UNPKG

grapesjs

Version:

Free and Open Source Web Builder Framework

2 lines 686 kB
/*! grapesjs - 0.15.3 */ !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()}(window,function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=85)}([function(t,e,n){(function(t,n){var r;!function(){var i="object"==typeof self&&self.self===self&&self||"object"==typeof t&&t.global===t&&t||this||{},o=i._,a=Array.prototype,s=Object.prototype,l="undefined"!=typeof Symbol?Symbol.prototype:null,c=a.push,u=a.slice,h=s.toString,d=s.hasOwnProperty,f=Array.isArray,p=Object.keys,g=Object.create,v=function(){},m=function(t){return t instanceof m?t:this instanceof m?void(this._wrapped=t):new m(t)};e.nodeType?i._=m:(!n.nodeType&&n.exports&&(e=n.exports=m),e._=m),m.VERSION="1.9.1";var y,b=function(t,e,n){if(void 0===e)return t;switch(null==n?3:n){case 1:return function(n){return t.call(e,n)};case 3:return function(n,r,i){return t.call(e,n,r,i)};case 4:return function(n,r,i,o){return t.call(e,n,r,i,o)}}return function(){return t.apply(e,arguments)}},w=function(t,e,n){return m.iteratee!==y?m.iteratee(t,e):null==t?m.identity:m.isFunction(t)?b(t,e,n):m.isObject(t)&&!m.isArray(t)?m.matcher(t):m.property(t)};m.iteratee=y=function(t,e){return w(t,e,1/0)};var x=function(t,e){return e=null==e?t.length-1:+e,function(){for(var n=Math.max(arguments.length-e,0),r=Array(n),i=0;i<n;i++)r[i]=arguments[i+e];switch(e){case 0:return t.call(this,r);case 1:return t.call(this,arguments[0],r);case 2:return t.call(this,arguments[0],arguments[1],r)}var o=Array(e+1);for(i=0;i<e;i++)o[i]=arguments[i];return o[e]=r,t.apply(this,o)}},C=function(t){if(!m.isObject(t))return{};if(g)return g(t);v.prototype=t;var e=new v;return v.prototype=null,e},O=function(t){return function(e){return null==e?void 0:e[t]}},k=function(t,e){return null!=t&&d.call(t,e)},S=function(t,e){for(var n=e.length,r=0;r<n;r++){if(null==t)return;t=t[e[r]]}return n?t:void 0},T=Math.pow(2,53)-1,P=O("length"),E=function(t){var e=P(t);return"number"==typeof e&&e>=0&&e<=T};m.each=m.forEach=function(t,e,n){var r,i;if(e=b(e,n),E(t))for(r=0,i=t.length;r<i;r++)e(t[r],r,t);else{var o=m.keys(t);for(r=0,i=o.length;r<i;r++)e(t[o[r]],o[r],t)}return t},m.map=m.collect=function(t,e,n){e=w(e,n);for(var r=!E(t)&&m.keys(t),i=(r||t).length,o=Array(i),a=0;a<i;a++){var s=r?r[a]:a;o[a]=e(t[s],s,t)}return o};var j=function(t){var e=function(e,n,r,i){var o=!E(e)&&m.keys(e),a=(o||e).length,s=t>0?0:a-1;for(i||(r=e[o?o[s]:s],s+=t);s>=0&&s<a;s+=t){var l=o?o[s]:s;r=n(r,e[l],l,e)}return r};return function(t,n,r,i){var o=arguments.length>=3;return e(t,b(n,i,4),r,o)}};m.reduce=m.foldl=m.inject=j(1),m.reduceRight=m.foldr=j(-1),m.find=m.detect=function(t,e,n){var r=(E(t)?m.findIndex:m.findKey)(t,e,n);if(void 0!==r&&-1!==r)return t[r]},m.filter=m.select=function(t,e,n){var r=[];return e=w(e,n),m.each(t,function(t,n,i){e(t,n,i)&&r.push(t)}),r},m.reject=function(t,e,n){return m.filter(t,m.negate(w(e)),n)},m.every=m.all=function(t,e,n){e=w(e,n);for(var r=!E(t)&&m.keys(t),i=(r||t).length,o=0;o<i;o++){var a=r?r[o]:o;if(!e(t[a],a,t))return!1}return!0},m.some=m.any=function(t,e,n){e=w(e,n);for(var r=!E(t)&&m.keys(t),i=(r||t).length,o=0;o<i;o++){var a=r?r[o]:o;if(e(t[a],a,t))return!0}return!1},m.contains=m.includes=m.include=function(t,e,n,r){return E(t)||(t=m.values(t)),("number"!=typeof n||r)&&(n=0),m.indexOf(t,e,n)>=0},m.invoke=x(function(t,e,n){var r,i;return m.isFunction(e)?i=e:m.isArray(e)&&(r=e.slice(0,-1),e=e[e.length-1]),m.map(t,function(t){var o=i;if(!o){if(r&&r.length&&(t=S(t,r)),null==t)return;o=t[e]}return null==o?o:o.apply(t,n)})}),m.pluck=function(t,e){return m.map(t,m.property(e))},m.where=function(t,e){return m.filter(t,m.matcher(e))},m.findWhere=function(t,e){return m.find(t,m.matcher(e))},m.max=function(t,e,n){var r,i,o=-1/0,a=-1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var s=0,l=(t=E(t)?t:m.values(t)).length;s<l;s++)null!=(r=t[s])&&r>o&&(o=r);else e=w(e,n),m.each(t,function(t,n,r){((i=e(t,n,r))>a||i===-1/0&&o===-1/0)&&(o=t,a=i)});return o},m.min=function(t,e,n){var r,i,o=1/0,a=1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var s=0,l=(t=E(t)?t:m.values(t)).length;s<l;s++)null!=(r=t[s])&&r<o&&(o=r);else e=w(e,n),m.each(t,function(t,n,r){((i=e(t,n,r))<a||i===1/0&&o===1/0)&&(o=t,a=i)});return o},m.shuffle=function(t){return m.sample(t,1/0)},m.sample=function(t,e,n){if(null==e||n)return E(t)||(t=m.values(t)),t[m.random(t.length-1)];var r=E(t)?m.clone(t):m.values(t),i=P(r);e=Math.max(Math.min(e,i),0);for(var o=i-1,a=0;a<e;a++){var s=m.random(a,o),l=r[a];r[a]=r[s],r[s]=l}return r.slice(0,e)},m.sortBy=function(t,e,n){var r=0;return e=w(e,n),m.pluck(m.map(t,function(t,n,i){return{value:t,index:r++,criteria:e(t,n,i)}}).sort(function(t,e){var n=t.criteria,r=e.criteria;if(n!==r){if(n>r||void 0===n)return 1;if(n<r||void 0===r)return-1}return t.index-e.index}),"value")};var M=function(t,e){return function(n,r,i){var o=e?[[],[]]:{};return r=w(r,i),m.each(n,function(e,i){var a=r(e,i,n);t(o,e,a)}),o}};m.groupBy=M(function(t,e,n){k(t,n)?t[n].push(e):t[n]=[e]}),m.indexBy=M(function(t,e,n){t[n]=e}),m.countBy=M(function(t,e,n){k(t,n)?t[n]++:t[n]=1});var D=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;m.toArray=function(t){return t?m.isArray(t)?u.call(t):m.isString(t)?t.match(D):E(t)?m.map(t,m.identity):m.values(t):[]},m.size=function(t){return null==t?0:E(t)?t.length:m.keys(t).length},m.partition=M(function(t,e,n){t[n?0:1].push(e)},!0),m.first=m.head=m.take=function(t,e,n){return null==t||t.length<1?null==e?void 0:[]:null==e||n?t[0]:m.initial(t,t.length-e)},m.initial=function(t,e,n){return u.call(t,0,Math.max(0,t.length-(null==e||n?1:e)))},m.last=function(t,e,n){return null==t||t.length<1?null==e?void 0:[]:null==e||n?t[t.length-1]:m.rest(t,Math.max(0,t.length-e))},m.rest=m.tail=m.drop=function(t,e,n){return u.call(t,null==e||n?1:e)},m.compact=function(t){return m.filter(t,Boolean)};var A=function(t,e,n,r){for(var i=(r=r||[]).length,o=0,a=P(t);o<a;o++){var s=t[o];if(E(s)&&(m.isArray(s)||m.isArguments(s)))if(e)for(var l=0,c=s.length;l<c;)r[i++]=s[l++];else A(s,e,n,r),i=r.length;else n||(r[i++]=s)}return r};m.flatten=function(t,e){return A(t,e,!1)},m.without=x(function(t,e){return m.difference(t,e)}),m.uniq=m.unique=function(t,e,n,r){m.isBoolean(e)||(r=n,n=e,e=!1),null!=n&&(n=w(n,r));for(var i=[],o=[],a=0,s=P(t);a<s;a++){var l=t[a],c=n?n(l,a,t):l;e&&!n?(a&&o===c||i.push(l),o=c):n?m.contains(o,c)||(o.push(c),i.push(l)):m.contains(i,l)||i.push(l)}return i},m.union=x(function(t){return m.uniq(A(t,!0,!0))}),m.intersection=function(t){for(var e=[],n=arguments.length,r=0,i=P(t);r<i;r++){var o=t[r];if(!m.contains(e,o)){var a;for(a=1;a<n&&m.contains(arguments[a],o);a++);a===n&&e.push(o)}}return e},m.difference=x(function(t,e){return e=A(e,!0,!0),m.filter(t,function(t){return!m.contains(e,t)})}),m.unzip=function(t){for(var e=t&&m.max(t,P).length||0,n=Array(e),r=0;r<e;r++)n[r]=m.pluck(t,r);return n},m.zip=x(m.unzip),m.object=function(t,e){for(var n={},r=0,i=P(t);r<i;r++)e?n[t[r]]=e[r]:n[t[r][0]]=t[r][1];return n};var L=function(t){return function(e,n,r){n=w(n,r);for(var i=P(e),o=t>0?0:i-1;o>=0&&o<i;o+=t)if(n(e[o],o,e))return o;return-1}};m.findIndex=L(1),m.findLastIndex=L(-1),m.sortedIndex=function(t,e,n,r){for(var i=(n=w(n,r,1))(e),o=0,a=P(t);o<a;){var s=Math.floor((o+a)/2);n(t[s])<i?o=s+1:a=s}return o};var N=function(t,e,n){return function(r,i,o){var a=0,s=P(r);if("number"==typeof o)t>0?a=o>=0?o:Math.max(o+s,a):s=o>=0?Math.min(o+1,s):o+s+1;else if(n&&o&&s)return r[o=n(r,i)]===i?o:-1;if(i!=i)return(o=e(u.call(r,a,s),m.isNaN))>=0?o+a:-1;for(o=t>0?a:s-1;o>=0&&o<s;o+=t)if(r[o]===i)return o;return-1}};m.indexOf=N(1,m.findIndex,m.sortedIndex),m.lastIndexOf=N(-1,m.findLastIndex),m.range=function(t,e,n){null==e&&(e=t||0,t=0),n||(n=e<t?-1:1);for(var r=Math.max(Math.ceil((e-t)/n),0),i=Array(r),o=0;o<r;o++,t+=n)i[o]=t;return i},m.chunk=function(t,e){if(null==e||e<1)return[];for(var n=[],r=0,i=t.length;r<i;)n.push(u.call(t,r,r+=e));return n};var I=function(t,e,n,r,i){if(!(r instanceof e))return t.apply(n,i);var o=C(t.prototype),a=t.apply(o,i);return m.isObject(a)?a:o};m.bind=x(function(t,e,n){if(!m.isFunction(t))throw new TypeError("Bind must be called on a function");var r=x(function(i){return I(t,r,e,this,n.concat(i))});return r}),m.partial=x(function(t,e){var n=m.partial.placeholder,r=function(){for(var i=0,o=e.length,a=Array(o),s=0;s<o;s++)a[s]=e[s]===n?arguments[i++]:e[s];for(;i<arguments.length;)a.push(arguments[i++]);return I(t,r,this,this,a)};return r}),m.partial.placeholder=m,m.bindAll=x(function(t,e){var n=(e=A(e,!1,!1)).length;if(n<1)throw new Error("bindAll must be passed function names");for(;n--;){var r=e[n];t[r]=m.bind(t[r],t)}}),m.memoize=function(t,e){var n=function(r){var i=n.cache,o=""+(e?e.apply(this,arguments):r);return k(i,o)||(i[o]=t.apply(this,arguments)),i[o]};return n.cache={},n},m.delay=x(function(t,e,n){return setTimeout(function(){return t.apply(null,n)},e)}),m.defer=m.partial(m.delay,m,1),m.throttle=function(t,e,n){var r,i,o,a,s=0;n||(n={});var l=function(){s=!1===n.leading?0:m.now(),r=null,a=t.apply(i,o),r||(i=o=null)},c=function(){var c=m.now();s||!1!==n.leading||(s=c);var u=e-(c-s);return i=this,o=arguments,u<=0||u>e?(r&&(clearTimeout(r),r=null),s=c,a=t.apply(i,o),r||(i=o=null)):r||!1===n.trailing||(r=setTimeout(l,u)),a};return c.cancel=function(){clearTimeout(r),s=0,r=i=o=null},c},m.debounce=function(t,e,n){var r,i,o=function(e,n){r=null,n&&(i=t.apply(e,n))},a=x(function(a){if(r&&clearTimeout(r),n){var s=!r;r=setTimeout(o,e),s&&(i=t.apply(this,a))}else r=m.delay(o,e,this,a);return i});return a.cancel=function(){clearTimeout(r),r=null},a},m.wrap=function(t,e){return m.partial(e,t)},m.negate=function(t){return function(){return!t.apply(this,arguments)}},m.compose=function(){var t=arguments,e=t.length-1;return function(){for(var n=e,r=t[e].apply(this,arguments);n--;)r=t[n].call(this,r);return r}},m.after=function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},m.before=function(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}},m.once=m.partial(m.before,2),m.restArguments=x;var F=!{toString:null}.propertyIsEnumerable("toString"),R=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],V=function(t,e){var n=R.length,r=t.constructor,i=m.isFunction(r)&&r.prototype||s,o="constructor";for(k(t,o)&&!m.contains(e,o)&&e.push(o);n--;)(o=R[n])in t&&t[o]!==i[o]&&!m.contains(e,o)&&e.push(o)};m.keys=function(t){if(!m.isObject(t))return[];if(p)return p(t);var e=[];for(var n in t)k(t,n)&&e.push(n);return F&&V(t,e),e},m.allKeys=function(t){if(!m.isObject(t))return[];var e=[];for(var n in t)e.push(n);return F&&V(t,e),e},m.values=function(t){for(var e=m.keys(t),n=e.length,r=Array(n),i=0;i<n;i++)r[i]=t[e[i]];return r},m.mapObject=function(t,e,n){e=w(e,n);for(var r=m.keys(t),i=r.length,o={},a=0;a<i;a++){var s=r[a];o[s]=e(t[s],s,t)}return o},m.pairs=function(t){for(var e=m.keys(t),n=e.length,r=Array(n),i=0;i<n;i++)r[i]=[e[i],t[e[i]]];return r},m.invert=function(t){for(var e={},n=m.keys(t),r=0,i=n.length;r<i;r++)e[t[n[r]]]=n[r];return e},m.functions=m.methods=function(t){var e=[];for(var n in t)m.isFunction(t[n])&&e.push(n);return e.sort()};var _=function(t,e){return function(n){var r=arguments.length;if(e&&(n=Object(n)),r<2||null==n)return n;for(var i=1;i<r;i++)for(var o=arguments[i],a=t(o),s=a.length,l=0;l<s;l++){var c=a[l];e&&void 0!==n[c]||(n[c]=o[c])}return n}};m.extend=_(m.allKeys),m.extendOwn=m.assign=_(m.keys),m.findKey=function(t,e,n){e=w(e,n);for(var r,i=m.keys(t),o=0,a=i.length;o<a;o++)if(e(t[r=i[o]],r,t))return r};var z,H,$=function(t,e,n){return e in n};m.pick=x(function(t,e){var n={},r=e[0];if(null==t)return n;m.isFunction(r)?(e.length>1&&(r=b(r,e[1])),e=m.allKeys(t)):(r=$,e=A(e,!1,!1),t=Object(t));for(var i=0,o=e.length;i<o;i++){var a=e[i],s=t[a];r(s,a,t)&&(n[a]=s)}return n}),m.omit=x(function(t,e){var n,r=e[0];return m.isFunction(r)?(r=m.negate(r),e.length>1&&(n=e[1])):(e=m.map(A(e,!1,!1),String),r=function(t,n){return!m.contains(e,n)}),m.pick(t,r,n)}),m.defaults=_(m.allKeys,!0),m.create=function(t,e){var n=C(t);return e&&m.extendOwn(n,e),n},m.clone=function(t){return m.isObject(t)?m.isArray(t)?t.slice():m.extend({},t):t},m.tap=function(t,e){return e(t),t},m.isMatch=function(t,e){var n=m.keys(e),r=n.length;if(null==t)return!r;for(var i=Object(t),o=0;o<r;o++){var a=n[o];if(e[a]!==i[a]||!(a in i))return!1}return!0},z=function(t,e,n,r){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return!1;if(t!=t)return e!=e;var i=typeof t;return("function"===i||"object"===i||"object"==typeof e)&&H(t,e,n,r)},H=function(t,e,n,r){t instanceof m&&(t=t._wrapped),e instanceof m&&(e=e._wrapped);var i=h.call(t);if(i!==h.call(e))return!1;switch(i){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;case"[object Symbol]":return l.valueOf.call(t)===l.valueOf.call(e)}var o="[object Array]"===i;if(!o){if("object"!=typeof t||"object"!=typeof e)return!1;var a=t.constructor,s=e.constructor;if(a!==s&&!(m.isFunction(a)&&a instanceof a&&m.isFunction(s)&&s instanceof s)&&"constructor"in t&&"constructor"in e)return!1}r=r||[];for(var c=(n=n||[]).length;c--;)if(n[c]===t)return r[c]===e;if(n.push(t),r.push(e),o){if((c=t.length)!==e.length)return!1;for(;c--;)if(!z(t[c],e[c],n,r))return!1}else{var u,d=m.keys(t);if(c=d.length,m.keys(e).length!==c)return!1;for(;c--;)if(u=d[c],!k(e,u)||!z(t[u],e[u],n,r))return!1}return n.pop(),r.pop(),!0},m.isEqual=function(t,e){return z(t,e)},m.isEmpty=function(t){return null==t||(E(t)&&(m.isArray(t)||m.isString(t)||m.isArguments(t))?0===t.length:0===m.keys(t).length)},m.isElement=function(t){return!(!t||1!==t.nodeType)},m.isArray=f||function(t){return"[object Array]"===h.call(t)},m.isObject=function(t){var e=typeof t;return"function"===e||"object"===e&&!!t},m.each(["Arguments","Function","String","Number","Date","RegExp","Error","Symbol","Map","WeakMap","Set","WeakSet"],function(t){m["is"+t]=function(e){return h.call(e)==="[object "+t+"]"}}),m.isArguments(arguments)||(m.isArguments=function(t){return k(t,"callee")});var W=i.document&&i.document.childNodes;"object"!=typeof Int8Array&&"function"!=typeof W&&(m.isFunction=function(t){return"function"==typeof t||!1}),m.isFinite=function(t){return!m.isSymbol(t)&&isFinite(t)&&!isNaN(parseFloat(t))},m.isNaN=function(t){return m.isNumber(t)&&isNaN(t)},m.isBoolean=function(t){return!0===t||!1===t||"[object Boolean]"===h.call(t)},m.isNull=function(t){return null===t},m.isUndefined=function(t){return void 0===t},m.has=function(t,e){if(!m.isArray(e))return k(t,e);for(var n=e.length,r=0;r<n;r++){var i=e[r];if(null==t||!d.call(t,i))return!1;t=t[i]}return!!n},m.noConflict=function(){return i._=o,this},m.identity=function(t){return t},m.constant=function(t){return function(){return t}},m.noop=function(){},m.property=function(t){return m.isArray(t)?function(e){return S(e,t)}:O(t)},m.propertyOf=function(t){return null==t?function(){}:function(e){return m.isArray(e)?S(t,e):t[e]}},m.matcher=m.matches=function(t){return t=m.extendOwn({},t),function(e){return m.isMatch(e,t)}},m.times=function(t,e,n){var r=Array(Math.max(0,t));e=b(e,n,1);for(var i=0;i<t;i++)r[i]=e(i);return r},m.random=function(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))},m.now=Date.now||function(){return(new Date).getTime()};var B={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},U=m.invert(B),q=function(t){var e=function(e){return t[e]},n="(?:"+m.keys(t).join("|")+")",r=RegExp(n),i=RegExp(n,"g");return function(t){return t=null==t?"":""+t,r.test(t)?t.replace(i,e):t}};m.escape=q(B),m.unescape=q(U),m.result=function(t,e,n){m.isArray(e)||(e=[e]);var r=e.length;if(!r)return m.isFunction(n)?n.call(t):n;for(var i=0;i<r;i++){var o=null==t?void 0:t[e[i]];void 0===o&&(o=n,i=r),t=m.isFunction(o)?o.call(t):o}return t};var G=0;m.uniqueId=function(t){var e=++G+"";return t?t+e:e},m.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var K=/(.)^/,Y={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},X=/\\|'|\r|\n|\u2028|\u2029/g,J=function(t){return"\\"+Y[t]};m.template=function(t,e,n){!e&&n&&(e=n),e=m.defaults({},e,m.templateSettings);var r,i=RegExp([(e.escape||K).source,(e.interpolate||K).source,(e.evaluate||K).source].join("|")+"|$","g"),o=0,a="__p+='";t.replace(i,function(e,n,r,i,s){return a+=t.slice(o,s).replace(X,J),o=s+e.length,n?a+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?a+="'+\n((__t=("+r+"))==null?'':__t)+\n'":i&&(a+="';\n"+i+"\n__p+='"),e}),a+="';\n",e.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{r=new Function(e.variable||"obj","_",a)}catch(t){throw t.source=a,t}var s=function(t){return r.call(this,t,m)},l=e.variable||"obj";return s.source="function("+l+"){\n"+a+"}",s},m.chain=function(t){var e=m(t);return e._chain=!0,e};var Z=function(t,e){return t._chain?m(e).chain():e};m.mixin=function(t){return m.each(m.functions(t),function(e){var n=m[e]=t[e];m.prototype[e]=function(){var t=[this._wrapped];return c.apply(t,arguments),Z(this,n.apply(m,t))}}),m},m.mixin(m),m.each(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=a[t];m.prototype[t]=function(){var n=this._wrapped;return e.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0],Z(this,n)}}),m.each(["concat","join","slice"],function(t){var e=a[t];m.prototype[t]=function(){return Z(this,e.apply(this._wrapped,arguments))}}),m.prototype.value=function(){return this._wrapped},m.prototype.valueOf=m.prototype.toJSON=m.prototype.value,m.prototype.toString=function(){return String(this._wrapped)},void 0===(r=function(){return m}.apply(e,[]))||(n.exports=r)}()}).call(this,n(23),n(66)(t))},function(t,e,n){(function(r){var i,o,a;a="object"==typeof self&&self.self===self&&self||"object"==typeof r&&r.global===r&&r,i=[n(0),n(20),e],void 0===(o=function(t,e,n){a.Backbone=function(t,e,n,r){var i=t.Backbone,o=Array.prototype.slice;e.VERSION="1.3.3",e.$=r,e.noConflict=function(){return t.Backbone=i,this},e.emulateHTTP=!1,e.emulateJSON=!1;var a=function(t,e,r){n.each(e,function(e,i){n[i]&&(t.prototype[i]=function(t,e,r){switch(t){case 1:return function(){return n[e](this[r])};case 2:return function(t){return n[e](this[r],t)};case 3:return function(t,i){return n[e](this[r],s(t,this),i)};case 4:return function(t,i,o){return n[e](this[r],s(t,this),i,o)};default:return function(){var t=o.call(arguments);return t.unshift(this[r]),n[e].apply(n,t)}}}(e,i,r))})},s=function(t,e){return n.isFunction(t)?t:n.isObject(t)&&!e._isModel(t)?l(t):n.isString(t)?function(e){return e.get(t)}:t},l=function(t){var e=n.matches(t);return function(t){return e(t.attributes)}},c=e.Events={},u=/\s+/,h=function(t,e,r,i,o){var a,s=0;if(r&&"object"==typeof r){void 0!==i&&"context"in o&&void 0===o.context&&(o.context=i);for(a=n.keys(r);s<a.length;s++)e=h(t,e,a[s],r[a[s]],o)}else if(r&&u.test(r))for(a=r.split(u);s<a.length;s++)e=t(e,a[s],i,o);else e=t(e,r,i,o);return e};c.on=function(t,e,n){return d(this,t,e,n)};var d=function(t,e,n,r,i){return t._events=h(f,t._events||{},e,n,{context:r,ctx:t,listening:i}),i&&((t._listeners||(t._listeners={}))[i.id]=i),t};c.listenTo=function(t,e,r){if(!t)return this;var i=t._listenId||(t._listenId=n.uniqueId("l")),o=this._listeningTo||(this._listeningTo={}),a=o[i];if(!a){var s=this._listenId||(this._listenId=n.uniqueId("l"));a=o[i]={obj:t,objId:i,id:s,listeningTo:o,count:0}}return d(t,e,r,this,a),this};var f=function(t,e,n,r){if(n){var i=t[e]||(t[e]=[]),o=r.context,a=r.ctx,s=r.listening;s&&s.count++,i.push({callback:n,context:o,ctx:o||a,listening:s})}return t};c.off=function(t,e,n){return this._events?(this._events=h(p,this._events,t,e,{context:n,listeners:this._listeners}),this):this},c.stopListening=function(t,e,r){var i=this._listeningTo;if(!i)return this;for(var o=t?[t._listenId]:n.keys(i),a=0;a<o.length;a++){var s=i[o[a]];if(!s)break;s.obj.off(e,r,this)}return this};var p=function(t,e,r,i){if(t){var o,a=0,s=i.context,l=i.listeners;if(e||r||s){for(var c=e?[e]:n.keys(t);a<c.length;a++){var u=t[e=c[a]];if(!u)break;for(var h=[],d=0;d<u.length;d++){var f=u[d];r&&r!==f.callback&&r!==f.callback._callback||s&&s!==f.context?h.push(f):(o=f.listening)&&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);a<p.length;a++)delete l[(o=l[p[a]]).id],delete o.listeningTo[o.objId]}};c.once=function(t,e,r){var i=h(g,{},t,e,n.bind(this.off,this));return"string"==typeof t&&null==r&&(e=void 0),this.on(i,e,r)},c.listenToOnce=function(t,e,r){var i=h(g,{},e,r,n.bind(this.stopListening,this,t));return this.listenTo(t,i)};var g=function(t,e,r,i){if(r){var o=t[e]=n.once(function(){i(e,o),r.apply(this,arguments)});o._callback=r}return t};c.trigger=function(t){if(!this._events)return this;for(var e=Math.max(0,arguments.length-1),n=Array(e),r=0;r<e;r++)n[r]=arguments[r+1];return h(v,this._events,t,void 0,n),this};var v=function(t,e,n,r){if(t){var i=t[e],o=t.all;i&&o&&(o=o.slice()),i&&m(i,r),o&&m(o,[e].concat(r))}return t},m=function(t,e){var n,r=-1,i=t.length,o=e[0],a=e[1],s=e[2];switch(e.length){case 0:for(;++r<i;)(n=t[r]).callback.call(n.ctx);return;case 1:for(;++r<i;)(n=t[r]).callback.call(n.ctx,o);return;case 2:for(;++r<i;)(n=t[r]).callback.call(n.ctx,o,a);return;case 3:for(;++r<i;)(n=t[r]).callback.call(n.ctx,o,a,s);return;default:for(;++r<i;)(n=t[r]).callback.apply(n.ctx,e);return}};c.bind=c.on,c.unbind=c.off,n.extend(e,c);var y=e.Model=function(t,e){var r=t||{};e||(e={}),this.cid=n.uniqueId(this.cidPrefix),this.attributes={},e.collection&&(this.collection=e.collection),e.parse&&(r=this.parse(r,e)||{});var i=n.result(this,"defaults");r=n.defaults(n.extend({},i,r),i),this.set(r,e),this.changed={},this.initialize.apply(this,arguments)};n.extend(y.prototype,c,{changed:null,validationError:null,idAttribute:"id",cidPrefix:"c",initialize:function(){},toJSON:function(t){return n.clone(this.attributes)},sync:function(){return e.sync.apply(this,arguments)},get:function(t){return this.attributes[t]},escape:function(t){return n.escape(this.get(t))},has:function(t){return null!=this.get(t)},matches:function(t){return!!n.iteratee(t,this)(this.attributes)},set:function(t,e,r){if(null==t)return this;var i;if("object"==typeof t?(i=t,r=e):(i={})[t]=e,r||(r={}),!this._validate(i,r))return!1;var o=r.unset,a=r.silent,s=[],l=this._changing;this._changing=!0,l||(this._previousAttributes=n.clone(this.attributes),this.changed={});var c=this.attributes,u=this.changed,h=this._previousAttributes;for(var d in i)e=i[d],n.isEqual(c[d],e)||s.push(d),n.isEqual(h[d],e)?delete u[d]:u[d]=e,o?delete c[d]:c[d]=e;if(this.idAttribute in i&&(this.id=this.get(this.idAttribute)),!a){s.length&&(this._pending=r);for(var f=0;f<s.length;f++)this.trigger("change:"+s[f],this,c[s[f]],r)}if(l)return this;if(!a)for(;this._pending;)r=this._pending,this._pending=!1,this.trigger("change",this,r);return this._pending=!1,this._changing=!1,this},unset:function(t,e){return this.set(t,void 0,n.extend({},e,{unset:!0}))},clear:function(t){var e={};for(var r in this.attributes)e[r]=void 0;return this.set(e,n.extend({},t,{unset:!0}))},hasChanged:function(t){return null==t?!n.isEmpty(this.changed):n.has(this.changed,t)},changedAttributes:function(t){if(!t)return!!this.hasChanged()&&n.clone(this.changed);var e=this._changing?this._previousAttributes:this.attributes,r={};for(var i in t){var o=t[i];n.isEqual(e[i],o)||(r[i]=o)}return!!n.size(r)&&r},previous:function(t){return null!=t&&this._previousAttributes?this._previousAttributes[t]:null},previousAttributes:function(){return n.clone(this._previousAttributes)},fetch:function(t){t=n.extend({parse:!0},t);var e=this,r=t.success;return t.success=function(n){var i=t.parse?e.parse(n,t):n;if(!e.set(i,t))return!1;r&&r.call(t.context,e,n,t),e.trigger("sync",e,n,t)},R(this,t),this.sync("read",this,t)},save:function(t,e,r){var i;null==t||"object"==typeof t?(i=t,r=e):(i={})[t]=e;var o=(r=n.extend({validate:!0,parse:!0},r)).wait;if(i&&!o){if(!this.set(i,r))return!1}else if(!this._validate(i,r))return!1;var a=this,s=r.success,l=this.attributes;r.success=function(t){a.attributes=l;var e=r.parse?a.parse(t,r):t;if(o&&(e=n.extend({},i,e)),e&&!a.set(e,r))return!1;s&&s.call(r.context,a,t,r),a.trigger("sync",a,t,r)},R(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(t){t=t?n.clone(t):{};var e=this,r=t.success,i=t.wait,o=function(){e.stopListening(),e.trigger("destroy",e,e.collection,t)};t.success=function(n){i&&o(),r&&r.call(t.context,e,n,t),e.isNew()||e.trigger("sync",e,n,t)};var a=!1;return this.isNew()?n.defer(t.success):(R(this,t),a=this.sync("delete",this,t)),i||o(),a},url:function(){var t=n.result(this,"urlRoot")||n.result(this.collection,"url")||F();if(this.isNew())return t;var e=this.get(this.idAttribute);return t.replace(/[^\/]$/,"$&/")+encodeURIComponent(e)},parse:function(t,e){return t},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.has(this.idAttribute)},isValid:function(t){return this._validate({},n.extend({},t,{validate:!0}))},_validate:function(t,e){if(!e.validate||!this.validate)return!0;t=n.extend({},this.attributes,t);var r=this.validationError=this.validate(t,e)||null;return!r||(this.trigger("invalid",this,r,n.extend(e,{validationError:r})),!1)}}),a(y,{keys:1,values:1,pairs:1,invert:1,pick:0,omit:0,chain:1,isEmpty:1},"attributes");var b=e.Collection=function(t,e){e||(e={}),e.model&&(this.model=e.model),void 0!==e.comparator&&(this.comparator=e.comparator),this._reset(),this.initialize.apply(this,arguments),t&&this.reset(t,n.extend({silent:!0},e))},w={add:!0,remove:!0,merge:!0},x={add:!0,remove:!1},C=function(t,e,n){n=Math.min(Math.max(n,0),t.length);var r,i=Array(t.length-n),o=e.length;for(r=0;r<i.length;r++)i[r]=t[r+n];for(r=0;r<o;r++)t[r+n]=e[r];for(r=0;r<i.length;r++)t[r+o+n]=i[r]};n.extend(b.prototype,c,{model:y,initialize:function(){},toJSON:function(t){return this.map(function(e){return e.toJSON(t)})},sync:function(){return e.sync.apply(this,arguments)},add:function(t,e){return this.set(t,n.extend({merge:!1},e,x))},remove:function(t,e){e=n.extend({},e);var r=!n.isArray(t);t=r?[t]:t.slice();var i=this._removeModels(t,e);return!e.silent&&i.length&&(e.changes={added:[],merged:[],removed:i},this.trigger("update",this,e)),r?i[0]:i},set:function(t,e){if(null!=t){(e=n.extend({},w,e)).parse&&!this._isModel(t)&&(t=this.parse(t,e)||[]);var r=!n.isArray(t);t=r?[t]:t.slice();var i=e.at;null!=i&&(i=+i),i>this.length&&(i=this.length),i<0&&(i+=this.length+1);var o,a,s=[],l=[],c=[],u=[],h={},d=e.add,f=e.merge,p=e.remove,g=!1,v=this.comparator&&null==i&&!1!==e.sort,m=n.isString(this.comparator)?this.comparator:null;for(a=0;a<t.length;a++){o=t[a];var y=this.get(o);if(y){if(f&&o!==y){var b=this._isModel(o)?o.attributes:o;e.parse&&(b=y.parse(b,e)),y.set(b,e),c.push(y),v&&!g&&(g=y.hasChanged(m))}h[y.cid]||(h[y.cid]=!0,s.push(y)),t[a]=y}else d&&(o=t[a]=this._prepareModel(o,e))&&(l.push(o),this._addReference(o,e),h[o.cid]=!0,s.push(o))}if(p){for(a=0;a<this.length;a++)h[(o=this.models[a]).cid]||u.push(o);u.length&&this._removeModels(u,e)}var x=!1,O=!v&&d&&p;if(s.length&&O?(x=this.length!==s.length||n.some(this.models,function(t,e){return t!==s[e]}),this.models.length=0,C(this.models,s,0),this.length=this.models.length):l.length&&(v&&(g=!0),C(this.models,l,null==i?this.length:i),this.length=this.models.length),g&&this.sort({silent:!0}),!e.silent){for(a=0;a<l.length;a++)null!=i&&(e.index=i+a),(o=l[a]).trigger("add",o,this,e);(g||x)&&this.trigger("sort",this,e),(l.length||u.length||c.length)&&(e.changes={added:l,removed:u,merged:c},this.trigger("update",this,e))}return r?t[0]:t}},reset:function(t,e){e=e?n.clone(e):{};for(var r=0;r<this.models.length;r++)this._removeReference(this.models[r],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)return this._byId[t]||this._byId[this.modelId(t.attributes||t)]||t.cid&&this._byId[t.cid]},has:function(t){return null!=this.get(t)},at:function(t){return t<0&&(t+=this.length),this.models[t]},where:function(t,e){return this[e?"find":"filter"](t)},findWhere:function(t){return this.where(t,!0)},sort:function(t){var e=this.comparator;if(!e)throw new Error("Cannot sort a set without a comparator");t||(t={});var r=e.length;return n.isFunction(e)&&(e=n.bind(e,this)),1===r||n.isString(e)?this.models=this.sortBy(e):this.models.sort(e),t.silent||this.trigger("sort",this,t),this},pluck:function(t){return this.map(t+"")},fetch:function(t){var e=(t=n.extend({parse:!0},t)).success,r=this;return t.success=function(n){var i=t.reset?"reset":"set";r[i](n,t),e&&e.call(t.context,r,n,t),r.trigger("sync",r,n,t)},R(this,t),this.sync("read",this,t)},create:function(t,e){var r=(e=e?n.clone(e):{}).wait;if(!(t=this._prepareModel(t,e)))return!1;r||this.add(t,e);var i=this,o=e.success;return e.success=function(t,e,n){r&&i.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):{}).collection=this;var r=new this.model(t,e);return r.validationError?(this.trigger("invalid",this,r.validationError,e),!1):r},_removeModels:function(t,e){for(var n=[],r=0;r<t.length;r++){var i=this.get(t[r]);if(i){var o=this.indexOf(i);this.models.splice(o,1),this.length--,delete this._byId[i.cid];var a=this.modelId(i.attributes);null!=a&&delete this._byId[a],e.silent||(e.index=o,i.trigger("remove",i,this,e)),n.push(i),this._removeReference(i,e)}}return n},_isModel:function(t){return t instanceof y},_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,r){if(e){if(("add"===t||"remove"===t)&&n!==this)return;if("destroy"===t&&this.remove(e,r),"change"===t){var i=this.modelId(e.previousAttributes()),o=this.modelId(e.attributes);i!==o&&(null!=i&&delete this._byId[i],null!=o&&(this._byId[o]=e))}}this.trigger.apply(this,arguments)}}),a(b,{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},"models");var O=e.View=function(t){this.cid=n.uniqueId("view"),n.extend(this,n.pick(t,S)),this._ensureElement(),this.initialize.apply(this,arguments)},k=/^(\S+)\s*(.*)$/,S=["model","collection","el","id","attributes","className","tagName","events"];n.extend(O.prototype,c,{tagName:"div",$:function(t){return this.$el.find(t)},initialize:function(){},render:function(){return this},remove:function(){return this._removeElement(),this.stopListening(),this},_removeElement:function(){this.$el.remove()},setElement:function(t){return this.undelegateEvents(),this._setElement(t),this.delegateEvents(),this},_setElement:function(t){this.$el=t instanceof e.$?t:e.$(t),this.el=this.$el[0]},delegateEvents:function(t){if(t||(t=n.result(this,"events")),!t)return this;for(var e in this.undelegateEvents(),t){var r=t[e];if(n.isFunction(r)||(r=this[r]),r){var i=e.match(k);this.delegate(i[1],i[2],n.bind(r,this))}}return this},delegate:function(t,e,n){return this.$el.on(t+".delegateEvents"+this.cid,e,n),this},undelegateEvents:function(){return this.$el&&this.$el.off(".delegateEvents"+this.cid),this},undelegate:function(t,e,n){return this.$el.off(t+".delegateEvents"+this.cid,e,n),this},_createElement:function(t){return document.createElement(t)},_ensureElement:function(){if(this.el)this.setElement(n.result(this,"el"));else{var t=n.extend({},n.result(this,"attributes"));this.id&&(t.id=n.result(this,"id")),this.className&&(t.class=n.result(this,"className")),this.setElement(this._createElement(n.result(this,"tagName"))),this._setAttributes(t)}},_setAttributes:function(t){this.$el.attr(t)}}),e.sync=function(t,r,i){var o=T[t];n.defaults(i||(i={}),{emulateHTTP:e.emulateHTTP,emulateJSON:e.emulateJSON});var a={type:o,dataType:"json"};if(i.url||(a.url=n.result(r,"url")||F()),null!=i.data||!r||"create"!==t&&"update"!==t&&"patch"!==t||(a.contentType="application/json",a.data=JSON.stringify(i.attrs||r.toJSON(i))),i.emulateJSON&&(a.contentType="application/x-www-form-urlencoded",a.data=a.data?{model:a.data}:{}),i.emulateHTTP&&("PUT"===o||"DELETE"===o||"PATCH"===o)){a.type="POST",i.emulateJSON&&(a.data._method=o);var s=i.beforeSend;i.beforeSend=function(t){if(t.setRequestHeader("X-HTTP-Method-Override",o),s)return s.apply(this,arguments)}}"GET"===a.type||i.emulateJSON||(a.processData=!1);var l=i.error;i.error=function(t,e,n){i.textStatus=e,i.errorThrown=n,l&&l.call(i.context,t,e,n)};var c=i.xhr=e.ajax(n.extend(a,i));return r.trigger("request",r,c,i),c};var T={create:"POST",update:"PUT",patch:"PATCH",delete:"DELETE",read:"GET"};e.ajax=function(){return e.$.ajax.apply(e.$,arguments)};var P=e.Router=function(t){t||(t={}),t.routes&&(this.routes=t.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},E=/\((.*?)\)/g,j=/(\(\?)?:\w+/g,M=/\*\w+/g,D=/[\-{}\[\]+?.,\\\^$|#\s]/g;n.extend(P.prototype,c,{initialize:function(){},route:function(t,r,i){n.isRegExp(t)||(t=this._routeToRegExp(t)),n.isFunction(r)&&(i=r,r=""),i||(i=this[r]);var o=this;return e.history.route(t,function(n){var a=o._extractParameters(t,n);!1!==o.execute(i,a,r)&&(o.trigger.apply(o,["route:"+r].concat(a)),o.trigger("route",r,a),e.history.trigger("route",o,r,a))}),this},execute:function(t,e,n){t&&t.apply(this,e)},navigate:function(t,n){return e.history.navigate(t,n),this},_bindRoutes:function(){if(this.routes){this.routes=n.result(this,"routes");for(var t,e=n.keys(this.routes);null!=(t=e.pop());)this.route(t,this.routes[t])}},_routeToRegExp:function(t){return t=t.replace(D,"\\$&").replace(E,"(?:$1)?").replace(j,function(t,e){return e?t:"([^/?]+)"}).replace(M,"([^?]*?)"),new RegExp("^"+t+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(t,e){var r=t.exec(e).slice(1);return n.map(r,function(t,e){return e===r.length-1?t||null:t?decodeURIComponent(t):null})}});var A=e.History=function(){this.handlers=[],this.checkUrl=n.bind(this.checkUrl,this),"undefined"!=typeof window&&(this.location=window.location,this.history=window.history)},L=/^[#\/]|\s+$/g,N=/^\/+|\/+$/g,I=/#.*$/;A.started=!1,n.extend(A.prototype,c,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,"$&/")===this.root&&!this.getSearch()},matchRoot:function(){return this.decodeFragment(this.location.pathname).slice(0,this.root.length-1)+"/"===this.root},decodeFragment:function(t){return decodeURI(t.replace(/%25/g,"%2525"))},getSearch:function(){var t=this.location.href.replace(/#.*/,"").match(/\?.+/);return t?t[0]:""},getHash:function(t){var e=(t||this).location.href.match(/#(.*)$/);return e?e[1]:""},getPath:function(){var t=this.decodeFragment(this.location.pathname+this.getSearch()).slice(this.root.length-1);return"/"===t.charAt(0)?t.slice(1):t},getFragment:function(t){return null==t&&(t=this._usePushState||!this._wantsHashChange?this.getPath():this.getHash()),t.replace(L,"")},start:function(t){if(A.started)throw new Error("Backbone.history has already been started");if(A.started=!0,this.options=n.extend({root:"/"},this.options,t),this.root=this.options.root,this._wantsHashChange=!1!==this.options.hashChange,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(N,"/"),this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){var e=this.root.slice(0,-1)||"/";return this.location.replace(e+"#"+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(t,e){return attachEvent("on"+t,e)};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 t=window.removeEventListener||function(t,e){return detachEvent("on"+t,e)};this._usePushState?t("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe&&t("hashchange",this.checkUrl,!1),this.iframe&&(document.body.removeChild(this.iframe),this.iframe=null),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),A.started=!1},route:function(t,e){this.handlers.unshift({route:t,callback:e})},checkUrl:function(t){var e=this.getFragment();if(e===this.fragment&&this.iframe&&(e=this.getHash(this.iframe.contentWindow)),e===this.fragment)return!1;this.iframe&&this.navigate(e),this.loadUrl()},loadUrl:function(t){return!!this.matchRoot()&&(t=this.fragment=this.getFragment(t),n.some(this.handlers,function(e){if(e.route.test(t))return e.callback(t),!0}))},navigate:function(t,e){if(!A.started)return!1;e&&!0!==e||(e={trigger:!!e}),t=this.getFragment(t||"");var n=this.root;""!==t&&"?"!==t.charAt(0)||(n=n.slice(0,-1)||"/");var r=n+t;if(t=this.decodeFragment(t.replace(I,"")),this.fragment!==t){if(this.fragment=t,this._usePushState)this.history[e.replace?"replaceState":"pushState"]({},document.title,r);else{if(!this._wantsHashChange)return this.location.assign(r);if(this._updateHash(this.location,t,e.replace),this.iframe&&t!==this.getHash(this.iframe.contentWindow)){var i=this.iframe.contentWindow;e.replace||(i.document.open(),i.document.close()),this._updateHash(i.location,t,e.replace)}}return e.trigger?this.loadUrl(t):void 0}},_updateHash:function(t,e,n){if(n){var r=t.href.replace(/(javascript:|#).*$/,"");t.replace(r+"#"+e)}else t.hash="#"+e}}),e.history=new A,y.extend=b.extend=P.extend=O.extend=A.extend=function(t,e){var r,i=this;return r=t&&n.has(t,"constructor")?t.constructor:function(){return i.apply(this,arguments)},n.extend(r,i,e),r.prototype=n.create(i.prototype,t),r.prototype.constructor=r,r.__super__=i.prototype,r};var F=function(){throw new Error('A "url" property or function must be specified')},R=function(t,e){var n=e.error;e.error=function(r){n&&n.call(e.context,t,r,e),t.trigger("error",t,r,e)}};return e}(a,n,t,e)}.apply(e,i))||(t.exports=o)}).call(this,n(23))},function(t,e){t.exports=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},function(t,e,n){"use strict";n.d(e,"k",function(){return v}),n.d(e,"p",function(){return s}),n.d(e,"o",function(){return l}),n.d(e,"i",function(){return f}),n.d(e,"m",function(){return o}),n.d(e,"f",function(){return m}),n.d(e,"c",function(){return y}),n.d(e,"a",function(){return h}),n.d(e,"l",function(){return g}),n.d(e,"e",function(){return x}),n.d(e,"j",function(){return C}),n.d(e,"d",function(){return p}),n.d(e,"q",function(){return a}),n.d(e,"n",function(){return d}),n.d(e,"g",function(){return b}),n.d(e,"h",function(){return c}),n.d(e,"b",function(){return O});var r=n(0),i=window.Element.prototype,o=i.matches||i.webkitMatchesSelector||i.mozMatchesSelector||i.msMatchesSelector,a=function(t,e){var n={},i=Object(r.keys)(e);for(var o in t)if(t.hasOwnProperty(o)){var a=t[o],s=e[o];i.indexOf(o)>=0?a!==s&&(n[o]=s):n[o]=null}for(var l in e)e.hasOwnProperty(l)&&Object(r.isUndefined)(t[l])&&(n[l]=e[l]);return n},s=function(t,e,n){e=e.split(/\s+/),t=t instanceof Array?t:[t];for(var r=function(r){t.forEach(function(t){return t.addEventListener(e[r],n)})},i=0;i<e.length;++i)r(i)},l=function(t,e,n){e=e.split(/\s+/),t=t instanceof Array?t:[t];for(var r=function(r){t.forEach(function(t){return t.removeEventListener(e[r],n)})},i=0;i<e.length;++i)r(i)},c=function(t){return t.replace(parseFloat(t),"")},u=function(t){return t[0].toUpperCase()+t.toLowerCase().slice(1)},h=function(t){var e=t.split("-").filter(String);return e[0].toLowerCase()+e.slice(1).map(u)},d=function(t){var e=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(t))return n;if(t=parseFloat(t),Math.floor(t)!==t){var i=e.toString().split(".")[1];r=i?i.length:0}return r?parseFloat(t.toFixed(r)):t},f=function(t){return"draggable"in document.createElement("i")&&(t?t.get("Config").nativeDnD:1)},p=function(t){return Object(r.isElement)(t)||g(t)?t:t&&t.getEl?t.getEl():void 0},g=function(t){return t&&3===t.nodeType},v=function(t){return t&&!g(t)&&!function(t){return t&&8===t.nodeType}(t)},m=function(t,e){var n=t;return Object(r.isElement)(t)&&(n=e(t).data("model")),n},y=function(t){var e,n={top:0,left:0,width:0,height:0};if(!t)return n;if(g(t)){var r=document.createRange();r.selectNode(t),e=r.getBoundingClientRect(),r.detach()}return e||(t.getBoundingClientRect?t.getBoundingClientRect():n)},b=function(t){return t.touches&&t.touches[0]?t.touches[0]:t},w=function(t){return t.which||t.keyCode},x=function(t){return String.fromCharCode(w(t))},C=function(t){return 27===w(t)},O=function(t){return t.charAt(0).toUpperCase()+t.substring(1)}},function(t,e,n){"use strict";n.r(e);var r=n(2),i=n.n(r),o=n(0),a=n(3),s=n(19),l=n(1),c=n.n(l),u=n(17),h=n(7),d=n(9);function f(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function p(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?f(n,!0).forEach(function(e){i()(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):f(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}var g=c.a.Model.extend({defaults:{type:"text",label:"",name:"",min:"",max:"",unit:"",step:1,value:"",target:"",default:"",placeholder:"",changeProp:0,options:[]},initialize:function(){var t=this.get("target"),e=this.get("name"),n=this.get("changeProp");if(t){this.target=t,this.unset("target");var r=n?"change:".concat(e):"change:attributes:".concat(e);this.listenTo(t,r,this.targetUpdated)}},props:function(){return this.attributes},targetUpdated:function(){var t=this.getTargetValue();this.set({value:t},{fromTarget:1})},getTargetValue:function(){var t,e=this.get("name"),n=this.target;return t=this.get("changeProp")?n.get(e):n.getAttributes()[e],Object(o.isUndefined)(t)?"":t},setTargetValue:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.target,r=this.get("name");if(!Object(o.isUndefined)(t))if(this.get("changeProp"))n.set(r,t,e);else{var i=p({},n.get("attributes"));i[r]=t,n.set("attributes",i,e)}},setValueFromInput:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={value:t};this.set(r,p({},n,{avoidStore:1})),e&&(this.set("value","",n),this.set(r,n))},getInitValue:function(){var t,e=this.target,n=this.get("name");if(e){var r=e.get("attributes");t=this.get("changeProp")?e.get(n):r[n]}return t||this.get("value")||this.get("default")}}),v=c.a.Collection.extend({model:g,initialize:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.em=e.em||"",this.listenTo(this,"add",this.handleAdd),this.listenTo(this,"reset",this.handleReset)},handleReset:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.previousModels,r=void 0===n?[]:n;r.forEach(function(t){return t.trigger("remove")})},handleAdd:function(t){var e=this.target;e&&(t.target=e)},setTarget:function(t){this.target=t},add:function(t,e){var n=this.em;if(Object(o.isString)(t)||Object(o.isArray)(t)){var r=n&&n.get&&n.get("TraitManager"),i=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{build:function(e){var n=[];"string"==typeof e&&(e=[e]);for(var r=0;r<e.length;r++){var i={},o=e[r];switch(i.name=o,o){case"target":i.type="select"}switch(o){case"title":case"alt":case"id":i.placeholder=t.labelPlhText;break;case"href":i.placeholder=t.labelPlhHref}switch(o){case"target":i.options=t.optionsTarget}n.push(i)}return n}}}(r&&r.getConfig());Object(o.isString)(t)&&(t=[t]);for(var a=0,s=t.length;a<s;a++){var l=t[a],u=Object(o.isString)(l)?i.build(l)[0]:l;u.target=this.target,t[a]=u}}return c.a.Collection.prototype.add.apply(this,[t,e])}});function m(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function y(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?m(n,!0).forEach(function(e){i()(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):m(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}var b=function(t){return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&")},w=c.a.Model.extend(s.a).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(t,e,n){},removed:function(){},initialize:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.em,i=this.parent(),a=i&&i.attributes;if(a&&a.propagate){var s={},l=a.propagate;l.forEach(function(t){return s[t]=i.get(t)}),s.propagate=l,s=y({},s,{},e),this.set(s)}var c=this.get("propagate");c&&this.set("propagate",Object(o.isArray)(c)?c:[c]),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.config=n.config||{},this.set("attributes",y({},this.defaults.attributes||{},{},this.get("attributes")||{})),this.ccid=w.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.set("status",""),["classes","traits","components"].forEach(function(e){var n="add remove ".concat("components"!==e?"change":"");t.listenTo(t.get(e),n.trim(),function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.emitUpdate.apply(t,[e].concat(r))})}),n.temporary||(this.init(),r&&r.trigger("component:create",this))},is:function(t){return!(this.get("type")!=t)},props:function(){return this.attributes},index:function(){var t=this.collection;return t&&t.indexOf(this)},setDragMode:function(t){return this.set("dmode",t)},find:function(t){var e=[];return this.view.$el.find(t).each(function(t,n,r){var i=r.eq(n).data("model");i&&e.push(i)}),e},findType:function(t){var e=[];return function n(r){return r.forEach(function(r){r.is(t)&&e.push(r),n(r.compo