Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gridstack

Package Overview
Dependencies
Maintainers
3
Versions
111
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gridstack - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

2

dist/gridstack-poly.js

@@ -1,2 +0,2 @@

/** gridstack.js 1.2.0 - IE and older browsers Polyfills for this library @preserve*/
/** gridstack.js 1.2.1 - IE and older browsers Polyfills for this library @preserve*/
/**

@@ -3,0 +3,0 @@ * https://gridstackjs.com/

@@ -1,3 +0,3 @@

/** gridstack.js 1.2.0 - IE and older browsers Polyfills for this library @preserve*/
/** gridstack.js 1.2.1 - IE and older browsers Polyfills for this library @preserve*/
"function"!=typeof window.CustomEvent&&(window.CustomEvent=function(e,t){t=t||{bubbles:!1,cancelable:!1,detail:null};var r=document.createEvent("CustomEvent");return r.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),r}),Number.isNaN=Number.isNaN||function(e){return"number"==typeof e&&e!=e},Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(e){if(null==this)throw TypeError('"this" is null or not defined');var t=Object(this),r=t.length>>>0;if("function"!=typeof e)throw TypeError("predicate must be a function");for(var n=arguments[1],o=0;o<r;){var i=t[o];if(e.call(n,i,o,t))return i;o++}},configurable:!0,writable:!0}),Array.prototype.findIndex||Object.defineProperty(Array.prototype,"findIndex",{value:function(e){if(null==this)throw new TypeError('"this" is null or not defined');var t=Object(this),r=t.length>>>0;if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var n=arguments[1],o=0;o<r;){var i=t[o];if(e.call(n,i,o,t))return o;o++}return-1},configurable:!0,writable:!0});
//# sourceMappingURL=gridstack.min.map

@@ -1,2 +0,2 @@

// Type definitions for Gridstack 1.2.0
// Type definitions for Gridstack 1.2.1
// Project: https://gridstackjs.com/

@@ -3,0 +3,0 @@ // Definitions by: Pascal Senn <https://github.com/PascalSenn>

@@ -1,2 +0,2 @@

/** gridstack.js 1.2.0 - JQuery UI Drag&Drop plugin @preserve */
/** gridstack.js 1.2.1 - JQuery UI Drag&Drop plugin @preserve */
/**

@@ -8,3 +8,2 @@ * https://gridstackjs.com/

(function(factory) {
/* we compile this in so no need for required loading
if (typeof define === 'function' && define.amd) {

@@ -16,3 +15,3 @@ define(['jquery', 'gridstack', 'exports'], factory);

factory(jQuery, gridstack.GridStack, exports);
} else */{
} else {
factory(jQuery, GridStack, window);

@@ -19,0 +18,0 @@ }

@@ -1,3 +0,3 @@

