dgz-ui
Version:
Custom ui library using React.js, Shadcn/ui, TailwindCSS, Typescript
186 lines • 386 kB
JavaScript
"use strict";var Hf=Object.defineProperty;var zf=(r,e,t)=>e in r?Hf(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var J=(r,e,t)=>zf(r,typeof e!="symbol"?e+"":e,t);const I=require("./jsx-runtime-h4oGeKUK.cjs"),ee=require("react"),Pe=require("./index-C1oWDt_I.cjs"),Xe=require("./index-Dyp2JWEo.cjs"),Ae=require("./index-OHKxBzpT.cjs"),er=require("./index-2AoaKL3W.cjs"),Ut=require("./index-DGIrLGcj.cjs"),Te=require("./index-9_bM8_1f.cjs"),Js=require("./index-DxEITWU9.cjs"),ke=require("./utils-BeXF6FlA.cjs"),mc=require("./index-BbYJWkTf.cjs"),Fa=require("./index-BbFAJcHl.cjs"),Gf=require("react-dom"),_l=require("./index-C8ni3LLa.cjs"),Kf=require("./index-DG_2LC46.cjs"),gc=require("./index-CrR8uNCV.cjs"),Wf=require("./index-B4TRRfSv.cjs"),Dn=require("./index-C01riI3g.cjs"),Yf=require("./index-hwV4SK1V.cjs"),Zf=require("./index-Ohh8fm8C.cjs"),ze=require("./react-select-YYVvM9vk.cjs"),vc=require("./chevron-down-DJIIbSYZ.cjs"),yc=require("./circle-rB3jSuFA.cjs"),Xf=require("./createLucideIcon-BnAj0RnC.cjs"),ci=require("./index-DUh4Mlc6.cjs"),Qf=require("./button-BZdVaLIh.cjs");function bc(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const R=bc(ee),xc=bc(Gf);/**
* @license lucide-react v0.511.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Jf=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],ep=Xf.createLucideIcon("chevron-up",Jf);function hi(r){const e=R.useRef({value:r,previous:r});return R.useMemo(()=>(e.current.value!==r&&(e.current.previous=e.current.value,e.current.value=r),e.current.previous),[r])}var di="Checkbox",[tp,YE]=Xe.createContextScope(di),[rp,ja]=tp(di);function np(r){const{__scopeCheckbox:e,checked:t,children:n,defaultChecked:s,disabled:i,form:o,name:a,onCheckedChange:l,required:c,value:d="on",internal_do_not_use_render:m}=r,[h,g]=er.useControllableState({prop:t,defaultProp:s??!1,onChange:l,caller:di}),[v,f]=R.useState(null),[y,x]=R.useState(null),w=R.useRef(!1),_=v?!!o||!!v.closest("form"):!0,k={checked:h,disabled:i,setChecked:g,control:v,setControl:f,name:a,form:o,value:d,hasConsumerStoppedPropagationRef:w,required:c,defaultChecked:tr(s)?!1:s,isFormControl:_,bubbleInput:y,setBubbleInput:x};return I.jsxRuntimeExports.jsx(rp,{scope:e,...k,children:sp(m)?m(k):n})}var Ec="CheckboxTrigger",wc=R.forwardRef(({__scopeCheckbox:r,onKeyDown:e,onClick:t,...n},s)=>{const{control:i,value:o,disabled:a,checked:l,required:c,setControl:d,setChecked:m,hasConsumerStoppedPropagationRef:h,isFormControl:g,bubbleInput:v}=ja(Ec,r),f=Pe.useComposedRefs(s,d),y=R.useRef(l);return R.useEffect(()=>{const x=i==null?void 0:i.form;if(x){const w=()=>m(y.current);return x.addEventListener("reset",w),()=>x.removeEventListener("reset",w)}},[i,m]),I.jsxRuntimeExports.jsx(Te.Primitive.button,{type:"button",role:"checkbox","aria-checked":tr(l)?"mixed":l,"aria-required":c,"data-state":kc(l),"data-disabled":a?"":void 0,disabled:a,value:o,...n,ref:f,onKeyDown:Ae.composeEventHandlers(e,x=>{x.key==="Enter"&&x.preventDefault()}),onClick:Ae.composeEventHandlers(t,x=>{m(w=>tr(w)?!0:!w),v&&g&&(h.current=x.isPropagationStopped(),h.current||x.stopPropagation())})})});wc.displayName=Ec;var Va=R.forwardRef((r,e)=>{const{__scopeCheckbox:t,name:n,checked:s,defaultChecked:i,required:o,disabled:a,value:l,onCheckedChange:c,form:d,...m}=r;return I.jsxRuntimeExports.jsx(np,{__scopeCheckbox:t,checked:s,defaultChecked:i,disabled:a,required:o,onCheckedChange:c,name:n,form:d,value:l,internal_do_not_use_render:({isFormControl:h})=>I.jsxRuntimeExports.jsxs(I.jsxRuntimeExports.Fragment,{children:[I.jsxRuntimeExports.jsx(wc,{...m,ref:e,__scopeCheckbox:t}),h&&I.jsxRuntimeExports.jsx(Cc,{__scopeCheckbox:t})]})})});Va.displayName=di;var Sc="CheckboxIndicator",_c=R.forwardRef((r,e)=>{const{__scopeCheckbox:t,forceMount:n,...s}=r,i=ja(Sc,t);return I.jsxRuntimeExports.jsx(Ae.Presence,{present:n||tr(i.checked)||i.checked===!0,children:I.jsxRuntimeExports.jsx(Te.Primitive.span,{"data-state":kc(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:e,style:{pointerEvents:"none",...r.style}})})});_c.displayName=Sc;var Ac="CheckboxBubbleInput",Cc=R.forwardRef(({__scopeCheckbox:r,...e},t)=>{const{control:n,hasConsumerStoppedPropagationRef:s,checked:i,defaultChecked:o,required:a,disabled:l,name:c,value:d,form:m,bubbleInput:h,setBubbleInput:g}=ja(Ac,r),v=Pe.useComposedRefs(t,g),f=hi(i),y=Ut.useSize(n);R.useEffect(()=>{const w=h;if(!w)return;const _=window.HTMLInputElement.prototype,S=Object.getOwnPropertyDescriptor(_,"checked").set,D=!s.current;if(f!==i&&S){const F=new Event("click",{bubbles:D});w.indeterminate=tr(i),S.call(w,tr(i)?!1:i),w.dispatchEvent(F)}},[h,f,i,s]);const x=R.useRef(tr(i)?!1:i);return I.jsxRuntimeExports.jsx(Te.Primitive.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??x.current,required:a,disabled:l,name:c,value:d,form:m,...e,tabIndex:-1,ref:v,style:{...e.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Cc.displayName=Ac;function sp(r){return typeof r=="function"}function tr(r){return r==="indeterminate"}function kc(r){return tr(r)?"indeterminate":r?"checked":"unchecked"}const Tc=R.forwardRef(({className:r,...e},t)=>I.jsxRuntimeExports.jsx(Va,{ref:t,className:ke.cn("peer border-primary ring-offset-background focus-visible:ring-ring data-[state=checked]:text-primary size-4 shrink-0 rounded-sm border focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",r),...e,children:I.jsxRuntimeExports.jsx(_c,{className:ke.cn("flex size-4 items-center justify-center text-current"),children:e.checked==="indeterminate"?I.jsxRuntimeExports.jsx(Js.RN,{className:"text-primary mr-0.5 mb-0.5 size-3.5"}):I.jsxRuntimeExports.jsx(Js.s7,{className:"text-primary mr-0.5 mb-0.5 size-3.5"})})}));Tc.displayName=Va.displayName;const fi=Fa.cva("flex h-10 w-full rounded-lg border border-border-alpha-strong px-3 py-2 dark:bg-transparent file:border-0 placeholder:text-secondary placeholder:text-body-sm-regular focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-bg focus-visible:ring-offset-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",{variants:{variant:{default:"focus-visible:ring-item-primary",failure:"focus-visible:ring-item-destructive bg-item-destructive-focus placeholder:text-item-destructive border-item-destructive text-destructive",success:"focus-visible:ring-success bg-success/20 placeholder:text-success/80 border-success text-success"}},defaultVariants:{variant:"default"}}),Nc=R.forwardRef(({className:r,type:e,variant:t,...n},s)=>{const[i,o]=ee.useState(!1),[a,l]=ee.useState(!1);return ee.useEffect(()=>{o(e==="password")},[e]),I.jsxRuntimeExports.jsxs("div",{className:"relative",children:[I.jsxRuntimeExports.jsx("input",{type:a?"text":e,className:ke.cn(fi({variant:t}),r,i&&"pr-10"),ref:s,...n}),i&&I.jsxRuntimeExports.jsx(Qf.Button,{type:"button",size:"icon",variant:"tertiary",className:"absolute top-1 right-1 size-8 cursor-pointer rounded-md p-2 !ring-0 !ring-offset-0",onClick:()=>{l(!a)},children:a?I.jsxRuntimeExports.jsx(Js.Xt,{}):I.jsxRuntimeExports.jsx(Js.qt,{})})]})});Nc.displayName="Input";var Ye=function(){return Ye=Object.assign||function(e){for(var t,n=1,s=arguments.length;n<s;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Ye.apply(this,arguments)};function rn(r,e,t){if(t||arguments.length===2)for(var n=0,s=e.length,i;n<s;n++)(i||!(n in e))&&(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return r.concat(i||Array.prototype.slice.call(e))}function ip(r){var e=Object.create(null);return function(t){return e[t]===void 0&&(e[t]=r(t)),e[t]}}var op=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,ap=ip(function(r){return op.test(r)||r.charCodeAt(0)===111&&r.charCodeAt(1)===110&&r.charCodeAt(2)<91}),Se="-ms-",$n="-moz-",Ee="-webkit-",Rc="comm",pi="rule",$a="decl",lp="@import",Ic="@keyframes",up="@layer",Oc=Math.abs,Ua=String.fromCharCode,ta=Object.assign;function cp(r,e){return Oe(r,0)^45?(((e<<2^Oe(r,0))<<2^Oe(r,1))<<2^Oe(r,2))<<2^Oe(r,3):0}function Lc(r){return r.trim()}function Bt(r,e){return(r=e.exec(r))?r[0]:r}function de(r,e,t){return r.replace(e,t)}function Vs(r,e,t){return r.indexOf(e,t)}function Oe(r,e){return r.charCodeAt(e)|0}function nn(r,e,t){return r.slice(e,t)}function _t(r){return r.length}function Mc(r){return r.length}function Pn(r,e){return e.push(r),r}function hp(r,e){return r.map(e).join("")}function Al(r,e){return r.filter(function(t){return!Bt(t,e)})}var mi=1,sn=1,Dc=0,it=0,Re=0,pn="";function gi(r,e,t,n,s,i,o,a){return{value:r,root:e,parent:t,type:n,props:s,children:i,line:mi,column:sn,length:o,return:"",siblings:a}}function Yt(r,e){return ta(gi("",null,null,"",null,null,0,r.siblings),r,{length:-r.length},e)}function zr(r){for(;r.root;)r=Yt(r.root,{children:[r]});Pn(r,r.siblings)}function dp(){return Re}function fp(){return Re=it>0?Oe(pn,--it):0,sn--,Re===10&&(sn=1,mi--),Re}function ft(){return Re=it<Dc?Oe(pn,it++):0,sn++,Re===10&&(sn=1,mi++),Re}function br(){return Oe(pn,it)}function $s(){return it}function vi(r,e){return nn(pn,r,e)}function ra(r){switch(r){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function pp(r){return mi=sn=1,Dc=_t(pn=r),it=0,[]}function mp(r){return pn="",r}function ko(r){return Lc(vi(it-1,na(r===91?r+2:r===40?r+1:r)))}function gp(r){for(;(Re=br())&&Re<33;)ft();return ra(r)>2||ra(Re)>3?"":" "}function vp(r,e){for(;--e&&ft()&&!(Re<48||Re>102||Re>57&&Re<65||Re>70&&Re<97););return vi(r,$s()+(e<6&&br()==32&&ft()==32))}function na(r){for(;ft();)switch(Re){case r:return it;case 34:case 39:r!==34&&r!==39&&na(Re);break;case 40:r===41&&na(r);break;case 92:ft();break}return it}function yp(r,e){for(;ft()&&r+Re!==57;)if(r+Re===84&&br()===47)break;return"/*"+vi(e,it-1)+"*"+Ua(r===47?r:ft())}function bp(r){for(;!ra(br());)ft();return vi(r,it)}function xp(r){return mp(Us("",null,null,null,[""],r=pp(r),0,[0],r))}function Us(r,e,t,n,s,i,o,a,l){for(var c=0,d=0,m=o,h=0,g=0,v=0,f=1,y=1,x=1,w=0,_="",k=s,S=i,D=n,F=_;y;)switch(v=w,w=ft()){case 40:if(v!=108&&Oe(F,m-1)==58){Vs(F+=de(ko(w),"&","&\f"),"&\f",Oc(c?a[c-1]:0))!=-1&&(x=-1);break}case 34:case 39:case 91:F+=ko(w);break;case 9:case 10:case 13:case 32:F+=gp(v);break;case 92:F+=vp($s()-1,7);continue;case 47:switch(br()){case 42:case 47:Pn(Ep(yp(ft(),$s()),e,t,l),l);break;default:F+="/"}break;case 123*f:a[c++]=_t(F)*x;case 125*f:case 59:case 0:switch(w){case 0:case 125:y=0;case 59+d:x==-1&&(F=de(F,/\f/g,"")),g>0&&_t(F)-m&&Pn(g>32?kl(F+";",n,t,m-1,l):kl(de(F," ","")+";",n,t,m-2,l),l);break;case 59:F+=";";default:if(Pn(D=Cl(F,e,t,c,d,s,a,_,k=[],S=[],m,i),i),w===123)if(d===0)Us(F,e,D,D,k,i,m,a,S);else switch(h===99&&Oe(F,3)===110?100:h){case 100:case 108:case 109:case 115:Us(r,D,D,n&&Pn(Cl(r,D,D,0,0,s,a,_,s,k=[],m,S),S),s,S,m,a,n?k:S);break;default:Us(F,D,D,D,[""],S,0,a,S)}}c=d=g=0,f=x=1,_=F="",m=o;break;case 58:m=1+_t(F),g=v;default:if(f<1){if(w==123)--f;else if(w==125&&f++==0&&fp()==125)continue}switch(F+=Ua(w),w*f){case 38:x=d>0?1:(F+="\f",-1);break;case 44:a[c++]=(_t(F)-1)*x,x=1;break;case 64:br()===45&&(F+=ko(ft())),h=br(),d=m=_t(_=F+=bp($s())),w++;break;case 45:v===45&&_t(F)==2&&(f=0)}}return i}function Cl(r,e,t,n,s,i,o,a,l,c,d,m){for(var h=s-1,g=s===0?i:[""],v=Mc(g),f=0,y=0,x=0;f<n;++f)for(var w=0,_=nn(r,h+1,h=Oc(y=o[f])),k=r;w<v;++w)(k=Lc(y>0?g[w]+" "+_:de(_,/&\f/g,g[w])))&&(l[x++]=k);return gi(r,e,t,s===0?pi:a,l,c,d,m)}function Ep(r,e,t,n){return gi(r,e,t,Rc,Ua(dp()),nn(r,2,-2),0,n)}function kl(r,e,t,n,s){return gi(r,e,t,$a,nn(r,0,n),nn(r,n+1,-1),n,s)}function Pc(r,e,t){switch(cp(r,e)){case 5103:return Ee+"print-"+r+r;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Ee+r+r;case 4789:return $n+r+r;case 5349:case 4246:case 4810:case 6968:case 2756:return Ee+r+$n+r+Se+r+r;case 5936:switch(Oe(r,e+11)){case 114:return Ee+r+Se+de(r,/[svh]\w+-[tblr]{2}/,"tb")+r;case 108:return Ee+r+Se+de(r,/[svh]\w+-[tblr]{2}/,"tb-rl")+r;case 45:return Ee+r+Se+de(r,/[svh]\w+-[tblr]{2}/,"lr")+r}case 6828:case 4268:case 2903:return Ee+r+Se+r+r;case 6165:return Ee+r+Se+"flex-"+r+r;case 5187:return Ee+r+de(r,/(\w+).+(:[^]+)/,Ee+"box-$1$2"+Se+"flex-$1$2")+r;case 5443:return Ee+r+Se+"flex-item-"+de(r,/flex-|-self/g,"")+(Bt(r,/flex-|baseline/)?"":Se+"grid-row-"+de(r,/flex-|-self/g,""))+r;case 4675:return Ee+r+Se+"flex-line-pack"+de(r,/align-content|flex-|-self/g,"")+r;case 5548:return Ee+r+Se+de(r,"shrink","negative")+r;case 5292:return Ee+r+Se+de(r,"basis","preferred-size")+r;case 6060:return Ee+"box-"+de(r,"-grow","")+Ee+r+Se+de(r,"grow","positive")+r;case 4554:return Ee+de(r,/([^-])(transform)/g,"$1"+Ee+"$2")+r;case 6187:return de(de(de(r,/(zoom-|grab)/,Ee+"$1"),/(image-set)/,Ee+"$1"),r,"")+r;case 5495:case 3959:return de(r,/(image-set\([^]*)/,Ee+"$1$`$1");case 4968:return de(de(r,/(.+:)(flex-)?(.*)/,Ee+"box-pack:$3"+Se+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Ee+r+r;case 4200:if(!Bt(r,/flex-|baseline/))return Se+"grid-column-align"+nn(r,e)+r;break;case 2592:case 3360:return Se+de(r,"template-","")+r;case 4384:case 3616:return t&&t.some(function(n,s){return e=s,Bt(n.props,/grid-\w+-end/)})?~Vs(r+(t=t[e].value),"span",0)?r:Se+de(r,"-start","")+r+Se+"grid-row-span:"+(~Vs(t,"span",0)?Bt(t,/\d+/):+Bt(t,/\d+/)-+Bt(r,/\d+/))+";":Se+de(r,"-start","")+r;case 4896:case 4128:return t&&t.some(function(n){return Bt(n.props,/grid-\w+-start/)})?r:Se+de(de(r,"-end","-span"),"span ","")+r;case 4095:case 3583:case 4068:case 2532:return de(r,/(.+)-inline(.+)/,Ee+"$1$2")+r;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(_t(r)-1-e>6)switch(Oe(r,e+1)){case 109:if(Oe(r,e+4)!==45)break;case 102:return de(r,/(.+:)(.+)-([^]+)/,"$1"+Ee+"$2-$3$1"+$n+(Oe(r,e+3)==108?"$3":"$2-$3"))+r;case 115:return~Vs(r,"stretch",0)?Pc(de(r,"stretch","fill-available"),e,t)+r:r}break;case 5152:case 5920:return de(r,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(n,s,i,o,a,l,c){return Se+s+":"+i+c+(o?Se+s+"-span:"+(a?l:+l-+i)+c:"")+r});case 4949:if(Oe(r,e+6)===121)return de(r,":",":"+Ee)+r;break;case 6444:switch(Oe(r,Oe(r,14)===45?18:11)){case 120:return de(r,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+Ee+(Oe(r,14)===45?"inline-":"")+"box$3$1"+Ee+"$2$3$1"+Se+"$2box$3")+r;case 100:return de(r,":",":"+Se)+r}break;case 5719:case 2647:case 2135:case 3927:case 2391:return de(r,"scroll-","scroll-snap-")+r}return r}function ei(r,e){for(var t="",n=0;n<r.length;n++)t+=e(r[n],n,r,e)||"";return t}function wp(r,e,t,n){switch(r.type){case up:if(r.children.length)break;case lp:case $a:return r.return=r.return||r.value;case Rc:return"";case Ic:return r.return=r.value+"{"+ei(r.children,n)+"}";case pi:if(!_t(r.value=r.props.join(",")))return""}return _t(t=ei(r.children,n))?r.return=r.value+"{"+t+"}":""}function Sp(r){var e=Mc(r);return function(t,n,s,i){for(var o="",a=0;a<e;a++)o+=r[a](t,n,s,i)||"";return o}}function _p(r){return function(e){e.root||(e=e.return)&&r(e)}}function Ap(r,e,t,n){if(r.length>-1&&!r.return)switch(r.type){case $a:r.return=Pc(r.value,r.length,t);return;case Ic:return ei([Yt(r,{value:de(r.value,"@","@"+Ee)})],n);case pi:if(r.length)return hp(t=r.props,function(s){switch(Bt(s,n=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":zr(Yt(r,{props:[de(s,/:(read-\w+)/,":"+$n+"$1")]})),zr(Yt(r,{props:[s]})),ta(r,{props:Al(t,n)});break;case"::placeholder":zr(Yt(r,{props:[de(s,/:(plac\w+)/,":"+Ee+"input-$1")]})),zr(Yt(r,{props:[de(s,/:(plac\w+)/,":"+$n+"$1")]})),zr(Yt(r,{props:[de(s,/:(plac\w+)/,Se+"input-$1")]})),zr(Yt(r,{props:[s]})),ta(r,{props:Al(t,n)});break}return""})}}var Cp={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Er=typeof process<"u"&&process.env!==void 0&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",Bc="active",qc="data-styled-version",yi="6.1.19",Ha=`/*!sc*/
`,ti=typeof window<"u"&&typeof document<"u",kp=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&process.env!==void 0&&process.env.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&process.env.REACT_APP_SC_DISABLE_SPEEDY!==""?process.env.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&process.env.REACT_APP_SC_DISABLE_SPEEDY:typeof process<"u"&&process.env!==void 0&&process.env.SC_DISABLE_SPEEDY!==void 0&&process.env.SC_DISABLE_SPEEDY!==""?process.env.SC_DISABLE_SPEEDY!=="false"&&process.env.SC_DISABLE_SPEEDY:process.env.NODE_ENV!=="production"),Tl=/invalid hook call/i,As=new Set,Tp=function(r,e){if(process.env.NODE_ENV!=="production"){var t=e?' with the id of "'.concat(e,'"'):"",n="The component ".concat(r).concat(t,` has been created dynamically.
`)+`You may see this warning because you've called styled inside another component.
To resolve this only create new StyledComponents outside of any render method and function component.
See https://styled-components.com/docs/basics#define-styled-components-outside-of-the-render-method for more info.
`,s=console.error;try{var i=!0;console.error=function(o){for(var a=[],l=1;l<arguments.length;l++)a[l-1]=arguments[l];Tl.test(o)?(i=!1,As.delete(n)):s.apply(void 0,rn([o],a,!1))},ee.useRef(),i&&!As.has(n)&&(console.warn(n),As.add(n))}catch(o){Tl.test(o.message)&&As.delete(n)}finally{console.error=s}}},bi=Object.freeze([]),on=Object.freeze({});function Np(r,e,t){return t===void 0&&(t=on),r.theme!==t.theme&&r.theme||e||t.theme}var sa=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),Rp=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,Ip=/(^-|-$)/g;function Nl(r){return r.replace(Rp,"-").replace(Ip,"")}var Op=/(a)(d)/gi,Cs=52,Rl=function(r){return String.fromCharCode(r+(r>25?39:97))};function ia(r){var e,t="";for(e=Math.abs(r);e>Cs;e=e/Cs|0)t=Rl(e%Cs)+t;return(Rl(e%Cs)+t).replace(Op,"$1-$2")}var To,Fc=5381,gr=function(r,e){for(var t=e.length;t;)r=33*r^e.charCodeAt(--t);return r},jc=function(r){return gr(Fc,r)};function Lp(r){return ia(jc(r)>>>0)}function Vc(r){return process.env.NODE_ENV!=="production"&&typeof r=="string"&&r||r.displayName||r.name||"Component"}function No(r){return typeof r=="string"&&(process.env.NODE_ENV==="production"||r.charAt(0)===r.charAt(0).toLowerCase())}var $c=typeof Symbol=="function"&&Symbol.for,Uc=$c?Symbol.for("react.memo"):60115,Mp=$c?Symbol.for("react.forward_ref"):60112,Dp={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Pp={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Hc={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Bp=((To={})[Mp]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},To[Uc]=Hc,To);function Il(r){return("type"in(e=r)&&e.type.$$typeof)===Uc?Hc:"$$typeof"in r?Bp[r.$$typeof]:Dp;var e}var qp=Object.defineProperty,Fp=Object.getOwnPropertyNames,Ol=Object.getOwnPropertySymbols,jp=Object.getOwnPropertyDescriptor,Vp=Object.getPrototypeOf,Ll=Object.prototype;function zc(r,e,t){if(typeof e!="string"){if(Ll){var n=Vp(e);n&&n!==Ll&&zc(r,n,t)}var s=Fp(e);Ol&&(s=s.concat(Ol(e)));for(var i=Il(r),o=Il(e),a=0;a<s.length;++a){var l=s[a];if(!(l in Pp||t&&t[l]||o&&l in o||i&&l in i)){var c=jp(e,l);try{qp(r,l,c)}catch{}}}}return r}function an(r){return typeof r=="function"}function za(r){return typeof r=="object"&&"styledComponentId"in r}function vr(r,e){return r&&e?"".concat(r," ").concat(e):r||e||""}function Ml(r,e){if(r.length===0)return"";for(var t=r[0],n=1;n<r.length;n++)t+=r[n];return t}function ln(r){return r!==null&&typeof r=="object"&&r.constructor.name===Object.name&&!("props"in r&&r.$$typeof)}function oa(r,e,t){if(t===void 0&&(t=!1),!t&&!ln(r)&&!Array.isArray(r))return e;if(Array.isArray(e))for(var n=0;n<e.length;n++)r[n]=oa(r[n],e[n]);else if(ln(e))for(var n in e)r[n]=oa(r[n],e[n]);return r}function Ga(r,e){Object.defineProperty(r,"toString",{value:e})}var $p=process.env.NODE_ENV!=="production"?{1:`Cannot create styled-component for component: %s.
`,2:`Can't collect styles once you've consumed a \`ServerStyleSheet\`'s styles! \`ServerStyleSheet\` is a one off instance for each server-side render cycle.
- Are you trying to reuse it across renders?
- Are you accidentally calling collectStyles twice?
`,3:`Streaming SSR is only supported in a Node.js environment; Please do not try to call this method in the browser.
`,4:`The \`StyleSheetManager\` expects a valid target or sheet prop!
- Does this error occur on the client and is your target falsy?
- Does this error occur on the server and is the sheet falsy?
`,5:`The clone method cannot be used on the client!
- Are you running in a client-like environment on the server?
- Are you trying to run SSR on the client?
`,6:`Trying to insert a new style tag, but the given Node is unmounted!
- Are you using a custom target that isn't mounted?
- Does your document not have a valid head element?
- Have you accidentally removed a style tag manually?
`,7:'ThemeProvider: Please return an object from your "theme" prop function, e.g.\n\n```js\ntheme={() => ({})}\n```\n\n',8:`ThemeProvider: Please make your "theme" prop an object.
`,9:"Missing document `<head>`\n\n",10:`Cannot find a StyleSheet instance. Usually this happens if there are multiple copies of styled-components loaded at once. Check out this issue for how to troubleshoot and fix the common cases where this situation can happen: https://github.com/styled-components/styled-components/issues/1941#issuecomment-417862021
`,11:`_This error was replaced with a dev-time warning, it will be deleted for v4 final._ [createGlobalStyle] received children which will not be rendered. Please use the component without passing children elements.
`,12:"It seems you are interpolating a keyframe declaration (%s) into an untagged string. This was supported in styled-components v3, but is not longer supported in v4 as keyframes are now injected on-demand. Please wrap your string in the css\\`\\` helper which ensures the styles are injected correctly. See https://www.styled-components.com/docs/api#css\n\n",13:`%s is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.
`,14:`ThemeProvider: "theme" prop is required.
`,15:"A stylis plugin has been supplied that is not named. We need a name for each plugin to be able to prevent styling collisions between different stylis configurations within the same app. Before you pass your plugin to `<StyleSheetManager stylisPlugins={[]}>`, please make sure each plugin is uniquely-named, e.g.\n\n```js\nObject.defineProperty(importedPlugin, 'name', { value: 'some-unique-name' });\n```\n\n",16:`Reached the limit of how many styled components may be created at group %s.
You may only create up to 1,073,741,824 components. If you're creating components dynamically,
as for instance in your render method then you may be running into this limitation.
`,17:`CSSStyleSheet could not be found on HTMLStyleElement.
Has styled-components' style tag been unmounted or altered by another script?
`,18:"ThemeProvider: Please make sure your useTheme hook is within a `<ThemeProvider>`"}:{};function Up(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];for(var t=r[0],n=[],s=1,i=r.length;s<i;s+=1)n.push(r[s]);return n.forEach(function(o){t=t.replace(/%[a-z]/,o)}),t}function mn(r){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];return process.env.NODE_ENV==="production"?new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(r," for more information.").concat(e.length>0?" Args: ".concat(e.join(", ")):"")):new Error(Up.apply(void 0,rn([$p[r]],e,!1)).trim())}var Hp=function(){function r(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}return r.prototype.indexOfGroup=function(e){for(var t=0,n=0;n<e;n++)t+=this.groupSizes[n];return t},r.prototype.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var n=this.groupSizes,s=n.length,i=s;e>=i;)if((i<<=1)<0)throw mn(16,"".concat(e));this.groupSizes=new Uint32Array(i),this.groupSizes.set(n),this.length=i;for(var o=s;o<i;o++)this.groupSizes[o]=0}for(var a=this.indexOfGroup(e+1),l=(o=0,t.length);o<l;o++)this.tag.insertRule(a,t[o])&&(this.groupSizes[e]++,a++)},r.prototype.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],n=this.indexOfGroup(e),s=n+t;this.groupSizes[e]=0;for(var i=n;i<s;i++)this.tag.deleteRule(n)}},r.prototype.getGroup=function(e){var t="";if(e>=this.length||this.groupSizes[e]===0)return t;for(var n=this.groupSizes[e],s=this.indexOfGroup(e),i=s+n,o=s;o<i;o++)t+="".concat(this.tag.getRule(o)).concat(Ha);return t},r}(),zp=1<<30,Hs=new Map,ri=new Map,zs=1,ks=function(r){if(Hs.has(r))return Hs.get(r);for(;ri.has(zs);)zs++;var e=zs++;if(process.env.NODE_ENV!=="production"&&((0|e)<0||e>zp))throw mn(16,"".concat(e));return Hs.set(r,e),ri.set(e,r),e},Gp=function(r,e){zs=e+1,Hs.set(r,e),ri.set(e,r)},Kp="style[".concat(Er,"][").concat(qc,'="').concat(yi,'"]'),Wp=new RegExp("^".concat(Er,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),Yp=function(r,e,t){for(var n,s=t.split(","),i=0,o=s.length;i<o;i++)(n=s[i])&&r.registerName(e,n)},Zp=function(r,e){for(var t,n=((t=e.textContent)!==null&&t!==void 0?t:"").split(Ha),s=[],i=0,o=n.length;i<o;i++){var a=n[i].trim();if(a){var l=a.match(Wp);if(l){var c=0|parseInt(l[1],10),d=l[2];c!==0&&(Gp(d,c),Yp(r,d,l[3]),r.getTag().insertRules(c,s)),s.length=0}else s.push(a)}}},Dl=function(r){for(var e=document.querySelectorAll(Kp),t=0,n=e.length;t<n;t++){var s=e[t];s&&s.getAttribute(Er)!==Bc&&(Zp(r,s),s.parentNode&&s.parentNode.removeChild(s))}};function Xp(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:null}var Gc=function(r){var e=document.head,t=r||e,n=document.createElement("style"),s=function(a){var l=Array.from(a.querySelectorAll("style[".concat(Er,"]")));return l[l.length-1]}(t),i=s!==void 0?s.nextSibling:null;n.setAttribute(Er,Bc),n.setAttribute(qc,yi);var o=Xp();return o&&n.setAttribute("nonce",o),t.insertBefore(n,i),n},Qp=function(){function r(e){this.element=Gc(e),this.element.appendChild(document.createTextNode("")),this.sheet=function(t){if(t.sheet)return t.sheet;for(var n=document.styleSheets,s=0,i=n.length;s<i;s++){var o=n[s];if(o.ownerNode===t)return o}throw mn(17)}(this.element),this.length=0}return r.prototype.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch{return!1}},r.prototype.deleteRule=function(e){this.sheet.deleteRule(e),this.length--},r.prototype.getRule=function(e){var t=this.sheet.cssRules[e];return t&&t.cssText?t.cssText:""},r}(),Jp=function(){function r(e){this.element=Gc(e),this.nodes=this.element.childNodes,this.length=0}return r.prototype.insertRule=function(e,t){if(e<=this.length&&e>=0){var n=document.createTextNode(t);return this.element.insertBefore(n,this.nodes[e]||null),this.length++,!0}return!1},r.prototype.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},r.prototype.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},r}(),em=function(){function r(e){this.rules=[],this.length=0}return r.prototype.insertRule=function(e,t){return e<=this.length&&(this.rules.splice(e,0,t),this.length++,!0)},r.prototype.deleteRule=function(e){this.rules.splice(e,1),this.length--},r.prototype.getRule=function(e){return e<this.length?this.rules[e]:""},r}(),Pl=ti,tm={isServer:!ti,useCSSOMInjection:!kp},Kc=function(){function r(e,t,n){e===void 0&&(e=on),t===void 0&&(t={});var s=this;this.options=Ye(Ye({},tm),e),this.gs=t,this.names=new Map(n),this.server=!!e.isServer,!this.server&&ti&&Pl&&(Pl=!1,Dl(this)),Ga(this,function(){return function(i){for(var o=i.getTag(),a=o.length,l="",c=function(m){var h=function(x){return ri.get(x)}(m);if(h===void 0)return"continue";var g=i.names.get(h),v=o.getGroup(m);if(g===void 0||!g.size||v.length===0)return"continue";var f="".concat(Er,".g").concat(m,'[id="').concat(h,'"]'),y="";g!==void 0&&g.forEach(function(x){x.length>0&&(y+="".concat(x,","))}),l+="".concat(v).concat(f,'{content:"').concat(y,'"}').concat(Ha)},d=0;d<a;d++)c(d);return l}(s)})}return r.registerId=function(e){return ks(e)},r.prototype.rehydrate=function(){!this.server&&ti&&Dl(this)},r.prototype.reconstructWithOptions=function(e,t){return t===void 0&&(t=!0),new r(Ye(Ye({},this.options),e),this.gs,t&&this.names||void 0)},r.prototype.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},r.prototype.getTag=function(){return this.tag||(this.tag=(e=function(t){var n=t.useCSSOMInjection,s=t.target;return t.isServer?new em(s):n?new Qp(s):new Jp(s)}(this.options),new Hp(e)));var e},r.prototype.hasNameForId=function(e,t){return this.names.has(e)&&this.names.get(e).has(t)},r.prototype.registerName=function(e,t){if(ks(e),this.names.has(e))this.names.get(e).add(t);else{var n=new Set;n.add(t),this.names.set(e,n)}},r.prototype.insertRules=function(e,t,n){this.registerName(e,t),this.getTag().insertRules(ks(e),n)},r.prototype.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},r.prototype.clearRules=function(e){this.getTag().clearGroup(ks(e)),this.clearNames(e)},r.prototype.clearTag=function(){this.tag=void 0},r}(),rm=/&/g,nm=/^\s*\/\/.*$/gm;function Wc(r,e){return r.map(function(t){return t.type==="rule"&&(t.value="".concat(e," ").concat(t.value),t.value=t.value.replaceAll(",",",".concat(e," ")),t.props=t.props.map(function(n){return"".concat(e," ").concat(n)})),Array.isArray(t.children)&&t.type!=="@keyframes"&&(t.children=Wc(t.children,e)),t})}function sm(r){var e,t,n,s=on,i=s.options,o=i===void 0?on:i,a=s.plugins,l=a===void 0?bi:a,c=function(h,g,v){return v.startsWith(t)&&v.endsWith(t)&&v.replaceAll(t,"").length>0?".".concat(e):h},d=l.slice();d.push(function(h){h.type===pi&&h.value.includes("&")&&(h.props[0]=h.props[0].replace(rm,t).replace(n,c))}),o.prefix&&d.push(Ap),d.push(wp);var m=function(h,g,v,f){g===void 0&&(g=""),v===void 0&&(v=""),f===void 0&&(f="&"),e=f,t=g,n=new RegExp("\\".concat(t,"\\b"),"g");var y=h.replace(nm,""),x=xp(v||g?"".concat(v," ").concat(g," { ").concat(y," }"):y);o.namespace&&(x=Wc(x,o.namespace));var w=[];return ei(x,Sp(d.concat(_p(function(_){return w.push(_)})))),w};return m.hash=l.length?l.reduce(function(h,g){return g.name||mn(15),gr(h,g.name)},Fc).toString():"",m}var im=new Kc,aa=sm(),Yc=ee.createContext({shouldForwardProp:void 0,styleSheet:im,stylis:aa});Yc.Consumer;ee.createContext(void 0);function Bl(){return ee.useContext(Yc)}var ql=function(){function r(e,t){var n=this;this.inject=function(s,i){i===void 0&&(i=aa);var o=n.name+i.hash;s.hasNameForId(n.id,o)||s.insertRules(n.id,o,i(n.rules,o,"@keyframes"))},this.name=e,this.id="sc-keyframes-".concat(e),this.rules=t,Ga(this,function(){throw mn(12,String(n.name))})}return r.prototype.getName=function(e){return e===void 0&&(e=aa),this.name+e.hash},r}(),om=function(r){return r>="A"&&r<="Z"};function Fl(r){for(var e="",t=0;t<r.length;t++){var n=r[t];if(t===1&&n==="-"&&r[0]==="-")return r;om(n)?e+="-"+n.toLowerCase():e+=n}return e.startsWith("ms-")?"-"+e:e}var Zc=function(r){return r==null||r===!1||r===""},Xc=function(r){var e,t,n=[];for(var s in r){var i=r[s];r.hasOwnProperty(s)&&!Zc(i)&&(Array.isArray(i)&&i.isCss||an(i)?n.push("".concat(Fl(s),":"),i,";"):ln(i)?n.push.apply(n,rn(rn(["".concat(s," {")],Xc(i),!1),["}"],!1)):n.push("".concat(Fl(s),": ").concat((e=s,(t=i)==null||typeof t=="boolean"||t===""?"":typeof t!="number"||t===0||e in Cp||e.startsWith("--")?String(t).trim():"".concat(t,"px")),";")))}return n};function xr(r,e,t,n){if(Zc(r))return[];if(za(r))return[".".concat(r.styledComponentId)];if(an(r)){if(!an(i=r)||i.prototype&&i.prototype.isReactComponent||!e)return[r];var s=r(e);return process.env.NODE_ENV==="production"||typeof s!="object"||Array.isArray(s)||s instanceof ql||ln(s)||s===null||console.error("".concat(Vc(r)," is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.")),xr(s,e,t,n)}var i;return r instanceof ql?t?(r.inject(t,n),[r.getName(n)]):[r]:ln(r)?Xc(r):Array.isArray(r)?Array.prototype.concat.apply(bi,r.map(function(o){return xr(o,e,t,n)})):[r.toString()]}function am(r){for(var e=0;e<r.length;e+=1){var t=r[e];if(an(t)&&!za(t))return!1}return!0}var lm=jc(yi),um=function(){function r(e,t,n){this.rules=e,this.staticRulesId="",this.isStatic=process.env.NODE_ENV==="production"&&(n===void 0||n.isStatic)&&am(e),this.componentId=t,this.baseHash=gr(lm,t),this.baseStyle=n,Kc.registerId(t)}return r.prototype.generateAndInjectStyles=function(e,t,n){var s=this.baseStyle?this.baseStyle.generateAndInjectStyles(e,t,n):"";if(this.isStatic&&!n.hash)if(this.staticRulesId&&t.hasNameForId(this.componentId,this.staticRulesId))s=vr(s,this.staticRulesId);else{var i=Ml(xr(this.rules,e,t,n)),o=ia(gr(this.baseHash,i)>>>0);if(!t.hasNameForId(this.componentId,o)){var a=n(i,".".concat(o),void 0,this.componentId);t.insertRules(this.componentId,o,a)}s=vr(s,o),this.staticRulesId=o}else{for(var l=gr(this.baseHash,n.hash),c="",d=0;d<this.rules.length;d++){var m=this.rules[d];if(typeof m=="string")c+=m,process.env.NODE_ENV!=="production"&&(l=gr(l,m));else if(m){var h=Ml(xr(m,e,t,n));l=gr(l,h+d),c+=h}}if(c){var g=ia(l>>>0);t.hasNameForId(this.componentId,g)||t.insertRules(this.componentId,g,n(c,".".concat(g),void 0,this.componentId)),s=vr(s,g)}}return s},r}(),Qc=ee.createContext(void 0);Qc.Consumer;var Ro={},jl=new Set;function cm(r,e,t){var n=za(r),s=r,i=!No(r),o=e.attrs,a=o===void 0?bi:o,l=e.componentId,c=l===void 0?function(k,S){var D=typeof k!="string"?"sc":Nl(k);Ro[D]=(Ro[D]||0)+1;var F="".concat(D,"-").concat(Lp(yi+D+Ro[D]));return S?"".concat(S,"-").concat(F):F}(e.displayName,e.parentComponentId):l,d=e.displayName,m=d===void 0?function(k){return No(k)?"styled.".concat(k):"Styled(".concat(Vc(k),")")}(r):d,h=e.displayName&&e.componentId?"".concat(Nl(e.displayName),"-").concat(e.componentId):e.componentId||c,g=n&&s.attrs?s.attrs.concat(a).filter(Boolean):a,v=e.shouldForwardProp;if(n&&s.shouldForwardProp){var f=s.shouldForwardProp;if(e.shouldForwardProp){var y=e.shouldForwardProp;v=function(k,S){return f(k,S)&&y(k,S)}}else v=f}var x=new um(t,h,n?s.componentStyle:void 0);function w(k,S){return function(D,F,ae){var ce=D.attrs,ge=D.componentStyle,b=D.defaultProps,P=D.foldedComponentIds,A=D.styledComponentId,H=D.target,V=ee.useContext(Qc),N=Bl(),q=D.shouldForwardProp||N.shouldForwardProp;process.env.NODE_ENV!=="production"&&ee.useDebugValue(A);var W=Np(F,V,b)||on,Z=function(U,Q,B){for(var j,Y=Ye(Ye({},Q),{className:void 0,theme:B}),G=0;G<U.length;G+=1){var X=an(j=U[G])?j(Y):j;for(var T in X)Y[T]=T==="className"?vr(Y[T],X[T]):T==="style"?Ye(Ye({},Y[T]),X[T]):X[T]}return Q.className&&(Y.className=vr(Y.className,Q.className)),Y}(ce,F,W),C=Z.as||H,L={};for(var $ in Z)Z[$]===void 0||$[0]==="$"||$==="as"||$==="theme"&&Z.theme===W||($==="forwardedAs"?L.as=Z.forwardedAs:q&&!q($,C)||(L[$]=Z[$],q||process.env.NODE_ENV!=="development"||ap($)||jl.has($)||!sa.has(C)||(jl.add($),console.warn('styled-components: it looks like an unknown prop "'.concat($,'" is being sent through to the DOM, which will likely trigger a React console error. If you would like automatic filtering of unknown props, you can opt-into that behavior via `<StyleSheetManager shouldForwardProp={...}>` (connect an API like `@emotion/is-prop-valid`) or consider using transient props (`$` prefix for automatic filtering.)')))));var K=function(U,Q){var B=Bl(),j=U.generateAndInjectStyles(Q,B.styleSheet,B.stylis);return process.env.NODE_ENV!=="production"&&ee.useDebugValue(j),j}(ge,Z);process.env.NODE_ENV!=="production"&&D.warnTooManyClasses&&D.warnTooManyClasses(K);var z=vr(P,A);return K&&(z+=" "+K),Z.className&&(z+=" "+Z.className),L[No(C)&&!sa.has(C)?"class":"className"]=z,ae&&(L.ref=ae),ee.createElement(C,L)}(_,k,S)}w.displayName=m;var _=ee.forwardRef(w);return _.attrs=g,_.componentStyle=x,_.displayName=m,_.shouldForwardProp=v,_.foldedComponentIds=n?vr(s.foldedComponentIds,s.styledComponentId):"",_.styledComponentId=h,_.target=n?s.target:r,Object.defineProperty(_,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(k){this._foldedDefaultProps=n?function(S){for(var D=[],F=1;F<arguments.length;F++)D[F-1]=arguments[F];for(var ae=0,ce=D;ae<ce.length;ae++)oa(S,ce[ae],!0);return S}({},s.defaultProps,k):k}}),process.env.NODE_ENV!=="production"&&(Tp(m,h),_.warnTooManyClasses=function(k,S){var D={},F=!1;return function(ae){if(!F&&(D[ae]=!0,Object.keys(D).length>=200)){var ce=S?' with the id of "'.concat(S,'"'):"";console.warn("Over ".concat(200," classes were generated for component ").concat(k).concat(ce,`.
`)+`Consider using the attrs method, together with a style object for frequently changed styles.
Example:
const Component = styled.div.attrs(props => ({
style: {
background: props.background,
},
}))\`width: 100%;\`
<Component />`),F=!0,D={}}}}(m,h)),Ga(_,function(){return".".concat(_.styledComponentId)}),i&&zc(_,r,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),_}function Vl(r,e){for(var t=[r[0]],n=0,s=e.length;n<s;n+=1)t.push(e[n],r[n+1]);return t}var $l=function(r){return Object.assign(r,{isCss:!0})};function hm(r){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];if(an(r)||ln(r))return $l(xr(Vl(bi,rn([r],e,!0))));var n=r;return e.length===0&&n.length===1&&typeof n[0]=="string"?xr(n):$l(xr(Vl(n,e)))}function la(r,e,t){if(t===void 0&&(t=on),!e)throw mn(1,e);var n=function(s){for(var i=[],o=1;o<arguments.length;o++)i[o-1]=arguments[o];return r(e,t,hm.apply(void 0,rn([s],i,!1)))};return n.attrs=function(s){return la(r,e,Ye(Ye({},t),{attrs:Array.prototype.concat(t.attrs,s).filter(Boolean)}))},n.withConfig=function(s){return la(r,e,Ye(Ye({},t),s))},n}var Jc=function(r){return la(cm,r)},Ka=Jc;sa.forEach(function(r){Ka[r]=Jc(r)});process.env.NODE_ENV!=="production"&&typeof navigator<"u"&&navigator.product==="ReactNative"&&console.warn(`It looks like you've imported 'styled-components' on React Native.
Perhaps you're looking to import 'styled-components/native'?
Read more about this at https://www.styled-components.com/docs/basics#react-native`);var Ts="__sc-".concat(Er,"__");process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&typeof window<"u"&&(window[Ts]||(window[Ts]=0),window[Ts]===1&&console.warn(`It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason.
See https://s-c.sh/2BAXzed for more info.`),window[Ts]+=1);const dm=Ka.div`
.filepond {
&--drop-label {
label {
color: ${({$invalid:r})=>r?"var(--color-item-primary-destructive)":"inherit"} !important;
}
}
&--root {
margin-bottom: 0.5rem;
border-radius: 0.75rem;
}
&--panel {
border-radius: 0.8rem;
overflow: hidden;
&-root {
background-color: transparent;
}
}
&--drip {
border: 1px solid
${({$invalid:r})=>r?"var(--color-item-primary-destructive)":"var(--color-border-alpha-strong)"};
background-color: transparent;
opacity: 1;
outline-offset: 2px;
border-radius: 0.75rem;
}
}
&:focus-within {
.filepond {
&--drip {
outline: 2px solid
${({$invalid:r})=>r?"var(--color-item-primary-destructive)":"var(--color-item-primary-primary)"};
}
}
}
`;function eh({variant:r="default",...e}){return I.jsxRuntimeExports.jsx(dm,{$invalid:r==="failure",...e})}eh.displayName="FilepondContainer";var fm="Label",th=R.forwardRef((r,e)=>I.jsxRuntimeExports.jsx(Te.Primitive.label,{...r,ref:e,onMouseDown:t=>{var s;t.target.closest("button, input, select, textarea")||((s=r.onMouseDown)==null||s.call(r,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));th.displayName=fm;var rh=th,pm=r=>r.type==="checkbox",Bn=r=>r instanceof Date,Wa=r=>r==null;const nh=r=>typeof r=="object";var wr=r=>!Wa(r)&&!Array.isArray(r)&&nh(r)&&!Bn(r),mm=r=>wr(r)&&r.target?pm(r.target)?r.target.checked:r.target.value:r,gm=r=>r.substring(0,r.search(/\.\d+(\.|$)/))||r,vm=(r,e)=>r.has(gm(e)),ym=r=>{const e=r.constructor&&r.constructor.prototype;return wr(e)&&e.hasOwnProperty("isPrototypeOf")},bm=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function sh(r){let e;const t=Array.isArray(r),n=typeof FileList<"u"?r instanceof FileList:!1;if(r instanceof Date)e=new Date(r);else if(!(bm&&(r instanceof Blob||n))&&(t||wr(r)))if(e=t?[]:Object.create(Object.getPrototypeOf(r)),!t&&!ym(r))e=r;else for(const s in r)r.hasOwnProperty(s)&&(e[s]=sh(r[s]));else return r;return e}var ih=r=>/^\w*$/.test(r),ua=r=>r===void 0,xm=r=>Array.isArray(r)?r.filter(Boolean):[],oh=r=>xm(r.replace(/["|']|\]/g,"").split(/\.|\[/)),We=(r,e,t)=>{if(!e||!wr(r))return t;const n=(ih(e)?[e]:oh(e)).reduce((s,i)=>Wa(s)?s:s[i],r);return ua(n)||n===r?ua(r[e])?t:r[e]:n},Io=r=>typeof r=="boolean",Ul=(r,e,t)=>{let n=-1;const s=ih(e)?[e]:oh(e),i=s.length,o=i-1;for(;++n<i;){const a=s[n];let l=t;if(n!==o){const c=r[a];l=wr(c)||Array.isArray(c)?c:isNaN(+s[n+1])?{}:[]}if(a==="__proto__"||a==="constructor"||a==="prototype")return;r[a]=l,r=r[a]}};const Hl={BLUR:"blur",CHANGE:"change"},zl={all:"all"},Ya=ee.createContext(null);Ya.displayName="HookFormContext";const xi=()=>ee.useContext(Ya),Em=r=>{const{children:e,...t}=r;return ee.createElement(Ya.Provider,{value:t},e)};var wm=(r,e,t,n=!0)=>{const s={defaultValues:e._defaultValues};for(const i in r)Object.defineProperty(s,i,{get:()=>{const o=i;return e._proxyFormState[o]!==zl.all&&(e._proxyFormState[o]=!n||zl.all),t&&(t[o]=!0),r[o]}});return s};const ah=typeof window<"u"?ee.useLayoutEffect:ee.useEffect;function Sm(r){const e=xi(),{control:t=e.control,disabled:n,name:s,exact:i}=r||{},[o,a]=ee.useState(t._formState),l=ee.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return ah(()=>t._subscribe({name:s,formState:l.current,exact:i,callback:c=>{!n&&a({...t._formState,...c})}}),[s,n,i]),ee.useEffect(()=>{l.current.isValid&&t._setValid(!0)},[t]),ee.useMemo(()=>wm(o,t,l.current,!1),[o,t])}var _m=r=>typeof r=="string",Gl=(r,e,t,n,s)=>_m(r)?We(t,r,s):Array.isArray(r)?r.map(i=>We(t,i)):t,Kl=r=>Wa(r)||!nh(r);function Gs(r,e,t=new WeakSet){if(Kl(r)||Kl(e))return Object.is(r,e);if(Bn(r)&&Bn(e))return r.getTime()===e.getTime();const n=Object.keys(r),s=Object.keys(e);if(n.length!==s.length)return!1;if(t.has(r)||t.has(e))return!0;t.add(r),t.add(e);for(const i of n){const o=r[i];if(!s.includes(i))return!1;if(i!=="ref"){const a=e[i];if(Bn(o)&&Bn(a)||wr(o)&&wr(a)||Array.isArray(o)&&Array.isArray(a)?!Gs(o,a,t):!Object.is(o,a))return!1}}return!0}function Am(r){const e=xi(),{control:t=e.control,name:n,defaultValue:s,disabled:i,exact:o,compute:a}=r||{},l=ee.useRef(s),c=ee.useRef(a),d=ee.useRef(void 0),m=ee.useRef(t),h=ee.useRef(n);c.current=a;const[g,v]=ee.useState(()=>{const k=t._getWatch(n,l.current);return c.current?c.current(k):k}),f=ee.useCallback(k=>{const S=Gl(n,t._names,k||t._formValues,!1,l.current);return c.current?c.current(S):S},[t._formValues,t._names,n]),y=ee.useCallback(k=>{if(!i){const S=Gl(n,t._names,k||t._formValues,!1,l.current);if(c.current){const D=c.current(S);Gs(D,d.current)||(v(D),d.current=D)}else v(S)}},[t._formValues,t._names,i,n]);ah(()=>((m.current!==t||!Gs(h.current,n))&&(m.current=t,h.current=n,y()),t._subscribe({name:n,formState:{values:!0},exact:o,callback:k=>{y(k.values)}})),[t,o,n,y]),ee.useEffect(()=>t._removeUnmounted());const x=m.current!==t,w=h.current,_=ee.useMemo(()=>{if(i)return null;const k=!x&&!Gs(w,n);return x||k?f():null},[i,x,n,w,f]);return _!==null?_:g}function Cm(r){const e=xi(),{name:t,disabled:n,control:s=e.control,shouldUnregister:i,defaultValue:o,exact:a=!0}=r,l=vm(s._names.array,t),c=ee.useMemo(()=>We(s._formValues,t,We(s._defaultValues,t,o)),[s,t,o]),d=Am({control:s,name:t,defaultValue:c,exact:a}),m=Sm({control:s,name:t,exact:a}),h=ee.useRef(r),g=ee.useRef(void 0),v=ee.useRef(s.register(t,{...r.rules,value:d,...Io(r.disabled)?{disabled:r.disabled}:{}}));h.current=r;const f=ee.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!We(m.errors,t)},isDirty:{enumerable:!0,get:()=>!!We(m.dirtyFields,t)},isTouched:{enumerable:!0,get:()=>!!We(m.touchedFields,t)},isValidating:{enumerable:!0,get:()=>!!We(m.validatingFields,t)},error:{enumerable:!0,get:()=>We(m.errors,t)}}),[m,t]),y=ee.useCallback(k=>v.current.onChange({target:{value:mm(k),name:t},type:Hl.CHANGE}),[t]),x=ee.useCallback(()=>v.current.onBlur({target:{value:We(s._formValues,t),name:t},type:Hl.BLUR}),[t,s._formValues]),w=ee.useCallback(k=>{const S=We(s._fields,t);S&&k&&(S._f.ref={focus:()=>k.focus&&k.focus(),select:()=>k.select&&k.select(),setCustomValidity:D=>k.setCustomValidity(D),reportValidity:()=>k.reportValidity()})},[s._fields,t]),_=ee.useMemo(()=>({name:t,value:d,...Io(n)||m.disabled?{disabled:m.disabled||n}:{},onChange:y,onBlur:x,ref:w}),[t,n,m.disabled,y,x,w,d]);return ee.useEffect(()=>{const k=s._options.shouldUnregister||i,S=g.current;S&&S!==t&&!l&&s.unregister(S),s.register(t,{...h.current.rules,...Io(h.current.disabled)?{disabled:h.current.disabled}:{}});const D=(F,ae)=>{const ce=We(s._fields,F);ce&&ce._f&&(ce._f.mount=ae)};if(D(t,!0),k){const F=sh(We(s._options.defaultValues,t,h.current.defaultValue));Ul(s._defaultValues,t,F),ua(We(s._formValues,t))&&Ul(s._formValues,t,F)}return!l&&s.register(t),g.current=t,()=>{(l?k&&!s._state.action:k)?s.unregister(t):D(t,!1)}},[t,s,l,i]),ee.useEffect(()=>{s._setDisabledField({disabled:n,name:t})},[n,t,s]),ee.useMemo(()=>({field:_,formState:m,fieldState:f}),[_,m,f])}const km=r=>r.render(Cm(r)),Tm=Fa.cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Za=R.forwardRef(({className:r,...e},t)=>I.jsxRuntimeExports.jsx(rh,{ref:t,className:ke.cn(Tm(),r),...e}));Za.displayName=rh.displayName;const Nm=Em,lh=R.createContext({}),Rm=({...r})=>I.jsxRuntimeExports.jsx(lh.Provider,{value:{name:r.name},children:I.jsxRuntimeExports.jsx(km,{...r})}),ts=()=>{const r=R.useContext(lh),e=R.useContext(uh),{getFieldState:t,formState:n}=xi(),s=t(r.name,n);if(!r)throw new Error("useFormField should be used within <FormField>");const{id:i}=e;return{id:i,name:r.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...s}},uh=R.createContext({}),ch=R.forwardRef(({className:r,...e},t)=>{const n=R.useId();return I.jsxRuntimeExports.jsx(uh.Provider,{value:{id:n},children:I.jsxRuntimeExports.jsx("div",{ref:t,className:ke.cn("relative space-y-2",r),...e})})});ch.displayName="FormItem";const hh=R.forwardRef(({className:r,...e},t)=>{const{error:n,formItemId:s}=ts();return I.jsxRuntimeExports.jsx(Za,{ref:t,className:ke.cn("!text-body-xs-medium",r,n&&"text-destructive"),htmlFor:s,...e})});hh.displayName="FormLabel";const dh=R.forwardRef(({...r},e)=>{const{error:t,formItemId:n,formDescriptionId:s,formMessageId:i}=ts();return I.jsxRuntimeExports.jsx(mc.Slot,{ref:e,id:n,"aria-describedby":t?`${s} ${i}`:`${s}`,"aria-invalid":!!t,...r})});dh.displayName="FormControl";const fh=R.forwardRef(({className:r,...e},t)=>{const{formDescriptionId:n}=ts();return I.jsxRuntimeExports.jsx("p",{ref:t,id:n,className:ke.cn("text-muted-foreground text-sm",r),...e})});fh.displayName="FormDescription";const ph=R.forwardRef(({className:r,children:e,...t},n)=>{const{error:s,formMessageId:i}=ts(),o=s?String(s==null?void 0:s.message):e;return o?I.jsxRuntimeExports.jsx("p",{ref:n,id:i,className:ke.cn("!text-body-xs-medium text-destructive",r),...t,children:o}):null});ph.displayName="FormMessage";var Ei="Switch",[Im,ZE]=Xe.createContextScope(Ei),[Om,Lm]=Im(Ei),mh=R.forwardRef((r,e)=>{const{__scopeSwitch:t,name:n,checked:s,defaultChecked:i,required:o,disabled:a,value:l="on",onCheckedChange:c,form:d,...m}=r,[h,g]=R.useState(null),v=Pe.useComposedRefs(e,_=>g(_)),f=R.useRef(!1),y=h?d||!!h.closest("form"):!0,[x,w]=er.useControllableState({prop:s,defaultProp:i??!1,onChange:c,caller:Ei});return I.jsxRuntimeExports.jsxs(Om,{scope:t,checked:x,disabled:a,children:[I.jsxRuntimeExports.jsx(Te.Primitive.button,{type:"button",role:"switch","aria-checked":x,"aria-required":o,"data-state":bh(x),"data-disabled":a?"":void 0,disabled:a,value:l,...m,ref:v,onClick:Ae.composeEventHandlers(r.onClick,_=>{w(k=>!k),y&&(f.current=_.isPropagationStopped(),f.current||_.stopPropagation())})}),y&&I.jsxRuntimeExports.jsx(yh,{control:h,bubbles:!f.current,name:n,value:l,checked:x,required:o,disabled:a,form:d,style:{transform:"translateX(-100%)"}})]})});mh.displayName=Ei;var gh="SwitchThumb",vh=R.forwardRef((r,e)=>{const{__scopeSwitch:t,...n}=r,s=Lm(gh,t);return I.jsxRuntimeExports.jsx(Te.Primitive.span,{"data-state":bh(s.checked),"data-disabled":s.disabled?"":void 0,...n,ref:e})});vh.displayName=gh;var Mm="SwitchBubbleInput",yh=R.forwardRef(({__scopeSwitch:r,control:e,checked:t,bubbles:n=!0,...s},i)=>{const o=R.useRef(null),a=Pe.useComposedRefs(o,i),l=hi(t),c=Ut.useSize(e);return R.useEffect(()=>{const d=o.current;if(!d)return;const m=window.HTMLInputElement.prototype,g=Object.getOwnPropertyDescriptor(m,"checked").set;if(l!==t&&g){const v=new Event("click",{bubbles:n});g.call(d,t),d.dispatchEvent(v)}},[l,t,n]),I.jsxRuntimeExports.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:t,...s,tabIndex:-1,ref:a,style:{...s.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});yh.displayName=Mm;function bh(r){return r?"checked":"unchecked"}var xh=mh,Dm=vh;const Eh=R.forwardRef(({className:r,...e},t)=>I.jsxRuntimeExports.jsx(xh,{className:ke.cn("peer focus-visible:ring-ring focus-visible:ring-offset-background data-[state=checked]:bg-item-primary data-[state=unchecked]:bg-input inline-flex h-4 w-7 shrink-0 cursor-pointer items-center rounded-full border border-transparent transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-40",r),...e,ref:t,children:I.jsxRuntimeExports.jsx(Dm,{className:ke.cn("bg-background pointer-events-none block size-3.5 rounded-full shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-3 data-[state=unchecked]:translate-x-0")})}));Eh.displayName=xh.displayName;const wh=R.forwardRef(({className:r,variant:e,...t},n)=>I.jsxRuntimeExports.jsx("textarea",{className:ke.cn("min-h-20 px-3 py-2",fi({variant:e}),r),ref:n,...t}));wh.displayName="Textarea";var Pm=[" ","Enter","ArrowUp","ArrowDown"],Bm=[" ","Enter"],Sr="Select",[wi,Si,qm]=Kf.createCollection(Sr),[gn,XE]=Xe.createContextScope(Sr,[qm,Ut.createPopperScope]),_i=Ut.createPopperScope(),[Fm,ir]=gn(Sr),[jm,Vm]=gn(Sr),Sh=r=>{const{__scopeSelect:e,children:t,open:n,defaultOpen:s,onOpenChange:i,value:o,defaultValue:a,onValueChange:l,dir:c,name:d,autoComplete:m,disabled:h,required:g,form:v}=r,f=_i(e),[y,x]=R.useState(null),[w,_]=R.useState(null),[k,S]=R.useState(!1),D=gc.useDirection(c),[F,ae]=er.useControllableState({prop:n,defaultProp:s??!1,onChange:i,caller:Sr}),[ce,ge]=er.useControllableState({prop:o,defaultProp:a,onChange:l,caller:Sr}),b=R.useRef(null),P=y?v||!!y.closest("form"):!0,[A,H]=R.useState(new Set),V=Array.from(A).map(N=>N.props.value).join(";");return I.jsxRuntimeExports.jsx(Ut.Root2,{...f,children:I.jsxRuntimeExports.jsxs(Fm,{required:g,scope:e,trigger:y,onTriggerChange:x,valueNode:w,onValueNodeChange:_,valueNodeHasChildren:k,onValueNodeHasChildrenChange:S,contentId:er.useId(),value:ce,onValueChange:ge,open:F,onOpenChange:ae,dir:D,triggerPointerDownPosRef:b,disabled:h,children:[I.jsxRuntimeExports.jsx(wi.Provider,{scope:e,children:I.jsxRuntimeExports.jsx(jm,{scope:r.__scopeSelect,onNativeOptionAdd:R.useCallback(N=>{H(q=>new Set(q).add(N))},[]),onNativeOptionRemove:R.useCallback(N=>{H(q=>{const W=new Set(q);return W.delete(N),W})},[]),children:t})}),P?I.jsxRuntimeExports.jsxs(Wh,{"aria-hidden":!0,required:g,tabIndex:-1,name:d,autoComplete:m,value:ce,onChange:N=>ge(N.target.value),disabled:h,form:v,children:[ce===void 0?I.jsxRuntimeExports.jsx("option",{value:""}):null,Array.from(A)]},V):null]})})};Sh.displayName=Sr;var _h="SelectTrigger",Ah=R.forwardRef((r,e)=>{const{__scopeSelect:t,disabled:n=!1,...s}=r,i=_i(t),o=ir(_h,t),a=o.disabled||n,l=Pe.useComposedRefs(e,o.onTriggerChange),c=Si(t),d=R.useRef("touch"),[m,h,g]=Zh(f=>{const y=c().filter(_=>!_.disabled),x=y.find(_=>_.value===o.value),w=Xh(y,f,x);w!==void 0&&o.onValueChange(w.value)}),v=f=>{a||(o.onOpenChange(!0),g()),f&&(o.triggerPointerDownPosRef.current={x:Math.round(f.pageX),y:Math.round(f.pageY)})};return I.jsxRuntimeExports.jsx(Ut.Anchor,{asChild:!0,...i,children:I.jsxRuntimeExports.jsx(Te.Primitive.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":Yh(o.value)?"":void 0,...s,ref:l,onClick:Ae.composeEventHandlers(s.onClick,f=>{f.currentTarget.focus(),d.current!=="mouse"&&v(f)}),onPointerDown:Ae.composeEventHandlers(s.onPointerDown,f=>{d.current=f.pointerType;const y=f.target;y.hasPointerCapture(f.pointerId)&&y.releasePointerCapture(f.pointerId),f.button===0&&f.ctrlKey===!1&&f.pointerType==="mouse"&&(v(f),f.preventDefault())}),onKeyDown:Ae.composeEventHandlers(s.onKeyDown,f=>{const y=m.current!=="";!(f.ctrlKey||f.altKey||f.metaKey)&&f.key.length===1&&h(f.key),!(y&&f.key===" ")&&Pm.includes(f.key)&&(v(),f.preventDefault())})})})});Ah.displayName=_h;var Ch="SelectValue",kh=R.forwardRef((r,e)=>{const{__scopeSelect:t,className:n,style:s,children:i,placeholder:o="",...a}=r,l=ir(Ch,t),{onValueNodeHasChildrenChange:c}=l,d=i!==void 0,m=Pe.useComposedRefs(e,l.onValueNodeChange);return Xe.useLayoutEffect2(()=>{c(d)},[c,d]),I.jsxRuntimeExports.jsx(Te.Primitive.span,{...a,ref:m,style:{pointerEvents:"none"},children:Yh(l.value)?I.jsxRuntimeExports.jsx(I.jsxRuntimeExports.Fragment,{children:o}):i})});kh.displayName=Ch;var $m="SelectIcon",Th=R.forwardRef((r,e)=>{const{__scopeSelect:t,children:n,...s}=r;return I.jsxRuntimeExports.jsx(Te.Primitive.span,{"aria-hidden":!0,...s,ref:e,children:n||"▼"})});Th.displayName=$m;var Um="SelectPortal",Nh=r=>I.jsxRuntimeExports.jsx(Dn.Portal,{asChild:!0,...r});Nh.displayName=Um;var _r="SelectContent",Rh=R.forwardRef((r,e)=>{const t=ir(_r,r.__scopeSelect),[n,s]=R.useState();if(Xe.useLayoutEffect2(()=>{s(new DocumentFragment)},[]),!t.open){const i=n;return i?xc.createPortal(I.jsxRuntimeExports.jsx(Ih,{scope:r.__scopeSelect,children:I.jsxRuntimeExports.jsx(wi.Slot,{scope:r.__scopeSelect,children:I.jsxRuntimeExports.jsx("div",{children:r.children})})}),i):null}return I.jsxRuntimeExports.jsx(Oh,{...r,ref:e})});Rh.displayName=_r;var ut=10,[Ih,or]=gn(_r),Hm="SelectContentImpl",zm=mc.createSlot("SelectContent.RemoveScroll"),Oh=R.forwardRef((r,e)=>{const{__scopeSelect:t,position:n="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:o,side:a,sideOffset:l,align:c,alignOffset:d,arrowPadding:m,collisionBoundary:h,collisionPadding:g,sticky:v,hideWhenDetached:f,avoidCollisions:y,...x}=r,w=ir(_r,t),[_,k]=R.useState(null),[S,D]=R.useState(null),F=Pe.useComposedRefs(e,B=>k(B)),[ae,ce]=R.useState(null),[ge,b]=R.useState(null),P=Si(t),[A,H]=R.useState(!1),V=R.useRef(!1);R.useEffect(()=>{if(_)return Dn.hideOthers(_)},[_]),Dn.useFocusGuards();const N=R.useCallback(B=>{const[j,...Y]=P().map(T=>T.ref.current),[G]=Y.slice(-1),X=document.activeElement;for(const T of B)if(T===X||(T==null||T.scrollIntoView({block:"nearest"}),T===j&&S&&(S.scrollTop=0),T===G&&S&&(S.scrollTop=S.scrollHeight),T==null||T.focus(),document.activeElement!==X))return},[P,S]),q=R.useCallback(()=>N([ae,_]),[N,ae,_]);R.useEffect(()=>{A&&q()},[A,q]);const{onOpenChange:W,triggerPointerDownPosRef:Z}=w;R.useEffect(()=>{if(_){let B={x:0,y:0};const j=G=>{var X,T;B={x:Math.abs(Math.round(G.pageX)-(((X=Z.current)==null?void 0:X.x)??0)),y:Math.abs(Math.round(G.pageY)-(((T=Z.current)==null?void 0:T.y)??0))}},Y=G=>{B.x<=10&&B.y<=10?G.preventDefault():_.contains(G.target)||W(!1),document.removeEventListener("pointermove",j),Z.current=null};return Z.current!==null&&(document.addEventListener("pointermove",j),document.addEventListener("pointerup",Y,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",j),document.removeEventListener("pointerup",Y,{capture:!0})}}},[_,W,Z]),R.useEffect(()=>{const B=()=>W(!1);return window.addEventListener("blur",B),window.addEventListener("resize",B),()=>{window.removeEventListener("blur",B),window.removeEventListener("resize",B)}},[W]);const[C,L]=Zh(B=>{const j=P().filter(X=>!X.disabled),Y=j.find(X=>X.ref.current===document.activeElement),G=Xh(j,B,Y);G&&setTimeout(()=>G.ref.current.focus())}),$=R.useCallback((B,j,Y)=>{const G=!V.current&&!Y;(w.value!==void 0&&w.value===j||G)&&(ce(B),G&&(V.current=!0))},[w.value]),K=R.useCallback(()=>_==null?void 0:_.focus(),[_]),z=R.useCallback((B,j,Y)=>{const G=!V.current&&!Y;(w.value!==void 0&&w.value===j||G)&&b(B)},[w.value]),U=n==="popper"?ca:Lh,Q=U===ca?{side:a,sideOffset:l,align:c,alignOffset:d,arrowPadding:m,collisionBoundary:h,collisionPadding:g,sticky:v,hideWhenDetached:f,avoidCollisions:y}:{};return I.jsxRuntimeExports.jsx(Ih,{scope:t,content:_,viewport:S,onViewportChange:D,itemRefCallback:$,selectedItem:ae,onItemLeave:K,itemTextRefCallback:z,focusSelectedItem:q,selectedItemText:ge,position:n,isPositioned:A,searchRef:C,children:I.jsxRuntimeExports.jsx(Dn.ReactRemoveScroll,{as:zm,allowPinchZoom:!0,children:I.jsxRuntimeExports.jsx(Dn.FocusScope,{asChild:!0,trapped:w.open,onMountAutoFocus:B=>{B.preventDefault()},onUnmountAutoFocus:Ae.composeEventHandlers(s,B=>{var j;(j=w.trigger)==null||j.focus({preventScroll:!0}),B.preventDefault()}),children:I.jsxRuntimeExports.jsx(Wf.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:B=>B.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:I.jsxRuntimeExports.jsx(U,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:B=>B.preventDefault(),...x,...Q,onPlaced:()=>H(!0),ref:F,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:Ae.composeEventHandlers(x.onKeyDown,B=>{const j=B.ctrlKey||B.altKey||B.metaKey;if(B.key==="Tab"&&B.preventDefault(),!j&&B.key.length===1&&L(B.key),["ArrowUp","ArrowDown","Home","End"].includes(B.key)){let G=P().filter(X=>!X.disabled).map(X=>X.ref.current);if(["ArrowUp","End"].includes(B.key)&&(G=G.slice().reverse()),["ArrowUp","ArrowDown"].includes(B.key)){const X=B.target,T=G.indexOf(X);G=G.slice(T+1)}setTimeout(()=>N(G)),B.preventDefault()}})})})})})})});Oh.displayName=Hm;var Gm="SelectItemAlignedPosition",Lh=R.forwardRef((r,e)=>{const{__scopeSelect:t,onPlaced:n,...s}=r,i=ir(_r,t),o=or(_r,t),[a,l]=R.useState(null),[c,d]=R.useState(null),m=Pe.useComposedRefs(e,F=>d(F)),h=Si(t),g=R.useRef(!1),v=R.useRef(!0),{viewport:f,selectedItem:y,selectedItemText:x,focusSelectedItem:w}=o,_=R.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&c&&f&&y&&x){const F=i.trigger.getBoundingClientRect(),ae=c.getBoundingClientRect(),ce=i.valueNode.getBoundingClientRect(),ge=x.getBoundingClientRect();if(i.dir!=="rtl"){const X=ge.left-ae.left,T=ce.left-X,le=F.left-T,pe=F.width+le,Ce=Math.max(pe,ae.width),It=window.innerWidth-ut,Gt=_l.clamp(T,[ut,Math.max(ut,It-Ce)]);a.style.minWidth=pe+"px",a.style.left=Gt+"px"}else{const X=ae.right-ge.right,T=window.innerWidth-ce.right-X,le=window.innerWidth-F.right-T,pe=F.width+le,Ce=Math.max(pe,ae.width),It=window.innerWidth-ut,Gt=_l.clamp(T,[ut,Math.max(ut,It-Ce)]);a.style.minWidth=pe+"px",a.style.right=Gt+"px"}const b=h(),P=window.innerHeight-ut*2,A=f.scrollHeight,H=window.getComputedStyle(c),V=parseInt(H.borderTopWidth,10),N=parseInt(H.paddingTop,10),q=parseInt(H.borderBottomWidth,10),W=parseInt(H.paddingBottom,10),Z=V+N+A+W+q,C=Math.min(y.offsetHeight*5,Z),L=window.getComputedStyle(f),$=parseInt(L.paddingTop,10),K=parseInt(L.paddingBottom,10),z=F.top+F.height/2-ut,U=P-z,Q=y.offsetHeight/2,B=y.offsetTop+Q,j=V+N+B,Y=Z-j;if(j<=z){const X=b.length>0&&y===b[b.length-1].ref.current;a.style.bottom="0px";const T=c.clientHeight-f.offsetTop-f.offsetHeight,le=Math.max(U,Q+(X?K:0)+T+q),pe=j+le;a.style.height=pe+"px"}else{const X=b.length>0&&y===b[0].ref.current;a.style.top="0px";const le=Math.max(z,V+f.offsetTop+(X?$:0)+Q)+Y;a.style.height=le+"px",f.scrollTop=j-z+f.offsetTop}a.style.margin=`${ut}px 0`,a.style.minHeight=C+"px",a.style.maxHeight=P+"px",n==null||n(),requestAnimationFrame(()=>g.current=!0)}},[h,i.trigger,i.valueNode,a,c,f,y,x,i.dir,n]);Xe.useLayoutEffect2(()=>_(),[_]);const[k,S]=R.useState();Xe.useLayoutEffect2(()=>{c&&S(window.getComputedStyle(c).zIndex)},[c]);const D=R.useCallback(F=>{F&&v.current===!0&&(_(),w==null||w(),v.current=!1)},[_,w]);return I.jsxRuntimeExports.jsx(Wm,{scope:t,contentWrapper:a,shouldExpandOnScrollRef:g,onScrollButtonChange:D,children:I.jsxRuntimeExports.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:I.jsxRuntimeExports.jsx(Te.Primitive.div,{...s,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});Lh.displayName=Gm;var Km="SelectPopperPosition",ca=R.forwardRef((r,e)=>{const{__scopeSelect:t,align:n="start",collisionPadding:s=ut,...i}=r,o=_i(t);return I.jsxRuntimeExports.jsx(Ut.Content,{...o,...i,ref:e,align:n,collisionPadding:s,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});ca.displayName=Km;var[Wm,Xa]=gn(_r,{}),ha="SelectViewport",Mh=R.forwardRef((r,e)=>{const{__scopeSelect:t,nonce:n,...s}=r,i=or(ha,t),o=Xa(ha,t),a=Pe.useComposedRefs(e,i.onViewportChange),l=R.useRef(0);return I.jsxRuntimeExports.jsxs(I.jsxRuntimeExports.Fragment,{children:[I.jsxRuntimeExports.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),I.jsxRuntimeExports.jsx(wi.Slot,{scope:t,children:I.jsxRuntimeExports.jsx(Te.Primitive.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:Ae.composeEventHandlers(s.onScroll,c=>{const d=c.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:h}=o;if(h!=null&&h.current&&m){const g=Math.abs(l.current-d.scrollTop);if(g>0){const v=window.innerHeight-ut*2,f=parseFloat(m.style.minHeight),y=parseFloat(m.style.height),x=Math.max(f,y);if(x<v){const w=x+g,_=Math.min(v,w),k=w-_;m.style.height=_+"px",m.style.bottom==="0px"&&(d.scrollTop=k>0?k:0,m.style.justifyContent="flex-end")}}}l.current=d.scrollTop})})})]})});Mh.displayName=ha;var Dh="SelectGroup",[Ym,Zm]=gn(Dh),Ph=R.forwardRef((r,e)=>{const{__scopeSelect:t,...n}=r,s=er.useId();return I.jsxRuntimeExports.jsx(Ym,{scope:t,id:s,children:I.jsxRuntimeExports.jsx(Te.Primitive.div,{role:"group","aria-labelledby":s,...n,ref:e})})});Ph.displayName=Dh;var Bh="SelectLabel",qh=R.forwardRef((r,e)=>{const{__scopeSelect:t,...n}=r,s=Zm(Bh,t);return I.jsxRuntimeExports.jsx(Te.Primitive.div,{id:s.id,...n,ref:e})});qh.displayName=Bh;var ni="SelectItem",[Xm,Fh]=gn(ni),jh=R.forwardRef((r,e)=>{const{__scopeSelect:t,value:n,disabled:s=!1,textValue:i,...o}=r,a=ir(ni,t),l=or(ni,t),c=a.value===n,[d,m]=R.useState(i??""),[h,g]=R.useState(!1),v=Pe.useComposedRefs(e,w=>{var _;return(_=l.itemRefCallback)==null?void 0:_.call(l,w,n,s)}),f=er.useId(),y=R.useRef("touch"),x=()=>{s||(a.onValueChange(n),a.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return I.jsxRuntimeExports.jsx(Xm,{scope:t,value:n,disabled:s,textId:f,isSelected:c,onItemTextChange:R.useCallback(w=>{m(_=>_||((w==null?void 0:w.textContent)??"").trim())},[]),children:I.jsxRuntimeExports.jsx(wi.ItemSlot,{scope:t,value:n,disabled:s,textValue:d,children:I.jsxRuntimeExports.jsx(Te.Primitive.div,{role:"option","aria-labelledby":f,"data-highlighted":h?"":void 0,"aria-selected":c&&h,"data-state":c?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...o,ref:v,onFocus:Ae.composeEventHandlers(o.onFocus,()=>g(!0)),onBlur:Ae.composeEventHandlers(o.onBlur,()=>g(!1)),onClick:Ae.composeEventHandlers(o.onClick,()=>{y.current!=="mouse"&&x()}),onPointerUp:Ae.composeEventHandlers(o.onPointerUp,()=>{y.current==="mouse"&&x()}),onPointerDown:Ae.composeEventHandlers(o.onPointerDown,w=>{y.current=w.pointerType}),onPointerMove:Ae.composeEventHandlers(o.onPointerMove,w=>{var _;y.current=w.pointerType,s?(_=l.onItemLeave)==null||_.call(l):y.current==="mouse"&&w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ae.composeEventHandlers(o.onPointerLeave,w=>{var _;w.currentTarget===document.activeElement&&((_=l.onItemLeave)==null||_.call(l))}),onKeyDown:Ae.composeEventHandlers(o.onKeyDown,w=>{var k;((k=l.searchRef)==null?void 0:k.current)!==""&&w.key===" "||(Bm.includes(w.key)&&x(),w.key===" "&&w.preventDefault())})})})})});jh.displayName=ni;var qn="SelectItemText",Vh=R.forwardRef((r,e)=>{const{__scopeSelect:t,className:n,style:s,...i}=r,o=ir(qn,t),a=or(qn,t),l=Fh(qn,t),c=Vm(qn,t),[d,m]=R.useState(null),h=Pe.useComposedRefs(e,x=>m(x),l.onItemTextChange,x=>{var w;return(w=a.itemTextRefCallback)==null?void 0:w.call(a,x,l.value,l.disabled)}),g=d==null?void 0:d.textContent,v=R.useMemo(()=>I.jsxRuntimeExports.jsx("option",{value:l.value,disabled:l.disabled,children:g},l.value),[l.disabled,l.value,g]),{onNativeOptionAdd:f,onNativeOptionRemove:y}=c;return Xe.useLayoutEffect2(()=>(f(v),()=>y(v)),[f,y,v]),I.jsxRuntimeExports.jsxs(I.jsxRuntimeExports.Fragment,{children:[I.jsxRuntimeExports.jsx(Te.Primitive.span,{id:l.textId,...i,ref:h}),l.isSelected&&o.valueNode&&!o.valueNodeHasChildren?xc.createPortal(i.children,o.valueNode):null]})});Vh.displayName=qn;var $h="SelectItemIndicator",Uh=R.forwardRef((r,e)=>{const{__scopeSelect:t,...n}=r;return Fh($h,t).isSelected?I.jsxRuntimeExports.jsx(Te.Primitive.span,{"aria-hidden":!0,...n,ref:e}):null});Uh.displayName=$h;var da="SelectScrollUpButton",Hh=R.forwardRef((r,e)=>{const t=or(da,r.__scopeSelect),n=Xa(da,r.__scopeSelect),[s,i]=R.useState(!1),o=Pe.useComposedRefs(e,n.onScrollButtonChange);return Xe.useLayoutEffect2(()=>{if(t.viewport&&t.isPositioned){let a=function(){const c=l.scrollTop>0;i(c)};const l=t.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[t.viewport,t.isPositioned]),s?I.jsxRuntimeExports.jsx(Gh,{...r,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=t;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});Hh.displayName=da;var fa="SelectScrollDownButton",zh=R.forwardRef((r,e)=>{const t=or(fa,r.__scopeSelect),n=Xa(fa,r.__scopeSelect),[s,i]=R.useState(!1),o=Pe.useComposedRefs(e,n.onScrollButtonChange);return Xe.useLayoutEffect2(()=>{if(t.viewport&&t.isPositioned){let a=function(){const c=l.scrollHeight-l.clientHeight,d=Math.ceil(l.scrollTop)<c;i(d)};const l=t.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[t.viewport,t.isPositioned]),s?I.jsxRuntimeExports.jsx(Gh,{...r,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=t;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});zh.displayName=fa;var Gh=R.forwardRef((r,e)=>{const{__scopeSelect:t,onAutoScroll:n,...s}=r,i=or("SelectScrollButton",t),o=R.useRef(null),a=Si(t),l=R.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return R.useEffect(()=>()=>l(),[l]),Xe.useLayoutEffect2(()=>{var d;const c=a().find(m=>m.ref.current===document.activeElement);(d=c==null?void 0:c.ref.current)==null||d.scrollIntoView({block:"nearest"})},[a]),I.jsxRuntimeExports.jsx(Te.Primitive.div,{"aria-hidden":!0,...s,ref:e,style:{flexShrink:0,...s.style},onPointerDown:Ae.composeEventHandlers(s.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(n,50))}),onPointerMove:Ae.composeEventHandlers(s.onPointerMove,()=>{var c;(c=i.onItemLeave)==null||c.call(i),o.current===null&&(o.current=window.setInterval(n,50))}),onPointerLeave:Ae.composeEventHandlers(s.onPointerLeave,()=>{l()})})}),Qm="SelectSeparator",Kh=R.forwardRef((r,e)=>{const{__scopeSelect:t,...n}=r;return I.jsxRuntimeExports.jsx(Te.Primitive.div,{"aria-hidden":!0,...n,ref:e})});Kh.displayName=Qm;var pa="SelectArrow",Jm=R.forwardRef((r,e)=>{const{__scopeSelect:t,...n}=r,s=_i(t),i=ir(pa,t),o=or(pa,t);return i.open&&o.position==="popper"?I.jsxRuntimeExports.jsx(Ut.Arrow,{...s,...n,ref:e}):null});Jm.displayName=pa;var eg="SelectBubbleInput",Wh=R.forwardRef(({__scopeSelect:r,value:e,...t},n)=>{const s=R.useRef(null),i=Pe.useComposedRefs(n,s),o=hi(e);return R.useEffect(()=>{const a=s.current;if(!a)return;const l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(o!==e&&d){const m=new Event("change",{bubbles:!0});d.call(a,e),a.dispatchEvent(m)}},[o,e]),I.jsxRuntimeExports.jsx(Te.Primitive.select,{...t,style:{...Zf.VISUALLY_HIDDEN_STYLES,...t.style},ref:i,defaultValue:e})});Wh.displayName=eg;function Yh(r){return r===""||r===void 0}function Zh(r){const e=Yf.useCallbackRef(r),t=R.useRef(""),n=R.useRef(0),s=R.useCallback(o=>{const a=t.current+o;e(a),function l(c){t.current=c,window.clearTimeout(n.current),c!==""&&(n.current=window.setTimeout(()=>l(""),1e3))}(a)},[e]),i=R.useCallback(()=>{t.current="",window.clearTimeout(n.current)},[]);return R.useEffect(()=>()=>window.clearTimeout(n.current),[]),[t,s,i]}function Xh(r,e,t){const s=e.length>1&&Array.from(e).every(c=>c===e[0])?e[0]:e,i=t?r.indexOf(t):-1;let o=tg(r,Math.max(i,0));s.length===1&&(o=o.filter(c=>c!==t));const l=o.find(c=>c.textValue.toLowerCase().startsWith(s.toLowerCase()));return l!==t?l:void 0}function tg(r,e){return r.map((t,n)=>r[(e+n)%r.length])}var rg=Sh,Qh=Ah,ng=kh,sg=Th,ig=Nh,Jh=Rh,og=Mh,ag=Ph,ed=qh,td=jh,lg=Vh,ug=Uh,rd=Hh,nd=zh,sd=Kh;function cg(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,ze._setPrototypeOf(r,e)}var Wl=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function hg(r,e){return!!(r===e||Wl(r)&&Wl(e))}function dg(r,e){if(r.length!==e.length)return!1;for(var t=0;t<r.length;t++)if(!hg(r[t],e[t]))return!1;return!0}function Oo(r,e){e===void 0&&(e=dg);var t,n=[],s,i=!1;function o(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];return i&&t===this&&e(a,n)||(s=r.apply(this,a),i=!0,t=this,n=a),s}return o}var fg=typeof performance=="object"&&typeof performance.now=="function",Yl=fg?function(){return performance.now()}:function(){return Date.now()};function Zl(r){cancelAnimationFrame(r.id)}function pg(r,e){var t=Yl();function n(){Yl()-t>=e?r.call(null):s.id=requestAnimationFrame(n)}var s={id:requestAnimationFrame(n)};return s}var Lo=-1;function Xl(r){if(r===void 0&&(r=!1),Lo===-1||r){var e=document.createElement("div"),t=e.style;t.width="50px",t.height="50px",t.overflow="scroll",document.body.appendChild(e),Lo=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return Lo}var Gr=null;function Ql(r){if(r===void 0&&(r=!1),Gr===null||r){var e=document.createElement("div"),t=e.style;t.width="50px",t.height="50px",t.overflow="scroll",t.direction="rtl";var n=document.createElement("div"),s=n.style;return s.width="100px",s.height="100px",e.appendChild(n),document.body.appendChild(e),e.scrollLeft>0?Gr="positive-descending":(e.scrollLeft=1,e.scrollLeft===0?Gr="negative":Gr="positive-ascending"),document.body.removeChild(e),Gr}return Gr}process.env.NODE_ENV;var mg=150,gg=function(e,t){return e},Ks=null,Ws=null;process.env.NODE_ENV!=="production"&&typeof window<"u"&&typeof window.WeakSet<"u"&&(Ks=new WeakSet,Ws=new WeakSet);function vg(r){var e,t=r.getItemOffset,n=r.getEstimatedTotalSize,s=r.getItemSize,i=r.getOffsetForIndexAndAlignment,o=r.getStartIndexForOffset,a=r.getStopIndexForStartIndex,l=r.initInstanceProps,c=r.shouldResetStyleCacheOnItemSizeChange,d=r.validateProps;return e=function(m){cg(h,m);function h(v){var f;return f=m.call(this,v)||this,f._instanceProps=l(f.props,ze._assertThisInitialized(f)),f._outerRef=void 0,f._resetIsScrollingTimeoutId=null,f.state={instance:ze._assertThisInitialized(f),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof f.props.initialScrollOffset=="number"?f.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},f._callOnItemsRendered=void 0,f._callOnItemsRendered=Oo(function(y,x,w,_){return f.props.onItemsRendered({overscanStartIndex:y,overscanStopIndex:x,visibleStartIndex:w,visibleStopIndex:_})}),f._callOnScroll=void 0,f._callOnScroll=Oo(function(y,x,w){return f.props.onScroll({scrollDirection:y,scrollOffset:x,scrollUpdateWasRequested:w})}),f._getItemStyle=void 0,f._getItemStyle=function(y){var x=f.props,w=x.direction,_=x.itemSize,k=x.layout,S=f._getItemStyleCache(c&&_,c&&k,c&&w),D;if(S.hasOwnProperty(y))D=S[y];else{var F=t(f.props,y,f._instanceProps),ae=s(f.props,y,f._instanceProps),ce=w==="horizontal"||k==="horizontal",ge=w==="rtl",b=ce?F:0;S[y]=D={position:"absolute",left:ge?void 0:b,right:ge?b:void 0,top:ce?0:F,height:ce?"100%":ae,width:ce?ae:"100%"}}return D},f._getItemStyleCache=void 0,f._getItemStyleCache=Oo(function(y,x,w){return{}}),f._onScrollHorizontal=function(y){var x=y.currentTarget,w=x.clientWidth,_=x.scrollLeft,k=x.scrollWidth;f.setState(function(S){if(S.scrollOffset===_)return null;var D=f.props.direction,F=_;if(D==="rtl")switch(Ql()){case"negative":F=-_;break;case"positive-descending":F=k-w-_;break}return F=Math.max(0,Math.min(F,k-w)),{isScrolling:!0,scrollDirection:S.scrollOffset<F?"forward":"backward",scrollOffset:F,scrollUpdateWasRequested:!1}},f._resetIsScrollingDebounced)},f._onScrollVertical=function(y){var x=y.currentTarget,w=x.clientHeight,_=x.scrollHeight,k=x.scrollTop;f.setState(function(S){if(S.scrollOffset===k)return null;var D=Math.max(0,Math.min(k,_-w));return{isScrolling:!0,scrollDirection:S.scrollOffset<D?"forward":"backward",scrollOffset:D,scrollUpdateWasRequested:!1}},f._resetIsScrollingDebounced)},f._outerRefSetter=function(y){var x=f.props.outerRef;f._outerRef=y,typeof x=="function"?x(y):x!=null&&typeof x=="object"&&x.hasOwnProperty("current")&&(x.current=y)},f._resetIsScrollingDebounced=function(){f._resetIsScrollingTimeoutId!==null&&Zl(f._resetIsScrollingTimeoutId),f._resetIsScrollingTimeoutId=pg(f._resetIsScrolling,mg)},f._resetIsScrolling=function(){f._resetIsScrollingTimeoutId=null,f.setState({isScrolling:!1},function(){f._getItemStyleCache(-1,null)})},f}h.getDerivedStateFromProps=function(f,y){return yg(f,y),d(f),null};var g=h.prototype;return g.scrollTo=function(f){f=Math.max(0,f),this.setState(function(y){return y.scrollOffset===f?null:{scrollDirection:y.scrollOffset<f?"forward":"backward",scrollOffset:f,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},g.scrollToItem=function(f,y){y===void 0&&(y="auto");var x=this.props,w=x.itemCount,_=x.layout,k=this.state.scrollOffset;f=Math.max(0,Math.min(f,w-1));var S=0;if(this._outerRef){var D=this._outerRef;_==="vertical"?S=D.scrollWidth>D.clientWidth?Xl():0:S=D.scrollHeight>D.clientHeight?Xl():0}this.scrollTo(i(this.props,f,y,k,this._instanceProps,S))},g.componentDidMount=function(){var f=this.props,y=f.direction,x=f.initialScrollOffset,w=f.layout;if(typeof x=="number"&&this._outerRef!=null){var _=this._outerRef;y==="horizontal"||w==="horizontal"?_.scrollLeft=x:_.scrollTop=x}this._callPropsCallbacks()},g.componentDidUpdate=function(){var f=this.props,y=f.direction,x=f.layout,w=this.state,_=w.scrollOffset,k=w.scrollUpdateWasRequested;if(k&&this._outerRef!=null){var S=this._outerRef;if(y==="horizontal"||x==="horizontal")if(y==="rtl")switch(Ql()){case"negative":S.scrollLeft=-_;break;case"positive-ascending":S.scrollLeft=_;break;default:var D=S.clientWidth,F=S.scrollWidth;S.scrollLeft=F-D-_;break}else S.scrollLeft=_;else S.scrollTop=_}this._callPropsCallbacks()},g.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&Zl(this._resetIsScrollingTimeoutId)},g.render=function(){var f=this.props,y=f.children,x=f.className,w=f.direction,_=f.height,k=f.innerRef,S=f.innerElementType,D=f.innerTagName,F=f.itemCount,ae=f.itemData,ce=f.itemKey,ge=ce===void 0?gg:ce,b=f.layout,P=f.outerElementType,A=f.outerTagName,H=f.style,V=f.useIsScrolling,N=f.width,q=this.state.isScrolling,W=w==="horizontal"||b==="horizontal",Z=W?this._onScrollHorizontal:this._onScrollVertical,C=this._getRangeToRender(),L=C[0],$=C[1],K=[];if(F>0)for(var z=L;z<=$;z++)K.push(ee.createElement(y,{data:ae,key:ge(z,ae),index:z,isScrolling:V?q:void 0,style:this._getItemStyle(z)}));var U=n(this.props,this._instanceProps);return ee.createElement(P||A||"div",{className:x,onScroll:Z,ref:this._outerRefSetter,style:ze._extends({position:"relative",height:_,width:N,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:w},H)},ee.createElement(S||D||"div",{children:K,ref:k,style:{height:W?"100%":U,pointerEvents:q?"none":void 0,width:W?U:"100%"}}))},g._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var f=this.props.itemCount;if(f>0){var y=this._getRangeToRender(),x=y[0],w=y[1],_=y[2],k=y[3];this._callOnItemsRendered(x,w,_,k)}}if(typeof this.props.onScroll=="function"){var S=this.state,D=S.scrollDirection,F=S.scrollOffset,ae=S.scrollUpdateWasRequested;this._callOnScroll(D,F,ae)}},g._getRangeToRender=function(){var f=this.props,y=f.itemCount,x=f.overscanCount,w=this.state,_=w.isScrolling,k=w.scrollDirection,S=w.scrollOffset;if(y===0)return[0,0,0,0];var D=o(this.props,S,this._instanceProps),F=a(this.props,D,S,this._instanceProps),ae=!_||k==="backward"?Math.max(1,x):1,ce=!_||k==="forward"?Math.max(1,x):1;return[Math.max(0,D-ae),Math.max(0,Math.min(y-1,F+ce)),D,F]},h}(ee.PureComponent),e.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},e}var yg=function(e,t){var n=e.children,s=e.direction,i=e.height,o=e.layout,a=e.innerTagName,l=e.outerTagName,c=e.width,d=t.instance;if(process.env.NODE_ENV!=="production"){(a!=null||l!=null)&&Ws&&!Ws.has(d)&&(Ws.add(d),console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead."));var m=s==="horizontal"||o==="horizontal";switch(s){case"horizontal":case"vertical":Ks&&!Ks.has(d)&&(Ks.add(d),console.warn('The direction prop should be either "ltr" (default) or "rtl". Please use the layout prop to specify "vertical" (default) or "horizontal" orientation.'));break;case"ltr":case"rtl":break;default:throw Error('An invalid "direction" prop has been specified. Value should be either "ltr" or "rtl". '+('"'+s+'" was specified.'))}switch(o){case"horizontal":case"vertical":break;default:throw Error('An invalid "layout" prop has been specified. Value should be either "horizontal" or "vertical". '+('"'+o+'" was specified.'))}if(n==null)throw Error('An invalid "children" prop has been specified. Value should be a React component. '+('"'+(n===null?"null":typeof n)+'" was specified.'));if(m&&typeof c!="number")throw Error('An invalid "width" prop has been specified. Horizontal lists must specify a number for width. '+('"'+(c===null?"null":typeof c)+'" was specified.'));if(!m&&typeof i!="number")throw Error('An invalid "height" prop has been specified. Vertical lists must specify a number for height. '+('"'+(i===null?"null":typeof i)+'" was specified.'))}},bg=vg({getItemOffset:function(e,t){var n=e.itemSize;return t*n},getItemSize:function(e,t){var n=e.itemSize;return n},getEstimatedTotalSize:function(e){var t=e.itemCount,n=e.itemSize;return n*t},getOffsetForIndexAndAlignment:function(e,t,n,s,i,o){var a=e.direction,l=e.height,c=e.itemCount,d=e.itemSize,m=e.layout,h=e.width,g=a==="horizontal"||m==="horizontal",v=g?h:l,f=Math.max(0,c*d-v),y=Math.min(f,t*d),x=Math.max(0,t*d-v+d+o);switch(n==="smart"&&(s>=x-v&&s<=y+v?n="auto":n="center"),n){case"start":return y;case"end":return x;case"center":{var w=Math.round(x+(y-x)/2);return w<Math.ceil(v/2)?0:w>f+Math.floor(v/2)?f:w}case"auto":default:return s>=x&&s<=y?s:s<x?x:y}},getStartIndexForOffset:function(e,t){var n=e.itemCount,s=e.itemSize;return Math.max(0,Math.min(n-1,Math.floor(t/s)))},getStopIndexForStartIndex:function(e,t,n){var s=e.direction,i=e.height,o=e.itemCount,a=e.itemSize,l=e.layout,c=e.width,d=s==="horizontal"||l==="horizontal",m=t*a,h=d?c:i,g=Math.ceil((h+n-m)/a);return Math.max(0,Math.min(o-1,t+g-1))},initInstanceProps:function(e){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(e){var t=e.itemSize;if(process.env.NODE_ENV!=="production"&&typeof t!="number")throw Error('An invalid "itemSize" prop has been specified. Value should be a number. '+('"'+(t===null?"null":typeof t)+'" was specified.'))}});const xg=rg,Eg=ag,wg=ng,id=R.forwardRef(({className:r,children:e,variant:t="default",...n},s)=>I.jsxRuntimeExports.jsxs(Qh,{ref:s,className:ke.cn("border-border ring-offset-background placeholder:text-muted-foreground focus:ring-offset-none focus:ring-primary flex h-10 w-full items-center justify-between rounded-md border bg-white px-3 py-2 text-sm focus:ring-2 focus:ring-offset-transparent focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 dark:bg-transparent [&>span]:line-clamp-1",t==="failure"&&"focus:ring-destructive hover:bg-destructive/20 bg-destructive/20 border-destructive !text-destructive",r),...n,children:[e,I.jsxRuntimeExports.jsx(sg,{asChild:!0,children:I.jsxRuntimeExports.jsx(vc.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));id.displayName=Qh.displayName;const Qa=R.forwardRef(({className:r,...e},t)=>I.jsxRuntimeExports.jsx(rd,{ref:t,className:ke.cn("flex cursor-default items-center justify-center py-1",r),...e,children:I.jsxRuntimeExports.jsx(ep,{className:"h-4 w-4"})}));Qa.displayName=rd.displayName;const Ja=R.forwardRef(({className:r,...e},t)=>I.jsxRuntimeExports.jsx(nd,{ref:t,className:ke.cn("flex cursor-default items-center justify-center py-1",r),...e,children:I.jsxRuntimeExports.jsx(vc.ChevronDown,{className:"h-4 w-4"})}));Ja.displayName=nd.displayName;const el=R.forwardRef(({className:r,children:e,position:t="popper",...n},s)=>I.jsxRuntimeExports.jsx(ig,{children:I.jsxRuntimeExports.jsxs(Jh,{ref:s,className:ke.cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md",t==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",r),position:t,...n,children:[I.jsxRuntimeExports.jsx(Qa,{}),I.jsxRuntimeExports.jsx(og,{className:ke.cn("p-1",t==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),I.jsxRuntimeExports.jsx(Ja,{})]})}));el.displayName=Jh.displayName;const od=R.forwardRef(({className:r,...e},t)=>I.jsxRuntimeExports.jsx(ed,{ref:t,className:ke.cn("py-1.5 pr-2 pl-8 text-sm font-semibold",r),...e}));od.displayName=ed.displayName;const tl=R.forwardRef(({className:r,children:e,...t},n)=>I.jsxRuntimeExports.jsxs(td,{ref:n,className:ke.cn("focus:bg-accent focus:text-accent-foreground relative flex w-full cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",r),...t,children:[I.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:I.jsxRuntimeExports.jsx(ug,{children:I.jsxRuntimeExports.jsx(yc.Check,{className:"h-4 w-4"})})}),I.jsxRuntimeExports.jsx(lg,{children:e})]}));tl.displayName=td.displayName;const ad=R.forwardRef(({className:r,...e},t)=>I.jsxRuntimeExports.jsx(sd,{ref:t,className:ke.cn("bg-muted -mx-1 my-1 h-px",r),...e}));ad.displayName=sd.displayName;const ld=R.forwardRef(({className:r,options:e,position:t="popper",itemHeight:n=35,maxHeight:s=300,...i},o)=>{const a=ee.useRef(null),l=({index:c,style:d})=>{const m=e[c];return I.jsxRuntimeExports.jsx("div",{style:d,children:I.jsxRuntimeExports.jsx(tl,{value:`${m.value}`,children:m.label})})};return I.jsxRuntimeExports.jsx(el,{ref:o,...i,children:I.jsxRuntimeExports.jsx(bg,{ref:a,height:Math.min(s,e.length*n),itemCount:e.length,itemSize:n,width:"100%",children:l})})});ld.displayName="VirtualizedSelectContent";var rl="Radio",[Sg,ud]=Xe.createContextScope(rl),[_g,Ag]=Sg(rl),cd=R.forwardRef((r,e)=>{const{__scopeRadio:t,name:n,checked:s=!1,required:i,disabled:o,value:a="on",onCheck:l,form:c,...d}=r,[m,h]=R.useState(null),g=Pe.useComposedRefs(e,y=>h(y)),v=R.useRef(!1),f=m?c||!!m.closest("form"):!0;return I.jsxRuntimeExports.jsxs(_g,{scope:t,checked:s,disabled:o,children:[I.jsxRuntimeExports.jsx(Te.Primitive.button,{type:"button",role:"radio","aria-checked":s,"data-state":pd(s),"data-disabled":o?"":void 0,disabled:o,value:a,...d,ref:g,onClick:Ae.composeEventHandlers(r.onClick,y=>{s||l==null||l(),f&&(v.current=y.isPropagationStopped(),v.current||y.stopPropagation())})}),f&&I.jsxRuntimeExports.jsx(fd,{control:m,bubbles:!v.current,name:n,value:a,checked:s,required:i,disabled:o,form:c,style:{transform:"translateX(-100%)"}})]})});cd.displayName=rl;var hd="RadioIndicator",dd=R.forwardRef((r,e)=>{const{__scopeRadio:t,forceMount:n,...s}=r,i=Ag(hd,t);return I.jsxRuntimeExports.jsx(Ae.Presence,{present:n||i.checked,children:I.jsxRuntimeExports.jsx(Te.Primitive.span,{"data-state":pd(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:e})})});dd.displayName=hd;var Cg="RadioBubbleInput",fd=R.forwardRef(({__scopeRadio:r,control:e,checked:t,bubbles:n=!0,...s},i)=>{const o=R.useRef(null),a=Pe.useComposedRefs(o,i),l=hi(t),c=Ut.useSize(e);return R.useEffect(()=>{const d=o.current;if(!d)return;const m=window.HTMLInputElement.prototype,g=Object.getOwnPropertyDescriptor(m,"checked").set;if(l!==t&&g){const v=new Event("click",{bubbles:n});g.call(d,t),d.dispatchEvent(v)}},[l,t,n]),I.jsxRuntimeExports.jsx(Te.Primitive.input,{type:"radio","aria-hidden":!0,defaultChecked:t,...s,tabIndex:-1,ref:a,style:{...s.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});fd.displayName=Cg;function pd(r){return r?"checked":"unchecked"}var kg=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Ai="RadioGroup",[Tg,QE]=Xe.createContextScope(Ai,[ci.createRovingFocusGroupScope,ud]),md=ci.createRovingFocusGroupScope(),gd=ud(),[Ng,Rg]=Tg(Ai),vd=R.forwardRef((r,e)=>{const{__scopeRadioGroup:t,name:n,defaultValue:s,value:i,required:o=!1,disabled:a=!1,orientation:l,dir:c,loop:d=!0,onValueChange:m,...h}=r,g=md(t),v=gc.useDirection(c),[f,y]=er.useControllableState({prop:i,defaultProp:s??null,onChange:m,caller:Ai});return I.jsxRuntimeExports.jsx(Ng,{scope:t,name:n,required:o,disabled:a,value:f,onValueChange:y,children:I.jsxRuntimeExports.jsx(ci.Root,{asChild:!0,...g,orientation:l,dir:v,loop:d,children:I.jsxRuntimeExports.jsx(Te.Primitive.div,{role:"radiogroup","aria-required":o,"aria-orientation":l,"data-disabled":a?"":void 0,dir:v,...h,ref:e})})})});vd.displayName=Ai;var yd="RadioGroupItem",bd=R.forwardRef((r,e)=>{const{__scopeRadioGroup:t,disabled:n,...s}=r,i=Rg(yd,t),o=i.disabled||n,a=md(t),l=gd(t),c=R.useRef(null),d=Pe.useComposedRefs(e,c),m=i.value===s.value,h=R.useRef(!1);return R.useEffect(()=>{const g=f=>{kg.includes(f.key)&&(h.current=!0)},v=()=>h.current=!1;return document.addEventListener("keydown",g),document.addEventListener("keyup",v),()=>{document.removeEventListener("keydown",g),document.removeEventListener("keyup",v)}},[]),I.jsxRuntimeExports.jsx(ci.Item,{asChild:!0,...a,focusable:!o,active:m,children:I.jsxRuntimeExports.jsx(cd,{disabled:o,required:i.required,checked:m,...l,...s,name:i.name,ref:d,onCheck:()=>i.onValueChange(s.value),onKeyDown:Ae.composeEventHandlers(g=>{g.key==="Enter"&&g.preventDefault()}),onFocus:Ae.composeEventHandlers(s.onFocus,()=>{var g;h.current&&((g=c.current)==null||g.click())})})})});bd.displayName=yd;var Ig="RadioGroupIndicator",xd=R.forwardRef((r,e)=>{const{__scopeRadioGroup:t,...n}=r,s=gd(t);return I.jsxRuntimeExports.jsx(dd,{...s,...n,ref:e})});xd.displayName=Ig;var Ed=vd,wd=bd,Og=xd;const Sd=R.forwardRef(({className:r,...e},t)=>I.jsxRuntimeExports.jsx(Ed,{className:ke.cn("grid gap-2",r),...e,ref:t}));Sd.displayName=Ed.displayName;const _d=R.forwardRef(({className:r,...e},t)=>I.jsxRuntimeExports.jsx(wd,{ref:t,className:ke.cn("border-primary text-primary ring-offset-background focus-visible:ring-ring aspect-square h-4 w-4 rounded-full border focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",r),...e,children:I.jsxRuntimeExports.jsx(Og,{className:"flex items-center justify-center",children:I.jsxRuntimeExports.jsx(yc.Circle,{className:"h-2.5 w-2.5 fill-current text-current"})})}));_d.displayName=wd.displayName;var Ad=typeof global=="object"&&global&&global.Object===Object&&global,Lg=typeof self=="object"&&self&&self.Object===Object&&self,Rt=Ad||Lg||Function("return this")(),sr=Rt.Symbol,Cd=Object.prototype,Mg=Cd.hasOwnProperty,Dg=Cd.toString,Ln=sr?sr.toStringTag:void 0;function Pg(r){var e=Mg.call(r,Ln),t=r[Ln];try{r[Ln]=void 0;var n=!0}catch{}var s=Dg.call(r);return n&&(e?r[Ln]=t:delete r[Ln]),s}var Bg=Object.prototype,qg=Bg.toString;function Fg(r){return qg.call(r)}var jg="[object Null]",Vg="[object Undefined]",Jl=sr?sr.toStringTag:void 0;function vn(r){return r==null?r===void 0?Vg:jg:Jl&&Jl in Object(r)?Pg(r):Fg(r)}function Ft(r){return r!=null&&typeof r=="object"}var Ar=Array.isArray;function ar(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}function kd(r){return r}var $g="[object AsyncFunction]",Ug="[object Function]",Hg="[object GeneratorFunction]",zg="[object Proxy]";function nl(r){if(!ar(r))return!1;var e=vn(r);return e==Ug||e==Hg||e==$g||e==zg}var Mo=Rt["__core-js_shared__"],eu=function(){var r=/[^.]+$/.exec(Mo&&Mo.keys&&Mo.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function Gg(r){return!!eu&&eu in r}var Kg=Function.prototype,Wg=Kg.toString;function Tr(r){if(r!=null){try{return Wg.call(r)}catch{}try{return r+""}catch{}}return""}var Yg=/[\\^$.*+?()[\]{}|]/g,Zg=/^\[object .+?Constructor\]$/,Xg=Function.prototype,Qg=Object.prototype,Jg=Xg.toString,e0=Qg.hasOwnProperty,t0=RegExp("^"+Jg.call(e0).replace(Yg,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function r0(r){if(!ar(r)||Gg(r))return!1;var e=nl(r)?t0:Zg;return e.test(Tr(r))}function n0(r,e){return r==null?void 0:r[e]}function Nr(r,e){var t=n0(r,e);return r0(t)?t:void 0}var ma=Nr(Rt,"WeakMap"),tu=Object.create,s0=function(){function r(){}return function(e){if(!ar(e))return{};if(tu)return tu(e);r.prototype=e;var t=new r;return r.prototype=void 0,t}}();function i0(r,e,t){switch(t.length){case 0:return r.call(e);case 1:return r.call(e,t[0]);case 2:return r.call(e,t[0],t[1]);case 3:return r.call(e,t[0],t[1],t[2])}return r.apply(e,t)}function o0(r,e){var t=-1,n=r.length;for(e||(e=Array(n));++t<n;)e[t]=r[t];return e}var a0=800,l0=16,u0=Date.now;function c0(r){var e=0,t=0;return function(){var n=u0(),s=l0-(n-t);if(t=n,s>0){if(++e>=a0)return arguments[0]}else e=0;return r.apply(void 0,arguments)}}function h0(r){return function(){return r}}var si=function(){try{var r=Nr(Object,"defineProperty");return r({},"",{}),r}catch{}}(),d0=si?function(r,e){return si(r,"toString",{configurable:!0,enumerable:!1,value:h0(e),writable:!0})}:kd,f0=c0(d0);function p0(r,e){for(var t=-1,n=r==null?0:r.length;++t<n&&e(r[t],t,r)!==!1;);return r}var m0=9007199254740991,g0=/^(?:0|[1-9]\d*)$/;function Td(r,e){var t=typeof r;return e=e??m0,!!e&&(t=="number"||t!="symbol"&&g0.test(r))&&r>-1&&r%1==0&&r<e}function sl(r,e,t){e=="__proto__"&&si?si(r,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):r[e]=t}function rs(r,e){return r===e||r!==r&&e!==e}var v0=Object.prototype,y0=v0.hasOwnProperty;function Nd(r,e,t){var n=r[e];(!(y0.call(r,e)&&rs(n,t))||t===void 0&&!(e in r))&&sl(r,e,t)}function b0(r,e,t,n){var s=!t;t||(t={});for(var i=-1,o=e.length;++i<o;){var a=e[i],l=void 0;l===void 0&&(l=r[a]),s?sl(t,a,l):Nd(t,a,l)}return t}var ru=Math.max;function x0(r,e,t){return e=ru(e===void 0?r.length-1:e,0),function(){for(var n=arguments,s=-1,i=ru(n.length-e,0),o=Array(i);++s<i;)o[s]=n[e+s];s=-1;for(var a=Array(e+1);++s<e;)a[s]=n[s];return a[e]=t(o),i0(r,this,a)}}function E0(r,e){return f0(x0(r,e,kd),r+"")}var w0=9007199254740991;function Rd(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=w0}function Ci(r){return r!=null&&Rd(r.length)&&!nl(r)}function S0(r,e,t){if(!ar(t))return!1;var n=typeof e;return(n=="number"?Ci(t)&&Td(e,t.length):n=="string"&&e in t)?rs(t[e],r):!1}function _0(r){return E0(function(e,t){var n=-1,s=t.length,i=s>1?t[s-1]:void 0,o=s>2?t[2]:void 0;for(i=r.length>3&&typeof i=="function"?(s--,i):void 0,o&&S0(t[0],t[1],o)&&(i=s<3?void 0:i,s=1),e=Object(e);++n<s;){var a=t[n];a&&r(e,a,n,i)}return e})}var A0=Object.prototype;function il(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||A0;return r===t}function C0(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}var k0="[object Arguments]";function nu(r){return Ft(r)&&vn(r)==k0}var Id=Object.prototype,T0=Id.hasOwnProperty,N0=Id.propertyIsEnumerable,ga=nu(function(){return arguments}())?nu:function(r){return Ft(r)&&T0.call(r,"callee")&&!N0.call(r,"callee")};function R0(){return!1}var Od=typeof exports=="object"&&exports&&!exports.nodeType&&exports,su=Od&&typeof module=="object"&&module&&!module.nodeType&&module,I0=su&&su.exports===Od,iu=I0?Rt.Buffer:void 0,O0=iu?iu.isBuffer:void 0,Kn=O0||R0,L0="[object Arguments]",M0="[object Array]",D0="[object Boolean]",P0="[object Date]",B0="[object Error]",q0="[object Function]",F0="[object Map]",j0="[object Number]",V0="[object Object]",$0="[object RegExp]",U0="[object Set]",H0="[object String]",z0="[object WeakMap]",G0="[object ArrayBuffer]",K0="[object DataView]",W0="[object Float32Array]",Y0="[object Float64Array]",Z0="[object Int8Array]",X0="[object Int16Array]",Q0="[object Int32Array]",J0="[object Uint8Array]",e1="[object Uint8ClampedArray]",t1="[object Uint16Array]",r1="[object Uint32Array]",_e={};_e[W0]=_e[Y0]=_e[Z0]=_e[X0]=_e[Q0]=_e[J0]=_e[e1]=_e[t1]=_e[r1]=!0;_e[L0]=_e[M0]=_e[G0]=_e[D0]=_e[K0]=_e[P0]=_e[B0]=_e[q0]=_e[F0]=_e[j0]=_e[V0]=_e[$0]=_e[U0]=_e[H0]=_e[z0]=!1;function n1(r){return Ft(r)&&Rd(r.length)&&!!_e[vn(r)]}function ol(r){return function(e){return r(e)}}var Ld=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Un=Ld&&typeof module=="object"&&module&&!module.nodeType&&module,s1=Un&&Un.exports===Ld,Do=s1&&Ad.process,un=function(){try{var r=Un&&Un.require&&Un.require("util").types;return r||Do&&Do.binding&&Do.binding("util")}catch{}}(),ou=un&&un.isTypedArray,al=ou?ol(ou):n1,i1=Object.prototype,o1=i1.hasOwnProperty;function Md(r,e){var t=Ar(r),n=!t&&ga(r),s=!t&&!n&&Kn(r),i=!t&&!n&&!s&&al(r),o=t||n||s||i,a=o?C0(r.length,String):[],l=a.length;for(var c in r)(e||o1.call(r,c))&&!(o&&(c=="length"||s&&(c=="offset"||c=="parent")||i&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Td(c,l)))&&a.push(c);return a}function Dd(r,e){return function(t){return r(e(t))}}var a1=Dd(Object.keys,Object),l1=Object.prototype,u1=l1.hasOwnProperty;function c1(r){if(!il(r))return a1(r);var e=[];for(var t in Object(r))u1.call(r,t)&&t!="constructor"&&e.push(t);return e}function h1(r){return Ci(r)?Md(r):c1(r)}function d1(r){var e=[];if(r!=null)for(var t in Object(r))e.push(t);return e}var f1=Object.prototype,p1=f1.hasOwnProperty;function m1(r){if(!ar(r))return d1(r);var e=il(r),t=[];for(var n in r)n=="constructor"&&(e||!p1.call(r,n))||t.push(n);return t}function Pd(r){return Ci(r)?Md(r,!0):m1(r)}var Wn=Nr(Object,"create");function g1(){this.__data__=Wn?Wn(null):{},this.size=0}function v1(r){var e=this.has(r)&&delete this.__data__[r];return this.size-=e?1:0,e}var y1="__lodash_hash_undefined__",b1=Object.prototype,x1=b1.hasOwnProperty;function E1(r){var e=this.__data__;if(Wn){var t=e[r];return t===y1?void 0:t}return x1.call(e,r)?e[r]:void 0}var w1=Object.prototype,S1=w1.hasOwnProperty;function _1(r){var e=this.__data__;return Wn?e[r]!==void 0:S1.call(e,r)}var A1="__lodash_hash_undefined__";function C1(r,e){var t=this.__data__;return this.size+=this.has(r)?0:1,t[r]=Wn&&e===void 0?A1:e,this}function Cr(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}Cr.prototype.clear=g1;Cr.prototype.delete=v1;Cr.prototype.get=E1;Cr.prototype.has=_1;Cr.prototype.set=C1;function k1(){this.__data__=[],this.size=0}function ki(r,e){for(var t=r.length;t--;)if(rs(r[t][0],e))return t;return-1}var T1=Array.prototype,N1=T1.splice;function R1(r){var e=this.__data__,t=ki(e,r);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():N1.call(e,t,1),--this.size,!0}function I1(r){var e=this.__data__,t=ki(e,r);return t<0?void 0:e[t][1]}function O1(r){return ki(this.__data__,r)>-1}function L1(r,e){var t=this.__data__,n=ki(t,r);return n<0?(++this.size,t.push([r,e])):t[n][1]=e,this}function Ht(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}Ht.prototype.clear=k1;Ht.prototype.delete=R1;Ht.prototype.get=I1;Ht.prototype.has=O1;Ht.prototype.set=L1;var Yn=Nr(Rt,"Map");function M1(){this.size=0,this.__data__={hash:new Cr,map:new(Yn||Ht),string:new Cr}}function D1(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}function Ti(r,e){var t=r.__data__;return D1(e)?t[typeof e=="string"?"string":"hash"]:t.map}function P1(r){var e=Ti(this,r).delete(r);return this.size-=e?1:0,e}function B1(r){return Ti(this,r).get(r)}function q1(r){return Ti(this,r).has(r)}function F1(r,e){var t=Ti(this,r),n=t.size;return t.set(r,e),this.size+=t.size==n?0:1,this}function Rr(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}Rr.prototype.clear=M1;Rr.prototype.delete=P1;Rr.prototype.get=B1;Rr.prototype.has=q1;Rr.prototype.set=F1;function j1(r,e){for(var t=-1,n=e.length,s=r.length;++t<n;)r[s+t]=e[t];return r}var Bd=Dd(Object.getPrototypeOf,Object),V1="[object Object]",$1=Function.prototype,U1=Object.prototype,qd=$1.toString,H1=U1.hasOwnProperty,z1=qd.call(Object);function G1(r){if(!Ft(r)||vn(r)!=V1)return!1;var e=Bd(r);if(e===null)return!0;var t=H1.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&qd.call(t)==z1}function K1(){this.__data__=new Ht,this.size=0}function W1(r){var e=this.__data__,t=e.delete(r);return this.size=e.size,t}function Y1(r){return this.__data__.get(r)}function Z1(r){return this.__data__.has(r)}var X1=200;function Q1(r,e){var t=this.__data__;if(t instanceof Ht){var n=t.__data__;if(!Yn||n.length<X1-1)return n.push([r,e]),this.size=++t.size,this;t=this.__data__=new Rr(n)}return t.set(r,e),this.size=t.size,this}function Ct(r){var e=this.__data__=new Ht(r);this.size=e.size}Ct.prototype.clear=K1;Ct.prototype.delete=W1;Ct.prototype.get=Y1;Ct.prototype.has=Z1;Ct.prototype.set=Q1;var Fd=typeof exports=="object"&&exports&&!exports.nodeType&&exports,au=Fd&&typeof module=="object"&&module&&!module.nodeType&&module,J1=au&&au.exports===Fd,lu=J1?Rt.Buffer:void 0,uu=lu?lu.allocUnsafe:void 0;function jd(r,e){if(e)return r.slice();var t=r.length,n=uu?uu(t):new r.constructor(t);return r.copy(n),n}function ev(r,e){for(var t=-1,n=r==null?0:r.length,s=0,i=[];++t<n;){var o=r[t];e(o,t,r)&&(i[s++]=o)}return i}function tv(){return[]}var rv=Object.prototype,nv=rv.propertyIsEnumerable,cu=Object.getOwnPropertySymbols,sv=cu?function(r){return r==null?[]:(r=Object(r),ev(cu(r),function(e){return nv.call(r,e)}))}:tv;function iv(r,e,t){var n=e(r);return Ar(r)?n:j1(n,t(r))}function va(r){return iv(r,h1,sv)}var ya=Nr(Rt,"DataView"),ba=Nr(Rt,"Promise"),xa=Nr(Rt,"Set"),hu="[object Map]",ov="[object Object]",du="[object Promise]",fu="[object Set]",pu="[object WeakMap]",mu="[object DataView]",av=Tr(ya),lv=Tr(Yn),uv=Tr(ba),cv=Tr(xa),hv=Tr(ma),ht=vn;(ya&&ht(new ya(new ArrayBuffer(1)))!=mu||Yn&&ht(new Yn)!=hu||ba&&ht(ba.resolve())!=du||xa&&ht(new xa)!=fu||ma&&ht(new ma)!=pu)&&(ht=function(r){var e=vn(r),t=e==ov?r.constructor:void 0,n=t?Tr(t):"";if(n)switch(n){case av:return mu;case lv:return hu;case uv:return du;case cv:return fu;case hv:return pu}return e});var dv=Object.prototype,fv=dv.hasOwnProperty;function pv(r){var e=r.length,t=new r.constructor(e);return e&&typeof r[0]=="string"&&fv.call(r,"index")&&(t.index=r.index,t.input=r.input),t}var ii=Rt.Uint8Array;function ll(r){var e=new r.constructor(r.byteLength);return new ii(e).set(new ii(r)),e}function mv(r,e){var t=ll(r.buffer);return new r.constructor(t,r.byteOffset,r.byteLength)}var gv=/\w*$/;function vv(r){var e=new r.constructor(r.source,gv.exec(r));return e.lastIndex=r.lastIndex,e}var gu=sr?sr.prototype:void 0,vu=gu?gu.valueOf:void 0;function yv(r){return vu?Object(vu.call(r)):{}}function Vd(r,e){var t=e?ll(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.length)}var bv="[object Boolean]",xv="[object Date]",Ev="[object Map]",wv="[object Number]",Sv="[object RegExp]",_v="[object Set]",Av="[object String]",Cv="[object Symbol]",kv="[object ArrayBuffer]",Tv="[object DataView]",Nv="[object Float32Array]",Rv="[object Float64Array]",Iv="[object Int8Array]",Ov="[object Int16Array]",Lv="[object Int32Array]",Mv="[object Uint8Array]",Dv="[object Uint8ClampedArray]",Pv="[object Uint16Array]",Bv="[object Uint32Array]";function qv(r,e,t){var n=r.constructor;switch(e){case kv:return ll(r);case bv:case xv:return new n(+r);case Tv:return mv(r);case Nv:case Rv:case Iv:case Ov:case Lv:case Mv:case Dv:case Pv:case Bv:return Vd(r,t);case Ev:return new n;case wv:case Av:return new n(r);case Sv:return vv(r);case _v:return new n;case Cv:return yv(r)}}function $d(r){return typeof r.constructor=="function"&&!il(r)?s0(Bd(r)):{}}var Fv="[object Map]";function jv(r){return Ft(r)&&ht(r)==Fv}var yu=un&&un.isMap,Vv=yu?ol(yu):jv,$v="[object Set]";function Uv(r){return Ft(r)&&ht(r)==$v}var bu=un&&un.isSet,Hv=bu?ol(bu):Uv,zv=1,Ud="[object Arguments]",Gv="[object Array]",Kv="[object Boolean]",Wv="[object Date]",Yv="[object Error]",Hd="[object Function]",Zv="[object GeneratorFunction]",Xv="[object Map]",Qv="[object Number]",zd="[object Object]",Jv="[object RegExp]",ey="[object Set]",ty="[object String]",ry="[object Symbol]",ny="[object WeakMap]",sy="[object ArrayBuffer]",iy="[object DataView]",oy="[object Float32Array]",ay="[object Float64Array]",ly="[object Int8Array]",uy="[object Int16Array]",cy="[object Int32Array]",hy="[object Uint8Array]",dy="[object Uint8ClampedArray]",fy="[object Uint16Array]",py="[object Uint32Array]",we={};we[Ud]=we[Gv]=we[sy]=we[iy]=we[Kv]=we[Wv]=we[oy]=we[ay]=we[ly]=we[uy]=we[cy]=we[Xv]=we[Qv]=we[zd]=we[Jv]=we[ey]=we[ty]=we[ry]=we[hy]=we[dy]=we[fy]=we[py]=!0;we[Yv]=we[Hd]=we[ny]=!1;function Ys(r,e,t,n,s,i){var o,a=e&zv;if(o!==void 0)return o;if(!ar(r))return r;var l=Ar(r);if(l)o=pv(r);else{var c=ht(r),d=c==Hd||c==Zv;if(Kn(r))return jd(r,a);if(c==zd||c==Ud||d&&!s)o=d?{}:$d(r);else{if(!we[c])return s?r:{};o=qv(r,c,a)}}i||(i=new Ct);var m=i.get(r);if(m)return m;i.set(r,o),Hv(r)?r.forEach(function(v){o.add(Ys(v,e,t,v,r,i))}):Vv(r)&&r.forEach(function(v,f){o.set(f,Ys(v,e,t,f,r,i))});var h=va,g=l?void 0:h(r);return p0(g||r,function(v,f){g&&(f=v,v=r[f]),Nd(o,f,Ys(v,e,t,f,r,i))}),o}var my=1,gy=4;function Jr(r){return Ys(r,my|gy)}var vy="__lodash_hash_undefined__";function yy(r){return this.__data__.set(r,vy),this}function by(r){return this.__data__.has(r)}function oi(r){var e=-1,t=r==null?0:r.length;for(this.__data__=new Rr;++e<t;)this.add(r[e])}oi.prototype.add=oi.prototype.push=yy;oi.prototype.has=by;function xy(r,e){for(var t=-1,n=r==null?0:r.length;++t<n;)if(e(r[t],t,r))return!0;return!1}function Ey(r,e){return r.has(e)}var wy=1,Sy=2;function Gd(r,e,t,n,s,i){var o=t&wy,a=r.length,l=e.length;if(a!=l&&!(o&&l>a))return!1;var c=i.get(r),d=i.get(e);if(c&&d)return c==e&&d==r;var m=-1,h=!0,g=t&Sy?new oi:void 0;for(i.set(r,e),i.set(e,r);++m<a;){var v=r[m],f=e[m];if(n)var y=o?n(f,v,m,e,r,i):n(v,f,m,r,e,i);if(y!==void 0){if(y)continue;h=!1;break}if(g){if(!xy(e,function(x,w){if(!Ey(g,w)&&(v===x||s(v,x,t,n,i)))return g.push(w)})){h=!1;break}}else if(!(v===f||s(v,f,t,n,i))){h=!1;break}}return i.delete(r),i.delete(e),h}function _y(r){var e=-1,t=Array(r.size);return r.forEach(function(n,s){t[++e]=[s,n]}),t}function Ay(r){var e=-1,t=Array(r.size);return r.forEach(function(n){t[++e]=n}),t}var Cy=1,ky=2,Ty="[object Boolean]",Ny="[object Date]",Ry="[object Error]",Iy="[object Map]",Oy="[object Number]",Ly="[object RegExp]",My="[object Set]",Dy="[object String]",Py="[object Symbol]",By="[object ArrayBuffer]",qy="[object DataView]",xu=sr?sr.prototype:void 0,Po=xu?xu.valueOf:void 0;function Fy(r,e,t,n,s,i,o){switch(t){case qy:if(r.byteLength!=e.byteLength||r.byteOffset!=e.byteOffset)return!1;r=r.buffer,e=e.buffer;case By:return!(r.byteLength!=e.byteLength||!i(new ii(r),new ii(e)));case Ty:case Ny:case Oy:return rs(+r,+e);case Ry:return r.name==e.name&&r.message==e.message;case Ly:case Dy:return r==e+"";case Iy:var a=_y;case My:var l=n&Cy;if(a||(a=Ay),r.size!=e.size&&!l)return!1;var c=o.get(r);if(c)return c==e;n|=ky,o.set(r,e);var d=Gd(a(r),a(e),n,s,i,o);return o.delete(r),d;case Py:if(Po)return Po.call(r)==Po.call(e)}return!1}var jy=1,Vy=Object.prototype,$y=Vy.hasOwnProperty;function Uy(r,e,t,n,s,i){var o=t&jy,a=va(r),l=a.length,c=va(e),d=c.length;if(l!=d&&!o)return!1;for(var m=l;m--;){var h=a[m];if(!(o?h in e:$y.call(e,h)))return!1}var g=i.get(r),v=i.get(e);if(g&&v)return g==e&&v==r;var f=!0;i.set(r,e),i.set(e,r);for(var y=o;++m<l;){h=a[m];var x=r[h],w=e[h];if(n)var _=o?n(w,x,h,e,r,i):n(x,w,h,r,e,i);if(!(_===void 0?x===w||s(x,w,t,n,i):_)){f=!1;break}y||(y=h=="constructor")}if(f&&!y){var k=r.constructor,S=e.constructor;k!=S&&"constructor"in r&&"constructor"in e&&!(typeof k=="function"&&k instanceof k&&typeof S=="function"&&S instanceof S)&&(f=!1)}return i.delete(r),i.delete(e),f}var Hy=1,Eu="[object Arguments]",wu="[object Array]",Ns="[object Object]",zy=Object.prototype,Su=zy.hasOwnProperty;function Gy(r,e,t,n,s,i){var o=Ar(r),a=Ar(e),l=o?wu:ht(r),c=a?wu:ht(e);l=l==Eu?Ns:l,c=c==Eu?Ns:c;var d=l==Ns,m=c==Ns,h=l==c;if(h&&Kn(r)){if(!Kn(e))return!1;o=!0,d=!1}if(h&&!d)return i||(i=new Ct),o||al(r)?Gd(r,e,t,n,s,i):Fy(r,e,l,t,n,s,i);if(!(t&Hy)){var g=d&&Su.call(r,"__wrapped__"),v=m&&Su.call(e,"__wrapped__");if(g||v){var f=g?r.value():r,y=v?e.value():e;return i||(i=new Ct),s(f,y,t,n,i)}}return h?(i||(i=new Ct),Uy(r,e,t,n,s,i)):!1}function Kd(r,e,t,n,s){return r===e?!0:r==null||e==null||!Ft(r)&&!Ft(e)?r!==r&&e!==e:Gy(r,e,t,n,Kd,s)}function Ky(r){return function(e,t,n){for(var s=-1,i=Object(e),o=n(e),a=o.length;a--;){var l=o[++s];if(t(i[l],l,i)===!1)break}return e}}var Wy=Ky();function Ea(r,e,t){(t!==void 0&&!rs(r[e],t)||t===void 0&&!(e in r))&&sl(r,e,t)}function Yy(r){return Ft(r)&&Ci(r)}function wa(r,e){if(!(e==="constructor"&&typeof r[e]=="function")&&e!="__proto__")return r[e]}function Zy(r){return b0(r,Pd(r))}function Xy(r,e,t,n,s,i,o){var a=wa(r,t),l=wa(e,t),c=o.get(l);if(c){Ea(r,t,c);return}var d=i?i(a,l,t+"",r,e,o):void 0,m=d===void 0;if(m){var h=Ar(l),g=!h&&Kn(l),v=!h&&!g&&al(l);d=l,h||g||v?Ar(a)?d=a:Yy(a)?d=o0(a):g?(m=!1,d=jd(l,!0)):v?(m=!1,d=Vd(l,!0)):d=[]:G1(l)||ga(l)?(d=a,ga(a)?d=Zy(a):(!ar(a)||nl(a))&&(d=$d(l))):m=!1}m&&(o.set(l,d),s(d,l,n,i,o),o.delete(l)),Ea(r,t,d)}function Wd(r,e,t,n,s){r!==e&&Wy(e,function(i,o){if(s||(s=new Ct),ar(i))Xy(r,e,o,t,Wd,n,s);else{var a=n?n(wa(r,o),i,o+"",r,e,s):void 0;a===void 0&&(a=i),Ea(r,o,a)}},Pd)}function Xt(r,e){return Kd(r,e)}var rr=_0(function(r,e,t){Wd(r,e,t)}),ne=(r=>(r[r.TYPE=3]="TYPE",r[r.LEVEL=12]="LEVEL",r[r.ATTRIBUTE=13]="ATTRIBUTE",r[r.BLOT=14]="BLOT",r[r.INLINE=7]="INLINE",r[r.BLOCK=11]="BLOCK",r[r.BLOCK_BLOT=10]="BLOCK_BLOT",r[r.INLINE_BLOT=6]="INLINE_BLOT",r[r.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",r[r.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",r[r.ANY=15]="ANY",r))(ne||{});class Tt{constructor(e,t,n={}){this.attrName=e,this.keyName=t;const s=ne.TYPE&ne.ATTRIBUTE;this.scope=n.scope!=null?n.scope&ne.LEVEL|s:ne.ATTRIBUTE,n.whitelist!=null&&(this.whitelist=n.whitelist)}static keys(e){return Array.from(e.attributes).map(t=>t.name)}add(e,t){return this.canAdd(e,t)?(e.setAttribute(this.keyName,t),!0):!1}canAdd(e,t){return this.whitelist==null?!0:typeof t=="string"?this.whitelist.indexOf(t.replace(/["']/g,""))>-1:this.whitelist.indexOf(t)>-1}remove(e){e.removeAttribute(this.keyName)}value(e){const t=e.getAttribute(this.keyName);return this.canAdd(e,t)&&t?t:""}}class en extends Error{constructor(e){e="[Parchment] "+e,super(e),this.message=e,this.name=this.constructor.name}}const Yd=class Sa{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(e,t=!1){if(e==null)return null;if(this.blots.has(e))return this.blots.get(e)||null;if(t){let n=null;try{n=e.parentNode}catch{return null}return this.find(n,t)}return null}create(e,t,n){const s=this.query(t);if(s==null)throw new en(`Unable to create ${t} blot`);const i=s,o=t instanceof Node||t.nodeType===Node.TEXT_NODE?t:i.create(n),a=new i(e,o,n);return Sa.blots.set(a.domNode,a),a}find(e,t=!1){return Sa.find(e,t)}query(e,t=ne.ANY){let n;return typeof e=="string"?n=this.types[e]||this.attributes[e]:e instanceof Text||e.nodeType===Node.TEXT_NODE?n=this.types.text:typeof e=="number"?e&ne.LEVEL&ne.BLOCK?n=this.types.block:e&ne.LEVEL&ne.INLINE&&(n=this.types.inline):e instanceof Element&&((e.getAttribute("class")||"").split(/\s+/).some(s=>(n=this.classes[s],!!n)),n=n||this.tags[e.tagName]),n==null?null:"scope"in n&&t&ne.LEVEL&n.scope&&t&ne.TYPE&n.scope?n:null}register(...e){return e.map(t=>{const n="blotName"in t,s="attrName"in t;if(!n&&!s)throw new en("Invalid definition");if(n&&t.blotName==="abstract")throw new en("Cannot register abstract class");const i=n?t.blotName:s?t.attrName:void 0;return this.types[i]=t,s?typeof t.keyName=="string"&&(this.attributes[t.keyName]=t):n&&(t.className&&(this.classes[t.className]=t),t.tagName&&(Array.isArray(t.tagName)?t.tagName=t.tagName.map(o=>o.toUpperCase()):t.tagName=t.tagName.toUpperCase(),(Array.isArray(t.tagName)?t.tagName:[t.tagName]).forEach(o=>{(this.tags[o]==null||t.className==null)&&(this.tags[o]=t)}))),t})}};Yd.blots=new WeakMap;let cn=Yd;function _u(r,e){return(r.getAttribute("class")||"").split(/\s+/).filter(t=>t.indexOf(`${e}-`)===0)}class Qy extends Tt{static keys(e){return(e.getAttribute("class")||"").split(/\s+/).map(t=>t.split("-").slice(0,-1).join("-"))}add(e,t){return this.canAdd(e,t)?(this.remove(e),e.classList.add(`${this.keyName}-${t}`),!0):!1}remove(e){_u(e,this.keyName).forEach(t=>{e.classList.remove(t)}),e.classList.length===0&&e.removeAttribute("class")}value(e){const t=(_u(e,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(e,t)?t:""}}const gt=Qy;function Bo(r){const e=r.split("-"),t=e.slice(1).map(n=>n[0].toUpperCase()+n.slice(1)).join("");return e[0]+t}class Jy extends Tt{static keys(e){return(e.getAttribute("style")||"").split(";").map(t=>t.split(":")[0].trim())}add(e,t){return this.canAdd(e,t)?(e.style[Bo(this.keyName)]=t,!0):!1}remove(e){e.style[Bo(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")}value(e){const t=e.style[Bo(this.keyName)];return this.canAdd(e,t)?t:""}}const lr=Jy;class eb{constructor(e){this.attributes={},this.domNode=e,this.build()}attribute(e,t){t?e.add(this.domNode,t)&&(e.value(this.domNode)!=null?this.attributes[e.attrName]=e:delete this.attributes[e.attrName]):(e.remove(this.domNode),delete this.attributes[e.attrName])}build(){this.attributes={};const e=cn.find(this.domNode);if(e==null)return;const t=Tt.keys(this.domNode),n=gt.keys(this.domNode),s=lr.keys(this.domNode);t.concat(n).concat(s).forEach(i=>{const o=e.scroll.query(i,ne.ATTRIBUTE);o instanceof Tt&&(this.attributes[o.attrName]=o)})}copy(e){Object.keys(this.attributes).forEach(t=>{const n=this.attributes[t].value(this.domNode);e.format(t,n)})}move(e){this.copy(e),Object.keys(this.attributes).forEach(t=>{this.attributes[t].remove(this.domNode)}),this.attributes={}}values(){return Object.keys(this.attributes).reduce((e,t)=>(e[t]=this.attributes[t].value(this.domNode),e),{})}}const Ni=eb,Zd=class{constructor(e,t){this.scroll=e,this.domNode=t,cn.blots.set(t,this),this.prev=null,this.next=null}static create(e){if(this.tagName==null)throw new en("Blot definition missing tagName");let t,n;return Array.isArray(this.tagName)?(typeof e=="string"?(n=e.toUpperCase(),parseInt(n,10).toString()===n&&(n=parseInt(n,10))):typeof e=="number"&&(n=e),typeof n=="number"?t=document.createElement(this.tagName[n-1]):n&&this.tagName.indexOf(n)>-1?t=document.createElement(n):t=document.createElement(this.tagName[0])):t=document.createElement(this.tagName),this.className&&t.classList.add(this.className),t}get statics(){return this.constructor}attach(){}clone(){const e=this.domNode.cloneNode(!1);return this.scroll.create(e)}detach(){this.parent!=null&&this.parent.removeChild(this),cn.blots.delete(this.domNode)}deleteAt(e,t){this.isolate(e,t).remove()}formatAt(e,t,n,s){const i=this.isolate(e,t);if(this.scroll.query(n,ne.BLOT)!=null&&s)i.wrap(n,s);else if(this.scroll.query(n,ne.ATTRIBUTE)!=null){const o=this.scroll.create(this.statics.scope);i.wrap(o),o.format(n,s)}}insertAt(e,t,n){const s=n==null?this.scroll.create("text",t):this.scroll.create(t,n),i=this.split(e);this.parent.insertBefore(s,i||void 0)}isolate(e,t){const n=this.split(e);if(n==null)throw new Error("Attempt to isolate at end");return n.split(t),n}length(){return 1}offset(e=this.parent){return this.parent==null||this===e?0:this.parent.children.offset(this)+this.parent.offset(e)}optimize(e){this.statics.requiredContainer&&!(this.parent instanceof this.statics.requiredContainer)&&this.wrap(this.statics.requiredContainer.blotName)}remove(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()}replaceWith(e,t){const n=typeof e=="string"?this.scroll.create(e,t):e;return this.parent!=null&&(this.parent.insertBefore(n,this.next||void 0),this.remove()),n}split(e,t){return e===0?this:this.next}update(e,t){}wrap(e,t){const n=typeof e=="string"?this.scroll.create(e,t):e;if(this.parent!=null&&this.parent.insertBefore(n,this.next||void 0),typeof n.appendChild!="function")throw new en(`Cannot wrap ${e}`);return n.appendChild(this),n}};Zd.blotName="abstract";let Xd=Zd;const Qd=class extends Xd{static value(e){return!0}index(e,t){return this.domNode===e||this.domNode.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(t,1):-1}position(e,t){let n=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return e>0&&(n+=1),[this.parent.domNode,n]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};Qd.scope=ne.INLINE_BLOT;let tb=Qd;const je=tb;class rb{constructor(){this.head=null,this.tail=null,this.length=0}append(...e){if(this.insertBefore(e[0],null),e.length>1){const t=e.slice(1);this.append(...t)}}at(e){const t=this.iterator();let n=t();for(;n&&e>0;)e-=1,n=t();return n}contains(e){const t=this.iterator();let n=t();for(;n;){if(n===e)return!0;n=t()}return!1}indexOf(e){const t=this.iterator();let n=t(),s=0;for(;n;){if(n===e)return s;s+=1,n=t()}return-1}insertBefore(e,t){e!=null&&(this.remove(e),e.next=t,t!=null?(e.prev=t.prev,t.prev!=null&&(t.prev.next=e),t.prev=e,t===this.head&&(this.head=e)):this.tail!=null?(this.tail.next=e,e.prev=this.tail,this.tail=e):(e.prev=null,this.head=this.tail=e),this.length+=1)}offset(e){let t=0,n=this.head;for(;n!=null;){if(n===e)return t;t+=n.length(),n=n.next}return-1}remove(e){this.contains(e)&&(e.prev!=null&&(e.prev.next=e.next),e.next!=null&&(e.next.prev=e.prev),e===this.head&&(this.head=e.next),e===this.tail&&(this.tail=e.prev),this.length-=1)}iterator(e=this.head){return()=>{const t=e;return e!=null&&(e=e.next),t}}find(e,t=!1){const n=this.iterator();let s=n();for(;s;){const i=s.length();if(e<i||t&&e===i&&(s.next==null||s.next.length()!==0))return[s,e];e-=i,s=n()}return[null,0]}forEach(e){const t=this.iterator();let n=t();for(;n;)e(n),n=t()}forEachAt(e,t,n){if(t<=0)return;const[s,i]=this.find(e);let o=e-i;const a=this.iterator(s);let l=a();for(;l&&o<e+t;){const c=l.length();e>o?n(l,e-o,Math.min(t,o+c-e)):n(l,0,Math.min(c,e+t-o)),o+=c,l=a()}}map(e){return this.reduce((t,n)=>(t.push(e(n)),t),[])}reduce(e,t){const n=this.iterator();let s=n();for(;s;)t=e(t,s),s=n();return t}}function Au(r,e){const t=e.find(r);if(t)return t;try{return e.create(r)}catch{const n=e.create(ne.INLINE);return Array.from(r.childNodes).forEach(s=>{n.domNode.appendChild(s)}),r.parentNode&&r.parentNode.replaceChild(n.domNode,r),n.attach(),n}}const Jd=class Zt extends Xd{constructor(e,t){super(e,t),this.uiNode=null,this.build()}appendChild(e){this.insertBefore(e)}attach(){super.attach(),this.children.forEach(e=>{e.attach()})}attachUI(e){this.uiNode!=null&&this.uiNode.remove(),this.uiNode=e,Zt.uiClass&&this.uiNode.classList.add(Zt.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new rb,Array.from(this.domNode.childNodes).filter(e=>e!==this.uiNode).reverse().forEach(e=>{try{const t=Au(e,this.scroll);this.insertBefore(t,this.children.head||void 0)}catch(t){if(t instanceof en)return;throw t}})}deleteAt(e,t){if(e===0&&t===this.length())return this.remove();this.children.forEachAt(e,t,(n,s,i)=>{n.deleteAt(s,i)})}descendant(e,t=0){const[n,s]=this.children.find(t);return e.blotName==null&&e(n)||e.blotName!=null&&n instanceof e?[n,s]:n instanceof Zt?n.descendant(e,s):[null,-1]}descendants(e,t=0,n=Number.MAX_VALUE){let s=[],i=n;return this.children.forEachAt(t,n,(o,a,l)=>{(e.blotName==null&&e(o)||e.blotName!=null&&o instanceof e)&&s.push(o),o instanceof Zt&&(s=s.concat(o.descendants(e,a,i))),i-=l}),s}detach(){this.children.forEach(e=>{e.detach()}),super.detach()}enforceAllowedChildren(){let e=!1;this.children.forEach(t=>{e||this.statics.allowedChildren.some(n=>t instanceof n)||(t.statics.scope===ne.BLOCK_BLOT?(t.next!=null&&this.splitAfter(t),t.prev!=null&&this.splitAfter(t.prev),t.parent.unwrap(),e=!0):t instanceof Zt?t.unwrap():t.remove())})}formatAt(e,t,n,s){this.children.forEachAt(e,t,(i,o,a)=>{i.formatAt(o,a,n,s)})}insertAt(e,t,n){const[s,i]=this.children.find(e);if(s)s.insertAt(i,t,n);else{const o=n==null?this.scroll.create("text",t):this.scroll.create(t,n);this.appendChild(o)}}insertBefore(e,t){e.parent!=null&&e.parent.children.remove(e);let n=null;this.children.insertBefore(e,t||null),e.parent=this,t!=null&&(n=t.domNode),(this.domNode.parentNode!==e.domNode||this.domNode.nextSibling!==n)&&this.domNode.insertBefore(e.domNode,n),e.attach()}length(){return this.children.reduce((e,t)=>e+t.length(),0)}moveChildren(e,t){this.children.forEach(n=>{e.insertBefore(n,t)})}optimize(e){if(super.optimize(e),this.enforceAllowedChildren(),this.uiNode!=null&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),this.children.length===0)if(this.statics.defaultChild!=null){const t=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(t)}else this.remove()}path(e,t=!1){const[n,s]=this.children.find(e,t),i=[[this,e]];return n instanceof Zt?i.concat(n.path(s,t)):(n!=null&&i.push([n,s]),i)}removeChild(e){this.children.remove(e)}replaceWith(e,t){const n=typeof e=="string"?this.scroll.create(e,t):e;return n instanceof Zt&&this.moveChildren(n),super.replaceWith(n)}split(e,t=!1){if(!t){if(e===0)return this;if(e===this.length())return this.next}const n=this.clone();return this.parent&&this.parent.insertBefore(n,this.next||void 0),this.children.forEachAt(e,this.length(),(s,i,o)=>{const a=s.split(i,t);a!=null&&n.appendChild(a)}),n}splitAfter(e){const t=this.clone();for(;e.next!=null;)t.appendChild(e.next);return this.parent&&this.parent.insertBefore(t,this.next||void 0),t}unwrap(){this.parent&&this.moveChildren(this.parent,this.next||void 0),this.remove()}update(e,t){const n=[],s=[];e.forEach(i=>{i.target===this.domNode&&i.type==="childList"&&(n.push(...i.addedNodes),s.push(...i.removedNodes))}),s.forEach(i=>{if(i.parentNode!=null&&i.tagName!=="IFRAME"&&document.body.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const o=this.scroll.find(i);o!=null&&(o.domNode.parentNode==null||o.domNode.parentNode===this.domNode)&&o.detach()}),n.filter(i=>i.parentNode===this.domNode&&i!==this.uiNode).sort((i,o)=>i===o?0:i.compareDocumentPosition(o)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1).forEach(i=>{let o=null;i.nextSibling!=null&&(o=this.scroll.find(i.nextSibling));const a=Au(i,this.scroll);(a.next!==o||a.next==null)&&(a.parent!=null&&a.parent.removeChild(this),this.insertBefore(a,o||void 0))}),this.enforceAllowedChildren()}};Jd.uiClass="";let nb=Jd;const pt=nb;function sb(r,e){if(Object.keys(r).length!==Object.keys(e).length)return!1;for(const t in r)if(r[t]!==e[t])return!1;return!0}const Kr=class Wr extends pt{static create(e){return super.create(e)}static formats(e,t){const n=t.query(Wr.blotName);if(!(n!=null&&e.tagName===n.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(e,t){super(e,t),this.attributes=new Ni(this.domNode)}format(e,t){if(e===this.statics.blotName&&!t)this.children.forEach(n=>{n instanceof Wr||(n=n.wrap(Wr.blotName,!0)),this.attributes.copy(n)}),this.unwrap();else{const n=this.scroll.query(e,ne.INLINE);if(n==null)return;n instanceof Tt?this.attributes.attribute(n,t):t&&(e!==this.statics.blotName||this.formats()[e]!==t)&&this.replaceWith(e,t)}}formats(){const e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return t!=null&&(e[this.statics.blotName]=t),e}formatAt(e,t,n,s){this.formats()[n]!=null||this.scroll.query(n,ne.ATTRIBUTE)?this.isolate(e,t).format(n,s):super.formatAt(e,t,n,s)}optimize(e){super.optimize(e);const t=this.formats();if(Object.keys(t).length===0)return this.unwrap();const n=this.next;n instanceof Wr&&n.prev===this&&sb(t,n.formats())&&(n.moveChildren(this),n.remove())}replaceWith(e,t){const n=super.replaceWith(e,t);return this.attributes.copy(n),n}update(e,t){super.update(e,t),e.some(n=>n.target===this.domNode&&n.type==="attributes")&&this.attributes.build()}wrap(e,t){const n=super.wrap(e,t);return n instanceof Wr&&this.attributes.move(n),n}};Kr.allowedChildren=[Kr,je],Kr.blotName="inline",Kr.scope=ne.INLINE_BLOT,Kr.tagName="SPAN";let ib=Kr;const ul=ib,Yr=class _a extends pt{static create(e){return super.create(e)}static formats(e,t){const n=t.query(_a.blotName);if(!(n!=null&&e.tagName===n.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(e,t){super(e,t),this.attributes=new Ni(this.domNode)}format(e,t){const n=this.scroll.query(e,ne.BLOCK);n!=null&&(n instanceof Tt?this.attributes.attribute(n,t):e===this.statics.blotName&&!t?this.replaceWith(_a.blotName):t&&(e!==this.statics.blotName||this.formats()[e]!==t)&&this.replaceWith(e,t))}formats(){const e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return t!=null&&(e[this.statics.blotName]=t),e}formatAt(e,t,n,s){this.scroll.query(n,ne.BLOCK)!=null?this.format(n,s):super.formatAt(e,t,n,s)}insertAt(e,t,n){if(n==null||this.scroll.query(t,ne.INLINE)!=null)super.insertAt(e,t,n);else{const s=this.split(e);if(s!=null){const i=this.scroll.create(t,n);s.parent.insertBefore(i,s)}else throw new Error("Attempt to insertAt after block boundaries")}}replaceWith(e,t){const n=super.replaceWith(e,t);return this.attributes.copy(n),n}update(e,t){super.update(e,t),e.some(n=>n.target===this.domNode&&n.type==="attributes")&&this.attributes.build()}};Yr.blotName="block",Yr.scope=ne.BLOCK_BLOT,Yr.tagName="P",Yr.allowedChildren=[ul,Yr,je];let ob=Yr;const Zn=ob,Aa=class extends pt{checkMerge(){return this.next!==null&&this.next.statics.blotName===this.statics.blotName}deleteAt(e,t){super.deleteAt(e,t),this.enforceAllowedChildren()}formatAt(e,t,n,s){super.formatAt(e,t,n,s),this.enforceAllowedChildren()}insertAt(e,t,n){super.insertAt(e,t,n),this.enforceAllowedChildren()}optimize(e){super.optimize(e),this.children.length>0&&this.next!=null&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};Aa.blotName="container",Aa.scope=ne.BLOCK_BLOT;let ab=Aa;const Ri=ab;class lb extends je{static formats(e,t){}format(e,t){super.formatAt(0,this.length(),e,t)}formatAt(e,t,n,s){e===0&&t===this.length()?this.format(n,s):super.formatAt(e,t,n,s)}formats(){return this.statics.formats(this.domNode,this.scroll)}}const Qe=lb,ub={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},cb=100,Zr=class extends pt{constructor(e,t){super(null,t),this.registry=e,this.scroll=this,this.build(),this.observer=new MutationObserver(n=>{this.update(n)}),this.observer.observe(this.domNode,ub),this.attach()}create(e,t){return this.registry.create(this,e,t)}find(e,t=!1){const n=this.registry.find(e,t);return n?n.scroll===this?n:t?this.find(n.scroll.domNode.parentNode,!0):null:null}query(e,t=ne.ANY){return this.registry.query(e,t)}register(...e){return this.registry.register(...e)}build(){this.scroll!=null&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(e,t){this.update(),e===0&&t===this.length()?this.children.forEach(n=>{n.remove()}):super.deleteAt(e,t)}formatAt(e,t,n,s){this.update(),super.formatAt(e,t,n,s)}insertAt(e,t,n){this.update(),super.insertAt(e,t,n)}optimize(e=[],t={}){super.optimize(t);const n=t.mutationsMap||new WeakMap;let s=Array.from(this.observer.takeRecords());for(;s.length>0;)e.push(s.pop());const i=(l,c=!0)=>{l==null||l===this||l.domNode.parentNode!=null&&(n.has(l.domNode)||n.set(l.domNode,[]),c&&i(l.parent))},o=l=>{n.has(l.domNode)&&(l instanceof pt&&l.children.forEach(o),n.delete(l.domNode),l.optimize(t))};let a=e;for(let l=0;a.length>0;l+=1){if(l>=cb)throw new Error("[Parchment] Maximum optimize iterations reached");for(a.forEach(c=>{const d=this.find(c.target,!0);d!=null&&(d.domNode===c.target&&(c.type==="childList"?(i(this.find(c.previousSibling,!1)),Array.from(c.addedNodes).forEach(m=>{const h=this.find(m,!1);i(h,!1),h instanceof pt&&h.children.forEach(g=>{i(g,!1)})})):c.type==="attributes"&&i(d.prev)),i(d))}),this.children.forEach(o),a=Array.from(this.observer.takeRecords()),s=a.slice();s.length>0;)e.push(s.pop())}}update(e,t={}){e=e||this.observer.takeRecords();const n=new WeakMap;e.map(s=>{const i=this.find(s.target,!0);return i==null?null:n.has(i.domNode)?(n.get(i.domNode).push(s),null):(n.set(i.domNode,[s]),i)}).forEach(s=>{s!=null&&s!==this&&n.has(s.domNode)&&s.update(n.get(s.domNode)||[],t)}),t.mutationsMap=n,n.has(this.domNode)&&super.update(n.get(this.domNode),t),this.optimize(e,t)}};Zr.blotName="scroll",Zr.defaultChild=Zn,Zr.allowedChildren=[Zn,Ri],Zr.scope=ne.BLOCK_BLOT,Zr.tagName="DIV";let hb=Zr;const cl=hb,Ca=class ef extends je{static create(e){return document.createTextNode(e)}static value(e){return e.data}constructor(e,t){super(e,t),this.text=this.statics.value(this.domNode)}deleteAt(e,t){this.domNode.data=this.text=this.text.slice(0,e)+this.text.slice(e+t)}index(e,t){return this.domNode===e?t:-1}insertAt(e,t,n){n==null?(this.text=this.text.slice(0,e)+t+this.text.slice(e),this.domNode.data=this.text):super.insertAt(e,t,n)}length(){return this.text.length}optimize(e){super.optimize(e),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof ef&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())}position(e,t=!1){return[this.domNode,e]}split(e,t=!1){if(!t){if(e===0)return this;if(e===this.length())return this.next}const n=this.scroll.create(this.domNode.splitText(e));return this.parent.insertBefore(n,this.next||void 0),this.text=this.statics.value(this.domNode),n}update(e,t){e.some(n=>n.type==="characterData"&&n.target===this.domNode)&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};Ca.blotName="text",Ca.scope=ne.INLINE_BLOT;let db=Ca;const ai=db,fb=Object.freeze(Object.defineProperty({__proto__:null,Attributor:Tt,AttributorStore:Ni,BlockBlot:Zn,ClassAttributor:gt,ContainerBlot:Ri,EmbedBlot:Qe,InlineBlot:ul,LeafBlot:je,ParentBlot:pt,Registry:cn,Scope:ne,ScrollBlot:cl,StyleAttributor:lr,TextBlot:ai},Symbol.toStringTag,{value:"Module"}));var Rs={exports:{}},qo,Cu;function pb(){if(Cu)return qo;Cu=1;var r=-1,e=1,t=0;function n(b,P,A,H,V){if(b===P)return b?[[t,b]]:[];if(A!=null){var N=ce(b,P,A);if(N)return N}var q=a(b,P),W=b.substring(0,q);b=b.substring(q),P=P.substring(q),q=c(b,P);var Z=b.substring(b.length-q);b=b.substring(0,b.length-q),P=P.substring(0,P.length-q);var C=s(b,P);return W&&C.unshift([t,W]),Z&&C.push([t,Z]),w(C,V),H&&m(C),C}function s(b,P){var A;if(!b)return[[e,P]];if(!P)return[[r,b]];var H=b.length>P.length?b:P,V=b.length>P.length?P:b,N=H.indexOf(V);if(N!==-1)return A=[[e,H.substring(0,N)],[t,V],[e,H.substring(N+V.length)]],b.length>P.length&&(A[0][0]=A[2][0]=r),A;if(V.length===1)return[[r,b],[e,P]];var q=d(b,P);if(q){var W=q[0],Z=q[1],C=q[2],L=q[3],$=q[4],K=n(W,C),z=n(Z,L);return K.concat([[t,$]],z)}return i(b,P)}function i(b,P){for(var A=b.length,H=P.length,V=Math.ceil((A+H)/2),N=V,q=2*V,W=new Array(q),Z=new Array(q),C=0;C<q;C++)W[C]=-1,Z[C]=-1;W[N+1]=0,Z[N+1]=0;for(var L=A-H,$=L%2!==0,K=0,z=0,U=0,Q=0,B=0;B<V;B++){for(var j=-B+K;j<=B-z;j+=2){var Y=N+j,G;j===-B||j!==B&&W[Y-1]<W[Y+1]?G=W[Y+1]:G=W[Y-1]+1;for(var X=G-j;G<A&&X<H&&b.charAt(G)===P.charAt(X);)G++,X++;if(W[Y]=G,G>A)z+=2;else if(X>H)K+=2;else if($){var T=N+L-j;if(T>=0&&T<q&&Z[T]!==-1){var le=A-Z[T];if(G>=le)return o(b,P,G,X)}}}for(var pe=-B+U;pe<=B-Q;pe+=2){var T=N+pe,le;pe===-B||pe!==B&&Z[T-1]<Z[T+1]?le=Z[T+1]:le=Z[T-1]+1;for(var Ce=le-pe;le<A&&Ce<H&&b.charAt(A-le-1)===P.charAt(H-Ce-1);)le++,Ce++;if(Z[T]=le,le>A)Q+=2;else if(Ce>H)U+=2;else if(!$){var Y=N+L-pe;if(Y>=0&&Y<q&&W[Y]!==-1){var G=W[Y],X=N+G-Y;if(le=A-le,G>=le)return o(b,P,G,X)}}}}return[[r,b],[e,P]]}function o(b,P,A,H){var V=b.substring(0,A),N=P.substring(0,H),q=b.substring(A),W=P.substring(H),Z=n(V,N),C=n(q,W);return Z.concat(C)}function a(b,P){if(!b||!P||b.charAt(0)!==P.charAt(0))return 0;for(var A=0,H=Math.min(b.length,P.length),V=H,N=0;A<V;)b.substring(N,V)==P.substring(N,V)?(A=V,N=A):H=V,V=Math.floor((H-A)/2+A);return _(b.charCodeAt(V-1))&&V--,V}function l(b,P){var A=b.length,H=P.length;if(A==0||H==0)return 0;A>H?b=b.substring(A-H):A<H&&(P=P.substring(0,A));var V=Math.min(A,H);if(b==P)return V;for(var N=0,q=1;;){var W=b.substring(V-q),Z=P.indexOf(W);if(Z==-1)return N;q+=Z,(Z==0||b.substring(V-q)==P.substring(0,q))&&(N=q,q++)}}function c(b,P){if(!b||!P||b.slice(-1)!==P.slice(-1))return 0;for(var A=0,H=Math.min(b.length,P.length),V=H,N=0;A<V;)b.substring(b.length-V,b.length-N)==P.substring(P.length-V,P.length-N)?(A=V,N=A):H=V,V=Math.floor((H-A)/2+A);return k(b.charCodeAt(b.length-V))&&V--,V}function d(b,P){var A=b.length>P.length?b:P,H=b.length>P.length?P:b;if(A.length<4||H.length*2<A.length)return null;function V(z,U,Q){for(var B=z.substring(Q,Q+Math.floor(z.length/4)),j=-1,Y="",G,X,T,le;(j=U.indexOf(B,j+1))!==-1;){var pe=a(z.substring(Q),U.substring(j)),Ce=c(z.substring(0,Q),U.substring(0,j));Y.length<Ce+pe&&(Y=U.substring(j-Ce,j)+U.substring(j,j+pe),G=z.substring(0,Q-Ce),X=z.substring(Q+pe),T=U.substring(0,j-Ce),le=U.substring(j+pe))}return Y.length*2>=z.length?[G,X,T,le,Y]:null}var N=V(A,H,Math.ceil(A.length/4)),q=V(A,H,Math.ceil(A.length/2)),W;if(!N&&!q)return null;q?N?W=N[4].length>q[4].length?N:q:W=q:W=N;var Z,C,L,$;b.length>P.length?(Z=W[0],C=W[1],L=W[2],$=W[3]):(L=W[0],$=W[1],Z=W[2],C=W[3]);var K=W[4];return[Z,C,L,$,K]}function m(b){for(var P=!1,A=[],H=0,V=null,N=0,q=0,W=0,Z=0,C=0;N<b.length;)b[N][0]==t?(A[H++]=N,q=Z,W=C,Z=0,C=0,V=b[N][1]):(b[N][0]==e?Z+=b[N][1].length:C+=b[N][1].length,V&&V.length<=Math.max(q,W)&&V.length<=Math.max(Z,C)&&(b.splice(A[H-1],0,[r,V]),b[A[H-1]+1][0]=e,H--,H--,N=H>0?A[H-1]:-1,q=0,W=0,Z=0,C=0,V=null,P=!0)),N++;for(P&&w(b),x(b),N=1;N<b.length;){if(b[N-1][0]==r&&b[N][0]==e){var L=b[N-1][1],$=b[N][1],K=l(L,$),z=l($,L);K>=z?(K>=L.length/2||K>=$.length/2)&&(b.splice(N,0,[t,$.substring(0,K)]),b[N-1][1]=L.substring(0,L.length-K),b[N+1][1]=$.substring(K),N++):(z>=L.length/2||z>=$.length/2)&&(b.splice(N,0,[t,L.substring(0,z)]),b[N-1][0]=e,b[N-1][1]=$.substring(0,$.length-z),b[N+1][0]=r,b[N+1][1]=L.substring(z),N++),N++}N++}}var h=/[^a-zA-Z0-9]/,g=/\s/,v=/[\r\n]/,f=/\n\r?\n$/,y=/^\r?\n\r?\n/;function x(b){function P(z,U){if(!z||!U)return 6;var Q=z.charAt(z.length-1),B=U.charAt(0),j=Q.match(h),Y=B.match(h),G=j&&Q.match(g),X=Y&&B.match(g),T=G&&Q.match(v),le=X&&B.match(v),pe=T&&z.match(f),Ce=le&&U.match(y);return pe||Ce?5:T||le?4:j&&!G&&X?3:G||X?2:j||Y?1:0}for(var A=1;A<b.length-1;){if(b[A-1][0]==t&&b[A+1][0]==t){var H=b[A-1][1],V=b[A][1],N=b[A+1][1],q=c(H,V);if(q){var W=V.substring(V.length-q);H=H.substring(0,H.length-q),V=W+V.substring(0,V.length-q),N=W+N}for(var Z=H,C=V,L=N,$=P(H,V)+P(V,N);V.charAt(0)===N.charAt(0);){H+=V.charAt(0),V=V.substring(1)+N.charAt(0),N=N.substring(1);var K=P(H,V)+P(V,N);K>=$&&($=K,Z=H,C=V,L=N)}b[A-1][1]!=Z&&(Z?b[A-1][1]=Z:(b.splice(A-1,1),A--),b[A][1]=C,L?b[A+1][1]=L:(b.splice(A+1,1),A--))}A++}}function w(b,P){b.push([t,""]);for(var A=0,H=0,V=0,N="",q="",W;A<b.length;){if(A<b.length-1&&!b[A][1]){b.splice(A,1);continue}switch(b[A][0]){case e:V++,q+=b[A][1],A++;break;case r:H++,N+=b[A][1],A++;break;case t:var Z=A-V-H-1;if(P){if(Z>=0&&D(b[Z][1])){var C=b[Z][1].slice(-1);if(b[Z][1]=b[Z][1].slice(0,-1),N=C+N,q=C+q,!b[Z][1]){b.splice(Z,1),A--;var L=Z-1;b[L]&&b[L][0]===e&&(V++,q=b[L][1]+q,L--),b[L]&&b[L][0]===r&&(H++,N=b[L][1]+N,L--),Z=L}}if(S(b[A][1])){var C=b[A][1].charAt(0);b[A][1]=b[A][1].slice(1),N+=C,q+=C}}if(A<b.length-1&&!b[A][1]){b.splice(A,1);break}if(N.length>0||q.length>0){N.length>0&&q.length>0&&(W=a(q,N),W!==0&&(Z>=0?b[Z][1]+=q.substring(0,W):(b.splice(0,0,[t,q.substring(0,W)]),A++),q=q.substring(W),N=N.substring(W)),W=c(q,N),W!==0&&(b[A][1]=q.substring(q.length-W)+b[A][1],q=q.substring(0,q.length-W),N=N.substring(0,N.length-W)));var $=V+H;N.length===0&&q.length===0?(b.splice(A-$,$),A=A-$):N.length===0?(b.splice(A-$,$,[e,q]),A=A-$+1):q.length===0?(b.splice(A-$,$,[r,N]),A=A-$+1):(b.splice(A-$,$,[r,N],[e,q]),A=A-$+2)}A!==0&&b[A-1][0]===t?(b[A-1][1]+=b[A][1],b.splice(A,1)):A++,V=0,H=0,N="",q="";break}}b[b.length-1][1]===""&&b.pop();var K=!1;for(A=1;A<b.length-1;)b[A-1][0]===t&&b[A+1][0]===t&&(b[A][1].substring(b[A][1].length-b[A-1][1].length)===b[A-1][1]?(b[A][1]=b[A-1][1]+b[A][1].substring(0,b[A][1].length-b[A-1][1].length),b[A+1][1]=b[A-1][1]+b[A+1][1],b.splice(A-1,1),K=!0):b[A][1].substring(0,b[A+1][1].length)==b[A+1][1]&&(b[A-1][1]+=b[A+1][1],b[A][1]=b[A][1].substring(b[A+1][1].length)+b[A+1][1],b.splice(A+1,1),K=!0)),A++;K&&w(b,P)}function _(b){return b>=55296&&b<=56319}function k(b){return b>=56320&&b<=57343}function S(b){return k(b.charCodeAt(0))}function D(b){return _(b.charCodeAt(b.length-1))}function F(b){for(var P=[],A=0;A<b.length;A++)b[A][1].length>0&&P.push(b[A]);return P}function ae(b,P,A,H){return D(b)||S(H)?null:F([[t,b],[r,P],[e,A],[t,H]])}function ce(b,P,A){var H=typeof A=="number"?{index:A,length:0}:A.oldRange,V=typeof A=="number"?null:A.newRange,N=b.length,q=P.length;if(H.length===0&&(V===null||V.length===0)){var W=H.index,Z=b.slice(0,W),C=b.slice(W),L=V?V.index:null;e:{var $=W+q-N;if(L!==null&&L!==$||$<0||$>q)break e;var K=P.slice(0,$),z=P.slice($);if(z!==C)break e;var U=Math.min(W,$),Q=Z.slice(0,U),B=K.slice(0,U);if(Q!==B)break e;var j=Z.slice(U),Y=K.slice(U);return ae(Q,j,Y,C)}e:{if(L!==null&&L!==W)break e;var G=W,K=P.slice(0,G),z=P.slice(G);if(K!==Z)break e;var X=Math.min(N-G,q-G),T=C.slice(C.length-X),le=z.slice(z.length-X);if(T!==le)break e;var j=C.slice(0,C.length-X),Y=z.slice(0,z.length-X);return ae(Z,j,Y,T)}}if(H.length>0&&V&&V.length===0)e:{var Q=b.slice(0,H.index),T=b.slice(H.index+H.length),U=Q.length,X=T.length;if(q<U+X)break e;var B=P.slice(0,U),le=P.slice(q-X);if(Q!==B||T!==le)break e;var j=b.slice(U,N-X),Y=P.slice(U,q-X);return ae(Q,j,Y,T)}return null}function ge(b,P,A,H){return n(b,P,A,H,!0)}return ge.INSERT=e,ge.DELETE=r,ge.EQUAL=t,qo=ge,qo}var Fn={exports:{}};Fn.exports;var ku;function tf(){return ku||(ku=1,function(r,e){var t=200,n="__lodash_hash_undefined__",s=9007199254740991,i="[object Arguments]",o="[object Array]",a="[object Boolean]",l="[object Date]",c="[object Error]",d="[object Function]",m="[object GeneratorFunction]",h="[object Map]",g="[object Number]",v="[object Object]",f="[object Promise]",y="[object RegExp]",x="[object Set]",w="[object String]",_="[object Symbol]",k="[object WeakMap]",S="[object ArrayBuffer]",D="[object DataView]",F="[object Float32Array]",ae="[object Float64Array]",ce="[object Int8Array]",ge="[object Int16Array]",b="[object Int32Array]",P="[object Uint8Array]",A="[object Uint8ClampedArray]",H="[object Uint16Array]",V="[object Uint32Array]",N=/[\\^$.*+?()[\]{}|]/g,q=/\w*$/,W=/^\[object .+?Constructor\]$/,Z=/^(?:0|[1-9]\d*)$/,C={};C[i]=C[o]=C[S]=C[D]=C[a]=C[l]=C[F]=C[ae]=C[ce]=C[ge]=C[b]=C[h]=C[g]=C[v]=C[y]=C[x]=C[w]=C[_]=C[P]=C[A]=C[H]=C[V]=!0,C[c]=C[d]=C[k]=!1;var L=typeof ze.commonjsGlobal=="object"&&ze.commonjsGlobal&&ze.commonjsGlobal.Object===Object&&ze.commonjsGlobal,$=typeof self=="object"&&self&&self.Object===Object&&self,K=L||$||Function("return this")(),z=e&&!e.nodeType&&e,U=z&&!0&&r&&!r.nodeType&&r,Q=U&&U.exports===z;function B(u,p){return u.set(p[0],p[1]),u}function j(u,p){return u.add(p),u}function Y(u,p){for(var E=-1,O=u?u.length:0;++E<O&&p(u[E],E,u)!==!1;);return u}function G(u,p){for(var E=-1,O=p.length,he=u.length;++E<O;)u[he+E]=p[E];return u}function X(u,p,E,O){for(var he=-1,ie=u?u.length:0;++he<ie;)E=p(E,u[he],he,u);return E}function T(u,p){for(var E=-1,O=Array(u);++E<u;)O[E]=p(E);return O}function le(u,p){return u==null?void 0:u[p]}function pe(u){var p=!1;if(u!=null&&typeof u.toString!="function")try{p=!!(u+"")}catch{}return p}function Ce(u){var p=-1,E=Array(u.size);return u.forEach(function(O,he){E[++p]=[he,O]}),E}function It(u,p){return function(E){return u(p(E))}}function Gt(u){var p=-1,E=Array(u.size);return u.forEach(function(O){E[++p]=O}),E}var Fi=Array.prototype,ji=Function.prototype,Mr=Object.prototype,yn=K["__core-js_shared__"],as=function(){var u=/[^.]+$/.exec(yn&&yn.keys&&yn.keys.IE_PROTO||"");return u?"Symbol(src)_1."+u:""}(),ls=ji.toString,bt=Mr.hasOwnProperty,Dr=Mr.toString,Vi=RegExp("^"+ls.call(bt).replace(N,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ur=Q?K.Buffer:void 0,Pr=K.Symbol,bn=K.Uint8Array,Je=It(Object.getPrototypeOf,Object),us=Object.create,cs=Mr.propertyIsEnumerable,$i=Fi.splice,xn=Object.getOwnPropertySymbols,Br=ur?ur.isBuffer:void 0,hs=It(Object.keys,Object),qr=at(K,"DataView"),cr=at(K,"Map"),ot=at(K,"Promise"),Fr=at(K,"Set"),En=at(K,"WeakMap"),hr=at(Object,"create"),wn=He(qr),dr=He(cr),Sn=He(ot),_n=He(Fr),An=He(En),Kt=Pr?Pr.prototype:void 0,ds=Kt?Kt.valueOf:void 0;function Ot(u){var p=-1,E=u?u.length:0;for(this.clear();++p<E;){var O=u[p];this.set(O[0],O[1])}}function Ui(){this.__data__=hr?hr(null):{}}function Hi(u){return this.has(u)&&delete this.__data__[u]}function zi(u){var p=this.__data__;if(hr){var E=p[u];return E===n?void 0:E}return bt.call(p,u)?p[u]:void 0}function fs(u){var p=this.__data__;return hr?p[u]!==void 0:bt.call(p,u)}function Cn(u,p){var E=this.__data__;return E[u]=hr&&p===void 0?n:p,this}Ot.prototype.clear=Ui,Ot.prototype.delete=Hi,Ot.prototype.get=zi,Ot.prototype.has=fs,Ot.prototype.set=Cn;function Le(u){var p=-1,E=u?u.length:0;for(this.clear();++p<E;){var O=u[p];this.set(O[0],O[1])}}function Gi(){this.__data__=[]}function Ki(u){var p=this.__data__,E=Vr(p,u);if(E<0)return!1;var O=p.length-1;return E==O?p.pop():$i.call(p,E,1),!0}function Wi(u){var p=this.__data__,E=Vr(p,u);return E<0?void 0:p[E][1]}function Yi(u){return Vr(this.__data__,u)>-1}function Zi(u,p){var E=this.__data__,O=Vr(E,u);return O<0?E.push([u,p]):E[O][1]=p,this}Le.prototype.clear=Gi,Le.prototype.delete=Ki,Le.prototype.get=Wi,Le.prototype.has=Yi,Le.prototype.set=Zi;function Be(u){var p=-1,E=u?u.length:0;for(this.clear();++p<E;){var O=u[p];this.set(O[0],O[1])}}function Xi(){this.__data__={hash:new Ot,map:new(cr||Le),string:new Ot}}function Qi(u){return pr(this,u).delete(u)}function Ji(u){return pr(this,u).get(u)}function eo(u){return pr(this,u).has(u)}function to(u,p){return pr(this,u).set(u,p),this}Be.prototype.clear=Xi,Be.prototype.delete=Qi,Be.prototype.get=Ji,Be.prototype.has=eo,Be.prototype.set=to;function Ge(u){this.__data__=new Le(u)}function ro(){this.__data__=new Le}function no(u){return this.__data__.delete(u)}function so(u){return this.__data__.get(u)}function io(u){return this.__data__.has(u)}function oo(u,p){var E=this.__data__;if(E instanceof Le){var O=E.__data__;if(!cr||O.length<t-1)return O.push([u,p]),this;E=this.__data__=new Be(O)}return E.set(u,p),this}Ge.prototype.clear=ro,Ge.prototype.delete=no,Ge.prototype.get=so,Ge.prototype.has=io,Ge.prototype.set=oo;function jr(u,p){var E=Rn(u)||Ur(u)?T(u.length,String):[],O=E.length,he=!!O;for(var ie in u)bt.call(u,ie)&&!(he&&(ie=="length"||Eo(ie,O)))&&E.push(ie);return E}function ps(u,p,E){var O=u[p];(!(bt.call(u,p)&&bs(O,E))||E===void 0&&!(p in u))&&(u[p]=E)}function Vr(u,p){for(var E=u.length;E--;)if(bs(u[E][0],p))return E;return-1}function xt(u,p){return u&&Nn(p,On(p),u)}function kn(u,p,E,O,he,ie,ve){var me;if(O&&(me=ie?O(u,he,ie,ve):O(u)),me!==void 0)return me;if(!wt(u))return u;var Ne=Rn(u);if(Ne){if(me=bo(u),!p)return go(u,me)}else{var ye=Mt(u),qe=ye==d||ye==m;if(xs(u))return $r(u,p);if(ye==v||ye==i||qe&&!ie){if(pe(u))return ie?u:{};if(me=Et(qe?{}:u),!p)return vo(u,xt(me,u))}else{if(!C[ye])return ie?u:{};me=xo(u,ye,kn,p)}}ve||(ve=new Ge);var Ke=ve.get(u);if(Ke)return Ke;if(ve.set(u,me),!Ne)var Ie=E?yo(u):On(u);return Y(Ie||u,function(Fe,Me){Ie&&(Me=Fe,Fe=u[Me]),ps(me,Me,kn(Fe,p,E,O,Me,u,ve))}),me}function ao(u){return wt(u)?us(u):{}}function lo(u,p,E){var O=p(u);return Rn(u)?O:G(O,E(u))}function uo(u){return Dr.call(u)}function co(u){if(!wt(u)||So(u))return!1;var p=In(u)||pe(u)?Vi:W;return p.test(He(u))}function ho(u){if(!vs(u))return hs(u);var p=[];for(var E in Object(u))bt.call(u,E)&&E!="constructor"&&p.push(E);return p}function $r(u,p){if(p)return u.slice();var E=new u.constructor(u.length);return u.copy(E),E}function Tn(u){var p=new u.constructor(u.byteLength);return new bn(p).set(new bn(u)),p}function fr(u,p){var E=p?Tn(u.buffer):u.buffer;return new u.constructor(E,u.byteOffset,u.byteLength)}function ms(u,p,E){var O=p?E(Ce(u),!0):Ce(u);return X(O,B,new u.constructor)}function gs(u){var p=new u.constructor(u.source,q.exec(u));return p.lastIndex=u.lastIndex,p}function fo(u,p,E){var O=p?E(Gt(u),!0):Gt(u);return X(O,j,new u.constructor)}function po(u){return ds?Object(ds.call(u)):{}}function mo(u,p){var E=p?Tn(u.buffer):u.buffer;return new u.constructor(E,u.byteOffset,u.length)}function go(u,p){var E=-1,O=u.length;for(p||(p=Array(O));++E<O;)p[E]=u[E];return p}function Nn(u,p,E,O){E||(E={});for(var he=-1,ie=p.length;++he<ie;){var ve=p[he],me=void 0;ps(E,ve,me===void 0?u[ve]:me)}return E}function vo(u,p){return Nn(u,Lt(u),p)}function yo(u){return lo(u,On,Lt)}function pr(u,p){var E=u.__data__;return wo(p)?E[typeof p=="string"?"string":"hash"]:E.map}function at(u,p){var E=le(u,p);return co(E)?E:void 0}var Lt=xn?It(xn,Object):Ao,Mt=uo;(qr&&Mt(new qr(new ArrayBuffer(1)))!=D||cr&&Mt(new cr)!=h||ot&&Mt(ot.resolve())!=f||Fr&&Mt(new Fr)!=x||En&&Mt(new En)!=k)&&(Mt=function(u){var p=Dr.call(u),E=p==v?u.constructor:void 0,O=E?He(E):void 0;if(O)switch(O){case wn:return D;case dr:return h;case Sn:return f;case _n:return x;case An:return k}return p});function bo(u){var p=u.length,E=u.constructor(p);return p&&typeof u[0]=="string"&&bt.call(u,"index")&&(E.index=u.index,E.input=u.input),E}function Et(u){return typeof u.constructor=="function"&&!vs(u)?ao(Je(u)):{}}function xo(u,p,E,O){var he=u.constructor;switch(p){case S:return Tn(u);case a:case l:return new he(+u);case D:return fr(u,O);case F:case ae:case ce:case ge:case b:case P:case A:case H:case V:return mo(u,O);case h:return ms(u,O,E);case g:case w:return new he(u);case y:return gs(u);case x:return fo(u,O,E);case _:return po(u)}}function Eo(u,p){return p=p??s,!!p&&(typeof u=="number"||Z.test(u))&&u>-1&&u%1==0&&u<p}function wo(u){var p=typeof u;return p=="string"||p=="number"||p=="symbol"||p=="boolean"?u!=="__proto__":u===null}function So(u){return!!as&&as in u}function vs(u){var p=u&&u.constructor,E=typeof p=="function"&&p.prototype||Mr;return u===E}function He(u){if(u!=null){try{return ls.call(u)}catch{}try{return u+""}catch{}}return""}function ys(u){return kn(u,!0,!0)}function bs(u,p){return u===p||u!==u&&p!==p}function Ur(u){return _o(u)&&bt.call(u,"callee")&&(!cs.call(u,"callee")||Dr.call(u)==i)}var Rn=Array.isArray;function Hr(u){return u!=null&&Es(u.length)&&!In(u)}function _o(u){return ws(u)&&Hr(u)}var xs=Br||Co;function In(u){var p=wt(u)?Dr.call(u):"";return p==d||p==m}function Es(u){return typeof u=="number"&&u>-1&&u%1==0&&u<=s}function wt(u){var p=typeof u;return!!u&&(p=="object"||p=="function")}function ws(u){return!!u&&typeof u=="object"}function On(u){return Hr(u)?jr(u):ho(u)}function Ao(){return[]}function Co(){return!1}r.exports=ys}(Fn,Fn.exports)),Fn.exports}var jn={exports:{}};jn.exports;var Tu;function rf(){return Tu||(Tu=1,function(r,e){var t=200,n="__lodash_hash_undefined__",s=1,i=2,o=9007199254740991,a="[object Arguments]",l="[object Array]",c="[object AsyncFunction]",d="[object Boolean]",m="[object Date]",h="[object Error]",g="[object Function]",v="[object GeneratorFunction]",f="[object Map]",y="[object Number]",x="[object Null]",w="[object Object]",_="[object Promise]",k="[object Proxy]",S="[object RegExp]",D="[object Set]",F="[object String]",ae="[object Symbol]",ce="[object Undefined]",ge="[object WeakMap]",b="[object ArrayBuffer]",P="[object DataView]",A="[object Float32Array]",H="[object Float64Array]",V="[object Int8Array]",N="[object Int16Array]",q="[object Int32Array]",W="[object Uint8Array]",Z="[object Uint8ClampedArray]",C="[object Uint16Array]",L="[object Uint32Array]",$=/[\\^$.*+?()[\]{}|]/g,K=/^\[object .+?Constructor\]$/,z=/^(?:0|[1-9]\d*)$/,U={};U[A]=U[H]=U[V]=U[N]=U[q]=U[W]=U[Z]=U[C]=U[L]=!0,U[a]=U[l]=U[b]=U[d]=U[P]=U[m]=U[h]=U[g]=U[f]=U[y]=U[w]=U[S]=U[D]=U[F]=U[ge]=!1;var Q=typeof ze.commonjsGlobal=="object"&&ze.commonjsGlobal&&ze.commonjsGlobal.Object===Object&&ze.commonjsGlobal,B=typeof self=="object"&&self&&self.Object===Object&&self,j=Q||B||Function("return this")(),Y=e&&!e.nodeType&&e,G=Y&&!0&&r&&!r.nodeType&&r,X=G&&G.exports===Y,T=X&&Q.process,le=function(){try{return T&&T.binding&&T.binding("util")}catch{}}(),pe=le&&le.isTypedArray;function Ce(u,p){for(var E=-1,O=u==null?0:u.length,he=0,ie=[];++E<O;){var ve=u[E];p(ve,E,u)&&(ie[he++]=ve)}return ie}function It(u,p){for(var E=-1,O=p.length,he=u.length;++E<O;)u[he+E]=p[E];return u}function Gt(u,p){for(var E=-1,O=u==null?0:u.length;++E<O;)if(p(u[E],E,u))return!0;return!1}function Fi(u,p){for(var E=-1,O=Array(u);++E<u;)O[E]=p(E);return O}function ji(u){return function(p){return u(p)}}function Mr(u,p){return u.has(p)}function yn(u,p){return u==null?void 0:u[p]}function as(u){var p=-1,E=Array(u.size);return u.forEach(function(O,he){E[++p]=[he,O]}),E}function ls(u,p){return function(E){return u(p(E))}}function bt(u){var p=-1,E=Array(u.size);return u.forEach(function(O){E[++p]=O}),E}var Dr=Array.prototype,Vi=Function.prototype,ur=Object.prototype,Pr=j["__core-js_shared__"],bn=Vi.toString,Je=ur.hasOwnProperty,us=function(){var u=/[^.]+$/.exec(Pr&&Pr.keys&&Pr.keys.IE_PROTO||"");return u?"Symbol(src)_1."+u:""}(),cs=ur.toString,$i=RegExp("^"+bn.call(Je).replace($,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),xn=X?j.Buffer:void 0,Br=j.Symbol,hs=j.Uint8Array,qr=ur.propertyIsEnumerable,cr=Dr.splice,ot=Br?Br.toStringTag:void 0,Fr=Object.getOwnPropertySymbols,En=xn?xn.isBuffer:void 0,hr=ls(Object.keys,Object),wn=Lt(j,"DataView"),dr=Lt(j,"Map"),Sn=Lt(j,"Promise"),_n=Lt(j,"Set"),An=Lt(j,"WeakMap"),Kt=Lt(Object,"create"),ds=He(wn),Ot=He(dr),Ui=He(Sn),Hi=He(_n),zi=He(An),fs=Br?Br.prototype:void 0,Cn=fs?fs.valueOf:void 0;function Le(u){var p=-1,E=u==null?0:u.length;for(this.clear();++p<E;){var O=u[p];this.set(O[0],O[1])}}function Gi(){this.__data__=Kt?Kt(null):{},this.size=0}function Ki(u){var p=this.has(u)&&delete this.__data__[u];return this.size-=p?1:0,p}function Wi(u){var p=this.__data__;if(Kt){var E=p[u];return E===n?void 0:E}return Je.call(p,u)?p[u]:void 0}function Yi(u){var p=this.__data__;return Kt?p[u]!==void 0:Je.call(p,u)}function Zi(u,p){var E=this.__data__;return this.size+=this.has(u)?0:1,E[u]=Kt&&p===void 0?n:p,this}Le.prototype.clear=Gi,Le.prototype.delete=Ki,Le.prototype.get=Wi,Le.prototype.has=Yi,Le.prototype.set=Zi;function Be(u){var p=-1,E=u==null?0:u.length;for(this.clear();++p<E;){var O=u[p];this.set(O[0],O[1])}}function Xi(){this.__data__=[],this.size=0}function Qi(u){var p=this.__data__,E=$r(p,u);if(E<0)return!1;var O=p.length-1;return E==O?p.pop():cr.call(p,E,1),--this.size,!0}function Ji(u){var p=this.__data__,E=$r(p,u);return E<0?void 0:p[E][1]}function eo(u){return $r(this.__data__,u)>-1}function to(u,p){var E=this.__data__,O=$r(E,u);return O<0?(++this.size,E.push([u,p])):E[O][1]=p,this}Be.prototype.clear=Xi,Be.prototype.delete=Qi,Be.prototype.get=Ji,Be.prototype.has=eo,Be.prototype.set=to;function Ge(u){var p=-1,E=u==null?0:u.length;for(this.clear();++p<E;){var O=u[p];this.set(O[0],O[1])}}function ro(){this.size=0,this.__data__={hash:new Le,map:new(dr||Be),string:new Le}}function no(u){var p=at(this,u).delete(u);return this.size-=p?1:0,p}function so(u){return at(this,u).get(u)}function io(u){return at(this,u).has(u)}function oo(u,p){var E=at(this,u),O=E.size;return E.set(u,p),this.size+=E.size==O?0:1,this}Ge.prototype.clear=ro,Ge.prototype.delete=no,Ge.prototype.get=so,Ge.prototype.has=io,Ge.prototype.set=oo;function jr(u){var p=-1,E=u==null?0:u.length;for(this.__data__=new Ge;++p<E;)this.add(u[p])}function ps(u){return this.__data__.set(u,n),this}function Vr(u){return this.__data__.has(u)}jr.prototype.add=jr.prototype.push=ps,jr.prototype.has=Vr;function xt(u){var p=this.__data__=new Be(u);this.size=p.size}function kn(){this.__data__=new Be,this.size=0}function ao(u){var p=this.__data__,E=p.delete(u);return this.size=p.size,E}function lo(u){return this.__data__.get(u)}function uo(u){return this.__data__.has(u)}function co(u,p){var E=this.__data__;if(E instanceof Be){var O=E.__data__;if(!dr||O.length<t-1)return O.push([u,p]),this.size=++E.size,this;E=this.__data__=new Ge(O)}return E.set(u,p),this.size=E.size,this}xt.prototype.clear=kn,xt.prototype.delete=ao,xt.prototype.get=lo,xt.prototype.has=uo,xt.prototype.set=co;function ho(u,p){var E=Ur(u),O=!E&&bs(u),he=!E&&!O&&Hr(u),ie=!E&&!O&&!he&&ws(u),ve=E||O||he||ie,me=ve?Fi(u.length,String):[],Ne=me.length;for(var ye in u)Je.call(u,ye)&&!(ve&&(ye=="length"||he&&(ye=="offset"||ye=="parent")||ie&&(ye=="buffer"||ye=="byteLength"||ye=="byteOffset")||xo(ye,Ne)))&&me.push(ye);return me}function $r(u,p){for(var E=u.length;E--;)if(ys(u[E][0],p))return E;return-1}function Tn(u,p,E){var O=p(u);return Ur(u)?O:It(O,E(u))}function fr(u){return u==null?u===void 0?ce:x:ot&&ot in Object(u)?Mt(u):vs(u)}function ms(u){return wt(u)&&fr(u)==a}function gs(u,p,E,O,he){return u===p?!0:u==null||p==null||!wt(u)&&!wt(p)?u!==u&&p!==p:fo(u,p,E,O,gs,he)}function fo(u,p,E,O,he,ie){var ve=Ur(u),me=Ur(p),Ne=ve?l:Et(u),ye=me?l:Et(p);Ne=Ne==a?w:Ne,ye=ye==a?w:ye;var qe=Ne==w,Ke=ye==w,Ie=Ne==ye;if(Ie&&Hr(u)){if(!Hr(p))return!1;ve=!0,qe=!1}if(Ie&&!qe)return ie||(ie=new xt),ve||ws(u)?Nn(u,p,E,O,he,ie):vo(u,p,Ne,E,O,he,ie);if(!(E&s)){var Fe=qe&&Je.call(u,"__wrapped__"),Me=Ke&&Je.call(p,"__wrapped__");if(Fe||Me){var Wt=Fe?u.value():u,Dt=Me?p.value():p;return ie||(ie=new xt),he(Wt,Dt,E,O,ie)}}return Ie?(ie||(ie=new xt),yo(u,p,E,O,he,ie)):!1}function po(u){if(!Es(u)||wo(u))return!1;var p=xs(u)?$i:K;return p.test(He(u))}function mo(u){return wt(u)&&In(u.length)&&!!U[fr(u)]}function go(u){if(!So(u))return hr(u);var p=[];for(var E in Object(u))Je.call(u,E)&&E!="constructor"&&p.push(E);return p}function Nn(u,p,E,O,he,ie){var ve=E&s,me=u.length,Ne=p.length;if(me!=Ne&&!(ve&&Ne>me))return!1;var ye=ie.get(u);if(ye&&ie.get(p))return ye==p;var qe=-1,Ke=!0,Ie=E&i?new jr:void 0;for(ie.set(u,p),ie.set(p,u);++qe<me;){var Fe=u[qe],Me=p[qe];if(O)var Wt=ve?O(Me,Fe,qe,p,u,ie):O(Fe,Me,qe,u,p,ie);if(Wt!==void 0){if(Wt)continue;Ke=!1;break}if(Ie){if(!Gt(p,function(Dt,mr){if(!Mr(Ie,mr)&&(Fe===Dt||he(Fe,Dt,E,O,ie)))return Ie.push(mr)})){Ke=!1;break}}else if(!(Fe===Me||he(Fe,Me,E,O,ie))){Ke=!1;break}}return ie.delete(u),ie.delete(p),Ke}function vo(u,p,E,O,he,ie,ve){switch(E){case P:if(u.byteLength!=p.byteLength||u.byteOffset!=p.byteOffset)return!1;u=u.buffer,p=p.buffer;case b:return!(u.byteLength!=p.byteLength||!ie(new hs(u),new hs(p)));case d:case m:case y:return ys(+u,+p);case h:return u.name==p.name&&u.message==p.message;case S:case F:return u==p+"";case f:var me=as;case D:var Ne=O&s;if(me||(me=bt),u.size!=p.size&&!Ne)return!1;var ye=ve.get(u);if(ye)return ye==p;O|=i,ve.set(u,p);var qe=Nn(me(u),me(p),O,he,ie,ve);return ve.delete(u),qe;case ae:if(Cn)return Cn.call(u)==Cn.call(p)}return!1}function yo(u,p,E,O,he,ie){var ve=E&s,me=pr(u),Ne=me.length,ye=pr(p),qe=ye.length;if(Ne!=qe&&!ve)return!1;for(var Ke=Ne;Ke--;){var Ie=me[Ke];if(!(ve?Ie in p:Je.call(p,Ie)))return!1}var Fe=ie.get(u);if(Fe&&ie.get(p))return Fe==p;var Me=!0;ie.set(u,p),ie.set(p,u);for(var Wt=ve;++Ke<Ne;){Ie=me[Ke];var Dt=u[Ie],mr=p[Ie];if(O)var Sl=ve?O(mr,Dt,Ie,p,u,ie):O(Dt,mr,Ie,u,p,ie);if(!(Sl===void 0?Dt===mr||he(Dt,mr,E,O,ie):Sl)){Me=!1;break}Wt||(Wt=Ie=="constructor")}if(Me&&!Wt){var Ss=u.constructor,_s=p.constructor;Ss!=_s&&"constructor"in u&&"constructor"in p&&!(typeof Ss=="function"&&Ss instanceof Ss&&typeof _s=="function"&&_s instanceof _s)&&(Me=!1)}return ie.delete(u),ie.delete(p),Me}function pr(u){return Tn(u,On,bo)}function at(u,p){var E=u.__data__;return Eo(p)?E[typeof p=="string"?"string":"hash"]:E.map}function Lt(u,p){var E=yn(u,p);return po(E)?E:void 0}function Mt(u){var p=Je.call(u,ot),E=u[ot];try{u[ot]=void 0;var O=!0}catch{}var he=cs.call(u);return O&&(p?u[ot]=E:delete u[ot]),he}var bo=Fr?function(u){return u==null?[]:(u=Object(u),Ce(Fr(u),function(p){return qr.call(u,p)}))}:Ao,Et=fr;(wn&&Et(new wn(new ArrayBuffer(1)))!=P||dr&&Et(new dr)!=f||Sn&&Et(Sn.resolve())!=_||_n&&Et(new _n)!=D||An&&Et(new An)!=ge)&&(Et=function(u){var p=fr(u),E=p==w?u.constructor:void 0,O=E?He(E):"";if(O)switch(O){case ds:return P;case Ot:return f;case Ui:return _;case Hi:return D;case zi:return ge}return p});function xo(u,p){return p=p??o,!!p&&(typeof u=="number"||z.test(u))&&u>-1&&u%1==0&&u<p}function Eo(u){var p=typeof u;return p=="string"||p=="number"||p=="symbol"||p=="boolean"?u!=="__proto__":u===null}function wo(u){return!!us&&us in u}function So(u){var p=u&&u.constructor,E=typeof p=="function"&&p.prototype||ur;return u===E}function vs(u){return cs.call(u)}function He(u){if(u!=null){try{return bn.call(u)}catch{}try{return u+""}catch{}}return""}function ys(u,p){return u===p||u!==u&&p!==p}var bs=ms(function(){return arguments}())?ms:function(u){return wt(u)&&Je.call(u,"callee")&&!qr.call(u,"callee")},Ur=Array.isArray;function Rn(u){return u!=null&&In(u.length)&&!xs(u)}var Hr=En||Co;function _o(u,p){return gs(u,p)}function xs(u){if(!Es(u))return!1;var p=fr(u);return p==g||p==v||p==c||p==k}function In(u){return typeof u=="number"&&u>-1&&u%1==0&&u<=o}function Es(u){var p=typeof u;return u!=null&&(p=="object"||p=="function")}function wt(u){return u!=null&&typeof u=="object"}var ws=pe?ji(pe):mo;function On(u){return Rn(u)?ho(u):go(u)}function Ao(){return[]}function Co(){return!1}r.exports=_o}(jn,jn.exports)),jn.exports}var Is={},Nu;function mb(){if(Nu)return Is;Nu=1,Object.defineProperty(Is,"__esModule",{value:!0});const r=tf(),e=rf();var t;return function(n){function s(l={},c={},d=!1){typeof l!="object"&&(l={}),typeof c!="object"&&(c={});let m=r(c);d||(m=Object.keys(m).reduce((h,g)=>(m[g]!=null&&(h[g]=m[g]),h),{}));for(const h in l)l[h]!==void 0&&c[h]===void 0&&(m[h]=l[h]);return Object.keys(m).length>0?m:void 0}n.compose=s;function i(l={},c={}){typeof l!="object"&&(l={}),typeof c!="object"&&(c={});const d=Object.keys(l).concat(Object.keys(c)).reduce((m,h)=>(e(l[h],c[h])||(m[h]=c[h]===void 0?null:c[h]),m),{});return Object.keys(d).length>0?d:void 0}n.diff=i;function o(l={},c={}){l=l||{};const d=Object.keys(c).reduce((m,h)=>(c[h]!==l[h]&&l[h]!==void 0&&(m[h]=c[h]),m),{});return Object.keys(l).reduce((m,h)=>(l[h]!==c[h]&&c[h]===void 0&&(m[h]=null),m),d)}n.invert=o;function a(l,c,d=!1){if(typeof l!="object")return c;if(typeof c!="object")return;if(!d)return c;const m=Object.keys(c).reduce((h,g)=>(l[g]===void 0&&(h[g]=c[g]),h),{});return Object.keys(m).length>0?m:void 0}n.transform=a}(t||(t={})),Is.default=t,Is}var Os={},Ru;function nf(){if(Ru)return Os;Ru=1,Object.defineProperty(Os,"__esModule",{value:!0});var r;return function(e){function t(n){return typeof n.delete=="number"?n.delete:typeof n.retain=="number"?n.retain:typeof n.retain=="object"&&n.retain!==null?1:typeof n.insert=="string"?n.insert.length:1}e.length=t}(r||(r={})),Os.default=r,Os}var Ls={},Iu;function gb(){if(Iu)return Ls;Iu=1,Object.defineProperty(Ls,"__esModule",{value:!0});const r=nf();class e{constructor(n){this.ops=n,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(n){n||(n=1/0);const s=this.ops[this.index];if(s){const i=this.offset,o=r.default.length(s);if(n>=o-i?(n=o-i,this.index+=1,this.offset=0):this.offset+=n,typeof s.delete=="number")return{delete:n};{const a={};return s.attributes&&(a.attributes=s.attributes),typeof s.retain=="number"?a.retain=n:typeof s.retain=="object"&&s.retain!==null?a.retain=s.retain:typeof s.insert=="string"?a.insert=s.insert.substr(i,n):a.insert=s.insert,a}}else return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?r.default.length(this.ops[this.index])-this.offset:1/0}peekType(){const n=this.ops[this.index];return n?typeof n.delete=="number"?"delete":typeof n.retain=="number"||typeof n.retain=="object"&&n.retain!==null?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);{const n=this.offset,s=this.index,i=this.next(),o=this.ops.slice(this.index);return this.offset=n,this.index=s,[i].concat(o)}}else return[]}}return Ls.default=e,Ls}var Ou;function vb(){return Ou||(Ou=1,function(r,e){Object.defineProperty(e,"__esModule",{value:!0}),e.AttributeMap=e.OpIterator=e.Op=void 0;const t=pb(),n=tf(),s=rf(),i=mb();e.AttributeMap=i.default;const o=nf();e.Op=o.default;const a=gb();e.OpIterator=a.default;const l="\0",c=(m,h)=>{if(typeof m!="object"||m===null)throw new Error(`cannot retain a ${typeof m}`);if(typeof h!="object"||h===null)throw new Error(`cannot retain a ${typeof h}`);const g=Object.keys(m)[0];if(!g||g!==Object.keys(h)[0])throw new Error(`embed types not matched: ${g} != ${Object.keys(h)[0]}`);return[g,m[g],h[g]]};class d{constructor(h){Array.isArray(h)?this.ops=h:h!=null&&Array.isArray(h.ops)?this.ops=h.ops:this.ops=[]}static registerEmbed(h,g){this.handlers[h]=g}static unregisterEmbed(h){delete this.handlers[h]}static getHandler(h){const g=this.handlers[h];if(!g)throw new Error(`no handlers for embed type "${h}"`);return g}insert(h,g){const v={};return typeof h=="string"&&h.length===0?this:(v.insert=h,g!=null&&typeof g=="object"&&Object.keys(g).length>0&&(v.attributes=g),this.push(v))}delete(h){return h<=0?this:this.push({delete:h})}retain(h,g){if(typeof h=="number"&&h<=0)return this;const v={retain:h};return g!=null&&typeof g=="object"&&Object.keys(g).length>0&&(v.attributes=g),this.push(v)}push(h){let g=this.ops.length,v=this.ops[g-1];if(h=n(h),typeof v=="object"){if(typeof h.delete=="number"&&typeof v.delete=="number")return this.ops[g-1]={delete:v.delete+h.delete},this;if(typeof v.delete=="number"&&h.insert!=null&&(g-=1,v=this.ops[g-1],typeof v!="object"))return this.ops.unshift(h),this;if(s(h.attributes,v.attributes)){if(typeof h.insert=="string"&&typeof v.insert=="string")return this.ops[g-1]={insert:v.insert+h.insert},typeof h.attributes=="object"&&(this.ops[g-1].attributes=h.attributes),this;if(typeof h.retain=="number"&&typeof v.retain=="number")return this.ops[g-1]={retain:v.retain+h.retain},typeof h.attributes=="object"&&(this.ops[g-1].attributes=h.attributes),this}}return g===this.ops.length?this.ops.push(h):this.ops.splice(g,0,h),this}chop(){const h=this.ops[this.ops.length-1];return h&&typeof h.retain=="number"&&!h.attributes&&this.ops.pop(),this}filter(h){return this.ops.filter(h)}forEach(h){this.ops.forEach(h)}map(h){return this.ops.map(h)}partition(h){const g=[],v=[];return this.forEach(f=>{(h(f)?g:v).push(f)}),[g,v]}reduce(h,g){return this.ops.reduce(h,g)}changeLength(){return this.reduce((h,g)=>g.insert?h+o.default.length(g):g.delete?h-g.delete:h,0)}length(){return this.reduce((h,g)=>h+o.default.length(g),0)}slice(h=0,g=1/0){const v=[],f=new a.default(this.ops);let y=0;for(;y<g&&f.hasNext();){let x;y<h?x=f.next(h-y):(x=f.next(g-y),v.push(x)),y+=o.default.length(x)}return new d(v)}compose(h){const g=new a.default(this.ops),v=new a.default(h.ops),f=[],y=v.peek();if(y!=null&&typeof y.retain=="number"&&y.attributes==null){let w=y.retain;for(;g.peekType()==="insert"&&g.peekLength()<=w;)w-=g.peekLength(),f.push(g.next());y.retain-w>0&&v.next(y.retain-w)}const x=new d(f);for(;g.hasNext()||v.hasNext();)if(v.peekType()==="insert")x.push(v.next());else if(g.peekType()==="delete")x.push(g.next());else{const w=Math.min(g.peekLength(),v.peekLength()),_=g.next(w),k=v.next(w);if(k.retain){const S={};if(typeof _.retain=="number")S.retain=typeof k.retain=="number"?w:k.retain;else if(typeof k.retain=="number")_.retain==null?S.insert=_.insert:S.retain=_.retain;else{const F=_.retain==null?"insert":"retain",[ae,ce,ge]=c(_[F],k.retain),b=d.getHandler(ae);S[F]={[ae]:b.compose(ce,ge,F==="retain")}}const D=i.default.compose(_.attributes,k.attributes,typeof _.retain=="number");if(D&&(S.attributes=D),x.push(S),!v.hasNext()&&s(x.ops[x.ops.length-1],S)){const F=new d(g.rest());return x.concat(F).chop()}}else typeof k.delete=="number"&&(typeof _.retain=="number"||typeof _.retain=="object"&&_.retain!==null)&&x.push(k)}return x.chop()}concat(h){const g=new d(this.ops.slice());return h.ops.length>0&&(g.push(h.ops[0]),g.ops=g.ops.concat(h.ops.slice(1))),g}diff(h,g){if(this.ops===h.ops)return new d;const v=[this,h].map(_=>_.map(k=>{if(k.insert!=null)return typeof k.insert=="string"?k.insert:l;const S=_===h?"on":"with";throw new Error("diff() called "+S+" non-document")}).join("")),f=new d,y=t(v[0],v[1],g,!0),x=new a.default(this.ops),w=new a.default(h.ops);return y.forEach(_=>{let k=_[1].length;for(;k>0;){let S=0;switch(_[0]){case t.INSERT:S=Math.min(w.peekLength(),k),f.push(w.next(S));break;case t.DELETE:S=Math.min(k,x.peekLength()),x.next(S),f.delete(S);break;case t.EQUAL:S=Math.min(x.peekLength(),w.peekLength(),k);const D=x.next(S),F=w.next(S);s(D.insert,F.insert)?f.retain(S,i.default.diff(D.attributes,F.attributes)):f.push(F).delete(S);break}k-=S}}),f.chop()}eachLine(h,g=`
`){const v=new a.default(this.ops);let f=new d,y=0;for(;v.hasNext();){if(v.peekType()!=="insert")return;const x=v.peek(),w=o.default.length(x)-v.peekLength(),_=typeof x.insert=="string"?x.insert.indexOf(g,w)-w:-1;if(_<0)f.push(v.next());else if(_>0)f.push(v.next(_));else{if(h(f,v.next(1).attributes||{},y)===!1)return;y+=1,f=new d}}f.length()>0&&h(f,{},y)}invert(h){const g=new d;return this.reduce((v,f)=>{if(f.insert)g.delete(o.default.length(f));else{if(typeof f.retain=="number"&&f.attributes==null)return g.retain(f.retain),v+f.retain;if(f.delete||typeof f.retain=="number"){const y=f.delete||f.retain;return h.slice(v,v+y).forEach(w=>{f.delete?g.push(w):f.retain&&f.attributes&&g.retain(o.default.length(w),i.default.invert(f.attributes,w.attributes))}),v+y}else if(typeof f.retain=="object"&&f.retain!==null){const y=h.slice(v,v+1),x=new a.default(y.ops).next(),[w,_,k]=c(f.retain,x.insert),S=d.getHandler(w);return g.retain({[w]:S.invert(_,k)},i.default.invert(f.attributes,x.attributes)),v+1}}return v},0),g.chop()}transform(h,g=!1){if(g=!!g,typeof h=="number")return this.transformPosition(h,g);const v=h,f=new a.default(this.ops),y=new a.default(v.ops),x=new d;for(;f.hasNext()||y.hasNext();)if(f.peekType()==="insert"&&(g||y.peekType()!=="insert"))x.retain(o.default.length(f.next()));else if(y.peekType()==="insert")x.push(y.next());else{const w=Math.min(f.peekLength(),y.peekLength()),_=f.next(w),k=y.next(w);if(_.delete)continue;if(k.delete)x.push(k);else{const S=_.retain,D=k.retain;let F=typeof D=="object"&&D!==null?D:w;if(typeof S=="object"&&S!==null&&typeof D=="object"&&D!==null){const ae=Object.keys(S)[0];if(ae===Object.keys(D)[0]){const ce=d.getHandler(ae);ce&&(F={[ae]:ce.transform(S[ae],D[ae],g)})}}x.retain(F,i.default.transform(_.attributes,k.attributes,g))}}return x.chop()}transformPosition(h,g=!1){g=!!g;const v=new a.default(this.ops);let f=0;for(;v.hasNext()&&f<=h;){const y=v.peekLength(),x=v.peekType();if(v.next(),x==="delete"){h-=Math.min(y,h-f);continue}else x==="insert"&&(f<h||!g)&&(h+=y);f+=y}return h}}d.Op=o.default,d.OpIterator=a.default,d.AttributeMap=i.default,d.handlers={},e.default=d,r.exports=d,r.exports.default=d}(Rs,Rs.exports)),Rs.exports}var st=vb();const re=ze.getDefaultExportFromCjs(st);class vt extends Qe{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return""}}vt.blotName="break";vt.tagName="BR";let mt=class extends ai{};const yb={"&":"&","<":"<",">":">",'"':""","'":"'"};function Ii(r){return r.replace(/[&<>"']/g,e=>yb[e])}const St=class St extends ul{static compare(e,t){const n=St.order.indexOf(e),s=St.order.indexOf(t);return n>=0||s>=0?n-s:e===t?0:e<t?-1:1}formatAt(e,t,n,s){if(St.compare(this.statics.blotName,n)<0&&this.scroll.query(n,ne.BLOT)){const i=this.isolate(e,t);s&&i.wrap(n,s)}else super.formatAt(e,t,n,s)}optimize(e){if(super.optimize(e),this.parent instanceof St&&St.compare(this.statics.blotName,this.parent.statics.blotName)>0){const t=this.parent.isolate(this.offset(),this.length());this.moveChildren(t),t.wrap(this)}}};J(St,"allowedChildren",[St,vt,Qe,mt]),J(St,"order",["cursor","inline","link","underline","strike","italic","bold","script","code"]);let Nt=St;const Lu=1;class De extends Zn{constructor(){super(...arguments);J(this,"cache",{})}delta(){return this.cache.delta==null&&(this.cache.delta=sf(this)),this.cache.delta}deleteAt(t,n){super.deleteAt(t,n),this.cache={}}formatAt(t,n,s,i){n<=0||(this.scroll.query(s,ne.BLOCK)?t+n===this.length()&&this.format(s,i):super.formatAt(t,Math.min(n,this.length()-t-1),s,i),this.cache={})}insertAt(t,n,s){if(s!=null){super.insertAt(t,n,s),this.cache={};return}if(n.length===0)return;const i=n.split(`
`),o=i.shift();o.length>0&&(t<this.length()-1||this.children.tail==null?super.insertAt(Math.min(t,this.length()-1),o):this.children.tail.insertAt(this.children.tail.length(),o),this.cache={});let a=this;i.reduce((l,c)=>(a=a.split(l,!0),a.insertAt(0,c),c.length),t+o.length)}insertBefore(t,n){const{head:s}=this.children;super.insertBefore(t,n),s instanceof vt&&s.remove(),this.cache={}}length(){return this.cache.length==null&&(this.cache.length=super.length()+Lu),this.cache.length}moveChildren(t,n){super.moveChildren(t,n),this.cache={}}optimize(t){super.optimize(t),this.cache={}}path(t){return super.path(t,!0)}removeChild(t){super.removeChild(t),this.cache={}}split(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(n&&(t===0||t>=this.length()-Lu)){const i=this.clone();return t===0?(this.parent.insertBefore(i,this),this):(this.parent.insertBefore(i,this.next),i)}const s=super.split(t,n);return this.cache={},s}}De.blotName="block";De.tagName="P";De.defaultChild=vt;De.allowedChildren=[vt,Nt,Qe,mt];class nt extends Qe{attach(){super.attach(),this.attributes=new Ni(this.domNode)}delta(){return new re().insert(this.value(),{...this.formats(),...this.attributes.values()})}format(e,t){const n=this.scroll.query(e,ne.BLOCK_ATTRIBUTE);n!=null&&this.attributes.attribute(n,t)}formatAt(e,t,n,s){this.format(n,s)}insertAt(e,t,n){if(n!=null){super.insertAt(e,t,n);return}const s=t.split(`
`),i=s.pop(),o=s.map(l=>{const c=this.scroll.create(De.blotName);return c.insertAt(0,l),c}),a=this.split(e);o.forEach(l=>{this.parent.insertBefore(l,a)}),i&&this.parent.insertBefore(this.scroll.create("text",i),a)}}nt.scope=ne.BLOCK_BLOT;function sf(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return r.descendants(je).reduce((t,n)=>n.length()===0?t:t.insert(n.value(),tt(n,{},e)),new re).insert(`
`,tt(r))}function tt(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return r==null||("formats"in r&&typeof r.formats=="function"&&(e={...e,...r.formats()},t&&delete e["code-token"]),r.parent==null||r.parent.statics.blotName==="scroll"||r.parent.statics.scope!==r.statics.scope)?e:tt(r.parent,e,t)}const et=class et extends Qe{static value(){}constructor(e,t,n){super(e,t),this.selection=n,this.textNode=document.createTextNode(et.CONTENTS),this.domNode.appendChild(this.textNode),this.savedLength=0}detach(){this.parent!=null&&this.parent.removeChild(this)}format(e,t){if(this.savedLength!==0){super.format(e,t);return}let n=this,s=0;for(;n!=null&&n.statics.scope!==ne.BLOCK_BLOT;)s+=n.offset(n.parent),n=n.parent;n!=null&&(this.savedLength=et.CONTENTS.length,n.optimize(),n.formatAt(s,et.CONTENTS.length,e,t),this.savedLength=0)}index(e,t){return e===this.textNode?0:super.index(e,t)}length(){return this.savedLength}position(){return[this.textNode,this.textNode.data.length]}remove(){super.remove(),this.parent=null}restore(){if(this.selection.composing||this.parent==null)return null;const e=this.selection.getNativeRange();for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);const t=this.prev instanceof mt?this.prev:null,n=t?t.length():0,s=this.next instanceof mt?this.next:null,i=s?s.text:"",{textNode:o}=this,a=o.data.split(et.CONTENTS).join("");o.data=et.CONTENTS;let l;if(t)l=t,(a||s)&&(t.insertAt(t.length(),a+i),s&&s.remove());else if(s)l=s,s.insertAt(0,a);else{const c=document.createTextNode(a);l=this.scroll.create(c),this.parent.insertBefore(l,this)}if(this.remove(),e){const c=(h,g)=>t&&h===t.domNode?g:h===o?n+g-1:s&&h===s.domNode?n+a.length+g:null,d=c(e.start.node,e.start.offset),m=c(e.end.node,e.end.offset);if(d!==null&&m!==null)return{startNode:l.domNode,startOffset:d,endNode:l.domNode,endOffset:m}}return null}update(e,t){if(e.some(n=>n.type==="characterData"&&n.target===this.textNode)){const n=this.restore();n&&(t.range=n)}}optimize(e){super.optimize(e);let{parent:t}=this;for(;t;){if(t.domNode.tagName==="A"){this.savedLength=et.CONTENTS.length,t.isolate(this.offset(t),this.length()).unwrap(),this.savedLength=0;break}t=t.parent}}value(){return""}};J(et,"blotName","cursor"),J(et,"className","ql-cursor"),J(et,"tagName","span"),J(et,"CONTENTS","\uFEFF");let hn=et;var Fo={exports:{}},Mu;function bb(){return Mu||(Mu=1,function(r){var e=Object.prototype.hasOwnProperty,t="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(t=!1));function s(l,c,d){this.fn=l,this.context=c,this.once=d||!1}function i(l,c,d,m,h){if(typeof d!="function")throw new TypeError("The listener must be a function");var g=new s(d,m||l,h),v=t?t+c:c;return l._events[v]?l._events[v].fn?l._events[v]=[l._events[v],g]:l._events[v].push(g):(l._events[v]=g,l._eventsCount++),l}function o(l,c){--l._eventsCount===0?l._events=new n:delete l._events[c]}function a(){this._events=new n,this._eventsCount=0}a.prototype.eventNames=function(){var c=[],d,m;if(this._eventsCount===0)return c;for(m in d=this._events)e.call(d,m)&&c.push(t?m.slice(1):m);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(d)):c},a.prototype.listeners=function(c){var d=t?t+c:c,m=this._events[d];if(!m)return[];if(m.fn)return[m.fn];for(var h=0,g=m.length,v=new Array(g);h<g;h++)v[h]=m[h].fn;return v},a.prototype.listenerCount=function(c){var d=t?t+c:c,m=this._events[d];return m?m.fn?1:m.length:0},a.prototype.emit=function(c,d,m,h,g,v){var f=t?t+c:c;if(!this._events[f])return!1;var y=this._events[f],x=arguments.length,w,_;if(y.fn){switch(y.once&&this.removeListener(c,y.fn,void 0,!0),x){case 1:return y.fn.call(y.context),!0;case 2:return y.fn.call(y.context,d),!0;case 3:return y.fn.call(y.context,d,m),!0;case 4:return y.fn.call(y.context,d,m,h),!0;case 5:return y.fn.call(y.context,d,m,h,g),!0;case 6:return y.fn.call(y.context,d,m,h,g,v),!0}for(_=1,w=new Array(x-1);_<x;_++)w[_-1]=arguments[_];y.fn.apply(y.context,w)}else{var k=y.length,S;for(_=0;_<k;_++)switch(y[_].once&&this.removeListener(c,y[_].fn,void 0,!0),x){case 1:y[_].fn.call(y[_].context);break;case 2:y[_].fn.call(y[_].context,d);break;case 3:y[_].fn.call(y[_].context,d,m);break;case 4:y[_].fn.call(y[_].context,d,m,h);break;default:if(!w)for(S=1,w=new Array(x-1);S<x;S++)w[S-1]=arguments[S];y[_].fn.apply(y[_].context,w)}}return!0},a.prototype.on=function(c,d,m){return i(this,c,d,m,!1)},a.prototype.once=function(c,d,m){return i(this,c,d,m,!0)},a.prototype.removeListener=function(c,d,m,h){var g=t?t+c:c;if(!this._events[g])return this;if(!d)return o(this,g),this;var v=this._events[g];if(v.fn)v.fn===d&&(!h||v.once)&&(!m||v.context===m)&&o(this,g);else{for(var f=0,y=[],x=v.length;f<x;f++)(v[f].fn!==d||h&&!v[f].once||m&&v[f].context!==m)&&y.push(v[f]);y.length?this._events[g]=y.length===1?y[0]:y:o(this,g)}return this},a.prototype.removeAllListeners=function(c){var d;return c?(d=t?t+c:c,this._events[d]&&o(this,d)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=t,a.EventEmitter=a,r.exports=a}(Fo)),Fo.exports}var xb=bb();const Eb=ze.getDefaultExportFromCjs(xb),ka=new WeakMap,Ta=["error","warn","log","info"];let Na="warn";function of(r){if(Na&&Ta.indexOf(r)<=Ta.indexOf(Na)){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];console[r](...t)}}function zt(r){return Ta.reduce((e,t)=>(e[t]=of.bind(console,t,r),e),{})}zt.level=r=>{Na=r};of.level=zt.level;const jo=zt("quill:events"),wb=["selectionchange","mousedown","mouseup","click"];wb.forEach(r=>{document.addEventListener(r,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];Array.from(document.querySelectorAll(".ql-container")).forEach(s=>{const i=ka.get(s);i&&i.emitter&&i.emitter.handleDOM(...t)})})});class te extends Eb{constructor(){super(),this.domListeners={},this.on("error",jo.error)}emit(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return jo.log.call(jo,...t),super.emit(...t)}handleDOM(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];(this.domListeners[e.type]||[]).forEach(i=>{let{node:o,handler:a}=i;(e.target===o||o.contains(e.target))&&a(e,...n)})}listenDOM(e,t,n){this.domListeners[e]||(this.domListeners[e]=[]),this.domListeners[e].push({node:t,handler:n})}}J(te,"events",{EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_BLOT_MOUNT:"scroll-blot-mount",SCROLL_BLOT_UNMOUNT:"scroll-blot-unmount",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SCROLL_EMBED_UPDATE:"scroll-embed-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change",COMPOSITION_BEFORE_START:"composition-before-start",COMPOSITION_START:"composition-start",COMPOSITION_BEFORE_END:"composition-before-end",COMPOSITION_END:"composition-end"}),J(te,"sources",{API:"api",SILENT:"silent",USER:"user"});const Vo=zt("quill:selection");class kr{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.index=e,this.length=t}}class Sb{constructor(e,t){this.emitter=t,this.scroll=e,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=this.scroll.create("cursor",this),this.savedRange=new kr(0,0),this.lastRange=this.savedRange,this.lastNative=null,this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,()=>{!this.mouseDown&&!this.composing&&setTimeout(this.update.bind(this,te.sources.USER),1)}),this.emitter.on(te.events.SCROLL_BEFORE_UPDATE,()=>{if(!this.hasFocus())return;const n=this.getNativeRange();n!=null&&n.start.node!==this.cursor.textNode&&this.emitter.once(te.events.SCROLL_UPDATE,(s,i)=>{try{this.root.contains(n.start.node)&&this.root.contains(n.end.node)&&this.setNativeRange(n.start.node,n.start.offset,n.end.node,n.end.offset);const o=i.some(a=>a.type==="characterData"||a.type==="childList"||a.type==="attributes"&&a.target===this.root);this.update(o?te.sources.SILENT:s)}catch{}})}),this.emitter.on(te.events.SCROLL_OPTIMIZE,(n,s)=>{if(s.range){const{startNode:i,startOffset:o,endNode:a,endOffset:l}=s.range;this.setNativeRange(i,o,a,l),this.update(te.sources.SILENT)}}),this.update(te.sources.SILENT)}handleComposition(){this.emitter.on(te.events.COMPOSITION_BEFORE_START,()=>{this.composing=!0}),this.emitter.on(te.events.COMPOSITION_END,()=>{if(this.composing=!1,this.cursor.parent){const e=this.cursor.restore();if(!e)return;setTimeout(()=>{this.setNativeRange(e.startNode,e.startOffset,e.endNode,e.endOffset)},1)}})}handleDragging(){this.emitter.listenDOM("mousedown",document.body,()=>{this.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,()=>{this.mouseDown=!1,this.update(te.sources.USER)})}focus(){this.hasFocus()||(this.root.focus({preventScroll:!0}),this.setRange(this.savedRange))}format(e,t){this.scroll.update();const n=this.getNativeRange();if(!(n==null||!n.native.collapsed||this.scroll.query(e,ne.BLOCK))){if(n.start.node!==this.cursor.textNode){const s=this.scroll.find(n.start.node,!1);if(s==null)return;if(s instanceof je){const i=s.split(n.start.offset);s.parent.insertBefore(this.cursor,i)}else s.insertBefore(this.cursor,n.start.node);this.cursor.attach()}this.cursor.format(e,t),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}getBounds(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const n=this.scroll.length();e=Math.min(e,n-1),t=Math.min(e+t,n-1)-e;let s,[i,o]=this.scroll.leaf(e);if(i==null)return null;if(t>0&&o===i.length()){const[d]=this.scroll.leaf(e+1);if(d){const[m]=this.scroll.line(e),[h]=this.scroll.line(e+1);m===h&&(i=d,o=0)}}[s,o]=i.position(o,!0);const a=document.createRange();if(t>0)return a.setStart(s,o),[i,o]=this.scroll.leaf(e+t),i==null?null:([s,o]=i.position(o,!0),a.setEnd(s,o),a.getBoundingClientRect());let l="left",c;if(s instanceof Text){if(!s.data.length)return null;o<s.data.length?(a.setStart(s,o),a.setEnd(s,o+1)):(a.setStart(s,o-1),a.setEnd(s,o),l="right"),c=a.getBoundingClientRect()}else{if(!(i.domNode instanceof Element))return null;c=i.domNode.getBoundingClientRect(),o>0&&(l="right")}return{bottom:c.top+c.height,height:c.height,left:c[l],right:c[l],top:c.top,width:0}}getNativeRange(){const e=document.getSelection();if(e==null||e.rangeCount<=0)return null;const t=e.getRangeAt(0);if(t==null)return null;const n=this.normalizeNative(t);return Vo.info("getNativeRange",n),n}getRange(){const e=this.scroll.domNode;if("isConnected"in e&&!e.isConnected)return[null,null];const t=this.getNativeRange();return t==null?[null,null]:[this.normalizedToRange(t),t]}hasFocus(){return document.activeElement===this.root||document.activeElement!=null&&$o(this.root,document.activeElement)}normalizedToRange(e){const t=[[e.start.node,e.start.offset]];e.native.collapsed||t.push([e.end.node,e.end.offset]);const n=t.map(o=>{const[a,l]=o,c=this.scroll.find(a,!0),d=c.offset(this.scroll);return l===0?d:c instanceof je?d+c.index(a,l):d+c.length()}),s=Math.min(Math.max(...n),this.scroll.length()-1),i=Math.min(s,...n);return new kr(i,s-i)}normalizeNative(e){if(!$o(this.root,e.startContainer)||!e.collapsed&&!$o(this.root,e.endContainer))return null;const t={start:{node:e.startContainer,offset:e.startOffset},end:{node:e.endContainer,offset:e.endOffset},native:e};return[t.start,t.end].forEach(n=>{let{node:s,offset:i}=n;for(;!(s instanceof Text)&&s.childNodes.length>0;)if(s.childNodes.length>i)s=s.childNodes[i],i=0;else if(s.childNodes.length===i)s=s.lastChild,s instanceof Text?i=s.data.length:s.childNodes.length>0?i=s.childNodes.length:i=s.childNodes.length+1;else break;n.node=s,n.offset=i}),t}rangeToNative(e){const t=this.scroll.length(),n=(s,i)=>{s=Math.min(t-1,s);const[o,a]=this.scroll.leaf(s);return o?o.position(a,i):[null,-1]};return[...n(e.index,!1),...n(e.index+e.length,!0)]}setNativeRange(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:t,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(Vo.info("setNativeRange",e,t,n,s),e!=null&&(this.root.parentNode==null||e.parentNode==null||n.parentNode==null))return;const o=document.getSelection();if(o!=null)if(e!=null){this.hasFocus()||this.root.focus({preventScroll:!0});const{native:a}=this.getNativeRange()||{};if(a==null||i||e!==a.startContainer||t!==a.startOffset||n!==a.endContainer||s!==a.endOffset){e instanceof Element&&e.tagName==="BR"&&(t=Array.from(e.parentNode.childNodes).indexOf(e),e=e.parentNode),n instanceof Element&&n.tagName==="BR"&&(s=Array.from(n.parentNode.childNodes).indexOf(n),n=n.parentNode);const l=document.createRange();l.setStart(e,t),l.setEnd(n,s),o.removeAllRanges(),o.addRange(l)}}else o.removeAllRanges(),this.root.blur()}setRange(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:te.sources.API;if(typeof t=="string"&&(n=t,t=!1),Vo.info("setRange",e),e!=null){const s=this.rangeToNative(e);this.setNativeRange(...s,t)}else this.setNativeRange(null);this.update(n)}update(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:te.sources.USER;const t=this.lastRange,[n,s]=this.getRange();if(this.lastRange=n,this.lastNative=s,this.lastRange!=null&&(this.savedRange=this.lastRange),!Xt(t,this.lastRange)){if(!this.composing&&s!=null&&s.native.collapsed&&s.start.node!==this.cursor.textNode){const o=this.cursor.restore();o&&this.setNativeRange(o.startNode,o.startOffset,o.endNode,o.endOffset)}const i=[te.events.SELECTION_CHANGE,Jr(this.lastRange),Jr(t),e];this.emitter.emit(te.events.EDITOR_CHANGE,...i),e!==te.sources.SILENT&&this.emitter.emit(...i)}}}function $o(r,e){try{e.parentNode}catch{return!1}return r.contains(e)}const _b=/^[ -~]*$/;class Ab{constructor(e){this.scroll=e,this.delta=this.getDelta()}applyDelta(e){this.scroll.update();let t=this.scroll.length();this.scroll.batchStart();const n=Du(e),s=new re;return kb(n.ops.slice()).reduce((o,a)=>{const l=st.Op.length(a);let c=a.attributes||{},d=!1,m=!1;if(a.insert!=null){if(s.retain(l),typeof a.insert=="string"){const v=a.insert;m=!v.endsWith(`
`)&&(t<=o||!!this.scroll.descendant(nt,o)[0]),this.scroll.insertAt(o,v);const[f,y]=this.scroll.line(o);let x=rr({},tt(f));if(f instanceof De){const[w]=f.descendant(je,y);w&&(x=rr(x,tt(w)))}c=st.AttributeMap.diff(x,c)||{}}else if(typeof a.insert=="object"){const v=Object.keys(a.insert)[0];if(v==null)return o;const f=this.scroll.query(v,ne.INLINE)!=null;if(f)(t<=o||this.scroll.descendant(nt,o)[0])&&(m=!0);else if(o>0){const[y,x]=this.scroll.descendant(je,o-1);y instanceof mt?y.value()[x]!==`
`&&(d=!0):y instanceof Qe&&y.statics.scope===ne.INLINE_BLOT&&(d=!0)}if(this.scroll.insertAt(o,v,a.insert[v]),f){const[y]=this.scroll.descendant(je,o);if(y){const x=rr({},tt(y));c=st.AttributeMap.diff(x,c)||{}}}}t+=l}else if(s.push(a),a.retain!==null&&typeof a.retain=="object"){const v=Object.keys(a.retain)[0];if(v==null)return o;this.scroll.updateEmbedAt(o,v,a.retain[v])}Object.keys(c).forEach(v=>{this.scroll.formatAt(o,l,v,c[v])});const h=d?1:0,g=m?1:0;return t+=h+g,s.retain(h),s.delete(g),o+l+h+g},0),s.reduce((o,a)=>typeof a.delete=="number"?(this.scroll.deleteAt(o,a.delete),o):o+st.Op.length(a),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(n)}deleteText(e,t){return this.scroll.deleteAt(e,t),this.update(new re().retain(e).delete(t))}formatLine(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.scroll.update(),Object.keys(n).forEach(i=>{this.scroll.lines(e,Math.max(t,1)).forEach(o=>{o.format(i,n[i])})}),this.scroll.optimize();const s=new re().retain(e).retain(t,Jr(n));return this.update(s)}formatText(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.keys(n).forEach(i=>{this.scroll.formatAt(e,t,i,n[i])});const s=new re().retain(e).retain(t,Jr(n));return this.update(s)}getContents(e,t){return this.delta.slice(e,e+t)}getDelta(){return this.scroll.lines().reduce((e,t)=>e.concat(t.delta()),new re)}getFormat(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=[],s=[];t===0?this.scroll.path(e).forEach(a=>{const[l]=a;l instanceof De?n.push(l):l instanceof je&&s.push(l)}):(n=this.scroll.lines(e,t),s=this.scroll.descendants(je,e,t));const[i,o]=[n,s].map(a=>{const l=a.shift();if(l==null)return{};let c=tt(l);for(;Object.keys(c).length>0;){const d=a.shift();if(d==null)return c;c=Cb(tt(d),c)}return c});return{...i,...o}}getHTML(e,t){const[n,s]=this.scroll.line(e);if(n){const i=n.length();return n.length()>=s+t&&!(s===0&&t===i)?Xn(n,s,t,!0):Xn(this.scroll,e,t,!0)}return""}getText(e,t){return this.getContents(e,t).filter(n=>typeof n.insert=="string").map(n=>n.insert).join("")}insertContents(e,t){const n=Du(t),s=new re().retain(e).concat(n);return this.scroll.insertContents(e,n),this.update(s)}insertEmbed(e,t,n){return this.scroll.insertAt(e,t,n),this.update(new re().retain(e).insert({[t]:n}))}insertText(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t=t.replace(/\r\n/g,`
`).replace(/\r/g,`
`),this.scroll.insertAt(e,t),Object.keys(n).forEach(s=>{this.scroll.formatAt(e,t.length,s,n[s])}),this.update(new re().retain(e).insert(t,Jr(n)))}isBlank(){if(this.scroll.children.length===0)return!0;if(this.scroll.children.length>1)return!1;const e=this.scroll.children.head;if((e==null?void 0:e.statics.blotName)!==De.blotName)return!1;const t=e;return t.children.length>1?!1:t.children.head instanceof vt}removeFormat(e,t){const n=this.getText(e,t),[s,i]=this.scroll.line(e+t);let o=0,a=new re;s!=null&&(o=s.length()-i,a=s.delta().slice(i,i+o-1).insert(`
`));const c=this.getContents(e,t+o).diff(new re().insert(n).concat(a)),d=new re().retain(e).concat(c);return this.applyDelta(d)}update(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;const s=this.delta;if(t.length===1&&t[0].type==="characterData"&&t[0].target.data.match(_b)&&this.scroll.find(t[0].target)){const i=this.scroll.find(t[0].target),o=tt(i),a=i.offset(this.scroll),l=t[0].oldValue.replace(hn.CONTENTS,""),c=new re().insert(l),d=new re().insert(i.value()),m=n&&{oldRange:Pu(n.oldRange,-a),newRange:Pu(n.newRange,-a)};e=new re().retain(a).concat(c.diff(d,m)).reduce((g,v)=>v.insert?g.insert(v.insert,o):g.push(v),new re),this.delta=s.compose(e)}else this.delta=this.getDelta(),(!e||!Xt(s.compose(e),this.delta))&&(e=s.diff(this.delta,n));return e}}function Xr(r,e,t){if(r.length===0){const[g]=Uo(t.pop());return e<=0?`</li></${g}>`:`</li></${g}>${Xr([],e-1,t)}`}const[{child:n,offset:s,length:i,indent:o,type:a},...l]=r,[c,d]=Uo(a);if(o>e)return t.push(a),o===e+1?`<${c}><li${d}>${Xn(n,s,i)}${Xr(l,o,t)}`:`<${c}><li>${Xr(r,e+1,t)}`;const m=t[t.length-1];if(o===e&&a===m)return`</li><li${d}>${Xn(n,s,i)}${Xr(l,o,t)}`;const[h]=Uo(t.pop());return`</li></${h}>${Xr(r,e-1,t)}`}function Xn(r,e,t){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if("html"in r&&typeof r.html=="function")return r.html(e,t);if(r instanceof mt)return Ii(r.value().slice(e,e+t)).replaceAll(" "," ");if(r instanceof pt){if(r.statics.blotName==="list-container"){const c=[];return r.children.forEachAt(e,t,(d,m,h)=>{const g="formats"in d&&typeof d.formats=="function"?d.formats():{};c.push({child:d,offset:m,length:h,indent:g.indent||0,type:g.list})}),Xr(c,-1,[])}const s=[];if(r.children.forEachAt(e,t,(c,d,m)=>{s.push(Xn(c,d,m))}),n||r.statics.blotName==="list")return s.join("");const{outerHTML:i,innerHTML:o}=r.domNode,[a,l]=i.split(`>${o}<`);return a==="<table"?`<table style="border: 1px solid #000;">${s.join("")}<${l}`:`${a}>${s.join("")}<${l}`}return r.domNode instanceof Element?r.domNode.outerHTML:""}function Cb(r,e){return Object.keys(e).reduce((t,n)=>{if(r[n]==null)return t;const s=e[n];return s===r[n]?t[n]=s:Array.isArray(s)?s.indexOf(r[n])<0?t[n]=s.concat([r[n]]):t[n]=s:t[n]=[s,r[n]],t},{})}function Uo(r){const e=r==="ordered"?"ol":"ul";switch(r){case"checked":return[e,' data-list="checked"'];case"unchecked":return[e,' data-list="unchecked"'];default:return[e,""]}}function Du(r){return r.reduce((e,t)=>{if(typeof t.insert=="string"){const n=t.insert.replace(/\r\n/g,`
`).replace(/\r/g,`
`);return e.insert(n,t.attributes)}return e.push(t)},new re)}function Pu(r,e){let{index:t,length:n}=r;return new kr(t+e,n)}function kb(r){const e=[];return r.forEach(t=>{typeof t.insert=="string"?t.insert.split(`
`).forEach((s,i)=>{i&&e.push({insert:`
`,attributes:t.attributes}),s&&e.push({insert:s,attributes:t.attributes})}):e.push(t)}),e}class yt{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.quill=e,this.options=t}}J(yt,"DEFAULTS",{});const Ms="\uFEFF";class hl extends Qe{constructor(e,t){super(e,t),this.contentNode=document.createElement("span"),this.contentNode.setAttribute("contenteditable","false"),Array.from(this.domNode.childNodes).forEach(n=>{this.contentNode.appendChild(n)}),this.leftGuard=document.createTextNode(Ms),this.rightGuard=document.createTextNode(Ms),this.domNode.appendChild(this.leftGuard),this.domNode.appendChild(this.contentNode),this.domNode.appendChild(this.rightGuard)}index(e,t){return e===this.leftGuard?0:e===this.rightGuard?1:super.index(e,t)}restore(e){let t=null,n;const s=e.data.split(Ms).join("");if(e===this.leftGuard)if(this.prev instanceof mt){const i=this.prev.length();this.prev.insertAt(i,s),t={startNode:this.prev.domNode,startOffset:i+s.length}}else n=document.createTextNode(s),this.parent.insertBefore(this.scroll.create(n),this),t={startNode:n,startOffset:s.length};else e===this.rightGuard&&(this.next instanceof mt?(this.next.insertAt(0,s),t={startNode:this.next.domNode,startOffset:s.length}):(n=document.createTextNode(s),this.parent.insertBefore(this.scroll.create(n),this.next),t={startNode:n,startOffset:s.length}));return e.data=Ms,t}update(e,t){e.forEach(n=>{if(n.type==="characterData"&&(n.target===this.leftGuard||n.target===this.rightGuard)){const s=this.restore(n.target);s&&(t.range=s)}})}}class Tb{constructor(e,t){J(this,"isComposing",!1);this.scroll=e,this.emitter=t,this.setupListeners()}setupListeners(){this.scroll.domNode.addEventListener("compositionstart",e=>{this.isComposing||this.handleCompositionStart(e)}),this.scroll.domNode.addEventListener("compositionend",e=>{this.isComposing&&queueMicrotask(()=>{this.handleCompositionEnd(e)})})}handleCompositionStart(e){const t=e.target instanceof Node?this.scroll.find(e.target,!0):null;t&&!(t instanceof hl)&&(this.emitter.emit(te.events.COMPOSITION_BEFORE_START,e),this.scroll.batchStart(),this.emitter.emit(te.events.COMPOSITION_START,e),this.isComposing=!0)}handleCompositionEnd(e){this.emitter.emit(te.events.COMPOSITION_BEFORE_END,e),this.scroll.batchEnd(),this.emitter.emit(te.events.COMPOSITION_END,e),this.isComposing=!1}}const zn=class zn{constructor(e,t){J(this,"modules",{});this.quill=e,this.options=t}init(){Object.keys(this.options.modules).forEach(e=>{this.modules[e]==null&&this.addModule(e)})}addModule(e){const t=this.quill.constructor.import(`modules/${e}`);return this.modules[e]=new t(this.quill,this.options.modules[e]||{}),this.modules[e]}};J(zn,"DEFAULTS",{modules:{}}),J(zn,"themes",{default:zn});let dn=zn;const Nb=r=>r.parentElement||r.getRootNode().host||null,Rb=r=>{const e=r.getBoundingClientRect(),t="offsetWidth"in r&&Math.abs(e.width)/r.offsetWidth||1,n="offsetHeight"in r&&Math.abs(e.height)/r.offsetHeight||1;return{top:e.top,right:e.left+r.clientWidth*t,bottom:e.top+r.clientHeight*n,left:e.left}},Ds=r=>{const e=parseInt(r,10);return Number.isNaN(e)?0:e},Bu=(r,e,t,n,s,i)=>r<t&&e>n?0:r<t?-(t-r+s):e>n?e-r>n-t?r+s-t:e-n+i:0,Ib=(r,e)=>{var i,o,a;const t=r.ownerDocument;let n=e,s=r;for(;s;){const l=s===t.body,c=l?{top:0,right:((i=window.visualViewport)==null?void 0:i.width)??t.documentElement.clientWidth,bottom:((o=window.visualViewport)==null?void 0:o.height)??t.documentElement.clientHeight,left:0}:Rb(s),d=getComputedStyle(s),m=Bu(n.left,n.right,c.left,c.right,Ds(d.scrollPaddingLeft),Ds(d.scrollPaddingRight)),h=Bu(n.top,n.bottom,c.top,c.bottom,Ds(d.scrollPaddingTop),Ds(d.scrollPaddingBottom));if(m||h)if(l)(a=t.defaultView)==null||a.scrollBy(m,h);else{const{scrollLeft:g,scrollTop:v}=s;h&&(s.scrollTop+=h),m&&(s.scrollLeft+=m);const f=s.scrollLeft-g,y=s.scrollTop-v;n={left:n.left-f,top:n.top-y,right:n.right-f,bottom:n.bottom-y}}s=l||d.position==="fixed"?null:Nb(s)}},Ob=100,Lb=["block","break","cursor","inline","scroll","text"],Mb=(r,e,t)=>{const n=new cn;return Lb.forEach(s=>{const i=e.query(s);i&&n.register(i)}),r.forEach(s=>{let i=e.query(s);i||t.error(`Cannot register "${s}" specified in "formats" config. Are you sure it was registered?`);let o=0;for(;i;)if(n.register(i),i="blotName"in i?i.requiredContainer??null:null,o+=1,o>Ob){t.error(`Cycle detected in registering blot requiredContainer: "${s}"`);break}}),n},tn=zt("quill"),Ps=new cn;pt.uiClass="ql-ui";const ct=class ct{static debug(e){e===!0&&(e="log"),zt.level(e)}static find(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return ka.get(e)||Ps.find(e,t)}static import(e){return this.imports[e]==null&&tn.error(`Cannot import ${e}. Are you sure it was registered?`),this.imports[e]}static register(){if(typeof(arguments.length<=0?void 0:arguments[0])!="string"){const e=arguments.length<=0?void 0:arguments[0],t=!!(!(arguments.length<=1)&&arguments[1]),n="attrName"in e?e.attrName:e.blotName;typeof n=="string"?this.register(`formats/${n}`,e,t):Object.keys(e).forEach(s=>{this.register(s,e[s],t)})}else{const e=arguments.length<=0?void 0:arguments[0],t=arguments.length<=1?void 0:arguments[1],n=!!(!(arguments.length<=2)&&arguments[2]);this.imports[e]!=null&&!n&&tn.warn(`Overwriting ${e} with`,t),this.imports[e]=t,(e.startsWith("blots/")||e.startsWith("formats/"))&&t&&typeof t!="boolean"&&t.blotName!=="abstract"&&Ps.register(t),typeof t.register=="function"&&t.register(Ps)}}constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.options=Db(e,t),this.container=this.options.container,this.container==null){tn.error("Invalid Quill container",e);return}this.options.debug&&ct.debug(this.options.debug);const n=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",ka.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new te;const s=cl.blotName,i=this.options.registry.query(s);if(!i||!("blotName"in i))throw new Error(`Cannot initialize Quill without "${s}" blot`);if(this.scroll=new i(this.options.registry,this.root,{emitter:this.emitter}),this.editor=new Ab(this.scroll),this.selection=new Sb(this.scroll,this.emitter),this.composition=new Tb(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.uploader=this.theme.addModule("uploader"),this.theme.addModule("input"),this.theme.addModule("uiNode"),this.theme.init(),this.emitter.on(te.events.EDITOR_CHANGE,o=>{o===te.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())}),this.emitter.on(te.events.SCROLL_UPDATE,(o,a)=>{const l=this.selection.lastRange,[c]=this.selection.getRange(),d=l&&c?{oldRange:l,newRange:c}:void 0;lt.call(this,()=>this.editor.update(null,a,d),o)}),this.emitter.on(te.events.SCROLL_EMBED_UPDATE,(o,a)=>{const l=this.selection.lastRange,[c]=this.selection.getRange(),d=l&&c?{oldRange:l,newRange:c}:void 0;lt.call(this,()=>{const m=new re().retain(o.offset(this)).retain({[o.statics.blotName]:a});return this.editor.update(m,[],d)},ct.sources.USER)}),n){const o=this.clipboard.convert({html:`${n}<p><br></p>`,text:`
`});this.setContents(o)}this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable(),this.allowReadOnlyEdits=!1}addContainer(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof e=="string"){const n=e;e=document.createElement("div"),e.classList.add(n)}return this.container.insertBefore(e,t),e}blur(){this.selection.setRange(null)}deleteText(e,t,n){return[e,t,,n]=Pt(e,t,n),lt.call(this,()=>this.editor.deleteText(e,t),n,e,-1*t)}disable(){this.enable(!1)}editReadOnly(e){this.allowReadOnlyEdits=!0;const t=e();return this.allowReadOnlyEdits=!1,t}enable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(e),this.container.classList.toggle("ql-disabled",!e)}focus(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.selection.focus(),e.preventScroll||this.scrollSelectionIntoView()}format(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:te.sources.API;return lt.call(this,()=>{const s=this.getSelection(!0);let i=new re;if(s==null)return i;if(this.scroll.query(e,ne.BLOCK))i=this.editor.formatLine(s.index,s.length,{[e]:t});else{if(s.length===0)return this.selection.format(e,t),i;i=this.editor.formatText(s.index,s.length,{[e]:t})}return this.setSelection(s,te.sources.SILENT),i},n)}formatLine(e,t,n,s,i){let o;return[e,t,o,i]=Pt(e,t,n,s,i),lt.call(this,()=>this.editor.formatLine(e,t,o),i,e,0)}formatText(e,t,n,s,i){let o;return[e,t,o,i]=Pt(e,t,n,s,i),lt.call(this,()=>this.editor.formatText(e,t,o),i,e,0)}getBounds(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=null;if(typeof e=="number"?n=this.selection.getBounds(e,t):n=this.selection.getBounds(e.index,e.length),!n)return null;const s=this.container.getBoundingClientRect();return{bottom:n.bottom-s.top,height:n.height,left:n.left-s.left,right:n.right-s.left,top:n.top-s.top,width:n.width}}getContents(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-e;return[e,t]=Pt(e,t),this.editor.getContents(e,t)}getFormat(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof e=="number"?this.editor.getFormat(e,t):this.editor.getFormat(e.index,e.length)}getIndex(e){return e.offset(this.scroll)}getLength(){return this.scroll.length()}getLeaf(e){return this.scroll.leaf(e)}getLine(e){return this.scroll.line(e)}getLines(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof e!="number"?this.scroll.lines(e.index,e.length):this.scroll.lines(e,t)}getModule(e){return this.theme.modules[e]}getSelection(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1)&&this.focus(),this.update(),this.selection.getRange()[0]}getSemanticHTML(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;return typeof e=="number"&&(t=t??this.getLength()-e),[e,t]=Pt(e,t),this.editor.getHTML(e,t)}getText(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;return typeof e=="number"&&(t=t??this.getLength()-e),[e,t]=Pt(e,t),this.editor.getText(e,t)}hasFocus(){return this.selection.hasFocus()}insertEmbed(e,t,n){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:ct.sources.API;return lt.call(this,()=>this.editor.insertEmbed(e,t,n),s,e)}insertText(e,t,n,s,i){let o;return[e,,o,i]=Pt(e,0,n,s,i),lt.call(this,()=>this.editor.insertText(e,t,o),i,e,t.length)}isEnabled(){return this.scroll.isEnabled()}off(){return this.emitter.off(...arguments)}on(){return this.emitter.on(...arguments)}once(){return this.emitter.once(...arguments)}removeFormat(e,t,n){return[e,t,,n]=Pt(e,t,n),lt.call(this,()=>this.editor.removeFormat(e,t),n,e)}scrollRectIntoView(e){Ib(this.root,e)}scrollIntoView(){console.warn("Quill#scrollIntoView() has been deprecated and will be removed in the near future. Please use Quill#scrollSelectionIntoView() instead."),this.scrollSelectionIntoView()}scrollSelectionIntoView(){const e=this.selection.lastRange,t=e&&this.selection.getBounds(e.index,e.length);t&&this.scrollRectIntoView(t)}setContents(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:te.sources.API;return lt.call(this,()=>{e=new re(e);const n=this.getLength(),s=this.editor.deleteText(0,n),i=this.editor.insertContents(0,e),o=this.editor.deleteText(this.getLength()-1,1);return s.compose(i).compose(o)},t)}setSelection(e,t,n){e==null?this.selection.setRange(null,t||ct.sources.API):([e,t,,n]=Pt(e,t,n),this.selection.setRange(new kr(Math.max(0,e),t),n),n!==te.sources.SILENT&&this.scrollSelectionIntoView())}setText(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:te.sources.API;const n=new re().insert(e);return this.setContents(n,t)}update(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:te.sources.USER;const t=this.scroll.update(e);return this.selection.update(e),t}updateContents(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:te.sources.API;return lt.call(this,()=>(e=new re(e),this.editor.applyDelta(e)),t,!0)}};J(ct,"DEFAULTS",{bounds:null,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0},placeholder:"",readOnly:!1,registry:Ps,theme:"default"}),J(ct,"events",te.events),J(ct,"sources",te.sources),J(ct,"version","2.0.3"),J(ct,"imports",{delta:re,parchment:fb,"core/module":yt,"core/theme":dn});let M=ct;function qu(r){return typeof r=="string"?document.querySelector(r):r}function Ho(r){return Object.entries(r??{}).reduce((e,t)=>{let[n,s]=t;return{...e,[n]:s===!0?{}:s}},{})}function Fu(r){return Object.fromEntries(Object.entries(r).filter(e=>e[1]!==void 0))}function Db(r,e){const t=qu(r);if(!t)throw new Error("Invalid Quill container");const s=!e.theme||e.theme===M.DEFAULTS.theme?dn:M.import(`themes/${e.theme}`);if(!s)throw new Error(`Invalid theme ${e.theme}. Did you register it?`);const{modules:i,...o}=M.DEFAULTS,{modules:a,...l}=s.DEFAULTS;let c=Ho(e.modules);c!=null&&c.toolbar&&c.toolbar.constructor!==Object&&(c={...c,toolbar:{container:c.toolbar}});const d=rr({},Ho(i),Ho(a),c),m={...o,...Fu(l),...Fu(e)};let h=e.registry;return h?e.formats&&tn.warn('Ignoring "formats" option because "registry" is specified'):h=e.formats?Mb(e.formats,m.registry,tn):m.registry,{...m,registry:h,container:t,theme:s,modules:Object.entries(d).reduce((g,v)=>{let[f,y]=v;if(!y)return g;const x=M.import(`modules/${f}`);return x==null?(tn.error(`Cannot load ${f} module. Are you sure you registered it?`),g):{...g,[f]:rr({},x.DEFAULTS||{},y)}},{}),bounds:qu(m.bounds)}}function lt(r,e,t,n){if(!this.isEnabled()&&e===te.sources.USER&&!this.allowReadOnlyEdits)return new re;let s=t==null?null:this.getSelection();const i=this.editor.delta,o=r();if(s!=null&&(t===!0&&(t=s.index),n==null?s=ju(s,o,e):n!==0&&(s=ju(s,t,n,e)),this.setSelection(s,te.sources.SILENT)),o.length()>0){const a=[te.events.TEXT_CHANGE,o,i,e];this.emitter.emit(te.events.EDITOR_CHANGE,...a),e!==te.sources.SILENT&&this.emitter.emit(...a)}return o}function Pt(r,e,t,n,s){let i={};return typeof r.index=="number"&&typeof r.length=="number"?typeof e!="number"?(s=n,n=t,t=e,e=r.length,r=r.index):(e=r.length,r=r.index):typeof e!="number"&&(s=n,n=t,t=e,e=0),typeof t=="object"?(i=t,s=n):typeof t=="string"&&(n!=null?i[t]=n:s=t),s=s||te.sources.API,[r,e,i,s]}function ju(r,e,t,n){const s=typeof t=="number"?t:0;if(r==null)return null;let i,o;return e&&typeof e.transformPosition=="function"?[i,o]=[r.index,r.index+r.length].map(a=>e.transformPosition(a,n!==te.sources.USER)):[i,o]=[r.index,r.index+r.length].map(a=>a<e||a===e&&n===te.sources.USER?a:s>=0?a+s:Math.max(e,a+s)),new kr(i,o-i)}class Ir extends Ri{}function Vu(r){return r instanceof De||r instanceof nt}function $u(r){return typeof r.updateContent=="function"}class Qr extends cl{constructor(e,t,n){let{emitter:s}=n;super(e,t),this.emitter=s,this.batch=!1,this.optimize(),this.enable(),this.domNode.addEventListener("dragstart",i=>this.handleDragStart(i))}batchStart(){Array.isArray(this.batch)||(this.batch=[])}batchEnd(){if(!this.batch)return;const e=this.batch;this.batch=!1,this.update(e)}emitMount(e){this.emitter.emit(te.events.SCROLL_BLOT_MOUNT,e)}emitUnmount(e){this.emitter.emit(te.events.SCROLL_BLOT_UNMOUNT,e)}emitEmbedUpdate(e,t){this.emitter.emit(te.events.SCROLL_EMBED_UPDATE,e,t)}deleteAt(e,t){const[n,s]=this.line(e),[i]=this.line(e+t);if(super.deleteAt(e,t),i!=null&&n!==i&&s>0){if(n instanceof nt||i instanceof nt){this.optimize();return}const o=i.children.head instanceof vt?null:i.children.head;n.moveChildren(i,o),n.remove()}this.optimize()}enable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",e?"true":"false")}formatAt(e,t,n,s){super.formatAt(e,t,n,s),this.optimize()}insertAt(e,t,n){if(e>=this.length())if(n==null||this.scroll.query(t,ne.BLOCK)==null){const s=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(s),n==null&&t.endsWith(`
`)?s.insertAt(0,t.slice(0,-1),n):s.insertAt(0,t,n)}else{const s=this.scroll.create(t,n);this.appendChild(s)}else super.insertAt(e,t,n);this.optimize()}insertBefore(e,t){if(e.statics.scope===ne.INLINE_BLOT){const n=this.scroll.create(this.statics.defaultChild.blotName);n.appendChild(e),super.insertBefore(n,t)}else super.insertBefore(e,t)}insertContents(e,t){const n=this.deltaToRenderBlocks(t.concat(new re().insert(`
`))),s=n.pop();if(s==null)return;this.batchStart();const i=n.shift();if(i){const l=i.type==="block"&&(i.delta.length()===0||!this.descendant(nt,e)[0]&&e<this.length()),c=i.type==="block"?i.delta:new re().insert({[i.key]:i.value});zo(this,e,c);const d=i.type==="block"?1:0,m=e+c.length()+d;l&&this.insertAt(m-1,`
`);const h=tt(this.line(e)[0]),g=st.AttributeMap.diff(h,i.attributes)||{};Object.keys(g).forEach(v=>{this.formatAt(m-1,1,v,g[v])}),e=m}let[o,a]=this.children.find(e);if(n.length&&(o&&(o=o.split(a),a=0),n.forEach(l=>{if(l.type==="block"){const c=this.createBlock(l.attributes,o||void 0);zo(c,0,l.delta)}else{const c=this.create(l.key,l.value);this.insertBefore(c,o||void 0),Object.keys(l.attributes).forEach(d=>{c.format(d,l.attributes[d])})}})),s.type==="block"&&s.delta.length()){const l=o?o.offset(o.scroll)+a:this.length();zo(this,l,s.delta)}this.batchEnd(),this.optimize()}isEnabled(){return this.domNode.getAttribute("contenteditable")==="true"}leaf(e){const t=this.path(e).pop();if(!t)return[null,-1];const[n,s]=t;return n instanceof je?[n,s]:[null,-1]}line(e){return e===this.length()?this.line(e-1):this.descendant(Vu,e)}lines(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;const n=(s,i,o)=>{let a=[],l=o;return s.children.forEachAt(i,o,(c,d,m)=>{Vu(c)?a.push(c):c instanceof Ri&&(a=a.concat(n(c,d,l))),l-=m}),a};return n(this,e,t)}optimize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch||(super.optimize(e,t),e.length>0&&this.emitter.emit(te.events.SCROLL_OPTIMIZE,e,t))}path(e){return super.path(e).slice(1)}remove(){}update(e){if(this.batch){Array.isArray(e)&&(this.batch=this.batch.concat(e));return}let t=te.sources.USER;typeof e=="string"&&(t=e),Array.isArray(e)||(e=this.observer.takeRecords()),e=e.filter(n=>{let{target:s}=n;const i=this.find(s,!0);return i&&!$u(i)}),e.length>0&&this.emitter.emit(te.events.SCROLL_BEFORE_UPDATE,t,e),super.update(e.concat([])),e.length>0&&this.emitter.emit(te.events.SCROLL_UPDATE,t,e)}updateEmbedAt(e,t,n){const[s]=this.descendant(i=>i instanceof nt,e);s&&s.statics.blotName===t&&$u(s)&&s.updateContent(n)}handleDragStart(e){e.preventDefault()}deltaToRenderBlocks(e){const t=[];let n=new re;return e.forEach(s=>{const i=s==null?void 0:s.insert;if(i)if(typeof i=="string"){const o=i.split(`
`);o.slice(0,-1).forEach(l=>{n.insert(l,s.attributes),t.push({type:"block",delta:n,attributes:s.attributes??{}}),n=new re});const a=o[o.length-1];a&&n.insert(a,s.attributes)}else{const o=Object.keys(i)[0];if(!o)return;this.query(o,ne.INLINE)?n.push(s):(n.length()&&t.push({type:"block",delta:n,attributes:{}}),n=new re,t.push({type:"blockEmbed",key:o,value:i[o],attributes:s.attributes??{}}))}}),n.length()&&t.push({type:"block",delta:n,attributes:{}}),t}createBlock(e,t){let n;const s={};Object.entries(e).forEach(a=>{let[l,c]=a;this.query(l,ne.BLOCK&ne.BLOT)!=null?n=l:s[l]=c});const i=this.create(n||this.statics.defaultChild.blotName,n?e[n]:void 0);this.insertBefore(i,t||void 0);const o=i.length();return Object.entries(s).forEach(a=>{let[l,c]=a;i.formatAt(0,o,l,c)}),i}}J(Qr,"blotName","scroll"),J(Qr,"className","ql-editor"),J(Qr,"tagName","DIV"),J(Qr,"defaultChild",De),J(Qr,"allowedChildren",[De,nt,Ir]);function zo(r,e,t){t.reduce((n,s)=>{const i=st.Op.length(s);let o=s.attributes||{};if(s.insert!=null){if(typeof s.insert=="string"){const a=s.insert;r.insertAt(n,a);const[l]=r.descendant(je,n),c=tt(l);o=st.AttributeMap.diff(c,o)||{}}else if(typeof s.insert=="object"){const a=Object.keys(s.insert)[0];if(a==null)return n;if(r.insertAt(n,a,s.insert[a]),r.scroll.query(a,ne.INLINE)!=null){const[c]=r.descendant(je,n),d=tt(c);o=st.AttributeMap.diff(d,o)||{}}}}return Object.keys(o).forEach(a=>{r.formatAt(n,i,a,o[a])}),n+i},e)}const dl={scope:ne.BLOCK,whitelist:["right","center","justify"]},Pb=new Tt("align","align",dl),af=new gt("align","ql-align",dl),lf=new lr("align","text-align",dl);class uf extends lr{value(e){let t=super.value(e);return t.startsWith("rgb(")?(t=t.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),`#${t.split(",").map(s=>`00${parseInt(s,10).toString(16)}`.slice(-2)).join("")}`):t}}const Bb=new gt("color","ql-color",{scope:ne.INLINE}),fl=new uf("color","color",{scope:ne.INLINE}),qb=new gt("background","ql-bg",{scope:ne.INLINE}),pl=new uf("background","background-color",{scope:ne.INLINE});class Or extends Ir{static create(e){const t=super.create(e);return t.setAttribute("spellcheck","false"),t}code(e,t){return this.children.map(n=>n.length()<=1?"":n.domNode.innerText).join(`
`).slice(e,e+t)}html(e,t){return`<pre>
${Ii(this.code(e,t))}
</pre>`}}class Ve extends De{static register(){M.register(Or)}}J(Ve,"TAB"," ");class ml extends Nt{}ml.blotName="code";ml.tagName="CODE";Ve.blotName="code-block";Ve.className="ql-code-block";Ve.tagName="DIV";Or.blotName="code-block-container";Or.className="ql-code-block-container";Or.tagName="DIV";Or.allowedChildren=[Ve];Ve.allowedChildren=[mt,vt,hn];Ve.requiredContainer=Or;const gl={scope:ne.BLOCK,whitelist:["rtl"]},cf=new Tt("direction","dir",gl),hf=new gt("direction","ql-direction",gl),df=new lr("direction","direction",gl),ff={scope:ne.INLINE,whitelist:["serif","monospace"]},pf=new gt("font","ql-font",ff);class Fb extends lr{value(e){return super.value(e).replace(/["']/g,"")}}const mf=new Fb("font","font-family",ff),gf=new gt("size","ql-size",{scope:ne.INLINE,whitelist:["small","large","huge"]}),vf=new lr("size","font-size",{scope:ne.INLINE,whitelist:["10px","18px","32px"]}),jb=zt("quill:keyboard"),Vb=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class Oi extends yt{static match(e,t){return["altKey","ctrlKey","metaKey","shiftKey"].some(n=>!!t[n]!==e[n]&&t[n]!==null)?!1:t.key===e.key||t.key===e.which}constructor(e,t){super(e,t),this.bindings={},Object.keys(this.options.bindings).forEach(n=>{this.options.bindings[n]&&this.addBinding(this.options.bindings[n])}),this.addBinding({key:"Enter",shiftKey:null},this.handleEnter),this.addBinding({key:"Enter",metaKey:null,ctrlKey:null,altKey:null},()=>{}),/Firefox/i.test(navigator.userAgent)?(this.addBinding({key:"Backspace"},{collapsed:!0},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0},this.handleDelete)):(this.addBinding({key:"Backspace"},{collapsed:!0,prefix:/^.?$/},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0,suffix:/^.?$/},this.handleDelete)),this.addBinding({key:"Backspace"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Delete"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Backspace",altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},this.handleBackspace),this.listen()}addBinding(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=Ub(e);if(s==null){jb.warn("Attempted to add invalid keyboard binding",s);return}typeof t=="function"&&(t={handler:t}),typeof n=="function"&&(n={handler:n}),(Array.isArray(s.key)?s.key:[s.key]).forEach(o=>{const a={...s,key:o,...t,...n};this.bindings[a.key]=this.bindings[a.key]||[],this.bindings[a.key].push(a)})}listen(){this.quill.root.addEventListener("keydown",e=>{if(e.defaultPrevented||e.isComposing||e.keyCode===229&&(e.key==="Enter"||e.key==="Backspace"))return;const s=(this.bindings[e.key]||[]).concat(this.bindings[e.which]||[]).filter(x=>Oi.match(e,x));if(s.length===0)return;const i=M.find(e.target,!0);if(i&&i.scroll!==this.quill.scroll)return;const o=this.quill.getSelection();if(o==null||!this.quill.hasFocus())return;const[a,l]=this.quill.getLine(o.index),[c,d]=this.quill.getLeaf(o.index),[m,h]=o.length===0?[c,d]:this.quill.getLeaf(o.index+o.length),g=c instanceof ai?c.value().slice(0,d):"",v=m instanceof ai?m.value().slice(h):"",f={collapsed:o.length===0,empty:o.length===0&&a.length()<=1,format:this.quill.getFormat(o),line:a,offset:l,prefix:g,suffix:v,event:e};s.some(x=>{if(x.collapsed!=null&&x.collapsed!==f.collapsed||x.empty!=null&&x.empty!==f.empty||x.offset!=null&&x.offset!==f.offset)return!1;if(Array.isArray(x.format)){if(x.format.every(w=>f.format[w]==null))return!1}else if(typeof x.format=="object"&&!Object.keys(x.format).every(w=>x.format[w]===!0?f.format[w]!=null:x.format[w]===!1?f.format[w]==null:Xt(x.format[w],f.format[w])))return!1;return x.prefix!=null&&!x.prefix.test(f.prefix)||x.suffix!=null&&!x.suffix.test(f.suffix)?!1:x.handler.call(this,o,f,x)!==!0})&&e.preventDefault()})}handleBackspace(e,t){const n=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(t.prefix)?2:1;if(e.index===0||this.quill.getLength()<=1)return;let s={};const[i]=this.quill.getLine(e.index);let o=new re().retain(e.index-n).delete(n);if(t.offset===0){const[a]=this.quill.getLine(e.index-1);if(a&&!(a.statics.blotName==="block"&&a.length()<=1)){const c=i.formats(),d=this.quill.getFormat(e.index-1,1);if(s=st.AttributeMap.diff(c,d)||{},Object.keys(s).length>0){const m=new re().retain(e.index+i.length()-2).retain(1,s);o=o.compose(m)}}}this.quill.updateContents(o,M.sources.USER),this.quill.focus()}handleDelete(e,t){const n=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(t.suffix)?2:1;if(e.index>=this.quill.getLength()-n)return;let s={};const[i]=this.quill.getLine(e.index);let o=new re().retain(e.index).delete(n);if(t.offset>=i.length()-1){const[a]=this.quill.getLine(e.index+1);if(a){const l=i.formats(),c=this.quill.getFormat(e.index,1);s=st.AttributeMap.diff(l,c)||{},Object.keys(s).length>0&&(o=o.retain(a.length()-1).retain(1,s))}}this.quill.updateContents(o,M.sources.USER),this.quill.focus()}handleDeleteRange(e){vl({range:e,quill:this.quill}),this.quill.focus()}handleEnter(e,t){const n=Object.keys(t.format).reduce((i,o)=>(this.quill.scroll.query(o,ne.BLOCK)&&!Array.isArray(t.format[o])&&(i[o]=t.format[o]),i),{}),s=new re().retain(e.index).delete(e.length).insert(`
`,n);this.quill.updateContents(s,M.sources.USER),this.quill.setSelection(e.index+1,M.sources.SILENT),this.quill.focus()}}const $b={bindings:{bold:Go("bold"),italic:Go("italic"),underline:Go("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(r,e){return e.collapsed&&e.offset!==0?!0:(this.quill.format("indent","+1",M.sources.USER),!1)}},outdent:{key:"Tab",shiftKey:!0,format:["blockquote","indent","list"],handler(r,e){return e.collapsed&&e.offset!==0?!0:(this.quill.format("indent","-1",M.sources.USER),!1)}},"outdent backspace":{key:"Backspace",collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler(r,e){e.format.indent!=null?this.quill.format("indent","-1",M.sources.USER):e.format.list!=null&&this.quill.format("list",!1,M.sources.USER)}},"indent code-block":Uu(!0),"outdent code-block":Uu(!1),"remove tab":{key:"Tab",shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(r){this.quill.deleteText(r.index-1,1,M.sources.USER)}},tab:{key:"Tab",handler(r,e){if(e.format.table)return!0;this.quill.history.cutoff();const t=new re().retain(r.index).delete(r.length).insert(" ");return this.quill.updateContents(t,M.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(r.index+1,M.sources.SILENT),!1}},"blockquote empty enter":{key:"Enter",collapsed:!0,format:["blockquote"],empty:!0,handler(){this.quill.format("blockquote",!1,M.sources.USER)}},"list empty enter":{key:"Enter",collapsed:!0,format:["list"],empty:!0,handler(r,e){const t={list:!1};e.format.indent&&(t.indent=!1),this.quill.formatLine(r.index,r.length,t,M.sources.USER)}},"checklist enter":{key:"Enter",collapsed:!0,format:{list:"checked"},handler(r){const[e,t]=this.quill.getLine(r.index),n={...e.formats(),list:"checked"},s=new re().retain(r.index).insert(`
`,n).retain(e.length()-t-1).retain(1,{list:"unchecked"});this.quill.updateContents(s,M.sources.USER),this.quill.setSelection(r.index+1,M.sources.SILENT),this.quill.scrollSelectionIntoView()}},"header enter":{key:"Enter",collapsed:!0,format:["header"],suffix:/^$/,handler(r,e){const[t,n]=this.quill.getLine(r.index),s=new re().retain(r.index).insert(`
`,e.format).retain(t.length()-n-1).retain(1,{header:null});this.quill.updateContents(s,M.sources.USER),this.quill.setSelection(r.index+1,M.sources.SILENT),this.quill.scrollSelectionIntoView()}},"table backspace":{key:"Backspace",format:["table"],collapsed:!0,offset:0,handler(){}},"table delete":{key:"Delete",format:["table"],collapsed:!0,suffix:/^$/,handler(){}},"table enter":{key:"Enter",shiftKey:null,format:["table"],handler(r){const e=this.quill.getModule("table");if(e){const[t,n,s,i]=e.getTable(r),o=Hb(t,n,s,i);if(o==null)return;let a=t.offset();if(o<0){const l=new re().retain(a).insert(`
`);this.quill.updateContents(l,M.sources.USER),this.quill.setSelection(r.index+1,r.length,M.sources.SILENT)}else if(o>0){a+=t.length();const l=new re().retain(a).insert(`
`);this.quill.updateContents(l,M.sources.USER),this.quill.setSelection(a,M.sources.USER)}}}},"table tab":{key:"Tab",shiftKey:null,format:["table"],handler(r,e){const{event:t,line:n}=e,s=n.offset(this.quill.scroll);t.shiftKey?this.quill.setSelection(s-1,M.sources.USER):this.quill.setSelection(s+n.length(),M.sources.USER)}},"list autofill":{key:" ",shiftKey:null,collapsed:!0,format:{"code-block":!1,blockquote:!1,table:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler(r,e){if(this.quill.scroll.query("list")==null)return!0;const{length:t}=e.prefix,[n,s]=this.quill.getLine(r.index);if(s>t)return!0;let i;switch(e.prefix.trim()){case"[]":case"[ ]":i="unchecked";break;case"[x]":i="checked";break;case"-":case"*":i="bullet";break;default:i="ordered"}this.quill.insertText(r.index," ",M.sources.USER),this.quill.history.cutoff();const o=new re().retain(r.index-s).delete(t+1).retain(n.length()-2-s).retain(1,{list:i});return this.quill.updateContents(o,M.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(r.index-t,M.sources.SILENT),!1}},"code exit":{key:"Enter",collapsed:!0,format:["code-block"],prefix:/^$/,suffix:/^\s*$/,handler(r){const[e,t]=this.quill.getLine(r.index);let n=2,s=e;for(;s!=null&&s.length()<=1&&s.formats()["code-block"];)if(s=s.prev,n-=1,n<=0){const i=new re().retain(r.index+e.length()-t-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(i,M.sources.USER),this.quill.setSelection(r.index-1,M.sources.SILENT),!1}return!0}},"embed left":Bs("ArrowLeft",!1),"embed left shift":Bs("ArrowLeft",!0),"embed right":Bs("ArrowRight",!1),"embed right shift":Bs("ArrowRight",!0),"table down":Hu(!1),"table up":Hu(!0)}};Oi.DEFAULTS=$b;function Uu(r){return{key:"Tab",shiftKey:!r,format:{"code-block":!0},handler(e,t){let{event:n}=t;const s=this.quill.scroll.query("code-block"),{TAB:i}=s;if(e.length===0&&!n.shiftKey){this.quill.insertText(e.index,i,M.sources.USER),this.quill.setSelection(e.index+i.length,M.sources.SILENT);return}const o=e.length===0?this.quill.getLines(e.index,1):this.quill.getLines(e);let{index:a,length:l}=e;o.forEach((c,d)=>{r?(c.insertAt(0,i),d===0?a+=i.length:l+=i.length):c.domNode.textContent.startsWith(i)&&(c.deleteAt(0,i.length),d===0?a-=i.length:l-=i.length)}),this.quill.update(M.sources.USER),this.quill.setSelection(a,l,M.sources.SILENT)}}}function Bs(r,e){return{key:r,shiftKey:e,altKey:null,[r==="ArrowLeft"?"prefix":"suffix"]:/^$/,handler(n){let{index:s}=n;r==="ArrowRight"&&(s+=n.length+1);const[i]=this.quill.getLeaf(s);return i instanceof Qe?(r==="ArrowLeft"?e?this.quill.setSelection(n.index-1,n.length+1,M.sources.USER):this.quill.setSelection(n.index-1,M.sources.USER):e?this.quill.setSelection(n.index,n.length+1,M.sources.USER):this.quill.setSelection(n.index+n.length+1,M.sources.USER),!1):!0}}}function Go(r){return{key:r[0],shortKey:!0,handler(e,t){this.quill.format(r,!t.format[r],M.sources.USER)}}}function Hu(r){return{key:r?"ArrowUp":"ArrowDown",collapsed:!0,format:["table"],handler(e,t){const n=r?"prev":"next",s=t.line,i=s.parent[n];if(i!=null){if(i.statics.blotName==="table-row"){let o=i.children.head,a=s;for(;a.prev!=null;)a=a.prev,o=o.next;const l=o.offset(this.quill.scroll)+Math.min(t.offset,o.length()-1);this.quill.setSelection(l,0,M.sources.USER)}}else{const o=s.table()[n];o!=null&&(r?this.quill.setSelection(o.offset(this.quill.scroll)+o.length()-1,0,M.sources.USER):this.quill.setSelection(o.offset(this.quill.scroll),0,M.sources.USER))}return!1}}}function Ub(r){if(typeof r=="string"||typeof r=="number")r={key:r};else if(typeof r=="object")r=Jr(r);else return null;return r.shortKey&&(r[Vb]=r.shortKey,delete r.shortKey),r}function vl(r){let{quill:e,range:t}=r;const n=e.getLines(t);let s={};if(n.length>1){const i=n[0].formats(),o=n[n.length-1].formats();s=st.AttributeMap.diff(o,i)||{}}e.deleteText(t,M.sources.USER),Object.keys(s).length>0&&e.formatLine(t.index,1,s,M.sources.USER),e.setSelection(t.index,M.sources.SILENT)}function Hb(r,e,t,n){return e.prev==null&&e.next==null?t.prev==null&&t.next==null?n===0?-1:1:t.prev==null?-1:1:e.prev==null?-1:e.next==null?1:null}const zb=/font-weight:\s*normal/,Gb=["P","OL","UL"],zu=r=>r&&Gb.includes(r.tagName),Kb=r=>{Array.from(r.querySelectorAll("br")).filter(e=>zu(e.previousElementSibling)&&zu(e.nextElementSibling)).forEach(e=>{var t;(t=e.parentNode)==null||t.removeChild(e)})},Wb=r=>{Array.from(r.querySelectorAll('b[style*="font-weight"]')).filter(e=>{var t;return(t=e.getAttribute("style"))==null?void 0:t.match(zb)}).forEach(e=>{var n;const t=r.createDocumentFragment();t.append(...e.childNodes),(n=e.parentNode)==null||n.replaceChild(t,e)})};function Yb(r){r.querySelector('[id^="docs-internal-guid-"]')&&(Wb(r),Kb(r))}const Zb=/\bmso-list:[^;]*ignore/i,Xb=/\bmso-list:[^;]*\bl(\d+)/i,Qb=/\bmso-list:[^;]*\blevel(\d+)/i,Jb=(r,e)=>{const t=r.getAttribute("style"),n=t==null?void 0:t.match(Xb);if(!n)return null;const s=Number(n[1]),i=t==null?void 0:t.match(Qb),o=i?Number(i[1]):1,a=new RegExp(`@list l${s}:level${o}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,"i"),l=e.match(a),c=l&&l[1]==="bullet"?"bullet":"ordered";return{id:s,indent:o,type:c,element:r}},ex=r=>{var o,a;const e=Array.from(r.querySelectorAll("[style*=mso-list]")),t=[],n=[];e.forEach(l=>{(l.getAttribute("style")||"").match(Zb)?t.push(l):n.push(l)}),t.forEach(l=>{var c;return(c=l.parentNode)==null?void 0:c.removeChild(l)});const s=r.documentElement.innerHTML,i=n.map(l=>Jb(l,s)).filter(l=>l);for(;i.length;){const l=[];let c=i.shift();for(;c;)l.push(c),c=i.length&&((o=i[0])==null?void 0:o.element)===c.element.nextElementSibling&&i[0].id===c.id?i.shift():null;const d=document.createElement("ul");l.forEach(g=>{const v=document.createElement("li");v.setAttribute("data-list",g.type),g.indent>1&&v.setAttribute("class",`ql-indent-${g.indent-1}`),v.innerHTML=g.element.innerHTML,d.appendChild(v)});const m=(a=l[0])==null?void 0:a.element,{parentNode:h}=m??{};m&&(h==null||h.replaceChild(d,m)),l.slice(1).forEach(g=>{let{element:v}=g;h==null||h.removeChild(v)})}};function tx(r){r.documentElement.getAttribute("xmlns:w")==="urn:schemas-microsoft-com:office:word"&&ex(r)}const rx=[tx,Yb],nx=r=>{r.documentElement&&rx.forEach(e=>{e(r)})},sx=zt("quill:clipboard"),ix=[[Node.TEXT_NODE,vx],[Node.TEXT_NODE,Ku],["br",cx],[Node.ELEMENT_NODE,Ku],[Node.ELEMENT_NODE,ux],[Node.ELEMENT_NODE,lx],[Node.ELEMENT_NODE,mx],["li",fx],["ol, ul",px],["pre",hx],["tr",gx],["b",Ko("bold")],["i",Ko("italic")],["strike",Ko("strike")],["style",dx]],ox=[Pb,cf].reduce((r,e)=>(r[e.keyName]=e,r),{}),Gu=[lf,pl,fl,df,mf,vf].reduce((r,e)=>(r[e.keyName]=e,r),{});class yf extends yt{constructor(e,t){super(e,t),this.quill.root.addEventListener("copy",n=>this.onCaptureCopy(n,!1)),this.quill.root.addEventListener("cut",n=>this.onCaptureCopy(n,!0)),this.quill.root.addEventListener("paste",this.onCapturePaste.bind(this)),this.matchers=[],ix.concat(this.options.matchers??[]).forEach(n=>{let[s,i]=n;this.addMatcher(s,i)})}addMatcher(e,t){this.matchers.push([e,t])}convert(e){let{html:t,text:n}=e,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(s[Ve.blotName])return new re().insert(n||"",{[Ve.blotName]:s[Ve.blotName]});if(!t)return new re().insert(n||"",s);const i=this.convertHTML(t);return ns(i,`
`)&&(i.ops[i.ops.length-1].attributes==null||s.table)?i.compose(new re().retain(i.length()-1).delete(1)):i}normalizeHTML(e){nx(e)}convertHTML(e){const t=new DOMParser().parseFromString(e,"text/html");this.normalizeHTML(t);const n=t.body,s=new WeakMap,[i,o]=this.prepareMatching(n,s);return yl(this.quill.scroll,n,i,o,s)}dangerouslyPasteHTML(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:M.sources.API;if(typeof e=="string"){const s=this.convert({html:e,text:""});this.quill.setContents(s,t),this.quill.setSelection(0,M.sources.SILENT)}else{const s=this.convert({html:t,text:""});this.quill.updateContents(new re().retain(e).concat(s),n),this.quill.setSelection(e+s.length(),M.sources.SILENT)}}onCaptureCopy(e){var o,a;let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(e.defaultPrevented)return;e.preventDefault();const[n]=this.quill.selection.getRange();if(n==null)return;const{html:s,text:i}=this.onCopy(n,t);(o=e.clipboardData)==null||o.setData("text/plain",i),(a=e.clipboardData)==null||a.setData("text/html",s),t&&vl({range:n,quill:this.quill})}normalizeURIList(e){return e.split(/\r?\n/).filter(t=>t[0]!=="#").join(`
`)}onCapturePaste(e){var o,a,l,c,d;if(e.defaultPrevented||!this.quill.isEnabled())return;e.preventDefault();const t=this.quill.getSelection(!0);if(t==null)return;const n=(o=e.clipboardData)==null?void 0:o.getData("text/html");let s=(a=e.clipboardData)==null?void 0:a.getData("text/plain");if(!n&&!s){const m=(l=e.clipboardData)==null?void 0:l.getData("text/uri-list");m&&(s=this.normalizeURIList(m))}const i=Array.from(((c=e.clipboardData)==null?void 0:c.files)||[]);if(!n&&i.length>0){this.quill.uploader.upload(t,i);return}if(n&&i.length>0){const m=new DOMParser().parseFromString(n,"text/html");if(m.body.childElementCount===1&&((d=m.body.firstElementChild)==null?void 0:d.tagName)==="IMG"){this.quill.uploader.upload(t,i);return}}this.onPaste(t,{html:n,text:s})}onCopy(e){const t=this.quill.getText(e);return{html:this.quill.getSemanticHTML(e),text:t}}onPaste(e,t){let{text:n,html:s}=t;const i=this.quill.getFormat(e.index),o=this.convert({text:n,html:s},i);sx.log("onPaste",o,{text:n,html:s});const a=new re().retain(e.index).delete(e.length).concat(o);this.quill.updateContents(a,M.sources.USER),this.quill.setSelection(a.length()-e.length,M.sources.SILENT),this.quill.scrollSelectionIntoView()}prepareMatching(e,t){const n=[],s=[];return this.matchers.forEach(i=>{const[o,a]=i;switch(o){case Node.TEXT_NODE:s.push(a);break;case Node.ELEMENT_NODE:n.push(a);break;default:Array.from(e.querySelectorAll(o)).forEach(l=>{if(t.has(l)){const c=t.get(l);c==null||c.push(a)}else t.set(l,[a])});break}}),[n,s]}}J(yf,"DEFAULTS",{matchers:[]});function Lr(r,e,t,n){return n.query(e)?r.reduce((s,i)=>{if(!i.insert)return s;if(i.attributes&&i.attributes[e])return s.push(i);const o=t?{[e]:t}:{};return s.insert(i.insert,{...o,...i.attributes})},new re):r}function ns(r,e){let t="";for(let n=r.ops.length-1;n>=0&&t.length<e.length;--n){const s=r.ops[n];if(typeof s.insert!="string")break;t=s.insert+t}return t.slice(-1*e.length)===e}function Qt(r,e){if(!(r instanceof Element))return!1;const t=e.query(r);return t&&t.prototype instanceof Qe?!1:["address","article","blockquote","canvas","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","iframe","li","main","nav","ol","output","p","pre","section","table","td","tr","ul","video"].includes(r.tagName.toLowerCase())}function ax(r,e){return r.previousElementSibling&&r.nextElementSibling&&!Qt(r.previousElementSibling,e)&&!Qt(r.nextElementSibling,e)}const qs=new WeakMap;function bf(r){return r==null?!1:(qs.has(r)||(r.tagName==="PRE"?qs.set(r,!0):qs.set(r,bf(r.parentNode))),qs.get(r))}function yl(r,e,t,n,s){return e.nodeType===e.TEXT_NODE?n.reduce((i,o)=>o(e,i,r),new re):e.nodeType===e.ELEMENT_NODE?Array.from(e.childNodes||[]).reduce((i,o)=>{let a=yl(r,o,t,n,s);return o.nodeType===e.ELEMENT_NODE&&(a=t.reduce((l,c)=>c(o,l,r),a),a=(s.get(o)||[]).reduce((l,c)=>c(o,l,r),a)),i.concat(a)},new re):new re}function Ko(r){return(e,t,n)=>Lr(t,r,!0,n)}function lx(r,e,t){const n=Tt.keys(r),s=gt.keys(r),i=lr.keys(r),o={};return n.concat(s).concat(i).forEach(a=>{let l=t.query(a,ne.ATTRIBUTE);l!=null&&(o[l.attrName]=l.value(r),o[l.attrName])||(l=ox[a],l!=null&&(l.attrName===a||l.keyName===a)&&(o[l.attrName]=l.value(r)||void 0),l=Gu[a],l!=null&&(l.attrName===a||l.keyName===a)&&(l=Gu[a],o[l.attrName]=l.value(r)||void 0))}),Object.entries(o).reduce((a,l)=>{let[c,d]=l;return Lr(a,c,d,t)},e)}function ux(r,e,t){const n=t.query(r);if(n==null)return e;if(n.prototype instanceof Qe){const s={},i=n.value(r);if(i!=null)return s[n.blotName]=i,new re().insert(s,n.formats(r,t))}else if(n.prototype instanceof Zn&&!ns(e,`
`)&&e.insert(`
`),"blotName"in n&&"formats"in n&&typeof n.formats=="function")return Lr(e,n.blotName,n.formats(r,t),t);return e}function cx(r,e){return ns(e,`
`)||e.insert(`
`),e}function hx(r,e,t){const n=t.query("code-block"),s=n&&"formats"in n&&typeof n.formats=="function"?n.formats(r,t):!0;return Lr(e,"code-block",s,t)}function dx(){return new re}function fx(r,e,t){const n=t.query(r);if(n==null||n.blotName!=="list"||!ns(e,`
`))return e;let s=-1,i=r.parentNode;for(;i!=null;)["OL","UL"].includes(i.tagName)&&(s+=1),i=i.parentNode;return s<=0?e:e.reduce((o,a)=>a.insert?a.attributes&&typeof a.attributes.indent=="number"?o.push(a):o.insert(a.insert,{indent:s,...a.attributes||{}}):o,new re)}function px(r,e,t){const n=r;let s=n.tagName==="OL"?"ordered":"bullet";const i=n.getAttribute("data-checked");return i&&(s=i==="true"?"checked":"unchecked"),Lr(e,"list",s,t)}function Ku(r,e,t){if(!ns(e,`
`)){if(Qt(r,t)&&(r.childNodes.length>0||r instanceof HTMLParagraphElement))return e.insert(`
`);if(e.length()>0&&r.nextSibling){let n=r.nextSibling;for(;n!=null;){if(Qt(n,t))return e.insert(`
`);const s=t.query(n);if(s&&s.prototype instanceof nt)return e.insert(`
`);n=n.firstChild}}}return e}function mx(r,e,t){var i;const n={},s=r.style||{};return s.fontStyle==="italic"&&(n.italic=!0),s.textDecoration==="underline"&&(n.underline=!0),s.textDecoration==="line-through"&&(n.strike=!0),((i=s.fontWeight)!=null&&i.startsWith("bold")||parseInt(s.fontWeight,10)>=700)&&(n.bold=!0),e=Object.entries(n).reduce((o,a)=>{let[l,c]=a;return Lr(o,l,c,t)},e),parseFloat(s.textIndent||0)>0?new re().insert(" ").concat(e):e}function gx(r,e,t){var s,i;const n=((s=r.parentElement)==null?void 0:s.tagName)==="TABLE"?r.parentElement:(i=r.parentElement)==null?void 0:i.parentElement;if(n!=null){const a=Array.from(n.querySelectorAll("tr")).indexOf(r)+1;return Lr(e,"table",a,t)}return e}function vx(r,e,t){var s;let n=r.data;if(((s=r.parentElement)==null?void 0:s.tagName)==="O:P")return e.insert(n.trim());if(!bf(r)){if(n.trim().length===0&&n.includes(`
`)&&!ax(r,t))return e;n=n.replace(/[^\S\u00a0]/g," "),n=n.replace(/ {2,}/g," "),(r.previousSibling==null&&r.parentElement!=null&&Qt(r.parentElement,t)||r.previousSibling instanceof Element&&Qt(r.previousSibling,t))&&(n=n.replace(/^ /,"")),(r.nextSibling==null&&r.parentElement!=null&&Qt(r.parentElement,t)||r.nextSibling instanceof Element&&Qt(r.nextSibling,t))&&(n=n.replace(/ $/,"")),n=n.replaceAll(" "," ")}return e.insert(n)}class xf extends yt{constructor(t,n){super(t,n);J(this,"lastRecorded",0);J(this,"ignoreChange",!1);J(this,"stack",{undo:[],redo:[]});J(this,"currentRange",null);this.quill.on(M.events.EDITOR_CHANGE,(s,i,o,a)=>{s===M.events.SELECTION_CHANGE?i&&a!==M.sources.SILENT&&(this.currentRange=i):s===M.events.TEXT_CHANGE&&(this.ignoreChange||(!this.options.userOnly||a===M.sources.USER?this.record(i,o):this.transform(i)),this.currentRange=Ra(this.currentRange,i))}),this.quill.keyboard.addBinding({key:"z",shortKey:!0},this.undo.bind(this)),this.quill.keyboard.addBinding({key:["z","Z"],shortKey:!0,shiftKey:!0},this.redo.bind(this)),/Win/i.test(navigator.platform)&&this.quill.keyboard.addBinding({key:"y",shortKey:!0},this.redo.bind(this)),this.quill.root.addEventListener("beforeinput",s=>{s.inputType==="historyUndo"?(this.undo(),s.preventDefault()):s.inputType==="historyRedo"&&(this.redo(),s.preventDefault())})}change(t,n){if(this.stack[t].length===0)return;const s=this.stack[t].pop();if(!s)return;const i=this.quill.getContents(),o=s.delta.invert(i);this.stack[n].push({delta:o,range:Ra(s.range,o)}),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(s.delta,M.sources.USER),this.ignoreChange=!1,this.restoreSelection(s)}clear(){this.stack={undo:[],redo:[]}}cutoff(){this.lastRecorded=0}record(t,n){if(t.ops.length===0)return;this.stack.redo=[];let s=t.invert(n),i=this.currentRange;const o=Date.now();if(this.lastRecorded+this.options.delay>o&&this.stack.undo.length>0){const a=this.stack.undo.pop();a&&(s=s.compose(a.delta),i=a.range)}else this.lastRecorded=o;s.length()!==0&&(this.stack.undo.push({delta:s,range:i}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift())}redo(){this.change("redo","undo")}transform(t){Wu(this.stack.undo,t),Wu(this.stack.redo,t)}undo(){this.change("undo","redo")}restoreSelection(t){if(t.range)this.quill.setSelection(t.range,M.sources.USER);else{const n=bx(this.quill.scroll,t.delta);this.quill.setSelection(n,M.sources.USER)}}}J(xf,"DEFAULTS",{delay:1e3,maxStack:100,userOnly:!1});function Wu(r,e){let t=e;for(let n=r.length-1;n>=0;n-=1){const s=r[n];r[n]={delta:t.transform(s.delta,!0),range:s.range&&Ra(s.range,t)},t=s.delta.transform(t),r[n].delta.length()===0&&r.splice(n,1)}}function yx(r,e){const t=e.ops[e.ops.length-1];return t==null?!1:t.insert!=null?typeof t.insert=="string"&&t.insert.endsWith(`
`):t.attributes!=null?Object.keys(t.attributes).some(n=>r.query(n,ne.BLOCK)!=null):!1}function bx(r,e){const t=e.reduce((s,i)=>s+(i.delete||0),0);let n=e.length()-t;return yx(r,e)&&(n-=1),n}function Ra(r,e){if(!r)return r;const t=e.transformPosition(r.index),n=e.transformPosition(r.index+r.length);return{index:t,length:n-t}}class Ef extends yt{constructor(e,t){super(e,t),e.root.addEventListener("drop",n=>{var o;n.preventDefault();let s=null;if(document.caretRangeFromPoint)s=document.caretRangeFromPoint(n.clientX,n.clientY);else if(document.caretPositionFromPoint){const a=document.caretPositionFromPoint(n.clientX,n.clientY);s=document.createRange(),s.setStart(a.offsetNode,a.offset),s.setEnd(a.offsetNode,a.offset)}const i=s&&e.selection.normalizeNative(s);if(i){const a=e.selection.normalizedToRange(i);(o=n.dataTransfer)!=null&&o.files&&this.upload(a,n.dataTransfer.files)}})}upload(e,t){const n=[];Array.from(t).forEach(s=>{var i;s&&((i=this.options.mimetypes)!=null&&i.includes(s.type))&&n.push(s)}),n.length>0&&this.options.handler.call(this,e,n)}}Ef.DEFAULTS={mimetypes:["image/png","image/jpeg"],handler(r,e){if(!this.quill.scroll.query("image"))return;const t=e.map(n=>new Promise(s=>{const i=new FileReader;i.onload=()=>{s(i.result)},i.readAsDataURL(n)}));Promise.all(t).then(n=>{const s=n.reduce((i,o)=>i.insert({image:o}),new re().retain(r.index).delete(r.length));this.quill.updateContents(s,te.sources.USER),this.quill.setSelection(r.index+n.length,te.sources.SILENT)})}};const xx=["insertText","insertReplacementText"];class Ex extends yt{constructor(e,t){super(e,t),e.root.addEventListener("beforeinput",n=>{this.handleBeforeInput(n)}),/Android/i.test(navigator.userAgent)||e.on(M.events.COMPOSITION_BEFORE_START,()=>{this.handleCompositionStart()})}deleteRange(e){vl({range:e,quill:this.quill})}replaceText(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(e.length===0)return!1;if(t){const n=this.quill.getFormat(e.index,1);this.deleteRange(e),this.quill.updateContents(new re().retain(e.index).insert(t,n),M.sources.USER)}else this.deleteRange(e);return this.quill.setSelection(e.index+t.length,0,M.sources.SILENT),!0}handleBeforeInput(e){if(this.quill.composition.isComposing||e.defaultPrevented||!xx.includes(e.inputType))return;const t=e.getTargetRanges?e.getTargetRanges()[0]:null;if(!t||t.collapsed===!0)return;const n=wx(e);if(n==null)return;const s=this.quill.selection.normalizeNative(t),i=s?this.quill.selection.normalizedToRange(s):null;i&&this.replaceText(i,n)&&e.preventDefault()}handleCompositionStart(){const e=this.quill.getSelection();e&&this.replaceText(e)}}function wx(r){var e;return typeof r.data=="string"?r.data:(e=r.dataTransfer)!=null&&e.types.includes("text/plain")?r.dataTransfer.getData("text/plain"):null}const Sx=/Mac/i.test(navigator.platform),_x=100,Ax=r=>!!(r.key==="ArrowLeft"||r.key==="ArrowRight"||r.key==="ArrowUp"||r.key==="ArrowDown"||r.key==="Home"||Sx&&r.key==="a"&&r.ctrlKey===!0);class Cx extends yt{constructor(t,n){super(t,n);J(this,"isListening",!1);J(this,"selectionChangeDeadline",0);this.handleArrowKeys(),this.handleNavigationShortcuts()}handleArrowKeys(){this.quill.keyboard.addBinding({key:["ArrowLeft","ArrowRight"],offset:0,shiftKey:null,handler(t,n){let{line:s,event:i}=n;if(!(s instanceof pt)||!s.uiNode)return!0;const o=getComputedStyle(s.domNode).direction==="rtl";return o&&i.key!=="ArrowRight"||!o&&i.key!=="ArrowLeft"?!0:(this.quill.setSelection(t.index-1,t.length+(i.shiftKey?1:0),M.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",t=>{!t.defaultPrevented&&Ax(t)&&this.ensureListeningToSelectionChange()})}ensureListeningToSelectionChange(){if(this.selectionChangeDeadline=Date.now()+_x,this.isListening)return;this.isListening=!0;const t=()=>{this.isListening=!1,Date.now()<=this.selectionChangeDeadline&&this.handleSelectionChange()};document.addEventListener("selectionchange",t,{once:!0})}handleSelectionChange(){const t=document.getSelection();if(!t)return;const n=t.getRangeAt(0);if(n.collapsed!==!0||n.startOffset!==0)return;const s=this.quill.scroll.find(n.startContainer);if(!(s instanceof pt)||!s.uiNode)return;const i=document.createRange();i.setStartAfter(s.uiNode),i.setEndAfter(s.uiNode),t.removeAllRanges(),t.addRange(i)}}M.register({"blots/block":De,"blots/block/embed":nt,"blots/break":vt,"blots/container":Ir,"blots/cursor":hn,"blots/embed":hl,"blots/inline":Nt,"blots/scroll":Qr,"blots/text":mt,"modules/clipboard":yf,"modules/history":xf,"modules/keyboard":Oi,"modules/uploader":Ef,"modules/input":Ex,"modules/uiNode":Cx});class kx extends gt{add(e,t){let n=0;if(t==="+1"||t==="-1"){const s=this.value(e)||0;n=t==="+1"?s+1:s-1}else typeof t=="number"&&(n=t);return n===0?(this.remove(e),!0):super.add(e,n.toString())}canAdd(e,t){return super.canAdd(e,t)||super.canAdd(e,parseInt(t,10))}value(e){return parseInt(super.value(e),10)||void 0}}const Tx=new kx("indent","ql-indent",{scope:ne.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class Ia extends De{}J(Ia,"blotName","blockquote"),J(Ia,"tagName","blockquote");class Oa extends De{static formats(e){return this.tagName.indexOf(e.tagName)+1}}J(Oa,"blotName","header"),J(Oa,"tagName",["H1","H2","H3","H4","H5","H6"]);class ss extends Ir{}ss.blotName="list-container";ss.tagName="OL";class is extends De{static create(e){const t=super.create();return t.setAttribute("data-list",e),t}static formats(e){return e.getAttribute("data-list")||void 0}static register(){M.register(ss)}constructor(e,t){super(e,t);const n=t.ownerDocument.createElement("span"),s=i=>{if(!e.isEnabled())return;const o=this.statics.formats(t,e);o==="checked"?(this.format("list","unchecked"),i.preventDefault()):o==="unchecked"&&(this.format("list","checked"),i.preventDefault())};n.addEventListener("mousedown",s),n.addEventListener("touchstart",s),this.attachUI(n)}format(e,t){e===this.statics.blotName&&t?this.domNode.setAttribute("data-list",t):super.format(e,t)}}is.blotName="list";is.tagName="LI";ss.allowedChildren=[is];is.requiredContainer=ss;class Qn extends Nt{static create(){return super.create()}static formats(){return!0}optimize(e){super.optimize(e),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}J(Qn,"blotName","bold"),J(Qn,"tagName",["STRONG","B"]);class La extends Qn{}J(La,"blotName","italic"),J(La,"tagName",["EM","I"]);class Jt extends Nt{static create(e){const t=super.create(e);return t.setAttribute("href",this.sanitize(e)),t.setAttribute("rel","noopener noreferrer"),t.setAttribute("target","_blank"),t}static formats(e){return e.getAttribute("href")}static sanitize(e){return wf(e,this.PROTOCOL_WHITELIST)?e:this.SANITIZED_URL}format(e,t){e!==this.statics.blotName||!t?super.format(e,t):this.domNode.setAttribute("href",this.constructor.sanitize(t))}}J(Jt,"blotName","link"),J(Jt,"tagName","A"),J(Jt,"SANITIZED_URL","about:blank"),J(Jt,"PROTOCOL_WHITELIST",["http","https","mailto","tel","sms"]);function wf(r,e){const t=document.createElement("a");t.href=r;const n=t.href.slice(0,t.href.indexOf(":"));return e.indexOf(n)>-1}class Ma extends Nt{static create(e){return e==="super"?document.createElement("sup"):e==="sub"?document.createElement("sub"):super.create(e)}static formats(e){if(e.tagName==="SUB")return"sub";if(e.tagName==="SUP")return"super"}}J(Ma,"blotName","script"),J(Ma,"tagName",["SUB","SUP"]);class Da extends Qn{}J(Da,"blotName","strike"),J(Da,"tagName",["S","STRIKE"]);class Pa extends Nt{}J(Pa,"blotName","underline"),J(Pa,"tagName","U");class Zs extends hl{static create(e){if(window.katex==null)throw new Error("Formula module requires KaTeX.");const t=super.create(e);return typeof e=="string"&&(window.katex.render(e,t,{throwOnError:!1,errorColor:"#f00"}),t.setAttribute("data-value",e)),t}static value(e){return e.getAttribute("data-value")}html(){const{formula:e}=this.value();return`<span>${e}</span>`}}J(Zs,"blotName","formula"),J(Zs,"className","ql-formula"),J(Zs,"tagName","SPAN");const Yu=["alt","height","width"];class Ba extends Qe{static create(e){const t=super.create(e);return typeof e=="string"&&t.setAttribute("src",this.sanitize(e)),t}static formats(e){return Yu.reduce((t,n)=>(e.hasAttribute(n)&&(t[n]=e.getAttribute(n)),t),{})}static match(e){return/\.(jpe?g|gif|png)$/.test(e)||/^data:image\/.+;base64/.test(e)}static sanitize(e){return wf(e,["http","https","data"])?e:"//:0"}static value(e){return e.getAttribute("src")}format(e,t){Yu.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}}J(Ba,"blotName","image"),J(Ba,"tagName","IMG");const Zu=["height","width"];class Xs extends nt{static create(e){const t=super.create(e);return t.setAttribute("frameborder","0"),t.setAttribute("allowfullscreen","true"),t.setAttribute("src",this.sanitize(e)),t}static formats(e){return Zu.reduce((t,n)=>(e.hasAttribute(n)&&(t[n]=e.getAttribute(n)),t),{})}static sanitize(e){return Jt.sanitize(e)}static value(e){return e.getAttribute("src")}format(e,t){Zu.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}html(){const{video:e}=this.value();return`<a href="${e}">${e}</a>`}}J(Xs,"blotName","video"),J(Xs,"className","ql-video"),J(Xs,"tagName","IFRAME");const Vn=new gt("code-token","hljs",{scope:ne.INLINE});class jt extends Nt{static formats(e,t){for(;e!=null&&e!==t.domNode;){if(e.classList&&e.classList.contains(Ve.className))return super.formats(e,t);e=e.parentNode}}constructor(e,t,n){super(e,t,n),Vn.add(this.domNode,n)}format(e,t){e!==jt.blotName?super.format(e,t):t?Vn.add(this.domNode,t):(Vn.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),Vn.value(this.domNode)||this.unwrap()}}jt.blotName="code-token";jt.className="ql-token";class rt extends Ve{static create(e){const t=super.create(e);return typeof e=="string"&&t.setAttribute("data-language",e),t}static formats(e){return e.getAttribute("data-language")||"plain"}static register(){}format(e,t){e===this.statics.blotName&&t?this.domNode.setAttribute("data-language",t):super.format(e,t)}replaceWith(e,t){return this.formatAt(0,this.length(),jt.blotName,!1),super.replaceWith(e,t)}}class Hn extends Or{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(e,t){e===rt.blotName&&(this.forceNext=!0,this.children.forEach(n=>{n.format(e,t)}))}formatAt(e,t,n,s){n===rt.blotName&&(this.forceNext=!0),super.formatAt(e,t,n,s)}highlight(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.children.head==null)return;const s=`${Array.from(this.domNode.childNodes).filter(o=>o!==this.uiNode).map(o=>o.textContent).join(`
`)}
`,i=rt.formats(this.children.head.domNode);if(t||this.forceNext||this.cachedText!==s){if(s.trim().length>0||this.cachedText==null){const o=this.children.reduce((l,c)=>l.concat(sf(c,!1)),new re),a=e(s,i);o.diff(a).reduce((l,c)=>{let{retain:d,attributes:m}=c;return d?(m&&Object.keys(m).forEach(h=>{[rt.blotName,jt.blotName].includes(h)&&this.formatAt(l,d,h,m[h])}),l+d):l},0)}this.cachedText=s,this.forceNext=!1}}html(e,t){const[n]=this.children.find(e);return`<pre data-language="${n?rt.formats(n.domNode):"plain"}">
${Ii(this.code(e,t))}
</pre>`}optimize(e){if(super.optimize(e),this.parent!=null&&this.children.head!=null&&this.uiNode!=null){const t=rt.formats(this.children.head.domNode);t!==this.uiNode.value&&(this.uiNode.value=t)}}}Hn.allowedChildren=[rt];rt.requiredContainer=Hn;rt.allowedChildren=[jt,hn,mt,vt];const Nx=(r,e,t)=>{if(typeof r.versionString=="string"){const n=r.versionString.split(".")[0];if(parseInt(n,10)>=11)return r.highlight(t,{language:e}).value}return r.highlight(e,t).value};class Sf extends yt{static register(){M.register(jt,!0),M.register(rt,!0),M.register(Hn,!0)}constructor(e,t){if(super(e,t),this.options.hljs==null)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");this.languages=this.options.languages.reduce((n,s)=>{let{key:i}=s;return n[i]=!0,n},{}),this.highlightBlot=this.highlightBlot.bind(this),this.initListener(),this.initTimer()}initListener(){this.quill.on(M.events.SCROLL_BLOT_MOUNT,e=>{if(!(e instanceof Hn))return;const t=this.quill.root.ownerDocument.createElement("select");this.options.languages.forEach(n=>{let{key:s,label:i}=n;const o=t.ownerDocument.createElement("option");o.textContent=i,o.setAttribute("value",s),t.appendChild(o)}),t.addEventListener("change",()=>{e.format(rt.blotName,t.value),this.quill.root.focus(),this.highlight(e,!0)}),e.uiNode==null&&(e.attachUI(t),e.children.head&&(t.value=rt.formats(e.children.head.domNode)))})}initTimer(){let e=null;this.quill.on(M.events.SCROLL_OPTIMIZE,()=>{e&&clearTimeout(e),e=setTimeout(()=>{this.highlight(),e=null},this.options.interval)})}highlight(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.quill.selection.composing)return;this.quill.update(M.sources.USER);const n=this.quill.getSelection();(e==null?this.quill.scroll.descendants(Hn):[e]).forEach(i=>{i.highlight(this.highlightBlot,t)}),this.quill.update(M.sources.SILENT),n!=null&&this.quill.setSelection(n,M.sources.SILENT)}highlightBlot(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"plain";if(t=this.languages[t]?t:"plain",t==="plain")return Ii(e).split(`
`).reduce((s,i,o)=>(o!==0&&s.insert(`
`,{[Ve.blotName]:t}),s.insert(i)),new re);const n=this.quill.root.ownerDocument.createElement("div");return n.classList.add(Ve.className),n.innerHTML=Nx(this.options.hljs,t,e),yl(this.quill.scroll,n,[(s,i)=>{const o=Vn.value(s);return o?i.compose(new re().retain(i.length(),{[jt.blotName]:o})):i}],[(s,i)=>s.data.split(`
`).reduce((o,a,l)=>(l!==0&&o.insert(`
`,{[Ve.blotName]:t}),o.insert(a)),i)],new WeakMap)}}Sf.DEFAULTS={hljs:window.hljs,interval:1e3,languages:[{key:"plain",label:"Plain"},{key:"bash",label:"Bash"},{key:"cpp",label:"C++"},{key:"cs",label:"C#"},{key:"css",label:"CSS"},{key:"diff",label:"Diff"},{key:"xml",label:"HTML/XML"},{key:"java",label:"Java"},{key:"javascript",label:"JavaScript"},{key:"markdown",label:"Markdown"},{key:"php",label:"PHP"},{key:"python",label:"Python"},{key:"ruby",label:"Ruby"},{key:"sql",label:"SQL"}]};const Gn=class Gn extends De{static create(e){const t=super.create();return e?t.setAttribute("data-row",e):t.setAttribute("data-row",bl()),t}static formats(e){if(e.hasAttribute("data-row"))return e.getAttribute("data-row")}cellOffset(){return this.parent?this.parent.children.indexOf(this):-1}format(e,t){e===Gn.blotName&&t?this.domNode.setAttribute("data-row",t):super.format(e,t)}row(){return this.parent}rowOffset(){return this.row()?this.row().rowOffset():-1}table(){return this.row()&&this.row().table()}};J(Gn,"blotName","table"),J(Gn,"tagName","TD");let dt=Gn;class Vt extends Ir{checkMerge(){if(super.checkMerge()&&this.next.children.head!=null){const e=this.children.head.formats(),t=this.children.tail.formats(),n=this.next.children.head.formats(),s=this.next.children.tail.formats();return e.table===t.table&&e.table===n.table&&e.table===s.table}return!1}optimize(e){super.optimize(e),this.children.forEach(t=>{if(t.next==null)return;const n=t.formats(),s=t.next.formats();if(n.table!==s.table){const i=this.splitAfter(t);i&&i.optimize(),this.prev&&this.prev.optimize()}})}rowOffset(){return this.parent?this.parent.children.indexOf(this):-1}table(){return this.parent&&this.parent.parent}}J(Vt,"blotName","table-row"),J(Vt,"tagName","TR");class kt extends Ir{}J(kt,"blotName","table-body"),J(kt,"tagName","TBODY");class fn extends Ir{balanceCells(){const e=this.descendants(Vt),t=e.reduce((n,s)=>Math.max(s.children.length,n),0);e.forEach(n=>{new Array(t-n.children.length).fill(0).forEach(()=>{let s;n.children.head!=null&&(s=dt.formats(n.children.head.domNode));const i=this.scroll.create(dt.blotName,s);n.appendChild(i),i.optimize()})})}cells(e){return this.rows().map(t=>t.children.at(e))}deleteColumn(e){const[t]=this.descendant(kt);t==null||t.children.head==null||t.children.forEach(n=>{const s=n.children.at(e);s!=null&&s.remove()})}insertColumn(e){const[t]=this.descendant(kt);t==null||t.children.head==null||t.children.forEach(n=>{const s=n.children.at(e),i=dt.formats(n.children.head.domNode),o=this.scroll.create(dt.blotName,i);n.insertBefore(o,s)})}insertRow(e){const[t]=this.descendant(kt);if(t==null||t.children.head==null)return;const n=bl(),s=this.scroll.create(Vt.blotName);t.children.head.children.forEach(()=>{const o=this.scroll.create(dt.blotName,n);s.appendChild(o)});const i=t.children.at(e);t.insertBefore(s,i)}rows(){const e=this.children.head;return e==null?[]:e.children.map(t=>t)}}J(fn,"blotName","table-container"),J(fn,"tagName","TABLE");fn.allowedChildren=[kt];kt.requiredContainer=fn;kt.allowedChildren=[Vt];Vt.requiredContainer=kt;Vt.allowedChildren=[dt];dt.requiredContainer=Vt;function bl(){return`row-${Math.random().toString(36).slice(2,6)}`}class Rx extends yt{static register(){M.register(dt),M.register(Vt),M.register(kt),M.register(fn)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(fn).forEach(e=>{e.balanceCells()})}deleteColumn(){const[e,,t]=this.getTable();t!=null&&(e.deleteColumn(t.cellOffset()),this.quill.update(M.sources.USER))}deleteRow(){const[,e]=this.getTable();e!=null&&(e.remove(),this.quill.update(M.sources.USER))}deleteTable(){const[e]=this.getTable();if(e==null)return;const t=e.offset();e.remove(),this.quill.update(M.sources.USER),this.quill.setSelection(t,M.sources.SILENT)}getTable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.quill.getSelection();if(e==null)return[null,null,null,-1];const[t,n]=this.quill.getLine(e.index);if(t==null||t.statics.blotName!==dt.blotName)return[null,null,null,-1];const s=t.parent;return[s.parent.parent,s,t,n]}insertColumn(e){const t=this.quill.getSelection();if(!t)return;const[n,s,i]=this.getTable(t);if(i==null)return;const o=i.cellOffset();n.insertColumn(o+e),this.quill.update(M.sources.USER);let a=s.rowOffset();e===0&&(a+=1),this.quill.setSelection(t.index+a,t.length,M.sources.SILENT)}insertColumnLeft(){this.insertColumn(0)}insertColumnRight(){this.insertColumn(1)}insertRow(e){const t=this.quill.getSelection();if(!t)return;const[n,s,i]=this.getTable(t);if(i==null)return;const o=s.rowOffset();n.insertRow(o+e),this.quill.update(M.sources.USER),e>0?this.quill.setSelection(t,M.sources.SILENT):this.quill.setSelection(t.index+s.children.length,t.length,M.sources.SILENT)}insertRowAbove(){this.insertRow(0)}insertRowBelow(){this.insertRow(1)}insertTable(e,t){const n=this.quill.getSelection();if(n==null)return;const s=new Array(e).fill(0).reduce(i=>{const o=new Array(t).fill(`
`).join("");return i.insert(o,{table:bl()})},new re().retain(n.index));this.quill.updateContents(s,M.sources.USER),this.quill.setSelection(n.index,M.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(M.events.SCROLL_OPTIMIZE,e=>{e.some(t=>["TD","TR","TBODY","TABLE"].includes(t.target.tagName)?(this.quill.once(M.events.TEXT_CHANGE,(n,s,i)=>{i===M.sources.USER&&this.balanceTables()}),!0):!1)})}}const Xu=zt("quill:toolbar");class xl extends yt{constructor(e,t){var n,s;if(super(e,t),Array.isArray(this.options.container)){const i=document.createElement("div");i.setAttribute("role","toolbar"),Ix(i,this.options.container),(s=(n=e.container)==null?void 0:n.parentNode)==null||s.insertBefore(i,e.container),this.container=i}else typeof this.options.container=="string"?this.container=document.querySelector(this.options.container):this.container=this.options.container;if(!(this.container instanceof HTMLElement)){Xu.error("Container required for toolbar",this.options);return}this.container.classList.add("ql-toolbar"),this.controls=[],this.handlers={},this.options.handlers&&Object.keys(this.options.handlers).forEach(i=>{var a;const o=(a=this.options.handlers)==null?void 0:a[i];o&&this.addHandler(i,o)}),Array.from(this.container.querySelectorAll("button, select")).forEach(i=>{this.attach(i)}),this.quill.on(M.events.EDITOR_CHANGE,()=>{const[i]=this.quill.selection.getRange();this.update(i)})}addHandler(e,t){this.handlers[e]=t}attach(e){let t=Array.from(e.classList).find(s=>s.indexOf("ql-")===0);if(!t)return;if(t=t.slice(3),e.tagName==="BUTTON"&&e.setAttribute("type","button"),this.handlers[t]==null&&this.quill.scroll.query(t)==null){Xu.warn("ignoring attaching to nonexistent format",t,e);return}const n=e.tagName==="SELECT"?"change":"click";e.addEventListener(n,s=>{let i;if(e.tagName==="SELECT"){if(e.selectedIndex<0)return;const a=e.options[e.selectedIndex];a.hasAttribute("selected")?i=!1:i=a.value||!1}else e.classList.contains("ql-active")?i=!1:i=e.value||!e.hasAttribute("value"),s.preventDefault();this.quill.focus();const[o]=this.quill.selection.getRange();if(this.handlers[t]!=null)this.handlers[t].call(this,i);else if(this.quill.scroll.query(t).prototype instanceof Qe){if(i=prompt(`Enter ${t}`),!i)return;this.quill.updateContents(new re().retain(o.index).delete(o.length).insert({[t]:i}),M.sources.USER)}else this.quill.format(t,i,M.sources.USER);this.update(o)}),this.controls.push([t,e])}update(e){const t=e==null?{}:this.quill.getFormat(e);this.controls.forEach(n=>{const[s,i]=n;if(i.tagName==="SELECT"){let o=null;if(e==null)o=null;else if(t[s]==null)o=i.querySelector("option[selected]");else if(!Array.isArray(t[s])){let a=t[s];typeof a=="string"&&(a=a.replace(/"/g,'\\"')),o=i.querySelector(`option[value="${a}"]`)}o==null?(i.value="",i.selectedIndex=-1):o.selected=!0}else if(e==null)i.classList.remove("ql-active"),i.setAttribute("aria-pressed","false");else if(i.hasAttribute("value")){const o=t[s],a=o===i.getAttribute("value")||o!=null&&o.toString()===i.getAttribute("value")||o==null&&!i.getAttribute("value");i.classList.toggle("ql-active",a),i.setAttribute("aria-pressed",a.toString())}else{const o=t[s]!=null;i.classList.toggle("ql-active",o),i.setAttribute("aria-pressed",o.toString())}})}}xl.DEFAULTS={};function Qu(r,e,t){const n=document.createElement("button");n.setAttribute("type","button"),n.classList.add(`ql-${e}`),n.setAttribute("aria-pressed","false"),t!=null?(n.value=t,n.setAttribute("aria-label",`${e}: ${t}`)):n.setAttribute("aria-label",e),r.appendChild(n)}function Ix(r,e){Array.isArray(e[0])||(e=[e]),e.forEach(t=>{const n=document.createElement("span");n.classList.add("ql-formats"),t.forEach(s=>{if(typeof s=="string")Qu(n,s);else{const i=Object.keys(s)[0],o=s[i];Array.isArray(o)?Ox(n,i,o):Qu(n,i,o)}}),r.appendChild(n)})}function Ox(r,e,t){const n=document.createElement("select");n.classList.add(`ql-${e}`),t.forEach(s=>{const i=document.createElement("option");s!==!1?i.setAttribute("value",String(s)):i.setAttribute("selected","selected"),n.appendChild(i)}),r.appendChild(n)}xl.DEFAULTS={container:null,handlers:{clean(){const r=this.quill.getSelection();if(r!=null)if(r.length===0){const e=this.quill.getFormat();Object.keys(e).forEach(t=>{this.quill.scroll.query(t,ne.INLINE)!=null&&this.quill.format(t,!1,M.sources.USER)})}else this.quill.removeFormat(r.index,r.length,M.sources.USER)},direction(r){const{align:e}=this.quill.getFormat();r==="rtl"&&e==null?this.quill.format("align","right",M.sources.USER):!r&&e==="right"&&this.quill.format("align",!1,M.sources.USER),this.quill.format("direction",r,M.sources.USER)},indent(r){const e=this.quill.getSelection(),t=this.quill.getFormat(e),n=parseInt(t.indent||0,10);if(r==="+1"||r==="-1"){let s=r==="+1"?1:-1;t.direction==="rtl"&&(s*=-1),this.quill.format("indent",n+s,M.sources.USER)}},link(r){r===!0&&(r=prompt("Enter link URL:")),this.quill.format("link",r,M.sources.USER)},list(r){const e=this.quill.getSelection(),t=this.quill.getFormat(e);r==="check"?t.list==="checked"||t.list==="unchecked"?this.quill.format("list",!1,M.sources.USER):this.quill.format("list","unchecked",M.sources.USER):this.quill.format("list",r,M.sources.USER)}}};const Lx='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="13" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="9" y1="4" y2="4"/></svg>',Mx='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="14" x2="4" y1="14" y2="14"/><line class="ql-stroke" x1="12" x2="6" y1="4" y2="4"/></svg>',Dx='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="5" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="9" y1="4" y2="4"/></svg>',Px='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="3" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="3" y1="4" y2="4"/></svg>',Bx='<svg viewbox="0 0 18 18"><g class="ql-fill ql-color-label"><polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"/><rect height="1" width="1" x="4" y="4"/><polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"/><rect height="1" width="1" x="2" y="6"/><rect height="1" width="1" x="3" y="5"/><rect height="1" width="1" x="4" y="7"/><polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"/><rect height="1" width="1" x="2" y="12"/><rect height="1" width="1" x="2" y="9"/><rect height="1" width="1" x="2" y="15"/><polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"/><rect height="1" width="1" x="3" y="8"/><path d="M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z"/><path d="M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z"/><path d="M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z"/><rect height="1" width="1" x="12" y="2"/><rect height="1" width="1" x="11" y="3"/><path d="M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z"/><rect height="1" width="1" x="2" y="3"/><rect height="1" width="1" x="6" y="2"/><rect height="1" width="1" x="3" y="2"/><rect height="1" width="1" x="5" y="3"/><rect height="1" width="1" x="9" y="2"/><rect height="1" width="1" x="15" y="14"/><polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"/><rect height="1" width="1" x="13" y="7"/><rect height="1" width="1" x="15" y="5"/><rect height="1" width="1" x="14" y="6"/><rect height="1" width="1" x="15" y="8"/><rect height="1" width="1" x="14" y="9"/><path d="M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z"/><rect height="1" width="1" x="14" y="3"/><polygon points="12 6.868 12 6 11.62 6 12 6.868"/><rect height="1" width="1" x="15" y="2"/><rect height="1" width="1" x="12" y="5"/><rect height="1" width="1" x="13" y="4"/><polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"/><rect height="1" width="1" x="9" y="14"/><rect height="1" width="1" x="8" y="15"/><path d="M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z"/><rect height="1" width="1" x="5" y="15"/><path d="M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z"/><rect height="1" width="1" x="11" y="15"/><path d="M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z"/><rect height="1" width="1" x="14" y="15"/><rect height="1" width="1" x="15" y="11"/></g><polyline class="ql-stroke" points="5.5 13 9 5 12.5 13"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="11" y2="11"/></svg>',qx='<svg viewbox="0 0 18 18"><rect class="ql-fill ql-stroke" height="3" width="3" x="4" y="5"/><rect class="ql-fill ql-stroke" height="3" width="3" x="11" y="5"/><path class="ql-even ql-fill ql-stroke" d="M7,8c0,4.031-3,5-3,5"/><path class="ql-even ql-fill ql-stroke" d="M14,8c0,4.031-3,5-3,5"/></svg>',Fx='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z"/><path class="ql-stroke" d="M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z"/></svg>',jx='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="5" x2="13" y1="3" y2="3"/><line class="ql-stroke" x1="6" x2="9.35" y1="12" y2="3"/><line class="ql-stroke" x1="11" x2="15" y1="11" y2="15"/><line class="ql-stroke" x1="15" x2="11" y1="11" y2="15"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="7" x="2" y="14"/></svg>',Ju='<svg viewbox="0 0 18 18"><polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"/><polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"/><line class="ql-stroke" x1="10" x2="8" y1="5" y2="13"/></svg>',Vx='<svg viewbox="0 0 18 18"><line class="ql-color-label ql-stroke ql-transparent" x1="3" x2="15" y1="15" y2="15"/><polyline class="ql-stroke" points="5.5 11 9 3 12.5 11"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="9" y2="9"/></svg>',$x='<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"/><line class="ql-stroke ql-fill" x1="15" x2="11" y1="4" y2="4"/><path class="ql-fill" d="M11,3a3,3,0,0,0,0,6h1V3H11Z"/><rect class="ql-fill" height="11" width="1" x="11" y="4"/><rect class="ql-fill" height="11" width="1" x="13" y="4"/></svg>',Ux='<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"/><line class="ql-stroke ql-fill" x1="9" x2="5" y1="4" y2="4"/><path class="ql-fill" d="M5,3A3,3,0,0,0,5,9H6V3H5Z"/><rect class="ql-fill" height="11" width="1" x="5" y="4"/><rect class="ql-fill" height="11" width="1" x="7" y="4"/></svg>',Hx='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z"/><rect class="ql-fill" height="1.6" rx="0.8" ry="0.8" width="5" x="5.15" y="6.2"/><path class="ql-fill" d="M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z"/></svg>',zx='<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>',Gx='<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>',Kx='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.65186,12.30664a2.6742,2.6742,0,0,1-2.915,2.68457,3.96592,3.96592,0,0,1-2.25537-.6709.56007.56007,0,0,1-.13232-.83594L11.64648,13c.209-.34082.48389-.36328.82471-.1543a2.32654,2.32654,0,0,0,1.12256.33008c.71484,0,1.12207-.35156,1.12207-.78125,0-.61523-.61621-.86816-1.46338-.86816H13.2085a.65159.65159,0,0,1-.68213-.41895l-.05518-.10937a.67114.67114,0,0,1,.14307-.78125l.71533-.86914a8.55289,8.55289,0,0,1,.68213-.7373V8.58887a3.93913,3.93913,0,0,1-.748.05469H11.9873a.54085.54085,0,0,1-.605-.60547V7.59863a.54085.54085,0,0,1,.605-.60547h3.75146a.53773.53773,0,0,1,.60547.59375v.17676a1.03723,1.03723,0,0,1-.27539.748L14.74854,10.0293A2.31132,2.31132,0,0,1,16.65186,12.30664ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',Wx='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm7.05371,7.96582v.38477c0,.39648-.165.60547-.46191.60547h-.47314v1.29785a.54085.54085,0,0,1-.605.60547h-.69336a.54085.54085,0,0,1-.605-.60547V12.95605H11.333a.5412.5412,0,0,1-.60547-.60547v-.15332a1.199,1.199,0,0,1,.22021-.748l2.56348-4.05957a.7819.7819,0,0,1,.72607-.39648h1.27637a.54085.54085,0,0,1,.605.60547v3.7627h.33008A.54055.54055,0,0,1,17.05371,11.96582ZM14.28125,8.7207h-.022a4.18969,4.18969,0,0,1-.38525.81348l-1.188,1.80469v.02246h1.5293V9.60059A7.04058,7.04058,0,0,1,14.28125,8.7207Z"/></svg>',Yx='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.74023,12.18555a2.75131,2.75131,0,0,1-2.91553,2.80566,3.908,3.908,0,0,1-2.25537-.68164.54809.54809,0,0,1-.13184-.8252L11.73438,13c.209-.34082.48389-.36328.8252-.1543a2.23757,2.23757,0,0,0,1.1001.33008,1.01827,1.01827,0,0,0,1.1001-.96777c0-.61621-.53906-.97949-1.25439-.97949a2.15554,2.15554,0,0,0-.64893.09961,1.15209,1.15209,0,0,1-.814.01074l-.12109-.04395a.64116.64116,0,0,1-.45117-.71484l.231-3.00391a.56666.56666,0,0,1,.62744-.583H15.541a.54085.54085,0,0,1,.605.60547v.43945a.54085.54085,0,0,1-.605.60547H13.41748l-.04395.72559a1.29306,1.29306,0,0,1-.04395.30859h.022a2.39776,2.39776,0,0,1,.57227-.07715A2.53266,2.53266,0,0,1,16.74023,12.18555ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',Zx='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M14.51758,9.64453a1.85627,1.85627,0,0,0-1.24316.38477H13.252a1.73532,1.73532,0,0,1,1.72754-1.4082,2.66491,2.66491,0,0,1,.5498.06641c.35254.05469.57227.01074.70508-.40723l.16406-.5166a.53393.53393,0,0,0-.373-.75977,4.83723,4.83723,0,0,0-1.17773-.14258c-2.43164,0-3.7627,2.17773-3.7627,4.43359,0,2.47559,1.60645,3.69629,3.19043,3.69629A2.70585,2.70585,0,0,0,16.96,12.19727,2.43861,2.43861,0,0,0,14.51758,9.64453Zm-.23047,3.58691c-.67187,0-1.22168-.81445-1.22168-1.45215,0-.47363.30762-.583.72559-.583.96875,0,1.27734.59375,1.27734,1.12207A.82182.82182,0,0,1,14.28711,13.23145ZM10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Z"/></svg>',Xx='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="13" y1="4" y2="4"/><line class="ql-stroke" x1="5" x2="11" y1="14" y2="14"/><line class="ql-stroke" x1="8" x2="10" y1="14" y2="4"/></svg>',Qx='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="10" width="12" x="3" y="4"/><circle class="ql-fill" cx="6" cy="7" r="1"/><polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"/></svg>',Jx='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"/></svg>',eE='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="5 7 5 11 3 9 5 7"/></svg>',tE='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="11" y1="7" y2="11"/><path class="ql-even ql-stroke" d="M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z"/><path class="ql-even ql-stroke" d="M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z"/></svg>',rE='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="6" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="6" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="6" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="3" y1="4" y2="4"/><line class="ql-stroke" x1="3" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="3" y1="14" y2="14"/></svg>',nE='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="9" x2="15" y1="4" y2="4"/><polyline class="ql-stroke" points="3 4 4 5 6 3"/><line class="ql-stroke" x1="9" x2="15" y1="14" y2="14"/><polyline class="ql-stroke" points="3 14 4 15 6 13"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="3 9 4 10 6 8"/></svg>',sE='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="7" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="7" x2="15" y1="14" y2="14"/><line class="ql-stroke ql-thin" x1="2.5" x2="4.5" y1="5.5" y2="5.5"/><path class="ql-fill" d="M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z"/><path class="ql-stroke ql-thin" d="M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156"/><path class="ql-stroke ql-thin" d="M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109"/></svg>',iE='<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>',oE='<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>',aE='<svg viewbox="0 0 18 18"><line class="ql-stroke ql-thin" x1="15.5" x2="2.5" y1="8.5" y2="9.5"/><path class="ql-fill" d="M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z"/><path class="ql-fill" d="M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z"/></svg>',lE='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="2" width="3" x="5" y="5"/><rect class="ql-fill" height="2" width="4" x="9" y="5"/><g class="ql-fill ql-transparent"><rect height="2" width="3" x="5" y="8"/><rect height="2" width="4" x="9" y="8"/><rect height="2" width="3" x="5" y="11"/><rect height="2" width="4" x="9" y="11"/></g></svg>',uE='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="12" x="3" y="15"/></svg>',cE='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="12" width="1" x="5" y="3"/><rect class="ql-fill" height="12" width="1" x="12" y="3"/><rect class="ql-fill" height="2" width="8" x="5" y="8"/><rect class="ql-fill" height="1" width="3" x="3" y="5"/><rect class="ql-fill" height="1" width="3" x="3" y="7"/><rect class="ql-fill" height="1" width="3" x="3" y="10"/><rect class="ql-fill" height="1" width="3" x="3" y="12"/><rect class="ql-fill" height="1" width="3" x="12" y="5"/><rect class="ql-fill" height="1" width="3" x="12" y="7"/><rect class="ql-fill" height="1" width="3" x="12" y="10"/><rect class="ql-fill" height="1" width="3" x="12" y="12"/></svg>',Jn={align:{"":Lx,center:Mx,right:Dx,justify:Px},background:Bx,blockquote:qx,bold:Fx,clean:jx,code:Ju,"code-block":Ju,color:Vx,direction:{"":$x,rtl:Ux},formula:Hx,header:{1:zx,2:Gx,3:Kx,4:Wx,5:Yx,6:Zx},italic:Xx,image:Qx,indent:{"+1":Jx,"-1":eE},link:tE,list:{bullet:rE,check:nE,ordered:sE},script:{sub:iE,super:oE},strike:aE,table:lE,underline:uE,video:cE},hE='<svg viewbox="0 0 18 18"><polygon class="ql-stroke" points="7 11 9 13 11 11 7 11"/><polygon class="ql-stroke" points="7 7 9 5 11 7 7 7"/></svg>';let ec=0;function tc(r,e){r.setAttribute(e,`${r.getAttribute(e)!=="true"}`)}class Li{constructor(e){this.select=e,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",()=>{this.togglePicker()}),this.label.addEventListener("keydown",t=>{switch(t.key){case"Enter":this.togglePicker();break;case"Escape":this.escape(),t.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}togglePicker(){this.container.classList.toggle("ql-expanded"),tc(this.label,"aria-expanded"),tc(this.options,"aria-hidden")}buildItem(e){const t=document.createElement("span");t.tabIndex="0",t.setAttribute("role","button"),t.classList.add("ql-picker-item");const n=e.getAttribute("value");return n&&t.setAttribute("data-value",n),e.textContent&&t.setAttribute("data-label",e.textContent),t.addEventListener("click",()=>{this.selectItem(t,!0)}),t.addEventListener("keydown",s=>{switch(s.key){case"Enter":this.selectItem(t,!0),s.preventDefault();break;case"Escape":this.escape(),s.preventDefault();break}}),t}buildLabel(){const e=document.createElement("span");return e.classList.add("ql-picker-label"),e.innerHTML=hE,e.tabIndex="0",e.setAttribute("role","button"),e.setAttribute("aria-expanded","false"),this.container.appendChild(e),e}buildOptions(){const e=document.createElement("span");e.classList.add("ql-picker-options"),e.setAttribute("aria-hidden","true"),e.tabIndex="-1",e.id=`ql-picker-options-${ec}`,ec+=1,this.label.setAttribute("aria-controls",e.id),this.options=e,Array.from(this.select.options).forEach(t=>{const n=this.buildItem(t);e.appendChild(n),t.selected===!0&&this.selectItem(n)}),this.container.appendChild(e)}buildPicker(){Array.from(this.select.attributes).forEach(e=>{this.container.setAttribute(e.name,e.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}escape(){this.close(),setTimeout(()=>this.label.focus(),1)}close(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}selectItem(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const n=this.container.querySelector(".ql-selected");e!==n&&(n!=null&&n.classList.remove("ql-selected"),e!=null&&(e.classList.add("ql-selected"),this.select.selectedIndex=Array.from(e.parentNode.children).indexOf(e),e.hasAttribute("data-value")?this.label.setAttribute("data-value",e.getAttribute("data-value")):this.label.removeAttribute("data-value"),e.hasAttribute("data-label")?this.label.setAttribute("data-label",e.getAttribute("data-label")):this.label.removeAttribute("data-label"),t&&(this.select.dispatchEvent(new Event("change")),this.close())))}update(){let e;if(this.select.selectedIndex>-1){const n=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];e=this.select.options[this.select.selectedIndex],this.selectItem(n)}else this.selectItem(null);const t=e!=null&&e!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",t)}}class _f extends Li{constructor(e,t){super(e),this.label.innerHTML=t,this.container.classList.add("ql-color-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).slice(0,7).forEach(n=>{n.classList.add("ql-primary")})}buildItem(e){const t=super.buildItem(e);return t.style.backgroundColor=e.getAttribute("value")||"",t}selectItem(e,t){super.selectItem(e,t);const n=this.label.querySelector(".ql-color-label"),s=e&&e.getAttribute("data-value")||"";n&&(n.tagName==="line"?n.style.stroke=s:n.style.fill=s)}}class Af extends Li{constructor(e,t){super(e),this.container.classList.add("ql-icon-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).forEach(n=>{n.innerHTML=t[n.getAttribute("data-value")||""]}),this.defaultItem=this.container.querySelector(".ql-selected"),this.selectItem(this.defaultItem)}selectItem(e,t){super.selectItem(e,t);const n=e||this.defaultItem;if(n!=null){if(this.label.innerHTML===n.innerHTML)return;this.label.innerHTML=n.innerHTML}}}const dE=r=>{const{overflowY:e}=getComputedStyle(r,null);return e!=="visible"&&e!=="clip"};class Cf{constructor(e,t){this.quill=e,this.boundsContainer=t||document.body,this.root=e.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,dE(this.quill.root)&&this.quill.root.addEventListener("scroll",()=>{this.root.style.marginTop=`${-1*this.quill.root.scrollTop}px`}),this.hide()}hide(){this.root.classList.add("ql-hidden")}position(e){const t=e.left+e.width/2-this.root.offsetWidth/2,n=e.bottom+this.quill.root.scrollTop;this.root.style.left=`${t}px`,this.root.style.top=`${n}px`,this.root.classList.remove("ql-flip");const s=this.boundsContainer.getBoundingClientRect(),i=this.root.getBoundingClientRect();let o=0;if(i.right>s.right&&(o=s.right-i.right,this.root.style.left=`${t+o}px`),i.left<s.left&&(o=s.left-i.left,this.root.style.left=`${t+o}px`),i.bottom>s.bottom){const a=i.bottom-i.top,l=e.bottom-e.top+a;this.root.style.top=`${n-l}px`,this.root.classList.add("ql-flip")}return o}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}const fE=[!1,"center","right","justify"],pE=["#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"],mE=[!1,"serif","monospace"],gE=["1","2","3",!1],vE=["small",!1,"large","huge"];class os extends dn{constructor(e,t){super(e,t);const n=s=>{if(!document.body.contains(e.root)){document.body.removeEventListener("click",n);return}this.tooltip!=null&&!this.tooltip.root.contains(s.target)&&document.activeElement!==this.tooltip.textbox&&!this.quill.hasFocus()&&this.tooltip.hide(),this.pickers!=null&&this.pickers.forEach(i=>{i.container.contains(s.target)||i.close()})};e.emitter.listenDOM("click",document.body,n)}addModule(e){const t=super.addModule(e);return e==="toolbar"&&this.extendToolbar(t),t}buildButtons(e,t){Array.from(e).forEach(n=>{(n.getAttribute("class")||"").split(/\s+/).forEach(i=>{if(i.startsWith("ql-")&&(i=i.slice(3),t[i]!=null))if(i==="direction")n.innerHTML=t[i][""]+t[i].rtl;else if(typeof t[i]=="string")n.innerHTML=t[i];else{const o=n.value||"";o!=null&&t[i][o]&&(n.innerHTML=t[i][o])}})})}buildPickers(e,t){this.pickers=Array.from(e).map(s=>{if(s.classList.contains("ql-align")&&(s.querySelector("option")==null&&Mn(s,fE),typeof t.align=="object"))return new Af(s,t.align);if(s.classList.contains("ql-background")||s.classList.contains("ql-color")){const i=s.classList.contains("ql-background")?"background":"color";return s.querySelector("option")==null&&Mn(s,pE,i==="background"?"#ffffff":"#000000"),new _f(s,t[i])}return s.querySelector("option")==null&&(s.classList.contains("ql-font")?Mn(s,mE):s.classList.contains("ql-header")?Mn(s,gE):s.classList.contains("ql-size")&&Mn(s,vE)),new Li(s)});const n=()=>{this.pickers.forEach(s=>{s.update()})};this.quill.on(te.events.EDITOR_CHANGE,n)}}os.DEFAULTS=rr({},dn.DEFAULTS,{modules:{toolbar:{handlers:{formula(){this.quill.theme.tooltip.edit("formula")},image(){let r=this.container.querySelector("input.ql-image[type=file]");r==null&&(r=document.createElement("input"),r.setAttribute("type","file"),r.setAttribute("accept",this.quill.uploader.options.mimetypes.join(", ")),r.classList.add("ql-image"),r.addEventListener("change",()=>{const e=this.quill.getSelection(!0);this.quill.uploader.upload(e,r.files),r.value=""}),this.container.appendChild(r)),r.click()},video(){this.quill.theme.tooltip.edit("video")}}}}});class kf extends Cf{constructor(e,t){super(e,t),this.textbox=this.root.querySelector('input[type="text"]'),this.listen()}listen(){this.textbox.addEventListener("keydown",e=>{e.key==="Enter"?(this.save(),e.preventDefault()):e.key==="Escape"&&(this.cancel(),e.preventDefault())})}cancel(){this.hide(),this.restoreFocus()}edit(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),this.textbox==null)return;t!=null?this.textbox.value=t:e!==this.root.getAttribute("data-mode")&&(this.textbox.value="");const n=this.quill.getBounds(this.quill.selection.savedRange);n!=null&&this.position(n),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute(`data-${e}`)||""),this.root.setAttribute("data-mode",e)}restoreFocus(){this.quill.focus({preventScroll:!0})}save(){let{value:e}=this.textbox;switch(this.root.getAttribute("data-mode")){case"link":{const{scrollTop:t}=this.quill.root;this.linkRange?(this.quill.formatText(this.linkRange,"link",e,te.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",e,te.sources.USER)),this.quill.root.scrollTop=t;break}case"video":e=yE(e);case"formula":{if(!e)break;const t=this.quill.getSelection(!0);if(t!=null){const n=t.index+t.length;this.quill.insertEmbed(n,this.root.getAttribute("data-mode"),e,te.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(n+1," ",te.sources.USER),this.quill.setSelection(n+2,te.sources.USER)}break}}this.textbox.value="",this.hide()}}function yE(r){let e=r.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||r.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return e?`${e[1]||"https"}://www.youtube.com/embed/${e[2]}?showinfo=0`:(e=r.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?`${e[1]||"https"}://player.vimeo.com/video/${e[2]}/`:r}function Mn(r,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;e.forEach(n=>{const s=document.createElement("option");n===t?s.setAttribute("selected","selected"):s.setAttribute("value",String(n)),r.appendChild(s)})}const bE=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class Tf extends kf{constructor(e,t){super(e,t),this.quill.on(te.events.EDITOR_CHANGE,(n,s,i,o)=>{if(n===te.events.SELECTION_CHANGE)if(s!=null&&s.length>0&&o===te.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width=`${this.root.offsetWidth}px`;const a=this.quill.getLines(s.index,s.length);if(a.length===1){const l=this.quill.getBounds(s);l!=null&&this.position(l)}else{const l=a[a.length-1],c=this.quill.getIndex(l),d=Math.min(l.length()-1,s.index+s.length-c),m=this.quill.getBounds(new kr(c,d));m!=null&&this.position(m)}}else document.activeElement!==this.textbox&&this.quill.hasFocus()&&this.hide()})}listen(){super.listen(),this.root.querySelector(".ql-close").addEventListener("click",()=>{this.root.classList.remove("ql-editing")}),this.quill.on(te.events.SCROLL_OPTIMIZE,()=>{setTimeout(()=>{if(this.root.classList.contains("ql-hidden"))return;const e=this.quill.getSelection();if(e!=null){const t=this.quill.getBounds(e);t!=null&&this.position(t)}},1)})}cancel(){this.show()}position(e){const t=super.position(e),n=this.root.querySelector(".ql-tooltip-arrow");return n.style.marginLeft="",t!==0&&(n.style.marginLeft=`${-1*t-n.offsetWidth/2}px`),t}}J(Tf,"TEMPLATE",['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join(""));class Nf extends os{constructor(e,t){t.modules.toolbar!=null&&t.modules.toolbar.container==null&&(t.modules.toolbar.container=bE),super(e,t),this.quill.container.classList.add("ql-bubble")}extendToolbar(e){this.tooltip=new Tf(this.quill,this.options.bounds),e.container!=null&&(this.tooltip.root.appendChild(e.container),this.buildButtons(e.container.querySelectorAll("button"),Jn),this.buildPickers(e.container.querySelectorAll("select"),Jn))}}Nf.DEFAULTS=rr({},os.DEFAULTS,{modules:{toolbar:{handlers:{link(r){r?this.quill.theme.tooltip.edit():this.quill.format("link",!1,M.sources.USER)}}}}});const xE=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class Rf extends kf{constructor(){super(...arguments);J(this,"preview",this.root.querySelector("a.ql-preview"))}listen(){super.listen(),this.root.querySelector("a.ql-action").addEventListener("click",t=>{this.root.classList.contains("ql-editing")?this.save():this.edit("link",this.preview.textContent),t.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",t=>{if(this.linkRange!=null){const n=this.linkRange;this.restoreFocus(),this.quill.formatText(n,"link",!1,te.sources.USER),delete this.linkRange}t.preventDefault(),this.hide()}),this.quill.on(te.events.SELECTION_CHANGE,(t,n,s)=>{if(t!=null){if(t.length===0&&s===te.sources.USER){const[i,o]=this.quill.scroll.descendant(Jt,t.index);if(i!=null){this.linkRange=new kr(t.index-o,i.length());const a=Jt.formats(i.domNode);this.preview.textContent=a,this.preview.setAttribute("href",a),this.show();const l=this.quill.getBounds(this.linkRange);l!=null&&this.position(l);return}}else delete this.linkRange;this.hide()}})}show(){super.show(),this.root.removeAttribute("data-mode")}}J(Rf,"TEMPLATE",['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join(""));class If extends os{constructor(e,t){t.modules.toolbar!=null&&t.modules.toolbar.container==null&&(t.modules.toolbar.container=xE),super(e,t),this.quill.container.classList.add("ql-snow")}extendToolbar(e){e.container!=null&&(e.container.classList.add("ql-snow"),this.buildButtons(e.container.querySelectorAll("button"),Jn),this.buildPickers(e.container.querySelectorAll("select"),Jn),this.tooltip=new Rf(this.quill,this.options.bounds),e.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"k",shortKey:!0},(t,n)=>{e.handlers.link.call(e,!n.format.link)}))}}If.DEFAULTS=rr({},os.DEFAULTS,{modules:{toolbar:{handlers:{link(r){if(r){const e=this.quill.getSelection();if(e==null||e.length===0)return;let t=this.quill.getText(e);/^\S+@\S+\.\S+$/.test(t)&&t.indexOf("mailto:")!==0&&(t=`mailto:${t}`);const{tooltip:n}=this.quill.theme;n.edit("link",t)}else this.quill.format("link",!1,M.sources.USER)}}}}});M.register({"attributors/attribute/direction":cf,"attributors/class/align":af,"attributors/class/background":qb,"attributors/class/color":Bb,"attributors/class/direction":hf,"attributors/class/font":pf,"attributors/class/size":gf,"attributors/style/align":lf,"attributors/style/background":pl,"attributors/style/color":fl,"attributors/style/direction":df,"attributors/style/font":mf,"attributors/style/size":vf},!0);M.register({"formats/align":af,"formats/direction":hf,"formats/indent":Tx,"formats/background":pl,"formats/color":fl,"formats/font":pf,"formats/size":gf,"formats/blockquote":Ia,"formats/code-block":Ve,"formats/header":Oa,"formats/list":is,"formats/bold":Qn,"formats/code":ml,"formats/italic":La,"formats/link":Jt,"formats/script":Ma,"formats/strike":Da,"formats/underline":Pa,"formats/formula":Zs,"formats/image":Ba,"formats/video":Xs,"modules/syntax":Sf,"modules/table":Rx,"modules/toolbar":xl,"themes/bubble":Nf,"themes/snow":If,"ui/icons":Jn,"ui/picker":Li,"ui/icon-picker":Af,"ui/color-picker":_f,"ui/tooltip":Cf},!0);class Mi extends ee.Component{constructor(e){super(e),this.editingAreaRef=ee.createRef(),this.containerRef=ee.createRef(),this.dirtyProps=["modules","formats","bounds","theme","children"],this.cleanProps=["id","className","style","placeholder","tabIndex","onChange","onChangeSelection","onFocus","onBlur","onKeyPress","onKeyDown","onKeyUp"],this.state={generation:0},this.selection=null,this.onEditorChange=(n,s,i,o)=>{var a,l;n==="text-change"?(a=this.onEditorChangeText)==null||a.call(this,this.editor.root.innerHTML,s,o,this.unprivilegedEditor):n==="selection-change"&&((l=this.onEditorChangeSelection)==null||l.call(this,s,o,this.unprivilegedEditor))};const t=this.isControlled()?e.value:e.defaultValue;this.value=t??""}validateProps(e){if(ee.Children.count(e.children)>1)throw new Error("The Quill editing area can only be composed of a single React element.");if(ee.Children.count(e.children)){const t=ee.Children.only(e.children);if((t==null?void 0:t.type)==="textarea")throw new Error("Quill does not support editing on a <textarea>. Use a <div> instead.")}if(this.lastDeltaChangeSet&&e.value===this.lastDeltaChangeSet)throw new Error("You are passing the `delta` object from the `onChange` event back as `value`. You most probably want `editor.getContents()` instead. See: https://github.com/zenoamaro/react-quill#using-deltas")}shouldComponentUpdate(e,t){if(this.validateProps(e),!this.editor||this.state.generation!==t.generation)return!0;if("value"in e){const n=this.getEditorContents(),s=e.value??"";this.isEqualValue(s,n)||this.setEditorContents(this.editor,s)}return e.readOnly!==this.props.readOnly&&this.setEditorReadOnly(this.editor,e.readOnly),[...this.cleanProps,...this.dirtyProps].some(n=>!Xt(e[n],this.props[n]))}shouldComponentRegenerate(e){return this.dirtyProps.some(t=>!Xt(e[t],this.props[t]))}componentDidMount(){this.instantiateEditor(),this.setEditorContents(this.editor,this.getEditorContents())}componentWillUnmount(){this.destroyEditor()}componentDidUpdate(e,t){if(this.editor&&this.shouldComponentRegenerate(e)){const n=this.editor.getContents(),s=this.editor.getSelection();this.regenerationSnapshot={delta:n,selection:s},this.setState({generation:this.state.generation+1}),this.destroyEditor()}if(this.state.generation!==t.generation){const{delta:n,selection:s}=this.regenerationSnapshot;delete this.regenerationSnapshot,this.instantiateEditor();const i=this.editor;i.setContents(n),rc(()=>this.setEditorSelection(i,s))}}instantiateEditor(){this.editor?this.hookEditor(this.editor):this.editor=this.createEditor(this.getEditingArea(),this.getEditorConfig())}destroyEditor(){var n,s;if(!this.editor)return;this.unhookEditor(this.editor);const e=(n=this.props.modules)==null?void 0:n.toolbar;if(!(typeof e=="object"&&e&&"container"in e&&typeof e.container=="string"||typeof e=="string")){const i=(s=this.containerRef.current)==null?void 0:s.querySelector(".ql-toolbar");i&&i.remove()}delete this.editor}isControlled(){return"value"in this.props}getEditorConfig(){return{bounds:this.props.bounds,formats:this.props.formats,modules:this.props.modules,placeholder:this.props.placeholder,readOnly:this.props.readOnly,tabIndex:this.props.tabIndex,theme:this.props.theme}}getEditor(){if(!this.editor)throw new Error("Accessing non-instantiated editor");return this.editor}createEditor(e,t){const n=new M(e,t);return t.tabIndex!=null&&this.setEditorTabIndex(n,t.tabIndex),this.hookEditor(n),n}hookEditor(e){this.unprivilegedEditor=this.makeUnprivilegedEditor(e),e.on("editor-change",this.onEditorChange)}unhookEditor(e){e.off("editor-change",this.onEditorChange)}getEditorContents(){return this.value}getEditorSelection(){return this.selection}isDelta(e){return e&&e.ops}isEqualValue(e,t){return this.isDelta(e)&&this.isDelta(t)?Xt(e.ops,t.ops):Xt(e,t)}setEditorContents(e,t){this.value=t;const n=this.getEditorSelection();typeof t=="string"?e.setContents(e.clipboard.convert({html:t})):e.setContents(t),rc(()=>this.setEditorSelection(e,n))}setEditorSelection(e,t){if(this.selection=t,t){const n=e.getLength();t.index=Math.max(0,Math.min(t.index,n-1)),t.length=Math.max(0,Math.min(t.length,n-1-t.index)),e.setSelection(t)}}setEditorTabIndex(e,t){var n;(n=e==null?void 0:e.scroll)!=null&&n.domNode&&(e.scroll.domNode.tabIndex=t)}setEditorReadOnly(e,t){t?e.disable():e.enable()}makeUnprivilegedEditor(e){const t=e;return{getHTML:()=>t.root.innerHTML,getSemanticHTML:t.getSemanticHTML.bind(t),getLength:t.getLength.bind(t),getText:t.getText.bind(t),getContents:t.getContents.bind(t),getSelection:t.getSelection.bind(t),getBounds:t.getBounds.bind(t)}}getEditingArea(){const e=this.editingAreaRef.current;if(!e)throw new Error("Cannot find element for editing area");if(e.nodeType===3)throw new Error("Editing area cannot be a text node");return e}renderEditingArea(){const{children:e,preserveWhitespace:t}=this.props,{generation:n}=this.state,s={key:n,ref:this.editingAreaRef};return ee.Children.count(e)?ee.cloneElement(ee.Children.only(e),s):t?ee.createElement("pre",{...s}):ee.createElement("div",{...s})}render(){return ee.createElement("div",{ref:this.containerRef,id:this.props.id,style:this.props.style,key:this.state.generation,className:`quill ${this.props.className??""}`,onKeyPress:this.props.onKeyPress,onKeyDown:this.props.onKeyDown,onKeyUp:this.props.onKeyUp},this.renderEditingArea())}onEditorChangeText(e,t,n,s){var o,a;if(!this.editor)return;const i=this.isDelta(this.value)?s.getContents():s.getHTML();i!==this.getEditorContents()&&(this.lastDeltaChangeSet=t,this.value=i,(a=(o=this.props).onChange)==null||a.call(o,e,t,n,s))}onEditorChangeSelection(e,t,n){var a,l,c,d,m,h;if(!this.editor)return;const s=this.getEditorSelection(),i=!s&&e,o=s&&!e;Xt(e,s)||(this.selection=e,(l=(a=this.props).onChangeSelection)==null||l.call(a,e,t,n),i?(d=(c=this.props).onFocus)==null||d.call(c,e,t,n):o&&((h=(m=this.props).onBlur)==null||h.call(m,s,t,n)))}focus(){this.editor&&this.editor.focus()}blur(){this.editor&&(this.selection=null,this.editor.blur())}}Mi.displayName="React Quill";Mi.Quill=M;Mi.defaultProps={theme:"snow",modules:{},readOnly:!1};function rc(r){Promise.resolve().then(r)}const EE=Fa.cva("w-full rounded-lg border border-border-alpha-strong dark:bg-transparent file:border-0 placeholder:text-secondary placeholder:text-body-sm-regular focus-within:outline-none focus-within:ring-2 focus-within:ring-offset-bg focus-within:ring-offset-2 focus-within:ring-ring disabled:cursor-not-allowed disabled:opacity-50",{variants:{variant:{default:"focus-within:ring-item-primary",failure:"focus-within:ring-item-destructive bg-item-destructive-focus placeholder:text-item-destructive border-item-destructive text-destructive",success:"focus-within:ring-success bg-success/20 placeholder:text-success/80 border-success text-success"}},defaultVariants:{variant:"default"}}),wE=Ka.div`
.quill {
.ql {
&-toolbar {
border: none;
}
&-editor,
&-container {
min-height: 120px;
border: none;
}
}
`;function Of({containerProps:r,className:e,variant:t,...n}){return I.jsxRuntimeExports.jsx(wE,{...r,className:ke.cn(EE({variant:t}),"block h-auto p-0",e),children:I.jsxRuntimeExports.jsx(Mi,{theme:"snow",...n})})}Of.displayName="HtmlEditor";function nr(r){return typeof r=="string"||r instanceof String}function nc(r){var e;return typeof r=="object"&&r!=null&&(r==null||(e=r.constructor)==null?void 0:e.name)==="Object"}function Lf(r,e){return Array.isArray(e)?Lf(r,(t,n)=>e.includes(n)):Object.entries(r).reduce((t,n)=>{let[s,i]=n;return e(i,s)&&(t[s]=i),t},{})}const oe={NONE:"NONE",LEFT:"LEFT",FORCE_LEFT:"FORCE_LEFT",RIGHT:"RIGHT",FORCE_RIGHT:"FORCE_RIGHT"};function SE(r){switch(r){case oe.LEFT:return oe.FORCE_LEFT;case oe.RIGHT:return oe.FORCE_RIGHT;default:return r}}function Wo(r){return r.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function li(r,e){if(e===r)return!0;const t=Array.isArray(e),n=Array.isArray(r);let s;if(t&&n){if(e.length!=r.length)return!1;for(s=0;s<e.length;s++)if(!li(e[s],r[s]))return!1;return!0}if(t!=n)return!1;if(e&&r&&typeof e=="object"&&typeof r=="object"){const i=e instanceof Date,o=r instanceof Date;if(i&&o)return e.getTime()==r.getTime();if(i!=o)return!1;const a=e instanceof RegExp,l=r instanceof RegExp;if(a&&l)return e.toString()==r.toString();if(a!=l)return!1;const c=Object.keys(e);for(s=0;s<c.length;s++)if(!Object.prototype.hasOwnProperty.call(r,c[s]))return!1;for(s=0;s<c.length;s++)if(!li(r[c[s]],e[c[s]]))return!1;return!0}else if(e&&r&&typeof e=="function"&&typeof r=="function")return e.toString()===r.toString();return!1}class _E{constructor(e){for(Object.assign(this,e);this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos);)--this.oldSelection.start;if(this.insertedCount)for(;this.value.slice(this.cursorPos)!==this.oldValue.slice(this.oldSelection.end);)this.value.length-this.cursorPos<this.oldValue.length-this.oldSelection.end?++this.oldSelection.end:++this.cursorPos}get startChangePos(){return Math.min(this.cursorPos,this.oldSelection.start)}get insertedCount(){return this.cursorPos-this.startChangePos}get inserted(){return this.value.substr(this.startChangePos,this.insertedCount)}get removedCount(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}get removed(){return this.oldValue.substr(this.startChangePos,this.removedCount)}get head(){return this.value.substring(0,this.startChangePos)}get tail(){return this.value.substring(this.startChangePos+this.insertedCount)}get removeDirection(){return!this.removedCount||this.insertedCount?oe.NONE:(this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos)&&this.oldSelection.end===this.oldSelection.start?oe.RIGHT:oe.LEFT}}function ue(r,e){return new ue.InputMask(r,e)}function Mf(r){if(r==null)throw new Error("mask property should be defined");return r instanceof RegExp?ue.MaskedRegExp:nr(r)?ue.MaskedPattern:r===Date?ue.MaskedDate:r===Number?ue.MaskedNumber:Array.isArray(r)||r===Array?ue.MaskedDynamic:ue.Masked&&r.prototype instanceof ue.Masked?r:ue.Masked&&r instanceof ue.Masked?r.constructor:r instanceof Function?ue.MaskedFunction:(console.warn("Mask not found for mask",r),ue.Masked)}function es(r){if(!r)throw new Error("Options in not defined");if(ue.Masked){if(r.prototype instanceof ue.Masked)return{mask:r};const{mask:e=void 0,...t}=r instanceof ue.Masked?{mask:r}:nc(r)&&r.mask instanceof ue.Masked?r:{};if(e){const n=e.mask;return{...Lf(e,(s,i)=>!i.startsWith("_")),mask:e.constructor,_mask:n,...t}}}return nc(r)?{...r}:{mask:r}}function $t(r){if(ue.Masked&&r instanceof ue.Masked)return r;const e=es(r),t=Mf(e.mask);if(!t)throw new Error("Masked class is not found for provided mask "+e.mask+", appropriate module needs to be imported manually before creating mask.");return e.mask===t&&delete e.mask,e._mask&&(e.mask=e._mask,delete e._mask),new t(e)}ue.createMask=$t;class El{get selectionStart(){let e;try{e=this._unsafeSelectionStart}catch{}return e??this.value.length}get selectionEnd(){let e;try{e=this._unsafeSelectionEnd}catch{}return e??this.value.length}select(e,t){if(!(e==null||t==null||e===this.selectionStart&&t===this.selectionEnd))try{this._unsafeSelect(e,t)}catch{}}get isActive(){return!1}}ue.MaskElement=El;const sc=90,AE=89;class Di extends El{constructor(e){super(),this.input=e,this._onKeydown=this._onKeydown.bind(this),this._onInput=this._onInput.bind(this),this._onBeforeinput=this._onBeforeinput.bind(this),this._onCompositionEnd=this._onCompositionEnd.bind(this)}get rootElement(){var e,t,n;return(e=(t=(n=this.input).getRootNode)==null?void 0:t.call(n))!=null?e:document}get isActive(){return this.input===this.rootElement.activeElement}bindEvents(e){this.input.addEventListener("keydown",this._onKeydown),this.input.addEventListener("input",this._onInput),this.input.addEventListener("beforeinput",this._onBeforeinput),this.input.addEventListener("compositionend",this._onCompositionEnd),this.input.addEventListener("drop",e.drop),this.input.addEventListener("click",e.click),this.input.addEventListener("focus",e.focus),this.input.addEventListener("blur",e.commit),this._handlers=e}_onKeydown(e){if(this._handlers.redo&&(e.keyCode===sc&&e.shiftKey&&(e.metaKey||e.ctrlKey)||e.keyCode===AE&&e.ctrlKey))return e.preventDefault(),this._handlers.redo(e);if(this._handlers.undo&&e.keyCode===sc&&(e.metaKey||e.ctrlKey))return e.preventDefault(),this._handlers.undo(e);e.isComposing||this._handlers.selectionChange(e)}_onBeforeinput(e){if(e.inputType==="historyUndo"&&this._handlers.undo)return e.preventDefault(),this._handlers.undo(e);if(e.inputType==="historyRedo"&&this._handlers.redo)return e.preventDefault(),this._handlers.redo(e)}_onCompositionEnd(e){this._handlers.input(e)}_onInput(e){e.isComposing||this._handlers.input(e)}unbindEvents(){this.input.removeEventListener("keydown",this._onKeydown),this.input.removeEventListener("input",this._onInput),this.input.removeEventListener("beforeinput",this._onBeforeinput),this.input.removeEventListener("compositionend",this._onCompositionEnd),this.input.removeEventListener("drop",this._handlers.drop),this.input.removeEventListener("click",this._handlers.click),this.input.removeEventListener("focus",this._handlers.focus),this.input.removeEventListener("blur",this._handlers.commit),this._handlers={}}}ue.HTMLMaskElement=Di;class CE extends Di{constructor(e){super(e),this.input=e}get _unsafeSelectionStart(){return this.input.selectionStart!=null?this.input.selectionStart:this.value.length}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(e,t){this.input.setSelectionRange(e,t)}get value(){return this.input.value}set value(e){this.input.value=e}}ue.HTMLMaskElement=Di;class Df extends Di{get _unsafeSelectionStart(){const e=this.rootElement,t=e.getSelection&&e.getSelection(),n=t&&t.anchorOffset,s=t&&t.focusOffset;return s==null||n==null||n<s?n:s}get _unsafeSelectionEnd(){const e=this.rootElement,t=e.getSelection&&e.getSelection(),n=t&&t.anchorOffset,s=t&&t.focusOffset;return s==null||n==null||n>s?n:s}_unsafeSelect(e,t){if(!this.rootElement.createRange)return;const n=this.rootElement.createRange();n.setStart(this.input.firstChild||this.input,e),n.setEnd(this.input.lastChild||this.input,t);const s=this.rootElement,i=s.getSelection&&s.getSelection();i&&(i.removeAllRanges(),i.addRange(n))}get value(){return this.input.textContent||""}set value(e){this.input.textContent=e}}ue.HTMLContenteditableMaskElement=Df;class Pi{constructor(){this.states=[],this.currentIndex=0}get currentState(){return this.states[this.currentIndex]}get isEmpty(){return this.states.length===0}push(e){this.currentIndex<this.states.length-1&&(this.states.length=this.currentIndex+1),this.states.push(e),this.states.length>Pi.MAX_LENGTH&&this.states.shift(),this.currentIndex=this.states.length-1}go(e){return this.currentIndex=Math.min(Math.max(this.currentIndex+e,0),this.states.length-1),this.currentState}undo(){return this.go(-1)}redo(){return this.go(1)}clear(){this.states.length=0,this.currentIndex=0}}Pi.MAX_LENGTH=100;class kE{constructor(e,t){this.el=e instanceof El?e:e.isContentEditable&&e.tagName!=="INPUT"&&e.tagName!=="TEXTAREA"?new Df(e):new CE(e),this.masked=$t(t),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new Pi,this._saveSelection=this._saveSelection.bind(this),this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onDrop=this._onDrop.bind(this),this._onFocus=this._onFocus.bind(this),this._onClick=this._onClick.bind(this),this._onUndo=this._onUndo.bind(this),this._onRedo=this._onRedo.bind(this),this.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this.updateValue(),this._onChange()}maskEquals(e){var t;return e==null||((t=this.masked)==null?void 0:t.maskEquals(e))}get mask(){return this.masked.mask}set mask(e){if(this.maskEquals(e))return;if(!(e instanceof ue.Masked)&&this.masked.constructor===Mf(e)){this.masked.updateOptions({mask:e});return}const t=e instanceof ue.Masked?e:$t({mask:e});t.unmaskedValue=this.masked.unmaskedValue,this.masked=t}get value(){return this._value}set value(e){this.value!==e&&(this.masked.value=e,this.updateControl("auto"))}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(e){this.unmaskedValue!==e&&(this.masked.unmaskedValue=e,this.updateControl("auto"))}get rawInputValue(){return this._rawInputValue}set rawInputValue(e){this.rawInputValue!==e&&(this.masked.rawInputValue=e,this.updateControl(),this.alignCursor())}get typedValue(){return this.masked.typedValue}set typedValue(e){this.masked.typedValueEquals(e)||(this.masked.typedValue=e,this.updateControl("auto"))}get displayValue(){return this.masked.displayValue}_bindEvents(){this.el.bindEvents({selectionChange:this._saveSelection,input:this._onInput,drop:this._onDrop,click:this._onClick,focus:this._onFocus,commit:this._onChange,undo:this._onUndo,redo:this._onRedo})}_unbindEvents(){this.el&&this.el.unbindEvents()}_fireEvent(e,t){const n=this._listeners[e];n&&n.forEach(s=>s(t))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(e){!this.el||!this.el.isActive||(this.el.select(e,e),this._saveSelection())}_saveSelection(){this.displayValue!==this.el.value&&console.warn("Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly."),this._selection={start:this.selectionStart,end:this.cursorPos}}updateValue(){this.masked.value=this.el.value,this._value=this.masked.value,this._unmaskedValue=this.masked.unmaskedValue,this._rawInputValue=this.masked.rawInputValue}updateControl(e){const t=this.masked.unmaskedValue,n=this.masked.value,s=this.masked.rawInputValue,i=this.displayValue,o=this.unmaskedValue!==t||this.value!==n||this._rawInputValue!==s;this._unmaskedValue=t,this._value=n,this._rawInputValue=s,this.el.value!==i&&(this.el.value=i),e==="auto"?this.alignCursor():e!=null&&(this.cursorPos=e),o&&this._fireChangeEvents(),!this._historyChanging&&(o||this.history.isEmpty)&&this.history.push({unmaskedValue:t,selection:{start:this.selectionStart,end:this.cursorPos}})}updateOptions(e){const{mask:t,...n}=e,s=!this.maskEquals(t),i=this.masked.optionsIsChanged(n);s&&(this.mask=t),i&&this.masked.updateOptions(n),(s||i)&&this.updateControl()}updateCursor(e){e!=null&&(this.cursorPos=e,this._delayUpdateCursor(e))}_delayUpdateCursor(e){this._abortUpdateCursor(),this._changingCursorPos=e,this._cursorChanging=setTimeout(()=>{this.el&&(this.cursorPos=this._changingCursorPos,this._abortUpdateCursor())},10)}_fireChangeEvents(){this._fireEvent("accept",this._inputEvent),this.masked.isComplete&&this._fireEvent("complete",this._inputEvent)}_abortUpdateCursor(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)}alignCursor(){this.cursorPos=this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos,oe.LEFT))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(e,t){return this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t),this}off(e,t){if(!this._listeners[e])return this;if(!t)return delete this._listeners[e],this;const n=this._listeners[e].indexOf(t);return n>=0&&this._listeners[e].splice(n,1),this}_onInput(e){this._inputEvent=e,this._abortUpdateCursor();const t=new _E({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),n=this.masked.rawInputValue,s=this.masked.splice(t.startChangePos,t.removed.length,t.inserted,t.removeDirection,{input:!0,raw:!0}).offset,i=n===this.masked.rawInputValue?t.removeDirection:oe.NONE;let o=this.masked.nearestInputPos(t.startChangePos+s,i);i!==oe.NONE&&(o=this.masked.nearestInputPos(o,oe.NONE)),this.updateControl(o),delete this._inputEvent}_onChange(){this.displayValue!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}_onDrop(e){e.preventDefault(),e.stopPropagation()}_onFocus(e){this.alignCursorFriendly()}_onClick(e){this.alignCursorFriendly()}_onUndo(){this._applyHistoryState(this.history.undo())}_onRedo(){this._applyHistoryState(this.history.redo())}_applyHistoryState(e){e&&(this._historyChanging=!0,this.unmaskedValue=e.unmaskedValue,this.el.select(e.selection.start,e.selection.end),this._saveSelection(),this._historyChanging=!1)}destroy(){this._unbindEvents(),this._listeners.length=0,delete this.el}}ue.InputMask=kE;class fe{static normalize(e){return Array.isArray(e)?e:[e,new fe]}constructor(e){Object.assign(this,{inserted:"",rawInserted:"",tailShift:0,skip:!1},e)}aggregate(e){return this.inserted+=e.inserted,this.rawInserted+=e.rawInserted,this.tailShift+=e.tailShift,this.skip=this.skip||e.skip,this}get offset(){return this.tailShift+this.inserted.length}get consumed(){return!!this.rawInserted||this.skip}equals(e){return this.inserted===e.inserted&&this.tailShift===e.tailShift&&this.rawInserted===e.rawInserted&&this.skip===e.skip}}ue.ChangeDetails=fe;class At{constructor(e,t,n){e===void 0&&(e=""),t===void 0&&(t=0),this.value=e,this.from=t,this.stop=n}toString(){return this.value}extend(e){this.value+=String(e)}appendTo(e){return e.append(this.toString(),{tail:!0}).aggregate(e._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(e){Object.assign(this,e)}unshift(e){if(!this.value.length||e!=null&&this.from>=e)return"";const t=this.value[0];return this.value=this.value.slice(1),t}shift(){if(!this.value.length)return"";const e=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),e}}class $e{constructor(e){this._value="",this._update({...$e.DEFAULTS,...e}),this._initialized=!0}updateOptions(e){this.optionsIsChanged(e)&&this.withValueRefresh(this._update.bind(this,e))}_update(e){Object.assign(this,e)}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue}}set state(e){this._value=e._value}reset(){this._value=""}get value(){return this._value}set value(e){this.resolve(e,{input:!0})}resolve(e,t){t===void 0&&(t={input:!0}),this.reset(),this.append(e,t,""),this.doCommit()}get unmaskedValue(){return this.value}set unmaskedValue(e){this.resolve(e,{})}get typedValue(){return this.parse?this.parse(this.value,this):this.unmaskedValue}set typedValue(e){this.format?this.value=this.format(e,this):this.unmaskedValue=String(e)}get rawInputValue(){return this.extractInput(0,this.displayValue.length,{raw:!0})}set rawInputValue(e){this.resolve(e,{raw:!0})}get displayValue(){return this.value}get isComplete(){return!0}get isFilled(){return this.isComplete}nearestInputPos(e,t){return e}totalInputPositions(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),Math.min(this.displayValue.length,t-e)}extractInput(e,t,n){return e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),this.displayValue.slice(e,t)}extractTail(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),new At(this.extractInput(e,t),e)}appendTail(e){return nr(e)&&(e=new At(String(e))),e.appendTo(this)}_appendCharRaw(e,t){return e?(this._value+=e,new fe({inserted:e,rawInserted:e})):new fe}_appendChar(e,t,n){t===void 0&&(t={});const s=this.state;let i;if([e,i]=this.doPrepareChar(e,t),e&&(i=i.aggregate(this._appendCharRaw(e,t)),!i.rawInserted&&this.autofix==="pad")){const o=this.state;this.state=s;let a=this.pad(t);const l=this._appendCharRaw(e,t);a=a.aggregate(l),l.rawInserted||a.equals(i)?i=a:this.state=o}if(i.inserted){let o,a=this.doValidate(t)!==!1;if(a&&n!=null){const l=this.state;if(this.overwrite===!0){o=n.state;for(let d=0;d<i.rawInserted.length;++d)n.unshift(this.displayValue.length-i.tailShift)}let c=this.appendTail(n);if(a=c.rawInserted.length===n.toString().length,!(a&&c.inserted)&&this.overwrite==="shift"){this.state=l,o=n.state;for(let d=0;d<i.rawInserted.length;++d)n.shift();c=this.appendTail(n),a=c.rawInserted.length===n.toString().length}a&&c.inserted&&(this.state=l)}a||(i=new fe,this.state=s,n&&o&&(n.state=o))}return i}_appendPlaceholder(){return new fe}_appendEager(){return new fe}append(e,t,n){if(!nr(e))throw new Error("value should be string");const s=nr(n)?new At(String(n)):n;t!=null&&t.tail&&(t._beforeTailState=this.state);let i;[e,i]=this.doPrepare(e,t);for(let o=0;o<e.length;++o){const a=this._appendChar(e[o],t,s);if(!a.rawInserted&&!this.doSkipInvalid(e[o],t,s))break;i.aggregate(a)}return(this.eager===!0||this.eager==="append")&&t!=null&&t.input&&e&&i.aggregate(this._appendEager()),s!=null&&(i.tailShift+=this.appendTail(s).tailShift),i}remove(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),this._value=this.displayValue.slice(0,e)+this.displayValue.slice(t),new fe}withValueRefresh(e){if(this._refreshing||!this._initialized)return e();this._refreshing=!0;const t=this.rawInputValue,n=this.value,s=e();return this.rawInputValue=t,this.value&&this.value!==n&&n.indexOf(this.value)===0&&(this.append(n.slice(this.displayValue.length),{},""),this.doCommit()),delete this._refreshing,s}runIsolated(e){if(this._isolated||!this._initialized)return e(this);this._isolated=!0;const t=this.state,n=e(this);return this.state=t,delete this._isolated,n}doSkipInvalid(e,t,n){return!!this.skipInvalid}doPrepare(e,t){return t===void 0&&(t={}),fe.normalize(this.prepare?this.prepare(e,this,t):e)}doPrepareChar(e,t){return t===void 0&&(t={}),fe.normalize(this.prepareChar?this.prepareChar(e,this,t):e)}doValidate(e){return(!this.validate||this.validate(this.value,this,e))&&(!this.parent||this.parent.doValidate(e))}doCommit(){this.commit&&this.commit(this.value,this)}splice(e,t,n,s,i){n===void 0&&(n=""),s===void 0&&(s=oe.NONE),i===void 0&&(i={input:!0});const o=e+t,a=this.extractTail(o),l=this.eager===!0||this.eager==="remove";let c;l&&(s=SE(s),c=this.extractInput(0,o,{raw:!0}));let d=e;const m=new fe;if(s!==oe.NONE&&(d=this.nearestInputPos(e,t>1&&e!==0&&!l?oe.NONE:s),m.tailShift=d-e),m.aggregate(this.remove(d)),l&&s!==oe.NONE&&c===this.rawInputValue)if(s===oe.FORCE_LEFT){let h;for(;c===this.rawInputValue&&(h=this.displayValue.length);)m.aggregate(new fe({tailShift:-1})).aggregate(this.remove(h-1))}else s===oe.FORCE_RIGHT&&a.unshift();return m.aggregate(this.append(n,i,a))}maskEquals(e){return this.mask===e}optionsIsChanged(e){return!li(this,e)}typedValueEquals(e){const t=this.typedValue;return e===t||$e.EMPTY_VALUES.includes(e)&&$e.EMPTY_VALUES.includes(t)||(this.format?this.format(e,this)===this.format(this.typedValue,this):!1)}pad(e){return new fe}}$e.DEFAULTS={skipInvalid:!0};$e.EMPTY_VALUES=[void 0,null,""];ue.Masked=$e;class yr{constructor(e,t){e===void 0&&(e=[]),t===void 0&&(t=0),this.chunks=e,this.from=t}toString(){return this.chunks.map(String).join("")}extend(e){if(!String(e))return;e=nr(e)?new At(String(e)):e;const t=this.chunks[this.chunks.length-1],n=t&&(t.stop===e.stop||e.stop==null)&&e.from===t.from+t.toString().length;if(e instanceof At)n?t.extend(e.toString()):this.chunks.push(e);else if(e instanceof yr){if(e.stop==null){let s;for(;e.chunks.length&&e.chunks[0].stop==null;)s=e.chunks.shift(),s.from+=e.from,this.extend(s)}e.toString()&&(e.stop=e.blockIndex,this.chunks.push(e))}}appendTo(e){if(!(e instanceof ue.MaskedPattern))return new At(this.toString()).appendTo(e);const t=new fe;for(let n=0;n<this.chunks.length;++n){const s=this.chunks[n],i=e._mapPosToBlock(e.displayValue.length),o=s.stop;let a;if(o!=null&&(!i||i.index<=o)&&((s instanceof yr||e._stops.indexOf(o)>=0)&&t.aggregate(e._appendPlaceholder(o)),a=s instanceof yr&&e._blocks[o]),a){const l=a.appendTail(s);t.aggregate(l);const c=s.toString().slice(l.rawInserted.length);c&&t.aggregate(e.append(c,{tail:!0}))}else t.aggregate(e.append(s.toString(),{tail:!0}))}return t}get state(){return{chunks:this.chunks.map(e=>e.state),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(e){const{chunks:t,...n}=e;Object.assign(this,n),this.chunks=t.map(s=>{const i="chunks"in s?new yr:new At;return i.state=s,i})}unshift(e){if(!this.chunks.length||e!=null&&this.from>=e)return"";const t=e!=null?e-this.from:e;let n=0;for(;n<this.chunks.length;){const s=this.chunks[n],i=s.unshift(t);if(s.toString()){if(!i)break;++n}else this.chunks.splice(n,1);if(i)return i}return""}shift(){if(!this.chunks.length)return"";let e=this.chunks.length-1;for(;0<=e;){const t=this.chunks[e],n=t.shift();if(t.toString()){if(!n)break;--e}else this.chunks.splice(e,1);if(n)return n}return""}}class TE{constructor(e,t){this.masked=e,this._log=[];const{offset:n,index:s}=e._mapPosToBlock(t)||(t<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=n,this.index=s,this.ok=!1}get block(){return this.masked._blocks[this.index]}get pos(){return this.masked._blockStartPos(this.index)+this.offset}get state(){return{index:this.index,offset:this.offset,ok:this.ok}}set state(e){Object.assign(this,e)}pushState(){this._log.push(this.state)}popState(){const e=this._log.pop();return e&&(this.state=e),e}bindBlock(){this.block||(this.index<0&&(this.index=0,this.offset=0),this.index>=this.masked._blocks.length&&(this.index=this.masked._blocks.length-1,this.offset=this.block.displayValue.length))}_pushLeft(e){for(this.pushState(),this.bindBlock();0<=this.index;--this.index,this.offset=((t=this.block)==null?void 0:t.displayValue.length)||0){var t;if(e())return this.ok=!0}return this.ok=!1}_pushRight(e){for(this.pushState(),this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0)if(e())return this.ok=!0;return this.ok=!1}pushLeftBeforeFilled(){return this._pushLeft(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,oe.FORCE_LEFT),this.offset!==0))return!0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,oe.LEFT),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,oe.LEFT),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,oe.FORCE_RIGHT),this.offset!==this.block.value.length))return!0})}pushRightBeforeInput(){return this._pushRight(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,oe.NONE),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,oe.NONE),!0})}}class Pf{constructor(e){Object.assign(this,e),this._value="",this.isFixed=!0}get value(){return this._value}get unmaskedValue(){return this.isUnmasking?this.value:""}get rawInputValue(){return this._isRawInput?this.value:""}get displayValue(){return this.value}reset(){this._isRawInput=!1,this._value=""}remove(e,t){return e===void 0&&(e=0),t===void 0&&(t=this._value.length),this._value=this._value.slice(0,e)+this._value.slice(t),this._value||(this._isRawInput=!1),new fe}nearestInputPos(e,t){t===void 0&&(t=oe.NONE);const n=0,s=this._value.length;switch(t){case oe.LEFT:case oe.FORCE_LEFT:return n;case oe.NONE:case oe.RIGHT:case oe.FORCE_RIGHT:default:return s}}totalInputPositions(e,t){return e===void 0&&(e=0),t===void 0&&(t=this._value.length),this._isRawInput?t-e:0}extractInput(e,t,n){return e===void 0&&(e=0),t===void 0&&(t=this._value.length),n===void 0&&(n={}),n.raw&&this._isRawInput&&this._value.slice(e,t)||""}get isComplete(){return!0}get isFilled(){return!!this._value}_appendChar(e,t){if(t===void 0&&(t={}),this.isFilled)return new fe;const n=this.eager===!0||this.eager==="append",i=this.char===e&&(this.isUnmasking||t.input||t.raw)&&(!t.raw||!n)&&!t.tail,o=new fe({inserted:this.char,rawInserted:i?this.char:""});return this._value=this.char,this._isRawInput=i&&(t.raw||t.input),o}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){const e=new fe;return this.isFilled||(this._value=e.inserted=this.char),e}extractTail(){return new At("")}appendTail(e){return nr(e)&&(e=new At(String(e))),e.appendTo(this)}append(e,t,n){const s=this._appendChar(e[0],t);return n!=null&&(s.tailShift+=this.appendTail(n).tailShift),s}doCommit(){}get state(){return{_value:this._value,_rawInputValue:this.rawInputValue}}set state(e){this._value=e._value,this._isRawInput=!!e._rawInputValue}pad(e){return this._appendPlaceholder()}}class ui{constructor(e){const{parent:t,isOptional:n,placeholderChar:s,displayChar:i,lazy:o,eager:a,...l}=e;this.masked=$t(l),Object.assign(this,{parent:t,isOptional:n,placeholderChar:s,displayChar:i,lazy:o,eager:a})}reset(){this.isFilled=!1,this.masked.reset()}remove(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.value.length),e===0&&t>=1?(this.isFilled=!1,this.masked.remove(e,t)):new fe}get value(){return this.masked.value||(this.isFilled&&!this.isOptional?this.placeholderChar:"")}get unmaskedValue(){return this.masked.unmaskedValue}get rawInputValue(){return this.masked.rawInputValue}get displayValue(){return this.masked.value&&this.displayChar||this.value}get isComplete(){return!!this.masked.value||this.isOptional}_appendChar(e,t){if(t===void 0&&(t={}),this.isFilled)return new fe;const n=this.masked.state;let s=this.masked._appendChar(e,this.currentMaskFlags(t));return s.inserted&&this.doValidate(t)===!1&&(s=new fe,this.masked.state=n),!s.inserted&&!this.isOptional&&!this.lazy&&!t.input&&(s.inserted=this.placeholderChar),s.skip=!s.inserted&&!this.isOptional,this.isFilled=!!s.inserted,s}append(e,t,n){return this.masked.append(e,this.currentMaskFlags(t),n)}_appendPlaceholder(){return this.isFilled||this.isOptional?new fe:(this.isFilled=!0,new fe({inserted:this.placeholderChar}))}_appendEager(){return new fe}extractTail(e,t){return this.masked.extractTail(e,t)}appendTail(e){return this.masked.appendTail(e)}extractInput(e,t,n){return e===void 0&&(e=0),t===void 0&&(t=this.value.length),this.masked.extractInput(e,t,n)}nearestInputPos(e,t){t===void 0&&(t=oe.NONE);const n=0,s=this.value.length,i=Math.min(Math.max(e,n),s);switch(t){case oe.LEFT:case oe.FORCE_LEFT:return this.isComplete?i:n;case oe.RIGHT:case oe.FORCE_RIGHT:return this.isComplete?i:s;case oe.NONE:default:return i}}totalInputPositions(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.value.length),this.value.slice(e,t).length}doValidate(e){return this.masked.doValidate(this.currentMaskFlags(e))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(e)))}doCommit(){this.masked.doCommit()}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}}set state(e){this.masked.state=e.masked,this.isFilled=e.isFilled}currentMaskFlags(e){var t;return{...e,_beforeTailState:(e==null||(t=e._beforeTailState)==null?void 0:t.masked)||(e==null?void 0:e._beforeTailState)}}pad(e){return new fe}}ui.DEFAULT_DEFINITIONS={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./};class NE extends $e{updateOptions(e){super.updateOptions(e)}_update(e){const t=e.mask;t&&(e.validate=n=>n.search(t)>=0),super._update(e)}}ue.MaskedRegExp=NE;class Ue extends $e{constructor(e){super({...Ue.DEFAULTS,...e,definitions:Object.assign({},ui.DEFAULT_DEFINITIONS,e==null?void 0:e.definitions)})}updateOptions(e){super.updateOptions(e)}_update(e){e.definitions=Object.assign({},this.definitions,e.definitions),super._update(e),this._rebuildMask()}_rebuildMask(){const e=this.definitions;this._blocks=[],this.exposeBlock=void 0,this._stops=[],this._maskedBlocks={};const t=this.mask;if(!t||!e)return;let n=!1,s=!1;for(let i=0;i<t.length;++i){if(this.blocks){const c=t.slice(i),d=Object.keys(this.blocks).filter(h=>c.indexOf(h)===0);d.sort((h,g)=>g.length-h.length);const m=d[0];if(m){const{expose:h,repeat:g,...v}=es(this.blocks[m]),f={lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,autofix:this.autofix,...v,repeat:g,parent:this},y=g!=null?new ue.RepeatBlock(f):$t(f);y&&(this._blocks.push(y),h&&(this.exposeBlock=y),this._maskedBlocks[m]||(this._maskedBlocks[m]=[]),this._maskedBlocks[m].push(this._blocks.length-1)),i+=m.length-1;continue}}let o=t[i],a=o in e;if(o===Ue.STOP_CHAR){this._stops.push(this._blocks.length);continue}if(o==="{"||o==="}"){n=!n;continue}if(o==="["||o==="]"){s=!s;continue}if(o===Ue.ESCAPE_CHAR){if(++i,o=t[i],!o)break;a=!1}const l=a?new ui({isOptional:s,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...es(e[o]),parent:this}):new Pf({char:o,eager:this.eager,isUnmasking:n});this._blocks.push(l)}}get state(){return{...super.state,_blocks:this._blocks.map(e=>e.state)}}set state(e){if(!e){this.reset();return}const{_blocks:t,...n}=e;this._blocks.forEach((s,i)=>s.state=t[i]),super.state=n}reset(){super.reset(),this._blocks.forEach(e=>e.reset())}get isComplete(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every(e=>e.isComplete)}get isFilled(){return this._blocks.every(e=>e.isFilled)}get isFixed(){return this._blocks.every(e=>e.isFixed)}get isOptional(){return this._blocks.every(e=>e.isOptional)}doCommit(){this._blocks.forEach(e=>e.doCommit()),super.doCommit()}get unmaskedValue(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce((e,t)=>e+=t.unmaskedValue,"")}set unmaskedValue(e){if(this.exposeBlock){const t=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=e,this.appendTail(t),this.doCommit()}else super.unmaskedValue=e}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce((e,t)=>e+=t.value,"")}set value(e){if(this.exposeBlock){const t=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=e,this.appendTail(t),this.doCommit()}else super.value=e}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(e){if(this.exposeBlock){const t=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=e,this.appendTail(t),this.doCommit()}else super.typedValue=e}get displayValue(){return this._blocks.reduce((e,t)=>e+=t.displayValue,"")}appendTail(e){return super.appendTail(e).aggregate(this._appendPlaceholder())}_appendEager(){var e;const t=new fe;let n=(e=this._mapPosToBlock(this.displayValue.length))==null?void 0:e.index;if(n==null)return t;this._blocks[n].isFilled&&++n;for(let s=n;s<this._blocks.length;++s){const i=this._blocks[s]._appendEager();if(!i.inserted)break;t.aggregate(i)}return t}_appendCharRaw(e,t){t===void 0&&(t={});const n=this._mapPosToBlock(this.displayValue.length),s=new fe;if(!n)return s;for(let o=n.index,a;a=this._blocks[o];++o){var i;const l=a._appendChar(e,{...t,_beforeTailState:(i=t._beforeTailState)==null||(i=i._blocks)==null?void 0:i[o]});if(s.aggregate(l),l.consumed)break}return s}extractTail(e,t){e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length);const n=new yr;return e===t||this._forEachBlocksInRange(e,t,(s,i,o,a)=>{const l=s.extractTail(o,a);l.stop=this._findStopBefore(i),l.from=this._blockStartPos(i),l instanceof yr&&(l.blockIndex=i),n.extend(l)}),n}extractInput(e,t,n){if(e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),n===void 0&&(n={}),e===t)return"";let s="";return this._forEachBlocksInRange(e,t,(i,o,a,l)=>{s+=i.extractInput(a,l,n)}),s}_findStopBefore(e){let t;for(let n=0;n<this._stops.length;++n){const s=this._stops[n];if(s<=e)t=s;else break}return t}_appendPlaceholder(e){const t=new fe;if(this.lazy&&e==null)return t;const n=this._mapPosToBlock(this.displayValue.length);if(!n)return t;const s=n.index,i=e??this._blocks.length;return this._blocks.slice(s,i).forEach(o=>{if(!o.lazy||e!=null){var a;t.aggregate(o._appendPlaceholder((a=o._blocks)==null?void 0:a.length))}}),t}_mapPosToBlock(e){let t="";for(let n=0;n<this._blocks.length;++n){const s=this._blocks[n],i=t.length;if(t+=s.displayValue,e<=t.length)return{index:n,offset:e-i}}}_blockStartPos(e){return this._blocks.slice(0,e).reduce((t,n)=>t+=n.displayValue.length,0)}_forEachBlocksInRange(e,t,n){t===void 0&&(t=this.displayValue.length);const s=this._mapPosToBlock(e);if(s){const i=this._mapPosToBlock(t),o=i&&s.index===i.index,a=s.offset,l=i&&o?i.offset:this._blocks[s.index].displayValue.length;if(n(this._blocks[s.index],s.index,a,l),i&&!o){for(let c=s.index+1;c<i.index;++c)n(this._blocks[c],c,0,this._blocks[c].displayValue.length);n(this._blocks[i.index],i.index,0,i.offset)}}}remove(e,t){e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length);const n=super.remove(e,t);return this._forEachBlocksInRange(e,t,(s,i,o,a)=>{n.aggregate(s.remove(o,a))}),n}nearestInputPos(e,t){if(t===void 0&&(t=oe.NONE),!this._blocks.length)return 0;const n=new TE(this,e);if(t===oe.NONE)return n.pushRightBeforeInput()||(n.popState(),n.pushLeftBeforeInput())?n.pos:this.displayValue.length;if(t===oe.LEFT||t===oe.FORCE_LEFT){if(t===oe.LEFT){if(n.pushRightBeforeFilled(),n.ok&&n.pos===e)return e;n.popState()}if(n.pushLeftBeforeInput(),n.pushLeftBeforeRequired(),n.pushLeftBeforeFilled(),t===oe.LEFT){if(n.pushRightBeforeInput(),n.pushRightBeforeRequired(),n.ok&&n.pos<=e||(n.popState(),n.ok&&n.pos<=e))return n.pos;n.popState()}return n.ok?n.pos:t===oe.FORCE_LEFT?0:(n.popState(),n.ok||(n.popState(),n.ok)?n.pos:0)}return t===oe.RIGHT||t===oe.FORCE_RIGHT?(n.pushRightBeforeInput(),n.pushRightBeforeRequired(),n.pushRightBeforeFilled()?n.pos:t===oe.FORCE_RIGHT?this.displayValue.length:(n.popState(),n.ok||(n.popState(),n.ok)?n.pos:this.nearestInputPos(e,oe.LEFT))):e}totalInputPositions(e,t){e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length);let n=0;return this._forEachBlocksInRange(e,t,(s,i,o,a)=>{n+=s.totalInputPositions(o,a)}),n}maskedBlock(e){return this.maskedBlocks(e)[0]}maskedBlocks(e){const t=this._maskedBlocks[e];return t?t.map(n=>this._blocks[n]):[]}pad(e){const t=new fe;return this._forEachBlocksInRange(0,this.displayValue.length,n=>t.aggregate(n.pad(e))),t}}Ue.DEFAULTS={...$e.DEFAULTS,lazy:!0,placeholderChar:"_"};Ue.STOP_CHAR="`";Ue.ESCAPE_CHAR="\\";Ue.InputDefinition=ui;Ue.FixedDefinition=Pf;ue.MaskedPattern=Ue;class Qs extends Ue{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(e){super(e)}updateOptions(e){super.updateOptions(e)}_update(e){const{to:t=this.to||0,from:n=this.from||0,maxLength:s=this.maxLength||0,autofix:i=this.autofix,...o}=e;this.to=t,this.from=n,this.maxLength=Math.max(String(t).length,s),this.autofix=i;const a=String(this.from).padStart(this.maxLength,"0"),l=String(this.to).padStart(this.maxLength,"0");let c=0;for(;c<l.length&&l[c]===a[c];)++c;o.mask=l.slice(0,c).replace(/0/g,"\\0")+"0".repeat(this.maxLength-c),super._update(o)}get isComplete(){return super.isComplete&&!!this.value}boundaries(e){let t="",n="";const[,s,i]=e.match(/^(\D*)(\d*)(\D*)/)||[];return i&&(t="0".repeat(s.length)+i,n="9".repeat(s.length)+i),t=t.padEnd(this.maxLength,"0"),n=n.padEnd(this.maxLength,"9"),[t,n]}doPrepareChar(e,t){t===void 0&&(t={});let n;return[e,n]=super.doPrepareChar(e.replace(/\D/g,""),t),e||(n.skip=!this.isComplete),[e,n]}_appendCharRaw(e,t){if(t===void 0&&(t={}),!this.autofix||this.value.length+1>this.maxLength)return super._appendCharRaw(e,t);const n=String(this.from).padStart(this.maxLength,"0"),s=String(this.to).padStart(this.maxLength,"0"),[i,o]=this.boundaries(this.value+e);return Number(o)<this.from?super._appendCharRaw(n[this.value.length],t):Number(i)>this.to?!t.tail&&this.autofix==="pad"&&this.value.length+1<this.maxLength?super._appendCharRaw(n[this.value.length],t).aggregate(this._appendCharRaw(e,t)):super._appendCharRaw(s[this.value.length],t):super._appendCharRaw(e,t)}doValidate(e){const t=this.value;if(t.search(/[^0]/)===-1&&t.length<=this._matchFrom)return!0;const[s,i]=this.boundaries(t);return this.from<=Number(i)&&Number(s)<=this.to&&super.doValidate(e)}pad(e){const t=new fe;if(this.value.length===this.maxLength)return t;const n=this.value,s=this.maxLength-this.value.length;if(s){this.reset();for(let i=0;i<s;++i)t.aggregate(super._appendCharRaw("0",e));n.split("").forEach(i=>this._appendCharRaw(i))}return t}}ue.MaskedRange=Qs;const RE="d{.}`m{.}`Y";class qt extends Ue{static extractPatternOptions(e){const{mask:t,pattern:n,...s}=e;return{...s,mask:nr(t)?t:n}}constructor(e){super(qt.extractPatternOptions({...qt.DEFAULTS,...e}))}updateOptions(e){super.updateOptions(e)}_update(e){const{mask:t,pattern:n,blocks:s,...i}={...qt.DEFAULTS,...e},o=Object.assign({},qt.GET_DEFAULT_BLOCKS());e.min&&(o.Y.from=e.min.getFullYear()),e.max&&(o.Y.to=e.max.getFullYear()),e.min&&e.max&&o.Y.from===o.Y.to&&(o.m.from=e.min.getMonth()+1,o.m.to=e.max.getMonth()+1,o.m.from===o.m.to&&(o.d.from=e.min.getDate(),o.d.to=e.max.getDate())),Object.assign(o,this.blocks,s),super._update({...i,mask:nr(t)?t:n,blocks:o})}doValidate(e){const t=this.date;return super.doValidate(e)&&(!this.isComplete||this.isDateExist(this.value)&&t!=null&&(this.min==null||this.min<=t)&&(this.max==null||t<=this.max))}isDateExist(e){return this.format(this.parse(e,this),this).indexOf(e)>=0}get date(){return this.typedValue}set date(e){this.typedValue=e}get typedValue(){return this.isComplete?super.typedValue:null}set typedValue(e){super.typedValue=e}maskEquals(e){return e===Date||super.maskEquals(e)}optionsIsChanged(e){return super.optionsIsChanged(qt.extractPatternOptions(e))}}qt.GET_DEFAULT_BLOCKS=()=>({d:{mask:Qs,from:1,to:31,maxLength:2},m:{mask:Qs,from:1,to:12,maxLength:2},Y:{mask:Qs,from:1900,to:9999}});qt.DEFAULTS={...Ue.DEFAULTS,mask:Date,pattern:RE,format:(r,e)=>{if(!r)return"";const t=String(r.getDate()).padStart(2,"0"),n=String(r.getMonth()+1).padStart(2,"0"),s=r.getFullYear();return[t,n,s].join(".")},parse:(r,e)=>{const[t,n,s]=r.split(".").map(Number);return new Date(s,n-1,t)}};ue.MaskedDate=qt;class Bi extends $e{constructor(e){super({...Bi.DEFAULTS,...e}),this.currentMask=void 0}updateOptions(e){super.updateOptions(e)}_update(e){super._update(e),"mask"in e&&(this.exposeMask=void 0,this.compiledMasks=Array.isArray(e.mask)?e.mask.map(t=>{const{expose:n,...s}=es(t),i=$t({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...s});return n&&(this.exposeMask=i),i}):[])}_appendCharRaw(e,t){t===void 0&&(t={});const n=this._applyDispatch(e,t);return this.currentMask&&n.aggregate(this.currentMask._appendChar(e,this.currentMaskFlags(t))),n}_applyDispatch(e,t,n){e===void 0&&(e=""),t===void 0&&(t={}),n===void 0&&(n="");const s=t.tail&&t._beforeTailState!=null?t._beforeTailState._value:this.value,i=this.rawInputValue,o=t.tail&&t._beforeTailState!=null?t._beforeTailState._rawInputValue:i,a=i.slice(o.length),l=this.currentMask,c=new fe,d=l==null?void 0:l.state;return this.currentMask=this.doDispatch(e,{...t},n),this.currentMask&&(this.currentMask!==l?(this.currentMask.reset(),o&&(this.currentMask.append(o,{raw:!0}),c.tailShift=this.currentMask.value.length-s.length),a&&(c.tailShift+=this.currentMask.append(a,{raw:!0,tail:!0}).tailShift)):d&&(this.currentMask.state=d)),c}_appendPlaceholder(){const e=this._applyDispatch();return this.currentMask&&e.aggregate(this.currentMask._appendPlaceholder()),e}_appendEager(){const e=this._applyDispatch();return this.currentMask&&e.aggregate(this.currentMask._appendEager()),e}appendTail(e){const t=new fe;return e&&t.aggregate(this._applyDispatch("",{},e)),t.aggregate(this.currentMask?this.currentMask.appendTail(e):super.appendTail(e))}currentMaskFlags(e){var t,n;return{...e,_beforeTailState:((t=e._beforeTailState)==null?void 0:t.currentMaskRef)===this.currentMask&&((n=e._beforeTailState)==null?void 0:n.currentMask)||e._beforeTailState}}doDispatch(e,t,n){return t===void 0&&(t={}),n===void 0&&(n=""),this.dispatch(e,this,t,n)}doValidate(e){return super.doValidate(e)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(e)))}doPrepare(e,t){t===void 0&&(t={});let[n,s]=super.doPrepare(e,t);if(this.currentMask){let i;[n,i]=super.doPrepare(n,this.currentMaskFlags(t)),s=s.aggregate(i)}return[n,s]}doPrepareChar(e,t){t===void 0&&(t={});let[n,s]=super.doPrepareChar(e,t);if(this.currentMask){let i;[n,i]=super.doPrepareChar(n,this.currentMaskFlags(t)),s=s.aggregate(i)}return[n,s]}reset(){var e;(e=this.currentMask)==null||e.reset(),this.compiledMasks.forEach(t=>t.reset())}get value(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:""}set value(e){this.exposeMask?(this.exposeMask.value=e,this.currentMask=this.exposeMask,this._applyDispatch()):super.value=e}get unmaskedValue(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:""}set unmaskedValue(e){this.exposeMask?(this.exposeMask.unmaskedValue=e,this.currentMask=this.exposeMask,this._applyDispatch()):super.unmaskedValue=e}get typedValue(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:""}set typedValue(e){if(this.exposeMask){this.exposeMask.typedValue=e,this.currentMask=this.exposeMask,this._applyDispatch();return}let t=String(e);this.currentMask&&(this.currentMask.typedValue=e,t=this.currentMask.unmaskedValue),this.unmaskedValue=t}get displayValue(){return this.currentMask?this.currentMask.displayValue:""}get isComplete(){var e;return!!((e=this.currentMask)!=null&&e.isComplete)}get isFilled(){var e;return!!((e=this.currentMask)!=null&&e.isFilled)}remove(e,t){const n=new fe;return this.currentMask&&n.aggregate(this.currentMask.remove(e,t)).aggregate(this._applyDispatch()),n}get state(){var e;return{...super.state,_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map(t=>t.state),currentMaskRef:this.currentMask,currentMask:(e=this.currentMask)==null?void 0:e.state}}set state(e){const{compiledMasks:t,currentMaskRef:n,currentMask:s,...i}=e;t&&this.compiledMasks.forEach((o,a)=>o.state=t[a]),n!=null&&(this.currentMask=n,this.currentMask.state=s),super.state=i}extractInput(e,t,n){return this.currentMask?this.currentMask.extractInput(e,t,n):""}extractTail(e,t){return this.currentMask?this.currentMask.extractTail(e,t):super.extractTail(e,t)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(e,t){return this.currentMask?this.currentMask.nearestInputPos(e,t):super.nearestInputPos(e,t)}get overwrite(){return this.currentMask?this.currentMask.overwrite:this._overwrite}set overwrite(e){this._overwrite=e}get eager(){return this.currentMask?this.currentMask.eager:this._eager}set eager(e){this._eager=e}get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid}set skipInvalid(e){this._skipInvalid=e}get autofix(){return this.currentMask?this.currentMask.autofix:this._autofix}set autofix(e){this._autofix=e}maskEquals(e){return Array.isArray(e)?this.compiledMasks.every((t,n)=>{if(!e[n])return;const{mask:s,...i}=e[n];return li(t,i)&&t.maskEquals(s)}):super.maskEquals(e)}typedValueEquals(e){var t;return!!((t=this.currentMask)!=null&&t.typedValueEquals(e))}}Bi.DEFAULTS={...$e.DEFAULTS,dispatch:(r,e,t,n)=>{if(!e.compiledMasks.length)return;const s=e.rawInputValue,i=e.compiledMasks.map((o,a)=>{const l=e.currentMask===o,c=l?o.displayValue.length:o.nearestInputPos(o.displayValue.length,oe.FORCE_LEFT);return o.rawInputValue!==s?(o.reset(),o.append(s,{raw:!0})):l||o.remove(c),o.append(r,e.currentMaskFlags(t)),o.appendTail(n),{index:a,weight:o.rawInputValue.length,totalInputPositions:o.totalInputPositions(0,Math.max(c,o.nearestInputPos(o.displayValue.length,oe.FORCE_LEFT)))}});return i.sort((o,a)=>a.weight-o.weight||a.totalInputPositions-o.totalInputPositions),e.compiledMasks[i[0].index]}};ue.MaskedDynamic=Bi;class qi extends Ue{constructor(e){super({...qi.DEFAULTS,...e})}updateOptions(e){super.updateOptions(e)}_update(e){const{enum:t,...n}=e;if(t){const s=t.map(a=>a.length),i=Math.min(...s),o=Math.max(...s)-i;n.mask="*".repeat(i),o&&(n.mask+="["+"*".repeat(o)+"]"),this.enum=t}super._update(n)}_appendCharRaw(e,t){t===void 0&&(t={});const n=Math.min(this.nearestInputPos(0,oe.FORCE_RIGHT),this.value.length),s=this.enum.filter(i=>this.matchValue(i,this.unmaskedValue+e,n));if(s.length){s.length===1&&this._forEachBlocksInRange(0,this.value.length,(o,a)=>{const l=s[0][a];a>=this.value.length||l===o.value||(o.reset(),o._appendChar(l,t))});const i=super._appendCharRaw(s[0][this.value.length],t);return s.length===1&&s[0].slice(this.unmaskedValue.length).split("").forEach(o=>i.aggregate(super._appendCharRaw(o))),i}return new fe({skip:!this.isComplete})}extractTail(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),new At("",e)}remove(e,t){if(e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),e===t)return new fe;const n=Math.min(super.nearestInputPos(0,oe.FORCE_RIGHT),this.value.length);let s;for(s=e;s>=0&&!(this.enum.filter(a=>this.matchValue(a,this.value.slice(n,s),n)).length>1);--s);const i=super.remove(s,t);return i.tailShift+=s-e,i}get isComplete(){return this.enum.indexOf(this.value)>=0}}qi.DEFAULTS={...Ue.DEFAULTS,matchValue:(r,e,t)=>r.indexOf(e,t)===t};ue.MaskedEnum=qi;class IE extends $e{updateOptions(e){super.updateOptions(e)}_update(e){super._update({...e,validate:e.mask})}}ue.MaskedFunction=IE;var Bf;class Ze extends $e{constructor(e){super({...Ze.DEFAULTS,...e})}updateOptions(e){super.updateOptions(e)}_update(e){super._update(e),this._updateRegExps()}_updateRegExps(){const e="^"+(this.allowNegative?"[+|\\-]?":""),t="\\d*",n=(this.scale?"("+Wo(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(e+t+n),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(Wo).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(Wo(this.thousandsSeparator),"g")}_removeThousandsSeparators(e){return e.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(e){const t=e.split(this.radix);return t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),t.join(this.radix)}doPrepareChar(e,t){t===void 0&&(t={});const[n,s]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(t.input&&t.raw||!t.input&&!t.raw)?e.replace(this._mapToRadixRegExp,this.radix):e),t);return e&&!n&&(s.skip=!0),n&&!this.allowPositive&&!this.value&&n!=="-"&&s.aggregate(this._appendChar("-")),[n,s]}_separatorsCount(e,t){t===void 0&&(t=!1);let n=0;for(let s=0;s<e;++s)this._value.indexOf(this.thousandsSeparator,s)===s&&(++n,t&&(e+=this.thousandsSeparator.length));return n}_separatorsCountFromSlice(e){return e===void 0&&(e=this._value),this._separatorsCount(this._removeThousandsSeparators(e).length,!0)}extractInput(e,t,n){return e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),[e,t]=this._adjustRangeWithSeparators(e,t),this._removeThousandsSeparators(super.extractInput(e,t,n))}_appendCharRaw(e,t){t===void 0&&(t={});const n=t.tail&&t._beforeTailState?t._beforeTailState._value:this._value,s=this._separatorsCountFromSlice(n);this._value=this._removeThousandsSeparators(this.value);const i=this._value;this._value+=e;const o=this.number;let a=!isNaN(o),l=!1;if(a){let h;this.min!=null&&this.min<0&&this.number<this.min&&(h=this.min),this.max!=null&&this.max>0&&this.number>this.max&&(h=this.max),h!=null&&(this.autofix?(this._value=this.format(h,this).replace(Ze.UNMASKED_RADIX,this.radix),l||(l=i===this._value&&!t.tail)):a=!1),a&&(a=!!this._value.match(this._numberRegExp))}let c;a?c=new fe({inserted:this._value.slice(i.length),rawInserted:l?"":e,skip:l}):(this._value=i,c=new fe),this._value=this._insertThousandsSeparators(this._value);const d=t.tail&&t._beforeTailState?t._beforeTailState._value:this._value,m=this._separatorsCountFromSlice(d);return c.tailShift+=(m-s)*this.thousandsSeparator.length,c}_findSeparatorAround(e){if(this.thousandsSeparator){const t=e-this.thousandsSeparator.length+1,n=this.value.indexOf(this.thousandsSeparator,t);if(n<=e)return n}return-1}_adjustRangeWithSeparators(e,t){const n=this._findSeparatorAround(e);n>=0&&(e=n);const s=this._findSeparatorAround(t);return s>=0&&(t=s+this.thousandsSeparator.length),[e,t]}remove(e,t){e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),[e,t]=this._adjustRangeWithSeparators(e,t);const n=this.value.slice(0,e),s=this.value.slice(t),i=this._separatorsCount(n.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(n+s));const o=this._separatorsCountFromSlice(n);return new fe({tailShift:(o-i)*this.thousandsSeparator.length})}nearestInputPos(e,t){if(!this.thousandsSeparator)return e;switch(t){case oe.NONE:case oe.LEFT:case oe.FORCE_LEFT:{const n=this._findSeparatorAround(e-1);if(n>=0){const s=n+this.thousandsSeparator.length;if(e<s||this.value.length<=s||t===oe.FORCE_LEFT)return n}break}case oe.RIGHT:case oe.FORCE_RIGHT:{const n=this._findSeparatorAround(e);if(n>=0)return n+this.thousandsSeparator.length}}return e}doCommit(){if(this.value){const e=this.number;let t=e;this.min!=null&&(t=Math.max(t,this.min)),this.max!=null&&(t=Math.min(t,this.max)),t!==e&&(this.unmaskedValue=this.format(t,this));let n=this.value;this.normalizeZeros&&(n=this._normalizeZeros(n)),this.padFractionalZeros&&this.scale>0&&(n=this._padFractionalZeros(n)),this._value=n}super.doCommit()}_normalizeZeros(e){const t=this._removeThousandsSeparators(e).split(this.radix);return t[0]=t[0].replace(/^(\D*)(0*)(\d*)/,(n,s,i,o)=>s+o),e.length&&!/\d$/.test(t[0])&&(t[0]=t[0]+"0"),t.length>1&&(t[1]=t[1].replace(/0*$/,""),t[1].length||(t.length=1)),this._insertThousandsSeparators(t.join(this.radix))}_padFractionalZeros(e){if(!e)return e;const t=e.split(this.radix);return t.length<2&&t.push(""),t[1]=t[1].padEnd(this.scale,"0"),t.join(this.radix)}doSkipInvalid(e,t,n){t===void 0&&(t={});const s=this.scale===0&&e!==this.thousandsSeparator&&(e===this.radix||e===Ze.UNMASKED_RADIX||this.mapToRadix.includes(e));return super.doSkipInvalid(e,t,n)&&!s}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,Ze.UNMASKED_RADIX)}set unmaskedValue(e){super.unmaskedValue=e}get typedValue(){return this.parse(this.unmaskedValue,this)}set typedValue(e){this.rawInputValue=this.format(e,this).replace(Ze.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(e){this.typedValue=e}get allowNegative(){return this.min!=null&&this.min<0||this.max!=null&&this.max<0}get allowPositive(){return this.min!=null&&this.min>0||this.max!=null&&this.max>0}typedValueEquals(e){return(super.typedValueEquals(e)||Ze.EMPTY_VALUES.includes(e)&&Ze.EMPTY_VALUES.includes(this.typedValue))&&!(e===0&&this.value==="")}}Bf=Ze;Ze.UNMASKED_RADIX=".";Ze.EMPTY_VALUES=[...$e.EMPTY_VALUES,0];Ze.DEFAULTS={...$e.DEFAULTS,mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[Bf.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:!0,padFractionalZeros:!1,parse:Number,format:r=>r.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20})};ue.MaskedNumber=Ze;const qa={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function qf(r,e,t){e===void 0&&(e=qa.MASKED),t===void 0&&(t=qa.MASKED);const n=$t(r);return s=>n.runIsolated(i=>(i[e]=s,i[t]))}function OE(r,e,t,n){return qf(e,t,n)(r)}ue.PIPE_TYPE=qa;ue.createPipe=qf;ue.pipe=OE;class LE extends Ue{get repeatFrom(){var e;return(e=Array.isArray(this.repeat)?this.repeat[0]:this.repeat===1/0?0:this.repeat)!=null?e:0}get repeatTo(){var e;return(e=Array.isArray(this.repeat)?this.repeat[1]:this.repeat)!=null?e:1/0}constructor(e){super(e)}updateOptions(e){super.updateOptions(e)}_update(e){var t,n,s;const{repeat:i,...o}=es(e);this._blockOpts=Object.assign({},this._blockOpts,o);const a=$t(this._blockOpts);this.repeat=(t=(n=i??a.repeat)!=null?n:this.repeat)!=null?t:1/0,super._update({mask:"m".repeat(Math.max(this.repeatTo===1/0&&((s=this._blocks)==null?void 0:s.length)||0,this.repeatFrom)),blocks:{m:a},eager:a.eager,overwrite:a.overwrite,skipInvalid:a.skipInvalid,lazy:a.lazy,placeholderChar:a.placeholderChar,displayChar:a.displayChar})}_allocateBlock(e){if(e<this._blocks.length)return this._blocks[e];if(this.repeatTo===1/0||this._blocks.length<this.repeatTo)return this._blocks.push($t(this._blockOpts)),this.mask+="m",this._blocks[this._blocks.length-1]}_appendCharRaw(e,t){t===void 0&&(t={});const n=new fe;for(let l=(s=(i=this._mapPosToBlock(this.displayValue.length))==null?void 0:i.index)!=null?s:Math.max(this._blocks.length-1,0),c,d;c=(o=this._blocks[l])!=null?o:d=!d&&this._allocateBlock(l);++l){var s,i,o,a;const m=c._appendChar(e,{...t,_beforeTailState:(a=t._beforeTailState)==null||(a=a._blocks)==null?void 0:a[l]});if(m.skip&&d){this._blocks.pop(),this.mask=this.mask.slice(1);break}if(n.aggregate(m),m.consumed)break}return n}_trimEmptyTail(e,t){var n,s;e===void 0&&(e=0);const i=Math.max(((n=this._mapPosToBlock(e))==null?void 0:n.index)||0,this.repeatFrom,0);let o;t!=null&&(o=(s=this._mapPosToBlock(t))==null?void 0:s.index),o==null&&(o=this._blocks.length-1);let a=0;for(let l=o;i<=l&&!this._blocks[l].unmaskedValue;--l,++a);a&&(this._blocks.splice(o-a+1,a),this.mask=this.mask.slice(a))}reset(){super.reset(),this._trimEmptyTail()}remove(e,t){e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length);const n=super.remove(e,t);return this._trimEmptyTail(e,t),n}totalInputPositions(e,t){return e===void 0&&(e=0),t==null&&this.repeatTo===1/0?1/0:super.totalInputPositions(e,t)}get state(){return super.state}set state(e){this._blocks.length=e._blocks.length,this.mask=this.mask.slice(0,this._blocks.length),super.state=e}}ue.RepeatBlock=LE;try{globalThis.IMask=ue}catch{}var Fs={exports:{}},js={exports:{}},be={};/** @license React v16.13.1
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var ic;function ME(){if(ic)return be;ic=1;var r=typeof Symbol=="function"&&Symbol.for,e=r?Symbol.for("react.element"):60103,t=r?Symbol.for("react.portal"):60106,n=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,i=r?Symbol.for("react.profiler"):60114,o=r?Symbol.for("react.provider"):60109,a=r?Symbol.for("react.context"):60110,l=r?Symbol.for("react.async_mode"):60111,c=r?Symbol.for("react.concurrent_mode"):60111,d=r?Symbol.for("react.forward_ref"):60112,m=r?Symbol.for("react.suspense"):60113,h=r?Symbol.for("react.suspense_list"):60120,g=r?Symbol.for("react.memo"):60115,v=r?Symbol.for("react.lazy"):60116,f=r?Symbol.for("react.block"):60121,y=r?Symbol.for("react.fundamental"):60117,x=r?Symbol.for("react.responder"):60118,w=r?Symbol.for("react.scope"):60119;function _(S){if(typeof S=="object"&&S!==null){var D=S.$$typeof;switch(D){case e:switch(S=S.type,S){case l:case c:case n:case i:case s:case m:return S;default:switch(S=S&&S.$$typeof,S){case a:case d:case v:case g:case o:return S;default:return D}}case t:return D}}}function k(S){return _(S)===c}return be.AsyncMode=l,be.ConcurrentMode=c,be.ContextConsumer=a,be.ContextProvider=o,be.Element=e,be.ForwardRef=d,be.Fragment=n,be.Lazy=v,be.Memo=g,be.Portal=t,be.Profiler=i,be.StrictMode=s,be.Suspense=m,be.isAsyncMode=function(S){return k(S)||_(S)===l},be.isConcurrentMode=k,be.isContextConsumer=function(S){return _(S)===a},be.isContextProvider=function(S){return _(S)===o},be.isElement=function(S){return typeof S=="object"&&S!==null&&S.$$typeof===e},be.isForwardRef=function(S){return _(S)===d},be.isFragment=function(S){return _(S)===n},be.isLazy=function(S){return _(S)===v},be.isMemo=function(S){return _(S)===g},be.isPortal=function(S){return _(S)===t},be.isProfiler=function(S){return _(S)===i},be.isStrictMode=function(S){return _(S)===s},be.isSuspense=function(S){return _(S)===m},be.isValidElementType=function(S){return typeof S=="string"||typeof S=="function"||S===n||S===c||S===i||S===s||S===m||S===h||typeof S=="object"&&S!==null&&(S.$$typeof===v||S.$$typeof===g||S.$$typeof===o||S.$$typeof===a||S.$$typeof===d||S.$$typeof===y||S.$$typeof===x||S.$$typeof===w||S.$$typeof===f)},be.typeOf=_,be}var xe={};/** @license React v16.13.1
* react-is.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var oc;function DE(){return oc||(oc=1,process.env.NODE_ENV!=="production"&&function(){var r=typeof Symbol=="function"&&Symbol.for,e=r?Symbol.for("react.element"):60103,t=r?Symbol.for("react.portal"):60106,n=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,i=r?Symbol.for("react.profiler"):60114,o=r?Symbol.for("react.provider"):60109,a=r?Symbol.for("react.context"):60110,l=r?Symbol.for("react.async_mode"):60111,c=r?Symbol.for("react.concurrent_mode"):60111,d=r?Symbol.for("react.forward_ref"):60112,m=r?Symbol.for("react.suspense"):60113,h=r?Symbol.for("react.suspense_list"):60120,g=r?Symbol.for("react.memo"):60115,v=r?Symbol.for("react.lazy"):60116,f=r?Symbol.for("react.block"):60121,y=r?Symbol.for("react.fundamental"):60117,x=r?Symbol.for("react.responder"):60118,w=r?Symbol.for("react.scope"):60119;function _(T){return typeof T=="string"||typeof T=="function"||T===n||T===c||T===i||T===s||T===m||T===h||typeof T=="object"&&T!==null&&(T.$$typeof===v||T.$$typeof===g||T.$$typeof===o||T.$$typeof===a||T.$$typeof===d||T.$$typeof===y||T.$$typeof===x||T.$$typeof===w||T.$$typeof===f)}function k(T){if(typeof T=="object"&&T!==null){var le=T.$$typeof;switch(le){case e:var pe=T.type;switch(pe){case l:case c:case n:case i:case s:case m:return pe;default:var Ce=pe&&pe.$$typeof;switch(Ce){case a:case d:case v:case g:case o:return Ce;default:return le}}case t:return le}}}var S=l,D=c,F=a,ae=o,ce=e,ge=d,b=n,P=v,A=g,H=t,V=i,N=s,q=m,W=!1;function Z(T){return W||(W=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),C(T)||k(T)===l}function C(T){return k(T)===c}function L(T){return k(T)===a}function $(T){return k(T)===o}function K(T){return typeof T=="object"&&T!==null&&T.$$typeof===e}function z(T){return k(T)===d}function U(T){return k(T)===n}function Q(T){return k(T)===v}function B(T){return k(T)===g}function j(T){return k(T)===t}function Y(T){return k(T)===i}function G(T){return k(T)===s}function X(T){return k(T)===m}xe.AsyncMode=S,xe.ConcurrentMode=D,xe.ContextConsumer=F,xe.ContextProvider=ae,xe.Element=ce,xe.ForwardRef=ge,xe.Fragment=b,xe.Lazy=P,xe.Memo=A,xe.Portal=H,xe.Profiler=V,xe.StrictMode=N,xe.Suspense=q,xe.isAsyncMode=Z,xe.isConcurrentMode=C,xe.isContextConsumer=L,xe.isContextProvider=$,xe.isElement=K,xe.isForwardRef=z,xe.isFragment=U,xe.isLazy=Q,xe.isMemo=B,xe.isPortal=j,xe.isProfiler=Y,xe.isStrictMode=G,xe.isSuspense=X,xe.isValidElementType=_,xe.typeOf=k}()),xe}var ac;function Ff(){return ac||(ac=1,process.env.NODE_ENV==="production"?js.exports=ME():js.exports=DE()),js.exports}/*
object-assign
(c) Sindre Sorhus
@license MIT
*/var Yo,lc;function PE(){if(lc)return Yo;lc=1;var r=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable;function n(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function s(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var o={},a=0;a<10;a++)o["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(o).map(function(d){return o[d]});if(l.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(d){c[d]=d}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Yo=s()?Object.assign:function(i,o){for(var a,l=n(i),c,d=1;d<arguments.length;d++){a=Object(arguments[d]);for(var m in a)e.call(a,m)&&(l[m]=a[m]);if(r){c=r(a);for(var h=0;h<c.length;h++)t.call(a,c[h])&&(l[c[h]]=a[c[h]])}}return l},Yo}var Zo,uc;function wl(){if(uc)return Zo;uc=1;var r="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Zo=r,Zo}var Xo,cc;function jf(){return cc||(cc=1,Xo=Function.call.bind(Object.prototype.hasOwnProperty)),Xo}var Qo,hc;function BE(){if(hc)return Qo;hc=1;var r=function(){};if(process.env.NODE_ENV!=="production"){var e=wl(),t={},n=jf();r=function(i){var o="Warning: "+i;typeof console<"u"&&console.error(o);try{throw new Error(o)}catch{}}}function s(i,o,a,l,c){if(process.env.NODE_ENV!=="production"){for(var d in i)if(n(i,d)){var m;try{if(typeof i[d]!="function"){var h=Error((l||"React class")+": "+a+" type `"+d+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[d]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw h.name="Invariant Violation",h}m=i[d](o,d,l,a,null,e)}catch(v){m=v}if(m&&!(m instanceof Error)&&r((l||"React class")+": type specification of "+a+" `"+d+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof m+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),m instanceof Error&&!(m.message in t)){t[m.message]=!0;var g=c?c():"";r("Failed "+a+" type: "+m.message+(g??""))}}}}return s.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(t={})},Qo=s,Qo}var Jo,dc;function qE(){if(dc)return Jo;dc=1;var r=Ff(),e=PE(),t=wl(),n=jf(),s=BE(),i=function(){};process.env.NODE_ENV!=="production"&&(i=function(a){var l="Warning: "+a;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function o(){return null}return Jo=function(a,l){var c=typeof Symbol=="function"&&Symbol.iterator,d="@@iterator";function m(C){var L=C&&(c&&C[c]||C[d]);if(typeof L=="function")return L}var h="<<anonymous>>",g={array:x("array"),bigint:x("bigint"),bool:x("boolean"),func:x("function"),number:x("number"),object:x("object"),string:x("string"),symbol:x("symbol"),any:w(),arrayOf:_,element:k(),elementType:S(),instanceOf:D,node:ge(),objectOf:ae,oneOf:F,oneOfType:ce,shape:P,exact:A};function v(C,L){return C===L?C!==0||1/C===1/L:C!==C&&L!==L}function f(C,L){this.message=C,this.data=L&&typeof L=="object"?L:{},this.stack=""}f.prototype=Error.prototype;function y(C){if(process.env.NODE_ENV!=="production")var L={},$=0;function K(U,Q,B,j,Y,G,X){if(j=j||h,G=G||B,X!==t){if(l){var T=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw T.name="Invariant Violation",T}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var le=j+":"+B;!L[le]&&$<3&&(i("You are manually calling a React.PropTypes validation function for the `"+G+"` prop on `"+j+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),L[le]=!0,$++)}}return Q[B]==null?U?Q[B]===null?new f("The "+Y+" `"+G+"` is marked as required "+("in `"+j+"`, but its value is `null`.")):new f("The "+Y+" `"+G+"` is marked as required in "+("`"+j+"`, but its value is `undefined`.")):null:C(Q,B,j,Y,G)}var z=K.bind(null,!1);return z.isRequired=K.bind(null,!0),z}function x(C){function L($,K,z,U,Q,B){var j=$[K],Y=N(j);if(Y!==C){var G=q(j);return new f("Invalid "+U+" `"+Q+"` of type "+("`"+G+"` supplied to `"+z+"`, expected ")+("`"+C+"`."),{expectedType:C})}return null}return y(L)}function w(){return y(o)}function _(C){function L($,K,z,U,Q){if(typeof C!="function")return new f("Property `"+Q+"` of component `"+z+"` has invalid PropType notation inside arrayOf.");var B=$[K];if(!Array.isArray(B)){var j=N(B);return new f("Invalid "+U+" `"+Q+"` of type "+("`"+j+"` supplied to `"+z+"`, expected an array."))}for(var Y=0;Y<B.length;Y++){var G=C(B,Y,z,U,Q+"["+Y+"]",t);if(G instanceof Error)return G}return null}return y(L)}function k(){function C(L,$,K,z,U){var Q=L[$];if(!a(Q)){var B=N(Q);return new f("Invalid "+z+" `"+U+"` of type "+("`"+B+"` supplied to `"+K+"`, expected a single ReactElement."))}return null}return y(C)}function S(){function C(L,$,K,z,U){var Q=L[$];if(!r.isValidElementType(Q)){var B=N(Q);return new f("Invalid "+z+" `"+U+"` of type "+("`"+B+"` supplied to `"+K+"`, expected a single ReactElement type."))}return null}return y(C)}function D(C){function L($,K,z,U,Q){if(!($[K]instanceof C)){var B=C.name||h,j=Z($[K]);return new f("Invalid "+U+" `"+Q+"` of type "+("`"+j+"` supplied to `"+z+"`, expected ")+("instance of `"+B+"`."))}return null}return y(L)}function F(C){if(!Array.isArray(C))return process.env.NODE_ENV!=="production"&&(arguments.length>1?i("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):i("Invalid argument supplied to oneOf, expected an array.")),o;function L($,K,z,U,Q){for(var B=$[K],j=0;j<C.length;j++)if(v(B,C[j]))return null;var Y=JSON.stringify(C,function(X,T){var le=q(T);return le==="symbol"?String(T):T});return new f("Invalid "+U+" `"+Q+"` of value `"+String(B)+"` "+("supplied to `"+z+"`, expected one of "+Y+"."))}return y(L)}function ae(C){function L($,K,z,U,Q){if(typeof C!="function")return new f("Property `"+Q+"` of component `"+z+"` has invalid PropType notation inside objectOf.");var B=$[K],j=N(B);if(j!=="object")return new f("Invalid "+U+" `"+Q+"` of type "+("`"+j+"` supplied to `"+z+"`, expected an object."));for(var Y in B)if(n(B,Y)){var G=C(B,Y,z,U,Q+"."+Y,t);if(G instanceof Error)return G}return null}return y(L)}function ce(C){if(!Array.isArray(C))return process.env.NODE_ENV!=="production"&&i("Invalid argument supplied to oneOfType, expected an instance of array."),o;for(var L=0;L<C.length;L++){var $=C[L];if(typeof $!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+W($)+" at index "+L+"."),o}function K(z,U,Q,B,j){for(var Y=[],G=0;G<C.length;G++){var X=C[G],T=X(z,U,Q,B,j,t);if(T==null)return null;T.data&&n(T.data,"expectedType")&&Y.push(T.data.expectedType)}var le=Y.length>0?", expected one of type ["+Y.join(", ")+"]":"";return new f("Invalid "+B+" `"+j+"` supplied to "+("`"+Q+"`"+le+"."))}return y(K)}function ge(){function C(L,$,K,z,U){return H(L[$])?null:new f("Invalid "+z+" `"+U+"` supplied to "+("`"+K+"`, expected a ReactNode."))}return y(C)}function b(C,L,$,K,z){return new f((C||"React class")+": "+L+" type `"+$+"."+K+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+z+"`.")}function P(C){function L($,K,z,U,Q){var B=$[K],j=N(B);if(j!=="object")return new f("Invalid "+U+" `"+Q+"` of type `"+j+"` "+("supplied to `"+z+"`, expected `object`."));for(var Y in C){var G=C[Y];if(typeof G!="function")return b(z,U,Q,Y,q(G));var X=G(B,Y,z,U,Q+"."+Y,t);if(X)return X}return null}return y(L)}function A(C){function L($,K,z,U,Q){var B=$[K],j=N(B);if(j!=="object")return new f("Invalid "+U+" `"+Q+"` of type `"+j+"` "+("supplied to `"+z+"`, expected `object`."));var Y=e({},$[K],C);for(var G in Y){var X=C[G];if(n(C,G)&&typeof X!="function")return b(z,U,Q,G,q(X));if(!X)return new f("Invalid "+U+" `"+Q+"` key `"+G+"` supplied to `"+z+"`.\nBad object: "+JSON.stringify($[K],null," ")+`
Valid keys: `+JSON.stringify(Object.keys(C),null," "));var T=X(B,G,z,U,Q+"."+G,t);if(T)return T}return null}return y(L)}function H(C){switch(typeof C){case"number":case"string":case"undefined":return!0;case"boolean":return!C;case"object":if(Array.isArray(C))return C.every(H);if(C===null||a(C))return!0;var L=m(C);if(L){var $=L.call(C),K;if(L!==C.entries){for(;!(K=$.next()).done;)if(!H(K.value))return!1}else for(;!(K=$.next()).done;){var z=K.value;if(z&&!H(z[1]))return!1}}else return!1;return!0;default:return!1}}function V(C,L){return C==="symbol"?!0:L?L["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&L instanceof Symbol:!1}function N(C){var L=typeof C;return Array.isArray(C)?"array":C instanceof RegExp?"object":V(L,C)?"symbol":L}function q(C){if(typeof C>"u"||C===null)return""+C;var L=N(C);if(L==="object"){if(C instanceof Date)return"date";if(C instanceof RegExp)return"regexp"}return L}function W(C){var L=q(C);switch(L){case"array":case"object":return"an "+L;case"boolean":case"date":case"regexp":return"a "+L;default:return L}}function Z(C){return!C.constructor||!C.constructor.name?h:C.constructor.name}return g.checkPropTypes=s,g.resetWarningCache=s.resetWarningCache,g.PropTypes=g,g},Jo}var ea,fc;function FE(){if(fc)return ea;fc=1;var r=wl();function e(){}function t(){}return t.resetWarningCache=e,ea=function(){function n(o,a,l,c,d,m){if(m!==r){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}n.isRequired=n;function s(){return n}var i={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:s,element:n,elementType:n,instanceOf:s,node:n,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:t,resetWarningCache:e};return i.PropTypes=i,i},ea}var pc;function jE(){if(pc)return Fs.exports;if(pc=1,process.env.NODE_ENV!=="production"){var r=Ff(),e=!0;Fs.exports=qE()(r.isElement,e)}else Fs.exports=FE()();return Fs.exports}var VE=jE();const se=ze.getDefaultExportFromCjs(VE),Vf={mask:se.oneOfType([se.array,se.func,se.string,se.instanceOf(RegExp),se.oneOf([Date,Number,ue.Masked]),se.instanceOf(ue.Masked)]),value:se.any,unmask:se.oneOfType([se.bool,se.oneOf(["typed"])]),prepare:se.func,prepareChar:se.func,validate:se.func,commit:se.func,overwrite:se.oneOfType([se.bool,se.oneOf(["shift"])]),eager:se.oneOfType([se.bool,se.oneOf(["append","remove"])]),skipInvalid:se.bool,onAccept:se.func,onComplete:se.func,placeholderChar:se.string,displayChar:se.string,lazy:se.bool,definitions:se.object,blocks:se.object,enum:se.arrayOf(se.string),maxLength:se.number,from:se.number,to:se.number,pattern:se.string,format:se.func,parse:se.func,autofix:se.oneOfType([se.bool,se.oneOf(["pad"])]),radix:se.string,thousandsSeparator:se.string,mapToRadix:se.arrayOf(se.string),scale:se.number,normalizeZeros:se.bool,padFractionalZeros:se.bool,min:se.oneOfType([se.number,se.instanceOf(Date)]),max:se.oneOfType([se.number,se.instanceOf(Date)]),dispatch:se.func,inputRef:se.oneOfType([se.func,se.shape({current:se.object})])},$f=Object.keys(Vf).filter(r=>r!=="value"),$E=["value","unmask","onAccept","onComplete","inputRef"],UE=$f.filter(r=>$E.indexOf(r)<0);function HE(r){var e;const t=(e=class extends ee.Component{constructor(i){super(i),this._inputRef=this._inputRef.bind(this)}componentDidMount(){this.props.mask&&this.initMask()}componentDidUpdate(){const i=this.props,o=this._extractMaskOptionsFromProps(i);if(o.mask)this.maskRef?(this.maskRef.updateOptions(o),"value"in i&&i.value!==void 0&&(this.maskValue=i.value)):this.initMask(o);else if(this.destroyMask(),"value"in i&&i.value!==void 0){var a;(a=this.element)!=null&&a.isContentEditable&&this.element.tagName!=="INPUT"&&this.element.tagName!=="TEXTAREA"?this.element.textContent=i.value:this.element.value=i.value}}componentWillUnmount(){this.destroyMask()}_inputRef(i){this.element=i,this.props.inputRef&&(Object.prototype.hasOwnProperty.call(this.props.inputRef,"current")?this.props.inputRef.current=i:this.props.inputRef(i))}initMask(i){i===void 0&&(i=this._extractMaskOptionsFromProps(this.props)),this.maskRef=ue(this.element,i).on("accept",this._onAccept.bind(this)).on("complete",this._onComplete.bind(this)),"value"in this.props&&this.props.value!==void 0&&(this.maskValue=this.props.value)}destroyMask(){this.maskRef&&(this.maskRef.destroy(),delete this.maskRef)}_extractMaskOptionsFromProps(i){const{...o}=i;return Object.keys(o).filter(a=>UE.indexOf(a)<0).forEach(a=>{delete o[a]}),o}_extractNonMaskProps(i){const{...o}=i;return $f.forEach(a=>{a!=="maxLength"&&delete o[a]}),"defaultValue"in o||(o.defaultValue=i.mask?"":o.value),delete o.value,o}get maskValue(){return this.maskRef?this.props.unmask==="typed"?this.maskRef.typedValue:this.props.unmask?this.maskRef.unmaskedValue:this.maskRef.value:""}set maskValue(i){this.maskRef&&(i=i==null&&this.props.unmask!=="typed"?"":i,this.props.unmask==="typed"?this.maskRef.typedValue=i:this.props.unmask?this.maskRef.unmaskedValue=i:this.maskRef.value=i)}_onAccept(i){this.props.onAccept&&this.maskRef&&this.props.onAccept(this.maskValue,this.maskRef,i)}_onComplete(i){this.props.onComplete&&this.maskRef&&this.props.onComplete(this.maskValue,this.maskRef,i)}render(){return ee.createElement(r,{...this._extractNonMaskProps(this.props),inputRef:this._inputRef})}},e.displayName=void 0,e.propTypes=void 0,e),n=r.displayName||r.name||"Component";return t.displayName="IMask("+n+")",t.propTypes=Vf,ee.forwardRef((s,i)=>ee.createElement(t,{...s,ref:i}))}const zE=HE(r=>{let{inputRef:e,...t}=r;return ee.createElement("input",{...t,ref:e})}),GE=(r,e)=>ee.createElement(zE,{...r,ref:e}),KE=ee.forwardRef(GE),Uf=ee.forwardRef(({className:r,type:e,variant:t,...n},s)=>I.jsxRuntimeExports.jsx(KE,{className:ke.cn(fi({variant:t}),r),ref:s,...n}));Uf.displayName="MaskInput";exports.Checkbox=Tc;exports.FilepondContainer=eh;exports.Form=Nm;exports.FormControl=dh;exports.FormDescription=fh;exports.FormField=Rm;exports.FormItem=ch;exports.FormLabel=hh;exports.FormMessage=ph;exports.HtmlEditor=Of;exports.Input=Nc;exports.Label=Za;exports.MaskInput=Uf;exports.RadioGroup=Sd;exports.RadioGroupItem=_d;exports.Select=xg;exports.SelectContent=el;exports.SelectGroup=Eg;exports.SelectItem=tl;exports.SelectLabel=od;exports.SelectScrollDownButton=Ja;exports.SelectScrollUpButton=Qa;exports.SelectSeparator=ad;exports.SelectTrigger=id;exports.SelectValue=wg;exports.Switch=Eh;exports.Textarea=wh;exports.VirtualizedSelectContent=ld;exports.inputVariants=fi;exports.useFormField=ts;