PageSourceSearch

https://webportal.imatrics.com/assets/AutoTaggingDemo-BOxyz0pP.js

js imatrics.com collected 2026-10-05 03:15:51 UTC 269,586 bytes, 73 lines download raw bytes

1var dc=Object.defineProperty;var fc=(r,e,t)=>e in r?dc(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var U=(r,e,t)=>fc(r,typeof e!="symbol"?e+"":e,t);import{f as k,R as ae,c as fn,aC as pc,_ as Je,aD as gc,aE as mc,q as Ee,aF as bc,aG as yc,aH as vc,b as xc,aI as on,g as Wl,j as h,aj as sn,aJ as Fi,B as z,T as je,aK as Ec,aL as wc,aM as Nc,p as Vl,Y as Ql,aN as Ac,aO as Tc,C as Zl,G as _e,aP as Cc,$ as De,e as vt,aQ as Sc,aR as Lc,aS as Oc,aT as qc,x as Lr,aU as jc,aV as Ic,aW as kc,aX as _c,M as Yl,w as Rc,h as Or,as as Mc,af as Bc,au as Xl,a5 as Dc,av as Pc,aY as $c,aZ as di,a_ as fi,A as xs,Z as pi,a$ as Fc,at as Uc,b0 as Da,i as nn,ak as Hc,b1 as zc,b2 as Gc,b3 as Kc,I as Wc,b4 as Vc,b5 as Qc,b6 as Zc,b7 as Yc,a9 as Xc,b8 as gi,aa as Jc,ab as eu}from"./mui-DY5Gl7oU.js";import{W as Rt,u as Fr,C as ur,a as Jl,A as ss,P as is,G as tu}from"./index-CdMfwr03.js";import{g as nu,u as as,b as Pa}from"./apollo-CyXUVKo4.js";import{Q as ru,A as su,G as iu,U as au,T as mi,a as bi,S as yi}from"./ArticleDisplayer-KfWOECrM.js";import{G as lu}from"./GET_CUSTOMER_SETTINGS-GHgG3cx9.js";import{C as ou}from"./CLEAR_ENTITY_CACHE-Cx4m70Rk.js";import{C as vi}from"./CMConceptModal-RQgQ2uwn.js";import{D as cu}from"./DatasetPicker-UQuKL93J.js";import{M as uu}from"./MultiChannelInput-DjpMSPNK.js";import"./vendors-g49t3g-N.js";import"./react-BUsGL8WM.js";import"./searchConcepts-8XXVdUuB.js";import"./main-DTeIB9jz.js";import"./AliasInput-CfQAWUFz.js";import"./omit-9l3jDvWE.js";import"./GET_CONCEPT_AUTHORITY_PROFILE-ihuxrA_T.js";function sr(r){return r&&r.ownerDocument||document}function hu(r){var e=sr(r);return e&&e.defaultView||window}function du(r,e){return hu(r).getComputedStyle(r,e)}var fu=/([A-Z])/g;function pu(r){return r.replace(fu,"-$1").toLowerCase()}var gu=/^ms-/;function ls(r){return pu(r).replace(gu,"-ms-")}var mu=/^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i;function bu(r){return!!(r&&mu.test(r))}function Sn(r,e){var t="",n="";if(typeof e=="string")return r.style.getPropertyValue(ls(e))||du(r).getPropertyValue(ls(e));Object.keys(e).forEach(function(s){var i=e[s];!i&&i!==0?r.style.removeProperty(ls(s)):bu(s)?n+=s+"("+i+") ":t+=ls(s)+": "+i+";"}),n&&(t+="transform: "+n+";"),r.style.cssText+=";"+t}const js=!!(typeof window<"u"&&window.document&&window.document.createElement);var Ui=!1,Hi=!1;try{var xi={get passive(){return Ui=!0},get once(){return Hi=Ui=!0}};js&&(window.addEventListener("test",xi,xi),window.removeEventListener("test",xi,!0))}catch{}function eo(r,e,t,n){if(n&&typeof n!="boolean"&&!Hi){var s=n.once,i=n.capture,l=t;!Hi&&s&&(l=t.__once||function o(c){this.removeEventListener(e,o,i),t.call(this,c)},t.__once=l),r.addEventListener(e,l,Ui?n:i)}r.addEventListener(e,t,n)}function zi(r,e,t,n){var s=n&&typeof n!="boolean"?n.capture:n;r.removeEventListener(e,t,s),t.__once&&r.removeEventListener(e,t.__once,s)}function As(r,e,t,n){return eo(r,e,t,n),function(){zi(r,e,t,n)}}function yu(r,e,t,n){if(n===void 0&&(n=!0),r){var s=document.createEvent("HTMLEvents");s.initEvent(e,t,n),r.dispatchEvent(s)}}function vu(r){var e=Sn(r,"transitionDuration")||"",t=e.indexOf("ms")===-1?1e3:1;return parseFloat(e)*t}function xu(r,e,t){t===void 0&&(t=5);var n=!1,s=setTimeout(function(){n||yu(r,"transitionend",!0)},e+t),i=As(r,"transitionend",function(){n=!0},{once:!0});return function(){clearTimeout(s),i()}}function to(r,e,t,n){t==null&&(t=vu(r)||0);var s=xu(r,t,n),i=As(r,"transitionend",e);return function(){s(),i()}}function $a(r,e){var t=Sn(r,e)||"",n=t.indexOf("ms")===-1?1e3:1;return parseFloat(t)*n}function Eu(r,e){var t=$a(r,"transitionDuration"),n=$a(r,"transitionDelay"),s=to(r,function(i){i.target===r&&(s(),e(i))},t+n)}function wu(r){r.offsetHeight}function Nu(r){const e=k.useRef(r);return k.useEffect(()=>{e.current=r},[r]),e}function an(r){const e=Nu(r);return k.useCallback(function(...t){return e.current&&e.current(...t)},[e])}var Au=["className","children"],os,Tu={in:!1,timeout:300,mountOnEnter:!1,unmountOnExit:!1,appear:!1},Cu=(os={},os[gc]="show",os[mc]="show",os),Is=ae.forwardRef(function(r,e){var t=r.className,n=r.children,s=fn(r,Au),i=k.useCallback(function(l){wu(l),s.onEnter&&s.onEnter(l)},[s]);return ae.createElement(pc,Je({ref:e,addEndListener:Eu},s,{onEnter:i}),function(l,o){return ae.cloneElement(n,Je({},o,{className:Rt("fade",t,n.props.className,Cu[l])}))})});Is.defaultProps=Tu;Is.displayName="Fade";var Su=["label","onClick","className"],Lu={label:Ee.string.isRequired,onClick:Ee.func},Ou={label:"Close"},ks=ae.forwardRef(function(r,e){var t=r.label,n=r.onClick,s=r.className,i=fn(r,Su);return ae.createElement("button",Je({ref:e,type:"button",className:Rt("close",s
1),onClick:n},i),ae.createElement("span",{"aria-hidden":"true"},"×"),ae.createElement("span",{className:"sr-only"},t))});ks.displayName="CloseButton";ks.propTypes=Lu;ks.defaultProps=Ou;const qu=(function(r){return ae.forwardRef(function(e,t){return ae.createElement("div",Je({},e,{ref:t,className:Rt(e.className,r)}))})});var ju=/-(.)/g;function Iu(r){return r.replace(ju,function(e,t){return t.toUpperCase()})}var ku=["className","bsPrefix","as"],_u=function(e){return e[0].toUpperCase()+Iu(e).slice(1)};function ga(r,e){var t=e===void 0?{}:e,n=t.displayName,s=n===void 0?_u(r):n,i=t.Component,l=t.defaultProps,o=ae.forwardRef(function(c,d){var p=c.className,x=c.bsPrefix,f=c.as,m=f===void 0?i||"div":f,y=fn(c,ku),E=Fr(x,r);return ae.createElement(m,Je({ref:d,className:Rt(p,E)},y))});return o.defaultProps=l,o.displayName=s,o}function Ru(){const r=k.useRef(!0),e=k.useRef(()=>r.current);return k.useEffect(()=>(r.current=!0,()=>{r.current=!1}),[]),e.current}function Mu(r){const e=k.useRef(r);return e.current=r,e}function no(r){const e=Mu(r);k.useEffect(()=>()=>e.current(),[])}var Bu=Function.prototype.bind.call(Function.prototype.call,[].slice);function Wn(r,e){return Bu(r.querySelectorAll(e))}function Du(r){const e=k.useRef(null);return k.useEffect(()=>{e.current=r}),e.current}function Pu(){return k.useState(null)}function Fa(r,e){if(r.contains)return r.contains(e);if(r.compareDocumentPosition)return r===e||!!(r.compareDocumentPosition(e)&16)}var cs;function Ts(r){if((!cs&&cs!==0||r)&&js){var e=document.createElement("div");e.style.position="absolute",e.style.top="-9999px",e.style.width="50px",e.style.height="50px",e.style.overflow="scroll",document.body.appendChild(e),cs=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return cs}function Ei(r){r===void 0&&(r=sr());try{var e=r.activeElement;return!e||!e.nodeName?null:e}catch{return r.body}}function $u(r){return"nodeType"in r&&r.nodeType===document.DOCUMENT_NODE}function Gi(r){return"window"in r&&r.window===r?r:$u(r)&&r.defaultView||!1}function Fu(r){return r&&r.tagName.toLowerCase()==="body"}function Uu(r){var e=Gi(r)?sr():sr(r),t=Gi(r)||e.defaultView;return e.body.clientWidth<t.innerWidth}function Hu(r){var e=Gi(r);return e||Fu(r)?Uu(r):r.scrollHeight>r.clientHeight}var zu=["template","script","style"],Gu=function(e){var t=e.nodeType,n=e.tagName;return t===1&&zu.indexOf(n.toLowerCase())===-1},ro=function(e,t,n){[].forEach.call(e.children,function(s){t.indexOf(s)===-1&&Gu(s)&&n(s)})};function Cs(r,e){e&&(r?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden"))}function Ku(r,e){var t=e.dialog,n=e.backdrop;ro(r,[t,n],function(s){return Cs(!0,s)})}function Wu(r,e){var t=e.dialog,n=e.backdrop;ro(r,[t,n],function(s){return Cs(!1,s)})}function Vu(r,e){var t=-1;return r.some(function(n,s){return e(n,s)?(t=s,!0):!1}),t}var _s=(function(){function r(t){var n=t===void 0?{}:t,s=n.hideSiblingNodes,i=s===void 0?!0:s,l=n.handleContainerOverflow,o=l===void 0?!0:l;this.hideSiblingNodes=void 0,this.handleContainerOverflow=void 0,this.modals=void 0,this.containers=void 0,this.data=void 0,this.scrollbarSize=void 0,this.hideSiblingNodes=i,this.handleContainerOverflow=o,this.modals=[],this.containers=[],this.data=[],this.scrollbarSize=Ts()}var e=r.prototype;return e.isContainerOverflowing=function(n){var s=this.data[this.containerIndexFromModal(n)];return s&&s.overflowing},e.containerIndexFromModal=function(n){return Vu(this.data,function(s){return s.modals.indexOf(n)!==-1})},e.setContainerStyle=function(n,s){var i={overflow:"hidden"};n.style={overflow:s.style.overflow,paddingRight:s.style.paddingRight},n.overflowing&&(i.paddingRight=parseInt(Sn(s,"paddingRight")||"0",10)+this.scrollbarSize+"px"),Sn(s,i)},e.removeContainerStyle=function(n,s){Object.assign(s.style,n.style)},e.add=function(n,s,i){var l=this.modals.indexOf(n),o=this.containers.indexOf(s);if(l!==-1)return l;if(l=this.modals.length,this.modals.push(n),this.hideSiblingNodes&&Ku(s,n),o!==-1)return this.data[o].modals.push(n),l;var c={modals:[n],classes:i?i.split(/\s+/):[],overflowing:Hu(s)};return this.handleContainerOverflow&&this.setContainerStyle(c,s),c.classes.forEac
1h(bc.bind(null,s)),this.containers.push(s),this.data.push(c),l},e.remove=function(n){var s=this.modals.indexOf(n);if(s!==-1){var i=this.containerIndexFromModal(n),l=this.data[i],o=this.containers[i];if(l.modals.splice(l.modals.indexOf(n),1),this.modals.splice(s,1),l.modals.length===0)l.classes.forEach(yc.bind(null,o)),this.handleContainerOverflow&&this.removeContainerStyle(l,o),this.hideSiblingNodes&&Wu(o,n),this.containers.splice(i,1),this.data.splice(i,1);else if(this.hideSiblingNodes){var c=l.modals[l.modals.length-1],d=c.backdrop,p=c.dialog;Cs(!1,p),Cs(!1,d)}}},e.isTopModal=function(n){return!!this.modals.length&&this.modals[this.modals.length-1]===n},r})(),wi=function(e){var t;return typeof document>"u"?null:e==null?sr().body:(typeof e=="function"&&(e=e()),e&&"current"in e&&(e=e.current),(t=e)!=null&&t.nodeType&&e||null)};function Qu(r,e){var t=k.useState(function(){return wi(r)}),n=t[0],s=t[1];if(!n){var i=wi(r);i&&s(i)}return k.useEffect(function(){},[e,n]),k.useEffect(function(){var l=wi(r);l!==n&&s(l)},[r,n]),n}var Ni;function Zu(){return Ni||(Ni=new _s),Ni}function Yu(r){var e=r||Zu(),t=k.useRef({dialog:null,backdrop:null});return Object.assign(t.current,{add:function(s,i){return e.add(t.current,s,i)},remove:function(){return e.remove(t.current)},isTopModal:function(){return e.isTopModal(t.current)},setDialogRef:k.useCallback(function(n){t.current.dialog=n},[]),setBackdropRef:k.useCallback(function(n){t.current.backdrop=n},[])})}var ma=k.forwardRef(function(r,e){var t=r.show,n=t===void 0?!1:t,s=r.role,
1i=s===void 0?"dialog":s,l=r.className,o=r.style,c=r.children,d=r.backdrop,p=d===void 0?!0:d,x=r.keyboard,f=x===void 0?!0:x,m=r.onBackdropClick,y=r.onEscapeKeyDown,E=r.transition,w=r.backdropTransition,S=r.autoFocus,I=S===void 0?!0:S,M=r.enforceFocus,H=M===void 0?!0:M,L=r.restoreFocus,P=L===void 0?!0:L,W=r.restoreFocusOptions,re=r.renderDialog,fe=r.renderBackdrop,F=fe===void 0?function(ge){return ae.createElement("div",ge)}:fe,g=r.manager,A=r.container,v=r.containerClassName,j=r.onShow,O=r.onHide,T=O===void 0?function(){}:O,q=r.onExit,B=r.onExited,D=r.onExiting,_=r.onEnter,Z=r.onEntering,Y=r.onEntered,te=fn(r,["show","role","className","style","children","backdrop","keyboard","onBackdropClick","onEscapeKeyDown","transition","backdropTransition","autoFocus","enforceFocus","restoreFocus","restoreFocusOptions","renderDialog","renderBackdrop","manager","container","containerClassName","onShow","onHide","onExit","onExited","onExiting","onEnter","onEntering","onEntered"]),X=Qu(A),R=Yu(g),pe=Ru(),oe=Du(n),ee=k.useState(!n),ue=ee[0],de=ee[1],se=k.useRef(null);k.useImperativeHandle(e,function(){return R},[R]),js&&!oe&&n&&(se.current=Ei()),!E&&!n&&!ue?de(!0):n&&ue&&de(!1);var ie=an(function(){if(R.add(X,v),Re.current=As(document,"keydown",Ze),tt.current=As(document,"focus",function(){return setTimeout(Ne)},!0),j&&j(),I){var ge=Ei(document);R.dialog&&ge&&!Fa(R.dialog,ge)&&(se.current=ge,R.dialog.focus())}}),ce=an(function(){if(R.remove(),Re.current==null||Re.current(),tt.current==null||tt.current(),P){var ge;(ge=se.current)==null||ge.focus==null||ge.focus(W),se.current=null}});k.useEffect(function(){!n||!X||ie()},[n,X,ie]),k.useEffect(function(){ue&&ce()},[ue,ce]),no(function(){ce()});var Ne=an(function(){if(!(!H||!pe()||!R.isTopModal())){var ge=Ei();R.dialog&&ge&&!Fa(R.dialog,ge)&&R.dialog.focus()}}),xe=an(function(ge){ge.target===ge.currentTarget&&(m==null||m(ge),p===!0&&T())}),Ze=an(function(ge){f&&ge.keyCode===27&&R.isTopModal()&&(y==null||y(ge),ge.defaultPrevented||T())}),tt=k.useRef(),Re=k.useRef(),Te=function(){de(!0);for(var He=arguments.length,we=new Array(He),le=0;le<He;le++)we[le]=arguments[le];B==null||B.apply(void 0,we)},Pe=E;if(!X||!(n||Pe&&!ue))return null;var Me=Je({role:i,ref:R.setDialogRef,"aria-modal":i==="dialog"?!0:void 0},te,{style:o,className:l,tabIndex:-1}),Ce=re?re(Me):ae.createElement("div",Me,ae.cloneElement(c,{role:"document"}));Pe&&(Ce=ae.createElement(Pe,{appear:!0,unmountOnExit:!0,in:!!n,onExit:q,onExiting:D,onExited:Te,onEnter:_,onEntering:Z,onEntered:Y},Ce));var Ye=null;if(p){var Be=w;Ye=F({ref:R.setBackdropRef,onClick:xe}),Be&&(Ye=ae.createElement(Be,{appear:!0,in:!!n},Ye))}return ae.createElement(ae.Fragment,null,vc.createPortal(ae.createElement(ae.Fragment,null,Ye,Ce),X))}),Xu={show:Ee.bool,container:Ee.any,onShow:Ee.func,onHide:Ee.func,backdrop:Ee.oneOfType([Ee.bool,Ee.oneOf(["static"])]),renderDialog:Ee.func,renderBackdrop:Ee.func,onEscapeKeyDown:Ee.func,onBackdropClick:Ee.func,containerClassName:Ee.string,keyboard:Ee.bool,transition:Ee.elementType,backdropTransition:Ee.elementType,autoFocus:Ee.bool,enforceFocus:Ee.bool,restoreFocus:Ee.bool,restoreFocusOptions:Ee.shape({preventScroll:Ee.bool}),onEnter:Ee.func,onEntering:Ee.func,onEntered:Ee.func,onExit:Ee.func,onExiting:Ee.func,onExited:Ee.func,manager:Ee.instanceOf(_s)};ma.displayName="Modal";ma.propTypes=Xu;const Ju=Object.assign(ma,{Manager:_s});var Vn={FIXED_CONTENT:".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",STICKY_CONTENT:".sticky-top",NAVBAR_TOGGLER:".navbar-toggler"},eh=(function(r){xc(e,r);function e(){return r.apply(this,arguments)||this}var t=e.prototype;return t.adjustAndStore=function(s,i,l){var o,c=i.style[s];i.dataset[s]=c,Sn(i,(o={},o[s]=parseFloat(Sn(i,s))+l+"px",o))},t.restore=function(s,i){var l=i.dataset[s];if(l!==void 0){var o;delete i.dataset[s],Sn(i,(o={},o[s]=l,o))}},t.setContainerStyle=function(s,i){var l=this;if(r.prototype.setContainerStyle.call(this,s,i),!!s.overflowing){var o=Ts();Wn(i,Vn.FIXED_CONTENT).forEach(function(c){return l.adjustAndStore("paddingRight",c,o)}),Wn(i,Vn.STICKY_CONTENT).forEach(function(c){return l.adjustAndStore("marginRight",c,-o)}
1),Wn(i,Vn.NAVBAR_TOGGLER).forEach(function(c){return l.adjustAndStore("marginRight",c,o)})}},t.removeContainerStyle=function(s,i){var l=this;r.prototype.removeContainerStyle.call(this,s,i),Wn(i,Vn.FIXED_CONTENT).forEach(function(o){return l.restore("paddingRight",o)}),Wn(i,Vn.STICKY_CONTENT).forEach(function(o){return l.restore("marginRight",o)}),Wn(i,Vn.NAVBAR_TOGGLER).forEach(function(o){return l.restore("marginRight",o)})},e})(_s);const th=ga("modal-body");var so=ae.createContext({onHide:function(){}}),nh=["bsPrefix","className","contentClassName","centered","size","children","scrollable"],ba=ae.forwardRef(function(r,e){var t=r.bsPrefix,n=r.className,s=r.contentClassName,i=r.centered,l=r.size,o=r.children,c=r.scrollable,d=fn(r,nh);t=Fr(t,"modal");var p=t+"-dialog";return ae.createElement("div",Je({},d,{ref:e,className:Rt(p,n,l&&t+"-"+l,i&&p+"-centered",c&&p+"-scrollable")}),ae.createElement("div",{className:Rt(t+"-content",s)},o))});ba.displayName="ModalDialog";const rh=ga("modal-footer");var sh=["bsPrefix","closeLabel","closeButton","onHide","className","children"],ih={closeLabel:"Close",closeButton:!1},ya=ae.forwardRef(function(r,e){var t=r.bsPrefix,n=r.closeLabel,s=r.closeButton,i=r.onHide,l=r.className,o=r.children,c=fn(r,sh);t=Fr(t,"modal-header");var d=k.useContext(so),p=an(function(){d&&d.onHide(),i&&i()});return ae.createElement("div",Je({ref:e},c,{className:Rt(l,t)}),o,s&&ae.createElement(ks,{label:n,onClick:p}))});ya.displayName="ModalHeader";ya.defaultProps=ih;var ah=qu("h4");const lh=ga("modal-title",{Component:ah});var oh=["bsPrefix","className","style","dialogClassName","contentClassName","children","dialogAs","aria-labelledby","aria-describedby","aria-label","show","animation","backdrop","keyboard","onEscapeKeyDown","onShow","onHide","container","autoFocus","enforceFocus","restoreFocus","restoreFocusOptions","onEntered","onExit","onExiting","onEnter","onEntering","onExited","backdropClassName","manager"],Ai,ch={show:!1,backdrop:!0,keyboard:!0,autoFocus:!0,enforceFocus:!0,restoreFocus:!0,animation:!0,dialogAs:ba};function uh(r){return ae.createElement(Is,Je({},r,{timeout:null}))}function hh(r){return ae.createElement(Is,Je({},r,{timeout:null}))}var ft=ae.forwardRef(function(r,e){var t=r.bsPrefix,n=r.className,s=r.style,i=r.dialogClassName,l=r.contentClassName,o=r.children,c=r.dialogAs,d=r["aria-labelledby"],p=r["aria-describedby"],x=r["aria-label"],f=r.show,m=r.animation,y=r.backdrop,E=r.keyboard,w=r.onEscapeKeyDown,S=r.onShow,I=r.onHide,M=r.container,H=r.autoFocus,L=r.enforceFocus,P=r.restoreFocus,W=r.restoreFocusOptions,re=r.onEntered,fe=r.onExit,F=r.onExiting,g=r.onEnter,A=r.onEntering,v=r.onExited,j=r.backdropClassName,O=r.manager,T=fn(r,oh),q=k.useState({}),B=q[0],D=q[1],_=k.useState(!1),Z=_[0],Y=_[1],te=k.useRef(!1),X=k.useRef(!1),R=k.useRef(null),pe=Pu(),oe=pe[0],ee=pe[1],ue=an(I);t=Fr(t,"modal"),k.useImperativeHandle(e,function(){return{get _modal(){return oe}}},[oe]);var de=k.useMemo(function(){return{onHide:ue}},[ue]);function se(){return O||(Ai||(Ai=new eh),Ai)}function ie(we){if(js){var le=se().isContainerOverflowing(oe),ze=we.scrollHeight>sr(we).documentElement.clientHeight;D({paddingRight:le&&!ze?Ts():void 0,paddingLeft:!le&&ze?Ts():void 0})}}var ce=an(function(){oe&&ie(oe.dialog)});no(function(){zi(window,"resize",ce),R.current&&R.current()});var Ne=function(){te.current=!0},xe=function(le){te.current&&oe&&le.target===oe.dialog&&(X.current=!0),te.current=!1},Ze=function(){Y(!0),R.current=to(oe.dialog,function(){Y(!1)})},tt=function(le){le.target===le.currentTarget&&Ze()},Re=function(le){if(y==="static"){tt(le);return}if(X.current||le.target!==le.currentTarget){X.current=!1;return}I==null||I()},Te=function(le){!E&&y==="static"?(le.preventDefault(),Ze()):E&&w&&w(le)},Pe=function(le,ze){le&&(le.style.display="block",ie(le)),g==null||g(le,ze)},Me=function(le){R.current==null||R.current(),fe==null||fe(le)},Ce=function(le,ze){A==null||A(le,ze),eo(window,"resize",ce)},Ye=function(le){le&&(le.style.display=""),v==null||v(le),zi(window,"resize",ce)},Be=k.useCallback(function(we){return ae.createElement("div",Je({},we,{className:Rt(t+"-backdrop",j,!m&&"show")}))},[m,j,t]),ge=Je({},s,B);m||(ge.display="block");var He=function(le){return ae.createElement("div",Je({role:"dialog"},le,{style:ge,className:Rt(n,t,Z&&t+"-static"),onClick:y?Re:void 0,onMouseUp:xe,"aria-label":x,"aria-labelledby":d,"aria-describedby":p}),ae.createElement(c,Je({},T,{onMouseDown:Ne,className:i,contentClassName:l}),o))};return ae.createElement(so.Provider,{value:de},ae.createElement(Ju,{show:f,ref:ee,backdrop:y,container:M,keyboard:!0,autoFocus:H,enforceFocus:L,restoreFocus:P,restoreFocusOptions:W,onEscapeKeyDown:Te,onShow:S,onHide:I,onEnter:Pe,onEntering:Ce,onEntered:re,onExit:Me,onExiting:F,onExited:Ye,manager:se(),containerClassName:t+"-open",transition:m?uh:void 0,backdropTransition:m?hh:void 0,renderBackdrop:Be,renderDialog:He}))});ft.displayName="Modal";ft.defaultProps=ch;ft.Body=th;ft.Header=ya;ft.Title=lh;ft.Footer=rh;ft.Dialog=ba;ft.TRANSITION_DURATION=300;ft.BACKDROP_TRANSITION_DURATION=150;var dh=["bsPrefix","className","striped","bordered","borderless","hover","size","variant","responsive"],fh=ae.forwardRef(function(r,e){var t=r.bsPrefix,n=r.className,s=r.striped,i=r.bordered,l=r.borderless,o=r.hover,c=r.size,d=r.variant,p=r.responsive,x=fn(r,dh),f=Fr(t,"table"),m=Rt(n,f,d&&f+"-"+d,c&&f+"-"+c,s&&f+"-striped",i&&f+"-bordered",l&&f+"-borderless",o&&f+"-hover"),y=ae.createElement("table",Je({},x,{className:m,ref:e}));if(p){var E=f+"-responsive";return typeof p=="string"&&(E=E+"-"+p),ae.createElement("div",{className:E},y)}return y});const ph=nu`
2  mutation ($searchString: String!, $returnSize: Int) {
3    searchArticlesMutation(query: $searchString, returnSize: $returnSize) {
4      uuid
5      headline
6      preamble
7      body
8      channels
9      dateline
10      groupAndGroupCluster
11      concepts {
12        title
13        type
14        uuid
15      }
16    }
17  }
18`;var io=typeof global=="object"&&global&&global.Object===Object&&global,gh=typeof self=="object"&&self&&self.Object===Object&&self,Dt=io||gh||Function("return this")(),dn=Dt.Symbol,ao=Object.prototype,mh=ao.hasOwnProperty,bh=ao.toString,wr=dn?dn.toStringTag:void 0;function yh(r){var e=mh.call(r,wr),t=r[wr];try{r[wr]=void 0;var n=!0}catch{}var s=bh.call(r);return n&&(e?r[wr]=t:delete r[wr]),s}var vh=Object.prototype,xh=vh.toString;function Eh(r){return xh.call(r)}
vendor: 11,504 bytes, line 18
18var wh="[object Null]",Nh="[object Undefined]",Ua=dn?dn.toStringTag:void 0;function hr(r){return r==null?r===void 0?Nh:wh:Ua&&Ua in Object(r)?yh(r):Eh(r)}function Gt(r){return r!=null&&typeof r=="object"}var Ln=Array.isArray;function pn(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}function lo(r){return r}var Ah="[object AsyncFunction]",Th="[object Function]",Ch="[object GeneratorFunction]",Sh="[object Proxy]";function va(r){if(!pn(r))return!1;var e=hr(r);return e==Th||e==Ch||e==Ah||e==Sh}var Ti=Dt["__core-js_shared__"],Ha=(function(){var r=/[^.]+$/.exec(Ti&&Ti.keys&&Ti.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function Lh(r){return!!Ha&&Ha in r}var Oh=Function.prototype,qh=Oh.toString;function jn(r){if(r!=null){try{return qh.call(r)}catch{}try{return r+""}catch{}}return""}var jh=/[\\^$.*+?()[\]{}|]/g,Ih=/^\[object .+?Constructor\]$/,kh=Function.prototype,_h=Object.prototype,Rh=kh.toString,Mh=_h.hasOwnProperty,Bh=RegExp("^"+Rh.call(Mh).replace(jh,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Dh(r){if(!pn(r)||Lh(r))return!1;var e=va(r)?Bh:Ih;return e.test(jn(r))}function Ph(r,e){return r==null?void 0:r[e]}function In(r,e){var t=Ph(r,e);return Dh(t)?t:void 0}var Ki=In(Dt,"WeakMap"),za=Object.create,$h=(function(){function r(){}return function(e){if(!pn(e))return{};if(za)return za(e);r.prototype=e;var t=new r;return r.prototype=void 0,t}})();function Fh(r,e,t){switch(t.length){case 0:return r.call(e);case 1:return r.call(e,t[0]);case 2:return r.call(e,t[0],t[1]);case 3:return r.call(e,t[0],t[1],t[2])}return r.apply(e,t)}function Uh(r,e){var t=-1,n=r.length;for(e||(e=Array(n));++t<n;)e[t]=r[t];return e}var Hh=800,zh=16,Gh=Date.now;function Kh(r){var e=0,t=0;return function(){var n=Gh(),s=zh-(n-t);if(t=n,s>0){if(++e>=Hh)return arguments[0]}else e=0;return r.apply(void 0,arguments)}}function Wh(r){return function(){return r}}var Ss=(function(){try{var r=In(Object,"defineProperty");return r({},"",{}),r}catch{}})(),Vh=Ss?function(r,e){return Ss(r,"toString",{configurable:!0,enumerable:!1,value:Wh(e),writable:!0})}:lo,Qh=Kh(Vh);function Zh(r,e){for(var t=-1,n=r==null?0:r.length;++t<n&&e(r[t],t,r)!==!1;);return r}var Yh=9007199254740991,Xh=/^(?:0|[1-9]\d*)$/;function oo(r,e){var t=typeof r;return e=e??Yh,!!e&&(t=="number"||t!="symbol"&&Xh.test(r))&&r>-1&&r%1==0&&r<e}function xa(r,e,t){e=="__proto__"&&Ss?Ss(r,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):r[e]=t}function Ur(r,e){return r===e||r!==r&&e!==e}var Jh=Object.prototype,ed=Jh.hasOwnProperty;function co(r,e,t){var n=r[e];(!(ed.call(r,e)&&Ur(n,t))||t===void 0&&!(e in r))&&xa(r,e,t)}function td(r,e,t,n){var s=!t;t||(t={});for(var i=-1,l=e.length;++i<l;){var o=e[i],c=void 0;c===void 0&&(c=r[o]),s?xa(t,o,c):co(t,o,c)}return t}var Ga=Math.max;function nd(r,e,t){return e=Ga(e===void 0?r.length-1:e,0),function(){for(var n=arguments,s=-1,i=Ga(n.length-e,0),l=Array(i);++s<i;)l[s]=n[e+s];s=-1;for(var o=Array(e+1);++s<e;)o[s]=n[s];return o[e]=t(l),Fh(r,this,o)}}function rd(r,e){return Qh(nd(r,e,lo),r+"")}var sd=9007199254740991;function uo(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=sd}function Rs(r){return r!=null&&uo(r.length)&&!va(r)}function id(r,e,t){if(!pn(t))return!1;var n=typeof e;return(n=="number"?Rs(t)&&oo(e,t.length):n=="string"&&e in t)?Ur(t[e],r):!1}function ad(r){return rd(function(e,t){var n=-1,s=t.length,i=s>1?t[s-1]:void 0,l=s>2?t[2]:void 0;for(i=r.length>3&&typeof i=="function"?(s--,i):void 0,l&&id(t[0],t[1],l)&&(i=s<3?void 0:i,s=1),e=Object(e);++n<s;){var o=t[n];o&&r(e,o,n,i)}return e})}var ld=Object.prototype;function Ea(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||ld;return r===t}function od(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}var cd="[object Arguments]";function Ka(r){return Gt(r)&&hr(r)==cd}var ho=Object.prototype,ud=ho.hasOwnProperty,hd=ho.propertyIsEnumerable,Wi=Ka((function(){return arguments})())?Ka:function(r){return Gt(r)&&ud.call(r,"callee")&&!hd.call(r,"callee")};function dd(){return!1}var fo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Wa=fo&&typeof module=="object"&&module&&!module.nodeType&&module,fd=Wa&&Wa.exports===fo,Va=fd?Dt.Buffer:void 0,pd=Va?Va.isBuffer:void 0,_r=pd||dd,gd="[object Arguments]",md="[object Array]",bd="[object Boolean]",yd="[object Date]",vd="[object Error]",xd="[object Function]",Ed="[object Map]",wd="[object Number]",Nd="[object Object]",Ad="[object RegExp]",Td="[object Set]",Cd="[object String]",Sd="[object WeakMap]",Ld="[object ArrayBuffer]",Od="[object DataView]",qd="[object Float32Array]",jd="[object Float64Array]",Id="[object Int8Array]",kd="[object Int16Array]",_d="[object Int32Array]",Rd="[object Uint8Array]",Md="[object Uint8ClampedArray]",Bd="[object Uint16Array]",Dd="[object Uint32Array]",Le={};Le[qd]=Le[jd]=Le[Id]=Le[kd]=Le[_d]=Le[Rd]=Le[Md]=Le[Bd]=Le[Dd]=!0;Le[gd]=Le[md]=Le[Ld]=Le[bd]=Le[Od]=Le[yd]=Le[vd]=Le[xd]=Le[Ed]=Le[wd]=Le[Nd]=Le[Ad]=Le[Td]=Le[Cd]=Le[Sd]=!1;function Pd(r){return Gt(r)&&uo(r.length)&&!!Le[hr(r)]}function wa(r){return function(e){return r(e)}}var po=typeof exports=="object"&&exports&&!exports.nodeType&&exports,qr=po&&typeof module=="object"&&module&&!module.nodeType&&module,$d=qr&&qr.exports===po,Ci=$d&&io.process,ir=(function(){try{var r=qr&&qr.require&&qr.require("util").types;return r||Ci&&Ci.binding&&Ci.binding("util")}catch{}})(),Qa=ir&&ir.isTypedArray,Na=Qa?wa(Qa):Pd,Fd=Object.prototype,Ud=Fd.hasOwnProperty;function go(r,e){var t=Ln(r),n=!t&&Wi(r),s=!t&&!n&&_r(r),i=!t&&!n&&!s&&Na(r),l=t||n||s||i,o=l?od(r.length,String):[],c=o.length;for(var d in r)(e||Ud.call(r,d))&&!(l&&(d=="length"||s&&(d=="offset"||d=="parent")||i&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||oo(d,c)))&&o.push(d);return o}function mo(r,e){return function(t){return r(e(t))}}var Hd=mo(Object.keys,Object),zd=Object.prototype,Gd=zd.hasOwnProperty;function Kd(r){if(!Ea(r))return Hd(r);var e=[];for(var t in Object(r))Gd.call(r,t)&&t!="constructor"&&e.push(t);return e}function Wd(r){return Rs(r)?go(r):Kd(r)}function Vd(r){var e=[];if(r!=null)for(var t in Object(r))e.push(t);return e}var Qd=Object.prototype,Zd=Qd.hasOwnProperty;function Yd(r){if(!pn(r))return Vd(r);var e=Ea(r),t=[];for(var n in r)n=="constructor"&&(e||!Zd.call(r,n))||t.push(n);return t}function bo(r){return Rs(r)?go(r,!0):Yd(r)}var Rr=In(Object,"create");function Xd(){this.__data__=Rr?Rr(null):{},this.size=0}function Jd(r){var e=this.has(r)&&delete this.__data__[r];return this.size-=e?1:0,e}var ef="__lodash_hash_undefined__",tf=Object.prototype,nf=tf.hasOwnProperty;function rf(r){var e=this.__data__;if(Rr){var t=e[r];return t===ef?void 0:t}return nf.call(e,r)?e[r]:void 0}var sf=Object.prototype,af=sf.hasOwnProperty;function lf(r){var e=this.__data__;return Rr?e[r]!==void 0:af.call(e,r)}var of="__lodash_hash_undefined__";function cf(r,e){var t=this.__data__;return this.size+=this.has(r)?0:1,t[r]=Rr&&e===void 0?of:e,this}function On(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}On.prototype.clear=Xd;On.prototype.delete=Jd;On.prototype.get=rf;On.prototype.has=lf;On.prototype.set=cf;function uf(){this.__data__=[],this.size=0}function Ms(r,e){for(var t=r.length;t--;)if(Ur(r[t][0],e))return t;return-1}var hf=Array.prototype,df=hf.splice;function ff(r){var e=this.__data__,t=Ms(e,r);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():df.call(e,t,1),--this.size,!0}function pf(r){var e=this.__data__,t=Ms(e,r);return t<0?void 0:e[t][1]}function gf(r){return Ms(this.__data__,r)>-1}function mf(r,e){var t=this.__data__,n=Ms(t,r);return n<0?(++this.size,t.push([r,e])):t[n][1]=e,this}function Vt(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}Vt.prototype.clear=uf;Vt.prototype.delete=ff;Vt.prototype.get=pf;Vt.prototype.has=gf;Vt.prototype.set=mf;var Mr=In(Dt,"Map");function bf(){this.size=0,this.__data__={hash:new On,map:new(Mr||Vt),string:new On}}function yf(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}function Bs(r,e){var t=r.__data__;return yf(e)?t[typeof e=="string"?"string":"hash"]:t.map}function vf(r){var e=Bs(this,r).delete(r);return this.size-=e?1:0,e}function xf(r){return Bs(this,r).get(r)}function Ef(r){return Bs(this,r).has(r)}function wf(r,e){var t=Bs(this,r),n=t.size;return t.set(r,e),this.size+=t.size==n?0:1,this}function kn(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}kn.prototype.clear=bf;kn.prototype.delete=vf;kn.prototype.get=xf;kn.prototype.has=Ef;kn.prototype.set=wf;function Nf(r,e){for(var t=-1,n=e.length,s=r.length;++t<n;)r[s+t]=e[t];return r}var yo=mo(Object.getPrototypeOf,Object),Af="[object Object]",Tf=Function.prototype,Cf=Object.prototype,vo=Tf.toString,Sf=Cf.hasOwnProperty,Lf=vo.call(Object);function Of(r){if(!Gt(r)||hr(r)!=Af)return!1;var e=yo(r);if(e===null)return!0;var t=Sf.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&vo.call(t)==Lf}function qf(){this.__data__=new Vt,this.size=0}function jf(r){var e=this.__data__,t=e.delete(r);return this.size=e.size,t}function If(r){return this.__data__.get(r)}function kf(r){return this.__data__.has(r)}var _f=200;function Rf(r,e){var t=this.__data__;if(t instanceof Vt){var n=t.__data__;if(!Mr||n.length<_f-1)return n.push([r,e]),this.size=++t.size,this;t=this.__data__=new kn(n)}return t.set(r,e),this.size=t.size,this}function kt(r){var e=this.__data__=new Vt(r);this.size=e.size}kt.prototype.clear=qf;kt.prototype.delete=jf;kt.prototype.get=If;kt.prototype.has=kf;kt.prototype.set=Rf;var xo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Za=xo&&typeof module=="object"&&module&&!module.nodeType&&module,Mf=Za&&Za.exports===xo,Ya=Mf?Dt.Buffer:void 0,Xa=Ya?Ya.allocUnsafe:void 0;function Eo(r,e){if(e)return r.slice();var t=r.length,n=Xa?Xa(t):new r.constructor(t);return r.copy(n),n}function Bf(r,e){for(var t=-1,n=r==null?0:r.length,s=0,i=[];++t<n;){var l=r[t];e(l,t,r)&&(i[s++]=l)}return i}function Df(){return[]}var Pf=Object.prototype,$f=Pf.propertyIsEnumerable,Ja=Object.getOwnPropertySymbols,Ff=Ja?function(r){return r==null?[]:(r=Object(r),Bf(Ja(r),function(e){return $f.call(r,e)}))}:Df;function Uf(r,e,t){var n=e(r);return Ln(r)?n:Nf(n,t(r))}function Vi(r){return Uf(r,Wd,Ff)}var Qi=In(Dt,"DataView"),Zi=In(Dt,"Promise"),Yi=In(Dt,"Set"),el="[object Map]",Hf="[object Object]",tl="[object Promise]",nl="[object Set]",rl="[object WeakMap]",sl="[object DataView]",zf=jn(Qi),Gf=jn(Mr),Kf=jn(Zi),Wf=jn(Yi),Vf=jn(Ki),yt=hr;(Qi&&yt(new Qi(new ArrayBuffer(1)))!=sl||Mr&&yt(new Mr)!=el||Zi&&yt(Zi.resolve())!=tl||Yi&&yt(new Yi)!=nl||Ki&&yt(new Ki)!=rl)&&(yt=function(r){var e=hr(r),t=e==Hf?r.constructor:void 0,n=t?jn(t):"";if(n)switch(n){case zf:return sl;case Gf:return el;case Kf:return tl;case Wf:return nl;case Vf:return rl}return e});var Qf=Object.prototype,Zf=Qf.hasOwnProperty;function Yf(r){var e=r.length,t=new r.constructor(e);return e&&typeof r[0]=="string"&&Zf.call(r,"index")&&(t.index=r.index,t.input=r.input),t}var Ls=Dt.Uint8Array;function Aa(r){var e=new r.constructor(r.byteLength);return new Ls(e).set(new Ls(r)),e}function Xf(r,e){var t=Aa(r.buffer);return new r.constructor(t,r.byteOffset,r.byteLength)}var Jf=/\w*$/;function ep(r){var e=new r.constructor(r.source,Jf.exec(r));return e.lastIndex=r.lastIndex,e}var il=dn?dn.prototype:void 0,al=il?il.valueOf:void 0;function tp(r){return al?Object(al.call(r)):{}}
vendor: 5,357 bytes, line 18
18function wo(r,e){var t=e?Aa(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.length)}var np="[object Boolean]",rp="[object Date]",sp="[object Map]",ip="[object Number]",ap="[object RegExp]",lp="[object Set]",op="[object String]",cp="[object Symbol]",up="[object ArrayBuffer]",hp="[object DataView]",dp="[object Float32Array]",fp="[object Float64Array]",pp="[object Int8Array]",gp="[object Int16Array]",mp="[object Int32Array]",bp="[object Uint8Array]",yp="[object Uint8ClampedArray]",vp="[object Uint16Array]",xp="[object Uint32Array]";function Ep(r,e,t){var n=r.constructor;switch(e){case up:return Aa(r);case np:case rp:return new n(+r);case hp:return Xf(r);case dp:case fp:case pp:case gp:case mp:case bp:case yp:case vp:case xp:return wo(r,t);case sp:return new n;case ip:case op:return new n(r);case ap:return ep(r);case lp:return new n;case cp:return tp(r)}}function No(r){return typeof r.constructor=="function"&&!Ea(r)?$h(yo(r)):{}}var wp="[object Map]";function Np(r){return Gt(r)&&yt(r)==wp}var ll=ir&&ir.isMap,Ap=ll?wa(ll):Np,Tp="[object Set]";function Cp(r){return Gt(r)&&yt(r)==Tp}var ol=ir&&ir.isSet,Sp=ol?wa(ol):Cp,Lp=1,Ao="[object Arguments]",Op="[object Array]",qp="[object Boolean]",jp="[object Date]",Ip="[object Error]",To="[object Function]",kp="[object GeneratorFunction]",_p="[object Map]",Rp="[object Number]",Co="[object Object]",Mp="[object RegExp]",Bp="[object Set]",Dp="[object String]",Pp="[object Symbol]",$p="[object WeakMap]",Fp="[object ArrayBuffer]",Up="[object DataView]",Hp="[object Float32Array]",zp="[object Float64Array]",Gp="[object Int8Array]",Kp="[object Int16Array]",Wp="[object Int32Array]",Vp="[object Uint8Array]",Qp="[object Uint8ClampedArray]",Zp="[object Uint16Array]",Yp="[object Uint32Array]",Se={};Se[Ao]=Se[Op]=Se[Fp]=Se[Up]=Se[qp]=Se[jp]=Se[Hp]=Se[zp]=Se[Gp]=Se[Kp]=Se[Wp]=Se[_p]=Se[Rp]=Se[Co]=Se[Mp]=Se[Bp]=Se[Dp]=Se[Pp]=Se[Vp]=Se[Qp]=Se[Zp]=Se[Yp]=!0;Se[Ip]=Se[To]=Se[$p]=!1;function Es(r,e,t,n,s,i){var l,o=e&Lp;if(l!==void 0)return l;if(!pn(r))return r;var c=Ln(r);if(c)l=Yf(r);else{var d=yt(r),p=d==To||d==kp;if(_r(r))return Eo(r,o);if(d==Co||d==Ao||p&&!s)l=p?{}:No(r);else{if(!Se[d])return s?r:{};l=Ep(r,d,o)}}i||(i=new kt);var x=i.get(r);if(x)return x;i.set(r,l),Sp(r)?r.forEach(function(y){l.add(Es(y,e,t,y,r,i))}):Ap(r)&&r.forEach(function(y,E){l.set(E,Es(y,e,t,E,r,i))});var f=Vi,m=c?void 0:f(r);return Zh(m||r,function(y,E){m&&(E=y,y=r[E]),co(l,E,Es(y,e,t,E,r,i))}),l}var Xp=1,Jp=4;function tr(r){return Es(r,Xp|Jp)}var eg="__lodash_hash_undefined__";function tg(r){return this.__data__.set(r,eg),this}function ng(r){return this.__data__.has(r)}function Os(r){var e=-1,t=r==null?0:r.length;for(this.__data__=new kn;++e<t;)this.add(r[e])}Os.prototype.add=Os.prototype.push=tg;Os.prototype.has=ng;function rg(r,e){for(var t=-1,n=r==null?0:r.length;++t<n;)if(e(r[t],t,r))return!0;return!1}function sg(r,e){return r.has(e)}var ig=1,ag=2;function So(r,e,t,n,s,i){var l=t&ig,o=r.length,c=e.length;if(o!=c&&!(l&&c>o))return!1;var d=i.get(r),p=i.get(e);if(d&&p)return d==e&&p==r;var x=-1,f=!0,m=t&ag?new Os:void 0;for(i.set(r,e),i.set(e,r);++x<o;){var y=r[x],E=e[x];if(n)var w=l?n(E,y,x,e,r,i):n(y,E,x,r,e,i);if(w!==void 0){if(w)continue;f=!1;break}if(m){if(!rg(e,function(S,I){if(!sg(m,I)&&(y===S||s(y,S,t,n,i)))return m.push(I)})){f=!1;break}}else if(!(y===E||s(y,E,t,n,i))){f=!1;break}}return i.delete(r),i.delete(e),f}function lg(r){var e=-1,t=Array(r.size);return r.forEach(function(n,s){t[++e]=[s,n]}),t}function og(r){var e=-1,t=Array(r.size);return r.forEach(function(n){t[++e]=n}),t}var cg=1,ug=2,hg="[object Boolean]",dg="[object Date]",fg="[object Error]",pg="[object Map]",gg="[object Number]",mg="[object RegExp]",bg="[object Set]",yg="[object String]",vg="[object Symbol]",xg="[object ArrayBuffer]",Eg="[object DataView]",cl=dn?dn.prototype:void 0,Si=cl?cl.valueOf:void 0;function wg(r,e,t,n,s,i,l){switch(t){case Eg:if(r.byteLength!=e.byteLength||r.byteOffset!=e.byteOffset)return!1;r=r.buffer,e=e.buffer;case xg:return!(r.byteLength!=e.byteLength||!i(new Ls(r),new Ls(e)));case hg:case dg:case gg:return Ur(+r,+e);case fg:return r.name==e.name&&r.message==e.message;case mg:case yg:return r==e+"";case pg:var o=lg;case bg:var c=n&cg;if(o||(o=og),r.size!=e.size&&!c)return!1;var d=l.get(r);if(d)return d==e;n|=ug,l.set(r,e);var p=So(o(r),o(e),n,s,i,l);return l.delete(r),p;case vg:if(Si)return Si.call(r)==Si.call(e)}return!1}var Ng=1,Ag=Object.prototype,Tg=Ag.hasOwnProperty;function Cg(r,e,t,n,s,i){var l=t&Ng,o=Vi(r),c=o.length,d=Vi(e),p=d.length;if(c!=p&&!l)return!1;for(var x=c;x--;){var f=o[x];if(!(l?f in e:Tg.call(e,f)))return!1}var m=i.get(r),y=i.get(e);if(m&&y)return m==e&&y==r;var E=!0;i.set(r,e),i.set(e,r);for(var w=l;++x<c;){f=o[x];var S=r[f],I=e[f];if(n)var M=l?n(I,S,f,e,r,i):n(S,I,f,r,e,i);if(!(M===void 0?S===I||s(S,I,t,n,i):M)){E=!1;break}w||(w=f=="constructor")}if(E&&!w){var H=r.constructor,L=e.constructor;H!=L&&"constructor"in r&&"constructor"in e&&!(typeof H=="function"&&H instanceof H&&typeof L=="function"&&L instanceof L)&&(E=!1)}return i.delete(r),i.delete(e),E}var Sg=1,ul="[object Arguments]",hl="[object Array]",us="[object Object]",Lg=Object.prototype,dl=Lg.hasOwnProperty;function Og(r,e,t,n,s,i){var l=Ln(r),o=Ln(e),c=l?hl:yt(r),d=o?hl:yt(e);c=c==ul?us:c,d=d==ul?us:d;var p=c==us,x=d==us,f=c==d;if(f&&_r(r)){if(!_r(e))return!1;l=!0,p=!1}
18if(f&&!p)return i||(i=new kt),l||Na(r)?So(r,e,t,n,s,i):wg(r,e,c,t,n,s,i);if(!(t&Sg)){var m=p&&dl.call(r,"__wrapped__"),y=x&&dl.call(e,"__wrapped__");if(m||y){var E=m?r.value():r,w=y?e.value():e;return i||(i=new kt),s(E,w,t,n,i)}}return f?(i||(i=new kt),Cg(r,e,t,n,s,i)):!1}function Lo(r,e,t,n,s){return r===e?!0:r==null||e==null||!Gt(r)&&!Gt(e)?r!==r&&e!==e:Og(r,e,t,n,Lo,s)}function qg(r){return function(e,t,n){for(var s=-1,i=Object(e),l=n(e),o=l.length;o--;){var c=l[++s];if(t(i[c],c,i)===!1)break}return e}}var jg=qg();function Xi(r,e,t){(t!==void 0&&!Ur(r[e],t)||t===void 0&&!(e in r))&&xa(r,e,t)}function Ig(r){return Gt(r)&&Rs(r)}function Ji(r,e){if(!(e==="constructor"&&typeof r[e]=="function")&&e!="__proto__")return r[e]}function kg(r){return td(r,bo(r))}function _g(r,e,t,n,s,i,l){var o=Ji(r,t),c=Ji(e,t),d=l.get(c);if(d){Xi(r,t,d);return}var p=i?i(o,c,t+"",r,e,l):void 0,x=p===void 0;if(x){var f=Ln(c),m=!f&&_r(c),y=!f&&!m&&Na(c);p=c,f||m||y?Ln(o)?p=o:Ig(o)?p=Uh(o):m?(x=!1,p=Eo(c,!0)):y?(x=!1,p=wo(c,!0)):p=[]:Of(c)||Wi(c)?(p=o,Wi(o)?p=kg(o):(!pn(o)||va(o))&&(p=No(c))):x=!1}x&&(l.set(c,p),s(p,c,n,i,l),l.delete(c)),Xi(r,t,p)}function Oo(r,e,t,n,s){r!==e&&jg(e,function(i,l){if(s||(s=new kt),pn(i))_g(r,e,l,t,Oo,n,s);else{var o=n?n(Ji(r,l),i,l+"",r,e,s):void 0;o===void 0&&(o=i),Xi(r,l,o)}},bo)}function ln(r,e){return Lo(r,e)}var hn=ad(function(r,e,t){Oo(r,e,t)}),Q=(r=>(r[r.TYPE=3]="TYPE",r[r.LEVEL=12]="LEVEL",r[r.ATTRIBUTE=13]="ATTRIBUTE",r[r.BLOT=14]="BLOT",r[r.INLINE=7]="INLINE",r[r.BLOCK=11]="BLOCK",r[r.BLOCK_BLOT=10]="BLOCK_BLOT",r[r.INLINE_BLOT=6]="INLINE_BLOT",r[r.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",r[r.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",r[r.ANY=15]="ANY",r))(Q||{});class Mt{constructor(e,t,n={}){this.attrName=e,this.keyName=t;const s=Q.TYPE&Q.ATTRIBUTE;this.scope=n.scope!=null?n.scope&Q.LEVEL|s:Q.ATTRIBUTE,n.whitelist!=null&&(this.whitelist=n.whitelist)}static keys(e){return Array.from(e.attributes).map(t=>t.name)}add(e,t){return this.canAdd(e,t)?(e.setAttribute(this.keyName,t),!0):!1}canAdd(e,t){return this.whitelist==null?!0:typeof t=="string"?this.whitelist.indexOf(t.replace(/["']/g,""))>-1:this.whitelist.indexOf(t)>-1}remove(e){e.removeAttribute(this.keyName)}value(e){const t=e.getAttribute(this.keyName);return this.canAdd(e,t)&&t?t:""}}class nr extends Error{constructor(e){e="[Parchment] "+e,super(e),this.message=e,this.name=this.constructor.name}}const qo=class ea{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(e,t=!1){if(e==null)return null;if(this.blots.has(e))return this.blots.get(e)||null;if(t){let n=null;try{n=e.parentNode}catch{return null}return this.find(n,t)}return null}create(e,t,n){const s=this.query(t);if(s==null)throw new nr(`Unable to create ${t} blot`);const i=s,l=t instanceof Node||t.nodeType===Node.TEXT_NODE?t:i.create(n),o=new i(e,l,n);return ea.blots.set(o.domNode,o),o}find(e,t=!1){return ea.find(e,t)}query(e,t=Q.ANY){let n;return typeof e=="string"?n=this.types[e]||this.attributes[e]:e instanceof Text||e.nodeType===Node.TEXT_NODE?n=this.types.text:typeof e=="number"?e&Q.LEVEL&Q.BLOCK?n=this.types.block:e&Q.LEVEL&Q.INLINE&&(n=this.types.inline):e instanceof Element&&((e.getAttribute("class")||"").split(/\s+/).some(s=>(n=this.classes[s],!!n)),n=n||this.tags[e.tagName]),n==null?null:"scope"in n&&t&Q.LEVEL&n.scope&&t&Q.TYPE&n.scope?n:null}register(...e){return e.map(t=>{const n="blotName"in t,s="attrName"in t;if(!n&&!s)throw new nr("Invalid definition");if(n&&t.blotName==="abstract")throw new nr("Cannot register abstract class");const i=n?t.blotName:s?t.attrName:void 0;return this.types[i]=t,s?typeof t.keyName=="string"&&(this.attributes[t.keyName]=t):n&&(t.className&&(this.classes[t.className]=t),t.tagName&&(Array.isArray(t.tagName)?t.tagName=t.tagName.map(l=>l.toUpperCase()):t.tagName=t.tagName.toUpperCase(),(Array.isArray(t.tagName)?t.tagName:[t.tagName]).forEach(l=>{(this.tags[l]==null||t.className==null)&&(this.tags[l]=t)}))),t})}};qo.blots=new WeakMap;let ar=qo;function fl(r,e){return(r.getAttribute("class")||"").split(/\s+/).filter(t=>t.indexOf(`${e}-`)===0)}class Rg extends Mt{static keys(e){return(e.getAttribute("class")||"").split(/\s+/).map(t=>t.split("-").slice(0,-1).join("-"))}add(e,t){return this.canAdd(e,t)?(this.remove(e),e.classList.add(`${this.keyName}-${t}`),!0):!1}remove(e){fl(e,this.keyName).forEach(t=>{e.classList.remove(t)}),e.classList.length===0&&e.removeAttribute("class")}value(e){const t=(fl(e,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(e,t)?t:""}}const Nt=Rg;function Li(r){const e=r.split("-"),t=e.slice(1).map(n=>n[0].toUpperCase()+n.slice(1)).join("");return e[0]+t}class Mg extends Mt{static keys(e){return(e.getAttribute("style")||"").split(";").map(t=>t.split(":")[0].trim())}add(e,t){return this.canAdd(e,t)?(e.style[Li(this.keyName)]=t,!0):!1}remove(e){e.style[Li(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")}value(e){const t=e.style[Li(this.keyName)];return this.canAdd(e,t)?t:""}}const gn=Mg;class Bg{constructor(e){this.attributes={},this.domNode=e,this.build()}attribute(e,t){t?e.add(this.domNode,t)&&(e.value(this.domNode)!=null?this.attributes[e.attrName]=e:delete this.attributes[e.attrName]):(e.remove(this.domNode),delete this.attributes[e.attrName])}build(){this.attributes={};const e=ar.find(this.domNode);
vendor: 13,692 bytes, line 18
18if(e==null)return;const t=Mt.keys(this.domNode),n=Nt.keys(this.domNode),s=gn.keys(this.domNode);t.concat(n).concat(s).forEach(i=>{const l=e.scroll.query(i,Q.ATTRIBUTE);l instanceof Mt&&(this.attributes[l.attrName]=l)})}copy(e){Object.keys(this.attributes).forEach(t=>{const n=this.attributes[t].value(this.domNode);e.format(t,n)})}move(e){this.copy(e),Object.keys(this.attributes).forEach(t=>{this.attributes[t].remove(this.domNode)}),this.attributes={}}values(){return Object.keys(this.attributes).reduce((e,t)=>(e[t]=this.attributes[t].value(this.domNode),e),{})}}const Ds=Bg,jo=class{constructor(e,t){this.scroll=e,this.domNode=t,ar.blots.set(t,this),this.prev=null,this.next=null}static create(e){if(this.tagName==null)throw new nr("Blot definition missing tagName");let t,n;return Array.isArray(this.tagName)?(typeof e=="string"?(n=e.toUpperCase(),parseInt(n,10).toString()===n&&(n=parseInt(n,10))):typeof e=="number"&&(n=e),typeof n=="number"?t=document.createElement(this.tagName[n-1]):n&&this.tagName.indexOf(n)>-1?t=document.createElement(n):t=document.createElement(this.tagName[0])):t=document.createElement(this.tagName),this.className&&t.classList.add(this.className),t}get statics(){return this.constructor}attach(){}clone(){const e=this.domNode.cloneNode(!1);return this.scroll.create(e)}detach(){this.parent!=null&&this.parent.removeChild(this),ar.blots.delete(this.domNode)}deleteAt(e,t){this.isolate(e,t).remove()}formatAt(e,t,n,s){const i=this.isolate(e,t);if(this.scroll.query(n,Q.BLOT)!=null&&s)i.wrap(n,s);else if(this.scroll.query(n,Q.ATTRIBUTE)!=null){const l=this.scroll.create(this.statics.scope);i.wrap(l),l.format(n,s)}}insertAt(e,t,n){const s=n==null?this.scroll.create("text",t):this.scroll.create(t,n),i=this.split(e);this.parent.insertBefore(s,i||void 0)}isolate(e,t){const n=this.split(e);if(n==null)throw new Error("Attempt to isolate at end");return n.split(t),n}length(){return 1}offset(e=this.parent){return this.parent==null||this===e?0:this.parent.children.offset(this)+this.parent.offset(e)}optimize(e){this.statics.requiredContainer&&!(this.parent instanceof this.statics.requiredContainer)&&this.wrap(this.statics.requiredContainer.blotName)}remove(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()}replaceWith(e,t){const n=typeof e=="string"?this.scroll.create(e,t):e;return this.parent!=null&&(this.parent.insertBefore(n,this.next||void 0),this.remove()),n}split(e,t){return e===0?this:this.next}update(e,t){}wrap(e,t){const n=typeof e=="string"?this.scroll.create(e,t):e;if(this.parent!=null&&this.parent.insertBefore(n,this.next||void 0),typeof n.appendChild!="function")throw new nr(`Cannot wrap ${e}`);return n.appendChild(this),n}};jo.blotName="abstract";let Io=jo;const ko=class extends Io{static value(e){return!0}index(e,t){return this.domNode===e||this.domNode.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(t,1):-1}position(e,t){let n=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return e>0&&(n+=1),[this.parent.domNode,n]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};ko.scope=Q.INLINE_BLOT;let Dg=ko;const Ve=Dg;class Pg{constructor(){this.head=null,this.tail=null,this.length=0}append(...e){if(this.insertBefore(e[0],null),e.length>1){const t=e.slice(1);this.append(...t)}}at(e){const t=this.iterator();let n=t();for(;n&&e>0;)e-=1,n=t();return n}contains(e){const t=this.iterator();let n=t();for(;n;){if(n===e)return!0;n=t()}return!1}indexOf(e){const t=this.iterator();let n=t(),s=0;for(;n;){if(n===e)return s;s+=1,n=t()}return-1}insertBefore(e,t){e!=null&&(this.remove(e),e.next=t,t!=null?(e.prev=t.prev,t.prev!=null&&(t.prev.next=e),t.prev=e,t===this.head&&(this.head=e)):this.tail!=null?(this.tail.next=e,e.prev=this.tail,this.tail=e):(e.prev=null,this.head=this.tail=e),this.length+=1)}offset(e){let t=0,n=this.head;for(;n!=null;){if(n===e)return t;t+=n.length(),n=n.next}return-1}remove(e){this.contains(e)&&(e.prev!=null&&(e.prev.next=e.next),e.next!=null&&(e.next.prev=e.prev),e===this.head&&(this.head=e.next),e===this.tail&&(this.tail=e.prev),this.length-=1)}iterator(e=this.head){return()=>{const t=e;return e!=null&&(e=e.next),t}}find(e,t=!1){const n=this.iterator();let s=n();for(;s;){const i=s.length();if(e<i||t&&e===i&&(s.next==null||s.next.length()!==0))return[s,e];e-=i,s=n()}return[null,0]}forEach(e){const t=this.iterator();let n=t();for(;n;)e(n),n=t()}forEachAt(e,t,n){if(t<=0)return;const[s,i]=this.find(e);let l=e-i;const o=this.iterator(s);let c=o();for(;c&&l<e+t;){const d=c.length();e>l?n(c,e-l,Math.min(t,l+d-e)):n(c,0,Math.min(d,e+t-l)),l+=d,c=o()}}map(e){return this.reduce((t,n)=>(t.push(e(n)),t),[])}reduce(e,t){const n=this.iterator();let s=n();for(;s;)t=e(t,s),s=n();return t}}function pl(r,e){const t=e.find(r);if(t)return t;try{return e.create(r)}catch{const n=e.create(Q.INLINE);return Array.from(r.childNodes).forEach(s=>{n.domNode.appendChild(s)}),r.parentNode&&r.parentNode.replaceChild(n.domNode,r),n.attach(),n}}const _o=class rn extends Io{constructor(e,t){super(e,t),this.uiNode=null,this.build()}appendChild(e){this.insertBefore(e)}attach(){super.attach(),this.children.forEach(e=>{e.attach()})}attachUI(e){this.uiNode!=null&&this.uiNode.remove(),this.uiNode=e,rn.uiClass&&this.uiNode.classList.add(rn.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new Pg,Array.from(this.domNode.childNodes).filter(e=>e!==this.uiNode).reverse().forEach(e=>{try{const t=pl(e,this.scroll);this.insertBefore(t,this.children.head||void 0)}catch(t){if(t instanceof nr)return;throw t}})}deleteAt(e,t){if(e===0&&t===this.length())return this.remove();this.children.forEachAt(e,t,(n,s,i)=>{n.deleteAt(s,i)})}descendant(e,t=0){const[n,s]=this.children.find(t);return e.blotName==null&&e(n)||e.blotName!=null&&n instanceof e?[n,s]:n instanceof rn?n.descendant(e,s):[null,-1]}descendants(e,t=0,n=Number.MAX_VALUE){let s=[],i=n;return this.children.forEachAt(t,n,(l,o,c)=>{(e.blotName==null&&e(l)||e.blotName!=null&&l instanceof e)&&s.push(l),l instanceof rn&&(s=s.concat(l.descendants(e,o,i))),i-=c}),s}detach(){this.children.forEach(e=>{e.detach()}),super.detach()}enforceAllowedChildren(){let e=!1;this.children.forEach(t=>{e||this.statics.allowedChildren.some(n=>t instanceof n)||(t.statics.scope===Q.BLOCK_BLOT?(t.next!=null&&this.splitAfter(t),t.prev!=null&&this.splitAfter(t.prev),t.parent.unwrap(),e=!0):t instanceof rn?t.unwrap():t.remove())})}formatAt(e,t,n,s){this.children.forEachAt(e,t,(i,l,o)=>{i.formatAt(l,o,n,s)})}insertAt(e,t,n){const[s,i]=this.children.find(e);if(s)s.insertAt(i,t,n);else{const l=n==null?this.scroll.create("text",t):this.scroll.create(t,n);this.appendChild(l)}}insertBefore(e,t){e.parent!=null&&e.parent.children.remove(e);let n=null;this.children.insertBefore(e,t||null),e.parent=this,t!=null&&(n=t.domNode),(this.domNode.parentNode!==e.domNode||this.domNode.nextSibling!==n)&&this.domNode.insertBefore(e.domNode,n),e.attach()}length(){return this.children.reduce((e,t)=>e+t.length(),0)}moveChildren(e,t){this.children.forEach(n=>{e.insertBefore(n,t)})}optimize(e){if(super.optimize(e),this.enforceAllowedChildren(),this.uiNode!=null&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),this.children.length===0)if(this.statics.defaultChild!=null){const t=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(t)}else this.remove()}path(e,t=!1){const[n,s]=this.children.find(e,t),i=[[this,e]];return n instanceof rn?i.concat(n.path(s,t)):(n!=null&&i.push([n,s]),i)}removeChild(e){this.children.remove(e)}replaceWith(e,t){const n=typeof e=="string"?this.scroll.create(e,t):e;return n instanceof rn&&this.moveChildren(n),super.replaceWith(n)}split(e,t=!1){if(!t){if(e===0)return this;if(e===this.length())return this.next}const n=this.clone();return this.parent&&this.parent.insertBefore(n,this.next||void 0),this.children.forEachAt(e,this.length(),(s,i,l)=>{const o=s.split(i,t);o!=null&&n.appendChild(o)}),n}splitAfter(e){const t=this.clone();for(;e.next!=null;)t.appendChild(e.next);return this.parent&&this.parent.insertBefore(t,this.next||void 0),t}unwrap(){this.parent&&this.moveChildren(this.parent,this.next||void 0),this.remove()}update(e,t){const n=[],s=[];e.forEach(i=>{i.target===this.domNode&&i.type==="childList"&&(n.push(...i.addedNodes),s.push(...i.removedNodes))}),s.forEach(i=>{if(i.parentNode!=null&&i.tagName!=="IFRAME"&&document.body.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const l=this.scroll.find(i);l!=null&&(l.domNode.parentNode==null||l.domNode.parentNode===this.domNode)&&l.detach()}),n.filter(i=>i.parentNode===this.domNode&&i!==this.uiNode).sort((i,l)=>i===l?0:i.compareDocumentPosition(l)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1).forEach(i=>{let l=null;i.nextSibling!=null&&(l=this.scroll.find(i.nextSibling));const o=pl(i,this.scroll);(o.next!==l||o.next==null)&&(o.parent!=null&&o.parent.removeChild(this),this.insertBefore(o,l||void 0))}),this.enforceAllowedChildren()}};_o.uiClass="";let $g=_o;const Et=$g;function Fg(r,e){if(Object.keys(r).length!==Object.keys(e).length)return!1;for(const t in r)if(r[t]!==e[t])return!1;return!0}const Qn=class Zn extends Et{static create(e){return super.create(e)}static formats(e,t){const n=t.query(Zn.blotName);if(!(n!=null&&e.tagName===n.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(e,t){super(e,t),this.attributes=new Ds(this.domNode)}format(e,t){if(e===this.statics.blotName&&!t)this.children.forEach(n=>{n instanceof Zn||(n=n.wrap(Zn.blotName,!0)),this.attributes.copy(n)}),this.unwrap();else{const n=this.scroll.query(e,Q.INLINE);if(n==null)return;n instanceof Mt?this.attributes.attribute(n,t):t&&(e!==this.statics.blotName||this.formats()[e]!==t)&&this.replaceWith(e,t)}}formats(){const e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return t!=null&&(e[this.statics.blotName]=t),e}formatAt(e,t,n,s){this.formats()[n]!=null||this.scroll.query(n,Q.ATTRIBUTE)?this.isolate(e,t).format(n,s):super.formatAt(e,t,n,s)}optimize(e){super.optimize(e);const t=this.formats();if(Object.keys(t).length===0)return this.unwrap();const n=this.next;n instanceof Zn&&n.prev===this&&Fg(t,n.formats())&&(n.moveChildren(this),n.remove())}replaceWith(e,t){const n=super.replaceWith(e,t);return this.attributes.copy(n),n}update(e,t){super.update(e,t),e.some(n=>n.target===this.domNode&&n.type==="attributes")&&this.attributes.build()}wrap(e,t){const n=super.wrap(e,t);return n instanceof Zn&&this.attributes.move(n),n}};Qn.allowedChildren=[Qn,Ve],Qn.blotName="inline",Qn.scope=Q.INLINE_BLOT,Qn.tagName="SPAN";let Ug=Qn;const Ta=Ug,Yn=class ta extends Et{static create(e){return super.create(e)}static formats(e,t){const n=t.query(ta.blotName);if(!(n!=null&&e.tagName===n.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(e,t){super(e,t),this.attributes=new Ds(this.domNode)}format(e,t){const n=this.scroll.query(e,Q.BLOCK);n!=null&&(n instanceof Mt?this.attributes.attribute(n,t):e===this.statics.blotName&&!t?this.replaceWith(ta.blotName):t&&(e!==this.statics.blotName||this.formats()[e]!==t)&&this.replaceWith(e,t))}formats(){const e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return t!=null&&(e[this.statics.blotName]=t),e}formatAt(e,t,n,s){this.scroll.query(n,Q.BLOCK)!=null?this.format(n,s):super.formatAt(e,t,n,s)}insertAt(e,t,n){if(n==null||this.scroll.query(t,Q.INLINE)!=null)super.insertAt(e,t,n);else{const s=this.split(e);if(s!=null){const i=this.scroll.create(t,n);s.parent.insertBefore(i,s)}else throw new Error("Attempt to insertAt after block boundaries")}}replaceWith(e,t){const n=super.replaceWith(e,t);return this.attributes.copy(n),n}update(e,t){super.update(e,t),e.some(n=>n.target===this.domNode&&n.type==="attributes")&&this.attributes.build()}};Yn.blotName="block",Yn.scope=Q.BLOCK_BLOT,Yn.tagName="P",Yn.allowedChildren=[Ta,Yn,Ve];let Hg=Yn;const Br=Hg,na=class extends Et{checkMerge(){return this.next!==null&&this.next.statics.blotName===this.statics.blotName}deleteAt(e,t){super.deleteAt(e,t),this.enforceAllowedChildren()}formatAt(e,t,n,s){super.formatAt(e,t,n,s),this.enforceAllowedChildren()}insertAt(e,t,n){super.insertAt(e,t,n),this.enforceAllowedChildren()}optimize(e){super.optimize(e),this.children.length>0&&this.next!=null&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};na.blotName="container",na.scope=Q.BLOCK_BLOT;let zg=na;const Ps=zg;class Gg extends Ve{static formats(e,t){}format(e,t){super.formatAt(0,this.length(),e,t)}formatAt(e,t,n,s){e===0&&t===this.length()?this.format(n,s):super.formatAt(e,t,n,s)}formats(){return this.statics.formats(this.domNode,this.scroll)}}const st=Gg,Kg={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},Wg=100,Xn=class extends Et{constructor(e,t){super(null,t),this.registry=e,this.scroll=this,this.build(),this.observer=new MutationObserver(n=>{this.update(n)}),this.observer.observe(this.domNode,Kg),this.attach()}create(e,t){return this.registry.create(this,e,t)}find(e,t=!1){const n=this.registry.find(e,t);return n?n.scroll===this?n:t?this.find(n.scroll.domNode.parentNode,!0):null:null}query(e,t=Q.ANY){return this.registry.query(e,t)}register(...e){return this.registry.register(...e)}build(){this.scroll!=null&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(e,t){this.update(),e===0&&t===this.length()?this.children.forEac
vendor: 13,105 bytes, line 18
18h(n=>{n.remove()}):super.deleteAt(e,t)}formatAt(e,t,n,s){this.update(),super.formatAt(e,t,n,s)}insertAt(e,t,n){this.update(),super.insertAt(e,t,n)}optimize(e=[],t={}){super.optimize(t);const n=t.mutationsMap||new WeakMap;let s=Array.from(this.observer.takeRecords());for(;s.length>0;)e.push(s.pop());const i=(c,d=!0)=>{c==null||c===this||c.domNode.parentNode!=null&&(n.has(c.domNode)||n.set(c.domNode,[]),d&&i(c.parent))},l=c=>{n.has(c.domNode)&&(c instanceof Et&&c.children.forEach(l),n.delete(c.domNode),c.optimize(t))};let o=e;for(let c=0;o.length>0;c+=1){if(c>=Wg)throw new Error("[Parchment] Maximum optimize iterations reached");for(o.forEach(d=>{const p=this.find(d.target,!0);p!=null&&(p.domNode===d.target&&(d.type==="childList"?(i(this.find(d.previousSibling,!1)),Array.from(d.addedNodes).forEach(x=>{const f=this.find(x,!1);i(f,!1),f instanceof Et&&f.children.forEach(m=>{i(m,!1)})})):d.type==="attributes"&&i(p.prev)),i(p))}),this.children.forEach(l),o=Array.from(this.observer.takeRecords()),s=o.slice();s.length>0;)e.push(s.pop())}}update(e,t={}){e=e||this.observer.takeRecords();const n=new WeakMap;e.map(s=>{const i=this.find(s.target,!0);return i==null?null:n.has(i.domNode)?(n.get(i.domNode).push(s),null):(n.set(i.domNode,[s]),i)}).forEach(s=>{s!=null&&s!==this&&n.has(s.domNode)&&s.update(n.get(s.domNode)||[],t)}),t.mutationsMap=n,n.has(this.domNode)&&super.update(n.get(this.domNode),t),this.optimize(e,t)}};Xn.blotName="scroll",Xn.defaultChild=Br,Xn.allowedChildren=[Br,Ps],Xn.scope=Q.BLOCK_BLOT,Xn.tagName="DIV";let Vg=Xn;const Ca=Vg,ra=class Ro extends Ve{static create(e){return document.createTextNode(e)}static value(e){return e.data}constructor(e,t){super(e,t),this.text=this.statics.value(this.domNode)}deleteAt(e,t){this.domNode.data=this.text=this.text.slice(0,e)+this.text.slice(e+t)}index(e,t){return this.domNode===e?t:-1}insertAt(e,t,n){n==null?(this.text=this.text.slice(0,e)+t+this.text.slice(e),this.domNode.data=this.text):super.insertAt(e,t,n)}length(){return this.text.length}optimize(e){super.optimize(e),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof Ro&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())}position(e,t=!1){return[this.domNode,e]}split(e,t=!1){if(!t){if(e===0)return this;if(e===this.length())return this.next}const n=this.scroll.create(this.domNode.splitText(e));return this.parent.insertBefore(n,this.next||void 0),this.text=this.statics.value(this.domNode),n}update(e,t){e.some(n=>n.type==="characterData"&&n.target===this.domNode)&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};ra.blotName="text",ra.scope=Q.INLINE_BLOT;let Qg=ra;const qs=Qg,Zg=Object.freeze(Object.defineProperty({__proto__:null,Attributor:Mt,AttributorStore:Ds,BlockBlot:Br,ClassAttributor:Nt,ContainerBlot:Ps,EmbedBlot:st,InlineBlot:Ta,LeafBlot:Ve,ParentBlot:Et,Registry:ar,Scope:Q,ScrollBlot:Ca,StyleAttributor:gn,TextBlot:qs},Symbol.toStringTag,{value:"Module"}));var hs={exports:{}},Oi,gl;function Yg(){if(gl)return Oi;gl=1;var r=-1,e=1,t=0;function n(g,A,v,j,O){if(g===A)return g?[[t,g]]:[];if(v!=null){var T=fe(g,A,v);if(T)return T}var q=o(g,A),B=g.substring(0,q);g=g.substring(q),A=A.substring(q),q=d(g,A);var D=g.substring(g.length-q);g=g.substring(0,g.length-q),A=A.substring(0,A.length-q);var _=s(g,A);return B&&_.unshift([t,B]),D&&_.push([t,D]),I(_,O),j&&x(_),_}function s(g,A){var v;if(!g)return[[e,A]];if(!A)return[[r,g]];var j=g.length>A.length?g:A,O=g.length>A.length?A:g,T=j.indexOf(O);if(T!==-1)return v=[[e,j.substring(0,T)],[t,O],[e,j.substring(T+O.length)]],g.length>A.length&&(v[0][0]=v[2][0]=r),v;if(O.length===1)return[[r,g],[e,A]];var q=p(g,A);if(q){var B=q[0],D=q[1],_=q[2],Z=q[3],Y=q[4],te=n(B,_),X=n(D,Z);return te.concat([[t,Y]],X)}return i(g,A)}function i(g,A){for(var v=g.length,j=A.length,O=Math.ceil((v+j)/2),T=O,q=2*O,B=new Array(q),D=new Array(q),_=0;_<q;_++)B[_]=-1,D[_]=-1;B[T+1]=0,D[T+1]=0;for(var Z=v-j,Y=Z%2!==0,te=0,X=0,R=0,pe=0,oe=0;oe<O;oe++){for(var ee=-oe+te;ee<=oe-X;ee+=2){var ue=T+ee,de;ee===-oe||ee!==oe&&B[ue-1]<B[ue+1]?de=B[ue+1]:de=B[ue-1]+1;for(var se=de-ee;de<v&&se<j&&g.charAt(de)===A.charAt(se);)de++,se++;if(B[ue]=de,de>v)X+=2;else if(se>j)te+=2;else if(Y){var ie=T+Z-ee;if(ie>=0&&ie<q&&D[ie]!==-1){var ce=v-D[ie];if(de>=ce)return l(g,A,de,se)}}}for(var Ne=-oe+R;Ne<=oe-pe;Ne+=2){var ie=T+Ne,ce;Ne===-oe||Ne!==oe&&D[ie-1]<D[ie+1]?ce=D[ie+1]:ce=D[ie-1]+1;for(var xe=ce-Ne;ce<v&&xe<j&&g.charAt(v-ce-1)===A.charAt(j-xe-1);)ce++,xe++;if(D[ie]=ce,ce>v)pe+=2;else if(xe>j)R+=2;else if(!Y){var ue=T+Z-Ne;if(ue>=0&&ue<q&&B[ue]!==-1){var de=B[ue],se=T+de-ue;if(ce=v-ce,de>=ce)return l(g,A,de,se)}}}}return[[r,g],[e,A]]}function l(g,A,v,j){var O=g.substring(0,v),T=A.substring(0,j),q=g.substring(v),B=A.substring(j),D=n(O,T),_=n(q,B);return D.concat(_)}function o(g,A){if(!g||!A||g.charAt(0)!==A.charAt(0))return 0;for(var v=0,j=Math.min(g.length,A.length),O=j,T=0;v<O;)g.substring(T,O)==A.substring(T,O)?(v=O,T=v):j=O,O=Math.floor((j-v)/2+v);return M(g.charCodeAt(O-1))&&O--,O}function c(g,A){var v=g.length,j=A.length;if(v==0||j==0)return 0;v>j?g=g.substring(v-j):v<j&&(A=A.substring(0,v));var O=Math.min(v,j);if(g==A)return O;for(var T=0,q=1;;){var B=g.substring(O-q),D=A.indexOf(B);if(D==-1)return T;q+=D,(D==0||g.substring(O-q)==A.substring(0,q))&&(T=q,q++)}}function d(g,A){if(!g||!A||g.slice(-1)!==A.slice(-1))return 0;for(var v=0,j=Math.min(g.length,A.length),O=j,T=0;v<O;)g.substring(g.length-O,g.length-T)==A.substring(A.length-O,A.length-T)?(v=O,T=v):j=O,O=Math.floor((j-v)/2+v);return H(g.charCodeAt(g.length-O))&&O--,O}function p(g,A){var v=g.length>A.length?g:A,j=g.length>A.length?A:g;if(v.length<4||j.length*2<v.length)return null;function O(X,R,pe){for(var oe=X.substring(pe,pe+Math.floor(X.length/4)),ee=-1,ue="",de,se,ie,ce;(ee=R.indexOf(oe,ee+1))!==-1;){var Ne=o(X.substring(pe),R.substring(ee)),xe=d(X.substring(0,pe),R.substring(0,ee));ue.length<xe+Ne&&(ue=R.substring(ee-xe,ee)+R.substring(ee,ee+Ne),de=X.substring(0,pe-xe),se=X.substring(pe+Ne),ie=R.substring(0,ee-xe),ce=R.substring(ee+Ne))}return ue.length*2>=X.length?[de,se,ie,ce,ue]:null}var T=O(v,j,Math.ceil(v.length/4)),q=O(v,j,Math.ceil(v.length/2)),B;if(!T&&!q)return null;q?T?B=T[4].length>q[4].length?T:q:B=q:B=T;var D,_,Z,Y;g.length>A.length?(D=B[0],_=B[1],Z=B[2],Y=B[3]):(Z=B[0],Y=B[1],D=B[2],_=B[3]);var te=B[4];return[D,_,Z,Y,te]}function x(g){for(var A=!1,v=[],j=0,O=null,T=0,q=0,B=0,D=0,_=0;T<g.length;)g[T][0]==t?(v[j++]=T,q=D,B=_,D=0,_=0,O=g[T][1]):(g[T][0]==e?D+=g[T][1].length:_+=g[T][1].length,O&&O.length<=Math.max(q,B)&&O.length<=Math.max(D,_)&&(g.splice(v[j-1],0,[r,O]),g[v[j-1]+1][0]=e,j--,j--,T=j>0?v[j-1]:-1,q=0,B=0,D=0,_=0,O=null,A=!0)),T++;for(A&&I(g),S(g),T=1;T<g.length;){if(g[T-1][0]==r&&g[T][0]==e){var Z=g[T-1][1],Y=g[T][1],te=c(Z,Y),X=c(Y,Z);te>=X?(te>=Z.length/2||te>=Y.length/2)&&(g.splice(T,0,[t,Y.substring(0,te)]),g[T-1][1]=Z.substring(0,Z.length-te),g[T+1][1]=Y.substring(te),T++):(X>=Z.length/2||X>=Y.length/2)&&(g.splice(T,0,[t,Z.substring(0,X)]),g[T-1][0]=e,g[T-1][1]=Y.substring(0,Y.length-X),g[T+1][0]=r,g[T+1][1]=Z.substring(X),T++),T++}T++}}var f=/[^a-zA-Z0-9]/,m=/\s/,y=/[\r\n]/,E=/\n\r?\n$/,w=/^\r?\n\r?\n/;function S(g){function A(X,R){if(!X||!R)return 6;var pe=X.charAt(X.length-1),oe=R.charAt(0),ee=pe.match(f),ue=oe.match(f),de=ee&&pe.match(m),se=ue&&oe.match(m),ie=de&&pe.match(y),ce=se&&oe.match(y),Ne=ie&&X.match(E),xe=ce&&R.match(w);return Ne||xe?5:ie||ce?4:ee&&!de&&se?3:de||se?2:ee||ue?1:0}for(var v=1;v<g.length-1;){if(g[v-1][0]==t&&g[v+1][0]==t){var j=g[v-1][1],O=g[v][1],T=g[v+1][1],q=d(j,O);if(q){var B=O.substring(O.length-q);j=j.substring(0,j.length-q),O=B+O.substring(0,O.length-q),T=B+T}for(var D=j,_=O,Z=T,Y=A(j,O)+A(O,T);O.charAt(0)===T.charAt(0);){j+=O.charAt(0),O=O.substring(1)+T.charAt(0),T=T.substring(1);var te=A(j,O)+A(O,T);te>=Y&&(Y=te,D=j,_=O,Z=T)}g[v-1][1]!=D&&(D?g[v-1][1]=D:(g.splice(v-1,1),v--),g[v][1]=_,Z?g[v+1][1]=Z:(g.splice(v+1,1),v--))}v++}}function I(g,A){g.push([t,""]);for(var v=0,j=0,O=0,T="",q="",B;v<g.length;){if(v<g.length-1&&!g[v][1]){g.splice(v,1);continue}switch(g[v][0]){case e:O++,q+=g[v][1],v++;break;case r:j++,T+=g[v][1],v++;break;case t:var D=v-O-j-1;if(A){if(D>=0&&P(g[D][1])){var _=g[D][1].slice(-1);if(g[D][1]=g[D][1].slice(0,-1),T=_+T,q=_+q,!g[D][1]){g.splice(D,1),v--;var Z=D-1;g[Z]&&g[Z][0]===e&&(O++,q=g[Z][1]+q,Z--),g[Z]&&g[Z][0]===r&&(j++,T=g[Z][1]+T,Z--),D=Z}}if(L(g[v][1])){var _=g[v][1].charAt(0);g[v][1]=g[v][1].slice(1),T+=_,q+=_}}if(v<g.length-1&&!g[v][1]){g.splice(v,1);break}if(T.length>0||q.length>0){T.length>0&&q.length>0&&(B=o(q,T),B!==0&&(D>=0?g[D][1]+=q.substring(0,B):(g.splice(0,0,[t,q.substring(0,B)]),v++),q=q.substring(B),T=T.substring(B)),B=d(q,T),B!==0&&(g[v][1]=q.substring(q.length-B)+g[v][1],q=q.substring(0,q.length-B),T=T.substring(0,T.length-B)));var Y=O+j;T.length===0&&q.length===0?(g.splice(v-Y,Y),v=v-Y):T.length===0?(g.splice(v-Y,Y,[e,q]),v=v-Y+1):q.length===0?(g.splice(v-Y,Y,[r,T]),v=v-Y+1):(g.splice(v-Y,Y,[r,T],[e,q]),v=v-Y+2)}v!==0&&g[v-1][0]===t?(g[v-1][1]+=g[v][1],g.splice(v,1)):v++,O=0,j=0,T="",q="";break}}g[g.length-1][1]===""&&g.pop();var te=!1;for(v=1;v<g.length-1;)g[v-1][0]===t&&g[v+1][0]===t&&(g[v][1].substring(g[v][1].length-g[v-1][1].length)===g[v-1][1]?(g[v][1]=g[v-1][1]+g[v][1].substring(0,g[v][1].length-g[v-1][1].length),g[v+1][1]=g[v-1][1]+g[v+1][1],g.splice(v-1,1),te=!0):g[v][1].substring(0,g[v+1][1].length)==g[v+1][1]&&(g[v-1][1]+=g[v+1][1],g[v][1]=g[v][1].substring(g[v+1][1].length)+g[v+1][1],g.splice(v+1,1),te=!0)),v++;te&&I(g,A)}function M(g){return g>=55296&&g<=56319}function H(g){return g>=56320&&g<=57343}function L(g){return H(g.charCodeAt(0))}function P(g){return M(g.charCodeAt(g.length-1))}function W(g){for(var A=[],v=0;v<g.length;v++)g[v][1].length>0&&A.push(g[v]);return A}function re(g,A,v,j){return P(g)||L(j)?null:W([[t,g],[r,A],[e,v],[t,j]])}function fe(g,A,v){var j=typeof v=="number"?{index:v,length:0}:v.oldRange,O=typeof v=="number"?null:v.newRange,T=g.length,q=A.length;if(j.length===0&&(O===null||O.length===0)){var B=j.index,D=g.slice(0,B),_=g.slice(B),Z=O?O.index:null;e:{var Y=B+q-T;if(Z!==null&&Z!==Y||Y<0||Y>q)break e;var te=A.slice(0,Y),X=A.slice(Y);if(X!==_)break e;var R=Math.min(B,Y),pe=D.slice(0,R),oe=te.slice(0,R);if(pe!==oe)break e;var ee=D.slice(R),ue=te.slice(R);return re(pe,ee,ue,_)}e:{if(Z!==null&&Z!==B)break e;var de=B,te=A.slice(0,de),X=A.slice(de);if(te!==D)break e;var se=Math.min(T-de,q-de),ie=_.slice(_.length-se),ce=X.slice(X.length-se);if(ie!==ce)break e;var ee=_.slice(0,_.length-se),ue=X.slice(0,X.length-se);return re(D,ee,ue,ie)}}if(j.length>0&&O&&O.length===0)e:{var pe=g.slice(0,j.index),ie=g.slice(j.index+j.length),R=pe.length,se=ie.length;if(q<R+se)break e;var oe=A.slice(0,R),ce=A.slice(q-se);if(pe!==oe||ie!==ce)break e;var ee=g.slice(R,T-se),ue=A.slice(R,q-se);return re(pe,ee,ue,ie)}return null}function F(g,A,v,j){return n(g,A,v,j,!0)}return F.INSERT=e,F.DELETE=r,F.EQUAL=t,Oi=F,Oi}var Tr={exports:{}};Tr.exports;var ml;function Mo(){return ml||(ml=1,(function(r,e){var t=200,n="__lodash_hash_undefined__",s=9007199254740991,i="[object Arguments]",l="[object Array]",o="[object Boolean]",c="[object Date]",d="[object Error]",p="[object Function]",x="[object GeneratorFunction]",f="[object Map]",m="[object Number]",y="[object Object]",E="[object Promise]",w="[object RegExp]",S="[object Set]",I="[object String]",M="[object Symbol]",H="[object WeakMap]",L="[object ArrayBuffer]",P="[object DataView]",W="[object Float32Array]",re="[object Float64Array]",fe="[object Int8Array]",F="[object Int16Array]",g="[object Int32Array]",A="[object Uint8Array]",v="[object Uint8ClampedArray]",j="[object Uint16Array]",O="[object Uint32Array]",T=/[\\^$.*+?()[\]{}|]/g,q=/\w*$/,B=/^\[object .+?Constructor\]$/,D=/^(?:0|[1-9]\d*)$/,_={};_[i]=_[l]=_[L]=_[P]=_[o]=_[c]=_[W]=_[re]=_[fe]=_[F]=_[g]=_[f]=_[m]=_[y]=_[w]=_[S]=_[I]=_[M]=_[A]=_[v]=_[j]=_[O]=!0,_[d]=_[p]=_[H]=!1;var Z=typeof on=="object"&&on&&on.Object===Object&&on,Y=typeof self=="object"&&self&&self.Object===Object&&self,te=Z||Y||Function("return this")(),X=e&&!e.nodeType&&e,R=X&&!0&&r&&!r.nodeType&&r,pe=R&&R.exports===X;function oe(a,u){return a.set(u[0],u[1]),a}function ee(a,u){return a.add(u),a}function ue(a,u){for(var b=-1,N=a?a.length:0;++b<N&&u(a[b],b,a)!==!1;);return a}function de(a,u){for(var b=-1,N=u.length,he=a.length;++b<N;)a[he+b]=u[b];return a}function se(a,u,b,N){for(var he=-1,J=a?a.length:0;++he<J;)b=u(b,a[he],he,a);return b}function ie(a,u){for(var b=-1,N=Array(a);++b<a;)N[b]=u(b);return N}function ce(a,u){return a==null?void 0:a[u]}function Ne(a){var u=!1;if(a!=null&&typeof a.toString!="function")try{u=!!(a+"")}catch{}return u}function xe(a){var u=-1,b=Array(a.size);return a.forEach(function(N,he){b[++u]=[he,N]}),b}function Ze(a,u){return function(b){return a(u(b))}}function tt(a){var u=-1,b=Array(a.size);return a.forEach(function(N){b[++u]=N}),b}var Re=Array.prototype,Te=Function.prototype,Pe=Object.prototype,Me=te["__core-js_shared__"],Ce=(function(){var a=/[^.]+$/.exec(Me&&Me.keys&&Me.keys.IE_PROTO||"");
vendor: 4,798 bytes, line 18
18return a?"Symbol(src)_1."+a:""})(),Ye=Te.toString,Be=Pe.hasOwnProperty,ge=Pe.toString,He=RegExp("^"+Ye.call(Be).replace(T,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),we=pe?te.Buffer:void 0,le=te.Symbol,ze=te.Uint8Array,Ge=Ze(Object.getPrototypeOf,Object),Zt=Object.create,mn=Pe.propertyIsEnumerable,bn=Re.splice,Yt=Object.getOwnPropertySymbols,Ct=we?we.isBuffer:void 0,yn=Ze(Object.keys,Object),Xt=gt(te,"DataView"),Pt=gt(te,"Map"),nt=gt(te,"Promise"),Jt=gt(te,"Set"),vn=gt(te,"WeakMap"),it=gt(Object,"create"),xn=Xe(Xt),$t=Xe(Pt),En=Xe(nt),wn=Xe(Jt),at=Xe(vn),rt=le?le.prototype:void 0,en=rt?rt.valueOf:void 0;function pt(a){var u=-1,b=a?a.length:0;for(this.clear();++u<b;){var N=a[u];this.set(N[0],N[1])}}function Bn(){this.__data__=it?it(null):{}}function dr(a){return this.has(a)&&delete this.__data__[a]}function fr(a){var u=this.__data__;if(it){var b=u[a];return b===n?void 0:b}return Be.call(u,a)?u[a]:void 0}function Dn(a){var u=this.__data__;return it?u[a]!==void 0:Be.call(u,a)}function Nn(a,u){var b=this.__data__;return b[a]=it&&u===void 0?n:u,this}pt.prototype.clear=Bn,pt.prototype.delete=dr,pt.prototype.get=fr,pt.prototype.has=Dn,pt.prototype.set=Nn;function Ie(a){var u=-1,b=a?a.length:0;for(this.clear();++u<b;){var N=a[u];this.set(N[0],N[1])}}function pr(){this.__data__=[]}function gr(a){var u=this.__data__,b=Hn(u,a);if(b<0)return!1;var N=u.length-1;return b==N?u.pop():bn.call(u,b,1),!0}function K(a){var u=this.__data__,b=Hn(u,a);return b<0?void 0:u[b][1]}function ne(a){return Hn(this.__data__,a)>-1}function Oe(a,u){var b=this.__data__,N=Hn(b,a);return N<0?b.push([a,u]):b[N][1]=u,this}Ie.prototype.clear=pr,Ie.prototype.delete=gr,Ie.prototype.get=K,Ie.prototype.has=ne,Ie.prototype.set=Oe;function be(a){var u=-1,b=a?a.length:0;for(this.clear();++u<b;){var N=a[u];this.set(N[0],N[1])}}function Ae(){this.__data__={hash:new pt,map:new(Pt||Ie),string:new pt}}function St(a){return Tn(this,a).delete(a)}function Lt(a){return Tn(this,a).get(a)}function Pn(a){return Tn(this,a).has(a)}function lt(a,u){return Tn(this,a).set(a,u),this}be.prototype.clear=Ae,be.prototype.delete=St,be.prototype.get=Lt,be.prototype.has=Pn,be.prototype.set=lt;function $e(a){this.__data__=new Ie(a)}function $n(){this.__data__=new Ie}function Fn(a){return this.__data__.delete(a)}function zs(a){return this.__data__.get(a)}function Gs(a){return this.__data__.has(a)}function Ks(a,u){var b=this.__data__;if(b instanceof Ie){var N=b.__data__;if(!Pt||N.length<t-1)return N.push([a,u]),this;b=this.__data__=new be(N)}return b.set(a,u),this}$e.prototype.clear=$n,$e.prototype.delete=Fn,$e.prototype.get=zs,$e.prototype.has=Gs,$e.prototype.set=Ks;function Un(a,u){var b=vr(a)||Gn(a)?ie(a.length,String):[],N=b.length,he=!!N;for(var J in a)Be.call(a,J)&&!(he&&(J=="length"||ai(J,N)))&&b.push(J);return b}function Wr(a,u,b){var N=a[u];(!(Be.call(a,u)&&Xr(N,b))||b===void 0&&!(u in a))&&(a[u]=b)}function Hn(a,u){for(var b=a.length;b--;)if(Xr(a[b][0],u))return b;return-1}function Ot(a,u){return a&&yr(u,Er(u),a)}function mr(a,u,b,N,he,J,ye){var me;if(N&&(me=J?N(a,he,J,ye):N(a)),me!==void 0)return me;if(!jt(a))return a;var qe=vr(a);if(qe){if(me=si(a),!u)return ti(a,me)}else{var ve=Ut(a),Ke=ve==p||ve==x;if(Jr(a))return zn(a,u);if(ve==y||ve==i||Ke&&!J){if(Ne(a))return J?a:{};if(me=qt(Ke?{}:a),!u)return ni(a,Ot(me,a))}else{if(!_[ve])return J?a:{};me=ii(a,ve,mr,u)}}ye||(ye=new $e);var et=ye.get(a);if(et)return et;if(ye.set(a,me),!qe)var ke=b?ri(a):Er(a);return ue(ke||a,function(We,Fe){ke&&(Fe=We,We=a[Fe]),Wr(me,Fe,mr(We,u,b,N,Fe,a,ye))}),me}function Ws(a){return jt(a)?Zt(a):{}}function Vs(a,u,b){var N=u(a);return vr(a)?N:de(N,b(a))}function Qs(a){return ge.call(a)}function Zs(a){if(!jt(a)||oi(a))return!1;var u=xr(a)||Ne(a)?He:B;return u.test(Xe(a))}function Ys(a){if(!Zr(a))return yn(a);var u=[];for(var b in Object(a))Be.call(a,b)&&b!="constructor"&&u.push(b);return u}function zn(a,u){if(u)return a.slice();var b=new a.constructor(a.length);return a.copy(b),b}function br(a){var u=new a.constructor(a.byteLength);return new ze(u).set(new ze(a)),u}function An(a,u){var b=u?br(a.buffer):a.buffer;return new a.constructor(b,a.byteOffset,a.byteLength)}function Vr(a,u,b){var N=u?b(xe(a),!0):xe(a);return se(N,oe,new a.constructor)}function Qr(a){var u=new a.constructor(a.source,q.exec(a));return u.lastIndex=a.lastIndex,u}function Xs(a,u,b){var N=u?b(tt(a),!0):tt(a);return se(N,ee,new a.constructor)}function Js(a){return en?Object(en.call(a)):{}}function ei(a,u){var b=u?br(a.buffer):a.buffer;return new a.constructor(b,a.byteOffset,a.length)}function ti(a,u){var b=-1,N=a.length;for(u||(u=Array(N));++b<N;)u[b]=a[b];return u}function yr(a,u,b,N){b||(b={});for(var he=-1,J=u.length;++he<J;){var ye=u[he],me=void 0;Wr(b,ye,me===void 0?a[ye]:me)}return b}
18function ni(a,u){return yr(a,Ft(a),u)}function ri(a){return Vs(a,Er,Ft)}function Tn(a,u){var b=a.__data__;return li(u)?b[typeof u=="string"?"string":"hash"]:b.map}function gt(a,u){var b=ce(a,u);return Zs(b)?b:void 0}var Ft=Yt?Ze(Yt,Object):ui,Ut=Qs;(Xt&&Ut(new Xt(new ArrayBuffer(1)))!=P||Pt&&Ut(new Pt)!=f||nt&&Ut(nt.resolve())!=E||Jt&&Ut(new Jt)!=S||vn&&Ut(new vn)!=H)&&(Ut=function(a){var u=ge.call(a),b=u==y?a.constructor:void 0,N=b?Xe(b):void 0;if(N)switch(N){case xn:return P;case $t:return f;case En:return E;case wn:return S;case at:return H}return u});function si(a){var u=a.length,b=a.constructor(u);return u&&typeof a[0]=="string"&&Be.call(a,"index")&&(b.index=a.index,b.input=a.input),b}function qt(a){return typeof a.constructor=="function"&&!Zr(a)?Ws(Ge(a)):{}}function ii(a,u,b,N){var he=a.constructor;switch(u){case L:return br(a);case o:case c:return new he(+a);case P:return An(a,N);case W:case re:case fe:case F:case g:case A:case v:case j:case O:return ei(a,N);case f:return Vr(a,N,b);case m:case I:return new he(a);case w:return Qr(a);case S:return Xs(a,N,b);case M:return Js(a)}}function ai(a,u){return u=u??s,!!u&&(typeof a=="number"||D.test(a))&&a>-1&&a%1==0&&a<u}function li(a){var u=typeof a;return u=="string"||u=="number"||u=="symbol"||u=="boolean"?a!=="__proto__":a===null}function oi(a){return!!Ce&&Ce in a}function Zr(a){var u=a&&a.constructor,b=typeof u=="function"&&u.prototype||Pe;return a===b}function Xe(a){if(a!=null){try{return Ye.call(a)}catch{}try{return a+""}catch{}}return""}function Yr(a){return mr(a,!0,!0)}function Xr(a,u){return a===u||a!==a&&u!==u}function Gn(a){return ci(a)&&Be.call(a,"callee")&&(!mn.call(a,"callee")||ge.call(a)==i)}var vr=Array.isArray;function Kn(a){return a!=null&&es(a.length)&&!xr(a)}function ci(a){return ts(a)&&Kn(a)}var Jr=Ct||hi;function xr(a){var u=jt(a)?ge.call(a):"";return u==p||u==x}function es(a){return typeof a=="number"&&a>-1&&a%1==0&&a<=s}function jt(a){var u=typeof a;return!!a&&(u=="object"||u=="function")}function ts(a){return!!a&&typeof a=="object"}function Er(a){return Kn(a)?Un(a):Ys(a)}function ui(){return[]}function hi(){return!1}r.exports=Yr})(Tr,Tr.exports)),Tr.exports}var Cr={exports:{}};Cr.exports;var bl;function Bo(){return bl||(bl=1,(function(r,e){var t=200,n="__lodash_hash_undefined__",s=1,i=2,l=9007199254740991,o="[object Arguments]",c="[object Array]",d="[object AsyncFunction]",p="[object Boolean]",x="[object Date]",f="[object Error]",m="[object Function]",y="[object GeneratorFunction]",E="[object Map]",w="[object Number]",S="[object Null]",I="[object Object]",M="[object Promise]",H="[object Proxy]",L="[object RegExp]",P="[object Set]",W="[object String]",re="[object Symbol]",fe="[object Undefined]",F="[object WeakMap]",g="[object ArrayBuffer]",A="[object DataView]",v="[object Float32Array]",j="[object Float64Array]",O="[object Int8Array]",T="[object Int16Array]",q="[object Int32Array]",B="[object Uint8Array]",D="[object Uint8ClampedArray]",_="[object Uint16Array]",Z="[object Uint32Array]",Y=/[\\^$.*+?()[\]{}|]/g,te=/^\[object .+?Constructor\]$/,X=/^(?:0|[1-9]\d*)$/,R={};R[v]=R[j]=R[O]=R[T]=R[q]=R[B]=R[D]=R[_]=R[Z]=!0,R[o]=R[c]=R[g]=R[p]=R[A]=R[x]=R[f]=R[m]=R[E]=R[w]=R[I]=R[L]=R[P]=R[W]=R[F]=!1;var pe=typeof on=="object"&&on&&on.Object===Object&&on,oe=typeof self=="object"&&self&&self.Object===Object&&self,ee=pe||oe||Function("return this")(),ue=e&&!e.nodeType&&e,de=ue&&!0&&r&&!r.nodeType&&r,se=de&&de.exports===ue,ie=se&&pe.process,ce=(function(){try{return ie&&ie.binding&&ie.binding("util")}catch{}})(),Ne=ce&&ce.isTypedArray;function xe(a,u){for(var b=-1,N=a==null?0:a.length,he=0,J=[];++b<N;){var ye=a[b];u(ye,b,a)&&(J[he++]=ye)}return J}function Ze(a,u){for(var b=-1,N=u.length,he=a.length;++b<N;)a[he+b]=u[b];return a}function tt(a,u){for(var b=-1,N=a==null?0:a.length;++b<N;)if(u(a[b],b,a))return!0;return!1}function Re(a,u){for(var b=-1,N=Array(a);++b<a;)N[b]=u(b);return N}function Te(a){return function(u){return a(u)}}function Pe(a,u){return a.has(u)}function Me(a,u){return a==null?void 0:a[u]}function Ce(a){var u=-1,b=Array(a.size);return a.forEach(function(N,he){b[++u]=[he,N]}),b}function Ye(a,u){return function(b){return a(u(b))}}function Be(a){var u=-1,b=Array(a.size);return a.forEach(function(N){b[++u]=N}),b}var ge=Array.prototype,He=Function.prototype,we=Object.prototype,le=ee["__core-js_shared__"],ze=He.toString,Ge=we.hasOwnProperty,Zt=(function(){var a=/[^.]+$/.exec(le&&le.keys&&le.keys.IE_PROTO||"");
vendor: 4,089 bytes, line 18
18return a?"Symbol(src)_1."+a:""})(),mn=we.toString,bn=RegExp("^"+ze.call(Ge).replace(Y,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Yt=se?ee.Buffer:void 0,Ct=ee.Symbol,yn=ee.Uint8Array,Xt=we.propertyIsEnumerable,Pt=ge.splice,nt=Ct?Ct.toStringTag:void 0,Jt=Object.getOwnPropertySymbols,vn=Yt?Yt.isBuffer:void 0,it=Ye(Object.keys,Object),xn=Ft(ee,"DataView"),$t=Ft(ee,"Map"),En=Ft(ee,"Promise"),wn=Ft(ee,"Set"),at=Ft(ee,"WeakMap"),rt=Ft(Object,"create"),en=Xe(xn),pt=Xe($t),Bn=Xe(En),dr=Xe(wn),fr=Xe(at),Dn=Ct?Ct.prototype:void 0,Nn=Dn?Dn.valueOf:void 0;function Ie(a){var u=-1,b=a==null?0:a.length;for(this.clear();++u<b;){var N=a[u];this.set(N[0],N[1])}}function pr(){this.__data__=rt?rt(null):{},this.size=0}function gr(a){var u=this.has(a)&&delete this.__data__[a];return this.size-=u?1:0,u}function K(a){var u=this.__data__;if(rt){var b=u[a];return b===n?void 0:b}return Ge.call(u,a)?u[a]:void 0}function ne(a){var u=this.__data__;return rt?u[a]!==void 0:Ge.call(u,a)}function Oe(a,u){var b=this.__data__;return this.size+=this.has(a)?0:1,b[a]=rt&&u===void 0?n:u,this}Ie.prototype.clear=pr,Ie.prototype.delete=gr,Ie.prototype.get=K,Ie.prototype.has=ne,Ie.prototype.set=Oe;function be(a){var u=-1,b=a==null?0:a.length;for(this.clear();++u<b;){var N=a[u];this.set(N[0],N[1])}}function Ae(){this.__data__=[],this.size=0}function St(a){var u=this.__data__,b=zn(u,a);if(b<0)return!1;var N=u.length-1;return b==N?u.pop():Pt.call(u,b,1),--this.size,!0}function Lt(a){var u=this.__data__,b=zn(u,a);return b<0?void 0:u[b][1]}function Pn(a){return zn(this.__data__,a)>-1}function lt(a,u){var b=this.__data__,N=zn(b,a);return N<0?(++this.size,b.push([a,u])):b[N][1]=u,this}be.prototype.clear=Ae,be.prototype.delete=St,be.prototype.get=Lt,be.prototype.has=Pn,be.prototype.set=lt;function $e(a){var u=-1,b=a==null?0:a.length;for(this.clear();++u<b;){var N=a[u];this.set(N[0],N[1])}}function $n(){this.size=0,this.__data__={hash:new Ie,map:new($t||be),string:new Ie}}function Fn(a){var u=gt(this,a).delete(a);return this.size-=u?1:0,u}function zs(a){return gt(this,a).get(a)}function Gs(a){return gt(this,a).has(a)}function Ks(a,u){var b=gt(this,a),N=b.size;return b.set(a,u),this.size+=b.size==N?0:1,this}$e.prototype.clear=$n,$e.prototype.delete=Fn,$e.prototype.get=zs,$e.prototype.has=Gs,$e.prototype.set=Ks;function Un(a){var u=-1,b=a==null?0:a.length;for(this.__data__=new $e;++u<b;)this.add(a[u])}function Wr(a){return this.__data__.set(a,n),this}function Hn(a){return this.__data__.has(a)}Un.prototype.add=Un.prototype.push=Wr,Un.prototype.has=Hn;function Ot(a){var u=this.__data__=new be(a);this.size=u.size}function mr(){this.__data__=new be,this.size=0}function Ws(a){var u=this.__data__,b=u.delete(a);return this.size=u.size,b}function Vs(a){return this.__data__.get(a)}function Qs(a){return this.__data__.has(a)}function Zs(a,u){var b=this.__data__;if(b instanceof be){var N=b.__data__;if(!$t||N.length<t-1)return N.push([a,u]),this.size=++b.size,this;b=this.__data__=new $e(N)}return b.set(a,u),this.size=b.size,this}Ot.prototype.clear=mr,Ot.prototype.delete=Ws,Ot.prototype.get=Vs,Ot.prototype.has=Qs,Ot.prototype.set=Zs;function Ys(a,u){var b=Gn(a),N=!b&&Xr(a),he=!b&&!N&&Kn(a),J=!b&&!N&&!he&&ts(a),ye=b||N||he||J,me=ye?Re(a.length,String):[],qe=me.length;for(var ve in a)Ge.call(a,ve)&&!(ye&&(ve=="length"||he&&(ve=="offset"||ve=="parent")||J&&(ve=="buffer"||ve=="byteLength"||ve=="byteOffset")||ii(ve,qe)))&&me.push(ve);return me}function zn(a,u){for(var b=a.length;b--;)if(Yr(a[b][0],u))return b;return-1}function br(a,u,b){var N=u(a);return Gn(a)?N:Ze(N,b(a))}function An(a){return a==null?a===void 0?fe:S:nt&&nt in Object(a)?Ut(a):Zr(a)}function Vr(a){return jt(a)&&An(a)==o}function Qr(a,u,b,N,he){return a===u?!0:a==null||u==null||!jt(a)&&!jt(u)?a!==a&&u!==u:Xs(a,u,b,N,Qr,he)}function Xs(a,u,b,N,he,J){var ye=Gn(a),me=Gn(u),qe=ye?c:qt(a),ve=me?c:qt(u);qe=qe==o?I:qe,ve=ve==o?I:ve;var Ke=qe==I,et=ve==I,ke=qe==ve;if(ke&&Kn(a)){if(!Kn(u))return!1;ye=!0,Ke=!1}if(ke&&!Ke)return J||(J=new Ot),ye||ts(a)?yr(a,u,b,N,he,J):ni(a,u,qe,b,N,he,J);
vendor: 4,798 bytes, line 18
18if(!(b&s)){var We=Ke&&Ge.call(a,"__wrapped__"),Fe=et&&Ge.call(u,"__wrapped__");if(We||Fe){var tn=We?a.value():a,Ht=Fe?u.value():u;return J||(J=new Ot),he(tn,Ht,b,N,J)}}return ke?(J||(J=new Ot),ri(a,u,b,N,he,J)):!1}function Js(a){if(!es(a)||li(a))return!1;var u=Jr(a)?bn:te;return u.test(Xe(a))}function ei(a){return jt(a)&&xr(a.length)&&!!R[An(a)]}function ti(a){if(!oi(a))return it(a);var u=[];for(var b in Object(a))Ge.call(a,b)&&b!="constructor"&&u.push(b);return u}function yr(a,u,b,N,he,J){var ye=b&s,me=a.length,qe=u.length;if(me!=qe&&!(ye&&qe>me))return!1;var ve=J.get(a);if(ve&&J.get(u))return ve==u;var Ke=-1,et=!0,ke=b&i?new Un:void 0;for(J.set(a,u),J.set(u,a);++Ke<me;){var We=a[Ke],Fe=u[Ke];if(N)var tn=ye?N(Fe,We,Ke,u,a,J):N(We,Fe,Ke,a,u,J);if(tn!==void 0){if(tn)continue;et=!1;break}if(ke){if(!tt(u,function(Ht,Cn){if(!Pe(ke,Cn)&&(We===Ht||he(We,Ht,b,N,J)))return ke.push(Cn)})){et=!1;break}}else if(!(We===Fe||he(We,Fe,b,N,J))){et=!1;break}}return J.delete(a),J.delete(u),et}function ni(a,u,b,N,he,J,ye){switch(b){case A:if(a.byteLength!=u.byteLength||a.byteOffset!=u.byteOffset)return!1;a=a.buffer,u=u.buffer;case g:return!(a.byteLength!=u.byteLength||!J(new yn(a),new yn(u)));case p:case x:case w:return Yr(+a,+u);case f:return a.name==u.name&&a.message==u.message;case L:case W:return a==u+"";case E:var me=Ce;case P:var qe=N&s;if(me||(me=Be),a.size!=u.size&&!qe)return!1;var ve=ye.get(a);if(ve)return ve==u;N|=i,ye.set(a,u);var Ke=yr(me(a),me(u),N,he,J,ye);return ye.delete(a),Ke;case re:if(Nn)return Nn.call(a)==Nn.call(u)}return!1}function ri(a,u,b,N,he,J){var ye=b&s,me=Tn(a),qe=me.length,ve=Tn(u),Ke=ve.length;if(qe!=Ke&&!ye)return!1;for(var et=qe;et--;){var ke=me[et];if(!(ye?ke in u:Ge.call(u,ke)))return!1}var We=J.get(a);if(We&&J.get(u))return We==u;var Fe=!0;J.set(a,u),J.set(u,a);for(var tn=ye;++et<qe;){ke=me[et];var Ht=a[ke],Cn=u[ke];if(N)var Ba=ye?N(Cn,Ht,ke,u,a,J):N(Ht,Cn,ke,a,u,J);if(!(Ba===void 0?Ht===Cn||he(Ht,Cn,b,N,J):Ba)){Fe=!1;break}tn||(tn=ke=="constructor")}if(Fe&&!tn){var ns=a.constructor,rs=u.constructor;ns!=rs&&"constructor"in a&&"constructor"in u&&!(typeof ns=="function"&&ns instanceof ns&&typeof rs=="function"&&rs instanceof rs)&&(Fe=!1)}return J.delete(a),J.delete(u),Fe}function Tn(a){return br(a,Er,si)}function gt(a,u){var b=a.__data__;return ai(u)?b[typeof u=="string"?"string":"hash"]:b.map}function Ft(a,u){var b=Me(a,u);return Js(b)?b:void 0}function Ut(a){var u=Ge.call(a,nt),b=a[nt];try{a[nt]=void 0;var N=!0}catch{}var he=mn.call(a);return N&&(u?a[nt]=b:delete a[nt]),he}var si=Jt?function(a){return a==null?[]:(a=Object(a),xe(Jt(a),function(u){return Xt.call(a,u)}))}:ui,qt=An;(xn&&qt(new xn(new ArrayBuffer(1)))!=A||$t&&qt(new $t)!=E||En&&qt(En.resolve())!=M||wn&&qt(new wn)!=P||at&&qt(new at)!=F)&&(qt=function(a){var u=An(a),b=u==I?a.constructor:void 0,N=b?Xe(b):"";if(N)switch(N){case en:return A;case pt:return E;case Bn:return M;case dr:return P;case fr:return F}return u});function ii(a,u){return u=u??l,!!u&&(typeof a=="number"||X.test(a))&&a>-1&&a%1==0&&a<u}function ai(a){var u=typeof a;return u=="string"||u=="number"||u=="symbol"||u=="boolean"?a!=="__proto__":a===null}function li(a){return!!Zt&&Zt in a}function oi(a){var u=a&&a.constructor,b=typeof u=="function"&&u.prototype||we;return a===b}function Zr(a){return mn.call(a)}function Xe(a){if(a!=null){try{return ze.call(a)}catch{}try{return a+""}catch{}}return""}function Yr(a,u){return a===u||a!==a&&u!==u}var Xr=Vr((function(){return arguments})())?Vr:function(a){return jt(a)&&Ge.call(a,"callee")&&!Xt.call(a,"callee")},Gn=Array.isArray;function vr(a){return a!=null&&xr(a.length)&&!Jr(a)}var Kn=vn||hi;function ci(a,u){return Qr(a,u)}function Jr(a){if(!es(a))return!1;var u=An(a);return u==m||u==y||u==d||u==H}function xr(a){return typeof a=="number"&&a>-1&&a%1==0&&a<=l}function es(a){var u=typeof a;return a!=null&&(u=="object"||u=="function")}function jt(a){return a!=null&&typeof a=="object"}var ts=Ne?Te(Ne):ei;function Er(a){return vr(a)?Ys(a):ti(a)}function ui(){return[]}function hi(){return!1}r.exports=ci})(Cr,Cr.exports)),Cr.exports}var ds={},yl;function Xg(){if(yl)return ds;yl=1,Object.defineProperty(ds,"__esModule",{value:!0});const r=Mo(),e=Bo();var t;return(function(n){function s(c={},d={},p=!1){typeof c!="object"&&(c={}),typeof d!="object"&&(d={});let x=r(d);p||(x=Object.keys(x).reduce((f,m)=>(x[m]!=null&&(f[m]=x[m]),f),{}));for(const f in c)c[f]!==void 0&&d[f]===void 0&&(x[f]=c[f]);return Object.keys(x).length>0?x:void 0}n.compose=s;function i(c={},d={}){typeof c!="object"&&(c={}),typeof d!="object"&&(d={});const p=Object.keys(c).concat(Object.keys(d)).reduce((x,f)=>(e(c[f],d[f])||(x[f]=d[f]===void 0?null:d[f]),x),{});return Object.keys(p).length>0?p:void 0}n.diff=i;function l(c={},d={}){c=c||{};const p=Object.keys(d).reduce((x,f)=>
18(d[f]!==c[f]&&c[f]!==void 0&&(x[f]=d[f]),x),{});return Object.keys(c).reduce((x,f)=>(c[f]!==d[f]&&d[f]===void 0&&(x[f]=null),x),p)}n.invert=l;function o(c,d,p=!1){if(typeof c!="object")return d;if(typeof d!="object")return;if(!p)return d;const x=Object.keys(d).reduce((f,m)=>(c[m]===void 0&&(f[m]=d[m]),f),{});return Object.keys(x).length>0?x:void 0}n.transform=o})(t||(t={})),ds.default=t,ds}var fs={},vl;function Do(){if(vl)return fs;vl=1,Object.defineProperty(fs,"__esModule",{value:!0});var r;return(function(e){function t(n){return typeof n.delete=="number"?n.delete:typeof n.retain=="number"?n.retain:typeof n.retain=="object"&&n.retain!==null?1:typeof n.insert=="string"?n.insert.length:1}e.length=t})(r||(r={})),fs.default=r,fs}var ps={},xl;function Jg(){if(xl)return ps;xl=1,Object.defineProperty(ps,"__esModule",{value:!0});const r=Do();class e{constructor(n){this.ops=n,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(n){n||(n=1/0);const s=this.ops[this.index];if(s){const i=this.offset,l=r.default.length(s);if(n>=l-i?(n=l-i,this.index+=1,this.offset=0):this.offset+=n,typeof s.delete=="number")return{delete:n};{const o={};return s.attributes&&(o.attributes=s.attributes),typeof s.retain=="number"?o.retain=n:typeof s.retain=="object"&&s.retain!==null?o.retain=s.retain:typeof s.insert=="string"?o.insert=s.insert.substr(i,n):o.insert=s.insert,o}}else return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?r.default.length(this.ops[this.index])-this.offset:1/0}peekType(){const n=this.ops[this.index];return n?typeof n.delete=="number"?"delete":typeof n.retain=="number"||typeof n.retain=="object"&&n.retain!==null?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);{const n=this.offset,s=this.index,i=this.next(),l=this.ops.slice(this.index);return this.offset=n,this.index=s,[i].concat(l)}}else return[]}}return ps.default=e,ps}var El;function em(){return El||(El=1,(function(r,e){Object.defineProperty(e,"__esModule",{value:!0}),e.AttributeMap=e.OpIterator=e.Op=void 0;const t=Yg(),n=Mo(),s=Bo(),i=Xg();e.AttributeMap=i.default;const l=Do();e.Op=l.default;const o=Jg();e.OpIterator=o.default;const c="\0",d=(x,f)=>{if(typeof x!="object"||x===null)throw new Error(`cannot retain a ${typeof x}`);if(typeof f!="object"||f===null)throw new Error(`cannot retain a ${typeof f}`);const m=Object.keys(x)[0];if(!m||m!==Object.keys(f)[0])throw new Error(`embed types not matched: ${m} != ${Object.keys(f)[0]}`);return[m,x[m],f[m]]};class p{constructor(f){Array.isArray(f)?this.ops=f:f!=null&&Array.isArray(f.ops)?this.ops=f.ops:this.ops=[]}static registerEmbed(f,m){this.handlers[f]=m}static unregisterEmbed(f){delete this.handlers[f]}static getHandler(f){const m=this.handlers[f];if(!m)throw new Error(`no handlers for embed type "${f}"`);return m}insert(f,m){const y={};return typeof f=="string"&&f.length===0?this:(y.insert=f,m!=null&&typeof m=="object"&&Object.keys(m).length>0&&(y.attributes=m),this.push(y))}delete(f){return f<=0?this:this.push({delete:f})}retain(f,m){if(typeof f=="number"&&f<=0)return this;const y={retain:f};return m!=null&&typeof m=="object"&&Object.keys(m).length>0&&(y.attributes=m),this.push(y)}push(f){let m=this.ops.length,y=this.ops[m-1];if(f=n(f),typeof y=="object"){if(typeof f.delete=="number"&&typeof y.delete=="number")return this.ops[m-1]={delete:y.delete+f.delete},this;if(typeof y.delete=="number"&&f.insert!=null&&(m-=1,y=this.ops[m-1],typeof y!="object"))return this.ops.unshift(f),this;if(s(f.attributes,y.attributes)){if(typeof f.insert=="string"&&typeof y.insert=="string")return this.ops[m-1]={insert:y.insert+f.insert},typeof f.attributes=="object"&&(this.ops[m-1].attributes=f.attributes),this;if(typeof f.retain=="number"&&typeof y.retain=="number")return this.ops[m-1]={retain:y.retain+f.retain},typeof f.attributes=="object"&&(this.ops[m-1].attributes=f.attributes),this}}return m===this.ops.length?this.ops.push(f):this.ops.splice(m,0,f),this}chop(){const f=this.ops[this.ops.length-1];return f&&typeof f.retain=="number"&&!f.attributes&&this.ops.pop(),this}filter(f){return this.ops.filter(f)}forEach(f){this.ops.forEach(f)}map(f){return this.ops.map(f)}partition(f){const m=[],y=[];return this.forEach(E=>{(f(E)?m:y).push(E)}),[m,y]}reduce(f,m){return this.ops.reduce(f,m)}changeLength(){return this.reduce((f,m)=>m.insert?f+l.default.length(m):m.delete?f-m.delete:f,0)}length(){return this.reduce((f,m)=>f+l.default.length(m),0)}slice(f=0,m=1/0){const y=[],E=new o.default(this.ops);let w=0;for(;w<m&&E.hasNext();){let S;w<f?S=E.next(f-w):(S=E.next(m-w),y.push(S)),w+=l.default.length(S)}return new p(y)}compose(f){const m=new o.default(this.ops),y=new o.default(f.ops),E=[],w=y.peek();if(w!=null&&typeof w.retain=="number"&&w.attributes==null){let I=w.retain;for(;m.peekType()==="insert"&&m.peekLength()<=I;)I-=m.peekLength(),E.push(m.next());w.retain-I>0&&y.next(w.retain-I)}const S=new p(E);for(;m.hasNext()||y.hasNext();)if(y.peekType()==="insert")S.push(y.next());
18else if(m.peekType()==="delete")S.push(m.next());else{const I=Math.min(m.peekLength(),y.peekLength()),M=m.next(I),H=y.next(I);if(H.retain){const L={};if(typeof M.retain=="number")L.retain=typeof H.retain=="number"?I:H.retain;else if(typeof H.retain=="number")M.retain==null?L.insert=M.insert:L.retain=M.retain;else{const W=M.retain==null?"insert":"retain",[re,fe,F]=d(M[W],H.retain),g=p.getHandler(re);L[W]={[re]:g.compose(fe,F,W==="retain")}}const P=i.default.compose(M.attributes,H.attributes,typeof M.retain=="number");if(P&&(L.attributes=P),S.push(L),!y.hasNext()&&s(S.ops[S.ops.length-1],L)){const W=new p(m.rest());return S.concat(W).chop()}}else typeof H.delete=="number"&&(typeof M.retain=="number"||typeof M.retain=="object"&&M.retain!==null)&&S.push(H)}return S.chop()}concat(f){const m=new p(this.ops.slice());return f.ops.length>0&&(m.push(f.ops[0]),m.ops=m.ops.concat(f.ops.slice(1))),m}diff(f,m){if(this.ops===f.ops)return new p;const y=[this,f].map(M=>M.map(H=>{if(H.insert!=null)return typeof H.insert=="string"?H.insert:c;const L=M===f?"on":"with";throw new Error("diff() called "+L+" non-document")}).join("")),E=new p,w=t(y[0],y[1],m,!0),S=new o.default(this.ops),I=new o.default(f.ops);return w.forEach(M=>{let H=M[1].length;for(;H>0;){let L=0;switch(M[0]){case t.INSERT:L=Math.min(I.peekLength(),H),E.push(I.next(L));break;case t.DELETE:L=Math.min(H,S.peekLength()),S.next(L),E.delete(L);break;case t.EQUAL:L=Math.min(S.peekLength(),I.peekLength(),H);const P=S.next(L),W=I.next(L);s(P.insert,W.insert)?E.retain(L,i.default.diff(P.attributes,W.attributes)):E.push(W).delete(L);break}H-=L}}),E.chop()}eachLine(f,m=`
19`){const y=new o.default(this.ops);let E=new p,w=0;for(;y.hasNext();){if(y.peekType()!=="insert")return;const S=y.peek(),I=l.default.length(S)-y.peekLength(),M=typeof S.insert=="string"?S.insert.indexOf(m,I)-I:-1;if(M<0)E.push(y.next());else if(M>0)E.push(y.next(M));else{if(f(E,y.next(1).attributes||{},w)===!1)return;w+=1,E=new p}}E.length()>0&&f(E,{},w)}invert(f){const m=new p;return this.reduce((y,E)=>{if(E.insert)m.delete(l.default.length(E));else{if(typeof E.retain=="number"&&E.attributes==null)return m.retain(E.retain),y+E.retain;if(E.delete||typeof E.retain=="number"){const w=E.delete||E.retain;return f.slice(y,y+w).forEach(I=>{E.delete?m.push(I):E.retain&&E.attributes&&m.retain(l.default.length(I),i.default.invert(E.attributes,I.attributes))}),y+w}else if(typeof E.retain=="object"&&E.retain!==null){const w=f.slice(y,y+1),S=new o.default(w.ops).next(),[I,M,H]=d(E.retain,S.insert),L=p.getHandler(I);return m.retain({[I]:L.invert(M,H)},i.default.invert(E.attributes,S.attributes)),y+1}}return y},0),m.chop()}transform(f,m=!1){if(m=!!m,typeof f=="number")return this.transformPosition(f,m);const y=f,E=new o.default(this.ops),w=new o.default(y.ops),S=new p;for(;E.hasNext()||w.hasNext();)if(E.peekType()==="insert"&&(m||w.peekType()!=="insert"))S.retain(l.default.length(E.next()));else if(w.peekType()==="insert")S.push(w.next());else{const I=Math.min(E.peekLength(),w.peekLength()),M=E.next(I),H=w.next(I);if(M.delete)continue;if(H.delete)S.push(H);else{const L=M.retain,P=H.retain;let W=typeof P=="object"&&P!==null?P:I;if(typeof L=="object"&&L!==null&&typeof P=="object"&&P!==null){const re=Object.keys(L)[0];if(re===Object.keys(P)[0]){const fe=p.getHandler(re);fe&&(W={[re]:fe.transform(L[re],P[re],m)})}}S.retain(W,i.default.transform(M.attributes,H.attributes,m))}}return S.chop()}transformPosition(f,m=!1){m=!!m;const y=new o.default(this.ops);let E=0;for(;y.hasNext()&&E<=f;){const w=y.peekLength(),S=y.peekType();if(y.next(),S==="delete"){f-=Math.min(w,f-E);continue}else S==="insert"&&(E<f||!m)&&(f+=w);E+=w}return f}}p.Op=l.default,p.OpIterator=o.default,p.AttributeMap=i.default,p.handlers={},e.default=p,r.exports=p,r.exports.default=p})(hs,hs.exports)),hs.exports}var dt=em();const V=Wl(dt);class At extends st{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return""}}At.blotName="break";At.tagName="BR";let wt=class extends qs{};const tm={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function $s(r){return r.replace(/[&<>"']/g,e=>tm[e])}const It=class It extends Ta{static compare(e,t){const n=It.order.indexOf(e),s=It.order.indexOf(t);return n>=0||s>=0?n-s:e===t?0:e<t?-1:1}formatAt(e,t,n,s){if(It.compare(this.statics.blotName,n)<0&&this.scroll.query(n,Q.BLOT)){const i=this.isolate(e,t);s&&i.wrap(n,s)}else super.formatAt(e,t,n,s)}optimize(e){if(super.optimize(e),this.parent instanceof It&&It.compare(this.statics.blotName,this.parent.statics.blotName)>0){const t=this.parent.isolate(this.offset(),this.length());this.moveChildren(t),t.wrap(this)}}};U(It,"allowedChildren",[It,At,st,wt]),U(It,"order",["cursor","inline","link","underline","strike","italic","bold","script","code"]);let Bt=It;const wl=1;class Ue extends Br{constructor(){super(...arguments);
19U(this,"cache",{})}delta(){return this.cache.delta==null&&(this.cache.delta=Po(this)),this.cache.delta}deleteAt(t,n){super.deleteAt(t,n),this.cache={}}formatAt(t,n,s,i){n<=0||(this.scroll.query(s,Q.BLOCK)?t+n===this.length()&&this.format(s,i):super.formatAt(t,Math.min(n,this.length()-t-1),s,i),this.cache={})}insertAt(t,n,s){if(s!=null){super.insertAt(t,n,s),this.cache={};return}if(n.length===0)return;const i=n.split(`
20`),l=i.shift();l.length>0&&(t<this.length()-1||this.children.tail==null?super.insertAt(Math.min(t,this.length()-1),l):this.children.tail.insertAt(this.children.tail.length(),l),this.cache={});let o=this;i.reduce((c,d)=>(o=o.split(c,!0),o.insertAt(0,d),d.length),t+l.length)}insertBefore(t,n){const{head:s}=this.children;super.insertBefore(t,n),s instanceof At&&s.remove(),this.cache={}}length(){return this.cache.length==null&&(this.cache.length=super.length()+wl),this.cache.length}moveChildren(t,n){super.moveChildren(t,n),this.cache={}}optimize(t){super.optimize(t),this.cache={}}path(t){return super.path(t,!0)}removeChild(t){super.removeChild(t),this.cache={}}split(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(n&&(t===0||t>=this.length()-wl)){const i=this.clone();return t===0?(this.parent.insertBefore(i,this),this):(this.parent.insertBefore(i,this.next),i)}const s=super.split(t,n);return this.cache={},s}}Ue.blotName="block";Ue.tagName="P";Ue.defaultChild=At;Ue.allowedChildren=[At,Bt,st,wt];class ht extends st{attach(){super.attach(),this.attributes=new Ds(this.domNode)}delta(){return new V().insert(this.value(),{...this.formats(),...this.attributes.values()})}format(e,t){const n=this.scroll.query(e,Q.BLOCK_ATTRIBUTE);n!=null&&this.attributes.attribute(n,t)}formatAt(e,t,n,s){this.format(n,s)}insertAt(e,t,n){if(n!=null){super.insertAt(e,t,n);return}const s=t.split(`
21`),i=s.pop(),l=s.map(c=>{const d=this.scroll.create(Ue.blotName);return d.insertAt(0,c),d}),o=this.split(e);l.forEach(c=>{this.parent.insertBefore(c,o)}),i&&this.parent.insertBefore(this.scroll.create("text",i),o)}}ht.scope=Q.BLOCK_BLOT;function Po(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return r.descendants(Ve).reduce((t,n)=>n.length()===0?t:t.insert(n.value(),ct(n,{},e)),new V).insert(`
22`,ct(r))}function ct(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return r==null||("formats"in r&&typeof r.formats=="function"&&(e={...e,...r.formats()},t&&delete e["code-token"]),r.parent==null||r.parent.statics.blotName==="scroll"||r.parent.statics.scope!==r.statics.scope)?e:ct(r.parent,e,t)}const ot=class ot extends st{static value(){}constructor(e,t,n){super(e,t),this.selection=n,this.textNode=document.createTextNode(ot.CONTENTS),this.domNode.appendChild(this.textNode),this.savedLength=0}detach(){this.parent!=null&&this.parent.removeChild(this)}format(e,t){if(this.savedLength!==0){super.format(e,t);return}let n=this,s=0;for(;n!=null&&n.statics.scope!==Q.BLOCK_BLOT;)s+=n.offset(n.parent),n=n.parent;n!=null&&(this.savedLength=ot.CONTENTS.length,n.optimize(),n.formatAt(s,ot.CONTENTS.length,e,t),this.savedLength=0)}index(e,t){return e===this.textNode?0:super.index(e,t)}length(){return this.savedLength}position(){return[this.textNode,this.textNode.data.length]}remove(){super.remove(),this.parent=null}restore(){if(this.selection.composing||this.parent==null)return null;const e=this.selection.getNativeRange();for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);const t=this.prev instanceof wt?this.prev:null,n=t?t.length():0,s=this.next instanceof wt?this.next:null,i=s?s.text:"",{textNode:l}=this,o=l.data.split(ot.CONTENTS).join("");l.data=ot.CONTENTS;let c;if(t)c=t,(o||s)&&(t.insertAt(t.length(),o+i),s&&s.remove());else if(s)c=s,s.insertAt(0,o);else{const d=document.createTextNode(o);c=this.scroll.create(d),this.parent.insertBefore(c,this)}if(this.remove(),e){const d=(f,m)=>t&&f===t.domNode?m:f===l?n+m-1:s&&f===s.domNode?n+o.length+m:null,p=d(e.start.node,e.start.offset),x=d(e.end.node,e.end.offset);if(p!==null&&x!==null)return{startNode:c.domNode,startOffset:p,endNode:c.domNode,endOffset:x}}return null}update(e,t){if(e.some(n=>n.type==="characterData"&&n.target===this.textNode)){const n=this.restore(
22);n&&(t.range=n)}}optimize(e){super.optimize(e);let{parent:t}=this;for(;t;){if(t.domNode.tagName==="A"){this.savedLength=ot.CONTENTS.length,t.isolate(this.offset(t),this.length()).unwrap(),this.savedLength=0;break}t=t.parent}}value(){return""}};U(ot,"blotName","cursor"),U(ot,"className","ql-cursor"),U(ot,"tagName","span"),U(ot,"CONTENTS","\uFEFF");let lr=ot;var qi={exports:{}},Nl;function nm(){return Nl||(Nl=1,(function(r){var e=Object.prototype.hasOwnProperty,t="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(t=!1));function s(c,d,p){this.fn=c,this.context=d,this.once=p||!1}function i(c,d,p,x,f){if(typeof p!="function")throw new TypeError("The listener must be a function");var m=new s(p,x||c,f),y=t?t+d:d;return c._events[y]?c._events[y].fn?c._events[y]=[c._events[y],m]:c._events[y].push(m):(c._events[y]=m,c._eventsCount++),c}function l(c,d){--c._eventsCount===0?c._events=new n:delete c._events[d]}function o(){this._events=new n,this._eventsCount=0}o.prototype.eventNames=function(){var d=[],p,x;if(this._eventsCount===0)return d;for(x in p=this._events)e.call(p,x)&&d.push(t?x.slice(1):x);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(p)):d},o.prototype.listeners=function(d){var p=t?t+d:d,x=this._events[p];if(!x)return[];if(x.fn)return[x.fn];for(var f=0,m=x.length,y=new Array(m);f<m;f++)y[f]=x[f].fn;return y},o.prototype.listenerCount=function(d){var p=t?t+d:d,x=this._events[p];return x?x.fn?1:x.length:0},o.prototype.emit=function(d,p,x,f,m,y){var E=t?t+d:d;if(!this._events[E])return!1;var w=this._events[E],S=arguments.length,I,M;if(w.fn){switch(w.once&&this.removeListener(d,w.fn,void 0,!0),S){case 1:return w.fn.call(w.context),!0;case 2:return w.fn.call(w.context,p),!0;case 3:return w.fn.call(w.context,p,x),!0;case 4:return w.fn.call(w.context,p,x,f),!0;case 5:return w.fn.call(w.context,p,x,f,m),!0;case 6:return w.fn.call(w.context,p,x,f,m,y),!0}for(M=1,I=new Array(S-1);M<S;M++)I[M-1]=arguments[M];w.fn.apply(w.context,I)}else{var H=w.length,L;for(M=0;M<H;M++)switch(w[M].once&&this.removeListener(d,w[M].fn,void 0,!0),S){case 1:w[M].fn.call(w[M].context);break;case 2:w[M].fn.call(w[M].context,p);break;case 3:w[M].fn.call(w[M].context,p,x);break;case 4:w[M].fn.call(w[M].context,p,x,f);break;default:if(!I)for(L=1,I=new Array(S-1);L<S;L++)I[L-1]=arguments[L];w[M].fn.apply(w[M].context,I)}}return!0},o.prototype.on=function(d,p,x){return i(this,d,p,x,!1)},o.prototype.once=function(d,p,x){return i(this,d,p,x,!0)},o.prototype.removeListener=function(d,p,x,f){var m=t?t+d:d;if(!this._events[m])return this;if(!p)return l(this,m),this;var y=this._events[m];if(y.fn)y.fn===p&&(!f||y.once)&&(!x||y.context===x)&&l(this,m);else{for(var E=0,w=[],S=y.length;E<S;E++)(y[E].fn!==p||f&&!y[E].once||x&&y[E].context!==x)&&w.push(y[E]);w.length?this._events[m]=w.length===1?w[0]:w:l(this,m)}return this},o.prototype.removeAllListeners=function(d){var p;return d?(p=t?t+d:d,this._events[p]&&l(this,p)):(this._events=new n,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=t,o.EventEmitter=o,r.exports=o})(qi)),qi.exports}var rm=nm();const sm=Wl(rm),sa=new WeakMap,ia=["error","warn","log","info"];let aa="warn";function $o(r){if(aa&&ia.indexOf(r)<=ia.indexOf(aa)){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];console[r](...t)}}function Qt(r){return ia.reduce((e,t)=>(e[t]=$o.bind(console,t,r),e),{})}Qt.level=r=>{aa=r};$o.level=Qt.level;const ji=Qt("quill:events"),im=["selectionchange","mousedown","mouseup","click"];im.forEach(r=>{document.addEventListener(r,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];Array.from(document.querySelectorAll(".ql-container")).forEach(s=>{const i=sa.get(s);i&&i.emitter&&i.emitter.handleDOM(...t)})})});class G extends sm{constructor(){super(),this.domListeners={},this.on("error",ji.error)}emit(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return ji.log.call(ji,...t),super.emit(...t)}handleDOM(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];
22(this.domListeners[e.type]||[]).forEach(i=>{let{node:l,handler:o}=i;(e.target===l||l.contains(e.target))&&o(e,...n)})}listenDOM(e,t,n){this.domListeners[e]||(this.domListeners[e]=[]),this.domListeners[e].push({node:t,handler:n})}}U(G,"events",{EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_BLOT_MOUNT:"scroll-blot-mount",SCROLL_BLOT_UNMOUNT:"scroll-blot-unmount",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SCROLL_EMBED_UPDATE:"scroll-embed-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change",COMPOSITION_BEFORE_START:"composition-before-start",COMPOSITION_START:"composition-start",COMPOSITION_BEFORE_END:"composition-before-end",COMPOSITION_END:"composition-end"}),U(G,"sources",{API:"api",SILENT:"silent",USER:"user"});const Ii=Qt("quill:selection");class qn{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.index=e,this.length=t}}class am{constructor(e,t){this.emitter=t,this.scroll=e,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=this.scroll.create("cursor",this),this.savedRange=new qn(0,0),this.lastRange=this.savedRange,this.lastNative=null,this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,()=>{!this.mouseDown&&!this.composing&&setTimeout(this.update.bind(this,G.sources.USER),1)}),this.emitter.on(G.events.SCROLL_BEFORE_UPDATE,()=>{if(!this.hasFocus())return;const n=this.getNativeRange();n!=null&&n.start.node!==this.cursor.textNode&&this.emitter.once(G.events.SCROLL_UPDATE,(s,i)=>{try{this.root.contains(n.start.node)&&this.root.contains(n.end.node)&&this.setNativeRange(n.start.node,n.start.offset,n.end.node,n.end.offset);const l=i.some(o=>o.type==="characterData"||o.type==="childList"||o.type==="attributes"&&o.target===this.root);this.update(l?G.sources.SILENT:s)}catch{}})}),this.emitter.on(G.events.SCROLL_OPTIMIZE,(n,s)=>{if(s.range){const{startNode:i,startOffset:l,endNode:o,endOffset:c}=s.range;this.setNativeRange(i,l,o,c),this.update(G.sources.SILENT)}}),this.update(G.sources.SILENT)}handleComposition(){this.emitter.on(G.events.COMPOSITION_BEFORE_START,()=>{this.composing=!0}),this.emitter.on(G.events.COMPOSITION_END,()=>{if(this.composing=!1,this.cursor.parent){const e=this.cursor.restore();if(!e)return;setTimeout(()=>{this.setNativeRange(e.startNode,e.startOffset,e.endNode,e.endOffset)},1)}})}handleDragging(){this.emitter.listenDOM("mousedown",document.body,()=>{this.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,()=>{this.mouseDown=!1,this.update(G.sources.USER)})}focus(){this.hasFocus()||(this.root.focus({preventScroll:!0}),this.setRange(this.savedRange))}format(e,t){this.scroll.update();const n=this.getNativeRange();if(!(n==null||!n.native.collapsed||this.scroll.query(e,Q.BLOCK))){if(n.start.node!==this.cursor.textNode){const s=this.scroll.find(n.start.node,!1);if(s==null)return;if(s instanceof Ve){const i=s.split(n.start.offset);s.parent.insertBefore(this.cursor,i)}else s.insertBefore(this.cursor,n.start.node);this.cursor.attach()}this.cursor.format(e,t),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}getBounds(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const n=this.scroll.length();e=Math.min(e,n-1),t=Math.min(e+t,n-1)-e;let s,[i,l]=this.scroll.leaf(e);if(i==null)return null;if(t>0&&l===i.length()){const[p]=this.scroll.leaf(e+1);if(p){const[x]=this.scroll.line(e),[f]=this.scroll.line(e+1);x===f&&(i=p,l=0)}}[s,l]=i.position(l,!0);const o=document.createRange();if(t>0)return o.setStart(s,l),[i,l]=this.scroll.leaf(e+t),i==null?null:([s,l]=i.position(l,!0),o.setEnd(s,l),o.getBoundingClientRect());let c="left",d;if(s instanceof Text){if(!s.data.length)return null;l<s.data.length?(o.setStart(s,l),o.setEnd(s,l+1)):(o.setStart(s,l-1),o.setEnd(s,l),c="right"),d=o.getBoundingClientRect()}else{if(!(i.domNode instanceof Element))return null;d=i.domNode.getBoundingClientRect(),l>0&&(c="right")}return{bottom:d.top+d.height,height:d.height,left:d[c],right:d[c],top:d.top,width:0}}getNativeRange(){const e=document.getSelection();if(e==null||e.rangeCount<=0)return null;const t=e.getRangeAt(0);if(t==null)return null;const n=this.normalizeNative(t);return Ii.info("getNativeRange",n),n}getRange(){const e=this.scroll.domNode;
22if("isConnected"in e&&!e.isConnected)return[null,null];const t=this.getNativeRange();return t==null?[null,null]:[this.normalizedToRange(t),t]}hasFocus(){return document.activeElement===this.root||document.activeElement!=null&&ki(this.root,document.activeElement)}normalizedToRange(e){const t=[[e.start.node,e.start.offset]];e.native.collapsed||t.push([e.end.node,e.end.offset]);const n=t.map(l=>{const[o,c]=l,d=this.scroll.find(o,!0),p=d.offset(this.scroll);return c===0?p:d instanceof Ve?p+d.index(o,c):p+d.length()}),s=Math.min(Math.max(...n),this.scroll.length()-1),i=Math.min(s,...n);return new qn(i,s-i)}normalizeNative(e){if(!ki(this.root,e.startContainer)||!e.collapsed&&!ki(this.root,e.endContainer))return null;const t={start:{node:e.startContainer,offset:e.startOffset},end:{node:e.endContainer,offset:e.endOffset},native:e};return[t.start,t.end].forEach(n=>{let{node:s,offset:i}=n;for(;!(s instanceof Text)&&s.childNodes.length>0;)if(s.childNodes.length>i)s=s.childNodes[i],i=0;else if(s.childNodes.length===i)s=s.lastChild,s instanceof Text?i=s.data.length:s.childNodes.length>0?i=s.childNodes.length:i=s.childNodes.length+1;else break;n.node=s,n.offset=i}),t}rangeToNative(e){const t=this.scroll.length(),n=(s,i)=>{s=Math.min(t-1,s);const[l,o]=this.scroll.leaf(s);return l?l.position(o,i):[null,-1]};return[...n(e.index,!1),...n(e.index+e.length,!0)]}setNativeRange(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:t,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(Ii.info("setNativeRange",e,t,n,s),e!=null&&(this.root.parentNode==null||e.parentNode==null||n.parentNode==null))return;const l=document.getSelection();if(l!=null)if(e!=null){this.hasFocus()||this.root.focus({preventScroll:!0});const{native:o}=this.getNativeRange()||{};if(o==null||i||e!==o.startContainer||t!==o.startOffset||n!==o.endContainer||s!==o.endOffset){e instanceof Element&&e.tagName==="BR"&&(t=Array.from(e.parentNode.childNodes).indexOf(e),e=e.parentNode),n instanceof Element&&n.tagName==="BR"&&(s=Array.from(n.parentNode.childNodes).indexOf(n),n=n.parentNode);const c=document.createRange();c.setStart(e,t),c.setEnd(n,s),l.removeAllRanges(),l.addRange(c)}}else l.removeAllRanges(),this.root.blur()}setRange(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:G.sources.API;if(typeof t=="string"&&(n=t,t=!1),Ii.info("setRange",e),e!=null){const s=this.rangeToNative(e);this.setNativeRange(...s,t)}else this.setNativeRange(null);this.update(n)}update(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:G.sources.USER;const t=this.lastRange,[n,s]=this.getRange();if(this.lastRange=n,this.lastNative=s,this.lastRange!=null&&(this.savedRange=this.lastRange),!ln(t,this.lastRange)){if(!this.composing&&s!=null&&s.native.collapsed&&s.start.node!==this.cursor.textNode){const l=this.cursor.restore();l&&this.setNativeRange(l.startNode,l.startOffset,l.endNode,l.endOffset)}const i=[G.events.SELECTION_CHANGE,tr(this.lastRange),tr(t),e];this.emitter.emit(G.events.EDITOR_CHANGE,...i),e!==G.sources.SILENT&&this.emitter.emit(...i)}}}function ki(r,e){try{e.parentNode}catch{return!1}return r.contains(e)}const lm=/^[ -~]*$/;let om=class{constructor(e){this.scroll=e,this.delta=this.getDelta()}applyDelta(e){this.scroll.update();let t=this.scroll.length();this.scroll.batchStart();const n=Al(e),s=new V;return um(n.ops.slice()).reduce((l,o)=>{const c=dt.Op.length(o);let d=o.attributes||{},p=!1,x=!1;if(o.insert!=null){if(s.retain(c),typeof o.insert=="string"){const y=o.insert;x=!y.endsWith(`
23`)&&(t<=l||!!this.scroll.descendant(ht,l)[0]),this.scroll.insertAt(l,y);const[E,w]=this.scroll.line(l);let S=hn({},ct(E));if(E instanceof Ue){const[I]=E.descendant(Ve,w);I&&(S=hn(S,ct(I)))}d=dt.AttributeMap.diff(S,d)||{}}else if(typeof o.insert=="object"){const y=Object.keys(o.insert)[0];if(y==null)return l;const E=this.scroll.query(y,Q.INLINE)!=null;if(E)(t<=l||this.scroll.descendant(ht,l)[0])&&(x=!0);else if(l>0){const[w,S]=this.scroll.descendant(Ve,l-1);
23w instanceof wt?w.value()[S]!==`
24`&&(p=!0):w instanceof st&&w.statics.scope===Q.INLINE_BLOT&&(p=!0)}if(this.scroll.insertAt(l,y,o.insert[y]),E){const[w]=this.scroll.descendant(Ve,l);if(w){const S=hn({},ct(w));d=dt.AttributeMap.diff(S,d)||{}}}}t+=c}else if(s.push(o),o.retain!==null&&typeof o.retain=="object"){const y=Object.keys(o.retain)[0];if(y==null)return l;this.scroll.updateEmbedAt(l,y,o.retain[y])}Object.keys(d).forEach(y=>{this.scroll.formatAt(l,c,y,d[y])});const f=p?1:0,m=x?1:0;return t+=f+m,s.retain(f),s.delete(m),l+c+f+m},0),s.reduce((l,o)=>typeof o.delete=="number"?(this.scroll.deleteAt(l,o.delete),l):l+dt.Op.length(o),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(n)}deleteText(e,t){return this.scroll.deleteAt(e,t),this.update(new V().retain(e).delete(t))}formatLine(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.scroll.update(),Object.keys(n).forEach(i=>{this.scroll.lines(e,Math.max(t,1)).forEach(l=>{l.format(i,n[i])})}),this.scroll.optimize();const s=new V().retain(e).retain(t,tr(n));return this.update(s)}formatText(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.keys(n).forEach(i=>{this.scroll.formatAt(e,t,i,n[i])});const s=new V().retain(e).retain(t,tr(n));return this.update(s)}getContents(e,t){return this.delta.slice(e,e+t)}getDelta(){return this.scroll.lines().reduce((e,t)=>e.concat(t.delta()),new V)}getFormat(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=[],s=[];t===0?this.scroll.path(e).forEach(o=>{const[c]=o;c instanceof Ue?n.push(c):c instanceof Ve&&s.push(c)}):(n=this.scroll.lines(e,t),s=this.scroll.descendants(Ve,e,t));const[i,l]=[n,s].map(o=>{const c=o.shift();if(c==null)return{};let d=ct(c);for(;Object.keys(d).length>0;){const p=o.shift();if(p==null)return d;d=cm(ct(p),d)}return d});return{...i,...l}}getHTML(e,t){const[n,s]=this.scroll.line(e);if(n){const i=n.length();return n.length()>=s+t&&!(s===0&&t===i)?Dr(n,s,t,!0):Dr(this.scroll,e,t,!0)}return""}getText(e,t){return this.getContents(e,t).filter(n=>typeof n.insert=="string").map(n=>n.insert).join("")}insertContents(e,t){const n=Al(t),s=new V().retain(e).concat(n);return this.scroll.insertContents(e,n),this.update(s)}insertEmbed(e,t,n){return this.scroll.insertAt(e,t,n),this.update(new V().retain(e).insert({[t]:n}))}insertText(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t=t.replace(/\r\n/g,`
25`).replace(/\r/g,`
26`),this.scroll.insertAt(e,t),Object.keys(n).forEach(s=>{this.scroll.formatAt(e,t.length,s,n[s])}),this.update(new V().retain(e).insert(t,tr(n)))}isBlank(){if(this.scroll.children.length===0)return!0;if(this.scroll.children.length>1)return!1;const e=this.scroll.children.head;if((e==null?void 0:e.statics.blotName)!==Ue.blotName)return!1;const t=e;return t.children.length>1?!1:t.children.head instanceof At}removeFormat(e,t){const n=this.getText(e,t),[s,i]=this.scroll.line(e+t);let l=0,o=new V;s!=null&&(l=s.length()-i,o=s.delta().slice(i,i+l-1).insert(`
27`));const d=this.getContents(e,t+l).diff(new V().insert(n).concat(o)),p=new V().retain(e).concat(d);return this.applyDelta(p)}update(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;const s=this.delta;if(t.length===1&&t[0].type==="characterData"&&t[0].target.data.match(lm)&&this.scroll.find(t[0].target)){const i=this.scroll.find(t[0].target),l=ct(i),o=i.offset(this.scroll),c=t[0].oldValue.replace(lr.CONTENTS,""),d=new V().insert(c),p=new V().insert(i.value()),x=n&&{oldRange:Tl(n.oldRange,-o),newRange:Tl(n.newRange,-o)};e=new V().retain(o).concat(d.diff(p,x)).reduce((m,y)=>y.insert?m.insert(y.insert,l):m.push(y),new V),this.delta=s.compose(e)}else this.delta=this.getDelta(),(!e||!ln(s.compose(e),this.delta))&&(e=s.diff(this.delta,n));return e}};function Jn(r,e,t){if(r.length===0){const[m]=_i(t.pop());return e<=0?`</li></${m}>`:`</li></${m}>${Jn([],e-1,t)}`}const[{child:n,offset:s,length:i,indent:l,type:o},...c]=r,[d,p]=_i(o);if(l>e)return t.push(o),l===e+1?`<${d}><li${p}>${Dr(n,s,i)}${Jn(c,l,t)}`:`<${d}><li>${Jn(r,e+1,t)}`;const x=t[t.length-1];if(l===e&&o===x)return`</li><li${p}>${Dr(n,s,i)}${Jn(c,l,t)}`;const[f]=_i(t.pop());return`</li></${f}>${Jn(r,e-1,t)}`}function Dr(r,e,t){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if("html"in r&&typeof r.html=="function")return r.html(e,t);if(r instanceof wt)return $s(r.value().slice(e,e+t)).replaceAll(" ","&nbsp;");if(r instanceof Et){if(r.statics.blotName==="list-container"){const d=[];
27return r.children.forEachAt(e,t,(p,x,f)=>{const m="formats"in p&&typeof p.formats=="function"?p.formats():{};d.push({child:p,offset:x,length:f,indent:m.indent||0,type:m.list})}),Jn(d,-1,[])}const s=[];if(r.children.forEachAt(e,t,(d,p,x)=>{s.push(Dr(d,p,x))}),n||r.statics.blotName==="list")return s.join("");const{outerHTML:i,innerHTML:l}=r.domNode,[o,c]=i.split(`>${l}<`);return o==="<table"?`<table style="border: 1px solid #000;">${s.join("")}<${c}`:`${o}>${s.join("")}<${c}`}return r.domNode instanceof Element?r.domNode.outerHTML:""}function cm(r,e){return Object.keys(e).reduce((t,n)=>{if(r[n]==null)return t;const s=e[n];return s===r[n]?t[n]=s:Array.isArray(s)?s.indexOf(r[n])<0?t[n]=s.concat([r[n]]):t[n]=s:t[n]=[s,r[n]],t},{})}function _i(r){const e=r==="ordered"?"ol":"ul";switch(r){case"checked":return[e,' data-list="checked"'];case"unchecked":return[e,' data-list="unchecked"'];default:return[e,""]}}function Al(r){return r.reduce((e,t)=>{if(typeof t.insert=="string"){const n=t.insert.replace(/\r\n/g,`
28`).replace(/\r/g,`
29`);return e.insert(n,t.attributes)}return e.push(t)},new V)}function Tl(r,e){let{index:t,length:n}=r;return new qn(t+e,n)}function um(r){const e=[];return r.forEach(t=>{typeof t.insert=="string"?t.insert.split(`
30`).forEach((s,i)=>{i&&e.push({insert:`
31`,attributes:t.attributes}),s&&e.push({insert:s,attributes:t.attributes})}):e.push(t)}),e}class Tt{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.quill=e,this.options=t}}U(Tt,"DEFAULTS",{});const gs="\uFEFF";class Sa extends st{constructor(e,t){super(e,t),this.contentNode=document.createElement("span"),this.contentNode.setAttribute("contenteditable","false"),Array.from(this.domNode.childNodes).forEach(n=>{this.contentNode.appendChild(n)}),this.leftGuard=document.createTextNode(gs),this.rightGuard=document.createTextNode(gs),this.domNode.appendChild(this.leftGuard),this.domNode.appendChild(this.contentNode),this.domNode.appendChild(this.rightGuard)}index(e,t){return e===this.leftGuard?0:e===this.rightGuard?1:super.index(e,t)}restore(e){let t=null,n;const s=e.data.split(gs).join("");if(e===this.leftGuard)if(this.prev instanceof wt){const i=this.prev.length();this.prev.insertAt(i,s),t={startNode:this.prev.domNode,startOffset:i+s.length}}else n=document.createTextNode(s),this.parent.insertBefore(this.scroll.create(n),this),t={startNode:n,startOffset:s.length};else e===this.rightGuard&&(this.next instanceof wt?(this.next.insertAt(0,s),t={startNode:this.next.domNode,startOffset:s.length}):(n=document.createTextNode(s),this.parent.insertBefore(this.scroll.create(n),this.next),t={startNode:n,startOffset:s.length}));return e.data=gs,t}update(e,t){e.forEach(n=>{if(n.type==="characterData"&&(n.target===this.leftGuard||n.target===this.rightGuard)){const s=this.restore(n.target);s&&(t.range=s)}})}}class hm{constructor(e,t){U(this,"isComposing",!1);this.scroll=e,this.emitter=t,this.setupListeners()}setupListeners(){this.scroll.domNode.addEventListener("compositionstart",e=>{this.isComposing||this.handleCompositionStart(e)}),this.scroll.domNode.addEventListener("compositionend",e=>{this.isComposing&&queueMicrotask(()=>{this.handleCompositionEnd(e)})})}handleCompositionStart(e){const t=e.target instanceof Node?this.scroll.find(e.target,!0):null;t&&!(t instanceof Sa)&&(this.emitter.emit(G.events.COMPOSITION_BEFORE_START,e),this.scroll.batchStart(),this.emitter.emit(G.events.COMPOSITION_START,e),this.isComposing=!0)}handleCompositionEnd(e){this.emitter.emit(G.events.COMPOSITION_BEFORE_END,e),this.scroll.batchEnd(),this.emitter.emit(G.events.COMPOSITION_END,e),this.isComposing=!1}}const Ir=class Ir{constructor(e,t){U(this,"modules",{});this.quill=e,this.options=t}init(){Object.keys(this.options.modules).forEach(e=>{this.modules[e]==null&&this.addModule(e)})}addModule(e){const t=this.quill.constructor.import(`modules/${e}`);return this.modules[e]=new t(this.quill,this.options.modules[e]||{}),this.modules[e]}};U(Ir,"DEFAULTS",{modules:{}}),U(Ir,"themes",{default:Ir});let or=Ir;const dm=r=>r.parentElement||r.getRootNode().host||null,fm=r=>{const e=r.getBoundingClientRect(),t="offsetWidth"in r&&Math.abs(e.width)/r.offsetWidth||1,n="offsetHeight"in r&&Math.abs(e.height)/r.offsetHeight||1;return{top:e.top,right:e.left+r.clientWidth*t,bottom:e.top+r.clientHeight*n,left:e.left}},ms=r=>{const e=parseInt(r,10);return Number.isNaN(e)?0:e},Cl=(r,e,t,n,s,i)=>r<t&&e>n?0:r<t?-(t-r+s):e>n?e-r>n-t?r+s-t:e-n+i:0,pm=(r,e)=>{var i,l,o;const t=r.ownerDocument;let n=e,s=r;for(;s;
31){const c=s===t.body,d=c?{top:0,right:((i=window.visualViewport)==null?void 0:i.width)??t.documentElement.clientWidth,bottom:((l=window.visualViewport)==null?void 0:l.height)??t.documentElement.clientHeight,left:0}:fm(s),p=getComputedStyle(s),x=Cl(n.left,n.right,d.left,d.right,ms(p.scrollPaddingLeft),ms(p.scrollPaddingRight)),f=Cl(n.top,n.bottom,d.top,d.bottom,ms(p.scrollPaddingTop),ms(p.scrollPaddingBottom));if(x||f)if(c)(o=t.defaultView)==null||o.scrollBy(x,f);else{const{scrollLeft:m,scrollTop:y}=s;f&&(s.scrollTop+=f),x&&(s.scrollLeft+=x);const E=s.scrollLeft-m,w=s.scrollTop-y;n={left:n.left-E,top:n.top-w,right:n.right-E,bottom:n.bottom-w}}s=c||p.position==="fixed"?null:dm(s)}},gm=100,mm=["block","break","cursor","inline","scroll","text"],bm=(r,e,t)=>{const n=new ar;return mm.forEach(s=>{const i=e.query(s);i&&n.register(i)}),r.forEach(s=>{let i=e.query(s);i||t.error(`Cannot register "${s}" specified in "formats" config. Are you sure it was registered?`);let l=0;for(;i;)if(n.register(i),i="blotName"in i?i.requiredContainer??null:null,l+=1,l>gm){t.error(`Cycle detected in registering blot requiredContainer: "${s}"`);break}}),n},rr=Qt("quill"),bs=new ar;Et.uiClass="ql-ui";const bt=class bt{static debug(e){e===!0&&(e="log"),Qt.level(e)}static find(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return sa.get(e)||bs.find(e,t)}static import(e){return this.imports[e]==null&&rr.error(`Cannot import ${e}. Are you sure it was registered?`),this.imports[e]}static register(){if(typeof(arguments.length<=0?void 0:arguments[0])!="string"){const e=arguments.length<=0?void 0:arguments[0],t=!!(!(arguments.length<=1)&&arguments[1]),n="attrName"in e?e.attrName:e.blotName;typeof n=="string"?this.register(`formats/${n}`,e,t):Object.keys(e).forEach(s=>{this.register(s,e[s],t)})}else{const e=arguments.length<=0?void 0:arguments[0],t=arguments.length<=1?void 0:arguments[1],n=!!(!(arguments.length<=2)&&arguments[2]);this.imports[e]!=null&&!n&&rr.warn(`Overwriting ${e} with`,t),this.imports[e]=t,(e.startsWith("blots/")||e.startsWith("formats/"))&&t&&typeof t!="boolean"&&t.blotName!=="abstract"&&bs.register(t),typeof t.register=="function"&&t.register(bs)}}constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.options=ym(e,t),this.container=this.options.container,this.container==null){rr.error("Invalid Quill container",e);return}this.options.debug&&bt.debug(this.options.debug);const n=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",sa.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new G;const s=Ca.blotName,i=this.options.registry.query(s);if(!i||!("blotName"in i))throw new Error(`Cannot initialize Quill without "${s}" blot`);if(this.scroll=new i(this.options.registry,this.root,{emitter:this.emitter}),this.editor=new om(this.scroll),this.selection=new am(this.scroll,this.emitter),this.composition=new hm(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.uploader=this.theme.addModule("uploader"),this.theme.addModule("input"),this.theme.addModule("uiNode"),this.theme.init(),this.emitter.on(G.events.EDITOR_CHANGE,l=>{l===G.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())}),this.emitter.on(G.events.SCROLL_UPDATE,(l,o)=>{const c=this.selection.lastRange,[d]=this.selection.getRange(),p=c&&d?{oldRange:c,newRange:d}:void 0;mt.call(this,()=>this.editor.update(null,o,p),l)}),this.emitter.on(G.events.SCROLL_EMBED_UPDATE,(l,o)=>{const c=this.selection.lastRange,[d]=this.selection.getRange(),p=c&&d?{oldRange:c,newRange:d}:void 0;mt.call(this,()=>{const x=new V().retain(l.offset(this)).retain({[l.statics.blotName]:o});return this.editor.update(x,[],p)},bt.sources.USER)}),n){const l=this.clipboard.convert({html:`${n}<p><br></p>`,text:`
32`});this.setContents(l)}this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable(),this.allowReadOnlyEdits=!1}addContainer(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof e=="string"){const n=e;e=document.createElement("div"),e.classList.add(n)}return this.container.insertBefore(e,t),e}blur(){this.selection.setRange(null)}deleteText(e,t,n){return[e,t,,n]=zt(e,t,n),mt.call(this,()=>this.editor.deleteText(e,t),n,e,-1*t)}disable(){this.enable(!1)}editReadOnly(e){this.allowReadOnlyEdits=!0;const t=e();return this.allowReadOnlyEdits=!1,t}enable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(e),this.container.classList.toggle("ql-disabled",!e)}focus(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.selection.focus(),e.preventScroll||this.scrollSelectionIntoView()}format(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:G.sources.API;return mt.call(this,()=>{const s=this.getSelection(!0);let i=new V;if(s==null)return i;if(this.scroll.query(e,Q.BLOCK))i=this.editor.formatLine(s.index,s.length,{[e]:t});else{if(s.length===0)return this.selection.format(e,t),i;i=this.editor.formatText(s.index,s.length,{[e]:t})}return this.setSelection(s,G.sources.SILENT),i},n)}formatLine(e,t,n,s,i){let l;return[e,t,l,i]=zt(e,t,n,s,i),mt.call(this,()=>this.editor.formatLine(e,t,l),i,e,0)}formatText(e,t,n,s,i){let l;return[e,t,l,i]=zt(e,t,n,s,i),mt.call(this,()=>this.editor.formatText(e,t,l),i,e,0)}getBounds(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=null;if(typeof e=="number"?n=this.selection.getBounds(e,t):n=this.selection.getBounds(e.index,e.length),!n)return null;const s=this.container.getBoundingClientRect();return{bottom:n.bottom-s.top,height:n.height,left:n.left-s.left,right:n.right-s.left,top:n.top-s.top,width:n.width}}getContents(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-e;return[e,t]=zt(e,t),this.editor.getContents(e,t)}getFormat(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof e=="number"?this.editor.getFormat(e,t):this.editor.getFormat(e.index,e.length)}getIndex(e){return e.offset(this.scroll)}getLength(){return this.scroll.length()}getLeaf(e){return this.scroll.leaf(e)}getLine(e){return this.scroll.line(e)}getLines(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof e!="number"?this.scroll.lines(e.index,e.length):this.scroll.lines(e,t)}getModule(e){return this.theme.modules[e]}getSelection(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1)&&this.focus(),this.update(),this.selection.getRange()[0]}getSemanticHTML(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;return typeof e=="number"&&(t=t??this.getLength()-e),[e,t]=zt(e,t),this.editor.getHTML(e,t)}getText(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;return typeof e=="number"&&(t=t??this.getLength()-e),[e,t]=zt(e,t),this.editor.getText(e,t)}hasFocus(){return this.selection.hasFocus()}insertEmbed(e,t,n){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:bt.sources.API;return mt.call(this,()=>this.editor.insertEmbed(e,t,n),s,e)}insertText(e,t,n,s,i){let l;return[e,,l,i]=zt(e,0,n,s,i),mt.call(this,()=>this.editor.insertText(e,t,l),i,e,t.length)}isEnabled(){return this.scroll.isEnabled()}off(){return this.emitter.off(...arguments)}on(){return this.emitter.on(...arguments)}once(){return this.emitter.once(...arguments)}removeFormat(e,t,n){return[e,t,,n]=zt(e,t,n),mt.call(this,()=>this.editor.removeFormat(e,t),n,e)}scrollRectIntoView(e){pm(this.root,e)}scrollIntoView(){console.warn("Quill#scrollIntoView() has been deprecated and will be removed in the near future. Please use Quill#scrollSelectionIntoView() instead."),this.scrollSelectionIntoView()}scrollSelectionIntoView(){const e=this.selection.lastRange,t=e&&this.selection.getBounds(e.index,e.length);t&&this.scrollRectIntoView(t)}setContents(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:G.sources.API;return mt.call(this,()=>{e=new V(e);const n=this.getLength(),s=this.editor.deleteText(0,n),i=this.editor.insertContents(0,e),l=this.editor.deleteText(this.getLength()-1,1);return s.compose(i).compose(l)},t)}setSelection(e,t,n){e==null?this.selection.setRange(null,t||bt.sources.API):([e,t,,n]=zt(e,t,n),this.selection.setRange(new qn(Math.max(0,e),t),n),n!==G.sources.SILENT&&this.scrollSelectionIntoView())}setText(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:G.sources.API;const n=new V().insert(e);return this.setContents(n,t)}update(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:G.sources.USER;const t=this.scroll.update(e);return this.selection.update(e),t}updateContents(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:G.sources.API;return mt.call(this,()=>(e=new V(e),this.editor.applyDelta(e)),t,!0)}};U(bt,"DEFAULTS",{bounds:null,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0},placeholder:"",readOnly:!1,registry:bs,theme:"default"}),U(bt,"events",G.events),U(bt,"sources",G.sources),U(bt,"version","2.0.3"),U(bt,"imports",{delta:V,parchment:Zg,"core/module":Tt,"core/theme":or});let C=bt;function Sl(r){return typeof r=="string"?document.querySelector(r):r}function Ri(r){return Object.entries(r??{}).reduce((e,t)=>
32{let[n,s]=t;return{...e,[n]:s===!0?{}:s}},{})}function Ll(r){return Object.fromEntries(Object.entries(r).filter(e=>e[1]!==void 0))}function ym(r,e){const t=Sl(r);if(!t)throw new Error("Invalid Quill container");const s=!e.theme||e.theme===C.DEFAULTS.theme?or:C.import(`themes/${e.theme}`);if(!s)throw new Error(`Invalid theme ${e.theme}. Did you register it?`);const{modules:i,...l}=C.DEFAULTS,{modules:o,...c}=s.DEFAULTS;let d=Ri(e.modules);d!=null&&d.toolbar&&d.toolbar.constructor!==Object&&(d={...d,toolbar:{container:d.toolbar}});const p=hn({},Ri(i),Ri(o),d),x={...l,...Ll(c),...Ll(e)};let f=e.registry;return f?e.formats&&rr.warn('Ignoring "formats" option because "registry" is specified'):f=e.formats?bm(e.formats,x.registry,rr):x.registry,{...x,registry:f,container:t,theme:s,modules:Object.entries(p).reduce((m,y)=>{let[E,w]=y;if(!w)return m;const S=C.import(`modules/${E}`);return S==null?(rr.error(`Cannot load ${E} module. Are you sure you registered it?`),m):{...m,[E]:hn({},S.DEFAULTS||{},w)}},{}),bounds:Sl(x.bounds)}}function mt(r,e,t,n){if(!this.isEnabled()&&e===G.sources.USER&&!this.allowReadOnlyEdits)return new V;let s=t==null?null:this.getSelection();const i=this.editor.delta,l=r();if(s!=null&&(t===!0&&(t=s.index),n==null?s=Ol(s,l,e):n!==0&&(s=Ol(s,t,n,e)),this.setSelection(s,G.sources.SILENT)),l.length()>0){const o=[G.events.TEXT_CHANGE,l,i,e];this.emitter.emit(G.events.EDITOR_CHANGE,...o),e!==G.sources.SILENT&&this.emitter.emit(...o)}return l}function zt(r,e,t,n,s){let i={};return typeof r.index=="number"&&typeof r.length=="number"?typeof e!="number"?(s=n,n=t,t=e,e=r.length,r=r.index):(e=r.length,r=r.index):typeof e!="number"&&(s=n,n=t,t=e,e=0),typeof t=="object"?(i=t,s=n):typeof t=="string"&&(n!=null?i[t]=n:s=t),s=s||G.sources.API,[r,e,i,s]}function Ol(r,e,t,n){const s=typeof t=="number"?t:0;if(r==null)return null;let i,l;return e&&typeof e.transformPosition=="function"?[i,l]=[r.index,r.index+r.length].map(o=>e.transformPosition(o,n!==G.sources.USER)):[i,l]=[r.index,r.index+r.length].map(o=>o<e||o===e&&n===G.sources.USER?o:s>=0?o+s:Math.max(e,o+s)),new qn(i,l-i)}class _n extends Ps{}function ql(r){return r instanceof Ue||r instanceof ht}function jl(r){return typeof r.updateContent=="function"}class er extends Ca{constructor(e,t,n){let{emitter:s}
32=n;super(e,t),this.emitter=s,this.batch=!1,this.optimize(),this.enable(),this.domNode.addEventListener("dragstart",i=>this.handleDragStart(i))}batchStart(){Array.isArray(this.batch)||(this.batch=[])}batchEnd(){if(!this.batch)return;const e=this.batch;this.batch=!1,this.update(e)}emitMount(e){this.emitter.emit(G.events.SCROLL_BLOT_MOUNT,e)}emitUnmount(e){this.emitter.emit(G.events.SCROLL_BLOT_UNMOUNT,e)}emitEmbedUpdate(e,t){this.emitter.emit(G.events.SCROLL_EMBED_UPDATE,e,t)}deleteAt(e,t){const[n,s]=this.line(e),[i]=this.line(e+t);if(super.deleteAt(e,t),i!=null&&n!==i&&s>0){if(n instanceof ht||i instanceof ht){this.optimize();return}const l=i.children.head instanceof At?null:i.children.head;n.moveChildren(i,l),n.remove()}this.optimize()}enable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",e?"true":"false")}formatAt(e,t,n,s){super.formatAt(e,t,n,s),this.optimize()}insertAt(e,t,n){if(e>=this.length())if(n==null||this.scroll.query(t,Q.BLOCK)==null){const s=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(s),n==null&&t.endsWith(`
33`)?s.insertAt(0,t.slice(0,-1),n):s.insertAt(0,t,n)}else{const s=this.scroll.create(t,n);this.appendChild(s)}else super.insertAt(e,t,n);this.optimize()}insertBefore(e,t){if(e.statics.scope===Q.INLINE_BLOT){const n=this.scroll.create(this.statics.defaultChild.blotName);n.appendChild(e),super.insertBefore(n,t)}else super.insertBefore(e,t)}insertContents(e,t){const n=this.deltaToRenderBlocks(t.concat(new V().insert(`
34`))),s=n.pop();if(s==null)return;this.batchStart();const i=n.shift();if(i){const c=i.type==="block"&&(i.delta.length()===0||!this.descendant(ht,e)[0]&&e<this.length()),d=i.type==="block"?i.delta:new V().insert({[i.key]:i.value});Mi(this,e,d);const p=i.type==="block"?1:0,x=e+d.length()+p;c&&this.insertAt(x-1,`
35`);const f=ct(this.line(e)[0]),m=dt.AttributeMap.diff(f,i.attributes)||{};Object.keys(m).forEach(y=>{this.formatAt(x-1,1,y,m[y])}),e=x}let[l,o]=this.children.find(e);if(n.length&&(l&&(l=l.split(o),o=0),n.forEach(c=>{if(c.type==="block"){const d=this.createBlock(c.attributes,l||void 0);Mi(d,0,c.delta)}else{const d=this.create(c.key,c.value);this.insertBefore(d,l||void 0),Object.keys(c.attributes).forEach(p=>{d.format(p,c.attributes[p])})}})),s.type==="block"&&s.delta.length()){const c=l?l.offset(l.scroll)+o:this.length();Mi(this,c,s.delta)}this.batchEnd(),this.optimize()}isEnabled(){return this.domNode.getAttribute("contenteditable")==="true"}leaf(e){const t=this.path(e).pop();if(!t)return[null,-1];const[n,s]=t;return n instanceof Ve?[n,s]:[null,-1]}line(e){return e===this.length()?this.line(e-1):this.descendant(ql,e)}lines(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;const n=(s,i,l)=>{let o=[],c=l;return s.children.forEachAt(i,l,(d,p,x)=>{ql(d)?o.push(d):d instanceof Ps&&(o=o.concat(n(d,p,c))),c-=x}),o};return n(this,e,t)}optimize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch||(super.optimize(e,t),e.length>0&&this.emitter.emit(G.events.SCROLL_OPTIMIZE,e,t))}path(e){return super.path(e).slice(1)}remove(){}update(e){if(this.batch){Array.isArray(e)&&(this.batch=this.batch.concat(e));return}let t=G.sources.USER;typeof e=="string"&&(t=e),Array.isArray(e)||(e=this.observer.takeRecords()),e=e.filter(n=>{let{target:s}=n;const i=this.find(s,!0);return i&&!jl(i)}),e.length>0&&this.emitter.emit(G.events.SCROLL_BEFORE_UPDATE,t,e),super.update(e.concat([])),e.length>0&&this.emitter.emit(G.events.SCROLL_UPDATE,t,e)}updateEmbedAt(e,t,n){const[s]=this.descendant(i=>i instanceof ht,e);s&&s.statics.blotName===t&&jl(s)&&s.updateContent(n)}handleDragStart(e){e.preventDefault()}deltaToRenderBlocks(e){const t=[];let n=new V;return e.forEach(s=>{const i=s==null?void 0:s.insert;if(i)if(typeof i=="string"){const l=i.split(`
36`);l.slice(0,-1).forEach(c=>{n.insert(c,s.attributes),t.push({type:"block",delta:n,attributes:s.attributes??{}}),n=new V});const o=l[l.length-1];o&&n.insert(o,s.attributes)}else{const l=Object.keys(i)[0];if(!l)return;this.query(l,Q.INLINE)?n.push(s):(n.length()&&t.push({type:"block",delta:n,attributes:{}}),n=new V,t.push({type:"blockEmbed",key:l,value:i[l],attributes:s.attributes??{}}))}}),n.length()&&t.push({type:"block",delta:n,attributes:{}}),t}createBlock(e,t){let n;const s={};Object.entries(e).forEach(o=>{let[c,d]=o;this.query(c,Q.BLOCK&Q.BLOT)!=null?n=c:s[c]=d});const i=this.create(n||this.statics.defaultChild.blotName,n?e[n]:void 0);this.insertBefore(i,t||void 0);const l=i.length();
36return Object.entries(s).forEach(o=>{let[c,d]=o;i.formatAt(0,l,c,d)}),i}}U(er,"blotName","scroll"),U(er,"className","ql-editor"),U(er,"tagName","DIV"),U(er,"defaultChild",Ue),U(er,"allowedChildren",[Ue,ht,_n]);function Mi(r,e,t){t.reduce((n,s)=>{const i=dt.Op.length(s);let l=s.attributes||{};if(s.insert!=null){if(typeof s.insert=="string"){const o=s.insert;r.insertAt(n,o);const[c]=r.descendant(Ve,n),d=ct(c);l=dt.AttributeMap.diff(d,l)||{}}else if(typeof s.insert=="object"){const o=Object.keys(s.insert)[0];if(o==null)return n;if(r.insertAt(n,o,s.insert[o]),r.scroll.query(o,Q.INLINE)!=null){const[d]=r.descendant(Ve,n),p=ct(d);l=dt.AttributeMap.diff(p,l)||{}}}}return Object.keys(l).forEach(o=>{r.formatAt(n,i,o,l[o])}),n+i},e)}const La={scope:Q.BLOCK,whitelist:["right","center","justify"]},vm=new Mt("align","align",La),Fo=new Nt("align","ql-align",La),Uo=new gn("align","text-align",La);class Ho extends gn{value(e){let t=super.value(e);return t.startsWith("rgb(")?(t=t.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),`#${t.split(",").map(s=>`00${parseInt(s,10).toString(16)}`.slice(-2)).join("")}`):t}}const xm=new Nt("color","ql-color",{scope:Q.INLINE}),Oa=new Ho("color","color",{scope:Q.INLINE}),Em=new Nt("background","ql-bg",{scope:Q.INLINE}),qa=new Ho("background","background-color",{scope:Q.INLINE});class Rn extends _n{static create(e){const t=super.create(e);return t.setAttribute("spellcheck","false"),t}code(e,t){return this.children.map(n=>n.length()<=1?"":n.domNode.innerText).join(`
37`).slice(e,e+t)}html(e,t){return`<pre>
38${$s(this.code(e,t))}
39</pre>`}}class Qe extends Ue{static register(){C.register(Rn)}}U(Qe,"TAB","  ");class ja extends Bt{}ja.blotName="code";ja.tagName="CODE";Qe.blotName="code-block";Qe.className="ql-code-block";Qe.tagName="DIV";Rn.blotName="code-block-container";Rn.className="ql-code-block-container";Rn.tagName="DIV";Rn.allowedChildren=[Qe];Qe.allowedChildren=[wt,At,lr];Qe.requiredContainer=Rn;const Ia={scope:Q.BLOCK,whitelist:["rtl"]},zo=new Mt("direction","dir",Ia),Go=new Nt("direction","ql-direction",Ia),Ko=new gn("direction","direction",Ia),Wo={scope:Q.INLINE,whitelist:["serif","monospace"]},Vo=new Nt("font","ql-font",Wo);class wm extends gn{value(e){return super.value(e).replace(/["']/g,"")}}const Qo=new wm("font","font-family",Wo),Zo=new Nt("size","ql-size",{scope:Q.INLINE,whitelist:["small","large","huge"]}),Yo=new gn("size","font-size",{scope:Q.INLINE,whitelist:["10px","18px","32px"]}),Nm=Qt("quill:keyboard"),Am=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class Fs extends Tt{static match(e,t){return["altKey","ctrlKey","metaKey","shiftKey"].some(n=>!!t[n]!==e[n]&&t[n]!==null)?!1:t.key===e.key||t.key===e.which}constructor(e,t){super(e,t),this.bindings={},Object.keys(this.options.bindings).forEach(n=>{this.options.bindings[n]&&this.addBinding(this.options.bindings[n])}),this.addBinding({key:"Enter",shiftKey:null},this.handleEnter),this.addBinding({key:"Enter",metaKey:null,ctrlKey:null,altKey:null},()=>{}),/Firefox/i.test(navigator.userAgent)?(this.addBinding({key:"Backspace"},{collapsed:!0},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0},this.handleDelete)):(this.addBinding({key:"Backspace"},{collapsed:!0,prefix:/^.?$/},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0,suffix:/^.?$/},this.handleDelete)),this.addBinding({key:"Backspace"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Delete"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Backspace",altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},this.handleBackspace),this.listen()}addBinding(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=Cm(e);if(s==null){Nm.warn("Attempted to add invalid keyboard binding",s);return}typeof t=="function"&&(t={handler:t}),typeof n=="function"&&(n={handler:n}),(Array.isArray(s.key)?s.key:[s.key]).forEach(l=>{const o={...s,key:l,...t,...n};this.bindings[o.key]=this.bindings[o.key]||[],this.bindings[o.key].push(o)})}listen(){this.quill.root.addEventListener("keydown",e=>{if(e.defaultPrevented||e.isComposing||e.keyCode===229&&(e.key==="Enter"||e.key==="Backspace"))return;const s=(this.bindings[e.key]||[]).concat(this.bindings[e.which]||[]).filter(S=>Fs.match(e,S));if(s.length===0)return;const i=C.find(e.target,!0);if(i&&i.scroll!==this.quill.scroll)return;const l=this.quill.getSelection();if(l==null||!this.quill.hasFocus())return;const[o,c]=this.quill.getLine(l.index),[d,p]=this.quill.getLeaf(l.index),[x,f]=l.length===0?[d,p]:this.quill.getLeaf(l.index+l.length),m=d instanceof qs?d.value().slice(0,p):"",y=x instanceof qs?x.value().slice(f):"",E={collapsed:l.length===0,empty:l.length===0&&o.length()<=1,format:this.quill.getFormat(l),line:o,offset:c,prefix:m,suffix:y,event:e};s.some(S=>{if(S.collapsed!=null&&S.collapsed!==E.collapsed||S.empty!=null&&S.empty!==E.empty||S.offset!=null&&S.offset!==E.offset)return!1;if(Array.isArray(S.format)){if(S.format.every(I=>E.format[I]==null))return!1}else if(typeof S.format=="object"&&!Object.keys(S.format).every(I=>
39S.format[I]===!0?E.format[I]!=null:S.format[I]===!1?E.format[I]==null:ln(S.format[I],E.format[I])))return!1;return S.prefix!=null&&!S.prefix.test(E.prefix)||S.suffix!=null&&!S.suffix.test(E.suffix)?!1:S.handler.call(this,l,E,S)!==!0})&&e.preventDefault()})}handleBackspace(e,t){const n=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(t.prefix)?2:1;if(e.index===0||this.quill.getLength()<=1)return;let s={};const[i]=this.quill.getLine(e.index);let l=new V().retain(e.index-n).delete(n);if(t.offset===0){const[o]=this.quill.getLine(e.index-1);if(o&&!(o.statics.blotName==="block"&&o.length()<=1)){const d=i.formats(),p=this.quill.getFormat(e.index-1,1);if(s=dt.AttributeMap.diff(d,p)||{},Object.keys(s).length>0){const x=new V().retain(e.index+i.length()-2).retain(1,s);l=l.compose(x)}}}this.quill.updateContents(l,C.sources.USER),this.quill.focus()}handleDelete(e,t){const n=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(t.suffix)?2:1;if(e.index>=this.quill.getLength()-n)return;let s={};const[i]=this.quill.getLine(e.index);let l=new V().retain(e.index).delete(n);if(t.offset>=i.length()-1){const[o]=this.quill.getLine(e.index+1);if(o){const c=i.formats(),d=this.quill.getFormat(e.index,1);s=dt.AttributeMap.diff(c,d)||{},Object.keys(s).length>0&&(l=l.retain(o.length()-1).retain(1,s))}}this.quill.updateContents(l,C.sources.USER),this.quill.focus()}handleDeleteRange(e){ka({range:e,quill:this.quill}),this.quill.focus()}handleEnter(e,t){const n=Object.keys(t.format).reduce((i,l)=>(this.quill.scroll.query(l,Q.BLOCK)&&!Array.isArray(t.format[l])&&(i[l]=t.format[l]),i),{}),s=new V().retain(e.index).delete(e.length).insert(`
40`,n);this.quill.updateContents(s,C.sources.USER),this.quill.setSelection(e.index+1,C.sources.SILENT),this.quill.focus()}}const Tm={bindings:{bold:Bi("bold"),italic:Bi("italic"),underline:Bi("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(r,e){return e.collapsed&&e.offset!==0?!0:(this.quill.format("indent","+1",C.sources.USER),!1)}},outdent:{key:"Tab",shiftKey:!0,format:["blockquote","indent","list"],handler(r,e){return e.collapsed&&e.offset!==0?!0:(this.quill.format("indent","-1",C.sources.USER),!1)}},"outdent backspace":{key:"Backspace",collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler(r,e){e.format.indent!=null?this.quill.format("indent","-1",C.sources.USER):e.format.list!=null&&this.quill.format("list",!1,C.sources.USER)}},"indent code-block":Il(!0),"outdent code-block":Il(!1),"remove tab":{key:"Tab",shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(r){this.quill.deleteText(r.index-1,1,C.sources.USER)}},tab:{key:"Tab",handler(r,e){if(e.format.table)return!0;this.quill.history.cutoff();const t=new V().retain(r.index).delete(r.length).insert("	");return this.quill.updateContents(t,C.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(r.index+1,C.sources.SILENT),!1}},"blockquote empty enter":{key:"Enter",collapsed:!0,format:["blockquote"],empty:!0,handler(){this.quill.format("blockquote",!1,C.sources.USER)}},"list empty enter":{key:"Enter",collapsed:!0,format:["list"],empty:!0,handler(r,e){const t={list:!1};e.format.indent&&(t.indent=!1),this.quill.formatLine(r.index,r.length,t,C.sources.USER)}},"checklist enter":{key:"Enter",collapsed:!0,format:{list:"checked"},handler(r){const[e,t]=this.quill.getLine(r.index),n={...e.formats(),list:"checked"},s=new V().retain(r.index).insert(`
41`,n).retain(e.length()-t-1).retain(1,{list:"unchecked"});this.quill.updateContents(s,C.sources.USER),this.quill.setSelection(r.index+1,C.sources.SILENT),this.quill.scrollSelectionIntoView()}},"header enter":{key:"Enter",collapsed:!0,format:["header"],suffix:/^$/,handler(r,e){const[t,n]=this.quill.getLine(r.index),s=new V().retain(r.index).insert(`
42`,e.format).retain(t.length()-n-1).retain(1,{header:null});this.quill.updateContents(s,C.sources.USER),this.quill.setSelection(r.index+1,C.sources.SILENT),this.quill.scrollSelectionIntoView()}},"table backspace":{key:"Backspace",format:["table"],collapsed:!0,offset:0,handler(){}},"table delete":{key:"Delete",format:["table"],collapsed:!0,suffix:/^$/,handler(){}},"table enter":{key:"Enter",shiftKey:null,format:["table"],handler(r){const e=this.quill.getModule("table");if(e){const[t,n,s,i]=e.getTable(r),l=Sm(t,n,s,i);if(l==null)return;let o=t.offset();if(l<0){const c=new V().retain(o).insert(`
43`);this.quill.updateContents(c,C.sources.USER),this.quill.setSelection(r.index+1,r.length,C.sources.SILENT)}else if(l>0){o+=t.length();const c=new V().retain(o).insert(`
44`);this.quill.updateContents(c,C.sources.USER),this.quill.setSelection(o,C.sources.USER)}}}},"table tab":{key:"Tab",shiftKey:null,format:["table"],handler(r,e){const{event:t,line:n}
44=e,s=n.offset(this.quill.scroll);t.shiftKey?this.quill.setSelection(s-1,C.sources.USER):this.quill.setSelection(s+n.length(),C.sources.USER)}},"list autofill":{key:" ",shiftKey:null,collapsed:!0,format:{"code-block":!1,blockquote:!1,table:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler(r,e){if(this.quill.scroll.query("list")==null)return!0;const{length:t}=e.prefix,[n,s]=this.quill.getLine(r.index);if(s>t)return!0;let i;switch(e.prefix.trim()){case"[]":case"[ ]":i="unchecked";break;case"[x]":i="checked";break;case"-":case"*":i="bullet";break;default:i="ordered"}this.quill.insertText(r.index," ",C.sources.USER),this.quill.history.cutoff();const l=new V().retain(r.index-s).delete(t+1).retain(n.length()-2-s).retain(1,{list:i});return this.quill.updateContents(l,C.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(r.index-t,C.sources.SILENT),!1}},"code exit":{key:"Enter",collapsed:!0,format:["code-block"],prefix:/^$/,suffix:/^\s*$/,handler(r){const[e,t]=this.quill.getLine(r.index);let n=2,s=e;for(;s!=null&&s.length()<=1&&s.formats()["code-block"];)if(s=s.prev,n-=1,n<=0){const i=new V().retain(r.index+e.length()-t-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(i,C.sources.USER),this.quill.setSelection(r.index-1,C.sources.SILENT),!1}return!0}},"embed left":ys("ArrowLeft",!1),"embed left shift":ys("ArrowLeft",!0),"embed right":ys("ArrowRight",!1),"embed right shift":ys("ArrowRight",!0),"table down":kl(!1),"table up":kl(!0)}};Fs.DEFAULTS=Tm;function Il(r){return{key:"Tab",shiftKey:!r,format:{"code-block":!0},handler(e,t){let{event:n}=t;const s=this.quill.scroll.query("code-block"),{TAB:i}=s;if(e.length===0&&!n.shiftKey){this.quill.insertText(e.index,i,C.sources.USER),this.quill.setSelection(e.index+i.length,C.sources.SILENT);return}const l=e.length===0?this.quill.getLines(e.index,1):this.quill.getLines(e);let{index:o,length:c}=e;l.forEach((d,p)=>{r?(d.insertAt(0,i),p===0?o+=i.length:c+=i.length):d.domNode.textContent.startsWith(i)&&(d.deleteAt(0,i.length),p===0?o-=i.length:c-=i.length)}),this.quill.update(C.sources.USER),this.quill.setSelection(o,c,C.sources.SILENT)}}}function ys(r,e){return{key:r,shiftKey:e,altKey:null,[r==="ArrowLeft"?"prefix":"suffix"]:/^$/,handler(n){let{index:s}=n;r==="ArrowRight"&&(s+=n.length+1);const[i]=this.quill.getLeaf(s);return i instanceof st?(r==="ArrowLeft"?e?this.quill.setSelection(n.index-1,n.length+1,C.sources.USER):this.quill.setSelection(n.index-1,C.sources.USER):e?this.quill.setSelection(n.index,n.length+1,C.sources.USER):this.quill.setSelection(n.index+n.length+1,C.sources.USER),!1):!0}}}function Bi(r){return{key:r[0],shortKey:!0,handler(e,t){this.quill.format(r,!t.format[r],C.sources.USER)}}}function kl(r){return{key:r?"ArrowUp":"ArrowDown",collapsed:!0,format:["table"],handler(e,t){const n=r?"prev":"next",s=t.line,i=s.parent[n];if(i!=null){if(i.statics.blotName==="table-row"){let l=i.children.head,o=s;for(;o.prev!=null;)o=o.prev,l=l.next;const c=l.offset(this.quill.scroll)+Math.min(t.offset,l.length()-1);this.quill.setSelection(c,0,C.sources.USER)}}else{const l=s.table()[n];l!=null&&(r?this.quill.setSelection(l.offset(this.quill.scroll)+l.length()-1,0,C.sources.USER):this.quill.setSelection(l.offset(this.quill.scroll),0,C.sources.USER))}return!1}}}function Cm(r){if(typeof r=="string"||typeof r=="number")r={key:r};else if(typeof r=="object")r=tr(r);else return null;return r.shortKey&&(r[Am]=r.shortKey,delete r.shortKey),r}function ka(r){let{quill:e,range:t}=r;const n=e.getLines(t);let s={};if(n.length>1){const i=n[0].formats(),l=n[n.length-1].formats();s=dt.AttributeMap.diff(l,i)||{}}e.deleteText(t,C.sources.USER),Object.keys(s).length>0&&e.formatLine(t.index,1,s,C.sources.USER),e.setSelection(t.index,C.sources.SILENT)}function Sm(r,e,t,n){return e.prev==null&&e.next==null?t.prev==null&&t.next==null?n===0?-1:1:t.prev==null?-1:1:e.prev==null?-1:e.next==null?1:null}const Lm=/font-weight:\s*normal/,Om=["P","OL","UL"],_l=r=>r&&Om.includes(r.tagName),qm=r=>{Array.from(r.querySelectorAll("br")).filter(e=>
44_l(e.previousElementSibling)&&_l(e.nextElementSibling)).forEach(e=>{var t;(t=e.parentNode)==null||t.removeChild(e)})},jm=r=>{Array.from(r.querySelectorAll('b[style*="font-weight"]')).filter(e=>{var t;return(t=e.getAttribute("style"))==null?void 0:t.match(Lm)}).forEach(e=>{var n;const t=r.createDocumentFragment();t.append(...e.childNodes),(n=e.parentNode)==null||n.replaceChild(t,e)})};function Im(r){r.querySelector('[id^="docs-internal-guid-"]')&&(jm(r),qm(r))}const km=/\bmso-list:[^;]*ignore/i,_m=/\bmso-list:[^;]*\bl(\d+)/i,Rm=/\bmso-list:[^;]*\blevel(\d+)/i,Mm=(r,e)=>{const t=r.getAttribute("style"),n=t==null?void 0:t.match(_m);if(!n)return null;const s=Number(n[1]),i=t==null?void 0:t.match(Rm),l=i?Number(i[1]):1,o=new RegExp(`@list l${s}:level${l}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,"i"),c=e.match(o),d=c&&c[1]==="bullet"?"bullet":"ordered";return{id:s,indent:l,type:d,element:r}},Bm=r=>{var l,o;const e=Array.from(r.querySelectorAll("[style*=mso-list]")),t=[],n=[];e.forEach(c=>{(c.getAttribute("style")||"").match(km)?t.push(c):n.push(c)}),t.forEach(c=>{var d;return(d=c.parentNode)==null?void 0:d.removeChild(c)});const s=r.documentElement.innerHTML,i=n.map(c=>Mm(c,s)).filter(c=>c);for(;i.length;){const c=[];let d=i.shift();for(;d;)c.push(d),d=i.length&&((l=i[0])==null?void 0:l.element)===d.element.nextElementSibling&&i[0].id===d.id?i.shift():null;const p=document.createElement("ul");c.forEach(m=>{const y=document.createElement("li");y.setAttribute("data-list",m.type),m.indent>1&&y.setAttribute("class",`ql-indent-${m.indent-1}`),y.innerHTML=m.element.innerHTML,p.appendChild(y)});const x=(o=c[0])==null?void 0:o.element,{parentNode:f}=x??{};x&&(f==null||f.replaceChild(p,x)),c.slice(1).forEach(m=>{let{element:y}=m;f==null||f.removeChild(y)})}};function Dm(r){r.documentElement.getAttribute("xmlns:w")==="urn:schemas-microsoft-com:office:word"&&Bm(r)}const Pm=[Dm,Im],$m=r=>{r.documentElement&&Pm.forEach(e=>{e(r)})},Fm=Qt("quill:clipboard"),Um=[[Node.TEXT_NODE,e1],[Node.TEXT_NODE,Ml],["br",Wm],[Node.ELEMENT_NODE,Ml],[Node.ELEMENT_NODE,Km],[Node.ELEMENT_NODE,Gm],[Node.ELEMENT_NODE,Xm],["li",Zm],["ol, ul",Ym],["pre",Vm],["tr",Jm],["b",Di("bold")],["i",Di("italic")],["strike",Di("strike")],["style",Qm]],Hm=[vm,zo].reduce((r,e)=>(r[e.keyName]=e,r),{}),Rl=[Uo,qa,Oa,Ko,Qo,Yo].reduce((r,e)=>(r[e.keyName]=e,r),{});class Xo extends Tt{constructor(e,t){super(e,t),this.quill.root.addEventListener("copy",n=>this.onCaptureCopy(n,!1)),this.quill.root.addEventListener("cut",n=>this.onCaptureCopy(n,!0)),this.quill.root.addEventListener("paste",this.onCapturePaste.bind(this)),this.matchers=[],Um.concat(this.options.matchers??[]).forEach(n=>{let[s,i]=n;this.addMatcher(s,i)})}addMatcher(e,t){this.matchers.push([e,t])}convert(e){let{html:t,text:n}=e,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(s[Qe.blotName])return new V().insert(n||"",{[Qe.blotName]:s[Qe.blotName]});if(!t)return new V().insert(n||"",s);const i=this.convertHTML(t);return Hr(i,`
45`)&&(i.ops[i.ops.length-1].attributes==null||s.table)?i.compose(new V().retain(i.length()-1).delete(1)):i}normalizeHTML(e){$m(e)}convertHTML(e){const t=new DOMParser().parseFromString(e,"text/html");this.normalizeHTML(t);const n=t.body,s=new WeakMap,[i,l]=this.prepareMatching(n,s);return _a(this.quill.scroll,n,i,l,s)}dangerouslyPasteHTML(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:C.sources.API;if(typeof e=="string"){const s=this.convert({html:e,text:""});this.quill.setContents(s,t),this.quill.setSelection(0,C.sources.SILENT)}else{const s=this.convert({html:t,text:""});this.quill.updateContents(new V().retain(e).concat(s),n),this.quill.setSelection(e+s.length(),C.sources.SILENT)}}onCaptureCopy(e){var l,o;let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(e.defaultPrevented)return;e.preventDefault();const[n]=this.quill.selection.getRange();if(n==null)return;const{html:s,text:i}=this.onCopy(n,t);(l=e.clipboardData)==null||l.setData("text/plain",i),(o=e.clipboardData)==null||o.setData("text/html",s),t&&ka({range:n,quill:this.quill})}normalizeURIList(e){return e.split(/\r?\n/).filter(t=>t[0]!=="#").join(`
46`)}onCapturePaste(e){var l,o,c,d,p;if(e.defaultPrevented||!this.quill.isEnabled())return;e.preventDefault();const t=this.quill.getSelection(!0);if(t==null)return;const n=(l=e.clipboardData)==null?void 0:l.getData("text/html");let s=(o=e.clipboardData)==null?void 0:o.getData("text/plain");if(!n&&!s){const x=(c=e.clipboardData)==null?void 0:c.getData("text/uri-l
46ist");x&&(s=this.normalizeURIList(x))}const i=Array.from(((d=e.clipboardData)==null?void 0:d.files)||[]);if(!n&&i.length>0){this.quill.uploader.upload(t,i);return}if(n&&i.length>0){const x=new DOMParser().parseFromString(n,"text/html");if(x.body.childElementCount===1&&((p=x.body.firstElementChild)==null?void 0:p.tagName)==="IMG"){this.quill.uploader.upload(t,i);return}}this.onPaste(t,{html:n,text:s})}onCopy(e){const t=this.quill.getText(e);return{html:this.quill.getSemanticHTML(e),text:t}}onPaste(e,t){let{text:n,html:s}=t;const i=this.quill.getFormat(e.index),l=this.convert({text:n,html:s},i);Fm.log("onPaste",l,{text:n,html:s});const o=new V().retain(e.index).delete(e.length).concat(l);this.quill.updateContents(o,C.sources.USER),this.quill.setSelection(o.length()-e.length,C.sources.SILENT),this.quill.scrollSelectionIntoView()}prepareMatching(e,t){const n=[],s=[];return this.matchers.forEach(i=>{const[l,o]=i;switch(l){case Node.TEXT_NODE:s.push(o);break;case Node.ELEMENT_NODE:n.push(o);break;default:Array.from(e.querySelectorAll(l)).forEac
46h(c=>{if(t.has(c)){const d=t.get(c);d==null||d.push(o)}else t.set(c,[o])});break}}),[n,s]}}U(Xo,"DEFAULTS",{matchers:[]});function Mn(r,e,t,n){return n.query(e)?r.reduce((s,i)=>{if(!i.insert)return s;if(i.attributes&&i.attributes[e])return s.push(i);const l=t?{[e]:t}:{};return s.insert(i.insert,{...l,...i.attributes})},new V):r}function Hr(r,e){let t="";for(let n=r.ops.length-1;n>=0&&t.length<e.length;--n){const s=r.ops[n];if(typeof s.insert!="string")break;t=s.insert+t}return t.slice(-1*e.length)===e}function cn(r,e){if(!(r instanceof Element))return!1;const t=e.query(r);return t&&t.prototype instanceof st?!1:["address","article","blockquote","canvas","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","iframe","li","main","nav","ol","output","p","pre","section","table","td","tr","ul","video"].includes(r.tagName.toLowerCase())}function zm(r,e){return r.previousElementSibling&&r.nextElementSibling&&!cn(r.previousElementSibling,e)&&!cn(r.nextElementSibling,e)}const vs=new WeakMap;function Jo(r){return r==null?!1:(vs.has(r)||(r.tagName==="PRE"?vs.set(r,!0):vs.set(r,Jo(r.parentNode))),vs.get(r))}function _a(r,e,t,n,s){return e.nodeType===e.TEXT_NODE?n.reduce((i,l)=>l(e,i,r),new V):e.nodeType===e.ELEMENT_NODE?Array.from(e.childNodes||[]).reduce((i,l)=>{let o=_a(r,l,t,n,s);return l.nodeType===e.ELEMENT_NODE&&(o=t.reduce((c,d)=>d(l,c,r),o),o=(s.get(l)||[]).reduce((c,d)=>d(l,c,r),o)),i.concat(o)},new V):new V}function Di(r){return(e,t,n)=>Mn(t,r,!0,n)}function Gm(r,e,t){const n=Mt.keys(r),s=Nt.keys(r),i=gn.keys(r),l={};return n.concat(s).concat(i).forEach(o=>{let c=t.query(o,Q.ATTRIBUTE);c!=null&&(l[c.attrName]=c.value(r),l[c.attrName])||(c=Hm[o],c!=null&&(c.attrName===o||c.keyName===o)&&(l[c.attrName]=c.value(r)||void 0),c=Rl[o],c!=null&&(c.attrName===o||c.keyName===o)&&(c=Rl[o],l[c.attrName]=c.value(r)||void 0))}),Object.entries(l).reduce((o,c)=>{let[d,p]=c;return Mn(o,d,p,t)},e)}function Km(r,e,t){const n=t.query(r);if(n==null)return e;if(n.prototype instanceof st){const s={},i=n.value(r);if(i!=null)return s[n.blotName]=i,new V().insert(s,n.formats(r,t))}else if(n.prototype instanceof Br&&!Hr(e,`
47`)&&e.insert(`
48`),"blotName"in n&&"formats"in n&&typeof n.formats=="function")return Mn(e,n.blotName,n.formats(r,t),t);return e}function Wm(r,e){return Hr(e,`
49`)||e.insert(`
50`),e}function Vm(r,e,t){const n=t.query("code-block"),s=n&&"formats"in n&&typeof n.formats=="function"?n.formats(r,t):!0;return Mn(e,"code-block",s,t)}function Qm(){return new V}function Zm(r,e,t){const n=t.query(r);if(n==null||n.blotName!=="list"||!Hr(e,`
51`))return e;let s=-1,i=r.parentNode;for(;i!=null;)["OL","UL"].includes(i.tagName)&&(s+=1),i=i.parentNode;return s<=0?e:e.reduce((l,o)=>o.insert?o.attributes&&typeof o.attributes.indent=="number"?l.push(o):l.insert(o.insert,{indent:s,...o.attributes||{}}):l,new V)}function Ym(r,e,t){const n=r;let s=n.tagName==="OL"?"ordered":"bullet";const i=n.getAttribute("data-checked");return i&&(s=i==="true"?"checked":"unchecked"),Mn(e,"list",s,t)}function Ml(r,e,t){if(!Hr(e,`
52`)){if(cn(r,t)&&(r.childNodes.length>0||r instanceof HTMLParagraphElement))return e.insert(`
53`);if(e.length()>0&&r.nextSibling){let n=r.nextSibling;for(;n!=null;){if(cn(n,t))return e.insert(`
54`);const s=t.query(n);if(s&&s.prototype instanceof ht)return e.insert(`
55`);n=n.firstChild}}}return e}function Xm(r,e,t){var i;const n={},s=r.style||{};return s.fontStyle==="italic"&&(n.italic=!0),s.textDecoration==="underline"&&(n.underline=!0),s.textDecoration==="line-through"&&(n.strike=!0),((i=s.fontWeight)!=null&&i.startsWith("bold")||parseInt(s.fontWeight,10)>=700)&&(n.bold=!0),e=Object.entries(n).reduce((l,o)=>{let[c,d]=o;return Mn(l,c,d,t)},e),parseFloat(s.textIndent||0)>0?new V().insert("	").concat(e):e}function Jm(r,e,t){var s,i;const n=((s=r.parentElement)==null?void 0:s.tagName)==="TABLE"?r.parentElement:(i=r.parentElement)==null?void 0:i.parentElement;if(n!=null){const o=Array.from(n.querySelectorAll("tr")).indexOf(r)+1;return Mn(e,"table",o,t)}return e}function e1(r,e,t){var s;let n=r.data;
55if(((s=r.parentElement)==null?void 0:s.tagName)==="O:P")return e.insert(n.trim());if(!Jo(r)){if(n.trim().length===0&&n.includes(`
56`)&&!zm(r,t))return e;n=n.replace(/[^\S\u00a0]/g," "),n=n.replace(/ {2,}/g," "),(r.previousSibling==null&&r.parentElement!=null&&cn(r.parentElement,t)||r.previousSibling instanceof Element&&cn(r.previousSibling,t))&&(n=n.replace(/^ /,"")),(r.nextSibling==null&&r.parentElement!=null&&cn(r.parentElement,t)||r.nextSibling instanceof Element&&cn(r.nextSibling,t))&&(n=n.replace(/ $/,"")),n=n.replaceAll(" "," ")}return e.insert(n)}class ec extends Tt{constructor(t,n){super(t,n);U(this,"lastRecorded",0);U(this,"ignoreChange",!1);U(this,"stack",{undo:[],redo:[]});U(this,"currentRange",null);this.quill.on(C.events.EDITOR_CHANGE,(s,i,l,o)=>{s===C.events.SELECTION_CHANGE?i&&o!==C.sources.SILENT&&(this.currentRange=i):s===C.events.TEXT_CHANGE&&(this.ignoreChange||(!this.options.userOnly||o===C.sources.USER?this.record(i,l):this.transform(i)),this.currentRange=la(this.currentRange,i))}),this.quill.keyboard.addBinding({key:"z",shortKey:!0},this.undo.bind(this)),this.quill.keyboard.addBinding({key:["z","Z"],shortKey:!0,shiftKey:!0},this.redo.bind(this)),/Win/i.test(navigator.platform)&&this.quill.keyboard.addBinding({key:"y",shortKey:!0},this.redo.bind(this)),this.quill.root.addEventListener("beforeinput",s=>{s.inputType==="historyUndo"?(this.undo(),s.preventDefault()):s.inputType==="historyRedo"&&(this.redo(),s.preventDefault())})}change(t,n){if(this.stack[t].length===0)return;const s=this.stack[t].pop();if(!s)return;const i=this.quill.getContents(),l=s.delta.invert(i);this.stack[n].push({delta:l,range:la(s.range,l)}),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(s.delta,C.sources.USER),this.ignoreChange=!1,this.restoreSelection(s)}clear(){this.stack={undo:[],redo:[]}}cutoff(){this.lastRecorded=0}record(t,n){if(t.ops.length===0)return;this.stack.redo=[];let s=t.invert(n),i=this.currentRange;const l=Date.now();if(this.lastRecorded+this.options.delay>l&&this.stack.undo.length>0){const o=this.stack.undo.pop();o&&(s=s.compose(o.delta),i=o.range)}else this.lastRecorded=l;s.length()!==0&&(this.stack.undo.push({delta:s,range:i}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift())}redo(){this.change("redo","undo")}transform(t){Bl(this.stack.undo,t),Bl(this.stack.redo,t)}undo(){this.change("undo","redo")}restoreSelection(t){if(t.range)this.quill.setSelection(t.range,C.sources.USER);else{const n=n1(this.quill.scroll,t.delta);this.quill.setSelection(n,C.sources.USER)}}}U(ec,"DEFAULTS",{delay:1e3,maxStack:100,userOnly:!1});function Bl(r,e){let t=e;for(let n=r.length-1;n>=0;n-=1){const s=r[n];r[n]={delta:t.transform(s.delta,!0),range:s.range&&la(s.range,t)},t=s.delta.transform(t),r[n].delta.length()===0&&r.splice(n,1)}}function t1(r,e){const t=e.ops[e.ops.length-1];return t==null?!1:t.insert!=null?typeof t.insert=="string"&&t.insert.endsWith(`
57`):t.attributes!=null?Object.keys(t.attributes).some(n=>r.query(n,Q.BLOCK)!=null):!1}function n1(r,e){const t=e.reduce((s,i)=>s+(i.delete||0),0);let n=e.length()-t;return t1(r,e)&&(n-=1),n}function la(r,e){if(!r)return r;const t=e.transformPosition(r.index),n=e.transformPosition(r.index+r.length);return{index:t,length:n-t}}class tc extends Tt{constructor(e,t){super(e,t),e.root.addEventListener("drop",n=>{var l;n.preventDefault();let s=null;if(document.caretRangeFromPoint)s=document.caretRangeFromPoint(n.clientX,n.clientY);else if(document.caretPositionFromPoint){const o=document.caretPositionFromPoint(n.clientX,n.clientY);s=document.createRange(),s.setStart(o.offsetNode,o.offset),s.setEnd(o.offsetNode,o.offset)}const i=s&&e.selection.normalizeNative(s);if(i){const o=e.selection.normalizedToRange(i);(l=n.dataTransfer)!=null&&l.files&&this.upload(o,n.dataTransfer.files)}})}upload(e,t){const n=[];Array.from(t).forEach(s=>{var i;s&&((i=this.options.mimetypes)!=null&&i.includes(s.type))&&n.push(s)}),n.length>0&&this.options.handler.call(this,e,n)}}tc.DEFAULTS={mimetypes:["image/png","image/jpeg"],handler(r,e){if(!this.quill.scroll.query("image"))return;const t=e.map(n=>new Promise(s=>{const i=new FileReader;i.onload=()=>{s(i.result)},i.readAsDataURL(n)}));Promise.all(t).then(n=>{const s=n.reduce((i,l)=>i.insert({image:l}),new V().retain(r.index).delete(r.length));this.quill.updateContents(s,G.sources.USER),this.quill.setSelection(r.index+n.length,G.sources.SILENT)})}};const r1=["insertText","insertReplacementText"];class s1 extends Tt{constructor(e,t){super(e,t),e.root.addEventListener("beforeinput",n=>{this.handleBeforeInput(n)}),/Android/i.test(navigator.userAgent)||e.on(C.events.COMPOSITION_BEFORE_START,()=>{this.handleCompositionStart()})}deleteRange(e){ka({range:e,quill:this.quill})}replaceText(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(e.length===0)return!1;if(t){const n=this.quill.getFormat(e.index,1);this.deleteRange(e),this.quill.updateContents(new V().retain(e.index).insert(t,n),C.sources.USER)}else this.deleteRange(e);return this.quill.setSelection(e.index+t.length,0,C.sources.SILENT),!0}handleBeforeInput(e){if(this.quill.composition.isComposing||e.defaultPrevented||!r1.includes(e.inputType))return;const t=e.getTargetRanges?e.getTargetRanges()[0]:null;if(!t||t.collapsed===!0)return;const n=i1(e);if(n==null)return;const s=this.quill.selection.normalizeNative(t),i=s?this.quill.selection.normalizedToRange(s):null;i&&this.replaceText(i,n)&&e.preventDefault()}handleCompositionStart(){const e=this.quill.getSelection();e&&this.replaceText(e)}}function i1(r){var e;
57return typeof r.data=="string"?r.data:(e=r.dataTransfer)!=null&&e.types.includes("text/plain")?r.dataTransfer.getData("text/plain"):null}const a1=/Mac/i.test(navigator.platform),l1=100,o1=r=>!!(r.key==="ArrowLeft"||r.key==="ArrowRight"||r.key==="ArrowUp"||r.key==="ArrowDown"||r.key==="Home"||a1&&r.key==="a"&&r.ctrlKey===!0);class c1 extends Tt{constructor(t,n){super(t,n);U(this,"isListening",!1);U(this,"selectionChangeDeadline",0);this.handleArrowKeys(),this.handleNavigationShortcuts()}handleArrowKeys(){this.quill.keyboard.addBinding({key:["ArrowLeft","ArrowRight"],offset:0,shiftKey:null,handler(t,n){let{line:s,event:i}=n;if(!(s instanceof Et)||!s.uiNode)return!0;const l=getComputedStyle(s.domNode).direction==="rtl";return l&&i.key!=="ArrowRight"||!l&&i.key!=="ArrowLeft"?!0:(this.quill.setSelection(t.index-1,t.length+(i.shiftKey?1:0),C.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",t=>{!t.defaultPrevented&&o1(t)&&this.ensureListeningToSelectionChange()})}ensureListeningToSelectionChange(){if(this.selectionChangeDeadline=Date.now()+l1,this.isListening)return;this.isListening=!0;const t=()=>{this.isListening=!1,Date.now()<=this.selectionChangeDeadline&&this.handleSelectionChange()};document.addEventListener("selectionchange",t,{once:!0})}handleSelectionChange(){const t=document.getSelection();if(!t)return;const n=t.getRangeAt(0);if(n.collapsed!==!0||n.startOffset!==0)return;const s=this.quill.scroll.find(n.startContainer);if(!(s instanceof Et)||!s.uiNode)return;const i=document.createRange();i.setStartAfter(s.uiNode),i.setEndAfter(s.uiNode),t.removeAllRanges(),t.addRange(i)}}C.register({"blots/block":Ue,"blots/block/embed":ht,"blots/break":At,"blots/container":_n,"blots/cursor":lr,"blots/embed":Sa,"blots/inline":Bt,"blots/scroll":er,"blots/text":wt,"modules/clipboard":Xo,"modules/history":ec,"modules/keyboard":Fs,"modules/uploader":tc,"modules/input":s1,"modules/uiNode":c1});class u1 extends Nt{add(e,t){let n=0;if(t==="+1"||t==="-1"){const s=this.value(e)||0;n=t==="+1"?s+1:s-1}else typeof t=="number"&&(n=t);return n===0?(this.remove(e),!0):super.add(e,n.toString())}canAdd(e,t){return super.canAdd(e,t)||super.canAdd(e,parseInt(t,10))}value(e){return parseInt(super.value(e),10)||void 0}}const h1=new u1("indent","ql-indent",{scope:Q.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class oa extends Ue{}U(oa,"blotName","blockquote"),U(oa,"tagName","blockquote");class ca extends Ue{static formats(e){return this.tagName.indexOf(e.tagName)+1}}U(ca,"blotName","header"),U(ca,"tagName",["H1","H2","H3","H4","H5","H6"]);class zr extends _n{}zr.blotName="list-container";zr.tagName="OL";class Gr extends Ue{static create(e){const t=super.create();return t.setAttribute("data-list",e),t}static formats(e){return e.getAttribute("data-list")||void 0}static register(){C.register(zr)}constructor(e,t){super(e,t);const n=t.ownerDocument.createElement("span"),s=i=>{if(!e.isEnabled())return;const l=this.statics.formats(t,e);l==="checked"?(this.format("list","unchecked"),i.preventDefault()):l==="unchecked"&&(this.format("list","checked"),i.preventDefault())};n.addEventListener("mousedown",s),n.addEventListener("touchstart",s),this.attachUI(n)}format(e,t){e===this.statics.blotName&&t?this.domNode.setAttribute("data-list",t):super.format(e,t)}}Gr.blotName="list";Gr.tagName="LI";zr.allowedChildren=[Gr];Gr.requiredContainer=zr;class Pr extends Bt{static create(){return super.create()}static formats(){return!0}optimize(e){super.optimize(e),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}U(Pr,"blotName","bold"),U(Pr,"tagName",["STRONG","B"]);class ua extends Pr{}U(ua,"blotName","italic"),U(ua,"tagName",["EM","I"]);class un extends Bt{static create(e){const t=super.create(e);return t.setAttribute("href",this.sanitize(e)),t.setAttribute("rel","noopener noreferrer"),t.setAttribute("target","_blank"),t}static formats(e){return e.getAttribute("href")}static sanitize(e){return nc(e,this.PROTOCOL_WHITELIST)?e:this.SANITIZED_URL}format(e,t){e!==this.statics.blotName||!t?super.format(e,t):this.domNode.setAttribute("href",this.constructor.sanitize(t))}}U(un,"blotName","link"),U(un,"tagName","A"),U(un,"SANITIZED_URL","about:blank"),U(un,"PROTOCOL_WHITELIST",["http","https","mailto","tel","sms"]);function nc(r,e){const t=document.createElement("a");t.href=r;const n=t.href.slice(0,t.href.indexOf(":"));return e.indexOf(n)>-1}class ha extends Bt{static create(e){return e==="super"?document.createElement("sup"):e==="sub"?document.createElement("sub"):super.create(e)}static formats(e){if(e.tagName==="SUB")return"sub";if(e.tagName==="SUP")return"super"}}U(ha,"blotName","script"),U(ha,"tagName",["SUB","SUP"]);class da extends Pr{}U(da,"blotName","strike"),U(da,"tagName",["S","STRIKE"]);class fa extends Bt{}U(fa,"blotName","underline"),U(fa,"tagName","U");class ws extends Sa{static create(e){if(window.katex==null)throw new Error("Formula module requires KaTeX.");const t=super.create(e);return typeof e=="string"&&(window.katex.render(e,t,{throwOnError:!1,errorColor:"#f00"}),t.setAttribute("data-value",e)),t}static value(e){return e.getAttribute("data-value")}html(){const{formula:e}=this.value();return`<span>${e}</span>`}}U(ws,"blotName","formula"),U(ws,"className","ql-formula"),U(ws,"tagName","SPAN");const Dl=["alt","height","width"];class pa extends st{static create(e){const t=super.create(e);return typeof e=="string"&&t.setAttribute("src",this.sanitize(e)),t}static formats(e){return Dl.reduce((t,n)=>(e.hasAttribute(n)&&(t[n]=e.getAttribute(n)),t),{})}static match(e){return/\.(jpe?g|gif|png)$/.test(e)||/^data:image\/.+;base64/.test(e)}static sanitize(e){return nc(e,["http","https","data"])?e:"//:0"}static value(e){return e.getAttribute("src")}format(e,t){Dl.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}}
57U(pa,"blotName","image"),U(pa,"tagName","IMG");const Pl=["height","width"];class Ns extends ht{static create(e){const t=super.create(e);return t.setAttribute("frameborder","0"),t.setAttribute("allowfullscreen","true"),t.setAttribute("src",this.sanitize(e)),t}static formats(e){return Pl.reduce((t,n)=>(e.hasAttribute(n)&&(t[n]=e.getAttribute(n)),t),{})}static sanitize(e){return un.sanitize(e)}static value(e){return e.getAttribute("src")}format(e,t){Pl.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}html(){const{video:e}=this.value();return`<a href="${e}">${e}</a>`}}U(Ns,"blotName","video"),U(Ns,"className","ql-video"),U(Ns,"tagName","IFRAME");const Sr=new Nt("code-token","hljs",{scope:Q.INLINE});class Kt extends Bt{static formats(e,t){for(;e!=null&&e!==t.domNode;){if(e.classList&&e.classList.contains(Qe.className))return super.formats(e,t);e=e.parentNode}}constructor(e,t,n){super(e,t,n),Sr.add(this.domNode,n)}format(e,t){e!==Kt.blotName?super.format(e,t):t?Sr.add(this.domNode,t):(Sr.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),Sr.value(this.domNode)||this.unwrap()}}Kt.blotName="code-token";Kt.className="ql-token";class ut extends Qe{static create(e){const t=super.create(e);return typeof e=="string"&&t.setAttribute("data-language",e),t}static formats(e){return e.getAttribute("data-language")||"plain"}static register(){}format(e,t){e===this.statics.blotName&&t?this.domNode.setAttribute("data-language",t):super.format(e,t)}replaceWith(e,t){return this.formatAt(0,this.length(),Kt.blotName,!1),super.replaceWith(e,t)}}class jr extends Rn{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(e,t){e===ut.blotName&&(this.forceNext=!0,this.children.forEach(n=>{n.format(e,t)}))}formatAt(e,t,n,s){n===ut.blotName&&(this.forceNext=!0),super.formatAt(e,t,n,s)}highlight(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.children.head==null)return;const s=`${Array.from(this.domNode.childNodes).filter(l=>l!==this.uiNode).map(l=>l.textContent).join(`
58`)}
59`,i=ut.formats(this.children.head.domNode);if(t||this.forceNext||this.cachedText!==s){if(s.trim().length>0||this.cachedText==null){const l=this.children.reduce((c,d)=>c.concat(Po(d,!1)),new V),o=e(s,i);l.diff(o).reduce((c,d)=>{let{retain:p,attributes:x}=d;return p?(x&&Object.keys(x).forEach(f=>{[ut.blotName,Kt.blotName].includes(f)&&this.formatAt(c,p,f,x[f])}),c+p):c},0)}this.cachedText=s,this.forceNext=!1}}html(e,t){const[n]=this.children.find(e);return`<pre data-language="${n?ut.formats(n.domNode):"plain"}">
60${$s(this.code(e,t))}
61</pre>`}optimize(e){if(super.optimize(e),this.parent!=null&&this.children.head!=null&&this.uiNode!=null){const t=ut.formats(this.children.head.domNode);t!==this.uiNode.value&&(this.uiNode.value=t)}}}jr.allowedChildren=[ut];ut.requiredContainer=jr;ut.allowedChildren=[Kt,lr,wt,At];const d1=(r,e,t)=>{if(typeof r.versionString=="string"){const n=r.versionString.split(".")[0];if(parseInt(n,10)>=11)return r.highlight(t,{language:e}).value}return r.highlight(e,t).value};class rc extends Tt{static register(){C.register(Kt,!0),C.register(ut,!0),C.register(jr,!0)}constructor(e,t){if(super(e,t),this.options.hljs==null)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");this.languages=this.options.languages.reduce((n,s)=>{let{key:i}=s;return n[i]=!0,n},{}),this.highlightBlot=this.highlightBlot.bind(this),this.initListener(),this.initTimer()}initListener(){this.quill.on(C.events.SCROLL_BLOT_MOUNT,e=>{if(!(e instanceof jr))return;const t=this.quill.root.ownerDocument.createElement("select");
61this.options.languages.forEach(n=>{let{key:s,label:i}=n;const l=t.ownerDocument.createElement("option");l.textContent=i,l.setAttribute("value",s),t.appendChild(l)}),t.addEventListener("change",()=>{e.format(ut.blotName,t.value),this.quill.root.focus(),this.highlight(e,!0)}),e.uiNode==null&&(e.attachUI(t),e.children.head&&(t.value=ut.formats(e.children.head.domNode)))})}initTimer(){let e=null;this.quill.on(C.events.SCROLL_OPTIMIZE,()=>{e&&clearTimeout(e),e=setTimeout(()=>{this.highlight(),e=null},this.options.interval)})}highlight(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.quill.selection.composing)return;this.quill.update(C.sources.USER);const n=this.quill.getSelection();(e==null?this.quill.scroll.descendants(jr):[e]).forEach(i=>{i.highlight(this.highlightBlot,t)}),this.quill.update(C.sources.SILENT),n!=null&&this.quill.setSelection(n,C.sources.SILENT)}highlightBlot(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"plain";if(t=this.languages[t]?t:"plain",t==="plain")return $s(e).split(`
62`).reduce((s,i,l)=>(l!==0&&s.insert(`
63`,{[Qe.blotName]:t}),s.insert(i)),new V);const n=this.quill.root.ownerDocument.createElement("div");return n.classList.add(Qe.className),n.innerHTML=d1(this.options.hljs,t,e),_a(this.quill.scroll,n,[(s,i)=>{const l=Sr.value(s);return l?i.compose(new V().retain(i.length(),{[Kt.blotName]:l})):i}],[(s,i)=>s.data.split(`
64`).reduce((l,o,c)=>(c!==0&&l.insert(`
65`,{[Qe.blotName]:t}),l.insert(o)),i)],new WeakMap)}}rc.DEFAULTS={hljs:window.hljs,interval:1e3,languages:[{key:"plain",label:"Plain"},{key:"bash",label:"Bash"},{key:"cpp",label:"C++"},{key:"cs",label:"C#"},{key:"css",label:"CSS"},{key:"diff",label:"Diff"},{key:"xml",label:"HTML/XML"},{key:"java",label:"Java"},{key:"javascript",label:"JavaScript"},{key:"markdown",label:"Markdown"},{key:"php",label:"PHP"},{key:"python",label:"Python"},{key:"ruby",label:"Ruby"},{key:"sql",label:"SQL"}]};const kr=class kr extends Ue{static create(e){const t=super.create();return e?t.setAttribute("data-row",e):t.setAttribute("data-row",Ra()),t}static formats(e){if(e.hasAttribute("data-row"))return e.getAttribute("data-row")}cellOffset(){return this.parent?this.parent.children.indexOf(this):-1}format(e,t){e===kr.blotName&&t?this.domNode.setAttribute("data-row",t):super.format(e,t)}row(){return this.parent}rowOffset(){return this.row()?this.row().rowOffset():-1}table(){return this.row()&&this.row().table()}};U(kr,"blotName","table"),U(kr,"tagName","TD");let xt=kr;class Wt extends _n{checkMerge(){if(super.checkMerge()&&this.next.children.head!=null){const e=this.children.head.formats(),t=this.children.tail.formats(),n=this.next.children.head.formats(),s=this.next.children.tail.formats();return e.table===t.table&&e.table===n.table&&e.table===s.table}return!1}optimize(e){super.optimize(e),this.children.forEach(t=>{if(t.next==null)return;const n=t.formats(),s=t.next.formats();if(n.table!==s.table){const i=this.splitAfter(t);i&&i.optimize(),this.prev&&this.prev.optimize()}})}rowOffset(){return this.parent?this.parent.children.indexOf(this):-1}table(){return this.parent&&this.parent.parent}}U(Wt,"blotName","table-row"),U(Wt,"tagName","TR");class _t extends _n{}U(_t,"blotName","table-body"),U(_t,"tagName","TBODY");class cr extends _n{balanceCells(){const e=this.descendants(Wt),t=e.reduce((n,s)=>Math.max(s.children.length,n),0);e.forEach(n=>{new Array(t-n.children.length).fill(0).forEach(()=>{let s;n.children.head!=null&&(s=xt.formats(n.children.head.domNode));const i=this.scroll.create(xt.blotName,s);n.appendChild(i),i.optimize()})})}cells(e){return this.rows().map(t=>t.children.at(e))}deleteColumn(e){const[t]=this.descendant(_t);t==null||t.children.head==null||t.children.forEach(n=>{const s=n.children.at(e);s!=null&&s.remove()})}insertColumn(e){const[t]=this.descendant(_t);t==null||t.children.head==null||t.children.forEach(n=>{const s=n.children.at(e),i=xt.formats(n.children.head.domNode),l=this.scroll.create(xt.blotName,i);n.insertBefore(l,s)})}insertRow(e){const[t]=this.descendant(_t);if(t==null||t.children.head==null)return;const n=Ra(),s=this.scroll.create(Wt.blotName);
65t.children.head.children.forEach(()=>{const l=this.scroll.create(xt.blotName,n);s.appendChild(l)});const i=t.children.at(e);t.insertBefore(s,i)}rows(){const e=this.children.head;return e==null?[]:e.children.map(t=>t)}}U(cr,"blotName","table-container"),U(cr,"tagName","TABLE");cr.allowedChildren=[_t];_t.requiredContainer=cr;_t.allowedChildren=[Wt];Wt.requiredContainer=_t;Wt.allowedChildren=[xt];xt.requiredContainer=Wt;function Ra(){return`row-${Math.random().toString(36).slice(2,6)}`}class f1 extends Tt{static register(){C.register(xt),C.register(Wt),C.register(_t),C.register(cr)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(cr).forEach(e=>{e.balanceCells()})}deleteColumn(){const[e,,t]=this.getTable();t!=null&&(e.deleteColumn(t.cellOffset()),this.quill.update(C.sources.USER))}deleteRow(){const[,e]=this.getTable();e!=null&&(e.remove(),this.quill.update(C.sources.USER))}deleteTable(){const[e]=this.getTable();if(e==null)return;const t=e.offset();e.remove(),this.quill.update(C.sources.USER),this.quill.setSelection(t,C.sources.SILENT)}getTable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.quill.getSelection();if(e==null)return[null,null,null,-1];const[t,n]=this.quill.getLine(e.index);if(t==null||t.statics.blotName!==xt.blotName)return[null,null,null,-1];const s=t.parent;return[s.parent.parent,s,t,n]}insertColumn(e){const t=this.quill.getSelection();if(!t)return;const[n,s,i]=this.getTable(t);if(i==null)return;const l=i.cellOffset();n.insertColumn(l+e),this.quill.update(C.sources.USER);let o=s.rowOffset();e===0&&(o+=1),this.quill.setSelection(t.index+o,t.length,C.sources.SILENT)}insertColumnLeft(){this.insertColumn(0)}insertColumnRight(){this.insertColumn(1)}insertRow(e){const t=this.quill.getSelection();if(!t)return;const[n,s,i]=this.getTable(t);if(i==null)return;const l=s.rowOffset();n.insertRow(l+e),this.quill.update(C.sources.USER),e>0?this.quill.setSelection(t,C.sources.SILENT):this.quill.setSelection(t.index+s.children.length,t.length,C.sources.SILENT)}insertRowAbove(){this.insertRow(0)}insertRowBelow(){this.insertRow(1)}insertTable(e,t){const n=this.quill.getSelection();if(n==null)return;const s=new Array(e).fill(0).reduce(i=>{const l=new Array(t).fill(`
66`).join("");return i.insert(l,{table:Ra()})},new V().retain(n.index));this.quill.updateContents(s,C.sources.USER),this.quill.setSelection(n.index,C.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(C.events.SCROLL_OPTIMIZE,e=>{e.some(t=>["TD","TR","TBODY","TABLE"].includes(t.target.tagName)?(this.quill.once(C.events.TEXT_CHANGE,(n,s,i)=>{i===C.sources.USER&&this.balanceTables()}),!0):!1)})}}const $l=Qt("quill:toolbar");class Ma extends Tt{constructor(e,t){var n,s;if(super(e,t),Array.isArray(this.options.container)){const i=document.createElement("div");i.setAttribute("role","toolbar"),p1(i,this.options.container),(s=(n=e.container)==null?void 0:n.parentNode)==null||s.insertBefore(i,e.container),this.container=i}else typeof this.options.container=="string"?this.container=document.querySelector(this.options.container):this.container=this.options.container;if(!(this.container instanceof HTMLElement)){$l.error("Container required for toolbar",this.options);return}this.container.classList.add("ql-toolbar"),this.controls=[],this.handlers={},this.options.handlers&&Object.keys(this.options.handlers).forEach(i=>{var o;const l=(o=this.options.handlers)==null?void 0:o[i];l&&this.addHandler(i,l)}),Array.from(this.container.querySelectorAll("button, select")).forEac
66h(i=>{this.attach(i)}),this.quill.on(C.events.EDITOR_CHANGE,()=>{const[i]=this.quill.selection.getRange();this.update(i)})}addHandler(e,t){this.handlers[e]=t}attach(e){let t=Array.from(e.classList).find(s=>s.indexOf("ql-")===0);if(!t)return;if(t=t.slice(3),e.tagName==="BUTTON"&&e.setAttribute("type","button"),this.handlers[t]==null&&this.quill.scroll.query(t)==null){$l.warn("ignoring attaching to nonexistent format",t,e);return}const n=e.tagName==="SELECT"?"change":"click";e.addEventListener(n,s=>{let i;if(e.tagName==="SELECT"){if(e.selectedIndex<0)return;const o=e.options[e.selectedIndex];o.hasAttribute("selected")?i=!1:i=o.value||!1}else e.classList.contains("ql-active")?i=!1:i=e.value||!e.hasAttribute("value"),s.preventDefault();this.quill.focus();const[l]=this.quill.selection.getRange();if(this.handlers[t]!=null)this.handlers[t].call(this,i);else if(this.quill.scroll.query(t).prototype instanceof st){if(i=prompt(`Enter ${t}`),!i)return;this.quill.updateContents(new V().retain(l.index).delete(l.length).insert({[t]:i}),C.sources.USER)}else this.quill.format(t,i,C.sources.USER);this.update(l)}),this.controls.push([t,e])}update(e){const t=e==null?{}:this.quill.getFormat(e);this.controls.forEach(n=>{const[s,i]=n;if(i.tagName==="SELECT"){let l=null;if(e==null)l=null;else if(t[s]==null)l=i.querySelector("option[selected]");else if(!Array.isArray(t[s])){let o=t[s];typeof o=="string"&&(o=o.replace(/"/g,'\\"')),l=i.querySelector(`option[value="${o}"]`)}l==null?(i.value="",i.selectedIndex=-1):l.selected=!0}else if(e==null)i.classList.remove("ql-active"),i.setAttribute("aria-pressed","false");else if(i.hasAttribute("value")){const l=t[s],o=l===i.getAttribute("value")||l!=null&&l.toString()===i.getAttribute("value")||l==null&&!i.getAttribute("value");i.classList.toggle("ql-active",o),i.setAttribute("aria-pressed",o.toString())}else{const l=t[s]!=null;i.classList.toggle("ql-active",l),i.setAttribute("aria-pressed",l.toString())}})}}Ma.DEFAULTS={};function Fl(r,e,t){const n=document.createElement("button");n.setAttribute("type","button"),n.classList.add(`ql-${e}`),n.setAttribute("aria-pressed","false"),t!=null?(n.value=t,n.setAttribute("aria-label",`${e}: ${t}`)):n.setAttribute("aria-label",e),r.appendChild(n)}function p1(r,e){Array.isArray(e[0])||(e=[e]),e.forEach(t=>{const n=document.createElement("span");n.classList.add("ql-formats"),t.forEach(s=>{if(typeof s=="string")Fl(n,s);else{const i=Object.keys(s)[0],l=s[i];Array.isArray(l)?g1(n,i,l):Fl(n,i,l)}}),r.appendChild(n)})}function g1(r,e,t){const n=document.createElement("select");n.classList.add(`ql-${e}`),t.forEach(s=>{const i=document.createElement("option");s!==!1?i.setAttribute("value",String(s)):i.setAttribute("selected","selected"),n.appendChild(i)}),r.appendChild(n)}Ma.DEFAULTS={container:null,handlers:{clean(){const r=this.quill.getSelection();if(r!=null)if(r.length===0){const e=this.quill.getFormat();Object.keys(e).forEach(t=>{this.quill.scroll.query(t,Q.INLINE)!=null&&this.quill.format(t,!1,C.sources.USER)})}else this.quill.removeFormat(r.index,r.length,C.sources.USER)},direction(r){const{align:e}=this.quill.getFormat();r==="rtl"&&e==null?this.quill.format("align","right",C.sources.USER):!r&&e==="right"&&this.quill.format("align",!1,C.sources.USER),this.quill.format("direction",r,C.sources.USER)},indent(r){const e=this.quill.getSelection(),t=this.quill.getFormat(e),n=parseInt(t.indent||0,10);if(r==="+1"||r==="-1"){let s=r==="+1"?1:-1;t.direction==="rtl"&&(s*=-1),this.quill.format("indent",n+s,C.sources.USER)}},link(r){r===!0&&(r=prompt("Enter link URL:")),this.quill.format("link",r,C.sources.USER)},list(r){const e=this.quill.getSelection(),t=this.quill.getFormat(e);r==="check"?t.list==="checked"||t.list==="unchecked"?this.quill.format("list",!1,C.sources.USER):this.quill.format("list","unchecked",C.sources.USER):this.quill.format("list",r,C.sources.USER)}}};const m1='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="13" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="9" y1="4" y2="4"/></svg>',b1='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="14" x2="4" y1="14" y2="14"/><line class="ql-stroke" x1="12" x2="6" y1="4" y2="4"/></svg>',y1='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="5" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="9" y1="4" y2="4"/></svg>',v1='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="3" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="3" y1="4" y2="4"/></svg>',x1='<svg viewbox="0 0 18 18"><g class="ql-fill ql-color-label"><polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"/><rect height="1" width="1" x="4" y="4"/><polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"/><rect height="1" width="1" x="2" y="6"/><rect height="1" width="1" x="3" y="5"/><rect height="1" width="1" x="4" y="7"/><polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"/><rect height="1" width="1" x="2" y="12"/><rect height="1" width="1" x="2" y="9"/><rect height="1" width="1" x="2" y="15"/><polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"/><rect height="1" width="1" x="3" y="8"/><path d="M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z"/><path d="M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z"/><path d="M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z"/><rect height="1" width="1" x="12" y="2"/><rect height="1" width="1" x="11" y="3"/><path d="M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z"/><rect height="1" width="1" x="2" y="3"/><rect height="1" width="1" x="6" y="2"/><rect height="1" width="1" x="3" y="2"/><rect height="1" width="1" x="5" y="3"/><rect height="1" width="1" x="9" y="2"/><rect height="1" width="1" x="15" y="14"/><polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"/><rect height="1" width="1" x="13" y="7"/><rect height="1" width="1" x="15" y="5"/><rect height="1" width="1" x="14" y="6"/><rect height="1" width="1" x="15" y="8"/><rect height="1" width="1" x="14" y="9"/><path d="M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z"/><rect height="1" width="1" x="14" y="3"/><polygon points="12 6.868 12 6 11.62 6 12 6.868"/><rect height="1" width="1" x="15" y="2"/><rect height="1" width="1" x="12" y="5"/><rect height="1" width="1" x="13" y="4"/><polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"/><rect height="1" width="1" x="9" y="14"/><rect height="1" width="1" x="8" y="15"/>
66<path d="M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z"/><rect height="1" width="1" x="5" y="15"/><path d="M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z"/><rect height="1" width="1" x="11" y="15"/><path d="M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z"/><rect height="1" width="1" x="14" y="15"/><rect height="1" width="1" x="15" y="11"/></g><polyline class="ql-stroke" points="5.5 13 9 5 12.5 13"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="11" y2="11"/></svg>',E1='<svg viewbox="0 0 18 18"><rect class="ql-fill ql-stroke" height="3" width="3" x="4" y="5"/><rect class="ql-fill ql-stroke" height="3" width="3" x="11" y="5"/><path class="ql-even ql-fill ql-stroke" d="M7,8c0,4.031-3,5-3,5"/><path class="ql-even ql-fill ql-stroke" d="M14,8c0,4.031-3,5-3,5"/></svg>',w1='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z"/><path class="ql-stroke" d="M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z"/></svg>',N1='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="5" x2="13" y1="3" y2="3"/><line class="ql-stroke" x1="6" x2="9.35" y1="12" y2="3"/><line class="ql-stroke" x1="11" x2="15" y1="11" y2="15"/><line class="ql-stroke" x1="15" x2="11" y1="11" y2="15"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="7" x="2" y="14"/></svg>',Ul='<svg viewbox="0 0 18 18"><polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"/><polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"/><line class="ql-stroke" x1="10" x2="8" y1="5" y2="13"/></svg>',A1='<svg viewbox="0 0 18 18"><line class="ql-color-label ql-stroke ql-transparent" x1="3" x2="15" y1="15" y2="15"/><polyline class="ql-stroke" points="5.5 11 9 3 12.5 11"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="9" y2="9"/></svg>',T1='<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"/><line class="ql-stroke ql-fill" x1="15" x2="11" y1="4" y2="4"/><path class="ql-fill" d="M11,3a3,3,0,0,0,0,6h1V3H11Z"/><rect class="ql-fill" height="11" width="1" x="11" y="4"/><rect class="ql-fill" height="11" width="1" x="13" y="4"/></svg>',C1='<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"/><line class="ql-stroke ql-fill" x1="9" x2="5" y1="4" y2="4"/><path class="ql-fill" d="M5,3A3,3,0,0,0,5,9H6V3H5Z"/><rect class="ql-fill" height="11" width="1" x="5" y="4"/><rect class="ql-fill" height="11" width="1" x="7" y="4"/></svg>',S1='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z"/><rect class="ql-fill" height="1.6" rx="0.8" ry="0.8" width="5" x="5.15" y="6.2"/><path class="ql-fill" d="M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z"/></svg>',L1='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z"/></svg>',O1='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',q1='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.65186,12.30664a2.6742,2.6742,0,0,1-2.915,2.68457,3.96592,3.96592,0,0,1-2.25537-.6709.56007.56007,0,0,1-.13232-.83594L11.64648,13c.209-.34082.48389-.36328.82471-.1543a2.32654,2.32654,0,0,0,1.12256.33008c.71484,0,1.12207-.35156,1.12207-.78125,0-.61523-.61621-.86816-1.46338-.86816
66H13.2085a.65159.65159,0,0,1-.68213-.41895l-.05518-.10937a.67114.67114,0,0,1,.14307-.78125l.71533-.86914a8.55289,8.55289,0,0,1,.68213-.7373V8.58887a3.93913,3.93913,0,0,1-.748.05469H11.9873a.54085.54085,0,0,1-.605-.60547V7.59863a.54085.54085,0,0,1,.605-.60547h3.75146a.53773.53773,0,0,1,.60547.59375v.17676a1.03723,1.03723,0,0,1-.27539.748L14.74854,10.0293A2.31132,2.31132,0,0,1,16.65186,12.30664ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',j1='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm7.05371,7.96582v.38477c0,.39648-.165.60547-.46191.60547h-.47314v1.29785a.54085.54085,0,0,1-.605.60547h-.69336a.54085.54085,0,0,1-.605-.60547V12.95605H11.333a.5412.5412,0,0,1-.60547-.60547v-.15332a1.199,1.199,0,0,1,.22021-.748l2.56348-4.05957a.7819.7819,0,0,1,.72607-.39648h1.27637a.54085.54085,0,0,1,.605.60547v3.7627h.33008A.54055.54055,0,0,1,17.05371,11.96582ZM14.28125,8.7207h-.022a4.18969,4.18969,0,0,1-.38525.81348l-1.188,1.80469v.02246h1.5293V9.60059A7.04058,7.04058,0,0,1,14.28125,8.7207Z"/></svg>',I1='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.74023,12.18555a2.75131,2.75131,0,0,1-2.91553,2.80566,3.908,3.908,0,0,1-2.25537-.68164.54809.54809,0,0,1-.13184-.8252L11.73438,13c.209-.34082.48389-.36328.8252-.1543a2.23757,2.23757,0,0,0,1.1001.33008,1.01827,1.01827,0,0,0,1.1001-.96777c0-.61621-.53906-.97949-1.25439-.97949a2.15554,2.15554,0,0,0-.64893.09961,1.15209,1.15209,0,0,1-.814.01074l-.12109-.04395a.64116.64116,0,0,1-.45117-.71484l.231-3.00391a.56666.56666,0,0,1,.62744-.583H15.541a.54085.54085,0,0,1,.605.60547v.43945a.54085.54085,0,0,1-.605.60547H13.41748l-.04395.72559a1.29306,1.29306,0,0,1-.04395.30859h.022a2.39776,2.39776,0,0,1,.57227-.07715A2.53266,2.53266,0,0,1,16.74023,12.18555ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',k1='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M14.51758,9.64453a1.85627,1.85627,0,0,0-1.24316.38477H13.252a1.73532,1.73532,0,0,1,1.72754-1.4082,2.66491,2.66491,0,0,1,.5498.06641c.35254.05469.57227.01074.70508-.40723l.16406-.5166a.53393.53393,0,0,0-.373-.75977,4.83723,4.83723,0,0,0-1.17773-.14258c-2.43164,0-3.7627,2.17773-3.7627,4.43359,0,2.47559,1.60645,3.69629,3.19043,3.69629A2.70585,2.70585,0,0,0,16.96,12.19727,2.43861,2.43861,0,0,0,14.51758,9.64453Zm-.23047,3.58691c-.67187,0-1.22168-.81445-1.22168-1.45215,0-.47363.30762-.583.72559-.583.96875,0,1.27734.59375,1.27734,1.12207A.82182.82182,0,0,1,14.28711,13.23145ZM10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Z"/></svg>',_1='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="13" y1="4" y2="4"/><line class="ql-stroke" x1="5" x2="11" y1="14" y2="14"/><line class="ql-stroke" x1="8" x2="10" y1="14" y2="4"/></svg>',R1='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="10" width="12" x="3" y="4"/><circle class="ql-fill" cx="6" cy="7" r="1"/><polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"/></svg>',M1='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"/></svg>',B1='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="5 7 5 11 3 9 5 7"/></svg>',D1='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="11" y1="7" y2="11"/><path class="ql-even ql-stroke" d="M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z"/><path class="ql-even ql-stroke" d="M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z"/></svg>',P1='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="6" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="6" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="6" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="3" y1="4" y2="4"/><line class="ql-stroke" x1="3" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="3" y1="14" y2="14"/></svg>',$1='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="9" x2="15" y1="4" y2="4"/><polyline class="ql-stroke" points="3 4 4 5 6 3"/><line class="ql-stroke" x1="9" x2="15" y1="14" y2="14"/><polyline class="ql-stroke" points="3 14 4 15 6 13"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="3 9 4 10 6 8"/></svg>',F1='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="7" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="7" x2="15" y1="14" y2="14"/><line class="ql-stroke ql-thin" x1="2.5" x2="4.5" y1="5.5" y2="5.5"/><path class="ql-fill" d="M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z"/>
66<path class="ql-stroke ql-thin" d="M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156"/><path class="ql-stroke ql-thin" d="M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109"/></svg>',U1='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z"/><path class="ql-fill" d="M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z"/></svg>',H1='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z"/><path class="ql-fill" d="M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z"/></svg>',z1='<svg viewbox="0 0 18 18"><line class="ql-stroke ql-thin" x1="15.5" x2="2.5" y1="8.5" y2="9.5"/><path class="ql-fill" d="M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z"/><path class="ql-fill" d="M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z"/></svg>',G1='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="2" width="3" x="5" y="5"/><rect class="ql-fill" height="2" width="4" x="9" y="5"/><g class="ql-fill ql-transparent"><rect height="2" width="3" x="5" y="8"/><rect height="2" width="4" x="9" y="8"/><rect height="2" width="3" x="5" y="11"/><rect height="2" width="4" x="9" y="11"/></g></svg>',K1='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="12" x="3" y="15"/></svg>',W1='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="12" width="1" x="5" y="3"/><rect class="ql-fill" height="12" width="1" x="12" y="3"/><rect class="ql-fill" height="2" width="8" x="5" y="8"/><rect class="ql-fill" height="1" width="3" x="3" y="5"/><rect class="ql-fill" height="1" width="3" x="3" y="7"/><rect class="ql-fill" height="1" width="3" x="3" y="10"/><rect class="ql-fill" height="1" width="3" x="3" y="12"/><rect class="ql-fill" height="1" width="3" x="12" y="5"/><rect class="ql-fill" height="1" width="3" x="12" y="7"/><rect class="ql-fill" height="1" width="3" x="12" y="10"/><rect class="ql-fill" height="1" width="3" x="12" y="12"/></svg>',$r={align:{"":m1,center:b1,right:y1,justify:v1},background:x1,blockquote:E1,bold:w1,clean:N1,code:Ul,"code-block":Ul,color:A1,direction:{"":T1,rtl:C1},formula:S1,header:{1:L1,2:O1,3:q1,4:j1,5:I1,6:k1},italic:_1,image:R1,indent:{"+1":M1,"-1":B1},link:D1,list:{bullet:P1,check:$1,ordered:F1},script:{sub:U1,super:H1},strike:z1,table:G1,underline:K1,video:W1},V1='<svg viewbox="0 0 18 18"><polygon class="ql-stroke" points="7 11 9 13 11 11 7 11"/><polygon class="ql-stroke" points="7 7 9 5 11 7 7 7"/></svg>';let Hl=0;function zl(r,e){r.setAttribute(e,`${r.getAttribute(e)!=="true"}`)}class Us{constructor(e){this.select=e,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",()=>{this.togglePicker()}),this.label.addEventListener("keydown",t=>{switch(t.key){case"Enter":this.togglePicker();break;case"Escape":this.escape(),t.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}togglePicker(){this.container.classList.toggle("ql-expanded"),zl(this.label,"aria-expanded"),zl(this.options,"aria-hidden")}buildItem(e){const t=document.createElement("span");t.tabIndex="0",t.setAttribute("role","button"),t.classList.add("ql-picker-item");const n=e.getAttribute("value");return n&&t.setAttribute("data-value",n),e.textContent&&t.setAttribute("data-label",e.textContent),t.addEventListener("click",()=>{this.selectItem(t,!0)}),t.addEventListener("keydown",s=>{switch(s.key){case"Enter":this.selectItem(t,!0),s.preventDefault();break;case"Escape":this.escape(),s.preventDefault();break}}),t}buildLabel(){const e=document.createElement("span");return e.classList.add("ql-picker-label"),e.innerHTML=V1,e.tabIndex="0",e.setAttribute("role","button"),e.setAttribute("aria-expanded","fal
66se"),this.container.appendChild(e),e}buildOptions(){const e=document.createElement("span");e.classList.add("ql-picker-options"),e.setAttribute("aria-hidden","true"),e.tabIndex="-1",e.id=`ql-picker-options-${Hl}`,Hl+=1,this.label.setAttribute("aria-controls",e.id),this.options=e,Array.from(this.select.options).forEach(t=>{const n=this.buildItem(t);e.appendChild(n),t.selected===!0&&this.selectItem(n)}),this.container.appendChild(e)}buildPicker(){Array.from(this.select.attributes).forEach(e=>{this.container.setAttribute(e.name,e.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}escape(){this.close(),setTimeout(()=>this.label.focus(),1)}close(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}selectItem(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const n=this.container.querySelector(".ql-selected");e!==n&&(n!=null&&n.classList.remove("ql-selected"),e!=null&&(e.classList.add("ql-selected"),this.select.selectedIndex=Array.from(e.parentNode.children).indexOf(e),e.hasAttribute("data-value")?this.label.setAttribute("data-value",e.getAttribute("data-value")):this.label.removeAttribute("data-value"),e.hasAttribute("data-label")?this.label.setAttribute("data-label",e.getAttribute("data-label")):this.label.removeAttribute("data-label"),t&&(this.select.dispatchEvent(new Event("change")),this.close())))}update(){let e;if(this.select.selectedIndex>-1){const n=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];e=this.select.options[this.select.selectedIndex],this.selectItem(n)}else this.selectItem(null);const t=e!=null&&e!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",t)}}class sc extends Us{constructor(e,t){super(e),this.label.innerHTML=t,this.container.classList.add("ql-color-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).slice(0,7).forEach(n=>{n.classList.add("ql-primary")})}buildItem(e){const t=super.buildItem(e);return t.style.backgroundColor=e.getAttribute("value")||"",t}selectItem(e,t){super.selectItem(e,t);const n=this.label.querySelector(".ql-color-label"),s=e&&e.getAttribute("data-value")||"";n&&(n.tagName==="line"?n.style.stroke=s:n.style.fill=s)}}class ic extends Us{constructor(e,t){super(e),this.container.classList.add("ql-icon-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).forEach(n=>{n.innerHTML=t[n.getAttribute("data-value")||""]}),this.defaultItem=this.container.querySelector(".ql-selected"),this.selectItem(this.defaultItem)}selectItem(e,t){super.selectItem(e,t);const n=e||this.defaultItem;if(n!=null){if(this.label.innerHTML===n.innerHTML)return;this.label.innerHTML=n.innerHTML}}}const Q1=r=>{const{overflowY:e}=getComputedStyle(r,null);return e!=="visible"&&e!=="clip"};class ac{constructor(e,t){this.quill=e,this.boundsContainer=t||document.body,this.root=e.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,Q1(this.quill.root)&&this.quill.root.addEventListener("scroll",()=>{this.root.style.marginTop=`${-1*this.quill.root.scrollTop}px`}),this.hide()}hide(){this.root.classList.add("ql-hidden")}position(e){const t=e.left+e.width/2-this.root.offsetWidth/2,n=e.bottom+this.quill.root.scrollTop;this.root.style.left=`${t}px`,this.root.style.top=`${n}px`,this.root.classList.remove("ql-flip");const s=this.boundsContainer.getBoundingClientRect(),i=this.root.getBoundingClientRect();let l=0;if(i.right>s.right&&(l=s.right-i.right,this.root.style.left=`${t+l}px`),i.left<s.left&&(l=s.left-i.left,this.root.style.left=`${t+l}px`),i.bottom>s.bottom){const o=i.bottom-i.top,c=e.bottom-e.top+o;this.root.style.top=`${n-c}px`,this.root.classList.add("ql-flip")}return l}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}const Z1=[!1,"center","right","justify"],Y1=["#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"],X1=[!1,"serif","monospace"],J1=["1","2","3",!1],e0=["small",!1,"large","huge"];class Kr extends or{constructor(e,t){super(e,t);const n=s=>{if(!document.body.contains(e.root)){document.body.removeEventListener("click",n);return}this.tooltip!=null&&!this.tooltip.root.contains(s.target)&&document.activeElement!==this.tooltip.textbox&&!this.quill.hasFocus()&&this.tooltip.hide(),this.pickers!=null&&this.pickers.forEac
66h(i=>{i.container.contains(s.target)||i.close()})};e.emitter.listenDOM("click",document.body,n)}addModule(e){const t=super.addModule(e);return e==="toolbar"&&this.extendToolbar(t),t}buildButtons(e,t){Array.from(e).forEach(n=>{(n.getAttribute("class")||"").split(/\s+/).forEach(i=>{if(i.startsWith("ql-")&&(i=i.slice(3),t[i]!=null))if(i==="direction")n.innerHTML=t[i][""]+t[i].rtl;else if(typeof t[i]=="string")n.innerHTML=t[i];else{const l=n.value||"";l!=null&&t[i][l]&&(n.innerHTML=t[i][l])}})})}buildPickers(e,t){this.pickers=Array.from(e).map(s=>{if(s.classList.contains("ql-align")&&(s.querySelector("option")==null&&Nr(s,Z1),typeof t.align=="object"))return new ic(s,t.align);if(s.classList.contains("ql-background")||s.classList.contains("ql-color")){const i=s.classList.contains("ql-background")?"background":"color";return s.querySelector("option")==null&&Nr(s,Y1,i==="background"?"#ffffff":"#000000"),new sc(s,t[i])}return s.querySelector("option")==null&&(s.classList.contains("ql-font")?Nr(s,X1):s.classList.contains("ql-header")?Nr(s,J1):s.classList.contains("ql-size")&&Nr(s,e0)),new Us(s)});const n=()=>{this.pickers.forEach(s=>{s.update()})};this.quill.on(G.events.EDITOR_CHANGE,n)}}Kr.DEFAULTS=hn({},or.DEFAULTS,{modules:{toolbar:{handlers:{formula(){this.quill.theme.tooltip.edit("formula")},image(){let r=this.container.querySelector("input.ql-image[type=file]");r==null&&(r=document.createElement("input"),r.setAttribute("type","file"),r.setAttribute("accept",this.quill.uploader.options.mimetypes.join(", ")),r.classList.add("ql-image"),r.addEventListener("change",()=>{const e=this.quill.getSelection(!0);this.quill.uploader.upload(e,r.files),r.value=""}),this.container.appendChild(r)),r.click()},video(){this.quill.theme.tooltip.edit("video")}}}}});class lc extends ac{constructor(e,t){super(e,t),this.textbox=this.root.querySelector('input[type="text"]'),this.listen()}listen(){this.textbox.addEventListener("keydown",e=>{e.key==="Enter"?(this.save(),e.preventDefault()):e.key==="Escape"&&(this.cancel(),e.preventDefault())})}cancel(){this.hide(),this.restoreFocus()}edit(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),this.textbox==null)return;t!=null?this.textbox.value=t:e!==this.root.getAttribute("data-mode")&&(this.textbox.value="");const n=this.quill.getBounds(this.quill.selection.savedRange);n!=null&&this.position(n),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute(`data-${e}`)||""),this.root.setAttribute("data-mode",e)}restoreFocus(){this.quill.focus({preventScroll:!0})}save(){let{value:e}=this.textbox;switch(this.root.getAttribute("data-mode")){case"link":{const{scrollTop:t}=this.quill.root;this.linkRange?(this.quill.formatText(this.linkRange,"link",e,G.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",e,G.sources.USER)),this.quill.root.scrollTop=t;break}case"video":e=t0(e);case"formula":{if(!e)break;const t=this.quill.getSelection(!0);if(t!=null){const n=t.index+t.length;this.quill.insertEmbed(n,this.root.getAttribute("data-mode"),e,G.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(n+1," ",G.sources.USER),this.quill.setSelection(n+2,G.sources.USER)}break}}this.textbox.value="",this.hide()}}function t0(r){let e=r.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||r.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return e?`${e[1]||"https"}://www.youtube.com/embed/${e[2]}?showinfo=0`:(e=r.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?`${e[1]||"https"}://player.vimeo.com/video/${e[2]}/`:r}function Nr(r,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;e.forEach(n=>{const s=document.createElement("option");n===t?s.setAttribute("selected","selected"):s.setAttribute("value",String(n)),r.appendChild(s)})}const n0=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class oc extends lc{constructor(e,t){super(e,t),this.quill.on(G.events.EDITOR_CHANGE,(n,s,i,l)=>{if(n===G.events.SELECTION_CHANGE)if(s!=null&&s.length>0&&l===G.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width=`${this.root.offsetWidth}px`;const o=this.quill.getLines(s.index,s.length);if(o.length===1){const c=this.quill.getBounds(s);c!=null&&this.position(c)}else{const c=o[o.length-1],d=this.quill.getIndex(c),p=Math.min(c.length()-1,s.index+s.length-d),x=this.quill.getBounds(new qn(d,p));x!=null&&this.position(x)}}else document.activeElement!==this.textbox&&this.quill.hasFocus()&&this.hide()})}listen(){super.listen(),this.root.querySelector(".ql-close").addEventListener("click",()=>{this.root.classList.remove("ql-editing")}),this.quill.on(G.events.SCROLL_OPTIMIZE,()=>{setTimeout(()=>{if(this.root.classList.contains("ql-hidden"))return;const e=this.quill.getSelection();if(e!=null){const t=this.quill.getBounds(e);t!=null&&this.position(t)}},1)})}cancel(){this.show()}position(e){const t=super.position(e),n=this.root.querySelector(".ql-tooltip-arrow");return n.style.marginLeft="",t!==0&&(n.style.marginLeft=`${-1*t-n.offsetWidth/2}px`),t}}U(oc,"TEMPLATE",['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join(""));class cc extends Kr{constructor(e,t){t.modules.toolbar!=null&&t.modules.toolbar.container==null&&(t.modules.toolbar.container=n0),super(e,t),this.quill.container.classList.add("ql-bubble")}extendToolbar(e){this.tooltip=new oc(this.quill,this.options.bounds),e.container!=null&&(this.tooltip.root.appendChild(e.container),this.buildButtons(e.container.querySelectorAll("button"),$r),this.buildPickers(e.container.querySelectorAll("select"),$r))}}cc.DEFAULTS=hn({},Kr.DEFAULTS,{modules:{toolbar:{handlers:{link(r){r?this.quill.theme.tooltip.edit():this.quill.format("link",!1,C.sources.USER)}}}}});const r0=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class uc extends lc{constructor(){super(...arguments);U(this,"preview",this.root.querySelector("a.ql-preview"))}listen(){super.listen(),this.root.querySelector("a.ql-action").addEventListener("click",t=>{this.root.classList.contains("ql-editing")?this.save():this.edit("link",this.preview.textContent),t.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",t=>{if(this.linkRange!=null){const n=this.linkRange;this.restoreFocus(),this.quill.formatText(n,"link",!1,G.sources.USER),delete this.linkRange}t.preventDefault(),this.hide()}),this.quill.on(G.events.SELECTION_CHANGE,(t,n,s)=>{if(t!=null){if(t.length===0&&s===G.sources.USER){const[i,l]=this.quill.scroll.descendant(un,t.index);if(i!=null){this.linkRange=new qn(t.index-l,i.length());const o=un.formats(i.domNode);this.preview.textContent=o,this.preview.setAttribute("href",o),this.show();const c=this.quill.getBounds(this.linkRange);c!=null&&this.position(c);return}}else delete this.linkRange;this.hide()}})}show(){super.show(),this.root.removeAttribute("data-mode")}}U(uc,"TEMPLATE",['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join(""));class hc extends Kr{constructor(e,t){t.modules.toolbar!=null&&t.modules.toolbar.container==null&&(t.modules.toolbar.container=r0),super(e,t),this.quill.container.classList.add("ql-snow")}extendToolbar(e){e.container!=null&&(e.container.classList.add("ql-snow"),this.buildButtons(e.container.querySelectorAll("button"),$r),this.buildPickers(e.container.querySelectorAll("select"),$r),this.tooltip=new uc(this.quill,this.options.bounds),e.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"k",shortKey:!0},(t,n)=>{e.handlers.link.call(e,!n.format.link)}))}}hc.DEFAULTS=hn({},Kr.DEFAULTS,{modules:{toolbar:{handlers:{link(r){if(r){const e=this.quill.getSelection();if(e==null||e.length===0)return;let t=this.quill.getText(e);/^\S+@\S+\.\S+$/.test(t)&&t.indexOf("mailto:")!==0&&(t=`mailto:${t}`);const{tooltip:n}=this.quill.theme;n.edit("link",t)}else this.quill.format("link",!1,C.sources.USER)}}}}});C.register({"attributors/attribute/direction":zo,"attributors/class/align":Fo,"attributors/class/background":Em,"attributors/class/color":xm,"attributors/class/direction":Go,"attributors/class/font":Vo,"attributors/class/size":Zo,"attributors/style/align":Uo,"attributors/style/background":qa,"attributors/style/color":Oa,"attributors/style/direction":Ko,"attributors/style/font":Qo,"attributors/style/size":Yo},!0);C.register({"formats/align":Fo,"formats/direction":Go,"formats/indent":h1,"formats/background":qa,"formats/color":Oa,"formats/font":Vo,"formats/size":Zo,"formats/blockquote":oa,"formats/code-block":Qe,"formats/header":ca,"formats/list":Gr,"formats/bold":Pr,"formats/code":ja,"formats/ital
66ic":ua,"formats/link":un,"formats/script":ha,"formats/strike":da,"formats/underline":fa,"formats/formula":ws,"formats/image":pa,"formats/video":Ns,"modules/syntax":rc,"modules/table":f1,"modules/toolbar":Ma,"themes/bubble":cc,"themes/snow":hc,"ui/icons":$r,"ui/picker":Us,"ui/icon-picker":ic,"ui/color-picker":sc,"ui/tooltip":ac},!0);class Hs extends ae.Component{constructor(e){super(e),this.editingAreaRef=k.createRef(),this.containerRef=k.createRef(),this.dirtyProps=["modules","formats","bounds","theme","children"],this.cleanProps=["id","className","style","placeholder","tabIndex","onChange","onChangeSelection","onFocus","onBlur","onKeyPress","onKeyDown","onKeyUp"],this.state={generation:0},this.selection=null,this.onEditorChange=(n,s,i,l)=>{var o,c;n==="text-change"?(o=this.onEditorChangeText)==null||o.call(this,this.editor.root.innerHTML,s,l,this.unprivilegedEditor):n==="selection-change"&&((c=this.onEditorChangeSelection)==null||c.call(this,s,l,this.unprivilegedEditor))};const t=this.isControlled()?e.value:e.defaultValue;this.value=t??""}validateProps(e){if(ae.Children.count(e.children)>1)throw new Error("The Quill editing area can only be composed of a single React element.");if(ae.Children.count(e.children)){const t=ae.Children.only(e.children);if((t==null?void 0:t.type)==="textarea")throw new Error("Quill does not support editing on a <textarea>. Use a <div> instead.")}if(this.lastDeltaChangeSet&&e.value===this.lastDeltaChangeSet)throw new Error("You are passing the `delta` object from the `onChange` event back as `value`. You most probably want `editor.getContents()` instead. See: https://github.com/zenoamaro/react-quill#using-deltas")}shouldComponentUpdate(e,t){if(this.validateProps(e),!this.editor||this.state.generation!==t.generation)return!0;if("value"in e){const n=this.getEditorContents(),s=e.value??"";this.isEqualValue(s,n)||this.setEditorContents(this.editor,s)}return e.readOnly!==this.props.readOnly&&this.setEditorReadOnly(this.editor,e.readOnly),[...this.cleanProps,...this.dirtyProps].some(n=>!ln(e[n],this.props[n]))}shouldComponentRegenerate(e){return this.dirtyProps.some(t=>!ln(e[t],this.props[t]))}componentDidMount(){this.instantiateEditor(),this.setEditorContents(this.editor,this.getEditorContents())}componentWillUnmount(){this.destroyEditor()}componentDidUpdate(e,t){if(this.editor&&this.shouldComponentRegenerate(e)){const n=this.editor.getContents(),s=this.editor.getSelection();this.regenerationSnapshot={delta:n,selection:s},this.setState({generation:this.state.generation+1}),this.destroyEditor()}if(this.state.generation!==t.generation){const{delta:n,selection:s}=this.regenerationSnapshot;delete this.regenerationSnapshot,this.instantiateEditor();const i=this.editor;i.setContents(n),Gl(()=>this.setEditorSelection(i,s))}}instantiateEditor(){this.editor?this.hookEditor(this.editor):this.editor=this.createEditor(this.getEditingArea(),this.getEditorConfig())}destroyEditor(){var n,s;if(!this.editor)return;this.unhookEditor(this.editor);const e=(n=this.props.modules)==null?void 0:n.toolbar;if(!(typeof e=="object"&&e&&"container"in e&&typeof e.container=="string"||typeof e=="string")){const i=(s=this.containerRef.current)==null?void 0:s.querySelector(".ql-toolbar");i&&i.remove()}delete this.editor}isControlled(){return"value"in this.props}getEditorConfig(){return{bounds:this.props.bounds,formats:this.props.formats,modules:this.props.modules,placeholder:this.props.placeholder,readOnly:this.props.readOnly,tabIndex:this.props.tabIndex,theme:this.props.theme}}getEditor(){if(!this.editor)throw new Error("Accessing non-instantiated editor");return this.editor}createEditor(e,t){const n=new C(e,t);return t.tabIndex!=null&&this.setEditorTabIndex(n,t.tabIndex),this.hookEditor(n),n}hookEditor(e){this.unprivilegedEditor=this.makeUnprivilegedEditor(e),e.on("editor-change",this.onEditorChange)}unhookEditor(e){e.off("editor-change",this.onEditorChange)}getEditorContents(){return this.value}getEditorSelection(){return this.selection}isDelta(e){return e&&e.ops}isEqualValue(e,t){return this.isDelta(e)&&this.isDelta(t)?ln(e.ops,t.ops):ln(e,t)}setEditorContents(e,t){this.value=t;const n=this.getEditorSelection();typeof t=="string"?e.setContents(e.clipboard.convert({html:t})):e.setContents(t),Gl(()=>this.setEditorSelection(e,n))}setEditorSelection(e,t){if(this.selection=t,t){const n=e.getLength();t.index=Math.max(0,Math.min(t.index,n-1)),t.length=Math.max(0,Math.min(t.length,n-1-t.index)),e.setSelection(t)}}setEditorTabIndex(e,t){var n;
66(n=e==null?void 0:e.scroll)!=null&&n.domNode&&(e.scroll.domNode.tabIndex=t)}setEditorReadOnly(e,t){t?e.disable():e.enable()}makeUnprivilegedEditor(e){const t=e;return{getHTML:()=>t.root.innerHTML,getSemanticHTML:t.getSemanticHTML.bind(t),getLength:t.getLength.bind(t),getText:t.getText.bind(t),getContents:t.getContents.bind(t),getSelection:t.getSelection.bind(t),getBounds:t.getBounds.bind(t)}}getEditingArea(){const e=this.editingAreaRef.current;if(!e)throw new Error("Cannot find element for editing area");if(e.nodeType===3)throw new Error("Editing area cannot be a text node");return e}renderEditingArea(){const{children:e,preserveWhitespace:t}=this.props,{generation:n}=this.state,s={key:n,ref:this.editingAreaRef};return ae.Children.count(e)?ae.cloneElement(ae.Children.only(e),s):t?ae.createElement("pre",{...s}):ae.createElement("div",{...s})}render(){return ae.createElement("div",{ref:this.containerRef,id:this.props.id,style:this.props.style,key:this.state.generation,className:`quill ${this.props.className??""}`,onKeyPress:this.props.onKeyPress,onKeyDown:this.props.onKeyDown,onKeyUp:this.props.onKeyUp},this.renderEditingArea())}onEditorChangeText(e,t,n,s){var l,o;if(!this.editor)return;const i=this.isDelta(this.value)?s.getContents():s.getHTML();i!==this.getEditorContents()&&(this.lastDeltaChangeSet=t,this.value=i,(o=(l=this.props).onChange)==null||o.call(l,e,t,n,s))}onEditorChangeSelection(e,t,n){var o,c,d,p,x,f;if(!this.editor)return;const s=this.getEditorSelection(),i=!s&&e,l=s&&!e;ln(e,s)||(this.selection=e,(c=(o=this.props).onChangeSelection)==null||c.call(o,e,t,n),i?(p=(d=this.props).onFocus)==null||p.call(d,e,t,n):l&&((f=(x=this.props).onBlur)==null||f.call(x,s,t,n)))}focus(){this.editor&&this.editor.focus()}blur(){this.editor&&(this.selection=null,this.editor.blur())}}Hs.displayName="React Quill";Hs.Quill=C;Hs.defaultProps={theme:"snow",modules:{},readOnly:!1};function Gl(r){Promise.resolve().then(r)}const s0={toolbar:[[{header:[1,2,3,!1,5]}],[{size:[]}],[{color:[]},{background:[]}],["bold","italic","underline","strike","blockquote"],["link"],[{align:[]}],[{list:"ordered"},{list:"bullet"}],["clean"]]},i0=["header","bold","italic","underline","strike","blockquote","list","link","color","image","background","align","size","font"];let Kl=!1;const Ar=r=>(r=r.replaceAll("</p>",`</p>
67`),r=r.replaceAll("<br>",`
68`),r=r.replaceAll("</h1>",`</h1>
69`),r=r.replaceAll("</h2>",`</h2>
70`),r=r.replaceAll("</h3>",`</h3>
71`),r=r.replaceAll("</h4>",`</h4>
72`),r=r.replaceAll(/<[^>]*>?/gm,""),r),a0=()=>{const{setCategories:r,setTopics:e,setEntities:t,setRecentConcepts:n,analyzeArticle:s,editorText:i,setEditorText:l,setTextEditor:o,setTagError:c,taggingTimeout:d,formatTag:p,clearTags:x,setGenderData:f,tagQualityAssurance:m,isPlaying:y,tagSettings:E,articleFormat:w,channels:S}=k.useContext(ur),{showBroaderTags:I}=k.useContext(Jl),[M,H]=k.useState(!1),[L,P]=k.useState(""),W=k.useRef(void 0),re=(A,v=void 0)=>{var q,B,D,_,Z,Y,te,X,R;let j={headline:"",preamble:"",body:[],dateline:"",images:[{caption:""},{caption:""}],channels:S,...v};const T=new DOMParser().parseFromString(A,"text/html").body;return j.headline=Ar((B=(q=$(T))==null?void 0:q.find("h1"))==null?void 0:B.text()),j.preamble=Ar((_=(D=$(T))==null?void 0:D.find("h2"))==null?void 0:_.text()),j.dateline=Ar((Y=(Z=$(T))==null?void 0:Z.find("h3"))==null?void 0:Y.text()),j.body=(R=(X=(te=$(T))==null?void 0:te.find("p"))==null?void 0:X.get())==null?void 0:R.map(pe=>Ar(pe.innerHTML)),j};k.useEffect(()=>{Kl=M},[M]),k.useEffect(()=>{W.current&&(W.current.getEditor().root.dataset.placeholder=m?"":"Write something awesome here :)")},[m]),k.useEffect(()=>{var A,v;W.current&&(o((A=W.current)==null?void 0:A.getEditor()),(v=W.current)==null||v.getEditor().focus(),W.current.getEditor().onEditorChange=g)},[]);const fe=A=>{let v=A.replaceAll(/<img[^>]*>/g,"");return v=v.replaceAll("<a[^>]*>(.*?)</a>",""),v=v.replaceAll(/<\/?figure[^>]*>/g,""),v},F=A=>!A||(A.getContents().ops||[]).length!==1?!1:A.getText().trim().length===0,g=(A,v=null,j=2e3,O=void 0,T=void 0)=>{var q;if(!y&&clearTimeout(d.current),l(fe(A)),!m&&!(v&&!y&&v.getText()===L)){if(F((q=W.current)==null?void 0:q.getEditor())){P(fe(A)),x();return}!y&&!m&&!F(v)&&(c({error:!1,message:""}),d.current=setTimeout(()=>{if(Kl)return;let B={articleFormat:w,categories:E.categories,topics:E.topics,entities:E.entities,...O},D=Ar(A);((O==null?void 0:O.articleFormat)==="json"||!O&&w==="json")&&(D=JSON.stringify(re(A,T)),B={...E,...B,articleFormat:"json"}),H(!0),s({fetchPolicy:"network-only",variables:{articleText:D,settings:B}}).then(_=>{var pe,oe,ee,ue,de,se;P(v==null?void 0:v.getText());let Z=[],Y=[],te=[],X=[];X=((oe=(pe=_==null?void 0:_.data)==null?void 0:pe.analyzeArticle)==null?void 0:oe.concepts)||[],f(((ue=(ee=_==null?void 0:_.data)==null?void 0:ee.analyzeArticle)==null?void 0:ue.genderData)||{maleScore:0,maleMentions:0,uniqueMaleEntities:0,malePeople:[],femaleScore:0,femaleMentions:0,uniqueFemaleEntities:0,femalePeople:[],nonbinaryScore:0,nonbinaryMentions:0,uniqueNonbinaryEntities:0,nonbinaryPeople:[],unknownScore:0,unknownMentions:0,uniqueUnknownEntities:0,unknownPeople:[]});
72const R=((se=(de=_==null?void 0:_.data)==null?void 0:de.analyzeArticle)==null?void 0:se.broader)||[];R.length>0?(n([...X,...R]),I&&R.forEach(ie=>{X.some(ce=>ce.uuid===ie.uuid)||X.push(ie)})):n([]),X.forEach(ie=>{delete ie.__typename,ie.type.includes("category")?Z=[...Z,p(ie)]:ie.type.includes("topic")?Y=[...Y,p(ie)]:te=[...te,p(ie)]}),r(Z),e(Y),t(te)}).catch(_=>{c({error:!0,message:(_==null?void 0:_.message)+". Contact iMatrics if this problem persists."})}).finally(()=>{H(!1)})},j))}};return h.jsxs(sn,{id:"editor",elevation:0,sx:{height:"100%",position:"relative",bgcolor:"#fff",border:"1px solid #dcdcdd",borderRadius:1},children:[h.jsx(Fi,{color:"primary",variant:M?"indeterminate":"determinate",value:0,sx:{position:"absolute",top:"0",left:"0",width:"100%",visibility:M?"visible":"hidden",zIndex:1}}),h.jsx(Hs,{id:"demo-editor",ref:W,readOnly:!!(m||y),theme:"snow",modules:s0,formats:i0,style:{display:"flex",height:"100%",flex:1,flexDirection:"column",overflow:"hidden"},value:i,onChange:(A,v,j,O)=>{g(A,O)}})]})},l0=Vl(r=>Ql({genderBar:{display:"flex",justifyContent:"space-between",height:"29.6px",backgroundColor:"#fff",boxSizing:"border-box",flexWrap:"nowrap",borderRadius:"0.2em",border:"0.8px solid rgba(0, 0, 0, 0.125)",overflow:"hidden",transition:"all .5s linear",cursor:"pointer"},femaleBar:{borderRadius:"0.2em 0 0 0.2em",backgroundColor:"#ddd",transition:"all .5s linear",width:"0px",fontWeight:700},maleBar:{backgroundColor:"#eee",borderRadius:"0 0.2em 0.2em 0",transition:"all .5s linear",width:"0px",fontWeight:700},popover:{pointerEvents:"none"},paper:{maxWidth:"33%",minWidth:"300px",padding:"16px"}})),o0=()=>{var p,x,f,m,y,E,w,S;const r=l0(),{genderData:e,resetGenderData:t,editorText:n}=k.useContext(ur),[s,i]=k.useState(null),l=!!s,o=I=>{i(I.currentTarget)},c=()=>{i(null)},d=()=>{let I=document.getElementById("female-bar"),M=document.getElementById("male-bar");const H=e.maleScore+e.femaleScore,{femaleProportion:L,maleProportion:P}=H>0?(()=>{let W=e.femaleScore/H*100,re=e.maleScore/H*100,fe=Math.round(W),F=Math.round(re);const g=fe+F;return g!==100&&(fe>F?fe-=g-100:F-=g-100),{femaleProportion:fe,maleProportion:F}})():{femaleProportion:0,maleProportion:0};I.style.width=L+"%",I.innerHTML=L>=3?L+"%":"",M.style.width=P+"%",M.innerHTML=P>=3?P+"%":""};return k.useEffect(d,[e]),k.useEffect(()=>{n||t()},[n]),h.jsxs(z,{children:[h.jsxs(z,{display:"flex",justifyContent:"space-between",children:[h.jsx(z,{children:h.jsxs(je,{variant:"overline",sx:{display:"flex",alignItems:"center",gap:.5},children:[h.jsx(Ec,{}),"Women:",h.jsx("span",{style:{fontWeight:700},children:e.uniqueFemaleEntities})]})}),h.jsx(z,{children:h.jsxs(je,{variant:"overline",sx:{display:"flex",alignItems:"center",gap:.5},children:[h.jsx(wc,{})," Men:",h.jsx("span",{style:{fontWeight:700},children:e.uniqueMaleEntities})]})})]}),h.jsxs(z,{className:r.genderBar,"aria-owns":l?"gender-popover":void 0,"aria-haspopup":"true",onMouseEnter:o,onMouseLeave:c,children:[h.jsx(z,{id:"female-bar",display:"flex",alignItems:"center",justifyContent:"center",className:r.femaleBar}),h.jsx(z,{id:"male-bar",display:"flex",alignItems:"center",justifyContent:"center",className:r.maleBar})]}),h.jsxs(Nc,{id:"gender-popover",className:r.popover,classes:{paper:r.paper},open:l,anchorEl:s,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},onClose:c,disableRestoreFocus:!0,children:[h.jsxs(z,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[h.jsx(je,{variant:"overline",children:"Female mentions: "}),h.jsx("span",{className:"font-weight-bold",children:e.femaleScore})]}),h.jsxs(z,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[h.jsx(je,{variant:"overline",children:"Male mentions: "}),h.jsx("span",{className:"font-weight-bold",children:e.maleScore})]}),h.jsxs(z,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[h.jsx(je,{variant:"overline",children:"Non-binary mentions: "}),h.jsx("span",{className:"font-weight-bold",children:e.nonbinaryScore})]}),h.jsxs(z,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[h.jsx(je,{variant:"overline",children:"Unknown mentions: "}),h.jsx("span",{className:"font-weight-bold",children:e.unknownScore})]}),h.jsxs(z,{display:"flex",justifyContent:"space-between",alignItems:"center",borderTop:"1px solid rgba(0,0,0,0.125)",children:[h.jsx(je,{variant:"overline",children:"Total: "}),h.jsx("span",{style:{fontWeight:700}
72,children:e.femaleScore+e.maleScore+e.nonbinaryScore+e.unknownScore})]}),h.jsxs(z,{borderTop:"1px solid rgba(0,0,0,0.125)",children:[((p=e.malePeople)==null?void 0:p.length)>0&&h.jsxs(z,{my:.5,children:[h.jsx(je,{variant:"overline",children:"Male persons:"}),h.jsx(z,{mt:-.5,fontSize:"80%",fontWeight:700,children:(x=e.malePeople)==null?void 0:x.join(", ")})]}),((f=e.femalePeople)==null?void 0:f.length)>0&&h.jsxs(z,{my:.5,children:[h.jsx(je,{variant:"overline",children:"Female persons:"}),h.jsx(z,{mt:-.5,fontSize:"80%",fontWeight:700,children:(m=e.femalePeople)==null?void 0:m.join(", ")})]}),((y=e.nonbinaryPeople)==null?void 0:y.length)>0&&h.jsxs(z,{my:.5,children:[h.jsx(je,{variant:"overline",children:"Non-binary persons:"}),h.jsx(z,{mt:-.5,fontSize:"80%",fontWeight:700,children:(E=e.nonbinaryPeople)==null?void 0:E.join(", ")})]}),((w=e.unknownPeople)==null?void 0:w.length)>0&&h.jsxs(z,{my:.5,children:[h.jsx(je,{variant:"overline",children:"Unknown persons:"}),h.jsx(z,{mt:-.5,fontSize:"80%",fontWeight:700,children:(S=e.unknownPeople)==null?void 0:S.join(", ")})]})]})]})]})},c0=Vl(r=>Ql({root:{width:"100%"},cardBody:{padding:"8px"},imageFrame:{width:"100%",maxWidth:"100%",maxHeight:"100%",backgroundColor:"#e8eef2",color:"#000",borderRadius:"0.25rem"},previewImg:{maxWidth:"100%",maxHeight:"100%",height:255},captionContent:{maxWidth:"100%",padding:"0px 4px",maxHeight:90,overflow:"auto",backgroundColor:"#fff"},minifiedImg:{maxWidth:"100%",height:"100%",transition:"all ease-out 100ms","&:hover":{opacity:.5}},img:{display:"block",maxWidth:"100%",maxHeight:"100%",borderRadius:"0.25rem"},selectedMinImg:{opacity:.5},leftCol:{maxHeight:"350px",height:"fit-content"},rightCol:{height:"350px",overflowX:"hidden",overflowY:"auto"}})),u0=()=>{const r=c0(),{entities:e,topics:t,categories:n,getImages:s}=k.useContext(ur),[i,l]=k.useState([]),[o,c]=k.useState(void 0),[d,p]=k.useState(!1),x=()=>{const f=[...e,...t,...n];p(!0),s({variables:{tags:f}}).then(m=>{var y,E;(E=(y=m==null?void 0:m.data)==null?void 0:y.getImages)!=null&&E.data&&(l(m.data.getImages.data),c(m.data.getImages.data[0]||null))}).catch(m=>{console.error("Failed to fetch images: ",m.message),c(null),l([])}).finally(()=>p(!1))};return k.useEffect(()=>{if((e==null?void 0:e.length)>0){x();return}c(null),l([])},[e,t,n]),h.jsx(z,{className:r.root,children:h.jsxs(Ac,{variant:"outlined",children:[h.jsx(z,{className:"card-header",padding:"5.5px 8.8px",children:h.jsx(z,{display:"flex",alignItems:"center",justifyContent:"space-between",children:h.jsxs(z,{display:"flex",alignItems:"center",children:[h.jsx(Tc,{className:"mr-2",style:{fontSize:"1.7em"}}),h.jsx(z,{fontSize:"1.25em",children:"Smart image suggestions"}),d&&h.jsx(Zl,{size:"1rem",style:{marginLeft:"1em"}})]})})}),h.jsx(z,{className:r.cardBody,children:i.length>0&&h.jsxs(_e,{container:!0,direction:"row",spacing:1,children:[h.jsx(_e,{container:!0,size:9,direction:"column",className:r.leftCol,children:o&&h.jsxs(_e,{justifyContent:"center",container:!0,size:12,direction:"row",children:[h.jsx(z,{display:"flex",justifyContent:"center",className:`${r.imageFrame}`,children:h.jsx("img",{className:`${r.img} ${r.previewImg}`,alt:o.credit,src:o.imageUrl})}),h.jsx(z,{className:r.captionContent,textAlign:"center",children:h.jsx(je,{component:"span",variant:"caption",children:o.caption})})]})}),h.jsx(_e,{size:3,className:r.rightCol,children:h.jsx(_e,{container:!0,direction:"row",spacing:1,children:(i==null?void 0:i.length)>0&&i.map((f,m)=>h.jsx(_e,{size:12,children:h.jsx(Cc,{className:`${r.imageFrame} ${r.minifiedImg} ${o&&o.thumbnailUrl===f.thumbnailUrl?r.selectedMinImg:""}`,onClick:()=>c(f),children:h.jsx("img",{className:r.img,alt:f.thumbnailUrl,src:f.thumbnailUrl})})},m))})})]})})]})})},h0=r=>{const{disabled:e,tagQueueArticle:t,tagQueueProps:n={},tagQueueArticleCallback:s}=r;return h.jsx(De,{arrow:!0,disableInteractive:!0,title:"Mark article as finished without any tags",enterDelay:500,children:h.jsx("span",{children:h.jsxs(vt,{disabled:e,variant:"contained",color:"secondary",onClick:()=>{t&&t({variables:{query:{finished:!0,concepts:[],customQueue:!1,queueName:void 0,queueNr:void 0,...n}}}).then(i=>{s&&s(i)})}
72,sx:{gap:.5},children:[h.jsx(Sc,{}),"Skip"]})})})},d0=r=>{const{stopDemo:e,disabled:t}=r,n=k.useRef(null),{demoArticles:s,selectedDemoArticle:i,setSelectedDemoArticle:l,isPlaying:o,setIsPlaying:c}=k.useContext(ur),[d,p]=k.useState(!1),[x,f]=k.useState(void 0);k.useEffect(()=>{s&&s.length>0&&(l(s[0]),f(0))},[s]);const m=()=>{c(!0)},y=(S,I)=>{f(I),l(s[I]),p(!1)},E=()=>{p(S=>!S)},w=()=>{p(!1)};return h.jsxs(z,{component:"span",sx:{whiteSpace:"nowrap"},children:[h.jsxs(Lc,{disabled:t||!i,disableElevation:t||!i,variant:"contained",ref:n,"aria-label":"demo button",children:[o?h.jsx(De,{arrow:!0,placement:"top",title:"Stop demo",enterDelay:500,children:h.jsx("span",{children:h.jsxs(vt,{color:"secondary",onClick:e,sx:{width:"140px",gap:.5,overflow:"hidden",borderRight:"0 !important"},children:[h.jsx(qc,{}),"Stop demo"]})})}):h.jsx(De,{arrow:!0,placement:"top",title:h.jsxs("span",{children:["Demo: ",h.jsx("b",{children:i==null?void 0:i.headline})]}),enterDelay:500,children:h.jsx("span",{children:h.jsxs(vt,{color:"success",onClick:m,sx:{width:"140px",gap:.5,overflow:"hidden",borderRight:"0 !important"},children:[h.jsx(Oc,{}),`Play demo${i&&x||x===0?` ${x+1}`:""}`]})})}),h.jsx(De,{arrow:!0,placement:"top",title:"Select demo article",enterDelay:500,children:h.jsx("span",{children:h.jsx(vt,{disabled:o,color:"success","aria-controls":d?"demo-articles-button-menu":void 0,"aria-expanded":d?"true":void 0,"aria-label":"select demo article","aria-haspopup":"menu",onClick:E,sx:{px:0},children:h.jsx(Lr,{})})})})]}),h.jsx(jc,{open:d,anchorEl:n.current,role:void 0,transition:!0,disablePortal:!0,placement:"bottom-end",sx:{zIndex:1},children:({TransitionProps:S,placement:I})=>h.jsx(Ic,{...S,style:{transformOrigin:I==="bottom"?"center top":"center bottom"},children:h.jsx(sn,{children:h.jsx(kc,{onClickAway:w,children:h.jsx(_c,{id:"demo-articles-button-menu",dense:!0,disablePadding:!0,sx:{minWidth:"180px",maxWidth:"270px"},children:s.map((M,H)=>h.jsx(De,{title:M.headline,placement:"right",arrow:!0,children:h.jsx(Yl,{selected:H===x,onClick:L=>y(L,H),sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:h.jsx(Rc,{primary:`${H+1+". "+M.altHeadline}`||`Demo article ${H+1}`,secondary:M.headline,primaryTypographyProps:{fontWeight:700},secondaryTypographyProps:{textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"}})})},H))})})})})})]})},Pi=r=>{const{value:e,onChange:t,options:n}=r;return h.jsx(Or,{name:"max-input",autoComplete:"off",select:!0,label:"Max",size:"small",variant:"outlined",style:{margin:"0 8px",width:"5rem"},InputProps:{style:{fontWeight:700,maxHeight:"1.8rem"}},InputLabelProps:{shrink:!0},value:e,onChange:t,children:n.map(s=>h.jsx(Yl,{value:s.value,children:s.label},s.value))})},f0=Fc({content:{m:0},root:{minHeight:36,maxHeight:36,"&.Mui-expanded":{minHeight:36,maxHeight:36}},expandIcon:{order:-1}})(Uc),$i=r=>{const{children:e,value:t,index:n,...s}=r;return h.jsx(z,{hidden:t!==n,...s,children:t===n&&h.jsx(z,{sx:{pt:3,px:2},children:e})})},p0=()=>{const{tagSettings:r,setTagSettings:e,articleFormat:t,setArticleFormat:n}=k.useContext(ur),[s,i]=k.useState(0),[l,o]=k.useState(!1),c=(L,P)=>{i(P)},[d,p]=k.useState([{id:"categoryFilterVariable",label:"Category filter variable",value:-1},{id:"topicFilterVariable",label:"Topic filter variable",value:-1},{id:"personFilterVariable",label:"Person filter variable",value:-1},{id:"placeFilterVariable",label:"Place filter variable",value:-1},{id:"organisationFilterVariable",label:"Organisation filter variable",value:-1},{id:"eventFilterVariable",label:"Event filter variable",value:-1},{id:"objectFilterVariable",label:"Object filter variable",value:-1}]),[x,f]=k.useState(0),[m,y]=k.useState([{id:"personLimit",label:"Person limit",value:-1},{id:"placeLimit",label:"Place limit",value:-1},{id:"organisationLimit",label:"Organisation limit",value:-1},{id:"eventLimit",label:"Event limit",value:-1},{id:"objectLimit",label:"Object limit",value:-1}]),[E,w]=k.useState([{id:"entityWeightHeadlineModifier",label:"Headline weight modifier",value:-1},{id:"entityWeightPreambleModifier",label:"Preamble weight modifier",value:-1},{id:"entityWeightBodyModifier",label:"Body weight modifier",value:-1},{id:"entityWeightDatelineModifier",label:"Dateline weight modifier",value:-1},{id:"entityWeightImageTextModifier",label:"Image text weight modifier",value:-1}]),S=L=>{let P=0;for(const W of Object.values(L))W!==-1&&P++;f(P)},I=()=>{let L={...r},P=[...m],W=[...d],re=[...E];m.forEach((fe,F)=>{L[fe.id]=-1,P[F].value=-1}),d.forEach((fe,F)=>{L[fe.id]=-1,W[F].value=-1}
72),E.forEach((fe,F)=>{L[fe.id]=-1,re[F].value=-1}),y(P),p(W),w(re),e(L),S(L)},M=L=>{L.stopPropagation(),I()},H=()=>{let L={...r};m.forEach(P=>{L[P.id]=P.value}),d.forEach(P=>{L[P.id]=P.value}),E.forEach(P=>{L[P.id]=P.value}),e(L),S(L)};return h.jsxs(Mc,{expanded:l,sx:{width:"100%"},children:[h.jsx(f0,{expandIcon:h.jsx(Lr,{color:"primary"}),sx:{px:.5},children:h.jsxs(z,{sx:{width:"100%",display:"flex",justifyContent:"space-between",alignItems:"center",gap:2},children:[h.jsx(De,{title:"Set article format sent to server. If checked, the format will be in JSON, otherwise clean text. You can only modify the advanced settings in JSON format.",placement:"top",children:h.jsxs(z,{component:"span",sx:{whiteSpace:"nowrap"},children:[h.jsx(Bc,{checked:t==="json",onClick:L=>{L.stopPropagation()},onChange:L=>{const P=L.target.checked?"json":void 0;n(P),e({...r,articleFormat:P})}}),h.jsx(je,{component:"span",variant:"overline",sx:{fontWeight:700},children:"JSON"})]})}),h.jsxs(je,{component:"span",variant:"button",color:"primary",onClick:()=>{o(L=>!L)},sx:{display:"flex",pr:.5,textAlign:"right",fontWeight:700,alignItems:"center",gap:1},children:[t==="json"&&x>0&&h.jsx(Xl,{label:x+(x===1?" active filter":" active filters"),color:"success",variant:"filled",size:"small",onDelete:M}),h.jsxs(z,{sx:{display:"flex",alignItems:"center",gap:.5},children:[h.jsx(Dc,{fontSize:"small"}),"Advanced settings"]})]})]})}),h.jsxs(Pc,{sx:t!=="json"?{bgcolor:"rgba(0,0,0,0.125)",opacity:.75}:void 0,children:[h.jsxs(z,{sx:{width:"100%"},children:[h.jsx(z,{sx:{borderBottom:1,borderColor:"divider",mx:-2},children:h.jsxs($c,{value:s,variant:"scrollable",scrollButtons:"auto",onChange:c,children:[h.jsx(di,{label:"Filter variables",sx:{py:0,px:2}}),h.jsx(di,{label:"Entity type limits",sx:{py:0,px:2}}),h.jsx(di,{label:"Entity weight modifiers",sx:{py:0,px:2}})]})}),h.jsx($i,{value:s,index:0,children:h.jsxs(_e,{container:!0,spacing:2,children:[h.jsx(_e,{size:5,children:d.map((L,P)=>h.jsxs(z,{sx:{display:"flex",alignItems:"center",mb:2},children:[h.jsx(Or,{autoComplete:"off",disabled:t!=="json",type:"number",id:L.id,variant:"outlined",size:"small",fullWidth:!0,value:L.value!==-1?L.value:"",label:L.label,InputLabelProps:{shrink:!0},onChange:W=>{let re=[...d];W.target.value===""||W.target.valueAsNumber<=-1?(re[P].value=-1,p(re)):(re[P].value=W.target.valueAsNumber,p(re))}}),h.jsx(fi,{onClick:()=>{let W=[...d];W[P].value=-1,p(W)},sx:{cursor:"pointer",ml:.5,visibility:L.value!==-1?"visible":"hidden"}})]},L.id))}),h.jsx(_e,{size:7,children:h.jsxs(xs,{severity:"info",children:[h.jsx(pi,{sx:{fontWeight:700},children:"Filter variables"}),h.jsx(je,{variant:"body2",children:"You can use filter variables for tweaking how many entities of each type that will be returned based on the score of the top entity. You can set these to nothing, or a positive number."})]})})]})}),h.jsx($i,{value:s,index:1,children:h.jsxs(_e,{container:!0,spacing:2,children:[h.jsx(_e,{size:5,children:m.map((L,P)=>h.jsxs(z,{sx:{display:"flex",alignItems:"center",mb:2},children:[h.jsx(Or,{autoComplete:"off",disabled:t!=="json",type:"number",id:L.id,variant:"outlined",size:"small",fullWidth:!0,value:L.value!==-1?L.value:"",label:L.label,InputLabelProps:{shrink:!0},onChange:W=>{let re=[...m];W.target.value===""||W.target.valueAsNumber<=-1?(re[P].value=-1,y(re)):(re[P].value=W.target.valueAsNumber,y(re))}}),h.jsx(fi,{onClick:()=>{let W=[...m];W[P].value=-1,y(W)},sx:{cursor:"pointer",ml:.5,visibility:L.value!==-1?"visible":"hidden"}})]},L.id))}),h.jsx(_e,{size:7,children:h.jsxs(xs,{severity:"info",children:[h.jsx(pi,{sx:{fontWeight:700},children:"Entity type limits"}),h.jsx(je,{variant:"body2",children:"You can use entity type limits for tweaking the maximum amount of entities of each type that will be returned. You can set these to nothing, or a positive number."})]})})]})}),h.jsx($i,{value:s,index:2,children:h.jsxs(_e,{container:!0,spacing:2,children:[h.jsxs(_e,{size:5,children:[E.map((L,P)=>h.jsx(z,{sx:{display:"flex",alignItems:"center",mb:2},children:h.jsx(Or,{autoComplete:"off",disabled:t!=="json",type:"number",id:L.id,variant:"outlined",size:"small",fullWidth:!0,value:L.value!==-1?L.value:"",label:L.label,InputLabelProps:{shrink:!0},onChange:W=>{let re=[...E];W.target.valueAsNumber<=-1?(re.forEach(fe=>{fe.value>-1&&(fe.value=-1)}),re[P].value=-1):(re.forEach(fe=>{fe.value<0&&(fe.value=1)}),re[P].value=W.target.valueAsNumber),w(re)}})},L.id)),h.jsxs(vt,{variant:"outlined",size:"small",color:"secondary",onClick:()=>{let L=[...E];
72E.forEach((P,W)=>{L[W].value=-1}),w(L)},children:[h.jsx(fi,{sx:{mr:.5}}),"Clear modifiers"]})]}),h.jsx(_e,{size:7,children:h.jsxs(xs,{severity:"info",children:[h.jsx(pi,{sx:{fontWeight:700},children:"Entity weight modifiers"}),h.jsx(je,{variant:"body2",children:"You can use weight modifiers for tweaking the score on each entity based on in which part of the article it is mentioned. Each mention gets the score of the corresponding modifier. If you set one of these variables to a number, all the others will default to 1."})]})})]})})]}),h.jsx(z,{sx:{display:"flex",justifyContent:"end",p:2},children:h.jsx(vt,{variant:"contained",size:"small",onClick:H,children:"Apply filters"})})]})]})},g0=Vc(({className:r,...e})=>h.jsx(De,{...e,classes:{popper:r}}))({[`& .${Qc.tooltip}`]:{maxWidth:500,maxHeight:"400px"}}),P0=r=>{const{tagQualityAssurance:e}=r,{activeEndpoint:t,prevEndpoint:n,showImageDisplayer:s,setShowSnackbar:i,setSnackbarMessage:l,setSnackbarError:o}=k.useContext(Jl),[c,d]=k.useState(!1),[p,x]=k.useState(""),[f,m]=k.useState({}),[y,E]=k.useState(void 0),[w,S]=k.useState(void 0),[I,M]=k.useState(void 0),[H,L]=k.useState([]),[P,W]=k.useState(!1),[re,fe]=k.useState(""),[F,g]=k.useState({customQueue:!1,queueName:void 0,queueNr:void 0,articleUuid:"",articleFinished:void 0}),[A]=as(tu),[v,{data:j}]=Pa(lu,{fetchPolicy:"no-cache"}),[O,{loading:T,data:q,error:B}]=Pa(iu,{fetchPolicy:"network-only"}),[D,{loading:_,error:Z}]=as(au),[Y,{loading:te}]=as(ou),[X]=as(ph),R={uuid:"",title:"",type:"person",shortDescription:"",longDescription:"",aliases:[],broader:""},pe={uuid:"",title:"",type:"topic",shortDescription:"",longDescription:"",broader:""},oe=400,ee=k.useMemo(()=>{if(t)return t.settingsName??t.settings_name},[t]),ue=k.useMemo(()=>{var Ae,St;if(!(j!=null&&j.getCustomerSettings)||!ee)return!1;let K=[];try{K=JSON.parse(j.getCustomerSettings)}catch{return!1}if(!Array.isArray(K))return!1;const ne=K.find(Lt=>String(Lt.settings_name)===String(ee));if(!ne)return!1;const Oe=(Ae=ne==null?void 0:ne.deploy_environment_variables)==null?void 0:Ae.ENABLE_ENTITY_CACHE,be=(St=ne==null?void 0:ne.local_environment_variables)==null?void 0:St.ENABLE_ENTITY_CACHE;return!!(Oe??be)},[j,ee]),de=ss.hasAuthority([is.CONCEPT_MANAGEMENT])&&ue,{categories:se,setCategories:ie,topics:ce,setTopics:Ne,entities:xe,setEntities:Ze,editorText:tt,setEditorText:Re,textEditor:Te,tagError:Pe,setTagError:Me,tagSettings:Ce,setTagSettings:Ye,articleFormat:Be,formatTag:ge,clearTags:He,setTagQualityAssurance:we,isPlaying:le,setIsPlaying:ze,taggingTimeout:Ge,hideCategories:Zt,setHideCategories:mn,hideTopics:bn,setHideTopics:Yt,hideEntities:Ct,setHideEntities:yn,addConcept:Xt,deleteCategory:Pt,deleteTopic:nt,deleteEntity:Jt,editConceptModalShow:vn,setEditConceptModalShow:it,createTopicModalShow:xn,setCreateTopicModalShow:$t,createConceptModalShow:En,setCreateConceptModalShow:wn,selectedDemoArticle:at,channels:rt,setChannels:en}=k.useContext(ur);k.useEffect(()=>{ee&&ss.hasAuthority([is.CONCEPT_MANAGEMENT])&&v({variables:{settingNames:[ee]}})},[v,ee]);const pt=()=>{Y().then(()=>{i(!0),l("Entity cache cleared"),o(!1)}).catch(K=>{i(!0),l(K.message||"Failed to clear entity cache"),o(!0)})};k.useEffect(()=>{if(!(q!=null&&q.getQueueArticle))return;const K=q.getQueueArticle;g(Ae=>({...Ae,queueNr:K.queueNr,articleUuid:K.uuid,article:K,articleFinished:K.finished}));let ne=[],Oe=[],be=[];K!=null&&K.concepts&&K.concepts.length>
720&&K.concepts.forEach(Ae=>{Ae.type==="category"||Ae.type==="x-im/category"?ne=[...ne,ge(Ae)]:Ae.type==="topic"||Ae.type==="x-im/topic"?Oe=[...Oe,ge(Ae)]:be=[...be,ge(Ae)]}),JSON.stringify(ne)!==JSON.stringify(se)&&ie(ne),JSON.stringify(Oe)!==JSON.stringify(ce)&&Ne(Oe),JSON.stringify(be)!==JSON.stringify(xe)&&Ze(be)},[se,xe,q,ie,Ze,Ne,ce]),k.useEffect(()=>{B&&(g(K=>({...K,queueNr:void 0,articleUuid:void 0,article:void 0,articleFinished:void 0})),Me({error:!0,message:(B==null?void 0:B.message)??"Failed to fetch article, please contact iMatrics"}))},[B,Me]),k.useEffect(()=>{Z&&Me({error:!0,message:(Z==null?void 0:Z.message)??"Failed to update article, please contact iMatrics"})},[Z,Me]),k.useEffect(()=>{we(e)},[]),k.useEffect(()=>{(t==null?void 0:t.url)!==(n==null?void 0:n.url)&&(He(),le||Te==null||Te.onEditorChange(tt,void 0,100,{...Ce},{channels:rt}),e&&(Re(""),Bn(),g({...F,queueNr:void 0,articleUuid:void 0,article:void 0,articleFinished:void 0}),He()),Pe.error&&Me({error:!1,message:""}))},[t]),k.useEffect(()=>{le||Te==null||Te.onEditorChange(tt,null,100,{...Ce},{channels:rt}),Pe.error&&Me({error:!1,message:""})},[Ce,rt]),k.useEffect(()=>{Zt?$("#categories").slideUp(oe):$("#categories").slideDown(oe),bn?$("#topics").slideUp(oe):$("#topics").slideDown(oe),Ct?$("#entities").slideUp(oe):$("#entities").slideDown(oe)},[Zt,bn,Ct]),k.useEffect(()=>{const K=(at==null?void 0:at.headline)||"",ne=(at==null?void 0:at.body)||[];if(le){He();let Oe=0,be=0,Ae=0,St,Lt,Pn,lt="";return clearTimeout(Ge.current),Lt=setInterval(()=>{K&&Oe!==K.length?(Re("<h1>"+K.substring(0,Oe)+"</h1>"),Oe++):(lt="<h1>"+K+"</h1>",Re(lt),Te==null||Te.onEditorChange(lt,null,10),clearInterval(Lt),Pn=setTimeout(()=>{St=setInterval(()=>{var $e,$n,Fn;if(ne!=null&&ne.length&&Ae>ne.length-1)ze(!1),clearInterval(St);else if((ne==null?void 0:ne.length)!==0&&(($e=ne[Ae])==null?void 0:$e.length)>0&&be<=(($n=ne[Ae])==null?void 0:$n.length)){if(be===((Fn=ne[Ae])==null?void 0:Fn.length)){lt=lt+"<p>"+ne[Ae]+"</p>",Re(lt),Te==null||Te.onEditorChange(lt,null,10),Ae++,be=0;return}Re(lt+"<p>"+ne[Ae].substring(0,be)+"</p>"),be++}},15)},1e3))},40),()=>{clearInterval(Lt),clearInterval(St),clearTimeout(Pn)}}},[le]);const Bn=()=>{clearTimeout(Ge.current),ze(!1),Re(""),He(),Te==null||Te.focus()},dr=()=>{clearTimeout(Ge.current),ze(!1),Re(""),en([]),He(),Te==null||Te.focus()},fr=h.jsx("form",{autoComplete:"off",onSubmit:K=>{K.preventDefault(),fe(""),p&&(W(!0),X({variables:{searchString:p,returnSize:20}}).then(ne=>{var Oe;(Oe=ne==null?void 0:ne.data)!=null&&Oe.searchArticlesMutation&&L(ne.data.searchArticlesMutation)}).catch(ne=>{L([])}).finally(()=>{fe(p),W(!1)}))},style:{display:"inline-block",width:"50%",padding:"0 1rem"},children:h.jsx(Or,{autoComplete:"off",autoFocus:!0,fullWidth:!0,value:p,label:"Search article",type:"text",variant:"filled",size:"small",InputLabelProps:{shrink:!0,sx:{fontWeight:700}},onChange:K=>x(K.target.value),InputProps:{endAdornment:h.jsx(Wc,{position:"end",children:h.jsx(De,{title:"Search articles",placement:"top",arrow:!0,disableInteractive:!0,enterDelay:500,children:h.jsx(nn,{type:"submit",edge:"end",children:h.jsx(Da,{})})})})}})}),Dn=()=>h.jsxs(z,{children:[h.jsxs(sn,{sx:{mb:2,width:"100%",zIndex:5},children:[h.jsxs(z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",py:.5,px:1,bgcolor:"#f5f5f5"},children:[h.jsxs(z,{sx:{display:"flex",alignItems:"center",fontWeight:700},children:[h.jsx(Xc,{sx:{mr:1}}),"Categories ",se.length>0&&`(${se.length})`]}),!e&&h.jsxs(z,{sx:{display:"flex",alignItems:"center"},children:[h.jsx(Pi,{value:Ce.categories===-1||!Number.isInteger(Ce.categories)?"":Ce.categories,onChange:K=>{Ye({...Ce,categories:parseInt(K.target.value)})},options:[{label:"Default",value:-1},{label:"0",value:0},{label:"1",value:1},{label:"2",value:2},{label:"3",value:3},{label:"4",value:4},{label:"5",value:5}]}),Zt?h.jsx(De,{title:"Show categories",placement:"top",arrow:!0,disableInteractive:!0,enterDelay:500,children:h.jsx(nn,{size:"small",onClick:()=>{mn(!1)},sx:{float:"right"},children:h.jsx(Lr,{})})}):h.jsx(De,{title:"Hide categories",placement:"top",arrow:!0,disableInteractive:!0,enterDelay:500,children:h.jsx(nn,{size:"small",onClick:()=>{mn(!0)},sx:{float:"right"},children:h.jsx(gi,{})})}),h.jsx(mi,{type:"category"})]})]}),h.jsxs(z,{id:"categories",sx:{p:1},children:[h.jsx(bi,{tags:se,getConcept:A,deleteTag:Pt,setChosenConcept:m,setEditConceptModalShow:it,type:"category",isEntity:!1,tagQualityAssurance:e,tagQueueArticle:D,tagQueueProps:{customQueue:F.customQueue,queueName:F.queueName,queueNr:F.queueNr,finished:!1}}),h.jsx(yi,{type:"category",tagQualityAssurance:e,tagQueueArticle:D,tagQueueProps:{customQueue:F.customQueue,queueName:F.queueName,queueNr:F.queueNr,finished:!1}})]})]}),h.jsxs(sn,{sx:{mb:2,width:"100%",zIndex:4},children:[h.jsxs(z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",py:.5,px:1.5,bgcolor:"#f5f5f5"},children:[h.jsxs(z,{sx:{display:"flex",alignItems:"center",fontWeight:700},children:[h.jsx(Jc,{sx:{mr:1}}),"Topics ",ce.length>0&&`(${ce.length})`]}),!e&&h.jsxs(z,{sx:{display:"flex",alignItems:"center"},children:[h.jsx(Pi,{value:Ce.topics===-1||!Number.isInteger(Ce.topics)?"":Ce.topics,onChange:K=>{Ye({...Ce,topics:parseInt(K.target.value)})},options:[{label:"Default",value:-1},{label:"0",value:0},{label:"1",value:1},{label:"2",value:2},{label:"3",value:3},{label:"4",value:4},{label:"5",value:5},{label:"6",value:6},{label:"7",value:7},{label:"8",value:8},{label:"9",value:9},{label:"10",value:10}]}),bn?h.jsx(De,{title:"Show topics",placement:"top",arrow:!0,disableInteractive:!0,enterDelay:500,children:h.jsx(nn,{size:"small",onClick:()=>{Yt(!1)},sx:{float:"right"},children:h.jsx(Lr,{})})}):h.jsx(De,{title:"Hide topics",placement:"top",arrow:!0,disableInteractive:!0,enterDelay:500,children:h.jsx(nn,{size:"small",onClick:()=>{Yt(!0)},sx:{float:"right"},children:h.jsx(gi,{})})}),h.jsx(mi,{type:"topic"})]})]}),h.jsxs(z,{id:"topics",sx:{p:1},children:[h.jsx(bi,{tags:ce,getConcept:A,deleteTag:nt,setChosenConcept:m,setEditConceptModalShow:it,type:"topic",isEntity:!1,tagQualityAssurance:e,tagQueueArticle:D,tagQueueProps:{customQueue:F.customQueue,queueName:F.queueName,queueNr:F.queueNr,finished:!1}}),h.jsx(yi,{type:"topic",tagQualityAssurance:e,tagQueueArticle:D,tagQueueProps:{customQueue:F.customQueue,queueName:F.queueName,queueNr:F.queueNr,finished:!1}})]})]}),h.jsxs(sn,{sx:{width:"100%",zIndex:3},children:[h.jsxs(z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",py:.5,px:1.5,bgcolor:"#f5f5f5"},children:[h.jsxs(z,{sx:{display:"flex",alignItems:"center",fontWeight:700},children:[h.jsx(eu,{sx:{mr:1}}),"Entities ",xe.length>0&&`(${xe.length})`]}),!e&&h.jsxs(z,{sx:{display:"flex",alignItems:"center"},children:[h.jsx(Pi,{value:Ce.entities===-1||!Number.isInteger(Ce.entities)?"":Ce.entities,onChange:K=>{Ye({...Ce,entities:parseInt(K.target.value)})},options:[{label:"Default",value:-1},{label:"0",value:0},{label:"5",value:5},{label:"10",value:10},{label:"15",value:15},{label:"25",value:25},{label:"50",value:50},{label:"100",value:100}]}),Ct?h.jsx(De,{title:"Show entities",placement:"top",arrow:!0,disableInteractive:!0,enterDelay:500,children:h.jsx(nn,{size:"small",onClick:()=>{yn(!1)}
72,sx:{float:"right"},children:h.jsx(Lr,{})})}):h.jsx(De,{title:"Hide entities",placement:"top",arrow:!0,disableInteractive:!0,enterDelay:500,children:h.jsx(nn,{size:"small",onClick:()=>{yn(!0)},sx:{float:"right"},children:h.jsx(gi,{})})}),h.jsx(mi,{type:"entity"})]})]}),h.jsxs(z,{id:"entities",sx:{p:1},children:[h.jsx(bi,{tags:xe,getConcept:A,deleteTag:Jt,setChosenConcept:m,setEditConceptModalShow:it,type:"entity",isEntity:!0,tagQualityAssurance:e,tagQueueArticle:D,tagQueueProps:{customQueue:F.customQueue,queueName:F.queueName,queueNr:F.queueNr,finished:!1}}),h.jsx(yi,{type:"entity",tagQualityAssurance:e,tagQueueArticle:D,tagQueueProps:{customQueue:F.customQueue,queueName:F.queueName,queueNr:F.queueNr,finished:!1}})]})]})]}),Nn=()=>h.jsx(De,{arrow:!0,disableInteractive:!0,title:"Fetch the next unassigned article from the queue",enterDelay:500,children:h.jsx("span",{children:h.jsxs(vt,{disabled:T||F.articleFinished===!1,variant:"contained",color:"primary",onClick:()=>{Me({error:!1,message:""}),O({fetchPolicy:"network-only",variables:{query:{customQueue:F.customQueue,queueName:F.queueName}}})}
72,sx:{gap:.5,alignItems:"center"},children:[T?h.jsx(Zl,{size:"23px",sx:{p:"4px"}}):h.jsx(Zc,{}),"Fetch article"]})})}),Ie=h.jsxs(z,{children:[h.jsxs(vt,{variant:"contained",color:"warning",onClick:()=>{d(!0)},sx:{mr:2,gap:.5},children:[h.jsx(Da,{}),"Search article"]}),h.jsxs(ft,{id:"modal",size:"xl",show:c,animation:!1,onHide:()=>d(!1),children:[h.jsxs(ft.Header,{children:[h.jsx(je,{variant:"h5",children:"Search articles"}),h.jsx(nn,{onClick:()=>{d(!1)},sx:{position:"absolute",right:12,top:12},children:h.jsx(Hc,{})})]}),h.jsxs(ft.Body,{style:{padding:0,minHeight:"33vh"},children:[h.jsxs(z,{sx:{display:"flex",width:"100%"},children:[fr,re&&h.jsxs(je,{sx:{display:"flex",alignItems:"center"},children:[`${H==null?void 0:H.length}`," results found for ",h.jsx("b",{children:`${re}`})]})]}),h.jsxs(z,{sx:{position:"relative"},children:[h.jsx(Fi,{color:"primary",variant:P?"indeterminate":"determinate",value:0,sx:{position:"absolute",top:"0",left:"0",width:"100%",visibility:P?"visible":"hidden",zIndex:1}}),h.jsxs(fh,{striped:!0,bordered:!0,hover:!0,style:{margin:0},children:[h.jsx("thead",{children:h.jsxs("tr",{children:[h.jsx("th",{style:{width:"25%"},children:"Title"}),h.jsx("th",{style:{width:"40%"},children:"Preamble"}),h.jsx("th",{style:{width:"35%"},children:"Tags"})]})}),h.jsx("tbody",{children:(H==null?void 0:H.length)>0&&H.map(K=>{var ne;return h.jsx(k.Fragment,{children:h.jsx(g0,{arrow:!0,placement:"bottom",disableInteractive:!0,enterDelay:500,title:h.jsxs(z,{children:[h.jsx(z,{sx:{borderBottom:"1px solid rgba(255,255,255,0.4)",pb:.2,mb:.4},children:K.uuid}),h.jsx("b",{children:K.headline}),h.jsx(z,{children:K.body.join(" ")!==null?h.jsx("span",{children:K.body.join(" ")}):h.jsx("span",{style:{color:"red"},children:"No article found"})})]}),children:h.jsxs("tr",{className:"article-table-row",onClick:()=>{Re("<h1>"+K.headline+"</h1><h2>"+K.preamble+"</h2><p>"+K.body.join(" ")+"</p>"),en(Oe=>[...Oe,...K.channels]),d(!1)},children:[h.jsx("td",{children:h.jsx("span",{className:"font-weight-bold",children:K.headline})}),h.jsx("td",{children:h.jsx("span",{children:K.preamble===" "||K.preamble===""?K.body[0]:K.preamble})}),h.jsx("td",{children:(ne=K.concepts)==null?void 0:ne.map(Oe=>h.jsx(Xl,{label:Oe.title,variant:"outlined",color:"primary",size:"small",sx:{mr:.5,mb:.5}},Oe.uuid))})]})})},K.uuid)})})]})]})]})]})]}),pr=()=>h.jsx(De,{arrow:!0,disableInteractive:!0,title:"Mark article as finished with the specified tags",enterDelay:500,children:h.jsx("span",{children:h.jsxs(vt,{disabled:T||_||!F.article||F.articleFinished,variant:"contained",color:"success",onClick:()=>{e&&ss.hasAuthority([is.QUEUE])&&D({variables:{query:{finished:!0,concepts:[...se,...ce,...xe],customQueue:F.customQueue,queueName:F.queueName,queueNr:F.queueNr}}}).then(()=>{g(K=>({...K,queueNr:void 0,articleUuid:void 0,article:void 0,articleFinished:void 0})),He()})}
72,sx:{gap:.5},children:[h.jsx(Yc,{}),"Done"]})})}),gr=h.jsxs(z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",p:1.5,gap:1,borderBottom:"1px solid rgba(0,0,0,0.125)"},children:[h.jsx(z,{sx:{display:"flex",gap:1},children:e?h.jsxs(k.Fragment,{children:[h.jsx(Nn,{}),h.jsx(pr,{}),h.jsx(h0,{disabled:T||_||!F.article||F.articleFinished,tagQueueArticle:D,tagQueueProps:{customQueue:F.customQueue,queueName:F.queueName,queueNr:F.queueNr},tagQueueArticleCallback:K=>{g({...F,queueNr:void 0,articleUuid:void 0,article:void 0,articleFinished:void 0}),He()}}),h.jsx(ru,{userQueueData:F}),h.jsx(De,{arrow:!0,disableInteractive:!1,title:h.jsxs("span",{children:[h.jsxs("div",{children:["Current queue number:"," ",h.jsx("b",{children:F.queueNr??"N/A"})]}),h.jsxs("div",{children:["Current article UUID:"," ",h.jsx("b",{children:F.articleUuid??"N/A"})]})]}),enterDelay:500,children:h.jsxs(sn,{sx:{display:"flex",alignItems:"center",p:1,maxWidth:160,maxHeight:33,overflow:"hidden",whiteSpace:"nowrap",cursor:"pointer",gap:.5},children:[h.jsxs(je,{variant:"overline",sx:{lineHeight:1,display:"flex",gap:.5},children:["Current:",h.jsx("b",{children:F.queueNr??"N/A"})]}),F.queueName&&h.jsx(zc,{color:F.articleFinished?"success":"disabled"})]})})]}):h.jsxs(k.Fragment,{children:[(t==null?void 0:t.isDemoEnvironment)&&h.jsx(d0,{stopDemo:Bn}),h.jsxs(vt,{variant:"contained",onClick:dr,sx:{gap:.5},children:[h.jsx(Gc,{}),"Clear all"]}),!(t!=null&&t.isDemoEnvironment)&&Ie]})}),h.jsxs(z,{sx:{display:"flex",alignItems:"center",gap:1},children:[de&&h.jsx(De,{title:"Clear entity cache",arrow:!0,children:h.jsx("span",{children:h.jsxs(vt,{size:"small",variant:"outlined",onClick:pt,disabled:te,sx:{gap:.5},children:[h.jsx(Kc,{}),"Clear entity cache"]})})}),h.jsx(cu,{})]})]});return k.useEffect(()=>{y&&setTimeout(()=>{A({variables:y}).then(K=>{var be,Ae;const ne=(Ae=(be=K==null?void 0:K.data)==null?void 0:be.getConcept)==null?void 0:Ae.result;if(!ne||(ne==null?void 0:ne.length)<1)return;const Oe=ne[0];Xt(Oe)})},750)},[y]),k.useEffect(()=>{if(w!=null&&w.uuid){let K=xe.map(ne=>ne.uuid===w.uuid?{...ne,...w}:ne);Ze(K)}},[w]),k.useEffect(()=>{if(I){let K=xe.filter(ne=>ne.uuid!==I);Ze(K),M(null)}},[I]),h.jsxs(z,{sx:{display:"flex",flexDirection:"column",height:"100%",overflow:"hidden"},children:[h.jsx(vi,{show:vn,onHide:()=>it(!1),concept:f,setModifiedConcept:S,setDeletedConcept:M}),h.jsx(vi,{show:En,onHide:()=>wn(!1),concept:R,setAddedConcept:E,createConcept:!0}),h.jsx(vi,{show:xn,onHide:()=>$t(!1),concept:pe,setAddedConcept:E,createConcept:!0}),gr,h.jsx(z,{sx:{display:"flex",flex:1,p:2,overflow:"auto"},children:h.jsxs(_e,{container:!0,spacing:2,sx:{width:"100%",height:"100%"},children:[h.jsx(_e,{size:{xs:12,md:7},sx:{flex:1,p:.25,height:"100%",maxHeight:"100%"},children:e?h.jsxs(sn,{elevation:4,sx:{height:"100%",overflowY:"auto",width:"100%"},children:[h.jsx(Fi,{sx:{visibility:T?"visible":"hidden"}}),h.jsx(su,{article:F.article})]}):h.jsx(sn,{elevation:4,sx:{height:"100%",overflowY:"auto"},children:h.jsx(a0,{})})}),h.jsx(_e,{size:{xs:12,md:5},gap:2,sx:{flex:1,height:"100%",maxHeight:"100%"},children:h.jsxs(z,{sx:{display:"flex",flexDirection:"column",gap:2,overflowY:"auto",p:.25,flex:1,height:"100%",maxHeight:"100%"},children:[Pe.error&&h.jsx(xs,{severity:"error",children:Pe.message}),!e&&h.jsx(p0,{}),!e&&Be==="json"&&h.jsx(uu,{value:rt,onChange:en,disabled:Be!=="json"}),!e&&(t==null?void 0:t.genderAnalysisEnabled)&&h.jsx(o0,{}),Dn(),!e&&s&&ss.hasAuthority([is.IMAGE_TAGGING])&&h.jsx(_e,{size:12,children:h.jsx(u0,{})})]})})]})})]})};export{P0 as default};
73//# sourceMappingURL=AutoTaggingDemo-BOxyz0pP.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.