/** gridstack.js 1.2.0 - JQuery UI Drag&Drop plugin @preserve */
!function(){function t(t){e.DragDropPlugin.call(this,t)}var o,e,r;o=jQuery,e=GridStack,r=window,e.DragDropPlugin.registerPlugin(t),((t.prototype=Object.create(e.DragDropPlugin.prototype)).constructor=t).prototype.resizable=function(t,e){if(t=o(t),"disable"===e||"enable"===e||"destroy"===e)t.resizable(e);else if("option"===e){var r=arguments[2],i=arguments[3];t.resizable(e,r,i)}else{var n=t.data("gs-resize-handles")?t.data("gs-resize-handles"):this.grid.opts.resizable.handles;t.resizable(o.extend({},this.grid.opts.resizable,{handles:n},{start:e.start||function(){},stop:e.stop||function(){},resize:e.resize||function(){}}))}return this},t.prototype.draggable=function(t,e){return t=o(t),"disable"===e||"enable"===e||"destroy"===e?t.draggable(e):t.draggable(o.extend({},this.grid.opts.draggable,{containment:this.grid.opts.isNested&&!this.grid.opts.dragOut?this.grid.$el.parent():this.grid.opts.draggable.containment||null,start:e.start||function(){},stop:e.stop||function(){},drag:e.drag||function(){}})),this},t.prototype.droppable=function(t,e){return(t=o(t)).droppable(e),this},t.prototype.isDroppable=function(t,e){return t=o(t),Boolean(t.data("droppable"))},t.prototype.on=function(t,e,r){return o(t).on(e,r),this},r.JQueryUIGridStackDragDropPlugin=t}();
/** gridstack.js 1.2.1 - JQuery UI Drag&Drop plugin @preserve */
!function(e){if("function"==typeof define&&define.amd)define(["jquery","gridstack","exports"],e);else if("undefined"!=typeof exports){try{jQuery=require("jquery")}catch(e){}try{gridstack=require("gridstack")}catch(e){}e(jQuery,gridstack.GridStack,exports)}else e(jQuery,GridStack,window)}(function(o,t,e){function r(e){t.DragDropPlugin.call(this,e)}return t.DragDropPlugin.registerPlugin(r),((r.prototype=Object.create(t.DragDropPlugin.prototype)).constructor=r).prototype.resizable=function(e,t){if(e=o(e),"disable"===t||"enable"===t||"destroy"===t)e.resizable(t);else if("option"===t){var r=arguments[2],i=arguments[3];e.resizable(t,r,i)}else{var n=e.data("gs-resize-handles")?e.data("gs-resize-handles"):this.grid.opts.resizable.handles;e.resizable(o.extend({},this.grid.opts.resizable,{handles:n},{start:t.start||function(){},stop:t.stop||function(){},resize:t.resize||function(){}}))}return this},r.prototype.draggable=function(e,t){return e=o(e),"disable"===t||"enable"===t||"destroy"===t?e.draggable(t):e.draggable(o.extend({},this.grid.opts.draggable,{containment:this.grid.opts.isNested&&!this.grid.opts.dragOut?this.grid.$el.parent():this.grid.opts.draggable.containment||null,start:t.start||function(){},stop:t.stop||function(){},drag:t.drag||function(){}})),this},r.prototype.droppable=function(e,t){return(e=o(e)).droppable(t),this},r.prototype.isDroppable=function(e,t){return e=o(e),Boolean(e.data("droppable"))},r.prototype.on=function(e,t,r){return o(e).on(t,r),this},e.JQueryUIGridStackDragDropPlugin=r});
//# sourceMappingURL=gridstack.min.map
/**
* gridstack.js 1.2.0
* gridstack.js 1.2.1
* https://gridstackjs.com/

@@ -8,3 +8,3 @@ * (c) 2014-2020 Alain Dumesny, Dylan Weiss, Pavel Reznikov

*/
!function(f,t){var e=function(t,e,i,o){var n=function(){console.warn("gridstack.js: Function `"+e+"` is deprecated in "+o+" and has been replaced "+"with `"+i+"`. It will be **completely** removed in v1.0");return t.apply(this,arguments)};n.prototype=t.prototype;return n},l=function(t,e,i,o){if(t[e]!==undefined){t[i]=t[e];console.warn("gridstack.js: Option `"+e+"` is deprecated in "+o+" and has been replaced with `"+i+"`. It will be **completely** removed in v1.0")}},g=function(t,e,i,o){if(t[e]!==undefined){console.warn("gridstack.js: Option `"+e+"` is deprecated in "+i+o)}},m=function(t,e,i,o){var n=t.attr(e);if(n!==undefined){t.attr(i,n);console.warn("gridstack.js: attribute `"+e+"`="+n+" is deprecated on this object in "+o+" and has been replaced with `"+i+"`. It will be **completely** removed in v1.0")}},v={isIntercepted:function(t,e){return!(t.x+t.width<=e.x||e.x+e.width<=t.x||t.y+t.height<=e.y||e.y+e.height<=t.y)},sort:function(t,e,i){if(!i){var o=t.map(function(t){return t.x+t.width});i=Math.max.apply(Math,o)}if(e===-1)return v.sortBy(t,function(t){return-(t.x+t.y*i)});else return v.sortBy(t,function(t){return t.x+t.y*i})},createStylesheet:function(t,e){var i=document.createElement("style");i.setAttribute("type","text/css");i.setAttribute("data-gs-style-id",t);if(i.styleSheet){i.styleSheet.cssText=""}else{i.appendChild(document.createTextNode(""))}if(!e){e=document.getElementsByTagName("head")[0]}e.insertBefore(i,e.firstChild);return i.sheet},removeStylesheet:function(t){f("STYLE[data-gs-style-id="+t+"]").remove()},insertCSSRule:function(t,e,i,o){if(typeof t.insertRule==="function"){t.insertRule(e+"{"+i+"}",o)}else if(typeof t.addRule==="function"){t.addRule(e,i,o)}},toBool:function(t){if(typeof t==="boolean"){return t}if(typeof t==="string"){t=t.toLowerCase();return!(t===""||t==="no"||t==="false"||t==="0")}return Boolean(t)},_collisionNodeCheck:function(t){return t!==this.node&&v.isIntercepted(t,this.nn)},_didCollide:function(t){return v.isIntercepted({x:this.n.x,y:this.newY,width:this.n.width,height:this.n.height},t)},_isAddNodeIntercepted:function(t){return v.isIntercepted({x:this.x,y:this.y,width:this.node.width,height:this.node.height},t)},parseHeight:function(t){var e=t;var i="px";if(e&&typeof e==="string"){var o=e.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%)?$/);if(!o){throw new Error("Invalid height")}i=o[2]||"px";e=parseFloat(o[1])}return{height:e,unit:i}},without:function(t,e){var i=t.indexOf(e);if(i!==-1){t=t.slice(0);t.splice(i,1)}return t},sortBy:function(t,n){return t.slice(0).sort(function(t,e){var i=n(t);var o=n(e);if(o===i){return 0}return i>o?1:-1})},defaults:function(i){var t=Array.prototype.slice.call(arguments,1);t.forEach(function(t){for(var e in t){if(Object.prototype.hasOwnProperty.call(t,e)&&(!Object.prototype.hasOwnProperty.call(i,e)||i[e]===undefined)){i[e]=t[e]}}});return i},clone:function(t){return f.extend({},t)},throttle:function(t,e){var i=false;return function(){if(!i){t.apply(this,arguments);i=true;setTimeout(function(){i=false},e)}}},removePositioningStyles:function(t){var e=t[0].style;if(e.position){e.removeProperty("position")}if(e.left){e.removeProperty("left")}if(e.top){e.removeProperty("top")}if(e.width){e.removeProperty("width")}if(e.height){e.removeProperty("height")}},getScrollParent:function(t){var e;if(t===null){e=null}else if(t.scrollHeight>t.clientHeight){e=t}else{e=v.getScrollParent(t.parentNode)}return e},updateScrollPosition:function(t,e,i){var o=t.getBoundingClientRect();var n=window.innerHeight||document.documentElement.clientHeight;if(o.top<0||o.bottom>n){var s=o.bottom-n;var a=o.top;var r=v.getScrollParent(t);if(r!==null){var d=r.scrollTop;if(o.top<0&&i<0){if(t.offsetHeight>n){r.scrollTop+=i}else{r.scrollTop+=Math.abs(a)>Math.abs(i)?i:a}}else if(i>0){if(t.offsetHeight>n){r.scrollTop+=i}else{r.scrollTop+=s>i?i:s}}e.position.top+=r.scrollTop-d}}}};function _(t){this.grid=t}_.registeredPlugins=[],_.registerPlugin=function(t){_.registeredPlugins.push(t)},_.prototype.resizable=function(t,e){return this},_.prototype.draggable=function(t,e){return this},_.prototype.droppable=function(t,e){return this},_.prototype.isDroppable=function(t){return false},_.prototype.on=function(t,e,i){return this};var s=0,y=function(t,e,i,o,n){this.column=t||12;this.float=i||false;this.maxRow=o||0;this.nodes=n||[];this.onchange=e||function(){};this._addedNodes=[];this._removedNodes=[];this._batchMode=false};y.prototype.batchUpdate=function(){if(this._batchMode)return;this._batchMode=true;this._prevFloat=this.float;this.float=true},y.prototype.commit=function(){if(!this._batchMode)return;this._batchMode=false;this.float=this._prevFloat;delete this._prevFloat;this._packNodes();this._notify()},y.prototype.getNodeDataByDOMEl=function(e){return this.nodes.find(function(t){return e===t.el})},y.prototype._fixCollisions=function(t){var e=this;this._sortNodes(-1);var i=t;var o=Boolean(this.nodes.find(function(t){return t.locked}));if(!this.float&&!o){i={x:0,y:t.y,width:this.column,height:t.height}}while(true){var n=this.nodes.find(v._collisionNodeCheck,{node:t,nn:i});if(!n){return}var s;if(n.locked){s=this.moveNode(t,t.x,n.y+n.height,t.width,t.height,true)}else{s=this.moveNode(n,n.x,t.y+t.height,n.width,n.height,true)}if(!s){return}}},y.prototype.isAreaEmpty=function(t,e,i,o){var n={x:t||0,y:e||0,width:i||1,height:o||1};var s=this.nodes.find(function(t){return v.isIntercepted(t,n)});return!s},y.prototype._sortNodes=function(t){this.nodes=v.sort(this.nodes,t,this.column)},y.prototype._packNodes=function(){this._sortNodes();if(this.float){this.nodes.forEach(function(t,e){if(t._updating||t._packY===undefined||t.y===t._packY){return}var i=t.y;while(i>=t._packY){var o=this.nodes.slice(0,e).find(v._didCollide,{n:t,newY:i});if(!o){t._dirty=true;t.y=i}--i}},this)}else{this.nodes.forEach(function(t,e){if(t.locked){return}while(t.y>0){var i=t.y-1;var o=e===0;if(e>0){var n=this.nodes.slice(0,e).find(v._didCollide,{n:t,newY:i});o=n===undefined}if(!o){break}t._dirty=t.y!==i;t.y=i}},this)}},y.prototype._prepareNode=function(t,e){t=t||{};if(t.x===undefined||t.y===undefined||t.x===null||t.y===null){t.autoPosition=true}var i={width:1,height:1,x:0,y:0};t=v.defaults(t,i);t.x=parseInt(t.x);t.y=parseInt(t.y);t.width=parseInt(t.width);t.height=parseInt(t.height);t.autoPosition=t.autoPosition||false;t.noResize=t.noResize||false;t.noMove=t.noMove||false;if(Number.isNaN(t.x)){t.x=i.x;t.autoPosition=true}if(Number.isNaN(t.y)){t.y=i.y;t.autoPosition=true}if(Number.isNaN(t.width)){t.width=i.width}if(Number.isNaN(t.height)){t.height=i.height}if(t.maxWidth!==undefined){t.width=Math.min(t.width,t.maxWidth)}if(t.maxHeight!==undefined){t.height=Math.min(t.height,t.maxHeight)}if(t.minWidth!==undefined){t.width=Math.max(t.width,t.minWidth)}if(t.minHeight!==undefined){t.height=Math.max(t.height,t.minHeight)}if(t.width>this.column){t.width=this.column}else if(t.width<1){t.width=1}if(this.maxRow&&t.height>this.maxRow){t.height=this.maxRow}else if(t.height<1){t.height=1}if(t.x<0){t.x=0}if(t.y<0){t.y=0}if(t.x+t.width>this.column){if(e){t.width=this.column-t.x}else{t.x=this.column-t.width}}if(this.maxRow&&t.y+t.height>this.maxRow){if(e){t.height=this.maxRow-t.y}else{t.y=this.maxRow-t.height}}return t},y.prototype._notify=function(){if(this._batchMode){return}var t=Array.prototype.slice.call(arguments,0);t[0]=t[0]===undefined?[]:Array.isArray(t[0])?t[0]:[t[0]];t[1]=t[1]===undefined?true:t[1];var e=t[0].concat(this.getDirtyNodes());this.onchange(e,t[1])},y.prototype.cleanNodes=function(){if(this._batchMode){return}this.nodes.forEach(function(t){delete t._dirty})},y.prototype.getDirtyNodes=function(t){if(t){var e=[];this.nodes.forEach(function(t){if(t._dirty){if(t.y===t._origY&&t.x===t._origX&&t.width===t._origW&&t.height===t._origH){delete t._dirty}else{e.push(t)}}});return e}return this.nodes.filter(function(t){return t._dirty})},y.prototype.addNode=function(t,e){t=this._prepareNode(t);t._id=t._id||++s;if(t.autoPosition){this._sortNodes();for(var i=0;;++i){var o=i%this.column;var n=Math.floor(i/this.column);if(o+t.width>this.column){continue}if(!this.nodes.find(v._isAddNodeIntercepted,{x:o,y:n,node:t})){t.x=o;t.y=n;delete t.autoPosition;break}}}this.nodes.push(t);if(e){this._addedNodes.push(t)}this._fixCollisions(t);this._packNodes();this._notify();return t},y.prototype.removeNode=function(t,e){e=e===undefined?true:e;this._removedNodes.push(t);t._id=null;this.nodes=v.without(this.nodes,t);this._packNodes();this._notify(t,e)},y.prototype.removeAll=function(t){delete this._layouts;if(this.nodes.length===0){return}t=t===undefined?true:t;this.nodes.forEach(function(t){t._id=null});this._removedNodes=this.nodes;this.nodes=[];this._notify(this._removedNodes,t)},y.prototype.canMoveNode=function(e,t,i,o,n){if(!this.isNodeChangedPosition(e,t,i,o,n)){return false}var s=Boolean(this.nodes.find(function(t){return t.locked}));if(!this.maxRow&&!s){return true}var a;var r=new y(this.column,null,this.float,0,this.nodes.map(function(t){if(t===e){a=f.extend({},t);return a}return f.extend({},t)}));if(!a){return true}r.moveNode(a,t,i,o,n);var d=true;if(s){d&=!Boolean(r.nodes.find(function(t){return t!==a&&Boolean(t.locked)&&Boolean(t._dirty)}))}if(this.maxRow){d&=r.getRow()<=this.maxRow}return d},y.prototype.canBePlacedWithRespectToHeight=function(t){if(!this.maxRow){return true}var e=new y(this.column,null,this.float,0,this.nodes.map(function(t){return f.extend({},t)}));e.addNode(t);return e.getRow()<=this.maxRow},y.prototype.isNodeChangedPosition=function(t,e,i,o,n){if(typeof e!=="number"){e=t.x}if(typeof i!=="number"){i=t.y}if(typeof o!=="number"){o=t.width}if(typeof n!=="number"){n=t.height}if(t.maxWidth!==undefined){o=Math.min(o,t.maxWidth)}if(t.maxHeight!==undefined){n=Math.min(n,t.maxHeight)}if(t.minWidth!==undefined){o=Math.max(o,t.minWidth)}if(t.minHeight!==undefined){n=Math.max(n,t.minHeight)}if(t.x===e&&t.y===i&&t.width===o&&t.height===n){return false}return true},y.prototype.moveNode=function(t,e,i,o,n,s){if(t.locked){return null}if(typeof e!=="number"){e=t.x}if(typeof i!=="number"){i=t.y}if(typeof o!=="number"){o=t.width}if(typeof n!=="number"){n=t.height}var a=t.width!==o||t.height!==n;var r={x:e,y:i,width:o,height:n,maxWidth:t.maxWidth,maxHeight:t.maxHeight,minWidth:t.minWidth,minHeight:t.minHeight};r=this._prepareNode(r,a);if(t.x===r.x&&t.y===r.y&&t.width===r.width&&t.height===r.height){return null}t._dirty=true;t.x=t.lastTriedX=r.x;t.y=t.lastTriedY=r.y;t.width=t.lastTriedWidth=r.width;t.height=t.lastTriedHeight=r.height;this._fixCollisions(t);if(!s){this._packNodes();this._notify()}return t},y.prototype.getRow=function(){return this.nodes.reduce(function(t,e){return Math.max(t,e.y+e.height)},0)},y.prototype.beginUpdate=function(t){if(t._updating)return;t._updating=true;this.nodes.forEach(function(t){t._packY=t.y})},y.prototype.endUpdate=function(){var t=this.nodes.find(function(t){return t._updating});if(t){t._updating=false;this.nodes.forEach(function(t){delete t._packY})}};var n=function(t,e){var u=this;var i,o,n;e=e||{};this.$el=f(t);this.el=this.$el.get(0);l(e,"width","column","v0.5.3");l(e,"height","maxRow","v0.5.3");g(e,"oneColumnModeClass","v0.6.3",". Use class `.grid-stack-1` instead");m(this.$el,"data-gs-width","data-gs-column","v0.5.3");m(this.$el,"data-gs-height","data-gs-max-row","v0.5.3");m(this.$el,"data-gs-current-height","data-gs-current-row","v1.0.0");e.itemClass=e.itemClass||"grid-stack-item";var s=this.$el.closest("."+e.itemClass).length>0;if(e.row){e.minRow=e.maxRow=e.row;delete e.row}var a=parseInt(this.$el.attr("data-gs-row"));this.opts=v.defaults(e,{column:parseInt(this.$el.attr("data-gs-column"))||12,minRow:a?a:parseInt(this.$el.attr("data-gs-min-row"))||0,maxRow:a?a:parseInt(this.$el.attr("data-gs-max-row"))||0,itemClass:"grid-stack-item",placeholderClass:"grid-stack-placeholder",placeholderText:"",handle:".grid-stack-item-content",handleClass:null,styleInHead:false,cellHeight:60,verticalMargin:20,auto:true,minWidth:768,float:false,staticGrid:false,_class:"grid-stack-instance-"+(Math.random()*1e4).toFixed(0),animate:Boolean(this.$el.attr("data-gs-animate"))||false,alwaysShowResizeHandle:e.alwaysShowResizeHandle||false,resizable:v.defaults(e.resizable||{},{autoHide:!(e.alwaysShowResizeHandle||false),handles:"se"}),draggable:v.defaults(e.draggable||{},{handle:(e.handleClass?"."+e.handleClass:e.handle?e.handle:"")||".grid-stack-item-content",scroll:false,appendTo:"body"}),disableDrag:e.disableDrag||false,disableResize:e.disableResize||false,rtl:"auto",removable:false,removableOptions:v.defaults(e.removableOptions||{},{accept:"."+e.itemClass}),removeTimeout:2e3,verticalMarginUnit:"px",cellHeightUnit:"px",disableOneColumnMode:e.disableOneColumnMode||false,oneColumnModeDomSort:e.oneColumnModeDomSort,ddPlugin:null});if(this.opts.ddPlugin===false){this.opts.ddPlugin=_}else if(this.opts.ddPlugin===null){this.opts.ddPlugin=_.registeredPlugins[0]||_}this.dd=new this.opts.ddPlugin(this);if(this.opts.rtl==="auto"){this.opts.rtl=this.$el.css("direction")==="rtl"}if(this.opts.rtl){this.$el.addClass("grid-stack-rtl")}this.opts.isNested=s;n=this.opts.cellHeight==="auto";if(n){u.cellHeight(u.cellWidth(),true)}else{this.cellHeight(this.opts.cellHeight,true)}this.verticalMargin(this.opts.verticalMargin,true);this.$el.addClass(this.opts._class);this._setStaticClass();if(s){this.$el.addClass("grid-stack-nested")}this._initStyles();this.engine=new y(this.opts.column,function(t,e){e=e===undefined?true:e;var i=0;this.nodes.forEach(function(t){i=Math.max(i,t.y+t.height)});t.forEach(function(t){if(e&&t._id===null){if(t.el){f(t.el).remove()}}else{f(t.el).attr("data-gs-x",t.x).attr("data-gs-y",t.y).attr("data-gs-width",t.width).attr("data-gs-height",t.height)}});u._updateStyles(i+10)},this.opts.float,this.opts.maxRow);if(this.opts.auto){var r=[];var d=this;this.$el.children("."+this.opts.itemClass+":not(."+this.opts.placeholderClass+")").each(function(t,e){e=f(e);var i=parseInt(e.attr("data-gs-x"));var o=parseInt(e.attr("data-gs-y"));r.push({el:e.get(0),i:(Number.isNaN(i)?1e3:i)+(Number.isNaN(o)?1e3:o)*d.opts.column})});v.sortBy(r,function(t){return t.i}).forEach(function(t){this._prepareElement(t.el)},this)}this.engine._saveInitial();this.setAnimation(this.opts.animate);this.placeholder=f('<div class="'+this.opts.placeholderClass+" "+this.opts.itemClass+'">'+'<div class="placeholder-content">'+this.opts.placeholderText+"</div></div>").hide();this._updateContainerHeight();this._updateHeightsOnResize=v.throttle(function(){u.cellHeight(u.cellWidth(),false)},100);this.onResizeHandler=function(){if(n){u._updateHeightsOnResize()}if(!u.opts.disableOneColumnMode&&(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<=u.opts.minWidth){if(u.oneColumnMode){return}u.oneColumnMode=true;u.column(1)}else{if(!u.oneColumnMode){return}u.oneColumnMode=false;u.column(u._prevColumn)}};f(window).resize(this.onResizeHandler);this.onResizeHandler();if(!u.opts.staticGrid&&typeof u.opts.removable==="string"){var h=f(u.opts.removable);if(!this.dd.isDroppable(h)){this.dd.droppable(h,u.opts.removableOptions)}this.dd.on(h,"dropover",function(t,e){var i=f(e.draggable);var o=i.data("_gridstack_node");if(!o||o._grid!==u){return}i.data("inTrashZone",true);u._setupRemovingTimeout(i)}).on(h,"dropout",function(t,e){var i=f(e.draggable);var o=i.data("_gridstack_node");if(!o||o._grid!==u){return}i.data("inTrashZone",false);u._clearRemovingTimeout(i)})}if(!u.opts.staticGrid&&u.opts.acceptWidgets){var c=null;var p=function(t,e){var i=c;var o=i.data("_gridstack_node");var n=u.getCellFromPixel({left:t.pageX,top:t.pageY},true);var s=Math.max(0,n.x);var a=Math.max(0,n.y);if(!o._added){o._added=true;o.el=i.get(0);o.autoPosition=true;o.x=s;o.y=a;u.engine.cleanNodes();u.engine.beginUpdate(o);u.engine.addNode(o);u.$el.append(u.placeholder);u.placeholder.attr("data-gs-x",o.x).attr("data-gs-y",o.y).attr("data-gs-width",o.width).attr("data-gs-height",o.height).show();o.el=u.placeholder.get(0);o._beforeDragX=o.x;o._beforeDragY=o.y;u._updateContainerHeight()}if(!u.engine.canMoveNode(o,s,a)){return}u.engine.moveNode(o,s,a);u._updateContainerHeight()};this.dd.droppable(u.$el,{accept:function(t){t=f(t);var e=t.data("_gridstack_node");if(e&&e._grid===u){return false}return t.is(u.opts.acceptWidgets===true?".grid-stack-item":u.opts.acceptWidgets)}}).on(u.$el,"dropover",function(t,e){var i=f(e.draggable);var o,n;var s=i.data("_gridstack_node");if(!s||!s.width||!s.height){var a=parseInt(i.attr("data-gs-width"));if(a>0){s=s||{};s.width=a}var r=parseInt(i.attr("data-gs-height"));if(r>0){s=s||{};s.height=r}}var d=u.cellWidth();var h=u.cellHeight();var l=u.opts.verticalMargin;o=s&&s.width?s.width:Math.ceil(i.outerWidth()/d);n=s&&s.height?s.height:Math.round((i.outerHeight()+l)/(h+l));c=i;var g=u.engine._prepareNode({width:o,height:n,_added:false,_temporary:true});g.isOutOfGrid=true;i.data("_gridstack_node",g);i.data("_gridstack_node_orig",s);i.on("drag",p);return false}).on(u.$el,"dropout",function(t,e){var i=f(e.draggable);if(!i.data("_gridstack_node")){return}var o=i.data("_gridstack_node");if(!o.isOutOfGrid){return}i.unbind("drag",p);o.el=null;u.engine.removeNode(o);u.placeholder.detach();u._updateContainerHeight();i.data("_gridstack_node",i.data("_gridstack_node_orig"));return false}).on(u.$el,"drop",function(t,e){u.placeholder.detach();var i=f(e.draggable).data("_gridstack_node");i.isOutOfGrid=false;i._grid=u;var o=f(e.draggable).clone(false);o.data("_gridstack_node",i);var n=f(e.draggable).data("_gridstack_node_orig");if(n!==undefined&&n._grid!==undefined){n._grid._triggerRemoveEvent()}f(e.helper).remove();i.el=o.get(0);u.placeholder.hide();v.removePositioningStyles(o);o.find("div.ui-resizable-handle").remove();o.attr("data-gs-x",i.x).attr("data-gs-y",i.y).attr("data-gs-width",i.width).attr("data-gs-height",i.height).addClass(u.opts.itemClass).enableSelection().removeData("draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled").unbind("drag",p);u.$el.append(o);u._prepareElementsByNode(o,i);u._updateContainerHeight();u.engine._addedNodes.push(i);u._triggerAddEvent();u._triggerChangeEvent();u.engine.endUpdate();f(e.draggable).unbind("drag",p);f(e.draggable).removeData("_gridstack_node");f(e.draggable).removeData("_gridstack_node_orig");u.$el.trigger("dropped",[n,i]);return false})}};n.prototype._triggerChangeEvent=function(){if(!this.engine._batchMode){var t=this.engine.getDirtyNodes(!0);t&&t.length&&(this.engine._layoutsNodesChange(t),this._triggerEvent("change",t)),this.engine._saveInitial()}},n.prototype._triggerAddEvent=function(){this.engine._batchMode||this.engine._addedNodes&&0<this.engine._addedNodes.length&&(this.engine._layoutsNodesChange(this.engine._addedNodes),this.engine._addedNodes.forEach(function(t){delete t._dirty}),this._triggerEvent("added",this.engine._addedNodes),this.engine._addedNodes=[])},n.prototype._triggerRemoveEvent=function(){this.engine._batchMode||this.engine._removedNodes&&0<this.engine._removedNodes.length&&(this._triggerEvent("removed",this.engine._removedNodes),this.engine._removedNodes=[])},n.prototype._triggerEvent=function(t,e){var i=new CustomEvent(t,{detail:e});this.el.dispatchEvent(i)},n.prototype._initStyles=function(){this._stylesId&&v.removeStylesheet(this._stylesId),this._stylesId="gridstack-style-"+(1e5*Math.random()).toFixed();var t=this.opts.styleInHead?void 0:this.el.parentNode;this._styles=v.createStylesheet(this._stylesId,t),null!==this._styles&&(this._styles._max=0)},n.prototype._updateStyles=function(t){if(null!==this._styles&&void 0!==this._styles){var e,i="."+this.opts._class+" ."+this.opts.itemClass,o=this;if(void 0===t&&(t=this._styles._max),this._initStyles(),this._updateContainerHeight(),this.opts.cellHeight&&!(0!==this._styles._max&&t<=this._styles._max)&&(e=this.opts.verticalMargin&&this.opts.cellHeightUnit!==this.opts.verticalMarginUnit?function(t,e){return t&&e?"calc("+(o.opts.cellHeight*t+o.opts.cellHeightUnit)+" + "+(o.opts.verticalMargin*e+o.opts.verticalMarginUnit)+")":o.opts.cellHeight*t+o.opts.verticalMargin*e+o.opts.cellHeightUnit}:function(t,e){return o.opts.cellHeight*t+o.opts.verticalMargin*e+o.opts.cellHeightUnit},0===this._styles._max&&v.insertCSSRule(this._styles,i,"min-height: "+e(1,0)+";",0),t>this._styles._max)){for(var n=this._styles._max;n<t;++n)v.insertCSSRule(this._styles,i+'[data-gs-height="'+(n+1)+'"]',"height: "+e(n+1,n)+";",n),v.insertCSSRule(this._styles,i+'[data-gs-min-height="'+(n+1)+'"]',"min-height: "+e(n+1,n)+";",n),v.insertCSSRule(this._styles,i+'[data-gs-max-height="'+(n+1)+'"]',"max-height: "+e(n+1,n)+";",n),v.insertCSSRule(this._styles,i+'[data-gs-y="'+n+'"]',"top: "+e(n,n)+";",n);this._styles._max=t}}},n.prototype._updateContainerHeight=function(){if(!this.engine._batchMode){var t=this.engine.getRow();t<this.opts.minRow&&(t=this.opts.minRow);var e=parseInt(this.$el.css("min-height"));if(0<e){var i=this.opts.verticalMargin,o=Math.round((e+i)/(this.cellHeight()+i));t<o&&(t=o)}this.$el.attr("data-gs-current-row",t),this.opts.cellHeight&&(this.opts.verticalMargin?this.opts.cellHeightUnit===this.opts.verticalMarginUnit?this.$el.css("height",t*(this.opts.cellHeight+this.opts.verticalMargin)-this.opts.verticalMargin+this.opts.cellHeightUnit):this.$el.css("height","calc("+(t*this.opts.cellHeight+this.opts.cellHeightUnit)+" + "+(t*(this.opts.verticalMargin-1)+this.opts.verticalMarginUnit)+")"):this.$el.css("height",t*this.opts.cellHeight+this.opts.cellHeightUnit))}},n.prototype._setupRemovingTimeout=function(t){var e=f(t).data("_gridstack_node");!e._removeTimeout&&this.opts.removable&&(e._removeTimeout=setTimeout(function(){t.addClass("grid-stack-item-removing"),e._isAboutToRemove=!0},this.opts.removeTimeout))},n.prototype._clearRemovingTimeout=function(t){var e=f(t).data("_gridstack_node");e._removeTimeout&&(clearTimeout(e._removeTimeout),e._removeTimeout=null,t.removeClass("grid-stack-item-removing"),e._isAboutToRemove=!1)},n.prototype._prepareElementsByNode=function(h,l){function t(t,e){var i,o,n=Math.round(e.position.left/g),s=Math.floor((e.position.top+u/2)/u);if("drag"===t.type){var a=e.position.top-l._prevYPix;if(l._prevYPix=e.position.top,v.updateScrollPosition(h[0],e,a),h.data("inTrashZone")||n<0||n>=c.engine.column||s<0||!c.engine.float&&s>c.engine.getRow()){if(l._temporaryRemoved)return;!0===c.opts.removable&&c._setupRemovingTimeout(h),n=l._beforeDragX,s=l._beforeDragY,c.placeholder.detach(),c.placeholder.hide(),c.engine.removeNode(l),c._updateContainerHeight(),l._temporaryRemoved=!0}else c._clearRemovingTimeout(h),l._temporaryRemoved&&(c.engine.addNode(l),c.placeholder.attr("data-gs-x",n).attr("data-gs-y",s).attr("data-gs-width",i).attr("data-gs-height",o).show(),c.$el.append(c.placeholder),l.el=c.placeholder.get(0),l._temporaryRemoved=!1)}else if("resize"===t.type){if(n<0)return;i=Math.round(e.size.width/g),o=Math.round((e.size.height+c.verticalMargin())/u)}var r=void 0!==i?i:l.lastTriedWidth,d=void 0!==o?o:l.lastTriedHeight;!c.engine.canMoveNode(l,n,s,i,o)||l.lastTriedX===n&&l.lastTriedY===s&&l.lastTriedWidth===r&&l.lastTriedHeight===d||(l.lastTriedX=n,l.lastTriedY=s,l.lastTriedWidth=i,l.lastTriedHeight=o,c.engine.moveNode(l,n,s,i,o),c._updateContainerHeight(),"resize"===t.type&&f(t.target).trigger("gsresize",l))}function e(t,e){c.$el.append(c.placeholder);var i=f(this);c.engine.cleanNodes(),c.engine.beginUpdate(l),g=c.cellWidth();var o=c.cellHeight();u=(c.$el.height()+c.verticalMargin())/parseInt(c.$el.attr("data-gs-current-row")),c.placeholder.attr("data-gs-x",i.attr("data-gs-x")).attr("data-gs-y",i.attr("data-gs-y")).attr("data-gs-width",i.attr("data-gs-width")).attr("data-gs-height",i.attr("data-gs-height")).show(),l.el=c.placeholder.get(0),l._beforeDragX=l.x,l._beforeDragY=l.y,l._prevYPix=e.position.top;var n=l.minHeight||1,s=c.opts.verticalMargin;c.dd.resizable(h,"option","minWidth",g*(l.minWidth||1)),c.dd.resizable(h,"option","minHeight",o*n+(n-1)*s),"resizestart"===t.type&&i.find(".grid-stack-item").trigger("resizestart")}function i(t,e){var i=f(this);if(i.data("_gridstack_node")){if(c.placeholder.detach(),l.el=i.get(0),c.placeholder.hide(),l._isAboutToRemove)h.data("_gridstack_node")._grid._triggerRemoveEvent(),h.removeData("_gridstack_node"),h.remove();else c._clearRemovingTimeout(h),l._temporaryRemoved?(v.removePositioningStyles(i),i.attr("data-gs-x",l._beforeDragX).attr("data-gs-y",l._beforeDragY).attr("data-gs-width",l.width).attr("data-gs-height",l.height),l.x=l._beforeDragX,l.y=l._beforeDragY,l._temporaryRemoved=!1,c.engine.addNode(l)):(v.removePositioningStyles(i),i.attr("data-gs-x",l.x).attr("data-gs-y",l.y).attr("data-gs-width",l.width).attr("data-gs-height",l.height));c._updateContainerHeight(),c._triggerChangeEvent(),c.engine.endUpdate();var o=i.find(".grid-stack");o.length&&"resizestop"===t.type&&(o.each(function(t,e){e.gridstack.onResizeHandler()}),i.find(".grid-stack-item").trigger("resizestop"),i.find(".grid-stack-item").trigger("gsresizestop")),"resizestop"===t.type&&c.$el.trigger("gsresizestop",i)}}var g,u,c=this;this.dd.draggable(h,{start:e,stop:i,drag:t}).resizable(h,{start:e,stop:i,resize:t}),(l.noMove||this.opts.disableDrag||this.opts.staticGrid)&&this.dd.draggable(h,"disable"),(l.noResize||this.opts.disableResize||this.opts.staticGrid)&&this.dd.resizable(h,"disable"),this._writeAttr(h,l)},n.prototype._prepareElement=function(t,e){e=void 0!==e&&e;(t=f(t)).addClass(this.opts.itemClass);var i=this._readAttr(t,{el:t.get(0),_grid:this});i=this.engine.addNode(i,e),t.data("_gridstack_node",i),this._prepareElementsByNode(t,i)},n.prototype._writeAttr=function(t,e){e&&(t=f(t),void 0!==e.x&&t.attr("data-gs-x",e.x),void 0!==e.y&&t.attr("data-gs-y",e.y),void 0!==e.width&&t.attr("data-gs-width",e.width),void 0!==e.height&&t.attr("data-gs-height",e.height),void 0!==e.autoPosition&&t.attr("data-gs-auto-position",!!e.autoPosition||null),void 0!==e.minWidth&&t.attr("data-gs-min-width",e.minWidth),void 0!==e.maxWidth&&t.attr("data-gs-max-width",e.maxWidth),void 0!==e.minHeight&&t.attr("data-gs-min-height",e.minHeight),void 0!==e.maxHeight&&t.attr("data-gs-max-height",e.maxHeight),void 0!==e.noResize&&t.attr("data-gs-no-resize",!!e.noResize||null),void 0!==e.noMove&&t.attr("data-gs-no-move",!!e.noMove||null),void 0!==e.locked&&t.attr("data-gs-locked",!!e.locked||null),void 0!==e.resizeHandles&&t.attr("data-gs-resize-handles",e.resizeHandles),void 0!==e.id&&t.attr("data-gs-id",e.id))},n.prototype._readAttr=function(t,e){return t=f(t),(e=e||{}).x=t.attr("data-gs-x"),e.y=t.attr("data-gs-y"),e.width=t.attr("data-gs-width"),e.height=t.attr("data-gs-height"),e.autoPosition=v.toBool(t.attr("data-gs-auto-position")),e.maxWidth=t.attr("data-gs-max-width"),e.minWidth=t.attr("data-gs-min-width"),e.maxHeight=t.attr("data-gs-max-height"),e.minHeight=t.attr("data-gs-min-height"),e.noResize=v.toBool(t.attr("data-gs-no-resize")),e.noMove=v.toBool(t.attr("data-gs-no-move")),e.locked=v.toBool(t.attr("data-gs-locked")),e.resizeHandles=t.attr("data-gs-resize-handles"),e.id=t.attr("data-gs-id"),e},n.prototype.setAnimation=function(t){t?this.$el.addClass("grid-stack-animate"):this.$el.removeClass("grid-stack-animate")},n.prototype.addWidget=function(t,e,i,o,n,s,a,r,d,h,l){if(void 0!==e&&"object"!=typeof e)return this.addWidget(t,{x:e,y:i,width:o,height:n,autoPosition:s,minWidth:a,maxWidth:r,minHeight:d,maxHeight:h,id:l});if(t=f(t),e){var g=this._readAttr(t);v.defaults(e,g),this.engine._prepareNode(e)}return this._writeAttr(t,e),this.$el.append(t),this.makeWidget(t)},n.prototype.makeWidget=function(t){return t=f(t),this._prepareElement(t,!0),this._updateContainerHeight(),this._triggerAddEvent(),this._triggerChangeEvent(!0),t.get(0)},n.prototype.willItFit=function(t,e,i,o,n){var s={x:t,y:e,width:i,height:o,autoPosition:n};return this.engine.canBePlacedWithRespectToHeight(s)},n.prototype.removeWidget=function(t,e){var i=(t=f(t)).data("_gridstack_node");(i=i||this.engine.getNodeDataByDOMEl(t.get(0)))&&i.el.parentElement===this.el&&(t.removeData("_gridstack_node"),this.dd.draggable(t,"destroy").resizable(t,"destroy"),this.engine.removeNode(i,e),this._triggerRemoveEvent(),this._triggerChangeEvent(!0))},n.prototype.removeAll=function(t){this.engine.nodes.forEach(function(t){var e=f(t.el);e.removeData("_gridstack_node"),this.dd.draggable(e,"destroy").resizable(e,"destroy")},this),this.engine.removeAll(t),this._triggerRemoveEvent()},n.prototype.destroy=function(t){f(window).off("resize",this.onResizeHandler),!1===t?(this.removeAll(!1),this.$el.removeClass(this.opts._class),delete this.$el.get(0).gridstack):this.$el.remove(),v.removeStylesheet(this._stylesId),this.engine&&(this.engine=null)},n.prototype.resizable=function(t,o){var n=this;return(t=f(t)).each(function(t,e){var i=(e=f(e)).data("_gridstack_node");i&&(i.noResize=!o,i.noResize?n.dd.resizable(e,"disable"):n.dd.resizable(e,"enable"))}),this},n.prototype.movable=function(t,o){var n=this;return(t=f(t)).each(function(t,e){var i=(e=f(e)).data("_gridstack_node");i&&(i.noMove=!o,i.noMove?(n.dd.draggable(e,"disable"),e.removeClass("ui-draggable-handle")):(n.dd.draggable(e,"enable"),e.addClass("ui-draggable-handle")))}),this},n.prototype.enableMove=function(t,e){this.movable(this.$el.children("."+this.opts.itemClass),t),e&&(this.opts.disableDrag=!t)},n.prototype.enableResize=function(t,e){this.resizable(this.$el.children("."+this.opts.itemClass),t),e&&(this.opts.disableResize=!t)},n.prototype.disable=function(){this.movable(this.$el.children("."+this.opts.itemClass),!1),this.resizable(this.$el.children("."+this.opts.itemClass),!1),this.$el.trigger("disable")},n.prototype.enable=function(){this.movable(this.$el.children("."+this.opts.itemClass),!0),this.resizable(this.$el.children("."+this.opts.itemClass),!0),this.$el.trigger("enable")},n.prototype.locked=function(t,o){return(t=f(t)).each(function(t,e){var i=(e=f(e)).data("_gridstack_node");i&&(i.locked=o||!1,e.attr("data-gs-locked",i.locked?"yes":null))}),this},n.prototype.maxHeight=function(t,o){return(t=f(t)).each(function(t,e){var i=(e=f(e)).data("_gridstack_node");i&&(isNaN(o)||(i.maxHeight=o||!1,e.attr("data-gs-max-height",o)))}),this},n.prototype.minHeight=function(t,o){return(t=f(t)).each(function(t,e){var i=(e=f(e)).data("_gridstack_node");i&&(isNaN(o)||(i.minHeight=o||!1,e.attr("data-gs-min-height",o)))}),this},n.prototype.maxWidth=function(t,o){return(t=f(t)).each(function(t,e){var i=(e=f(e)).data("_gridstack_node");i&&(isNaN(o)||(i.maxWidth=o||!1,e.attr("data-gs-max-width",o)))}),this},n.prototype.minWidth=function(t,o){return(t=f(t)).each(function(t,e){var i=(e=f(e)).data("_gridstack_node");i&&(isNaN(o)||(i.minWidth=o||!1,e.attr("data-gs-min-width",o)))}),this},n.prototype._updateElement=function(t,e){var i=(t=f(t).first()).data("_gridstack_node");if(i){var o=this;o.engine.cleanNodes(),o.engine.beginUpdate(i),e.call(this,t,i),o._updateContainerHeight(),o._triggerChangeEvent(),o.engine.endUpdate()}},n.prototype.resize=function(t,i,o){this._updateElement(t,function(t,e){i=null!=i?i:e.width,o=null!=o?o:e.height,this.engine.moveNode(e,e.x,e.y,i,o)})},n.prototype.move=function(t,i,o){this._updateElement(t,function(t,e){i=null!=i?i:e.x,o=null!=o?o:e.y,this.engine.moveNode(e,i,o,e.width,e.height)})},n.prototype.update=function(t,i,o,n,s){this._updateElement(t,function(t,e){i=null!=i?i:e.x,o=null!=o?o:e.y,n=null!=n?n:e.width,s=null!=s?s:e.height,this.engine.moveNode(e,i,o,n,s)})},n.prototype.compact=function(){if(0!==this.engine.nodes.length){this.batchUpdate(),this.engine._sortNodes();var t=this.engine.nodes;this.engine.nodes=[],t.forEach(function(t){t.noMove||t.locked||(t.autoPosition=!0),this.engine.addNode(t,!1),t._dirty=!0},this),this.commit()}},n.prototype.verticalMargin=function(t,e){if(void 0===t)return this.opts.verticalMargin;var i=v.parseHeight(t);this.opts.verticalMarginUnit===i.unit&&this.opts.maxRow===i.height||(this.opts.verticalMarginUnit=i.unit,this.opts.verticalMargin=i.height,e||this._updateStyles())},n.prototype.cellHeight=function(t,e){if(void 0===t){if(this.opts.cellHeight&&"auto"!==this.opts.cellHeight)return this.opts.cellHeight;var i=this.$el.children("."+this.opts.itemClass).first(),o=i.attr("data-gs-height"),n=this.opts.verticalMargin;return Math.round((i.outerHeight()-(o-1)*n)/o)}var s=v.parseHeight(t);this.opts.cellHeightUnit===s.unit&&this.opts.cellHeight===s.height||(this.opts.cellHeightUnit=s.unit,this.opts.cellHeight=s.height,e||this._updateStyles())},n.prototype.cellWidth=function(){return Math.round(this.$el.outerWidth()/this.opts.column)},n.prototype.getCellFromPixel=function(t,e){var i=void 0!==e&&e?this.$el.offset():this.$el.position(),o=t.left-i.left,n=t.top-i.top,s=Math.floor(this.$el.width()/this.opts.column),a=Math.floor(this.$el.height()/parseInt(this.$el.attr("data-gs-current-row")));return{x:Math.floor(o/s),y:Math.floor(n/a)}},n.prototype.batchUpdate=function(){this.engine.batchUpdate()},n.prototype.commit=function(){this.engine.commit(),this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent()},n.prototype.isAreaEmpty=function(t,e,i,o){return this.engine.isAreaEmpty(t,e,i,o)},n.prototype.setStatic=function(t){this.opts.staticGrid=!0===t,this.enableMove(!t),this.enableResize(!t),this._setStaticClass()},n.prototype._setStaticClass=function(){var t="grid-stack-static";!0===this.opts.staticGrid?this.$el.addClass(t):this.$el.removeClass(t)},y.prototype._layoutsNodesChange=function(t){this._layouts&&!this._ignoreLayoutsNodeChange&&this._layouts.forEach(function(o,n){o&&n!==this.column&&(n<this.column?this._layouts[n]=void 0:t.forEach(function(e){var t=o.find(function(t){return t._id===e._id});if(t){var i=n/this.column;e.y!==e._origY&&(t.y+=e.y-e._origY),e.x!==e._origX&&(t.x=Math.round(e.x*i)),e.width!==e._origW&&(t.width=Math.round(e.width*i))}},this))},this)},y.prototype._updateNodeWidths=function(e,i,o){if(this.nodes.length&&e!==i){var n=[this.nodes.length];if(this.nodes.forEach(function(t,e){n[e]={x:t.x,y:t.y,width:t.width,_id:t._id}}),this._layouts=this._layouts||[],this._layouts[e]=n,1===i&&o&&o.length){var s=0;o.forEach(function(t){t.x=0,t.width=1,t.y=Math.max(t.y,s),s=t.y+t.height})}else o=v.sort(this.nodes,-1,e);var t=this._layouts[i]||[],a=this._layouts.length-1;0===t.length&&e<i&&i<a&&(t=this._layouts[a]||[]).length&&(e=a,t.forEach(function(e){var t=o.findIndex(function(t){return t&&t._id===e._id});-1!==t&&(o[t].x=e.x,o[t].y=e.y,o[t].width=e.width)}),t=[]);var r=[];t.forEach(function(e){var t=o.findIndex(function(t){return t&&t._id===e._id});-1!==t&&(o[t].x=e.x,o[t].y=e.y,o[t].width=e.width,r.push(o[t]),o[t]=null)});var d=i/e;o.forEach(function(t){t&&(t.x=1===i?0:Math.round(t.x*d),t.width=1!==i&&1!==e&&Math.round(t.width*d)||1,r.push(t))}),r=v.sort(r,-1,i),this._ignoreLayoutsNodeChange=!0,this.batchUpdate(),this.nodes=[],r.forEach(function(t){this.addNode(t,!1),t._dirty=!0},this),this.commit(),delete this._ignoreLayoutsNodeChange}},y.prototype._saveInitial=function(){this.nodes.forEach(function(t){t._origX=t.x,t._origY=t.y,t._origW=t.width,t._origH=t.height,delete t._dirty})},n.prototype.column=function(t,e){if(void 0===t)return this.opts.column;if(this.opts.column!==t){var o,i=this.opts.column;if(1===t?this._prevColumn=i:delete this._prevColumn,this.$el.removeClass("grid-stack-"+i),this.$el.addClass("grid-stack-"+t),this.opts.column=this.engine.column=t,!0!==e)this.opts.oneColumnModeDomSort&&1===t&&(o=[],this.$el.children("."+this.opts.itemClass).each(function(t,e){var i=f(e).data("_gridstack_node");i&&o.push(i)}),o.length||(o=void 0)),this.engine._updateNodeWidths(i,t,o),this.engine._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this.engine._ignoreLayoutsNodeChange}},n.prototype.float=function(t){if(void 0===t)return this.opts.float||!1;this.opts.float!==t&&(this.opts.float=this.engine.float=t||!1,t||(this.engine._packNodes(),this.engine._notify(),this._triggerChangeEvent()))},n.prototype.getRow=function(){return this.engine.getRow()},n.prototype.on=function(t,e){-1===t.indexOf(" ")?"change"===t||"added"===t||"removed"===t?(this._gsEventHandler=this._gsEventHandler||{},this._gsEventHandler[t]=function(t){e(t,t.detail)},this.el.addEventListener(t,this._gsEventHandler[t])):this.$el.on(t,e):t.split(" ").forEach(function(t){this.on(t,e)},this)},n.prototype.off=function(t){-1===t.indexOf(" ")?"change"===t||"added"===t||"removed"===t?this._gsEventHandler&&this._gsEventHandler[t]&&(this.el.removeEventListener(t,this._gsEventHandler[t]),delete this._gsEventHandler[t]):this.$el.off(t):t.split(" ").forEach(function(t){this.off(t,callback)},this)},n.prototype.setGridWidth=e(n.prototype.column,"setGridWidth","column","v0.5.3"),n.prototype.setColumn=e(n.prototype.column,"setColumn","column","v0.6.4"),y.prototype.getGridHeight=e(y.prototype.getRow,"getGridHeight","getRow","v1.0.0"),t.GridStack=n,t.GridStack.Utils=v,t.GridStack.Engine=y,t.GridStack.DragDropPlugin=_,n.init=function(t,e){var i=f(e=e||".grid-stack").get(0);if(i)return i.gridstack||(i.gridstack=new n(i,v.clone(t))),i.gridstack},n.initAll=function(i,t){var o=[];return f(t=t||".grid-stack").each(function(t,e){e.gridstack||(e.gridstack=new n(e,v.clone(i))),o.push(e.gridstack)}),o},t.GridStack}(window.jQuery,window);
!function(t){if("function"==typeof define&&define.amd)define(["jquery","exports"],t);else if("undefined"!=typeof exports){var e;try{e=require("jquery")}catch(t){}t(e||window.jQuery,exports)}else t(window.jQuery,window)}(function(m,t){function e(t,e,i,o){function n(){return console.warn("gridstack.js: Function `"+e+"` is deprecated in "+o+" and has been replaced with `"+i+"`. It will be **completely** removed in v1.0"),t.apply(this,arguments)}return n.prototype=t.prototype,n}function g(t,e,i,o){void 0!==t[e]&&(t[i]=t[e],console.warn("gridstack.js: Option `"+e+"` is deprecated in "+o+" and has been replaced with `"+i+"`. It will be **completely** removed in v1.0"))}function f(t,e,i,o){var n=t.attr(e);void 0!==n&&(t.attr(i,n),console.warn("gridstack.js: attribute `"+e+"`="+n+" is deprecated on this object in "+o+" and has been replaced with `"+i+"`. It will be **completely** removed in v1.0"))}var v={isIntercepted:function(t,e){return!(t.x+t.width<=e.x||e.x+e.width<=t.x||t.y+t.height<=e.y||e.y+e.height<=t.y)},sort:function(t,e,i){if(!i){var o=t.map(function(t){return t.x+t.width});i=Math.max.apply(Math,o)}return-1===e?v.sortBy(t,function(t){return-(t.x+t.y*i)}):v.sortBy(t,function(t){return t.x+t.y*i})},createStylesheet:function(t,e){var i=document.createElement("style");return i.setAttribute("type","text/css"),i.setAttribute("data-gs-style-id",t),i.styleSheet?i.styleSheet.cssText="":i.appendChild(document.createTextNode("")),(e=e||document.getElementsByTagName("head")[0]).insertBefore(i,e.firstChild),i.sheet},removeStylesheet:function(t){m("STYLE[data-gs-style-id="+t+"]").remove()},insertCSSRule:function(t,e,i,o){"function"==typeof t.insertRule?t.insertRule(e+"{"+i+"}",o):"function"==typeof t.addRule&&t.addRule(e,i,o)},toBool:function(t){return"boolean"==typeof t?t:"string"==typeof t?!(""===(t=t.toLowerCase())||"no"===t||"false"===t||"0"===t):Boolean(t)},_collisionNodeCheck:function(t){return t!==this.node&&v.isIntercepted(t,this.nn)},_didCollide:function(t){return v.isIntercepted({x:this.n.x,y:this.newY,width:this.n.width,height:this.n.height},t)},_isAddNodeIntercepted:function(t){return v.isIntercepted({x:this.x,y:this.y,width:this.node.width,height:this.node.height},t)},parseHeight:function(t){var e=t,i="px";if(e&&"string"==typeof e){var o=e.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%)?$/);if(!o)throw new Error("Invalid height");i=o[2]||"px",e=parseFloat(o[1])}return{height:e,unit:i}},without:function(t,e){var i=t.indexOf(e);return-1!==i&&(t=t.slice(0)).splice(i,1),t},sortBy:function(t,n){return t.slice(0).sort(function(t,e){var i=n(t),o=n(e);return o===i?0:o<i?1:-1})},defaults:function(i){return Array.prototype.slice.call(arguments,1).forEach(function(t){for(var e in t)!Object.prototype.hasOwnProperty.call(t,e)||Object.prototype.hasOwnProperty.call(i,e)&&void 0!==i[e]||(i[e]=t[e])}),i},clone:function(t){return m.extend({},t)},throttle:function(t,e){var i=!1;return function(){i||(t.apply(this,arguments),i=!0,setTimeout(function(){i=!1},e))}},removePositioningStyles:function(t){var e=t[0].style;e.position&&e.removeProperty("position"),e.left&&e.removeProperty("left"),e.top&&e.removeProperty("top"),e.width&&e.removeProperty("width"),e.height&&e.removeProperty("height")},getScrollParent:function(t){return null===t?null:t.scrollHeight>t.clientHeight?t:v.getScrollParent(t.parentNode)},updateScrollPosition:function(t,e,i){var o=t.getBoundingClientRect(),n=window.innerHeight||document.documentElement.clientHeight;if(o.top<0||o.bottom>n){var s=o.bottom-n,a=o.top,r=v.getScrollParent(t);if(null!==r){var d=r.scrollTop;o.top<0&&i<0?t.offsetHeight>n?r.scrollTop+=i:r.scrollTop+=Math.abs(a)>Math.abs(i)?i:a:0<i&&(t.offsetHeight>n?r.scrollTop+=i:r.scrollTop+=i<s?i:s),e.position.top+=r.scrollTop-d}}}};function _(t){this.grid=t}_.registeredPlugins=[],_.registerPlugin=function(t){_.registeredPlugins.push(t)},_.prototype.resizable=function(t,e){return this},_.prototype.draggable=function(t,e){return this},_.prototype.droppable=function(t,e){return this},_.prototype.isDroppable=function(t){return!1},_.prototype.on=function(t,e,i){return this};function y(t,e,i,o,n){this.column=t||12,this.float=i||!1,this.maxRow=o||0,this.nodes=n||[],this.onchange=e||function(){},this._addedNodes=[],this._removedNodes=[],this._batchMode=!1}var s=0;y.prototype.batchUpdate=function(){this._batchMode||(this._batchMode=!0,this._prevFloat=this.float,this.float=!0)},y.prototype.commit=function(){this._batchMode&&(this._batchMode=!1,this.float=this._prevFloat,delete this._prevFloat,this._packNodes(),this._notify())},y.prototype.getNodeDataByDOMEl=function(e){return this.nodes.find(function(t){return e===t.el})},y.prototype._fixCollisions=function(t){this._sortNodes(-1);var e=t,i=Boolean(this.nodes.find(function(t){return t.locked}));for(this.float||i||(e={x:0,y:t.y,width:this.column,height:t.height});;){var o=this.nodes.find(v._collisionNodeCheck,{node:t,nn:e});if(!o)return;if(!(o.locked?this.moveNode(t,t.x,o.y+o.height,t.width,t.height,!0):this.moveNode(o,o.x,t.y+t.height,o.width,o.height,!0)))return}},y.prototype.isAreaEmpty=function(t,e,i,o){var n={x:t||0,y:e||0,width:i||1,height:o||1};return!this.nodes.find(function(t){return v.isIntercepted(t,n)})},y.prototype._sortNodes=function(t){this.nodes=v.sort(this.nodes,t,this.column)},y.prototype._packNodes=function(){this._sortNodes(),this.float?this.nodes.forEach(function(t,e){if(!t._updating&&void 0!==t._packY&&t.y!==t._packY)for(var i=t.y;i>=t._packY;){this.nodes.slice(0,e).find(v._didCollide,{n:t,newY:i})||(t._dirty=!0,t.y=i),--i}},this):this.nodes.forEach(function(t,e){if(!t.locked)for(;0<t.y;){var i=t.y-1,o=0===e;if(0<e)o=void 0===this.nodes.slice(0,e).find(v._didCollide,{n:t,newY:i});if(!o)break;t._dirty=t.y!==i,t.y=i}},this)},y.prototype._prepareNode=function(t,e){void 0!==(t=t||{}).x&&void 0!==t.y&&null!==t.x&&null!==t.y||(t.autoPosition=!0);var i={width:1,height:1,x:0,y:0};return(t=v.defaults(t,i)).x=parseInt(t.x),t.y=parseInt(t.y),t.width=parseInt(t.width),t.height=parseInt(t.height),t.autoPosition=t.autoPosition||!1,t.noResize=t.noResize||!1,t.noMove=t.noMove||!1,Number.isNaN(t.x)&&(t.x=i.x,t.autoPosition=!0),Number.isNaN(t.y)&&(t.y=i.y,t.autoPosition=!0),Number.isNaN(t.width)&&(t.width=i.width),Number.isNaN(t.height)&&(t.height=i.height),void 0!==t.maxWidth&&(t.width=Math.min(t.width,t.maxWidth)),void 0!==t.maxHeight&&(t.height=Math.min(t.height,t.maxHeight)),void 0!==t.minWidth&&(t.width=Math.max(t.width,t.minWidth)),void 0!==t.minHeight&&(t.height=Math.max(t.height,t.minHeight)),t.width>this.column?t.width=this.column:t.width<1&&(t.width=1),this.maxRow&&t.height>this.maxRow?t.height=this.maxRow:t.height<1&&(t.height=1),t.x<0&&(t.x=0),t.y<0&&(t.y=0),t.x+t.width>this.column&&(e?t.width=this.column-t.x:t.x=this.column-t.width),this.maxRow&&t.y+t.height>this.maxRow&&(e?t.height=this.maxRow-t.y:t.y=this.maxRow-t.height),t},y.prototype._notify=function(){if(!this._batchMode){var t=Array.prototype.slice.call(arguments,0);t[0]=void 0===t[0]?[]:Array.isArray(t[0])?t[0]:[t[0]],t[1]=void 0===t[1]||t[1];var e=t[0].concat(this.getDirtyNodes());this.onchange(e,t[1])}},y.prototype.cleanNodes=function(){this._batchMode||this.nodes.forEach(function(t){delete t._dirty})},y.prototype.getDirtyNodes=function(t){if(t){var e=[];return this.nodes.forEach(function(t){t._dirty&&(t.y===t._origY&&t.x===t._origX&&t.width===t._origW&&t.height===t._origH?delete t._dirty:e.push(t))}),e}return this.nodes.filter(function(t){return t._dirty})},y.prototype.addNode=function(t,e){if((t=this._prepareNode(t))._id=t._id||++s,t.autoPosition){this._sortNodes();for(var i=0;;++i){var o=i%this.column,n=Math.floor(i/this.column);if(!(o+t.width>this.column)&&!this.nodes.find(v._isAddNodeIntercepted,{x:o,y:n,node:t})){t.x=o,t.y=n,delete t.autoPosition;break}}}return this.nodes.push(t),e&&this._addedNodes.push(t),this._fixCollisions(t),this._packNodes(),this._notify(),t},y.prototype.removeNode=function(t,e){e=void 0===e||e,this._removedNodes.push(t),t._id=null,this.nodes=v.without(this.nodes,t),this._packNodes(),this._notify(t,e)},y.prototype.removeAll=function(t){delete this._layouts,0!==this.nodes.length&&(t=void 0===t||t,this.nodes.forEach(function(t){t._id=null}),this._removedNodes=this.nodes,this.nodes=[],this._notify(this._removedNodes,t))},y.prototype.canMoveNode=function(e,t,i,o,n){if(!this.isNodeChangedPosition(e,t,i,o,n))return!1;var s,a=Boolean(this.nodes.find(function(t){return t.locked}));if(!this.maxRow&&!a)return!0;var r=new y(this.column,null,this.float,0,this.nodes.map(function(t){return t===e?s=m.extend({},t):m.extend({},t)}));if(!s)return!0;r.moveNode(s,t,i,o,n);var d=!0;return a&&(d&=!Boolean(r.nodes.find(function(t){return t!==s&&Boolean(t.locked)&&Boolean(t._dirty)}))),this.maxRow&&(d&=r.getRow()<=this.maxRow),d},y.prototype.canBePlacedWithRespectToHeight=function(t){if(!this.maxRow)return!0;var e=new y(this.column,null,this.float,0,this.nodes.map(function(t){return m.extend({},t)}));return e.addNode(t),e.getRow()<=this.maxRow},y.prototype.isNodeChangedPosition=function(t,e,i,o,n){return"number"!=typeof e&&(e=t.x),"number"!=typeof i&&(i=t.y),"number"!=typeof o&&(o=t.width),"number"!=typeof n&&(n=t.height),void 0!==t.maxWidth&&(o=Math.min(o,t.maxWidth)),void 0!==t.maxHeight&&(n=Math.min(n,t.maxHeight)),void 0!==t.minWidth&&(o=Math.max(o,t.minWidth)),void 0!==t.minHeight&&(n=Math.max(n,t.minHeight)),t.x!==e||t.y!==i||t.width!==o||t.height!==n},y.prototype.moveNode=function(t,e,i,o,n,s){if(t.locked)return null;"number"!=typeof e&&(e=t.x),"number"!=typeof i&&(i=t.y),"number"!=typeof o&&(o=t.width),"number"!=typeof n&&(n=t.height);var a=t.width!==o||t.height!==n,r={x:e,y:i,width:o,height:n,maxWidth:t.maxWidth,maxHeight:t.maxHeight,minWidth:t.minWidth,minHeight:t.minHeight};return r=this._prepareNode(r,a),t.x===r.x&&t.y===r.y&&t.width===r.width&&t.height===r.height?null:(t._dirty=!0,t.x=t.lastTriedX=r.x,t.y=t.lastTriedY=r.y,t.width=t.lastTriedWidth=r.width,t.height=t.lastTriedHeight=r.height,this._fixCollisions(t),s||(this._packNodes(),this._notify()),t)},y.prototype.getRow=function(){return this.nodes.reduce(function(t,e){return Math.max(t,e.y+e.height)},0)},y.prototype.beginUpdate=function(t){t._updating||(t._updating=!0,this.nodes.forEach(function(t){t._packY=t.y}))},y.prototype.endUpdate=function(){var t=this.nodes.find(function(t){return t._updating});t&&(t._updating=!1,this.nodes.forEach(function(t){delete t._packY}))};function n(t,e){var i,o,n,s,c=this;e=e||{},this.$el=m(t),this.el=this.$el.get(0),g(e,"width","column","v0.5.3"),g(e,"height","maxRow","v0.5.3"),n="v0.6.3",s=". Use class `.grid-stack-1` instead",void 0!==e[o="oneColumnModeClass"]&&console.warn("gridstack.js: Option `"+o+"` is deprecated in "+n+s),f(this.$el,"data-gs-width","data-gs-column","v0.5.3"),f(this.$el,"data-gs-height","data-gs-max-row","v0.5.3"),f(this.$el,"data-gs-current-height","data-gs-current-row","v1.0.0"),e.itemClass=e.itemClass||"grid-stack-item";var a=0<this.$el.closest("."+e.itemClass).length;e.row&&(e.minRow=e.maxRow=e.row,delete e.row);var r=parseInt(this.$el.attr("data-gs-row"));if(this.opts=v.defaults(e,{column:parseInt(this.$el.attr("data-gs-column"))||12,minRow:r||(parseInt(this.$el.attr("data-gs-min-row"))||0),maxRow:r||(parseInt(this.$el.attr("data-gs-max-row"))||0),itemClass:"grid-stack-item",placeholderClass:"grid-stack-placeholder",placeholderText:"",handle:".grid-stack-item-content",handleClass:null,styleInHead:!1,cellHeight:60,verticalMargin:20,auto:!0,minWidth:768,float:!1,staticGrid:!1,_class:"grid-stack-instance-"+(1e4*Math.random()).toFixed(0),animate:Boolean(this.$el.attr("data-gs-animate"))||!1,alwaysShowResizeHandle:e.alwaysShowResizeHandle||!1,resizable:v.defaults(e.resizable||{},{autoHide:!e.alwaysShowResizeHandle,handles:"se"}),draggable:v.defaults(e.draggable||{},{handle:(e.handleClass?"."+e.handleClass:e.handle?e.handle:"")||".grid-stack-item-content",scroll:!1,appendTo:"body"}),disableDrag:e.disableDrag||!1,disableResize:e.disableResize||!1,rtl:"auto",removable:!1,removableOptions:v.defaults(e.removableOptions||{},{accept:"."+e.itemClass}),removeTimeout:2e3,verticalMarginUnit:"px",cellHeightUnit:"px",disableOneColumnMode:e.disableOneColumnMode||!1,oneColumnModeDomSort:e.oneColumnModeDomSort,ddPlugin:null}),!1===this.opts.ddPlugin?this.opts.ddPlugin=_:null===this.opts.ddPlugin&&(this.opts.ddPlugin=_.registeredPlugins[0]||_),this.dd=new this.opts.ddPlugin(this),"auto"===this.opts.rtl&&(this.opts.rtl="rtl"===this.$el.css("direction")),this.opts.rtl&&this.$el.addClass("grid-stack-rtl"),this.opts.isNested=a,(i="auto"===this.opts.cellHeight)?c.cellHeight(c.cellWidth(),!0):this.cellHeight(this.opts.cellHeight,!0),this.verticalMargin(this.opts.verticalMargin,!0),this.$el.addClass(this.opts._class),this._setStaticClass(),a&&this.$el.addClass("grid-stack-nested"),this._initStyles(),this.engine=new y(this.opts.column,function(t,e){e=void 0===e||e;var i=0;this.nodes.forEach(function(t){i=Math.max(i,t.y+t.height)}),t.forEach(function(t){e&&null===t._id?t.el&&m(t.el).remove():m(t.el).attr("data-gs-x",t.x).attr("data-gs-y",t.y).attr("data-gs-width",t.width).attr("data-gs-height",t.height)}),c._updateStyles(i+10)},this.opts.float,this.opts.maxRow),this.opts.auto){var d=[],h=this;this.$el.children("."+this.opts.itemClass+":not(."+this.opts.placeholderClass+")").each(function(t,e){e=m(e);var i=parseInt(e.attr("data-gs-x")),o=parseInt(e.attr("data-gs-y"));d.push({el:e.get(0),i:(Number.isNaN(i)?1e3:i)+(Number.isNaN(o)?1e3:o)*h.opts.column})}),v.sortBy(d,function(t){return t.i}).forEach(function(t){this._prepareElement(t.el)},this)}if(this.engine._saveInitial(),this.setAnimation(this.opts.animate),this.placeholder=m('<div class="'+this.opts.placeholderClass+" "+this.opts.itemClass+'"><div class="placeholder-content">'+this.opts.placeholderText+"</div></div>").hide(),this._updateContainerHeight(),this._updateHeightsOnResize=v.throttle(function(){c.cellHeight(c.cellWidth(),!1)},100),this.onResizeHandler=function(){if(i&&c._updateHeightsOnResize(),!c.opts.disableOneColumnMode&&(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<=c.opts.minWidth){if(c.oneColumnMode)return;c.oneColumnMode=!0,c.column(1)}else{if(!c.oneColumnMode)return;c.oneColumnMode=!1,c.column(c._prevColumn)}},m(window).resize(this.onResizeHandler),this.onResizeHandler(),!c.opts.staticGrid&&"string"==typeof c.opts.removable){var l=m(c.opts.removable);this.dd.isDroppable(l)||this.dd.droppable(l,c.opts.removableOptions),this.dd.on(l,"dropover",function(t,e){var i=m(e.draggable),o=i.data("_gridstack_node");o&&o._grid===c&&(i.data("inTrashZone",!0),c._setupRemovingTimeout(i))}).on(l,"dropout",function(t,e){var i=m(e.draggable),o=i.data("_gridstack_node");o&&o._grid===c&&(i.data("inTrashZone",!1),c._clearRemovingTimeout(i))})}if(!c.opts.staticGrid&&c.opts.acceptWidgets){function p(t,e){var i=u,o=i.data("_gridstack_node"),n=c.getCellFromPixel({left:t.pageX,top:t.pageY},!0),s=Math.max(0,n.x),a=Math.max(0,n.y);o._added||(o._added=!0,o.el=i.get(0),o.autoPosition=!0,o.x=s,o.y=a,c.engine.cleanNodes(),c.engine.beginUpdate(o),c.engine.addNode(o),c.$el.append(c.placeholder),c.placeholder.attr("data-gs-x",o.x).attr("data-gs-y",o.y).attr("data-gs-width",o.width).attr("data-gs-height",o.height).show(),o.el=c.placeholder.get(0),o._beforeDragX=o.x,o._beforeDragY=o.y,c._updateContainerHeight()),c.engine.canMoveNode(o,s,a)&&(c.engine.moveNode(o,s,a),c._updateContainerHeight())}var u=null;this.dd.droppable(c.$el,{accept:function(t){var e=(t=m(t)).data("_gridstack_node");return(!e||e._grid!==c)&&t.is(!0===c.opts.acceptWidgets?".grid-stack-item":c.opts.acceptWidgets)}}).on(c.$el,"dropover",function(t,e){var i,o,n=m(e.draggable),s=n.data("_gridstack_node");if(!s||!s.width||!s.height){var a=parseInt(n.attr("data-gs-width"));0<a&&((s=s||{}).width=a);var r=parseInt(n.attr("data-gs-height"));0<r&&((s=s||{}).height=r)}var d=c.cellWidth(),h=c.cellHeight(),l=c.opts.verticalMargin;i=s&&s.width?s.width:Math.ceil(n.outerWidth()/d),o=s&&s.height?s.height:Math.round((n.outerHeight()+l)/(h+l)),u=n;var g=c.engine._prepareNode({width:i,height:o,_added:!1,_temporary:!0});return g.isOutOfGrid=!0,n.data("_gridstack_node",g),n.data("_gridstack_node_orig",s),n.on("drag",p),!1}).on(c.$el,"dropout",function(t,e){var i=m(e.draggable);if(i.data("_gridstack_node")){var o=i.data("_gridstack_node");if(o.isOutOfGrid)return i.unbind("drag",p),o.el=null,c.engine.removeNode(o),c.placeholder.detach(),c._updateContainerHeight(),i.data("_gridstack_node",i.data("_gridstack_node_orig")),!1}}).on(c.$el,"drop",function(t,e){c.placeholder.detach();var i=m(e.draggable).data("_gridstack_node");i.isOutOfGrid=!1,i._grid=c;var o=m(e.draggable).clone(!1);o.data("_gridstack_node",i);var n=m(e.draggable).data("_gridstack_node_orig");return void 0!==n&&void 0!==n._grid&&n._grid._triggerRemoveEvent(),m(e.helper).remove(),i.el=o.get(0),c.placeholder.hide(),v.removePositioningStyles(o),o.find("div.ui-resizable-handle").remove(),o.attr("data-gs-x",i.x).attr("data-gs-y",i.y).attr("data-gs-width",i.width).attr("data-gs-height",i.height).addClass(c.opts.itemClass).enableSelection().removeData("draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled").unbind("drag",p),c.$el.append(o),c._prepareElementsByNode(o,i),c._updateContainerHeight(),c.engine._addedNodes.push(i),c._triggerAddEvent(),c._triggerChangeEvent(),c.engine.endUpdate(),m(e.draggable).unbind("drag",p),m(e.draggable).removeData("_gridstack_node"),m(e.draggable).removeData("_gridstack_node_orig"),c.$el.trigger("dropped",[n,i]),!1})}}return n.prototype._triggerChangeEvent=function(){if(!this.engine._batchMode){var t=this.engine.getDirtyNodes(!0);t&&t.length&&(this.engine._layoutsNodesChange(t),this._triggerEvent("change",t)),this.engine._saveInitial()}},n.prototype._triggerAddEvent=function(){this.engine._batchMode||this.engine._addedNodes&&0<this.engine._addedNodes.length&&(this.engine._layoutsNodesChange(this.engine._addedNodes),this.engine._addedNodes.forEach(function(t){delete t._dirty}),this._triggerEvent("added",this.engine._addedNodes),this.engine._addedNodes=[])},n.prototype._triggerRemoveEvent=function(){this.engine._batchMode||this.engine._removedNodes&&0<this.engine._removedNodes.length&&(this._triggerEvent("removed",this.engine._removedNodes),this.engine._removedNodes=[])},n.prototype._triggerEvent=function(t,e){var i=new CustomEvent(t,{detail:e});this.el.dispatchEvent(i)},n.prototype._initStyles=function(){this._stylesId&&v.removeStylesheet(this._stylesId),this._stylesId="gridstack-style-"+(1e5*Math.random()).toFixed();var t=this.opts.styleInHead?void 0:this.el.parentNode;this._styles=v.createStylesheet(this._stylesId,t),null!==this._styles&&(this._styles._max=0)},n.prototype._updateStyles=function(t){if(null!==this._styles&&void 0!==this._styles){var e,i="."+this.opts._class+" ."+this.opts.itemClass,o=this;if(void 0===t&&(t=this._styles._max),this._initStyles(),this._updateContainerHeight(),this.opts.cellHeight&&!(0!==this._styles._max&&t<=this._styles._max)&&(e=this.opts.verticalMargin&&this.opts.cellHeightUnit!==this.opts.verticalMarginUnit?function(t,e){return t&&e?"calc("+(o.opts.cellHeight*t+o.opts.cellHeightUnit)+" + "+(o.opts.verticalMargin*e+o.opts.verticalMarginUnit)+")":o.opts.cellHeight*t+o.opts.verticalMargin*e+o.opts.cellHeightUnit}:function(t,e){return o.opts.cellHeight*t+o.opts.verticalMargin*e+o.opts.cellHeightUnit},0===this._styles._max&&v.insertCSSRule(this._styles,i,"min-height: "+e(1,0)+";",0),t>this._styles._max)){for(var n=this._styles._max;n<t;++n)v.insertCSSRule(this._styles,i+'[data-gs-height="'+(n+1)+'"]',"height: "+e(n+1,n)+";",n),v.insertCSSRule(this._styles,i+'[data-gs-min-height="'+(n+1)+'"]',"min-height: "+e(n+1,n)+";",n),v.insertCSSRule(this._styles,i+'[data-gs-max-height="'+(n+1)+'"]',"max-height: "+e(n+1,n)+";",n),v.insertCSSRule(this._styles,i+'[data-gs-y="'+n+'"]',"top: "+e(n,n)+";",n);this._styles._max=t}}},n.prototype._updateContainerHeight=function(){if(!this.engine._batchMode){var t=this.engine.getRow();t<this.opts.minRow&&(t=this.opts.minRow);var e=parseInt(this.$el.css("min-height"));if(0<e){var i=this.opts.verticalMargin,o=Math.round((e+i)/(this.cellHeight()+i));t<o&&(t=o)}this.$el.attr("data-gs-current-row",t),this.opts.cellHeight&&(this.opts.verticalMargin?this.opts.cellHeightUnit===this.opts.verticalMarginUnit?this.$el.css("height",t*(this.opts.cellHeight+this.opts.verticalMargin)-this.opts.verticalMargin+this.opts.cellHeightUnit):this.$el.css("height","calc("+(t*this.opts.cellHeight+this.opts.cellHeightUnit)+" + "+(t*(this.opts.verticalMargin-1)+this.opts.verticalMarginUnit)+")"):this.$el.css("height",t*this.opts.cellHeight+this.opts.cellHeightUnit))}},n.prototype._setupRemovingTimeout=function(t){var e=m(t).data("_gridstack_node");!e._removeTimeout&&this.opts.removable&&(e._removeTimeout=setTimeout(function(){t.addClass("grid-stack-item-removing"),e._isAboutToRemove=!0},this.opts.removeTimeout))},n.prototype._clearRemovingTimeout=function(t){var e=m(t).data("_gridstack_node");e._removeTimeout&&(clearTimeout(e._removeTimeout),e._removeTimeout=null,t.removeClass("grid-stack-item-removing"),e._isAboutToRemove=!1)},n.prototype._prepareElementsByNode=function(h,l){function t(t,e){var i,o,n=Math.round(e.position.left/g),s=Math.floor((e.position.top+c/2)/c);if("drag"===t.type){var a=e.position.top-l._prevYPix;if(l._prevYPix=e.position.top,v.updateScrollPosition(h[0],e,a),h.data("inTrashZone")||n<0||n>=p.engine.column||s<0||!p.engine.float&&s>p.engine.getRow()){if(l._temporaryRemoved)return;!0===p.opts.removable&&p._setupRemovingTimeout(h),n=l._beforeDragX,s=l._beforeDragY,p.placeholder.detach(),p.placeholder.hide(),p.engine.removeNode(l),p._updateContainerHeight(),l._temporaryRemoved=!0}else p._clearRemovingTimeout(h),l._temporaryRemoved&&(p.engine.addNode(l),p.placeholder.attr("data-gs-x",n).attr("data-gs-y",s).attr("data-gs-width",i).attr("data-gs-height",o).show(),p.$el.append(p.placeholder),l.el=p.placeholder.get(0),l._temporaryRemoved=!1)}else if("resize"===t.type){if(n<0)return;i=Math.round(e.size.width/g),o=Math.round((e.size.height+p.verticalMargin())/c)}var r=void 0!==i?i:l.lastTriedWidth,d=void 0!==o?o:l.lastTriedHeight;!p.engine.canMoveNode(l,n,s,i,o)||l.lastTriedX===n&&l.lastTriedY===s&&l.lastTriedWidth===r&&l.lastTriedHeight===d||(l.lastTriedX=n,l.lastTriedY=s,l.lastTriedWidth=i,l.lastTriedHeight=o,p.engine.moveNode(l,n,s,i,o),p._updateContainerHeight(),"resize"===t.type&&m(t.target).trigger("gsresize",l))}function e(t,e){p.$el.append(p.placeholder);var i=m(this);p.engine.cleanNodes(),p.engine.beginUpdate(l),g=p.cellWidth();var o=p.cellHeight();c=(p.$el.height()+p.verticalMargin())/parseInt(p.$el.attr("data-gs-current-row")),p.placeholder.attr("data-gs-x",i.attr("data-gs-x")).attr("data-gs-y",i.attr("data-gs-y")).attr("data-gs-width",i.attr("data-gs-width")).attr("data-gs-height",i.attr("data-gs-height")).show(),l.el=p.placeholder.get(0),l._beforeDragX=l.x,l._beforeDragY=l.y,l._prevYPix=e.position.top;var n=l.minHeight||1,s=p.opts.verticalMargin;p.dd.resizable(h,"option","minWidth",g*(l.minWidth||1)),p.dd.resizable(h,"option","minHeight",o*n+(n-1)*s),"resizestart"===t.type&&i.find(".grid-stack-item").trigger("resizestart")}function i(t,e){var i=m(this);if(i.data("_gridstack_node")){if(p.placeholder.detach(),l.el=i.get(0),p.placeholder.hide(),l._isAboutToRemove)h.data("_gridstack_node")._grid._triggerRemoveEvent(),h.removeData("_gridstack_node"),h.remove();else p._clearRemovingTimeout(h),l._temporaryRemoved?(v.removePositioningStyles(i),i.attr("data-gs-x",l._beforeDragX).attr("data-gs-y",l._beforeDragY).attr("data-gs-width",l.width).attr("data-gs-height",l.height),l.x=l._beforeDragX,l.y=l._beforeDragY,l._temporaryRemoved=!1,p.engine.addNode(l)):(v.removePositioningStyles(i),i.attr("data-gs-x",l.x).attr("data-gs-y",l.y).attr("data-gs-width",l.width).attr("data-gs-height",l.height));p._updateContainerHeight(),p._triggerChangeEvent(),p.engine.endUpdate();var o=i.find(".grid-stack");o.length&&"resizestop"===t.type&&(o.each(function(t,e){e.gridstack.onResizeHandler()}),i.find(".grid-stack-item").trigger("resizestop"),i.find(".grid-stack-item").trigger("gsresizestop")),"resizestop"===t.type&&p.$el.trigger("gsresizestop",i)}}var g,c,p=this;this.dd.draggable(h,{start:e,stop:i,drag:t}).resizable(h,{start:e,stop:i,resize:t}),(l.noMove||this.opts.disableDrag||this.opts.staticGrid)&&this.dd.draggable(h,"disable"),(l.noResize||this.opts.disableResize||this.opts.staticGrid)&&this.dd.resizable(h,"disable"),this._writeAttr(h,l)},n.prototype._prepareElement=function(t,e){e=void 0!==e&&e;(t=m(t)).addClass(this.opts.itemClass);var i=this._readAttr(t,{el:t.get(0),_grid:this});i=this.engine.addNode(i,e),t.data("_gridstack_node",i),this._prepareElementsByNode(t,i)},n.prototype._writeAttr=function(t,e){e&&(t=m(t),void 0!==e.x&&t.attr("data-gs-x",e.x),void 0!==e.y&&t.attr("data-gs-y",e.y),void 0!==e.width&&t.attr("data-gs-width",e.width),void 0!==e.height&&t.attr("data-gs-height",e.height),void 0!==e.autoPosition&&t.attr("data-gs-auto-position",!!e.autoPosition||null),void 0!==e.minWidth&&t.attr("data-gs-min-width",e.minWidth),void 0!==e.maxWidth&&t.attr("data-gs-max-width",e.maxWidth),void 0!==e.minHeight&&t.attr("data-gs-min-height",e.minHeight),void 0!==e.maxHeight&&t.attr("data-gs-max-height",e.maxHeight),void 0!==e.noResize&&t.attr("data-gs-no-resize",!!e.noResize||null),void 0!==e.noMove&&t.attr("data-gs-no-move",!!e.noMove||null),void 0!==e.locked&&t.attr("data-gs-locked",!!e.locked||null),void 0!==e.resizeHandles&&t.attr("data-gs-resize-handles",e.resizeHandles),void 0!==e.id&&t.attr("data-gs-id",e.id))},n.prototype._readAttr=function(t,e){return t=m(t),(e=e||{}).x=t.attr("data-gs-x"),e.y=t.attr("data-gs-y"),e.width=t.attr("data-gs-width"),e.height=t.attr("data-gs-height"),e.autoPosition=v.toBool(t.attr("data-gs-auto-position")),e.maxWidth=t.attr("data-gs-max-width"),e.minWidth=t.attr("data-gs-min-width"),e.maxHeight=t.attr("data-gs-max-height"),e.minHeight=t.attr("data-gs-min-height"),e.noResize=v.toBool(t.attr("data-gs-no-resize")),e.noMove=v.toBool(t.attr("data-gs-no-move")),e.locked=v.toBool(t.attr("data-gs-locked")),e.resizeHandles=t.attr("data-gs-resize-handles"),e.id=t.attr("data-gs-id"),e},n.prototype.setAnimation=function(t){t?this.$el.addClass("grid-stack-animate"):this.$el.removeClass("grid-stack-animate")},n.prototype.addWidget=function(t,e,i,o,n,s,a,r,d,h,l){if(void 0!==e&&"object"!=typeof e)return this.addWidget(t,{x:e,y:i,width:o,height:n,autoPosition:s,minWidth:a,maxWidth:r,minHeight:d,maxHeight:h,id:l});if(t=m(t),e){var g=this._readAttr(t);v.defaults(e,g),this.engine._prepareNode(e)}return this._writeAttr(t,e),this.$el.append(t),this.makeWidget(t)},n.prototype.makeWidget=function(t){return t=m(t),this._prepareElement(t,!0),this._updateContainerHeight(),this._triggerAddEvent(),this._triggerChangeEvent(!0),t.get(0)},n.prototype.willItFit=function(t,e,i,o,n){var s={x:t,y:e,width:i,height:o,autoPosition:n};return this.engine.canBePlacedWithRespectToHeight(s)},n.prototype.removeWidget=function(t,e){var i=(t=m(t)).data("_gridstack_node");(i=i||this.engine.getNodeDataByDOMEl(t.get(0)))&&i.el.parentElement===this.el&&(t.removeData("_gridstack_node"),this.dd.draggable(t,"destroy").resizable(t,"destroy"),this.engine.removeNode(i,e),this._triggerRemoveEvent(),this._triggerChangeEvent(!0))},n.prototype.removeAll=function(t){this.engine.nodes.forEach(function(t){var e=m(t.el);e.removeData("_gridstack_node"),this.dd.draggable(e,"destroy").resizable(e,"destroy")},this),this.engine.removeAll(t),this._triggerRemoveEvent()},n.prototype.destroy=function(t){m(window).off("resize",this.onResizeHandler),!1===t?(this.removeAll(!1),this.$el.removeClass(this.opts._class),delete this.$el.get(0).gridstack):this.$el.remove(),v.removeStylesheet(this._stylesId),this.engine&&(this.engine=null)},n.prototype.resizable=function(t,o){var n=this;return(t=m(t)).each(function(t,e){var i=(e=m(e)).data("_gridstack_node");i&&(i.noResize=!o,i.noResize?n.dd.resizable(e,"disable"):n.dd.resizable(e,"enable"))}),this},n.prototype.movable=function(t,o){var n=this;return(t=m(t)).each(function(t,e){var i=(e=m(e)).data("_gridstack_node");i&&(i.noMove=!o,i.noMove?(n.dd.draggable(e,"disable"),e.removeClass("ui-draggable-handle")):(n.dd.draggable(e,"enable"),e.addClass("ui-draggable-handle")))}),this},n.prototype.enableMove=function(t,e){this.movable(this.$el.children("."+this.opts.itemClass),t),e&&(this.opts.disableDrag=!t)},n.prototype.enableResize=function(t,e){this.resizable(this.$el.children("."+this.opts.itemClass),t),e&&(this.opts.disableResize=!t)},n.prototype.disable=function(){this.movable(this.$el.children("."+this.opts.itemClass),!1),this.resizable(this.$el.children("."+this.opts.itemClass),!1),this.$el.trigger("disable")},n.prototype.enable=function(){this.movable(this.$el.children("."+this.opts.itemClass),!0),this.resizable(this.$el.children("."+this.opts.itemClass),!0),this.$el.trigger("enable")},n.prototype.locked=function(t,o){return(t=m(t)).each(function(t,e){var i=(e=m(e)).data("_gridstack_node");i&&(i.locked=o||!1,e.attr("data-gs-locked",i.locked?"yes":null))}),this},n.prototype.maxHeight=function(t,o){return(t=m(t)).each(function(t,e){var i=(e=m(e)).data("_gridstack_node");i&&(isNaN(o)||(i.maxHeight=o||!1,e.attr("data-gs-max-height",o)))}),this},n.prototype.minHeight=function(t,o){return(t=m(t)).each(function(t,e){var i=(e=m(e)).data("_gridstack_node");i&&(isNaN(o)||(i.minHeight=o||!1,e.attr("data-gs-min-height",o)))}),this},n.prototype.maxWidth=function(t,o){return(t=m(t)).each(function(t,e){var i=(e=m(e)).data("_gridstack_node");i&&(isNaN(o)||(i.maxWidth=o||!1,e.attr("data-gs-max-width",o)))}),this},n.prototype.minWidth=function(t,o){return(t=m(t)).each(function(t,e){var i=(e=m(e)).data("_gridstack_node");i&&(isNaN(o)||(i.minWidth=o||!1,e.attr("data-gs-min-width",o)))}),this},n.prototype._updateElement=function(t,e){var i=(t=m(t).first()).data("_gridstack_node");if(i){var o=this;o.engine.cleanNodes(),o.engine.beginUpdate(i),e.call(this,t,i),o._updateContainerHeight(),o._triggerChangeEvent(),o.engine.endUpdate()}},n.prototype.resize=function(t,i,o){this._updateElement(t,function(t,e){i=null!=i?i:e.width,o=null!=o?o:e.height,this.engine.moveNode(e,e.x,e.y,i,o)})},n.prototype.move=function(t,i,o){this._updateElement(t,function(t,e){i=null!=i?i:e.x,o=null!=o?o:e.y,this.engine.moveNode(e,i,o,e.width,e.height)})},n.prototype.update=function(t,i,o,n,s){this._updateElement(t,function(t,e){i=null!=i?i:e.x,o=null!=o?o:e.y,n=null!=n?n:e.width,s=null!=s?s:e.height,this.engine.moveNode(e,i,o,n,s)})},n.prototype.compact=function(){if(0!==this.engine.nodes.length){this.batchUpdate(),this.engine._sortNodes();var t=this.engine.nodes;this.engine.nodes=[],t.forEach(function(t){t.noMove||t.locked||(t.autoPosition=!0),this.engine.addNode(t,!1),t._dirty=!0},this),this.commit()}},n.prototype.verticalMargin=function(t,e){if(void 0===t)return this.opts.verticalMargin;var i=v.parseHeight(t);this.opts.verticalMarginUnit===i.unit&&this.opts.maxRow===i.height||(this.opts.verticalMarginUnit=i.unit,this.opts.verticalMargin=i.height,e||this._updateStyles())},n.prototype.cellHeight=function(t,e){if(void 0===t){if(this.opts.cellHeight&&"auto"!==this.opts.cellHeight)return this.opts.cellHeight;var i=this.$el.children("."+this.opts.itemClass).first(),o=i.attr("data-gs-height"),n=this.opts.verticalMargin;return Math.round((i.outerHeight()-(o-1)*n)/o)}var s=v.parseHeight(t);this.opts.cellHeightUnit===s.unit&&this.opts.cellHeight===s.height||(this.opts.cellHeightUnit=s.unit,this.opts.cellHeight=s.height,e||this._updateStyles())},n.prototype.cellWidth=function(){return Math.round(this.$el.outerWidth()/this.opts.column)},n.prototype.getCellFromPixel=function(t,e){var i=void 0!==e&&e?this.$el.offset():this.$el.position(),o=t.left-i.left,n=t.top-i.top,s=Math.floor(this.$el.width()/this.opts.column),a=Math.floor(this.$el.height()/parseInt(this.$el.attr("data-gs-current-row")));return{x:Math.floor(o/s),y:Math.floor(n/a)}},n.prototype.batchUpdate=function(){this.engine.batchUpdate()},n.prototype.commit=function(){this.engine.commit(),this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent()},n.prototype.isAreaEmpty=function(t,e,i,o){return this.engine.isAreaEmpty(t,e,i,o)},n.prototype.setStatic=function(t){this.opts.staticGrid=!0===t,this.enableMove(!t),this.enableResize(!t),this._setStaticClass()},n.prototype._setStaticClass=function(){var t="grid-stack-static";!0===this.opts.staticGrid?this.$el.addClass(t):this.$el.removeClass(t)},y.prototype._layoutsNodesChange=function(t){this._layouts&&!this._ignoreLayoutsNodeChange&&this._layouts.forEach(function(o,n){o&&n!==this.column&&(n<this.column?this._layouts[n]=void 0:t.forEach(function(e){var t=o.find(function(t){return t._id===e._id});if(t){var i=n/this.column;e.y!==e._origY&&(t.y+=e.y-e._origY),e.x!==e._origX&&(t.x=Math.round(e.x*i)),e.width!==e._origW&&(t.width=Math.round(e.width*i))}},this))},this)},y.prototype._updateNodeWidths=function(e,i,o){if(this.nodes.length&&e!==i){var n=[this.nodes.length];if(this.nodes.forEach(function(t,e){n[e]={x:t.x,y:t.y,width:t.width,_id:t._id}}),this._layouts=this._layouts||[],this._layouts[e]=n,1===i&&o&&o.length){var s=0;o.forEach(function(t){t.x=0,t.width=1,t.y=Math.max(t.y,s),s=t.y+t.height})}else o=v.sort(this.nodes,-1,e);var t=this._layouts[i]||[],a=this._layouts.length-1;0===t.length&&e<i&&i<a&&(t=this._layouts[a]||[]).length&&(e=a,t.forEach(function(e){var t=o.findIndex(function(t){return t&&t._id===e._id});-1!==t&&(o[t].x=e.x,o[t].y=e.y,o[t].width=e.width)}),t=[]);var r=[];t.forEach(function(e){var t=o.findIndex(function(t){return t&&t._id===e._id});-1!==t&&(o[t].x=e.x,o[t].y=e.y,o[t].width=e.width,r.push(o[t]),o[t]=null)});var d=i/e;o.forEach(function(t){t&&(t.x=1===i?0:Math.round(t.x*d),t.width=1!==i&&1!==e&&Math.round(t.width*d)||1,r.push(t))}),r=v.sort(r,-1,i),this._ignoreLayoutsNodeChange=!0,this.batchUpdate(),this.nodes=[],r.forEach(function(t){this.addNode(t,!1),t._dirty=!0},this),this.commit(),delete this._ignoreLayoutsNodeChange}},y.prototype._saveInitial=function(){this.nodes.forEach(function(t){t._origX=t.x,t._origY=t.y,t._origW=t.width,t._origH=t.height,delete t._dirty})},n.prototype.column=function(t,e){if(void 0===t)return this.opts.column;if(this.opts.column!==t){var o,i=this.opts.column;if(1===t?this._prevColumn=i:delete this._prevColumn,this.$el.removeClass("grid-stack-"+i),this.$el.addClass("grid-stack-"+t),this.opts.column=this.engine.column=t,!0!==e)this.opts.oneColumnModeDomSort&&1===t&&(o=[],this.$el.children("."+this.opts.itemClass).each(function(t,e){var i=m(e).data("_gridstack_node");i&&o.push(i)}),o.length||(o=void 0)),this.engine._updateNodeWidths(i,t,o),this.engine._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this.engine._ignoreLayoutsNodeChange}},n.prototype.float=function(t){if(void 0===t)return this.opts.float||!1;this.opts.float!==t&&(this.opts.float=this.engine.float=t||!1,t||(this.engine._packNodes(),this.engine._notify(),this._triggerChangeEvent()))},n.prototype.getRow=function(){return this.engine.getRow()},n.prototype.on=function(t,e){-1===t.indexOf(" ")?"change"===t||"added"===t||"removed"===t?(this._gsEventHandler=this._gsEventHandler||{},this._gsEventHandler[t]=function(t){e(t,t.detail)},this.el.addEventListener(t,this._gsEventHandler[t])):this.$el.on(t,e):t.split(" ").forEach(function(t){this.on(t,e)},this)},n.prototype.off=function(t){-1===t.indexOf(" ")?"change"===t||"added"===t||"removed"===t?this._gsEventHandler&&this._gsEventHandler[t]&&(this.el.removeEventListener(t,this._gsEventHandler[t]),delete this._gsEventHandler[t]):this.$el.off(t):t.split(" ").forEach(function(t){this.off(t,callback)},this)},n.prototype.setGridWidth=e(n.prototype.column,"setGridWidth","column","v0.5.3"),n.prototype.setColumn=e(n.prototype.column,"setColumn","column","v0.6.4"),y.prototype.getGridHeight=e(y.prototype.getRow,"getGridHeight","getRow","v1.0.0"),t.GridStack=n,t.GridStack.Utils=v,t.GridStack.Engine=y,t.GridStack.DragDropPlugin=_,n.init=function(t,e){var i=m(e=e||".grid-stack").get(0);if(i)return i.gridstack||(i.gridstack=new n(i,v.clone(t))),i.gridstack},n.initAll=function(i,t){var o=[];return m(t=t||".grid-stack").each(function(t,e){e.gridstack||(e.gridstack=new n(e,v.clone(i))),o.push(e.gridstack)}),o},t.GridStack});
//# sourceMappingURL=gridstack.min.map

