55 lines
253 KiB
JavaScript
55 lines
253 KiB
JavaScript
import{g as fr,u as cr}from"./const-aa4e7587.js";import{ai as Nt,aj as Xn,d as Qn,i as Jn,H as hr,r as Ve,h as Mn,n as $n,ak as dr,o as vr,c as pr,b as Ht,w as ce,L as Ot,e as yr,a0 as gr}from"./index-a8433551.js";import{I as mr,T as Gn}from"./index-ab4bfd10.js";import{B as br}from"./index-cd5dab0a.js";import{_ as ze,F as _r}from"./index-9790e4ab.js";import"./SearchOutlined-14c653fb.js";import"./styleChecker-4074517c.js";import"./debounce-12f80d64.js";import"./raf-ca407421.js";import"./EyeOutlined-a79acaa2.js";import"./Col-6a6e9347.js";var tr={exports:{}};/*!
|
|||
|
|
* Quill Editor v1.3.7
|
||
|
|
* https://quilljs.com/
|
||
|
|
* Copyright (c) 2014, Jason Chen
|
||
|
|
* Copyright (c) 2013, salesforce.com
|
||
|
|
*/(function(R,U){(function(p,f){R.exports=f()})(typeof self<"u"?self:Nt,function(){return function(m){var p={};function f(E){if(p[E])return p[E].exports;var b=p[E]={i:E,l:!1,exports:{}};return m[E].call(b.exports,b,b.exports,f),b.l=!0,b.exports}return f.m=m,f.c=p,f.d=function(E,b,_){f.o(E,b)||Object.defineProperty(E,b,{configurable:!1,enumerable:!0,get:_})},f.n=function(E){var b=E&&E.__esModule?function(){return E.default}:function(){return E};return f.d(b,"a",b),b},f.o=function(E,b){return Object.prototype.hasOwnProperty.call(E,b)},f.p="",f(f.s=109)}([function(m,p,f){Object.defineProperty(p,"__esModule",{value:!0});var E=f(17),b=f(18),_=f(19),y=f(45),g=f(46),h=f(47),o=f(48),t=f(49),e=f(12),s=f(32),l=f(33),u=f(31),r=f(1),i={Scope:r.Scope,create:r.create,find:r.find,query:r.query,register:r.register,Container:E.default,Format:b.default,Leaf:_.default,Embed:o.default,Scroll:y.default,Block:h.default,Inline:g.default,Text:t.default,Attributor:{Attribute:e.default,Class:s.default,Style:l.default,Store:u.default}};p.default=i},function(m,p,f){var E=this&&this.__extends||function(){var u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var c in i)i.hasOwnProperty(c)&&(r[c]=i[c])};return function(r,i){u(r,i);function c(){this.constructor=r}r.prototype=i===null?Object.create(i):(c.prototype=i.prototype,new c)}}();Object.defineProperty(p,"__esModule",{value:!0});var b=function(u){E(r,u);function r(i){var c=this;return i="[Parchment] "+i,c=u.call(this,i)||this,c.message=i,c.name=c.constructor.name,c}return r}(Error);p.ParchmentError=b;var _={},y={},g={},h={};p.DATA_KEY="__blot";var o;(function(u){u[u.TYPE=3]="TYPE",u[u.LEVEL=12]="LEVEL",u[u.ATTRIBUTE=13]="ATTRIBUTE",u[u.BLOT=14]="BLOT",u[u.INLINE=7]="INLINE",u[u.BLOCK=11]="BLOCK",u[u.BLOCK_BLOT=10]="BLOCK_BLOT",u[u.INLINE_BLOT=6]="INLINE_BLOT",u[u.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",u[u.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",u[u.ANY=15]="ANY"})(o=p.Scope||(p.Scope={}));function t(u,r){var i=s(u);if(i==null)throw new b("Unable to create "+u+" blot");var c=i,n=u instanceof Node||u.nodeType===Node.TEXT_NODE?u:c.create(r);return new c(n,r)}p.create=t;function e(u,r){return r===void 0&&(r=!1),u==null?null:u[p.DATA_KEY]!=null?u[p.DATA_KEY].blot:r?e(u.parentNode,r):null}p.find=e;function s(u,r){r===void 0&&(r=o.ANY);var i;if(typeof u=="string")i=h[u]||_[u];else if(u instanceof Text||u.nodeType===Node.TEXT_NODE)i=h.text;else if(typeof u=="number")u&o.LEVEL&o.BLOCK?i=h.block:u&o.LEVEL&o.INLINE&&(i=h.inline);else if(u instanceof HTMLElement){var c=(u.getAttribute("class")||"").split(/\s+/);for(var n in c)if(i=y[c[n]],i)break;i=i||g[u.tagName]}return i==null?null:r&o.LEVEL&i.scope&&r&o.TYPE&i.scope?i:null}p.query=s;function l(){for(var u=[],r=0;r<arguments.length;r++)u[r]=arguments[r];if(u.length>1)return u.map(function(n){return l(n)});var i=u[0];if(typeof i.blotName!="string"&&typeof i.attrName!="string")throw new b("Invalid definition");if(i.blotName==="abstract")throw new b("Cannot register abstract class");if(h[i.blotName||i.attrName]=i,typeof i.keyName=="string")_[i.keyName]=i;else if(i.className!=null&&(y[i.className]=i),i.tagName!=null){Array.isArray(i.tagName)?i.tagName=i.tagName.map(function(n){return n.toUpperCase()}):i.tagName=i.tagName.toUpperCase();var c=Array.isArray(i.tagName)?i.tagName:[i.tagName];c.forEach(function(n){(g[n]==null||i.className==null)&&(g[n]=i)})}return i}p.register=l},function(m,p,f){var E=f(51),b=f(11),_=f(3),y=f(20),g=String.fromCharCode(0),h=function(o){Array.isArray(o)?this.ops=o:o!=null&&Array.isArray(o.ops)?this.ops=o.ops:this.ops=[]};h.prototype.insert=function(o,t){var e={};return o.length===0?this:(e.insert=o,t!=null&&typeof t=="object"&&Object.keys(t).length>0&&(e.attributes=t),this.push(e))},h.prototype.delete=function(o){return o<=0?this:this.push({delete:o})},h.prototype.retain=function(o,t){if(o<=0)return this;var e={retain:o};return t!=null&&typeof t=="object"&&Object.keys(t).length>0&&(e.attributes=t),this.push(e)},h.prototype.push=function(o){var t=this.ops.length,e=this.ops[t-1];if(o=
|
||
|
|
`;for(var e=y.iterator(this.ops),s=new h,l=0;e.hasNext();){if(e.peekType()!=="insert")return;var u=e.peek(),r=y.length(u)-e.peekLength(),i=typeof u.insert=="string"?u.insert.indexOf(t,r)-r:-1;if(i<0)s.push(e.next());else if(i>0)s.push(e.next(i));else{if(o(s,e.next(1).attributes||{},l)===!1)return;l+=1,s=new h}}s.length()>0&&o(s,{},l)},h.prototype.transform=function(o,t){if(t=!!t,typeof o=="number")return this.transformPosition(o,t);for(var e=y.iterator(this.ops),s=y.iterator(o.ops),l=new h;e.hasNext()||s.hasNext();)if(e.peekType()==="insert"&&(t||s.peekType()!=="insert"))l.retain(y.length(e.next()));else if(s.peekType()==="insert")l.push(s.next());else{var u=Math.min(e.peekLength(),s.peekLength()),r=e.next(u),i=s.next(u);if(r.delete)continue;i.delete?l.push(i):l.retain(u,y.attributes.transform(r.attributes,i.attributes,t))}return l.chop()},h.prototype.transformPosition=function(o,t){t=!!t;for(var e=y.iterator(this.ops),s=0;e.hasNext()&&s<=o;){var l=e.peekLength(),u=e.peekType();if(e.next(),u==="delete"){o-=Math.min(l,o-s);continue}else u==="insert"&&(s<o||!t)&&(o+=l);s+=l}return o},m.exports=h},function(m,p){var f=Object.prototype.hasOwnProperty,E=Object.prototype.toString,b=Object.defineProperty,_=Object.getOwnPropertyDescriptor,y=function(e){return typeof Array.isArray=="function"?Array.isArray(e):E.call(e)==="[object Array]"},g=function(e){if(!e||E.call(e)!=="[object Object]")return!1;var s=f.call(e,"constructor"),l=e.constructor&&e.constructor.prototype&&f.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!s&&!l)return!1;var u;for(u in e);return typeof u>"u"||f.call(e,u)},h=function(e,s){b&&s.name==="__proto__"?b(e,s.name,{enumerable:!0,configurable:!0,value:s.newValue,writable:!0}):e[s.name]=s.newValue},o=function(e,s){if(s==="__proto__")if(f.call(e,s)){if(_)return _(e,s).value}else return;return e[s]};m.exports=function t(){var e,s,l,u,r,i,c=arguments[0],n=1,d=arguments.length,N=!1;for(typeof c=="boolean"&&(N=c,c=arguments[1]||{},n=2),(c==null||typeof c!="object"&&typeof c!="function")&&(c={});n<d;++n)if(e=arguments[n],e!=null)for(s in e)l=o(c,s),u=o(e,s),c!==u&&(N&&u&&(g(u)||(r=y(u)))?(r?(r=!1,i=l&&y(l)?l:[]):i=l&&g(l)?l:{},h(c,{name:s,newValue:t(N,i,u)})):typeof u<"u"&&h(c,{name:s,newValue:u}));return c}},function(m,p,f){Object.defineProperty(p,"__esModule",{value:!0}),p.default=p.BlockEmbed=p.bubbleFormats=void 0;var E=function(){function v(O,k){for(var L=0;L<k.length;L++){var D=k[L];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(O,D.key,D)}}return function(O,k,L){return k&&v(O.prototype,k),L&&v(O,L),O}}(),b=function v(O,k,L){O===null&&(O=Function.prototype);var D=Object.getOwnPropertyDescriptor(O,k);if(D===void 0){var z=Object.getPrototypeOf(O);return z===null?void 0:v(z,k,L)}else{if("value"in D)return D.value;var $=D.get;return $===void 0?void 0:$.call(L)}},_=f(3),y=c(_),g=f(2),h=c(g),o=f(0),t=c(o),e=f(16),s=c(e),l=f(6),u=c(l),r=f(7),i=c(r);function c(v){return v&&v.__esModule?v:{default:v}}function n(v,O){if(!(v instanceof O))throw new TypeError("Cannot call a class as a function")}function d(v,O){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O&&(typeof O=="object"||typeof O=="function")?O:v}function N(v,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof O);v.prototype=Object.create(O&&O.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),O&&(Object.setPrototypeOf?Object.setPrototypeOf(v,O):v.__proto__=O)}var w=1,T=function(v){N(O,v);function O(){return n(this,O),d(this,(O.__proto__||Object.getPrototypeOf(O)).apply(this,arguments))}return E(O,[{key:"attach",value:function(){b(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"attach",this).call(this),this.attributes=new t.default.Attributor.Store(this.domNode)}},{key:"delta",value:function(){return new h.default().insert(this.value(),(0,y.default)(this.formats(),this.attributes.values()))}},{key:"format",value:function(L,D){var z=t.defaul
|
||
|
|
`)){var $=t.default.create(P.blotName);this.parent.insertBefore($,L===0?this:this.next),$.insertAt(0,D.slice(0,-1))}else b(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"insertAt",this).call(this,L,D,z)}}]),O}(t.default.Embed);T.scope=t.default.Scope.BLOCK_BLOT;var P=function(v){N(O,v);function O(k){n(this,O);var L=d(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,k));return L.cache={},L}return E(O,[{key:"delta",value:function(){return this.cache.delta==null&&(this.cache.delta=this.descendants(t.default.Leaf).reduce(function(L,D){return D.length()===0?L:L.insert(D.value(),A(D))},new h.default).insert(`
|
||
|
|
`,A(this))),this.cache.delta}},{key:"deleteAt",value:function(L,D){b(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"deleteAt",this).call(this,L,D),this.cache={}}},{key:"formatAt",value:function(L,D,z,$){D<=0||(t.default.query(z,t.default.Scope.BLOCK)?L+D===this.length()&&this.format(z,$):b(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"formatAt",this).call(this,L,Math.min(D,this.length()-L-1),z,$),this.cache={})}},{key:"insertAt",value:function(L,D,z){if(z!=null)return b(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"insertAt",this).call(this,L,D,z);if(D.length!==0){var $=D.split(`
|
||
|
|
`),J=$.shift();J.length>0&&(L<this.length()-1||this.children.tail==null?b(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"insertAt",this).call(this,Math.min(L,this.length()-1),J):this.children.tail.insertAt(this.children.tail.length(),J),this.cache={});var H=this;$.reduce(function(j,S){return H=H.split(j,!0),H.insertAt(0,S),S.length},L+J.length)}}},{key:"insertBefore",value:function(L,D){var z=this.children.head;b(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"insertBefore",this).call(this,L,D),z instanceof s.default&&z.remove(),this.cache={}}},{key:"length",value:function(){return this.cache.length==null&&(this.cache.length=b(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"length",this).call(this)+w),this.cache.length}},{key:"moveChildren",value:function(L,D){b(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"moveChildren",this).call(this,L,D),this.cache={}}},{key:"optimize",value:function(L){b(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"optimize",this).call(this,L),this.cache={}}},{key:"path",value:function(L){return b(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"path",this).call(this,L,!0)}},{key:"removeChild",value:function(L){b(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"removeChild",this).call(this,L),this.cache={}}},{key:"split",value:function(L){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(D&&(L===0||L>=this.length()-w)){var z=this.clone();return L===0?(this.parent.insertBefore(z,this),this):(this.parent.insertBefore(z,this.next),z)}else{var $=b(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"split",this).call(this,L,D);return this.cache={},$}}}]),O}(t.default.Block);P.blotName="block",P.tagName="P",P.defaultChild="break",P.allowedChildren=[u.default,t.default.Embed,i.default];function A(v){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return v==null||(typeof v.formats=="function"&&(O=(0,y.default)(O,v.formats())),v.parent==null||v.parent.blotName=="scroll"||v.parent.statics.scope!==v.statics.scope)?O:A(v.parent,O)}p.bubbleFormats=A,p.BlockEmbed=T,p.default=P},function(m,p,f){Object.defineProperty(p,"__esModule",{value:!0}),p.default=p.overload=p.expandConfig=void 0;var E=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(H){return typeof H}:function(H){return H&&typeof Symbol=="function"&&H.constructor===Symbol&&H!==Symbol.prototype?"symbol":typeof H},b=function(){function H(j,S){var I=[],M=!0,K=!1,C=void 0;try{for(var q=j[Symbol.iterator](),F;!(M=(F=q.next()).done)&&(I.push(F.value),!(S&&I.length===S));M=!0);}catch(G){K=!0,C=G}finally{try{!M&&q.return&&q.return()}finally{if(K)throw C}}return I}return function(j,S){if(Array.isArray(j))return j;if(Symbol.iterator in Object(j))return H(j,S);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),_=function(){function H(j,S){for(var I=0;I<S.length;I++){var M=S[I];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(j,M.key,M)}}return function(j,S,I){return S&&H(j.prototype,S),I&&H(j,I),j}}();f(50);var y=f(2),g=A(y),h=f(14),o=A(h),t=f(8),e=A(t),s=f(9),l=A(s),u=f(0),r=A(u),i=f(15),c=A(i),n=f(3),d=A(n),N=f(10),w=A(N),T=f(34),P=A(T);function A(H){return H&&H.__esModule?H:{default:H}}function v(H,j,S){return j in H?Object.defineProperty(H,j,{value:S,enumerable:!0,configurable:!0,writable:!0}):H[j]=S,H}function O(H,j){if(!(H instanceof j))throw new TypeError("Cannot call a class as a function")}var k=(0,w.default)("quill"),L=function(){_(H,null,[{key:"debug",value:function(S){S===!0&&(S="log"),w.default.level(S)}},{key:"find",value:function(S){return S.__quill||r.default.find(S)}},{key:"import",value:function(S){return this.imports[S]==null&&k.error("Cannot import "+S+". Are you sure it was registered?"),this.imports[S]}},{key:"register",value:function(S,I){var M=this,K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(typeof S!="string"){var C=S.attrName||S.blotName;typeof C=="string"?this.register("formats/"+C,S,I):Object.keys(S).forE
|
||
|
|
`&&(I.editor.deleteText(I.getLength()-1,1),q.delete(1));var G=C.compose(q);return G},M)}},{key:"setSelection",value:function(S,I,M){if(S==null)this.selection.setRange(null,I||H.sources.API);else{var K=$(S,I,M),C=b(K,4);S=C[0],I=C[1],M=C[3],this.selection.setRange(new i.Range(S,I),M),M!==e.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(S){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e.default.sources.API,M=new g.default().insert(S);return this.setContents(M,I)}},{key:"update",value:function(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e.default.sources.USER,I=this.scroll.update(S);return this.selection.update(S),I}},{key:"updateContents",value:function(S){var I=this,M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e.default.sources.API;return z.call(this,function(){return S=new g.default(S),I.editor.applyDelta(S,M)},M,!0)}}]),H}();L.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},L.events=e.default.events,L.sources=e.default.sources,L.version="1.3.7",L.imports={delta:g.default,parchment:r.default,"core/module":l.default,"core/theme":P.default};function D(H,j){if(j=(0,d.default)(!0,{container:H,modules:{clipboard:!0,keyboard:!0,history:!0}},j),!j.theme||j.theme===L.DEFAULTS.theme)j.theme=P.default;else if(j.theme=L.import("themes/"+j.theme),j.theme==null)throw new Error("Invalid theme "+j.theme+". Did you register it?");var S=(0,d.default)(!0,{},j.theme.DEFAULTS);[S,j].forEach(function(K){K.modules=K.modules||{},Object.keys(K.modules).forEach(function(C){K.modules[C]===!0&&(K.modules[C]={})})});var I=Object.keys(S.modules).concat(Object.keys(j.modules)),M=I.reduce(function(K,C){var q=L.import("modules/"+C);return q==null?k.error("Cannot load "+C+" module. Are you sure you registered it?"):K[C]=q.DEFAULTS||{},K},{});return j.modules!=null&&j.modules.toolbar&&j.modules.toolbar.constructor!==Object&&(j.modules.toolbar={container:j.modules.toolbar}),j=(0,d.default)(!0,{},L.DEFAULTS,{modules:M},S,j),["bounds","container","scrollingContainer"].forEach(function(K){typeof j[K]=="string"&&(j[K]=document.querySelector(j[K]))}),j.modules=Object.keys(j.modules).reduce(function(K,C){return j.modules[C]&&(K[C]=j.modules[C]),K},{}),j}function z(H,j,S,I){if(this.options.strict&&!this.isEnabled()&&j===e.default.sources.USER)return new g.default;var M=S==null?null:this.getSelection(),K=this.editor.delta,C=H();if(M!=null&&(S===!0&&(S=M.index),I==null?M=J(M,C,j):I!==0&&(M=J(M,S,I,j)),this.setSelection(M,e.default.sources.SILENT)),C.length()>0){var q,F=[e.default.events.TEXT_CHANGE,C,K,j];if((q=this.emitter).emit.apply(q,[e.default.events.EDITOR_CHANGE].concat(F)),j!==e.default.sources.SILENT){var G;(G=this.emitter).emit.apply(G,F)}}return C}function $(H,j,S,I,M){var K={};return typeof H.index=="number"&&typeof H.length=="number"?typeof j!="number"?(M=I,I=S,S=j,j=H.length,H=H.index):(j=H.length,H=H.index):typeof j!="number"&&(M=I,I=S,S=j,j=0),(typeof S>"u"?"undefined":E(S))==="object"?(K=S,M=I):typeof S=="string"&&(I!=null?K[S]=I:M=S),M=M||e.default.sources.API,[H,j,K,M]}function J(H,j,S,I){if(H==null)return null;var M=void 0,K=void 0;if(j instanceof g.default){var C=[H.index,H.index+H.length].map(function(V){return j.transformPosition(V,I!==e.default.sources.USER)}),q=b(C,2);M=q[0],K=q[1]}else{var F=[H.index,H.index+H.length].map(function(V){return V<j||V===j&&I===e.default.sources.USER?V:S>=0?V+S:Math.max(j,V+S)}),G=b(F,2);M=G[0],K=G[1]}return new i.Range(M,K-M)}p.expandConfig=D,p.overload=$,p.default=L},function(m,p,f){Object.defineProperty(p,"__esModule",{value:!0});var E=function(){function u(r,i){for(var c=0;c<i.length;c++){var n=i[c];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}return function(r,i,c){return i&&u(r.prototype,i),c&&u(r,c),r}}(),b=function u(r,i,c){r===null&&(r=Function.prototype);var n=Object.getOwnPropertyDescriptor(r,i);if(n===void 0){var d=Object.getPrototypeOf(r);return d=
|
||
|
|
`)&&(O=O.slice(0,-1)),O.split(`
|
||
|
|
`).reduce(function(k,L){return k.insert(L).insert(`
|
||
|
|
`,v.formats())},new g.default)}},{key:"format",value:function(v,O){if(!(v===this.statics.blotName&&O)){var k=this.descendant(r.default,this.length()-1),L=E(k,1),D=L[0];D!=null&&D.deleteAt(D.length()-1,1),_(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"format",this).call(this,v,O)}}},{key:"formatAt",value:function(v,O,k,L){if(O!==0&&!(o.default.query(k,o.default.Scope.BLOCK)==null||k===this.statics.blotName&&L===this.statics.formats(this.domNode))){var D=this.newlineIndex(v);if(!(D<0||D>=v+O)){var z=this.newlineIndex(v,!0)+1,$=D-z+1,J=this.isolate(z,$),H=J.next;J.format(k,L),H instanceof P&&H.formatAt(0,v-z+O-$,k,L)}}}},{key:"insertAt",value:function(v,O,k){if(k==null){var L=this.descendant(r.default,v),D=E(L,2),z=D[0],$=D[1];z.insertAt($,O)}}},{key:"length",value:function(){var v=this.domNode.textContent.length;return this.domNode.textContent.endsWith(`
|
||
|
|
`)?v:v+1}},{key:"newlineIndex",value:function(v){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(O)return this.domNode.textContent.slice(0,v).lastIndexOf(`
|
||
|
|
`);var k=this.domNode.textContent.slice(v).indexOf(`
|
||
|
|
`);return k>-1?v+k:-1}},{key:"optimize",value:function(v){this.domNode.textContent.endsWith(`
|
||
|
|
`)||this.appendChild(o.default.create("text",`
|
||
|
|
`)),_(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"optimize",this).call(this,v);var O=this.next;O!=null&&O.prev===this&&O.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===O.statics.formats(O.domNode)&&(O.optimize(v),O.moveChildren(this),O.remove())}},{key:"replace",value:function(v){_(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"replace",this).call(this,v),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(O){var k=o.default.find(O);k==null?O.parentNode.removeChild(O):k instanceof o.default.Embed?k.remove():k.unwrap()})}}],[{key:"create",value:function(v){var O=_(P.__proto__||Object.getPrototypeOf(P),"create",this).call(this,v);return O.setAttribute("spellcheck",!1),O}},{key:"formats",value:function(){return!0}}]),P}(e.default);w.blotName="code-block",w.tagName="PRE",w.TAB=" ",p.Code=N,p.default=w},function(m,p,f){Object.defineProperty(p,"__esModule",{value:!0});var E=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(H){return typeof H}:function(H){return H&&typeof Symbol=="function"&&H.constructor===Symbol&&H!==Symbol.prototype?"symbol":typeof H},b=function(){function H(j,S){var I=[],M=!0,K=!1,C=void 0;try{for(var q=j[Symbol.iterator](),F;!(M=(F=q.next()).done)&&(I.push(F.value),!(S&&I.length===S));M=!0);}catch(G){K=!0,C=G}finally{try{!M&&q.return&&q.return()}finally{if(K)throw C}}return I}return function(j,S){if(Array.isArray(j))return j;if(Symbol.iterator in Object(j))return H(j,S);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),_=function(){function H(j,S){for(var I=0;I<S.length;I++){var M=S[I];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(j,M.key,M)}}return function(j,S,I){return S&&H(j.prototype,S),I&&H(j,I),j}}(),y=f(2),g=O(y),h=f(20),o=O(h),t=f(0),e=O(t),s=f(13),l=O(s),u=f(24),r=O(u),i=f(4),c=O(i),n=f(16),d=O(n),N=f(21),w=O(N),T=f(11),P=O(T),A=f(3),v=O(A);function O(H){return H&&H.__esModule?H:{default:H}}function k(H,j,S){return j in H?Object.defineProperty(H,j,{value:S,enumerable:!0,configurable:!0,writable:!0}):H[j]=S,H}function L(H,j){if(!(H instanceof j))throw new TypeError("Cannot call a class as a function")}var D=/^[ -~]*$/,z=function(){function H(j){L(this,H),this.scroll=j,this.delta=this.getDelta()}return _(H,[{key:"applyDelta",value:function(S){var I=this,M=!1;this.scroll.update();var K=this.scroll.length();return this.scroll.batchStart(),S=J(S),S.reduce(function(C,q){var F=q.retain||q.delete||q.insert.length||1,G=q.attributes||{};if(q.insert!=null){if(typeof q.insert=="string"){var V=q.insert;V.endsWith(`
|
||
|
|
`)&&M&&(M=!1,V=V.slice(0,-1)),C>=K&&!V.endsWith(`
|
||
|
|
`)&&(M=!0),I.scroll.insertAt(C,V);var X=I.scroll.line(C),nt=b(X,2),it=nt[0],at=nt[1],ft=(0,v.default)({},(0,i.bubbleFormats)(it));if(it instanceof c.default){var ht=it.descendant(e.default.Leaf,at),mt=b(ht,1),gt=mt[0];ft=(0,v.default)(ft,(0,i.bubbleFormats)(gt))}G=o.default.attributes.diff(ft,G)||{}}else if(E(q.insert)==="object"){var W=Object.keys(q.insert)[0];if(W==null)return C;I.scroll.insertAt(C,W,q.insert[W])}K+=F}return Object.keys(G).forEach(function(Y){I.scroll.formatAt(C,F,Y,G[Y])}),C+F},0),S.reduce(function(C,q){return typeof q.delete=="number"?(I.scroll.deleteAt(C,q.delete),C):C+(q.retain||q.insert.length||1)},0),this.scroll.batchEnd(),this.update(S)}},{key:"deleteText",value:function(S,I){return this.scroll.deleteAt(S,I),this.update(new g.default().retain(S).delete(I))}},{key:"formatLine",value:function(S,I){var M=this,K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.scroll.update(),Object.keys(K).forEach(function(C){if(!(M.scroll.whitelist!=null&&!M.scroll.whitelist[C])){var q=M.scroll.lines(S,Math.max(I,1)),F=I;q.forEach(function(G){var V=G.length();if(!(G instanceof l.default))G.format(C,K[C]);else{var X=S-G.offset(M.scroll),nt=G.newlineIndex(X+F)-X+1;G.formatAt(X,nt,C,K[C])}F-=V})}}),this.scroll.optimize(),this.update(new g.default().retain(S).retain(I,(0,w.default)(K)))}},{key:"formatText",value:function(S,I){var M=this,K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Object.keys(K).forEach(function(C){M.scroll.formatAt(S,I,C,K[C])}),this.update(new g.default().retain(S).retain(I,(0,w.default)(K)))}},{key:"getContents",value:function(S,I){return this.delta.slice(S,S+I)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(S,I){return S.concat(I.delta())},new g.default)}},{key:"getFormat",value:function(S){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,M=[],K=[];I===0?this.scroll.path(S).forEach(function(q){var F=b(q,1),G=F[0];G instanceof c.default?M.push(G):G instanceof e.default.Leaf&&K.push(G)}):(M=this.scroll.lines(S,I),K=this.scroll.descendants(e.default.Leaf,S,I));var C=[M,K].map(function(q){if(q.length===0)return{};for(var F=(0,i.bubbleFormats)(q.shift());Object.keys(F).length>0;){var G=q.shift();if(G==null)return F;F=$((0,i.bubbleFormats)(G),F)}return F});return v.default.apply(v.default,C)}},{key:"getText",value:function(S,I){return this.getContents(S,I).filter(function(M){return typeof M.insert=="string"}).map(function(M){return M.insert}).join("")}},{key:"insertEmbed",value:function(S,I,M){return this.scroll.insertAt(S,I,M),this.update(new g.default().retain(S).insert(k({},I,M)))}},{key:"insertText",value:function(S,I){var M=this,K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return I=I.replace(/\r\n/g,`
|
||
|
|
`).replace(/\r/g,`
|
||
|
|
`),this.scroll.insertAt(S,I),Object.keys(K).forEach(function(C){M.scroll.formatAt(S,I.length,C,K[C])}),this.update(new g.default().retain(S).insert(I,(0,w.default)(K)))}},{key:"isBlank",value:function(){if(this.scroll.children.length==0)return!0;if(this.scroll.children.length>1)return!1;var S=this.scroll.children.head;return S.statics.blotName!==c.default.blotName||S.children.length>1?!1:S.children.head instanceof d.default}},{key:"removeFormat",value:function(S,I){var M=this.getText(S,I),K=this.scroll.line(S+I),C=b(K,2),q=C[0],F=C[1],G=0,V=new g.default;q!=null&&(q instanceof l.default?G=q.newlineIndex(F)-F+1:G=q.length()-F,V=q.delta().slice(F,F+G-1).insert(`
|
||
|
|
`));var X=this.getContents(S,I+G),nt=X.diff(new g.default().insert(M).concat(V)),it=new g.default().retain(S).concat(nt);return this.applyDelta(it)}},{key:"update",value:function(S){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],M=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,K=this.delta;if(I.length===1&&I[0].type==="characterData"&&I[0].target.data.match(D)&&e.default.find(I[0].target)){var C=e.default.find(I[0].target),q=(0,i.bubbleFormats)(C),F=C.offset(this.scroll),G=I[0].oldValue.replace(r.default.CONTENTS,""),V=new g.default().insert(G),X=new g.default().insert(C.value()),nt=new g.default().retain(F).concat(V.diff(X,M));S=nt.reduce(function(it,at){return at.insert?it.insert(at.insert,q):it.push(at)},new g.default),this.delta=K.compose(S)}else this.delta=this.getDelta(),(!S||!(0,P.default)(K.compose(S),this.delta))&&(S=K.diff(this.delta,M));return S}}]),H}();function $(H,j){return Object.keys(j).reduce(function(S,I){return H[I]==null||(j[I]===H[I]?S[I]=j[I]:Array.isArray(j[I])?j[I].indexOf(H[I])<0&&(S[I]=j[I].concat([H[I]])):S[I]=[j[I],H[I]]),S},{})}function J(H){return H.reduce(function(j,S){if(S.insert===1){var I=(0,w.default)(S.attributes);return delete I.image,j.insert({image:S.attributes.image},I)}if(S.attributes!=null&&(S.attributes.list===!0||S.attributes.bullet===!0)&&(S=(0,w.default)(S),S.attributes.list?S.attributes.list="ordered":(S.attributes.list="bullet",delete S.attributes.bullet)),typeof S.insert=="string"){var M=S.insert.replace(/\r\n/g,`
|
||
|
|
`).replace(/\r/g,`
|
||
|
|
`);return j.insert(M,S.attributes)}return j.push(S)},new g.default)}p.default=z},function(m,p,f){Object.defineProperty(p,"__esModule",{value:!0}),p.default=p.Range=void 0;var E=function(){function T(P,A){var v=[],O=!0,k=!1,L=void 0;try{for(var D=P[Symbol.iterator](),z;!(O=(z=D.next()).done)&&(v.push(z.value),!(A&&v.length===A));O=!0);}catch($){k=!0,L=$}finally{try{!O&&D.return&&D.return()}finally{if(k)throw L}}return v}return function(P,A){if(Array.isArray(P))return P;if(Symbol.iterator in Object(P))return T(P,A);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),b=function(){function T(P,A){for(var v=0;v<A.length;v++){var O=A[v];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(P,O.key,O)}}return function(P,A,v){return A&&T(P.prototype,A),v&&T(P,v),P}}(),_=f(0),y=r(_),g=f(21),h=r(g),o=f(11),t=r(o),e=f(8),s=r(e),l=f(10),u=r(l);function r(T){return T&&T.__esModule?T:{default:T}}function i(T){if(Array.isArray(T)){for(var P=0,A=Array(T.length);P<T.length;P++)A[P]=T[P];return A}else return Array.from(T)}function c(T,P){if(!(T instanceof P))throw new TypeError("Cannot call a class as a function")}var n=(0,u.default)("quill:selection"),d=function T(P){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;c(this,T),this.index=P,this.length=A},N=function(){function T(P,A){var v=this;c(this,T),this.emitter=A,this.scroll=P,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=y.default.create("cursor",this),this.lastRange=this.savedRange=new d(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){v.mouseDown||setTimeout(v.update.bind(v,s.default.sources.USER),1)}),this.emitter.on(s.default.events.EDITOR_CHANGE,function(O,k){O===s.default.events.TEXT_CHANGE&&k.length()>0&&v.update(s.default.sources.SILENT)}),this.emitter.on(s.default.events.SCROLL_BEFORE_UPDATE,function(){if(v.hasFocus()){var O=v.getNativeRange();O!=null&&O.start.node!==v.cursor.textNode&&v.emitter.once(s.default.events.SCROLL_UPDATE,function(){try{v.setNativeRange(O.start.node,O.start.offset,O.end.node,O.end.offset)}catch{}})}}),this.emitter.on(s.default.events.SCROLL_OPTIMIZE,function(O,k){if(k.range){var L=k.range,D=L.startNode,z=L.startOffset,$=L.endNode,J=L.endOffset;v.setNativeRange(D,z,$,J)}}),this.update(s.default.sources.SILENT)}return b(T,[{key:"handleComposition",value:function(){var A=this;this.root.addEventListener("compositionstart",function(){A.composing=!0}),this.root.addEventListener("compositionend",function(){if(A.composing=!1,A.cursor.parent){var v=A.cursor.restore();if(!v)return;setTimeout(function(){A.setNativeRange(v.startNode,v.startOffset,v.endNode,v.endOffset)},1)}})}},{key:"handleDragging",value:function(){var A=this;this.emitter.listenDOM("mousedown",document.body,function(){A.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){A.mouseDown=!1,A.update(s.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(A,v){if(!(this.scroll.whitelist!=null&&!this.scroll.whitelist[A])){this.scroll.update();var O=this.getNativeRange();if(!(O==null||!O.native.collapsed||y.default.query(A,y.default.Scope.BLOCK))){if(O.start.node!==this.cursor.textNode){var k=y.default.find(O.start.node,!1);if(k==null)return;if(k instanceof y.default.Leaf){var L=k.split(O.start.offset);k.parent.insertBefore(this.cursor,L)}else k.insertBefore(this.cursor,O.start.node);this.cursor.attach()}this.cursor.format(A,v),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(A){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,O=this.scroll.length();A=Math.min(A,O-1),v=Math.min(A+v,O-1)-A;var k=void 0,L=this.scroll.leaf(A),D=E(L,2),z=D[0],$=D[1];if(z==null)return null;var J=z.position($,!0),H=E(J,2);k=H[0],$=H[1];var j=document.createRange();if(v>0){j.setStart(k,$);var S=this.scroll.leaf(A+
|
||
|
|
`)&&(L=L.slice(0,-1)),z.insertAt(0,L,D)}else{var $=g.default.create(L,D);this.appendChild($)}else _(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"insertAt",this).call(this,k,L,D);this.optimize()}}},{key:"insertBefore",value:function(k,L){if(k.statics.scope===g.default.Scope.INLINE_BLOT){var D=g.default.create(this.statics.defaultChild);D.appendChild(k),k=D}_(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"insertBefore",this).call(this,k,L)}},{key:"leaf",value:function(k){return this.path(k).pop()||[null,-1]}},{key:"line",value:function(k){return k===this.length()?this.line(k-1):this.descendant(T,k)}},{key:"lines",value:function(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE,D=function z($,J,H){var j=[],S=H;return $.children.forEachAt(J,H,function(I,M,K){T(I)?j.push(I):I instanceof g.default.Container&&(j=j.concat(z(I,M,S))),S-=K}),j};return D(this,k,L)}},{key:"optimize",value:function(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch!==!0&&(_(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"optimize",this).call(this,k,L),k.length>0&&this.emitter.emit(o.default.events.SCROLL_OPTIMIZE,k,L))}},{key:"path",value:function(k){return _(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"path",this).call(this,k).slice(1)}},{key:"update",value:function(k){if(this.batch!==!0){var L=o.default.sources.USER;typeof k=="string"&&(L=k),Array.isArray(k)||(k=this.observer.takeRecords()),k.length>0&&this.emitter.emit(o.default.events.SCROLL_BEFORE_UPDATE,L,k),_(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"update",this).call(this,k.concat([])),k.length>0&&this.emitter.emit(o.default.events.SCROLL_UPDATE,L,k)}}}]),v}(g.default.Scroll);P.blotName="scroll",P.className="ql-editor",P.tagName="DIV",P.defaultChild="block",P.allowedChildren=[e.default,t.BlockEmbed,c.default],p.default=P},function(m,p,f){Object.defineProperty(p,"__esModule",{value:!0}),p.SHORTKEY=p.default=void 0;var E=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(q){return typeof q}:function(q){return q&&typeof Symbol=="function"&&q.constructor===Symbol&&q!==Symbol.prototype?"symbol":typeof q},b=function(){function q(F,G){var V=[],X=!0,nt=!1,it=void 0;try{for(var at=F[Symbol.iterator](),ft;!(X=(ft=at.next()).done)&&(V.push(ft.value),!(G&&V.length===G));X=!0);}catch(ht){nt=!0,it=ht}finally{try{!X&&at.return&&at.return()}finally{if(nt)throw it}}return V}return function(F,G){if(Array.isArray(F))return F;if(Symbol.iterator in Object(F))return q(F,G);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),_=function(){function q(F,G){for(var V=0;V<G.length;V++){var X=G[V];X.enumerable=X.enumerable||!1,X.configurable=!0,"value"in X&&(X.writable=!0),Object.defineProperty(F,X.key,X)}}return function(F,G,V){return G&&q(F.prototype,G),V&&q(F,V),F}}(),y=f(21),g=A(y),h=f(11),o=A(h),t=f(3),e=A(t),s=f(2),l=A(s),u=f(20),r=A(u),i=f(0),c=A(i),n=f(5),d=A(n),N=f(10),w=A(N),T=f(9),P=A(T);function A(q){return q&&q.__esModule?q:{default:q}}function v(q,F,G){return F in q?Object.defineProperty(q,F,{value:G,enumerable:!0,configurable:!0,writable:!0}):q[F]=G,q}function O(q,F){if(!(q instanceof F))throw new TypeError("Cannot call a class as a function")}function k(q,F){if(!q)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return F&&(typeof F=="object"||typeof F=="function")?F:q}function L(q,F){if(typeof F!="function"&&F!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof F);q.prototype=Object.create(F&&F.prototype,{constructor:{value:q,enumerable:!1,writable:!0,configurable:!0}}),F&&(Object.setPrototypeOf?Object.setPrototypeOf(q,F):q.__proto__=F)}var D=(0,w.default)("quill:keyboard"),z=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",$=function(q){L(F,q),_(F,null,[{key:"match",value:function(V,X){return X=C(X),["altKey","ctrlKey","metaKey","shiftKey"
|
||
|
|
`,it).retain(X.length()-nt-1).retain(1,{list:"unchecked"});this.quill.updateContents(at,d.default.sources.USER),this.quill.setSelection(F.index+1,d.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:$.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(F,G){var V=this.quill.getLine(F.index),X=b(V,2),nt=X[0],it=X[1],at=new l.default().retain(F.index).insert(`
|
||
|
|
`,G.format).retain(nt.length()-it-1).retain(1,{header:null});this.quill.updateContents(at,d.default.sources.USER),this.quill.setSelection(F.index+1,d.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(F,G){var V=G.prefix.length,X=this.quill.getLine(F.index),nt=b(X,2),it=nt[0],at=nt[1];if(at>V)return!0;var ft=void 0;switch(G.prefix.trim()){case"[]":case"[ ]":ft="unchecked";break;case"[x]":ft="checked";break;case"-":case"*":ft="bullet";break;default:ft="ordered"}this.quill.insertText(F.index," ",d.default.sources.USER),this.quill.history.cutoff();var ht=new l.default().retain(F.index-at).delete(V+1).retain(it.length()-2-at).retain(1,{list:ft});this.quill.updateContents(ht,d.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(F.index-V,d.default.sources.SILENT)}},"code exit":{key:$.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(F){var G=this.quill.getLine(F.index),V=b(G,2),X=V[0],nt=V[1],it=new l.default().retain(F.index+X.length()-nt-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(it,d.default.sources.USER)}},"embed left":J($.keys.LEFT,!1),"embed left shift":J($.keys.LEFT,!0),"embed right":J($.keys.RIGHT,!1),"embed right shift":J($.keys.RIGHT,!0)}};function J(q,F){var G,V=q===$.keys.LEFT?"prefix":"suffix";return G={key:q,shiftKey:F,altKey:null},v(G,V,/^$/),v(G,"handler",function(nt){var it=nt.index;q===$.keys.RIGHT&&(it+=nt.length+1);var at=this.quill.getLeaf(it),ft=b(at,1),ht=ft[0];return ht instanceof c.default.Embed?(q===$.keys.LEFT?F?this.quill.setSelection(nt.index-1,nt.length+1,d.default.sources.USER):this.quill.setSelection(nt.index-1,d.default.sources.USER):F?this.quill.setSelection(nt.index,nt.length+1,d.default.sources.USER):this.quill.setSelection(nt.index+nt.length+1,d.default.sources.USER),!1):!0}),G}function H(q,F){if(!(q.index===0||this.quill.getLength()<=1)){var G=this.quill.getLine(q.index),V=b(G,1),X=V[0],nt={};if(F.offset===0){var it=this.quill.getLine(q.index-1),at=b(it,1),ft=at[0];if(ft!=null&&ft.length()>1){var ht=X.formats(),mt=this.quill.getFormat(q.index-1,1);nt=r.default.attributes.diff(ht,mt)||{}}}var gt=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(F.prefix)?2:1;this.quill.deleteText(q.index-gt,gt,d.default.sources.USER),Object.keys(nt).length>0&&this.quill.formatLine(q.index-gt,gt,nt,d.default.sources.USER),this.quill.focus()}}function j(q,F){var G=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(F.suffix)?2:1;if(!(q.index>=this.quill.getLength()-G)){var V={},X=0,nt=this.quill.getLine(q.index),it=b(nt,1),at=it[0];if(F.offset>=at.length()-1){var ft=this.quill.getLine(q.index+1),ht=b(ft,1),mt=ht[0];if(mt){var gt=at.formats(),W=this.quill.getFormat(q.index,1);V=r.default.attributes.diff(gt,W)||{},X=mt.length()}}this.quill.deleteText(q.index,G,d.default.sources.USER),Object.keys(V).length>0&&this.quill.formatLine(q.index+X-1,G,V,d.default.sources.USER)}}function S(q){var F=this.quill.getLines(q),G={};if(F.length>1){var V=F[0].formats(),X=F[F.length-1].formats();G=r.default.attributes.diff(X,V)||{}}this.quill.deleteText(q,d.default.sources.USER),Object.keys(G).length>0&&this.quill.formatLine(q.index,1,G,d.default.sources.USER),this.quill.setSelection(q.index,d.default.sources.SILENT),this.quill.focus()}function I(q,F){var G=this;q.length>0&&this.quill.scroll.deleteAt(q.index,q.length);var V=Object.keys(F.format).reduce(function(X,nt){return c.default.query(nt,c.default.Scope.BLOCK)&&!Array.isArray(F.format[nt])&&(X[nt]=F.format[nt]),X},{});this.quill.insertText(q.index,`
|
||
|
|
`,V,d.default.sources.USER),this.quill.setSelection(q.index+1,d.default.sources.SILENT),this.quill.focus(),Object.keys(F.format).forEach(function(X){V[X]==null&&(Array.isArray(F.format[X])||X!=="link"&&G.quill.format(X,F.format[X],d.default.sources.USER))})}function M(q){return{key:$.keys.TAB,shiftKey:!q,format:{"code-block":!0},handler:function(G){var V=c.default.query("code-block"),X=G.index,nt=G.length,it=this.quill.scroll.descendant(V,X),at=b(it,2),ft=at[0],ht=at[1];if(ft!=null){var mt=this.quill.getIndex(ft),gt=ft.newlineIndex(ht,!0)+1,W=ft.newlineIndex(mt+ht+nt),Y=ft.domNode.textContent.slice(gt,W).split(`
|
||
|
|
`);ht=0,Y.forEach(function(tt,et){q?(ft.insertAt(gt+ht,V.TAB),ht+=V.TAB.length,et===0?X+=V.TAB.length:nt+=V.TAB.length):tt.startsWith(V.TAB)&&(ft.deleteAt(gt+ht,V.TAB.length),ht-=V.TAB.length,et===0?X-=V.TAB.length:nt-=V.TAB.length),ht+=tt.length+1}),this.quill.update(d.default.sources.USER),this.quill.setSelection(X,nt,d.default.sources.SILENT)}}}}function K(q){return{key:q[0].toUpperCase(),shortKey:!0,handler:function(G,V){this.quill.format(q,!V.format[q],d.default.sources.USER)}}}function C(q){if(typeof q=="string"||typeof q=="number")return C({key:q});if((typeof q>"u"?"undefined":E(q))==="object"&&(q=(0,g.default)(q,!1)),typeof q.key=="string")if($.keys[q.key.toUpperCase()]!=null)q.key=$.keys[q.key.toUpperCase()];else if(q.key.length===1)q.key=q.key.toUpperCase().charCodeAt(0);else return null;return q.shortKey&&(q[z]=q.shortKey,delete q.shortKey),q}p.default=$,p.SHORTKEY=z},function(m,p,f){Object.defineProperty(p,"__esModule",{value:!0});var E=function(){function r(i,c){var n=[],d=!0,N=!1,w=void 0;try{for(var T=i[Symbol.iterator](),P;!(d=(P=T.next()).done)&&(n.push(P.value),!(c&&n.length===c));d=!0);}catch(A){N=!0,w=A}finally{try{!d&&T.return&&T.return()}finally{if(N)throw w}}return n}return function(i,c){if(Array.isArray(i))return i;if(Symbol.iterator in Object(i))return r(i,c);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),b=function r(i,c,n){i===null&&(i=Function.prototype);var d=Object.getOwnPropertyDescriptor(i,c);if(d===void 0){var N=Object.getPrototypeOf(i);return N===null?void 0:r(N,c,n)}else{if("value"in d)return d.value;var w=d.get;return w===void 0?void 0:w.call(n)}},_=function(){function r(i,c){for(var n=0;n<c.length;n++){var d=c[n];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(i,d.key,d)}}return function(i,c,n){return c&&r(i.prototype,c),n&&r(i,n),i}}(),y=f(0),g=t(y),h=f(7),o=t(h);function t(r){return r&&r.__esModule?r:{default:r}}function e(r,i){if(!(r instanceof i))throw new TypeError("Cannot call a class as a function")}function s(r,i){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i&&(typeof i=="object"||typeof i=="function")?i:r}function l(r,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof i);r.prototype=Object.create(i&&i.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),i&&(Object.setPrototypeOf?Object.setPrototypeOf(r,i):r.__proto__=i)}var u=function(r){l(i,r),_(i,null,[{key:"value",value:function(){}}]);function i(c,n){e(this,i);var d=s(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,c));return d.selection=n,d.textNode=document.createTextNode(i.CONTENTS),d.domNode.appendChild(d.textNode),d._length=0,d}return _(i,[{key:"detach",value:function(){this.parent!=null&&this.parent.removeChild(this)}},{key:"format",value:function(n,d){if(this._length!==0)return b(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"format",this).call(this,n,d);for(var N=this,w=0;N!=null&&N.statics.scope!==g.default.Scope.BLOCK_BLOT;)w+=N.offset(N.parent),N=N.parent;N!=null&&(this._length=i.CONTENTS.length,N.optimize(),N.formatAt(w,i.CONTENTS.length,n,d),this._length=0)}},{key:"index",value:function(n,d){return n===this.textNode?0:b(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"index",this).call(this,n,d)}},{key:"length",value:function(){return this._length}},{key:"position",value:function(){return[this.textNode,this.textNode.data.length]}},{key:"remove",value:function(){b(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"remove",this).call(this),this.parent=null}},{key:"restore",value:function(){if(!(this.selection.composing||this.parent==null)){var n=this.textNode,d=this.selection.getNativeRange(),N=void 0,w=void 0,T=void 0;if(d!=null&&d.start.node===n&&d.end.node===n){var P=[n,d.start.offset,d.end.offset];N=P[0],w=P[1],T=P[2]}for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNod
|
||
|
|
`):n.attributes!=null?Object.keys(n.attributes).some(function(d){return _.default.query(d,_.default.Scope.BLOCK)!=null}):!1}function i(c){var n=c.reduce(function(N,w){return N+=w.delete||0,N},0),d=c.length()-n;return r(c)&&(d-=1),d}p.default=u,p.getLastChangeIndex=i},function(m,p,f){Object.defineProperty(p,"__esModule",{value:!0}),p.default=p.BaseTooltip=void 0;var E=function(){function I(M,K){for(var C=0;C<K.length;C++){var q=K[C];q.enumerable=q.enumerable||!1,q.configurable=!0,"value"in q&&(q.writable=!0),Object.defineProperty(M,q.key,q)}}return function(M,K,C){return K&&I(M.prototype,K),C&&I(M,C),M}}(),b=function I(M,K,C){M===null&&(M=Function.prototype);var q=Object.getOwnPropertyDescriptor(M,K);if(q===void 0){var F=Object.getPrototypeOf(M);return F===null?void 0:I(F,K,C)}else{if("value"in q)return q.value;var G=q.get;return G===void 0?void 0:G.call(C)}},_=f(3),y=P(_),g=f(2),h=P(g),o=f(8),t=P(o),e=f(23),s=P(e),l=f(34),u=P(l),r=f(59),i=P(r),c=f(60),n=P(c),d=f(28),N=P(d),w=f(61),T=P(w);function P(I){return I&&I.__esModule?I:{default:I}}function A(I,M){if(!(I instanceof M))throw new TypeError("Cannot call a class as a function")}function v(I,M){if(!I)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return M&&(typeof M=="object"||typeof M=="function")?M:I}function O(I,M){if(typeof M!="function"&&M!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof M);I.prototype=Object.create(M&&M.prototype,{constructor:{value:I,enumerable:!1,writable:!0,configurable:!0}}),M&&(Object.setPrototypeOf?Object.setPrototypeOf(I,M):I.__proto__=M)}var k=[!1,"center","right","justify"],L=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],D=[!1,"serif","monospace"],z=["1","2","3",!1],$=["small",!1,"large","huge"],J=function(I){O(M,I);function M(K,C){A(this,M);var q=v(this,(M.__proto__||Object.getPrototypeOf(M)).call(this,K,C)),F=function G(V){if(!document.body.contains(K.root))return document.body.removeEventListener("click",G);q.tooltip!=null&&!q.tooltip.root.contains(V.target)&&document.activeElement!==q.tooltip.textbox&&!q.quill.hasFocus()&&q.tooltip.hide(),q.pickers!=null&&q.pickers.forEach(function(X){X.container.contains(V.target)||X.close()})};return K.emitter.listenDOM("click",document.body,F),q}return E(M,[{key:"addModule",value:function(C){var q=b(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"addModule",this).call(this,C);return C==="toolbar"&&this.extendToolbar(q),q}},{key:"buildButtons",value:function(C,q){C.forEach(function(F){var G=F.getAttribute("class")||"";G.split(/\s+/).forEach(function(V){if(V.startsWith("ql-")&&(V=V.slice(3),q[V]!=null))if(V==="direction")F.innerHTML=q[V][""]+q[V].rtl;else if(typeof q[V]=="string")F.innerHTML=q[V];else{var X=F.value||"";X!=null&&q[V][X]&&(F.innerHTML=q[V][X])}})})}},{key:"buildPickers",value:function(C,q){var F=this;this.pickers=C.map(function(V){if(V.classList.contains("ql-align"))return V.querySelector("option")==null&&S(V,k),new n.default(V,q.align);if(V.classList.contains("ql-background")||V.classList.contains("ql-color")){var X=V.classList.contains("ql-background")?"background":"color";return V.querySelector("option")==null&&S(V,L,X==="background"?"#ffffff":"#000000"),new i.default(V,q[X])}else return V.querySelector("option")==null&&(V.classList.contains("ql-font")?S(V,D):V.classList.contains("ql-header")?S(V,z):V.classList.contains("ql-size")&&S(V,$)),new N.default(V)});var G=function(){F.pickers.forEach(function(X){X.update()})};this.quill.on(t.default.events.EDITOR_CHANGE,G)}}]),M}(u.default);J.DEFAULTS=(0,y.default)(!0,{},u.default.DEFAULTS,{modules:{toolbar:{handlers:{formula:function(){this.quill.theme.tooltip.edit("formula")},image:function(){var M=this,K=this.container.querySelector("input.ql-i
|
||
|
|
`)&&pt.ops[pt.ops.length-1].attributes==null&&(pt=pt.compose(new o.default().retain(pt.length()-1).delete(1))),$.log("convert",this.container.innerHTML,pt),this.container.innerHTML="",pt}},{key:"dangerouslyPasteHTML",value:function(et,Q){var st=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l.default.sources.API;if(typeof et=="string")this.quill.setContents(this.convert(et),Q),this.quill.setSelection(0,l.default.sources.SILENT);else{var ot=this.convert(Q);this.quill.updateContents(new o.default().retain(et).concat(ot),st),this.quill.setSelection(et+ot.length(),l.default.sources.SILENT)}}},{key:"onPaste",value:function(et){var Q=this;if(!(et.defaultPrevented||!this.quill.isEnabled())){var st=this.quill.getSelection(),ot=new o.default().retain(st.index),lt=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(l.default.sources.SILENT),setTimeout(function(){ot=ot.concat(Q.convert()).delete(st.length),Q.quill.updateContents(ot,l.default.sources.USER),Q.quill.setSelection(ot.length()-st.length,l.default.sources.SILENT),Q.quill.scrollingContainer.scrollTop=lt,Q.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var et=this,Q=[],st=[];return this.matchers.forEach(function(ot){var lt=b(ot,2),kt=lt[0],Et=lt[1];switch(kt){case Node.TEXT_NODE:st.push(Et);break;case Node.ELEMENT_NODE:Q.push(Et);break;default:[].forEach.call(et.container.querySelectorAll(kt),function(pt){pt[J]=pt[J]||[],pt[J].push(Et)});break}}),[Q,st]}}]),Y}(c.default);I.DEFAULTS={matchers:[],matchVisual:!0};function M(W,Y,tt){return(typeof Y>"u"?"undefined":E(Y))==="object"?Object.keys(Y).reduce(function(et,Q){return M(et,Q,Y[Q])},W):W.reduce(function(et,Q){return Q.attributes&&Q.attributes[Y]?et.push(Q):et.insert(Q.insert,(0,g.default)({},k({},Y,tt),Q.attributes))},new o.default)}function K(W){if(W.nodeType!==Node.ELEMENT_NODE)return{};var Y="__ql-computed-style";return W[Y]||(W[Y]=window.getComputedStyle(W))}function C(W,Y){for(var tt="",et=W.ops.length-1;et>=0&&tt.length<Y.length;--et){var Q=W.ops[et];if(typeof Q.insert!="string")break;tt=Q.insert+tt}return tt.slice(-1*Y.length)===Y}function q(W){if(W.childNodes.length===0)return!1;var Y=K(W);return["block","list-item"].indexOf(Y.display)>-1}function F(W,Y,tt){return W.nodeType===W.TEXT_NODE?tt.reduce(function(et,Q){return Q(W,et)},new o.default):W.nodeType===W.ELEMENT_NODE?[].reduce.call(W.childNodes||[],function(et,Q){var st=F(Q,Y,tt);return Q.nodeType===W.ELEMENT_NODE&&(st=Y.reduce(function(ot,lt){return lt(Q,ot)},st),st=(Q[J]||[]).reduce(function(ot,lt){return lt(Q,ot)},st)),et.concat(st)},new o.default):new o.default}function G(W,Y,tt){return M(tt,W,!0)}function V(W,Y){var tt=e.default.Attributor.Attribute.keys(W),et=e.default.Attributor.Class.keys(W),Q=e.default.Attributor.Style.keys(W),st={};return tt.concat(et).concat(Q).forEach(function(ot){var lt=e.default.query(ot,e.default.Scope.ATTRIBUTE);lt!=null&&(st[lt.attrName]=lt.value(W),st[lt.attrName])||(lt=j[ot],lt!=null&&(lt.attrName===ot||lt.keyName===ot)&&(st[lt.attrName]=lt.value(W)||void 0),lt=S[ot],lt!=null&&(lt.attrName===ot||lt.keyName===ot)&&(lt=S[ot],st[lt.attrName]=lt.value(W)||void 0))}),Object.keys(st).length>0&&(Y=M(Y,st)),Y}function X(W,Y){var tt=e.default.query(W);if(tt==null)return Y;if(tt.prototype instanceof e.default.Embed){var et={},Q=tt.value(W);Q!=null&&(et[tt.blotName]=Q,Y=new o.default().insert(et,tt.formats(W)))}else typeof tt.formats=="function"&&(Y=M(Y,tt.blotName,tt.formats(W)));return Y}function nt(W,Y){return C(Y,`
|
||
|
|
`)||Y.insert(`
|
||
|
|
`),Y}function it(){return new o.default}function at(W,Y){var tt=e.default.query(W);if(tt==null||tt.blotName!=="list-item"||!C(Y,`
|
||
|
|
`))return Y;for(var et=-1,Q=W.parentNode;!Q.classList.contains("ql-clipboard");)(e.default.query(Q)||{}).blotName==="list"&&(et+=1),Q=Q.parentNode;return et<=0?Y:Y.compose(new o.default().retain(Y.length()-1).retain(1,{indent:et}))}function ft(W,Y){return C(Y,`
|
||
|
|
`)||(q(W)||Y.length()>0&&W.nextSibling&&q(W.nextSibling))&&Y.insert(`
|
||
|
|
`),Y}function ht(W,Y){if(q(W)&&W.nextElementSibling!=null&&!C(Y,`
|
||
|
|
|
||
|
|
`)){var tt=W.offsetHeight+parseFloat(K(W).marginTop)+parseFloat(K(W).marginBottom);W.nextElementSibling.offsetTop>W.offsetTop+tt*1.5&&Y.insert(`
|
||
|
|
`)}return Y}function mt(W,Y){var tt={},et=W.style||{};return et.fontStyle&&K(W).fontStyle==="italic"&&(tt.italic=!0),et.fontWeight&&(K(W).fontWeight.startsWith("bold")||parseInt(K(W).fontWeight)>=700)&&(tt.bold=!0),Object.keys(tt).length>0&&(Y=M(Y,tt)),parseFloat(et.textIndent||0)>0&&(Y=new o.default().insert(" ").concat(Y)),Y}function gt(W,Y){var tt=W.data;if(W.parentNode.tagName==="O:P")return Y.insert(tt.trim());if(tt.trim().length===0&&W.parentNode.classList.contains("ql-clipboard"))return Y;if(!K(W.parentNode).whiteSpace.startsWith("pre")){var et=function(st,ot){return ot=ot.replace(/[^\u00a0]/g,""),ot.length<1&&st?" ":ot};tt=tt.replace(/\r\n/g," ").replace(/\n/g," "),tt=tt.replace(/\s\s+/g,et.bind(et,!0)),(W.previousSibling==null&&q(W.parentNode)||W.previousSibling!=null&&q(W.previousSibling))&&(tt=tt.replace(/^\s+/,et.bind(et,!1))),(W.nextSibling==null&&q(W.parentNode)||W.nextSibling!=null&&q(W.nextSibling))&&(tt=tt.replace(/\s+$/,et.bind(et,!1)))}return Y.insert(tt)}p.default=I,p.matchAttributor=V,p.matchBlot=X,p.matchNewline=ft,p.matchSpacing=ht,p.matchText=gt},function(m,p,f){Object.defineProperty(p,"__esModule",{value:!0});var E=function(){function s(l,u){for(var r=0;r<u.length;r++){var i=u[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(l,i.key,i)}}return function(l,u,r){return u&&s(l.prototype,u),r&&s(l,r),l}}(),b=function s(l,u,r){l===null&&(l=Function.prototype);var i=Object.getOwnPropertyDescriptor(l,u);if(i===void 0){var c=Object.getPrototypeOf(l);return c===null?void 0:s(c,u,r)}else{if("value"in i)return i.value;var n=i.get;return n===void 0?void 0:n.call(r)}},_=f(6),y=g(_);function g(s){return s&&s.__esModule?s:{default:s}}function h(s,l){if(!(s instanceof l))throw new TypeError("Cannot call a class as a function")}function o(s,l){if(!s)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l&&(typeof l=="object"||typeof l=="function")?l:s}function t(s,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof l);s.prototype=Object.create(l&&l.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(s,l):s.__proto__=l)}var e=function(s){t(l,s);function l(){return h(this,l),o(this,(l.__proto__||Object.getPrototypeOf(l)).apply(this,arguments))}return E(l,[{key:"optimize",value:function(r){b(l.prototype.__proto__||Object.getPrototypeOf(l.prototype),"optimize",this).call(this,r),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}],[{key:"create",value:function(){return b(l.__proto__||Object.getPrototypeOf(l),"create",this).call(this)}},{key:"formats",value:function(){return!0}}]),l}(y.default);e.blotName="bold",e.tagName=["STRONG","B"],p.default=e},function(m,p,f){Object.defineProperty(p,"__esModule",{value:!0}),p.addControls=p.default=void 0;var E=function(){function v(O,k){var L=[],D=!0,z=!1,$=void 0;try{for(var J=O[Symbol.iterator](),H;!(D=(H=J.next()).done)&&(L.push(H.value),!(k&&L.length===k));D=!0);}catch(j){z=!0,$=j}finally{try{!D&&J.return&&J.return()}finally{if(z)throw $}}return L}return function(O,k){if(Array.isArray(O))return O;if(Symbol.iterator in Object(O))return v(O,k);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),b=function(){function v(O,k){for(var L=0;L<k.length;L++){var D=k[L];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(O,D.key,D)}}return function(O,k,L){return k&&v(O.prototype,k),L&&v(O,L),O}}(),_=f(2),y=r(_),g=f(0),h=r(g),o=f(5),t=r(o),e=f(10),s=r(e),l=f(9),u=r(l);function r(v){return v&&v.__esModule?v:{default:v}}function i(v,O,k){return O in v?Object.defineProperty(v,O,{value:k,enumerable:!0,configurable:!0,writable:!0}):v[O]=k,v}function c(v,O){if(!(v instanceof O))throw new TypeError("Cannot call a class as a function")}function n(v,O){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O&&
|
||
|
|
`);for(var p=Tt.default.iterator(this.ops),f=new R,E=0;p.hasNext();){if(p.peekType()!=="insert")return;var b=p.peek(),_=Tt.default.length(b)-p.peekLength(),y=typeof b.insert=="string"?b.insert.indexOf(m,_)-_:-1;if(y<0)f.push(p.next());else if(y>0)f.push(p.next(y));else{if(U(f,p.next(1).attributes||{},E)===!1)return;E+=1,f=new R}}f.length()>0&&U(f,{},E)},R.prototype.invert=function(U){var m=new R;return this.reduce(function(p,f){if(f.insert)m.delete(Tt.default.length(f));else{if(f.retain&&f.attributes==null)return m.retain(f.retain),p+f.retain;if(f.delete||f.retain&&f.attributes){var E=f.delete||f.retain,b=U.slice(p,p+E);return b.forEach(function(_){f.delete?m.push(_):f.retain&&f.attributes&&m.retain(Tt.default.length(_),Te.default.invert(f.attributes,_.attributes))}),p+E}}return p},0),m.chop()},R.prototype.transform=function(U,m){if(m===void 0&&(m=!1),m=!!m,typeof U=="number")return this.transformPosition(U,m);for(var p=U,f=Tt.default.iterator(this.ops),E=Tt.default.iterator(p.ops),b=new R;f.hasNext()||E.hasNext();)if(f.peekType()==="insert"&&(m||E.peekType()!=="insert"))b.retain(Tt.default.length(f.next()));else if(E.peekType()==="insert")b.push(E.next());else{var _=Math.min(f.peekLength(),E.peekLength()),y=f.next(_),g=E.next(_);if(y.delete)continue;g.delete?b.push(g):b.retain(_,Te.default.transform(y.attributes,g.attributes,m))}return b.chop()},R.prototype.transformPosition=function(U,m){m===void 0&&(m=!1),m=!!m;for(var p=Tt.default.iterator(this.ops),f=0;p.hasNext()&&f<=U;){var E=p.peekLength(),b=p.peekType();if(p.next(),b==="delete"){U-=Math.min(E,U-f);continue}else b==="insert"&&(f<U||!m)&&(U+=E);f+=E}return U},R.Op=Tt.default,R.AttributeMap=Te.default,R}(),jr=Rr;const Ir=Xn(jr);/*!
|
||
|
|
* VueQuill @vueup/vue-quill v1.2.0
|
||
|
|
* https://vueup.github.io/vue-quill/
|
||
|
|
*
|
||
|
|
* Includes quill v1.3.7
|
||
|
|
* https://quilljs.com/
|
||
|
|
*
|
||
|
|
* Copyright (c) 2023 Ahmad Luthfi Masruri
|
||
|
|
* Released under the MIT license
|
||
|
|
* Date: 2023-05-12T08:44:03.742Z
|
||
|
|
*/const Yn={essential:[[{header:[1,2,3,4,5,6,!1]}],["bold","italic","underline"],[{list:"ordered"},{list:"bullet"},{align:[]}],["blockquote","code-block","link"],[{color:[]},"clean"]],minimal:[[{header:1},{header:2}],["bold","italic","underline"],[{list:"ordered"},{list:"bullet"},{align:[]}]],full:[["bold","italic","underline","strike"],["blockquote","code-block"],[{header:1},{header:2}],[{list:"ordered"},{list:"bullet"}],[{script:"sub"},{script:"super"}],[{indent:"-1"},{indent:"+1"}],[{direction:"rtl"}],[{size:["small",!1,"large","huge"]}],[{header:[1,2,3,4,5,6,!1]}],[{color:[]},{background:[]}],[{font:[]}],[{align:[]}],["link","video","image"],["clean"]]},Mr=Qn({name:"QuillEditor",inheritAttrs:!1,props:{content:{type:[String,Object]},contentType:{type:String,default:"delta",validator:R=>["delta","html","text"].includes(R)},enable:{type:Boolean,default:!0},readOnly:{type:Boolean,default:!1},placeholder:{type:String,required:!1},theme:{type:String,default:"snow",validator:R=>["snow","bubble",""].includes(R)},toolbar:{type:[String,Array,Object],required:!1,validator:R=>typeof R=="string"&&R!==""?R.charAt(0)==="#"?!0:Object.keys(Yn).indexOf(R)!==-1:!0},modules:{type:Object,required:!1},options:{type:Object,required:!1},globalOptions:{type:Object,required:!1}},emits:["textChange","selectionChange","editorChange","update:content","focus","blur","ready"],setup:(R,U)=>{Jn(()=>{E()}),hr(()=>{m=null});let m,p;const f=Ve(),E=()=>{var v;if(f.value){if(p=b(),R.modules)if(Array.isArray(R.modules))for(const O of R.modules)Dn.register(`modules/${O.name}`,O.module);else Dn.register(`modules/${R.modules.name}`,R.modules.module);m=new Dn(f.value,p),c(R.content),m.on("text-change",o),m.on("selection-change",e),m.on("editor-change",s),R.theme!=="bubble"&&f.value.classList.remove("ql-bubble"),R.theme!=="snow"&&f.value.classList.remove("ql-snow"),(v=m.getModule("toolbar"))===null||v===void 0||v.container.addEventListener("mousedown",O=>{O.preventDefault()}),U.emit("ready",m)}},b=()=>{const v={};if(R.theme!==""&&(v.theme=R.theme),R.readOnly&&(v.readOnly=R.readOnly),R.placeholder&&(v.placeholder=R.placeholder),R.toolbar&&R.toolbar!==""&&(v.modules={toolbar:(()=>{if(typeof R.toolbar=="object")return R.toolbar;if(typeof R.toolbar=="string")return R.toolbar.charAt(0)==="#"?R.toolbar:Yn[R.toolbar]})()}),R.modules){const O=(()=>{var k,L;const D={};if(Array.isArray(R.modules))for(const z of R.modules)D[z.name]=(k=z.options)!==null&&k!==void 0?k:{};else D[R.modules.name]=(L=R.modules.options)!==null&&L!==void 0?L:{};return D})();v.modules=Object.assign({},v.modules,O)}return Object.assign({},R.globalOptions,R.options,v)},_=v=>typeof v=="object"&&v?v.slice():v,y=v=>Object.values(v.ops).some(O=>!O.retain||Object.keys(O).length!==1);let g;const h=v=>{if(typeof g==typeof v){if(v===g)return!0;if(typeof v=="object"&&v&&typeof g=="object"&&g)return!y(g.diff(v))}return!1},o=(v,O,k)=>{g=_(i()),h(R.content)||U.emit("update:content",g),U.emit("textChange",{delta:v,oldContents:O,source:k})},t=Ve(),e=(v,O,k)=>{t.value=!!(m!=null&&m.hasFocus()),U.emit("selectionChange",{range:v,oldRange:O,source:k})};Mn(t,v=>{v?U.emit("focus",f):U.emit("blur",f)});const s=(...v)=>{v[0]==="text-change"&&U.emit("editorChange",{name:v[0],delta:v[1],oldContents:v[2],source:v[3]}),v[0]==="selection-change"&&U.emit("editorChange",{name:v[0],range:v[1],oldRange:v[2],source:v[3]})},l=()=>f.value,u=()=>{var v;return(v=m==null?void 0:m.getModule("toolbar"))===null||v===void 0?void 0:v.container},r=()=>{if(m)return m;throw`The quill editor hasn't been instantiated yet,
|
||
|
|
make sure to call this method when the editor ready
|
||
|
|
or use v-on:ready="onReady(quill)" event instead.`},i=(v,O)=>R.contentType==="html"?N():R.contentType==="text"?n(v,O):m==null?void 0:m.getContents(v,O),c=(v,O="api")=>{const k=v||(R.contentType==="delta"?new Ir:"");R.contentType==="html"?w(k):R.contentType==="text"?d(k,O):m==null||m.setContents(k,O),g=_(k)},n=(v,O)=>{var k;return(k=m==null?void 0:m.getText(v,O))!==null&&k!==void 0?k:""},d=(v,O="api")=>{m==null||m.setText(v,O)},N=()=>{var v;return(v=m==null?void 0:m.root.innerHTML)!==null&&v!==void 0?v:""},w=v=>{m&&(m.root.innerHTML=v)},T=(v,O="api")=>{const k=m==null?void 0:m.clipboard.convert(v);k&&(m==null||m.setContents(k,O))},P=()=>{m==null||m.focus()},A=()=>{$n(()=>{var v;!U.slots.toolbar&&m&&((v=m.getModule("toolbar"))===null||v===void 0||v.container.remove()),E()})};return Mn(()=>R.content,v=>{if(!m||!v||h(v))return;const O=m.getSelection();O&&$n(()=>m==null?void 0:m.setSelection(O)),c(v)},{deep:!0}),Mn(()=>R.enable,v=>{m&&m.enable(v)}),{editor:f,getEditor:l,getToolbar:u,getQuill:r,getContents:i,setContents:c,getHTML:N,setHTML:w,pasteHTML:T,focus:P,getText:n,setText:d,reinit:A}},render(){var R,U;return[(U=(R=this.$slots).toolbar)===null||U===void 0?void 0:U.call(R),dr("div",{ref:"editor",...this.$attrs})]}}),Dr={class:"p-4"},Wr=Qn({__name:"index",setup(R){const U=Ve(),m=Ve({id:null,payload:{title:"",meta:"",description:"",about_us:""}});async function p(){try{await U.value.validate(),m.value.id&&await cr(m.value.id,{id:m.value.id,value_json:JSON.stringify(m.value.payload),key:"seo_home"}),gr.success("اطلاعات با موفقیت ذخیره شد")}catch(f){console.log(f)}finally{}}return Jn(async()=>{const f=await fr("seo_home");f.length>0&&(m.value.id=f[0].id,f[0].value_json&&(m.value.payload=JSON.parse(f[0].value_json)))}),(f,E)=>(vr(),pr("div",Dr,[Ht(Ot(_r),{ref_key:"formRef",ref:U,model:Ot(m)},{default:ce(()=>[Ht(Ot(ze),{rules:[{required:!0,message:"عنوان را وارد نمایید"}],label:"عنوان",name:["payload","title"]},{default:ce(()=>[Ht(Ot(mr),{value:Ot(m).payload.title,"onUpdate:value":E[0]||(E[0]=b=>Ot(m).payload.title=b)},null,8,["value"])]),_:1}),Ht(Ot(ze),{rules:[{required:!0,message:"متا را وارد نمایید"}],label:"متا",name:["payload","meta"]},{default:ce(()=>[Ht(Ot(Gn),{value:Ot(m).payload.meta,"onUpdate:value":E[1]||(E[1]=b=>Ot(m).payload.meta=b)},null,8,["value"])]),_:1}),Ht(Ot(ze),{rules:[{required:!0,message:"درباره ما را وارد نمایید"}],label:"متن درباره ما",name:["payload","about_us"]},{default:ce(()=>[Ht(Ot(Gn),{value:Ot(m).payload.about_us,"onUpdate:value":E[2]||(E[2]=b=>Ot(m).payload.about_us=b)},null,8,["value"])]),_:1}),Ht(Ot(ze),{label:"محتوا صفحه اصلی",name:["payload","description"]},{default:ce(()=>[Ht(Ot(Mr),{content:Ot(m).payload.description,"onUpdate:content":E[3]||(E[3]=b=>Ot(m).payload.description=b),theme:"snow",contentType:"html",toolbar:"full"},null,8,["content"])]),_:1}),Ht(Ot(br),{class:"mt-5",type:"primary",onClick:p},{default:ce(()=>[yr("ذخیره تغییرات")]),_:1})]),_:1},8,["model"])]))}});export{Wr as default};
|