PluginProbe
Booktics – Appointment Booking Calendar for Service Businesses / 1.0.2
Booktics – Appointment Booking Calendar for Service Businesses v1.0.2
1.0.29 1.0.28 1.0.27 1.0.26 1.0.25 1.0.24 1.0.23 1.0.22 1.0.21 1.0.20 1.0.19 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.2 1.0.3 All 31 releases
booktics / assets / build / chunks / js / 764.js

764.js in Booktics – Appointment Booking Calendar for Service Businesses 1.0.2, at assets/build/chunks/js/764.js

1 lines 500.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 (globalThis.webpackChunkbooktics=globalThis.webpackChunkbooktics||[]).push([[764],{659:(e,t,n)=>{var o=n(51873),r=Object.prototype,i=r.hasOwnProperty,a=r.toString,s=o?o.toStringTag:void 0;e.exports=function(e){var t=i.call(e,s),n=e[s];try{e[s]=void 0;var o=!0}catch(e){}var r=a.call(e);return o&&(t?e[s]=n:delete e[s]),r}},1882:(e,t,n)=>{var o=n(72552),r=n(23805);e.exports=function(e){if(!r(e))return!1;var t=o(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},2404:(e,t,n)=>{var o=n(60270);e.exports=function(e,t){return o(e,t)}},3650:(e,t,n)=>{var o=n(74335)(Object.keys,Object);e.exports=o},3656:(e,t,n)=>{e=n.nmd(e);var o=n(9325),r=n(89935),i=t&&!t.nodeType&&t,a=i&&e&&!e.nodeType&&e,s=a&&a.exports===i?o.Buffer:void 0,l=(s?s.isBuffer:void 0)||r;e.exports=l},4509:(e,t,n)=>{var o=n(12651);e.exports=function(e){return o(this,e).has(e)}},4664:(e,t,n)=>{var o=n(79770),r=n(63345),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(e){return null==e?[]:(e=Object(e),o(a(e),function(t){return i.call(e,t)}))}:r;e.exports=s},4901:(e,t,n)=>{var o=n(72552),r=n(30294),i=n(40346),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,e.exports=function(e){return i(e)&&r(e.length)&&!!a[o(e)]}},5861:(e,t,n)=>{var o=n(55580),r=n(68223),i=n(32804),a=n(76545),s=n(28303),l=n(72552),c=n(47473),u="[object Map]",d="[object Promise]",f="[object Set]",h="[object WeakMap]",p="[object DataView]",g=c(o),y=c(r),m=c(i),v=c(a),b=c(s),x=l;(o&&x(new o(new ArrayBuffer(1)))!=p||r&&x(new r)!=u||i&&x(i.resolve())!=d||a&&x(new a)!=f||s&&x(new s)!=h)&&(x=function(e){var t=l(e),n="[object Object]"==t?e.constructor:void 0,o=n?c(n):"";if(o)switch(o){case g:return p;case y:return u;case m:return d;case v:return f;case b:return h}return t}),e.exports=x},8999:e=>{e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},9325:(e,t,n)=>{var o=n(34840),r="object"==typeof self&&self&&self.Object===Object&&self,i=o||r||Function("return this")();e.exports=i},10392:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},12651:(e,t,n)=>{var o=n(74218);e.exports=function(e,t){var n=e.__data__;return o(t)?n["string"==typeof t?"string":"hash"]:n.map}},12749:(e,t,n)=>{var o=n(81042),r=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return o?void 0!==t[e]:r.call(t,e)}},14248:e=>{e.exports=function(e,t){for(var n=-1,o=null==e?0:e.length;++n<o;)if(t(e[n],n,e))return!0;return!1}},14528:e=>{e.exports=function(e,t){for(var n=-1,o=t.length,r=e.length;++n<o;)e[r+n]=t[n];return e}},17670:(e,t,n)=>{var o=n(12651);e.exports=function(e){var t=o(this,e).delete(e);return this.size-=t?1:0,t}},19219:e=>{e.exports=function(e,t){return e.has(t)}},20317:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,o){n[++t]=[o,e]}),n}},21020:(e,t,n)=>{"use strict";var o=n(51609),r=Symbol.for("react.element"),i=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,s=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var o,i={},c=null,u=null;for(o in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)a.call(t,o)&&!l.hasOwnProperty(o)&&(i[o]=t[o]);if(e&&e.defaultProps)for(o in t=e.defaultProps)void 0===i[o]&&(i[o]=t[o]);return{$$typeof:r,type:e,key:c,ref:u,props:i,_owner:s.current}}t.Fragment=i,t.jsx=c,t.jsxs=c},21549:(e,t,n)=>{var o=n(22032),r=n(63862),i=n(66721),a=n(12749),s=n(35749);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}l.prototype.clear=o,l.prototype.delete=r,l.prototype.get=i,l.prototype.has=a,l.prototype.set=s,e.exports=l},21986:(e,t,n)=>{var o=n(51873),r=n(37828),i=n(75288),a=n(25911),s=n(20317),l=n(84247),c=o?o.prototype:void 0,u=c?c.valueOf:void 0;e.exports=function(e,t,n,o,c,d,f){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!d(new r(e),new r(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return i(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var h=s;case"[object Set]":var p=1&o;if(h||(h=l),e.size!=t.size&&!p)return!1;var g=f.get(e);if(g)return g==t;o|=2,f.set(e,t);var y=a(h(e),h(t),o,c,d,f);return f.delete(e),y;case"[object Symbol]":if(u)return u.call(e)==u.call(t)}return!1}},22032:(e,t,n)=>{var o=n(81042);e.exports=function(){this.__data__=o?o(null):{},this.size=0}},22383:(e,t,n)=>{"use strict";n.d(t,{tL:()=>Pf,eb:()=>Rf,fB:()=>fo});var o=n(74848),r=n(51609),i=n.n(r),a=n(36492),s=n(79888),l=n(31058),c=n(89394);const u=i().createContext({});var d=n(62279),f=n(68676),h=n(71919),p=n(24768),g=n(4732),y=n(29729),m=n(65010),v=n(36962),b=n(46942),x=n.n(b),w=n(3453),_=n(80045),E=n(89379),k=n(75795),O=n(58168),S=n(64467),C=n(30156),N=n(82284),j=n(16928),A=n(72065),P=r.forwardRef(function(e,t){var n=e.prefixCls,o=e.style,i=e.className,a=e.duration,s=void 0===a?4.5:a,l=e.showProgress,c=e.pauseOnHover,u=void 0===c||c,d=e.eventKey,f=e.content,h=e.closable,p=e.closeIcon,g=void 0===p?"x":p,y=e.props,m=e.onClick,v=e.onNoticeClose,b=e.times,_=e.hovering,E=r.useState(!1),k=(0,w.A)(E,2),C=k[0],P=k[1],M=r.useState(0),T=(0,w.A)(M,2),L=T[0],I=T[1],R=r.useState(0),q=(0,w.A)(R,2),D=q[0],z=q[1],B=_||C,$=s>0&&l,F=function(){v(d)};r.useEffect(function(){if(!B&&s>0){var e=Date.now()-D,t=setTimeout(function(){F()},1e3*s-D);return function(){u&&clearTimeout(t),z(Date.now()-e)}}},[s,B,b]),r.useEffect(function(){if(!B&&$&&(u||0===D)){var e,t=performance.now();return function n(){cancelAnimationFrame(e),e=requestAnimationFrame(function(e){var o=e+D-t,r=Math.min(o/(1e3*s),1);I(100*r),r<1&&n()})}(),function(){u&&cancelAnimationFrame(e)}}},[s,D,B,$,b]);var H=r.useMemo(function(){return"object"===(0,N.A)(h)&&null!==h?h:h?{closeIcon:g}:{}},[h,g]),V=(0,A.A)(H,!0),U=100-(!L||L<0?0:L>100?100:L),K="".concat(n,"-notice");return r.createElement("div",(0,O.A)({},y,{ref:t,className:x()(K,i,(0,S.A)({},"".concat(K,"-closable"),h)),style:o,onMouseEnter:function(e){var t;P(!0),null==y||null===(t=y.onMouseEnter)||void 0===t||t.call(y,e)},onMouseLeave:function(e){var t;P(!1),null==y||null===(t=y.onMouseLeave)||void 0===t||t.call(y,e)},onClick:m}),r.createElement("div",{className:"".concat(K,"-content")},f),h&&r.createElement("a",(0,O.A)({tabIndex:0,className:"".concat(K,"-close"),onKeyDown:function(e){"Enter"!==e.key&&"Enter"!==e.code&&e.keyCode!==j.A.ENTER||F()},"aria-label":"Close"},V,{onClick:function(e){e.preventDefault(),e.stopPropagation(),F()}}),H.closeIcon),$&&r.createElement("progress",{className:"".concat(K,"-progress"),max:"100",value:U},U+"%"))});const M=P;var T=i().createContext({});const L=function(e){var t=e.children,n=e.classNames;return i().createElement(T.Provider,{value:{classNames:n}},t)};var I=["className","style","classNames","styles"];const R=function(e){var t,n,o,a,s,l=e.configList,u=e.placement,d=e.prefixCls,f=e.className,h=e.style,p=e.motion,g=e.onAllNoticeRemoved,y=e.onNoticeClose,m=e.stack,v=(0,r.useContext)(T).classNames,b=(0,r.useRef)({}),k=(0,r.useState)(null),j=(0,w.A)(k,2),A=j[0],P=j[1],L=(0,r.useState)([]),R=(0,w.A)(L,2),q=R[0],D=R[1],z=l.map(function(e){return{config:e,key:String(e.key)}}),B=(s={offset:8,threshold:3,gap:16},(t=m)&&"object"===(0,N.A)(t)&&(s.offset=null!==(n=t.offset)&&void 0!==n?n:8,s.threshold=null!==(o=t.threshold)&&void 0!==o?o:3,s.gap=null!==(a=t.gap)&&void 0!==a?a:16),[!!t,s]),$=(0,w.A)(B,2),F=$[0],H=$[1],V=H.offset,U=H.threshold,K=H.gap,Z=F&&(q.length>0||z.length<=U),W="function"==typeof p?p(u):p;return(0,r.useEffect)(function(){F&&q.length>1&&D(function(e){return e.filter(function(e){return z.some(function(t){var n=t.key;return e===n})})})},[q,z,F]),(0,r.useEffect)(function(){var e,t;F&&b.current[null===(e=z[z.length-1])||void 0===e?void 0:e.key]&&P(b.current[null===(t=z[z.length-1])||void 0===t?void 0:t.key])},[z,F]),i().createElement(C.aF,(0,O.A)({key:u,className:x()(d,"".concat(d,"-").concat(u),null==v?void 0:v.list,f,(0,S.A)((0,S.A)({},"".concat(d,"-stack"),!!F),"".concat(d,"-stack-expanded"),Z)),style:h,keys:z,motionAppear:!0},W,{onAllRemoved:function(){g(u)}}),function(e,t){var n=e.config,o=e.className,r=e.style,a=e.index,s=n,l=s.key,f=s.times,h=String(l),p=n,g=p.className,m=p.style,w=p.classNames,k=p.styles,S=(0,_.A)(p,I),C=z.findIndex(function(e){return e.key===h}),N={};if(F){var j=z.length-1-(C>-1?C:a-1),P="top"===u||"bottom"===u?"-50%":"0";if(j>0){var T,L,R;N.height=Z?null===(T=b.current[h])||void 0===T?void 0:T.offsetHeight:null==A?void 0:A.offsetHeight;for(var B=0,$=0;$<j;$++){var H;B+=(null===(H=b.current[z[z.length-1-$].key])||void 0===H?void 0:H.offsetHeight)+K}var U=(Z?B:j*V)*(u.startsWith("top")?1:-1),W=!Z&&null!=A&&A.offsetWidth&&null!==(L=b.current[h])&&void 0!==L&&L.offsetWidth?((null==A?void 0:A.offsetWidth)-2*V*(j<3?j:3))/(null===(R=b.current[h])||void 0===R?void 0:R.offsetWidth):1;N.transform="translate3d(".concat(P,", ").concat(U,"px, 0) scaleX(").concat(W,")")}else N.transform="translate3d(".concat(P,", 0, 0)")}return i().createElement("div",{ref:t,className:x()("".concat(d,"-notice-wrapper"),o,null==w?void 0:w.wrapper),style:(0,E.A)((0,E.A)((0,E.A)({},r),N),null==k?void 0:k.wrapper),onMouseEnter:function(){return D(function(e){return e.includes(h)?e:[].concat((0,c.A)(e),[h])})},onMouseLeave:function(){return D(function(e){return e.filter(function(e){return e!==h})})}},i().createElement(M,(0,O.A)({},S,{ref:function(e){C>-1?b.current[h]=e:delete b.current[h]},prefixCls:d,classNames:w,styles:k,className:x()(g,null==v?void 0:v.notice),style:m,times:f,key:l,eventKey:l,onNoticeClose:y,hovering:F&&q.length>0})))})};var q=r.forwardRef(function(e,t){var n=e.prefixCls,o=void 0===n?"rc-notification":n,i=e.container,a=e.motion,s=e.maxCount,l=e.className,u=e.style,d=e.onAllRemoved,f=e.stack,h=e.renderNotifications,p=r.useState([]),g=(0,w.A)(p,2),y=g[0],m=g[1],v=function(e){var t,n=y.find(function(t){return t.key===e});null==n||null===(t=n.onClose)||void 0===t||t.call(n),m(function(t){return t.filter(function(t){return t.key!==e})})};r.useImperativeHandle(t,function(){return{open:function(e){m(function(t){var n,o=(0,c.A)(t),r=o.findIndex(function(t){return t.key===e.key}),i=(0,E.A)({},e);return r>=0?(i.times=((null===(n=t[r])||void 0===n?void 0:n.times)||0)+1,o[r]=i):(i.times=0,o.push(i)),s>0&&o.length>s&&(o=o.slice(-s)),o})},close:function(e){v(e)},destroy:function(){m([])}}});var b=r.useState({}),x=(0,w.A)(b,2),_=x[0],O=x[1];r.useEffect(function(){var e={};y.forEach(function(t){var n=t.placement,o=void 0===n?"topRight":n;o&&(e[o]=e[o]||[],e[o].push(t))}),Object.keys(_).forEach(function(t){e[t]=e[t]||[]}),O(e)},[y]);var S=function(e){O(function(t){var n=(0,E.A)({},t);return(n[e]||[]).length||delete n[e],n})},C=r.useRef(!1);if(r.useEffect(function(){Object.keys(_).length>0?C.current=!0:C.current&&(null==d||d(),C.current=!1)},[_]),!i)return null;var N=Object.keys(_);return(0,k.createPortal)(r.createElement(r.Fragment,null,N.map(function(e){var t=_[e],n=r.createElement(R,{key:e,configList:t,placement:e,prefixCls:o,className:null==l?void 0:l(e),style:null==u?void 0:u(e),motion:a,onNoticeClose:v,onAllNoticeRemoved:S,stack:f});return h?h(n,{prefixCls:o,key:e}):n})),i)});const D=q;var z=n(81470),B=["getContainer","motion","prefixCls","maxCount","className","style","onAllRemoved","stack","renderNotifications"],$=function(){return document.body},F=0;var H=n(20934),V=n(54018),U=n(60275),K=n(25905),Z=n(37358),W=n(67906);const Y=e=>{const{componentCls:t,iconCls:n,boxShadow:o,colorText:r,colorSuccess:i,colorError:a,colorWarning:s,colorInfo:l,fontSizeLG:c,motionEaseInOutCirc:u,motionDurationSlow:d,marginXS:f,paddingXS:h,borderRadiusLG:p,zIndexPopup:g,contentPadding:y,contentBg:m}=e,v=`${t}-notice`,b=new V.Mo("MessageMoveIn",{"0%":{padding:0,transform:"translateY(-100%)",opacity:0},"100%":{padding:h,transform:"translateY(0)",opacity:1}}),x=new V.Mo("MessageMoveOut",{"0%":{maxHeight:e.height,padding:h,opacity:1},"100%":{maxHeight:0,padding:0,opacity:0}}),w={padding:h,textAlign:"center",[`${t}-custom-content`]:{display:"flex",alignItems:"center"},[`${t}-custom-content > ${n}`]:{marginInlineEnd:f,fontSize:c},[`${v}-content`]:{display:"inline-block",padding:y,background:m,borderRadius:p,boxShadow:o,pointerEvents:"all"},[`${t}-success > ${n}`]:{color:i},[`${t}-error > ${n}`]:{color:a},[`${t}-warning > ${n}`]:{color:s},[`${t}-info > ${n},\n ${t}-loading > ${n}`]:{color:l}};return[{[t]:Object.assign(Object.assign({},(0,K.dF)(e)),{color:r,position:"fixed",top:f,width:"100%",pointerEvents:"none",zIndex:g,[`${t}-move-up`]:{animationFillMode:"forwards"},[`\n ${t}-move-up-appear,\n ${t}-move-up-enter\n `]:{animationName:b,animationDuration:d,animationPlayState:"paused",animationTimingFunction:u},[`\n ${t}-move-up-appear${t}-move-up-appear-active,\n ${t}-move-up-enter${t}-move-up-enter-active\n `]:{animationPlayState:"running"},[`${t}-move-up-leave`]:{animationName:x,animationDuration:d,animationPlayState:"paused",animationTimingFunction:u},[`${t}-move-up-leave${t}-move-up-leave-active`]:{animationPlayState:"running"},"&-rtl":{direction:"rtl",span:{direction:"rtl"}}})},{[t]:{[`${v}-wrapper`]:Object.assign({},w)}},{[`${t}-notice-pure-panel`]:Object.assign(Object.assign({},w),{padding:0,textAlign:"start"})}]},X=(0,Z.OF)("Message",e=>{const t=(0,W.oX)(e,{height:150});return[Y(t)]},e=>({zIndexPopup:e.zIndexPopupBase+U.jH+10,contentBg:e.colorBgElevated,contentPadding:`${(e.controlHeightLG-e.fontSize*e.lineHeight)/2}px ${e.paddingSM}px`}));const G={info:r.createElement(m.A,null),success:r.createElement(p.A,null),error:r.createElement(g.A,null),warning:r.createElement(y.A,null),loading:r.createElement(v.A,null)},Q=({prefixCls:e,type:t,icon:n,children:o})=>r.createElement("div",{className:x()(`${e}-custom-content`,`${e}-${t}`)},n||G[t],r.createElement("span",null,o));var J=n(55886),ee=n(18877);function te(e){let t;const n=new Promise(n=>{t=e(()=>{n(!0)})}),o=()=>{null==t||t()};return o.then=(e,t)=>n.then(e,t),o.promise=n,o}const ne=3,oe=({children:e,prefixCls:t})=>{const n=(0,H.A)(t),[o,i,a]=X(t,n);return o(r.createElement(L,{classNames:{list:x()(i,a,n)}},e))},re=(e,{prefixCls:t,key:n})=>r.createElement(oe,{prefixCls:t,key:n},e),ie=r.forwardRef((e,t)=>{const{top:n,prefixCls:o,getContainer:i,maxCount:a,duration:s=ne,rtl:l,transitionName:u,onAllRemoved:f}=e,{getPrefixCls:h,getPopupContainer:p,message:g,direction:y}=r.useContext(d.QO),m=o||h("message"),v=r.createElement("span",{className:`${m}-close-x`},r.createElement(J.A,{className:`${m}-close-icon`})),[b,E]=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.getContainer,n=void 0===t?$:t,o=e.motion,i=e.prefixCls,a=e.maxCount,s=e.className,l=e.style,u=e.onAllRemoved,d=e.stack,f=e.renderNotifications,h=(0,_.A)(e,B),p=r.useState(),g=(0,w.A)(p,2),y=g[0],m=g[1],v=r.useRef(),b=r.createElement(D,{container:y,ref:v,prefixCls:i,motion:o,maxCount:a,className:s,style:l,onAllRemoved:u,stack:d,renderNotifications:f}),x=r.useState([]),E=(0,w.A)(x,2),k=E[0],O=E[1],S=(0,z._q)(function(e){var t=function(){for(var e={},t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return n.forEach(function(t){t&&Object.keys(t).forEach(function(n){var o=t[n];void 0!==o&&(e[n]=o)})}),e}(h,e);null!==t.key&&void 0!==t.key||(t.key="rc-notification-".concat(F),F+=1),O(function(e){return[].concat((0,c.A)(e),[{type:"open",config:t}])})}),C=r.useMemo(function(){return{open:S,close:function(e){O(function(t){return[].concat((0,c.A)(t),[{type:"close",key:e}])})},destroy:function(){O(function(e){return[].concat((0,c.A)(e),[{type:"destroy"}])})}}},[]);return r.useEffect(function(){m(n())}),r.useEffect(function(){var e,t;v.current&&k.length&&(k.forEach(function(e){switch(e.type){case"open":v.current.open(e.config);break;case"close":v.current.close(e.key);break;case"destroy":v.current.destroy()}}),O(function(n){return e===n&&t||(e=n,t=n.filter(function(e){return!k.includes(e)})),t}))},[k]),[C,b]}({prefixCls:m,style:()=>({left:"50%",transform:"translateX(-50%)",top:null!=n?n:8}),className:()=>x()({[`${m}-rtl`]:null!=l?l:"rtl"===y}),motion:()=>function(e,t){return{motionName:null!=t?t:`${e}-move-up`}}(m,u),closable:!1,closeIcon:v,duration:s,getContainer:()=>(null==i?void 0:i())||(null==p?void 0:p())||document.body,maxCount:a,onAllRemoved:f,renderNotifications:re});return r.useImperativeHandle(t,()=>Object.assign(Object.assign({},b),{prefixCls:m,message:g})),E});let ae=0;function se(e){const t=r.useRef(null),n=((0,ee.rJ)("Message"),r.useMemo(()=>{const e=e=>{var n;null===(n=t.current)||void 0===n||n.close(e)},n=n=>{if(!t.current){const e=()=>{};return e.then=()=>{},e}const{open:o,prefixCls:i,message:a}=t.current,s=`${i}-notice`,{content:l,icon:c,type:u,key:d,className:f,style:h,onClose:p}=n,g=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}(n,["content","icon","type","key","className","style","onClose"]);let y=d;return null==y&&(ae+=1,y=`antd-message-${ae}`),te(t=>(o(Object.assign(Object.assign({},g),{key:y,content:r.createElement(Q,{prefixCls:i,type:u,icon:c},l),placement:"top",className:x()(u&&`${s}-${u}`,f,null==a?void 0:a.className),style:Object.assign(Object.assign({},null==a?void 0:a.style),h),onClose:()=>{null==p||p(),t()}})),()=>{e(y)}))},o={open:n,destroy:n=>{var o;void 0!==n?e(n):null===(o=t.current)||void 0===o||o.destroy()}};return["info","success","warning","error","loading"].forEach(e=>{o[e]=(t,o,r)=>{let i,a,s;i=t&&"object"==typeof t&&"content"in t?t:{content:t},"function"==typeof o?s=o:(a=o,s=r);const l=Object.assign(Object.assign({onClose:s,duration:a},i),{type:e});return n(l)}}),o},[]));return[n,r.createElement(ie,Object.assign({key:"message-holder"},e,{ref:t}))]}let le=null,ce=e=>e(),ue=[],de={};function fe(){const{getContainer:e,duration:t,rtl:n,maxCount:o,top:r}=de,i=(null==e?void 0:e())||document.body;return{getContainer:()=>i,duration:t,rtl:n,maxCount:o,top:r}}const he=i().forwardRef((e,t)=>{const{messageConfig:n,sync:o}=e,{getPrefixCls:a}=(0,r.useContext)(d.QO),s=de.prefixCls||a("message"),l=(0,r.useContext)(u),[c,f]=se(Object.assign(Object.assign(Object.assign({},n),{prefixCls:s}),l.message));return i().useImperativeHandle(t,()=>{const e=Object.assign({},c);return Object.keys(e).forEach(t=>{e[t]=(...e)=>(o(),c[t].apply(c,e))}),{instance:e,sync:o}}),f}),pe=i().forwardRef((e,t)=>{const[n,o]=i().useState(fe),r=()=>{o(fe)};i().useEffect(r,[]);const a=(0,f.cr)(),s=a.getRootPrefixCls(),l=a.getIconPrefixCls(),c=a.getTheme(),u=i().createElement(he,{ref:t,sync:r,messageConfig:n});return i().createElement(f.Ay,{prefixCls:s,iconPrefixCls:l,theme:c},a.holderRender?a.holderRender(u):u)});function ge(){if(!le){const e=document.createDocumentFragment(),t={fragment:e};return le=t,void ce(()=>{(0,h.L)()(i().createElement(pe,{ref:e=>{const{instance:n,sync:o}=e||{};Promise.resolve().then(()=>{!t.instance&&n&&(t.instance=n,t.sync=o,ge())})}}),e)})}le.instance&&(ue.forEach(e=>{const{type:t,skipped:n}=e;if(!n)switch(t){case"open":ce(()=>{const t=le.instance.open(Object.assign(Object.assign({},de),e.config));null==t||t.then(e.resolve),e.setCloseFn(t)});break;case"destroy":ce(()=>{null==le||le.instance.destroy(e.key)});break;default:ce(()=>{var n;const o=(n=le.instance)[t].apply(n,(0,c.A)(e.args));null==o||o.then(e.resolve),e.setCloseFn(o)})}}),ue=[])}const ye={open:function(e){const t=te(t=>{let n;const o={type:"open",config:e,resolve:t,setCloseFn:e=>{n=e}};return ue.push(o),()=>{n?ce(()=>{n()}):o.skipped=!0}});return ge(),t},destroy:e=>{ue.push({type:"destroy",key:e}),ge()},config:function(e){de=Object.assign(Object.assign({},de),e),ce(()=>{var e;null===(e=null==le?void 0:le.sync)||void 0===e||e.call(le)})},useMessage:function(e){return se(e)},_InternalPanelDoNotUseOrYouWillBeFired:e=>{const{prefixCls:t,className:n,type:o,icon:i,content:a}=e,s=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}(e,["prefixCls","className","type","icon","content"]),{getPrefixCls:l}=r.useContext(d.QO),c=t||l("message"),u=(0,H.A)(c),[f,h,p]=X(c,u);return f(r.createElement(M,Object.assign({},s,{prefixCls:c,className:x()(n,h,`${c}-notice-pure-panel`,p,u),eventKey:"pure",duration:null,content:r.createElement(Q,{prefixCls:c,type:o,icon:i},a)})))}},me=ye;["success","info","warning","error","loading"].forEach(e=>{me[e]=(...t)=>function(e,t){(0,f.cr)();const n=te(n=>{let o;const r={type:e,args:t,resolve:n,setCloseFn:e=>{o=e}};return ue.push(r),()=>{o?ce(()=>{o()}):r.skipped=!0}});return ge(),n}(e,t)});const ve=me;var be=n(50400),xe=n(67313),we=n(71524),_e=n(90070),Ee=n(19549),ke=n(51643),Oe=n(32099),Se=n(60742),Ce=n(54861),Ne=n(88966),je=n(30981),Ae=r.createContext(null),Pe=r.createContext({});const Me=Ae;var Te=n(8719),Le=["prefixCls","className","containerRef"];const Ie=function(e){var t=e.prefixCls,n=e.className,o=e.containerRef,i=(0,_.A)(e,Le),a=r.useContext(Pe).panel,s=(0,Te.xK)(a,o);return r.createElement("div",(0,O.A)({className:x()("".concat(t,"-content"),n),role:"dialog",ref:s},(0,A.A)(e,{aria:!0}),{"aria-modal":"true"},i))};var Re=n(68210);function qe(e){return"string"==typeof e&&String(Number(e))===e?((0,Re.Ay)(!1,"Invalid value type of `width` or `height` which should be number type instead."),Number(e)):e}var De={width:0,height:0,overflow:"hidden",outline:"none",position:"absolute"};function ze(e,t){var n,o,i,a=e.prefixCls,s=e.open,l=e.placement,c=e.inline,u=e.push,d=e.forceRender,f=e.autoFocus,h=e.keyboard,p=e.classNames,g=e.rootClassName,y=e.rootStyle,m=e.zIndex,v=e.className,b=e.id,_=e.style,k=e.motion,N=e.width,P=e.height,M=e.children,T=e.mask,L=e.maskClosable,I=e.maskMotion,R=e.maskClassName,q=e.maskStyle,D=e.afterOpenChange,z=e.onClose,B=e.onMouseEnter,$=e.onMouseOver,F=e.onMouseLeave,H=e.onClick,V=e.onKeyDown,U=e.onKeyUp,K=e.styles,Z=e.drawerRender,W=r.useRef(),Y=r.useRef(),X=r.useRef();r.useImperativeHandle(t,function(){return W.current}),r.useEffect(function(){var e;s&&f&&(null===(e=W.current)||void 0===e||e.focus({preventScroll:!0}))},[s]);var G=r.useState(!1),Q=(0,w.A)(G,2),J=Q[0],ee=Q[1],te=r.useContext(Me),ne=null!==(n=null!==(o=null===(i="boolean"==typeof u?u?{}:{distance:0}:u||{})||void 0===i?void 0:i.distance)&&void 0!==o?o:null==te?void 0:te.pushDistance)&&void 0!==n?n:180,oe=r.useMemo(function(){return{pushDistance:ne,push:function(){ee(!0)},pull:function(){ee(!1)}}},[ne]);r.useEffect(function(){var e,t;s?null==te||null===(e=te.push)||void 0===e||e.call(te):null==te||null===(t=te.pull)||void 0===t||t.call(te)},[s]),r.useEffect(function(){return function(){var e;null==te||null===(e=te.pull)||void 0===e||e.call(te)}},[]);var re=r.createElement(C.Ay,(0,O.A)({key:"mask"},I,{visible:T&&s}),function(e,t){var n=e.className,o=e.style;return r.createElement("div",{className:x()("".concat(a,"-mask"),n,null==p?void 0:p.mask,R),style:(0,E.A)((0,E.A)((0,E.A)({},o),q),null==K?void 0:K.mask),onClick:L&&s?z:void 0,ref:t})}),ie="function"==typeof k?k(l):k,ae={};if(J&&ne)switch(l){case"top":ae.transform="translateY(".concat(ne,"px)");break;case"bottom":ae.transform="translateY(".concat(-ne,"px)");break;case"left":ae.transform="translateX(".concat(ne,"px)");break;default:ae.transform="translateX(".concat(-ne,"px)")}"left"===l||"right"===l?ae.width=qe(N):ae.height=qe(P);var se={onMouseEnter:B,onMouseOver:$,onMouseLeave:F,onClick:H,onKeyDown:V,onKeyUp:U},le=r.createElement(C.Ay,(0,O.A)({key:"panel"},ie,{visible:s,forceRender:d,onVisibleChanged:function(e){null==D||D(e)},removeOnLeave:!1,leavedClassName:"".concat(a,"-content-wrapper-hidden")}),function(t,n){var o=t.className,i=t.style,s=r.createElement(Ie,(0,O.A)({id:b,containerRef:n,prefixCls:a,className:x()(v,null==p?void 0:p.content),style:(0,E.A)((0,E.A)({},_),null==K?void 0:K.content)},(0,A.A)(e,{aria:!0}),se),M);return r.createElement("div",(0,O.A)({className:x()("".concat(a,"-content-wrapper"),null==p?void 0:p.wrapper,o),style:(0,E.A)((0,E.A)((0,E.A)({},ae),i),null==K?void 0:K.wrapper)},(0,A.A)(e,{data:!0})),Z?Z(s):s)}),ce=(0,E.A)({},y);return m&&(ce.zIndex=m),r.createElement(Me.Provider,{value:oe},r.createElement("div",{className:x()(a,"".concat(a,"-").concat(l),g,(0,S.A)((0,S.A)({},"".concat(a,"-open"),s),"".concat(a,"-inline"),c)),style:ce,tabIndex:-1,ref:W,onKeyDown:function(e){var t=e.keyCode,n=e.shiftKey;switch(t){case j.A.TAB:var o;if(t===j.A.TAB)if(n||document.activeElement!==X.current){if(n&&document.activeElement===Y.current){var r;null===(r=X.current)||void 0===r||r.focus({preventScroll:!0})}}else null===(o=Y.current)||void 0===o||o.focus({preventScroll:!0});break;case j.A.ESC:z&&h&&(e.stopPropagation(),z(e))}}},re,r.createElement("div",{tabIndex:0,ref:Y,style:De,"aria-hidden":"true","data-sentinel":"start"}),le,r.createElement("div",{tabIndex:0,ref:X,style:De,"aria-hidden":"true","data-sentinel":"end"})))}const Be=r.forwardRef(ze),$e=function(e){var t=e.open,n=void 0!==t&&t,o=e.prefixCls,i=void 0===o?"rc-drawer":o,a=e.placement,s=void 0===a?"right":a,l=e.autoFocus,c=void 0===l||l,u=e.keyboard,d=void 0===u||u,f=e.width,h=void 0===f?378:f,p=e.mask,g=void 0===p||p,y=e.maskClosable,m=void 0===y||y,v=e.getContainer,b=e.forceRender,x=e.afterOpenChange,_=e.destroyOnClose,k=e.onMouseEnter,O=e.onMouseOver,S=e.onMouseLeave,C=e.onClick,N=e.onKeyDown,j=e.onKeyUp,A=e.panelRef,P=r.useState(!1),M=(0,w.A)(P,2),T=M[0],L=M[1],I=r.useState(!1),R=(0,w.A)(I,2),q=R[0],D=R[1];(0,je.A)(function(){D(!0)},[]);var z=!!q&&n,B=r.useRef(),$=r.useRef();(0,je.A)(function(){z&&($.current=document.activeElement)},[z]);var F=r.useMemo(function(){return{panel:A}},[A]);if(!b&&!T&&!z&&_)return null;var H={onMouseEnter:k,onMouseOver:O,onMouseLeave:S,onClick:C,onKeyDown:N,onKeyUp:j},V=(0,E.A)((0,E.A)({},e),{},{open:z,prefixCls:i,placement:s,autoFocus:c,keyboard:d,width:h,mask:g,maskClosable:m,inline:!1===v,afterOpenChange:function(e){var t,n;L(e),null==x||x(e),e||!$.current||null!==(t=B.current)&&void 0!==t&&t.contains($.current)||null===(n=$.current)||void 0===n||n.focus({preventScroll:!0})},ref:B},H);return r.createElement(Pe.Provider,{value:F},r.createElement(Ne.A,{open:z||b||T,autoDestroy:!1,getContainer:v,autoLock:g&&(z||T)},r.createElement(Be,V)))};var Fe=n(62897),He=n(23723),Ve=n(72616),Ue=n(28557),Ke=n(70064),Ze=n(75063);const We=e=>{var t,n;const{prefixCls:o,title:i,footer:a,extra:s,loading:l,onClose:c,headerStyle:u,bodyStyle:f,footerStyle:h,children:p,classNames:g,styles:y}=e,m=(0,d.TP)("drawer"),v=r.useCallback(e=>r.createElement("button",{type:"button",onClick:c,className:`${o}-close`},e),[c]),[b,w]=(0,Ke.A)((0,Ke.d)(e),(0,Ke.d)(m),{closable:!0,closeIconRender:v}),_=r.useMemo(()=>{var e,t;return i||b?r.createElement("div",{style:Object.assign(Object.assign(Object.assign({},null===(e=m.styles)||void 0===e?void 0:e.header),u),null==y?void 0:y.header),className:x()(`${o}-header`,{[`${o}-header-close-only`]:b&&!i&&!s},null===(t=m.classNames)||void 0===t?void 0:t.header,null==g?void 0:g.header)},r.createElement("div",{className:`${o}-header-title`},w,i&&r.createElement("div",{className:`${o}-title`},i)),s&&r.createElement("div",{className:`${o}-extra`},s)):null},[b,w,s,u,o,i]),E=r.useMemo(()=>{var e,t;if(!a)return null;const n=`${o}-footer`;return r.createElement("div",{className:x()(n,null===(e=m.classNames)||void 0===e?void 0:e.footer,null==g?void 0:g.footer),style:Object.assign(Object.assign(Object.assign({},null===(t=m.styles)||void 0===t?void 0:t.footer),h),null==y?void 0:y.footer)},a)},[a,h,o]);return r.createElement(r.Fragment,null,_,r.createElement("div",{className:x()(`${o}-body`,null==g?void 0:g.body,null===(t=m.classNames)||void 0===t?void 0:t.body),style:Object.assign(Object.assign(Object.assign({},null===(n=m.styles)||void 0===n?void 0:n.body),f),null==y?void 0:y.body)},l?r.createElement(Ze.A,{active:!0,title:!1,paragraph:{rows:5},className:`${o}-body-skeleton`}):p),E)},Ye=e=>{const t="100%";return{left:`translateX(-${t})`,right:`translateX(${t})`,top:`translateY(-${t})`,bottom:`translateY(${t})`}[e]},Xe=(e,t)=>({"&-enter, &-appear":Object.assign(Object.assign({},e),{"&-active":t}),"&-leave":Object.assign(Object.assign({},t),{"&-active":e})}),Ge=(e,t)=>Object.assign({"&-enter, &-appear, &-leave":{"&-start":{transition:"none"},"&-active":{transition:`all ${t}`}}},Xe({opacity:e},{opacity:1})),Qe=(e,t)=>[Ge(.7,t),Xe({transform:Ye(e)},{transform:"none"})],Je=e=>{const{componentCls:t,motionDurationSlow:n}=e;return{[t]:{[`${t}-mask-motion`]:Ge(0,n),[`${t}-panel-motion`]:["left","right","top","bottom"].reduce((e,t)=>Object.assign(Object.assign({},e),{[`&-${t}`]:Qe(t,n)}),{})}}},et=e=>{const{borderRadiusSM:t,componentCls:n,zIndexPopup:o,colorBgMask:r,colorBgElevated:i,motionDurationSlow:a,motionDurationMid:s,paddingXS:l,padding:c,paddingLG:u,fontSizeLG:d,lineHeightLG:f,lineWidth:h,lineType:p,colorSplit:g,marginXS:y,colorIcon:m,colorIconHover:v,colorBgTextHover:b,colorBgTextActive:x,colorText:w,fontWeightStrong:_,footerPaddingBlock:E,footerPaddingInline:k,calc:O}=e,S=`${n}-content-wrapper`;return{[n]:{position:"fixed",inset:0,zIndex:o,pointerEvents:"none",color:w,"&-pure":{position:"relative",background:i,display:"flex",flexDirection:"column",[`&${n}-left`]:{boxShadow:e.boxShadowDrawerLeft},[`&${n}-right`]:{boxShadow:e.boxShadowDrawerRight},[`&${n}-top`]:{boxShadow:e.boxShadowDrawerUp},[`&${n}-bottom`]:{boxShadow:e.boxShadowDrawerDown}},"&-inline":{position:"absolute"},[`${n}-mask`]:{position:"absolute",inset:0,zIndex:o,background:r,pointerEvents:"auto"},[S]:{position:"absolute",zIndex:o,maxWidth:"100vw",transition:`all ${a}`,"&-hidden":{display:"none"}},[`&-left > ${S}`]:{top:0,bottom:0,left:{_skip_check_:!0,value:0},boxShadow:e.boxShadowDrawerLeft},[`&-right > ${S}`]:{top:0,right:{_skip_check_:!0,value:0},bottom:0,boxShadow:e.boxShadowDrawerRight},[`&-top > ${S}`]:{top:0,insetInline:0,boxShadow:e.boxShadowDrawerUp},[`&-bottom > ${S}`]:{bottom:0,insetInline:0,boxShadow:e.boxShadowDrawerDown},[`${n}-content`]:{display:"flex",flexDirection:"column",width:"100%",height:"100%",overflow:"auto",background:i,pointerEvents:"auto"},[`${n}-header`]:{display:"flex",flex:0,alignItems:"center",padding:`${(0,V.zA)(c)} ${(0,V.zA)(u)}`,fontSize:d,lineHeight:f,borderBottom:`${(0,V.zA)(h)} ${p} ${g}`,"&-title":{display:"flex",flex:1,alignItems:"center",minWidth:0,minHeight:0}},[`${n}-extra`]:{flex:"none"},[`${n}-close`]:Object.assign({display:"inline-flex",width:O(d).add(l).equal(),height:O(d).add(l).equal(),borderRadius:t,justifyContent:"center",alignItems:"center",marginInlineEnd:y,color:m,fontWeight:_,fontSize:d,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",textDecoration:"none",background:"transparent",border:0,cursor:"pointer",transition:`all ${s}`,textRendering:"auto","&:hover":{color:v,backgroundColor:b,textDecoration:"none"},"&:active":{backgroundColor:x}},(0,K.K8)(e)),[`${n}-title`]:{flex:1,margin:0,fontWeight:e.fontWeightStrong,fontSize:d,lineHeight:f},[`${n}-body`]:{flex:1,minWidth:0,minHeight:0,padding:u,overflow:"auto",[`${n}-body-skeleton`]:{width:"100%",height:"100%",display:"flex",justifyContent:"center"}},[`${n}-footer`]:{flexShrink:0,padding:`${(0,V.zA)(E)} ${(0,V.zA)(k)}`,borderTop:`${(0,V.zA)(h)} ${p} ${g}`},"&-rtl":{direction:"rtl"}}}},tt=(0,Z.OF)("Drawer",e=>{const t=(0,W.oX)(e,{});return[et(t),Je(t)]},e=>({zIndexPopup:e.zIndexPopupBase,footerPaddingBlock:e.paddingXS,footerPaddingInline:e.padding}));var nt=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};const ot={distance:180},rt=e=>{const{rootClassName:t,width:n,height:o,size:i="default",mask:a=!0,push:s=ot,open:l,afterOpenChange:c,onClose:u,prefixCls:f,getContainer:h,style:p,className:g,visible:y,afterVisibleChange:m,maskStyle:v,drawerStyle:b,contentWrapperStyle:w,destroyOnClose:_,destroyOnHidden:E}=e,k=nt(e,["rootClassName","width","height","size","mask","push","open","afterOpenChange","onClose","prefixCls","getContainer","style","className","visible","afterVisibleChange","maskStyle","drawerStyle","contentWrapperStyle","destroyOnClose","destroyOnHidden"]),{getPopupContainer:O,getPrefixCls:S,direction:C,className:N,style:j,classNames:A,styles:P}=(0,d.TP)("drawer"),M=S("drawer",f),[T,L,I]=tt(M),R=void 0===h&&O?()=>O(document.body):h,q=x()({"no-mask":!a,[`${M}-rtl`]:"rtl"===C},t,L,I),D=r.useMemo(()=>null!=n?n:"large"===i?736:378,[n,i]),z=r.useMemo(()=>null!=o?o:"large"===i?736:378,[o,i]),B={motionName:(0,He.b)(M,"mask-motion"),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500},$=(0,Ue.f)(),[F,H]=(0,U.YK)("Drawer",k.zIndex),{classNames:V={},styles:K={}}=k;return T(r.createElement(Fe.A,{form:!0,space:!0},r.createElement(Ve.A.Provider,{value:H},r.createElement($e,Object.assign({prefixCls:M,onClose:u,maskMotion:B,motion:e=>({motionName:(0,He.b)(M,`panel-motion-${e}`),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500})},k,{classNames:{mask:x()(V.mask,A.mask),content:x()(V.content,A.content),wrapper:x()(V.wrapper,A.wrapper)},styles:{mask:Object.assign(Object.assign(Object.assign({},K.mask),v),P.mask),content:Object.assign(Object.assign(Object.assign({},K.content),b),P.content),wrapper:Object.assign(Object.assign(Object.assign({},K.wrapper),w),P.wrapper)},open:null!=l?l:y,mask:a,push:s,width:D,height:z,style:Object.assign(Object.assign({},j),p),className:x()(N,g),rootClassName:q,getContainer:R,afterOpenChange:null!=c?c:m,panelRef:$,zIndex:F,destroyOnClose:null!=E?E:_}),r.createElement(We,Object.assign({prefixCls:M},k,{onClose:u}))))))};rt._InternalPanelDoNotUseOrYouWillBeFired=e=>{const{prefixCls:t,style:n,className:o,placement:i="right"}=e,a=nt(e,["prefixCls","style","className","placement"]),{getPrefixCls:s}=r.useContext(d.QO),l=s("drawer",t),[c,u,f]=tt(l),h=x()(l,`${l}-pure`,`${l}-${i}`,u,f,o);return c(r.createElement("div",{className:h,style:n},r.createElement(We,Object.assign({prefixCls:l},a))))};const it=rt;var at=n(54121),st=n(40682),lt=n(31108);const ct=new V.Mo("antStatusProcessing",{"0%":{transform:"scale(0.8)",opacity:.5},"100%":{transform:"scale(2.4)",opacity:0}}),ut=new V.Mo("antZoomBadgeIn",{"0%":{transform:"scale(0) translate(50%, -50%)",opacity:0},"100%":{transform:"scale(1) translate(50%, -50%)"}}),dt=new V.Mo("antZoomBadgeOut",{"0%":{transform:"scale(1) translate(50%, -50%)"},"100%":{transform:"scale(0) translate(50%, -50%)",opacity:0}}),ft=new V.Mo("antNoWrapperZoomBadgeIn",{"0%":{transform:"scale(0)",opacity:0},"100%":{transform:"scale(1)"}}),ht=new V.Mo("antNoWrapperZoomBadgeOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0)",opacity:0}}),pt=new V.Mo("antBadgeLoadingCircle",{"0%":{transformOrigin:"50%"},"100%":{transform:"translate(50%, -50%) rotate(360deg)",transformOrigin:"50%"}}),gt=e=>{const{fontHeight:t,lineWidth:n,marginXS:o,colorBorderBg:r}=e,i=t,a=n,s=e.colorTextLightSolid,l=e.colorError,c=e.colorErrorHover;return(0,W.oX)(e,{badgeFontHeight:i,badgeShadowSize:a,badgeTextColor:s,badgeColor:l,badgeColorHover:c,badgeShadowColor:r,badgeProcessingDuration:"1.2s",badgeRibbonOffset:o,badgeRibbonCornerTransform:"scaleY(0.75)",badgeRibbonCornerFilter:"brightness(75%)"})},yt=e=>{const{fontSize:t,lineHeight:n,fontSizeSM:o,lineWidth:r}=e;return{indicatorZIndex:"auto",indicatorHeight:Math.round(t*n)-2*r,indicatorHeightSM:t,dotSize:o/2,textFontSize:o,textFontSizeSM:o,textFontWeight:"normal",statusSize:o/2}},mt=(0,Z.OF)("Badge",e=>(e=>{const{componentCls:t,iconCls:n,antCls:o,badgeShadowSize:r,textFontSize:i,textFontSizeSM:a,statusSize:s,dotSize:l,textFontWeight:c,indicatorHeight:u,indicatorHeightSM:d,marginXS:f,calc:h}=e,p=`${o}-scroll-number`,g=(0,lt.A)(e,(e,{darkColor:n})=>({[`&${t} ${t}-color-${e}`]:{background:n,[`&:not(${t}-count)`]:{color:n},"a:hover &":{background:n}}}));return{[t]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,K.dF)(e)),{position:"relative",display:"inline-block",width:"fit-content",lineHeight:1,[`${t}-count`]:{display:"inline-flex",justifyContent:"center",zIndex:e.indicatorZIndex,minWidth:u,height:u,color:e.badgeTextColor,fontWeight:c,fontSize:i,lineHeight:(0,V.zA)(u),whiteSpace:"nowrap",textAlign:"center",background:e.badgeColor,borderRadius:h(u).div(2).equal(),boxShadow:`0 0 0 ${(0,V.zA)(r)} ${e.badgeShadowColor}`,transition:`background ${e.motionDurationMid}`,a:{color:e.badgeTextColor},"a:hover":{color:e.badgeTextColor},"a:hover &":{background:e.badgeColorHover}},[`${t}-count-sm`]:{minWidth:d,height:d,fontSize:a,lineHeight:(0,V.zA)(d),borderRadius:h(d).div(2).equal()},[`${t}-multiple-words`]:{padding:`0 ${(0,V.zA)(e.paddingXS)}`,bdi:{unicodeBidi:"plaintext"}},[`${t}-dot`]:{zIndex:e.indicatorZIndex,width:l,minWidth:l,height:l,background:e.badgeColor,borderRadius:"100%",boxShadow:`0 0 0 ${(0,V.zA)(r)} ${e.badgeShadowColor}`},[`${t}-count, ${t}-dot, ${p}-custom-component`]:{position:"absolute",top:0,insetInlineEnd:0,transform:"translate(50%, -50%)",transformOrigin:"100% 0%",[`&${n}-spin`]:{animationName:pt,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear"}},[`&${t}-status`]:{lineHeight:"inherit",verticalAlign:"baseline",[`${t}-status-dot`]:{position:"relative",top:-1,display:"inline-block",width:s,height:s,verticalAlign:"middle",borderRadius:"50%"},[`${t}-status-success`]:{backgroundColor:e.colorSuccess},[`${t}-status-processing`]:{overflow:"visible",color:e.colorInfo,backgroundColor:e.colorInfo,borderColor:"currentcolor","&::after":{position:"absolute",top:0,insetInlineStart:0,width:"100%",height:"100%",borderWidth:r,borderStyle:"solid",borderColor:"inherit",borderRadius:"50%",animationName:ct,animationDuration:e.badgeProcessingDuration,animationIterationCount:"infinite",animationTimingFunction:"ease-in-out",content:'""'}},[`${t}-status-default`]:{backgroundColor:e.colorTextPlaceholder},[`${t}-status-error`]:{backgroundColor:e.colorError},[`${t}-status-warning`]:{backgroundColor:e.colorWarning},[`${t}-status-text`]:{marginInlineStart:f,color:e.colorText,fontSize:e.fontSize}}}),g),{[`${t}-zoom-appear, ${t}-zoom-enter`]:{animationName:ut,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack,animationFillMode:"both"},[`${t}-zoom-leave`]:{animationName:dt,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack,animationFillMode:"both"},[`&${t}-not-a-wrapper`]:{[`${t}-zoom-appear, ${t}-zoom-enter`]:{animationName:ft,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack},[`${t}-zoom-leave`]:{animationName:ht,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack},[`&:not(${t}-status)`]:{verticalAlign:"middle"},[`${p}-custom-component, ${t}-count`]:{transform:"none"},[`${p}-custom-component, ${p}`]:{position:"relative",top:"auto",display:"block",transformOrigin:"50% 50%"}},[p]:{overflow:"hidden",transition:`all ${e.motionDurationMid} ${e.motionEaseOutBack}`,[`${p}-only`]:{position:"relative",display:"inline-block",height:u,transition:`all ${e.motionDurationSlow} ${e.motionEaseOutBack}`,WebkitTransformStyle:"preserve-3d",WebkitBackfaceVisibility:"hidden",[`> p${p}-only-unit`]:{height:u,margin:0,WebkitTransformStyle:"preserve-3d",WebkitBackfaceVisibility:"hidden"}},[`${p}-symbol`]:{verticalAlign:"top"}},"&-rtl":{direction:"rtl",[`${t}-count, ${t}-dot, ${p}-custom-component`]:{transform:"translate(-50%, -50%)"}}})}})(gt(e)),yt),vt=(0,Z.OF)(["Badge","Ribbon"],e=>(e=>{const{antCls:t,badgeFontHeight:n,marginXS:o,badgeRibbonOffset:r,calc:i}=e,a=`${t}-ribbon`,s=`${t}-ribbon-wrapper`,l=(0,lt.A)(e,(e,{darkColor:t})=>({[`&${a}-color-${e}`]:{background:t,color:t}}));return{[s]:{position:"relative"},[a]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,K.dF)(e)),{position:"absolute",top:o,padding:`0 ${(0,V.zA)(e.paddingXS)}`,color:e.colorPrimary,lineHeight:(0,V.zA)(n),whiteSpace:"nowrap",backgroundColor:e.colorPrimary,borderRadius:e.borderRadiusSM,[`${a}-text`]:{color:e.badgeTextColor},[`${a}-corner`]:{position:"absolute",top:"100%",width:r,height:r,color:"currentcolor",border:`${(0,V.zA)(i(r).div(2).equal())} solid`,transform:e.badgeRibbonCornerTransform,transformOrigin:"top",filter:e.badgeRibbonCornerFilter}}),l),{[`&${a}-placement-end`]:{insetInlineEnd:i(r).mul(-1).equal(),borderEndEndRadius:0,[`${a}-corner`]:{insetInlineEnd:0,borderInlineEndColor:"transparent",borderBlockEndColor:"transparent"}},[`&${a}-placement-start`]:{insetInlineStart:i(r).mul(-1).equal(),borderEndStartRadius:0,[`${a}-corner`]:{insetInlineStart:0,borderBlockEndColor:"transparent",borderInlineStartColor:"transparent"}},"&-rtl":{direction:"rtl"}})}})(gt(e)),yt),bt=e=>{const{prefixCls:t,value:n,current:o,offset:i=0}=e;let a;return i&&(a={position:"absolute",top:`${i}00%`,left:0}),r.createElement("span",{style:a,className:x()(`${t}-only-unit`,{current:o})},n)};function xt(e,t,n){let o=e,r=0;for(;(o+10)%10!==t;)o+=n,r+=n;return r}const wt=e=>{const{prefixCls:t,count:n,value:o}=e,i=Number(o),a=Math.abs(n),[s,l]=r.useState(i),[c,u]=r.useState(a),d=()=>{l(i),u(a)};let f,h;if(r.useEffect(()=>{const e=setTimeout(d,1e3);return()=>clearTimeout(e)},[i]),s===i||Number.isNaN(i)||Number.isNaN(s))f=[r.createElement(bt,Object.assign({},e,{key:i,current:!0}))],h={transition:"none"};else{f=[];const t=i+10,n=[];for(let e=i;e<=t;e+=1)n.push(e);const o=c<a?1:-1,l=n.findIndex(e=>e%10===s);f=(o<0?n.slice(0,l+1):n.slice(l)).map((t,n)=>{const i=t%10;return r.createElement(bt,Object.assign({},e,{key:t,value:i,offset:o<0?n-l:n,current:n===l}))}),h={transform:`translateY(${-xt(s,i,o)}00%)`}}return r.createElement("span",{className:`${t}-only`,style:h,onTransitionEnd:d},f)};const _t=r.forwardRef((e,t)=>{const{prefixCls:n,count:o,className:i,motionClassName:a,style:s,title:l,show:c,component:u="sup",children:f}=e,h=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}(e,["prefixCls","count","className","motionClassName","style","title","show","component","children"]),{getPrefixCls:p}=r.useContext(d.QO),g=p("scroll-number",n),y=Object.assign(Object.assign({},h),{"data-show":c,style:s,className:x()(g,i,a),title:l});let m=o;if(o&&Number(o)%1==0){const e=String(o).split("");m=r.createElement("bdi",null,e.map((t,n)=>r.createElement(wt,{prefixCls:g,count:Number(o),value:t,key:e.length-n})))}return(null==s?void 0:s.borderColor)&&(y.style=Object.assign(Object.assign({},s),{boxShadow:`0 0 0 1px ${s.borderColor} inset`})),f?(0,st.Ob)(f,e=>({className:x()(`${g}-custom-component`,null==e?void 0:e.className,a)})):r.createElement(u,Object.assign({},y,{ref:t}),m)}),Et=_t;const kt=r.forwardRef((e,t)=>{var n,o,i,a,s;const{prefixCls:l,scrollNumberPrefixCls:c,children:u,status:f,text:h,color:p,count:g=null,overflowCount:y=99,dot:m=!1,size:v="default",title:b,offset:w,style:_,className:E,rootClassName:k,classNames:O,styles:S,showZero:N=!1}=e,j=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}(e,["prefixCls","scrollNumberPrefixCls","children","status","text","color","count","overflowCount","dot","size","title","offset","style","className","rootClassName","classNames","styles","showZero"]),{getPrefixCls:A,direction:P,badge:M}=r.useContext(d.QO),T=A("badge",l),[L,I,R]=mt(T),q=g>y?`${y}+`:g,D="0"===q||0===q,z=null===g||D&&!N,B=(null!=f||null!=p)&&z,$=null!=f||!D,F=m&&!D,H=F?"":q,V=(0,r.useMemo)(()=>(null==H||""===H||D&&!N)&&!F,[H,D,N,F]),U=(0,r.useRef)(g);V||(U.current=g);const K=U.current,Z=(0,r.useRef)(H);V||(Z.current=H);const W=Z.current,Y=(0,r.useRef)(F);V||(Y.current=F);const X=(0,r.useMemo)(()=>{if(!w)return Object.assign(Object.assign({},null==M?void 0:M.style),_);const e={marginTop:w[1]};return"rtl"===P?e.left=parseInt(w[0],10):e.right=-parseInt(w[0],10),Object.assign(Object.assign(Object.assign({},e),null==M?void 0:M.style),_)},[P,w,_,null==M?void 0:M.style]),G=null!=b?b:"string"==typeof K||"number"==typeof K?K:void 0,Q=V||!h?null:r.createElement("span",{className:`${T}-status-text`},h),J=K&&"object"==typeof K?(0,st.Ob)(K,e=>({style:Object.assign(Object.assign({},X),e.style)})):void 0,ee=(0,at.nP)(p,!1),te=x()(null==O?void 0:O.indicator,null===(n=null==M?void 0:M.classNames)||void 0===n?void 0:n.indicator,{[`${T}-status-dot`]:B,[`${T}-status-${f}`]:!!f,[`${T}-color-${p}`]:ee}),ne={};p&&!ee&&(ne.color=p,ne.background=p);const oe=x()(T,{[`${T}-status`]:B,[`${T}-not-a-wrapper`]:!u,[`${T}-rtl`]:"rtl"===P},E,k,null==M?void 0:M.className,null===(o=null==M?void 0:M.classNames)||void 0===o?void 0:o.root,null==O?void 0:O.root,I,R);if(!u&&B&&(h||$||!z)){const e=X.color;return L(r.createElement("span",Object.assign({},j,{className:oe,style:Object.assign(Object.assign(Object.assign({},null==S?void 0:S.root),null===(i=null==M?void 0:M.styles)||void 0===i?void 0:i.root),X)}),r.createElement("span",{className:te,style:Object.assign(Object.assign(Object.assign({},null==S?void 0:S.indicator),null===(a=null==M?void 0:M.styles)||void 0===a?void 0:a.indicator),ne)}),h&&r.createElement("span",{style:{color:e},className:`${T}-status-text`},h)))}return L(r.createElement("span",Object.assign({ref:t},j,{className:oe,style:Object.assign(Object.assign({},null===(s=null==M?void 0:M.styles)||void 0===s?void 0:s.root),null==S?void 0:S.root)}),u,r.createElement(C.Ay,{visible:!V,motionName:`${T}-zoom`,motionAppear:!1,motionDeadline:1e3},({className:e})=>{var t,n;const o=A("scroll-number",c),i=Y.current,a=x()(null==O?void 0:O.indicator,null===(t=null==M?void 0:M.classNames)||void 0===t?void 0:t.indicator,{[`${T}-dot`]:i,[`${T}-count`]:!i,[`${T}-count-sm`]:"small"===v,[`${T}-multiple-words`]:!i&&W&&W.toString().length>1,[`${T}-status-${f}`]:!!f,[`${T}-color-${p}`]:ee});let s=Object.assign(Object.assign(Object.assign({},null==S?void 0:S.indicator),null===(n=null==M?void 0:M.styles)||void 0===n?void 0:n.indicator),X);return p&&!ee&&(s=s||{},s.background=p),r.createElement(Et,{prefixCls:o,show:!V,motionClassName:e,className:a,count:W,title:G,style:s,key:"scrollNumber"},J)}),Q))}),Ot=kt;Ot.Ribbon=e=>{const{className:t,prefixCls:n,style:o,color:i,children:a,text:s,placement:l="end",rootClassName:c}=e,{getPrefixCls:u,direction:f}=r.useContext(d.QO),h=u("ribbon",n),p=`${h}-wrapper`,[g,y,m]=vt(h,p),v=(0,at.nP)(i,!1),b=x()(h,`${h}-placement-${l}`,{[`${h}-rtl`]:"rtl"===f,[`${h}-color-${i}`]:v},t),w={},_={};return i&&!v&&(w.background=i,_.color=i),g(r.createElement("div",{className:x()(p,c,y,m)},a,r.createElement("div",{className:x()(b,y),style:Object.assign(Object.assign({},w),o)},r.createElement("span",{className:`${h}-text`},s),r.createElement("div",{className:`${h}-corner`,style:_}))))};const St=Ot;var Ct=n(428),Nt=n(43960),jt=n(11721),At=n(16784),Pt=n(74353),Mt=n(45708),Tt=(0,r.createContext)({});function Lt(){return Lt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Lt.apply(null,arguments)}function It(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function Rt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t);else for(;!(l=(o=i.call(n)).done)&&(s.push(o.value),s.length!==t);l=!0);}catch(e){c=!0,r=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return It(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?It(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qt(e){return qt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qt(e)}function Dt(e,t,n){return(t=function(e){var t=function(e){if("object"!=qt(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=qt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==qt(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zt(e,t){if(null==e)return{};var n,o,r=function(e,t){if(null==e)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(-1!==t.indexOf(o))continue;n[o]=e[o]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Bt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $t,Ft={exports:{}};$t=Ft,function(){var e={}.hasOwnProperty;function t(){for(var e="",t=0;t<arguments.length;t++){var r=arguments[t];r&&(e=o(e,n(r)))}return e}function n(n){if("string"==typeof n||"number"==typeof n)return n;if("object"!=typeof n)return"";if(Array.isArray(n))return t.apply(null,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var r="";for(var i in n)e.call(n,i)&&n[i]&&(r=o(r,i));return r}function o(e,t){return t?e?e+" "+t:e+t:e}$t.exports?(t.default=t,$t.exports=t):window.classNames=t}();var Ht=Bt(Ft.exports);const Vt=Math.round;function Ut(e,t){const n=e.replace(/^[^(]*\((.*)/,"$1").replace(/\).*/,"").match(/\d*\.?\d+%?/g)||[],o=n.map(e=>parseFloat(e));for(let e=0;e<3;e+=1)o[e]=t(o[e]||0,n[e]||"",e);return n[3]?o[3]=n[3].includes("%")?o[3]/100:o[3]:o[3]=1,o}const Kt=(e,t,n)=>0===n?e:e/100;function Zt(e,t){const n=t||255;return e>n?n:e<0?0:e}class Wt{constructor(e){function t(t){return t[0]in e&&t[1]in e&&t[2]in e}if(Dt(this,"isValid",!0),Dt(this,"r",0),Dt(this,"g",0),Dt(this,"b",0),Dt(this,"a",1),Dt(this,"_h",void 0),Dt(this,"_s",void 0),Dt(this,"_l",void 0),Dt(this,"_v",void 0),Dt(this,"_max",void 0),Dt(this,"_min",void 0),Dt(this,"_brightness",void 0),e)if("string"==typeof e){const n=e.trim();function o(e){return n.startsWith(e)}/^#?[A-F\d]{3,8}$/i.test(n)?this.fromHexString(n):o("rgb")?this.fromRgbString(n):o("hsl")?this.fromHslString(n):(o("hsv")||o("hsb"))&&this.fromHsvString(n)}else if(e instanceof Wt)this.r=e.r,this.g=e.g,this.b=e.b,this.a=e.a,this._h=e._h,this._s=e._s,this._l=e._l,this._v=e._v;else if(t("rgb"))this.r=Zt(e.r),this.g=Zt(e.g),this.b=Zt(e.b),this.a="number"==typeof e.a?Zt(e.a,1):1;else if(t("hsl"))this.fromHsl(e);else{if(!t("hsv"))throw new Error("@ant-design/fast-color: unsupported input "+JSON.stringify(e));this.fromHsv(e)}}setR(e){return this._sc("r",e)}setG(e){return this._sc("g",e)}setB(e){return this._sc("b",e)}setA(e){return this._sc("a",e,1)}setHue(e){const t=this.toHsv();return t.h=e,this._c(t)}getLuminance(){function e(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}return.2126*e(this.r)+.7152*e(this.g)+.0722*e(this.b)}getHue(){if(void 0===this._h){const e=this.getMax()-this.getMin();this._h=0===e?0:Vt(60*(this.r===this.getMax()?(this.g-this.b)/e+(this.g<this.b?6:0):this.g===this.getMax()?(this.b-this.r)/e+2:(this.r-this.g)/e+4))}return this._h}getSaturation(){if(void 0===this._s){const e=this.getMax()-this.getMin();this._s=0===e?0:e/this.getMax()}return this._s}getLightness(){return void 0===this._l&&(this._l=(this.getMax()+this.getMin())/510),this._l}getValue(){return void 0===this._v&&(this._v=this.getMax()/255),this._v}getBrightness(){return void 0===this._brightness&&(this._brightness=(299*this.r+587*this.g+114*this.b)/1e3),this._brightness}darken(e=10){const t=this.getHue(),n=this.getSaturation();let o=this.getLightness()-e/100;return o<0&&(o=0),this._c({h:t,s:n,l:o,a:this.a})}lighten(e=10){const t=this.getHue(),n=this.getSaturation();let o=this.getLightness()+e/100;return o>1&&(o=1),this._c({h:t,s:n,l:o,a:this.a})}mix(e,t=50){const n=this._c(e),o=t/100,r=e=>(n[e]-this[e])*o+this[e],i={r:Vt(r("r")),g:Vt(r("g")),b:Vt(r("b")),a:Vt(100*r("a"))/100};return this._c(i)}tint(e=10){return this.mix({r:255,g:255,b:255,a:1},e)}shade(e=10){return this.mix({r:0,g:0,b:0,a:1},e)}onBackground(e){const t=this._c(e),n=this.a+t.a*(1-this.a),o=e=>Vt((this[e]*this.a+t[e]*t.a*(1-this.a))/n);return this._c({r:o("r"),g:o("g"),b:o("b"),a:n})}isDark(){return this.getBrightness()<128}isLight(){return this.getBrightness()>=128}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}clone(){return this._c(this)}toHexString(){let e="#";const t=(this.r||0).toString(16);e+=2===t.length?t:"0"+t;const n=(this.g||0).toString(16);e+=2===n.length?n:"0"+n;const o=(this.b||0).toString(16);if(e+=2===o.length?o:"0"+o,"number"==typeof this.a&&this.a>=0&&this.a<1){const t=Vt(255*this.a).toString(16);e+=2===t.length?t:"0"+t}return e}toHsl(){return{h:this.getHue(),s:this.getSaturation(),l:this.getLightness(),a:this.a}}toHslString(){const e=this.getHue(),t=Vt(100*this.getSaturation()),n=Vt(100*this.getLightness());return 1!==this.a?`hsla(${e},${t}%,${n}%,${this.a})`:`hsl(${e},${t}%,${n}%)`}toHsv(){return{h:this.getHue(),s:this.getSaturation(),v:this.getValue(),a:this.a}}toRgb(){return{r:this.r,g:this.g,b:this.b,a:this.a}}toRgbString(){return 1!==this.a?`rgba(${this.r},${this.g},${this.b},${this.a})`:`rgb(${this.r},${this.g},${this.b})`}toString(){return this.toRgbString()}_sc(e,t,n){const o=this.clone();return o[e]=Zt(t,n),o}_c(e){return new this.constructor(e)}getMax(){return void 0===this._max&&(this._max=Math.max(this.r,this.g,this.b)),this._max}getMin(){return void 0===this._min&&(this._min=Math.min(this.r,this.g,this.b)),this._min}fromHexString(e){const t=e.replace("#","");function n(e,n){return parseInt(t[e]+t[n||e],16)}t.length<6?(this.r=n(0),this.g=n(1),this.b=n(2),this.a=t[3]?n(3)/255:1):(this.r=n(0,1),this.g=n(2,3),this.b=n(4,5),this.a=t[6]?n(6,7)/255:1)}fromHsl({h:e,s:t,l:n,a:o}){if(this._h=e%360,this._s=t,this._l=n,this.a="number"==typeof o?o:1,t<=0){const e=Vt(255*n);this.r=e,this.g=e,this.b=e}let r=0,i=0,a=0;const s=e/60,l=(1-Math.abs(2*n-1))*t,c=l*(1-Math.abs(s%2-1));s>=0&&s<1?(r=l,i=c):s>=1&&s<2?(r=c,i=l):s>=2&&s<3?(i=l,a=c):s>=3&&s<4?(i=c,a=l):s>=4&&s<5?(r=c,a=l):s>=5&&s<6&&(r=l,a=c);const u=n-l/2;this.r=Vt(255*(r+u)),this.g=Vt(255*(i+u)),this.b=Vt(255*(a+u))}fromHsv({h:e,s:t,v:n,a:o}){this._h=e%360,this._s=t,this._v=n,this.a="number"==typeof o?o:1;const r=Vt(255*n);if(this.r=r,this.g=r,this.b=r,t<=0)return;const i=e/60,a=Math.floor(i),s=i-a,l=Vt(n*(1-t)*255),c=Vt(n*(1-t*s)*255),u=Vt(n*(1-t*(1-s))*255);switch(a){case 0:this.g=u,this.b=l;break;case 1:this.r=c,this.b=l;break;case 2:this.r=l,this.b=u;break;case 3:this.r=l,this.g=c;break;case 4:this.r=u,this.g=l;break;default:this.g=l,this.b=c}}fromHsvString(e){const t=Ut(e,Kt);this.fromHsv({h:t[0],s:t[1],v:t[2],a:t[3]})}fromHslString(e){const t=Ut(e,Kt);this.fromHsl({h:t[0],s:t[1],l:t[2],a:t[3]})}fromRgbString(e){const t=Ut(e,(e,t)=>t.includes("%")?Vt(e/100*255):e);this.r=t[0],this.g=t[1],this.b=t[2],this.a=t[3]}}var Yt=[{index:7,amount:15},{index:6,amount:25},{index:5,amount:30},{index:5,amount:45},{index:5,amount:65},{index:5,amount:85},{index:4,amount:90},{index:3,amount:95},{index:2,amount:97},{index:1,amount:98}];function Xt(e,t,n){var o;return(o=Math.round(e.h)>=60&&Math.round(e.h)<=240?n?Math.round(e.h)-2*t:Math.round(e.h)+2*t:n?Math.round(e.h)+2*t:Math.round(e.h)-2*t)<0?o+=360:o>=360&&(o-=360),o}function Gt(e,t,n){return 0===e.h&&0===e.s?e.s:((o=n?e.s-.16*t:4===t?e.s+.16:e.s+.05*t)>1&&(o=1),n&&5===t&&o>.1&&(o=.1),o<.06&&(o=.06),Math.round(100*o)/100);var o}function Qt(e,t,n){var o;return o=n?e.v+.05*t:e.v-.15*t,o=Math.max(0,Math.min(1,o)),Math.round(100*o)/100}var Jt=["#e6f4ff","#bae0ff","#91caff","#69b1ff","#4096ff","#1677ff","#0958d9","#003eb3","#002c8c","#001d66"];function en(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,o)}return n}function tn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?en(Object(n),!0).forEach(function(t){Dt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):en(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}Jt.primary=Jt[5];var nn="data-rc-order",on="data-rc-priority",rn=new Map;function an(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).mark;return e?e.startsWith("data-")?e:"data-".concat(e):"rc-util-key"}function sn(e){return e.attachTo?e.attachTo:document.querySelector("head")||document.body}function ln(e){return Array.from((rn.get(e)||e).children).filter(function(e){return"STYLE"===e.tagName})}function cn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("undefined"==typeof window||!window.document||!window.document.createElement)return null;var n=t.csp,o=t.prepend,r=t.priority,i=void 0===r?0:r,a=function(e){return"queue"===e?"prependQueue":e?"prepend":"append"}(o),s="prependQueue"===a,l=document.createElement("style");l.setAttribute(nn,a),s&&i&&l.setAttribute(on,"".concat(i)),null!=n&&n.nonce&&(l.nonce=null==n?void 0:n.nonce),l.innerHTML=e;var c=sn(t),u=c.firstChild;if(o){if(s){var d=(t.styles||ln(c)).filter(function(e){if(!["prepend","prependQueue"].includes(e.getAttribute(nn)))return!1;var t=Number(e.getAttribute(on)||0);return i>=t});if(d.length)return c.insertBefore(l,d[d.length-1].nextSibling),l}c.insertBefore(l,u)}else c.appendChild(l);return l}function un(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}var dn={},fn=[];function hn(e,t){}function pn(e,t){}function gn(e,t,n){t||dn[n]||(e(!1,n),dn[n]=!0)}function yn(e,t){gn(hn,e,t)}function mn(e){return"object"===qt(e)&&"string"==typeof e.name&&"string"==typeof e.theme&&("object"===qt(e.icon)||"function"==typeof e.icon)}function vn(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.keys(e).reduce(function(t,n){var o,r=e[n];return"class"===n?(t.className=r,delete t.class):(delete t[n],t[(o=n,o.replace(/-(.)/g,function(e,t){return t.toUpperCase()}))]=r),t},{})}function bn(e,t,n){return n?r.createElement(e.tag,tn(tn({key:t},vn(e.attrs)),n),(e.children||[]).map(function(n,o){return bn(n,"".concat(t,"-").concat(e.tag,"-").concat(o))})):r.createElement(e.tag,tn({key:t},vn(e.attrs)),(e.children||[]).map(function(n,o){return bn(n,"".concat(t,"-").concat(e.tag,"-").concat(o))}))}function xn(e){return function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[],o=new Wt(e),r=o.toHsv(),i=5;i>0;i-=1){var a=new Wt({h:Xt(r,i,!0),s:Gt(r,i,!0),v:Qt(r,i,!0)});n.push(a)}n.push(o);for(var s=1;s<=4;s+=1){var l=new Wt({h:Xt(r,s),s:Gt(r,s),v:Qt(r,s)});n.push(l)}return"dark"===t.theme?Yt.map(function(e){var o=e.index,r=e.amount;return new Wt(t.backgroundColor||"#141414").mix(n[o],r).toHexString()}):n.map(function(e){return e.toHexString()})}(e)[0]}function wn(e){return e?Array.isArray(e)?e:[e]:[]}yn.preMessage=function(e){fn.push(e)},yn.resetWarned=function(){dn={}},yn.noteOnce=function(e,t){gn(pn,e,t)};var En=["icon","className","onClick","style","primaryColor","secondaryColor"],kn={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1},On=function(e){var t,n,o,i,a,s,l=e.icon,c=e.className,u=e.onClick,d=e.style,f=e.primaryColor,h=e.secondaryColor,p=zt(e,En),g=r.useRef(),y=kn;if(f&&(y={primaryColor:f,secondaryColor:h||xn(f)}),t=g,n=(0,r.useContext)(Tt),o=n.csp,i=n.prefixCls,a=n.layer,s="\n.anticon {\n display: inline-flex;\n align-items: center;\n color: inherit;\n font-style: normal;\n line-height: 0;\n text-align: center;\n text-transform: none;\n vertical-align: -0.125em;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n.anticon > * {\n line-height: 1;\n}\n\n.anticon svg {\n display: inline-block;\n}\n\n.anticon::before {\n display: none;\n}\n\n.anticon .anticon-icon {\n display: block;\n}\n\n.anticon[tabindex] {\n cursor: pointer;\n}\n\n.anticon-spin::before,\n.anticon-spin {\n display: inline-block;\n -webkit-animation: loadingCircle 1s infinite linear;\n animation: loadingCircle 1s infinite linear;\n}\n\n@-webkit-keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n",i&&(s=s.replace(/anticon/g,i)),a&&(s="@layer ".concat(a," {\n").concat(s,"\n}")),(0,r.useEffect)(function(){var e=function(e){return function(e){return un(e)instanceof ShadowRoot}(e)?un(e):null}(t.current);!function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=sn(n),r=ln(o),i=tn(tn({},n),{},{styles:r});!function(e,t){var n=rn.get(e);if(!n||!function(e,t){if(!e)return!1;if(e.contains)return e.contains(t);for(var n=t;n;){if(n===e)return!0;n=n.parentNode}return!1}(document,n)){var o=cn("",t),r=o.parentNode;rn.set(e,r),e.removeChild(o)}}(o,i);var a,s,l,c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=sn(t);return(t.styles||ln(n)).find(function(n){return n.getAttribute(an(t))===e})}(t,i);if(c)return null!==(a=i.csp)&&void 0!==a&&a.nonce&&c.nonce!==(null===(s=i.csp)||void 0===s?void 0:s.nonce)&&(c.nonce=null===(l=i.csp)||void 0===l?void 0:l.nonce),c.innerHTML!==e&&(c.innerHTML=e),c;cn(e,i).setAttribute(an(i),t)}(s,"@ant-design-icons",{prepend:!a,csp:o,attachTo:e})},[]),function(e,t){yn(e,"[@ant-design/icons] ".concat(t))}(mn(l),"icon should be icon definiton, but got ".concat(l)),!mn(l))return null;var m=l;return m&&"function"==typeof m.icon&&(m=tn(tn({},m),{},{icon:m.icon(y.primaryColor,y.secondaryColor)})),bn(m.icon,"svg-".concat(m.name),tn(tn({className:c,onClick:u,style:d,"data-icon":m.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},p),{},{ref:g}))};function Sn(e){var t=Rt(wn(e),2),n=t[0],o=t[1];return On.setTwoToneColors({primaryColor:n,secondaryColor:o})}On.displayName="IconReact",On.getTwoToneColors=function(){return tn({},kn)},On.setTwoToneColors=function(e){var t=e.primaryColor,n=e.secondaryColor;kn.primaryColor=t,kn.secondaryColor=n||xn(t),kn.calculated=!!n};var Cn=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];Sn(Jt.primary);var Nn=r.forwardRef(function(e,t){var n=e.className,o=e.icon,i=e.spin,a=e.rotate,s=e.tabIndex,l=e.onClick,c=e.twoToneColor,u=zt(e,Cn),d=r.useContext(Tt),f=d.prefixCls,h=void 0===f?"anticon":f,p=d.rootClassName,g=Ht(p,h,Dt(Dt({},"".concat(h,"-").concat(o.name),!!o.name),"".concat(h,"-spin"),!!i||"loading"===o.name),n),y=s;void 0===y&&l&&(y=-1);var m=a?{msTransform:"rotate(".concat(a,"deg)"),transform:"rotate(".concat(a,"deg)")}:void 0,v=Rt(wn(c),2),b=v[0],x=v[1];return r.createElement("span",Lt({role:"img","aria-label":o.name},u,{ref:t,tabIndex:y,onClick:l,className:g}),r.createElement(On,{icon:o,primaryColor:b,secondaryColor:x,style:m}))});Nn.displayName="AntdIcon",Nn.getTwoToneColor=function(){var e=On.getTwoToneColors();return e.calculated?[e.primaryColor,e.secondaryColor]:e.primaryColor},Nn.setTwoToneColor=Sn;var jn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M908 640H804V488c0-4.4-3.6-8-8-8H548v-96h108c8.8 0 16-7.2 16-16V80c0-8.8-7.2-16-16-16H368c-8.8 0-16 7.2-16 16v288c0 8.8 7.2 16 16 16h108v96H228c-4.4 0-8 3.6-8 8v152H116c-8.8 0-16 7.2-16 16v288c0 8.8 7.2 16 16 16h288c8.8 0 16-7.2 16-16V656c0-8.8-7.2-16-16-16H292v-88h440v88H620c-8.8 0-16 7.2-16 16v288c0 8.8 7.2 16 16 16h288c8.8 0 16-7.2 16-16V656c0-8.8-7.2-16-16-16zm-564 76v168H176V716h168zm84-408V140h168v168H428zm420 576H680V716h168v168z"}}]},name:"apartment",theme:"outlined"},An=r.forwardRef(function(e,t){return r.createElement(Nn,Lt({},e,{ref:t,icon:jn}))}),Pn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M816 768h-24V428c0-141.1-104.3-257.7-240-277.1V112c0-22.1-17.9-40-40-40s-40 17.9-40 40v38.9c-135.7 19.4-240 136-240 277.1v340h-24c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h216c0 61.8 50.2 112 112 112s112-50.2 112-112h216c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM512 888c-26.5 0-48-21.5-48-48h96c0 26.5-21.5 48-48 48zM304 768V428c0-55.6 21.6-107.8 60.9-147.1S456.4 220 512 220c55.6 0 107.8 21.6 147.1 60.9S720 372.4 720 428v340H304z"}}]},name:"bell",theme:"outlined"},Mn=r.forwardRef(function(e,t){return r.createElement(Nn,Lt({},e,{ref:t,icon:Pn}))}),Tn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"}}]},name:"check-circle",theme:"filled"},Ln=r.forwardRef(function(e,t){return r.createElement(Nn,Lt({},e,{ref:t,icon:Tn}))}),In={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M686.7 638.6L544.1 535.5V288c0-4.4-3.6-8-8-8H488c-4.4 0-8 3.6-8 8v275.4c0 2.6 1.2 5 3.3 6.5l165.4 120.6c3.6 2.6 8.6 1.8 11.2-1.7l28.6-39c2.6-3.7 1.8-8.7-1.8-11.2z"}}]},name:"clock-circle",theme:"outlined"},Rn=r.forwardRef(function(e,t){return r.createElement(Nn,Lt({},e,{ref:t,icon:In}))}),qn={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z"}}]},name:"close",theme:"outlined"},Dn=r.forwardRef(function(e,t){return r.createElement(Nn,Lt({},e,{ref:t,icon:qn}))}),zn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"}}]},name:"copy",theme:"outlined"},Bn=r.forwardRef(function(e,t){return r.createElement(Nn,Lt({},e,{ref:t,icon:zn}))}),$n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"},Fn=r.forwardRef(function(e,t){return r.createElement(Nn,Lt({},e,{ref:t,icon:$n}))}),Hn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M257.7 752c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 000-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 009.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9zm67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z"}}]},name:"edit",theme:"outlined"},Vn=r.forwardRef(function(e,t){return r.createElement(Nn,Lt({},e,{ref:t,icon:Hn}))}),Un={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"exclamation-circle",theme:"filled"},Kn=r.forwardRef(function(e,t){return r.createElement(Nn,Lt({},e,{ref:t,icon:Un}))}),Zn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 305H624V192c0-17.7-14.3-32-32-32H184v-40c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v784c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V640h248v113c0 17.7 14.3 32 32 32h416c17.7 0 32-14.3 32-32V337c0-17.7-14.3-32-32-32zM184 568V232h368v336H184zm656 145H504v-73h112c4.4 0 8-3.6 8-8V377h216v336z"}}]},name:"flag",theme:"outlined"},Wn=r.forwardRef(function(e,t){return r.createElement(Nn,Lt({},e,{ref:t,icon:Zn}))}),Yn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M904 512h-56c-4.4 0-8 3.6-8 8v320H184V184h320c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V520c0-4.4-3.6-8-8-8z"}},{tag:"path",attrs:{d:"M355.9 534.9L354 653.8c-.1 8.9 7.1 16.2 16 16.2h.4l118-2.9c2-.1 4-.9 5.4-2.3l415.9-415c3.1-3.1 3.1-8.2 0-11.3L785.4 114.3c-1.6-1.6-3.6-2.3-5.7-2.3s-4.1.8-5.7 2.3l-415.8 415a8.3 8.3 0 00-2.3 5.6zm63.5 23.6L779.7 199l45.2 45.1-360.5 359.7-45.7 1.1.7-46.4z"}}]},name:"form",theme:"outlined"},Xn=r.forwardRef(function(e,t){return r.createElement(Nn,Lt({},e,{ref:t,icon:Yn}))}),Gn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"}}]},name:"info-circle",theme:"outlined"},Qn=r.forwardRef(function(e,t){return r.createElement(Nn,Lt({},e,{ref:t,icon:Gn}))}),Jn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"}}]},name:"left",theme:"outlined"},eo=r.forwardRef(function(e,t){return r.createElement(Nn,Lt({},e,{ref:t,icon:Jn}))}),to={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 110.8V792H136V270.8l-27.6-21.5 39.3-50.5 42.8 33.3h643.1l42.8-33.3 39.3 50.5-27.7 21.5zM833.6 232L512 482 190.4 232l-42.8-33.3-39.3 50.5 27.6 21.5 341.6 265.6a55.99 55.99 0 0068.7 0L888 270.8l27.6-21.5-39.3-50.5-42.7 33.2z"}}]},name:"mail",theme:"outlined"},no=r.forwardRef(function(e,t){return r.createElement(Nn,Lt({},e,{ref:t,icon:to}))}),oo={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M456 231a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"more",theme:"outlined"},ro=r.forwardRef(function(e,t){return r.createElement(Nn,Lt({},e,{ref:t,icon:oo}))}),io={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}},{tag:"path",attrs:{d:"M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8z"}}]},name:"plus",theme:"outlined"},ao=r.forwardRef(function(e,t){return r.createElement(Nn,Lt({},e,{ref:t,icon:io}))}),so={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M623.6 316.7C593.6 290.4 554 276 512 276s-81.6 14.5-111.6 40.7C369.2 344 352 380.7 352 420v7.6c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V420c0-44.1 43.1-80 96-80s96 35.9 96 80c0 31.1-22 59.6-56.1 72.7-21.2 8.1-39.2 22.3-52.1 40.9-13.1 19-19.9 41.8-19.9 64.9V620c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-22.7a48.3 48.3 0 0130.9-44.8c59-22.7 97.1-74.7 97.1-132.5.1-39.3-17.1-76-48.3-103.3zM472 732a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"question-circle",theme:"outlined"},lo=r.forwardRef(function(e,t){return r.createElement(Nn,Lt({},e,{ref:t,icon:so}))});class co{constructor({baseUrl:e,pluginSlug:t="poptics",apiVersion:n="v1",nonce:o=""}){this.baseUrl=e,this.pluginSlug=t,this.apiVersion=n,this.nonce=o}getApiUrl(e){return`${this.baseUrl}/wp-json/${this.pluginSlug}/${this.apiVersion}/${e}`}async fetchWithAuth(e,t={}){const n=this.getApiUrl(e),o={"Content-Type":"application/json",...this.nonce?{"X-WP-Nonce":this.nonce}:{},...t.headers},r=await fetch(n,{...t,headers:o});if(!r.ok){const e=await r.text();throw new Error(`API Error (${r.status}): ${e}`)}return r.json()}async getAllFlows(){return this.fetchWithAuth("poptics-notification-flow")}async getFlowById(e){return this.fetchWithAuth(`notification-flow/${e}`)}async updateFlow(e,t){return this.fetchWithAuth(`notification-flow/${e}`,{method:"PUT",body:JSON.stringify(t)})}async createFlow(e){return this.fetchWithAuth("notification-flow",{method:"POST",body:JSON.stringify(e)})}async deleteFlow(e){return this.fetchWithAuth(`notification-flow/${e}`,{method:"DELETE"})}async bulkDeleteFlow(e){return this.fetchWithAuth("notification-flow",{method:"DELETE",body:JSON.stringify(e)})}async cloneFlow(e){return this.fetchWithAuth(`notification-flow/${e}/clone`,{method:"POST"})}async getFilteredFlows(e){const t=new URLSearchParams;e.trigger&&t.append("trigger",e.trigger),e.status&&t.append("status",e.status),e.searchKey&&t.append("search_key",e.searchKey);const n=t.toString(),o="notification-flow"+(n?`?${n}`:"");return this.fetchWithAuth(o)}}let uo={prefix:"pt"};const fo=e=>{uo={...uo,...e}},ho=()=>{return{...uo,prefix:(e=uo.prefix,`${e}_ens_data`)};var e},po={poptics_ens_data:{nonce:"a8ad90e706",api_version:"v1",plugin_slug:"poptics",base_url:"http://poptics-demo.local",triggers:[{trigger_label:"Order Completed",trigger_value:"order_completed",trigger_data:[{label:"Order Amount",value:"order_amount",type:"number"},{label:"Order Status",value:"order_status",type:"string"},{label:"Order Date",value:"order_date",type:"date"},{label:"email",value:"email",type:"string"}],delay_dependencies:[{label:"Order Date",value:"order_date"},{label:"Event Date",value:"event_date"}],email_receivers:[{label:"User Email",value:"user_email"},{label:"Admin Email",value:"admin_email"}]},{trigger_label:"Event Created",trigger_value:"event_created",trigger_data:[{label:"Purchase Price",value:"purchase_price",type:"number"},{label:"Purchase Status",value:"purchase_status",type:"string"},{label:"Purchase Date",value:"purchase_date",type:"date"},{label:"email",value:"email",type:"string"}],delay_dependencies:[{label:"Order Date",value:"order_date"}],email_receivers:[{label:"User Email",value:"user_email"},{label:"Admin Email",value:"admin_email"}]}]}},go=[{label:"Send Email",value:"send_email"},{label:"Add Delay",value:"add_delay"}],yo={send_email:{label:"Send Email",formFields:[{name:"receiverType",label:"Receiver Type",component:a.A,required:!0,props:{style:{width:"100%"},options:[],placeholder:"Select user type",getPopupContainer:e=>e.parentNode},rules:[{required:!0,message:"Please select a user type"}]},{name:"from_address",label:"From Address",component:s.A,required:!1,props:{style:{width:"100%"},placeholder:"Enter from address",type:"email"},rules:[{required:!1,type:"email",message:"Please enter a valid email address"}]},{name:"subject",label:"Email Subject",component:s.A,required:!0,props:{style:{width:"100%"},placeholder:"Enter email subject"},rules:[{required:!0,message:"Please enter email subject"}]},{name:"body",label:"Email Body",component:"richText",required:!0,props:{style:{height:"200px"},modules:{toolbar:[[{header:[1,2,3,4,5,6,!1]}],["bold","italic","underline","strike","blockquote"],[{list:"ordered"},{list:"bullet"}],[{color:[]},{background:[]}],["link","image"],["clean"]]}},rules:[{required:!0,message:"Please enter email content"}]}]},add_delay:{label:"Add Delay",formFields:[{name:"delay",label:"Wait Time",component:l.A,required:!0,props:{style:{width:"100%"},min:0,placeholder:"Delay amount in number"},rules:[{required:!0,message:"Please enter delay amount"}]},{name:"delayUnit",label:"Wait Time Unit",component:a.A,required:!0,props:{style:{width:"100%"},options:[{value:"minutes",label:"Minutes"},{value:"hours",label:"Hours"},{value:"days",label:"Days"},{value:"weeks",label:"Weeks"}],placeholder:"Select time unit",getPopupContainer:e=>e.parentNode},rules:[{required:!0,message:"Please select a time unit"}]},{name:"delayCondition",label:"Delay condition",component:a.A,required:!1,tooltip:{title:"Select when the delay should be calculated from. This determines the reference point for your wait time.",icon:"info",placement:"topRight"},props:{style:{width:"100%"},options:[{value:"order_date ",label:"Order Date"}],placeholder:"Select delay condition",getPopupContainer:e=>e.parentNode}}]}},mo=[{label:"Equal to (=)",value:"equal"},{label:"Not equal to (≠)",value:"not_equal"},{label:"Greater than (>)",value:"greater_then"},{label:"Greater than or equal to (≥)",value:"greater_equal"},{label:"Less than (<)",value:"less_then"},{label:"Less than or equal to (≤)",value:"less_equal"}],vo=[{label:"Equal to (=)",value:"equal"},{label:"Not equal to (≠)",value:"not_equal"}],bo=[{label:"Equal to (=)",value:"equal"},{label:"Not equal to (≠)",value:"not_equal"},{label:"Before (<)",value:"before"},{label:"After (>)",value:"after"}],xo=()=>{const{prefix:e}=ho(),{api_version:t="",base_url:n="",plugin_slug:o="",nonce:i=""}="undefined"!=typeof window&&window[e]?window[e]:po.poptics_ens_data,a=new co({baseUrl:n,apiVersion:t,pluginSlug:o,nonce:i}),[s,l]=(0,r.useState)({}),[c,u]=(0,r.useState)(),[d,f]=(0,r.useState)([]),[h,p]=(0,r.useState)({trigger:"",status:"",searchKey:""});(0,r.useEffect)(()=>{ve.config({top:32,duration:3})},[]);const g=e=>{l(t=>({...t,[e]:!0}))},y=e=>{l(t=>({...t,[e]:!1}))},m=e=>!!s[e],v=(0,r.useCallback)(async e=>{var t,n,o;g("listFlows");const r=e||h;try{const{data:e}=await a.getFilteredFlows(r);return f((null==e?void 0:e.items)||[]),u({draft:(null===(t=null==e?void 0:e.status_count)||void 0===t?void 0:t.draft)||0,trash:(null===(n=null==e?void 0:e.status_count)||void 0===n?void 0:n.trash)||0,publish:(null===(o=null==e?void 0:e.status_count)||void 0===o?void 0:o.publish)||0}),{data:e}}catch(e){return console.error("Error fetching flows:",e),ve.error("Failed to load flows"),{error:e}}finally{y("listFlows")}},[a,h]),b=(0,r.useCallback)(async e=>{g("getFlow");try{return await a.getFlowById(e)}catch(e){return console.error("Error fetching flow:",e),ve.error("Failed to load flow"),{error:e}}finally{y("getFlow")}},[a]),x=(0,r.useCallback)(async(e,t,n=!1)=>{g("updateFlow");try{await a.updateFlow(e,t),ve.success("Flow updated successfully"),n&&await v()}catch(e){return console.error("Error updating flow:",e),ve.error("Failed to update flow"),{error:e}}finally{y("updateFlow")}},[a]),w=(0,r.useCallback)(async e=>{g("deleteFlow");try{await a.deleteFlow(e),ve.success("Flow deleted successfully"),await v()}catch(e){ve.error("Failed to delete flow: "+(e instanceof Error?e.message:"Unknown error")),console.error("Error deleting flow:",e)}finally{y("deleteFlow")}},[v]),_=(0,r.useCallback)(async e=>{g("cloneFlow");try{await a.cloneFlow(e),await v(),ve.success("Flow cloned successfully")}catch(e){ve.error("Failed to clone flow: "+(e instanceof Error?e.message:"Unknown error")),console.error("Error cloning flow:",e)}finally{y("cloneFlow")}},[v]),E=(0,r.useCallback)(async e=>{g("createFlow");try{const t=await a.createFlow(e);return ve.success("Flow created successfully"),await v(),null==t?void 0:t.data}catch(e){ve.error("Failed to create flow: "+(e instanceof Error?e.message:"Unknown error")),console.error("Error creating flow:",e)}finally{y("createFlow")}},[v]),k=(0,r.useCallback)(async e=>{g("bulkDelete");try{await a.bulkDeleteFlow(e),ve.success(`${e.length} flows deleted successfully`),await v()}catch(e){ve.error("Failed to delete flows: "+(e instanceof Error?e.message:"Unknown error")),console.error("Error bulk deleting flows:",e)}finally{y("bulkDelete")}},[v]),O=(0,r.useCallback)(e=>{p(t=>{const n={...t,...e};return setTimeout(()=>{v(n)},0),n})},[v]),S=(0,r.useCallback)(e=>{O({searchKey:e})},[O]),C=(0,r.useCallback)(e=>{O({status:e})},[O]),N=(0,r.useCallback)(e=>{O({trigger:e})},[O]);return{notificationFlows:d,fetchFlows:v,editFlow:x,cloneFlow:_,createFlow:E,getFlowById:b,deleteFlow:w,bulkDeleteFlows:k,refresh:v,statusCount:c,isFlowListLoading:()=>m("listFlows"),isFlowLoading:()=>m("getFlow"),isFlowSaving:()=>m("updateFlow"),isFlowDeleting:()=>m("deleteFlow"),isFlowCloning:()=>m("cloneFlow"),isFlowCreating:()=>m("createFlow"),isFlowBulkDeleting:()=>m("bulkDelete"),filterFlows:O,searchFlows:S,filterByStatus:C,filterByTrigger:N,currentFilters:h}};function wo(e){if("string"==typeof e||"number"==typeof e)return""+e;let t="";if(Array.isArray(e))for(let n,o=0;o<e.length;o++)""!==(n=wo(e[o]))&&(t+=(t&&" ")+n);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var _o={value:()=>{}};function Eo(){for(var e,t=0,n=arguments.length,o={};t<n;++t){if(!(e=arguments[t]+"")||e in o||/[\s.]/.test(e))throw new Error("illegal type: "+e);o[e]=[]}return new ko(o)}function ko(e){this._=e}function Oo(e,t){for(var n,o=0,r=e.length;o<r;++o)if((n=e[o]).name===t)return n.value}function So(e,t,n){for(var o=0,r=e.length;o<r;++o)if(e[o].name===t){e[o]=_o,e=e.slice(0,o).concat(e.slice(o+1));break}return null!=n&&e.push({name:t,value:n}),e}ko.prototype=Eo.prototype={constructor:ko,on:function(e,t){var n,o,r=this._,i=(o=r,(e+"").trim().split(/^|\s+/).map(function(e){var t="",n=e.indexOf(".");if(n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),e&&!o.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:t}})),a=-1,s=i.length;if(!(arguments.length<2)){if(null!=t&&"function"!=typeof t)throw new Error("invalid callback: "+t);for(;++a<s;)if(n=(e=i[a]).type)r[n]=So(r[n],e.name,t);else if(null==t)for(n in r)r[n]=So(r[n],e.name,null);return this}for(;++a<s;)if((n=(e=i[a]).type)&&(n=Oo(r[n],e.name)))return n},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new ko(e)},call:function(e,t){if((n=arguments.length-2)>0)for(var n,o,r=new Array(n),i=0;i<n;++i)r[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=0,n=(o=this._[e]).length;i<n;++i)o[i].value.apply(t,r)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var o=this._[e],r=0,i=o.length;r<i;++r)o[r].value.apply(t,n)}};var Co="http://www.w3.org/1999/xhtml",No={svg:"http://www.w3.org/2000/svg",xhtml:Co,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function jo(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),No.hasOwnProperty(t)?{space:No[t],local:e}:e}function Ao(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Co&&t.documentElement.namespaceURI===Co?t.createElement(e):t.createElementNS(n,e)}}function Po(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Mo(e){var t=jo(e);return(t.local?Po:Ao)(t)}function To(){}function Lo(e){return null==e?To:function(){return this.querySelector(e)}}function Io(){return[]}function Ro(e){return null==e?Io:function(){return this.querySelectorAll(e)}}function qo(e){return function(){return this.matches(e)}}function Do(e){return function(t){return t.matches(e)}}var zo=Array.prototype.find;function Bo(){return this.firstElementChild}var $o=Array.prototype.filter;function Fo(){return Array.from(this.children)}function Ho(e){return new Array(e.length)}function Vo(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function Uo(e,t,n,o,r,i){for(var a,s=0,l=t.length,c=i.length;s<c;++s)(a=t[s])?(a.__data__=i[s],o[s]=a):n[s]=new Vo(e,i[s]);for(;s<l;++s)(a=t[s])&&(r[s]=a)}function Ko(e,t,n,o,r,i,a){var s,l,c,u=new Map,d=t.length,f=i.length,h=new Array(d);for(s=0;s<d;++s)(l=t[s])&&(h[s]=c=a.call(l,l.__data__,s,t)+"",u.has(c)?r[s]=l:u.set(c,l));for(s=0;s<f;++s)c=a.call(e,i[s],s,i)+"",(l=u.get(c))?(o[s]=l,l.__data__=i[s],u.delete(c)):n[s]=new Vo(e,i[s]);for(s=0;s<d;++s)(l=t[s])&&u.get(h[s])===l&&(r[s]=l)}function Zo(e){return e.__data__}function Wo(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function Yo(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Xo(e){return function(){this.removeAttribute(e)}}function Go(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Qo(e,t){return function(){this.setAttribute(e,t)}}function _n(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Jo(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}function er(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function tr(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function nr(e){return function(){this.style.removeProperty(e)}}function or(e,t,n){return function(){this.style.setProperty(e,t,n)}}function rr(e,t,n){return function(){var o=t.apply(this,arguments);null==o?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function ir(e,t){return e.style.getPropertyValue(t)||tr(e).getComputedStyle(e,null).getPropertyValue(t)}function ar(e){return function(){delete this[e]}}function sr(e,t){return function(){this[e]=t}}function lr(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}function cr(e){return e.trim().split(/^|\s+/)}function ur(e){return e.classList||new dr(e)}function dr(e){this._node=e,this._names=cr(e.getAttribute("class")||"")}function fr(e,t){for(var n=ur(e),o=-1,r=t.length;++o<r;)n.add(t[o])}function hr(e,t){for(var n=ur(e),o=-1,r=t.length;++o<r;)n.remove(t[o])}function pr(e){return function(){fr(this,e)}}function gr(e){return function(){hr(this,e)}}function yr(e,t){return function(){(t.apply(this,arguments)?fr:hr)(this,e)}}function mr(){this.textContent=""}function vr(e){return function(){this.textContent=e}}function br(e){return function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}}function xr(){this.innerHTML=""}function wr(e){return function(){this.innerHTML=e}}function _r(e){return function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}}function Er(){this.nextSibling&&this.parentNode.appendChild(this)}function kr(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Or(){return null}function Sr(){var e=this.parentNode;e&&e.removeChild(this)}function Cr(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Nr(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function jr(e){return function(){var t=this.__on;if(t){for(var n,o=0,r=-1,i=t.length;o<i;++o)n=t[o],e.type&&n.type!==e.type||n.name!==e.name?t[++r]=n:this.removeEventListener(n.type,n.listener,n.options);++r?t.length=r:delete this.__on}}}function Ar(e,t,n){return function(){var o,r=this.__on,i=function(e){return function(t){e.call(this,t,this.__data__)}}(t);if(r)for(var a=0,s=r.length;a<s;++a)if((o=r[a]).type===e.type&&o.name===e.name)return this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=i,o.options=n),void(o.value=t);this.addEventListener(e.type,i,n),o={type:e.type,name:e.name,value:t,listener:i,options:n},r?r.push(o):this.__on=[o]}}function Pr(e,t,n){var o=tr(e),r=o.CustomEvent;"function"==typeof r?r=new r(t,n):(r=o.document.createEvent("Event"),n?(r.initEvent(t,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(t,!1,!1)),e.dispatchEvent(r)}function Mr(e,t){return function(){return Pr(this,e,t)}}function Tr(e,t){return function(){return Pr(this,e,t.apply(this,arguments))}}Vo.prototype={constructor:Vo,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}},dr.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};var Lr=[null];function Ir(e,t){this._groups=e,this._parents=t}function Rr(){return new Ir([[document.documentElement]],Lr)}function qr(e){return"string"==typeof e?new Ir([[document.querySelector(e)]],[document.documentElement]):new Ir([[e]],Lr)}function Dr(e,t){if(e=function(e){let t;for(;t=e.sourceEvent;)e=t;return e}(e),void 0===t&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=e.clientX,o.y=e.clientY,[(o=o.matrixTransform(t.getScreenCTM().inverse())).x,o.y]}if(t.getBoundingClientRect){var r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]}}return[e.pageX,e.pageY]}Ir.prototype=Rr.prototype={constructor:Ir,select:function(e){"function"!=typeof e&&(e=Lo(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i,a,s=t[r],l=s.length,c=o[r]=new Array(l),u=0;u<l;++u)(i=s[u])&&(a=e.call(i,i.__data__,u,s))&&("__data__"in i&&(a.__data__=i.__data__),c[u]=a);return new Ir(o,this._parents)},selectAll:function(e){e="function"==typeof e?function(e){return function(){return null==(t=e.apply(this,arguments))?[]:Array.isArray(t)?t:Array.from(t);var t}}(e):Ro(e);for(var t=this._groups,n=t.length,o=[],r=[],i=0;i<n;++i)for(var a,s=t[i],l=s.length,c=0;c<l;++c)(a=s[c])&&(o.push(e.call(a,a.__data__,c,s)),r.push(a));return new Ir(o,r)},selectChild:function(e){return this.select(null==e?Bo:function(e){return function(){return zo.call(this.children,e)}}("function"==typeof e?e:Do(e)))},selectChildren:function(e){return this.selectAll(null==e?Fo:function(e){return function(){return $o.call(this.children,e)}}("function"==typeof e?e:Do(e)))},filter:function(e){"function"!=typeof e&&(e=qo(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i,a=t[r],s=a.length,l=o[r]=[],c=0;c<s;++c)(i=a[c])&&e.call(i,i.__data__,c,a)&&l.push(i);return new Ir(o,this._parents)},data:function(e,t){if(!arguments.length)return Array.from(this,Zo);var n,o=t?Ko:Uo,r=this._parents,i=this._groups;"function"!=typeof e&&(n=e,e=function(){return n});for(var a=i.length,s=new Array(a),l=new Array(a),c=new Array(a),u=0;u<a;++u){var d=r[u],f=i[u],h=f.length,p=Wo(e.call(d,d&&d.__data__,u,r)),g=p.length,y=l[u]=new Array(g),m=s[u]=new Array(g);o(d,f,y,m,c[u]=new Array(h),p,t);for(var v,b,x=0,w=0;x<g;++x)if(v=y[x]){for(x>=w&&(w=x+1);!(b=m[w])&&++w<g;);v._next=b||null}}return(s=new Ir(s,r))._enter=l,s._exit=c,s},enter:function(){return new Ir(this._enter||this._groups.map(Ho),this._parents)},exit:function(){return new Ir(this._exit||this._groups.map(Ho),this._parents)},join:function(e,t,n){var o=this.enter(),r=this,i=this.exit();return"function"==typeof e?(o=e(o))&&(o=o.selection()):o=o.append(e+""),null!=t&&(r=t(r))&&(r=r.selection()),null==n?i.remove():n(i),o&&r?o.merge(r).order():r},merge:function(e){for(var t=e.selection?e.selection():e,n=this._groups,o=t._groups,r=n.length,i=o.length,a=Math.min(r,i),s=new Array(r),l=0;l<a;++l)for(var c,u=n[l],d=o[l],f=u.length,h=s[l]=new Array(f),p=0;p<f;++p)(c=u[p]||d[p])&&(h[p]=c);for(;l<r;++l)s[l]=n[l];return new Ir(s,this._parents)},selection:function(){return this},order:function(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var o,r=e[t],i=r.length-1,a=r[i];--i>=0;)(o=r[i])&&(a&&4^o.compareDocumentPosition(a)&&a.parentNode.insertBefore(o,a),a=o);return this},sort:function(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=Yo);for(var n=this._groups,o=n.length,r=new Array(o),i=0;i<o;++i){for(var a,s=n[i],l=s.length,c=r[i]=new Array(l),u=0;u<l;++u)(a=s[u])&&(c[u]=a);c.sort(t)}return new Ir(r,this._parents).order()},call:function(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],r=0,i=o.length;r<i;++r){var a=o[r];if(a)return a}return null},size:function(){let e=0;for(const t of this)++e;return e},empty:function(){return!this.node()},each:function(e){for(var t=this._groups,n=0,o=t.length;n<o;++n)for(var r,i=t[n],a=0,s=i.length;a<s;++a)(r=i[a])&&e.call(r,r.__data__,a,i);return this},attr:function(e,t){var n=jo(e);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((null==t?n.local?Go:Xo:"function"==typeof t?n.local?er:Jo:n.local?_n:Qo)(n,t))},style:function(e,t,n){return arguments.length>1?this.each((null==t?nr:"function"==typeof t?rr:or)(e,t,null==n?"":n)):ir(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?ar:"function"==typeof t?lr:sr)(e,t)):this.node()[e]},classed:function(e,t){var n=cr(e+"");if(arguments.length<2){for(var o=ur(this.node()),r=-1,i=n.length;++r<i;)if(!o.contains(n[r]))return!1;return!0}return this.each(("function"==typeof t?yr:t?pr:gr)(n,t))},text:function(e){return arguments.length?this.each(null==e?mr:("function"==typeof e?br:vr)(e)):this.node().textContent},html:function(e){return arguments.length?this.each(null==e?xr:("function"==typeof e?_r:wr)(e)):this.node().innerHTML},raise:function(){return this.each(Er)},lower:function(){return this.each(kr)},append:function(e){var t="function"==typeof e?e:Mo(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})},insert:function(e,t){var n="function"==typeof e?e:Mo(e),o=null==t?Or:"function"==typeof t?t:Lo(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})},remove:function(){return this.each(Sr)},clone:function(e){return this.select(e?Nr:Cr)},datum:function(e){return arguments.length?this.property("__data__",e):this.node().__data__},on:function(e,t,n){var o,r,i=function(e){return e.trim().split(/^|\s+/).map(function(e){var t="",n=e.indexOf(".");return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}(e+""),a=i.length;if(!(arguments.length<2)){for(s=t?Ar:jr,o=0;o<a;++o)this.each(s(i[o],t,n));return this}var s=this.node().__on;if(s)for(var l,c=0,u=s.length;c<u;++c)for(o=0,l=s[c];o<a;++o)if((r=i[o]).type===l.type&&r.name===l.name)return l.value},dispatch:function(e,t){return this.each(("function"==typeof t?Tr:Mr)(e,t))},[Symbol.iterator]:function*(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o,r=e[t],i=0,a=r.length;i<a;++i)(o=r[i])&&(yield o)}};const zr={passive:!1},Br={capture:!0,passive:!1};function $r(e){e.stopImmediatePropagation()}function Fr(e){e.preventDefault(),e.stopImmediatePropagation()}function Hr(e){var t=e.document.documentElement,n=qr(e).on("dragstart.drag",Fr,Br);"onselectstart"in t?n.on("selectstart.drag",Fr,Br):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Vr(e,t){var n=e.document.documentElement,o=qr(e).on("dragstart.drag",null);t&&(o.on("click.drag",Fr,Br),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var Ur=e=>()=>e;function Kr(e,{sourceEvent:t,subject:n,target:o,identifier:r,active:i,x:a,y:s,dx:l,dy:c,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:u}})}function Zr(e){return!e.ctrlKey&&!e.button}function Wr(){return this.parentNode}function Yr(e,t){return null==t?{x:e.x,y:e.y}:t}function Xr(){return navigator.maxTouchPoints||"ontouchstart"in this}function Gr(){var e,t,n,o,r=Zr,i=Wr,a=Yr,s=Xr,l={},c=Eo("start","drag","end"),u=0,d=0;function f(e){e.on("mousedown.drag",h).filter(s).on("touchstart.drag",y).on("touchmove.drag",m,zr).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(a,s){if(!o&&r.call(this,a,s)){var l=b(this,i.call(this,a,s),a,s,"mouse");l&&(qr(a.view).on("mousemove.drag",p,Br).on("mouseup.drag",g,Br),Hr(a.view),$r(a),n=!1,e=a.clientX,t=a.clientY,l("start",a))}}function p(o){if(Fr(o),!n){var r=o.clientX-e,i=o.clientY-t;n=r*r+i*i>d}l.mouse("drag",o)}function g(e){qr(e.view).on("mousemove.drag mouseup.drag",null),Vr(e.view,n),Fr(e),l.mouse("end",e)}function y(e,t){if(r.call(this,e,t)){var n,o,a=e.changedTouches,s=i.call(this,e,t),l=a.length;for(n=0;n<l;++n)(o=b(this,s,e,t,a[n].identifier,a[n]))&&($r(e),o("start",e,a[n]))}}function m(e){var t,n,o=e.changedTouches,r=o.length;for(t=0;t<r;++t)(n=l[o[t].identifier])&&(Fr(e),n("drag",e,o[t]))}function v(e){var t,n,r=e.changedTouches,i=r.length;for(o&&clearTimeout(o),o=setTimeout(function(){o=null},500),t=0;t<i;++t)(n=l[r[t].identifier])&&($r(e),n("end",e,r[t]))}function b(e,t,n,o,r,i){var s,d,h,p=c.copy(),g=Dr(i||n,t);if(null!=(h=a.call(e,new Kr("beforestart",{sourceEvent:n,target:f,identifier:r,active:u,x:g[0],y:g[1],dx:0,dy:0,dispatch:p}),o)))return s=h.x-g[0]||0,d=h.y-g[1]||0,function n(i,a,c){var y,m=g;switch(i){case"start":l[r]=n,y=u++;break;case"end":delete l[r],--u;case"drag":g=Dr(c||a,t),y=u}p.call(i,e,new Kr(i,{sourceEvent:a,subject:h,target:f,identifier:r,active:y,x:g[0]+s,y:g[1]+d,dx:g[0]-m[0],dy:g[1]-m[1],dispatch:p}),o)}}return f.filter=function(e){return arguments.length?(r="function"==typeof e?e:Ur(!!e),f):r},f.container=function(e){return arguments.length?(i="function"==typeof e?e:Ur(e),f):i},f.subject=function(e){return arguments.length?(a="function"==typeof e?e:Ur(e),f):a},f.touchable=function(e){return arguments.length?(s="function"==typeof e?e:Ur(!!e),f):s},f.on=function(){var e=c.on.apply(c,arguments);return e===c?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}function Qr(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Jr(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function ei(){}Kr.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};var ti=.7,ni=1/ti,oi="\\s*([+-]?\\d+)\\s*",ri="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ii="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ai=/^#([0-9a-f]{3,8})$/,si=new RegExp(`^rgb\\(${oi},${oi},${oi}\\)$`),li=new RegExp(`^rgb\\(${ii},${ii},${ii}\\)$`),ci=new RegExp(`^rgba\\(${oi},${oi},${oi},${ri}\\)$`),ui=new RegExp(`^rgba\\(${ii},${ii},${ii},${ri}\\)$`),di=new RegExp(`^hsl\\(${ri},${ii},${ii}\\)$`),fi=new RegExp(`^hsla\\(${ri},${ii},${ii},${ri}\\)$`),hi={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function pi(){return this.rgb().formatHex()}function gi(){return this.rgb().formatRgb()}function yi(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=ai.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?mi(t):3===n?new xi(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?vi(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?vi(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=si.exec(e))?new xi(t[1],t[2],t[3],1):(t=li.exec(e))?new xi(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=ci.exec(e))?vi(t[1],t[2],t[3],t[4]):(t=ui.exec(e))?vi(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=di.exec(e))?Si(t[1],t[2]/100,t[3]/100,1):(t=fi.exec(e))?Si(t[1],t[2]/100,t[3]/100,t[4]):hi.hasOwnProperty(e)?mi(hi[e]):"transparent"===e?new xi(NaN,NaN,NaN,0):null}function mi(e){return new xi(e>>16&255,e>>8&255,255&e,1)}function vi(e,t,n,o){return o<=0&&(e=t=n=NaN),new xi(e,t,n,o)}function bi(e,t,n,o){return 1===arguments.length?((r=e)instanceof ei||(r=yi(r)),r?new xi((r=r.rgb()).r,r.g,r.b,r.opacity):new xi):new xi(e,t,n,null==o?1:o);var r}function xi(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}function wi(){return`#${Oi(this.r)}${Oi(this.g)}${Oi(this.b)}`}function _i(){const e=Ei(this.opacity);return`${1===e?"rgb(":"rgba("}${ki(this.r)}, ${ki(this.g)}, ${ki(this.b)}${1===e?")":`, ${e})`}`}function Ei(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ki(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Oi(e){return((e=ki(e))<16?"0":"")+e.toString(16)}function Si(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ni(e,t,n,o)}function Ci(e){if(e instanceof Ni)return new Ni(e.h,e.s,e.l,e.opacity);if(e instanceof ei||(e=yi(e)),!e)return new Ni;if(e instanceof Ni)return e;var t=(e=e.rgb()).r/255,n=e.g/255,o=e.b/255,r=Math.min(t,n,o),i=Math.max(t,n,o),a=NaN,s=i-r,l=(i+r)/2;return s?(a=t===i?(n-o)/s+6*(n<o):n===i?(o-t)/s+2:(t-n)/s+4,s/=l<.5?i+r:2-i-r,a*=60):s=l>0&&l<1?0:a,new Ni(a,s,l,e.opacity)}function Ni(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}function ji(e){return(e=(e||0)%360)<0?e+360:e}function Ai(e){return Math.max(0,Math.min(1,e||0))}function Pi(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}Qr(ei,yi,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:pi,formatHex:pi,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Ci(this).formatHsl()},formatRgb:gi,toString:gi}),Qr(xi,bi,Jr(ei,{brighter(e){return e=null==e?ni:Math.pow(ni,e),new xi(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?ti:Math.pow(ti,e),new xi(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new xi(ki(this.r),ki(this.g),ki(this.b),Ei(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:wi,formatHex:wi,formatHex8:function(){return`#${Oi(this.r)}${Oi(this.g)}${Oi(this.b)}${Oi(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:_i,toString:_i})),Qr(Ni,function(e,t,n,o){return 1===arguments.length?Ci(e):new Ni(e,t,n,null==o?1:o)},Jr(ei,{brighter(e){return e=null==e?ni:Math.pow(ni,e),new Ni(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?ti:Math.pow(ti,e),new Ni(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*t,r=2*n-o;return new xi(Pi(e>=240?e-240:e+120,r,o),Pi(e,r,o),Pi(e<120?e+240:e-120,r,o),this.opacity)},clamp(){return new Ni(ji(this.h),Ai(this.s),Ai(this.l),Ei(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Ei(this.opacity);return`${1===e?"hsl(":"hsla("}${ji(this.h)}, ${100*Ai(this.s)}%, ${100*Ai(this.l)}%${1===e?")":`, ${e})`}`}}));var Mi=e=>()=>e;function Ti(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Mi(isNaN(e)?t:e)}var Li=function e(t){var n=function(e){return 1==(e=+e)?Ti:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(o){return Math.pow(e+o*t,n)}}(t,n,e):Mi(isNaN(t)?n:t)}}(t);function o(e,t){var o=n((e=bi(e)).r,(t=bi(t)).r),r=n(e.g,t.g),i=n(e.b,t.b),a=Ti(e.opacity,t.opacity);return function(t){return e.r=o(t),e.g=r(t),e.b=i(t),e.opacity=a(t),e+""}}return o.gamma=e,o}(1);function Ii(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var Ri=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,qi=new RegExp(Ri.source,"g");function Di(e,t){var n,o,r,i=Ri.lastIndex=qi.lastIndex=0,a=-1,s=[],l=[];for(e+="",t+="";(n=Ri.exec(e))&&(o=qi.exec(t));)(r=o.index)>i&&(r=t.slice(i,r),s[a]?s[a]+=r:s[++a]=r),(n=n[0])===(o=o[0])?s[a]?s[a]+=o:s[++a]=o:(s[++a]=null,l.push({i:a,x:Ii(n,o)})),i=qi.lastIndex;return i<t.length&&(r=t.slice(i),s[a]?s[a]+=r:s[++a]=r),s.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,o=0;o<t;++o)s[(n=l[o]).i]=n.x(e);return s.join("")})}var zi,Bi=180/Math.PI,$i={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Fi(e,t,n,o,r,i){var a,s,l;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(l=e*n+t*o)&&(n-=e*l,o-=t*l),(s=Math.sqrt(n*n+o*o))&&(n/=s,o/=s,l/=s),e*o<t*n&&(e=-e,t=-t,l=-l,a=-a),{translateX:r,translateY:i,rotate:Math.atan2(t,e)*Bi,skewX:Math.atan(l)*Bi,scaleX:a,scaleY:s}}function Hi(e,t,n,o){function r(e){return e.length?e.pop()+" ":""}return function(i,a){var s=[],l=[];return i=e(i),a=e(a),function(e,o,r,i,a,s){if(e!==r||o!==i){var l=a.push("translate(",null,t,null,n);s.push({i:l-4,x:Ii(e,r)},{i:l-2,x:Ii(o,i)})}else(r||i)&&a.push("translate("+r+t+i+n)}(i.translateX,i.translateY,a.translateX,a.translateY,s,l),function(e,t,n,i){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),i.push({i:n.push(r(n)+"rotate(",null,o)-2,x:Ii(e,t)})):t&&n.push(r(n)+"rotate("+t+o)}(i.rotate,a.rotate,s,l),function(e,t,n,i){e!==t?i.push({i:n.push(r(n)+"skewX(",null,o)-2,x:Ii(e,t)}):t&&n.push(r(n)+"skewX("+t+o)}(i.skewX,a.skewX,s,l),function(e,t,n,o,i,a){if(e!==n||t!==o){var s=i.push(r(i)+"scale(",null,",",null,")");a.push({i:s-4,x:Ii(e,n)},{i:s-2,x:Ii(t,o)})}else 1===n&&1===o||i.push(r(i)+"scale("+n+","+o+")")}(i.scaleX,i.scaleY,a.scaleX,a.scaleY,s,l),i=a=null,function(e){for(var t,n=-1,o=l.length;++n<o;)s[(t=l[n]).i]=t.x(e);return s.join("")}}}var Vi=Hi(function(e){const t=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?$i:Fi(t.a,t.b,t.c,t.d,t.e,t.f)},"px, ","px)","deg)"),Ui=Hi(function(e){return null==e?$i:(zi||(zi=document.createElementNS("http://www.w3.org/2000/svg","g")),zi.setAttribute("transform",e),(e=zi.transform.baseVal.consolidate())?Fi((e=e.matrix).a,e.b,e.c,e.d,e.e,e.f):$i)},", ",")",")");function Ki(e){return((e=Math.exp(e))+1/e)/2}var Zi,Wi,Yi=function e(t,n,o){function r(e,r){var i,a,s=e[0],l=e[1],c=e[2],u=r[0],d=r[1],f=r[2],h=u-s,p=d-l,g=h*h+p*p;if(g<1e-12)a=Math.log(f/c)/t,i=function(e){return[s+e*h,l+e*p,c*Math.exp(t*e*a)]};else{var y=Math.sqrt(g),m=(f*f-c*c+o*g)/(2*c*n*y),v=(f*f-c*c-o*g)/(2*f*n*y),b=Math.log(Math.sqrt(m*m+1)-m),x=Math.log(Math.sqrt(v*v+1)-v);a=(x-b)/t,i=function(e){var o,r=e*a,i=Ki(b),u=c/(n*y)*(i*(o=t*r+b,((o=Math.exp(2*o))-1)/(o+1))-function(e){return((e=Math.exp(e))-1/e)/2}(b));return[s+u*h,l+u*p,c*i/Ki(t*r+b)]}}return i.duration=1e3*a*t/Math.SQRT2,i}return r.rho=function(t){var n=Math.max(.001,+t),o=n*n;return e(n,o,o*o)},r}(Math.SQRT2,2,4),Xi=0,Gi=0,Qi=0,Ji=0,ea=0,ta=0,na="object"==typeof performance&&performance.now?performance:Date,oa="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function ra(){return ea||(oa(ia),ea=na.now()+ta)}function ia(){ea=0}function aa(){this._call=this._time=this._next=null}function sa(e,t,n){var o=new aa;return o.restart(e,t,n),o}function la(){ea=(Ji=na.now())+ta,Xi=Gi=0;try{!function(){ra(),++Xi;for(var e,t=Zi;t;)(e=ea-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Xi}()}finally{Xi=0,function(){for(var e,t,n=Zi,o=1/0;n;)n._call?(o>n._time&&(o=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:Zi=t);Wi=e,ua(o)}(),ea=0}}function ca(){var e=na.now(),t=e-Ji;t>1e3&&(ta-=t,Ji=e)}function ua(e){Xi||(Gi&&(Gi=clearTimeout(Gi)),e-ea>24?(e<1/0&&(Gi=setTimeout(la,e-na.now()-ta)),Qi&&(Qi=clearInterval(Qi))):(Qi||(Ji=na.now(),Qi=setInterval(ca,1e3)),Xi=1,oa(la)))}function da(e,t,n){var o=new aa;return t=null==t?0:+t,o.restart(n=>{o.stop(),e(n+t)},t,n),o}aa.prototype=sa.prototype={constructor:aa,restart:function(e,t,n){if("function"!=typeof e)throw new TypeError("callback is not a function");n=(null==n?ra():+n)+(null==t?0:+t),this._next||Wi===this||(Wi?Wi._next=this:Zi=this,Wi=this),this._call=e,this._time=n,ua()},stop:function(){this._call&&(this._call=null,this._time=1/0,ua())}};var fa=Eo("start","end","cancel","interrupt"),ha=[];function pa(e,t,n,o,r,i){var a=e.__transition;if(a){if(n in a)return}else e.__transition={};!function(e,t,n){var o,r=e.__transition;function i(l){var c,u,d,f;if(1!==n.state)return s();for(c in r)if((f=r[c]).name===n.name){if(3===f.state)return da(i);4===f.state?(f.state=6,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete r[c]):+c<t&&(f.state=6,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete r[c])}if(da(function(){3===n.state&&(n.state=4,n.timer.restart(a,n.delay,n.time),a(l))}),n.state=2,n.on.call("start",e,e.__data__,n.index,n.group),2===n.state){for(n.state=3,o=new Array(d=n.tween.length),c=0,u=-1;c<d;++c)(f=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(o[++u]=f);o.length=u+1}}function a(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(s),n.state=5,1),i=-1,a=o.length;++i<a;)o[i].call(e,r);5===n.state&&(n.on.call("end",e,e.__data__,n.index,n.group),s())}function s(){for(var o in n.state=6,n.timer.stop(),delete r[t],r)return;delete e.__transition}r[t]=n,n.timer=sa(function(e){n.state=1,n.timer.restart(i,n.delay,n.time),n.delay<=e&&i(e-n.delay)},0,n.time)}(e,n,{name:t,index:o,group:r,on:fa,tween:ha,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:0})}function ga(e,t){var n=ma(e,t);if(n.state>0)throw new Error("too late; already scheduled");return n}function ya(e,t){var n=ma(e,t);if(n.state>3)throw new Error("too late; already running");return n}function ma(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function va(e,t){var n,o,r,i=e.__transition,a=!0;if(i){for(r in t=null==t?null:t+"",i)(n=i[r]).name===t?(o=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(o?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete i[r]):a=!1;a&&delete e.__transition}}function ba(e,t){var n,o;return function(){var r=ya(this,e),i=r.tween;if(i!==n)for(var a=0,s=(o=n=i).length;a<s;++a)if(o[a].name===t){(o=o.slice()).splice(a,1);break}r.tween=o}}function xa(e,t,n){var o,r;if("function"!=typeof n)throw new Error;return function(){var i=ya(this,e),a=i.tween;if(a!==o){r=(o=a).slice();for(var s={name:t,value:n},l=0,c=r.length;l<c;++l)if(r[l].name===t){r[l]=s;break}l===c&&r.push(s)}i.tween=r}}function wa(e,t,n){var o=e._id;return e.each(function(){var e=ya(this,o);(e.value||(e.value={}))[t]=n.apply(this,arguments)}),function(e){return ma(e,o).value[t]}}function _a(e,t){var n;return("number"==typeof t?Ii:t instanceof yi?Li:(n=yi(t))?(t=n,Li):Di)(e,t)}function Ea(e){return function(){this.removeAttribute(e)}}function ka(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Oa(e,t,n){var o,r,i=n+"";return function(){var a=this.getAttribute(e);return a===i?null:a===o?r:r=t(o=a,n)}}function Sa(e,t,n){var o,r,i=n+"";return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===o?r:r=t(o=a,n)}}function Ca(e,t,n){var o,r,i;return function(){var a,s,l=n(this);if(null!=l)return(a=this.getAttribute(e))===(s=l+"")?null:a===o&&s===r?i:(r=s,i=t(o=a,l));this.removeAttribute(e)}}function Na(e,t,n){var o,r,i;return function(){var a,s,l=n(this);if(null!=l)return(a=this.getAttributeNS(e.space,e.local))===(s=l+"")?null:a===o&&s===r?i:(r=s,i=t(o=a,l));this.removeAttributeNS(e.space,e.local)}}function ja(e,t){var n,o;function r(){var r=t.apply(this,arguments);return r!==o&&(n=(o=r)&&function(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}(e,r)),n}return r._value=t,r}function Aa(e,t){var n,o;function r(){var r=t.apply(this,arguments);return r!==o&&(n=(o=r)&&function(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}(e,r)),n}return r._value=t,r}function Pa(e,t){return function(){ga(this,e).delay=+t.apply(this,arguments)}}function Ma(e,t){return t=+t,function(){ga(this,e).delay=t}}function Ta(e,t){return function(){ya(this,e).duration=+t.apply(this,arguments)}}function La(e,t){return t=+t,function(){ya(this,e).duration=t}}var Ia=Rr.prototype.constructor;function Ra(e){return function(){this.style.removeProperty(e)}}var qa=0;function Da(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function za(){return++qa}var Ba=Rr.prototype;Da.prototype={constructor:Da,select:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=Lo(e));for(var o=this._groups,r=o.length,i=new Array(r),a=0;a<r;++a)for(var s,l,c=o[a],u=c.length,d=i[a]=new Array(u),f=0;f<u;++f)(s=c[f])&&(l=e.call(s,s.__data__,f,c))&&("__data__"in s&&(l.__data__=s.__data__),d[f]=l,pa(d[f],t,n,f,d,ma(s,n)));return new Da(i,this._parents,t,n)},selectAll:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=Ro(e));for(var o=this._groups,r=o.length,i=[],a=[],s=0;s<r;++s)for(var l,c=o[s],u=c.length,d=0;d<u;++d)if(l=c[d]){for(var f,h=e.call(l,l.__data__,d,c),p=ma(l,n),g=0,y=h.length;g<y;++g)(f=h[g])&&pa(f,t,n,g,h,p);i.push(h),a.push(l)}return new Da(i,a,t,n)},selectChild:Ba.selectChild,selectChildren:Ba.selectChildren,filter:function(e){"function"!=typeof e&&(e=qo(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i,a=t[r],s=a.length,l=o[r]=[],c=0;c<s;++c)(i=a[c])&&e.call(i,i.__data__,c,a)&&l.push(i);return new Da(o,this._parents,this._name,this._id)},merge:function(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,o=t.length,r=n.length,i=Math.min(o,r),a=new Array(o),s=0;s<i;++s)for(var l,c=t[s],u=n[s],d=c.length,f=a[s]=new Array(d),h=0;h<d;++h)(l=c[h]||u[h])&&(f[h]=l);for(;s<o;++s)a[s]=t[s];return new Da(a,this._parents,this._name,this._id)},selection:function(){return new Ia(this._groups,this._parents)},transition:function(){for(var e=this._name,t=this._id,n=za(),o=this._groups,r=o.length,i=0;i<r;++i)for(var a,s=o[i],l=s.length,c=0;c<l;++c)if(a=s[c]){var u=ma(a,t);pa(a,e,n,c,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Da(o,this._parents,e,n)},call:Ba.call,nodes:Ba.nodes,node:Ba.node,size:Ba.size,empty:Ba.empty,each:Ba.each,on:function(e,t){var n=this._id;return arguments.length<2?ma(this.node(),n).on.on(e):this.each(function(e,t,n){var o,r,i=function(e){return(e+"").trim().split(/^|\s+/).every(function(e){var t=e.indexOf(".");return t>=0&&(e=e.slice(0,t)),!e||"start"===e})}(t)?ga:ya;return function(){var a=i(this,e),s=a.on;s!==o&&(r=(o=s).copy()).on(t,n),a.on=r}}(n,e,t))},attr:function(e,t){var n=jo(e),o="transform"===n?Ui:_a;return this.attrTween(e,"function"==typeof t?(n.local?Na:Ca)(n,o,wa(this,"attr."+e,t)):null==t?(n.local?ka:Ea)(n):(n.local?Sa:Oa)(n,o,t))},attrTween:function(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw new Error;var o=jo(e);return this.tween(n,(o.local?ja:Aa)(o,t))},style:function(e,t,n){var o="transform"==(e+="")?Vi:_a;return null==t?this.styleTween(e,function(e,t){var n,o,r;return function(){var i=ir(this,e),a=(this.style.removeProperty(e),ir(this,e));return i===a?null:i===n&&a===o?r:r=t(n=i,o=a)}}(e,o)).on("end.style."+e,Ra(e)):"function"==typeof t?this.styleTween(e,function(e,t,n){var o,r,i;return function(){var a=ir(this,e),s=n(this),l=s+"";return null==s&&(this.style.removeProperty(e),l=s=ir(this,e)),a===l?null:a===o&&l===r?i:(r=l,i=t(o=a,s))}}(e,o,wa(this,"style."+e,t))).each(function(e,t){var n,o,r,i,a="style."+t,s="end."+a;return function(){var l=ya(this,e),c=l.on,u=null==l.value[a]?i||(i=Ra(t)):void 0;c===n&&r===u||(o=(n=c).copy()).on(s,r=u),l.on=o}}(this._id,e)):this.styleTween(e,function(e,t,n){var o,r,i=n+"";return function(){var a=ir(this,e);return a===i?null:a===o?r:r=t(o=a,n)}}(e,o,t),n).on("end.style."+e,null)},styleTween:function(e,t,n){var o="style."+(e+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(null==t)return this.tween(o,null);if("function"!=typeof t)throw new Error;return this.tween(o,function(e,t,n){var o,r;function i(){var i=t.apply(this,arguments);return i!==r&&(o=(r=i)&&function(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}(e,i,n)),o}return i._value=t,i}(e,t,null==n?"":n))},text:function(e){return this.tween("text","function"==typeof e?function(e){return function(){var t=e(this);this.textContent=null==t?"":t}}(wa(this,"text",e)):function(e){return function(){this.textContent=e}}(null==e?"":e+""))},textTween:function(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(null==e)return this.tween(t,null);if("function"!=typeof e)throw new Error;return this.tween(t,function(e){var t,n;function o(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&function(e){return function(t){this.textContent=e.call(this,t)}}(o)),t}return o._value=e,o}(e))},remove:function(){return this.on("end.remove",(e=this._id,function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}));var e},tween:function(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o,r=ma(this.node(),n).tween,i=0,a=r.length;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((null==t?ba:xa)(n,e,t))},delay:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?Pa:Ma)(t,e)):ma(this.node(),t).delay},duration:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?Ta:La)(t,e)):ma(this.node(),t).duration},ease:function(e){var t=this._id;return arguments.length?this.each(function(e,t){if("function"!=typeof t)throw new Error;return function(){ya(this,e).ease=t}}(t,e)):ma(this.node(),t).ease},easeVarying:function(e){if("function"!=typeof e)throw new Error;return this.each(function(e,t){return function(){var n=t.apply(this,arguments);if("function"!=typeof n)throw new Error;ya(this,e).ease=n}}(this._id,e))},end:function(){var e,t,n=this,o=n._id,r=n.size();return new Promise(function(i,a){var s={value:a},l={value:function(){0==--r&&i()}};n.each(function(){var n=ya(this,o),r=n.on;r!==e&&((t=(e=r).copy())._.cancel.push(s),t._.interrupt.push(s),t._.end.push(l)),n.on=t}),0===r&&i()})},[Symbol.iterator]:Ba[Symbol.iterator]};var $a={time:null,delay:0,duration:250,ease:function(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}};function Fa(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}Rr.prototype.interrupt=function(e){return this.each(function(){va(this,e)})},Rr.prototype.transition=function(e){var t,n;e instanceof Da?(t=e._id,e=e._name):(t=za(),(n=$a).time=ra(),e=null==e?null:e+"");for(var o=this._groups,r=o.length,i=0;i<r;++i)for(var a,s=o[i],l=s.length,c=0;c<l;++c)(a=s[c])&&pa(a,e,t,c,s,n||Fa(a,t));return new Da(o,this._parents,e,t)};var Ha=e=>()=>e;function Va(e,{sourceEvent:t,target:n,transform:o,dispatch:r}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:r}})}function Ua(e,t,n){this.k=e,this.x=t,this.y=n}Ua.prototype={constructor:Ua,scale:function(e){return 1===e?this:new Ua(this.k*e,this.x,this.y)},translate:function(e,t){return 0===e&0===t?this:new Ua(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Ka=new Ua(1,0,0);function Za(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Ka;return e.__zoom}function Wa(e){e.stopImmediatePropagation()}function Ya(e){e.preventDefault(),e.stopImmediatePropagation()}function Xa(e){return!(e.ctrlKey&&"wheel"!==e.type||e.button)}function Ga(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e).hasAttribute("viewBox")?[[(e=e.viewBox.baseVal).x,e.y],[e.x+e.width,e.y+e.height]]:[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]:[[0,0],[e.clientWidth,e.clientHeight]]}function Qa(){return this.__zoom||Ka}function Ja(e){return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function es(){return navigator.maxTouchPoints||"ontouchstart"in this}function ts(e,t,n){var o=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(r>o?(o+r)/2:Math.min(0,o)||Math.max(0,r),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function ns(){var e,t,n,o=Xa,r=Ga,i=ts,a=Ja,s=es,l=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],u=250,d=Yi,f=Eo("start","zoom","end"),h=0,p=10;function g(e){e.property("__zoom",Qa).on("wheel.zoom",_,{passive:!1}).on("mousedown.zoom",E).on("dblclick.zoom",k).filter(s).on("touchstart.zoom",O).on("touchmove.zoom",S).on("touchend.zoom touchcancel.zoom",C).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function y(e,t){return(t=Math.max(l[0],Math.min(l[1],t)))===e.k?e:new Ua(t,e.x,e.y)}function m(e,t,n){var o=t[0]-n[0]*e.k,r=t[1]-n[1]*e.k;return o===e.x&&r===e.y?e:new Ua(e.k,o,r)}function v(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function b(e,t,n,o){e.on("start.zoom",function(){x(this,arguments).event(o).start()}).on("interrupt.zoom end.zoom",function(){x(this,arguments).event(o).end()}).tween("zoom",function(){var e=this,i=arguments,a=x(e,i).event(o),s=r.apply(e,i),l=null==n?v(s):"function"==typeof n?n.apply(e,i):n,c=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),u=e.__zoom,f="function"==typeof t?t.apply(e,i):t,h=d(u.invert(l).concat(c/u.k),f.invert(l).concat(c/f.k));return function(e){if(1===e)e=f;else{var t=h(e),n=c/t[2];e=new Ua(n,l[0]-t[0]*n,l[1]-t[1]*n)}a.zoom(null,e)}})}function x(e,t,n){return!n&&e.__zooming||new w(e,t)}function w(e,t){this.that=e,this.args=t,this.active=0,this.sourceEvent=null,this.extent=r.apply(e,t),this.taps=0}function _(e,...t){if(o.apply(this,arguments)){var n=x(this,t).event(e),r=this.__zoom,s=Math.max(l[0],Math.min(l[1],r.k*Math.pow(2,a.apply(this,arguments)))),u=Dr(e);if(n.wheel)n.mouse[0][0]===u[0]&&n.mouse[0][1]===u[1]||(n.mouse[1]=r.invert(n.mouse[0]=u)),clearTimeout(n.wheel);else{if(r.k===s)return;n.mouse=[u,r.invert(u)],va(this),n.start()}Ya(e),n.wheel=setTimeout(function(){n.wheel=null,n.end()},150),n.zoom("mouse",i(m(y(r,s),n.mouse[0],n.mouse[1]),n.extent,c))}}function E(e,...t){if(!n&&o.apply(this,arguments)){var r=e.currentTarget,a=x(this,t,!0).event(e),s=qr(e.view).on("mousemove.zoom",function(e){if(Ya(e),!a.moved){var t=e.clientX-u,n=e.clientY-d;a.moved=t*t+n*n>h}a.event(e).zoom("mouse",i(m(a.that.__zoom,a.mouse[0]=Dr(e,r),a.mouse[1]),a.extent,c))},!0).on("mouseup.zoom",function(e){s.on("mousemove.zoom mouseup.zoom",null),Vr(e.view,a.moved),Ya(e),a.event(e).end()},!0),l=Dr(e,r),u=e.clientX,d=e.clientY;Hr(e.view),Wa(e),a.mouse=[l,this.__zoom.invert(l)],va(this),a.start()}}function k(e,...t){if(o.apply(this,arguments)){var n=this.__zoom,a=Dr(e.changedTouches?e.changedTouches[0]:e,this),s=n.invert(a),l=n.k*(e.shiftKey?.5:2),d=i(m(y(n,l),a,s),r.apply(this,t),c);Ya(e),u>0?qr(this).transition().duration(u).call(b,d,a,e):qr(this).call(g.transform,d,a,e)}}function O(n,...r){if(o.apply(this,arguments)){var i,a,s,l,c=n.touches,u=c.length,d=x(this,r,n.changedTouches.length===u).event(n);for(Wa(n),a=0;a<u;++a)l=[l=Dr(s=c[a],this),this.__zoom.invert(l),s.identifier],d.touch0?d.touch1||d.touch0[2]===l[2]||(d.touch1=l,d.taps=0):(d.touch0=l,i=!0,d.taps=1+!!e);e&&(e=clearTimeout(e)),i&&(d.taps<2&&(t=l[0],e=setTimeout(function(){e=null},500)),va(this),d.start())}}function S(e,...t){if(this.__zooming){var n,o,r,a,s=x(this,t).event(e),l=e.changedTouches,u=l.length;for(Ya(e),n=0;n<u;++n)r=Dr(o=l[n],this),s.touch0&&s.touch0[2]===o.identifier?s.touch0[0]=r:s.touch1&&s.touch1[2]===o.identifier&&(s.touch1[0]=r);if(o=s.that.__zoom,s.touch1){var d=s.touch0[0],f=s.touch0[1],h=s.touch1[0],p=s.touch1[1],g=(g=h[0]-d[0])*g+(g=h[1]-d[1])*g,v=(v=p[0]-f[0])*v+(v=p[1]-f[1])*v;o=y(o,Math.sqrt(g/v)),r=[(d[0]+h[0])/2,(d[1]+h[1])/2],a=[(f[0]+p[0])/2,(f[1]+p[1])/2]}else{if(!s.touch0)return;r=s.touch0[0],a=s.touch0[1]}s.zoom("touch",i(m(o,r,a),s.extent,c))}}function C(e,...o){if(this.__zooming){var r,i,a=x(this,o).event(e),s=e.changedTouches,l=s.length;for(Wa(e),n&&clearTimeout(n),n=setTimeout(function(){n=null},500),r=0;r<l;++r)i=s[r],a.touch0&&a.touch0[2]===i.identifier?delete a.touch0:a.touch1&&a.touch1[2]===i.identifier&&delete a.touch1;if(a.touch1&&!a.touch0&&(a.touch0=a.touch1,delete a.touch1),a.touch0)a.touch0[1]=this.__zoom.invert(a.touch0[0]);else if(a.end(),2===a.taps&&(i=Dr(i,this),Math.hypot(t[0]-i[0],t[1]-i[1])<p)){var c=qr(this).on("dblclick.zoom");c&&c.apply(this,arguments)}}}return g.transform=function(e,t,n,o){var r=e.selection?e.selection():e;r.property("__zoom",Qa),e!==r?b(e,t,n,o):r.interrupt().each(function(){x(this,arguments).event(o).start().zoom(null,"function"==typeof t?t.apply(this,arguments):t).end()})},g.scaleBy=function(e,t,n,o){g.scaleTo(e,function(){return this.__zoom.k*("function"==typeof t?t.apply(this,arguments):t)},n,o)},g.scaleTo=function(e,t,n,o){g.transform(e,function(){var e=r.apply(this,arguments),o=this.__zoom,a=null==n?v(e):"function"==typeof n?n.apply(this,arguments):n,s=o.invert(a),l="function"==typeof t?t.apply(this,arguments):t;return i(m(y(o,l),a,s),e,c)},n,o)},g.translateBy=function(e,t,n,o){g.transform(e,function(){return i(this.__zoom.translate("function"==typeof t?t.apply(this,arguments):t,"function"==typeof n?n.apply(this,arguments):n),r.apply(this,arguments),c)},null,o)},g.translateTo=function(e,t,n,o,a){g.transform(e,function(){var e=r.apply(this,arguments),a=this.__zoom,s=null==o?v(e):"function"==typeof o?o.apply(this,arguments):o;return i(Ka.translate(s[0],s[1]).scale(a.k).translate("function"==typeof t?-t.apply(this,arguments):-t,"function"==typeof n?-n.apply(this,arguments):-n),e,c)},o,a)},w.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(e,t){return this.mouse&&"mouse"!==e&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&"touch"!==e&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&"touch"!==e&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(e){var t=qr(this.that).datum();f.call(e,this.that,new Va(e,{sourceEvent:this.sourceEvent,target:g,transform:this.that.__zoom,dispatch:f}),t)}},g.wheelDelta=function(e){return arguments.length?(a="function"==typeof e?e:Ha(+e),g):a},g.filter=function(e){return arguments.length?(o="function"==typeof e?e:Ha(!!e),g):o},g.touchable=function(e){return arguments.length?(s="function"==typeof e?e:Ha(!!e),g):s},g.extent=function(e){return arguments.length?(r="function"==typeof e?e:Ha([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),g):r},g.scaleExtent=function(e){return arguments.length?(l[0]=+e[0],l[1]=+e[1],g):[l[0],l[1]]},g.translateExtent=function(e){return arguments.length?(c[0][0]=+e[0][0],c[1][0]=+e[1][0],c[0][1]=+e[0][1],c[1][1]=+e[1][1],g):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},g.constrain=function(e){return arguments.length?(i=e,g):i},g.duration=function(e){return arguments.length?(u=+e,g):u},g.interpolate=function(e){return arguments.length?(d=e,g):d},g.on=function(){var e=f.on.apply(f,arguments);return e===f?g:e},g.clickDistance=function(e){return arguments.length?(h=(e=+e)*e,g):Math.sqrt(h)},g.tapDistance=function(e){return arguments.length?(p=+e,g):p},g}Za.prototype=Ua.prototype;const os=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],rs=["Enter"," ","Escape"];var is,as,ss,ls;(ls=is||(is={})).Strict="strict",ls.Loose="loose",function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"}(as||(as={})),function(e){e.Partial="partial",e.Full="full"}(ss||(ss={}));const cs={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var us,ds,fs;!function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"}(us||(us={})),function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"}(ds||(ds={})),function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"}(fs||(fs={}));const hs={[fs.Left]:fs.Right,[fs.Right]:fs.Left,[fs.Top]:fs.Bottom,[fs.Bottom]:fs.Top};function ps(e){return null===e?null:e?"valid":"invalid"}const gs=e=>"id"in e&&"source"in e&&"target"in e,ys=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),ms=(e,t=[0,0])=>{const{width:n,height:o}=Hs(e),r=e.origin??t,i=n*r[0],a=o*r[1];return{x:e.position.x-i,y:e.position.y-a}},vs=(e,t={})=>{if(0===e.size)return{x:0,y:0,width:0,height:0};let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0};return e.forEach(e=>{if(void 0===t.filter||t.filter(e)){const t=As(e);n=Ss(n,t)}}),Ns(n)},bs=(e,t,[n,o,r]=[0,0,1],i=!1,a=!1)=>{const s={...qs(t,[n,o,r]),width:t.width/r,height:t.height/r},l=[];for(const t of e.values()){const{measured:e,selectable:n=!0,hidden:o=!1}=t;if(a&&!n||o)continue;const r=e.width??t.width??t.initialWidth??null,c=e.height??t.height??t.initialHeight??null,u=Ms(s,js(t)),d=(r??0)*(c??0),f=i&&u>0;(!t.internals.handleBounds||f||u>=d||t.dragging)&&l.push(t)}return l};function xs({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:o=[0,0],nodeExtent:r,onError:i}){const a=n.get(e),s=a.parentId?n.get(a.parentId):void 0,{x:l,y:c}=s?s.internals.positionAbsolute:{x:0,y:0},u=a.origin??o;let d=r;if("parent"!==a.extent||a.expandParent)s&&Fs(a.extent)&&(d=[[a.extent[0][0]+l,a.extent[0][1]+c],[a.extent[1][0]+l,a.extent[1][1]+c]]);else if(s){const e=s.measured.width,t=s.measured.height;e&&t&&(d=[[l,c],[l+e,c+t]])}else i?.("005","Only child nodes can use a parent extent.");const f=Fs(d)?_s(t,d,a.measured):t;return void 0!==a.measured.width&&void 0!==a.measured.height||i?.("015","It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."),{position:{x:f.x-l+(a.measured.width??0)*u[0],y:f.y-c+(a.measured.height??0)*u[1]},positionAbsolute:f}}const ws=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),_s=(e={x:0,y:0},t,n)=>({x:ws(e.x,t[0][0],t[1][0]-(n?.width??0)),y:ws(e.y,t[0][1],t[1][1]-(n?.height??0))});function Es(e,t,n){const{width:o,height:r}=Hs(n),{x:i,y:a}=n.internals.positionAbsolute;return _s(e,[[i,a],[i+o,a+r]],t)}const ks=(e,t,n)=>e<t?ws(Math.abs(e-t),1,t)/t:e>n?-ws(Math.abs(e-n),1,t)/t:0,Os=(e,t,n=15,o=40)=>[ks(e.x,o,t.width-o)*n,ks(e.y,o,t.height-o)*n],Ss=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Cs=({x:e,y:t,width:n,height:o})=>({x:e,y:t,x2:e+n,y2:t+o}),Ns=({x:e,y:t,x2:n,y2:o})=>({x:e,y:t,width:n-e,height:o-t}),js=(e,t=[0,0])=>{const{x:n,y:o}=ys(e)?e.internals.positionAbsolute:ms(e,t);return{x:n,y:o,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},As=(e,t=[0,0])=>{const{x:n,y:o}=ys(e)?e.internals.positionAbsolute:ms(e,t);return{x:n,y:o,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:o+(e.measured?.height??e.height??e.initialHeight??0)}},Ps=(e,t)=>Ns(Ss(Cs(e),Cs(t))),Ms=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),o=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*o)},Ts=e=>Ls(e.width)&&Ls(e.height)&&Ls(e.x)&&Ls(e.y),Ls=e=>!isNaN(e)&&isFinite(e),Is=(e,t)=>{},Rs=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),qs=({x:e,y:t},[n,o,r],i=!1,a=[1,1])=>{const s={x:(e-n)/r,y:(t-o)/r};return i?Rs(s,a):s},Ds=({x:e,y:t},[n,o,r])=>({x:e*r+n,y:t*r+o});function zs(e,t){if("number"==typeof e)return Math.floor(.5*(t-t/(1+e)));if("string"==typeof e&&e.endsWith("px")){const t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if("string"==typeof e&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}const Bs=(e,t,n,o,r,i)=>{const a=function(e,t,n){if("string"==typeof e||"number"==typeof e){const o=zs(e,n),r=zs(e,t);return{top:o,right:r,bottom:o,left:r,x:2*r,y:2*o}}if("object"==typeof e){const o=zs(e.top??e.y??0,n),r=zs(e.bottom??e.y??0,n),i=zs(e.left??e.x??0,t),a=zs(e.right??e.x??0,t);return{top:o,right:a,bottom:r,left:i,x:i+a,y:o+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}(i,t,n),s=(t-a.x)/e.width,l=(n-a.y)/e.height,c=Math.min(s,l),u=ws(c,o,r),d=t/2-(e.x+e.width/2)*u,f=n/2-(e.y+e.height/2)*u,h=function(e,t,n,o,r,i){const{x:a,y:s}=Ds(e,[t,n,o]),{x:l,y:c}=Ds({x:e.x+e.width,y:e.y+e.height},[t,n,o]),u=r-l,d=i-c;return{left:Math.floor(a),top:Math.floor(s),right:Math.floor(u),bottom:Math.floor(d)}}(e,d,f,u,t,n),p=Math.min(h.left-a.left,0),g=Math.min(h.top-a.top,0);return{x:d-p+Math.min(h.right-a.right,0),y:f-g+Math.min(h.bottom-a.bottom,0),zoom:u}},$s=()=>"undefined"!=typeof navigator&&navigator?.userAgent?.indexOf("Mac")>=0;function Fs(e){return void 0!==e&&"parent"!==e}function Hs(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function Vs(e){return void 0!==(e.measured?.width??e.width??e.initialWidth)&&void 0!==(e.measured?.height??e.height??e.initialHeight)}function Us(e,t={width:0,height:0},n,o,r){const i={...e},a=o.get(n);if(a){const e=a.origin||r;i.x+=a.internals.positionAbsolute.x-(t.width??0)*e[0],i.y+=a.internals.positionAbsolute.y-(t.height??0)*e[1]}return i}function Ks(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Zs(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:o,containerBounds:r}){const{x:i,y:a}=Js(e),s=qs({x:i-(r?.left??0),y:a-(r?.top??0)},o),{x:l,y:c}=n?Rs(s,t):s;return{xSnapped:l,ySnapped:c,...s}}const Ws=e=>({width:e.offsetWidth,height:e.offsetHeight}),Ys=e=>e?.getRootNode?.()||window?.document,Xs=["INPUT","SELECT","TEXTAREA"];function Gs(e){const t=e.composedPath?.()?.[0]||e.target;return 1===t?.nodeType&&(Xs.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey"))}const Qs=e=>"clientX"in e,Js=(e,t)=>{const n=Qs(e),o=n?e.clientX:e.touches?.[0].clientX,r=n?e.clientY:e.touches?.[0].clientY;return{x:o-(t?.left??0),y:r-(t?.top??0)}},el=(e,t,n,o,r)=>{const i=t.querySelectorAll(`.${e}`);return i&&i.length?Array.from(i).map(t=>{const i=t.getBoundingClientRect();return{id:t.getAttribute("data-handleid"),type:e,nodeId:r,position:t.getAttribute("data-handlepos"),x:(i.left-n.left)/o,y:(i.top-n.top)/o,...Ws(t)}}):null};function tl({sourceX:e,sourceY:t,targetX:n,targetY:o,sourceControlX:r,sourceControlY:i,targetControlX:a,targetControlY:s}){const l=.125*e+.375*r+.375*a+.125*n,c=.125*t+.375*i+.375*s+.125*o;return[l,c,Math.abs(l-e),Math.abs(c-t)]}function nl(e,t){return e>=0?.5*e:25*t*Math.sqrt(-e)}function ol({pos:e,x1:t,y1:n,x2:o,y2:r,c:i}){switch(e){case fs.Left:return[t-nl(t-o,i),n];case fs.Right:return[t+nl(o-t,i),n];case fs.Top:return[t,n-nl(n-r,i)];case fs.Bottom:return[t,n+nl(r-n,i)]}}function rl({sourceX:e,sourceY:t,sourcePosition:n=fs.Bottom,targetX:o,targetY:r,targetPosition:i=fs.Top,curvature:a=.25}){const[s,l]=ol({pos:n,x1:e,y1:t,x2:o,y2:r,c:a}),[c,u]=ol({pos:i,x1:o,y1:r,x2:e,y2:t,c:a}),[d,f,h,p]=tl({sourceX:e,sourceY:t,targetX:o,targetY:r,sourceControlX:s,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${s},${l} ${c},${u} ${o},${r}`,d,f,h,p]}function il({sourceX:e,sourceY:t,targetX:n,targetY:o}){const r=Math.abs(n-e)/2,i=n<e?n+r:n-r,a=Math.abs(o-t)/2;return[i,o<t?o+a:o-a,r,a]}function al({sourceNode:e,targetNode:t,width:n,height:o,transform:r}){const i=Ss(As(e),As(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const a={x:-r[0]/r[2],y:-r[1]/r[2],width:n/r[2],height:o/r[2]};return Ms(a,Ns(i))>0}const sl=({source:e,sourceHandle:t,target:n,targetHandle:o})=>`xy-edge__${e}${t||""}-${n}${o||""}`;function ll({sourceX:e,sourceY:t,targetX:n,targetY:o}){const[r,i,a,s]=il({sourceX:e,sourceY:t,targetX:n,targetY:o});return[`M ${e},${t}L ${n},${o}`,r,i,a,s]}const cl={[fs.Left]:{x:-1,y:0},[fs.Right]:{x:1,y:0},[fs.Top]:{x:0,y:-1},[fs.Bottom]:{x:0,y:1}},ul=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function dl({sourceX:e,sourceY:t,sourcePosition:n=fs.Bottom,targetX:o,targetY:r,targetPosition:i=fs.Top,borderRadius:a=5,centerX:s,centerY:l,offset:c=20}){const[u,d,f,h,p]=function({source:e,sourcePosition:t=fs.Bottom,target:n,targetPosition:o=fs.Top,center:r,offset:i}){const a=cl[t],s=cl[o],l={x:e.x+a.x*i,y:e.y+a.y*i},c={x:n.x+s.x*i,y:n.y+s.y*i},u=(({source:e,sourcePosition:t=fs.Bottom,target:n})=>t===fs.Left||t===fs.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1})({source:l,sourcePosition:t,target:c}),d=0!==u.x?"x":"y",f=u[d];let h,p,g=[];const y={x:0,y:0},m={x:0,y:0},[v,b,x,w]=il({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(a[d]*s[d]==-1){h=r.x??v,p=r.y??b;const e=[{x:h,y:l.y},{x:h,y:c.y}],t=[{x:l.x,y:p},{x:c.x,y:p}];g=a[d]===f?"x"===d?e:t:"x"===d?t:e}else{const r=[{x:l.x,y:c.y}],u=[{x:c.x,y:l.y}];if(g="x"===d?a.x===f?u:r:a.y===f?r:u,t===o){const t=Math.abs(e[d]-n[d]);if(t<=i){const o=Math.min(i-1,i-t);a[d]===f?y[d]=(l[d]>e[d]?-1:1)*o:m[d]=(c[d]>n[d]?-1:1)*o}}if(t!==o){const e="x"===d?"y":"x",t=a[d]===s[e],n=l[e]>c[e],o=l[e]<c[e];(1===a[d]&&(!t&&n||t&&o)||1!==a[d]&&(!t&&o||t&&n))&&(g="x"===d?r:u)}const v={x:l.x+y.x,y:l.y+y.y},b={x:c.x+m.x,y:c.y+m.y};Math.max(Math.abs(v.x-g[0].x),Math.abs(b.x-g[0].x))>=Math.max(Math.abs(v.y-g[0].y),Math.abs(b.y-g[0].y))?(h=(v.x+b.x)/2,p=g[0].y):(h=g[0].x,p=(v.y+b.y)/2)}return[[e,{x:l.x+y.x,y:l.y+y.y},...g,{x:c.x+m.x,y:c.y+m.y},n],h,p,x,w]}({source:{x:e,y:t},sourcePosition:n,target:{x:o,y:r},targetPosition:i,center:{x:s,y:l},offset:c});return[u.reduce((e,t,n)=>{let o="";return o=n>0&&n<u.length-1?function(e,t,n,o){const r=Math.min(ul(e,t)/2,ul(t,n)/2,o),{x:i,y:a}=t;if(e.x===i&&i===n.x||e.y===a&&a===n.y)return`L${i} ${a}`;if(e.y===a)return`L ${i+r*(e.x<n.x?-1:1)},${a}Q ${i},${a} ${i},${a+r*(e.y<n.y?1:-1)}`;const s=e.x<n.x?1:-1;return`L ${i},${a+r*(e.y<n.y?-1:1)}Q ${i},${a} ${i+r*s},${a}`}(u[n-1],t,u[n+1],a):`${0===n?"M":"L"}${t.x} ${t.y}`,e+o},""),d,f,h,p]}function fl(e){return e&&!(!e.internals.handleBounds&&!e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function hl(e){if(!e)return null;const t=[],n=[];for(const o of e)o.width=o.width??1,o.height=o.height??1,"source"===o.type?t.push(o):"target"===o.type&&n.push(o);return{source:t,target:n}}function pl(e,t,n=fs.Left,o=!1){const r=(t?.x??0)+e.internals.positionAbsolute.x,i=(t?.y??0)+e.internals.positionAbsolute.y,{width:a,height:s}=t??Hs(e);if(o)return{x:r+a/2,y:i+s/2};switch(t?.position??n){case fs.Top:return{x:r+a/2,y:i};case fs.Right:return{x:r+a,y:i+s/2};case fs.Bottom:return{x:r+a/2,y:i+s};case fs.Left:return{x:r,y:i+s/2}}}function gl(e,t){return e&&(t?e.find(e=>e.id===t):e[0])||null}function yl(e,t){return e?"string"==typeof e?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join("&")}`:""}const ml={nodeOrigin:[0,0],nodeExtent:os,elevateNodesOnSelect:!0,defaults:{}},vl={...ml,checkEquality:!0};function bl(e,t){const n={...e};for(const e in t)void 0!==t[e]&&(n[e]=t[e]);return n}function xl(e,t,n,o){const r=bl(vl,o);let i=e.length>0;const a=new Map(t),s=r?.elevateNodesOnSelect?1e3:0;t.clear(),n.clear();for(const l of e){let e=a.get(l.id);if(r.checkEquality&&l===e?.internals.userNode)t.set(l.id,e);else{const n=ms(l,r.nodeOrigin),o=Fs(l.extent)?l.extent:r.nodeExtent,i=_s(n,o,Hs(l));e={...r.defaults,...l,measured:{width:l.measured?.width,height:l.measured?.height},internals:{positionAbsolute:i,handleBounds:l.measured?e?.internals.handleBounds:void 0,z:_l(l,s),userNode:l}},t.set(l.id,e)}void 0!==e.measured&&void 0!==e.measured.width&&void 0!==e.measured.height||e.hidden||(i=!1),l.parentId&&wl(e,t,n,o)}return i}function wl(e,t,n,o){const{elevateNodesOnSelect:r,nodeOrigin:i,nodeExtent:a}=bl(ml,o),s=e.parentId,l=t.get(s);if(!l)return void console.warn(`Parent node ${s} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);!function(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}(e,n);const c=r?1e3:0,{x:u,y:d,z:f}=function(e,t,n,o,r){const{x:i,y:a}=t.internals.positionAbsolute,s=Hs(e),l=ms(e,n),c=Fs(e.extent)?_s(l,e.extent,s):l;let u=_s({x:i+c.x,y:a+c.y},o,s);"parent"===e.extent&&(u=Es(u,s,t));const d=_l(e,r),f=t.internals.z??0;return{x:u.x,y:u.y,z:f>d?f:d}}(e,l,i,a,c),{positionAbsolute:h}=e.internals,p=u!==h.x||d!==h.y;(p||f!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:p?{x:u,y:d}:h,z:f}})}function _l(e,t){return(Ls(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function El(e,t,n,o=[0,0]){const r=[],i=new Map;for(const n of e){const e=t.get(n.parentId);if(!e)continue;const o=i.get(n.parentId)?.expandedRect??js(e),r=Ps(o,n.rect);i.set(n.parentId,{expandedRect:r,parent:e})}return i.size>0&&i.forEach(({expandedRect:t,parent:i},a)=>{const s=i.internals.positionAbsolute,l=Hs(i),c=i.origin??o,u=t.x<s.x?Math.round(Math.abs(s.x-t.x)):0,d=t.y<s.y?Math.round(Math.abs(s.y-t.y)):0,f=Math.max(l.width,Math.round(t.width)),h=Math.max(l.height,Math.round(t.height)),p=(f-l.width)*c[0],g=(h-l.height)*c[1];(u>0||d>0||p||g)&&(r.push({id:a,type:"position",position:{x:i.position.x-u+p,y:i.position.y-d+g}}),n.get(a)?.forEach(t=>{e.some(e=>e.id===t.id)||r.push({id:t.id,type:"position",position:{x:t.position.x+u,y:t.position.y+d}})})),(l.width<t.width||l.height<t.height||u||d)&&r.push({id:a,type:"dimensions",setAttributes:!0,dimensions:{width:f+(u?c[0]*u-p:0),height:h+(d?c[1]*d-g:0)}})}),r}function kl(e,t,n,o,r,i){let a=r;const s=o.get(a)||new Map;o.set(a,s.set(n,t)),a=`${r}-${e}`;const l=o.get(a)||new Map;if(o.set(a,l.set(n,t)),i){a=`${r}-${e}-${i}`;const s=o.get(a)||new Map;o.set(a,s.set(n,t))}}function Ol(e,t,n){e.clear(),t.clear();for(const o of n){const{source:n,target:r,sourceHandle:i=null,targetHandle:a=null}=o,s={edgeId:o.id,source:n,target:r,sourceHandle:i,targetHandle:a},l=`${n}-${i}--${r}-${a}`;kl("source",s,`${r}-${a}--${n}-${i}`,e,n,i),kl("target",s,l,e,r,a),t.set(o.id,o)}}function Sl(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return!!n&&(!!n.selected||Sl(n,t))}function Cl(e,t,n){let o=e;do{if(o?.matches?.(t))return!0;if(o===n)return!1;o=o?.parentElement}while(o);return!1}function Nl({nodeId:e,dragItems:t,nodeLookup:n,dragging:o=!0}){const r=[];for(const[e,i]of t){const t=n.get(e)?.internals.userNode;t&&r.push({...t,position:i.position,dragging:o})}if(!e)return[r[0],r];const i=n.get(e)?.internals.userNode;return[i?{...i,position:t.get(e)?.position||i.position,dragging:o}:r[0],r]}function jl(e,t,n,o,r,i=!1){const a=o.get(e);if(!a)return null;const s="strict"===r?a.internals.handleBounds?.[t]:[...a.internals.handleBounds?.source??[],...a.internals.handleBounds?.target??[]],l=(n?s?.find(e=>e.id===n):s?.[0])??null;return l&&i?{...l,...pl(a,l,l.position,!0)}:l}function Al(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}const Pl=()=>!0;function Ml(e,{handle:t,connectionMode:n,fromNodeId:o,fromHandleId:r,fromType:i,doc:a,lib:s,flowId:l,isValidConnection:c=Pl,nodeLookup:u}){const d="target"===i,f=t?a.querySelector(`.${s}-flow__handle[data-id="${l}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:h,y:p}=Js(e),g=a.elementFromPoint(h,p),y=g?.classList.contains(`${s}-flow__handle`)?g:f,m={handleDomNode:y,isValid:!1,connection:null,toHandle:null};if(y){const e=Al(void 0,y),t=y.getAttribute("data-nodeid"),i=y.getAttribute("data-handleid"),a=y.classList.contains("connectable"),s=y.classList.contains("connectableend");if(!t||!e)return m;const l={source:d?t:o,sourceHandle:d?i:r,target:d?o:t,targetHandle:d?r:i};m.connection=l;const f=a&&s&&(n===is.Strict?d&&"source"===e||!d&&"target"===e:t!==o||i!==r);m.isValid=f&&c(l),m.toHandle=jl(t,e,i,u,n,!1)}return m}const Tl={onPointerDown:function(e,{connectionMode:t,connectionRadius:n,handleId:o,nodeId:r,edgeUpdaterType:i,isTarget:a,domNode:s,nodeLookup:l,lib:c,autoPanOnConnect:u,flowId:d,panBy:f,cancelConnection:h,onConnectStart:p,onConnect:g,onConnectEnd:y,isValidConnection:m=Pl,onReconnectEnd:v,updateConnection:b,getTransform:x,getFromHandle:w,autoPanSpeed:_}){const E=Ys(e.target);let k,O=0;const{x:S,y:C}=Js(e),N=E?.elementFromPoint(S,C),j=Al(i,N),A=s?.getBoundingClientRect();if(!A||!j)return;const P=jl(r,j,o,l,t);if(!P)return;let M=Js(e,A),T=!1,L=null,I=!1,R=null;function q(){if(!u||!A)return;const[e,t]=Os(M,A,_);f({x:e,y:t}),O=requestAnimationFrame(q)}const D={...P,nodeId:r,type:j,position:P.position},z=l.get(r),B={inProgress:!0,isValid:null,from:pl(z,D,fs.Left,!0),fromHandle:D,fromPosition:D.position,fromNode:z,to:M,toHandle:null,toPosition:hs[D.position],toNode:null};b(B);let $=B;function F(e){if(!w()||!D)return void H(e);const i=x();M=Js(e,A),k=function(e,t,n,o){let r=[],i=1/0;const a=function(e,t,n){const o=[],r={x:e.x-n,y:e.y-n,width:2*n,height:2*n};for(const e of t.values())Ms(r,js(e))>0&&o.push(e);return o}(e,n,t+250);for(const n of a){const a=[...n.internals.handleBounds?.source??[],...n.internals.handleBounds?.target??[]];for(const s of a){if(o.nodeId===s.nodeId&&o.type===s.type&&o.id===s.id)continue;const{x:a,y:l}=pl(n,s,s.position,!0),c=Math.sqrt(Math.pow(a-e.x,2)+Math.pow(l-e.y,2));c>t||(c<i?(r=[{...s,x:a,y:l}],i=c):c===i&&r.push({...s,x:a,y:l}))}}if(!r.length)return null;if(r.length>1){const e="source"===o.type?"target":"source";return r.find(t=>t.type===e)??r[0]}return r[0]}(qs(M,i,!1,[1,1]),n,l,D),T||(q(),T=!0);const s=Ml(e,{handle:k,connectionMode:t,fromNodeId:r,fromHandleId:o,fromType:a?"target":"source",isValidConnection:m,doc:E,lib:c,flowId:d,nodeLookup:l});R=s.handleDomNode,L=s.connection,I=function(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}(!!k,s.isValid);const u={...$,isValid:I,to:k&&I?Ds({x:k.x,y:k.y},i):M,toHandle:s.toHandle,toPosition:I&&s.toHandle?s.toHandle.position:hs[D.position],toNode:s.toHandle?l.get(s.toHandle.nodeId):null};I&&k&&$.toHandle&&u.toHandle&&$.toHandle.type===u.toHandle.type&&$.toHandle.nodeId===u.toHandle.nodeId&&$.toHandle.id===u.toHandle.id&&$.to.x===u.to.x&&$.to.y===u.to.y||(b(u),$=u)}function H(e){(k||R)&&L&&I&&g?.(L);const{inProgress:t,...n}=$,o={...n,toPosition:$.toHandle?$.toPosition:null};y?.(e,o),i&&v?.(e,o),h(),cancelAnimationFrame(O),T=!1,I=!1,L=null,R=null,E.removeEventListener("mousemove",F),E.removeEventListener("mouseup",H),E.removeEventListener("touchmove",F),E.removeEventListener("touchend",H)}p?.(e,{nodeId:r,handleId:o,handleType:j}),E.addEventListener("mousemove",F),E.addEventListener("mouseup",H),E.addEventListener("touchmove",F),E.addEventListener("touchend",H)},isValid:Ml},Ll=e=>({x:e.x,y:e.y,zoom:e.k}),Il=({x:e,y:t,zoom:n})=>Ka.translate(e,t).scale(n),Rl=(e,t)=>e.target.closest(`.${t}`),ql=(e,t)=>2===t&&Array.isArray(e)&&e.includes(2),Dl=(e,t=0,n=()=>{})=>{const o="number"==typeof t&&t>0;return o||n(),o?e.transition().duration(t).on("end",n):e},zl=e=>{const t=e.ctrlKey&&$s()?10:1;return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*t};var Bl;function $l(e,t){return Math.max(0,t-e)}function Fl(e,t){return Math.max(0,e-t)}function Hl(e,t,n){return Math.max(0,t-e,e-n)}function Vl(e,t){return e?!t:t}!function(e){e.Line="line",e.Handle="handle"}(Bl||(Bl={}));const Ul={width:0,height:0,x:0,y:0},Kl={...Ul,pointerX:0,pointerY:0,aspectRatio:1};function Zl(e,t,n){const o=t.position.x+e.position.x,r=t.position.y+e.position.y,i=e.measured.width??0,a=e.measured.height??0,s=n[0]*i,l=n[1]*a;return[[o-s,r-l],[o+i-s,r+a-l]]}var Wl,Yl,Xl,Gl={exports:{}},Ql={},Jl={exports:{}},ec={};Gl.exports=function(){if(Xl)return Ql;Xl=1;var e=r,t=(Yl||(Yl=1,Jl.exports=function(){if(Wl)return ec;Wl=1;var e=r,t="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},n=e.useState,o=e.useEffect,i=e.useLayoutEffect,a=e.useDebugValue;function s(e){var n=e.getSnapshot;e=e.value;try{var o=n();return!t(e,o)}catch(e){return!0}}var l="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var r=t(),l=n({inst:{value:r,getSnapshot:t}}),c=l[0].inst,u=l[1];return i(function(){c.value=r,c.getSnapshot=t,s(c)&&u({inst:c})},[e,r,t]),o(function(){return s(c)&&u({inst:c}),e(function(){s(c)&&u({inst:c})})},[e]),a(r),r};return ec.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:l,ec}()),Jl.exports),n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=t.useSyncExternalStore,i=e.useRef,a=e.useEffect,s=e.useMemo,l=e.useDebugValue;return Ql.useSyncExternalStoreWithSelector=function(e,t,r,c,u){var d=i(null);if(null===d.current){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=s(function(){function e(e){if(!a){if(a=!0,o=e,e=c(e),void 0!==u&&f.hasValue){var t=f.value;if(u(t,e))return i=t}return i=e}if(t=i,n(o,e))return t;var r=c(e);return void 0!==u&&u(t,r)?(o=e,t):(o=e,i=r)}var o,i,a=!1,s=void 0===r?null:r;return[function(){return e(t())},null===s?void 0:function(){return e(s())}]},[t,r,c,u]);var h=o(e,d[0],d[1]);return a(function(){f.hasValue=!0,f.value=h},[h]),l(h),h},Ql}();var tc=Bt(Gl.exports);const nc=e=>{let t;const n=new Set,o=(e,o)=>{const r="function"==typeof e?e(t):e;if(!Object.is(r,t)){const e=t;t=(null!=o?o:"object"!=typeof r||null===r)?r:Object.assign({},t,r),n.forEach(n=>n(t,e))}},r=()=>t,i={setState:o,getState:r,getInitialState:()=>a,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},a=t=e(o,r,i);return i},{useDebugValue:oc}=r,{useSyncExternalStoreWithSelector:rc}=tc,ic=e=>e;function ac(e,t=ic,n){const o=rc(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return oc(o),o}const sc=(e,t)=>{const n=(e=>e?nc(e):nc)(e),o=(e,o=t)=>ac(n,e,o);return Object.assign(o,n),o};function lc(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[n,o]of e)if(!Object.is(o,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const o of n)if(!Object.prototype.hasOwnProperty.call(t,o)||!Object.is(e[o],t[o]))return!1;return!0}const cc=(0,r.createContext)(null),uc=cc.Provider,dc="[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001";function fc(e,t){const n=(0,r.useContext)(cc);if(null===n)throw new Error(dc);return ac(n,e,t)}function hc(){const e=(0,r.useContext)(cc);if(null===e)throw new Error(dc);return(0,r.useMemo)(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const pc={display:"none"},gc={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},yc="react-flow__node-desc",mc="react-flow__edge-desc",vc=e=>e.ariaLiveMessage;function bc({rfId:e}){const t=fc(vc);return(0,o.jsx)("div",{id:`react-flow__aria-live-${e}`,"aria-live":"assertive","aria-atomic":"true",style:gc,children:t})}function xc({rfId:e,disableKeyboardA11y:t}){return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{id:`${yc}-${e}`,style:pc,children:["Press enter or space to select a node.",!t&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "]}),(0,o.jsx)("div",{id:`${mc}-${e}`,style:pc,children:"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."}),!t&&(0,o.jsx)(bc,{rfId:e})]})}const wc=e=>e.userSelectionActive?"none":"all",_c=(0,r.forwardRef)(({position:e="top-left",children:t,className:n,style:r,...i},a)=>{const s=fc(wc),l=`${e}`.split("-");return(0,o.jsx)("div",{className:wo(["react-flow__panel",n,...l]),style:{...r,pointerEvents:s},ref:a,...i,children:t})});function Ec({proOptions:e,position:t="bottom-right"}){return e?.hideAttribution?null:(0,o.jsx)(_c,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:(0,o.jsx)("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}_c.displayName="Panel";const kc=e=>{const t=[],n=[];for(const[,n]of e.nodeLookup)n.selected&&t.push(n.internals.userNode);for(const[,t]of e.edgeLookup)t.selected&&n.push(t);return{selectedNodes:t,selectedEdges:n}},Oc=e=>e.id;function Sc(e,t){return lc(e.selectedNodes.map(Oc),t.selectedNodes.map(Oc))&&lc(e.selectedEdges.map(Oc),t.selectedEdges.map(Oc))}function Cc({onSelectionChange:e}){const t=hc(),{selectedNodes:n,selectedEdges:o}=fc(kc,Sc);return(0,r.useEffect)(()=>{const r={nodes:n,edges:o};e?.(r),t.getState().onSelectionChangeHandlers.forEach(e=>e(r))},[n,o,e]),null}const Nc=e=>!!e.onSelectionChangeHandlers;function jc({onSelectionChange:e}){const t=fc(Nc);return e||t?(0,o.jsx)(Cc,{onSelectionChange:e}):null}const Ac=[0,0],Pc={x:0,y:0,zoom:1},Mc=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","onBeforeDelete","debug","autoPanSpeed","paneClickDistance","rfId"],Tc=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setPaneClickDistance:e.setPaneClickDistance}),Lc={translateExtent:os,nodeOrigin:Ac,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1",paneClickDistance:0};function Ic(e){const{setNodes:t,setEdges:n,setMinZoom:o,setMaxZoom:i,setTranslateExtent:a,setNodeExtent:s,reset:l,setDefaultNodesAndEdges:c,setPaneClickDistance:u}=fc(Tc,lc),d=hc();(0,r.useEffect)(()=>(c(e.defaultNodes,e.defaultEdges),()=>{f.current=Lc,l()}),[]);const f=(0,r.useRef)(Lc);return(0,r.useEffect)(()=>{for(const r of Mc){const l=e[r];l!==f.current[r]&&void 0!==e[r]&&("nodes"===r?t(l):"edges"===r?n(l):"minZoom"===r?o(l):"maxZoom"===r?i(l):"translateExtent"===r?a(l):"nodeExtent"===r?s(l):"paneClickDistance"===r?u(l):"fitView"===r?d.setState({fitViewQueued:l}):"fitViewOptions"===r?d.setState({fitViewOptions:l}):d.setState({[r]:l}))}f.current=e},Mc.map(t=>e[t])),null}function Rc(){return"undefined"!=typeof window&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null}const qc="undefined"!=typeof document?document:null;function Dc(e=null,t={target:qc,actInsideInputWithModifier:!0}){const[n,o]=(0,r.useState)(!1),i=(0,r.useRef)(!1),a=(0,r.useRef)(new Set([])),[s,l]=(0,r.useMemo)(()=>{if(null!==e){const t=(Array.isArray(e)?e:[e]).filter(e=>"string"==typeof e).map(e=>e.replace("+","\n").replace("\n\n","\n+").split("\n")),n=t.reduce((e,t)=>e.concat(...t),[]);return[t,n]}return[[],[]]},[e]);return(0,r.useEffect)(()=>{const n=t?.target||qc;if(null!==e){const e=e=>{if(i.current=e.ctrlKey||e.metaKey||e.shiftKey||e.altKey,(!i.current||i.current&&!t.actInsideInputWithModifier)&&Gs(e))return!1;const n=Bc(e.code,l);if(a.current.add(e[n]),zc(s,a.current,!1)){const n=e.composedPath?.()?.[0]||e.target,r="BUTTON"===n?.nodeName||"A"===n?.nodeName;!1===t.preventDefault||!i.current&&r||e.preventDefault(),o(!0)}},r=e=>{const t=Bc(e.code,l);zc(s,a.current,!0)?(o(!1),a.current.clear()):a.current.delete(e[t]),"Meta"===e.key&&a.current.clear(),i.current=!1},c=()=>{a.current.clear(),o(!1)};return n?.addEventListener("keydown",e),n?.addEventListener("keyup",r),window.addEventListener("blur",c),window.addEventListener("contextmenu",c),()=>{n?.removeEventListener("keydown",e),n?.removeEventListener("keyup",r),window.removeEventListener("blur",c),window.removeEventListener("contextmenu",c)}}},[e,o]),n}function zc(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function Bc(e,t){return t.includes(e)?"code":"key"}function $c(e,t){const n=[],o=new Map,r=[];for(const t of e)if("add"!==t.type)if("remove"===t.type||"replace"===t.type)o.set(t.id,[t]);else{const e=o.get(t.id);e?e.push(t):o.set(t.id,[t])}else r.push(t);for(const e of t){const t=o.get(e.id);if(!t){n.push(e);continue}if("remove"===t[0].type)continue;if("replace"===t[0].type){n.push({...t[0].item});continue}const r={...e};for(const e of t)Fc(e,r);n.push(r)}return r.length&&r.forEach(e=>{void 0!==e.index?n.splice(e.index,0,{...e.item}):n.push({...e.item})}),n}function Fc(e,t){switch(e.type){case"select":t.selected=e.selected;break;case"position":void 0!==e.position&&(t.position=e.position),void 0!==e.dragging&&(t.dragging=e.dragging);break;case"dimensions":void 0!==e.dimensions&&(t.measured??={},t.measured.width=e.dimensions.width,t.measured.height=e.dimensions.height,e.setAttributes&&(!0!==e.setAttributes&&"width"!==e.setAttributes||(t.width=e.dimensions.width),!0!==e.setAttributes&&"height"!==e.setAttributes||(t.height=e.dimensions.height))),"boolean"==typeof e.resizing&&(t.resizing=e.resizing)}}function Hc(e,t){return $c(e,t)}function Vc(e,t){return $c(e,t)}function Uc(e,t){return{id:e,type:"select",selected:t}}function Kc(e,t=new Set,n=!1){const o=[];for(const[r,i]of e){const e=t.has(r);void 0===i.selected&&!e||i.selected===e||(n&&(i.selected=e),o.push(Uc(i.id,e)))}return o}function Zc({items:e=[],lookup:t}){const n=[],o=new Map(e.map(e=>[e.id,e]));for(const[o,r]of e.entries()){const e=t.get(r.id),i=e?.internals?.userNode??e;void 0!==i&&i!==r&&n.push({id:r.id,item:r,type:"replace"}),void 0===i&&n.push({item:r,type:"add",index:o})}for(const[e]of t)void 0===o.get(e)&&n.push({id:e,type:"remove"});return n}function Wc(e){return{id:e.id,type:"remove"}}const Yc=e=>(e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e))(e);function Xc(e){return(0,r.forwardRef)(e)}const Gc="undefined"!=typeof window?r.useLayoutEffect:r.useEffect;function Qc(e){const[t,n]=(0,r.useState)(BigInt(0)),[o]=(0,r.useState)(()=>function(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}(()=>n(e=>e+BigInt(1))));return Gc(()=>{const t=o.get();t.length&&(e(t),o.reset())},[t]),o}const Jc=(0,r.createContext)(null);function eu({children:e}){const t=hc(),n=Qc((0,r.useCallback)(e=>{const{nodes:n=[],setNodes:o,hasDefaultNodes:r,onNodesChange:i,nodeLookup:a,fitViewQueued:s}=t.getState();let l=n;for(const t of e)l="function"==typeof t?t(l):t;if(r)o(l);else{const e=Zc({items:l,lookup:a});e.length>0?i?.(e):s&&window.requestAnimationFrame(()=>{const{fitViewQueued:e,nodes:n,setNodes:o}=t.getState();e&&o(n)})}},[])),i=Qc((0,r.useCallback)(e=>{const{edges:n=[],setEdges:o,hasDefaultEdges:r,onEdgesChange:i,edgeLookup:a}=t.getState();let s=n;for(const t of e)s="function"==typeof t?t(s):t;r?o(s):i&&i(Zc({items:s,lookup:a}))},[])),a=(0,r.useMemo)(()=>({nodeQueue:n,edgeQueue:i}),[]);return(0,o.jsx)(Jc.Provider,{value:a,children:e})}const tu=e=>!!e.panZoom;function nu(){const e=(()=>{const e=hc();return(0,r.useMemo)(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t?.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t?.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:o}=e.getState();return o?o.scaleTo(t,{duration:n?.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[o,r,i],panZoom:a}=e.getState();return a?(await a.setViewport({x:t.x??o,y:t.y??r,zoom:t.zoom??i},{duration:n?.duration}),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,o]=e.getState().transform;return{x:t,y:n,zoom:o}},setCenter:async(t,n,o)=>{const{width:r,height:i,maxZoom:a,panZoom:s}=e.getState(),l=void 0!==o?.zoom?o.zoom:a,c=r/2-t*l,u=i/2-n*l;return s?(await s.setViewport({x:c,y:u,zoom:l},{duration:o?.duration}),Promise.resolve(!0)):Promise.resolve(!1)},fitBounds:async(t,n)=>{const{width:o,height:r,minZoom:i,maxZoom:a,panZoom:s}=e.getState(),l=Bs(t,o,r,i,a,n?.padding??.1);return s?(await s.setViewport(l,{duration:n?.duration}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:o,snapGrid:r,snapToGrid:i,domNode:a}=e.getState();if(!a)return t;const{x:s,y:l}=a.getBoundingClientRect(),c={x:t.x-s,y:t.y-l},u=n.snapGrid??r,d=n.snapToGrid??i;return qs(c,o,d,u)},flowToScreenPosition:t=>{const{transform:n,domNode:o}=e.getState();if(!o)return t;const{x:r,y:i}=o.getBoundingClientRect(),a=Ds(t,n);return{x:a.x+r,y:a.y+i}}}),[])})(),t=hc(),n=function(){const e=(0,r.useContext)(Jc);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}(),o=fc(tu),i=(0,r.useMemo)(()=>{const e=e=>t.getState().nodeLookup.get(e),o=e=>{n.nodeQueue.push(e)},r=e=>{n.edgeQueue.push(e)},i=e=>{const{nodeLookup:n,nodeOrigin:o}=t.getState(),r=Yc(e)?e:n.get(e.id),i=r.parentId?Us(r.position,r.measured,r.parentId,n,o):r.position,a={...r,position:i,width:r.measured?.width??r.width,height:r.measured?.height??r.height};return js(a)},a=(e,t,n={replace:!1})=>{o(o=>o.map(o=>{if(o.id===e){const e="function"==typeof t?t(o):t;return n.replace&&Yc(e)?e:{...o,...e}}return o}))},s=(e,t,n={replace:!1})=>{r(o=>o.map(o=>{if(o.id===e){const e="function"==typeof t?t(o):t;return n.replace&&gs(e)?e:{...o,...e}}return o}))};return{getNodes:()=>t.getState().nodes.map(e=>({...e})),getNode:t=>e(t)?.internals.userNode,getInternalNode:e,getEdges:()=>{const{edges:e=[]}=t.getState();return e.map(e=>({...e}))},getEdge:e=>t.getState().edgeLookup.get(e),setNodes:o,setEdges:r,addNodes:e=>{const t=Array.isArray(e)?e:[e];n.nodeQueue.push(e=>[...e,...t])},addEdges:e=>{const t=Array.isArray(e)?e:[e];n.edgeQueue.push(e=>[...e,...t])},toObject:()=>{const{nodes:e=[],edges:n=[],transform:o}=t.getState(),[r,i,a]=o;return{nodes:e.map(e=>({...e})),edges:n.map(e=>({...e})),viewport:{x:r,y:i,zoom:a}}},deleteElements:async({nodes:e=[],edges:n=[]})=>{const{nodes:o,edges:r,onNodesDelete:i,onEdgesDelete:a,triggerNodeChanges:s,triggerEdgeChanges:l,onDelete:c,onBeforeDelete:u}=t.getState(),{nodes:d,edges:f}=await async function({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:o,onBeforeDelete:r}){const i=new Set(e.map(e=>e.id)),a=[];for(const e of n){if(!1===e.deletable)continue;const t=i.has(e.id),n=!t&&e.parentId&&a.find(t=>t.id===e.parentId);(t||n)&&a.push(e)}const s=new Set(t.map(e=>e.id)),l=o.filter(e=>!1!==e.deletable),c=((e,t)=>{const n=new Set;return e.forEach(e=>{n.add(e.id)}),t.filter(e=>n.has(e.source)||n.has(e.target))})(a,l),u=c;for(const e of l)s.has(e.id)&&!u.find(t=>t.id===e.id)&&u.push(e);if(!r)return{edges:u,nodes:a};const d=await r({nodes:a,edges:u});return"boolean"==typeof d?d?{edges:u,nodes:a}:{edges:[],nodes:[]}:d}({nodesToRemove:e,edgesToRemove:n,nodes:o,edges:r,onBeforeDelete:u}),h=f.length>0,p=d.length>0;if(h){const e=f.map(Wc);a?.(f),l(e)}if(p){const e=d.map(Wc);i?.(d),s(e)}return(p||h)&&c?.({nodes:d,edges:f}),{deletedNodes:d,deletedEdges:f}},getIntersectingNodes:(e,n=!0,o)=>{const r=Ts(e),a=r?e:i(e),s=void 0!==o;return a?(o||t.getState().nodes).filter(o=>{const i=t.getState().nodeLookup.get(o.id);if(i&&!r&&(o.id===e.id||!i.internals.positionAbsolute))return!1;const l=js(s?o:i),c=Ms(l,a);return n&&c>0||c>=a.width*a.height}):[]},isNodeIntersecting:(e,t,n=!0)=>{const o=Ts(e)?e:i(e);if(!o)return!1;const r=Ms(o,t);return n&&r>0||r>=o.width*o.height},updateNode:a,updateNodeData:(e,t,n={replace:!1})=>{a(e,e=>{const o="function"==typeof t?t(e):t;return n.replace?{...e,data:o}:{...e,data:{...e.data,...o}}},n)},updateEdge:s,updateEdgeData:(e,t,n={replace:!1})=>{s(e,e=>{const o="function"==typeof t?t(e):t;return n.replace?{...e,data:o}:{...e,data:{...e.data,...o}}},n)},getNodesBounds:e=>{const{nodeLookup:n,nodeOrigin:o}=t.getState();return((e,t={nodeOrigin:[0,0]})=>{if(0===e.length)return{x:0,y:0,width:0,height:0};const n=e.reduce((e,n)=>{const o="string"==typeof n;let r=t.nodeLookup||o?void 0:n;t.nodeLookup&&(r=o?t.nodeLookup.get(n):ys(n)?n:t.nodeLookup.get(n.id));const i=r?As(r,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Ss(e,i)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Ns(n)})(e,{nodeLookup:n,nodeOrigin:o})},getHandleConnections:({type:e,id:n,nodeId:o})=>Array.from(t.getState().connectionLookup.get(`${o}-${e}${n?`-${n}`:""}`)?.values()??[]),getNodeConnections:({type:e,handleId:n,nodeId:o})=>Array.from(t.getState().connectionLookup.get(`${o}${e?n?`-${e}-${n}`:`-${e}`:""}`)?.values()??[]),fitView:async e=>{const o=t.getState().fitViewResolver??function(){let e,t;return{promise:new Promise((n,o)=>{e=n,t=o}),resolve:e,reject:t}}();return t.setState({fitViewQueued:!0,fitViewOptions:e,fitViewResolver:o}),n.nodeQueue.push(e=>[...e]),o.promise}}},[]);return(0,r.useMemo)(()=>({...i,...e,viewportInitialized:o}),[o])}const ou=e=>e.selected,ru={actInsideInputWithModifier:!1},iu="undefined"!=typeof window?window:void 0,au={position:"absolute",width:"100%",height:"100%",top:0,left:0},su=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib});function lu({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:i=!1,panOnScrollSpeed:a=.5,panOnScrollMode:s=as.Free,zoomOnDoubleClick:l=!0,panOnDrag:c=!0,defaultViewport:u,translateExtent:d,minZoom:f,maxZoom:h,zoomActivationKeyCode:p,preventScrolling:g=!0,children:y,noWheelClassName:m,noPanClassName:v,onViewportChange:b,isControlledViewport:x,paneClickDistance:w}){const _=hc(),E=(0,r.useRef)(null),{userSelectionActive:k,lib:O}=fc(su,lc),S=Dc(p),C=(0,r.useRef)();!function(e){const t=hc();(0,r.useEffect)(()=>{const n=()=>{if(!e.current)return!1;const n=Ws(e.current);0!==n.height&&0!==n.width||t.getState().onError?.("004","The React Flow parent container needs a width and a height to render the graph."),t.setState({width:n.width||500,height:n.height||500})};if(e.current){n(),window.addEventListener("resize",n);const t=new ResizeObserver(()=>n());return t.observe(e.current),()=>{window.removeEventListener("resize",n),t&&e.current&&t.unobserve(e.current)}}},[])}(E);const N=(0,r.useCallback)(e=>{b?.({x:e[0],y:e[1],zoom:e[2]}),x||_.setState({transform:e})},[b,x]);return(0,r.useEffect)(()=>{if(E.current){C.current=function({domNode:e,minZoom:t,maxZoom:n,paneClickDistance:o,translateExtent:r,viewport:i,onPanZoom:a,onPanZoomStart:s,onPanZoomEnd:l,onDraggingChange:c}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),f=ns().clickDistance(!Ls(o)||o<0?0:o).scaleExtent([t,n]).translateExtent(r),h=qr(e).call(f);v({x:i.x,y:i.y,zoom:ws(i.zoom,t,n)},[[0,0],[d.width,d.height]],r);const p=h.on("wheel.zoom"),g=h.on("dblclick.zoom");function y(e,t){return h?new Promise(n=>{f?.transform(Dl(h,t?.duration,()=>n(!0)),e)}):Promise.resolve(!1)}function m(){f.on("zoom",null)}async function v(e,t,n){const o=Il(e),r=f?.constrain()(o,t,n);return r&&await y(r),new Promise(e=>e(r))}return f.wheelDelta(zl),{update:function({noWheelClassName:e,noPanClassName:t,onPaneContextMenu:n,userSelectionActive:o,panOnScroll:r,panOnDrag:i,panOnScrollMode:d,panOnScrollSpeed:y,preventScrolling:v,zoomOnPinch:b,zoomOnScroll:x,zoomOnDoubleClick:w,zoomActivationKeyPressed:_,lib:E,onTransformChange:k}){o&&!u.isZoomingOrPanning&&m();const O=!r||_||o?function({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(o,r){const i="wheel"===o.type,a=!t&&i&&!o.ctrlKey,s=Rl(o,e);if(o.ctrlKey&&i&&s&&o.preventDefault(),a||s)return null;o.preventDefault(),n.call(this,o,r)}}({noWheelClassName:e,preventScrolling:v,d3ZoomHandler:p}):function({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:o,panOnScrollMode:r,panOnScrollSpeed:i,zoomOnPinch:a,onPanZoomStart:s,onPanZoom:l,onPanZoomEnd:c}){return u=>{if(Rl(u,t))return!1;u.preventDefault(),u.stopImmediatePropagation();const d=n.property("__zoom").k||1;if(u.ctrlKey&&a){const e=Dr(u),t=zl(u),r=d*Math.pow(2,t);return void o.scaleTo(n,r,e,u)}const f=1===u.deltaMode?20:1;let h=r===as.Vertical?0:u.deltaX*f,p=r===as.Horizontal?0:u.deltaY*f;!$s()&&u.shiftKey&&r!==as.Vertical&&(h=u.deltaY*f,p=0),o.translateBy(n,-h/d*i,-p/d*i,{internal:!0});const g=Ll(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,s?.(u,g)),e.isPanScrolling&&(l?.(u,g),e.panScrollTimeout=setTimeout(()=>{c?.(u,g),e.isPanScrolling=!1},150))}}({zoomPanValues:u,noWheelClassName:e,d3Selection:h,d3Zoom:f,panOnScrollMode:d,panOnScrollSpeed:y,zoomOnPinch:b,onPanZoomStart:s,onPanZoom:a,onPanZoomEnd:l});if(h.on("wheel.zoom",O,{passive:!1}),!o){const e=function({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return o=>{if(o.sourceEvent?.internal)return;const r=Ll(o.transform);e.mouseButton=o.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=r,"mousedown"===o.sourceEvent?.type&&t(!0),n&&n?.(o.sourceEvent,r)}}({zoomPanValues:u,onDraggingChange:c,onPanZoomStart:s});f.on("start",e);const t=function({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:o,onPanZoom:r}){return i=>{e.usedRightMouseButton=!(!n||!ql(t,e.mouseButton??0)),i.sourceEvent?.sync||o([i.transform.x,i.transform.y,i.transform.k]),r&&!i.sourceEvent?.internal&&r?.(i.sourceEvent,Ll(i.transform))}}({zoomPanValues:u,panOnDrag:i,onPaneContextMenu:!!n,onPanZoom:a,onTransformChange:k});f.on("zoom",t);const o=function({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:o,onPanZoomEnd:r,onPaneContextMenu:i}){return a=>{var s,l;if(!a.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,i&&ql(t,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&i(a.sourceEvent),e.usedRightMouseButton=!1,o(!1),r&&(s=e.prevViewport,l=a.transform,s.x!==l.x||s.y!==l.y||s.zoom!==l.k))){const t=Ll(a.transform);e.prevViewport=t,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r?.(a.sourceEvent,t)},n?150:0)}}}({zoomPanValues:u,panOnDrag:i,panOnScroll:r,onPaneContextMenu:n,onPanZoomEnd:l,onDraggingChange:c});f.on("end",o)}const S=function({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:o,panOnScroll:r,zoomOnDoubleClick:i,userSelectionActive:a,noWheelClassName:s,noPanClassName:l,lib:c}){return u=>{const d=e||t,f=n&&u.ctrlKey;if(1===u.button&&"mousedown"===u.type&&(Rl(u,`${c}-flow__node`)||Rl(u,`${c}-flow__edge`)))return!0;if(!(o||d||r||i||n))return!1;if(a)return!1;if(Rl(u,s)&&"wheel"===u.type)return!1;if(Rl(u,l)&&("wheel"!==u.type||r&&"wheel"===u.type&&!e))return!1;if(!n&&u.ctrlKey&&"wheel"===u.type)return!1;if(!n&&"touchstart"===u.type&&u.touches?.length>1)return u.preventDefault(),!1;if(!d&&!r&&!f&&"wheel"===u.type)return!1;if(!o&&("mousedown"===u.type||"touchstart"===u.type))return!1;if(Array.isArray(o)&&!o.includes(u.button)&&"mousedown"===u.type)return!1;const h=Array.isArray(o)&&o.includes(u.button)||!u.button||u.button<=1;return(!u.ctrlKey||"wheel"===u.type)&&h}}({zoomActivationKeyPressed:_,panOnDrag:i,zoomOnScroll:x,panOnScroll:r,zoomOnDoubleClick:w,zoomOnPinch:b,userSelectionActive:o,noPanClassName:t,noWheelClassName:e,lib:E});f.filter(S),w?h.on("dblclick.zoom",g):h.on("dblclick.zoom",null)},destroy:m,setViewport:async function(e,t){const n=Il(e);return await y(n,t),new Promise(e=>e(n))},setViewportConstrained:v,getViewport:function(){const e=h?Za(h.node()):{x:0,y:0,k:1};return{x:e.x,y:e.y,zoom:e.k}},scaleTo:function(e,t){return h?new Promise(n=>{f?.scaleTo(Dl(h,t?.duration,()=>n(!0)),e)}):Promise.resolve(!1)},scaleBy:function(e,t){return h?new Promise(n=>{f?.scaleBy(Dl(h,t?.duration,()=>n(!0)),e)}):Promise.resolve(!1)},setScaleExtent:function(e){f?.scaleExtent(e)},setTranslateExtent:function(e){f?.translateExtent(e)},syncViewport:function(e){if(h){const t=Il(e),n=h.property("__zoom");n.k===e.zoom&&n.x===e.x&&n.y===e.y||f?.transform(h,t,null,{sync:!0})}},setClickDistance:function(e){const t=!Ls(e)||e<0?0:e;f?.clickDistance(t)}}}({domNode:E.current,minZoom:f,maxZoom:h,translateExtent:d,viewport:u,paneClickDistance:w,onDraggingChange:e=>_.setState({paneDragging:e}),onPanZoomStart:(e,t)=>{const{onViewportChangeStart:n,onMoveStart:o}=_.getState();o?.(e,t),n?.(t)},onPanZoom:(e,t)=>{const{onViewportChange:n,onMove:o}=_.getState();o?.(e,t),n?.(t)},onPanZoomEnd:(e,t)=>{const{onViewportChangeEnd:n,onMoveEnd:o}=_.getState();o?.(e,t),n?.(t)}});const{x:e,y:t,zoom:n}=C.current.getViewport();return _.setState({panZoom:C.current,transform:[e,t,n],domNode:E.current.closest(".react-flow")}),()=>{C.current?.destroy()}}},[]),(0,r.useEffect)(()=>{C.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:i,panOnScrollSpeed:a,panOnScrollMode:s,zoomOnDoubleClick:l,panOnDrag:c,zoomActivationKeyPressed:S,preventScrolling:g,noPanClassName:v,userSelectionActive:k,noWheelClassName:m,lib:O,onTransformChange:N})},[e,t,n,i,a,s,l,c,S,g,v,k,m,O,N]),(0,o.jsx)("div",{className:"react-flow__renderer",ref:E,style:au,children:y})}const cu=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function uu(){const{userSelectionActive:e,userSelectionRect:t}=fc(cu,lc);return e&&t?(0,o.jsx)("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const du=(e,t)=>n=>{n.target===t.current&&e?.(n)},fu=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function hu({isSelecting:e,selectionKeyPressed:t,selectionMode:n=ss.Full,panOnDrag:i,selectionOnDrag:a,onSelectionStart:s,onSelectionEnd:l,onPaneClick:c,onPaneContextMenu:u,onPaneScroll:d,onPaneMouseEnter:f,onPaneMouseMove:h,onPaneMouseLeave:p,children:g}){const y=hc(),{userSelectionActive:m,elementsSelectable:v,dragging:b,connectionInProgress:x}=fc(fu,lc),w=v&&(e||m),_=(0,r.useRef)(null),E=(0,r.useRef)(),k=(0,r.useRef)(new Set),O=(0,r.useRef)(new Set),S=(0,r.useRef)(!1),C=(0,r.useRef)(!1),N=e=>{S.current||x?S.current=!1:(c?.(e),y.getState().resetSelectedElements(),y.setState({nodesSelectionActive:!1}))},j=d?e=>d(e):void 0,A=!0===i||Array.isArray(i)&&i.includes(0);return(0,o.jsxs)("div",{className:wo(["react-flow__pane",{draggable:A,dragging:b,selection:e}]),onClick:w?void 0:du(N,_),onContextMenu:du(e=>{Array.isArray(i)&&i?.includes(2)?e.preventDefault():u?.(e)},_),onWheel:du(j,_),onPointerEnter:w?void 0:f,onPointerDown:w?t=>{const{resetSelectedElements:n,domNode:o}=y.getState();if(E.current=o?.getBoundingClientRect(),!v||!e||0!==t.button||t.target!==_.current||!E.current)return;t.target?.setPointerCapture?.(t.pointerId),C.current=!0,S.current=!1;const{x:r,y:i}=Js(t.nativeEvent,E.current);n(),y.setState({userSelectionRect:{width:0,height:0,startX:r,startY:i,x:r,y:i}}),s?.(t)}:h,onPointerMove:w?e=>{const{userSelectionRect:t,transform:o,nodeLookup:r,edgeLookup:i,connectionLookup:a,triggerNodeChanges:s,triggerEdgeChanges:l,defaultEdgeOptions:c}=y.getState();if(!E.current||!t)return;S.current=!0;const{x:u,y:d}=Js(e.nativeEvent,E.current),{startX:f,startY:h}=t,p={startX:f,startY:h,x:u<f?u:f,y:d<h?d:h,width:Math.abs(u-f),height:Math.abs(d-h)},g=k.current,m=O.current;k.current=new Set(bs(r,p,o,n===ss.Partial,!0).map(e=>e.id)),O.current=new Set;const v=c?.selectable??!0;for(const e of k.current){const t=a.get(e);if(t)for(const{edgeId:e}of t.values()){const t=i.get(e);t&&(t.selectable??v)&&O.current.add(e)}}Ks(g,k.current)||s(Kc(r,k.current,!0)),Ks(m,O.current)||l(Kc(i,O.current)),y.setState({userSelectionRect:p,userSelectionActive:!0,nodesSelectionActive:!1})}:h,onPointerUp:w?e=>{if(0!==e.button||!C.current)return;e.target?.releasePointerCapture?.(e.pointerId);const{userSelectionRect:n}=y.getState();!m&&n&&e.target===_.current&&N?.(e),y.setState({userSelectionActive:!1,userSelectionRect:null,nodesSelectionActive:k.current.size>0}),l?.(e),(t||a)&&(S.current=!1),C.current=!1}:void 0,onPointerLeave:p,ref:_,style:au,children:[g,(0,o.jsx)(uu,{})]})}function pu({id:e,store:t,unselect:n=!1,nodeRef:o}){const{addSelectedNodes:r,unselectNodesAndEdges:i,multiSelectionActive:a,nodeLookup:s,onError:l}=t.getState(),c=s.get(e);c?(t.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&a)&&(i({nodes:[c],edges:[]}),requestAnimationFrame(()=>o?.current?.blur())):r([e])):l?.("012",(e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`)(e))}function gu({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:o,nodeId:i,isSelectable:a,nodeClickDistance:s}){const l=hc(),[c,u]=(0,r.useState)(!1),d=(0,r.useRef)();return(0,r.useEffect)(()=>{d.current=function({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:o,onDragStop:r}){let i={x:null,y:null},a=0,s=new Map,l=!1,c={x:0,y:0},u=null,d=!1,f=null,h=!1;return{update:function({noDragClassName:p,handleSelector:g,domNode:y,isSelectable:m,nodeId:v,nodeClickDistance:b=0}){function x({x:e,y:n},r){const{nodeLookup:a,nodeExtent:l,snapGrid:c,snapToGrid:u,nodeOrigin:d,onNodeDrag:f,onSelectionDrag:h,onError:p,updateNodePositions:g}=t();i={x:e,y:n};let y=!1,m={x:0,y:0,x2:0,y2:0};if(s.size>1&&l){const e=vs(s);m=Cs(e)}for(const[t,o]of s){if(!a.has(t))continue;let r={x:e-o.distance.x,y:n-o.distance.y};u&&(r=Rs(r,c));let i=[[l[0][0],l[0][1]],[l[1][0],l[1][1]]];if(s.size>1&&l&&!o.extent){const{positionAbsolute:e}=o.internals,t=e.x-m.x+l[0][0],n=e.x+o.measured.width-m.x2+l[1][0];i=[[t,e.y-m.y+l[0][1]],[n,e.y+o.measured.height-m.y2+l[1][1]]]}const{position:f,positionAbsolute:h}=xs({nodeId:t,nextPosition:r,nodeLookup:a,nodeExtent:i,nodeOrigin:d,onError:p});y=y||o.position.x!==f.x||o.position.y!==f.y,o.position=f,o.internals.positionAbsolute=h}if(y&&(g(s,!0),r&&(o||f||!v&&h))){const[e,t]=Nl({nodeId:v,dragItems:s,nodeLookup:a});o?.(r,s,e,t),f?.(r,e,t),v||h?.(r,t)}}async function w(){if(!u)return;const{transform:e,panBy:n,autoPanSpeed:o,autoPanOnNodeDrag:r}=t();if(!r)return l=!1,void cancelAnimationFrame(a);const[s,d]=Os(c,u,o);0===s&&0===d||(i.x=(i.x??0)-s/e[2],i.y=(i.y??0)-d/e[2],await n({x:s,y:d})&&x(i,null)),a=requestAnimationFrame(w)}function _(o){const{nodeLookup:r,multiSelectionActive:a,nodesDraggable:l,transform:c,snapGrid:f,snapToGrid:h,selectNodesOnDrag:p,onNodeDragStart:g,onSelectionDragStart:y,unselectNodesAndEdges:b}=t();d=!0,p&&m||a||!v||r.get(v)?.selected||b(),m&&p&&v&&e?.(v);const x=Zs(o.sourceEvent,{transform:c,snapGrid:f,snapToGrid:h,containerBounds:u});if(i=x,s=function(e,t,n,o){const r=new Map;for(const[i,a]of e)if((a.selected||a.id===o)&&(!a.parentId||!Sl(a,e))&&(a.draggable||t&&void 0===a.draggable)){const t=e.get(i);t&&r.set(i,{id:i,position:t.position||{x:0,y:0},distance:{x:n.x-t.internals.positionAbsolute.x,y:n.y-t.internals.positionAbsolute.y},extent:t.extent,parentId:t.parentId,origin:t.origin,expandParent:t.expandParent,internals:{positionAbsolute:t.internals.positionAbsolute||{x:0,y:0}},measured:{width:t.measured.width??0,height:t.measured.height??0}})}return r}(r,l,x,v),s.size>0&&(n||g||!v&&y)){const[e,t]=Nl({nodeId:v,dragItems:s,nodeLookup:r});n?.(o.sourceEvent,s,e,t),g?.(o.sourceEvent,e,t),v||y?.(o.sourceEvent,t)}}f=qr(y);const E=Gr().clickDistance(b).on("start",e=>{const{domNode:n,nodeDragThreshold:o,transform:r,snapGrid:a,snapToGrid:s}=t();u=n?.getBoundingClientRect()||null,h=!1,0===o&&_(e);const l=Zs(e.sourceEvent,{transform:r,snapGrid:a,snapToGrid:s,containerBounds:u});i=l,c=Js(e.sourceEvent,u)}).on("drag",e=>{const{autoPanOnNodeDrag:n,transform:o,snapGrid:r,snapToGrid:a,nodeDragThreshold:f,nodeLookup:p}=t(),g=Zs(e.sourceEvent,{transform:o,snapGrid:r,snapToGrid:a,containerBounds:u});if(("touchmove"===e.sourceEvent.type&&e.sourceEvent.touches.length>1||v&&!p.has(v))&&(h=!0),!h){if(!l&&n&&d&&(l=!0,w()),!d){const t=g.xSnapped-(i.x??0),n=g.ySnapped-(i.y??0);Math.sqrt(t*t+n*n)>f&&_(e)}(i.x!==g.xSnapped||i.y!==g.ySnapped)&&s&&d&&(c=Js(e.sourceEvent,u),x(g,e.sourceEvent))}}).on("end",e=>{if(d&&!h&&(l=!1,d=!1,cancelAnimationFrame(a),s.size>0)){const{nodeLookup:n,updateNodePositions:o,onNodeDragStop:i,onSelectionDragStop:a}=t();if(o(s,!1),r||i||!v&&a){const[t,o]=Nl({nodeId:v,dragItems:s,nodeLookup:n,dragging:!1});r?.(e.sourceEvent,s,t,o),i?.(e.sourceEvent,t,o),v||a?.(e.sourceEvent,o)}}}).filter(e=>{const t=e.target;return!e.button&&(!p||!Cl(t,`.${p}`,y))&&(!g||Cl(t,g,y))});f.call(E)},destroy:function(){f?.on(".drag",null)}}}({getStoreItems:()=>l.getState(),onNodeMouseDown:t=>{pu({id:t,store:l,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),(0,r.useEffect)(()=>{if(t)d.current?.destroy();else if(e.current)return d.current?.update({noDragClassName:n,handleSelector:o,domNode:e.current,isSelectable:a,nodeId:i,nodeClickDistance:s}),()=>{d.current?.destroy()}},[n,o,t,a,e,i]),c}function yu(){const e=hc();return(0,r.useCallback)(t=>{const{nodeExtent:n,snapToGrid:o,snapGrid:r,nodesDraggable:i,onError:a,updateNodePositions:s,nodeLookup:l,nodeOrigin:c}=e.getState(),u=new Map,d=(e=>t=>t.selected&&(t.draggable||e&&void 0===t.draggable))(i),f=o?r[0]:5,h=o?r[1]:5,p=t.direction.x*f*t.factor,g=t.direction.y*h*t.factor;for(const[,e]of l){if(!d(e))continue;let t={x:e.internals.positionAbsolute.x+p,y:e.internals.positionAbsolute.y+g};o&&(t=Rs(t,r));const{position:i,positionAbsolute:s}=xs({nodeId:e.id,nextPosition:t,nodeLookup:l,nodeExtent:n,nodeOrigin:c,onError:a});e.position=i,e.internals.positionAbsolute=s,u.set(e.id,e)}s(u)},[])}const mu=(0,r.createContext)(null),vu=mu.Provider;mu.Consumer;const bu=()=>(0,r.useContext)(mu),xu=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),wu=(0,r.memo)(Xc(function({type:e="source",position:t=fs.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:a=!0,id:s,onConnect:l,children:c,className:u,onMouseDown:d,onTouchStart:f,...h},p){const g=s||null,y="target"===e,m=hc(),v=bu(),{connectOnClick:b,noPanClassName:x,rfId:w}=fc(xu,lc),{connectingFrom:_,connectingTo:E,clickConnecting:k,isPossibleEndHandle:O,connectionInProcess:S,clickConnectionInProcess:C,valid:N}=fc(((e,t,n)=>o=>{const{connectionClickStartHandle:r,connectionMode:i,connection:a}=o,{fromHandle:s,toHandle:l,isValid:c}=a,u=l?.nodeId===e&&l?.id===t&&l?.type===n;return{connectingFrom:s?.nodeId===e&&s?.id===t&&s?.type===n,connectingTo:u,clickConnecting:r?.nodeId===e&&r?.id===t&&r?.type===n,isPossibleEndHandle:i===is.Strict?s?.type!==n:e!==s?.nodeId||t!==s?.id,connectionInProcess:!!s,clickConnectionInProcess:!!r,valid:u&&c}})(v,g,e),lc);v||m.getState().onError?.("010","Handle: No node id found. Make sure to only use a Handle inside a custom Node.");const j=e=>{const{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:o}=m.getState(),r={...t,...e};if(o){const{edges:e,setEdges:t}=m.getState();t(((e,t)=>{if(!e.source||!e.target)return t;let n;return n=gs(e)?{...e}:{...e,id:sl(e)},((e,t)=>t.some(t=>!(t.source!==e.source||t.target!==e.target||t.sourceHandle!==e.sourceHandle&&(t.sourceHandle||e.sourceHandle)||t.targetHandle!==e.targetHandle&&(t.targetHandle||e.targetHandle))))(n,t)?t:(null===n.sourceHandle&&delete n.sourceHandle,null===n.targetHandle&&delete n.targetHandle,t.concat(n))})(r,e))}n?.(r),l?.(r)},A=e=>{if(!v)return;const t=Qs(e.nativeEvent);if(i&&(t&&0===e.button||!t)){const t=m.getState();Tl.onPointerDown(e.nativeEvent,{autoPanOnConnect:t.autoPanOnConnect,connectionMode:t.connectionMode,connectionRadius:t.connectionRadius,domNode:t.domNode,nodeLookup:t.nodeLookup,lib:t.lib,isTarget:y,handleId:g,nodeId:v,flowId:t.rfId,panBy:t.panBy,cancelConnection:t.cancelConnection,onConnectStart:t.onConnectStart,onConnectEnd:t.onConnectEnd,updateConnection:t.updateConnection,onConnect:j,isValidConnection:n||t.isValidConnection,getTransform:()=>m.getState().transform,getFromHandle:()=>m.getState().connection.fromHandle,autoPanSpeed:t.autoPanSpeed})}t?d?.(e):f?.(e)};return(0,o.jsx)("div",{"data-handleid":g,"data-nodeid":v,"data-handlepos":t,"data-id":`${w}-${v}-${g}-${e}`,className:wo(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",x,u,{source:!y,target:y,connectable:r,connectablestart:i,connectableend:a,clickconnecting:k,connectingfrom:_,connectingto:E,valid:N,connectionindicator:r&&(!S||O)&&(S||C?a:i)}]),onMouseDown:A,onTouchStart:A,onClick:b?t=>{const{onClickConnectStart:o,onClickConnectEnd:r,connectionClickStartHandle:a,connectionMode:s,isValidConnection:l,lib:c,rfId:u,nodeLookup:d,connection:f}=m.getState();if(!v||!a&&!i)return;if(!a)return o?.(t.nativeEvent,{nodeId:v,handleId:g,handleType:e}),void m.setState({connectionClickStartHandle:{nodeId:v,type:e,id:g}});const h=Ys(t.target),p=n||l,{connection:y,isValid:b}=Tl.isValid(t.nativeEvent,{handle:{nodeId:v,id:g,type:e},connectionMode:s,fromNodeId:a.nodeId,fromHandleId:a.id||null,fromType:a.type,isValidConnection:p,flowId:u,doc:h,lib:c,nodeLookup:d});b&&y&&j(y);const x=structuredClone(f);delete x.inProgress,x.toPosition=x.toHandle?x.toHandle.position:null,r?.(t,x),m.setState({connectionClickStartHandle:null})}:void 0,ref:p,...h,children:c})})),_u={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Eu={input:function({data:e,isConnectable:t,sourcePosition:n=fs.Bottom}){return(0,o.jsxs)(o.Fragment,{children:[e?.label,(0,o.jsx)(wu,{type:"source",position:n,isConnectable:t})]})},default:function({data:e,isConnectable:t,targetPosition:n=fs.Top,sourcePosition:r=fs.Bottom}){return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(wu,{type:"target",position:n,isConnectable:t}),e?.label,(0,o.jsx)(wu,{type:"source",position:r,isConnectable:t})]})},output:function({data:e,isConnectable:t,targetPosition:n=fs.Top}){return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(wu,{type:"target",position:n,isConnectable:t}),e?.label]})},group:function(){return null}},ku=e=>{const{width:t,height:n,x:o,y:r}=vs(e.nodeLookup,{filter:e=>!!e.selected});return{width:Ls(t)?t:null,height:Ls(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${o}px,${r}px)`}};function Ou({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const i=hc(),{width:a,height:s,transformString:l,userSelectionActive:c}=fc(ku,lc),u=yu(),d=(0,r.useRef)(null);if((0,r.useEffect)(()=>{n||d.current?.focus({preventScroll:!0})},[n]),gu({nodeRef:d}),c||!a||!s)return null;const f=e?t=>{const n=i.getState().nodes.filter(e=>e.selected);e(t,n)}:void 0;return(0,o.jsx)("div",{className:wo(["react-flow__nodesselection","react-flow__container",t]),style:{transform:l},children:(0,o.jsx)("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:e=>{Object.prototype.hasOwnProperty.call(_u,e.key)&&(e.preventDefault(),u({direction:_u[e.key],factor:e.shiftKey?4:1}))},style:{width:a,height:s}})})}const Su="undefined"!=typeof window?window:void 0,Cu=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function Nu({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:a,onPaneContextMenu:s,onPaneScroll:l,paneClickDistance:c,deleteKeyCode:u,selectionKeyCode:d,selectionOnDrag:f,selectionMode:h,onSelectionStart:p,onSelectionEnd:g,multiSelectionKeyCode:y,panActivationKeyCode:m,zoomActivationKeyCode:v,elementsSelectable:b,zoomOnScroll:x,zoomOnPinch:w,panOnScroll:_,panOnScrollSpeed:E,panOnScrollMode:k,zoomOnDoubleClick:O,panOnDrag:S,defaultViewport:C,translateExtent:N,minZoom:j,maxZoom:A,preventScrolling:P,onSelectionContextMenu:M,noWheelClassName:T,noPanClassName:L,disableKeyboardA11y:I,onViewportChange:R,isControlledViewport:q}){const{nodesSelectionActive:D,userSelectionActive:z}=fc(Cu),B=Dc(d,{target:Su}),$=Dc(m,{target:Su}),F=$||S,H=$||_,V=f&&!0!==F,U=B||z||V;return function({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=hc(),{deleteElements:o}=nu(),i=Dc(e,ru),a=Dc(t,{target:iu});(0,r.useEffect)(()=>{if(i){const{edges:e,nodes:t}=n.getState();o({nodes:t.filter(ou),edges:e.filter(ou)}),n.setState({nodesSelectionActive:!1})}},[i]),(0,r.useEffect)(()=>{n.setState({multiSelectionActive:a})},[a])}({deleteKeyCode:u,multiSelectionKeyCode:y}),(0,o.jsx)(lu,{onPaneContextMenu:s,elementsSelectable:b,zoomOnScroll:x,zoomOnPinch:w,panOnScroll:H,panOnScrollSpeed:E,panOnScrollMode:k,zoomOnDoubleClick:O,panOnDrag:!B&&F,defaultViewport:C,translateExtent:N,minZoom:j,maxZoom:A,zoomActivationKeyCode:v,preventScrolling:P,noWheelClassName:T,noPanClassName:L,onViewportChange:R,isControlledViewport:q,paneClickDistance:c,children:(0,o.jsxs)(hu,{onSelectionStart:p,onSelectionEnd:g,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:a,onPaneContextMenu:s,onPaneScroll:l,panOnDrag:F,isSelecting:!!U,selectionMode:h,selectionKeyPressed:B,selectionOnDrag:V,children:[e,D&&(0,o.jsx)(Ou,{onSelectionContextMenu:M,noPanClassName:L,disableKeyboardA11y:I})]})})}Nu.displayName="FlowRenderer";const ju=(0,r.memo)(Nu),Au=e=>e.updateNodeInternals;function Pu({id:e,onClick:t,onMouseEnter:n,onMouseMove:i,onMouseLeave:a,onContextMenu:s,onDoubleClick:l,nodesDraggable:c,elementsSelectable:u,nodesConnectable:d,nodesFocusable:f,resizeObserver:h,noDragClassName:p,noPanClassName:g,disableKeyboardA11y:y,rfId:m,nodeTypes:v,nodeClickDistance:b,onError:x}){const{node:w,internals:_,isParent:E}=fc(t=>{const n=t.nodeLookup.get(e),o=t.parentLookup.has(e);return{node:n,internals:n.internals,isParent:o}},lc);let k=w.type||"default",O=v?.[k]||Eu[k];void 0===O&&(x?.("003",(e=>`Node type "${e}" not found. Using fallback type "default".`)(k)),k="default",O=Eu.default);const S=!!(w.draggable||c&&void 0===w.draggable),C=!!(w.selectable||u&&void 0===w.selectable),N=!!(w.connectable||d&&void 0===w.connectable),j=!!(w.focusable||f&&void 0===w.focusable),A=hc(),P=Vs(w),M=function({node:e,nodeType:t,hasDimensions:n,resizeObserver:o}){const i=hc(),a=(0,r.useRef)(null),s=(0,r.useRef)(null),l=(0,r.useRef)(e.sourcePosition),c=(0,r.useRef)(e.targetPosition),u=(0,r.useRef)(t),d=n&&!!e.internals.handleBounds;return(0,r.useEffect)(()=>{!a.current||e.hidden||d&&s.current===a.current||(s.current&&o?.unobserve(s.current),o?.observe(a.current),s.current=a.current)},[d,e.hidden]),(0,r.useEffect)(()=>()=>{s.current&&(o?.unobserve(s.current),s.current=null)},[]),(0,r.useEffect)(()=>{if(a.current){const n=u.current!==t,o=l.current!==e.sourcePosition,r=c.current!==e.targetPosition;(n||o||r)&&(u.current=t,l.current=e.sourcePosition,c.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),a}({node:w,nodeType:k,hasDimensions:P,resizeObserver:h}),T=gu({nodeRef:M,disabled:w.hidden||!S,noDragClassName:p,handleSelector:w.dragHandle,nodeId:e,isSelectable:C,nodeClickDistance:b}),L=yu();if(w.hidden)return null;const I=Hs(w),R=function(e){return void 0===e.internals.handleBounds?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}(w),q=C||S||t||n||i||a,D=n?e=>n(e,{..._.userNode}):void 0,z=i?e=>i(e,{..._.userNode}):void 0,B=a?e=>a(e,{..._.userNode}):void 0,$=s?e=>s(e,{..._.userNode}):void 0,F=l?e=>l(e,{..._.userNode}):void 0;return(0,o.jsx)("div",{className:wo(["react-flow__node",`react-flow__node-${k}`,{[g]:S},w.className,{selected:w.selected,selectable:C,parent:E,draggable:S,dragging:T}]),ref:M,style:{zIndex:_.z,transform:`translate(${_.positionAbsolute.x}px,${_.positionAbsolute.y}px)`,pointerEvents:q?"all":"none",visibility:P?"visible":"hidden",...w.style,...R},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:D,onMouseMove:z,onMouseLeave:B,onContextMenu:$,onClick:n=>{const{selectNodesOnDrag:o,nodeDragThreshold:r}=A.getState();C&&(!o||!S||r>0)&&pu({id:e,store:A,nodeRef:M}),t&&t(n,{..._.userNode})},onDoubleClick:F,onKeyDown:j?t=>{if(!Gs(t.nativeEvent)&&!y)if(rs.includes(t.key)&&C){const n="Escape"===t.key;pu({id:e,store:A,unselect:n,nodeRef:M})}else S&&w.selected&&Object.prototype.hasOwnProperty.call(_u,t.key)&&(t.preventDefault(),A.setState({ariaLiveMessage:`Moved selected node ${t.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~_.positionAbsolute.x}, y: ${~~_.positionAbsolute.y}`}),L({direction:_u[t.key],factor:t.shiftKey?4:1}))}:void 0,tabIndex:j?0:void 0,role:j?"button":void 0,"aria-describedby":y?void 0:`${yc}-${m}`,"aria-label":w.ariaLabel,children:(0,o.jsx)(vu,{value:e,children:(0,o.jsx)(O,{id:e,data:w.data,type:k,positionAbsoluteX:_.positionAbsolute.x,positionAbsoluteY:_.positionAbsolute.y,selected:w.selected??!1,selectable:C,draggable:S,deletable:w.deletable??!0,isConnectable:N,sourcePosition:w.sourcePosition,targetPosition:w.targetPosition,dragging:T,dragHandle:w.dragHandle,zIndex:_.z,parentId:w.parentId,...I})})})}const Mu=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function Tu(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:i,elementsSelectable:a,onError:s}=fc(Mu,lc),l=function(e){return fc((0,r.useCallback)((e=>t=>e?bs(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(e=>e.id):Array.from(t.nodeLookup.keys()))(e),[e]),lc)}(e.onlyRenderVisibleElements),c=function(){const e=fc(Au),[t]=(0,r.useState)(()=>"undefined"==typeof ResizeObserver?null:new ResizeObserver(t=>{const n=new Map;t.forEach(e=>{const t=e.target.getAttribute("data-id");n.set(t,{id:t,nodeElement:e.target,force:!0})}),e(n)}));return(0,r.useEffect)(()=>()=>{t?.disconnect()},[t]),t}();return(0,o.jsx)("div",{className:"react-flow__nodes",style:au,children:l.map(r=>(0,o.jsx)(Pu,{id:r,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:c,nodesDraggable:t,nodesConnectable:n,nodesFocusable:i,elementsSelectable:a,nodeClickDistance:e.nodeClickDistance,onError:s},r))})}Tu.displayName="NodeRenderer";const Lu=(0,r.memo)(Tu),Iu={[ds.Arrow]:({color:e="none",strokeWidth:t=1})=>(0,o.jsx)("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),[ds.ArrowClosed]:({color:e="none",strokeWidth:t=1})=>(0,o.jsx)("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Ru=({id:e,type:t,color:n,width:i=12.5,height:a=12.5,markerUnits:s="strokeWidth",strokeWidth:l,orient:c="auto-start-reverse"})=>{const u=function(e){const t=hc();return(0,r.useMemo)(()=>Object.prototype.hasOwnProperty.call(Iu,e)?Iu[e]:(t.getState().onError?.("009",(e=>`Marker type "${e}" doesn't exist.`)(e)),null),[e])}(t);return u?(0,o.jsx)("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${i}`,markerHeight:`${a}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:c,refX:"0",refY:"0",children:(0,o.jsx)(u,{color:n,strokeWidth:l})}):null},qu=({defaultColor:e,rfId:t})=>{const n=fc(e=>e.edges),i=fc(e=>e.defaultEdgeOptions),a=(0,r.useMemo)(()=>{const o=function(e,{id:t,defaultColor:n,defaultMarkerStart:o,defaultMarkerEnd:r}){const i=new Set;return e.reduce((e,a)=>([a.markerStart||o,a.markerEnd||r].forEach(o=>{if(o&&"object"==typeof o){const r=yl(o,t);i.has(r)||(e.push({id:r,color:o.color||n,...o}),i.add(r))}}),e),[]).sort((e,t)=>e.id.localeCompare(t.id))}(n,{id:t,defaultColor:e,defaultMarkerStart:i?.markerStart,defaultMarkerEnd:i?.markerEnd});return o},[n,i,t,e]);return a.length?(0,o.jsx)("svg",{className:"react-flow__marker","aria-hidden":"true",children:(0,o.jsx)("defs",{children:a.map(e=>(0,o.jsx)(Ru,{id:e.id,type:e.type,color:e.color,width:e.width,height:e.height,markerUnits:e.markerUnits,strokeWidth:e.strokeWidth,orient:e.orient},e.id))})}):null};qu.displayName="MarkerDefinitions";var Du=(0,r.memo)(qu);function zu({x:e,y:t,label:n,labelStyle:i,labelShowBg:a=!0,labelBgStyle:s,labelBgPadding:l=[2,4],labelBgBorderRadius:c=2,children:u,className:d,...f}){const[h,p]=(0,r.useState)({x:1,y:0,width:0,height:0}),g=wo(["react-flow__edge-textwrapper",d]),y=(0,r.useRef)(null);return(0,r.useEffect)(()=>{if(y.current){const e=y.current.getBBox();p({x:e.x,y:e.y,width:e.width,height:e.height})}},[n]),n?(0,o.jsxs)("g",{transform:`translate(${e-h.width/2} ${t-h.height/2})`,className:g,visibility:h.width?"visible":"hidden",...f,children:[a&&(0,o.jsx)("rect",{width:h.width+2*l[0],x:-l[0],y:-l[1],height:h.height+2*l[1],className:"react-flow__edge-textbg",style:s,rx:c,ry:c}),(0,o.jsx)("text",{className:"react-flow__edge-text",y:h.height/2,dy:"0.3em",ref:y,style:i,children:n}),u]}):null}zu.displayName="EdgeText";const Bu=(0,r.memo)(zu);function $u({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:c,interactionWidth:u=20,...d}){return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("path",{...d,d:e,fill:"none",className:wo(["react-flow__edge-path",d.className])}),u&&(0,o.jsx)("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}),r&&Ls(t)&&Ls(n)?(0,o.jsx)(Bu,{x:t,y:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:c}):null]})}function Fu({pos:e,x1:t,y1:n,x2:o,y2:r}){return e===fs.Left||e===fs.Right?[.5*(t+o),n]:[t,.5*(n+r)]}function Hu({sourceX:e,sourceY:t,sourcePosition:n=fs.Bottom,targetX:o,targetY:r,targetPosition:i=fs.Top}){const[a,s]=Fu({pos:n,x1:e,y1:t,x2:o,y2:r}),[l,c]=Fu({pos:i,x1:o,y1:r,x2:e,y2:t}),[u,d,f,h]=tl({sourceX:e,sourceY:t,targetX:o,targetY:r,sourceControlX:a,sourceControlY:s,targetControlX:l,targetControlY:c});return[`M${e},${t} C${a},${s} ${l},${c} ${o},${r}`,u,d,f,h]}function Vu(e){return(0,r.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:s,targetPosition:l,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:g,markerEnd:y,markerStart:m,interactionWidth:v})=>{const[b,x,w]=Hu({sourceX:n,sourceY:r,sourcePosition:s,targetX:i,targetY:a,targetPosition:l}),_=e.isInternal?void 0:t;return(0,o.jsx)($u,{id:_,path:b,labelX:x,labelY:w,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:g,markerEnd:y,markerStart:m,interactionWidth:v})})}const Uu=Vu({isInternal:!1}),Ku=Vu({isInternal:!0});function Zu(e){return(0,r.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,sourcePosition:p=fs.Bottom,targetPosition:g=fs.Top,markerEnd:y,markerStart:m,pathOptions:v,interactionWidth:b})=>{const[x,w,_]=dl({sourceX:n,sourceY:r,sourcePosition:p,targetX:i,targetY:a,targetPosition:g,borderRadius:v?.borderRadius,offset:v?.offset}),E=e.isInternal?void 0:t;return(0,o.jsx)($u,{id:E,path:x,labelX:w,labelY:_,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:y,markerStart:m,interactionWidth:b})})}Uu.displayName="SimpleBezierEdge",Ku.displayName="SimpleBezierEdgeInternal";const Wu=Zu({isInternal:!1}),Yu=Zu({isInternal:!0});function Xu(e){return(0,r.memo)(({id:t,...n})=>{const i=e.isInternal?void 0:t;return(0,o.jsx)(Wu,{...n,id:i,pathOptions:(0,r.useMemo)(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}Wu.displayName="SmoothStepEdge",Yu.displayName="SmoothStepEdgeInternal";const Gu=Xu({isInternal:!1}),Qu=Xu({isInternal:!0});function Ju(e){return(0,r.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:g,interactionWidth:y})=>{const[m,v,b]=ll({sourceX:n,sourceY:r,targetX:i,targetY:a}),x=e.isInternal?void 0:t;return(0,o.jsx)($u,{id:x,path:m,labelX:v,labelY:b,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:g,interactionWidth:y})})}Gu.displayName="StepEdge",Qu.displayName="StepEdgeInternal";const ed=Ju({isInternal:!1}),td=Ju({isInternal:!0});function nd(e){return(0,r.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:s=fs.Bottom,targetPosition:l=fs.Top,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:g,markerEnd:y,markerStart:m,pathOptions:v,interactionWidth:b})=>{const[x,w,_]=rl({sourceX:n,sourceY:r,sourcePosition:s,targetX:i,targetY:a,targetPosition:l,curvature:v?.curvature}),E=e.isInternal?void 0:t;return(0,o.jsx)($u,{id:E,path:x,labelX:w,labelY:_,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:g,markerEnd:y,markerStart:m,interactionWidth:b})})}ed.displayName="StraightEdge",td.displayName="StraightEdgeInternal";const od=nd({isInternal:!1}),rd=nd({isInternal:!0});od.displayName="BezierEdge",rd.displayName="BezierEdgeInternal";const id={default:rd,straight:td,step:Qu,smoothstep:Yu,simplebezier:Ku},ad={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},sd=(e,t,n)=>n===fs.Left?e-t:n===fs.Right?e+t:e,ld=(e,t,n)=>n===fs.Top?e-t:n===fs.Bottom?e+t:e,cd="react-flow__edgeupdater";function ud({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:a,onMouseOut:s,type:l}){return(0,o.jsx)("circle",{onMouseDown:i,onMouseEnter:a,onMouseOut:s,className:wo([cd,`${cd}-${l}`]),cx:sd(t,r,e),cy:ld(n,r,e),r,stroke:"transparent",fill:"transparent"})}function dd({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:a,targetY:s,sourcePosition:l,targetPosition:c,onReconnect:u,onReconnectStart:d,onReconnectEnd:f,setReconnecting:h,setUpdateHover:p}){const g=hc(),y=(e,t)=>{if(0!==e.button)return;const{autoPanOnConnect:o,domNode:r,isValidConnection:i,connectionMode:a,connectionRadius:s,lib:l,onConnectStart:c,onConnectEnd:p,cancelConnection:y,nodeLookup:m,rfId:v,panBy:b,updateConnection:x}=g.getState(),w="target"===t.type;h(!0),d?.(e,n,t.type),Tl.onPointerDown(e.nativeEvent,{autoPanOnConnect:o,connectionMode:a,connectionRadius:s,domNode:r,handleId:t.id,nodeId:t.nodeId,nodeLookup:m,isTarget:w,edgeUpdaterType:t.type,lib:l,flowId:v,cancelConnection:y,panBy:b,isValidConnection:i,onConnect:e=>u?.(n,e),onConnectStart:c,onConnectEnd:p,onReconnectEnd:(e,o)=>{h(!1),f?.(e,n,t.type,o)},updateConnection:x,getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle})},m=()=>p(!0),v=()=>p(!1);return(0,o.jsxs)(o.Fragment,{children:[(!0===e||"source"===e)&&(0,o.jsx)(ud,{position:l,centerX:r,centerY:i,radius:t,onMouseDown:e=>y(e,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),onMouseEnter:m,onMouseOut:v,type:"source"}),(!0===e||"target"===e)&&(0,o.jsx)(ud,{position:c,centerX:a,centerY:s,radius:t,onMouseDown:e=>y(e,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),onMouseEnter:m,onMouseOut:v,type:"target"})]})}function fd({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:i,onClick:a,onDoubleClick:s,onContextMenu:l,onMouseEnter:c,onMouseMove:u,onMouseLeave:d,reconnectRadius:f,onReconnect:h,onReconnectStart:p,onReconnectEnd:g,rfId:y,edgeTypes:m,noPanClassName:v,onError:b,disableKeyboardA11y:x}){let w=fc(t=>t.edgeLookup.get(e));const _=fc(e=>e.defaultEdgeOptions);w=_?{..._,...w}:w;let E=w.type||"default",k=m?.[E]||id[E];void 0===k&&(b?.("011",(e=>`Edge type "${e}" not found. Using fallback type "default".`)(E)),E="default",k=id.default);const O=!!(w.focusable||t&&void 0===w.focusable),S=void 0!==h&&(w.reconnectable||n&&void 0===w.reconnectable),C=!!(w.selectable||i&&void 0===w.selectable),N=(0,r.useRef)(null),[j,A]=(0,r.useState)(!1),[P,M]=(0,r.useState)(!1),T=hc(),{zIndex:L,sourceX:I,sourceY:R,targetX:q,targetY:D,sourcePosition:z,targetPosition:B}=fc((0,r.useCallback)(t=>{const n=t.nodeLookup.get(w.source),o=t.nodeLookup.get(w.target);if(!n||!o)return{zIndex:w.zIndex,...ad};const r=function(e){const{sourceNode:t,targetNode:n}=e;if(!fl(t)||!fl(n))return null;const o=t.internals.handleBounds||hl(t.handles),r=n.internals.handleBounds||hl(n.handles),i=gl(o?.source??[],e.sourceHandle),a=gl(e.connectionMode===is.Strict?r?.target??[]:(r?.target??[]).concat(r?.source??[]),e.targetHandle);if(!i||!a)return e.onError?.("008",((e,{id:t,sourceHandle:n,targetHandle:o})=>`Couldn't create edge for ${e} handle id: "${"source"===e?n:o}", edge id: ${t}.`)(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const s=i?.position||fs.Bottom,l=a?.position||fs.Top,c=pl(t,i,s),u=pl(n,a,l);return{sourceX:c.x,sourceY:c.y,targetX:u.x,targetY:u.y,sourcePosition:s,targetPosition:l}}({id:e,sourceNode:n,targetNode:o,sourceHandle:w.sourceHandle||null,targetHandle:w.targetHandle||null,connectionMode:t.connectionMode,onError:b}),i=function({sourceNode:e,targetNode:t,selected:n=!1,zIndex:o=0,elevateOnSelect:r=!1}){if(!r)return o;const i=n||t.selected||e.selected,a=Math.max(e.internals.z||0,t.internals.z||0,1e3);return o+(i?a:0)}({selected:w.selected,zIndex:w.zIndex,sourceNode:n,targetNode:o,elevateOnSelect:t.elevateEdgesOnSelect});return{zIndex:i,...r||ad}},[w.source,w.target,w.sourceHandle,w.targetHandle,w.selected,w.zIndex]),lc),$=(0,r.useMemo)(()=>w.markerStart?`url('#${yl(w.markerStart,y)}')`:void 0,[w.markerStart,y]),F=(0,r.useMemo)(()=>w.markerEnd?`url('#${yl(w.markerEnd,y)}')`:void 0,[w.markerEnd,y]);if(w.hidden||null===I||null===R||null===q||null===D)return null;const H=s?e=>{s(e,{...w})}:void 0,V=l?e=>{l(e,{...w})}:void 0,U=c?e=>{c(e,{...w})}:void 0,K=u?e=>{u(e,{...w})}:void 0,Z=d?e=>{d(e,{...w})}:void 0;return(0,o.jsx)("svg",{style:{zIndex:L},children:(0,o.jsxs)("g",{className:wo(["react-flow__edge",`react-flow__edge-${E}`,w.className,v,{selected:w.selected,animated:w.animated,inactive:!C&&!a,updating:j,selectable:C}]),onClick:t=>{const{addSelectedEdges:n,unselectNodesAndEdges:o,multiSelectionActive:r}=T.getState();C&&(T.setState({nodesSelectionActive:!1}),w.selected&&r?(o({nodes:[],edges:[w]}),N.current?.blur()):n([e])),a&&a(t,w)},onDoubleClick:H,onContextMenu:V,onMouseEnter:U,onMouseMove:K,onMouseLeave:Z,onKeyDown:O?t=>{if(!x&&rs.includes(t.key)&&C){const{unselectNodesAndEdges:n,addSelectedEdges:o}=T.getState();"Escape"===t.key?(N.current?.blur(),n({edges:[w]})):o([e])}}:void 0,tabIndex:O?0:void 0,role:O?"button":"img","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":null===w.ariaLabel?void 0:w.ariaLabel||`Edge from ${w.source} to ${w.target}`,"aria-describedby":O?`${mc}-${y}`:void 0,ref:N,children:[!P&&(0,o.jsx)(k,{id:e,source:w.source,target:w.target,type:w.type,selected:w.selected,animated:w.animated,selectable:C,deletable:w.deletable??!0,label:w.label,labelStyle:w.labelStyle,labelShowBg:w.labelShowBg,labelBgStyle:w.labelBgStyle,labelBgPadding:w.labelBgPadding,labelBgBorderRadius:w.labelBgBorderRadius,sourceX:I,sourceY:R,targetX:q,targetY:D,sourcePosition:z,targetPosition:B,data:w.data,style:w.style,sourceHandleId:w.sourceHandle,targetHandleId:w.targetHandle,markerStart:$,markerEnd:F,pathOptions:"pathOptions"in w?w.pathOptions:void 0,interactionWidth:w.interactionWidth}),S&&(0,o.jsx)(dd,{edge:w,isReconnectable:S,reconnectRadius:f,onReconnect:h,onReconnectStart:p,onReconnectEnd:g,sourceX:I,sourceY:R,targetX:q,targetY:D,sourcePosition:z,targetPosition:B,setUpdateHover:A,setReconnecting:M})]})})}const hd=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function pd({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:i,noPanClassName:a,onReconnect:s,onEdgeContextMenu:l,onEdgeMouseEnter:c,onEdgeMouseMove:u,onEdgeMouseLeave:d,onEdgeClick:f,reconnectRadius:h,onEdgeDoubleClick:p,onReconnectStart:g,onReconnectEnd:y,disableKeyboardA11y:m}){const{edgesFocusable:v,edgesReconnectable:b,elementsSelectable:x,onError:w}=fc(hd,lc),_=fc((0,r.useCallback)(e=>{if(!E)return e.edges.map(e=>e.id);const t=[];if(e.width&&e.height)for(const n of e.edges){const o=e.nodeLookup.get(n.source),r=e.nodeLookup.get(n.target);o&&r&&al({sourceNode:o,targetNode:r,width:e.width,height:e.height,transform:e.transform})&&t.push(n.id)}return t},[E=t]),lc);var E;return(0,o.jsxs)("div",{className:"react-flow__edges",children:[(0,o.jsx)(Du,{defaultColor:e,rfId:n}),_.map(e=>(0,o.jsx)(fd,{id:e,edgesFocusable:v,edgesReconnectable:b,elementsSelectable:x,noPanClassName:a,onReconnect:s,onContextMenu:l,onMouseEnter:c,onMouseMove:u,onMouseLeave:d,onClick:f,reconnectRadius:h,onDoubleClick:p,onReconnectStart:g,onReconnectEnd:y,rfId:n,onError:w,edgeTypes:i,disableKeyboardA11y:m},e))]})}pd.displayName="EdgeRenderer";const gd=(0,r.memo)(pd),yd=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function md({children:e}){const t=fc(yd);return(0,o.jsx)("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}const vd=e=>e.panZoom?.syncViewport;function bd(e){return e.connection.inProgress?{...e.connection,to:qs(e.connection.to,e.transform)}:{...e.connection}}const xd=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function wd({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:i,width:a,height:s,isValid:l,inProgress:c}=fc(xd,lc);return a&&i&&c?(0,o.jsx)("svg",{style:e,width:a,height:s,className:"react-flow__connectionline react-flow__container",children:(0,o.jsx)("g",{className:wo(["react-flow__connection",ps(l)]),children:(0,o.jsx)(_d,{style:t,type:n,CustomComponent:r,isValid:l})})}):null}const _d=({style:e,type:t=us.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:i,from:a,fromNode:s,fromHandle:l,fromPosition:c,to:u,toNode:d,toHandle:f,toPosition:h}=fc(bd,lc);if(!i)return;if(n)return(0,o.jsx)(n,{connectionLineType:t,connectionLineStyle:e,fromNode:s,fromHandle:l,fromX:a.x,fromY:a.y,toX:u.x,toY:u.y,fromPosition:c,toPosition:h,connectionStatus:ps(r),toNode:d,toHandle:f});let p="";const g={sourceX:a.x,sourceY:a.y,sourcePosition:c,targetX:u.x,targetY:u.y,targetPosition:h};switch(t){case us.Bezier:[p]=rl(g);break;case us.SimpleBezier:[p]=Hu(g);break;case us.Step:[p]=dl({...g,borderRadius:0});break;case us.SmoothStep:[p]=dl(g);break;default:[p]=ll(g)}return(0,o.jsx)("path",{d:p,fill:"none",className:"react-flow__connection-path",style:e})};_d.displayName="ConnectionLine";const Ed={};function kd(e=Ed){(0,r.useRef)(e),hc(),(0,r.useEffect)(()=>{},[e])}function Od({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:i,onEdgeClick:a,onNodeDoubleClick:s,onEdgeDoubleClick:l,onNodeMouseEnter:c,onNodeMouseMove:u,onNodeMouseLeave:d,onNodeContextMenu:f,onSelectionContextMenu:h,onSelectionStart:p,onSelectionEnd:g,connectionLineType:y,connectionLineStyle:m,connectionLineComponent:v,connectionLineContainerStyle:b,selectionKeyCode:x,selectionOnDrag:w,selectionMode:_,multiSelectionKeyCode:E,panActivationKeyCode:k,zoomActivationKeyCode:O,deleteKeyCode:S,onlyRenderVisibleElements:C,elementsSelectable:N,defaultViewport:j,translateExtent:A,minZoom:P,maxZoom:M,preventScrolling:T,defaultMarkerColor:L,zoomOnScroll:I,zoomOnPinch:R,panOnScroll:q,panOnScrollSpeed:D,panOnScrollMode:z,zoomOnDoubleClick:B,panOnDrag:$,onPaneClick:F,onPaneMouseEnter:H,onPaneMouseMove:V,onPaneMouseLeave:U,onPaneScroll:K,onPaneContextMenu:Z,paneClickDistance:W,nodeClickDistance:Y,onEdgeContextMenu:X,onEdgeMouseEnter:G,onEdgeMouseMove:Q,onEdgeMouseLeave:J,reconnectRadius:ee,onReconnect:te,onReconnectStart:ne,onReconnectEnd:oe,noDragClassName:re,noWheelClassName:ie,noPanClassName:ae,disableKeyboardA11y:se,nodeExtent:le,rfId:ce,viewport:ue,onViewportChange:de}){return kd(e),kd(t),hc(),(0,r.useRef)(!1),(0,r.useEffect)(()=>{},[]),function(e){const t=nu(),n=(0,r.useRef)(!1);(0,r.useEffect)(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}(n),function(e){const t=fc(vd),n=hc();(0,r.useEffect)(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t])}(ue),(0,o.jsx)(ju,{onPaneClick:F,onPaneMouseEnter:H,onPaneMouseMove:V,onPaneMouseLeave:U,onPaneContextMenu:Z,onPaneScroll:K,paneClickDistance:W,deleteKeyCode:S,selectionKeyCode:x,selectionOnDrag:w,selectionMode:_,onSelectionStart:p,onSelectionEnd:g,multiSelectionKeyCode:E,panActivationKeyCode:k,zoomActivationKeyCode:O,elementsSelectable:N,zoomOnScroll:I,zoomOnPinch:R,zoomOnDoubleClick:B,panOnScroll:q,panOnScrollSpeed:D,panOnScrollMode:z,panOnDrag:$,defaultViewport:j,translateExtent:A,minZoom:P,maxZoom:M,onSelectionContextMenu:h,preventScrolling:T,noDragClassName:re,noWheelClassName:ie,noPanClassName:ae,disableKeyboardA11y:se,onViewportChange:de,isControlledViewport:!!ue,children:(0,o.jsxs)(md,{children:[(0,o.jsx)(gd,{edgeTypes:t,onEdgeClick:a,onEdgeDoubleClick:l,onReconnect:te,onReconnectStart:ne,onReconnectEnd:oe,onlyRenderVisibleElements:C,onEdgeContextMenu:X,onEdgeMouseEnter:G,onEdgeMouseMove:Q,onEdgeMouseLeave:J,reconnectRadius:ee,defaultMarkerColor:L,noPanClassName:ae,disableKeyboardA11y:se,rfId:ce}),(0,o.jsx)(wd,{style:m,type:y,component:v,containerStyle:b}),(0,o.jsx)("div",{className:"react-flow__edgelabel-renderer"}),(0,o.jsx)(Lu,{nodeTypes:e,onNodeClick:i,onNodeDoubleClick:s,onNodeMouseEnter:c,onNodeMouseMove:u,onNodeMouseLeave:d,onNodeContextMenu:f,nodeClickDistance:Y,onlyRenderVisibleElements:C,noPanClassName:ae,noDragClassName:re,disableKeyboardA11y:se,nodeExtent:le,rfId:ce}),(0,o.jsx)("div",{className:"react-flow__viewport-portal"})]})})}Od.displayName="GraphView";const Sd=(0,r.memo)(Od),Cd=({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,width:r,height:i,fitView:a,fitViewOptions:s,minZoom:l=.5,maxZoom:c=2,nodeOrigin:u,nodeExtent:d}={})=>{const f=new Map,h=new Map,p=new Map,g=new Map,y=o??t??[],m=n??e??[],v=u??[0,0],b=d??os;Ol(p,g,y);const x=xl(m,f,h,{nodeOrigin:v,nodeExtent:b,elevateNodesOnSelect:!1});let w=[0,0,1];if(a&&r&&i){const e=vs(f,{filter:e=>!(!e.width&&!e.initialWidth||!e.height&&!e.initialHeight)}),{x:t,y:n,zoom:o}=Bs(e,r,i,l,c,s?.padding??.1);w=[t,n,o]}return{rfId:"1",width:0,height:0,transform:w,nodes:m,nodesInitialized:x,nodeLookup:f,parentLookup:h,edges:y,edgeLookup:g,connectionLookup:p,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:void 0!==n,hasDefaultEdges:void 0!==o,panZoom:null,minZoom:l,maxZoom:c,translateExtent:os,nodeExtent:b,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:is.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:v,nodeDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:a??!1,fitViewOptions:s,fitViewResolver:null,connection:{...cs},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanSpeed:15,connectionRadius:20,onError:Is,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1}};function Nd({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:i,initialWidth:a,initialHeight:s,initialMinZoom:l,initialMaxZoom:c,initialFitViewOptions:u,fitView:d,nodeOrigin:f,nodeExtent:h,children:p}){const[g]=(0,r.useState)(()=>(({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,width:r,height:i,fitView:a,fitViewOptions:s,minZoom:l,maxZoom:c,nodeOrigin:u,nodeExtent:d})=>{return f=(f,h)=>{async function p(){const{nodeLookup:e,panZoom:t,fitViewOptions:n,fitViewResolver:o,width:r,height:i,minZoom:a,maxZoom:s}=h();t&&(await async function({nodes:e,width:t,height:n,panZoom:o,minZoom:r,maxZoom:i},a){if(0===e.size)return Promise.resolve(!0);const s=function(e,t){const n=new Map,o=t?.nodes?new Set(t.nodes.map(e=>e.id)):null;return e.forEach(e=>{!e.measured.width||!e.measured.height||!t?.includeHiddenNodes&&e.hidden||o&&!o.has(e.id)||n.set(e.id,e)}),n}(e,a),l=vs(s),c=Bs(l,t,n,a?.minZoom??r,a?.maxZoom??i,a?.padding??.1);return await o.setViewport(c,{duration:a?.duration}),Promise.resolve(!0)}({nodes:e,width:r,height:i,panZoom:t,minZoom:a,maxZoom:s},n),o?.resolve(!0),f({fitViewResolver:null}))}return{...Cd({nodes:e,edges:t,width:r,height:i,fitView:a,fitViewOptions:s,minZoom:l,maxZoom:c,nodeOrigin:u,nodeExtent:d,defaultNodes:n,defaultEdges:o}),setNodes:e=>{const{nodeLookup:t,parentLookup:n,nodeOrigin:o,elevateNodesOnSelect:r,fitViewQueued:i}=h(),a=xl(e,t,n,{nodeOrigin:o,nodeExtent:d,elevateNodesOnSelect:r,checkEquality:!0});i&&a?(p(),f({nodes:e,nodesInitialized:a,fitViewQueued:!1,fitViewOptions:void 0})):f({nodes:e,nodesInitialized:a})},setEdges:e=>{const{connectionLookup:t,edgeLookup:n}=h();Ol(t,n,e),f({edges:e})},setDefaultNodesAndEdges:(e,t)=>{if(e){const{setNodes:t}=h();t(e),f({hasDefaultNodes:!0})}if(t){const{setEdges:e}=h();e(t),f({hasDefaultEdges:!0})}},updateNodeInternals:e=>{const{triggerNodeChanges:t,nodeLookup:n,parentLookup:o,domNode:r,nodeOrigin:i,nodeExtent:a,debug:s,fitViewQueued:l}=h(),{changes:c,updatedInternals:u}=function(e,t,n,o,r,i){const a=o?.querySelector(".xyflow__viewport");let s=!1;if(!a)return{changes:[],updatedInternals:s};const l=[],c=window.getComputedStyle(a),{m22:u}=new window.DOMMatrixReadOnly(c.transform),d=[];for(const o of e.values()){const e=t.get(o.id);if(!e)continue;if(e.hidden){t.set(e.id,{...e,internals:{...e.internals,handleBounds:void 0}}),s=!0;continue}const a=Ws(o.nodeElement),c=e.measured.width!==a.width||e.measured.height!==a.height;if(a.width&&a.height&&(c||!e.internals.handleBounds||o.force)){const f=o.nodeElement.getBoundingClientRect(),h=Fs(e.extent)?e.extent:i;let{positionAbsolute:p}=e.internals;e.parentId&&"parent"===e.extent?p=Es(p,a,t.get(e.parentId)):h&&(p=_s(p,h,a));const g={...e,measured:a,internals:{...e.internals,positionAbsolute:p,handleBounds:{source:el("source",o.nodeElement,f,u,e.id),target:el("target",o.nodeElement,f,u,e.id)}}};t.set(e.id,g),e.parentId&&wl(g,t,n,{nodeOrigin:r}),s=!0,c&&(l.push({id:e.id,type:"dimensions",dimensions:a}),e.expandParent&&e.parentId&&d.push({id:e.id,parentId:e.parentId,rect:js(g,r)}))}}if(d.length>0){const e=El(d,t,n,r);l.push(...e)}return{changes:l,updatedInternals:s}}(e,n,o,r,i,a);u&&(function(e,t,n){const o=bl(ml,n);for(const n of e.values())if(n.parentId)wl(n,e,t,o);else{const e=ms(n,o.nodeOrigin),t=Fs(n.extent)?n.extent:o.nodeExtent,r=_s(e,t,Hs(n));n.internals.positionAbsolute=r}}(n,o,{nodeOrigin:i,nodeExtent:a}),l?(p(),f({fitViewQueued:!1,fitViewOptions:void 0})):f({}),c?.length>0&&(s&&console.log("React Flow: trigger node changes",c),t?.(c)))},updateNodePositions:(e,t=!1)=>{const n=[],o=[],{nodeLookup:r,triggerNodeChanges:i}=h();for(const[i,a]of e){const e=r.get(i),s=!!(e?.expandParent&&e?.parentId&&a?.position),l={id:i,type:"position",position:s?{x:Math.max(0,a.position.x),y:Math.max(0,a.position.y)}:a.position,dragging:t};s&&e.parentId&&n.push({id:i,parentId:e.parentId,rect:{...a.internals.positionAbsolute,width:a.measured.width??0,height:a.measured.height??0}}),o.push(l)}if(n.length>0){const{parentLookup:e,nodeOrigin:t}=h(),i=El(n,r,e,t);o.push(...i)}i(o)},triggerNodeChanges:e=>{const{onNodesChange:t,setNodes:n,nodes:o,hasDefaultNodes:r,debug:i}=h();e?.length&&(r&&n(Hc(e,o)),i&&console.log("React Flow: trigger node changes",e),t?.(e))},triggerEdgeChanges:e=>{const{onEdgesChange:t,setEdges:n,edges:o,hasDefaultEdges:r,debug:i}=h();e?.length&&(r&&n(Vc(e,o)),i&&console.log("React Flow: trigger edge changes",e),t?.(e))},addSelectedNodes:e=>{const{multiSelectionActive:t,edgeLookup:n,nodeLookup:o,triggerNodeChanges:r,triggerEdgeChanges:i}=h();t?r(e.map(e=>Uc(e,!0))):(r(Kc(o,new Set([...e]),!0)),i(Kc(n)))},addSelectedEdges:e=>{const{multiSelectionActive:t,edgeLookup:n,nodeLookup:o,triggerNodeChanges:r,triggerEdgeChanges:i}=h();t?i(e.map(e=>Uc(e,!0))):(i(Kc(n,new Set([...e]))),r(Kc(o,new Set,!0)))},unselectNodesAndEdges:({nodes:e,edges:t}={})=>{const{edges:n,nodes:o,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=h(),s=t||n,l=(e||o).map(e=>{const t=r.get(e.id);return t&&(t.selected=!1),Uc(e.id,!1)}),c=s.map(e=>Uc(e.id,!1));i(l),a(c)},setMinZoom:e=>{const{panZoom:t,maxZoom:n}=h();t?.setScaleExtent([e,n]),f({minZoom:e})},setMaxZoom:e=>{const{panZoom:t,minZoom:n}=h();t?.setScaleExtent([n,e]),f({maxZoom:e})},setTranslateExtent:e=>{h().panZoom?.setTranslateExtent(e),f({translateExtent:e})},setPaneClickDistance:e=>{h().panZoom?.setClickDistance(e)},resetSelectedElements:()=>{const{edges:e,nodes:t,triggerNodeChanges:n,triggerEdgeChanges:o,elementsSelectable:r}=h();if(!r)return;const i=t.reduce((e,t)=>t.selected?[...e,Uc(t.id,!1)]:e,[]),a=e.reduce((e,t)=>t.selected?[...e,Uc(t.id,!1)]:e,[]);n(i),o(a)},setNodeExtent:e=>{const{nodes:t,nodeLookup:n,parentLookup:o,nodeOrigin:r,elevateNodesOnSelect:i,nodeExtent:a}=h();e[0][0]===a[0][0]&&e[0][1]===a[0][1]&&e[1][0]===a[1][0]&&e[1][1]===a[1][1]||(xl(t,n,o,{nodeOrigin:r,nodeExtent:e,elevateNodesOnSelect:i,checkEquality:!1}),f({nodeExtent:e}))},panBy:e=>{const{transform:t,width:n,height:o,panZoom:r,translateExtent:i}=h();return async function({delta:e,panZoom:t,transform:n,translateExtent:o,width:r,height:i}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const a=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[r,i]],o),s=!!a&&(a.x!==n[0]||a.y!==n[1]||a.k!==n[2]);return Promise.resolve(s)}({delta:e,panZoom:r,transform:t,translateExtent:i,width:n,height:o})},cancelConnection:()=>{f({connection:{...cs}})},updateConnection:e=>{f({connection:e})},reset:()=>f({...Cd()})}},h=Object.is,f?sc(f,h):sc;var f,h})({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:a,height:s,fitView:d,minZoom:l,maxZoom:c,fitViewOptions:u,nodeOrigin:f,nodeExtent:h}));return(0,o.jsx)(uc,{value:g,children:(0,o.jsx)(eu,{children:p})})}function jd({children:e,nodes:t,edges:n,defaultNodes:i,defaultEdges:a,width:s,height:l,fitView:c,fitViewOptions:u,minZoom:d,maxZoom:f,nodeOrigin:h,nodeExtent:p}){return(0,r.useContext)(cc)?(0,o.jsx)(o.Fragment,{children:e}):(0,o.jsx)(Nd,{initialNodes:t,initialEdges:n,defaultNodes:i,defaultEdges:a,initialWidth:s,initialHeight:l,fitView:c,initialFitViewOptions:u,initialMinZoom:d,initialMaxZoom:f,nodeOrigin:h,nodeExtent:p,children:e})}const Ad={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};var Pd=Xc(function({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,className:a,nodeTypes:s,edgeTypes:l,onNodeClick:c,onEdgeClick:u,onInit:d,onMove:f,onMoveStart:h,onMoveEnd:p,onConnect:g,onConnectStart:y,onConnectEnd:m,onClickConnectStart:v,onClickConnectEnd:b,onNodeMouseEnter:x,onNodeMouseMove:w,onNodeMouseLeave:_,onNodeContextMenu:E,onNodeDoubleClick:k,onNodeDragStart:O,onNodeDrag:S,onNodeDragStop:C,onNodesDelete:N,onEdgesDelete:j,onDelete:A,onSelectionChange:P,onSelectionDragStart:M,onSelectionDrag:T,onSelectionDragStop:L,onSelectionContextMenu:I,onSelectionStart:R,onSelectionEnd:q,onBeforeDelete:D,connectionMode:z,connectionLineType:B=us.Bezier,connectionLineStyle:$,connectionLineComponent:F,connectionLineContainerStyle:H,deleteKeyCode:V="Backspace",selectionKeyCode:U="Shift",selectionOnDrag:K=!1,selectionMode:Z=ss.Full,panActivationKeyCode:W="Space",multiSelectionKeyCode:Y=($s()?"Meta":"Control"),zoomActivationKeyCode:X=($s()?"Meta":"Control"),snapToGrid:G,snapGrid:Q,onlyRenderVisibleElements:J=!1,selectNodesOnDrag:ee,nodesDraggable:te,nodesConnectable:ne,nodesFocusable:oe,nodeOrigin:re=Ac,edgesFocusable:ie,edgesReconnectable:ae,elementsSelectable:se=!0,defaultViewport:le=Pc,minZoom:ce=.5,maxZoom:ue=2,translateExtent:de=os,preventScrolling:fe=!0,nodeExtent:he,defaultMarkerColor:pe="#b1b1b7",zoomOnScroll:ge=!0,zoomOnPinch:ye=!0,panOnScroll:me=!1,panOnScrollSpeed:ve=.5,panOnScrollMode:be=as.Free,zoomOnDoubleClick:xe=!0,panOnDrag:we=!0,onPaneClick:_e,onPaneMouseEnter:Ee,onPaneMouseMove:ke,onPaneMouseLeave:Oe,onPaneScroll:Se,onPaneContextMenu:Ce,paneClickDistance:Ne=0,nodeClickDistance:je=0,children:Ae,onReconnect:Pe,onReconnectStart:Me,onReconnectEnd:Te,onEdgeContextMenu:Le,onEdgeDoubleClick:Ie,onEdgeMouseEnter:Re,onEdgeMouseMove:qe,onEdgeMouseLeave:De,reconnectRadius:ze=10,onNodesChange:Be,onEdgesChange:$e,noDragClassName:Fe="nodrag",noWheelClassName:He="nowheel",noPanClassName:Ve="nopan",fitView:Ue,fitViewOptions:Ke,connectOnClick:Ze,attributionPosition:We,proOptions:Ye,defaultEdgeOptions:Xe,elevateNodesOnSelect:Ge,elevateEdgesOnSelect:Qe,disableKeyboardA11y:Je=!1,autoPanOnConnect:et,autoPanOnNodeDrag:tt,autoPanSpeed:nt,connectionRadius:ot,isValidConnection:rt,onError:it,style:at,id:st,nodeDragThreshold:lt,viewport:ct,onViewportChange:ut,width:dt,height:ft,colorMode:ht="light",debug:pt,onScroll:gt,...yt},mt){const vt=st||"1",bt=function(e){const[t,n]=(0,r.useState)("system"===e?null:e);return(0,r.useEffect)(()=>{if("system"!==e)return void n(e);const t=Rc(),o=()=>n(t?.matches?"dark":"light");return o(),t?.addEventListener("change",o),()=>{t?.removeEventListener("change",o)}},[e]),null!==t?t:Rc()?.matches?"dark":"light"}(ht),xt=(0,r.useCallback)(e=>{e.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),gt?.(e)},[gt]);return(0,o.jsx)("div",{"data-testid":"rf__wrapper",...yt,onScroll:xt,style:{...at,...Ad},ref:mt,className:wo(["react-flow",a,bt]),id:st,children:(0,o.jsxs)(jd,{nodes:e,edges:t,width:dt,height:ft,fitView:Ue,fitViewOptions:Ke,minZoom:ce,maxZoom:ue,nodeOrigin:re,nodeExtent:he,children:[(0,o.jsx)(Sd,{onInit:d,onNodeClick:c,onEdgeClick:u,onNodeMouseEnter:x,onNodeMouseMove:w,onNodeMouseLeave:_,onNodeContextMenu:E,onNodeDoubleClick:k,nodeTypes:s,edgeTypes:l,connectionLineType:B,connectionLineStyle:$,connectionLineComponent:F,connectionLineContainerStyle:H,selectionKeyCode:U,selectionOnDrag:K,selectionMode:Z,deleteKeyCode:V,multiSelectionKeyCode:Y,panActivationKeyCode:W,zoomActivationKeyCode:X,onlyRenderVisibleElements:J,defaultViewport:le,translateExtent:de,minZoom:ce,maxZoom:ue,preventScrolling:fe,zoomOnScroll:ge,zoomOnPinch:ye,zoomOnDoubleClick:xe,panOnScroll:me,panOnScrollSpeed:ve,panOnScrollMode:be,panOnDrag:we,onPaneClick:_e,onPaneMouseEnter:Ee,onPaneMouseMove:ke,onPaneMouseLeave:Oe,onPaneScroll:Se,onPaneContextMenu:Ce,paneClickDistance:Ne,nodeClickDistance:je,onSelectionContextMenu:I,onSelectionStart:R,onSelectionEnd:q,onReconnect:Pe,onReconnectStart:Me,onReconnectEnd:Te,onEdgeContextMenu:Le,onEdgeDoubleClick:Ie,onEdgeMouseEnter:Re,onEdgeMouseMove:qe,onEdgeMouseLeave:De,reconnectRadius:ze,defaultMarkerColor:pe,noDragClassName:Fe,noWheelClassName:He,noPanClassName:Ve,rfId:vt,disableKeyboardA11y:Je,nodeExtent:he,viewport:ct,onViewportChange:ut}),(0,o.jsx)(Ic,{nodes:e,edges:t,defaultNodes:n,defaultEdges:i,onConnect:g,onConnectStart:y,onConnectEnd:m,onClickConnectStart:v,onClickConnectEnd:b,nodesDraggable:te,nodesConnectable:ne,nodesFocusable:oe,edgesFocusable:ie,edgesReconnectable:ae,elementsSelectable:se,elevateNodesOnSelect:Ge,elevateEdgesOnSelect:Qe,minZoom:ce,maxZoom:ue,nodeExtent:he,onNodesChange:Be,onEdgesChange:$e,snapToGrid:G,snapGrid:Q,connectionMode:z,translateExtent:de,connectOnClick:Ze,defaultEdgeOptions:Xe,fitView:Ue,fitViewOptions:Ke,onNodesDelete:N,onEdgesDelete:j,onDelete:A,onNodeDragStart:O,onNodeDrag:S,onNodeDragStop:C,onSelectionDrag:T,onSelectionDragStart:M,onSelectionDragStop:L,onMove:f,onMoveStart:h,onMoveEnd:p,noPanClassName:Ve,nodeOrigin:re,rfId:vt,autoPanOnConnect:et,autoPanOnNodeDrag:tt,autoPanSpeed:nt,onError:it,connectionRadius:ot,isValidConnection:rt,selectNodesOnDrag:ee,nodeDragThreshold:lt,onBeforeDelete:D,paneClickDistance:Ne,debug:pt}),(0,o.jsx)(jc,{onSelectionChange:P}),Ae,(0,o.jsx)(Ec,{proOptions:Ye,position:We}),(0,o.jsx)(xc,{rfId:vt,disableKeyboardA11y:Je})]})})});const Md=e=>e.domNode?.querySelector(".react-flow__edgelabel-renderer");function Td({children:e}){const t=fc(Md);return t?(0,k.createPortal)(e,t):null}function Ld({dimensions:e,lineWidth:t,variant:n,className:r}){return(0,o.jsx)("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:wo(["react-flow__background-pattern",n,r])})}function Id({radius:e,className:t}){return(0,o.jsx)("circle",{cx:e,cy:e,r:e,className:wo(["react-flow__background-pattern","dots",t])})}var Rd;!function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"}(Rd||(Rd={}));const qd={[Rd.Dots]:1,[Rd.Lines]:1,[Rd.Cross]:6},Dd=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function zd({id:e,variant:t=Rd.Dots,gap:n=20,size:i,lineWidth:a=1,offset:s=0,color:l,bgColor:c,style:u,className:d,patternClassName:f}){const h=(0,r.useRef)(null),{transform:p,patternId:g}=fc(Dd,lc),y=i||qd[t],m=t===Rd.Dots,v=t===Rd.Cross,b=Array.isArray(n)?n:[n,n],x=[b[0]*p[2]||1,b[1]*p[2]||1],w=y*p[2],_=Array.isArray(s)?s:[s,s],E=v?[w,w]:x,k=[_[0]*p[2]||1+E[0]/2,_[1]*p[2]||1+E[1]/2],O=`${g}${e||""}`;return(0,o.jsxs)("svg",{className:wo(["react-flow__background",d]),style:{...u,...au,"--xy-background-color-props":c,"--xy-background-pattern-color-props":l},ref:h,"data-testid":"rf__background",children:[(0,o.jsx)("pattern",{id:O,x:p[0]%x[0],y:p[1]%x[1],width:x[0],height:x[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${k[0]},-${k[1]})`,children:m?(0,o.jsx)(Id,{radius:w/2,className:f}):(0,o.jsx)(Ld,{dimensions:E,lineWidth:a,variant:t,className:f})}),(0,o.jsx)("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${O})`})]})}zd.displayName="Background";const Bd=(0,r.memo)(zd);function $d(){return(0,o.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:(0,o.jsx)("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function Fd(){return(0,o.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:(0,o.jsx)("path",{d:"M0 0h32v4.2H0z"})})}function Hd(){return(0,o.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:(0,o.jsx)("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function Vd(){return(0,o.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:(0,o.jsx)("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function Ud(){return(0,o.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:(0,o.jsx)("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function Kd({children:e,className:t,...n}){return(0,o.jsx)("button",{type:"button",className:wo(["react-flow__controls-button",t]),...n,children:e})}const Zd=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom});function Wd({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:a,onZoomOut:s,onFitView:l,onInteractiveChange:c,className:u,children:d,position:f="bottom-left",orientation:h="vertical","aria-label":p="React Flow controls"}){const g=hc(),{isInteractive:y,minZoomReached:m,maxZoomReached:v}=fc(Zd,lc),{zoomIn:b,zoomOut:x,fitView:w}=nu();return(0,o.jsxs)(_c,{className:wo(["react-flow__controls","horizontal"===h?"horizontal":"vertical",u]),position:f,style:e,"data-testid":"rf__controls","aria-label":p,children:[t&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(Kd,{onClick:()=>{b(),a?.()},className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:v,children:(0,o.jsx)($d,{})}),(0,o.jsx)(Kd,{onClick:()=>{x(),s?.()},className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:m,children:(0,o.jsx)(Fd,{})})]}),n&&(0,o.jsx)(Kd,{className:"react-flow__controls-fitview",onClick:()=>{w(i),l?.()},title:"fit view","aria-label":"fit view",children:(0,o.jsx)(Hd,{})}),r&&(0,o.jsx)(Kd,{className:"react-flow__controls-interactive",onClick:()=>{g.setState({nodesDraggable:!y,nodesConnectable:!y,elementsSelectable:!y}),c?.(!y)},title:"toggle interactivity","aria-label":"toggle interactivity",children:(0,o.jsx)(y?Ud:Vd,{})}),d]})}Wd.displayName="Controls";const Yd=(0,r.memo)(Wd),Xd=(0,r.memo)(function({id:e,x:t,y:n,width:r,height:i,style:a,color:s,strokeColor:l,strokeWidth:c,className:u,borderRadius:d,shapeRendering:f,selected:h,onClick:p}){const{background:g,backgroundColor:y}=a||{},m=s||g||y;return(0,o.jsx)("rect",{className:wo(["react-flow__minimap-node",{selected:h},u]),x:t,y:n,rx:d,ry:d,width:r,height:i,style:{fill:m,stroke:l,strokeWidth:c},shapeRendering:f,onClick:p?t=>p(t,e):void 0})}),Gd=e=>e.nodes.map(e=>e.id),Qd=e=>e instanceof Function?e:()=>e,Jd=(0,r.memo)(function({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:a,shapeRendering:s,NodeComponent:l,onClick:c}){const{node:u,x:d,y:f,width:h,height:p}=fc(t=>{const{internals:n}=t.nodeLookup.get(e),o=n.userNode,{x:r,y:i}=n.positionAbsolute,{width:a,height:s}=Hs(o);return{node:o,x:r,y:i,width:a,height:s}},lc);return u&&!u.hidden&&Vs(u)?(0,o.jsx)(l,{x:d,y:f,width:h,height:p,style:u.style,selected:!!u.selected,className:r(u),color:t(u),borderRadius:i,strokeColor:n(u),strokeWidth:a,shapeRendering:s,onClick:c,id:u.id}):null});var ef=(0,r.memo)(function({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:a=Xd,onClick:s}){const l=fc(Gd,lc),c=Qd(t),u=Qd(e),d=Qd(n),f="undefined"==typeof window||window.chrome?"crispEdges":"geometricPrecision";return(0,o.jsx)(o.Fragment,{children:l.map(e=>(0,o.jsx)(Jd,{id:e,nodeColorFunc:c,nodeStrokeColorFunc:u,nodeClassNameFunc:d,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:a,onClick:s,shapeRendering:f},e))})});const tf=e=>!e.hidden,nf=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?Ps(vs(e.nodeLookup,{filter:tf}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height}};function of({style:e,className:t,nodeStrokeColor:n,nodeColor:i,nodeClassName:a="",nodeBorderRadius:s=5,nodeStrokeWidth:l,nodeComponent:c,bgColor:u,maskColor:d,maskStrokeColor:f,maskStrokeWidth:h,position:p="bottom-right",onClick:g,onNodeClick:y,pannable:m=!1,zoomable:v=!1,ariaLabel:b="React Flow mini map",inversePan:x,zoomStep:w=10,offsetScale:_=5}){const E=hc(),k=(0,r.useRef)(null),{boundingRect:O,viewBB:S,rfId:C,panZoom:N,translateExtent:j,flowWidth:A,flowHeight:P}=fc(nf,lc),M=e?.width??200,T=e?.height??150,L=O.width/M,I=O.height/T,R=Math.max(L,I),q=R*M,D=R*T,z=_*R,B=O.x-(q-O.width)/2-z,$=O.y-(D-O.height)/2-z,F=q+2*z,H=D+2*z,V=`react-flow__minimap-desc-${C}`,U=(0,r.useRef)(0),K=(0,r.useRef)();U.current=R,(0,r.useEffect)(()=>{if(k.current&&N)return K.current=function({domNode:e,panZoom:t,getTransform:n,getViewScale:o}){const r=qr(e);return{update:function({translateExtent:e,width:i,height:a,zoomStep:s=10,pannable:l=!0,zoomable:c=!0,inversePan:u=!1}){let d=[0,0];const f=ns().on("start",e=>{"mousedown"!==e.sourceEvent.type&&"touchstart"!==e.sourceEvent.type||(d=[e.sourceEvent.clientX??e.sourceEvent.touches[0].clientX,e.sourceEvent.clientY??e.sourceEvent.touches[0].clientY])}).on("zoom",l?r=>{const s=n();if("mousemove"!==r.sourceEvent.type&&"touchmove"!==r.sourceEvent.type||!t)return;const l=[r.sourceEvent.clientX??r.sourceEvent.touches[0].clientX,r.sourceEvent.clientY??r.sourceEvent.touches[0].clientY],c=[l[0]-d[0],l[1]-d[1]];d=l;const f=o()*Math.max(s[2],Math.log(s[2]))*(u?-1:1),h={x:s[0]-c[0]*f,y:s[1]-c[1]*f},p=[[0,0],[i,a]];t.setViewportConstrained({x:h.x,y:h.y,zoom:s[2]},p,e)}:null).on("zoom.wheel",c?e=>{const o=n();if("wheel"!==e.sourceEvent.type||!t)return;const r=-e.sourceEvent.deltaY*(1===e.sourceEvent.deltaMode?.05:e.sourceEvent.deltaMode?1:.002)*s,i=o[2]*Math.pow(2,r);t.scaleTo(i)}:null);r.call(f,{})},destroy:function(){r.on("zoom",null)},pointer:Dr}}({domNode:k.current,panZoom:N,getTransform:()=>E.getState().transform,getViewScale:()=>U.current}),()=>{K.current?.destroy()}},[N]),(0,r.useEffect)(()=>{K.current?.update({translateExtent:j,width:A,height:P,inversePan:x,pannable:m,zoomStep:w,zoomable:v})},[m,v,x,w,j,A,P]);const Z=g?e=>{const[t,n]=K.current?.pointer(e)||[0,0];g(e,{x:t,y:n})}:void 0,W=y?(0,r.useCallback)((e,t)=>{const n=E.getState().nodeLookup.get(t).internals.userNode;y(e,n)},[]):void 0;return(0,o.jsx)(_c,{position:p,style:{...e,"--xy-minimap-background-color-props":"string"==typeof u?u:void 0,"--xy-minimap-mask-background-color-props":"string"==typeof d?d:void 0,"--xy-minimap-mask-stroke-color-props":"string"==typeof f?f:void 0,"--xy-minimap-mask-stroke-width-props":"number"==typeof h?h*R:void 0,"--xy-minimap-node-background-color-props":"string"==typeof i?i:void 0,"--xy-minimap-node-stroke-color-props":"string"==typeof n?n:void 0,"--xy-minimap-node-stroke-width-props":"number"==typeof l?l:void 0},className:wo(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:(0,o.jsxs)("svg",{width:M,height:T,viewBox:`${B} ${$} ${F} ${H}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":V,ref:k,onClick:Z,children:[b&&(0,o.jsx)("title",{id:V,children:b}),(0,o.jsx)(ef,{onClick:W,nodeColor:i,nodeStrokeColor:n,nodeBorderRadius:s,nodeClassName:a,nodeStrokeWidth:l,nodeComponent:c}),(0,o.jsx)("path",{className:"react-flow__minimap-mask",d:`M${B-z},${$-z}h${F+2*z}v${H+2*z}h${-F-2*z}z\n M${S.x},${S.y}h${S.width}v${S.height}h${-S.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}function rf(){var e;const{prefix:t}=ho();return"undefined"!=typeof window&&window[t]&&Array.isArray(window[t].triggers)?window[t].triggers:(console.warn("Error accessing triggers data, using fallback"),(null===(e=po.poptics_ens_data)||void 0===e?void 0:e.triggers)||[])}of.displayName="MiniMap",(0,r.memo)(of),(0,r.memo)(function({nodeId:e,position:t,variant:n=Bl.Handle,className:i,style:a={},children:s,color:l,minWidth:c=10,minHeight:u=10,maxWidth:d=Number.MAX_VALUE,maxHeight:f=Number.MAX_VALUE,keepAspectRatio:h=!1,resizeDirection:p,shouldResize:g,onResizeStart:y,onResize:m,onResizeEnd:v}){const b=bu(),x="string"==typeof e?e:b,w=hc(),_=(0,r.useRef)(null),E=n===Bl.Line?"right":"bottom-right",k=t??E,O=(0,r.useRef)(null);(0,r.useEffect)(()=>{if(_.current&&x)return O.current||(O.current=function({domNode:e,nodeId:t,getStoreItems:n,onChange:o,onEnd:r}){const i=qr(e);return{update:function({controlPosition:e,boundaries:a,keepAspectRatio:s,resizeDirection:l,onResizeStart:c,onResize:u,onResizeEnd:d,shouldResize:f}){let h={...Ul},p={...Kl};const g=function(e){return{isHorizontal:e.includes("right")||e.includes("left"),isVertical:e.includes("bottom")||e.includes("top"),affectsX:e.includes("left"),affectsY:e.includes("top")}}(e);let y,m,v,b,x=null,w=[];const _=Gr().on("start",e=>{const{nodeLookup:o,transform:r,snapGrid:i,snapToGrid:a,nodeOrigin:s,paneDomNode:l}=n();if(y=o.get(t),!y)return;x=l?.getBoundingClientRect()??null;const{xSnapped:u,ySnapped:d}=Zs(e.sourceEvent,{transform:r,snapGrid:i,snapToGrid:a,containerBounds:x});h={width:y.measured.width??0,height:y.measured.height??0,x:y.position.x??0,y:y.position.y??0},p={...h,pointerX:u,pointerY:d,aspectRatio:h.width/h.height},m=void 0,y.parentId&&("parent"===y.extent||y.expandParent)&&(m=o.get(y.parentId),v=m&&"parent"===y.extent?function(e){return[[0,0],[e.measured.width,e.measured.height]]}(m):void 0),w=[],b=void 0;for(const[e,n]of o)if(n.parentId===t&&(w.push({id:e,position:{...n.position},extent:n.extent}),"parent"===n.extent||n.expandParent)){const e=Zl(n,y,n.origin??s);b=b?[[Math.min(e[0][0],b[0][0]),Math.min(e[0][1],b[0][1])],[Math.max(e[1][0],b[1][0]),Math.max(e[1][1],b[1][1])]]:e}c?.(e,{...h})}).on("drag",e=>{const{transform:t,snapGrid:r,snapToGrid:i,nodeOrigin:c}=n(),d=Zs(e.sourceEvent,{transform:t,snapGrid:r,snapToGrid:i,containerBounds:x}),_=[];if(!y)return;const{x:E,y:k,width:O,height:S}=h,C={},N=y.origin??c,{width:j,height:A,x:P,y:M}=function(e,t,n,o,r,i,a,s){let{affectsX:l,affectsY:c}=t;const{isHorizontal:u,isVertical:d}=t,f=u&&d,{xSnapped:h,ySnapped:p}=n,{minWidth:g,maxWidth:y,minHeight:m,maxHeight:v}=o,{x:b,y:x,width:w,height:_,aspectRatio:E}=e;let k=Math.floor(u?h-e.pointerX:0),O=Math.floor(d?p-e.pointerY:0);const S=w+(l?-k:k),C=_+(c?-O:O),N=-i[0]*w,j=-i[1]*_;let A=Hl(S,g,y),P=Hl(C,m,v);if(a){let e=0,t=0;l&&k<0?e=$l(b+k+N,a[0][0]):!l&&k>0&&(e=Fl(b+S+N,a[1][0])),c&&O<0?t=$l(x+O+j,a[0][1]):!c&&O>0&&(t=Fl(x+C+j,a[1][1])),A=Math.max(A,e),P=Math.max(P,t)}if(s){let e=0,t=0;l&&k>0?e=Fl(b+k,s[0][0]):!l&&k<0&&(e=$l(b+S,s[1][0])),c&&O>0?t=Fl(x+O,s[0][1]):!c&&O<0&&(t=$l(x+C,s[1][1])),A=Math.max(A,e),P=Math.max(P,t)}if(r){if(u){const e=Hl(S/E,m,v)*E;if(A=Math.max(A,e),a){let e=0;e=!l&&!c||l&&!c&&f?Fl(x+j+S/E,a[1][1])*E:$l(x+j+(l?k:-k)/E,a[0][1])*E,A=Math.max(A,e)}if(s){let e=0;e=!l&&!c||l&&!c&&f?$l(x+S/E,s[1][1])*E:Fl(x+(l?k:-k)/E,s[0][1])*E,A=Math.max(A,e)}}if(d){const e=Hl(C*E,g,y)/E;if(P=Math.max(P,e),a){let e=0;e=!l&&!c||c&&!l&&f?Fl(b+C*E+N,a[1][0])/E:$l(b+(c?O:-O)*E+N,a[0][0])/E,P=Math.max(P,e)}if(s){let e=0;e=!l&&!c||c&&!l&&f?$l(b+C*E,s[1][0])/E:Fl(b+(c?O:-O)*E,s[0][0])/E,P=Math.max(P,e)}}}O+=O<0?P:-P,k+=k<0?A:-A,r&&(f?S>C*E?O=(Vl(l,c)?-k:k)/E:k=(Vl(l,c)?-O:O)*E:u?(O=k/E,c=l):(k=O*E,l=c));const M=l?b+k:b,T=c?x+O:x;return{width:w+(l?-k:k),height:_+(c?-O:O),x:i[0]*k*(l?-1:1)+M,y:i[1]*O*(c?-1:1)+T}}(p,g,d,a,s,N,v,b),T=j!==O,L=A!==S,I=P!==E&&T,R=M!==k&&L;if(!(I||R||T||L))return;if((I||R||1===N[0]||1===N[1])&&(C.x=I?P:h.x,C.y=R?M:h.y,h.x=C.x,h.y=C.y,w.length>0)){const e=P-E,t=M-k;for(const n of w)n.position={x:n.position.x-e+N[0]*(j-O),y:n.position.y-t+N[1]*(A-S)},_.push(n)}if((T||L)&&(C.width=!T||l&&"horizontal"!==l?h.width:j,C.height=!L||l&&"vertical"!==l?h.height:A,h.width=C.width,h.height=C.height),m&&y.expandParent){const e=N[0]*(C.width??0);C.x&&C.x<e&&(h.x=e,p.x=p.x-(C.x-e));const t=N[1]*(C.height??0);C.y&&C.y<t&&(h.y=t,p.y=p.y-(C.y-t))}const q=function({width:e,prevWidth:t,height:n,prevHeight:o,affectsX:r,affectsY:i}){const a=e-t,s=n-o,l=[a>0?1:a<0?-1:0,s>0?1:s<0?-1:0];return a&&r&&(l[0]=-1*l[0]),s&&i&&(l[1]=-1*l[1]),l}({width:h.width,prevWidth:O,height:h.height,prevHeight:S,affectsX:g.affectsX,affectsY:g.affectsY}),D={...h,direction:q},z=f?.(e,D);!1!==z&&(u?.(e,D),o(C,_))}).on("end",e=>{d?.(e,{...h}),r?.({...h})});i.call(_)},destroy:function(){i.on(".drag",null)}}}({domNode:_.current,nodeId:x,getStoreItems:()=>{const{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:o,nodeOrigin:r,domNode:i}=w.getState();return{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:o,nodeOrigin:r,paneDomNode:i}},onChange:(e,t)=>{const{triggerNodeChanges:n,nodeLookup:o,parentLookup:r,nodeOrigin:i}=w.getState(),a=[],s={x:e.x,y:e.y},l=o.get(x);if(l&&l.expandParent&&l.parentId){const t=l.origin??i,n=e.width??l.measured.width??0,c=e.height??l.measured.height??0,u=El([{id:l.id,parentId:l.parentId,rect:{width:n,height:c,...Us({x:e.x??l.position.x,y:e.y??l.position.y},{width:n,height:c},l.parentId,o,t)}}],o,r,i);a.push(...u),s.x=e.x?Math.max(t[0]*n,e.x):void 0,s.y=e.y?Math.max(t[1]*c,e.y):void 0}if(void 0!==s.x&&void 0!==s.y){const e={id:x,type:"position",position:{...s}};a.push(e)}if(void 0!==e.width&&void 0!==e.height){const t={id:x,type:"dimensions",resizing:!0,setAttributes:!p||("horizontal"===p?"width":"height"),dimensions:{width:e.width,height:e.height}};a.push(t)}for(const e of t){const t={...e,type:"position"};a.push(t)}n(a)},onEnd:({width:e,height:t})=>{const n={id:x,type:"dimensions",resizing:!1,dimensions:{width:e,height:t}};w.getState().triggerNodeChanges([n])}})),O.current.update({controlPosition:k,boundaries:{minWidth:c,minHeight:u,maxWidth:d,maxHeight:f},keepAspectRatio:h,resizeDirection:p,onResizeStart:y,onResize:m,onResizeEnd:v,shouldResize:g}),()=>{O.current?.destroy()}},[k,c,u,d,f,h,y,m,v,g]);const S=k.split("-"),C=n===Bl.Line?"borderColor":"backgroundColor",N=l?{...a,[C]:l}:a;return(0,o.jsx)("div",{className:wo(["react-flow__resize-control","nodrag",...S,n,i]),ref:_,style:N,children:s})});const af=e=>{switch(e){case"trigger":return"#1890ff";case"condition":return"#faad14";case"end":return"#201000";default:return"#52c41a"}},sf=(e,t)=>e.map(e=>{var n;const o={...e};if("receiverType"===e.name&&(null==t?void 0:t.email_receivers)&&(o.props={...e.props,options:t.email_receivers}),"delayUnit"===e.name&&(o.props={...e.props}),"delayCondition"===e.name&&(null==t?void 0:t.delay_dependencies)){const r=(null===(n=e.props)||void 0===n?void 0:n.options)||[],i=t.delay_dependencies||[];o.props={...e.props,options:[...r,...i]}}return o}),lf=({status:e,onChange:t,loading:n})=>{const r="publish"===e;return(0,o.jsx)(be.Ay,{variant:"outlined",onClick:()=>t(!r),loading:n,disabled:n,icon:(0,o.jsx)(r?cf:uf,{}),children:r?"Active":"Inactive"})};function cf(){return(0,o.jsx)("span",{className:"anticon",children:(0,o.jsxs)("svg",{width:"33",height:"18",viewBox:"0 0 33 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"switch-icon switch-icon--on",children:[(0,o.jsx)("rect",{width:"32.5",height:"20",rx:"10",className:"switch-background"}),(0,o.jsx)("circle",{cx:"22",cy:"10",r:"7.5",fill:"white"})]})})}function uf(){return(0,o.jsx)("span",{className:"anticon",children:(0,o.jsxs)("svg",{width:"33",height:"18",viewBox:"0 0 33 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,o.jsx)("rect",{width:"32.5",height:"20",rx:"10",fill:"#F3F4F8"}),(0,o.jsx)("circle",{cx:"10",cy:"10",r:"7.5",fill:"white"})]})})}const{Text:df}=xe.A,ff=({flowName:e,flowStatus:t,onFlowNameChange:n,isLoading:i})=>{const[a,l]=(0,r.useState)(!1),[c,u]=(0,r.useState)(e),d=(0,r.useRef)(null),f=async()=>{c.trim()&&n(c),l(!1)};return(0,o.jsx)("div",{className:"flow-name-section",children:(0,o.jsxs)("div",a?{className:"flow-name-edit-mode",children:[(0,o.jsx)(s.A,{ref:d,value:c,onChange:e=>u(e.target.value),onPressEnter:f,onBlur:f,variant:"outlined",placeholder:"Enter flow name",className:"flow-name-input",size:"middle",disabled:i}),(0,o.jsx)("div",{className:"flow-name-actions",children:(0,o.jsx)(be.Ay,{size:"small",onClick:()=>{u(e),l(!1)},children:"Cancel"})})]}:{className:"flow-name-display",children:[(0,o.jsx)(df,{className:"flow-name",strong:!0,children:e}),(0,o.jsx)(we.A,{color:"publish"===t?"success":"default",children:t.charAt(0).toUpperCase()+t.slice(1)}),(0,o.jsx)(be.Ay,{type:"default",size:"small",icon:(0,o.jsx)(Vn,{}),onClick:()=>{l(!0),u(e),setTimeout(()=>{var e;return null===(e=d.current)||void 0===e?void 0:e.focus()},0)},className:"edit-button",disabled:i})]})})},hf=({flowName:e,onFlowNameChange:t,flowData:n,flowStatus:r,setFlowStatus:i,reactFlowInstanceRef:a})=>{const{editFlow:s,isFlowSaving:l}=xo();return(0,o.jsxs)("div",{className:"top-navbar",children:[(0,o.jsxs)("div",{className:"top-navbar__left",children:[(0,o.jsx)(be.Ay,{type:"text",icon:(0,o.jsx)(eo,{}),onClick:()=>window.history.back()}),(0,o.jsx)(ff,{flowName:e,flowStatus:r,onFlowNameChange:t,isLoading:l()})]}),(0,o.jsx)("div",{className:"top-navbar__right",children:(0,o.jsxs)(_e.A,{children:[(0,o.jsx)(lf,{status:r,onChange:async e=>{const t=e?"publish":"draft";await s(n.id,{...n,status:t},!1),i(t)},loading:l()}),(0,o.jsx)(be.Ay,{type:"primary",onClick:async()=>{if(!a.current)return void console.error("React Flow instance or flow ID not available");const{getNodes:t,getEdges:o}=a.current,i=t(),l=o(),c=((e,t,n,o="draft")=>({name:e,status:o,flow_config:{nodes:t.map(e=>{var t,n,o,r,i;const a=(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.label)||"";switch(e.type){case"trigger":return{id:e.id,type:"trigger",name:"trigger",data:{...e.data},position:e.position};case"condition":return{id:e.id,type:"condition",name:"condition",data:{field:(null===(n=e.data)||void 0===n?void 0:n.conditionField)||"",operator:(null===(o=e.data)||void 0===o?void 0:o.operator)||"==",value:(null===(r=e.data)||void 0===r?void 0:r.value)||"",...e.data},position:e.position};case"action":return{id:e.id,type:"action",name:"send_email"===a?"email":"delay",data:{actionType:(null===(i=e.data)||void 0===i?void 0:i.actionType)||"",...e.data},position:e.position};case"end":return{id:e.id,type:"end",name:"end",data:{...e.data},position:e.position};default:return{id:e.id,type:e.type||"action",name:a,data:{...e.data},position:e.position}}}),edges:n.map(e=>{const{source:t,target:n,sourceHandle:o,targetHandle:r,data:i,label:a,...s}=e;return{...s,source:t,target:n,...o?{sourceHandle:o}:{},...r?{targetHandle:r}:{},...i?{data:i}:{},...a?{label:a}:{}}})}}))(e,i,l,r);try{await s(null==n?void 0:n.id,c,!1)}catch(t){console.error("Error saving flow:",t)}},loading:l(),disabled:l(),children:"Save Now"})]})})]})},{confirm:pf}=Ee.A,gf=({id:e,data:t,isConnectable:n,type:i})=>{const[a,s]=(0,r.useState)(!1),l=i||"end",c="end"!==l,u="trigger"!==l,d="condition"===l,f="trigger"!==l&&"end"!==l,h=(e=>{switch(e){case"trigger":return"Trigger Event";case"condition":return"Conditional";case"end":return"End Automation";case"action":return"Action";default:return"End"}})(l);return(0,o.jsxs)("div",{className:`flow-node flow-node--${l}`,onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),children:[f&&a&&(0,o.jsx)("button",{className:"node-delete-button",onClick:n=>{n.stopPropagation(),pf({title:"Do you want to delete this step?",icon:(0,o.jsx)(Kn,{}),content:"",onOk(){t.onDeleteNode&&t.onDeleteNode(e)}})},"aria-label":"Delete node",children:(0,o.jsx)(Dn,{})}),u&&(0,o.jsx)(wu,{type:"target",position:fs.Top,isConnectable:!!n}),(0,o.jsxs)("div",{className:"flow-node__content",children:[(0,o.jsx)("div",{className:"flow-node__icon",children:(()=>{switch(l){case"trigger":return(0,o.jsx)(Mn,{});case"condition":return(0,o.jsx)(An,{});case"end":default:return(0,o.jsx)(Wn,{});case"action":return"send_email"===t.actionType?(0,o.jsx)(no,{}):(0,o.jsx)(Rn,{})}})()}),(0,o.jsxs)("div",{className:"flow-node__details",children:[(0,o.jsx)("div",{className:"flow-node__title",children:h}),(null==t?void 0:t.subtitle)&&(0,o.jsx)("div",{className:"flow-node__subtitle",children:t.subtitle})]})]}),c&&!d&&(0,o.jsx)(wu,{type:"source",position:fs.Bottom,isConnectable:!!n}),d&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(wu,{id:"false",type:"source",position:fs.Left,isConnectable:!!n,style:{background:"#EF4444",left:-8}}),(0,o.jsx)(wu,{id:"true",type:"source",position:fs.Right,isConnectable:!!n,style:{background:"#22B855",right:-8}})]})]})},yf=({id:e,sourceX:t,sourceY:n,targetX:r,targetY:i,sourcePosition:a,targetPosition:s,style:l={},label:c,data:u,markerEnd:d})=>{const[f,h,p]=dl({sourceX:t,sourceY:n,sourcePosition:a,targetX:r,targetY:i,targetPosition:s}),g=null==u?void 0:u.onPlusClick,y=null==u?void 0:u.condition,m={...l};"true"===y?(m.stroke="#22B855",m.strokeWidth=1):"false"===y&&(m.stroke="#EF4444",m.strokeWidth=1);const v=g?-20:0,b=c?25:0;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)($u,{path:f,markerEnd:d,style:m}),c&&(0,o.jsx)(Td,{children:(0,o.jsx)("div",{style:{position:"absolute",transform:`translate(-50%, -50%) translate(${h}px, ${p+v}px)`,background:"true"===y?"#22B855":"false"===y?"#EF4444":"#ffffff",color:y?"#ffffff":"#000000",padding:"4px 8px",borderRadius:"4px",fontSize:"12px",fontWeight:500,pointerEvents:"all",boxShadow:"0 1px 3px rgba(0,0,0,0.1)",zIndex:1001},children:c})}),g&&(0,o.jsx)(Td,{children:(0,o.jsx)("div",{style:{position:"absolute",transform:`translate(-50%, -50%) translate(${h}px, ${p+b}px)`,pointerEvents:"all",zIndex:1e3},children:(0,o.jsx)("button",{className:"notif-flow-edge-plus-button",onClick:t=>{t.stopPropagation(),g(e)},"aria-label":"Add condition",children:(0,o.jsx)(ao,{})})})})]})},mf={trigger:e=>(0,o.jsx)(gf,{...e,type:"trigger"}),action:e=>(0,o.jsx)(gf,{...e,type:"action"}),condition:e=>(0,o.jsx)(gf,{...e,type:"condition"}),end:e=>(0,o.jsx)(gf,{...e,type:"end"})},vf=({onNodeClick:e,onPlusButtonClick:t,onInit:n})=>{const[i,a,s]=function(){const[e,t]=(0,r.useState)([]),n=(0,r.useCallback)(e=>t(t=>Hc(e,t)),[]);return[e,t,n]}(),[l,c,u]=function(){const[e,t]=(0,r.useState)([]),n=(0,r.useCallback)(e=>t(t=>Vc(e,t)),[]);return[e,t,n]}();(0,r.useCallback)(e=>{t(e)},[t]);const d=(0,r.useCallback)((t,n)=>{"end"!==n.type&&"trigger"!==n.type&&e(n)},[e]),f=(0,r.useCallback)(e=>{const t=l.filter(t=>t.target===e),n=l.filter(t=>t.source===e),o=[];t.forEach(e=>{n.forEach(t=>{var n;const r=i.find(t=>t.id===e.source),a="condition"===(null==r?void 0:r.type);o.push({id:`edge_${e.source}_${t.target}`,source:e.source,target:t.target,type:e.type||"default",...a&&e.sourceHandle?{sourceHandle:e.sourceHandle}:{},markerEnd:e.markerEnd,...e.label?{label:e.label}:{},data:{...(null===(n=e.data)||void 0===n?void 0:n.condition)?{condition:e.data.condition}:{}}})})}),a(t=>t.filter(t=>t.id!==e)),c(t=>[...t.filter(t=>t.source!==e&&t.target!==e),...o])},[l,i,a,c]),h=i.map(e=>({...e,data:{...e.data,onDeleteNode:f}})),p={default:yf,smoothstep:yf,straight:yf,curved:yf},g=l.map(e=>{var n,o;return{...e,data:{...e.data,onPlusClick:t,...(null===(n=e.data)||void 0===n?void 0:n.condition)?{condition:e.data.condition}:{}},...(null===(o=e.data)||void 0===o?void 0:o.condition)&&!e.label?{label:e.data.condition}:{}}}),y=(0,r.useCallback)(e=>{n&&n(e)},[n]);return(0,o.jsxs)(Pd,{nodes:h,edges:g,onNodeClick:d,onNodesChange:s,onEdgesChange:u,nodeTypes:mf,edgeTypes:p,fitView:!0,onInit:y,connectionLineType:us.SmoothStep,defaultEdgeOptions:{type:"default",markerEnd:{type:ds.ArrowClosed}},children:[(0,o.jsx)(Bd,{}),(0,o.jsx)(Yd,{})]})},bf=({onInsert:e,availableConditions:t})=>{const[n,i]=(0,r.useState)("action");return(0,o.jsxs)("div",{className:"node-insertion-content",children:[(0,o.jsxs)(ke.Ay.Group,{value:n,onChange:e=>i(e.target.value),className:"node-type-tabs",children:[(0,o.jsxs)(ke.Ay.Button,{value:"action",className:"tab-button",children:["action"===n&&(0,o.jsx)(Ln,{className:"check-icon"}),"Action"]}),(0,o.jsxs)(ke.Ay.Button,{value:"condition",className:"tab-button",children:["condition"===n&&(0,o.jsx)(Ln,{className:"check-icon"}),"Condition"]})]}),(0,o.jsx)("div",{className:"node-type-header",children:(0,o.jsx)("h4",{children:"action"===n?"Available Actions":"Available Conditions"})}),(0,o.jsxs)("div",{className:"node-options-grid",children:["action"===n&&(0,o.jsx)(o.Fragment,{children:go.map(t=>(0,o.jsx)("div",{className:"node-option",onClick:()=>null==e?void 0:e({type:"action",value:t.value,label:t.label}),children:t.label},t.value))}),"condition"===n&&(0,o.jsx)(o.Fragment,{children:t.map(t=>(0,o.jsx)("div",{className:"node-option",onClick:()=>null==e?void 0:e({type:"condition",value:t.value,label:t.label}),children:t.label},t.value))})]})]})},xf=({label:e,tooltip:t,required:n=!1,className:r=""})=>(0,o.jsxs)("span",{className:`form-field-label ${r}`,style:{display:"flex",alignItems:"center"},children:[e,(()=>{if(!t)return null;const e="question"===t.icon?lo:Qn;return(0,o.jsx)(Oe.A,{title:t.title,placement:t.placement||"top",trigger:t.trigger||"hover",children:(0,o.jsx)(e,{className:"form-field-tooltip-icon",style:{marginLeft:4,color:"#8c8c8c",cursor:"pointer",fontSize:"13px"}})})})()]}),wf=({customizationSettings:e})=>{const t=(null==e?void 0:e.formFields)||[],n=null==e?void 0:e.triggerData,i=sf(t,n);return(0,o.jsx)("div",{className:"delay-action-form",children:(0,o.jsx)("div",{className:"delay-form-row",children:i.map((e,t)=>(0,o.jsx)(Se.A.Item,{name:e.name,label:(0,o.jsx)(xf,{label:e.label,tooltip:e.tooltip,required:e.required}),rules:e.rules,className:"delay-form-field",children:r.createElement(e.component,e.props||{})},t))})})},_f=({triggerType:e,onVariableSelect:t})=>{var n;const r=rf(),i=(null===(n=null==r?void 0:r.find(t=>t.trigger_value===e))||void 0===n?void 0:n.trigger_data)||[];return 0===i.length?(0,o.jsx)("div",{className:"dynamic-variables-empty",children:"No variables available for this trigger"}):(0,o.jsx)("div",{className:"dynamic-variables-container",children:i.map(e=>(0,o.jsx)(Oe.A,{title:`Insert ${e.label} variable`,children:(0,o.jsx)(be.Ay,{className:"dynamic-variable-chip",onClick:()=>t(`{{${e.value}}}`),children:`{${e.label}}`})},e.value))})},Ef=({customizationSettings:e,selectedTrigger:t,setQuillRef:n,onVariableInsert:i})=>{const a=(null==e?void 0:e.triggerData)||{};if(!a)return null;const s=sf(e.formFields||[],a);return(0,o.jsx)("div",{className:"notification-flow-customization-form-field",children:s.map(e=>"richText"===e.component?(0,o.jsxs)("div",{className:"notification-flow-email-body",children:[(0,o.jsx)(Se.A.Item,{name:e.name,label:e.label,rules:e.rules,className:"notif-flow-rich-text-form-item",children:(0,o.jsx)(Mt,{theme:"snow",...e.props||{},ref:e=>n(e)})}),(0,o.jsxs)("div",{className:"email-variable-section",children:[(0,o.jsx)("div",{className:"email-variable-header",children:(0,o.jsx)("p",{children:"Variables for Email Body Content"})}),(0,o.jsx)(_f,{triggerType:t,onVariableSelect:i})]})]},e.name):(0,o.jsx)(Se.A.Item,{name:e.name,label:e.label,rules:e.rules,children:r.createElement(e.component,e.props||{})},e.name))})},kf=({nodeData:e,customizationSettings:t,selectedTrigger:n,quillRef:r,setQuillRef:i,onVariableInsert:a})=>{if(!e)return null;const s=e.actionType||(null==t?void 0:t.actionType);return s?"add_delay"===s?(0,o.jsx)(wf,{customizationSettings:t}):(0,o.jsx)(Ef,{customizationSettings:t,selectedTrigger:n,quillRef:r,setQuillRef:i,onVariableInsert:a}):null},Of=({customizationSettings:e})=>{if(!e)return null;const{type:t}=e,n=(e=>{switch(e){case"number":return mo;case"string":default:return vo;case"date":return bo}})(t);return(0,o.jsx)("div",{className:"condition-form",children:(0,o.jsxs)("div",{className:"condition-form-row",children:[(0,o.jsx)(Se.A.Item,{name:"operator",label:"Operator",className:"condition-operator",rules:[{required:!0,message:"Please select an operator"}],children:(0,o.jsx)(a.A,{options:n})}),(0,o.jsx)(Se.A.Item,"date"===t?{name:"dateValue",label:"Value",className:"condition-value",rules:[{required:!0,message:"Please select a date"}],children:(0,o.jsx)(Ce.A,{style:{width:"100%"}})}:{name:"value",label:"Value",className:"condition-value",rules:[{required:!0,message:"Please enter a value"}],children:(0,o.jsx)(s.A,{type:"number"===t?"number":"text",style:{width:"100%"}})})]})})},Sf=({visible:e,onClose:t,nodeType:n,nodeData:i,onSave:a,customizationSettings:s,selectedTrigger:l,mode:c="edit",onInsert:u,availableConditions:d=[]})=>{const[f]=Se.A.useForm(),[h,p]=(0,r.useState)(null),{handleVariableInsert:g}=(e=>({handleVariableInsert:(0,r.useCallback)(t=>{if(e){const n=e.getEditor(),o=n.getSelection(),r=o?o.index:0;n.insertText(r,t),n.setSelection(r+t.length)}},[e])}))(h),{initializeForm:y}=((e,t,n,o,i)=>({initializeForm:(0,r.useCallback)(()=>{if(o&&"edit"===i){e.resetFields();const o={label:(null==t?void 0:t.label)||"",subtitle:(null==t?void 0:t.subtitle)||"",operator:(null==t?void 0:t.operator)||"=",value:(null==t?void 0:t.value)||"",..."date"===(null==n?void 0:n.type)&&(null==t?void 0:t.value)?{dateValue:t.value?Pt(Number(t.value)):null}:{}};t&&Object.keys(t).forEach(e=>{"label"!==e&&"subtitle"!==e&&(o[e]=t[e])}),e.setFieldsValue(o)}},[o,t,n,e,i])}))(f,i,s,e,c),{handleSave:m}=((e,t,n,o,i)=>({handleSave:(0,r.useCallback)(()=>{e.validateFields().then(e=>{var r,a,s;if("date"===(null==n?void 0:n.type)&&e.dateValue){const t=new Date(e.dateValue).getTime();e.value=t,delete e.dateValue}if("condition"===t&&n){const t=n.label||"",o=(e=>{switch(e){case"equal":return"=";case"not_equal":return"≠";case"greater_then":return">";case"greater_equal":return"≥";case"less_then":return"<";case"less_equal":return"≤";case"before":return"before";case"after":return"after";default:return e}})(e.operator),r="date"===(null==n?void 0:n.type)?new Date(e.value).toLocaleDateString():e.value||"";e.subtitle=`${t} ${o} ${r}`}if("action"===t){const t=(null==o?void 0:o.actionType)||"";if("add_delay"===t&&e.delay&&e.delayUnit){let t=`Wait for ${e.delay} ${e.delayUnit}`;if(e.delayCondition&&e.delayDependency){const o=(null===(s=null===(a=null===(r=null==n?void 0:n.triggerData)||void 0===r?void 0:r.delay_dependencies)||void 0===a?void 0:a.find(t=>t.value===e.delayDependency))||void 0===s?void 0:s.label)||e.delayDependency;t+=` ${e.delayCondition} ${o}`}e.subtitle=t}else"send_email"===t&&e.subject&&(e.subtitle=`Subject: ${e.subject.substring(0,30)}${e.subject.length>30?"...":""}`)}null==i||i(e)})},[e,t,n,o,i])}))(f,n,s,i,a);(0,r.useEffect)(()=>{y()},[e,i,s,f,c]);const v="send_email"===(null==i?void 0:i.actionType)?520:400;return(0,o.jsx)(it,{open:e,width:v,zIndex:99999,title:(0,o.jsx)(Cf,{mode:c,customizationSettings:s,nodeType:n}),placement:"right",onClose:t,className:"node-sidebar "+("insert"===c?"insert-mode":"edit-mode"),footer:(0,o.jsx)(Nf,{mode:c,onClose:t,onSave:m}),children:"insert"===c?(0,o.jsx)(bf,{onInsert:u,availableConditions:d}):(0,o.jsx)(jf,{form:f,nodeType:n,nodeData:i,customizationSettings:s,selectedTrigger:l,quillRef:h,setQuillRef:p,onVariableInsert:g})})},Cf=({mode:e,customizationSettings:t,nodeType:n})=>"insert"===e?(0,o.jsx)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:"Add New Node"}):(0,o.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:["Edit ",null==t?void 0:t.label,(0,o.jsx)(St,{count:n&&n.slice(0,1).toUpperCase()+n.slice(1),style:{backgroundColor:`${af(n||"action")}16`,color:af(n||"action"),fontSize:"12px",fontWeight:"normal",borderRadius:"4px"}})]}),Nf=({mode:e,onClose:t,onSave:n})=>(0,o.jsxs)("div",{className:"node-sidebar__footer",children:[(0,o.jsx)(be.Ay,{onClick:t,children:"Cancel"}),"edit"===e&&(0,o.jsx)(be.Ay,{type:"primary",onClick:n,children:"Save"})]}),jf=({form:e,nodeType:t,nodeData:n,customizationSettings:r,selectedTrigger:i,quillRef:a,setQuillRef:s,onVariableInsert:l})=>(0,o.jsxs)(Se.A,{form:e,layout:"vertical",initialValues:{},children:["condition"===t&&(0,o.jsx)(Of,{customizationSettings:r}),"action"===t&&(0,o.jsx)(kf,{nodeData:n,customizationSettings:r,selectedTrigger:i,quillRef:a,setQuillRef:s,onVariableInsert:l})]}),Af=()=>(0,o.jsxs)("div",{className:"builder-page-skeleton",children:[(0,o.jsxs)("div",{className:"top-navbar",children:[(0,o.jsxs)("div",{className:"top-navbar__left",children:[(0,o.jsx)(be.Ay,{type:"text",icon:(0,o.jsx)(eo,{}),disabled:!0}),(0,o.jsx)(Ze.A.Input,{active:!0,style:{width:200}})]}),(0,o.jsx)("div",{className:"top-navbar__right",children:(0,o.jsxs)(_e.A,{children:[(0,o.jsx)(Ze.A.Button,{active:!0}),(0,o.jsx)(Ze.A.Button,{active:!0})]})})]}),(0,o.jsx)("div",{className:"builder-page__body",style:{height:"calc(100vh - 64px)",display:"flex",justifyContent:"center",alignItems:"center"},children:(0,o.jsx)(Ct.A,{size:"large",tip:"Loading flow data..."})})]}),Pf=({flowId:e})=>{var t;const[n,i]=(0,r.useState)("Untitled"),[a,s]=(0,r.useState)("draft"),[l,c]=(0,r.useState)(null),[u,d]=(0,r.useState)(null),[f,h]=(0,r.useState)(""),[p,g]=(0,r.useState)(null),y=(0,r.useRef)(null),{getFlowById:m,isFlowLoading:v}=xo(),{sidebarVisible:b,sidebarMode:x,edgeToSplit:w,setSidebarVisible:_,setSidebarMode:E,setEdgeToSplit:k,handleSidebarClose:O,handleNodeClick:S,handlePlusButtonClick:C}=(e=>{const[t,n]=(0,r.useState)(!1),[o,i]=(0,r.useState)("edit"),[a,s]=(0,r.useState)(null),l=(0,r.useCallback)(t=>{e(t),i("edit"),n(!0)},[e]),c=(0,r.useCallback)(e=>{e&&s(e),i("insert"),n(!0)},[]),u=(0,r.useCallback)(()=>{n(!1),"insert"===o&&s(null)},[o]);return{sidebarVisible:t,sidebarMode:o,edgeToSplit:a,setSidebarVisible:n,setSidebarMode:i,setEdgeToSplit:s,handleSidebarClose:u,handleNodeClick:l,handlePlusButtonClick:c}})(d),{loadFlowData:N}=((e,t,n,o,i,a,s)=>({loadFlowData:(0,r.useCallback)(async()=>{if(e)try{const{data:r}=await t(e);if(r&&(n(r.name||"Untitled"),o(r.trigger||""),i(r.status||"draft"),a(r),r.flow_config&&s)){const{setNodes:e,setEdges:t}=s;Array.isArray(r.flow_config.nodes)&&e(r.flow_config.nodes),Array.isArray(r.flow_config.edges)&&t(r.flow_config.edges.map(e=>{var t,n;return"true"===(null===(t=e.data)||void 0===t?void 0:t.condition)?{...e,sourceHandle:"true"}:"false"===(null===(n=e.data)||void 0===n?void 0:n.condition)?{...e,sourceHandle:"false"}:e}))}}catch(e){console.error("Error loading flow:",e)}},[e,t,n,o,i,a,s])}))(e,m,i,h,s,c,p),{handleInsertNode:j}=((e,t,n,o,i,a)=>{const s=rf(),l=(0,r.useCallback)((e,t,n,o)=>({id:e,type:t.type,position:n,data:{label:"condition"===t.type?(null==o?void 0:o.value)||"Conditional":t.value,subtitle:t.label,..."condition"===t.type&&{operator:"=",value:"",conditionField:t.value},..."action"===t.type&&{actionType:t.value}}}),[]),c=(0,r.useCallback)((e,t,n)=>{var o;return{id:`edge_${e.id}-${t}`,source:e.id,target:t,type:n.type||"default",markerEnd:n.markerEnd,...n.sourceHandle&&{sourceHandle:n.sourceHandle},data:{...(null===(o=n.data)||void 0===o?void 0:o.condition)&&{condition:n.data.condition}}}},[]),u=(0,r.useCallback)((t,n,o,r,i,a=300,s=180)=>{var l;const{getNodes:c,setNodes:u,setEdges:d}=e.current,f={...n,position:{x:t.position.x+a,y:t.position.y+s}},h={id:`end_${(null===(l=c())||void 0===l?void 0:l.length)+1}`,type:"end",position:{x:t.position.x-a,y:t.position.y+s},data:{label:"End Flow",subtitle:"Automation stops here"}},p={id:`edge_${t.id}-${n.id}_true`,source:t.id,sourceHandle:"true",target:n.id,type:"smoothstep",markerEnd:{type:ds.ArrowClosed},label:"True",data:{condition:"true",conditionInfo:i?{field:i.label,operator:"=",value:""}:void 0}},g={id:`edge_${t.id}-${h.id}_false`,source:t.id,sourceHandle:"false",target:h.id,type:"smoothstep",markerEnd:{type:ds.ArrowClosed},label:"false",data:{condition:"false",conditionInfo:i?{field:i.label,operator:"=",value:""}:void 0}};u([...c().map(e=>e.id===n.id?f:e),t,h]),d(e=>[...e.filter(e=>e.id!==r),o,p,g])},[e]),d=(0,r.useCallback)((t,n,o,r,i,a=180)=>{var s,l,c;const{getNodes:u,setNodes:d,setEdges:f}=e.current,h={id:`edge_${t.id}-${n.id}`,source:t.id,target:n.id,type:"smoothstep",markerEnd:i.markerEnd,...(null===(s=i.data)||void 0===s?void 0:s.condition)&&{label:null===(l=i.data)||void 0===l?void 0:l.condition},data:{...(null===(c=i.data)||void 0===c?void 0:c.condition)&&{condition:i.data.condition}}},p={...n,position:{x:n.position.x,y:t.position.y+a}};d([...u().map(e=>e.id===n.id?p:e),t]),f(e=>[...e.filter(e=>e.id!==r),o,h])},[e]);return{handleInsertNode:(0,r.useCallback)(r=>{var f,h;if(!e.current||!t)return console.error("React Flow instance or edge not available"),i(!1),void a(null);const{getNodes:p,getEdges:g}=e.current,y=g().find(e=>e.id===t);if(!y)return console.error("Edge not found:",t),i(!1),void a(null);const m=p().find(e=>e.id===y.source),v=p().find(e=>e.id===y.target);if(!m||!v)return console.error("Source or target node not found"),i(!1),void a(null);const b=(m.position.x+v.position.x)/2,x=m.position.y+180,w=(null===(f=s.find(e=>""===e.trigger_value))||void 0===f?void 0:f.trigger_data)||[];let _;"condition"===r.type&&(_=w.find(e=>e.value===r.value));const E=`node_${(null===(h=p())||void 0===h?void 0:h.length)+1}`,k=l(E,r,{x:b,y:x},_),O=c(m,E,y);"condition"===r.type?u(k,v,O,t,_,300,180):d(k,v,O,t,y,180),n(k),o("edit"),i(!0),a(null)},[e,t,s,l,c,u,d,n,o,i,a])}})(y,w,d,E,_,k);(0,r.useEffect)(()=>{e&&N()},[e]);const A=rf(),P=(null===(t=A.find(e=>e.trigger_value===f))||void 0===t?void 0:t.trigger_data)||[],M=(0,r.useCallback)(()=>f?A.find(e=>e.trigger_value===f):null,[f,A]),T=(0,r.useCallback)(()=>{if(!u)return null;if("condition"===u.type){const e=u.data.conditionField||"";return P.find(t=>t.value===e)||null}if("action"===u.type){const e=u.data.actionType,t=M();return{type:"action",actionType:e,...(e=>{if(e)return yo[e]})(e),triggerData:t}}return null},[u,P,M]),L=(0,r.useCallback)(e=>{if(u&&y.current){const{setNodes:t}=y.current;t(t=>t.map(t=>t.id===u.id?{...t,data:{...t.data,...e,..."action"===t.type&&{actionType:t.data.actionType}}}:t)),_(!1),d(null)}},[u,_,d]),I=(0,r.useCallback)(e=>{if(g(e),y.current=e,null==l?void 0:l.flow_config){const{setNodes:t,setEdges:n}=e;Array.isArray(l.flow_config.nodes)&&t(l.flow_config.nodes),Array.isArray(l.flow_config.edges)&&n(l.flow_config.edges)}},[l]);return v()?(0,o.jsx)(Af,{}):(0,o.jsxs)("div",{className:"builder-page",children:[(0,o.jsx)(hf,{flowName:n,onFlowNameChange:i,flowData:l,flowStatus:a,setFlowStatus:s,reactFlowInstanceRef:y}),(0,o.jsxs)("div",{className:"builder-page__body",children:[(0,o.jsx)("div",{className:"builder-page__canvas",children:(0,o.jsx)(vf,{onNodeClick:S,onPlusButtonClick:C,onInit:I})}),(0,o.jsx)(Sf,{visible:b,onClose:O,nodeType:u?(R=u.type,R?["trigger","end","condition","action"].includes(R)?R:"end":"action"):void 0,nodeData:null==u?void 0:u.data,onSave:L,customizationSettings:T()||{},selectedTrigger:f,mode:x,onInsert:j,availableConditions:P})]})]});var R},{Option:Mf}=a.A,Tf=({open:e,onClose:t,onCreate:n})=>{const[r]=Se.A.useForm(),{createFlow:i,isFlowCreating:l}=xo();ho();const c=rf(),u=()=>{r.resetFields(),t()};return(0,o.jsx)(Ee.A,{open:e,title:"Create New Automation",onCancel:u,footer:null,className:"create-flow-modal",children:(0,o.jsxs)(Se.A,{form:r,layout:"vertical",children:[(0,o.jsx)(Se.A.Item,{label:"Flow Name",name:"name",rules:[{required:!0,message:"Please enter flow name"}],children:(0,o.jsx)(s.A,{placeholder:"e.g. Welcome Email for Signup"})}),(0,o.jsx)(Se.A.Item,{label:"Trigger Event",name:"trigger",rules:[{required:!0,message:"Please select a trigger"}],children:(0,o.jsx)(a.A,{placeholder:"Select a trigger",children:null==c?void 0:c.map(e=>(0,o.jsx)(Mf,{value:e.trigger_value,children:e.trigger_label},e.trigger_value))})}),(0,o.jsx)(Se.A.Item,{className:"form-actions",children:(0,o.jsxs)(_e.A,{className:"form-actions__buttons",children:[(0,o.jsx)(be.Ay,{onClick:u,children:"Cancel"}),(0,o.jsx)(be.Ay,{type:"primary",loading:l(),onClick:async()=>{try{const e=await r.validateFields(),o=(e=>{const t=rf(),n=null==t?void 0:t.find(t=>t.trigger_value===e),o=(null==n?void 0:n.trigger_label)||"Trigger";return{nodes:[{id:"node_1",type:"trigger",position:{x:200,y:50},data:{label:`trigger: ${e}`,subtitle:o,triggerValue:e}},{id:"node_2",type:"end",position:{x:200,y:200},data:{label:"end_flow",subtitle:"End execution path"}}],edges:[{id:"edge_node_1-node_2",source:"node_1",target:"node_2",type:"smoothstep",markerEnd:{type:ds.ArrowClosed},data:{}}]}})(e.trigger),a={...e,flow_config:{nodes:o.nodes,edges:o.edges}},s=await i(a);r.resetFields(),t(),s&&s.id&&n(s.id)}catch(e){console.error("Error creating flow:",e)}},children:"Create"})]})})]})})},{Search:Lf}=s.A,{confirm:If}=Ee.A,Rf=({onEdit:e})=>{const{notificationFlows:t,cloneFlow:n,deleteFlow:i,bulkDeleteFlows:s,editFlow:l,isFlowListLoading:c,isFlowSaving:u,statusCount:d,isFlowCloning:f,isFlowDeleting:h,fetchFlows:p,filterByStatus:g,searchFlows:y}=xo(),[m,v]=(0,r.useState)(!1),[b,x]=(0,r.useState)([]),w=[{title:"Automations",dataIndex:"name",key:"name"},{title:"Trigger",dataIndex:"trigger",key:"trigger",render:e=>`${e}`},{title:"Status",dataIndex:"status",key:"status",render:e=>(0,o.jsx)(we.A,{color:"publish"===e?"green":"red",children:e.charAt(0).toUpperCase()+e.slice(1)},e)},{title:"Draft/Published",dataIndex:"status",key:"status-toggle",render:(e,t)=>(0,o.jsx)(Nt.A,{checked:"publish"===e,onChange:e=>{const n=e?"publish":"draft";l(t.id,{...t,status:n},!0)}})},{title:"Action",key:"actions",dataIndex:"id",render:t=>(0,o.jsxs)("div",{className:"actions-cell",children:[(0,o.jsxs)(be.Ay,{type:"default",onClick:()=>e(t),children:[(0,o.jsx)(Xn,{}),"Edit"]}),(0,o.jsx)(jt.A,{trigger:["click"],menu:{items:[{key:"clone",label:"Clone",icon:(0,o.jsx)(Bn,{}),onClick:()=>n(t)},{key:"delete",label:"Delete",icon:(0,o.jsx)(Fn,{}),onClick:()=>(e=>{If({title:"Do you want to delete this flow?",icon:(0,o.jsx)(Kn,{}),okText:"Delete",okButtonProps:{danger:!0},async onOk(){await i(e)}})})(t)}]},children:(0,o.jsx)(be.Ay,{icon:(0,o.jsx)(ro,{style:{transform:"rotate(90deg)"}})})})]})}],_={selectedRowKeys:b,onChange:e=>{x(e)}};return(0,r.useEffect)(()=>{p()},[]),(0,o.jsxs)("div",{className:"automation-list",children:[(0,o.jsxs)("div",{className:"automation-list__header",children:[(0,o.jsxs)("div",{className:"filter-search-group",children:[(0,o.jsx)(a.A,{defaultValue:"",placeholder:"All",className:"status-filter-select",onChange:e=>g(e),options:[{value:"",label:"All"},{value:"publish",label:`Publish (${null==d?void 0:d.publish})`},{value:"draft",label:`Draft (${null==d?void 0:d.draft})`}],disabled:c()}),(0,o.jsx)(Lf,{placeholder:"Search",className:"automation-search",onSearch:e=>y(e),allowClear:!0,disabled:c()})]}),(0,o.jsx)(be.Ay,{type:"primary",onClick:()=>v(!0),icon:(0,o.jsx)(ao,{}),children:"New Automation"})]}),b.length>0&&(0,o.jsxs)("div",{className:"bulk-actions-bar",children:[(0,o.jsx)(be.Ay,{danger:!0,type:"primary",className:"bulk-delete-btn",onClick:()=>{b.length>0&&If({title:"Delete Selected Items",icon:(0,o.jsx)(Kn,{}),content:`Are you sure you want to delete ${b.length} item${1!==b.length?"s":""}?`,okText:"Delete",okButtonProps:{danger:!0},cancelText:"Cancel",async onOk(){try{await s(b),x([])}catch(e){console.error("Bulk delete failed:",e)}}})},children:"Bulk Delete"}),(0,o.jsxs)("span",{className:"selected-count",children:[b.length," item",1!==b.length?"s":""," selected"]})]}),(0,o.jsx)(At.A,{className:"automation-list__table",dataSource:null!=t?t:[],rowSelection:_,columns:w,rowKey:"id",pagination:!1,loading:c()||u()||f()||h()}),(0,o.jsx)(Tf,{open:m,onClose:()=>v(!1),onCreate:t=>{v(!1),e(t)}})]})}},23805:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},24739:(e,t,n)=>{var o=n(26025);e.exports=function(e){var t=this.__data__,n=o(t,e);return n<0?void 0:t[n][1]}},25911:(e,t,n)=>{var o=n(38859),r=n(14248),i=n(19219);e.exports=function(e,t,n,a,s,l){var c=1&n,u=e.length,d=t.length;if(u!=d&&!(c&&d>u))return!1;var f=l.get(e),h=l.get(t);if(f&&h)return f==t&&h==e;var p=-1,g=!0,y=2&n?new o:void 0;for(l.set(e,t),l.set(t,e);++p<u;){var m=e[p],v=t[p];if(a)var b=c?a(v,m,p,t,e,l):a(m,v,p,e,t,l);if(void 0!==b){if(b)continue;g=!1;break}if(y){if(!r(t,function(e,t){if(!i(y,t)&&(m===e||s(m,e,n,a,l)))return y.push(t)})){g=!1;break}}else if(m!==v&&!s(m,v,n,a,l)){g=!1;break}}return l.delete(e),l.delete(t),g}},26025:(e,t,n)=>{var o=n(75288);e.exports=function(e,t){for(var n=e.length;n--;)if(o(e[n][0],t))return n;return-1}},27301:e=>{e.exports=function(e){return function(t){return e(t)}}},27534:(e,t,n)=>{var o=n(72552),r=n(40346);e.exports=function(e){return r(e)&&"[object Arguments]"==o(e)}},28303:(e,t,n)=>{var o=n(56110)(n(9325),"WeakMap");e.exports=o},29817:e=>{e.exports=function(e){return this.__data__.has(e)}},30294:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},30361:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,n){var o=typeof e;return!!(n=null==n?9007199254740991:n)&&("number"==o||"symbol"!=o&&t.test(e))&&e>-1&&e%1==0&&e<n}},31175:(e,t,n)=>{var o=n(26025);e.exports=function(e,t){var n=this.__data__,r=o(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}},32804:(e,t,n)=>{var o=n(56110)(n(9325),"Promise");e.exports=o},34840:(e,t,n)=>{var o="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=o},35749:(e,t,n)=>{var o=n(81042);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=o&&void 0===t?"__lodash_hash_undefined__":t,this}},37167:(e,t,n)=>{var o=n(4901),r=n(27301),i=n(86009),a=i&&i.isTypedArray,s=a?r(a):o;e.exports=s},37217:(e,t,n)=>{var o=n(80079),r=n(51420),i=n(90938),a=n(63605),s=n(29817),l=n(80945);function c(e){var t=this.__data__=new o(e);this.size=t.size}c.prototype.clear=r,c.prototype.delete=i,c.prototype.get=a,c.prototype.has=s,c.prototype.set=l,e.exports=c},37828:(e,t,n)=>{var o=n(9325).Uint8Array;e.exports=o},38859:(e,t,n)=>{var o=n(53661),r=n(8999),i=n(51459);function a(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new o;++t<n;)this.add(e[t])}a.prototype.add=a.prototype.push=r,a.prototype.has=i,e.exports=a},40346:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},45083:(e,t,n)=>{var o=n(1882),r=n(87296),i=n(23805),a=n(47473),s=/^\[object .+?Constructor\]$/,l=Function.prototype,c=Object.prototype,u=l.toString,d=c.hasOwnProperty,f=RegExp("^"+u.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!i(e)||r(e))&&(o(e)?f:s).test(a(e))}},45708:function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},o(e,t)},function(e,t){function __(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},i.apply(this,arguments)},a=this&&this.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var o=Array(e),r=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,r++)o[r]=i[a];return o},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},l=s(n(51609)),c=s(n(75795)),u=s(n(2404)),d=s(n(91574)),f=function(e){function t(t){var n=e.call(this,t)||this;n.dirtyProps=["modules","formats","bounds","theme","children"],n.cleanProps=["id","className","style","placeholder","tabIndex","onChange","onChangeSelection","onFocus","onBlur","onKeyPress","onKeyDown","onKeyUp"],n.state={generation:0},n.selection=null,n.onEditorChange=function(e,t,o,r){var i,a,s,l;"text-change"===e?null===(a=(i=n).onEditorChangeText)||void 0===a||a.call(i,n.editor.root.innerHTML,t,r,n.unprivilegedEditor):"selection-change"===e&&(null===(l=(s=n).onEditorChangeSelection)||void 0===l||l.call(s,t,r,n.unprivilegedEditor))};var o=n.isControlled()?t.value:t.defaultValue;return n.value=null!=o?o:"",n}return r(t,e),t.prototype.validateProps=function(e){var t;if(l.default.Children.count(e.children)>1)throw new Error("The Quill editing area can only be composed of a single React element.");if(l.default.Children.count(e.children)&&"textarea"===(null===(t=l.default.Children.only(e.children))||void 0===t?void 0:t.type))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")},t.prototype.shouldComponentUpdate=function(e,t){var n,o=this;if(this.validateProps(e),!this.editor||this.state.generation!==t.generation)return!0;if("value"in e){var r=this.getEditorContents(),i=null!=(n=e.value)?n:"";this.isEqualValue(i,r)||this.setEditorContents(this.editor,i)}return e.readOnly!==this.props.readOnly&&this.setEditorReadOnly(this.editor,e.readOnly),a(this.cleanProps,this.dirtyProps).some(function(t){return!u.default(e[t],o.props[t])})},t.prototype.shouldComponentRegenerate=function(e){var t=this;return this.dirtyProps.some(function(n){return!u.default(e[n],t.props[n])})},t.prototype.componentDidMount=function(){this.instantiateEditor(),this.setEditorContents(this.editor,this.getEditorContents())},t.prototype.componentWillUnmount=function(){this.destroyEditor()},t.prototype.componentDidUpdate=function(e,t){var n=this;if(this.editor&&this.shouldComponentRegenerate(e)){var o=this.editor.getContents(),r=this.editor.getSelection();this.regenerationSnapshot={delta:o,selection:r},this.setState({generation:this.state.generation+1}),this.destroyEditor()}if(this.state.generation!==t.generation){var i=this.regenerationSnapshot,a=(o=i.delta,i.selection);delete this.regenerationSnapshot,this.instantiateEditor();var s=this.editor;s.setContents(o),h(function(){return n.setEditorSelection(s,a)})}},t.prototype.instantiateEditor=function(){this.editor?this.hookEditor(this.editor):this.editor=this.createEditor(this.getEditingArea(),this.getEditorConfig())},t.prototype.destroyEditor=function(){this.editor&&this.unhookEditor(this.editor)},t.prototype.isControlled=function(){return"value"in this.props},t.prototype.getEditorConfig=function(){return{bounds:this.props.bounds,formats:this.props.formats,modules:this.props.modules,placeholder:this.props.placeholder,readOnly:this.props.readOnly,scrollingContainer:this.props.scrollingContainer,tabIndex:this.props.tabIndex,theme:this.props.theme}},t.prototype.getEditor=function(){if(!this.editor)throw new Error("Accessing non-instantiated editor");return this.editor},t.prototype.createEditor=function(e,t){var n=new d.default(e,t);return null!=t.tabIndex&&this.setEditorTabIndex(n,t.tabIndex),this.hookEditor(n),n},t.prototype.hookEditor=function(e){this.unprivilegedEditor=this.makeUnprivilegedEditor(e),e.on("editor-change",this.onEditorChange)},t.prototype.unhookEditor=function(e){e.off("editor-change",this.onEditorChange)},t.prototype.getEditorContents=function(){return this.value},t.prototype.getEditorSelection=function(){return this.selection},t.prototype.isDelta=function(e){return e&&e.ops},t.prototype.isEqualValue=function(e,t){return this.isDelta(e)&&this.isDelta(t)?u.default(e.ops,t.ops):u.default(e,t)},t.prototype.setEditorContents=function(e,t){var n=this;this.value=t;var o=this.getEditorSelection();"string"==typeof t?e.setContents(e.clipboard.convert(t)):e.setContents(t),h(function(){return n.setEditorSelection(e,o)})},t.prototype.setEditorSelection=function(e,t){if(this.selection=t,t){var 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)}},t.prototype.setEditorTabIndex=function(e,t){var n,o;(null===(o=null===(n=e)||void 0===n?void 0:n.scroll)||void 0===o?void 0:o.domNode)&&(e.scroll.domNode.tabIndex=t)},t.prototype.setEditorReadOnly=function(e,t){t?e.disable():e.enable()},t.prototype.makeUnprivilegedEditor=function(e){var t=e;return{getHTML:function(){return t.root.innerHTML},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)}},t.prototype.getEditingArea=function(){if(!this.editingArea)throw new Error("Instantiating on missing editing area");var e=c.default.findDOMNode(this.editingArea);if(!e)throw new Error("Cannot find element for editing area");if(3===e.nodeType)throw new Error("Editing area cannot be a text node");return e},t.prototype.renderEditingArea=function(){var e=this,t=this.props,n=t.children,o=t.preserveWhitespace,r={key:this.state.generation,ref:function(t){e.editingArea=t}};return l.default.Children.count(n)?l.default.cloneElement(l.default.Children.only(n),r):o?l.default.createElement("pre",i({},r)):l.default.createElement("div",i({},r))},t.prototype.render=function(){var e;return l.default.createElement("div",{id:this.props.id,style:this.props.style,key:this.state.generation,className:"quill "+(e=this.props.className,null!=e?e:""),onKeyPress:this.props.onKeyPress,onKeyDown:this.props.onKeyDown,onKeyUp:this.props.onKeyUp},this.renderEditingArea())},t.prototype.onEditorChangeText=function(e,t,n,o){var r,i;if(this.editor){var a=this.isDelta(this.value)?o.getContents():o.getHTML();a!==this.getEditorContents()&&(this.lastDeltaChangeSet=t,this.value=a,null===(i=(r=this.props).onChange)||void 0===i||i.call(r,e,t,n,o))}},t.prototype.onEditorChangeSelection=function(e,t,n){var o,r,i,a,s,l;if(this.editor){var c=this.getEditorSelection(),d=!c&&e,f=c&&!e;u.default(e,c)||(this.selection=e,null===(r=(o=this.props).onChangeSelection)||void 0===r||r.call(o,e,t,n),d?null===(a=(i=this.props).onFocus)||void 0===a||a.call(i,e,t,n):f&&(null===(l=(s=this.props).onBlur)||void 0===l||l.call(s,c,t,n)))}},t.prototype.focus=function(){this.editor&&this.editor.focus()},t.prototype.blur=function(){this.editor&&(this.selection=null,this.editor.blur())},t.displayName="React Quill",t.Quill=d.default,t.defaultProps={theme:"snow",modules:{},readOnly:!1},t}(l.default.Component);function h(e){Promise.resolve().then(e)}e.exports=f},47473:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},48655:(e,t,n)=>{var o=n(26025);e.exports=function(e){return o(this.__data__,e)>-1}},50002:(e,t,n)=>{var o=n(82199),r=n(4664),i=n(95950);e.exports=function(e){return o(e,i,r)}},50689:(e,t,n)=>{var o=n(50002),r=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,i,a,s){var l=1&n,c=o(e),u=c.length;if(u!=o(t).length&&!l)return!1;for(var d=u;d--;){var f=c[d];if(!(l?f in t:r.call(t,f)))return!1}var h=s.get(e),p=s.get(t);if(h&&p)return h==t&&p==e;var g=!0;s.set(e,t),s.set(t,e);for(var y=l;++d<u;){var m=e[f=c[d]],v=t[f];if(i)var b=l?i(v,m,f,t,e,s):i(m,v,f,e,t,s);if(!(void 0===b?m===v||a(m,v,n,i,s):b)){g=!1;break}y||(y="constructor"==f)}if(g&&!y){var x=e.constructor,w=t.constructor;x==w||!("constructor"in e)||!("constructor"in t)||"function"==typeof x&&x instanceof x&&"function"==typeof w&&w instanceof w||(g=!1)}return s.delete(e),s.delete(t),g}},51420:(e,t,n)=>{var o=n(80079);e.exports=function(){this.__data__=new o,this.size=0}},51459:e=>{e.exports=function(e){return this.__data__.has(e)}},51873:(e,t,n)=>{var o=n(9325).Symbol;e.exports=o},53661:(e,t,n)=>{var o=n(63040),r=n(17670),i=n(90289),a=n(4509),s=n(72949);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}l.prototype.clear=o,l.prototype.delete=r,l.prototype.get=i,l.prototype.has=a,l.prototype.set=s,e.exports=l},55481:(e,t,n)=>{var o=n(9325)["__core-js_shared__"];e.exports=o},55527:e=>{var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}},55580:(e,t,n)=>{var o=n(56110)(n(9325),"DataView");e.exports=o},56110:(e,t,n)=>{var o=n(45083),r=n(10392);e.exports=function(e,t){var n=r(e,t);return o(n)?n:void 0}},56449:e=>{var t=Array.isArray;e.exports=t},59350:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},60270:(e,t,n)=>{var o=n(87068),r=n(40346);e.exports=function e(t,n,i,a,s){return t===n||(null==t||null==n||!r(t)&&!r(n)?t!=t&&n!=n:o(t,n,i,a,e,s))}},63040:(e,t,n)=>{var o=n(21549),r=n(80079),i=n(68223);e.exports=function(){this.size=0,this.__data__={hash:new o,map:new(i||r),string:new o}}},63345:e=>{e.exports=function(){return[]}},63605:e=>{e.exports=function(e){return this.__data__.get(e)}},63702:e=>{e.exports=function(){this.__data__=[],this.size=0}},63862:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},64894:(e,t,n)=>{var o=n(1882),r=n(30294);e.exports=function(e){return null!=e&&r(e.length)&&!o(e)}},66721:(e,t,n)=>{var o=n(81042),r=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(o){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return r.call(t,e)?t[e]:void 0}},68223:(e,t,n)=>{var o=n(56110)(n(9325),"Map");e.exports=o},70080:(e,t,n)=>{var o=n(26025),r=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=o(t,e);return!(n<0||(n==t.length-1?t.pop():r.call(t,n,1),--this.size,0))}},70695:(e,t,n)=>{var o=n(78096),r=n(72428),i=n(56449),a=n(3656),s=n(30361),l=n(37167),c=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=i(e),u=!n&&r(e),d=!n&&!u&&a(e),f=!n&&!u&&!d&&l(e),h=n||u||d||f,p=h?o(e.length,String):[],g=p.length;for(var y in e)!t&&!c.call(e,y)||h&&("length"==y||d&&("offset"==y||"parent"==y)||f&&("buffer"==y||"byteLength"==y||"byteOffset"==y)||s(y,g))||p.push(y);return p}},72428:(e,t,n)=>{var o=n(27534),r=n(40346),i=Object.prototype,a=i.hasOwnProperty,s=i.propertyIsEnumerable,l=o(function(){return arguments}())?o:function(e){return r(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=l},72552:(e,t,n)=>{var o=n(51873),r=n(659),i=n(59350),a=o?o.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?r(e):i(e)}},72949:(e,t,n)=>{var o=n(12651);e.exports=function(e,t){var n=o(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}},74218:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},74335:e=>{e.exports=function(e,t){return function(n){return e(t(n))}}},74848:(e,t,n)=>{"use strict";e.exports=n(21020)},75288:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},76545:(e,t,n)=>{var o=n(56110)(n(9325),"Set");e.exports=o},78096:e=>{e.exports=function(e,t){for(var n=-1,o=Array(e);++n<e;)o[n]=t(n);return o}},79770:e=>{e.exports=function(e,t){for(var n=-1,o=null==e?0:e.length,r=0,i=[];++n<o;){var a=e[n];t(a,n,e)&&(i[r++]=a)}return i}},80079:(e,t,n)=>{var o=n(63702),r=n(70080),i=n(24739),a=n(48655),s=n(31175);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}l.prototype.clear=o,l.prototype.delete=r,l.prototype.get=i,l.prototype.has=a,l.prototype.set=s,e.exports=l},80945:(e,t,n)=>{var o=n(80079),r=n(68223),i=n(53661);e.exports=function(e,t){var n=this.__data__;if(n instanceof o){var a=n.__data__;if(!r||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new i(a)}return n.set(e,t),this.size=n.size,this}},81042:(e,t,n)=>{var o=n(56110)(Object,"create");e.exports=o},82199:(e,t,n)=>{var o=n(14528),r=n(56449);e.exports=function(e,t,n){var i=t(e);return r(e)?i:o(i,n(e))}},84247:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}},86009:(e,t,n)=>{e=n.nmd(e);var o=n(34840),r=t&&!t.nodeType&&t,i=r&&e&&!e.nodeType&&e,a=i&&i.exports===r&&o.process,s=function(){try{return i&&i.require&&i.require("util").types||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=s},87068:(e,t,n)=>{var o=n(37217),r=n(25911),i=n(21986),a=n(50689),s=n(5861),l=n(56449),c=n(3656),u=n(37167),d="[object Arguments]",f="[object Array]",h="[object Object]",p=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,g,y,m){var v=l(e),b=l(t),x=v?f:s(e),w=b?f:s(t),_=(x=x==d?h:x)==h,E=(w=w==d?h:w)==h,k=x==w;if(k&&c(e)){if(!c(t))return!1;v=!0,_=!1}if(k&&!_)return m||(m=new o),v||u(e)?r(e,t,n,g,y,m):i(e,t,x,n,g,y,m);if(!(1&n)){var O=_&&p.call(e,"__wrapped__"),S=E&&p.call(t,"__wrapped__");if(O||S){var C=O?e.value():e,N=S?t.value():t;return m||(m=new o),y(C,N,n,g,m)}}return!!k&&(m||(m=new o),a(e,t,n,g,y,m))}},87296:(e,t,n)=>{var o,r=n(55481),i=(o=/[^.]+$/.exec(r&&r.keys&&r.keys.IE_PROTO||""))?"Symbol(src)_1."+o:"";e.exports=function(e){return!!i&&i in e}},88984:(e,t,n)=>{var o=n(55527),r=n(3650),i=Object.prototype.hasOwnProperty;e.exports=function(e){if(!o(e))return r(e);var t=[];for(var n in Object(e))i.call(e,n)&&"constructor"!=n&&t.push(n);return t}},89935:e=>{e.exports=function(){return!1}},90289:(e,t,n)=>{var o=n(12651);e.exports=function(e){return o(this,e).get(e)}},90938:e=>{e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},91574:function(e){var t;"undefined"!=typeof self&&self,t=function(){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:o})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=109)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(17),r=n(18),i=n(19),a=n(45),s=n(46),l=n(47),c=n(48),u=n(49),d=n(12),f=n(32),h=n(33),p=n(31),g=n(1),y={Scope:g.Scope,create:g.create,find:g.find,query:g.query,register:g.register,Container:o.default,Format:r.default,Leaf:i.default,Embed:c.default,Scroll:a.default,Block:l.default,Inline:s.default,Text:u.default,Attributor:{Attribute:d.default,Class:f.default,Style:h.default,Store:p.default}};t.default=y},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function __(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)});Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(t){var n=this;return t="[Parchment] "+t,(n=e.call(this,t)||this).message=t,n.name=n.constructor.name,n}return r(t,e),t}(Error);t.ParchmentError=i;var a,s={},l={},c={},u={};function d(e,t){var n;if(void 0===t&&(t=a.ANY),"string"==typeof e)n=u[e]||s[e];else if(e instanceof Text||e.nodeType===Node.TEXT_NODE)n=u.text;else if("number"==typeof e)e&a.LEVEL&a.BLOCK?n=u.block:e&a.LEVEL&a.INLINE&&(n=u.inline);else if(e instanceof HTMLElement){var o=(e.getAttribute("class")||"").split(/\s+/);for(var r in o)if(n=l[o[r]])break;n=n||c[e.tagName]}return null==n?null:t&a.LEVEL&n.scope&&t&a.TYPE&n.scope?n:null}t.DATA_KEY="__blot",function(e){e[e.TYPE=3]="TYPE",e[e.LEVEL=12]="LEVEL",e[e.ATTRIBUTE=13]="ATTRIBUTE",e[e.BLOT=14]="BLOT",e[e.INLINE=7]="INLINE",e[e.BLOCK=11]="BLOCK",e[e.BLOCK_BLOT=10]="BLOCK_BLOT",e[e.INLINE_BLOT=6]="INLINE_BLOT",e[e.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",e[e.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",e[e.ANY=15]="ANY"}(a=t.Scope||(t.Scope={})),t.create=function(e,t){var n=d(e);if(null==n)throw new i("Unable to create "+e+" blot");var o=n,r=e instanceof Node||e.nodeType===Node.TEXT_NODE?e:o.create(t);return new o(r,t)},t.find=function e(n,o){return void 0===o&&(o=!1),null==n?null:null!=n[t.DATA_KEY]?n[t.DATA_KEY].blot:o?e(n.parentNode,o):null},t.query=d,t.register=function e(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(t.length>1)return t.map(function(t){return e(t)});var o=t[0];if("string"!=typeof o.blotName&&"string"!=typeof o.attrName)throw new i("Invalid definition");if("abstract"===o.blotName)throw new i("Cannot register abstract class");return u[o.blotName||o.attrName]=o,"string"==typeof o.keyName?s[o.keyName]=o:(null!=o.className&&(l[o.className]=o),null!=o.tagName&&(Array.isArray(o.tagName)?o.tagName=o.tagName.map(function(e){return e.toUpperCase()}):o.tagName=o.tagName.toUpperCase(),(Array.isArray(o.tagName)?o.tagName:[o.tagName]).forEach(function(e){null!=c[e]&&null!=o.className||(c[e]=o)}))),o}},function(e,t,n){var o=n(51),r=n(11),i=n(3),a=n(20),s=String.fromCharCode(0),l=function(e){Array.isArray(e)?this.ops=e:null!=e&&Array.isArray(e.ops)?this.ops=e.ops:this.ops=[]};l.prototype.insert=function(e,t){var n={};return 0===e.length?this:(n.insert=e,null!=t&&"object"==typeof t&&Object.keys(t).length>0&&(n.attributes=t),this.push(n))},l.prototype.delete=function(e){return e<=0?this:this.push({delete:e})},l.prototype.retain=function(e,t){if(e<=0)return this;var n={retain:e};return null!=t&&"object"==typeof t&&Object.keys(t).length>0&&(n.attributes=t),this.push(n)},l.prototype.push=function(e){var t=this.ops.length,n=this.ops[t-1];if(e=i(!0,{},e),"object"==typeof n){if("number"==typeof e.delete&&"number"==typeof n.delete)return this.ops[t-1]={delete:n.delete+e.delete},this;if("number"==typeof n.delete&&null!=e.insert&&(t-=1,"object"!=typeof(n=this.ops[t-1])))return this.ops.unshift(e),this;if(r(e.attributes,n.attributes)){if("string"==typeof e.insert&&"string"==typeof n.insert)return this.ops[t-1]={insert:n.insert+e.insert},"object"==typeof e.attributes&&(this.ops[t-1].attributes=e.attributes),this;if("number"==typeof e.retain&&"number"==typeof n.retain)return this.ops[t-1]={retain:n.retain+e.retain},"object"==typeof e.attributes&&(this.ops[t-1].attributes=e.attributes),this}}return t===this.ops.length?this.ops.push(e):this.ops.splice(t,0,e),this},l.prototype.chop=function(){var e=this.ops[this.ops.length-1];return e&&e.retain&&!e.attributes&&this.ops.pop(),this},l.prototype.filter=function(e){return this.ops.filter(e)},l.prototype.forEach=function(e){this.ops.forEach(e)},l.prototype.map=function(e){return this.ops.map(e)},l.prototype.partition=function(e){var t=[],n=[];return this.forEach(function(o){(e(o)?t:n).push(o)}),[t,n]},l.prototype.reduce=function(e,t){return this.ops.reduce(e,t)},l.prototype.changeLength=function(){return this.reduce(function(e,t){return t.insert?e+a.length(t):t.delete?e-t.delete:e},0)},l.prototype.length=function(){return this.reduce(function(e,t){return e+a.length(t)},0)},l.prototype.slice=function(e,t){e=e||0,"number"!=typeof t&&(t=1/0);for(var n=[],o=a.iterator(this.ops),r=0;r<t&&o.hasNext();){var i;r<e?i=o.next(e-r):(i=o.next(t-r),n.push(i)),r+=a.length(i)}return new l(n)},l.prototype.compose=function(e){var t=a.iterator(this.ops),n=a.iterator(e.ops),o=[],i=n.peek();if(null!=i&&"number"==typeof i.retain&&null==i.attributes){for(var s=i.retain;"insert"===t.peekType()&&t.peekLength()<=s;)s-=t.peekLength(),o.push(t.next());i.retain-s>0&&n.next(i.retain-s)}for(var c=new l(o);t.hasNext()||n.hasNext();)if("insert"===n.peekType())c.push(n.next());else if("delete"===t.peekType())c.push(t.next());else{var u=Math.min(t.peekLength(),n.peekLength()),d=t.next(u),f=n.next(u);if("number"==typeof f.retain){var h={};"number"==typeof d.retain?h.retain=u:h.insert=d.insert;var p=a.attributes.compose(d.attributes,f.attributes,"number"==typeof d.retain);if(p&&(h.attributes=p),c.push(h),!n.hasNext()&&r(c.ops[c.ops.length-1],h)){var g=new l(t.rest());return c.concat(g).chop()}}else"number"==typeof f.delete&&"number"==typeof d.retain&&c.push(f)}return c.chop()},l.prototype.concat=function(e){var t=new l(this.ops.slice());return e.ops.length>0&&(t.push(e.ops[0]),t.ops=t.ops.concat(e.ops.slice(1))),t},l.prototype.diff=function(e,t){if(this.ops===e.ops)return new l;var n=[this,e].map(function(t){return t.map(function(n){if(null!=n.insert)return"string"==typeof n.insert?n.insert:s;throw new Error("diff() called "+(t===e?"on":"with")+" non-document")}).join("")}),i=new l,c=o(n[0],n[1],t),u=a.iterator(this.ops),d=a.iterator(e.ops);return c.forEach(function(e){for(var t=e[1].length;t>0;){var n=0;switch(e[0]){case o.INSERT:n=Math.min(d.peekLength(),t),i.push(d.next(n));break;case o.DELETE:n=Math.min(t,u.peekLength()),u.next(n),i.delete(n);break;case o.EQUAL:n=Math.min(u.peekLength(),d.peekLength(),t);var s=u.next(n),l=d.next(n);r(s.insert,l.insert)?i.retain(n,a.attributes.diff(s.attributes,l.attributes)):i.push(l).delete(n)}t-=n}}),i.chop()},l.prototype.eachLine=function(e,t){t=t||"\n";for(var n=a.iterator(this.ops),o=new l,r=0;n.hasNext();){if("insert"!==n.peekType())return;var i=n.peek(),s=a.length(i)-n.peekLength(),c="string"==typeof i.insert?i.insert.indexOf(t,s)-s:-1;if(c<0)o.push(n.next());else if(c>0)o.push(n.next(c));else{if(!1===e(o,n.next(1).attributes||{},r))return;r+=1,o=new l}}o.length()>0&&e(o,{},r)},l.prototype.transform=function(e,t){if(t=!!t,"number"==typeof e)return this.transformPosition(e,t);for(var n=a.iterator(this.ops),o=a.iterator(e.ops),r=new l;n.hasNext()||o.hasNext();)if("insert"!==n.peekType()||!t&&"insert"===o.peekType())if("insert"===o.peekType())r.push(o.next());else{var i=Math.min(n.peekLength(),o.peekLength()),s=n.next(i),c=o.next(i);if(s.delete)continue;c.delete?r.push(c):r.retain(i,a.attributes.transform(s.attributes,c.attributes,t))}else r.retain(a.length(n.next()));return r.chop()},l.prototype.transformPosition=function(e,t){t=!!t;for(var n=a.iterator(this.ops),o=0;n.hasNext()&&o<=e;){var r=n.peekLength(),i=n.peekType();n.next(),"delete"!==i?("insert"===i&&(o<e||!t)&&(e+=r),o+=r):e-=Math.min(r,e-o)}return e},e.exports=l},function(e,t){"use strict";var n=Object.prototype.hasOwnProperty,o=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===o.call(e)},s=function(e){if(!e||"[object Object]"!==o.call(e))return!1;var t,r=n.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!i)return!1;for(t in e);return void 0===t||n.call(e,t)},l=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},c=function(e,t){if("__proto__"===t){if(!n.call(e,t))return;if(i)return i(e,t).value}return e[t]};e.exports=function e(){var t,n,o,r,i,u,d=arguments[0],f=1,h=arguments.length,p=!1;for("boolean"==typeof d&&(p=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<h;++f)if(null!=(t=arguments[f]))for(n in t)o=c(d,n),d!==(r=c(t,n))&&(p&&r&&(s(r)||(i=a(r)))?(i?(i=!1,u=o&&a(o)?o:[]):u=o&&s(o)?o:{},l(d,{name:n,newValue:e(p,u,r)})):void 0!==r&&l(d,{name:n,newValue:r}));return d}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.BlockEmbed=t.bubbleFormats=void 0;var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(o):void 0},i=d(n(3)),a=d(n(2)),s=d(n(0)),l=d(n(16)),c=d(n(6)),u=d(n(7));function d(e){return e&&e.__esModule?e:{default:e}}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var g=function(e){function t(){return f(this,t),h(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return p(t,e),o(t,[{key:"attach",value:function(){r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"attach",this).call(this),this.attributes=new s.default.Attributor.Store(this.domNode)}},{key:"delta",value:function(){return(new a.default).insert(this.value(),(0,i.default)(this.formats(),this.attributes.values()))}},{key:"format",value:function(e,t){var n=s.default.query(e,s.default.Scope.BLOCK_ATTRIBUTE);null!=n&&this.attributes.attribute(n,t)}},{key:"formatAt",value:function(e,t,n,o){this.format(n,o)}},{key:"insertAt",value:function(e,n,o){if("string"==typeof n&&n.endsWith("\n")){var i=s.default.create(y.blotName);this.parent.insertBefore(i,0===e?this:this.next),i.insertAt(0,n.slice(0,-1))}else r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insertAt",this).call(this,e,n,o)}}]),t}(s.default.Embed);g.scope=s.default.Scope.BLOCK_BLOT;var y=function(e){function t(e){f(this,t);var n=h(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.cache={},n}return p(t,e),o(t,[{key:"delta",value:function(){return null==this.cache.delta&&(this.cache.delta=this.descendants(s.default.Leaf).reduce(function(e,t){return 0===t.length()?e:e.insert(t.value(),m(t))},new a.default).insert("\n",m(this))),this.cache.delta}},{key:"deleteAt",value:function(e,n){r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"deleteAt",this).call(this,e,n),this.cache={}}},{key:"formatAt",value:function(e,n,o,i){n<=0||(s.default.query(o,s.default.Scope.BLOCK)?e+n===this.length()&&this.format(o,i):r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"formatAt",this).call(this,e,Math.min(n,this.length()-e-1),o,i),this.cache={})}},{key:"insertAt",value:function(e,n,o){if(null!=o)return r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insertAt",this).call(this,e,n,o);if(0!==n.length){var i=n.split("\n"),a=i.shift();a.length>0&&(e<this.length()-1||null==this.children.tail?r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insertAt",this).call(this,Math.min(e,this.length()-1),a):this.children.tail.insertAt(this.children.tail.length(),a),this.cache={});var s=this;i.reduce(function(e,t){return(s=s.split(e,!0)).insertAt(0,t),t.length},e+a.length)}}},{key:"insertBefore",value:function(e,n){var o=this.children.head;r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insertBefore",this).call(this,e,n),o instanceof l.default&&o.remove(),this.cache={}}},{key:"length",value:function(){return null==this.cache.length&&(this.cache.length=r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"length",this).call(this)+1),this.cache.length}},{key:"moveChildren",value:function(e,n){r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"moveChildren",this).call(this,e,n),this.cache={}}},{key:"optimize",value:function(e){r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"optimize",this).call(this,e),this.cache={}}},{key:"path",value:function(e){return r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"path",this).call(this,e,!0)}},{key:"removeChild",value:function(e){r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"removeChild",this).call(this,e),this.cache={}}},{key:"split",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(n&&(0===e||e>=this.length()-1)){var o=this.clone();return 0===e?(this.parent.insertBefore(o,this),this):(this.parent.insertBefore(o,this.next),o)}var i=r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"split",this).call(this,e,n);return this.cache={},i}}]),t}(s.default.Block);function m(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return null==e?t:("function"==typeof e.formats&&(t=(0,i.default)(t,e.formats())),null==e.parent||"scroll"==e.parent.blotName||e.parent.statics.scope!==e.statics.scope?t:m(e.parent,t))}y.blotName="block",y.tagName="P",y.defaultChild="break",y.allowedChildren=[c.default,s.default.Embed,u.default],t.bubbleFormats=m,t.BlockEmbed=g,t.default=y},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.overload=t.expandConfig=void 0;var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],_n=!0,o=!1,r=void 0;try{for(var i,a=e[Symbol.iterator]();!(_n=(i=a.next()).done)&&(n.push(i.value),!t||n.length!==t);_n=!0);}catch(e){o=!0,r=e}finally{try{!_n&&a.return&&a.return()}finally{if(o)throw r}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}();n(50);var a=y(n(2)),s=y(n(14)),l=y(n(8)),c=y(n(9)),u=y(n(0)),d=n(15),f=y(d),h=y(n(3)),p=y(n(10)),g=y(n(34));function y(e){return e&&e.__esModule?e:{default:e}}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var v=(0,p.default)("quill"),b=function(){function e(t){var n=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.options=x(t,o),this.container=this.options.container,null==this.container)return v.error("Invalid Quill container",t);this.options.debug&&e.debug(this.options.debug);var r=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",this.container.__quill=this,this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.root.setAttribute("data-gramm",!1),this.scrollingContainer=this.options.scrollingContainer||this.root,this.emitter=new l.default,this.scroll=u.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new s.default(this.scroll),this.selection=new f.default(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.theme.init(),this.emitter.on(l.default.events.EDITOR_CHANGE,function(e){e===l.default.events.TEXT_CHANGE&&n.root.classList.toggle("ql-blank",n.editor.isBlank())}),this.emitter.on(l.default.events.SCROLL_UPDATE,function(e,t){var o=n.selection.lastRange,r=o&&0===o.length?o.index:void 0;w.call(n,function(){return n.editor.update(null,t,r)},e)});var i=this.clipboard.convert("<div class='ql-editor' style=\"white-space: normal;\">"+r+"<p><br></p></div>");this.setContents(i),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return i(e,null,[{key:"debug",value:function(e){!0===e&&(e="log"),p.default.level(e)}},{key:"find",value:function(e){return e.__quill||u.default.find(e)}},{key:"import",value:function(e){return null==this.imports[e]&&v.error("Cannot import "+e+". Are you sure it was registered?"),this.imports[e]}},{key:"register",value:function(e,t){var n=this,o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("string"!=typeof e){var r=e.attrName||e.blotName;"string"==typeof r?this.register("formats/"+r,e,t):Object.keys(e).forEach(function(o){n.register(o,e[o],t)})}else null==this.imports[e]||o||v.warn("Overwriting "+e+" with",t),this.imports[e]=t,(e.startsWith("blots/")||e.startsWith("formats/"))&&"abstract"!==t.blotName?u.default.register(t):e.startsWith("modules")&&"function"==typeof t.register&&t.register()}}]),i(e,[{key:"addContainer",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if("string"==typeof e){var n=e;(e=document.createElement("div")).classList.add(n)}return this.container.insertBefore(e,t),e}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(e,t,n){var o=this,i=_(e,t,n),a=r(i,4);return e=a[0],t=a[1],n=a[3],w.call(this,function(){return o.editor.deleteText(e,t)},n,e,-1*t)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.scroll.enable(e),this.container.classList.toggle("ql-disabled",!e)}},{key:"focus",value:function(){var e=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=e,this.scrollIntoView()}},{key:"format",value:function(e,t){var n=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.default.sources.API;return w.call(this,function(){var o=n.getSelection(!0),r=new a.default;if(null==o)return r;if(u.default.query(e,u.default.Scope.BLOCK))r=n.editor.formatLine(o.index,o.length,m({},e,t));else{if(0===o.length)return n.selection.format(e,t),r;r=n.editor.formatText(o.index,o.length,m({},e,t))}return n.setSelection(o,l.default.sources.SILENT),r},o)}},{key:"formatLine",value:function(e,t,n,o,i){var a,s=this,l=_(e,t,n,o,i),c=r(l,4);return e=c[0],t=c[1],a=c[2],i=c[3],w.call(this,function(){return s.editor.formatLine(e,t,a)},i,e,0)}},{key:"formatText",value:function(e,t,n,o,i){var a,s=this,l=_(e,t,n,o,i),c=r(l,4);return e=c[0],t=c[1],a=c[2],i=c[3],w.call(this,function(){return s.editor.formatText(e,t,a)},i,e,0)}},{key:"getBounds",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;t="number"==typeof e?this.selection.getBounds(e,n):this.selection.getBounds(e.index,e.length);var o=this.container.getBoundingClientRect();return{bottom:t.bottom-o.top,height:t.height,left:t.left-o.left,right:t.right-o.left,top:t.top-o.top,width:t.width}}},{key:"getContents",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-e,n=_(e,t),o=r(n,2);return e=o[0],t=o[1],this.editor.getContents(e,t)}},{key:"getFormat",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getSelection(!0),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"number"==typeof e?this.editor.getFormat(e,t):this.editor.getFormat(e.index,e.length)}},{key:"getIndex",value:function(e){return e.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(e){return this.scroll.leaf(e)}},{key:"getLine",value:function(e){return this.scroll.line(e)}},{key:"getLines",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE;return"number"!=typeof e?this.scroll.lines(e.index,e.length):this.scroll.lines(e,t)}},{key:"getModule",value:function(e){return this.theme.modules[e]}},{key:"getSelection",value:function(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-e,n=_(e,t),o=r(n,2);return e=o[0],t=o[1],this.editor.getText(e,t)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(t,n,o){var r=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.sources.API;return w.call(this,function(){return r.editor.insertEmbed(t,n,o)},i,t)}},{key:"insertText",value:function(e,t,n,o,i){var a,s=this,l=_(e,0,n,o,i),c=r(l,4);return e=c[0],a=c[2],i=c[3],w.call(this,function(){return s.editor.insertText(e,t,a)},i,e,t.length)}},{key:"isEnabled",value:function(){return!this.container.classList.contains("ql-disabled")}},{key:"off",value:function(){return this.emitter.off.apply(this.emitter,arguments)}},{key:"on",value:function(){return this.emitter.on.apply(this.emitter,arguments)}},{key:"once",value:function(){return this.emitter.once.apply(this.emitter,arguments)}},{key:"pasteHTML",value:function(e,t,n){this.clipboard.dangerouslyPasteHTML(e,t,n)}},{key:"removeFormat",value:function(e,t,n){var o=this,i=_(e,t,n),a=r(i,4);return e=a[0],t=a[1],n=a[3],w.call(this,function(){return o.editor.removeFormat(e,t)},n,e)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.default.sources.API;return w.call(this,function(){e=new a.default(e);var n=t.getLength(),o=t.editor.deleteText(0,n),r=t.editor.applyDelta(e),i=r.ops[r.ops.length-1];return null!=i&&"string"==typeof i.insert&&"\n"===i.insert[i.insert.length-1]&&(t.editor.deleteText(t.getLength()-1,1),r.delete(1)),o.compose(r)},n)}},{key:"setSelection",value:function(t,n,o){if(null==t)this.selection.setRange(null,n||e.sources.API);else{var i=_(t,n,o),a=r(i,4);t=a[0],n=a[1],o=a[3],this.selection.setRange(new d.Range(t,n),o),o!==l.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.default.sources.API,n=(new a.default).insert(e);return this.setContents(n,t)}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l.default.sources.USER,t=this.scroll.update(e);return this.selection.update(e),t}},{key:"updateContents",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.default.sources.API;return w.call(this,function(){return e=new a.default(e),t.editor.applyDelta(e,n)},n,!0)}}]),e}();function x(e,t){if((t=(0,h.default)(!0,{container:e,modules:{clipboard:!0,keyboard:!0,history:!0}},t)).theme&&t.theme!==b.DEFAULTS.theme){if(t.theme=b.import("themes/"+t.theme),null==t.theme)throw new Error("Invalid theme "+t.theme+". Did you register it?")}else t.theme=g.default;var n=(0,h.default)(!0,{},t.theme.DEFAULTS);[n,t].forEach(function(e){e.modules=e.modules||{},Object.keys(e.modules).forEach(function(t){!0===e.modules[t]&&(e.modules[t]={})})});var o=Object.keys(n.modules).concat(Object.keys(t.modules)).reduce(function(e,t){var n=b.import("modules/"+t);return null==n?v.error("Cannot load "+t+" module. Are you sure you registered it?"):e[t]=n.DEFAULTS||{},e},{});return null!=t.modules&&t.modules.toolbar&&t.modules.toolbar.constructor!==Object&&(t.modules.toolbar={container:t.modules.toolbar}),t=(0,h.default)(!0,{},b.DEFAULTS,{modules:o},n,t),["bounds","container","scrollingContainer"].forEach(function(e){"string"==typeof t[e]&&(t[e]=document.querySelector(t[e]))}),t.modules=Object.keys(t.modules).reduce(function(e,n){return t.modules[n]&&(e[n]=t.modules[n]),e},{}),t}function w(e,t,n,o){if(this.options.strict&&!this.isEnabled()&&t===l.default.sources.USER)return new a.default;var r=null==n?null:this.getSelection(),i=this.editor.delta,s=e();if(null!=r&&(!0===n&&(n=r.index),null==o?r=E(r,s,t):0!==o&&(r=E(r,n,o,t)),this.setSelection(r,l.default.sources.SILENT)),s.length()>0){var c,u,d=[l.default.events.TEXT_CHANGE,s,i,t];(c=this.emitter).emit.apply(c,[l.default.events.EDITOR_CHANGE].concat(d)),t!==l.default.sources.SILENT&&(u=this.emitter).emit.apply(u,d)}return s}function _(e,t,n,r,i){var a={};return"number"==typeof e.index&&"number"==typeof e.length?"number"!=typeof t?(i=r,r=n,n=t,t=e.length,e=e.index):(t=e.length,e=e.index):"number"!=typeof t&&(i=r,r=n,n=t,t=0),"object"===(void 0===n?"undefined":o(n))?(a=n,i=r):"string"==typeof n&&(null!=r?a[n]=r:i=n),[e,t,a,i=i||l.default.sources.API]}function E(e,t,n,o){if(null==e)return null;var i=void 0,s=void 0;if(t instanceof a.default){var c=[e.index,e.index+e.length].map(function(e){return t.transformPosition(e,o!==l.default.sources.USER)}),u=r(c,2);i=u[0],s=u[1]}else{var f=[e.index,e.index+e.length].map(function(e){return e<t||e===t&&o===l.default.sources.USER?e:n>=0?e+n:Math.max(t,e+n)}),h=r(f,2);i=h[0],s=h[1]}return new d.Range(i,s-i)}b.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},b.events=l.default.events,b.sources=l.default.sources,b.version="1.3.7",b.imports={delta:a.default,parchment:u.default,"core/module":c.default,"core/theme":g.default},t.expandConfig=x,t.overload=_,t.default=b},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(o):void 0},i=s(n(7)),a=s(n(0));function s(e){return e&&e.__esModule?e:{default:e}}var l=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"formatAt",value:function(e,n,o,i){if(t.compare(this.statics.blotName,o)<0&&a.default.query(o,a.default.Scope.BLOT)){var s=this.isolate(e,n);i&&s.wrap(o,i)}else r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"formatAt",this).call(this,e,n,o,i)}},{key:"optimize",value:function(e){if(r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"optimize",this).call(this,e),this.parent instanceof t&&t.compare(this.statics.blotName,this.parent.statics.blotName)>0){var n=this.parent.isolate(this.offset(),this.length());this.moveChildren(n),n.wrap(this)}}}],[{key:"compare",value:function(e,n){var o=t.order.indexOf(e),r=t.order.indexOf(n);return o>=0||r>=0?o-r:e===n?0:e<n?-1:1}}]),t}(a.default.Inline);l.allowedChildren=[l,a.default.Embed,i.default],l.order=["cursor","inline","underline","strike","italic","bold","script","link","code"],t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,r=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(((o=n(0))&&o.__esModule?o:{default:o}).default.Text);t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(o):void 0},i=a(n(54));function a(e){return e&&e.__esModule?e:{default:e}}var s=(0,a(n(10)).default)("quill:events");["selectionchange","mousedown","mouseup","click"].forEach(function(e){document.addEventListener(e,function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];[].slice.call(document.querySelectorAll(".ql-container")).forEach(function(e){var n;e.__quill&&e.__quill.emitter&&(n=e.__quill.emitter).handleDOM.apply(n,t)})})});var l=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.listeners={},e.on("error",s.error),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"emit",value:function(){s.log.apply(s,arguments),r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"emit",this).apply(this,arguments)}},{key:"handleDOM",value:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];(this.listeners[e.type]||[]).forEach(function(t){var o=t.node,r=t.handler;(e.target===o||o.contains(e.target))&&r.apply(void 0,[e].concat(n))})}},{key:"listenDOM",value:function(e,t,n){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push({node:t,handler:n})}}]),t}(i.default);l.events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change"},l.sources={API:"api",SILENT:"silent",USER:"user"},t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.quill=t,this.options=n};o.DEFAULTS={},t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=["error","warn","log","info"],r="warn";function i(e){if(o.indexOf(e)<=o.indexOf(r)){for(var t,n=arguments.length,i=Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];(t=console)[e].apply(t,i)}}function a(e){return o.reduce(function(t,n){return t[n]=i.bind(console,n,e),t},{})}i.level=a.level=function(e){r=e},t.default=a},function(e,t,n){var o=Array.prototype.slice,r=n(52),i=n(53),a=e.exports=function(e,t,n){return n||(n={}),e===t||(e instanceof Date&&t instanceof Date?e.getTime()===t.getTime():!e||!t||"object"!=typeof e&&"object"!=typeof t?n.strict?e===t:e==t:function(e,t,n){var c,u;if(s(e)||s(t))return!1;if(e.prototype!==t.prototype)return!1;if(i(e))return!!i(t)&&(e=o.call(e),t=o.call(t),a(e,t,n));if(l(e)){if(!l(t))return!1;if(e.length!==t.length)return!1;for(c=0;c<e.length;c++)if(e[c]!==t[c])return!1;return!0}try{var d=r(e),f=r(t)}catch(e){return!1}if(d.length!=f.length)return!1;for(d.sort(),f.sort(),c=d.length-1;c>=0;c--)if(d[c]!=f[c])return!1;for(c=d.length-1;c>=0;c--)if(u=d[c],!a(e[u],t[u],n))return!1;return typeof e==typeof t}(e,t,n))};function s(e){return null==e}function l(e){return!(!e||"object"!=typeof e||"number"!=typeof e.length||"function"!=typeof e.copy||"function"!=typeof e.slice||e.length>0&&"number"!=typeof e[0])}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),r=function(){function e(e,t,n){void 0===n&&(n={}),this.attrName=e,this.keyName=t;var r=o.Scope.TYPE&o.Scope.ATTRIBUTE;null!=n.scope?this.scope=n.scope&o.Scope.LEVEL|r:this.scope=o.Scope.ATTRIBUTE,null!=n.whitelist&&(this.whitelist=n.whitelist)}return e.keys=function(e){return[].map.call(e.attributes,function(e){return e.name})},e.prototype.add=function(e,t){return!!this.canAdd(e,t)&&(e.setAttribute(this.keyName,t),!0)},e.prototype.canAdd=function(e,t){return null!=o.query(e,o.Scope.BLOT&(this.scope|o.Scope.TYPE))&&(null==this.whitelist||("string"==typeof t?this.whitelist.indexOf(t.replace(/["']/g,""))>-1:this.whitelist.indexOf(t)>-1))},e.prototype.remove=function(e){e.removeAttribute(this.keyName)},e.prototype.value=function(e){var t=e.getAttribute(this.keyName);return this.canAdd(e,t)&&t?t:""},e}();t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Code=void 0;var o=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],_n=!0,o=!1,r=void 0;try{for(var i,a=e[Symbol.iterator]();!(_n=(i=a.next()).done)&&(n.push(i.value),!t||n.length!==t);_n=!0);}catch(e){o=!0,r=e}finally{try{!_n&&a.return&&a.return()}finally{if(o)throw r}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(o):void 0},a=d(n(2)),s=d(n(0)),l=d(n(4)),c=d(n(6)),u=d(n(7));function d(e){return e&&e.__esModule?e:{default:e}}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var g=function(e){function t(){return f(this,t),h(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return p(t,e),t}(c.default);g.blotName="code",g.tagName="CODE";var y=function(e){function t(){return f(this,t),h(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return p(t,e),r(t,[{key:"delta",value:function(){var e=this,t=this.domNode.textContent;return t.endsWith("\n")&&(t=t.slice(0,-1)),t.split("\n").reduce(function(t,n){return t.insert(n).insert("\n",e.formats())},new a.default)}},{key:"format",value:function(e,n){if(e!==this.statics.blotName||!n){var r=this.descendant(u.default,this.length()-1),a=o(r,1)[0];null!=a&&a.deleteAt(a.length()-1,1),i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"format",this).call(this,e,n)}}},{key:"formatAt",value:function(e,n,o,r){if(0!==n&&null!=s.default.query(o,s.default.Scope.BLOCK)&&(o!==this.statics.blotName||r!==this.statics.formats(this.domNode))){var i=this.newlineIndex(e);if(!(i<0||i>=e+n)){var a=this.newlineIndex(e,!0)+1,l=i-a+1,c=this.isolate(a,l),u=c.next;c.format(o,r),u instanceof t&&u.formatAt(0,e-a+n-l,o,r)}}}},{key:"insertAt",value:function(e,t,n){if(null==n){var r=this.descendant(u.default,e),i=o(r,2),a=i[0],s=i[1];a.insertAt(s,t)}}},{key:"length",value:function(){var e=this.domNode.textContent.length;return this.domNode.textContent.endsWith("\n")?e:e+1}},{key:"newlineIndex",value:function(e){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1])return this.domNode.textContent.slice(0,e).lastIndexOf("\n");var t=this.domNode.textContent.slice(e).indexOf("\n");return t>-1?e+t:-1}},{key:"optimize",value:function(e){this.domNode.textContent.endsWith("\n")||this.appendChild(s.default.create("text","\n")),i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"optimize",this).call(this,e);var n=this.next;null!=n&&n.prev===this&&n.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===n.statics.formats(n.domNode)&&(n.optimize(e),n.moveChildren(this),n.remove())}},{key:"replace",value:function(e){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"replace",this).call(this,e),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(e){var t=s.default.find(e);null==t?e.parentNode.removeChild(e):t instanceof s.default.Embed?t.remove():t.unwrap()})}}],[{key:"create",value:function(e){var n=i(t.__proto__||Object.getPrototypeOf(t),"create",this).call(this,e);return n.setAttribute("spellcheck",!1),n}},{key:"formats",value:function(){return!0}}]),t}(l.default);y.blotName="code-block",y.tagName="PRE",y.TAB=" ",t.Code=g,t.default=y},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],_n=!0,o=!1,r=void 0;try{for(var i,a=e[Symbol.iterator]();!(_n=(i=a.next()).done)&&(n.push(i.value),!t||n.length!==t);_n=!0);}catch(e){o=!0,r=e}finally{try{!_n&&a.return&&a.return()}finally{if(o)throw r}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),a=m(n(2)),s=m(n(20)),l=m(n(0)),c=m(n(13)),u=m(n(24)),d=n(4),f=m(d),h=m(n(16)),p=m(n(21)),g=m(n(11)),y=m(n(3));function m(e){return e&&e.__esModule?e:{default:e}}var v=/^[ -~]*$/,b=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.scroll=t,this.delta=this.getDelta()}return i(e,[{key:"applyDelta",value:function(e){var t=this,n=!1;this.scroll.update();var i=this.scroll.length();return this.scroll.batchStart(),(e=function(e){return e.reduce(function(e,t){if(1===t.insert){var n=(0,p.default)(t.attributes);return delete n.image,e.insert({image:t.attributes.image},n)}if(null==t.attributes||!0!==t.attributes.list&&!0!==t.attributes.bullet||((t=(0,p.default)(t)).attributes.list?t.attributes.list="ordered":(t.attributes.list="bullet",delete t.attributes.bullet)),"string"==typeof t.insert){var o=t.insert.replace(/\r\n/g,"\n").replace(/\r/g,"\n");return e.insert(o,t.attributes)}return e.push(t)},new a.default)}(e)).reduce(function(e,a){var c=a.retain||a.delete||a.insert.length||1,u=a.attributes||{};if(null!=a.insert){if("string"==typeof a.insert){var h=a.insert;h.endsWith("\n")&&n&&(n=!1,h=h.slice(0,-1)),e>=i&&!h.endsWith("\n")&&(n=!0),t.scroll.insertAt(e,h);var p=t.scroll.line(e),g=r(p,2),m=g[0],v=g[1],b=(0,y.default)({},(0,d.bubbleFormats)(m));if(m instanceof f.default){var x=m.descendant(l.default.Leaf,v),w=r(x,1)[0];b=(0,y.default)(b,(0,d.bubbleFormats)(w))}u=s.default.attributes.diff(b,u)||{}}else if("object"===o(a.insert)){var _=Object.keys(a.insert)[0];if(null==_)return e;t.scroll.insertAt(e,_,a.insert[_])}i+=c}return Object.keys(u).forEach(function(n){t.scroll.formatAt(e,c,n,u[n])}),e+c},0),e.reduce(function(e,n){return"number"==typeof n.delete?(t.scroll.deleteAt(e,n.delete),e):e+(n.retain||n.insert.length||1)},0),this.scroll.batchEnd(),this.update(e)}},{key:"deleteText",value:function(e,t){return this.scroll.deleteAt(e,t),this.update((new a.default).retain(e).delete(t))}},{key:"formatLine",value:function(e,t){var n=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.scroll.update(),Object.keys(o).forEach(function(r){if(null==n.scroll.whitelist||n.scroll.whitelist[r]){var i=n.scroll.lines(e,Math.max(t,1)),a=t;i.forEach(function(t){var i=t.length();if(t instanceof c.default){var s=e-t.offset(n.scroll),l=t.newlineIndex(s+a)-s+1;t.formatAt(s,l,r,o[r])}else t.format(r,o[r]);a-=i})}}),this.scroll.optimize(),this.update((new a.default).retain(e).retain(t,(0,p.default)(o)))}},{key:"formatText",value:function(e,t){var n=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Object.keys(o).forEach(function(r){n.scroll.formatAt(e,t,r,o[r])}),this.update((new a.default).retain(e).retain(t,(0,p.default)(o)))}},{key:"getContents",value:function(e,t){return this.delta.slice(e,e+t)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(e,t){return e.concat(t.delta())},new a.default)}},{key:"getFormat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[],o=[];0===t?this.scroll.path(e).forEach(function(e){var t=r(e,1)[0];t instanceof f.default?n.push(t):t instanceof l.default.Leaf&&o.push(t)}):(n=this.scroll.lines(e,t),o=this.scroll.descendants(l.default.Leaf,e,t));var i=[n,o].map(function(e){if(0===e.length)return{};for(var t=(0,d.bubbleFormats)(e.shift());Object.keys(t).length>0;){var n=e.shift();if(null==n)return t;t=x((0,d.bubbleFormats)(n),t)}return t});return y.default.apply(y.default,i)}},{key:"getText",value:function(e,t){return this.getContents(e,t).filter(function(e){return"string"==typeof e.insert}).map(function(e){return e.insert}).join("")}},{key:"insertEmbed",value:function(e,t,n){return this.scroll.insertAt(e,t,n),this.update((new a.default).retain(e).insert(function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},t,n)))}},{key:"insertText",value:function(e,t){var n=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t=t.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),this.scroll.insertAt(e,t),Object.keys(o).forEach(function(r){n.scroll.formatAt(e,t.length,r,o[r])}),this.update((new a.default).retain(e).insert(t,(0,p.default)(o)))}},{key:"isBlank",value:function(){if(0==this.scroll.children.length)return!0;if(this.scroll.children.length>1)return!1;var e=this.scroll.children.head;return e.statics.blotName===f.default.blotName&&!(e.children.length>1)&&e.children.head instanceof h.default}},{key:"removeFormat",value:function(e,t){var n=this.getText(e,t),o=this.scroll.line(e+t),i=r(o,2),s=i[0],l=i[1],u=0,d=new a.default;null!=s&&(u=s instanceof c.default?s.newlineIndex(l)-l+1:s.length()-l,d=s.delta().slice(l,l+u-1).insert("\n"));var f=this.getContents(e,t+u).diff((new a.default).insert(n).concat(d)),h=(new a.default).retain(e).concat(f);return this.applyDelta(h)}},{key:"update",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,o=this.delta;if(1===t.length&&"characterData"===t[0].type&&t[0].target.data.match(v)&&l.default.find(t[0].target)){var r=l.default.find(t[0].target),i=(0,d.bubbleFormats)(r),s=r.offset(this.scroll),c=t[0].oldValue.replace(u.default.CONTENTS,""),f=(new a.default).insert(c),h=(new a.default).insert(r.value());e=(new a.default).retain(s).concat(f.diff(h,n)).reduce(function(e,t){return t.insert?e.insert(t.insert,i):e.push(t)},new a.default),this.delta=o.compose(e)}else this.delta=this.getDelta(),e&&(0,g.default)(o.compose(e),this.delta)||(e=o.diff(this.delta,n));return e}}]),e}();function x(e,t){return Object.keys(t).reduce(function(n,o){return null==e[o]||(t[o]===e[o]?n[o]=t[o]:Array.isArray(t[o])?t[o].indexOf(e[o])<0&&(n[o]=t[o].concat([e[o]])):n[o]=[t[o],e[o]]),n},{})}t.default=b},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Range=void 0;var o=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],_n=!0,o=!1,r=void 0;try{for(var i,a=e[Symbol.iterator]();!(_n=(i=a.next()).done)&&(n.push(i.value),!t||n.length!==t);_n=!0);}catch(e){o=!0,r=e}finally{try{!_n&&a.return&&a.return()}finally{if(o)throw r}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=c(n(0)),a=c(n(21)),s=c(n(11)),l=c(n(8));function c(e){return e&&e.__esModule?e:{default:e}}function u(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var f=(0,c(n(10)).default)("quill:selection"),h=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;d(this,e),this.index=t,this.length=n},p=function(){function e(t,n){var o=this;d(this,e),this.emitter=n,this.scroll=t,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=i.default.create("cursor",this),this.lastRange=this.savedRange=new h(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){o.mouseDown||setTimeout(o.update.bind(o,l.default.sources.USER),1)}),this.emitter.on(l.default.events.EDITOR_CHANGE,function(e,t){e===l.default.events.TEXT_CHANGE&&t.length()>0&&o.update(l.default.sources.SILENT)}),this.emitter.on(l.default.events.SCROLL_BEFORE_UPDATE,function(){if(o.hasFocus()){var e=o.getNativeRange();null!=e&&e.start.node!==o.cursor.textNode&&o.emitter.once(l.default.events.SCROLL_UPDATE,function(){try{o.setNativeRange(e.start.node,e.start.offset,e.end.node,e.end.offset)}catch(e){}})}}),this.emitter.on(l.default.events.SCROLL_OPTIMIZE,function(e,t){if(t.range){var n=t.range,r=n.startNode,i=n.startOffset,a=n.endNode,s=n.endOffset;o.setNativeRange(r,i,a,s)}}),this.update(l.default.sources.SILENT)}return r(e,[{key:"handleComposition",value:function(){var e=this;this.root.addEventListener("compositionstart",function(){e.composing=!0}),this.root.addEventListener("compositionend",function(){if(e.composing=!1,e.cursor.parent){var t=e.cursor.restore();if(!t)return;setTimeout(function(){e.setNativeRange(t.startNode,t.startOffset,t.endNode,t.endOffset)},1)}})}},{key:"handleDragging",value:function(){var e=this;this.emitter.listenDOM("mousedown",document.body,function(){e.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){e.mouseDown=!1,e.update(l.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(e,t){if(null==this.scroll.whitelist||this.scroll.whitelist[e]){this.scroll.update();var n=this.getNativeRange();if(null!=n&&n.native.collapsed&&!i.default.query(e,i.default.Scope.BLOCK)){if(n.start.node!==this.cursor.textNode){var o=i.default.find(n.start.node,!1);if(null==o)return;if(o instanceof i.default.Leaf){var r=o.split(n.start.offset);o.parent.insertBefore(this.cursor,r)}else o.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()}}}},{key:"getBounds",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.scroll.length();e=Math.min(e,n-1),t=Math.min(e+t,n-1)-e;var r=void 0,i=this.scroll.leaf(e),a=o(i,2),s=a[0],l=a[1];if(null==s)return null;var c=s.position(l,!0),u=o(c,2);r=u[0],l=u[1];var d=document.createRange();if(t>0){d.setStart(r,l);var f=this.scroll.leaf(e+t),h=o(f,2);if(s=h[0],l=h[1],null==s)return null;var p=s.position(l,!0),g=o(p,2);return r=g[0],l=g[1],d.setEnd(r,l),d.getBoundingClientRect()}var y="left",m=void 0;return r instanceof Text?(l<r.data.length?(d.setStart(r,l),d.setEnd(r,l+1)):(d.setStart(r,l-1),d.setEnd(r,l),y="right"),m=d.getBoundingClientRect()):(m=s.domNode.getBoundingClientRect(),l>0&&(y="right")),{bottom:m.top+m.height,height:m.height,left:m[y],right:m[y],top:m.top,width:0}}},{key:"getNativeRange",value:function(){var e=document.getSelection();if(null==e||e.rangeCount<=0)return null;var t=e.getRangeAt(0);if(null==t)return null;var n=this.normalizeNative(t);return f.info("getNativeRange",n),n}},{key:"getRange",value:function(){var e=this.getNativeRange();return null==e?[null,null]:[this.normalizedToRange(e),e]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(e){var t=this,n=[[e.start.node,e.start.offset]];e.native.collapsed||n.push([e.end.node,e.end.offset]);var r=n.map(function(e){var n=o(e,2),r=n[0],a=n[1],s=i.default.find(r,!0),l=s.offset(t.scroll);return 0===a?l:s instanceof i.default.Container?l+s.length():l+s.index(r,a)}),a=Math.min(Math.max.apply(Math,u(r)),this.scroll.length()-1),s=Math.min.apply(Math,[a].concat(u(r)));return new h(s,a-s)}},{key:"normalizeNative",value:function(e){if(!g(this.root,e.startContainer)||!e.collapsed&&!g(this.root,e.endContainer))return null;var t={start:{node:e.startContainer,offset:e.startOffset},end:{node:e.endContainer,offset:e.endOffset},native:e};return[t.start,t.end].forEach(function(e){for(var t=e.node,n=e.offset;!(t instanceof Text)&&t.childNodes.length>0;)if(t.childNodes.length>n)t=t.childNodes[n],n=0;else{if(t.childNodes.length!==n)break;n=(t=t.lastChild)instanceof Text?t.data.length:t.childNodes.length+1}e.node=t,e.offset=n}),t}},{key:"rangeToNative",value:function(e){var t=this,n=e.collapsed?[e.index]:[e.index,e.index+e.length],r=[],i=this.scroll.length();return n.forEach(function(e,n){e=Math.min(i-1,e);var a,s=t.scroll.leaf(e),l=o(s,2),c=l[0],u=l[1],d=c.position(u,0!==n),f=o(d,2);a=f[0],u=f[1],r.push(a,u)}),r.length<2&&(r=r.concat(r)),r}},{key:"scrollIntoView",value:function(e){var t=this.lastRange;if(null!=t){var n=this.getBounds(t.index,t.length);if(null!=n){var r=this.scroll.length()-1,i=this.scroll.line(Math.min(t.index,r)),a=o(i,1)[0],s=a;if(t.length>0){var l=this.scroll.line(Math.min(t.index+t.length,r));s=o(l,1)[0]}if(null!=a&&null!=s){var c=e.getBoundingClientRect();n.top<c.top?e.scrollTop-=c.top-n.top:n.bottom>c.bottom&&(e.scrollTop+=n.bottom-c.bottom)}}}}},{key:"setNativeRange",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t,r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(f.info("setNativeRange",e,t,n,o),null==e||null!=this.root.parentNode&&null!=e.parentNode&&null!=n.parentNode){var i=document.getSelection();if(null!=i)if(null!=e){this.hasFocus()||this.root.focus();var a=(this.getNativeRange()||{}).native;if(null==a||r||e!==a.startContainer||t!==a.startOffset||n!==a.endContainer||o!==a.endOffset){"BR"==e.tagName&&(t=[].indexOf.call(e.parentNode.childNodes,e),e=e.parentNode),"BR"==n.tagName&&(o=[].indexOf.call(n.parentNode.childNodes,n),n=n.parentNode);var s=document.createRange();s.setStart(e,t),s.setEnd(n,o),i.removeAllRanges(),i.addRange(s)}}else i.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.default.sources.API;if("string"==typeof t&&(n=t,t=!1),f.info("setRange",e),null!=e){var o=this.rangeToNative(e);this.setNativeRange.apply(this,u(o).concat([t]))}else this.setNativeRange(null);this.update(n)}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l.default.sources.USER,t=this.lastRange,n=this.getRange(),r=o(n,2),i=r[0],c=r[1];if(this.lastRange=i,null!=this.lastRange&&(this.savedRange=this.lastRange),!(0,s.default)(t,this.lastRange)){var u;!this.composing&&null!=c&&c.native.collapsed&&c.start.node!==this.cursor.textNode&&this.cursor.restore();var d,f=[l.default.events.SELECTION_CHANGE,(0,a.default)(this.lastRange),(0,a.default)(t),e];(u=this.emitter).emit.apply(u,[l.default.events.EDITOR_CHANGE].concat(f)),e!==l.default.sources.SILENT&&(d=this.emitter).emit.apply(d,f)}}}]),e}();function g(e,t){try{t.parentNode}catch(e){return!1}return t instanceof Text&&(t=t.parentNode),e.contains(t)}t.Range=h,t.default=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(o):void 0},a=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"insertInto",value:function(e,n){0===e.children.length?i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insertInto",this).call(this,e,n):this.remove()}},{key:"length",value:function(){return 0}},{key:"value",value:function(){return""}}],[{key:"value",value:function(){}}]),t}(((o=n(0))&&o.__esModule?o:{default:o}).default.Embed);a.blotName="break",a.tagName="BR",t.default=a},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function __(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(44),a=n(30),s=n(1),l=function(e){function t(t){var n=e.call(this,t)||this;return n.build(),n}return r(t,e),t.prototype.appendChild=function(e){this.insertBefore(e)},t.prototype.attach=function(){e.prototype.attach.call(this),this.children.forEach(function(e){e.attach()})},t.prototype.build=function(){var e=this;this.children=new i.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(t){try{var n=c(t);e.insertBefore(n,e.children.head||void 0)}catch(e){if(e instanceof s.ParchmentError)return;throw e}})},t.prototype.deleteAt=function(e,t){if(0===e&&t===this.length())return this.remove();this.children.forEachAt(e,t,function(e,t,n){e.deleteAt(t,n)})},t.prototype.descendant=function(e,n){var o=this.children.find(n),r=o[0],i=o[1];return null==e.blotName&&e(r)||null!=e.blotName&&r instanceof e?[r,i]:r instanceof t?r.descendant(e,i):[null,-1]},t.prototype.descendants=function(e,n,o){void 0===n&&(n=0),void 0===o&&(o=Number.MAX_VALUE);var r=[],i=o;return this.children.forEachAt(n,o,function(n,o,a){(null==e.blotName&&e(n)||null!=e.blotName&&n instanceof e)&&r.push(n),n instanceof t&&(r=r.concat(n.descendants(e,o,i))),i-=a}),r},t.prototype.detach=function(){this.children.forEach(function(e){e.detach()}),e.prototype.detach.call(this)},t.prototype.formatAt=function(e,t,n,o){this.children.forEachAt(e,t,function(e,t,r){e.formatAt(t,r,n,o)})},t.prototype.insertAt=function(e,t,n){var o=this.children.find(e),r=o[0],i=o[1];if(r)r.insertAt(i,t,n);else{var a=null==n?s.create("text",t):s.create(t,n);this.appendChild(a)}},t.prototype.insertBefore=function(e,t){if(null!=this.statics.allowedChildren&&!this.statics.allowedChildren.some(function(t){return e instanceof t}))throw new s.ParchmentError("Cannot insert "+e.statics.blotName+" into "+this.statics.blotName);e.insertInto(this,t)},t.prototype.length=function(){return this.children.reduce(function(e,t){return e+t.length()},0)},t.prototype.moveChildren=function(e,t){this.children.forEach(function(n){e.insertBefore(n,t)})},t.prototype.optimize=function(t){if(e.prototype.optimize.call(this,t),0===this.children.length)if(null!=this.statics.defaultChild){var n=s.create(this.statics.defaultChild);this.appendChild(n),n.optimize(t)}else this.remove()},t.prototype.path=function(e,n){void 0===n&&(n=!1);var o=this.children.find(e,n),r=o[0],i=o[1],a=[[this,e]];return r instanceof t?a.concat(r.path(i,n)):(null!=r&&a.push([r,i]),a)},t.prototype.removeChild=function(e){this.children.remove(e)},t.prototype.replace=function(n){n instanceof t&&n.moveChildren(this),e.prototype.replace.call(this,n)},t.prototype.split=function(e,t){if(void 0===t&&(t=!1),!t){if(0===e)return this;if(e===this.length())return this.next}var n=this.clone();return this.parent.insertBefore(n,this.next),this.children.forEachAt(e,this.length(),function(e,o,r){e=e.split(o,t),n.appendChild(e)}),n},t.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},t.prototype.update=function(e,t){var n=this,o=[],r=[];e.forEach(function(e){e.target===n.domNode&&"childList"===e.type&&(o.push.apply(o,e.addedNodes),r.push.apply(r,e.removedNodes))}),r.forEach(function(e){if(!(null!=e.parentNode&&"IFRAME"!==e.tagName&&document.body.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var t=s.find(e);null!=t&&(null!=t.domNode.parentNode&&t.domNode.parentNode!==n.domNode||t.detach())}}),o.filter(function(e){return e.parentNode==n.domNode}).sort(function(e,t){return e===t?0:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1}).forEach(function(e){var t=null;null!=e.nextSibling&&(t=s.find(e.nextSibling));var o=c(e);o.next==t&&null!=o.next||(null!=o.parent&&o.parent.removeChild(n),n.insertBefore(o,t||void 0))})},t}(a.default);function c(e){var t=s.find(e);if(null==t)try{t=s.create(e)}catch(n){t=s.create(s.Scope.INLINE),[].slice.call(e.childNodes).forEach(function(e){t.domNode.appendChild(e)}),e.parentNode&&e.parentNode.replaceChild(t.domNode,e),t.attach()}return t}t.default=l},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function __(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(12),a=n(31),s=n(17),l=n(1),c=function(e){function t(t){var n=e.call(this,t)||this;return n.attributes=new a.default(n.domNode),n}return r(t,e),t.formats=function(e){return"string"==typeof this.tagName||(Array.isArray(this.tagName)?e.tagName.toLowerCase():void 0)},t.prototype.format=function(e,t){var n=l.query(e);n instanceof i.default?this.attributes.attribute(n,t):t&&(null==n||e===this.statics.blotName&&this.formats()[e]===t||this.replaceWith(e,t))},t.prototype.formats=function(){var e=this.attributes.values(),t=this.statics.formats(this.domNode);return null!=t&&(e[this.statics.blotName]=t),e},t.prototype.replaceWith=function(t,n){var o=e.prototype.replaceWith.call(this,t,n);return this.attributes.copy(o),o},t.prototype.update=function(t,n){var o=this;e.prototype.update.call(this,t,n),t.some(function(e){return e.target===o.domNode&&"attributes"===e.type})&&this.attributes.build()},t.prototype.wrap=function(n,o){var r=e.prototype.wrap.call(this,n,o);return r instanceof t&&r.statics.scope===this.statics.scope&&this.attributes.move(r),r},t}(s.default);t.default=c},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function __(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(30),a=n(1),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.value=function(e){return!0},t.prototype.index=function(e,t){return this.domNode===e||this.domNode.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(t,1):-1},t.prototype.position=function(e,t){var n=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return e>0&&(n+=1),[this.parent.domNode,n]},t.prototype.value=function(){var e;return(e={})[this.statics.blotName]=this.statics.value(this.domNode)||!0,e},t.scope=a.Scope.INLINE_BLOT,t}(i.default);t.default=s},function(e,t,n){var o=n(11),r=n(3),i={attributes:{compose:function(e,t,n){"object"!=typeof e&&(e={}),"object"!=typeof t&&(t={});var o=r(!0,{},t);for(var i in n||(o=Object.keys(o).reduce(function(e,t){return null!=o[t]&&(e[t]=o[t]),e},{})),e)void 0!==e[i]&&void 0===t[i]&&(o[i]=e[i]);return Object.keys(o).length>0?o:void 0},diff:function(e,t){"object"!=typeof e&&(e={}),"object"!=typeof t&&(t={});var n=Object.keys(e).concat(Object.keys(t)).reduce(function(n,r){return o(e[r],t[r])||(n[r]=void 0===t[r]?null:t[r]),n},{});return Object.keys(n).length>0?n:void 0},transform:function(e,t,n){if("object"!=typeof e)return t;if("object"==typeof t){if(!n)return t;var o=Object.keys(t).reduce(function(n,o){return void 0===e[o]&&(n[o]=t[o]),n},{});return Object.keys(o).length>0?o:void 0}}},iterator:function(e){return new a(e)},length:function(e){return"number"==typeof e.delete?e.delete:"number"==typeof e.retain?e.retain:"string"==typeof e.insert?e.insert.length:1}};function a(e){this.ops=e,this.index=0,this.offset=0}a.prototype.hasNext=function(){return this.peekLength()<1/0},a.prototype.next=function(e){e||(e=1/0);var t=this.ops[this.index];if(t){var n=this.offset,o=i.length(t);if(e>=o-n?(e=o-n,this.index+=1,this.offset=0):this.offset+=e,"number"==typeof t.delete)return{delete:e};var r={};return t.attributes&&(r.attributes=t.attributes),"number"==typeof t.retain?r.retain=e:"string"==typeof t.insert?r.insert=t.insert.substr(n,e):r.insert=t.insert,r}return{retain:1/0}},a.prototype.peek=function(){return this.ops[this.index]},a.prototype.peekLength=function(){return this.ops[this.index]?i.length(this.ops[this.index])-this.offset:1/0},a.prototype.peekType=function(){return this.ops[this.index]?"number"==typeof this.ops[this.index].delete?"delete":"number"==typeof this.ops[this.index].retain?"retain":"insert":"retain"},a.prototype.rest=function(){if(this.hasNext()){if(0===this.offset)return this.ops.slice(this.index);var e=this.offset,t=this.index,n=this.next(),o=this.ops.slice(this.index);return this.offset=e,this.index=t,[n].concat(o)}return[]},e.exports=i},function(e,t){var n=function(){"use strict";function e(e,t){return null!=t&&e instanceof t}var t,n,o;try{t=Map}catch(e){t=function(){}}try{n=Set}catch(e){n=function(){}}try{o=Promise}catch(e){o=function(){}}function r(i,s,l,c,u){"object"==typeof s&&(l=s.depth,c=s.prototype,u=s.includeNonEnumerable,s=s.circular);var d=[],f=[],h="undefined"!=typeof Buffer;return void 0===s&&(s=!0),void 0===l&&(l=1/0),function i(l,p){if(null===l)return null;if(0===p)return l;var g,y;if("object"!=typeof l)return l;if(e(l,t))g=new t;else if(e(l,n))g=new n;else if(e(l,o))g=new o(function(e,t){l.then(function(t){e(i(t,p-1))},function(e){t(i(e,p-1))})});else if(r.__isArray(l))g=[];else if(r.__isRegExp(l))g=new RegExp(l.source,a(l)),l.lastIndex&&(g.lastIndex=l.lastIndex);else if(r.__isDate(l))g=new Date(l.getTime());else{if(h&&Buffer.isBuffer(l))return g=Buffer.allocUnsafe?Buffer.allocUnsafe(l.length):new Buffer(l.length),l.copy(g),g;e(l,Error)?g=Object.create(l):void 0===c?(y=Object.getPrototypeOf(l),g=Object.create(y)):(g=Object.create(c),y=c)}if(s){var m=d.indexOf(l);if(-1!=m)return f[m];d.push(l),f.push(g)}for(var v in e(l,t)&&l.forEach(function(e,t){var n=i(t,p-1),o=i(e,p-1);g.set(n,o)}),e(l,n)&&l.forEach(function(e){var t=i(e,p-1);g.add(t)}),l){var b;y&&(b=Object.getOwnPropertyDescriptor(y,v)),b&&null==b.set||(g[v]=i(l[v],p-1))}if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(l);for(v=0;v<x.length;v++){var w=x[v];(!(E=Object.getOwnPropertyDescriptor(l,w))||E.enumerable||u)&&(g[w]=i(l[w],p-1),E.enumerable||Object.defineProperty(g,w,{enumerable:!1}))}}if(u){var _=Object.getOwnPropertyNames(l);for(v=0;v<_.length;v++){var E,k=_[v];(E=Object.getOwnPropertyDescriptor(l,k))&&E.enumerable||(g[k]=i(l[k],p-1),Object.defineProperty(g,k,{enumerable:!1}))}}return g}(i,l)}function i(e){return Object.prototype.toString.call(e)}function a(e){var t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),t}return r.clonePrototype=function(e){if(null===e)return null;var t=function(){};return t.prototype=e,new t},r.__objToStr=i,r.__isDate=function(e){return"object"==typeof e&&"[object Date]"===i(e)},r.__isArray=function(e){return"object"==typeof e&&"[object Array]"===i(e)},r.__isRegExp=function(e){return"object"==typeof e&&"[object RegExp]"===i(e)},r.__getRegExpFlags=a,r}();"object"==typeof e&&e.exports&&(e.exports=n)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],_n=!0,o=!1,r=void 0;try{for(var i,a=e[Symbol.iterator]();!(_n=(i=a.next()).done)&&(n.push(i.value),!t||n.length!==t);_n=!0);}catch(e){o=!0,r=e}finally{try{!_n&&a.return&&a.return()}finally{if(o)throw r}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(o):void 0},a=h(n(0)),s=h(n(8)),l=n(4),c=h(l),u=h(n(16)),d=h(n(13)),f=h(n(25));function h(e){return e&&e.__esModule?e:{default:e}}function p(e){return e instanceof c.default||e instanceof l.BlockEmbed}var g=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return o.emitter=n.emitter,Array.isArray(n.whitelist)&&(o.whitelist=n.whitelist.reduce(function(e,t){return e[t]=!0,e},{})),o.domNode.addEventListener("DOMNodeInserted",function(){}),o.optimize(),o.enable(),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"batchStart",value:function(){this.batch=!0}},{key:"batchEnd",value:function(){this.batch=!1,this.optimize()}},{key:"deleteAt",value:function(e,n){var r=this.line(e),a=o(r,2),s=a[0],c=a[1],f=this.line(e+n),h=o(f,1)[0];if(i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"deleteAt",this).call(this,e,n),null!=h&&s!==h&&c>0){if(s instanceof l.BlockEmbed||h instanceof l.BlockEmbed)return void this.optimize();if(s instanceof d.default){var p=s.newlineIndex(s.length(),!0);if(p>-1&&(s=s.split(p+1))===h)return void this.optimize()}else if(h instanceof d.default){var g=h.newlineIndex(0);g>-1&&h.split(g+1)}var y=h.children.head instanceof u.default?null:h.children.head;s.moveChildren(h,y),s.remove()}this.optimize()}},{key:"enable",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.domNode.setAttribute("contenteditable",e)}},{key:"formatAt",value:function(e,n,o,r){(null==this.whitelist||this.whitelist[o])&&(i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"formatAt",this).call(this,e,n,o,r),this.optimize())}},{key:"insertAt",value:function(e,n,o){if(null==o||null==this.whitelist||this.whitelist[n]){if(e>=this.length())if(null==o||null==a.default.query(n,a.default.Scope.BLOCK)){var r=a.default.create(this.statics.defaultChild);this.appendChild(r),null==o&&n.endsWith("\n")&&(n=n.slice(0,-1)),r.insertAt(0,n,o)}else{var s=a.default.create(n,o);this.appendChild(s)}else i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insertAt",this).call(this,e,n,o);this.optimize()}}},{key:"insertBefore",value:function(e,n){if(e.statics.scope===a.default.Scope.INLINE_BLOT){var o=a.default.create(this.statics.defaultChild);o.appendChild(e),e=o}i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insertBefore",this).call(this,e,n)}},{key:"leaf",value:function(e){return this.path(e).pop()||[null,-1]}},{key:"line",value:function(e){return e===this.length()?this.line(e-1):this.descendant(p,e)}},{key:"lines",value:function(){return function e(t,n,o){var r=[],i=o;return t.children.forEachAt(n,o,function(t,n,o){p(t)?r.push(t):t instanceof a.default.Container&&(r=r.concat(e(t,n,i))),i-=o}),r}(this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE)}},{key:"optimize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!0!==this.batch&&(i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"optimize",this).call(this,e,n),e.length>0&&this.emitter.emit(s.default.events.SCROLL_OPTIMIZE,e,n))}},{key:"path",value:function(e){return i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"path",this).call(this,e).slice(1)}},{key:"update",value:function(e){if(!0!==this.batch){var n=s.default.sources.USER;"string"==typeof e&&(n=e),Array.isArray(e)||(e=this.observer.takeRecords()),e.length>0&&this.emitter.emit(s.default.events.SCROLL_BEFORE_UPDATE,n,e),i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"update",this).call(this,e.concat([])),e.length>0&&this.emitter.emit(s.default.events.SCROLL_UPDATE,n,e)}}}]),t}(a.default.Scroll);g.blotName="scroll",g.className="ql-editor",g.tagName="DIV",g.defaultChild="block",g.allowedChildren=[c.default,l.BlockEmbed,f.default],t.default=g},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SHORTKEY=t.default=void 0;var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],_n=!0,o=!1,r=void 0;try{for(var i,a=e[Symbol.iterator]();!(_n=(i=a.next()).done)&&(n.push(i.value),!t||n.length!==t);_n=!0);}catch(e){o=!0,r=e}finally{try{!_n&&a.return&&a.return()}finally{if(o)throw r}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),a=g(n(21)),s=g(n(11)),l=g(n(3)),c=g(n(2)),u=g(n(20)),d=g(n(0)),f=g(n(5)),h=g(n(10)),p=g(n(9));function g(e){return e&&e.__esModule?e:{default:e}}function y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var m=(0,h.default)("quill:keyboard"),v=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",b=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return o.bindings={},Object.keys(o.options.bindings).forEach(function(t){("list autofill"!==t||null==e.scroll.whitelist||e.scroll.whitelist.list)&&o.options.bindings[t]&&o.addBinding(o.options.bindings[t])}),o.addBinding({key:t.keys.ENTER,shiftKey:null},k),o.addBinding({key:t.keys.ENTER,metaKey:null,ctrlKey:null,altKey:null},function(){}),/Firefox/i.test(navigator.userAgent)?(o.addBinding({key:t.keys.BACKSPACE},{collapsed:!0},w),o.addBinding({key:t.keys.DELETE},{collapsed:!0},_)):(o.addBinding({key:t.keys.BACKSPACE},{collapsed:!0,prefix:/^.?$/},w),o.addBinding({key:t.keys.DELETE},{collapsed:!0,suffix:/^.?$/},_)),o.addBinding({key:t.keys.BACKSPACE},{collapsed:!1},E),o.addBinding({key:t.keys.DELETE},{collapsed:!1},E),o.addBinding({key:t.keys.BACKSPACE,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},w),o.listen(),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,null,[{key:"match",value:function(e,t){return t=C(t),!["altKey","ctrlKey","metaKey","shiftKey"].some(function(n){return!!t[n]!==e[n]&&null!==t[n]})&&t.key===(e.which||e.keyCode)}}]),i(t,[{key:"addBinding",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=C(e);if(null==o||null==o.key)return m.warn("Attempted to add invalid keyboard binding",o);"function"==typeof t&&(t={handler:t}),"function"==typeof n&&(n={handler:n}),o=(0,l.default)(o,t,n),this.bindings[o.key]=this.bindings[o.key]||[],this.bindings[o.key].push(o)}},{key:"listen",value:function(){var e=this;this.quill.root.addEventListener("keydown",function(n){if(!n.defaultPrevented){var i=n.which||n.keyCode,a=(e.bindings[i]||[]).filter(function(e){return t.match(n,e)});if(0!==a.length){var l=e.quill.getSelection();if(null!=l&&e.quill.hasFocus()){var c=e.quill.getLine(l.index),u=r(c,2),f=u[0],h=u[1],p=e.quill.getLeaf(l.index),g=r(p,2),y=g[0],m=g[1],v=0===l.length?[y,m]:e.quill.getLeaf(l.index+l.length),b=r(v,2),x=b[0],w=b[1],_=y instanceof d.default.Text?y.value().slice(0,m):"",E=x instanceof d.default.Text?x.value().slice(w):"",k={collapsed:0===l.length,empty:0===l.length&&f.length()<=1,format:e.quill.getFormat(l),offset:h,prefix:_,suffix:E};a.some(function(t){if(null!=t.collapsed&&t.collapsed!==k.collapsed)return!1;if(null!=t.empty&&t.empty!==k.empty)return!1;if(null!=t.offset&&t.offset!==k.offset)return!1;if(Array.isArray(t.format)){if(t.format.every(function(e){return null==k.format[e]}))return!1}else if("object"===o(t.format)&&!Object.keys(t.format).every(function(e){return!0===t.format[e]?null!=k.format[e]:!1===t.format[e]?null==k.format[e]:(0,s.default)(t.format[e],k.format[e])}))return!1;return!(null!=t.prefix&&!t.prefix.test(k.prefix)||null!=t.suffix&&!t.suffix.test(k.suffix)||!0===t.handler.call(e,l,k))})&&n.preventDefault()}}}})}}]),t}(p.default);function x(e,t){var n,o=e===b.keys.LEFT?"prefix":"suffix";return y(n={key:e,shiftKey:t,altKey:null},o,/^$/),y(n,"handler",function(n){var o=n.index;e===b.keys.RIGHT&&(o+=n.length+1);var i=this.quill.getLeaf(o);return!(r(i,1)[0]instanceof d.default.Embed&&(e===b.keys.LEFT?t?this.quill.setSelection(n.index-1,n.length+1,f.default.sources.USER):this.quill.setSelection(n.index-1,f.default.sources.USER):t?this.quill.setSelection(n.index,n.length+1,f.default.sources.USER):this.quill.setSelection(n.index+n.length+1,f.default.sources.USER),1))}),n}function w(e,t){if(!(0===e.index||this.quill.getLength()<=1)){var n=this.quill.getLine(e.index),o=r(n,1)[0],i={};if(0===t.offset){var a=this.quill.getLine(e.index-1),s=r(a,1)[0];if(null!=s&&s.length()>1){var l=o.formats(),c=this.quill.getFormat(e.index-1,1);i=u.default.attributes.diff(l,c)||{}}}var d=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(t.prefix)?2:1;this.quill.deleteText(e.index-d,d,f.default.sources.USER),Object.keys(i).length>0&&this.quill.formatLine(e.index-d,d,i,f.default.sources.USER),this.quill.focus()}}function _(e,t){var n=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(t.suffix)?2:1;if(!(e.index>=this.quill.getLength()-n)){var o={},i=0,a=this.quill.getLine(e.index),s=r(a,1)[0];if(t.offset>=s.length()-1){var l=this.quill.getLine(e.index+1),c=r(l,1)[0];if(c){var d=s.formats(),h=this.quill.getFormat(e.index,1);o=u.default.attributes.diff(d,h)||{},i=c.length()}}this.quill.deleteText(e.index,n,f.default.sources.USER),Object.keys(o).length>0&&this.quill.formatLine(e.index+i-1,n,o,f.default.sources.USER)}}function E(e){var t=this.quill.getLines(e),n={};if(t.length>1){var o=t[0].formats(),r=t[t.length-1].formats();n=u.default.attributes.diff(r,o)||{}}this.quill.deleteText(e,f.default.sources.USER),Object.keys(n).length>0&&this.quill.formatLine(e.index,1,n,f.default.sources.USER),this.quill.setSelection(e.index,f.default.sources.SILENT),this.quill.focus()}function k(e,t){var n=this;e.length>0&&this.quill.scroll.deleteAt(e.index,e.length);var o=Object.keys(t.format).reduce(function(e,n){return d.default.query(n,d.default.Scope.BLOCK)&&!Array.isArray(t.format[n])&&(e[n]=t.format[n]),e},{});this.quill.insertText(e.index,"\n",o,f.default.sources.USER),this.quill.setSelection(e.index+1,f.default.sources.SILENT),this.quill.focus(),Object.keys(t.format).forEach(function(e){null==o[e]&&(Array.isArray(t.format[e])||"link"!==e&&n.quill.format(e,t.format[e],f.default.sources.USER))})}function O(e){return{key:b.keys.TAB,shiftKey:!e,format:{"code-block":!0},handler:function(t){var n=d.default.query("code-block"),o=t.index,i=t.length,a=this.quill.scroll.descendant(n,o),s=r(a,2),l=s[0],c=s[1];if(null!=l){var u=this.quill.getIndex(l),h=l.newlineIndex(c,!0)+1,p=l.newlineIndex(u+c+i),g=l.domNode.textContent.slice(h,p).split("\n");c=0,g.forEach(function(t,r){e?(l.insertAt(h+c,n.TAB),c+=n.TAB.length,0===r?o+=n.TAB.length:i+=n.TAB.length):t.startsWith(n.TAB)&&(l.deleteAt(h+c,n.TAB.length),c-=n.TAB.length,0===r?o-=n.TAB.length:i-=n.TAB.length),c+=t.length+1}),this.quill.update(f.default.sources.USER),this.quill.setSelection(o,i,f.default.sources.SILENT)}}}}function S(e){return{key:e[0].toUpperCase(),shortKey:!0,handler:function(t,n){this.quill.format(e,!n.format[e],f.default.sources.USER)}}}function C(e){if("string"==typeof e||"number"==typeof e)return C({key:e});if("object"===(void 0===e?"undefined":o(e))&&(e=(0,a.default)(e,!1)),"string"==typeof e.key)if(null!=b.keys[e.key.toUpperCase()])e.key=b.keys[e.key.toUpperCase()];else{if(1!==e.key.length)return null;e.key=e.key.toUpperCase().charCodeAt(0)}return e.shortKey&&(e[v]=e.shortKey,delete e.shortKey),e}b.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},b.DEFAULTS={bindings:{bold:S("bold"),italic:S("italic"),underline:S("underline"),indent:{key:b.keys.TAB,format:["blockquote","indent","list"],handler:function(e,t){if(t.collapsed&&0!==t.offset)return!0;this.quill.format("indent","+1",f.default.sources.USER)}},outdent:{key:b.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(e,t){if(t.collapsed&&0!==t.offset)return!0;this.quill.format("indent","-1",f.default.sources.USER)}},"outdent backspace":{key:b.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(e,t){null!=t.format.indent?this.quill.format("indent","-1",f.default.sources.USER):null!=t.format.list&&this.quill.format("list",!1,f.default.sources.USER)}},"indent code-block":O(!0),"outdent code-block":O(!1),"remove tab":{key:b.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(e){this.quill.deleteText(e.index-1,1,f.default.sources.USER)}},tab:{key:b.keys.TAB,handler:function(e){this.quill.history.cutoff();var t=(new c.default).retain(e.index).delete(e.length).insert("\t");this.quill.updateContents(t,f.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(e.index+1,f.default.sources.SILENT)}},"list empty enter":{key:b.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(e,t){this.quill.format("list",!1,f.default.sources.USER),t.format.indent&&this.quill.format("indent",!1,f.default.sources.USER)}},"checklist enter":{key:b.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(e){var t=this.quill.getLine(e.index),n=r(t,2),o=n[0],i=n[1],a=(0,l.default)({},o.formats(),{list:"checked"}),s=(new c.default).retain(e.index).insert("\n",a).retain(o.length()-i-1).retain(1,{list:"unchecked"});this.quill.updateContents(s,f.default.sources.USER),this.quill.setSelection(e.index+1,f.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:b.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(e,t){var n=this.quill.getLine(e.index),o=r(n,2),i=o[0],a=o[1],s=(new c.default).retain(e.index).insert("\n",t.format).retain(i.length()-a-1).retain(1,{header:null});this.quill.updateContents(s,f.default.sources.USER),this.quill.setSelection(e.index+1,f.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(e,t){var n=t.prefix.length,o=this.quill.getLine(e.index),i=r(o,2),a=i[0],s=i[1];if(s>n)return!0;var l=void 0;switch(t.prefix.trim()){case"[]":case"[ ]":l="unchecked";break;case"[x]":l="checked";break;case"-":case"*":l="bullet";break;default:l="ordered"}this.quill.insertText(e.index," ",f.default.sources.USER),this.quill.history.cutoff();var u=(new c.default).retain(e.index-s).delete(n+1).retain(a.length()-2-s).retain(1,{list:l});this.quill.updateContents(u,f.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(e.index-n,f.default.sources.SILENT)}},"code exit":{key:b.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(e){var t=this.quill.getLine(e.index),n=r(t,2),o=n[0],i=n[1],a=(new c.default).retain(e.index+o.length()-i-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(a,f.default.sources.USER)}},"embed left":x(b.keys.LEFT,!1),"embed left shift":x(b.keys.LEFT,!0),"embed right":x(b.keys.RIGHT,!1),"embed right shift":x(b.keys.RIGHT,!0)}},t.default=b,t.SHORTKEY=v},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(o):void 0},r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=s(n(0)),a=s(n(7));function s(e){return e&&e.__esModule?e:{default:e}}var l=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return o.selection=n,o.textNode=document.createTextNode(t.CONTENTS),o.domNode.appendChild(o.textNode),o._length=0,o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,null,[{key:"value",value:function(){}}]),r(t,[{key:"detach",value:function(){null!=this.parent&&this.parent.removeChild(this)}},{key:"format",value:function(e,n){if(0!==this._length)return o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"format",this).call(this,e,n);for(var r=this,a=0;null!=r&&r.statics.scope!==i.default.Scope.BLOCK_BLOT;)a+=r.offset(r.parent),r=r.parent;null!=r&&(this._length=t.CONTENTS.length,r.optimize(),r.formatAt(a,t.CONTENTS.length,e,n),this._length=0)}},{key:"index",value:function(e,n){return e===this.textNode?0:o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"index",this).call(this,e,n)}},{key:"length",value:function(){return this._length}},{key:"position",value:function(){return[this.textNode,this.textNode.data.length]}},{key:"remove",value:function(){o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"remove",this).call(this),this.parent=null}},{key:"restore",value:function(){if(!this.selection.composing&&null!=this.parent){var e=this.textNode,n=this.selection.getNativeRange(),o=void 0,r=void 0,s=void 0;if(null!=n&&n.start.node===e&&n.end.node===e){var l=[e,n.start.offset,n.end.offset];o=l[0],r=l[1],s=l[2]}for(;null!=this.domNode.lastChild&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);if(this.textNode.data!==t.CONTENTS){var c=this.textNode.data.split(t.CONTENTS).join("");this.next instanceof a.default?(o=this.next.domNode,this.next.insertAt(0,c),this.textNode.data=t.CONTENTS):(this.textNode.data=c,this.parent.insertBefore(i.default.create(this.textNode),this),this.textNode=document.createTextNode(t.CONTENTS),this.domNode.appendChild(this.textNode))}if(this.remove(),null!=r){var u=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],_n=!0,o=!1,r=void 0;try{for(var i,a=e[Symbol.iterator]();!(_n=(i=a.next()).done)&&(n.push(i.value),!t||n.length!==t);_n=!0);}catch(e){o=!0,r=e}finally{try{!_n&&a.return&&a.return()}finally{if(o)throw r}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}([r,s].map(function(e){return Math.max(0,Math.min(o.data.length,e-1))}),2);return r=u[0],s=u[1],{startNode:o,startOffset:r,endNode:o,endOffset:s}}}}},{key:"update",value:function(e,t){var n=this;if(e.some(function(e){return"characterData"===e.type&&e.target===n.textNode})){var o=this.restore();o&&(t.range=o)}}},{key:"value",value:function(){return""}}]),t}(i.default.Embed);l.blotName="cursor",l.className="ql-cursor",l.tagName="span",l.CONTENTS="\ufeff",t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=a(n(0)),r=n(4),i=a(r);function a(e){return e&&e.__esModule?e:{default:e}}var s=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(o.default.Container);s.allowedChildren=[i.default,r.BlockEmbed,s],t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ColorStyle=t.ColorClass=t.ColorAttributor=void 0;var o,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(o):void 0},a=(o=n(0))&&o.__esModule?o:{default:o},s=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"value",value:function(e){var n=i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"value",this).call(this,e);return n.startsWith("rgb(")?"#"+(n=n.replace(/^[^\d]+/,"").replace(/[^\d]+$/,"")).split(",").map(function(e){return("00"+parseInt(e).toString(16)).slice(-2)}).join(""):n}}]),t}(a.default.Attributor.Style),l=new a.default.Attributor.Class("color","ql-color",{scope:a.default.Scope.INLINE}),c=new s("color","color",{scope:a.default.Scope.INLINE});t.ColorAttributor=s,t.ColorClass=l,t.ColorStyle=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sanitize=t.default=void 0;var o,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(o):void 0},a=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"format",value:function(e,n){if(e!==this.statics.blotName||!n)return i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"format",this).call(this,e,n);n=this.constructor.sanitize(n),this.domNode.setAttribute("href",n)}}],[{key:"create",value:function(e){var n=i(t.__proto__||Object.getPrototypeOf(t),"create",this).call(this,e);return e=this.sanitize(e),n.setAttribute("href",e),n.setAttribute("rel","noopener noreferrer"),n.setAttribute("target","_blank"),n}},{key:"formats",value:function(e){return e.getAttribute("href")}},{key:"sanitize",value:function(e){return s(e,this.PROTOCOL_WHITELIST)?e:this.SANITIZED_URL}}]),t}(((o=n(6))&&o.__esModule?o:{default:o}).default);function s(e,t){var n=document.createElement("a");n.href=e;var o=n.href.slice(0,n.href.indexOf(":"));return t.indexOf(o)>-1}a.blotName="link",a.tagName="A",a.SANITIZED_URL="about:blank",a.PROTOCOL_WHITELIST=["http","https","mailto","tel"],t.default=a,t.sanitize=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=s(n(23)),a=s(n(107));function s(e){return e&&e.__esModule?e:{default:e}}var l=0;function c(e,t){e.setAttribute(t,!("true"===e.getAttribute(t)))}var u=function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.select=t,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",function(){n.togglePicker()}),this.label.addEventListener("keydown",function(e){switch(e.keyCode){case i.default.keys.ENTER:n.togglePicker();break;case i.default.keys.ESCAPE:n.escape(),e.preventDefault()}}),this.select.addEventListener("change",this.update.bind(this))}return r(e,[{key:"togglePicker",value:function(){this.container.classList.toggle("ql-expanded"),c(this.label,"aria-expanded"),c(this.options,"aria-hidden")}},{key:"buildItem",value:function(e){var t=this,n=document.createElement("span");return n.tabIndex="0",n.setAttribute("role","button"),n.classList.add("ql-picker-item"),e.hasAttribute("value")&&n.setAttribute("data-value",e.getAttribute("value")),e.textContent&&n.setAttribute("data-label",e.textContent),n.addEventListener("click",function(){t.selectItem(n,!0)}),n.addEventListener("keydown",function(e){switch(e.keyCode){case i.default.keys.ENTER:t.selectItem(n,!0),e.preventDefault();break;case i.default.keys.ESCAPE:t.escape(),e.preventDefault()}}),n}},{key:"buildLabel",value:function(){var e=document.createElement("span");return e.classList.add("ql-picker-label"),e.innerHTML=a.default,e.tabIndex="0",e.setAttribute("role","button"),e.setAttribute("aria-expanded","false"),this.container.appendChild(e),e}},{key:"buildOptions",value:function(){var e=this,t=document.createElement("span");t.classList.add("ql-picker-options"),t.setAttribute("aria-hidden","true"),t.tabIndex="-1",t.id="ql-picker-options-"+l,l+=1,this.label.setAttribute("aria-controls",t.id),this.options=t,[].slice.call(this.select.options).forEach(function(n){var o=e.buildItem(n);t.appendChild(o),!0===n.selected&&e.selectItem(o)}),this.container.appendChild(t)}},{key:"buildPicker",value:function(){var e=this;[].slice.call(this.select.attributes).forEach(function(t){e.container.setAttribute(t.name,t.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}},{key:"escape",value:function(){var e=this;this.close(),setTimeout(function(){return e.label.focus()},1)}},{key:"close",value:function(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}},{key:"selectItem",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.container.querySelector(".ql-selected");if(e!==n&&(null!=n&&n.classList.remove("ql-selected"),null!=e&&(e.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(e.parentNode.children,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))){if("function"==typeof Event)this.select.dispatchEvent(new Event("change"));else if("object"===("undefined"==typeof Event?"undefined":o(Event))){var r=document.createEvent("Event");r.initEvent("change",!0,!0),this.select.dispatchEvent(r)}this.close()}}},{key:"update",value:function(){var e=void 0;if(this.select.selectedIndex>-1){var t=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];e=this.select.options[this.select.selectedIndex],this.selectItem(t)}else this.selectItem(null);var n=null!=e&&e!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",n)}}]),e}();t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=m(n(0)),r=m(n(5)),i=n(4),a=m(i),s=m(n(16)),l=m(n(25)),c=m(n(24)),u=m(n(35)),d=m(n(6)),f=m(n(22)),h=m(n(7)),p=m(n(55)),g=m(n(42)),y=m(n(23));function m(e){return e&&e.__esModule?e:{default:e}}r.default.register({"blots/block":a.default,"blots/block/embed":i.BlockEmbed,"blots/break":s.default,"blots/container":l.default,"blots/cursor":c.default,"blots/embed":u.default,"blots/inline":d.default,"blots/scroll":f.default,"blots/text":h.default,"modules/clipboard":p.default,"modules/history":g.default,"modules/keyboard":y.default}),o.default.register(a.default,s.default,c.default,d.default,f.default,h.default),t.default=r.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),r=function(){function e(e){this.domNode=e,this.domNode[o.DATA_KEY]={blot:this}}return Object.defineProperty(e.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),e.create=function(e){if(null==this.tagName)throw new o.ParchmentError("Blot definition missing tagName");var t;return Array.isArray(this.tagName)?("string"==typeof e&&(e=e.toUpperCase(),parseInt(e).toString()===e&&(e=parseInt(e))),t="number"==typeof e?document.createElement(this.tagName[e-1]):this.tagName.indexOf(e)>-1?document.createElement(e):document.createElement(this.tagName[0])):t=document.createElement(this.tagName),this.className&&t.classList.add(this.className),t},e.prototype.attach=function(){null!=this.parent&&(this.scroll=this.parent.scroll)},e.prototype.clone=function(){var e=this.domNode.cloneNode(!1);return o.create(e)},e.prototype.detach=function(){null!=this.parent&&this.parent.removeChild(this),delete this.domNode[o.DATA_KEY]},e.prototype.deleteAt=function(e,t){this.isolate(e,t).remove()},e.prototype.formatAt=function(e,t,n,r){var i=this.isolate(e,t);if(null!=o.query(n,o.Scope.BLOT)&&r)i.wrap(n,r);else if(null!=o.query(n,o.Scope.ATTRIBUTE)){var a=o.create(this.statics.scope);i.wrap(a),a.format(n,r)}},e.prototype.insertAt=function(e,t,n){var r=null==n?o.create("text",t):o.create(t,n),i=this.split(e);this.parent.insertBefore(r,i)},e.prototype.insertInto=function(e,t){void 0===t&&(t=null),null!=this.parent&&this.parent.children.remove(this);var n=null;e.children.insertBefore(this,t),null!=t&&(n=t.domNode),this.domNode.parentNode==e.domNode&&this.domNode.nextSibling==n||e.domNode.insertBefore(this.domNode,n),this.parent=e,this.attach()},e.prototype.isolate=function(e,t){var n=this.split(e);return n.split(t),n},e.prototype.length=function(){return 1},e.prototype.offset=function(e){return void 0===e&&(e=this.parent),null==this.parent||this==e?0:this.parent.children.offset(this)+this.parent.offset(e)},e.prototype.optimize=function(e){null!=this.domNode[o.DATA_KEY]&&delete this.domNode[o.DATA_KEY].mutations},e.prototype.remove=function(){null!=this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},e.prototype.replace=function(e){null!=e.parent&&(e.parent.insertBefore(this,e.next),e.remove())},e.prototype.replaceWith=function(e,t){var n="string"==typeof e?o.create(e,t):e;return n.replace(this),n},e.prototype.split=function(e,t){return 0===e?this:this.next},e.prototype.update=function(e,t){},e.prototype.wrap=function(e,t){var n="string"==typeof e?o.create(e,t):e;return null!=this.parent&&this.parent.insertBefore(n,this.next),n.appendChild(this),n},e.blotName="abstract",e}();t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(12),r=n(32),i=n(33),a=n(1),s=function(){function e(e){this.attributes={},this.domNode=e,this.build()}return e.prototype.attribute=function(e,t){t?e.add(this.domNode,t)&&(null!=e.value(this.domNode)?this.attributes[e.attrName]=e:delete this.attributes[e.attrName]):(e.remove(this.domNode),delete this.attributes[e.attrName])},e.prototype.build=function(){var e=this;this.attributes={};var t=o.default.keys(this.domNode),n=r.default.keys(this.domNode),s=i.default.keys(this.domNode);t.concat(n).concat(s).forEach(function(t){var n=a.query(t,a.Scope.ATTRIBUTE);n instanceof o.default&&(e.attributes[n.attrName]=n)})},e.prototype.copy=function(e){var t=this;Object.keys(this.attributes).forEach(function(n){var o=t.attributes[n].value(t.domNode);e.format(n,o)})},e.prototype.move=function(e){var t=this;this.copy(e),Object.keys(this.attributes).forEach(function(e){t.attributes[e].remove(t.domNode)}),this.attributes={}},e.prototype.values=function(){var e=this;return Object.keys(this.attributes).reduce(function(t,n){return t[n]=e.attributes[n].value(e.domNode),t},{})},e}();t.default=s},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function __(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)});function i(e,t){return(e.getAttribute("class")||"").split(/\s+/).filter(function(e){return 0===e.indexOf(t+"-")})}Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.keys=function(e){return(e.getAttribute("class")||"").split(/\s+/).map(function(e){return e.split("-").slice(0,-1).join("-")})},t.prototype.add=function(e,t){return!!this.canAdd(e,t)&&(this.remove(e),e.classList.add(this.keyName+"-"+t),!0)},t.prototype.remove=function(e){i(e,this.keyName).forEach(function(t){e.classList.remove(t)}),0===e.classList.length&&e.removeAttribute("class")},t.prototype.value=function(e){var t=(i(e,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(e,t)?t:""},t}(n(12).default);t.default=a},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function __(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)});function i(e){var t=e.split("-"),n=t.slice(1).map(function(e){return e[0].toUpperCase()+e.slice(1)}).join("");return t[0]+n}Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.keys=function(e){return(e.getAttribute("style")||"").split(";").map(function(e){return e.split(":")[0].trim()})},t.prototype.add=function(e,t){return!!this.canAdd(e,t)&&(e.style[i(this.keyName)]=t,!0)},t.prototype.remove=function(e){e.style[i(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")},t.prototype.value=function(e){var t=e.style[i(this.keyName)];return this.canAdd(e,t)?t:""},t}(n(12).default);t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.quill=t,this.options=n,this.modules={}}return o(e,[{key:"init",value:function(){var e=this;Object.keys(this.options.modules).forEach(function(t){null==e.modules[t]&&e.addModule(t)})}},{key:"addModule",value:function(e){var t=this.quill.constructor.import("modules/"+e);return this.modules[e]=new t(this.quill,this.options.modules[e]||{}),this.modules[e]}}]),e}();r.DEFAULTS={modules:{}},r.themes={default:r},t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(o):void 0},i=s(n(0)),a=s(n(7));function s(e){return e&&e.__esModule?e:{default:e}}var l="\ufeff",c=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.contentNode=document.createElement("span"),n.contentNode.setAttribute("contenteditable",!1),[].slice.call(n.domNode.childNodes).forEach(function(e){n.contentNode.appendChild(e)}),n.leftGuard=document.createTextNode(l),n.rightGuard=document.createTextNode(l),n.domNode.appendChild(n.leftGuard),n.domNode.appendChild(n.contentNode),n.domNode.appendChild(n.rightGuard),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"index",value:function(e,n){return e===this.leftGuard?0:e===this.rightGuard?1:r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"index",this).call(this,e,n)}},{key:"restore",value:function(e){var t=void 0,n=void 0,o=e.data.split(l).join("");if(e===this.leftGuard)if(this.prev instanceof a.default){var r=this.prev.length();this.prev.insertAt(r,o),t={startNode:this.prev.domNode,startOffset:r+o.length}}else n=document.createTextNode(o),this.parent.insertBefore(i.default.create(n),this),t={startNode:n,startOffset:o.length};else e===this.rightGuard&&(this.next instanceof a.default?(this.next.insertAt(0,o),t={startNode:this.next.domNode,startOffset:o.length}):(n=document.createTextNode(o),this.parent.insertBefore(i.default.create(n),this.next),t={startNode:n,startOffset:o.length}));return e.data=l,t}},{key:"update",value:function(e,t){var n=this;e.forEach(function(e){if("characterData"===e.type&&(e.target===n.leftGuard||e.target===n.rightGuard)){var o=n.restore(e.target);o&&(t.range=o)}})}}]),t}(i.default.Embed);t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AlignStyle=t.AlignClass=t.AlignAttribute=void 0;var o,r=(o=n(0))&&o.__esModule?o:{default:o},i={scope:r.default.Scope.BLOCK,whitelist:["right","center","justify"]},a=new r.default.Attributor.Attribute("align","align",i),s=new r.default.Attributor.Class("align","ql-align",i),l=new r.default.Attributor.Style("align","text-align",i);t.AlignAttribute=a,t.AlignClass=s,t.AlignStyle=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BackgroundStyle=t.BackgroundClass=void 0;var o,r=(o=n(0))&&o.__esModule?o:{default:o},i=n(26),a=new r.default.Attributor.Class("background","ql-bg",{scope:r.default.Scope.INLINE}),s=new i.ColorAttributor("background","background-color",{scope:r.default.Scope.INLINE});t.BackgroundClass=a,t.BackgroundStyle=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DirectionStyle=t.DirectionClass=t.DirectionAttribute=void 0;var o,r=(o=n(0))&&o.__esModule?o:{default:o},i={scope:r.default.Scope.BLOCK,whitelist:["rtl"]},a=new r.default.Attributor.Attribute("direction","dir",i),s=new r.default.Attributor.Class("direction","ql-direction",i),l=new r.default.Attributor.Style("direction","direction",i);t.DirectionAttribute=a,t.DirectionClass=s,t.DirectionStyle=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FontClass=t.FontStyle=void 0;var o,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(o):void 0},a=(o=n(0))&&o.__esModule?o:{default:o},s={scope:a.default.Scope.INLINE,whitelist:["serif","monospace"]},l=new a.default.Attributor.Class("font","ql-font",s),c=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"value",value:function(e){return i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"value",this).call(this,e).replace(/["']/g,"")}}]),t}(a.default.Attributor.Style),u=new c("font","font-family",s);t.FontStyle=u,t.FontClass=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SizeStyle=t.SizeClass=void 0;var o,r=(o=n(0))&&o.__esModule?o:{default:o},i=new r.default.Attributor.Class("size","ql-size",{scope:r.default.Scope.INLINE,whitelist:["small","large","huge"]}),a=new r.default.Attributor.Style("size","font-size",{scope:r.default.Scope.INLINE,whitelist:["10px","18px","32px"]});t.SizeClass=i,t.SizeStyle=a},function(e,t,n){"use strict";e.exports={align:{"":n(76),center:n(77),right:n(78),justify:n(79)},background:n(80),blockquote:n(81),bold:n(82),clean:n(83),code:n(58),"code-block":n(58),color:n(84),direction:{"":n(85),rtl:n(86)},float:{center:n(87),full:n(88),left:n(89),right:n(90)},formula:n(91),header:{1:n(92),2:n(93)},italic:n(94),image:n(95),indent:{"+1":n(96),"-1":n(97)},link:n(98),list:{ordered:n(99),bullet:n(100),check:n(101)},script:{sub:n(102),super:n(103)},strike:n(104),underline:n(105),video:n(106)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getLastChangeIndex=t.default=void 0;var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=a(n(0)),i=a(n(5));function a(e){return e&&e.__esModule?e:{default:e}}var s=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return o.lastRecorded=0,o.ignoreChange=!1,o.clear(),o.quill.on(i.default.events.EDITOR_CHANGE,function(e,t,n,r){e!==i.default.events.TEXT_CHANGE||o.ignoreChange||(o.options.userOnly&&r!==i.default.sources.USER?o.transform(t):o.record(t,n))}),o.quill.keyboard.addBinding({key:"Z",shortKey:!0},o.undo.bind(o)),o.quill.keyboard.addBinding({key:"Z",shortKey:!0,shiftKey:!0},o.redo.bind(o)),/Win/i.test(navigator.platform)&&o.quill.keyboard.addBinding({key:"Y",shortKey:!0},o.redo.bind(o)),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"change",value:function(e,t){if(0!==this.stack[e].length){var n=this.stack[e].pop();this.stack[t].push(n),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(n[e],i.default.sources.USER),this.ignoreChange=!1;var o=l(n[e]);this.quill.setSelection(o)}}},{key:"clear",value:function(){this.stack={undo:[],redo:[]}}},{key:"cutoff",value:function(){this.lastRecorded=0}},{key:"record",value:function(e,t){if(0!==e.ops.length){this.stack.redo=[];var n=this.quill.getContents().diff(t),o=Date.now();if(this.lastRecorded+this.options.delay>o&&this.stack.undo.length>0){var r=this.stack.undo.pop();n=n.compose(r.undo),e=r.redo.compose(e)}else this.lastRecorded=o;this.stack.undo.push({redo:e,undo:n}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(e){this.stack.undo.forEach(function(t){t.undo=e.transform(t.undo,!0),t.redo=e.transform(t.redo,!0)}),this.stack.redo.forEach(function(t){t.undo=e.transform(t.undo,!0),t.redo=e.transform(t.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),t}(a(n(9)).default);function l(e){var t=e.reduce(function(e,t){return e+(t.delete||0)},0),n=e.length()-t;return function(e){var t=e.ops[e.ops.length-1];return null!=t&&(null!=t.insert?"string"==typeof t.insert&&t.insert.endsWith("\n"):null!=t.attributes&&Object.keys(t.attributes).some(function(e){return null!=r.default.query(e,r.default.Scope.BLOCK)}))}(e)&&(n-=1),n}s.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1},t.default=s,t.getLastChangeIndex=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.BaseTooltip=void 0;var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(o):void 0},i=p(n(3)),a=p(n(2)),s=p(n(8)),l=p(n(23)),c=p(n(34)),u=p(n(59)),d=p(n(60)),f=p(n(28)),h=p(n(61));function p(e){return e&&e.__esModule?e:{default:e}}function g(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function y(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function m(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var v=[!1,"center","right","justify"],b=["#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"],x=[!1,"serif","monospace"],w=["1","2","3",!1],_=["small",!1,"large","huge"],E=function(e){function t(e,n){g(this,t);var o=y(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return e.emitter.listenDOM("click",document.body,function t(n){if(!document.body.contains(e.root))return document.body.removeEventListener("click",t);null==o.tooltip||o.tooltip.root.contains(n.target)||document.activeElement===o.tooltip.textbox||o.quill.hasFocus()||o.tooltip.hide(),null!=o.pickers&&o.pickers.forEach(function(e){e.container.contains(n.target)||e.close()})}),o}return m(t,e),o(t,[{key:"addModule",value:function(e){var n=r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"addModule",this).call(this,e);return"toolbar"===e&&this.extendToolbar(n),n}},{key:"buildButtons",value:function(e,t){e.forEach(function(e){(e.getAttribute("class")||"").split(/\s+/).forEach(function(n){if(n.startsWith("ql-")&&(n=n.slice(3),null!=t[n]))if("direction"===n)e.innerHTML=t[n][""]+t[n].rtl;else if("string"==typeof t[n])e.innerHTML=t[n];else{var o=e.value||"";null!=o&&t[n][o]&&(e.innerHTML=t[n][o])}})})}},{key:"buildPickers",value:function(e,t){var n=this;this.pickers=e.map(function(e){if(e.classList.contains("ql-align"))return null==e.querySelector("option")&&O(e,v),new d.default(e,t.align);if(e.classList.contains("ql-background")||e.classList.contains("ql-color")){var n=e.classList.contains("ql-background")?"background":"color";return null==e.querySelector("option")&&O(e,b,"background"===n?"#ffffff":"#000000"),new u.default(e,t[n])}return null==e.querySelector("option")&&(e.classList.contains("ql-font")?O(e,x):e.classList.contains("ql-header")?O(e,w):e.classList.contains("ql-size")&&O(e,_)),new f.default(e)}),this.quill.on(s.default.events.EDITOR_CHANGE,function(){n.pickers.forEach(function(e){e.update()})})}}]),t}(c.default);E.DEFAULTS=(0,i.default)(!0,{},c.default.DEFAULTS,{modules:{toolbar:{handlers:{formula:function(){this.quill.theme.tooltip.edit("formula")},image:function(){var e=this,t=this.container.querySelector("input.ql-image[type=file]");null==t&&((t=document.createElement("input")).setAttribute("type","file"),t.setAttribute("accept","image/png, image/gif, image/jpeg, image/bmp, image/x-icon"),t.classList.add("ql-image"),t.addEventListener("change",function(){if(null!=t.files&&null!=t.files[0]){var n=new FileReader;n.onload=function(n){var o=e.quill.getSelection(!0);e.quill.updateContents((new a.default).retain(o.index).delete(o.length).insert({image:n.target.result}),s.default.sources.USER),e.quill.setSelection(o.index+1,s.default.sources.SILENT),t.value=""},n.readAsDataURL(t.files[0])}}),this.container.appendChild(t)),t.click()},video:function(){this.quill.theme.tooltip.edit("video")}}}}});var k=function(e){function t(e,n){g(this,t);var o=y(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return o.textbox=o.root.querySelector('input[type="text"]'),o.listen(),o}return m(t,e),o(t,[{key:"listen",value:function(){var e=this;this.textbox.addEventListener("keydown",function(t){l.default.match(t,"enter")?(e.save(),t.preventDefault()):l.default.match(t,"escape")&&(e.cancel(),t.preventDefault())})}},{key:"cancel",value:function(){this.hide()}},{key:"edit",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"link",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),null!=t?this.textbox.value=t:e!==this.root.getAttribute("data-mode")&&(this.textbox.value=""),this.position(this.quill.getBounds(this.quill.selection.savedRange)),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute("data-"+e)||""),this.root.setAttribute("data-mode",e)}},{key:"restoreFocus",value:function(){var e=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=e}},{key:"save",value:function(){var e,t,n=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":var o=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",n,s.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",n,s.default.sources.USER)),this.quill.root.scrollTop=o;break;case"video":n=(t=(e=n).match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||e.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/))?(t[1]||"https")+"://www.youtube.com/embed/"+t[2]+"?showinfo=0":(t=e.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(t[1]||"https")+"://player.vimeo.com/video/"+t[2]+"/":e;case"formula":if(!n)break;var r=this.quill.getSelection(!0);if(null!=r){var i=r.index+r.length;this.quill.insertEmbed(i,this.root.getAttribute("data-mode"),n,s.default.sources.USER),"formula"===this.root.getAttribute("data-mode")&&this.quill.insertText(i+1," ",s.default.sources.USER),this.quill.setSelection(i+2,s.default.sources.USER)}}this.textbox.value="",this.hide()}}]),t}(h.default);function O(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t.forEach(function(t){var o=document.createElement("option");t===n?o.setAttribute("selected","selected"):o.setAttribute("value",t),e.appendChild(o)})}t.BaseTooltip=k,t.default=E},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(){this.head=this.tail=null,this.length=0}return e.prototype.append=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.insertBefore(e[0],null),e.length>1&&this.append.apply(this,e.slice(1))},e.prototype.contains=function(e){for(var t,n=this.iterator();t=n();)if(t===e)return!0;return!1},e.prototype.insertBefore=function(e,t){e&&(e.next=t,null!=t?(e.prev=t.prev,null!=t.prev&&(t.prev.next=e),t.prev=e,t===this.head&&(this.head=e)):null!=this.tail?(this.tail.next=e,e.prev=this.tail,this.tail=e):(e.prev=null,this.head=this.tail=e),this.length+=1)},e.prototype.offset=function(e){for(var t=0,n=this.head;null!=n;){if(n===e)return t;t+=n.length(),n=n.next}return-1},e.prototype.remove=function(e){this.contains(e)&&(null!=e.prev&&(e.prev.next=e.next),null!=e.next&&(e.next.prev=e.prev),e===this.head&&(this.head=e.next),e===this.tail&&(this.tail=e.prev),this.length-=1)},e.prototype.iterator=function(e){return void 0===e&&(e=this.head),function(){var t=e;return null!=e&&(e=e.next),t}},e.prototype.find=function(e,t){void 0===t&&(t=!1);for(var n,o=this.iterator();n=o();){var r=n.length();if(e<r||t&&e===r&&(null==n.next||0!==n.next.length()))return[n,e];e-=r}return[null,0]},e.prototype.forEach=function(e){for(var t,n=this.iterator();t=n();)e(t)},e.prototype.forEachAt=function(e,t,n){if(!(t<=0))for(var o,r=this.find(e),i=r[0],a=e-r[1],s=this.iterator(i);(o=s())&&a<e+t;){var l=o.length();e>a?n(o,e-a,Math.min(t,a+l-e)):n(o,0,Math.min(l,e+t-a)),a+=l}},e.prototype.map=function(e){return this.reduce(function(t,n){return t.push(e(n)),t},[])},e.prototype.reduce=function(e,t){for(var n,o=this.iterator();n=o();)t=e(t,n);return t},e}();t.default=o},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function __(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(17),a=n(1),s={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},l=function(e){function t(t){var n=e.call(this,t)||this;return n.scroll=n,n.observer=new MutationObserver(function(e){n.update(e)}),n.observer.observe(n.domNode,s),n.attach(),n}return r(t,e),t.prototype.detach=function(){e.prototype.detach.call(this),this.observer.disconnect()},t.prototype.deleteAt=function(t,n){this.update(),0===t&&n===this.length()?this.children.forEach(function(e){e.remove()}):e.prototype.deleteAt.call(this,t,n)},t.prototype.formatAt=function(t,n,o,r){this.update(),e.prototype.formatAt.call(this,t,n,o,r)},t.prototype.insertAt=function(t,n,o){this.update(),e.prototype.insertAt.call(this,t,n,o)},t.prototype.optimize=function(t,n){var o=this;void 0===t&&(t=[]),void 0===n&&(n={}),e.prototype.optimize.call(this,n);for(var r=[].slice.call(this.observer.takeRecords());r.length>0;)t.push(r.pop());for(var s=function(e,t){void 0===t&&(t=!0),null!=e&&e!==o&&null!=e.domNode.parentNode&&(null==e.domNode[a.DATA_KEY].mutations&&(e.domNode[a.DATA_KEY].mutations=[]),t&&s(e.parent))},l=function(e){null!=e.domNode[a.DATA_KEY]&&null!=e.domNode[a.DATA_KEY].mutations&&(e instanceof i.default&&e.children.forEach(l),e.optimize(n))},c=t,u=0;c.length>0;u+=1){if(u>=100)throw new Error("[Parchment] Maximum optimize iterations reached");for(c.forEach(function(e){var t=a.find(e.target,!0);null!=t&&(t.domNode===e.target&&("childList"===e.type?(s(a.find(e.previousSibling,!1)),[].forEach.call(e.addedNodes,function(e){var t=a.find(e,!1);s(t,!1),t instanceof i.default&&t.children.forEach(function(e){s(e,!1)})})):"attributes"===e.type&&s(t.prev)),s(t))}),this.children.forEach(l),r=(c=[].slice.call(this.observer.takeRecords())).slice();r.length>0;)t.push(r.pop())}},t.prototype.update=function(t,n){var o=this;void 0===n&&(n={}),(t=t||this.observer.takeRecords()).map(function(e){var t=a.find(e.target,!0);return null==t?null:null==t.domNode[a.DATA_KEY].mutations?(t.domNode[a.DATA_KEY].mutations=[e],t):(t.domNode[a.DATA_KEY].mutations.push(e),null)}).forEach(function(e){null!=e&&e!==o&&null!=e.domNode[a.DATA_KEY]&&e.update(e.domNode[a.DATA_KEY].mutations||[],n)}),null!=this.domNode[a.DATA_KEY].mutations&&e.prototype.update.call(this,this.domNode[a.DATA_KEY].mutations,n),this.optimize(t,n)},t.blotName="scroll",t.defaultChild="block",t.scope=a.Scope.BLOCK_BLOT,t.tagName="DIV",t}(i.default);t.default=l},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function __(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(18),a=n(1),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.formats=function(n){if(n.tagName!==t.tagName)return e.formats.call(this,n)},t.prototype.format=function(n,o){var r=this;n!==this.statics.blotName||o?e.prototype.format.call(this,n,o):(this.children.forEach(function(e){e instanceof i.default||(e=e.wrap(t.blotName,!0)),r.attributes.copy(e)}),this.unwrap())},t.prototype.formatAt=function(t,n,o,r){null!=this.formats()[o]||a.query(o,a.Scope.ATTRIBUTE)?this.isolate(t,n).format(o,r):e.prototype.formatAt.call(this,t,n,o,r)},t.prototype.optimize=function(n){e.prototype.optimize.call(this,n);var o=this.formats();if(0===Object.keys(o).length)return this.unwrap();var r=this.next;r instanceof t&&r.prev===this&&function(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(e[n]!==t[n])return!1;return!0}(o,r.formats())&&(r.moveChildren(this),r.remove())},t.blotName="inline",t.scope=a.Scope.INLINE_BLOT,t.tagName="SPAN",t}(i.default);t.default=s},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function __(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(18),a=n(1),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.formats=function(n){var o=a.query(t.blotName).tagName;if(n.tagName!==o)return e.formats.call(this,n)},t.prototype.format=function(n,o){null!=a.query(n,a.Scope.BLOCK)&&(n!==this.statics.blotName||o?e.prototype.format.call(this,n,o):this.replaceWith(t.blotName))},t.prototype.formatAt=function(t,n,o,r){null!=a.query(o,a.Scope.BLOCK)?this.format(o,r):e.prototype.formatAt.call(this,t,n,o,r)},t.prototype.insertAt=function(t,n,o){if(null==o||null!=a.query(n,a.Scope.INLINE))e.prototype.insertAt.call(this,t,n,o);else{var r=this.split(t),i=a.create(n,o);r.parent.insertBefore(i,r)}},t.prototype.update=function(t,n){navigator.userAgent.match(/Trident/)?this.build():e.prototype.update.call(this,t,n)},t.blotName="block",t.scope=a.Scope.BLOCK_BLOT,t.tagName="P",t}(i.default);t.default=s},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function __(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)});Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.formats=function(e){},t.prototype.format=function(t,n){e.prototype.formatAt.call(this,0,this.length(),t,n)},t.prototype.formatAt=function(t,n,o,r){0===t&&n===this.length()?this.format(o,r):e.prototype.formatAt.call(this,t,n,o,r)},t.prototype.formats=function(){return this.statics.formats(this.domNode)},t}(n(19).default);t.default=i},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function __(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(19),a=n(1),s=function(e){function t(t){var n=e.call(this,t)||this;return n.text=n.statics.value(n.domNode),n}return r(t,e),t.create=function(e){return document.createTextNode(e)},t.value=function(e){var t=e.data;return t.normalize&&(t=t.normalize()),t},t.prototype.deleteAt=function(e,t){this.domNode.data=this.text=this.text.slice(0,e)+this.text.slice(e+t)},t.prototype.index=function(e,t){return this.domNode===e?t:-1},t.prototype.insertAt=function(t,n,o){null==o?(this.text=this.text.slice(0,t)+n+this.text.slice(t),this.domNode.data=this.text):e.prototype.insertAt.call(this,t,n,o)},t.prototype.length=function(){return this.text.length},t.prototype.optimize=function(n){e.prototype.optimize.call(this,n),this.text=this.statics.value(this.domNode),0===this.text.length?this.remove():this.next instanceof t&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},t.prototype.position=function(e,t){return void 0===t&&(t=!1),[this.domNode,e]},t.prototype.split=function(e,t){if(void 0===t&&(t=!1),!t){if(0===e)return this;if(e===this.length())return this.next}var n=a.create(this.domNode.splitText(e));return this.parent.insertBefore(n,this.next),this.text=this.statics.value(this.domNode),n},t.prototype.update=function(e,t){var n=this;e.some(function(e){return"characterData"===e.type&&e.target===n.domNode})&&(this.text=this.statics.value(this.domNode))},t.prototype.value=function(){return this.text},t.blotName="text",t.scope=a.Scope.INLINE_BLOT,t}(i.default);t.default=s},function(e,t,n){"use strict";var o=document.createElement("div");if(o.classList.toggle("test-class",!1),o.classList.contains("test-class")){var r=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(e,t){return arguments.length>1&&!this.contains(e)==!t?t:r.call(this,e)}}String.prototype.startsWith||(String.prototype.startsWith=function(e,t){return t=t||0,this.substr(t,e.length)===e}),String.prototype.endsWith||(String.prototype.endsWith=function(e,t){var n=this.toString();("number"!=typeof t||!isFinite(t)||Math.floor(t)!==t||t>n.length)&&(t=n.length),t-=e.length;var o=n.indexOf(e,t);return-1!==o&&o===t}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(e){if(null===this)throw new TypeError("Array.prototype.find called on null or undefined");if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var t,n=Object(this),o=n.length>>>0,r=arguments[1],i=0;i<o;i++)if(t=n[i],e.call(r,t,i,n))return t}}),document.addEventListener("DOMContentLoaded",function(){document.execCommand("enableObjectResizing",!1,!1),document.execCommand("autoUrlDetect",!1,!1)})},function(e,t){var n=-1;function o(e,t,l){if(e==t)return e?[[0,e]]:[];(l<0||e.length<l)&&(l=null);var u=i(e,t),d=e.substring(0,u);u=a(e=e.substring(u),t=t.substring(u));var f=e.substring(e.length-u),h=function(e,t){var s;if(!e)return[[1,t]];if(!t)return[[n,e]];var l=e.length>t.length?e:t,c=e.length>t.length?t:e,u=l.indexOf(c);if(-1!=u)return s=[[1,l.substring(0,u)],[0,c],[1,l.substring(u+c.length)]],e.length>t.length&&(s[0][0]=s[2][0]=n),s;if(1==c.length)return[[n,e],[1,t]];var d=function(e,t){var n=e.length>t.length?e:t,o=e.length>t.length?t:e;if(n.length<4||2*o.length<n.length)return null;function r(e,t,n){for(var o,r,s,l,c=e.substring(n,n+Math.floor(e.length/4)),u=-1,d="";-1!=(u=t.indexOf(c,u+1));){var f=i(e.substring(n),t.substring(u)),h=a(e.substring(0,n),t.substring(0,u));d.length<h+f&&(d=t.substring(u-h,u)+t.substring(u,u+f),o=e.substring(0,n-h),r=e.substring(n+f),s=t.substring(0,u-h),l=t.substring(u+f))}return 2*d.length>=e.length?[o,r,s,l,d]:null}var s,l,c,u,d,f=r(n,o,Math.ceil(n.length/4)),h=r(n,o,Math.ceil(n.length/2));return f||h?(s=h?f&&f[4].length>h[4].length?f:h:f,e.length>t.length?(l=s[0],c=s[1],u=s[2],d=s[3]):(u=s[0],d=s[1],l=s[2],c=s[3]),[l,c,u,d,s[4]]):null}(e,t);if(d){var f=d[0],h=d[1],p=d[2],g=d[3],y=d[4],m=o(f,p),v=o(h,g);return m.concat([[0,y]],v)}return function(e,t){for(var o=e.length,i=t.length,a=Math.ceil((o+i)/2),s=a,l=2*a,c=new Array(l),u=new Array(l),d=0;d<l;d++)c[d]=-1,u[d]=-1;c[s+1]=0,u[s+1]=0;for(var f=o-i,h=f%2!=0,p=0,g=0,y=0,m=0,v=0;v<a;v++){for(var b=-v+p;b<=v-g;b+=2){for(var x=s+b,w=(S=b==-v||b!=v&&c[x-1]<c[x+1]?c[x+1]:c[x-1]+1)-b;S<o&&w<i&&e.charAt(S)==t.charAt(w);)S++,w++;if(c[x]=S,S>o)g+=2;else if(w>i)p+=2;else if(h&&(k=s+f-b)>=0&&k<l&&-1!=u[k]&&S>=(E=o-u[k]))return r(e,t,S,w)}for(var _=-v+y;_<=v-m;_+=2){for(var E,k=s+_,O=(E=_==-v||_!=v&&u[k-1]<u[k+1]?u[k+1]:u[k-1]+1)-_;E<o&&O<i&&e.charAt(o-E-1)==t.charAt(i-O-1);)E++,O++;if(u[k]=E,E>o)m+=2;else if(O>i)y+=2;else if(!h){var S;if((x=s+f-_)>=0&&x<l&&-1!=c[x]&&(w=s+(S=c[x])-x,S>=(E=o-E)))return r(e,t,S,w)}}}return[[n,e],[1,t]]}(e,t)}(e=e.substring(0,e.length-u),t=t.substring(0,t.length-u));return d&&h.unshift([0,d]),f&&h.push([0,f]),s(h),null!=l&&(h=function(e,t){var o=function(e,t){if(0===t)return[0,e];for(var o=0,r=0;r<e.length;r++){var i=e[r];if(i[0]===n||0===i[0]){var a=o+i[1].length;if(t===a)return[r+1,e];if(t<a){e=e.slice();var s=t-o,l=[i[0],i[1].slice(0,s)],c=[i[0],i[1].slice(s)];return e.splice(r,1,l,c),[r+1,e]}o=a}}throw new Error("cursor_pos is out of bounds!")}(e,t),r=o[1],i=o[0],a=r[i],s=r[i+1];if(null==a)return e;if(0!==a[0])return e;if(null!=s&&a[1]+s[1]===s[1]+a[1])return r.splice(i,2,s,a),c(r,i,2);if(null!=s&&0===s[1].indexOf(a[1])){r.splice(i,2,[s[0],a[1]],[0,a[1]]);var l=s[1].slice(a[1].length);return l.length>0&&r.splice(i+2,0,[s[0],l]),c(r,i,3)}return e}(h,l)),function(e){for(var t=!1,o=function(e){return e.charCodeAt(0)>=56320&&e.charCodeAt(0)<=57343},r=function(e){return e.charCodeAt(e.length-1)>=55296&&e.charCodeAt(e.length-1)<=56319},i=2;i<e.length;i+=1)0===e[i-2][0]&&r(e[i-2][1])&&e[i-1][0]===n&&o(e[i-1][1])&&1===e[i][0]&&o(e[i][1])&&(t=!0,e[i-1][1]=e[i-2][1].slice(-1)+e[i-1][1],e[i][1]=e[i-2][1].slice(-1)+e[i][1],e[i-2][1]=e[i-2][1].slice(0,-1));if(!t)return e;var a=[];for(i=0;i<e.length;i+=1)e[i][1].length>0&&a.push(e[i]);return a}(h)}function r(e,t,n,r){var i=e.substring(0,n),a=t.substring(0,r),s=e.substring(n),l=t.substring(r),c=o(i,a),u=o(s,l);return c.concat(u)}function i(e,t){if(!e||!t||e.charAt(0)!=t.charAt(0))return 0;for(var n=0,o=Math.min(e.length,t.length),r=o,i=0;n<r;)e.substring(i,r)==t.substring(i,r)?i=n=r:o=r,r=Math.floor((o-n)/2+n);return r}function a(e,t){if(!e||!t||e.charAt(e.length-1)!=t.charAt(t.length-1))return 0;for(var n=0,o=Math.min(e.length,t.length),r=o,i=0;n<r;)e.substring(e.length-r,e.length-i)==t.substring(t.length-r,t.length-i)?i=n=r:o=r,r=Math.floor((o-n)/2+n);return r}function s(e){e.push([0,""]);for(var t,o=0,r=0,l=0,c="",u="";o<e.length;)switch(e[o][0]){case 1:l++,u+=e[o][1],o++;break;case n:r++,c+=e[o][1],o++;break;case 0:r+l>1?(0!==r&&0!==l&&(0!==(t=i(u,c))&&(o-r-l>0&&0==e[o-r-l-1][0]?e[o-r-l-1][1]+=u.substring(0,t):(e.splice(0,0,[0,u.substring(0,t)]),o++),u=u.substring(t),c=c.substring(t)),0!==(t=a(u,c))&&(e[o][1]=u.substring(u.length-t)+e[o][1],u=u.substring(0,u.length-t),c=c.substring(0,c.length-t))),0===r?e.splice(o-l,r+l,[1,u]):0===l?e.splice(o-r,r+l,[n,c]):e.splice(o-r-l,r+l,[n,c],[1,u]),o=o-r-l+(r?1:0)+(l?1:0)+1):0!==o&&0==e[o-1][0]?(e[o-1][1]+=e[o][1],e.splice(o,1)):o++,l=0,r=0,c="",u=""}""===e[e.length-1][1]&&e.pop();var d=!1;for(o=1;o<e.length-1;)0==e[o-1][0]&&0==e[o+1][0]&&(e[o][1].substring(e[o][1].length-e[o-1][1].length)==e[o-1][1]?(e[o][1]=e[o-1][1]+e[o][1].substring(0,e[o][1].length-e[o-1][1].length),e[o+1][1]=e[o-1][1]+e[o+1][1],e.splice(o-1,1),d=!0):e[o][1].substring(0,e[o+1][1].length)==e[o+1][1]&&(e[o-1][1]+=e[o+1][1],e[o][1]=e[o][1].substring(e[o+1][1].length)+e[o+1][1],e.splice(o+1,1),d=!0)),o++;d&&s(e)}var l=o;function c(e,t,n){for(var o=t+n-1;o>=0&&o>=t-1;o--)if(o+1<e.length){var r=e[o],i=e[o+1];r[0]===i[1]&&e.splice(o,2,[r[0],r[1]+i[1]])}return e}l.INSERT=1,l.DELETE=n,l.EQUAL=0,e.exports=l},function(e,t){function n(e){var t=[];for(var n in e)t.push(n);return t}(e.exports="function"==typeof Object.keys?Object.keys:n).shim=n},function(e,t){var n="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();function o(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function r(e){return e&&"object"==typeof e&&"number"==typeof e.length&&Object.prototype.hasOwnProperty.call(e,"callee")&&!Object.prototype.propertyIsEnumerable.call(e,"callee")||!1}(t=e.exports=n?o:r).supported=o,t.unsupported=r},function(e,t){"use strict";var n=Object.prototype.hasOwnProperty,o="~";function r(){}function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function a(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(o=!1)),a.prototype.eventNames=function(){var e,t,r=[];if(0===this._eventsCount)return r;for(t in e=this._events)n.call(e,t)&&r.push(o?t.slice(1):t);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},a.prototype.listeners=function(e,t){var n=o?o+e:e,r=this._events[n];if(t)return!!r;if(!r)return[];if(r.fn)return[r.fn];for(var i=0,a=r.length,s=new Array(a);i<a;i++)s[i]=r[i].fn;return s},a.prototype.emit=function(e,t,n,r,i,a){var s=o?o+e:e;if(!this._events[s])return!1;var l,c,u=this._events[s],d=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),d){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,n),!0;case 4:return u.fn.call(u.context,t,n,r),!0;case 5:return u.fn.call(u.context,t,n,r,i),!0;case 6:return u.fn.call(u.context,t,n,r,i,a),!0}for(c=1,l=new Array(d-1);c<d;c++)l[c-1]=arguments[c];u.fn.apply(u.context,l)}else{var f,h=u.length;for(c=0;c<h;c++)switch(u[c].once&&this.removeListener(e,u[c].fn,void 0,!0),d){case 1:u[c].fn.call(u[c].context);break;case 2:u[c].fn.call(u[c].context,t);break;case 3:u[c].fn.call(u[c].context,t,n);break;case 4:u[c].fn.call(u[c].context,t,n,r);break;default:if(!l)for(f=1,l=new Array(d-1);f<d;f++)l[f-1]=arguments[f];u[c].fn.apply(u[c].context,l)}}return!0},a.prototype.on=function(e,t,n){var r=new i(t,n||this),a=o?o+e:e;return this._events[a]?this._events[a].fn?this._events[a]=[this._events[a],r]:this._events[a].push(r):(this._events[a]=r,this._eventsCount++),this},a.prototype.once=function(e,t,n){var r=new i(t,n||this,!0),a=o?o+e:e;return this._events[a]?this._events[a].fn?this._events[a]=[this._events[a],r]:this._events[a].push(r):(this._events[a]=r,this._eventsCount++),this},a.prototype.removeListener=function(e,t,n,i){var a=o?o+e:e;if(!this._events[a])return this;if(!t)return 0===--this._eventsCount?this._events=new r:delete this._events[a],this;var s=this._events[a];if(s.fn)s.fn!==t||i&&!s.once||n&&s.context!==n||(0===--this._eventsCount?this._events=new r:delete this._events[a]);else{for(var l=0,c=[],u=s.length;l<u;l++)(s[l].fn!==t||i&&!s[l].once||n&&s[l].context!==n)&&c.push(s[l]);c.length?this._events[a]=1===c.length?c[0]:c:0===--this._eventsCount?this._events=new r:delete this._events[a]}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=o?o+e:e,this._events[t]&&(0===--this._eventsCount?this._events=new r:delete this._events[t])):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prototype.setMaxListeners=function(){return this},a.prefixed=o,a.EventEmitter=a,void 0!==e&&(e.exports=a)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.matchText=t.matchSpacing=t.matchNewline=t.matchBlot=t.matchAttributor=t.default=void 0;var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],_n=!0,o=!1,r=void 0;try{for(var i,a=e[Symbol.iterator]();!(_n=(i=a.next()).done)&&(n.push(i.value),!t||n.length!==t);_n=!0);}catch(e){o=!0,r=e}finally{try{!_n&&a.return&&a.return()}finally{if(o)throw r}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),a=b(n(3)),s=b(n(2)),l=b(n(0)),c=b(n(5)),u=b(n(10)),d=b(n(9)),f=n(36),h=n(37),p=b(n(13)),g=n(26),y=n(38),m=n(39),v=n(40);function b(e){return e&&e.__esModule?e:{default:e}}function x(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var w=(0,u.default)("quill:clipboard"),_="__ql-matcher",E=[[Node.TEXT_NODE,q],[Node.TEXT_NODE,I],["br",function(e,t){return j(t,"\n")||t.insert("\n"),t}],[Node.ELEMENT_NODE,I],[Node.ELEMENT_NODE,L],[Node.ELEMENT_NODE,R],[Node.ELEMENT_NODE,T],[Node.ELEMENT_NODE,function(e,t){var n={},o=e.style||{};return o.fontStyle&&"italic"===N(e).fontStyle&&(n.italic=!0),o.fontWeight&&(N(e).fontWeight.startsWith("bold")||parseInt(N(e).fontWeight)>=700)&&(n.bold=!0),Object.keys(n).length>0&&(t=C(t,n)),parseFloat(o.textIndent||0)>0&&(t=(new s.default).insert("\t").concat(t)),t}],["li",function(e,t){var n=l.default.query(e);if(null==n||"list-item"!==n.blotName||!j(t,"\n"))return t;for(var o=-1,r=e.parentNode;!r.classList.contains("ql-clipboard");)"list"===(l.default.query(r)||{}).blotName&&(o+=1),r=r.parentNode;return o<=0?t:t.compose((new s.default).retain(t.length()-1).retain(1,{indent:o}))}],["b",M.bind(M,"bold")],["i",M.bind(M,"italic")],["style",function(){return new s.default}]],k=[f.AlignAttribute,y.DirectionAttribute].reduce(function(e,t){return e[t.keyName]=t,e},{}),O=[f.AlignStyle,h.BackgroundStyle,g.ColorStyle,y.DirectionStyle,m.FontStyle,v.SizeStyle].reduce(function(e,t){return e[t.keyName]=t,e},{}),S=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return o.quill.root.addEventListener("paste",o.onPaste.bind(o)),o.container=o.quill.addContainer("ql-clipboard"),o.container.setAttribute("contenteditable",!0),o.container.setAttribute("tabindex",-1),o.matchers=[],E.concat(o.options.matchers).forEach(function(e){var t=r(e,2),i=t[0],a=t[1];(n.matchVisual||a!==R)&&o.addMatcher(i,a)}),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"addMatcher",value:function(e,t){this.matchers.push([e,t])}},{key:"convert",value:function(e){if("string"==typeof e)return this.container.innerHTML=e.replace(/\>\r?\n +\</g,"><"),this.convert();var t=this.quill.getFormat(this.quill.selection.savedRange.index);if(t[p.default.blotName]){var n=this.container.innerText;return this.container.innerHTML="",(new s.default).insert(n,x({},p.default.blotName,t[p.default.blotName]))}var o=this.prepareMatching(),i=r(o,2),a=i[0],l=i[1],c=P(this.container,a,l);return j(c,"\n")&&null==c.ops[c.ops.length-1].attributes&&(c=c.compose((new s.default).retain(c.length()-1).delete(1))),w.log("convert",this.container.innerHTML,c),this.container.innerHTML="",c}},{key:"dangerouslyPasteHTML",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:c.default.sources.API;if("string"==typeof e)this.quill.setContents(this.convert(e),t),this.quill.setSelection(0,c.default.sources.SILENT);else{var o=this.convert(t);this.quill.updateContents((new s.default).retain(e).concat(o),n),this.quill.setSelection(e+o.length(),c.default.sources.SILENT)}}},{key:"onPaste",value:function(e){var t=this;if(!e.defaultPrevented&&this.quill.isEnabled()){var n=this.quill.getSelection(),o=(new s.default).retain(n.index),r=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(c.default.sources.SILENT),setTimeout(function(){o=o.concat(t.convert()).delete(n.length),t.quill.updateContents(o,c.default.sources.USER),t.quill.setSelection(o.length()-n.length,c.default.sources.SILENT),t.quill.scrollingContainer.scrollTop=r,t.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var e=this,t=[],n=[];return this.matchers.forEach(function(o){var i=r(o,2),a=i[0],s=i[1];switch(a){case Node.TEXT_NODE:n.push(s);break;case Node.ELEMENT_NODE:t.push(s);break;default:[].forEach.call(e.container.querySelectorAll(a),function(e){e[_]=e[_]||[],e[_].push(s)})}}),[t,n]}}]),t}(d.default);function C(e,t,n){return"object"===(void 0===t?"undefined":o(t))?Object.keys(t).reduce(function(e,n){return C(e,n,t[n])},e):e.reduce(function(e,o){return o.attributes&&o.attributes[t]?e.push(o):e.insert(o.insert,(0,a.default)({},x({},t,n),o.attributes))},new s.default)}function N(e){if(e.nodeType!==Node.ELEMENT_NODE)return{};var t="__ql-computed-style";return e[t]||(e[t]=window.getComputedStyle(e))}function j(e,t){for(var n="",o=e.ops.length-1;o>=0&&n.length<t.length;--o){var r=e.ops[o];if("string"!=typeof r.insert)break;n=r.insert+n}return n.slice(-1*t.length)===t}function A(e){if(0===e.childNodes.length)return!1;var t=N(e);return["block","list-item"].indexOf(t.display)>-1}function P(e,t,n){return e.nodeType===e.TEXT_NODE?n.reduce(function(t,n){return n(e,t)},new s.default):e.nodeType===e.ELEMENT_NODE?[].reduce.call(e.childNodes||[],function(o,r){var i=P(r,t,n);return r.nodeType===e.ELEMENT_NODE&&(i=t.reduce(function(e,t){return t(r,e)},i),i=(r[_]||[]).reduce(function(e,t){return t(r,e)},i)),o.concat(i)},new s.default):new s.default}function M(e,t,n){return C(n,e,!0)}function T(e,t){var n=l.default.Attributor.Attribute.keys(e),o=l.default.Attributor.Class.keys(e),r=l.default.Attributor.Style.keys(e),i={};return n.concat(o).concat(r).forEach(function(t){var n=l.default.query(t,l.default.Scope.ATTRIBUTE);null!=n&&(i[n.attrName]=n.value(e),i[n.attrName])||(null==(n=k[t])||n.attrName!==t&&n.keyName!==t||(i[n.attrName]=n.value(e)||void 0),null==(n=O[t])||n.attrName!==t&&n.keyName!==t||(n=O[t],i[n.attrName]=n.value(e)||void 0))}),Object.keys(i).length>0&&(t=C(t,i)),t}function L(e,t){var n=l.default.query(e);if(null==n)return t;if(n.prototype instanceof l.default.Embed){var o={},r=n.value(e);null!=r&&(o[n.blotName]=r,t=(new s.default).insert(o,n.formats(e)))}else"function"==typeof n.formats&&(t=C(t,n.blotName,n.formats(e)));return t}function I(e,t){return j(t,"\n")||(A(e)||t.length()>0&&e.nextSibling&&A(e.nextSibling))&&t.insert("\n"),t}function R(e,t){if(A(e)&&null!=e.nextElementSibling&&!j(t,"\n\n")){var n=e.offsetHeight+parseFloat(N(e).marginTop)+parseFloat(N(e).marginBottom);e.nextElementSibling.offsetTop>e.offsetTop+1.5*n&&t.insert("\n")}return t}function q(e,t){var n=e.data;if("O:P"===e.parentNode.tagName)return t.insert(n.trim());if(0===n.trim().length&&e.parentNode.classList.contains("ql-clipboard"))return t;if(!N(e.parentNode).whiteSpace.startsWith("pre")){var o=function(e,t){return(t=t.replace(/[^\u00a0]/g,"")).length<1&&e?" ":t};n=(n=n.replace(/\r\n/g," ").replace(/\n/g," ")).replace(/\s\s+/g,o.bind(o,!0)),(null==e.previousSibling&&A(e.parentNode)||null!=e.previousSibling&&A(e.previousSibling))&&(n=n.replace(/^\s+/,o.bind(o,!1))),(null==e.nextSibling&&A(e.parentNode)||null!=e.nextSibling&&A(e.nextSibling))&&(n=n.replace(/\s+$/,o.bind(o,!1)))}return t.insert(n)}S.DEFAULTS={matchers:[],matchVisual:!0},t.default=S,t.matchAttributor=T,t.matchBlot=L,t.matchNewline=I,t.matchSpacing=R,t.matchText=q},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(o):void 0},a=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"optimize",value:function(e){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"optimize",this).call(this,e),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}],[{key:"create",value:function(){return i(t.__proto__||Object.getPrototypeOf(t),"create",this).call(this)}},{key:"formats",value:function(){return!0}}]),t}(((o=n(6))&&o.__esModule?o:{default:o}).default);a.blotName="bold",a.tagName=["STRONG","B"],t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addControls=t.default=void 0;var o=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],_n=!0,o=!1,r=void 0;try{for(var i,a=e[Symbol.iterator]();!(_n=(i=a.next()).done)&&(n.push(i.value),!t||n.length!==t);_n=!0);}catch(e){o=!0,r=e}finally{try{!_n&&a.return&&a.return()}finally{if(o)throw r}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=u(n(2)),a=u(n(0)),s=u(n(5)),l=u(n(10)),c=u(n(9));function u(e){return e&&e.__esModule?e:{default:e}}function d(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var f=(0,l.default)("quill:toolbar"),h=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r,i=d(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));if(Array.isArray(i.options.container)){var a=document.createElement("div");g(a,i.options.container),e.container.parentNode.insertBefore(a,e.container),i.container=a}else"string"==typeof i.options.container?i.container=document.querySelector(i.options.container):i.container=i.options.container;return i.container instanceof HTMLElement?(i.container.classList.add("ql-toolbar"),i.controls=[],i.handlers={},Object.keys(i.options.handlers).forEach(function(e){i.addHandler(e,i.options.handlers[e])}),[].forEach.call(i.container.querySelectorAll("button, select"),function(e){i.attach(e)}),i.quill.on(s.default.events.EDITOR_CHANGE,function(e,t){e===s.default.events.SELECTION_CHANGE&&i.update(t)}),i.quill.on(s.default.events.SCROLL_OPTIMIZE,function(){var e=i.quill.selection.getRange(),t=o(e,1)[0];i.update(t)}),i):(r=f.error("Container required for toolbar",i.options),d(i,r))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"addHandler",value:function(e,t){this.handlers[e]=t}},{key:"attach",value:function(e){var t=this,n=[].find.call(e.classList,function(e){return 0===e.indexOf("ql-")});if(n){if(n=n.slice(3),"BUTTON"===e.tagName&&e.setAttribute("type","button"),null==this.handlers[n]){if(null!=this.quill.scroll.whitelist&&null==this.quill.scroll.whitelist[n])return void f.warn("ignoring attaching to disabled format",n,e);if(null==a.default.query(n))return void f.warn("ignoring attaching to nonexistent format",n,e)}var r="SELECT"===e.tagName?"change":"click";e.addEventListener(r,function(r){var l=void 0;if("SELECT"===e.tagName){if(e.selectedIndex<0)return;var c=e.options[e.selectedIndex];l=!c.hasAttribute("selected")&&(c.value||!1)}else l=!e.classList.contains("ql-active")&&(e.value||!e.hasAttribute("value")),r.preventDefault();t.quill.focus();var u=t.quill.selection.getRange(),d=o(u,1)[0];if(null!=t.handlers[n])t.handlers[n].call(t,l);else if(a.default.query(n).prototype instanceof a.default.Embed){if(!(l=prompt("Enter "+n)))return;t.quill.updateContents((new i.default).retain(d.index).delete(d.length).insert(function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},n,l)),s.default.sources.USER)}else t.quill.format(n,l,s.default.sources.USER);t.update(d)}),this.controls.push([n,e])}}},{key:"update",value:function(e){var t=null==e?{}:this.quill.getFormat(e);this.controls.forEach(function(n){var r=o(n,2),i=r[0],a=r[1];if("SELECT"===a.tagName){var s=void 0;if(null==e)s=null;else if(null==t[i])s=a.querySelector("option[selected]");else if(!Array.isArray(t[i])){var l=t[i];"string"==typeof l&&(l=l.replace(/\"/g,'\\"')),s=a.querySelector('option[value="'+l+'"]')}null==s?(a.value="",a.selectedIndex=-1):s.selected=!0}else if(null==e)a.classList.remove("ql-active");else if(a.hasAttribute("value")){var c=t[i]===a.getAttribute("value")||null!=t[i]&&t[i].toString()===a.getAttribute("value")||null==t[i]&&!a.getAttribute("value");a.classList.toggle("ql-active",c)}else a.classList.toggle("ql-active",null!=t[i])})}}]),t}(c.default);function p(e,t,n){var o=document.createElement("button");o.setAttribute("type","button"),o.classList.add("ql-"+t),null!=n&&(o.value=n),e.appendChild(o)}function g(e,t){Array.isArray(t[0])||(t=[t]),t.forEach(function(t){var n=document.createElement("span");n.classList.add("ql-formats"),t.forEach(function(e){if("string"==typeof e)p(n,e);else{var t=Object.keys(e)[0],o=e[t];Array.isArray(o)?function(e,t,n){var o=document.createElement("select");o.classList.add("ql-"+t),n.forEach(function(e){var t=document.createElement("option");!1!==e?t.setAttribute("value",e):t.setAttribute("selected","selected"),o.appendChild(t)}),e.appendChild(o)}(n,t,o):p(n,t,o)}}),e.appendChild(n)})}h.DEFAULTS={},h.DEFAULTS={container:null,handlers:{clean:function(){var e=this,t=this.quill.getSelection();if(null!=t)if(0==t.length){var n=this.quill.getFormat();Object.keys(n).forEach(function(t){null!=a.default.query(t,a.default.Scope.INLINE)&&e.quill.format(t,!1)})}else this.quill.removeFormat(t,s.default.sources.USER)},direction:function(e){var t=this.quill.getFormat().align;"rtl"===e&&null==t?this.quill.format("align","right",s.default.sources.USER):e||"right"!==t||this.quill.format("align",!1,s.default.sources.USER),this.quill.format("direction",e,s.default.sources.USER)},indent:function(e){var t=this.quill.getSelection(),n=this.quill.getFormat(t),o=parseInt(n.indent||0);if("+1"===e||"-1"===e){var r="+1"===e?1:-1;"rtl"===n.direction&&(r*=-1),this.quill.format("indent",o+r,s.default.sources.USER)}},link:function(e){!0===e&&(e=prompt("Enter link URL:")),this.quill.format("link",e,s.default.sources.USER)},list:function(e){var t=this.quill.getSelection(),n=this.quill.getFormat(t);"check"===e?"checked"===n.list||"unchecked"===n.list?this.quill.format("list",!1,s.default.sources.USER):this.quill.format("list","unchecked",s.default.sources.USER):this.quill.format("list",e,s.default.sources.USER)}}},t.default=h,t.addControls=g},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"></polyline> <polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"></polyline> <line class=ql-stroke x1=10 x2=8 y1=5 y2=13></line> </svg>'},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(o):void 0},a=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return o.label.innerHTML=n,o.container.classList.add("ql-color-picker"),[].slice.call(o.container.querySelectorAll(".ql-picker-item"),0,7).forEach(function(e){e.classList.add("ql-primary")}),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"buildItem",value:function(e){var n=i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"buildItem",this).call(this,e);return n.style.backgroundColor=e.getAttribute("value")||"",n}},{key:"selectItem",value:function(e,n){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"selectItem",this).call(this,e,n);var o=this.label.querySelector(".ql-color-label"),r=e&&e.getAttribute("data-value")||"";o&&("line"===o.tagName?o.style.stroke=r:o.style.fill=r)}}]),t}(((o=n(28))&&o.__esModule?o:{default:o}).default);t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(o):void 0},a=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return o.container.classList.add("ql-icon-picker"),[].forEach.call(o.container.querySelectorAll(".ql-picker-item"),function(e){e.innerHTML=n[e.getAttribute("data-value")||""]}),o.defaultItem=o.container.querySelector(".ql-selected"),o.selectItem(o.defaultItem),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"selectItem",value:function(e,n){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"selectItem",this).call(this,e,n),e=e||this.defaultItem,this.label.innerHTML=e.innerHTML}}]),t}(((o=n(28))&&o.__esModule?o:{default:o}).default);t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=function(){function e(t,n){var o=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.quill=t,this.boundsContainer=n||document.body,this.root=t.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,this.quill.root===this.quill.scrollingContainer&&this.quill.root.addEventListener("scroll",function(){o.root.style.marginTop=-1*o.quill.root.scrollTop+"px"}),this.hide()}return o(e,[{key:"hide",value:function(){this.root.classList.add("ql-hidden")}},{key:"position",value:function(e){var 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");var o=this.boundsContainer.getBoundingClientRect(),r=this.root.getBoundingClientRect(),i=0;if(r.right>o.right&&(i=o.right-r.right,this.root.style.left=t+i+"px"),r.left<o.left&&(i=o.left-r.left,this.root.style.left=t+i+"px"),r.bottom>o.bottom){var a=r.bottom-r.top,s=e.bottom-e.top+a;this.root.style.top=n-s+"px",this.root.classList.add("ql-flip")}return i}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),e}();t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(o):void 0},r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=f(n(3)),a=f(n(8)),s=n(43),l=f(s),c=f(n(27)),u=n(15),d=f(n(41));function f(e){return e&&e.__esModule?e:{default:e}}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function g(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var y=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],m=function(e){function t(e,n){h(this,t),null!=n.modules.toolbar&&null==n.modules.toolbar.container&&(n.modules.toolbar.container=y);var o=p(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return o.quill.container.classList.add("ql-snow"),o}return g(t,e),r(t,[{key:"extendToolbar",value:function(e){e.container.classList.add("ql-snow"),this.buildButtons([].slice.call(e.container.querySelectorAll("button")),d.default),this.buildPickers([].slice.call(e.container.querySelectorAll("select")),d.default),this.tooltip=new v(this.quill,this.options.bounds),e.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"K",shortKey:!0},function(t,n){e.handlers.link.call(e,!n.format.link)})}}]),t}(l.default);m.DEFAULTS=(0,i.default)(!0,{},l.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(e){if(e){var t=this.quill.getSelection();if(null==t||0==t.length)return;var n=this.quill.getText(t);/^\S+@\S+\.\S+$/.test(n)&&0!==n.indexOf("mailto:")&&(n="mailto:"+n),this.quill.theme.tooltip.edit("link",n)}else this.quill.format("link",!1)}}}}});var v=function(e){function t(e,n){h(this,t);var o=p(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return o.preview=o.root.querySelector("a.ql-preview"),o}return g(t,e),r(t,[{key:"listen",value:function(){var e=this;o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"listen",this).call(this),this.root.querySelector("a.ql-action").addEventListener("click",function(t){e.root.classList.contains("ql-editing")?e.save():e.edit("link",e.preview.textContent),t.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",function(t){if(null!=e.linkRange){var n=e.linkRange;e.restoreFocus(),e.quill.formatText(n,"link",!1,a.default.sources.USER),delete e.linkRange}t.preventDefault(),e.hide()}),this.quill.on(a.default.events.SELECTION_CHANGE,function(t,n,o){if(null!=t){if(0===t.length&&o===a.default.sources.USER){var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],_n=!0,o=!1,r=void 0;try{for(var i,a=e[Symbol.iterator]();!(_n=(i=a.next()).done)&&(n.push(i.value),!t||n.length!==t);_n=!0);}catch(e){o=!0,r=e}finally{try{!_n&&a.return&&a.return()}finally{if(o)throw r}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}(e.quill.scroll.descendant(c.default,t.index),2),i=r[0],s=r[1];if(null!=i){e.linkRange=new u.Range(t.index-s,i.length());var l=c.default.formats(i.domNode);return e.preview.textContent=l,e.preview.setAttribute("href",l),e.show(),void e.position(e.quill.getBounds(e.linkRange))}}else delete e.linkRange;e.hide()}})}},{key:"show",value:function(){o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"show",this).call(this),this.root.removeAttribute("data-mode")}}]),t}(s.BaseTooltip);v.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(""),t.default=m},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=I(n(29)),r=n(36),i=n(38),a=n(64),s=I(n(65)),l=I(n(66)),c=n(67),u=I(c),d=n(37),f=n(26),h=n(39),p=n(40),g=I(n(56)),y=I(n(68)),m=I(n(27)),v=I(n(69)),b=I(n(70)),x=I(n(71)),w=I(n(72)),_=I(n(73)),E=n(13),k=I(E),O=I(n(74)),S=I(n(75)),C=I(n(57)),N=I(n(41)),j=I(n(28)),A=I(n(59)),P=I(n(60)),M=I(n(61)),T=I(n(108)),L=I(n(62));function I(e){return e&&e.__esModule?e:{default:e}}o.default.register({"attributors/attribute/direction":i.DirectionAttribute,"attributors/class/align":r.AlignClass,"attributors/class/background":d.BackgroundClass,"attributors/class/color":f.ColorClass,"attributors/class/direction":i.DirectionClass,"attributors/class/font":h.FontClass,"attributors/class/size":p.SizeClass,"attributors/style/align":r.AlignStyle,"attributors/style/background":d.BackgroundStyle,"attributors/style/color":f.ColorStyle,"attributors/style/direction":i.DirectionStyle,"attributors/style/font":h.FontStyle,"attributors/style/size":p.SizeStyle},!0),o.default.register({"formats/align":r.AlignClass,"formats/direction":i.DirectionClass,"formats/indent":a.IndentClass,"formats/background":d.BackgroundStyle,"formats/color":f.ColorStyle,"formats/font":h.FontClass,"formats/size":p.SizeClass,"formats/blockquote":s.default,"formats/code-block":k.default,"formats/header":l.default,"formats/list":u.default,"formats/bold":g.default,"formats/code":E.Code,"formats/italic":y.default,"formats/link":m.default,"formats/script":v.default,"formats/strike":b.default,"formats/underline":x.default,"formats/image":w.default,"formats/video":_.default,"formats/list/item":c.ListItem,"modules/formula":O.default,"modules/syntax":S.default,"modules/toolbar":C.default,"themes/bubble":T.default,"themes/snow":L.default,"ui/icons":N.default,"ui/picker":j.default,"ui/icon-picker":P.default,"ui/color-picker":A.default,"ui/tooltip":M.default},!0),t.default=o.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IndentClass=void 0;var o,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(o):void 0},a=(o=n(0))&&o.__esModule?o:{default:o},s=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"add",value:function(e,n){if("+1"===n||"-1"===n){var o=this.value(e)||0;n="+1"===n?o+1:o-1}return 0===n?(this.remove(e),!0):i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"add",this).call(this,e,n)}},{key:"canAdd",value:function(e,n){return i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"canAdd",this).call(this,e,n)||i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"canAdd",this).call(this,e,parseInt(n))}},{key:"value",value:function(e){return parseInt(i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"value",this).call(this,e))||void 0}}]),t}(a.default.Attributor.Class),l=new s("indent","ql-indent",{scope:a.default.Scope.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});t.IndentClass=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,r=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(((o=n(4))&&o.__esModule?o:{default:o}).default);r.blotName="blockquote",r.tagName="blockquote",t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,null,[{key:"formats",value:function(e){return this.tagName.indexOf(e.tagName)+1}}]),t}(((o=n(4))&&o.__esModule?o:{default:o}).default);i.blotName="header",i.tagName=["H1","H2","H3","H4","H5","H6"],t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.ListItem=void 0;var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(o):void 0},i=l(n(0)),a=l(n(4)),s=l(n(25));function l(e){return e&&e.__esModule?e:{default:e}}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function d(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var f=function(e){function t(){return c(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return d(t,e),o(t,[{key:"format",value:function(e,n){e!==h.blotName||n?r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"format",this).call(this,e,n):this.replaceWith(i.default.create(this.statics.scope))}},{key:"remove",value:function(){null==this.prev&&null==this.next?this.parent.remove():r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"remove",this).call(this)}},{key:"replaceWith",value:function(e,n){return this.parent.isolate(this.offset(this.parent),this.length()),e===this.parent.statics.blotName?(this.parent.replaceWith(e,n),this):(this.parent.unwrap(),r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"replaceWith",this).call(this,e,n))}}],[{key:"formats",value:function(e){return e.tagName===this.tagName?void 0:r(t.__proto__||Object.getPrototypeOf(t),"formats",this).call(this,e)}}]),t}(a.default);f.blotName="list-item",f.tagName="LI";var h=function(e){function t(e){c(this,t);var n=u(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),o=function(t){if(t.target.parentNode===e){var o=n.statics.formats(e),r=i.default.find(t.target);"checked"===o?r.format("list","unchecked"):"unchecked"===o&&r.format("list","checked")}};return e.addEventListener("touchstart",o),e.addEventListener("mousedown",o),n}return d(t,e),o(t,null,[{key:"create",value:function(e){var n="ordered"===e?"OL":"UL",o=r(t.__proto__||Object.getPrototypeOf(t),"create",this).call(this,n);return"checked"!==e&&"unchecked"!==e||o.setAttribute("data-checked","checked"===e),o}},{key:"formats",value:function(e){return"OL"===e.tagName?"ordered":"UL"===e.tagName?e.hasAttribute("data-checked")?"true"===e.getAttribute("data-checked")?"checked":"unchecked":"bullet":void 0}}]),o(t,[{key:"format",value:function(e,t){this.children.length>0&&this.children.tail.format(e,t)}},{key:"formats",value:function(){return e={},t=this.statics.blotName,n=this.statics.formats(this.domNode),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e;var e,t,n}},{key:"insertBefore",value:function(e,n){if(e instanceof f)r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insertBefore",this).call(this,e,n);else{var o=null==n?this.length():n.offset(this),i=this.split(o);i.parent.insertBefore(e,i)}}},{key:"optimize",value:function(e){r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"optimize",this).call(this,e);var n=this.next;null!=n&&n.prev===this&&n.statics.blotName===this.statics.blotName&&n.domNode.tagName===this.domNode.tagName&&n.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(n.moveChildren(this),n.remove())}},{key:"replace",value:function(e){if(e.statics.blotName!==this.statics.blotName){var n=i.default.create(this.statics.defaultChild);e.moveChildren(n),this.appendChild(n)}r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"replace",this).call(this,e)}}]),t}(s.default);h.blotName="list",h.scope=i.default.Scope.BLOCK_BLOT,h.tagName=["OL","UL"],h.defaultChild="list-item",h.allowedChildren=[f],t.ListItem=f,t.default=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,r=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(((o=n(56))&&o.__esModule?o:{default:o}).default);r.blotName="italic",r.tagName=["EM","I"],t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(o):void 0},a=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,null,[{key:"create",value:function(e){return"super"===e?document.createElement("sup"):"sub"===e?document.createElement("sub"):i(t.__proto__||Object.getPrototypeOf(t),"create",this).call(this,e)}},{key:"formats",value:function(e){return"SUB"===e.tagName?"sub":"SUP"===e.tagName?"super":void 0}}]),t}(((o=n(6))&&o.__esModule?o:{default:o}).default);a.blotName="script",a.tagName=["SUB","SUP"],t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,r=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(((o=n(6))&&o.__esModule?o:{default:o}).default);r.blotName="strike",r.tagName="S",t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,r=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(((o=n(6))&&o.__esModule?o:{default:o}).default);r.blotName="underline",r.tagName="U",t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(o):void 0},a=(o=n(0))&&o.__esModule?o:{default:o},s=n(27),l=["alt","height","width"],c=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"format",value:function(e,n){l.indexOf(e)>-1?n?this.domNode.setAttribute(e,n):this.domNode.removeAttribute(e):i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"format",this).call(this,e,n)}}],[{key:"create",value:function(e){var n=i(t.__proto__||Object.getPrototypeOf(t),"create",this).call(this,e);return"string"==typeof e&&n.setAttribute("src",this.sanitize(e)),n}},{key:"formats",value:function(e){return l.reduce(function(t,n){return e.hasAttribute(n)&&(t[n]=e.getAttribute(n)),t},{})}},{key:"match",value:function(e){return/\.(jpe?g|gif|png)$/.test(e)||/^data:image\/.+;base64/.test(e)}},{key:"sanitize",value:function(e){return(0,s.sanitize)(e,["http","https","data"])?e:"//:0"}},{key:"value",value:function(e){return e.getAttribute("src")}}]),t}(a.default.Embed);c.blotName="image",c.tagName="IMG",t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(o):void 0},a=n(4),s=(o=n(27))&&o.__esModule?o:{default:o},l=["height","width"],c=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"format",value:function(e,n){l.indexOf(e)>-1?n?this.domNode.setAttribute(e,n):this.domNode.removeAttribute(e):i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"format",this).call(this,e,n)}}],[{key:"create",value:function(e){var n=i(t.__proto__||Object.getPrototypeOf(t),"create",this).call(this,e);return n.setAttribute("frameborder","0"),n.setAttribute("allowfullscreen",!0),n.setAttribute("src",this.sanitize(e)),n}},{key:"formats",value:function(e){return l.reduce(function(t,n){return e.hasAttribute(n)&&(t[n]=e.getAttribute(n)),t},{})}},{key:"sanitize",value:function(e){return s.default.sanitize(e)}},{key:"value",value:function(e){return e.getAttribute("src")}}]),t}(a.BlockEmbed);c.blotName="video",c.className="ql-video",c.tagName="IFRAME",t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.FormulaBlot=void 0;var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(o):void 0},i=l(n(35)),a=l(n(5)),s=l(n(9));function l(e){return e&&e.__esModule?e:{default:e}}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function d(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var f=function(e){function t(){return c(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return d(t,e),o(t,null,[{key:"create",value:function(e){var n=r(t.__proto__||Object.getPrototypeOf(t),"create",this).call(this,e);return"string"==typeof e&&(window.katex.render(e,n,{throwOnError:!1,errorColor:"#f00"}),n.setAttribute("data-value",e)),n}},{key:"value",value:function(e){return e.getAttribute("data-value")}}]),t}(i.default);f.blotName="formula",f.className="ql-formula",f.tagName="SPAN";var h=function(e){function t(){c(this,t);var e=u(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));if(null==window.katex)throw new Error("Formula module requires KaTeX.");return e}return d(t,e),o(t,null,[{key:"register",value:function(){a.default.register(f,!0)}}]),t}(s.default);t.FormulaBlot=f,t.default=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.CodeToken=t.CodeBlock=void 0;var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(o):void 0},i=l(n(0)),a=l(n(5)),s=l(n(9));function l(e){return e&&e.__esModule?e:{default:e}}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function d(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var f=function(e){function t(){return c(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return d(t,e),o(t,[{key:"replaceWith",value:function(e){this.domNode.textContent=this.domNode.textContent,this.attach(),r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"replaceWith",this).call(this,e)}},{key:"highlight",value:function(e){var t=this.domNode.textContent;this.cachedText!==t&&((t.trim().length>0||null==this.cachedText)&&(this.domNode.innerHTML=e(t),this.domNode.normalize(),this.attach()),this.cachedText=t)}}]),t}(l(n(13)).default);f.className="ql-syntax";var h=new i.default.Attributor.Class("token","hljs",{scope:i.default.Scope.INLINE}),p=function(e){function t(e,n){c(this,t);var o=u(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));if("function"!=typeof o.options.highlight)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var r=null;return o.quill.on(a.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(r),r=setTimeout(function(){o.highlight(),r=null},o.options.interval)}),o.highlight(),o}return d(t,e),o(t,null,[{key:"register",value:function(){a.default.register(h,!0),a.default.register(f,!0)}}]),o(t,[{key:"highlight",value:function(){var e=this;if(!this.quill.selection.composing){this.quill.update(a.default.sources.USER);var t=this.quill.getSelection();this.quill.scroll.descendants(f).forEach(function(t){t.highlight(e.options.highlight)}),this.quill.update(a.default.sources.SILENT),null!=t&&this.quill.setSelection(t,a.default.sources.SILENT)}}}]),t}(s.default);p.DEFAULTS={highlight:null==window.hljs?null:function(e){return window.hljs.highlightAuto(e).value},interval:1e3},t.CodeBlock=f,t.CodeToken=h,t.default=p},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=13 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=9 y1=4 y2=4></line> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=14 x2=4 y1=14 y2=14></line> <line class=ql-stroke x1=12 x2=6 y1=4 y2=4></line> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=5 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=9 y1=4 y2=4></line> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=3 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=3 y1=4 y2=4></line> </svg>'},function(e,t){e.exports='<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"></polygon> <rect height=1 width=1 x=4 y=4></rect> <polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"></polygon> <rect height=1 width=1 x=2 y=6></rect> <rect height=1 width=1 x=3 y=5></rect> <rect height=1 width=1 x=4 y=7></rect> <polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"></polygon> <rect height=1 width=1 x=2 y=12></rect> <rect height=1 width=1 x=2 y=9></rect> <rect height=1 width=1 x=2 y=15></rect> <polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"></polygon> <rect height=1 width=1 x=3 y=8></rect> <path d=M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z></path> <path d=M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z></path> <path d=M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z></path> <rect height=1 width=1 x=12 y=2></rect> <rect height=1 width=1 x=11 y=3></rect> <path d=M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z></path> <rect height=1 width=1 x=2 y=3></rect> <rect height=1 width=1 x=6 y=2></rect> <rect height=1 width=1 x=3 y=2></rect> <rect height=1 width=1 x=5 y=3></rect> <rect height=1 width=1 x=9 y=2></rect> <rect height=1 width=1 x=15 y=14></rect> <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"></polygon> <rect height=1 width=1 x=13 y=7></rect> <rect height=1 width=1 x=15 y=5></rect> <rect height=1 width=1 x=14 y=6></rect> <rect height=1 width=1 x=15 y=8></rect> <rect height=1 width=1 x=14 y=9></rect> <path d=M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z></path> <rect height=1 width=1 x=14 y=3></rect> <polygon points="12 6.868 12 6 11.62 6 12 6.868"></polygon> <rect height=1 width=1 x=15 y=2></rect> <rect height=1 width=1 x=12 y=5></rect> <rect height=1 width=1 x=13 y=4></rect> <polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"></polygon> <rect height=1 width=1 x=9 y=14></rect> <rect height=1 width=1 x=8 y=15></rect> <path d=M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z></path> <rect height=1 width=1 x=5 y=15></rect> <path d=M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z></path> <rect height=1 width=1 x=11 y=15></rect> <path d=M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z></path> <rect height=1 width=1 x=14 y=15></rect> <rect height=1 width=1 x=15 y=11></rect> </g> <polyline class=ql-stroke points="5.5 13 9 5 12.5 13"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=11 y2=11></line> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <rect class="ql-fill ql-stroke" height=3 width=3 x=4 y=5></rect> <rect class="ql-fill ql-stroke" height=3 width=3 x=11 y=5></rect> <path class="ql-even ql-fill ql-stroke" d=M7,8c0,4.031-3,5-3,5></path> <path class="ql-even ql-fill ql-stroke" d=M14,8c0,4.031-3,5-3,5></path> </svg>'},function(e,t){e.exports='<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> <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></path> </svg>'},function(e,t){e.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=5 x2=13 y1=3 y2=3></line> <line class=ql-stroke x1=6 x2=9.35 y1=12 y2=3></line> <line class=ql-stroke x1=11 x2=15 y1=11 y2=15></line> <line class=ql-stroke x1=15 x2=11 y1=11 y2=15></line> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=7 x=2 y=14></rect> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <line class="ql-color-label ql-stroke ql-transparent" x1=3 x2=15 y1=15 y2=15></line> <polyline class=ql-stroke points="5.5 11 9 3 12.5 11"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=9 y2=9></line> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"></polygon> <line class="ql-stroke ql-fill" x1=15 x2=11 y1=4 y2=4></line> <path class=ql-fill d=M11,3a3,3,0,0,0,0,6h1V3H11Z></path> <rect class=ql-fill height=11 width=1 x=11 y=4></rect> <rect class=ql-fill height=11 width=1 x=13 y=4></rect> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"></polygon> <line class="ql-stroke ql-fill" x1=9 x2=5 y1=4 y2=4></line> <path class=ql-fill d=M5,3A3,3,0,0,0,5,9H6V3H5Z></path> <rect class=ql-fill height=11 width=1 x=5 y=4></rect> <rect class=ql-fill height=11 width=1 x=7 y=4></rect> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M14,16H4a1,1,0,0,1,0-2H14A1,1,0,0,1,14,16Z /> <path class=ql-fill d=M14,4H4A1,1,0,0,1,4,2H14A1,1,0,0,1,14,4Z /> <rect class=ql-fill x=3 y=6 width=12 height=6 rx=1 ry=1 /> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M13,16H5a1,1,0,0,1,0-2h8A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H5A1,1,0,0,1,5,2h8A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=2 y=6 width=14 height=6 rx=1 ry=1 /> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15,8H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,8Z /> <path class=ql-fill d=M15,12H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,12Z /> <path class=ql-fill d=M15,16H5a1,1,0,0,1,0-2H15A1,1,0,0,1,15,16Z /> <path class=ql-fill d=M15,4H5A1,1,0,0,1,5,2H15A1,1,0,0,1,15,4Z /> <rect class=ql-fill x=2 y=6 width=8 height=6 rx=1 ry=1 /> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M5,8H3A1,1,0,0,1,3,6H5A1,1,0,0,1,5,8Z /> <path class=ql-fill d=M5,12H3a1,1,0,0,1,0-2H5A1,1,0,0,1,5,12Z /> <path class=ql-fill d=M13,16H3a1,1,0,0,1,0-2H13A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H3A1,1,0,0,1,3,2H13A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=8 y=6 width=8 height=6 rx=1 ry=1 transform="translate(24 18) rotate(-180)"/> </svg>'},function(e,t){e.exports='<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></path> <rect class=ql-fill height=1.6 rx=0.8 ry=0.8 width=5 x=5.15 y=6.2></rect> <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></path> </svg>'},function(e,t){e.exports='<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>'},function(e,t){e.exports='<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>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=13 y1=4 y2=4></line> <line class=ql-stroke x1=5 x2=11 y1=14 y2=14></line> <line class=ql-stroke x1=8 x2=10 y1=14 y2=4></line> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=10 width=12 x=3 y=4></rect> <circle class=ql-fill cx=6 cy=7 r=1></circle> <polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"></polyline> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"></polyline> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="5 7 5 11 3 9 5 7"></polyline> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=11 y1=7 y2=11></line> <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> <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></path> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=7 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=7 x2=15 y1=14 y2=14></line> <line class="ql-stroke ql-thin" x1=2.5 x2=4.5 y1=5.5 y2=5.5></line> <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></path> <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> <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></path> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=6 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=6 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=6 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=3 y1=4 y2=4></line> <line class=ql-stroke x1=3 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=3 y1=14 y2=14></line> </svg>'},function(e,t){e.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=9 x2=15 y1=4 y2=4></line> <polyline class=ql-stroke points="3 4 4 5 6 3"></polyline> <line class=ql-stroke x1=9 x2=15 y1=14 y2=14></line> <polyline class=ql-stroke points="3 14 4 15 6 13"></polyline> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="3 9 4 10 6 8"></polyline> </svg>'},function(e,t){e.exports='<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>'},function(e,t){e.exports='<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>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <line class="ql-stroke ql-thin" x1=15.5 x2=2.5 y1=8.5 y2=9.5></line> <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> <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></path> </svg>'},function(e,t){e.exports='<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></path> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=12 x=3 y=15></rect> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=12 width=12 x=3 y=3></rect> <rect class=ql-fill height=12 width=1 x=5 y=3></rect> <rect class=ql-fill height=12 width=1 x=12 y=3></rect> <rect class=ql-fill height=2 width=8 x=5 y=8></rect> <rect class=ql-fill height=1 width=3 x=3 y=5></rect> <rect class=ql-fill height=1 width=3 x=3 y=7></rect> <rect class=ql-fill height=1 width=3 x=3 y=10></rect> <rect class=ql-fill height=1 width=3 x=3 y=12></rect> <rect class=ql-fill height=1 width=3 x=12 y=5></rect> <rect class=ql-fill height=1 width=3 x=12 y=7></rect> <rect class=ql-fill height=1 width=3 x=12 y=10></rect> <rect class=ql-fill height=1 width=3 x=12 y=12></rect> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <polygon class=ql-stroke points="7 11 9 13 11 11 7 11"></polygon> <polygon class=ql-stroke points="7 7 9 5 11 7 7 7"></polygon> </svg>'},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.BubbleTooltip=void 0;var o=function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(o):void 0},r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=d(n(3)),a=d(n(8)),s=n(43),l=d(s),c=n(15),u=d(n(41));function d(e){return e&&e.__esModule?e:{default:e}}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var g=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],y=function(e){function t(e,n){f(this,t),null!=n.modules.toolbar&&null==n.modules.toolbar.container&&(n.modules.toolbar.container=g);var o=h(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return o.quill.container.classList.add("ql-bubble"),o}return p(t,e),r(t,[{key:"extendToolbar",value:function(e){this.tooltip=new m(this.quill,this.options.bounds),this.tooltip.root.appendChild(e.container),this.buildButtons([].slice.call(e.container.querySelectorAll("button")),u.default),this.buildPickers([].slice.call(e.container.querySelectorAll("select")),u.default)}}]),t}(l.default);y.DEFAULTS=(0,i.default)(!0,{},l.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(e){e?this.quill.theme.tooltip.edit():this.quill.format("link",!1)}}}}});var m=function(e){function t(e,n){f(this,t);var o=h(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return o.quill.on(a.default.events.EDITOR_CHANGE,function(e,t,n,r){if(e===a.default.events.SELECTION_CHANGE)if(null!=t&&t.length>0&&r===a.default.sources.USER){o.show(),o.root.style.left="0px",o.root.style.width="",o.root.style.width=o.root.offsetWidth+"px";var i=o.quill.getLines(t.index,t.length);if(1===i.length)o.position(o.quill.getBounds(t));else{var s=i[i.length-1],l=o.quill.getIndex(s),u=Math.min(s.length()-1,t.index+t.length-l),d=o.quill.getBounds(new c.Range(l,u));o.position(d)}}else document.activeElement!==o.textbox&&o.quill.hasFocus()&&o.hide()}),o}return p(t,e),r(t,[{key:"listen",value:function(){var e=this;o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){e.root.classList.remove("ql-editing")}),this.quill.on(a.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!e.root.classList.contains("ql-hidden")){var t=e.quill.getSelection();null!=t&&e.position(e.quill.getBounds(t))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(e){var n=o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"position",this).call(this,e),r=this.root.querySelector(".ql-tooltip-arrow");if(r.style.marginLeft="",0===n)return n;r.style.marginLeft=-1*n-r.offsetWidth/2+"px"}}]),t}(s.BaseTooltip);m.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(""),t.BubbleTooltip=m,t.default=y},function(e,t,n){e.exports=n(63)}]).default},e.exports=t()},95950:(e,t,n)=>{var o=n(70695),r=n(88984),i=n(64894);e.exports=function(e){return i(e)?o(e):r(e)}}}]);