@@ -5,3 +5,3 @@ /*! jQuery UI - v1.12.1 - 2019-11-20

* Copyright jQuery Foundation and other contributors; Licensed MIT @preserve*/
!function(b){b.ui=b.ui||{};var t=b.ui.version="1.12.1",i=0,a=Array.prototype.slice;b.cleanData=function(o){return function(t){var e,i,s;for(s=0;(i=t[s])!=null;s++){try{e=b._data(i,"events");if(e&&e.remove){b(i).triggerHandler("remove")}}catch(t){}}o(t)}}(b.cleanData),b.widget=function(t,i,e){var s,o,n;var r={};var a=t.split(".")[0];t=t.split(".")[1];var l=a+"-"+t;if(!e){e=i;i=b.Widget}if(b.isArray(e)){e=b.extend.apply(null,[{}].concat(e))}b.expr[":"][l.toLowerCase()]=function(t){return!!b.data(t,l)};b[a]=b[a]||{};s=b[a][t];o=b[a][t]=function(t,e){if(!this._createWidget){return new o(t,e)}if(arguments.length){this._createWidget(t,e)}};b.extend(o,s,{version:e.version,_proto:b.extend({},e),_childConstructors:[]});n=new i;n.options=b.widget.extend({},n.options);b.each(e,function(e,n){if(!b.isFunction(n)){r[e]=n;return}r[e]=function(){function s(){return i.prototype[e].apply(this,arguments)}function o(t){return i.prototype[e].apply(this,t)}return function(){var t=this._super;var e=this._superApply;var i;this._super=s;this._superApply=o;i=n.apply(this,arguments);this._super=t;this._superApply=e;return i}}()});o.prototype=b.widget.extend(n,{widgetEventPrefix:s?n.widgetEventPrefix||t:t},r,{constructor:o,namespace:a,widgetName:t,widgetFullName:l});if(s){b.each(s._childConstructors,function(t,e){var i=e.prototype;b.widget(i.namespace+"."+i.widgetName,o,e._proto)});delete s._childConstructors}else{i._childConstructors.push(o)}b.widget.bridge(t,o);return o},b.widget.extend=function(t){var e=a.call(arguments,1);var i=0;var s=e.length;var o;var n;for(;i<s;i++){for(o in e[i]){n=e[i][o];if(e[i].hasOwnProperty(o)&&n!==undefined){if(b.isPlainObject(n)){t[o]=b.isPlainObject(t[o])?b.widget.extend({},t[o],n):b.widget.extend({},n)}else{t[o]=n}}}}return t},b.widget.bridge=function(n,e){var r=e.prototype.widgetFullName||n;b.fn[n]=function(i){var t=typeof i==="string";var s=a.call(arguments,1);var o=this;if(t){if(!this.length&&i==="instance"){o=undefined}else{this.each(function(){var t;var e=b.data(this,r);if(i==="instance"){o=e;return false}if(!e){return b.error("cannot call methods on "+n+" prior to initialization; "+"attempted to call method '"+i+"'")}if(!b.isFunction(e[i])||i.charAt(0)==="_"){return b.error("no such method '"+i+"' for "+n+" widget instance")}t=e[i].apply(e,s);if(t!==e&&t!==undefined){o=t&&t.jquery?o.pushStack(t.get()):t;return false}})}}else{if(s.length){i=b.widget.extend.apply(null,[i].concat(s))}this.each(function(){var t=b.data(this,r);if(t){t.option(i||{});if(t._init){t._init()}}else{b.data(this,r,new e(i,this))}})}return o}},b.Widget=function(){},b.Widget._childConstructors=[],b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:false,create:null},_createWidget:function(t,e){e=b(e||this.defaultElement||this)[0];this.element=b(e);this.uuid=i++;this.eventNamespace="."+this.widgetName+this.uuid;this.bindings=b();this.hoverable=b();this.focusable=b();this.classesElementLookup={};if(e!==this){b.data(e,this.widgetFullName,this);this._on(true,this.element,{remove:function(t){if(t.target===e){this.destroy()}}});this.document=b(e.style?e.ownerDocument:e.document||e);this.window=b(this.document[0].defaultView||this.document[0].parentWindow)}this.options=b.widget.extend({},this.options,this._getCreateOptions(),t);this._create();if(this.options.disabled){this._setOptionDisabled(this.options.disabled)}this._trigger("create",null,this._getCreateEventData());this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:b.noop,_create:b.noop,_init:b.noop,destroy:function(){var i=this;this._destroy();b.each(this.classesElementLookup,function(t,e){i._removeClass(e,t)});this.element.off(this.eventNamespace).removeData(this.widgetFullName);this.widget().off(this.eventNamespace).removeAttr("aria-disabled");this.bindings.off(this.eventNamespace)},_destroy:b.noop,widget:function(){return this.element},option:function(t,e){var i=t;var s;var o;var n;if(arguments.length===0){return b.widget.extend({},this.options)}if(typeof t==="string"){i={};s=t.split(".");t=s.shift();if(s.length){o=i[t]=b.widget.extend({},this.options[t]);for(n=0;n<s.length-1;n++){o[s[n]]=o[s[n]]||{};o=o[s[n]]}t=s.pop();if(arguments.length===1){return o[t]===undefined?null:o[t]}o[t]=e}else{if(arguments.length===1){return this.options[t]===undefined?null:this.options[t]}i[t]=e}}this._setOptions(i);return this},_setOptions:function(t){var e;for(e in t){this._setOption(e,t[e])}return this},_setOption:function(t,e){if(t==="classes"){this._setOptionClasses(e)}this.options[t]=e;if(t==="disabled"){this._setOptionDisabled(e)}return this},_setOptionClasses:function(t){var e,i,s;for(e in t){s=this.classesElementLookup[e];if(t[e]===this.options.classes[e]||!s||!s.length){continue}i=b(s.get());this._removeClass(s,e);i.addClass(this._classes({element:i,keys:e,classes:t,add:true}))}},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t);if(t){this._removeClass(this.hoverable,null,"ui-state-hover");this._removeClass(this.focusable,null,"ui-state-focus")}},enable:function(){return this._setOptions({disabled:false})},disable:function(){return this._setOptions({disabled:true})},_classes:function(o){var n=[];var r=this;o=b.extend({element:this.element,classes:this.options.classes||{}},o);function t(t,e){var i,s;for(s=0;s<t.length;s++){i=r.classesElementLookup[t[s]]||b();if(o.add){i=b(b.unique(i.get().concat(o.element.get())))}else{i=b(i.not(o.element).get())}r.classesElementLookup[t[s]]=i;n.push(t[s]);if(e&&o.classes[t[s]]){n.push(o.classes[t[s]])}}}this._on(o.element,{remove:"_untrackClassesElement"});if(o.keys){t(o.keys.match(/\S+/g)||[],true)}if(o.extra){t(o.extra.match(/\S+/g)||[])}return n.join(" ")},_untrackClassesElement:function(i){var s=this;b.each(s.classesElementLookup,function(t,e){if(b.inArray(i.target,e)!==-1){s.classesElementLookup[t]=b(e.not(i.target).get())}})},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,false)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,true)},_toggleClass:function(t,e,i,s){s=typeof s==="boolean"?s:i;var o=typeof t==="string"||t===null,n={extra:o?e:i,keys:o?t:e,element:o?this.element:t,add:s};n.element.toggleClass(this._classes(n),s);return this},_on:function(r,a,t){var l;var h=this;if(typeof r!=="boolean"){t=a;a=r;r=false}if(!t){t=a;a=this.element;l=this.widget()}else{a=l=b(a);this.bindings=this.bindings.add(a)}b.each(t,function(t,e){function i(){if(!r&&(h.options.disabled===true||b(this).hasClass("ui-state-disabled"))){return}return(typeof e==="string"?h[e]:e).apply(h,arguments)}if(typeof e!=="string"){i.guid=e.guid=e.guid||i.guid||b.guid++}var s=t.match(/^([\w:-]*)\s*(.*)$/);var o=s[1]+h.eventNamespace;var n=s[2];if(n){l.on(o,n,i)}else{a.on(o,i)}})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace;t.off(e).off(e);this.bindings=b(this.bindings.not(t).get());this.focusable=b(this.focusable.not(t).get());this.hoverable=b(this.hoverable.not(t).get())},_delay:function(t,e){function i(){return(typeof t==="string"?s[t]:t).apply(s,arguments)}var s=this;return setTimeout(i,e||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t);this._on(t,{mouseenter:function(t){this._addClass(b(t.currentTarget),null,"ui-state-hover")},mouseleave:function(t){this._removeClass(b(t.currentTarget),null,"ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t);this._on(t,{focusin:function(t){this._addClass(b(t.currentTarget),null,"ui-state-focus")},focusout:function(t){this._removeClass(b(t.currentTarget),null,"ui-state-focus")}})},_trigger:function(t,e,i){var s,o;var n=this.options[t];i=i||{};e=b.Event(e);e.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase();e.target=this.element[0];o=e.originalEvent;if(o){for(s in o){if(!(s in e)){e[s]=o[s]}}}this.element.trigger(e,i);return!(b.isFunction(n)&&n.apply(this.element[0],[e].concat(i))===false||e.isDefaultPrevented())}},b.each({show:"fadeIn",hide:"fadeOut"},function(n,r){b.Widget.prototype["_"+n]=function(e,t,i){if(typeof t==="string"){t={effect:t}}var s;var o=!t?n:t===true||typeof t==="number"?r:t.effect||r;t=t||{};if(typeof t==="number"){t={duration:t}}s=!b.isEmptyObject(t);t.complete=i;if(t.delay){e.delay(t.delay)}if(s&&b.effects&&b.effects.effect[o]){e[n](t)}else if(o!==n&&e[o]){e[o](t.duration,t.easing,i)}else{e.queue(function(t){b(this)[n]();if(i){i.call(e[0])}t()})}}});var e=b.widget,s=b.extend(b.expr[":"],{data:b.expr.createPseudo?b.expr.createPseudo(function(e){return function(t){return!!b.data(t,e)}}):function(t,e,i){return!!b.data(t,i[3])}}),o=b.fn.extend({disableSelection:function(){var t="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.on(t+".ui-disableSelection",function(t){t.preventDefault()})}}(),enableSelection:function(){return this.off(".ui-disableSelection")}}),n=b.fn.scrollParent=function(t){var e=this.css("position"),i=e==="absolute",s=t?/(auto|scroll|hidden)/:/(auto|scroll)/,o=this.parents().filter(function(){var t=b(this);if(i&&t.css("position")==="static"){return false}return s.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return e==="fixed"||!o.length?b(this[0].ownerDocument||document):o},r=b.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),l=false;b(document).on("mouseup",function(){l=false});var h=b.widget("ui.mouse",{version:"1.12.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.on("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).on("click."+this.widgetName,function(t){if(true===b.data(t.target,e.widgetName+".preventClickEvent")){b.removeData(t.target,e.widgetName+".preventClickEvent");t.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.off("."+this.widgetName);if(this._mouseMoveDelegate){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)}},_mouseDown:function(t){if(l){return}this._mouseMoved=false;this._mouseStarted&&this._mouseUp(t);this._mouseDownEvent=t;var e=this,i=t.which===1,s=typeof this.options.cancel==="string"&&t.target.nodeName?b(t.target).closest(this.options.cancel).length:false;if(!i||s||!this._mouseCapture(t)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){e.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)){this._mouseStarted=this._mouseStart(t)!==false;if(!this._mouseStarted){t.preventDefault();return true}}if(true===b.data(t.target,this.widgetName+".preventClickEvent")){b.removeData(t.target,this.widgetName+".preventClickEvent")}this._mouseMoveDelegate=function(t){return e._mouseMove(t)};this._mouseUpDelegate=function(t){return e._mouseUp(t)};this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate);t.preventDefault();l=true;return true},_mouseMove:function(t){if(this._mouseMoved){if(b.ui.ie&&(!document.documentMode||document.documentMode<9)&&!t.button){return this._mouseUp(t)}else if(!t.which){if(t.originalEvent.altKey||t.originalEvent.ctrlKey||t.originalEvent.metaKey||t.originalEvent.shiftKey){this.ignoreMissingWhich=true}else if(!this.ignoreMissingWhich){return this._mouseUp(t)}}}if(t.which||t.button){this._mouseMoved=true}if(this._mouseStarted){this._mouseDrag(t);return t.preventDefault()}if(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)){this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==false;this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)}return!this._mouseStarted},_mouseUp:function(t){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;if(t.target===this._mouseDownEvent.target){b.data(t.target,this.widgetName+".preventClickEvent",true)}this._mouseStop(t)}if(this._mouseDelayTimer){clearTimeout(this._mouseDelayTimer);delete this._mouseDelayTimer}this.ignoreMissingWhich=false;l=false;t.preventDefault()},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}}),f=b.ui.plugin={add:function(t,e,i){var s,o=b.ui[t].prototype;for(s in i){o.plugins[s]=o.plugins[s]||[];o.plugins[s].push([e,i[s]])}},call:function(t,e,i,s){var o,n=t.plugins[e];if(!n){return}if(!s&&(!t.element[0].parentNode||t.element[0].parentNode.nodeType===11)){return}for(o=0;o<n.length;o++){if(t.options[n[o][0]]){n[o][1].apply(t.element,i)}}}},p=b.ui.safeActiveElement=function(e){var i;try{i=e.activeElement}catch(t){i=e.body}if(!i){i=e.body}if(!i.nodeName){i=e.body}return i},u=b.ui.safeBlur=function(t){if(t&&t.nodeName.toLowerCase()!=="body"){b(t).trigger("blur")}};b.widget("ui.draggable",b.ui.mouse,{version:"1.12.1",widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false,drag:null,start:null,stop:null},_create:function(){if(this.options.helper==="original"){this._setPositionRelative()}if(this.options.addClasses){this._addClass("ui-draggable")}this._setHandleClassName();this._mouseInit()},_setOption:function(t,e){this._super(t,e);if(t==="handle"){this._removeHandleClassName();this._setHandleClassName()}},_destroy:function(){if((this.helper||this.element).is(".ui-draggable-dragging")){this.destroyOnClear=true;return}this._removeHandleClassName();this._mouseDestroy()},_mouseCapture:function(t){var e=this.options;if(this.helper||e.disabled||b(t.target).closest(".ui-resizable-handle").length>0){return false}this.handle=this._getHandle(t);if(!this.handle){return false}this._blurActiveElement(t);this._blockFrames(e.iframeFix===true?"iframe":e.iframeFix);return true},_blockFrames:function(t){this.iframeBlocks=this.document.find(t).map(function(){var t=b(this);return b("<div>").css("position","absolute").appendTo(t.parent()).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).offset(t.offset())[0]})},_unblockFrames:function(){if(this.iframeBlocks){this.iframeBlocks.remove();delete this.iframeBlocks}},_blurActiveElement:function(t){var e=b.ui.safeActiveElement(this.document[0]),i=b(t.target);if(i.closest(e).length){return}b.ui.safeBlur(e)},_mouseStart:function(t){var e=this.options;this.helper=this._createHelper(t);this._addClass(this.helper,"ui-draggable-dragging");this._cacheHelperProportions();if(b.ui.ddmanager){b.ui.ddmanager.current=this}this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent(true);this.offsetParent=this.helper.offsetParent();this.hasFixedAncestor=this.helper.parents().filter(function(){return b(this).css("position")==="fixed"}).length>0;this.positionAbs=this.element.offset();this._refreshOffsets(t);this.originalPosition=this.position=this._generatePosition(t,false);this.originalPageX=t.pageX;this.originalPageY=t.pageY;e.cursorAt&&this._adjustOffsetFromHelper(e.cursorAt);this._setContainment();if(this._trigger("start",t)===false){this._clear();return false}this._cacheHelperProportions();if(b.ui.ddmanager&&!e.dropBehaviour){b.ui.ddmanager.prepareOffsets(this,t)}this._mouseDrag(t,true);if(b.ui.ddmanager){b.ui.ddmanager.dragStart(this,t)}return true},_refreshOffsets:function(t){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:false,parent:this._getParentOffset(),relative:this._getRelativeOffset()};this.offset.click={left:t.pageX-this.offset.left,top:t.pageY-this.offset.top}},_mouseDrag:function(t,e){if(this.hasFixedAncestor){this.offset.parent=this._getParentOffset()}this.position=this._generatePosition(t,true);this.positionAbs=this._convertPositionTo("absolute");if(!e){var i=this._uiHash();if(this._trigger("drag",t,i)===false){this._mouseUp(new b.Event("mouseup",t));return false}this.position=i.position}this.helper[0].style.left=this.position.left+"px";this.helper[0].style.top=this.position.top+"px";if(b.ui.ddmanager){b.ui.ddmanager.drag(this,t)}return false},_mouseStop:function(t){var e=this,i=false;if(b.ui.ddmanager&&!this.options.dropBehaviour){i=b.ui.ddmanager.drop(this,t)}if(this.dropped){i=this.dropped;this.dropped=false}if(this.options.revert==="invalid"&&!i||this.options.revert==="valid"&&i||this.options.revert===true||b.isFunction(this.options.revert)&&this.options.revert.call(this.element,i)){b(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){if(e._trigger("stop",t)!==false){e._clear()}})}else{if(this._trigger("stop",t)!==false){this._clear()}}return false},_mouseUp:function(t){this._unblockFrames();if(b.ui.ddmanager){b.ui.ddmanager.dragStop(this,t)}if(this.handleElement.is(t.target)){this.element.trigger("focus")}return b.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){if(this.helper.is(".ui-draggable-dragging")){this._mouseUp(new b.Event("mouseup",{target:this.element[0]}))}else{this._clear()}return this},_getHandle:function(t){return this.options.handle?!!b(t.target).closest(this.element.find(this.options.handle)).length:true},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element;this._addClass(this.handleElement,"ui-draggable-handle")},_removeHandleClassName:function(){this._removeClass(this.handleElement,"ui-draggable-handle")},_createHelper:function(t){var e=this.options,i=b.isFunction(e.helper),s=i?b(e.helper.apply(this.element[0],[t])):e.helper==="clone"?this.element.clone().removeAttr("id"):this.element;if(!s.parents("body").length){s.appendTo(e.appendTo==="parent"?this.element[0].parentNode:e.appendTo)}if(i&&s[0]===this.element[0]){this._setPositionRelative()}if(s[0]!==this.element[0]&&!/(fixed|absolute)/.test(s.css("position"))){s.css("position","absolute")}return s},_setPositionRelative:function(){if(!/^(?:r|a|f)/.test(this.element.css("position"))){this.element[0].style.position="relative"}},_adjustOffsetFromHelper:function(t){if(typeof t==="string"){t=t.split(" ")}if(b.isArray(t)){t={left:+t[0],top:+t[1]||0}}if("left"in t){this.offset.click.left=t.left+this.margins.left}if("right"in t){this.offset.click.left=this.helperProportions.width-t.right+this.margins.left}if("top"in t){this.offset.click.top=t.top+this.margins.top}if("bottom"in t){this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top}},_isRootNode:function(t){return/(html|body)/i.test(t.tagName)||t===this.document[0]},_getParentOffset:function(){var t=this.offsetParent.offset(),e=this.document[0];if(this.cssPosition==="absolute"&&this.scrollParent[0]!==e&&b.contains(this.scrollParent[0],this.offsetParent[0])){t.left+=this.scrollParent.scrollLeft();t.top+=this.scrollParent.scrollTop()}if(this._isRootNode(this.offsetParent[0])){t={top:0,left:0}}return{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition!=="relative"){return{top:0,left:0}}var t=this.element.position(),e=this._isRootNode(this.scrollParent[0]);return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+(!e?this.scrollParent.scrollTop():0),left:t.left-(parseInt(this.helper.css("left"),10)||0)+(!e?this.scrollParent.scrollLeft():0)}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,e,i,s=this.options,o=this.document[0];this.relativeContainer=null;if(!s.containment){this.containment=null;return}if(s.containment==="window"){this.containment=[b(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,b(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,b(window).scrollLeft()+b(window).width()-this.helperProportions.width-this.margins.left,b(window).scrollTop()+(b(window).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];return}if(s.containment==="document"){this.containment=[0,0,b(o).width()-this.helperProportions.width-this.margins.left,(b(o).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];return}if(s.containment.constructor===Array){this.containment=s.containment;return}if(s.containment==="parent"){s.containment=this.helper[0].parentNode}e=b(s.containment);i=e[0];if(!i){return}t=/(scroll|auto)/.test(e.css("overflow"));this.containment=[(parseInt(e.css("borderLeftWidth"),10)||0)+(parseInt(e.css("paddingLeft"),10)||0),(parseInt(e.css("borderTopWidth"),10)||0)+(parseInt(e.css("paddingTop"),10)||0),(t?Math.max(i.scrollWidth,i.offsetWidth):i.offsetWidth)-(parseInt(e.css("borderRightWidth"),10)||0)-(parseInt(e.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(i.scrollHeight,i.offsetHeight):i.offsetHeight)-(parseInt(e.css("borderBottomWidth"),10)||0)-(parseInt(e.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom];this.relativeContainer=e},_convertPositionTo:function(t,e){if(!e){e=this.position}var i=t==="absolute"?1:-1,s=this._isRootNode(this.scrollParent[0]);return{top:e.top+this.offset.relative.top*i+this.offset.parent.top*i-(this.cssPosition==="fixed"?-this.offset.scroll.top:s?0:this.offset.scroll.top)*i,left:e.left+this.offset.relative.left*i+this.offset.parent.left*i-(this.cssPosition==="fixed"?-this.offset.scroll.left:s?0:this.offset.scroll.left)*i}},_generatePosition:function(t,e){var i,s,o,n,r=this.options,a=this._isRootNode(this.scrollParent[0]),l=t.pageX,h=t.pageY;if(!a||!this.offset.scroll){this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}}if(e){if(this.containment){if(this.relativeContainer){s=this.relativeContainer.offset();i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]}else{i=this.containment}if(t.pageX-this.offset.click.left<i[0]){l=i[0]+this.offset.click.left}if(t.pageY-this.offset.click.top<i[1]){h=i[1]+this.offset.click.top}if(t.pageX-this.offset.click.left>i[2]){l=i[2]+this.offset.click.left}if(t.pageY-this.offset.click.top>i[3]){h=i[3]+this.offset.click.top}}if(r.grid){o=r.grid[1]?this.originalPageY+Math.round((h-this.originalPageY)/r.grid[1])*r.grid[1]:this.originalPageY;h=i?o-this.offset.click.top>=i[1]||o-this.offset.click.top>i[3]?o:o-this.offset.click.top>=i[1]?o-r.grid[1]:o+r.grid[1]:o;n=r.grid[0]?this.originalPageX+Math.round((l-this.originalPageX)/r.grid[0])*r.grid[0]:this.originalPageX;l=i?n-this.offset.click.left>=i[0]||n-this.offset.click.left>i[2]?n:n-this.offset.click.left>=i[0]?n-r.grid[0]:n+r.grid[0]:n}if(r.axis==="y"){l=this.originalPageX}if(r.axis==="x"){h=this.originalPageY}}return{top:h-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition==="fixed"?-this.offset.scroll.top:a?0:this.offset.scroll.top),left:l-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition==="fixed"?-this.offset.scroll.left:a?0:this.offset.scroll.left)}},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging");if(this.helper[0]!==this.element[0]&&!this.cancelHelperRemoval){this.helper.remove()}this.helper=null;this.cancelHelperRemoval=false;if(this.destroyOnClear){this.destroy()}},_trigger:function(t,e,i){i=i||this._uiHash();b.ui.plugin.call(this,t,[e,i,this],true);if(/^(drag|start|stop)/.test(t)){this.positionAbs=this._convertPositionTo("absolute");i.offset=this.positionAbs}return b.Widget.prototype._trigger.call(this,t,e,i)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),b.ui.plugin.add("draggable","connectToSortable",{start:function(e,t,i){var s=b.extend({},t,{item:i.element});i.sortables=[];b(i.options.connectToSortable).each(function(){var t=b(this).sortable("instance");if(t&&!t.options.disabled){i.sortables.push(t);t.refreshPositions();t._trigger("activate",e,s)}})},stop:function(e,t,i){var s=b.extend({},t,{item:i.element});i.cancelHelperRemoval=false;b.each(i.sortables,function(){var t=this;if(t.isOver){t.isOver=0;i.cancelHelperRemoval=true;t.cancelHelperRemoval=false;t._storedCSS={position:t.placeholder.css("position"),top:t.placeholder.css("top"),left:t.placeholder.css("left")};t._mouseStop(e);t.options.helper=t.options._helper}else{t.cancelHelperRemoval=true;t._trigger("deactivate",e,s)}})},drag:function(i,s,o){b.each(o.sortables,function(){var t=false,e=this;e.positionAbs=o.positionAbs;e.helperProportions=o.helperProportions;e.offset.click=o.offset.click;if(e._intersectsWith(e.containerCache)){t=true;b.each(o.sortables,function(){this.positionAbs=o.positionAbs;this.helperProportions=o.helperProportions;this.offset.click=o.offset.click;if(this!==e&&this._intersectsWith(this.containerCache)&&b.contains(e.element[0],this.element[0])){t=false}return t})}if(t){if(!e.isOver){e.isOver=1;o._parent=s.helper.parent();e.currentItem=s.helper.appendTo(e.element).data("ui-sortable-item",true);e.options._helper=e.options.helper;e.options.helper=function(){return s.helper[0]};i.target=e.currentItem[0];e._mouseCapture(i,true);e._mouseStart(i,true,true);e.offset.click.top=o.offset.click.top;e.offset.click.left=o.offset.click.left;e.offset.parent.left-=o.offset.parent.left-e.offset.parent.left;e.offset.parent.top-=o.offset.parent.top-e.offset.parent.top;o._trigger("toSortable",i);o.dropped=e.element;b.each(o.sortables,function(){this.refreshPositions()});o.currentItem=o.element;e.fromOutside=o}if(e.currentItem){e._mouseDrag(i);s.position=e.position}}else{if(e.isOver){e.isOver=0;e.cancelHelperRemoval=true;e.options._revert=e.options.revert;e.options.revert=false;e._trigger("out",i,e._uiHash(e));e._mouseStop(i,true);e.options.revert=e.options._revert;e.options.helper=e.options._helper;if(e.placeholder){e.placeholder.remove()}s.helper.appendTo(o._parent);o._refreshOffsets(i);s.position=o._generatePosition(i,true);o._trigger("fromSortable",i);o.dropped=false;b.each(o.sortables,function(){this.refreshPositions()})}}})}}),b.ui.plugin.add("draggable","cursor",{start:function(t,e,i){var s=b("body"),o=i.options;if(s.css("cursor")){o._cursor=s.css("cursor")}s.css("cursor",o.cursor)},stop:function(t,e,i){var s=i.options;if(s._cursor){b("body").css("cursor",s._cursor)}}}),b.ui.plugin.add("draggable","opacity",{start:function(t,e,i){var s=b(e.helper),o=i.options;if(s.css("opacity")){o._opacity=s.css("opacity")}s.css("opacity",o.opacity)},stop:function(t,e,i){var s=i.options;if(s._opacity){b(e.helper).css("opacity",s._opacity)}}}),b.ui.plugin.add("draggable","scroll",{start:function(t,e,i){if(!i.scrollParentNotHidden){i.scrollParentNotHidden=i.helper.scrollParent(false)}if(i.scrollParentNotHidden[0]!==i.document[0]&&i.scrollParentNotHidden[0].tagName!=="HTML"){i.overflowOffset=i.scrollParentNotHidden.offset()}},drag:function(t,e,i){var s=i.options,o=false,n=i.scrollParentNotHidden[0],r=i.document[0];if(n!==r&&n.tagName!=="HTML"){if(!s.axis||s.axis!=="x"){if(i.overflowOffset.top+n.offsetHeight-t.pageY<s.scrollSensitivity){n.scrollTop=o=n.scrollTop+s.scrollSpeed}else if(t.pageY-i.overflowOffset.top<s.scrollSensitivity){n.scrollTop=o=n.scrollTop-s.scrollSpeed}}if(!s.axis||s.axis!=="y"){if(i.overflowOffset.left+n.offsetWidth-t.pageX<s.scrollSensitivity){n.scrollLeft=o=n.scrollLeft+s.scrollSpeed}else if(t.pageX-i.overflowOffset.left<s.scrollSensitivity){n.scrollLeft=o=n.scrollLeft-s.scrollSpeed}}}else{if(!s.axis||s.axis!=="x"){if(t.pageY-b(r).scrollTop()<s.scrollSensitivity){o=b(r).scrollTop(b(r).scrollTop()-s.scrollSpeed)}else if(b(window).height()-(t.pageY-b(r).scrollTop())<s.scrollSensitivity){o=b(r).scrollTop(b(r).scrollTop()+s.scrollSpeed)}}if(!s.axis||s.axis!=="y"){if(t.pageX-b(r).scrollLeft()<s.scrollSensitivity){o=b(r).scrollLeft(b(r).scrollLeft()-s.scrollSpeed)}else if(b(window).width()-(t.pageX-b(r).scrollLeft())<s.scrollSensitivity){o=b(r).scrollLeft(b(r).scrollLeft()+s.scrollSpeed)}}}if(o!==false&&b.ui.ddmanager&&!s.dropBehaviour){b.ui.ddmanager.prepareOffsets(i,t)}}}),b.ui.plugin.add("draggable","snap",{start:function(t,e,i){var s=i.options;i.snapElements=[];b(s.snap.constructor!==String?s.snap.items||":data(ui-draggable)":s.snap).each(function(){var t=b(this),e=t.offset();if(this!==i.element[0]){i.snapElements.push({item:this,width:t.outerWidth(),height:t.outerHeight(),top:e.top,left:e.left})}})},drag:function(t,e,i){var s,o,n,r,a,l,h,f,p,u,c=i.options,d=c.snapTolerance,g=e.offset.left,m=g+i.helperProportions.width,v=e.offset.top,_=v+i.helperProportions.height;for(p=i.snapElements.length-1;p>=0;p--){a=i.snapElements[p].left-i.margins.left;l=a+i.snapElements[p].width;h=i.snapElements[p].top-i.margins.top;f=h+i.snapElements[p].height;if(m<a-d||g>l+d||_<h-d||v>f+d||!b.contains(i.snapElements[p].item.ownerDocument,i.snapElements[p].item)){if(i.snapElements[p].snapping){i.options.snap.release&&i.options.snap.release.call(i.element,t,b.extend(i._uiHash(),{snapItem:i.snapElements[p].item}))}i.snapElements[p].snapping=false;continue}if(c.snapMode!=="inner"){s=Math.abs(h-_)<=d;o=Math.abs(f-v)<=d;n=Math.abs(a-m)<=d;r=Math.abs(l-g)<=d;if(s){e.position.top=i._convertPositionTo("relative",{top:h-i.helperProportions.height,left:0}).top}if(o){e.position.top=i._convertPositionTo("relative",{top:f,left:0}).top}if(n){e.position.left=i._convertPositionTo("relative",{top:0,left:a-i.helperProportions.width}).left}if(r){e.position.left=i._convertPositionTo("relative",{top:0,left:l}).left}}u=s||o||n||r;if(c.snapMode!=="outer"){s=Math.abs(h-v)<=d;o=Math.abs(f-_)<=d;n=Math.abs(a-g)<=d;r=Math.abs(l-m)<=d;if(s){e.position.top=i._convertPositionTo("relative",{top:h,left:0}).top}if(o){e.position.top=i._convertPositionTo("relative",{top:f-i.helperProportions.height,left:0}).top}if(n){e.position.left=i._convertPositionTo("relative",{top:0,left:a}).left}if(r){e.position.left=i._convertPositionTo("relative",{top:0,left:l-i.helperProportions.width}).left}}if(!i.snapElements[p].snapping&&(s||o||n||r||u)){i.options.snap.snap&&i.options.snap.snap.call(i.element,t,b.extend(i._uiHash(),{snapItem:i.snapElements[p].item}))}i.snapElements[p].snapping=s||o||n||r||u}}}),b.ui.plugin.add("draggable","stack",{start:function(t,e,i){var s,o=i.options,n=b.makeArray(b(o.stack)).sort(function(t,e){return(parseInt(b(t).css("zIndex"),10)||0)-(parseInt(b(e).css("zIndex"),10)||0)});if(!n.length){return}s=parseInt(b(n[0]).css("zIndex"),10)||0;b(n).each(function(t){b(this).css("zIndex",s+t)});this.css("zIndex",s+n.length)}}),b.ui.plugin.add("draggable","zIndex",{start:function(t,e,i){var s=b(e.helper),o=i.options;if(s.css("zIndex")){o._zIndex=s.css("zIndex")}s.css("zIndex",o.zIndex)},stop:function(t,e,i){var s=i.options;if(s._zIndex){b(e.helper).css("zIndex",s._zIndex)}}});var c=b.ui.draggable;b.widget("ui.droppable",{version:"1.12.1",widgetEventPrefix:"drop",options:{accept:"*",addClasses:true,greedy:false,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t,e=this.options,i=e.accept;this.isover=false;this.isout=true;this.accept=b.isFunction(i)?i:function(t){return t.is(i)};this.proportions=function(){if(arguments.length){t=arguments[0]}else{return t?t:t={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}}};this._addToManager(e.scope);e.addClasses&&this._addClass("ui-droppable")},_addToManager:function(t){b.ui.ddmanager.droppables[t]=b.ui.ddmanager.droppables[t]||[];b.ui.ddmanager.droppables[t].push(this)},_splice:function(t){var e=0;for(;e<t.length;e++){if(t[e]===this){t.splice(e,1)}}},_destroy:function(){var t=b.ui.ddmanager.droppables[this.options.scope];this._splice(t)},_setOption:function(t,e){if(t==="accept"){this.accept=b.isFunction(e)?e:function(t){return t.is(e)}}else if(t==="scope"){var i=b.ui.ddmanager.droppables[this.options.scope];this._splice(i);this._addToManager(e)}this._super(t,e)},_activate:function(t){var e=b.ui.ddmanager.current;this._addActiveClass();if(e){this._trigger("activate",t,this.ui(e))}},_deactivate:function(t){var e=b.ui.ddmanager.current;this._removeActiveClass();if(e){this._trigger("deactivate",t,this.ui(e))}},_over:function(t){var e=b.ui.ddmanager.current;if(!e||(e.currentItem||e.element)[0]===this.element[0]){return}if(this.accept.call(this.element[0],e.currentItem||e.element)){this._addHoverClass();this._trigger("over",t,this.ui(e))}},_out:function(t){var e=b.ui.ddmanager.current;if(!e||(e.currentItem||e.element)[0]===this.element[0]){return}if(this.accept.call(this.element[0],e.currentItem||e.element)){this._removeHoverClass();this._trigger("out",t,this.ui(e))}},_drop:function(e,t){var i=t||b.ui.ddmanager.current,s=false;if(!i||(i.currentItem||i.element)[0]===this.element[0]){return false}this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var t=b(this).droppable("instance");if(t.options.greedy&&!t.options.disabled&&t.options.scope===i.options.scope&&t.accept.call(t.element[0],i.currentItem||i.element)&&d(i,b.extend(t,{offset:t.element.offset()}),t.options.tolerance,e)){s=true;return false}});if(s){return false}if(this.accept.call(this.element[0],i.currentItem||i.element)){this._removeActiveClass();this._removeHoverClass();this._trigger("drop",e,this.ui(i));return this.element}return false},ui:function(t){return{draggable:t.currentItem||t.element,helper:t.helper,position:t.position,offset:t.positionAbs}},_addHoverClass:function(){this._addClass("ui-droppable-hover")},_removeHoverClass:function(){this._removeClass("ui-droppable-hover")},_addActiveClass:function(){this._addClass("ui-droppable-active")},_removeActiveClass:function(){this._removeClass("ui-droppable-active")}});var d=b.ui.intersect=function(){function u(t,e,i){return t>=e&&t<e+i}return function(t,e,i,s){if(!e.offset){return false}var o=(t.positionAbs||t.position.absolute).left+t.margins.left,n=(t.positionAbs||t.position.absolute).top+t.margins.top,r=o+t.helperProportions.width,a=n+t.helperProportions.height,l=e.offset.left,h=e.offset.top,f=l+e.proportions().width,p=h+e.proportions().height;switch(i){case"fit":return l<=o&&r<=f&&h<=n&&a<=p;case"intersect":return l<o+t.helperProportions.width/2&&r-t.helperProportions.width/2<f&&h<n+t.helperProportions.height/2&&a-t.helperProportions.height/2<p;case"pointer":return u(s.pageY,h,e.proportions().height)&&u(s.pageX,l,e.proportions().width);case"touch":return(n>=h&&n<=p||a>=h&&a<=p||n<h&&a>p)&&(o>=l&&o<=f||r>=l&&r<=f||o<l&&r>f);default:return false}}}();if(b.ui.ddmanager={current:null,droppables:{default:[]},prepareOffsets:function(t,e){var i,s,o=b.ui.ddmanager.droppables[t.options.scope]||[],n=e?e.type:null,r=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();t:for(i=0;i<o.length;i++){if(o[i].options.disabled||t&&!o[i].accept.call(o[i].element[0],t.currentItem||t.element)){continue}for(s=0;s<r.length;s++){if(r[s]===o[i].element[0]){o[i].proportions().height=0;continue t}}o[i].visible=o[i].element.css("display")!=="none";if(!o[i].visible){continue}if(n==="mousedown"){o[i]._activate.call(o[i],e)}o[i].offset=o[i].element.offset();o[i].proportions({width:o[i].element[0].offsetWidth,height:o[i].element[0].offsetHeight})}},drop:function(t,e){var i=false;b.each((b.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){if(!this.options){return}if(!this.options.disabled&&this.visible&&d(t,this,this.options.tolerance,e)){i=this._drop.call(this,e)||i}if(!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)){this.isout=true;this.isover=false;this._deactivate.call(this,e)}});return i},dragStart:function(t,e){t.element.parentsUntil("body").on("scroll.droppable",function(){if(!t.options.refreshPositions){b.ui.ddmanager.prepareOffsets(t,e)}})},drag:function(n,r){if(n.options.refreshPositions){b.ui.ddmanager.prepareOffsets(n,r)}b.each(b.ui.ddmanager.droppables[n.options.scope]||[],function(){if(this.options.disabled||this.greedyChild||!this.visible){return}var t,e,i,s=d(n,this,this.options.tolerance,r),o=!s&&this.isover?"isout":s&&!this.isover?"isover":null;if(!o){return}if(this.options.greedy){e=this.options.scope;i=this.element.parents(":data(ui-droppable)").filter(function(){return b(this).droppable("instance").options.scope===e});if(i.length){t=b(i[0]).droppable("instance");t.greedyChild=o==="isover"}}if(t&&o==="isover"){t.isover=false;t.isout=true;t._out.call(t,r)}this[o]=true;this[o==="isout"?"isover":"isout"]=false;this[o==="isover"?"_over":"_out"].call(this,r);if(t&&o==="isout"){t.isout=false;t.isover=true;t._over.call(t,r)}})},dragStop:function(t,e){t.element.parentsUntil("body").off("scroll.droppable");if(!t.options.refreshPositions){b.ui.ddmanager.prepareOffsets(t,e)}}},b.uiBackCompat!==false){b.widget("ui.droppable",b.ui.droppable,{options:{hoverClass:false,activeClass:false},_addActiveClass:function(){this._super();if(this.options.activeClass){this.element.addClass(this.options.activeClass)}},_removeActiveClass:function(){this._super();if(this.options.activeClass){this.element.removeClass(this.options.activeClass)}},_addHoverClass:function(){this._super();if(this.options.hoverClass){this.element.addClass(this.options.hoverClass)}},_removeHoverClass:function(){this._super();if(this.options.hoverClass){this.element.removeClass(this.options.hoverClass)}}})}var g=b.ui.droppable;b.widget("ui.resizable",b.ui.mouse,{version:"1.12.1",widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,classes:{"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(t){return parseFloat(t)||0},_isNumber:function(t){return!isNaN(parseFloat(t))},_hasScroll:function(t,e){if(b(t).css("overflow")==="hidden"){return false}var i=e&&e==="left"?"scrollLeft":"scrollTop",s=false;if(t[i]>0){return true}t[i]=1;s=t[i]>0;t[i]=0;return s},_create:function(){var t,e=this.options,i=this;this._addClass("ui-resizable");b.extend(this,{_aspectRatio:!!e.aspectRatio,aspectRatio:e.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:e.helper||e.ghost||e.animate?e.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)){this.element.wrap(b("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance"));this.elementIsWrapper=true;t={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")};this.element.css(t);this.originalElement.css("margin",0);this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css(t);this._proportionallyResize()}this._setupHandles();if(e.autoHide){b(this.element).on("mouseenter",function(){if(e.disabled){return}i._removeClass("ui-resizable-autohide");i._handles.show()}).on("mouseleave",function(){if(e.disabled){return}if(!i.resizing){i._addClass("ui-resizable-autohide");i._handles.hide()}})}this._mouseInit()},_destroy:function(){this._mouseDestroy();var t,e=function(t){b(t).removeData("resizable").removeData("ui-resizable").off(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){e(this.element);t=this.element;this.originalElement.css({position:t.css("position"),width:t.outerWidth(),height:t.outerHeight(),top:t.css("top"),left:t.css("left")}).insertAfter(t);t.remove()}this.originalElement.css("resize",this.originalResizeStyle);e(this.originalElement);return this},_setOption:function(t,e){this._super(t,e);switch(t){case"handles":this._removeHandles();this._setupHandles();break;default:break}},_setupHandles:function(){var t=this.options,e,i,s,o,n,r=this;this.handles=t.handles||(!b(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});this._handles=b();if(this.handles.constructor===String){if(this.handles==="all"){this.handles="n,e,s,w,se,sw,ne,nw"}s=this.handles.split(",");this.handles={};for(i=0;i<s.length;i++){e=b.trim(s[i]);o="ui-resizable-"+e;n=b("<div>");this._addClass(n,"ui-resizable-handle "+o);n.css({zIndex:t.zIndex});this.handles[e]=".ui-resizable-"+e;this.element.append(n)}}this._renderAxis=function(t){var e,i,s,o;t=t||this.element;for(e in this.handles){if(this.handles[e].constructor===String){this.handles[e]=this.element.children(this.handles[e]).first().show()}else if(this.handles[e].jquery||this.handles[e].nodeType){this.handles[e]=b(this.handles[e]);this._on(this.handles[e],{mousedown:r._mouseDown})}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)){i=b(this.handles[e],this.element);o=/sw|ne|nw|se|n|s/.test(e)?i.outerHeight():i.outerWidth();s=["padding",/ne|nw|n/.test(e)?"Top":/se|sw|s/.test(e)?"Bottom":/^e$/.test(e)?"Right":"Left"].join("");t.css(s,o);this._proportionallyResize()}this._handles=this._handles.add(this.handles[e])}};this._renderAxis(this.element);this._handles=this._handles.add(this.element.find(".ui-resizable-handle"));this._handles.disableSelection();this._handles.on("mouseover",function(){if(!r.resizing){if(this.className){n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}r.axis=n&&n[1]?n[1]:"se"}});if(t.autoHide){this._handles.hide();this._addClass("ui-resizable-autohide")}},_removeHandles:function(){this._handles.remove()},_mouseCapture:function(t){var e,i,s=false;for(e in this.handles){i=b(this.handles[e])[0];if(i===t.target||b.contains(i,t.target)){s=true}}return!this.options.disabled&&s},_mouseStart:function(t){var e,i,s,o=this.options,n=this.element;this.resizing=true;this._renderProxy();e=this._num(this.helper.css("left"));i=this._num(this.helper.css("top"));if(o.containment){e+=b(o.containment).scrollLeft()||0;i+=b(o.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:e,top:i};this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:n.width(),height:n.height()};this.originalSize=this._helper?{width:n.outerWidth(),height:n.outerHeight()}:{width:n.width(),height:n.height()};this.sizeDiff={width:n.outerWidth()-n.width(),height:n.outerHeight()-n.height()};this.originalPosition={left:e,top:i};this.originalMousePosition={left:t.pageX,top:t.pageY};this.aspectRatio=typeof o.aspectRatio==="number"?o.aspectRatio:this.originalSize.width/this.originalSize.height||1;s=b(".ui-resizable-"+this.axis).css("cursor");b("body").css("cursor",s==="auto"?this.axis+"-resize":s);this._addClass("ui-resizable-resizing");this._propagate("start",t);return true},_mouseDrag:function(t){var e,i,s=this.originalMousePosition,o=this.axis,n=t.pageX-s.left||0,r=t.pageY-s.top||0,a=this._change[o];this._updatePrevProperties();if(!a){return false}e=a.apply(this,[t,n,r]);this._updateVirtualBoundaries(t.shiftKey);if(this._aspectRatio||t.shiftKey){e=this._updateRatio(e,t)}e=this._respectSize(e,t);this._updateCache(e);this._propagate("resize",t);i=this._applyChanges();if(!this._helper&&this._proportionallyResizeElements.length){this._proportionallyResize()}if(!b.isEmptyObject(i)){this._updatePrevProperties();this._trigger("resize",t,this.ui());this._applyChanges()}return false},_mouseStop:function(t){this.resizing=false;var e,i,s,o,n,r,a,l=this.options,h=this;if(this._helper){e=this._proportionallyResizeElements;i=e.length&&/textarea/i.test(e[0].nodeName);s=i&&this._hasScroll(e[0],"left")?0:h.sizeDiff.height;o=i?0:h.sizeDiff.width;n={width:h.helper.width()-o,height:h.helper.height()-s};r=parseFloat(h.element.css("left"))+(h.position.left-h.originalPosition.left)||null;a=parseFloat(h.element.css("top"))+(h.position.top-h.originalPosition.top)||null;if(!l.animate){this.element.css(b.extend(n,{top:a,left:r}))}h.helper.height(h.size.height);h.helper.width(h.size.width);if(this._helper&&!l.animate){this._proportionallyResize()}}b("body").css("cursor","auto");this._removeClass("ui-resizable-resizing");this._propagate("stop",t);if(this._helper){this.helper.remove()}return false},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left};this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var t={};if(this.position.top!==this.prevPosition.top){t.top=this.position.top+"px"}if(this.position.left!==this.prevPosition.left){t.left=this.position.left+"px"}if(this.size.width!==this.prevSize.width){t.width=this.size.width+"px"}if(this.size.height!==this.prevSize.height){t.height=this.size.height+"px"}this.helper.css(t);return t},_updateVirtualBoundaries:function(t){var e,i,s,o,n,r=this.options;n={minWidth:this._isNumber(r.minWidth)?r.minWidth:0,maxWidth:this._isNumber(r.maxWidth)?r.maxWidth:Infinity,minHeight:this._isNumber(r.minHeight)?r.minHeight:0,maxHeight:this._isNumber(r.maxHeight)?r.maxHeight:Infinity};if(this._aspectRatio||t){e=n.minHeight*this.aspectRatio;s=n.minWidth/this.aspectRatio;i=n.maxHeight*this.aspectRatio;o=n.maxWidth/this.aspectRatio;if(e>n.minWidth){n.minWidth=e}if(s>n.minHeight){n.minHeight=s}if(i<n.maxWidth){n.maxWidth=i}if(o<n.maxHeight){n.maxHeight=o}}this._vBoundaries=n},_updateCache:function(t){this.offset=this.helper.offset();if(this._isNumber(t.left)){this.position.left=t.left}if(this._isNumber(t.top)){this.position.top=t.top}if(this._isNumber(t.height)){this.size.height=t.height}if(this._isNumber(t.width)){this.size.width=t.width}},_updateRatio:function(t){var e=this.position,i=this.size,s=this.axis;if(this._isNumber(t.height)){t.width=t.height*this.aspectRatio}else if(this._isNumber(t.width)){t.height=t.width/this.aspectRatio}if(s==="sw"){t.left=e.left+(i.width-t.width);t.top=null}if(s==="nw"){t.top=e.top+(i.height-t.height);t.left=e.left+(i.width-t.width)}return t},_respectSize:function(t){var e=this._vBoundaries,i=this.axis,s=this._isNumber(t.width)&&e.maxWidth&&e.maxWidth<t.width,o=this._isNumber(t.height)&&e.maxHeight&&e.maxHeight<t.height,n=this._isNumber(t.width)&&e.minWidth&&e.minWidth>t.width,r=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,a=this.originalPosition.left+this.originalSize.width,l=this.originalPosition.top+this.originalSize.height,h=/sw|nw|w/.test(i),f=/nw|ne|n/.test(i);if(n){t.width=e.minWidth}if(r){t.height=e.minHeight}if(s){t.width=e.maxWidth}if(o){t.height=e.maxHeight}if(n&&h){t.left=a-e.minWidth}if(s&&h){t.left=a-e.maxWidth}if(r&&f){t.top=l-e.minHeight}if(o&&f){t.top=l-e.maxHeight}if(!t.width&&!t.height&&!t.left&&t.top){t.top=null}else if(!t.width&&!t.height&&!t.top&&t.left){t.left=null}return t},_getPaddingPlusBorderDimensions:function(t){var e=0,i=[],s=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],o=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];for(;e<4;e++){i[e]=parseFloat(s[e])||0;i[e]+=parseFloat(o[e])||0}return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(!this._proportionallyResizeElements.length){return}var t,e=0,i=this.helper||this.element;for(;e<this._proportionallyResizeElements.length;e++){t=this._proportionallyResizeElements[e];if(!this.outerDimensions){this.outerDimensions=this._getPaddingPlusBorderDimensions(t)}t.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})}},_renderProxy:function(){var t=this.element,e=this.options;this.elementOffset=t.offset();if(this._helper){this.helper=this.helper||b("<div style='overflow:hidden;'></div>");this._addClass(this.helper,this._helper);this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++e.zIndex});this.helper.appendTo("body").disableSelection()}else{this.helper=this.element}},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize,s=this.originalPosition;return{left:s.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize,o=this.originalPosition;return{top:o.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(t,e,i){return b.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},sw:function(t,e,i){return b.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,e,i]))},ne:function(t,e,i){return b.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},nw:function(t,e,i){return b.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,e,i]))}},_propagate:function(t,e){b.ui.plugin.call(this,t,[e,this.ui()]);t!=="resize"&&this._trigger(t,e,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),b.ui.plugin.add("resizable","animate",{stop:function(e){var i=b(this).resizable("instance"),t=i.options,s=i._proportionallyResizeElements,o=s.length&&/textarea/i.test(s[0].nodeName),n=o&&i._hasScroll(s[0],"left")?0:i.sizeDiff.height,r=o?0:i.sizeDiff.width,a={width:i.size.width-r,height:i.size.height-n},l=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left)||null,h=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null;i.element.animate(b.extend(a,h&&l?{top:h,left:l}:{}),{duration:t.animateDuration,easing:t.animateEasing,step:function(){var t={width:parseFloat(i.element.css("width")),height:parseFloat(i.element.css("height")),top:parseFloat(i.element.css("top")),left:parseFloat(i.element.css("left"))};if(s&&s.length){b(s[0]).css({width:t.width,height:t.height})}i._updateCache(t);i._propagate("resize",e)}})}}),b.ui.plugin.add("resizable","containment",{start:function(){var i,s,t,e,o,n,r,a=b(this).resizable("instance"),l=a.options,h=a.element,f=l.containment,p=f instanceof b?f.get(0):/parent/.test(f)?h.parent().get(0):f;if(!p){return}a.containerElement=b(p);if(/document/.test(f)||f===document){a.containerOffset={left:0,top:0};a.containerPosition={left:0,top:0};a.parentData={element:b(document),left:0,top:0,width:b(document).width(),height:b(document).height()||document.body.parentNode.scrollHeight}}else{i=b(p);s=[];b(["Top","Right","Left","Bottom"]).each(function(t,e){s[t]=a._num(i.css("padding"+e))});a.containerOffset=i.offset();a.containerPosition=i.position();a.containerSize={height:i.innerHeight()-s[3],width:i.innerWidth()-s[1]};t=a.containerOffset;e=a.containerSize.height;o=a.containerSize.width;n=a._hasScroll(p,"left")?p.scrollWidth:o;r=a._hasScroll(p)?p.scrollHeight:e;a.parentData={element:p,left:t.left,top:t.top,width:n,height:r}}},resize:function(t){var e,i,s,o,n=b(this).resizable("instance"),r=n.options,a=n.containerOffset,l=n.position,h=n._aspectRatio||t.shiftKey,f={top:0,left:0},p=n.containerElement,u=true;if(p[0]!==document&&/static/.test(p.css("position"))){f=a}if(l.left<(n._helper?a.left:0)){n.size.width=n.size.width+(n._helper?n.position.left-a.left:n.position.left-f.left);if(h){n.size.height=n.size.width/n.aspectRatio;u=false}n.position.left=r.helper?a.left:0}if(l.top<(n._helper?a.top:0)){n.size.height=n.size.height+(n._helper?n.position.top-a.top:n.position.top);if(h){n.size.width=n.size.height*n.aspectRatio;u=false}n.position.top=n._helper?a.top:0}s=n.containerElement.get(0)===n.element.parent().get(0);o=/relative|absolute/.test(n.containerElement.css("position"));if(s&&o){n.offset.left=n.parentData.left+n.position.left;n.offset.top=n.parentData.top+n.position.top}else{n.offset.left=n.element.offset().left;n.offset.top=n.element.offset().top}e=Math.abs(n.sizeDiff.width+(n._helper?n.offset.left-f.left:n.offset.left-a.left));i=Math.abs(n.sizeDiff.height+(n._helper?n.offset.top-f.top:n.offset.top-a.top));if(e+n.size.width>=n.parentData.width){n.size.width=n.parentData.width-e;if(h){n.size.height=n.size.width/n.aspectRatio;u=false}}if(i+n.size.height>=n.parentData.height){n.size.height=n.parentData.height-i;if(h){n.size.width=n.size.height*n.aspectRatio;u=false}}if(!u){n.position.left=n.prevPosition.left;n.position.top=n.prevPosition.top;n.size.width=n.prevSize.width;n.size.height=n.prevSize.height}},stop:function(){var t=b(this).resizable("instance"),e=t.options,i=t.containerOffset,s=t.containerPosition,o=t.containerElement,n=b(t.helper),r=n.offset(),a=n.outerWidth()-t.sizeDiff.width,l=n.outerHeight()-t.sizeDiff.height;if(t._helper&&!e.animate&&/relative/.test(o.css("position"))){b(this).css({left:r.left-s.left-i.left,width:a,height:l})}if(t._helper&&!e.animate&&/static/.test(o.css("position"))){b(this).css({left:r.left-s.left-i.left,width:a,height:l})}}}),b.ui.plugin.add("resizable","alsoResize",{start:function(){var t=b(this).resizable("instance"),e=t.options;b(e.alsoResize).each(function(){var t=b(this);t.data("ui-resizable-alsoresize",{width:parseFloat(t.width()),height:parseFloat(t.height()),left:parseFloat(t.css("left")),top:parseFloat(t.css("top"))})})},resize:function(t,i){var e=b(this).resizable("instance"),s=e.options,o=e.originalSize,n=e.originalPosition,r={height:e.size.height-o.height||0,width:e.size.width-o.width||0,top:e.position.top-n.top||0,left:e.position.left-n.left||0};b(s.alsoResize).each(function(){var t=b(this),s=b(this).data("ui-resizable-alsoresize"),o={},e=t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];b.each(e,function(t,e){var i=(s[e]||0)+(r[e]||0);if(i&&i>=0){o[e]=i||null}});t.css(o)})},stop:function(){b(this).removeData("ui-resizable-alsoresize")}}),b.ui.plugin.add("resizable","ghost",{start:function(){var t=b(this).resizable("instance"),e=t.size;t.ghost=t.originalElement.clone();t.ghost.css({opacity:.25,display:"block",position:"relative",height:e.height,width:e.width,margin:0,left:0,top:0});t._addClass(t.ghost,"ui-resizable-ghost");if(b.uiBackCompat!==false&&typeof t.options.ghost==="string"){t.ghost.addClass(this.options.ghost)}t.ghost.appendTo(t.helper)},resize:function(){var t=b(this).resizable("instance");if(t.ghost){t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})}},stop:function(){var t=b(this).resizable("instance");if(t.ghost&&t.helper){t.helper.get(0).removeChild(t.ghost.get(0))}}}),b.ui.plugin.add("resizable","grid",{resize:function(){var t,e=b(this).resizable("instance"),i=e.options,s=e.size,o=e.originalSize,n=e.originalPosition,r=e.axis,a=typeof i.grid==="number"?[i.grid,i.grid]:i.grid,l=a[0]||1,h=a[1]||1,f=Math.round((s.width-o.width)/l)*l,p=Math.round((s.height-o.height)/h)*h,u=o.width+f,c=o.height+p,d=i.maxWidth&&i.maxWidth<u,g=i.maxHeight&&i.maxHeight<c,m=i.minWidth&&i.minWidth>u,v=i.minHeight&&i.minHeight>c;i.grid=a;if(m){u+=l}if(v){c+=h}if(d){u-=l}if(g){c-=h}if(/^(se|s|e)$/.test(r)){e.size.width=u;e.size.height=c}else if(/^(ne)$/.test(r)){e.size.width=u;e.size.height=c;e.position.top=n.top-p}else if(/^(sw)$/.test(r)){e.size.width=u;e.size.height=c;e.position.left=n.left-f}else{if(c-h<=0||u-l<=0){t=e._getPaddingPlusBorderDimensions(this)}if(c-h>0){e.size.height=c;e.position.top=n.top-p}else{c=h-t.height;e.size.height=c;e.position.top=n.top+o.height-c}if(u-l>0){e.size.width=u;e.position.left=n.left-f}else{u=l-t.width;e.size.width=u;e.position.left=n.left+o.width-u}}}});var m=b.ui.resizable}(jQuery);
!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(w){w.ui=w.ui||{};w.ui.version="1.12.1";var o,i=0,a=Array.prototype.slice;w.cleanData=(o=w.cleanData,function(t){var e,i,s;for(s=0;null!=(i=t[s]);s++)try{(e=w._data(i,"events"))&&e.remove&&w(i).triggerHandler("remove")}catch(t){}o(t)}),w.widget=function(t,i,e){var s,o,n,r={},a=t.split(".")[0],h=a+"-"+(t=t.split(".")[1]);return e||(e=i,i=w.Widget),w.isArray(e)&&(e=w.extend.apply(null,[{}].concat(e))),w.expr[":"][h.toLowerCase()]=function(t){return!!w.data(t,h)},w[a]=w[a]||{},s=w[a][t],o=w[a][t]=function(t,e){if(!this._createWidget)return new o(t,e);arguments.length&&this._createWidget(t,e)},w.extend(o,s,{version:e.version,_proto:w.extend({},e),_childConstructors:[]}),(n=new i).options=w.widget.extend({},n.options),w.each(e,function(e,s){function o(){return i.prototype[e].apply(this,arguments)}function n(t){return i.prototype[e].apply(this,t)}w.isFunction(s)?r[e]=function(){var t,e=this._super,i=this._superApply;return this._super=o,this._superApply=n,t=s.apply(this,arguments),this._super=e,this._superApply=i,t}:r[e]=s}),o.prototype=w.widget.extend(n,{widgetEventPrefix:s&&n.widgetEventPrefix||t},r,{constructor:o,namespace:a,widgetName:t,widgetFullName:h}),s?(w.each(s._childConstructors,function(t,e){var i=e.prototype;w.widget(i.namespace+"."+i.widgetName,o,e._proto)}),delete s._childConstructors):i._childConstructors.push(o),w.widget.bridge(t,o),o},w.widget.extend=function(t){for(var e,i,s=a.call(arguments,1),o=0,n=s.length;o<n;o++)for(e in s[o])i=s[o][e],s[o].hasOwnProperty(e)&&void 0!==i&&(w.isPlainObject(i)?t[e]=w.isPlainObject(t[e])?w.widget.extend({},t[e],i):w.widget.extend({},i):t[e]=i);return t},w.widget.bridge=function(n,e){var r=e.prototype.widgetFullName||n;w.fn[n]=function(i){var t="string"==typeof i,s=a.call(arguments,1),o=this;return t?this.length||"instance"!==i?this.each(function(){var t,e=w.data(this,r);return"instance"===i?(o=e,!1):e?w.isFunction(e[i])&&"_"!==i.charAt(0)?(t=e[i].apply(e,s))!==e&&void 0!==t?(o=t&&t.jquery?o.pushStack(t.get()):t,!1):void 0:w.error("no such method '"+i+"' for "+n+" widget instance"):w.error("cannot call methods on "+n+" prior to initialization; attempted to call method '"+i+"'")}):o=void 0:(s.length&&(i=w.widget.extend.apply(null,[i].concat(s))),this.each(function(){var t=w.data(this,r);t?(t.option(i||{}),t._init&&t._init()):w.data(this,r,new e(i,this))})),o}},w.Widget=function(){},w.Widget._childConstructors=[],w.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,e){e=w(e||this.defaultElement||this)[0],this.element=w(e),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=w(),this.hoverable=w(),this.focusable=w(),this.classesElementLookup={},e!==this&&(w.data(e,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===e&&this.destroy()}}),this.document=w(e.style?e.ownerDocument:e.document||e),this.window=w(this.document[0].defaultView||this.document[0].parentWindow)),this.options=w.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:w.noop,_create:w.noop,_init:w.noop,destroy:function(){var i=this;this._destroy(),w.each(this.classesElementLookup,function(t,e){i._removeClass(e,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:w.noop,widget:function(){return this.element},option:function(t,e){var i,s,o,n=t;if(0===arguments.length)return w.widget.extend({},this.options);if("string"==typeof t)if(n={},t=(i=t.split(".")).shift(),i.length){for(s=n[t]=w.widget.extend({},this.options[t]),o=0;o<i.length-1;o++)s[i[o]]=s[i[o]]||{},s=s[i[o]];if(t=i.pop(),1===arguments.length)return void 0===s[t]?null:s[t];s[t]=e}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];n[t]=e}return this._setOptions(n),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(t){var e,i,s;for(e in t)s=this.classesElementLookup[e],t[e]!==this.options.classes[e]&&s&&s.length&&(i=w(s.get()),this._removeClass(s,e),i.addClass(this._classes({element:i,keys:e,classes:t,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(o){var n=[],r=this;function t(t,e){var i,s;for(s=0;s<t.length;s++)i=r.classesElementLookup[t[s]]||w(),i=o.add?w(w.unique(i.get().concat(o.element.get()))):w(i.not(o.element).get()),r.classesElementLookup[t[s]]=i,n.push(t[s]),e&&o.classes[t[s]]&&n.push(o.classes[t[s]])}return o=w.extend({element:this.element,classes:this.options.classes||{}},o),this._on(o.element,{remove:"_untrackClassesElement"}),o.keys&&t(o.keys.match(/\S+/g)||[],!0),o.extra&&t(o.extra.match(/\S+/g)||[]),n.join(" ")},_untrackClassesElement:function(i){var s=this;w.each(s.classesElementLookup,function(t,e){-1!==w.inArray(i.target,e)&&(s.classesElementLookup[t]=w(e.not(i.target).get()))})},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,s){s="boolean"==typeof s?s:i;var o="string"==typeof t||null===t,n={extra:o?e:i,keys:o?t:e,element:o?this.element:t,add:s};return n.element.toggleClass(this._classes(n),s),this},_on:function(r,a,t){var h,l=this;"boolean"!=typeof r&&(t=a,a=r,r=!1),t?(a=h=w(a),this.bindings=this.bindings.add(a)):(t=a,a=this.element,h=this.widget()),w.each(t,function(t,e){function i(){if(r||!0!==l.options.disabled&&!w(this).hasClass("ui-state-disabled"))return("string"==typeof e?l[e]:e).apply(l,arguments)}"string"!=typeof e&&(i.guid=e.guid=e.guid||i.guid||w.guid++);var s=t.match(/^([\w:-]*)\s*(.*)$/),o=s[1]+l.eventNamespace,n=s[2];n?h.on(o,n,i):a.on(o,i)})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.off(e).off(e),this.bindings=w(this.bindings.not(t).get()),this.focusable=w(this.focusable.not(t).get()),this.hoverable=w(this.hoverable.not(t).get())},_delay:function(t,e){var i=this;return setTimeout(function(){return("string"==typeof t?i[t]:t).apply(i,arguments)},e||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){this._addClass(w(t.currentTarget),null,"ui-state-hover")},mouseleave:function(t){this._removeClass(w(t.currentTarget),null,"ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){this._addClass(w(t.currentTarget),null,"ui-state-focus")},focusout:function(t){this._removeClass(w(t.currentTarget),null,"ui-state-focus")}})},_trigger:function(t,e,i){var s,o,n=this.options[t];if(i=i||{},(e=w.Event(e)).type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),e.target=this.element[0],o=e.originalEvent)for(s in o)s in e||(e[s]=o[s]);return this.element.trigger(e,i),!(w.isFunction(n)&&!1===n.apply(this.element[0],[e].concat(i))||e.isDefaultPrevented())}},w.each({show:"fadeIn",hide:"fadeOut"},function(n,r){w.Widget.prototype["_"+n]=function(e,t,i){var s;"string"==typeof t&&(t={effect:t});var o=t?!0!==t&&"number"!=typeof t&&t.effect||r:n;"number"==typeof(t=t||{})&&(t={duration:t}),s=!w.isEmptyObject(t),t.complete=i,t.delay&&e.delay(t.delay),s&&w.effects&&w.effects.effect[o]?e[n](t):o!==n&&e[o]?e[o](t.duration,t.easing,i):e.queue(function(t){w(this)[n](),i&&i.call(e[0]),t()})}});w.widget,w.extend(w.expr[":"],{data:w.expr.createPseudo?w.expr.createPseudo(function(e){return function(t){return!!w.data(t,e)}}):function(t,e,i){return!!w.data(t,i[3])}}),w.fn.extend({disableSelection:(t="onselectstart"in document.createElement("div")?"selectstart":"mousedown",function(){return this.on(t+".ui-disableSelection",function(t){t.preventDefault()})}),enableSelection:function(){return this.off(".ui-disableSelection")}}),w.fn.scrollParent=function(t){var e=this.css("position"),i="absolute"===e,s=t?/(auto|scroll|hidden)/:/(auto|scroll)/,o=this.parents().filter(function(){var t=w(this);return(!i||"static"!==t.css("position"))&&s.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==e&&o.length?o:w(this[0].ownerDocument||document)},w.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());var t,n=!1;w(document).on("mouseup",function(){n=!1});w.widget("ui.mouse",{version:"1.12.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.on("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).on("click."+this.widgetName,function(t){if(!0===w.data(t.target,e.widgetName+".preventClickEvent"))return w.removeData(t.target,e.widgetName+".preventClickEvent"),t.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(!n){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var e=this,i=1===t.which,s=!("string"!=typeof this.options.cancel||!t.target.nodeName)&&w(t.target).closest(this.options.cancel).length;return i&&!s&&this._mouseCapture(t)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){e.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=!1!==this._mouseStart(t),!this._mouseStarted)?(t.preventDefault(),!0):(!0===w.data(t.target,this.widgetName+".preventClickEvent")&&w.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return e._mouseMove(t)},this._mouseUpDelegate=function(t){return e._mouseUp(t)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),n=!0)):!0}},_mouseMove:function(t){if(this._mouseMoved){if(w.ui.ie&&(!document.documentMode||document.documentMode<9)&&!t.button)return this._mouseUp(t);if(!t.which)if(t.originalEvent.altKey||t.originalEvent.ctrlKey||t.originalEvent.metaKey||t.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(t)}return(t.which||t.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,t),this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&w.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,n=!1,t.preventDefault()},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),w.ui.plugin={add:function(t,e,i){var s,o=w.ui[t].prototype;for(s in i)o.plugins[s]=o.plugins[s]||[],o.plugins[s].push([e,i[s]])},call:function(t,e,i,s){var o,n=t.plugins[e];if(n&&(s||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(o=0;o<n.length;o++)t.options[n[o][0]]&&n[o][1].apply(t.element,i)}},w.ui.safeActiveElement=function(e){var i;try{i=e.activeElement}catch(t){i=e.body}return(i=i||e.body).nodeName||(i=e.body),i},w.ui.safeBlur=function(t){t&&"body"!==t.nodeName.toLowerCase()&&w(t).trigger("blur")};w.widget("ui.draggable",w.ui.mouse,{version:"1.12.1",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this._addClass("ui-draggable"),this._setHandleClassName(),this._mouseInit()},_setOption:function(t,e){this._super(t,e),"handle"===t&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){(this.helper||this.element).is(".ui-draggable-dragging")?this.destroyOnClear=!0:(this._removeHandleClassName(),this._mouseDestroy())},_mouseCapture:function(t){var e=this.options;return!(this.helper||e.disabled||0<w(t.target).closest(".ui-resizable-handle").length)&&(this.handle=this._getHandle(t),!!this.handle&&(this._blurActiveElement(t),this._blockFrames(!0===e.iframeFix?"iframe":e.iframeFix),!0))},_blockFrames:function(t){this.iframeBlocks=this.document.find(t).map(function(){var t=w(this);return w("<div>").css("position","absolute").appendTo(t.parent()).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(t){var e=w.ui.safeActiveElement(this.document[0]);w(t.target).closest(e).length||w.ui.safeBlur(e)},_mouseStart:function(t){var e=this.options;return this.helper=this._createHelper(t),this._addClass(this.helper,"ui-draggable-dragging"),this._cacheHelperProportions(),w.ui.ddmanager&&(w.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=0<this.helper.parents().filter(function(){return"fixed"===w(this).css("position")}).length,this.positionAbs=this.element.offset(),this._refreshOffsets(t),this.originalPosition=this.position=this._generatePosition(t,!1),this.originalPageX=t.pageX,this.originalPageY=t.pageY,e.cursorAt&&this._adjustOffsetFromHelper(e.cursorAt),this._setContainment(),!1===this._trigger("start",t)?(this._clear(),!1):(this._cacheHelperProportions(),w.ui.ddmanager&&!e.dropBehaviour&&w.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),w.ui.ddmanager&&w.ui.ddmanager.dragStart(this,t),!0)},_refreshOffsets:function(t){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:t.pageX-this.offset.left,top:t.pageY-this.offset.top}},_mouseDrag:function(t,e){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t,!0),this.positionAbs=this._convertPositionTo("absolute"),!e){var i=this._uiHash();if(!1===this._trigger("drag",t,i))return this._mouseUp(new w.Event("mouseup",t)),!1;this.position=i.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",w.ui.ddmanager&&w.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var e=this,i=!1;return w.ui.ddmanager&&!this.options.dropBehaviour&&(i=w.ui.ddmanager.drop(this,t)),this.dropped&&(i=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!i||"valid"===this.options.revert&&i||!0===this.options.revert||w.isFunction(this.options.revert)&&this.options.revert.call(this.element,i)?w(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){!1!==e._trigger("stop",t)&&e._clear()}):!1!==this._trigger("stop",t)&&this._clear(),!1},_mouseUp:function(t){return this._unblockFrames(),w.ui.ddmanager&&w.ui.ddmanager.dragStop(this,t),this.handleElement.is(t.target)&&this.element.trigger("focus"),w.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp(new w.Event("mouseup",{target:this.element[0]})):this._clear(),this},_getHandle:function(t){return!this.options.handle||!!w(t.target).closest(this.element.find(this.options.handle)).length},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this._addClass(this.handleElement,"ui-draggable-handle")},_removeHandleClassName:function(){this._removeClass(this.handleElement,"ui-draggable-handle")},_createHelper:function(t){var e=this.options,i=w.isFunction(e.helper),s=i?w(e.helper.apply(this.element[0],[t])):"clone"===e.helper?this.element.clone().removeAttr("id"):this.element;return s.parents("body").length||s.appendTo("parent"===e.appendTo?this.element[0].parentNode:e.appendTo),i&&s[0]===this.element[0]&&this._setPositionRelative(),s[0]===this.element[0]||/(fixed|absolute)/.test(s.css("position"))||s.css("position","absolute"),s},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),w.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_isRootNode:function(t){return/(html|body)/i.test(t.tagName)||t===this.document[0]},_getParentOffset:function(){var t=this.offsetParent.offset(),e=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==e&&w.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var t=this.element.position(),e=this._isRootNode(this.scrollParent[0]);return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+(e?0:this.scrollParent.scrollTop()),left:t.left-(parseInt(this.helper.css("left"),10)||0)+(e?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,e,i,s=this.options,o=this.document[0];this.relativeContainer=null,s.containment?"window"!==s.containment?"document"!==s.containment?s.containment.constructor!==Array?("parent"===s.containment&&(s.containment=this.helper[0].parentNode),(i=(e=w(s.containment))[0])&&(t=/(scroll|auto)/.test(e.css("overflow")),this.containment=[(parseInt(e.css("borderLeftWidth"),10)||0)+(parseInt(e.css("paddingLeft"),10)||0),(parseInt(e.css("borderTopWidth"),10)||0)+(parseInt(e.css("paddingTop"),10)||0),(t?Math.max(i.scrollWidth,i.offsetWidth):i.offsetWidth)-(parseInt(e.css("borderRightWidth"),10)||0)-(parseInt(e.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(i.scrollHeight,i.offsetHeight):i.offsetHeight)-(parseInt(e.css("borderBottomWidth"),10)||0)-(parseInt(e.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=e)):this.containment=s.containment:this.containment=[0,0,w(o).width()-this.helperProportions.width-this.margins.left,(w(o).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]:this.containment=[w(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,w(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,w(window).scrollLeft()+w(window).width()-this.helperProportions.width-this.margins.left,w(window).scrollTop()+(w(window).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]:this.containment=null},_convertPositionTo:function(t,e){e=e||this.position;var i="absolute"===t?1:-1,s=this._isRootNode(this.scrollParent[0]);return{top:e.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.offset.scroll.top:s?0:this.offset.scroll.top)*i,left:e.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.offset.scroll.left:s?0:this.offset.scroll.left)*i}},_generatePosition:function(t,e){var i,s,o,n,r=this.options,a=this._isRootNode(this.scrollParent[0]),h=t.pageX,l=t.pageY;return a&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),e&&(this.containment&&(i=this.relativeContainer?(s=this.relativeContainer.offset(),[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):this.containment,t.pageX-this.offset.click.left<i[0]&&(h=i[0]+this.offset.click.left),t.pageY-this.offset.click.top<i[1]&&(l=i[1]+this.offset.click.top),t.pageX-this.offset.click.left>i[2]&&(h=i[2]+this.offset.click.left),t.pageY-this.offset.click.top>i[3]&&(l=i[3]+this.offset.click.top)),r.grid&&(o=r.grid[1]?this.originalPageY+Math.round((l-this.originalPageY)/r.grid[1])*r.grid[1]:this.originalPageY,l=!i||o-this.offset.click.top>=i[1]||o-this.offset.click.top>i[3]?o:o-this.offset.click.top>=i[1]?o-r.grid[1]:o+r.grid[1],n=r.grid[0]?this.originalPageX+Math.round((h-this.originalPageX)/r.grid[0])*r.grid[0]:this.originalPageX,h=!i||n-this.offset.click.left>=i[0]||n-this.offset.click.left>i[2]?n:n-this.offset.click.left>=i[0]?n-r.grid[0]:n+r.grid[0]),"y"===r.axis&&(h=this.originalPageX),"x"===r.axis&&(l=this.originalPageY)),{top:l-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:a?0:this.offset.scroll.top),left:h-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:a?0:this.offset.scroll.left)}},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_trigger:function(t,e,i){return i=i||this._uiHash(),w.ui.plugin.call(this,t,[e,i,this],!0),/^(drag|start|stop)/.test(t)&&(this.positionAbs=this._convertPositionTo("absolute"),i.offset=this.positionAbs),w.Widget.prototype._trigger.call(this,t,e,i)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),w.ui.plugin.add("draggable","connectToSortable",{start:function(e,t,i){var s=w.extend({},t,{item:i.element});i.sortables=[],w(i.options.connectToSortable).each(function(){var t=w(this).sortable("instance");t&&!t.options.disabled&&(i.sortables.push(t),t.refreshPositions(),t._trigger("activate",e,s))})},stop:function(e,t,i){var s=w.extend({},t,{item:i.element});i.cancelHelperRemoval=!1,w.each(i.sortables,function(){var t=this;t.isOver?(t.isOver=0,i.cancelHelperRemoval=!0,t.cancelHelperRemoval=!1,t._storedCSS={position:t.placeholder.css("position"),top:t.placeholder.css("top"),left:t.placeholder.css("left")},t._mouseStop(e),t.options.helper=t.options._helper):(t.cancelHelperRemoval=!0,t._trigger("deactivate",e,s))})},drag:function(i,s,o){w.each(o.sortables,function(){var t=!1,e=this;e.positionAbs=o.positionAbs,e.helperProportions=o.helperProportions,e.offset.click=o.offset.click,e._intersectsWith(e.containerCache)&&(t=!0,w.each(o.sortables,function(){return this.positionAbs=o.positionAbs,this.helperProportions=o.helperProportions,this.offset.click=o.offset.click,this!==e&&this._intersectsWith(this.containerCache)&&w.contains(e.element[0],this.element[0])&&(t=!1),t})),t?(e.isOver||(e.isOver=1,o._parent=s.helper.parent(),e.currentItem=s.helper.appendTo(e.element).data("ui-sortable-item",!0),e.options._helper=e.options.helper,e.options.helper=function(){return s.helper[0]},i.target=e.currentItem[0],e._mouseCapture(i,!0),e._mouseStart(i,!0,!0),e.offset.click.top=o.offset.click.top,e.offset.click.left=o.offset.click.left,e.offset.parent.left-=o.offset.parent.left-e.offset.parent.left,e.offset.parent.top-=o.offset.parent.top-e.offset.parent.top,o._trigger("toSortable",i),o.dropped=e.element,w.each(o.sortables,function(){this.refreshPositions()}),o.currentItem=o.element,e.fromOutside=o),e.currentItem&&(e._mouseDrag(i),s.position=e.position)):e.isOver&&(e.isOver=0,e.cancelHelperRemoval=!0,e.options._revert=e.options.revert,e.options.revert=!1,e._trigger("out",i,e._uiHash(e)),e._mouseStop(i,!0),e.options.revert=e.options._revert,e.options.helper=e.options._helper,e.placeholder&&e.placeholder.remove(),s.helper.appendTo(o._parent),o._refreshOffsets(i),s.position=o._generatePosition(i,!0),o._trigger("fromSortable",i),o.dropped=!1,w.each(o.sortables,function(){this.refreshPositions()}))})}}),w.ui.plugin.add("draggable","cursor",{start:function(t,e,i){var s=w("body"),o=i.options;s.css("cursor")&&(o._cursor=s.css("cursor")),s.css("cursor",o.cursor)},stop:function(t,e,i){var s=i.options;s._cursor&&w("body").css("cursor",s._cursor)}}),w.ui.plugin.add("draggable","opacity",{start:function(t,e,i){var s=w(e.helper),o=i.options;s.css("opacity")&&(o._opacity=s.css("opacity")),s.css("opacity",o.opacity)},stop:function(t,e,i){var s=i.options;s._opacity&&w(e.helper).css("opacity",s._opacity)}}),w.ui.plugin.add("draggable","scroll",{start:function(t,e,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(t,e,i){var s=i.options,o=!1,n=i.scrollParentNotHidden[0],r=i.document[0];n!==r&&"HTML"!==n.tagName?(s.axis&&"x"===s.axis||(i.overflowOffset.top+n.offsetHeight-t.pageY<s.scrollSensitivity?n.scrollTop=o=n.scrollTop+s.scrollSpeed:t.pageY-i.overflowOffset.top<s.scrollSensitivity&&(n.scrollTop=o=n.scrollTop-s.scrollSpeed)),s.axis&&"y"===s.axis||(i.overflowOffset.left+n.offsetWidth-t.pageX<s.scrollSensitivity?n.scrollLeft=o=n.scrollLeft+s.scrollSpeed:t.pageX-i.overflowOffset.left<s.scrollSensitivity&&(n.scrollLeft=o=n.scrollLeft-s.scrollSpeed))):(s.axis&&"x"===s.axis||(t.pageY-w(r).scrollTop()<s.scrollSensitivity?o=w(r).scrollTop(w(r).scrollTop()-s.scrollSpeed):w(window).height()-(t.pageY-w(r).scrollTop())<s.scrollSensitivity&&(o=w(r).scrollTop(w(r).scrollTop()+s.scrollSpeed))),s.axis&&"y"===s.axis||(t.pageX-w(r).scrollLeft()<s.scrollSensitivity?o=w(r).scrollLeft(w(r).scrollLeft()-s.scrollSpeed):w(window).width()-(t.pageX-w(r).scrollLeft())<s.scrollSensitivity&&(o=w(r).scrollLeft(w(r).scrollLeft()+s.scrollSpeed)))),!1!==o&&w.ui.ddmanager&&!s.dropBehaviour&&w.ui.ddmanager.prepareOffsets(i,t)}}),w.ui.plugin.add("draggable","snap",{start:function(t,e,i){var s=i.options;i.snapElements=[],w(s.snap.constructor!==String?s.snap.items||":data(ui-draggable)":s.snap).each(function(){var t=w(this),e=t.offset();this!==i.element[0]&&i.snapElements.push({item:this,width:t.outerWidth(),height:t.outerHeight(),top:e.top,left:e.left})})},drag:function(t,e,i){var s,o,n,r,a,h,l,p,c,d,u=i.options,f=u.snapTolerance,g=e.offset.left,m=g+i.helperProportions.width,_=e.offset.top,v=_+i.helperProportions.height;for(c=i.snapElements.length-1;0<=c;c--)h=(a=i.snapElements[c].left-i.margins.left)+i.snapElements[c].width,p=(l=i.snapElements[c].top-i.margins.top)+i.snapElements[c].height,m<a-f||h+f<g||v<l-f||p+f<_||!w.contains(i.snapElements[c].item.ownerDocument,i.snapElements[c].item)?(i.snapElements[c].snapping&&i.options.snap.release&&i.options.snap.release.call(i.element,t,w.extend(i._uiHash(),{snapItem:i.snapElements[c].item})),i.snapElements[c].snapping=!1):("inner"!==u.snapMode&&(s=Math.abs(l-v)<=f,o=Math.abs(p-_)<=f,n=Math.abs(a-m)<=f,r=Math.abs(h-g)<=f,s&&(e.position.top=i._convertPositionTo("relative",{top:l-i.helperProportions.height,left:0}).top),o&&(e.position.top=i._convertPositionTo("relative",{top:p,left:0}).top),n&&(e.position.left=i._convertPositionTo("relative",{top:0,left:a-i.helperProportions.width}).left),r&&(e.position.left=i._convertPositionTo("relative",{top:0,left:h}).left)),d=s||o||n||r,"outer"!==u.snapMode&&(s=Math.abs(l-_)<=f,o=Math.abs(p-v)<=f,n=Math.abs(a-g)<=f,r=Math.abs(h-m)<=f,s&&(e.position.top=i._convertPositionTo("relative",{top:l,left:0}).top),o&&(e.position.top=i._convertPositionTo("relative",{top:p-i.helperProportions.height,left:0}).top),n&&(e.position.left=i._convertPositionTo("relative",{top:0,left:a}).left),r&&(e.position.left=i._convertPositionTo("relative",{top:0,left:h-i.helperProportions.width}).left)),!i.snapElements[c].snapping&&(s||o||n||r||d)&&i.options.snap.snap&&i.options.snap.snap.call(i.element,t,w.extend(i._uiHash(),{snapItem:i.snapElements[c].item})),i.snapElements[c].snapping=s||o||n||r||d)}}),w.ui.plugin.add("draggable","stack",{start:function(t,e,i){var s,o=i.options,n=w.makeArray(w(o.stack)).sort(function(t,e){return(parseInt(w(t).css("zIndex"),10)||0)-(parseInt(w(e).css("zIndex"),10)||0)});n.length&&(s=parseInt(w(n[0]).css("zIndex"),10)||0,w(n).each(function(t){w(this).css("zIndex",s+t)}),this.css("zIndex",s+n.length))}}),w.ui.plugin.add("draggable","zIndex",{start:function(t,e,i){var s=w(e.helper),o=i.options;s.css("zIndex")&&(o._zIndex=s.css("zIndex")),s.css("zIndex",o.zIndex)},stop:function(t,e,i){var s=i.options;s._zIndex&&w(e.helper).css("zIndex",s._zIndex)}});w.ui.draggable;w.widget("ui.droppable",{version:"1.12.1",widgetEventPrefix:"drop",options:{accept:"*",addClasses:!0,greedy:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t,e=this.options,i=e.accept;this.isover=!1,this.isout=!0,this.accept=w.isFunction(i)?i:function(t){return t.is(i)},this.proportions=function(){if(!arguments.length)return t||(t={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight});t=arguments[0]},this._addToManager(e.scope),e.addClasses&&this._addClass("ui-droppable")},_addToManager:function(t){w.ui.ddmanager.droppables[t]=w.ui.ddmanager.droppables[t]||[],w.ui.ddmanager.droppables[t].push(this)},_splice:function(t){for(var e=0;e<t.length;e++)t[e]===this&&t.splice(e,1)},_destroy:function(){var t=w.ui.ddmanager.droppables[this.options.scope];this._splice(t)},_setOption:function(t,e){if("accept"===t)this.accept=w.isFunction(e)?e:function(t){return t.is(e)};else if("scope"===t){var i=w.ui.ddmanager.droppables[this.options.scope];this._splice(i),this._addToManager(e)}this._super(t,e)},_activate:function(t){var e=w.ui.ddmanager.current;this._addActiveClass(),e&&this._trigger("activate",t,this.ui(e))},_deactivate:function(t){var e=w.ui.ddmanager.current;this._removeActiveClass(),e&&this._trigger("deactivate",t,this.ui(e))},_over:function(t){var e=w.ui.ddmanager.current;e&&(e.currentItem||e.element)[0]!==this.element[0]&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this._addHoverClass(),this._trigger("over",t,this.ui(e)))},_out:function(t){var e=w.ui.ddmanager.current;e&&(e.currentItem||e.element)[0]!==this.element[0]&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this._removeHoverClass(),this._trigger("out",t,this.ui(e)))},_drop:function(e,t){var i=t||w.ui.ddmanager.current,s=!1;return!(!i||(i.currentItem||i.element)[0]===this.element[0])&&(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var t=w(this).droppable("instance");if(t.options.greedy&&!t.options.disabled&&t.options.scope===i.options.scope&&t.accept.call(t.element[0],i.currentItem||i.element)&&h(i,w.extend(t,{offset:t.element.offset()}),t.options.tolerance,e))return!(s=!0)}),!s&&(!!this.accept.call(this.element[0],i.currentItem||i.element)&&(this._removeActiveClass(),this._removeHoverClass(),this._trigger("drop",e,this.ui(i)),this.element)))},ui:function(t){return{draggable:t.currentItem||t.element,helper:t.helper,position:t.position,offset:t.positionAbs}},_addHoverClass:function(){this._addClass("ui-droppable-hover")},_removeHoverClass:function(){this._removeClass("ui-droppable-hover")},_addActiveClass:function(){this._addClass("ui-droppable-active")},_removeActiveClass:function(){this._removeClass("ui-droppable-active")}});var h=w.ui.intersect=function(t,e,i,s){if(!e.offset)return!1;var o=(t.positionAbs||t.position.absolute).left+t.margins.left,n=(t.positionAbs||t.position.absolute).top+t.margins.top,r=o+t.helperProportions.width,a=n+t.helperProportions.height,h=e.offset.left,l=e.offset.top,p=h+e.proportions().width,c=l+e.proportions().height;switch(i){case"fit":return h<=o&&r<=p&&l<=n&&a<=c;case"intersect":return h<o+t.helperProportions.width/2&&r-t.helperProportions.width/2<p&&l<n+t.helperProportions.height/2&&a-t.helperProportions.height/2<c;case"pointer":return d(s.pageY,l,e.proportions().height)&&d(s.pageX,h,e.proportions().width);case"touch":return(l<=n&&n<=c||l<=a&&a<=c||n<l&&c<a)&&(h<=o&&o<=p||h<=r&&r<=p||o<h&&p<r);default:return!1}};function d(t,e,i){return e<=t&&t<e+i}!(w.ui.ddmanager={current:null,droppables:{default:[]},prepareOffsets:function(t,e){var i,s,o=w.ui.ddmanager.droppables[t.options.scope]||[],n=e?e.type:null,r=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();t:for(i=0;i<o.length;i++)if(!(o[i].options.disabled||t&&!o[i].accept.call(o[i].element[0],t.currentItem||t.element))){for(s=0;s<r.length;s++)if(r[s]===o[i].element[0]){o[i].proportions().height=0;continue t}o[i].visible="none"!==o[i].element.css("display"),o[i].visible&&("mousedown"===n&&o[i]._activate.call(o[i],e),o[i].offset=o[i].element.offset(),o[i].proportions({width:o[i].element[0].offsetWidth,height:o[i].element[0].offsetHeight}))}},drop:function(t,e){var i=!1;return w.each((w.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&h(t,this,this.options.tolerance,e)&&(i=this._drop.call(this,e)||i),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,e)))}),i},dragStart:function(t,e){t.element.parentsUntil("body").on("scroll.droppable",function(){t.options.refreshPositions||w.ui.ddmanager.prepareOffsets(t,e)})},drag:function(n,r){n.options.refreshPositions&&w.ui.ddmanager.prepareOffsets(n,r),w.each(w.ui.ddmanager.droppables[n.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var t,e,i,s=h(n,this,this.options.tolerance,r),o=!s&&this.isover?"isout":s&&!this.isover?"isover":null;o&&(this.options.greedy&&(e=this.options.scope,(i=this.element.parents(":data(ui-droppable)").filter(function(){return w(this).droppable("instance").options.scope===e})).length&&((t=w(i[0]).droppable("instance")).greedyChild="isover"===o)),t&&"isover"===o&&(t.isover=!1,t.isout=!0,t._out.call(t,r)),this[o]=!0,this["isout"===o?"isover":"isout"]=!1,this["isover"===o?"_over":"_out"].call(this,r),t&&"isout"===o&&(t.isout=!1,t.isover=!0,t._over.call(t,r)))}})},dragStop:function(t,e){t.element.parentsUntil("body").off("scroll.droppable"),t.options.refreshPositions||w.ui.ddmanager.prepareOffsets(t,e)}})!==w.uiBackCompat&&w.widget("ui.droppable",w.ui.droppable,{options:{hoverClass:!1,activeClass:!1},_addActiveClass:function(){this._super(),this.options.activeClass&&this.element.addClass(this.options.activeClass)},_removeActiveClass:function(){this._super(),this.options.activeClass&&this.element.removeClass(this.options.activeClass)},_addHoverClass:function(){this._super(),this.options.hoverClass&&this.element.addClass(this.options.hoverClass)},_removeHoverClass:function(){this._super(),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass)}});w.ui.droppable;w.widget("ui.resizable",w.ui.mouse,{version:"1.12.1",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,classes:{"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(t){return parseFloat(t)||0},_isNumber:function(t){return!isNaN(parseFloat(t))},_hasScroll:function(t,e){if("hidden"===w(t).css("overflow"))return!1;var i,s=e&&"left"===e?"scrollLeft":"scrollTop";return 0<t[s]||(t[s]=1,i=0<t[s],t[s]=0,i)},_create:function(){var t,e=this.options,i=this;this._addClass("ui-resizable"),w.extend(this,{_aspectRatio:!!e.aspectRatio,aspectRatio:e.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:e.helper||e.ghost||e.animate?e.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(w("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,t={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(t),this.originalElement.css("margin",0),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css(t),this._proportionallyResize()),this._setupHandles(),e.autoHide&&w(this.element).on("mouseenter",function(){e.disabled||(i._removeClass("ui-resizable-autohide"),i._handles.show())}).on("mouseleave",function(){e.disabled||i.resizing||(i._addClass("ui-resizable-autohide"),i._handles.hide())}),this._mouseInit()},_destroy:function(){this._mouseDestroy();function t(t){w(t).removeData("resizable").removeData("ui-resizable").off(".resizable").find(".ui-resizable-handle").remove()}var e;return this.elementIsWrapper&&(t(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),t(this.originalElement),this},_setOption:function(t,e){switch(this._super(t,e),t){case"handles":this._removeHandles(),this._setupHandles()}},_setupHandles:function(){var t,e,i,s,o,n=this.options,r=this;if(this.handles=n.handles||(w(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=w(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),i=this.handles.split(","),this.handles={},e=0;e<i.length;e++)s="ui-resizable-"+(t=w.trim(i[e])),o=w("<div>"),this._addClass(o,"ui-resizable-handle "+s),o.css({zIndex:n.zIndex}),this.handles[t]=".ui-resizable-"+t,this.element.append(o);this._renderAxis=function(t){var e,i,s,o;for(e in t=t||this.element,this.handles)this.handles[e].constructor===String?this.handles[e]=this.element.children(this.handles[e]).first().show():(this.handles[e].jquery||this.handles[e].nodeType)&&(this.handles[e]=w(this.handles[e]),this._on(this.handles[e],{mousedown:r._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(i=w(this.handles[e],this.element),o=/sw|ne|nw|se|n|s/.test(e)?i.outerHeight():i.outerWidth(),s=["padding",/ne|nw|n/.test(e)?"Top":/se|sw|s/.test(e)?"Bottom":/^e$/.test(e)?"Right":"Left"].join(""),t.css(s,o),this._proportionallyResize()),this._handles=this._handles.add(this.handles[e])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){r.resizing||(this.className&&(o=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),r.axis=o&&o[1]?o[1]:"se")}),n.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._handles.remove()},_mouseCapture:function(t){var e,i,s=!1;for(e in this.handles)(i=w(this.handles[e])[0])!==t.target&&!w.contains(i,t.target)||(s=!0);return!this.options.disabled&&s},_mouseStart:function(t){var e,i,s,o=this.options,n=this.element;return this.resizing=!0,this._renderProxy(),e=this._num(this.helper.css("left")),i=this._num(this.helper.css("top")),o.containment&&(e+=w(o.containment).scrollLeft()||0,i+=w(o.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:e,top:i},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:n.width(),height:n.height()},this.originalSize=this._helper?{width:n.outerWidth(),height:n.outerHeight()}:{width:n.width(),height:n.height()},this.sizeDiff={width:n.outerWidth()-n.width(),height:n.outerHeight()-n.height()},this.originalPosition={left:e,top:i},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio="number"==typeof o.aspectRatio?o.aspectRatio:this.originalSize.width/this.originalSize.height||1,s=w(".ui-resizable-"+this.axis).css("cursor"),w("body").css("cursor","auto"===s?this.axis+"-resize":s),this._addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var e,i,s=this.originalMousePosition,o=this.axis,n=t.pageX-s.left||0,r=t.pageY-s.top||0,a=this._change[o];return this._updatePrevProperties(),a&&(e=a.apply(this,[t,n,r]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(e=this._updateRatio(e,t)),e=this._respectSize(e,t),this._updateCache(e),this._propagate("resize",t),i=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),w.isEmptyObject(i)||(this._updatePrevProperties(),this._trigger("resize",t,this.ui()),this._applyChanges())),!1},_mouseStop:function(t){this.resizing=!1;var e,i,s,o,n,r,a,h=this.options,l=this;return this._helper&&(s=(i=(e=this._proportionallyResizeElements).length&&/textarea/i.test(e[0].nodeName))&&this._hasScroll(e[0],"left")?0:l.sizeDiff.height,o=i?0:l.sizeDiff.width,n={width:l.helper.width()-o,height:l.helper.height()-s},r=parseFloat(l.element.css("left"))+(l.position.left-l.originalPosition.left)||null,a=parseFloat(l.element.css("top"))+(l.position.top-l.originalPosition.top)||null,h.animate||this.element.css(w.extend(n,{top:a,left:r})),l.helper.height(l.size.height),l.helper.width(l.size.width),this._helper&&!h.animate&&this._proportionallyResize()),w("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var t={};return this.position.top!==this.prevPosition.top&&(t.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(t.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(t.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(t.height=this.size.height+"px"),this.helper.css(t),t},_updateVirtualBoundaries:function(t){var e,i,s,o,n,r=this.options;n={minWidth:this._isNumber(r.minWidth)?r.minWidth:0,maxWidth:this._isNumber(r.maxWidth)?r.maxWidth:1/0,minHeight:this._isNumber(r.minHeight)?r.minHeight:0,maxHeight:this._isNumber(r.maxHeight)?r.maxHeight:1/0},(this._aspectRatio||t)&&(e=n.minHeight*this.aspectRatio,s=n.minWidth/this.aspectRatio,i=n.maxHeight*this.aspectRatio,o=n.maxWidth/this.aspectRatio,e>n.minWidth&&(n.minWidth=e),s>n.minHeight&&(n.minHeight=s),i<n.maxWidth&&(n.maxWidth=i),o<n.maxHeight&&(n.maxHeight=o)),this._vBoundaries=n},_updateCache:function(t){this.offset=this.helper.offset(),this._isNumber(t.left)&&(this.position.left=t.left),this._isNumber(t.top)&&(this.position.top=t.top),this._isNumber(t.height)&&(this.size.height=t.height),this._isNumber(t.width)&&(this.size.width=t.width)},_updateRatio:function(t){var e=this.position,i=this.size,s=this.axis;return this._isNumber(t.height)?t.width=t.height*this.aspectRatio:this._isNumber(t.width)&&(t.height=t.width/this.aspectRatio),"sw"===s&&(t.left=e.left+(i.width-t.width),t.top=null),"nw"===s&&(t.top=e.top+(i.height-t.height),t.left=e.left+(i.width-t.width)),t},_respectSize:function(t){var e=this._vBoundaries,i=this.axis,s=this._isNumber(t.width)&&e.maxWidth&&e.maxWidth<t.width,o=this._isNumber(t.height)&&e.maxHeight&&e.maxHeight<t.height,n=this._isNumber(t.width)&&e.minWidth&&e.minWidth>t.width,r=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,a=this.originalPosition.left+this.originalSize.width,h=this.originalPosition.top+this.originalSize.height,l=/sw|nw|w/.test(i),p=/nw|ne|n/.test(i);return n&&(t.width=e.minWidth),r&&(t.height=e.minHeight),s&&(t.width=e.maxWidth),o&&(t.height=e.maxHeight),n&&l&&(t.left=a-e.minWidth),s&&l&&(t.left=a-e.maxWidth),r&&p&&(t.top=h-e.minHeight),o&&p&&(t.top=h-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_getPaddingPlusBorderDimensions:function(t){for(var e=0,i=[],s=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],o=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];e<4;e++)i[e]=parseFloat(s[e])||0,i[e]+=parseFloat(o[e])||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var t,e=0,i=this.helper||this.element;e<this._proportionallyResizeElements.length;e++)t=this._proportionallyResizeElements[e],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(t)),t.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})},_renderProxy:function(){var t=this.element,e=this.options;this.elementOffset=t.offset(),this._helper?(this.helper=this.helper||w("<div style='overflow:hidden;'></div>"),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++e.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize;return{left:this.originalPosition.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize;return{top:this.originalPosition.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(t,e,i){return w.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},sw:function(t,e,i){return w.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,e,i]))},ne:function(t,e,i){return w.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},nw:function(t,e,i){return w.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,e,i]))}},_propagate:function(t,e){w.ui.plugin.call(this,t,[e,this.ui()]),"resize"!==t&&this._trigger(t,e,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),w.ui.plugin.add("resizable","animate",{stop:function(e){var i=w(this).resizable("instance"),t=i.options,s=i._proportionallyResizeElements,o=s.length&&/textarea/i.test(s[0].nodeName),n=o&&i._hasScroll(s[0],"left")?0:i.sizeDiff.height,r=o?0:i.sizeDiff.width,a={width:i.size.width-r,height:i.size.height-n},h=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left)||null,l=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null;i.element.animate(w.extend(a,l&&h?{top:l,left:h}:{}),{duration:t.animateDuration,easing:t.animateEasing,step:function(){var t={width:parseFloat(i.element.css("width")),height:parseFloat(i.element.css("height")),top:parseFloat(i.element.css("top")),left:parseFloat(i.element.css("left"))};s&&s.length&&w(s[0]).css({width:t.width,height:t.height}),i._updateCache(t),i._propagate("resize",e)}})}}),w.ui.plugin.add("resizable","containment",{start:function(){var i,s,t,e,o,n,r,a=w(this).resizable("instance"),h=a.options,l=a.element,p=h.containment,c=p instanceof w?p.get(0):/parent/.test(p)?l.parent().get(0):p;c&&(a.containerElement=w(c),/document/.test(p)||p===document?(a.containerOffset={left:0,top:0},a.containerPosition={left:0,top:0},a.parentData={element:w(document),left:0,top:0,width:w(document).width(),height:w(document).height()||document.body.parentNode.scrollHeight}):(i=w(c),s=[],w(["Top","Right","Left","Bottom"]).each(function(t,e){s[t]=a._num(i.css("padding"+e))}),a.containerOffset=i.offset(),a.containerPosition=i.position(),a.containerSize={height:i.innerHeight()-s[3],width:i.innerWidth()-s[1]},t=a.containerOffset,e=a.containerSize.height,o=a.containerSize.width,n=a._hasScroll(c,"left")?c.scrollWidth:o,r=a._hasScroll(c)?c.scrollHeight:e,a.parentData={element:c,left:t.left,top:t.top,width:n,height:r}))},resize:function(t){var e,i,s,o,n=w(this).resizable("instance"),r=n.options,a=n.containerOffset,h=n.position,l=n._aspectRatio||t.shiftKey,p={top:0,left:0},c=n.containerElement,d=!0;c[0]!==document&&/static/.test(c.css("position"))&&(p=a),h.left<(n._helper?a.left:0)&&(n.size.width=n.size.width+(n._helper?n.position.left-a.left:n.position.left-p.left),l&&(n.size.height=n.size.width/n.aspectRatio,d=!1),n.position.left=r.helper?a.left:0),h.top<(n._helper?a.top:0)&&(n.size.height=n.size.height+(n._helper?n.position.top-a.top:n.position.top),l&&(n.size.width=n.size.height*n.aspectRatio,d=!1),n.position.top=n._helper?a.top:0),s=n.containerElement.get(0)===n.element.parent().get(0),o=/relative|absolute/.test(n.containerElement.css("position")),s&&o?(n.offset.left=n.parentData.left+n.position.left,n.offset.top=n.parentData.top+n.position.top):(n.offset.left=n.element.offset().left,n.offset.top=n.element.offset().top),e=Math.abs(n.sizeDiff.width+(n._helper?n.offset.left-p.left:n.offset.left-a.left)),i=Math.abs(n.sizeDiff.height+(n._helper?n.offset.top-p.top:n.offset.top-a.top)),e+n.size.width>=n.parentData.width&&(n.size.width=n.parentData.width-e,l&&(n.size.height=n.size.width/n.aspectRatio,d=!1)),i+n.size.height>=n.parentData.height&&(n.size.height=n.parentData.height-i,l&&(n.size.width=n.size.height*n.aspectRatio,d=!1)),d||(n.position.left=n.prevPosition.left,n.position.top=n.prevPosition.top,n.size.width=n.prevSize.width,n.size.height=n.prevSize.height)},stop:function(){var t=w(this).resizable("instance"),e=t.options,i=t.containerOffset,s=t.containerPosition,o=t.containerElement,n=w(t.helper),r=n.offset(),a=n.outerWidth()-t.sizeDiff.width,h=n.outerHeight()-t.sizeDiff.height;t._helper&&!e.animate&&/relative/.test(o.css("position"))&&w(this).css({left:r.left-s.left-i.left,width:a,height:h}),t._helper&&!e.animate&&/static/.test(o.css("position"))&&w(this).css({left:r.left-s.left-i.left,width:a,height:h})}}),w.ui.plugin.add("resizable","alsoResize",{start:function(){var t=w(this).resizable("instance").options;w(t.alsoResize).each(function(){var t=w(this);t.data("ui-resizable-alsoresize",{width:parseFloat(t.width()),height:parseFloat(t.height()),left:parseFloat(t.css("left")),top:parseFloat(t.css("top"))})})},resize:function(t,i){var e=w(this).resizable("instance"),s=e.options,o=e.originalSize,n=e.originalPosition,r={height:e.size.height-o.height||0,width:e.size.width-o.width||0,top:e.position.top-n.top||0,left:e.position.left-n.left||0};w(s.alsoResize).each(function(){var t=w(this),s=w(this).data("ui-resizable-alsoresize"),o={},e=t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];w.each(e,function(t,e){var i=(s[e]||0)+(r[e]||0);i&&0<=i&&(o[e]=i||null)}),t.css(o)})},stop:function(){w(this).removeData("ui-resizable-alsoresize")}}),w.ui.plugin.add("resizable","ghost",{start:function(){var t=w(this).resizable("instance"),e=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:e.height,width:e.width,margin:0,left:0,top:0}),t._addClass(t.ghost,"ui-resizable-ghost"),!1!==w.uiBackCompat&&"string"==typeof t.options.ghost&&t.ghost.addClass(this.options.ghost),t.ghost.appendTo(t.helper)},resize:function(){var t=w(this).resizable("instance");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=w(this).resizable("instance");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),w.ui.plugin.add("resizable","grid",{resize:function(){var t,e=w(this).resizable("instance"),i=e.options,s=e.size,o=e.originalSize,n=e.originalPosition,r=e.axis,a="number"==typeof i.grid?[i.grid,i.grid]:i.grid,h=a[0]||1,l=a[1]||1,p=Math.round((s.width-o.width)/h)*h,c=Math.round((s.height-o.height)/l)*l,d=o.width+p,u=o.height+c,f=i.maxWidth&&i.maxWidth<d,g=i.maxHeight&&i.maxHeight<u,m=i.minWidth&&i.minWidth>d,_=i.minHeight&&i.minHeight>u;i.grid=a,m&&(d+=h),_&&(u+=l),f&&(d-=h),g&&(u-=l),/^(se|s|e)$/.test(r)?(e.size.width=d,e.size.height=u):/^(ne)$/.test(r)?(e.size.width=d,e.size.height=u,e.position.top=n.top-c):/^(sw)$/.test(r)?(e.size.width=d,e.size.height=u,e.position.left=n.left-p):((u-l<=0||d-h<=0)&&(t=e._getPaddingPlusBorderDimensions(this)),0<u-l?(e.size.height=u,e.position.top=n.top-c):(u=l-t.height,e.size.height=u,e.position.top=n.top+o.height-u),0<d-h?(e.size.width=d,e.position.left=n.left-p):(d=h-t.width,e.size.width=d,e.position.left=n.left+o.width-d))}});w.ui.resizable});
//# sourceMappingURL=gridstack.min.map

@@ -8,2 +8,3 @@ Change log

- [1.2.1 (2020-09-04)](#121-2020-09-04)
- [1.2.0 (2020-08-01)](#120-2020-08-01)

@@ -38,2 +39,6 @@ - [1.1.2 (2020-05-17)](#112-2020-05-17)

## 1.2.1 (2020-09-04)
- fix [1341](https://github.com/gridstack/gridstack.js/pull/1341) Enable the UMD behavior for bundlers compatibility
## 1.2.0 (2020-08-01)

@@ -40,0 +45,0 @@

@@ -122,3 +122,3 @@ gridstack.js API

- `autoPosition` - tells to ignore `x` and `y` attributes and to place element to the first available position. Having either one missing will also do that.
- `x`, `y` - (number) element position in row/column. Note: if one is missing this will `autoPosition` the item
- `x`, `y` - (number) element position in column/row. Note: if one is missing this will `autoPosition` the item
- `width`, `height` - (number) element size in row/column (default 1x1)

@@ -125,0 +125,0 @@ - `maxWidth`, `minWidth`, `maxHeight`, `minHeight` - element constraints in row/column (default none)

{
"name": "gridstack",
"version": "1.2.0",
"version": "1.2.1",
"description": "JavaScript / TypeScript for dashboard layout and creation, no external dependencies, with many wrappers (React, Angular, Ember, knockout...)",

@@ -5,0 +5,0 @@ "main": "dist/gridstack",

@@ -66,5 +66,5 @@ gridstack.js

```bash
```js
yarn add gridstack
or
// or
npm install --save gridstack

@@ -75,4 +75,2 @@ ```

after you install:
```js

@@ -82,2 +80,37 @@ import 'gridstack/dist/gridstack.all.js';

```
* when using webpack/ES6 imports you will need this instead (instead of all.js):
```js
import 'jquery';
import 'jquery-ui';
import 'gridstack/dist/gridstack-poly'; // optional IE support
import GridStack from 'gridstack';
import 'gridstack/dist/gridstack.jQueryUI';
import 'gridstack/dist/gridstack.css';
```
If your project doesn't need to bring it's own jQuery (see [section](#jquery-application)) we include 3.5.1 that always export jQuery)
or jQuery-ui (we include a trimmed version with just drag&drop at 1/5th the size)
you can use the lightweight files provided by Gridstack instead.
either use full paths above
```js
import 'gridstack/dist/jquery';
import 'gridstack/dist/jquery-ui';
```
or define an alias in your webpack configuration:
```
module.exports = {
...
resolve: {
alias: {
'jquery': 'gridstack/dist/jquery.js',
'jquery-ui': 'gridstack/dist/jquery-ui.js',
}
}
}
```
* alternatively in html

@@ -93,6 +126,8 @@

```html
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gridstack@1.2.0/dist/gridstack.min.css" />
<script src="https://cdn.jsdelivr.net/npm/gridstack@1.2.0/dist/gridstack.all.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gridstack@1.2.1/dist/gridstack.min.css" />
<script src="https://cdn.jsdelivr.net/npm/gridstack@1.2.1/dist/gridstack.all.js"></script>
```
if you need to debug, look at the git demo/ examples for non min includes.

@@ -188,3 +223,3 @@

```html
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gridstack@1.2.0/dist/gridstack-extra.css"/>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gridstack@1.2.1/dist/gridstack-extra.css"/>

@@ -351,3 +386,3 @@ <div class="grid-stack grid-stack-N">...</div>

We're working on implementing HTML5 drag'n'drop through the plugin system. Right now it is still jquery-ui based. Because of that we are still bundling `jquery` (3.5.1) + `jquery-ui` (1.12.1 minimal drag|drop|resize) internally in `gridstack.all.js`. IFF your app needs to bring your own version instead, you should **instead** include `gridstack-poly.min.js` (optional IE support) + `gridstack.min.js` + `gridstack.jQueryUI.min.js` after you import your JQ libs. But note that there are issue with jQuery and ES6 import (see [1306](https://github.com/gridstack/gridstack.js/issues/1306))
We're working on implementing HTML5 drag'n'drop through the plugin system. Right now it is still jquery-ui based. Because of that we are still bundling `jquery` (3.5.1) + `jquery-ui` (1.12.1 minimal drag|drop|resize) internally in `gridstack.all.js`. IFF your app needs to bring your own version instead, you should **instead** include `gridstack-poly.min.js` (optional IE support) + `gridstack.min.js` + `gridstack.jQueryUI.min.js` after you import your JQ libs.

@@ -354,0 +389,0 @@ Changes

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc