vue2-bbl-editor 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +659 -0
- package/COMPONENT_USAGE_GUIDE.md +2590 -0
- package/CONTENT_WRAPPER_GUIDE.md +385 -0
- package/EXTERNAL_HTML_RENDERING.md +266 -0
- package/EXTERNAL_INTEGRATION_GUIDE.md +833 -0
- package/INSTALLATION.md +282 -0
- package/LICENSE +21 -0
- package/PACKAGE_DOCUMENTATION.md +1386 -0
- package/QUICK_SETUP.md +99 -0
- package/README.md +1694 -0
- package/dist/demo.html +10 -0
- package/dist/vue2-bbl-editor.common.js +24486 -0
- package/dist/vue2-bbl-editor.common.js.map +1 -0
- package/dist/vue2-bbl-editor.css +1 -0
- package/dist/vue2-bbl-editor.umd.js +24497 -0
- package/dist/vue2-bbl-editor.umd.js.map +1 -0
- package/dist/vue2-bbl-editor.umd.min.js +6 -0
- package/dist/vue2-bbl-editor.umd.min.js.map +1 -0
- package/package.json +172 -0
- package/types/index.d.ts +266 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("@tiptap/extension-code"),require("@tiptap/extension-underline"),require("@tiptap/extension-table-row"),require("@tiptap/extension-placeholder"),require("@tiptap/extension-table-header"),require("@tiptap/extension-table"),require("@tiptap/core"),require("@tiptap/extension-task-list"),require("@tiptap/extension-text-style"),require("@tiptap/extension-text-align"),require("@tiptap/extension-font-family"),function(){try{return require("vue")}catch(e){}}(),require("@tiptap/extension-color"),require("@tiptap/vue-2"),require("@tiptap/extension-table-cell"),require("@tiptap/extension-task-item"),require("@tiptap/starter-kit"),require("@tiptap/extension-link"),require("@tiptap/extension-highlight")):"function"===typeof define&&define.amd?define(["@tiptap/extension-code","@tiptap/extension-underline","@tiptap/extension-table-row","@tiptap/extension-placeholder","@tiptap/extension-table-header","@tiptap/extension-table","@tiptap/core","@tiptap/extension-task-list","@tiptap/extension-text-style","@tiptap/extension-text-align","@tiptap/extension-font-family","vue","@tiptap/extension-color","@tiptap/vue-2","@tiptap/extension-table-cell","@tiptap/extension-task-item","@tiptap/starter-kit","@tiptap/extension-link","@tiptap/extension-highlight"],t):"object"===typeof exports?exports["vue2-bbl-editor"]=t(require("@tiptap/extension-code"),require("@tiptap/extension-underline"),require("@tiptap/extension-table-row"),require("@tiptap/extension-placeholder"),require("@tiptap/extension-table-header"),require("@tiptap/extension-table"),require("@tiptap/core"),require("@tiptap/extension-task-list"),require("@tiptap/extension-text-style"),require("@tiptap/extension-text-align"),require("@tiptap/extension-font-family"),function(){try{return require("vue")}catch(e){}}(),require("@tiptap/extension-color"),require("@tiptap/vue-2"),require("@tiptap/extension-table-cell"),require("@tiptap/extension-task-item"),require("@tiptap/starter-kit"),require("@tiptap/extension-link"),require("@tiptap/extension-highlight")):e["vue2-bbl-editor"]=t(e["@tiptap/extension-code"],e["@tiptap/extension-underline"],e["@tiptap/extension-table-row"],e["@tiptap/extension-placeholder"],e["@tiptap/extension-table-header"],e["@tiptap/extension-table"],e["@tiptap/core"],e["@tiptap/extension-task-list"],e["@tiptap/extension-text-style"],e["@tiptap/extension-text-align"],e["@tiptap/extension-font-family"],e["Vue"],e["@tiptap/extension-color"],e["@tiptap/vue-2"],e["@tiptap/extension-table-cell"],e["@tiptap/extension-task-item"],e["@tiptap/starter-kit"],e["@tiptap/extension-link"],e["@tiptap/extension-highlight"])})("undefined"!==typeof self?self:this,(function(e,t,n,i,r,o,a,s,l,u,c,d,p,f,h,v,m,g,b){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="fb15")}({"0074":function(e,t,n){"use strict";n("60be")},"0450":function(e,t,n){},"0c93":function(e,t,n){},"11b9":function(t,n){t.exports=e},1300:function(e,t,n){"use strict";n("52d7")},1508:function(e,t,n){"use strict";n("a49f")},"23f5":function(e,t,n){},"23f8":function(e,t,n){},2505:function(e,t,n){"use strict";n("5887")},"2f31":function(e,t,n){},"32d6":function(e,t,n){"use strict";n("f948")},"3afb":function(e,t,n){"use strict";n("3b2b")},"3b2b":function(e,t,n){},"3b9d":function(e,n){e.exports=t},"3d95":function(e,t){e.exports=n},"3fc1":function(e,t){e.exports=i},"44c9":function(e,t){e.exports=r},"483d":function(e,t,n){"use strict";n("23f8")},4934:function(e,t,n){},"514f":function(e,t,n){"use strict";n("9fce")},"52be":function(e,t){e.exports=o},"52d7":function(e,t,n){},"533b":function(e,t,n){"use strict";n("23f5")},5516:function(e,t,n){},"55bc":function(e,t,n){"use strict";n("5eb2")},5887:function(e,t,n){},5924:function(e,t){e.exports=a},"5c6c":function(e,t,n){"use strict";n("909a")},"5dc5":function(e,t,n){},"5eb2":function(e,t,n){},"60be":function(e,t,n){},6685:function(e,t){e.exports=s},"696f":function(e,t){e.exports=l},"6a5c":function(e,t){e.exports=u},"6d5f":function(e,t,n){"use strict";n("0c93")},"71c9":function(e,t,n){},7524:function(e,t){e.exports=c},"86bc":function(e,t,n){"use strict";n("c4be")},"8bbf":function(e,t){if("undefined"===typeof d){var n=new Error("Cannot find module 'undefined'");throw n.code="MODULE_NOT_FOUND",n}e.exports=d},"909a":function(e,t,n){},9346:function(e,t,n){},9590:function(e,t){e.exports=p},9637:function(e,t){e.exports=f},"9bba":function(e,t){e.exports=h},"9d3b":function(e,t){e.exports=v},"9fce":function(e,t,n){},a49f:function(e,t,n){},b74c:function(e,t,n){"use strict";n("2f31")},bc12:function(e,t,n){"use strict";n("c61d")},bcb6:function(e,t){e.exports=m},c4be:function(e,t,n){},c61d:function(e,t,n){},c65b:function(e,t,n){"use strict";n("5dc5")},c884:function(e,t,n){},c8c1:function(e,t){e.exports=g},cc9b:function(e,t,n){},d046:function(e,t,n){"use strict";n("9346")},d741:function(e,t){e.exports=b},dc83:function(e,t,n){"use strict";n("4934")},de6e:function(e,t){function n(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}n.keys=function(){return[]},n.resolve=n,e.exports=n,n.id="de6e"},e6b9:function(e,t,n){},e6e8:function(e,t,n){"use strict";n("cc9b")},ed09:function(e,t,n){"use strict";n.r(t),n.d(t,"EffectScope",(function(){return f})),n.d(t,"computed",(function(){return Et})),n.d(t,"createApp",(function(){return Pt})),n.d(t,"createRef",(function(){return xe})),n.d(t,"customRef",(function(){return Ee})),n.d(t,"default",(function(){return en})),n.d(t,"defineAsyncComponent",(function(){return nn})),n.d(t,"defineComponent",(function(){return tn})),n.d(t,"del",(function(){return Ge})),n.d(t,"effectScope",(function(){return v})),n.d(t,"getCurrentInstance",(function(){return z})),n.d(t,"getCurrentScope",(function(){return m})),n.d(t,"h",(function(){return Dt})),n.d(t,"inject",(function(){return Lt})),n.d(t,"isRaw",(function(){return ze})),n.d(t,"isReactive",(function(){return je})),n.d(t,"isReadonly",(function(){return qe})),n.d(t,"isRef",(function(){return Se})),n.d(t,"markRaw",(function(){return Ne})),n.d(t,"nextTick",(function(){return Ht})),n.d(t,"onActivated",(function(){return st})),n.d(t,"onBeforeMount",(function(){return et})),n.d(t,"onBeforeUnmount",(function(){return rt})),n.d(t,"onBeforeUpdate",(function(){return nt})),n.d(t,"onDeactivated",(function(){return lt})),n.d(t,"onErrorCaptured",(function(){return at})),n.d(t,"onMounted",(function(){return tt})),n.d(t,"onScopeDispose",(function(){return g})),n.d(t,"onServerPrefetch",(function(){return ut})),n.d(t,"onUnmounted",(function(){return ot})),n.d(t,"onUpdated",(function(){return it})),n.d(t,"provide",(function(){return At})),n.d(t,"proxyRefs",(function(){return Le})),n.d(t,"reactive",(function(){return Ue})),n.d(t,"readonly",(function(){return Je})),n.d(t,"ref",(function(){return Ce})),n.d(t,"set",(function(){return ge})),n.d(t,"shallowReactive",(function(){return $e})),n.d(t,"shallowReadonly",(function(){return We})),n.d(t,"shallowRef",(function(){return Te})),n.d(t,"toRaw",(function(){return Ve})),n.d(t,"toRef",(function(){return Me})),n.d(t,"toRefs",(function(){return _e})),n.d(t,"triggerRef",(function(){return Ae})),n.d(t,"unref",(function(){return Oe})),n.d(t,"useAttrs",(function(){return Rt})),n.d(t,"useCSSModule",(function(){return jt})),n.d(t,"useCssModule",(function(){return zt})),n.d(t,"useSlots",(function(){return Ft})),n.d(t,"version",(function(){return rn})),n.d(t,"warn",(function(){return c})),n.d(t,"watch",(function(){return Ot})),n.d(t,"watchEffect",(function(){return xt})),n.d(t,"watchPostEffect",(function(){return Ct})),n.d(t,"watchSyncEffect",(function(){return St}));var i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)};function r(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var o,a=function(){return a=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},a.apply(this,arguments)};function s(e){var t="function"===typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"===typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function l(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,r,o=n.call(e),a=[];try{while((void 0===t||t-- >0)&&!(i=o.next()).done)a.push(i.value)}catch(s){r={error:s}}finally{try{i&&!i.done&&(n=o["return"])&&n.call(o)}finally{if(r)throw r.error}}return a}function u(e,t,n){if(n||2===arguments.length)for(var i,r=0,o=t.length;r<o;r++)!i&&r in t||(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}function c(e){var t;te(e,null===(t=z())||void 0===t?void 0:t.proxy)}var d=[],p=function(){function e(e){this.active=!0,this.effects=[],this.cleanups=[],this.vm=e}return e.prototype.run=function(e){if(this.active)try{return this.on(),e()}finally{this.off()}else 0},e.prototype.on=function(){this.active&&(d.push(this),o=this)},e.prototype.off=function(){this.active&&(d.pop(),o=d[d.length-1])},e.prototype.stop=function(){this.active&&(this.vm.$destroy(),this.effects.forEach((function(e){return e.stop()})),this.cleanups.forEach((function(e){return e()})),this.active=!1)},e}(),f=function(e){function t(t){void 0===t&&(t=!1);var n=this,i=void 0;return L((function(){i=oe(M())})),n=e.call(this,i)||this,t||h(n),n}return r(t,e),t}(p);function h(e,t){var n;if(t=t||o,t&&t.active)t.effects.push(e);else{var i=null===(n=z())||void 0===n?void 0:n.proxy;i&&i.$on("hook:destroyed",(function(){return e.stop()}))}}function v(e){return new f(e)}function m(){return o}function g(e){o&&o.cleanups.push(e)}function b(){var e,t;return(null===(e=m())||void 0===e?void 0:e.vm)||(null===(t=z())||void 0===t?void 0:t.proxy)}function y(e){if(!e.scope){var t=new p(e.proxy);e.scope=t,e.proxy.$on("hook:destroyed",(function(){return t.stop()}))}return e.scope}var w=void 0;try{var k=n("8bbf");k&&_(k)?w=k:k&&"default"in k&&_(k.default)&&(w=k.default)}catch(on){}var x=null,C=null,S=!0,O="__composition_api_installed__";function _(e){return e&&ee(e)&&"Vue"===e.name}function E(e){return x&&U(e,O)}function M(){return x}function T(){var e=x||w;return e}function A(e){x=e,Object.defineProperty(e,O,{configurable:!0,writable:!0,value:!0})}function L(e){var t=S;S=!1;try{e()}finally{S=t}}function B(e){if(S){var t=C;null===t||void 0===t||t.scope.off(),C=e,null===C||void 0===C||C.scope.on()}}function z(){return C}var j=new WeakMap;function P(e){if(j.has(e))return j.get(e);var t={proxy:e,update:e.$forceUpdate,type:e.$options,uid:e._uid,emit:e.$emit.bind(e),parent:null,root:null};y(t);var n=["data","props","attrs","refs","vnode","slots"];return n.forEach((function(n){R(t,n,{get:function(){return e["$".concat(n)]}})})),R(t,"isMounted",{get:function(){return e._isMounted}}),R(t,"isUnmounted",{get:function(){return e._isDestroyed}}),R(t,"isDeactivated",{get:function(){return e._inactive}}),R(t,"emitted",{get:function(){return e._events}}),j.set(e,t),e.$parent&&(t.parent=P(e.$parent)),e.$root&&(t.root=P(e.$root)),t}var I=function(e){return Object.prototype.toString.call(e)};function H(e){return"function"===typeof e&&/native code/.test(e.toString())}var D="undefined"!==typeof Symbol&&H(Symbol)&&"undefined"!==typeof Reflect&&H(Reflect.ownKeys),F=function(e){return e};function R(e,t,n){var i=n.get,r=n.set;Object.defineProperty(e,t,{enumerable:!0,configurable:!0,get:i||F,set:r||F})}function $(e,t,n,i){Object.defineProperty(e,t,{value:n,enumerable:!!i,writable:!0,configurable:!0})}function U(e,t){return Object.hasOwnProperty.call(e,t)}function N(e,t){if(!e)throw new Error("[vue-composition-api] ".concat(t))}function V(e){return Array.isArray(e)}var q,J=Object.prototype.toString,W=function(e){return J.call(e)},G=function(e){return"[object Map]"===W(e)},Z=function(e){return"[object Set]"===W(e)},K=4294967295;function Q(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)&&t<=K}function Y(e){return null!==e&&"object"===typeof e}function X(e){return"[object Object]"===I(e)}function ee(e){return"function"===typeof e}function te(e,t){var n=T();n&&n.util?n.util.warn(e,t):console.warn("[vue-composition-api] ".concat(e))}function ne(e,t,n){if("undefined"===typeof window||"undefined"===typeof console)throw e;console.error(e)}function ie(e,t){return e===t?0!==e||1/e===1/t:e!==e&&t!==t}function re(e,t){return t=t||z(),t}function oe(e,t){void 0===t&&(t={});var n=e.config.silent;e.config.silent=!0;var i=new e(t);return e.config.silent=n,i}function ae(e){var t=M();return t&&e instanceof t}function se(e,t){return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];if(e.$scopedSlots[t])return e.$scopedSlots[t].apply(e,n)}}function le(e,t){var n;if(e){if(e._normalized)return e._normalized;for(var i in n={},e)e[i]&&"$"!==i[0]&&(n[i]=!0)}else n={};for(var i in t)i in n||(n[i]=!0);return n}var ue=function(){if(!q){var e=oe(M(),{computed:{value:function(){return 0}}}),t=e._computedWatchers.value.constructor,n=e._data.__ob__.dep.constructor;q={Watcher:t,Dep:n},e.$destroy()}return q};function ce(e){return D?Symbol.for(e):e}var de=ce("composition-api.preFlushQueue"),pe=ce("composition-api.postFlushQueue"),fe="composition-api.refKey",he=new WeakMap,ve=new WeakMap,me=new WeakMap;function ge(e,t,n){var i=M(),r=i.util,o=(r.warn,r.defineReactive);var a=e.__ob__;function s(){a&&Y(n)&&!U(n,"__ob__")&&De(n)}if(V(e)){if(Q(t))return e.length=Math.max(e.length,t),e.splice(t,1,n),s(),n;if("length"===t&&n!==e.length)return e.length=n,null===a||void 0===a||a.dep.notify(),n}return t in e&&!(t in Object.prototype)?(e[t]=n,s(),n):e._isVue||a&&a.vmCount?n:a?(o(a.value,t,n),Ie(e,t,n),s(),a.dep.notify(),n):(e[t]=n,n)}var be=!1;function ye(){return be}function we(e){be=e}var ke=function(){function e(e){var t=e.get,n=e.set;R(this,"value",{get:t,set:n})}return e}();function xe(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var i=new ke(e);n&&(i.effect=!0);var r=Object.seal(i);return t&&me.set(r,!0),r}function Ce(e){var t;if(Se(e))return e;var n=Ue((t={},t[fe]=e,t));return xe({get:function(){return n[fe]},set:function(e){return n[fe]=e}})}function Se(e){return e instanceof ke}function Oe(e){return Se(e)?e.value:e}function _e(e){if(!X(e))return e;var t={};for(var n in e)t[n]=Me(e,n);return t}function Ee(e){var t=Ce(0);return xe(e((function(){t.value}),(function(){++t.value})))}function Me(e,t){t in e||ge(e,t,void 0);var n=e[t];return Se(n)?n:xe({get:function(){return e[t]},set:function(n){return e[t]=n}})}function Te(e){var t;if(Se(e))return e;var n=$e((t={},t[fe]=e,t));return xe({get:function(){return n[fe]},set:function(e){return n[fe]=e}})}function Ae(e){Se(e)&&(we(!0),e.value=e.value,we(!1))}function Le(e){var t,n,i;if(je(e))return e;var r=Ue((t={},t[fe]=e,t));$(r,fe,r[fe],!1);var o=function(e){R(r,e,{get:function(){return Se(r[fe][e])?r[fe][e].value:r[fe][e]},set:function(t){if(Se(r[fe][e]))return r[fe][e].value=Oe(t);r[fe][e]=Oe(t)}})};try{for(var a=s(Object.keys(e)),l=a.next();!l.done;l=a.next()){var u=l.value;o(u)}}catch(c){n={error:c}}finally{try{l&&!l.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}return r}var Be="__v_skip";function ze(e){var t;return Boolean(e&&U(e,"__ob__")&&"object"===typeof e.__ob__&&(null===(t=e.__ob__)||void 0===t?void 0:t[Be]))}function je(e){var t;return Boolean(e&&U(e,"__ob__")&&"object"===typeof e.__ob__&&!(null===(t=e.__ob__)||void 0===t?void 0:t[Be]))}function Pe(e){if(!(!X(e)||ze(e)||V(e)||Se(e)||ae(e)||he.has(e))){he.set(e,!0);for(var t=Object.keys(e),n=0;n<t.length;n++)Ie(e,t[n])}}function Ie(e,t,n){if("__ob__"!==t&&!ze(e[t])){var i,r,o=Object.getOwnPropertyDescriptor(e,t);if(o){if(!1===o.configurable)return;i=o.get,r=o.set,i&&!r||2!==arguments.length||(n=e[t])}Pe(n),R(e,t,{get:function(){var r=i?i.call(e):n;return t!==fe&&Se(r)?r.value:r},set:function(o){i&&!r||(t!==fe&&Se(n)&&!Se(o)?n.value=o:r?(r.call(e,o),n=o):n=o,Pe(o))}})}}function He(e){var t,n=T();if(n.observable)t=n.observable(e);else{var i=oe(n,{data:{$$state:e}});t=i._data.$$state}return U(t,"__ob__")||De(t),t}function De(e,t){var n,i;if(void 0===t&&(t=new Set),!t.has(e)&&!U(e,"__ob__")&&Object.isExtensible(e)){$(e,"__ob__",Fe(e)),t.add(e);try{for(var r=s(Object.keys(e)),o=r.next();!o.done;o=r.next()){var a=o.value,l=e[a];(X(l)||V(l))&&!ze(l)&&Object.isExtensible(l)&&De(l,t)}}catch(u){n={error:u}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}}}function Fe(e){return void 0===e&&(e={}),{value:e,dep:{notify:F,depend:F,addSub:F,removeSub:F}}}function Re(){return He({}).__ob__}function $e(e){var t,n;if(!Y(e))return e;if(!X(e)&&!V(e)||ze(e)||!Object.isExtensible(e))return e;var i=He(V(e)?[]:{}),r=i.__ob__,o=function(t){var n,o,a=e[t],s=Object.getOwnPropertyDescriptor(e,t);if(s){if(!1===s.configurable)return"continue";n=s.get,o=s.set}R(i,t,{get:function(){var e;return null===(e=r.dep)||void 0===e||e.depend(),a},set:function(t){var i;n&&!o||(ye()||a!==t)&&(o?o.call(e,t):a=t,null===(i=r.dep)||void 0===i||i.notify())}})};try{for(var a=s(Object.keys(e)),l=a.next();!l.done;l=a.next()){var u=l.value;o(u)}}catch(c){t={error:c}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return i}function Ue(e){if(!Y(e))return e;if(!X(e)&&!V(e)||ze(e)||!Object.isExtensible(e))return e;var t=He(e);return Pe(t),t}function Ne(e){if(!X(e)&&!V(e)||!Object.isExtensible(e))return e;var t=Re();return t[Be]=!0,$(e,"__ob__",t),ve.set(e,!0),e}function Ve(e){var t;return ze(e)||!Object.isExtensible(e)?e:(null===(t=null===e||void 0===e?void 0:e.__ob__)||void 0===t?void 0:t.value)||e}function qe(e){return me.has(e)}function Je(e){return me.set(e,!0),e}function We(e){var t,n;if(!Y(e))return e;if(!X(e)&&!V(e)||!Object.isExtensible(e)&&!Se(e))return e;var i=Se(e)?new ke({}):je(e)?He({}):{},r=Ue({}),o=r.__ob__,a=function(t){var n,r=e[t],a=Object.getOwnPropertyDescriptor(e,t);if(a){if(!1===a.configurable&&!Se(e))return"continue";n=a.get}R(i,t,{get:function(){var t=n?n.call(e):r;return o.dep.depend(),t},set:function(e){0}})};try{for(var l=s(Object.keys(e)),u=l.next();!u.done;u=l.next()){var c=u.value;a(c)}}catch(d){t={error:d}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}return me.set(i,!0),i}function Ge(e,t){var n=M();n.util.warn;if(V(e)&&Q(t))e.splice(t,1);else{var i=e.__ob__;e._isVue||i&&i.vmCount||U(e,t)&&(delete e[t],i&&i.dep.notify())}}var Ze=function(e){return"on".concat(e[0].toUpperCase()+e.slice(1))};function Ke(e){return function(t,n){var i=re(Ze(e),n);return i&&Qe(M(),i,e,t)}}function Qe(e,t,n,i){var r=t.proxy.$options,o=e.config.optionMergeStrategies[n],a=Ye(t,i);return r[n]=o(r[n],a),a}function Ye(e,t){return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var r=z();B(e);try{return t.apply(void 0,u([],l(n),!1))}finally{B(r)}}}var Xe,et=Ke("beforeMount"),tt=Ke("mounted"),nt=Ke("beforeUpdate"),it=Ke("updated"),rt=Ke("beforeDestroy"),ot=Ke("destroyed"),at=Ke("errorCaptured"),st=Ke("activated"),lt=Ke("deactivated"),ut=Ke("serverPrefetch");function ct(){gt(this,de)}function dt(){gt(this,pe)}function pt(e){return void 0!==e[de]}function ft(e){e[de]=[],e[pe]=[],e.$on("hook:beforeUpdate",ct),e.$on("hook:updated",dt)}function ht(e){return a({immediate:!1,deep:!1,flush:"pre"},e)}function vt(e){return a({flush:"pre"},e)}function mt(){var e=b();return e?pt(e)||ft(e):(Xe||(Xe=oe(M())),e=Xe),e}function gt(e,t){for(var n=e[t],i=0;i<n.length;i++)n[i]();n.length=0}function bt(e,t,n){var i=function(){e.$nextTick((function(){e[de].length&>(e,de),e[pe].length&>(e,pe)}))};switch(n){case"pre":i(),e[de].push(t);break;case"post":i(),e[pe].push(t);break;default:N(!1,'flush must be one of ["post", "pre", "sync"], but got '.concat(n));break}}function yt(e,t,n,i){var r=e._watchers.length;return e.$watch(t,n,{immediate:i.immediateInvokeCallback,deep:i.deep,lazy:i.noRun,sync:i.sync,before:i.before}),e._watchers[r]}function wt(e,t){var n=e.teardown;e.teardown=function(){for(var i=[],r=0;r<arguments.length;r++)i[r]=arguments[r];n.apply(e,i),t()}}function kt(e,t,n,i){var r;var o,a=i.flush,s="sync"===a,c=function(t){o=function(){try{t()}catch(n){ne(n,e,"onCleanup()")}}},d=function(){o&&(o(),o=null)},p=function(t){return s||e===Xe?t:function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return bt(e,(function(){t.apply(void 0,u([],l(n),!1))}),a)}};if(null===n){var f=!1,h=function(){if(!f)try{f=!0,t(c)}finally{f=!1}},v=yt(e,h,F,{deep:i.deep||!1,sync:s,before:d});wt(v,d),v.lazy=!1;var m=v.get.bind(v);return v.get=p(m),function(){v.teardown()}}var g,b=i.deep,y=!1;if(Se(t)?g=function(){return t.value}:je(t)?(g=function(){return t},b=!0):V(t)?(y=!0,g=function(){return t.map((function(e){return Se(e)?e.value:je(e)?_t(e):ee(e)?e():F}))}):g=ee(t)?t:F,b){var w=g;g=function(){return _t(w())}}var k=function(e,t){if(b||!y||!e.every((function(e,n){return ie(e,t[n])})))return d(),n(e,t,c)},x=p(k);if(i.immediate){var C=x,S=function(e,t){return S=C,k(e,V(e)?[]:t)};x=function(e,t){return S(e,t)}}var O=e.$watch(g,x,{immediate:i.immediate,deep:b,sync:s}),_=e._watchers[e._watchers.length-1];return je(_.value)&&(null===(r=_.value.__ob__)||void 0===r?void 0:r.dep)&&b&&_.value.__ob__.dep.addSub({update:function(){_.run()}}),wt(_,d),function(){O()}}function xt(e,t){var n=vt(t),i=mt();return kt(i,e,null,n)}function Ct(e){return xt(e,{flush:"post"})}function St(e){return xt(e,{flush:"sync"})}function Ot(e,t,n){var i=null;ee(t)?i=t:(n=t,i=null);var r=ht(n),o=mt();return kt(o,e,i,r)}function _t(e,t){if(void 0===t&&(t=new Set),!Y(e)||t.has(e)||ve.has(e))return e;if(t.add(e),Se(e))_t(e.value,t);else if(V(e))for(var n=0;n<e.length;n++)_t(e[n],t);else if(Z(e)||G(e))e.forEach((function(e){_t(e,t)}));else if(X(e))for(var i in e)_t(e[i],t);return e}function Et(e){var t,n,i,r,o=b();if(ee(e)?t=e:(t=e.get,n=e.set),o&&!o.$isServer){var a,s=ue(),l=s.Watcher,u=s.Dep;r=function(){return a||(a=new l(o,t,F,{lazy:!0})),a.dirty&&a.evaluate(),u.target&&a.depend(),a.value},i=function(e){n&&n(e)}}else{var c=oe(M(),{computed:{$$state:{get:t,set:n}}});o&&o.$on("hook:destroyed",(function(){return c.$destroy()})),r=function(){return c.$$state},i=function(e){c.$$state=e}}return xe({get:r,set:i},!n,!0)}var Mt={};function Tt(e,t){var n=t;while(n){if(n._provided&&U(n._provided,e))return n._provided[e];n=n.$parent}return Mt}function At(e,t){var n,i=null===(n=re("provide"))||void 0===n?void 0:n.proxy;if(i){if(!i._provided){var r={};R(i,"_provided",{get:function(){return r},set:function(e){return Object.assign(r,e)}})}i._provided[e]=t}}function Lt(e,t,n){var i;void 0===n&&(n=!1);var r=null===(i=z())||void 0===i?void 0:i.proxy;if(r){if(!e)return t;var o=Tt(e,r);return o!==Mt?o:arguments.length>1?n&&ee(t)?t():t:void 0}}var Bt={},zt=function(e){var t;void 0===e&&(e="$style");var n=z();if(!n)return Bt;var i=null===(t=n.proxy)||void 0===t?void 0:t[e];return i||Bt},jt=zt;function Pt(e,t){void 0===t&&(t=void 0);var n=M(),i=void 0,r={},o={config:n.config,use:n.use.bind(n),mixin:n.mixin.bind(n),component:n.component.bind(n),provide:function(e,t){return r[e]=t,this},directive:function(e,t){return t?(n.directive(e,t),o):n.directive(e)},mount:function(o,s){return i||(i=new n(a(a({propsData:t},e),{provide:a(a({},r),e.provide)})),i.$mount(o,s),i)},unmount:function(){i&&(i.$destroy(),i=void 0)}};return o}var It,Ht=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return null===(e=M())||void 0===e?void 0:e.nextTick.apply(this,t)},Dt=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i=(null===this||void 0===this?void 0:this.proxy)||(null===(e=z())||void 0===e?void 0:e.proxy);return i?i.$createElement.apply(i,t):(It||(It=oe(M()).$createElement),It.apply(It,t))};function Ft(){return $t().slots}function Rt(){return $t().attrs}function $t(){var e=z();return e.setupContext}function Ut(e,t,n){var i=e.__composition_api_state__=e.__composition_api_state__||{};i[t]=n}function Nt(e,t){return(e.__composition_api_state__||{})[t]}var Vt={set:Ut,get:Nt};function qt(e,t,n){var i=e.$options.props;t in e||i&&U(i,t)||(Se(n)?R(e,t,{get:function(){return n.value},set:function(e){n.value=e}}):R(e,t,{get:function(){return je(n)&&n.__ob__.dep.depend(),n},set:function(e){n=e}}))}function Jt(e){var t=Vt.get(e,"rawBindings")||{};if(t&&Object.keys(t).length){for(var n=e.$refs,i=Vt.get(e,"refs")||[],r=0;r<i.length;r++){var o=i[r],a=t[o];!n[o]&&a&&Se(a)&&(a.value=null)}var s=Object.keys(n),l=[];for(r=0;r<s.length;r++){o=s[r],a=t[o];n[o]&&a&&Se(a)&&(a.value=n[o],l.push(o))}Vt.set(e,"refs",l)}}function Wt(e){var t=[e._vnode];while(t.length){var n=t.pop();if(n&&(n.context&&Jt(n.context),n.children))for(var i=0;i<n.children.length;++i)t.push(n.children[i])}}function Gt(e,t){var n,i;if(e){var r=Vt.get(e,"attrBindings");if(r||t){if(!r){var o=Ue({});r={ctx:t,data:o},Vt.set(e,"attrBindings",r),R(t,"attrs",{get:function(){return null===r||void 0===r?void 0:r.data},set:function(){}})}var a=e.$attrs,l=function(t){U(r.data,t)||R(r.data,t,{get:function(){return e.$attrs[t]}})};try{for(var u=s(Object.keys(a)),c=u.next();!c.done;c=u.next()){var d=c.value;l(d)}}catch(p){n={error:p}}finally{try{c&&!c.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}}}}function Zt(e,t){var n=e.$options._parentVnode;if(n){for(var i=Vt.get(e,"slots")||[],r=le(n.data.scopedSlots,e.$slots),o=0;o<i.length;o++){var a=i[o];r[a]||delete t[a]}var s=Object.keys(r);for(o=0;o<s.length;o++){a=s[o];t[a]||(t[a]=se(e,a))}Vt.set(e,"slots",s)}}function Kt(e,t,n){var i=z();B(e);try{return t(e)}catch(r){if(!n)throw r;n(r)}finally{B(i)}}function Qt(e){function t(){var e=this,t=e.$options,i=t.setup,r=t.render;if(r&&(t.render=function(){for(var t=this,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return Kt(P(e),(function(){return r.apply(t,n)}))}),i&&ee(i)){var o=t.data;t.data=function(){return n(e,e.$props),ee(o)?o.call(e,e):o||{}}}}function n(e,t){void 0===t&&(t={});var n,a=e.$options.setup,s=o(e),l=P(e);if(l.setupContext=s,$(t,"__ob__",Re()),Zt(e,s.slots),Kt(l,(function(){n=a(t,s)})),n)if(ee(n)){var u=n;e.$options.render=function(){return Zt(e,s.slots),Kt(l,(function(){return u()}))}}else if(Y(n)){je(n)&&(n=_e(n)),Vt.set(e,"rawBindings",n);var c=n;Object.keys(c).forEach((function(t){var n=c[t];if(!Se(n))if(je(n))V(n)&&(n=Ce(n));else if(ee(n)){var o=n;n=n.bind(e),Object.keys(o).forEach((function(e){n[e]=o[e]}))}else Y(n)?r(n)&&i(n):n=Ce(n);qt(e,t,n)}))}else 0}function i(e,t){if(void 0===t&&(t=new Set),!t.has(e)&&X(e)&&!Se(e)&&!je(e)&&!ze(e)){var n=M(),r=n.util.defineReactive;Object.keys(e).forEach((function(n){var o=e[n];r(e,n,o),o&&(t.add(o),i(o,t))}))}}function r(e,t){return void 0===t&&(t=new Map),t.has(e)?t.get(e):(t.set(e,!1),V(e)&&je(e)?(t.set(e,!0),!0):!(!X(e)||ze(e)||Se(e))&&Object.keys(e).some((function(n){return r(e[n],t)})))}function o(e){var t={slots:{}},n=["root","parent","refs","listeners","isServer","ssrContext"],i=["emit"];return n.forEach((function(n){var i="$".concat(n);R(t,n,{get:function(){return e[i]},set:function(){}})})),Gt(e,t),i.forEach((function(n){var i="$".concat(n);R(t,n,{get:function(){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=e[i];r.apply(e,t)}}})})),t}e.mixin({beforeCreate:t,mounted:function(){Wt(this)},beforeUpdate:function(){Gt(this)},updated:function(){Wt(this)}})}function Yt(e,t){if(!e)return t;if(!t)return e;for(var n,i,r,o=D?Reflect.ownKeys(e):Object.keys(e),a=0;a<o.length;a++)n=o[a],"__ob__"!==n&&(i=t[n],r=e[n],U(t,n)?i!==r&&X(i)&&!Se(i)&&X(r)&&!Se(r)&&Yt(r,i):t[n]=r);return t}function Xt(e){E(e)||(e.config.optionMergeStrategies.setup=function(e,t){return function(n,i){return Yt(ee(e)?e(n,i)||{}:void 0,ee(t)?t(n,i)||{}:void 0)}},A(e),Qt(e))}var en={install:function(e){return Xt(e)}};function tn(e){return e}function nn(e){ee(e)&&(e={loader:e});var t=e.loader,n=e.loadingComponent,i=e.errorComponent,r=e.delay,o=void 0===r?200:r,a=e.timeout,s=(e.suspensible,e.onError);var l=null,u=0,c=function(){return u++,l=null,d()},d=function(){var e;return l||(e=l=t().catch((function(e){if(e=e instanceof Error?e:new Error(String(e)),s)return new Promise((function(t,n){var i=function(){return t(c())},r=function(){return n(e)};s(e,i,r,u+1)}));throw e})).then((function(t){return e!==l&&l?l:(t&&(t.__esModule||"Module"===t[Symbol.toStringTag])&&(t=t.default),t)})))};return function(){var e=d();return{component:e,delay:o,timeout:a,error:i,loading:n}}}var rn="1.7.2";"undefined"!==typeof window&&window.Vue&&window.Vue.use(en)},f948:function(e,t,n){},fb15:function(e,t,n){"use strict";if(n.r(t),n.d(t,"PremiumBblEditor",(function(){return $c})),n.d(t,"PremiumBblEditorOptionsAPI",(function(){return id})),n.d(t,"DiagnosticTool",(function(){return yd})),n.d(t,"DebugHelper",(function(){return Od})),n.d(t,"ToolbarMain",(function(){return Su})),n.d(t,"ToolbarGroup",(function(){return $i})),n.d(t,"ToolbarButton",(function(){return Wi})),n.d(t,"EditorBubbleMenu",(function(){return Au})),n.d(t,"TableBubbleMenu",(function(){return Gu})),n.d(t,"ImageBubbleMenu",(function(){return ec})),n.d(t,"VideoBubbleMenu",(function(){return ac})),n.d(t,"ImageModal",(function(){return kc})),n.d(t,"VideoModal",(function(){return Lc})),n.d(t,"LinkModal",(function(){return Hc})),n.d(t,"ResizableImage",(function(){return ri})),n.d(t,"ResizableVideo",(function(){return wi})),n.d(t,"CustomTableCell",(function(){return In})),n.d(t,"CustomTableHeader",(function(){return En})),n.d(t,"useEditor",(function(){return Bi})),"undefined"!==typeof window){var i=window.document.currentScript,r=i&&i.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);r&&(n.p=r[1])}var o=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"premium-editor-container",class:["theme-"+e.theme,e.editorClass]},[e.isEditorReady||e.editorError?e._e():n("div",{staticClass:"editor-loading"},[n("div",{staticClass:"loading-spinner"}),n("p",[e._v("Loading Premium Editor...")])]),e.editorError?n("div",{staticClass:"editor-error"},[n("div",{staticClass:"error-icon"},[e._v("โ ๏ธ")]),n("div",{staticClass:"error-content"},[n("h3",[e._v("Editor Failed to Load")]),e.missingDependencies.length>0?n("div",{staticClass:"missing-deps"},[e._m(0),n("ul",e._l(e.missingDependencies,(function(t){return n("li",{key:t},[e._v(e._s(t))])})),0),e._m(1)]):n("div",{staticClass:"generic-error"},[n("p",[e._v(e._s(e.editorError))]),n("p",[e._v("Please check the browser console for more details.")])]),e._m(2)])]):e._e(),n("div",{directives:[{name:"show",rawName:"v-show",value:e.isEditorReady&&!e.editorError,expression:"isEditorReady && !editorError"}],staticClass:"premium-editor-wrapper"},[e.showToolbar?n("div",{staticClass:"premium-toolbar-container",class:e.toolbarClass},[e.editor?n("ToolbarMain",{attrs:{editor:e.editor,config:e.toolbarConfig,"font-families":e.fontFamilies,"font-sizes":e.fontSizes,"line-heights":e.lineHeights,"allowed-headings":e.allowedHeadings,"source-code-mode":e.isSourceCodeMode},on:{"execute-command":e.executeCommand,"insert-link":e.openLinkModal,"insert-image":function(t){e.showImageModal=!0},"insert-video":function(t){e.showVideoModal=!0},"clear-formatting":e.clearFormatting,"toggle-source-code":e.toggleSourceCode}}):n("div",{staticClass:"toolbar-loading"},[n("div",{staticClass:"toolbar-loading-content"},[n("div",{staticClass:"loading-spinner-small"}),n("span",[e._v("Loading toolbar...")])])])],1):e._e(),n("div",{staticClass:"premium-editor-content",class:e.contentClass,style:e.contentStyles},[n("editor-content",{directives:[{name:"show",rawName:"v-show",value:!e.isSourceCodeMode,expression:"!isSourceCodeMode"}],staticClass:"bbl-editor-area",style:e.editorStyles,attrs:{editor:e.editor}}),n("textarea",{directives:[{name:"show",rawName:"v-show",value:e.isSourceCodeMode,expression:"isSourceCodeMode"},{name:"model",rawName:"v-model",value:e.sourceCode,expression:"sourceCode"}],staticClass:"source-code-editor",style:e.editorStyles,attrs:{spellcheck:e.spellcheck},domProps:{value:e.sourceCode},on:{input:[function(t){t.target.composing||(e.sourceCode=t.target.value)},e.updateFromSourceCode]}})],1),e.showBubbleMenu&&e.editor?n("EditorBubbleMenu",{attrs:{editor:e.editor,config:e.toolbarConfig},on:{"execute-command":e.executeCommand}}):e._e(),e.showTableBubbleMenu&&e.editor?n("TableBubbleMenu",{attrs:{editor:e.editor}}):e._e(),e.showImageBubbleMenu&&e.editor?n("ImageBubbleMenu",{attrs:{editor:e.editor}}):e._e(),e.showVideoBubbleMenu&&e.editor?n("VideoBubbleMenu",{attrs:{editor:e.editor}}):e._e()],1),n("LinkModal",{attrs:{visible:e.showLinkModal,"initial-text":e.linkModalData.text,"initial-url":e.linkModalData.url,"initial-target":e.linkModalData.target},on:{close:function(t){e.showLinkModal=!1},insert:e.insertLink,remove:e.removeLink}}),n("ImageModal",{attrs:{visible:e.showImageModal,"upload-handler":e.uploadHandler||e.defaultImageUpload,"upload-manager":e.uploadManager,"max-file-size":e.maxFileSize,"allowed-types":e.allowedImageTypes},on:{close:function(t){e.showImageModal=!1},insert:e.insertImage}}),n("VideoModal",{attrs:{visible:e.showVideoModal,"upload-handler":e.uploadHandler||e.defaultVideoUpload,"upload-manager":e.uploadManager,"max-file-size":e.maxFileSize,"allowed-types":e.allowedVideoTypes},on:{close:function(t){e.showVideoModal=!1},insert:e.insertVideo}})],1)},a=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("p",[n("strong",[e._v("Missing Dependencies:")])])},function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"install-command"},[n("p",[n("strong",[e._v("Quick Fix:")])]),n("code",[e._v("npm install @vue/composition-api @tiptap/core @tiptap/vue-2 @tiptap/starter-kit @tiptap/extension-text-style @tiptap/extension-color @tiptap/extension-highlight @tiptap/extension-underline @tiptap/extension-text-align @tiptap/extension-link @tiptap/extension-font-family @tiptap/extension-code @tiptap/extension-code-block @tiptap/extension-table @tiptap/extension-table-row @tiptap/extension-table-cell @tiptap/extension-table-header @tiptap/extension-task-list @tiptap/extension-task-item @tiptap/extension-placeholder")])])},function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"help-links"},[n("a",{attrs:{href:"https://github.com/kazi-shahin/vue2-bbl-editor#quick-setup",target:"_blank"}},[e._v("๐ Setup Guide")]),n("a",{attrs:{href:"https://github.com/kazi-shahin/vue2-bbl-editor/blob/main/TROUBLESHOOTING.md",target:"_blank"}},[e._v("๐ง Troubleshooting")])])}],s=n("9637"),l=n("ed09"),u=n("bcb6"),c=n.n(u),d=n("6a5c"),p=n.n(d),f=n("3b9d"),h=n.n(f),v=n("696f"),m=n.n(v),g=n("9590"),b=n.n(g),y=n("d741"),w=n.n(y),k=n("c8c1"),x=n.n(k),C=n("7524"),S=n.n(C),O=n("5924");function _(e){this.content=e}_.prototype={constructor:_,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return-1==t?void 0:this.content[t+1]},update:function(e,t,n){var i=n&&n!=e?this.remove(n):this,r=i.find(e),o=i.content.slice();return-1==r?o.push(n||e,t):(o[r+1]=t,n&&(o[r]=n)),new _(o)},remove:function(e){var t=this.find(e);if(-1==t)return this;var n=this.content.slice();return n.splice(t,2),new _(n)},addToStart:function(e,t){return new _([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new _(n)},addBefore:function(e,t,n){var i=this.remove(t),r=i.content.slice(),o=i.find(e);return r.splice(-1==o?r.length:o,0,t,n),new _(r)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=_.from(e),e.size?new _(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=_.from(e),e.size?new _(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=_.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach((function(t,n){e[t]=n})),e},get size(){return this.content.length>>1}},_.from=function(e){if(e instanceof _)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new _(t)};function E(e,t,n){return t=I(t),M(e,z()?Reflect.construct(t,n||[],I(e).constructor):t.apply(e,n))}function M(e,t){if(t&&("object"==H(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return T(e)}function T(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function A(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&P(e,t)}function L(e){var t="function"==typeof Map?new Map:void 0;return L=function(e){if(null===e||!j(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return B(e,arguments,I(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),P(n,e)},L(e)}function B(e,t,n){if(z())return Reflect.construct.apply(null,arguments);var i=[null];i.push.apply(i,t);var r=new(e.bind.apply(e,i));return n&&P(r,n.prototype),r}function z(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(z=function(){return!!e})()}function j(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}function P(e,t){return P=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},P(e,t)}function I(e){return I=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},I(e)}function H(e){return H="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},H(e)}function D(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function F(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,$(i.key),i)}}function R(e,t,n){return t&&F(e.prototype,t),n&&F(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function $(e){var t=U(e,"string");return"symbol"==H(t)?t:t+""}function U(e,t){if("object"!=H(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=H(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function N(e,t,n){for(var i=0;;i++){if(i==e.childCount||i==t.childCount)return e.childCount==t.childCount?null:n;var r=e.child(i),o=t.child(i);if(r!=o){if(!r.sameMarkup(o))return n;if(r.isText&&r.text!=o.text){for(var a=0;r.text[a]==o.text[a];a++)n++;return n}if(r.content.size||o.content.size){var s=N(r.content,o.content,n+1);if(null!=s)return s}n+=r.nodeSize}else n+=r.nodeSize}}function V(e,t,n,i){for(var r=e.childCount,o=t.childCount;;){if(0==r||0==o)return r==o?null:{a:n,b:i};var a=e.child(--r),s=t.child(--o),l=a.nodeSize;if(a!=s){if(!a.sameMarkup(s))return{a:n,b:i};if(a.isText&&a.text!=s.text){var u=0,c=Math.min(a.text.length,s.text.length);while(u<c&&a.text[a.text.length-u-1]==s.text[s.text.length-u-1])u++,n--,i--;return{a:n,b:i}}if(a.content.size||s.content.size){var d=V(a.content,s.content,n-1,i-1);if(d)return d}n-=l,i-=l}else n-=l,i-=l}}var q=function(){function e(t,n){if(D(this,e),this.content=t,this.size=n||0,null==n)for(var i=0;i<t.length;i++)this.size+=t[i].nodeSize}return R(e,[{key:"nodesBetween",value:function(e,t,n){for(var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4?arguments[4]:void 0,o=0,a=0;a<t;o++){var s=this.content[o],l=a+s.nodeSize;if(l>e&&!1!==n(s,i+a,r||null,o)&&s.content.size){var u=a+1;s.nodesBetween(Math.max(0,e-u),Math.min(s.content.size,t-u),n,i+u)}a=l}}},{key:"descendants",value:function(e){this.nodesBetween(0,this.size,e)}},{key:"textBetween",value:function(e,t,n,i){var r="",o=!0;return this.nodesBetween(e,t,(function(a,s){var l=a.isText?a.text.slice(Math.max(e,s)-s,t-s):a.isLeaf?i?"function"===typeof i?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&l||a.isTextblock)&&n&&(o?o=!1:r+=n),r+=l}),0),r}},{key:"append",value:function(t){if(!t.size)return this;if(!this.size)return t;var n=this.lastChild,i=t.firstChild,r=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(i)&&(r[r.length-1]=n.withText(n.text+i.text),o=1);o<t.content.length;o++)r.push(t.content[o]);return new e(r,this.size+t.size)}},{key:"cut",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.size;if(0==t&&n==this.size)return this;var i=[],r=0;if(n>t)for(var o=0,a=0;a<n;o++){var s=this.content[o],l=a+s.nodeSize;l>t&&((a<t||l>n)&&(s=s.isText?s.cut(Math.max(0,t-a),Math.min(s.text.length,n-a)):s.cut(Math.max(0,t-a-1),Math.min(s.content.size,n-a-1))),i.push(s),r+=s.nodeSize),a=l}return new e(i,r)}},{key:"cutByIndex",value:function(t,n){return t==n?e.empty:0==t&&n==this.content.length?this:new e(this.content.slice(t,n))}},{key:"replaceChild",value:function(t,n){var i=this.content[t];if(i==n)return this;var r=this.content.slice(),o=this.size+n.nodeSize-i.nodeSize;return r[t]=n,new e(r,o)}},{key:"addToStart",value:function(t){return new e([t].concat(this.content),this.size+t.nodeSize)}},{key:"addToEnd",value:function(t){return new e(this.content.concat(t),this.size+t.nodeSize)}},{key:"eq",value:function(e){if(this.content.length!=e.content.length)return!1;for(var t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}},{key:"firstChild",get:function(){return this.content.length?this.content[0]:null}},{key:"lastChild",get:function(){return this.content.length?this.content[this.content.length-1]:null}},{key:"childCount",get:function(){return this.content.length}},{key:"child",value:function(e){var t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}},{key:"maybeChild",value:function(e){return this.content[e]||null}},{key:"forEach",value:function(e){for(var t=0,n=0;t<this.content.length;t++){var i=this.content[t];e(i,n,t),n+=i.nodeSize}}},{key:"findDiffStart",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return N(this,e,t)}},{key:"findDiffEnd",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.size,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.size;return V(this,e,t,n)}},{key:"findIndex",value:function(e){if(0==e)return W(0,e);if(e==this.size)return W(this.content.length,e);if(e>this.size||e<0)throw new RangeError("Position ".concat(e," outside of fragment (").concat(this,")"));for(var t=0,n=0;;t++){var i=this.child(t),r=n+i.nodeSize;if(r>=e)return r==e?W(t+1,r):W(t,n);n=r}}},{key:"toString",value:function(){return"<"+this.toStringInner()+">"}},{key:"toStringInner",value:function(){return this.content.join(", ")}},{key:"toJSON",value:function(){return this.content.length?this.content.map((function(e){return e.toJSON()})):null}}],[{key:"fromJSON",value:function(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new e(n.map(t.nodeFromJSON))}},{key:"fromArray",value:function(t){if(!t.length)return e.empty;for(var n,i=0,r=0;r<t.length;r++){var o=t[r];i+=o.nodeSize,r&&o.isText&&t[r-1].sameMarkup(o)?(n||(n=t.slice(0,r)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new e(n||t,i)}},{key:"from",value:function(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}])}();q.empty=new q([],0);var J={index:0,offset:0};function W(e,t){return J.index=e,J.offset=t,J}function G(e,t){if(e===t)return!0;if(!e||"object"!=H(e)||!t||"object"!=H(t))return!1;var n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(var i=0;i<e.length;i++)if(!G(e[i],t[i]))return!1}else{for(var r in e)if(!(r in t)||!G(e[r],t[r]))return!1;for(var o in t)if(!(o in e))return!1}return!0}var Z=function(){function e(t,n){D(this,e),this.type=t,this.attrs=n}return R(e,[{key:"addToSet",value:function(e){for(var t,n=!1,i=0;i<e.length;i++){var r=e[i];if(this.eq(r))return e;if(this.type.excludes(r.type))t||(t=e.slice(0,i));else{if(r.type.excludes(this.type))return e;!n&&r.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),n=!0),t&&t.push(r)}}return t||(t=e.slice()),n||t.push(this),t}},{key:"removeFromSet",value:function(e){for(var t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}},{key:"isInSet",value:function(e){for(var t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}},{key:"eq",value:function(e){return this==e||this.type==e.type&&G(this.attrs,e.attrs)}},{key:"toJSON",value:function(){var e={type:this.type.name};for(var t in this.attrs){e.attrs=this.attrs;break}return e}}],[{key:"fromJSON",value:function(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");var n=e.marks[t.type];if(!n)throw new RangeError("There is no mark type ".concat(t.type," in this schema"));var i=n.create(t.attrs);return n.checkAttrs(i.attrs),i}},{key:"sameSet",value:function(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}},{key:"setFrom",value:function(t){if(!t||Array.isArray(t)&&0==t.length)return e.none;if(t instanceof e)return[t];var n=t.slice();return n.sort((function(e,t){return e.type.rank-t.type.rank})),n}}])}();Z.none=[];var K=function(e){function t(){return D(this,t),E(this,t,arguments)}return A(t,e),R(t)}(L(Error)),Q=function(){function e(t,n,i){D(this,e),this.content=t,this.openStart=n,this.openEnd=i}return R(e,[{key:"size",get:function(){return this.content.size-this.openStart-this.openEnd}},{key:"insertAt",value:function(t,n){var i=X(this.content,t+this.openStart,n);return i&&new e(i,this.openStart,this.openEnd)}},{key:"removeBetween",value:function(t,n){return new e(Y(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}},{key:"eq",value:function(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}},{key:"toString",value:function(){return this.content+"("+this.openStart+","+this.openEnd+")"}},{key:"toJSON",value:function(){if(!this.content.size)return null;var e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}}],[{key:"fromJSON",value:function(t,n){if(!n)return e.empty;var i=n.openStart||0,r=n.openEnd||0;if("number"!=typeof i||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new e(q.fromJSON(t,n.content),i,r)}},{key:"maxOpen",value:function(t){for(var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=0,r=0,o=t.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)i++;for(var a=t.lastChild;a&&!a.isLeaf&&(n||!a.type.spec.isolating);a=a.lastChild)r++;return new e(t,i,r)}}])}();function Y(e,t,n){var i=e.findIndex(t),r=i.index,o=i.offset,a=e.maybeChild(r),s=e.findIndex(n),l=s.index,u=s.offset;if(o==t||a.isText){if(u!=n&&!e.child(l).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=l)throw new RangeError("Removing non-flat range");return e.replaceChild(r,a.copy(Y(a.content,t-o-1,n-o-1)))}function X(e,t,n,i){var r=e.findIndex(t),o=r.index,a=r.offset,s=e.maybeChild(o);if(a==t||s.isText)return i&&!i.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));var l=X(s.content,t-a-1,n,s);return l&&e.replaceChild(o,s.copy(l))}function ee(e,t,n){if(n.openStart>e.depth)throw new K("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new K("Inconsistent open depths");return te(e,t,n,0)}function te(e,t,n,i){var r=e.index(i),o=e.node(i);if(r==t.index(i)&&i<e.depth-n.openStart){var a=te(e,t,n,i+1);return o.copy(o.content.replaceChild(r,a))}if(n.content.size){if(n.openStart||n.openEnd||e.depth!=i||t.depth!=i){var s=ue(n,e),l=s.start,u=s.end;return ae(o,se(e,l,u,t,i))}var c=e.parent,d=c.content;return ae(c,d.cut(0,e.parentOffset).append(n.content).append(d.cut(t.parentOffset)))}return ae(o,le(e,t,i))}function ne(e,t){if(!t.type.compatibleContent(e.type))throw new K("Cannot join "+t.type.name+" onto "+e.type.name)}function ie(e,t,n){var i=e.node(n);return ne(i,t.node(n)),i}function re(e,t){var n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function oe(e,t,n,i){var r=(t||e).node(n),o=0,a=t?t.index(n):r.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&(re(e.nodeAfter,i),o++));for(var s=o;s<a;s++)re(r.child(s),i);t&&t.depth==n&&t.textOffset&&re(t.nodeBefore,i)}function ae(e,t){return e.type.checkContent(t),e.copy(t)}function se(e,t,n,i,r){var o=e.depth>r&&ie(e,t,r+1),a=i.depth>r&&ie(n,i,r+1),s=[];return oe(null,e,r,s),o&&a&&t.index(r)==n.index(r)?(ne(o,a),re(ae(o,se(e,t,n,i,r+1)),s)):(o&&re(ae(o,le(e,t,r+1)),s),oe(t,n,r,s),a&&re(ae(a,le(n,i,r+1)),s)),oe(i,null,r,s),new q(s)}function le(e,t,n){var i=[];if(oe(null,e,n,i),e.depth>n){var r=ie(e,t,n+1);re(ae(r,le(e,t,n+1)),i)}return oe(t,null,n,i),new q(i)}function ue(e,t){for(var n=t.depth-e.openStart,i=t.node(n),r=i.copy(e.content),o=n-1;o>=0;o--)r=t.node(o).copy(q.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}Q.empty=new Q(q.empty,0,0);var ce=function(){function e(t,n,i){D(this,e),this.pos=t,this.path=n,this.parentOffset=i,this.depth=n.length/3-1}return R(e,[{key:"resolveDepth",value:function(e){return null==e?this.depth:e<0?this.depth+e:e}},{key:"parent",get:function(){return this.node(this.depth)}},{key:"doc",get:function(){return this.node(0)}},{key:"node",value:function(e){return this.path[3*this.resolveDepth(e)]}},{key:"index",value:function(e){return this.path[3*this.resolveDepth(e)+1]}},{key:"indexAfter",value:function(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}},{key:"start",value:function(e){return e=this.resolveDepth(e),0==e?0:this.path[3*e-1]+1}},{key:"end",value:function(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}},{key:"before",value:function(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}},{key:"after",value:function(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize}},{key:"textOffset",get:function(){return this.pos-this.path[this.path.length-1]}},{key:"nodeAfter",get:function(){var e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;var n=this.pos-this.path[this.path.length-1],i=e.child(t);return n?e.child(t).cut(n):i}},{key:"nodeBefore",get:function(){var e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)}},{key:"posAtIndex",value:function(e,t){t=this.resolveDepth(t);for(var n=this.path[3*t],i=0==t?0:this.path[3*t-1]+1,r=0;r<e;r++)i+=n.child(r).nodeSize;return i}},{key:"marks",value:function(){var e=this.parent,t=this.index();if(0==e.content.size)return Z.none;if(this.textOffset)return e.child(t).marks;var n=e.maybeChild(t-1),i=e.maybeChild(t);if(!n){var r=n;n=i,i=r}for(var o=n.marks,a=0;a<o.length;a++)!1!==o[a].type.spec.inclusive||i&&o[a].isInSet(i.marks)||(o=o[a--].removeFromSet(o));return o}},{key:"marksAcross",value:function(e){var t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;for(var n=t.marks,i=e.parent.maybeChild(e.index()),r=0;r<n.length;r++)!1!==n[r].type.spec.inclusive||i&&n[r].isInSet(i.marks)||(n=n[r--].removeFromSet(n));return n}},{key:"sharedDepth",value:function(e){for(var t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}},{key:"blockRange",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this,t=arguments.length>1?arguments[1]:void 0;if(e.pos<this.pos)return e.blockRange(this);for(var n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new he(this,e,n);return null}},{key:"sameParent",value:function(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}},{key:"max",value:function(e){return e.pos>this.pos?e:this}},{key:"min",value:function(e){return e.pos<this.pos?e:this}},{key:"toString",value:function(){for(var e="",t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}}],[{key:"resolve",value:function(t,n){if(!(n>=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");for(var i=[],r=0,o=n,a=t;;){var s=a.content.findIndex(o),l=s.index,u=s.offset,c=o-u;if(i.push(a,l,r+u),!c)break;if(a=a.child(l),a.isText)break;o=c-1,r+=u+1}return new e(n,i,o)}},{key:"resolveCached",value:function(t,n){var i=fe.get(t);if(i)for(var r=0;r<i.elts.length;r++){var o=i.elts[r];if(o.pos==n)return o}else fe.set(t,i=new de);var a=i.elts[i.i]=e.resolve(t,n);return i.i=(i.i+1)%pe,a}}])}(),de=R((function e(){D(this,e),this.elts=[],this.i=0})),pe=12,fe=new WeakMap,he=function(){function e(t,n,i){D(this,e),this.$from=t,this.$to=n,this.depth=i}return R(e,[{key:"start",get:function(){return this.$from.before(this.depth+1)}},{key:"end",get:function(){return this.$to.after(this.depth+1)}},{key:"parent",get:function(){return this.$from.node(this.depth)}},{key:"startIndex",get:function(){return this.$from.index(this.depth)}},{key:"endIndex",get:function(){return this.$to.indexAfter(this.depth)}}])}(),ve=Object.create(null),me=function(){function e(t,n,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Z.none;D(this,e),this.type=t,this.attrs=n,this.marks=r,this.content=i||q.empty}return R(e,[{key:"children",get:function(){return this.content.content}},{key:"nodeSize",get:function(){return this.isLeaf?1:2+this.content.size}},{key:"childCount",get:function(){return this.content.childCount}},{key:"child",value:function(e){return this.content.child(e)}},{key:"maybeChild",value:function(e){return this.content.maybeChild(e)}},{key:"forEach",value:function(e){this.content.forEach(e)}},{key:"nodesBetween",value:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;this.content.nodesBetween(e,t,n,i,this)}},{key:"descendants",value:function(e){this.nodesBetween(0,this.content.size,e)}},{key:"textContent",get:function(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}},{key:"textBetween",value:function(e,t,n,i){return this.content.textBetween(e,t,n,i)}},{key:"firstChild",get:function(){return this.content.firstChild}},{key:"lastChild",get:function(){return this.content.lastChild}},{key:"eq",value:function(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}},{key:"sameMarkup",value:function(e){return this.hasMarkup(e.type,e.attrs,e.marks)}},{key:"hasMarkup",value:function(e,t,n){return this.type==e&&G(this.attrs,t||e.defaultAttrs||ve)&&Z.sameSet(this.marks,n||Z.none)}},{key:"copy",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}},{key:"mark",value:function(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}},{key:"cut",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.content.size;return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))}},{key:"slice",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.content.size,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e==t)return Q.empty;var i=this.resolve(e),r=this.resolve(t),o=n?0:i.sharedDepth(t),a=i.start(o),s=i.node(o),l=s.content.cut(i.pos-a,r.pos-a);return new Q(l,i.depth-o,r.depth-o)}},{key:"replace",value:function(e,t,n){return ee(this.resolve(e),this.resolve(t),n)}},{key:"nodeAt",value:function(e){for(var t=this;;){var n=t.content.findIndex(e),i=n.index,r=n.offset;if(t=t.maybeChild(i),!t)return null;if(r==e||t.isText)return t;e-=r+1}}},{key:"childAfter",value:function(e){var t=this.content.findIndex(e),n=t.index,i=t.offset;return{node:this.content.maybeChild(n),index:n,offset:i}}},{key:"childBefore",value:function(e){if(0==e)return{node:null,index:0,offset:0};var t=this.content.findIndex(e),n=t.index,i=t.offset;if(i<e)return{node:this.content.child(n),index:n,offset:i};var r=this.content.child(n-1);return{node:r,index:n-1,offset:i-r.nodeSize}}},{key:"resolve",value:function(e){return ce.resolveCached(this,e)}},{key:"resolveNoCache",value:function(e){return ce.resolve(this,e)}},{key:"rangeHasMark",value:function(e,t,n){var i=!1;return t>e&&this.nodesBetween(e,t,(function(e){return n.isInSet(e.marks)&&(i=!0),!i})),i}},{key:"isBlock",get:function(){return this.type.isBlock}},{key:"isTextblock",get:function(){return this.type.isTextblock}},{key:"inlineContent",get:function(){return this.type.inlineContent}},{key:"isInline",get:function(){return this.type.isInline}},{key:"isText",get:function(){return this.type.isText}},{key:"isLeaf",get:function(){return this.type.isLeaf}},{key:"isAtom",get:function(){return this.type.isAtom}},{key:"toString",value:function(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);var e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),ge(this.marks,e)}},{key:"contentMatchAt",value:function(e){var t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}},{key:"canReplace",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:q.empty,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:n.childCount,o=this.contentMatchAt(e).matchFragment(n,i,r),a=o&&o.matchFragment(this.content,t);if(!a||!a.validEnd)return!1;for(var s=i;s<r;s++)if(!this.type.allowsMarks(n.child(s).marks))return!1;return!0}},{key:"canReplaceWith",value:function(e,t,n,i){if(i&&!this.type.allowsMarks(i))return!1;var r=this.contentMatchAt(e).matchType(n),o=r&&r.matchFragment(this.content,t);return!!o&&o.validEnd}},{key:"canAppend",value:function(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}},{key:"check",value:function(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);for(var e=Z.none,t=0;t<this.marks.length;t++){var n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!Z.sameSet(e,this.marks))throw new RangeError("Invalid collection of marks for node ".concat(this.type.name,": ").concat(this.marks.map((function(e){return e.type.name}))));this.content.forEach((function(e){return e.check()}))}},{key:"toJSON",value:function(){var e={type:this.type.name};for(var t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map((function(e){return e.toJSON()}))),e}}],[{key:"fromJSON",value:function(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");var n=void 0;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}var i=q.fromJSON(e,t.content),r=e.nodeType(t.type).create(t.attrs,i,n);return r.type.checkAttrs(r.attrs),r}}])}();me.prototype.text=void 0;function ge(e,t){for(var n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}var be=function(){function e(t){D(this,e),this.validEnd=t,this.next=[],this.wrapCache=[]}return R(e,[{key:"matchType",value:function(e){for(var t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}},{key:"matchFragment",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.childCount,i=this,r=t;i&&r<n;r++)i=i.matchType(e.child(r).type);return i}},{key:"inlineContent",get:function(){return 0!=this.next.length&&this.next[0].type.isInline}},{key:"defaultType",get:function(){for(var e=0;e<this.next.length;e++){var t=this.next[e].type;if(!t.isText&&!t.hasRequiredAttrs())return t}return null}},{key:"compatible",value:function(e){for(var t=0;t<this.next.length;t++)for(var n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}},{key:"fillBefore",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=[this];function r(o,a){var s=o.matchFragment(e,n);if(s&&(!t||s.validEnd))return q.from(a.map((function(e){return e.createAndFill()})));for(var l=0;l<o.next.length;l++){var u=o.next[l],c=u.type,d=u.next;if(!c.isText&&!c.hasRequiredAttrs()&&-1==i.indexOf(d)){i.push(d);var p=r(d,a.concat(c));if(p)return p}}return null}return r(this,[])}},{key:"findWrapping",value:function(e){for(var t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];var n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}},{key:"computeWrapping",value:function(e){var t=Object.create(null),n=[{match:this,type:null,via:null}];while(n.length){var i=n.shift(),r=i.match;if(r.matchType(e)){for(var o=[],a=i;a.type;a=a.via)o.push(a.type);return o.reverse()}for(var s=0;s<r.next.length;s++){var l=r.next[s],u=l.type,c=l.next;u.isLeaf||u.hasRequiredAttrs()||u.name in t||i.type&&!c.validEnd||(n.push({match:u.contentMatch,type:u,via:i}),t[u.name]=!0)}}return null}},{key:"edgeCount",get:function(){return this.next.length}},{key:"edge",value:function(e){if(e>=this.next.length)throw new RangeError("There's no ".concat(e,"th edge in this content match"));return this.next[e]}},{key:"toString",value:function(){var e=[];function t(n){e.push(n);for(var i=0;i<n.next.length;i++)-1==e.indexOf(n.next[i].next)&&t(n.next[i].next)}return t(this),e.map((function(t,n){for(var i=n+(t.validEnd?"*":" ")+" ",r=0;r<t.next.length;r++)i+=(r?", ":"")+t.next[r].type.name+"->"+e.indexOf(t.next[r].next);return i})).join("\n")}}],[{key:"parse",value:function(t,n){var i=new ye(t,n);if(null==i.next)return e.empty;var r=we(i);i.next&&i.err("Unexpected trailing text");var o=Ae(Ee(r));return Le(o,i),o}}])}();be.empty=new be(!0);var ye=function(){function e(t,n){D(this,e),this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}return R(e,[{key:"next",get:function(){return this.tokens[this.pos]}},{key:"eat",value:function(e){return this.next==e&&(this.pos++||!0)}},{key:"err",value:function(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}])}();function we(e){var t=[];do{t.push(ke(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function ke(e){var t=[];do{t.push(xe(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function xe(e){for(var t=_e(e);;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else{if(!e.eat("{"))break;t=Se(e,t)}return t}function Ce(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");var t=Number(e.next);return e.pos++,t}function Se(e,t){var n=Ce(e),i=n;return e.eat(",")&&(i="}"!=e.next?Ce(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:i,expr:t}}function Oe(e,t){var n=e.nodeTypes,i=n[t];if(i)return[i];var r=[];for(var o in n){var a=n[o];a.isInGroup(t)&&r.push(a)}return 0==r.length&&e.err("No node type or group '"+t+"' found"),r}function _e(e){if(e.eat("(")){var t=we(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){var n=Oe(e,e.next).map((function(t){return null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t}}));return e.pos++,1==n.length?n[0]:{type:"choice",exprs:n}}e.err("Unexpected token '"+e.next+"'")}function Ee(e){var t=[[]];return r(o(e,0),n()),t;function n(){return t.push([])-1}function i(e,n,i){var r={term:i,to:n};return t[e].push(r),r}function r(e,t){e.forEach((function(e){return e.to=t}))}function o(e,t){if("choice"==e.type)return e.exprs.reduce((function(e,n){return e.concat(o(n,t))}),[]);if("seq"!=e.type){if("star"==e.type){var a=n();return i(t,a),r(o(e.expr,a),a),[i(a)]}if("plus"==e.type){var s=n();return r(o(e.expr,t),s),r(o(e.expr,s),s),[i(s)]}if("opt"==e.type)return[i(t)].concat(o(e.expr,t));if("range"==e.type){for(var l=t,u=0;u<e.min;u++){var c=n();r(o(e.expr,l),c),l=c}if(-1==e.max)r(o(e.expr,l),l);else for(var d=e.min;d<e.max;d++){var p=n();i(l,p),r(o(e.expr,l),p),l=p}return[i(l)]}if("name"==e.type)return[i(t,void 0,e.value)];throw new Error("Unknown expr type")}for(var f=0;;f++){var h=o(e.exprs[f],t);if(f==e.exprs.length-1)return h;r(h,t=n())}}}function Me(e,t){return t-e}function Te(e,t){var n=[];return i(t),n.sort(Me);function i(t){var r=e[t];if(1==r.length&&!r[0].term)return i(r[0].to);n.push(t);for(var o=0;o<r.length;o++){var a=r[o],s=a.term,l=a.to;s||-1!=n.indexOf(l)||i(l)}}}function Ae(e){var t=Object.create(null);return n(Te(e,0));function n(i){var r=[];i.forEach((function(t){e[t].forEach((function(t){var n=t.term,i=t.to;if(n){for(var o,a=0;a<r.length;a++)r[a][0]==n&&(o=r[a][1]);Te(e,i).forEach((function(e){o||r.push([n,o=[]]),-1==o.indexOf(e)&&o.push(e)}))}}))}));for(var o=t[i.join(",")]=new be(i.indexOf(e.length-1)>-1),a=0;a<r.length;a++){var s=r[a][1].sort(Me);o.next.push({type:r[a][0],next:t[s.join(",")]||n(s)})}return o}}function Le(e,t){for(var n=0,i=[e];n<i.length;n++){for(var r=i[n],o=!r.validEnd,a=[],s=0;s<r.next.length;s++){var l=r.next[s],u=l.type,c=l.next;a.push(u.name),!o||u.isText||u.hasRequiredAttrs()||(o=!1),-1==i.indexOf(c)&&i.push(c)}o&&t.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}new WeakMap;function Be(e){var t="function"==typeof Map?new Map:void 0;return Be=function(e){if(null===e||!je(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return ze(e,arguments,Fe(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),$e(n,e)},Be(e)}function ze(e,t,n){if(De())return Reflect.construct.apply(null,arguments);var i=[null];i.push.apply(i,t);var r=new(e.bind.apply(e,i));return n&&$e(r,n.prototype),r}function je(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}function Pe(e,t,n){return t=Fe(t),Ie(e,De()?Reflect.construct(t,n||[],Fe(e).constructor):t.apply(e,n))}function Ie(e,t){if(t&&("object"==Ue(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return He(e)}function He(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function De(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(De=function(){return!!e})()}function Fe(e){return Fe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Fe(e)}function Re(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&$e(e,t)}function $e(e,t){return $e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},$e(e,t)}function Ue(e){return Ue="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ue(e)}function Ne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ve(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,Je(i.key),i)}}function qe(e,t,n){return t&&Ve(e.prototype,t),n&&Ve(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Je(e){var t=We(e,"string");return"symbol"==Ue(t)?t:t+""}function We(e,t){if("object"!=Ue(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=Ue(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var Ge=65535,Ze=Math.pow(2,16);function Ke(e,t){return e+t*Ze}function Qe(e){return e&Ge}function Ye(e){return(e-(e&Ge))/Ze}var Xe=1,et=2,tt=4,nt=8,it=function(){function e(t,n,i){Ne(this,e),this.pos=t,this.delInfo=n,this.recover=i}return qe(e,[{key:"deleted",get:function(){return(this.delInfo&nt)>0}},{key:"deletedBefore",get:function(){return(this.delInfo&(Xe|tt))>0}},{key:"deletedAfter",get:function(){return(this.delInfo&(et|tt))>0}},{key:"deletedAcross",get:function(){return(this.delInfo&tt)>0}}])}(),rt=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(Ne(this,e),this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}return qe(e,[{key:"recover",value:function(e){var t=0,n=Qe(e);if(!this.inverted)for(var i=0;i<n;i++)t+=this.ranges[3*i+2]-this.ranges[3*i+1];return this.ranges[3*n]+t+Ye(e)}},{key:"mapResult",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this._map(e,t,!1)}},{key:"map",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this._map(e,t,!0)}},{key:"_map",value:function(e,t,n){for(var i=0,r=this.inverted?2:1,o=this.inverted?1:2,a=0;a<this.ranges.length;a+=3){var s=this.ranges[a]-(this.inverted?i:0);if(s>e)break;var l=this.ranges[a+r],u=this.ranges[a+o],c=s+l;if(e<=c){var d=l?e==s?-1:e==c?1:t:t,p=s+i+(d<0?0:u);if(n)return p;var f=e==(t<0?s:c)?null:Ke(a/3,e-s),h=e==s?et:e==c?Xe:tt;return(t<0?e!=s:e!=c)&&(h|=nt),new it(p,h,f)}i+=u-l}return n?e+i:new it(e+i,0,null)}},{key:"touches",value:function(e,t){for(var n=0,i=Qe(t),r=this.inverted?2:1,o=this.inverted?1:2,a=0;a<this.ranges.length;a+=3){var s=this.ranges[a]-(this.inverted?n:0);if(s>e)break;var l=this.ranges[a+r],u=s+l;if(e<=u&&a==3*i)return!0;n+=this.ranges[a+o]-l}return!1}},{key:"forEach",value:function(e){for(var t=this.inverted?2:1,n=this.inverted?1:2,i=0,r=0;i<this.ranges.length;i+=3){var o=this.ranges[i],a=o-(this.inverted?r:0),s=o+(this.inverted?0:r),l=this.ranges[i+t],u=this.ranges[i+n];e(a,a+l,s,s+u),r+=u-l}}},{key:"invert",value:function(){return new e(this.ranges,!this.inverted)}},{key:"toString",value:function(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}}],[{key:"offset",value:function(t){return 0==t?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}}])}();rt.empty=new rt([]);var ot=Object.create(null),at=function(){function e(){Ne(this,e)}return qe(e,[{key:"getMap",value:function(){return rt.empty}},{key:"merge",value:function(e){return null}}],[{key:"fromJSON",value:function(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");var n=ot[t.stepType];if(!n)throw new RangeError("No step type ".concat(t.stepType," defined"));return n.fromJSON(e,t)}},{key:"jsonID",value:function(e,t){if(e in ot)throw new RangeError("Duplicate use of step JSON ID "+e);return ot[e]=t,t.prototype.jsonID=e,t}}])}(),st=function(){function e(t,n){Ne(this,e),this.doc=t,this.failed=n}return qe(e,null,[{key:"ok",value:function(t){return new e(t,null)}},{key:"fail",value:function(t){return new e(null,t)}},{key:"fromReplace",value:function(t,n,i,r){try{return e.ok(t.replace(n,i,r))}catch(o){if(o instanceof K)return e.fail(o.message);throw o}}}])}();function lt(e,t,n){for(var i=[],r=0;r<e.childCount;r++){var o=e.child(r);o.content.size&&(o=o.copy(lt(o.content,t,o))),o.isInline&&(o=t(o,n,r)),i.push(o)}return q.fromArray(i)}var ut=function(e){function t(e,n,i){var r;return Ne(this,t),r=Pe(this,t),r.from=e,r.to=n,r.mark=i,r}return Re(t,e),qe(t,[{key:"apply",value:function(e){var t=this,n=e.slice(this.from,this.to),i=e.resolve(this.from),r=i.node(i.sharedDepth(this.to)),o=new Q(lt(n.content,(function(e,n){return e.isAtom&&n.type.allowsMarkType(t.mark.type)?e.mark(t.mark.addToSet(e.marks)):e}),r),n.openStart,n.openEnd);return st.fromReplace(e,this.from,this.to,o)}},{key:"invert",value:function(){return new ct(this.from,this.to,this.mark)}},{key:"map",value:function(e){var n=e.mapResult(this.from,1),i=e.mapResult(this.to,-1);return n.deleted&&i.deleted||n.pos>=i.pos?null:new t(n.pos,i.pos,this.mark)}},{key:"merge",value:function(e){return e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new t(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}},{key:"toJSON",value:function(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}}],[{key:"fromJSON",value:function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new t(n.from,n.to,e.markFromJSON(n.mark))}}])}(at);at.jsonID("addMark",ut);var ct=function(e){function t(e,n,i){var r;return Ne(this,t),r=Pe(this,t),r.from=e,r.to=n,r.mark=i,r}return Re(t,e),qe(t,[{key:"apply",value:function(e){var t=this,n=e.slice(this.from,this.to),i=new Q(lt(n.content,(function(e){return e.mark(t.mark.removeFromSet(e.marks))}),e),n.openStart,n.openEnd);return st.fromReplace(e,this.from,this.to,i)}},{key:"invert",value:function(){return new ut(this.from,this.to,this.mark)}},{key:"map",value:function(e){var n=e.mapResult(this.from,1),i=e.mapResult(this.to,-1);return n.deleted&&i.deleted||n.pos>=i.pos?null:new t(n.pos,i.pos,this.mark)}},{key:"merge",value:function(e){return e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new t(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}},{key:"toJSON",value:function(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}}],[{key:"fromJSON",value:function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new t(n.from,n.to,e.markFromJSON(n.mark))}}])}(at);at.jsonID("removeMark",ct);var dt=function(e){function t(e,n){var i;return Ne(this,t),i=Pe(this,t),i.pos=e,i.mark=n,i}return Re(t,e),qe(t,[{key:"apply",value:function(e){var t=e.nodeAt(this.pos);if(!t)return st.fail("No node at mark step's position");var n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return st.fromReplace(e,this.pos,this.pos+1,new Q(q.from(n),0,t.isLeaf?0:1))}},{key:"invert",value:function(e){var n=e.nodeAt(this.pos);if(n){var i=this.mark.addToSet(n.marks);if(i.length==n.marks.length){for(var r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(i))return new t(this.pos,n.marks[r]);return new t(this.pos,this.mark)}}return new pt(this.pos,this.mark)}},{key:"map",value:function(e){var n=e.mapResult(this.pos,1);return n.deletedAfter?null:new t(n.pos,this.mark)}},{key:"toJSON",value:function(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}}],[{key:"fromJSON",value:function(e,n){if("number"!=typeof n.pos)throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new t(n.pos,e.markFromJSON(n.mark))}}])}(at);at.jsonID("addNodeMark",dt);var pt=function(e){function t(e,n){var i;return Ne(this,t),i=Pe(this,t),i.pos=e,i.mark=n,i}return Re(t,e),qe(t,[{key:"apply",value:function(e){var t=e.nodeAt(this.pos);if(!t)return st.fail("No node at mark step's position");var n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return st.fromReplace(e,this.pos,this.pos+1,new Q(q.from(n),0,t.isLeaf?0:1))}},{key:"invert",value:function(e){var t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new dt(this.pos,this.mark):this}},{key:"map",value:function(e){var n=e.mapResult(this.pos,1);return n.deletedAfter?null:new t(n.pos,this.mark)}},{key:"toJSON",value:function(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}}],[{key:"fromJSON",value:function(e,n){if("number"!=typeof n.pos)throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new t(n.pos,e.markFromJSON(n.mark))}}])}(at);at.jsonID("removeNodeMark",pt);var ft=function(e){function t(e,n,i){var r,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return Ne(this,t),r=Pe(this,t),r.from=e,r.to=n,r.slice=i,r.structure=o,r}return Re(t,e),qe(t,[{key:"apply",value:function(e){return this.structure&&vt(e,this.from,this.to)?st.fail("Structure replace would overwrite content"):st.fromReplace(e,this.from,this.to,this.slice)}},{key:"getMap",value:function(){return new rt([this.from,this.to-this.from,this.slice.size])}},{key:"invert",value:function(e){return new t(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}},{key:"map",value:function(e){var n=e.mapResult(this.from,1),i=e.mapResult(this.to,-1);return n.deletedAcross&&i.deletedAcross?null:new t(n.pos,Math.max(n.pos,i.pos),this.slice,this.structure)}},{key:"merge",value:function(e){if(!(e instanceof t)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;var n=this.slice.size+e.slice.size==0?Q.empty:new Q(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new t(e.from,this.to,n,this.structure)}var i=this.slice.size+e.slice.size==0?Q.empty:new Q(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new t(this.from,this.to+(e.to-e.from),i,this.structure)}},{key:"toJSON",value:function(){var e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}}],[{key:"fromJSON",value:function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new t(n.from,n.to,Q.fromJSON(e,n.slice),!!n.structure)}}])}(at);at.jsonID("replace",ft);var ht=function(e){function t(e,n,i,r,o,a){var s,l=arguments.length>6&&void 0!==arguments[6]&&arguments[6];return Ne(this,t),s=Pe(this,t),s.from=e,s.to=n,s.gapFrom=i,s.gapTo=r,s.slice=o,s.insert=a,s.structure=l,s}return Re(t,e),qe(t,[{key:"apply",value:function(e){if(this.structure&&(vt(e,this.from,this.gapFrom)||vt(e,this.gapTo,this.to)))return st.fail("Structure gap-replace would overwrite content");var t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return st.fail("Gap is not a flat range");var n=this.slice.insertAt(this.insert,t.content);return n?st.fromReplace(e,this.from,this.to,n):st.fail("Content does not fit in gap")}},{key:"getMap",value:function(){return new rt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}},{key:"invert",value:function(e){var n=this.gapTo-this.gapFrom;return new t(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}},{key:"map",value:function(e){var n=e.mapResult(this.from,1),i=e.mapResult(this.to,-1),r=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?i.pos:e.map(this.gapTo,1);return n.deletedAcross&&i.deletedAcross||r<n.pos||o>i.pos?null:new t(n.pos,i.pos,r,o,this.slice,this.insert,this.structure)}},{key:"toJSON",value:function(){var e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}}],[{key:"fromJSON",value:function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to||"number"!=typeof n.gapFrom||"number"!=typeof n.gapTo||"number"!=typeof n.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new t(n.from,n.to,n.gapFrom,n.gapTo,Q.fromJSON(e,n.slice),n.insert,!!n.structure)}}])}(at);function vt(e,t,n){var i=e.resolve(t),r=n-t,o=i.depth;while(r>0&&o>0&&i.indexAfter(o)==i.node(o).childCount)o--,r--;if(r>0){var a=i.node(o).maybeChild(i.indexAfter(o));while(r>0){if(!a||a.isLeaf)return!0;a=a.firstChild,r--}}return!1}at.jsonID("replaceAround",ht);var mt=function(e){function t(e,n,i){var r;return Ne(this,t),r=Pe(this,t),r.pos=e,r.attr=n,r.value=i,r}return Re(t,e),qe(t,[{key:"apply",value:function(e){var t=e.nodeAt(this.pos);if(!t)return st.fail("No node at attribute step's position");var n=Object.create(null);for(var i in t.attrs)n[i]=t.attrs[i];n[this.attr]=this.value;var r=t.type.create(n,null,t.marks);return st.fromReplace(e,this.pos,this.pos+1,new Q(q.from(r),0,t.isLeaf?0:1))}},{key:"getMap",value:function(){return rt.empty}},{key:"invert",value:function(e){return new t(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}},{key:"map",value:function(e){var n=e.mapResult(this.pos,1);return n.deletedAfter?null:new t(n.pos,this.attr,this.value)}},{key:"toJSON",value:function(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}}],[{key:"fromJSON",value:function(e,n){if("number"!=typeof n.pos||"string"!=typeof n.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new t(n.pos,n.attr,n.value)}}])}(at);at.jsonID("attr",mt);var gt=function(e){function t(e,n){var i;return Ne(this,t),i=Pe(this,t),i.attr=e,i.value=n,i}return Re(t,e),qe(t,[{key:"apply",value:function(e){var t=Object.create(null);for(var n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;var i=e.type.create(t,e.content,e.marks);return st.ok(i)}},{key:"getMap",value:function(){return rt.empty}},{key:"invert",value:function(e){return new t(this.attr,e.attrs[this.attr])}},{key:"map",value:function(e){return this}},{key:"toJSON",value:function(){return{stepType:"docAttr",attr:this.attr,value:this.value}}}],[{key:"fromJSON",value:function(e,n){if("string"!=typeof n.attr)throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new t(n.attr,n.value)}}])}(at);at.jsonID("docAttr",gt);var bt=function(e){function t(){return Ne(this,t),Pe(this,t,arguments)}return Re(t,e),qe(t)}(Be(Error));bt=function e(t){var n=Error.call(this,t);return n.__proto__=e.prototype,n},bt.prototype=Object.create(Error.prototype),bt.prototype.constructor=bt,bt.prototype.name="TransformError";function yt(e,t,n){return t=_t(t),wt(e,xt()?Reflect.construct(t,n||[],_t(e).constructor):t.apply(e,n))}function wt(e,t){if(t&&("object"==Tt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return kt(e)}function kt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function xt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(xt=function(){return!!e})()}function Ct(e,t,n,i){var r=St(_t(1&i?e.prototype:e),t,n);return 2&i&&"function"==typeof r?function(e){return r.apply(n,e)}:r}function St(){return St="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=Ot(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},St.apply(null,arguments)}function Ot(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=_t(e)););return e}function _t(e){return _t=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_t(e)}function Et(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Mt(e,t)}function Mt(e,t){return Mt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Mt(e,t)}function Tt(e){return Tt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Tt(e)}function At(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Lt(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,zt(i.key),i)}}function Bt(e,t,n){return t&&Lt(e.prototype,t),n&&Lt(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function zt(e){var t=jt(e,"string");return"symbol"==Tt(t)?t:t+""}function jt(e,t){if("object"!=Tt(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=Tt(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var Pt=Object.create(null),It=function(){function e(t,n,i){At(this,e),this.$anchor=t,this.$head=n,this.ranges=i||[new Ht(t.min(n),t.max(n))]}return Bt(e,[{key:"anchor",get:function(){return this.$anchor.pos}},{key:"head",get:function(){return this.$head.pos}},{key:"from",get:function(){return this.$from.pos}},{key:"to",get:function(){return this.$to.pos}},{key:"$from",get:function(){return this.ranges[0].$from}},{key:"$to",get:function(){return this.ranges[0].$to}},{key:"empty",get:function(){for(var e=this.ranges,t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}},{key:"content",value:function(){return this.$from.doc.slice(this.from,this.to,!0)}},{key:"replace",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Q.empty,n=t.content.lastChild,i=null,r=0;r<t.openEnd;r++)i=n,n=n.lastChild;for(var o=e.steps.length,a=this.ranges,s=0;s<a.length;s++){var l=a[s],u=l.$from,c=l.$to,d=e.mapping.slice(o);e.replaceRange(d.map(u.pos),d.map(c.pos),s?Q.empty:t),0==s&&Wt(e,o,(n?n.isInline:i&&i.isTextblock)?-1:1)}}},{key:"replaceWith",value:function(e,t){for(var n=e.steps.length,i=this.ranges,r=0;r<i.length;r++){var o=i[r],a=o.$from,s=o.$to,l=e.mapping.slice(n),u=l.map(a.pos),c=l.map(s.pos);r?e.deleteRange(u,c):(e.replaceRangeWith(u,c,t),Wt(e,n,t.isInline?-1:1))}}},{key:"getBookmark",value:function(){return Rt.between(this.$anchor,this.$head).getBookmark()}}],[{key:"findFrom",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=e.parent.inlineContent?new Rt(e):Jt(e.node(0),e.parent,e.pos,e.index(),t,n);if(i)return i;for(var r=e.depth-1;r>=0;r--){var o=t<0?Jt(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):Jt(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(o)return o}return null}},{key:"near",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.findFrom(e,t)||this.findFrom(e,-t)||new Vt(e.node(0))}},{key:"atStart",value:function(e){return Jt(e,e,0,0,1)||new Vt(e)}},{key:"atEnd",value:function(e){return Jt(e,e,e.content.size,e.childCount,-1)||new Vt(e)}},{key:"fromJSON",value:function(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");var n=Pt[t.type];if(!n)throw new RangeError("No selection type ".concat(t.type," defined"));return n.fromJSON(e,t)}},{key:"jsonID",value:function(e,t){if(e in Pt)throw new RangeError("Duplicate use of selection JSON ID "+e);return Pt[e]=t,t.prototype.jsonID=e,t}}])}();It.prototype.visible=!0;var Ht=Bt((function e(t,n){At(this,e),this.$from=t,this.$to=n})),Dt=!1;function Ft(e){Dt||e.parent.inlineContent||(Dt=!0,console["warn"]("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}var Rt=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return At(this,t),Ft(e),Ft(n),yt(this,t,[e,n])}return Et(t,e),Bt(t,[{key:"$cursor",get:function(){return this.$anchor.pos==this.$head.pos?this.$head:null}},{key:"map",value:function(e,n){var i=e.resolve(n.map(this.head));if(!i.parent.inlineContent)return It.near(i);var r=e.resolve(n.map(this.anchor));return new t(r.parent.inlineContent?r:i,i)}},{key:"replace",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Q.empty;if(Ct(t,"replace",this,3)([e,n]),n==Q.empty){var i=this.$from.marksAcross(this.$to);i&&e.ensureMarks(i)}}},{key:"eq",value:function(e){return e instanceof t&&e.anchor==this.anchor&&e.head==this.head}},{key:"getBookmark",value:function(){return new $t(this.anchor,this.head)}},{key:"toJSON",value:function(){return{type:"text",anchor:this.anchor,head:this.head}}}],[{key:"fromJSON",value:function(e,n){if("number"!=typeof n.anchor||"number"!=typeof n.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new t(e.resolve(n.anchor),e.resolve(n.head))}},{key:"create",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,i=e.resolve(t);return new this(i,n==t?i:e.resolve(n))}},{key:"between",value:function(e,n,i){var r=e.pos-n.pos;if(i&&!r||(i=r>=0?1:-1),!n.parent.inlineContent){var o=It.findFrom(n,i,!0)||It.findFrom(n,-i,!0);if(!o)return It.near(n,i);n=o.$head}return e.parent.inlineContent||(0==r?e=n:(e=(It.findFrom(e,-i,!0)||It.findFrom(e,i,!0)).$anchor,e.pos<n.pos!=r<0&&(e=n))),new t(e,n)}}])}(It);It.jsonID("text",Rt);var $t=function(){function e(t,n){At(this,e),this.anchor=t,this.head=n}return Bt(e,[{key:"map",value:function(t){return new e(t.map(this.anchor),t.map(this.head))}},{key:"resolve",value:function(e){return Rt.between(e.resolve(this.anchor),e.resolve(this.head))}}])}(),Ut=function(e){function t(e){var n;At(this,t);var i=e.nodeAfter,r=e.node(0).resolve(e.pos+i.nodeSize);return n=yt(this,t,[e,r]),n.node=i,n}return Et(t,e),Bt(t,[{key:"map",value:function(e,n){var i=n.mapResult(this.anchor),r=i.deleted,o=i.pos,a=e.resolve(o);return r?It.near(a):new t(a)}},{key:"content",value:function(){return new Q(q.from(this.node),0,0)}},{key:"eq",value:function(e){return e instanceof t&&e.anchor==this.anchor}},{key:"toJSON",value:function(){return{type:"node",anchor:this.anchor}}},{key:"getBookmark",value:function(){return new Nt(this.anchor)}}],[{key:"fromJSON",value:function(e,n){if("number"!=typeof n.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new t(e.resolve(n.anchor))}},{key:"create",value:function(e,n){return new t(e.resolve(n))}},{key:"isSelectable",value:function(e){return!e.isText&&!1!==e.type.spec.selectable}}])}(It);Ut.prototype.visible=!1,It.jsonID("node",Ut);var Nt=function(){function e(t){At(this,e),this.anchor=t}return Bt(e,[{key:"map",value:function(t){var n=t.mapResult(this.anchor),i=n.deleted,r=n.pos;return i?new $t(r,r):new e(r)}},{key:"resolve",value:function(e){var t=e.resolve(this.anchor),n=t.nodeAfter;return n&&Ut.isSelectable(n)?new Ut(t):It.near(t)}}])}(),Vt=function(e){function t(e){return At(this,t),yt(this,t,[e.resolve(0),e.resolve(e.content.size)])}return Et(t,e),Bt(t,[{key:"replace",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Q.empty;if(n==Q.empty){e.delete(0,e.doc.content.size);var i=It.atStart(e.doc);i.eq(e.selection)||e.setSelection(i)}else Ct(t,"replace",this,3)([e,n])}},{key:"toJSON",value:function(){return{type:"all"}}},{key:"map",value:function(e){return new t(e)}},{key:"eq",value:function(e){return e instanceof t}},{key:"getBookmark",value:function(){return qt}}],[{key:"fromJSON",value:function(e){return new t(e)}}])}(It);It.jsonID("all",Vt);var qt={map:function(){return this},resolve:function(e){return new Vt(e)}};function Jt(e,t,n,i,r){var o=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(t.inlineContent)return Rt.create(e,n);for(var a=i-(r>0?0:1);r>0?a<t.childCount:a>=0;a+=r){var s=t.child(a);if(s.isAtom){if(!o&&Ut.isSelectable(s))return Ut.create(e,n-(r<0?s.nodeSize:0))}else{var l=Jt(e,s,n+r,r<0?s.childCount:0,r,o);if(l)return l}n+=s.nodeSize*r}return null}function Wt(e,t,n){var i=e.steps.length-1;if(!(i<t)){var r=e.steps[i];if(r instanceof ft||r instanceof ht){var o,a=e.mapping.maps[i];a.forEach((function(e,t,n,i){null==o&&(o=i)})),e.setSelection(It.near(e.doc.resolve(o),n))}}}function Gt(e,t){return t&&e?e.bind(t):e}var Zt=Bt((function e(t,n,i){At(this,e),this.name=t,this.init=Gt(n.init,i),this.apply=Gt(n.apply,i)}));new Zt("doc",{init:function(e){return e.doc||e.schema.topNodeType.createAndFill()},apply:function(e){return e.doc}}),new Zt("selection",{init:function(e,t){return e.selection||It.atStart(t.doc)},apply:function(e){return e.selection}}),new Zt("storedMarks",{init:function(e){return e.storedMarks||null},apply:function(e,t,n,i){return i.selection.$cursor?e.storedMarks:null}}),new Zt("scrollToSelection",{init:function(){return 0},apply:function(e,t){return e.scrolledIntoView?t+1:t}});function Kt(e,t,n){for(var i in e){var r=e[i];r instanceof Function?r=r.bind(t):"handleDOMEvents"==i&&(r=Kt(r,t,{})),n[i]=r}return n}var Qt=function(){function e(t){At(this,e),this.spec=t,this.props={},t.props&&Kt(t.props,this,this.props),this.key=t.key?t.key.key:Xt("plugin")}return Bt(e,[{key:"getState",value:function(e){return e[this.key]}}])}(),Yt=Object.create(null);function Xt(e){return e in Yt?e+"$"+ ++Yt[e]:(Yt[e]=0,e+"$")}var en=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"key";At(this,e),this.key=Xt(t)}return Bt(e,[{key:"get",value:function(e){return e.config.pluginsByKey[this.key]}},{key:"getState",value:function(e){return e[this.key]}}])}();function tn(e){return an(e)||on(e)||rn(e)||nn()}function nn(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function rn(e,t){if(e){if("string"==typeof e)return sn(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?sn(e,t):void 0}}function on(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function an(e){if(Array.isArray(e))return sn(e)}function sn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}var ln=/^```([a-z]+)?[\s\n]$/,un=/^~~~([a-z]+)?[\s\n]$/,cn=O["Node"].create({name:"codeBlock",addOptions:function(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes:function(){var e=this;return{language:{default:this.options.defaultLanguage,parseHTML:function(t){var n,i=e.options.languageClassPrefix,r=tn((null===(n=t.firstElementChild)||void 0===n?void 0:n.classList)||[]),o=r.filter((function(e){return e.startsWith(i)})).map((function(e){return e.replace(i,"")})),a=o[0];return a||null},rendered:!1}}},parseHTML:function(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML:function(e){var t=e.node,n=e.HTMLAttributes;return["pre",Object(O["mergeAttributes"])(this.options.HTMLAttributes,n),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands:function(){var e=this;return{setCodeBlock:function(t){return function(n){var i=n.commands;return i.setNode(e.name,t)}},toggleCodeBlock:function(t){return function(n){var i=n.commands;return i.toggleNode(e.name,"paragraph",t)}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-Alt-c":function(){return e.editor.commands.toggleCodeBlock()},Backspace:function(){var t=e.editor.state.selection,n=t.empty,i=t.$anchor,r=1===i.pos;return!(!n||i.parent.type.name!==e.name)&&(!(!r&&i.parent.textContent.length)&&e.editor.commands.clearNodes())},Enter:function(t){var n=t.editor;if(!e.options.exitOnTripleEnter)return!1;var i=n.state,r=i.selection,o=r.$from,a=r.empty;if(!a||o.parent.type!==e.type)return!1;var s=o.parentOffset===o.parent.nodeSize-2,l=o.parent.textContent.endsWith("\n\n");return!(!s||!l)&&n.chain().command((function(e){var t=e.tr;return t.delete(o.pos-2,o.pos),!0})).exitCode().run()},ArrowDown:function(t){var n=t.editor;if(!e.options.exitOnArrowDown)return!1;var i=n.state,r=i.selection,o=i.doc,a=r.$from,s=r.empty;if(!s||a.parent.type!==e.type)return!1;var l=a.parentOffset===a.parent.nodeSize-2;if(!l)return!1;var u=a.after();if(void 0===u)return!1;var c=o.nodeAt(u);return c?n.commands.command((function(e){var t=e.tr;return t.setSelection(It.near(o.resolve(u))),!0})):n.commands.exitCode()}}},addInputRules:function(){return[Object(O["textblockTypeInputRule"])({find:ln,type:this.type,getAttributes:function(e){return{language:e[1]}}}),Object(O["textblockTypeInputRule"])({find:un,type:this.type,getAttributes:function(e){return{language:e[1]}}})]},addProseMirrorPlugins:function(){var e=this;return[new Qt({key:new en("codeBlockVSCodeHandler"),props:{handlePaste:function(t,n){if(!n.clipboardData)return!1;if(e.editor.isActive(e.type.name))return!1;var i=n.clipboardData.getData("text/plain"),r=n.clipboardData.getData("vscode-editor-data"),o=r?JSON.parse(r):void 0,a=null===o||void 0===o?void 0:o.mode;if(!i||!a)return!1;var s=t.state,l=s.tr,u=s.schema,c=u.text(i.replace(/\r\n?/g,"\n"));return l.replaceSelectionWith(e.type.create({language:a},c)),l.selection.$from.parent.type!==e.type&&l.setSelection(Rt.near(l.doc.resolve(Math.max(0,l.selection.from-2)))),l.setMeta("paste",!0),t.dispatch(l),!0}}})]}}),dn=n("11b9"),pn=n.n(dn),fn=/^\s*>\s$/,hn=O["Node"].create({name:"blockquote",addOptions:function(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML:function(){return[{tag:"blockquote"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["blockquote",Object(O["mergeAttributes"])(this.options.HTMLAttributes,t),0]},addCommands:function(){var e=this;return{setBlockquote:function(){return function(t){var n=t.commands;return n.wrapIn(e.name)}},toggleBlockquote:function(){return function(t){var n=t.commands;return n.toggleWrap(e.name)}},unsetBlockquote:function(){return function(t){var n=t.commands;return n.lift(e.name)}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-Shift-b":function(){return e.editor.commands.toggleBlockquote()}}},addInputRules:function(){return[Object(O["wrappingInputRule"])({find:fn,type:this.type})]}}),vn=n("52be"),mn=n.n(vn),gn=n("3d95"),bn=n.n(gn),yn=n("44c9"),wn=n.n(yn);function kn(e){return kn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},kn(e)}function xn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Cn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xn(Object(n),!0).forEach((function(t){Sn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Sn(e,t,n){return(t=On(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function On(e){var t=_n(e,"string");return"symbol"==kn(t)?t:t+""}function _n(e,t){if("object"!=kn(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=kn(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var En=wn.a.extend({addAttributes:function(){var e;return Cn(Cn({},null===(e=this.parent)||void 0===e?void 0:e.call(this)),{},{style:{default:null,parseHTML:function(e){return e.getAttribute("style")},renderHTML:function(e){return e.style?{style:e.style}:{}}}})}}),Mn=n("9bba"),Tn=n.n(Mn);function An(e){return An="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},An(e)}function Ln(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Bn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ln(Object(n),!0).forEach((function(t){zn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ln(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function zn(e,t,n){return(t=jn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jn(e){var t=Pn(e,"string");return"symbol"==An(t)?t:t+""}function Pn(e,t){if("object"!=An(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=An(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var In=Tn.a.extend({addAttributes:function(){var e;return Bn(Bn({},null===(e=this.parent)||void 0===e?void 0:e.call(this)),{},{style:{default:null,parseHTML:function(e){return e.getAttribute("style")},renderHTML:function(e){return e.style?{style:e.style}:{}}}})}}),Hn=n("6685"),Dn=n.n(Hn),Fn=n("9d3b"),Rn=n.n(Fn),$n=n("3fc1"),Un=n.n($n);function Nn(e){return Nn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Nn(e)}var Vn=["width","height","align","display","caption","captionPosition","spacing"];function qn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Jn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qn(Object(n),!0).forEach((function(t){Wn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Wn(e,t,n){return(t=Gn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gn(e){var t=Zn(e,"string");return"symbol"==Nn(t)?t:t+""}function Zn(e,t){if("object"!=Nn(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=Nn(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function Kn(e,t){return ti(e)||ei(e,t)||Yn(e,t)||Qn()}function Qn(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Yn(e,t){if(e){if("string"==typeof e)return Xn(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xn(e,t):void 0}}function Xn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function ei(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,o,a,s=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=o.call(n)).done)&&(s.push(i.value),s.length!==t);l=!0);}catch(e){u=!0,r=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw r}}return s}}function ti(e){if(Array.isArray(e))return e}function ni(e,t){if(null==e)return{};var n,i,r=ii(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function ii(e,t){if(null==e)return{};var n={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;n[i]=e[i]}return n}var ri=O["Node"].create({name:"resizableImage",group:"block",atom:!0,addAttributes:function(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null},align:{default:"left"},display:{default:"block"},caption:{default:""},captionPosition:{default:"none"},spacing:{default:"medium"}}},parseHTML:function(){return[{tag:"img[src]"}]},renderHTML:function(e){var t=e.HTMLAttributes,n=t.width,i=t.height,r=t.align,o=t.display,a=t.caption,s=t.captionPosition,l=t.spacing,u=ni(t,Vn),c={small:"0.5em",medium:"1em",large:"1.5em"},d=c[l]||c.medium,p="max-width: 100%; height: auto; display: block;";if(n&&(p+=" width: ".concat(n,"px;")),i&&(p+=" height: ".concat(i,"px;")),!a||"none"===s)return"inline"===o?(p=p.replace("display: block;","display: inline-block; vertical-align: middle;"),p+="center"===r?" margin: 0 auto;":"right"===r?" float: right; margin-left: ".concat(d,";"):"left"===r?" float: left; margin-right: ".concat(d,";"):" margin: 0 ".concat(d,";")):"center"===r?p+=" margin-left: auto; margin-right: auto;":"right"===r?p+=" float: right; margin-left: ".concat(d,"; margin-bottom: ").concat(d,";"):"left"===r&&(p+=" float: left; margin-right: ".concat(d,"; margin-bottom: ").concat(d,";")),["img",Object(O["mergeAttributes"])(u,{style:p})];var f="margin: 1em 0; max-width: 100%;";n&&(f+=" width: ".concat(n,"px;")),"inline"===o?(f+=" display: inline-block; vertical-align: middle;",f+="center"===r?" margin: 0 auto;":"right"===r?" margin-left: auto; margin-right: 0;":"left"===r?" margin-left: 0; margin-right: auto;":" margin: 0 ".concat(d,";")):(f+=" display: block;","center"===r?f+=" margin-left: auto; margin-right: auto; text-align: center;":"right"===r?f+=" float: right; margin-left: ".concat(d,"; margin-bottom: ").concat(d,";"):"left"===r&&(f+=" float: left; margin-right: ".concat(d,"; margin-bottom: ").concat(d,";")));var h="font-size: 0.875em; color: #6b7280; padding: 0.5em; text-align: center; font-style: italic; margin: 0;",v=["img",Object(O["mergeAttributes"])(u,{style:p})],m=["figcaption",{style:h},a],g="top"===s?[m,v]:[v,m];return["figure",{style:f}].concat(g)},addNodeView:function(){return function(e){var t=e.HTMLAttributes,n=e.getPos,i=e.editor,r=document.createElement("div");r.className="resizable-image-container",r.style.position="relative",r.style.maxWidth="100%",r.style.margin="1em 0";var o=document.createElement("div");o.style.position="relative",o.style.display="inline-block",o.style.maxWidth="100%";var a=t.display||"block",s=t.align||"left",l=t.spacing||"medium",u={small:"1em",medium:"1.5em",large:"2em"},c=u[l]||u.medium;"inline"===a?(r.style.display="inline-block",r.style.verticalAlign="middle",r.style.float="none","center"===s?r.style.margin="0 auto":"right"===s?(r.style.marginLeft="auto",r.style.marginRight="0"):"left"===s?(r.style.marginLeft="0",r.style.marginRight="auto"):r.style.margin="0 0.5em"):"center"===s?(r.style.display="block",r.style.textAlign="center",r.style.marginLeft="auto",r.style.marginRight="auto",r.style.float="none"):(r.style.display="inline-block","right"===s?(r.style.float="right",r.style.marginLeft=c,r.style.marginBottom=c):"left"===s&&(r.style.float="left",r.style.marginRight=c,r.style.marginBottom=c));var d=t.caption||"",p=t.captionPosition||"none",f=null;"none"!==p&&(f=document.createElement("div"),f.className="image-caption",f.contentEditable="true",f.textContent=d||"Enter caption...",f.style.fontSize="0.875em",f.style.color=d?"#6b7280":"#9ca3af",f.style.padding="0.5em",f.style.textAlign="center",f.style.fontStyle="italic",f.style.outline="none",f.style.cursor="text",f.style.minHeight="2em",f.style.userSelect="text",f.setAttribute("data-placeholder","Enter caption..."),f.addEventListener("focus",(function(e){"Enter caption..."===e.target.textContent&&(e.target.textContent="",e.target.style.color="#6b7280")})),f.addEventListener("blur",(function(e){var t=e.target.textContent.trim();if(""===t||"Enter caption..."===t){if(e.target.textContent="Enter caption...",e.target.style.color="#9ca3af","function"===typeof n){var r=n();void 0!==r&&i.commands.updateAttributes("resizableImage",{caption:""})}}else if("function"===typeof n){var o=n();void 0!==o&&i.commands.updateAttributes("resizableImage",{caption:t})}})),f.addEventListener("input",(function(e){var t=e.target.textContent;"Enter caption..."!==t&&(e.target.style.color="#6b7280")})),f.addEventListener("keydown",(function(e){"Enter"===e.key&&(e.preventDefault(),f.blur()),e.stopPropagation()})),f.addEventListener("mousedown",(function(e){e.stopPropagation()})),f.addEventListener("click",(function(e){e.stopPropagation(),f.focus()})),f.addEventListener("dblclick",(function(e){e.stopPropagation()})));var h=document.createElement("img");Object.entries(t).forEach((function(e){var t=Kn(e,2),n=t[0],i=t[1];null===i||void 0===i||["caption","captionPosition","display"].includes(n)||h.setAttribute(n,i)})),h.style.maxWidth="100%",h.style.height="auto",h.style.display="block",h.style.margin="center"===s?"0 auto":"0";var v=document.createElement("div");v.className="resize-handle",v.style.position="absolute",v.style.bottom=f&&"bottom"===p?"30px":"0",v.style.right="0",v.style.width="12px",v.style.height="12px",v.style.background="#3b82f6",v.style.cursor="se-resize",v.style.opacity="0",v.style.transition="opacity 0.2s",v.style.borderRadius="3px",v.style.border="2px solid white",v.style.boxShadow="0 2px 4px rgba(0, 0, 0, 0.2)",v.style.zIndex="10",f&&"top"===p&&o.appendChild(f),o.appendChild(h),f&&"bottom"===p&&o.appendChild(f),o.appendChild(v),r.appendChild(o),o.addEventListener("mouseenter",(function(){v.style.opacity="1"})),o.addEventListener("mouseleave",(function(){v.style.opacity="0"}));var m,g,b,y,w,k=!1;return v.addEventListener("mousedown",(function(e){k=!0,m=e.clientX,g=e.clientY,b=parseInt(document.defaultView.getComputedStyle(h).width,10),y=parseInt(document.defaultView.getComputedStyle(h).height,10),w=y/b,o.style.outline="2px solid #3b82f6",o.style.outlineOffset="2px",e.preventDefault()})),document.addEventListener("mousemove",(function(e){if(k){var t=e.clientX-m,n=e.clientY-g,i=Math.max(t,n),r=Math.max(50,Math.min(800,b+i)),a=Math.round(r*w);requestAnimationFrame((function(){h.style.width=r+"px",h.style.height=a+"px",o.style.width=r+"px"}))}})),document.addEventListener("mouseup",(function(){if(k){k=!1,o.style.outline="",o.style.outlineOffset="";var e=parseInt(h.style.width,10),t=parseInt(h.style.height,10);"function"===typeof n&&i.commands.updateAttributes("resizableImage",{width:e,height:t})}})),r.addEventListener("click",(function(e){if((!f||e.target!==f&&!f.contains(e.target))&&(e.target===h||e.target===o||e.target===r)&&"function"===typeof n){var t=n();i.commands.setNodeSelection(t)}})),{dom:r,contentDOM:f,update:function(e){if("resizableImage"!==e.type.name)return!1;var t=e.attrs,n=a,i=s,r=p,o=l;return t.display===n&&t.align===i&&t.captionPosition===r&&t.spacing===o&&(Object.entries(t).forEach((function(e){var t=Kn(e,2),n=t[0],i=t[1];null===i||void 0===i||["caption","captionPosition","display"].includes(n)||h.setAttribute(n,i)})),f&&void 0!==t.caption&&document.activeElement!==f&&(f.textContent=t.caption||"Enter caption...",f.style.color=t.caption?"#6b7280":"#9ca3af"),!0)}}}},addCommands:function(){var e=this;return{setResizableImage:function(t){return function(n){var i=n.commands;return i.insertContent({type:e.name,attrs:Jn({display:"block",align:"left",caption:"",captionPosition:"none",spacing:"medium"},t)})}}}}});function oi(e){return oi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},oi(e)}var ai=["width","height","align","display","caption","captionPosition","spacing"];function si(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function li(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?si(Object(n),!0).forEach((function(t){ui(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):si(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ui(e,t,n){return(t=ci(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ci(e){var t=di(e,"string");return"symbol"==oi(t)?t:t+""}function di(e,t){if("object"!=oi(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=oi(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function pi(e,t){return gi(e)||mi(e,t)||hi(e,t)||fi()}function fi(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function hi(e,t){if(e){if("string"==typeof e)return vi(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vi(e,t):void 0}}function vi(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function mi(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,o,a,s=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=o.call(n)).done)&&(s.push(i.value),s.length!==t);l=!0);}catch(e){u=!0,r=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw r}}return s}}function gi(e){if(Array.isArray(e))return e}function bi(e,t){if(null==e)return{};var n,i,r=yi(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function yi(e,t){if(null==e)return{};var n={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;n[i]=e[i]}return n}var wi=O["Node"].create({name:"resizableVideo",group:"block",atom:!0,addAttributes:function(){return{src:{default:null},width:{default:560},height:{default:315},controls:{default:!0},nocookie:{default:!1},align:{default:"left"},display:{default:"block"},caption:{default:""},captionPosition:{default:"none"},spacing:{default:"medium"}}},parseHTML:function(){return[{tag:'iframe[src*="youtube.com"]',getAttrs:function(e){return{src:e.getAttribute("src"),width:e.getAttribute("width")||560,height:e.getAttribute("height")||315}}},{tag:'iframe[src*="youtu.be"]',getAttrs:function(e){return{src:e.getAttribute("src"),width:e.getAttribute("width")||560,height:e.getAttribute("height")||315}}}]},renderHTML:function(e){var t=e.HTMLAttributes,n=t.width,i=t.height,r=t.align,o=t.display,a=t.caption,s=t.captionPosition,l=t.spacing,u=bi(t,ai),c={small:"1em",medium:"1.5em",large:"2em"},d=c[l]||c.medium,p="display: block; border: none; border-radius: 8px; max-width: 100%;";if(n&&(p+=" width: ".concat(n,"px;")),i&&(p+=" height: ".concat(i,"px;")),!a||"none"===s)return"inline"===o?(p=p.replace("display: block;","display: inline-block; vertical-align: middle;"),p+="center"===r?" margin: 0 auto;":"right"===r?" float: right; margin-left: ".concat(d,";"):"left"===r?" float: left; margin-right: ".concat(d,";"):" margin: 0 ".concat(d,";")):"center"===r?p+=" margin-left: auto; margin-right: auto;":"right"===r?p+=" float: right; margin-left: ".concat(d,"; margin-bottom: ").concat(d,";"):"left"===r&&(p+=" float: left; margin-right: ".concat(d,"; margin-bottom: ").concat(d,";")),["iframe",Object(O["mergeAttributes"])(u,{frameborder:"0",allowfullscreen:"true",style:p})];var f="margin: 1em 0; max-width: 100%;";n&&(f+=" width: ".concat(n,"px;")),"inline"===o?(f+=" display: inline-block; vertical-align: middle;",f+="center"===r?" margin: 0 auto;":"right"===r?" margin-left: auto; margin-right: 0;":"left"===r?" margin-left: 0; margin-right: auto;":" margin: 0 ".concat(d,";")):(f+=" display: block;","center"===r?f+=" margin-left: auto; margin-right: auto; text-align: center;":"right"===r?f+=" float: right; margin-left: ".concat(d,"; margin-bottom: ").concat(d,";"):"left"===r&&(f+=" float: left; margin-right: ".concat(d,"; margin-bottom: ").concat(d,";")));var h="font-size: 0.875em; color: #6b7280; padding: 0.5em; text-align: center; font-style: italic; margin: 0;",v=["iframe",Object(O["mergeAttributes"])(u,{frameborder:"0",allowfullscreen:"true",style:p})],m=["figcaption",{style:h},a],g="top"===s?[m,v]:[v,m];return["figure",{style:f}].concat(g)},addNodeView:function(){return function(e){var t=e.HTMLAttributes,n=e.getPos,i=e.editor,r=document.createElement("div");r.className="resizable-video-container",r.style.position="relative",r.style.maxWidth="100%",r.style.margin="1em 0";var o=document.createElement("div");o.className="resizable-video-wrapper",o.style.position="relative",o.style.display="inline-block",o.style.maxWidth="100%",o.style.borderRadius="8px",o.style.overflow="hidden";var a=t.display||"block",s=t.align||"left",l=t.spacing||"medium",u={small:"0.5em",medium:"1em",large:"1.5em"},c=u[l]||u.medium;"inline"===a?(r.style.display="inline-block",r.style.verticalAlign="middle",r.style.float="none","center"===s?r.style.margin="0 auto":"right"===s?(r.style.marginLeft="auto",r.style.marginRight="0"):"left"===s?(r.style.marginLeft="0",r.style.marginRight="auto"):r.style.margin="0 0.5em"):"center"===s?(r.style.display="block",r.style.textAlign="center",r.style.marginLeft="auto",r.style.marginRight="auto",r.style.float="none"):(r.style.display="inline-block","right"===s?(r.style.float="right",r.style.marginLeft=c,r.style.marginBottom=c):"left"===s&&(r.style.float="left",r.style.marginRight=c,r.style.marginBottom=c));var d=t.caption||"",p=t.captionPosition||"none",f=null;"none"!==p&&(f=document.createElement("div"),f.className="video-caption",f.contentEditable="true",f.textContent=d||"Enter caption...",f.style.fontSize="0.875em",f.style.color=d?"#6b7280":"#9ca3af",f.style.padding="0.5em",f.style.textAlign="center",f.style.fontStyle="italic",f.style.outline="none",f.style.cursor="text",f.style.minHeight="2em",f.style.userSelect="text",f.style.background="rgba(0, 0, 0, 0.05)",f.setAttribute("data-placeholder","Enter caption..."),f.addEventListener("focus",(function(e){"Enter caption..."===e.target.textContent&&(e.target.textContent="",e.target.style.color="#6b7280")})),f.addEventListener("blur",(function(e){var t=e.target.textContent.trim();if(""===t||"Enter caption..."===t){if(e.target.textContent="Enter caption...",e.target.style.color="#9ca3af","function"===typeof n){var r=n();void 0!==r&&i.commands.updateAttributes("resizableVideo",{caption:""})}}else if("function"===typeof n){var o=n();void 0!==o&&i.commands.updateAttributes("resizableVideo",{caption:t})}})),f.addEventListener("input",(function(e){var t=e.target.textContent;"Enter caption..."!==t&&(e.target.style.color="#6b7280")})),f.addEventListener("keydown",(function(e){"Enter"===e.key&&(e.preventDefault(),f.blur()),e.stopPropagation()})),f.addEventListener("mousedown",(function(e){e.stopPropagation()})),f.addEventListener("click",(function(e){e.stopPropagation(),f.focus()})),f.addEventListener("dblclick",(function(e){e.stopPropagation()})));var h=document.createElement("iframe");Object.entries(t).forEach((function(e){var t=pi(e,2),n=t[0],i=t[1];null===i||void 0===i||["caption","captionPosition","display"].includes(n)||h.setAttribute(n,i)})),h.setAttribute("frameborder","0"),h.setAttribute("allowfullscreen","true"),h.style.display="block",h.style.borderRadius="8px",h.style.margin="center"===s?"0 auto":"0";var v=document.createElement("div");v.className="video-resize-handle",v.style.position="absolute",v.style.bottom=f&&"bottom"===p?"30px":"0",v.style.right="0",v.style.width="12px",v.style.height="12px",v.style.background="#3b82f6",v.style.cursor="se-resize",v.style.opacity="0",v.style.transition="opacity 0.2s",v.style.borderRadius="3px",v.style.border="2px solid white",v.style.boxShadow="0 2px 4px rgba(0, 0, 0, 0.2)",v.style.zIndex="10",f&&"top"===p&&o.appendChild(f),o.appendChild(h),f&&"bottom"===p&&o.appendChild(f),o.appendChild(v),r.appendChild(o),o.addEventListener("mouseenter",(function(){v.style.opacity="1"})),o.addEventListener("mouseleave",(function(){v.style.opacity="0"}));var m,g,b,y,w=!1;return v.addEventListener("mousedown",(function(e){w=!0,m=e.clientX,g=parseInt(h.getAttribute("width")||h.offsetWidth,10),b=parseInt(h.getAttribute("height")||h.offsetHeight,10),y=b/g,o.style.outline="2px solid #3b82f6",o.style.outlineOffset="2px",document.body.style.userSelect="none",document.body.style.cursor="se-resize",e.preventDefault(),e.stopPropagation()})),document.addEventListener("mousemove",(function(e){if(w){e.preventDefault(),e.stopPropagation();var t=e.clientX-m,n=Math.max(200,Math.min(800,g+t)),i=Math.round(n*y);h.setAttribute("width",n),h.setAttribute("height",i),h.style.width=n+"px",h.style.height=i+"px",o.style.width=n+"px"}})),document.addEventListener("mouseup",(function(){if(w){w=!1,o.style.outline="",o.style.outlineOffset="",document.body.style.userSelect="",document.body.style.cursor="";var e=parseInt(h.getAttribute("width"),10),t=parseInt(h.getAttribute("height"),10);"function"===typeof n&&i.commands.updateAttributes("resizableVideo",{width:e,height:t})}})),r.addEventListener("click",(function(e){if((!f||e.target!==f&&!f.contains(e.target))&&(e.target===h||e.target===o||e.target===r)&&"function"===typeof n){var t=n();i.commands.setNodeSelection(t)}})),{dom:r,contentDOM:f,update:function(e){if("resizableVideo"!==e.type.name)return!1;var t=e.attrs,n=a,i=s,r=p,o=l;return t.display===n&&t.align===i&&t.captionPosition===r&&t.spacing===o&&(Object.entries(t).forEach((function(e){var t=pi(e,2),n=t[0],i=t[1];null===i||void 0===i||["caption","captionPosition","display"].includes(n)||(h.setAttribute(n,i),"width"!==n&&"height"!==n||(h.style[n]=i+"px"))})),f&&void 0!==t.caption&&document.activeElement!==f&&(f.textContent=t.caption||"Enter caption...",f.style.color=t.caption?"#6b7280":"#9ca3af"),!0)}}}},addCommands:function(){var e=this;return{setResizableVideo:function(t){return function(n){var i=n.commands,r=t.src;if(r.includes("youtube.com/watch?v=")){var o=r.split("v=")[1].split("&")[0];r="https://www.youtube.com/embed/".concat(o)}else if(r.includes("youtu.be/")){var a=r.split("youtu.be/")[1].split("?")[0];r="https://www.youtube.com/embed/".concat(a)}return i.insertContent({type:e.name,attrs:li(li({display:"block",align:"left",caption:"",captionPosition:"none",spacing:"medium"},t),{},{src:r})})}}}}});function ki(e){return ki="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ki(e)}function xi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Ci(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xi(Object(n),!0).forEach((function(t){Si(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Si(e,t,n){return(t=Oi(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Oi(e){var t=_i(e,"string");return"symbol"==ki(t)?t:t+""}function _i(e,t){if("object"!=ki(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=ki(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var Ei=pn.a.extend({renderHTML:function(e){var t=e.HTMLAttributes;return["code",Ci(Ci({},t),{},{style:"background: #f1f5f9; padding: 0.2em 0.4em; border-radius: 3px; font-family: Monaco, Menlo, Ubuntu Mono, monospace; font-size: 0.9em; color: #e11d48;"}),0]}}),Mi=cn.extend({renderHTML:function(e){var t=e.HTMLAttributes;return["pre",Ci(Ci({},t),{},{style:"background: #1e293b; color: #e2e8f0; padding: 1em; border-radius: 6px; overflow-x: auto; margin: 1.5em 0;"}),["code",{style:"background: transparent; padding: 0; color: inherit; font-family: Monaco, Menlo, Ubuntu Mono, monospace;"},0]]}}),Ti=hn.extend({renderHTML:function(e){var t=e.HTMLAttributes;return["blockquote",Ci(Ci({},t),{},{style:"margin: 1.5em 0; padding: 0.8em 1.2em; border-left: 4px solid #3b82f6; background: #f8fafc; font-style: italic; color: #64748b;"}),0]}}),Ai=O["Extension"].create({name:"fontSize",addOptions:function(){return{types:["textStyle"]}},addGlobalAttributes:function(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:function(e){return e.style.fontSize||null},renderHTML:function(e){return e.fontSize?{style:"font-size: ".concat(e.fontSize)}:{}}}}}]},addCommands:function(){return{setFontSize:function(e){return function(t){var n=t.chain;return n().setMark("textStyle",{fontSize:e}).run()}},unsetFontSize:function(){return function(e){var t=e.chain;return t().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}}}}),Li=O["Extension"].create({name:"lineHeight",addOptions:function(){return{types:["paragraph","heading"]}},addGlobalAttributes:function(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:function(e){return e.style.lineHeight||null},renderHTML:function(e){return e.lineHeight?{style:"line-height: ".concat(e.lineHeight)}:{}}}}}]},addCommands:function(){var e=this;return{setLineHeight:function(t){return function(n){var i=n.commands;return e.options.types.every((function(e){return i.updateAttributes(e,{lineHeight:t})}))}},unsetLineHeight:function(){return function(t){var n=t.commands;return e.options.types.every((function(e){return n.resetAttributes(e,"lineHeight")}))}}}}});function Bi(e,t){if(!e){console.error("โ BBL Editor: Props is null or undefined");var n=Object(l["ref"])(null),i=Object(l["ref"])(!1),r=Object(l["ref"])("Props not provided"),o=Object(l["ref"])(["Props not provided"]);return{editor:n,isEditorReady:i,currentContent:Object(l["computed"])((function(){return""})),editorError:r,missingDependencies:o,executeCommand:function(){},isActive:function(){return!1},getContent:function(){return""},setContent:function(){},focus:function(){},blur:function(){}}}console.log("๐ง BBL Editor: useEditor called with props:",e);var a=Object(l["ref"])(null),u=Object(l["ref"])(!1),d=Object(l["ref"])(e.value||""),f=Object(l["ref"])(null),v=Object(l["ref"])([]),g=Object(l["ref"])(null),y=Object(l["computed"])((function(){if(!a.value||!e)return"";var t=e.outputFormat||"html",n="json"===t?JSON.stringify(a.value.getJSON()):a.value.getHTML();return"html"===t&&!1!==e.wrapWithContentClass?'<div class="bbl-html-section">'.concat(n,"</div>"):n})),k=function(){var e=[];try{console.log("๐ BBL Editor: Starting dependency check..."),"function"!==typeof l["ref"]?(e.push("@vue/composition-api (ref)"),console.error("โ Missing: @vue/composition-api - ref function not available")):console.log("โ
Vue Composition API: ref available"),"function"!==typeof l["computed"]?(e.push("@vue/composition-api (computed)"),console.error("โ Missing: @vue/composition-api - computed function not available")):console.log("โ
Vue Composition API: computed available"),"function"!==typeof l["watch"]?(e.push("@vue/composition-api (watch)"),console.error("โ Missing: @vue/composition-api - watch function not available")):console.log("โ
Vue Composition API: watch available"),"function"!==typeof l["onMounted"]?(e.push("@vue/composition-api (onMounted)"),console.error("โ Missing: @vue/composition-api - onMounted function not available")):console.log("โ
Vue Composition API: onMounted available");try{s["Editor"]&&"function"===typeof s["Editor"]?console.log("โ
Tiptap: Editor class available"):(e.push("@tiptap/vue-2 (Editor)"),console.error("โ Missing: @tiptap/vue-2 - Editor class not available"))}catch(n){e.push("@tiptap/vue-2 (Editor)"),console.error("โ Error accessing Editor:",n.message)}try{c.a&&"function"===typeof c.a.configure?console.log("โ
Tiptap: StarterKit available"):(e.push("@tiptap/starter-kit"),console.error("โ Missing: @tiptap/starter-kit"))}catch(n){e.push("@tiptap/starter-kit"),console.error("โ Error accessing StarterKit:",n.message)}var t=[{name:"TextAlign",module:p.a,package:"@tiptap/extension-text-align"},{name:"Underline",module:h.a,package:"@tiptap/extension-underline"},{name:"TextStyle",module:m.a,package:"@tiptap/extension-text-style"},{name:"Color",module:b.a,package:"@tiptap/extension-color"},{name:"Highlight",module:w.a,package:"@tiptap/extension-highlight"},{name:"Link",module:x.a,package:"@tiptap/extension-link"},{name:"FontFamily",module:S.a,package:"@tiptap/extension-font-family"},{name:"Extension",module:O["Extension"],package:"@tiptap/core (Extension)"},{name:"CodeBlock",module:cn,package:"@tiptap/extension-code-block"},{name:"Code",module:pn.a,package:"@tiptap/extension-code"},{name:"Blockquote",module:hn,package:"@tiptap/extension-blockquote"},{name:"Table",module:mn.a,package:"@tiptap/extension-table"},{name:"TableRow",module:bn.a,package:"@tiptap/extension-table-row"},{name:"TaskList",module:Dn.a,package:"@tiptap/extension-task-list"},{name:"TaskItem",module:Rn.a,package:"@tiptap/extension-task-item"},{name:"Placeholder",module:Un.a,package:"@tiptap/extension-placeholder"}];t.forEach((function(t){var i=t.name,r=t.module,o=t.package;try{r?console.log("โ
Extension: ".concat(i," available")):(e.push(o),console.error("โ Missing: ".concat(o," (").concat(i,")")))}catch(n){e.push(o),console.error("โ Error accessing ".concat(i,":"),n.message)}}))}catch(i){console.error("โ Critical error during dependency check:",i),e.push("Critical dependency check error: "+i.message)}return console.log("๐ BBL Editor: Dependency check complete. Missing: ".concat(e.length)),e.length>0?console.error("โ Missing dependencies:",e):console.log("โ
All dependencies available!"),v.value=e,0===e.length},C=function(){try{if(console.log("๐ BBL Editor: Starting editor initialization..."),console.log("๐ง BBL Editor: Props received:",{toolbarConfig:e.toolbarConfig,extensionConfig:e.extensionConfig,placeholder:e.placeholder}),!k())return console.error("โ BBL Editor: Dependency check failed"),f.value="Missing required dependencies",void t("error",{type:"missing-dependencies",dependencies:v.value,message:"Please install all required dependencies"});console.log("โ
BBL Editor: All dependencies available, creating editor...");var n=e.toolbarConfig||{bold:!0,italic:!0,underline:!0,strike:!0,code:!0,textColor:!0,highlight:!0,fontFamily:!0,fontSize:!0,textAlign:!0,lineHeight:!0,headings:!0,lists:!0,blockquote:!0,codeBlock:!0,horizontalRule:!0,link:!0,image:!0,video:!0,table:!0,clearFormatting:!0,sourceCode:!0,undo:!0,redo:!0},i=e.extensionConfig||{image:{allowResize:!0,allowAlignment:!0,allowDelete:!0,maxWidth:"100%",quality:.8},video:{allowResize:!0,allowAlignment:!0,allowDelete:!0,maxWidth:"100%",autoplay:!1},table:{resizable:!0,allowRowControls:!0,allowColumnControls:!0,cellSelection:!0},link:{openOnClick:!1,autolink:!0,linkOnPaste:!0},textAlign:{types:["heading","paragraph"]}};console.log("๐ง BBL Editor: Using safe configs:",{toolbarConfig:n,extensionConfig:i});var r=[c.a.configure({image:!1,youtube:!1,table:!1,codeBlock:!1,code:!1,blockquote:!1}),Ei,Mi,Ti,m.a,Un.a.configure({placeholder:e.placeholder||"Start writing..."})];console.log("๐ง BBL Editor: Base extensions configured"),i.textAlign&&(r.push(p.a.configure(i.textAlign)),console.log("โ
Added: TextAlign extension")),n.underline&&(r.push(h.a),console.log("โ
Added: Underline extension")),n.textColor&&(r.push(b.a.configure({types:[m.a.name]})),console.log("โ
Added: Color extension")),n.highlight&&(r.push(w.a.configure({multicolor:!0})),console.log("โ
Added: Highlight extension")),n.fontFamily&&(r.push(S.a.configure({types:[m.a.name]})),console.log("โ
Added: FontFamily extension")),n.fontSize&&(r.push(Ai),console.log("โ
Added: FontSize extension")),n.lineHeight&&(r.push(Li),console.log("โ
Added: LineHeight extension")),n.link&&(r.push(x.a.configure(Ci(Ci({},i.link),{},{HTMLAttributes:{class:"editor-link"}}))),console.log("โ
Added: Link extension")),n.image&&(r.push(ri.configure(i.image)),console.log("โ
Added: ResizableImage extension")),n.video&&(r.push(wi.configure(i.video)),console.log("โ
Added: ResizableVideo extension")),n.table&&(r.push(mn.a.configure(i.table),bn.a,En,In),console.log("โ
Added: Table extensions")),n.lists&&(r.push(Dn.a,Rn.a.configure({nested:!0})),console.log("โ
Added: List extensions")),console.log("๐ง BBL Editor: Total extensions: ".concat(r.length)),console.log("๐ BBL Editor: Creating Tiptap Editor instance..."),a.value=new s["Editor"]({content:e.value||"",editable:!1!==e.editable,autofocus:e.autofocus||!1,extensions:r,onUpdate:function(){var e=y.value;e!==d.value&&(d.value=e,t("input",e),t("update",e)),setTimeout((function(){t("enhance-tables")}),200)},onCreate:function(){console.log("๐ BBL Editor: Editor created successfully!"),g.value&&(clearTimeout(g.value),g.value=null),u.value=!0,f.value=null,t("ready",a.value),t("created",a.value),setTimeout((function(){t("enhance-tables")}),100)},onFocus:function(){t("focus")},onBlur:function(){t("blur")},onDestroy:function(){console.log("๐๏ธ BBL Editor: Editor destroyed"),t("destroyed")}}),console.log("โ
BBL Editor: Editor instance created, waiting for onCreate...")}catch(o){console.error("โ BBL Editor: Initialization failed:",o),console.error("โ Error stack:",o.stack),f.value=o.message,t("error",{type:"initialization-failed",error:o.message,stack:o.stack,message:"Failed to initialize editor"})}},_=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(a.value)switch(e){case"setTextAlign":a.value.chain().focus().setTextAlign(t).run();break;case"setColor":a.value.chain().focus().setColor(t).run();break;case"setHighlight":a.value.chain().focus().setHighlight(t).run();break;case"setFontFamily":a.value.chain().focus().setFontFamily(t).run();break;case"setFontSize":a.value.chain().focus().setFontSize(t).run();break;case"setLineHeight":a.value.chain().focus().setLineHeight(t).run();break;case"setLink":a.value.chain().focus().setLink(t).run();break;case"setResizableImage":a.value.chain().focus().setResizableImage(t).run();break;case"setResizableVideo":a.value.chain().focus().setResizableVideo(t).run();break;case"insertTable":a.value.chain().focus().insertTable(t).run();break;case"toggleHeading":a.value.chain().focus().toggleHeading(t).run();break;case"setParagraph":a.value.chain().focus().setParagraph().run();break;case"toggleBlockquote":a.value.chain().focus().toggleBlockquote().run();break;case"setBlockquote":a.value.chain().focus().setBlockquote().run();break;case"unsetBlockquote":a.value.chain().focus().unsetBlockquote().run();break;case"unsetAllMarks":a.value.chain().focus().unsetAllMarks().run();break;case"clearNodes":a.value.chain().focus().clearNodes().run();break;default:"function"===typeof a.value.chain().focus()[e]&&a.value.chain().focus()[e](t).run()}},E=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!!a.value&&a.value.isActive(e,t)},M=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!a.value)return"";var i=t||e.outputFormat,r="json"===i?a.value.getJSON():a.value.getHTML(),o=null!==n?n:!1!==e.wrapWithContentClass;return"html"===i&&o?'<div class="bbl-html-section">'.concat(r,"</div>"):r},T=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];a.value&&a.value.commands.setContent(e,t)},A=function(){a.value&&a.value.commands.focus()},L=function(){a.value&&a.value.commands.blur()};return Object(l["watch"])((function(){return null===e||void 0===e?void 0:e.value}),(function(e){a.value&&e!==d.value&&(a.value.commands.setContent(e,!1),d.value=e)})),Object(l["watch"])((function(){return null===e||void 0===e?void 0:e.editable}),(function(e){a.value&&a.value.setEditable(e)})),Object(l["onMounted"])((function(){console.log("๐ BBL Editor: Component mounted, starting initialization..."),g.value=setTimeout((function(){u.value||f.value||(console.error("โฐ BBL Editor: Initialization timeout - editor stuck in loading state"),f.value="Editor initialization timeout - check console for details",t("error",{type:"initialization-timeout",message:"Editor failed to initialize within 10 seconds",dependencies:v.value}))}),1e4),C()})),Object(l["onBeforeUnmount"])((function(){console.log("๐งน BBL Editor: Component unmounting..."),g.value&&clearTimeout(g.value),a.value&&a.value.destroy()})),{editor:a,isEditorReady:u,currentContent:y,editorError:f,missingDependencies:v,executeCommand:_,isActive:E,getContent:M,setContent:T,focus:A,blur:L}}var zi=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"premium-toolbar-container"},[n("div",{staticClass:"toolbar-main"},[n("div",{staticClass:"toolbar-content"},[n("ToolbarGroup",[n("ToolbarButton",{attrs:{disabled:!e.canUndo,title:"Undo (Ctrl+Z)"},on:{click:function(t){return e.executeCommand("undo")}}},[n("Previous")],1),n("ToolbarButton",{attrs:{disabled:!e.canRedo,title:"Redo (Ctrl+Y)"},on:{click:function(t){return e.executeCommand("redo")}}},[n("Next")],1)],1),n("ToolbarGroup",[n("HeadingDropdown",{staticClass:"margin-right-0",attrs:{"model-value":e.currentHeading},on:{change:e.setHeading}}),n("FontFamilyDropdown",{staticClass:"margin-right-0",attrs:{"model-value":e.currentFontFamily},on:{change:e.setFontFamily}}),n("FontSizeDropdown",{staticClass:"margin-right-0",attrs:{"model-value":e.currentFontSize},on:{change:e.setFontSize}})],1),n("ToolbarGroup",[n("ToolbarButton",{attrs:{active:e.isActive("bold"),title:"Bold (Ctrl+B)"},on:{click:function(t){return e.executeCommand("toggleBold")}}},[n("strong",[e._v("B")])]),n("ToolbarButton",{attrs:{active:e.isActive("italic"),title:"Italic (Ctrl+I)"},on:{click:function(t){return e.executeCommand("toggleItalic")}}},[n("em",[e._v("I")])]),n("ToolbarButton",{attrs:{active:e.isActive("underline"),title:"Underline (Ctrl+U)"},on:{click:function(t){return e.executeCommand("toggleUnderline")}}},[n("u",[e._v("U")])]),n("ToolbarButton",{attrs:{active:e.isActive("strike"),title:"Strikethrough"},on:{click:function(t){return e.executeCommand("toggleStrike")}}},[n("s",[e._v("S")])]),n("ToolbarButton",{attrs:{title:"Horizontal Rule"},on:{click:function(t){return e.executeCommand("setHorizontalRule")}}},[e._v(" โ ")])],1),n("ToolbarGroup",[n("ColorPickerDropdown",{attrs:{"model-value":e.currentTextColor,title:"Text Color"},on:{change:e.setTextColor,remove:e.removeTextColor}}),n("HighlightPickerDropdown",{attrs:{"model-value":e.currentHighlightColor,title:"Highlight Color"},on:{change:e.setHighlight,remove:e.removeHighlight}})],1),n("ToolbarGroup",[n("AlignmentDropdown",{attrs:{"model-value":e.currentAlignment},on:{change:e.setAlignment}}),n("LineHeightDropdown",{attrs:{"model-value":e.currentLineHeight},on:{change:e.setLineHeight}}),n("ListDropdown",{attrs:{"model-value":e.currentList},on:{change:e.setList}}),n("TableDropdown",{on:{insert:e.handleTableInsert}})],1),n("ToolbarGroup",[n("ToolbarButton",{attrs:{title:"Insert Link"},on:{click:function(t){return e.$emit("insert-link")}}},[n("Link")],1),n("ToolbarButton",{attrs:{title:"Insert Image"},on:{click:function(t){return e.$emit("insert-image")}}},[n("ImageSvg")],1),n("ToolbarButton",{attrs:{title:"Insert Video"},on:{click:function(t){return e.$emit("insert-video")}}},[n("Video")],1)],1),n("ToolbarGroup",[n("ToolbarButton",{attrs:{active:e.isActive("blockquote"),title:"Quote"},on:{click:function(t){return e.executeCommand("toggleBlockquote")}}},[n("Quote")],1),n("ToolbarButton",{attrs:{active:e.isActive("codeBlock"),title:"Code Block"},on:{click:function(t){return e.executeCommand("toggleCodeBlock")}}},[n("CodeBlock")],1),n("ToolbarButton",{attrs:{title:"Clear Formatting"},on:{click:function(t){return e.$emit("clear-formatting")}}},[n("ClearFormatting")],1),n("ToolbarButton",{attrs:{active:e.sourceCodeMode,title:"Source Code"},on:{click:function(t){return e.$emit("toggle-source-code")}}},[n("Code")],1)],1)],1)])])},ji=[],Pi=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"bbl-toolbar-group"},[e._t("default")],2)},Ii=[],Hi={name:"ToolbarGroup"},Di=Hi;function Fi(e,t,n,i,r,o,a,s){var l,u="function"===typeof e?e.options:e;if(t&&(u.render=t,u.staticRenderFns=n,u._compiled=!0),i&&(u.functional=!0),o&&(u._scopeId="data-v-"+o),a?(l=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),r&&r.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},u._ssrRegister=l):r&&(l=s?function(){r.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:r),l)if(u.functional){u._injectStyles=l;var c=u.render;u.render=function(e,t){return l.call(t),c(e,t)}}else{var d=u.beforeCreate;u.beforeCreate=d?[].concat(d,l):[l]}return{exports:e,options:u}}var Ri=Fi(Di,Pi,Ii,!1,null,null,null),$i=Ri.exports,Ui=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("button",{class:["toolbar-btn",{active:e.active}],attrs:{title:e.title,disabled:e.disabled},on:{click:function(t){return e.$emit("click")}}},[e._t("default")],2)},Ni=[],Vi={name:"ToolbarButton",props:{active:{type:Boolean,default:!1},title:{type:String,default:""},disabled:{type:Boolean,default:!1}},emits:["click"]},qi=Vi,Ji=(n("55bc"),Fi(qi,Ui,Ni,!1,null,"049b1133",null)),Wi=Ji.exports,Gi=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{ref:"dropdown",staticClass:"heading-dropdown"},[n("button",{staticClass:"heading-bbl-dropdown-trigger",class:{"is-open":e.isOpen},on:{click:e.toggleDropdown}},[n("span",{staticClass:"heading-preview",class:"preview-"+e.currentValue},[e._v(" "+e._s(e.currentLabel)+" ")]),n("svg",{staticClass:"dropdown-icon",class:{rotate:e.isOpen},attrs:{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"}},[n("path",{attrs:{d:"M2.5 4.5L6 8L9.5 4.5",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}})])]),n("transition",{attrs:{name:"dropdown-fade"}},[e.isOpen?n("div",{staticClass:"heading-bbl-dropdown-menu"},[n("div",{staticClass:"bbl-dropdown-menu-inner"},e._l(e.options,(function(t){return n("button",{key:t.value,staticClass:"heading-option",class:{"is-active":e.currentValue===t.value},on:{click:function(n){return e.selectOption(t)}}},[n("span",{staticClass:"option-preview",class:"preview-"+t.value},[e._v(" "+e._s(t.label)+" ")]),e.currentValue===t.value?n("svg",{staticClass:"check-icon",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"}},[n("path",{attrs:{d:"M13.5 4L6 11.5L2.5 8",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}})]):e._e()])})),0)]):e._e()])],1)},Zi=[],Ki={name:"HeadingDropdown",props:{modelValue:{type:String,default:""}},emits:["update:modelValue","change"],data:function(){return{isOpen:!1,options:[{value:"paragraph",label:"Paragraph"},{value:"1",label:"Heading 1"},{value:"2",label:"Heading 2"},{value:"3",label:"Heading 3"},{value:"4",label:"Heading 4"},{value:"5",label:"Heading 5"},{value:"6",label:"Heading 6"}]}},computed:{currentValue:function(){return this.modelValue||"paragraph"},currentLabel:function(){var e=this,t=this.options.find((function(t){return t.value===e.currentValue}));return t?t.label:"Select Style"}},mounted:function(){document.addEventListener("click",this.handleClickOutside)},beforeUnmount:function(){document.removeEventListener("click",this.handleClickOutside)},methods:{toggleDropdown:function(){this.isOpen=!this.isOpen},selectOption:function(e){this.$emit("update:modelValue",e.value),this.$emit("change",{target:{value:e.value}}),this.isOpen=!1},handleClickOutside:function(e){this.$refs.dropdown&&!this.$refs.dropdown.contains(e.target)&&(this.isOpen=!1)}}},Qi=Ki,Yi=(n("bc12"),Fi(Qi,Gi,Zi,!1,null,"316569f8",null)),Xi=Yi.exports,er=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{ref:"dropdown",staticClass:"font-dropdown"},[n("button",{staticClass:"font-bbl-dropdown-trigger",class:{"is-open":e.isOpen},on:{click:e.toggleDropdown}},[n("span",{staticClass:"font-preview",style:{fontFamily:e.currentValue||"inherit"}},[e._v(" "+e._s(e.currentLabel)+" ")]),n("svg",{staticClass:"dropdown-icon",class:{rotate:e.isOpen},attrs:{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"}},[n("path",{attrs:{d:"M2.5 4.5L6 8L9.5 4.5",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}})])]),n("transition",{attrs:{name:"dropdown-fade"}},[e.isOpen?n("div",{staticClass:"font-bbl-dropdown-menu"},[n("div",{staticClass:"bbl-dropdown-search"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.searchQuery,expression:"searchQuery"}],staticClass:"bbl-search-input",attrs:{type:"text",placeholder:"Search fonts..."},domProps:{value:e.searchQuery},on:{click:function(e){e.stopPropagation()},input:function(t){t.target.composing||(e.searchQuery=t.target.value)}}})]),n("div",{staticClass:"bbl-dropdown-menu-inner"},[e._l(e.filteredOptions,(function(t){return n("button",{key:t.value,staticClass:"font-option",class:{"is-active":e.currentValue===t.value},on:{click:function(n){return e.selectOption(t)}}},[n("span",{staticClass:"option-preview",style:{fontFamily:t.value||"inherit"}},[e._v(" "+e._s(t.label)+" ")]),e.currentValue===t.value?n("svg",{staticClass:"check-icon",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"}},[n("path",{attrs:{d:"M13.5 4L6 11.5L2.5 8",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}})]):e._e()])})),0===e.filteredOptions.length?n("div",{staticClass:"no-results"},[e._v(" No fonts found ")]):e._e()],2)]):e._e()])],1)},tr=[],nr={name:"FontFamilyDropdown",props:{modelValue:{type:String,default:""}},emits:["update:modelValue","change"],data:function(){return{isOpen:!1,searchQuery:"",options:[{value:"",label:"Default Font"},{value:"Arial, sans-serif",label:"Arial"},{value:"'Helvetica Neue', Helvetica, sans-serif",label:"Helvetica"},{value:"'Times New Roman', Times, serif",label:"Times New Roman"},{value:"Georgia, serif",label:"Georgia"},{value:"'Courier New', Courier, monospace",label:"Courier New"},{value:"Verdana, sans-serif",label:"Verdana"},{value:"'Trebuchet MS', sans-serif",label:"Trebuchet MS"},{value:"'Comic Sans MS', cursive",label:"Comic Sans MS"},{value:"Impact, Charcoal, sans-serif",label:"Impact"},{value:"'Lucida Sans Unicode', 'Lucida Grande', sans-serif",label:"Lucida Sans"},{value:"Tahoma, Geneva, sans-serif",label:"Tahoma"},{value:"'Palatino Linotype', 'Book Antiqua', Palatino, serif",label:"Palatino"},{value:"Garamond, serif",label:"Garamond"},{value:"'Bookman Old Style', serif",label:"Bookman"},{value:"'Arial Black', Gadget, sans-serif",label:"Arial Black"},{value:"'Brush Script MT', cursive",label:"Brush Script"},{value:"'Copperplate', 'Copperplate Gothic Light', fantasy",label:"Copperplate"},{value:"Papyrus, fantasy",label:"Papyrus"},{value:"'Lucida Console', Monaco, monospace",label:"Lucida Console"},{value:"'Andale Mono', monospace",label:"Andale Mono"},{value:"'Consolas', monospace",label:"Consolas"},{value:"'Monaco', monospace",label:"Monaco"},{value:"'Roboto', sans-serif",label:"Roboto"},{value:"'Open Sans', sans-serif",label:"Open Sans"},{value:"'Lato', sans-serif",label:"Lato"},{value:"'Montserrat', sans-serif",label:"Montserrat"},{value:"'Poppins', sans-serif",label:"Poppins"},{value:"'Source Sans Pro', sans-serif",label:"Source Sans Pro"},{value:"'Raleway', sans-serif",label:"Raleway"},{value:"'PT Sans', sans-serif",label:"PT Sans"},{value:"'Merriweather', serif",label:"Merriweather"},{value:"'Playfair Display', serif",label:"Playfair Display"},{value:"'Noto Sans', sans-serif",label:"Noto Sans"},{value:"'Ubuntu', sans-serif",label:"Ubuntu"},{value:"'Nunito', sans-serif",label:"Nunito"},{value:"'Oswald', sans-serif",label:"Oswald"},{value:"'Quicksand', sans-serif",label:"Quicksand"},{value:"'Fira Sans', sans-serif",label:"Fira Sans"},{value:"'Inter', sans-serif",label:"Inter"},{value:"'Work Sans', sans-serif",label:"Work Sans"}]}},computed:{currentValue:function(){return this.modelValue||""},currentLabel:function(){var e=this,t=this.options.find((function(t){return t.value===e.currentValue}));return t?t.label:"Default Font"},filteredOptions:function(){if(!this.searchQuery)return this.options;var e=this.searchQuery.toLowerCase();return this.options.filter((function(t){return t.label.toLowerCase().includes(e)}))}},mounted:function(){document.addEventListener("click",this.handleClickOutside)},beforeUnmount:function(){document.removeEventListener("click",this.handleClickOutside)},methods:{toggleDropdown:function(){var e=this;this.isOpen=!this.isOpen,this.isOpen&&(this.searchQuery="",this.$nextTick((function(){var t=e.$el.querySelector(".bbl-search-input");t&&t.focus()})))},selectOption:function(e){this.$emit("update:modelValue",e.value),this.$emit("change",{target:{value:e.value}}),this.isOpen=!1,this.searchQuery=""},handleClickOutside:function(e){this.$refs.dropdown&&!this.$refs.dropdown.contains(e.target)&&(this.isOpen=!1,this.searchQuery="")}}},ir=nr,rr=(n("533b"),Fi(ir,er,tr,!1,null,"63c4f28f",null)),or=rr.exports,ar=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{ref:"dropdown",staticClass:"fontsize-dropdown"},[n("button",{staticClass:"fontsize-bbl-dropdown-trigger",class:{"is-open":e.isOpen},on:{click:e.toggleDropdown}},[n("span",{staticClass:"fontsize-preview"},[e._v(" "+e._s(e.currentLabel)+" ")]),n("svg",{staticClass:"dropdown-icon",class:{rotate:e.isOpen},attrs:{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"}},[n("path",{attrs:{d:"M2.5 4.5L6 8L9.5 4.5",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}})])]),n("transition",{attrs:{name:"dropdown-fade"}},[e.isOpen?n("div",{staticClass:"fontsize-bbl-dropdown-menu"},[n("div",{staticClass:"bbl-dropdown-menu-inner"},e._l(e.options,(function(t){return n("button",{key:t.value,staticClass:"fontsize-option",class:{"is-active":e.currentValue===t.value},on:{click:function(n){return e.selectOption(t)}}},[n("span",{staticClass:"option-label"},[e._v(e._s(t.label))]),n("span",{staticClass:"option-preview",style:{fontSize:t.previewSize}},[e._v(" Aa ")]),e.currentValue===t.value?n("svg",{staticClass:"check-icon",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"}},[n("path",{attrs:{d:"M13.5 4L6 11.5L2.5 8",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}})]):e._e()])})),0)]):e._e()])],1)},sr=[],lr={name:"FontSizeDropdown",props:{modelValue:{type:String,default:""}},emits:["update:modelValue","change"],data:function(){return{isOpen:!1,options:[{value:"",label:"Default",previewSize:"14px"},{value:"8px",label:"8px",previewSize:"8px"},{value:"9px",label:"9px",previewSize:"9px"},{value:"10px",label:"10px",previewSize:"10px"},{value:"11px",label:"11px",previewSize:"11px"},{value:"12px",label:"12px",previewSize:"12px"},{value:"14px",label:"14px (H6)",previewSize:"14px"},{value:"16px",label:"16px (H5)",previewSize:"16px"},{value:"18px",label:"18px (H4)",previewSize:"18px"},{value:"20px",label:"20px (H3)",previewSize:"20px"},{value:"22px",label:"22px",previewSize:"22px"},{value:"24px",label:"24px (H2)",previewSize:"24px"},{value:"26px",label:"26px",previewSize:"26px"},{value:"28px",label:"28px",previewSize:"28px"},{value:"30px",label:"30px",previewSize:"30px"},{value:"32px",label:"32px (H1)",previewSize:"32px"},{value:"36px",label:"36px",previewSize:"36px"},{value:"40px",label:"40px",previewSize:"40px"},{value:"48px",label:"48px",previewSize:"48px"},{value:"56px",label:"56px",previewSize:"56px"},{value:"64px",label:"64px",previewSize:"64px"},{value:"72px",label:"72px",previewSize:"72px"}]}},computed:{currentValue:function(){return this.modelValue||""},currentLabel:function(){var e=this,t=this.options.find((function(t){return t.value===e.currentValue}));return t?t.label:"Default"}},mounted:function(){document.addEventListener("click",this.handleClickOutside)},beforeUnmount:function(){document.removeEventListener("click",this.handleClickOutside)},methods:{toggleDropdown:function(){this.isOpen=!this.isOpen},selectOption:function(e){this.$emit("update:modelValue",e.value),this.$emit("change",{target:{value:e.value}}),this.isOpen=!1},handleClickOutside:function(e){this.$refs.dropdown&&!this.$refs.dropdown.contains(e.target)&&(this.isOpen=!1)}}},ur=lr,cr=(n("e6e8"),Fi(ur,ar,sr,!1,null,"48e8063c",null)),dr=cr.exports,pr=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{ref:"dropdown",staticClass:"lineheight-dropdown"},[n("button",{staticClass:"lineheight-bbl-dropdown-trigger",class:{"is-open":e.isOpen},attrs:{title:"Line Height"},on:{click:e.toggleDropdown}},[n("svg",{attrs:{width:"20",height:"20",viewBox:"0 0 20 20","aria-hidden":"true"}},[n("path",{attrs:{d:"m17.975 15.279.779-.779.707.707-2.265 2.265-2.193-2.265.707-.707.765.765V4.825q0-.063.002-.123l-.77.77L15 4.765 17.196 2.5l2.265 2.265-.707.707-.782-.782q.003.065.003.135zM1 15.75c0 .414.273.75.61.75h8.067a.56.56 0 0 0 .43-.22.85.85 0 0 0 .18-.53.85.85 0 0 0-.18-.53.56.56 0 0 0-.43-.22H1.609a.56.56 0 0 0-.43.22.85.85 0 0 0-.179.53m0-12c0 .414.273.75.61.75h11.78a.56.56 0 0 0 .431-.22.85.85 0 0 0 .179-.53.85.85 0 0 0-.178-.53.56.56 0 0 0-.431-.22H1.609a.56.56 0 0 0-.43.22.85.85 0 0 0-.179.53m0 4c0 .414.273.75.61.75h11.78a.56.56 0 0 0 .431-.22.85.85 0 0 0 .179-.53.85.85 0 0 0-.178-.53.56.56 0 0 0-.431-.22H1.609a.56.56 0 0 0-.43.22.85.85 0 0 0-.179.53m0 4c0 .414.273.75.61.75h11.78a.56.56 0 0 0 .431-.22.85.85 0 0 0 .179-.53.85.85 0 0 0-.178-.53.56.56 0 0 0-.431-.22H1.609a.56.56 0 0 0-.43.22.85.85 0 0 0-.179.53"}})]),n("svg",{staticClass:"dropdown-icon",class:{rotate:e.isOpen},attrs:{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"}},[n("path",{attrs:{d:"M2.5 4.5L6 8L9.5 4.5",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}})])]),n("transition",{attrs:{name:"dropdown-fade"}},[e.isOpen?n("div",{staticClass:"lineheight-bbl-dropdown-menu"},[n("div",{staticClass:"bbl-dropdown-menu-inner"},e._l(e.options,(function(t){return n("button",{key:t.value,staticClass:"lineheight-option",class:{"is-active":e.currentValue===t.value},on:{click:function(n){return e.selectOption(t)}}},[n("span",{staticClass:"option-label"},[e._v(e._s(t.label))]),n("span",{staticClass:"option-description"},[e._v(e._s(t.description))]),e.currentValue===t.value?n("svg",{staticClass:"check-icon",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"}},[n("path",{attrs:{d:"M13.5 4L6 11.5L2.5 8",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}})]):e._e()])})),0)]):e._e()])],1)},fr=[],hr={name:"LineHeightDropdown",props:{modelValue:{type:String,default:""}},emits:["update:modelValue","change"],data:function(){return{isOpen:!1,options:[{value:"1",label:"1.0"},{value:"1.15",label:"1.15"},{value:"1.5",label:"1.5"},{value:"1.75",label:"1.75"},{value:"2",label:"2.0"},{value:"2.5",label:"2.5"},{value:"3",label:"3.0"}]}},computed:{currentValue:function(){return this.modelValue||""},currentLabel:function(){var e=this,t=this.options.find((function(t){return t.value===e.currentValue}));return t?t.label:"Default"}},mounted:function(){document.addEventListener("click",this.handleClickOutside)},beforeUnmount:function(){document.removeEventListener("click",this.handleClickOutside)},methods:{toggleDropdown:function(){this.isOpen=!this.isOpen},selectOption:function(e){this.$emit("update:modelValue",e.value),this.$emit("change",{target:{value:e.value}}),this.isOpen=!1},handleClickOutside:function(e){this.$refs.dropdown&&!this.$refs.dropdown.contains(e.target)&&(this.isOpen=!1)}}},vr=hr,mr=(n("2505"),Fi(vr,pr,fr,!1,null,"2f569a71",null)),gr=mr.exports,br=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{ref:"dropdown",staticClass:"alignment-dropdown"},[n("button",{staticClass:"alignment-bbl-dropdown-trigger",class:{"is-open":e.isOpen},attrs:{title:"Text Alignment"},on:{click:e.toggleDropdown}},[n(e.currentIcon,{tag:"component"}),n("svg",{staticClass:"dropdown-icon",class:{rotate:e.isOpen},attrs:{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"}},[n("path",{attrs:{d:"M2.5 4.5L6 8L9.5 4.5",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}})])],1),n("transition",{attrs:{name:"dropdown-fade"}},[e.isOpen?n("div",{staticClass:"alignment-bbl-dropdown-menu"},[n("div",{staticClass:"bbl-dropdown-menu-inner"},e._l(e.options,(function(t){return n("button",{key:t.value,staticClass:"alignment-option",class:{"is-active":e.currentValue===t.value},on:{click:function(n){return e.selectOption(t)}}},[n(t.icon,{tag:"component",staticClass:"option-icon"}),n("span",{staticClass:"option-label"},[e._v(e._s(t.label))]),e.currentValue===t.value?n("svg",{staticClass:"check-icon",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"}},[n("path",{attrs:{d:"M13.5 4L6 11.5L2.5 8",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}})]):e._e()],1)})),0)]):e._e()])],1)},yr=[],wr=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("svg",{attrs:{width:"24",height:"24",viewBox:"0 0 24 24",focusable:"false"}},[n("path",{attrs:{d:"M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2Zm0 4h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2Zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2Zm0-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2Z","fill-rule":"evenodd"}})])},kr=[],xr={},Cr=Fi(xr,wr,kr,!1,null,null,null),Sr=Cr.exports,Or=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("svg",{attrs:{width:e.width,height:e.height,viewBox:"0 0 24 24",focusable:"false"}},[n("path",{attrs:{d:"M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2Zm6 4h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm-6-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2Z","fill-rule":"evenodd"}})])},_r=[],Er={name:"RightAlign",props:{width:{type:[Number,String],default:24},height:{type:[Number,String],default:24}}},Mr=Er,Tr=Fi(Mr,Or,_r,!1,null,null,null),Ar=Tr.exports,Lr=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("svg",{attrs:{width:"24",height:"24",viewBox:"0 0 24 24",focusable:"false"}},[n("path",{attrs:{d:"M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2Zm3 4h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 1 1 0-2Zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 0 1 0-2Zm-3-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2Z","fill-rule":"evenodd"}})])},Br=[],zr={},jr=Fi(zr,Lr,Br,!1,null,null,null),Pr=jr.exports,Ir=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("svg",{attrs:{width:"24",height:"24",viewBox:"0 0 24 24",focusable:"false"}},[n("path",{attrs:{d:"M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2Zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2Zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2Zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2Z","fill-rule":"evenodd"}})])},Hr=[],Dr={},Fr=Fi(Dr,Ir,Hr,!1,null,null,null),Rr=Fr.exports,$r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}},[n("rect",{attrs:{x:"3",y:"3",width:"18",height:"18",rx:"2"}})])},Ur=[],Nr={name:"BlockDisplay"},Vr=Nr,qr=Fi(Vr,$r,Ur,!1,null,null,null),Jr=qr.exports,Wr=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}},[n("rect",{attrs:{x:"3",y:"9",width:"18",height:"6",rx:"1"}})])},Gr=[],Zr={name:"InlineDisplay"},Kr=Zr,Qr=Fi(Kr,Wr,Gr,!1,null,null,null),Yr=Qr.exports,Xr=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("svg",{attrs:{width:e.width,height:e.height,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}},[n("rect",{attrs:{x:"3",y:"8",width:"18",height:"13",rx:"2"}}),n("line",{attrs:{x1:"3",y1:"5",x2:"21",y2:"5"}})])},eo=[],to={name:"CaptionTop",props:{width:{type:[Number,String],default:24},height:{type:[Number,String],default:24}}},no=to,io=Fi(no,Xr,eo,!1,null,null,null),ro=io.exports,oo=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("svg",{attrs:{width:e.width,height:e.height,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}},[n("rect",{attrs:{x:"3",y:"3",width:"18",height:"13",rx:"2"}}),n("line",{attrs:{x1:"3",y1:"19",x2:"21",y2:"19"}})])},ao=[],so={name:"CaptionBottom",props:{width:{type:[Number,String],default:24},height:{type:[Number,String],default:24}}},lo=so,uo=Fi(lo,oo,ao,!1,null,null,null),co=uo.exports,po=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("svg",{attrs:{width:e.width,height:e.height,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}},[n("rect",{attrs:{x:"3",y:"3",width:"18",height:"18",rx:"2"}}),n("line",{attrs:{x1:"3",y1:"3",x2:"21",y2:"21"}})])},fo=[],ho={name:"NoCaption",props:{width:{type:[Number,String],default:24},height:{type:[Number,String],default:24}}},vo=ho,mo=Fi(vo,po,fo,!1,null,null,null),go=mo.exports,bo=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}},[n("polyline",{attrs:{points:"3 6 5 6 21 6"}}),n("path",{attrs:{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}}),n("line",{attrs:{x1:"10",y1:"11",x2:"10",y2:"17"}}),n("line",{attrs:{x1:"14",y1:"11",x2:"14",y2:"17"}})])},yo=[],wo={name:"Delete"},ko=wo,xo=Fi(ko,bo,yo,!1,null,null,null),Co=xo.exports,So=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("svg",{attrs:{width:e.width,height:e.height,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}},[n("rect",{attrs:{x:"8",y:"4",width:"8",height:"16",rx:"1"}}),n("line",{attrs:{x1:"4",y1:"4",x2:"4",y2:"20"}}),n("line",{attrs:{x1:"20",y1:"4",x2:"20",y2:"20"}})])},Oo=[],_o={name:"SpacingSmall",props:{width:{type:[Number,String],default:24},height:{type:[Number,String],default:24}}},Eo=_o,Mo=Fi(Eo,So,Oo,!1,null,null,null),To=Mo.exports,Ao=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("svg",{attrs:{width:e.width,height:e.height,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}},[n("rect",{attrs:{x:"10",y:"4",width:"4",height:"16",rx:"1"}}),n("line",{attrs:{x1:"4",y1:"4",x2:"4",y2:"20"}}),n("line",{attrs:{x1:"20",y1:"4",x2:"20",y2:"20"}})])},Lo=[],Bo={name:"SpacingMedium",props:{width:{type:[Number,String],default:24},height:{type:[Number,String],default:24}}},zo=Bo,jo=Fi(zo,Ao,Lo,!1,null,null,null),Po=jo.exports,Io=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("svg",{attrs:{width:e.width,height:e.height,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}},[n("rect",{attrs:{x:"11",y:"4",width:"2",height:"16",rx:"1"}}),n("line",{attrs:{x1:"4",y1:"4",x2:"4",y2:"20"}}),n("line",{attrs:{x1:"20",y1:"4",x2:"20",y2:"20"}})])},Ho=[],Do={name:"SpacingLarge",props:{width:{type:[Number,String],default:24},height:{type:[Number,String],default:24}}},Fo=Do,Ro=Fi(Fo,Io,Ho,!1,null,null,null),$o=Ro.exports,Uo=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("svg",{attrs:{width:"24",height:"24",focusable:"false"}},[n("path",{attrs:{d:"M10 17h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 1 1 0-2ZM6 4v3.5c0 .3-.2.5-.5.5a.5.5 0 0 1-.5-.5V5h-.5a.5.5 0 0 1 0-1H6Zm-1 8.8.2.2h1.3c.3 0 .5.2.5.5s-.2.5-.5.5H4.9a1 1 0 0 1-.9-1V13c0-.4.3-.8.6-1l1.2-.4.2-.3a.2.2 0 0 0-.2-.2H4.5a.5.5 0 0 1-.5-.5c0-.3.2-.5.5-.5h1.6c.5 0 .9.4.9 1v.1c0 .4-.3.8-.6 1l-1.2.4-.2.3ZM7 17v2c0 .6-.4 1-1 1H4.5a.5.5 0 0 1 0-1h1.2c.2 0 .3-.1.3-.3 0-.2-.1-.3-.3-.3H4.4a.4.4 0 1 1 0-.8h1.3c.2 0 .3-.1.3-.3 0-.2-.1-.3-.3-.3H4.5a.5.5 0 1 1 0-1H6c.6 0 1 .4 1 1Z","fill-rule":"evenodd"}})])},No=[],Vo={},qo=Fi(Vo,Uo,No,!1,null,null,null),Jo=qo.exports,Wo=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("svg",{attrs:{width:"24",height:"24",focusable:"false"}},[n("path",{attrs:{d:"M11 5h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2ZM4.5 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1Zm0 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1Zm0 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1Z","fill-rule":"evenodd"}})])},Go=[],Zo={},Ko=Fi(Zo,Wo,Go,!1,null,null,null),Qo=Ko.exports,Yo=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("svg",{attrs:{width:"26",height:"26",viewBox:"0 0 48 48"}},[n("path",{attrs:{d:"M8 21h6v6H8zm0 10h6v6H8zm0-20h6v6H8z"}}),n("path",{attrs:{d:"M18 12h22v4H18zm0 10h22v4H18zm0 10h22v4H18z",opacity:".5"}})])},Xo=[],ea={},ta=Fi(ea,Yo,Xo,!1,null,null,null),na=ta.exports,ia=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("svg",{attrs:{width:"24",height:"24",focusable:"false"}},[n("path",{attrs:{d:"M6.2 12.3a1 1 0 0 1 1.4 1.4l-2 2a2 2 0 1 0 2.6 2.8l4.8-4.8a1 1 0 0 0 0-1.4 1 1 0 1 1 1.4-1.3 2.9 2.9 0 0 1 0 4L9.6 20a3.9 3.9 0 0 1-5.5-5.5l2-2Zm11.6-.6a1 1 0 0 1-1.4-1.4l2-2a2 2 0 1 0-2.6-2.8L11 10.3a1 1 0 0 0 0 1.4A1 1 0 1 1 9.6 13a2.9 2.9 0 0 1 0-4L14.4 4a3.9 3.9 0 0 1 5.5 5.5l-2 2Z","fill-rule":"nonzero"}})])},ra=[],oa={},aa=Fi(oa,ia,ra,!1,null,null,null),sa=aa.exports,la=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("svg",{attrs:{width:"24",height:"24",focusable:"false"}},[n("path",{attrs:{d:"m5 15.7 3.3-3.2c.3-.3.7-.3 1 0L12 15l4.1-4c.3-.4.8-.4 1 0l2 1.9V5H5v10.7ZM5 18V19h3l2.8-2.9-2-2L5 17.9Zm14-3-2.5-2.4-6.4 6.5H19v-4ZM4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 0 1-1-1V4c0-.6.4-1 1-1Zm6 8a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z","fill-rule":"nonzero"}})])},ua=[],ca={},da=Fi(ca,la,ua,!1,null,null,null),pa=da.exports,fa=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("svg",{attrs:{width:"24",height:"24",focusable:"false"}},[n("path",{attrs:{d:"M4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 0 1-1-1V4c0-.6.4-1 1-1Zm1 2v14h14V5H5Zm4.8 2.6 5.6 4a.5.5 0 0 1 0 .8l-5.6 4A.5.5 0 0 1 9 16V8a.5.5 0 0 1 .8-.4Z","fill-rule":"nonzero"}})])},ha=[],va={},ma=Fi(va,fa,ha,!1,null,null,null),ga=ma.exports,ba=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("svg",{attrs:{width:"20",height:"20",viewBox:"0 0 24 24",focusable:"false"}},[n("path",{attrs:{d:"M6.4 8H12c3.7 0 6.2 2 6.8 5.1.6 2.7-.4 5.6-2.3 6.8a1 1 0 0 1-1-1.8c1.1-.6 1.8-2.7 1.4-4.6-.5-2.1-2.1-3.5-4.9-3.5H6.4l3.3 3.3a1 1 0 1 1-1.4 1.4l-5-5a1 1 0 0 1 0-1.4l5-5a1 1 0 0 1 1.4 1.4L6.4 8Z","fill-rule":"nonzero"}})])},ya=[],wa={},ka=Fi(wa,ba,ya,!1,null,null,null),xa=ka.exports,Ca=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("svg",{attrs:{width:"20",height:"20",viewBox:"0 0 24 24",focusable:"false"}},[n("path",{attrs:{d:"M17.6 10H12c-2.8 0-4.4 1.4-4.9 3.5-.4 2 .3 4 1.4 4.6a1 1 0 1 1-1 1.8c-2-1.2-2.9-4.1-2.3-6.8.6-3 3-5.1 6.8-5.1h5.6l-3.3-3.3a1 1 0 1 1 1.4-1.4l5 5a1 1 0 0 1 0 1.4l-5 5a1 1 0 0 1-1.4-1.4l3.3-3.3Z","fill-rule":"nonzero"}})])},Sa=[],Oa={},_a=Fi(Oa,Ca,Sa,!1,null,null,null),Ea=_a.exports,Ma=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("svg",{attrs:{viewBox:"0 0 20 20","aria-hidden":"true"}},[n("path",{attrs:{d:"M3 10.423a6.5 6.5 0 0 1 6.056-6.408l.038.67C6.448 5.423 5.354 7.663 5.22 10H9c.552 0 .5.432.5.986v4.511c0 .554-.448.503-1 .503h-5c-.552 0-.5-.449-.5-1.003zm8 0a6.5 6.5 0 0 1 6.056-6.408l.038.67c-2.646.739-3.74 2.979-3.873 5.315H17c.552 0 .5.432.5.986v4.511c0 .554-.448.503-1 .503h-5c-.552 0-.5-.449-.5-1.003z"}})])},Ta=[],Aa={},La=Fi(Aa,Ma,Ta,!1,null,null,null),Ba=La.exports,za=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("svg",{attrs:{width:"24",height:"24",focusable:"false"}},[n("path",{attrs:{"fill-rule":"nonzero",d:"M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14ZM5 14v4h6v-4H5Zm14 0h-6v4h6v-4Zm0-6h-6v4h6V8ZM5 12h6V8H5v4Z"}})])},ja=[],Pa={},Ia=Fi(Pa,za,ja,!1,null,null,null),Ha=Ia.exports,Da=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"4","stroke-linecap":"round","stroke-linejoin":"round"}},[n("polyline",{attrs:{points:"16 18 22 12 16 6"}}),n("polyline",{attrs:{points:"8 6 2 12 8 18"}})])},Fa=[],Ra={name:"Code"},$a=Ra,Ua=Fi($a,Da,Fa,!1,null,null,null),Na=Ua.exports,Va=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("svg",{attrs:{width:e.width,height:e.height,viewBox:"0 0 24 24",focusable:"false"}},[n("path",{attrs:{"fill-rule":"nonzero",d:"M6 4a1 1 0 1 1 0 2H5v6h14V6h-1a1 1 0 0 1 0-2h2c.6 0 1 .4 1 1v13a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5c0-.6.4-1 1-1h2Zm5 10H5v4h6v-4Zm8 0h-6v4h6v-4ZM12 3c.5 0 1 .4 1 .9V6h2a1 1 0 0 1 0 2h-2v2a1 1 0 0 1-2 .1V8H9a1 1 0 0 1 0-2h2V4c0-.6.4-1 1-1Z",opacity:".8"}})])},qa=[],Ja={props:{width:{type:Number,default:24},height:{type:Number,default:24}}},Wa=Ja,Ga=Fi(Wa,Va,qa,!1,null,null,null),Za=Ga.exports,Ka=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("svg",{attrs:{width:"24",height:"24",viewBox:"0 0 24 24",focusable:"false"}},[n("path",{attrs:{"fill-rule":"nonzero",d:"M12 13c.5 0 1 .4 1 .9V16h2a1 1 0 0 1 .1 2H13v2a1 1 0 0 1-2 .1V18H9a1 1 0 0 1-.1-2H11v-2c0-.6.4-1 1-1Zm6 7a1 1 0 0 1 0-2h1v-6H5v6h1a1 1 0 0 1 0 2H4a1 1 0 0 1-1-1V6c0-1.1.9-2 2-2h14a2 2 0 0 1 2 2v13c0 .5-.4 1-.9 1H18ZM11 6H5v4h6V6Zm8 0h-6v4h6V6Z",opacity:".8"}})])},Qa=[],Ya={},Xa=Fi(Ya,Ka,Qa,!1,null,null,null),es=Xa.exports,ts=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("svg",{attrs:{width:e.width,height:e.height,viewBox:"0 0 24 24",focusable:"false"}},[n("path",{attrs:{"fill-rule":"nonzero",d:"M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a1 1 0 0 1-1-1v-2a1 1 0 0 1 2 0v1h8V6H5v1a1 1 0 1 1-2 0V5c0-.6.4-1 1-1h15Zm0 9h-4v5h4v-5ZM8 8c.5 0 1 .4 1 .9V11h2a1 1 0 0 1 .1 2H9v2a1 1 0 0 1-2 .1V13H5a1 1 0 0 1-.1-2H7V9c0-.6.4-1 1-1Zm11-2h-4v5h4V6Z",opacity:".8"}})])},ns=[],is={props:{width:{type:Number,default:24},height:{type:Number,default:24}}},rs=is,os=Fi(rs,ts,ns,!1,null,null,null),as=os.exports,ss=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("svg",{attrs:{width:"24",height:"24",viewBox:"0 0 24 24",focusable:"false"}},[n("path",{attrs:{"fill-rule":"nonzero",d:"M20 4c.6 0 1 .4 1 1v2a1 1 0 0 1-2 0V6h-8v12h8v-1a1 1 0 0 1 2 0v2c0 .5-.4 1-.9 1H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h15ZM9 13H5v5h4v-5Zm7-5c.5 0 1 .4 1 .9V11h2a1 1 0 0 1 .1 2H17v2a1 1 0 0 1-2 .1V13h-2a1 1 0 0 1-.1-2H15V9c0-.6.4-1 1-1ZM9 6H5v5h4V6Z",opacity:".8"}})])},ls=[],us={},cs=Fi(us,ss,ls,!1,null,null,null),ds=cs.exports,ps=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("svg",{attrs:{width:"24",height:"24",viewBox:"0 0 24 24",focusable:"false"}},[n("path",{attrs:{"fill-rule":"nonzero",d:"M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14Zm-4 4h-2V6h-2v2H9V6H5v12h4v-2h2v2h2v-2h2v2h4V6h-4v2Zm.3.5 1 1.2-3 2.3 3 2.3-1 1.2L12 13l-3.3 2.6-1-1.2 3-2.3-3-2.3 1-1.2L12 11l3.3-2.5Z",opacity:"0.8"}})])},fs=[],hs={},vs=Fi(hs,ps,fs,!1,null,null,null),ms=vs.exports,gs=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}},[n("path",{attrs:{d:"M19 12H5M12 19l-7-7 7-7"}})])},bs=[],ys={name:"MoveLeft"},ws=ys,ks=Fi(ws,gs,bs,!1,null,null,null),xs=ks.exports,Cs=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}},[n("path",{attrs:{d:"M5 12h14M12 5l7 7-7 7"}})])},Ss=[],Os={name:"MoveRight"},_s=Os,Es=Fi(_s,Cs,Ss,!1,null,null,null),Ms=Es.exports,Ts=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}},[n("path",{attrs:{d:"M12 19V5M5 12l7-7 7 7"}})])},As=[],Ls={name:"MoveUp"},Bs=Ls,zs=Fi(Bs,Ts,As,!1,null,null,null),js=zs.exports,Ps=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}},[n("path",{attrs:{d:"M12 5v14M19 12l-7 7-7-7"}})])},Is=[],Hs={name:"MoveDown"},Ds=Hs,Fs=Fi(Ds,Ps,Is,!1,null,null,null),Rs=Fs.exports,$s=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}},[n("rect",{attrs:{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}}),n("path",{attrs:{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"}})])},Us=[],Ns={name:"Duplicate"},Vs=Ns,qs=Fi(Vs,$s,Us,!1,null,null,null),Js=qs.exports,Ws=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}},[n("circle",{attrs:{cx:"13.5",cy:"6.5",r:".5"}}),n("circle",{attrs:{cx:"17.5",cy:"10.5",r:".5"}}),n("circle",{attrs:{cx:"8.5",cy:"7.5",r:".5"}}),n("circle",{attrs:{cx:"6.5",cy:"12.5",r:".5"}}),n("path",{attrs:{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z"}})])},Gs=[],Zs={name:"ColorPalette"},Ks=Zs,Qs=Fi(Ks,Ws,Gs,!1,null,null,null),Ys=Qs.exports,Xs=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("svg",{attrs:{width:"24",height:"24",focusable:"false"}},[n("path",{attrs:{d:"M13.2 6a1 1 0 0 1 0 .2l-2.6 10a1 1 0 0 1-1 .8h-.2a.8.8 0 0 1-.8-1l2.6-10H8a1 1 0 1 1 0-2h9a1 1 0 0 1 0 2h-3.8ZM5 18h7a1 1 0 0 1 0 2H5a1 1 0 0 1 0-2Zm13 1.5L16.5 18 15 19.5a.7.7 0 0 1-1-1l1.5-1.5-1.5-1.5a.7.7 0 0 1 1-1l1.5 1.5 1.5-1.5a.7.7 0 0 1 1 1L17.5 17l1.5 1.5a.7.7 0 0 1-1 1Z","fill-rule":"evenodd"}})])},el=[],tl={name:"ClearFormatting"},nl=tl,il=Fi(nl,Xs,el,!1,null,null,null),rl=il.exports,ol=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("svg",{attrs:{width:"24",height:"26",focusable:"false"}},[n("path",{attrs:{d:"M7.1 11a2.8 2.8 0 0 1-.8 2 2.8 2.8 0 0 1 .8 2v1.7c0 .3.1.6.4.8.2.3.5.4.8.4.3 0 .4.2.4.4v.8c0 .2-.1.4-.4.4-.7 0-1.4-.3-2-.8-.5-.6-.8-1.3-.8-2V15c0-.3-.1-.6-.4-.8-.2-.3-.5-.4-.8-.4a.4.4 0 0 1-.4-.4v-.8c0-.2.2-.4.4-.4.3 0 .6-.1.8-.4.3-.2.4-.5.4-.8V9.3c0-.7.3-1.4.8-2 .6-.5 1.3-.8 2-.8.3 0 .4.2.4.4v.8c0 .2-.1.4-.4.4-.3 0-.6.1-.8.4-.3.2-.4.5-.4.8V11Zm9.8 0V9.3c0-.3-.1-.6-.4-.8-.2-.3-.5-.4-.8-.4a.4.4 0 0 1-.4-.4V7c0-.2.1-.4.4-.4.7 0 1.4.3 2 .8.5.6.8 1.3.8 2V11c0 .3.1.6.4.8.2.3.5.4.8.4.2 0 .4.2.4.4v.8c0 .2-.2.4-.4.4-.3 0-.6.1-.8.4-.3.2-.4.5-.4.8v1.7c0 .7-.3 1.4-.8 2-.6.5-1.3.8-2 .8a.4.4 0 0 1-.4-.4v-.8c0-.2.1-.4.4-.4.3 0 .6-.1.8-.4.3-.2.4-.5.4-.8V15a2.8 2.8 0 0 1 .8-2 2.8 2.8 0 0 1-.8-2Zm-3.3-.4c0 .4-.1.8-.5 1.1-.3.3-.7.5-1.1.5-.4 0-.8-.2-1.1-.5-.4-.3-.5-.7-.5-1.1 0-.5.1-.9.5-1.2.3-.3.7-.4 1.1-.4.4 0 .8.1 1.1.4.4.3.5.7.5 1.2ZM12 13c.4 0 .8.1 1.1.5.4.3.5.7.5 1.1 0 1-.1 1.6-.5 2a3 3 0 0 1-1.1 1c-.4.3-.8.4-1.1.4a.5.5 0 0 1-.5-.5V17a3 3 0 0 0 1-.2l.6-.6c-.6 0-1-.2-1.3-.5-.2-.3-.3-.7-.3-1 0-.5.1-1 .5-1.2.3-.4.7-.5 1.1-.5Z","fill-rule":"evenodd"}})])},al=[],sl={name:"CodeBlock"},ll=sl,ul=Fi(ll,ol,al,!1,null,null,null),cl=ul.exports,dl=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("svg",{attrs:{width:e.width,height:e.height,viewBox:"0 0 20 20","aria-hidden":"true"}},[n("path",{attrs:{d:"M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1M2 2v16h16V2z",opacity:".6"}}),n("path",{attrs:{d:"M18 7v1H2V7zm0 5v1H2v-1z",opacity:".6"}}),n("path",{attrs:{d:"M14 1v18a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V1a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1m-2 1H8v4h4zm0 6H8v4h4zm0 6H8v4h4z"}})])},pl=[],fl={name:"RowIcon",props:{width:{type:[Number,String],default:18},height:{type:[Number,String],default:18}}},hl=fl,vl=Fi(hl,dl,pl,!1,null,null,null),ml=vl.exports,gl=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("svg",{attrs:{width:e.width,height:e.height,viewBox:"0 0 20 20","aria-hidden":"true"}},[n("path",{attrs:{d:"M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1M2 2v16h16V2z",opacity:".6"}}),n("path",{attrs:{d:"M7 2h1v16H7zm5 0h1v16h-1z",opacity:".6"}}),n("path",{attrs:{d:"M1 6h18a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1m1 2v4h4V8zm6 0v4h4V8zm6 0v4h4V8z"}})])},bl=[],yl={name:"ColumnIcon",props:{width:{type:[Number,String],default:18},height:{type:[Number,String],default:18}}},wl=yl,kl=Fi(wl,gl,bl,!1,null,null,null),xl=kl.exports,Cl=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("svg",{attrs:{width:e.width,height:e.height,viewBox:"0 0 20 20","aria-hidden":"true"}},[n("path",{attrs:{d:"M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1M2 2v16h16V2z",opacity:".6"}}),n("path",{attrs:{d:"M7 2h1v16H7zm5 0h1v7h-1zm6 5v1H2V7zM8 12v1H2v-1z",opacity:".6"}}),n("path",{attrs:{d:"M7 7h12a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1m1 2v9h10V9z"}})])},Sl=[],Ol={name:"CellIcon",props:{width:{type:[Number,String],default:18},height:{type:[Number,String],default:18}}},_l=Ol,El=Fi(_l,Cl,Sl,!1,null,null,null),Ml=El.exports,Tl=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("svg",{attrs:{width:e.width,height:e.height,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}},[n("line",{attrs:{x1:"17",y1:"10",x2:"3",y2:"10"}}),n("line",{attrs:{x1:"21",y1:"6",x2:"3",y2:"6"}}),n("line",{attrs:{x1:"21",y1:"14",x2:"3",y2:"14"}}),n("line",{attrs:{x1:"17",y1:"18",x2:"3",y2:"18"}})])},Al=[],Ll={name:"AlignIcon",props:{width:{type:[Number,String],default:18},height:{type:[Number,String],default:18}}},Bl=Ll,zl=Fi(Bl,Tl,Al,!1,null,null,null),jl=zl.exports,Pl=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("svg",{attrs:{width:e.width,height:e.height,viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"}},[n("path",{attrs:{d:"M2 3h7v5H2V3zm0 6h7v5H2V9zm9-6h7v5h-7V3zm0 6h7v5h-7V9z",opacity:"0.3"}}),n("path",{attrs:{d:"M2 14h16v3H2v-3z"}}),n("path",{attrs:{d:"M9 15.5l-2-1.5v1H4v1h3v1l2-1.5zm7 0l-2-1.5v1h-3v1h3v1l2-1.5z"}})])},Il=[],Hl={name:"MergeCells",props:{width:{type:[Number,String],default:18},height:{type:[Number,String],default:18}}},Dl=Hl,Fl=Fi(Dl,Pl,Il,!1,null,null,null),Rl=Fl.exports,$l=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("svg",{attrs:{width:e.width,height:e.height,viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"}},[n("path",{attrs:{d:"M2 3h16v11H2V3z",opacity:"0.3"}}),n("path",{attrs:{d:"M2 14h7v3H2v-3zm9 0h7v3h-7v-3z"}}),n("path",{attrs:{d:"M7 15.5l2-1.5v1h2v1H9v1l-2-1.5zm6 0l2-1.5v1h2v1h-2v1l-2-1.5z",transform:"rotate(180 10 15.5)"}})])},Ul=[],Nl={name:"SplitCell",props:{width:{type:[Number,String],default:18},height:{type:[Number,String],default:18}}},Vl=Nl,ql=Fi(Vl,$l,Ul,!1,null,null,null),Jl=ql.exports,Wl={name:"AlignmentDropdown",components:{LeftAlign:Sr,CenterAlign:Pr,RightAlign:Ar,JustifyAlign:Rr},props:{modelValue:{type:String,default:"left"}},emits:["update:modelValue","change"],data:function(){return{isOpen:!1,options:[{value:"left",label:"Align Left",icon:"LeftAlign"},{value:"center",label:"Align Center",icon:"CenterAlign"},{value:"right",label:"Align Right",icon:"RightAlign"},{value:"justify",label:"Justify",icon:"JustifyAlign"}]}},computed:{currentValue:function(){return this.modelValue||"left"},currentIcon:function(){var e=this,t=this.options.find((function(t){return t.value===e.currentValue}));return t?t.icon:"LeftAlign"}},mounted:function(){document.addEventListener("click",this.handleClickOutside)},beforeUnmount:function(){document.removeEventListener("click",this.handleClickOutside)},methods:{toggleDropdown:function(){this.isOpen=!this.isOpen},selectOption:function(e){this.$emit("update:modelValue",e.value),this.$emit("change",{target:{value:e.value}}),this.isOpen=!1},handleClickOutside:function(e){this.$refs.dropdown&&!this.$refs.dropdown.contains(e.target)&&(this.isOpen=!1)}}},Gl=Wl,Zl=(n("6d5f"),Fi(Gl,br,yr,!1,null,"5acb8492",null)),Kl=Zl.exports,Ql=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{ref:"dropdown",staticClass:"list-dropdown"},[n("button",{staticClass:"list-bbl-dropdown-trigger",class:{"is-open":e.isOpen},attrs:{title:"List Type"},on:{click:e.toggleDropdown}},[n(e.currentIcon,{tag:"component"}),n("svg",{staticClass:"dropdown-icon",class:{rotate:e.isOpen},attrs:{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"}},[n("path",{attrs:{d:"M2.5 4.5L6 8L9.5 4.5",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}})])],1),n("transition",{attrs:{name:"dropdown-fade"}},[e.isOpen?n("div",{staticClass:"list-bbl-dropdown-menu"},[n("div",{staticClass:"bbl-dropdown-menu-inner"},e._l(e.options,(function(t){return n("button",{key:t.value,staticClass:"list-option",class:{"is-active":e.currentValue===t.value},on:{click:function(n){return e.selectOption(t)}}},[n(t.icon,{tag:"component",staticClass:"option-icon"}),n("span",{staticClass:"option-label"},[e._v(e._s(t.label))]),e.currentValue===t.value?n("svg",{staticClass:"check-icon",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"}},[n("path",{attrs:{d:"M13.5 4L6 11.5L2.5 8",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}})]):e._e()],1)})),0)]):e._e()])],1)},Yl=[],Xl={name:"ListDropdown",components:{BulletList:Qo,NumberList:Jo,BoxList:na},props:{modelValue:{type:String,default:""}},emits:["update:modelValue","change"],data:function(){return{isOpen:!1,options:[{value:"bulletList",label:"Bullet List",icon:"BulletList"},{value:"orderedList",label:"Numbered List",icon:"NumberList"},{value:"taskList",label:"Task List",icon:"BoxList"}]}},computed:{currentValue:function(){return this.modelValue||""},currentIcon:function(){var e=this,t=this.options.find((function(t){return t.value===e.currentValue}));return t?t.icon:"BulletList"}},mounted:function(){document.addEventListener("click",this.handleClickOutside)},beforeUnmount:function(){document.removeEventListener("click",this.handleClickOutside)},methods:{toggleDropdown:function(){this.isOpen=!this.isOpen},selectOption:function(e){this.$emit("update:modelValue",e.value),this.$emit("change",{target:{value:e.value}}),this.isOpen=!1},handleClickOutside:function(e){this.$refs.dropdown&&!this.$refs.dropdown.contains(e.target)&&(this.isOpen=!1)}}},eu=Xl,tu=(n("32d6"),Fi(eu,Ql,Yl,!1,null,"43bc54c8",null)),nu=tu.exports,iu=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{ref:"dropdown",staticClass:"table-dropdown"},[n("button",{staticClass:"table-bbl-dropdown-trigger",class:{"is-open":e.isOpen},attrs:{title:"Insert Table"},on:{click:e.toggleDropdown}},[n("Table"),n("svg",{staticClass:"dropdown-icon",class:{rotate:e.isOpen},attrs:{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"}},[n("path",{attrs:{d:"M2.5 4.5L6 8L9.5 4.5",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}})])],1),n("transition",{attrs:{name:"dropdown-fade"}},[e.isOpen?n("div",{staticClass:"table-bbl-dropdown-menu"},[n("div",{staticClass:"bbl-dropdown-menu-inner"},[n("div",{staticClass:"table-grid-container"},[n("div",{staticClass:"table-grid"},e._l(e.maxRows,(function(t){return n("div",{key:"row-"+t,staticClass:"grid-row"},e._l(e.maxCols,(function(i){return n("div",{key:"cell-"+t+"-"+i,staticClass:"grid-cell",class:{highlighted:t<=e.hoveredRows&&i<=e.hoveredCols},on:{mouseenter:function(n){return e.handleCellHover(t,i)},click:function(n){return e.handleCellClick(t,i)}}})})),0)})),0),n("div",{staticClass:"grid-label"},[e._v(" "+e._s(e.hoveredRows||0)+" ร "+e._s(e.hoveredCols||0)+" Table ")])])])]):e._e()])],1)},ru=[],ou={name:"TableDropdown",components:{Table:Ha},emits:["insert"],data:function(){return{isOpen:!1,maxRows:8,maxCols:8,hoveredRows:0,hoveredCols:0,customRows:3,customCols:3}},mounted:function(){document.addEventListener("click",this.handleClickOutside)},beforeUnmount:function(){document.removeEventListener("click",this.handleClickOutside)},methods:{toggleDropdown:function(){this.isOpen=!this.isOpen,this.isOpen&&(this.hoveredRows=0,this.hoveredCols=0)},handleCellHover:function(e,t){this.hoveredRows=e,this.hoveredCols=t},handleCellClick:function(e,t){this.$emit("insert",{rows:e,cols:t}),this.isOpen=!1,this.hoveredRows=0,this.hoveredCols=0},handleClickOutside:function(e){this.$refs.dropdown&&!this.$refs.dropdown.contains(e.target)&&(this.isOpen=!1)}}},au=ou,su=(n("dc83"),Fi(au,iu,ru,!1,null,"2d602c24",null)),lu=su.exports,uu=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{ref:"dropdown",staticClass:"color-picker-dropdown"},[n("button",{staticClass:"color-picker-button",attrs:{title:e.title,type:"button"},on:{click:e.toggleDropdown}},[n("span",{staticClass:"bbl-color-icon",style:{color:e.currentColor||"#000000"}},[e._v("A")]),n("span",{staticClass:"bbl-color-bar",style:{backgroundColor:e.currentColor||"#000000"}}),n("span",{staticClass:"dropdown-arrow"},[e._v("โผ")])]),e.isOpen?n("div",{staticClass:"color-dropdown-panel"},[n("div",{staticClass:"color-section"},[n("button",{staticClass:"color-action-button",attrs:{type:"button"},on:{click:e.removeColor}},[n("span",{staticClass:"remove-icon"},[e._v("โ")]),e._v(" Remove Color ")])]),n("div",{staticClass:"color-section"},[n("div",{staticClass:"section-label"},[e._v("Theme Colors")]),n("div",{staticClass:"color-grid"},e._l(e.themeColors,(function(t){return n("button",{key:t.value,staticClass:"color-swatch",style:{backgroundColor:t.value},attrs:{title:t.name,type:"button"},on:{click:function(n){return e.selectColor(t.value)}}},[e.currentColor===t.value?n("span",{staticClass:"check-mark"},[e._v("โ")]):e._e()])})),0)]),n("div",{staticClass:"color-section"},[n("div",{staticClass:"section-label"},[e._v("Standard Colors")]),n("div",{staticClass:"color-grid"},e._l(e.standardColors,(function(t){return n("button",{key:t.value,staticClass:"color-swatch",style:{backgroundColor:t.value},attrs:{title:t.name,type:"button"},on:{click:function(n){return e.selectColor(t.value)}}},[e.currentColor===t.value?n("span",{staticClass:"check-mark"},[e._v("โ")]):e._e()])})),0)]),n("div",{staticClass:"color-section"},[n("div",{staticClass:"section-label"},[e._v("Custom Color")]),n("div",{staticClass:"custom-color-picker"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.customColor,expression:"customColor"}],staticClass:"color-input",attrs:{type:"color"},domProps:{value:e.customColor},on:{change:function(t){return e.selectColor(e.customColor)},input:function(t){t.target.composing||(e.customColor=t.target.value)}}}),n("input",{directives:[{name:"model",rawName:"v-model",value:e.customColor,expression:"customColor"}],staticClass:"color-text-input",attrs:{type:"text",placeholder:"#000000",maxlength:"7"},domProps:{value:e.customColor},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.selectColor(e.customColor)},input:function(t){t.target.composing||(e.customColor=t.target.value)}}})])])]):e._e()])},cu=[],du={name:"ColorPickerDropdown",props:{modelValue:{type:String,default:""},title:{type:String,default:"Text Color"}},data:function(){return{isOpen:!1,customColor:"#000000",themeColors:[{name:"Black",value:"#000000"},{name:"Dark Gray",value:"#434343"},{name:"Gray",value:"#666666"},{name:"Light Gray",value:"#999999"},{name:"White",value:"#FFFFFF"},{name:"Red",value:"#E74C3C"},{name:"Orange",value:"#E67E22"},{name:"Yellow",value:"#F1C40F"},{name:"Green",value:"#2ECC71"},{name:"Blue",value:"#3498DB"},{name:"Purple",value:"#9B59B6"},{name:"Pink",value:"#E91E63"}],standardColors:[{name:"Dark Red",value:"#C0392B"},{name:"Red",value:"#E74C3C"},{name:"Light Red",value:"#EC7063"},{name:"Dark Orange",value:"#D35400"},{name:"Orange",value:"#E67E22"},{name:"Light Orange",value:"#EB984E"},{name:"Dark Yellow",value:"#F39C12"},{name:"Yellow",value:"#F1C40F"},{name:"Light Yellow",value:"#F4D03F"},{name:"Dark Green",value:"#27AE60"},{name:"Green",value:"#2ECC71"},{name:"Light Green",value:"#58D68D"},{name:"Dark Teal",value:"#16A085"},{name:"Teal",value:"#1ABC9C"},{name:"Light Teal",value:"#48C9B0"},{name:"Dark Blue",value:"#2980B9"},{name:"Blue",value:"#3498DB"},{name:"Light Blue",value:"#5DADE2"},{name:"Dark Purple",value:"#8E44AD"},{name:"Purple",value:"#9B59B6"},{name:"Light Purple",value:"#AF7AC5"},{name:"Dark Pink",value:"#AD1457"},{name:"Pink",value:"#E91E63"},{name:"Light Pink",value:"#F06292"}]}},computed:{currentColor:function(){return this.modelValue}},mounted:function(){document.addEventListener("click",this.handleClickOutside)},beforeUnmount:function(){document.removeEventListener("click",this.handleClickOutside)},methods:{toggleDropdown:function(){this.isOpen=!this.isOpen},selectColor:function(e){this.$emit("change",e),this.isOpen=!1},removeColor:function(){this.$emit("remove"),this.isOpen=!1},handleClickOutside:function(e){this.$refs.dropdown&&!this.$refs.dropdown.contains(e.target)&&(this.isOpen=!1)}}},pu=du,fu=(n("fba0"),Fi(pu,uu,cu,!1,null,"8bc740d8",null)),hu=fu.exports,vu=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{ref:"dropdown",staticClass:"highlight-picker-dropdown"},[n("button",{staticClass:"highlight-picker-button",attrs:{title:e.title,type:"button"},on:{click:e.toggleDropdown}},[n("span",{staticClass:"bbl-highlight-icon",style:{backgroundColor:e.currentColor||"transparent"}},[e._v("H")]),n("span",{staticClass:"dropdown-arrow"},[e._v("โผ")])]),e.isOpen?n("div",{staticClass:"highlight-dropdown-panel"},[n("div",{staticClass:"color-section"},[n("button",{staticClass:"color-action-button",attrs:{type:"button"},on:{click:e.removeHighlight}},[n("span",{staticClass:"remove-icon"},[e._v("โ")]),e._v(" Remove Highlight ")])]),n("div",{staticClass:"color-section"},[n("div",{staticClass:"section-label"},[e._v("Highlight Colors")]),n("div",{staticClass:"color-grid"},e._l(e.highlightColors,(function(t){return n("button",{key:t.value,staticClass:"color-swatch",style:{backgroundColor:t.value},attrs:{title:t.name,type:"button"},on:{click:function(n){return e.selectColor(t.value)}}},[e.currentColor===t.value?n("span",{staticClass:"check-mark"},[e._v("โ")]):e._e()])})),0)]),n("div",{staticClass:"color-section"},[n("div",{staticClass:"section-label"},[e._v("More Colors")]),n("div",{staticClass:"color-grid"},e._l(e.moreColors,(function(t){return n("button",{key:t.value,staticClass:"color-swatch",style:{backgroundColor:t.value},attrs:{title:t.name,type:"button"},on:{click:function(n){return e.selectColor(t.value)}}},[e.currentColor===t.value?n("span",{staticClass:"check-mark"},[e._v("โ")]):e._e()])})),0)]),n("div",{staticClass:"color-section"},[n("div",{staticClass:"section-label"},[e._v("Custom Color")]),n("div",{staticClass:"custom-color-picker"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.customColor,expression:"customColor"}],staticClass:"color-input",attrs:{type:"color"},domProps:{value:e.customColor},on:{change:function(t){return e.selectColor(e.customColor)},input:function(t){t.target.composing||(e.customColor=t.target.value)}}}),n("input",{directives:[{name:"model",rawName:"v-model",value:e.customColor,expression:"customColor"}],staticClass:"color-text-input",attrs:{type:"text",placeholder:"#FFFF00",maxlength:"7"},domProps:{value:e.customColor},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.selectColor(e.customColor)},input:function(t){t.target.composing||(e.customColor=t.target.value)}}})])])]):e._e()])},mu=[],gu={name:"HighlightPickerDropdown",props:{modelValue:{type:String,default:""},title:{type:String,default:"Highlight Color"}},data:function(){return{isOpen:!1,customColor:"#FFFF00",highlightColors:[{name:"Yellow",value:"#FFFF00"},{name:"Light Yellow",value:"#FFFF99"},{name:"Light Green",value:"#CCFFCC"},{name:"Light Blue",value:"#CCFFFF"},{name:"Light Pink",value:"#FFCCFF"},{name:"Light Orange",value:"#FFCC99"}],moreColors:[{name:"Bright Yellow",value:"#FFF59D"},{name:"Lime",value:"#E6FF99"},{name:"Mint",value:"#CCFFE6"},{name:"Cyan",value:"#99FFFF"},{name:"Sky Blue",value:"#CCE5FF"},{name:"Lavender",value:"#E6CCFF"},{name:"Pink",value:"#FFCCE6"},{name:"Peach",value:"#FFE6CC"},{name:"Light Coral",value:"#FFCCCC"},{name:"Light Gray",value:"#E0E0E0"},{name:"Beige",value:"#F5F5DC"},{name:"Light Salmon",value:"#FFE4B5"}]}},computed:{currentColor:function(){return this.modelValue}},mounted:function(){document.addEventListener("click",this.handleClickOutside)},beforeUnmount:function(){document.removeEventListener("click",this.handleClickOutside)},methods:{toggleDropdown:function(){this.isOpen=!this.isOpen},selectColor:function(e){this.$emit("change",e),this.isOpen=!1},removeHighlight:function(){this.$emit("remove"),this.isOpen=!1},handleClickOutside:function(e){this.$refs.dropdown&&!this.$refs.dropdown.contains(e.target)&&(this.isOpen=!1)}}},bu=gu,yu=(n("0074"),Fi(bu,vu,mu,!1,null,"f5f4b028",null)),wu=yu.exports,ku={name:"ToolbarMain",components:{ToolbarGroup:$i,ToolbarButton:Wi,HeadingDropdown:Xi,FontFamilyDropdown:or,FontSizeDropdown:dr,LineHeightDropdown:gr,AlignmentDropdown:Kl,ListDropdown:nu,TableDropdown:lu,ColorPickerDropdown:hu,HighlightPickerDropdown:wu,Link:sa,ImageSvg:pa,Video:ga,Previous:xa,Next:Ea,Code:Na,Quote:Ba,ClearFormatting:rl,CodeBlock:cl},props:{editor:{type:Object,default:null},sourceCodeMode:{type:Boolean,default:!1}},data:function(){return{editorUpdateKey:0}},emits:["insert-link","insert-image","insert-video","clear-formatting","toggle-source-code"],computed:{canUndo:function(){return this.editorUpdateKey,!!this.editor&&this.editor.can().undo()},canRedo:function(){return this.editorUpdateKey,!!this.editor&&this.editor.can().redo()},currentFontFamily:function(){if(this.editorUpdateKey,!this.editor)return"";var e=this.editor.getAttributes("textStyle"),t=e.fontFamily;return t||""},currentFontSize:function(){if(this.editorUpdateKey,!this.editor)return"";var e=this.editor.getAttributes("textStyle"),t=e.fontSize;return t||(this.editor.isActive("heading",{level:1})?"32px":this.editor.isActive("heading",{level:2})?"24px":this.editor.isActive("heading",{level:3})?"20px":this.editor.isActive("heading",{level:4})?"18px":this.editor.isActive("heading",{level:5})?"16px":this.editor.isActive("heading",{level:6})?"14px":"")},currentHeading:function(){if(this.editorUpdateKey,!this.editor)return"";for(var e=1;e<=6;e++)if(this.editor.isActive("heading",{level:e}))return String(e);return this.editor.isActive("paragraph")?"paragraph":""},currentTextColor:function(){if(this.editorUpdateKey,!this.editor)return"";var e=this.editor.getAttributes("textStyle"),t=e.color;return t||""},currentHighlightColor:function(){if(this.editorUpdateKey,!this.editor)return"";var e=this.editor.getAttributes("highlight"),t=e.color;return t||""},currentLineHeight:function(){if(this.editorUpdateKey,!this.editor)return"";var e=this.editor.getAttributes("paragraph");if(e.lineHeight)return e.lineHeight;for(var t=1;t<=6;t++)if(this.editor.isActive("heading",{level:t})){var n=this.editor.getAttributes("heading");return n.lineHeight||""}return""},currentAlignment:function(){return this.editorUpdateKey,this.editor?this.editor.isActive({textAlign:"center"})?"center":this.editor.isActive({textAlign:"right"})?"right":this.editor.isActive({textAlign:"justify"})?"justify":"left":"left"},currentList:function(){return this.editorUpdateKey,this.editor?this.editor.isActive("bulletList")?"bulletList":this.editor.isActive("orderedList")?"orderedList":this.editor.isActive("taskList")?"taskList":"":""}},watch:{editor:{immediate:!0,handler:function(e,t){t&&(t.off("selectionUpdate",this.handleEditorUpdate),t.off("transaction",this.handleEditorUpdate)),e&&(e.on("selectionUpdate",this.handleEditorUpdate),e.on("transaction",this.handleEditorUpdate))}}},beforeDestroy:function(){this.editor&&(this.editor.off("selectionUpdate",this.handleEditorUpdate),this.editor.off("transaction",this.handleEditorUpdate))},methods:{handleEditorUpdate:function(){this.editorUpdateKey++},executeCommand:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.editor&&this.$emit("execute-command",e,t)},isActive:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!!this.editor&&this.editor.isActive(e,t)},setHeading:function(e){if(this.editor){var t=e.target.value;if("paragraph"===t)this.executeCommand("setParagraph");else{var n=parseInt(t);n&&this.executeCommand("toggleHeading",{level:n})}}},setFontFamily:function(e){if(this.editor){var t=e.target.value;t?this.executeCommand("setFontFamily",t):this.editor.chain().focus().unsetFontFamily().run()}},setFontSize:function(e){if(this.editor){var t=e.target.value;t?this.executeCommand("setFontSize",t):this.editor.chain().focus().unsetFontSize().run()}},setTextColor:function(e){this.editor&&this.executeCommand("setColor",e)},removeTextColor:function(){this.editor&&this.editor.chain().focus().unsetColor().run()},setHighlight:function(e){this.editor&&this.executeCommand("setHighlight",{color:e})},removeHighlight:function(){this.editor&&this.editor.chain().focus().unsetHighlight().run()},setLineHeight:function(e){if(this.editor){var t=e.target.value;t?this.executeCommand("setLineHeight",t):this.editor.chain().focus().unsetLineHeight().run()}},setAlignment:function(e){if(this.editor){var t=e.target.value;t&&this.executeCommand("setTextAlign",t)}},setList:function(e){if(this.editor){var t=e.target.value;"bulletList"===t?this.executeCommand("toggleBulletList"):"orderedList"===t?this.executeCommand("toggleOrderedList"):"taskList"===t&&this.executeCommand("toggleTaskList")}},handleTableInsert:function(e){var t=e.rows,n=e.cols;this.editor&&this.editor.chain().focus().insertTable({rows:t,cols:n,withHeaderRow:!0}).run()}}},xu=ku,Cu=Fi(xu,zi,ji,!1,null,null,null),Su=Cu.exports,Ou=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.editor?n("bubble-menu",{staticClass:"bubble-menu",attrs:{editor:e.editor,"tippy-options":{duration:100}}},[n("div",{staticClass:"bubble-menu-content"},[n("button",{staticClass:"bubble-btn",class:{active:e.isActive("bold")},attrs:{title:"Bold"},on:{click:function(t){return e.executeCommand("toggleBold")}}},[n("strong",[e._v("B")])]),n("button",{staticClass:"bubble-btn",class:{active:e.isActive("italic")},attrs:{title:"Italic"},on:{click:function(t){return e.executeCommand("toggleItalic")}}},[n("em",[e._v("I")])]),n("button",{staticClass:"bubble-btn",class:{active:e.isActive("underline")},attrs:{title:"Underline"},on:{click:function(t){return e.executeCommand("toggleUnderline")}}},[n("u",[e._v("U")])]),n("div",{staticClass:"bubble-separator"}),n("button",{staticClass:"bubble-btn",class:{active:e.isActive("link")},attrs:{title:"Link"},on:{click:e.setLink}},[e._v(" ๐ ")]),n("button",{staticClass:"bubble-btn",class:{active:e.isActive("code")},attrs:{title:"Code"},on:{click:function(t){return e.executeCommand("toggleCode")}}},[e._v(" </> ")])])]):e._e()},_u=[],Eu={name:"EditorBubbleMenu",components:{BubbleMenu:s["BubbleMenu"]},props:{editor:{type:Object,default:null}},methods:{executeCommand:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.$emit("execute-command",e,t)},isActive:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!!this.editor&&this.editor.isActive(e,t)},setLink:function(){var e=this.editor.getAttributes("link").href,t=window.prompt("URL",e);null!==t&&(""!==t?this.editor.chain().focus().extendMarkRange("link").setLink({href:t}).run():this.editor.chain().focus().extendMarkRange("link").unsetLink().run())}}},Mu=Eu,Tu=(n("1508"),Fi(Mu,Ou,_u,!1,null,"d228d170",null)),Au=Tu.exports,Lu=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.editor?n("bubble-menu",{staticClass:"table-bubble-menu",attrs:{editor:e.editor,"tippy-options":e.tippyOptions,"should-show":e.shouldShow}},[n("div",{staticClass:"bubble-menu-content"},[n("BubbleMenuDropdown",{attrs:{items:e.rowItems},scopedSlots:e._u([{key:"trigger",fn:function(){return[n("RowIcon",{attrs:{width:20,height:20}})]},proxy:!0}],null,!1,1514853362)}),n("div",{staticClass:"bbl-menu-divider"}),n("BubbleMenuDropdown",{attrs:{items:e.columnItems},scopedSlots:e._u([{key:"trigger",fn:function(){return[n("ColumnIcon",{attrs:{width:20,height:20}})]},proxy:!0}],null,!1,2749318126)}),n("div",{staticClass:"bbl-menu-divider"}),n("BubbleMenuDropdown",{attrs:{items:e.cellItems},scopedSlots:e._u([{key:"trigger",fn:function(){return[n("CellIcon",{attrs:{width:18,height:18}})]},proxy:!0}],null,!1,1604387166)}),n("div",{staticClass:"bbl-menu-divider"}),n("BubbleMenuDropdown",{attrs:{items:e.alignmentItems},scopedSlots:e._u([{key:"trigger",fn:function(){return[n("AlignIcon",{attrs:{width:18,height:18}})]},proxy:!0}],null,!1,1132556629)}),n("div",{staticClass:"bbl-menu-divider"}),n("div",{ref:"colorPicker",staticClass:"color-picker-wrapper"},[n("button",{staticClass:"menu-btn",attrs:{title:"Cell Background Color"},on:{click:e.toggleColorPicker}},[n("ColorPalette")],1),e.showColorPicker?n("div",{staticClass:"color-picker-dropdown"},[n("div",{staticClass:"color-section"},[n("button",{staticClass:"color-action-button",attrs:{type:"button"},on:{click:function(t){return e.setCellBackground("")}}},[n("span",{staticClass:"remove-icon"},[e._v("โ")]),e._v(" Clear Background ")])]),n("div",{staticClass:"color-section"},[n("div",{staticClass:"section-label"},[e._v("Background Colors")]),n("div",{staticClass:"color-grid"},e._l(e.colorOptions,(function(t){return n("button",{key:t.value,staticClass:"color-option",style:{backgroundColor:t.value},attrs:{title:t.name,type:"button"},on:{click:function(n){return e.setCellBackground(t.value)}}})})),0)]),n("div",{staticClass:"color-section"},[n("div",{staticClass:"section-label"},[e._v("Custom Color")]),n("div",{staticClass:"custom-color-picker"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.customColor,expression:"customColor"}],staticClass:"color-input",attrs:{type:"color"},domProps:{value:e.customColor},on:{change:e.applyCustomColor,input:function(t){t.target.composing||(e.customColor=t.target.value)}}}),n("input",{directives:[{name:"model",rawName:"v-model",value:e.customColor,expression:"customColor"}],staticClass:"color-text-input",attrs:{type:"text",placeholder:"#ffffff",maxlength:"7"},domProps:{value:e.customColor},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.applyCustomColor.apply(null,arguments)},blur:e.validateCustomColor,input:function(t){t.target.composing||(e.customColor=t.target.value)}}})])])]):e._e()]),n("div",{staticClass:"bbl-menu-divider"}),n("button",{staticClass:"menu-btn delete-btn",attrs:{title:"Delete Table"},on:{click:e.deleteTable}},[n("DeleteTable")],1)],1)]):e._e()},Bu=[],zu=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{ref:"dropdown",staticClass:"bubble-menu-dropdown"},[n("button",{staticClass:"bbl-dropdown-trigger",class:{active:e.isOpen},on:{click:e.toggleDropdown}},[e._t("trigger",(function(){return[n("span",[e._v(e._s(e.label))])]})),n("svg",{staticClass:"dropdown-arrow",class:{open:e.isOpen},attrs:{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor","stroke-width":"2"}},[n("polyline",{attrs:{points:"2,4 6,8 10,4"}})])],2),e.isOpen?n("div",{staticClass:"bbl-dropdown-menu",style:e.menuStyle},e._l(e.items,(function(t,i){return n("div",{key:i,staticClass:"bbl-dropdown-item",class:{active:t.active,disabled:t.disabled},on:{click:function(n){return e.handleItemClick(t)}}},[t.icon?n(t.icon,{tag:"component",staticClass:"item-icon",attrs:{width:16,height:16}}):e._e(),n("span",{staticClass:"bbl-item-label"},[e._v(e._s(t.label))])],1)})),0):e._e()])},ju=[],Pu={name:"BubbleMenuDropdown",props:{label:{type:String,default:""},items:{type:Array,required:!0}},data:function(){return{isOpen:!1}},computed:{menuStyle:function(){return{minWidth:"180px"}}},mounted:function(){document.addEventListener("click",this.handleClickOutside)},beforeDestroy:function(){document.removeEventListener("click",this.handleClickOutside)},methods:{toggleDropdown:function(){this.isOpen=!this.isOpen},handleItemClick:function(e){e.disabled||(e.action&&"function"===typeof e.action&&e.action(),this.isOpen=!1)},handleClickOutside:function(e){this.$refs.dropdown&&!this.$refs.dropdown.contains(e.target)&&(this.isOpen=!1)}}},Iu=Pu,Hu=(n("86bc"),Fi(Iu,zu,ju,!1,null,"44510f88",null)),Du=Hu.exports;function Fu(e){return Fu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fu(e)}function Ru(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function $u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ru(Object(n),!0).forEach((function(t){Uu(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ru(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Uu(e,t,n){return(t=Nu(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nu(e){var t=Vu(e,"string");return"symbol"==Fu(t)?t:t+""}function Vu(e,t){if("object"!=Fu(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=Fu(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var qu={name:"TableBubbleMenu",components:{BubbleMenu:s["BubbleMenu"],BubbleMenuDropdown:Du,DeleteTable:ms,ColorPalette:Ys,RowIcon:ml,ColumnIcon:xl,CellIcon:Ml,AlignIcon:jl},props:{editor:{type:Object,required:!0}},data:function(){var e=this;return{showColorPicker:!1,customColor:"#ffffff",tippyOptions:{duration:100,placement:"top",maxWidth:"none",getReferenceClientRect:function(){if(!e.editor)return null;for(var t=e.editor.state,n=t.selection,i=n.$anchor,r=null,o=i.depth;o>0;o--)if("table"===i.node(o).type.name){r=o;break}if(null!==r){var a=i.before(r),s=t.doc.nodeAt(a);if(s){var l=e.editor.view.nodeDOM(a);if(l&&l.getBoundingClientRect){var u=l.getBoundingClientRect();return{top:u.top,left:u.left,right:u.right,bottom:u.top,width:u.width,height:0}}}}return e.editor.view.coordsAtPos(n.$anchor.pos)}},colorOptions:[{name:"Light Gray",value:"#f3f4f6"},{name:"Light Blue",value:"#dbeafe"},{name:"Light Green",value:"#dcfce7"},{name:"Light Yellow",value:"#fef3c7"},{name:"Light Red",value:"#fee2e2"},{name:"Light Purple",value:"#f3e8ff"},{name:"Light Pink",value:"#fce7f3"},{name:"Light Orange",value:"#ffedd5"},{name:"Gray",value:"#e5e7eb"},{name:"Sky Blue",value:"#bfdbfe"},{name:"Mint",value:"#bbf7d0"},{name:"Cream",value:"#fef08a"},{name:"Coral",value:"#fecaca"},{name:"Lavender",value:"#e9d5ff"},{name:"Rose",value:"#fbcfe8"},{name:"Peach",value:"#fed7aa"},{name:"Slate",value:"#cbd5e1"},{name:"Blue",value:"#93c5fd"},{name:"Green",value:"#86efac"},{name:"Yellow",value:"#fde047"},{name:"Red",value:"#fca5a5"},{name:"Purple",value:"#d8b4fe"},{name:"Pink",value:"#f9a8d4"},{name:"Orange",value:"#fdba74"}]}},mounted:function(){document.addEventListener("click",this.handleClickOutside)},beforeDestroy:function(){document.removeEventListener("click",this.handleClickOutside)},computed:{rowItems:function(){var e=this;return[{label:"Insert Row Above",icon:Za,action:function(){return e.editor.chain().focus().addRowBefore().run()}},{label:"Insert Row Below",icon:es,action:function(){return e.editor.chain().focus().addRowAfter().run()}},{label:"Move Row Up",icon:js,action:function(){return e.moveRowUp()}},{label:"Move Row Down",icon:Rs,action:function(){return e.moveRowDown()}},{label:"Duplicate Row",icon:Js,action:function(){return e.duplicateRow()}},{label:"Delete Row",icon:ms,action:function(){return e.editor.chain().focus().deleteRow().run()}}]},columnItems:function(){var e=this;return[{label:"Insert Column Left",icon:as,action:function(){return e.editor.chain().focus().addColumnBefore().run()}},{label:"Insert Column Right",icon:ds,action:function(){return e.editor.chain().focus().addColumnAfter().run()}},{label:"Move Column Left",icon:xs,action:function(){return e.moveColumnLeft()}},{label:"Move Column Right",icon:Ms,action:function(){return e.moveColumnRight()}},{label:"Duplicate Column",icon:Js,action:function(){return e.duplicateColumn()}},{label:"Delete Column",icon:ms,action:function(){return e.editor.chain().focus().deleteColumn().run()}}]},cellItems:function(){var e=this;return[{label:"Merge Cells",icon:Rl,action:function(){return e.editor.chain().focus().mergeCells().run()},disabled:!this.editor.can().mergeCells()},{label:"Split Cell",icon:Jl,action:function(){return e.editor.chain().focus().splitCell().run()},disabled:!this.editor.can().splitCell()}]},alignmentItems:function(){var e=this;return[{label:"Align Left",icon:Sr,action:function(){return e.setCellAlignment("left")}},{label:"Align Center",icon:Pr,action:function(){return e.setCellAlignment("center")}},{label:"Align Right",icon:Ar,action:function(){return e.setCellAlignment("right")}},{label:"Justify",icon:Rr,action:function(){return e.setCellAlignment("justify")}}]}},methods:{shouldShow:function(e){var t=e.editor;return t.isActive("table")},deleteTable:function(){this.editor.chain().focus().deleteTable().run()},toggleColorPicker:function(){this.showColorPicker=!this.showColorPicker},handleClickOutside:function(e){this.$refs.colorPicker&&!this.$refs.colorPicker.contains(e.target)&&(this.showColorPicker=!1)},applyCustomColor:function(){this.isValidColor(this.customColor)&&this.setCellBackground(this.customColor)},validateCustomColor:function(){this.isValidColor(this.customColor)||(this.customColor="#ffffff")},isValidColor:function(e){return/^#[0-9A-F]{6}$/i.test(e)},setCellAlignment:function(e){if(this.editor){for(var t=this.editor,n=t.state,i=t.view,r=n.selection,o=r.$anchor,a=null,s=o.depth;s>0;s--){var l=o.node(s);if("tableCell"===l.type.name||"tableHeader"===l.type.name){a=s;break}}if(null!==a){var u=o.before(a),c=n.doc.nodeAt(u);if(c){var d=n.tr,p=c.attrs||{},f=p.style||"",h=f.split(";").filter((function(e){return e.trim()&&!e.trim().startsWith("text-align")})).join(";"),v=h?"".concat(h,"; text-align: ").concat(e):"text-align: ".concat(e);d.setNodeMarkup(u,null,$u($u({},p),{},{style:v})),i.dispatch(d),this.editor.commands.focus()}}}},setCellBackground:function(e){if(this.editor){for(var t=this.editor,n=t.state,i=t.view,r=n.selection,o=r.$anchor,a=null,s=o.depth;s>0;s--){var l=o.node(s);if("tableCell"===l.type.name||"tableHeader"===l.type.name){a=s;break}}if(null!==a){var u=o.before(a),c=n.doc.nodeAt(u);if(c){var d=n.tr,p=c.attrs||{},f=p.style||"",h=f.split(";").filter((function(e){return e.trim()&&!e.trim().startsWith("background-color")})).join(";"),v=e?h?"".concat(h,"; background-color: ").concat(e):"background-color: ".concat(e):h;d.setNodeMarkup(u,null,$u($u({},p),{},{style:v||void 0})),i.dispatch(d),this.editor.commands.focus()}}this.showColorPicker=!1}},duplicateRow:function(){if(this.editor){for(var e=this.editor.state,t=e.selection,n=t.$anchor,i=null,r=n.depth;r>0;r--)if("tableRow"===n.node(r).type.name){i=r;break}if(null!==i){var o=n.before(i),a=e.doc.nodeAt(o);if(a){var s=e.tr,l=a.copy(a.content);s.insert(o+a.nodeSize,l),this.editor.view.dispatch(s),this.editor.commands.focus()}}}},duplicateColumn:function(){var e=this;if(this.editor){for(var t=this.editor.state,n=t.selection,i=null,r=n.$anchor.depth;r>0;r--){var o=n.$anchor.node(r);if("tableCell"===o.type.name||"tableHeader"===o.type.name){i=r;break}}if(null!==i){var a=n.$anchor.before(i),s=t.doc.resolve(a),l=0,u=t.doc.resolve(a),c=u.node(u.depth-1),d=u.before(u.depth-1)+1;c.forEach((function(e,t){if(d===a)return l=t,!1;d+=e.nodeSize})),console.log("Current column index: ".concat(l,", total columns: ").concat(c.childCount));var p=s.depth-2,f=s.node(p),h=[];f.forEach((function(e,t){var n=0;e.forEach((function(e){n===l&&("tableCell"===e.type.name||"tableHeader"===e.type.name?(console.log("Capturing cell at row ".concat(t,", col ").concat(l,":"),{type:e.type.name,content:e.content,textContent:e.textContent,attrs:e.attrs}),h.push({node:e.copy(e.content),content:e.content,attrs:$u({},e.attrs),type:e.type.name})):console.warn("Skipping non-cell node at row ".concat(t,", col ").concat(l,":"),e.type.name)),n++}))})),console.log("Column data extracted:",h),this.editor.chain().focus().addColumnAfter().run(),setTimeout((function(){try{console.log("Populating duplicated column with data:",h);var t=[];h.forEach((function(e,n){var i="";e&&e.content&&e.content.forEach((function(e){"text"===e.type.name?i+=e.text||"":"paragraph"===e.type.name?e.content&&e.content.forEach((function(e){"text"===e.type.name&&(i+=e.text||"")})):e.textContent?i+=e.textContent:e.text&&(i+=e.text),console.log("Node type: ".concat(e.type.name,', text: "').concat(e.text||e.textContent||"no text",'"'))})),t.push(i),console.log("Row ".concat(n," extracted text:"),i)})),t.forEach((function(e,t){e&&setTimeout((function(){try{console.log('Inserting "'.concat(e,'" into row ').concat(t))}catch(n){console.warn("Failed to insert content for row ".concat(t,":"),n)}}),100*t)}))}catch(n){console.error("Column duplication content restoration failed:",n)}e.editor.commands.focus()}),200)}}},moveRowUp:function(){if(this.editor){for(var e=this.editor.state,t=e.selection,n=t.$anchor,i=null,r=n.depth;r>0;r--)if("tableRow"===n.node(r).type.name){i=r;break}if(null!==i){var o=i-1,a=n.node(o),s=n.before(i),l=n.before(o),u=0,c=l+1;if(a.forEach((function(e){if(c===s)return!1;u++,c+=e.nodeSize})),0===u)return;var d=e.doc.nodeAt(s),p=l+1,f=0;a.forEach((function(e){if(f===u-1)return!1;p+=e.nodeSize,f++}));var h=e.doc.nodeAt(p),v=e.tr,m=d.copy(d.content),g=h.copy(h.content);v.replaceWith(s,s+d.nodeSize,g),v.replaceWith(p,p+h.nodeSize,m),this.editor.view.dispatch(v),this.editor.commands.focus()}}},moveRowDown:function(){if(this.editor){for(var e=this.editor.state,t=e.selection,n=t.$anchor,i=null,r=n.depth;r>0;r--)if("tableRow"===n.node(r).type.name){i=r;break}if(null!==i){var o=i-1,a=n.node(o),s=n.before(i),l=n.before(o),u=0,c=0,d=l+1;if(a.forEach((function(e){d===s&&(u=c),c++,d+=e.nodeSize})),u>=c-1)return;var p=e.doc.nodeAt(s),f=s+p.nodeSize,h=e.doc.nodeAt(f),v=e.tr,m=p.copy(p.content),g=h.copy(h.content);v.replaceWith(s,s+p.nodeSize,g),v.replaceWith(f,f+h.nodeSize,m),this.editor.view.dispatch(v),this.editor.commands.focus()}}},moveColumnLeft:function(){var e=this;if(this.editor){for(var t=this.editor.state,n=t.selection,i=null,r=n.$anchor.depth;r>0;r--){var o=n.$anchor.node(r);if("tableCell"===o.type.name||"tableHeader"===o.type.name){i=r;break}}if(null!==i){var a=t.doc.resolve(n.$anchor.before(i)),s=0,l=t.doc.resolve(n.$anchor.before(i)),u=l.node(l.depth-1),c=l.before(l.depth-1)+1;if(u.forEach((function(e,t){if(c===n.$anchor.before(i))return s=t,!1;c+=e.nodeSize})),console.log("moveColumnLeft - Current column index: ".concat(s,", total columns: ").concat(u.childCount)),0===s)return;var d=a.depth-2,p=a.node(d),f=[];p.forEach((function(e,t){var n=0;e.forEach((function(e){n===s&&("tableCell"===e.type.name||"tableHeader"===e.type.name?(console.log("moveColumnLeft - Capturing cell at row ".concat(t,", col ").concat(s,":"),{type:e.type.name,content:e.content,textContent:e.textContent,attrs:e.attrs}),f.push({node:e.copy(e.content),content:e.content,attrs:$u({},e.attrs),type:e.type.name})):console.warn("moveColumnLeft - Skipping non-cell node at row ".concat(t,", col ").concat(s,":"),e.type.name)),n++}))})),console.log("Moving column left, data:",f),this.editor.chain().focus().deleteColumn().run(),setTimeout((function(){e.editor.chain().focus().addColumnBefore().run(),setTimeout((function(){try{for(var t=e.editor.state,n=t.tr,i=!1,r=null,o=t.selection.$anchor.depth;o>0;o--){var a=t.selection.$anchor.node(o);if("tableCell"===a.type.name||"tableHeader"===a.type.name){r=o;break}}if(null!==r&&f.length>0){var l=t.doc.resolve(t.selection.$anchor.before(r)),u=l.depth-2,c=l.node(u),d=l.before(u),p=d+1;c.forEach((function(e,t){if(t<f.length){var r=p+1,o=0;e.forEach((function(e){if(o===s-1){var a=f[t];console.log("Restoring cell at row ".concat(t,", col ").concat(o,":"),a),a&&a.node&&(n.replaceWith(r,r+e.nodeSize,a.node),i=!0)}r+=e.nodeSize,o++}))}p+=e.nodeSize})),i&&e.editor.view.dispatch(n)}}catch(h){console.warn("Column move failed:",h)}e.editor.commands.focus()}),50)}),50)}}},moveColumnRight:function(){var e=this;if(this.editor){for(var t=this.editor.state,n=t.selection,i=null,r=n.$anchor.depth;r>0;r--){var o=n.$anchor.node(r);if("tableCell"===o.type.name||"tableHeader"===o.type.name){i=r;break}}if(null!==i){var a=t.doc.resolve(n.$anchor.before(i)),s=0,l=0,u=t.doc.resolve(n.$anchor.before(i)),c=u.node(u.depth-1),d=u.before(u.depth-1)+1;if(c.forEach((function(e,t){d===n.$anchor.before(i)&&(s=t),l++,d+=e.nodeSize})),console.log("moveColumnRight - Current column index: ".concat(s,", total columns: ").concat(l)),s>=l-1)return;var p=a.depth-2,f=a.node(p),h=[];f.forEach((function(e,t){var n=0;e.forEach((function(e){n===s&&("tableCell"===e.type.name||"tableHeader"===e.type.name?(console.log("moveColumnRight - Capturing cell at row ".concat(t,", col ").concat(s,":"),{type:e.type.name,content:e.content,textContent:e.textContent,attrs:e.attrs}),h.push({node:e.copy(e.content),content:e.content,attrs:$u({},e.attrs),type:e.type.name})):console.warn("moveColumnRight - Skipping non-cell node at row ".concat(t,", col ").concat(s,":"),e.type.name)),n++}))})),console.log("Moving column right, data:",h),this.editor.chain().focus().deleteColumn().run(),setTimeout((function(){e.editor.chain().focus().addColumnAfter().run(),setTimeout((function(){try{for(var t=e.editor.state,n=t.tr,i=!1,r=null,o=t.selection.$anchor.depth;o>0;o--){var a=t.selection.$anchor.node(o);if("tableCell"===a.type.name||"tableHeader"===a.type.name){r=o;break}}if(null!==r&&h.length>0){var l=t.doc.resolve(t.selection.$anchor.before(r)),u=l.depth-2,c=l.node(u),d=l.before(u),p=d+1;c.forEach((function(e,t){if(t<h.length){var r=p+1,o=0;e.forEach((function(e){if(o===s){var a=h[t];console.log("Restoring cell at row ".concat(t,", col ").concat(o,":"),a),a&&a.node&&(n.replaceWith(r,r+e.nodeSize,a.node),i=!0)}r+=e.nodeSize,o++}))}p+=e.nodeSize})),i&&e.editor.view.dispatch(n)}}catch(f){console.warn("Column move failed:",f)}e.editor.commands.focus()}),50)}),50)}}}}},Ju=qu,Wu=(n("5c6c"),Fi(Ju,Lu,Bu,!1,null,"2e470dcb",null)),Gu=Wu.exports,Zu=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.showMenu&&e.editor?n("div",{staticClass:"image-bubble-menu",style:e.menuStyle,on:{mouseenter:e.handleMenuEnter,mouseleave:e.handleMenuLeave}},[n("div",{staticClass:"bubble-menu-content"},[n("div",{staticClass:"menu-group"},[n("button",{class:["menu-btn",{active:e.isDisplay("block")}],attrs:{title:"Block Display"},on:{click:function(t){return e.setDisplay("block")}}},[n("BlockDisplay")],1),n("button",{class:["menu-btn",{active:e.isDisplay("inline")}],attrs:{title:"Inline Display"},on:{click:function(t){return e.setDisplay("inline")}}},[n("InlineDisplay")],1)]),n("div",{staticClass:"bbl-menu-divider"}),n("BubbleMenuDropdown",{attrs:{items:e.alignmentItems},scopedSlots:e._u([{key:"trigger",fn:function(){return[n(e.currentAlignIcon,{tag:"component"})]},proxy:!0}],null,!1,2490756210)}),n("div",{staticClass:"bbl-menu-divider"}),e.showSpacing?n("BubbleMenuDropdown",{attrs:{items:e.spacingItems},scopedSlots:e._u([{key:"trigger",fn:function(){return[n(e.currentSpacingIcon,{tag:"component",attrs:{width:"20",height:"20"}})]},proxy:!0}],null,!1,2157053435)}):e._e(),e.showSpacing?n("div",{staticClass:"bbl-menu-divider"}):e._e(),n("button",{staticClass:"menu-btn delete-btn",attrs:{title:"Delete Image"},on:{click:e.deleteImage}},[n("Delete")],1)],1)]):e._e()},Ku=[],Qu={name:"ImageBubbleMenu",components:{LeftAlign:Sr,CenterAlign:Pr,RightAlign:Ar,BlockDisplay:Jr,InlineDisplay:Yr,CaptionTop:ro,CaptionBottom:co,NoCaption:go,Delete:Co,SpacingSmall:To,SpacingMedium:Po,SpacingLarge:$o,BubbleMenuDropdown:Du},props:{editor:{type:Object,required:!0}},data:function(){return{showMenu:!1,menuStyle:{position:"fixed",top:"0px",left:"0px",zIndex:1e3},currentImageElement:null,hideTimeout:null}},mounted:function(){this.attachHoverListeners()},beforeDestroy:function(){this.removeHoverListeners(),this.hideTimeout&&clearTimeout(this.hideTimeout)},computed:{showSpacing:function(){if(!this.editor)return!1;var e=this.editor.getAttributes("resizableImage"),t=e.display||"block",n=e.align||"left";return"block"===t&&("left"===n||"right"===n)},currentAlignIcon:function(){var e=this.editor.getAttributes("resizableImage").align||"left";return"center"===e?Pr:"right"===e?Ar:Sr},currentSpacingIcon:function(){var e=this.editor.getAttributes("resizableImage").spacing||"medium";return"small"===e?To:"large"===e?$o:Po},currentCaptionIcon:function(){var e=this.editor.getAttributes("resizableImage").captionPosition||"none";return"top"===e?ro:"bottom"===e?co:go},alignmentItems:function(){var e=this;return[{label:"Align Left",icon:Sr,action:function(){return e.setAlign("left")},active:this.isAlign("left")},{label:"Align Center",icon:Pr,action:function(){return e.setAlign("center")},active:this.isAlign("center")},{label:"Align Right",icon:Ar,action:function(){return e.setAlign("right")},active:this.isAlign("right")}]},spacingItems:function(){var e=this;return[{label:"Small Spacing",icon:To,action:function(){return e.setSpacing("small")},active:this.isSpacing("small")},{label:"Medium Spacing",icon:Po,action:function(){return e.setSpacing("medium")},active:this.isSpacing("medium")},{label:"Large Spacing",icon:$o,action:function(){return e.setSpacing("large")},active:this.isSpacing("large")}]},captionItems:function(){var e=this;return[{label:"No Caption",icon:go,action:function(){return e.setCaptionPosition("none")},active:this.isCaptionPosition("none")},{label:"Caption Top",icon:ro,action:function(){return e.setCaptionPosition("top")},active:this.isCaptionPosition("top")},{label:"Caption Bottom",icon:co,action:function(){return e.setCaptionPosition("bottom")},active:this.isCaptionPosition("bottom")}]}},methods:{attachHoverListeners:function(){if(this.editor&&this.editor.view){var e=this.editor.view.dom;e.addEventListener("mouseover",this.handleImageHover),e.addEventListener("mouseout",this.handleImageLeave)}},removeHoverListeners:function(){if(this.editor&&this.editor.view){var e=this.editor.view.dom;e.removeEventListener("mouseover",this.handleImageHover),e.removeEventListener("mouseout",this.handleImageLeave)}},handleImageHover:function(e){var t=e.target.closest(".resizable-image-container");t&&(this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=null),this.currentImageElement=t,this.positionMenu(t),this.showMenu=!0,this.focusImageNode(t))},handleImageLeave:function(e){var t=this,n=e.target.closest(".resizable-image-container");!n||e.relatedTarget&&e.relatedTarget.closest(".image-bubble-menu")||(this.hideTimeout=setTimeout((function(){t.showMenu=!1,t.currentImageElement=null}),200))},handleMenuEnter:function(){this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=null)},handleMenuLeave:function(){var e=this;this.hideTimeout=setTimeout((function(){e.showMenu=!1,e.currentImageElement=null}),200)},positionMenu:function(e){var t=e.getBoundingClientRect();this.menuStyle={position:"fixed",top:"".concat(t.top-50,"px"),left:"".concat(t.left+t.width/2,"px"),transform:"translateX(-50%)",zIndex:1e3}},focusImageNode:function(e){var t=this.editor,n=t.state,i=t.view,r=n.doc,o=null;if(r.descendants((function(t,n){if("resizableImage"===t.type.name){var r=i.nodeDOM(n);if(r===e||r&&r.contains(e))return o=n,!1}})),null!==o){var a=n.tr.setSelection(this.editor.state.selection.constructor.create(n.doc,o));i.dispatch(a)}},isDisplay:function(e){return this.editor.isActive("resizableImage",{display:e})},isAlign:function(e){return this.editor.isActive("resizableImage",{align:e})},isCaptionPosition:function(e){return this.editor.isActive("resizableImage",{captionPosition:e})},isSpacing:function(e){return this.editor.isActive("resizableImage",{spacing:e})},setDisplay:function(e){this.editor.commands.updateAttributes("resizableImage",{display:e})},setAlign:function(e){this.editor.commands.updateAttributes("resizableImage",{align:e})},setCaptionPosition:function(e){var t=this.editor.getAttributes("resizableImage").caption||"",n="none"===e?"":t||"Enter caption...";this.editor.commands.updateAttributes("resizableImage",{captionPosition:e,caption:n})},setSpacing:function(e){this.editor.commands.updateAttributes("resizableImage",{spacing:e})},deleteImage:function(){this.editor.commands.deleteSelection(),this.showMenu=!1}}},Yu=Qu,Xu=(n("c65b"),Fi(Yu,Zu,Ku,!1,null,"17766d4e",null)),ec=Xu.exports,tc=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.showMenu&&e.editor?n("div",{staticClass:"video-bubble-menu",style:e.menuStyle,on:{mouseenter:e.handleMenuEnter,mouseleave:e.handleMenuLeave}},[n("div",{staticClass:"bubble-menu-content"},[n("div",{staticClass:"menu-group"},[n("button",{class:["menu-btn",{active:e.isDisplay("block")}],attrs:{title:"Block Display"},on:{click:function(t){return e.setDisplay("block")}}},[n("BlockDisplay")],1),n("button",{class:["menu-btn",{active:e.isDisplay("inline")}],attrs:{title:"Inline Display"},on:{click:function(t){return e.setDisplay("inline")}}},[n("InlineDisplay")],1)]),n("div",{staticClass:"bbl-menu-divider"}),n("BubbleMenuDropdown",{attrs:{items:e.alignmentItems},scopedSlots:e._u([{key:"trigger",fn:function(){return[n(e.currentAlignIcon,{tag:"component"})]},proxy:!0}],null,!1,2490756210)}),n("div",{staticClass:"bbl-menu-divider"}),e.showSpacing?n("BubbleMenuDropdown",{attrs:{items:e.spacingItems},scopedSlots:e._u([{key:"trigger",fn:function(){return[n(e.currentSpacingIcon,{tag:"component",attrs:{width:"20",height:"20"}})]},proxy:!0}],null,!1,2157053435)}):e._e(),e.showSpacing?n("div",{staticClass:"bbl-menu-divider"}):e._e(),n("button",{staticClass:"menu-btn delete-btn",attrs:{title:"Delete Video"},on:{click:e.deleteVideo}},[n("Delete")],1)],1)]):e._e()},nc=[],ic={name:"VideoBubbleMenu",components:{LeftAlign:Sr,CenterAlign:Pr,RightAlign:Ar,BlockDisplay:Jr,InlineDisplay:Yr,CaptionTop:ro,CaptionBottom:co,NoCaption:go,Delete:Co,SpacingSmall:To,SpacingMedium:Po,SpacingLarge:$o,BubbleMenuDropdown:Du},props:{editor:{type:Object,required:!0}},data:function(){return{showMenu:!1,menuStyle:{position:"fixed",top:"0px",left:"0px",zIndex:1e3},currentVideoElement:null,hideTimeout:null}},mounted:function(){this.attachHoverListeners()},beforeDestroy:function(){this.removeHoverListeners(),this.hideTimeout&&clearTimeout(this.hideTimeout)},computed:{showSpacing:function(){if(!this.editor)return!1;var e=this.editor.getAttributes("resizableVideo"),t=e.display||"block",n=e.align||"left";return"block"===t&&("left"===n||"right"===n)},currentAlignIcon:function(){var e=this.editor.getAttributes("resizableVideo").align||"left";return"center"===e?Pr:"right"===e?Ar:Sr},currentSpacingIcon:function(){var e=this.editor.getAttributes("resizableVideo").spacing||"medium";return"small"===e?To:"large"===e?$o:Po},currentCaptionIcon:function(){var e=this.editor.getAttributes("resizableVideo").captionPosition||"none";return"top"===e?ro:"bottom"===e?co:go},alignmentItems:function(){var e=this;return[{label:"Align Left",icon:Sr,action:function(){return e.setAlign("left")},active:this.isAlign("left")},{label:"Align Center",icon:Pr,action:function(){return e.setAlign("center")},active:this.isAlign("center")},{label:"Align Right",icon:Ar,action:function(){return e.setAlign("right")},active:this.isAlign("right")}]},spacingItems:function(){var e=this;return[{label:"Small Spacing",icon:To,action:function(){return e.setSpacing("small")},active:this.isSpacing("small")},{label:"Medium Spacing",icon:Po,action:function(){return e.setSpacing("medium")},active:this.isSpacing("medium")},{label:"Large Spacing",icon:$o,action:function(){return e.setSpacing("large")},active:this.isSpacing("large")}]},captionItems:function(){var e=this;return[{label:"No Caption",icon:go,action:function(){return e.setCaptionPosition("none")},active:this.isCaptionPosition("none")},{label:"Caption Top",icon:ro,action:function(){return e.setCaptionPosition("top")},active:this.isCaptionPosition("top")},{label:"Caption Bottom",icon:co,action:function(){return e.setCaptionPosition("bottom")},active:this.isCaptionPosition("bottom")}]}},methods:{attachHoverListeners:function(){if(this.editor&&this.editor.view){var e=this.editor.view.dom;e.addEventListener("mouseover",this.handleVideoHover),e.addEventListener("mouseout",this.handleVideoLeave)}},removeHoverListeners:function(){if(this.editor&&this.editor.view){var e=this.editor.view.dom;e.removeEventListener("mouseover",this.handleVideoHover),e.removeEventListener("mouseout",this.handleVideoLeave)}},handleVideoHover:function(e){var t=e.target.closest(".resizable-video-container");t&&(this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=null),this.currentVideoElement=t,this.positionMenu(t),this.showMenu=!0,this.focusVideoNode(t))},handleVideoLeave:function(e){var t=this,n=e.target.closest(".resizable-video-container");!n||e.relatedTarget&&e.relatedTarget.closest(".video-bubble-menu")||(this.hideTimeout=setTimeout((function(){t.showMenu=!1,t.currentVideoElement=null}),200))},handleMenuEnter:function(){this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=null)},handleMenuLeave:function(){var e=this;this.hideTimeout=setTimeout((function(){e.showMenu=!1,e.currentVideoElement=null}),200)},positionMenu:function(e){var t=e.getBoundingClientRect();this.menuStyle={position:"fixed",top:"".concat(t.top-50,"px"),left:"".concat(t.left+t.width/2,"px"),transform:"translateX(-50%)",zIndex:1e3}},focusVideoNode:function(e){var t=this.editor,n=t.state,i=t.view,r=n.doc,o=null;if(r.descendants((function(t,n){if("resizableVideo"===t.type.name){var r=i.nodeDOM(n);if(r===e||r&&r.contains(e))return o=n,!1}})),null!==o){var a=n.tr.setSelection(this.editor.state.selection.constructor.create(n.doc,o));i.dispatch(a)}},isDisplay:function(e){return this.editor.isActive("resizableVideo",{display:e})},isAlign:function(e){return this.editor.isActive("resizableVideo",{align:e})},isCaptionPosition:function(e){return this.editor.isActive("resizableVideo",{captionPosition:e})},isSpacing:function(e){return this.editor.isActive("resizableVideo",{spacing:e})},setDisplay:function(e){this.editor.commands.updateAttributes("resizableVideo",{display:e})},setAlign:function(e){this.editor.commands.updateAttributes("resizableVideo",{align:e})},setCaptionPosition:function(e){var t=this.editor.getAttributes("resizableVideo").caption||"",n="none"===e?"":t||"Enter caption...";this.editor.commands.updateAttributes("resizableVideo",{captionPosition:e,caption:n})},setSpacing:function(e){this.editor.commands.updateAttributes("resizableVideo",{spacing:e})},deleteVideo:function(){this.editor.commands.deleteSelection(),this.showMenu=!1}}},rc=ic,oc=(n("483d"),Fi(rc,tc,nc,!1,null,"b8fe8f10",null)),ac=oc.exports,sc=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.visible?n("div",{staticClass:"bbl-upload-modal-overlay",on:{click:e.handleOverlayClick}},[n("div",{staticClass:"bbl-upload-modal",on:{click:function(e){e.stopPropagation()}}},[n("div",{staticClass:"bbl-modal-header"},[n("h3",[e._v("Insert Image")]),n("button",{staticClass:"close-btn",on:{click:e.close}},[e._v("ร")])]),n("div",{staticClass:"bbl-modal-body"},[n("div",{staticClass:"tab-buttons"},[n("button",{class:["tab-btn",{active:"upload"===e.activeTab}],on:{click:function(t){e.activeTab="upload"}}},[e._v(" Upload File ")]),n("button",{class:["tab-btn",{active:"url"===e.activeTab}],on:{click:function(t){e.activeTab="url"}}},[e._v(" From URL ")])]),"upload"===e.activeTab?n("div",{staticClass:"tab-content"},[e.previewUrl?n("div",{staticClass:"preview-container"},[n("img",{staticClass:"preview-image",attrs:{src:e.previewUrl,alt:"Preview"}}),n("div",{staticClass:"preview-info"},[n("div",{staticClass:"preview-filename"},[e._v(e._s(e.selectedFile&&e.selectedFile.name))]),n("div",{staticClass:"preview-size"},[e._v(e._s(e.formatFileSize(e.selectedFile&&e.selectedFile.size)))])]),e.isUploading||e.uploadError||!e.uploadedUrl?e._e():n("div",{staticClass:"upload-success"},[e._m(0)]),e.isUploading?n("div",{staticClass:"upload-progress"},[n("div",{staticClass:"progress-bar"},[n("div",{staticClass:"progress-fill",style:{width:e.uploadProgress+"%"}})]),n("div",{staticClass:"progress-text"},[e._v("Uploading... "+e._s(e.uploadProgress)+"%")])]):e._e(),e.uploadError?n("div",{staticClass:"upload-error"},[n("div",{staticClass:"error-message"},[n("span",{staticClass:"error-icon"},[e._v("โ ๏ธ")]),e._v(" "+e._s(e.uploadError)+" ")]),n("div",{staticClass:"error-actions"},[n("button",{staticClass:"retry-btn",on:{click:function(t){return e.retryUpload(e.selectedFile)}}},[e._v("Try Again")]),n("button",{staticClass:"local-btn",on:{click:e.insertLocalImage}},[e._v("Use Local File")])])]):e._e(),e.isUploading||e.uploadError?e._e():n("button",{staticClass:"change-btn",on:{click:e.changeFile}},[e._v("Change Image")])]):n("div",{staticClass:"drop-zone",class:{"drag-over":e.isDragOver},on:{click:function(t){return e.$refs.fileInput.click()},dragover:function(t){t.preventDefault(),e.isDragOver=!0},dragleave:function(t){e.isDragOver=!1},drop:function(t){return t.preventDefault(),e.handleDrop.apply(null,arguments)}}},[n("div",{staticClass:"drop-zone-icon"},[e._v("๐")]),n("div",{staticClass:"drop-zone-title"},[e._v("Drop image here or click to browse")]),n("div",{staticClass:"drop-zone-subtitle"},[e._v("Supports: JPG, PNG, GIF, WebP (max "+e._s(Math.round(e.maxFileSize/1048576))+"MB)")]),n("input",{ref:"fileInput",staticStyle:{display:"none"},attrs:{type:"file",accept:"image/*"},on:{change:e.handleFileSelect}})])]):e._e(),"url"===e.activeTab?n("div",{staticClass:"tab-content"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.imageUrl,expression:"imageUrl"}],staticClass:"url-input",attrs:{type:"url",placeholder:"https://example.com/image.jpg"},domProps:{value:e.imageUrl},on:{input:function(t){t.target.composing||(e.imageUrl=t.target.value)}}}),n("div",{staticClass:"url-help"},[e._v("Enter a direct link to an image file")])]):e._e()]),n("div",{staticClass:"bbl-modal-footer"},[n("button",{staticClass:"cancel-btn",on:{click:e.close}},[e._v("Cancel")]),n("button",{staticClass:"insert-btn",attrs:{disabled:e.isUploading||"upload"===e.activeTab&&!e.selectedFile||"url"===e.activeTab&&!e.imageUrl.trim()},on:{click:e.insertImage}},[e.isUploading?n("span",[e._v("Uploading...")]):n("span",[e._v("Insert Image")])])])])]):e._e()},lc=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"success-message"},[n("span",{staticClass:"success-icon"},[e._v("โ
")]),e._v(" Upload complete! Ready to insert. ")])}];function uc(){
|
|
2
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function o(n,i,r,o){var l=i&&i.prototype instanceof s?i:s,u=Object.create(l.prototype);return cc(u,"_invoke",function(n,i,r){var o,s,l,u=0,c=r||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return o=t,s=0,l=e,p.n=n,a}};function f(n,i){for(s=n,l=i,t=0;!d&&u&&!r&&t<c.length;t++){var r,o=c[t],f=p.p,h=o[2];n>3?(r=h===i)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=f&&((r=n<2&&f<o[1])?(s=0,p.v=i,p.n=o[1]):f<h&&(r=n<3||o[0]>i||i>h)&&(o[4]=n,o[5]=i,p.n=h,s=0))}if(r||n>1)return a;throw d=!0,i}return function(r,c,h){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&f(c,h),s=c,l=h;(t=s<2?e:l)||!d;){o||(s?s<3?(s>1&&(p.n=-1),f(s,l)):p.n=l:p.v=l);try{if(u=2,o){if(s||(r="next"),t=o[r]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+r+"' method"),s=1);o=e}else if((t=(d=p.n<0)?l:n.call(i,p))!==a)break}catch(t){o=e,s=1,l=t}finally{u=1}}return{value:t,done:d}}}(n,r,o),!0),u}var a={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][i]?t(t([][i]())):(cc(t={},i,(function(){return this})),t),d=u.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,cc(e,r,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,cc(d,"constructor",u),cc(u,"constructor",l),l.displayName="GeneratorFunction",cc(u,r,"GeneratorFunction"),cc(d),cc(d,r,"Generator"),cc(d,i,(function(){return this})),cc(d,"toString",(function(){return"[object Generator]"})),(uc=function(){return{w:o,m:p}})()}function cc(e,t,n,i){var r=Object.defineProperty;try{r({},"",{})}catch(e){r=0}cc=function(e,t,n,i){function o(t,n){cc(e,t,(function(e){return this._invoke(t,n,e)}))}t?r?r(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},cc(e,t,n,i)}function dc(e,t,n,i,r,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(i,r)}function pc(e){return function(){var t=this,n=arguments;return new Promise((function(i,r){var o=e.apply(t,n);function a(e){dc(o,i,r,a,s,"next",e)}function s(e){dc(o,i,r,a,s,"throw",e)}a(void 0)}))}}var fc={props:{uploadHandler:{type:Function,default:null},uploadManager:{type:Object,default:null},maxFileSize:{type:Number,default:10485760},allowedTypes:{type:Array,default:function(){return[]}}},data:function(){return{isUploading:!1,uploadProgress:0,uploadError:null,uploadedUrl:null}},methods:{validateFile:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"file",n="image"===t?"image/":"video"===t?"video/":"";if(n&&!e.type.startsWith(n))throw new Error("Please select a valid ".concat(t," file."));if(this.allowedTypes.length>0&&!this.allowedTypes.includes(e.type))throw new Error("File type ".concat(e.type," is not allowed."));if(e.size>this.maxFileSize){var i=Math.round(this.maxFileSize/1048576);throw new Error("File size must be less than ".concat(i,"MB."))}return!0},handleApiUpload:function(e){var t=this;return pc(uc().m((function n(){var i,r,o;return uc().w((function(n){while(1)switch(n.p=n.n){case 0:return t.isUploading=!0,t.uploadError=null,t.uploadProgress=0,n.p=1,n.n=2,t.uploadManager.upload(e,{onProgress:function(e){t.uploadProgress=e.percentage||0}});case 2:if(i=n.v,r=(null===i||void 0===i?void 0:i.src)||(null===i||void 0===i?void 0:i.url)||(null===i||void 0===i?void 0:i.publicUrl)||(null===i||void 0===i?void 0:i.location)||(null===i||void 0===i?void 0:i.href),r||"string"!==typeof i){n.n=3;break}return t.uploadedUrl=i,t.isUploading=!1,n.a(2,i);case 3:if(r){n.n=4;break}throw new Error("No URL found in upload result");case 4:return t.uploadedUrl=r,t.isUploading=!1,n.a(2,r);case 5:throw n.p=5,o=n.v,t.uploadError=t.getErrorMessage(o),t.isUploading=!1,o;case 6:return n.a(2)}}),n,null,[[1,5]])})))()},handleLegacyUpload:function(e){var t=this;return pc(uc().m((function n(){var i,r,o;return uc().w((function(n){while(1)switch(n.p=n.n){case 0:return t.isUploading=!0,t.uploadError=null,t.uploadProgress=0,n.p=1,n.n=2,t.uploadHandler(e);case 2:if(i=n.v,r=(null===i||void 0===i?void 0:i.src)||(null===i||void 0===i?void 0:i.url)||(null===i||void 0===i?void 0:i.publicUrl)||(null===i||void 0===i?void 0:i.location)||(null===i||void 0===i?void 0:i.href),r||"string"!==typeof i){n.n=3;break}return t.uploadedUrl=i,t.isUploading=!1,n.a(2,i);case 3:if(r){n.n=4;break}throw new Error("No URL found in upload result");case 4:return t.uploadedUrl=r,t.isUploading=!1,n.a(2,r);case 5:throw n.p=5,o=n.v,t.uploadError=t.getErrorMessage(o),t.isUploading=!1,o;case 6:return n.a(2)}}),n,null,[[1,5]])})))()},autoUpload:function(e){var t=this;return pc(uc().m((function n(){return uc().w((function(n){while(1)switch(n.n){case 0:if(!t.uploadManager){n.n=2;break}return n.n=1,t.handleApiUpload(e);case 1:return n.a(2,n.v);case 2:if(!t.uploadHandler){n.n=4;break}return n.n=3,t.handleLegacyUpload(e);case 3:return n.a(2,n.v);case 4:return n.a(2,null)}}),n)})))()},retryUpload:function(e){var t=this;return pc(uc().m((function n(){return uc().w((function(n){while(1)switch(n.n){case 0:if(!t.uploadManager){n.n=2;break}return n.n=1,t.handleApiUpload(e);case 1:return n.a(2,n.v);case 2:if(!t.uploadHandler){n.n=4;break}return n.n=3,t.handleLegacyUpload(e);case 3:return n.a(2,n.v);case 4:throw new Error("No upload method available");case 5:return n.a(2)}}),n)})))()},getErrorMessage:function(e){var t,n,i,r,o;return null!==(t=e.message)&&void 0!==t&&t.includes("network")||null!==(n=e.message)&&void 0!==n&&n.includes("timeout")?"Network error. Please check your connection and try again.":null!==(i=e.message)&&void 0!==i&&i.includes("size")?"File too large. Please choose a smaller file.":null!==(r=e.message)&&void 0!==r&&r.includes("format")||null!==(o=e.message)&&void 0!==o&&o.includes("type")?"Invalid file format. Please choose a valid file.":e.message||"Upload failed. Please try again."},formatFileSize:function(e){if(!e)return"0 B";var t=1024,n=["B","KB","MB","GB"],i=Math.floor(Math.log(e)/Math.log(t));return Math.round(e/Math.pow(t,i)*100)/100+" "+n[i]},resetUploadState:function(){this.isUploading=!1,this.uploadProgress=0,this.uploadError=null,this.uploadedUrl=null}}};function hc(){
|
|
3
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function o(n,i,r,o){var l=i&&i.prototype instanceof s?i:s,u=Object.create(l.prototype);return vc(u,"_invoke",function(n,i,r){var o,s,l,u=0,c=r||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return o=t,s=0,l=e,p.n=n,a}};function f(n,i){for(s=n,l=i,t=0;!d&&u&&!r&&t<c.length;t++){var r,o=c[t],f=p.p,h=o[2];n>3?(r=h===i)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=f&&((r=n<2&&f<o[1])?(s=0,p.v=i,p.n=o[1]):f<h&&(r=n<3||o[0]>i||i>h)&&(o[4]=n,o[5]=i,p.n=h,s=0))}if(r||n>1)return a;throw d=!0,i}return function(r,c,h){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&f(c,h),s=c,l=h;(t=s<2?e:l)||!d;){o||(s?s<3?(s>1&&(p.n=-1),f(s,l)):p.n=l:p.v=l);try{if(u=2,o){if(s||(r="next"),t=o[r]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+r+"' method"),s=1);o=e}else if((t=(d=p.n<0)?l:n.call(i,p))!==a)break}catch(t){o=e,s=1,l=t}finally{u=1}}return{value:t,done:d}}}(n,r,o),!0),u}var a={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][i]?t(t([][i]())):(vc(t={},i,(function(){return this})),t),d=u.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,vc(e,r,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,vc(d,"constructor",u),vc(u,"constructor",l),l.displayName="GeneratorFunction",vc(u,r,"GeneratorFunction"),vc(d),vc(d,r,"Generator"),vc(d,i,(function(){return this})),vc(d,"toString",(function(){return"[object Generator]"})),(hc=function(){return{w:o,m:p}})()}function vc(e,t,n,i){var r=Object.defineProperty;try{r({},"",{})}catch(e){r=0}vc=function(e,t,n,i){function o(t,n){vc(e,t,(function(e){return this._invoke(t,n,e)}))}t?r?r(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},vc(e,t,n,i)}function mc(e,t,n,i,r,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(i,r)}function gc(e){return function(){var t=this,n=arguments;return new Promise((function(i,r){var o=e.apply(t,n);function a(e){mc(o,i,r,a,s,"next",e)}function s(e){mc(o,i,r,a,s,"throw",e)}a(void 0)}))}}var bc={name:"ImageModal",mixins:[fc],props:{visible:{type:Boolean,default:!1}},emits:["close","insert"],data:function(){return{activeTab:"upload",imageUrl:"",isDragOver:!1,selectedFile:null,previewUrl:null}},methods:{close:function(){this.activeTab="upload",this.imageUrl="",this.selectedFile=null,this.isDragOver=!1,this.resetUploadState(),this.clearPreview(),this.$emit("close")},clearPreview:function(){this.previewUrl&&(URL.revokeObjectURL(this.previewUrl),this.previewUrl=null)},changeFile:function(){this.clearPreview(),this.selectedFile=null,this.resetUploadState(),this.$refs.fileInput.click()},handleOverlayClick:function(e){e.target===e.currentTarget&&this.close()},handleFileSelect:function(e){var t=this;return gc(hc().m((function n(){return hc().w((function(n){while(1)switch(n.n){case 0:if(!(e.target.files.length>0)){n.n=1;break}return n.n=1,t.handleFile(e.target.files[0]);case 1:return n.a(2)}}),n)})))()},handleDrop:function(e){var t=this;return gc(hc().m((function n(){var i;return hc().w((function(n){while(1)switch(n.n){case 0:if(t.isDragOver=!1,i=e.dataTransfer.files,!(i.length>0)){n.n=1;break}return n.n=1,t.handleFile(i[0]);case 1:return n.a(2)}}),n)})))()},handleFile:function(e){var t=this;return gc(hc().m((function n(){var i;return hc().w((function(n){while(1)switch(n.p=n.n){case 0:if(n.p=0,t.validateFile(e,"image"),t.selectedFile=e,t.clearPreview(),t.resetUploadState(),t.previewUrl=URL.createObjectURL(e),!t.uploadManager&&!t.uploadHandler){n.n=1;break}return n.n=1,t.autoUpload(e);case 1:n.n=3;break;case 2:n.p=2,i=n.v,alert(i.message);case 3:return n.a(2)}}),n,null,[[0,2]])})))()},insertImage:function(){var e=this;return gc(hc().m((function t(){var n;return hc().w((function(t){while(1)switch(t.n){case 0:"url"===e.activeTab&&e.imageUrl.trim()?(e.$emit("insert",{src:e.imageUrl.trim(),width:400,height:300}),e.close()):"upload"===e.activeTab&&e.selectedFile&&(e.uploadedUrl?e.insertImageWithSrc(e.uploadedUrl):e.uploadManager||e.uploadHandler?e.insertImageWithSrc(e.previewUrl):(n=URL.createObjectURL(e.selectedFile),e.insertImageWithSrc(n)));case 1:return t.a(2)}}),t)})))()},insertImageWithSrc:function(e){this.$emit("insert",{src:e,width:400,height:300}),this.close()},insertLocalImage:function(){var e=this;return gc(hc().m((function t(){var n;return hc().w((function(t){while(1)switch(t.n){case 0:e.selectedFile&&(n=URL.createObjectURL(e.selectedFile),e.insertImageWithSrc(n));case 1:return t.a(2)}}),t)})))()}},beforeUnmount:function(){this.clearPreview()}},yc=bc,wc=(n("d046"),Fi(yc,sc,lc,!1,null,"863d9362",null)),kc=wc.exports,xc=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.visible?n("div",{staticClass:"bbl-upload-modal-overlay",on:{click:e.handleOverlayClick}},[n("div",{staticClass:"bbl-upload-modal",on:{click:function(e){e.stopPropagation()}}},[n("div",{staticClass:"bbl-modal-header"},[n("h3",[e._v("Insert Video")]),n("button",{staticClass:"close-btn",on:{click:e.close}},[e._v("ร")])]),n("div",{staticClass:"bbl-modal-body"},["url"===e.activeTab?n("div",{staticClass:"tab-content"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.videoUrl,expression:"videoUrl"}],staticClass:"url-input",attrs:{type:"url",placeholder:"https://youtube.com/watch?v=... or video file URL"},domProps:{value:e.videoUrl},on:{input:function(t){t.target.composing||(e.videoUrl=t.target.value)}}}),n("div",{staticClass:"url-help"},[e._v("Supports: YouTube, Vimeo, or direct video links (MP4, WebM)")])]):e._e(),"upload"===e.activeTab?n("div",{staticClass:"tab-content"},[e.previewUrl?n("div",{staticClass:"preview-container"},[n("video",{staticClass:"preview-video",attrs:{src:e.previewUrl,controls:""}}),n("div",{staticClass:"preview-info"},[n("div",{staticClass:"preview-filename"},[e._v(e._s(e.selectedFile&&e.selectedFile.name))]),n("div",{staticClass:"preview-size"},[e._v(e._s(e.formatFileSize(e.selectedFile&&e.selectedFile.size)))])]),e.isUploading||e.uploadError||!e.uploadedUrl?e._e():n("div",{staticClass:"upload-success"},[e._m(0)]),e.isUploading?n("div",{staticClass:"upload-progress"},[n("div",{staticClass:"progress-bar"},[n("div",{staticClass:"progress-fill",style:{width:e.uploadProgress+"%"}})]),n("div",{staticClass:"progress-text"},[e._v("Uploading... "+e._s(e.uploadProgress)+"%")])]):e._e(),e.uploadError?n("div",{staticClass:"upload-error"},[n("div",{staticClass:"error-message"},[n("span",{staticClass:"error-icon"},[e._v("โ ๏ธ")]),e._v(" "+e._s(e.uploadError)+" ")]),n("div",{staticClass:"error-actions"},[n("button",{staticClass:"retry-btn",on:{click:function(t){return e.retryUpload(e.selectedFile)}}},[e._v("Try Again")]),n("button",{staticClass:"local-btn",on:{click:e.insertLocalVideo}},[e._v("Use Local File")])])]):e._e(),e.isUploading||e.uploadError?e._e():n("button",{staticClass:"change-btn",on:{click:e.changeFile}},[e._v("Change Video")])]):n("div",{staticClass:"drop-zone",class:{"drag-over":e.isDragOver},on:{click:function(t){return e.$refs.fileInput.click()},dragover:function(t){t.preventDefault(),e.isDragOver=!0},dragleave:function(t){e.isDragOver=!1},drop:function(t){return t.preventDefault(),e.handleDrop.apply(null,arguments)}}},[n("div",{staticClass:"drop-zone-icon"},[e._v("๐ฅ")]),n("div",{staticClass:"drop-zone-title"},[e._v("Drop video here or click to browse")]),n("div",{staticClass:"drop-zone-subtitle"},[e._v("Supports: MP4, WebM, MOV (max "+e._s(Math.round(e.maxFileSize/1048576))+"MB)")]),n("input",{ref:"fileInput",staticStyle:{display:"none"},attrs:{type:"file",accept:"video/*"},on:{change:e.handleFileSelect}})])]):e._e()]),n("div",{staticClass:"bbl-modal-footer"},[n("button",{staticClass:"cancel-btn",on:{click:e.close}},[e._v("Cancel")]),n("button",{staticClass:"insert-btn",attrs:{disabled:e.isUploading||"upload"===e.activeTab&&!e.selectedFile||"url"===e.activeTab&&!e.videoUrl.trim()},on:{click:e.insertVideo}},[e.isUploading?n("span",[e._v("Uploading...")]):n("span",[e._v("Insert Video")])])])])]):e._e()},Cc=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"success-message"},[n("span",{staticClass:"success-icon"},[e._v("โ
")]),e._v(" Upload complete! Ready to insert. ")])}];function Sc(){
|
|
4
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function o(n,i,r,o){var l=i&&i.prototype instanceof s?i:s,u=Object.create(l.prototype);return Oc(u,"_invoke",function(n,i,r){var o,s,l,u=0,c=r||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return o=t,s=0,l=e,p.n=n,a}};function f(n,i){for(s=n,l=i,t=0;!d&&u&&!r&&t<c.length;t++){var r,o=c[t],f=p.p,h=o[2];n>3?(r=h===i)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=f&&((r=n<2&&f<o[1])?(s=0,p.v=i,p.n=o[1]):f<h&&(r=n<3||o[0]>i||i>h)&&(o[4]=n,o[5]=i,p.n=h,s=0))}if(r||n>1)return a;throw d=!0,i}return function(r,c,h){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&f(c,h),s=c,l=h;(t=s<2?e:l)||!d;){o||(s?s<3?(s>1&&(p.n=-1),f(s,l)):p.n=l:p.v=l);try{if(u=2,o){if(s||(r="next"),t=o[r]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+r+"' method"),s=1);o=e}else if((t=(d=p.n<0)?l:n.call(i,p))!==a)break}catch(t){o=e,s=1,l=t}finally{u=1}}return{value:t,done:d}}}(n,r,o),!0),u}var a={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][i]?t(t([][i]())):(Oc(t={},i,(function(){return this})),t),d=u.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,Oc(e,r,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,Oc(d,"constructor",u),Oc(u,"constructor",l),l.displayName="GeneratorFunction",Oc(u,r,"GeneratorFunction"),Oc(d),Oc(d,r,"Generator"),Oc(d,i,(function(){return this})),Oc(d,"toString",(function(){return"[object Generator]"})),(Sc=function(){return{w:o,m:p}})()}function Oc(e,t,n,i){var r=Object.defineProperty;try{r({},"",{})}catch(e){r=0}Oc=function(e,t,n,i){function o(t,n){Oc(e,t,(function(e){return this._invoke(t,n,e)}))}t?r?r(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},Oc(e,t,n,i)}function _c(e,t,n,i,r,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(i,r)}function Ec(e){return function(){var t=this,n=arguments;return new Promise((function(i,r){var o=e.apply(t,n);function a(e){_c(o,i,r,a,s,"next",e)}function s(e){_c(o,i,r,a,s,"throw",e)}a(void 0)}))}}var Mc={name:"VideoModal",mixins:[fc],props:{visible:{type:Boolean,default:!1},maxFileSize:{type:Number,default:52428800}},emits:["close","insert"],data:function(){return{activeTab:"url",videoUrl:"",isDragOver:!1,selectedFile:null,previewUrl:null}},methods:{close:function(){this.activeTab="url",this.videoUrl="",this.selectedFile=null,this.isDragOver=!1,this.resetUploadState(),this.clearPreview(),this.$emit("close")},clearPreview:function(){this.previewUrl&&(URL.revokeObjectURL(this.previewUrl),this.previewUrl=null)},changeFile:function(){this.clearPreview(),this.selectedFile=null,this.resetUploadState(),this.$refs.fileInput.click()},handleOverlayClick:function(e){e.target===e.currentTarget&&this.close()},handleFileSelect:function(e){var t=this;return Ec(Sc().m((function n(){return Sc().w((function(n){while(1)switch(n.n){case 0:if(!(e.target.files.length>0)){n.n=1;break}return n.n=1,t.handleFile(e.target.files[0]);case 1:return n.a(2)}}),n)})))()},handleDrop:function(e){var t=this;return Ec(Sc().m((function n(){var i;return Sc().w((function(n){while(1)switch(n.n){case 0:if(t.isDragOver=!1,i=e.dataTransfer.files,!(i.length>0)){n.n=1;break}return n.n=1,t.handleFile(i[0]);case 1:return n.a(2)}}),n)})))()},handleFile:function(e){var t=this;return Ec(Sc().m((function n(){var i;return Sc().w((function(n){while(1)switch(n.p=n.n){case 0:if(n.p=0,t.validateFile(e,"video"),t.selectedFile=e,t.clearPreview(),t.resetUploadState(),t.previewUrl=URL.createObjectURL(e),!t.uploadManager&&!t.uploadHandler){n.n=1;break}return n.n=1,t.autoUpload(e);case 1:n.n=3;break;case 2:n.p=2,i=n.v,alert(i.message);case 3:return n.a(2)}}),n,null,[[0,2]])})))()},insertVideo:function(){var e=this;return Ec(Sc().m((function t(){var n;return Sc().w((function(t){while(1)switch(t.n){case 0:"url"===e.activeTab&&e.videoUrl.trim()?(e.$emit("insert",{src:e.videoUrl.trim(),width:560,height:315}),e.close()):"upload"===e.activeTab&&e.selectedFile&&(e.uploadedUrl?e.insertVideoWithSrc(e.uploadedUrl):e.uploadManager||e.uploadHandler?e.insertVideoWithSrc(e.previewUrl):(n=URL.createObjectURL(e.selectedFile),e.insertVideoWithSrc(n)));case 1:return t.a(2)}}),t)})))()},insertVideoWithSrc:function(e){this.$emit("insert",{src:e,width:560,height:315}),this.close()},insertLocalVideo:function(){var e=this;return Ec(Sc().m((function t(){var n;return Sc().w((function(t){while(1)switch(t.n){case 0:e.selectedFile&&(n=URL.createObjectURL(e.selectedFile),e.insertVideoWithSrc(n));case 1:return t.a(2)}}),t)})))()}},beforeUnmount:function(){this.clearPreview()}},Tc=Mc,Ac=(n("fd09"),Fi(Tc,xc,Cc,!1,null,"1994d050",null)),Lc=Ac.exports,Bc=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.visible?n("div",{staticClass:"bbl-upload-modal-overlay",on:{click:e.handleOverlayClick}},[n("div",{staticClass:"bbl-upload-modal",on:{click:function(e){e.stopPropagation()}}},[n("div",{staticClass:"bbl-modal-header"},[n("h3",[e._v(e._s(e.isEditing?"Edit Link":"Insert Link"))]),n("button",{staticClass:"close-btn",on:{click:e.close}},[e._v("ร")])]),n("div",{staticClass:"bbl-modal-body"},[n("div",{staticClass:"bbl-form-group"},[n("label",{attrs:{for:"link-text"}},[e._v("Link Text")]),n("input",{directives:[{name:"model",rawName:"v-model",value:e.linkText,expression:"linkText"}],staticClass:"form-input",attrs:{id:"link-text",type:"text",placeholder:"Enter link text"},domProps:{value:e.linkText},on:{input:function(t){t.target.composing||(e.linkText=t.target.value)}}})]),n("div",{staticClass:"bbl-form-group"},[n("label",{attrs:{for:"link-url"}},[e._v("URL")]),n("input",{directives:[{name:"model",rawName:"v-model",value:e.linkUrl,expression:"linkUrl"}],staticClass:"form-input",attrs:{id:"link-url",type:"url",placeholder:"https://example.com"},domProps:{value:e.linkUrl},on:{input:function(t){t.target.composing||(e.linkUrl=t.target.value)}}})]),n("div",{staticClass:"bbl-form-group"},[n("label",{staticClass:"checkbox-label"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.openInNewTab,expression:"openInNewTab"}],staticClass:"checkbox-input",attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.openInNewTab)?e._i(e.openInNewTab,null)>-1:e.openInNewTab},on:{change:function(t){var n=e.openInNewTab,i=t.target,r=!!i.checked;if(Array.isArray(n)){var o=null,a=e._i(n,o);i.checked?a<0&&(e.openInNewTab=n.concat([o])):a>-1&&(e.openInNewTab=n.slice(0,a).concat(n.slice(a+1)))}else e.openInNewTab=r}}}),e._v(" Open in new tab ")])])]),n("div",{staticClass:"bbl-modal-footer"},[n("button",{staticClass:"cancel-btn",on:{click:e.close}},[e._v("Cancel")]),e.isEditing?n("button",{staticClass:"remove-btn",on:{click:e.removeLink}},[e._v("Remove Link")]):e._e(),n("button",{staticClass:"insert-btn",on:{click:e.insertLink}},[e._v(" "+e._s(e.isEditing?"Update Link":"Insert Link")+" ")])])])]):e._e()},zc=[],jc={name:"LinkModal",props:{visible:{type:Boolean,default:!1},initialText:{type:String,default:""},initialUrl:{type:String,default:""},initialTarget:{type:String,default:""}},emits:["close","insert","remove"],data:function(){return{linkText:this.initialText,linkUrl:this.initialUrl,openInNewTab:"_blank"===this.initialTarget}},computed:{isEditing:function(){return!!this.initialUrl}},watch:{visible:function(e){e&&(this.linkText=this.initialText,this.linkUrl=this.initialUrl,this.openInNewTab="_blank"===this.initialTarget)}},methods:{close:function(){this.linkText="",this.linkUrl="",this.openInNewTab=!1,this.$emit("close")},handleOverlayClick:function(e){e.target===e.currentTarget&&this.close()},insertLink:function(){if(this.linkUrl.trim()){var e={href:this.linkUrl.trim(),target:this.openInNewTab?"_blank":null};this.linkText.trim()&&(e.text=this.linkText.trim()),this.$emit("insert",e),this.close()}else alert("Please enter a URL")},removeLink:function(){this.$emit("remove"),this.close()}}},Pc=jc,Ic=(n("1300"),Fi(Pc,Bc,zc,!1,null,"744289fc",null)),Hc=Ic.exports,Dc=(n("0450"),n("71c9"),n("e6b9"),{name:"PremiumBblEditor",components:{EditorContent:s["EditorContent"],ToolbarMain:Su,EditorBubbleMenu:Au,TableBubbleMenu:Gu,ImageBubbleMenu:ec,VideoBubbleMenu:ac,ImageModal:kc,VideoModal:Lc,LinkModal:Hc},props:{value:{type:String,default:""},placeholder:{type:String,default:"Start writing..."},editable:{type:Boolean,default:!0},outputFormat:{type:String,default:"html",validator:function(e){return["html","json"].includes(e)}},maxHeight:{type:[String,Number],default:null},minHeight:{type:[String,Number],default:200},theme:{type:String,default:"default",validator:function(e){return["default","minimal","dark"].includes(e)}},showToolbar:{type:Boolean,default:!0},showBubbleMenu:{type:Boolean,default:!0},showTableBubbleMenu:{type:Boolean,default:!0},showImageBubbleMenu:{type:Boolean,default:!0},showVideoBubbleMenu:{type:Boolean,default:!0},toolbarConfig:{type:Object,default:function(){return{bold:!0,italic:!0,underline:!0,strike:!0,code:!0,textColor:!0,highlight:!0,fontFamily:!0,fontSize:!0,textAlign:!0,lineHeight:!0,headings:!0,lists:!0,blockquote:!0,codeBlock:!0,horizontalRule:!0,link:!0,image:!0,video:!0,table:!0,clearFormatting:!0,sourceCode:!0,undo:!0,redo:!0}}},extensionConfig:{type:Object,default:function(){return{image:{allowResize:!0,allowAlignment:!0,allowDelete:!0,maxWidth:"100%",quality:.8},video:{allowResize:!0,allowAlignment:!0,allowDelete:!0,maxWidth:"100%",autoplay:!1},table:{resizable:!0,allowRowControls:!0,allowColumnControls:!0,cellSelection:!0},link:{openOnClick:!1,autolink:!0,linkOnPaste:!0},textAlign:{types:["heading","paragraph"]}}}},uploadHandler:{type:Function,default:null},uploadManager:{type:Object,default:null},imageUploadUrl:{type:String,default:null},videoUploadUrl:{type:String,default:null},maxFileSize:{type:Number,default:10485760},allowedImageTypes:{type:Array,default:function(){return["image/jpeg","image/png","image/gif","image/webp"]}},allowedVideoTypes:{type:Array,default:function(){return["video/mp4","video/webm","video/ogg"]}},useBase64Upload:{type:Boolean,default:!1},base64Quality:{type:Number,default:.8,validator:function(e){return e>=.1&&e<=1}},base64MaxWidth:{type:Number,default:1920},base64MaxHeight:{type:Number,default:1080},enableImageCompression:{type:Boolean,default:!0},preserveOriginalFileName:{type:Boolean,default:!0},base64Prefix:{type:String,default:"data:"},maxContentLength:{type:Number,default:null},allowedHeadings:{type:Array,default:function(){return[1,2,3,4,5,6]}},fontFamilies:{type:Array,default:function(){return["Inter","Arial","Helvetica","Times New Roman","Georgia","Courier New","Monaco","Menlo"]}},fontSizes:{type:Array,default:function(){return["12px","14px","16px","18px","20px","24px","28px","32px","36px","48px"]}},lineHeights:{type:Array,default:function(){return["1","1.2","1.4","1.6","1.8","2","2.5","3"]}},autofocus:{type:Boolean,default:!1},spellcheck:{type:Boolean,default:!0},autoSave:{type:Boolean,default:!1},autoSaveInterval:{type:Number,default:3e4},editorClass:{type:[String,Array,Object],default:""},toolbarClass:{type:[String,Array,Object],default:""},contentClass:{type:[String,Array,Object],default:""},wrapWithContentClass:{type:Boolean,default:!0}},setup:function(e,t){var n=t.emit,i=Bi(e,n),r=i.editor,o=i.isEditorReady,a=i.currentContent,s=i.editorError,l=i.missingDependencies,u=i.executeCommand,c=i.isActive,d=i.getContent,p=i.setContent,f=i.focus,h=i.blur;return{editor:r,isEditorReady:o,currentContent:a,editorError:s,missingDependencies:l,executeCommand:u,isActive:c,getContent:d,setContent:p,focus:f,blur:h}},data:function(){return{showImageModal:!1,showVideoModal:!1,showLinkModal:!1,linkModalData:{text:"",url:"",target:""},isSourceCodeMode:!1,sourceCode:"",sourceCodeUpdateTimeout:null,autoSaveTimeout:null}},computed:{contentStyles:function(){var e={};return this.minHeight&&(e.minHeight="number"===typeof this.minHeight?"".concat(this.minHeight,"px"):this.minHeight),e},editorStyles:function(){var e={};return this.maxHeight&&(e.maxHeight="number"===typeof this.maxHeight?"".concat(this.maxHeight,"px"):this.maxHeight),this.minHeight&&(e.minHeight="number"===typeof this.minHeight?"".concat(this.minHeight,"px"):this.minHeight),e}},watch:{currentContent:{handler:function(e){this.autoSave&&e!==this.value&&this.scheduleAutoSave()},immediate:!1}},beforeDestroy:function(){this.sourceCodeUpdateTimeout&&clearTimeout(this.sourceCodeUpdateTimeout),this.autoSaveTimeout&&clearTimeout(this.autoSaveTimeout)},methods:{scheduleAutoSave:function(){var e=this;this.autoSaveTimeout&&clearTimeout(this.autoSaveTimeout),this.autoSaveTimeout=setTimeout((function(){e.$emit("auto-save",e.currentContent)}),this.autoSaveInterval)},defaultImageUpload:function(e){var t=this;return new Promise((function(n,i){if(t.imageUploadUrl&&!t.useBase64Upload){var r=new FormData;r.append("image",e),fetch(t.imageUploadUrl,{method:"POST",body:r}).then((function(e){return e.json()})).then((function(t){t.url?n({src:t.url,alt:e.name}):i(new Error("Upload failed: No URL returned"))})).catch(i)}else t.convertImageToBase64(e).then((function(e){return n(e)})).catch(i)}))},defaultVideoUpload:function(e){var t=this;return new Promise((function(n,i){if(t.videoUploadUrl&&!t.useBase64Upload){var r=new FormData;r.append("video",e),fetch(t.videoUploadUrl,{method:"POST",body:r}).then((function(e){return e.json()})).then((function(e){e.url?n({src:e.url}):i(new Error("Upload failed: No URL returned"))})).catch(i)}else t.convertVideoToBase64(e).then((function(e){return n(e)})).catch(i)}))},convertImageToBase64:function(e){var t=this;return new Promise((function(n,i){if(!t.enableImageCompression){var r=new FileReader;return r.onload=function(i){n({src:i.target.result,alt:t.preserveOriginalFileName?e.name:"Image",size:e.size,type:e.type,originalName:e.name})},r.onerror=i,void r.readAsDataURL(e)}var o=new Image,a=document.createElement("canvas"),s=a.getContext("2d");o.onload=function(){try{var r=t.calculateImageDimensions(o.width,o.height,t.base64MaxWidth,t.base64MaxHeight),l=r.width,u=r.height;a.width=l,a.height=u,s.drawImage(o,0,0,l,u);var c=a.toDataURL(e.type,t.base64Quality);t.$emit("image-compressed",{originalSize:e.size,compressedSize:t.getBase64Size(c),originalDimensions:{width:o.width,height:o.height},compressedDimensions:{width:l,height:u},compressionRatio:e.size/t.getBase64Size(c)}),n({src:c,alt:t.preserveOriginalFileName?e.name:"Image",width:l,height:u,size:t.getBase64Size(c),originalSize:e.size,type:e.type,originalName:e.name,compressed:!0})}catch(d){i(new Error("Image compression failed: ".concat(d.message)))}},o.onerror=function(){return i(new Error("Failed to load image for compression"))};var l=URL.createObjectURL(e);o.src=l,o.onload=function(e){return function(){return URL.revokeObjectURL(l),e.apply(this,arguments)}}(o.onload)}))},convertVideoToBase64:function(e){var t=this;return new Promise((function(n,i){var r=new FileReader;r.onload=function(i){n({src:i.target.result,size:e.size,type:e.type,originalName:t.preserveOriginalFileName?e.name:"Video",compressed:!1})},r.onerror=i,r.readAsDataURL(e)}))},calculateImageDimensions:function(e,t,n,i){var r=e,o=t,a=n/e,s=i/t,l=Math.min(a,s,1);return l<1&&(r=Math.round(e*l),o=Math.round(t*l)),{width:r,height:o}},getBase64Size:function(e){var t=e.split(",")[1]||e;return Math.round(3*t.length/4)},validateContent:function(e){return!(this.maxContentLength&&e.length>this.maxContentLength)||(this.$emit("content-limit-exceeded",{current:e.length,max:this.maxContentLength}),!1)},formatHTML:function(e){if(!e)return"";var t="",n=0,i=" ",r=["a","abbr","b","bdi","bdo","br","cite","code","data","dfn","em","i","kbd","mark","q","s","samp","small","span","strong","sub","sup","time","u","var"],o=["br","hr","img","input","link","meta"],a=[],s=0;while(s<e.length){var l=e.indexOf("<",s);if(-1===l){var u=e.substring(s).trim();u&&a.push({type:"text",content:u});break}if(l>s){var c=e.substring(s,l).trim();c&&a.push({type:"text",content:c})}var d=e.indexOf(">",l);if(-1===d)break;var p=e.substring(l,d+1),f=p.match(/<\/?(\w+)/)&&p.match(/<\/?(\w+)/)[1]&&p.match(/<\/?(\w+)/)[1].toLowerCase();p.startsWith("</")?a.push({type:"close",content:p,tagName:f,inline:r.includes(f)}):p.endsWith("/>")||o.includes(f)?a.push({type:"self",content:p,tagName:f}):p.startsWith("\x3c!--")?a.push({type:"comment",content:p}):a.push({type:"open",content:p,tagName:f,inline:r.includes(f)}),s=d+1}var h=!1,v="";return a.forEach((function(e,r){var o=a[r+1],s=a[r-1];"open"===e.type?e.inline?(!h&&v&&(t+=i.repeat(n)+v,v=""),v+=e.content,h=!0):(v&&(t+=i.repeat(n)+v+"\n",v=""),t+=i.repeat(n)+e.content+"\n",n++,h=!1):"close"===e.type?e.inline?(v+=e.content,o&&(o.inline||"text"===o.type)||(t+=i.repeat(n)+v+"\n",v="",h=!1)):(n=Math.max(0,n-1),v&&(t+=i.repeat(n+1)+v+"\n",v=""),t+=i.repeat(n)+e.content+"\n",h=!1):"self"===e.type?(v&&(t+=i.repeat(n)+v+"\n",v=""),t+=i.repeat(n)+e.content+"\n",h=!1):"text"===e.type?h||s&&s.inline?v+=e.content:(v&&(t+=i.repeat(n)+v+"\n",v=""),t+=i.repeat(n)+e.content+"\n"):"comment"===e.type&&(v&&(t+=i.repeat(n)+v+"\n",v=""),t+=i.repeat(n)+e.content+"\n")})),v&&(t+=i.repeat(n)+v+"\n"),t.trim()},toggleSourceCode:function(){if(this.editor)if(this.isSourceCodeMode)this.editor.commands.setContent(this.sourceCode),this.isSourceCodeMode=!1;else{var e=this.editor.getHTML();this.sourceCode=this.formatHTML(e),this.isSourceCodeMode=!0}},updateFromSourceCode:function(){var e=this;this.sourceCodeUpdateTimeout&&clearTimeout(this.sourceCodeUpdateTimeout),this.sourceCodeUpdateTimeout=setTimeout((function(){if(e.editor&&e.isSourceCodeMode)try{e.editor.commands.setContent(e.sourceCode)}catch(t){console.warn("Invalid HTML in source code:",t)}}),500)},openLinkModal:function(){var e=this.editor.state.selection,t=e.from,n=e.to,i=this.editor.state.doc.textBetween(t,n,""),r=this.editor.getAttributes("link");this.linkModalData={text:i||"",url:r.href||"",target:r.target||""},this.showLinkModal=!0},clearFormatting:function(){this.executeCommand("unsetAllMarks"),this.executeCommand("clearNodes")},insertLink:function(e){var t=e.href,n=e.target,i=e.text;i&&this.editor.state.selection.empty?this.editor.chain().focus().insertContent({type:"text",text:i,marks:[{type:"link",attrs:{href:t,target:n}}]}).run():this.executeCommand("setLink",{href:t,target:n})},removeLink:function(){this.editor.chain().focus().unsetLink().run()},insertImage:function(e){this.executeCommand("setResizableImage",e)},insertVideo:function(e){this.executeCommand("setResizableVideo",e)}}}),Fc=Dc,Rc=(n("3afb"),Fi(Fc,o,a,!1,null,"373e0c3f",null)),$c=Rc.exports,Uc=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"premium-editor-container",class:["theme-"+e.theme,e.editorClass]},[e.isEditorReady||e.editorError?e._e():n("div",{staticClass:"editor-loading"},[n("div",{staticClass:"loading-spinner"}),n("p",[e._v("Loading Premium Editor...")])]),e.editorError?n("div",{staticClass:"editor-error"},[n("div",{staticClass:"error-icon"},[e._v("โ ๏ธ")]),n("div",{staticClass:"error-content"},[n("h3",[e._v("Editor Failed to Load")]),e.missingDependencies.length>0?n("div",{staticClass:"missing-deps"},[e._m(0),n("ul",e._l(e.missingDependencies,(function(t){return n("li",{key:t},[e._v(e._s(t))])})),0),e._m(1)]):n("div",{staticClass:"generic-error"},[n("p",[e._v(e._s(e.editorError))]),n("p",[e._v("Please check the browser console for more details.")])]),e._m(2)])]):e._e(),n("div",{directives:[{name:"show",rawName:"v-show",value:e.isEditorReady&&!e.editorError,expression:"isEditorReady && !editorError"}],staticClass:"premium-editor-wrapper"},[e.showToolbar?n("div",{staticClass:"premium-toolbar-container",class:e.toolbarClass},[e.editor?n("ToolbarMain",{attrs:{editor:e.editor,config:e.toolbarConfig,"font-families":e.fontFamilies,"font-sizes":e.fontSizes,"line-heights":e.lineHeights,"allowed-headings":e.allowedHeadings,"source-code-mode":e.isSourceCodeMode},on:{"execute-command":e.executeCommand,"insert-link":e.openLinkModal,"insert-image":function(t){e.showImageModal=!0},"insert-video":function(t){e.showVideoModal=!0},"clear-formatting":e.clearFormatting,"toggle-source-code":e.toggleSourceCode}}):n("div",{staticClass:"toolbar-loading"},[n("div",{staticClass:"toolbar-loading-content"},[n("div",{staticClass:"loading-spinner-small"}),n("span",[e._v("Loading toolbar...")])])])],1):e._e(),n("div",{staticClass:"premium-editor-content",class:e.contentClass,style:e.contentStyles},[n("editor-content",{directives:[{name:"show",rawName:"v-show",value:!e.isSourceCodeMode,expression:"!isSourceCodeMode"}],staticClass:"bbl-editor-area",style:e.editorStyles,attrs:{editor:e.editor}}),n("textarea",{directives:[{name:"show",rawName:"v-show",value:e.isSourceCodeMode,expression:"isSourceCodeMode"},{name:"model",rawName:"v-model",value:e.sourceCode,expression:"sourceCode"}],staticClass:"source-code-editor",style:e.editorStyles,attrs:{spellcheck:e.spellcheck},domProps:{value:e.sourceCode},on:{input:[function(t){t.target.composing||(e.sourceCode=t.target.value)},e.updateFromSourceCode]}})],1),e.showBubbleMenu&&e.editor?n("EditorBubbleMenu",{attrs:{editor:e.editor,config:e.toolbarConfig},on:{"execute-command":e.executeCommand}}):e._e(),e.showTableBubbleMenu&&e.editor?n("TableBubbleMenu",{attrs:{editor:e.editor}}):e._e(),e.showImageBubbleMenu&&e.editor?n("ImageBubbleMenu",{attrs:{editor:e.editor}}):e._e(),e.showVideoBubbleMenu&&e.editor?n("VideoBubbleMenu",{attrs:{editor:e.editor}}):e._e()],1),n("LinkModal",{attrs:{visible:e.showLinkModal,"initial-text":e.linkModalData.text,"initial-url":e.linkModalData.url,"initial-target":e.linkModalData.target},on:{close:function(t){e.showLinkModal=!1},insert:e.insertLink,remove:e.removeLink}}),n("ImageModal",{attrs:{visible:e.showImageModal,"upload-handler":e.uploadHandler||e.defaultImageUpload,"upload-manager":e.uploadManager,"max-file-size":e.maxFileSize,"allowed-types":e.allowedImageTypes},on:{close:function(t){e.showImageModal=!1},insert:e.insertImage}}),n("VideoModal",{attrs:{visible:e.showVideoModal,"upload-handler":e.uploadHandler||e.defaultVideoUpload,"upload-manager":e.uploadManager,"max-file-size":e.maxFileSize,"allowed-types":e.allowedVideoTypes},on:{close:function(t){e.showVideoModal=!1},insert:e.insertVideo}})],1)},Nc=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("p",[n("strong",[e._v("Missing Dependencies:")])])},function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"install-command"},[n("p",[n("strong",[e._v("Quick Fix:")])]),n("code",[e._v("npm install @vue/composition-api @tiptap/core @tiptap/vue-2 @tiptap/starter-kit @tiptap/extension-text-style @tiptap/extension-color @tiptap/extension-highlight @tiptap/extension-underline @tiptap/extension-text-align @tiptap/extension-link @tiptap/extension-font-family @tiptap/extension-code @tiptap/extension-code-block @tiptap/extension-table @tiptap/extension-table-row @tiptap/extension-table-cell @tiptap/extension-table-header @tiptap/extension-task-list @tiptap/extension-task-item @tiptap/extension-placeholder")])])},function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"help-links"},[n("a",{attrs:{href:"https://github.com/kazi-shahin/vue2-bbl-editor#quick-setup",target:"_blank"}},[e._v("๐ Setup Guide")]),n("a",{attrs:{href:"https://github.com/kazi-shahin/vue2-bbl-editor/blob/main/TROUBLESHOOTING.md",target:"_blank"}},[e._v("๐ง Troubleshooting")])])}];function Vc(e){return Vc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vc(e)}function qc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Jc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qc(Object(n),!0).forEach((function(t){Wc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Wc(e,t,n){return(t=Gc(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gc(e){var t=Zc(e,"string");return"symbol"==Vc(t)?t:t+""}function Zc(e,t){if("object"!=Vc(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=Vc(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var Kc=pn.a.extend({renderHTML:function(e){var t=e.HTMLAttributes;return["code",Jc(Jc({},t),{},{style:"background: #f1f5f9; padding: 0.2em 0.4em; border-radius: 3px; font-family: Monaco, Menlo, Ubuntu Mono, monospace; font-size: 0.9em; color: #e11d48;"}),0]}}),Qc=cn.extend({renderHTML:function(e){var t=e.HTMLAttributes;return["pre",Jc(Jc({},t),{},{style:"background: #1e293b; color: #e2e8f0; padding: 1em; border-radius: 6px; overflow-x: auto; margin: 1.5em 0;"}),["code",{style:"background: transparent; padding: 0; color: inherit; font-family: Monaco, Menlo, Ubuntu Mono, monospace;"},0]]}}),Yc=O["Extension"].create({name:"fontSize",addOptions:function(){return{types:["textStyle"]}},addGlobalAttributes:function(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:function(e){return e.style.fontSize||null},renderHTML:function(e){return e.fontSize?{style:"font-size: ".concat(e.fontSize)}:{}}}}}]},addCommands:function(){return{setFontSize:function(e){return function(t){var n=t.chain;return n().setMark("textStyle",{fontSize:e}).run()}},unsetFontSize:function(){return function(e){var t=e.chain;return t().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}}}}),Xc=O["Extension"].create({name:"lineHeight",addOptions:function(){return{types:["paragraph","heading"]}},addGlobalAttributes:function(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:function(e){return e.style.lineHeight||null},renderHTML:function(e){return e.lineHeight?{style:"line-height: ".concat(e.lineHeight)}:{}}}}}]},addCommands:function(){var e=this;return{setLineHeight:function(t){return function(n){var i=n.commands;return e.options.types.every((function(e){return i.updateAttributes(e,{lineHeight:t})}))}},unsetLineHeight:function(){return function(t){var n=t.commands;return e.options.types.every((function(e){return n.resetAttributes(e,"lineHeight")}))}}}}}),ed={name:"PremiumBblEditorOptionsAPI",components:{EditorContent:s["EditorContent"],ToolbarMain:Su,EditorBubbleMenu:Au,TableBubbleMenu:Gu,ImageBubbleMenu:ec,VideoBubbleMenu:ac,ImageModal:kc,VideoModal:Lc,LinkModal:Hc},props:{value:{type:String,default:""},placeholder:{type:String,default:"Start writing..."},editable:{type:Boolean,default:!0},outputFormat:{type:String,default:"html",validator:function(e){return["html","json"].includes(e)}},maxHeight:{type:[String,Number],default:null},minHeight:{type:[String,Number],default:200},theme:{type:String,default:"default",validator:function(e){return["default","minimal","dark"].includes(e)}},showToolbar:{type:Boolean,default:!0},showBubbleMenu:{type:Boolean,default:!0},showTableBubbleMenu:{type:Boolean,default:!0},showImageBubbleMenu:{type:Boolean,default:!0},showVideoBubbleMenu:{type:Boolean,default:!0},toolbarConfig:{type:Object,default:function(){return{bold:!0,italic:!0,underline:!0,strike:!0,code:!0,textColor:!0,highlight:!0,fontFamily:!0,fontSize:!0,textAlign:!0,lineHeight:!0,headings:!0,lists:!0,blockquote:!0,codeBlock:!0,horizontalRule:!0,link:!0,image:!0,video:!0,table:!0,clearFormatting:!0,sourceCode:!0,undo:!0,redo:!0}}},extensionConfig:{type:Object,default:function(){return{image:{allowResize:!0,allowAlignment:!0,allowDelete:!0,maxWidth:"100%",quality:.8},video:{allowResize:!0,allowAlignment:!0,allowDelete:!0,maxWidth:"100%",autoplay:!1},table:{resizable:!0,allowRowControls:!0,allowColumnControls:!0,cellSelection:!0},link:{openOnClick:!1,autolink:!0,linkOnPaste:!0},textAlign:{types:["heading","paragraph"]}}}},uploadHandler:{type:Function,default:null},uploadManager:{type:Object,default:null},imageUploadUrl:{type:String,default:null},videoUploadUrl:{type:String,default:null},maxFileSize:{type:Number,default:10485760},allowedImageTypes:{type:Array,default:function(){return["image/jpeg","image/png","image/gif","image/webp"]}},allowedVideoTypes:{type:Array,default:function(){return["video/mp4","video/webm","video/ogg"]}},useBase64Upload:{type:Boolean,default:!1},base64Quality:{type:Number,default:.8,validator:function(e){return e>=.1&&e<=1}},base64MaxWidth:{type:Number,default:1920},base64MaxHeight:{type:Number,default:1080},enableImageCompression:{type:Boolean,default:!0},preserveOriginalFileName:{type:Boolean,default:!0},base64Prefix:{type:String,default:"data:"},maxContentLength:{type:Number,default:null},allowedHeadings:{type:Array,default:function(){return[1,2,3,4,5,6]}},fontFamilies:{type:Array,default:function(){return["Inter","Arial","Helvetica","Times New Roman","Georgia","Courier New","Monaco","Menlo"]}},fontSizes:{type:Array,default:function(){return["12px","14px","16px","18px","20px","24px","28px","32px","36px","48px"]}},lineHeights:{type:Array,default:function(){return["1","1.2","1.4","1.6","1.8","2","2.5","3"]}},autofocus:{type:Boolean,default:!1},spellcheck:{type:Boolean,default:!0},autoSave:{type:Boolean,default:!1},autoSaveInterval:{type:Number,default:3e4},editorClass:{type:[String,Array,Object],default:""},toolbarClass:{type:[String,Array,Object],default:""},contentClass:{type:[String,Array,Object],default:""},wrapWithContentClass:{type:Boolean,default:!0}},data:function(){return{editor:null,isEditorReady:!1,editorError:null,missingDependencies:[],internalValue:this.value||"",showImageModal:!1,showVideoModal:!1,showLinkModal:!1,linkModalData:{text:"",url:"",target:""},isSourceCodeMode:!1,sourceCode:"",sourceCodeUpdateTimeout:null,autoSaveTimeout:null,initializationTimeout:null}},computed:{currentContent:function(){if(!this.editor)return"";var e=this.outputFormat||"html",t="json"===e?JSON.stringify(this.editor.getJSON()):this.editor.getHTML();return"html"===e&&!1!==this.wrapWithContentClass?'<div class="bbl-html-section">'.concat(t,"</div>"):t},contentStyles:function(){var e={};return this.minHeight&&(e.minHeight="number"===typeof this.minHeight?"".concat(this.minHeight,"px"):this.minHeight),e},editorStyles:function(){var e={};return this.maxHeight&&(e.maxHeight="number"===typeof this.maxHeight?"".concat(this.maxHeight,"px"):this.maxHeight),this.minHeight&&(e.minHeight="number"===typeof this.minHeight?"".concat(this.minHeight,"px"):this.minHeight),e}},watch:{value:function(e){this.editor&&e!==this.internalValue&&(this.editor.commands.setContent(e,!1),this.internalValue=e)},editable:function(e){this.editor&&this.editor.setEditable(e)},currentContent:{handler:function(e){this.autoSave&&e!==this.value&&this.scheduleAutoSave()},immediate:!1}},mounted:function(){var e=this;console.log("๐ BBL Editor (Options API): Component mounted, starting initialization..."),this.initializationTimeout=setTimeout((function(){e.isEditorReady||e.editorError||(console.error("โฐ BBL Editor (Options API): Initialization timeout - editor stuck in loading state"),e.editorError="Editor initialization timeout - check console for details",e.$emit("error",{type:"initialization-timeout",message:"Editor failed to initialize within 10 seconds",dependencies:e.missingDependencies}))}),1e4),this.initializeEditor()},beforeDestroy:function(){console.log("๐งน BBL Editor (Options API): Component unmounting..."),this.initializationTimeout&&clearTimeout(this.initializationTimeout),this.sourceCodeUpdateTimeout&&clearTimeout(this.sourceCodeUpdateTimeout),this.autoSaveTimeout&&clearTimeout(this.autoSaveTimeout),this.editor&&this.editor.destroy()},methods:{checkDependencies:function(){var e=[];try{console.log("๐ BBL Editor (Options API): Starting dependency check...");try{s["Editor"]&&"function"===typeof s["Editor"]?console.log("โ
Tiptap: Editor class available"):(e.push("@tiptap/vue-2 (Editor)"),console.error("โ Missing: @tiptap/vue-2 - Editor class not available"))}catch(n){e.push("@tiptap/vue-2 (Editor)"),console.error("โ Error accessing Editor:",n.message)}try{c.a&&"function"===typeof c.a.configure?console.log("โ
Tiptap: StarterKit available"):(e.push("@tiptap/starter-kit"),console.error("โ Missing: @tiptap/starter-kit"))}catch(n){e.push("@tiptap/starter-kit"),console.error("โ Error accessing StarterKit:",n.message)}var t=[{name:"TextAlign",module:p.a,package:"@tiptap/extension-text-align"},{name:"Underline",module:h.a,package:"@tiptap/extension-underline"},{name:"TextStyle",module:m.a,package:"@tiptap/extension-text-style"},{name:"Color",module:b.a,package:"@tiptap/extension-color"},{name:"Highlight",module:w.a,package:"@tiptap/extension-highlight"},{name:"Link",module:x.a,package:"@tiptap/extension-link"},{name:"FontFamily",module:S.a,package:"@tiptap/extension-font-family"},{name:"Extension",module:O["Extension"],package:"@tiptap/core (Extension)"},{name:"CodeBlock",module:cn,package:"@tiptap/extension-code-block"},{name:"Code",module:pn.a,package:"@tiptap/extension-code"},{name:"Table",module:mn.a,package:"@tiptap/extension-table"},{name:"TableRow",module:bn.a,package:"@tiptap/extension-table-row"},{name:"TaskList",module:Dn.a,package:"@tiptap/extension-task-list"},{name:"TaskItem",module:Rn.a,package:"@tiptap/extension-task-item"},{name:"Placeholder",module:Un.a,package:"@tiptap/extension-placeholder"}];t.forEach((function(t){var i=t.name,r=t.module,o=t.package;try{r?console.log("โ
Extension: ".concat(i," available")):(e.push(o),console.error("โ Missing: ".concat(o," (").concat(i,")")))}catch(n){e.push(o),console.error("โ Error accessing ".concat(i,":"),n.message)}}))}catch(i){console.error("โ Critical error during dependency check:",i),e.push("Critical dependency check error: "+i.message)}return console.log("๐ BBL Editor (Options API): Dependency check complete. Missing: ".concat(e.length)),e.length>0?console.error("โ Missing dependencies:",e):console.log("โ
All dependencies available!"),this.missingDependencies=e,0===e.length},initializeEditor:function(){var e=this;try{if(console.log("๐ BBL Editor (Options API): Starting editor initialization..."),!this.checkDependencies())return console.error("โ BBL Editor (Options API): Dependency check failed"),this.editorError="Missing required dependencies",void this.$emit("error",{type:"missing-dependencies",dependencies:this.missingDependencies,message:"Please install all required dependencies"});console.log("โ
BBL Editor (Options API): All dependencies available, creating editor...");var t=this.toolbarConfig||{bold:!0,italic:!0,underline:!0,strike:!0,code:!0,textColor:!0,highlight:!0,fontFamily:!0,fontSize:!0,textAlign:!0,lineHeight:!0,headings:!0,lists:!0,blockquote:!0,codeBlock:!0,horizontalRule:!0,link:!0,image:!0,video:!0,table:!0,clearFormatting:!0,sourceCode:!0,undo:!0,redo:!0},n=this.extensionConfig||{image:{allowResize:!0,allowAlignment:!0,allowDelete:!0,maxWidth:"100%",quality:.8},video:{allowResize:!0,allowAlignment:!0,allowDelete:!0,maxWidth:"100%",autoplay:!1},table:{resizable:!0,allowRowControls:!0,allowColumnControls:!0,cellSelection:!0},link:{openOnClick:!1,autolink:!0,linkOnPaste:!0},textAlign:{types:["heading","paragraph"]}},i=[c.a.configure({image:!1,youtube:!1,table:!1,codeBlock:!1,code:!1}),Kc,Qc,m.a,Un.a.configure({placeholder:this.placeholder||"Start writing..."})];n.textAlign&&i.push(p.a.configure(n.textAlign)),t.underline&&i.push(h.a),t.textColor&&i.push(b.a.configure({types:[m.a.name]})),t.highlight&&i.push(w.a.configure({multicolor:!0})),t.fontFamily&&i.push(S.a.configure({types:[m.a.name]})),t.fontSize&&i.push(Yc),t.lineHeight&&i.push(Xc),t.link&&i.push(x.a.configure(Jc(Jc({},n.link),{},{HTMLAttributes:{class:"editor-link"}}))),t.image&&i.push(ri.configure(n.image)),t.video&&i.push(wi.configure(n.video)),t.table&&i.push(mn.a.configure(n.table),bn.a,En,In),t.lists&&i.push(Dn.a,Rn.a.configure({nested:!0})),console.log("๐ง BBL Editor (Options API): Total extensions: ".concat(i.length)),console.log("๐ BBL Editor (Options API): Creating Tiptap Editor instance..."),this.editor=new s["Editor"]({content:this.value||"",editable:!1!==this.editable,autofocus:this.autofocus||!1,extensions:i,onUpdate:function(){var t=e.currentContent;t!==e.internalValue&&(e.internalValue=t,e.$emit("input",t),e.$emit("update",t))},onCreate:function(){console.log("๐ BBL Editor (Options API): Editor created successfully!"),e.initializationTimeout&&(clearTimeout(e.initializationTimeout),e.initializationTimeout=null),e.isEditorReady=!0,e.editorError=null,e.$emit("ready",e.editor),e.$emit("created",e.editor)},onFocus:function(){e.$emit("focus")},onBlur:function(){e.$emit("blur")},onDestroy:function(){console.log("๐๏ธ BBL Editor (Options API): Editor destroyed"),e.$emit("destroyed")}}),console.log("โ
BBL Editor (Options API): Editor instance created, waiting for onCreate...")}catch(r){console.error("โ BBL Editor (Options API): Initialization failed:",r),console.error("โ Error stack:",r.stack),this.editorError=r.message,this.$emit("error",{type:"initialization-failed",error:r.message,stack:r.stack,message:"Failed to initialize editor"})}},scheduleAutoSave:function(){var e=this;this.autoSaveTimeout&&clearTimeout(this.autoSaveTimeout),this.autoSaveTimeout=setTimeout((function(){e.$emit("auto-save",e.currentContent)}),this.autoSaveInterval)},defaultImageUpload:function(e){var t=this;return new Promise((function(n,i){if(t.imageUploadUrl&&!t.useBase64Upload){var r=new FormData;r.append("image",e),fetch(t.imageUploadUrl,{method:"POST",body:r}).then((function(e){return e.json()})).then((function(t){t.url?n({src:t.url,alt:e.name}):i(new Error("Upload failed: No URL returned"))})).catch(i)}else t.convertImageToBase64(e).then((function(e){return n(e)})).catch(i)}))},defaultVideoUpload:function(e){var t=this;return new Promise((function(n,i){if(t.videoUploadUrl&&!t.useBase64Upload){var r=new FormData;r.append("video",e),fetch(t.videoUploadUrl,{method:"POST",body:r}).then((function(e){return e.json()})).then((function(e){e.url?n({src:e.url}):i(new Error("Upload failed: No URL returned"))})).catch(i)}else t.convertVideoToBase64(e).then((function(e){return n(e)})).catch(i)}))},convertImageToBase64:function(e){var t=this;return new Promise((function(n,i){if(!t.enableImageCompression){var r=new FileReader;return r.onload=function(i){n({src:i.target.result,alt:t.preserveOriginalFileName?e.name:"Image",size:e.size,type:e.type,originalName:e.name})},r.onerror=i,void r.readAsDataURL(e)}var o=new Image,a=document.createElement("canvas"),s=a.getContext("2d");o.onload=function(){try{var r=t.calculateImageDimensions(o.width,o.height,t.base64MaxWidth,t.base64MaxHeight),l=r.width,u=r.height;a.width=l,a.height=u,s.drawImage(o,0,0,l,u);var c=a.toDataURL(e.type,t.base64Quality);t.$emit("image-compressed",{originalSize:e.size,compressedSize:t.getBase64Size(c),originalDimensions:{width:o.width,height:o.height},compressedDimensions:{width:l,height:u},compressionRatio:e.size/t.getBase64Size(c)}),n({src:c,alt:t.preserveOriginalFileName?e.name:"Image",width:l,height:u,size:t.getBase64Size(c),originalSize:e.size,type:e.type,originalName:e.name,compressed:!0})}catch(d){i(new Error("Image compression failed: ".concat(d.message)))}},o.onerror=function(){return i(new Error("Failed to load image for compression"))};var l=URL.createObjectURL(e);o.src=l,o.onload=function(e){return function(){return URL.revokeObjectURL(l),e.apply(this,arguments)}}(o.onload)}))},convertVideoToBase64:function(e){var t=this;return new Promise((function(n,i){var r=new FileReader;r.onload=function(i){n({src:i.target.result,size:e.size,type:e.type,originalName:t.preserveOriginalFileName?e.name:"Video",compressed:!1})},r.onerror=i,r.readAsDataURL(e)}))},calculateImageDimensions:function(e,t,n,i){var r=e,o=t,a=n/e,s=i/t,l=Math.min(a,s,1);return l<1&&(r=Math.round(e*l),o=Math.round(t*l)),{width:r,height:o}},getBase64Size:function(e){var t=e.split(",")[1]||e;return Math.round(3*t.length/4)},validateContent:function(e){return!(this.maxContentLength&&e.length>this.maxContentLength)||(this.$emit("content-limit-exceeded",{current:e.length,max:this.maxContentLength}),!1)},formatHTML:function(e){if(!e)return"";var t="",n=0,i=" ",r=["a","abbr","b","bdi","bdo","br","cite","code","data","dfn","em","i","kbd","mark","q","s","samp","small","span","strong","sub","sup","time","u","var"],o=["br","hr","img","input","link","meta"],a=[],s=0;while(s<e.length){var l=e.indexOf("<",s);if(-1===l){var u=e.substring(s).trim();u&&a.push({type:"text",content:u});break}if(l>s){var c=e.substring(s,l).trim();c&&a.push({type:"text",content:c})}var d=e.indexOf(">",l);if(-1===d)break;var p=e.substring(l,d+1),f=p.match(/<\/?(\w+)/)&&p.match(/<\/?(\w+)/)[1]&&p.match(/<\/?(\w+)/)[1].toLowerCase();p.startsWith("</")?a.push({type:"close",content:p,tagName:f,inline:r.includes(f)}):p.endsWith("/>")||o.includes(f)?a.push({type:"self",content:p,tagName:f}):p.startsWith("\x3c!--")?a.push({type:"comment",content:p}):a.push({type:"open",content:p,tagName:f,inline:r.includes(f)}),s=d+1}var h=!1,v="";return a.forEach((function(e,r){var o=a[r+1],s=a[r-1];"open"===e.type?e.inline?(!h&&v&&(t+=i.repeat(n)+v,v=""),v+=e.content,h=!0):(v&&(t+=i.repeat(n)+v+"\n",v=""),t+=i.repeat(n)+e.content+"\n",n++,h=!1):"close"===e.type?e.inline?(v+=e.content,o&&(o.inline||"text"===o.type)||(t+=i.repeat(n)+v+"\n",v="",h=!1)):(n=Math.max(0,n-1),v&&(t+=i.repeat(n+1)+v+"\n",v=""),t+=i.repeat(n)+e.content+"\n",h=!1):"self"===e.type?(v&&(t+=i.repeat(n)+v+"\n",v=""),t+=i.repeat(n)+e.content+"\n",h=!1):"text"===e.type?h||s&&s.inline?v+=e.content:(v&&(t+=i.repeat(n)+v+"\n",v=""),t+=i.repeat(n)+e.content+"\n"):"comment"===e.type&&(v&&(t+=i.repeat(n)+v+"\n",v=""),t+=i.repeat(n)+e.content+"\n")})),v&&(t+=i.repeat(n)+v+"\n"),t.trim()},toggleSourceCode:function(){if(this.editor)if(this.isSourceCodeMode)this.editor.commands.setContent(this.sourceCode),this.isSourceCodeMode=!1;else{var e=this.editor.getHTML();this.sourceCode=this.formatHTML(e),this.isSourceCodeMode=!0}},updateFromSourceCode:function(){var e=this;this.sourceCodeUpdateTimeout&&clearTimeout(this.sourceCodeUpdateTimeout),this.sourceCodeUpdateTimeout=setTimeout((function(){if(e.editor&&e.isSourceCodeMode)try{e.editor.commands.setContent(e.sourceCode)}catch(t){console.warn("Invalid HTML in source code:",t)}}),500)},executeCommand:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.editor)switch(e){case"setTextAlign":this.editor.chain().focus().setTextAlign(t).run();break;case"setColor":this.editor.chain().focus().setColor(t).run();break;case"setHighlight":this.editor.chain().focus().setHighlight(t).run();break;case"setFontFamily":this.editor.chain().focus().setFontFamily(t).run();break;case"setFontSize":this.editor.chain().focus().setFontSize(t).run();break;case"setLineHeight":this.editor.chain().focus().setLineHeight(t).run();break;case"setLink":this.editor.chain().focus().setLink(t).run();break;case"setResizableImage":this.editor.chain().focus().setResizableImage(t).run();break;case"setResizableVideo":this.editor.chain().focus().setResizableVideo(t).run();break;case"insertTable":this.editor.chain().focus().insertTable(t).run();break;case"toggleHeading":this.editor.chain().focus().toggleHeading(t).run();break;case"setParagraph":this.editor.chain().focus().setParagraph().run();break;case"unsetAllMarks":this.editor.chain().focus().unsetAllMarks().run();break;case"clearNodes":this.editor.chain().focus().clearNodes().run();break;default:"function"===typeof this.editor.chain().focus()[e]&&this.editor.chain().focus()[e](t).run()}},isActive:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!!this.editor&&this.editor.isActive(e,t)},getContent:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!this.editor)return"";var n=e||this.outputFormat,i="json"===n?this.editor.getJSON():this.editor.getHTML(),r=null!==t?t:!1!==this.wrapWithContentClass;return"html"===n&&r?'<div class="bbl-html-section">'.concat(i,"</div>"):i},setContent:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.editor&&this.editor.commands.setContent(e,t)},focus:function(){this.editor&&this.editor.commands.focus()},blur:function(){this.editor&&this.editor.commands.blur()},openLinkModal:function(){var e=this.editor.state.selection,t=e.from,n=e.to,i=this.editor.state.doc.textBetween(t,n,""),r=this.editor.getAttributes("link");this.linkModalData={text:i||"",url:r.href||"",target:r.target||""},this.showLinkModal=!0},clearFormatting:function(){this.executeCommand("unsetAllMarks"),this.executeCommand("clearNodes")},insertLink:function(e){var t=e.href,n=e.target,i=e.text;i&&this.editor.state.selection.empty?this.editor.chain().focus().insertContent({type:"text",text:i,marks:[{type:"link",attrs:{href:t,target:n}}]}).run():this.executeCommand("setLink",{href:t,target:n})},removeLink:function(){this.editor.chain().focus().unsetLink().run()},insertImage:function(e){this.executeCommand("setResizableImage",e)},insertVideo:function(e){this.executeCommand("setResizableVideo",e)}}},td=ed,nd=(n("514f"),Fi(td,Uc,Nc,!1,null,"059c96e4",null)),id=nd.exports,rd=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"diagnostic-tool"},[n("h2",[e._v("๐ BBL Editor Diagnostic Tool")]),n("p",[e._v("This tool checks if all required dependencies are properly installed.")]),n("div",{staticClass:"diagnostic-results"},[n("div",{staticClass:"check-section"},[n("h3",[e._v("Vue Composition API")]),n("div",{staticClass:"check-item",class:{success:e.checks.compositionApi,error:!e.checks.compositionApi}},[n("span",{staticClass:"icon"},[e._v(e._s(e.checks.compositionApi?"โ
":"โ"))]),n("span",[e._v("@vue/composition-api")]),e.checks.compositionApi?e._e():n("span",{staticClass:"install-cmd"},[e._v("npm install @vue/composition-api")])])]),n("div",{staticClass:"check-section"},[n("h3",[e._v("Tiptap Core")]),n("div",{staticClass:"check-item",class:{success:e.checks.tiptapCore,error:!e.checks.tiptapCore}},[n("span",{staticClass:"icon"},[e._v(e._s(e.checks.tiptapCore?"โ
":"โ"))]),n("span",[e._v("@tiptap/core & @tiptap/vue-2")]),e.checks.tiptapCore?e._e():n("span",{staticClass:"install-cmd"},[e._v("npm install @tiptap/core @tiptap/vue-2")])])]),n("div",{staticClass:"check-section"},[n("h3",[e._v("Tiptap Extensions")]),e._l(e.checks.extensions,(function(t,i){return n("div",{key:i,staticClass:"check-item",class:{success:t,error:!t}},[n("span",{staticClass:"icon"},[e._v(e._s(t?"โ
":"โ"))]),n("span",[e._v(e._s(i))]),t?e._e():n("span",{staticClass:"install-cmd"},[e._v("npm install "+e._s(i))])])}))],2),n("div",{staticClass:"check-section"},[n("h3",[e._v("ProseMirror Dependencies")]),e._l(e.checks.prosemirror,(function(t,i){return n("div",{key:i,staticClass:"check-item",class:{success:t,error:!t}},[n("span",{staticClass:"icon"},[e._v(e._s(t?"โ
":"โ"))]),n("span",[e._v(e._s(i))]),t?e._e():n("span",{staticClass:"install-cmd"},[e._v("npm install "+e._s(i))])])}))],2)]),n("div",{staticClass:"summary",class:{success:e.allChecksPass,error:!e.allChecksPass}},[n("h3",[e._v(e._s(e.allChecksPass?"๐ All Dependencies Found!":"โ ๏ธ Missing Dependencies"))]),e.allChecksPass?n("p",[e._v(" Your setup is complete! The BBL Editor should work properly. ")]):n("div",[n("p",[e._v("Install missing dependencies with this command:")]),n("div",{staticClass:"install-all"},[n("code",[e._v(e._s(e.installCommand))]),n("button",{staticClass:"copy-btn",on:{click:e.copyToClipboard}},[e._v("๐ Copy")])])])]),e.allChecksPass?n("div",{staticClass:"test-editor"},[n("h3",[e._v("๐งช Test Editor")]),n("PremiumBblEditor",{staticStyle:{"min-height":"150px"},attrs:{placeholder:"If you can see this editor and type here, everything is working!","show-toolbar":!0},model:{value:e.testContent,callback:function(t){e.testContent=t},expression:"testContent"}})],1):e._e()])},od=[];function ad(){
|
|
5
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function o(n,i,r,o){var l=i&&i.prototype instanceof s?i:s,u=Object.create(l.prototype);return sd(u,"_invoke",function(n,i,r){var o,s,l,u=0,c=r||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return o=t,s=0,l=e,p.n=n,a}};function f(n,i){for(s=n,l=i,t=0;!d&&u&&!r&&t<c.length;t++){var r,o=c[t],f=p.p,h=o[2];n>3?(r=h===i)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=f&&((r=n<2&&f<o[1])?(s=0,p.v=i,p.n=o[1]):f<h&&(r=n<3||o[0]>i||i>h)&&(o[4]=n,o[5]=i,p.n=h,s=0))}if(r||n>1)return a;throw d=!0,i}return function(r,c,h){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&f(c,h),s=c,l=h;(t=s<2?e:l)||!d;){o||(s?s<3?(s>1&&(p.n=-1),f(s,l)):p.n=l:p.v=l);try{if(u=2,o){if(s||(r="next"),t=o[r]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+r+"' method"),s=1);o=e}else if((t=(d=p.n<0)?l:n.call(i,p))!==a)break}catch(t){o=e,s=1,l=t}finally{u=1}}return{value:t,done:d}}}(n,r,o),!0),u}var a={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][i]?t(t([][i]())):(sd(t={},i,(function(){return this})),t),d=u.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,sd(e,r,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,sd(d,"constructor",u),sd(u,"constructor",l),l.displayName="GeneratorFunction",sd(u,r,"GeneratorFunction"),sd(d),sd(d,r,"Generator"),sd(d,i,(function(){return this})),sd(d,"toString",(function(){return"[object Generator]"})),(ad=function(){return{w:o,m:p}})()}function sd(e,t,n,i){var r=Object.defineProperty;try{r({},"",{})}catch(e){r=0}sd=function(e,t,n,i){function o(t,n){sd(e,t,(function(e){return this._invoke(t,n,e)}))}t?r?r(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},sd(e,t,n,i)}function ld(e,t,n,i,r,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(i,r)}function ud(e){return function(){var t=this,n=arguments;return new Promise((function(i,r){var o=e.apply(t,n);function a(e){ld(o,i,r,a,s,"next",e)}function s(e){ld(o,i,r,a,s,"throw",e)}a(void 0)}))}}function cd(e,t){return vd(e)||hd(e,t)||pd(e,t)||dd()}function dd(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function pd(e,t){if(e){if("string"==typeof e)return fd(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?fd(e,t):void 0}}function fd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function hd(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,o,a,s=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=o.call(n)).done)&&(s.push(i.value),s.length!==t);l=!0);}catch(e){u=!0,r=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw r}}return s}}function vd(e){if(Array.isArray(e))return e}var md={name:"DiagnosticTool",components:{PremiumBblEditor:$c},data:function(){return{testContent:"<p>Test content - you can edit this!</p>",checks:{compositionApi:!1,tiptapCore:!1,extensions:{},prosemirror:{}}}},computed:{allChecksPass:function(){return this.checks.compositionApi&&this.checks.tiptapCore&&Object.values(this.checks.extensions).every(Boolean)&&Object.values(this.checks.prosemirror).every(Boolean)},installCommand:function(){var e=[];return this.checks.compositionApi||e.push("@vue/composition-api"),this.checks.tiptapCore||e.push("@tiptap/core","@tiptap/vue-2"),Object.entries(this.checks.extensions).forEach((function(t){var n=cd(t,2),i=n[0],r=n[1];r||e.push(i)})),Object.entries(this.checks.prosemirror).forEach((function(t){var n=cd(t,2),i=n[0],r=n[1];r||e.push(i)})),"npm install ".concat(e.join(" "))}},mounted:function(){this.runDiagnostics()},methods:{runDiagnostics:function(){var e=this;try{var t=n("ed09"),i=t.ref;this.checks.compositionApi="function"===typeof i}catch(l){this.checks.compositionApi=!1}try{var r=n("9637"),o=r.Editor;this.checks.tiptapCore=!!o}catch(l){this.checks.tiptapCore=!1}var a=["@tiptap/starter-kit","@tiptap/extension-text-style","@tiptap/extension-color","@tiptap/extension-highlight","@tiptap/extension-underline","@tiptap/extension-text-align","@tiptap/extension-link","@tiptap/extension-font-family","@tiptap/extension-code","@tiptap/extension-code-block","@tiptap/extension-table","@tiptap/extension-table-row","@tiptap/extension-table-cell","@tiptap/extension-table-header","@tiptap/extension-task-list","@tiptap/extension-task-item","@tiptap/extension-placeholder"];a.forEach((function(t){try{n("de6e")(t),e.$set(e.checks.extensions,t,!0)}catch(l){e.$set(e.checks.extensions,t,!1)}}));var s=["prosemirror-state","prosemirror-view","prosemirror-model","prosemirror-commands","prosemirror-keymap","prosemirror-history","prosemirror-transform","prosemirror-tables"];s.forEach((function(t){try{n("de6e")(t),e.$set(e.checks.prosemirror,t,!0)}catch(l){e.$set(e.checks.prosemirror,t,!1)}}))},copyToClipboard:function(){var e=this;return ud(ad().m((function t(){var n;return ad().w((function(t){while(1)switch(t.p=t.n){case 0:return t.p=0,t.n=1,navigator.clipboard.writeText(e.installCommand);case 1:alert("Command copied to clipboard!"),t.n=3;break;case 2:t.p=2,t.v,n=document.createElement("textarea"),n.value=e.installCommand,document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n),alert("Command copied to clipboard!");case 3:return t.a(2)}}),t,null,[[0,2]])})))()}}},gd=md,bd=(n("b74c"),Fi(gd,rd,od,!1,null,"c5e76f00",null)),yd=bd.exports,wd=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("PremiumBblEditor",{attrs:{placeholder:"Start writing..."},model:{value:e.content,callback:function(t){e.content=t},expression:"content"}})],1)},kd=[],xd={data:function(){return{content:""}}},Cd=xd,Sd=Fi(Cd,wd,kd,!1,null,null,null),Od=Sd.exports,_d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.component("PremiumBblEditor",$c),e.component("PremiumBblEditorOptionsAPI",id),e.component("DiagnosticTool",yd),e.component("DebugHelper",Od),t.registerAllComponents&&(e.component("ToolbarMain",Su),e.component("ToolbarGroup",$i),e.component("ToolbarButton",Wi),e.component("EditorBubbleMenu",Au),e.component("TableBubbleMenu",Gu),e.component("ImageBubbleMenu",ec),e.component("VideoBubbleMenu",ac),e.component("ImageModal",kc),e.component("VideoModal",Lc),e.component("LinkModal",Hc))};"undefined"!==typeof window&&window.Vue&&_d(window.Vue);var Ed={install:_d,PremiumBblEditor:$c,PremiumBblEditorOptionsAPI:id,DiagnosticTool:yd,DebugHelper:Od};t["default"]=Ed},fba0:function(e,t,n){"use strict";n("c884")},fd09:function(e,t,n){"use strict";n("5516")}})}));
|
|
6
|
+
//# sourceMappingURL=vue2-bbl-editor.umd.min.js.map
|