3 lines
932 KiB
JavaScript
3 lines
932 KiB
JavaScript
|
/*! grapesjs - 0.21.4 */
|
||
|
!function(t,e){if('object'==typeof exports&&'object'==typeof module)module.exports=e();else if('function'==typeof define&&define.amd)define([],e);else{var n=e();for(var o in n)('object'==typeof exports?exports:t)[o]=n[o]}}('undefined'!=typeof globalThis?globalThis:'undefined'!=typeof window?window:this,(()=>(()=>{var t={410:(t,e,n)=>{var o,r,i;1&&(r=[n(50),n(316)],void 0===(i='function'==typeof(o=function(t,e){var n=Array.prototype.slice;function o(t,e,n){return n.length<=4?t.call(e,n[0],n[1],n[2],n[3]):t.apply(e,n)}function r(t,e){return n.call(t,e)}function i(e,n){return null!=e&&(t.isArray(n)||(n=r(arguments,1)),t.all(n,(function(t){return t in e})))}var s=function(){var e=!1,n=-1;function o(){n++,e=!0,t.defer((function(){e=!1}))}return function(){return e||o(),n}}();function a(){this.registeredObjects=[],this.cidIndexes=[]}function l(e,n,o,r){for(var i,s=0,a=n.length;s<a;s++)if(i=n[s]){if("on"===e){if(!r.objectRegistry.register(i))continue}else if(!r.objectRegistry.unregister(i))continue;t.isFunction(i[e])&&i[e]("all",o,r)}}function c(e,n){var o=n.type,r=n.undoTypes,i=!r[o]||r[o][e];t.isFunction(i)&&i(n.object,n.before,n.after,n.options)}function u(e,o,r,i,s){if(!(r.isCurrentlyUndoRedoing||"undo"===e&&-1===r.pointer||"redo"===e&&r.pointer===r.length-1)){r.isCurrentlyUndoRedoing=!0;var a,l,c="undo"===e;for(s?l=c&&r.pointer===r.length-1||!c&&-1===r.pointer?t.clone(r.models):n.apply(r.models,c?[0,r.pointer]:[r.pointer,r.length-1]):(a=r.at(c?r.pointer:r.pointer+1),l=i?r.where({magicFusionIndex:a.get("magicFusionIndex")}):[a]),r.pointer+=(c?-1:1)*l.length;a=c?l.pop():l.shift();)a[e]();r.isCurrentlyUndoRedoing=!1,o.trigger(e,o)}}function p(t,e){var n=t.condition,r=typeof n;return"function"===r?!!o(n,t,e):"boolean"!==r||n}function d(t,e,n,r){if(t.track&&!t.isCurrentlyUndoRedoing&&e in r&&p(r[e],n)){var a=o(r[e]["on"],r[e],n);if(i(a,"object","before","after")){if(a.type=e,a.magicFusionIndex=s(),a.undoTypes=r,t.pointer<t.length-1)for(var l=t.length-t.pointer-1;l--;)t.pop();t.pointer=t.length,t.add(a),t.length>t.maximumStackLength&&(t.shift(),t.pointer--)}}}a.prototype={isRegistered:function(e){return e&&e.cid?this.registeredObjects[e.cid]:t.contains(this.registeredObjects,e)},register:function(t){return!this.isRegistered(t)&&(t&&t.cid?(this.registeredObjects[t.cid]=t,this.cidIndexes.push(t.cid)):this.registeredObjects.push(t),!0)},unregister:function(e){if(this.isRegistered(e)){if(e&&e.cid)delete this.registeredObjects[e.cid],this.cidIndexes.splice(t.indexOf(this.cidIndexes,e.cid),1);else{var n=t.indexOf(this.registeredObjects,e);this.registeredObjects.splice(n,1)}return!0}return!1},get:function(){return t.map(this.cidIndexes,(function(t){return this.registeredObjects[t]}),this).concat(this.registeredObjects)}};var f={add:{undo:function(t,e,n,o){t.remove(n,o)},redo:function(t,e,n,o){o.index&&(o.at=o.index),t.add(n,o)},on:function(e,n,o){return{object:n,before:void 0,after:e,options:t.clone(o)}}},remove:{undo:function(t,e,n,o){"index"in o&&(o.at=o.index),t.add(e,o)},redo:function(t,e,n,o){t.remove(e,o)},on:function(e,n,o){return{object:n,before:e,after:void 0,options:t.clone(o)}}},change:{undo:function(e,n,o,r){t.isEmpty(n)?t.each(t.keys(o),e.unset,e):(e.set(n),r&&r.unsetData&&r.unsetData.before&&r.unsetData.before.length&&t.each(r.unsetData.before,e.unset,e))},redo:function(e,n,o,r){t.isEmpty(o)?t.each(t.keys(n),e.unset,e):(e.set(o),r&&r.unsetData&&r.unsetData.after&&r.unsetData.after.length&&t.each(r.unsetData.after,e.unset,e))},on:function(e,n){var o=e.changedAttributes(),r=t.keys(o),i=t.pick(e.previousAttributes(),r),s=t.keys(i),a=(n||(n={})).unsetData={after:[],before:[]};return r.length!=s.length&&(r.length>s.length?t.each(r,(function(t){t in i||a.before.push(t)}),this):t.each(s,(function(t){t in o||a.after.push(t)}))),{object:e,before:i,after:o,options:t.clone(n)}}},reset:{undo:function(t,e,n){t.reset(e)},redo:function(t,e,n){t.reset(n)},on:function(e,n){return{object:e,before:n.previousModels,after:t.clone(e.models)}}}};function h(){}function g(e,n,o,r){if("object"==typeof n)return t.each(n,(function(t,n){2===e?g(e,t,
|
||
|
//# sourceMappingURL=grapes.min.js.map
|