1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 20:22:42 +01:00
invoiceninja/public/js/grapesjs.min.js

21 lines
595 KiB
JavaScript
Raw Normal View History

2020-03-29 08:39:57 +02:00
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.grapesjs=e():t.grapesjs=e()}(this,function(){return function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var n=t&&t.__esModule?function(){return t["default"]}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=59)}([function(t,e,n){(function(i){var r,o;!function(s){var a="object"==typeof self&&self.self===self&&self||"object"==typeof i&&i.global===i&&i;r=[n(1),n(9),e],o=function(t,e,n){a.Backbone=s(a,n,t,e)}.apply(e,r),!(void 0!==o&&(t.exports=o))}(function(t,e,n,i){var r=t.Backbone,o=Array.prototype.slice;e.VERSION="1.3.3",e.$=i,e.noConflict=function(){return t.Backbone=r,this},e.emulateHTTP=!1,e.emulateJSON=!1;var s=function(t,e,i){switch(t){case 1:return function(){return n[e](this[i])};case 2:return function(t){return n[e](this[i],t)};case 3:return function(t,r){return n[e](this[i],l(t,this),r)};case 4:return function(t,r,o){return n[e](this[i],l(t,this),r,o)};default:return function(){var t=o.call(arguments);return t.unshift(this[i]),n[e].apply(n,t)}}},a=function(t,e,i){n.each(e,function(e,r){n[r]&&(t.prototype[r]=s(e,r,i))})},l=function(t,e){return n.isFunction(t)?t:n.isObject(t)&&!e._isModel(t)?c(t):n.isString(t)?function(e){return e.get(t)}:t},c=function(t){var e=n.matches(t);return function(t){return e(t.attributes)}},u=e.Events={},h=/\s+/,d=function(t,e,i,r,o){var s,a=0;if(i&&"object"==typeof i){void 0!==r&&"context"in o&&void 0===o.context&&(o.context=r);for(s=n.keys(i);a<s.length;a++)e=d(t,e,s[a],i[s[a]],o)}else if(i&&h.test(i))for(s=i.split(h);a<s.length;a++)e=t(e,s[a],r,o);else e=t(e,i,r,o);return e};u.on=function(t,e,n){return f(this,t,e,n)};var f=function(t,e,n,i,r){if(t._events=d(p,t._events||{},e,n,{context:i,ctx:t,listening:r}),r){var o=t._listeners||(t._listeners={});o[r.id]=r}return t};u.listenTo=function(t,e,i){if(!t)return this;var r=t._listenId||(t._listenId=n.uniqueId("l")),o=this._listeningTo||(this._listeningTo={}),s=o[r];if(!s){var a=this._listenId||(this._listenId=n.uniqueId("l"));s=o[r]={obj:t,objId:r,id:a,listeningTo:o,count:0}}return f(t,e,i,this,s),this};var p=function(t,e,n,i){if(n){var r=t[e]||(t[e]=[]),o=i.context,s=i.ctx,a=i.listening;a&&a.count++,r.push({callback:n,context:o,ctx:o||s,listening:a})}return t};u.off=function(t,e,n){return this._events?(this._events=d(g,this._events,t,e,{context:n,listeners:this._listeners}),this):this},u.stopListening=function(t,e,i){var r=this._listeningTo;if(!r)return this;for(var o=t?[t._listenId]:n.keys(r),s=0;s<o.length;s++){var a=r[o[s]];if(!a)break;a.obj.off(e,i,this)}return this};var g=function(t,e,i,r){if(t){var o,s=0,a=r.context,l=r.listeners;if(e||i||a){for(var c=e?[e]:n.keys(t);s<c.length;s++){e=c[s];var u=t[e];if(!u)break;for(var h=[],d=0;d<u.length;d++){var f=u[d];i&&i!==f.callback&&i!==f.callback._callback||a&&a!==f.context?h.push(f):(o=f.listening,o&&0===--o.count&&(delete l[o.id],delete o.listeningTo[o.objId]))}h.length?t[e]=h:delete t[e]}return t}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(t,e,i){var r=d(v,{},t,e,n.bind(this.off,this));return"string"==typeof t&&null==i&&(e=void 0),this.on(r,e,i)},u.listenToOnce=function(t,e,i){var r=d(v,{},e,i,n.bind(this.stopListening,this,t));return this.listenTo(t,r)};var v=function(t,e,i,r){if(i){var o=t[e]=n.once(function(){r(e,o),i.apply(this,arguments)});o._callback=i}return t};u.trigger=function(t){if(!this._events)return this;for(var e=Math.max(0,arguments.length-1),n=Array(e),i=0;i<e;i++)n[i]=arguments[i+1];return d(m,this._events,t,void 0,n),this};var m=function(t,e,n,i){if(t){var r=t[e],o=t.all;r&&o&&(o=o.slice()),r&&y(r,i),o&&y(o,[e].concat(i))}return t},y=fun
return function(){for(var n=e,i=t[e].apply(this,arguments);n--;)i=t[n].call(this,i);return i}},C.after=function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},C.before=function(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}},C.once=C.partial(C.before,2);var I=!{toString:null}.propertyIsEnumerable("toString"),_=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];C.keys=function(t){if(!C.isObject(t))return[];if(y)return y(t);var e=[];for(var n in t)C.has(t,n)&&e.push(n);return I&&a(t,e),e},C.allKeys=function(t){if(!C.isObject(t))return[];var e=[];for(var n in t)e.push(n);return I&&a(t,e),e},C.values=function(t){for(var e=C.keys(t),n=e.length,i=Array(n),r=0;r<n;r++)i[r]=t[e[r]];return i},C.mapObject=function(t,e,n){e=S(e,n);for(var i,r=C.keys(t),o=r.length,s={},a=0;a<o;a++)i=r[a],s[i]=e(t[i],i,t);return s},C.pairs=function(t){for(var e=C.keys(t),n=e.length,i=Array(n),r=0;r<n;r++)i[r]=[e[r],t[e[r]]];return i},C.invert=function(t){for(var e={},n=C.keys(t),i=0,r=n.length;i<r;i++)e[t[n[i]]]=n[i];return e},C.functions=C.methods=function(t){var e=[];for(var n in t)C.isFunction(t[n])&&e.push(n);return e.sort()},C.extend=T(C.allKeys),C.extendOwn=C.assign=T(C.keys),C.findKey=function(t,e,n){e=S(e,n);for(var i,r=C.keys(t),o=0,s=r.length;o<s;o++)if(i=r[o],e(t[i],i,t))return i},C.pick=function(t,e,n){var i,r,o={},s=t;if(null==s)return o;C.isFunction(e)?(r=C.allKeys(s),i=k(e,n)):(r=N(arguments,!1,!1,1),i=function(t,e,n){return e in n},s=Object(s));for(var a=0,l=r.length;a<l;a++){var c=r[a],u=s[c];i(u,c,s)&&(o[c]=u)}return o},C.omit=function(t,e,n){if(C.isFunction(e))e=C.negate(e);else{var i=C.map(N(arguments,!1,!1,1),String);e=function(t,e){return!C.contains(i,e)}}return C.pick(t,e,n)},C.defaults=T(C.allKeys,!0),C.create=function(t,e){var n=E(t);return e&&C.extendOwn(n,e),n},C.clone=function(t){return C.isObject(t)?C.isArray(t)?t.slice():C.extend({},t):t},C.tap=function(t,e){return e(t),t},C.isMatch=function(t,e){var n=C.keys(e),i=n.length;if(null==t)return!i;for(var r=Object(t),o=0;o<i;o++){var s=n[o];if(e[s]!==r[s]||!(s in r))return!1}return!0};var F=function(t,e,n,i){if(t===e)return 0!==t||1/t===1/e;if(null==t||null==e)return t===e;t instanceof C&&(t=t._wrapped),e instanceof C&&(e=e._wrapped);var r=g.call(t);if(r!==g.call(e))return!1;switch(r){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!==+t?+e!==+e:0===+t?1/+t===1/e:+t===+e;case"[object Date]":case"[object Boolean]":return+t===+e}var o="[object Array]"===r;if(!o){if("object"!=typeof t||"object"!=typeof e)return!1;var s=t.constructor,a=e.constructor;if(s!==a&&!(C.isFunction(s)&&s instanceof s&&C.isFunction(a)&&a instanceof a)&&"constructor"in t&&"constructor"in e)return!1}n=n||[],i=i||[];for(var l=n.length;l--;)if(n[l]===t)return i[l]===e;if(n.push(t),i.push(e),o){if(l=t.length,l!==e.length)return!1;for(;l--;)if(!F(t[l],e[l],n,i))return!1}else{var c,u=C.keys(t);if(l=u.length,C.keys(e).length!==l)return!1;for(;l--;)if(c=u[l],!C.has(e,c)||!F(t[c],e[c],n,i))return!1}return n.pop(),i.pop(),!0};C.isEqual=function(t,e){return F(t,e)},C.isEmpty=function(t){return null==t||(O(t)&&(C.isArray(t)||C.isString(t)||C.isArguments(t))?0===t.length:0===C.keys(t).length)},C.isElement=function(t){return!(!t||1!==t.nodeType)},C.isArray=m||function(t){return"[object Array]"===g.call(t)},C.isObject=function(t){var e=typeof t;return"function"===e||"object"===e&&!!t},C.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(t){C["is"+t]=function(e){return g.call(e)==="[object "+t+"]"}}),C.isArguments(arguments)||(C.isArguments=function(t){return C.has(t,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(C.isFunction=function(t){return"function"==typeof t||!1}),C.isFinite=function(t){return isFinite(t)&&!isNaN(parseFloat(t))},C.isNaN=function(t){return C.isNumber(t)&&t!==+t},C.isBoolean=function(t){return t===!0||t===!1||"[object Boolean]"===g.call(t)},C.isNull=function(t){return null===t},C.isUndefined=function(t){return
var n=e-t.height;if(n)for(var i=t;i;i=i.parent)i.height+=n}function L(t){if(null==t.parent)return null;for(var e=t.parent,n=d(e.lines,t),i=e.parent;i;e=i,i=i.parent)for(var r=0;i.children[r]!=e;++r)n+=i.children[r].chunkSize();return n+e.first}function N(t,e){var n=t.first;t:do{for(var i=0;i<t.children.length;++i){var r=t.children[i],o=r.height;if(e<o){t=r;continue t}e-=o,n+=r.chunkSize()}return n}while(!t.lines);for(var s=0;s<t.lines.length;++s){var a=t.lines[s],l=a.height;if(e<l)break;e-=l}return n+s}function D(t,e){return e>=t.first&&e<t.first+t.size}function I(t,e){return String(t.lineNumberFormatter(e+t.firstLineNumber))}function _(t,e,n){return void 0===n&&(n=null),this instanceof _?(this.line=t,this.ch=e,void(this.sticky=n)):new _(t,e,n)}function F(t,e){return t.line-e.line||t.ch-e.ch}function R(t,e){return t.sticky==e.sticky&&0==F(t,e)}function z(t){return _(t.line,t.ch)}function $(t,e){return F(t,e)<0?e:t}function V(t,e){return F(t,e)<0?t:e}function H(t,e){return Math.max(t.first,Math.min(e,t.first+t.size-1))}function j(t,e){if(e.line<t.first)return _(t.first,0);var n=t.first+t.size-1;return e.line>n?_(n,M(t,n).text.length):B(e,M(t,e.line).text.length)}function B(t,e){var n=t.ch;return null==n||n>e?_(t.line,e):n<0?_(t.line,0):t}function W(t,e){for(var n=[],i=0;i<e.length;i++)n[i]=j(t,e[i]);return n}function U(){Js=!0}function q(){Zs=!0}function K(t,e,n){this.marker=t,this.from=e,this.to=n}function G(t,e){if(t)for(var n=0;n<t.length;++n){var i=t[n];if(i.marker==e)return i}}function Y(t,e){for(var n,i=0;i<t.length;++i)t[i]!=e&&(n||(n=[])).push(t[i]);return n}function X(t,e){t.markedSpans=t.markedSpans?t.markedSpans.concat([e]):[e],e.marker.attachLine(t)}function J(t,e,n){var i;if(t)for(var r=0;r<t.length;++r){var o=t[r],s=o.marker,a=null==o.from||(s.inclusiveLeft?o.from<=e:o.from<e);if(a||o.from==e&&"bookmark"==s.type&&(!n||!o.marker.insertLeft)){var l=null==o.to||(s.inclusiveRight?o.to>=e:o.to>e);(i||(i=[])).push(new K(s,o.from,l?null:o.to))}}return i}function Z(t,e,n){var i;if(t)for(var r=0;r<t.length;++r){var o=t[r],s=o.marker,a=null==o.to||(s.inclusiveRight?o.to>=e:o.to>e);if(a||o.from==e&&"bookmark"==s.type&&(!n||o.marker.insertLeft)){var l=null==o.from||(s.inclusiveLeft?o.from<=e:o.from<e);(i||(i=[])).push(new K(s,l?null:o.from-e,null==o.to?null:o.to-e))}}return i}function Q(t,e){if(e.full)return null;var n=D(t,e.from.line)&&M(t,e.from.line).markedSpans,i=D(t,e.to.line)&&M(t,e.to.line).markedSpans;if(!n&&!i)return null;var r=e.from.ch,o=e.to.ch,s=0==F(e.from,e.to),a=J(n,r,s),l=Z(i,o,s),c=1==e.text.length,u=g(e.text).length+(c?r:0);if(a)for(var h=0;h<a.length;++h){var d=a[h];if(null==d.to){var f=G(l,d.marker);f?c&&(d.to=null==f.to?null:f.to+u):d.to=r}}if(l)for(var p=0;p<l.length;++p){var v=l[p];if(null!=v.to&&(v.to+=u),null==v.from){var m=G(a,v.marker);m||(v.from=u,c&&(a||(a=[])).push(v))}else v.from+=u,c&&(a||(a=[])).push(v)}a&&(a=tt(a)),l&&l!=a&&(l=tt(l));var y=[a];if(!c){var b,x=e.text.length-2;if(x>0&&a)for(var w=0;w<a.length;++w)null==a[w].to&&(b||(b=[])).push(new K(a[w].marker,null,null));for(var C=0;C<x;++C)y.push(b);y.push(l)}return y}function tt(t){for(var e=0;e<t.length;++e){var n=t[e];null!=n.from&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&t.splice(e--,1)}return t.length?t:null}function et(t,e,n){var i=null;if(t.iter(e.line,n.line+1,function(t){if(t.markedSpans)for(var e=0;e<t.markedSpans.length;++e){var n=t.markedSpans[e].marker;!n.readOnly||i&&d(i,n)!=-1||(i||(i=[])).push(n)}}),!i)return null;for(var r=[{from:e,to:n}],o=0;o<i.length;++o)for(var s=i[o],a=s.find(0),l=0;l<r.length;++l){var c=r[l];if(!(F(c.to,a.from)<0||F(c.from,a.to)>0)){var u=[l,1],h=F(c.from,a.from),f=F(c.to,a.to);(h<0||!s.inclusiveLeft&&!h)&&u.push({from:c.from,to:a.from}),(f>0||!s.inclusiveRight&&!f)&&u.push({from:a.to,to:c.to}),r.splice.apply(r,u),l+=u.length-3}}return r}function nt(t){var e=t.markedSpans;if(e){for(var n=0;n<e.length;++n)e[n].marker.detachLine(t);t.markedSpans=null}}function it(t,e){if(e){for(var n=0;n<e.length;++n)e[n].marker.attachLine(t);t.markedSpans=e}}function rt(t){return t.inclusiveLeft?-1:0}function
var l=r[a],c=1!=l.level;return gn(cn(t,_(n,c?l.to:l.from,c?"before":"after"),"line",e,i),o,s,!0)},0,r.length-1),l=r[a];if(a>0){var c=1!=l.level,u=cn(t,_(n,c?l.from:l.to,c?"after":"before"),"line",e,i);gn(u,o,s,!0)&&u.top>s&&(l=r[a-1])}return l}function yn(t,e,n,i,r,o,s){var a=fn(t,e,i,s),l=a.begin,c=a.end;/\s/.test(e.text.charAt(c-1))&&c--;for(var u=null,h=null,d=0;d<r.length;d++){var f=r[d];if(!(f.from>=c||f.to<=l)){var p=1!=f.level,g=Ge(t,i,p?Math.min(c,f.to)-1:Math.max(l,f.from)).right,v=g<o?o-g+1e9:g-o;(!u||h>v)&&(u=f,h=v)}}return u||(u=r[r.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 bn(t){if(null!=t.cachedTextHeight)return t.cachedTextHeight;if(null==va){va=i("pre");for(var r=0;r<49;++r)va.appendChild(document.createTextNode("x")),va.appendChild(i("br"));va.appendChild(document.createTextNode("x"))}n(t.measure,va);var o=va.offsetHeight/50;return o>3&&(t.cachedTextHeight=o),e(t.measure),o||1}function xn(t){if(null!=t.cachedCharWidth)return t.cachedCharWidth;var e=i("span","xxxxxxxxxx"),r=i("pre",[e]);n(t.measure,r);var o=e.getBoundingClientRect(),s=(o.right-o.left)/10;return s>2&&(t.cachedCharWidth=s),s||10}function wn(t){for(var e=t.display,n={},i={},r=e.gutters.clientLeft,o=e.gutters.firstChild,s=0;o;o=o.nextSibling,++s)n[t.options.gutters[s]]=o.offsetLeft+o.clientLeft+r,i[t.options.gutters[s]]=o.clientWidth;return{fixedPos:Cn(e),gutterTotalWidth:e.gutters.offsetWidth,gutterLeft:n,gutterWidth:i,wrapperWidth:e.wrapper.clientWidth}}function Cn(t){return t.scroller.getBoundingClientRect().left-t.sizer.getBoundingClientRect().left}function kn(t){var e=bn(t.display),n=t.options.lineWrapping,i=n&&Math.max(5,t.display.scroller.clientWidth/xn(t.display)-3);return function(r){if(vt(t.doc,r))return 0;var o=0;if(r.widgets)for(var s=0;s<r.widgets.length;s++)r.widgets[s].height&&(o+=r.widgets[s].height);return n?o+(Math.ceil(r.text.length/i)||1)*e:o+e}}function Sn(t){var e=t.doc,n=kn(t);e.iter(function(t){var e=n(t);e!=t.height&&O(t,e)})}function Tn(t,e,n,i){var r=t.display;if(!n&&"true"==_t(e).getAttribute("cm-not-content"))return null;var o,s,a=r.lineSpace.getBoundingClientRect();try{o=e.clientX-a.left,s=e.clientY-a.top}catch(e){return null}var l,c=dn(t,o,s);if(i&&1==c.xRel&&(l=M(t.doc,c.line).text).length==c.ch){var u=h(l,l.length,t.options.tabSize)-l.length;c=_(c.line,Math.max(0,Math.round((o-ze(t.display).left)/xn(t.display))-u))}return c}function En(t,e){if(e>=t.display.viewTo)return null;if(e-=t.display.viewFrom,e<0)return null;for(var n=t.display.view,i=0;i<n.length;i++)if(e-=n[i].size,e<0)return i}function Mn(t){t.display.input.showSelection(t.display.input.prepareSelection())}function Pn(t,e){void 0===e&&(e=!0);for(var n=t.doc,i={},r=i.cursors=document.createDocumentFragment(),o=i.selection=document.createDocumentFragment(),s=0;s<n.sel.ranges.length;s++)if(e||s!=n.sel.primIndex){var a=n.sel.ranges[s];if(!(a.from().line>=t.display.viewTo||a.to().line<t.display.viewFrom)){var l=a.empty();(l||t.options.showCursorWhenSelecting)&&An(t,a.head,r),l||Ln(t,a,o)}}return i}function An(t,e,n){var r=cn(t,e,"div",null,null,!t.options.singleCursorHeightPerLine),o=n.appendChild(i("div"," ","CodeMirror-cursor"));if(o.style.left=r.left+"px",o.style.top=r.top+"px",o.style.height=Math.max(0,r.bottom-r.top)*t.options.cursorHeight+"px",r.other){var s=n.appendChild(i("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));s.style.display="",s.style.left=r.other.left+"px",s.style.top=r.other.top+"px",s.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function On(t,e){return t.top-e.top||t.left-e.left}function Ln(t,e,n){function r(t,e,n,r){e<0&&(e=0),e=Math.round(e),r=Math.round(r),l.appendChild(i("div",null,"CodeMirror-selected","position: absolute; left: "+t+"px;\n top: "+e+"px; width: "+(null==n?h-t:n)+"px;\n height: "+(r-e)+"px"))}function o(e,n,i){function o(n,i){return ln(t,_(e,n),"div",f,i)}function s(e,n,i){var r=pn(t,f,null,e),s="ltr"==n==("after"==i)?"left":"right",a="after"==i?r.begin:r.end-(/\s/.test
xr(t,Vi(e,n),i)}function yr(t,e,n){var i={ranges:e.ranges,update:function(e){var n=this;this.ranges=[];for(var i=0;i<e.length;i++)n.ranges[i]=new Oa(j(t,e[i].anchor),j(t,e[i].head))},origin:n&&n.origin};return Et(t,"beforeSelectionChange",t,i),t.cm&&Et(t.cm,"beforeSelectionChange",t.cm,i),i.ranges!=e.ranges?$i(i.ranges,i.ranges.length-1):e}function br(t,e,n){var i=t.history.done,r=g(i);r&&r.ranges?(i[i.length-1]=e,wr(t,e,n)):xr(t,e,n)}function xr(t,e,n){wr(t,e,n),sr(t,t.sel,t.cm?t.cm.curOp.id:NaN,n)}function wr(t,e,n){(At(t,"beforeSelectionChange")||t.cm&&At(t.cm,"beforeSelectionChange"))&&(e=yr(t,e,n));var i=n&&n.bias||(F(e.primary().head,t.sel.primary().head)<0?-1:1);Cr(t,Sr(t,e,i,!0)),n&&n.scroll===!1||!t.cm||Kn(t.cm)}function Cr(t,e){e.equals(t.sel)||(t.sel=e,t.cm&&(t.cm.curOp.updateInput=t.cm.curOp.selectionChanged=!0,Pt(t.cm)),xe(t,"cursorActivity",t))}function kr(t){Cr(t,Sr(t,t.sel,null,!1))}function Sr(t,e,n,i){for(var r,o=0;o<e.ranges.length;o++){var s=e.ranges[o],a=e.ranges.length==t.sel.ranges.length&&t.sel.ranges[o],l=Er(t,s.anchor,a&&a.anchor,n,i),c=Er(t,s.head,a&&a.head,n,i);(r||l!=s.anchor||c!=s.head)&&(r||(r=e.ranges.slice(0,o)),r[o]=new Oa(l,c))}return r?$i(r,e.primIndex):e}function Tr(t,e,n,i,r){var o=M(t,e.line);if(o.markedSpans)for(var s=0;s<o.markedSpans.length;++s){var a=o.markedSpans[s],l=a.marker;if((null==a.from||(l.inclusiveLeft?a.from<=e.ch:a.from<e.ch))&&(null==a.to||(l.inclusiveRight?a.to>=e.ch:a.to>e.ch))){if(r&&(Et(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--s;continue}break}if(!l.atomic)continue;if(n){var c=l.find(i<0?1:-1),u=void 0;if((i<0?l.inclusiveRight:l.inclusiveLeft)&&(c=Mr(t,c,-i,c&&c.line==e.line?o:null)),c&&c.line==e.line&&(u=F(c,n))&&(i<0?u<0:u>0))return Tr(t,c,e,i,r)}var h=l.find(i<0?-1:1);return(i<0?l.inclusiveLeft:l.inclusiveRight)&&(h=Mr(t,h,i,h.line==e.line?o:null)),h?Tr(t,h,e,i,r):null}}return e}function Er(t,e,n,i,r){var o=i||1,s=Tr(t,e,n,o,r)||!r&&Tr(t,e,n,o,!0)||Tr(t,e,n,-o,r)||!r&&Tr(t,e,n,-o,!0);return s?s:(t.cantEdit=!0,_(t.first,0))}function Mr(t,e,n,i){return n<0&&0==e.ch?e.line>t.first?j(t,_(e.line-1)):null:n>0&&e.ch==(i||M(t,e.line)).text.length?e.line<t.first+t.size-1?_(e.line+1,0):null:new _(e.line,e.ch+n)}function Pr(t){t.setSelection(_(t.firstLine(),0),_(t.lastLine()),Us)}function Ar(t,e,n){var i={canceled:!1,from:e.from,to:e.to,text:e.text,origin:e.origin,cancel:function(){return i.canceled=!0}};return n&&(i.update=function(e,n,r,o){e&&(i.from=j(t,e)),n&&(i.to=j(t,n)),r&&(i.text=r),void 0!==o&&(i.origin=o)}),Et(t,"beforeChange",t,i),t.cm&&Et(t.cm,"beforeChange",t.cm,i),i.canceled?null:{from:i.from,to:i.to,text:i.text,origin:i.origin}}function Or(t,e,n){if(t.cm){if(!t.cm.curOp)return pi(t.cm,Or)(t,e,n);if(t.cm.state.suppressEdits)return}if(!(At(t,"beforeChange")||t.cm&&At(t.cm,"beforeChange"))||(e=Ar(t,e,!0))){var i=Js&&!n&&et(t,e.from,e.to);if(i)for(var r=i.length-1;r>=0;--r)Lr(t,{from:i[r].from,to:i[r].to,text:r?[""]:e.text,origin:e.origin});else Lr(t,e)}}function Lr(t,e){if(1!=e.text.length||""!=e.text[0]||0!=F(e.from,e.to)){var n=Bi(t,e);rr(t,e,n,t.cm?t.cm.curOp.id:NaN),Ir(t,e,n,Q(t,e));var i=[];Xi(t,function(t,n){n||d(i,t.history)!=-1||($r(t.history,e),i.push(t.history)),Ir(t,e,null,Q(t,e))})}}function Nr(t,e,n){if(!t.cm||!t.cm.state.suppressEdits||n){for(var i,r=t.history,o=t.sel,s="undo"==e?r.done:r.undone,a="undo"==e?r.undone:r.done,l=0;l<s.length&&(i=s[l],n?!i.ranges||i.equals(t.sel):i.ranges);l++);if(l!=s.length){for(r.lastOrigin=r.lastSelOrigin=null;i=s.pop(),i.ranges;){if(ar(i,a),n&&!i.equals(t.sel))return void xr(t,i,{clearRedo:!1});o=i}var c=[];ar(o,a),a.push({changes:c,generation:r.generation}),r.generation=i.generation||++r.maxGeneration;for(var u=At(t,"beforeChange")||t.cm&&At(t.cm,"beforeChange"),h=function(n){var r=i.changes[n];if(r.origin=e,u&&!Ar(t,r,!1))return s.length=0,{};c.push(er(t,r));var o=n?Bi(t,r):g(s);Ir(t,r,o,hr(t,r)),!n&&t.cm&&t.cm.scrollIntoView({from:r.from,to:Hi(r)});var a=[];Xi(t,function(t,e){e||d(a,t.history)!=-1||($r(t.history,r),a.push(t.history)),Ir(t,r,null,hr(t,r))})},f=i.changes.length-1;f>=0;
if(s&&i.ranges.length>1)if(el&&el.text.join("\n")==e){if(i.ranges.length%el.text.length==0){l=[];for(var c=0;c<el.text.length;c++)l.push(o.splitLines(el.text[c]))}}else a.length==i.ranges.length&&t.options.pasteLinesPerSelection&&(l=v(a,function(t){return[t]}));for(var u,h=i.ranges.length-1;h>=0;h--){var d=i.ranges[h],f=d.from(),p=d.to();d.empty()&&(n&&n>0?f=_(f.line,f.ch-n):t.state.overwrite&&!s?p=_(p.line,Math.min(M(o,p.line).text.length,p.ch+g(a).length)):el&&el.lineWise&&el.text.join("\n")==e&&(f=p=_(f.line,0))),u=t.curOp.updateInput;var m={from:f,to:p,text:l?l[h%l.length]:a,origin:r||(s?"paste":t.state.cutIncoming?"cut":"+input")};Or(t.doc,m),xe(t,"inputRead",t,m)}e&&!s&&Qo(t,e),Kn(t),t.curOp.updateInput=u,t.curOp.typing=!0,t.state.pasteIncoming=t.state.cutIncoming=!1}function Zo(t,e){var n=t.clipboardData&&t.clipboardData.getData("Text");if(n)return t.preventDefault(),e.isReadOnly()||e.options.disableInput||fi(e,function(){return Jo(e,n,0,null,"paste")}),!0}function Qo(t,e){if(t.options.electricChars&&t.options.smartIndent)for(var n=t.doc.sel,i=n.ranges.length-1;i>=0;i--){var r=n.ranges[i];if(!(r.head.ch>100||i&&n.ranges[i-1].head.line==r.head.line)){var o=t.getModeAt(r.head),s=!1;if(o.electricChars){for(var a=0;a<o.electricChars.length;a++)if(e.indexOf(o.electricChars.charAt(a))>-1){s=Yo(t,r.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(M(t.doc,r.head.line).text.slice(0,r.head.ch))&&(s=Yo(t,r.head.line,"smart"));s&&xe(t,"electricInput",t,r.head.line)}}}function ts(t){for(var e=[],n=[],i=0;i<t.doc.sel.ranges.length;i++){var r=t.doc.sel.ranges[i].head.line,o={anchor:_(r,0),head:_(r+1,0)};n.push(o),e.push(t.getRange(o.anchor,o.head))}return{text:e,ranges:n}}function es(t,e){t.setAttribute("autocorrect","off"),t.setAttribute("autocapitalize","off"),t.setAttribute("spellcheck",!!e)}function ns(){var t=i("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),e=i("div",[t],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return ws?t.style.width="1000px":t.setAttribute("wrap","off"),Ps&&(t.style.border="1px solid black"),es(t),e}function is(t,e,n,i,r){function o(){var i=e.line+n;return!(i<t.first||i>=t.first+t.size)&&(e=new _(i,e.ch,e.sticky),c=M(t,i))}function s(i){var s;if(s=r?vo(t.cm,c,e,n):po(c,e,n),null==s){if(i||!o())return!1;e=go(r,t.cm,c,e.line,n)}else e=s;return!0}var a=e,l=n,c=M(t,e.line);if("char"==i)s();else if("column"==i)s(!0);else if("word"==i||"group"==i)for(var u=null,h="group"==i,d=t.cm&&t.cm.getHelper(e,"wordChars"),f=!0;!(n<0)||s(!f);f=!1){var p=c.text.charAt(e.ch)||"\n",g=w(p,d)?"w":h&&"\n"==p?"n":!h||/\s/.test(p)?null:"p";if(!h||f||g||(g="s"),u&&u!=g){n<0&&(n=1,s(),e.sticky="after");break}if(g&&(u=g),n>0&&!s(!f))break}var v=Er(t,e,a,l,!0);return R(a,v)&&(v.hitSide=!0),v}function rs(t,e,n,i){var r,o=t.doc,s=e.left;if("page"==i){var a=Math.min(t.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),l=Math.max(a-.5*bn(t.display),3);r=(n>0?e.bottom:e.top)+n*l}else"line"==i&&(r=n>0?e.bottom+3:e.top-3);for(var c;c=dn(t,s,r),c.outside;){if(n<0?r<=0:r>=o.height){c.hitSide=!0;break}r+=5*n}return c}function os(t,e){var n=qe(t,e.line);if(!n||n.hidden)return null;var i=M(t.doc,e.line),r=Be(n,i,e.line),o=kt(i,t.doc.direction),s="left";if(o){var a=Ct(o,e.ch);s=a%2?"right":"left"}var l=Ye(r.map,e.ch,s);return l.offset="right"==l.collapse?l.end:l.start,l}function ss(t){for(var e=t;e;e=e.parentNode)if(/CodeMirror-gutter-wrapper/.test(e.className))return!0;return!1}function as(t,e){return e&&(t.bad=!0),t}function ls(t,e,n,i,r){function o(t){return function(e){return e.id==t}}function s(){u&&(c+=h,u=!1)}function a(t){t&&(s(),c+=t)}function l(e){if(1==e.nodeType){var n=e.getAttribute("cm-text");if(null!=n)return void a(n||e.textContent.replace(/\u200b/g,""));var c,d=e.getAttribute("cm-marker");if(d){var f=t.findMarks(_(i,0),_(r+1,0),o(+d));return void(f.length&&(c=f[0].find(0))&&a(P(t.doc,c.from,c.to).join(h)))}if("false"==e.getAttribute("contenteditable"))return;var p=/^(pre|div|p)$/i.te
removeLineClass:vi(function(e,n,i){return Vr(this,e,"gutter"==n?"gutter":"class",function(e){var r="text"==n?"textClass":"background"==n?"bgClass":"gutter"==n?"gutterClass":"wrapClass",o=e[r];if(!o)return!1;if(null==i)e[r]=null;else{var s=o.match(t(i));if(!s)return!1;var a=s.index+s[0].length;e[r]=o.slice(0,s.index)+(s.index&&a!=o.length?" ":"")+o.slice(a)||null}return!0})}),addLineWidget:vi(function(t,e,n){return Wr(this,t,e,n)}),removeLineWidget:function(t){t.clear()},markText:function(t,e,n){return Ur(this,j(this,t),j(this,e),n,n&&n.type||"range")},setBookmark:function(t,e){var n={replacedWith:e&&(null==e.nodeType?e.widget:e),insertLeft:e&&e.insertLeft,clearWhenEmpty:!1,shared:e&&e.shared,handleMouseEvents:e&&e.handleMouseEvents};return t=j(this,t),Ur(this,t,t,n,"bookmark")},findMarksAt:function(t){t=j(this,t);var e=[],n=M(this,t.line).markedSpans;if(n)for(var i=0;i<n.length;++i){var r=n[i];(null==r.from||r.from<=t.ch)&&(null==r.to||r.to>=t.ch)&&e.push(r.marker.parent||r.marker)}return e},findMarks:function(t,e,n){t=j(this,t),e=j(this,e);var i=[],r=t.line;return this.iter(t.line,e.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&&r==t.line&&t.ch>=l.to||null==l.from&&r!=t.line||null!=l.from&&r==e.line&&l.from>=e.ch||n&&!n(l.marker)||i.push(l.marker.parent||l.marker)}++r}),i},getAllMarks:function(){var t=[];return this.iter(function(e){var n=e.markedSpans;if(n)for(var i=0;i<n.length;++i)null!=n[i].from&&t.push(n[i].marker)}),t},posFromIndex:function(t){var e,n=this.first,i=this.lineSeparator().length;return this.iter(function(r){var o=r.text.length+i;return o>t?(e=t,!0):(t-=o,void++n)}),j(this,_(n,e))},indexFromPos:function(t){t=j(this,t);var e=t.ch;if(t.line<this.first||t.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,t.line,function(t){e+=t.text.length+n}),e},copy:function(t){var e=new Fa(A(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return e.scrollTop=this.scrollTop,e.scrollLeft=this.scrollLeft,e.sel=this.sel,e.extend=!1,t&&(e.history.undoDepth=this.history.undoDepth,e.setHistory(this.getHistory())),e},linkedDoc:function(t){t||(t={});var e=this.first,n=this.first+this.size;null!=t.from&&t.from>e&&(e=t.from),null!=t.to&&t.to<n&&(n=t.to);var i=new Fa(A(this,e,n),t.mode||this.modeOption,e,this.lineSep,this.direction);return t.sharedHist&&(i.history=this.history),(this.linked||(this.linked=[])).push({doc:i,sharedHist:t.sharedHist}),i.linked=[{doc:this,isParent:!0,sharedHist:t.sharedHist}],Gr(i,Kr(this)),i},unlinkDoc:function(t){var e=this;if(t instanceof Ko&&(t=t.doc),this.linked)for(var n=0;n<this.linked.length;++n){var i=e.linked[n];if(i.doc==t){e.linked.splice(n,1),t.unlinkDoc(e),Yr(Kr(e));break}}if(t.history==this.history){var r=[t.id];Xi(t,function(t){return r.push(t.id)},!0),t.history=new tr(null),t.history.done=dr(this.history.done,r),t.history.undone=dr(this.history.undone,r)}},iterLinkedDocs:function(t){Xi(this,t)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(t){return this.lineSep?t.split(this.lineSep):ra(t)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:vi(function(t){"rtl"!=t&&(t="ltr"),t!=this.direction&&(this.direction=t,this.iter(function(t){return t.order=null}),this.cm&&Qi(this.cm))})}),Fa.prototype.eachLine=Fa.prototype.iter;for(var Ra=0,za=!1,$a={3:"Enter",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:"/",127:"Delete",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"},Va=0;Va<10;Va++)$a[Va+48]=$a[Va+96]=String(Va);for(var Ha=65;Ha<=90;Ha++)$a[Ha]=String.fromCharCode(Ha);for(
o.selForContextMenu==r.doc.sel&&0==s.selectionStart&&s.selectionEnd>0&&""==i.prevInput?pi(r,Pr)(r):t++<10?o.detectingSelectAll=setTimeout(n,500):(o.selForContextMenu=null,o.input.reset())};o.detectingSelectAll=setTimeout(n,200)}}var i=this,r=i.cm,o=r.display,s=i.textarea,a=Tn(r,t),l=o.scroller.scrollTop;if(a&&!Ss){var c=r.options.resetSelectionOnContextMenu;c&&r.doc.sel.contains(a)==-1&&pi(r,xr)(r.doc,Vi(a),Us);var u=s.style.cssText,h=i.wrapper.style.cssText;i.wrapper.style.cssText="position: absolute";var d=i.wrapper.getBoundingClientRect();s.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(t.clientY-d.top-5)+"px; left: "+(t.clientX-d.left-5)+"px;\n z-index: 1000; background: "+(bs?"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(ws&&(f=window.scrollY),o.input.focus(),ws&&window.scrollTo(null,f),o.input.reset(),r.somethingSelected()||(s.value=i.prevInput=" "),i.contextMenuPending=!0,o.selForContextMenu=r.doc.sel,clearTimeout(o.detectingSelectAll),bs&&xs>=9&&e(),Rs){It(t);var p=function(){Tt(window,"mouseup",p),setTimeout(n,20)};na(window,"mouseup",p)}else setTimeout(n,50)}},rl.prototype.readOnlyChanged=function(t){t||this.reset(),this.textarea.disabled="nocursor"==t},rl.prototype.setUneditable=function(){},rl.prototype.needsContentAttribute=!1,Bo(Ko),nl(Ko);var ol="iter insert remove copy getEditor constructor".split(" ");for(var sl in Fa.prototype)Fa.prototype.hasOwnProperty(sl)&&d(ol,sl)<0&&(Ko.prototype[sl]=function(t){return function(){return t.apply(this.doc,arguments)}}(Fa.prototype[sl]));return Ot(Fa),Ko.inputStyles={textarea:rl,contenteditable:il},Ko.defineMode=function(t){Ko.defaults.mode||"null"==t||(Ko.defaults.mode=t),Vt.apply(this,arguments)},Ko.defineMIME=Ht,Ko.defineMode("null",function(){return{token:function(t){return t.skipToEnd()}}}),Ko.defineMIME("text/plain","null"),Ko.defineExtension=function(t,e){Ko.prototype[t]=e},Ko.defineDocExtension=function(t,e){Fa.prototype[t]=e},Ko.fromTextArea=hs,ds(Ko),Ko.version="5.31.0",Ko})},function(t,e,n){"use strict";var i=n(0),r=1,o=2,s=i.Model.extend({idAttribute:"name",defaults:{name:"",label:"",type:r,active:!0,"private":!1,"protected":!1},initialize:function(){var t=this.get("name"),e=this.get("label");t?e||this.set("label",t):this.set("name",e),this.set("name",s.escapeName(this.get("name")))},getFullName:function(){var t="";switch(this.get("type")){case r:t=".";break;case o:t="#"}return t+this.get("name")}},{TYPE_CLASS:r,TYPE_ID:o,escapeName:function(t){return(""+t).trim().replace(/([^a-z0-9\w-]+)/gi,"-")}});t.exports=s},function(t,e,n){"use strict";var i=(n(1),n(0)),r=i.$;t.exports=i.View.extend({events:{change:"onChange"},attributes:function(){return this.model.get("attributes")},initialize:function(t){var e=this.model,n=(e.get("name"),e.target);this.config=t.config||{},this.pfx=this.config.stylePrefix||"",this.ppfx=this.config.pStylePrefix||"",this.target=n,this.className=this.pfx+"trait",this.labelClass=this.ppfx+"label",this.fieldClass=this.ppfx+"field "+this.ppfx+"field-"+e.get("type"),this.inputhClass=this.ppfx+"input-holder",e.off("change:value",this.onValueChange),this.listenTo(e,"change:value",this.onValueChange),this.tmpl='<div class="'+this.fieldClass+'"><div class="'+this.inputhClass+'"></div></div>'},onChange:function(){this.model.set("value",this.getInputEl().value)},getValueForTarget:function(){return this.model.get("value")},setInputValue:function(t){this.getInputEl().value=t},onValueChange:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this.model;this.target,i.get("name");if(n.fromTarget)this.setInputValue(i.get("value"));else{var r=this.getValueForTarget();i.setTargetValue(r)}},renderLabel:function(){this.$el.html('<div class="'+this.labelClass+'">'+this.getLabel()+"</div>")},getLabel:function(){var t=this.model,e=t.get("label")||t.get("name");return e.charAt(0).toUpperCase()+e.slice(1).replace(/-/g," ")},getInputEl:function(){if(!this.$input){var t=this.mo
this.canvas.getHighlighter().style.display="none"},onClick:function(t){t.stopPropagation();var e=c(t.target).data("model"),n=this.editor;if(e)if(e.get("selectable"))n.select(e);else{for(var i=e.parent();i&&!i.get("selectable");)i=i.parent();i&&n.select(i)}},updateBadge:function(t,e){var n=c(t),i=this.canvas,r=i.getConfig(),o=r.customBadgeLabel;this.cacheEl=t;var s=n.data("model");if(s&&s.get("badgable")){var a=this.getBadge(),l=s.getIcon()+s.getName();l=o?o(s):l,a.innerHTML=l;var u=a.style,h="px";u.display="block";var d=i.getCanvasView().getPosition(),f=a?a.offsetHeight:0,p=a?a.offsetWidth:0,g=e.top-f<d.top?d.top:e.top-f,v=e.left+p<d.left?d.left:e.left;u.top=g+h,u.left=v+h}},updateHighlighter:function(t,e){var n=c(t),i=n.data("model");if(i&&i.get("hoverable")&&"selected"!=i.get("status")){var r=this.canvas.getHighlighter(),o=r.style,s="px";o.left=e.left+s,o.top=e.top+s,o.height=e.height+s,o.width=e.width+s,o.display="block"}},onSelect:function(){var t=this.editor,e=this.em.getSelected();if(this.updateToolbar(e),e){var n=e.view.el;this.showFixedElementOffset(n),this.hideElementOffset(),this.hideHighlighter(),this.initResize(n)}else t.stopCommand("resize")},initResize:function(t){var e,n=this.em,o=n?n.get("Editor"):"",a=n?n.get("Config"):"",l=a.stylePrefix||"",c=l+"resizing",h=n.get("selectedComponent"),d=h.get("resizable"),f={},p=function(t,e,n){var i=n.docs;i&&i.forEach(function(e){var n=e.body,i=n.className||"";n.className=("add"==t?i+" "+c:i.replace(c,"")).trim()})};o&&d&&(f={onStart:function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=i.el,o=i.config,a=i.resizer,l=o.keyHeight,c=o.keyWidth,d=o.currentUnit;p("add",t,i),e=n.get("StyleManager").getModelToStyle(h);var f=getComputedStyle(r),g=e.getStyle(),v=g[c]||f[c],m=g[l]||f[l];a.startDim.w=parseFloat(v),a.startDim.h=parseFloat(m),u=0,d&&(o.unitHeight=(0,s.getUnitFromValue)(m),o.unitWidth=(0,s.getUnitFromValue)(v))},onMove:function(){o.trigger("change:canvasOffset")},onEnd:function(t,e){p("remove",t,e),o.trigger("change:canvasOffset"),u=1},updateTarget:function(t,i){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e){var o=r.store,s=r.selectedHandler,a=r.config,l=a.keyHeight,c=a.keyWidth,u=["tc","bc"].indexOf(s)>=0,h=["cl","cr"].indexOf(s)>=0,d=e.getStyle();u||(d[c]=i.w+a.unitWidth),h||(d[l]=i.h+a.unitHeight),e.setStyle(d,{avoidStore:1});var f="update:component:style";n&&n.trigger(f+":"+l+" "+f+":"+c),o&&e.trigger("change:style",e,d,{})}}},"object"==("undefined"==typeof d?"undefined":r(d))&&(f=i({},f,d)),o.runCommand("resize",{el:t,options:f}))},updateToolbar:function(t){var e=this.config.em,n=t==e?e.get("selectedComponent"):t,i=this.canvas.getToolbarEl(),r=i.style;if(!n)return void(r.opacity=0);var o=n.get("toolbar"),s=(this.ppfx,e.get("Config").showToolbar);if(s&&o&&o.length){if(r.opacity="",r.display="",!this.toolbar){i.innerHTML="",this.toolbar=new l(o);var c=new a({collection:this.toolbar,editor:this.editor});i.appendChild(c.render().el)}this.toolbar.reset(o);var u=n.view;u&&this.updateToolbarPos(u.el)}else r.display="none"},updateToolbarPos:function(t,e){var n="px",i=this.canvas.getToolbarEl(),r=i.style,o=r.display;r.display="block";var s=this.canvas.getTargetToElementDim(i,t,{elPos:e,event:"toolbarPosUpdate"}),a=s.left+s.elementWidth-s.targetWidth;r.top=s.top+n,r.left=(a<0?0:a)+n,r.display=o},getCanvasPosition:function(){return this.canvas.getCanvasView().getPosition()},clean:function(){this.selEl&&this.selEl.removeClass(this.hoverClass)},getBadge:function(){return this.canvas.getBadgeEl()},onFrameScroll:function(t){var e=this.cacheEl;if(e){var n=this.getElementPos(e);this.updateBadge(e,n);var i=this.em.get("selectedComponent");i&&this.updateToolbarPos(i.view.el)}},updateAttached:function(t){var e=this.em.getSelected();if(e){var n=e.view;this.updateToolbarPos(n.el),this.showFixedElementOffset(n.el)}},getElementPos:function(t,e){return this.canvas.getCanvasView().getElementPos(t)},hideBadge:function(){this.getBadge().style.display="none"},cleanPrevious:function(t){t&&t.set({status:"",state:""})},getContentWindow:function(
t.registerHelper("hintWords","css",k),t.defineMIME("text/css",{documentTypes:r,mediaTypes:s,mediaFeatures:l,mediaValueKeywords:u,propertyKeywords:d,nonStandardPropertyKeywords:p,fontProperties:v,counterDescriptors:y,colorKeywords:x,valueKeywords:C,tokenHooks:{"/":function(t,e){return!!t.eat("*")&&(e.tokenize=n,n(t,e))}},name:"css"}),t.defineMIME("text/x-scss",{mediaTypes:s,mediaFeatures:l,mediaValueKeywords:u,propertyKeywords:d,nonStandardPropertyKeywords:p,colorKeywords:x,valueKeywords:C,fontProperties:v,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(t,e){return t.eat("/")?(t.skipToEnd(),["comment","comment"]):t.eat("*")?(e.tokenize=n,n(t,e)):["operator","operator"]},":":function(t){return!!t.match(/\s*\{/,!1)&&[null,null]},$:function(t){return t.match(/^[\w-]+/),t.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(t){return!!t.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),t.defineMIME("text/x-less",{mediaTypes:s,mediaFeatures:l,mediaValueKeywords:u,propertyKeywords:d,nonStandardPropertyKeywords:p,colorKeywords:x,valueKeywords:C,fontProperties:v,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(t,e){return t.eat("/")?(t.skipToEnd(),["comment","comment"]):t.eat("*")?(e.tokenize=n,n(t,e)):["operator","operator"]},"@":function(t){return t.eat("{")?[null,"interpolation"]:!t.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/,!1)&&(t.eatWhile(/[\w\\\-]/),t.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),t.defineMIME("text/x-gss",{documentTypes:r,mediaTypes:s,mediaFeatures:l,propertyKeywords:d,nonStandardPropertyKeywords:p,fontProperties:v,counterDescriptors:y,colorKeywords:x,valueKeywords:C,supportsAtComponent:!0,tokenHooks:{"/":function(t,e){return!!t.eat("*")&&(e.tokenize=n,n(t,e))}},name:"css",helperType:"gss"})})},function(t,e,n){"use strict";var i=n(0),r=n(28);t.exports=i.Model.extend({defaults:{id:"",content:"",visible:!0,buttons:[],attributes:{}},initialize:function(t){this.btn=this.get("buttons")||[],this.buttons=new r(this.btn),this.set("buttons",this.buttons)}})},function(t,e,n){"use strict";var i=n(0),r=n(109);t.exports=i.Collection.extend({model:r,deactivateAllExceptOne:function(t,e){this.forEach(function(n,i){n!==t&&(n.set("active",!1),e&&n.get("buttons").length&&n.get("buttons").deactivateAllExceptOne(t,e))})},deactivateAll:function(t){var e=t||"";this.forEach(function(t,n){t.get("context")==e&&(t.set("active",!1),t.get("buttons").length&&t.get("buttons").deactivateAll(e))})},disableAllButtons:function(t){var e=t||"";this.forEach(function(t,n){t.get("context")==e&&(t.set("disable",!0),t.get("buttons").length&&t.get("buttons").disableAllButtons(e))})},disableAllButtonsExceptOne:function(t,e){this.forEach(function(n,i){n!==t&&(n.set("disable",!0),e&&n.get("buttons").length&&n.get("buttons").disableAllButtonsExceptOne(t,e))})}})},function(t,e,n){"use strict";var i=n(0),r=n(30);t.exports=i.View.extend({initialize:function(t){var e=t.config||{};this.config=e,this.pfx=e.stylePrefix||"",this.ppfx=e.pStylePrefix||"",this.buttons=this.model.get("buttons"),this.className=this.pfx+"panel",this.id=this.pfx+this.model.get("id"),this.listenTo(this.model,"change:appendContent",this.appendContent),this.listenTo(this.model,"change:content",this.updateContent)},appendContent:function(){this.$el.append(this.model.get("appendContent"))},updateContent:function(){this.$el.html(this.model.get("content"))},attributes:function(){return this.model.get("attributes")},initResize:function(){var t=this.config.em,e=t?t.get("Editor"):"",n=this.model.get("resizable");if(e&&n){var i,r,o,s=n===!0?[1,1,1,1]:n,a=s.length,l=0;2==a?(i=s[0],o=s[0],r=s[1],l=s[1]):4==a&&(i=s[0],r=s[1],o=s[2],l=s[3]);var c=e.Utils.Resizer.init({tc:i,cr:r,bc:o,cl:l,tl:0,tr:0,bl:0,br:0,appendTo:this.el,prefix:e.getConfig().stylePrefix,posFetcher:function(t){var e=t.getBoundingClientRect();return{left:0,top:0,width:e.width,height:e.h
},this.config),s=o.render().el;n?n.appendChild(s):this.$el.append(s)},render:function(){var t=document.createDocumentFragment();return this.$el.empty(),this.collection.length&&this.collection.each(function(e){this.add(e,t)},this),this.$el.append(t),this}})},function(t,e,n){"use strict";var i=n(1),r=n(0);t.exports=r.Collection.extend({initialize:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.listenTo(this,"add",this.onAdd),this.config=e.config,this.em=e.em,this.model=function(t,n){var i,r=e.componentTypes;n.em=e.em,n.config=e.config,n.componentTypes=r;for(var o=0;o<r.length;o++){var s=r[o].id;if(s==t.type){i=r[o].model;break}}return i||(i=r[r.length-1].model),new i(t,n)}},add:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"==typeof t){var n=this.em.get("Parser").parseHtml(t);t=n.html;var i=this.em.get("CssComposer");if(n.css&&i){var o=e.avoidUpdateStyle;i.addCollection(n.css,{extend:1,avoidUpdateStyle:o})}}return r.Collection.prototype.add.apply(this,[t,e])},onAdd:function(t,e,n){var r=this.em,o=t.getStyle(),s=r&&r.getConfig("avoidInlineStyle");if(!(0,i.isEmpty)(o)&&!s&&r&&r.get&&r.getConfig("forceClass")){var a=t.cid;r.get("CssComposer").setClassRule(a,o);t.setStyle({}),t.addClass(a)}}})},function(t,e,n){"use strict";(function(e){var i=n(1);t.exports=e.View.extend({initialize:function(t){this.opts=t||{},this.config=t.config||{};var e=this.collection;this.listenTo(e,"add",this.addTo),this.listenTo(e,"reset",this.resetChildren)},addTo:function(t){var e=this.config.em,n=this.collection.indexOf(t);this.addToCollection(t,null,n),e&&!t.opt.temporary&&(e.trigger("add:component",t),e.trigger("component:add",t))},addToCollection:function(t,e,r){this.compView||(this.compView=n(3));for(var o=e||null,s=this.compView,a=this.opts.componentTypes,l=t.get("type"),c=0;c<a.length;c++){var u=a[c].id;if(u==l){s=a[c].view;break}}var h=new s({model:t,config:this.config,componentTypes:a}),d=h.render().el;if("textnode"==h.model.get("type")&&(d=document.createTextNode(h.model.get("content"))),o)o.appendChild(d);else{var f=this.parentEl,p=f.childNodes;if((0,i.isUndefined)(r))f.appendChild(d);else{var g=p.length==r;g&&r--,g||!p.length?f.appendChild(d):f.insertBefore(d,p[r])}}return d},resetChildren:function(){var t=this;this.parentEl.innerHTML="",this.collection.each(function(e){return t.addToCollection(e)})},render:function(t){var e=this,n=this.el,i=document.createDocumentFragment();return this.parentEl=t||this.el,this.collection.each(function(t){return e.addToCollection(t,i)}),n.innerHTML="",n.appendChild(i),this}})}).call(e,n(0))},function(t,e,n){"use strict";var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r=n(4);t.exports=r.extend({defaults:i({},r.prototype.defaults,{type:"text",droppable:!1,editable:!0})})},function(t,e,n){"use strict";var i=n(2),r=n(3);t.exports=r.extend({events:{dblclick:"enableEditing"},initialize:function(t){r.prototype.initialize.apply(this,arguments),this.disableEditing=this.disableEditing.bind(this);var e=this.model,n=this.em;this.listenTo(e,"focus active",this.enableEditing),this.listenTo(e,"change:content",this.updateContent),this.rte=n&&n.get("RichTextEditor")},enableEditing:function(){var t=this.rte;if(!this.rteEnabled&&this.model.get("editable")){if(t)try{this.activeRte=t.enable(this,this.activeRte)}catch(e){console.error(e)}this.rteEnabled=1,this.toggleEvents(1)}},disableEditing:function(){var t=this.model,e=t.get("editable"),n=this.rte;if(n&&e){try{n.disable(this,this.activeRte)}catch(i){console.error(i)}var r=this.getChildrenContainer().innerHTML,o=t.get("components");if(o.length&&o.reset(),t.set("content",""),n.customRte)t.set("content",r);else{var s=function a(t){t.set({editable:0,highlightable:0,removable:0,draggable:0,copyable:0,toolbar:""}),t.get("components").each(function(t){return a(t)})};t.trigger("change:content",t),o.add(r),o.each(function(t){return s(t)}),o.trigger("resetNavigator")}}this.rteEnabled=0,this.tog
this.cacheDims=this.getChildrenDim(t)}if(this.prevTarget==t&&(r=this.cacheDims),this.target=this.prevTarget,this.nearBorders(this.prevTargetDim,e,n)||!this.nested&&!this.cacheDims.length){var s=this.targetP;s&&this.validTarget(s).valid&&(r=this.cacheDimsP,this.target=s)}return this.lastPos=null,r},getTargetFromEl:function(t){var e=t,n=void 0,i=this.targetPrev,r=this.em,o=this.containerSel,s=this.itemSel;if(this.matches(e,s+", "+o)||(e=this.closest(e,s)),this.draggable instanceof Array&&(e=this.closest(e,this.draggable.join(","))),i&&i!=e&&(this.targetPrev=""),!this.targetPrev){n=this.closest(e,o);var a=this.validTarget(e);if(r&&r.trigger("sorter:drag:validation",a),!a.valid&&n)return this.getTargetFromEl(n);this.targetPrev=e}return this.nearElBorders(e)&&(n=this.closest(e,o),n&&this.validTarget(n).valid&&(e=n)),e},nearElBorders:function(t){var e=10,n=t.getBoundingClientRect(),i=t.ownerDocument.body,r=this.getCurrentPos(),o=r.x,s=r.y,a=n.top+i.scrollTop,l=n.left+i.scrollLeft,c=n.width,u=n.height;if(s<a+e||s>a+u-e||o<l+e||o>l+c-e)return 1},getCurrentPos:function(){var t=this.eventMove,e=t.pageX||0,n=t.pageY||0;return{x:e,y:n}},getDim:function(t){var e,n,i,r;if(this.canvasRelative&&this.em){var o=this.em.get("Canvas").getElementPos(t),s=window.getComputedStyle(t),a=parseFloat(s.marginTop),l=parseFloat(s.marginBottom),c=parseFloat(s.marginRight),u=parseFloat(s.marginLeft);e=o.top-a,n=o.left-u,i=o.height+a+l,r=o.width+u+c}else{var h=this.offset(t);e=this.relative?t.offsetTop:h.top-(this.wmargin?-1:1)*this.elT,n=this.relative?t.offsetLeft:h.left-(this.wmargin?-1:1)*this.elL,i=t.offsetHeight,r=t.offsetWidth}return[e,n,i,r]},getChildrenDim:function(t){var e=[];if(!t)return e;var n=this.getTargetModel(t);n&&n.view&&!this.ignoreViewChildren&&(t=n.view.getChildrenContainer());for(var i=t.children,r=0,o=i.length;r<o;r++){var s=i[r];if(this.matches(s,this.itemSel)){var a=this.getDim(s),l=this.direction;l="v"==l||"h"!=l&&this.isInFlow(s,t),a.push(l),a.push(s),e.push(a)}}return e},nearBorders:function(t,e,n){var i=0,r=this.borderOffset,o=e||0,s=n||0,a=t[0],l=t[1],c=t[2],u=t[3];return(a+r>s||s>a+c-r||l+r>o||o>l+u-r)&&(i=1),!!i},findPosition:function(t,e,n){for(var i={index:0,method:"before"},r=0,o=0,s=0,a=0,l=0,c=0,u=0,h=0,d=0,f=t.length;d<f;d++)if(h=t[d],s=h[1]+h[3],u=h[0]+h[2],l=h[1]+h[3]/2,c=h[0]+h[2]/2,!(o&&h[1]>o||a&&c>=a||r&&s<r))if(i.index=d,h[4]){if(n<c){i.method="before";break}i.method="after"}else n<u&&(a=u),e<l?(o=l,i.method="before"):(r=l,i.method="after");return i},movePlaceholder:function(t,e,n,i){var r=0,o=0,s=0,a=0,l=0,c="px",u=5,h="#62c462",d=3,f=n.method,p=e[n.index];if(t.style.borderColor="transparent "+h,t.style.borderWidth=d+c+" "+(d+2)+c,t.style.margin="-"+d+"px 0 0",p)p[4]?(a=p[3]+c,l="auto",o="before"==f?p[0]-r:p[0]+p[2]-r,s=p[1]):(a="auto",l=p[2]-2*r+c,o=p[0]+r,s="before"==f?p[1]-r:p[1]+p[3]-r,t.style.borderColor=h+" transparent",t.style.borderWidth=d+2+c+" "+d+c,t.style.margin="0 0 0 -"+d+"px");else{if(!this.nested)return void(t.style.display="none");i&&(o=i[0]+u,s=i[1]+u,a=parseInt(i[3])-2*u+c,l="auto")}t.style.top=o+c,t.style.left=s+c,a&&(t.style.width=a),l&&(t.style.height=l)},endMove:function(t){var e,n=this.getDocuments(),i=this.getContainerEl();(0,s.off)(i,"mousemove dragover",this.onMove),(0,s.off)(n,"mouseup dragend",this.endMove),(0,s.off)(n,"keydown",this.rollback),this.plh.style.display="none";var r=(new RegExp("(?:^|\\s)"+this.freezeClass+"(?!\\S)","gi"),this.eV);if(r){var o=this.getSourceModel();o&&o.set&&(o.set("status",""),o.set("status","selected"))}this.moved&&(e=this.move(this.target,r,this.lastPos)),this.plh&&(this.plh.style.display="none"),"function"==typeof this.onEndMove&&this.onEndMove(e);var a=this.dragHelper;a&&(a.parentNode.removeChild(a),this.dragHelper=null),this.selectTargetModel(),this.toggleSortCursor()},move:function(t,n,i){var o=this.em;o&&o.trigger("component:dragEnd:before",t,n,i);var s,l,c,u=[],h=i.index,d=this.validTarget(t),f=a(t).data("collection"),p=d.srcModel,g=d.droppable,v=d.draggable,m=d.dropInfo,y=d.dragInfo,b=this.dropContent;if(g=d.trgModel instanceof e.Collection
a=this.get(s))m&&(p[a.cid]=!0),v&&s!==a&&(s=this._isModel(s)?s.attributes:s,e.parse&&(s=a.parse(s,e)),a.set(s,e),u&&!l&&a.hasChanged(h)&&(l=!0)),t[w]=a;else if(g){if(o=t[w]=this._prepareModel(s,e),!o)continue;d.push(o),this._addReference(o,e)}o=a||o,o&&(r=this.modelId(o.attributes),!y||!o.isNew()&&p[r]||(y.push(o),b=b||!this.models[w]||o.cid!==this.models[w].cid),p[r]=!0)}if(m){for(var w=0;w<this.length;w++)p[(o=this.models[w]).cid]||f.push(o);f.length&&this._removeModels(f,e)}if(d.length||b)if(u&&(l=!0),this.length+=d.length,null!=c)for(var w=0;w<d.length;w++)this.models.splice(c+w,0,d[w]);else{y&&(this.models.length=0);for(var C=y||d,w=0;w<C.length;w++)this.models.push(C[w])}if(l&&this.sort({silent:!0}),!e.silent){for(var k=null!=c?n.clone(e):e,w=0;w<d.length;w++)null!=c&&(k.index=c+w),(o=d[w]).trigger("add",o,this,k);(l||b)&&this.trigger("sort",this,e),(d.length||f.length)&&this.trigger("update",this,e)}return i?t[0]:t},reset:function(t,e){e=e?n.clone(e):{};for(var i=0;i<this.models.length;i++)this._removeReference(this.models[i],e);return e.previousModels=this.models,this._reset(),t=this.add(t,n.extend({silent:!0},e)),e.silent||this.trigger("reset",this,e),t},push:function(t,e){return this.add(t,n.extend({at:this.length},e))},pop:function(t){var e=this.at(this.length-1);return this.remove(e,t)},unshift:function(t,e){return this.add(t,n.extend({at:0},e))},shift:function(t){var e=this.at(0);return this.remove(e,t)},slice:function(){return o.apply(this.models,arguments)},get:function(t){if(null!=t){var e=this.modelId(this._isModel(t)?t.attributes:t);return this._byId[t]||this._byId[e]||this._byId[t.cid]}},at:function(t){return t<0&&(t+=this.length),this.models[t]},where:function(t,e){var i=n.matches(t);return this[e?"find":"filter"](function(t){return i(t.attributes)})},findWhere:function(t){return this.where(t,!0)},sort:function(t){if(!this.comparator)throw new Error("Cannot sort a set without a comparator");return t||(t={}),n.isString(this.comparator)||1===this.comparator.length?this.models=this.sortBy(this.comparator,this):this.models.sort(n.bind(this.comparator,this)),t.silent||this.trigger("sort",this,t),this},pluck:function(t){return n.invoke(this.models,"get",t)},fetch:function(t){t=n.extend({parse:!0},t);var e=t.success,i=this;return t.success=function(n){var r=t.reset?"reset":"set";i[r](n,t),e&&e.call(t.context,i,n,t),i.trigger("sync",i,n,t)},$(this,t),this.sync("read",this,t)},create:function(t,e){e=e?n.clone(e):{};var i=e.wait;if(t=this._prepareModel(t,e),!t)return!1;i||this.add(t,e);var r=this,o=e.success;return e.success=function(t,e,n){i&&r.add(t,n),o&&o.call(n.context,t,e,n)},t.save(null,e),t},parse:function(t,e){return t},clone:function(){return new this.constructor(this.models,{model:this.model,comparator:this.comparator})},modelId:function(t){return t[this.model.prototype.idAttribute||"id"]},_reset:function(){this.length=0,this.models=[],this._byId={}},_prepareModel:function(t,e){if(this._isModel(t))return t.collection||(t.collection=this),t;e=e?n.clone(e):{},e.collection=this;var i=new this.model(t,e);return i.validationError?(this.trigger("invalid",this,i.validationError,e),!1):i},_removeModels:function(t,e){for(var n=[],i=0;i<t.length;i++){var r=this.get(t[i]);if(r){var o=this.indexOf(r);this.models.splice(o,1),this.length--,e.silent||(e.index=o,r.trigger("remove",r,this,e)),n.push(r),this._removeReference(r,e)}}return!!n.length&&n},_isModel:function(t){return t instanceof m},_addReference:function(t,e){this._byId[t.cid]=t;var n=this.modelId(t.attributes);null!=n&&(this._byId[n]=t),t.on("all",this._onModelEvent,this)},_removeReference:function(t,e){delete this._byId[t.cid];var n=this.modelId(t.attributes);null!=n&&delete this._byId[n],this===t.collection&&delete t.collection,t.off("all",this._onModelEvent,this)},_onModelEvent:function(t,e,n,i){if("add"!==t&&"remove"!==t||n===this){if("destroy"===t&&this.remove(e,i),"change"===t){var r=this.modelId(e.previousAttributes()),o=this.modelId(e.attributes);r!==o&&(null!=r&&delete this._byId[r],null!=o&&(this._byId[o]=e))}this.trigger.apply(this,arguments)
this.listenTo(this.collection,"reset",this.renderClasses),this.listenTo(this.collection,"remove",this.tagRemoved),this.delegateEvents()},tagRemoved:function(t){this.updateStateVis()},getStateOptions:function(){for(var t="",e=0;e<this.states.length;e++)t+='<option value="'+this.states[e].name+'">'+this.states[e].label+"</option>";return t},addNew:function(t){this.addToClasses(t)},startNewTag:function(t){this.$addBtn.get(0).style.display="none",this.$input.show().focus()},endNewTag:function(t){this.$addBtn.get(0).style.display="",this.$input.hide().val("")},onInputKeyUp:function(t){13===t.keyCode?this.addNewTag(this.$input.val()):27===t.keyCode&&this.endNewTag()},componentChanged:function(t){this.compTarget=this.target.get("selectedComponent");var e=this.compTarget,n=[];e&&(this.getStates().val(e.get("state")),n=e.get("classes").getValid()),this.collection.reset(n),this.updateStateVis()},updateStateVis:function(){var t=this.em,e=t&&t.getConfig("avoidInlineStyle");this.collection.length||e?this.getStatesC().css("display","block"):this.getStatesC().css("display","none"),this.updateSelector()},updateSelector:function(){var t=this.target.getSelected();if(this.compTarget=t,t&&t.get){var e=t.get("state"),n=this.collection,i=n.getFullString(n.getStyleable());i=i||"#"+t.getId(),i+=e?":"+e:"";var r=this.el.querySelector("#"+this.pfx+"sel");r&&(r.innerHTML=i)}},stateChanged:function(t){this.compTarget&&(this.compTarget.set("state",this.$states.val()),this.updateSelector())},addNewTag:function(t){var e=this.target,n=this.compTarget;if(t.trim()){if(e){var i=e.get("SelectorManager"),r=i.add({label:t});if(n){var o=n.get("classes");o.length;o.add(r);o.length;this.collection.add(r),this.updateStateVis()}}this.endNewTag()}},addToClasses:function(t,e){var n=e||null,i=new r({model:t,config:this.config,coll:this.collection}),o=i.render().el;return n?n.appendChild(o):this.getClasses().append(o),o},renderClasses:function(){var t=document.createDocumentFragment();return this.collection.each(function(e){this.addToClasses(e,t)},this),this.getClasses()&&this.getClasses().empty().append(t),this},getClasses:function(){return this.$classes||(this.$classes=this.$el.find("#"+this.pfx+"tags-c")),this.$classes},getStates:function(){return this.$states||(this.$states=this.$el.find("#"+this.stateInputId)),this.$states},getStatesC:function(){return this.$statesC||(this.$statesC=this.$el.find("#"+this.stateInputC)),this.$statesC},render:function(){var t=this.config;return this.$el.html(this.template({selectedLabel:t.selectedLabel,statesLabel:t.statesLabel,label:t.label,pfx:this.pfx,ppfx:this.ppfx})),this.$input=this.$el.find("input#"+this.newInputId),this.$addBtn=this.$el.find("#"+this.addBtnId),this.$classes=this.$el.find("#"+this.pfx+"tags-c"),this.$states=this.$el.find("#"+this.stateInputId),this.$statesC=this.$el.find("#"+this.stateInputC),this.$states.append(this.getStateOptions()),this.renderClasses(),this.$el.attr("class",this.className),this}})}).call(e,n(1))},function(t,e,n){"use strict";var i=n(7),r="contentEditable";t.exports=n(0).View.extend({template:function(){var t=this.pfx,e=(this.ppfx,this.model.get("label")||"");return'\n <span id="'+t+'checkbox" class="fa" data-tag-status></span>\n <span id="'+t+'tag-label" data-tag-name>'+e+'</span>\n <span id="'+t+'close" data-tag-remove>\n &Cross;\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(t){this.config=t.config||{},this.coll=t.coll||null,this.pfx=this.config.stylePrefix||"",this.ppfx=this.config.pStylePrefix||"",this.target=this.config.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 t=this.getInputEl();t[r]=!0,t.focus()},endEditTag:function(){var t=this.model,e=this.getInputEl(),n=e.textContent,o=i.escapeName(n),s=this.target,a=s&&s.get("SelectorManager");e[r
function t(t){return{type:t,style:"keyword"}}var e=t("keyword a"),n=t("keyword b"),i=t("keyword c"),r=t("keyword d"),o=t("operator"),s={type:"atom",style:"atom"},a={"if":t("if"),"while":e,"with":e,"else":n,"do":n,"try":n,"finally":n,"return":r,"break":r,"continue":r,"new":t("new"),"delete":i,"void":i,"throw":i,"debugger":t("debugger"),"var":t("var"),"const":t("var"),"let":t("var"),"function":t("function"),"catch":t("catch"),"for":t("for"),"switch":t("switch"),"case":t("case"),"default":t("default"),"in":o,"typeof":o,"instanceof":o,"true":s,"false":s,"null":s,undefined:s,NaN:s,Infinity:s,"this":t("this"),"class":t("class"),"super":t("atom"),"yield":i,"export":t("export"),"import":t("import"),"extends":i,await:i};if(Lt){var l={type:"variable",style:"type"},c={"interface":t("class"),"implements":i,namespace:i,module:t("module"),"enum":t("module"),"public":t("modifier"),"private":t("modifier"),"protected":t("modifier"),"abstract":t("modifier"),readonly:t("modifier"),string:l,number:l,"boolean":l,any:l};for(var u in c)a[u]=c[u]}return a}(),It=/[+\-*&%=<>!?|~^@]/,_t=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,Ft="([{}])",Rt={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,"this":!0,"jsonld-keyword":!0},zt={state:null,column:null,marked:null,cc:null},$t={name:"this",next:{name:"arguments"}};return b.lex=!0,{startState:function(t){var e={tokenize:o,lastType:"sof",cc:[],lexical:new u((t||0)-Mt,0,"block",(!1)),localVars:n.localVars,context:n.localVars&&{vars:n.localVars},indented:t||0};return n.globalVars&&"object"==typeof n.globalVars&&(e.globalVars=n.globalVars),e},token:function(t,e){if(t.sol()&&(e.lexical.hasOwnProperty("align")||(e.lexical.align=!1),e.indented=t.indentation(),c(t,e)),e.tokenize!=a&&t.eatSpace())return null;var n=e.tokenize(t,e);return"comment"==Tt?n:(e.lastType="operator"!=Tt||"++"!=Et&&"--"!=Et?Tt:"incdec",d(e,n,Tt,Et,t))},indent:function(e,i){if(e.tokenize==a)return t.Pass;if(e.tokenize!=o)return 0;var r,s=i&&i.charAt(0),l=e.lexical;if(!/^\s*else\b/.test(i))for(var c=e.cc.length-1;c>=0;--c){var u=e.cc[c];if(u==b)l=l.prev;else if(u!=nt)break}for(;("stat"==l.type||"form"==l.type)&&("}"==s||(r=e.cc[e.cc.length-1])&&(r==M||r==P)&&!/^[,\.=+\-*:?[\(]/.test(i));)l=l.prev;Pt&&")"==l.type&&"stat"==l.prev.type&&(l=l.prev);var h=l.type,d=s==h;return"vardef"==h?l.indented+("operator"==e.lastType||","==e.lastType?l.info+1:0):"form"==h&&"{"==s?l.indented:"form"==h?l.indented+Mt:"stat"==h?l.indented+(kt(e,i)?Pt||Mt:0):"switch"!=l.info||d||0==n.doubleIndentSwitch?l.align?l.column+(d?0:1):l.indented+(d?0:Mt):l.indented+(/^(?:case|default)\b/.test(i)?Mt:2*Mt)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:Ot?null:"/*",blockCommentEnd:Ot?null:"*/",blockCommentContinue:Ot?null:" * ",lineComment:Ot?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:Ot?"json":"javascript",jsonldMode:At,jsonMode:Ot,expressionAllowed:St,skipExpression:function(t){var e=t.cc[t.cc.length-1];e!=C&&e!=k||t.cc.pop()}}}),t.registerHelper("wordChars","javascript",/[\w$]/),t.defineMIME("text/javascript","javascript"),t.defineMIME("text/ecmascript","javascript"),t.defineMIME("application/javascript","javascript"),t.defineMIME("application/x-javascript","javascript"),t.defineMIME("application/ecmascript","javascript"),t.defineMIME("application/json",{name:"javascript",json:!0}),t.defineMIME("application/x-json",{name:"javascript",json:!0}),t.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),t.defineMIME("text/typescript",{name:"javascript",typescript:!0}),t.defineMIME("application/typescript",{name:"javascript",typescript:!0})})},function(t,e,n){!function(t){t(n(6))}(function(t){t.extendMode("css",{commentStart:"/*",commentEnd:"*/",newlineAfterToken:function(t,e){return/^[;{}]$/.test(e)}}),t.extendMode("javascript",{commentStart:"/*",commentEnd:"*/",newlineAfterToken:function(t,e,n,i){return this.jsonMode?/^[\[,{]$/.test(e)||/^}/.test(n):(";"!=e||!i.lexical||")"!=i.lexical.type)&&(/^[;{}]$/.test(e)&&!/^;/.test(n))}});var e=/^(a|abbr|acronym|area|base|bdo|big|br|
q.move(A()),Ct.trigger("move.spectrum",[A()])}function N(){Dt.removeClass("sp-validation-error"),D();var t=lt.fromRatio({h:ut,s:1,v:1});Et.css("background-color",t.toHexString());var e=Gt;ft<1&&(0!==ft||"name"!==e)&&("hex"!==e&&"hex3"!==e&&"hex6"!==e&&"name"!==e||(e="rgb"));var n=A({format:e}),i="";if(Ut.removeClass("sp-clear-display"),Ut.css("background-color","transparent"),!n&&Jt)Ut.addClass("sp-clear-display");else{var r=n.toHexString(),o=n.toRgbString();if(X||1===n.alpha?Ut.css("background-color",o):(Ut.css("background-color","transparent"),Ut.css("filter",n.toFilter())),H.showAlpha){var s=n.toRgb();s.a=0;var a=lt(s).toRgbString(),l="linear-gradient(left, "+a+", "+r+")";Y?Ot.css("filter",lt(a).toFilter({gradientType:1},r)):(Ot.css("background","-webkit-"+l),Ot.css("background","-moz-"+l),Ot.css("background","-ms-"+l),Ot.css("background","linear-gradient(to right, "+a+", "+r+")"))}i=n.toString(e)}H.showInput&&Dt.val(i),H.showPalette&&m(),y()}function D(){var t=ht,e=dt;if(Jt&&Xt)Nt.hide(),At.hide(),Mt.hide();else{Nt.show(),At.show(),Mt.show();var n=t*et,i=nt-e*nt;n=Math.max(-it,Math.min(et-it,n-it)),i=Math.max(-it,Math.min(nt-it,i-it)),Mt.css({top:i+"px",left:n+"px"});var r=ft*st;Nt.css({left:r-at/2+"px"});var o=ut*rt;At.css({top:o-ct+"px"})}}function I(t){var e=A(),n="",i=!lt.equals(e,Kt);e&&(n=e.toString(Gt),g(e)),Vt&&Ct.val(n),t&&i&&(q.change(e),Ct.trigger("change",[e]))}function _(){Q&&(et=Et.width(),nt=Et.height(),it=Mt.height(),ot=Pt.width(),rt=Pt.height(),ct=At.height(),st=Lt.width(),at=Nt.width(),j||(St.css("position","absolute"),H.offset?St.offset(H.offset):St.offset(a(St,Wt))),D(),H.showPalette&&m(),Ct.trigger("reflow.spectrum"))}function F(){Ct.show(),Wt.unbind("click.spectrum touchstart.spectrum"),St.remove(),Bt.remove(),G[Zt.id]=null}function R(e,i){return e===n?t.extend({},H):i===n?H[e]:(H[e]=i,"preferredFormat"===e&&(Gt=H.preferredFormat),void l())}function z(){kt=!1,Ct.attr("disabled",!1),Wt.removeClass("sp-disabled")}function $(){E(),kt=!0,Ct.attr("disabled",!0),Wt.addClass("sp-disabled")}function V(t){H.offset=t,_()}var H=o(s,e),j=H.flat,B=H.showSelectionPalette,W=H.localStorageKey,U=H.theme,q=H.callbacks,K=d(_,10),Q=!1,tt=!1,et=0,nt=0,it=0,rt=0,ot=0,st=0,at=0,ct=0,ut=0,ht=0,dt=0,ft=1,pt=[],gt=[],vt={},mt=H.selectionPalette.slice(0),yt=H.maxSelectionSize,bt="sp-dragging",xt=null,wt=e.ownerDocument,Ct=(wt.body,t(e)),kt=!1,St=t(Z,wt).addClass(U),Tt=St.find(".sp-picker-container"),Et=St.find(".sp-color"),Mt=St.find(".sp-dragger"),Pt=St.find(".sp-hue"),At=St.find(".sp-slider"),Ot=St.find(".sp-alpha-inner"),Lt=St.find(".sp-alpha"),Nt=St.find(".sp-alpha-handle"),Dt=St.find(".sp-input"),It=St.find(".sp-palette"),_t=St.find(".sp-initial"),Ft=St.find(".sp-cancel"),Rt=St.find(".sp-clear"),zt=St.find(".sp-choose"),$t=St.find(".sp-palette-toggle"),Vt=Ct.is("input"),Ht=Vt&&"color"===Ct.attr("type")&&f(),jt=Vt&&!j,Bt=jt?t(J).addClass(U).addClass(H.className).addClass(H.replacerClassName):t([]),Wt=jt?Bt:Ct,Ut=Bt.find(".sp-preview-inner"),qt=H.color||Vt&&Ct.val(),Kt=!1,Gt=H.preferredFormat,Yt=!H.showButtons||H.clickoutFiresChange,Xt=!qt,Jt=H.allowEmpty&&!Ht;u();var Zt={show:k,hide:E,toggle:C,reflow:_,option:R,enable:z,disable:$,offset:V,set:function(t){P(t),I()},get:A,destroy:F,container:St};return Zt.id=G.push(Zt)-1,Zt}function a(e,n){var i=0,r=e.outerWidth(),o=e.outerHeight(),s=n.outerHeight(),a=e[0].ownerDocument,l=a.documentElement,c=l.clientWidth,u=l.clientHeight,h=t(a).scrollLeft(),d=t(a).scrollTop(),f=c+h,p=u+d,g=n.offset();return g.top+=s,g.left-=Math.min(g.left,g.left+r>f&&f>r?Math.abs(g.left+r-f):0),g.top-=Math.min(g.top,g.top+o>p&&p>o?Math.abs(o+s-i):i),g}function l(){}function c(t){t.stopPropagation()}function u(t,e){var n=Array.prototype.slice,i=n.call(arguments,2);return function(){return t.apply(e,i.concat(n.call(arguments)))}}function h(e,n,i,r){function o(t){t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),t.returnValue=!1}function s(t){if(u){if(Y&&c.documentMode<9&&!t.button)return l();var i=t.originalEvent&&t.originalEvent.touches&&t.originalEvent.touches[0],r=i&&i.page
r.defaults="";break;case"background-repeat":r.defaults="repeat";break;case"background-position":r.defaults="left top";break;case"background-attachment":r.defaults="scroll";break;case"transition-property":r.defaults="width";break;case"transition-duration":r.defaults="2";break;case"transition-timing-function":r.defaults="ease";break;case"overflow":r.defaults="visible"}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"min-height":case"min-width":case"max-height":case"max-width":case"width":case"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"box-shadow-h":case"box-shadow-v":r.units=["px","%"];break;case"font-size":case"letter-spacing":case"line-height":r.units=["px","em","rem","%"];break;case"border-width":r.units=["px","em"];break;case"box-shadow-blur":case"box-shadow-spread":case"perspective":r.units=["px"];break;case"transition-duration":r.units=["s"];break;case"transform-rotate-x":case"transform-rotate-y":case"transform-rotate-z":r.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":r.min=0}switch(o){case"text-shadow":case"box-shadow":case"background":r.preview=!0}switch(o){case"background":r.detached=!0}switch(o){case"transform-rotate-x":r.functionName="rotateX";break;case"transform-rotate-y":r.functionName="rotateY";break;case"transform-rotate-z":r.functionName="rotateZ";break;case"transform-scale-x":r.functionName="scaleX";break;case"transform-scale-y":r.functionName="scaleY";break;case"transform-scale-z":r.functionName="scaleZ";break;case"background-image":r.functionName="url"}switch(o){case"float":r.list=[{value:"none"},{value:"left"},{value:"right"}];break;case"display":r.list=[{value:"block"},{value:"inline"},{value:"inline-block"},{value:"none"}];break;case"position":r.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];r.list=[];for(var l=0,c=a.length;l<c;l++){var u={};u.value=a[l],u.name=a[l].split(",")[0],r.list.push(u)}break;case"font-weight":r.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":r.list=[{value:"left"},{value:"center"},{value:"right"},{value:"justify"}];break;case"border-style":r.list=[{value:"none"},{value:"solid"},{value:"dotted"},{value:"dashed"},{value:"double"},{value:"groove"},{value:"ridge"},{value:"inset"},{value:"outset"}];break;case"box-shadow-type":r.list=[{value:"",name:"Outside"},{value:"inset",name:"Inside"}];break;case"background-repeat":r.list=[{value:"repeat"},{value:"repeat-x"},{value:"repeat-y"},{value:"no-repeat"}];break;case"background-position":r.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":r.list=[{value:"scroll"},{value
}n.push(r)}return n}}}},function(t,e,n){"use strict";var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r=n(4);t.exports=r.extend({defaults:i({},r.prototype.defaults,{type:"cell",tagName:"td",draggable:["tr"]})},{isComponent:function(t){var e="",n=t.tagName;return"TD"!=n&&"TH"!=n||(e={type:"cell",tagName:n.toLowerCase()}),e}})},function(t,e,n){"use strict";var i=(n(0),n(3));t.exports=i.extend({})},function(t,e,n){"use strict";var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r=n(4);t.exports=r.extend({defaults:i({},r.prototype.defaults,{type:"row",tagName:"tr",draggable:["thead","tbody","tfoot"],droppable:["th","td"]}),initialize:function(t,e){r.prototype.initialize.apply(this,arguments);var n=[],i=this.get("components");i.each(function(t){return t.is("cell")&&n.push(t)}),i.reset(n)}},{isComponent:function(t){var e="";return"TR"==t.tagName&&(e={type:"row"}),e}})},function(t,e,n){"use strict";var i=(n(0),n(3));t.exports=i.extend({})},function(t,e,n){"use strict";var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r=n(4);t.exports=r.extend({defaults:i({},r.prototype.defaults,{type:"table",tagName:"table",droppable:["tbody","thead","tfoot"]}),initialize:function(t,e){r.prototype.initialize.apply(this,arguments);var n=this.get("components");!n.length&&n.add({type:"tbody"})}},{isComponent:function(t){var e="";return"TABLE"==t.tagName&&(e={type:"table"}),e}})},function(t,e,n){"use strict";var i=(n(0),n(3));t.exports=i.extend({events:{}})},function(t,e,n){"use strict";var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r=n(19);t.exports=r.extend({defaults:i({},r.prototype.defaults,{type:"thead",tagName:"thead"})},{isComponent:function(t){var e="";return"THEAD"==t.tagName&&(e={type:"thead"}),e}})},function(t,e,n){"use strict";var i=(n(0),n(3));t.exports=i.extend({})},function(t,e,n){"use strict";var i=(n(0),n(3));t.exports=i.extend({})},function(t,e,n){"use strict";var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r=n(19);t.exports=r.extend({defaults:i({},r.prototype.defaults,{type:"tfoot",tagName:"tfoot"})},{isComponent:function(t){var e="";return"TFOOT"==t.tagName&&(e={type:"tfoot"}),e}})},function(t,e,n){"use strict";var i=(n(0),n(3));t.exports=i.extend({})},function(t,e,n){"use strict";(function(e){var i=n(20),r=n(4);t.exports=i.extend({defaults:e.extend({},i.prototype.defaults,{type:"map","void":0,mapUrl:"https://maps.google.com/maps",tagName:"iframe",mapType:"q",address:"",zoom:"1",attributes:{frameborder:0},toolbar:r.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(t,e){this.get("src")?this.parseFromSrc():this.updateSrc(),i.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 t=this,e=t.get("address"),n=t.get("zoom"),i=t.get("mapType");e=e?"&q="+e:"",n=n?"&z="+n:"",i=i?"&t="+i:"";var r=t.get("mapUrl")+"?"+e+n+i;return r+="&output=embed"},parseFromSrc:function(){var t=this.parseUri(this.get("src")),e=t.query;e.q&&this.set("address",e.q),e.z&&this.set("zoom",e.z),e.t&&this.set("mapType",e.t)}},{isComponent:function(t){var e="";return"IFRAME"==t.tagName&&/maps\.google\.com/.test(t.src)&&(e={type:"map",src:t.src}),e}})}).call(e,
this.$wrapper=n(this.getCanvasWrapper()),this.frameEl=this.canvas.getFrameEl(),this.canvasTool=this.getCanvasTools(),this.bodyEl=this.getCanvasBody()),this.init(this.config)},onFrameScroll:function(t){},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(t){var e=t.getBoundingClientRect();return{top:e.top+t.ownerDocument.body.scrollTop,left:e.left+t.ownerDocument.body.scrollLeft}},init:function(t){},run:function(t,e){},stop:function(t,e){}})}).call(e,n(0))},function(t,e,n){"use strict";(function(e){var n=e.$;t.exports={run:function(t,e){arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};e&&e.set&&e.set("active",0);var i=t.getConfig(),r=t.Modal,o=i.stylePrefix;if(this.cm=t.CodeManager||null,!this.$editors){var s=this.buildEditor("htmlmixed","hopscotch","HTML"),a=this.buildEditor("css","hopscotch","CSS");this.htmlEditor=s.el,this.cssEditor=a.el;var l=n('<div class="'+o+'export-dl"></div>');l.append(s.$el).append(a.$el),this.$editors=l}r.setTitle(i.textViewCode),r.setContent(this.$editors),r.open(),this.htmlEditor.setContent(t.getHtml()),this.cssEditor.setContent(t.getCss())},stop:function(t){var e=t.Modal;e&&e.close()},buildEditor:function(t,e,n){var i=document.createElement("textarea");!this.codeMirror&&(this.codeMirror=this.cm.getViewer("CodeMirror"));var r=this.codeMirror.clone().set({label:n,codeName:t,theme:e,input:i}),o=new this.cm.EditorView({model:r,config:this.cm.getConfig()}).render().$el;return r.init(i),{el:r,$el:o}}}}).call(e,n(0))},function(t,e,n){"use strict";var i=(n(0),n(49)),r=n(188);t.exports=i.extend({itemView:r,initialize:function(t){this.config={editor:t.editor||""},this.listenTo(this.collection,"reset",this.render)}})},function(t,e,n){"use strict";var i=n(0);t.exports=i.View.extend({events:function(){return this.model.get("events")||{mousedown:"handleClick"}},attributes:function(){return this.model.get("attributes")},initialize:function(t){this.editor=t.config.editor},handleClick:function(t){t.preventDefault(),t.stopPropagation(),this.execCommand(t)},execCommand:function(t){var e={event:t},n=this.model.get("command"),i=this.editor;"function"==typeof n&&n(i,null,e),"string"==typeof n&&i.runCommand(n,e)},render:function(){var t=this.editor.getConfig();return this.el.className+=" "+t.stylePrefix+"toolbar-item",this}})},function(t,e,n){"use strict";var i=n(0),r=n(190);t.exports=i.Collection.extend({model:r})},function(t,e,n){"use strict";var i=n(0);t.exports=i.Model.extend({defaults:{command:"",attributes:{}}})},function(t,e,n){"use strict";(function(e,i){var r=n(21),o=e.$;t.exports=i.extend({},r,{init:function(t){i.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(t){t.stopPropagation();var e=o(t.target);e.data("model").get("removable")&&(e.addClass(this.hoverClass),this.attachBadge(e.get(0)))},stopDelete:function(t){t.stopPropagation();var e=o(t.target);e.removeClass(this.hoverClass),this.badge&&this.badge.css({left:-1e3,top:-1e3})},onDelete:function(t){t.stopPropagation();var e=o(t.target);e.data("model").get("removable")&&(e.data("model").destroy(),this.removeBadge(),this.clean())},updateBadgeLabel:function(t){this.badge.html("Remove "+t.getName())}})}).call(e,n(0),n(1))},function(t,e,n){"use strict";(function(e){var i=(n(0),n(55));t.exports=e.extend({},i,{beforeInsert:function(t){t.type="image",t.style={},t.attributes={},t.attributes.onmousedown="return false",this.config.firstCentered&&this.getCanvasWrapper()==this.sorter.target&&(t.style.margin="0 auto")},afterInsert:function(t){t.trigger("dblclick"),this.sender&&this.sender.set("active",!1)}})}).call(e,n(1))},function(t,e,n){"use strict";(function(e,i){var r=n(2),o=n(21),s=n(54),a=e.$;t.exports=i.extend({},s,o,{init:function(t){o.init.ap
2018-01-30 19:58:55 +01:00
//# sourceMappingURL=grapesjs.min.js.map