mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-08 12:12:48 +01:00
27 lines
776 KiB
JavaScript
27 lines
776 KiB
JavaScript
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.grapesjs=t():e.grapesjs=t()}(window,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var i in e)t.d(r,i,function(t){return e[t]}.bind(null,i));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e["default"]}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s="./src/index.js")}({"./node_modules/@babel/runtime/helpers/arrayWithHoles.js":function(e,t){function n(e){if(Array.isArray(e))return e}e.exports=n},"./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js":function(e,t){function n(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}e.exports=n},"./node_modules/@babel/runtime/helpers/classCallCheck.js":function(e,t){function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}e.exports=n},"./node_modules/@babel/runtime/helpers/createClass.js":function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function r(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}e.exports=r},"./node_modules/@babel/runtime/helpers/defineProperty.js":function(e,t){function n(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}e.exports=n},"./node_modules/@babel/runtime/helpers/iterableToArray.js":function(e,t){function n(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}e.exports=n},"./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js":function(e,t){function n(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var n=[],r=!0,i=!1,o=void 0;try{for(var s,a=e[Symbol.iterator]();!(r=(s=a.next()).done)&&(n.push(s.value),!t||n.length!==t);r=!0);}catch(l){i=!0,o=l}finally{try{r||null==a["return"]||a["return"]()}finally{if(i)throw o}}return n}}e.exports=n},"./node_modules/@babel/runtime/helpers/nonIterableRest.js":function(e,t){function n(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}e.exports=n},"./node_modules/@babel/runtime/helpers/nonIterableSpread.js":function(e,t){function n(){throw new TypeError("Invalid attempt to spread non-iterable instance")}e.exports=n},"./node_modules/@babel/runtime/helpers/objectWithoutProperties.js":function(e,t,n){function r(e,t){if(null==e)return{};var n,r,o=i(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var i=n("./node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js");e.exports=r},"./node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js":function(e,t){function n(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}e.exports=n},"./node_modules/@babel/runtime/helpers/slicedToArray.js":function(e,t,n){function r(e,t){return i(e)||o(e,t)||s()}var i=n("./node_modules/@babel/runtime/helpers/arrayWithHoles.js"),o=n("./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js"),s=n("./node_modules/@babel/runtime/helpers/nonIterableRest.js");e.exports=r},"./node_modules/@babel/runtime/helpers/toConsumableArray.js":function(e,t,n){function r(e){return i(e)||o(e)||s()}var i=n("./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js"),o=n("./node_modules/@babel/runtime/helpers/iterableToArray.js"),s=n("./node_modules/@babel/runtime/helpers/nonIterableSpread.js");e.exports=r},"./node_modules/@babel/runtime/helpers/typeof.js":function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(t){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?e.exports=r=function(e){return n(e)}:e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)},r(t)}e.exports=r},"./node_modules/backbone-undo/Backbone.Undo.js":function(e,t,n){var r,i,o;!function(s){i=[n("./node_modules/underscore/underscore.js"),n("./node_modules/backbone/backbone.js")],r=s,o="function"==typeof r?r.apply(t,i):r,!(void 0!==o&&(e.exports=o))}(function(e,t){function n(e,t,n){return n.length<=4?e.call(t,n[0],n[1],n[2],n[3]):e.apply(t,n)}function r(e,t){return f.call(e,t)}function i(t,n){return null!=t&&(e.isArray(n)||(n=r(arguments,1)),e.all(n,function(e){return e in t}))}function o(){this.registeredObjects=[],this.cidIndexes=[]}function s(t,n,r,i){for(var o,s=0,a=n.length;s<a;s++)if(o=n[s]){if("on"===t){if(!i.objectRegistry.register(o))continue}else if(!i.objectRegistry.unregister(o))continue;e.isFunction(o[t])&&o[t]("all",r,i)}}function a(t,n){var r=n.type,i=n.undoTypes,o=!i[r]||i[r][t];e.isFunction(o)&&o(n.object,n.before,n.after,n.options)}function l(t,n,r,i,o){if(!(r.isCurrentlyUndoRedoing||"undo"===t&&r.pointer===-1||"redo"===t&&r.pointer===r.length-1)){r.isCurrentlyUndoRedoing=!0;var s,a,l="undo"===t;for(o?a=l&&r.pointer===r.length-1||!l&&r.pointer===-1?e.clone(r.models):f.apply(r.models,l?[0,r.pointer]:[r.pointer,r.length-1]):(s=r.at(l?r.pointer:r.pointer+1),a=i?r.where({magicFusionIndex:s.get("magicFusionIndex")}):[s]),r.pointer+=(l?-1:1)*a.length;s=l?a.pop():a.shift();)s[t]();r.isCurrentlyUndoRedoing=!1,n.trigger(t,n)}}function c(e,t){var r=e.condition,i=typeof r;return"function"===i?!!n(r,e,t):"boolean"!==i||r}function u(e,t,r,o){if(e.track&&!e.isCurrentlyUndoRedoing&&t in o&&c(o[t],r)){var s,a=n(o[t].on,o[t],r);if(i(a,"object","before","after")){if(a.type=t,a.magicFusionIndex=p(),a.undoTypes=o,e.pointer<e.length-1)for(var s=e.length-e.pointer-1;s--;)e.pop();e.pointer=e.length,e.add(a),e.length>e.maximumStackLength&&(e.shift(),e.pointer--)}}}function d(){}function h(t,n,r,o){if("object"==typeof n)return e.each(n,function(e,n){2===t?h(t,e,r,o):h(t,n,e,r)});switch(t){case 0:i(r,"undo","redo","on")&&e.all(e.pick(r,"undo","redo","on"),e.isFunction)&&(o[n]=r);break;case 1:o[n]&&e.isObject(r)&&(o[n]=e.extend({},o[n],r));break;case 2:delete o[n]}return this}var f=Array.prototype.slice,p=function(){function t(){r++,n=!0,e.defer(function(){n=!1})}var n=!1,r=-1;return function(){return n||t(),r}}();o.prototype={isRegistered:function(t){return t&&t.cid?this.registeredObjects[t.cid]:e.contains(this.registeredObjects,t)},register:function(e){return!this.isRegistered(e)&&(e&&e.cid?(this.registeredObjects[e.cid]=e,this.cidIndexes.push(e.cid)):this.registeredObjects.push(e),!0)},unregister:function(t){if(this.isRegistered(t)){if(t&&t.cid)delete this.registeredObjects[t.cid],this.cidIndexes.splice(e.indexOf(this.cidIndexes,t.cid),1);else{var n=e.indexOf(this.registeredObjects,t);this.registeredObjects.splice(n,1)}return!0}return!1},get:function(){return e.map(this.cidIndexes,function(e){return this.registeredObjects[e]},this).concat(this.registeredObjects)}};var g={add:{undo:function(e,t,n,r){e.remove(n,r)},redo:function(e,t,n,r){r.index&&(r.at=r.index),e.add(n,r)},on:function(t,n,r){return{object:n,before:void 0,after:t,options:e.clone(r)}}},remove:{undo:function(e,t,n,r){"index"in r&&(r.at=r.index),e.add(t,r)},redo:function(e,t,n,r){e.remove(t,r)},on:function(t,n,r){return{object:n,before:t,after:void 0,options:e.clone(r)}}},change:{undo:function(t,n,r,i){e.isEmpty(n)?e.each(e.keys(r),t.unset,t):(t.set(n),i&&i.unsetData&&i.unsetData.before&&i.unsetData.before.length&&e.each(i.unsetData.before,t.unset,t))},redo:function(t,n,r,i){e.isEmpty(r)?e.each(e.keys(n),t.unset,t):(t.set(r),i&&i.unsetData&&i.unsetData.after&&i.unsetData.after.length&&e.each(i.unsetData.after,t.unset,t))},on:function(t,n){var r=t.changedAttributes(),i=e.keys(r),o=e.pick(t.previousAttributes(),i),s=e.keys(o),a=(n||(n={})).unsetData={after:[],before:[]};return i.length!=s.length&&(i.length>s.length?e.each(i,function(e){e in o||a.before.push(e)},this):e.each(s,function(e){e in r||a.after.push(e)})),{object:t,before:o,after:r,options:e.clone(n)}}},reset:{undo:function(e,t,n){e.reset(t)},redo:function(e,t,n){e.reset(n)},on:function(t,n){return{object:t,before:n.previousModels,after:e.clone(t.models)}}}};d.prototype=g;var m=t.Model.extend({defaults:{type:null,object:null,before:null,after:null,magicFusionIndex:null},undo:function(e){a("undo",this.attributes)},redo:function(e){a("redo",this.attributes)}}),v=t.Collection.extend({model:m,pointer:-1,track:!1,isCurrentlyUndoRedoing:!1,maximumStackLength:1/0,setMaxLength:function(e){this.maximumStackLength=e}}),b=t.Model.extend({defaults:{maximumStackLength:1/0,track:!1},initialize:function(t){this.stack=new v,this.objectRegistry=new o,this.undoTypes=new d,this.stack.setMaxLength(this.get("maximumStackLength")),this.on("change:maximumStackLength",function(e,t){this.stack.setMaxLength(t)},this),t&&t.track&&this.startTracking(),t&&t.register&&(e.isArray(t.register)||e.isArguments(t.register)?n(this.register,this,t.register):this.register(t.register))},startTracking:function(){this.set("track",!0),this.stack.track=!0},stopTracking:function(){this.set("track",!1),this.stack.track=!1},isTracking:function(){return this.get("track")},_addToStack:function(e){u(this.stack,e,r(arguments,1),this.undoTypes)},register:function(){s("on",arguments,this._addToStack,this)},unregister:function(){s("off",arguments,this._addToStack,this)},unregisterAll:function(){n(this.unregister,this,this.objectRegistry.get())},undo:function(e){l("undo",this,this.stack,e)},undoAll:function(){l("undo",this,this.stack,!1,!0)},redo:function(e){l("redo",this,this.stack,e)},redoAll:function(){l("redo",this,this.stack,!1,!0)},isAvailable:function(e){var t=this.stack,n=t.length;switch(e){case"undo":return n>0&&t.pointer>-1;case"redo":return n>0&&t.pointer<n-1;default:return!1}},merge:function(t){for(var n,i=e.isArray(t)?t:r(arguments);n=i.pop();)n instanceof b&&n.stack instanceof v&&(n.stack=this.stack)},addUndoType:function(e,t){h(0,e,t,this.undoTypes)},changeUndoType:function(e,t){h(1,e,t,this.undoTypes)},removeUndoType:function(e){h(2,e,void 0,this.undoTypes)},clear:function(){this.stack.reset(),this.stack.pointer=-1}});return e.extend(b,{defaults:function(t){e.extend(b.prototype.defaults,t)},addUndoType:function(e,t){h(0,e,t,g)},changeUndoType:function(e,t){h(1,e,t,g)},removeUndoType:function(e){h(2,e,void 0,g)}}),t.UndoManager=b})},"./node_modules/backbone/backbone.js":function(e,t,n){(function(r){var i,o;!function(s){var a="object"==typeof self&&self.self===self&&self||"object"==typeof r&&r.global===r&&r;i=[n("./node_modules/underscore/underscore.js"),n("./node_modules/cash-dom/dist/cash.esm.js"),t],o=function(e,t,n){a.Backbone=s(a,n,e,t)}.apply(t,i),!(void 0!==o&&(e.exports=o))}(function(e,t,n,r){var i=e.Backbone,o=Array.prototype.slice;t.VERSION="1.3.3",t.$=r,t.noConflict=function(){return e.Backbone=i,this},t.emulateHTTP=!1,t.emulateJSON=!1;var s=function(e,t,r){switch(e){case 1:return function(){return n[t](this[r])};case 2:return function(e){return n[t](this[r],e)};case 3:return function(e,i){return n[t](this[r],l(e,this),i)};case 4:return function(e,i,o){return n[t](this[r],l(e,this),i,o)};default:return function(){var e=o.call(arguments);return e.unshift(this[r]),n[t].apply(n,e)}}},a=function(e,t,r){n.each(t,function(t,i){n[i]&&(e.prototype[i]=s(t,i,r))})},l=function(e,t){return n.isFunction(e)?e:n.isObject(e)&&!t._isModel(e)?c(e):n.isString(e)?function(t){return t.get(e)}:e},c=function(e){var t=n.matches(e);return function(e){return t(e.attributes)}},u=t.Events={},d=/\s+/,h=function(e,t,r,i,o){var s,a=0;if(r&&"object"==typeof r){void 0!==i&&"context"in o&&void 0===o.context&&(o.context=i);for(s=n.keys(r);a<s.length;a++)t=h(e,t,s[a],r[s[a]],o)}else if(r&&d.test(r))for(s=r.split(d);a<s.length;a++)t=e(t,s[a],i,o);else t=e(t,r,i,o);return t};u.on=function(e,t,n){return f(this,e,t,n)};var f=function(e,t,n,r,i){if(e._events=h(p,e._events||{},t,n,{context:r,ctx:e,listening:i}),i){var o=e._listeners||(e._listeners={});o[i.id]=i}return e};u.listenTo=function(e,t,r){if(!e)return this;var i=e._listenId||(e._listenId=n.uniqueId("l")),o=this._listeningTo||(this._listeningTo={}),s=o[i];if(!s){var a=this._listenId||(this._listenId=n.uniqueId("l"));s=o[i]={obj:e,objId:i,id:a,listeningTo:o,count:0}}return f(e,t,r,this,s),this};var p=function(e,t,n,r){if(n){var i=e[t]||(e[t]=[]),o=r.context,s=r.ctx,a=r.listening;a&&a.count++,i.push({callback:n,context:o,ctx:o||s,listening:a})}return e};u.off=function(e,t,n){return this._events?(this._events=h(g,this._events,e,t,{context:n,listeners:this._listeners}),this):this},u.stopListening=function(e,t,r){var i=this._listeningTo;if(!i)return this;for(var o=e?[e._listenId]:n.keys(i),s=0;s<o.length;s++){var a=i[o[s]];if(!a)break;a.obj.off(t,r,this)}return this};var g=function(e,t,r,i){if(e){var o,s=0,a=i.context,l=i.listeners;if(t||r||a){for(var c=t?[t]:n.keys(e);s<c.length;s++){t=c[s];var u=e[t];if(!u)break;for(var d=[],h=0;h<u.length;h++){var f=u[h];r&&r!==f.callback&&r!==f.callback._callback||a&&a!==f.context?d.push(f):(o=f.listening,o&&0===--o.count&&(delete l[o.id],delete o.listeningTo[o.objId]))}d.length?e[t]=d:delete e[t]}return e}for(var p=n.keys(l);s<p.length;s++)o=l[p[s]],delete l[o.id],delete o.listeningTo[o.objId]}};u.once=function(e,t,r){var i=h(m,{},e,t,n.bind(this.off,this));return"string"==typeof e&&null==r&&(t=void 0),this.on(i,t,r)},u.listenToOnce=function(e,t,r){var i=h(m,{},t,r,n.bind(this.stopListening,this,e));return this.listenTo(e,i)};var m=function(e,t,r,i){if(r){var o=e[t]=n.once(function(){i(t,o),r.apply(this,arguments)});o._callback=r}return e};u.trigger=function(e){if(!this._events)return this;for(var t=Math.max(0,arguments.length-1),n=Array(t),r=0;r<t;r++)n[r]=arguments[r+1];return h(v,this._events,e,void 0,n),this};var v=function(e,t,n,r){if(e){var i=e[t],o=e.all;i&&o&&(o=o.slice()),i&&b(i,r),o&&b(o,[t].concat(r))}return e},b=function(e,t){var n,r=-1,i=e.length,o=t[0],s=t[1],a=t[2];switch(t.length){case 0:for(;++r<i;)(n=e[r]).callback.call(n.ctx);return;case 1:for(;++r<i;)(n=e[r]).callback.call(n.ctx,o);return;case 2:for(;++r<i;)(n=e[r]).callback.call(n.ctx,o,s);return;case 3:for(;++r<i;)(n=e[r]).callback.call(n.ctx,o,s,a);return;default:for(;++r<i;)(n=e[r]).callback.apply(n.ctx,t);return}};u.bind=u.on,u.unbind=u.off,n.extend(t,u);var y=t.Model=function(e,t){var r=e||{};t||(t={}),this.cid=n.uniqueId(this.cidPrefix),this.attributes={},t.collection&&(this.collection=t.collection),t.parse&&(r=this.parse(r,t)||{});var i=n.result(this,"defaults");r=n.defaults(n.extend({},i,r),i),this.set(r,t),this.changed={},this.initialize.apply(this,arguments)};n.extend(y.prototype,u,{changed:null,validationError:null,idAttribute:"id",cidPrefix:"c",initialize:function(){},toJSON:function(e){return n.clone(this.attributes)},sync:function(){return t.sync.apply(this,arguments)},get:function(e){return this.attributes[e]},escape:function(e){return n.escape(this.get(e))},has:function(e){return null!=this.get(e)},matches:function(e){return!!n.iteratee(e,this)(this.attributes)},set:function(e,t,r){if(null==e)return this;var i;if("object"==typeof e?(i=e,r=t):(i={})[e]=t,r||(r={}),!this._validate(i,r))return!1;var o=r.unset,s=r.silent,a=[],l=this._changing;this._changing=!0,l||(this._previousAttributes=n.clone(this.attributes),this.changed={});var c=this.attributes,u=this.changed,d=this._previousAttributes;for(var h in i)t=i[h],n.isEqual(c[h],t)||a.push(h),n.isEqual(d[h],t)?delete u[h]:u[h]=t,o?delete c[h]:c[h]=t;if(this.idAttribute in i&&(this.id=this.get(this.idAttribute)),!s){a.length&&(this._pending=r);for(var f=0;f<a.length;f++)this.trigger("change:"+a[f],this,c[a[f]],r)}if(l)return this;if(!s)for(;this._pending;)r=this._pending,this._pending=!1,this.trigger("change",this,r);return this._pending=!1,this._changing=!1,this},unset:function(e,t){return this.set(e,void 0,n.extend({},t,{unset:!0}))},clear:function(e){var t={};for(var r in this.attributes)t[r]=void 0;return this.set(t,n.extend({},e,{unset:!0}))},hasChanged:function(e){return null==e?!n.isEmpty(this.changed):n.has(this.changed,e)},changedAttributes:function(e){if(!e)return!!this.hasChanged()&&n.clone(this.changed);var t=this._changing?this._previousAttributes:this.attributes,r={};for(var i in e){var o=e[i];n.isEqual(t[i],o)||(r[i]=o)}return!!n.size(r)&&r},previous:function(e){return null!=e&&this._previousAttributes?this._previousAttributes[e]:null},previousAttributes:function(){return n.clone(this._previousAttributes)},fetch:function(e){e=n.extend({parse:!0},e);var t=this,r=e.success;return e.success=function(n){var i=e.parse?t.parse(n,e):n;return!!t.set(i,e)&&(r&&r.call(e.context,t,n,e),void t.trigger("sync",t,n,e))},z(this,e),this.sync("read",this,e)},save:function(e,t,r){var i;null==e||"object"==typeof e?(i=e,r=t):(i={})[e]=t,r=n.extend({validate:!0,parse:!0},r);var o=r.wait;if(i&&!o){if(!this.set(i,r))return!1}else if(!this._validate(i,r))return!1;var s=this,a=r.success,l=this.attributes;r.success=function(e){s.attributes=l;var t=r.parse?s.parse(e,r):e;return o&&(t=n.extend({},i,t)),!(t&&!s.set(t,r))&&(a&&a.call(r.context,s,e,r),void s.trigger("sync",s,e,r))},z(this,r),i&&o&&(this.attributes=n.extend({},l,i));var c=this.isNew()?"create":r.patch?"patch":"update";"patch"!==c||r.attrs||(r.attrs=i);var u=this.sync(c,this,r);return this.attributes=l,u},destroy:function(e){e=e?n.clone(e):{};var t=this,r=e.success,i=e.wait,o=function(){t.stopListening(),t.trigger("destroy",t,t.collection,e)};e.success=function(n){i&&o(),r&&r.call(e.context,t,n,e),t.isNew()||t.trigger("sync",t,n,e)};var s=!1;return this.isNew()?n.defer(e.success):(z(this,e),s=this.sync("delete",this,e)),i||o(),s},url:function(){var e=n.result(this,"urlRoot")||n.result(this.collection,"url")||H();if(this.isNew())return e;var t=this.get(this.idAttribute);return e.replace(/[^\/]$/,"$&/")+encodeURIComponent(t)},parse:function(e,t){return e},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.has(this.idAttribute)},isValid:function(e){return this._validate({},n.extend({},e,{validate:!0}))},_validate:function(e,t){if(!t.validate||!this.validate)return!0;e=n.extend({},this.attributes,e);var r=this.validationError=this.validate(e,t)||null;return!r||(this.trigger("invalid",this,r,n.extend(t,{validationError:r})),!1)}});var w={keys:1,values:1,pairs:1,invert:1,pick:0,omit:0,chain:1,isEmpty:1};a(y,w,"attributes");var x=t.Collection=function(e,t){t||(t={}),t.model&&(this.model=t.model),void 0!==t.comparator&&(this.comparator=t.comparator),this._reset(),this.initialize.apply(this,arguments),e&&this.reset(e,n.extend({silent:!0},t))},C={add:!0,remove:!0,merge:!0},j={add:!0,remove:!1},O=function(e,t,n){n=Math.min(Math.max(n,0),e.length);var r,i=Array(e.length-n),o=t.length;for(r=0;r<i.length;r++)i[r]=e[r+n];for(r=0;r<o;r++)e[r+n]=t[r];for(r=0;r<i.length;r++)e[r+o+n]=i[r]};n.extend(x.prototype,u,{model:y,initialize:function(){},toJSON:function(e){return this.map(function(t){return t.toJSON(e)})},sync:function(){return t.sync.apply(this,arguments)},add:function(e,t){return this.set(e,n.extend({merge:!1},t,j))},remove:function(e,t){t=n.extend({},t);var r=!n.isArray(e);e=r?[e]:e.slice();var i=this._removeModels(e,t);return!t.silent&&i.length&&(t.changes={added:[],merged:[],removed:i},this.trigger("update",this,t)),r?i[0]:i},set:function(e,t){if(null!=e){t=n.extend({},C,t),t.parse&&!this._isModel(e)&&(e=this.parse(e,t)||[]);var r=!n.isArray(e);e=r?[e]:e.slice();var i=t.at;null!=i&&(i=+i),i>this.length&&(i=this.length),i<0&&(i+=this.length+1);var o,s,a=[],l=[],c=[],u=[],d={},h=t.add,f=t.merge,p=t.remove,g=!1,m=this.comparator&&null==i&&t.sort!==!1,v=n.isString(this.comparator)?this.comparator:null;for(s=0;s<e.length;s++){o=e[s];var b=this.get(o);if(b){if(f&&o!==b){var y=this._isModel(o)?o.attributes:o;t.parse&&(y=b.parse(y,t)),b.set(y,t),c.push(b),m&&!g&&(g=b.hasChanged(v))}d[b.cid]||(d[b.cid]=!0,a.push(b)),e[s]=b}else h&&(o=e[s]=this._prepareModel(o,t),o&&(l.push(o),this._addReference(o,t),d[o.cid]=!0,a.push(o)))}if(p){for(s=0;s<this.length;s++)o=this.models[s],d[o.cid]||u.push(o);u.length&&this._removeModels(u,t)}var w=!1,x=!m&&h&&p;if(a.length&&x?(w=this.length!==a.length||n.some(this.models,function(e,t){return e!==a[t]}),this.models.length=0,O(this.models,a,0),this.length=this.models.length):l.length&&(m&&(g=!0),O(this.models,l,null==i?this.length:i),this.length=this.models.length),g&&this.sort({silent:!0}),!t.silent){for(s=0;s<l.length;s++)null!=i&&(t.index=i+s),o=l[s],o.trigger("add",o,this,t);(g||w)&&this.trigger("sort",this,t),(l.length||u.length||c.length)&&(t.changes={added:l,removed:u,merged:c},this.trigger("update",this,t))}return r?e[0]:e}},reset:function(e,t){t=t?n.clone(t):{};for(var r=0;r<this.models.length;r++)this._removeReference(this.models[r],t);return t.previousModels=this.models,this._reset(),e=this.add(e,n.extend({silent:!0},t)),t.silent||this.trigger("reset",this,t),e},push:function(e,t){return this.add(e,n.extend({at:this.length},t))},pop:function(e){var t=this.at(this.length-1);return this.remove(t,e)},unshift:function(e,t){return this.add(e,n.extend({at:0},t))},shift:function(e){var t=this.at(0);return this.remove(t,e)},slice:function(){return o.apply(this.models,arguments)},get:function(e){if(null!=e)return this._byId[e]||this._byId[this.modelId(e.attributes||e)]||e.cid&&this._byId[e.cid]},has:function(e){return null!=this.get(e)},at:function(e){return e<0&&(e+=this.length),this.models[e]},where:function(e,t){return this[t?"find":"filter"](e)},findWhere:function(e){return this.where(e,!0)},sort:function(e){var t=this.comparator;if(!t)throw new Error("Cannot sort a set without a comparator");e||(e={});var r=t.length;return n.isFunction(t)&&(t=n.bind(t,this)),1===r||n.isString(t)?this.models=this.sortBy(t):this.models.sort(t),e.silent||this.trigger("sort",this,e),this},pluck:function(e){return this.map(e+"")},fetch:function(e){e=n.extend({parse:!0},e);var t=e.success,r=this;return e.success=function(n){var i=e.reset?"reset":"set";r[i](n,e),t&&t.call(e.context,r,n,e),r.trigger("sync",r,n,e)},z(this,e),this.sync("read",this,e)},create:function(e,t){t=t?n.clone(t):{};var r=t.wait;if(e=this._prepareModel(e,t),!e)return!1;r||this.add(e,t);var i=this,o=t.success;return t.success=function(e,t,n){r&&i.add(e,n),o&&o.call(n.context,e,t,n)},e.save(null,t),e},parse:function(e,t){return e},clone:function(){return new this.constructor(this.models,{model:this.model,comparator:this.comparator})},modelId:function(e){return e[this.model.prototype.idAttribute||"id"]},_reset:function(){this.length=0,this.models=[],this._byId={}},_prepareModel:function(e,t){if(this._isModel(e))return e.collection||(e.collection=this),e;t=t?n.clone(t):{},t.collection=this;var r=new this.model(e,t);return r.validationError?(this.trigger("invalid",this,r.validationError,t),!1):r},_removeModels:function(e,t){for(var n=[],r=0;r<e.length;r++){var i=this.get(e[r]);if(i){var o=this.indexOf(i);this.models.splice(o,1),this.length--,delete this._byId[i.cid];var s=this.modelId(i.attributes);null!=s&&delete this._byId[s],t.silent||(t.index=o,i.trigger("remove",i,this,t)),n.push(i),this._removeReference(i,t)}}return n},_isModel:function(e){return e instanceof y},_addReference:function(e,t){this._byId[e.cid]=e;var n=this.modelId(e.attributes);null!=n&&(this._byId[n]=e),e.on("all",this._onModelEvent,this)},_removeReference:function(e,t){delete this._byId[e.cid];var n=this.modelId(e.attributes);null!=n&&delete this._byId[n],this===e.collection&&delete e.collection,e.off("all",this._onModelEvent,this)},_onModelEvent:function(e,t,n,r){if(t){if(("add"===e||"remove"===e)&&n!==this)return;if("destroy"===e&&this.remove(t,r),"change"===e){var i=this.modelId(t.previousAttributes()),o=this.modelId(t.attributes);i!==o&&(null!=i&&delete this._byId[i],null!=o&&(this._byId[o]=t))}}this.trigger.apply(this,arguments)}});var k={forEach:3,each:3,map:3,collect:3,reduce:0,foldl:0,inject:0,reduceRight:0,foldr:0,find:3,detect:3,filter:3,select:3,reject:3,every:3,all:3,some:3,any:3,include:3,includes:3,contains:3,invoke:0,max:3,min:3,toArray:1,size:1,first:3,head:3,take:3,initial:3,rest:3,tail:3,drop:3,last:3,without:0,difference:0,indexOf:3,shuffle:1,lastIndexOf:3,isEmpty:1,chain:1,sample:3,partition:3,groupBy:3,countBy:3,sortBy:3,indexBy:3,findIndex:3,findLastIndex:3};a(x,k,"models");var S=t.View=function(e){this.cid=n.uniqueId("view"),n.extend(this,n.pick(e,P)),this._ensureElement(),this.initialize.apply(this,arguments)},T=/^(\S+)\s*(.*)$/,P=["model","collection","el","id","attributes","className","tagName","events"];n.extend(S.prototype,u,{tagName:"div",$:function(e){return this.$el.find(e)},initialize:function(){},render:function(){return this},remove:function(){return this._removeElement(),this.stopListening(),this},_removeElement:function(){this.$el.remove()},setElement:function(e){return this.undelegateEvents(),this._setElement(e),this.delegateEvents(),this},_setElement:function(e){this.$el=e instanceof t.$?e:t.$(e),this.el=this.$el[0]},delegateEvents:function(e){if(e||(e=n.result(this,"events")),!e)return this;this.undelegateEvents();for(var t in e){var r=e[t];if(n.isFunction(r)||(r=this[r]),r){var i=t.match(T);this.delegate(i[1],i[2],n.bind(r,this))}}return this},delegate:function(e,t,n){return this.$el.on(e+".delegateEvents"+this.cid,t,n),this},undelegateEvents:function(){return this.$el&&this.$el.off(".delegateEvents"+this.cid),this},undelegate:function(e,t,n){return this.$el.off(e+".delegateEvents"+this.cid,t,n),this},_createElement:function(e){return document.createElement(e)},_ensureElement:function(){if(this.el)this.setElement(n.result(this,"el"));else{var e=n.extend({},n.result(this,"attributes"));this.id&&(e.id=n.result(this,"id")),this.className&&(e["class"]=n.result(this,"className")),this.setElement(this._createElement(n.result(this,"tagName"))),this._setAttributes(e)}},_setAttributes:function(e){this.$el.attr(e)}}),t.sync=function(e,r,i){var o=E[e];n.defaults(i||(i={}),{emulateHTTP:t.emulateHTTP,emulateJSON:t.emulateJSON});var s={type:o,dataType:"json"};if(i.url||(s.url=n.result(r,"url")||H()),null!=i.data||!r||"create"!==e&&"update"!==e&&"patch"!==e||(s.contentType="application/json",s.data=JSON.stringify(i.attrs||r.toJSON(i))),i.emulateJSON&&(s.contentType="application/x-www-form-urlencoded",s.data=s.data?{model:s.data}:{}),i.emulateHTTP&&("PUT"===o||"DELETE"===o||"PATCH"===o)){s.type="POST",i.emulateJSON&&(s.data._method=o);var a=i.beforeSend;i.beforeSend=function(e){if(e.setRequestHeader("X-HTTP-Method-Override",o),a)return a.apply(this,arguments)}}"GET"===s.type||i.emulateJSON||(s.processData=!1);var l=i.error;i.error=function(e,t,n){i.textStatus=t,i.errorThrown=n,l&&l.call(i.context,e,t,n)};var c=i.xhr=t.ajax(n.extend(s,i));return r.trigger("request",r,c,i),c};var E={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};t.ajax=function(){return t.$.ajax.apply(t.$,arguments)};var _=t.Router=function(e){e||(e={}),e.routes&&(this.routes=e.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},D=/\((.*?)\)/g,M=/(\(\?)?:\w+/g,A=/\*\w+/g,L=/[\-{}\[\]+?.,\\\^$|#\s]/g;n.extend(_.prototype,u,{initialize:function(){},route:function(e,r,i){n.isRegExp(e)||(e=this._routeToRegExp(e)),n.isFunction(r)&&(i=r,r=""),i||(i=this[r]);var o=this;return t.history.route(e,function(n){var s=o._extractParameters(e,n);o.execute(i,s,r)!==!1&&(o.trigger.apply(o,["route:"+r].concat(s)),o.trigger("route",r,s),t.history.trigger("route",o,r,s))}),this},execute:function(e,t,n){e&&e.apply(this,t)},navigate:function(e,n){return t.history.navigate(e,n),this},_bindRoutes:function(){if(this.routes){this.routes=n.result(this,"routes");for(var e,t=n.keys(this.routes);null!=(e=t.pop());)this.route(e,this.routes[e])}},_routeToRegExp:function(e){return e=e.replace(L,"\\$&").replace(D,"(?:$1)?").replace(M,function(e,t){return t?e:"([^/?]+)"}).replace(A,"([^?]*?)"),new RegExp("^"+e+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(e,t){var r=e.exec(t).slice(1);return n.map(r,function(e,t){return t===r.length-1?e||null:e?decodeURIComponent(e):null})}});var N=t.History=function(){this.handlers=[],this.checkUrl=n.bind(this.checkUrl,this),"undefined"!=typeof window&&(this.location=window.location,this.history=window.history)},V=/^[#\/]|\s+$/g,I=/^\/+|\/+$/g,F=/#.*$/;N.started=!1,n.extend(N.prototype,u,{interval:50,atRoot:function(){var e=this.location.pathname.replace(/[^\/]$/,"$&/");return e===this.root&&!this.getSearch()},matchRoot:function(){var e=this.decodeFragment(this.location.pathname),t=e.slice(0,this.root.length-1)+"/";return t===this.root},decodeFragment:function(e){return decodeURI(e.replace(/%25/g,"%2525"))},getSearch:function(){var e=this.location.href.replace(/#.*/,"").match(/\?.+/);return e?e[0]:""},getHash:function(e){var t=(e||this).location.href.match(/#(.*)$/);return t?t[1]:""},getPath:function(){var e=this.decodeFragment(this.location.pathname+this.getSearch()).slice(this.root.length-1);return"/"===e.charAt(0)?e.slice(1):e},getFragment:function(e){return null==e&&(e=this._usePushState||!this._wantsHashChange?this.getPath():this.getHash()),e.replace(V,"")},start:function(e){if(N.started)throw new Error("Backbone.history has already been started");if(N.started=!0,this.options=n.extend({root:"/"},this.options,e),this.root=this.options.root,this._wantsHashChange=this.options.hashChange!==!1,this._hasHashChange="onhashchange"in window&&(void 0===document.documentMode||document.documentMode>7),this._useHashChange=this._wantsHashChange&&this._hasHashChange,this._wantsPushState=!!this.options.pushState,this._hasPushState=!(!this.history||!this.history.pushState),this._usePushState=this._wantsPushState&&this._hasPushState,this.fragment=this.getFragment(),this.root=("/"+this.root+"/").replace(I,"/"),this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){var t=this.root.slice(0,-1)||"/";return this.location.replace(t+"#"+this.getPath()),!0}this._hasPushState&&this.atRoot()&&this.navigate(this.getHash(),{replace:!0})}if(!this._hasHashChange&&this._wantsHashChange&&!this._usePushState){this.iframe=document.createElement("iframe"),this.iframe.src="javascript:0",this.iframe.style.display="none",this.iframe.tabIndex=-1;var r=document.body,i=r.insertBefore(this.iframe,r.firstChild).contentWindow;i.document.open(),i.document.close(),i.location.hash="#"+this.fragment}var o=window.addEventListener||function(e,t){return attachEvent("on"+e,t)};if(this._usePushState?o("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe?o("hashchange",this.checkUrl,!1):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),!this.options.silent)return this.loadUrl()},stop:function(){var e=window.removeEventListener||function(e,t){return detachEvent("on"+e,t)};this._usePushState?e("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe&&e("hashchange",this.checkUrl,!1),this.iframe&&(document.body.removeChild(this.iframe),this.iframe=null),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),N.started=!1;
|
||
},route:function(e,t){this.handlers.unshift({route:e,callback:t})},checkUrl:function(e){var t=this.getFragment();return t===this.fragment&&this.iframe&&(t=this.getHash(this.iframe.contentWindow)),t!==this.fragment&&(this.iframe&&this.navigate(t),void this.loadUrl())},loadUrl:function(e){return!!this.matchRoot()&&(e=this.fragment=this.getFragment(e),n.some(this.handlers,function(t){if(t.route.test(e))return t.callback(e),!0}))},navigate:function(e,t){if(!N.started)return!1;t&&t!==!0||(t={trigger:!!t}),e=this.getFragment(e||"");var n=this.root;""!==e&&"?"!==e.charAt(0)||(n=n.slice(0,-1)||"/");var r=n+e;if(e=this.decodeFragment(e.replace(F,"")),this.fragment!==e){if(this.fragment=e,this._usePushState)this.history[t.replace?"replaceState":"pushState"]({},document.title,r);else{if(!this._wantsHashChange)return this.location.assign(r);if(this._updateHash(this.location,e,t.replace),this.iframe&&e!==this.getHash(this.iframe.contentWindow)){var i=this.iframe.contentWindow;t.replace||(i.document.open(),i.document.close()),this._updateHash(i.location,e,t.replace)}}return t.trigger?this.loadUrl(e):void 0}},_updateHash:function(e,t,n){if(n){var r=e.href.replace(/(javascript:|#).*$/,"");e.replace(r+"#"+t)}else e.hash="#"+t}}),t.history=new N;var R=function(e,t){var r,i=this;return r=e&&n.has(e,"constructor")?e.constructor:function(){return i.apply(this,arguments)},n.extend(r,i,t),r.prototype=n.create(i.prototype,e),r.prototype.constructor=r,r.__super__=i.prototype,r};y.extend=x.extend=_.extend=S.extend=N.extend=R;var H=function(){throw new Error('A "url" property or function must be specified')},z=function(e,t){var n=t.error;t.error=function(r){n&&n.call(t.context,e,r,t),e.trigger("error",e,r,t)}};return t})}).call(this,n("./node_modules/webpack/buildin/global.js"))},"./node_modules/cash-dom/dist/cash.esm.js":function(e,t,n){"use strict";function r(e,t){return void 0===t&&(t=H),J.test(e)?t.getElementsByClassName(e.slice(1)):Q.test(e)?t.getElementsByTagName(e):t.querySelectorAll(e)}function i(e,t){if(void 0===t&&(t=H),e){if(e.__cash)return e;var n=e;if(d(e)){if(t.__cash&&(t=t[0]),n=X.test(e)?t.getElementById(e.slice(1)):Z.test(e)?I(e):r(e,t),!n)return}else if(u(e))return this.ready(e);(n.nodeType||n===z)&&(n=[n]),this.length=n.length;for(var i=0,o=this.length;i<o;i++)this[i]=n[i]}}function o(e,t){return new i(e,t)}function s(e){return e.replace(te,function(e,t){return e[t?"toUpperCase":"toLowerCase"]()}).replace(ne,"")}function a(e,t){for(var n=0,r=e.length;n<r&&t.call(e[n],e[n],n,e)!==!1;n++);}function l(e){void 0===e&&(e=this);for(var t=arguments,n=t.length,r=n<2?0:1;r<n;r++)for(var i in t[r])e[i]=t[r][i];return e}function c(e,t){var n=e&&(e.matches||e.webkitMatchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector);return!!n&&n.call(e,t)}function u(e){return"function"==typeof e}function d(e){return"string"==typeof e}function h(e){return!isNaN(parseFloat(e))&&isFinite(e)}function f(e){return d(e)?function(t,n){return c(n,e)}:e.__cash?function(t,n){return e.is(n)}:function(e,t,n){return t===n}}function p(e){return d(e)?e.match(oe)||[]:[]}function g(e){return e.filter(function(e,t,n){return n.indexOf(e)===t})}function m(e,t,n){if(1===e.nodeType){var r=z.getComputedStyle(e,null);return t?n?r.getPropertyValue(t):r[t]:r}}function v(e,t){return parseInt(m(e,t),10)||0}function b(e){return se.test(e)}function y(e,t){if(void 0===t&&(t=b(e)),t)return e;if(!ae[e]){var n=s(e),r=""+n.charAt(0).toUpperCase()+n.slice(1),i=(n+" "+ue.join(r+" ")+r).split(" ");a(i,function(t){if(t in ce)return ae[e]=t,!1})}return ae[e]}function w(e,t,n){return void 0===n&&(n=b(e)),n||de[e]||!h(t)?t:t+"px"}function x(e){return e[he]=e[he]||{}}function C(e,t){var n=x(e);if(t){if(!(t in n)){var r=e.dataset?e.dataset[t]||e.dataset[s(t)]:o(e).attr("data-"+t);if(void 0!==r){try{r=JSON.parse(r)}catch(i){}n[t]=r}}return n[t]}return n}function j(e,t){void 0===t?delete e[he]:delete x(e)[t]}function O(e,t,n){x(e)[t]=n}function k(e,t){return v(e,"border"+(t?"Left":"Top")+"Width")+v(e,"padding"+(t?"Left":"Top"))+v(e,"padding"+(t?"Right":"Bottom"))+v(e,"border"+(t?"Right":"Bottom")+"Width")}function S(e,t){for(var n=0,r=t.length;n<r;n++)if(e.indexOf(t[n])<0)return!1;return!0}function T(e,t,n){a(e[n],function(e){var r=(e[0],e[1]);t.removeEventListener(n,r)}),delete e[n]}function P(e){return e[pe]=e[pe]||{}}function E(e,t,n,r){r.guid=r.guid||re++;var i=P(e);i[t]=i[t]||[],i[t].push([n,r]),e.addEventListener(t,r)}function _(e){var t=e.split(ge);return[t[0],t.slice(1).sort()]}function D(e,t,n,r){var i=P(e);if(t){var o=i[t];if(!o)return;r&&(r.guid=r.guid||re++),i[t]=o.filter(function(i){var o=i[0],s=i[1];return!((!r||s.guid===r.guid)&&S(o,n))||void e.removeEventListener(t,s)})}else if(n&&n.length)for(t in i)D(e,t,n,r);else for(t in i)T(i,e,t)}function M(e){var t=[];return a(e.options,function(e){!e.selected||e.disabled||e.parentNode.disabled||t.push(e.value)}),t}function A(e){return e.selectedIndex<0?null:e.options[e.selectedIndex].value}function L(e){var t=e.type;return me.test(t)?A(e):ve.test(t)?M(e):e.value}function N(e,t){return"&"+encodeURIComponent(e)+"="+encodeURIComponent(t).replace(be,"+")}function V(){if(!xe){var e=H.createElement("table"),t=H.createElement("tr");xe={"*":H.createElement("div"),tr:H.createElement("tbody"),td:t,th:t,thead:e,tbody:e,tfoot:e}}}function I(e){if(V(),!d(e))return[];if(je.test(e))return[H.createElement(RegExp.$1)];var t=Ce.test(e)&&RegExp.$1,n=xe[t]||xe["*"];return n.innerHTML=e,o(n.childNodes).detach().get()}function F(e,t,n){n?e.insertBefore(t,e.childNodes[0]):e.appendChild(t)}function R(e,t,n){if(void 0!==t){var r=d(t);!r&&t.length?a(t,function(t){return R(e,t,n)}):a(e,r?function(e){e.insertAdjacentHTML(n?"afterbegin":"beforeend",t)}:function(e,r){return F(e,r?t.cloneNode(!0):t,n)})}}n.r(t);var H=document,z=window,B=Array.prototype,$=B.filter,W=B.indexOf,U=B.map,q=B.push,G=B.reverse,K=B.slice,Y=B.splice,X=/^#[\w-]*$/,J=/^\.[\w-]*$/,Z=/<.+>/,Q=/^\w+$/,ee=o.fn=o.prototype=i.prototype={constructor:o,__cash:!0,length:0,splice:Y};ee.get=function(e){return void 0===e?K.call(this):this[e<0?e+this.length:e]},ee.eq=function(e){return o(this.get(e))},ee.first=function(){return this.eq(0)},ee.last=function(){return this.eq(-1)},ee.map=function(e){return o(U.call(this,function(t,n){return e.call(t,n,t)}))},ee.slice=function(){return o(K.apply(this,arguments))};var te=/(?:^\w|[A-Z]|\b\w)/g,ne=/[\s-_]+/g;o.camelCase=s,o.each=a,ee.each=function(e){return a(this,function(t,n){return e.call(t,n,t)}),this},ee.removeProp=function(e){return this.each(function(t,n){delete n[e]})},o.extend=ee.extend=l;var re=1;o.guid=re,o.matches=c,o.isFunction=u,o.isString=d,o.isNumeric=h;var ie=Array.isArray;o.isArray=ie,ee.prop=function(e,t){if(e){if(d(e))return arguments.length<2?this[0]&&this[0][e]:this.each(function(n,r){r[e]=t});for(var n in e)this.prop(n,e[n]);return this}},ee.filter=function(e){if(!e)return o();var t=u(e)?e:f(e);return o($.call(this,function(n,r){return t.call(n,r,n,e)}))};var oe=/\S+/g;ee.hasClass=function(e){var t=p(e),n=!1;return t.length&&this.each(function(e,r){return n=r.classList.contains(t[0]),!n}),n},ee.removeAttr=function(e){var t=p(e);return t.length?this.each(function(e,n){a(t,function(e){n.removeAttribute(e)})}):this},ee.attr=function(e,t){if(e){if(d(e)){if(arguments.length<2){if(!this[0])return;var n=this[0].getAttribute(e);return null===n?void 0:n}return null===t?this.removeAttr(e):this.each(function(n,r){r.setAttribute(e,t)})}for(var r in e)this.attr(r,e[r]);return this}},ee.toggleClass=function(e,t){var n=p(e),r=void 0!==t;return n.length?this.each(function(e,i){a(n,function(e){r?t?i.classList.add(e):i.classList.remove(e):i.classList.toggle(e)})}):this},ee.addClass=function(e){return this.toggleClass(e,!0)},ee.removeClass=function(e){return arguments.length?this.toggleClass(e,!1):this.attr("class","")},o.unique=g,ee.add=function(e,t){return o(g(this.get().concat(o(e,t).get())))};var se=/^--/,ae={},le=H.createElement("div"),ce=le.style,ue=["webkit","moz","ms","o"];o.prefixedProp=y;var de={animationIterationCount:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0};ee.css=function(e,t){if(d(e)){var n=b(e);return e=y(e,n),arguments.length<2?this[0]&&m(this[0],e,n):e?(t=w(e,t,n),this.each(function(r,i){1===i.nodeType&&(n?i.style.setProperty(e,t):i.style[e]=t)})):this}for(var r in e)this.css(r,e[r]);return this};var he="__cashData",fe=/^data-(.*)/;o.hasData=function(e){return he in e},ee.data=function(e,t){var n=this;if(!e){if(!this[0])return;return a(this[0].attributes,function(e){var t=e.name.match(fe);t&&n.data(t[1])}),C(this[0])}if(d(e))return void 0===t?this[0]&&C(this[0],e):this.each(function(n,r){return O(r,e,t)});for(var r in e)this.data(r,e[r]);return this},ee.removeData=function(e){return this.each(function(t,n){return j(n,e)})},a(["Width","Height"],function(e){ee["inner"+e]=function(){if(this[0])return this[0]===z?z["inner"+e]:this[0]["client"+e]}}),a(["width","height"],function(e,t){ee[e]=function(n){return this[0]?arguments.length?(n=parseInt(n,10),this.each(function(r,i){if(1===i.nodeType){var o=m(i,"boxSizing");i.style[e]=w(e,n+("border-box"===o?k(i,!t):0))}})):this[0]===z?this[0][s("outer-"+e)]:this[0].getBoundingClientRect()[e]-k(this[0],!t):void 0===n?void 0:this}}),a(["Width","Height"],function(e,t){ee["outer"+e]=function(n){if(this[0])return this[0]===z?z["outer"+e]:this[0]["offset"+e]+(n?v(this[0],"margin"+(t?"Top":"Left"))+v(this[0],"margin"+(t?"Bottom":"Right")):0)}});var pe="__cashEvents",ge=".";ee.off=function(e,t){var n=this;return void 0===e?this.each(function(e,t){return D(t)}):a(p(e),function(e){var r=_(e),i=r[0],o=r[1];n.each(function(e,n){return D(n,i,o,t)})}),this},ee.on=function(e,t,n,r){var i=this;if(!d(e)){for(var o in e)this.on(o,t,e[o]);return this}return u(t)&&(n=t,t=!1),a(p(e),function(e){var o=_(e),s=o[0],a=o[1];i.each(function(e,i){var o=function l(e){if(!e.namespace||S(a,e.namespace.split(ge))){var o=i;if(t){for(var u=e.target;!c(u,t);){if(u===i)return;if(u=u.parentNode,!u)return}o=u}e.namespace=e.namespace||"";var d=n.call(o,e,e.data);r&&D(i,s,a,l),d===!1&&(e.preventDefault(),e.stopPropagation())}};o.guid=n.guid=n.guid||re++,E(i,s,a,o)})}),this},ee.one=function(e,t,n){return this.on(e,t,n,!0)},ee.ready=function(e){var t=function(){return e(o)};return"loading"!==H.readyState?setTimeout(t):H.addEventListener("DOMContentLoaded",t),this},ee.trigger=function(e,t){var n=e;if(d(e)){var r=_(e),i=r[0],o=r[1];n=H.createEvent("HTMLEvents"),n.initEvent(i,!0,!0),n.namespace=o.join(ge)}return n.data=t,this.each(function(e,t){t.dispatchEvent(n)})};var me=/select-one/i,ve=/select-multiple/i,be=/%20/g,ye=/file|reset|submit|button|image/i,we=/radio|checkbox/i;ee.serialize=function(){var e="";return this.each(function(t,n){a(n.elements||[n],function(t){if(!t.disabled&&t.name&&"FIELDSET"!==t.tagName&&!ye.test(t.type)&&(!we.test(t.type)||t.checked)){var n=L(t);if(void 0!==n){var r=ie(n)?n:[n];a(r,function(n){e+=N(t.name,n)})}}})}),e.substr(1)},ee.val=function(e){return void 0===e?this[0]&&L(this[0]):this.each(function(t,n){var r=ve.test(n.type),i=null===e?r?[]:"":e;r&&ie(i)?a(n.options,function(e){e.selected=i.indexOf(e.value)>=0}):n.value=i})},ee.clone=function(){return this.map(function(e,t){return t.cloneNode(!0)})},ee.detach=function(){return this.each(function(e,t){t.parentNode&&t.parentNode.removeChild(t)})};var xe,Ce=/^\s*<(\w+)[^>]*>/,je=/^\s*<(\w+)\s*\/?>(?:<\/\1>)?\s*$/;o.parseHTML=I,ee.empty=function(){var e=this[0];if(e)for(;e.firstChild;)e.removeChild(e.firstChild);return this},ee.append=function(){var e=this;return a(arguments,function(t){R(e,t)}),this},ee.appendTo=function(e){return R(o(e),this),this},ee.html=function(e){if(void 0===e)return this[0]&&this[0].innerHTML;var t=e.nodeType?e[0].outerHTML:e;return this.each(function(e,n){n.innerHTML=t})},ee.insertAfter=function(e){var t=this;return o(e).each(function(e,n){var r=n.parentNode;t.each(function(t,i){r.insertBefore(e?i.cloneNode(!0):i,n.nextSibling)})}),this},ee.after=function(){var e=this;return a(G.apply(arguments),function(t){G.apply(o(t).slice()).insertAfter(e)}),this},ee.insertBefore=function(e){var t=this;return o(e).each(function(e,n){var r=n.parentNode;t.each(function(t,i){r.insertBefore(e?i.cloneNode(!0):i,n)})}),this},ee.before=function(){var e=this;return a(arguments,function(t){o(t).insertBefore(e)}),this},ee.prepend=function(){var e=this;return a(arguments,function(t){R(e,t,!0)}),this},ee.prependTo=function(e){return R(o(e),G.apply(this.slice()),!0),this},ee.remove=function(){return this.detach().off()},ee.replaceWith=function(e){var t=this;return this.each(function(n,r){var i=r.parentNode;if(i){var s=n?o(e).clone():o(e);if(!s[0])return t.remove(),!1;i.replaceChild(s[0],r),o(s[0]).after(s.slice(1))}})},ee.replaceAll=function(e){return o(e).replaceWith(this),this},ee.text=function(e){return void 0===e?this[0]?this[0].textContent:"":this.each(function(t,n){n.textContent=e})};var Oe=H.documentElement;ee.offset=function(){var e=this[0];if(e){var t=e.getBoundingClientRect();return{top:t.top+z.pageYOffset-Oe.clientTop,left:t.left+z.pageXOffset-Oe.clientLeft}}},ee.offsetParent=function(){return o(this[0]&&this[0].offsetParent)},ee.position=function(){var e=this[0];if(e)return{left:e.offsetLeft,top:e.offsetTop}},ee.children=function(e){var t=[];return this.each(function(e,n){q.apply(t,n.children)}),t=o(g(t)),e?t.filter(function(t,n){return c(n,e)}):t},ee.contents=function(){var e=[];return this.each(function(t,n){q.apply(e,"IFRAME"===n.tagName?[n.contentDocument]:n.childNodes)}),o(e.length&&g(e))},ee.find=function(e){for(var t=[],n=0,i=this.length;n<i;n++){var s=r(e,this[n]);s.length&&q.apply(t,s)}return o(t.length&&g(t))},ee.has=function(e){var t=d(e)?function(t,n){return!!r(e,n).length}:function(t,n){return n.contains(e)};return this.filter(t)},ee.is=function(e){if(!e||!this[0])return!1;var t=f(e),n=!1;return this.each(function(r,i){return n=t(r,i,e),!n}),n},ee.next=function(){return o(this[0]&&this[0].nextElementSibling)},ee.not=function(e){if(!e||!this[0])return this;var t=f(e);return this.filter(function(n,r){return!t(n,r,e)})},ee.parent=function(){var e=[];return this.each(function(t,n){n&&n.parentNode&&e.push(n.parentNode)}),o(g(e))},ee.index=function(e){var t=e?o(e)[0]:this[0],n=e?this:o(t).parent().children();return W.call(n,t)},ee.closest=function(e){return e&&this[0]?this.is(e)?this.filter(e):this.parent().closest(e):o()},ee.parents=function(e){var t,n=[];return this.each(function(r,i){for(t=i;t&&t.parentNode&&t!==H.body.parentNode;)t=t.parentNode,(!e||e&&c(t,e))&&n.push(t)}),o(g(n))},ee.prev=function(){return o(this[0]&&this[0].previousElementSibling)},ee.siblings=function(){var e=this[0];return this.parent().children().filter(function(t,n){return n!==e})},t["default"]=o},"./node_modules/codemirror-formatting/formatting.js":function(e,t,n){!function(e){e(n("./node_modules/codemirror/lib/codemirror.js"))}(function(e){e.extendMode("css",{commentStart:"/*",commentEnd:"*/",newlineAfterToken:function(e,t){return/^[;{}]$/.test(t)}}),e.extendMode("javascript",{commentStart:"/*",commentEnd:"*/",newlineAfterToken:function(e,t,n,r){return this.jsonMode?/^[\[,{]$/.test(t)||/^}/.test(n):(";"!=t||!r.lexical||")"!=r.lexical.type)&&(/^[;{}]$/.test(t)&&!/^;/.test(n))}});var t=/^(a|abbr|acronym|area|base|bdo|big|br|button|caption|cite|code|col|colgroup|dd|del|dfn|em|frame|hr|iframe|img|input|ins|kbd|label|legend|link|map|object|optgroup|option|param|q|samp|script|select|small|span|strong|sub|sup|textarea|tt|var)$/;e.extendMode("xml",{commentStart:"<!--",commentEnd:"-->",newlineAfterToken:function(e,n,r,i){var o=!1;return"html"==this.configuration&&(o=!!i.context&&t.test(i.context.tagName)),!o&&("tag"==e&&/>$/.test(n)&&i.context||/^</.test(r))}}),e.defineExtension("commentRange",function(t,n,r){var i=this,o=e.innerMode(i.getMode(),i.getTokenAt(n).state).mode;i.operation(function(){if(t)i.replaceRange(o.commentEnd,r),i.replaceRange(o.commentStart,n),n.line==r.line&&n.ch==r.ch&&i.setCursor(n.line,n.ch+o.commentStart.length);else{var e=i.getRange(n,r),s=e.indexOf(o.commentStart),a=e.lastIndexOf(o.commentEnd);s>-1&&a>-1&&a>s&&(e=e.substr(0,s)+e.substring(s+o.commentStart.length,a)+e.substr(a+o.commentEnd.length)),i.replaceRange(e,n,r)}})}),e.defineExtension("autoIndentRange",function(e,t){var n=this;this.operation(function(){for(var r=e.line;r<=t.line;r++)n.indentLine(r,"smart")})}),e.defineExtension("autoFormatRange",function(t,n){function r(){c+="\n",d=!0,++u}for(var i=this,o=i.getMode(),s=i.getRange(t,n).split("\n"),a=e.copyState(o,i.getTokenAt(t).state),l=i.getOption("tabSize"),c="",u=0,d=0===t.ch,h=0;h<s.length;++h){for(var f=new e.StringStream(s[h],l);!f.eol();){var p=e.innerMode(o,a),g=o.token(f,a),m=f.current();f.start=f.pos,d&&!/\S/.test(m)||(c+=m,d=!1),!d&&p.mode.newlineAfterToken&&p.mode.newlineAfterToken(g,m,f.string.slice(f.pos)||s[h+1]||"",p.state)&&r()}!f.pos&&o.blankLine&&o.blankLine(a),!d&&h<s.length-1&&r()}i.operation(function(){i.replaceRange(c,t,n);for(var e=t.line+1,r=t.line+u;e<=r;++e)i.indentLine(e,"smart");i.setSelection(t,i.getCursor(!1))})})})},"./node_modules/codemirror/lib/codemirror.js":function(e,t,n){!function(t,n){e.exports=n()}(this,function(){"use strict";function e(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function t(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function n(e,n){return t(e).appendChild(n)}function r(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function i(e,t,n,i){var o=r(e,t,n,i);return o.setAttribute("role","presentation"),o}function o(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do if(11==t.nodeType&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function s(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function a(t,n){var r=t.className;e(n).test(r)||(t.className+=(r?" ":"")+n)}function l(t,n){for(var r=t.split(" "),i=0;i<r.length;i++)r[i]&&!e(r[i]).test(n)&&(n+=" "+r[i]);return n}function c(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function u(e,t,n){t||(t={});for(var r in e)!e.hasOwnProperty(r)||n===!1&&t.hasOwnProperty(r)||(t[r]=e[r]);return t}function d(e,t,n,r,i){null==t&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var o=r||0,s=i||0;;){var a=e.indexOf("\t",o);if(a<0||a>=t)return s+(t-o);s+=a-o,s+=n-s%n,o=a+1}}function h(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}function f(e,t,n){for(var r=0,i=0;;){var o=e.indexOf("\t",r);o==-1&&(o=e.length);var s=o-r;if(o==e.length||i+s>=t)return r+Math.min(s,t-i);if(i+=o-r,i+=n-i%n,r=o+1,i>=t)return r}}function p(e){for(;Js.length<=e;)Js.push(g(Js)+" ");return Js[e]}function g(e){return e[e.length-1]}function m(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function v(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}function b(){}function y(e,t){var n;return Object.create?n=Object.create(e):(b.prototype=e,n=new b),t&&u(t,n),n}function w(e){return/\w/.test(e)||e>""&&(e.toUpperCase()!=e.toLowerCase()||Zs.test(e))}function x(e,t){return t?!!(t.source.indexOf("\\w")>-1&&w(e))||t.test(e):w(e)}function C(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function j(e){return e.charCodeAt(0)>=768&&Qs.test(e)}function O(e,t,n){for(;(n<0?t>0:t<e.length)&&j(e.charAt(t));)t+=n;return t}function k(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}function S(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;o<e.length;++o){var s=e[o];(s.from<n&&s.to>t||t==n&&s.to==t)&&(r(Math.max(s.from,t),Math.min(s.to,n),1==s.level?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}function T(e,t,n){var r;ea=null;for(var i=0;i<e.length;++i){var o=e[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&"before"==n?r=i:ea=i),o.from==t&&(o.from!=o.to&&"before"!=n?r=i:ea=i)}return null!=r?r:ea}function P(e,t){var n=e.order;return null==n&&(n=e.order=ta(e.text,t)),n}function E(e,t){return e._handlers&&e._handlers[t]||na}function _(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var o=h(i,n);o>-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function D(e,t){var n=E(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function M(e,t,n){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),D(e,n||t.type,e,t),F(t)||t.codemirrorIgnore}function A(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)h(n,t[r])==-1&&n.push(t[r])}function L(e,t){return E(e,t).length>0}function N(e){e.prototype.on=function(e,t){ra(this,e,t)},e.prototype.off=function(e,t){_(this,e,t)}}function V(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function I(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function F(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function R(e){V(e),I(e)}function H(e){return e.target||e.srcElement}function z(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),Ls&&e.ctrlKey&&1==t&&(t=3),t}function B(e){if(null==Ws){var t=r("span","");n(e,r("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Ws=t.offsetWidth<=1&&t.offsetHeight>2&&!(Cs&&js<8))}var i=Ws?r("span",""):r("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}function $(e){if(null!=Us)return Us;var r=n(e,document.createTextNode("AخA")),i=Fs(r,0,1).getBoundingClientRect(),o=Fs(r,1,2).getBoundingClientRect();return t(e),!(!i||i.left==i.right)&&(Us=o.right-i.right<3)}function W(e){if(null!=la)return la;var t=n(e,r("span","x")),i=t.getBoundingClientRect(),o=Fs(t,0,1).getBoundingClientRect();return la=Math.abs(i.left-o.left)>1}function U(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),ca[e]=t}function q(e,t){ua[e]=t}function G(e){if("string"==typeof e&&ua.hasOwnProperty(e))e=ua[e];else if(e&&"string"==typeof e.name&&ua.hasOwnProperty(e.name)){var t=ua[e.name];"string"==typeof t&&(t={name:t}),e=y(t,e),e.name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return G("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return G("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function K(e,t){t=G(t);var n=ca[t.name];if(!n)return K(e,"text/plain");var r=n(e,t);if(da.hasOwnProperty(t.name)){var i=da[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var s in t.modeProps)r[s]=t.modeProps[s];return r}function Y(e,t){var n=da.hasOwnProperty(e)?da[e]:da[e]={};u(t,n)}function X(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function J(e,t){for(var n;e.innerMode&&(n=e.innerMode(t),n&&n.mode!=e);)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Z(e,t,n){return!e.startState||e.startState(t,n)}function Q(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t<o){n=i;break}t-=o}return n.lines[t]}function ee(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(e){var o=e.text;i==n.line&&(o=o.slice(0,n.ch)),i==t.line&&(o=o.slice(t.ch)),r.push(o),++i}),r}function te(e,t,n){var r=[];return e.iter(t,n,function(e){r.push(e.text)}),r}function ne(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function re(e){if(null==e.parent)return null;for(var t=e.parent,n=h(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function ie(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],o=i.height;if(t<o){e=i;continue e}t-=o,n+=i.chunkSize()}return n}while(!e.lines);for(var s=0;s<e.lines.length;++s){var a=e.lines[s],l=a.height;if(t<l)break;t-=l}return n+s}function oe(e,t){return t>=e.first&&t<e.first+e.size}function se(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function ae(e,t,n){return void 0===n&&(n=null),this instanceof ae?(this.line=e,this.ch=t,void(this.sticky=n)):new ae(e,t,n)}function le(e,t){return e.line-t.line||e.ch-t.ch}function ce(e,t){return e.sticky==t.sticky&&0==le(e,t)}function ue(e){return ae(e.line,e.ch)}function de(e,t){return le(e,t)<0?t:e}function he(e,t){return le(e,t)<0?e:t}function fe(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function pe(e,t){if(t.line<e.first)return ae(e.first,0);var n=e.first+e.size-1;return t.line>n?ae(n,Q(e,n).text.length):ge(t,Q(e,t.line).text.length)}function ge(e,t){var n=e.ch;return null==n||n>t?ae(e.line,t):n<0?ae(e.line,0):e}function me(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=pe(e,t[r]);return n}function ve(e,t,n,r){var i=[e.state.modeGen],o={};ke(e,t.text,e.doc.mode,n,function(e,t){return i.push(e,t)},o,r);for(var s=n.state,a=function(r){n.baseTokens=i;var a=e.state.overlays[r],l=1,c=0;n.state=!0,ke(e,t.text,a.mode,n,function(e,t){for(var n=l;c<e;){var r=i[l];r>e&&i.splice(l,1,e,i[l+1],r),l+=2,c=Math.min(e,r)}if(t)if(a.opaque)i.splice(n,l-n,e,"overlay "+t),l=n+2;else for(;n<l;n+=2){var o=i[n+1];i[n+1]=(o?o+" ":"")+"overlay "+t}},o),n.state=s,n.baseTokens=null,n.baseTokenPos=1},l=0;l<e.state.overlays.length;++l)a(l);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function be(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=ye(e,re(t)),i=t.text.length>e.options.maxHighlightLength&&X(e.doc.mode,r.state),o=ve(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function ye(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new pa(r,(!0),t);var o=Se(e,t,n),s=o>r.first&&Q(r,o-1).stateAfter,a=s?pa.fromSaved(r,s,o):new pa(r,Z(r.mode),o);return r.iter(o,t,function(n){we(e,n.text,a);var r=a.line;n.stateAfter=r==t-1||r%5==0||r>=i.viewFrom&&r<i.viewTo?a.save():null,a.nextLine()}),n&&(r.modeFrontier=a.line),a}function we(e,t,n,r){var i=e.doc.mode,o=new ha(t,e.options.tabSize,n);for(o.start=o.pos=r||0,""==t&&xe(i,n.state);!o.eol();)Ce(i,o,n.state),o.start=o.pos}function xe(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=J(e,t);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function Ce(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=J(e,n).mode);var o=e.token(t,n);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}function je(e,t,n,r){var i,o=e.doc,s=o.mode;t=pe(o,t);var a,l=Q(o,t.line),c=ye(e,t.line,n),u=new ha(l.text,e.options.tabSize,c);for(r&&(a=[]);(r||u.pos<t.ch)&&!u.eol();)u.start=u.pos,i=Ce(s,u,c.state),r&&a.push(new ga(u,i,X(o.mode,c.state)));return r?a:new ga(u,i,c.state)}function Oe(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";null==t[r]?t[r]=n[2]:new RegExp("(?:^|s)"+n[2]+"(?:$|s)").test(t[r])||(t[r]+=" "+n[2])}return e}function ke(e,t,n,r,i,o,s){var a=n.flattenSpans;null==a&&(a=e.options.flattenSpans);var l,c=0,u=null,d=new ha(t,e.options.tabSize,r),h=e.options.addModeClass&&[null];for(""==t&&Oe(xe(n,r.state),o);!d.eol();){if(d.pos>e.options.maxHighlightLength?(a=!1,s&&we(e,t,r,d.pos),d.pos=t.length,l=null):l=Oe(Ce(n,d,r.state,h),o),h){var f=h[0].name;f&&(l="m-"+(l?f+" "+l:f))}if(!a||u!=l){for(;c<d.start;)c=Math.min(d.start,c+5e3),i(c,u);u=l}d.start=d.pos}for(;c<d.pos;){var p=Math.min(d.pos,c+5e3);i(p,u),c=p}}function Se(e,t,n){for(var r,i,o=e.doc,s=n?-1:t-(e.doc.mode.innerMode?1e3:100),a=t;a>s;--a){if(a<=o.first)return o.first;var l=Q(o,a-1),c=l.stateAfter;if(c&&(!n||a+(c instanceof fa?c.lookAhead:0)<=o.modeFrontier))return a;var u=d(l.text,null,e.options.tabSize);(null==i||r>u)&&(i=a-1,r=u)}return i}function Te(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,r=t-1;r>n;r--){var i=Q(e,r).stateAfter;if(i&&(!(i instanceof fa)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}function Pe(){ma=!0}function Ee(){va=!0}function _e(e,t,n){this.marker=e,this.from=t,this.to=n}function De(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function Me(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function Ae(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Le(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],s=o.marker,a=null==o.from||(s.inclusiveLeft?o.from<=t:o.from<t);if(a||o.from==t&&"bookmark"==s.type&&(!n||!o.marker.insertLeft)){var l=null==o.to||(s.inclusiveRight?o.to>=t:o.to>t);(r||(r=[])).push(new _e(s,o.from,l?null:o.to))}}return r}function Ne(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],s=o.marker,a=null==o.to||(s.inclusiveRight?o.to>=t:o.to>t);if(a||o.from==t&&"bookmark"==s.type&&(!n||o.marker.insertLeft)){var l=null==o.from||(s.inclusiveLeft?o.from<=t:o.from<t);(r||(r=[])).push(new _e(s,l?null:o.from-t,null==o.to?null:o.to-t))}}return r}function Ve(e,t){if(t.full)return null;var n=oe(e,t.from.line)&&Q(e,t.from.line).markedSpans,r=oe(e,t.to.line)&&Q(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,o=t.to.ch,s=0==le(t.from,t.to),a=Le(n,i,s),l=Ne(r,o,s),c=1==t.text.length,u=g(t.text).length+(c?i:0);if(a)for(var d=0;d<a.length;++d){var h=a[d];if(null==h.to){var f=De(l,h.marker);f?c&&(h.to=null==f.to?null:f.to+u):h.to=i}}if(l)for(var p=0;p<l.length;++p){var m=l[p];if(null!=m.to&&(m.to+=u),null==m.from){var v=De(a,m.marker);v||(m.from=u,c&&(a||(a=[])).push(m))}else m.from+=u,c&&(a||(a=[])).push(m)}a&&(a=Ie(a)),l&&l!=a&&(l=Ie(l));var b=[a];if(!c){var y,w=t.text.length-2;if(w>0&&a)for(var x=0;x<a.length;++x)null==a[x].to&&(y||(y=[])).push(new _e(a[x].marker,null,null));for(var C=0;C<w;++C)b.push(y);b.push(l)}return b}function Ie(e){for(var t=0;t<e.length;++t){var n=e[t];null!=n.from&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function Fe(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var n=e.markedSpans[t].marker;!n.readOnly||r&&h(r,n)!=-1||(r||(r=[])).push(n)}}),!r)return null;for(var i=[{from:t,to:n}],o=0;o<r.length;++o)for(var s=r[o],a=s.find(0),l=0;l<i.length;++l){var c=i[l];if(!(le(c.to,a.from)<0||le(c.from,a.to)>0)){var u=[l,1],d=le(c.from,a.from),f=le(c.to,a.to);(d<0||!s.inclusiveLeft&&!d)&&u.push({from:c.from,to:a.from}),(f>0||!s.inclusiveRight&&!f)&&u.push({from:a.to,to:c.to}),i.splice.apply(i,u),l+=u.length-3}}return i}function Re(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function He(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function ze(e){return e.inclusiveLeft?-1:0}function Be(e){return e.inclusiveRight?1:0}function $e(e,t){var n=e.lines.length-t.lines.length;if(0!=n)return n;var r=e.find(),i=t.find(),o=le(r.from,i.from)||ze(e)-ze(t);if(o)return-o;var s=le(r.to,i.to)||Be(e)-Be(t);return s?s:t.id-e.id}function We(e,t){var n,r=va&&e.markedSpans;if(r)for(var i=void 0,o=0;o<r.length;++o)i=r[o],i.marker.collapsed&&null==(t?i.from:i.to)&&(!n||$e(n,i.marker)<0)&&(n=i.marker);
|
||
return n}function Ue(e){return We(e,!0)}function qe(e){return We(e,!1)}function Ge(e,t){var n,r=va&&e.markedSpans;if(r)for(var i=0;i<r.length;++i){var o=r[i];o.marker.collapsed&&(null==o.from||o.from<t)&&(null==o.to||o.to>t)&&(!n||$e(n,o.marker)<0)&&(n=o.marker)}return n}function Ke(e,t,n,r,i){var o=Q(e,t),s=va&&o.markedSpans;if(s)for(var a=0;a<s.length;++a){var l=s[a];if(l.marker.collapsed){var c=l.marker.find(0),u=le(c.from,n)||ze(l.marker)-ze(i),d=le(c.to,r)||Be(l.marker)-Be(i);if(!(u>=0&&d<=0||u<=0&&d>=0)&&(u<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?le(c.to,n)>=0:le(c.to,n)>0)||u>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?le(c.from,r)<=0:le(c.from,r)<0)))return!0}}}function Ye(e){for(var t;t=Ue(e);)e=t.find(-1,!0).line;return e}function Xe(e){for(var t;t=qe(e);)e=t.find(1,!0).line;return e}function Je(e){for(var t,n;t=qe(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function Ze(e,t){var n=Q(e,t),r=Ye(n);return n==r?t:re(r)}function Qe(e,t){if(t>e.lastLine())return t;var n,r=Q(e,t);if(!et(e,r))return t;for(;n=qe(r);)r=n.find(1,!0).line;return re(r)+1}function et(e,t){var n=va&&t.markedSpans;if(n)for(var r=void 0,i=0;i<n.length;++i)if(r=n[i],r.marker.collapsed){if(null==r.from)return!0;if(!r.marker.widgetNode&&0==r.from&&r.marker.inclusiveLeft&&tt(e,t,r))return!0}}function tt(e,t,n){if(null==n.to){var r=n.marker.find(1,!0);return tt(e,r.line,De(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if(i=t.markedSpans[o],i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(null==i.to||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&tt(e,t,i))return!0}function nt(e){e=Ye(e);for(var t=0,n=e.parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var o=n.parent;o;n=o,o=n.parent)for(var s=0;s<o.children.length;++s){var a=o.children[s];if(a==n)break;t+=a.height}return t}function rt(e){if(0==e.height)return 0;for(var t,n=e.text.length,r=e;t=Ue(r);){var i=t.find(0,!0);r=i.from.line,n+=i.from.ch-i.to.ch}for(r=e;t=qe(r);){var o=t.find(0,!0);n-=r.text.length-o.from.ch,r=o.to.line,n+=r.text.length-o.to.ch}return n}function it(e){var t=e.display,n=e.doc;t.maxLine=Q(n,n.first),t.maxLineLength=rt(t.maxLine),t.maxLineChanged=!0,n.iter(function(e){var n=rt(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)})}function ot(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Re(e),He(e,n);var i=r?r(e):1;i!=e.height&&ne(e,i)}function st(e){e.parent=null,Re(e)}function at(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?xa:wa;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function lt(e,t){var n=i("span",null,null,Os?"padding-right: .1px":null),r={pre:i("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var o=0;o<=(t.rest?t.rest.length:0);o++){var s=o?t.rest[o-1]:t.line,a=void 0;r.pos=0,r.addToken=ut,$(e.display.measure)&&(a=P(s,e.doc.direction))&&(r.addToken=ht(r.addToken,a)),r.map=[];var c=t!=e.display.externalMeasured&&re(s);pt(s,r,be(e,s,c)),s.styleClasses&&(s.styleClasses.bgClass&&(r.bgClass=l(s.styleClasses.bgClass,r.bgClass||"")),s.styleClasses.textClass&&(r.textClass=l(s.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(B(e.display.measure))),0==o?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(Os){var u=r.content.lastChild;(/\bcm-tab\b/.test(u.className)||u.querySelector&&u.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return D(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=l(r.pre.className,r.textClass||"")),r}function ct(e){var t=r("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function ut(e,t,n,i,o,s,a){if(t){var l,c=e.splitSpaces?dt(t,e.trailingSpace):t,u=e.cm.state.specialChars,d=!1;if(u.test(t)){l=document.createDocumentFragment();for(var h=0;;){u.lastIndex=h;var f=u.exec(t),g=f?f.index-h:t.length-h;if(g){var m=document.createTextNode(c.slice(h,h+g));Cs&&js<9?l.appendChild(r("span",[m])):l.appendChild(m),e.map.push(e.pos,e.pos+g,m),e.col+=g,e.pos+=g}if(!f)break;h+=g+1;var v=void 0;if("\t"==f[0]){var b=e.cm.options.tabSize,y=b-e.col%b;v=l.appendChild(r("span",p(y),"cm-tab")),v.setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),e.col+=y}else"\r"==f[0]||"\n"==f[0]?(v=l.appendChild(r("span","\r"==f[0]?"␍":"","cm-invalidchar")),v.setAttribute("cm-text",f[0]),e.col+=1):(v=e.cm.options.specialCharPlaceholder(f[0]),v.setAttribute("cm-text",f[0]),Cs&&js<9?l.appendChild(r("span",[v])):l.appendChild(v),e.col+=1);e.map.push(e.pos,e.pos+1,v),e.pos++}}else e.col+=t.length,l=document.createTextNode(c),e.map.push(e.pos,e.pos+t.length,l),Cs&&js<9&&(d=!0),e.pos+=t.length;if(e.trailingSpace=32==c.charCodeAt(t.length-1),n||i||o||d||s){var w=n||"";i&&(w+=i),o&&(w+=o);var x=r("span",[l],w,s);if(a)for(var C in a)a.hasOwnProperty(C)&&"style"!=C&&"class"!=C&&x.setAttribute(C,a[C]);return e.content.appendChild(x)}e.content.appendChild(l)}}function dt(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;i<e.length;i++){var o=e.charAt(i);" "!=o||!n||i!=e.length-1&&32!=e.charCodeAt(i+1)||(o=" "),r+=o,n=" "==o}return r}function ht(e,t){return function(n,r,i,o,s,a,l){i=i?i+" cm-force-border":"cm-force-border";for(var c=n.pos,u=c+r.length;;){for(var d=void 0,h=0;h<t.length&&(d=t[h],!(d.to>c&&d.from<=c));h++);if(d.to>=u)return e(n,r,i,o,s,a,l);e(n,r.slice(0,d.to-c),i,o,null,a,l),o=null,r=r.slice(d.to-c),c=d.to}}}function ft(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function pt(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var s,a,l,c,u,d,h,f=i.length,p=0,g=1,m="",v=0;;){if(v==p){l=c=u=a="",h=null,d=null,v=1/0;for(var b=[],y=void 0,w=0;w<r.length;++w){var x=r[w],C=x.marker;if("bookmark"==C.type&&x.from==p&&C.widgetNode)b.push(C);else if(x.from<=p&&(null==x.to||x.to>p||C.collapsed&&x.to==p&&x.from==p)){if(null!=x.to&&x.to!=p&&v>x.to&&(v=x.to,c=""),C.className&&(l+=" "+C.className),C.css&&(a=(a?a+";":"")+C.css),C.startStyle&&x.from==p&&(u+=" "+C.startStyle),C.endStyle&&x.to==v&&(y||(y=[])).push(C.endStyle,x.to),C.title&&((h||(h={})).title=C.title),C.attributes)for(var j in C.attributes)(h||(h={}))[j]=C.attributes[j];C.collapsed&&(!d||$e(d.marker,C)<0)&&(d=x)}else x.from>p&&v>x.from&&(v=x.from)}if(y)for(var O=0;O<y.length;O+=2)y[O+1]==v&&(c+=" "+y[O]);if(!d||d.from==p)for(var k=0;k<b.length;++k)ft(t,0,b[k]);if(d&&(d.from||0)==p){if(ft(t,(null==d.to?f+1:d.to)-p,d.marker,null==d.from),null==d.to)return;d.to==p&&(d=!1)}}if(p>=f)break;for(var S=Math.min(f,v);;){if(m){var T=p+m.length;if(!d){var P=T>S?m.slice(0,S-p):m;t.addToken(t,P,s?s+l:l,u,p+P.length==v?c:"",a,h)}if(T>=S){m=m.slice(S-p),p=S;break}p=T,u=""}m=i.slice(o,o=n[g++]),s=at(n[g++],t.cm.options)}}else for(var E=1;E<n.length;E+=2)t.addToken(t,i.slice(o,o=n[E]),at(n[E+1],t.cm.options))}function gt(e,t,n){this.line=t,this.rest=Je(t),this.size=this.rest?re(g(this.rest))-n+1:1,this.node=this.text=null,this.hidden=et(e,t)}function mt(e,t,n){for(var r,i=[],o=t;o<n;o=r){var s=new gt(e.doc,Q(e.doc,o),o);r=o+s.size,i.push(s)}return i}function vt(e){Ca?Ca.ops.push(e):e.ownsGroup=Ca={ops:[e],delayedCallbacks:[]}}function bt(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}function yt(e,t){var n=e.ownsGroup;if(n)try{bt(n)}finally{Ca=null,t(n)}}function wt(e,t){var n=E(e,t);if(n.length){var r,i=Array.prototype.slice.call(arguments,2);Ca?r=Ca.delayedCallbacks:ja?r=ja:(r=ja=[],setTimeout(xt,0));for(var o=function(e){r.push(function(){return n[e].apply(null,i)})},s=0;s<n.length;++s)o(s)}}function xt(){var e=ja;ja=null;for(var t=0;t<e.length;++t)e[t]()}function Ct(e,t,n,r){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?St(e,t):"gutter"==o?Pt(e,t,n,r):"class"==o?Tt(e,t):"widget"==o&&Et(e,t,r)}t.changes=null}function jt(e){return e.node==e.text&&(e.node=r("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),Cs&&js<8&&(e.node.style.zIndex=2)),e.node}function Ot(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var i=jt(t);t.background=i.insertBefore(r("div",null,n),i.firstChild),e.display.input.setUneditable(t.background)}}function kt(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):lt(e,t)}function St(e,t){var n=t.text.className,r=kt(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,Tt(e,t)):n&&(t.text.className=n)}function Tt(e,t){Ot(e,t),t.line.wrapClass?jt(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function Pt(e,t,n,i){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var o=jt(t);t.gutterBackground=r("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px; width: "+i.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),o.insertBefore(t.gutterBackground,t.text)}var s=t.line.gutterMarkers;if(e.options.lineNumbers||s){var a=jt(t),l=t.gutter=r("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px");if(e.display.input.setUneditable(l),a.insertBefore(l,t.text),t.line.gutterClass&&(l.className+=" "+t.line.gutterClass),!e.options.lineNumbers||s&&s["CodeMirror-linenumbers"]||(t.lineNumber=l.appendChild(r("div",se(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+i.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),s)for(var c=0;c<e.display.gutterSpecs.length;++c){var u=e.display.gutterSpecs[c].className,d=s.hasOwnProperty(u)&&s[u];d&&l.appendChild(r("div",[d],"CodeMirror-gutter-elt","left: "+i.gutterLeft[u]+"px; width: "+i.gutterWidth[u]+"px"))}}}function Et(e,t,n){t.alignable&&(t.alignable=null);for(var r=t.node.firstChild,i=void 0;r;r=i)i=r.nextSibling,"CodeMirror-linewidget"==r.className&&t.node.removeChild(r);Dt(e,t,n)}function _t(e,t,n,r){var i=kt(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),Tt(e,t),Pt(e,t,n,r),Dt(e,t,r),t.node}function Dt(e,t,n){if(Mt(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)Mt(e,t.rest[r],t,n,!1)}function Mt(e,t,n,i,o){if(t.widgets)for(var s=jt(n),a=0,l=t.widgets;a<l.length;++a){var c=l[a],u=r("div",[c.node],"CodeMirror-linewidget");c.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),At(c,u,n,i),e.display.input.setUneditable(u),o&&c.above?s.insertBefore(u,n.gutter||n.text):s.appendChild(u),wt(c,"redraw")}}function At(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function Lt(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!o(document.body,e.node)){var i="position: relative;";e.coverGutter&&(i+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(i+="width: "+t.display.wrapper.clientWidth+"px;"),n(t.display.measure,r("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function Nt(e,t){for(var n=H(t);n!=e.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==e.sizer&&n!=e.mover)return!0}function Vt(e){return e.lineSpace.offsetTop}function It(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Ft(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=n(e.measure,r("pre","x","CodeMirror-line-like")),i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,o={left:parseInt(i.paddingLeft),right:parseInt(i.paddingRight)};return isNaN(o.left)||isNaN(o.right)||(e.cachedPaddingH=o),o}function Rt(e){return qs-e.display.nativeBarWidth}function Ht(e){return e.display.scroller.clientWidth-Rt(e)-e.display.barWidth}function zt(e){return e.display.scroller.clientHeight-Rt(e)-e.display.barHeight}function Bt(e,t,n){var r=e.options.lineWrapping,i=r&&Ht(e);if(!t.measure.heights||r&&t.measure.width!=i){var o=t.measure.heights=[];if(r){t.measure.width=i;for(var s=t.text.firstChild.getClientRects(),a=0;a<s.length-1;a++){var l=s[a],c=s[a+1];Math.abs(l.bottom-c.bottom)>2&&o.push((l.bottom+c.top)/2-n.top)}}o.push(n.bottom-n.top)}}function $t(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var i=0;i<e.rest.length;i++)if(re(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Wt(e,t){t=Ye(t);var r=re(t),i=e.display.externalMeasured=new gt(e.doc,t,r);i.lineN=r;var o=i.built=lt(e,i);return i.text=o.pre,n(e.display.lineMeasure,o.pre),i}function Ut(e,t,n,r){return Kt(e,Gt(e,t),n,r)}function qt(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Sn(e,t)];var n=e.display.externalMeasured;return n&&t>=n.lineN&&t<n.lineN+n.size?n:void 0}function Gt(e,t){var n=re(t),r=qt(e,n);r&&!r.text?r=null:r&&r.changes&&(Ct(e,r,n,xn(e)),e.curOp.forceUpdate=!0),r||(r=Wt(e,t));var i=$t(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Kt(e,t,n,r,i){t.before&&(n=-1);var o,s=n+(r||"");return t.cache.hasOwnProperty(s)?o=t.cache[s]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Bt(e,t.view,t.rect),t.hasHeights=!0),o=Jt(e,t,n,r),o.bogus||(t.cache[s]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}function Yt(e,t,n){for(var r,i,o,s,a,l,c=0;c<e.length;c+=3)if(a=e[c],l=e[c+1],t<a?(i=0,o=1,s="left"):t<l?(i=t-a,o=i+1):(c==e.length-3||t==l&&e[c+3]>t)&&(o=l-a,i=o-1,t>=l&&(s="right")),null!=i){if(r=e[c+2],a==l&&n==(r.insertLeft?"left":"right")&&(s=n),"left"==n&&0==i)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)r=e[(c-=3)+2],s="left";if("right"==n&&i==l-a)for(;c<e.length-3&&e[c+3]==e[c+4]&&!e[c+5].insertLeft;)r=e[(c+=3)+2],s="right";break}return{node:r,start:i,end:o,collapse:s,coverStart:a,coverEnd:l}}function Xt(e,t){var n=Oa;if("left"==t)for(var r=0;r<e.length&&(n=e[r]).left==n.right;r++);else for(var i=e.length-1;i>=0&&(n=e[i]).left==n.right;i--);return n}function Jt(e,t,n,r){var i,o=Yt(t.map,n,r),s=o.node,a=o.start,l=o.end,c=o.collapse;if(3==s.nodeType){for(var u=0;u<4;u++){for(;a&&j(t.line.text.charAt(o.coverStart+a));)--a;for(;o.coverStart+l<o.coverEnd&&j(t.line.text.charAt(o.coverStart+l));)++l;if(i=Cs&&js<9&&0==a&&l==o.coverEnd-o.coverStart?s.parentNode.getBoundingClientRect():Xt(Fs(s,a,l).getClientRects(),r),i.left||i.right||0==a)break;l=a,a-=1,c="right"}Cs&&js<11&&(i=Zt(e.display.measure,i))}else{a>0&&(c=r="right");var d;i=e.options.lineWrapping&&(d=s.getClientRects()).length>1?d["right"==r?d.length-1:0]:s.getBoundingClientRect()}if(Cs&&js<9&&!a&&(!i||!i.left&&!i.right)){var h=s.parentNode.getClientRects()[0];i=h?{left:h.left,right:h.left+wn(e.display),top:h.top,bottom:h.bottom}:Oa}for(var f=i.top-t.rect.top,p=i.bottom-t.rect.top,g=(f+p)/2,m=t.view.measure.heights,v=0;v<m.length-1&&!(g<m[v]);v++);var b=v?m[v-1]:0,y=m[v],w={left:("right"==c?i.right:i.left)-t.rect.left,right:("left"==c?i.left:i.right)-t.rect.left,top:b,bottom:y};return i.left||i.right||(w.bogus=!0),e.options.singleCursorHeightPerLine||(w.rtop=f,w.rbottom=p),w}function Zt(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!W(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function Qt(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function en(e){e.display.externalMeasure=null,t(e.display.lineMeasure);for(var n=0;n<e.display.view.length;n++)Qt(e.display.view[n])}function tn(e){en(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function nn(){return Ss&&Ms?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function rn(){return Ss&&Ms?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function on(e){var t=0;if(e.widgets)for(var n=0;n<e.widgets.length;++n)e.widgets[n].above&&(t+=Lt(e.widgets[n]));return t}function sn(e,t,n,r,i){if(!i){var o=on(t);n.top+=o,n.bottom+=o}if("line"==r)return n;r||(r="local");var s=nt(t);if("local"==r?s+=Vt(e.display):s-=e.display.viewOffset,"page"==r||"window"==r){var a=e.display.lineSpace.getBoundingClientRect();s+=a.top+("window"==r?0:rn());var l=a.left+("window"==r?0:nn());n.left+=l,n.right+=l}return n.top+=s,n.bottom+=s,n}function an(e,t,n){if("div"==n)return t;var r=t.left,i=t.top;if("page"==n)r-=nn(),i-=rn();else if("local"==n||!n){var o=e.display.sizer.getBoundingClientRect();r+=o.left,i+=o.top}var s=e.display.lineSpace.getBoundingClientRect();return{left:r-s.left,top:i-s.top}}function ln(e,t,n,r,i){return r||(r=Q(e.doc,t.line)),sn(e,r,Ut(e,r,t.ch,i),n)}function cn(e,t,n,r,i,o){function s(t,s){var a=Kt(e,i,t,s?"right":"left",o);return s?a.left=a.right:a.right=a.left,sn(e,r,a,n)}function a(e,t,n){var r=l[t],i=1==r.level;return s(n?e-1:e,i!=n)}r=r||Q(e.doc,t.line),i||(i=Gt(e,r));var l=P(r,e.doc.direction),c=t.ch,u=t.sticky;if(c>=r.text.length?(c=r.text.length,u="before"):c<=0&&(c=0,u="after"),!l)return s("before"==u?c-1:c,"before"==u);var d=T(l,c,u),h=ea,f=a(c,d,"before"==u);return null!=h&&(f.other=a(c,h,"before"!=u)),f}function un(e,t){var n=0;t=pe(e.doc,t),e.options.lineWrapping||(n=wn(e.display)*t.ch);var r=Q(e.doc,t.line),i=nt(r)+Vt(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function dn(e,t,n,r,i){var o=ae(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function hn(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return dn(r.first,0,null,-1,-1);var i=ie(r,n),o=r.first+r.size-1;if(i>o)return dn(r.first+r.size-1,Q(r,o).text.length,null,1,1);t<0&&(t=0);for(var s=Q(r,i);;){var a=mn(e,s,i,t,n),l=Ge(s,a.ch+(a.xRel>0||a.outside>0?1:0));if(!l)return a;var c=l.find(1);if(c.line==i)return c;s=Q(r,i=c.line)}}function fn(e,t,n,r){r-=on(t);var i=t.text.length,o=k(function(t){return Kt(e,n,t-1).bottom<=r},i,0);return i=k(function(t){return Kt(e,n,t).top>r},o,i),{begin:o,end:i}}function pn(e,t,n,r){n||(n=Gt(e,t));var i=sn(e,t,Kt(e,n,r),"line").top;return fn(e,t,n,i)}function gn(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function mn(e,t,n,r,i){i-=nt(t);var o=Gt(e,t),s=on(t),a=0,l=t.text.length,c=!0,u=P(t,e.doc.direction);if(u){var d=(e.options.lineWrapping?bn:vn)(e,t,n,o,u,r,i);c=1!=d.level,a=c?d.from:d.to-1,l=c?d.to:d.from-1}var h,f,p=null,g=null,m=k(function(t){var n=Kt(e,o,t);return n.top+=s,n.bottom+=s,!!gn(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(p=t,g=n),!0)},a,l),v=!1;if(g){var b=r-g.left<g.right-r,y=b==c;m=p+(y?0:1),f=y?"after":"before",h=b?g.left:g.right}else{c||m!=l&&m!=a||m++,f=0==m?"after":m==t.text.length?"before":Kt(e,o,m-(c?1:0)).bottom+s<=i==c?"after":"before";var w=cn(e,ae(n,m,f),"line",t,o);h=w.left,v=i<w.top?-1:i>=w.bottom?1:0}return m=O(t.text,m,1),dn(n,m,f,v,r-h)}function vn(e,t,n,r,i,o,s){var a=k(function(a){var l=i[a],c=1!=l.level;return gn(cn(e,ae(n,c?l.to:l.from,c?"before":"after"),"line",t,r),o,s,!0)},0,i.length-1),l=i[a];if(a>0){var c=1!=l.level,u=cn(e,ae(n,c?l.from:l.to,c?"after":"before"),"line",t,r);gn(u,o,s,!0)&&u.top>s&&(l=i[a-1])}return l}function bn(e,t,n,r,i,o,s){var a=fn(e,t,r,s),l=a.begin,c=a.end;/\s/.test(t.text.charAt(c-1))&&c--;for(var u=null,d=null,h=0;h<i.length;h++){var f=i[h];if(!(f.from>=c||f.to<=l)){var p=1!=f.level,g=Kt(e,r,p?Math.min(c,f.to)-1:Math.max(l,f.from)).right,m=g<o?o-g+1e9:g-o;(!u||d>m)&&(u=f,d=m)}}return u||(u=i[i.length-1]),u.from<l&&(u={from:l,to:u.to,level:u.level}),u.to>c&&(u={from:u.from,to:c,level:u.level}),u}function yn(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==ya){ya=r("pre",null,"CodeMirror-line-like");for(var i=0;i<49;++i)ya.appendChild(document.createTextNode("x")),ya.appendChild(r("br"));ya.appendChild(document.createTextNode("x"))}n(e.measure,ya);var o=ya.offsetHeight/50;return o>3&&(e.cachedTextHeight=o),t(e.measure),o||1}function wn(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=r("span","xxxxxxxxxx"),i=r("pre",[t],"CodeMirror-line-like");n(e.measure,i);var o=t.getBoundingClientRect(),s=(o.right-o.left)/10;return s>2&&(e.cachedCharWidth=s),s||10}function xn(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,s=0;o;o=o.nextSibling,++s){var a=e.display.gutterSpecs[s].className;n[a]=o.offsetLeft+o.clientLeft+i,r[a]=o.clientWidth}return{fixedPos:Cn(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Cn(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function jn(e){var t=yn(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/wn(e.display)-3);return function(i){if(et(e.doc,i))return 0;var o=0;if(i.widgets)for(var s=0;s<i.widgets.length;s++)i.widgets[s].height&&(o+=i.widgets[s].height);return n?o+(Math.ceil(i.text.length/r)||1)*t:o+t}}function On(e){var t=e.doc,n=jn(e);t.iter(function(e){var t=n(e);t!=e.height&&ne(e,t)})}function kn(e,t,n,r){var i=e.display;if(!n&&"true"==H(t).getAttribute("cm-not-content"))return null;var o,s,a=i.lineSpace.getBoundingClientRect();try{o=t.clientX-a.left,s=t.clientY-a.top}catch(t){return null}var l,c=hn(e,o,s);if(r&&1==c.xRel&&(l=Q(e.doc,c.line).text).length==c.ch){var u=d(l,l.length,e.options.tabSize)-l.length;c=ae(c.line,Math.max(0,Math.round((o-Ft(e.display).left)/wn(e.display))-u))}return c}function Sn(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var n=e.display.view,r=0;r<n.length;r++)if(t-=n[r].size,t<0)return r}function Tn(e,t,n,r){null==t&&(t=e.doc.first),null==n&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;if(r&&n<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)va&&Ze(e.doc,t)<i.viewTo&&En(e);else if(n<=i.viewFrom)va&&Qe(e.doc,n+r)>i.viewFrom?En(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)En(e);else if(t<=i.viewFrom){var o=_n(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):En(e)}else if(n>=i.viewTo){var s=_n(e,t,t,-1);s?(i.view=i.view.slice(0,s.index),i.viewTo=s.lineN):En(e)}else{var a=_n(e,t,t,-1),l=_n(e,n,n+r,1);a&&l?(i.view=i.view.slice(0,a.index).concat(mt(e,a.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=r):En(e)}var c=i.externalMeasured;c&&(n<c.lineN?c.lineN+=r:t<c.lineN+c.size&&(i.externalMeasured=null))}function Pn(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var o=r.view[Sn(e,t)];if(null!=o.node){var s=o.changes||(o.changes=[]);h(s,n)==-1&&s.push(n)}}}function En(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function _n(e,t,n,r){var i,o=Sn(e,t),s=e.display.view;if(!va||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var a=e.display.viewFrom,l=0;l<o;l++)a+=s[l].size;if(a!=t){if(r>0){if(o==s.length-1)return null;i=a+s[o].size-t,o++}else i=a-t;t+=i,n+=i}for(;Ze(e.doc,n)!=n;){if(o==(r<0?0:s.length-1))return null;n+=r*s[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function Dn(e,t,n){var r=e.display,i=r.view;0==i.length||t>=r.viewTo||n<=r.viewFrom?(r.view=mt(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=mt(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(Sn(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(mt(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,Sn(e,n)))),r.viewTo=n}function Mn(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];i.hidden||i.node&&!i.changes||++n}return n}function An(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Ln(e,t){void 0===t&&(t=!0);for(var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),s=0;s<n.sel.ranges.length;s++)if(t||s!=n.sel.primIndex){var a=n.sel.ranges[s];if(!(a.from().line>=e.display.viewTo||a.to().line<e.display.viewFrom)){var l=a.empty();(l||e.options.showCursorWhenSelecting)&&Nn(e,a.head,i),l||In(e,a,o)}}return r}function Nn(e,t,n){var i=cn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),o=n.appendChild(r("div"," ","CodeMirror-cursor"));if(o.style.left=i.left+"px",o.style.top=i.top+"px",o.style.height=Math.max(0,i.bottom-i.top)*e.options.cursorHeight+"px",i.other){var s=n.appendChild(r("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));s.style.display="",s.style.left=i.other.left+"px",s.style.top=i.other.top+"px",s.style.height=.85*(i.other.bottom-i.other.top)+"px"}}function Vn(e,t){return e.top-t.top||e.left-t.left}function In(e,t,n){function i(e,t,n,i){t<0&&(t=0),t=Math.round(t),i=Math.round(i),l.appendChild(r("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==n?d-e:n)+"px;\n height: "+(i-t)+"px"))}function o(t,n,r){function o(n,r){return ln(e,ae(t,n),"div",f,r)}function s(t,n,r){var i=pn(e,f,null,t),s="ltr"==n==("after"==r)?"left":"right",a="after"==r?i.begin:i.end-(/\s/.test(f.text.charAt(i.end-1))?2:1);return o(a,s)[s]}var l,c,f=Q(a,t),p=f.text.length,g=P(f,a.direction);return S(g,n||0,null==r?p:r,function(e,t,a,f){var m="ltr"==a,v=o(e,m?"left":"right"),b=o(t-1,m?"right":"left"),y=null==n&&0==e,w=null==r&&t==p,x=0==f,C=!g||f==g.length-1;if(b.top-v.top<=3){var j=(h?y:w)&&x,O=(h?w:y)&&C,k=j?u:(m?v:b).left,S=O?d:(m?b:v).right;i(k,v.top,S-k,v.bottom)}else{var T,P,E,_;m?(T=h&&y&&x?u:v.left,P=h?d:s(e,a,"before"),E=h?u:s(t,a,"after"),_=h&&w&&C?d:b.right):(T=h?s(e,a,"before"):u,P=!h&&y&&x?d:v.right,E=!h&&w&&C?u:b.left,_=h?s(t,a,"after"):d),i(T,v.top,P-T,v.bottom),v.bottom<b.top&&i(u,v.bottom,null,b.top),i(E,b.top,_-E,b.bottom)}(!l||Vn(v,l)<0)&&(l=v),Vn(b,l)<0&&(l=b),(!c||Vn(v,c)<0)&&(c=v),Vn(b,c)<0&&(c=b)}),{start:l,end:c}}var s=e.display,a=e.doc,l=document.createDocumentFragment(),c=Ft(e.display),u=c.left,d=Math.max(s.sizerWidth,Ht(e)-s.sizer.offsetLeft)-c.right,h="ltr"==a.direction,f=t.from(),p=t.to();if(f.line==p.line)o(f.line,f.ch,p.ch);else{var g=Q(a,f.line),m=Q(a,p.line),v=Ye(g)==Ye(m),b=o(f.line,f.ch,v?g.text.length+1:null).end,y=o(p.line,v?0:null,p.ch).start;v&&(b.top<y.top-2?(i(b.right,b.top,null,b.bottom),i(u,y.top,y.left,y.bottom)):i(b.right,b.top,y.left-b.right,b.bottom)),b.bottom<y.top&&i(u,b.bottom,null,y.top)}n.appendChild(l)}function Fn(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){return t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Rn(e){e.state.focused||(e.display.input.focus(),zn(e))}function Hn(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Bn(e))},100)}function zn(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(D(e,"focus",e,t),e.state.focused=!0,a(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),Os&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Fn(e))}function Bn(e,t){e.state.delayingBlurEvent||(e.state.focused&&(D(e,"blur",e,t),e.state.focused=!1,zs(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function $n(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var i=t.view[r],o=e.options.lineWrapping,s=void 0,a=0;if(!i.hidden){if(Cs&&js<8){var l=i.node.offsetTop+i.node.offsetHeight;s=l-n,n=l}else{var c=i.node.getBoundingClientRect();s=c.bottom-c.top,!o&&i.text.firstChild&&(a=i.text.firstChild.getBoundingClientRect().right-c.left-1)}var u=i.line.height-s;if((u>.005||u<-.005)&&(ne(i.line,s),Wn(i.line),i.rest))for(var d=0;d<i.rest.length;d++)Wn(i.rest[d]);if(a>e.display.sizerWidth){var h=Math.ceil(a/wn(e.display));h>e.display.maxLineLength&&(e.display.maxLineLength=h,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}}function Wn(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function Un(e,t,n){var r=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-Vt(e));var i=n&&null!=n.bottom?n.bottom:r+e.wrapper.clientHeight,o=ie(t,r),s=ie(t,i);if(n&&n.ensure){var a=n.ensure.from.line,l=n.ensure.to.line;a<o?(o=a,s=ie(t,nt(Q(t,a))+e.wrapper.clientHeight)):Math.min(l,t.lastLine())>=s&&(o=ie(t,nt(Q(t,l))-e.wrapper.clientHeight),s=l)}return{from:o,to:Math.max(s,o+1)}}function qn(e,t){if(!M(e,"scrollCursorIntoView")){var n=e.display,i=n.sizer.getBoundingClientRect(),o=null;if(t.top+i.top<0?o=!0:t.bottom+i.top>(window.innerHeight||document.documentElement.clientHeight)&&(o=!1),null!=o&&!_s){var s=r("div","",null,"position: absolute;\n top: "+(t.top-n.viewOffset-Vt(e.display))+"px;\n height: "+(t.bottom-t.top+Rt(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(s),s.scrollIntoView(o),e.display.lineSpace.removeChild(s)}}}function Gn(e,t,n,r){null==r&&(r=0);var i;e.options.lineWrapping||t!=n||(t=t.ch?ae(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t,n="before"==t.sticky?ae(t.line,t.ch+1,"before"):t);for(var o=0;o<5;o++){var s=!1,a=cn(e,t),l=n&&n!=t?cn(e,n):a;i={left:Math.min(a.left,l.left),top:Math.min(a.top,l.top)-r,right:Math.max(a.left,l.left),bottom:Math.max(a.bottom,l.bottom)+r};var c=Yn(e,i),u=e.doc.scrollTop,d=e.doc.scrollLeft;if(null!=c.scrollTop&&(nr(e,c.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(s=!0)),null!=c.scrollLeft&&(ir(e,c.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(s=!0)),!s)break}return i}function Kn(e,t){var n=Yn(e,t);null!=n.scrollTop&&nr(e,n.scrollTop),null!=n.scrollLeft&&ir(e,n.scrollLeft)}function Yn(e,t){var n=e.display,r=yn(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,o=zt(e),s={};t.bottom-t.top>o&&(t.bottom=t.top+o);
|
||
var a=e.doc.height+It(n),l=t.top<r,c=t.bottom>a-r;if(t.top<i)s.scrollTop=l?0:t.top;else if(t.bottom>i+o){var u=Math.min(t.top,(c?a:t.bottom)-o);u!=i&&(s.scrollTop=u)}var d=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft,h=Ht(e)-(e.options.fixedGutter?n.gutters.offsetWidth:0),f=t.right-t.left>h;return f&&(t.right=t.left+h),t.left<10?s.scrollLeft=0:t.left<d?s.scrollLeft=Math.max(0,t.left-(f?0:10)):t.right>h+d-3&&(s.scrollLeft=t.right+(f?0:10)-h),s}function Xn(e,t){null!=t&&(er(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Jn(e){er(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Zn(e,t,n){null==t&&null==n||er(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function Qn(e,t){er(e),e.curOp.scrollToPos=t}function er(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=un(e,t.from),r=un(e,t.to);tr(e,n,r,t.margin)}}function tr(e,t,n,r){var i=Yn(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});Zn(e,i.scrollLeft,i.scrollTop)}function nr(e,t){Math.abs(e.doc.scrollTop-t)<2||(bs||Pr(e,{top:t}),rr(e,t,!0),bs&&Pr(e),xr(e,100))}function rr(e,t,n){t=Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function ir(e,t,n,r){t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r||(e.doc.scrollLeft=t,Mr(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function or(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+It(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Rt(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}function sr(e,t){t||(t=or(e));var n=e.display.barWidth,r=e.display.barHeight;ar(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&$n(e),ar(e,or(e)),n=e.display.barWidth,r=e.display.barHeight}function ar(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}function lr(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&zs(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Ta[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),ra(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){"horizontal"==n?ir(e,t):nr(e,t)},e),e.display.scrollbars.addClass&&a(e.display.wrapper,e.display.scrollbars.addClass)}function cr(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Pa},vt(e.curOp)}function ur(e){var t=e.curOp;t&&yt(t,function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;dr(e)})}function dr(e){for(var t=e.ops,n=0;n<t.length;n++)hr(t[n]);for(var r=0;r<t.length;r++)fr(t[r]);for(var i=0;i<t.length;i++)pr(t[i]);for(var o=0;o<t.length;o++)gr(t[o]);for(var s=0;s<t.length;s++)mr(t[s])}function hr(e){var t=e.cm,n=t.display;jr(t),e.updateMaxLine&&it(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Ea(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function fr(e){e.updatedDisplay=e.mustUpdate&&Sr(e.cm,e.update)}function pr(e){var t=e.cm,n=t.display;e.updatedDisplay&&$n(t),e.barMeasure=or(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Ut(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Rt(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Ht(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function gr(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&ir(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==s();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&sr(t,e.barMeasure),e.updatedDisplay&&Dr(t,e.barMeasure),e.selectionChanged&&Fn(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&Rn(e.cm)}function mr(e){var t=e.cm,n=t.display,r=t.doc;if(e.updatedDisplay&&Tr(t,e.update),null==n.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null!=e.scrollTop&&rr(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&ir(t,e.scrollLeft,!0,!0),e.scrollToPos){var i=Gn(t,pe(r,e.scrollToPos.from),pe(r,e.scrollToPos.to),e.scrollToPos.margin);qn(t,i)}var o=e.maybeHiddenMarkers,s=e.maybeUnhiddenMarkers;if(o)for(var a=0;a<o.length;++a)o[a].lines.length||D(o[a],"hide");if(s)for(var l=0;l<s.length;++l)s[l].lines.length&&D(s[l],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&D(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function vr(e,t){if(e.curOp)return t();cr(e);try{return t()}finally{ur(e)}}function br(e,t){return function(){if(e.curOp)return t.apply(e,arguments);cr(e);try{return t.apply(e,arguments)}finally{ur(e)}}}function yr(e){return function(){if(this.curOp)return e.apply(this,arguments);cr(this);try{return e.apply(this,arguments)}finally{ur(this)}}}function wr(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);cr(t);try{return e.apply(this,arguments)}finally{ur(t)}}}function xr(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,c(Cr,e))}function Cr(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=ye(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(r.line>=e.display.viewFrom){var s=o.styles,a=o.text.length>e.options.maxHighlightLength?X(t.mode,r.state):null,l=ve(e,o,r,!0);a&&(r.state=a),o.styles=l.styles;var c=o.styleClasses,u=l.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var d=!s||s.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),h=0;!d&&h<s.length;++h)d=s[h]!=o.styles[h];d&&i.push(r.line),o.stateAfter=r.save(),r.nextLine()}else o.text.length<=e.options.maxHighlightLength&&we(e,o.text,r),o.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return xr(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&vr(e,function(){for(var t=0;t<i.length;t++)Pn(e,i[t],"text")})}}function jr(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Rt(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Rt(e)+"px",t.scrollbarsClipped=!0)}function Or(e){if(e.hasFocus())return null;var t=s();if(!t||!o(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&o(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}function kr(e){if(e&&e.activeElt&&e.activeElt!=s()&&(e.activeElt.focus(),e.anchorNode&&o(document.body,e.anchorNode)&&o(document.body,e.focusNode))){var t=window.getSelection(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}function Sr(e,n){var r=e.display,i=e.doc;if(n.editorIsHidden)return En(e),!1;if(!n.force&&n.visible.from>=r.viewFrom&&n.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==Mn(e))return!1;Ar(e)&&(En(e),n.dims=xn(e));var o=i.first+i.size,s=Math.max(n.visible.from-e.options.viewportMargin,i.first),a=Math.min(o,n.visible.to+e.options.viewportMargin);r.viewFrom<s&&s-r.viewFrom<20&&(s=Math.max(i.first,r.viewFrom)),r.viewTo>a&&r.viewTo-a<20&&(a=Math.min(o,r.viewTo)),va&&(s=Ze(e.doc,s),a=Qe(e.doc,a));var l=s!=r.viewFrom||a!=r.viewTo||r.lastWrapHeight!=n.wrapperHeight||r.lastWrapWidth!=n.wrapperWidth;Dn(e,s,a),r.viewOffset=nt(Q(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var c=Mn(e);if(!l&&0==c&&!n.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1;var u=Or(e);return c>4&&(r.lineDiv.style.display="none"),Er(e,r.updateLineNumbers,n.dims),c>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,kr(u),t(r.cursorDiv),t(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,l&&(r.lastWrapHeight=n.wrapperHeight,r.lastWrapWidth=n.wrapperWidth,xr(e,400)),r.updateLineNumbers=null,!0}function Tr(e,t){for(var n=t.viewport,r=!0;(r&&e.options.lineWrapping&&t.oldDisplayWidth!=Ht(e)||(n&&null!=n.top&&(n={top:Math.min(e.doc.height+It(e.display)-zt(e),n.top)}),t.visible=Un(e.display,e.doc,n),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&Sr(e,t);r=!1){$n(e);var i=or(e);An(e),sr(e,i),Dr(e,i),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Pr(e,t){var n=new Ea(e,t);if(Sr(e,n)){$n(e),Tr(e,n);var r=or(e);An(e),sr(e,r),Dr(e,r),n.finish()}}function Er(e,n,r){function i(t){var n=t.nextSibling;return Os&&Ls&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var o=e.display,s=e.options.lineNumbers,a=o.lineDiv,l=a.firstChild,c=o.view,u=o.viewFrom,d=0;d<c.length;d++){var f=c[d];if(f.hidden);else if(f.node&&f.node.parentNode==a){for(;l!=f.node;)l=i(l);var p=s&&null!=n&&n<=u&&f.lineNumber;f.changes&&(h(f.changes,"gutter")>-1&&(p=!1),Ct(e,f,u,r)),p&&(t(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(se(e.options,u)))),l=f.node.nextSibling}else{var g=_t(e,f,u,r);a.insertBefore(g,l)}u+=f.size}for(;l;)l=i(l)}function _r(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Dr(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Rt(e)+"px"}function Mr(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=Cn(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",s=0;s<n.length;s++)if(!n[s].hidden){e.options.fixedGutter&&(n[s].gutter&&(n[s].gutter.style.left=o),n[s].gutterBackground&&(n[s].gutterBackground.style.left=o));var a=n[s].alignable;if(a)for(var l=0;l<a.length;l++)a[l].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}}function Ar(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=se(e.options,t.first+t.size-1),i=e.display;if(n.length!=i.lineNumChars){var o=i.measure.appendChild(r("div",[r("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),s=o.firstChild.offsetWidth,a=o.offsetWidth-s;return i.lineGutter.style.width="",i.lineNumInnerWidth=Math.max(s,i.lineGutter.offsetWidth-a)+1,i.lineNumWidth=i.lineNumInnerWidth+a,i.lineNumChars=i.lineNumInnerWidth?n.length:-1,i.lineGutter.style.width=i.lineNumWidth+"px",_r(e.display),!0}return!1}function Lr(e,t){for(var n=[],r=!1,i=0;i<e.length;i++){var o=e[i],s=null;if("string"!=typeof o&&(s=o.style,o=o.className),"CodeMirror-linenumbers"==o){if(!t)continue;r=!0}n.push({className:o,style:s})}return t&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function Nr(e){var n=e.gutters,i=e.gutterSpecs;t(n),e.lineGutter=null;for(var o=0;o<i.length;++o){var s=i[o],a=s.className,l=s.style,c=n.appendChild(r("div",null,"CodeMirror-gutter "+a));l&&(c.style.cssText=l),"CodeMirror-linenumbers"==a&&(e.lineGutter=c,c.style.width=(e.lineNumWidth||1)+"px")}n.style.display=i.length?"":"none",_r(e)}function Vr(e){Nr(e.display),Tn(e),Mr(e)}function Ir(e,t,n,o){var s=this;this.input=n,s.scrollbarFiller=r("div",null,"CodeMirror-scrollbar-filler"),s.scrollbarFiller.setAttribute("cm-not-content","true"),s.gutterFiller=r("div",null,"CodeMirror-gutter-filler"),s.gutterFiller.setAttribute("cm-not-content","true"),s.lineDiv=i("div",null,"CodeMirror-code"),s.selectionDiv=r("div",null,null,"position: relative; z-index: 1"),s.cursorDiv=r("div",null,"CodeMirror-cursors"),s.measure=r("div",null,"CodeMirror-measure"),s.lineMeasure=r("div",null,"CodeMirror-measure"),s.lineSpace=i("div",[s.measure,s.lineMeasure,s.selectionDiv,s.cursorDiv,s.lineDiv],null,"position: relative; outline: none");var a=i("div",[s.lineSpace],"CodeMirror-lines");s.mover=r("div",[a],null,"position: relative"),s.sizer=r("div",[s.mover],"CodeMirror-sizer"),s.sizerWidth=null,s.heightForcer=r("div",null,null,"position: absolute; height: "+qs+"px; width: 1px;"),s.gutters=r("div",null,"CodeMirror-gutters"),s.lineGutter=null,s.scroller=r("div",[s.sizer,s.heightForcer,s.gutters],"CodeMirror-scroll"),s.scroller.setAttribute("tabIndex","-1"),s.wrapper=r("div",[s.scrollbarFiller,s.gutterFiller,s.scroller],"CodeMirror"),Cs&&js<8&&(s.gutters.style.zIndex=-1,s.scroller.style.paddingRight=0),Os||bs&&As||(s.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(s.wrapper):e(s.wrapper)),s.viewFrom=s.viewTo=t.first,s.reportedViewFrom=s.reportedViewTo=t.first,s.view=[],s.renderedView=null,s.externalMeasured=null,s.viewOffset=0,s.lastWrapHeight=s.lastWrapWidth=0,s.updateLineNumbers=null,s.nativeBarWidth=s.barHeight=s.barWidth=0,s.scrollbarsClipped=!1,s.lineNumWidth=s.lineNumInnerWidth=s.lineNumChars=null,s.alignWidgets=!1,s.cachedCharWidth=s.cachedTextHeight=s.cachedPaddingH=null,s.maxLine=null,s.maxLineLength=0,s.maxLineChanged=!1,s.wheelDX=s.wheelDY=s.wheelStartX=s.wheelStartY=null,s.shift=!1,s.selForContextMenu=null,s.activeTouch=null,s.gutterSpecs=Lr(o.gutters,o.lineNumbers),Nr(s),n.init(s)}function Fr(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==n&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:null==n&&(n=e.wheelDelta),{x:t,y:n}}function Rr(e){var t=Fr(e);return t.x*=Da,t.y*=Da,t}function Hr(e,t){var n=Fr(t),r=n.x,i=n.y,o=e.display,s=o.scroller,a=s.scrollWidth>s.clientWidth,l=s.scrollHeight>s.clientHeight;if(r&&a||i&&l){if(i&&Ls&&Os)e:for(var c=t.target,u=o.view;c!=s;c=c.parentNode)for(var d=0;d<u.length;d++)if(u[d].node==c){e.display.currentWheelTarget=c;break e}if(r&&!bs&&!Ts&&null!=Da)return i&&l&&nr(e,Math.max(0,s.scrollTop+i*Da)),ir(e,Math.max(0,s.scrollLeft+r*Da)),(!i||i&&l)&&V(t),void(o.wheelStartX=null);if(i&&null!=Da){var h=i*Da,f=e.doc.scrollTop,p=f+o.wrapper.clientHeight;h<0?f=Math.max(0,f+h-50):p=Math.min(e.doc.height,p+h+50),Pr(e,{top:f,bottom:p})}_a<20&&(null==o.wheelStartX?(o.wheelStartX=s.scrollLeft,o.wheelStartY=s.scrollTop,o.wheelDX=r,o.wheelDY=i,setTimeout(function(){if(null!=o.wheelStartX){var e=s.scrollLeft-o.wheelStartX,t=s.scrollTop-o.wheelStartY,n=t&&o.wheelDY&&t/o.wheelDY||e&&o.wheelDX&&e/o.wheelDX;o.wheelStartX=o.wheelStartY=null,n&&(Da=(Da*_a+n)/(_a+1),++_a)}},200)):(o.wheelDX+=r,o.wheelDY+=i))}}function zr(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort(function(e,t){return le(e.from(),t.from())}),n=h(t,i);for(var o=1;o<t.length;o++){var s=t[o],a=t[o-1],l=le(a.to(),s.from());if(r&&!s.empty()?l>0:l>=0){var c=he(a.from(),s.from()),u=de(a.to(),s.to()),d=a.empty()?s.from()==s.head:a.from()==a.head;o<=n&&--n,t.splice(--o,2,new Aa(d?u:c,d?c:u))}}return new Ma(t,n)}function Br(e,t){return new Ma([new Aa(e,t||e)],0)}function $r(e){return e.text?ae(e.from.line+e.text.length-1,g(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function Wr(e,t){if(le(e,t.from)<0)return e;if(le(e,t.to)<=0)return $r(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=$r(t).ch-t.to.ch),ae(n,r)}function Ur(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new Aa(Wr(i.anchor,t),Wr(i.head,t)))}return zr(e.cm,n,e.sel.primIndex)}function qr(e,t,n){return e.line==t.line?ae(n.line,e.ch-t.ch+n.ch):ae(n.line+(e.line-t.line),e.ch)}function Gr(e,t,n){for(var r=[],i=ae(e.first,0),o=i,s=0;s<t.length;s++){var a=t[s],l=qr(a.from,i,o),c=qr($r(a),i,o);if(i=a.to,o=c,"around"==n){var u=e.sel.ranges[s],d=le(u.head,u.anchor)<0;r[s]=new Aa(d?c:l,d?l:c)}else r[s]=new Aa(l,l)}return new Ma(r,e.sel.primIndex)}function Kr(e){e.doc.mode=K(e.options,e.doc.modeOption),Yr(e)}function Yr(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,xr(e,100),e.state.modeGen++,e.curOp&&Tn(e)}function Xr(e,t){return 0==t.from.ch&&0==t.to.ch&&""==g(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Jr(e,t,n,r){function i(e){return n?n[e]:null}function o(e,n,i){ot(e,n,i,r),wt(e,"change",e,t)}function s(e,t){for(var n=[],o=e;o<t;++o)n.push(new ba(c[o],i(o),r));return n}var a=t.from,l=t.to,c=t.text,u=Q(e,a.line),d=Q(e,l.line),h=g(c),f=i(c.length-1),p=l.line-a.line;if(t.full)e.insert(0,s(0,c.length)),e.remove(c.length,e.size-c.length);else if(Xr(e,t)){var m=s(0,c.length-1);o(d,d.text,f),p&&e.remove(a.line,p),m.length&&e.insert(a.line,m)}else if(u==d)if(1==c.length)o(u,u.text.slice(0,a.ch)+h+u.text.slice(l.ch),f);else{var v=s(1,c.length-1);v.push(new ba(h+u.text.slice(l.ch),f,r)),o(u,u.text.slice(0,a.ch)+c[0],i(0)),e.insert(a.line+1,v)}else if(1==c.length)o(u,u.text.slice(0,a.ch)+c[0]+d.text.slice(l.ch),i(0)),e.remove(a.line+1,p);else{o(u,u.text.slice(0,a.ch)+c[0],i(0)),o(d,h+d.text.slice(l.ch),f);var b=s(1,c.length-1);p>1&&e.remove(a.line+1,p-1),e.insert(a.line+1,b)}wt(e,"change",e,t)}function Zr(e,t,n){function r(e,i,o){if(e.linked)for(var s=0;s<e.linked.length;++s){var a=e.linked[s];if(a.doc!=i){var l=o&&a.sharedHist;n&&!l||(t(a.doc,l),r(a.doc,e,l))}}}r(e,null,!0)}function Qr(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,On(e),Kr(e),ei(e),e.options.lineWrapping||it(e),e.options.mode=t.modeOption,Tn(e)}function ei(e){("rtl"==e.doc.direction?a:zs)(e.display.lineDiv,"CodeMirror-rtl")}function ti(e){vr(e,function(){ei(e),Tn(e)})}function ni(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function ri(e,t){var n={from:ue(t.from),to:$r(t),text:ee(e,t.from,t.to)};return ui(e,n,t.from.line,t.to.line+1),Zr(e,function(e){return ui(e,n,t.from.line,t.to.line+1)},!0),n}function ii(e){for(;e.length;){var t=g(e);if(!t.ranges)break;e.pop()}}function oi(e,t){return t?(ii(e.done),g(e.done)):e.done.length&&!g(e.done).ranges?g(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),g(e.done)):void 0}function si(e,t,n,r){var i=e.history;i.undone.length=0;var o,s,a=+new Date;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&i.lastModTime>a-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=oi(i,i.lastOp==r)))s=g(o.changes),0==le(t.from,t.to)&&0==le(t.from,s.to)?s.to=$r(t):o.changes.push(ri(e,t));else{var l=g(i.done);for(l&&l.ranges||ci(e.sel,i.done),o={changes:[ri(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=a,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,s||D(e,"historyAdded")}function ai(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function li(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||ai(e,o,g(i.done),t))?i.done[i.done.length-1]=t:ci(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&r.clearRedo!==!1&&ii(i.undone)}function ci(e,t){var n=g(t);n&&n.ranges&&n.equals(e)||t.push(e)}function ui(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=n.markedSpans),++o})}function di(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function hi(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],i=0;i<t.text.length;++i)r.push(di(n[i]));return r}function fi(e,t){var n=hi(e,t),r=Ve(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var o=n[i],s=r[i];if(o&&s)e:for(var a=0;a<s.length;++a){for(var l=s[a],c=0;c<o.length;++c)if(o[c].marker==l.marker)continue e;o.push(l)}else s&&(n[i]=s)}return n}function pi(e,t,n){for(var r=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges)r.push(n?Ma.prototype.deepCopy.call(o):o);else{var s=o.changes,a=[];r.push({changes:a});for(var l=0;l<s.length;++l){var c=s[l],u=void 0;if(a.push({from:c.from,to:c.to,text:c.text}),t)for(var d in c)(u=d.match(/^spans_(\d+)$/))&&h(t,Number(u[1]))>-1&&(g(a)[d]=c[d],delete c[d])}}}return r}function gi(e,t,n,r){if(r){var i=e.anchor;if(n){var o=le(t,i)<0;o!=le(n,i)<0?(i=t,t=n):o!=le(t,n)<0&&(t=n)}return new Aa(i,t)}return new Aa(n||t,t)}function mi(e,t,n,r,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),Ci(e,new Ma([gi(e.sel.primary(),t,n,i)],0),r)}function vi(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)r[o]=gi(e.sel.ranges[o],t[o],null,i);var s=zr(e.cm,r,e.sel.primIndex);Ci(e,s,n)}function bi(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,Ci(e,zr(e.cm,i,e.sel.primIndex),r)}function yi(e,t,n,r){Ci(e,Br(t,n),r)}function wi(e,t,n){var r={ranges:t.ranges,update:function(t){var n=this;this.ranges=[];for(var r=0;r<t.length;r++)n.ranges[r]=new Aa(pe(e,t[r].anchor),pe(e,t[r].head))},origin:n&&n.origin};return D(e,"beforeSelectionChange",e,r),e.cm&&D(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?zr(e.cm,r.ranges,r.ranges.length-1):t}function xi(e,t,n){var r=e.history.done,i=g(r);i&&i.ranges?(r[r.length-1]=t,ji(e,t,n)):Ci(e,t,n)}function Ci(e,t,n){ji(e,t,n),li(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function ji(e,t,n){(L(e,"beforeSelectionChange")||e.cm&&L(e.cm,"beforeSelectionChange"))&&(t=wi(e,t,n));var r=n&&n.bias||(le(t.primary().head,e.sel.primary().head)<0?-1:1);Oi(e,Si(e,t,r,!0)),n&&n.scroll===!1||!e.cm||Jn(e.cm)}function Oi(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,A(e.cm)),wt(e,"cursorActivity",e))}function ki(e){Oi(e,Si(e,e.sel,null,!1))}function Si(e,t,n,r){for(var i,o=0;o<t.ranges.length;o++){var s=t.ranges[o],a=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],l=Pi(e,s.anchor,a&&a.anchor,n,r),c=Pi(e,s.head,a&&a.head,n,r);(i||l!=s.anchor||c!=s.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new Aa(l,c))}return i?zr(e.cm,i,t.primIndex):t}function Ti(e,t,n,r,i){var o=Q(e,t.line);if(o.markedSpans)for(var s=0;s<o.markedSpans.length;++s){var a=o.markedSpans[s],l=a.marker,c="selectLeft"in l?!l.selectLeft:l.inclusiveLeft,u="selectRight"in l?!l.selectRight:l.inclusiveRight;if((null==a.from||(c?a.from<=t.ch:a.from<t.ch))&&(null==a.to||(u?a.to>=t.ch:a.to>t.ch))){if(i&&(D(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--s;continue}break}if(!l.atomic)continue;if(n){var d=l.find(r<0?1:-1),h=void 0;if((r<0?u:c)&&(d=Ei(e,d,-r,d&&d.line==t.line?o:null)),d&&d.line==t.line&&(h=le(d,n))&&(r<0?h<0:h>0))return Ti(e,d,t,r,i)}var f=l.find(r<0?-1:1);return(r<0?c:u)&&(f=Ei(e,f,r,f.line==t.line?o:null)),f?Ti(e,f,t,r,i):null}}return t}function Pi(e,t,n,r,i){var o=r||1,s=Ti(e,t,n,o,i)||!i&&Ti(e,t,n,o,!0)||Ti(e,t,n,-o,i)||!i&&Ti(e,t,n,-o,!0);return s?s:(e.cantEdit=!0,ae(e.first,0))}function Ei(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?pe(e,ae(t.line-1)):null:n>0&&t.ch==(r||Q(e,t.line)).text.length?t.line<e.first+e.size-1?ae(t.line+1,0):null:new ae(t.line,t.ch+n)}function _i(e){e.setSelection(ae(e.firstLine(),0),ae(e.lastLine()),Ks)}function Di(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(t,n,i,o){t&&(r.from=pe(e,t)),n&&(r.to=pe(e,n)),i&&(r.text=i),void 0!==o&&(r.origin=o)}),D(e,"beforeChange",e,r),e.cm&&D(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function Mi(e,t,n){if(e.cm){if(!e.cm.curOp)return br(e.cm,Mi)(e,t,n);if(e.cm.state.suppressEdits)return}if(!(L(e,"beforeChange")||e.cm&&L(e.cm,"beforeChange"))||(t=Di(e,t,!0))){var r=ma&&!n&&Fe(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)Ai(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else Ai(e,t)}}function Ai(e,t){if(1!=t.text.length||""!=t.text[0]||0!=le(t.from,t.to)){var n=Ur(e,t);si(e,t,n,e.cm?e.cm.curOp.id:NaN),Vi(e,t,n,Ve(e,t));var r=[];Zr(e,function(e,n){n||h(r,e.history)!=-1||(zi(e.history,t),r.push(e.history)),Vi(e,t,null,Ve(e,t))})}}function Li(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!r||n){for(var i,o=e.history,s=e.sel,a="undo"==t?o.done:o.undone,l="undo"==t?o.undone:o.done,c=0;c<a.length&&(i=a[c],n?!i.ranges||i.equals(e.sel):i.ranges);c++);if(c!=a.length){for(o.lastOrigin=o.lastSelOrigin=null;;){if(i=a.pop(),!i.ranges){if(r)return void a.push(i);break}if(ci(i,l),n&&!i.equals(e.sel))return void Ci(e,i,{clearRedo:!1});s=i}var u=[];ci(s,l),l.push({changes:u,generation:o.generation}),o.generation=i.generation||++o.maxGeneration;for(var d=L(e,"beforeChange")||e.cm&&L(e.cm,"beforeChange"),f=function(n){var r=i.changes[n];if(r.origin=t,d&&!Di(e,r,!1))return a.length=0,{};u.push(ri(e,r));var o=n?Ur(e,r):g(a);Vi(e,r,o,fi(e,r)),!n&&e.cm&&e.cm.scrollIntoView({from:r.from,to:$r(r)});var s=[];Zr(e,function(e,t){t||h(s,e.history)!=-1||(zi(e.history,r),s.push(e.history)),Vi(e,r,null,fi(e,r))})},p=i.changes.length-1;p>=0;--p){var m=f(p);if(m)return m.v}}}}function Ni(e,t){if(0!=t&&(e.first+=t,e.sel=new Ma(m(e.sel.ranges,function(e){return new Aa(ae(e.anchor.line+t,e.anchor.ch),ae(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){Tn(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)Pn(e.cm,r,"gutter")}}function Vi(e,t,n,r){if(e.cm&&!e.cm.curOp)return br(e.cm,Vi)(e,t,n,r);if(t.to.line<e.first)return void Ni(e,t.text.length-1-(t.to.line-t.from.line));if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);Ni(e,i),t={from:ae(e.first,0),to:ae(t.to.line+i,t.to.ch),text:[g(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:ae(o,Q(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=ee(e,t.from,t.to),n||(n=Ur(e,t)),e.cm?Ii(e.cm,t,r):Jr(e,t,r),ji(e,n,Ks),e.cantEdit&&Pi(e,ae(e.firstLine(),0))&&(e.cantEdit=!1)}}function Ii(e,t,n){var r=e.doc,i=e.display,o=t.from,s=t.to,a=!1,l=o.line;e.options.lineWrapping||(l=re(Ye(Q(r,o.line))),r.iter(l,s.line+1,function(e){if(e==i.maxLine)return a=!0,!0})),r.sel.contains(t.from,t.to)>-1&&A(e),Jr(r,t,n,jn(e)),e.options.lineWrapping||(r.iter(l,o.line+t.text.length,function(e){var t=rt(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,a=!1)}),a&&(e.curOp.updateMaxLine=!0)),Te(r,o.line),xr(e,400);var c=t.text.length-(s.line-o.line)-1;t.full?Tn(e):o.line!=s.line||1!=t.text.length||Xr(e.doc,t)?Tn(e,o.line,s.line+1,c):Pn(e,o.line,"text");var u=L(e,"changes"),d=L(e,"change");if(d||u){var h={from:o,to:s,text:t.text,removed:t.removed,origin:t.origin};d&&wt(e,"change",e,h),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(h)}e.display.selForContextMenu=null}function Fi(e,t,n,r,i){var o;r||(r=n),le(r,n)<0&&(o=[r,n],n=o[0],r=o[1]),"string"==typeof t&&(t=e.splitLines(t)),Mi(e,{from:n,to:r,text:t,origin:i})}function Ri(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function Hi(e,t,n,r){for(var i=0;i<e.length;++i){var o=e[i],s=!0;if(o.ranges){o.copied||(o=e[i]=o.deepCopy(),o.copied=!0);for(var a=0;a<o.ranges.length;a++)Ri(o.ranges[a].anchor,t,n,r),Ri(o.ranges[a].head,t,n,r)}else{for(var l=0;l<o.changes.length;++l){var c=o.changes[l];if(n<c.from.line)c.from=ae(c.from.line+r,c.from.ch),c.to=ae(c.to.line+r,c.to.ch);else if(t<=c.to.line){s=!1;break}}s||(e.splice(0,i+1),i=0)}}}function zi(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;Hi(e.done,n,r,i),Hi(e.undone,n,r,i)}function Bi(e,t,n,r){var i=t,o=t;return"number"==typeof t?o=Q(e,fe(e,t)):i=re(t),null==i?null:(r(o,i)&&e.cm&&Pn(e.cm,i,n),o)}function $i(e){var t=this;this.lines=e,this.parent=null;for(var n=0,r=0;r<e.length;++r)e[r].parent=t,n+=e[r].height;this.height=n}function Wi(e){var t=this;this.children=e;for(var n=0,r=0,i=0;i<e.length;++i){var o=e[i];n+=o.chunkSize(),r+=o.height,o.parent=t}this.size=n,this.height=r,this.parent=null}function Ui(e,t,n){nt(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Xn(e,n)}function qi(e,t,n,r){var i=new La(e,n,r),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),Bi(e,t,"widget",function(t){var n=t.widgets||(t.widgets=[]);if(null==i.insertAt?n.push(i):n.splice(Math.min(n.length-1,Math.max(0,i.insertAt)),0,i),i.line=t,o&&!et(e,t)){var r=nt(t)<e.scrollTop;ne(t,t.height+Lt(i)),r&&Xn(o,i.height),o.curOp.forceUpdate=!0}return!0}),o&&wt(o,"lineWidgetAdded",o,i,"number"==typeof t?t:re(t)),i}function Gi(e,t,n,r,o){if(r&&r.shared)return Ki(e,t,n,r,o);if(e.cm&&!e.cm.curOp)return br(e.cm,Gi)(e,t,n,r,o);var s=new Va(e,o),a=le(t,n);if(r&&u(r,s,!1),a>0||0==a&&s.clearWhenEmpty!==!1)return s;if(s.replacedWith&&(s.collapsed=!0,s.widgetNode=i("span",[s.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||s.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(s.widgetNode.insertLeft=!0)),s.collapsed){if(Ke(e,t.line,t,n,s)||t.line!=n.line&&Ke(e,n.line,t,n,s))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ee()}s.addToHistory&&si(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var l,c=t.line,d=e.cm;if(e.iter(c,n.line+1,function(e){d&&s.collapsed&&!d.options.lineWrapping&&Ye(e)==d.display.maxLine&&(l=!0),s.collapsed&&c!=t.line&&ne(e,0),Ae(e,new _e(s,c==t.line?t.ch:null,c==n.line?n.ch:null)),++c}),s.collapsed&&e.iter(t.line,n.line+1,function(t){et(e,t)&&ne(t,0)}),s.clearOnEnter&&ra(s,"beforeCursorEnter",function(){return s.clear()}),s.readOnly&&(Pe(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),s.collapsed&&(s.id=++Na,s.atomic=!0),d){if(l&&(d.curOp.updateMaxLine=!0),s.collapsed)Tn(d,t.line,n.line+1);else if(s.className||s.startStyle||s.endStyle||s.css||s.attributes||s.title)for(var h=t.line;h<=n.line;h++)Pn(d,h,"text");
|
||
s.atomic&&ki(d.doc),wt(d,"markerAdded",d,s)}return s}function Ki(e,t,n,r,i){r=u(r),r.shared=!1;var o=[Gi(e,t,n,r,i)],s=o[0],a=r.widgetNode;return Zr(e,function(e){a&&(r.widgetNode=a.cloneNode(!0)),o.push(Gi(e,pe(e,t),pe(e,n),r,i));for(var l=0;l<e.linked.length;++l)if(e.linked[l].isParent)return;s=g(o)}),new Ia(o,s)}function Yi(e){return e.findMarks(ae(e.first,0),e.clipPos(ae(e.lastLine())),function(e){return e.parent})}function Xi(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),o=e.clipPos(i.from),s=e.clipPos(i.to);if(le(o,s)){var a=Gi(e,o,s,r.primary,r.primary.type);r.markers.push(a),a.parent=r}}}function Ji(e){for(var t=function(t){var n=e[t],r=[n.primary.doc];Zr(n.primary.doc,function(e){return r.push(e)});for(var i=0;i<n.markers.length;i++){var o=n.markers[i];h(r,o.doc)==-1&&(o.parent=null,n.markers.splice(i--,1))}},n=0;n<e.length;n++)t(n)}function Zi(e){var t=this;if(to(t),!M(t,e)&&!Nt(t.display,e)){V(e),Cs&&(Ha=+new Date);var n=kn(t,e,!0),r=e.dataTransfer.files;if(n&&!t.isReadOnly())if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),s=0,a=function(e,r){if(!t.options.allowDropFileTypes||h(t.options.allowDropFileTypes,e.type)!=-1){var a=new FileReader;a.onload=br(t,function(){var e=a.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(e)&&(e=""),o[r]=e,++s==i){n=pe(t.doc,n);var l={from:n,to:n,text:t.doc.splitLines(o.join(t.doc.lineSeparator())),origin:"paste"};Mi(t.doc,l),xi(t.doc,Br(n,$r(l)))}}),a.readAsText(e)}},l=0;l<i;++l)a(r[l],l);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1)return t.state.draggingText(e),void setTimeout(function(){return t.display.input.focus()},20);try{var c=e.dataTransfer.getData("Text");if(c){var u;if(t.state.draggingText&&!t.state.draggingText.copy&&(u=t.listSelections()),ji(t.doc,Br(n,n)),u)for(var d=0;d<u.length;++d)Fi(t.doc,"",u[d].anchor,u[d].head,"drag");t.replaceSelection(c,"around","paste"),t.display.input.focus()}}catch(e){}}}}function Qi(e,t){if(Cs&&(!e.state.draggingText||+new Date-Ha<100))return void R(t);if(!M(e,t)&&!Nt(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!Ps)){var n=r("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",Ts&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),Ts&&n.parentNode.removeChild(n)}}function eo(e,t){var i=kn(e,t);if(i){var o=document.createDocumentFragment();Nn(e,i,o),e.display.dragCursor||(e.display.dragCursor=r("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),n(e.display.dragCursor,o)}}function to(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function no(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<t.length;r++){var i=t[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation(function(){for(var t=0;t<n.length;t++)e(n[t])})}}function ro(){za||(io(),za=!0)}function io(){var e;ra(window,"resize",function(){null==e&&(e=setTimeout(function(){e=null,no(oo)},100))}),ra(window,"blur",function(){return no(Bn)})}function oo(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}function so(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var n,r,i,o,s=0;s<t.length-1;s++){var a=t[s];if(/^(cmd|meta|m)$/i.test(a))o=!0;else if(/^a(lt)?$/i.test(a))n=!0;else if(/^(c|ctrl|control)$/i.test(a))r=!0;else{if(!/^s(hift)?$/i.test(a))throw new Error("Unrecognized modifier name: "+a);i=!0}}return n&&(e="Alt-"+e),r&&(e="Ctrl-"+e),o&&(e="Cmd-"+e),i&&(e="Shift-"+e),e}function ao(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==r){delete e[n];continue}for(var i=m(n.split(" "),so),o=0;o<i.length;o++){var s=void 0,a=void 0;o==i.length-1?(a=i.join(" "),s=r):(a=i.slice(0,o+1).join(" "),s="...");var l=t[a];if(l){if(l!=s)throw new Error("Inconsistent bindings for "+a)}else t[a]=s}delete e[n]}for(var c in t)e[c]=t[c];return e}function lo(e,t,n,r){t=fo(t);var i=t.call?t.call(e,r):t[e];if(i===!1)return"nothing";if("..."===i)return"multi";if(null!=i&&n(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return lo(e,t.fallthrough,n,r);for(var o=0;o<t.fallthrough.length;o++){var s=lo(e,t.fallthrough[o],n,r);if(s)return s}}}function co(e){var t="string"==typeof e?e:Ba[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function uo(e,t,n){var r=e;return t.altKey&&"Alt"!=r&&(e="Alt-"+e),(Rs?t.metaKey:t.ctrlKey)&&"Ctrl"!=r&&(e="Ctrl-"+e),(Rs?t.ctrlKey:t.metaKey)&&"Cmd"!=r&&(e="Cmd-"+e),!n&&t.shiftKey&&"Shift"!=r&&(e="Shift-"+e),e}function ho(e,t){if(Ts&&34==e.keyCode&&e["char"])return!1;var n=Ba[e.keyCode];return null!=n&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(n=e.code),uo(n,e,t))}function fo(e){return"string"==typeof e?qa[e]:e}function po(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var o=t(n[i]);r.length&&le(o.from,g(r).to)<=0;){var s=r.pop();if(le(s.from,o.from)<0){o.from=s.from;break}}r.push(o)}vr(e,function(){for(var t=r.length-1;t>=0;t--)Fi(e.doc,"",r[t].from,r[t].to,"+delete");Jn(e)})}function go(e,t,n){var r=O(e.text,t+n,n);return r<0||r>e.text.length?null:r}function mo(e,t,n){var r=go(e,t.ch,n);return null==r?null:new ae(t.line,r,n<0?"after":"before")}function vo(e,t,n,r,i){if(e){var o=P(n,t.doc.direction);if(o){var s,a=i<0?g(o):o[0],l=i<0==(1==a.level),c=l?"after":"before";if(a.level>0||"rtl"==t.doc.direction){var u=Gt(t,n);s=i<0?n.text.length-1:0;var d=Kt(t,u,s).top;s=k(function(e){return Kt(t,u,e).top==d},i<0==(1==a.level)?a.from:a.to-1,s),"before"==c&&(s=go(n,s,1))}else s=i<0?a.to:a.from;return new ae(r,s,c)}}return new ae(r,i<0?n.text.length:0,i<0?"before":"after")}function bo(e,t,n,r){var i=P(t,e.doc.direction);if(!i)return mo(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=T(i,n.ch,n.sticky),s=i[o];if("ltr"==e.doc.direction&&s.level%2==0&&(r>0?s.to>n.ch:s.from<n.ch))return mo(t,n,r);var a,l=function(e,n){return go(t,e instanceof ae?e.ch:e,n)},c=function(n){return e.options.lineWrapping?(a=a||Gt(e,t),pn(e,t,a,n)):{begin:0,end:t.text.length}},u=c("before"==n.sticky?l(n,-1):n.ch);if("rtl"==e.doc.direction||1==s.level){var d=1==s.level==r<0,h=l(n,d?1:-1);if(null!=h&&(d?h<=s.to&&h<=u.end:h>=s.from&&h>=u.begin)){var f=d?"before":"after";return new ae(n.line,h,f)}}var p=function(e,t,r){for(var o=function(e,t){return t?new ae(n.line,l(e,1),"before"):new ae(n.line,e,"after")};e>=0&&e<i.length;e+=t){var s=i[e],a=t>0==(1!=s.level),c=a?r.begin:l(r.end,-1);if(s.from<=c&&c<s.to)return o(c,a);if(c=a?s.from:l(s.to,-1),r.begin<=c&&c<r.end)return o(c,a)}},g=p(o+r,r,u);if(g)return g;var m=r>0?u.end:l(u.begin,-1);return null==m||r>0&&m==t.text.length||!(g=p(r>0?0:i.length-1,r,c(m)))?null:g}function yo(e,t){var n=Q(e.doc,t),r=Ye(n);return r!=n&&(t=re(r)),vo(!0,e,r,t,1)}function wo(e,t){var n=Q(e.doc,t),r=Xe(n);return r!=n&&(t=re(r)),vo(!0,e,n,t,-1)}function xo(e,t){var n=yo(e,t.line),r=Q(e.doc,n.line),i=P(r,e.doc.direction);if(!i||0==i[0].level){var o=Math.max(0,r.text.search(/\S/)),s=t.line==n.line&&t.ch<=o&&t.ch;return ae(n.line,s?0:o,n.sticky)}return n}function Co(e,t,n){if("string"==typeof t&&(t=Ga[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=Gs}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function jo(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=lo(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&lo(t,e.options.extraKeys,n,e)||lo(t,e.options.keyMap,n,e)}function Oo(e,t,n,r){var i=e.state.keySeq;if(i){if(co(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Ka.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),ko(e,i+" "+t,n,r))return!0}return ko(e,t,n,r)}function ko(e,t,n,r){var i=jo(e,t,r);return"multi"==i&&(e.state.keySeq=t),"handled"==i&&wt(e,"keyHandled",e,t,n),"handled"!=i&&"multi"!=i||(V(n),Fn(e)),!!i}function So(e,t){var n=ho(t,!0);return!!n&&(t.shiftKey&&!e.state.keySeq?Oo(e,"Shift-"+n,t,function(t){return Co(e,t,!0)})||Oo(e,n,t,function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return Co(e,t)}):Oo(e,n,t,function(t){return Co(e,t)}))}function To(e,t,n){return Oo(e,"'"+n+"'",t,function(t){return Co(e,t,!0)})}function Po(e){var t=this;if(t.curOp.focus=s(),!M(t,e)){Cs&&js<11&&27==e.keyCode&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=16==n||e.shiftKey;var r=So(t,e);Ts&&(Ya=r?n:null,!r&&88==n&&!aa&&(Ls?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),18!=n||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||Eo(t)}}function Eo(e){function t(e){18!=e.keyCode&&e.altKey||(zs(n,"CodeMirror-crosshair"),_(document,"keyup",t),_(document,"mouseover",t))}var n=e.display.lineDiv;a(n,"CodeMirror-crosshair"),ra(document,"keyup",t),ra(document,"mouseover",t)}function _o(e){16==e.keyCode&&(this.doc.sel.shift=!1),M(this,e)}function Do(e){var t=this;if(!(Nt(t.display,e)||M(t,e)||e.ctrlKey&&!e.altKey||Ls&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(Ts&&n==Ya)return Ya=null,void V(e);if(!Ts||e.which&&!(e.which<10)||!So(t,e)){var i=String.fromCharCode(null==r?n:r);"\b"!=i&&(To(t,e,i)||t.display.input.onKeyPress(e))}}}function Mo(e,t){var n=+new Date;return Qa&&Qa.compare(n,e,t)?(Za=Qa=null,"triple"):Za&&Za.compare(n,e,t)?(Qa=new Ja(n,e,t),Za=null,"double"):(Za=new Ja(n,e,t),Qa=null,"single")}function Ao(e){var t=this,n=t.display;if(!(M(t,e)||n.activeTouch&&n.input.supportsTouch())){if(n.input.ensurePolled(),n.shift=e.shiftKey,Nt(n,e))return void(Os||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100)));if(!Bo(t,e)){var r=kn(t,e),i=z(e),o=r?Mo(r,i):"single";window.focus(),1==i&&t.state.selectingText&&t.state.selectingText(e),r&&Lo(t,i,r,o,e)||(1==i?r?Vo(t,r,o,e):H(e)==n.scroller&&V(e):2==i?(r&&mi(t.doc,r),setTimeout(function(){return n.input.focus()},20)):3==i&&(Hs?t.display.input.onContextMenu(e):Hn(t)))}}}function Lo(e,t,n,r,i){var o="Click";return"double"==r?o="Double"+o:"triple"==r&&(o="Triple"+o),o=(1==t?"Left":2==t?"Middle":"Right")+o,Oo(e,uo(o,i),i,function(t){if("string"==typeof t&&(t=Ga[t]),!t)return!1;var r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r=t(e,n)!=Gs}finally{e.state.suppressEdits=!1}return r})}function No(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(null==i.unit){var o=Ns?n.shiftKey&&n.metaKey:n.altKey;i.unit=o?"rectangle":"single"==t?"char":"double"==t?"word":"line"}return(null==i.extend||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),null==i.addNew&&(i.addNew=Ls?n.metaKey:n.ctrlKey),null==i.moveOnDrag&&(i.moveOnDrag=!(Ls?n.altKey:n.ctrlKey)),i}function Vo(e,t,n,r){Cs?setTimeout(c(Rn,e),0):e.curOp.focus=s();var i,o=No(e,n,r),a=e.doc.sel;e.options.dragDrop&&ia&&!e.isReadOnly()&&"single"==n&&(i=a.contains(t))>-1&&(le((i=a.ranges[i]).from(),t)<0||t.xRel>0)&&(le(i.to(),t)>0||t.xRel<0)?Io(e,r,t,o):Ro(e,r,t,o)}function Io(e,t,n,r){var i=e.display,o=!1,s=br(e,function(t){Os&&(i.scroller.draggable=!1),e.state.draggingText=!1,_(i.wrapper.ownerDocument,"mouseup",s),_(i.wrapper.ownerDocument,"mousemove",a),_(i.scroller,"dragstart",l),_(i.scroller,"drop",s),o||(V(t),r.addNew||mi(e.doc,n,null,null,r.extend),Os||Cs&&9==js?setTimeout(function(){i.wrapper.ownerDocument.body.focus(),i.input.focus()},20):i.input.focus())}),a=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},l=function(){return o=!0};Os&&(i.scroller.draggable=!0),e.state.draggingText=s,s.copy=!r.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),ra(i.wrapper.ownerDocument,"mouseup",s),ra(i.wrapper.ownerDocument,"mousemove",a),ra(i.scroller,"dragstart",l),ra(i.scroller,"drop",s),Hn(e),setTimeout(function(){return i.input.focus()},20)}function Fo(e,t,n){if("char"==n)return new Aa(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new Aa(ae(t.line,0),pe(e.doc,ae(t.line+1,0)));var r=n(e,t);return new Aa(r.from,r.to)}function Ro(e,t,n,r){function i(t){if(0!=le(v,t))if(v=t,"rectangle"==r.unit){for(var i=[],o=e.options.tabSize,s=d(Q(c,n.line).text,n.ch,o),a=d(Q(c,t.line).text,t.ch,o),l=Math.min(s,a),g=Math.max(s,a),m=Math.min(n.line,t.line),b=Math.min(e.lastLine(),Math.max(n.line,t.line));m<=b;m++){var y=Q(c,m).text,w=f(y,l,o);l==g?i.push(new Aa(ae(m,w),ae(m,w))):y.length>w&&i.push(new Aa(ae(m,w),ae(m,f(y,g,o))))}i.length||i.push(new Aa(n,n)),Ci(c,zr(e,p.ranges.slice(0,h).concat(i),h),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var x,C=u,j=Fo(e,t,r.unit),O=C.anchor;le(j.anchor,O)>0?(x=j.head,O=he(C.from(),j.anchor)):(x=j.anchor,O=de(C.to(),j.head));var k=p.ranges.slice(0);k[h]=Ho(e,new Aa(pe(c,O),x)),Ci(c,zr(e,k,h),Ys)}}function o(t){var n=++y,a=kn(e,t,!0,"rectangle"==r.unit);if(a)if(0!=le(a,v)){e.curOp.focus=s(),i(a);var u=Un(l,c);(a.line>=u.to||a.line<u.from)&&setTimeout(br(e,function(){y==n&&o(t)}),150)}else{var d=t.clientY<b.top?-20:t.clientY>b.bottom?20:0;d&&setTimeout(br(e,function(){y==n&&(l.scroller.scrollTop+=d,o(t))}),50)}}function a(t){e.state.selectingText=!1,y=1/0,t&&(V(t),l.input.focus()),_(l.wrapper.ownerDocument,"mousemove",w),_(l.wrapper.ownerDocument,"mouseup",x),c.history.lastSelOrigin=null}var l=e.display,c=e.doc;V(t);var u,h,p=c.sel,g=p.ranges;if(r.addNew&&!r.extend?(h=c.sel.contains(n),u=h>-1?g[h]:new Aa(n,n)):(u=c.sel.primary(),h=c.sel.primIndex),"rectangle"==r.unit)r.addNew||(u=new Aa(n,n)),n=kn(e,t,!0,!0),h=-1;else{var m=Fo(e,n,r.unit);u=r.extend?gi(u,m.anchor,m.head,r.extend):m}r.addNew?h==-1?(h=g.length,Ci(c,zr(e,g.concat([u]),h),{scroll:!1,origin:"*mouse"})):g.length>1&&g[h].empty()&&"char"==r.unit&&!r.extend?(Ci(c,zr(e,g.slice(0,h).concat(g.slice(h+1)),0),{scroll:!1,origin:"*mouse"}),p=c.sel):bi(c,h,u,Ys):(h=0,Ci(c,new Ma([u],0),Ys),p=c.sel);var v=n,b=l.wrapper.getBoundingClientRect(),y=0,w=br(e,function(e){0!==e.buttons&&z(e)?o(e):a(e)}),x=br(e,a);e.state.selectingText=x,ra(l.wrapper.ownerDocument,"mousemove",w),ra(l.wrapper.ownerDocument,"mouseup",x)}function Ho(e,t){var n=t.anchor,r=t.head,i=Q(e.doc,n.line);if(0==le(n,r)&&n.sticky==r.sticky)return t;var o=P(i);if(!o)return t;var s=T(o,n.ch,n.sticky),a=o[s];if(a.from!=n.ch&&a.to!=n.ch)return t;var l=s+(a.from==n.ch==(1!=a.level)?0:1);if(0==l||l==o.length)return t;var c;if(r.line!=n.line)c=(r.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var u=T(o,r.ch,r.sticky),d=u-s||(r.ch-n.ch)*(1==a.level?-1:1);c=u==l-1||u==l?d<0:d>0}var h=o[l+(c?-1:0)],f=c==(1==h.level),p=f?h.from:h.to,g=f?"after":"before";return n.ch==p&&n.sticky==g?t:new Aa(new ae(n.line,p,g),r)}function zo(e,t,n,r){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(t){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&V(t);var s=e.display,a=s.lineDiv.getBoundingClientRect();if(o>a.bottom||!L(e,n))return F(t);o-=a.top-s.viewOffset;for(var l=0;l<e.display.gutterSpecs.length;++l){var c=s.gutters.childNodes[l];if(c&&c.getBoundingClientRect().right>=i){var u=ie(e.doc,o),d=e.display.gutterSpecs[l];return D(e,n,e,u,d.className,t),F(t)}}}function Bo(e,t){return zo(e,t,"gutterClick",!0)}function $o(e,t){Nt(e.display,t)||Wo(e,t)||M(e,t,"contextmenu")||Hs||e.display.input.onContextMenu(t)}function Wo(e,t){return!!L(e,"gutterContextMenu")&&zo(e,t,"gutterContextMenu",!1)}function Uo(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),tn(e)}function qo(e){function t(t,r,i,o){e.defaults[t]=r,i&&(n[t]=o?function(e,t,n){n!=el&&i(e,t,n)}:i)}var n=e.optionHandlers;e.defineOption=t,e.Init=el,t("value","",function(e,t){return e.setValue(t)},!0),t("mode",null,function(e,t){e.doc.modeOption=t,Kr(e)},!0),t("indentUnit",2,Kr,!0),t("indentWithTabs",!1),t("smartIndent",!0),t("tabSize",4,function(e){Yr(e),tn(e),Tn(e)},!0),t("lineSeparator",null,function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter(function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(o==-1)break;i=o+t.length,n.push(ae(r,o))}r++});for(var i=n.length-1;i>=0;i--)Fi(e.doc,t,n[i],ae(n[i].line,n[i].ch+t.length))}}),t("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=el&&e.refresh()}),t("specialCharPlaceholder",ct,function(e){return e.refresh()},!0),t("electricChars",!0),t("inputStyle",As?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),t("spellcheck",!1,function(e,t){return e.getInputField().spellcheck=t},!0),t("autocorrect",!1,function(e,t){return e.getInputField().autocorrect=t},!0),t("autocapitalize",!1,function(e,t){return e.getInputField().autocapitalize=t},!0),t("rtlMoveVisually",!Vs),t("wholeLineUpdateBefore",!0),t("theme","default",function(e){Uo(e),Vr(e)},!0),t("keyMap","default",function(e,t,n){var r=fo(t),i=n!=el&&fo(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)}),t("extraKeys",null),t("configureMouse",null),t("lineWrapping",!1,Ko,!0),t("gutters",[],function(e,t){e.display.gutterSpecs=Lr(t,e.options.lineNumbers),Vr(e)},!0),t("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?Cn(e.display)+"px":"0",e.refresh()},!0),t("coverGutterNextToScrollbar",!1,function(e){return sr(e)},!0),t("scrollbarStyle","native",function(e){lr(e),sr(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),t("lineNumbers",!1,function(e,t){e.display.gutterSpecs=Lr(e.options.gutters,t),Vr(e)},!0),t("firstLineNumber",1,Vr,!0),t("lineNumberFormatter",function(e){return e},Vr,!0),t("showCursorWhenSelecting",!1,An,!0),t("resetSelectionOnContextMenu",!0),t("lineWiseCopyCut",!0),t("pasteLinesPerSelection",!0),t("selectionsMayTouch",!1),t("readOnly",!1,function(e,t){"nocursor"==t&&(Bn(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)}),t("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),t("dragDrop",!0,Go),t("allowDropFileTypes",null),t("cursorBlinkRate",530),t("cursorScrollMargin",0),t("cursorHeight",1,An,!0),t("singleCursorHeightPerLine",!0,An,!0),t("workTime",100),t("workDelay",100),t("flattenSpans",!0,Yr,!0),t("addModeClass",!1,Yr,!0),t("pollInterval",100),t("undoDepth",200,function(e,t){return e.doc.history.undoDepth=t}),t("historyEventDelay",1250),t("viewportMargin",10,function(e){return e.refresh()},!0),t("maxHighlightLength",1e4,Yr,!0),t("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),t("tabindex",null,function(e,t){return e.display.input.getField().tabIndex=t||""}),t("autofocus",null),t("direction","ltr",function(e,t){return e.doc.setDirection(t)},!0),t("phrases",null)}function Go(e,t,n){var r=n&&n!=el;if(!t!=!r){var i=e.display.dragFunctions,o=t?ra:_;o(e.display.scroller,"dragstart",i.start),o(e.display.scroller,"dragenter",i.enter),o(e.display.scroller,"dragover",i.over),o(e.display.scroller,"dragleave",i.leave),o(e.display.scroller,"drop",i.drop)}}function Ko(e){e.options.lineWrapping?(a(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(zs(e.display.wrapper,"CodeMirror-wrap"),it(e)),On(e),Tn(e),tn(e),setTimeout(function(){return sr(e)},100)}function Yo(e,t){var n=this;if(!(this instanceof Yo))return new Yo(e,t);this.options=t=t?u(t):{},u(tl,t,!1);var r=t.value;"string"==typeof r?r=new Ra(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Yo.inputStyles[t.inputStyle](this),o=this.display=new Ir(e,r,i,t);o.wrapper.CodeMirror=this,Uo(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),lr(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new $s,keySeq:null,specialChars:null},t.autofocus&&!As&&o.input.focus(),Cs&&js<11&&setTimeout(function(){return n.display.input.reset(!0)},20),Xo(this),ro(),cr(this),this.curOp.forceUpdate=!0,Qr(this,r),t.autofocus&&!As||this.hasFocus()?setTimeout(c(zn,this),20):Bn(this);for(var s in nl)nl.hasOwnProperty(s)&&nl[s](n,t[s],el);Ar(this),t.finishInit&&t.finishInit(this);for(var a=0;a<rl.length;++a)rl[a](n);ur(this),Os&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}function Xo(e){function t(){i.activeTouch&&(o=setTimeout(function(){return i.activeTouch=null},1e3),s=i.activeTouch,s.end=+new Date)}function n(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function r(e,t){if(null==t.left)return!0;var n=t.left-e.left,r=t.top-e.top;return n*n+r*r>400}var i=e.display;ra(i.scroller,"mousedown",br(e,Ao)),Cs&&js<11?ra(i.scroller,"dblclick",br(e,function(t){if(!M(e,t)){var n=kn(e,t);if(n&&!Bo(e,t)&&!Nt(e.display,t)){V(t);var r=e.findWordAt(n);mi(e.doc,r.anchor,r.head)}}})):ra(i.scroller,"dblclick",function(t){return M(e,t)||V(t)}),ra(i.scroller,"contextmenu",function(t){return $o(e,t)});var o,s={end:0};ra(i.scroller,"touchstart",function(t){if(!M(e,t)&&!n(t)&&!Bo(e,t)){i.input.ensurePolled(),clearTimeout(o);var r=+new Date;i.activeTouch={start:r,moved:!1,prev:r-s.end<=300?s:null},1==t.touches.length&&(i.activeTouch.left=t.touches[0].pageX,i.activeTouch.top=t.touches[0].pageY)}}),ra(i.scroller,"touchmove",function(){i.activeTouch&&(i.activeTouch.moved=!0)}),ra(i.scroller,"touchend",function(n){var o=i.activeTouch;if(o&&!Nt(i,n)&&null!=o.left&&!o.moved&&new Date-o.start<300){var s,a=e.coordsChar(i.activeTouch,"page");s=!o.prev||r(o,o.prev)?new Aa(a,a):!o.prev.prev||r(o,o.prev.prev)?e.findWordAt(a):new Aa(ae(a.line,0),pe(e.doc,ae(a.line+1,0))),e.setSelection(s.anchor,s.head),e.focus(),V(n)}t()}),ra(i.scroller,"touchcancel",t),ra(i.scroller,"scroll",function(){i.scroller.clientHeight&&(nr(e,i.scroller.scrollTop),ir(e,i.scroller.scrollLeft,!0),D(e,"scroll",e))}),ra(i.scroller,"mousewheel",function(t){return Hr(e,t)}),ra(i.scroller,"DOMMouseScroll",function(t){return Hr(e,t)}),ra(i.wrapper,"scroll",function(){return i.wrapper.scrollTop=i.wrapper.scrollLeft=0}),i.dragFunctions={enter:function(t){M(e,t)||R(t)},over:function(t){M(e,t)||(eo(e,t),R(t))},start:function(t){return Qi(e,t)},drop:br(e,Zi),leave:function(t){M(e,t)||to(e)}};var a=i.input.getField();ra(a,"keyup",function(t){return _o.call(e,t)}),ra(a,"keydown",br(e,Po)),ra(a,"keypress",br(e,Do)),ra(a,"focus",function(t){return zn(e,t)}),ra(a,"blur",function(t){return Bn(e,t)})}function Jo(e,t,n,r){var i,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=ye(e,t).state:n="prev");var s=e.options.tabSize,a=Q(o,t),l=d(a.text,null,s);a.stateAfter&&(a.stateAfter=null);var c,u=a.text.match(/^\s*/)[0];if(r||/\S/.test(a.text)){if("smart"==n&&(c=o.mode.indent(i,a.text.slice(u.length),a.text),c==Gs||c>150)){if(!r)return;n="prev"}}else c=0,n="not";"prev"==n?c=t>o.first?d(Q(o,t-1).text,null,s):0:"add"==n?c=l+e.options.indentUnit:"subtract"==n?c=l-e.options.indentUnit:"number"==typeof n&&(c=l+n),c=Math.max(0,c);var h="",f=0;if(e.options.indentWithTabs)for(var g=Math.floor(c/s);g;--g)f+=s,h+="\t";if(f<c&&(h+=p(c-f)),h!=u)return Fi(o,h,ae(t,0),ae(t,u.length),"+input"),a.stateAfter=null,!0;for(var m=0;m<o.sel.ranges.length;m++){var v=o.sel.ranges[m];if(v.head.line==t&&v.head.ch<u.length){var b=ae(t,u.length);bi(o,m,new Aa(b,b));break}}}function Zo(e){il=e}function Qo(e,t,n,r,i){var o=e.doc;e.display.shift=!1,r||(r=o.sel);var s=+new Date-200,a="paste"==i||e.state.pasteIncoming>s,l=oa(t),c=null;if(a&&r.ranges.length>1)if(il&&il.text.join("\n")==t){if(r.ranges.length%il.text.length==0){c=[];for(var u=0;u<il.text.length;u++)c.push(o.splitLines(il.text[u]))}}else l.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(c=m(l,function(e){return[e]}));for(var d=e.curOp.updateInput,h=r.ranges.length-1;h>=0;h--){var f=r.ranges[h],p=f.from(),v=f.to();f.empty()&&(n&&n>0?p=ae(p.line,p.ch-n):e.state.overwrite&&!a?v=ae(v.line,Math.min(Q(o,v.line).text.length,v.ch+g(l).length)):a&&il&&il.lineWise&&il.text.join("\n")==t&&(p=v=ae(p.line,0)));var b={from:p,to:v,text:c?c[h%c.length]:l,origin:i||(a?"paste":e.state.cutIncoming>s?"cut":"+input")};Mi(e.doc,b),wt(e,"inputRead",e,b)}t&&!a&&ts(e,t),Jn(e),e.curOp.updateInput<2&&(e.curOp.updateInput=d),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function es(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||vr(t,function(){return Qo(t,n,0,null,"paste")}),!0}function ts(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),s=!1;if(o.electricChars){for(var a=0;a<o.electricChars.length;a++)if(t.indexOf(o.electricChars.charAt(a))>-1){s=Jo(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Q(e.doc,i.head.line).text.slice(0,i.head.ch))&&(s=Jo(e,i.head.line,"smart"));s&&wt(e,"electricInput",e,i.head.line)}}}function ns(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,o={anchor:ae(i,0),head:ae(i+1,0)};n.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:n}}function rs(e,t,n,r){e.setAttribute("autocorrect",n?"":"off"),e.setAttribute("autocapitalize",r?"":"off"),e.setAttribute("spellcheck",!!t)}function is(){var e=r("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=r("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return Os?e.style.width="1000px":e.setAttribute("wrap","off"),Ds&&(e.style.border="1px solid black"),rs(e),t}function os(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,n){var r=this.options,i=r[e];r[e]==n&&"mode"!=e||(r[e]=n,t.hasOwnProperty(e)&&br(this,t[e])(this,n,i),D(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](fo(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;n<t.length;++n)if(t[n]==e||t[n].name==e)return t.splice(n,1),!0},addOverlay:yr(function(t,n){var r=t.token?t:e.getMode(this.options,t);if(r.startState)throw new Error("Overlays may not be stateful.");v(this.state.overlays,{mode:r,modeSpec:t,opaque:n&&n.opaque,priority:n&&n.priority||0},function(e){return e.priority}),this.state.modeGen++,Tn(this)}),removeOverlay:yr(function(e){for(var t=this,n=this.state.overlays,r=0;r<n.length;++r){var i=n[r].modeSpec;if(i==e||"string"==typeof e&&i.name==e)return n.splice(r,1),t.state.modeGen++,void Tn(t)}}),indentLine:yr(function(e,t,n){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),oe(this.doc,e)&&Jo(this,e,t,n)}),indentSelection:yr(function(e){for(var t=this,n=this.doc.sel.ranges,r=-1,i=0;i<n.length;i++){var o=n[i];if(o.empty())o.head.line>r&&(Jo(t,o.head.line,e,!0),r=o.head.line,i==t.doc.sel.primIndex&&Jn(t));else{var s=o.from(),a=o.to(),l=Math.max(r,s.line);r=Math.min(t.lastLine(),a.line-(a.ch?0:1))+1;for(var c=l;c<r;++c)Jo(t,c,e);var u=t.doc.sel.ranges;0==s.ch&&n.length==u.length&&u[i].from().ch>0&&bi(t.doc,i,new Aa(s,u[i].to()),Ks)}}}),getTokenAt:function(e,t){return je(this,e,t)},getLineTokens:function(e,t){return je(this,ae(e),t,!0)},getTokenTypeAt:function(e){e=pe(this.doc,e);var t,n=be(this,Q(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var s=r+i>>1;if((s?n[2*s-1]:0)>=o)i=s;else{if(!(n[2*s+1]<o)){t=n[2*s+2];break}r=s+1}}var a=t?t.indexOf("overlay "):-1;return a<0?t:0==a?null:t.slice(0,a-1)},getModeAt:function(t){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var r=this,i=[];if(!n.hasOwnProperty(t))return i;var o=n[t],s=this.getModeAt(e);if("string"==typeof s[t])o[s[t]]&&i.push(o[s[t]]);else if(s[t])for(var a=0;a<s[t].length;a++){var l=o[s[t][a]];l&&i.push(l)}else s.helperType&&o[s.helperType]?i.push(o[s.helperType]):o[s.name]&&i.push(o[s.name]);for(var c=0;c<o._global.length;c++){var u=o._global[c];u.pred(s,r)&&h(i,u.val)==-1&&i.push(u.val)}return i},getStateAfter:function(e,t){var n=this.doc;return e=fe(n,null==e?n.first+n.size-1:e),ye(this,e+1,t).state},cursorCoords:function(e,t){var n,r=this.doc.sel.primary();return n=null==e?r.head:"object"==typeof e?pe(this.doc,e):e?r.from():r.to(),cn(this,n,t||"page")},charCoords:function(e,t){return ln(this,pe(this.doc,e),t||"page")},coordsChar:function(e,t){return e=an(this,e,t||"page"),hn(this,e.left,e.top)},lineAtHeight:function(e,t){return e=an(this,{top:e,left:0},t||"page").top,ie(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,n){var r,i=!1;if("number"==typeof e){var o=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>o&&(e=o,i=!0),r=Q(this.doc,e)}else r=e;return sn(this,r,{top:0,left:0},t||"page",n||i).top+(i?this.doc.height-nt(r):0)},defaultTextHeight:function(){return yn(this.display)},defaultCharWidth:function(){return wn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o=this.display;e=cn(this,pe(this.doc,e));var s=e.bottom,a=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==r)s=e.top;else if("above"==r||"near"==r){var l=Math.max(o.wrapper.clientHeight,this.doc.height),c=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>l)&&e.top>t.offsetHeight?s=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=l&&(s=e.bottom),a+t.offsetWidth>c&&(a=c-t.offsetWidth)}t.style.top=s+"px",t.style.left=t.style.right="","right"==i?(a=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?a=0:"middle"==i&&(a=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=a+"px"),n&&Kn(this,{left:a,top:s,right:a+t.offsetWidth,bottom:s+t.offsetHeight})},triggerOnKeyDown:yr(Po),triggerOnKeyPress:yr(Do),triggerOnKeyUp:_o,triggerOnMouseDown:yr(Ao),execCommand:function(e){if(Ga.hasOwnProperty(e))return Ga[e].call(null,this)},triggerElectric:yr(function(e){ts(this,e)}),findPosH:function(e,t,n,r){var i=this,o=1;t<0&&(o=-1,t=-t);for(var s=pe(this.doc,e),a=0;a<t&&(s=ss(i.doc,s,o,n,r),!s.hitSide);++a);return s},moveH:yr(function(e,t){var n=this;this.extendSelectionsBy(function(r){return n.display.shift||n.doc.extend||r.empty()?ss(n.doc,r.head,e,t,n.options.rtlMoveVisually):e<0?r.from():r.to()},Xs)}),deleteH:yr(function(e,t){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):po(this,function(n){var i=ss(r,n.head,e,t,!1);return e<0?{from:i,to:n.head}:{from:n.head,to:i}})}),findPosV:function(e,t,n,r){var i=this,o=1,s=r;t<0&&(o=-1,t=-t);for(var a=pe(this.doc,e),l=0;l<t;++l){var c=cn(i,a,"div");if(null==s?s=c.left:c.left=s,a=as(i,c,o,n),a.hitSide)break}return a},moveV:yr(function(e,t){var n=this,r=this.doc,i=[],o=!this.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy(function(s){if(o)return e<0?s.from():s.to();var a=cn(n,s.head,"div");null!=s.goalColumn&&(a.left=s.goalColumn),i.push(a.left);var l=as(n,a,e,t);return"page"==t&&s==r.sel.primary()&&Xn(n,ln(n,l,"div").top-a.top),l},Xs),i.length)for(var s=0;s<r.sel.ranges.length;s++)r.sel.ranges[s].goalColumn=i[s]}),findWordAt:function(e){var t=this.doc,n=Q(t,e.line).text,r=e.ch,i=e.ch;
|
||
if(n){var o=this.getHelper(e,"wordChars");"before"!=e.sticky&&i!=n.length||!r?++i:--r;for(var s=n.charAt(r),a=x(s,o)?function(e){return x(e,o)}:/\s/.test(s)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!x(e)};r>0&&a(n.charAt(r-1));)--r;for(;i<n.length&&a(n.charAt(i));)++i}return new Aa(ae(e.line,r),ae(e.line,i))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?a(this.display.cursorDiv,"CodeMirror-overwrite"):zs(this.display.cursorDiv,"CodeMirror-overwrite"),D(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==s()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:yr(function(e,t){Zn(this,e,t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Rt(this)-this.display.barHeight,width:e.scrollWidth-Rt(this)-this.display.barWidth,clientHeight:zt(this),clientWidth:Ht(this)}},scrollIntoView:yr(function(e,t){null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:ae(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line?Qn(this,e):tr(this,e.from,e.to,e.margin)}),setSize:yr(function(e,t){var n=this,r=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=r(e)),null!=t&&(this.display.wrapper.style.height=r(t)),this.options.lineWrapping&&en(this);var i=this.display.viewFrom;this.doc.iter(i,this.display.viewTo,function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){Pn(n,i,"widget");break}++i}),this.curOp.forceUpdate=!0,D(this,"refresh",this)}),operation:function(e){return vr(this,e)},startOperation:function(){return cr(this)},endOperation:function(){return ur(this)},refresh:yr(function(){var e=this.display.cachedTextHeight;Tn(this),this.curOp.forceUpdate=!0,tn(this),Zn(this,this.doc.scrollLeft,this.doc.scrollTop),_r(this.display),(null==e||Math.abs(e-yn(this.display))>.5)&&On(this),D(this,"refresh",this)}),swapDoc:yr(function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),Qr(this,e),tn(this),this.display.input.reset(),Zn(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,wt(this,"swapDoc",this,t),t}),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},N(e),e.registerHelper=function(t,r,i){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=i},e.registerGlobalHelper=function(t,r,i,o){e.registerHelper(t,r,o),n[t]._global.push({pred:i,val:o})}}function ss(e,t,n,r,i){function o(){var r=t.line+n;return!(r<e.first||r>=e.first+e.size)&&(t=new ae(r,t.ch,t.sticky),c=Q(e,r))}function s(r){var s;if(s=i?bo(e.cm,c,t,n):mo(c,t,n),null==s){if(r||!o())return!1;t=vo(i,e.cm,c,t.line,n)}else t=s;return!0}var a=t,l=n,c=Q(e,t.line);if("char"==r)s();else if("column"==r)s(!0);else if("word"==r||"group"==r)for(var u=null,d="group"==r,h=e.cm&&e.cm.getHelper(t,"wordChars"),f=!0;!(n<0)||s(!f);f=!1){var p=c.text.charAt(t.ch)||"\n",g=x(p,h)?"w":d&&"\n"==p?"n":!d||/\s/.test(p)?null:"p";if(!d||f||g||(g="s"),u&&u!=g){n<0&&(n=1,s(),t.sticky="after");break}if(g&&(u=g),n>0&&!s(!f))break}var m=Pi(e,t,a,l,!0);return ce(a,m)&&(m.hitSide=!0),m}function as(e,t,n,r){var i,o=e.doc,s=t.left;if("page"==r){var a=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),l=Math.max(a-.5*yn(e.display),3);i=(n>0?t.bottom:t.top)+n*l}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(var c;c=hn(e,s,i),c.outside;){if(n<0?i<=0:i>=o.height){c.hitSide=!0;break}i+=5*n}return c}function ls(e,t){var n=qt(e,t.line);if(!n||n.hidden)return null;var r=Q(e.doc,t.line),i=$t(n,r,t.line),o=P(r,e.doc.direction),s="left";if(o){var a=T(o,t.ch);s=a%2?"right":"left"}var l=Yt(i.map,t.ch,s);return l.offset="right"==l.collapse?l.end:l.start,l}function cs(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function us(e,t){return t&&(e.bad=!0),e}function ds(e,t,n,r,i){function o(e){return function(t){return t.id==e}}function s(){u&&(c+=d,h&&(c+=d),u=h=!1)}function a(e){e&&(s(),c+=e)}function l(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void a(n);var c,f=t.getAttribute("cm-marker");if(f){var p=e.findMarks(ae(r,0),ae(i+1,0),o(+f));return void(p.length&&(c=p[0].find(0))&&a(ee(e.doc,c.from,c.to).join(d)))}if("false"==t.getAttribute("contenteditable"))return;var g=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;g&&s();for(var m=0;m<t.childNodes.length;m++)l(t.childNodes[m]);/^(pre|p)$/i.test(t.nodeName)&&(h=!0),g&&(u=!0)}else 3==t.nodeType&&a(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(var c="",u=!1,d=e.doc.lineSeparator(),h=!1;l(t),t!=n;)t=t.nextSibling,h=!1;return c}function hs(e,t,n){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[n],!r)return us(e.clipPos(ae(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==r)return fs(o,t,n)}}function fs(e,t,n){function r(t,n,r){for(var i=-1;i<(d?d.length:0);i++)for(var o=i<0?u.map:d[i],s=0;s<o.length;s+=3){var a=o[s+2];if(a==t||a==n){var l=re(i<0?e.line:e.rest[i]),c=o[s]+r;return(r<0||a!=t)&&(c=o[s+(r?1:0)]),ae(l,c)}}}var i=e.text.firstChild,s=!1;if(!t||!o(i,t))return us(ae(re(e.line),0),!0);if(t==i&&(s=!0,t=i.childNodes[n],n=0,!t)){var a=e.rest?g(e.rest):e.line;return us(ae(re(a),a.text.length),s)}var l=3==t.nodeType?t:null,c=t;for(l||1!=t.childNodes.length||3!=t.firstChild.nodeType||(l=t.firstChild,n&&(n=l.nodeValue.length));c.parentNode!=i;)c=c.parentNode;var u=e.measure,d=u.maps,h=r(l,c,n);if(h)return us(h,s);for(var f=c.nextSibling,p=l?l.nodeValue.length-n:0;f;f=f.nextSibling){if(h=r(f,f.firstChild,0))return us(ae(h.line,h.ch-p),s);p+=f.textContent.length}for(var m=c.previousSibling,v=n;m;m=m.previousSibling){if(h=r(m,m.firstChild,-1))return us(ae(h.line,h.ch+v),s);v+=m.textContent.length}}function ps(e,t){function n(){e.value=c.getValue()}if(t=t?u(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var r=s();t.autofocus=r==e||null!=e.getAttribute("autofocus")&&r==document.body}var i;if(e.form&&(ra(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var a=o.submit=function(){n(),o.submit=i,o.submit(),o.submit=a}}catch(l){}}t.finishInit=function(r){r.save=n,r.getTextArea=function(){return e},r.toTextArea=function(){r.toTextArea=isNaN,n(),e.parentNode.removeChild(r.getWrapperElement()),e.style.display="",e.form&&(_(e.form,"submit",n),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=i))}},e.style.display="none";var c=Yo(function(t){return e.parentNode.insertBefore(t,e.nextSibling)},t);return c}function gs(e){e.off=_,e.on=ra,e.wheelEventPixels=Rr,e.Doc=Ra,e.splitLines=oa,e.countColumn=d,e.findColumn=f,e.isWordChar=w,e.Pass=Gs,e.signal=D,e.Line=ba,e.changeEnd=$r,e.scrollbarModel=Ta,e.Pos=ae,e.cmpPos=le,e.modes=ca,e.mimeModes=ua,e.resolveMode=G,e.getMode=K,e.modeExtensions=da,e.extendMode=Y,e.copyState=X,e.startState=Z,e.innerMode=J,e.commands=Ga,e.keyMap=qa,e.keyName=ho,e.isModifierKey=co,e.lookupKey=lo,e.normalizeKeyMap=ao,e.StringStream=ha,e.SharedTextMarker=Ia,e.TextMarker=Va,e.LineWidget=La,e.e_preventDefault=V,e.e_stopPropagation=I,e.e_stop=R,e.addClass=a,e.contains=o,e.rmClass=zs,e.keyNames=Ba}var ms=navigator.userAgent,vs=navigator.platform,bs=/gecko\/\d/i.test(ms),ys=/MSIE \d/.test(ms),ws=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ms),xs=/Edge\/(\d+)/.exec(ms),Cs=ys||ws||xs,js=Cs&&(ys?document.documentMode||6:+(xs||ws)[1]),Os=!xs&&/WebKit\//.test(ms),ks=Os&&/Qt\/\d+\.\d+/.test(ms),Ss=!xs&&/Chrome\//.test(ms),Ts=/Opera\//.test(ms),Ps=/Apple Computer/.test(navigator.vendor),Es=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ms),_s=/PhantomJS/.test(ms),Ds=!xs&&/AppleWebKit/.test(ms)&&/Mobile\/\w+/.test(ms),Ms=/Android/.test(ms),As=Ds||Ms||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ms),Ls=Ds||/Mac/.test(vs),Ns=/\bCrOS\b/.test(ms),Vs=/win/i.test(vs),Is=Ts&&ms.match(/Version\/(\d*\.\d*)/);Is&&(Is=Number(Is[1])),Is&&Is>=15&&(Ts=!1,Os=!0);var Fs,Rs=Ls&&(ks||Ts&&(null==Is||Is<12.11)),Hs=bs||Cs&&js>=9,zs=function(t,n){var r=t.className,i=e(n).exec(r);if(i){var o=r.slice(i.index+i[0].length);t.className=r.slice(0,i.index)+(o?i[1]+o:"")}};Fs=document.createRange?function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(i){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};var Bs=function(e){e.select()};Ds?Bs=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:Cs&&(Bs=function(e){try{e.select()}catch(t){}});var $s=function(){this.id=null,this.f=null,this.time=0,this.handler=c(this.onTimeout,this)};$s.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},$s.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};var Ws,Us,qs=30,Gs={toString:function(){return"CodeMirror.Pass"}},Ks={scroll:!1},Ys={origin:"*mouse"},Xs={origin:"+move"},Js=[""],Zs=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Qs=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/,ea=null,ta=function(){function e(e){return e<=247?n.charAt(e):1424<=e&&e<=1524?"R":1536<=e&&e<=1785?r.charAt(e-1536):1774<=e&&e<=2220?"r":8192<=e&&e<=8203?"w":8204==e?"b":"L"}function t(e,t,n){this.level=e,this.from=t,this.to=n}var n="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",r="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111",i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,s=/[LRr]/,a=/[Lb1n]/,l=/[1n]/;return function(n,r){var c="ltr"==r?"L":"R";if(0==n.length||"ltr"==r&&!i.test(n))return!1;for(var u=n.length,d=[],h=0;h<u;++h)d.push(e(n.charCodeAt(h)));for(var f=0,p=c;f<u;++f){var m=d[f];"m"==m?d[f]=p:p=m}for(var v=0,b=c;v<u;++v){var y=d[v];"1"==y&&"r"==b?d[v]="n":s.test(y)&&(b=y,"r"==y&&(d[v]="R"))}for(var w=1,x=d[0];w<u-1;++w){var C=d[w];"+"==C&&"1"==x&&"1"==d[w+1]?d[w]="1":","!=C||x!=d[w+1]||"1"!=x&&"n"!=x||(d[w]=x),x=C}for(var j=0;j<u;++j){var O=d[j];if(","==O)d[j]="N";else if("%"==O){var k=void 0;for(k=j+1;k<u&&"%"==d[k];++k);for(var S=j&&"!"==d[j-1]||k<u&&"1"==d[k]?"1":"N",T=j;T<k;++T)d[T]=S;j=k-1}}for(var P=0,E=c;P<u;++P){var _=d[P];"L"==E&&"1"==_?d[P]="L":s.test(_)&&(E=_)}for(var D=0;D<u;++D)if(o.test(d[D])){var M=void 0;for(M=D+1;M<u&&o.test(d[M]);++M);for(var A="L"==(D?d[D-1]:c),L="L"==(M<u?d[M]:c),N=A==L?A?"L":"R":c,V=D;V<M;++V)d[V]=N;D=M-1}for(var I,F=[],R=0;R<u;)if(a.test(d[R])){var H=R;for(++R;R<u&&a.test(d[R]);++R);F.push(new t(0,H,R))}else{var z=R,B=F.length;for(++R;R<u&&"L"!=d[R];++R);for(var $=z;$<R;)if(l.test(d[$])){z<$&&F.splice(B,0,new t(1,z,$));var W=$;for(++$;$<R&&l.test(d[$]);++$);F.splice(B,0,new t(2,W,$)),z=$}else++$;z<R&&F.splice(B,0,new t(1,z,R))}return"ltr"==r&&(1==F[0].level&&(I=n.match(/^\s+/))&&(F[0].from=I[0].length,F.unshift(new t(0,0,I[0].length))),1==g(F).level&&(I=n.match(/\s+$/))&&(g(F).to-=I[0].length,F.push(new t(0,u-I[0].length,u)))),"rtl"==r?F.reverse():F}}(),na=[],ra=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||na).concat(n)}},ia=function(){if(Cs&&js<9)return!1;var e=r("div");return"draggable"in e||"dragDrop"in e}(),oa=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf("\n",t);i==-1&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),s=o.indexOf("\r");s!=-1?(n.push(o.slice(0,s)),t+=s+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},sa=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(n){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},aa=function(){var e=r("div");return"oncopy"in e||(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),la=null,ca={},ua={},da={},ha=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};ha.prototype.eol=function(){return this.pos>=this.string.length},ha.prototype.sol=function(){return this.pos==this.lineStart},ha.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},ha.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},ha.prototype.eat=function(e){var t,n=this.string.charAt(this.pos);if(t="string"==typeof e?n==e:n&&(e.test?e.test(n):e(n)))return++this.pos,n},ha.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},ha.prototype.eatSpace=function(){for(var e=this,t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++e.pos;return this.pos>t},ha.prototype.skipToEnd=function(){this.pos=this.string.length},ha.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},ha.prototype.backUp=function(e){this.pos-=e},ha.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=d(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?d(this.string,this.lineStart,this.tabSize):0)},ha.prototype.indentation=function(){return d(this.string,null,this.tabSize)-(this.lineStart?d(this.string,this.lineStart,this.tabSize):0)},ha.prototype.match=function(e,t,n){if("string"!=typeof e){var r=this.string.slice(this.pos).match(e);return r&&r.index>0?null:(r&&t!==!1&&(this.pos+=r[0].length),r)}var i=function(e){return n?e.toLowerCase():e},o=this.string.substr(this.pos,e.length);if(i(o)==i(e))return t!==!1&&(this.pos+=e.length),!0},ha.prototype.current=function(){return this.string.slice(this.start,this.pos)},ha.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},ha.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},ha.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var fa=function(e,t){this.state=e,this.lookAhead=t},pa=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};pa.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},pa.prototype.baseToken=function(e){var t=this;if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)t.baseTokenPos+=2;var n=this.baseTokens[this.baseTokenPos+1];return{type:n&&n.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},pa.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},pa.fromSaved=function(e,t,n){return t instanceof fa?new pa(e,X(e.mode,t.state),n,t.lookAhead):new pa(e,X(e.mode,t),n)},pa.prototype.save=function(e){var t=e!==!1?X(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new fa(t,this.maxLookAhead):t};var ga=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n},ma=!1,va=!1,ba=function(e,t,n){this.text=e,He(this,t),this.height=n?n(this):1};ba.prototype.lineNo=function(){return re(this)},N(ba);var ya,wa={},xa={},Ca=null,ja=null,Oa={left:0,right:0,top:0,bottom:0},ka=function(e,t,n){this.cm=n;var i=this.vert=r("div",[r("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),o=this.horiz=r("div",[r("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");i.tabIndex=o.tabIndex=-1,e(i),e(o),ra(i,"scroll",function(){i.clientHeight&&t(i.scrollTop,"vertical")}),ra(o,"scroll",function(){o.clientWidth&&t(o.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,Cs&&js<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};ka.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},ka.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},ka.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},ka.prototype.zeroWidthHack=function(){var e=Ls&&!Es?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new $s,this.disableVert=new $s},ka.prototype.enableZeroWidthBar=function(e,t,n){function r(){var i=e.getBoundingClientRect(),o="vert"==n?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1);o!=e?e.style.pointerEvents="none":t.set(1e3,r)}e.style.pointerEvents="auto",t.set(1e3,r)},ka.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Sa=function(){};Sa.prototype.update=function(){return{bottom:0,right:0}},Sa.prototype.setScrollLeft=function(){},Sa.prototype.setScrollTop=function(){},Sa.prototype.clear=function(){};var Ta={"native":ka,"null":Sa},Pa=0,Ea=function(e,t,n){var r=e.display;this.viewport=t,this.visible=Un(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=Ht(e),this.force=n,this.dims=xn(e),this.events=[]};Ea.prototype.signal=function(e,t){L(e,t)&&this.events.push(arguments)},Ea.prototype.finish=function(){for(var e=this,t=0;t<this.events.length;t++)D.apply(null,e.events[t])};var _a=0,Da=null;Cs?Da=-.53:bs?Da=15:Ss?Da=-.7:Ps&&(Da=-1/3);var Ma=function(e,t){this.ranges=e,this.primIndex=t};Ma.prototype.primary=function(){return this.ranges[this.primIndex]},Ma.prototype.equals=function(e){var t=this;if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var n=0;n<this.ranges.length;n++){var r=t.ranges[n],i=e.ranges[n];if(!ce(r.anchor,i.anchor)||!ce(r.head,i.head))return!1}return!0},Ma.prototype.deepCopy=function(){for(var e=this,t=[],n=0;n<this.ranges.length;n++)t[n]=new Aa(ue(e.ranges[n].anchor),ue(e.ranges[n].head));return new Ma(t,this.primIndex)},Ma.prototype.somethingSelected=function(){for(var e=this,t=0;t<this.ranges.length;t++)if(!e.ranges[t].empty())return!0;return!1},Ma.prototype.contains=function(e,t){var n=this;t||(t=e);for(var r=0;r<this.ranges.length;r++){var i=n.ranges[r];if(le(t,i.from())>=0&&le(e,i.to())<=0)return r}return-1};var Aa=function(e,t){this.anchor=e,this.head=t};Aa.prototype.from=function(){return he(this.anchor,this.head)},Aa.prototype.to=function(){return de(this.anchor,this.head)},Aa.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},$i.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=this,r=e,i=e+t;r<i;++r){var o=n.lines[r];n.height-=o.height,st(o),wt(o,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){var r=this;this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var i=0;i<t.length;++i)t[i].parent=r},iterN:function(e,t,n){for(var r=this,i=e+t;e<i;++e)if(n(r.lines[e]))return!0}},Wi.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){var n=this;this.size-=t;for(var r=0;r<this.children.length;++r){var i=n.children[r],o=i.chunkSize();if(e<o){var s=Math.min(t,o-e),a=i.height;if(i.removeInner(e,s),n.height-=a-i.height,o==s&&(n.children.splice(r--,1),i.parent=null),0==(t-=s))break;e=0}else e-=o}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof $i))){var l=[];this.collapse(l),this.children=[new $i(l)],this.children[0].parent=this}},collapse:function(e){for(var t=this,n=0;n<this.children.length;++n)t.children[n].collapse(e)},insertInner:function(e,t,n){var r=this;this.size+=t.length,this.height+=n;for(var i=0;i<this.children.length;++i){var o=r.children[i],s=o.chunkSize();if(e<=s){if(o.insertInner(e,t,n),o.lines&&o.lines.length>50){for(var a=o.lines.length%25+25,l=a;l<o.lines.length;){var c=new $i(o.lines.slice(l,l+=25));o.height-=c.height,r.children.splice(++i,0,c),c.parent=r}o.lines=o.lines.slice(0,a),r.maybeSpill()}break}e-=s}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new Wi(t);if(e.parent){e.size-=n.size,e.height-=n.height;var r=h(e.parent.children,e);e.parent.children.splice(r+1,0,n)}else{var i=new Wi(e.children);i.parent=e,e.children=[i,n],e=i}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=this,i=0;i<this.children.length;++i){var o=r.children[i],s=o.chunkSize();if(e<s){var a=Math.min(t,s-e);if(o.iterN(e,a,n))return!0;if(0==(t-=a))break;e=0}else e-=s}}};var La=function(e,t,n){var r=this;if(n)for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i]);this.doc=e,this.node=t};La.prototype.clear=function(){var e=this,t=this.doc.cm,n=this.line.widgets,r=this.line,i=re(r);if(null!=i&&n){for(var o=0;o<n.length;++o)n[o]==e&&n.splice(o--,1);n.length||(r.widgets=null);var s=Lt(this);ne(r,Math.max(0,r.height-s)),t&&(vr(t,function(){Ui(t,r,-s),Pn(t,i,"widget")}),wt(t,"lineWidgetCleared",t,this,i))}},La.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=Lt(this)-t;i&&(et(this.doc,r)||ne(r,r.height+i),n&&vr(n,function(){n.curOp.forceUpdate=!0,Ui(n,r,i),wt(n,"lineWidgetChanged",n,e,re(r))}))},N(La);var Na=0,Va=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Na};Va.prototype.clear=function(){var e=this;if(!this.explicitlyCleared){var t=this.doc.cm,n=t&&!t.curOp;if(n&&cr(t),L(this,"clear")){var r=this.find();r&&wt(this,"clear",r.from,r.to)}for(var i=null,o=null,s=0;s<this.lines.length;++s){var a=e.lines[s],l=De(a.markedSpans,e);t&&!e.collapsed?Pn(t,re(a),"text"):t&&(null!=l.to&&(o=re(a)),null!=l.from&&(i=re(a))),a.markedSpans=Me(a.markedSpans,l),null==l.from&&e.collapsed&&!et(e.doc,a)&&t&&ne(a,yn(t.display))}if(t&&this.collapsed&&!t.options.lineWrapping)for(var c=0;c<this.lines.length;++c){var u=Ye(e.lines[c]),d=rt(u);d>t.display.maxLineLength&&(t.display.maxLine=u,t.display.maxLineLength=d,t.display.maxLineChanged=!0)}null!=i&&t&&this.collapsed&&Tn(t,i,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&ki(t.doc)),t&&wt(t,"markerCleared",t,this,i,o),n&&ur(t),this.parent&&this.parent.clear()}},Va.prototype.find=function(e,t){var n=this;null==e&&"bookmark"==this.type&&(e=1);for(var r,i,o=0;o<this.lines.length;++o){var s=n.lines[o],a=De(s.markedSpans,n);if(null!=a.from&&(r=ae(t?s:re(s),a.from),e==-1))return r;if(null!=a.to&&(i=ae(t?s:re(s),a.to),1==e))return i}return r&&{from:r,to:i}},Va.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;t&&r&&vr(r,function(){var i=t.line,o=re(t.line),s=qt(r,o);if(s&&(Qt(s),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!et(n.doc,i)&&null!=n.height){var a=n.height;n.height=null;var l=Lt(n)-a;l&&ne(i,i.height+l)}wt(r,"markerChanged",r,e)})},Va.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&h(t.maybeHiddenMarkers,this)!=-1||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Va.prototype.detachLine=function(e){if(this.lines.splice(h(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},N(Va);var Ia=function(e,t){var n=this;this.markers=e,this.primary=t;for(var r=0;r<e.length;++r)e[r].parent=n};Ia.prototype.clear=function(){var e=this;if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var t=0;t<this.markers.length;++t)e.markers[t].clear();wt(this,"clear")}},Ia.prototype.find=function(e,t){return this.primary.find(e,t)},N(Ia);var Fa=0,Ra=function(e,t,n,r,i){if(!(this instanceof Ra))return new Ra(e,t,n,r,i);null==n&&(n=0),Wi.call(this,[new $i([new ba("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var o=ae(n,0);this.sel=Br(o),this.history=new ni(null),this.id=++Fa,this.modeOption=t,this.lineSep=r,this.direction="rtl"==i?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Jr(this,{from:o,to:o,text:e}),Ci(this,Br(o),Ks)};Ra.prototype=y(Wi.prototype,{constructor:Ra,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=te(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:wr(function(e){var t=ae(this.first,0),n=this.first+this.size-1;Mi(this,{from:t,to:ae(n,Q(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Zn(this.cm,0,0),Ci(this,Br(t),Ks)}),replaceRange:function(e,t,n,r){t=pe(this,t),n=n?pe(this,n):t,Fi(this,e,t,n,r)},getRange:function(e,t,n){var r=ee(this,pe(this,e),pe(this,t));return n===!1?r:r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(oe(this,e))return Q(this,e)},getLineNumber:function(e){return re(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=Q(this,e)),Ye(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return pe(this,e)},getCursor:function(e){var t,n=this.sel.primary();return t=null==e||"head"==e?n.head:"anchor"==e?n.anchor:"end"==e||"to"==e||e===!1?n.to():n.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:wr(function(e,t,n){yi(this,pe(this,"number"==typeof e?ae(e,t||0):e),null,n)}),setSelection:wr(function(e,t,n){yi(this,pe(this,e),pe(this,t||e),n)}),extendSelection:wr(function(e,t,n){mi(this,pe(this,e),t&&pe(this,t),n)}),extendSelections:wr(function(e,t){vi(this,me(this,e),t)}),extendSelectionsBy:wr(function(e,t){var n=m(this.sel.ranges,e);vi(this,me(this,n),t)}),setSelections:wr(function(e,t,n){var r=this;if(e.length){for(var i=[],o=0;o<e.length;o++)i[o]=new Aa(pe(r,e[o].anchor),pe(r,e[o].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),Ci(this,zr(this.cm,i,t),n)}}),addSelection:wr(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new Aa(pe(this,e),pe(this,t||e))),Ci(this,zr(this.cm,r,r.length-1),n)}),getSelection:function(e){for(var t,n=this,r=this.sel.ranges,i=0;i<r.length;i++){var o=ee(n,r[i].from(),r[i].to());t=t?t.concat(o):o}return e===!1?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=this,n=[],r=this.sel.ranges,i=0;i<r.length;i++){var o=ee(t,r[i].from(),r[i].to());e!==!1&&(o=o.join(e||t.lineSeparator())),n[i]=o}return n},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:wr(function(e,t,n){for(var r=this,i=[],o=this.sel,s=0;s<o.ranges.length;s++){var a=o.ranges[s];i[s]={from:a.from(),to:a.to(),text:r.splitLines(e[s]),origin:n}}for(var l=t&&"end"!=t&&Gr(this,i,t),c=i.length-1;c>=0;c--)Mi(r,i[c]);l?xi(this,l):this.cm&&Jn(this.cm)}),undo:wr(function(){Li(this,"undo")}),redo:wr(function(){Li(this,"redo")}),undoSelection:wr(function(){Li(this,"undo",!0)}),redoSelection:wr(function(){Li(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){this.history=new ni(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),
|
||
this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:pi(this.history.done),undone:pi(this.history.undone)}},setHistory:function(e){var t=this.history=new ni(this.history.maxGeneration);t.done=pi(e.done.slice(0),null,!0),t.undone=pi(e.undone.slice(0),null,!0)},setGutterMarker:wr(function(e,t,n){return Bi(this,e,"gutter",function(e){var r=e.gutterMarkers||(e.gutterMarkers={});return r[t]=n,!n&&C(r)&&(e.gutterMarkers=null),!0})}),clearGutter:wr(function(e){var t=this;this.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&Bi(t,n,"gutter",function(){return n.gutterMarkers[e]=null,C(n.gutterMarkers)&&(n.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if("number"==typeof e){if(!oe(this,e))return null;if(t=e,e=Q(this,e),!e)return null}else if(t=re(e),null==t)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:wr(function(t,n,r){return Bi(this,t,"gutter"==n?"gutter":"class",function(t){var i="text"==n?"textClass":"background"==n?"bgClass":"gutter"==n?"gutterClass":"wrapClass";if(t[i]){if(e(r).test(t[i]))return!1;t[i]+=" "+r}else t[i]=r;return!0})}),removeLineClass:wr(function(t,n,r){return Bi(this,t,"gutter"==n?"gutter":"class",function(t){var i="text"==n?"textClass":"background"==n?"bgClass":"gutter"==n?"gutterClass":"wrapClass",o=t[i];if(!o)return!1;if(null==r)t[i]=null;else{var s=o.match(e(r));if(!s)return!1;var a=s.index+s[0].length;t[i]=o.slice(0,s.index)+(s.index&&a!=o.length?" ":"")+o.slice(a)||null}return!0})}),addLineWidget:wr(function(e,t,n){return qi(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return Gi(this,pe(this,e),pe(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=pe(this,e),Gi(this,e,e,n,"bookmark")},findMarksAt:function(e){e=pe(this,e);var t=[],n=Q(this,e.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(null==i.from||i.from<=e.ch)&&(null==i.to||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=pe(this,e),t=pe(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var s=o.markedSpans;if(s)for(var a=0;a<s.length;a++){var l=s[a];null!=l.to&&i==e.line&&e.ch>=l.to||null==l.from&&i!=e.line||null!=l.from&&i==t.line&&l.from>=t.ch||n&&!n(l.marker)||r.push(l.marker.parent||l.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)null!=n[r].from&&e.push(n[r].marker)}),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter(function(i){var o=i.text.length+r;return o>e?(t=e,!0):(e-=o,void++n)}),pe(this,ae(n,t))},indexFromPos:function(e){e=pe(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,function(e){t+=e.text.length+n}),t},copy:function(e){var t=new Ra(te(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<n&&(n=e.to);var r=new Ra(te(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Xi(r,Yi(this)),r},unlinkDoc:function(e){var t=this;if(e instanceof Yo&&(e=e.doc),this.linked)for(var n=0;n<this.linked.length;++n){var r=t.linked[n];if(r.doc==e){t.linked.splice(n,1),e.unlinkDoc(t),Ji(Yi(t));break}}if(e.history==this.history){var i=[e.id];Zr(e,function(e){return i.push(e.id)},!0),e.history=new ni(null),e.history.done=pi(this.history.done,i),e.history.undone=pi(this.history.undone,i)}},iterLinkedDocs:function(e){Zr(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):oa(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:wr(function(e){"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(e){return e.order=null}),this.cm&&ti(this.cm))})}),Ra.prototype.eachLine=Ra.prototype.iter;for(var Ha=0,za=!1,Ba={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},$a=0;$a<10;$a++)Ba[$a+48]=Ba[$a+96]=String($a);for(var Wa=65;Wa<=90;Wa++)Ba[Wa]=String.fromCharCode(Wa);for(var Ua=1;Ua<=12;Ua++)Ba[Ua+111]=Ba[Ua+63235]="F"+Ua;var qa={};qa.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},qa.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},qa.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},qa.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},qa["default"]=Ls?qa.macDefault:qa.pcDefault;var Ga={selectAll:_i,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Ks)},killLine:function(e){return po(e,function(t){if(t.empty()){var n=Q(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:ae(t.head.line+1,0)}:{from:t.head,to:ae(t.head.line,n)}}return{from:t.from(),to:t.to()}})},deleteLine:function(e){return po(e,function(t){return{from:ae(t.from().line,0),to:pe(e.doc,ae(t.to().line+1,0))}})},delLineLeft:function(e){return po(e,function(e){return{from:ae(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(e){return po(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){return po(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(ae(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(ae(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return yo(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return xo(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return wo(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")},Xs)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")},Xs)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?xo(e,t.head):r},Xs)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"char")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("\t")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var o=n[i].from(),s=d(e.getLine(o.line),o.ch,r);t.push(p(r-s%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return vr(e,function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)if(t[r].empty()){var i=t[r].head,o=Q(e.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new ae(i.line,i.ch-1)),i.ch>0)i=new ae(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),ae(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var s=Q(e.doc,i.line-1).text;s&&(i=new ae(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+s.charAt(s.length-1),ae(i.line-1,s.length-1),i,"+transpose"))}n.push(new Aa(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return vr(e,function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);Jn(e)})},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}},Ka=new $s,Ya=null,Xa=400,Ja=function(e,t,n){this.time=e,this.pos=t,this.button=n};Ja.prototype.compare=function(e,t,n){return this.time+Xa>e&&0==le(t,this.pos)&&n==this.button};var Za,Qa,el={toString:function(){return"CodeMirror.Init"}},tl={},nl={};Yo.defaults=tl,Yo.optionHandlers=nl;var rl=[];Yo.defineInitHook=function(e){return rl.push(e)};var il=null,ol=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new $s,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};ol.prototype.init=function(e){function t(e){if(!M(i,e)){if(i.somethingSelected())Zo({lineWise:!1,text:i.getSelections()}),"cut"==e.type&&i.replaceSelection("",null,"cut");else{if(!i.options.lineWiseCopyCut)return;var t=ns(i);Zo({lineWise:!0,text:t.text}),"cut"==e.type&&i.operation(function(){i.setSelections(t.ranges,0,Ks),i.replaceSelection("",null,"cut")})}if(e.clipboardData){e.clipboardData.clearData();var n=il.text.join("\n");if(e.clipboardData.setData("Text",n),e.clipboardData.getData("Text")==n)return void e.preventDefault()}var s=is(),a=s.firstChild;i.display.lineSpace.insertBefore(s,i.display.lineSpace.firstChild),a.value=il.text.join("\n");var l=document.activeElement;Bs(a),setTimeout(function(){i.display.lineSpace.removeChild(s),l.focus(),l==o&&r.showPrimarySelection()},50)}}var n=this,r=this,i=r.cm,o=r.div=e.lineDiv;rs(o,i.options.spellcheck,i.options.autocorrect,i.options.autocapitalize),ra(o,"paste",function(e){M(i,e)||es(e,i)||js<=11&&setTimeout(br(i,function(){return n.updateFromDOM()}),20)}),ra(o,"compositionstart",function(e){n.composing={data:e.data,done:!1}}),ra(o,"compositionupdate",function(e){n.composing||(n.composing={data:e.data,done:!1})}),ra(o,"compositionend",function(e){n.composing&&(e.data!=n.composing.data&&n.readFromDOMSoon(),n.composing.done=!0)}),ra(o,"touchstart",function(){return r.forceCompositionEnd()}),ra(o,"input",function(){n.composing||n.readFromDOMSoon()}),ra(o,"copy",t),ra(o,"cut",t)},ol.prototype.prepareSelection=function(){var e=Ln(this.cm,!1);return e.focus=this.cm.state.focused,e},ol.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},ol.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},ol.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),r=n.from(),i=n.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||i.line<t.display.viewFrom)return void e.removeAllRanges();var o=hs(t,e.anchorNode,e.anchorOffset),s=hs(t,e.focusNode,e.focusOffset);if(!o||o.bad||!s||s.bad||0!=le(he(o,s),r)||0!=le(de(o,s),i)){var a=t.display.view,l=r.line>=t.display.viewFrom&&ls(t,r)||{node:a[0].measure.map[2],offset:0},c=i.line<t.display.viewTo&&ls(t,i);if(!c){var u=a[a.length-1].measure,d=u.maps?u.maps[u.maps.length-1]:u.map;c={node:d[d.length-1],offset:d[d.length-2]-d[d.length-3]}}if(!l||!c)return void e.removeAllRanges();var h,f=e.rangeCount&&e.getRangeAt(0);try{h=Fs(l.node,l.offset,c.offset,c.node)}catch(p){}h&&(!bs&&t.state.focused?(e.collapse(l.node,l.offset),h.collapsed||(e.removeAllRanges(),e.addRange(h))):(e.removeAllRanges(),e.addRange(h)),f&&null==e.anchorNode?e.addRange(f):bs&&this.startGracePeriod()),this.rememberSelection()}},ol.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},ol.prototype.showMultipleSelections=function(e){n(this.cm.display.cursorDiv,e.cursors),n(this.cm.display.selectionDiv,e.selection)},ol.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},ol.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return o(this.div,t)},ol.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()||this.showSelection(this.prepareSelection(),!0),this.div.focus())},ol.prototype.blur=function(){this.div.blur()},ol.prototype.getField=function(){return this.div},ol.prototype.supportsTouch=function(){return!0},ol.prototype.receivedFocus=function(){function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))}var t=this;this.selectionInEditor()?this.pollSelection():vr(this.cm,function(){return t.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,e)},ol.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},ol.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=this.getSelection(),t=this.cm;if(Ms&&Ss&&this.cm.display.gutterSpecs.length&&cs(e.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var n=hs(t,e.anchorNode,e.anchorOffset),r=hs(t,e.focusNode,e.focusOffset);n&&r&&vr(t,function(){Ci(t.doc,Br(n,r),Ks),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}}},ol.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,n=e.doc.sel.primary(),r=n.from(),i=n.to();if(0==r.ch&&r.line>e.firstLine()&&(r=ae(r.line-1,Q(e.doc,r.line-1).length)),i.ch==Q(e.doc,i.line).text.length&&i.line<e.lastLine()&&(i=ae(i.line+1,0)),r.line<t.viewFrom||i.line>t.viewTo-1)return!1;var o,s,a;r.line==t.viewFrom||0==(o=Sn(e,r.line))?(s=re(t.view[0].line),a=t.view[0].node):(s=re(t.view[o].line),a=t.view[o-1].node.nextSibling);var l,c,u=Sn(e,i.line);if(u==t.view.length-1?(l=t.viewTo-1,c=t.lineDiv.lastChild):(l=re(t.view[u+1].line)-1,c=t.view[u+1].node.previousSibling),!a)return!1;for(var d=e.doc.splitLines(ds(e,a,c,s,l)),h=ee(e.doc,ae(s,0),ae(l,Q(e.doc,l).text.length));d.length>1&&h.length>1;)if(g(d)==g(h))d.pop(),h.pop(),l--;else{if(d[0]!=h[0])break;d.shift(),h.shift(),s++}for(var f=0,p=0,m=d[0],v=h[0],b=Math.min(m.length,v.length);f<b&&m.charCodeAt(f)==v.charCodeAt(f);)++f;for(var y=g(d),w=g(h),x=Math.min(y.length-(1==d.length?f:0),w.length-(1==h.length?f:0));p<x&&y.charCodeAt(y.length-p-1)==w.charCodeAt(w.length-p-1);)++p;if(1==d.length&&1==h.length&&s==r.line)for(;f&&f>r.ch&&y.charCodeAt(y.length-p-1)==w.charCodeAt(w.length-p-1);)f--,p++;d[d.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),d[0]=d[0].slice(f).replace(/\u200b+$/,"");var C=ae(s,f),j=ae(l,h.length?g(h).length-p:0);return d.length>1||d[0]||le(C,j)?(Fi(e.doc,d,C,j,"+input"),!0):void 0},ol.prototype.ensurePolled=function(){this.forceCompositionEnd()},ol.prototype.reset=function(){this.forceCompositionEnd()},ol.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},ol.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()},80))},ol.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||vr(this.cm,function(){return Tn(e.cm)})},ol.prototype.setUneditable=function(e){e.contentEditable="false"},ol.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||br(this.cm,Qo)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},ol.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},ol.prototype.onContextMenu=function(){},ol.prototype.resetPosition=function(){},ol.prototype.needsContentAttribute=!0;var sl=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new $s,this.hasSelection=!1,this.composing=null};sl.prototype.init=function(e){function t(e){if(!M(i,e)){if(i.somethingSelected())Zo({lineWise:!1,text:i.getSelections()});else{if(!i.options.lineWiseCopyCut)return;var t=ns(i);Zo({lineWise:!0,text:t.text}),"cut"==e.type?i.setSelections(t.ranges,null,Ks):(r.prevInput="",o.value=t.text.join("\n"),Bs(o))}"cut"==e.type&&(i.state.cutIncoming=+new Date)}}var n=this,r=this,i=this.cm;this.createField(e);var o=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),Ds&&(o.style.width="0px"),ra(o,"input",function(){Cs&&js>=9&&n.hasSelection&&(n.hasSelection=null),r.poll()}),ra(o,"paste",function(e){M(i,e)||es(e,i)||(i.state.pasteIncoming=+new Date,r.fastPoll())}),ra(o,"cut",t),ra(o,"copy",t),ra(e.scroller,"paste",function(t){if(!Nt(e,t)&&!M(i,t)){if(!o.dispatchEvent)return i.state.pasteIncoming=+new Date,void r.focus();var n=new Event("paste");n.clipboardData=t.clipboardData,o.dispatchEvent(n)}}),ra(e.lineSpace,"selectstart",function(t){Nt(e,t)||V(t)}),ra(o,"compositionstart",function(){var e=i.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:e,range:i.markText(e,i.getCursor("to"),{className:"CodeMirror-composing"})}}),ra(o,"compositionend",function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)})},sl.prototype.createField=function(e){this.wrapper=is(),this.textarea=this.wrapper.firstChild},sl.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=Ln(e);if(e.options.moveInputWithCursor){var i=cn(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),s=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+s.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+s.left-o.left))}return r},sl.prototype.showSelection=function(e){var t=this.cm,r=t.display;n(r.cursorDiv,e.cursors),n(r.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},sl.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&Bs(this.textarea),Cs&&js>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",Cs&&js>=9&&(this.hasSelection=null))}},sl.prototype.getField=function(){return this.textarea},sl.prototype.supportsTouch=function(){return!1},sl.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!As||s()!=this.textarea))try{this.textarea.focus()}catch(e){}},sl.prototype.blur=function(){this.textarea.blur()},sl.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},sl.prototype.receivedFocus=function(){this.slowPoll()},sl.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},sl.prototype.fastPoll=function(){function e(){var r=n.poll();r||t?(n.pollingFast=!1,n.slowPoll()):(t=!0,n.polling.set(60,e))}var t=!1,n=this;n.pollingFast=!0,n.polling.set(20,e)},sl.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||sa(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(Cs&&js>=9&&this.hasSelection===i||Ls&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||r||(r=""),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var s=0,a=Math.min(r.length,i.length);s<a&&r.charCodeAt(s)==i.charCodeAt(s);)++s;return vr(t,function(){Qo(t,i.slice(s),r.length-s,null,e.composing?"*compose":null),i.length>1e3||i.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},sl.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},sl.prototype.onKeyPress=function(){Cs&&js>=9&&(this.hasSelection=null),this.fastPoll()},sl.prototype.onContextMenu=function(e){function t(){if(null!=s.selectionStart){var e=i.somethingSelected(),t=""+(e?s.value:"");s.value="⇚",s.value=t,r.prevInput=e?"":"",s.selectionStart=1,s.selectionEnd=t.length,o.selForContextMenu=i.doc.sel}}function n(){if(r.contextMenuPending==n&&(r.contextMenuPending=!1,r.wrapper.style.cssText=d,s.style.cssText=u,Cs&&js<9&&o.scrollbars.setScrollTop(o.scroller.scrollTop=l),null!=s.selectionStart)){(!Cs||Cs&&js<9)&&t();var e=0,a=function(){o.selForContextMenu==i.doc.sel&&0==s.selectionStart&&s.selectionEnd>0&&""==r.prevInput?br(i,_i)(i):e++<10?o.detectingSelectAll=setTimeout(a,500):(o.selForContextMenu=null,o.input.reset())};o.detectingSelectAll=setTimeout(a,200)}}var r=this,i=r.cm,o=i.display,s=r.textarea;r.contextMenuPending&&r.contextMenuPending();var a=kn(i,e),l=o.scroller.scrollTop;if(a&&!Ts){var c=i.options.resetSelectionOnContextMenu;c&&i.doc.sel.contains(a)==-1&&br(i,Ci)(i.doc,Br(a),Ks);var u=s.style.cssText,d=r.wrapper.style.cssText,h=r.wrapper.offsetParent.getBoundingClientRect();r.wrapper.style.cssText="position: static",s.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-h.top-5)+"px; left: "+(e.clientX-h.left-5)+"px;\n z-index: 1000; background: "+(Cs?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";var f;if(Os&&(f=window.scrollY),o.input.focus(),Os&&window.scrollTo(null,f),o.input.reset(),i.somethingSelected()||(s.value=r.prevInput=" "),r.contextMenuPending=n,o.selForContextMenu=i.doc.sel,clearTimeout(o.detectingSelectAll),Cs&&js>=9&&t(),Hs){R(e);var p=function(){_(window,"mouseup",p),setTimeout(n,20)};ra(window,"mouseup",p)}else setTimeout(n,50)}},sl.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e},sl.prototype.setUneditable=function(){},sl.prototype.needsContentAttribute=!1,qo(Yo),os(Yo);var al="iter insert remove copy getEditor constructor".split(" ");for(var ll in Ra.prototype)Ra.prototype.hasOwnProperty(ll)&&h(al,ll)<0&&(Yo.prototype[ll]=function(e){return function(){return e.apply(this.doc,arguments)}}(Ra.prototype[ll]));return N(Ra),Yo.inputStyles={textarea:sl,contenteditable:ol},Yo.defineMode=function(e){Yo.defaults.mode||"null"==e||(Yo.defaults.mode=e),U.apply(this,arguments)},Yo.defineMIME=q,Yo.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Yo.defineMIME("text/plain","null"),Yo.defineExtension=function(e,t){Yo.prototype[e]=t},Yo.defineDocExtension=function(e,t){Ra.prototype[e]=t},Yo.fromTextArea=ps,gs(Yo),Yo.version="5.49.2",Yo})},"./node_modules/codemirror/mode/css/css.js":function(e,t,n){!function(e){e(n("./node_modules/codemirror/lib/codemirror.js"))}(function(e){"use strict";function t(e){for(var t={},n=0;n<e.length;++n)t[e[n].toLowerCase()]=!0;return t}function n(e,t){for(var n,r=!1;null!=(n=e.next());){if(r&&"/"==n){t.tokenize=null;break}r="*"==n}return["comment","comment"]}e.defineMode("css",function(t,n){function r(e,t){return p=t,e}function i(e,t){var n=e.next();if(v[n]){var i=v[n](e,t);if(i!==!1)return i}return"@"==n?(e.eatWhile(/[\w\\\-]/),r("def",e.current())):"="==n||("~"==n||"|"==n)&&e.eat("=")?r(null,"compare"):'"'==n||"'"==n?(t.tokenize=o(n),t.tokenize(e,t)):"#"==n?(e.eatWhile(/[\w\\\-]/),r("atom","hash")):"!"==n?(e.match(/^\s*\w*/),r("keyword","important")):/\d/.test(n)||"."==n&&e.eat(/\d/)?(e.eatWhile(/[\w.%]/),r("number","unit")):"-"!==n?/[,+>*\/]/.test(n)?r(null,"select-op"):"."==n&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?r("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(n)?r(null,n):e.match(/[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/.test(e.current().toLowerCase())&&(t.tokenize=s),r("variable callee","variable")):/[\w\\\-]/.test(n)?(e.eatWhile(/[\w\\\-]/),r("property","word")):r(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),r("number","unit")):e.match(/^-[\w\\\-]*/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?r("variable-2","variable-definition"):r("variable-2","variable")):e.match(/^\w+-/)?r("meta","meta"):void 0}function o(e){return function(t,n){for(var i,o=!1;null!=(i=t.next());){if(i==e&&!o){")"==e&&t.backUp(1);break}o=!o&&"\\"==i}return(i==e||!o&&")"!=e)&&(n.tokenize=null),r("string","string")}}function s(e,t){return e.next(),e.match(/\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=o(")"),r(null,"(")}function a(e,t,n){this.type=e,this.indent=t,this.prev=n}function l(e,t,n,r){return e.context=new a(n,t.indentation()+(r===!1?0:m),e.context),n}function c(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function u(e,t,n){return D[n.context.type](e,t,n)}function d(e,t,n,r){for(var i=r||1;i>0;i--)n.context=n.context.prev;return u(e,t,n)}function h(e){var t=e.current().toLowerCase();g=T.hasOwnProperty(t)?"atom":S.hasOwnProperty(t)?"keyword":"variable"}var f=n.inline;n.propertyKeywords||(n=e.resolveMode("text/css"));var p,g,m=t.indentUnit,v=n.tokenHooks,b=n.documentTypes||{},y=n.mediaTypes||{},w=n.mediaFeatures||{},x=n.mediaValueKeywords||{},C=n.propertyKeywords||{},j=n.nonStandardPropertyKeywords||{},O=n.fontProperties||{},k=n.counterDescriptors||{},S=n.colorKeywords||{},T=n.valueKeywords||{},P=n.allowNested,E=n.lineComment,_=n.supportsAtComponent===!0,D={};return D.top=function(e,t,n){if("{"==e)return l(n,t,"block");if("}"==e&&n.context.prev)return c(n);if(_&&/@component/i.test(e))return l(n,t,"atComponentBlock");if(/^@(-moz-)?document$/i.test(e))return l(n,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(e))return l(n,t,"atBlock");if(/^@(font-face|counter-style)/i.test(e))return n.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return l(n,t,"at");if("hash"==e)g="builtin";else if("word"==e)g="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return l(n,t,"interpolation");if(":"==e)return"pseudo";if(P&&"("==e)return l(n,t,"parens")}return n.context.type},D.block=function(e,t,n){if("word"==e){var r=t.current().toLowerCase();return C.hasOwnProperty(r)?(g="property","maybeprop"):j.hasOwnProperty(r)?(g="string-2","maybeprop"):P?(g=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(g+=" error","maybeprop")}return"meta"==e?"block":P||"hash"!=e&&"qualifier"!=e?D.top(e,t,n):(g="error","block")},D.maybeprop=function(e,t,n){return":"==e?l(n,t,"prop"):u(e,t,n)},D.prop=function(e,t,n){if(";"==e)return c(n);if("{"==e&&P)return l(n,t,"propBlock");if("}"==e||"{"==e)return d(e,t,n);if("("==e)return l(n,t,"parens");if("hash"!=e||/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(t.current())){if("word"==e)h(t);else if("interpolation"==e)return l(n,t,"interpolation")}else g+=" error";return"prop"},D.propBlock=function(e,t,n){return"}"==e?c(n):"word"==e?(g="property","maybeprop"):n.context.type},D.parens=function(e,t,n){return"{"==e||"}"==e?d(e,t,n):")"==e?c(n):"("==e?l(n,t,"parens"):"interpolation"==e?l(n,t,"interpolation"):("word"==e&&h(t),"parens")},D.pseudo=function(e,t,n){return"meta"==e?"pseudo":"word"==e?(g="variable-3",n.context.type):u(e,t,n)},D.documentTypes=function(e,t,n){return"word"==e&&b.hasOwnProperty(t.current())?(g="tag",n.context.type):D.atBlock(e,t,n)},D.atBlock=function(e,t,n){if("("==e)return l(n,t,"atBlock_parens");if("}"==e||";"==e)return d(e,t,n);if("{"==e)return c(n)&&l(n,t,P?"block":"top");if("interpolation"==e)return l(n,t,"interpolation");
|
||
if("word"==e){var r=t.current().toLowerCase();g="only"==r||"not"==r||"and"==r||"or"==r?"keyword":y.hasOwnProperty(r)?"attribute":w.hasOwnProperty(r)?"property":x.hasOwnProperty(r)?"keyword":C.hasOwnProperty(r)?"property":j.hasOwnProperty(r)?"string-2":T.hasOwnProperty(r)?"atom":S.hasOwnProperty(r)?"keyword":"error"}return n.context.type},D.atComponentBlock=function(e,t,n){return"}"==e?d(e,t,n):"{"==e?c(n)&&l(n,t,P?"block":"top",!1):("word"==e&&(g="error"),n.context.type)},D.atBlock_parens=function(e,t,n){return")"==e?c(n):"{"==e||"}"==e?d(e,t,n,2):D.atBlock(e,t,n)},D.restricted_atBlock_before=function(e,t,n){return"{"==e?l(n,t,"restricted_atBlock"):"word"==e&&"@counter-style"==n.stateArg?(g="variable","restricted_atBlock_before"):u(e,t,n)},D.restricted_atBlock=function(e,t,n){return"}"==e?(n.stateArg=null,c(n)):"word"==e?(g="@font-face"==n.stateArg&&!O.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==n.stateArg&&!k.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},D.keyframes=function(e,t,n){return"word"==e?(g="variable","keyframes"):"{"==e?l(n,t,"top"):u(e,t,n)},D.at=function(e,t,n){return";"==e?c(n):"{"==e||"}"==e?d(e,t,n):("word"==e?g="tag":"hash"==e&&(g="builtin"),"at")},D.interpolation=function(e,t,n){return"}"==e?c(n):"{"==e||";"==e?d(e,t,n):("word"==e?g="variable":"variable"!=e&&"("!=e&&")"!=e&&(g="error"),"interpolation")},{startState:function(e){return{tokenize:null,state:f?"block":"top",stateArg:null,context:new a(f?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var n=(t.tokenize||i)(e,t);return n&&"object"==typeof n&&(p=n[1],n=n[0]),g=n,"comment"!=p&&(t.state=D[t.state](p,e,t)),g},indent:function(e,t){var n=e.context,r=t&&t.charAt(0),i=n.indent;return"prop"!=n.type||"}"!=r&&")"!=r||(n=n.prev),n.prev&&("}"!=r||"block"!=n.type&&"top"!=n.type&&"interpolation"!=n.type&&"restricted_atBlock"!=n.type?(")"!=r||"parens"!=n.type&&"atBlock_parens"!=n.type)&&("{"!=r||"at"!=n.type&&"atBlock"!=n.type)||(i=Math.max(0,n.indent-m)):(n=n.prev,i=n.indent)),i},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:E,fold:"brace"}});var r=["domain","regexp","url","url-prefix"],i=t(r),o=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],s=t(o),a=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover"],l=t(a),c=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive"],u=t(c),d=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],h=t(d),f=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],p=t(f),g=["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],m=t(g),v=["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"],b=t(v),y=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],w=t(y),x=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],C=t(x),j=r.concat(o).concat(a).concat(c).concat(d).concat(f).concat(y).concat(x);e.registerHelper("hintWords","css",j),e.defineMIME("text/css",{documentTypes:i,mediaTypes:s,mediaFeatures:l,mediaValueKeywords:u,propertyKeywords:h,nonStandardPropertyKeywords:p,fontProperties:m,counterDescriptors:b,colorKeywords:w,valueKeywords:C,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=n,n(e,t))}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:s,mediaFeatures:l,mediaValueKeywords:u,propertyKeywords:h,nonStandardPropertyKeywords:p,colorKeywords:w,valueKeywords:C,fontProperties:m,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=n,n(e,t)):["operator","operator"]},":":function(e){return!!e.match(/\s*\{/,!1)&&[null,null]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),e.defineMIME("text/x-less",{mediaTypes:s,mediaFeatures:l,mediaValueKeywords:u,propertyKeywords:h,nonStandardPropertyKeywords:p,colorKeywords:w,valueKeywords:C,fontProperties:m,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=n,n(e,t)):["operator","operator"]},"@":function(e){return e.eat("{")?[null,"interpolation"]:!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),e.defineMIME("text/x-gss",{documentTypes:i,mediaTypes:s,mediaFeatures:l,propertyKeywords:h,nonStandardPropertyKeywords:p,fontProperties:m,counterDescriptors:b,colorKeywords:w,valueKeywords:C,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=n,n(e,t))}},name:"css",helperType:"gss"})})},"./node_modules/codemirror/mode/htmlmixed/htmlmixed.js":function(e,t,n){!function(e){e(n("./node_modules/codemirror/lib/codemirror.js"),n("./node_modules/codemirror/mode/xml/xml.js"),n("./node_modules/codemirror/mode/javascript/javascript.js"),n("./node_modules/codemirror/mode/css/css.js"))}(function(e){"use strict";function t(e,t,n){var r=e.current(),i=r.search(t);return i>-1?e.backUp(r.length-i):r.match(/<\/?$/)&&(e.backUp(r.length),e.match(t,!1)||e.match(r)),n}function n(e){var t=l[e];return t?t:l[e]=new RegExp("\\s+"+e+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*")}function r(e,t){var r=e.match(n(t));return r?/^\s*(.*?)\s*$/.exec(r[2])[1]:""}function i(e,t){return new RegExp((t?"^":"")+"</s*"+e+"s*>","i")}function o(e,t){for(var n in e)for(var r=t[n]||(t[n]=[]),i=e[n],o=i.length-1;o>=0;o--)r.unshift(i[o])}function s(e,t){for(var n=0;n<e.length;n++){var i=e[n];if(!i[0]||i[1].test(r(t,i[0])))return i[2]}}var a={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]},l={};e.defineMode("htmlmixed",function(n,r){function l(r,o){var a,d=c.token(r,o.htmlState),h=/\btag\b/.test(d);if(h&&!/[<>\s\/]/.test(r.current())&&(a=o.htmlState.tagName&&o.htmlState.tagName.toLowerCase())&&u.hasOwnProperty(a))o.inTag=a+" ";else if(o.inTag&&h&&/>$/.test(r.current())){var f=/^([\S]+) (.*)/.exec(o.inTag);o.inTag=null;var p=">"==r.current()&&s(u[f[1]],f[2]),g=e.getMode(n,p),m=i(f[1],!0),v=i(f[1],!1);o.token=function(e,n){return e.match(m,!1)?(n.token=l,n.localState=n.localMode=null,null):t(e,v,n.localMode.token(e,n.localState))},o.localMode=g,o.localState=e.startState(g,c.indent(o.htmlState,"",""))}else o.inTag&&(o.inTag+=r.current(),r.eol()&&(o.inTag+=" "));return d}var c=e.getMode(n,{name:"xml",htmlMode:!0,multilineTagIndentFactor:r.multilineTagIndentFactor,multilineTagIndentPastTag:r.multilineTagIndentPastTag}),u={},d=r&&r.tags,h=r&&r.scriptTypes;if(o(a,u),d&&o(d,u),h)for(var f=h.length-1;f>=0;f--)u.script.unshift(["type",h[f].matches,h[f].mode]);return{startState:function(){var t=e.startState(c);return{token:l,inTag:null,localMode:null,localState:null,htmlState:t}},copyState:function(t){var n;return t.localState&&(n=e.copyState(t.localMode,t.localState)),{token:t.token,inTag:t.inTag,localMode:t.localMode,localState:n,htmlState:e.copyState(c,t.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(t,n,r){return!t.localMode||/^\s*<\//.test(n)?c.indent(t.htmlState,n,r):t.localMode.indent?t.localMode.indent(t.localState,n,r):e.Pass},innerMode:function(e){return{state:e.localState||e.htmlState,mode:e.localMode||c}}}},"xml","javascript","css"),e.defineMIME("text/html","htmlmixed")})},"./node_modules/codemirror/mode/javascript/javascript.js":function(e,t,n){!function(e){e(n("./node_modules/codemirror/lib/codemirror.js"))}(function(e){"use strict";e.defineMode("javascript",function(t,n){function r(e){for(var t,n=!1,r=!1;null!=(t=e.next());){if(!n){if("/"==t&&!r)return;"["==t?r=!0:r&&"]"==t&&(r=!1)}n=!n&&"\\"==t}}function i(e,t,n){return He=e,ze=n,t}function o(e,t){var n=e.next();if('"'==n||"'"==n)return t.tokenize=s(n),t.tokenize(e,t);if("."==n&&e.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return i("number","number");if("."==n&&e.match(".."))return i("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return i(n);if("="==n&&e.eat(">"))return i("=>","operator");if("0"==n&&e.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return i("number","number");if(/\d/.test(n))return e.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),i("number","number");if("/"==n)return e.eat("*")?(t.tokenize=a,a(e,t)):e.eat("/")?(e.skipToEnd(),i("comment","comment")):Re(e,t,1)?(r(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),i("regexp","string-2")):(e.eat("="),i("operator","operator",e.current()));if("`"==n)return t.tokenize=l,l(e,t);if("#"==n)return e.skipToEnd(),i("error","error");if("<"==n&&e.match("!--")||"-"==n&&e.match("->"))return e.skipToEnd(),i("comment","comment");if(Ye.test(n))return">"==n&&t.lexical&&">"==t.lexical.type||(e.eat("=")?"!"!=n&&"="!=n||e.eat("="):/[<>*+\-]/.test(n)&&(e.eat(n),">"==n&&e.eat(n))),i("operator","operator",e.current());if(Ge.test(n)){e.eatWhile(Ge);var o=e.current();if("."!=t.lastType){if(Ke.propertyIsEnumerable(o)){var c=Ke[o];return i(c.type,c.style,o)}if("async"==o&&e.match(/^(\s|\/\*.*?\*\/)*[\[\(\w]/,!1))return i("async","keyword",o)}return i("variable","variable",o)}}function s(e){return function(t,n){var r,s=!1;if(We&&"@"==t.peek()&&t.match(Xe))return n.tokenize=o,i("jsonld-keyword","meta");for(;null!=(r=t.next())&&(r!=e||s);)s=!s&&"\\"==r;return s||(n.tokenize=o),i("string","string")}}function a(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=o;break}r="*"==n}return i("comment","comment")}function l(e,t){for(var n,r=!1;null!=(n=e.next());){if(!r&&("`"==n||"$"==n&&e.eat("{"))){t.tokenize=o;break}r=!r&&"\\"==n}return i("quasi","string-2",e.current())}function c(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var n=e.string.indexOf("=>",e.start);if(!(n<0)){if(qe){var r=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,n));r&&(n=r.index)}for(var i=0,o=!1,s=n-1;s>=0;--s){var a=e.string.charAt(s),l=Je.indexOf(a);if(l>=0&&l<3){if(!i){++s;break}if(0==--i){"("==a&&(o=!0);break}}else if(l>=3&&l<6)++i;else if(Ge.test(a))o=!0;else if(/["'\/`]/.test(a))for(;;--s){if(0==s)return;var c=e.string.charAt(s-1);if(c==a&&"\\"!=e.string.charAt(s-2)){s--;break}}else if(o&&!i){++s;break}}o&&!i&&(t.fatArrowAt=s)}}function u(e,t,n,r,i,o){this.indented=e,this.column=t,this.type=n,this.prev=i,this.info=o,null!=r&&(this.align=r)}function d(e,t){for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0;for(var r=e.context;r;r=r.prev)for(var n=r.vars;n;n=n.next)if(n.name==t)return!0}function h(e,t,n,r,i){var o=e.cc;for(Qe.state=e,Qe.stream=i,Qe.marked=null,Qe.cc=o,Qe.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){var s=o.length?o.pop():Ue?E:T;if(s(n,r)){for(;o.length&&o[o.length-1].lex;)o.pop()();return Qe.marked?Qe.marked:"variable"==n&&d(e,r)?"variable-2":t}}}function f(){for(var e=arguments.length-1;e>=0;e--)Qe.cc.push(arguments[e])}function p(){return f.apply(null,arguments),!0}function g(e,t){for(var n=t;n;n=n.next)if(n.name==e)return!0;return!1}function m(e){var t=Qe.state;if(Qe.marked="def",t.context)if("var"==t.lexical.info&&t.context&&t.context.block){var r=v(e,t.context);if(null!=r)return void(t.context=r)}else if(!g(e,t.localVars))return void(t.localVars=new w(e,t.localVars));n.globalVars&&!g(e,t.globalVars)&&(t.globalVars=new w(e,t.globalVars))}function v(e,t){if(t){if(t.block){var n=v(e,t.prev);return n?n==t.prev?t:new y(n,t.vars,(!0)):null}return g(e,t.vars)?t:new y(t.prev,new w(e,t.vars),(!1))}return null}function b(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function y(e,t,n){this.prev=e,this.vars=t,this.block=n}function w(e,t){this.name=e,this.next=t}function x(){Qe.state.context=new y(Qe.state.context,Qe.state.localVars,(!1)),Qe.state.localVars=et}function C(){Qe.state.context=new y(Qe.state.context,Qe.state.localVars,(!0)),Qe.state.localVars=null}function j(){Qe.state.localVars=Qe.state.context.vars,Qe.state.context=Qe.state.context.prev}function O(e,t){var n=function(){var n=Qe.state,r=n.indented;if("stat"==n.lexical.type)r=n.lexical.indented;else for(var i=n.lexical;i&&")"==i.type&&i.align;i=i.prev)r=i.indented;n.lexical=new u(r,Qe.stream.column(),e,null,n.lexical,t)};return n.lex=!0,n}function k(){var e=Qe.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function S(e){function t(n){return n==e?p():";"==e||"}"==n||")"==n||"]"==n?f():p(t)}return t}function T(e,t){return"var"==e?p(O("vardef",t),ce,S(";"),k):"keyword a"==e?p(O("form"),D,T,k):"keyword b"==e?p(O("form"),T,k):"keyword d"==e?Qe.stream.match(/^\s*$/,!1)?p():p(O("stat"),A,S(";"),k):"debugger"==e?p(S(";")):"{"==e?p(O("}"),C,X,k,j):";"==e?p():"if"==e?("else"==Qe.state.lexical.info&&Qe.state.cc[Qe.state.cc.length-1]==k&&Qe.state.cc.pop()(),p(O("form"),D,T,k,ge)):"function"==e?p(ye):"for"==e?p(O("form"),me,T,k):"class"==e||qe&&"interface"==t?(Qe.marked="keyword",p(O("form","class"==e?e:t),Oe,k)):"variable"==e?qe&&"declare"==t?(Qe.marked="keyword",p(T)):qe&&("module"==t||"enum"==t||"type"==t)&&Qe.stream.match(/^\s*\w/,!1)?(Qe.marked="keyword","enum"==t?p(Ve):"type"==t?p(xe,S("operator"),te,S(";")):p(O("form"),ue,S("{"),O("}"),X,k,k)):qe&&"namespace"==t?(Qe.marked="keyword",p(O("form"),E,T,k)):qe&&"abstract"==t?(Qe.marked="keyword",p(T)):p(O("stat"),$):"switch"==e?p(O("form"),D,S("{"),O("}","switch"),C,X,k,k,j):"case"==e?p(E,S(":")):"default"==e?p(S(":")):"catch"==e?p(O("form"),x,P,T,k,j):"export"==e?p(O("stat"),Pe,k):"import"==e?p(O("stat"),_e,k):"async"==e?p(T):"@"==t?p(E,T):f(O("stat"),E,S(";"),k)}function P(e){if("("==e)return p(Ce,S(")"))}function E(e,t){return M(e,t,!1)}function _(e,t){return M(e,t,!0)}function D(e){return"("!=e?f():p(O(")"),E,S(")"),k)}function M(e,t,n){if(Qe.state.fatArrowAt==Qe.stream.start){var r=n?R:F;if("("==e)return p(x,O(")"),K(Ce,")"),k,S("=>"),r,j);if("variable"==e)return f(x,ue,S("=>"),r,j)}var i=n?N:L;return Ze.hasOwnProperty(e)?p(i):"function"==e?p(ye,i):"class"==e||qe&&"interface"==t?(Qe.marked="keyword",p(O("form"),je,k)):"keyword c"==e||"async"==e?p(n?_:E):"("==e?p(O(")"),A,S(")"),k,i):"operator"==e||"spread"==e?p(n?_:E):"["==e?p(O("]"),Ne,k,i):"{"==e?Y(U,"}",null,i):"quasi"==e?f(V,i):"new"==e?p(H(n)):"import"==e?p(E):p()}function A(e){return e.match(/[;\}\)\],]/)?f():f(E)}function L(e,t){return","==e?p(E):N(e,t,!1)}function N(e,t,n){var r=0==n?L:N,i=0==n?E:_;return"=>"==e?p(x,n?R:F,j):"operator"==e?/\+\+|--/.test(t)||qe&&"!"==t?p(r):qe&&"<"==t&&Qe.stream.match(/^([^>]|<.*?>)*>\s*\(/,!1)?p(O(">"),K(te,">"),k,r):"?"==t?p(E,S(":"),i):p(i):"quasi"==e?f(V,r):";"!=e?"("==e?Y(_,")","call",r):"."==e?p(W,r):"["==e?p(O("]"),A,S("]"),k,r):qe&&"as"==t?(Qe.marked="keyword",p(te,r)):"regexp"==e?(Qe.state.lastType=Qe.marked="operator",Qe.stream.backUp(Qe.stream.pos-Qe.stream.start-1),p(i)):void 0:void 0}function V(e,t){return"quasi"!=e?f():"${"!=t.slice(t.length-2)?p(V):p(E,I)}function I(e){if("}"==e)return Qe.marked="string-2",Qe.state.tokenize=l,p(V)}function F(e){return c(Qe.stream,Qe.state),f("{"==e?T:E)}function R(e){return c(Qe.stream,Qe.state),f("{"==e?T:_)}function H(e){return function(t){return"."==t?p(e?B:z):"variable"==t&&qe?p(se,e?N:L):f(e?_:E)}}function z(e,t){if("target"==t)return Qe.marked="keyword",p(L)}function B(e,t){if("target"==t)return Qe.marked="keyword",p(N)}function $(e){return":"==e?p(k,T):f(L,S(";"),k)}function W(e){if("variable"==e)return Qe.marked="property",p()}function U(e,t){if("async"==e)return Qe.marked="property",p(U);if("variable"==e||"keyword"==Qe.style){if(Qe.marked="property","get"==t||"set"==t)return p(q);var n;return qe&&Qe.state.fatArrowAt==Qe.stream.start&&(n=Qe.stream.match(/^\s*:\s*/,!1))&&(Qe.state.fatArrowAt=Qe.stream.pos+n[0].length),p(G)}return"number"==e||"string"==e?(Qe.marked=We?"property":Qe.style+" property",p(G)):"jsonld-keyword"==e?p(G):qe&&b(t)?(Qe.marked="keyword",p(U)):"["==e?p(E,J,S("]"),G):"spread"==e?p(_,G):"*"==t?(Qe.marked="keyword",p(U)):":"==e?f(G):void 0}function q(e){return"variable"!=e?f(G):(Qe.marked="property",p(ye))}function G(e){return":"==e?p(_):"("==e?f(ye):void 0}function K(e,t,n){function r(i,o){if(n?n.indexOf(i)>-1:","==i){var s=Qe.state.lexical;return"call"==s.info&&(s.pos=(s.pos||0)+1),p(function(n,r){return n==t||r==t?f():f(e)},r)}return i==t||o==t?p():n&&n.indexOf(";")>-1?f(e):p(S(t))}return function(n,i){return n==t||i==t?p():f(e,r)}}function Y(e,t,n){for(var r=3;r<arguments.length;r++)Qe.cc.push(arguments[r]);return p(O(t,n),K(e,t),k)}function X(e){return"}"==e?p():f(T,X)}function J(e,t){if(qe){if(":"==e)return p(te);if("?"==t)return p(J)}}function Z(e,t){if(qe&&(":"==e||"in"==t))return p(te);
|
||
}function Q(e){if(qe&&":"==e)return Qe.stream.match(/^\s*\w+\s+is\b/,!1)?p(E,ee,te):p(te)}function ee(e,t){if("is"==t)return Qe.marked="keyword",p()}function te(e,t){return"keyof"==t||"typeof"==t||"infer"==t?(Qe.marked="keyword",p("typeof"==t?_:te)):"variable"==e||"void"==t?(Qe.marked="type",p(oe)):"|"==t||"&"==t?p(te):"string"==e||"number"==e||"atom"==e?p(oe):"["==e?p(O("]"),K(te,"]",","),k,oe):"{"==e?p(O("}"),K(re,"}",",;"),k,oe):"("==e?p(K(ie,")"),ne,oe):"<"==e?p(K(te,">"),te):void 0}function ne(e){if("=>"==e)return p(te)}function re(e,t){return"variable"==e||"keyword"==Qe.style?(Qe.marked="property",p(re)):"?"==t||"number"==e||"string"==e?p(re):":"==e?p(te):"["==e?p(S("variable"),Z,S("]"),re):"("==e?f(we,re):void 0}function ie(e,t){return"variable"==e&&Qe.stream.match(/^\s*[?:]/,!1)||"?"==t?p(ie):":"==e?p(te):"spread"==e?p(ie):f(te)}function oe(e,t){return"<"==t?p(O(">"),K(te,">"),k,oe):"|"==t||"."==e||"&"==t?p(te):"["==e?p(te,S("]"),oe):"extends"==t||"implements"==t?(Qe.marked="keyword",p(te)):"?"==t?p(te,S(":"),te):void 0}function se(e,t){if("<"==t)return p(O(">"),K(te,">"),k,oe)}function ae(){return f(te,le)}function le(e,t){if("="==t)return p(te)}function ce(e,t){return"enum"==t?(Qe.marked="keyword",p(Ve)):f(ue,J,fe,pe)}function ue(e,t){return qe&&b(t)?(Qe.marked="keyword",p(ue)):"variable"==e?(m(t),p()):"spread"==e?p(ue):"["==e?Y(he,"]"):"{"==e?Y(de,"}"):void 0}function de(e,t){return"variable"!=e||Qe.stream.match(/^\s*:/,!1)?("variable"==e&&(Qe.marked="property"),"spread"==e?p(ue):"}"==e?f():"["==e?p(E,S("]"),S(":"),de):p(S(":"),ue,fe)):(m(t),p(fe))}function he(){return f(ue,fe)}function fe(e,t){if("="==t)return p(_)}function pe(e){if(","==e)return p(ce)}function ge(e,t){if("keyword b"==e&&"else"==t)return p(O("form","else"),T,k)}function me(e,t){return"await"==t?p(me):"("==e?p(O(")"),ve,k):void 0}function ve(e){return"var"==e?p(ce,be):"variable"==e?p(be):f(be)}function be(e,t){return")"==e?p():";"==e?p(be):"in"==t||"of"==t?(Qe.marked="keyword",p(E,be)):f(E,be)}function ye(e,t){return"*"==t?(Qe.marked="keyword",p(ye)):"variable"==e?(m(t),p(ye)):"("==e?p(x,O(")"),K(Ce,")"),k,Q,T,j):qe&&"<"==t?p(O(">"),K(ae,">"),k,ye):void 0}function we(e,t){return"*"==t?(Qe.marked="keyword",p(we)):"variable"==e?(m(t),p(we)):"("==e?p(x,O(")"),K(Ce,")"),k,Q,j):qe&&"<"==t?p(O(">"),K(ae,">"),k,we):void 0}function xe(e,t){return"keyword"==e||"variable"==e?(Qe.marked="type",p(xe)):"<"==t?p(O(">"),K(ae,">"),k):void 0}function Ce(e,t){return"@"==t&&p(E,Ce),"spread"==e?p(Ce):qe&&b(t)?(Qe.marked="keyword",p(Ce)):qe&&"this"==e?p(J,fe):f(ue,J,fe)}function je(e,t){return"variable"==e?Oe(e,t):ke(e,t)}function Oe(e,t){if("variable"==e)return m(t),p(ke)}function ke(e,t){return"<"==t?p(O(">"),K(ae,">"),k,ke):"extends"==t||"implements"==t||qe&&","==e?("implements"==t&&(Qe.marked="keyword"),p(qe?te:E,ke)):"{"==e?p(O("}"),Se,k):void 0}function Se(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||qe&&b(t))&&Qe.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(Qe.marked="keyword",p(Se)):"variable"==e||"keyword"==Qe.style?(Qe.marked="property",p(qe?Te:ye,Se)):"number"==e||"string"==e?p(qe?Te:ye,Se):"["==e?p(E,J,S("]"),qe?Te:ye,Se):"*"==t?(Qe.marked="keyword",p(Se)):qe&&"("==e?f(we,Se):";"==e||","==e?p(Se):"}"==e?p():"@"==t?p(E,Se):void 0}function Te(e,t){if("?"==t)return p(Te);if(":"==e)return p(te,fe);if("="==t)return p(_);var n=Qe.state.lexical.prev,r=n&&"interface"==n.info;return f(r?we:ye)}function Pe(e,t){return"*"==t?(Qe.marked="keyword",p(Le,S(";"))):"default"==t?(Qe.marked="keyword",p(E,S(";"))):"{"==e?p(K(Ee,"}"),Le,S(";")):f(T)}function Ee(e,t){return"as"==t?(Qe.marked="keyword",p(S("variable"))):"variable"==e?f(_,Ee):void 0}function _e(e){return"string"==e?p():"("==e?f(E):f(De,Me,Le)}function De(e,t){return"{"==e?Y(De,"}"):("variable"==e&&m(t),"*"==t&&(Qe.marked="keyword"),p(Ae))}function Me(e){if(","==e)return p(De,Me)}function Ae(e,t){if("as"==t)return Qe.marked="keyword",p(De)}function Le(e,t){if("from"==t)return Qe.marked="keyword",p(E)}function Ne(e){return"]"==e?p():f(K(_,"]"))}function Ve(){return f(O("form"),ue,S("{"),O("}"),K(Ie,"}"),k,k)}function Ie(){return f(ue,fe)}function Fe(e,t){return"operator"==e.lastType||","==e.lastType||Ye.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}function Re(e,t,n){return t.tokenize==o&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(n||0)))}var He,ze,Be=t.indentUnit,$e=n.statementIndent,We=n.jsonld,Ue=n.json||We,qe=n.typescript,Ge=n.wordCharacters||/[\w$\xa1-\uffff]/,Ke=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),n=e("keyword b"),r=e("keyword c"),i=e("keyword d"),o=e("operator"),s={type:"atom",style:"atom"};return{"if":e("if"),"while":t,"with":t,"else":n,"do":n,"try":n,"finally":n,"return":i,"break":i,"continue":i,"new":e("new"),"delete":r,"void":r,"throw":r,"debugger":e("debugger"),"var":e("var"),"const":e("var"),"let":e("var"),"function":e("function"),"catch":e("catch"),"for":e("for"),"switch":e("switch"),"case":e("case"),"default":e("default"),"in":o,"typeof":o,"instanceof":o,"true":s,"false":s,"null":s,undefined:s,NaN:s,Infinity:s,"this":e("this"),"class":e("class"),"super":e("atom"),"yield":r,"export":e("export"),"import":e("import"),"extends":r,await:r}}(),Ye=/[+\-*&%=<>!?|~^@]/,Xe=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,Je="([{}])",Ze={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,"this":!0,"jsonld-keyword":!0},Qe={state:null,column:null,marked:null,cc:null},et=new w("this",new w("arguments",null));return j.lex=!0,k.lex=!0,{startState:function(e){var t={tokenize:o,lastType:"sof",cc:[],lexical:new u((e||0)-Be,0,"block",(!1)),localVars:n.localVars,context:n.localVars&&new y(null,null,(!1)),indented:e||0};return n.globalVars&&"object"==typeof n.globalVars&&(t.globalVars=n.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),c(e,t)),t.tokenize!=a&&e.eatSpace())return null;var n=t.tokenize(e,t);return"comment"==He?n:(t.lastType="operator"!=He||"++"!=ze&&"--"!=ze?He:"incdec",h(t,n,He,ze,e))},indent:function(t,r){if(t.tokenize==a)return e.Pass;if(t.tokenize!=o)return 0;var i,s=r&&r.charAt(0),l=t.lexical;if(!/^\s*else\b/.test(r))for(var c=t.cc.length-1;c>=0;--c){var u=t.cc[c];if(u==k)l=l.prev;else if(u!=ge)break}for(;("stat"==l.type||"form"==l.type)&&("}"==s||(i=t.cc[t.cc.length-1])&&(i==L||i==N)&&!/^[,\.=+\-*:?[\(]/.test(r));)l=l.prev;$e&&")"==l.type&&"stat"==l.prev.type&&(l=l.prev);var d=l.type,h=s==d;return"vardef"==d?l.indented+("operator"==t.lastType||","==t.lastType?l.info.length+1:0):"form"==d&&"{"==s?l.indented:"form"==d?l.indented+Be:"stat"==d?l.indented+(Fe(t,r)?$e||Be:0):"switch"!=l.info||h||0==n.doubleIndentSwitch?l.align?l.column+(h?0:1):l.indented+(h?0:Be):l.indented+(/^(?:case|default)\b/.test(r)?Be:2*Be)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:Ue?null:"/*",blockCommentEnd:Ue?null:"*/",blockCommentContinue:Ue?null:" * ",lineComment:Ue?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:Ue?"json":"javascript",jsonldMode:We,jsonMode:Ue,expressionAllowed:Re,skipExpression:function(e){var t=e.cc[e.cc.length-1];t!=E&&t!=_||e.cc.pop()}}}),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})})},"./node_modules/codemirror/mode/xml/xml.js":function(e,t,n){!function(e){e(n("./node_modules/codemirror/lib/codemirror.js"))}(function(e){"use strict";var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},n={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};e.defineMode("xml",function(r,i){function o(e,t){function n(n){return t.tokenize=n,n(e,t)}var r=e.next();if("<"==r)return e.eat("!")?e.eat("[")?e.match("CDATA[")?n(l("atom","]]>")):null:e.match("--")?n(l("comment","-->")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(c(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=l("meta","?>"),"meta"):(S=e.eat("/")?"closeTag":"openTag",t.tokenize=s,"tag bracket");if("&"==r){var i;return i=e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"),i?"atom":"error"}return e.eatWhile(/[^&<]/),null}function s(e,t){var n=e.next();if(">"==n||"/"==n&&e.eat(">"))return t.tokenize=o,S=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return S="equals",null;if("<"==n){t.tokenize=o,t.state=f,t.tagName=t.tagStart=null;var r=t.tokenize(e,t);return r?r+" tag error":"tag error"}return/[\'\"]/.test(n)?(t.tokenize=a(n),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function a(e){var t=function(t,n){for(;!t.eol();)if(t.next()==e){n.tokenize=s;break}return"string"};return t.isInAttribute=!0,t}function l(e,t){return function(n,r){for(;!n.eol();){if(n.match(t)){r.tokenize=o;break}n.next()}return e}}function c(e){return function(t,n){for(var r;null!=(r=t.next());){if("<"==r)return n.tokenize=c(e+1),n.tokenize(t,n);if(">"==r){if(1==e){n.tokenize=o;break}return n.tokenize=c(e-1),n.tokenize(t,n)}}return"meta"}}function u(e,t,n){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=n,(j.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function d(e){e.context&&(e.context=e.context.prev)}function h(e,t){for(var n;;){if(!e.context)return;if(n=e.context.tagName,!j.contextGrabbers.hasOwnProperty(n)||!j.contextGrabbers[n].hasOwnProperty(t))return;d(e)}}function f(e,t,n){return"openTag"==e?(n.tagStart=t.column(),p):"closeTag"==e?g:f}function p(e,t,n){return"word"==e?(n.tagName=t.current(),T="tag",b):j.allowMissingTagName&&"endTag"==e?(T="tag bracket",b(e,t,n)):(T="error",p)}function g(e,t,n){if("word"==e){var r=t.current();return n.context&&n.context.tagName!=r&&j.implicitlyClosed.hasOwnProperty(n.context.tagName)&&d(n),n.context&&n.context.tagName==r||j.matchClosing===!1?(T="tag",m):(T="tag error",v)}return j.allowMissingTagName&&"endTag"==e?(T="tag bracket",m(e,t,n)):(T="error",v)}function m(e,t,n){return"endTag"!=e?(T="error",m):(d(n),f)}function v(e,t,n){return T="error",m(e,t,n)}function b(e,t,n){if("word"==e)return T="attribute",y;if("endTag"==e||"selfcloseTag"==e){var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||j.autoSelfClosers.hasOwnProperty(r)?h(n,r):(h(n,r),n.context=new u(n,r,i==n.indented)),f}return T="error",b}function y(e,t,n){return"equals"==e?w:(j.allowMissing||(T="error"),b(e,t,n))}function w(e,t,n){return"string"==e?x:"word"==e&&j.allowUnquoted?(T="string",b):(T="error",b(e,t,n))}function x(e,t,n){return"string"==e?x:b(e,t,n)}var C=r.indentUnit,j={},O=i.htmlMode?t:n;for(var k in O)j[k]=O[k];for(var k in i)j[k]=i[k];var S,T;return o.isInText=!0,{startState:function(e){var t={tokenize:o,state:f,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;S=null;var n=t.tokenize(e,t);return(n||S)&&"comment"!=n&&(T=null,t.state=t.state(S||n,e,t),T&&(n="error"==T?n+" error":T)),n},indent:function(t,n,r){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+C;if(i&&i.noIndent)return e.Pass;if(t.tokenize!=s&&t.tokenize!=o)return r?r.match(/^(\s*)/)[0].length:0;if(t.tagName)return j.multilineTagIndentPastTag!==!1?t.tagStart+t.tagName.length+2:t.tagStart+C*(j.multilineTagIndentFactor||1);if(j.alignCDATA&&/<!\[CDATA\[/.test(n))return 0;var a=n&&/^<(\/)?([\w_:\.-]*)/.exec(n);if(a&&a[1])for(;i;){if(i.tagName==a[2]){i=i.prev;break}if(!j.implicitlyClosed.hasOwnProperty(i.tagName))break;i=i.prev}else if(a)for(;i;){var l=j.contextGrabbers[i.tagName];if(!l||!l.hasOwnProperty(a[2]))break;i=i.prev}for(;i&&i.prev&&!i.startOfLine;)i=i.prev;return i?i.indent+C:t.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:j.htmlMode?"html":"xml",helperType:j.htmlMode?"html":"xml",skipAttribute:function(e){e.state==w&&(e.state=b)},xmlCurrentTag:function(e){return e.tagName?{name:e.tagName,close:"closeTag"==e.type}:null},xmlCurrentContext:function(e){for(var t=[],n=e.context;n;n=n.prev)n.tagName&&t.push(n.tagName);return t.reverse()}}}),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"./node_modules/keymaster/keymaster.js":function(e,t,n){!function(t){function n(e,t){for(var n=e.length;n--;)if(e[n]===t)return n;return-1}function r(e,t){if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function i(e){for(w in C)C[w]=e[P[w]]}function o(e){var t,r,o,s,a,c;if(t=e.keyCode,n(T,t)==-1&&T.push(t),93!=t&&224!=t||(t=91),t in C){C[t]=!0;for(o in O)O[o]==t&&(l[o]=!0)}else if(i(e),l.filter.call(this,e)&&t in x)for(c=p(),s=0;s<x[t].length;s++)if(r=x[t][s],r.scope==c||"all"==r.scope){a=r.mods.length>0;for(o in C)(!C[o]&&n(r.mods,+o)>-1||C[o]&&n(r.mods,+o)==-1)&&(a=!1);(0!=r.mods.length||C[16]||C[18]||C[17]||C[91])&&!a||r.method(e,r)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}function s(e){var t,r=e.keyCode,i=n(T,r);if(i>=0&&T.splice(i,1),93!=r&&224!=r||(r=91),r in C){C[r]=!1;for(t in O)O[t]==r&&(l[t]=!1)}}function a(){for(w in C)C[w]=!1;for(w in O)l[w]=!1}function l(e,t,n){var r,i;r=m(e),void 0===n&&(n=t,t="all");for(var o=0;o<r.length;o++)i=[],e=r[o].split("+"),e.length>1&&(i=v(e),e=[e[e.length-1]]),e=e[0],e=S(e),e in x||(x[e]=[]),x[e].push({shortcut:r[o],scope:t,method:n,key:r[o],mods:i})}function c(e,t){var n,i,o,s,a,l=[];for(n=m(e),s=0;s<n.length;s++){if(i=n[s].split("+"),i.length>1&&(l=v(i),e=i[i.length-1]),e=S(e),void 0===t&&(t=p()),!x[e])return;for(o=0;o<x[e].length;o++)a=x[e][o],a.scope===t&&r(a.mods,l)&&(x[e][o]={})}}function u(e){return"string"==typeof e&&(e=S(e)),n(T,e)!=-1}function d(){return T.slice(0)}function h(e){var t=(e.target||e.srcElement).tagName;return!("INPUT"==t||"SELECT"==t||"TEXTAREA"==t)}function f(e){j=e||"all"}function p(){return j||"all"}function g(e){var t,n,r;for(t in x)for(n=x[t],r=0;r<n.length;)n[r].scope===e?n.splice(r,1):r++}function m(e){var t;return e=e.replace(/\s/g,""),t=e.split(","),""==t[t.length-1]&&(t[t.length-2]+=","),t}function v(e){for(var t=e.slice(0,e.length-1),n=0;n<t.length;n++)t[n]=O[t[n]];return t}function b(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent&&e.attachEvent("on"+t,function(){n(window.event)})}function y(){var e=t.key;return t.key=E,e}var w,x={},C={16:!1,18:!1,17:!1,91:!1},j="all",O={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,command:91},k={backspace:8,tab:9,clear:12,enter:13,"return":13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,"delete":46,home:36,end:35,pageup:33,pagedown:34,",":188,".":190,"/":191,"`":192,"-":189,"=":187,";":186,"'":222,"[":219,"]":221,"\\":220},S=function(e){return k[e]||e.toUpperCase().charCodeAt(0)},T=[];for(w=1;w<20;w++)k["f"+w]=111+w;var P={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey"};for(w in O)l[w]=!1;b(document,"keydown",function(e){o(e)}),b(document,"keyup",s),b(window,"focus",a);var E=t.key;t.key=l,t.key.setScope=f,t.key.getScope=p,t.key.deleteScope=g,t.key.filter=h,t.key.isPressed=u,t.key.getPressedKeyCodes=d,t.key.noConflict=y,t.key.unbind=c,e.exports=l}(this)},"./node_modules/process/browser.js":function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function i(e){if(u===setTimeout)return setTimeout(e,0);if((u===n||!u)&&setTimeout)return u=setTimeout,setTimeout(e,0);try{return u(e,0)}catch(t){try{return u.call(null,e,0)}catch(t){return u.call(this,e,0)}}}function o(e){if(d===clearTimeout)return clearTimeout(e);if((d===r||!d)&&clearTimeout)return d=clearTimeout,clearTimeout(e);try{return d(e)}catch(t){try{return d.call(null,e)}catch(t){return d.call(this,e)}}}function s(){g&&f&&(g=!1,f.length?p=f.concat(p):m=-1,p.length&&a())}function a(){if(!g){var e=i(s);g=!0;for(var t=p.length;t;){for(f=p,p=[];++m<t;)f&&f[m].run();m=-1,t=p.length}f=null,g=!1,o(e)}}function l(e,t){this.fun=e,this.array=t}function c(){}var u,d,h=e.exports={};!function(){try{u="function"==typeof setTimeout?setTimeout:n}catch(e){u=n}try{d="function"==typeof clearTimeout?clearTimeout:r}catch(e){d=r}}();var f,p=[],g=!1,m=-1;h.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];p.push(new l(e,t)),1!==p.length||g||i(a)},l.prototype.run=function(){this.fun.apply(null,this.array)},h.title="browser",h.browser=!0,h.env={},h.argv=[],h.version="",h.versions={},h.on=c,h.addListener=c,h.once=c,h.off=c,h.removeListener=c,h.removeAllListeners=c,h.emit=c,h.prependListener=c,h.prependOnceListener=c,h.listeners=function(e){return[]},h.binding=function(e){throw new Error("process.binding is not supported")},h.cwd=function(){return"/"},h.chdir=function(e){throw new Error("process.chdir is not supported")},h.umask=function(){return 0}},"./node_modules/promise-polyfill/src/finally.js":function(e,t,n){"use strict";function r(e){var t=this.constructor;return this.then(function(n){return t.resolve(e()).then(function(){return n})},function(n){return t.resolve(e()).then(function(){return t.reject(n)})})}n.r(t),t["default"]=r},"./node_modules/promise-polyfill/src/index.js":function(e,t,n){"use strict";n.r(t),function(e){function r(e){return Boolean(e&&"undefined"!=typeof e.length)}function i(){}function o(e,t){return function(){e.apply(t,arguments)}}function s(e){if(!(this instanceof s))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],h(e,this)}function a(e,t){for(;3===e._state;)e=e._value;return 0===e._state?void e._deferreds.push(t):(e._handled=!0,void s._immediateFn(function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null===n)return void(1===e._state?l:c)(t.promise,e._value);var r;try{r=n(e._value)}catch(i){return void c(t.promise,i)}l(t.promise,r)}))}function l(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if(t instanceof s)return e._state=3,e._value=t,void u(e);if("function"==typeof n)return void h(o(n,t),e)}e._state=1,e._value=t,u(e)}catch(r){c(e,r)}}function c(e,t){e._state=2,e._value=t,u(e)}function u(e){2===e._state&&0===e._deferreds.length&&s._immediateFn(function(){e._handled||s._unhandledRejectionFn(e._value)});for(var t=0,n=e._deferreds.length;t<n;t++)a(e,e._deferreds[t]);e._deferreds=null}function d(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}function h(e,t){var n=!1;try{e(function(e){n||(n=!0,l(t,e))},function(e){n||(n=!0,c(t,e))})}catch(r){if(n)return;n=!0,c(t,r)}}var f=n("./node_modules/promise-polyfill/src/finally.js"),p=setTimeout;s.prototype["catch"]=function(e){return this.then(null,e)},s.prototype.then=function(e,t){var n=new this.constructor(i);return a(this,new d(e,t,n)),n},s.prototype["finally"]=f["default"],s.all=function(e){return new s(function(t,n){function i(e,r){try{if(r&&("object"==typeof r||"function"==typeof r)){var a=r.then;if("function"==typeof a)return void a.call(r,function(t){i(e,t)},n)}o[e]=r,0===--s&&t(o)}catch(l){n(l)}}if(!r(e))return n(new TypeError("Promise.all accepts an array"));var o=Array.prototype.slice.call(e);if(0===o.length)return t([]);for(var s=o.length,a=0;a<o.length;a++)i(a,o[a])})},s.resolve=function(e){return e&&"object"==typeof e&&e.constructor===s?e:new s(function(t){t(e)})},s.reject=function(e){return new s(function(t,n){n(e)})},s.race=function(e){return new s(function(t,n){if(!r(e))return n(new TypeError("Promise.race accepts an array"));for(var i=0,o=e.length;i<o;i++)s.resolve(e[i]).then(t,n)})},s._immediateFn="function"==typeof e&&function(t){e(t)}||function(e){p(e,0)},s._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)},t["default"]=s}.call(this,n("./node_modules/timers-browserify/main.js").setImmediate)},"./node_modules/setimmediate/setImmediate.js":function(e,t,n){(function(e,t){!function(e,n){"use strict";function r(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var r={callback:e,args:t};return g[p]=r,f(p),p++}function i(e){delete g[e]}function o(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(n,r)}}function s(e){if(m)setTimeout(s,0,e);else{var t=g[e];if(t){m=!0;try{o(t)}finally{i(e),m=!1}}}}function a(){f=function(e){t.nextTick(function(){s(e)})}}function l(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}function c(){var t="setImmediate$"+Math.random()+"$",n=function(n){n.source===e&&"string"==typeof n.data&&0===n.data.indexOf(t)&&s(+n.data.slice(t.length))};e.addEventListener?e.addEventListener("message",n,!1):e.attachEvent("onmessage",n),f=function(n){e.postMessage(t+n,"*")}}function u(){var e=new MessageChannel;e.port1.onmessage=function(e){var t=e.data;s(t)},f=function(t){e.port2.postMessage(t)}}function d(){var e=v.documentElement;f=function(t){var n=v.createElement("script");n.onreadystatechange=function(){s(t),n.onreadystatechange=null,e.removeChild(n),n=null},e.appendChild(n)}}function h(){f=function(e){setTimeout(s,0,e)}}if(!e.setImmediate){var f,p=1,g={},m=!1,v=e.document,b=Object.getPrototypeOf&&Object.getPrototypeOf(e);b=b&&b.setTimeout?b:e,"[object process]"==={}.toString.call(e.process)?a():l()?c():e.MessageChannel?u():v&&"onreadystatechange"in v.createElement("script")?d():h(),b.setImmediate=r,b.clearImmediate=i}}("undefined"==typeof self?"undefined"==typeof e?this:e:self)}).call(this,n("./node_modules/webpack/buildin/global.js"),n("./node_modules/process/browser.js"))},"./node_modules/timers-browserify/main.js":function(e,t,n){(function(e){function r(e,t){this._id=e,this._clearFn=t}var i="undefined"!=typeof e&&e||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;t.setTimeout=function(){return new r(o.call(setTimeout,i,arguments),clearTimeout)},t.setInterval=function(){return new r(o.call(setInterval,i,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},r.prototype.unref=r.prototype.ref=function(){},r.prototype.close=function(){this._clearFn.call(i,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n("./node_modules/setimmediate/setImmediate.js"),t.setImmediate="undefined"!=typeof self&&self.setImmediate||"undefined"!=typeof e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||"undefined"!=typeof e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n("./node_modules/webpack/buildin/global.js"))},"./node_modules/underscore/underscore.js":function(e,t,n){(function(e,n){var r,i;!function(){var o="object"==typeof self&&self.self===self&&self||"object"==typeof e&&e.global===e&&e||this||{},s=o._,a=Array.prototype,l=Object.prototype,c="undefined"!=typeof Symbol?Symbol.prototype:null,u=a.push,d=a.slice,h=l.toString,f=l.hasOwnProperty,p=Array.isArray,g=Object.keys,m=Object.create,v=function(){},b=function(e){return e instanceof b?e:this instanceof b?void(this._wrapped=e):new b(e)};t.nodeType?o._=b:(!n.nodeType&&n.exports&&(t=n.exports=b),t._=b),b.VERSION="1.9.1";var y,w=function(e,t,n){if(void 0===t)return e;switch(null==n?3:n){case 1:return function(n){return e.call(t,n)};case 3:return function(n,r,i){return e.call(t,n,r,i)};case 4:return function(n,r,i,o){return e.call(t,n,r,i,o)}}return function(){return e.apply(t,arguments)}},x=function(e,t,n){return b.iteratee!==y?b.iteratee(e,t):null==e?b.identity:b.isFunction(e)?w(e,t,n):b.isObject(e)&&!b.isArray(e)?b.matcher(e):b.property(e)};b.iteratee=y=function(e,t){return x(e,t,1/0)};var C=function(e,t){return t=null==t?e.length-1:+t,function(){for(var n=Math.max(arguments.length-t,0),r=Array(n),i=0;i<n;i++)r[i]=arguments[i+t];switch(t){case 0:return e.call(this,r);case 1:return e.call(this,arguments[0],r);case 2:return e.call(this,arguments[0],arguments[1],r)}var o=Array(t+1);for(i=0;i<t;i++)o[i]=arguments[i];return o[t]=r,e.apply(this,o)}},j=function(e){if(!b.isObject(e))return{};if(m)return m(e);v.prototype=e;var t=new v;return v.prototype=null,t},O=function(e){return function(t){return null==t?void 0:t[e]}},k=function(e,t){return null!=e&&f.call(e,t)},S=function(e,t){for(var n=t.length,r=0;r<n;r++){if(null==e)return;e=e[t[r]]}return n?e:void 0},T=Math.pow(2,53)-1,P=O("length"),E=function(e){var t=P(e);return"number"==typeof t&&t>=0&&t<=T};b.each=b.forEach=function(e,t,n){t=w(t,n);var r,i;if(E(e))for(r=0,i=e.length;r<i;r++)t(e[r],r,e);else{var o=b.keys(e);for(r=0,i=o.length;r<i;r++)t(e[o[r]],o[r],e)}return e},b.map=b.collect=function(e,t,n){t=x(t,n);for(var r=!E(e)&&b.keys(e),i=(r||e).length,o=Array(i),s=0;s<i;s++){var a=r?r[s]:s;o[s]=t(e[a],a,e)}return o};var _=function(e){var t=function(t,n,r,i){var o=!E(t)&&b.keys(t),s=(o||t).length,a=e>0?0:s-1;for(i||(r=t[o?o[a]:a],a+=e);a>=0&&a<s;a+=e){var l=o?o[a]:a;r=n(r,t[l],l,t)}return r};return function(e,n,r,i){var o=arguments.length>=3;return t(e,w(n,i,4),r,o)}};b.reduce=b.foldl=b.inject=_(1),b.reduceRight=b.foldr=_(-1),b.find=b.detect=function(e,t,n){var r=E(e)?b.findIndex:b.findKey,i=r(e,t,n);if(void 0!==i&&i!==-1)return e[i]},b.filter=b.select=function(e,t,n){var r=[];return t=x(t,n),b.each(e,function(e,n,i){t(e,n,i)&&r.push(e)}),r},b.reject=function(e,t,n){return b.filter(e,b.negate(x(t)),n)},b.every=b.all=function(e,t,n){t=x(t,n);for(var r=!E(e)&&b.keys(e),i=(r||e).length,o=0;o<i;o++){var s=r?r[o]:o;if(!t(e[s],s,e))return!1}return!0},b.some=b.any=function(e,t,n){t=x(t,n);for(var r=!E(e)&&b.keys(e),i=(r||e).length,o=0;o<i;o++){var s=r?r[o]:o;if(t(e[s],s,e))return!0}return!1},b.contains=b.includes=b.include=function(e,t,n,r){return E(e)||(e=b.values(e)),("number"!=typeof n||r)&&(n=0),b.indexOf(e,t,n)>=0},b.invoke=C(function(e,t,n){var r,i;return b.isFunction(t)?i=t:b.isArray(t)&&(r=t.slice(0,-1),t=t[t.length-1]),b.map(e,function(e){var o=i;if(!o){if(r&&r.length&&(e=S(e,r)),null==e)return;o=e[t]}return null==o?o:o.apply(e,n)})}),b.pluck=function(e,t){return b.map(e,b.property(t))},b.where=function(e,t){return b.filter(e,b.matcher(t))},b.findWhere=function(e,t){return b.find(e,b.matcher(t))},b.max=function(e,t,n){var r,i,o=-(1/0),s=-(1/0);if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e){e=E(e)?e:b.values(e);for(var a=0,l=e.length;a<l;a++)r=e[a],null!=r&&r>o&&(o=r)}else t=x(t,n),b.each(e,function(e,n,r){i=t(e,n,r),(i>s||i===-(1/0)&&o===-(1/0))&&(o=e,s=i)});return o},b.min=function(e,t,n){var r,i,o=1/0,s=1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e){e=E(e)?e:b.values(e);for(var a=0,l=e.length;a<l;a++)r=e[a],null!=r&&r<o&&(o=r)}else t=x(t,n),b.each(e,function(e,n,r){i=t(e,n,r),(i<s||i===1/0&&o===1/0)&&(o=e,s=i)});return o},b.shuffle=function(e){return b.sample(e,1/0)},b.sample=function(e,t,n){if(null==t||n)return E(e)||(e=b.values(e)),e[b.random(e.length-1)];var r=E(e)?b.clone(e):b.values(e),i=P(r);t=Math.max(Math.min(t,i),0);for(var o=i-1,s=0;s<t;s++){var a=b.random(s,o),l=r[s];r[s]=r[a],r[a]=l}return r.slice(0,t)},b.sortBy=function(e,t,n){var r=0;return t=x(t,n),b.pluck(b.map(e,function(e,n,i){return{value:e,index:r++,criteria:t(e,n,i)}}).sort(function(e,t){var n=e.criteria,r=t.criteria;if(n!==r){if(n>r||void 0===n)return 1;if(n<r||void 0===r)return-1}return e.index-t.index}),"value")};var D=function(e,t){return function(n,r,i){var o=t?[[],[]]:{};return r=x(r,i),b.each(n,function(t,i){var s=r(t,i,n);e(o,t,s)}),o}};b.groupBy=D(function(e,t,n){k(e,n)?e[n].push(t):e[n]=[t]}),b.indexBy=D(function(e,t,n){e[n]=t}),b.countBy=D(function(e,t,n){k(e,n)?e[n]++:e[n]=1});var M=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;b.toArray=function(e){return e?b.isArray(e)?d.call(e):b.isString(e)?e.match(M):E(e)?b.map(e,b.identity):b.values(e):[]},b.size=function(e){return null==e?0:E(e)?e.length:b.keys(e).length},b.partition=D(function(e,t,n){e[n?0:1].push(t)},!0),b.first=b.head=b.take=function(e,t,n){return null==e||e.length<1?null==t?void 0:[]:null==t||n?e[0]:b.initial(e,e.length-t)},b.initial=function(e,t,n){return d.call(e,0,Math.max(0,e.length-(null==t||n?1:t)))},b.last=function(e,t,n){return null==e||e.length<1?null==t?void 0:[]:null==t||n?e[e.length-1]:b.rest(e,Math.max(0,e.length-t))},b.rest=b.tail=b.drop=function(e,t,n){return d.call(e,null==t||n?1:t)},b.compact=function(e){return b.filter(e,Boolean)};var A=function(e,t,n,r){r=r||[];for(var i=r.length,o=0,s=P(e);o<s;o++){var a=e[o];if(E(a)&&(b.isArray(a)||b.isArguments(a)))if(t)for(var l=0,c=a.length;l<c;)r[i++]=a[l++];else A(a,t,n,r),i=r.length;else n||(r[i++]=a)}return r};b.flatten=function(e,t){return A(e,t,!1)},b.without=C(function(e,t){return b.difference(e,t)}),b.uniq=b.unique=function(e,t,n,r){b.isBoolean(t)||(r=n,n=t,t=!1),null!=n&&(n=x(n,r));for(var i=[],o=[],s=0,a=P(e);s<a;s++){var l=e[s],c=n?n(l,s,e):l;t&&!n?(s&&o===c||i.push(l),o=c):n?b.contains(o,c)||(o.push(c),i.push(l)):b.contains(i,l)||i.push(l)}return i},b.union=C(function(e){return b.uniq(A(e,!0,!0))}),b.intersection=function(e){for(var t=[],n=arguments.length,r=0,i=P(e);r<i;r++){var o=e[r];if(!b.contains(t,o)){var s;for(s=1;s<n&&b.contains(arguments[s],o);s++);s===n&&t.push(o)}}return t},b.difference=C(function(e,t){return t=A(t,!0,!0),b.filter(e,function(e){return!b.contains(t,e)})}),b.unzip=function(e){for(var t=e&&b.max(e,P).length||0,n=Array(t),r=0;r<t;r++)n[r]=b.pluck(e,r);return n},b.zip=C(b.unzip),b.object=function(e,t){for(var n={},r=0,i=P(e);r<i;r++)t?n[e[r]]=t[r]:n[e[r][0]]=e[r][1];return n};var L=function(e){return function(t,n,r){n=x(n,r);for(var i=P(t),o=e>0?0:i-1;o>=0&&o<i;o+=e)if(n(t[o],o,t))return o;return-1}};b.findIndex=L(1),b.findLastIndex=L(-1),
|
||
b.sortedIndex=function(e,t,n,r){n=x(n,r,1);for(var i=n(t),o=0,s=P(e);o<s;){var a=Math.floor((o+s)/2);n(e[a])<i?o=a+1:s=a}return o};var N=function(e,t,n){return function(r,i,o){var s=0,a=P(r);if("number"==typeof o)e>0?s=o>=0?o:Math.max(o+a,s):a=o>=0?Math.min(o+1,a):o+a+1;else if(n&&o&&a)return o=n(r,i),r[o]===i?o:-1;if(i!==i)return o=t(d.call(r,s,a),b.isNaN),o>=0?o+s:-1;for(o=e>0?s:a-1;o>=0&&o<a;o+=e)if(r[o]===i)return o;return-1}};b.indexOf=N(1,b.findIndex,b.sortedIndex),b.lastIndexOf=N(-1,b.findLastIndex),b.range=function(e,t,n){null==t&&(t=e||0,e=0),n||(n=t<e?-1:1);for(var r=Math.max(Math.ceil((t-e)/n),0),i=Array(r),o=0;o<r;o++,e+=n)i[o]=e;return i},b.chunk=function(e,t){if(null==t||t<1)return[];for(var n=[],r=0,i=e.length;r<i;)n.push(d.call(e,r,r+=t));return n};var V=function(e,t,n,r,i){if(!(r instanceof t))return e.apply(n,i);var o=j(e.prototype),s=e.apply(o,i);return b.isObject(s)?s:o};b.bind=C(function(e,t,n){if(!b.isFunction(e))throw new TypeError("Bind must be called on a function");var r=C(function(i){return V(e,r,t,this,n.concat(i))});return r}),b.partial=C(function(e,t){var n=b.partial.placeholder,r=function(){for(var i=0,o=t.length,s=Array(o),a=0;a<o;a++)s[a]=t[a]===n?arguments[i++]:t[a];for(;i<arguments.length;)s.push(arguments[i++]);return V(e,r,this,this,s)};return r}),b.partial.placeholder=b,b.bindAll=C(function(e,t){t=A(t,!1,!1);var n=t.length;if(n<1)throw new Error("bindAll must be passed function names");for(;n--;){var r=t[n];e[r]=b.bind(e[r],e)}}),b.memoize=function(e,t){var n=function(r){var i=n.cache,o=""+(t?t.apply(this,arguments):r);return k(i,o)||(i[o]=e.apply(this,arguments)),i[o]};return n.cache={},n},b.delay=C(function(e,t,n){return setTimeout(function(){return e.apply(null,n)},t)}),b.defer=b.partial(b.delay,b,1),b.throttle=function(e,t,n){var r,i,o,s,a=0;n||(n={});var l=function(){a=n.leading===!1?0:b.now(),r=null,s=e.apply(i,o),r||(i=o=null)},c=function(){var c=b.now();a||n.leading!==!1||(a=c);var u=t-(c-a);return i=this,o=arguments,u<=0||u>t?(r&&(clearTimeout(r),r=null),a=c,s=e.apply(i,o),r||(i=o=null)):r||n.trailing===!1||(r=setTimeout(l,u)),s};return c.cancel=function(){clearTimeout(r),a=0,r=i=o=null},c},b.debounce=function(e,t,n){var r,i,o=function(t,n){r=null,n&&(i=e.apply(t,n))},s=C(function(s){if(r&&clearTimeout(r),n){var a=!r;r=setTimeout(o,t),a&&(i=e.apply(this,s))}else r=b.delay(o,t,this,s);return i});return s.cancel=function(){clearTimeout(r),r=null},s},b.wrap=function(e,t){return b.partial(t,e)},b.negate=function(e){return function(){return!e.apply(this,arguments)}},b.compose=function(){var e=arguments,t=e.length-1;return function(){for(var n=t,r=e[t].apply(this,arguments);n--;)r=e[n].call(this,r);return r}},b.after=function(e,t){return function(){if(--e<1)return t.apply(this,arguments)}},b.before=function(e,t){var n;return function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=null),n}},b.once=b.partial(b.before,2),b.restArguments=C;var I=!{toString:null}.propertyIsEnumerable("toString"),F=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],R=function(e,t){var n=F.length,r=e.constructor,i=b.isFunction(r)&&r.prototype||l,o="constructor";for(k(e,o)&&!b.contains(t,o)&&t.push(o);n--;)o=F[n],o in e&&e[o]!==i[o]&&!b.contains(t,o)&&t.push(o)};b.keys=function(e){if(!b.isObject(e))return[];if(g)return g(e);var t=[];for(var n in e)k(e,n)&&t.push(n);return I&&R(e,t),t},b.allKeys=function(e){if(!b.isObject(e))return[];var t=[];for(var n in e)t.push(n);return I&&R(e,t),t},b.values=function(e){for(var t=b.keys(e),n=t.length,r=Array(n),i=0;i<n;i++)r[i]=e[t[i]];return r},b.mapObject=function(e,t,n){t=x(t,n);for(var r=b.keys(e),i=r.length,o={},s=0;s<i;s++){var a=r[s];o[a]=t(e[a],a,e)}return o},b.pairs=function(e){for(var t=b.keys(e),n=t.length,r=Array(n),i=0;i<n;i++)r[i]=[t[i],e[t[i]]];return r},b.invert=function(e){for(var t={},n=b.keys(e),r=0,i=n.length;r<i;r++)t[e[n[r]]]=n[r];return t},b.functions=b.methods=function(e){var t=[];for(var n in e)b.isFunction(e[n])&&t.push(n);return t.sort()};var H=function(e,t){return function(n){var r=arguments.length;if(t&&(n=Object(n)),r<2||null==n)return n;for(var i=1;i<r;i++)for(var o=arguments[i],s=e(o),a=s.length,l=0;l<a;l++){var c=s[l];t&&void 0!==n[c]||(n[c]=o[c])}return n}};b.extend=H(b.allKeys),b.extendOwn=b.assign=H(b.keys),b.findKey=function(e,t,n){t=x(t,n);for(var r,i=b.keys(e),o=0,s=i.length;o<s;o++)if(r=i[o],t(e[r],r,e))return r};var z=function(e,t,n){return t in n};b.pick=C(function(e,t){var n={},r=t[0];if(null==e)return n;b.isFunction(r)?(t.length>1&&(r=w(r,t[1])),t=b.allKeys(e)):(r=z,t=A(t,!1,!1),e=Object(e));for(var i=0,o=t.length;i<o;i++){var s=t[i],a=e[s];r(a,s,e)&&(n[s]=a)}return n}),b.omit=C(function(e,t){var n,r=t[0];return b.isFunction(r)?(r=b.negate(r),t.length>1&&(n=t[1])):(t=b.map(A(t,!1,!1),String),r=function(e,n){return!b.contains(t,n)}),b.pick(e,r,n)}),b.defaults=H(b.allKeys,!0),b.create=function(e,t){var n=j(e);return t&&b.extendOwn(n,t),n},b.clone=function(e){return b.isObject(e)?b.isArray(e)?e.slice():b.extend({},e):e},b.tap=function(e,t){return t(e),e},b.isMatch=function(e,t){var n=b.keys(t),r=n.length;if(null==e)return!r;for(var i=Object(e),o=0;o<r;o++){var s=n[o];if(t[s]!==i[s]||!(s in i))return!1}return!0};var B,$;B=function(e,t,n,r){if(e===t)return 0!==e||1/e===1/t;if(null==e||null==t)return!1;if(e!==e)return t!==t;var i=typeof e;return("function"===i||"object"===i||"object"==typeof t)&&$(e,t,n,r)},$=function(e,t,n,r){e instanceof b&&(e=e._wrapped),t instanceof b&&(t=t._wrapped);var i=h.call(e);if(i!==h.call(t))return!1;switch(i){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!==+e?+t!==+t:0===+e?1/+e===1/t:+e===+t;case"[object Date]":case"[object Boolean]":return+e===+t;case"[object Symbol]":return c.valueOf.call(e)===c.valueOf.call(t)}var o="[object Array]"===i;if(!o){if("object"!=typeof e||"object"!=typeof t)return!1;var s=e.constructor,a=t.constructor;if(s!==a&&!(b.isFunction(s)&&s instanceof s&&b.isFunction(a)&&a instanceof a)&&"constructor"in e&&"constructor"in t)return!1}n=n||[],r=r||[];for(var l=n.length;l--;)if(n[l]===e)return r[l]===t;if(n.push(e),r.push(t),o){if(l=e.length,l!==t.length)return!1;for(;l--;)if(!B(e[l],t[l],n,r))return!1}else{var u,d=b.keys(e);if(l=d.length,b.keys(t).length!==l)return!1;for(;l--;)if(u=d[l],!k(t,u)||!B(e[u],t[u],n,r))return!1}return n.pop(),r.pop(),!0},b.isEqual=function(e,t){return B(e,t)},b.isEmpty=function(e){return null==e||(E(e)&&(b.isArray(e)||b.isString(e)||b.isArguments(e))?0===e.length:0===b.keys(e).length)},b.isElement=function(e){return!(!e||1!==e.nodeType)},b.isArray=p||function(e){return"[object Array]"===h.call(e)},b.isObject=function(e){var t=typeof e;return"function"===t||"object"===t&&!!e},b.each(["Arguments","Function","String","Number","Date","RegExp","Error","Symbol","Map","WeakMap","Set","WeakSet"],function(e){b["is"+e]=function(t){return h.call(t)==="[object "+e+"]"}}),b.isArguments(arguments)||(b.isArguments=function(e){return k(e,"callee")});var W=o.document&&o.document.childNodes;"object"!=typeof Int8Array&&"function"!=typeof W&&(b.isFunction=function(e){return"function"==typeof e||!1}),b.isFinite=function(e){return!b.isSymbol(e)&&isFinite(e)&&!isNaN(parseFloat(e))},b.isNaN=function(e){return b.isNumber(e)&&isNaN(e)},b.isBoolean=function(e){return e===!0||e===!1||"[object Boolean]"===h.call(e)},b.isNull=function(e){return null===e},b.isUndefined=function(e){return void 0===e},b.has=function(e,t){if(!b.isArray(t))return k(e,t);for(var n=t.length,r=0;r<n;r++){var i=t[r];if(null==e||!f.call(e,i))return!1;e=e[i]}return!!n},b.noConflict=function(){return o._=s,this},b.identity=function(e){return e},b.constant=function(e){return function(){return e}},b.noop=function(){},b.property=function(e){return b.isArray(e)?function(t){return S(t,e)}:O(e)},b.propertyOf=function(e){return null==e?function(){}:function(t){return b.isArray(t)?S(e,t):e[t]}},b.matcher=b.matches=function(e){return e=b.extendOwn({},e),function(t){return b.isMatch(t,e)}},b.times=function(e,t,n){var r=Array(Math.max(0,e));t=w(t,n,1);for(var i=0;i<e;i++)r[i]=t(i);return r},b.random=function(e,t){return null==t&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))},b.now=Date.now||function(){return(new Date).getTime()};var U={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},q=b.invert(U),G=function(e){var t=function(t){return e[t]},n="(?:"+b.keys(e).join("|")+")",r=RegExp(n),i=RegExp(n,"g");return function(e){return e=null==e?"":""+e,r.test(e)?e.replace(i,t):e}};b.escape=G(U),b.unescape=G(q),b.result=function(e,t,n){b.isArray(t)||(t=[t]);var r=t.length;if(!r)return b.isFunction(n)?n.call(e):n;for(var i=0;i<r;i++){var o=null==e?void 0:e[t[i]];void 0===o&&(o=n,i=r),e=b.isFunction(o)?o.call(e):o}return e};var K=0;b.uniqueId=function(e){var t=++K+"";return e?e+t:t},b.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var Y=/(.)^/,X={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},J=/\\|'|\r|\n|\u2028|\u2029/g,Z=function(e){return"\\"+X[e]};b.template=function(e,t,n){!t&&n&&(t=n),t=b.defaults({},t,b.templateSettings);var r=RegExp([(t.escape||Y).source,(t.interpolate||Y).source,(t.evaluate||Y).source].join("|")+"|$","g"),i=0,o="__p+='";e.replace(r,function(t,n,r,s,a){return o+=e.slice(i,a).replace(J,Z),i=a+t.length,n?o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?o+="'+\n((__t=("+r+"))==null?'':__t)+\n'":s&&(o+="';\n"+s+"\n__p+='"),t}),o+="';\n",t.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";var s;try{s=new Function(t.variable||"obj","_",o)}catch(a){throw a.source=o,a}var l=function(e){return s.call(this,e,b)},c=t.variable||"obj";return l.source="function("+c+"){\n"+o+"}",l},b.chain=function(e){var t=b(e);return t._chain=!0,t};var Q=function(e,t){return e._chain?b(t).chain():t};b.mixin=function(e){return b.each(b.functions(e),function(t){var n=b[t]=e[t];b.prototype[t]=function(){var e=[this._wrapped];return u.apply(e,arguments),Q(this,n.apply(b,e))}}),b},b.mixin(b),b.each(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=a[e];b.prototype[e]=function(){var n=this._wrapped;return t.apply(n,arguments),"shift"!==e&&"splice"!==e||0!==n.length||delete n[0],Q(this,n)}}),b.each(["concat","join","slice"],function(e){var t=a[e];b.prototype[e]=function(){return Q(this,t.apply(this._wrapped,arguments))}}),b.prototype.value=function(){return this._wrapped},b.prototype.valueOf=b.prototype.toJSON=b.prototype.value,b.prototype.toString=function(){return String(this._wrapped)},r=[],i=function(){return b}.apply(t,r),!(void 0!==i&&(n.exports=i))}()}).call(this,n("./node_modules/webpack/buildin/global.js"),n("./node_modules/webpack/buildin/module.js")(e))},"./node_modules/webpack/buildin/global.js":function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(r){"object"==typeof window&&(n=window)}e.exports=n},"./node_modules/webpack/buildin/module.js":function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},"./src/asset_manager/config/config.js":function(e,t,n){"use strict";n.r(t),t["default"]={assets:[],noAssets:"",stylePrefix:"am-",upload:0,uploadName:"files",headers:{},params:{},credentials:"include",multiUpload:!0,autoAdd:1,customFetch:"",uploadFile:"",embedAsBase64:1,handleAdd:"",dropzone:0,openAssetsOnDrop:1,dropzoneContent:"",beforeUpload:null,showUrlInput:!0}},"./src/asset_manager/index.js":function(e,t,n){"use strict";n.r(t);var r=n("./src/asset_manager/config/config.js"),i=n("./src/asset_manager/model/Assets.js"),o=n("./src/asset_manager/view/AssetsView.js"),s=n("./src/asset_manager/view/FileUploader.js");t["default"]=function(){var e,t,n,a={};return{name:"AssetManager",storageKey:"assets",getConfig:function(){return a},init:function(l){var c=this;a=l||{};for(var u in r["default"])u in a||(a[u]=r["default"][u]);var d=a.pStylePrefix,h=a.em;d&&(a.stylePrefix=d+a.stylePrefix),e=new i["default"]([]);var f={collection:new i["default"]([]),globalCollection:e,config:a};return n=new s["default"](f),f.fu=n,t=new o["default"](f),e.listenTo(e,"add",function(e){c.getAllVisible().add(e),h&&h.trigger("asset:add",e)}),e.listenTo(e,"remove",function(e){c.getAllVisible().remove(e),h&&h.trigger("asset:remove",e)}),this},add:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"undefined"==typeof n.at&&(n.at=0),e.add(t,n)},get:function(t){return e.where({src:t})[0]},getAll:function(){return e},getAllVisible:function(){return t.collection},remove:function(e){var t=this.get(e);return this.getAll().remove(t),this},store:function(e){var t={},n=JSON.stringify(this.getAll().toJSON());return t[this.storageKey]=n,!e&&a.stm&&a.stm.store(t),t},load:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.storageKey,n=e[t]||[];if("string"==typeof n)try{n=JSON.parse(e[t])}catch(r){}return n&&n.length&&this.getAll().reset(n),n},getContainer:function(){return t.el},getAssetsEl:function(){return t.el.querySelector("[data-el=assets]")},render:function(e){var n=e||this.getAll().models;return t.rendered||t.render(),t.collection.reset(n),this.getContainer()},addType:function(e,t){this.getAll().addType(e,t)},getType:function(e){return this.getAll().getType(e)},getTypes:function(){return this.getAll().getTypes()},AssetsView:function(){return t},FileUploader:function(){return n},onLoad:function(){this.getAll().reset(a.assets)},postRender:function(e){a.dropzone&&n.initDropzone(e)},setTarget:function(e){t.collection.target=e},onSelect:function(e){t.collection.onSelect=e},onClick:function(e){a.onClick=e},onDblClick:function(e){a.onDblClick=e}}}},"./src/asset_manager/model/Asset.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r);t["default"]=i.a.Model.extend({idAttribute:"src",defaults:{type:"",src:""},getFilename:function(){return this.get("src").split("/").pop()},getExtension:function(){return this.getFilename().split(".").pop()}})},"./src/asset_manager/model/AssetImage.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./src/asset_manager/model/Asset.js");t["default"]=a["default"].extend({defaults:i({},a["default"].prototype.defaults,{type:"image",unitDim:"px",height:0,width:0})})},"./src/asset_manager/model/Assets.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=n("./src/asset_manager/model/AssetImage.js"),s=n("./src/asset_manager/view/AssetImageView.js"),a=n("./src/domain_abstract/model/TypeableCollection.js");t["default"]=i.a.Collection.extend(a["default"]).extend({types:[{id:"image",model:o["default"],view:s["default"],isType:function(e){return"string"==typeof e?{type:"image",src:e}:e}}]})},"./src/asset_manager/view/AssetImageView.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/underscore/underscore.js"),i=(n.n(r),n("./src/asset_manager/view/AssetView.js"));t["default"]=i["default"].extend({events:{"click [data-toggle=asset-remove]":"onRemove",click:"onClick",dblclick:"onDblClick"},getPreview:function(){var e=this.pfx,t=this.model.get("src");return'\n <div class="'.concat(e,'preview" style="background-image: url(\'').concat(t,'\');"></div>\n <div class="').concat(e,"preview-bg ").concat(this.ppfx,'checker-bg"></div>\n ')},getInfo:function(){var e=this.pfx,t=this.model,n=t.get("name"),r=t.get("width"),i=t.get("height"),o=t.get("unitDim"),s=r&&i?"".concat(r,"x").concat(i).concat(o):"";return n=n||t.getFilename(),'\n <div class="'.concat(e,'name">').concat(n,'</div>\n <div class="').concat(e,'dimensions">').concat(s,"</div>\n ")},init:function(e){var t=this.pfx;this.className+=" ".concat(t,"asset-image")},onClick:function o(){var o=this.config.onClick,e=this.model;this.collection.trigger("deselectAll"),this.$el.addClass(this.pfx+"highlight"),Object(r.isFunction)(o)?o(e):this.updateTarget(this.collection.target)},onDblClick:function s(){var e=this.em,t=this.model,s=this.config.onDblClick;Object(r.isFunction)(s)?s(t):(this.updateTarget(this.collection.target),e&&e.get("Modal").close());var n=this.collection.onSelect;Object(r.isFunction)(n)&&n(t)},onRemove:function(e){e.stopImmediatePropagation(),this.model.collection.remove(this.model)}})},"./src/asset_manager/view/AssetView.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=n("./node_modules/underscore/underscore.js");n.n(o);t["default"]=i.a.View.extend({initialize:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=e,this.collection=e.collection;var t=e.config||{};this.config=t,this.pfx=t.stylePrefix||"",this.ppfx=t.pStylePrefix||"",this.em=t.em,this.className=this.pfx+"asset",this.listenTo(this.model,"destroy remove",this.remove),this.model.view=this;var n=this.init&&this.init.bind(this);n&&n(e)},template:function(){var e=this.pfx;return'\n <div class="'.concat(e,'preview-cont">\n ').concat(this.getPreview(),'\n </div>\n <div class="').concat(e,'meta">\n ').concat(this.getInfo(),'\n </div>\n <div class="').concat(e,'close" data-toggle="asset-remove">\n ⨯\n </div>\n ')},updateTarget:function(e){e&&e.set&&(e.set("attributes",Object(o.clone)(e.get("attributes"))),e.set("src",this.model.get("src")))},getPreview:function(){return""},getInfo:function(){return""},render:function(){var e=this.el;return e.innerHTML=this.template(this,this.model),e.className=this.className,this}})},"./src/asset_manager/view/AssetsView.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/@babel/runtime/helpers/objectWithoutProperties.js"),i=n.n(r),o=n("./node_modules/backbone/backbone.js"),s=n.n(o);t["default"]=s.a.View.extend({events:{submit:"handleSubmit"},template:function(e){var t=e.pfx,n=e.ppfx,r=e.em,o=(i()(e,["pfx","ppfx","em"]),"");return this.config.showUrlInput&&(o='\n <form class="'.concat(t,'add-asset">\n <div class="').concat(n,"field ").concat(t,'add-field">\n <input placeholder="').concat(r&&r.t("assetManager.inputPlh"),'"/>\n </div>\n <button class="').concat(n,'btn-prim">').concat(r&&r.t("assetManager.addButton"),'</button>\n <div style="clear:both"></div>\n </form>\n ')),'\n <div class="'.concat(t,'assets-cont">\n <div class="').concat(t,'assets-header">\n ').concat(o,'\n </div>\n <div class="').concat(t,'assets" data-el="assets"></div>\n <div style="clear:both"></div>\n </div>\n ')},initialize:function(e){this.options=e,this.config=e.config,this.pfx=this.config.stylePrefix||"",this.ppfx=this.config.pStylePrefix||"",this.em=this.config.em;var t=this.collection;this.listenTo(t,"reset",this.renderAssets),this.listenTo(t,"add",this.addToAsset),this.listenTo(t,"remove",this.removedAsset),this.listenTo(t,"deselectAll",this.deselectAll)},handleSubmit:function(e){e.preventDefault();var t=this.getAddInput(),n=t&&t.value.trim(),r=this.config.handleAdd;n&&(t.value="",this.getAssetsEl().scrollTop=0,r?r.bind(this)(n):this.options.globalCollection.add(n,{at:0}))},getAssetsEl:function(){return this.el.querySelector(".".concat(this.pfx,"assets"))},getAddInput:function(){return this.inputUrl&&this.inputUrl.value||(this.inputUrl=this.el.querySelector(".".concat(this.pfx,"add-asset input"))),this.inputUrl},removedAsset:function(e){this.collection.length||this.toggleNoAssets()},addToAsset:function(e){1==this.collection.length&&this.toggleNoAssets(1),this.addAsset(e)},addAsset:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=t,r=this.collection,i=this.config,o=new e.typeView({model:e,collection:r,config:i}).render().el;if(n)n.appendChild(o);else{var s=this.getAssetsEl();s&&s.insertBefore(o,s.firstChild)}return o},toggleNoAssets:function(e){var t=this.$el.find(".".concat(this.pfx,"assets"));if(e)t.empty();else{var n=this.config.noAssets;n&&t.append(n)}},deselectAll:function(){var e=this.pfx;this.$el.find(".".concat(e,"highlight")).removeClass("".concat(e,"highlight"))},renderAssets:function(){var e=this,t=document.createDocumentFragment(),n=this.$el.find(".".concat(this.pfx,"assets"));n.empty(),this.toggleNoAssets(this.collection.length),this.collection.each(function(n){return e.addAsset(n,t)}),n.append(t)},render:function(){var e=this.options.fu.render().el;return this.$el.empty(),this.$el.append(e).append(this.template(this)),this.el.className="".concat(this.ppfx,"asset-manager"),this.renderAssets(),this.rendered=1,this}})},"./src/asset_manager/view/FileUploader.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/underscore/underscore.js"),i=(n.n(r),n("./node_modules/backbone/backbone.js")),o=n.n(i),s=n("./src/utils/fetch.js");t["default"]=o.a.View.extend({template:Object(r.template)('\n <form>\n <div id="<%= pfx %>title"><%= title %></div>\n <input type="file" id="<%= uploadId %>" name="file" accept="*/*" <%= disabled ? \'disabled\' : \'\' %> <%= multiUpload ? \'multiple\' : \'\' %>/>\n <div style="clear:both;"></div>\n </form>\n '),events:{},initialize:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=e;var t=e.config||{};this.config=t,this.em=this.config.em,this.pfx=t.stylePrefix||"",this.ppfx=t.pStylePrefix||"",this.target=this.options.globalCollection||{},this.uploadId=this.pfx+"uploadFile",this.disabled=void 0!==t.disableUpload?t.disableUpload:!t.upload&&!t.embedAsBase64,this.multiUpload=void 0===t.multiUpload||t.multiUpload,this.events["change #"+this.uploadId]="uploadFile";var n=t.uploadFile;n?this.uploadFile=n.bind(this):!t.upload&&t.embedAsBase64&&(this.uploadFile=this.constructor.embedAsBase64),this.delegateEvents()},onUploadStart:function(){var e=this.config.em;e&&e.trigger("asset:upload:start")},onUploadEnd:function(e){var t=this.$el,n=this.config,r=n.em;r&&r.trigger("asset:upload:end",e);var i=t.find("input");i&&i.val("")},onUploadError:function(e){var t=this.config.em;console.error(e),this.onUploadEnd(e),t&&t.trigger("asset:upload:error",e)},onUploadResponse:function(e,t){var n,r=this.config.em,i=this.config,o=this.target;try{n="string"==typeof e?JSON.parse(e):e}catch(s){n=e}r&&r.trigger("asset:upload:response",n),i.autoAdd&&o&&o.add(n.data,{at:0}),this.onUploadEnd(e),t&&t(n)},uploadFile:function(e,t){var n=this,r=e.dataTransfer?e.dataTransfer.files:e.target.files,i=this.config,o=i.beforeUpload,a=o&&o(r);if(a!==!1){var l=new FormData,c=i.params,u=i.customFetch;for(var d in c)l.append(d,c[d]);if(this.multiUpload)for(var h=0;h<r.length;h++)l.append("".concat(i.uploadName,"[]"),r[h]);else r.length&&l.append(i.uploadName,r[0]);var f=(this.target,i.upload),p=i.headers,g="X-Requested-With";if("undefined"==typeof p[g]&&(p[g]="XMLHttpRequest"),f){this.onUploadStart();var m={method:"post",credentials:i.credentials||"include",headers:p,body:l},v=u?u(f,m):Object(s["default"])(f,m).then(function(e){return 1==(e.status/200|0)?e.text():e.text().then(function(e){return Promise.reject(e)})});return v.then(function(e){return n.onUploadResponse(e,t)})["catch"](function(e){return n.onUploadError(e)})}}},initDrop:function(){var e=this;if(!this.uploadForm&&(this.uploadForm=this.$el.find("form").get(0),"draggable"in this.uploadForm)){this.uploadFile;this.uploadForm.ondragover=function(){return this.className=e.pfx+"hover",!1},this.uploadForm.ondragleave=function(){return this.className="",!1},this.uploadForm.ondrop=function(t){this.className="",t.preventDefault(),e.uploadFile(t)}}},initDropzone:function(e){var t=this,n=0,r=this.config,i=e.model,o=e.el,s=i.get("Editor"),a=(i.get("Config").el,i.get("Canvas").getBody()),l=this.ppfx,c="".concat(l,"dropzone-active"),u="".concat(l,"dropzone"),d=function(){o.className=o.className.replace(c,"").trim(),n=0},h=function(){return n||(o.className+=" ".concat(c),n=1),!1},f=function(){return d(),!1},p=function(e){if(d(),e.preventDefault(),e.stopPropagation(),t.uploadFile(e),r.openAssetsOnDrop&&s){var n=s.getSelected();s.runCommand("open-assets",{target:n,onSelect:function(){s.Modal.close(),s.AssetManager.setTarget(null)}})}return!1};e.$el.append('<div class="'.concat(u,'">').concat(r.dropzoneContent,"</div>")),d(),"draggable"in o&&[o,a].forEach(function(e){e.ondragover=h,e.ondragleave=f,e.ondrop=p})},render:function(){var e=this.$el,t=this.pfx,n=this.em;return e.html(this.template({title:n&&n.t("assetManager.uploadTitle"),uploadId:this.uploadId,disabled:this.disabled,multiUpload:this.multiUpload,pfx:t})),this.initDrop(),e.attr("class",t+"file-uploader"),this}},{embedAsBase64:function(e,t){var n=this,r=e.dataTransfer?e.dataTransfer.files:e.target.files,i={data:[]};if(!FileReader)return void this.onUploadError(new Error("Unsupported platform, FileReader is not defined"));var o=[],s=/^(.+)\/(.+)$/,a=!0,l=!1,c=void 0;try{for(var u,d=function(){var e=u.value,t=new Promise(function(t,n){var r=new FileReader;r.addEventListener("load",function(i){var o,a=e.name,l=s.exec(e.type);if(o=l?l[1]:e.type,"image"===o){var c={src:r.result,name:a,type:o,height:0,width:0},u=new Image;u.addEventListener("error",function(e){n(e)}),u.addEventListener("load",function(){c.height=u.height,c.width=u.width,t(c)}),u.src=c.src}else t(o?{src:r.result,name:a,type:o}:r.result)}),r.addEventListener("error",function(e){n(e)}),r.addEventListener("abort",function(e){n("Aborted")}),r.readAsDataURL(e)});o.push(t)},h=r[Symbol.iterator]();!(a=(u=h.next()).done);a=!0)d()}catch(f){l=!0,c=f}finally{try{a||null==h["return"]||h["return"]()}finally{if(l)throw c}}Promise.all(o).then(function(e){i.data=e,n.onUploadResponse(i,t)},function(e){n.onUploadError(e)})}})},"./src/block_manager/config/config.js":function(e,t,n){"use strict";n.r(t),t["default"]={appendTo:"",appendOnClick:0,blocks:[]}},"./src/block_manager/index.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./node_modules/underscore/underscore.js"),l=(n.n(a),n("./src/block_manager/config/config.js")),c=n("./src/block_manager/model/Blocks.js"),u=n("./src/block_manager/model/Categories.js"),d=n("./src/block_manager/view/BlocksView.js");t["default"]=function(){var e,t,n,r={},o=[];return{name:"BlockManager",init:function(i){r=i||{};var s=r.em;for(var a in l["default"])a in r||(r[a]=l["default"][a]);return e=new c["default"]([]),t=new c["default"]([]),o=new u["default"],n=new d["default"]({collection:t,categories:o},r),e.listenTo(e,"add",function(e){t.add(e),s&&s.trigger("block:add",e)}),e.listenTo(e,"remove",function(e){t.remove(e),s&&s.trigger("block:remove",e)}),e.listenTo(e,"reset",function(e){t.reset(e.models)}),this},getConfig:function(){return r},onLoad:function(){var e=this.getAll();!e.length&&e.reset(r.blocks)},postRender:function(){var e=this.getConfig().appendTo;if(e){var t=Object(a.isElement)(e)?e:document.querySelector(e);t.appendChild(this.render())}},add:function(t,n){var r=n||{};return r.id=t,e.add(r)},get:function(t){return e.get(t)},getAll:function(){return e},getAllVisible:function(){return t},remove:function(t){return e.remove(t)},getCategories:function(){return o},getContainer:function(){return n.el},render:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=e||this.getAll().models;return t.external?new d["default"]({collection:new c["default"](s),categories:o},i({},r,{},t)).render().el:(n.rendered||(n.render(),n.rendered=1),n.updateConfig(t),n.collection.reset(s),this.getContainer())}}}},"./src/block_manager/model/Block.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=n("./src/block_manager/model/Category.js");t["default"]=i.a.Model.extend({defaults:{activate:0,select:0,resetId:0,label:"",media:"",content:"",category:"",attributes:{}},initialize:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},this.get("category"));if(e&&"string"==typeof e){new o["default"]({id:e,label:e})}}})},"./src/block_manager/model/Blocks.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=n("./src/block_manager/model/Block.js");t["default"]=i.a.Collection.extend({model:o["default"]})},"./src/block_manager/model/Categories.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=n("./src/block_manager/model/Category.js");t["default"]=i.a.Collection.extend({model:o["default"]})},"./src/block_manager/model/Category.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r);t["default"]=i.a.Model.extend({defaults:{id:"",label:"",open:!0,attributes:{}}})},"./src/block_manager/view/BlockView.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=n("./node_modules/underscore/underscore.js"),s=(n.n(o),n("./src/utils/mixins.js"));t["default"]=i.a.View.extend({events:{click:"handleClick",mousedown:"startDrag",dragstart:"handleDragStart",drag:"handleDrag",dragend:"handleDragEnd"},initialize:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.model;this.em=t.em,this.config=t,this.endDrag=this.endDrag.bind(this),this.ppfx=t.pStylePrefix||"",this.listenTo(n,"destroy remove",this.remove),this.listenTo(n,"change",this.render)},handleClick:function(){var e=this.config,t=this.model,n=this.em;if(e.appendOnClick){var r=e.getSorter(),i=t.get("content"),o=n.getSelected();r.setDropContent(i);var s,a;if(o)if(a=r.validTarget(o.getEl(),i),a.valid)s=o;else{var l=o.parent();a=r.validTarget(l.getEl(),i),a.valid&&(s=l)}if(!s){var c=n.getWrapper();a=r.validTarget(c.getEl(),i),a.valid&&(s=c)}var u=s&&s.append(i)[0];u&&n.setSelected(u,{scroll:1})}},startDrag:function(e){var t=this.config,n=this.em;if(0===e.button&&t.getSorter&&!this.el.draggable){n.refreshCanvas();var r=t.getSorter();r.setDragHelper(this.el,e),r.setDropContent(this.model.get("content")),r.startSort(this.el),Object(s.on)(document,"mouseup",this.endDrag)}},handleDragStart:function(e){var t=this.em,n=this.model,r=n.get("content"),i=Object(o.isObject)(r),s=i?JSON.stringify(r):r;t.set("dragResult"),e.dataTransfer.setData("text",s),t.set("dragContent",r),t.trigger("block:drag:start",n,e)},handleDrag:function(e){this.em.trigger("block:drag",this.model,e)},handleDragEnd:function(){var e=this.em,t=this.model,n=e.get("dragResult");if(n){var r="activeOnRender",i=n.get&&n.get(r);(t.get("activate")||i)&&(n.trigger("active"),n.set(r,0)),t.get("select")&&e.setSelected(n),t.get("resetId")&&n.onAll(function(e){
|
||
return e.resetId()})}e.set({dragResult:null,dragContent:null}),e.trigger("block:drag:stop",n,t)},endDrag:function(e){Object(s.off)(document,"mouseup",this.endDrag);var t=this.config.getSorter();t.moved=0,t.endMove()},render:function a(){var e=this.em,t=this.el,n=this.ppfx,r=this.model,i="".concat(n,"block"),o=e&&e.t("blockManager.labels.".concat(r.id))||r.get("label"),a=r.get("render"),l=r.get("media");t.className+=" ".concat(i," ").concat(n,"one-bg ").concat(n,"four-color-h"),t.innerHTML="\n ".concat(l?'<div class="'.concat(i,'__media">').concat(l,"</div>"):"",'\n <div class="').concat(i,'-label">').concat(o,"</div>\n "),t.title=t.textContent.trim(),Object(s.hasDnd)(e)&&t.setAttribute("draggable",!0);var c=a&&a({el:t,model:r,className:i,prefix:n});return c&&(t.innerHTML=c),this}})},"./src/block_manager/view/BlocksView.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./node_modules/backbone/backbone.js"),l=n.n(a),c=n("./node_modules/underscore/underscore.js"),u=(n.n(c),n("./src/block_manager/view/BlockView.js")),d=n("./src/block_manager/view/CategoryView.js");t["default"]=l.a.View.extend({initialize:function(e,t){Object(c.bindAll)(this,"getSorter","onDrag","onDrop"),this.config=t||{},this.categories=e.categories||"",this.renderedCategories=[];var n=this.config.pStylePrefix||"";this.ppfx=n,this.noCatClass="".concat(n,"blocks-no-cat"),this.blockContClass="".concat(n,"blocks-c"),this.catsClass="".concat(n,"block-categories");var r=this.collection;this.listenTo(r,"add",this.addTo),this.listenTo(r,"reset",this.render),this.em=this.config.em,this.tac="test-tac",this.grabbingCls=this.ppfx+"grabbing",this.em&&(this.config.getSorter=this.getSorter,this.canvas=this.em.get("Canvas"))},updateConfig:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.config=i({},this.config,{},e)},getSorter:function(){if(this.em){if(!this.sorter){var e=this.em.get("Utils"),t=this.canvas;this.sorter=new e.Sorter({container:t.getBody(),placer:t.getPlacerEl(),containerSel:"*",itemSel:"*",pfx:this.ppfx,onStart:this.onDrag,onEndMove:this.onDrop,onMove:this.onMove,document:t.getFrameEl().contentDocument,direction:"a",wmargin:1,nested:1,em:this.em,canvasRelative:1})}return this.sorter}},onDrag:function(e){this.em.stopDefault(),this.em.trigger("block:drag:start",e)},onMove:function(e){this.em.trigger("block:drag:move",e)},onDrop:function(e){var t=this.em;t.runDefault(),e&&e.get&&(e.get("activeOnRender")&&(e.trigger("active"),e.set("activeOnRender",0)),t.trigger("block:drag:stop",e))},addTo:function(e){this.add(e)},add:function(e,t){var n=this.config,r=t||null,i=new u["default"]({model:e,attributes:e.get("attributes")},n),o=i.render().el,s=e.get("category");if(s&&this.categories&&!n.ignoreCategories){Object(c.isString)(s)?s={id:s,label:s}:Object(c.isObject)(s)&&!s.id&&(s.id=s.label);var a=this.categories.add(s),l=a.get("id"),h=this.renderedCategories[l],f=this.getCategoriesEl();return e.set("category",a),!h&&f&&(h=new d["default"]({model:a},this.config).render(),this.renderedCategories[l]=h,f.appendChild(h.el)),void(h&&h.append(o))}r?r.appendChild(o):this.append(o)},getCategoriesEl:function(){return this.catsEl||(this.catsEl=this.el.querySelector(".".concat(this.catsClass))),this.catsEl},getBlocksEl:function(){return this.blocksEl||(this.blocksEl=this.el.querySelector(".".concat(this.noCatClass," .").concat(this.blockContClass))),this.blocksEl},append:function(e){var t=this.getBlocksEl();t&&t.appendChild(e)},render:function(){var e=this,t=this.ppfx,n=document.createDocumentFragment();this.catsEl=null,this.blocksEl=null,this.renderedCategories=[],this.el.innerHTML='\n <div class="'.concat(this.catsClass,'"></div>\n <div class="').concat(this.noCatClass,'">\n <div class="').concat(this.blockContClass,'"></div>\n </div>\n '),this.collection.each(function(t){return e.add(t,n)}),this.append(n);var r="".concat(this.blockContClass,"s ").concat(t,"one-bg ").concat(t,"two-color");return this.$el.addClass(r),this}})},"./src/block_manager/view/CategoryView.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/underscore/underscore.js"),i=(n.n(r),n("./node_modules/backbone/backbone.js")),o=n.n(i);t["default"]=o.a.View.extend({template:Object(r.template)('\n <div class="<%= pfx %>title">\n <i class="<%= pfx %>caret-icon"></i>\n <%= label %>\n </div>\n <div class="<%= pfx %>blocks-c"></div>\n '),events:{},initialize:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{});this.config=e;var t=e.pStylePrefix||"";this.em=e.em,this.pfx=t,this.caretR="fa fa-caret-right",this.caretD="fa fa-caret-down",this.iconClass="".concat(t,"caret-icon"),this.activeClass="".concat(t,"open"),this.className="".concat(t,"block-category"),this.events["click .".concat(t,"title")]="toggle",this.listenTo(this.model,"change:open",this.updateVisibility),this.delegateEvents()},updateVisibility:function(){this.model.get("open")?this.open():this.close()},open:function(){this.el.className="".concat(this.className," ").concat(this.activeClass),this.getIconEl().className="".concat(this.iconClass," ").concat(this.caretD),this.getBlocksEl().style.display=""},close:function(){this.el.className=this.className,this.getIconEl().className="".concat(this.iconClass," ").concat(this.caretR),this.getBlocksEl().style.display="none"},toggle:function(){var e=this.model;e.set("open",!e.get("open"))},getIconEl:function(){return this.iconEl||(this.iconEl=this.el.querySelector("."+this.iconClass)),this.iconEl},getBlocksEl:function(){return this.blocksEl||(this.blocksEl=this.el.querySelector("."+this.pfx+"blocks-c")),this.blocksEl},append:function(e){this.getBlocksEl().appendChild(e)},render:function(){var e=this.em,t=this.el,n=this.$el,r=this.model,i=e.t("blockManager.categories.".concat(r.id))||r.get("label");return t.innerHTML=this.template({pfx:this.pfx,label:i}),t.className=this.className,n.css({order:r.get("order")}),this.updateVisibility(),this}})},"./src/canvas/config/config.js":function(e,t,n){"use strict";n.r(t),t["default"]={stylePrefix:"cv-",scripts:[],styles:[],customBadgeLabel:"",autoscrollLimit:50,notTextable:["button","a","input[type=checkbox]","input[type=radio]"]}},"./src/canvas/index.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){l()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/toConsumableArray.js"),s=n.n(o),a=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),l=n.n(a),c=n("./src/utils/mixins.js"),u=n("./node_modules/underscore/underscore.js"),d=(n.n(u),n("./src/utils/Droppable.js")),h=n("./src/canvas/config/config.js"),f=n("./src/canvas/model/Canvas.js"),p=n("./src/canvas/view/CanvasView.js"),g=window;g.requestAnimationFrame;t["default"]=function(){var e,t,n={};return{getCanvasView:function(){return t},name:"Canvas",init:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};n=i({},h["default"],{},r,{module:this}),this.em=n.em;var o=n.pStylePrefix;o&&(n.stylePrefix=o+n.stylePrefix),e=new f["default"](r),t=new p["default"]({model:e,config:n});var s=n.em.get("DomComponents");return s&&this.setWrapper(s),this.model=e,this.startAutoscroll=this.startAutoscroll.bind(this),this.stopAutoscroll=this.stopAutoscroll.bind(this),this},getConfig:function(){return n},setWrapper:function(t){e.set("wrapper",t)},getElement:function(){return t.el},getFrame:function(){return e.get("frame")},getFrameEl:function(){var e=t,n=e.frame;return n&&n.el},getFramesEl:function(){return t.framesArea},getWindow:function(){return this.getFrameEl().contentWindow},getDocument:function(){var e=this.getFrameEl();return e&&e.contentDocument},getBody:function(){var e=this.getDocument();return e&&e.body},getWrapperEl:function(){var e=this.getBody();return e&&e.querySelector("#wrapper")},_getCompFrame:function(e){return e&&e._getFrame()},_getLocalEl:function(e,t,n){var r=e,i=this._getCompFrame(t);return r=i?i[n]():r},getGlobalToolsEl:function(){return t.toolsGlobEl},getToolsEl:function(e){return this._getLocalEl(t.toolsEl,e,"getToolsEl")},getHighlighter:function(e){return this._getLocalEl(t.hlEl,e,"getHighlighter")},getBadgeEl:function(e){return this._getLocalEl(t.badgeEl,e,"getBadgeEl")},getPlacerEl:function(){return t.placerEl},getGhostEl:function(){return t.ghostEl},getToolbarEl:function(){return t.toolbarEl},getResizerEl:function(){return t.resizerEl},getOffsetViewerEl:function(e){return this._getLocalEl(t.offsetEl,e,"getOffsetViewerEl")},getFixedOffsetViewerEl:function(){return t.fixedOffsetEl},render:function(){return t.render().el},getOffset:function(){var e=this.offset(this.getFrameEl()),t=this.offset(this.getElement());return{top:e.top-t.top,left:e.left-t.left}},offset:function(e){return t.offset(e)},setCustomBadgeLabel:function(e){n.customBadgeLabel=e},getElementPos:function(e,n){return t.getElementPos(e,n)},getElementOffsets:function(e){return t.getElementOffsets(e)},getRect:function(){var e=t.getPosition(),n=e.top,r=e.left;return i({},t.getCanvasOffset(),{topScroll:n,leftScroll:r})},getTargetToElementDim:function(e,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=i||{},s=t.getPosition();if(s){var a=o.elPos||t.getElementPos(r),l=i.toRight||0,c=o.targetHeight||e.offsetHeight,u=o.targetWidth||e.offsetWidth,d=o.event||null,h=a.top-c,f=a.left;f+=l?a.width:0,f=l?f-u:f;var p=f<s.left?s.left:f,g=h<s.top?s.top:h;g=g>a.top+a.height?a.top+a.height:g;var m={top:g,left:p,elementTop:a.top,elementLeft:a.left,elementWidth:a.width,elementHeight:a.height,targetWidth:e.offsetWidth,targetHeight:e.offsetHeight,canvasTop:s.top,canvasLeft:s.left,canvasWidth:s.width,canvasHeight:s.height};return d&&n.em&&n.em.trigger(d,m),m}},canvasRectOffset:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=function(e){var t=e.defaultView;return t&&t.frameElement},o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2?arguments[2]:void 0,s=n.em.getZoomDecimal(),a=t?"top":"left",l=e.ownerDocument,c=r.offset?i(l):{},u=c.offsetTop,d=void 0===u?0:u,h=c.offsetLeft,f=void 0===h?0:h,p=l.body||{},g=p.scrollTop,m=void 0===g?0:g,v=p.scrollLeft,b=void 0===v?0:v,y=t?m:b,w=t?d:f;return o[a]-(y-w)*s};return{top:o(e,1,t),left:o(e,0,t)}},getTargetToElementFixed:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.pos||this.getElementPos(e),i=n.canvasOff||this.canvasRectOffset(e,r),o=t.offsetHeight||0,s=t.offsetWidth||0,a=r.left+r.width,l=this.getCanvasView(),c=l.getPosition(),u=l.getFrameOffset(e),d=n.event,h=-o,f=r.width-s;f=r.left<-f?-r.left:f,f=a>c.width?f-(a-c.width):f;var p=r.height+o,g=p<u.height;i.top<o&&(g?h+=p:h=-i.top<r.height?-i.top:r.height);var m={top:h,left:f,canvasOffsetTop:i.top,canvasOffsetLeft:i.left};return d&&this.em.trigger(d,m),m},getMouseRelativePos:function(e,t){var n=t||{},r=0,i=0,o=n.subWinOffset,s=e.target.ownerDocument,a=s.defaultView||s.parentWindow,l=a.frameElement,c=o?a.pageYOffset:0,u=o?a.pageXOffset:0;if(l){var d=l.getBoundingClientRect();r=d.top||0,i=d.left||0}return{y:e.clientY+r-c,x:e.clientX+i-u}},getMouseRelativeCanvas:function(e,n){var r=this.getZoomDecimal(),i=t.getPosition(n),o=i.top,s=i.left;return{y:e.clientY*r+o,x:e.clientX*r+s}},hasFocus:function(){return this.getDocument().hasFocus()},isInputFocused:function(){var e=this.getDocument(),t=["body"].concat(s()(this.getConfig().notTextable)),n=e&&e.activeElement;return n&&!t.some(function(e){return n.matches(e)})},scrollTo:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Object(c.getElement)(e),r=n&&Object(c.getViewEl)(n);r&&r.scrollIntoView(t)},startAutoscroll:function(e){var t=e&&e.view||this.em.getCurrentFrame();t&&t.startAutoscroll()},stopAutoscroll:function(e){var t=e&&e.view||this.em.getCurrentFrame();t&&t.stopAutoscroll()},postRender:function(){Object(c.hasDnd)(n.em)&&(this.droppable=new d["default"](n.em))},setZoom:function(t){return e.set("zoom",parseFloat(t)),this},getZoom:function(){return parseFloat(e.get("zoom"))},getZoomDecimal:function(){return this.getZoom()/100},getZoomMultiplier:function(){var e=this.getZoomDecimal();return e?1/e:1},toggleFramesEvents:function(e){var t=this.getFramesEl(),n=t.style;n.pointerEvents=e?"":"none"},getFrameWrapperEl:function(){return t.frame.getWrapper()},getFrames:function(){return e.get("frames").map(function(e){return e})},addFrame:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.get("frames").add(i({},t),i({},n,{em:this.em}))}}}},"./src/canvas/model/Canvas.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=n("./src/canvas/model/Frame.js"),s=n("./src/canvas/model/Frames.js");t["default"]=i.a.Model.extend({defaults:{frame:"",frames:"",wrapper:"",rulers:!1,zoom:100,x:0,y:0},initialize:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.em,n=e.styles,r=void 0===n?[]:n,i=e.scripts,a=void 0===i?[]:i,l=new o["default"]({},e);r.forEach(function(e){return l.addLink(e)}),a.forEach(function(e){return l.addScript(e)}),this.em=t,this.set("frame",l),this.set("frames",new s["default"]([l],e)),this.listenTo(this,"change:zoom",this.onZoomChange),this.listenTo(t,"change:device",this.updateDevice)},updateDevice:function(){var e=this.em,t=e.getDeviceModel(),n=e.getCurrentFrameModel();if(n&&t){var r=t.attributes,i=r.width,o=r.height;n.set({width:i,height:o})}},onZoomChange:function(){var e=this.get("zoom");e<1&&this.set("zoom",1)}})},"./src/canvas/model/Frame.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./node_modules/@babel/runtime/helpers/toConsumableArray.js"),l=n.n(a),c=n("./node_modules/backbone/backbone.js"),u=n.n(c),d=n("./src/dom_components/model/Component.js"),h=n("./src/css_composer/model/CssRules.js"),f=n("./node_modules/underscore/underscore.js");n.n(f);t["default"]=u.a.Model.extend({defaults:{wrapper:"",width:null,height:null,head:"",x:0,y:0,root:0,components:0,styles:0,attributes:{}},initialize:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.attributes,r=n.root,i=n.styles,o=n.components;this.set("head",[]),this.em=t.em;var s={em:t.em,config:t.em.get("DomComponents").getConfig(),frame:this};!r&&this.set("root",new d["default"]({type:"wrapper",components:o||[]},s)),(!i||Object(f.isString)(i))&&this.set("styles",new h["default"](i,s))},remove:function(){this.view=0;var e=this.collection;return e&&e.remove(this)},getHead:function(){return l()(this.get("head"))},setHead:function(e){return this.set("head",l()(e))},addHeadItem:function(e){var t=this.getHead();t.push(e),this.setHead(t)},getHeadByAttr:function(e,t,n){var r=this.getHead();return r.filter(function(r){return r.attributes&&r.attributes[e]==t&&(!n||n===r.tag)})[0]},removeHeadByAttr:function(e,t,n){var r=this.getHead(),i=this.getHeadByAttr(e,t,n),o=r.indexOf(i);o>=0&&(r.splice(o,1),this.setHead(r))},addLink:function(e){var t="link";!this.getHeadByAttr("href",e,t)&&this.addHeadItem({tag:t,attributes:{href:e,rel:"stylesheet"}})},removeLink:function(e){this.removeHeadByAttr("href",e,"link")},addScript:function(e){var t="script";!this.getHeadByAttr("src",e,t)&&this.addHeadItem({tag:t,attributes:{src:e}})},removeScript:function(e){this.removeHeadByAttr("src",e,"script")},_emitUpdated:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.em.trigger("frame:updated",i({frame:this},e))}})},"./src/canvas/model/Frames.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/underscore/underscore.js"),i=(n.n(r),n("./node_modules/backbone/backbone.js")),o=n.n(i),s=n("./src/canvas/model/Frame.js");t["default"]=o.a.Collection.extend({model:s["default"],initialize:function(){Object(r.bindAll)(this,"itemLoaded")},itemLoaded:function(){this.loadedItems++,this.loadedItems>=this.itemsToLoad&&(this.trigger("loaded:all"),this.listenToLoadItems(0))},listenToLoad:function(){this.loadedItems=0,this.itemsToLoad=this.length,this.listenToLoadItems(1)},listenToLoadItems:function(e){var t=this;this.forEach(function(n){return n[e?"on":"off"]("loaded",t.itemLoaded)})}})},"./src/canvas/view/CanvasView.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){a()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o,s=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),a=n.n(s),l=n("./node_modules/backbone/backbone.js"),c=n.n(l),u=n("./node_modules/underscore/underscore.js"),d=(n.n(u),n("./src/utils/mixins.js")),h=n("./src/canvas/view/FramesView.js"),f=c.a.$;t["default"]=c.a.View.extend({events:{wheel:"onWheel"},template:function(){var e=this.pfx;return'\n <div class="'.concat(e,'canvas__frames" data-frames></div>\n <div id="').concat(e,'tools" class="').concat(e,'canvas__tools" data-tools></div>\n ')},initialize:function(e){Object(u.bindAll)(this,"clearOff","onKeyPress"),Object(d.on)(window,"scroll resize",this.clearOff);var t=this.model,n=t.get("frames");this.config=e.config||{},this.em=this.config.em||{},this.pfx=this.config.stylePrefix||"",this.ppfx=this.config.pStylePrefix||"",this.className=this.config.stylePrefix+"canvas";var r=this.em,o=this.config;this.frames=new h["default"]({collection:n,config:i({},o,{canvasView:this,renderContent:1})}),this.listenTo(r,"change:canvasOffset",this.clearOff),this.listenTo(r,"component:selected",this.checkSelected),this.listenTo(t,"change:zoom change:x change:y",this.updateFrames),this.listenTo(n,"loaded:all",function(){return r.trigger("loaded")}),this.toggleListeners(1)},checkSelected:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.scroll,r=this.em.get("currentFrame");n&&e.views.forEach(function(e){e._getFrame()!==r&&e.scrollIntoView(n)})},remove:function(){c.a.View.prototype.remove.apply(this,arguments),this.toggleListeners()},preventDefault:function(e){e&&(e.preventDefault(),e._parentEvent&&e._parentEvent.preventDefault())},toggleListeners:function(e){var t=e?"on":"off",n={on:d.on,off:d.off};n[t](document,"keypress",this.onKeyPress)},onKeyPress:function(e){var t=this.em,n=Object(d.getKeyChar)(e);" "===n&&1!==t.getZoomDecimal()&&(this.preventDefault(e),t.get("Editor").runCommand("core:canvas-move"))},onWheel:function(e){if((e.ctrlKey||e.metaKey)&&this.em.getConfig("multiFrames")){this.preventDefault(e);var t=this.model,n=Math.max(-1,Math.min(1,e.wheelDelta||-e.detail)),r=t.get("zoom");t.set("zoom",r+2*n)}},updateFrames:function(e){var t=this.em,n=this.model,r=n.attributes,i=r.x,s=r.y,a=this.getZoom(),l={preserveSelected:1},c=a?1/a:1;this.framesArea.style.transform="scale(".concat(a,") translate(").concat(i*c,"px, ").concat(s*c,"px)"),this.clearOff(),t.stopDefault(l),t.trigger("canvas:update",e),o&&clearTimeout(o),o=setTimeout(function(){return t.runDefault(l)},300)},getZoom:function(){return this.em.getZoomDecimal()},isElInViewport:function(e){var t=Object(d.getElement)(e),n=Object(d.getElRect)(t),r=this.getFrameOffset(t),i=n.top,o=n.left;return i>=0&&o>=0&&i<=r.height&&o<=r.width},offset:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Object(d.getElRect)(e),r=e.ownerDocument.body,i=t.noScroll;return{top:n.top+(i?0:r.scrollTop),left:n.left+(i?0:r.scrollLeft),width:n.width,height:n.height}},clearOff:function(){this.frmOff=null,this.cvsOff=null},getFrameOffset:function(e){if(!this.frmOff||e){var t=e?e.ownerDocument.defaultView.frameElement:this.frame.el;this.frmOff=this.offset(t)}return this.frmOff},getCanvasOffset:function(){return this.cvsOff||(this.cvsOff=this.offset(this.el)),this.cvsOff},getElementPos:function(e,t){var n=this.getZoom(),r=t||{},i=this.getFrameOffset(e),o=this.getCanvasOffset(),s=this.offset(e,t),a=r.avoidFrameOffset?0:i.top,l=r.avoidFrameOffset?0:i.left,c=s.top*n+a-o.top,u=s.left*n+l-o.left,d=s.height*n,h=s.width*n;return{top:c,left:u,height:d,width:h,zoom:n,rect:s}},getElementOffsets:function(e){var t=this;if(!e||Object(d.isTextNode)(e))return{};var n={},r=window.getComputedStyle(e);return["marginTop","marginRight","marginBottom","marginLeft","paddingTop","paddingRight","paddingBottom","paddingLeft"].forEach(function(e){n[e]=parseFloat(r[e])*t.getZoom()}),n},getPosition:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.frame.el.contentDocument;if(t){var n=t.body,r=this.getZoom(),i=this.getFrameOffset(),o=this.getCanvasOffset(),s=e.noScroll;return{top:i.top+(s?0:n.scrollTop)*r-o.top,left:i.left+(s?0:n.scrollLeft)*r-o.left,width:o.width,height:o.height}}},updateScript:function(e){var t=e.model,n=t.getId();e.scriptContainer||(e.scriptContainer=f('<div data-id="'.concat(n,'">')),this.getJsContainer().appendChild(e.scriptContainer.get(0))),e.el.id=n,e.scriptContainer.html("");var r=document.createElement("script");r.innerHTML="\n setTimeout(function() {\n var item = document.getElementById('".concat(n,"');\n if (!item) return;\n (function(){\n ").concat(t.getScriptString(),";\n }.bind(item))()\n }, 1);"),setTimeout(function(){return e.scriptContainer.get(0).appendChild(r)},0)},getJsContainer:function(e){var t=this.getFrameView(e);return t&&t.getJsContainer()},getFrameView:function(e){return e&&e._getFrame()||this.em.get("currentFrame")},render:function(){var e=this.el,t=this.$el,n=this.ppfx,r=this.model,i=this.em,o=this.frames,s=i.get("CssComposer"),a=r.get("wrapper");t.html(this.template());var l=t.find("[data-frames]");this.framesArea=l.get(0),this.wrapper=a,a&&"function"==typeof a.render&&r.get("frame").set({wrapper:a,root:a.getWrapper(),styles:s.getAll()});var c=t.find("[data-tools]");this.toolsWrapper=c.get(0),c.append('\n <div class="'.concat(n,"tools ").concat(n,'tools-gl" style="pointer-events:none">\n <div class="').concat(n,'placeholder">\n <div class="').concat(n,'placeholder-int"></div>\n </div>\n </div>\n <div id="').concat(n,'tools" style="pointer-events:none">\n <div class="').concat(n,'badge"></div>\n <div class="').concat(n,'ghost"></div>\n <div class="').concat(n,'toolbar" style="pointer-events:all"></div>\n <div class="').concat(n,'resizer"></div>\n <div class="').concat(n,'offset-v"></div>\n <div class="').concat(n,'offset-fixed-v"></div>\n </div>\n '));var u=e.querySelector("#".concat(n,"tools"));this.hlEl=e.querySelector(".".concat(n,"highlighter")),this.badgeEl=e.querySelector(".".concat(n,"badge")),this.placerEl=e.querySelector(".".concat(n,"placeholder")),this.ghostEl=e.querySelector(".".concat(n,"ghost")),this.toolbarEl=e.querySelector(".".concat(n,"toolbar")),this.resizerEl=e.querySelector(".".concat(n,"resizer")),this.offsetEl=e.querySelector(".".concat(n,"offset-v")),this.fixedOffsetEl=e.querySelector(".".concat(n,"offset-fixed-v")),this.toolsGlobEl=e.querySelector(".".concat(n,"tools-gl")),this.toolsEl=u,this.el.className=this.className;var d=r.get("frames");return d.listenToLoad(),o.render(),i.setCurrentFrame(d.at(0).view),l.append(o.el),this.frame=d.at(0).view,this}})},"./src/canvas/view/FrameView.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){l()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/toConsumableArray.js"),s=n.n(o),a=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),l=n.n(a),c=n("./node_modules/backbone/backbone.js"),u=n.n(c),d=n("./node_modules/underscore/underscore.js"),h=(n.n(d),n("./src/css_composer/view/CssRulesView.js")),f=n("./src/dom_components/view/ComponentView.js"),p=n("./src/utils/dom.js"),g=n("./src/utils/mixins.js");t["default"]=u.a.View.extend({tagName:"iframe",attributes:{allowfullscreen:"allowfullscreen","data-frame-el":!0},initialize:function(e){Object(d.bindAll)(this,"updateClientY","stopAutoscroll","autoscroll","_emitUpdate");var t=this.model,n=this.el;this.config=i({},e.config||{},{frameView:this}),this.ppfx=this.config.pStylePrefix||"",this.em=this.config.em,this.listenTo(t,"change:head",this.updateHead),t.view=this,Object(g.setViewEl)(n,this)},updateHead:function(){var e=this.getHead();Object(p.empty)(e),Object(p.appendVNodes)(e,this.model.getHead())},getEl:function(){return this.el},getWindow:function(){return this.getEl().contentWindow},getDoc:function(){return this.getEl().contentDocument},getHead:function(){return this.getDoc().querySelector("head")},getBody:function(){return this.getDoc().querySelector("body")},getWrapper:function(){return this.getBody().querySelector("[data-gjs-type=wrapper]")},getJsContainer:function(){return this.jsContainer||(this.jsContainer=Object(p.createEl)("div",{"class":"".concat(this.ppfx,"js-cont")})),this.jsContainer},getToolsEl:function(){var e=this.config.frameWrapView;return e&&e.elTools},getGlobalToolsEl:function(){return this.em.get("Canvas").getGlobalToolsEl()},getHighlighter:function(){return this._getTool("[data-hl]")},getBadgeEl:function(){return this._getTool("[data-badge]")},getOffsetViewerEl:function(){return this._getTool("[data-offset]")},getRect:function(){return this.rect||(this.rect=this.el.getBoundingClientRect()),this.rect},getOffsetRect:function(){var e=this.el,t=this.getBody(),n=t.scrollTop,r=t.scrollLeft,i=e.offsetHeight,o=e.offsetWidth;return{top:e.offsetTop,left:e.offsetLeft,height:i,width:o,scrollTop:n,scrollLeft:r,scrollBottom:n+i,scrollRight:r+o}},_getTool:function(e){var t=this.getToolsEl();return this[e]||(this[e]=t.querySelector(e)),this[e]},remove:function(){var e=this.root,t=this.model;this._toggleEffects(),u.a.View.prototype.remove.apply(this,arguments),e.remove(),t.remove()},startAutoscroll:function(){var e=this;this.lastMaxHeight=this.getWrapper().offsetHeight-this.el.offsetHeight,setTimeout(function(){e._toggleAutoscrollFx(1),requestAnimationFrame(e.autoscroll)},0)},autoscroll:function(){if(this.dragging){var e=this.em.get("Canvas"),t=this.getWindow(),n=this.getBody(),r=n.scrollTop,i=this.lastClientY||0,o=e.getConfig().autoscrollLimit,s=this.getRect().height-o,a=r;if(i<o&&(a-=o-i),i>s&&(a+=i-s),a!==r&&a>0&&a<this.lastMaxHeight){var l=this.getGlobalToolsEl();l.style.opacity=0,this.showGlobalTools(),t.scrollTo(0,a)}requestAnimationFrame(this.autoscroll)}},updateClientY:function(e){e.preventDefault(),this.lastClientY=Object(g.getPointerEvent)(e).clientY*this.em.getZoomDecimal()},showGlobalTools:Object(d.debounce)(function(){this.getGlobalToolsEl().style.opacity=""},50),stopAutoscroll:function(){this.dragging&&this._toggleAutoscrollFx()},_toggleAutoscrollFx:function(e){this.dragging=e;var t=this.getWindow(),n=e?"on":"off",r={on:g.on,off:g.off};r[n](t,"mousemove dragover",this.updateClientY),r[n](t,"mouseup",this.stopAutoscroll)},render:function(){var e=this.el,t=this.$el,n=this.ppfx,r=this.config;return t.attr({"class":n+"frame"}),r.scripts.length?this.renderScripts():r.renderContent&&(e.onload=this.renderBody.bind(this)),this},renderScripts:function(){var e=this,t=this.el,n=this.config,r=function o(n){if(n.length>0){var r=n.shift(),s=Object(p.createEl)("script",i({type:"text/javascript"},Object(d.isString)(r)?{src:r}:r));s.onerror=s.onload=o.bind(null,n),t.contentDocument.head.appendChild(s)}else e.renderBody()};t.onload=function(){return r(s()(n.scripts))}},renderBody:function(){var e=this,t=this.config,n=this.model,r=this.ppfx,o=n.get("root"),s=n.get("styles"),a=t.em,l=this.getDoc(),c=this.getHead(),u=this.getBody(),m=(this.getWindow(),a.get("Config")),v=[];t.styles.forEach(function(e){return v.push(Object(d.isString)(e)?{tag:"link",attributes:{href:e,rel:"stylesheet"}}:{tag:"link",attributes:i({rel:"stylesheet"},e)})}),v.length&&Object(p.appendVNodes)(c,v);var b="#ffca6f";Object(p.append)(u,"<style>\n ".concat(m.baseCss||"","\n\n .").concat(r,"dashed *[data-highlightable] {\n outline: 1px dashed rgba(170,170,170,0.7);\n outline-offset: -2px;\n }\n\n .").concat(r,"selected {\n outline: 3px solid #3b97e3 !important;\n outline-offset: -3px;\n }\n\n .").concat(r,"selected-parent {\n outline: 2px solid ").concat(b," !important\n }\n\n .").concat(r,"no-select {\n user-select: none;\n -webkit-user-select:none;\n -moz-user-select: none;\n }\n\n .").concat(r,"freezed {\n opacity: 0.5;\n pointer-events: none;\n }\n\n .").concat(r,"no-pointer {\n pointer-events: none;\n }\n\n .").concat(r,"plh-image {\n background: #f5f5f5;\n border: none;\n height: 100px;\n width: 100px;\n display: block;\n outline: 3px solid #ffca6f;\n cursor: pointer;\n outline-offset: -2px\n }\n\n .").concat(r,"grabbing {\n cursor: grabbing;\n cursor: -webkit-grabbing;\n }\n\n .").concat(r,"is__grabbing {\n overflow-x: hidden;\n }\n\n .").concat(r,"is__grabbing,\n .").concat(r,"is__grabbing * {\n cursor: grabbing !important;\n }\n\n ").concat(m.canvasCss||"","\n ").concat(m.protectedCss||"","\n </style>")),this.root=new f["default"]({model:o,config:i({},o.config,{frameView:this})}).render(),Object(p.append)(u,this.root.el),Object(p.append)(u,new h["default"]({collection:s,config:i({},a.get("CssComposer").getConfig(),{frameView:this})}).render().el),
|
||
Object(p.append)(u,this.getJsContainer()),Object(g.on)(u,"click",function(e){return e&&"A"==e.target.tagName&&e.preventDefault()}),Object(g.on)(u,"submit",function(e){return e&&e.preventDefault()}),[{event:"keydown keyup keypress","class":"KeyboardEvent"},{event:"wheel","class":"WheelEvent"}].forEach(function(t){return t.event.split(" ").forEach(function(n){l.addEventListener(n,function(n){return e.el.dispatchEvent(Object(p.createCustomEvent)(n,t["class"]))})})}),this._toggleEffects(1),n.trigger("loaded")},_toggleEffects:function(e){var t=e?g.on:g.off,n=this.getWindow();t(n,"".concat(p.motionsEv," resize"),this._emitUpdate)},_emitUpdate:function(){this.model._emitUpdated()}})},"./src/canvas/view/FrameWrapView.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./node_modules/backbone/backbone.js"),l=n.n(a),c=n("./src/canvas/view/FrameView.js"),u=n("./node_modules/underscore/underscore.js"),d=(n.n(u),n("./src/utils/dom.js")),h=n("./src/utils/Dragger.js");t["default"]=l.a.View.extend({events:{"click [data-action-remove]":"remove","mousedown [data-action-move]":"startDrag"},initialize:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(u.bindAll)(this,"onScroll","frameLoaded","updateOffset","remove","startDrag");var n=this.model,r=i({},e.config||t,{frameWrapView:this}),o=r.canvasView,s=r.em;this.cv=o,this.config=r,this.em=s,this.canvas=s&&s.get("Canvas"),this.ppfx=r.pStylePrefix||"",this.frame=new c["default"]({model:n,config:r}),this.classAnim="".concat(this.ppfx,"frame-wrapper--anim"),this.listenTo(n,"loaded",this.frameLoaded),this.listenTo(n,"change:x change:y",this.updatePos),this.listenTo(n,"change:width change:height",this.updateSize),this.updatePos(),this.setupDragger()},setupDragger:function(){var e,t,n,r=this,i=this.canvas,o=this.model,s=function(e){i.toggleFramesEvents(e)};this.dragger=new h["default"]({onStart:function(){var i=o.attributes,a=i.x,l=i.y;n=r.em.getZoomMultiplier(),e=a,t=l,s()},onEnd:function(){return s(1)},setPosition:function(r){o.set({x:e+r.x*n,y:t+r.y*n})}})},startDrag:function(e){e&&this.dragger.start(e)},remove:function(){return l.a.View.prototype.remove.apply(this,arguments),this.frame.remove(),this},updateOffset:Object(u.debounce)(function(){var e=this.em,t=this.$el,n=this.frame;e.runDefault({preserveSelected:1}),t.removeClass(this.classAnim),n.model._emitUpdated()}),updatePos:function(e){var t=this.model,n=this.el,r=t.attributes,i=r.x,o=r.y,s=n.style;this.frame.rect=0,s.left=isNaN(i)?i:"".concat(i,"px"),s.top=isNaN(o)?o:"".concat(o,"px"),e&&this.updateOffset()},updateSize:Object(u.debounce)(function(){this.updateDim()}),updateDim:function(){var e=this.em,t=this.el,n=this.$el,r=this.model,o=this.classAnim,s=r.attributes,a=s.width,l=s.height,c=t.style,h=c.width||"",f=c.height||"",p=a||"",g=l||"",m=h==p&&f==g,v="px";if(this.frame.rect=0,n.addClass(o),c.width=Object(u.isNumber)(p)?"".concat(p).concat(v):p,c.height=Object(u.isNumber)(g)?"".concat(g).concat(v):g,Object(u.isNull)(a)||Object(u.isNull)(l)){var b=i({},a?{}:{width:t.offsetWidth},{},l?{}:{height:t.offsetHeight});r.set(b,{silent:1})}e.stopDefault({preserveSelected:1}),m?this.updateOffset():n.one(d.motionsEv,this.updateOffset)},onScroll:function(){var e=this.frame,t=this.em;t.trigger("frame:scroll",{frame:e,body:e.getBody(),target:e.getWindow()})},frameLoaded:function(){var e=this.frame;e.getWindow().onscroll=this.onScroll,this.updateDim()},render:function(){var e=this.frame,t=this.$el,n=this.ppfx,r=this.cv,i=this.model,o=this.el,s=i.attributes.onRender;e.render(),t.empty().attr({"class":"".concat(n,"frame-wrapper")}).append('\n <div class="'.concat(n,'frame-wrapper__top gjs-two-color" data-frame-top>\n <div class="').concat(n,'frame-wrapper__name" data-action-move>\n ').concat(i.get("name")||"",'\n </div>\n <div class="').concat(n,'frame-wrapper__top-r">\n <div class="').concat(n,'frame-wrapper__icon" data-action-remove style="display: none">\n <svg viewBox="0 0 24 24"><path d="M19 4h-3.5l-1-1h-5l-1 1H5v2h14M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12z"></path></svg>\n </div>\n </div>\n </div>\n <div class="').concat(n,'frame-wrapper__right" data-frame-right></div>\n <div class="').concat(n,'frame-wrapper__left" data-frame-left></div>\n <div class="').concat(n,'frame-wrapper__bottom" data-frame-bottom></div>\n ')).append(e.el);var a=Object(d.createEl)("div",{"class":"".concat(n,"tools"),style:"pointer-events:none; opacity: 0"},'\n <div class="'.concat(n,'highlighter" data-hl></div>\n <div class="').concat(n,'badge" data-badge></div>\n <div class="').concat(n,'placeholder">\n <div class="').concat(n,'placeholder-int"></div>\n </div>\n <div class="').concat(n,'ghost"></div>\n <div class="').concat(n,'toolbar" style="pointer-events:all"></div>\n <div class="').concat(n,'resizer"></div>\n <div class="').concat(n,'offset-v" data-offset>\n <div class="gjs-marginName" data-offset-m>\n <div class="gjs-margin-v-el gjs-margin-v-top" data-offset-m-t></div>\n <div class="gjs-margin-v-el gjs-margin-v-bottom" data-offset-m-b></div>\n <div class="gjs-margin-v-el gjs-margin-v-left" data-offset-m-l></div>\n <div class="gjs-margin-v-el gjs-margin-v-right" data-offset-m-r></div>\n </div>\n <div class="gjs-paddingName" data-offset-m>\n <div class="gjs-padding-v-el gjs-padding-v-top" data-offset-p-t></div>\n <div class="gjs-padding-v-el gjs-padding-v-bottom" data-offset-p-b></div>\n <div class="gjs-padding-v-el gjs-padding-v-left" data-offset-p-l></div>\n <div class="gjs-padding-v-el gjs-padding-v-right" data-offset-p-r></div>\n </div>\n </div>\n <div class="').concat(n,'offset-fixed-v"></div>\n '));return this.elTools=a,r.toolsWrapper.appendChild(a),s&&s({el:o,elTop:o.querySelector("[data-frame-top]"),elRight:o.querySelector("[data-frame-right]"),elBottom:o.querySelector("[data-frame-bottom]"),elLeft:o.querySelector("[data-frame-left]"),frame:i,frameWrapperView:this,remove:this.remove,startDrag:this.startDrag}),this}})},"./src/canvas/view/FramesView.js":function(e,t,n){"use strict";n.r(t);var r=n("./src/domain_abstract/view/DomainViews.js"),i=n("./src/canvas/view/FrameWrapView.js");t["default"]=r["default"].extend({itemView:i["default"],autoAdd:1,init:function(){this.listenTo(this.collection,"reset",this.render)},onRender:function(){var e=this.config,t=this.$el,n=e.em;n&&t.attr({"class":"".concat(n.getConfig("stylePrefix"),"frames")})}})},"./src/code_manager/config/config.js":function(e,t,n){"use strict";n.r(t),t["default"]={stylePrefix:"cm-",inlineCss:!1}},"./src/code_manager/index.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/underscore/underscore.js"),i=(n.n(r),n("./src/code_manager/config/config.js")),o=n("./src/code_manager/model/HtmlGenerator.js"),s=n("./src/code_manager/model/CssGenerator.js"),a=n("./src/code_manager/model/JsonGenerator.js"),l=n("./src/code_manager/model/JsGenerator.js"),c=n("./src/code_manager/model/CodeMirrorEditor.js"),u=n("./src/code_manager/view/EditorView.js");t["default"]=function(){var e={},t={},n={},d={},h={},f="CodeMirror";return{getConfig:function(){return e},config:e,EditorView:u["default"],name:"CodeManager",init:function(t){e=t||{};for(var r in i["default"])r in e||(e[r]=i["default"][r]);var u=e.pStylePrefix;return u&&(e.stylePrefix=u+e.stylePrefix),n.html=new o["default"],n.css=new s["default"],n.json=new a["default"],n.js=new l["default"],h.CodeMirror=new c["default"],this.loadDefaultGenerators().loadDefaultViewers(),this},addGenerator:function(e,n){return t[e]=n,this},getGenerator:function(e){return t[e]||null},getGenerators:function(){return t},addViewer:function(e,t){return d[e]=t,this},getViewer:function(e){return d[e]||null},getViewers:function(){return d},createViewer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object(r.isUndefined)(e.type)?f:e.type,n=this.getViewer(t)&&this.getViewer(t).clone(),i=document.createElement("div"),o=document.createElement("textarea");return i.appendChild(o),n.set(e),n.init(o),n.setElement(i),n},updateViewer:function(e,t){e.setContent(t)},getCode:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r.em=e.em;var i=this.getGenerator(n);return i?i.build(t,r):""},loadDefaultGenerators:function(){for(var e in n)this.addGenerator(e,n[e]);return this},loadDefaultViewers:function(){for(var e in h)this.addViewer(e,h[e]);return this}}}},"./src/code_manager/model/CodeMirrorEditor.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./node_modules/underscore/underscore.js"),l=(n.n(a),n("./node_modules/backbone/backbone.js")),c=n.n(l),u=n("./node_modules/codemirror/lib/codemirror.js"),d=n.n(u),h=n("./node_modules/codemirror/mode/htmlmixed/htmlmixed.js"),f=(n.n(h),n("./node_modules/codemirror/mode/css/css.js")),p=(n.n(f),n("./node_modules/codemirror-formatting/formatting.js"));n.n(p);t["default"]=c.a.Model.extend({defaults:{input:"",label:"",codeName:"",theme:"hopscotch",readOnly:!0,lineNumbers:!0},init:function(e){return Object(a.bindAll)(this,"onChange"),this.editor=d.a.fromTextArea(e,i({dragDrop:!1,lineWrapping:!0,mode:this.get("codeName")},this.attributes)),this.element=e,this.editor.on("change",this.onChange),this},onChange:function(){this.trigger("update",this)},getEditor:function(){return this.editor},getElement:function(){return this.element},setElement:function(e){return this.element=e,this},refresh:function(){return this.getEditor().refresh(),this},focus:function(){return this.getEditor().focus(),this},getContent:function(){var e=this.getEditor();return e&&e.getValue()},setContent:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.editor;r&&(r.setValue(e),r.autoFormatRange&&(d.a.commands.selectAll(r),r.autoFormatRange(r.getCursor(!0),r.getCursor(!1)),d.a.commands.goDocStart(r)),!n.noRefresh&&setTimeout(function(){return t.refresh()}))}})},"./src/code_manager/model/CssGenerator.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=n("./node_modules/underscore/underscore.js"),s=(n.n(o),Number.MAX_VALUE);t["default"]=i.a.Model.extend({initialize:function(){this.compCls=[],this.ids=[]},buildFromModel:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r="",i=this.em,o=i&&i.getConfig("avoidInlineStyle"),s=e.styleToString(),a=e.get("classes"),l=n.wrapperIsBody,c=e.get("wrapper");if(this.ids.push("#".concat(e.getId())),a.each(function(e){return t.compCls.push(e.getFullName())}),!o&&s){var u="#".concat(e.getId());u=l&&c?"body":u,r="".concat(u,"{").concat(s,"}")}var d=e.components();return d.each(function(e){return r+=t.buildFromModel(e,n)}),r},build:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.cssc,i=n.em||"";this.em=i,this.compCls=[],this.ids=[];var s=this.buildFromModel(e,n),a=Object(o.isUndefined)(n.clearStyles)&&i?i.getConfig("clearStyles"):n.clearStyles;if(r){var l=r.getAll(),c={},u=[];l.each(function(e){var r=e.getAtRule();if(r){var i=c[r];return void(i?i.push(e):c[r]=[e])}s+=t.buildFromRule(e,u,n)}),this.sortMediaObject(c).forEach(function(e){var r="",i=e.key,o=e.value;o.forEach(function(e){var o=t.buildFromRule(e,u,n);e.get("singleAtRule")?s+="".concat(i,"{").concat(o,"}"):r+=o}),r&&(s+="".concat(i,"{").concat(r,"}"))}),i&&a&&l.remove(u)}return s},buildFromRule:function(e,t){var n,r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o="",s=e.selectorsToString({skipAdd:1}),a=e.get("selectorsAdd"),l=e.get("singleAtRule");if(e.get("selectors").each(function(e){var t=e.getFullName();(r.compCls.indexOf(t)>=0||r.ids.indexOf(t)>=0||i.keepUnusedStyles)&&(n=1)}),s&&n||a||l){var c=e.getDeclaration();c&&(o+=c)}else t.push(e);return o},getQueryLength:function(e){var t=/(-?\d*\.?\d+)\w{0,}/.exec(e);return t?parseFloat(t[1]):s},sortMediaObject:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=[];return Object(o.each)(t,function(e,t){return n.push({key:t,value:e})}),n.sort(function(t,n){var r=[t.key,n.key].every(function(e){return e.indexOf("min-width")!==-1}),i=r?t.key:n.key,o=r?n.key:t.key;return e.getQueryLength(i)-e.getQueryLength(o)})}})},"./src/code_manager/model/HtmlGenerator.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./node_modules/backbone/backbone.js"),l=n.n(a);t["default"]=l.a.Model.extend({build:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.get("components");return t.exportWrapper?e.toHTML(i({},t.wrapperIsBody&&{tag:"body"})):this.buildModels(n)},buildModels:function(e){var t="";return e.each(function(e){t+=e.toHTML()}),t}})},"./src/code_manager/model/JsGenerator.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/underscore/underscore.js"),i=(n.n(r),n("./node_modules/backbone/backbone.js")),o=n.n(i);t["default"]=o.a.Model.extend({mapModel:function(e){var t="",n=e.get("script-export")||e.get("script"),i=e.get("type"),o=e.get("components"),s=e.getId();if(n){var a=e.get("attributes");a=Object(r.extend)({},a,{id:s}),e.set("attributes",a,{silent:1});var l=e.getScriptString(n);if(e.get("scriptUpdated"))this.mapJs[i+"-"+s]={ids:[s],code:l};else{var c=this.mapJs[i];c?c.ids.push(s):this.mapJs[i]={ids:[s],code:l}}}return o.each(function(e){t+=this.mapModel(e)},this),t},build:function(e){this.mapJs={},this.mapModel(e);var t="";for(var n in this.mapJs){var r=this.mapJs[n],i="#"+r.ids.join(", #");t+="\n var items = document.querySelectorAll('".concat(i,"');\n for (var i = 0, len = items.length; i < len; i++) {\n (function(){").concat(r.code,"}.bind(items[i]))();\n }")}return t}})},"./src/code_manager/model/JsonGenerator.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/underscore/underscore.js"),i=(n.n(r),n("./node_modules/backbone/backbone.js")),o=n.n(i);t["default"]=o.a.Model.extend({build:function(e){var t=e.toJSON();return this.beforeEach(t),Object(r.each)(t,function(e,n){var r=t[n];if(r instanceof o.a.Model)t[n]=this.build(r);else if(r instanceof o.a.Collection){var i=r;t[n]=[],i.length&&i.each(function(e,r){t[n][r]=this.build(e)},this)}},this),t},beforeEach:function(e){delete e.status}})},"./src/code_manager/view/EditorView.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/underscore/underscore.js"),i=(n.n(r),n("./node_modules/backbone/backbone.js")),o=n.n(i);t["default"]=o.a.View.extend({template:Object(r.template)('\n <div class="<%= pfx %>editor" id="<%= pfx %><%= codeName %>">\n \t<div id="<%= pfx %>title"><%= label %></div>\n \t<div id="<%= pfx %>code"></div>\n </div>'),initialize:function(e){this.config=e.config||{},this.pfx=this.config.stylePrefix},render:function(){var e=this.model.toJSON();return e.pfx=this.pfx,this.$el.html(this.template(e)),this.$el.attr("class",this.pfx+"editor-c"),this.$el.find("#"+this.pfx+"code").append(this.model.get("input")),this}})},"./src/commands/config/config.js":function(e,t,n){"use strict";n.r(t),t["default"]={stylePrefix:"com-",defaults:[],strict:1}},"./src/commands/index.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){l()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/toConsumableArray.js"),s=n.n(o),a=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),l=n.n(a),c=n("./node_modules/underscore/underscore.js"),u=(n.n(c),n("./src/commands/view/CommandAbstract.js")),d=n("./src/commands/config/config.js"),h=n("./src/dom_components/model/Component.js");t["default"]=function(){var e,t={},r={},o={},a={},l=[["preview","Preview","preview"],["resize","Resize","resize"],["fullscreen","Fullscreen","fullscreen"],["copy","CopyComponent"],["paste","PasteComponent"],["canvas-move","CanvasMove"],["canvas-clear","CanvasClear"],["open-code","ExportTemplate","export-template"],["open-layers","OpenLayers","open-layers"],["open-styles","OpenStyleManager","open-sm"],["open-traits","OpenTraitManager","open-tm"],["open-blocks","OpenBlocks","open-blocks"],["open-assets","OpenAssets","open-assets"],["component-select","SelectComponent","select-comp"],["component-outline","SwitchVisibility","sw-visibility"],["component-offset","ShowOffset","show-offset"],["component-move","MoveComponent","move-comp"],["component-next","ComponentNext"],["component-prev","ComponentPrev"],["component-enter","ComponentEnter"],["component-exit","ComponentExit","select-parent"],["component-delete","ComponentDelete"],["component-style-clear","ComponentStyleClear"],["component-drag","ComponentDrag"]],f=function(e,t){return Object(c.isFunction)(t)&&(t={run:t}),t.stop||(t.noStop=1),delete t.initialize,t.id=e,r[e]=u["default"].extend(t),this};return{CommandAbstract:u["default"],name:"Commands",init:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t=i({},d["default"],{},r),e=t.em;var a=t.pStylePrefix;a&&(t.stylePrefix=a+t.stylePrefix);for(var u in t.defaults){var f=t.defaults[u];f.id&&this.add(f.id,f)}return o["tlb-delete"]={run:function(e){return e.runCommand("core:component-delete")}},o["tlb-clone"]={run:function(e){e.runCommand("core:copy"),e.runCommand("core:paste")}},o["tlb-move"]={run:function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=e.getModel(),o=r&&r.event,a=r.target,l=a||e.getSelected(),u=a?[a]:s()(e.getSelectedAll()),d=o&&"dragstart"==o.type,f={preserveSelected:1},p=["absolute","translate"],g=l.get("dmode")||i.get("dmode"),m=function(){return i.stopDefault(f)},v=Object(c.includes)(p,g);if(u.forEach(function(e){return e.trigger("disable")}),!l||!l.get("draggable"))return i.logWarning("The element is not draggable");d?setTimeout(m,0):m();var b=function(e){i.trigger("".concat(h.eventDrag,":start"),e)},y=function(e){i.trigger(h.eventDrag,e)},w=function(t,n,r){i.runDefault(f),u.forEach(function(e){return e.set("status","selected")}),e.select(u),l.emitUpdate(),i.trigger("".concat(h.eventDrag,":end"),r),(v||r.cancelled)&&i.set("_cmpDrag",1)};if(v)n=e.runCommand("core:component-drag",{guidesInfo:1,mode:g,target:l,onStart:b,onDrag:y,onEnd:w,event:o});else{d&&o.dataTransfer.setDragImage(l.view.el,0,0);var x=e.Commands.get("move-comp");x.onStart=b,x.onDrag=y,x.onEndMoveFromModel=w,x.initSorterFromModels(u)}u.forEach(function(e){return e.set("status","freezed-selected")})}},o["core:undo"]=function(e){return e.UndoManager.undo()},o["core:redo"]=function(e){return e.UndoManager.redo()},l.forEach(function(t){var r=t[2],i=n("./src/commands/view sync recursive ^\\.\\/.*$")("./".concat(t[1]))["default"],s="core:".concat(t[0]);o[s]=i,r&&(o[r]=i,["run","stop"].forEach(function(t){e.on("".concat(t,":").concat(r),function(){for(var n,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return(n=e).trigger.apply(n,["".concat(t,":").concat(s)].concat(i))})}))}),t.em&&(t.model=t.em.get("Canvas")),this.loadDefaultCommands(),this},add:f,get:function(n){var i=r[n];return Object(c.isFunction)(i)?(i=new i(t),r[n]=i):i||e.logWarning("'".concat(n,"' command not found")),i},extend:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.get(e);if(n){var r=i({},n.constructor.prototype,{},t);this.add(e,r);var o=l.filter(function(t){return"core:".concat(t[0])===e&&t[2]})[0];o&&this.add(o[2],r)}return this},has:function(e){return!!r[e]},getAll:function(){return r},run:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.runCommand(this.get(e),t)},stop:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.stopCommand(this.get(e),t)},isActive:function(e){return this.getActive().hasOwnProperty(e)},getActive:function(){return a},loadDefaultCommands:function(){for(var e in o)this.add(e,o[e]);return this},runCommand:function(n){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(n&&n.run){var o=n.id,s=e.get("Editor");this.isActive(o)&&!i.force&&t.strict||(r=n.callRun(s,i),o&&n.stop&&!n.noStop&&!i.abort&&(a[o]=r))}return r},stopCommand:function(n){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(n&&n.run){var o=n.id,s=e.get("Editor");(this.isActive(o)||i.force||!t.strict)&&(o&&delete a[o],r=n.callStop(s,i))}return r},create:function(e){e.stop||(e.noStop=1);var n=u["default"].extend(e);return new n(t)}}}},"./src/commands/view sync recursive ^\\.\\/.*$":function(e,t,n){function r(e){var t=i(e);return n(t)}function i(e){if(!n.o(o,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return o[e]}var o={"./CanvasClear":"./src/commands/view/CanvasClear.js","./CanvasClear.js":"./src/commands/view/CanvasClear.js","./CanvasMove":"./src/commands/view/CanvasMove.js","./CanvasMove.js":"./src/commands/view/CanvasMove.js","./CommandAbstract":"./src/commands/view/CommandAbstract.js","./CommandAbstract.js":"./src/commands/view/CommandAbstract.js","./ComponentDelete":"./src/commands/view/ComponentDelete.js","./ComponentDelete.js":"./src/commands/view/ComponentDelete.js","./ComponentDrag":"./src/commands/view/ComponentDrag.js","./ComponentDrag.js":"./src/commands/view/ComponentDrag.js","./ComponentEnter":"./src/commands/view/ComponentEnter.js","./ComponentEnter.js":"./src/commands/view/ComponentEnter.js","./ComponentExit":"./src/commands/view/ComponentExit.js","./ComponentExit.js":"./src/commands/view/ComponentExit.js","./ComponentNext":"./src/commands/view/ComponentNext.js","./ComponentNext.js":"./src/commands/view/ComponentNext.js","./ComponentPrev":"./src/commands/view/ComponentPrev.js","./ComponentPrev.js":"./src/commands/view/ComponentPrev.js","./ComponentStyleClear":"./src/commands/view/ComponentStyleClear.js","./ComponentStyleClear.js":"./src/commands/view/ComponentStyleClear.js","./CopyComponent":"./src/commands/view/CopyComponent.js","./CopyComponent.js":"./src/commands/view/CopyComponent.js","./DeleteComponent":"./src/commands/view/DeleteComponent.js","./DeleteComponent.js":"./src/commands/view/DeleteComponent.js","./ExportTemplate":"./src/commands/view/ExportTemplate.js","./ExportTemplate.js":"./src/commands/view/ExportTemplate.js","./Fullscreen":"./src/commands/view/Fullscreen.js","./Fullscreen.js":"./src/commands/view/Fullscreen.js","./MoveComponent":"./src/commands/view/MoveComponent.js","./MoveComponent.js":"./src/commands/view/MoveComponent.js","./OpenAssets":"./src/commands/view/OpenAssets.js","./OpenAssets.js":"./src/commands/view/OpenAssets.js","./OpenBlocks":"./src/commands/view/OpenBlocks.js","./OpenBlocks.js":"./src/commands/view/OpenBlocks.js","./OpenLayers":"./src/commands/view/OpenLayers.js","./OpenLayers.js":"./src/commands/view/OpenLayers.js","./OpenStyleManager":"./src/commands/view/OpenStyleManager.js","./OpenStyleManager.js":"./src/commands/view/OpenStyleManager.js","./OpenTraitManager":"./src/commands/view/OpenTraitManager.js","./OpenTraitManager.js":"./src/commands/view/OpenTraitManager.js","./PasteComponent":"./src/commands/view/PasteComponent.js","./PasteComponent.js":"./src/commands/view/PasteComponent.js","./Preview":"./src/commands/view/Preview.js","./Preview.js":"./src/commands/view/Preview.js","./Resize":"./src/commands/view/Resize.js","./Resize.js":"./src/commands/view/Resize.js","./SelectComponent":"./src/commands/view/SelectComponent.js","./SelectComponent.js":"./src/commands/view/SelectComponent.js","./SelectPosition":"./src/commands/view/SelectPosition.js","./SelectPosition.js":"./src/commands/view/SelectPosition.js","./ShowOffset":"./src/commands/view/ShowOffset.js","./ShowOffset.js":"./src/commands/view/ShowOffset.js","./SwitchVisibility":"./src/commands/view/SwitchVisibility.js","./SwitchVisibility.js":"./src/commands/view/SwitchVisibility.js"};r.keys=function(){return Object.keys(o)},r.resolve=i,e.exports=r,r.id="./src/commands/view sync recursive ^\\.\\/.*$"},"./src/commands/view/CanvasClear.js":function(e,t,n){"use strict";n.r(t),t["default"]={run:function(e){e.DomComponents.clear(),e.CssComposer.clear()}}},"./src/commands/view/CanvasMove.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/underscore/underscore.js"),i=(n.n(r),n("./src/utils/mixins.js")),o=n("./src/utils/Dragger.js");t["default"]={run:function(e){Object(r.bindAll)(this,"onKeyUp","enableDragger","disableDragger"),this.editor=e,this.canvasModel=this.canvas.getCanvasView().model,this.toggleMove(1)},stop:function(e){this.toggleMove(),this.disableDragger()},onKeyUp:function(e){" "===Object(i.getKeyChar)(e)&&this.editor.stopCommand(this.id)},enableDragger:function(e){this.toggleDragger(1,e)},disableDragger:function(e){this.toggleDragger(0,e)},toggleDragger:function(e,t){var n=this.canvasModel,r=this.em,i=this.dragger,s=e?"add":"remove";this.getCanvas().classList[s]("".concat(this.ppfx,"is__grabbing")),i||(i=new o["default"]({getPosition:function(){return{x:n.get("x"),y:n.get("y")}},setPosition:function(e){var t=e.x,r=e.y;n.set({x:t,y:r})},onStart:function(e,t){r.trigger("canvas:move:start",t)},onDrag:function(e,t){r.trigger("canvas:move",t)},onEnd:function(e,t){r.trigger("canvas:move:end",t)}}),this.dragger=i),e?i.start(t):i.stop()},toggleMove:function(e){var t=this.ppfx,n=e?"add":"remove",r=e?"on":"off",o={on:i.on,off:i.off},s=this.getCanvas(),a=["".concat(t,"is__grab")];!e&&a.push("".concat(t,"is__grabbing")),a.forEach(function(e){return s.classList[n](e)}),o[r](document,"keyup",this.onKeyUp),o[r](s,"mousedown",this.enableDragger),o[r](document,"mouseup",this.disableDragger)}}},"./src/commands/view/CommandAbstract.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r);i.a.$;t["default"]=i.a.View.extend({initialize:function(e){this.config=e||{},this.editorModel=this.em=this.config.em||{},this.pfx=this.config.stylePrefix,this.ppfx=this.config.pStylePrefix,this.hoverClass=this.pfx+"hover",this.badgeClass=this.pfx+"badge",this.plhClass=this.pfx+"placeholder",this.freezClass=this.ppfx+"freezed",this.canvas=this.em.get&&this.em.get("Canvas"),this.em.get&&this.setElement(this.getCanvas()),this.canvas&&(this.$canvas=this.$el,this.canvasTool=this.getCanvasTools()),this.init(this.config)},onFrameScroll:function(e){},getCanvas:function(){return this.canvas.getElement()},getCanvasBody:function(){return this.canvas.getBody()},getCanvasWrapper:function(){return this.canvas.getWrapperEl()},getCanvasTools:function(){return this.canvas.getToolsEl()},offset:function(e){var t=e.getBoundingClientRect();return{top:t.top+e.ownerDocument.body.scrollTop,left:t.left+e.ownerDocument.body.scrollLeft}},init:function(e){},callRun:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.id;if(e.trigger("run:".concat(n,":before"),t),t&&t.abort)return void e.trigger("abort:".concat(n),t);var r=t.sender||e,i=this.run(e,r,t);return e.trigger("run:".concat(n),i,t),e.trigger("run",n,i,t),i},callStop:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.id,r=t.sender||e;e.trigger("stop:".concat(n,":before"),t);var i=this.stop(e,r,t);return e.trigger("stop:".concat(n),i,t),e.trigger("stop",n,i,t),i},stopCommand:function(){this.em.get("Commands").stop(this.id)},run:function(e,t){},stop:function(e,t){}})},"./src/commands/view/ComponentDelete.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/@babel/runtime/helpers/toConsumableArray.js"),i=n.n(r),o=n("./node_modules/underscore/underscore.js");n.n(o);t["default"]={run:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=r.component||e.getSelectedAll();return s=Object(o.isArray)(s)?i()(s):[s],e.select(null),s.forEach(function(e){return e&&e.get("removable")?void e.remove():n.em.logWarning("The element is not removable",{component:e})}),s}}},"./src/commands/view/ComponentDrag.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./node_modules/underscore/underscore.js"),l=(n.n(a),n("./src/utils/Dragger.js")),c="dmode";t["default"]={run:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(a.bindAll)(this,"setPosition","onStart","onDrag","onEnd","getPosition","getGuidesStatic","renderGuide","getGuidesTarget");var o=r.target,s=r.event,u=r.mode,d=r.dragger,h=void 0===d?{}:d,f=o.getEl(),p=i({doc:f.ownerDocument,onStart:this.onStart,onEnd:this.onEnd,onDrag:this.onDrag,getPosition:this.getPosition,setPosition:this.setPosition,guidesStatic:function(){return n.guidesStatic},guidesTarget:function(){return n.guidesTarget}},h);this.setupGuides(),this.opts=r,this.editor=e,this.em=e.getModel(),this.target=o,this.isTran="translate"==u,this.guidesContainer=this.getGuidesContainer(),this.guidesTarget=this.getGuidesTarget(),this.guidesStatic=this.getGuidesStatic();var g=this.dragger;return g?g.setOptions(p):(g=new l["default"](p),this.dragger=g),s&&g.start(s),this.toggleDrag(1),this.em.trigger("".concat(c,":start"),this.getEventOpts()),g},getEventOpts:function(){return{mode:this.opts.mode,
|
||
target:this.target,guidesTarget:this.guidesTarget,guidesStatic:this.guidesStatic}},stop:function(){this.toggleDrag()},setupGuides:function(){(this.guides||[]).forEach(function(e){var t=e.guide;t&&t.parentNode.removeChild(t)}),this.guides=[]},getGuidesContainer:function(){var e=this,t=this.guidesEl;if(!t){var n=this.editor,r=this.em,i=this.opts,o=n.getConfig("stylePrefix"),s=document.createElement("div"),l=document.createElement("div"),c='<div class="'.concat(o,"guide-info__line ").concat(o,'danger-bg">\n <div class="').concat(o,"guide-info__content ").concat(o,'danger-color"></div>\n </div>');t=document.createElement("div"),t.className="".concat(o,"guides"),s.className="".concat(o,"guide-info ").concat(o,"guide-info__x"),l.className="".concat(o,"guide-info ").concat(o,"guide-info__y"),s.innerHTML=c,l.innerHTML=c,t.appendChild(s),t.appendChild(l),n.Canvas.getGlobalToolsEl().appendChild(t),this.guidesEl=t,this.elGuideInfoX=s,this.elGuideInfoY=l,this.elGuideInfoContentX=s.querySelector(".".concat(o,"guide-info__content")),this.elGuideInfoContentY=l.querySelector(".".concat(o,"guide-info__content")),r.on("canvas:update frame:scroll",Object(a.debounce)(function(){e.updateGuides(),i.debug&&e.guides.forEach(function(t){return e.renderGuide(t)})},200))}return t},getGuidesStatic:function(){var e=this,t=[],n=this.target.getEl(),r=n.parentNode,i=void 0===r?{}:r;return Object(a.each)(i.children,function(r){return t=t.concat(n!==r?e.getElementGuides(r):[])}),t.concat(this.getElementGuides(i))},getGuidesTarget:function(){return this.getElementGuides(this.target.getEl())},updateGuides:function(e){var t,n,r=this;(e||this.guides).forEach(function(e){var i=e.origin,o=t===i?n:r.getElementPos(i);t=i,n=o,Object(a.each)(r.getGuidePosUpdate(e,o),function(t,n){return e[n]=t}),e.originRect=o})},getGuidePosUpdate:function(e,t){var n={},r=t.top,i=t.height,o=t.left,s=t.width;switch(e.type){case"t":n.y=r;break;case"b":n.y=r+i;break;case"l":n.x=o;break;case"r":n.x=o+s;break;case"x":n.x=o+s/2;break;case"y":n.y=r+i/2}return n},renderGuide:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.guide||document.createElement("div"),n="px",r=e.active?2:1,i=t.children[0];return t.style="position: absolute; background-color: ".concat(e.active?"green":"red",";"),t.children.length||(i=document.createElement("div"),i.style="position: absolute; color: red; padding: 5px; top: 0; left: 0;",t.appendChild(i)),e.y?(t.style.width="100%",t.style.height="".concat(r).concat(n),t.style.top="".concat(e.y).concat(n),t.style.left=0):(t.style.width="".concat(r).concat(n),t.style.height="100%",t.style.left="".concat(e.x).concat(n),t.style.top="0".concat(n)),!e.guide&&this.guidesContainer.appendChild(t),t},getElementPos:function(e){return this.editor.Canvas.getElementPos(e,{noScroll:1})},getElementGuides:function(e){var t=this,n=this.opts,r=this.getElementPos(e),o=r.top,s=r.height,a=r.left,l=r.width,c=[{type:"t",y:o},{type:"b",y:o+s},{type:"l",x:a},{type:"r",x:a+l},{type:"x",x:a+l/2},{type:"y",y:o+s/2}].map(function(o){return i({},o,{origin:e,originRect:r,guide:n.debug&&t.renderGuide(o)})});return c.forEach(function(e){return t.guides.push(e)}),c},getTranslate:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"x",n=0;return(e||"").split(" ").forEach(function(e){var r=e.trim(),i="translate".concat(t.toUpperCase(),"(");0===r.indexOf(i)&&(n=parseFloat(r.replace(i,"")))}),n},setTranslate:function(e,t,n){var r="translate".concat(t.toUpperCase(),"("),i="".concat(r).concat(n,")"),o=(e||"").split(" ").map(function(e){var t=e.trim();return 0===t.indexOf(r)&&(e=i),e}).join(" ");return o.indexOf(r)<0&&(o+=" ".concat(i)),o},getPosition:function(){var e=this.target,t=this.isTran,n=e.getStyle(),r=n.left,i=n.top,o=n.transform,s=0,a=0;return t?(s=this.getTranslate(o),a=this.getTranslate(o,"y")):(s=parseFloat(r),a=parseFloat(i)),{x:s,y:a}},setPosition:function(e){var t=e.x,n=e.y,r=e.end,i=e.position,o=e.width,s=e.height,l=this.target,c=this.isTran,u="px",d=r?"":1,h="".concat(t).concat(u),f="".concat(n).concat(u);if(c){var p=l.getStyle().transform||"";return p=this.setTranslate(p,"x",h),p=this.setTranslate(p,"y",f),l.addStyle({transform:p,en:d},{avoidStore:!r})}var g={position:i,width:o,height:s},m={left:h,top:f,en:d};Object(a.keys)(g).forEach(function(e){var t=g[e];t&&(m[e]=t)}),l.addStyle(m,{avoidStore:!r})},_getDragData:function(){var e=this.target;return{target:e,parent:e.parent(),index:e.index()}},onStart:function u(){var e=this.target,t=this.editor,n=this.isTran,r=this.opts,i=r.center,u=r.onStart,o=t.Canvas,s=e.getStyle(),a="absolute";if(u&&u(this._getDragData()),!n&&s.position!==a){var l=o.offset(e.getEl()),c=l.left,d=l.top,h=l.width,f=l.height;if(i){var p=o.getMouseRelativeCanvas(event),g=p.x,m=p.y;c=g,d=m}this.setPosition({x:c,y:d,width:"".concat(h,"px"),height:"".concat(f,"px"),position:a})}},onDrag:function d(){var e=this,t=this.guidesTarget,n=this.opts,d=n.onDrag;this.updateGuides(t),n.debug&&t.forEach(function(t){return e.renderGuide(t)}),n.guidesInfo&&this.renderGuideInfo(t.filter(function(e){return e.active})),d&&d(this._getDragData())},onEnd:function h(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.editor,o=this.opts,s=this.id,h=o.onEnd;h&&h(e,n,i({event:e},n,{},this._getDragData())),r.stopCommand(s),this.hideGuidesInfo(),this.em.trigger("".concat(c,":end"),this.getEventOpts())},hideGuidesInfo:function(){var e=this;["X","Y"].forEach(function(t){var n=e["elGuideInfo".concat(t)];n&&(n.style.display="none")})},renderGuideInfo:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=this.guidesStatic;this.hideGuidesInfo(),t.forEach(function(t){var r=t.origin,o=t.x,s=e.getElementPos(r),l=Object(a.isUndefined)(o)?"y":"x",u="y"===l,d=s[u?"left":"top"],h=s.rect[u?"left":"top"],f=u?d+s.width:d+s.height,p=u?h+s.rect.width:h+s.rect.height,g=e["elGuideInfo".concat(l.toUpperCase())],m=e["elGuideInfoContent".concat(l.toUpperCase())],v=g.style,b=n.filter(function(e){return e.type===t.type}).map(function(e){var t=e.originRect,n=t.left,r=t.width,i=t.top,o=t.height,s=u?n:i,a=u?n+r:i+o;return{gap:a<d?d-a:s-f,guide:e}}).filter(function(e){return e.gap>0}).sort(function(e,t){return e.gap-t.gap}).map(function(e){return e.guide})[0];if(b){var y=b.originRect,w=y.left,x=y.width,C=y.top,j=y.height,O=y.rect,k=u?w<s.left:C<s.top,S=u?w:C,T=u?O.left:O.top,P=u?w+x:C+j,E=u?O.left+O.width:O.top+O.height,_=u?t.y:t.x,D=k?P:f,M="".concat(_,"px"),A=k?d-P:S-f,L=k?h-E:T-p;v.display="",v[u?"top":"left"]=M,v[u?"left":"top"]="".concat(D,"px"),v[u?"width":"height"]="".concat(A,"px"),m.innerHTML="".concat(Math.round(L),"px"),e.em.trigger("".concat(c,":active"),i({},e.getEventOpts(),{guide:t,guidesStatic:n,matched:b,posFirst:_,posSecond:D,size:A,sizeRaw:L,elGuideInfo:g,elGuideInfoCnt:m}))}})},toggleDrag:function(e){var t=this.ppfx,n=this.editor,r=e?"add":"remove",i=["".concat(t,"is__grabbing")],o=n.Canvas,s=o.getBody();i.forEach(function(e){return s.classList[r](e)}),o[e?"startAutoscroll":"stopAutoscroll"]()}}},"./src/commands/view/ComponentEnter.js":function(e,t,n){"use strict";n.r(t),t["default"]={run:function(e){if(e.Canvas.hasFocus()){var t=[];e.getSelectedAll().forEach(function(e){var n=e.components(),r=n&&n.at(0);r&&t.push(r)}),t.length&&e.select(t)}}}},"./src/commands/view/ComponentExit.js":function(e,t,n){"use strict";n.r(t),t["default"]={run:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e.Canvas.hasFocus()||n.force){var r=[];e.getSelectedAll().forEach(function(e){for(var t=e.parent();t&&!t.get("selectable");)t=t.parent();t&&r.push(t)}),r.length&&e.select(r)}}}},"./src/commands/view/ComponentNext.js":function(e,t,n){"use strict";n.r(t),t["default"]={run:function(e){if(e.Canvas.hasFocus()){var t=[];e.getSelectedAll().forEach(function(e){var n=e.collection,r=n.indexOf(e),i=n.at(r+1);t.push(i||e)}),t.length&&e.select(t)}}}},"./src/commands/view/ComponentPrev.js":function(e,t,n){"use strict";n.r(t),t["default"]={run:function(e){if(e.Canvas.hasFocus()){var t=[];e.getSelectedAll().forEach(function(e){var n=e.collection,r=n.indexOf(e),i=n.at(r-1);t.push(i&&r-1>=0?i:e)}),t.length&&e.select(t)}}}},"./src/commands/view/ComponentStyleClear.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/underscore/underscore.js");n.n(r);t["default"]={run:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.target,o=e.DomComponents,s=i.get("type"),a=o.getWrapper().find('[data-gjs-type="'.concat(s,'"]')).length,l=[];if(!a){var c=e.CssComposer.getAll(),u=i.get("style-signature");u=Object(r.isArray)(u)?u:[u],c.forEach(function(e){var t=e.selectorsToString();u.forEach(function(n){n&&t.indexOf(n)>=0&&l.push(e)})}),c.remove(l)}return l}}},"./src/commands/view/CopyComponent.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/@babel/runtime/helpers/toConsumableArray.js"),i=n.n(r);t["default"]={run:function(e){var t=e.getModel(),n=i()(e.getSelectedAll());n.length&&t.set("clipboard",n)}}},"./src/commands/view/DeleteComponent.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/underscore/underscore.js"),i=(n.n(r),n("./node_modules/backbone/backbone.js")),o=n.n(i),s=n("./src/commands/view/SelectComponent.js"),a=o.a.$;t["default"]=Object(r.extend)({},s["default"],{init:function(e){Object(r.bindAll)(this,"startDelete","stopDelete","onDelete"),this.hoverClass=this.pfx+"hover-delete",this.badgeClass=this.pfx+"badge-red"},enable:function(){this.$el.find("*").mouseover(this.startDelete).mouseout(this.stopDelete).click(this.onDelete)},startDelete:function(e){e.stopPropagation();var t=a(e.target);t.data("model").get("removable")&&(t.addClass(this.hoverClass),this.attachBadge(t.get(0)))},stopDelete:function(e){e.stopPropagation();var t=a(e.target);t.removeClass(this.hoverClass),this.badge&&this.badge.css({left:-1e3,top:-1e3})},onDelete:function(e){e.stopPropagation();var t=a(e.target);t.data("model").get("removable")&&(t.data("model").destroy(),this.removeBadge(),this.clean())},updateBadgeLabel:function(e){this.badge.html("Remove "+e.getName())}})},"./src/commands/view/ExportTemplate.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=i.a.$;t["default"]={run:function(e,t){var n=this;arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t&&t.set&&t.set("active",0);var r=e.getConfig(),i=e.Modal,s=r.stylePrefix;if(this.cm=e.CodeManager||null,!this.$editors){var a=this.buildEditor("htmlmixed","hopscotch","HTML"),l=this.buildEditor("css","hopscotch","CSS");this.htmlEditor=a.el,this.cssEditor=l.el;var c=o('<div class="'.concat(s,'export-dl"></div>'));c.append(a.$el).append(l.$el),this.$editors=c}i.open({title:r.textViewCode,content:this.$editors}).getModel().once("change:open",function(){return e.stopCommand(n.id)}),this.htmlEditor.setContent(e.getHtml()),this.cssEditor.setContent(e.getCss())},stop:function(e){var t=e.Modal;t&&t.close()},buildEditor:function(e,t,n){var r=document.createElement("textarea");!this.codeMirror&&(this.codeMirror=this.cm.getViewer("CodeMirror"));var i=this.codeMirror.clone().set({label:n,codeName:e,theme:t,input:r}),o=new this.cm.EditorView({model:i,config:this.cm.getConfig()}).render().$el;return i.init(r),{el:i,$el:o}}}},"./src/commands/view/Fullscreen.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/underscore/underscore.js");n.n(r);t["default"]={isEnabled:function(){var e=document;return e.fullscreenElement||e.webkitFullscreenElement||e.mozFullScreenElement?1:0},enable:function(e){var t="";return e.requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen?(t="webkit",e.webkitRequestFullscreen()):e.mozRequestFullScreen?(t="moz",e.mozRequestFullScreen()):e.msRequestFullscreen?e.msRequestFullscreen():console.warn("Fullscreen not supported"),t},disable:function(){var e=document;this.isEnabled()&&(e.exitFullscreen?e.exitFullscreen():e.webkitExitFullscreen?e.webkitExitFullscreen():e.mozCancelFullScreen?e.mozCancelFullScreen():e.msExitFullscreen&&e.msExitFullscreen())},fsChanged:function(e,t){var n=(document,(e||"")+"fullscreenchange");this.isEnabled()||(this.stop(null,this.sender),document.removeEventListener(n,this.fsChanged))},run:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.sender=t;var i=n.target,o=Object(r.isElement)(i)?i:document.querySelector(i),s=this.enable(o||e.getContainer());this.fsChanged=this.fsChanged.bind(this,s),document.addEventListener(s+"fullscreenchange",this.fsChanged),e.trigger("change:canvasOffset")},stop:function(e,t){t&&t.set&&t.set("active",!1),this.disable(),e&&e.trigger("change:canvasOffset")}}},"./src/commands/view/MoveComponent.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/underscore/underscore.js"),i=(n.n(r),n("./node_modules/backbone/backbone.js")),o=n.n(i),s=n("./src/utils/mixins.js"),a=n("./src/commands/view/SelectComponent.js"),l=n("./src/commands/view/SelectPosition.js"),c=o.a.$;t["default"]=Object(r.extend)({},l["default"],a["default"],{init:function(e){a["default"].init.apply(this,arguments),Object(r.bindAll)(this,"initSorter","rollback","onEndMove"),this.opt=e,this.hoverClass=this.ppfx+"highlighter-warning",this.badgeClass=this.ppfx+"badge-warning",this.noSelClass=this.ppfx+"no-select"},enable:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];a["default"].enable.apply(this,t),this.getBadgeEl().addClass(this.badgeClass),this.getHighlighterEl().addClass(this.hoverClass);var r=this.$wrapper;r.css("cursor","move"),r.on("mousedown",this.initSorter),r.addClass(this.noSelClass)},toggleClipboard:function(){},initSorter:function(e){var t=c(e.target).data("model"),n=t.get("draggable");n&&(this.cacheEl=null,this.startSelectPosition(e.target,this.frameEl.contentDocument),this.sorter.draggable=n,this.sorter.onEndMove=this.onEndMove.bind(this),this.stopSelectComponent(),this.$wrapper.off("mousedown",this.initSorter),Object(s.on)(this.getContentWindow(),"keydown",this.rollback))},initSorterFromModel:function(e){var t=e.get("draggable");if(t){this.cacheEl=null;var n=e.view.el;this.startSelectPosition(n,this.frameEl.contentDocument),this.sorter.draggable=t,this.sorter.onEndMove=this.onEndMoveFromModel.bind(this),this.stopSelectComponent(),Object(s.on)(this.getContentWindow(),"keydown",this.rollback)}},initSorterFromModels:function(e){this.cacheEl=null;var t=e[e.length-1],n=(this.em.get("currentFrame")||{}).model,r=t.getEl(n),i=r.ownerDocument;this.startSelectPosition(r,i,{onStart:this.onStart}),this.sorter.draggable=t.get("draggable"),this.sorter.toMove=e,this.sorter.onMoveClb=this.onDrag,this.sorter.onEndMove=this.onEndMoveFromModel.bind(this),this.stopSelectComponent(),Object(s.on)(this.getContentWindow(),"keydown",this.rollback)},onEndMoveFromModel:function(){Object(s.off)(this.getContentWindow(),"keydown",this.rollback)},onEndMove:function(){this.enable(),Object(s.off)(this.getContentWindow(),"keydown",this.rollback)},onSelect:function(e,t){},rollback:function(e,t){var n=e.which||e.keyCode;(27==n||t)&&(this.sorter.moved=!1,this.sorter.endMove())},getBadgeEl:function(){return this.$badge||(this.$badge=c(this.getBadge())),this.$badge},getHighlighterEl:function(){return this.$hl||(this.$hl=c(this.canvas.getHighlighter())),this.$hl},stop:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];a["default"].stop.apply(this,t),this.getBadgeEl().removeClass(this.badgeClass),this.getHighlighterEl().removeClass(this.hoverClass);var r=this.$wrapper;r.css("cursor","").unbind().removeClass(this.noSelClass)}})},"./src/commands/view/OpenAssets.js":function(e,t,n){"use strict";n.r(t),t["default"]={run:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=e.Modal,o=e.AssetManager,s=o.getConfig(),a=o.getContainer(),l=r.modalTitle||e.t("assetManager.modalTitle")||"",c=r.types,u=r.accept;if(o.setTarget(r.target),o.onClick(r.onClick),o.onDblClick(r.onDblClick),o.onSelect(r.onSelect),!this.rendered||c){var d=o.getAll().filter(function(e){return 1});c&&c.length&&(d=d.filter(function(e){return c.indexOf(e.get("type"))!==-1})),o.render(d),this.rendered=1}if(u){var h=a.querySelector("input#".concat(s.stylePrefix,"uploadFile"));h&&h.setAttribute("accept",u)}return i.open({title:l,content:a}).getModel().once("change:open",function(){return e.stopCommand(n.id)}),this},stop:function(e){return e.Modal.close(),this}}},"./src/commands/view/OpenBlocks.js":function(e,t,n){"use strict";n.r(t),t["default"]={run:function(e,t){var n=e.BlockManager,r=e.Panels;if(!this.blocks){n.render();var i="views-container",o=document.createElement("div"),s=r.getPanel(i)||r.addPanel({id:i});o.appendChild(n.getContainer()),s.set("appendContent",o).trigger("change:appendContent"),this.blocks=o}this.blocks.style.display="block"},stop:function(){var e=this.blocks;e&&(e.style.display="none")}}},"./src/commands/view/OpenLayers.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r);n("./src/navigator/index.js"),i.a.$;t["default"]={run:function(e){var t=e.LayerManager,n=e.Panels;if(!this.layers){var r="views-container",i=document.createElement("div"),o=n.getPanel(r)||n.addPanel({id:r});i.appendChild(t.render()),o.set("appendContent",i).trigger("change:appendContent"),this.layers=i}this.layers.style.display="block"},stop:function(){var e=this.layers;e&&(e.style.display="none")}}},"./src/commands/view/OpenStyleManager.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=(n("./src/style_manager/index.js"),i.a.$);t["default"]={run:function(e,t){if(this.sender=t,!this.$cn){var n=e.getConfig(),r=e.Panels;this.$cn=o("<div></div>"),this.$cn2=o("<div></div>"),this.$cn.append(this.$cn2);var i=e.DeviceManager;if(i&&n.showDevices){var s=r.addPanel({id:"devices-c"});s.set("appendContent",i.render()).trigger("change:appendContent")}var a=e.SelectorManager;a&&this.$cn2.append(a.render([])),this.$cn2.append(e.StyleManager.render());var l=e.StyleManager.getConfig(),c=l.stylePrefix;this.$header=o('<div class="'.concat(c,'header">').concat(e.t("styleManager.empty"),"</div>")),this.$cn.append(this.$header),r.getPanel("views-container")?this.panel=r.getPanel("views-container"):this.panel=r.addPanel({id:"views-container"}),this.panel.set("appendContent",this.$cn).trigger("change:appendContent"),this.target=e.editor,this.listenTo(this.target,"component:toggled",this.toggleSm)}this.toggleSm()},toggleSm:function(){var e=this.target,t=this.sender;if(!t||!t.get||t.get("active")){var n=e.get("SelectorManager").getConfig(),r=n.componentFirst,i=e.getSelectedAll().length;1===i||i>1&&r?(this.$cn2.show(),this.$header.hide()):(this.$cn2.hide(),this.$header.show())}},stop:function(){this.$cn2&&this.$cn2.hide(),this.$header&&this.$header.hide()}}},"./src/commands/view/OpenTraitManager.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=i.a.$;t["default"]={run:function(e,t){this.sender=t;var n,r=e.getModel(),i=e.Config,s=i.stylePrefix,a=e.TraitManager;if(!this.$cn){var l=a.getTraitsViewer(),c=a.getConfig();this.$cn=o("<div></div>"),this.$cn2=o("<div></div>"),this.$cn.append(this.$cn2),this.$header=o("<div>").append('<div class="'.concat(c.stylePrefix,'header">').concat(r.t("traitManager.empty"),"</div>")),this.$cn.append(this.$header),this.$cn2.append('<div class="'.concat(s,'traits-label">').concat(r.t("traitManager.label"),"</div>")),this.$cn2.append(l.render().el);var u=e.Panels;n=u.getPanel("views-container")?u.getPanel("views-container"):u.addPanel({id:"views-container"}),n.set("appendContent",this.$cn.get(0)).trigger("change:appendContent"),this.target=e.getModel(),this.listenTo(this.target,"component:toggled",this.toggleTm)}this.toggleTm()},toggleTm:function(){var e=this.sender;e&&e.get&&!e.get("active")||(1===this.target.getSelectedAll().length?(this.$cn2.show(),this.$header.hide()):(this.$cn2.hide(),this.$header.show()))},stop:function(){this.$cn2&&this.$cn2.hide(),this.$header&&this.$header.hide()}}},"./src/commands/view/PasteComponent.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/underscore/underscore.js");n.n(r);t["default"]={run:function(e){var t=e.getModel(),n=t.get("clipboard"),i=e.getSelected();n&&i&&(e.getSelectedAll().forEach(function(t){if(t){var i,o=t.collection,s=o.indexOf(t)+1,a=n.filter(function(e){return e.get("copyable")});i=Object(r.contains)(n,t)&&t.get("copyable")?o.add(t.clone(),{at:s}):o.add(a.map(function(e){return e.clone()}),{at:s}),i=Object(r.isArray)(i)?i:[i],i.forEach(function(t){return e.trigger("component:paste",t)})}}),i.emitUpdate())}}},"./src/commands/view/Preview.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/underscore/underscore.js");n.n(r);t["default"]={getPanels:function(e){return this.panels||(this.panels=e.Panels.getPanels()),this.panels},tglPointers:function(e,t){var n=e.Canvas.getBody(),i=n.querySelectorAll(".".concat(this.ppfx,"no-pointer"));Object(r.each)(i,function(e){return e.style.pointerEvents=t?"":"all"})},run:function(e,t){var n=this;this.sender=t,e.stopCommand("sw-visibility"),e.getModel().stopDefault();var r=this.getPanels(e),i=e.Canvas.getElement(),o=e.getEl(),s=e.Config.stylePrefix;if(!this.helper){var a=document.createElement("span");a.className="".concat(s,"off-prv fa fa-eye-slash"),o.appendChild(a),a.onclick=function(){return n.stopCommand()},this.helper=a}this.helper.style.display="inline-block",this.tglPointers(e),r.forEach(function(e){return e.set("visible",!1)});var l=i.style;l.width="100%",l.height="100%",l.top="0",l.left="0",l.padding="0",l.margin="0",e.refresh()},stop:function(e){var t=this.sender,n=void 0===t?{}:t;n.set&&n.set("active",0);var r=this.getPanels(e),i=e.Panels.getButton("options","sw-visibility");i&&i.get("active")&&e.runCommand("sw-visibility"),e.getModel().runDefault(),r.forEach(function(e){return e.set("visible",!0)});var o=e.Canvas.getElement();o.setAttribute("style",""),this.helper&&(this.helper.style.display="none"),e.refresh(),this.tglPointers(e,1)}}},"./src/commands/view/Resize.js":function(e,t,n){"use strict";n.r(t),t["default"]={run:function(e,t,n){var r=n||{},i=r.el||"",o=e.Canvas,s=this.canvasResizer,a=r.options||{},l=o.getCanvasView();return a.appendTo=o.getResizerEl(),a.prefix=e.getConfig().stylePrefix,a.posFetcher=l.getElementPos.bind(l),a.mousePosFetcher=o.getMouseRelativePos,s&&!r.forceNew||(this.canvasResizer=e.Utils.Resizer.init(a),s=this.canvasResizer),s.setOptions(a),s.blur(),s.focus(i),s},stop:function(){var e=this.canvasResizer;e&&e.blur()}}},"./src/commands/view/SelectComponent.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){c()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o,s=n("./node_modules/@babel/runtime/helpers/typeof.js"),a=n.n(s),l=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),c=n.n(l),u=n("./node_modules/backbone/backbone.js"),d=n.n(u),h=n("./node_modules/underscore/underscore.js"),f=(n.n(h),n("./src/utils/mixins.js")),p=n("./src/dom_components/view/ToolbarView.js"),g=n("./src/dom_components/model/Toolbar.js"),m=d.a.$;t["default"]={init:function(e){Object(h.bindAll)(this,"onHover","onOut","onClick","onFrameScroll","onFrameUpdated")},enable:function(){this.frameOff=this.canvasOff=this.adjScroll=null,this.startSelectComponent(),o=1},startSelectComponent:function(){this.toggleSelectComponent(1),this.em.getSelected()&&this.onSelect()},stopSelectComponent:function(){this.toggleSelectComponent()},toggleSelectComponent:function(e){var t=this,n=this.em,r=e?"on":"off",i={on:f.on,off:f.off},o=function(e,n){i[r](n,"mouseover",t.onHover),i[r](n,"mouseleave",t.onOut),i[r](n,"click touchend",t.onClick),i[r](e,"scroll",t.onFrameScroll)};i[r](window,"resize",this.onFrameUpdated),n[r]("component:toggled",this.onSelect,this),n[r]("change:componentHovered",this.onHovered,this),n[r]("component:resize component:styleUpdate",this.updateGlobalPos,this),n[r]("change:canvasOffset",this.updateAttached,this),n[r]("frame:updated",this.onFrameUpdated,this),n.get("Canvas").getFrames().forEach(function(e){var t=e.view;o(t.getWindow(),t.getBody())})},onHover:function(e){e.stopPropagation();var t=e.target,n=Object(f.getViewEl)(t),r=n&&n._getFrame(),i=m(t),o=i.data("model");if(!o)for(var s=i.parent();!o&&s.length>0;)o=s.data("model"),s=s.parent();if(o&&!o.get("hoverable")){for(var a=o&&o.parent();a&&!a.get("hoverable");)a=a.parent();o=a}this.currentDoc=t.ownerDocument,this.em.setHovered(o),r&&this.em.set("currentFrame",r)},onFrameUpdated:function(){this.updateLocalPos(),this.updateGlobalPos()},onHovered:function(e,t){var n=this,r={};t&&t.views.forEach(function(e){var i=e.el,o=n.getElementPos(i);r={el:i,pos:o,component:t,view:Object(f.getViewEl)(i)},n.updateToolsLocal(r),i.ownerDocument===n.currentDoc&&(n.elHovered=r)})},onSelect:Object(h.debounce)(function(){var e=this.em,t=e.getSelected(),n=e.get("currentFrame")||{},r=t&&t.getView(n.model),i=r&&r.el,o={};if(i){var s=this.getElementPos(i);o={el:i,pos:s,component:t,view:Object(f.getViewEl)(i)}}this.elSelected=o,this.updateToolsGlobal(),this.updateToolsLocal(o)}),updateGlobalPos:function(){var e=this.getElSelected();e.el&&(e.pos=this.getElementPos(e.el),this.updateToolsGlobal())},updateLocalPos:function(){var e=this.getElHovered();e.el&&(e.pos=this.getElementPos(e.el),this.updateToolsLocal())},getElHovered:function(){return this.elHovered||{}},getElSelected:function(){return this.elSelected||{}},onOut:function(){var e=this;this.currentDoc=null,this.em.setHovered(0),this.canvas.getFrames().forEach(function(t){var n=t.view.getToolsEl();e.toggleToolsEl(0,0,{el:n})})},toggleToolsEl:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.el||this.canvas.getToolsEl(t);return r.style.opacity=e?1:0,r},showElementOffset:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};o&&this.editor.runCommand("show-offset",{el:e,elPos:t,view:n.view,force:1,top:0,left:0})},hideElementOffset:function(e){this.editor.stopCommand("show-offset",{view:e})},showFixedElementOffset:function(e,t){this.editor.runCommand("show-offset",{el:e,elPos:t,state:"Fixed"})},hideFixedElementOffset:function(e,t){this.editor&&this.editor.stopCommand("show-offset",{state:"Fixed"})},hideHighlighter:function(e){this.canvas.getHighlighter(e).style.opacity=0},onClick:function(e){e.stopPropagation(),e.preventDefault();var t=this.em;if(t.get("_cmpDrag"))return t.set("_cmpDrag");var n=m(e.target),r=n.data("model");if(!r)for(var i=n.parent();!r&&i.length>0;)r=i.data("model"),i=i.parent();if(r)if(r.get("selectable"))this.select(r,e);else{for(var o=r.parent();o&&!o.get("selectable");)o=o.parent();this.select(o,e)}},select:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e){var n=t.ctrlKey||t.metaKey,r=t.shiftKey,i=this.editor,o=this.em,s=i.getConfig("multipleSelection");if(n&&s)i.selectToggle(e);else if(r&&s){o.clearSelection(i.Canvas.getWindow());var a,l,c=e.collection,u=c.indexOf(e);i.getSelectedAll();if(i.getSelectedAll().forEach(function(e){var t=e.collection,n=t.indexOf(e);t===c&&(n<u?a=Object(h.isUndefined)(a)?n:Math.max(a,n):n>u&&(l=Object(h.isUndefined)(l)?n:Math.min(l,n)))}),!Object(h.isUndefined)(a))for(;a!==u;)i.selectAdd(c.at(a)),a++;if(!Object(h.isUndefined)(l))for(;l!==u;)i.selectAdd(c.at(l)),l--;i.selectAdd(e)}else i.select(e,{scroll:{}});this.initResize(e)}},updateBadge:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=m(e).data("model");if(r&&r.get("badgable")){var i=this.getBadge(n);if(!n.posOnly){var o=this.canvas.getConfig(),s=r.getIcon(),a=o.pStylePrefix||"",l="".concat(a,"badge"),c=o.customBadgeLabel,u="".concat(s?'<div class="'.concat(l,'__icon">').concat(s,"</div>"):"",'\n <div class="').concat(l,'__name">').concat(r.getName(),"</div>");i.innerHTML=c?c(r):u}var d="px",h=i.style;h.display="block";var f=i?i.offsetHeight:0,p=0-f,g=n.topOff-f<0?-n.topOff:p,v=n.leftOff<0?-n.leftOff:0;h.top=g+d,h.left=v+d}},showHighlighter:function(e){this.canvas.getHighlighter(e).style.opacity=""},initResize:function(e){var t,n=this.em,r=this.canvas,s=n?n.get("Editor"):"",l=n?n.get("Config"):"",c=l.stylePrefix||"",u="".concat(c,"resizing"),d=!Object(h.isElement)(e)&&Object(f.isTaggableNode)(e)?e:n.getSelected(),p=d.get("resizable"),g=Object(h.isElement)(e)?e:d.getEl(),m={},v=function(e,t,n){var r=n.docs;r&&r.forEach(function(t){var n=t.body,r=n.className||"";n.className=("add"==e?"".concat(r," ").concat(u):r.replace(u,"")).trim()})};s&&p?(m={onStart:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=i.el,a=i.config,l=i.resizer,c=a.keyHeight,u=a.keyWidth,h=a.currentUnit,p=a.keepAutoHeight,g=a.keepAutoWidth;v("add",e,i),t=n.get("StyleManager").getModelToStyle(d),r.toggleFramesEvents();var m=getComputedStyle(s),b=t.getStyle(),y=b[u];a.autoWidth=g&&"auto"===y,isNaN(parseFloat(y))&&(y=m[u]);var w=b[c];a.autoHeight=p&&"auto"===w,isNaN(parseFloat(w))&&(w=m[c]),l.startDim.w=parseFloat(y),l.startDim.h=parseFloat(w),o=0,h&&(a.unitHeight=Object(f.getUnitFromValue)(w),a.unitWidth=Object(f.getUnitFromValue)(y))},onMove:function(){s.trigger("component:resize")},onEnd:function(e,t){v("remove",e,t),s.trigger("component:resize"),r.toggleFramesEvents(1),o=1},updateTarget:function(e,o){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(t){var a=s.store,l=s.selectedHandler,c=s.config,u=c.keyHeight,d=c.keyWidth,h=c.autoHeight,f=c.autoWidth,p=c.unitWidth,g=c.unitHeight,m=["tc","bc"].indexOf(l)>=0,v=["cl","cr"].indexOf(l)>=0,b={},y=a?"":1;if(!m){var w=r.getBody().offsetWidth,x=o.w<w?o.w:w;b[d]=f?"auto":"".concat(x).concat(p)}v||(b[u]=h?"auto":"".concat(o.h).concat(g)),t.addStyle(i({},b,{en:y}),{avoidStore:!a});var C="update:component:style",j="".concat(C,":").concat(u," ").concat(C,":").concat(d);n&&n.trigger(j,null,null,{noEmit:1})}}},"object"==a()(p)&&(m=i({},m,{},p)),this.resizer=s.runCommand("resize",{el:g,options:m,force:1})):(s.stopCommand("resize"),this.resizer=null)},updateToolbar:function(e){var t=this.config.em,n=e==t?t.getSelected():e,r=this.canvas.getToolbarEl(),i=r.style;if(!n)return void(i.opacity=0);var o=n.get("toolbar"),s=t.get("Config").showToolbar;if(s&&o&&o.length){if(i.opacity="",i.display="",!this.toolbar){r.innerHTML="",this.toolbar=new g["default"](o);var a=new p["default"]({collection:this.toolbar,editor:this.editor,em:t});r.appendChild(a.render().el)}this.toolbar.reset(o),i.top="-100px",i.left=0}else i.display="none"},updateToolbarPos:function(e){var t="px",n=this.canvas.getToolbarEl(),r=n.style;r.top="".concat(e.top).concat(t),r.left="".concat(e.left).concat(t),r.opacity=""},getCanvasPosition:function(){return this.canvas.getCanvasView().getPosition()},getBadge:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.canvas.getBadgeEl(e.view)},onFrameScroll:function(){this.updateTools()},updateTools:function(){this.updateToolsLocal(),this.updateGlobalPos()},isCompSelected:function(e){return e&&"selected"===e.get("status")},updateToolsLocal:function(e){var t=e||this.getElHovered(),n=t.el,r=t.pos,o=t.view,s=t.component;if(!n)return void(this.lastHovered=0);var a=s.get("hoverable"),l=this.lastHovered!==n,c=l?{}:{posOnly:1};l&&a&&(this.lastHovered=n,this.showHighlighter(o),this.showElementOffset(n,r,{view:o})),this.isCompSelected(s)&&(this.hideHighlighter(o),this.hideElementOffset(o));var u="px",d=this.toggleToolsEl(1,o),h=d.style,f=this.canvas.canvasRectOffset(n,r),p=f.top,g=f.left;this.updateBadge(n,r,i({},c,{
|
||
view:o,topOff:p,leftOff:g})),h.top=p+u,h.left=g+u,h.width=r.width+u,h.height=r.height+u},updateToolsGlobal:function(){var e=this.getElSelected(),t=e.el,n=e.pos,r=e.component;if(!t)return this.toggleToolsEl(),void(this.lastSelected=0);var i=this.canvas,o=this.lastSelected!==t;o&&(this.lastSelected=t,this.updateToolbar(r));var s="px",a=this.toggleToolsEl(1),l=a.style,c=i.getTargetToElementFixed(t,i.getToolbarEl(),{pos:n}),u=c.canvasOffsetTop,d=c.canvasOffsetLeft;l.top=u+s,l.left=d+s,l.width=n.width+s,l.height=n.height+s,this.updateToolbarPos({top:c.top,left:c.left})},updateAttached:Object(h.debounce)(function(){this.updateToolsGlobal()}),getElementPos:function(e){return this.canvas.getCanvasView().getElementPos(e)},hideBadge:function(){this.getBadge().style.display="none"},cleanPrevious:function(e){e&&e.set({status:"",state:""})},getContentWindow:function(){return this.canvas.getWindow()},run:function(e){this.editor=e&&e.get("Editor"),this.enable()},stop:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.em,i=this.editor;this.stopSelectComponent(),!n.preserveSelected&&r.setSelected(null),this.onOut(),this.toggleToolsEl(),i&&i.stopCommand("resize")}}},"./src/commands/view/SelectPosition.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=i.a.$;t["default"]={startSelectPosition:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.isPointed=!1;var i=this.editorModel.get("Utils"),o=e.ownerDocument.body;i&&!this.sorter&&(this.sorter=new i.Sorter({container:o,placer:this.canvas.getPlacerEl(),containerSel:"*",itemSel:"*",pfx:this.ppfx,direction:"a",document:t,wmargin:1,nested:1,em:this.editorModel,canvasRelative:1,scale:function(){return n.em.getZoomDecimal()}})),r.onStart&&(this.sorter.onStart=r.onStart),e&&this.sorter.startSort(e,{container:o})},getOffsetDim:function(){var e=this.offset(this.canvas.getFrameEl()),t=this.offset(this.canvas.getElement()),n=e.top-t.top,r=e.left-t.left;return{top:n,left:r}},stopSelectPosition:function(){this.posTargetCollection=null,this.posIndex="after"==this.posMethod&&0!==this.cDim.length?this.posIndex+1:this.posIndex,this.sorter&&(this.sorter.moved=0,this.sorter.endMove()),this.cDim&&(this.posIsLastEl=0!==this.cDim.length&&"after"==this.posMethod&&this.posIndex==this.cDim.length,this.posTargetEl=0===this.cDim.length?o(this.outsideElem):!this.posIsLastEl&&this.cDim[this.posIndex]?o(this.cDim[this.posIndex][5]).parent():o(this.outsideElem),this.posTargetModel=this.posTargetEl.data("model"),this.posTargetCollection=this.posTargetEl.data("model-comp"))},enable:function(){this.startSelectPosition()},nearFloat:function(e,t,n){var r=e||0,i=t||"before",o=n.length,s=0!==o&&"after"==i&&r==o;return 0!==o&&(!s&&!n[r][4]||n[r-1]&&!n[r-1][4]||s&&!n[r-1][4])?1:0},run:function(){this.enable()},stop:function(){this.stopSelectPosition(),this.$wrapper.css("cursor",""),this.$wrapper.unbind()}}},"./src/commands/view/ShowOffset.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./node_modules/backbone/backbone.js"),l=n.n(a),c=n("./node_modules/underscore/underscore.js"),u=(n.n(c),n("./src/utils/mixins.js")),d=l.a.$;t["default"]={getOffsetMethod:function(e){var t=e||"";return"get"+t+"OffsetViewerEl"},run:function(e,t,n){var r=n||{},o=r.state||"",s=e.getConfig(),a=this.em.getZoomDecimal(),l=r.el||"";if(!s.showOffsets||Object(u.isTextNode)(l)||!s.showOffsetsSelected&&"Fixed"==o)return void e.stopCommand(this.id,n);var h=e.Canvas,f=i({},r.elPos||h.getElementPos(l));Object(c.isUndefined)(r.top)||(f.top=r.top),Object(c.isUndefined)(r.left)||(f.left=r.left);var p=window.getComputedStyle(l),g=this.ppfx,m=o+"State",v=this.getOffsetMethod(o),b=h[v](n.view);b.style.opacity="";var y=this["marginT"+o],w=this["marginB"+o],x=this["marginL"+o],C=this["marginR"+o],j=this["padT"+o],O=this["padB"+o],k=this["padL"+o],S=this["padR"+o];if(b.childNodes.length&&(this[m]="1",y=b.querySelector("[data-offset-m-t]"),w=b.querySelector("[data-offset-m-b]"),x=b.querySelector("[data-offset-m-l]"),C=b.querySelector("[data-offset-m-r]"),j=b.querySelector("[data-offset-p-t]"),O=b.querySelector("[data-offset-p-b]"),k=b.querySelector("[data-offset-p-l]"),S=b.querySelector("[data-offset-p-r]")),!this[m]){var T=o.toLowerCase(),P=T+"margin-v",E=T+"padding-v",_=d('<div class="'.concat(g,'marginName">')).get(0),D=d('<div class="'.concat(g,'paddingName">')).get(0),M=g+P+"-el",A=g+E+"-el",L="".concat(M," ").concat(g+P),N="".concat(A," ").concat(g+E);y=d('<div class="'.concat(L,'-top"></div>')).get(0),w=d('<div class="'.concat(L,'-bottom"></div>')).get(0),x=d('<div class="'.concat(L,'-left"></div>')).get(0),C=d('<div class="'.concat(L,'-right"></div>')).get(0),j=d('<div class="'.concat(N,'-top"></div>')).get(0),O=d('<div class="'.concat(N,'-bottom"></div>')).get(0),k=d('<div class="'.concat(N,'-left"></div>')).get(0),S=d('<div class="'.concat(N,'-right"></div>')).get(0),this["marginT"+o]=y,this["marginB"+o]=w,this["marginL"+o]=x,this["marginR"+o]=C,this["padT"+o]=j,this["padB"+o]=O,this["padL"+o]=k,this["padR"+o]=S,_.appendChild(y),_.appendChild(w),_.appendChild(x),_.appendChild(C),D.appendChild(j),D.appendChild(O),D.appendChild(k),D.appendChild(S),b.appendChild(_),b.appendChild(D),this[m]="1"}var V="px",I=parseFloat(p.marginLeft.replace(V,""))*a,F=parseFloat(p.marginRight.replace(V,""))*a,R=parseFloat(p.marginTop.replace(V,""))*a,H=parseFloat(p.marginBottom.replace(V,""))*a,z=y.style,B=w.style,$=x.style,W=C.style,U=j.style,q=O.style,G=k.style,K=S.style,Y=parseFloat(f.left),X=parseFloat(p.width)*a+V;z.height=R+V,z.width=X,z.top=f.top-R+V,z.left=Y+V,B.height=H+V,B.width=X,B.top=f.top+f.height+V,B.left=Y+V;var J=f.height+R+H+V,Z=f.top-R+V;$.height=J,$.width=I+V,$.top=Z,$.left=Y-I+V,W.height=J,W.width=F+V,W.top=Z,W.left=Y+f.width+V;var Q=parseFloat(p.paddingTop)*a;U.height=Q+V;var ee=parseFloat(p.paddingBottom)*a;q.height=ee+V;var te=f.height-ee-Q+V,ne=f.top+Q+V;G.height=te,G.width=parseFloat(p.paddingLeft)*a+V,G.top=ne;var re=parseFloat(p.paddingRight)*a;K.height=te,K.width=re+V,K.top=ne},stop:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n||{},i=r.state||"",o=this.getOffsetMethod(i),s=e.Canvas,a=s[o](n.view);a.style.opacity=0}}},"./src/commands/view/SwitchVisibility.js":function(e,t,n){"use strict";n.r(t),t["default"]={run:function(e){this.toggleVis(e)},stop:function(e){this.toggleVis(e,0)},toggleVis:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=n?"add":"remove";e.Canvas.getFrames().forEach(function(e){e.view.getBody().classList[r]("".concat(t.ppfx,"dashed"))})}}},"./src/css_composer/config/config.js":function(e,t,n){"use strict";n.r(t),t["default"]={stylePrefix:"css-",staticRules:"",rules:[]}},"./src/css_composer/index.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./node_modules/underscore/underscore.js"),l=(n.n(a),n("./src/css_composer/config/config.js")),c=n("./src/css_composer/model/CssRule.js"),u=n("./src/css_composer/model/CssRules.js"),d=n("./src/css_composer/view/CssRulesView.js"),h=n("./src/selector_manager/model/Selectors.js"),f=n("./src/selector_manager/model/Selector.js");t["default"]=function(){var e,t,n,r={};return{Selectors:h["default"],name:"CssComposer",getConfig:function(){return r},storageKey:function(){var e=[],t=r.stm&&r.stm.getConfig()||{};return t.storeCss&&e.push("css"),t.storeStyles&&e.push("styles"),e},init:function(i){r=i||{};for(var o in l["default"])o in r||(r[o]=l["default"][o]);var s=r.pStylePrefix;s&&(r.stylePrefix=s+r.stylePrefix);var a=r.em&&r.em.config.style||"";return r.rules=a||r.rules,e=r.em,t=new u["default"]([],r),n=new d["default"]({collection:t,config:r}),this},onLoad:function(){t.add(r.rules)},postLoad:function(e){var t=this,n="add remove",r=this.getAll(),i=e.get("UndoManager");i&&i.add(r),e.stopListening(r,n,this.handleChange),e.listenTo(r,n,this.handleChange),r.each(function(e){return t.handleChange(e,{avoidStore:1})})},handleChange:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r="change:style",i=e.get("UndoManager");i&&i.add(t);var o=e.handleUpdates.bind(e);e.stopListening(t,r,o),e.listenTo(t,r,o),!n.avoidStore&&o("","",n)},load:function(e){var n=e||"";!n&&r.stm&&(n=r.em.getCacheLoad());var i=n.styles||"";if(n.styles)try{i=JSON.parse(n.styles)}catch(o){}else n.css&&(i=r.em.get("Parser").parseCss(n.css));return Object(a.isArray)(i)?i.length&&t.reset(i):i&&t.reset(i),i},store:function(e){if(r.stm){var n={},i=this.storageKey();return i.indexOf("css")>=0&&(n.css=r.em.getCss()),i.indexOf("styles")>=0&&(n.styles=JSON.stringify(t)),e||r.stm.store(n),n}},add:function(e,n,o){var s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=n||"",l=o||"",u=i({},s),d=this.get(e,a,l,u);return d&&d.config&&!d.config.singleAtRule?d:(u.state=a,u.mediaText=l,u.selectors="",d=new c["default"](u,r),d.get("selectors").add(e),t.add(d),d)},get:function(e,n,r,i){var o=null;return t.each(function(t){o||t.compare(e,n,r,i)&&(o=t)}),o},getAll:function(){return t},clear:function(){return this.getAll().reset(),this},addCollection:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[],o=e instanceof Array?e:[e],s=0,a=o.length;s<a;s++){var l=o[s]||{};if(l.selectors){var c=r.em&&r.em.get("SelectorManager");c||console.warn("Selector Manager not found");for(var u=l.selectors,d=u instanceof Array?u:[u],h=[],f=0,p=d.length;f<p;f++){var g=c.add(d[f]);h.push(g)}var m=this.get(h,l.state,l.mediaText,l),v=this.add(h,l.state,l.mediaText,l),b=!m||!t.avoidUpdateStyle,y=l.style||{};if(b){var w=t.extend?i({},v.get("style"),{},y):y;v.set("style",w)}n.push(v)}}return n},setRule:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=r.atRuleType,o=r.atRuleParams,s=e.get("Parser").parserCss.checkNode({selectors:t,style:n})[0],a=s.state,l=s.selectorsAdd,c=e.get("SelectorManager"),u=c.add(s.selectors),d=this.add(u,a,o,{selectorsAdd:l,atRule:i});return d.setStyle(n,r),d},getRule:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.get("SelectorManager"),i=e.get("Parser").parserCss.checkNode({selectors:t})[0],o=r.get(i.selectors),s=i.state,a=i.selectorsAdd,l=n.atRuleType,c=n.atRuleParams;return o&&this.get(o,s,c,{selectorsAdd:a,atRule:l})},setIdRule:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=r.state||"",o=r.mediaText||e.getCurrentMedia(),s=e.get("SelectorManager"),a=s.add({name:t,type:f["default"].TYPE_ID}),l=this.add(a,i,o);return l.setStyle(n,r),l},getIdRule:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.state||"",i=n.mediaText||e.getCurrentMedia(),o=e.get("SelectorManager").get(t,f["default"].TYPE_ID);return o&&this.get(o,r,i)},setClassRule:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=r.state||"",o=r.mediaText||e.getCurrentMedia(),s=e.get("SelectorManager"),a=s.add({name:t,type:f["default"].TYPE_CLASS}),l=this.add(a,i,o);return l.setStyle(n,r),l},getClassRule:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.state||"",i=n.mediaText||e.getCurrentMedia(),o=e.get("SelectorManager").get(t,f["default"].TYPE_CLASS);return o&&this.get(o,r,i)},render:function(){return n.render().el}}}},"./src/css_composer/model/CssRule.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/underscore/underscore.js"),i=(n.n(r),n("./node_modules/backbone/backbone.js")),o=n.n(i),s=n("./src/domain_abstract/model/Styleable.js"),a=n("./src/selector_manager/model/Selectors.js"),l=window,c=l.CSS;t["default"]=o.a.Model.extend(s["default"]).extend({defaults:{selectors:{},selectorsAdd:"",style:{},mediaText:"",state:"",stylable:!0,atRuleType:"",singleAtRule:0,important:0},initialize:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.config=e||{};var n=t.em,r=this.config.selectors||[];if(this.em=n,n){var i=n.get("SelectorManager"),o=[];r.forEach(function(e){o.push(i.add(e))}),r=o}this.set("selectors",new a["default"](r))},getAtRule:function(){var e=this.get("atRuleType"),t=this.get("mediaText"),n=e?"@".concat(e):t?"@media":"";return n+(t&&n?" ".concat(t):"")},selectorsToString:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=[],n=this.em,r=this.get("state"),i=this.get("wrapper"),o=this.get("selectorsAdd"),s=i&&n&&n.getConfig("wrapperIsBody"),a={escape:function(e){return c&&c.escape?c.escape(e):e}},l=s?"body":this.get("selectors").getFullString(0,a),u=r&&!e.skipState?":".concat(r):"";return l&&t.push("".concat(l).concat(u)),o&&!e.skipAdd&&t.push(o),t.join(", ")},getDeclaration:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t="",n=this.selectorsToString(),r=this.styleToString(e),i=this.get("singleAtRule");return(n||i)&&r&&(t=i?r:"".concat(n,"{").concat(r,"}")),t},toCSS:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t="",n=this.getAtRule(),r=this.getDeclaration(e);return r&&(t=r),n&&t&&(t="".concat(n,"{").concat(t,"}")),t},toJSON:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var i=o.a.Model.prototype.toJSON.apply(this,t);if(this.em.getConfig("avoidDefaults")){var s=this.defaults;Object(r.forEach)(s,function(e,t){i[t]===e&&delete i[t]}),Object(r.isEmpty)(i.selectors)&&delete i.selectors,Object(r.isEmpty)(i.style)&&delete i.style}return i},compare:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=t||"",s=n||"",a=i.selectorsAdd||"",l=i.atRuleType||"";e instanceof Array||e.models||(e=[e]);var c=Object(r.map)(e.models||e,function(e){return e.get("name")}),u=Object(r.map)(this.get("selectors").models,function(e){return e.get("name")}),d=!1;if(c.length!==u.length)return d;for(var h=0;h<c.length;h++){for(var f=0,p=0;p<u.length;p++)c[h]===u[p]&&(f=1);if(0===f)return d}return this.get("state")===o&&this.get("mediaText")===s&&this.get("selectorsAdd")===a&&this.get("atRuleType")===l||d}})},"./src/css_composer/model/CssRules.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=n("./src/css_composer/model/CssRule.js");t["default"]=i.a.Collection.extend({initialize:function(e,t){t&&t.em&&(this.editor=t.em),this.model=function(e,n){var r;return!n.em&&t&&t.em&&(n.em=t.em),r=new o["default"](e,n)}},add:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=this.editor.get("Parser").parseCss(e)),t.em=this.editor,i.a.Collection.prototype.add.apply(this,[e,t])}})},"./src/css_composer/view/CssGroupRuleView.js":function(e,t,n){"use strict";n.r(t);var r=n("./src/css_composer/view/CssRuleView.js");t["default"]=r["default"].extend({_createElement:function(e){return document.createTextNode("")},render:function(){var e=this.model,t=e.get("important");return this.el.textContent=e.getDeclaration({important:t}),this}})},"./src/css_composer/view/CssRuleView.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r);t["default"]=i.a.View.extend({tagName:"style",initialize:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.config=e.config||{};var t=this.model,n="change:style change:state change:mediaText";this.listenTo(t,n,this.render),this.listenTo(t,"destroy remove",this.remove),this.listenTo(t.get("selectors"),"change",this.render)},render:function(){var e=this.model,t=e.get("important");return this.el.innerHTML=this.model.toCSS({important:t}),this}})},"./src/css_composer/view/CssRulesView.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=n("./src/css_composer/view/CssRuleView.js"),s=n("./src/css_composer/view/CssGroupRuleView.js"),a=i.a.$,l=function(e,t){return"".concat(e).concat(t?"-".concat(parseFloat(t)):"")};t["default"]=i.a.View.extend({initialize:function(e){var t=e.config||{};this.atRules={},this.config=t,this.em=t.em,this.pfx=t.stylePrefix||"",this.className=this.pfx+"rules";var n=this.collection;this.listenTo(n,"add",this.addTo),this.listenTo(n,"reset",this.render)},addTo:function(e){this.addToCollection(e)},addToCollection:function(e,t){if(this.renderStarted){var n,r,i=t||null,a=this.config,c={model:e,config:a};if("keyframes"===e.get("atRuleType")){var u=e.getAtRule(),d=this.atRules[u];if(!d){var h=document.createElement("style");d=document.createTextNode(""),h.appendChild(document.createTextNode("".concat(u,"{"))),h.appendChild(d),h.appendChild(document.createTextNode("}")),this.atRules[u]=d,n=h}r=new s["default"](c),d.appendData(r.render().el.textContent)}else r=new o["default"](c),n=r.render().el;var f=this.className,p=e.get("mediaText"),g=l(f),m=g;if(p&&(m=l(f,this.getMediaWidth(p))),n){var v,b=i||this.el;try{v=b.querySelector("#".concat(m))}catch(y){}v||(v=b.querySelector("#".concat(g))),v.appendChild(n)}return n}},getMediaWidth:function(e){return e&&e.replace("(".concat(this.em.getConfig("mediaCondition"),": "),"").replace(")","")},render:function(){var e=this;this.renderStarted=1,this.atRules={};var t=this.em,n=this.$el,r=this.className,i=this.collection,o=document.createDocumentFragment();n.empty();var s=t.get("DeviceManager").getAll().pluck("priority");return s.every(function(e){return e})&&s.unshift(0),s.forEach(function(e){return a('<div id="'.concat(l(r,e),'"></div>')).appendTo(o)}),i.each(function(t){return e.addToCollection(t,o)}),n.append(o),n.attr("class",r),this}})},"./src/device_manager/config/config.js":function(e,t,n){"use strict";n.r(t),t["default"]={devices:[]}},"./src/device_manager/index.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./src/device_manager/config/config.js"),l=n("./src/device_manager/model/Devices.js"),c=n("./src/device_manager/view/DevicesView.js");t["default"]=function(){var e,t,n={};return{name:"DeviceManager",init:function(r){var i=this;n=r||{};for(var o in a["default"])o in n||(n[o]=a["default"][o]);return e=new l["default"],(n.devices||[]).forEach(function(e){return i.add(e.id||e.name,e.width,e)}),t=new c["default"]({collection:e,config:n}),this},add:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=i({},r,{id:t,name:r.name||t,width:n});return e.add(o)},get:function(t){return e.get(t)},getAll:function(){return e},render:function(){return t.render().el}}}},"./src/device_manager/model/Device.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r);t["default"]=i.a.Model.extend({idAttribute:"name",defaults:{name:"",width:null,height:"",widthMedia:null,priority:null},initialize:function(){var e=this;null===this.get("widthMedia")&&this.set("widthMedia",this.get("width")),null===this.get("width")&&this.set("width",this.get("widthMedia")),!this.get("priority")&&this.set("priority",parseFloat(this.get("widthMedia"))||0);var t=["width","height","widthMedia"];t.forEach(function(t){return e.checkUnit(t)})},checkUnit:function(e){var t=this.get(e)||"",n=(parseFloat(t)||0).toString()===t.toString();n&&this.set(e,"".concat(t,"px"))}})},"./src/device_manager/model/Devices.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=n("./src/device_manager/model/Device.js");t["default"]=i.a.Collection.extend({model:o["default"],comparator:function(e,t){var n=Number.MAX_VALUE;return(t.get("priority")||n)-(e.get("priority")||n)},getSorted:function(){return this.sort()}})},"./src/device_manager/view/DevicesView.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/underscore/underscore.js"),i=(n.n(r),n("./node_modules/backbone/backbone.js")),o=n.n(i);t["default"]=o.a.View.extend({template:Object(r.template)('\n <div class="<%= ppfx %>device-label"><%= deviceLabel %></div>\n <div class="<%= ppfx %>field <%= ppfx %>select">\n <span id="<%= ppfx %>input-holder">\n <select class="<%= ppfx %>devices"></select>\n </span>\n <div class="<%= ppfx %>sel-arrow">\n <div class="<%= ppfx %>d-s-arrow"></div>\n </div>\n </div>\n <button style="display:none" class="<%= ppfx %>add-trasp">+</button>'),events:{change:"updateDevice"},initialize:function(e){this.config=e.config||{},this.em=this.config.em,this.ppfx=this.config.pStylePrefix||"",this.events["click ."+this.ppfx+"add-trasp"]=this.startAdd,this.listenTo(this.em,"change:device",this.updateSelect),this.delegateEvents()},startAdd:function(){},updateDevice:function(){var e=this.em;if(e){var t=this.devicesEl,n=t?t.val():"";e.set("device",n)}},updateSelect:function(){var e=this.em,t=this.devicesEl;if(e&&e.getDeviceModel&&t){var n=e.getDeviceModel(),r=n?n.get("name"):"";t.val(r)}},getOptions:function(){var e=this.collection,t=this.em,n="";return e.each(function(e){var r=e.attributes,i=r.name,o=r.id,s=t&&t.t&&t.t("deviceManager.devices.".concat(o))||i;n+='<option value="'.concat(i,'">').concat(s,"</option>")}),n},render:function(){var e=this.em,t=this.ppfx,n=this.$el,r=this.el;return n.html(this.template({ppfx:t,deviceLabel:e&&e.t&&e.t("deviceManager.device")})),this.devicesEl=n.find(".".concat(t,"devices")),this.devicesEl.append(this.getOptions()),r.className="".concat(t,"devices-c"),this}})},"./src/dom_components/config/config.js":function(e,t,n){"use strict";n.r(t),t["default"]={stylePrefix:"comp-",wrapperId:"wrapper",wrapperName:"Body",wrapper:{removable:!1,copyable:!1,draggable:!1,components:[],traits:[],stylable:["background","background-color","background-image","background-repeat","background-attachment","background-position","background-size"]},components:[],draggableComponents:1,storeWrapper:0,processor:0,voidElements:["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"]}},"./src/dom_components/index.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){l()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/typeof.js"),s=n.n(o),a=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),l=n.n(a),c=n("./node_modules/backbone/backbone.js"),u=n.n(c),d=n("./node_modules/underscore/underscore.js"),h=(n.n(d),n("./src/dom_components/config/config.js")),f=n("./src/dom_components/model/Component.js"),p=n("./src/dom_components/model/Components.js"),g=n("./src/dom_components/view/ComponentView.js"),m=n("./src/dom_components/view/ComponentsView.js"),v=n("./src/dom_components/model/ComponentTableCell.js"),b=n("./src/dom_components/view/ComponentTableCellView.js"),y=n("./src/dom_components/model/ComponentTableRow.js"),w=n("./src/dom_components/view/ComponentTableRowView.js"),x=n("./src/dom_components/model/ComponentTable.js"),C=n("./src/dom_components/view/ComponentTableView.js"),j=n("./src/dom_components/model/ComponentTableHead.js"),O=n("./src/dom_components/view/ComponentTableHeadView.js"),k=n("./src/dom_components/model/ComponentTableBody.js"),S=n("./src/dom_components/view/ComponentTableBodyView.js"),T=n("./src/dom_components/model/ComponentTableFoot.js"),P=n("./src/dom_components/view/ComponentTableFootView.js"),E=n("./src/dom_components/model/ComponentMap.js"),_=n("./src/dom_components/view/ComponentMapView.js"),D=n("./src/dom_components/model/ComponentLink.js"),M=n("./src/dom_components/view/ComponentLinkView.js"),A=n("./src/dom_components/model/ComponentLabel.js"),L=n("./src/dom_components/view/ComponentLabelView.js"),N=n("./src/dom_components/model/ComponentVideo.js"),V=n("./src/dom_components/view/ComponentVideoView.js"),I=n("./src/dom_components/model/ComponentImage.js"),F=n("./src/dom_components/view/ComponentImageView.js"),R=n("./src/dom_components/model/ComponentScript.js"),H=n("./src/dom_components/view/ComponentScriptView.js"),z=n("./src/dom_components/model/ComponentSvg.js"),B=n("./src/dom_components/model/ComponentSvgIn.js"),$=n("./src/dom_components/view/ComponentSvgView.js"),W=n("./src/dom_components/model/ComponentComment.js"),U=n("./src/dom_components/view/ComponentCommentView.js"),q=n("./src/dom_components/model/ComponentTextNode.js"),G=n("./src/dom_components/view/ComponentTextNodeView.js"),K=n("./src/dom_components/model/ComponentText.js"),Y=n("./src/dom_components/view/ComponentTextView.js"),X=n("./src/dom_components/model/ComponentWrapper.js");t["default"]=function(){var e,t,n,r={},o={},a=[{id:"cell",model:v["default"],view:b["default"]},{id:"row",model:y["default"],view:w["default"]},{id:"table",model:x["default"],view:C["default"]},{id:"thead",model:j["default"],view:O["default"]},{id:"tbody",model:k["default"],view:S["default"]},{id:"tfoot",model:T["default"],view:P["default"]},{id:"map",model:E["default"],view:_["default"]},{id:"link",model:D["default"],view:M["default"]},{id:"label",model:A["default"],view:L["default"]},{id:"video",model:N["default"],view:V["default"]},{id:"image",model:I["default"],view:F["default"]},{id:"script",model:R["default"],view:H["default"]},{id:"svg-in",model:B["default"],view:$["default"]},{id:"svg",model:z["default"],view:$["default"]},{id:"comment",model:W["default"],view:U["default"]},{id:"textnode",model:q["default"],view:G["default"]},{id:"text",model:K["default"],view:Y["default"]},{id:"wrapper",model:X["default"],view:g["default"]},{id:"default",model:f["default"],view:g["default"]}];return{Component:f["default"],Components:p["default"],ComponentsView:m["default"],componentTypes:a,componentsById:o,name:"DomComponents",getConfig:function(){return r},storageKey:function(){var e=[],t=r.stm&&r.stm.getConfig()||{};return t.storeHtml&&e.push("html"),t.storeComponents&&e.push("components"),e},init:function(o){var s=this;r=o||{},e=r.em,this.em=e,e&&(r.components=e.config.components||r.components);for(var l in h["default"])l in r||(r[l]=h["default"][l]);var c=r.pStylePrefix;if(c&&(r.stylePrefix=c+r.stylePrefix),e){r.modal=e.get("Modal")||"",r.am=e.get("AssetManager")||"",e.get("Parser").compTypes=a,e.on("change:componentHovered",this.componentHovered,this);var u=e.get("selected");e.listenTo(u,"add",function(e,t,n){return s.selectAdd(e,n)}),e.listenTo(u,"remove",function(e,t,n){return s.selectRemove(e,n)})}var d=r.components,p=i({},r.wrapper);return p["custom-name"]=r.wrapperName,p.wrapper=1,p.type="wrapper",d&&d.constructor===Object&&d.wrapper&&(p=i({},d),d=d.components||[],p.components=[],e&&(e.config.components=d,r.components=d)),t=new f["default"](p,{em:e,config:r,componentTypes:a,domc:this}),t.set({attributes:{id:"wrapper"}}),n=new g["default"]({model:t,config:r,componentTypes:a}),this},onLoad:function(){this.setComponents(r.components)},postLoad:function(e){this.handleChanges(this.getWrapper(),null,{avoidStore:1})},handleChanges:function l(t,n){var r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=t.components(),s=e.get("UndoManager"),a=e.handleUpdates.bind(e),l=this.handleChanges.bind(this),c=this.handleChangesColl.bind(this),u=this.handleRemoves.bind(this);s&&s.add(t),s&&o&&s.add(o);var d="change:style change:content change:attributes change:src";[[t,d,a],[t,"change:components",c],[o,"add",l],[o,"remove",u],[t.get("classes"),"add remove",a]].forEach(function(t){e.stopListening(t[0],t[1],t[2]),e.listenTo(t[0],t[1],t[2])}),!i.avoidStore&&a("","",i),o.each(function(e){return r.handleChanges(e,n,i)})},handleChangesColl:function(t,n){var r=e.get("UndoManager");if(r&&n instanceof u.a.Collection){var i=this.handleChanges.bind(this),o=this.handleRemoves.bind(this);r.add(n),[[n,"add",i],[n,"remove",o]].forEach(function(t){e.stopListening(t[0],t[1],t[2]),e.listenTo(t[0],t[1],t[2])})}},handleRemoves:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!r.avoidStore&&e.handleUpdates(t,n,r)},load:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.em,n="";!e&&r.stm&&(e=r.em.getCacheLoad());var i=e,o=i.components,s=i.html;if(o)if(Object(d.isObject)(o)||Object(d.isArray)(o))n=o;else try{n=JSON.parse(o)}catch(a){t&&t.logError(a)}else s&&(n=s);var l=n&&n.constructor===Object;return(n&&n.length||l)&&(this.clear(),l?this.getWrapper().set(n):this.getComponents().add(n)),n},store:function(e){if(r.stm){var t={},n=this.storageKey();if(n.indexOf("html")>=0&&(t.html=r.em.getHtml()),n.indexOf("components")>=0){var i=(this.em,r.storeWrapper),o=i?this.getWrapper():this.getComponents();t.components=JSON.stringify(o)}return e||r.stm.store(t),t}},getComponent:function(){return t},getWrapper:function(){return this.getComponent()},getComponents:function(){return this.getWrapper().get("components")},addComponent:function(e){return this.getComponents().add(e)},render:function(){return n.render().el},clear:function(){return this.getComponents().map(function(e){return e}).forEach(function(e){return e.remove()}),this},setComponents:function(e){this.clear().addComponent(e)},addType:function(e,t){var n=this.em,r=t.model,o=void 0===r?{}:r,l=t.view,c=void 0===l?{}:l,u=t.isComponent,h=t.extend,f=t.extendView,p=t.extendFn,g=void 0===p?[]:p,m=t.extendFnView,v=void 0===m?[]:m,b=this.getType(e),y=this.getType(h),w=this.getType(f),x=y?y:b?b:this.getType("default"),C=x.model,j=w?w.view:x.view,O=function(e,t,n){return e.reduce(function(e,r){var i=t[r],o=n.prototype[r];return i&&o&&(e[r]=function(){o.bind(this).apply(void 0,arguments),i.bind(this).apply(void 0,arguments)}),e},{})};"object"===s()(o)&&(t.model=C.extend(i({},o,{},O(g,o,C),{defaults:i({},C.prototype.defaults,{},Object(d.result)(o,"defaults")||{})}),{isComponent:!b||y||u?u||function(){return 0}:C.isComponent})),"object"===s()(c)&&(t.view=j.extend(i({},c,{},O(v,c,j)))),b?(b.model=t.model,b.view=t.view):(t.id=e,a.unshift(t));var k="component:type:".concat(b?"update":"add");
|
||
return n&&n.trigger(k,b||t),this},getType:function(e){for(var t=a,n=0;n<t.length;n++){var r=t[n].id;if(r==e)return t[n]}},removeType:function(e){var t=a,n=this.getType(e);if(n){var r=t.indexOf(n);return t.splice(r,1),n}},getTypes:function(){return a},selectAdd:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e&&(e.set({status:"selected"}),["component:selected","component:toggled"].forEach(function(r){return t.em.trigger(r,e,n)}))},selectRemove:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e){this.em;e.set({status:"",state:""}),["component:deselected","component:toggled"].forEach(function(r){return t.em.trigger(r,e,n)})}},componentHovered:function(){var e=r.em,t=e.get("componentHovered"),n=e.previous("componentHovered"),i="hovered";n&&n.get("status")==i&&n.set({status:"",state:""}),t&&Object(d.isEmpty)(t.get("status"))&&t.set("status",i)}}}},"./src/dom_components/model/Component.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){l()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t),n.d(t,"eventDrag",function(){return w});var o=n("./node_modules/@babel/runtime/helpers/typeof.js"),s=n.n(o),a=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),l=n.n(a),c=n("./node_modules/underscore/underscore.js"),u=(n.n(c),n("./src/utils/mixins.js")),d=n("./src/domain_abstract/model/Styleable.js"),h=n("./node_modules/backbone/backbone.js"),f=n.n(h),p=n("./src/dom_components/model/Components.js"),g=n("./src/selector_manager/model/Selector.js"),m=n("./src/selector_manager/model/Selectors.js"),v=n("./src/trait_manager/model/Traits.js"),b=function(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&")},y=function(e){return e&&e.getConfig("avoidInlineStyle")},w="component:drag",x=f.a.Model.extend(d["default"]).extend({defaults:{tagName:"div",type:"",name:"",removable:!0,draggable:!0,droppable:!0,badgable:!0,stylable:!0,"stylable-require":"","style-signature":"",unstylable:"",highlightable:!0,copyable:!0,resizable:!1,editable:!1,layerable:!0,selectable:!0,hoverable:!0,"void":!1,state:"",status:"",content:"",icon:"",style:"",classes:"",script:"","script-export":"",attributes:"",traits:["id","title"],propagate:"",dmode:"",toolbar:null},init:function(){},updated:function(e,t,n){},removed:function(){},initialize:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.em,o=this.parent(),s=o&&o.attributes;if(s&&s.propagate){var a={},l=s.propagate;l.forEach(function(e){return a[e]=o.get(e)}),a.propagate=l,a=i({},a,{},t),this.set(a)}var u=this.get("propagate");u&&this.set("propagate",Object(c.isArray)(u)?u:[u]),n&&n.config&&n.config.voidElements.indexOf(this.get("tagName"))>=0&&this.set("void",!0),n.em=r,this.opt=n,this.em=r,this.frame=n.frame,this.config=n.config||{},this.set("attributes",i({},this.defaults.attributes||{},{},this.get("attributes")||{})),this.ccid=x.createId(this),this.initClasses(),this.initTraits(),this.initComponents(),this.initToolbar(),this.listenTo(this,"change:script",this.scriptUpdated),this.listenTo(this,"change:tagName",this.tagUpdated),this.listenTo(this,"change:attributes",this.attrUpdated),this.listenTo(this,"change:attributes:id",this._idUpdated),this.set("status",""),this.views=[],["classes","traits","components"].forEach(function(t){var n="add remove ".concat("components"!==t?"change":"");e.listenTo(e.get(t),n.trim(),function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return e.emitUpdate.apply(e,[t].concat(r))})}),n.temporary||(this.init(),r&&r.trigger("component:create",this))},is:function(e){return!(this.get("type")!=e)},props:function(){return this.attributes},index:function(){var e=this.collection;return e&&e.indexOf(this)},setDragMode:function(e){return this.set("dmode",e)},find:function(e){var t=[],n=this.view.$el.find(e);return n.each(function(e){var r=n.eq(e),i=r.data("model");i&&t.push(i)}),t},findType:function(e){var t=[],n=function r(n){return n.forEach(function(n){n.is(e)&&t.push(n),r(n.components())})};return n(this.components()),t},closest:function(e){var t=this.view.$el.closest(e);return t.length&&t.data("model")},tagUpdated:function(){var e=this.collection,t=e.indexOf(this);e.remove(this),e.add(this,{at:t})},replaceWith:function(e){var t=this.collection,n=t.indexOf(this);return t.remove(this),t.add(e,{at:n})},attrUpdated:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=this.get("attributes"),s=o["class"];s&&this.setClass(s),delete o["class"];var a=o.style;a&&this.setStyle(a),delete o.style;var l=i({},this.previous("attributes")),d=Object(u.shallowDiff)(l,this.get("attributes"));Object(c.keys)(d).forEach(function(e){return n.trigger("change:attributes:".concat(e),n,d[e],r)})},setAttributes:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.set("attributes",i({},e),t),this},addAttributes:function(e){var t=i({},this.getAttributes(),{},e);return this.setAttributes(t),this},getStyle:function(){var e=this.em;if(e&&e.getConfig("avoidInlineStyle")){var t=e.get("state"),n=e.get("CssComposer"),r=n.getIdRule(this.getId(),{state:t});if(this.rule=r,r)return r.getStyle()}return d["default"].getStyle.call(this)},setStyle:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.em,o=this.opt;if(r&&r.getConfig("avoidInlineStyle")&&!o.temporary){var s=this.get("style")||{};t=Object(c.isString)(t)?this.parseStyle(t):t,t=i({},t,{},s);var a=r.get("state"),l=r.get("CssComposer"),h=this.getStyle();this.rule=l.setIdRule(this.getId(),t,i({},n,{state:a}));var f=Object(u.shallowDiff)(h,t);this.set("style",{},{silent:1}),Object(c.keys)(f).forEach(function(t){return e.trigger("change:style:".concat(t))})}else t=d["default"].setStyle.apply(this,arguments);return t},getAttributes:function(){var e=this.em,t=[],n=i({},this.get("attributes")),r=e&&e.get("SelectorManager"),o=this.getId();if(this.get("classes").forEach(function(e){return t.push(Object(c.isString)(e)?e:e.get("name"))}),t.length&&(n["class"]=t.join(" ")),!Object(c.has)(n,"id")){var s;y(e)?s=r&&r.get(o,r.Selector.TYPE_ID):Object(c.isEmpty)(this.getStyle())||(s=1),s&&(n.id=this.getId())}return n},addClass:function(e){var t=this.em.get("SelectorManager").addClass(e);return this.get("classes").add(t)},setClass:function(e){return this.get("classes").reset(),this.addClass(e)},removeClass:function(e){var t=[];e=Object(c.isArray)(e)?e:[e];var n=this.get("classes"),r=g["default"].TYPE_CLASS;return e.forEach(function(e){var i=e.split(" ");i.forEach(function(e){var i=n.where({name:e,type:r})[0];i&&t.push(n.remove(i))})}),t},getClasses:function(){var e=this.getAttributes(),t=e["class"];return t?t.split(" "):[]},initClasses:function(){var e="change:classes",t=[this,e,this.initClasses],n=this.get("classes")||[],r=Object(c.isString)(n)?n.split(" "):n;this.stopListening.apply(this,t);var i=this.normalizeClasses(r),o=new m["default"]([]);return this.set("classes",o),o.add(i),this.listenTo.apply(this,t),this},initComponents:function(){var e="change:components",t=[this,e,this.initComponents];this.stopListening.apply(this,t);var n=new p["default"](null,this.opt);n.parent=this;var r=this.get("components"),i=!this.opt.avoidChildren;return this.set("components",n),i&&n.add(Object(c.isFunction)(r)?r(this):r),this.listenTo.apply(this,t),this},initTraits:function(e){var t=this.em,n="change:traits",r=[this,n,this.initTraits];this.stopListening.apply(this,r),this.loadTraits();var o=i({},this.get("attributes")),s=this.get("traits");return s.each(function(e){if(!e.get("changeProp")){var t=e.get("name"),n=e.getInitValue();t&&n&&(o[t]=n)}}),s.length&&this.set("attributes",o),this.listenTo.apply(this,r),e&&t&&t.trigger("component:toggled"),this},append:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.components().add(e,t);return Object(c.isArray)(n)?n:[n]},components:function(e){var t=this.get("components");return Object(c.isUndefined)(e)?t:(t.reset(),e&&this.append(e))},parent:function(){var e=this.collection;return e&&e.parent},scriptUpdated:function(){this.set("scriptUpdated",1)},initToolbar:function(){var e=this.em,t=this,n=e&&e.getConfig("stylePrefix")||"";if(!t.get("toolbar")){var r=[];t.collection&&r.push({attributes:{"class":"fa fa-arrow-up"},command:function(e){return e.runCommand("core:component-exit",{force:1})}}),t.get("draggable")&&r.push({attributes:{"class":"fa fa-arrows ".concat(n,"no-touch-actions"),draggable:!0},command:"tlb-move"}),t.get("copyable")&&r.push({attributes:{"class":"fa fa-clone"},command:"tlb-clone"}),t.get("removable")&&r.push({attributes:{"class":"fa fa-trash-o"},command:"tlb-delete"}),t.set("toolbar",r)}},loadTraits:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e=e||this.get("traits"),e=Object(c.isFunction)(e)?e(this):e,!(e instanceof v["default"])){var n=new v["default"]([],this.opt);n.setTarget(this),e.length&&(e.forEach(function(e){return e.attributes&&delete e.attributes.value}),n.add(e)),this.set("traits",n,t)}return this},getTrait:function(e){return this.get("traits").filter(function(t){return t.get("id")===e||t.get("name")===e})[0]},updateTrait:function(e,t){var n=this.em,r=this.getTrait(e);return r&&r.set(t),n&&n.trigger("component:toggled"),this},getTraitIndex:function(e){var t=this.getTrait(e);return t?this.get("traits").indexOf(t):t},removeTrait:function(e){var t=this,n=this.em,r=Object(c.isArray)(e)?e:[e],i=r.map(function(e){return t.getTrait(e)}),o=this.get("traits").remove(i);return n&&n.trigger("component:toggled"),o},addTrait:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.em,r=this.get("traits").add(e,t);return n&&n.trigger("component:toggled"),r},normalizeClasses:function(e){var t=[],n=this.em;if(n){var r=n.get("SelectorManager");if(r)return e.forEach(function(e){var n="";n="string"==typeof e?e:e.name;var i=r.add(n);t.push(i)}),t}},clone:function(){var e=this.em,t=this.getStyle(),n=i({},this.attributes),r=i({},this.opt);n.attributes=i({},n.attributes),delete n.attributes.id,n.components=[],n.classes=[],n.traits=[],this.get("components").each(function(e,t){n.components[t]=e.clone()}),this.get("traits").each(function(e,t){n.traits[t]=e.clone()}),this.get("classes").each(function(e,t){n.classes[t]=e.get("name")}),n.status="",n.view="",r.collection=null,e&&e.getConfig("avoidInlineStyle")&&!Object(c.isEmpty)(t)&&(n.style=t);var o=new this.constructor(n,r),s="component:clone";return e&&e.trigger(s,o),this.trigger(s,o),o},getName:function(){var e=this.em,t=this.attributes,n=t.type,r=t.tagName,i=this.get("name"),o="div"==r,s=o?"box":r,a=n||s,l=!n&&r&&!o&&r,c="domComponents.names.",d=i&&e&&e.t("".concat(c).concat(i)),h=l&&e&&e.t("".concat(c).concat(l)),f=e&&(e.t("".concat(c).concat(n))||e.t("".concat(c).concat(r)));return this.get("custom-name")||d||i||h||Object(u.capitalize)(l)||f||Object(u.capitalize)(a)},getIcon:function(){var e=this.get("icon");return e?e+" ":""},toHTML:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this,n=[],r=e.tag,i=r||t.get("tagName"),o=t.get("void"),s=e.attributes,a=this.getAttrToHTML();delete e.tag,s&&(Object(c.isFunction)(s)?a=s(t,a)||{}:Object(c.isObject)(s)&&(a=s));for(var l in a){var u=a[l],d=Object(c.isString)(u)?u.replace(/"/g,"""):u;Object(c.isUndefined)(d)||(Object(c.isBoolean)(d)?d&&n.push(l):n.push("".concat(l,'="').concat(d,'"')))}var h=n.length?" ".concat(n.join(" ")):"",f="<".concat(i).concat(h).concat(o?"/":"",">").concat(t.get("content"));return t.get("components").each(function(t){return f+=t.toHTML(e)}),!o&&(f+="</".concat(i,">")),f},getAttrToHTML:function(){var e=this.getAttributes();return delete e.style,e},toJSON:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=f.a.Model.prototype.toJSON.apply(this,t);if(r.attributes=this.getAttributes(),delete r.attributes["class"],delete r.toolbar,delete r.traits,this.em.getConfig("avoidDefaults")){var i=Object(c.result)(this,"defaults");Object(c.forEach)(i,function(e,t){["type","content"].indexOf(t)===-1&&r[t]===e&&delete r[t]}),Object(c.isEmpty)(r.type)&&delete r.type,Object(c.forEach)(["attributes","style"],function(e){Object(c.isEmpty)(i[e])&&Object(c.isEmpty)(r[e])&&delete r[e]}),Object(c.forEach)(["classes","components"],function(e){Object(c.isEmpty)(i[e])&&!r[e].length&&delete r[e]})}return r},getId:function(){var e=this.get("attributes")||{};return e.id||this.ccid||this.cid},setId:function(e,t){var n=i({},this.get("attributes"));return n.id=e,this.set("attributes",n,t),this},getEl:function(e){var t=this.getView(e);return t&&t.el},getView:function(e){var t=this.view,n=this.views;return e&&(t=n.filter(function(t){return t._getFrame()===e.view})[0]),t},getCurrentView:function(){var e=(this.em.get("currentFrame")||{}).model;return this.getView(e)},getScriptString:function(e){var t=this,n=e||this.get("script");if(!n)return n;if("function"==typeof n){var r=n.toString().trim();r=r.replace(/^function[\s\w]*\(\)\s?\{/,"").replace(/\}$/,""),n=r.trim()}var i=this.em.getConfig(),o=b(i.tagVarStart||"{[ "),a=b(i.tagVarEnd||" ]}"),l=new RegExp("".concat(o,"([\\w\\d-]*)").concat(a),"g");return n=n.replace(l,function(e,n){t.scriptUpdated();var r=t.attributes[n]||"";return Object(c.isArray)(r)||"object"==s()(r)?JSON.stringify(r):r})},emitUpdate:function(e){for(var t=this.em,n="component:update"+(e?":".concat(e):""),r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];e&&this.updated.apply(this,[e,e&&this.get(e),e&&this.previous(e)].concat(i)),this.trigger.apply(this,[n].concat(i)),t&&t.trigger.apply(t,[n,this].concat(i))},onAll:function(e){return Object(c.isFunction)(e)&&(e(this),this.components().forEach(function(t){return t.onAll(e)})),this},remove:function(){var e=this.collection;return e&&e.remove(this)},resetId:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},this.em),t=this.getId();if(t){var n=x.createId(this);this.setId(n);var r=e&&e.get("CssComposer").getIdRule(t),i=r&&r.get("selectors").at(0);return i&&i.set("name",n),this}},_getStyleRule:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.id,n=this.em,r=t||this.getId();return n&&n.get("CssComposer").getIdRule(r)},_getStyleSelector:function(e){var t=this._getStyleRule(e);return t&&t.get("selectors").at(0)},_idUpdated:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!n.idUpdate){var r=this.ccid,i=this.get("attributes")||{},o=i.id,s=(this.previous("attributes")||{}).id||r,a=x.getList(this);if(a[o])return this.setId(s,{idUpdate:1});delete a[s],a[o]=this,this.ccid=o;var l=this._getStyleSelector({id:s});l&&l.set({name:o,label:o})}}},{isComponent:function(e){return{tagName:e.tagName?e.tagName.toLowerCase():""}},createId:function(e){var t,n=x.getList(e),r=e.get("attributes"),i=r.id;return i?(t=x.getIncrementId(i,n),e.setId(t)):t=x.getNewId(n),n[t]=e,t},getNewId:function(e){for(var t=Object.keys(e).length,n=t.toString().length+2,r=(Math.random()+1.1).toString(36).slice(-n),i="i".concat(r);e[i];)i=x.getNewId(e);return i},getIncrementId:function(e,t){for(var n=1,r=e;t[r];)n++,r="".concat(e,"-").concat(n);return r},getList:function(e){var t=e.opt&&e.opt.domc;return t?t.componentsById:{}},checkId:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Object(c.isArray)(e)?e:[e];r.forEach(function(e){var r=e.attributes,i=void 0===r?{}:r,o=e.components,s=i.id;if(s&&n[s]){var a=x.getIncrementId(s,n);i.id=a,Object(c.isArray)(t)&&t.forEach(function(e){var t=e.selectors;t.forEach(function(e,n){e==="#".concat(s)&&(t[n]="#".concat(a))})})}o&&x.checkId(o,t,n)})}});t["default"]=x},"./src/dom_components/model/ComponentComment.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./src/dom_components/model/ComponentTextNode.js");t["default"]=a["default"].extend({defaults:i({},a["default"].prototype.defaults),toHTML:function(){return"<!--".concat(this.get("content"),"-->")}},{isComponent:function(e){if(8==e.nodeType)return{tagName:"NULL",type:"comment",content:e.textContent}}})},"./src/dom_components/model/ComponentImage.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./node_modules/underscore/underscore.js"),l=(n.n(a),n("./src/dom_components/model/Component.js")),c='xmlns="http://www.w3.org/2000/svg" width="100" viewBox="0 0 24 24" style="fill: rgba(0,0,0,0.15); transform: scale(0.75)"';t["default"]=l["default"].extend({defaults:i({},l["default"].prototype.defaults,{type:"image",tagName:"img","void":1,droppable:0,editable:1,highlightable:0,resizable:{ratioDefault:1},traits:["alt"],src:"<svg ".concat(c,'>\n <path d="M8.5 13.5l2.5 3 3.5-4.5 4.5 6H5m16 1V5a2 2 0 0 0-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2z"></path>\n </svg>'),fallback:"<svg ".concat(c,'>\n <path d="M2.28 3L1 4.27l2 2V19c0 1.1.9 2 2 2h12.73l2 2L21 21.72 2.28 3m2.55 0L21 19.17V5a2 2 0 0 0-2-2H4.83M8.5 13.5l2.5 3 1-1.25L14.73 18H5l3.5-4.5z"></path>\n </svg>'),file:""}),initialize:function(e,t){l["default"].prototype.initialize.apply(this,arguments);var n=this.get("attributes");n.src&&this.set("src",n.src)},initToolbar:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];l["default"].prototype.initToolbar.apply(this,t);var r=this.em;if(r){var i=r.get("Commands"),o="image-editor";if(i.has(o)){for(var s=!1,a=this.get("toolbar"),c=0;c<a.length;c++)if("image-editor"===a[c].command){s=!0;break}s||(a.push({attributes:{"class":"fa fa-pencil"},command:o}),this.set("toolbar",a))}}},getAttrToHTML:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=l["default"].prototype.getAttrToHTML.apply(this,t),i=this.getSrcResult();return i&&(r.src=i),r},getSrcResult:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.get(e.fallback?"fallback":"src")||"",n=t;return t&&"<svg"===t.substr(0,4)&&(n="data:image/svg+xml;base64,".concat(window.btoa(t))),n},isDefaultSrc:function(){return this.get("src")===Object(a.result)(this,"defaults").src},parseUri:function(e){var t=document.createElement("a");t.href=e;for(var n={},r=t.search.substring(1).split("&"),i=0;i<r.length;i++){var o=r[i].split("="),s=decodeURIComponent(o[0]);s&&(n[s]=decodeURIComponent(o[1]))}return{hostname:t.hostname,pathname:t.pathname,protocol:t.protocol,search:t.search,hash:t.hash,port:t.port,query:n}}},{isComponent:function(e){var t="";return"IMG"==e.tagName&&(t={type:"image"}),t}})},"./src/dom_components/model/ComponentLabel.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./src/dom_components/model/ComponentText.js");t["default"]=a["default"].extend({defaults:i({},a["default"].prototype.defaults,{tagName:"label",traits:["id","title","for"]})},{isComponent:function(e){if("LABEL"==e.tagName)return{type:"label"}}})},"./src/dom_components/model/ComponentLink.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./src/dom_components/model/ComponentText.js");t["default"]=a["default"].extend({defaults:i({},a["default"].prototype.defaults,{type:"link",tagName:"a",traits:["title","href","target"]}),getAttrToHTML:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=a["default"].prototype.getAttrToHTML.apply(this,t);return delete r.onmousedown,r}},{isComponent:function(e){var t;if("A"==e.tagName){t={type:"link",editable:0};var n=e.childNodes,r=n.length;r||delete t.editable;for(var i=0;i<r;i++){var o=n[i];if(3==o.nodeType&&""!=o.textContent.trim()){delete t.editable;break}}}return t}})},"./src/dom_components/model/ComponentMap.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./src/dom_components/model/ComponentImage.js"),l=n("./src/dom_components/model/Component.js");t["default"]=a["default"].extend({defaults:i({},a["default"].prototype.defaults,{type:"map",src:"","void":0,mapUrl:"https://maps.google.com/maps",tagName:"iframe",mapType:"q",address:"",zoom:"1",attributes:{frameborder:0},toolbar:l["default"].prototype.defaults.toolbar,traits:[{label:"Address",name:"address",placeholder:"eg. London, UK",changeProp:1},{type:"select",label:"Map type",name:"mapType",changeProp:1,options:[{value:"q",name:"Roadmap"},{value:"w",name:"Satellite"}]},{label:"Zoom",name:"zoom",type:"range",min:"1",max:"20",changeProp:1}]}),initialize:function(e,t){this.get("src")?this.parseFromSrc():this.updateSrc(),a["default"].prototype.initialize.apply(this,arguments),this.listenTo(this,"change:address change:zoom change:mapType",this.updateSrc)},updateSrc:function(){this.set("src",this.getMapUrl())},getMapUrl:function(){var e=this,t=e.get("address"),n=e.get("zoom"),r=e.get("mapType");t=t?"&q="+t:"",n=n?"&z="+n:"",r=r?"&t="+r:"";var i=e.get("mapUrl")+"?"+t+n+r;return i+="&output=embed"},parseFromSrc:function(){var e=this.parseUri(this.get("src")),t=e.query;t.q&&this.set("address",t.q),t.z&&this.set("zoom",t.z),t.t&&this.set("mapType",t.t)}},{isComponent:function(e){var t="";return"IFRAME"==e.tagName&&/maps\.google\.com/.test(e.src)&&(t={type:"map",src:e.src}),t}})},"./src/dom_components/model/ComponentScript.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./src/dom_components/model/Component.js");t["default"]=a["default"].extend({defaults:i({},a["default"].prototype.defaults,{type:"script",droppable:!1,draggable:!1,layerable:!1})},{isComponent:function(e){if("SCRIPT"==e.tagName){var t={type:"script"};return e.src&&(t.src=e.src,t.onload=e.onload),t}}})},"./src/dom_components/model/ComponentSvg.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./src/dom_components/model/Component.js");t["default"]=a["default"].extend({defaults:i({},a["default"].prototype.defaults,{resizable:{ratioDefault:1},highlightable:0}),getName:function(){var e=this.get("tagName"),t=this.get("custom-name");return e=e.charAt(0).toUpperCase()+e.slice(1),t||e}},{isComponent:function(e){if(SVGElement&&e instanceof SVGElement)return{tagName:e.tagName,type:"svg"}}})},"./src/dom_components/model/ComponentSvgIn.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./src/dom_components/model/ComponentSvg.js");t["default"]=a["default"].extend({defaults:i({},a["default"].prototype.defaults,{selectable:!1,hoverable:!1,layerable:!1})},{isComponent:function(e){if(a["default"].isComponent(e)&&"svg"!==e.tagName.toLowerCase())return{tagName:e.tagName,type:"svg-in"}}})},"./src/dom_components/model/ComponentTable.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./src/dom_components/model/Component.js");t["default"]=a["default"].extend({defaults:i({},a["default"].prototype.defaults,{type:"table",tagName:"table",droppable:["tbody","thead","tfoot"]}),initialize:function(e,t){a["default"].prototype.initialize.apply(this,arguments);var n=this.get("components");!n.length&&n.add({type:"tbody"})}},{isComponent:function(e){var t="";return"TABLE"==e.tagName&&(t={type:"table"}),t}})},"./src/dom_components/model/ComponentTableBody.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./src/dom_components/model/Component.js");t["default"]=a["default"].extend({defaults:i({},a["default"].prototype.defaults,{type:"tbody",tagName:"tbody",draggable:["table"],droppable:["tr"],columns:1,rows:1}),initialize:function(e,t){a["default"].prototype.initialize.apply(this,arguments);var n=this.get("components"),r=this.get("columns"),i=this.get("rows");if(!n.length){for(var o=[];i--;){for(var s=[],l=r;l--;)s.push({type:"cell",classes:["cell"]});o.push({type:"row",classes:["row"],components:s})}n.add(o)}}},{isComponent:function(e){var t="";return"TBODY"==e.tagName&&(t={type:"tbody"}),t}})},"./src/dom_components/model/ComponentTableCell.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./src/dom_components/model/Component.js");t["default"]=a["default"].extend({defaults:i({},a["default"].prototype.defaults,{type:"cell",tagName:"td",draggable:["tr"]})},{isComponent:function(e){var t="",n=e.tagName;return"TD"!=n&&"TH"!=n||(t={type:"cell",tagName:n.toLowerCase()}),t}})},"./src/dom_components/model/ComponentTableFoot.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t));
|
||
})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./src/dom_components/model/ComponentTableBody.js");t["default"]=a["default"].extend({defaults:i({},a["default"].prototype.defaults,{type:"tfoot",tagName:"tfoot"})},{isComponent:function(e){var t="";return"TFOOT"==e.tagName&&(t={type:"tfoot"}),t}})},"./src/dom_components/model/ComponentTableHead.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./src/dom_components/model/ComponentTableBody.js");t["default"]=a["default"].extend({defaults:i({},a["default"].prototype.defaults,{type:"thead",tagName:"thead"})},{isComponent:function(e){var t="";return"THEAD"==e.tagName&&(t={type:"thead"}),t}})},"./src/dom_components/model/ComponentTableRow.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./src/dom_components/model/Component.js");t["default"]=a["default"].extend({defaults:i({},a["default"].prototype.defaults,{type:"row",tagName:"tr",draggable:["thead","tbody","tfoot"],droppable:["th","td"]}),initialize:function(e,t){a["default"].prototype.initialize.apply(this,arguments);var n=[],r=this.get("components");r.each(function(e){return e.is("cell")&&n.push(e)}),r.reset(n)}},{isComponent:function(e){var t="";return"TR"==e.tagName&&(t={type:"row"}),t}})},"./src/dom_components/model/ComponentText.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./src/dom_components/model/Component.js");t["default"]=a["default"].extend({defaults:i({},a["default"].prototype.defaults,{type:"text",droppable:!1,editable:!0}),toHTML:function(){return this.trigger("sync:content",{silent:1}),a["default"].prototype.toHTML.apply(this,arguments)}})},"./src/dom_components/model/ComponentTextNode.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./src/dom_components/model/Component.js");t["default"]=a["default"].extend({defaults:i({},a["default"].prototype.defaults,{droppable:!1,layerable:!1,editable:!0}),toHTML:function(){return this.get("content").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}},{isComponent:function(e){var t="";return 3===e.nodeType&&(t={type:"textnode",content:e.textContent}),t}})},"./src/dom_components/model/ComponentVideo.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./src/dom_components/model/ComponentImage.js"),l=n("./src/dom_components/model/Component.js"),c="yt",u="vi",d="ytnc";t["default"]=a["default"].extend({defaults:i({},a["default"].prototype.defaults,{type:"video",tagName:"video",videoId:"","void":0,provider:"so",ytUrl:"https://www.youtube.com/embed/",ytncUrl:"https://www.youtube-nocookie.com/embed/",viUrl:"https://player.vimeo.com/video/",loop:0,poster:"",muted:0,autoplay:0,controls:1,color:"",rel:1,modestbranding:0,sources:[],attributes:{allowfullscreen:"allowfullscreen"},toolbar:l["default"].prototype.defaults.toolbar}),initialize:function(e,t){var n=[],r=this.get("provider");switch(r){case c:case d:n=this.getYoutubeTraits();break;case u:n=this.getVimeoTraits();break;default:n=this.getSourceTraits()}this.get("src")&&this.parseFromSrc(),this.set("traits",n),a["default"].prototype.initialize.apply(this,arguments),this.listenTo(this,"change:provider",this.updateTraits),this.listenTo(this,"change:videoId change:provider",this.updateSrc)},initToolbar:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];l["default"].prototype.initToolbar.apply(this,t)},parseFromSrc:function(){var e=this.get("provider"),t=this.parseUri(this.get("src")),n=t.query;switch(e){case c:case d:case u:var r=t.pathname.split("/").pop();this.set("videoId",r),n.autoplay&&this.set("autoplay",1),n.loop&&this.set("loop",1),0===parseInt(n.controls)&&this.set("controls",0),n.color&&this.set("color",n.color),"0"===n.rel&&this.set("rel",0),"1"===n.modestbranding&&this.set("modestbranding",1)}},updateSrc:function(){var e=this.get("provider");switch(e){case c:this.set("src",this.getYoutubeSrc());break;case d:this.set("src",this.getYoutubeNoCookieSrc());break;case u:this.set("src",this.getVimeoSrc())}},getAttrToHTML:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=a["default"].prototype.getAttrToHTML.apply(this,t),i=this.get("provider");switch(i){case c:case d:case u:break;default:this.get("loop")&&(r.loop="loop"),this.get("autoplay")&&(r.autoplay="autoplay"),this.get("controls")&&(r.controls="controls")}return r},updateTraits:function(){var e=this.get("provider"),t=this.getSourceTraits();switch(e){case c:case d:this.set("tagName","iframe"),t=this.getYoutubeTraits();break;case u:this.set("tagName","iframe"),t=this.getVimeoTraits();break;default:this.set("tagName","video")}this.loadTraits(t),this.em.trigger("component:toggled")},getProviderTrait:function(){return{type:"select",label:"Provider",name:"provider",changeProp:1,options:[{value:"so",name:"HTML5 Source"},{value:c,name:"Youtube"},{value:d,name:"Youtube (no cookie)"},{value:u,name:"Vimeo"}]}},getSourceTraits:function(){return[this.getProviderTrait(),{label:"Source",name:"src",placeholder:"eg. ./media/video.mp4",changeProp:1},{label:"Poster",name:"poster",placeholder:"eg. ./media/image.jpg"},this.getAutoplayTrait(),this.getLoopTrait(),this.getControlsTrait()]},getYoutubeTraits:function(){return[this.getProviderTrait(),{label:"Video ID",name:"videoId",placeholder:"eg. jNQXAC9IVRw",changeProp:1},this.getAutoplayTrait(),this.getLoopTrait(),this.getControlsTrait(),{type:"checkbox",label:"Related",name:"rel",changeProp:1},{type:"checkbox",label:"Modest",name:"modestbranding",changeProp:1}]},getVimeoTraits:function(){return[this.getProviderTrait(),{label:"Video ID",name:"videoId",placeholder:"eg. 123456789",changeProp:1},{label:"Color",name:"color",placeholder:"eg. FF0000",changeProp:1},this.getAutoplayTrait(),this.getLoopTrait()]},getAutoplayTrait:function(){return{type:"checkbox",label:"Autoplay",name:"autoplay",changeProp:1}},getLoopTrait:function(){return{type:"checkbox",label:"Loop",name:"loop",changeProp:1}},getControlsTrait:function(){return{type:"checkbox",label:"Controls",name:"controls",changeProp:1}},getYoutubeSrc:function(){var e=this.get("videoId"),t=this.get("ytUrl");return t+=e+"?",t+=this.get("autoplay")?"&autoplay=1":"",t+=this.get("controls")?"":"&controls=0&showinfo=0",t+=this.get("loop")?"&loop=1&playlist=".concat(e):"",t+=this.get("rel")?"":"&rel=0",t+=this.get("modestbranding")?"&modestbranding=1":""},getYoutubeNoCookieSrc:function(){var e=this.getYoutubeSrc();return e=e.replace(this.get("ytUrl"),this.get("ytncUrl"))},getVimeoSrc:function(){var e=this.get("viUrl");return e+=this.get("videoId")+"?",e+=this.get("autoplay")?"&autoplay=1":"",e+=this.get("loop")?"&loop=1":"",e+=this.get("controls")?"":"&title=0&portrait=0&badge=0",e+=this.get("color")?"&color="+this.get("color"):""}},{isComponent:function(e){var t="",n=/youtube\.com\/embed/.test(e.src),r=/youtube-nocookie\.com\/embed/.test(e.src),i=/player\.vimeo\.com\/video/.test(e.src),o=n||r||i;return("VIDEO"==e.tagName||"IFRAME"==e.tagName&&o)&&(t={type:"video"},e.src&&(t.src=e.src),o&&(n?t.provider=c:r?t.provider=d:i&&(t.provider=u))),t}})},"./src/dom_components/model/ComponentWrapper.js":function(e,t,n){"use strict";n.r(t);var r=n("./src/dom_components/model/Component.js");t["default"]=r["default"].extend({},{isComponent:function(){return!1}})},"./src/dom_components/model/Components.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){c()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o,s=n("./node_modules/@babel/runtime/helpers/typeof.js"),a=n.n(s),l=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),c=n.n(l),u=n("./node_modules/backbone/backbone.js"),d=n.n(u),h=n("./node_modules/underscore/underscore.js");n.n(h);t["default"]=d.a.Collection.extend({initialize:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.opt=t,this.listenTo(this,"add",this.onAdd),this.config=t.config,this.em=t.em;var n=this.em;this.model=function(e,r){var i,o=t.em.get("DomComponents").componentTypes;r.em=t.em,r.config=t.config,r.componentTypes=o,r.domc=t.domc;for(var s=0;s<o.length;s++){var a=o[s].id;if(a==e.type){i=o[s].model;break}}return i||(i=o[o.length-1].model,n&&e.type&&n.logWarning("Component type '".concat(e.type,"' not found"),{attrs:e,options:r})),new i(e,r)}},parseString:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.em,s=this.opt.domc,a=r.get("CssComposer"),l=r.get("Parser").parseHtml(e);return o||(o=n("./src/dom_components/model/Component.js")["default"]),o.checkId(l.html,l.css,s.componentsById),l.css&&a&&!t.temporary&&a.addCollection(l.css,i({},t,{extend:1})),l.html},add:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(h.isString)(e)?e=this.parseString(e,n):Object(h.isArray)(e)&&e.forEach(function(r,i){Object(h.isString)(r)&&(e[i]=t.parseString(r,n))});var r=Object(h.isArray)(e);return e=(r?e:[e]).filter(function(e){return e}).map(function(e){return t.processDef(e)}),e=r?e:e[0],d.a.Collection.prototype.add.apply(this,[e,n])},processDef:function(e){if(e.cid&&e.ccid)return e;var t=this.em,n=this.config,r=void 0===n?{}:n,o=r.processor,s=e;if(o){s=i({},s);var l=o(s);l&&(Object(h.each)(s,function(e,t){return delete s[t]}),Object(h.extend)(s,l))}if(s.$$typeof&&"object"==a()(s.props)){s=i({},s),s.props=i({},s.props);var c=t.get("DomComponents"),u=t.get("Parser"),d=u.parserHtml;Object(h.each)(s,function(e,t){Object(h.includes)(["props","type"],t)||delete s[t]});var f=s,p=f.props,g=p.children;delete p.children,delete s.props;var m=d.splitPropsFromAttr(p);s.attributes=m.attrs,g&&(s.components=g),s.type?c.getType(s.type)||(s.tagName=s.type,delete s.type):s.type="textnode",Object(h.extend)(s,m.props)}return s},onAdd:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.em,i=e.getStyle(),o=r&&r.getConfig("avoidInlineStyle");if(!Object(h.isEmpty)(i)&&!o&&r&&r.get&&r.getConfig("forceClass")&&!n.temporary){var s=e.cid;r.get("CssComposer").setClassRule(s,i);e.setStyle({}),e.addClass(s)}}})},"./src/dom_components/model/Toolbar.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=n("./src/dom_components/model/ToolbarButton.js");t["default"]=i.a.Collection.extend({model:o["default"]})},"./src/dom_components/model/ToolbarButton.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r);t["default"]=i.a.Model.extend({defaults:{command:"",attributes:{}}})},"./src/dom_components/view/ComponentCommentView.js":function(e,t,n){"use strict";n.r(t);var r=n("./src/dom_components/view/ComponentTextNodeView.js");t["default"]=r["default"].extend({_createElement:function(){return document.createComment(this.model.get("content"))}})},"./src/dom_components/view/ComponentImageView.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/underscore/underscore.js"),i=(n.n(r),n("./src/dom_components/view/ComponentView.js"));t["default"]=i["default"].extend({tagName:"img",events:{dblclick:"onActive",click:"initResize",error:"onError",dragstart:"noDrag"},initialize:function(e){var t=this.model;i["default"].prototype.initialize.apply(this,arguments),this.listenTo(t,"change:src",this.updateSrc),this.classEmpty="".concat(this.ppfx,"plh-image");var n=this.config;n.modal&&(this.modal=n.modal),n.am&&(this.am=n.am),this.fetchFile()},fetchFile:function(){if(!this.modelOpt.temporary){var e=this.model,t=e.get("file");if(t){var n=this.em.get("AssetManager").FileUploader();n.uploadFile({dataTransfer:{files:[t]}},function(t){var n=t&&t.data&&t.data[0],i=n&&(Object(r.isString)(n)?n:n.src);i&&e.set({src:i})}),e.set("file","")}}},updateSrc:function(){var e=this.model,t=this.classEmpty,n=this.$el,r=e.getSrcResult(),i=r&&!e.isDefaultSrc();e.addAttributes({src:r}),n[i?"removeClass":"addClass"](t)},onActive:function(e){e&&e.stopPropagation();var t=this.opts.config.em,n=t?t.get("Editor"):"";n&&this.model.get("editable")&&n.runCommand("open-assets",{target:this.model,types:["image"],accept:"image/*",onSelect:function(){n.Modal.close(),n.AssetManager.setTarget(null)}})},onError:function(){var e=this.model.getSrcResult({fallback:1});e&&(this.el.src=e)},noDrag:function(e){return e.preventDefault(),!1},render:function(){this.renderAttributes(),this.updateSrc();var e=this.$el,t=this.model,n=e.attr("class")||"";return!t.get("src")&&e.attr("class","".concat(n," ").concat(this.classEmpty).trim()),this.postRender(),this}})},"./src/dom_components/view/ComponentLabelView.js":function(e,t,n){"use strict";n.r(t);var r=n("./src/dom_components/view/ComponentLinkView.js");t["default"]=r["default"].extend({tagName:"span"})},"./src/dom_components/view/ComponentLinkView.js":function(e,t,n){"use strict";n.r(t);var r=n("./src/dom_components/view/ComponentTextView.js");t["default"]=r["default"].extend({render:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r["default"].prototype.render.apply(this,t),this.el.addEventListener("click",this.prevDef,!0),this}})},"./src/dom_components/view/ComponentMapView.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=(n.n(r),n("./src/dom_components/view/ComponentImageView.js"));t["default"]=i["default"].extend({tagName:"div",events:{},initialize:function(e){i["default"].prototype.initialize.apply(this,arguments),this.classEmpty=this.ppfx+"plh-map"},updateSrc:function(){this.getIframe().src=this.model.get("src")},getIframe:function(){if(!this.iframe){var e=document.createElement("iframe");e.src=this.model.get("src"),e.frameBorder=0,e.style.height="100%",e.style.width="100%",e.className=this.ppfx+"no-pointer",this.iframe=e}return this.iframe},render:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return i["default"].prototype.render.apply(this,t),this.updateClasses(),this.el.appendChild(this.getIframe()),this}})},"./src/dom_components/view/ComponentScriptView.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=(n.n(r),n("./src/dom_components/view/ComponentImageView.js"));t["default"]=i["default"].extend({tagName:"script",events:{},render:function(){var e=this.model,t=e.get("src"),n=this.em,r=n&&n.get("scriptCount")?n.get("scriptCount"):0,i="";if(t){var o=e.get("onload"),s="script"+r,a="script"+(r+1);i="var "+s+" = document.createElement('script');\n"+s+".onload = function(){\n"+(o?o+"();\n":"")+"typeof "+a+"Start == 'function' && "+a+"Start();\n};\n"+s+".src = '"+t+"';\nfunction "+s+"Start() { document.body.appendChild("+s+"); };\n"+(r?"":s+"Start();"),n&&n.set("scriptCount",r+1)}else i=e.get("content");return this.el.innerHTML=i,this}})},"./src/dom_components/view/ComponentSvgView.js":function(e,t,n){"use strict";n.r(t);var r=n("./src/dom_components/view/ComponentView.js");t["default"]=r["default"].extend({_createElement:function(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}})},"./src/dom_components/view/ComponentTableBodyView.js":function(e,t,n){"use strict";n.r(t);var r=n("./src/dom_components/view/ComponentView.js");t["default"]=r["default"].extend({})},"./src/dom_components/view/ComponentTableCellView.js":function(e,t,n){"use strict";n.r(t);var r=n("./src/dom_components/view/ComponentView.js");t["default"]=r["default"].extend({})},"./src/dom_components/view/ComponentTableFootView.js":function(e,t,n){"use strict";n.r(t);var r=n("./src/dom_components/view/ComponentView.js");t["default"]=r["default"].extend({})},"./src/dom_components/view/ComponentTableHeadView.js":function(e,t,n){"use strict";n.r(t);var r=n("./src/dom_components/view/ComponentView.js");t["default"]=r["default"].extend({})},"./src/dom_components/view/ComponentTableRowView.js":function(e,t,n){"use strict";n.r(t);var r=n("./src/dom_components/view/ComponentView.js");t["default"]=r["default"].extend({})},"./src/dom_components/view/ComponentTableView.js":function(e,t,n){"use strict";n.r(t);var r=n("./src/dom_components/view/ComponentView.js");t["default"]=r["default"].extend({events:{}})},"./src/dom_components/view/ComponentTextNodeView.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r);t["default"]=i.a.View.extend({initialize:function(){var e=this.$el,t=this.model;e.data("model",t),t.view=this},_createElement:function(){return document.createTextNode(this.model.get("content"))}})},"./src/dom_components/view/ComponentTextView.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./src/utils/mixins.js"),l=n("./src/dom_components/view/ComponentView.js"),c=l["default"].prototype;t["default"]=l["default"].extend({events:{dblclick:"onActive",input:"onInput"},initialize:function(e){c.initialize.apply(this,arguments),this.disableEditing=this.disableEditing.bind(this);var t=this.model,n=this.em;this.listenTo(t,"focus",this.onActive),this.listenTo(t,"change:content",this.updateContentText),this.listenTo(t,"sync:content",this.syncContent),this.rte=n&&n.get("RichTextEditor")},updateContentText:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!n.fromDisable&&this.disableEditing()},onActive:function(e){if(!this.rteEnabled&&this.model.get("editable")){e&&e.stopPropagation&&e.stopPropagation();var t=this.rte,n=this.em;if(t)try{this.activeRte=t.enable(this,this.activeRte)}catch(r){n.logError(r)}this.toggleEvents(1)}},onDisable:function(){this.disableEditing()},disableEditing:function(){var e=this.model,t=this.rte,n=this.activeRte,r=this.em,i=e.get("editable");if(t&&i){try{t.disable(this,n)}catch(o){r.logError(o)}this.syncContent()}this.toggleEvents()},getContent:function(){var e=this.rte,t=e||{},n=t.activeRte,r="";return r=n&&"function"==typeof n.getContent?n.getContent():this.getChildrenContainer().innerHTML},syncContent:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.model,n=this.rte,r=this.rteEnabled;if(r||e.force){var o=this.getContent(),s=t.components(),a=i({fromDisable:1},e);if(s.length&&s.reset(null,e),t.set("content","",a),n.customRte)t.set("content",o,a);else{var l=function c(t){var n=!!t.get("textable"),r=!["text","default",""].some(function(e){return t.is(e)})||n;t.set(i({_innertext:!r,editable:r&&t.get("editable"),selectable:r,hoverable:r,removable:n,draggable:n,highlightable:0,copyable:n},!n&&{toolbar:""}),e),t.get("components").each(function(e){return c(e)})};!e.silent&&t.trigger("change:content",t,"",a),s.add(o,e),s.each(function(e){return l(e)}),s.trigger("resetNavigator")}}},onInput:function(){var e=this.em;e&&e.trigger("component:update",this.model)},disablePropagation:function(e){e.stopPropagation()},toggleEvents:function(e){var t=this.em,n={on:a.on,off:a.off},r=e?"on":"off";t.setEditing(e),this.rteEnabled=!!e;var i=[this.el.ownerDocument,document];if(n.off(i,"mousedown",this.disableEditing),n[r](i,"mousedown",this.disableEditing),t[r]("toolbar:run:before",this.disableEditing),this.$el.off("mousedown",this.disablePropagation),this.$el[r]("mousedown",this.disablePropagation),this.config.draggableComponents)for(var o=this.el;o;)o.draggable=!e,o=o.parentNode,o&&"BODY"==o.tagName&&(o=0)}})},"./src/dom_components/view/ComponentVideoView.js":function(e,t,n){"use strict";n.r(t);var r=n("./src/dom_components/view/ComponentImageView.js"),i=n("./src/dom_components/view/ComponentView.js");t["default"]=r["default"].extend({tagName:"div",events:{},initialize:function(e){i["default"].prototype.initialize.apply(this,arguments);var t=this.model,n=["loop","autoplay","controls","color","rel","modestbranding","poster"],r=n.map(function(e){return"change:".concat(e)}).join(" ");this.listenTo(t,"change:provider",this.updateProvider),this.listenTo(t,"change:src",this.updateSrc),this.listenTo(t,r,this.updateVideo)},updateProvider:function(){var e=this.model.get("provider");this.el.innerHTML="",this.el.appendChild(this.renderByProvider(e))},updateSrc:function(){var e=this.model,t=this.videoEl;if(t){var n=e.get("provider"),r=e.get("src");switch(n){case"yt":r=e.getYoutubeSrc();break;case"ytnc":r=e.getYoutubeNoCookieSrc();break;case"vi":r=e.getVimeoSrc()}t.src=r}},updateVideo:function(){var e=this.model.get("provider"),t=this.videoEl,n=this.model;switch(e){case"yt":case"ytnc":case"vi":this.model.trigger("change:videoId");break;default:t.loop=n.get("loop"),t.autoplay=n.get("autoplay"),t.controls=n.get("controls"),t.poster=n.get("poster")}},renderByProvider:function(e){var t;switch(e){case"yt":t=this.renderYoutube();break;case"ytnc":t=this.renderYoutubeNoCookie();break;case"vi":t=this.renderVimeo();break;default:t=this.renderSource()}return this.videoEl=t,t},renderSource:function(){var e=document.createElement("video");return e.src=this.model.get("src"),this.initVideoEl(e),e},renderYoutube:function(){var e=document.createElement("iframe");return e.src=this.model.getYoutubeSrc(),e.frameBorder=0,e.setAttribute("allowfullscreen",!0),this.initVideoEl(e),e},renderYoutubeNoCookie:function(){var e=document.createElement("iframe");return e.src=this.model.getYoutubeNoCookieSrc(),e.frameBorder=0,e.setAttribute("allowfullscreen",!0),this.initVideoEl(e),e},renderVimeo:function(){var e=document.createElement("iframe");return e.src=this.model.getVimeoSrc(),e.frameBorder=0,e.setAttribute("allowfullscreen",!0),this.initVideoEl(e),e},initVideoEl:function(e){e.className=this.ppfx+"no-pointer",e.style.height="100%",e.style.width="100%"},render:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];r["default"].prototype.render.apply(this,t),this.updateClasses();var i=this.model.get("provider");return this.el.appendChild(this.renderByProvider(i)),this.updateVideo(),this}})},"./src/dom_components/view/ComponentView.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./node_modules/backbone/backbone.js"),l=n.n(a),c=n("./node_modules/underscore/underscore.js"),u=(n.n(c),n("./src/dom_components/model/Components.js")),d=n("./src/dom_components/view/ComponentsView.js"),h=n("./src/selector_manager/model/Selectors.js"),f=n("./src/utils/dom.js"),p=n("./src/utils/mixins.js");t["default"]=l.a.View.extend({className:function(){return this.getClasses()},tagName:function(){return this.model.get("tagName")},initialize:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.model,n=e.config||{},r=n.em,o=t.opt||{},s=this.$el,a=this.el,l=n.draggableComponents;this.opts=e,this.modelOpt=o,this.config=n,this.em=r||"",this.pfx=n.stylePrefix||"",this.ppfx=n.pStylePrefix||"",this.attr=t.get("attributes"),this.classe=this.attr["class"]||[],this.listenTo(t,"change:style",this.updateStyle),this.listenTo(t,"change:attributes change:_innertext",this.renderAttributes),this.listenTo(t,"change:highlightable",this.updateHighlight),this.listenTo(t,"change:status",this.updateStatus),this.listenTo(t,"change:script",this.reset),this.listenTo(t,"change:content",this.updateContent),this.listenTo(t,"change",this.handleChange),this.listenTo(t,"active",this.onActive),this.listenTo(t,"disable",this.onDisable),s.data("model",t),Object(p.setViewEl)(a,this),t.view=this,this._getFrame()&&t.views.push(this),this.initClasses(),this.initComponents({avoidRender:1}),this.events=i({},this.events,{},l&&{dragstart:"handleDragStart"}),this.delegateEvents(),!o.temporary&&this.init(this._clbObj())},_clbObj:function(){var e=this.em,t=this.model,n=this.el;return{editor:e&&e.getEditor(),model:t,el:n}},init:function(){},removed:function(){},onActive:function(){},onDisable:function(){},remove:function(){l.a.View.prototype.remove.apply(this,arguments);var e=this.model,t=this._getFrame()||{},n=t.model;e.components().forEach(function(e){var t=e.getView(n);t&&t.remove()});var r=e.views;return r.splice(r.indexOf(this),1),this.removed(this._clbObj()),this},handleDragStart:function(e){e.preventDefault(),e.stopPropagation(),this.em.get("Commands").run("tlb-move",{target:this.model,event:e})},initClasses:function(){var e=this.model,t="change:classes",n=e.get("classes");n instanceof h["default"]&&(this.stopListening(e,t,this.initClasses),this.listenTo(e,t,this.initClasses),this.listenTo(n,"add remove change",this.updateClasses),n.length&&this.importClasses())},initComponents:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.model,n=this.$el,r=this.childrenView,i="change:components",o=t.get("components"),s=[t,i,this.initComponents];o instanceof u["default"]&&(n.data("collection",o),r&&r.remove(),this.stopListening.apply(this,s),!e.avoidRender&&this.renderChildren(),this.listenTo.apply(this,s))},handleChange:function(){var e=this.model,t=Object(c.keys)(e.changed);if(1!==t.length||"status"!==t[0]){e.emitUpdate();for(var n in e.changed)e.emitUpdate(n)}},importClasses:function(){var e=this.config.em.get("SelectorManager");e&&this.model.get("classes").each(function(t){e.add(t.get("name"))})},updateStatus:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(this.em,this.el),n=this.model.get("status"),r=(this.pfx,this.ppfx),i="".concat(r,"selected"),o="".concat(i,"-parent"),s="".concat(r,"freezed"),a="".concat(r,"hovered"),l=[i,o,s,a];this.$el.removeClass(l.join(" "));var c=t.getAttribute("class")||"",u="";switch(n){case"selected":u="".concat(c," ").concat(i);break;case"selected-parent":u="".concat(c," ").concat(o);break;case"freezed":u="".concat(c," ").concat(s);break;case"freezed-selected":u="".concat(c," ").concat(s," ").concat(i);break;case"hovered":u=e.avoidHover?"":"".concat(c," ").concat(a)}u=u.trim(),u&&t.setAttribute("class",u)},updateHighlight:function(){var e=this.model.get("highlightable");this.setAttribute("data-highlightable",e?1:"")},updateStyle:function(){var e=this.model,t=this.em,n=this.el;if(t&&t.getConfig("avoidInlineStyle")){e.get("_innertext")?n.removeAttribute("id"):n.id=e.getId();var r=e.getStyle();!Object(c.isEmpty)(r)&&e.setStyle(r)}else this.setAttribute("style",e.styleToString())},updateClasses:function(){var e=this.model.get("classes").pluck("name").join(" ");this.setAttribute("class",e),this.updateStatus()},setAttribute:function(e,t){var n=this.$el;t?n.attr(e,t):n.removeAttr(e)},getClasses:function(){return this.model.getClasses().join(" ")},updateAttributes:function(){var e=[],t=this.model,n=this.$el,r=this.el,o=this.config,s=t.attributes,a=s.highlightable,l=s.textable,u=s.type,d=s._innertext,h=o.draggableComponents,f=i({"data-gjs-type":u||"default"},h&&!d?{draggable:!0}:{},{},a?{"data-highlightable":1}:{},{},l?{contenteditable:"false","data-gjs-textable":"true"}:{});Object(c.each)(r.attributes,function(t){return e.push(t.nodeName)}),e.forEach(function(e){return n.removeAttr(e)});var p=i({},f,{},t.getAttributes());Object(c.keys)(p).forEach(function(e){return p[e]===!1&&delete p[e]}),n.attr(p),this.updateStyle()},updateContent:function(){this.getChildrenContainer().innerHTML=this.model.get("content")},prevDef:function(e){e.preventDefault()},updateScript:function(){var e=this.model,t=this.em;e.get("script")&&t&&t.get("Canvas").getCanvasView().updateScript(this)},getChildrenContainer:function(){var e=this.el;return"function"==typeof this.getChildrenSelector?e=this.el.querySelector(this.getChildrenSelector()):"function"==typeof this.getTemplate,e},getOffsetRect:function(){var e={},t=this.el,n=0,r=0,i=function o(i){
|
||
var s=i.offsetParent;s?(n+=s.offsetTop,r+=s.offsetLeft,o(s)):(e.top=t.offsetTop+n,e.left=t.offsetLeft+r,e.bottom=e.top+t.offsetHeight,e.right=e.left+t.offsetWidth)};return i(t),e},isInViewport:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.rect,n=this.el,r=n.ownerDocument,i=r.body,o=r.defaultView.frameElement,s=t||this.getOffsetRect(),a=s.top,l=s.left,c=this._getFrame().getOffsetRect();return a>=c.scrollTop&&l>=c.scrollLeft&&a<=c.scrollBottom&&l<=o.offsetWidth+i.scrollLeft},scrollIntoView:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.getOffsetRect(),n=this.isInViewport({rect:t});if(!n||e.force){var r=this.el;"smooth"!==e.behavior?r.ownerDocument.defaultView.scrollTo(0,t.top):r.scrollIntoView(i({behavior:"smooth",block:"nearest"},e))}},reset:function(){var e=this.el;this.el="",this._ensureElement(),this._setData(),Object(f.replaceWith)(e,this.el),this.render()},_setData:function(){var e=this.model,t=e.components(),n=this;this.$el.data({model:e,collection:t,view:n})},_getFrame:function(){return this.config.frameView},renderChildren:function(){this.updateContent();var e=this.getChildrenContainer(),t=new d["default"]({collection:this.model.get("components"),config:this.config,componentTypes:this.opts.componentTypes});t.render(e),this.childrenView=t;for(var n=Array.prototype.slice.call(t.el.childNodes),r=0,i=n.length;r<i;r++)e.appendChild(n.shift())},renderAttributes:function(){this.updateAttributes(),this.updateClasses()},render:function(){return this.renderAttributes(),this.modelOpt.temporary?this:(this.renderChildren(),this.updateScript(),this.postRender(),this)},postRender:function(){var e=this.em,t=this.model,n=this.modelOpt;n.temporary||(this.onRender(this._clbObj()),e&&e.trigger("component:mount",t))},onRender:function(){}})},"./src/dom_components/view/ComponentsView.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=n("./node_modules/underscore/underscore.js");n.n(o);t["default"]=i.a.View.extend({initialize:function(e){this.opts=e||{},this.config=e.config||{},this.em=this.config.em;var t=this.collection;this.listenTo(t,"add",this.addTo),this.listenTo(t,"reset",this.resetChildren),this.listenTo(t,"remove",this.removeChildren)},removeChildren:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this.config.em,o=r.temporary;if(e.views.forEach(function(e){if(e){e.remove.apply(e);var t=e.childrenView,n=e.scriptContainer;t&&t.stopListening(),n&&n.remove()}}),e.components().forEach(function(e){return n.removeChildren(e,t,r)}),i&&!o){var s=e.getId(),a=i.get("DomComponents");delete a.componentsById[s];var l=i.get("CssComposer").getAll();if(l.remove(l.filter(function(e){return e.getSelectors().getFullString()==="#".concat(s)})),!e.opt.temporary){var c=i.get("Commands"),u=e.get("style-signature"),d={target:e};u&&c.run("core:component-style-clear",d),e.removed(),i.trigger("component:remove",e)}}},addTo:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}),n=this.config.em,r=this.collection.indexOf(e);if(this.addToCollection(e,null,r),n&&!t.temporary){var i=function o(e){n.trigger("component:add",e),e.components().forEach(function(e){return o(e)})};i(e)}},addToCollection:function(e,t,r){this.compView||(this.compView=n("./src/dom_components/view/ComponentView.js")["default"]);for(var i=this.config,s=this.opts,a=this.em,l=t||null,c=s.componentTypes||a&&a.get("DomComponents").getTypes(),u=e.get("type"),d=this.compView,h=0;h<c.length;h++)if(c[h].id==u){d=c[h].view;break}var f=new d({model:e,config:i,componentTypes:c}),p=f.render().el;if(l)l.appendChild(p);else{var g=this.parentEl,m=g.childNodes;if(Object(o.isUndefined)(r))g.appendChild(p);else{var v=m.length==r;v&&r--,v||!m.length?g.appendChild(p):g.insertBefore(p,m[r])}}return p},resetChildren:function(){var e=this;this.parentEl.innerHTML="",this.collection.each(function(t){return e.addToCollection(t)})},render:function(e){var t=this,n=this.el,r=document.createDocumentFragment();return this.parentEl=e||this.el,this.collection.each(function(e){return t.addToCollection(e,r)}),n.innerHTML="",n.appendChild(r),this}})},"./src/dom_components/view/ToolbarButtonView.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./node_modules/backbone/backbone.js"),l=n.n(a);t["default"]=l.a.View.extend({events:function(){return this.model.get("events")||{mousedown:"handleClick"}},attributes:function(){return this.model.get("attributes")},initialize:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.config,n=void 0===t?{}:t;this.em=n.em,this.editor=n.editor},handleClick:function(e){e.preventDefault(),e.stopPropagation();var t=this.editor,n=this.em,r=t.Canvas.getFrameEl().getBoundingClientRect(),o=r.left,s=r.top,a=i({},e,{clientX:e.clientX-o,clientY:e.clientY-s});n.trigger("toolbar:run:before"),this.execCommand(a)},execCommand:function(e){var t={event:e},n=this.model.get("command"),r=this.editor;"function"==typeof n&&n(r,null,t),"string"==typeof n&&r.runCommand(n,t)},render:function(){var e=this.editor,t=this.$el,n=this.model,r=n.get("id"),i=n.get("label"),o=e.getConfig("stylePrefix");return t.addClass("".concat(o,"toolbar-item")),r&&t.addClass("".concat(o,"toolbar-item__").concat(r)),i&&t.append(i),this}})},"./src/dom_components/view/ToolbarView.js":function(e,t,n){"use strict";n.r(t);var r=n("./src/domain_abstract/view/DomainViews.js"),i=n("./src/dom_components/view/ToolbarButtonView.js");t["default"]=r["default"].extend({itemView:i["default"],initialize:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.config={editor:e.editor||"",em:e.em},this.listenTo(this.collection,"reset",this.render)}})},"./src/domain_abstract/model/Styleable.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./node_modules/underscore/underscore.js"),l=(n.n(a),n("./src/utils/mixins.js")),c=n("./src/parser/model/ParserHtml.js"),u=Object(c["default"])().parseStyle;t["default"]={parseStyle:u,extendStyle:function(e){return i({},this.getStyle(),{},e)},getStyle:function(){var e=this.get("style")||{};return i({},e)},setStyle:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(a.isString)(t)&&(t=u(t));var r=this.getStyle(),o=i({},t);this.set("style",o,n);var s=Object(l.shallowDiff)(r,o);return Object(a.keys)(s).forEach(function(t){var n=e.em;e.trigger("change:style:".concat(t)),n&&(n.trigger("styleable:change",e,t),n.trigger("styleable:change:".concat(t),e,t))}),o},addStyle:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};"string"==typeof e?e={prop:t}:n=t||{},e=this.extendStyle(e),this.setStyle(e,n)},removeStyle:function(e){var t=this.getStyle();delete t[e],this.setStyle(t)},styleToString:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=[],n=this.getStyle();for(var r in n){var i=e.important,o=Object(a.isArray)(i)?i.indexOf(r)>=0:i,s="".concat(n[r]).concat(o?" !important":""),l="__"==r.substr(0,2);s&&!l&&t.push("".concat(r,":").concat(s,";"))}return t.join("")},getSelectors:function(){return this.get("selectors")||this.get("classes")},getSelectorsString:function(){return this.selectorsToString?this.selectorsToString():this.getSelectors().getFullString()}}},"./src/domain_abstract/model/TypeableCollection.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/underscore/underscore.js"),i=(n.n(r),n("./node_modules/backbone/backbone.js")),o=n.n(i),s=o.a.Model,a=o.a.View;t["default"]={types:[],initialize:function(e,t){var n=this;this.model=function(){var e,t,r,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(i&&i.type){var s=n.getBaseType();r=n.getType(i.type),e=r?r.model:s.model,t=r?r.view:s.view}else{var a=n.recognizeType(i);r=a.type,e=r.model,t=r.view,i=a.attributes}var l=new e(i,o);return l.typeView=t,l};var r=this.init&&this.init.bind(this);r&&r()},recognizeType:function(e){for(var t=this.getTypes(),n=0;n<t.length;n++){var r=t[n],i=r.isType(e);if(i="boolean"==typeof i&&i?{type:r.id}:i)return{type:r,attributes:i}}return{type:this.getBaseType(),attributes:e}},getBaseType:function(){var e=this.getTypes();return e[e.length-1]},getTypes:function(){return this.types},getType:function(e){for(var t=this.getTypes(),n=0;n<t.length;n++){var r=t[n];if(r.id===e)return r}},addType:function(e,t){var n=this.getType(e),i=this.getBaseType(),o=n?n.model:i.model,l=n?n.view:i.view,c=t.model,u=t.view,d=t.isType;c=c instanceof s||Object(r.isFunction)(c)?c:o.extend(c||{}),u=u instanceof a||Object(r.isFunction)(u)?u:l.extend(u||{}),n?(n.model=c,n.view=u,n.isType=d||n.isType):(t.id=e,t.model=c,t.view=u,t.isType=d||function(t){if(t&&t.type==e)return!0},this.getTypes().unshift(t))}}},"./src/domain_abstract/ui/Input.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=i.a.$;t["default"]=i.a.View.extend({events:{change:"handleChange"},template:function(){return'<span class="'.concat(this.holderClass(),'"></span>')},inputClass:function(){return"".concat(this.ppfx,"field")},holderClass:function(){return"".concat(this.ppfx,"input-holder")},initialize:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.ppfx||"";this.opts=e,this.ppfx=t,this.em=e.target||{},this.listenTo(this.model,"change:value",this.handleModelChange)},elementUpdated:function(){this.model.trigger("el:change")},setValue:function(e){var t=this.model,n=e||t.get("defaults"),r=this.getInputEl();r&&(r.value=n)},handleModelChange:function(e,t,n){this.setValue(t,n)},handleChange:function(e){e.stopPropagation();var t=this.getInputEl().value;this.model.set({value:t},{fromInput:1}),this.elementUpdated()},getInputEl:function(){if(!this.inputEl){var e=this.model,t=e.get("placeholder")||e.get("defaults")||"";this.inputEl=o('<input type="text" placeholder="'.concat(t,'">'))}return this.inputEl.get(0)},render:function(){this.inputEl=null;var e=this.$el;return e.addClass(this.inputClass()),e.html(this.template()),e.find(".".concat(this.holderClass())).append(this.getInputEl()),this}})},"./src/domain_abstract/ui/InputColor.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./node_modules/backbone/backbone.js"),l=n.n(a),c=n("./node_modules/underscore/underscore.js"),u=(n.n(c),n("./src/utils/ColorPicker.js")),d=n("./src/domain_abstract/ui/Input.js"),h=l.a.$;Object(u["default"])(h),t["default"]=d["default"].extend({template:function(){var e=this.ppfx;return'\n <div class="'.concat(this.holderClass(),'"></div>\n <div class="').concat(e,'field-colorp">\n <div class="').concat(e,'field-colorp-c" data-colorp-c>\n <div class="').concat(e,'checker-bg"></div>\n </div>\n </div>\n ')},inputClass:function(){var e=this.ppfx;return"".concat(e,"field ").concat(e,"field-color")},holderClass:function(){return"".concat(this.ppfx,"input-holder")},setValue:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.model,r=n.get("defaults"),i=Object(c.isUndefined)(e)?Object(c.isUndefined)(r)?"":r:e,o=this.getInputEl(),s=this.getColorEl(),a="none"!=i?i:"";o.value=i,s.get(0).style.backgroundColor=a,t.fromTarget&&(s.spectrum("set",a),this.noneColor="none"==i)},getColorEl:function(){if(!this.colorEl){var e,t=this,n=this.ppfx,r=this.model,o=h('<div class="'.concat(this.ppfx,'field-color-picker"></div>')),s=o.get(0).style,a=this.em&&this.em.config?this.em.config.el:"",l=this.em&&this.em.getConfig&&this.em.getConfig("colorPicker")||{},c=function(e){var t=1==e.getAlpha()?e.toHexString():e.toRgbString();return t.replace(/ /g,"")},u=0;this.$el.find("[data-colorp-c]").append(o),o.spectrum(i({containerClassName:"".concat(n,"one-bg ").concat(n,"two-color"),appendTo:a||"body",maxSelectionSize:8,showPalette:!0,showAlpha:!0,chooseText:"Ok",cancelText:"⨯",palette:[]},l,{move:function(e){var t=c(e);s.backgroundColor=t,r.setValueFromInput(t,0)},change:function(e){u=1;var n=c(e);s.backgroundColor=n,r.setValueFromInput(0,0),r.setValueFromInput(n),t.noneColor=0},show:function(t){u=0,e=c(t)},hide:function(n){!u&&e&&(t.noneColor&&(e=""),s.backgroundColor=e,o.spectrum("set",e),r.setValueFromInput(e,0))}})),this.colorEl=o}return this.colorEl},render:function(){return d["default"].prototype.render.call(this),this.getColorEl(),this}})},"./src/domain_abstract/ui/InputNumber.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=n("./node_modules/underscore/underscore.js"),s=(n.n(o),n("./src/utils/mixins.js")),a=n("./src/domain_abstract/ui/Input.js");i.a.$;t["default"]=a["default"].extend({events:{"change input":"handleChange","change select":"handleUnitChange","click [data-arrow-up]":"upArrowClick","click [data-arrow-down]":"downArrowClick","mousedown [data-arrows]":"downIncrement"},template:function(){var e=this.ppfx;return'\n <span class="'.concat(e,'input-holder"></span>\n <span class="').concat(e,'field-units"></span>\n <div class="').concat(e,'field-arrows" data-arrows>\n <div class="').concat(e,'field-arrow-u" data-arrow-up></div>\n <div class="').concat(e,'field-arrow-d" data-arrow-down></div>\n </div>\n ')},inputClass:function(){var e=this.ppfx;return this.opts.contClass||"".concat(e,"field ").concat(e,"field-integer")},initialize:function(){arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};a["default"].prototype.initialize.apply(this,arguments),Object(o.bindAll)(this,"moveIncrement","upIncrement"),this.doc=document,this.listenTo(this.model,"change:unit",this.handleModelChange)},setValue:function(e,t){var n=t||{},r=this.validateInputValue(e,{deepCheck:1}),i={value:r.value};(r.unit||r.force)&&(i.unit=r.unit),this.model.set(i,n),n.silent&&this.handleModelChange()},handleChange:function(e){e.stopPropagation(),this.setValue(this.getInputEl().value),this.elementUpdated()},handleUnitChange:function(e){e.stopPropagation();var t=this.getUnitEl().value;this.model.set("unit",t),this.elementUpdated()},elementUpdated:function(){this.model.trigger("el:change")},handleModelChange:function(){var e=this.model;this.getInputEl().value=e.get("value");var t=this.getUnitEl();t&&(t.value=e.get("unit")||"")},getUnitEl:function(){if(!this.unitEl){var e=this.model,t=e.get("units")||[];if(t.length){var n=[];t.forEach(function(t){var r=t==e.get("unit")?"selected":"";n.push("<option ".concat(r,">").concat(t,"</option>"))});var r=document.createElement("div");r.innerHTML='<select class="'.concat(this.ppfx,'input-unit">').concat(n.join(""),"</select>"),this.unitEl=r.firstChild}}return this.unitEl},upArrowClick:function(){var e=this.model,t=e.get("step"),n=parseInt(e.get("value"),10);n=this.normalizeValue(n+t);var r=this.validateInputValue(n);e.set("value",r.value),this.elementUpdated()},downArrowClick:function(){var e=this.model,t=e.get("step"),n=parseInt(e.get("value"),10),r=this.normalizeValue(n-t),i=this.validateInputValue(r);e.set("value",i.value),this.elementUpdated()},downIncrement:function(e){e.preventDefault(),this.moved=0;var t=this.model.get("value");t=this.normalizeValue(t),this.current={y:e.pageY,val:t},Object(s.on)(this.doc,"mousemove",this.moveIncrement),Object(s.on)(this.doc,"mouseup",this.upIncrement)},moveIncrement:function(e){this.moved=1;var t=this.model,n=t.get("step"),r=this.current,i=this.normalizeValue(r.val+(r.y-e.pageY)*n);return this.prValue=this.validateInputValue(i).value,t.set("value",this.prValue,{avoidStore:1}),!1},upIncrement:function(){var e=this.model,t=e.get("step");if(Object(s.off)(this.doc,"mouseup",this.upIncrement),Object(s.off)(this.doc,"mousemove",this.moveIncrement),this.prValue&&this.moved){var n=this.prValue-t;e.set("value",n,{avoidStore:1}).set("value",n+t),this.elementUpdated()}},normalizeValue:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.model,r=n.get("step"),i=0;if(isNaN(e))return t;if(e=parseFloat(e),Math.floor(e)!==e){var o=r.toString().split(".")[1];i=o?o.length:0}return i?parseFloat(e.toFixed(i)):e},validateInputValue:function(e,t){var n=0,r=t||{},i=this.model,s="",a=Object(o.isUndefined)(e)?s:e,l=i.get("units")||[],c=i.get("unit")||l.length&&l[0]||"",u=i.get("max"),d=i.get("min");if(r.deepCheck){var h=i.get("fixedValues")||[];if(a){var f=new RegExp("^"+h.join("|"),"g");if(h.length&&f.test(a))a=a.match(f)[0],c="",n=1;else{var p=a+"";a+="",a=parseFloat(a.replace(",",".")),a=isNaN(a)?s:a;var g=p.replace(a,"");Object(o.indexOf)(l,g)>=0&&(c=g)}}}return Object(o.isUndefined)(u)||""===u||(a=a>u?u:a),Object(o.isUndefined)(d)||""===d||(a=a<d?d:a),{force:n,value:a,unit:c}},render:function(){a["default"].prototype.render.call(this),this.unitEl=null;var e=this.getUnitEl();return e&&this.$el.find(".".concat(this.ppfx,"field-units")).get(0).appendChild(e),this}})},"./src/domain_abstract/view/DomainViews.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/underscore/underscore.js"),i=(n.n(r),n("./node_modules/backbone/backbone.js")),o=n.n(i);t["default"]=o.a.View.extend({itemView:"",itemsView:"",itemType:"type",autoAdd:0,initialize:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;this.config=t||e.config||{},this.autoAdd&&this.listenTo(this.collection,"add",this.addTo),this.init()},init:function(){},addTo:function(e){this.add(e)},itemViewNotFound:function(e){var t=this.config,n=this.ns,r=t.em,i="".concat(n?"[".concat(n,"]: "):"","'").concat(e,"' type not found");r&&r.logWarning(i)},add:function(e,t){var n,i=this.config,o=this.reuseView,s=this.itemsView,a=void 0===s?{}:s,l=["button","checkbox","color","date","datetime-local","email","file","hidden","image","month","number","password","radio","range","reset","search","submit","tel","text","time","url","week"],c=t||null,u=this.itemView,d=e.get(this.itemType);a[d]?u=a[d]:!d||a[d]||Object(r.includes)(l,d)||this.itemViewNotFound(d),n=e.view&&o?e.view:new u({model:e,config:i},i);var h=n.render().el;c?c.appendChild(h):this.$el.append(h)},render:function(){var e=document.createDocumentFragment();return this.$el.empty(),this.collection.length&&this.collection.each(function(t){this.add(t,e)},this),this.$el.append(e),this.onRender(),this},onRender:function(){}})},"./src/editor/config/config.js":function(e,t,n){"use strict";n.r(t),t["default"]={stylePrefix:"gjs-",components:"",style:"",fromElement:0,noticeOnUnload:!0,showOffsets:!1,showOffsetsSelected:!1,forceClass:!0,height:"900px",width:"100%",log:["warning","error"],baseCss:"\n * {\n box-sizing: border-box;\n }\n html, body, [data-gjs-type=wrapper] {\n min-height: 100%;\n }\n body {\n margin: 0;\n height: 100%;\n background-color: #fff\n }\n [data-gjs-type=wrapper] {\n overflow: auto;\n overflow-x: hidden;\n }\n\n * ::-webkit-scrollbar-track {\n background: rgba(0, 0, 0, 0.1)\n }\n\n * ::-webkit-scrollbar-thumb {\n background: rgba(255, 255, 255, 0.2)\n }\n\n * ::-webkit-scrollbar {\n width: 10px\n }\n ",protectedCss:"* { box-sizing: border-box; } body {margin: 0;}",canvasCss:"",defaultCommand:"select-comp",showToolbar:1,allowScripts:0,showDevices:1,devicePreviewMode:0,mediaCondition:"max-width",tagVarStart:"{[ ",tagVarEnd:" ]}",keepEmptyTextNodes:0,jsInHtml:!0,nativeDnD:1,multipleSelection:1,exportWrapper:0,wrapperIsBody:1,avoidInlineStyle:1,avoidDefaults:1,clearStyles:0,dragMode:0,cssIcons:"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css",el:"",i18n:{},undoManager:{},assetManager:{},canvas:{},layers:{},storageManager:{},richTextEditor:{},domComponents:{},modal:{},codeManager:{},panels:{},commands:{},cssComposer:{},selectorManager:{},deviceManager:{devices:[{id:"desktop",name:"Desktop",width:""},{id:"tablet",name:"Tablet",width:"768px",widthMedia:"992px"},{id:"mobileLandscape",name:"Mobile landscape",width:"568px",widthMedia:"768px"},{id:"mobilePortrait",name:"Mobile portrait",width:"320px",widthMedia:"480px"}]},styleManager:{sectors:[{name:"General",open:!1,buildProps:["float","display","position","top","right","left","bottom"]},{name:"Flex",open:!1,buildProps:["flex-direction","flex-wrap","justify-content","align-items","align-content","order","flex-basis","flex-grow","flex-shrink","align-self"]},{name:"Dimension",open:!1,buildProps:["width","height","max-width","min-height","margin","padding"]},{name:"Typography",open:!1,buildProps:["font-family","font-size","font-weight","letter-spacing","color","line-height","text-align","text-shadow"],properties:[{property:"text-align",list:[{value:"left",className:"fa fa-align-left"},{value:"center",className:"fa fa-align-center"},{value:"right",className:"fa fa-align-right"},{value:"justify",className:"fa fa-align-justify"}]}]},{name:"Decorations",open:!1,buildProps:["border-radius-c","background-color","border-radius","border","box-shadow","background"]},{name:"Extra",open:!1,buildProps:["transition","perspective","transform"]}]},blockManager:{},traitManager:{},textViewCode:"Code",keepUnusedStyles:0,multiFrames:0}},"./src/editor/index.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./node_modules/cash-dom/dist/cash.esm.js"),l=n("./src/editor/config/config.js"),c=n("./src/editor/model/Editor.js"),u=n("./src/editor/view/EditorView.js");t["default"]=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=i({},l["default"],{},e);t.pStylePrefix=t.stylePrefix;var n=new c["default"](t),r=new u["default"]({model:n,config:t});return{$:a["default"],editor:n,I18n:n.get("I18n"),DomComponents:n.get("DomComponents"),LayerManager:n.get("LayerManager"),CssComposer:n.get("CssComposer"),StorageManager:n.get("StorageManager"),AssetManager:n.get("AssetManager"),BlockManager:n.get("BlockManager"),TraitManager:n.get("TraitManager"),SelectorManager:n.get("SelectorManager"),CodeManager:n.get("CodeManager"),Commands:n.get("Commands"),Keymaps:n.get("Keymaps"),Modal:n.get("Modal"),Panels:n.get("Panels"),StyleManager:n.get("StyleManager"),Canvas:n.get("Canvas"),UndoManager:n.get("UndoManager"),DeviceManager:n.get("DeviceManager"),RichTextEditor:n.get("RichTextEditor"),Parser:n.get("Parser"),Utils:n.get("Utils"),Config:n.get("Config"),init:function(){var e=this;return n.init(this),n.on("loaded",function(){e.UndoManager.clear(),n.get("modules").forEach(function(e){e.postRender&&e.postRender(r)})}),this},getConfig:function(e){return n.getConfig(e)},getHtml:function(e){return n.getHtml(e)},getCss:function(e){return n.getCss(e)},getJs:function(){return n.getJs()},getComponents:function(){return n.get("DomComponents").getComponents()},getWrapper:function(){return n.get("DomComponents").getWrapper()},setComponents:function(e){return n.setComponents(e),this},addComponents:function(e,t){return this.getWrapper().append(e,t)},getStyle:function(){return n.get("CssComposer").getAll()},setStyle:function(e){return n.setStyle(e),this},getSelected:function(){return n.getSelected()},getSelectedAll:function(){return n.getSelectedAll()},getSelectedToStyle:function(){var e=n.getSelected();if(e)return this.StyleManager.getModelToStyle(e)},select:function(e,t){return n.setSelected(e,t),this},selectAdd:function(e){return n.addSelected(e),this},selectRemove:function(e){return n.removeSelected(e),this},selectToggle:function(e){return n.toggleSelected(e),this},setDevice:function(e){return n.set("device",e),this},getDevice:function(){return n.get("device")},runCommand:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n.get("Commands").run(e,t)},stopCommand:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n.get("Commands").stop(e,t)},store:function(e){return n.store(e)},load:function(e){return n.load(e)},getContainer:function(){return t.el},getDirtyCount:function(){return n.getDirtyCount()},refresh:function(){n.refreshCanvas()},setCustomRte:function(e){this.RichTextEditor.customRte=e},setCustomParserCss:function(e){return this.Parser.getConfig().parserCss=e,this},setDragMode:function(e){return n.setDragMode(e),this},log:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n.log(e,t),this},t:function(){return n.t.apply(n,arguments)},on:function(e,t){return n.on(e,t),this},once:function(e,t){return n.once(e,t),this},off:function(e,t){return n.off(e,t),this},trigger:function(e){return n.trigger.apply(n,arguments),this},destroy:function(){return n.destroyAll()},getEl:function(){return r.el},getModel:function(){return n},render:function(){return r.render(),r.el}}}},"./src/editor/model/Editor.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./node_modules/underscore/underscore.js"),l=(n.n(a),n("./node_modules/cash-dom/dist/cash.esm.js")),c=n("./node_modules/backbone/backbone.js"),u=n.n(c),d=n("./src/utils/extender.js"),h=n("./src/utils/mixins.js");u.a.$=l["default"];var f,p,g=[n("./src/utils/index.js"),n("./src/i18n/index.js"),n("./src/keymaps/index.js"),n("./src/undo_manager/index.js"),n("./src/storage_manager/index.js"),n("./src/device_manager/index.js"),n("./src/parser/index.js"),n("./src/selector_manager/index.js"),n("./src/style_manager/index.js"),n("./src/modal_dialog/index.js"),n("./src/code_manager/index.js"),n("./src/panels/index.js"),n("./src/rich_text_editor/index.js"),n("./src/asset_manager/index.js"),n("./src/css_composer/index.js"),n("./src/trait_manager/index.js"),n("./src/dom_components/index.js"),n("./src/navigator/index.js"),n("./src/canvas/index.js"),n("./src/commands/index.js"),n("./src/block_manager/index.js")],m=u.a.Collection;Object(d["default"])({Backbone:u.a,$:u.a.$});var v={debug:console.log,info:console.info,warning:console.warn,error:console.error};t["default"]=u.a.Model.extend({defaults:function(){return{editing:0,selected:new m,clipboard:null,dmode:0,componentHovered:null,previousModel:null,changesCount:0,storables:[],modules:[],toLoad:[],opened:{},device:""}},initialize:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.config=t,this.set("Config",t),this.set("modules",[]),this.set("toLoad",[]),this.set("storables",[]),this.set("dmode",t.dragMode);var n=t.el,r=t.log,i=r===!0?Object(a.keys)(v):Object(a.isArray)(r)?r:[];Object(a.bindAll)(this,"initBaseColorPicker"),n&&t.fromElement&&(this.config.components=n.innerHTML),this.attrsOrig=n?Object(a.toArray)(n.attributes).reduce(function(e,t){return e[t.nodeName]=t.nodeValue,e},{}):"",g.forEach(function(t){return e.loadModule(t)}),this.on("change:componentHovered",this.componentHovered,this),this.on("change:changesCount",this.updateChanges,this),i.forEach(function(t){return e.listenLog(t)}),[{from:"change:selectedComponent",to:"component:toggled"}].forEach(function(t){var n=t.from,r=t.to;e.listenTo(e,n,function(){for(var t=arguments.length,i=new Array(t),o=0;o<t;o++)i[o]=arguments[o];e.trigger.apply(e,[r].concat(i)),e.logWarning("The event '".concat(n,"' is deprecated, replace it with '").concat(r,"'"))})})},getContainer:function(){return this.config.el},listenLog:function(e){this.listenTo(this,"log:".concat(e),v[e])},getConfig:function(e){var t=this.config;return Object(a.isUndefined)(e)?t:t[e]},loadOnStart:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=this.get("StorageManager");this.get("toLoad").forEach(function(e){e.onLoad()});var r=function(){var n=e.get("modules");n.forEach(function(t){return t.postLoad&&t.postLoad(e)}),t&&t()};n&&n.canAutoload()?this.load(r):r()},updateChanges:function(){var e=this,t=this.get("StorageManager"),n=this.get("changesCount");p&&clearTimeout(p),p=setTimeout(function(){return e.trigger("update")}),this.config.noticeOnUnload&&(window.onbeforeunload=n?function(e){return 1}:null),t.isAutosave()&&n>=t.getStepsBeforeSave()&&this.store()},loadModule:function(e){var t=this.config,n=e["default"]||e,r=new n,o=r.name.charAt(0).toLowerCase()+r.name.slice(1),s=Object(a.isUndefined)(t[o])?t[r.name]:t[o],l=s||{},c=this.get("StorageManager");if(l.pStylePrefix=t.pStylePrefix||"",Object(a.isUndefined)(s)||s||(l._disable=1),r.storageKey&&r.store&&r.load&&c){l.stm=c;var u="domComponents"==o?"unshift":"push";this.get("storables")[u](r)}return l.em=this,r.init(i({},l)),!r["private"]&&this.set(r.name,r),r.onLoad&&this.get("toLoad").push(r),this.get("modules").push(r),this},init:function(e){this.set("Editor",e)},getEditor:function(){return this.get("Editor")},handleUpdates:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r.temporary||(f&&clearInterval(f),f=setTimeout(function(){r.avoidStore||n.set("changesCount",n.get("changesCount")+1,r)},0))},componentHovered:function(e,t,n){var r=this.previous("componentHovered");r&&this.trigger("component:unhovered",r,n),
|
||
t&&this.trigger("component:hovered",t,n)},getSelected:function(){return this.get("selected").last()},getSelectedAll:function(){return this.get("selected").models},setSelected:function(e){var t,n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=Object(a.isArray)(e),o=i?e:[e],s=this.get("selected");i&&this.removeSelected(s.filter(function(e){return!Object(a.contains)(o,e)})),o.forEach(function(e){var o=Object(h.getModel)(e,l["default"]);o&&!o.get("selectable")||(!i&&n.removeSelected(s.filter(function(e){return e!==o})),n.addSelected(o,r),t=o)})},addSelected:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Object(h.getModel)(e,l["default"]),i=Object(a.isArray)(r)?r:[r];i.forEach(function(e){if(!e||e.get("selectable")){var r=t.get("selected");n.forceChange&&r.remove(e,n),r.push(e,n)}})},removeSelected:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.get("selected").remove(Object(h.getModel)(e,l["default"]),t)},toggleSelected:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Object(h.getModel)(e,l["default"]),i=Object(a.isArray)(r)?r:[r];i.forEach(function(e){t.get("selected").contains(e)?t.removeSelected(e,n):t.addSelected(e,n)})},setHovered:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Object(h.getModel)(e,l["default"]);n&&!n.get("hoverable")||(t.forceChange&&this.set("componentHovered",""),this.set("componentHovered",n,t))},getHovered:function(){return this.get("componentHovered")},setComponents:function(e){return this.get("DomComponents").setComponents(e)},getComponents:function(){var e=this.get("DomComponents"),t=this.get("CodeManager");if(e&&t){var n=e.getComponents();return t.getCode(n,"json")}},setStyle:function(e){for(var t=this.get("CssComposer").getAll(),n=0,r=t.length;n<r;n++)t.pop();return t.add(e),this},getStyle:function(){return this.get("CssComposer").getAll()},setState:function(e){return this.set("state",e),this},getState:function(){return this.get("state")},getHtml:function(){var e=this.config,t=e.exportWrapper,n=e.wrapperIsBody,r=e.jsInHtml?this.getJs():"",i=this.get("DomComponents").getComponent(),o=this.get("CodeManager").getCode(i,"html",{exportWrapper:t,wrapperIsBody:n});return o+=r?"<script>".concat(r,"</script>"):""},getCss:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.config,n=t.wrapperIsBody,r=e.avoidProtected,i=Object(a.isUndefined)(e.keepUnusedStyles)?t.keepUnusedStyles:e.keepUnusedStyles,o=this.get("CssComposer"),s=this.get("DomComponents").getComponent(),l=r?"":t.protectedCss;return l+this.get("CodeManager").getCode(s,"css",{cssc:o,wrapperIsBody:n,keepUnusedStyles:i})},getJs:function(){var e=this.get("DomComponents").getWrapper();return this.get("CodeManager").getCode(e,"js").trim()},store:function b(e){var t=this,n=this.get("StorageManager"),b={};if(n)return this.get("storables").forEach(function(e){var t=e.store(1);for(var n in t)b[n]=t[n]}),n.store(b,function(n){e&&e(n),t.set("changesCount",0),t.trigger("storage:store",b)}),b},load:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.getCacheLoad(1,function(n){e.get("storables").forEach(function(e){return e.load(n)}),t&&t(n)})},getCacheLoad:function(e,t){var n=this;if(this.cacheLoad&&!e)return this.cacheLoad;var r=this.get("StorageManager"),i=[];return r?(this.get("storables").forEach(function(e){var t=e.storageKey;t=Object(a.isFunction)(t)?t():t;var n=Object(a.isArray)(t)?t:[t];n.forEach(function(e){return i.push(e)})}),void r.load(i,function(e){n.cacheLoad=e,t&&t(e),setTimeout(function(){return n.trigger("storage:load",e)})})):{}},getDeviceModel:function(){var e=this.get("device");return this.get("DeviceManager").get(e)},runDefault:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.get("Commands").get(this.config.defaultCommand);t&&!this.defaultRunning&&(t.stop(this,this,e),t.run(this,this,e),this.defaultRunning=1)},stopDefault:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.get("Commands").get(this.config.defaultCommand);t&&(t.stop(this,this,e),this.defaultRunning=0)},refreshCanvas:function(){this.set("canvasOffset",null),this.set("canvasOffset",this.get("Canvas").getOffset())},clearSelection:function(e){var t=e||window;t.getSelection().removeAllRanges()},getCurrentMedia:function(){var e=this.config,t=this.getDeviceModel(),n=e.mediaCondition,r=e.devicePreviewMode,i=t&&t.get("widthMedia");return t&&i&&!r?"(".concat(n,": ").concat(i,")"):""},getWrapper:function(){return this.get("DomComponents").getWrapper()},setCurrentFrame:function(e){return this.set("currentFrame",e)},getCurrentFrame:function(){return this.get("currentFrame")},getCurrentFrameModel:function(){return(this.getCurrentFrame()||{}).model},getDirtyCount:function(){return this.get("changesCount")},getZoomDecimal:function(){return this.get("Canvas").getZoomDecimal()},getZoomMultiplier:function(){return this.get("Canvas").getZoomMultiplier()},setDragMode:function(e){return this.set("dmode",e)},t:function(){var e;return(e=this.get("I18n")).t.apply(e,arguments)},inAbsoluteMode:function(){return"absolute"===this.get("dmode")},destroyAll:function(){var e=this.attributes,t=e.DomComponents,n=e.CssComposer,r=e.UndoManager,i=e.Panels,o=e.Canvas,s=e.Keymaps,a=e.RichTextEditor;t.clear(),n.clear(),r.clear().removeAll(),i.getPanels().reset(),o.getCanvasView().remove(),s.removeAll(),a.destroy(),this.view.remove(),this.stopListening(),Object(l["default"])(this.config.el).empty().attr(this.attrsOrig)},setEditing:function(e){return this.set("editing",e),this},isEditing:function(){return!!this.get("editing")},log:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.ns,r=t.level,i=void 0===r?"debug":r;if(this.trigger("log",e,t),i&&this.trigger("log:".concat(i),e,t),n){var o="log-".concat(n);this.trigger(o,e,t),i&&this.trigger("".concat(o,":").concat(i),e,t)}},logInfo:function(e,t){this.log(e,i({},t,{level:"info"}))},logWarning:function(e,t){this.log(e,i({},t,{level:"warning"}))},logError:function(e,t){this.log(e,i({},t,{level:"error"}))},initBaseColorPicker:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getConfig(),r=n.colorPicker,o=void 0===r?{}:r,s=n.el,a=n.stylePrefix;return Object(l["default"])(e).spectrum(i({containerClassName:"".concat(a,"one-bg ").concat(a,"two-color"),appendTo:s||"body",maxSelectionSize:8,showPalette:!0,palette:[],showAlpha:!0,chooseText:"Ok",cancelText:"⨯"},t,{},o))},data:function(e,t,n){var r="_gjs-data";return e[r]||(e[r]={}),Object(a.isUndefined)(n)?e[r][t]:void(e[r][t]=n)}})},"./src/editor/view/EditorView.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=n("./src/utils/mixins.js"),s=i.a.$;t["default"]=i.a.View.extend({initialize:function(){var e=this,t=this.model;t.view=this,this.conf=t.config,this.pn=t.get("Panels"),this.cv=t.get("Canvas"),t.on("loaded",function(){e.pn.active(),e.pn.disableButtons(),setTimeout(function(){t.runDefault(),t.trigger("load",t.get("Editor"))})})},render:function(){var e=(this.model,this.$el),t=this.conf,n=t.stylePrefix,r=s(t.el||"body ".concat(t.container));return Object(o.appendStyles)(t.cssIcons,{unique:1,prepand:1}),e.empty(),t.width&&r.css("width",t.width),t.height&&r.css("height",t.height),e.append(this.cv.render()),e.append(this.pn.render()),e.attr("class","".concat(n,"editor ").concat(n,"one-bg ").concat(n,"two-color")),r.addClass("".concat(n,"editor-cont")).empty().append(e),this}})},"./src/i18n/config.js":function(e,t,n){"use strict";n.r(t);var r=n("./src/i18n/locale/en.js");t["default"]={locale:"en",localeFallback:"en",detectLocale:1,debug:0,messages:{en:r["default"]}}},"./src/i18n/index.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./node_modules/@babel/runtime/helpers/typeof.js"),l=n.n(a),c=n("./node_modules/underscore/underscore.js"),u=(n.n(c),n("./src/i18n/config.js")),d=function(e){return!Array.isArray(e)&&null!==e&&"object"===l()(e)},h=function f(){for(var e=i({},arguments.length<=0?void 0:arguments[0]),t=1;t<arguments.length;t++){var n=i({},t<0||arguments.length<=t?void 0:arguments[t]);for(var r in n){var o=e[r],s=n[r];d(o)&&d(s)?e[r]=f(o,s):e[r]=s}}return e};t["default"]=function(){return{name:"I18n",config:u["default"],init:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.config=i({},u["default"],{},e,{messages:i({},u["default"].messages,{},e.messages||{})}),this.config.detectLocale&&(this.config.locale=this._localLang()),this.em=e.em,this},getConfig:function(){return this.config},setLocale:function(e){var t=this.em,n=this.config,r={value:e,valuePrev:n.locale};return t&&t.trigger("i18n:locale",r),n.locale=e,this},getLocale:function(){return this.config.locale},getMessages:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.config.messages;return e&&!n[e]&&this._debug("'".concat(e,"' i18n lang not found"),t),e?n[e]:n},setMessages:function(e){var t=this.em,n=this.config;return n.messages=e,t&&t.trigger("i18n:update",e),this},addMessages:function(e){var t=this.em,n=this.config.messages;return t&&t.trigger("i18n:add",e),this.setMessages(h(n,e)),this},t:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.config,r=t.params||{},i=t.l||this.getLocale(),o=t.lFlb||n.localeFallback,s=this._getMsg(e,i,t);return s||(s=this._getMsg(e,o,t)),!s&&this._debug("'".concat(e,"' i18n key not found in '").concat(i,"' lang"),t),s=s&&Object(c.isString)(s)?this._addParams(s,r):s},_localLang:function(){var e=window.navigator||{},t=e.language||e.userLanguage;return t?t.split("-")[0]:"en"},_addParams:function(e,t){var n=new RegExp("{([\\w\\d-]*)}","g");return e.replace(n,function(e,n){return t[n]||""}).trim()},_getMsg:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.getMessages(t,n);if(r){var i=r[e];return!i&&e.indexOf(".")>0&&(i=e.split(".").reduce(function(e,t){if(!Object(c.isUndefined)(e))return e[t]},r)),i}},_debug:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.em,r=this.config;(t.debug||r.debug)&&n&&n.logWarning(e)}}}},"./src/i18n/locale/en.js":function(e,t,n){"use strict";n.r(t);var r={placeholder:"eg. Text here"};t["default"]={assetManager:{addButton:"Add image",inputPlh:"http://path/to/the/image.jpg",modalTitle:"Select Image",uploadTitle:"Drop files here or click to upload"},blockManager:{labels:{},categories:{}},domComponents:{names:{"":"Box",wrapper:"Body",text:"Text",comment:"Comment",image:"Image",video:"Video",label:"Label",link:"Link",map:"Map",tfoot:"Table foot",tbody:"Table body",thead:"Table head",table:"Table",row:"Table row",cell:"Table cell"}},deviceManager:{device:"Device",devices:{desktop:"Desktop",tablet:"Tablet",mobileLandscape:"Mobile Landscape",mobilePortrait:"Mobile Portrait"}},panels:{buttons:{titles:{preview:"Preview",fullscreen:"Fullscreen","sw-visibility":"View components","export-template":"View code","open-sm":"Open Style Manager","open-tm":"Settings","open-layers":"Open Layer Manager","open-blocks":"Open Blocks"}}},selectorManager:{label:"Classes",selected:"Selected",emptyState:"- State -",states:{hover:"Hover",active:"Click","nth-of-type(2n)":"Even/Odd"}},styleManager:{empty:"Select an element before using Style Manager",layer:"Layer",fileButton:"Images",sectors:{general:"General",layout:"Layout",typography:"Typography",decorations:"Decorations",extra:"Extra",flex:"Flex",dimension:"Dimension"},properties:{}},traitManager:{empty:"Select an element before using Trait Manager",label:"Component settings",traits:{labels:{},attributes:{id:r,alt:r,title:r,href:{placeholder:"eg. https://google.com"}},options:{target:{"false":"This window",_blank:"New window"}}}}}},"./src/index.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./node_modules/cash-dom/dist/cash.esm.js"),l=n("./src/editor/index.js"),c=n("./node_modules/underscore/underscore.js"),u=(n.n(c),n("./src/utils/polyfills.js")),d=n("./src/plugin_manager/index.js");Object(u["default"])();var h=new d["default"],f=[],p={autorender:1,plugins:[],pluginsOpts:{}};t["default"]={$:a["default"],editors:f,plugins:h,version:"0.16.3",init:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.container;if(!t)throw new Error("'container' is required");e=i({},p,{},e),e.el=Object(c.isElement)(t)?t:document.querySelector(t);var n=new l["default"](e).init();return e.plugins.forEach(function(t){var r=h.get(t),i=e.pluginsOpts[t]||{};if(!r){var o=window[t];r=o&&o["default"]?o["default"]:o}r?r(n,i):Object(c.isFunction)(t)?t(n,i):console.warn("Plugin ".concat(t," not found"))}),n.getModel().loadOnStart(),e.autorender&&n.render(),f.push(n),n}}},"./src/keymaps/index.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){l()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/typeof.js"),s=n.n(o),a=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),l=n.n(a),c=n("./node_modules/underscore/underscore.js"),u=(n.n(c),n("./node_modules/keymaster/keymaster.js")),d=n.n(u);t["default"]=function(){var e,t,n={},r={defaults:{"core:undo":{keys:"⌘+z, ctrl+z",handler:"core:undo"},"core:redo":{keys:"⌘+shift+z, ctrl+shift+z",handler:"core:redo"},"core:copy":{keys:"⌘+c, ctrl+c",handler:"core:copy"},"core:paste":{keys:"⌘+v, ctrl+v",handler:"core:paste"},"core:component-next":{keys:"s",handler:"core:component-next"},"core:component-prev":{keys:"w",handler:"core:component-prev"},"core:component-enter":{keys:"d",handler:"core:component-enter"},"core:component-exit":{keys:"a",handler:"core:component-exit"},"core:component-delete":{keys:"backspace, delete",handler:"core:component-delete"}}};return{keymaster:d.a,name:"Keymaps",getConfig:function(){return t},init:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=i({},r,{},n),e=t.em,this.em=e,this},onLoad:function(){var e=t.defaults;for(var n in e){var r=e[n];this.add(n,r.keys,r.handler)}},add:function(e,t,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=this.em,a=o.get("Commands"),l=o.getEditor(),u=o.get("Canvas"),h={id:e,keys:t,handler:r},f=n[e];return f&&this.remove(e),n[e]=h,d()(t,function(t,n){var d={event:t,h:n};r=Object(c.isString)(r)?a.get(r):r,i.prevent&&u.getCanvasView().preventDefault(t);var h=!o.isEditing()&&!l.Canvas.isInputFocused();if(h||i.force){"object"==s()(r)?r.run(l,0,d):r(l,0,d);var f=[e,n.shortcut,t];o.trigger.apply(o,["keymap:emit"].concat(f)),o.trigger.apply(o,["keymap:emit:".concat(e)].concat(f))}}),o.trigger("keymap:add",h),h},get:function(e){return n[e]},getAll:function(){return n},remove:function(e){var t=this.em,r=this.get(e);if(r)return delete n[e],d.a.unbind(r.keys),t&&t.trigger("keymap:remove",r),r},removeAll:function(){var e=this;return Object.keys(n).forEach(function(t){return e.remove(t)}),this}}}},"./src/modal_dialog/config/config.js":function(e,t,n){"use strict";n.r(t),t["default"]={stylePrefix:"mdl-",title:"",content:"",backdrop:!0}},"./src/modal_dialog/index.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./src/modal_dialog/config/config.js"),l=n("./src/modal_dialog/model/Modal.js"),c=n("./src/modal_dialog/view/ModalView.js");t["default"]=function(){var e,t,n={},r=function(e,t){t&&t.trigger("modal:".concat(e?"open":"close"))};return{name:"Modal",getConfig:function(){return n},init:function(){var o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};n=i({},a["default"],{},o);var s=n.em;this.em=s;var u=n.pStylePrefix;return u&&(n.stylePrefix=u+n.stylePrefix),e=new l["default"](n),e.on("change:open",function(e,t){return r(t,s)}),t=new c["default"]({model:e,config:n}),this},postRender:function(e){var t=e.model.getConfig().el||e.el;this.render().appendTo(t)},open:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.title&&this.setTitle(e.title),e.content&&this.setContent(e.content),t.show(),this},close:function(){return t.hide(),this},onceClose:function(e){return this.em.once("modal:close",e),this},onceOpen:function(e){return this.em.once("modal:open",e),this},isOpen:function(){return!!e.get("open")},setTitle:function(t){return e.set("title",t),this},getTitle:function(){return e.get("title")},setContent:function(t){return e.set("content"," "),e.set("content",t),this},getContent:function(){return e.get("content")},getContentEl:function(){return t.getContent().get(0)},getModel:function(){return e},render:function(){return t.render().$el}}}},"./src/modal_dialog/model/Modal.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r);t["default"]=i.a.Model.extend({defaults:{title:"",content:"",open:!1}})},"./src/modal_dialog/view/ModalView.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r);t["default"]=i.a.View.extend({template:function(e){var t=e.pfx,n=e.ppfx,r=e.content,i=e.title;return'<div class="'.concat(t,"dialog ").concat(n,"one-bg ").concat(n,'two-color">\n <div class="').concat(t,'header">\n <div class="').concat(t,'title">').concat(i,'</div>\n <div class="').concat(t,'btn-close" data-close-modal>⨯</div>\n </div>\n <div class="').concat(t,'content">\n <div id="').concat(t,'c">').concat(r,'</div>\n <div style="clear:both"></div>\n </div>\n </div>\n <div class="').concat(t,'collector" style="display: none"></div>')},events:{click:"onClick","click [data-close-modal]":"hide"},initialize:function(e){var t=this.model,n=e.config||{},r=n.stylePrefix||"";this.config=n,this.pfx=r,this.ppfx=n.pStylePrefix||"",this.listenTo(t,"change:open",this.updateOpen),this.listenTo(t,"change:title",this.updateTitle),this.listenTo(t,"change:content",this.updateContent)},onClick:function(e){var t=this.config.backdrop;t&&e.target===this.el&&this.hide()},getCollector:function(){return this.$collector||(this.$collector=this.$el.find("."+this.pfx+"collector")),this.$collector},getContent:function(){var e=this.pfx;return this.$content||(this.$content=this.$el.find(".".concat(e,"content #").concat(e,"c"))),this.$content},getTitle:function(){return this.$title||(this.$title=this.$el.find("."+this.pfx+"title")),this.$title.get(0)},updateContent:function(){var e=this.getContent(),t=e.children(),n=this.getCollector(),r=this.model.get("content");t.length&&n.append(t),e.empty().append(r)},updateTitle:function(){var e=this.getTitle();e&&(e.innerHTML=this.model.get("title"))},updateOpen:function(){this.el.style.display=this.model.get("open")?"":"none"},hide:function(){this.model.set("open",0)},show:function(){this.model.set("open",1)},render:function(){var e=this.$el,t=this.pfx,n=(this.ppfx,this.model.toJSON());return n.pfx=this.pfx,n.ppfx=this.ppfx,e.html(this.template(n)),e.attr("class","".concat(t,"container")),this.updateOpen(),this}})},"./src/navigator/config/config.js":function(e,t,n){"use strict";n.r(t),t["default"]={stylePrefix:"",appendTo:"",sortable:1,hidable:1,hideTextnode:1,root:"",showWrapper:1,showHover:1,scrollCanvas:{behavior:"smooth",block:"nearest"},scrollLayers:{behavior:"auto",block:"nearest"},highlightHover:1}},"./src/navigator/index.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./src/navigator/config/config.js"),l=n("./src/navigator/view/ItemView.js"),c=n("./node_modules/underscore/underscore.js");n.n(c);t["default"]=function(){var e,t,n={};return{name:"LayerManager",init:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n=i({},a["default"],{},t),n.stylePrefix=t.pStylePrefix,e=n.em,this},getConfig:function(){return n},onLoad:function(){t=new l["default"]({level:0,config:n,opened:n.opened||{},model:e.get("DomComponents").getWrapper()}),e&&e.on("component:selected",this.componentChanged),this.componentChanged()},postRender:function(){var e=n.appendTo,t=n.root;if(t&&this.setRoot(t),e){var r=Object(c.isElement)(e)?e:document.querySelector(e);r.appendChild(this.render())}},setRoot:function(e){return t.setRoot(e),this},getRoot:function(){return t.model},getAll:function(){return t},componentChanged:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!r.fromLayers){var i=e.get("opened"),o=e.getSelected(),s=n.scrollLayers,a=o&&o.collection?o.collection.parent:null;for(var l in i)i[l].set("open",0);for(;a;)a.set("open",1),i[a.cid]=a,a=a.collection?a.collection.parent:null;if(o&&s){var c=o.viewLayer&&o.viewLayer.el;c&&c.scrollIntoView(s)}}},render:function(){return t.render().el}}}},"./src/navigator/view/ItemView.js":function(e,t,n){"use strict";n.r(t);var r,i=n("./node_modules/underscore/underscore.js"),o=(n.n(i),n("./src/utils/mixins.js")),s=n("./node_modules/backbone/backbone.js"),a=n.n(s),l=n("./src/dom_components/view/ComponentView.js"),c=n("./src/dom_components/model/Component.js"),u="contentEditable",d=a.a.$;t["default"]=a.a.View.extend({events:{"mousedown [data-toggle-move]":"startSort","touchstart [data-toggle-move]":"startSort","click [data-toggle-visible]":"toggleVisibility","click [data-toggle-select]":"handleSelect","mouseover [data-toggle-select]":"handleHover","click [data-toggle-open]":"toggleOpening","dblclick [data-name]":"handleEdit","focusout [data-name]":"handleEditEnd"},template:function(e){var t=this.pfx,n=this.ppfx,r=this.config,i=this.clsNoEdit,o=r.hidable,s=this.countChildren(e),a=s?"":this.clsNoChild,l="".concat(this.clsTitle," ").concat(a),c="".concat(this.clsTitleC," ").concat(n,"one-bg"),u="".concat(this.clsCaret," fa fa-chevron-right"),d="".concat(this.inputNameCls," ").concat(i," ").concat(n,"no-app"),h=this.level+1,f="".concat(30+10*h,"px"),p=e.getName(),g=e.getIcon(),m="".concat(t,"layer");return"\n ".concat(o?'<i class="'.concat(t,"layer-vis fa fa-eye ").concat(this.isVisible()?"":"fa-eye-slash",'" data-toggle-visible></i>'):"",'\n <div class="').concat(c,'">\n <div class="').concat(l,'" style="padding-left: ').concat(f,'" data-toggle-select>\n <div class="').concat(t,'layer-title-inn">\n <i class="').concat(u,'" data-toggle-open></i>\n ').concat(g?'<span class="'.concat(m,'__icon">').concat(g,"</span>"):"",'\n <span class="').concat(d,'" data-name>').concat(p,'</span>\n </div>\n </div>\n </div>\n <div class="').concat(this.clsCount,'" data-count>').concat(s||"",'</div>\n <div class="').concat(this.clsMove,'" data-toggle-move>\n <i class="fa fa-arrows"></i>\n </div>\n <div class="').concat(this.clsChildren,'"></div>')},initialize:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.opt=e,this.level=e.level,this.config=e.config,this.em=e.config.em,this.ppfx=this.em.get("Config").stylePrefix,this.sorter=e.sorter||"",this.pfx=this.config.stylePrefix,this.parentView=e.parentView;var t=this.pfx,n=this.ppfx,r=this.model,i=r.get("components"),o=r.get("type")||"default";r.set("open",!1),this.listenTo(i,"remove add reset",this.checkChildren),this.listenTo(r,"change:status",this.updateStatus),this.listenTo(r,"change:open",this.updateOpening),this.listenTo(r,"change:layerable",this.updateLayerable),this.listenTo(r,"change:style:display",this.updateVisibility),this.className="".concat(t,"layer ").concat(t,"layer__t-").concat(o," no-select ").concat(n,"two-color"),this.inputNameCls="".concat(n,"layer-name"),this.clsTitleC="".concat(t,"layer-title-c"),this.clsTitle="".concat(t,"layer-title"),this.clsCaret="".concat(t,"layer-caret"),this.clsCount="".concat(t,"layer-count"),this.clsMove="".concat(t,"layer-move"),this.clsChildren="".concat(t,"layer-children"),this.clsNoChild="".concat(t,"layer-no-chld"),this.clsEdit="".concat(this.inputNameCls,"--edit"),this.clsNoEdit="".concat(this.inputNameCls,"--no-edit"),this.$el.data("model",r),this.$el.data("collection",i),r.viewLayer=this},getVisibilityEl:function(){return this.eyeEl||(this.eyeEl=this.$el.children(".".concat(this.pfx,"layer-vis"))),this.eyeEl},updateVisibility:function(){var e=this.pfx,t=this.model,n="".concat(e,"layer-hidden"),r="fa-eye-slash",i="none"==t.getStyle().display,o=i?"addClass":"removeClass";this.$el[o](n),this.getVisibilityEl()[o](r)},toggleVisibility:function(e){e&&e.stopPropagation();var t=this.model,n="__prev-display",r=t.get(n),i=t.getStyle(),o=i.display,s="none"==o;s?(delete i.display,r&&(i.display=r,t.unset(n))):(o&&t.set(n,o),i.display="none"),t.setStyle(i)},handleEdit:function(e){e&&e.stopPropagation();var t=this.em,n=this.$el,r=this.clsNoEdit,i=this.clsEdit,o=this.getInputName();o[u]=!0,o.focus(),t&&t.setEditing(1),n.find(".".concat(this.inputNameCls)).removeClass(r).addClass(i)},handleEditEnd:function(e){e&&e.stopPropagation();var t=this.em,n=this.$el,r=this.clsNoEdit,i=this.clsEdit,o=this.getInputName(),s=o.textContent;o.scrollLeft=0,o[u]=!1,this.model.set({"custom-name":s}),t&&t.setEditing(0),n.find(".".concat(this.inputNameCls)).addClass(r).removeClass(i)},getInputName:function(){return this.inputName||(this.inputName=this.el.querySelector(".".concat(this.inputNameCls))),this.inputName},updateOpening:function(){var e=this.opt.opened||{},t=this.model,n="fa-chevron-down";t.get("open")?(this.$el.addClass("open"),this.getCaret().addClass(n),e[t.cid]=t):(this.$el.removeClass("open"),this.getCaret().removeClass(n),delete e[t.cid])},toggleOpening:function(e){e.stopPropagation(),this.model.get("components").length&&this.model.set("open",!this.model.get("open"))},handleSelect:function(e){e.stopPropagation();var t=this.em,n=this.config;if(t){var r=this.model;t.setSelected(r,{fromLayers:1});var i=n.scrollCanvas;i&&r.views.forEach(function(e){return e.scrollIntoView(i)})}},handleHover:function(e){e.stopPropagation();var t=this.em,n=this.config,r=this.model;t&&n.showHover&&t.setHovered(r,{fromLayers:1})},startSort:function(e){e.stopPropagation();var t=this.em,n=this.sorter;e.button&&0!==e.button||n&&(n.onStart=function(e){return t.trigger("".concat(c.eventDrag,":start"),e)},n.onMoveClb=function(e){return t.trigger(c.eventDrag,e)},n.startSort(e.target))},freeze:function(){this.$el.addClass(this.pfx+"opac50"),this.model.set("open",0)},unfreeze:function(){this.$el.removeClass(this.pfx+"opac50")},updateStatus:function(e){l["default"].prototype.updateStatus.apply(this,[{avoidHover:!this.config.highlightHover}])},isVisible:function(){var e=this.model.get("style"),t=e.display;if(!t||"none"!=t)return 1},checkChildren:function(){var e=this.model,t=this.clsNoChild,n=this.countChildren(e),r=this.$el.children(".".concat(this.clsTitleC)).children(".".concat(this.clsTitle)),i=this.cnt;i||(i=this.$el.children("[data-count]").get(0),this.cnt=i),r[n?"removeClass":"addClass"](t),i&&(i.innerHTML=n||""),!n&&e.set("open",0)},countChildren:function(e){var t=0;return e.get("components").each(function(e){var n=this.opt.isCountable,r=this.config.hideTextnode;n&&!n(e,r)||t++},this),t},getCaret:function(){if(!this.caret||!this.caret.length){this.pfx;this.caret=this.$el.children(".".concat(this.clsTitleC)).find(".".concat(this.clsCaret))}return this.caret},setRoot:function(e){e=Object(i.isString)(e)?this.em.getWrapper().find(e)[0]:e;var t=Object(o.getModel)(e,d);t&&(this.stopListening(),this.model=t,this.initialize(this.opt),this.render())},updateLayerable:function(){var e=this.parentView,t=e||this;t.render()},render:function(){var e=this.model,t=this.config,o=this.pfx,s=this.ppfx,a=this.opt,l=a.isCountable,c=l&&!l(e,t.hideTextnode),u=this.isVisible(),d=this.$el.empty(),h=this.level+1;Object(i.isUndefined)(r)&&(r=n("./src/navigator/view/ItemsView.js")["default"]);var f=new r({collection:e.get("components"),config:this.config,sorter:this.sorter,opened:this.opt.opened,parentView:this,parent:e,level:h}).render().$el;return this.config.showWrapper||1!==h?(d.html(this.template(e)),d.find(".".concat(this.clsChildren)).append(f)):d.append(f),e.get("draggable")&&this.config.sortable||d.children(".".concat(this.clsMove)).remove(),!u&&(this.className+=" ".concat(o,"hide")),c&&(this.className+=" ".concat(s,"hidden")),d.attr("class",this.className),this.updateOpening(),this.updateStatus(),this.updateVisibility(),this}})},"./src/navigator/view/ItemsView.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=n("./src/navigator/view/ItemView.js"),s=n("./src/dom_components/model/Component.js");t["default"]=i.a.View.extend({initialize:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.opt=e;var t=e.config||{};this.level=e.level,this.config=t,this.preview=e.preview,this.ppfx=t.pStylePrefix||"",this.pfx=t.stylePrefix||"",this.parent=e.parent,this.parentView=e.parentView;var n=this.pfx,r=this.ppfx,i=this.parent,o=this.collection;this.listenTo(o,"add",this.addTo),this.listenTo(o,"reset resetNavigator",this.render),this.listenTo(o,"remove",this.removeChildren),this.className="".concat(n,"layers");var a=t.em;if(t.sortable&&!this.opt.sorter){var l=a.get("Utils");this.opt.sorter=new l.Sorter({container:t.sortContainer||this.el,
|
||
containerSel:".".concat(this.className),itemSel:".".concat(n,"layer"),ignoreViewChildren:1,onEndMove:function(e,t,n){var r=t.getSourceModel();a.setSelected(r,{forceChange:1}),a.trigger("".concat(s.eventDrag,":end"),n)},avoidSelectOnEnd:1,nested:1,ppfx:r,pfx:n})}this.sorter=this.opt.sorter||"",this.$el.data("collection",o),i&&this.$el.data("model",i)},removeChildren:function(e){var t=e.viewLayer;t&&t.remove.apply(t)},addTo:function(e){var t=this.collection.indexOf(e);this.addToCollection(e,null,t)},addToCollection:function(e,t,n){var r=this.level,i=this.parentView,s=t||null,a=o["default"],l=new a({level:r,model:e,parentView:i,config:this.config,sorter:this.sorter,isCountable:this.isCountable,opened:this.opt.opened}),c=l.render().el;if(s)s.appendChild(c);else if("undefined"!=typeof n){var u="before";this.$el.children().length==n&&(n--,u="after"),n<0?this.$el.append(c):this.$el.children().eq(n)[u](c)}else this.$el.append(c);return c},isCountable:function(e,t){var n=e.get("type"),r=e.get("tagName");return!(("textnode"==n||"br"==r)&&t||!e.get("layerable"))},render:function(){var e=this,t=document.createDocumentFragment(),n=this.el;return n.innerHTML="",this.collection.each(function(n){return e.addToCollection(n,t)}),n.appendChild(t),n.className=this.className,this}})},"./src/panels/config/config.js":function(e,t,n){"use strict";n.r(t);var r="sw-visibility",i="export-template",o="open-sm",s="open-tm",a="open-layers",l="open-blocks",c="fullscreen",u="preview";t["default"]={stylePrefix:"pn-",defaults:[{id:"commands",buttons:[{}]},{id:"options",buttons:[{active:!0,id:r,className:"fa fa-square-o",command:r,context:r,attributes:{title:"View components"}},{id:u,className:"fa fa-eye",command:u,context:u,attributes:{title:"Preview"}},{id:c,className:"fa fa-arrows-alt",command:c,context:c,attributes:{title:"Fullscreen"}},{id:i,className:"fa fa-code",command:i,attributes:{title:"View code"}}]},{id:"views",buttons:[{id:o,className:"fa fa-paint-brush",command:o,active:!0,togglable:0,attributes:{title:"Open Style Manager"}},{id:s,className:"fa fa-cog",command:s,togglable:0,attributes:{title:"Settings"}},{id:a,className:"fa fa-bars",command:a,togglable:0,attributes:{title:"Open Layer Manager"}},{id:l,className:"fa fa-th-large",command:l,togglable:0,attributes:{title:"Open Blocks"}}]}],em:null,delayBtnsShow:300}},"./src/panels/index.js":function(e,t,n){"use strict";n.r(t);var r=n("./src/panels/config/config.js"),i=n("./src/panels/model/Panel.js"),o=n("./src/panels/model/Panels.js"),s=(n("./src/panels/view/PanelView.js"),n("./src/panels/view/PanelsView.js"));t["default"]=function(){var e,t,n={};return{name:"Panels",init:function(i){n=i||{};for(var a in r["default"])a in n||(n[a]=r["default"][a]);var l=n.pStylePrefix;return l&&(n.stylePrefix=l+n.stylePrefix),e=new o["default"](n.defaults),t=new s["default"]({collection:e,config:n}),this},getPanels:function(){return e},getPanelsEl:function(){return t.el},addPanel:function(t){return e.add(t)},removePanel:function(t){return e.remove(t)},getPanel:function(t){var n=e.where({id:t});return n.length?n[0]:null},addButton:function(e,t){var n=this.getPanel(e);return n?n.get("buttons").add(t):null},removeButton:function(e,t){var n=this.getPanel(e);return n&&n.get("buttons").remove(t)},getButton:function(e,t){var n=this.getPanel(e);if(n){var r=n.get("buttons").where({id:t});return r.length?r[0]:null}return null},render:function(){return t.render().el},active:function(){this.getPanels().each(function(e){e.get("buttons").each(function(e){e.get("active")&&e.trigger("updateActive")})})},disableButtons:function(){this.getPanels().each(function(e){e.get("buttons").each(function(e){e.get("disable")&&e.trigger("change:disable")})})},Panel:i["default"]}}},"./src/panels/model/Button.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r);t["default"]=i.a.Model.extend({defaults:{id:"",label:"",tagName:"span",className:"",command:"",context:"",buttons:[],attributes:{},options:{},active:!1,dragDrop:!1,togglable:!0,runDefaultCommand:!0,stopDefaultCommand:!1,disable:!1},initialize:function(e){if(this.get("buttons").length){var t=n("./src/panels/model/Buttons.js")["default"];this.set("buttons",new t(this.get("buttons")))}}})},"./src/panels/model/Buttons.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=n("./src/panels/model/Button.js");t["default"]=i.a.Collection.extend({model:o["default"],deactivateAllExceptOne:function(e,t){this.forEach(function(n,r){n!==e&&(n.set("active",!1),t&&n.get("buttons").length&&n.get("buttons").deactivateAllExceptOne(e,t))})},deactivateAll:function(e,t){var n=e||"";this.forEach(function(e){e.get("context")==n&&e!==t&&(e.set("active",!1,{silent:1}),e.trigger("updateActive",{fromCollection:1}))})},disableAllButtons:function(e){var t=e||"";this.forEach(function(e,n){e.get("context")==t&&e.set("disable",!0)})},disableAllButtonsExceptOne:function(e,t){this.forEach(function(n,r){n!==e&&(n.set("disable",!0),t&&n.get("buttons").length&&n.get("buttons").disableAllButtonsExceptOne(e,t))})}})},"./src/panels/model/Panel.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=n("./src/panels/model/Buttons.js");t["default"]=i.a.Model.extend({defaults:{id:"",content:"",visible:!0,buttons:[],attributes:{}},initialize:function(e){this.btn=this.get("buttons")||[],this.buttons=new o["default"](this.btn),this.set("buttons",this.buttons)}})},"./src/panels/model/Panels.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=n("./src/panels/model/Panel.js");t["default"]=i.a.Collection.extend({model:o["default"]})},"./src/panels/view/ButtonView.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./node_modules/backbone/backbone.js"),l=n.n(a),c=n("./node_modules/underscore/underscore.js");n.n(c),l.a.$;t["default"]=l.a.View.extend({tagName:function(){return this.model.get("tagName")},events:{click:"clicked"},initialize:function(e){var t=this.model.get("className");this.config=e.config||{},this.em=this.config.em||{};var n=this.config.stylePrefix||"",r=this.config.pStylePrefix||"";this.pfx=n,this.ppfx=this.config.pStylePrefix||"",this.id=n+this.model.get("id"),this.activeCls="".concat(n,"active ").concat(r,"four-color"),this.disableCls="".concat(r,"disabled"),this.btnsVisCls="".concat(n,"visible"),this.className=n+"btn"+(t?" "+t:""),this.listenTo(this.model,"change",this.render),this.listenTo(this.model,"change:active updateActive",this.updateActive),this.listenTo(this.model,"checkActive",this.checkActive),this.listenTo(this.model,"change:bntsVis",this.updateBtnsVis),this.listenTo(this.model,"change:attributes",this.updateAttributes),this.listenTo(this.model,"change:className",this.updateClassName),this.listenTo(this.model,"change:disable",this.updateDisable),this.em&&this.em.get&&(this.commands=this.em.get("Commands"))},updateClassName:function(){var e=this.model,t=this.pfx,n=e.get("className"),r=e.get("attributes")["class"],i="".concat(r?r:""," ").concat(t,"btn ").concat(n?n:"");this.$el.attr("class",i.trim())},updateAttributes:function(){var e=this.em,t=this.model,n=this.$el,r=t.get("attributes")||{},i=e&&e.t&&e.t("panels.buttons.titles.".concat(t.id));n.attr(r),i&&n.attr({title:i}),this.updateClassName()},updateBtnsVis:function(){this.$buttons&&(this.model.get("bntsVis")?this.$buttons.addClass(this.btnsVisCls):this.$buttons.removeClass(this.btnsVisCls))},updateActive:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.model,n=this.commands,r=this.$el,o=this.activeCls,s=e.fromCollection,a=t.get("context"),l=t.get("options"),u=t.get("command"),d={};n&&Object(c.isString)(u)?d=n.get(u)||{}:Object(c.isFunction)(u)?d=n.create({run:u}):null!==u&&Object(c.isObject)(u)&&(d=n.create(u)),t.get("active")?(!s&&t.collection.deactivateAll(a,t),t.set("active",!0,{silent:!0}).trigger("checkActive"),n.runCommand(d,i({},l,{sender:t})),d.noStop&&t.set("active",!1)):(r.removeClass(o),n.stopCommand(d,i({},l,{sender:t,force:1})))},updateDisable:function(){var e=this.disableCls,t=this.model,n=t.get("disable");this.$el[n?"addClass":"removeClass"](e)},checkActive:function(){var e=this.model,t=this.$el,n=this.activeCls;e.get("active")?t.addClass(n):t.removeClass(n)},clicked:function(e){this.model.get("bntsVis")||this.model.get("disable")||this.toggleActive()},toggleActive:function(){var e=this.model,t=e.attributes,n=t.active,r=t.togglable;if(!n||r){e.set("active",!n);this.em.get("Commands").get("select-comp");n?e.get("runDefaultCommand")&&this.em.runDefault():e.get("stopDefaultCommand")&&this.em.stopDefault()}},render:function(){var e=this.model.get("label"),t=this.$el;return t.empty(),this.updateAttributes(),e&&t.append(e),this.checkActive(),this.updateDisable(),this}})},"./src/panels/view/ButtonsView.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=n("./src/panels/view/ButtonView.js"),s=n("./node_modules/underscore/underscore.js");n.n(s);t["default"]=i.a.View.extend({initialize:function(e){this.opt=e||{},this.config=this.opt.config||{},this.pfx=this.config.stylePrefix||"",this.parentM=this.opt.parentM||null,this.listenTo(this.collection,"add",this.addTo),this.listenTo(this.collection,"reset remove",this.render),this.className=this.pfx+"buttons"},addTo:function(e){this.addToCollection(e)},addToCollection:function(e,t){var n=t||null,r=o["default"],i=new r({model:e,config:this.config,parentM:this.parentM}),s=i.render().el;return n?n.appendChild(s):this.$el.append(s),s},render:function(){var e=document.createDocumentFragment();return this.$el.empty(),this.collection.each(function(t){this.addToCollection(t,e)},this),this.$el.append(e),this.$el.attr("class",Object(s.result)(this,"className")),this}})},"./src/panels/view/PanelView.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./node_modules/backbone/backbone.js"),l=n.n(a),c=n("./src/panels/view/ButtonsView.js");t["default"]=l.a.View.extend({initialize:function(e){var t=e.config||{},n=this.model;this.config=t,this.pfx=t.stylePrefix||"",this.ppfx=t.pStylePrefix||"",this.buttons=n.get("buttons"),this.className=this.pfx+"panel",this.id=this.pfx+n.get("id"),this.listenTo(n,"change:appendContent",this.appendContent),this.listenTo(n,"change:content",this.updateContent),this.listenTo(n,"change:visible",this.toggleVisible),n.view=this},appendContent:function(){this.$el.append(this.model.get("appendContent"))},updateContent:function(){this.$el.html(this.model.get("content"))},toggleVisible:function(){return this.model.get("visible")?void this.$el.removeClass("".concat(this.ppfx,"hidden")):void this.$el.addClass("".concat(this.ppfx,"hidden"))},attributes:function(){return this.model.get("attributes")},initResize:function(){var e=this.config.em,t=e?e.get("Editor"):"",n=this.model.get("resizable");if(t&&n){var r,o,s,a=n===!0?[1,1,1,1]:n,l=a.length,c=0;2==l?(r=a[0],s=a[0],o=a[1],c=a[1]):4==l&&(r=a[0],o=a[1],s=a[2],c=a[3]);var u=t.Utils.Resizer.init(i({tc:r,cr:o,bc:s,cl:c,tl:0,tr:0,bl:0,br:0,appendTo:this.el,silentFrames:1,avoidContainerUpdate:1,prefix:t.getConfig().stylePrefix,onEnd:function(){e&&e.trigger("change:canvasOffset")},posFetcher:function(e,t){var n=t.target,r=e.style,i=u.getConfig(),o=i.keyWidth,s=i.keyHeight,a=e.getBoundingClientRect(),l="container"==n,c=r[o],d=r[s],h=c&&!l?parseFloat(c):a.width,f=d&&!l?parseFloat(d):a.height;return{left:0,top:0,width:h,height:f}}},n));u.blur=function(){},u.focus(this.el)}},render:function(){var e=this.$el,t=this.ppfx,n="".concat(this.className," ").concat(this.id," ").concat(t,"one-bg ").concat(t,"two-color");if(e.addClass(n),this.buttons.length){var r=new c["default"]({collection:this.buttons,config:this.config});e.append(r.render().el)}return e.append(this.model.get("content")),this}})},"./src/panels/view/PanelsView.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=n("./src/panels/view/PanelView.js");t["default"]=i.a.View.extend({initialize:function(e){this.opt=e||{},this.config=this.opt.config||{},this.pfx=this.config.stylePrefix||"";var t=this.collection;this.listenTo(t,"add",this.addTo),this.listenTo(t,"reset",this.render),this.listenTo(t,"remove",this.onRemove),this.className=this.pfx+"panels"},onRemove:function(e){var t=e.view;t&&t.remove()},addTo:function(e){this.addToCollection(e)},addToCollection:function(e,t){var n=t||null,r=this.config,i=e.get("el"),s=new o["default"]({el:i,model:e,config:r}),a=s.render().el,l=e.get("appendTo");if(i);else if(l){var c=document.querySelector(l);c.appendChild(a)}else n?n.appendChild(a):this.$el.append(a);return s.initResize(),a},render:function(){var e=this,t=this.$el,n=document.createDocumentFragment();return t.empty(),this.collection.each(function(t){return e.addToCollection(t,n)}),t.append(n),t.attr("class",this.className),this}})},"./src/parser/config/config.js":function(e,t,n){"use strict";n.r(t),t["default"]={textTags:["br","b","i","u","a","ul","ol"],parserCss:null,parserHtml:null}},"./src/parser/index.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./src/parser/config/config.js"),l=n("./src/parser/model/ParserCss.js"),c=n("./src/parser/model/ParserHtml.js");t["default"]=function(){var e,t,n={};return{compTypes:"",parserCss:null,parserHtml:null,name:"Parser",getConfig:function(){return n},init:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n=i({},a["default"],{},r),n.Parser=this,e=new c["default"](n),t=new l["default"](n),this.em=n.em,this.parserCss=t,this.parserHtml=e,this},parseHtml:function(n){var r=this.em,i=this.compTypes;return e.compTypes=r?r.get("DomComponents").getTypes():i,e.parse(n,t)},parseCss:function(e){return t.parse(e)}}}},"./src/parser/model/BrowserParserCss.js":function(e,t,n){"use strict";n.r(t),n.d(t,"parseSelector",function(){return l}),n.d(t,"parseStyle",function(){return c}),n.d(t,"parseCondition",function(){return u}),n.d(t,"createNode",function(){return d}),n.d(t,"parseNode",function(){return h});var r=n("./node_modules/underscore/underscore.js"),i=(n.n(r),{4:"media",5:"font-face",6:"page",7:"keyframes",11:"counter-style",12:"supports",13:"document",14:"font-feature-values",15:"viewport"}),o=Object(r.keys)(i),s=["5","6","11","15"],a=["font-face","page","counter-style","viewport"],l=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=[],n=[],r=e.split(","),i=0,o=r.length;i<o;i++){var s=r[i].trim();if(/^(\.{1}[\w\-]+)+(:{1,2}[\w\-()]+)?$/gi.test(s)||/^(#{1}[\w\-]+){1}(:{1,2}[\w\-()]+)?$/gi.test(s)){var a=s.split(".").filter(Boolean);n.push(a)}else t.push(s)}return{result:n,add:t}},c=function(e){for(var t=e.style,n={},r=0,i=t.length;r<i;r++){var o=t[r],s=t.getPropertyValue(o),a=t.getPropertyPriority(o);n[o]="".concat(s).concat(a?" !".concat(a):"")}return n},u=function(e){var t=e.conditionText||e.media&&e.media.mediaText||e.name||e.selectorText||"";return t.trim()},d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={},i=e.length,o=e[i-1],s=o?o.split(/:(.+)/):[],l=s[1],c=n.atRule,u=n.selectorsAdd,d=n.mediaText,h=a.indexOf(c)>=0;return h&&(r.singleAtRule=1),c&&(r.atRuleType=c),u&&(r.selectorsAdd=u),d&&(r.mediaText=d),l&&(e[i-1]=s[0],r.state=l,s.splice(s.length-1,1)),r.selectors=e,r.style=t,r},h=function f(e){for(var t=[],n=e.cssRules||[],r=0,a=n.length;r<a;r++){var h=n[r],p=h.type.toString(),g=0,m="",v="",b=h.selectorText||h.keyText,y=s.indexOf(p)>=0;if(y)g=1,m=i[p],v=u(h);else if(o.indexOf(p)>=0){var w=f(h);v=u(h);for(var x=0,C=w.length;x<C;x++){var j=w[x];v&&(j.mediaText=v),j.atRuleType=i[p]}t=t.concat(w)}if(b||y){var O=c(h),k=l(b),S=k.add;b=k.result;for(var T=void 0,P=0,E=b.length;P<E;P++){var _=d(b[P],O,{atRule:i[p]});t.push(_),T=_}if(S.length){var D=S.join(", ");if(T)T.selectorsAdd=D;else{var M={selectors:[],selectorsAdd:D,style:O};g&&(M.singleAtRule=g),m&&(M.atRuleType=m),v&&(M.mediaText=v),t.push(M)}}}}return t};t["default"]=function(e){var t=document.createElement("style");t.innerHTML=e,document.head.appendChild(t);var n=t.sheet;return document.head.removeChild(t),h(n)}},"./src/parser/model/ParserCss.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/underscore/underscore.js"),i=(n.n(r),n("./src/parser/model/BrowserParserCss.js"));t["default"]=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{parse:function(t){var n=this,r=[],o=e.parserCss,s=e.em,a=void 0===s?{}:s,l=a&&a.get&&a.get("Editor"),c=o?o(t,l):Object(i["default"])(t);return c.forEach(function(e){return r=r.concat(n.checkNode(e))}),r},checkNode:function(e){var t=e,n=t.selectors,o=t.style;if(Object(r.isString)(n)){var s=[],a=Object(i.parseSelector)(n),l=a.result,c=a.add.join(", "),u={atRule:e.atRule,mediaText:e.params};if(l.length?l.forEach(function(e){s.push(Object(i.createNode)(e,o,u))}):s.push(Object(i.createNode)([],o,u)),c){var d=s[s.length-1];d.selectorsAdd=c}e=s}return e}}}},"./src/parser/model/ParserHtml.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/@babel/runtime/helpers/typeof.js"),i=n.n(r),o=n("./node_modules/underscore/underscore.js");n.n(o);t["default"]=function(e){var t=e,n="data-gjs-";return{compTypes:"",modelAttrStart:n,splitPropsFromAttr:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r={},i={};return Object(o.each)(t,function(t,s){if(0===s.indexOf(e.modelAttrStart)){var a=s.replace(n,""),l=t.length,c=t&&Object(o.isString)(t),u=c&&t.substr(0,1),d=c&&t.substr(l-1);t="true"===t||t,t="false"!==t&&t;try{t="{"==u&&"}"==d||"["==u&&"]"==d?JSON.parse(t):t}catch(h){}r[a]=t}else i[s]=t}),{props:r,attrs:i}},parseStyle:function(e){for(var t={},n=e.split(";"),r=0,i=n.length;r<i;r++){var o=n[r].trim();if(o){var s=o.split(":");t[s[0].trim()]=s.slice(1).join(":").trim()}}return t},parseClass:function(e){for(var t=[],n=e.split(" "),r=0,i=n.length;r<i;r++){var o=n[r].trim();o&&t.push(o)}return t},parseNode:function(r){for(var o=[],s=r.childNodes,a=0,l=s.length;a<l;a++){var c=s[a],u=c.attributes||[],d=u.length,h=o[o.length-1],f=c.childNodes.length,p=this.compTypes,g={};if(p){var m="",v=c.getAttribute&&c.getAttribute("".concat(n,"type"));if(v)g={type:v};else{for(var b=0;b<p.length;b++){var y=p[b];if(m=y.model.isComponent(c)){"object"!==i()(m)&&(m={type:y.id});break}}g=m}}g.tagName||(g.tagName=c.tagName?c.tagName.toLowerCase():""),d&&(g.attributes={});for(var w=0;w<d;w++){var x=u[w].nodeName,C=u[w].nodeValue;if("style"==x)g.style=this.parseStyle(C);else if("class"==x)g.classes=this.parseClass(C);else{if("contenteditable"==x)continue;if(0===x.indexOf(n)){var j=x.replace(n,""),O=C.length,k=C&&C.substr(0,1),S=C&&C.substr(O-1);C="true"===C||C,C="false"!==C&&C;try{C="{"==k&&"}"==S||"["==k&&"]"==S?JSON.parse(C):C}catch(T){}g[j]=C}else g.attributes[x]=C}}if(f&&!g.components){var P=c.childNodes[0];1===f&&3===P.nodeType?(!g.type&&(g.type="text"),g.content=P.nodeValue):g.components=this.parseNode(c)}if("textnode"==g.type){if(h&&"textnode"==h.type){h.content+=g.content;continue}if(!e.keepEmptyTextNodes){var E=c.nodeValue;if(" "!=E&&!E.trim())continue}}var _=g.components;if(!g.type&&_){for(var D=1,M=0,A=0;A<_.length;A++){var L=_[A],N=L.type;if(["text","textnode"].indexOf(N)<0&&t.textTags.indexOf(L.tagName)<0){D=0;break}"textnode"==N&&(M=1)}D&&M&&(g.type="text")}(g.tagName||"textnode"==g.type)&&o.push(g)}return o},parse:function(e,n){var r=t.em&&t.em.get("Config")||{},i={html:"",css:""},o=document.createElement("div");o.innerHTML=e;var s=o.querySelectorAll("script"),a=s.length;if(!r.allowScripts)for(;a--;)s[a].parentNode.removeChild(s[a]);if(n){for(var l="",c=o.querySelectorAll("style"),u=c.length;u--;)l=c[u].innerHTML+l,c[u].parentNode.removeChild(c[u]);l&&(i.css=n.parse(l))}var d=this.parseNode(o);return 1==d.length&&(d=d[0]),i.html=d,i}}}},"./src/plugin_manager/config/config.js":function(e,t,n){"use strict";n.r(t),t["default"]={plugins:[]}},"./src/plugin_manager/index.js":function(e,t,n){"use strict";n.r(t);var r=n("./src/plugin_manager/config/config.js");t["default"]=function(e){var t=e||{};for(var n in r["default"])n in t||(t[n]=r["default"][n]);var i={};return{add:function(e,t){return i[e]?i[e]:(i[e]=t,t)},get:function(e){return i[e]},getAll:function(){return i}}}},"./src/rich_text_editor/config/config.js":function(e,t,n){"use strict";n.r(t),t["default"]={stylePrefix:"rte-",adjustToolbar:1,actions:["bold","italic","underline","strikethrough","link"]}},"./src/rich_text_editor/index.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){l()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/toConsumableArray.js"),s=n.n(o),a=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),l=n.n(a),c=n("./src/rich_text_editor/model/RichTextEditor.js"),u=n("./src/utils/mixins.js"),d=n("./src/rich_text_editor/config/config.js");t["default"]=function(){var e,t,n,r,o,a={},l=function(){var t=e.style,n="-1000px";t.top=n,t.left=n,t.display="none"};return{customRte:null,name:"RichTextEditor",getConfig:function(){return a},init:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};a=i({},d["default"],{},n);var r=a.pStylePrefix;return r&&(a.stylePrefix=r+a.stylePrefix),this.pfx=a.stylePrefix,t=a.actions||[],e=document.createElement("div"),e.className="".concat(r,"rte-toolbar ").concat(r,"one-bg"),o=this.initRte(document.createElement("div")),Object(u.on)(e,"mousedown",function(e){return e.stopPropagation()}),this},destroy:function(){var t=this.customRte;o&&o.destroy(),t&&t.destroy&&t.destroy(),e=0,o=0,this.actionbar=0,this.actions=0},postRender:function(t){var n=t.model.get("Canvas");e.style.pointerEvents="all",l(),n.getToolsEl().appendChild(e)},initRte:function(t){var n=this.pfx,r=e,i=this.actionbar,l=this.actions||s()(a.actions),u={actionbar:"".concat(n,"actionbar"),button:"".concat(n,"action"),active:"".concat(n,"active"),inactive:"".concat(n,"inactive"),disabled:"".concat(n,"disabled")},d=new c["default"]({el:t,classes:u,actions:l,actionbar:i,actionbarContainer:r});return o&&o.setEl(t),d.actionbar&&(this.actionbar=d.actionbar),d.actions&&(this.actions=d.actions),d},add:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.name=e,o.addAction(t,{sync:1})},get:function(e){var t;return o.getActions().forEach(function(n){n.name==e&&(t=n)}),t},getAll:function(){return o.getActions()},remove:function(e){var t=this.getAll(),n=this.get(e);if(n){var r=n.btn,i=t.indexOf(n);r.parentNode.removeChild(r),t.splice(i,1)}return n},getToolbarEl:function(){return e},updatePosition:function(){var t="px",r=a.em.get("Canvas"),i=e,o=i.style,s=r.getTargetToElementFixed(n,e,{event:"rteToolbarPosUpdate"});o.top=s.top+t,o.left=0+t},enable:function(t,i){n=t.el;var o=a.em.get("Canvas"),s=a.em,l=t.getChildrenContainer(),c=this.customRte;if(r=o.getElementPos(n),e.style.display="",i=c?c.enable(l,i):this.initRte(l).enable(),s){setTimeout(this.updatePosition.bind(this),0);var u="change:canvasOffset canvasScroll frame:scroll component:update";s.off(u,this.updatePosition,this),s.on(u,this.updatePosition,this),s.trigger("rte:enable",t,i)}return i},disable:function(e,t){var n=a.em,r=this.customRte,i=e.getChildrenContainer();r?r.disable(i,t):t&&t.disable(),l(),n&&n.trigger("rte:disable",e,t)}}}},"./src/rich_text_editor/model/RichTextEditor.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t),n.d(t,"default",function(){return m});var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./node_modules/@babel/runtime/helpers/classCallCheck.js"),l=n.n(a),c=n("./node_modules/@babel/runtime/helpers/createClass.js"),u=n.n(c),d=n("./src/utils/mixins.js"),h="_rte",f={ACTIVE:1,INACTIVE:0,DISABLED:-1},p=function(e){var t=e.selection().anchorNode,n=t&&t.parentNode,r=t&&t.nextSibling;return n&&"A"==n.nodeName||r&&"A"==r.nodeName},g={bold:{name:"bold",icon:"<b>B</b>",attributes:{title:"Bold"},result:function(e){return e.exec("bold")}},italic:{name:"italic",icon:"<i>I</i>",attributes:{title:"Italic"},result:function(e){return e.exec("italic")}},underline:{name:"underline",icon:"<u>U</u>",attributes:{title:"Underline"},result:function(e){return e.exec("underline")}},strikethrough:{name:"strikethrough",icon:"<strike>S</strike>",attributes:{title:"Strike-through"},result:function(e){return e.exec("strikeThrough")}},link:{icon:'<span style="transform:rotate(45deg)">⫘</span>',name:"link",attributes:{style:"font-size:1.4rem;padding:0 4px 2px;",title:"Link"},state:function(e,t){return e&&e.selection()&&p(e)?f.ACTIVE:f.INACTIVE},result:function(e){p(e)?e.exec("unlink"):e.insertHTML('<a class="link" href="">'.concat(e.selection(),"</a>"))}}},m=function(){function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};l()(this,e);var r=n.el;if(r[h])return r[h];r[h]=this,this.setEl(r),this.updateActiveActions=this.updateActiveActions.bind(this);var o=n.actions||[];o.forEach(function(e,t){"string"==typeof e?e=g[e]:g[e.name]&&(e=i({},g[e.name],{},e)),o[t]=e});var s=o.length?o:Object.keys(g).map(function(e){return g[e]});n.classes=i({},{actionbar:"actionbar",button:"action",active:"active",disabled:"disabled",inactive:"inactive"},{},n.classes);var a=n.classes,c=n.actionbar;if(this.actionbar=c,this.settings=n,this.classes=a,this.actions=s,!c){var u=n.actionbarContainer;c=document.createElement("div"),c.className=a.actionbar,u.appendChild(c),this.actionbar=c,s.forEach(function(e){return t.addAction(e)})}return n.styleWithCSS&&this.exec("styleWithCSS"),this.syncActions(),this}return u()(e,[{key:"destroy",value:function(){this.el=0,this.doc=0,this.actionbar=0,this.settings={},this.classes={},this.actions=[]}},{key:"setEl",value:function(e){this.el=e,this.doc=e.ownerDocument}},{key:"updateActiveActions",value:function(){var e=this;this.getActions().forEach(function(t){var n=t.btn,r=t.update,o=i({},e.classes),s=o.active,a=o.inactive,l=o.disabled,c=t.state,u=t.name,d=e.doc;if(n.className=n.className.replace(s,"").trim(),n.className=n.className.replace(a,"").trim(),n.className=n.className.replace(l,"").trim(),c)switch(c(e,d)){case f.ACTIVE:n.className+=" ".concat(s);break;case f.INACTIVE:n.className+=" ".concat(a);break;case f.DISABLED:n.className+=" ".concat(l)}else d.queryCommandSupported(u)&&d.queryCommandState(u)&&(n.className+=" ".concat(s));r&&r(e,t)})}},{key:"enable",value:function(){return this.enabled?this:(this.actionbarEl().style.display="",this.el.contentEditable=!0,Object(d.on)(this.el,"mouseup keyup",this.updateActiveActions),this.syncActions(),this.updateActiveActions(),this.el.focus(),this.enabled=1,this)}},{key:"disable",value:function(){return this.actionbarEl().style.display="none",this.el.contentEditable=!1,Object(d.off)(this.el,"mouseup keyup",this.updateActiveActions),this.enabled=0,this}},{key:"syncActions",value:function(){var e=this;this.getActions().forEach(function(t){if(e.settings.actionbar&&(!t.state||t.state&&t.state(e,e.doc)>=0)){var n=t.event||"click";t.btn["on".concat(n)]=function(n){t.result(e,t),e.updateActiveActions()}}})}},{key:"addAction",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.sync,r=document.createElement("span"),i=e.icon,o=e.attributes||{};r.className=this.classes.button,e.btn=r;for(var s in o)r.setAttribute(s,o[s]);"string"==typeof i?r.innerHTML=i:r.appendChild(i),this.actionbarEl().appendChild(r),n&&(this.actions.push(e),this.syncActions())}},{key:"getActions",value:function(){return this.actions}},{key:"selection",value:function(){return this.doc.getSelection()}},{key:"exec",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.doc.execCommand(e,!1,t)}},{key:"actionbarEl",value:function(){return this.actionbar}},{key:"insertHTML",value:function(e){var t,n=this.doc,r=n.getSelection();if(r&&r.rangeCount){var i=n.createElement("div"),o=r.getRangeAt(0);o.deleteContents(),i.innerHTML=e,Array.prototype.slice.call(i.childNodes).forEach(function(e){o.insertNode(e),t=e}),r.removeAllRanges(),r.addRange(o),this.el.focus()}}}]),e}()},"./src/selector_manager/config/config.js":function(e,t,n){"use strict";n.r(t),t["default"]={stylePrefix:"clm-",appendTo:"",selectors:[],states:[{name:"hover"},{name:"active"},{name:"nth-of-type(2n)"}],escapeName:0,selectedName:0,iconAdd:'<svg viewBox="0 0 24 24"><path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path></svg>',iconSync:'<svg viewBox="0 0 24 24"><path d="M12 18c-3.31 0-6-2.69-6-6 0-1 .25-1.97.7-2.8L5.24 7.74A7.93 7.93 0 0 0 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4m0-11V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1-.25 1.97-.7 2.8l1.46 1.46A7.93 7.93 0 0 0 20 12c0-4.42-3.58-8-8-8z"></path></svg>',iconTagOn:'<svg viewBox="0 0 24 24"><path d="M19 19H5V5h10V3H5c-1.11 0-2 .89-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8h-2m-11.09-.92L6.5 11.5 11 16 21 6l-1.41-1.42L11 13.17l-3.09-3.09z"></path></svg>',iconTagOff:'<svg viewBox="0 0 24 24"><path d="M19 3H5c-1.11 0-2 .89-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5a2 2 0 0 0-2-2m0 2v14H5V5h14z"></path></svg>',iconTagRemove:'<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"></path></svg>',
|
||
render:0,componentFirst:0}},"./src/selector_manager/index.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./node_modules/underscore/underscore.js"),l=(n.n(a),n("./src/utils/mixins.js")),c=n("./src/selector_manager/config/config.js"),u=n("./src/selector_manager/model/Selector.js"),d=n("./src/selector_manager/model/Selectors.js"),h=n("./src/selector_manager/view/ClassTagsView.js"),f=function(e){return Object(a.isString)(e)&&"#"==e[0]},p=function(e){return Object(a.isString)(e)&&"."==e[0]};t["default"]=function(e){var t,n=e||{};return{Selector:u["default"],Selectors:d["default"],name:"SelectorManager",getConfig:function(){return n},init:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};n=i({},c["default"],{},e);var r=n.em,o=n.pStylePrefix;return this.em=r,o&&(n.stylePrefix=o+n.stylePrefix),this.selectorTags=new h["default"]({collection:new d["default"]([],{em:r,config:n}),config:n}),t=new d["default"](n.selectors),t.on("add",function(e){return r.trigger("selector:add",e)}),t.on("remove",function(e){return r.trigger("selector:remove",e)}),t.on("change",function(e){return r.trigger("selector:update",e,e.previousAttributes(),e.changedAttributes())}),r.on("change:state",function(e,t){return r.trigger("selector:state",t)}),this},postRender:function(){var e=this.getConfig().appendTo;if(e){var t=Object(a.isElement)(e)?e:document.querySelector(e);t.appendChild(this.render([]))}},select:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Array.isArray(e)?e:[e],r=this.em.get("StyleManager").setTarget(n,t),i=r.filter(function(e){return e}).map(function(e){return Object(l.isComponent)(e)?e:Object(l.isRule)(e)&&!e.get("selectorsAdd")?e:e.getSelectorsString()});return this.selectorTags.componentChanged({targets:i}),this},setState:function(e){return this.em.setState(e),this},getState:function(){return this.em.setState()},addSelector:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=i({},r);Object(a.isObject)(e)?o=e:o.name=e,f(o.name)?(o.name=o.name.substr(1),o.type=u["default"].TYPE_ID):p(o.name)&&(o.name=o.name.substr(1)),o.label&&!o.name&&(o.name=this.escapeName(o.label));var s=o.name,l=s?this.get(s,o.type):t.where(o)[0];return l?l:t.add(o,{config:n})},getSelector:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u["default"].TYPE_CLASS;return f(e)?(e=e.substr(1),n=u["default"].TYPE_ID):p(e)&&(e=e.substr(1)),t.where({name:e,type:n})[0]},add:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(a.isArray)(e)?e.map(function(e){return t.addSelector(e,n)}):this.addSelector(e,n)},addClass:function(e){var t=this,n=[];return Object(a.isString)(e)&&(e=e.trim().split(" ")),e.forEach(function(e){return n.push(t.addSelector(e))}),n},get:function(e,t){var n=this;if(Object(a.isArray)(e)){var r=[],i=e.map(function(e){return n.getSelector(e)}).filter(function(e){return e});return i.forEach(function(e){return r.indexOf(e)<0&&r.push(e)}),r}return this.getSelector(e,t)},getAll:function(){return t},escapeName:function r(e){var t=n,r=t.escapeName;return r?r(e):u["default"].escapeName(e)},render:function(e){return e?(this.selectorTags=new h["default"]({collection:new d["default"](e),config:n}),this.selectorTags.render().el):this.selectorTags.render().el}}}},"./src/selector_manager/model/Selector.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=1,s=2,a=i.a.Model.extend({idAttribute:"name",defaults:{name:"",label:"",type:o,active:!0,"private":!1,"protected":!1},initialize:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.config,r=void 0===n?{}:n,i=this.get("name"),o=this.get("label");i?o||this.set("label",i):this.set("name",o);var s=this.get("name"),l=r.escapeName,c=l?l(s):a.escapeName(s);this.set("name",c)},getFullName:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.escape,n=this.get("name"),r="";switch(this.get("type")){case o:r=".";break;case s:r="#"}return r+(t?t(n):n)}},{TYPE_CLASS:o,TYPE_ID:s,escapeName:function(e){return"".concat(e).trim().replace(/([^a-z0-9\w-\:]+)/gi,"-")}});t["default"]=a},"./src/selector_manager/model/Selectors.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/underscore/underscore.js"),i=(n.n(r),n("./node_modules/backbone/backbone.js")),o=n.n(i),s=n("./src/selector_manager/model/Selector.js");t["default"]=o.a.Collection.extend({model:s["default"],modelId:function(e){return"".concat(e.name,"_").concat(e.type||s["default"].TYPE_CLASS)},getStyleable:function(){return Object(r.filter)(this.models,function(e){return e.get("active")&&!e.get("private")})},getValid:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.noDisabled;return Object(r.filter)(this.models,function(e){return!e.get("private")}).filter(function(e){return t?e.get("active"):1})},getFullString:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[],r=e||this;return r.forEach(function(e){return n.push(e.getFullName(t))}),n.join("").trim()}})},"./src/selector_manager/view/ClassTagView.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o="contentEditable";t["default"]=i.a.View.extend({template:function(){var e=this.pfx,t=this.model,n=this.config,r=t.get("label")||"";return'\n <span id="'.concat(e,'checkbox" class="').concat(e,'tag-status" data-tag-status></span>\n <span id="').concat(e,'tag-label" data-tag-name>').concat(r,'</span>\n <span id="').concat(e,'close" class="').concat(e,'tag-close" data-tag-remove>\n ').concat(n.iconTagRemove,"\n </span>\n ")},events:{"click [data-tag-remove]":"removeTag","click [data-tag-status]":"changeStatus","dblclick [data-tag-name]":"startEditTag","focusout [data-tag-name]":"endEditTag"},initialize:function(e){var t=e.config||{};this.config=t,this.coll=e.coll||null,this.pfx=t.stylePrefix||"",this.ppfx=t.pStylePrefix||"",this.em=t.em,this.listenTo(this.model,"change:active",this.updateStatus)},getInputEl:function(){return this.inputEl||(this.inputEl=this.el.querySelector("[data-tag-name]")),this.inputEl},startEditTag:function(){var e=this.em,t=this.getInputEl();t[o]=!0,t.focus(),e&&e.setEditing(1)},endEditTag:function(){var e=this.model,t=this.getInputEl(),n=t.textContent,r=this.em,i=r&&r.get("SelectorManager");if(t[o]=!1,r&&r.setEditing(0),i){var s=i.escapeName(n);i.get(s)?t.innerText=e.get("label"):e.set({name:s,label:n})}},changeStatus:function(){var e=this.model;e.set("active",!e.get("active"))},removeTag:function(){var e=this.em,t=this.model,n=e&&e.getSelectedAll();n.forEach(function(e){!t.get("protected")&&e&&e.getSelectors().remove(t)})},updateStatus:function(){var e=this.model,t=this.$el,n=this.config,r=n.iconTagOn,i=n.iconTagOff,o=t.find("[data-tag-status]");e.get("active")?(o.html(r),t.removeClass("opac50")):(o.html(i),t.addClass("opac50"))},render:function(){var e=this.pfx,t=this.ppfx;return this.$el.html(this.template()),this.$el.attr("class","".concat(e,"tag ").concat(t,"three-bg")),this.updateStatus(),this}})},"./src/selector_manager/view/ClassTagsView.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/@babel/runtime/helpers/toConsumableArray.js"),i=n.n(r),o=n("./node_modules/underscore/underscore.js"),s=(n.n(o),n("./node_modules/backbone/backbone.js")),a=n.n(s),l=n("./src/selector_manager/view/ClassTagView.js");t["default"]=a.a.View.extend({template:function(e){var t=e.labelInfo,n=e.labelStates,r=e.labelHead,i=e.iconSync,o=e.iconAdd,s=e.pfx,a=e.ppfx;return'\n <div id="'.concat(s,'up" class="').concat(s,'header">\n <div id="').concat(s,'label" class="').concat(s,'header-label">').concat(r,'</div>\n <div id="').concat(s,'status-c" class="').concat(s,'header-status">\n <span id="').concat(s,'input-c" data-states-c>\n <div class="').concat(a,"field ").concat(a,'select">\n <span id="').concat(a,'input-holder">\n <select id="').concat(s,'states" data-states>\n <option value="">').concat(n,'</option>\n </select>\n </span>\n <div class="').concat(a,'sel-arrow">\n <div class="').concat(a,'d-s-arrow"></div>\n </div>\n </div>\n </span>\n </div>\n </div>\n <div id="').concat(s,'tags-field" class="').concat(a,'field">\n <div id="').concat(s,'tags-c" data-selectors></div>\n <input id="').concat(s,'new" data-input/>\n <span id="').concat(s,'add-tag" class="').concat(s,"tags-btn ").concat(s,'tags-btn__add" data-add>\n ').concat(o,'\n </span>\n <span class="').concat(s,"tags-btn ").concat(s,'tags-btn__sync" style="display: none" data-sync-style>\n ').concat(i,'\n </span>\n </div>\n <div class="').concat(s,'sels-info">\n <div class="').concat(s,'label-sel">').concat(t,':</div>\n <div class="').concat(s,'sels" data-selected></div>\n <div style="clear:both"></div>\n </div>')},events:{"change [data-states]":"stateChanged","click [data-add]":"startNewTag","focusout [data-input]":"endNewTag","keyup [data-input]":"onInputKeyUp","click [data-sync-style]":"syncStyle"},initialize:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.config=e.config||{},this.pfx=this.config.stylePrefix||"",this.ppfx=this.config.pStylePrefix||"",this.className=this.pfx+"tags",this.stateInputId=this.pfx+"states",this.stateInputC=this.pfx+"input-c",this.states=this.config.states||[];var t=this.config.em,n=this.getStyleEmitter(),r=this.collection;this.target=this.config.em,this.em=t;var i="component:toggled component:update:classes",o="component:update:classes change:state";this.listenTo(t,i,this.componentChanged),this.listenTo(n,"styleManager:update",this.componentChanged),this.listenTo(t,o,this.__handleStateChange),this.listenTo(t,"styleable:change change:device",this.checkSync),this.listenTo(r,"add",this.addNew),this.listenTo(r,"reset",this.renderClasses),this.listenTo(r,"remove",this.tagRemoved),this.delegateEvents()},syncStyle:function(){var e,t=this.em,n=this.getTarget(),r=t.get("CssComposer"),i={noDisabled:1},o=this.getCommonSelectors({opts:i}),s=t.get("state"),a=t.getCurrentMedia(),l=[],c=r.get(o,s,a)||r.add(o,s,a);this.getTargets().forEach(function(t){var n=r.getIdRule(t.getId(),{state:s,mediaText:a});e=n.getStyle(),n.setStyle({}),l.push(n)}),e&&c.addStyle(e),t.trigger("component:toggled"),t.trigger("component:sync-style",{component:n,selectors:o,mediaText:a,rule:c,ruleComponents:l,state:s})},getStyleEmitter:function(){var e=this.em,t=e&&e.get("StyleManager"),n=t&&t.getEmitter();return n||{}},tagRemoved:function(e){this.updateStateVis()},getStateOptions:function(){var e=this.states,t=this.em,n=[];return e.forEach(function(e){return n.push('<option value="'.concat(e.name,'">').concat(t.t("selectorManager.states.".concat(e.name))||e.label||e.name,"</option>"))}),n.join("")},addNew:function(e){this.addToClasses(e)},startNewTag:function(){this.$addBtn.css({display:"none"}),this.$input.show().focus()},endNewTag:function(){this.$addBtn.css({display:""}),this.$input.hide().val("")},onInputKeyUp:function(e){13===e.keyCode?this.addNewTag(this.$input.val()):27===e.keyCode&&this.endNewTag()},checkStates:function(){var e=this.em.getState(),t=this.getStates();t&&t.val(e)},componentChanged:Object(o.debounce)(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.targets;this.updateSelection(t)}),updateSelection:function(e){var t=e||this.getTargets();t=Object(o.isArray)(t)?t:[t];var n=[];return t&&t.length&&(n=this.getCommonSelectors({targets:t}),this.checkSync({validSelectors:n})),this.collection.reset(n),this.updateStateVis(t),n},getCommonSelectors:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.targets,n=e.opts,r=void 0===n?{}:n,o=t||this.getTargets(),s=o.map(function(e){return e.getSelectors&&e.getSelectors().getValid(r)}).filter(function(e){return e});return this._commonSelectors.apply(this,i()(s))},_commonSelectors:function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return n.length?1===n.length?n[0]:2===n.length?n[0].filter(function(e){return n[1].indexOf(e)>=0}):n.slice(1).reduce(function(t,n){return e._commonSelectors(t,n)},n[0]):[]},checkSync:Object(o.debounce)(function(){var e,t=this.$btnSyncEl,n=this.config,r=this.collection,i=this.getTarget();if(i&&n.componentFirst&&r.length){var s=i.getStyle();e=!Object(o.isEmpty)(s)}t&&t[e?"show":"hide"]()}),getTarget:function(){return this.target.getSelected()},getTargets:function(){return this.target.getSelectedAll()},updateStateVis:function(e){var t=this.em,n=t&&t.getConfig("avoidInlineStyle"),r=this.collection.length||n?"":"none";this.getStatesC().css("display",r),this.updateSelector(e)},__handleStateChange:function(){this.updateSelector(this.getTargets())},updateSelector:function(e){var t=this,n=this.el.querySelector("[data-selected]"),r=[],i=e||this.getTargets();i=Object(o.isArray)(i)?i:[i],i.forEach(function(e){return r.push(t.__getName(e))}),n&&(n.innerHTML=r.join(", ")),this.checkStates()},__getName:function(e){var t,n=this.pfx,r=this.config,i=this.em,s=r.selectedName,a=r.componentFirst;if(Object(o.isString)(e))t='<span class="'.concat(n,'sel-gen">').concat(e,"</span>");else{if(!e||!e.get)return;var l=e.getSelectors().getStyleable(),c=i.get("state"),u=e.getId?'<span class="'.concat(n,'sel-cmp">').concat(e.getName(),'</span><span class="').concat(n,'sel-id">#').concat(e.getId(),"</span>"):"";t=this.collection.getFullString(l),t=t?'<span class="'.concat(n,'sel-rule">').concat(t,"</span>"):e.get("selectorsAdd")||u,t=a&&u?u:t,t+=c?'<span class="'.concat(n,'sel-state">:').concat(c,"</span>"):"",t=s?s({result:t,state:c,target:e}):t}return t&&'<span class="'.concat(n,'sel">').concat(t,"</span>")},stateChanged:function(e){var t=this.em,n=e.target.value;t.set("state",n)},addNewTag:function(e){var t=this,n=this.em;if(e.trim()){if(n){var r=n.get("SelectorManager"),i=r.add({label:e});this.getTargets().forEach(function(e){e.getSelectors().add(i),t.collection.add(i),t.updateStateVis()})}this.endNewTag()}},addToClasses:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=t,r=this.getClasses(),i=new l["default"]({model:e,config:this.config,coll:this.collection}).render().el;return n?n.appendChild(i):r.append(i),i},renderClasses:function(){var e=this,t=document.createDocumentFragment(),n=this.getClasses();n.empty(),this.collection.each(function(n){return e.addToClasses(n,t)}),n.append(t)},getClasses:function(){return this.$el.find("[data-selectors]")},getStates:function(){if(!this.$states){var e=this.$el.find("[data-states]");this.$states=e[0]&&e}return this.$states},getStatesC:function(){return this.$statesC||(this.$statesC=this.$el.find("#"+this.stateInputC)),this.$statesC},render:function c(){var e=this.em,t=this.pfx,n=this.ppfx,r=this.config,i=this.$el,o=this.el,c=r.render,s=r.iconSync,a=r.iconAdd,l={iconSync:s,iconAdd:a,labelHead:e.t("selectorManager.label"),labelStates:e.t("selectorManager.emptyState"),labelInfo:e.t("selectorManager.selected"),ppfx:n,pfx:t,el:o};i.html(this.template(l));var u=c&&c(l);u&&u!==o&&i.empty().append(u),this.$input=i.find("[data-input]"),this.$addBtn=i.find("[data-add]"),this.$classes=i.find("#"+t+"tags-c"),this.$btnSyncEl=i.find("[data-sync-style]"),this.$input.hide();var d=this.getStates();return d&&d.append(this.getStateOptions()),this.renderClasses(),i.attr("class","".concat(this.className," ").concat(n,"one-bg ").concat(n,"two-color")),this}})},"./src/storage_manager/config/config.js":function(e,t,n){"use strict";n.r(t),t["default"]={id:"gjs-",autosave:1,autoload:1,type:"local",stepsBeforeSave:1,storeComponents:1,storeStyles:1,storeHtml:1,storeCss:1,checkLocal:1,params:{},headers:{},urlStore:"",urlLoad:"",beforeSend:function(e,t){},onComplete:function(e,t){},contentTypeJson:!0,credentials:"include",fetchOptions:""}},"./src/storage_manager/index.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./src/storage_manager/config/config.js"),l=n("./src/storage_manager/model/LocalStorage.js"),c=n("./src/storage_manager/model/RemoteStorage.js");t["default"]=function(){var e,t={},n={},r={},o="storage:start",s="storage:end",u="storage:error";return{name:"StorageManager",init:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=i({},a["default"],{},n),e=t.em,t._disable&&(t.type=0),r.remote=new c["default"](t),r.local=new l["default"](t),t.currentStorage=t.type,this.loadDefaultProviders().setCurrent(t.type),this},getConfig:function(){return t},isAutosave:function(){return!!t.autosave},setAutosave:function(e){return t.autosave=!!e,this},getStepsBeforeSave:function(){return t.stepsBeforeSave},setStepsBeforeSave:function(e){return t.stepsBeforeSave=e,this},add:function(e,t){return n[e]=t,this},get:function(e){return n[e]||null},getStorages:function(){return n},getCurrent:function(){return t.currentStorage},setCurrent:function(e){return t.currentStorage=e,this},store:function(e,n){var r=this,i=this.get(this.getCurrent()),o={};this.onStart("store",e);for(var s in e)o[t.id+s]=e[s];return i?i.store(o,function(e){n&&n(e),r.onEnd("store",e)},function(e){r.onError("store",e)}):null},load:function(e,n){var r=this,i=this.get(this.getCurrent()),o=[],s={};"string"==typeof e&&(e=[e]),this.onStart("load",e);for(var a=0,l=e.length;a<l;a++)o.push(t.id+e[a]);i?i.load(o,function(e){var i=new RegExp("^"+t.id);for(var o in e){var a=o.replace(i,"");s[a]=e[o]}n&&n(s),r.onEnd("load",s)},function(e){n&&n(s),r.onError("load",e)}):n&&n(s)},loadDefaultProviders:function(){for(var e in r)this.add(e,r[e]);return this},getCurrentStorage:function(){return this.get(this.getCurrent())},onStart:function(t,n){e&&(e.trigger(o),t&&e.trigger("".concat(o,":").concat(t),n))},onEnd:function(t,n){e&&(e.trigger(s),t&&e.trigger("".concat(s,":").concat(t),n))},onError:function(t,n){e&&(e.trigger(u,n),t&&e.trigger("".concat(u,":").concat(t),n),this.onEnd(t,n))},canAutoload:function(){var e=this.getCurrentStorage();return e&&this.getConfig().autoload}}}},"./src/storage_manager/model/LocalStorage.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r);t["default"]=i.a.Model.extend({defaults:{checkLocal:!0},store:function(e,t){this.checkStorageEnvironment();for(var n in e)localStorage.setItem(n,e[n]);"function"==typeof t&&t()},load:function(e,t){this.checkStorageEnvironment();for(var n={},r=0,i=e.length;r<i;r++){var o=localStorage.getItem(e[r]);o&&(n[e[r]]=o)}return"function"==typeof t&&t(n),n},remove:function(e){this.checkStorageEnvironment();for(var t=0,n=e.length;t<n;t++)localStorage.removeItem(e[t])},checkStorageEnvironment:function(){this.get("checkLocal")&&!localStorage&&console.warn("Your browser doesn't support localStorage")}})},"./src/storage_manager/model/RemoteStorage.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./node_modules/backbone/backbone.js"),l=n.n(a),c=n("./src/utils/fetch.js"),u=n("./node_modules/underscore/underscore.js");n.n(u);t["default"]=l.a.Model.extend({fetch:c["default"],defaults:{urlStore:"",urlLoad:"",params:{},beforeSend:function(){},onComplete:function(){},contentTypeJson:!1,credentials:"include",fetchOptions:""},onStart:function(){var e=(this.get("em"),this.get("beforeSend"));e&&e()},onError:function(e,t){if(t)t(e);else{var n=this.get("em");console.error(e),n&&n.trigger("storage:error",e)}},onResponse:function(e,t){var n=this.get("em"),r=this.get("onComplete"),i=this.get("contentTypeJson"),o=e&&"string"==typeof e,s=i&&o?JSON.parse(e):e;r&&r(s),t&&t(s),n&&n.trigger("storage:response",s)},store:function(e,t,n){var r={};for(var i in e)r[i]=e[i];this.request(this.get("urlStore"),{body:r},t,n)},load:function(e,t,n){this.request(this.get("urlLoad"),{method:"get"},t,n)},request:function(e){var t,n,r=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,l=this.get("contentTypeJson"),c=this.get("headers")||{},d=this.get("params"),h="X-Requested-With",f="Content-Type",p=o.body||{};for(var g in d)p[g]=d[g];if(Object(u.isUndefined)(c[h])&&(c[h]="XMLHttpRequest"),Object(u.isUndefined)(c[f])&&l&&(c[f]="application/json; charset=utf-8"),l)n=JSON.stringify(p);else{n=new FormData;for(var m in p)n.append(m,p[m])}t={method:o.method||"post",credentials:this.get("credentials"),headers:c},"post"===t.method&&(t.body=n);var v=this.get("fetchOptions")||{},b=Object(u.isFunction)(v)?v(t):t;this.onStart(),this.fetch(e,i({},t,{},b||{})).then(function(e){return 1==(e.status/200|0)?e.text():e.text().then(function(e){return Promise.reject(e)})}).then(function(e){return r.onResponse(e,s)})["catch"](function(e){return r.onError(e,a)})}})},"./src/style_manager/config/config.js":function(e,t,n){"use strict";n.r(t),t["default"]={stylePrefix:"sm-",sectors:[],appendTo:"",hideNotStylable:!0,highlightChanged:!0,highlightComputed:!0,showComputed:!0,clearProperties:0,avoidComputed:["width","height"]}},"./src/style_manager/index.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./node_modules/underscore/underscore.js"),l=(n.n(a),n("./src/style_manager/config/config.js")),c=n("./src/style_manager/model/Sectors.js"),u=n("./src/style_manager/model/Properties.js"),d=n("./src/style_manager/view/SectorsView.js");t["default"]=function(){var e,t,n,r={};return{name:"StyleManager",getConfig:function(){return r},init:function(o){r=i({},l["default"],{},o);var s=r.pStylePrefix;return this.em=r.em,s&&(r.stylePrefix=s+r.stylePrefix),e=new u["default"],t=new c["default"]([],r),n=new d["default"]({collection:t,target:r.em,config:r}),this},onLoad:function(){t.add(r.sectors)},postRender:function(){var e=this.getConfig().appendTo;if(e){var t=Object(a.isElement)(e)?e:document.querySelector(e);t.appendChild(this.render())}},addSector:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this.getSector(e);return i||(n.id=e,i=t.add(n,r)),i},getSector:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.where({id:e})[0];return!r&&n.warn&&this._logNoSector(e),r},removeSector:function(e){return this.getSectors().remove(this.getSector(e,{warn:1}))},getSectors:function(){return t},addProperty:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.getSector(e,{warn:1}),i=null;return r&&(i=r.get("properties").add(t,n)),i},getProperty:function(e,t){var n=this.getSector(e,{warn:1}),r=null;return n&&(r=n.get("properties").where({property:t}),r=1==r.length?r[0]:r),r},removeProperty:function(e,t){var n=this.getProperties(e);return n&&n.remove(this.getProperty(e,t))},getProperties:function(e){var t=null,n=this.getSector(e,{warn:1});return n&&(t=n.get("properties")),t},getModelToStyle:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.em,i=t.skipAdd,o=e.get("classes"),s=e.getId();if(n){var a,l=n.getConfig(),c=n.get("UndoManager"),u=n.get("CssComposer"),d=n.get("SelectorManager"),h=d?d.getConfig():{},f=l.devicePreviewMode?"":n.get("state"),p=o.getStyleable(),g=p.length,m=!h.componentFirst||t.useClasses,v={state:f};if(c.stop(),g&&m){var b=n.getCurrentMedia();a=u.get(p,f,b),a||i||(a=u.add(p,f,b))}else l.avoidInlineStyle&&(a=u.getIdRule(s,v),!a&&!i&&(a=u.setIdRule(s,{},v)),e.is("wrapper")&&a.set("wrapper",1));a&&(e=a),c.start()}return e},addType:function(t,n){e.addType(t,n)},getType:function(t){return e.getType(t)},getTypes:function(){return e.getTypes()},createType:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.model,o=void 0===n?{}:n,s=t.view,a=void 0===s?{}:s,l=this.getType(e);if(l)return new l.view(i({model:new l.model(o),config:r},a))},setTarget:function(e,t){return n.setTarget(e,t)},getEmitter:function(){return n.propTarget},render:function(){return n.render().el},_logNoSector:function(e){var t=this.em;t&&t.logWarning("'".concat(e,"' sector not found"))}}}},"./src/style_manager/model/Layer.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=n("./src/style_manager/model/Properties.js");t["default"]=i.a.Model.extend({defaults:{index:"",value:"",values:{},active:!1,preview:!1,properties:[]},initialize:function(){var e=this.get("properties"),t=this.get("value");this.set("properties",e instanceof o["default"]?e:new o["default"](e));var n=this.get("properties");if(n.forEach(this.onPropAdd,this),this.listenTo(n,"add",this.onPropAdd),!t){var r="",i=this.get("values");for(var s in i)r+=" "+i[s];this.set("value",r.trim())}},onPropAdd:function(e){var t=this.collection;e.parent=t&&t.property},getPropertyAt:function(e){return this.get("properties").at(e)},getPropertyValue:function(e){var t="";return this.get("properties").each(function(n){n.get("property")==e&&(t=n.getFullValue())}),t},getFullValue:function(){var e=[];return this.get("properties").each(function(t){return e.push(t.getFullValue())}),e.join(" ").trim()}})},"./src/style_manager/model/Layers.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./node_modules/underscore/underscore.js"),l=(n.n(a),n("./node_modules/backbone/backbone.js")),c=n.n(l),u=n("./src/style_manager/model/Layer.js");t["default"]=c.a.Collection.extend({model:u["default"],initialize:function(){this.idx=1,this.on("add",this.onAdd),this.on("reset",this.onReset)},onAdd:function(e,t,n){n.noIncrement||e.set("index",this.idx++),n.active&&this.active(this.indexOf(e))},onReset:function(){this.idx=1},getSeparator:function(){var e=this.property;return e?e.get("layerSeparator"):", "},getLayersFromValue:function(e){var t=this,n=[];e.replace(/\(([\w\s,.]*)\)/g,function(t){var n=t.replace(/,\s*/g,",");e=e.replace(t,n)});var r=e?e.split(this.getSeparator()):[];return r.forEach(function(e){n.push({properties:t.properties.parseValue(e)})}),n},getLayersFromStyle:function(e){var t=[],n=this.properties;n.pluck("property");return n.each(function(n){var r=e[n.get("property")],o=r?r.split(", "):[];o.forEach(function(e,r){e=n.parseValue(e.trim()).value;var o=t[r],s=i({},n.attributes,{},{value:e});o?o.properties.push(s):t[r]={properties:[s]}})}),t.forEach(function(e){var t=e.properties.map(function(e){return e.property});n.each(function(n){var r=n.get("property");t.indexOf(r)<0&&e.properties.push(i({},n.attributes))})}),t},active:function(e){this.each(function(e){return e.set("active",0)});var t=this.at(e);t&&t.set("active",1)},getFullValue:function(){var e=[];return this.each(function(t){return e.push(t.getFullValue())}),e.join(this.getSeparator())},getPropertyValues:function(e,t){var n=[];return this.each(function(r){var i=r.getPropertyValue(e);i?n.push(i):!Object(a.isUndefined)(t)&&n.push(t)}),n.join(", ")}})},"./src/style_manager/model/Properties.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./node_modules/backbone/backbone.js"),l=n.n(a),c=n("./src/domain_abstract/model/TypeableCollection.js"),u=n("./src/style_manager/model/Property.js"),d=n("./src/style_manager/model/PropertyStack.js"),h=n("./src/style_manager/view/PropertyStackView.js"),f=n("./src/style_manager/model/PropertyComposite.js"),p=n("./src/style_manager/view/PropertyCompositeView.js"),g=n("./src/style_manager/view/PropertyFileView.js"),m=n("./src/style_manager/view/PropertyColorView.js"),v=n("./src/style_manager/model/PropertySelect.js"),b=n("./src/style_manager/view/PropertySelectView.js"),y=n("./src/style_manager/model/PropertyRadio.js"),w=n("./src/style_manager/view/PropertyRadioView.js"),x=n("./src/style_manager/model/PropertySlider.js"),C=n("./src/style_manager/view/PropertySliderView.js"),j=n("./src/style_manager/model/PropertyInteger.js"),O=n("./src/style_manager/view/PropertyIntegerView.js"),k=n("./src/style_manager/view/PropertyView.js");t["default"]=l.a.Collection.extend(c["default"]).extend({types:[{id:"stack",model:d["default"],view:h["default"],isType:function(e){if(e&&"stack"==e.type)return e}},{id:"composite",model:f["default"],view:p["default"],isType:function(e){if(e&&"composite"==e.type)return e}},{id:"file",model:u["default"],view:g["default"],isType:function(e){if(e&&"file"==e.type)return e}},{id:"color",model:u["default"],view:m["default"],isType:function(e){
|
||
if(e&&"color"==e.type)return e}},{id:"select",model:v["default"],view:b["default"],isType:function(e){if(e&&"select"==e.type)return e}},{id:"radio",model:y["default"],view:w["default"],isType:function(e){if(e&&"radio"==e.type)return e}},{id:"slider",model:x["default"],view:C["default"],isType:function(e){if(e&&"slider"==e.type)return e}},{id:"integer",model:j["default"],view:O["default"],isType:function(e){if(e&&"integer"==e.type)return e}},{id:"base",model:u["default"],view:k["default"],isType:function(e){return e.type="base",e}}],deepClone:function(){var e=this.clone();return e.reset(e.map(function(e){var t=e.clone();return t.typeView=e.typeView,t})),e},parseValue:function(e){var t=this,n=[],r=e.split(" ");return r.forEach(function(e,r){var o=t.at(r);o&&n.push(i({},o.attributes,{},{value:e}))}),n},getFullValue:function(){var e="";return this.each(function(t){return e+="".concat(t.getFullValue()," ")}),e.trim()}})},"./src/style_manager/model/Property.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./node_modules/backbone/backbone.js"),l=n.n(a),c=n("./node_modules/underscore/underscore.js"),u=(n.n(c),n("./src/utils/mixins.js")),d=l.a.Model.extend({defaults:{name:"",property:"",type:"",defaults:"",info:"",value:"",icon:"",functionName:"",status:"",visible:!0,fixedValues:["initial","inherit"],full:0,important:0,toRequire:0,requires:null,requiresParent:null},initialize:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.get("id")||"",r=this.get("name")||"";!this.get("property")&&this.set("property",(r||n).replace(/ /g,"-"));var i=this.get("property");!this.get("id")&&this.set("id",i),!r&&this.set("name",Object(u.capitalize)(i).replace(/-/g," ")),d.callInit(this,e,t)},init:function(){},clearValue:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.set({value:void 0,status:""},e),this},setValue:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.parseValue(e);this.set(r,i({},n,{avoidStore:!t}))},setValueFromInput:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.setValue(e,t,i({},n,{fromInput:1}))},parseValue:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={value:e},r="!important";if(Object(c.isString)(e)&&e.indexOf(r)!==-1&&(n.value=e.replace(r,"").trim(),n.important=1),!this.get("functionName")&&!t.complete)return n;var i=[],o="".concat(n.value),s=o.indexOf("(")+1,a=o.lastIndexOf(")"),l=o.substring(0,s-1);if(l&&(n.functionName=l),i.push(s),a>=0&&i.push(a),n.value=String.prototype.substring.apply(o,i),t.numeric){var u=parseFloat(n.value);n.unit=n.value.replace(u,""),n.value=u}return n},splitValues:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:",",n=[],r="(",i=")",o="",s=0;return(e||"").split("").forEach(function(e){e==r?(s++,o+=r):e==i&&s>0?(s--,o+=i):e===t&&0==s?(n.push(o),o=""):o+=e}),""!==o&&n.push(o),n.map(function(e){return e.trim()})},getDefaultValue:function(){return this.get("defaults")},getFullValue:function(e){var t=this.get("functionName"),n=this.getDefaultValue(),r=Object(c.isUndefined)(e)?this.get("value"):e,i=!Object(c.isUndefined)(r)&&""!==r;return r&&n&&r===n?n:(t&&i&&(r="".concat(t,"(").concat(r,")")),i&&this.get("important")&&(r="".concat(r," !important")),r||"")}},{callParentInit:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};e.prototype.initialize.apply(t,[n,i({},r,{skipInit:1})])},callInit:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!n.skipInit&&e.init(t,n)}});t["default"]=d},"./src/style_manager/model/PropertyComposite.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./src/style_manager/model/Property.js");t["default"]=a["default"].extend({defaults:i({},a["default"].prototype.defaults,{detached:0,properties:[],separator:" "}),initialize:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};a["default"].callParentInit(a["default"],this,e,t);var r=this.get("properties")||[],i=n("./src/style_manager/model/Properties.js")["default"];this.set("properties",new i(r)),this.listenTo(this,"change:value",this.updateValues),a["default"].callInit(this,e,t)},clearValue:function(){arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.get("properties").each(function(e){return e.clearValue()}),a["default"].prototype.clearValue.apply(this,arguments)},updateValues:function(){var e=this.getFullValue().split(this.getSplitSeparator());this.get("properties").each(function(t,n){var r=e.length;e[n]||e[n%r+(1!=r&&r%2?1:0)]})},getSplitSeparator:function(){return new RegExp("".concat(this.get("separator"),"(?![^\\(]*\\))"))},getDefaultValue:function(e){var t=this.get("defaults");if(t&&!e)return t;t="";var n=this.get("properties");return n.each(function(e,n){return t+="".concat(e.getDefaultValue()," ")}),t.trim()},getFullValue:function(){return this.get("detached")?"":this.get("properties").getFullValue()},getPropertyAt:function(e){return this.get("properties").at(e)}})},"./src/style_manager/model/PropertyFactory.js":function(e,t,n){"use strict";n.r(t),t["default"]=function(){return{build:function(e){var t=[];"string"==typeof e&&(e=[e]);for(var n=0,r=e.length;n<r;n++){var i={},o=e[n];switch(i.property=o,o){case"border-radius-c":i.property="border-radius"}switch(o){case"top":case"right":case"bottom":case"left":case"margin-top":case"margin-right":case"margin-bottom":case"margin-left":case"padding-top":case"padding-right":case"padding-bottom":case"padding-left":case"width":case"max-width":case"min-width":case"height":case"max-height":case"min-height":case"flex-basis":i.fixedValues=["initial","inherit","auto"];break;case"font-size":i.fixedValues=["medium","xx-small","x-small","small","large","x-large","xx-large","smaller","larger","length","initial","inherit"];break;case"letter-spacing":case"line-height":i.fixedValues=["normal","initial","inherit"]}switch(o){case"float":case"position":case"text-align":i.type="radio";break;case"display":case"flex-direction":case"flex-wrap":case"justify-content":case"align-items":case"align-content":case"align-self":case"font-family":case"font-weight":case"border-style":case"box-shadow-type":case"background-repeat":case"background-position":case"background-attachment":case"background-size":case"transition-property":case"transition-timing-function":case"cursor":case"overflow":case"overflow-x":case"overflow-y":i.type="select";break;case"top":case"right":case"bottom":case"left":case"margin-top":case"margin-right":case"margin-bottom":case"margin-left":case"padding-top":case"padding-right":case"padding-bottom":case"padding-left":case"min-height":case"min-width":case"max-height":case"max-width":case"width":case"height":case"font-size":case"letter-spacing":case"line-height":case"text-shadow-h":case"text-shadow-v":case"text-shadow-blur":case"border-radius-c":case"border-top-left-radius":case"border-top-right-radius":case"border-bottom-left-radius":case"border-bottom-right-radius":case"border-width":case"box-shadow-h":case"box-shadow-v":case"box-shadow-blur":case"box-shadow-spread":case"transition-duration":case"perspective":case"transform-rotate-x":case"transform-rotate-y":case"transform-rotate-z":case"transform-scale-x":case"transform-scale-y":case"transform-scale-z":case"order":case"flex-grow":case"flex-shrink":case"flex-basis":i.type="integer";break;case"margin":case"padding":case"border-radius":case"border":case"transform":i.type="composite";break;case"color":case"text-shadow-color":case"background-color":case"border-color":case"box-shadow-color":i.type="color";break;case"text-shadow":case"box-shadow":case"background":case"transition":i.type="stack";break;case"background-image":i.type="file"}switch(o){case"float":case"background-color":case"text-shadow":i.defaults="none";break;case"display":i.defaults="block";break;case"flex-direction":i.defaults="row";break;case"flex-wrap":i.defaults="nowrap";break;case"justify-content":i.defaults="flex-start";break;case"align-items":i.defaults="stretch";break;case"align-content":i.defaults="stretch";break;case"align-self":i.defaults="auto";break;case"position":i.defaults="static";break;case"margin-top":case"margin-right":case"margin-bottom":case"margin-left":case"padding-top":case"padding-right":case"padding-bottom":case"padding-left":case"text-shadow-h":case"text-shadow-v":case"text-shadow-blur":case"border-radius-c":case"box-shadow-h":case"box-shadow-v":case"box-shadow-spread":case"perspective":case"transform-rotate-x":case"transform-rotate-y":case"transform-rotate-z":case"order":case"flex-grow":i.defaults=0;break;case"border-top-left-radius":case"border-top-right-radius":case"border-bottom-left-radius":case"border-bottom-right-radius":i.defaults="0px";break;case"transform-scale-x":case"transform-scale-y":case"transform-scale-z":case"flex-shrink":i.defaults=1;break;case"box-shadow-blur":i.defaults="5px";break;case"top":case"right":case"bottom":case"left":case"min-height":case"min-width":case"max-height":case"max-width":case"width":case"height":case"background-size":case"cursor":case"flex-basis":i.defaults="auto";break;case"font-family":i.defaults="Arial, Helvetica, sans-serif";break;case"font-size":case"border-width":i.defaults="medium";break;case"font-weight":i.defaults="400";break;case"letter-spacing":case"line-height":i.defaults="normal";break;case"color":case"text-shadow-color":case"border-color":case"box-shadow-color":i.defaults="black";break;case"text-align":i.defaults="left";break;case"border-style":i.defaults="solid";break;case"box-shadow-type":i.defaults="";break;case"background-repeat":i.defaults="repeat";break;case"background-position":i.defaults="left top";break;case"background-attachment":i.defaults="scroll";break;case"transition-property":i.defaults="width";break;case"transition-duration":i.defaults="2";break;case"transition-timing-function":i.defaults="ease";break;case"overflow":case"overflow-x":case"overflow-y":i.defaults="visible"}switch(o){case"flex-direction":case"flex-wrap":case"justify-content":case"align-items":case"align-content":i.requires={display:["flex"]};break;case"order":case"flex-basis":case"flex-grow":case"flex-shrink":case"align-self":i.requiresParent={display:["flex"]}}switch(o){case"top":case"bottom":case"margin-top":case"margin-bottom":case"padding-top":case"padding-bottom":case"min-height":case"max-height":case"height":i.units=["px","%","vh"];break;case"right":case"left":case"margin-right":case"margin-left":case"padding-right":case"padding-left":case"min-width":case"max-width":case"width":i.units=["px","%","vw"];break;case"flex-basis":i.units=["px","%","vw","vh"];break;case"text-shadow-v":case"text-shadow-h":case"text-shadow-blur":case"border-radius-c":case"border-top-left-radius":case"border-top-right-radius":case"border-bottom-left-radius":case"border-bottom-right-radius":case"box-shadow-h":case"box-shadow-v":i.units=["px","%"];break;case"font-size":case"letter-spacing":case"line-height":i.units=["px","em","rem","%"];break;case"border-width":i.units=["px","em"];break;case"box-shadow-blur":case"box-shadow-spread":case"perspective":i.units=["px"];break;case"transition-duration":i.units=["s"];break;case"transform-rotate-x":case"transform-rotate-y":case"transform-rotate-z":i.units=["deg"]}switch(o){case"padding-top":case"padding-right":case"padding-bottom":case"padding-left":case"min-height":case"min-width":case"max-height":case"max-width":case"width":case"height":case"font-size":case"text-shadow-blur":case"border-radius-c":case"border-top-left-radius":case"border-top-right-radius":case"border-bottom-left-radius":case"border-bottom-right-radius":case"border-width":case"box-shadow-blur":case"transition-duration":case"perspective":case"flex-basis":i.min=0}switch(o){case"text-shadow":case"box-shadow":case"background":i.preview=!0}switch(o){case"background":i.detached=!0}switch(o){case"transform-rotate-x":i.functionName="rotateX";break;case"transform-rotate-y":i.functionName="rotateY";break;case"transform-rotate-z":i.functionName="rotateZ";break;case"transform-scale-x":i.functionName="scaleX";break;case"transform-scale-y":i.functionName="scaleY";break;case"transform-scale-z":i.functionName="scaleZ";break;case"background-image":i.functionName="url"}switch(o){case"float":i.list=[{value:"none"},{value:"left"},{value:"right"}];break;case"display":i.list=[{value:"block"},{value:"inline"},{value:"inline-block"},{value:"flex"},{value:"none"}];break;case"flex-direction":i.list=[{value:"row"},{value:"row-reverse"},{value:"column"},{value:"column-reverse"}];break;case"flex-wrap":i.list=[{value:"nowrap"},{value:"wrap"},{value:"wrap-reverse"}];break;case"justify-content":i.list=[{value:"flex-start"},{value:"flex-end"},{value:"center"},{value:"space-between"},{value:"space-around"},{value:"space-evenly"}];break;case"align-items":i.list=[{value:"flex-start"},{value:"flex-end"},{value:"center"},{value:"baseline"},{value:"stretch"}];break;case"align-content":i.list=[{value:"flex-start"},{value:"flex-end"},{value:"center"},{value:"space-between"},{value:"space-around"},{value:"stretch"}];break;case"align-self":i.list=[{value:"auto"},{value:"flex-start"},{value:"flex-end"},{value:"center"},{value:"baseline"},{value:"stretch"}];break;case"position":i.list=[{value:"static"},{value:"relative"},{value:"absolute"},{value:"fixed"}];break;case"font-family":var s=", sans-serif",a=["Arial, Helvetica"+s,"Arial Black, Gadget"+s,"Brush Script MT"+s,"Comic Sans MS, cursive"+s,"Courier New, Courier, monospace","Georgia, serif","Helvetica, serif","Impact, Charcoal"+s,"Lucida Sans Unicode, Lucida Grande"+s,"Tahoma, Geneva"+s,"Times New Roman, Times, serif","Trebuchet MS, Helvetica"+s,"Verdana, Geneva"+s];i.list=[];for(var l=0,c=a.length;l<c;l++){var u={};u.value=a[l],u.name=a[l].split(",")[0],i.list.push(u)}break;case"font-weight":i.list=[{value:"100",name:"Thin"},{value:"200",name:"Extra-Light"},{value:"300",name:"Light"},{value:"400",name:"Normal"},{value:"500",name:"Medium"},{value:"600",name:"Semi-Bold"},{value:"700",name:"Bold"},{value:"800",name:"Extra-Bold"},{value:"900",name:"Ultra-Bold"}];break;case"text-align":i.list=[{value:"left"},{value:"center"},{value:"right"},{value:"justify"}];break;case"border-style":i.list=[{value:"none"},{value:"solid"},{value:"dotted"},{value:"dashed"},{value:"double"},{value:"groove"},{value:"ridge"},{value:"inset"},{value:"outset"}];break;case"box-shadow-type":i.list=[{value:"",name:"Outside"},{value:"inset",name:"Inside"}];break;case"background-repeat":i.list=[{value:"repeat"},{value:"repeat-x"},{value:"repeat-y"},{value:"no-repeat"}];break;case"background-position":i.list=[{value:"left top"},{value:"left center"},{value:"left bottom"},{value:"right top"},{value:"right center"},{value:"right bottom"},{value:"center top"},{value:"center center"},{value:"center bottom"}];break;case"background-attachment":i.list=[{value:"scroll"},{value:"fixed"},{value:"local"}];break;case"background-size":i.list=[{value:"auto"},{value:"cover"},{value:"contain"}];break;case"transition-property":i.list=[{value:"all"},{value:"width"},{value:"height"},{value:"background-color"},{value:"transform"},{value:"box-shadow"},{value:"opacity"}];break;case"transition-timing-function":i.list=[{value:"linear"},{value:"ease"},{value:"ease-in"},{value:"ease-out"},{value:"ease-in-out"}];break;case"cursor":i.list=[{value:"auto"},{value:"pointer"},{value:"copy"},{value:"crosshair"},{value:"grab"},{value:"grabbing"},{value:"help"},{value:"move"},{value:"text"}];break;case"overflow":case"overflow-x":case"overflow-y":i.list=[{value:"visible"},{value:"hidden"},{value:"scroll"},{value:"auto"}]}switch(o){case"margin":i.properties=this.build(["margin-top","margin-right","margin-bottom","margin-left"]);break;case"padding":i.properties=this.build(["padding-top","padding-right","padding-bottom","padding-left"]);break;case"text-shadow":i.properties=this.build(["text-shadow-h","text-shadow-v","text-shadow-blur","text-shadow-color"]);break;case"border":i.properties=this.build(["border-width","border-style","border-color"]);break;case"border-radius":i.properties=this.build(["border-top-left-radius","border-top-right-radius","border-bottom-right-radius","border-bottom-left-radius"]);break;case"box-shadow":i.properties=this.build(["box-shadow-h","box-shadow-v","box-shadow-blur","box-shadow-spread","box-shadow-color","box-shadow-type"]);break;case"background":i.properties=this.build(["background-image","background-repeat","background-position","background-attachment","background-size"]);break;case"transition":i.properties=this.build(["transition-property","transition-duration","transition-timing-function"]);break;case"transform":i.properties=this.build(["transform-rotate-x","transform-rotate-y","transform-rotate-z","transform-scale-x","transform-scale-y","transform-scale-z"])}t.push(i)}return t}}}},"./src/style_manager/model/PropertyInteger.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./node_modules/underscore/underscore.js"),l=(n.n(a),n("./src/style_manager/model/Property.js")),c=n("./src/domain_abstract/ui/InputNumber.js");t["default"]=l["default"].extend({defaults:i({},l["default"].prototype.defaults,{units:[],unit:"",step:1,min:"",max:""}),initialize:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};l["default"].callParentInit(l["default"],this,e,t);var n=this.get("unit"),r=this.get("units");this.input=new c["default"]({model:this}),r.length&&!n&&this.set("unit",r[0]),l["default"].callInit(this,e,t)},clearValue:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.set({value:void 0,unit:void 0},e),this},parseValue:function(e){var t=l["default"].prototype.parseValue.apply(this,arguments),n=this.input.validateInputValue(t.value,{deepCheck:1}),r=n.value,i=n.unit;return t.value=r,t.unit=i,t},getFullValue:function(){var e=this.get("value"),t=this.get("unit");return e=Object(a.isUndefined)(e)?"":e,t=!Object(a.isUndefined)(t)&&e?t:"",e="".concat(e).concat(t),l["default"].prototype.getFullValue.apply(this,[e])}})},"./src/style_manager/model/PropertyRadio.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){l()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/toConsumableArray.js"),s=n.n(o),a=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),l=n.n(a),c=n("./src/style_manager/model/Property.js");t["default"]=c["default"].extend({defaults:function(){return i({},c["default"].prototype.defaults,{options:[],full:1})},initialize:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];c["default"].prototype.initialize.apply(this,t),this.listenTo(this,"change:options",this.onOptionChange)},onOptionChange:function(){this.set("list",this.get("options"))},getOptions:function(){var e=this.attributes,t=e.options,n=e.list;return t&&t.length?t:n},setOptions:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this.set("options",e),this},addOption:function(e){if(e){var t=this.getOptions();this.setOptions([].concat(s()(t),[e]))}return this}})},"./src/style_manager/model/PropertySelect.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./src/style_manager/model/PropertyRadio.js");t["default"]=a["default"].extend({defaults:function(){return i({},a["default"].prototype.defaults(),{full:0})}})},"./src/style_manager/model/PropertySlider.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./src/style_manager/model/PropertyInteger.js");t["default"]=a["default"].extend({defaults:i({},a["default"].prototype.defaults,{showInput:1})})},"./src/style_manager/model/PropertyStack.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./src/style_manager/model/PropertyComposite.js"),l=n("./src/style_manager/model/Layers.js");t["default"]=a["default"].extend({defaults:i({},a["default"].prototype.defaults,{layers:[],layerSeparator:", ",prepend:0,preview:0}),initialize:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};a["default"].callParentInit(a["default"],this,e,t);var n=this.get("layers"),r=new l["default"](n);r.property=this,r.properties=this.get("properties"),this.set("layers",r),a["default"].callInit(this,e,t)},getLayers:function(){return this.get("layers")},getCurrentLayer:function(){return this.getLayers().filter(function(e){return e.get("active")})[0]},getFullValue:function(){return this.get("detached")?"":this.get("layers").getFullValue()},getValueFromStyle:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.getLayers().getLayersFromStyle(e);return new l["default"](t).getFullValue()},clearValue:function(){return this.getLayers().reset(),a["default"].prototype.clearValue.apply(this,arguments)},getLayersFromTarget:function(e){}})},"./src/style_manager/model/Sector.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=n("./node_modules/underscore/underscore.js"),s=(n.n(o),n("./src/style_manager/model/Properties.js")),a=n("./src/style_manager/model/PropertyFactory.js");t["default"]=i.a.Model.extend({defaults:{id:"",name:"",open:!0,buildProps:"",extendBuilded:1,properties:[]},initialize:function(e){var t=e||{},n=this.buildProperties(t.buildProps),r=this.get("name")||"",i=[];!this.get("id")&&this.set("id",r.replace(/ /g,"_").toLowerCase()),i=n?this.extendProperties(n):this.get("properties");var o=new s["default"](i);o.sector=this,this.set("properties",o)},extendProperties:function(e,t,n){for(var r=e.length,i=t||this.get("properties"),s=this.get("extendBuilded"),a=[],l=0,c=i.length;l<c;l++){for(var u=i[l],d=0,h=0;h<r;h++){var f=e[h];if(u.property!=f.property&&u.id!=f.property);else{var p=u.properties;p&&p.length&&(u.properties=this.extendProperties(f.properties||[],p,1)),e[h]=s?Object(o.extend)(f,u):u,a[h]=e[h],d=1}}d||(e.push(u),a.push(u))}return n?a.filter(function(e){return e}):e},buildProperties:function(e){var t,n=e||[];if(n.length)return this.propFactory||(this.propFactory=new a["default"]),t=this.propFactory.build(n)}})},"./src/style_manager/model/Sectors.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=n("./src/style_manager/model/Sector.js");t["default"]=i.a.Collection.extend({model:o["default"]})},"./src/style_manager/view/LayerView.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/underscore/underscore.js"),i=(n.n(r),n("./node_modules/backbone/backbone.js")),o=n.n(i),s=n("./src/style_manager/view/PropertiesView.js");t["default"]=o.a.View.extend({events:{click:"active","click [data-close-layer]":"remove","mousedown [data-move-layer]":"initSorter","touchstart [data-move-layer]":"initSorter"},template:function(e){var t=this.pfx,n=this.ppfx,r=this.em,i="".concat(r&&r.t("styleManager.layer")," ").concat(e.get("index"));return'\n <div id="'.concat(t,'move" class="').concat(n,'no-touch-actions" data-move-layer>\n <i class="fa fa-arrows"></i>\n </div>\n <div id="').concat(t,'label">').concat(i,'</div>\n <div id="').concat(t,'preview-box">\n \t<div id="').concat(t,'preview" data-preview></div>\n </div>\n <div id="').concat(t,'close-layer" class="').concat(t,'btn-close" data-close-layer>\n ⨯\n </div>\n <div id="').concat(t,'inputs" data-properties></div>\n <div style="clear:both"></div>\n ')},initialize:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.model;this.stackModel=e.stackModel,this.config=e.config||{},this.em=this.config.em,this.pfx=this.config.stylePrefix||"",this.ppfx=this.config.pStylePrefix||"",this.sorter=e.sorter||null,this.propsConfig=e.propsConfig||{},this.customPreview=e.onPreview,this.listenTo(t,"destroy remove",this.remove),this.listenTo(t,"change:active",this.updateVisibility),this.listenTo(t.get("properties"),"change",this.updatePreview),t.view=this,t.set({droppable:0,draggable:1}),this.$el.data("model",t)},initSorter:function(e){this.sorter&&this.sorter.startSort(this.el)},remove:function(e){e&&e.stopPropagation&&e.stopPropagation();var t=this.model,n=t.collection,r=this.stackModel;o.a.View.prototype.remove.apply(this,arguments),n.contains(t)&&n.remove(t),r&&r.set&&(r.set({stackIndex:null},{silent:!0}),r.trigger("updateValue"))},onPreview:function(e){var t=this.stackModel,n=t&&t.get("detached"),r=e.split(" "),i=3,o=[],s={};return this.model.get("properties").each(function(e,t){var a=e.get("property"),l=n?e.getFullValue():r[t]||"";if(l&&"integer"==e.get("type")){var c=parseInt(l,10),u=l.replace(c,"");c=isNaN(c)?0:c,c=c>i?i:c,c=c<-i?-i:c,l=c+u}o.push(l),s[a]=l}),n?s:o.join(" ")},updatePreview:function(){var e=this.stackModel,t=this.customPreview,n=this.getPreviewEl(),i=this.model.getFullValue(),o=t?t(i):this.onPreview(i);if(o&&e&&n){var s=n.style;if(Object(r.isString)(o))s[e.get("property")]=o;else{var a=[];Object(r.each)(o,function(e,t){return a.push("".concat(t,":").concat(e))}),n.setAttribute("style",a.join(";"))}}},getPropertiesWrapper:function(){return this.propsWrapEl||(this.propsWrapEl=this.el.querySelector("[data-properties]")),this.propsWrapEl},getPreviewEl:function(){return this.previewEl||(this.previewEl=this.el.querySelector("[data-preview]")),this.previewEl},active:function(){var e=this.model,t=e.collection;t.active(t.indexOf(e))},updateVisibility:function(){var e=this.pfx,t=this.getPropertiesWrapper(),n=this.model.get("active");t.style.display=n?"":"none",this.$el[n?"addClass":"removeClass"]("".concat(e,"active"))},render:function(){var e=this.propsConfig,t=this.model,n=this.el,r=this.pfx,i=t.get("preview"),o=new s["default"]({collection:t.get("properties"),config:this.config,target:e.target,customValue:e.customValue,propTarget:e.propTarget,onChange:e.onChange}).render().el;return n.innerHTML=this.template(t),n.className="".concat(r,"layer").concat(i?"":" ".concat(r,"no-preview")),this.getPropertiesWrapper().appendChild(o),this.updateVisibility(),this.updatePreview(),this}})},"./src/style_manager/view/LayersView.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=n("./src/style_manager/view/LayerView.js");t["default"]=i.a.View.extend({initialize:function(e){this.config=e.config||{},this.stackModel=e.stackModel,this.preview=e.preview,this.pfx=this.config.stylePrefix||"",this.ppfx=this.config.pStylePrefix||"",this.propsConfig=e.propsConfig;var t=this.pfx,n=this.ppfx,r=this.collection;this.className="".concat(t,"layers ").concat(n,"field"),this.listenTo(r,"add",this.addTo),this.listenTo(r,"deselectAll",this.deselectAll),this.listenTo(r,"reset",this.render);var i=this.config.em||"",o=i?i.get("Utils"):"";this.sorter=o?new o.Sorter({container:this.el,ignoreViewChildren:1,containerSel:".".concat(t,"layers"),itemSel:".".concat(t,"layer"),pfx:this.config.pStylePrefix}):"",r.view=this,this.$el.data("model",r),this.$el.data("collection",r)},addTo:function(e){var t=this.collection.indexOf(e);this.addToCollection(e,null,t)},addToCollection:function(e,t,n){var r=t||null,i=this.stackModel,s=this.config,a=this.sorter,l=this.propsConfig;"undefined"!=typeof this.preview&&e.set("preview",this.preview);var c=new o["default"]({model:e,config:s,sorter:a,stackModel:i,propsConfig:l}),u=c.render().el;if(r)r.appendChild(u);else if("undefined"!=typeof n){var d="before";this.$el.children().length==n&&(n--,d="after"),n<0?this.$el.append(u):this.$el.children().eq(n)[d](u)}else this.$el.append(u);return u},deselectAll:function(){this.$el.find("."+this.pfx+"layer").removeClass(this.pfx+"active");
|
||
},render:function(){var e=document.createDocumentFragment();return this.$el.empty(),this.collection.each(function(t){this.addToCollection(t,e)},this),this.$el.append(e),this.$el.attr("class",this.className),this.sorter&&(this.sorter.plh=null),this}})},"./src/style_manager/view/PropertiesView.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=n("./src/utils/dom.js");t["default"]=i.a.View.extend({initialize:function(e){this.config=e.config||{},this.pfx=this.config.stylePrefix||"",this.target=e.target||{},this.propTarget=e.propTarget||{},this.onChange=e.onChange,this.onInputRender=e.onInputRender||{},this.customValue=e.customValue||{},this.properties=[];var t=this.collection;this.listenTo(t,"add",this.addTo),this.listenTo(t,"reset",this.render)},addTo:function(e,t,n){this.add(e,null,n)},add:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=t||this.el,i=new e.typeView({model:e,name:e.get("name"),id:this.pfx+e.get("property"),target:this.target,propTarget:this.propTarget,onChange:this.onChange,onInputRender:this.onInputRender,config:this.config});"composite"!=e.get("type")&&(i.customValue=this.customValue),i.render();var s=i.el;this.properties.push(i),i.updateVisibility(),Object(o.appendAtIndex)(r,s,n.at)},render:function(){var e=this,t=this.$el;this.properties=[];var n=document.createDocumentFragment();return this.collection.each(function(t){return e.add(t,n)}),t.empty(),t.append(n),t.attr("class","".concat(this.pfx,"properties")),this}})},"./src/style_manager/view/PropertyColorView.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./src/style_manager/view/PropertyIntegerView.js"),l=n("./src/domain_abstract/ui/InputColor.js");t["default"]=a["default"].extend({setValue:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t=i({},t,{silent:1}),this.inputInst.setValue(e,t)},onRender:function(){if(!this.input){var e=this.ppfx,t=new l["default"]({target:this.target,model:this.model,ppfx:e}),n=t.render();this.el.querySelector(".".concat(e,"fields")).appendChild(n.el),this.$input=n.inputEl,this.$color=n.colorEl,this.input=this.$input.get(0),this.inputInst=n}}})},"./src/style_manager/view/PropertyCompositeView.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./node_modules/backbone/backbone.js"),l=n.n(a),c=n("./src/style_manager/view/PropertyView.js"),u=l.a.$;t["default"]=c["default"].extend({templateInput:function(){var e=this.pfx;return'\n <div class="'.concat(e,"field ").concat(e,'composite">\n <span id="').concat(e,'input-holder"></span>\n </div>\n ')},inputValueChanged:function(){if(!this.model.get("detached")){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];c["default"].prototype.inputValueChanged.apply(this,t)}},clear:function(e){var t=this.properties;t&&t.forEach(function(e){return e.clear()}),c["default"].prototype.clear.apply(this,arguments)},onRender:function(){var e=this.model,t=e.get("properties")||[];if(this.properties=[],t.length&&(this.$input||(this.$input=u('<input type="hidden" value="0">'),this.input=this.$input.get(0)),this.props||(this.props=e.get("properties")),!this.$props)){this.props.each(function(t,n){t&&"composite"==t.get("type")&&(this.props.remove(t),console.warn("Nested composite types not yet allowed.")),t.parent=e},this);var r=n("./src/style_manager/view/PropertiesView.js")["default"],i=new r(this.getPropsConfig());this.$props=i.render().$el,this.properties=i.properties,this.$el.find("#".concat(this.pfx,"input-holder")).append(this.$props)}},getPropsConfig:function(e){var t=this,n=this.model,r={config:i({},this.config,{highlightComputed:0}),collection:this.props,target:this.target,propTarget:this.propTarget,onChange:function(e,t,r){n.set("value",n.getFullValue(),r)},customValue:function(e,n){return t.valueOnIndex(n,e)}};return n.get("detached")&&delete r.onChange,r},valueOnIndex:function(e,t){var n,r=this.getTargetValue({ignoreDefault:1});if(r){var i=r.split(this.model.getSplitSeparator());n=i[e]}else n=t&&t.getTargetValue({ignoreCustomValue:1,ignoreDefault:1});return n},clearCached:function(){c["default"].prototype.clearCached.apply(this,arguments),this.$input=null,this.props=null,this.$props=null}})},"./src/style_manager/view/PropertyFileView.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/underscore/underscore.js"),i=(n.n(r),n("./node_modules/backbone/backbone.js")),o=n.n(i),s=n("./src/style_manager/view/PropertyView.js"),a=o.a.$;t["default"]=s["default"].extend({templateInput:function(){var e=this.pfx,t=this.em;return'\n <div class="'.concat(e,"field ").concat(e,"file\">\n <div id='").concat(e,"input-holder'>\n <div class=\"").concat(e,'btn-c">\n <button class="').concat(e,'btn" id="').concat(e,'images" type="button">\n ').concat(t.t("styleManager.fileButton"),'\n </button>\n </div>\n <div style="clear:both;"></div>\n </div>\n <div id="').concat(e,'preview-box">\n <div id="').concat(e,'preview-file"></div>\n <div id="').concat(e,'close">⨯</div>\n </div>\n </div>\n ')},init:function(){var e=this.em;this.modal=e.get("Modal"),this.am=e.get("AssetManager"),this.events["click #"+this.pfx+"close"]="removeFile",this.events["click #"+this.pfx+"images"]="openAssetManager",this.delegateEvents()},onRender:function(){if(!this.$input){var e=this.model.getDefaultValue();this.$input=a('<input placeholder="'.concat(e,'">'))}this.$preview||(this.$preview=this.$el.find("#"+this.pfx+"preview-file")),this.$previewBox||(this.$previewBox=this.$el.find("#"+this.pfx+"preview-box")),this.setValue(this.componentValue,0)},clearCached:function(){s["default"].prototype.clearCached.apply(this,arguments),this.$preview=null,this.$previewBox=null},setValue:function(e,t){s["default"].prototype.setValue.apply(this,arguments),this.setPreviewView(e&&e!=this.model.getDefaultValue()),this.setPreview(e)},setPreviewView:function(e){var t=this.$previewBox;t&&t[e?"addClass":"removeClass"]("".concat(this.pfx,"show")),t&&t.css({display:e?"block":"none"})},spreadUrl:function(e){this.model.set("value",e),this.setPreviewView(1)},setPreview:function(e){var t=this.$preview;e=e&&e.indexOf("url(")<0?"url(".concat(e,")"):e,t&&t.css("background-image",e)},cleanValue:function(){this.setPreviewView(0),this.model.set({value:""},{silent:!0})},removeFile:function(){this.model.set("value",this.model.getDefaultValue());for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];s["default"].prototype.cleanValue.apply(this,t),this.setPreviewView(0)},openAssetManager:function(e){var t=this,n=this.em,i=this.modal,o=n?n.get("Editor"):"";o&&o.runCommand("open-assets",{types:["image"],accept:"image/*",target:this.getTargetModel(),onClick:function(){},onDblClick:function(){},onSelect:function(e){i.close();var n=Object(r.isString)(e)?e:e.get("src");t.spreadUrl(n)}})}})},"./src/style_manager/view/PropertyIntegerView.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=n("./src/style_manager/view/PropertyView.js"),s=i.a.$;t["default"]=o["default"].extend({templateInput:function(){return""},init:function(){var e=this.model;this.listenTo(e,"change:unit",this.modelValueChanged),this.listenTo(e,"el:change",this.elementUpdated),this.listenTo(e,"change:units",this.render)},setValue:function(e){var t=this.model.parseValue(e);e="".concat(t.value).concat(t.unit),this.inputInst.setValue(e,{silent:1})},onRender:function(){var e=this.ppfx;if(!this.input){var t=this.model.input;t.ppfx=e,t.render();var n=this.el.querySelector(".".concat(e,"fields"));n.appendChild(t.el),this.$input=t.inputEl,this.unit=t.unitEl,this.$unit=s(this.unit),this.input=this.$input.get(0),this.inputInst=t}},clearCached:function(){o["default"].prototype.clearCached.apply(this,arguments),this.unit=null,this.$unit=null}})},"./src/style_manager/view/PropertyRadioView.js":function(e,t,n){"use strict";n.r(t);var r=n("./src/style_manager/view/PropertyView.js");t["default"]=r["default"].extend({templateInput:function(){var e=(this.pfx,this.ppfx);return'\n <div class="'.concat(e,"field ").concat(e,'field-radio">\n </div>\n ')},onRender:function(){var e=this.pfx,t=this.ppfx,n="".concat(t,"radio-item-label"),r=this.model,i=r.get("property"),o=r.get("list")||r.get("options")||[],s=r.cid,a="".concat(e,"radio ").concat(e,"radio-").concat(i);if(!this.input&&o&&o.length){var l="";o.forEach(function(r){var o=r.className?"".concat(r.className," ").concat(e,"icon ").concat(n):"",c="".concat(i,"-").concat(r.value,"-").concat(s),u=r.name||r.value,d=r.title?'title="'.concat(r.title,'"'):"";l+='\n <div class="'.concat(t,'radio-item">\n <input type="radio" class="').concat(a,'" id="').concat(c,'" name="').concat(i,"-").concat(s,'" value="').concat(r.value,'"/>\n <label class="').concat(o||n,'" ').concat(d,' for="').concat(c,'">').concat(o?"":u,"</label>\n </div>\n ")});var c=this.el.querySelector(".".concat(t,"field"));c.innerHTML='<div class="'.concat(t,'radio-items">').concat(l,"</div>"),this.input=c.firstChild}},getInputValue:function(){var e=this.getCheckedEl();return e?e.value:""},getCheckedEl:function(){var e=this.getInputEl();return e?e.querySelector("input:checked"):""},setValue:function(e){var t=this.model,n=e||t.get("value")||t.getDefaultValue(),r=this.getInputEl(),i=r?r.querySelector('[value="'.concat(n,'"]')):"";if(i)i.checked=!0;else{var o=this.getCheckedEl();o&&(o.checked=!1)}}})},"./src/style_manager/view/PropertySelectView.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=n("./src/style_manager/view/PropertyView.js");i.a.$;t["default"]=o["default"].extend({templateInput:function(){var e=this.pfx,t=this.ppfx;return'\n <div class="'.concat(t,"field ").concat(t,'select">\n <span id="').concat(e,'input-holder"></span>\n <div class="').concat(t,'sel-arrow">\n <div class="').concat(t,'d-s-arrow"></div>\n </div>\n </div>\n ')},initialize:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];o["default"].prototype.initialize.apply(this,t),this.listenTo(this.model,"change:options",this.updateOptions)},updateOptions:function(){this.input=null,this.onRender()},onRender:function(){var e=this.pfx,t=this.model.getOptions();if(!this.input){var n="";t.forEach(function(e){var t=e.name||e.value,r=e.style?e.style.replace(/"/g,"""):"",i=r?'style="'.concat(r,'"'):"",o=e.value.replace(/"/g,""");n+='<option value="'.concat(o,'" ').concat(i,">").concat(t,"</option>")});var r=this.el.querySelector("#".concat(e,"input-holder"));r.innerHTML="<select>".concat(n,"</select>"),this.input=r.firstChild}}})},"./src/style_manager/view/PropertySliderView.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./src/style_manager/view/PropertyIntegerView.js");t["default"]=a["default"].extend({events:function(){return i({},a["default"].prototype.events,{"change [type=range]":"inputValueChanged","input [type=range]":"inputValueChangedSoft",change:""})},templateInput:function(e){var t=this.ppfx;return'\n <div class="'.concat(t,"field ").concat(t,'field-range">\n <input type="range"\n min="').concat(e.get("min"),'"\n max="').concat(e.get("max"),'"\n step="').concat(e.get("step"),'"/>\n </div>\n ')},getSliderEl:function(){return this.slider||(this.slider=this.el.querySelector("input[type=range]")),this.slider},inputValueChanged:function(){var e=this.model,t=e.get("step");this.getInputEl().value=this.getSliderEl().value;var n=this.getInputValue()-t;e.set("value",n,{avoidStore:1}).set("value",n+t),this.elementUpdated()},inputValueChangedSoft:function(){this.getInputEl().value=this.getSliderEl().value,this.model.set("value",this.getInputValue(),{avoidStore:1}),this.elementUpdated()},setValue:function(e){var t=this.model.parseValue(e);this.getSliderEl().value=parseFloat(t.value),a["default"].prototype.setValue.apply(this,arguments)},onRender:function(){a["default"].prototype.onRender.apply(this,arguments),this.model.get("showInput")||(this.inputInst.el.style.display="none")},clearCached:function(){a["default"].prototype.clearCached.apply(this,arguments),this.slider=null}})},"./src/style_manager/view/PropertyStackView.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./node_modules/underscore/underscore.js"),l=(n.n(a),n("./src/style_manager/view/PropertyCompositeView.js")),c=n("./src/style_manager/view/LayersView.js"),u=n("./src/code_manager/model/CssGenerator.js"),d=new u["default"];t["default"]=l["default"].extend({templateInput:function(){var e=this.pfx;this.ppfx;return'\n <div class="'.concat(e,"field ").concat(e,'stack">\n <button type="button" id="').concat(e,'add" data-add-layer>+</button>\n <div data-layers-wrapper></div>\n </div>\n ')},init:function(){var e=this.model;this.pfx;e.set("stackIndex",null),this.events["click [data-add-layer]"]="addLayer",this.listenTo(e,"change:stackIndex",this.indexChanged),this.listenTo(e,"updateValue",this.inputValueChanged),this.delegateEvents()},targetUpdated:function(){if(this.model.get("detached")){var e=this._getTargetData(),t=e.status;this.setStatus(t),this.checkVisibility()}else{for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];l["default"].prototype.targetUpdated.apply(this,r)}this.refreshLayers()},getLayers:function(){return this.model.get("layers")},indexChanged:function(e){var t=this.model;this.getLayers().active(t.get("stackIndex"))},addLayer:function(){var e=this.model,t=this.getLayers(),n=e.get("prepend"),r=e.get("properties").deepClone();r.each(function(e){return e.set("value","")});var o=t.add({properties:r},i({active:1},n&&{at:0}));this.inputValueChanged(),e.set("stackIndex",t.indexOf(o))},inputValueChanged:function(){var e=this.model;this.elementUpdated(),e.get("detached")?e.get("properties").each(function(e){return e.trigger("change:value")}):e.set("value",this.getLayerValues())},setValue:function(){},getLayerValues:function(){return this.getLayers().getFullValue()},_getClassRule:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.em,n=e.skipAdd,r=void 0===n?1:n,i=t.getSelected(),o=t.get("StyleManager").getModelToStyle(i,{skipAdd:r,useClasses:1});return o!==i&&o},_getParentTarget:function(e){for(var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.em,i=this.model,o=i.get("property"),s=n.isValid||function(e){return e.getStyle()[o]},a=r.get("CssComposer").getAll().filter(function(t){return t.selectorsToString()===e.getSelectorsString()}),l=a.reduce(function(e,t){return e[t.getAtRule()]=t,e},{}),c=d.sortMediaObject(l),u=c.map(function(e){return e.value}),h=u.indexOf(e),f=u.splice(0,h),p=f.length-1;p>-1;p--){var g=f[p];if(s(g)){t=g;break}}return t},refreshLayers:function(){var e,t,n,r,i,o,s=[],l=this.model,c=this.em,u=this.getLayers(),d=l.get("detached"),h=l.get("property"),f=this.getTarget(),p=this.getComputedValue(),g=c.getSelected();if(d){t=f?f.getStyle():{};var m=function(e){var t=l.get("properties").at(0).get("property");return e&&!Object(a.isUndefined)(e.getStyle()[t])};if(!Object(a.keys)(t).length&&p&&g){var v={isValid:function(e){return m(e)}};r=this._getParentTarget(f,v),r?t=r.getStyle():(n=this._getClassRule(),i=m(n)&&n.getStyle(),r=!i&&this._getParentTarget(this._getClassRule({skipAdd:0}),v),o=m(r)&&r.getStyle(),t=i||o||{})}e=t,s=u.getLayersFromStyle(t)}else{var b=this.getTargetValue({ignoreDefault:1}),y=b;!y&&p&&(r=this._getParentTarget(f),r?y=r.getStyle()[h]:(n=this._getClassRule(),i=n&&n.getStyle()[h],r=!i&&this._getParentTarget(this._getClassRule({skipAdd:0})),o=r&&r.getStyle()[h],y=i||o||p)),y=y==l.getDefaultValue()?"":y,e=y,s=u.getLayersFromValue(y)}var w=l.getLayersFromTarget(f,{resultValue:e,layersObj:s})||s;u.reset(),u.add(w),l.set({stackIndex:null},{silent:!0})},getTargetValue:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=l["default"].prototype.getTargetValue.call(this,e),n=this.model.attributes.detached;return Object(a.isUndefined)(t)&&!n&&(t=this.model.getValueFromStyle(this.getTarget().getStyle())),t},onRender:function(){var e=this,t=this.model,r=this.el.querySelector("[data-layers-wrapper]"),i=n("./src/style_manager/view/PropertiesView.js")["default"],o={target:this.target,propTarget:this.propTarget,onChange:function(n,r,i){var o=r.model;if(t.get("detached")){var s=o.get("property"),a=o.getDefaultValue(),l=e.getLayers().getPropertyValues(s,a);r.updateTargetStyle(l,null,i)}else if("updated"==t.get("status")){var c=t.getFullValue();t.set("value",c,i),!c&&r.updateTargetStyle(c,null,i)}}},s=new c["default"]({collection:this.getLayers(),stackModel:t,preview:t.get("preview"),config:this.config,propsConfig:o}).render().el;new i({target:this.target,collection:this.model.get("properties"),stackModel:t,config:this.config,onChange:o.onChange,propTarget:o.propTarget}).render(),r.appendChild(s)}})},"./src/style_manager/view/PropertyView.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){l()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/objectWithoutProperties.js"),s=n.n(o),a=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),l=n.n(a),c=n("./node_modules/backbone/backbone.js"),u=n.n(c),d=n("./node_modules/underscore/underscore.js"),h=(n.n(d),n("./src/utils/mixins.js")),f="data-clear-style";t["default"]=u.a.View.extend({template:function(e){var t=this.pfx;return'\n <div class="'.concat(t,'label">\n ').concat(this.templateLabel(e),'\n </div>\n <div class="').concat(this.ppfx,'fields">\n ').concat(this.templateInput(e),"\n </div>\n ")},templateLabel:function(e){var t=this.pfx,n=this.em,r=e.parent,i=e.attributes,o=i.icon,s=void 0===o?"":o,a=i.info,l=void 0===a?"":a,c=i.id,u=i.name,d=n&&n.t("styleManager.properties.".concat(c))||u;return'\n <span class="'.concat(t,"icon ").concat(s,'" title="').concat(l,'">\n ').concat(d,"\n </span>\n ").concat(r?"":'<b class="'.concat(t,'clear" ').concat(f,">⨯</b>"),"\n ")},templateInput:function(e){return'\n <div class="'.concat(this.ppfx,'field">\n <input placeholder="').concat(e.getDefaultValue(),'"/>\n </div>\n ')},events:l()({change:"inputValueChanged"},"click [".concat(f,"]"),"clear"),initialize:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(d.bindAll)(this,"targetUpdated"),this.config=t.config||{};var n=this.config.em;this.em=n,this.pfx=this.config.stylePrefix||"",this.ppfx=this.config.pStylePrefix||"",this.target=t.target||{},this.propTarget=t.propTarget||{},this.onChange=t.onChange,this.onInputRender=t.onInputRender||{},this.customValue=t.customValue||{};var r=this.model;this.property=r.get("property"),this.input=null;var i=this.pfx;this.inputHolderId="#"+i+"input-holder",this.sector=r.collection&&r.collection.sector,r.view=this,r.get("value")||r.set("value",r.getDefaultValue()),n&&n.on("update:component:style:".concat(this.property),this.targetUpdated);var o=r.get("requires");o&&Object.keys(o).forEach(function(t){n&&n.on("component:styleUpdate:".concat(t),e.targetUpdated)}),this.listenTo(this.propTarget,"update styleManager:update",this.targetUpdated),this.listenTo(r,"destroy remove",this.remove),this.listenTo(r,"change:value",this.modelValueChanged),this.listenTo(r,"targetUpdated",this.targetUpdated),this.listenTo(r,"change:visible",this.updateVisibility),this.listenTo(r,"change:status",this.updateStatus),this.listenTo(r,"change:name change:className change:full",this.render);var s=this.init&&this.init.bind(this);s&&s()},updateStatus:function(){var e=this.model,t=e.get("status"),n=e.parent,r=this.pfx,i=this.ppfx,o=this.config,s="".concat(i,"four-color"),a="".concat(i,"color-warn"),l=this.$el.children(".".concat(r,"label")),c=this.getClearEl(),u=c?c.style:{};switch(l.removeClass("".concat(s," ").concat(a)),u.display="none",t){case"updated":!n&&l.addClass(s),o.clearProperties&&(u.display="inline");break;case"computed":l.addClass(a)}},clear:function(e){var t=this;e&&e.stopPropagation(),this.model.clearValue(),setTimeout(function(){return t.targetUpdated()})},getClearEl:function(){return this.clearEl||(this.clearEl=this.el.querySelector("[".concat(f,"]"))),this.clearEl},getTarget:function(){return this.getTargetModel()},getTargets:function(){var e=this.propTarget.targets;return e||[this.getTarget()]},getTargetModel:function(){return this.propTarget&&this.propTarget.model},getHelperModel:function(){return this.propTarget&&this.propTarget.helper},inputValueChanged:function(e){e&&e.stopPropagation(),this.model.setValue(this.getInputValue(),1,{fromInput:1}),this.elementUpdated()},elementUpdated:function(){this.setStatus("updated")},setStatus:function(e){this.model.set("status",e);var t=this.model.parent;t&&"updated"==e&&t.set("status",e)},emitUpdateTarget:Object(d.debounce)(function(){var e=this.config.em;e&&e.trigger("styleManager:update:target",this.getTarget())}),_getTargetData:function(){var e=this.model,t=this.config,n=this.getTargetValue({ignoreDefault:1}),r=e.getDefaultValue(),i=this.getComputedValue(),o="",s="";return n?(o=n,t.highlightChanged&&(s="updated")):i&&t.showComputed&&i!=r?(o=i,t.highlightComputed&&(s="computed")):(o=r,s=""),{value:o,status:s,targetValue:n,defaultValue:r,computedValue:i}},targetUpdated:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this.emitUpdateTarget(),this.checkVisibility()){var r=this.config,o=r.em,a=this.model,l=a.get("property"),c=this._getTargetData(),u=c.status,d=c.value,h=s()(c,["status","value"]);if(this.setStatus(u),a.setValue(d,0,i({fromTarget:1},n)),o){var f=i({status:u,value:d},h);o.trigger("styleManager:change",this,l,d,f),o.trigger("styleManager:change:".concat(l),this,d,f),this._emitUpdate(f)}}},_emitUpdate:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.em,n=this.model;if(t){var r=n.get("property"),o=i({},this._getEventData(),{},e),s=o.id;t.trigger("style:update",o),t.trigger("style:update:".concat(r),o),r!==s&&t.trigger("style:update:".concat(s),o)}},_getEventData:function(){var e=this.model;return{propertyView:this,targets:this.getTargets(),value:e.getFullValue(),property:e,id:e.get("id"),name:e.get("property")}},checkVisibility:function(){var e=1;return this.config.hideNotStylable&&(this.isTargetStylable()&&this.isComponentStylable()?this.show():(this.hide(),e=0),this.sector&&this.sector.trigger("updateVisibility")),e},getTargetValue:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.model,r=this.getTargetModel(),i=this.customValue;if(!r)return e;if(e=r.getStyle()[n.get("property")],e||t.ignoreDefault||(e=n.getDefaultValue()),"function"==typeof i&&!t.ignoreCustomValue){var o=n.collection.indexOf(n),s=i(this,o,e);s&&(e=s)}return e},getComputedValue:function(){var e=this.propTarget,t=e.computed||{},n=e.computedDefault||{},r=this.config.avoidComputed||[],i=this.model.get("property"),o=r.indexOf(i)<0,s=t[i],a=n[Object(h.camelCase)(i)];return t&&o&&a!==s&&s||""},getInputValue:function(){var e=this.getInputEl();return e?e.value:""},modelValueChanged:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this.model,o=i.getFullValue();r.fromInput||this.setValue(o),this.getTargets().forEach(function(e){return n.__updateTarget(e,r)})},__updateTarget:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.model,r=this.config.em,o=n.get("property"),s=n.getFullValue(),a=this.onChange;if(e&&this.isTargetStylable(e)&&this.isComponentStylable()){t.fromTarget||(a&&!t.fromParent?a(e,this,t):this.updateTargetStyle(s,null,i({},t,{target:e})));var l=r&&r.getSelected();r&&l&&(!t.noEmit&&r.trigger("component:update",l),r.trigger("component:styleUpdate",l,o),r.trigger("component:styleUpdate:".concat(o),l)),this._emitUpdate()}},updateTargetStyle:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=t||this.model.get("property"),i=n.target||this.getTarget(),o=i.getStyle();e?o[r]=e:delete o[r],i.setStyle(o,n);var s=this.getHelperModel();s&&s.setStyle(o,n)},isTargetStylable:function(e){var t=e||this.getTarget(),n=this.model,r=n.get("id"),i=n.get("property"),o=n.get("toRequire"),s=t.get("unstylable"),a=t.get("stylable-require"),l=n.get("requires"),c=n.get("requiresParent"),u=this.sector?this.sector.collection:null,h=this.em?this.em.getSelected():null,f=t.get("stylable");if(Object(d.isArray)(f)&&(f=f.indexOf(i)>=0),Object(d.isArray)(s)&&(f=s.indexOf(i)<0),o&&(f=!e||a&&(a.indexOf(r)>=0||a.indexOf(i)>=0)),u&&l){var p=Object.keys(l);u.each(function(e){e.get("properties").each(function(e){if(Object(d.includes)(p,e.id)){var t=l[e.id];f=f&&Object(d.includes)(t,e.get("value"))}})})}if(c){var g=h&&h.parent(),m=g&&g.getEl();if(m){var v=window.getComputedStyle(m);Object(d.each)(c,function(e,t){f=f&&v[t]&&Object(d.includes)(e,v[t])})}else f=!1}return f},isComponentStylable:function(){var e=this.em,t=e&&e.getSelected();return!t||this.isTargetStylable(t)},setRawValue:function(e){this.setValue(this.model.parseValue(e))},setValue:function(e){var t=this.model,n=Object(d.isUndefined)(e)?t.getDefaultValue():e,r=this.getInputEl();r&&(r.value=n)},getInputEl:function(){return this.input||(this.input=this.el.querySelector("input")),this.input},updateVisibility:function(){this.el.style.display=this.model.get("visible")?"block":"none"},show:function(){this.model.set("visible",1)},hide:function(){this.model.set("visible",0)},cleanValue:function(){this.setValue("")},clearCached:function(){this.clearEl=null,this.input=null,this.$input=null},render:function(){this.clearCached();var e=this.pfx,t=this.model,n=this.el,r=t.get("property"),i=t.get("full"),o=t.get("className")||"",s="".concat(e,"property");n.innerHTML=this.template(t),n.className="".concat(s," ").concat(e).concat(t.get("type")," ").concat(s,"__").concat(r," ").concat(o).trim(),n.className+=i?" ".concat(s,"--full"):"",this.updateStatus();var a=this.onRender&&this.onRender.bind(this);a&&a(),this.setValue(t.get("value"),{targetUpdate:1})}})},"./src/style_manager/view/SectorView.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=n("./node_modules/underscore/underscore.js"),s=(n.n(o),n("./src/style_manager/view/PropertiesView.js"));t["default"]=i.a.View.extend({template:Object(o.template)('\n <div class="<%= pfx %>title" data-sector-title>\n <i id="<%= pfx %>caret" class="fa"></i>\n <%= label %>\n </div>'),events:{"click [data-sector-title]":"toggle"},initialize:function(e){this.config=e.config||{},this.em=this.config.em,this.pfx=this.config.stylePrefix||"",this.target=e.target||{},this.propTarget=e.propTarget||{},this.caretR="fa-caret-right",this.caretD="fa-caret-down";var t=this.model;this.listenTo(t,"change:open",this.updateOpen),this.listenTo(t,"updateVisibility",this.updateVisibility),this.listenTo(t,"destroy remove",this.remove)},updateVisibility:function(){var e;this.model.get("properties").each(function(t){t.get("visible")&&(e=1)}),this.el.style.display=e?"block":"none"},updateOpen:function(){this.model.get("open")?this.show():this.hide()},show:function(){this.$el.addClass(this.pfx+"open"),this.getPropertiesEl().style.display="",this.$caret.removeClass(this.caretR).addClass(this.caretD)},hide:function(){this.$el.removeClass(this.pfx+"open"),this.getPropertiesEl().style.display="none",this.$caret.removeClass(this.caretD).addClass(this.caretR)},getPropertiesEl:function(){return this.$el.find(".".concat(this.pfx,"properties")).get(0)},toggle:function(e){var t=this.model.get("open")?0:1;this.model.set("open",t)},render:function(){var e=this.pfx,t=this.model,n=this.em,r=this.$el,i=t.attributes,o=i.id,s=i.name,a=n&&n.t("styleManager.sectors.".concat(o))||s;return r.html(this.template({pfx:e,label:a})),this.$caret=r.find("#".concat(e,"caret")),this.renderProperties(),r.attr("class","".concat(e,"sector ").concat(e,"sector__").concat(o," no-select")),this.updateOpen(),this},renderProperties:function(){var e=this.model.get("properties");if(e){var t=new s["default"]({collection:e,target:this.target,propTarget:this.propTarget,config:this.config});this.$el.append(t.render().el)}}})},"./src/style_manager/view/SectorsView.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t));
|
||
})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./node_modules/backbone/backbone.js"),l=n.n(a),c=n("./node_modules/underscore/underscore.js"),u=(n.n(c),n("./src/utils/mixins.js")),d=n("./src/utils/dom.js"),h=n("./src/style_manager/view/SectorView.js"),f="hc-state";t["default"]=l.a.View.extend({initialize:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.config||{};this.pfx=t.stylePrefix||"",this.ppfx=t.pStylePrefix||"",this.target=e.target||{},this.config=t;var n={};Object(c.extend)(n,l.a.Events);var r=document.body,o=document.createElement("el-".concat((new Date).getTime()));r.appendChild(o),n.computedDefault=i({},window.getComputedStyle(o)),r.removeChild(o),this.propTarget=n;var s=this.collection,a="component:toggled component:update:classes change:state change:device frame:resized";this.listenTo(s,"add",this.addTo),this.listenTo(s,"reset",this.render),this.listenTo(this.target,a,this.targetUpdated)},addTo:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.addToCollection(e,null,n)},toggleStateCls:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;e.forEach(function(e){var n=e.getEl();n&&n.classList[t?"add":"remove"](f)})},targetUpdated:function(e){var t=this.target,n=this.propTarget,r=t.getSelectedAll(),i=t.getSelected(),o=e&&e.toHTML?e:i;if(o&&this.toggleStateCls([o]),i){var s=t.get("Config"),a=s.devicePreviewMode?"":t.get("state"),l=t.get("SelectorManager").getConfig(),c=l.componentFirst,d=i.getEl();if(n.helper=null,n.targets=null,d&&Object(u.isTaggableNode)(d)){var h=a?":".concat(a):null;n.computed=window.getComputedStyle(d,h)}var p=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.get("CssComposer"),i=r.getAll(),o=r.getClassRule(f);o?(i.remove(o),i.add(o)):o=r.setClassRule(f),o.set("important",1),o.setStyle(e),n.helper=o};i=t.get("StyleManager").getModelToStyle(i),a&&(p(i.getStyle()),this.toggleStateCls(r,1)),n.model=i,c&&(n.targets=r),n.trigger("update")}},setTarget:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.target,r=Object(c.isArray)(e)?e:[e],i=t.targetIsClass,o=t.stylable,s=[];r.forEach(function(e){var t=e;if(Object(c.isString)(e)){var r,a=n.get("CssComposer").getAll();i&&(r=a.filter(function(t){return t.get("selectors").getFullString()===e})[0]),r||(r=a.filter(function(t){return t.get("selectorsAdd")===e})[0]),r||(r=a.add({selectors:[],selectorsAdd:e})),o&&r.set({stylable:o}),t=r}s.push(t)});var a=this.propTarget;return a.targets=s,a.trigger("update"),s},addToCollection:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.pfx,i=this.target,o=this.propTarget,s=this.config,a=this.el,l=t||a,c=new h["default"]({model:e,id:"".concat(r).concat(e.get("id")),name:e.get("name"),properties:e.get("properties"),target:i,propTarget:o,config:s}).render().el;return Object(d.appendAtIndex)(l,c,n.at),c},render:function(){var e=this,t=document.createDocumentFragment(),n=this.$el,r=this.pfx,i=this.ppfx;return n.empty(),this.collection.each(function(n){return e.addToCollection(n,t)}),n.append(t),n.addClass("".concat(r,"sectors ").concat(i,"one-bg ").concat(i,"two-color")),this}})},"./src/trait_manager/config/config.js":function(e,t,n){"use strict";n.r(t),t["default"]={stylePrefix:"trt-",appendTo:"",optionsTarget:[{value:!1},{value:"_blank"}]}},"./src/trait_manager/index.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/underscore/underscore.js"),i=(n.n(r),n("./src/trait_manager/config/config.js")),o=n("./src/trait_manager/view/TraitsView.js");t["default"]=function(){var e,t={};return{TraitsView:o["default"],name:"TraitManager",getConfig:function(){return t},init:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t=n,Object(r.defaults)(t,i["default"]);var s=t.pStylePrefix;return s&&(t.stylePrefix="".concat(s).concat(t.stylePrefix)),e=new o["default"]({collection:[],editor:t.em,config:t}),this},postRender:function(){var e=this.getConfig().appendTo;if(e){var t=Object(r.isElement)(e)?e:document.querySelector(e);t.appendChild(this.render())}},getTraitsViewer:function(){return e},addType:function(t,n){var r=e.itemView;e.itemsView[t]=r.extend(n)},getType:function(t){return e.itemsView[t]},render:function(){return e.render().el}}}},"./src/trait_manager/model/Trait.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./node_modules/backbone/backbone.js"),l=n.n(a),c=n("./node_modules/underscore/underscore.js");n.n(c);t["default"]=l.a.Model.extend({defaults:{type:"text",label:"",name:"",min:"",max:"",unit:"",step:1,value:"",target:"","default":"",placeholder:"",changeProp:0,options:[]},initialize:function(){var e=this.get("target"),t=this.get("name"),n=this.get("changeProp");if(e){this.target=e,this.unset("target");var r=n?"change:".concat(t):"change:attributes:".concat(t);this.listenTo(e,r,this.targetUpdated)}},props:function(){return this.attributes},targetUpdated:function(){var e=this.getTargetValue();this.set({value:e},{fromTarget:1})},getTargetValue:function(){var e,t=this.get("name"),n=this.target;return e=this.get("changeProp")?n.get(t):n.getAttributes()[t],Object(c.isUndefined)(e)?"":e},setTargetValue:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.target,r=this.get("name");if(!Object(c.isUndefined)(e)){var o=e;if("false"===e?o=!1:"true"===e&&(o=!0),this.get("changeProp"))n.set(r,o,t);else{var s=i({},n.get("attributes"));s[r]=o,n.set("attributes",s,t)}}},setValueFromInput:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={value:e};this.set(r,i({},n,{avoidStore:1})),t&&(this.set("value","",n),this.set(r,n))},getInitValue:function(){var e,t=this.target,n=this.get("name");if(t){var r=t.get("attributes");e=this.get("changeProp")?t.get(n):r[n]}return e||this.get("value")||this.get("default")}})},"./src/trait_manager/model/TraitFactory.js":function(e,t,n){"use strict";n.r(t),t["default"]=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{build:function(t){var n=[];"string"==typeof t&&(t=[t]);for(var r=0;r<t.length;r++){var i={},o=t[r];switch(i.name=o,o){case"target":i.type="select"}switch(o){case"target":i.options=e.optionsTarget}n.push(i)}return n}}}},"./src/trait_manager/model/Traits.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=n("./node_modules/underscore/underscore.js"),s=(n.n(o),n("./src/trait_manager/model/Trait.js")),a=n("./src/trait_manager/model/TraitFactory.js");t["default"]=i.a.Collection.extend({model:s["default"],initialize:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.em=t.em||"",this.listenTo(this,"add",this.handleAdd),this.listenTo(this,"reset",this.handleReset)},handleReset:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.previousModels,r=void 0===n?[]:n;r.forEach(function(e){return e.trigger("remove")})},handleAdd:function(e){var t=this.target;t&&(e.target=t)},setTarget:function(e){this.target=e},add:function(e,t){var n=this.em;if(Object(o.isString)(e)||Object(o.isArray)(e)){var r=n&&n.get&&n.get("TraitManager"),s=r&&r.getConfig(),l=Object(a["default"])(s);Object(o.isString)(e)&&(e=[e]);for(var c=0,u=e.length;c<u;c++){var d=e[c],h=Object(o.isString)(d)?l.build(d)[0]:d;h.target=this.target,e[c]=h}}return i.a.Collection.prototype.add.apply(this,[e,t])}})},"./src/trait_manager/view/TraitButtonView.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/underscore/underscore.js"),i=(n.n(r),n("./src/trait_manager/view/TraitView.js"));t["default"]=i["default"].extend({events:{"click button":"handleClick"},templateInput:"",handleClick:function(){var e=this.model,t=this.em,n=e.get("command");n&&(Object(r.isString)(n)?t.get("Commands").run(n):n(t.get("Editor"),e))},renderLabel:function(){this.model.get("label")&&i["default"].prototype.renderLabel.apply(this,arguments)},getInputEl:function(){var e=this.model,t=this.ppfx,n=e.props(),r=n.labelButton,i=n.text,o=n.full,s=r||i,a="".concat(t,"btn"),l='<button type="button" class="'.concat(a,"-prim").concat(o?" ".concat(a,"--full"):"",'">').concat(s,"</button>");return l}})},"./src/trait_manager/view/TraitCheckboxView.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/underscore/underscore.js"),i=(n.n(r),n("./src/trait_manager/view/TraitView.js"));t["default"]=i["default"].extend({appendInput:0,templateInput:function(){var e=this.ppfx,t=this.clsField;return'<label class="'.concat(t,'" data-input>\n <i class="').concat(e,'chk-icon"></i>\n </label>')},onChange:function(){var e=this.getInputElem().checked;this.model.set("value",this.getCheckedValue(e))},getCheckedValue:function(e){var t=e,n=this.model.attributes,i=n.valueTrue,o=n.valueFalse;return t&&!Object(r.isUndefined)(i)&&(t=i),t||Object(r.isUndefined)(o)||(t=o),t},getInputEl:function(){for(var e=!this.$input,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];var s=i["default"].prototype.getInputEl.apply(this,n);if(e){var a,l,c=this.model,u=this.target,d=c.attributes,h=(d.valueTrue,d.valueFalse),f=c.get("name");c.get("changeProp")?(a=u.get(f),l=a):(l=u.get("attributes")[f],a=!(!l&&""!==l)),Object(r.isUndefined)(h)||l!==h||(a=!1),s.checked=a}return s}})},"./src/trait_manager/view/TraitColorView.js":function(e,t,n){"use strict";n.r(t);var r=n("./src/trait_manager/view/TraitView.js"),i=n("./src/domain_abstract/ui/InputColor.js");t["default"]=r["default"].extend({templateInput:"",getInputEl:function(){if(!this.input){var e=this.model,t=this.getModelValue(),n=new i["default"]({model:e,target:this.config.em,contClass:this.ppfx+"field-color",ppfx:this.ppfx}),r=n.render();r.setValue(t,{fromTarget:1}),this.input=r.el}return this.input}})},"./src/trait_manager/view/TraitNumberView.js":function(e,t,n){"use strict";n.r(t);var r=n("./src/trait_manager/view/TraitView.js"),i=n("./src/domain_abstract/ui/InputNumber.js");t["default"]=r["default"].extend({getValueForTarget:function(){var e=this.model,t=e.attributes,n=t.value,r=t.unit;return n?n+r:""},getInputEl:function(){if(!this.input){var e=this.getModelValue(),t=new i["default"]({contClass:this.ppfx+"field-int",model:this.model,ppfx:this.ppfx});this.input=t.render(),this.$input=this.input.inputEl,this.$unit=this.input.unitEl,this.model.set("value",e),this.$input.val(e),this.input=t.el}return this.input}})},"./src/trait_manager/view/TraitSelectView.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=n("./node_modules/underscore/underscore.js"),s=(n.n(o),n("./src/trait_manager/view/TraitView.js")),a=i.a.$;t["default"]=s["default"].extend({init:function(){this.listenTo(this.model,"change:options",this.rerender)},templateInput:function(){var e=this.ppfx,t=this.clsField;return'<div class="'.concat(t,'">\n <div data-input></div>\n <div class="').concat(e,'sel-arrow">\n <div class="').concat(e,'d-s-arrow"></div>\n </div>\n </div>')},getInputEl:function(){if(!this.$input){var e=this.model,t=this.em,n=e.get("name"),r=e.get("options")||[],i="<select>";r.forEach(function(e){var r,s,a,l="";Object(o.isString)(e)?(r=e,s=e):(r=e.name||e.label||e.value,s="".concat(Object(o.isUndefined)(e.value)?e.id:e.value).replace(/"/g,"""),a=e.style?e.style.replace(/"/g,"""):"",l+=a?' style="'.concat(a,'"'):"");var c=t.t("traitManager.traits.options.".concat(n,".").concat(s))||r;i+='<option value="'.concat(s,'"').concat(l,">").concat(c,"</option>")}),i+="</select>",this.$input=a(i);var s=e.getTargetValue();!Object(o.isUndefined)(s)&&this.$input.val(s)}return this.$input.get(0)}})},"./src/trait_manager/view/TraitView.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./node_modules/@babel/runtime/helpers/slicedToArray.js"),l=n.n(a),c=n("./node_modules/backbone/backbone.js"),u=n.n(c),d=n("./node_modules/underscore/underscore.js"),h=(n.n(d),n("./src/utils/mixins.js")),f=u.a.$;t["default"]=u.a.View.extend({events:{},eventCapture:["change"],appendInput:1,attributes:function(){return this.model.get("attributes")},templateLabel:function(){var e=this.ppfx,t=this.getLabel();return'<div class="'.concat(e,'label" title="').concat(t,'">').concat(t,"</div>")},templateInput:function(){var e=this.clsField;return'<div class="'.concat(e,'" data-input></div>')},initialize:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.config,r=void 0===n?{}:n,i=this.model,o=this.eventCapture,s=i.target,a=i.attributes.type;this.config=r,this.em=r.em,this.pfx=r.stylePrefix||"",this.ppfx=r.pStylePrefix||"",this.target=s;var c=this.ppfx;this.clsField="".concat(c,"field ").concat(c,"field-").concat(a),[["change:value",this.onValueChange],["remove",this.removeView]].forEach(function(t){var n=l()(t,2),r=n[0],o=n[1];i.off(r,o),e.listenTo(i,r,o)}),i.view=this,this.listenTo(i,"change:label",this.render),this.listenTo(i,"change:placeholder",this.rerender),o.forEach(function(t){return e.events[t]="onChange"}),this.delegateEvents(),this.init()},getClbOpts:function(){return{component:this.target,trait:this.model,elInput:this.getInputElem()}},removeView:function(){this.remove(),this.removed()},init:function(){},removed:function(){},onRender:function(){},onUpdate:function(){},onEvent:function(){},onChange:function(e){var t=this.getInputElem();t&&!Object(d.isUndefined)(t.value)&&this.model.set("value",t.value),this.onEvent(i({},this.getClbOpts(),{event:e}))},getValueForTarget:function(){return this.model.get("value")},setInputValue:function(e){var t=this.getInputElem();t&&(t.value=e)},onValueChange:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(n.fromTarget)this.setInputValue(e.get("value")),this.postUpdate();else{var r=this.getValueForTarget();e.setTargetValue(r,n)}},renderLabel:function(){var e=this.$el,t=this.target,n=this.getLabel(),r=this.templateLabel(t);this.createLabel&&(r=this.createLabel({label:n,component:t,trait:this})||""),e.find("[data-label]").append(r)},getLabel:function(){var e=this.em,t=this.model.attributes,n=t.label,r=t.name;return e.t("traitManager.traits.labels.".concat(r))||Object(h.capitalize)(n||r).replace(/-/g," ")},getComponent:function(){return this.target},getInputEl:function(){if(!this.$input){var e=this.em,t=this.model,n=t,r=t.attributes.name,i=n.get("placeholder")||n.get("default")||"",o=n.get("type")||"text",s=n.get("min"),a=n.get("max"),l=this.getModelValue(),c=f('<input type="'.concat(o,'" placeholder="').concat(i,'">')),u=e.t("traitManager.traits.attributes.".concat(r))||{};c.attr(u),Object(d.isUndefined)(l)||(n.set({value:l},{silent:!0}),c.prop("value",l)),s&&c.prop("min",s),a&&c.prop("max",a),this.$input=c}return this.$input.get(0)},getInputElem:function(){var e=this.input,t=this.$input;return e||t&&t.get&&t.get(0)||this.getElInput()},getModelValue:function(){var e,t=this.model,n=this.target,r=t.get("name");if(t.get("changeProp"))e=n.get(r);else{var i=n.get("attributes");e=t.get("value")||i[r]}return Object(d.isUndefined)(e)?"":e},getElInput:function(){return this.elInput},renderField:function(){var e=this.$el,t=this.appendInput,n=this.model,r=e.find("[data-input]"),i=r[r.length-1],o=n.el;o||(o=this.createInput?this.createInput(this.getClbOpts()):this.getInputEl()),Object(d.isString)(o)?(i.innerHTML=o,this.elInput=i.firstChild):(t?i.appendChild(o):i.insertBefore(o,i.firstChild),this.elInput=o),n.el=this.elInput},hasLabel:function(){var e=this.model.attributes.label;return!this.noLabel&&e!==!1},rerender:function(){this.model.el=null,this.render()},postUpdate:function(){this.onUpdate(this.getClbOpts())},render:function(){var e=this.$el,t=this.pfx,n=this.ppfx,r=this.model,i=r.attributes.type,o=this.hasLabel&&this.hasLabel(),s="".concat(t,"trait");this.$input=null;var a='<div class="'.concat(s,'">\n ').concat(o?'<div class="'.concat(n,'label-wrp" data-label></div>'):"",'\n <div class="').concat(n,"field-wrp ").concat(n,"field-wrp--").concat(i,'" data-input>\n ').concat(this.templateInput?Object(d.isFunction)(this.templateInput)?this.templateInput(this.getClbOpts()):this.templateInput:"","\n </div>\n </div>");return e.empty().append(a),o&&this.renderLabel(),this.renderField(),this.el.className="".concat(s,"__wrp"),this.postUpdate(),this.onRender(this.getClbOpts()),this}})},"./src/trait_manager/view/TraitsView.js":function(e,t,n){"use strict";n.r(t);var r=n("./src/domain_abstract/view/DomainViews.js"),i=n("./src/trait_manager/view/TraitView.js"),o=n("./src/trait_manager/view/TraitSelectView.js"),s=n("./src/trait_manager/view/TraitCheckboxView.js"),a=n("./src/trait_manager/view/TraitNumberView.js"),l=n("./src/trait_manager/view/TraitColorView.js"),c=n("./src/trait_manager/view/TraitButtonView.js");t["default"]=r["default"].extend({ns:"Traits",itemView:i["default"],reuseView:1,itemsView:{text:i["default"],number:a["default"],select:o["default"],checkbox:s["default"],color:l["default"],button:c["default"]},initialize:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.config||{};this.config=t,this.em=e.editor,this.pfx=t.stylePrefix||"",this.ppfx=t.pStylePrefix||"",this.className=this.pfx+"traits";var n="component:toggled";this.listenTo(this.em,n,this.updatedCollection),this.updatedCollection()},updatedCollection:function(){var e=this.ppfx,t=this.em.getSelected();this.el.className="".concat(this.className," ").concat(e,"one-bg ").concat(e,"two-color"),this.collection=t?t.get("traits"):[],this.render()}})},"./src/undo_manager/index.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./node_modules/backbone-undo/Backbone.Undo.js"),l=n.n(a);t["default"]=function(){var e,t,n,r,o={};return{name:"UndoManager",init:function(){var s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};n=i({},s,{},o),e=n.em,this.em=e,t=new l.a(i({track:!0,register:[]},n)),t.changeUndoType("change",{condition:!1}),t.changeUndoType("add",{on:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!n.avoidStore)return{object:t,before:void 0,after:e,options:i({},n)}}}),t.changeUndoType("remove",{on:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!n.avoidStore)return{object:t,before:e,after:void 0,options:i({},n)}}});var a={on:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!r&&(r=e.previousAttributes()),!n.avoidStore){var i={object:e,before:r,after:e.toJSON()};return r=null,i}},undo:function(e,t,n,r){e.set(t)},redo:function(e,t,n,r){e.set(n)}},c=["style","attributes","content","src"];return c.forEach(function(e){return t.addUndoType("change:".concat(e),a)}),t.on("undo redo",function(){return e.trigger("component:toggled change:canvasOffset")}),["undo","redo"].forEach(function(n){return t.on(n,function(){return e.trigger(n)})}),this},getConfig:function(){return n},add:function(e){return t.register(e),this},remove:function(e){return t.unregister(e),this},removeAll:function(){return t.unregisterAll(),this},start:function(){return t.startTracking(),this},stop:function(){return t.stopTracking(),this},undo:function(){return!e.isEditing()&&t.undo(1),this},undoAll:function(){return t.undoAll(),this},redo:function(){return!e.isEditing()&&t.redo(1),this},redoAll:function(){return t.redoAll(),this},hasUndo:function(){return t.isAvailable("undo")},hasRedo:function(){return t.isAvailable("redo")},getStack:function(){return t.stack},clear:function(){return t.clear(),this},getInstance:function(){return t}}}},"./src/utils/ColorPicker.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/@babel/runtime/helpers/typeof.js"),i=n.n(r);t["default"]=function(e,t){function n(t,n,r,i){for(var o=[],s=0;s<t.length;s++){var a=t[s];if(a){var l=le(a),c=l.toHsl().l<.5?"sp-thumb-el sp-thumb-dark":"sp-thumb-el sp-thumb-light";c+=le.equals(n,a)?" sp-thumb-active":"";var u=l.toString(i.preferredFormat||"rgb"),d=X?"background-color:"+l.toRgbString():"filter:"+l.toFilter();o.push('<span title="'+u+'" data-color="'+l.toRgbString()+'" class="'+c+'"><span class="sp-thumb-inner" style="'+d+';"></span></span>')}else{var h="sp-clear-display";o.push(e("<div />").append(e('<span data-color="" style="background-color:transparent;" class="'+h+'"></span>').attr("title",i.noColorSelectedText)).html())}}return"<div class='sp-cf "+r+"'>"+o.join("")+"</div>"}function r(){for(var e=0;e<K.length;e++)K[e]&&K[e].hide()}function o(t,n){var r=e.extend({},G,t);return r.callbacks={move:u(r.move,n),change:u(r.change,n),show:u(r.show,n),hide:u(r.hide,n),beforeShow:u(r.beforeShow,n)},r}function s(i,s){function l(){if(z.showPaletteOnly&&(z.showPalette=!0),Re.text(z.showPaletteOnly?z.togglePaletteMoreText:z.togglePaletteLessText),z.palette){pe=z.palette.slice(0),ge=e.isArray(pe[0])?pe:[pe],me={};for(var t=0;t<ge.length;t++)for(var n=0;n<ge[t].length;n++){var r=le(ge[t][n]).toRgbString();me[r]=!0}}Oe.toggleClass("sp-flat",B),Oe.toggleClass("sp-input-disabled",!z.showInput),Oe.toggleClass("sp-alpha-enabled",z.showAlpha),Oe.toggleClass("sp-clear-enabled",Je),Oe.toggleClass("sp-buttons-disabled",!z.showButtons),Oe.toggleClass("sp-palette-buttons-disabled",!z.togglePaletteOnly),Oe.toggleClass("sp-palette-disabled",!z.showPalette),Oe.toggleClass("sp-palette-only",z.showPaletteOnly),Oe.toggleClass("sp-initial-disabled",!z.showInitial),Oe.addClass(z.className).addClass(z.containerClassName),N()}function u(){function t(t){return t.data&&t.data.ignore?(P(e(t.target).closest(".sp-thumb-el").data("color")),D()):(P(e(t.target).closest(".sp-thumb-el").data("color")),D(),L(!0),z.hideAfterPaletteSelect&&S()),!1}if(Y&&Oe.find("*:not(input)").attr("unselectable","on"),l(),Be&&Ce.after($e).hide(),Je||Ie.hide(),B)Ce.after(Oe).hide();else{var n="parent"===z.appendTo?Ce.parent():e(z.appendTo);1!==n.length&&(n=e("body")),n.append(Oe)}p(),We.bind("click.spectrum touchstart.spectrum",function(t){je||C(),t.stopPropagation(),e(t.target).is("input")||t.preventDefault()}),(Ce.is(":disabled")||z.disabled===!0)&&R(),Oe.click(c),Ae.change(x),Ae.bind("paste",function(){setTimeout(x,1)}),Ae.keydown(function(e){13==e.keyCode&&x()}),Ve.text(z.cancelText),Ve.bind("click.spectrum",function(e){e.stopPropagation(),e.preventDefault(),T(),S()}),Ie.attr("title",z.clearText),Ie.bind("click.spectrum",function(e){e.stopPropagation(),e.preventDefault(),Xe=!0,D(),B&&L(!0)}),Fe.text(z.chooseText),Fe.bind("click.spectrum",function(e){e.stopPropagation(),e.preventDefault(),Y&&Ae.is(":focus")&&Ae.trigger("change"),_()&&(L(!0),S())}),Re.text(z.showPaletteOnly?z.togglePaletteMoreText:z.togglePaletteLessText),Re.bind("click.spectrum",function(e){e.stopPropagation(),e.preventDefault(),z.showPaletteOnly=!z.showPaletteOnly,z.showPaletteOnly||B||Oe.css("left","-="+(ke.outerWidth(!0)+5)),l()}),d(De,function(e,t,n){fe=e/se,Xe=!1,n.shiftKey&&(fe=Math.round(10*fe)/10),D()},y,w),d(Pe,function(e,t){ue=parseFloat(t/ie),Xe=!1,z.showAlpha||(fe=1),D()},y,w),d(Se,function(e,t,n){if(n.shiftKey){if(!we){var r=de*te,i=ne-he*ne,o=Math.abs(e-r)>Math.abs(t-i);we=o?"x":"y"}}else we=null;var s=!we||"x"===we,a=!we||"y"===we;s&&(de=parseFloat(e/te)),a&&(he=parseFloat((ne-t)/ne)),Xe=!1,z.showAlpha||(fe=1),D()},y,w),qe?(P(qe),M(),Ke=z.preferredFormat||le(qe).format,g(qe)):M(),B&&j();var r=Y?"mousedown.spectrum":"click.spectrum touchstart.spectrum";Le.delegate(".sp-thumb-el",r,t),Ne.delegate(".sp-thumb-el:nth-child(1)",r,{ignore:!0},t)}function p(){if(W&&window.localStorage){try{var t=window.localStorage[W].split(",#");t.length>1&&(delete window.localStorage[W],e.each(t,function(e,t){g(t)}))}catch(n){}try{ve=window.localStorage[W].split(";")}catch(n){}}}function g(t){if($){var n=le(t).toRgbString();if(!me[n]&&e.inArray(n,ve)===-1)for(ve.push(n);ve.length>be;)ve.shift();if(W&&window.localStorage)try{window.localStorage[W]=ve.join(";")}catch(r){}}}function m(){var e=[];if(z.showPalette)for(var t=0;t<ve.length;t++){var n=le(ve[t]).toRgbString();me[n]||e.push(ve[t])}return e.reverse().slice(0,z.maxSelectionSize)}function v(){var t=E(),r=e.map(ge,function(e,r){return n(e,t,"sp-palette-row sp-palette-row-"+r,z)});p(),ve&&r.push(n(m(),t,"sp-palette-row sp-palette-row-selection",z)),Le.html(r.join(""))}function b(){if(z.showInitial){var e=Ge,t=E();Ne.html(n([e,t],t,"sp-palette-row-initial",z))}}function y(){(ne<=0||te<=0||ie<=0)&&N(),ee=!0,Oe.addClass(ye),we=null,Ce.trigger("dragstart.spectrum",[E()])}function w(){ee=!1,Oe.removeClass(ye),Ce.trigger("dragstop.spectrum",[E()])}function x(){var e=Ae.val();if(null!==e&&""!==e||!Je){var t=le(e);t.isValid()?(P(t),L(!0)):Ae.addClass("sp-validation-error")}else P(null),L(!0)}function C(){Q?S():j()}function j(){var t=e.Event("beforeShow.spectrum");if(Q)return void N();if(Ce.trigger("beforeShow.spectrum",[E()]),q.beforeShow(E())!==!1&&!t.isDefaultPrevented()){r(),Q=!0;var n=e(xe);n.bind("keydown.spectrum",O),n.bind("click.spectrum",k),e(window).bind("resize.spectrum",G),$e.addClass("sp-active"),Oe.removeClass("sp-hidden"),N(),M(),Ge=E(),b(),q.show(Ge),Ce.trigger("show.spectrum",[Ge])}}function O(e){27===e.keyCode&&S()}function k(e){2!=e.button&&(ee||(Ye?L(!0):T(),S()))}function S(){Q&&!B&&(Q=!1,e(xe).unbind("keydown.spectrum",O),e(xe).unbind("click.spectrum",k),e(window).unbind("resize.spectrum",G),$e.removeClass("sp-active"),Oe.addClass("sp-hidden"),q.hide(E()),Ce.trigger("hide.spectrum",[E()]))}function T(){P(Ge,!0)}function P(e,t){if(le.equals(e,E()))return void M();var n,r;!e&&Je?Xe=!0:(Xe=!1,n=le(e),r=n.toHsv(),ue=r.h%360/360,de=r.s,he=r.v,fe=r.a),M(),n&&n.isValid()&&!t&&(Ke=z.preferredFormat||n.getFormat())}function E(e){return e=e||{},Je&&Xe?null:le.fromRatio({h:ue,s:de,v:he,a:Math.round(100*fe)/100},{format:e.format||Ke})}function _(){return!Ae.hasClass("sp-validation-error")}function D(){M(),q.move(E()),Ce.trigger("move.spectrum",[E()])}function M(){Ae.removeClass("sp-validation-error"),A();var e=le.fromRatio({h:ue,s:1,v:1});Se.css("background-color",e.toHexString());var t=Ke;fe<1&&(0!==fe||"name"!==t)&&("hex"!==t&&"hex3"!==t&&"hex6"!==t&&"name"!==t||(t="rgb"));var n=E({format:t}),r="";if(Ue.removeClass("sp-clear-display"),Ue.css("background-color","transparent"),!n&&Je)Ue.addClass("sp-clear-display");else{var i=n.toHexString(),o=n.toRgbString();if(X||1===n.alpha?Ue.css("background-color",o):(Ue.css("background-color","transparent"),Ue.css("filter",n.toFilter())),z.showAlpha){var s=n.toRgb();s.a=0;var a=le(s).toRgbString(),l="linear-gradient(left, "+a+", "+i+")";Y?_e.css("filter",le(a).toFilter({gradientType:1},i)):(_e.css("background","-webkit-"+l),_e.css("background","-moz-"+l),_e.css("background","-ms-"+l),_e.css("background","linear-gradient(to right, "+a+", "+i+")"))}r=n.toString(t)}z.showInput&&Ae.val(r),z.showPalette&&v(),b()}function A(){var e=de,t=he;if(Je&&Xe)Me.hide(),Ee.hide(),Te.hide();else{Me.show(),Ee.show(),Te.show();var n=e*te,r=ne-t*ne;n=Math.max(-re,Math.min(te-re,n-re)),r=Math.max(-re,Math.min(ne-re,r-re)),Te.css({top:r+"px",left:n+"px"});var i=fe*se;Me.css({left:i-ae/2+"px"});var o=ue*ie;Ee.css({top:o-ce+"px"})}}function L(e){var t=E(),n="",r=!le.equals(t,Ge);t&&(n=t.toString(Ke),g(t)),He&&Ce.val(n),e&&r&&(q.change(t),Ce.trigger("change",[t]))}function N(){Q&&(te=Se.width(),ne=Se.height(),re=Te.height(),oe=Pe.width(),ie=Pe.height(),ce=Ee.height(),se=De.width(),ae=Me.width(),B||(Oe.css("position","absolute"),z.offset?Oe.offset(z.offset):Oe.offset(a(Oe,We))),A(),z.showPalette&&v(),Ce.trigger("reflow.spectrum"))}function V(){Ce.show(),We.unbind("click.spectrum touchstart.spectrum"),Oe.remove(),$e.remove(),K[Ze.id]=null}function I(n,r){return n===t?e.extend({},z):r===t?z[n]:(z[n]=r,"preferredFormat"===n&&(Ke=z.preferredFormat),void l())}function F(){je=!1,Ce.attr("disabled",!1),We.removeClass("sp-disabled")}function R(){S(),je=!0,Ce.attr("disabled",!0),We.addClass("sp-disabled")}function H(e){z.offset=e,N()}var z=o(s,i),B=z.flat,$=z.showSelectionPalette,W=z.localStorageKey,U=z.theme,q=z.callbacks,G=h(N,10),Q=!1,ee=!1,te=0,ne=0,re=0,ie=0,oe=0,se=0,ae=0,ce=0,ue=0,de=0,he=0,fe=1,pe=[],ge=[],me={},ve=z.selectionPalette.slice(0),be=z.maxSelectionSize,ye="sp-dragging",we=null,xe=i.ownerDocument,Ce=(xe.body,e(i)),je=!1,Oe=e(Z,xe).addClass(U),ke=Oe.find(".sp-picker-container"),Se=Oe.find(".sp-color"),Te=Oe.find(".sp-dragger"),Pe=Oe.find(".sp-hue"),Ee=Oe.find(".sp-slider"),_e=Oe.find(".sp-alpha-inner"),De=Oe.find(".sp-alpha"),Me=Oe.find(".sp-alpha-handle"),Ae=Oe.find(".sp-input"),Le=Oe.find(".sp-palette"),Ne=Oe.find(".sp-initial"),Ve=Oe.find(".sp-cancel"),Ie=Oe.find(".sp-clear"),Fe=Oe.find(".sp-choose"),Re=Oe.find(".sp-palette-toggle"),He=Ce.is("input"),ze=He&&"color"===Ce.attr("type")&&f(),Be=He&&!B,$e=Be?e(J).addClass(U).addClass(z.className).addClass(z.replacerClassName):e([]),We=Be?$e:Ce,Ue=$e.find(".sp-preview-inner"),qe=z.color||He&&Ce.val(),Ge=!1,Ke=z.preferredFormat,Ye=!z.showButtons||z.clickoutFiresChange,Xe=!qe,Je=z.allowEmpty&&!ze;u();var Ze={show:j,hide:S,toggle:C,reflow:N,option:I,enable:F,disable:R,offset:H,set:function(e){P(e),L()},get:E,destroy:V,container:Oe};return Ze.id=K.push(Ze)-1,Ze}function a(t,n){var r=0,i=t.outerWidth(),o=t.outerHeight(),s=n.outerHeight(),a=t[0].ownerDocument,l=a.documentElement,c=l.clientWidth,u=l.clientHeight,d=e(a).scrollLeft(),h=e(a).scrollTop(),f=c+d,p=u+h,g=n.offset();return g.top+=s,g.left-=Math.min(g.left,g.left+i>f&&f>i?Math.abs(g.left+i-f):0),g.top-=Math.min(g.top,g.top+o>p&&p>o?Math.abs(o+s-r):r),g}function l(){}function c(e){e.stopPropagation()}function u(e,t){var n=Array.prototype.slice,r=n.call(arguments,2);return function(){return e.apply(t,r.concat(n.call(arguments)))}}function d(t,n,r,i){function o(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault(),e.returnValue=!1}function s(e){if(u){if(Y&&c.documentMode<9&&!e.button)return l();var r=e&&e.touches&&e.touches[0],i=r&&r.pageX||e.pageX,s=r&&r.pageY||e.pageY,a=Math.max(0,Math.min(i-d.left,f)),g=Math.max(0,Math.min(s-d.top,h));p&&o(e),n.apply(t,[a,g,e])}}function a(n){var i=n.which?3==n.which:2==n.button;i||u||r.apply(t,arguments)!==!1&&(u=!0,h=e(t).height(),
|
||
f=e(t).width(),d=e(t).offset(),e(c).bind(g),e(c.body).addClass("sp-dragging"),s(n),o(n))}function l(){u&&(e(c).unbind(g),e(c.body).removeClass("sp-dragging"),setTimeout(function(){i.apply(t,arguments)},0)),u=!1}n=n||function(){},r=r||function(){},i=i||function(){};var c=document,u=!1,d={},h=0,f=0,p="ontouchstart"in window,g={};g.selectstart=o,g.dragstart=o,g["touchmove mousemove"]=s,g["touchend mouseup"]=l,e(t).bind("touchstart mousedown",a)}function h(e,t,n){var r;return function(){var i=this,o=arguments,s=function(){r=null,e.apply(i,o)};n&&clearTimeout(r),!n&&r||(r=setTimeout(s,t))}}function f(){return e.fn.spectrum.inputTypeColorSupport()}function p(e){var t={r:0,g:0,b:0},n=1,r=!1,o=!1;return"string"==typeof e&&(e=q(e)),"object"==i()(e)&&(e.hasOwnProperty("r")&&e.hasOwnProperty("g")&&e.hasOwnProperty("b")?(t=g(e.r,e.g,e.b),r=!0,o="%"===String(e.r).substr(-1)?"prgb":"rgb"):e.hasOwnProperty("h")&&e.hasOwnProperty("s")&&e.hasOwnProperty("v")?(e.s=$(e.s),e.v=$(e.v),t=y(e.h,e.s,e.v),r=!0,o="hsv"):e.hasOwnProperty("h")&&e.hasOwnProperty("s")&&e.hasOwnProperty("l")&&(e.s=$(e.s),e.l=$(e.l),t=v(e.h,e.s,e.l),r=!0,o="hsl"),e.hasOwnProperty("a")&&(n=e.a)),n=V(n),{ok:r,format:e.format||o,r:oe(255,se(t.r,0)),g:oe(255,se(t.g,0)),b:oe(255,se(t.b,0)),a:n}}function g(e,t,n){return{r:255*I(e,255),g:255*I(t,255),b:255*I(n,255)}}function m(e,t,n){e=I(e,255),t=I(t,255),n=I(n,255);var r,i,o=se(e,t,n),s=oe(e,t,n),a=(o+s)/2;if(o==s)r=i=0;else{var l=o-s;switch(i=a>.5?l/(2-o-s):l/(o+s),o){case e:r=(t-n)/l+(t<n?6:0);break;case t:r=(n-e)/l+2;break;case n:r=(e-t)/l+4}r/=6}return{h:r,s:i,l:a}}function v(e,t,n){function r(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}var i,o,s;if(e=I(e,360),t=I(t,100),n=I(n,100),0===t)i=o=s=n;else{var a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;i=r(l,a,e+1/3),o=r(l,a,e),s=r(l,a,e-1/3)}return{r:255*i,g:255*o,b:255*s}}function b(e,t,n){e=I(e,255),t=I(t,255),n=I(n,255);var r,i,o=se(e,t,n),s=oe(e,t,n),a=o,l=o-s;if(i=0===o?0:l/o,o==s)r=0;else{switch(o){case e:r=(t-n)/l+(t<n?6:0);break;case t:r=(n-e)/l+2;break;case n:r=(e-t)/l+4}r/=6}return{h:r,s:i,v:a}}function y(e,t,n){e=6*I(e,360),t=I(t,100),n=I(n,100);var r=re.floor(e),i=e-r,o=n*(1-t),s=n*(1-i*t),a=n*(1-(1-i)*t),l=r%6,c=[n,s,o,o,a,n][l],u=[a,n,n,s,o,o][l],d=[o,o,a,n,n,s][l];return{r:255*c,g:255*u,b:255*d}}function w(e,t,n,r){var i=[B(ie(e).toString(16)),B(ie(t).toString(16)),B(ie(n).toString(16))];return r&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function x(e,t,n,r){var i=[B(W(r)),B(ie(e).toString(16)),B(ie(t).toString(16)),B(ie(n).toString(16))];return i.join("")}function C(e,t){t=0===t?0:t||10;var n=le(e).toHsl();return n.s-=t/100,n.s=F(n.s),le(n)}function j(e,t){t=0===t?0:t||10;var n=le(e).toHsl();return n.s+=t/100,n.s=F(n.s),le(n)}function O(e){return le(e).desaturate(100)}function k(e,t){t=0===t?0:t||10;var n=le(e).toHsl();return n.l+=t/100,n.l=F(n.l),le(n)}function S(e,t){t=0===t?0:t||10;var n=le(e).toRgb();return n.r=se(0,oe(255,n.r-ie(255*-(t/100)))),n.g=se(0,oe(255,n.g-ie(255*-(t/100)))),n.b=se(0,oe(255,n.b-ie(255*-(t/100)))),le(n)}function T(e,t){t=0===t?0:t||10;var n=le(e).toHsl();return n.l-=t/100,n.l=F(n.l),le(n)}function P(e,t){var n=le(e).toHsl(),r=(ie(n.h)+t)%360;return n.h=r<0?360+r:r,le(n)}function E(e){var t=le(e).toHsl();return t.h=(t.h+180)%360,le(t)}function _(e){var t=le(e).toHsl(),n=t.h;return[le(e),le({h:(n+120)%360,s:t.s,l:t.l}),le({h:(n+240)%360,s:t.s,l:t.l})]}function D(e){var t=le(e).toHsl(),n=t.h;return[le(e),le({h:(n+90)%360,s:t.s,l:t.l}),le({h:(n+180)%360,s:t.s,l:t.l}),le({h:(n+270)%360,s:t.s,l:t.l})]}function M(e){var t=le(e).toHsl(),n=t.h;return[le(e),le({h:(n+72)%360,s:t.s,l:t.l}),le({h:(n+216)%360,s:t.s,l:t.l})]}function A(e,t,n){t=t||6,n=n||30;var r=le(e).toHsl(),i=360/n,o=[le(e)];for(r.h=(r.h-(i*t>>1)+720)%360;--t;)r.h=(r.h+i)%360,o.push(le(r));return o}function L(e,t){t=t||6;for(var n=le(e).toHsv(),r=n.h,i=n.s,o=n.v,s=[],a=1/t;t--;)s.push(le({h:r,s:i,v:o})),o=(o+a)%1;return s}function N(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}function V(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function I(e,t){H(e)&&(e="100%");var n=z(e);return e=oe(t,se(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),re.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function F(e){return oe(1,se(0,e))}function R(e){return parseInt(e,16)}function H(e){return"string"==typeof e&&e.indexOf(".")!=-1&&1===parseFloat(e)}function z(e){return"string"==typeof e&&e.indexOf("%")!=-1}function B(e){return 1==e.length?"0"+e:""+e}function $(e){return e<=1&&(e=100*e+"%"),e}function W(e){return Math.round(255*parseFloat(e)).toString(16)}function U(e){return R(e)/255}function q(e){e=e.replace(ee,"").replace(te,"").toLowerCase();var t=!1;if(ce[e])e=ce[e],t=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};var n;return(n=de.rgb.exec(e))?{r:n[1],g:n[2],b:n[3]}:(n=de.rgba.exec(e))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=de.hsl.exec(e))?{h:n[1],s:n[2],l:n[3]}:(n=de.hsla.exec(e))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=de.hsv.exec(e))?{h:n[1],s:n[2],v:n[3]}:(n=de.hsva.exec(e))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=de.hex8.exec(e))?{a:U(n[1]),r:R(n[2]),g:R(n[3]),b:R(n[4]),format:t?"name":"hex8"}:(n=de.hex6.exec(e))?{r:R(n[1]),g:R(n[2]),b:R(n[3]),format:t?"name":"hex"}:!!(n=de.hex3.exec(e))&&{r:R(n[1]+""+n[1]),g:R(n[2]+""+n[2]),b:R(n[3]+""+n[3]),format:t?"name":"hex"}}var G={beforeShow:l,move:l,change:l,show:l,hide:l,color:!1,flat:!1,showInput:!1,allowEmpty:!1,showButtons:!0,clickoutFiresChange:!0,showInitial:!1,showPalette:!1,showPaletteOnly:!1,hideAfterPaletteSelect:!1,togglePaletteOnly:!1,showSelectionPalette:!0,localStorageKey:!1,appendTo:"body",maxSelectionSize:7,cancelText:"cancel",chooseText:"choose",togglePaletteMoreText:"more",togglePaletteLessText:"less",clearText:"Clear Color Selection",noColorSelectedText:"No Color Selected",preferredFormat:!1,className:"",containerClassName:"",replacerClassName:"",showAlpha:!1,theme:"sp-light",palette:[["#ffffff","#000000","#ff0000","#ff8000","#ffff00","#008000","#0000ff","#4b0082","#9400d3"]],selectionPalette:[],disabled:!1,offset:null},K=[],Y=!!/msie/i.exec(window.navigator.userAgent),X=function(){function e(e,t){return!!~(""+e).indexOf(t)}var t=document.createElement("div"),n=t.style;return n.cssText="background-color:rgba(0,0,0,.5)",e(n.backgroundColor,"rgba")||e(n.backgroundColor,"hsla")}(),J=["<div class='sp-replacer'>","<div class='sp-preview'><div class='sp-preview-inner'></div></div>","<div class='sp-dd'>▼</div>","</div>"].join(""),Z=function(){var e="";if(Y)for(var t=1;t<=6;t++)e+="<div class='sp-"+t+"'></div>";return["<div class='sp-container sp-hidden'>","<div class='sp-palette-container'>","<div class='sp-palette sp-thumb sp-cf'></div>","<div class='sp-palette-button-container sp-cf'>","<button type='button' class='sp-palette-toggle'></button>","</div>","</div>","<div class='sp-picker-container'>","<div class='sp-top sp-cf'>","<div class='sp-fill'></div>","<div class='sp-top-inner'>","<div class='sp-color'>","<div class='sp-sat'>","<div class='sp-val'>","<div class='sp-dragger'></div>","</div>","</div>","</div>","<div class='sp-clear sp-clear-display'>","</div>","<div class='sp-hue'>","<div class='sp-slider'></div>",e,"</div>","</div>","<div class='sp-alpha'><div class='sp-alpha-inner'><div class='sp-alpha-handle'></div></div></div>","</div>","<div class='sp-input-container sp-cf'>","<input class='sp-input' type='text' spellcheck='false' />","</div>","<div class='sp-initial sp-thumb sp-cf'></div>","<div class='sp-button-container sp-cf'>","<a class='sp-cancel' href='#'></a>","<button type='button' class='sp-choose'></button>","</div>","</div>","</div>"].join("")}(),Q="spectrum.id";e.fn.spectrum=function(t,n){if("string"==typeof t){var r=this,i=Array.prototype.slice.call(arguments,1);return this.each(function(){var n=K[e(this).data(Q)];if(n){var o=n[t];if(!o)throw new Error("Spectrum: no such method: '"+t+"'");"get"==t?r=n.get():"container"==t?r=n.container:"option"==t?r=n.option.apply(n,i):"destroy"==t?(n.destroy(),e(this).removeData(Q)):o.apply(n,i)}}),r}return this.spectrum("destroy").each(function(){var n=e.extend({},t,e(this).data()),r=s(this,n);e(this).data(Q,r.id)})},e.fn.spectrum.load=!0,e.fn.spectrum.loadOpts={},e.fn.spectrum.draggable=d,e.fn.spectrum.defaults=G,e.fn.spectrum.inputTypeColorSupport=function he(){if("undefined"==typeof he._cachedResult){var t=e("<input type='color'/>")[0];he._cachedResult="color"===t.type&&""!==t.value}return he._cachedResult},e.spectrum={},e.spectrum.localization={},e.spectrum.palettes={},e.fn.spectrum.processNativeColorInputs=function(){var t=e("input[type=color]");t.length&&!f()&&t.spectrum({preferredFormat:"hex6"})};var ee=/^[\s,#]+/,te=/\s+$/,ne=0,re=Math,ie=re.round,oe=re.min,se=re.max,ae=re.random,le=function fe(e,t){if(e=e?e:"",t=t||{},e instanceof fe)return e;if(!(this instanceof fe))return new fe(e,t);var n=p(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=ie(100*this._a)/100,this._format=t.format||n.format,this._gradientType=t.gradientType,this._r<1&&(this._r=ie(this._r)),this._g<1&&(this._g=ie(this._g)),this._b<1&&(this._b=ie(this._b)),this._ok=n.ok,this._tc_id=ne++};le.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},setAlpha:function(e){return this._a=V(e),this._roundA=ie(100*this._a)/100,this},toHsv:function(){var e=b(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=b(this._r,this._g,this._b),t=ie(360*e.h),n=ie(100*e.s),r=ie(100*e.v);return 1==this._a?"hsv("+t+", "+n+"%, "+r+"%)":"hsva("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var e=m(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=m(this._r,this._g,this._b),t=ie(360*e.h),n=ie(100*e.s),r=ie(100*e.l);return 1==this._a?"hsl("+t+", "+n+"%, "+r+"%)":"hsla("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(e){return w(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(){return x(this._r,this._g,this._b,this._a)},toHex8String:function(){return"#"+this.toHex8()},toRgb:function(){return{r:ie(this._r),g:ie(this._g),b:ie(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+ie(this._r)+", "+ie(this._g)+", "+ie(this._b)+")":"rgba("+ie(this._r)+", "+ie(this._g)+", "+ie(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:ie(100*I(this._r,255))+"%",g:ie(100*I(this._g,255))+"%",b:ie(100*I(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+ie(100*I(this._r,255))+"%, "+ie(100*I(this._g,255))+"%, "+ie(100*I(this._b,255))+"%)":"rgba("+ie(100*I(this._r,255))+"%, "+ie(100*I(this._g,255))+"%, "+ie(100*I(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(ue[w(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+x(this._r,this._g,this._b,this._a),n=t,r=this._gradientType?"GradientType = 1, ":"";if(e){var i=le(e);n=i.toHex8String()}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+t+",endColorstr="+n+")"},toString:function(e){var t=!!e;e=e||this._format;var n=!1,r=this._a<1&&this._a>=0,i=!t&&r&&("hex"===e||"hex6"===e||"hex3"===e||"name"===e);return i?"name"===e&&0===this._a?this.toName():this.toRgbString():("rgb"===e&&(n=this.toRgbString()),"prgb"===e&&(n=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(n=this.toHexString()),"hex3"===e&&(n=this.toHexString(!0)),"hex8"===e&&(n=this.toHex8String()),"name"===e&&(n=this.toName()),"hsl"===e&&(n=this.toHslString()),"hsv"===e&&(n=this.toHsvString()),n||this.toHexString())},_applyModification:function(e,t){var n=e.apply(null,[this].concat([].slice.call(t)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(k,arguments)},brighten:function(){return this._applyModification(S,arguments)},darken:function(){return this._applyModification(T,arguments)},desaturate:function(){return this._applyModification(C,arguments)},saturate:function(){return this._applyModification(j,arguments)},greyscale:function(){return this._applyModification(O,arguments)},spin:function(){return this._applyModification(P,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(A,arguments)},complement:function(){return this._applyCombination(E,arguments)},monochromatic:function(){return this._applyCombination(L,arguments)},splitcomplement:function(){return this._applyCombination(M,arguments)},triad:function(){return this._applyCombination(_,arguments)},tetrad:function(){return this._applyCombination(D,arguments)}},le.fromRatio=function(e,t){if("object"==i()(e)){var n={};for(var r in e)e.hasOwnProperty(r)&&("a"===r?n[r]=e[r]:n[r]=$(e[r]));e=n}return le(e,t)},le.equals=function(e,t){return!(!e||!t)&&le(e).toRgbString()==le(t).toRgbString()},le.random=function(){return le.fromRatio({r:ae(),g:ae(),b:ae()})},le.mix=function(e,t,n){n=0===n?0:n||50;var r,i=le(e).toRgb(),o=le(t).toRgb(),s=n/100,a=2*s-1,l=o.a-i.a;r=a*l==-1?a:(a+l)/(1+a*l),r=(r+1)/2;var c=1-r,u={r:o.r*r+i.r*c,g:o.g*r+i.g*c,b:o.b*r+i.b*c,a:o.a*s+i.a*(1-s)};return le(u)},le.readability=function(e,t){var n=le(e),r=le(t),i=n.toRgb(),o=r.toRgb(),s=n.getBrightness(),a=r.getBrightness(),l=Math.max(i.r,o.r)-Math.min(i.r,o.r)+Math.max(i.g,o.g)-Math.min(i.g,o.g)+Math.max(i.b,o.b)-Math.min(i.b,o.b);return{brightness:Math.abs(s-a),color:l}},le.isReadable=function(e,t){var n=le.readability(e,t);return n.brightness>125&&n.color>500},le.mostReadable=function(e,t){for(var n=null,r=0,i=!1,o=0;o<t.length;o++){var s=le.readability(e,t[o]),a=s.brightness>125&&s.color>500,l=3*(s.brightness/125)+s.color/500;(a&&!i||a&&i&&l>r||!a&&!i&&l>r)&&(i=a,r=l,n=le(t[o]))}return n};var ce=le.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},ue=le.hexNames=N(ce),de=function(){var e="[-\\+]?\\d+%?",t="[-\\+]?\\d*\\.\\d+%?",n="(?:"+t+")|(?:"+e+")",r="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?",i="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?";return{rgb:new RegExp("rgb"+r),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+r),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+r),hsva:new RegExp("hsva"+i),hex3:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex8:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();window.tinycolor=le,e(function(){e.fn.spectrum.load&&e.fn.spectrum.processNativeColorInputs()})}},"./src/utils/Dragger.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t),n.d(t,"default",function(){return p});var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./node_modules/@babel/runtime/helpers/classCallCheck.js"),l=n.n(a),c=n("./node_modules/@babel/runtime/helpers/createClass.js"),u=n.n(c),d=n("./node_modules/underscore/underscore.js"),h=(n.n(d),n("./src/utils/mixins.js")),f=function(){return{x:0,y:0}},p=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return l()(this,e),this.opts={container:null,onStart:null,onDrag:null,onEnd:null,setPosition:null,getPosition:null,guidesStatic:null,guidesTarget:null,snapOffset:5,doc:0,scale:1},Object(d.bindAll)(this,"drag","stop","keyHandle","handleScroll"),this.setOptions(t),this.delta=f(),this}return u()(e,[{key:"setOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.opts=i({},this.opts,{},e)}},{key:"toggleDrag",value:function(e){var t=this.getDocumentEl(),n=this.getContainerEl(),r=this.getWindowEl(),i=e?"on":"off",o={on:h.on,off:h.off};o[i](n,"mousemove dragover",this.drag),o[i](t,"mouseup dragend touchend",this.stop),o[i](t,"keydown",this.keyHandle),o[i](r,"scroll",this.handleScroll)}},{key:"handleScroll",value:function(){var e=this.lastScroll,t=this.delta,n=this.getScrollInfo(),r={x:n.x-e.x,y:n.y-e.y};this.move(t.x+r.x,t.y+r.y),this.lastScrollDiff=r}},{key:"start",value:function(e){var t=this.opts,n=t.onStart;this.toggleDrag(1),this.startPointer=this.getPointerPos(e),this.guidesStatic=Object(d.result)(t,"guidesStatic")||[],this.guidesTarget=Object(d.result)(t,"guidesTarget")||[],Object(d.isFunction)(n)&&n(e,this),this.startPosition=this.getStartPosition(),this.lastScrollDiff=f(),this.globScrollDiff=f(),this.drag(e)}},{key:"drag",value:function(e){var t=this,n=this.opts,r=this.lastScrollDiff,o=this.globScrollDiff,s=n.onDrag,a=this.startPointer,l=this.getPointerPos(e),c={x:o.x+r.x,y:o.y+r.y};this.globScrollDiff=c;var u={x:l.x-a.x+c.x,y:l.y-a.y+c.y};this.lastScrollDiff=f();var h=this.lockedAxis;h=e.shiftKey?!h&&this.detectAxisLock(u.x,u.y):null,"x"===h?u.x=a.x:"y"===h&&(u.y=a.y);var p=function(r){["x","y"].forEach(function(e){return r[e]=r[e]*Object(d.result)(n,"scale")}),t.delta=r,t.move(r.x,r.y),Object(d.isFunction)(s)&&s(e,t)},g=i({},u);if(this.currentPointer=l,this.lockedAxis=h,this.lastScroll=this.getScrollInfo(),p(u),this.guidesTarget.length){var m=this.snapGuides(g),v=m.newDelta,b=m.trgX,y=m.trgY;(b||y)&&p(v)}0===e.which&&this.stop(e)}},{key:"snapGuides",value:function(e){var t=this,n=e,r=this.trgX,i=this.trgY;return this.guidesTarget.forEach(function(n){n.x&&t.trgX||n.y&&t.trgY||(n.active=0,t.guidesStatic.forEach(function(o){if(!(n.y&&o.x||n.x&&o.y)){var s=n.y&&o.y,a=s?"y":"x",l=n[a],c=o[a],u=e[a],h=s?i:r;if(t.isPointIn(l,c)&&Object(d.isUndefined)(h)){var f=u-(l-c);t.setGuideLock(n,f)}}}))}),r=this.trgX,i=this.trgY,["x","y"].forEach(function(r){var i=r.toUpperCase(),o=t["trg".concat(i)];o&&!t.isPointIn(e[r],o.lock)&&(t.setGuideLock(o,null),o=null),o&&!Object(d.isUndefined)(o.lock)&&(n[r]=o.lock)}),{newDelta:n,trgX:this.trgX,trgY:this.trgY}}},{key:"isPointIn",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.offset,i=r||this.opts.snapOffset;return e>=t&&e<=t+i||e<=t&&e>=t-i}},{key:"setGuideLock",value:function(e,t){var n=Object(d.isUndefined)(e.x)?"Y":"X",r="trg".concat(n);return null!==t?(e.active=1,e.lock=t,this[r]=e):(delete e.active,delete e.lock,delete this[r]),e}},{key:"stop",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.delta,r=t.cancel,i=r?0:n.x,o=r?0:n.y;this.toggleDrag(),this.lockedAxis=null,this.move(i,o,1);var s=this.opts.onEnd;Object(d.isFunction)(s)&&s(e,this,{cancelled:r})}},{key:"keyHandle",value:function(e){Object(h.isEscKey)(e)&&this.stop(e,{cancel:1})}},{key:"move",value:function(e,t,n){var r=this.el,i=this.opts,o=this.startPosition;if(o){var s=i.setPosition,a=o.x+e,l=o.y+t;this.position={x:a,y:l,end:n},Object(d.isFunction)(s)&&s(this.position),r&&(r.style.left="".concat(a,"px"),r.style.top="".concat(l,"px"))}}},{key:"getContainerEl",value:function(){var e=this.opts.container;return e?[e]:this.getDocumentEl()}},{key:"getWindowEl",value:function(){var e=this.getContainerEl();return e.map(function(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow})}},{key:"getDocumentEl",value:function(e){var t=this.opts.doc;if(e=e||this.el,!this.docs){var n=[document];e&&n.push(e.ownerDocument),t&&n.push(t),this.docs=n}return this.docs}},{key:"getPointerPos",value:function(e){var t=this.opts.getPointerPosition,n=Object(h.getPointerEvent)(e);return t?t(e):{x:n.clientX,y:n.clientY}}},{key:"getStartPosition",value:function(){var e=this.el,t=this.opts,n=t.getPosition,r=f();return Object(d.isFunction)(n)?r=n():e&&(r={x:parseFloat(e.style.left),y:parseFloat(e.style.top)}),r}},{key:"getScrollInfo",value:function(){var e=this.opts.doc,t=e&&e.body;return{y:t?t.scrollTop:0,x:t?t.scrollLeft:0}}},{key:"detectAxisLock",value:function(e,t){var n=e,r=t,i=Math.abs(n),o=Math.abs(r);return r>=i||r<=-i?"x":n>o||n<-o?"y":void 0}}]),e}()},"./src/utils/Droppable.js":function(e,t,n){"use strict";n.r(t),n.d(t,"default",function(){return c});var r=n("./node_modules/@babel/runtime/helpers/classCallCheck.js"),i=n.n(r),o=n("./node_modules/@babel/runtime/helpers/createClass.js"),s=n.n(o),a=n("./src/utils/mixins.js"),l=n("./node_modules/underscore/underscore.js"),c=(n.n(l),function(){function e(t,n){var r=this;i()(this,e),this.em=t;var o=n||t.get("Canvas").getFrames().map(function(e){return e.get("root").getEl()}),s=Array.isArray(o)?o:[o];return this.el=o,this.counter=0,Object(l.bindAll)(this,"handleDragEnter","handleDragOver","handleDrop","handleDragLeave"),s.forEach(function(e){return r.toggleEffects(e,1)}),this}return s()(e,[{key:"toggleEffects",value:function(e,t){var n={on:a.on,off:a.off},r=t?"on":"off";n[r](e,"dragenter",this.handleDragEnter),n[r](e,"dragover",this.handleDragOver),n[r](e,"drop",this.handleDrop),n[r](e,"dragleave",this.handleDragLeave)}},{key:"endDrop",value:function(e,t){var n=this.em,r=this.dragStop;this.counter=0,this.over=0,r&&r(e),n.runDefault({preserveSelected:1}),n.trigger("canvas:dragend",t)}},{key:"handleDragLeave",value:function(e){this.updateCounter(-1,e)}},{key:"updateCounter",value:function(e,t){this.counter+=e,0===this.counter&&this.endDrop(1,t)}},{key:"handleDragEnter",value:function(e){var t=this,n=this.em,r=e.dataTransfer;if(this.updateCounter(1,e),!this.over){this.over=1;var i,o,s=n.get("Utils"),a=n.get("Canvas"),l=a.getBody(),c=n.get("dragContent")||"<br>";if(n.stopDefault(),n.inAbsoluteMode()){var u=n.get("DomComponents").getWrapper(),d=u.append({})[0],h=n.get("Commands").run("core:component-drag",{event:e,guidesInfo:1,center:1,target:d,onEnd:function(e,n,i){var o=i.cancelled;if(!o){var s=u.append(c)[0],a=d.getStyle(),l=a.left,h=a.top,f=a.position;s.addStyle({left:l,top:h,position:f}),t.handleDragEnd(s,r)}d.remove()}});i=function(t){return h.stop(e,{cancel:t})},o=function(e){return c=e}}else{var f=new s.Sorter({em:n,wmargin:1,nested:1,canvasRelative:1,direction:"a",container:l,placer:a.getPlacerEl(),containerSel:"*",itemSel:"*",pfx:"gjs-",onEndMove:function(e){return t.handleDragEnd(e,r)},document:a.getFrameEl().contentDocument});f.setDropContent(c),f.startSort(),this.sorter=f,i=function(e){e&&(f.moved=0),f.endMove()},o=function(e){return f.setDropContent(e)}}this.dragStop=i,this.dragContent=o,n.trigger("canvas:dragenter",r,c)}}},{key:"handleDragEnd",value:function(e,t){if(e){var n=this.em;n.set("dragResult",e),n.trigger("canvas:drop",t,e)}}},{key:"handleDragOver",value:function(e){e.preventDefault(),this.em.trigger("canvas:dragover",e)}},{key:"handleDrop",value:function(e){e.preventDefault();var t=this.dragContent,n=e.dataTransfer,r=this.getContentByData(n).content;e.target.style.border="",r&&t&&t(r),this.endDrop(!r,e)}},{key:"getContentByData",value:function(e){var t=this.em,n=e.types,r=e.files||[],i=t.get("dragContent"),o=e.getData("text");if(r.length){o=[];for(var s=0;s<r.length;s++){var a=r[s],c=a.type.split("/")[0];"image"==c&&o.push({type:c,file:a,attributes:{alt:a.name}})}}else if(i)o=i;else if(Object(l.indexOf)(n,"text/html")>=0)o=e.getData("text/html").replace(/<\/?meta[^>]*>/g,"");else if(Object(l.indexOf)(n,"text/uri-list")>=0)o={type:"link",attributes:{href:o},content:o};else if(Object(l.indexOf)(n,"text/json")>=0){var u=e.getData("text/json");u&&(o=JSON.parse(u))}var d={content:o};return t.trigger("canvas:dragdata",e,d),d}}]),e}())},"./src/utils/Resizer.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./node_modules/@babel/runtime/helpers/classCallCheck.js"),l=n.n(a),c=n("./node_modules/@babel/runtime/helpers/createClass.js"),u=n.n(c),d=n("./node_modules/underscore/underscore.js"),h=(n.n(d),n("./src/utils/mixins.js")),f={mousePosFetcher:null,updateTarget:null,ratioDefault:0,posFetcher:null,onStart:null,onMove:null,onEnd:null,onUpdateContainer:function(){},step:1,minDim:32,maxDim:"",unitHeight:"px",unitWidth:"px",keyHeight:"height",keyWidth:"width",currentUnit:1,silentFrames:0,avoidContainerUpdate:0,keepAutoHeight:!1,keepAutoWidth:!1,autoHeight:!1,autoWidth:!1,tl:1,tc:1,tr:1,cl:1,cr:1,bl:1,bc:1,br:1},p=function(e,t){var n=t.prefix||"",r=document.createElement("i");return r.className=n+"resizer-h "+n+"resizer-h-"+e,r.setAttribute("data-"+n+"handler",e),r},g=function(e,t){var n=t||window,r=e.getBoundingClientRect();return{left:r.left+n.pageXOffset,top:r.top+n.pageYOffset,width:r.width,height:r.height}},m=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return l()(this,e),this.setOptions(t),Object(d.bindAll)(this,"handleKeyDown","handleMouseDown","move","stop"),this}return u()(e,[{key:"getConfig",value:function(){return this.opts}},{key:"setOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.opts=Object(d.defaults)(e,f),this.setup()}},{key:"setup",value:function(){var e=this.opts,t=e.prefix||"",n=e.appendTo||document.body,r=this.container;for(r||(r=document.createElement("div"),r.className="".concat(t,"resizer-c"),n.appendChild(r),this.container=r);r.firstChild;)r.removeChild(r.firstChild);var i={};["tl","tc","tr","cl","cr","bl","bc","br"].forEach(function(t){return i[t]=e[t]?p(t,e):""});for(var o in i){var s=i[o];s&&r.appendChild(s)}this.handlers=i,this.mousePosFetcher=e.mousePosFetcher,this.updateTarget=e.updateTarget,this.posFetcher=e.posFetcher,this.onStart=e.onStart,this.onMove=e.onMove,this.onEnd=e.onEnd,this.onUpdateContainer=e.onUpdateContainer}},{key:"toggleFrames",value:function(e){if(this.opts.silentFrames){var t=document.querySelectorAll("iframe");Object(d.each)(t,function(t){return t.style.pointerEvents=e?"none":""})}}},{key:"isHandler",value:function(e){var t=this.handlers;for(var n in t)if(t[n]===e)return!0;return!1}},{key:"getFocusedEl",value:function(){return this.el}},{key:"getDocumentEl",value:function(){return[this.el.ownerDocument,document]}},{key:"getElementPos",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.posFetcher||"";return n?n(e,t):g(e)}},{key:"focus",value:function(e){e&&e===this.el||(this.el=e,this.updateContainer({forceShow:1}),Object(h.on)(this.getDocumentEl(),"mousedown",this.handleMouseDown))}},{key:"blur",value:function(){this.container.style.display="none",this.el&&(Object(h.off)(this.getDocumentEl(),"mousedown",this.handleMouseDown),this.el=null)}},{key:"start",value:function(e){if(0===e.button){e.preventDefault(),e.stopPropagation();var t=this.el,n=this,r=this.opts||{},i="data-"+r.prefix+"handler",o=this.getElementPos(t,{target:"el"});this.handlerAttr=e.target.getAttribute(i),this.clickedHandler=e.target,this.startDim={t:o.top,l:o.left,w:o.width,h:o.height},this.rectDim={t:o.top,l:o.left,w:o.width,h:o.height},this.startPos={x:e.clientX,y:e.clientY};var s=this.getDocumentEl();Object(h.on)(s,"mousemove",this.move),Object(h.on)(s,"keydown",this.handleKeyDown),Object(h.on)(s,"mouseup",this.stop),Object(d.isFunction)(this.onStart)&&this.onStart(e,{docs:s,config:r,el:t,resizer:n}),this.toggleFrames(1),this.move(e)}}},{key:"move",value:function(e){var t=this.onMove,n=this.mousePosFetcher,r=n?n(e):{x:e.clientX,y:e.clientY};this.currentPos=r,this.delta={x:r.x-this.startPos.x,y:r.y-this.startPos.y},this.keys={shift:e.shiftKey,ctrl:e.ctrlKey,alt:e.altKey},this.rectDim=this.calc(this),this.updateRect(0),t&&t(e),0===e.which&&this.stop(e)}},{key:"stop",value:function(e){var t=this.opts,n=this.getDocumentEl();Object(h.off)(n,"mousemove",this.move),Object(h.off)(n,"keydown",this.handleKeyDown),Object(h.off)(n,"mouseup",this.stop),this.updateRect(1),this.toggleFrames(),Object(d.isFunction)(this.onEnd)&&this.onEnd(e,{docs:n,config:t})}},{key:"updateRect",value:function(e){var t=this.el,n=this,r=this.opts,i=this.rectDim,o=this.updateTarget,s=this.getSelectedHandler(),a=r.unitHeight,l=r.unitWidth,c=r.keyWidth,u=r.keyHeight;if(Object(d.isFunction)(o))o(t,i,{store:e,selectedHandler:s,resizer:n,config:r});else{var h=t.style;h[c]=i.w+l,
|
||
h[u]=i.h+a}this.updateContainer()}},{key:"updateContainer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.opts,n=this.container,r=this.el,o=n.style;!t.avoidContainerUpdate&&r&&e.forceShow&&(o.display="block"),this.onUpdateContainer({el:n,resizer:this,opts:i({},t,{},e)})}},{key:"getSelectedHandler",value:function(){var e=this.handlers;if(this.selectedHandler)for(var t in e)if(e[t]===this.selectedHandler)return t}},{key:"handleKeyDown",value:function(e){27===e.keyCode&&(this.rectDim=this.startDim,this.stop(e))}},{key:"handleMouseDown",value:function(e){var t=e.target;this.isHandler(t)?(this.selectedHandler=t,this.start(e)):t!==this.el&&(this.selectedHandler="",this.blur())}},{key:"calc",value:function(e){var t,n=this.opts||{},r=n.step,i=this.startDim,o=n.minDim,s=n.maxDim,a=e.delta.x,l=e.delta.y,c=i.w,u=i.h,d={t:0,l:0,w:c,h:u};if(e){var f=e.handlerAttr;~f.indexOf("r")&&(t=Object(h.normalizeFloat)(c+a*r,r),t=Math.max(o,t),s&&(t=Math.min(s,t)),d.w=t),~f.indexOf("b")&&(t=Object(h.normalizeFloat)(u+l*r,r),t=Math.max(o,t),s&&(t=Math.min(s,t)),d.h=t),~f.indexOf("l")&&(t=Object(h.normalizeFloat)(c-a*r,r),t=Math.max(o,t),s&&(t=Math.min(s,t)),d.w=t),~f.indexOf("t")&&(t=Object(h.normalizeFloat)(u-l*r,r),t=Math.max(o,t),s&&(t=Math.min(s,t)),d.h=t);var p=n.ratioDefault?!e.keys.shift:e.keys.shift;if(f.indexOf("c")<0&&p){var g=i.w/i.h;d.w/d.h>g?d.h=Math.round(d.w/g):d.w=Math.round(d.h*g)}return~f.indexOf("l")&&(d.l=i.w-d.w),~f.indexOf("t")&&(d.t=i.h-d.h),d}}}]),e}();t["default"]={init:function(e){return new m(e)}}},"./src/utils/Sorter.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){s()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.r(t);var o=n("./node_modules/@babel/runtime/helpers/defineProperty.js"),s=n.n(o),a=n("./node_modules/backbone/backbone.js"),l=n.n(a),c=n("./node_modules/underscore/underscore.js"),u=(n.n(c),n("./src/utils/mixins.js")),d=l.a.$;t["default"]=l.a.View.extend({initialize:function(e){this.opt=e||{},Object(c.bindAll)(this,"startSort","onMove","endMove","rollback","updateOffset","moveDragHelper");var t=e||{};this.elT=0,this.elL=0,this.borderOffset=t.borderOffset||10;var n=t.container;this.el="string"==typeof n?document.querySelector(n):n,this.$el=d(this.el),this.containerSel=t.containerSel||"div",this.itemSel=t.itemSel||"div",this.draggable=t.draggable||!0,this.nested=t.nested||0,this.pfx=t.pfx||"",this.ppfx=t.ppfx||"",this.freezeClass=t.freezeClass||this.pfx+"freezed",this.onStart=t.onStart||"",this.onEndMove=t.onEndMove||"",this.direction=t.direction||"v",this.onMoveClb=t.onMove||"",this.relative=t.relative||0,this.ignoreViewChildren=t.ignoreViewChildren||0,this.ignoreModels=t.ignoreModels||0,this.plh=t.placer||"",this.wmargin=t.wmargin||0,this.offTop=t.offsetTop||0,this.offLeft=t.offsetLeft||0,this.document=t.document||document,this.$document=d(this.document),this.dropContent=null,this.em=t.em||"",this.dragHelper=null,this.canvasRelative=t.canvasRelative||0,this.selectOnEnd=!t.avoidSelectOnEnd,this.scale=t.scale,this.activeTextModel=null,this.em&&this.em.on&&(this.em.on("change:canvasOffset",this.updateOffset),this.updateOffset())},getScale:function(){return Object(c.result)(this,scale)||1},getContainerEl:function(e){if(e&&(this.el=e),!this.el){var t=this.opt.container;this.el="string"==typeof t?document.querySelector(t):t,this.$el=d(this.el)}return this.el},getDocuments:function(e){var t=this.em,n=e?e.ownerDocument:t&&t.get("Canvas").getBody().ownerDocument,r=[document];return n&&r.push(n),r},updateOffset:function(){var e=this.em.get("canvasOffset")||{};this.offTop=e.top,this.offLeft=e.left},setDropContent:function(e){this.dropModel=null,this.dropContent=e},updateTextViewCursorPosition:function(e){var t=this.em.get("Canvas"),n=t.getDocument(),r=null;if(n.caretRangeFromPoint){var i=Object(u.getPointerEvent)(e);r=n.caretRangeFromPoint(i.clientX,i.clientY)}else e.rangeParent&&(r=n.createRange(),r.setStart(e.rangeParent,e.rangeOffset));var o=t.getWindow().getSelection();t.getFrameEl().focus(),o.removeAllRanges(),r&&o.addRange(r)},setContentEditable:function(e,t){if(e){var n=e.getEl();n.contentEditable!=t&&(n.contentEditable=t)}},toggleSortCursor:function(e){var t=this.em,n=t&&t.get("Canvas");n&&(e?n.startAutoscroll():n.stopAutoscroll())},setDragHelper:function(e,t){for(var n=t||"",r=e.cloneNode(1),i=e.getBoundingClientRect(),o=getComputedStyle(e),s="",a=0;a<o.length;a++){var l=o[a];s+="".concat(l,":").concat(o.getPropertyValue(l),";")}document.body.appendChild(r),r.className+=" ".concat(this.pfx,"bdrag"),r.setAttribute("style",s),this.dragHelper=r,r.style.width="".concat(i.width,"px"),r.style.height="".concat(i.height,"px"),n&&this.moveDragHelper(n),this.em&&d(this.em.get("Canvas").getBody().ownerDocument).off("mousemove",this.moveDragHelper).on("mousemove",this.moveDragHelper),d(document).off("mousemove",this.moveDragHelper).on("mousemove",this.moveDragHelper)},moveDragHelper:function(e){var t=e.target.ownerDocument;if(this.dragHelper&&t){var n=e.pageY,r=e.pageX,i=0,o=0,s=t.defaultView||t.parentWindow,a=s.frameElement,l=this.dragHelper.style;if(a){var c=a.getBoundingClientRect();i=c.top+document.documentElement.scrollTop,o=c.left+document.documentElement.scrollLeft,n=e.clientY,r=e.clientX}l.top=n+i+"px",l.left=r+o+"px"}},matches:function(e,t,n){return u.matches.call(e,t)},closest:function(e,t){if(e){for(var n=e.parentNode;n&&1===n.nodeType;){if(this.matches(n,t))return n;n=n.parentNode}return null}},offset:function(e){var t=e.getBoundingClientRect();return{top:t.top+document.body.scrollTop,left:t.left+document.body.scrollLeft}},createPlaceholder:function(){var e=this.pfx,t=document.createElement("div"),n=document.createElement("div");return t.className=e+"placeholder",t.style.display="none",t.style["pointer-events"]="none",n.className=e+"placeholder-int",t.appendChild(n),t},startSort:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.em,i=this.itemSel,o=this.containerSel,s=this.getContainerEl(n.container),a=this.getDocuments(e),l=this.onStart,c=this.plh;this.dropModel=null,this.target=null,this.prevTarget=null,this.moved=0,e&&!this.matches(e,"".concat(i,", ").concat(o))&&(e=this.closest(e,i)),this.eV=e,c||(c=this.createPlaceholder(),s.appendChild(c),this.plh=c),e&&(t=this.getSourceModel(e),t&&t.set&&t.set("status","freezed"),this.srcModel=t),Object(u.on)(s,"mousemove dragover",this.onMove),Object(u.on)(a,"mouseup dragend touchend",this.endMove),Object(u.on)(a,"keydown",this.rollback),l&&l({target:t,parent:t&&t.parent(),index:t&&t.index()}),r&&r.clearSelection(),this.toggleSortCursor(1),r&&r.trigger("sorter:drag:start",e,t)},getTargetModel:function(e){var t=e||this.target;return d(t).data("model")},getSourceModel:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.target,o=n.avoidChildren,s=void 0===o?1:o,a=this.em,l=this.eV,c=e||l,u=this.dropModel,h=this.dropContent,f=function(e){return e&&r&&e.opt&&e.opt.avoidChildren&&t.isTextableActive(e,r)};if(h&&a){if(f(u)&&(u=null),!u){var p=a.get("DomComponents").getComponents(),g={avoidChildren:s,avoidStore:1,avoidUpdateStyle:1},m=p.add(h,i({},g,{temporary:1}));if(u=p.remove(m,g),u=u instanceof Array?u[0]:u,this.dropModel=u,f(u))return this.getSourceModel(c,{target:r,avoidChildren:0})}return u}return c&&d(c).data("model")},selectTargetModel:function(e){if(!(e instanceof l.a.Collection)){var t=this.targetModel;t&&t!==this.srcModel&&t.set("status",""),e&&e.set&&(e.set("status","selected-parent"),this.targetModel=e)}},onMove:function(e){var t=e,n=this.em,r=this.onMoveClb,i=this.plh;this.moved=1;var o=i.style.display;o&&"none"!==o||(i.style.display="block");var s=this.offset(this.el);this.elT=this.wmargin?Math.abs(s.top):s.top,this.elL=this.wmargin?Math.abs(s.left):s.left;var a=e.pageY-this.elT+this.el.scrollTop,l=e.pageX-this.elL+this.el.scrollLeft;if(this.canvasRelative&&n){var u=n.get("Canvas").getMouseRelativeCanvas(e,{noScroll:1});l=u.x,a=u.y}this.rX=l,this.rY=a,this.eventMove=e;var h=this.getSourceModel(),f=this.dimsFromTarget(e.target,l,a),p=this.target,g=p&&this.getTargetModel(p);if(this.selectTargetModel(g),g||(i.style.display="none"),p){this.lastDims=f;var m=this.findPosition(f,l,a);this.isTextableActive(h,g)?(this.activeTextModel=g,this.setContentEditable(g,!0),i.style.display="none",this.lastPos=m,this.updateTextViewCursorPosition(t)):(this.disableTextable(),this.activeTextModel=null,this.lastPos&&this.lastPos.index==m.index&&this.lastPos.method==m.method||(this.movePlaceholder(this.plh,f,m,this.prevTargetDim),this.$plh||(this.$plh=d(this.plh)),this.canvasRelative||(this.offTop&&this.$plh.css("top","+="+this.offTop+"px"),this.offLeft&&this.$plh.css("left","+="+this.offLeft+"px")),this.lastPos=m)),Object(c.isFunction)(r)&&r({event:e,target:h,parent:g,index:m.index+("after"==m.method?1:0)}),n&&n.trigger("sorter:drag",{target:p,targetModel:g,sourceModel:h,dims:f,pos:m,x:l,y:a})}},isTextableActive:function(e,t){return e&&e.get&&e.get("textable")&&t&&t.is("text")},disableTextable:function(){var e=this.activeTextModel;e&&e.getView().disableEditing()},isInFlow:function(e,t){if(!e)return!1;t=t||document.body;var n,r=e;return n=r.offsetHeight,!!this.styleInFlow(r,t)},styleInFlow:function(e,t){if(!Object(u.isTextNode)(e)){var n=e.style||{},r=d(e),i=t&&d(t);if(!(n.overflow&&"visible"!==n.overflow||"none"!==r.css("float")||i&&"flex"==i.css("display")&&"column"!==i.css("flex-direction"))){switch(n.position){case"static":case"relative":case"":break;default:return}switch(e.tagName){case"TR":case"TBODY":case"THEAD":case"TFOOT":return!0}switch(r.css("display")){case"block":case"list-item":case"table":case"flex":return!0}}}},validTarget:function(e,t){var n=this.getTargetModel(e),r=this.getSourceModel(t,{target:n});t=r&&r.view&&r.view.el,e=n&&n.view&&n.view.el;var i={valid:!0,src:t,srcModel:r,trg:e,trgModel:n};if(!t||!e)return i.valid=!1,i;var o=r.get("draggable");o=o instanceof Array?o.join(", "):o,i.dragInfo=o,o=Object(c.isString)(o)?this.matches(e,o):o,i.draggable=o;var s=n.get("droppable");return s=s instanceof l.a.Collection?1:s,s=s instanceof Array?s.join(", "):s,i.dropInfo=s,s=Object(c.isString)(s)?this.matches(t,s):s,s=o&&this.isTextableActive(r,n)?1:s,i.droppable=s,s&&o||(i.valid=!1),i},dimsFromTarget:function(e,t,n){var r=this.em,i=[];if(!e)return i;if(this.matches(e,"".concat(this.itemSel,", ").concat(this.containerSel))||(e=this.closest(e,this.itemSel)),this.draggable instanceof Array&&(e=this.closest(e,this.draggable.join(","))),!e)return i;if(this.prevTarget&&this.prevTarget!=e&&(this.prevTarget=null),!this.prevTarget){this.targetP=this.closest(e,this.containerSel);var o=this.validTarget(e);if(r&&r.trigger("sorter:drag:validation",o),!o.valid&&this.targetP)return this.dimsFromTarget(this.targetP,t,n);this.prevTarget=e,this.prevTargetDim=this.getDim(e),this.cacheDimsP=this.getChildrenDim(this.targetP),this.cacheDims=this.getChildrenDim(e)}if(this.prevTarget==e&&(i=this.cacheDims),this.target=this.prevTarget,this.nearBorders(this.prevTargetDim,t,n)||!this.nested&&!this.cacheDims.length){var s=this.targetP;s&&this.validTarget(s).valid&&(i=this.cacheDimsP,this.target=s)}return this.lastPos=null,i},getTargetFromEl:function(e){var t,n=e,r=this.targetPrev,i=this.em,o=this.containerSel,s=this.itemSel;if(this.matches(n,"".concat(s,", ").concat(o))||(n=this.closest(n,s)),this.draggable instanceof Array&&(n=this.closest(n,this.draggable.join(","))),r&&r!=n&&(this.targetPrev=""),!this.targetPrev){t=this.closest(n,o);var a=this.validTarget(n);if(i&&i.trigger("sorter:drag:validation",a),!a.valid&&t)return this.getTargetFromEl(t);this.targetPrev=n}return this.nearElBorders(n)&&(t=this.closest(n,o),t&&this.validTarget(t).valid&&(n=t)),n},nearElBorders:function(e){var t=10,n=e.getBoundingClientRect(),r=e.ownerDocument.body,i=this.getCurrentPos(),o=i.x,s=i.y,a=n.top+r.scrollTop,l=n.left+r.scrollLeft,c=n.width,u=n.height;if(s<a+t||s>a+u-t||o<l+t||o>l+c-t)return 1},getCurrentPos:function(){var e=this.eventMove,t=e.pageX||0,n=e.pageY||0;return{x:t,y:n}},getDim:function(e){var t,n,r,i,o=this.em,s=this.canvasRelative;if(s&&o){var a=o.get("Canvas"),l=a.getElementPos(e,{noScroll:1}),c=a.getElementOffsets(e);t=l.top-c.marginTop,n=l.left-c.marginLeft,r=l.height+c.marginTop+c.marginBottom,i=l.width+c.marginLeft+c.marginRight}else{var u=this.offset(e);t=this.relative?e.offsetTop:u.top-(this.wmargin?-1:1)*this.elT,n=this.relative?e.offsetLeft:u.left-(this.wmargin?-1:1)*this.elL,r=e.offsetHeight,i=e.offsetWidth}return[t,n,r,i]},getChildrenDim:function(e){var t=this,n=[];if(!e)return n;var r=this.getTargetModel(e);if(r&&r.view&&!this.ignoreViewChildren){var i=r.getCurrentView?r.getCurrentView():r.view;e=i.getChildrenContainer()}return Object(c.each)(e.children,function(r,i){var o=Object(u.getModel)(r,d),s=o&&o.index?o.index():i;if(Object(u.isTextNode)(r)||t.matches(r,t.itemSel)){var a=t.getDim(r),l=t.direction;l="v"==l||"h"!=l&&t.isInFlow(r,e),a.push(l,r,s),n.push(a)}}),n},nearBorders:function(e,t,n){var r=0,i=this.borderOffset,o=t||0,s=n||0,a=e[0],l=e[1],c=e[2],u=e[3];return(a+i>s||s>a+c-i||l+i>o||o>l+u-i)&&(r=1),!!r},findPosition:function(e,t,n){for(var r={index:0,indexEl:0,method:"before"},i=0,o=0,s=0,a=0,l=0,c=0,u=0,d=0,h=0,f=e.length;h<f;h++)if(d=e[h],s=d[1]+d[3],u=d[0]+d[2],l=d[1]+d[3]/2,c=d[0]+d[2]/2,!(o&&d[1]>o||a&&c>=a||i&&s<i))if(r.index=h,r.indexEl=d[6],d[4]){if(n<c){r.method="before";break}r.method="after"}else n<u&&(a=u),t<l?(o=l,r.method="before"):(i=l,r.method="after");return r},movePlaceholder:function(e,t,n,r){var i=0,o=0,s=0,a=0,l=0,c="px",u=5,d="#62c462",h=3,f=n.method,p=t[n.index];if(e.style.borderColor="transparent "+d,e.style.borderWidth=h+c+" "+(h+2)+c,e.style.margin="-"+h+"px 0 0",p)p[4]?(a=p[3]+c,l="auto",o="before"==f?p[0]-i:p[0]+p[2]-i,s=p[1]):(a="auto",l=p[2]-2*i+c,o=p[0]+i,s="before"==f?p[1]-i:p[1]+p[3]-i,e.style.borderColor=d+" transparent",e.style.borderWidth=h+2+c+" "+h+c,e.style.margin="0 0 0 -"+h+"px");else{if(!this.nested)return void(e.style.display="none");r&&(o=r[0]+u,s=r[1]+u,a=parseInt(r[3])-2*u+c,l="auto")}e.style.top=o+c,e.style.left=s+c,a&&(e.style.width=a),l&&(e.style.height=l)},endMove:function(e){var t,n=this,r=this.eV,o=[],s=this.getDocuments(),a=this.getContainerEl(),l=this.onEndMove,d=this.target,h=this.lastPos;if(Object(u.off)(a,"mousemove dragover",this.onMove),Object(u.off)(s,"mouseup dragend touchend",this.endMove),Object(u.off)(s,"keydown",this.rollback),this.plh.style.display="none",r&&(t=this.getSourceModel(),this.selectOnEnd&&t&&t.set&&(t.set("status",""),t.set("status","selected"))),this.moved){var f=this.toMove,p=Object(c.isArray)(f)?f:f?[f]:[r];p.forEach(function(e){o.push(n.move(d,e,h))})}this.plh&&(this.plh.style.display="none");var g=this.dragHelper;if(g&&(g.parentNode.removeChild(g),this.dragHelper=null),this.disableTextable(),this.selectTargetModel(),this.toggleSortCursor(),this.toMove=null,Object(c.isFunction)(l)){var m={target:t,parent:t&&t.parent(),index:t&&t.index()};o.length?o.forEach(function(e){return l(e,n,m)}):l(null,this,i({},m,{cancelled:1}))}},move:function(e,t,n){var r=this.em,o=this.activeTextModel,s=this.dropContent,a=Object(u.getElement)(t);r&&r.trigger("component:dragEnd:before",e,a,n);var c,h,f,p=[],g=n.indexEl,m=this.validTarget(e,a),v=d(e).data("collection"),b=m.srcModel,y=m.droppable,w=m.draggable,x=m.dropInfo,C=m.dragInfo,j=m.trgModel;y=j instanceof l.a.Collection?1:y;var O=this.isTextableActive(b,j);if(v&&y&&w){g="after"===n.method?g+1:g;var k={at:g,noIncrement:1};if(s?(c=s,k.silent=!1,k.avoidUpdateStyle=1):(k.temporary=1,h=v.add({},i({},k)),b.collection&&(c=b.collection.remove(b,{temporary:1}))),O){var S=o.getView();o.trigger("active");var T=S.activeRte,P=b.getEl();delete b.opt.temporary,b.getView().render(),P.setAttribute("data-gjs-textable","true");var E=P.outerHTML;T.insertHTML&&T.insertHTML(E)}else f=v.add(c,k);s?this.dropContent=null:v.remove(h),this.prevTarget=null}else v||p.push("Target collection not found"),y||p.push("Target is not droppable, accepts [".concat(x,"]")),w||p.push("Component not draggable, acceptable by [".concat(C,"]")),console.warn("Invalid target position: "+p.join(", "));return r&&r.trigger("component:dragEnd",v,c,p),r&&r.trigger("sorter:drag:end",{targetCollection:v,modelToDrop:c,warns:p,validResult:m,dst:e,srcEl:a}),f},rollback:function(e){Object(u.off)(this.getDocuments(),"keydown",this.rollback);var t=e.which||e.keyCode;27==t&&(this.moved=0,this.endMove())}})},"./src/utils/dom.js":function(e,t,n){"use strict";n.r(t),n.d(t,"motionsEv",function(){return s}),n.d(t,"empty",function(){return a}),n.d(t,"replaceWith",function(){return l}),n.d(t,"appendAtIndex",function(){return c}),n.d(t,"append",function(){return u}),n.d(t,"createEl",function(){return d}),n.d(t,"createCustomEvent",function(){return h}),n.d(t,"appendVNodes",function(){return f});var r=n("./node_modules/underscore/underscore.js"),i=(n.n(r),"tag"),o="attributes",s="transitionend oTransitionEnd transitionend webkitTransitionEnd",a=function(e){for(;e.firstChild;)e.removeChild(e.firstChild)},l=function(e,t){e.parentNode.replaceChild(t,e)},c=function(e,t,n){var i=e.childNodes,o=i.length,s=Object(r.isUndefined)(n)?o:n;Object(r.isString)(t)&&(e.insertAdjacentHTML("beforeEnd",t),t=e.lastChild,e.removeChild(t)),s>=o?e.appendChild(t):e.insertBefore(t,i[s])},u=function(e,t){return c(e,t)},d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,i=document.createElement(e);return t&&Object(r.each)(t,function(e,t){return i.setAttribute(t,e)}),n&&(Object(r.isString)(n)?i.innerHTML=n:i.appendChild(n)),i},h=function(e,t){var n;try{n=new window[t](e.type,e)}catch(e){n=document.createEvent(t),n.initEvent(e.type,!0,!0)}return n.keyCodeVal=e.keyCode,n._parentEvent=e,["keyCode","which"].forEach(function(e){Object.defineProperty(n,e,{get:function(){return this.keyCodeVal}})}),n},f=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=Array.isArray(t)?t:[t];n.forEach(function(t){var n=t[i]||"div",s=t[o]||{},a=document.createElement(n);Object(r.each)(s,function(e,t){a.setAttribute(t,e)}),e.appendChild(a)})}},"./src/utils/extender.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/underscore/underscore.js");n.n(r);t["default"]=function(e){var t=e.$;if(t&&"jQuery"!==t.prototype.constructor.name){var n=t.fn;n.hide=function(){return this.css("display","none")},n.show=function(){return this.css("display","block")},n.focus=function(){var e=this.get(0);return e&&e.focus(),this},n.bind=function(e,t){return this.on(e,t)},n.unbind=function(e,t){if(Object(r.isObject)(e)){for(var n in e)e.hasOwnProperty(n)&&this.off(n,e[n]);return this}return this.off(e,t)},n.click=function(e){return e?this.on("click",e):this.trigger("click")},n.change=function(e){return e?this.on("change",e):this.trigger("change")},n.keydown=function(e){return e?this.on("keydown",e):this.trigger("keydown")},n.delegate=function(e,t,n,r){return r||(r=n),this.on(t,e,function(e){e.data=n,r(e)})},n.scrollLeft=function(){var e=this.get(0);e=9==e.nodeType?e.defaultView:e;var t=e instanceof Window?e:null;return t?t.pageXOffset:e.scrollLeft||0},n.scrollTop=function(){var e=this.get(0);e=9==e.nodeType?e.defaultView:e;var t=e instanceof Window?e:null;return t?t.pageYOffset:e.scrollTop||0};var i=t.prototype.offset;n.offset=function(e){var t,n;return e&&(t=e.top,n=e.left),"undefined"!=typeof t&&this.css("top","".concat(t,"px")),"undefined"!=typeof n&&this.css("left","".concat(n,"px")),i.call(this)},t.map=function(e,t){for(var n=[],r=0;r<e.length;r++)n.push(t(e[r],r));return n};var o=Array.prototype.indexOf;t.inArray=function(e,t,n){return null==t?-1:o.call(t,e,n)},t.Event=function(e,n){return this instanceof t.Event?(this.type=e,void(this.isDefaultPrevented=function(){return!1})):new t.Event(e,n)}}}},"./src/utils/fetch.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/promise-polyfill/src/index.js");window.Promise=window.Promise||r["default"],t["default"]="function"==typeof fetch?fetch.bind():function(e,t){return new r["default"](function(n,i){var o=new XMLHttpRequest;o.open(t.method||"get",e),o.withCredentials="include"==t.credentials;for(var s in t.headers||{})o.setRequestHeader(s,t.headers[s]);o.onload=function(e){return n({status:o.status,statusText:o.statusText,text:function(){return r["default"].resolve(o.responseText)}})},o.onerror=i,o.upload&&t.onProgress&&(o.upload.onprogress=t.onProgress),t.body?o.send(t.body):o.send()})}},"./src/utils/index.js":function(e,t,n){"use strict";n.r(t);var r=n("./src/utils/Dragger.js"),i=n("./src/utils/Sorter.js"),o=n("./src/utils/Resizer.js");t["default"]=function(){return{name:"Utils",init:function(){return this},Sorter:i["default"],Resizer:o["default"],Dragger:r["default"]}}},"./src/utils/mixins.js":function(e,t,n){"use strict";n.r(t),n.d(t,"isCommentNode",function(){return y}),n.d(t,"isTaggableNode",function(){return w}),n.d(t,"on",function(){return u}),n.d(t,"off",function(){return d}),n.d(t,"hasDnd",function(){return m}),n.d(t,"upFirst",function(){return f}),n.d(t,"matches",function(){return a}),n.d(t,"getModel",function(){return x}),n.d(t,"getElRect",function(){return C}),n.d(t,"camelCase",function(){return p}),n.d(t,"isTextNode",function(){return b}),n.d(t,"getKeyCode",function(){return O}),n.d(t,"getKeyChar",function(){return k}),n.d(t,"isEscKey",function(){return S}),n.d(t,"getElement",function(){return v}),n.d(t,"shallowDiff",function(){return c}),n.d(t,"normalizeFloat",function(){return g}),n.d(t,"getPointerEvent",function(){return j}),n.d(t,"getUnitFromValue",function(){return h}),n.d(t,"capitalize",function(){return T}),n.d(t,"getViewEl",function(){return _}),n.d(t,"setViewEl",function(){return D}),n.d(t,"appendStyles",function(){return l}),n.d(t,"isComponent",function(){return P}),n.d(t,"isRule",function(){return E});var r=n("./node_modules/@babel/runtime/helpers/toConsumableArray.js"),i=n.n(r),o=n("./node_modules/underscore/underscore.js"),s=(n.n(o),window.Element.prototype),a=s.matches||s.webkitMatchesSelector||s.mozMatchesSelector||s.msMatchesSelector,l=function M(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Object(o.isArray)(e)?i()(e):[e];if(n.length){var r=n.shift();if(r&&(!t.unique||!document.querySelector('link[href="'.concat(r,'"]')))){var s=document,a=s.head,l=document.createElement("link");l.href=r,l.rel="stylesheet",t.prepand?a.insertBefore(l,a.firstChild):a.appendChild(l)}M(n)}},c=function(e,t){var n={},r=Object(o.keys)(t);for(var i in e)if(e.hasOwnProperty(i)){var s=e[i],a=t[i];r.indexOf(i)>=0?s!==a&&(n[i]=a):n[i]=null}for(var l in t)t.hasOwnProperty(l)&&Object(o.isUndefined)(e[l])&&(n[l]=t[l]);return n},u=function(e,t,n){t=t.split(/\s+/),e=e instanceof Array?e:[e];for(var r=function(r){e.forEach(function(e){return e.addEventListener(t[r],n)})},i=0;i<t.length;++i)r(i)},d=function(e,t,n){t=t.split(/\s+/),e=e instanceof Array?e:[e];for(var r=function(r){e.forEach(function(e){return e.removeEventListener(t[r],n)})},i=0;i<t.length;++i)r(i)},h=function(e){return e.replace(parseFloat(e),"")},f=function(e){return e[0].toUpperCase()+e.toLowerCase().slice(1)},p=function(e){var t=e.split("-").filter(String);return t[0].toLowerCase()+t.slice(1).map(f)},g=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=0;if(isNaN(e))return n;if(e=parseFloat(e),Math.floor(e)!==e){var i=t.toString().split(".")[1];r=i?i.length:0}return r?parseFloat(e.toFixed(r)):e},m=function(e){return"draggable"in document.createElement("i")&&(e?e.get("Config").nativeDnD:1)},v=function(e){return Object(o.isElement)(e)||b(e)?e:e&&e.getEl?e.getEl():void 0},b=function(e){return e&&3===e.nodeType},y=function(e){return e&&8===e.nodeType},w=function(e){return e&&!b(e)&&!y(e)},x=function(e,t){var n=e;return Object(o.isElement)(e)&&(n=t(e).data("model")),n},C=function(e){var t={top:0,left:0,width:0,height:0};if(!e)return t;var n;if(b(e)){var r=document.createRange();r.selectNode(e),n=r.getBoundingClientRect(),r.detach()}return n||(e.getBoundingClientRect?e.getBoundingClientRect():t)},j=function(e){return e.touches&&e.touches[0]?e.touches[0]:e},O=function(e){return e.which||e.keyCode},k=function(e){return String.fromCharCode(O(e))},S=function(e){return 27===O(e)},T=function(e){return e&&e.charAt(0).toUpperCase()+e.substring(1)},P=function(e){return e&&e.toHTML},E=function(e){return e&&e.toCSS},_=function(e){return e.__gjsv},D=function(e,t){e.__gjsv=t}},"./src/utils/polyfills.js":function(e,t,n){"use strict";n.r(t),t["default"]=function(){var e=function(){for(var e,t=window.navigator.userAgent,n=[["edge",/Edge\/([0-9\._]+)/],["ie",/MSIE\s(7\.0)/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/]],r=0;r<n.length;r++){var i=n[r];if(e=i[1].exec(t))break}return!!e};if(e()){var t=DOMImplementation.prototype.createHTMLDocument;DOMImplementation.prototype.createHTMLDocument=function(e){return e||(e=""),t.apply(document.implementation,[e])}}}}})["default"]});
|
||
//# sourceMappingURL=grapesjs.min.js.map
|