@emporix/cockpit-component-library 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,49 @@
1
+ (function(z,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],d):(z=typeof globalThis<"u"?globalThis:z||self,d(z.EmporixComponentLibrary={},z.jsxRuntime,z.React,z.ReactDOM))})(this,(function(z,d,k,po){"use strict";var N1=Object.defineProperty;var A1=(z,d,k)=>d in z?N1(z,d,{enumerable:!0,configurable:!0,writable:!0,value:k}):z[d]=k;var D=(z,d,k)=>A1(z,typeof d!="symbol"?d+"":d,k);const yn={primaryButton:"_primaryButton_1fi9p_1",primaryButtonDisabled:"_primaryButtonDisabled_1fi9p_51",spinner:"_spinner_1fi9p_63",iconLeft:"_iconLeft_1fi9p_69",iconRight:"_iconRight_1fi9p_70",iconOnly:"_iconOnly_1fi9p_71"};var go={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},mo=k.createContext&&k.createContext(go),Xl=["attr","size","title"];function Yl(r,t){if(r==null)return{};var e,n,s=Ql(r,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);for(n=0;n<i.length;n++)e=i[n],t.indexOf(e)===-1&&{}.propertyIsEnumerable.call(r,e)&&(s[e]=r[e])}return s}function Ql(r,t){if(r==null)return{};var e={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(t.indexOf(n)!==-1)continue;e[n]=r[n]}return e}function Ir(){return Ir=Object.assign?Object.assign.bind():function(r){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var n in e)({}).hasOwnProperty.call(e,n)&&(r[n]=e[n])}return r},Ir.apply(null,arguments)}function bo(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(r,s).enumerable})),e.push.apply(e,n)}return e}function Br(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?bo(Object(e),!0).forEach(function(n){Jl(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):bo(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}function Jl(r,t,e){return(t=tc(t))in r?Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[t]=e,r}function tc(r){var t=ec(r,"string");return typeof t=="symbol"?t:t+""}function ec(r,t){if(typeof r!="object"||!r)return r;var e=r[Symbol.toPrimitive];if(e!==void 0){var n=e.call(r,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(r)}function yo(r){return r&&r.map((t,e)=>k.createElement(t.tag,Br({key:e},t.attr),yo(t.child)))}function $t(r){return t=>k.createElement(nc,Ir({attr:Br({},r.attr)},t),yo(r.child))}function nc(r){var t=e=>{var{attr:n,size:s,title:i}=r,a=Yl(r,Xl),l=s||e.size||"1em",c;return e.className&&(c=e.className),r.className&&(c=(c?c+" ":"")+r.className),k.createElement("svg",Ir({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},e.attr,n,a,{className:c,style:Br(Br({color:r.color||e.color},e.style),r.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),i&&k.createElement("title",null,i),r.children)};return mo!==void 0?k.createElement(mo.Consumer,null,e=>t(e)):t(go)}function rc(r){return $t({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M512 1024c-69.1 0-136.2-13.5-199.3-40.2C251.7 958 197 921 150 874c-47-47-84-101.7-109.8-162.7C13.5 648.2 0 581.1 0 512c0-19.9 16.1-36 36-36s36 16.1 36 36c0 59.4 11.6 117 34.6 171.3 22.2 52.4 53.9 99.5 94.3 139.9 40.4 40.4 87.5 72.2 139.9 94.3C395 940.4 452.6 952 512 952c59.4 0 117-11.6 171.3-34.6 52.4-22.2 99.5-53.9 139.9-94.3 40.4-40.4 72.2-87.5 94.3-139.9C940.4 629 952 571.4 952 512c0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 0 0-94.3-139.9 437.71 437.71 0 0 0-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.2C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3s-13.5 136.2-40.2 199.3C958 772.3 921 827 874 874c-47 47-101.8 83.9-162.7 109.7-63.1 26.8-130.2 40.3-199.3 40.3z"},child:[]}]})(r)}const vo=({label:r,disabled:t=!1,loading:e=!1,icon:n,iconPos:s="left",onClick:i,className:a="","data-testid":l,...c})=>{const h=[yn.primaryButton,t?yn.primaryButtonDisabled:"",a].filter(Boolean).join(" "),g=!!r;return d.jsxs("button",{type:"button",className:h,disabled:t||e,onClick:i,"data-testid":l,...c,children:[e&&d.jsx(rc,{className:yn.spinner,"aria-hidden":!0}),g?d.jsxs(d.Fragment,{children:[n&&s==="left"&&d.jsx("span",{className:yn.iconLeft,children:n}),r,n&&s==="right"&&d.jsx("span",{className:yn.iconRight,children:n})]}):n&&d.jsx("span",{className:yn.iconOnly,children:n})]})},Vn={secondaryButton:"_secondaryButton_l9k9t_1",iconLeft:"_iconLeft_l9k9t_53",iconRight:"_iconRight_l9k9t_54",iconOnly:"_iconOnly_l9k9t_55",secondaryButtonDisabled:"_secondaryButtonDisabled_l9k9t_61"},As=({label:r,disabled:t=!1,icon:e,iconPos:n="left",onClick:s,className:i="","data-testid":a,...l})=>{const c=[Vn.secondaryButton,t?Vn.secondaryButtonDisabled:"",i].filter(Boolean).join(" "),h=!!r;return d.jsx("button",{type:"button",className:c,disabled:t,onClick:s,"data-testid":a,...l,children:h?d.jsxs(d.Fragment,{children:[e&&n==="left"&&d.jsx("span",{className:Vn.iconLeft,children:e}),r,e&&n==="right"&&d.jsx("span",{className:Vn.iconRight,children:e})]}):e&&d.jsx("span",{className:Vn.iconOnly,children:e})})},Gn={tertiaryButton:"_tertiaryButton_l2p3w_1",iconLeft:"_iconLeft_l2p3w_51",iconRight:"_iconRight_l2p3w_52",iconOnly:"_iconOnly_l2p3w_53",tertiaryButtonDisabled:"_tertiaryButtonDisabled_l2p3w_59"},sc=({label:r,disabled:t=!1,icon:e,iconPos:n="left",className:s="",...i})=>{const a=[Gn.tertiaryButton,t?Gn.tertiaryButtonDisabled:"",s].filter(Boolean).join(" "),l=!!r;return d.jsx("button",{type:"button",className:a,disabled:t,...i,children:l?d.jsxs(d.Fragment,{children:[e&&n==="left"&&d.jsx("span",{className:Gn.iconLeft,children:e}),r,e&&n==="right"&&d.jsx("span",{className:Gn.iconRight,children:e})]}):e&&d.jsx("span",{className:Gn.iconOnly,children:e})})},Zn={contrastButton:"_contrastButton_6r7h8_1",iconLeft:"_iconLeft_6r7h8_53",iconRight:"_iconRight_6r7h8_54",iconOnly:"_iconOnly_6r7h8_55",contrastButtonDisabled:"_contrastButtonDisabled_6r7h8_61"},ic=({label:r,disabled:t=!1,icon:e,iconPos:n="left",className:s="",...i})=>{const a=[Zn.contrastButton,t?Zn.contrastButtonDisabled:"",s].filter(Boolean).join(" "),l=!!r;return d.jsx("button",{type:"button",className:a,disabled:t,...i,children:l?d.jsxs(d.Fragment,{children:[e&&n==="left"&&d.jsx("span",{className:Zn.iconLeft,children:e}),r,e&&n==="right"&&d.jsx("span",{className:Zn.iconRight,children:e})]}):e&&d.jsx("span",{className:Zn.iconOnly,children:e})})},Ne={tabsContainer:"_tabsContainer_xbhwy_1",tabsHeader:"_tabsHeader_xbhwy_7",tabItem:"_tabItem_xbhwy_14",tabContent:"_tabContent_xbhwy_30",tabLabel:"_tabLabel_xbhwy_52",tabLine:"_tabLine_xbhwy_62",active:"_active_xbhwy_69",inactive:"_inactive_xbhwy_77",tabPanels:"_tabPanels_xbhwy_85"},oc=({tabs:r,activeTabId:t,onTabChange:e,className:n="","data-testid":s,...i})=>{var l;const a=[Ne.tabsContainer,n].filter(Boolean).join(" ");return d.jsxs("div",{className:a,"data-testid":s,...i,children:[d.jsx("div",{className:Ne.tabsHeader,children:r.map(c=>{const h=c.id===t,g=[Ne.tabItem,h?Ne.active:Ne.inactive].filter(Boolean).join(" ");return d.jsxs("button",{type:"button",className:g,onClick:()=>e(c.id),"data-testid":`${s}-tab-${c.id}`,children:[d.jsx("div",{className:Ne.tabContent,children:d.jsx("span",{className:Ne.tabLabel,children:c.label})}),d.jsx("div",{className:Ne.tabLine})]},c.id)})}),d.jsx("div",{className:Ne.tabPanels,children:(l=r.find(c=>c.id===t))==null?void 0:l.content})]})},_o={root:"_root_1tlq4_1",editorHost:"_editorHost_1tlq4_27"},ac=[[{font:[]},{size:[]}],["bold","italic","underline"],[{color:[]},{background:[]}],[{list:"ordered"},{list:"bullet"},{indent:"-1"},{indent:"+1"}],["link","clean"]],lc=({value:r,onChange:t,placeholder:e="Type your message...",className:n="",readOnly:s=!1,"data-testid":i})=>{const a=k.useRef(null),l=k.useRef(null),c=k.useRef(r),h=k.useRef(t),g=k.useRef(e),v=k.useRef(null),[f,b]=k.useState(!1);return k.useEffect(()=>{h.current=t,g.current=e},[t,e]),k.useEffect(()=>{if(!a.current)return;let N=!1;return b(!1),v.current=null,(async()=>{try{if(await Promise.resolve().then(()=>cu),N||!a.current)return;const{default:A}=await Promise.resolve().then(()=>_1);if(N||!a.current)return;const E=new A(a.current,{theme:"snow",placeholder:g.current,readOnly:s,modules:{toolbar:s?!1:ac}}),C=c.current;if(C){const U=E.clipboard.convert({html:C});E.setContents(U,"silent"),c.current=C}const q=()=>{const U=E.root.innerHTML;c.current=U,h.current(U)};if(v.current=q,E.on("text-change",q),N){E.off("text-change",q),v.current=null;return}l.current=E,b(!0)}catch(A){console.error("RichTextEditor: failed to load Quill",A)}})(),()=>{N=!0;const A=l.current,E=v.current;l.current=null,v.current=null,A&&E&&A.off("text-change",E),A&&a.current&&(c.current=A.root.innerHTML,a.current.innerHTML="")}},[s]),k.useEffect(()=>{const _=l.current;!_||!f||(_.root.dataset.placeholder=e)},[e,f]),k.useEffect(()=>{const _=l.current;if(!_||!f||r===c.current)return;const N=_.clipboard.convert({html:r});_.setContents(N,"silent"),c.current=r},[r,f]),d.jsx("div",{className:[_o.root,n].filter(Boolean).join(" "),"data-testid":i,children:d.jsx("div",{ref:a,className:_o.editorHost})})},vn={root:"_root_4kkdv_1",circle:"_circle_4kkdv_8",spin:"_spin_4kkdv_1",track:"_track_4kkdv_12",arc:"_arc_4kkdv_16",sm:"_sm_4kkdv_22",md:"_md_4kkdv_27",lg:"_lg_4kkdv_32",label:"_label_4kkdv_37"},cc=({size:r="md",label:t,"aria-label":e,className:n="","data-testid":s})=>{const i=[vn.root,vn[r],n].filter(Boolean).join(" ");return d.jsxs("div",{className:i,role:"status","aria-live":"polite","aria-label":t?void 0:e??"Loading","data-testid":s,children:[d.jsxs("svg",{className:vn.circle,viewBox:"0 0 50 50","aria-hidden":"true",children:[d.jsx("circle",{className:vn.track,cx:"25",cy:"25",r:"20",fill:"none",strokeWidth:"4"}),d.jsx("circle",{className:vn.arc,cx:"25",cy:"25",r:"20",fill:"none",strokeWidth:"4",strokeLinecap:"round"})]}),t&&d.jsx("span",{className:vn.label,children:t})]})};function No(r){return $t({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"18",y1:"6",x2:"6",y2:"18"},child:[]},{tag:"line",attr:{x1:"6",y1:"6",x2:"18",y2:"18"},child:[]}]})(r)}function uc(r){return $t({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"},child:[]},{tag:"polyline",attr:{points:"17 8 12 3 7 8"},child:[]},{tag:"line",attr:{x1:"12",y1:"3",x2:"12",y2:"15"},child:[]}]})(r)}function hc(r){return $t({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"3 6 5 6 21 6"},child:[]},{tag:"path",attr:{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"},child:[]},{tag:"line",attr:{x1:"10",y1:"11",x2:"10",y2:"17"},child:[]},{tag:"line",attr:{x1:"14",y1:"11",x2:"14",y2:"17"},child:[]}]})(r)}function dc(r){return $t({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"11",cy:"11",r:"8"},child:[]},{tag:"line",attr:{x1:"21",y1:"21",x2:"16.65",y2:"16.65"},child:[]}]})(r)}function Ao(r){return $t({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"12",y1:"5",x2:"12",y2:"19"},child:[]},{tag:"line",attr:{x1:"5",y1:"12",x2:"19",y2:"12"},child:[]}]})(r)}function fc(r){return $t({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"12",y1:"2",x2:"12",y2:"6"},child:[]},{tag:"line",attr:{x1:"12",y1:"18",x2:"12",y2:"22"},child:[]},{tag:"line",attr:{x1:"4.93",y1:"4.93",x2:"7.76",y2:"7.76"},child:[]},{tag:"line",attr:{x1:"16.24",y1:"16.24",x2:"19.07",y2:"19.07"},child:[]},{tag:"line",attr:{x1:"2",y1:"12",x2:"6",y2:"12"},child:[]},{tag:"line",attr:{x1:"18",y1:"12",x2:"22",y2:"12"},child:[]},{tag:"line",attr:{x1:"4.93",y1:"19.07",x2:"7.76",y2:"16.24"},child:[]},{tag:"line",attr:{x1:"16.24",y1:"7.76",x2:"19.07",y2:"4.93"},child:[]}]})(r)}function wo(r){return $t({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"},child:[]},{tag:"line",attr:{x1:"12",y1:"16",x2:"12",y2:"12"},child:[]},{tag:"line",attr:{x1:"12",y1:"8",x2:"12.01",y2:"8"},child:[]}]})(r)}function pc(r){return $t({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"9 18 15 12 9 6"},child:[]}]})(r)}function gc(r){return $t({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"15 18 9 12 15 6"},child:[]}]})(r)}function Eo(r){return $t({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"6 9 12 15 18 9"},child:[]}]})(r)}function mc(r){return $t({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"20 6 9 17 4 12"},child:[]}]})(r)}function bc(r){return $t({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"},child:[]},{tag:"polyline",attr:{points:"22 4 12 14.01 9 11.01"},child:[]}]})(r)}function yc(r){return $t({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"},child:[]},{tag:"line",attr:{x1:"12",y1:"9",x2:"12",y2:"13"},child:[]},{tag:"line",attr:{x1:"12",y1:"17",x2:"12.01",y2:"17"},child:[]}]})(r)}function vc(r){return $t({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"},child:[]},{tag:"line",attr:{x1:"12",y1:"8",x2:"12",y2:"12"},child:[]},{tag:"line",attr:{x1:"12",y1:"16",x2:"12.01",y2:"16"},child:[]}]})(r)}const te={root:"_root_1e6ob_1",back:"_back_1e6ob_12",backIcon:"_backIcon_1e6ob_39",backLabel:"_backLabel_1e6ob_45",list:"_list_1e6ob_49",item:"_item_1e6ob_60",separator:"_separator_1e6ob_68",link:"_link_1e6ob_76",linkButton:"_linkButton_1e6ob_93",segmentPlain:"_segmentPlain_1e6ob_117",current:"_current_1e6ob_122"},_c=({item:r,isLast:t,testIdPrefix:e,index:n})=>{const s=e?`${e}-segment-${n}`:void 0;return t?d.jsx("span",{className:te.current,"aria-current":"page","data-testid":s,children:r.label}):r.href!==void 0&&r.href!==""?d.jsx("a",{href:r.href,className:te.link,onClick:r.onClick,"data-testid":s,children:r.label}):r.onClick?d.jsx("button",{type:"button",className:te.linkButton,onClick:r.onClick,"data-testid":s,children:r.label}):d.jsx("span",{className:te.segmentPlain,"data-testid":s,children:r.label})},Nc=({items:r,onBack:t,backLabel:e="Back",className:n="","data-testid":s})=>{const i=[te.root,n].filter(Boolean).join(" ");return r.length===0?d.jsx("nav",{className:i,"aria-label":"Breadcrumb","data-testid":s}):d.jsxs("nav",{className:i,"aria-label":"Breadcrumb","data-testid":s,children:[t&&d.jsxs("button",{type:"button",className:te.back,onClick:t,"data-testid":s?`${s}-back`:void 0,children:[d.jsx(gc,{className:te.backIcon,"aria-hidden":!0}),d.jsx("span",{className:te.backLabel,children:e})]}),d.jsx("ol",{className:te.list,children:r.map((a,l)=>{const c=l===r.length-1;return d.jsxs("li",{className:te.item,children:[l>0&&d.jsx(pc,{className:te.separator,"aria-hidden":!0}),d.jsx(_c,{item:a,isLast:c,testIdPrefix:s,index:l})]},`${a.label}-${l}`)})})]})},vt={dropdown:"_dropdown_175a9_1",label:"_label_175a9_9",required:"_required_175a9_20",trigger:"_trigger_175a9_25",triggerDisabled:"_triggerDisabled_175a9_49",triggerInput:"_triggerInput_175a9_58",value:"_value_175a9_76",placeholder:"_placeholder_175a9_84",chevron:"_chevron_175a9_88",open:"_open_175a9_96",panel:"_panel_175a9_120",panelTop:"_panelTop_175a9_157",panelClosing:"_panelClosing_175a9_163",filterWrapper:"_filterWrapper_175a9_171",filterInput:"_filterInput_175a9_178",filterIcon:"_filterIcon_175a9_197",list:"_list_175a9_208",option:"_option_175a9_217",optionSelected:"_optionSelected_175a9_229",optionHighlighted:"_optionHighlighted_175a9_233",optionDisabled:"_optionDisabled_175a9_237",empty:"_empty_175a9_246",loadingItem:"_loadingItem_175a9_261",spinner:"_spinner_175a9_271",disabled:"_disabled_175a9_278"},Ze=(r,t)=>{const n=r[t];return n!=null?String(n):""},_n=(r,t)=>r[t],ee=(r,t)=>t==null?!1:!!r[t],Ac=({value:r,onChange:t,onEditEnd:e,options:n,optionLabel:s="label",optionValue:i="value",optionDisabled:a,placeholder:l="Select",filter:c=!1,filterPlaceholder:h="Search...",onFilter:g,loading:v=!1,hasMore:f=!1,onLoadMore:b,panelPosition:_="auto",editable:N=!1,disabled:A=!1,required:E=!1,label:C,inputId:q,className:U="",panelClassName:$="",valueTemplate:nt,itemTemplate:ht,"data-testid":st})=>{const tt=n.find(B=>_n(B,i)===r),V=tt?Ze(tt,s):"",[p,w]=k.useState(!1),[y,S]=k.useState(!1),[O,L]=k.useState(""),[I,M]=k.useState(V),[R,j]=k.useState(0),G=k.useRef(null),Z=k.useRef(null),et=k.useRef(null),rt=k.useRef(null),W=k.useRef(null),gt=k.useRef(!1),[yt,X]=k.useState("bottom"),it=!!g,Y=k.useMemo(()=>c&&!N&&!it?n.filter(B=>Ze(B,s).toLowerCase().includes(O.toLowerCase())):n,[c,N,it,n,s,O]),ot=k.useRef(null),ut=k.useCallback(()=>{if(!f||v||!b)return;const B=ot.current;if(!B)return;B.scrollHeight-B.scrollTop-B.clientHeight<60&&b()},[f,v,b]);k.useEffect(()=>{if(!p||_!=="auto"){_==="top"?X("top"):_==="bottom"&&X("bottom");return}const B=G.current;if(!B)return;const Q=B.getBoundingClientRect(),dt=window.innerHeight-Q.bottom;X(dt<280?"top":"bottom")},[p,_]),k.useEffect(()=>{N&&M(V)},[N,r,V]),k.useEffect(()=>{p&&c&&!N&&(L(""),j(0),it&&(g==null||g("")),setTimeout(()=>{var B;return(B=et.current)==null?void 0:B.focus()},0))},[p,c,N,it]),k.useEffect(()=>{if(!p)return;const B=Y.findIndex(mt=>_n(mt,i)===r),Q=Y.findIndex(mt=>!ee(mt,a)),dt=B>=0&&!ee(Y[B],a);j(dt?B:Q>=0?Q:0)},[p,r,Y,i,a]),k.useEffect(()=>{const B=W.current;B!=null&&B.scrollIntoView&&typeof B.scrollIntoView=="function"&&B.scrollIntoView({block:"nearest"})},[R]);const lt=()=>{gt.current=!0,S(!0)},Nt=B=>{var Q;(gt.current||(Q=B.animationName)!=null&&Q.includes("menuOut"))&&(gt.current=!1,w(!1),S(!1),N&&M(V))};k.useEffect(()=>{if(!p&&!y)return;const B=Q=>{G.current&&!G.current.contains(Q.target)&&(N&&M(V),lt())};return document.addEventListener("mousedown",B),()=>document.removeEventListener("mousedown",B)},[p,y,N,V]);const xt=()=>{A||w(B=>!B)},ke=(B,Q)=>{if(ee(B,a))return;const dt=_n(B,i);N&&M(Ze(B,s)),t==null||t({value:dt??null,originalEvent:Q}),lt()},un=B=>{if(!p){if(B.key==="Enter"&&N&&I.trim()){B.preventDefault();const Q=I.trim(),dt=Q.toLowerCase(),mt=n.find(Jt=>{const At=Ze(Jt,s).toLowerCase();return At===dt||At.startsWith(dt)}),Pt=mt&&!ee(mt,a)?_n(mt,i):null;mt&&!ee(mt,a)&&(M(Ze(mt,s)),t==null||t({value:Pt,originalEvent:B})),e==null||e({value:Q,selectedValue:Pt,originalEvent:B});return}(B.key==="Enter"||B.key===" "||B.key==="ArrowDown")&&(B.preventDefault(),w(!0));return}if(B.key==="Escape"){B.preventDefault(),lt();return}if(B.key==="ArrowDown"){B.preventDefault(),j(Q=>{for(let dt=Q+1;dt<Y.length;dt++)if(!ee(Y[dt],a))return dt;return Q});return}if(B.key==="ArrowUp"){B.preventDefault(),j(Q=>{for(let dt=Q-1;dt>=0;dt--)if(!ee(Y[dt],a))return dt;return Q});return}if(B.key==="Enter"){if(B.preventDefault(),N){const Q=I.trim();if(Q){const dt=Q.toLowerCase(),mt=n.find(Jt=>{const At=Ze(Jt,s).toLowerCase();return At===dt||At.startsWith(dt)}),Pt=mt&&!ee(mt,a)?_n(mt,i):null;mt&&!ee(mt,a)&&ke(mt,B),e==null||e({value:Q,selectedValue:Pt,originalEvent:B})}else e==null||e({value:"",selectedValue:null,originalEvent:B})}else if(Y[R]){const Q=Y[R];ee(Q,a)||ke(Q,B)}}},yr=[vt.dropdown,A?vt.disabled:"",p?vt.open:"",U].filter(Boolean).join(" "),vr=[vt.trigger,A?vt.triggerDisabled:""].filter(Boolean).join(" "),ze=[vt.panel,yt==="top"?vt.panelTop:"",y?vt.panelClosing:"",$].filter(Boolean).join(" "),hn=k.useId(),qe=q??`dropdown-${hn.replace(/[^a-zA-Z0-9_-]/g,"")}`,We=`${qe}-panel`;return d.jsxs("div",{className:yr,ref:G,"data-testid":st,children:[C!=null&&d.jsxs("label",{htmlFor:qe,className:vt.label,children:[C,E&&d.jsx("span",{className:vt.required,children:"*"})]}),d.jsxs("div",{id:N?void 0:qe,role:"combobox","aria-expanded":p||y,"aria-haspopup":"listbox","aria-controls":p||y?We:void 0,"aria-disabled":A,"aria-label":typeof C=="string"?C:void 0,tabIndex:N||A?-1:0,className:vr,onClick:N?void 0:xt,onKeyDown:N?void 0:un,"data-testid":st&&!N?`${st}-trigger`:void 0,children:[N?d.jsx("input",{ref:rt,id:qe,type:"text",className:vt.triggerInput,value:I,onChange:B=>{M(B.target.value),!p&&!y&&w(!0),j(0)},onFocus:()=>{!A&&!p&&!y&&w(!0)},onKeyDown:un,placeholder:l,disabled:A,"aria-autocomplete":"list","aria-controls":p||y?We:void 0,"aria-expanded":p||y,"data-testid":st?`${st}-trigger`:void 0}):d.jsx("span",{className:vt.value,children:nt?nt(tt??null):V||d.jsx("span",{className:vt.placeholder,children:l})}),d.jsx(Eo,{className:vt.chevron,"aria-hidden":!0,onClick:N?xt:void 0})]}),(p||y)&&d.jsxs("div",{ref:Z,id:We,className:ze,role:"presentation",onAnimationEnd:Nt,"data-testid":st?`${st}-panel`:void 0,children:[c&&!N&&d.jsxs("div",{className:vt.filterWrapper,children:[d.jsx("input",{ref:et,type:"text",className:vt.filterInput,value:O,onChange:B=>{const Q=B.target.value;L(Q),j(0),it&&(g==null||g(Q))},onKeyDown:B=>{B.key==="Escape"&&w(!1),B.stopPropagation()},placeholder:h,"aria-label":"Filter options",title:"Filter options","data-testid":st?`${st}-filter`:void 0}),d.jsx(dc,{className:vt.filterIcon,"aria-hidden":!0})]}),d.jsxs("ul",{ref:ot,className:vt.list,role:"listbox","aria-label":"Options",onScroll:ut,children:[Y.length===0?d.jsx("li",{className:vt.empty,children:"No results"}):Y.map((B,Q)=>{const dt=_n(B,i),mt=Ze(B,s),Pt=ee(B,a),Jt=r===dt,At=Q===R,Dn=dt!=null?String(dt):`option-${Q}`;return d.jsx("li",{ref:At?W:void 0,role:"option","aria-selected":Jt,"aria-disabled":Pt,className:[vt.option,Jt?vt.optionSelected:"",At?vt.optionHighlighted:"",Pt?vt.optionDisabled:""].filter(Boolean).join(" "),onMouseEnter:()=>!Pt&&j(Q),onClick:$n=>ke(B,$n),"data-testid":st?`${st}-option-${Q}`:void 0,children:ht?ht(B):mt},Dn)}),v&&d.jsxs("li",{className:vt.loadingItem,"aria-live":"polite",children:[d.jsx(fc,{className:vt.spinner,"aria-hidden":!0})," Loading…"]})]})]})]})},Xn={chip:"_chip_qgxbp_1",chipSuccess:"_chipSuccess_qgxbp_19",chipWarning:"_chipWarning_qgxbp_25",chipInfo:"_chipInfo_qgxbp_31",chipError:"_chipError_qgxbp_37"},wc={success:Xn.chipSuccess,warning:Xn.chipWarning,info:Xn.chipInfo,error:Xn.chipError},To=({variant:r="info",children:t,className:e="","data-testid":n,...s})=>{const i=[Xn.chip,wc[r],e].filter(Boolean).join(" ");return d.jsx("span",{className:i,"data-testid":n,...s,children:t})},Tt={root:"_root_1dryk_1",label:"_label_1dryk_9",trigger:"_trigger_1dryk_20",triggerDisabled:"_triggerDisabled_1dryk_44",chips:"_chips_1dryk_50",chip:"_chip_1dryk_50",chipLabel:"_chipLabel_1dryk_64",chipRemove:"_chipRemove_1dryk_70",placeholder:"_placeholder_1dryk_86",chevron:"_chevron_1dryk_90",open:"_open_1dryk_98",panel:"_panel_1dryk_102",list:"_list_1dryk_112",option:"_option_1dryk_120",optionSelected:"_optionSelected_1dryk_134",optionFocused:"_optionFocused_1dryk_138",optionCheckbox:"_optionCheckbox_1dryk_143",empty:"_empty_1dryk_148",disabled:"_disabled_1dryk_155"},xo=(r,t)=>{const e=r[t];return e!=null?String(e):""},ws=(r,t)=>{const e=r[t];return e!=null?String(e):""},Ec=({value:r,onChange:t,options:e,optionLabel:n="label",optionValue:s="value",placeholder:i="Select…",disabled:a=!1,label:l,className:c="","data-testid":h})=>{const[g,v]=k.useState(!1),[f,b]=k.useState(-1),_=k.useRef(null),N=k.useRef(null),A=k.useRef(null),C=`multiselect-${k.useId().replace(/[^a-zA-Z0-9_-]/g,"")}`,[q,U]=k.useState({}),$=k.useCallback(()=>{if(!N.current)return;const w=N.current.getBoundingClientRect();U({position:"fixed",top:w.bottom+4,left:w.left,width:w.width})},[]);k.useEffect(()=>{if(!g)return;$();const w=()=>$();return window.addEventListener("scroll",w,!0),window.addEventListener("resize",w),()=>{window.removeEventListener("scroll",w,!0),window.removeEventListener("resize",w)}},[g,$]),k.useEffect(()=>{if(!g)return;const w=y=>{const S=y.target;_.current&&!_.current.contains(S)&&A.current&&!A.current.contains(S)&&v(!1)};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[g]),k.useEffect(()=>{g&&b(-1)},[g]);const nt=w=>{r.includes(w)?t(r.filter(y=>y!==w)):t([...r,w])},ht=w=>{t(r.filter(y=>y!==w))},st=k.useMemo(()=>{const w={};return e.forEach(y=>{w[ws(y,s)]=xo(y,n)}),w},[e,n,s]),tt=w=>{if((w.key==="Enter"||w.key===" "||w.key==="ArrowDown")&&(w.preventDefault(),!a&&!g)){v(!0);return}if(w.key==="Escape"){v(!1);return}if(!(!g||e.length===0)){if(w.key==="ArrowDown")w.preventDefault(),b(y=>y<e.length-1?y+1:0);else if(w.key==="ArrowUp")w.preventDefault(),b(y=>y>0?y-1:e.length-1);else if((w.key==="Enter"||w.key===" ")&&f>=0){w.preventDefault();const y=e[f];y&&nt(ws(y,s))}}};k.useEffect(()=>{var O;if(!g||f<0)return;const w=A.current;if(!w)return;const S=w.querySelectorAll('[role="option"]')[f];(O=S==null?void 0:S.scrollIntoView)==null||O.call(S,{block:"nearest"})},[f,g]);const V=[Tt.root,a?Tt.disabled:"",g?Tt.open:"",c].filter(Boolean).join(" "),p=g?po.createPortal(d.jsx("div",{className:Tt.panel,style:q,ref:A,role:"presentation",children:d.jsxs("ul",{className:Tt.list,role:"listbox","aria-multiselectable":"true",children:[e.map((w,y)=>{const S=ws(w,s),O=xo(w,n),L=r.includes(S),I=y===f;return d.jsxs("li",{role:"option","aria-selected":L,className:[Tt.option,L?Tt.optionSelected:"",I?Tt.optionFocused:""].filter(Boolean).join(" "),onClick:()=>nt(S),children:[d.jsx("input",{type:"checkbox",checked:L,readOnly:!0,tabIndex:-1,className:Tt.optionCheckbox}),d.jsx("span",{children:O})]},S)}),e.length===0&&d.jsx("li",{className:Tt.empty,children:"No options"})]})}),document.body):null;return d.jsxs("div",{className:V,ref:_,"data-testid":h,children:[l!=null&&d.jsx("label",{htmlFor:C,className:Tt.label,children:l}),d.jsxs("div",{id:C,ref:N,role:"combobox","aria-expanded":g,"aria-haspopup":"listbox","aria-activedescendant":g&&f>=0?`${C}-option-${f}`:void 0,tabIndex:a?-1:0,className:[Tt.trigger,a?Tt.triggerDisabled:""].filter(Boolean).join(" "),onClick:()=>!a&&v(w=>!w),onKeyDown:tt,children:[d.jsxs("div",{className:Tt.chips,children:[r.length===0&&d.jsx("span",{className:Tt.placeholder,children:i}),r.map(w=>d.jsxs(To,{variant:"info",className:Tt.chip,children:[d.jsx("span",{className:Tt.chipLabel,children:st[w]??w}),d.jsx("button",{type:"button",className:Tt.chipRemove,"aria-label":`Remove ${st[w]??w}`,onClick:y=>{y.stopPropagation(),ht(w)},children:d.jsx(No,{size:10})})]},w))]}),d.jsx(Eo,{className:Tt.chevron,"aria-hidden":!0})]}),p]})},Xe={inputText:"_inputText_aq6o5_1",label:"_label_aq6o5_9",required:"_required_aq6o5_20",tooltipIcon:"_tooltipIcon_aq6o5_25",input:"_input_aq6o5_1",inputTextarea:"_inputTextarea_aq6o5_71",inputTextDisabled:"_inputTextDisabled_aq6o5_78"},Tc=({label:r,tooltip:t,required:e=!1,inputId:n,textarea:s=!1,rows:i,className:a="","data-testid":l,disabled:c=!1,...h})=>{const{type:g="text",...v}=h,f=k.useId(),b=n||`input-text-${f.replace(/[^a-zA-Z0-9_-]/g,"")}`,_=[Xe.inputText,c?Xe.inputTextDisabled:"",a].filter(Boolean).join(" "),N=v["aria-invalid"];let A;N===void 0?A=void 0:N===!0?A="true":N===!1?A="false":A=N;const E=e?{"aria-required":"true"}:{"aria-required":"false"},C=A===void 0?{}:{"aria-invalid":A},q=[Xe.input,s?Xe.inputTextarea:""].filter(Boolean).join(" "),U={id:b,className:q,disabled:c,...E,...C,"data-testid":l?`${l}-input`:void 0};return d.jsxs("div",{className:_,"data-testid":l,children:[r!=null&&d.jsxs("label",{htmlFor:b,className:Xe.label,children:[r,e&&d.jsx("span",{className:Xe.required,children:"*"}),t!=null&&d.jsx("span",{className:Xe.tooltipIcon,title:t,"aria-label":t,children:d.jsx(wo,{"aria-hidden":!0})})]}),s?d.jsx("textarea",{...v,...U,rows:i??3}):d.jsx("input",{...v,...U,type:g})]})},Ye={selectButton:"_selectButton_1xelm_1",selectButtonDisabled:"_selectButtonDisabled_1xelm_9",selectButtonInvalid:"_selectButtonInvalid_1xelm_14",button:"_button_1xelm_14",buttonFirst:"_buttonFirst_1xelm_47",buttonLast:"_buttonLast_1xelm_51",buttonSelected:"_buttonSelected_1xelm_59"},Lo=(r,t)=>{const n=r[t];return n!=null?String(n):""},Es=(r,t)=>r[t],Co=(r,t)=>t==null?!1:!!r[t],xc=({value:r,onChange:t,options:e,optionLabel:n="label",optionValue:s="value",optionDisabled:i,multiple:a=!1,itemTemplate:l,disabled:c=!1,invalid:h=!1,className:g="","data-testid":v})=>{const f=N=>{const A=Es(N,s);return a&&Array.isArray(r)?r.includes(A):r===A},b=(N,A)=>{if(c||Co(N,i))return;const E=Es(N,s);if(E===void 0)return;let C;if(a){const q=Array.isArray(r)?r:[];C=q.includes(E)?q.filter($=>$!==E):[...q,E]}else C=r===E?null:E;t==null||t({value:C,originalEvent:A})},_=[Ye.selectButton,c?Ye.selectButtonDisabled:"",h?Ye.selectButtonInvalid:"",g].filter(Boolean).join(" ");return d.jsx("div",{className:_,role:"group","aria-disabled":c,"data-testid":v,children:e.map((N,A)=>{const E=Es(N,s),C=E!=null?String(E):`option-${A}`,q=Co(N,i),U=f(N);return d.jsx("button",{type:"button","aria-pressed":U,"aria-disabled":q||c,"aria-label":Lo(N,n),disabled:c||q,className:[Ye.button,U?Ye.buttonSelected:"",A===0?Ye.buttonFirst:"",A===e.length-1?Ye.buttonLast:""].filter(Boolean).join(" "),onClick:$=>b(N,$),onKeyDown:$=>{($.key===" "||$.key==="Enter")&&($.preventDefault(),b(N,$))},"data-testid":v?`${v}-option-${A}`:void 0,children:l?l(N):Lo(N,n)},C)})})},Ht={card:"_card_13psy_1",body:"_body_13psy_13",header:"_header_13psy_20",headerLeading:"_headerLeading_13psy_29",headerActions:"_headerActions_13psy_36",title:"_title_13psy_44",meta:"_meta_13psy_53",metaRow:"_metaRow_13psy_59",metaIcon:"_metaIcon_13psy_71",metaContent:"_metaContent_13psy_86",footer:"_footer_13psy_91",iconButton:"_iconButton_13psy_99",iconButtonDanger:"_iconButtonDanger_13psy_126"},Lc=({children:r,className:t="",...e})=>d.jsx("div",{className:[Ht.body,t].filter(Boolean).join(" "),...e,children:r}),Cc=({tag:r,actions:t,children:e,className:n="",...s})=>!(r!=null||t!=null)&&e!=null?d.jsx("div",{className:[Ht.header,n].filter(Boolean).join(" "),...s,children:e}):d.jsxs("div",{className:[Ht.header,n].filter(Boolean).join(" "),...s,children:[d.jsxs("div",{className:Ht.headerLeading,children:[r,e]}),t?d.jsx("div",{className:Ht.headerActions,children:t}):null]}),Sc=({children:r,className:t="",...e})=>d.jsx("h2",{className:[Ht.title,t].filter(Boolean).join(" "),...e,children:r}),kc=({children:r,className:t="",...e})=>d.jsx("div",{className:[Ht.meta,t].filter(Boolean).join(" "),...e,children:r}),qc=({icon:r,children:t,className:e="",...n})=>d.jsxs("div",{className:[Ht.metaRow,e].filter(Boolean).join(" "),...n,children:[d.jsx("span",{className:Ht.metaIcon,"aria-hidden":!0,children:r}),d.jsx("div",{className:Ht.metaContent,children:t})]}),Oc=({children:r,className:t="",...e})=>d.jsx("div",{className:[Ht.footer,t].filter(Boolean).join(" "),...e,children:r}),So=k.forwardRef(({className:r="",type:t="button",variant:e="default",children:n,...s},i)=>d.jsx("button",{ref:i,type:t,className:[Ht.iconButton,e==="danger"?Ht.iconButtonDanger:"",r].filter(Boolean).join(" "),...s,children:n}));So.displayName="Card.IconButton";const jr=Object.assign(({children:r,className:t="","data-testid":e,...n})=>{const s=[Ht.card,t].filter(Boolean).join(" ");return d.jsx("div",{className:s,"data-testid":e,...n,children:r})},{Body:Lc,Header:Cc,Title:Sc,Meta:kc,MetaRow:qc,Footer:Oc,IconButton:So}),Ts={iconCard:"_iconCard_e9t2h_1",iconSection:"_iconSection_e9t2h_12",content:"_content_e9t2h_22"},Ic=Object.assign(({children:r,className:t="","data-testid":e,...n})=>{const s=[Ts.iconCard,t].filter(Boolean).join(" ");return d.jsx("div",{className:s,"data-testid":e,...n,children:r})},{Icon:({children:r,className:t="",...e})=>d.jsx("div",{className:[Ts.iconSection,t].filter(Boolean).join(" "),...e,children:r}),Content:({children:r,className:t="",...e})=>d.jsx("div",{className:[Ts.content,t].filter(Boolean).join(" "),...e,children:r})}),ko={pdf:{extensions:[".pdf"],mimeTypes:["application/pdf"]},doc:{extensions:[".doc"],mimeTypes:["application/msword"]},docx:{extensions:[".docx"],mimeTypes:["application/vnd.openxmlformats-officedocument.wordprocessingml.document"]},xls:{extensions:[".xls"],mimeTypes:["application/vnd.ms-excel"]},xlsx:{extensions:[".xlsx"],mimeTypes:["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"]},png:{extensions:[".png"],mimeTypes:["image/png"]},jpeg:{extensions:[".jpg",".jpeg"],mimeTypes:["image/jpeg"]}},Bc=["pdf"];function jc(r){return r.length===0?Bc:r}function Dc(r){const t=new Set;for(const e of r){const n=ko[e];for(const s of n.extensions)t.add(s);for(const s of n.mimeTypes)t.add(s)}return[...t].join(",")}function $c(r,t){const e=new Set,n=[];for(const a of t){const l=ko[a];for(const c of l.mimeTypes)e.add(c);for(const c of l.extensions)n.push(c.slice(1))}const s=n.map(a=>a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),i=new RegExp(`\\.(${s.join("|")})$`,"i");return!!(r.type&&e.has(r.type)||!r.type&&i.test(r.name)||r.type&&i.test(r.name))}const Ae={root:"_root_1mmsz_1",dropZone:"_dropZone_1mmsz_6",dropZoneDisabled:"_dropZoneDisabled_1mmsz_18",dropZoneActive:"_dropZoneActive_1mmsz_26",iconWrap:"_iconWrap_1mmsz_37",dropTitle:"_dropTitle_1mmsz_49",formats:"_formats_1mmsz_57",browseWrap:"_browseWrap_1mmsz_65",hiddenInput:"_hiddenInput_1mmsz_70"},Mc=({supportedTypes:r,onFileSelect:t,onRejectFile:e,maxSizeBytes:n,uploading:s=!1,dropHint:i,formatsHint:a,browseLabel:l,uploadingLabel:c,className:h="","data-testid":g})=>{const v=k.useRef(null),f=k.useId(),[b,_]=k.useState(!1),N=k.useMemo(()=>jc(r),[r]),A=k.useMemo(()=>Dc(N),[N]),E=k.useCallback(V=>{if(n!=null&&V.size>n){e==null||e(V,"size");return}if(!$c(V,N)){e==null||e(V,"type");return}t(V)},[n,t,e,N]),C=k.useCallback(()=>{var V;s||(V=v.current)==null||V.click()},[s]),q=V=>{var w;const p=(w=V.target.files)==null?void 0:w[0];p&&E(p),V.target.value=""},U=V=>{V.preventDefault(),V.stopPropagation(),s||_(!0)},$=V=>{V.preventDefault(),V.stopPropagation(),_(!1)},nt=V=>{var w;if(V.preventDefault(),V.stopPropagation(),_(!1),s)return;const p=(w=V.dataTransfer.files)==null?void 0:w[0];p&&E(p)},ht=V=>{s||V.target.closest("button")||C()},st=V=>{s||V.key!=="Enter"&&V.key!==" "||(V.preventDefault(),C())},tt=[Ae.dropZone,b?Ae.dropZoneActive:"",s?Ae.dropZoneDisabled:""].filter(Boolean).join(" ");return d.jsx(jr,{className:[Ae.root,h].filter(Boolean).join(" "),"data-testid":g,children:d.jsx(jr.Body,{children:d.jsxs("div",{className:tt,onDragOver:U,onDragLeave:$,onDrop:nt,onClick:ht,onKeyDown:st,role:"button",tabIndex:s?-1:0,"aria-disabled":s||void 0,"aria-labelledby":f,children:[d.jsx("div",{className:Ae.iconWrap,"aria-hidden":!0,children:d.jsx(uc,{size:22})}),d.jsx("p",{id:f,className:Ae.dropTitle,children:i}),d.jsx("p",{className:Ae.formats,children:a}),d.jsxs("div",{className:Ae.browseWrap,children:[d.jsx("input",{ref:v,type:"file",className:Ae.hiddenInput,accept:A,onChange:q,disabled:s,"aria-hidden":!0}),d.jsx(As,{label:s?c:l,onClick:C,disabled:s})]})]})})})},Qe={alert:"_alert_90rze_1",alertTitle:"_alertTitle_90rze_7",alertBody:"_alertBody_90rze_16",alertError:"_alertError_90rze_22",alertWarning:"_alertWarning_90rze_28",alertInfo:"_alertInfo_90rze_34",alertSuccess:"_alertSuccess_90rze_40"},Pc={error:Qe.alertError,warning:Qe.alertWarning,info:Qe.alertInfo,success:Qe.alertSuccess},Uc={error:d.jsx(vc,{size:16,"aria-hidden":!0}),warning:d.jsx(yc,{size:16,"aria-hidden":!0}),info:d.jsx(wo,{size:16,"aria-hidden":!0}),success:d.jsx(bc,{size:16,"aria-hidden":!0})},Hc=({variant:r="info",title:t,children:e,className:n,"data-testid":s,...i})=>{const a=[Qe.alert,Pc[r],n].filter(Boolean).join(" ");return d.jsxs("div",{className:a,role:"alert","data-testid":s,...i,children:[t&&d.jsxs("div",{className:Qe.alertTitle,children:[Uc[r],d.jsx("span",{children:t})]}),e&&d.jsx("div",{className:Qe.alertBody,children:e})]})},Rt={sideMenu:"_sideMenu_9at6r_1",brand:"_brand_9at6r_11",logoMark:"_logoMark_9at6r_19",brandText:"_brandText_9at6r_33",brandTitle:"_brandTitle_9at6r_40",brandSubtitle:"_brandSubtitle_9at6r_47",sectionLabel:"_sectionLabel_9at6r_52",nav:"_nav_9at6r_61",navItem:"_navItem_9at6r_68",navItemActive:"_navItemActive_9at6r_102",navIcon:"_navIcon_9at6r_109",navLabel:"_navLabel_9at6r_123",navBadge:"_navBadge_9at6r_130",footer:"_footer_9at6r_145"},Rc=Object.assign(({children:r,className:t="","data-testid":e,...n})=>d.jsx("nav",{className:[Rt.sideMenu,t].filter(Boolean).join(" "),"data-testid":e,"aria-label":"Side navigation",...n,children:r}),{Brand:({title:r="EMPORIX",subtitle:t,logo:e,className:n="",...s})=>d.jsxs("div",{className:[Rt.brand,n].filter(Boolean).join(" "),...s,children:[d.jsx("div",{className:Rt.logoMark,"aria-hidden":"true",children:e??"E"}),d.jsxs("div",{className:Rt.brandText,children:[d.jsx("div",{className:Rt.brandTitle,children:r}),t&&d.jsx("div",{className:Rt.brandSubtitle,children:t})]})]}),Nav:({label:r,children:t,className:e="",...n})=>d.jsxs(d.Fragment,{children:[r&&d.jsx("div",{className:Rt.sectionLabel,children:r}),d.jsx("nav",{className:[Rt.nav,e].filter(Boolean).join(" "),"aria-label":r??"Navigation",...n,children:t})]}),NavItem:({icon:r,active:t=!1,badge:e,children:n,className:s="",as:i="div",type:a="button",...l})=>{const c=[Rt.navItem,t?Rt.navItemActive:"",s].filter(Boolean).join(" "),h=d.jsxs(d.Fragment,{children:[r&&d.jsx("span",{className:Rt.navIcon,"aria-hidden":"true",children:r}),d.jsx("span",{className:Rt.navLabel,children:n}),e!=null&&d.jsx("span",{className:Rt.navBadge,children:e})]});return i==="button"?d.jsx("button",{type:a,className:c,...l,children:h}):d.jsx("div",{className:c,...l,children:h})},Footer:({children:r,className:t="",...e})=>d.jsx("div",{className:[Rt.footer,t].filter(Boolean).join(" "),...e,children:r})}),Fc="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKMAAAAYCAYAAACWYU02AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAo6ADAAQAAAABAAAAGAAAAADUwQHYAAAKfklEQVRoBcWbfdBVVRXGeUEzwsEvSEpSbHQiMCvUIj+m14xRMw2pmWw0xkwtyxqwD61IPqTQcJSSYNJyypBRahCcKfnDQFRmypKyFKQMEtGkVFBQUFH6PS9n39Zdd+1zzr28DmvmYa+PZ629z3nXPfecfS5dfUpk586d+xA+BhwOhoIdYF2Bx7q6uragVwp1hkESrPyT/Cesox2dmifC38vlrKDmq8kHZxD6UcnOjJvwr617LJkafZhrX2IfB93gvWAYOBhsAxvAGrAALGKurYy1hLonQeyXIe/EvxGso+bLGU7opu6xBLRmKzoP661DOtwzGSaDkWA1uA7ePMaOhHrnkXgZeDd4BEyj3p2MrQL5ZLAUvALKRJzu1grNHjhTgiIv4XtnM7OeRd71QT251HwNwR6b4UXuv+OcDUY0CtRQ4A8E14IXQB3ZDOlLoKtGeTXCi3WKwnkKLAeXg4OqasP5G/DyHZ8HYYInFfZMz61jkzszU29SUz6kfcDtGXKZu+UgbGESp2WS51teHZ06Q8GOTL232hpw2mlGW3I+xjtsrUiHcxBYaRPb0NU4dZqmbjPaqZ/EOD5ac/IR391m1HxtNaT4SsrItLQ2fQLfDJZliHXcX28UcwrJuWZ8jdhwRy814f+iZDG+Gc8u4VaFtkDQLUooxAaDNVVFKuJPEH9XOEHhJN5JM2pa5emrOBRitZpRyXBzV0dC9RpSPJEzcn3TIiHNzRD/hH886C7wBUadRC+v4/hgU9HCwJ9rRtXQfVQtgTscqIFz4psxujIq/x6D+9FztyOPE3uTXxy+AeBBUCbPENTVLzpXNm89RvYKSSxqxtX40zGsQ8/JSr/2ZJNQuxmVA//K3CT4S6+QipfktjTiGRmyGrTl3gafrqJ3Bjl3p4O1I7yyZlSZWldHeL8SuUTqNONWuzbp1NsPzMvUPTfg35Lhyv1rcDpoPHSgq/5Z4M8gkqV+jmRD1r21Fz0ANITgIeBGTyrsExpEoxBrqxmVSs6MzBxyhw0pf0nOHLOkngn6Ql4VJCzC19KIKZlYf/BYkDcycdIIp6oZFyZubqTG0cFc3tVRM2pOCvUDf/EFsW+xa8IeHXDkeh6cbbleJ94FpoNI9MTaIhCjK2NTMyoJnmrrIczLt1qK7uK33YzFPLmHR83b1JCy/WKM3dyIRfEzDcGqh0cHYX2Qz7cJhf5NyynmqGpGpWo7JCvEf1PULxs6bkZNTOFonSvsouAsCRagW5TwCmRzkw53QVDjwRS3I7zKK2Piw50T1L0hxe0Ir6NmVA1ytXuQk9MKzvdzBPw/tmtJel8U7Y15uZ99H+0nVsl9AWF04Itc/uvyqogkH4tXzY+5+BZn94b5YlCkf/Kxjv3RT0m2GWdwvpqa1sQi9WKcL7nAKOof5nwytZdYV6K9xs11k+vyOFY9rM4N+LOI6cN6JbHwioz/ZnBpkNuzaXxiEBhAwSmB37u0Ke5liHdk7J/g/5qJ6Qo9ioOJbrqvNjypz4E7wOdl9KIcGdR62vjGoPuN9tfwzTKcSpVj3Myx/gziVxxZH7joj+xorSb19KA1tjXS5+HAt9sujkF7papzSVFMjTgR3wTsqYXPD7fiuBBe+AHTiW36aiuy388odCKDaibdBG8csLcD07GbroAcnK5EHwZW1JyHWkdGj+55I5+uvoOp8Zmgzu+Nb5jRk7qUk/vfZLQx6o2Db0a9kehUppA4zCXr6rvE+XrNLBpyBwV3oF/GOVRjNj8d/382NeL4XCOKpmY8UEovyvagVvRJ0EFMBvYBQU+hH2DBD5gaM4wudSPQfdAPZFRING+Tj/n2psYZQLcJbwnq3W58bzN6Uju98jyaCpjxEKOXqeNY9xEFoT+j1j8ySJjIuXw+8Peai/pfVTHWcwHDnEzh2/B/tqwRladm3AYGyDCyDn29sdtRdcXzEl2N5NOn5dtguEn4HvoY2RzgWQzHSTei95jbiRlXW6puQeomz2auNab660ZPqs5hJ6Lz3qnoqV0ok6tY+41lhN6KcTrPpdZPM/V0sTm/qhGVqxP5DPDNuJjkiSL0kkR/xD7MoafQK5hjkZnno/g+gr0MXGP8UvUhSc0e1Yx8rkRtU1/PulG38rQ1Cn1Y4KvjOjQgPRn4og9yQGu49FQ+iXP7hn09N2ZC4W/1KQY1XLTOnkYkdh28h1mT7pOz0pfIhiBa+ooq4Fe5ooX25LDAxSh/dAVmYp8M7BVTlMnwX5WCRDUj3y52/X9fhjobdDOXdCv6MHgZw4ne3ztr2NEuxqogr+5VPKU+i7I8GW/kyHGfQ/3bgPrIS6MRCeih5ib44z2pyYZwNfCyBUc0QVNuXYNaU/0E2EekfPRTgvgDzvcIdmNN6D90cZl6CGkIdvQ60KdtwqFXnnrbpHfZ/lvC1htIPPqRRltfh5oDPAu8tNyTQtjqSdhjtSjG9wH9rbxU/gCFhI73GYu5z6GGvtki0dsgbcL7DXLxL2qcUK8Q1Cc7kvM8t1Ob4tFmcqMZVRfOvdEijE9P3g3B/yMTS2rTzgBONZeXaC+xUbdKoVi06a05mnYByurAjX4ZZR/aGulwo03vxv0i8StAJD0N2yjkFBI6bkZySxtRU8E5NVpU4bvELWeXSXAv8K8gcSO+g8Mk54R3FBjl3A2TWJ1mPA5eTh5qFCsUiHuqGUdnFqkfW3zCr9PaxPuCn2fyT7fcpMOtasa94Twe1Pw3vn1THT8S66gZybsgmCu5mp6mcZa9qfmyX1OPTdKFqZob9euQI8MknMQOA78DST4ZcQlWNqPy4C1Ohdx4qq9LfI80Y7HOX7r1WVPn49NgYFoz+hBwOVgLIrkrcf0IubQZi/Xkbkdm+XrJpm7bzUjOeJD9ak617Qi/7P1065sYEvSJvRtEosnvApPAaeBicDO4B2wHVmSfYBcjHV/dZtRPxLzc6+sVNfdkM+qer+onZDqOlSD6MYliSdaiHBAdY3Gclc1Y8JangmbU3+6YqDb+tpoR/kVA9SIpvWcmoe2GPJAknZjdkS0kj/YHj69WMxYn1V7at5F7tK9X8PZYMxbzD2ZtfwW7I/qto98xaDpc4nWbcQTc6OFKTdevqSgGvtrNCFeNmBO9gKgUkssa0m+h9SxwP5J+m5u1wv8f4sdGq8Jf+jRtc+DqKexDoBscZmNWJ1bnabrXH2DcGnSFzN1aECoVfbMMsvUiHU6tZlQu3BsyM2prpUngPRRwv9hEwoBzacBLrlqNmGqS1F5DKpGkcWBVmrFifIH4AvD2NKkfidW+MvrcnE3NPXpltOtiLbp9WQrqiJqw5w2TrZHT4UbNGD4pwz0A6MHTi75hhto5sH0z6j90tdwu4JsAImmrEdPcFMo15GS9gWkRNnsX4lxI4nsYTwLaBNcbg7RY/VJlEVgC9x+MVbIMgn878lxVUkVcN/2+ht+2WQ1nqqvzirN32+Qc6G3HEs7XEMZucDzQvbN+o6k3XH8A94H5cJ9ibEemQ9Yvcqw8ao2kU1t7ptrV+Bzwf1vdDmxIXMa5QOuVbALzlN9jmX/wzaKm/sZTgPpB5/Ra/Lcyti3kfYN6K0j8LhgBtNE/Hf8d/wPfUXoPHjYzNwAAAABJRU5ErkJggg==",Nn={topNav:"_topNav_5wym0_1",left:"_left_5wym0_14",logoArea:"_logoArea_5wym0_20",logoImage:"_logoImage_5wym0_25",start:"_start_5wym0_31",actions:"_actions_5wym0_36"},qo=()=>d.jsx("img",{src:Fc,alt:"Emporix",className:Nn.logoImage}),zc=Object.assign(({logo:r,start:t,children:e,className:n="","data-testid":s,...i})=>d.jsxs("header",{className:[Nn.topNav,n].filter(Boolean).join(" "),"data-testid":s,"aria-label":"Top navigation",...i,children:[d.jsxs("div",{className:Nn.left,children:[t&&d.jsx("div",{className:Nn.start,children:t}),d.jsx("div",{className:Nn.logoArea,children:r??d.jsx(qo,{})})]}),e&&d.jsx("div",{className:Nn.actions,children:e})]}),{Logo:qo}),Ft={overlay:"_overlay_1cjjq_1",toast:"_toast_1cjjq_15",toastExiting:"_toastExiting_1cjjq_35",toastSuccess:"_toastSuccess_1cjjq_59",toastError:"_toastError_1cjjq_63",toastWarning:"_toastWarning_1cjjq_67",toastInfo:"_toastInfo_1cjjq_71",icon:"_icon_1cjjq_75",iconSuccess:"_iconSuccess_1cjjq_89",iconError:"_iconError_1cjjq_94",iconWarning:"_iconWarning_1cjjq_99",iconInfo:"_iconInfo_1cjjq_104",message:"_message_1cjjq_109",closeButton:"_closeButton_1cjjq_114"},Wc={success:Ft.toastSuccess,error:Ft.toastError,warning:Ft.toastWarning,info:Ft.toastInfo},Kc={success:Ft.iconSuccess,error:Ft.iconError,warning:Ft.iconWarning,info:Ft.iconInfo},Vc={success:()=>d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:d.jsx("path",{d:"M3.5 8.5L6.5 11.5L12.5 4.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),error:()=>d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:d.jsx("path",{d:"M4 4L12 12M12 4L4 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),warning:()=>d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:d.jsx("path",{d:"M8 4V9M8 11.5V12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})}),info:()=>d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:d.jsx("path",{d:"M8 4.5V4M8 7V12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})},Gc=()=>d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M3 3L11 11M11 3L3 11",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});let Zc=0;const Xc=4e3,Oo=({entry:r,onClose:t})=>{const[e,n]=k.useState(!1),s=k.useRef(null),i=k.useRef(null),a=k.useRef(t),l=k.useRef(r.id);k.useEffect(()=>{a.current=t,l.current=r.id},[t,r.id]);const c=k.useCallback(()=>{n(!0),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{i.current=null,a.current(l.current)},200)},[]);k.useEffect(()=>{const f=r.duration??Xc;return f>0&&(s.current=setTimeout(c,f)),()=>{s.current&&clearTimeout(s.current)}},[r.duration,c]),k.useEffect(()=>()=>{i.current&&(clearTimeout(i.current),i.current=null,a.current(l.current))},[]);const h=Vc[r.variant],g=[Ft.toast,Wc[r.variant],e?Ft.toastExiting:""].filter(Boolean).join(" "),v=[Ft.icon,Kc[r.variant]].filter(Boolean).join(" ");return d.jsxs("div",{className:g,role:"alert",children:[d.jsx("span",{className:v,"aria-hidden":"true",children:d.jsx(h,{})}),d.jsx("span",{className:Ft.message,children:r.message}),d.jsx("button",{type:"button",className:Ft.closeButton,onClick:c,"aria-label":"Close notification",children:d.jsx(Gc,{})})]})},Io=k.createContext(null),Yc=({children:r})=>{const[t,e]=k.useState([]),n=k.useCallback((i,a="success",l)=>{const c=`toast-${++Zc}`;e(h=>[...h,{id:c,message:i,variant:a,duration:l}])},[]),s=k.useCallback(i=>{e(a=>a.filter(l=>l.id!==i))},[]);return d.jsxs(Io.Provider,{value:{showToast:n},children:[r,po.createPortal(d.jsx("div",{className:Ft.overlay,children:t.map(i=>d.jsx(Oo,{entry:i,onClose:s},i.id))}),document.body)]})},Qc=()=>{const r=k.useContext(Io);if(!r)throw new Error("useToast must be used within a <ToastProvider>");return r},we={overlay:"_overlay_r7enq_1",dialog:"_dialog_r7enq_13",header:"_header_r7enq_26",titleBlock:"_titleBlock_r7enq_36",title:"_title_r7enq_36",subtitle:"_subtitle_r7enq_47",closeBtn:"_closeBtn_r7enq_54",body:"_body_r7enq_87",footer:"_footer_r7enq_97"},Bo=({open:r,onClose:t,title:e,subtitle:n,children:s,footer:i,maxWidth:a="520px",disableClose:l=!1,className:c="",titleId:h="modal-title","data-testid":g})=>(k.useEffect(()=>{if(!r)return;const v=f=>{!l&&f.key==="Escape"&&t()};return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[r,t,l]),r?d.jsx("div",{className:[we.overlay,c].filter(Boolean).join(" "),role:"presentation",onMouseDown:v=>{!l&&v.target===v.currentTarget&&t()},"data-testid":g,children:d.jsxs("div",{className:we.dialog,role:"dialog","aria-modal":"true","aria-labelledby":h,style:{"--modal-max-width":a},children:[d.jsxs("div",{className:we.header,children:[d.jsxs("div",{className:we.titleBlock,children:[d.jsx("h2",{id:h,className:we.title,children:e}),n&&d.jsx("p",{className:we.subtitle,children:n})]}),d.jsx("button",{type:"button",className:we.closeBtn,"aria-label":"Close",disabled:l,onClick:t,children:d.jsx(No,{size:18})})]}),d.jsx("div",{className:we.body,children:s}),i&&d.jsx("div",{className:we.footer,children:i})]})}):null),xs={message:"_message_q6xsi_1",footer:"_footer_q6xsi_8",dangerButton:"_dangerButton_q6xsi_16"},Jc=({open:r,onClose:t,onConfirm:e,title:n,message:s,confirmLabel:i="Confirm",cancelLabel:a="Cancel",loading:l=!1,variant:c="default","data-testid":h})=>d.jsx(Bo,{open:r,onClose:t,disableClose:l,title:n,maxWidth:"420px","data-testid":h,footer:d.jsxs("div",{className:xs.footer,children:[d.jsx(As,{label:a,onClick:t,disabled:l}),d.jsx(vo,{label:i,loading:l,onClick:e,className:c==="danger"?xs.dangerButton:void 0})]}),children:d.jsx("p",{className:xs.message,children:s})}),pt={root:"_root_1ljnu_1",header:"_header_1ljnu_7",title:"_title_1ljnu_14",addBtn:"_addBtn_1ljnu_22",tableWrap:"_tableWrap_1ljnu_56",tableWrapEmbedded:"_tableWrapEmbedded_1ljnu_64",table:"_table_1ljnu_56",thLeft:"_thLeft_1ljnu_102",thCenter:"_thCenter_1ljnu_106",thRight:"_thRight_1ljnu_110",tdCenter:"_tdCenter_1ljnu_114",tdRight:"_tdRight_1ljnu_118",tdName:"_tdName_1ljnu_123",tdHighlight:"_tdHighlight_1ljnu_127",productCell:"_productCell_1ljnu_133",productThumb:"_productThumb_1ljnu_139",productThumbEmpty:"_productThumbEmpty_1ljnu_149",productInfo:"_productInfo_1ljnu_158",productName:"_productName_1ljnu_164",productCode:"_productCode_1ljnu_171",rowBusy:"_rowBusy_1ljnu_177",rowInvalid:"_rowInvalid_1ljnu_182",actionsCell:"_actionsCell_1ljnu_189",addRowBtn:"_addRowBtn_1ljnu_197",empty:"_empty_1ljnu_232"},Dr=k.forwardRef(({className:r="","aria-label":t,...e},n)=>d.jsx("button",{ref:n,type:"button",className:[pt.addRowBtn,r].filter(Boolean).join(" "),"aria-label":t,...e,children:d.jsx(Ao,{"aria-hidden":!0})}));Dr.displayName="ProductTableIconAddButton";const jo=(r,t)=>r==="center"?t?pt.thCenter:pt.tdCenter:r==="right"?t?pt.thRight:pt.tdRight:t?pt.thLeft:"",tu=({items:r,columns:t,onDelete:e,onRowAdd:n,rowAddLabel:s="Add",disableRowActions:i=!1,isRowAddDisabled:a,onAdd:l,addLabel:c="Add Item",addInActionsColumnHeader:h=!1,title:g,emptyMessage:v="No items.",busyItemIds:f=[],invalidItemIds:b=[],nameColumnHeader:_="Name",actionsColumnHeader:N="Actions",renderProductMeta:A,embedded:E=!1,className:C="","data-testid":q})=>{const U=new Set(f),$=new Set(b),nt=!!(e||n),ht=!!l&&!(h&&nt),st=[pt.root,C].filter(Boolean).join(" ");return d.jsxs("div",{className:st,"data-testid":q,children:[(g||ht)&&d.jsxs("div",{className:pt.header,children:[g&&d.jsx("h2",{className:pt.title,children:g}),ht&&d.jsxs("button",{type:"button",className:pt.addBtn,onClick:l,"data-testid":q?`${q}-add`:void 0,children:[d.jsx(Ao,{size:14,"aria-hidden":!0}),d.jsx("span",{children:c})]})]}),d.jsxs("div",{className:E?pt.tableWrapEmbedded:pt.tableWrap,children:[d.jsxs("table",{className:pt.table,children:[d.jsx("thead",{children:d.jsxs("tr",{children:[d.jsx("th",{className:pt.thLeft,children:_}),t.map(tt=>d.jsx("th",{className:jo(tt.align,!0),children:tt.header},tt.key)),nt&&d.jsx("th",{className:pt.thCenter,children:l&&h?d.jsx("div",{className:pt.actionsCell,children:d.jsx(Dr,{"aria-label":c,onClick:l,"data-testid":q?`${q}-header-add`:void 0})}):N})]})}),d.jsx("tbody",{children:r.map((tt,V)=>{const p=U.has(tt.id),w=$.has(tt.id),y=[p?pt.rowBusy:"",w?pt.rowInvalid:""].filter(Boolean).join(" ");return d.jsxs("tr",{className:y,children:[d.jsx("td",{className:pt.tdName,children:d.jsxs("div",{className:pt.productCell,children:[tt.imageUrl?d.jsx("img",{src:tt.imageUrl,alt:"",className:pt.productThumb}):d.jsx("div",{className:pt.productThumbEmpty}),d.jsxs("div",{className:pt.productInfo,children:[d.jsx("span",{className:pt.productName,children:tt.name}),tt.code&&d.jsx("span",{className:pt.productCode,children:tt.code}),A==null?void 0:A(tt,V)]})]})}),t.map(S=>{const O=[jo(S.align,!1),S.highlight?pt.tdHighlight:""].filter(Boolean).join(" ");return d.jsx("td",{className:O,children:S.render(tt,V)},S.key)}),nt&&d.jsx("td",{className:pt.tdCenter,children:d.jsxs("div",{className:pt.actionsCell,children:[e&&d.jsx(jr.IconButton,{type:"button",variant:"danger","aria-label":`Delete ${tt.name}`,onClick:()=>e(tt),disabled:p||i,"data-testid":q?`${q}-delete-${tt.id}`:void 0,children:d.jsx(hc,{"aria-hidden":!0})}),n&&d.jsx(Dr,{"aria-label":typeof s=="function"?s(tt,V):s,onClick:()=>n(tt),disabled:p||i||!!(a!=null&&a(tt)),"data-testid":q?`${q}-add-${tt.id}`:void 0})]})})]},tt.id)})})]}),r.length===0&&d.jsx("div",{className:pt.empty,children:v})]})]})},Je={tag:"_tag_15jzc_1",created:"_created_15jzc_18",confirmed:"_confirmed_15jzc_24",completed:"_completed_15jzc_30",declined:"_declined_15jzc_36",shipped:"_shipped_15jzc_42"},tn={IN_CHECKOUT:Je.created,CREATED:Je.created,CONFIRMED:Je.confirmed,DECLINED:Je.declined,SHIPPED:Je.shipped,COMPLETED:Je.completed},eu=r=>{const t=r.toUpperCase().trim();return t in tn?tn[t]:t.includes("CONFIRM")?tn.CONFIRMED:t.includes("DECLINE")||t.includes("CANCEL")||t.includes("FAIL")?tn.DECLINED:t.includes("COMPLETE")||t.includes("DELIVER")?tn.COMPLETED:t.includes("SHIP")?tn.SHIPPED:tn.CREATED},Do=({status:r,className:t="","data-testid":e})=>{const n=r.toUpperCase().trim(),s=eu(n),i=[Je.tag,s,t].filter(Boolean).join(" ");return d.jsx("span",{className:i,"data-testid":e,children:n})},wt={root:"_root_uqjwd_1",header:"_header_uqjwd_7",title:"_title_uqjwd_14",tableWrap:"_tableWrap_uqjwd_22",tableWrapEmbedded:"_tableWrapEmbedded_uqjwd_29",table:"_table_uqjwd_22",thLeft:"_thLeft_uqjwd_66",thRight:"_thRight_uqjwd_70",tdRight:"_tdRight_uqjwd_74",orderLink:"_orderLink_uqjwd_79",cellMuted:"_cellMuted_uqjwd_100",empty:"_empty_uqjwd_104"},nu=/^(\d{4})-(\d{2})-(\d{2})$/;function ru(r){const t=r.trim(),e=nu.exec(t);if(e){const n=Number(e[1]),s=Number(e[2])-1,i=Number(e[3]),a=new Date(n,s,i);if(a.getFullYear()===n&&a.getMonth()===s&&a.getDate()===i)return a}return new Date(r)}const $o=r=>{if(r==null||r==="")return"—";const t=typeof r=="string"?ru(r):r;return Number.isNaN(t.getTime())?"—":new Intl.DateTimeFormat("de-DE",{day:"2-digit",month:"2-digit",year:"numeric"}).format(t)},su=(r,t)=>new Intl.NumberFormat("de-DE",{style:"currency",currency:t}).format(r),iu=({row:r,getOrderHref:t,onOrderNavigate:e,testId:n})=>{const s=`#${r.id}`;return t?d.jsx("a",{href:t(r),className:wt.orderLink,"data-testid":n?`${n}-order-link-${r.id}`:void 0,children:s}):e?d.jsx("button",{type:"button",className:wt.orderLink,onClick:()=>e(r),"data-testid":n?`${n}-order-nav-${r.id}`:void 0,children:s}):d.jsx("span",{className:wt.cellMuted,children:s})},ou=({items:r,title:t,getOrderHref:e,onOrderNavigate:n,emptyMessage:s="No orders.",embedded:i=!1,className:a="","data-testid":l})=>{const c=[wt.root,a].filter(Boolean).join(" ");return d.jsxs("div",{className:c,"data-testid":l,children:[t&&d.jsx("div",{className:wt.header,children:d.jsx("h2",{className:wt.title,children:t})}),d.jsxs("div",{className:i?wt.tableWrapEmbedded:wt.tableWrap,children:[d.jsxs("table",{className:wt.table,children:[d.jsx("thead",{children:d.jsxs("tr",{children:[d.jsx("th",{className:wt.thLeft,children:"Order #"}),d.jsx("th",{className:wt.thLeft,children:"Status"}),d.jsx("th",{className:wt.thLeft,children:"Customer"}),d.jsx("th",{className:wt.thLeft,children:"Order Date"}),d.jsx("th",{className:wt.thLeft,children:"Delivery Date"}),d.jsx("th",{className:wt.thLeft,children:"Delivery Address"}),d.jsx("th",{className:wt.thLeft,children:"Payment"}),d.jsx("th",{className:wt.thRight,children:"Order Value"})]})}),d.jsx("tbody",{children:r.map(h=>d.jsxs("tr",{children:[d.jsx("td",{children:d.jsx(iu,{row:h,getOrderHref:e,onOrderNavigate:n,testId:l})}),d.jsx("td",{children:d.jsx(Do,{status:h.status})}),d.jsx("td",{children:h.customerName}),d.jsx("td",{children:$o(h.orderDate)}),d.jsx("td",{className:wt.cellMuted,children:$o(h.deliveryDate??null)}),d.jsx("td",{children:h.deliveryAddress}),d.jsx("td",{children:h.payment}),d.jsx("td",{className:wt.tdRight,children:su(h.orderValue.amount,h.orderValue.currency)})]},h.id))})]}),r.length===0&&d.jsx("div",{className:wt.empty,children:s})]})]})},Ct={wizard:"_wizard_ymuhn_2",stepper:"_stepper_ymuhn_9",stepItem:"_stepItem_ymuhn_17",indicator:"_indicator_ymuhn_25",indicatorCurrent:"_indicatorCurrent_ymuhn_41",indicatorCompleted:"_indicatorCompleted_ymuhn_47",checkIcon:"_checkIcon_ymuhn_53",connector:"_connector_ymuhn_58",connectorCompleted:"_connectorCompleted_ymuhn_69",stepLabel:"_stepLabel_ymuhn_73",stepLabelCurrent:"_stepLabelCurrent_ymuhn_81",stepLabelCompleted:"_stepLabelCompleted_ymuhn_86",body:"_body_ymuhn_91",actions:"_actions_ymuhn_96",btn:"_btn_ymuhn_104",btnSecondary:"_btnSecondary_ymuhn_123",btnPrimary:"_btnPrimary_ymuhn_133"},au=({steps:r,activeStep:t,onStepChange:e,onSubmit:n,backLabel:s="Back",nextLabel:i="Next",submitLabel:a="Submit",submitting:l=!1,className:c="","data-testid":h})=>{const g=t===0,v=t===r.length-1,f=r[t],b=(f==null?void 0:f.canProceed)!==!1,_=k.useCallback(()=>{g||e(t-1)},[g,t,e]),N=k.useCallback(()=>{v?n==null||n():e(t+1)},[v,t,e,n]),A=k.useMemo(()=>[Ct.wizard,c].filter(Boolean).join(" "),[c]);return d.jsxs("div",{className:A,"data-testid":h,children:[d.jsx("nav",{className:Ct.stepper,"aria-label":"Wizard steps",children:r.map((E,C)=>{const q=C<t,U=C===t,$=[Ct.indicator,q?Ct.indicatorCompleted:"",U?Ct.indicatorCurrent:""].filter(Boolean).join(" ");return d.jsxs(k.Fragment,{children:[C>0&&d.jsx("div",{className:[Ct.connector,q?Ct.connectorCompleted:""].filter(Boolean).join(" ")}),d.jsxs("div",{className:Ct.stepItem,children:[d.jsx("div",{className:$,"aria-current":U?"step":void 0,children:q?d.jsx(mc,{className:Ct.checkIcon,"aria-hidden":!0}):d.jsx("span",{children:C+1})}),d.jsx("span",{className:[Ct.stepLabel,U?Ct.stepLabelCurrent:"",q?Ct.stepLabelCompleted:""].filter(Boolean).join(" "),children:E.label})]})]},E.id)})}),d.jsx("div",{className:Ct.body,children:f==null?void 0:f.content}),d.jsxs("div",{className:Ct.actions,children:[d.jsx("button",{type:"button",className:[Ct.btn,Ct.btnSecondary].join(" "),onClick:_,disabled:g,"data-testid":h?`${h}-back`:void 0,children:s}),d.jsx("button",{type:"button",className:[Ct.btn,Ct.btnPrimary].join(" "),onClick:N,disabled:!b||l,"data-testid":h?`${h}-next`:void 0,children:v?l?`${a}…`:a:i})]})]})},Kt={timeline:"_timeline_qccju_2",line:"_line_qccju_11",lineAnimated:"_lineAnimated_qccju_21",drawLine:"_drawLine_qccju_1",pulse:"_pulse_qccju_1",event:"_event_qccju_63",eventAnimated:"_eventAnimated_qccju_71",eventVisible:"_eventVisible_qccju_77",dot:"_dot_qccju_83",dotInner:"_dotInner_qccju_105",dot_info:"_dot_info_qccju_113",dotInfo:"_dot_info_qccju_113",dot_success:"_dot_success_qccju_119",dotSuccess:"_dot_success_qccju_119",dot_warning:"_dot_warning_qccju_125",dotWarning:"_dot_warning_qccju_125",dot_error:"_dot_error_qccju_131",dotError:"_dot_error_qccju_131",dot_default:"_dot_default_qccju_137",dotDefault:"_dot_default_qccju_137",content:"_content_qccju_144",title:"_title_qccju_159",description:"_description_qccju_168",time:"_time_qccju_2"},lu=({events:r,animated:t=!0,animateLine:e=!0,className:n="","data-testid":s})=>{const i=k.useRef(null),a=k.useRef([]),[l,c]=k.useState(0),[h,g]=k.useState(!t),v=k.useCallback(f=>b=>{a.current[f]=b},[]);return k.useEffect(()=>{if(!t)return;const f=requestAnimationFrame(()=>g(!0));return()=>cancelAnimationFrame(f)},[t]),k.useEffect(()=>{const f=i.current;if(!f||r.length<2){c(0);return}const b=a.current[0],_=a.current[r.length-1];if(!b||!_)return;const N=f.getBoundingClientRect().top,A=b.getBoundingClientRect().top-N+b.offsetHeight/2,E=_.getBoundingClientRect().top-N+_.offsetHeight/2;c(E-A)},[r]),r.length===0?null:d.jsxs("div",{ref:i,className:[Kt.timeline,n].filter(Boolean).join(" "),"data-testid":s,children:[d.jsx("div",{className:[Kt.line,e&&h?Kt.lineAnimated:""].filter(Boolean).join(" "),style:{height:l,top:20}}),r.map((f,b)=>{const _=f.variant?Kt[`dot_${f.variant}`]:"";return d.jsxs("div",{className:[Kt.event,t?Kt.eventAnimated:"",h?Kt.eventVisible:""].filter(Boolean).join(" "),style:t?{transitionDelay:`${b*120}ms`}:void 0,children:[d.jsx("div",{ref:v(b),className:[Kt.dot,_].filter(Boolean).join(" "),children:f.icon??d.jsx("span",{className:Kt.dotInner})}),d.jsxs("div",{className:Kt.content,children:[d.jsx("h4",{className:Kt.title,children:f.title}),f.description&&d.jsx("p",{className:Kt.description,children:f.description}),f.timestamp&&d.jsx("time",{className:Kt.time,children:f.timestamp})]})]},f.id)})]})},cu=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Mo=typeof global=="object"&&global&&global.Object===Object&&global,uu=typeof self=="object"&&self&&self.Object===Object&&self,de=Mo||uu||Function("return this")(),De=de.Symbol,Po=Object.prototype,hu=Po.hasOwnProperty,du=Po.toString,Yn=De?De.toStringTag:void 0;function fu(r){var t=hu.call(r,Yn),e=r[Yn];try{r[Yn]=void 0;var n=!0}catch{}var s=du.call(r);return n&&(t?r[Yn]=e:delete r[Yn]),s}var pu=Object.prototype,gu=pu.toString;function mu(r){return gu.call(r)}var bu="[object Null]",yu="[object Undefined]",Uo=De?De.toStringTag:void 0;function An(r){return r==null?r===void 0?yu:bu:Uo&&Uo in Object(r)?fu(r):mu(r)}function Ee(r){return r!=null&&typeof r=="object"}var en=Array.isArray;function $e(r){var t=typeof r;return r!=null&&(t=="object"||t=="function")}function Ho(r){return r}var vu="[object AsyncFunction]",_u="[object Function]",Nu="[object GeneratorFunction]",Au="[object Proxy]";function Ls(r){if(!$e(r))return!1;var t=An(r);return t==_u||t==Nu||t==vu||t==Au}var Cs=de["__core-js_shared__"],Ro=(function(){var r=/[^.]+$/.exec(Cs&&Cs.keys&&Cs.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function wu(r){return!!Ro&&Ro in r}var Eu=Function.prototype,Tu=Eu.toString;function nn(r){if(r!=null){try{return Tu.call(r)}catch{}try{return r+""}catch{}}return""}var xu=/[\\^$.*+?()[\]{}|]/g,Lu=/^\[object .+?Constructor\]$/,Cu=Function.prototype,Su=Object.prototype,ku=Cu.toString,qu=Su.hasOwnProperty,Ou=RegExp("^"+ku.call(qu).replace(xu,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Iu(r){if(!$e(r)||wu(r))return!1;var t=Ls(r)?Ou:Lu;return t.test(nn(r))}function Bu(r,t){return r==null?void 0:r[t]}function rn(r,t){var e=Bu(r,t);return Iu(e)?e:void 0}var Ss=rn(de,"WeakMap"),Fo=Object.create,ju=(function(){function r(){}return function(t){if(!$e(t))return{};if(Fo)return Fo(t);r.prototype=t;var e=new r;return r.prototype=void 0,e}})();function Du(r,t,e){switch(e.length){case 0:return r.call(t);case 1:return r.call(t,e[0]);case 2:return r.call(t,e[0],e[1]);case 3:return r.call(t,e[0],e[1],e[2])}return r.apply(t,e)}function $u(r,t){var e=-1,n=r.length;for(t||(t=Array(n));++e<n;)t[e]=r[e];return t}var Mu=800,Pu=16,Uu=Date.now;function Hu(r){var t=0,e=0;return function(){var n=Uu(),s=Pu-(n-e);if(e=n,s>0){if(++t>=Mu)return arguments[0]}else t=0;return r.apply(void 0,arguments)}}function Ru(r){return function(){return r}}var $r=(function(){try{var r=rn(Object,"defineProperty");return r({},"",{}),r}catch{}})(),Fu=$r?function(r,t){return $r(r,"toString",{configurable:!0,enumerable:!1,value:Ru(t),writable:!0})}:Ho,zu=Hu(Fu);function Wu(r,t){for(var e=-1,n=r==null?0:r.length;++e<n&&t(r[e],e,r)!==!1;);return r}var Ku=9007199254740991,Vu=/^(?:0|[1-9]\d*)$/;function zo(r,t){var e=typeof r;return t=t??Ku,!!t&&(e=="number"||e!="symbol"&&Vu.test(r))&&r>-1&&r%1==0&&r<t}function ks(r,t,e){t=="__proto__"&&$r?$r(r,t,{configurable:!0,enumerable:!0,value:e,writable:!0}):r[t]=e}function Qn(r,t){return r===t||r!==r&&t!==t}var Gu=Object.prototype,Zu=Gu.hasOwnProperty;function Wo(r,t,e){var n=r[t];(!(Zu.call(r,t)&&Qn(n,e))||e===void 0&&!(t in r))&&ks(r,t,e)}function Xu(r,t,e,n){var s=!e;e||(e={});for(var i=-1,a=t.length;++i<a;){var l=t[i],c=void 0;c===void 0&&(c=r[l]),s?ks(e,l,c):Wo(e,l,c)}return e}var Ko=Math.max;function Yu(r,t,e){return t=Ko(t===void 0?r.length-1:t,0),function(){for(var n=arguments,s=-1,i=Ko(n.length-t,0),a=Array(i);++s<i;)a[s]=n[t+s];s=-1;for(var l=Array(t+1);++s<t;)l[s]=n[s];return l[t]=e(a),Du(r,this,l)}}function Qu(r,t){return zu(Yu(r,t,Ho),r+"")}var Ju=9007199254740991;function Vo(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=Ju}function Mr(r){return r!=null&&Vo(r.length)&&!Ls(r)}function th(r,t,e){if(!$e(e))return!1;var n=typeof t;return(n=="number"?Mr(e)&&zo(t,e.length):n=="string"&&t in e)?Qn(e[t],r):!1}function eh(r){return Qu(function(t,e){var n=-1,s=e.length,i=s>1?e[s-1]:void 0,a=s>2?e[2]:void 0;for(i=r.length>3&&typeof i=="function"?(s--,i):void 0,a&&th(e[0],e[1],a)&&(i=s<3?void 0:i,s=1),t=Object(t);++n<s;){var l=e[n];l&&r(t,l,n,i)}return t})}var nh=Object.prototype;function qs(r){var t=r&&r.constructor,e=typeof t=="function"&&t.prototype||nh;return r===e}function rh(r,t){for(var e=-1,n=Array(r);++e<r;)n[e]=t(e);return n}var sh="[object Arguments]";function Go(r){return Ee(r)&&An(r)==sh}var Zo=Object.prototype,ih=Zo.hasOwnProperty,oh=Zo.propertyIsEnumerable,Os=Go((function(){return arguments})())?Go:function(r){return Ee(r)&&ih.call(r,"callee")&&!oh.call(r,"callee")};function ah(){return!1}var Xo=typeof z=="object"&&z&&!z.nodeType&&z,Yo=Xo&&typeof module=="object"&&module&&!module.nodeType&&module,lh=Yo&&Yo.exports===Xo,Qo=lh?de.Buffer:void 0,ch=Qo?Qo.isBuffer:void 0,Jn=ch||ah,uh="[object Arguments]",hh="[object Array]",dh="[object Boolean]",fh="[object Date]",ph="[object Error]",gh="[object Function]",mh="[object Map]",bh="[object Number]",yh="[object Object]",vh="[object RegExp]",_h="[object Set]",Nh="[object String]",Ah="[object WeakMap]",wh="[object ArrayBuffer]",Eh="[object DataView]",Th="[object Float32Array]",xh="[object Float64Array]",Lh="[object Int8Array]",Ch="[object Int16Array]",Sh="[object Int32Array]",kh="[object Uint8Array]",qh="[object Uint8ClampedArray]",Oh="[object Uint16Array]",Ih="[object Uint32Array]",_t={};_t[Th]=_t[xh]=_t[Lh]=_t[Ch]=_t[Sh]=_t[kh]=_t[qh]=_t[Oh]=_t[Ih]=!0,_t[uh]=_t[hh]=_t[wh]=_t[dh]=_t[Eh]=_t[fh]=_t[ph]=_t[gh]=_t[mh]=_t[bh]=_t[yh]=_t[vh]=_t[_h]=_t[Nh]=_t[Ah]=!1;function Bh(r){return Ee(r)&&Vo(r.length)&&!!_t[An(r)]}function Is(r){return function(t){return r(t)}}var Jo=typeof z=="object"&&z&&!z.nodeType&&z,tr=Jo&&typeof module=="object"&&module&&!module.nodeType&&module,jh=tr&&tr.exports===Jo,Bs=jh&&Mo.process,wn=(function(){try{var r=tr&&tr.require&&tr.require("util").types;return r||Bs&&Bs.binding&&Bs.binding("util")}catch{}})(),ta=wn&&wn.isTypedArray,js=ta?Is(ta):Bh,Dh=Object.prototype,$h=Dh.hasOwnProperty;function ea(r,t){var e=en(r),n=!e&&Os(r),s=!e&&!n&&Jn(r),i=!e&&!n&&!s&&js(r),a=e||n||s||i,l=a?rh(r.length,String):[],c=l.length;for(var h in r)(t||$h.call(r,h))&&!(a&&(h=="length"||s&&(h=="offset"||h=="parent")||i&&(h=="buffer"||h=="byteLength"||h=="byteOffset")||zo(h,c)))&&l.push(h);return l}function na(r,t){return function(e){return r(t(e))}}var Mh=na(Object.keys,Object),Ph=Object.prototype,Uh=Ph.hasOwnProperty;function Hh(r){if(!qs(r))return Mh(r);var t=[];for(var e in Object(r))Uh.call(r,e)&&e!="constructor"&&t.push(e);return t}function Rh(r){return Mr(r)?ea(r):Hh(r)}function Fh(r){var t=[];if(r!=null)for(var e in Object(r))t.push(e);return t}var zh=Object.prototype,Wh=zh.hasOwnProperty;function Kh(r){if(!$e(r))return Fh(r);var t=qs(r),e=[];for(var n in r)n=="constructor"&&(t||!Wh.call(r,n))||e.push(n);return e}function ra(r){return Mr(r)?ea(r,!0):Kh(r)}var er=rn(Object,"create");function Vh(){this.__data__=er?er(null):{},this.size=0}function Gh(r){var t=this.has(r)&&delete this.__data__[r];return this.size-=t?1:0,t}var Zh="__lodash_hash_undefined__",Xh=Object.prototype,Yh=Xh.hasOwnProperty;function Qh(r){var t=this.__data__;if(er){var e=t[r];return e===Zh?void 0:e}return Yh.call(t,r)?t[r]:void 0}var Jh=Object.prototype,td=Jh.hasOwnProperty;function ed(r){var t=this.__data__;return er?t[r]!==void 0:td.call(t,r)}var nd="__lodash_hash_undefined__";function rd(r,t){var e=this.__data__;return this.size+=this.has(r)?0:1,e[r]=er&&t===void 0?nd:t,this}function sn(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var n=r[t];this.set(n[0],n[1])}}sn.prototype.clear=Vh,sn.prototype.delete=Gh,sn.prototype.get=Qh,sn.prototype.has=ed,sn.prototype.set=rd;function sd(){this.__data__=[],this.size=0}function Pr(r,t){for(var e=r.length;e--;)if(Qn(r[e][0],t))return e;return-1}var id=Array.prototype,od=id.splice;function ad(r){var t=this.__data__,e=Pr(t,r);if(e<0)return!1;var n=t.length-1;return e==n?t.pop():od.call(t,e,1),--this.size,!0}function ld(r){var t=this.__data__,e=Pr(t,r);return e<0?void 0:t[e][1]}function cd(r){return Pr(this.__data__,r)>-1}function ud(r,t){var e=this.__data__,n=Pr(e,r);return n<0?(++this.size,e.push([r,t])):e[n][1]=t,this}function Te(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var n=r[t];this.set(n[0],n[1])}}Te.prototype.clear=sd,Te.prototype.delete=ad,Te.prototype.get=ld,Te.prototype.has=cd,Te.prototype.set=ud;var nr=rn(de,"Map");function hd(){this.size=0,this.__data__={hash:new sn,map:new(nr||Te),string:new sn}}function dd(r){var t=typeof r;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?r!=="__proto__":r===null}function Ur(r,t){var e=r.__data__;return dd(t)?e[typeof t=="string"?"string":"hash"]:e.map}function fd(r){var t=Ur(this,r).delete(r);return this.size-=t?1:0,t}function pd(r){return Ur(this,r).get(r)}function gd(r){return Ur(this,r).has(r)}function md(r,t){var e=Ur(this,r),n=e.size;return e.set(r,t),this.size+=e.size==n?0:1,this}function on(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var n=r[t];this.set(n[0],n[1])}}on.prototype.clear=hd,on.prototype.delete=fd,on.prototype.get=pd,on.prototype.has=gd,on.prototype.set=md;function bd(r,t){for(var e=-1,n=t.length,s=r.length;++e<n;)r[s+e]=t[e];return r}var sa=na(Object.getPrototypeOf,Object),yd="[object Object]",vd=Function.prototype,_d=Object.prototype,ia=vd.toString,Nd=_d.hasOwnProperty,Ad=ia.call(Object);function wd(r){if(!Ee(r)||An(r)!=yd)return!1;var t=sa(r);if(t===null)return!0;var e=Nd.call(t,"constructor")&&t.constructor;return typeof e=="function"&&e instanceof e&&ia.call(e)==Ad}function Ed(){this.__data__=new Te,this.size=0}function Td(r){var t=this.__data__,e=t.delete(r);return this.size=t.size,e}function xd(r){return this.__data__.get(r)}function Ld(r){return this.__data__.has(r)}var Cd=200;function Sd(r,t){var e=this.__data__;if(e instanceof Te){var n=e.__data__;if(!nr||n.length<Cd-1)return n.push([r,t]),this.size=++e.size,this;e=this.__data__=new on(n)}return e.set(r,t),this.size=e.size,this}function fe(r){var t=this.__data__=new Te(r);this.size=t.size}fe.prototype.clear=Ed,fe.prototype.delete=Td,fe.prototype.get=xd,fe.prototype.has=Ld,fe.prototype.set=Sd;var oa=typeof z=="object"&&z&&!z.nodeType&&z,aa=oa&&typeof module=="object"&&module&&!module.nodeType&&module,kd=aa&&aa.exports===oa,la=kd?de.Buffer:void 0,ca=la?la.allocUnsafe:void 0;function ua(r,t){if(t)return r.slice();var e=r.length,n=ca?ca(e):new r.constructor(e);return r.copy(n),n}function qd(r,t){for(var e=-1,n=r==null?0:r.length,s=0,i=[];++e<n;){var a=r[e];t(a,e,r)&&(i[s++]=a)}return i}function Od(){return[]}var Id=Object.prototype,Bd=Id.propertyIsEnumerable,ha=Object.getOwnPropertySymbols,jd=ha?function(r){return r==null?[]:(r=Object(r),qd(ha(r),function(t){return Bd.call(r,t)}))}:Od;function Dd(r,t,e){var n=t(r);return en(r)?n:bd(n,e(r))}function Ds(r){return Dd(r,Rh,jd)}var $s=rn(de,"DataView"),Ms=rn(de,"Promise"),Ps=rn(de,"Set"),da="[object Map]",$d="[object Object]",fa="[object Promise]",pa="[object Set]",ga="[object WeakMap]",ma="[object DataView]",Md=nn($s),Pd=nn(nr),Ud=nn(Ms),Hd=nn(Ps),Rd=nn(Ss),ne=An;($s&&ne(new $s(new ArrayBuffer(1)))!=ma||nr&&ne(new nr)!=da||Ms&&ne(Ms.resolve())!=fa||Ps&&ne(new Ps)!=pa||Ss&&ne(new Ss)!=ga)&&(ne=function(r){var t=An(r),e=t==$d?r.constructor:void 0,n=e?nn(e):"";if(n)switch(n){case Md:return ma;case Pd:return da;case Ud:return fa;case Hd:return pa;case Rd:return ga}return t});var Fd=Object.prototype,zd=Fd.hasOwnProperty;function Wd(r){var t=r.length,e=new r.constructor(t);return t&&typeof r[0]=="string"&&zd.call(r,"index")&&(e.index=r.index,e.input=r.input),e}var Hr=de.Uint8Array;function Us(r){var t=new r.constructor(r.byteLength);return new Hr(t).set(new Hr(r)),t}function Kd(r,t){var e=Us(r.buffer);return new r.constructor(e,r.byteOffset,r.byteLength)}var Vd=/\w*$/;function Gd(r){var t=new r.constructor(r.source,Vd.exec(r));return t.lastIndex=r.lastIndex,t}var ba=De?De.prototype:void 0,ya=ba?ba.valueOf:void 0;function Zd(r){return ya?Object(ya.call(r)):{}}function va(r,t){var e=t?Us(r.buffer):r.buffer;return new r.constructor(e,r.byteOffset,r.length)}var Xd="[object Boolean]",Yd="[object Date]",Qd="[object Map]",Jd="[object Number]",tf="[object RegExp]",ef="[object Set]",nf="[object String]",rf="[object Symbol]",sf="[object ArrayBuffer]",of="[object DataView]",af="[object Float32Array]",lf="[object Float64Array]",cf="[object Int8Array]",uf="[object Int16Array]",hf="[object Int32Array]",df="[object Uint8Array]",ff="[object Uint8ClampedArray]",pf="[object Uint16Array]",gf="[object Uint32Array]";function mf(r,t,e){var n=r.constructor;switch(t){case sf:return Us(r);case Xd:case Yd:return new n(+r);case of:return Kd(r);case af:case lf:case cf:case uf:case hf:case df:case ff:case pf:case gf:return va(r,e);case Qd:return new n;case Jd:case nf:return new n(r);case tf:return Gd(r);case ef:return new n;case rf:return Zd(r)}}function _a(r){return typeof r.constructor=="function"&&!qs(r)?ju(sa(r)):{}}var bf="[object Map]";function yf(r){return Ee(r)&&ne(r)==bf}var Na=wn&&wn.isMap,vf=Na?Is(Na):yf,_f="[object Set]";function Nf(r){return Ee(r)&&ne(r)==_f}var Aa=wn&&wn.isSet,Af=Aa?Is(Aa):Nf,wf=1,wa="[object Arguments]",Ef="[object Array]",Tf="[object Boolean]",xf="[object Date]",Lf="[object Error]",Ea="[object Function]",Cf="[object GeneratorFunction]",Sf="[object Map]",kf="[object Number]",Ta="[object Object]",qf="[object RegExp]",Of="[object Set]",If="[object String]",Bf="[object Symbol]",jf="[object WeakMap]",Df="[object ArrayBuffer]",$f="[object DataView]",Mf="[object Float32Array]",Pf="[object Float64Array]",Uf="[object Int8Array]",Hf="[object Int16Array]",Rf="[object Int32Array]",Ff="[object Uint8Array]",zf="[object Uint8ClampedArray]",Wf="[object Uint16Array]",Kf="[object Uint32Array]",bt={};bt[wa]=bt[Ef]=bt[Df]=bt[$f]=bt[Tf]=bt[xf]=bt[Mf]=bt[Pf]=bt[Uf]=bt[Hf]=bt[Rf]=bt[Sf]=bt[kf]=bt[Ta]=bt[qf]=bt[Of]=bt[If]=bt[Bf]=bt[Ff]=bt[zf]=bt[Wf]=bt[Kf]=!0,bt[Lf]=bt[Ea]=bt[jf]=!1;function Rr(r,t,e,n,s,i){var a,l=t&wf;if(a!==void 0)return a;if(!$e(r))return r;var c=en(r);if(c)a=Wd(r);else{var h=ne(r),g=h==Ea||h==Cf;if(Jn(r))return ua(r,l);if(h==Ta||h==wa||g&&!s)a=g?{}:_a(r);else{if(!bt[h])return s?r:{};a=mf(r,h,l)}}i||(i=new fe);var v=i.get(r);if(v)return v;i.set(r,a),Af(r)?r.forEach(function(_){a.add(Rr(_,t,e,_,r,i))}):vf(r)&&r.forEach(function(_,N){a.set(N,Rr(_,t,e,N,r,i))});var f=Ds,b=c?void 0:f(r);return Wu(b||r,function(_,N){b&&(N=_,_=r[N]),Wo(a,N,Rr(_,t,e,N,r,i))}),a}var Vf=1,Gf=4;function En(r){return Rr(r,Vf|Gf)}var Zf="__lodash_hash_undefined__";function Xf(r){return this.__data__.set(r,Zf),this}function Yf(r){return this.__data__.has(r)}function Fr(r){var t=-1,e=r==null?0:r.length;for(this.__data__=new on;++t<e;)this.add(r[t])}Fr.prototype.add=Fr.prototype.push=Xf,Fr.prototype.has=Yf;function Qf(r,t){for(var e=-1,n=r==null?0:r.length;++e<n;)if(t(r[e],e,r))return!0;return!1}function Jf(r,t){return r.has(t)}var tp=1,ep=2;function xa(r,t,e,n,s,i){var a=e&tp,l=r.length,c=t.length;if(l!=c&&!(a&&c>l))return!1;var h=i.get(r),g=i.get(t);if(h&&g)return h==t&&g==r;var v=-1,f=!0,b=e&ep?new Fr:void 0;for(i.set(r,t),i.set(t,r);++v<l;){var _=r[v],N=t[v];if(n)var A=a?n(N,_,v,t,r,i):n(_,N,v,r,t,i);if(A!==void 0){if(A)continue;f=!1;break}if(b){if(!Qf(t,function(E,C){if(!Jf(b,C)&&(_===E||s(_,E,e,n,i)))return b.push(C)})){f=!1;break}}else if(!(_===N||s(_,N,e,n,i))){f=!1;break}}return i.delete(r),i.delete(t),f}function np(r){var t=-1,e=Array(r.size);return r.forEach(function(n,s){e[++t]=[s,n]}),e}function rp(r){var t=-1,e=Array(r.size);return r.forEach(function(n){e[++t]=n}),e}var sp=1,ip=2,op="[object Boolean]",ap="[object Date]",lp="[object Error]",cp="[object Map]",up="[object Number]",hp="[object RegExp]",dp="[object Set]",fp="[object String]",pp="[object Symbol]",gp="[object ArrayBuffer]",mp="[object DataView]",La=De?De.prototype:void 0,Hs=La?La.valueOf:void 0;function bp(r,t,e,n,s,i,a){switch(e){case mp:if(r.byteLength!=t.byteLength||r.byteOffset!=t.byteOffset)return!1;r=r.buffer,t=t.buffer;case gp:return!(r.byteLength!=t.byteLength||!i(new Hr(r),new Hr(t)));case op:case ap:case up:return Qn(+r,+t);case lp:return r.name==t.name&&r.message==t.message;case hp:case fp:return r==t+"";case cp:var l=np;case dp:var c=n&sp;if(l||(l=rp),r.size!=t.size&&!c)return!1;var h=a.get(r);if(h)return h==t;n|=ip,a.set(r,t);var g=xa(l(r),l(t),n,s,i,a);return a.delete(r),g;case pp:if(Hs)return Hs.call(r)==Hs.call(t)}return!1}var yp=1,vp=Object.prototype,_p=vp.hasOwnProperty;function Np(r,t,e,n,s,i){var a=e&yp,l=Ds(r),c=l.length,h=Ds(t),g=h.length;if(c!=g&&!a)return!1;for(var v=c;v--;){var f=l[v];if(!(a?f in t:_p.call(t,f)))return!1}var b=i.get(r),_=i.get(t);if(b&&_)return b==t&&_==r;var N=!0;i.set(r,t),i.set(t,r);for(var A=a;++v<c;){f=l[v];var E=r[f],C=t[f];if(n)var q=a?n(C,E,f,t,r,i):n(E,C,f,r,t,i);if(!(q===void 0?E===C||s(E,C,e,n,i):q)){N=!1;break}A||(A=f=="constructor")}if(N&&!A){var U=r.constructor,$=t.constructor;U!=$&&"constructor"in r&&"constructor"in t&&!(typeof U=="function"&&U instanceof U&&typeof $=="function"&&$ instanceof $)&&(N=!1)}return i.delete(r),i.delete(t),N}var Ap=1,Ca="[object Arguments]",Sa="[object Array]",zr="[object Object]",wp=Object.prototype,ka=wp.hasOwnProperty;function Ep(r,t,e,n,s,i){var a=en(r),l=en(t),c=a?Sa:ne(r),h=l?Sa:ne(t);c=c==Ca?zr:c,h=h==Ca?zr:h;var g=c==zr,v=h==zr,f=c==h;if(f&&Jn(r)){if(!Jn(t))return!1;a=!0,g=!1}if(f&&!g)return i||(i=new fe),a||js(r)?xa(r,t,e,n,s,i):bp(r,t,c,e,n,s,i);if(!(e&Ap)){var b=g&&ka.call(r,"__wrapped__"),_=v&&ka.call(t,"__wrapped__");if(b||_){var N=b?r.value():r,A=_?t.value():t;return i||(i=new fe),s(N,A,e,n,i)}}return f?(i||(i=new fe),Np(r,t,e,n,s,i)):!1}function qa(r,t,e,n,s){return r===t?!0:r==null||t==null||!Ee(r)&&!Ee(t)?r!==r&&t!==t:Ep(r,t,e,n,qa,s)}function Tp(r){return function(t,e,n){for(var s=-1,i=Object(t),a=n(t),l=a.length;l--;){var c=a[++s];if(e(i[c],c,i)===!1)break}return t}}var xp=Tp();function Rs(r,t,e){(e!==void 0&&!Qn(r[t],e)||e===void 0&&!(t in r))&&ks(r,t,e)}function Lp(r){return Ee(r)&&Mr(r)}function Fs(r,t){if(!(t==="constructor"&&typeof r[t]=="function")&&t!="__proto__")return r[t]}function Cp(r){return Xu(r,ra(r))}function Sp(r,t,e,n,s,i,a){var l=Fs(r,e),c=Fs(t,e),h=a.get(c);if(h){Rs(r,e,h);return}var g=i?i(l,c,e+"",r,t,a):void 0,v=g===void 0;if(v){var f=en(c),b=!f&&Jn(c),_=!f&&!b&&js(c);g=c,f||b||_?en(l)?g=l:Lp(l)?g=$u(l):b?(v=!1,g=ua(c,!0)):_?(v=!1,g=va(c,!0)):g=[]:wd(c)||Os(c)?(g=l,Os(l)?g=Cp(l):(!$e(l)||Ls(l))&&(g=_a(c))):v=!1}v&&(a.set(c,g),s(g,c,n,i,a),a.delete(c)),Rs(r,e,g)}function Oa(r,t,e,n,s){r!==t&&xp(t,function(i,a){if(s||(s=new fe),$e(i))Sp(r,t,a,e,Oa,n,s);else{var l=n?n(Fs(r,a),i,a+"",r,t,s):void 0;l===void 0&&(l=i),Rs(r,a,l)}},ra)}function zs(r,t){return qa(r,t)}var Me=eh(function(r,t,e){Oa(r,t,e)}),F=(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))(F||{});class pe{constructor(t,e,n={}){this.attrName=t,this.keyName=e;const s=F.TYPE&F.ATTRIBUTE;this.scope=n.scope!=null?n.scope&F.LEVEL|s:F.ATTRIBUTE,n.whitelist!=null&&(this.whitelist=n.whitelist)}static keys(t){return Array.from(t.attributes).map(e=>e.name)}add(t,e){return this.canAdd(t,e)?(t.setAttribute(this.keyName,e),!0):!1}canAdd(t,e){return this.whitelist==null?!0:typeof e=="string"?this.whitelist.indexOf(e.replace(/["']/g,""))>-1:this.whitelist.indexOf(e)>-1}remove(t){t.removeAttribute(this.keyName)}value(t){const e=t.getAttribute(this.keyName);return this.canAdd(t,e)&&e?e:""}}class Tn extends Error{constructor(t){t="[Parchment] "+t,super(t),this.message=t,this.name=this.constructor.name}}const Ia=class ho{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(t,e=!1){if(t==null)return null;if(this.blots.has(t))return this.blots.get(t)||null;if(e){let n=null;try{n=t.parentNode}catch{return null}return this.find(n,e)}return null}create(t,e,n){const s=this.query(e);if(s==null)throw new Tn(`Unable to create ${e} blot`);const i=s,a=e instanceof Node||e.nodeType===Node.TEXT_NODE?e:i.create(n),l=new i(t,a,n);return ho.blots.set(l.domNode,l),l}find(t,e=!1){return ho.find(t,e)}query(t,e=F.ANY){let n;return typeof t=="string"?n=this.types[t]||this.attributes[t]:t instanceof Text||t.nodeType===Node.TEXT_NODE?n=this.types.text:typeof t=="number"?t&F.LEVEL&F.BLOCK?n=this.types.block:t&F.LEVEL&F.INLINE&&(n=this.types.inline):t instanceof Element&&((t.getAttribute("class")||"").split(/\s+/).some(s=>(n=this.classes[s],!!n)),n=n||this.tags[t.tagName]),n==null?null:"scope"in n&&e&F.LEVEL&n.scope&&e&F.TYPE&n.scope?n:null}register(...t){return t.map(e=>{const n="blotName"in e,s="attrName"in e;if(!n&&!s)throw new Tn("Invalid definition");if(n&&e.blotName==="abstract")throw new Tn("Cannot register abstract class");const i=n?e.blotName:s?e.attrName:void 0;return this.types[i]=e,s?typeof e.keyName=="string"&&(this.attributes[e.keyName]=e):n&&(e.className&&(this.classes[e.className]=e),e.tagName&&(Array.isArray(e.tagName)?e.tagName=e.tagName.map(a=>a.toUpperCase()):e.tagName=e.tagName.toUpperCase(),(Array.isArray(e.tagName)?e.tagName:[e.tagName]).forEach(a=>{(this.tags[a]==null||e.className==null)&&(this.tags[a]=e)}))),e})}};Ia.blots=new WeakMap;let xn=Ia;function Ba(r,t){return(r.getAttribute("class")||"").split(/\s+/).filter(e=>e.indexOf(`${t}-`)===0)}class kp extends pe{static keys(t){return(t.getAttribute("class")||"").split(/\s+/).map(e=>e.split("-").slice(0,-1).join("-"))}add(t,e){return this.canAdd(t,e)?(this.remove(t),t.classList.add(`${this.keyName}-${e}`),!0):!1}remove(t){Ba(t,this.keyName).forEach(e=>{t.classList.remove(e)}),t.classList.length===0&&t.removeAttribute("class")}value(t){const e=(Ba(t,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(t,e)?e:""}}const re=kp;function Ws(r){const t=r.split("-"),e=t.slice(1).map(n=>n[0].toUpperCase()+n.slice(1)).join("");return t[0]+e}class qp extends pe{static keys(t){return(t.getAttribute("style")||"").split(";").map(e=>e.split(":")[0].trim())}add(t,e){return this.canAdd(t,e)?(t.style[Ws(this.keyName)]=e,!0):!1}remove(t){t.style[Ws(this.keyName)]="",t.getAttribute("style")||t.removeAttribute("style")}value(t){const e=t.style[Ws(this.keyName)];return this.canAdd(t,e)?e:""}}const Pe=qp;class Op{constructor(t){this.attributes={},this.domNode=t,this.build()}attribute(t,e){e?t.add(this.domNode,e)&&(t.value(this.domNode)!=null?this.attributes[t.attrName]=t:delete this.attributes[t.attrName]):(t.remove(this.domNode),delete this.attributes[t.attrName])}build(){this.attributes={};const t=xn.find(this.domNode);if(t==null)return;const e=pe.keys(this.domNode),n=re.keys(this.domNode),s=Pe.keys(this.domNode);e.concat(n).concat(s).forEach(i=>{const a=t.scroll.query(i,F.ATTRIBUTE);a instanceof pe&&(this.attributes[a.attrName]=a)})}copy(t){Object.keys(this.attributes).forEach(e=>{const n=this.attributes[e].value(this.domNode);t.format(e,n)})}move(t){this.copy(t),Object.keys(this.attributes).forEach(e=>{this.attributes[e].remove(this.domNode)}),this.attributes={}}values(){return Object.keys(this.attributes).reduce((t,e)=>(t[e]=this.attributes[e].value(this.domNode),t),{})}}const Wr=Op,ja=class{constructor(t,e){this.scroll=t,this.domNode=e,xn.blots.set(e,this),this.prev=null,this.next=null}static create(t){if(this.tagName==null)throw new Tn("Blot definition missing tagName");let e,n;return Array.isArray(this.tagName)?(typeof t=="string"?(n=t.toUpperCase(),parseInt(n,10).toString()===n&&(n=parseInt(n,10))):typeof t=="number"&&(n=t),typeof n=="number"?e=document.createElement(this.tagName[n-1]):n&&this.tagName.indexOf(n)>-1?e=document.createElement(n):e=document.createElement(this.tagName[0])):e=document.createElement(this.tagName),this.className&&e.classList.add(this.className),e}get statics(){return this.constructor}attach(){}clone(){const t=this.domNode.cloneNode(!1);return this.scroll.create(t)}detach(){this.parent!=null&&this.parent.removeChild(this),xn.blots.delete(this.domNode)}deleteAt(t,e){this.isolate(t,e).remove()}formatAt(t,e,n,s){const i=this.isolate(t,e);if(this.scroll.query(n,F.BLOT)!=null&&s)i.wrap(n,s);else if(this.scroll.query(n,F.ATTRIBUTE)!=null){const a=this.scroll.create(this.statics.scope);i.wrap(a),a.format(n,s)}}insertAt(t,e,n){const s=n==null?this.scroll.create("text",e):this.scroll.create(e,n),i=this.split(t);this.parent.insertBefore(s,i||void 0)}isolate(t,e){const n=this.split(t);if(n==null)throw new Error("Attempt to isolate at end");return n.split(e),n}length(){return 1}offset(t=this.parent){return this.parent==null||this===t?0:this.parent.children.offset(this)+this.parent.offset(t)}optimize(t){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(t,e){const n=typeof t=="string"?this.scroll.create(t,e):t;return this.parent!=null&&(this.parent.insertBefore(n,this.next||void 0),this.remove()),n}split(t,e){return t===0?this:this.next}update(t,e){}wrap(t,e){const n=typeof t=="string"?this.scroll.create(t,e):t;if(this.parent!=null&&this.parent.insertBefore(n,this.next||void 0),typeof n.appendChild!="function")throw new Tn(`Cannot wrap ${t}`);return n.appendChild(this),n}};ja.blotName="abstract";let Da=ja;const $a=class extends Da{static value(t){return!0}index(t,e){return this.domNode===t||this.domNode.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(e,1):-1}position(t,e){let n=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return t>0&&(n+=1),[this.parent.domNode,n]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};$a.scope=F.INLINE_BLOT;const Ot=$a;class Ip{constructor(){this.head=null,this.tail=null,this.length=0}append(...t){if(this.insertBefore(t[0],null),t.length>1){const e=t.slice(1);this.append(...e)}}at(t){const e=this.iterator();let n=e();for(;n&&t>0;)t-=1,n=e();return n}contains(t){const e=this.iterator();let n=e();for(;n;){if(n===t)return!0;n=e()}return!1}indexOf(t){const e=this.iterator();let n=e(),s=0;for(;n;){if(n===t)return s;s+=1,n=e()}return-1}insertBefore(t,e){t!=null&&(this.remove(t),t.next=e,e!=null?(t.prev=e.prev,e.prev!=null&&(e.prev.next=t),e.prev=t,e===this.head&&(this.head=t)):this.tail!=null?(this.tail.next=t,t.prev=this.tail,this.tail=t):(t.prev=null,this.head=this.tail=t),this.length+=1)}offset(t){let e=0,n=this.head;for(;n!=null;){if(n===t)return e;e+=n.length(),n=n.next}return-1}remove(t){this.contains(t)&&(t.prev!=null&&(t.prev.next=t.next),t.next!=null&&(t.next.prev=t.prev),t===this.head&&(this.head=t.next),t===this.tail&&(this.tail=t.prev),this.length-=1)}iterator(t=this.head){return()=>{const e=t;return t!=null&&(t=t.next),e}}find(t,e=!1){const n=this.iterator();let s=n();for(;s;){const i=s.length();if(t<i||e&&t===i&&(s.next==null||s.next.length()!==0))return[s,t];t-=i,s=n()}return[null,0]}forEach(t){const e=this.iterator();let n=e();for(;n;)t(n),n=e()}forEachAt(t,e,n){if(e<=0)return;const[s,i]=this.find(t);let a=t-i;const l=this.iterator(s);let c=l();for(;c&&a<t+e;){const h=c.length();t>a?n(c,t-a,Math.min(e,a+h-t)):n(c,0,Math.min(h,t+e-a)),a+=h,c=l()}}map(t){return this.reduce((e,n)=>(e.push(t(n)),e),[])}reduce(t,e){const n=this.iterator();let s=n();for(;s;)e=t(e,s),s=n();return e}}function Ma(r,t){const e=t.find(r);if(e)return e;try{return t.create(r)}catch{const n=t.create(F.INLINE);return Array.from(r.childNodes).forEach(s=>{n.domNode.appendChild(s)}),r.parentNode&&r.parentNode.replaceChild(n.domNode,r),n.attach(),n}}const Pa=class Ge extends Da{constructor(t,e){super(t,e),this.uiNode=null,this.build()}appendChild(t){this.insertBefore(t)}attach(){super.attach(),this.children.forEach(t=>{t.attach()})}attachUI(t){this.uiNode!=null&&this.uiNode.remove(),this.uiNode=t,Ge.uiClass&&this.uiNode.classList.add(Ge.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new Ip,Array.from(this.domNode.childNodes).filter(t=>t!==this.uiNode).reverse().forEach(t=>{try{const e=Ma(t,this.scroll);this.insertBefore(e,this.children.head||void 0)}catch(e){if(e instanceof Tn)return;throw e}})}deleteAt(t,e){if(t===0&&e===this.length())return this.remove();this.children.forEachAt(t,e,(n,s,i)=>{n.deleteAt(s,i)})}descendant(t,e=0){const[n,s]=this.children.find(e);return t.blotName==null&&t(n)||t.blotName!=null&&n instanceof t?[n,s]:n instanceof Ge?n.descendant(t,s):[null,-1]}descendants(t,e=0,n=Number.MAX_VALUE){let s=[],i=n;return this.children.forEachAt(e,n,(a,l,c)=>{(t.blotName==null&&t(a)||t.blotName!=null&&a instanceof t)&&s.push(a),a instanceof Ge&&(s=s.concat(a.descendants(t,l,i))),i-=c}),s}detach(){this.children.forEach(t=>{t.detach()}),super.detach()}enforceAllowedChildren(){let t=!1;this.children.forEach(e=>{t||this.statics.allowedChildren.some(n=>e instanceof n)||(e.statics.scope===F.BLOCK_BLOT?(e.next!=null&&this.splitAfter(e),e.prev!=null&&this.splitAfter(e.prev),e.parent.unwrap(),t=!0):e instanceof Ge?e.unwrap():e.remove())})}formatAt(t,e,n,s){this.children.forEachAt(t,e,(i,a,l)=>{i.formatAt(a,l,n,s)})}insertAt(t,e,n){const[s,i]=this.children.find(t);if(s)s.insertAt(i,e,n);else{const a=n==null?this.scroll.create("text",e):this.scroll.create(e,n);this.appendChild(a)}}insertBefore(t,e){t.parent!=null&&t.parent.children.remove(t);let n=null;this.children.insertBefore(t,e||null),t.parent=this,e!=null&&(n=e.domNode),(this.domNode.parentNode!==t.domNode||this.domNode.nextSibling!==n)&&this.domNode.insertBefore(t.domNode,n),t.attach()}length(){return this.children.reduce((t,e)=>t+e.length(),0)}moveChildren(t,e){this.children.forEach(n=>{t.insertBefore(n,e)})}optimize(t){if(super.optimize(t),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 e=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(e)}else this.remove()}path(t,e=!1){const[n,s]=this.children.find(t,e),i=[[this,t]];return n instanceof Ge?i.concat(n.path(s,e)):(n!=null&&i.push([n,s]),i)}removeChild(t){this.children.remove(t)}replaceWith(t,e){const n=typeof t=="string"?this.scroll.create(t,e):t;return n instanceof Ge&&this.moveChildren(n),super.replaceWith(n)}split(t,e=!1){if(!e){if(t===0)return this;if(t===this.length())return this.next}const n=this.clone();return this.parent&&this.parent.insertBefore(n,this.next||void 0),this.children.forEachAt(t,this.length(),(s,i,a)=>{const l=s.split(i,e);l!=null&&n.appendChild(l)}),n}splitAfter(t){const e=this.clone();for(;t.next!=null;)e.appendChild(t.next);return this.parent&&this.parent.insertBefore(e,this.next||void 0),e}unwrap(){this.parent&&this.moveChildren(this.parent,this.next||void 0),this.remove()}update(t,e){const n=[],s=[];t.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 a=this.scroll.find(i);a!=null&&(a.domNode.parentNode==null||a.domNode.parentNode===this.domNode)&&a.detach()}),n.filter(i=>i.parentNode===this.domNode&&i!==this.uiNode).sort((i,a)=>i===a?0:i.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1).forEach(i=>{let a=null;i.nextSibling!=null&&(a=this.scroll.find(i.nextSibling));const l=Ma(i,this.scroll);(l.next!==a||l.next==null)&&(l.parent!=null&&l.parent.removeChild(this),this.insertBefore(l,a||void 0))}),this.enforceAllowedChildren()}};Pa.uiClass="";const se=Pa;function Bp(r,t){if(Object.keys(r).length!==Object.keys(t).length)return!1;for(const e in r)if(r[e]!==t[e])return!1;return!0}const Ln=class Kn extends se{static create(t){return super.create(t)}static formats(t,e){const n=e.query(Kn.blotName);if(!(n!=null&&t.tagName===n.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return t.tagName.toLowerCase()}}constructor(t,e){super(t,e),this.attributes=new Wr(this.domNode)}format(t,e){if(t===this.statics.blotName&&!e)this.children.forEach(n=>{n instanceof Kn||(n=n.wrap(Kn.blotName,!0)),this.attributes.copy(n)}),this.unwrap();else{const n=this.scroll.query(t,F.INLINE);if(n==null)return;n instanceof pe?this.attributes.attribute(n,e):e&&(t!==this.statics.blotName||this.formats()[t]!==e)&&this.replaceWith(t,e)}}formats(){const t=this.attributes.values(),e=this.statics.formats(this.domNode,this.scroll);return e!=null&&(t[this.statics.blotName]=e),t}formatAt(t,e,n,s){this.formats()[n]!=null||this.scroll.query(n,F.ATTRIBUTE)?this.isolate(t,e).format(n,s):super.formatAt(t,e,n,s)}optimize(t){super.optimize(t);const e=this.formats();if(Object.keys(e).length===0)return this.unwrap();const n=this.next;n instanceof Kn&&n.prev===this&&Bp(e,n.formats())&&(n.moveChildren(this),n.remove())}replaceWith(t,e){const n=super.replaceWith(t,e);return this.attributes.copy(n),n}update(t,e){super.update(t,e),t.some(n=>n.target===this.domNode&&n.type==="attributes")&&this.attributes.build()}wrap(t,e){const n=super.wrap(t,e);return n instanceof Kn&&this.attributes.move(n),n}};Ln.allowedChildren=[Ln,Ot],Ln.blotName="inline",Ln.scope=F.INLINE_BLOT,Ln.tagName="SPAN";const Ks=Ln,Cn=class fo extends se{static create(t){return super.create(t)}static formats(t,e){const n=e.query(fo.blotName);if(!(n!=null&&t.tagName===n.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return t.tagName.toLowerCase()}}constructor(t,e){super(t,e),this.attributes=new Wr(this.domNode)}format(t,e){const n=this.scroll.query(t,F.BLOCK);n!=null&&(n instanceof pe?this.attributes.attribute(n,e):t===this.statics.blotName&&!e?this.replaceWith(fo.blotName):e&&(t!==this.statics.blotName||this.formats()[t]!==e)&&this.replaceWith(t,e))}formats(){const t=this.attributes.values(),e=this.statics.formats(this.domNode,this.scroll);return e!=null&&(t[this.statics.blotName]=e),t}formatAt(t,e,n,s){this.scroll.query(n,F.BLOCK)!=null?this.format(n,s):super.formatAt(t,e,n,s)}insertAt(t,e,n){if(n==null||this.scroll.query(e,F.INLINE)!=null)super.insertAt(t,e,n);else{const s=this.split(t);if(s!=null){const i=this.scroll.create(e,n);s.parent.insertBefore(i,s)}else throw new Error("Attempt to insertAt after block boundaries")}}replaceWith(t,e){const n=super.replaceWith(t,e);return this.attributes.copy(n),n}update(t,e){super.update(t,e),t.some(n=>n.target===this.domNode&&n.type==="attributes")&&this.attributes.build()}};Cn.blotName="block",Cn.scope=F.BLOCK_BLOT,Cn.tagName="P",Cn.allowedChildren=[Ks,Cn,Ot];const rr=Cn,Vs=class extends se{checkMerge(){return this.next!==null&&this.next.statics.blotName===this.statics.blotName}deleteAt(t,e){super.deleteAt(t,e),this.enforceAllowedChildren()}formatAt(t,e,n,s){super.formatAt(t,e,n,s),this.enforceAllowedChildren()}insertAt(t,e,n){super.insertAt(t,e,n),this.enforceAllowedChildren()}optimize(t){super.optimize(t),this.children.length>0&&this.next!=null&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};Vs.blotName="container",Vs.scope=F.BLOCK_BLOT;const Kr=Vs;class jp extends Ot{static formats(t,e){}format(t,e){super.formatAt(0,this.length(),t,e)}formatAt(t,e,n,s){t===0&&e===this.length()?this.format(n,s):super.formatAt(t,e,n,s)}formats(){return this.statics.formats(this.domNode,this.scroll)}}const Vt=jp,Dp={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},$p=100,Sn=class extends se{constructor(t,e){super(null,e),this.registry=t,this.scroll=this,this.build(),this.observer=new MutationObserver(n=>{this.update(n)}),this.observer.observe(this.domNode,Dp),this.attach()}create(t,e){return this.registry.create(this,t,e)}find(t,e=!1){const n=this.registry.find(t,e);return n?n.scroll===this?n:e?this.find(n.scroll.domNode.parentNode,!0):null:null}query(t,e=F.ANY){return this.registry.query(t,e)}register(...t){return this.registry.register(...t)}build(){this.scroll!=null&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(t,e){this.update(),t===0&&e===this.length()?this.children.forEach(n=>{n.remove()}):super.deleteAt(t,e)}formatAt(t,e,n,s){this.update(),super.formatAt(t,e,n,s)}insertAt(t,e,n){this.update(),super.insertAt(t,e,n)}optimize(t=[],e={}){super.optimize(e);const n=e.mutationsMap||new WeakMap;let s=Array.from(this.observer.takeRecords());for(;s.length>0;)t.push(s.pop());const i=(c,h=!0)=>{c==null||c===this||c.domNode.parentNode!=null&&(n.has(c.domNode)||n.set(c.domNode,[]),h&&i(c.parent))},a=c=>{n.has(c.domNode)&&(c instanceof se&&c.children.forEach(a),n.delete(c.domNode),c.optimize(e))};let l=t;for(let c=0;l.length>0;c+=1){if(c>=$p)throw new Error("[Parchment] Maximum optimize iterations reached");for(l.forEach(h=>{const g=this.find(h.target,!0);g!=null&&(g.domNode===h.target&&(h.type==="childList"?(i(this.find(h.previousSibling,!1)),Array.from(h.addedNodes).forEach(v=>{const f=this.find(v,!1);i(f,!1),f instanceof se&&f.children.forEach(b=>{i(b,!1)})})):h.type==="attributes"&&i(g.prev)),i(g))}),this.children.forEach(a),l=Array.from(this.observer.takeRecords()),s=l.slice();s.length>0;)t.push(s.pop())}}update(t,e={}){t=t||this.observer.takeRecords();const n=new WeakMap;t.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)||[],e)}),e.mutationsMap=n,n.has(this.domNode)&&super.update(n.get(this.domNode),e),this.optimize(t,e)}};Sn.blotName="scroll",Sn.defaultChild=rr,Sn.allowedChildren=[rr,Kr],Sn.scope=F.BLOCK_BLOT,Sn.tagName="DIV";const Gs=Sn,Zs=class Zl extends Ot{static create(t){return document.createTextNode(t)}static value(t){return t.data}constructor(t,e){super(t,e),this.text=this.statics.value(this.domNode)}deleteAt(t,e){this.domNode.data=this.text=this.text.slice(0,t)+this.text.slice(t+e)}index(t,e){return this.domNode===t?e:-1}insertAt(t,e,n){n==null?(this.text=this.text.slice(0,t)+e+this.text.slice(t),this.domNode.data=this.text):super.insertAt(t,e,n)}length(){return this.text.length}optimize(t){super.optimize(t),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof Zl&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())}position(t,e=!1){return[this.domNode,t]}split(t,e=!1){if(!e){if(t===0)return this;if(t===this.length())return this.next}const n=this.scroll.create(this.domNode.splitText(t));return this.parent.insertBefore(n,this.next||void 0),this.text=this.statics.value(this.domNode),n}update(t,e){t.some(n=>n.type==="characterData"&&n.target===this.domNode)&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};Zs.blotName="text",Zs.scope=F.INLINE_BLOT;const Vr=Zs,Ua=Object.freeze(Object.defineProperty({__proto__:null,Attributor:pe,AttributorStore:Wr,BlockBlot:rr,ClassAttributor:re,ContainerBlot:Kr,EmbedBlot:Vt,InlineBlot:Ks,LeafBlot:Ot,ParentBlot:se,Registry:xn,Scope:F,ScrollBlot:Gs,StyleAttributor:Pe,TextBlot:Vr},Symbol.toStringTag,{value:"Module"}));var Ue=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ha(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Gr={exports:{}},Xs,Ra;function Mp(){if(Ra)return Xs;Ra=1;var r=-1,t=1,e=0;function n(p,w,y,S,O){if(p===w)return p?[[e,p]]:[];if(y!=null){var L=tt(p,w,y);if(L)return L}var I=l(p,w),M=p.substring(0,I);p=p.substring(I),w=w.substring(I),I=h(p,w);var R=p.substring(p.length-I);p=p.substring(0,p.length-I),w=w.substring(0,w.length-I);var j=s(p,w);return M&&j.unshift([e,M]),R&&j.push([e,R]),C(j,O),S&&v(j),j}function s(p,w){var y;if(!p)return[[t,w]];if(!w)return[[r,p]];var S=p.length>w.length?p:w,O=p.length>w.length?w:p,L=S.indexOf(O);if(L!==-1)return y=[[t,S.substring(0,L)],[e,O],[t,S.substring(L+O.length)]],p.length>w.length&&(y[0][0]=y[2][0]=r),y;if(O.length===1)return[[r,p],[t,w]];var I=g(p,w);if(I){var M=I[0],R=I[1],j=I[2],G=I[3],Z=I[4],et=n(M,j),rt=n(R,G);return et.concat([[e,Z]],rt)}return i(p,w)}function i(p,w){for(var y=p.length,S=w.length,O=Math.ceil((y+S)/2),L=O,I=2*O,M=new Array(I),R=new Array(I),j=0;j<I;j++)M[j]=-1,R[j]=-1;M[L+1]=0,R[L+1]=0;for(var G=y-S,Z=G%2!==0,et=0,rt=0,W=0,gt=0,yt=0;yt<O;yt++){for(var X=-yt+et;X<=yt-rt;X+=2){var it=L+X,Y;X===-yt||X!==yt&&M[it-1]<M[it+1]?Y=M[it+1]:Y=M[it-1]+1;for(var ot=Y-X;Y<y&&ot<S&&p.charAt(Y)===w.charAt(ot);)Y++,ot++;if(M[it]=Y,Y>y)rt+=2;else if(ot>S)et+=2;else if(Z){var ut=L+G-X;if(ut>=0&&ut<I&&R[ut]!==-1){var lt=y-R[ut];if(Y>=lt)return a(p,w,Y,ot)}}}for(var Nt=-yt+W;Nt<=yt-gt;Nt+=2){var ut=L+Nt,lt;Nt===-yt||Nt!==yt&&R[ut-1]<R[ut+1]?lt=R[ut+1]:lt=R[ut-1]+1;for(var xt=lt-Nt;lt<y&&xt<S&&p.charAt(y-lt-1)===w.charAt(S-xt-1);)lt++,xt++;if(R[ut]=lt,lt>y)gt+=2;else if(xt>S)W+=2;else if(!Z){var it=L+G-Nt;if(it>=0&&it<I&&M[it]!==-1){var Y=M[it],ot=L+Y-it;if(lt=y-lt,Y>=lt)return a(p,w,Y,ot)}}}}return[[r,p],[t,w]]}function a(p,w,y,S){var O=p.substring(0,y),L=w.substring(0,S),I=p.substring(y),M=w.substring(S),R=n(O,L),j=n(I,M);return R.concat(j)}function l(p,w){if(!p||!w||p.charAt(0)!==w.charAt(0))return 0;for(var y=0,S=Math.min(p.length,w.length),O=S,L=0;y<O;)p.substring(L,O)==w.substring(L,O)?(y=O,L=y):S=O,O=Math.floor((S-y)/2+y);return q(p.charCodeAt(O-1))&&O--,O}function c(p,w){var y=p.length,S=w.length;if(y==0||S==0)return 0;y>S?p=p.substring(y-S):y<S&&(w=w.substring(0,y));var O=Math.min(y,S);if(p==w)return O;for(var L=0,I=1;;){var M=p.substring(O-I),R=w.indexOf(M);if(R==-1)return L;I+=R,(R==0||p.substring(O-I)==w.substring(0,I))&&(L=I,I++)}}function h(p,w){if(!p||!w||p.slice(-1)!==w.slice(-1))return 0;for(var y=0,S=Math.min(p.length,w.length),O=S,L=0;y<O;)p.substring(p.length-O,p.length-L)==w.substring(w.length-O,w.length-L)?(y=O,L=y):S=O,O=Math.floor((S-y)/2+y);return U(p.charCodeAt(p.length-O))&&O--,O}function g(p,w){var y=p.length>w.length?p:w,S=p.length>w.length?w:p;if(y.length<4||S.length*2<y.length)return null;function O(rt,W,gt){for(var yt=rt.substring(gt,gt+Math.floor(rt.length/4)),X=-1,it="",Y,ot,ut,lt;(X=W.indexOf(yt,X+1))!==-1;){var Nt=l(rt.substring(gt),W.substring(X)),xt=h(rt.substring(0,gt),W.substring(0,X));it.length<xt+Nt&&(it=W.substring(X-xt,X)+W.substring(X,X+Nt),Y=rt.substring(0,gt-xt),ot=rt.substring(gt+Nt),ut=W.substring(0,X-xt),lt=W.substring(X+Nt))}return it.length*2>=rt.length?[Y,ot,ut,lt,it]:null}var L=O(y,S,Math.ceil(y.length/4)),I=O(y,S,Math.ceil(y.length/2)),M;if(!L&&!I)return null;I?L?M=L[4].length>I[4].length?L:I:M=I:M=L;var R,j,G,Z;p.length>w.length?(R=M[0],j=M[1],G=M[2],Z=M[3]):(G=M[0],Z=M[1],R=M[2],j=M[3]);var et=M[4];return[R,j,G,Z,et]}function v(p){for(var w=!1,y=[],S=0,O=null,L=0,I=0,M=0,R=0,j=0;L<p.length;)p[L][0]==e?(y[S++]=L,I=R,M=j,R=0,j=0,O=p[L][1]):(p[L][0]==t?R+=p[L][1].length:j+=p[L][1].length,O&&O.length<=Math.max(I,M)&&O.length<=Math.max(R,j)&&(p.splice(y[S-1],0,[r,O]),p[y[S-1]+1][0]=t,S--,S--,L=S>0?y[S-1]:-1,I=0,M=0,R=0,j=0,O=null,w=!0)),L++;for(w&&C(p),E(p),L=1;L<p.length;){if(p[L-1][0]==r&&p[L][0]==t){var G=p[L-1][1],Z=p[L][1],et=c(G,Z),rt=c(Z,G);et>=rt?(et>=G.length/2||et>=Z.length/2)&&(p.splice(L,0,[e,Z.substring(0,et)]),p[L-1][1]=G.substring(0,G.length-et),p[L+1][1]=Z.substring(et),L++):(rt>=G.length/2||rt>=Z.length/2)&&(p.splice(L,0,[e,G.substring(0,rt)]),p[L-1][0]=t,p[L-1][1]=Z.substring(0,Z.length-rt),p[L+1][0]=r,p[L+1][1]=G.substring(rt),L++),L++}L++}}var f=/[^a-zA-Z0-9]/,b=/\s/,_=/[\r\n]/,N=/\n\r?\n$/,A=/^\r?\n\r?\n/;function E(p){function w(rt,W){if(!rt||!W)return 6;var gt=rt.charAt(rt.length-1),yt=W.charAt(0),X=gt.match(f),it=yt.match(f),Y=X&&gt.match(b),ot=it&&yt.match(b),ut=Y&&gt.match(_),lt=ot&&yt.match(_),Nt=ut&&rt.match(N),xt=lt&&W.match(A);return Nt||xt?5:ut||lt?4:X&&!Y&&ot?3:Y||ot?2:X||it?1:0}for(var y=1;y<p.length-1;){if(p[y-1][0]==e&&p[y+1][0]==e){var S=p[y-1][1],O=p[y][1],L=p[y+1][1],I=h(S,O);if(I){var M=O.substring(O.length-I);S=S.substring(0,S.length-I),O=M+O.substring(0,O.length-I),L=M+L}for(var R=S,j=O,G=L,Z=w(S,O)+w(O,L);O.charAt(0)===L.charAt(0);){S+=O.charAt(0),O=O.substring(1)+L.charAt(0),L=L.substring(1);var et=w(S,O)+w(O,L);et>=Z&&(Z=et,R=S,j=O,G=L)}p[y-1][1]!=R&&(R?p[y-1][1]=R:(p.splice(y-1,1),y--),p[y][1]=j,G?p[y+1][1]=G:(p.splice(y+1,1),y--))}y++}}function C(p,w){p.push([e,""]);for(var y=0,S=0,O=0,L="",I="",M;y<p.length;){if(y<p.length-1&&!p[y][1]){p.splice(y,1);continue}switch(p[y][0]){case t:O++,I+=p[y][1],y++;break;case r:S++,L+=p[y][1],y++;break;case e:var R=y-O-S-1;if(w){if(R>=0&&nt(p[R][1])){var j=p[R][1].slice(-1);if(p[R][1]=p[R][1].slice(0,-1),L=j+L,I=j+I,!p[R][1]){p.splice(R,1),y--;var G=R-1;p[G]&&p[G][0]===t&&(O++,I=p[G][1]+I,G--),p[G]&&p[G][0]===r&&(S++,L=p[G][1]+L,G--),R=G}}if($(p[y][1])){var j=p[y][1].charAt(0);p[y][1]=p[y][1].slice(1),L+=j,I+=j}}if(y<p.length-1&&!p[y][1]){p.splice(y,1);break}if(L.length>0||I.length>0){L.length>0&&I.length>0&&(M=l(I,L),M!==0&&(R>=0?p[R][1]+=I.substring(0,M):(p.splice(0,0,[e,I.substring(0,M)]),y++),I=I.substring(M),L=L.substring(M)),M=h(I,L),M!==0&&(p[y][1]=I.substring(I.length-M)+p[y][1],I=I.substring(0,I.length-M),L=L.substring(0,L.length-M)));var Z=O+S;L.length===0&&I.length===0?(p.splice(y-Z,Z),y=y-Z):L.length===0?(p.splice(y-Z,Z,[t,I]),y=y-Z+1):I.length===0?(p.splice(y-Z,Z,[r,L]),y=y-Z+1):(p.splice(y-Z,Z,[r,L],[t,I]),y=y-Z+2)}y!==0&&p[y-1][0]===e?(p[y-1][1]+=p[y][1],p.splice(y,1)):y++,O=0,S=0,L="",I="";break}}p[p.length-1][1]===""&&p.pop();var et=!1;for(y=1;y<p.length-1;)p[y-1][0]===e&&p[y+1][0]===e&&(p[y][1].substring(p[y][1].length-p[y-1][1].length)===p[y-1][1]?(p[y][1]=p[y-1][1]+p[y][1].substring(0,p[y][1].length-p[y-1][1].length),p[y+1][1]=p[y-1][1]+p[y+1][1],p.splice(y-1,1),et=!0):p[y][1].substring(0,p[y+1][1].length)==p[y+1][1]&&(p[y-1][1]+=p[y+1][1],p[y][1]=p[y][1].substring(p[y+1][1].length)+p[y+1][1],p.splice(y+1,1),et=!0)),y++;et&&C(p,w)}function q(p){return p>=55296&&p<=56319}function U(p){return p>=56320&&p<=57343}function $(p){return U(p.charCodeAt(0))}function nt(p){return q(p.charCodeAt(p.length-1))}function ht(p){for(var w=[],y=0;y<p.length;y++)p[y][1].length>0&&w.push(p[y]);return w}function st(p,w,y,S){return nt(p)||$(S)?null:ht([[e,p],[r,w],[t,y],[e,S]])}function tt(p,w,y){var S=typeof y=="number"?{index:y,length:0}:y.oldRange,O=typeof y=="number"?null:y.newRange,L=p.length,I=w.length;if(S.length===0&&(O===null||O.length===0)){var M=S.index,R=p.slice(0,M),j=p.slice(M),G=O?O.index:null;t:{var Z=M+I-L;if(G!==null&&G!==Z||Z<0||Z>I)break t;var et=w.slice(0,Z),rt=w.slice(Z);if(rt!==j)break t;var W=Math.min(M,Z),gt=R.slice(0,W),yt=et.slice(0,W);if(gt!==yt)break t;var X=R.slice(W),it=et.slice(W);return st(gt,X,it,j)}t:{if(G!==null&&G!==M)break t;var Y=M,et=w.slice(0,Y),rt=w.slice(Y);if(et!==R)break t;var ot=Math.min(L-Y,I-Y),ut=j.slice(j.length-ot),lt=rt.slice(rt.length-ot);if(ut!==lt)break t;var X=j.slice(0,j.length-ot),it=rt.slice(0,rt.length-ot);return st(R,X,it,ut)}}if(S.length>0&&O&&O.length===0)t:{var gt=p.slice(0,S.index),ut=p.slice(S.index+S.length),W=gt.length,ot=ut.length;if(I<W+ot)break t;var yt=w.slice(0,W),lt=w.slice(I-ot);if(gt!==yt||ut!==lt)break t;var X=p.slice(W,L-ot),it=w.slice(W,I-ot);return st(gt,X,it,ut)}return null}function V(p,w,y,S){return n(p,w,y,S,!0)}return V.INSERT=t,V.DELETE=r,V.EQUAL=e,Xs=V,Xs}var sr={exports:{}};sr.exports;var Fa;function za(){return Fa||(Fa=1,(function(r,t){var e=200,n="__lodash_hash_undefined__",s=9007199254740991,i="[object Arguments]",a="[object Array]",l="[object Boolean]",c="[object Date]",h="[object Error]",g="[object Function]",v="[object GeneratorFunction]",f="[object Map]",b="[object Number]",_="[object Object]",N="[object Promise]",A="[object RegExp]",E="[object Set]",C="[object String]",q="[object Symbol]",U="[object WeakMap]",$="[object ArrayBuffer]",nt="[object DataView]",ht="[object Float32Array]",st="[object Float64Array]",tt="[object Int8Array]",V="[object Int16Array]",p="[object Int32Array]",w="[object Uint8Array]",y="[object Uint8ClampedArray]",S="[object Uint16Array]",O="[object Uint32Array]",L=/[\\^$.*+?()[\]{}|]/g,I=/\w*$/,M=/^\[object .+?Constructor\]$/,R=/^(?:0|[1-9]\d*)$/,j={};j[i]=j[a]=j[$]=j[nt]=j[l]=j[c]=j[ht]=j[st]=j[tt]=j[V]=j[p]=j[f]=j[b]=j[_]=j[A]=j[E]=j[C]=j[q]=j[w]=j[y]=j[S]=j[O]=!0,j[h]=j[g]=j[U]=!1;var G=typeof Ue=="object"&&Ue&&Ue.Object===Object&&Ue,Z=typeof self=="object"&&self&&self.Object===Object&&self,et=G||Z||Function("return this")(),rt=t&&!t.nodeType&&t,W=rt&&!0&&r&&!r.nodeType&&r,gt=W&&W.exports===rt;function yt(o,u){return o.set(u[0],u[1]),o}function X(o,u){return o.add(u),o}function it(o,u){for(var m=-1,T=o?o.length:0;++m<T&&u(o[m],m,o)!==!1;);return o}function Y(o,u){for(var m=-1,T=u.length,J=o.length;++m<T;)o[J+m]=u[m];return o}function ot(o,u,m,T){for(var J=-1,K=o?o.length:0;++J<K;)m=u(m,o[J],J,o);return m}function ut(o,u){for(var m=-1,T=Array(o);++m<o;)T[m]=u(m);return T}function lt(o,u){return o==null?void 0:o[u]}function Nt(o){var u=!1;if(o!=null&&typeof o.toString!="function")try{u=!!(o+"")}catch{}return u}function xt(o){var u=-1,m=Array(o.size);return o.forEach(function(T,J){m[++u]=[J,T]}),m}function ke(o,u){return function(m){return o(u(m))}}function un(o){var u=-1,m=Array(o.size);return o.forEach(function(T){m[++u]=T}),m}var yr=Array.prototype,vr=Function.prototype,ze=Object.prototype,hn=et["__core-js_shared__"],qe=(function(){var o=/[^.]+$/.exec(hn&&hn.keys&&hn.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""})(),We=vr.toString,B=ze.hasOwnProperty,Q=ze.toString,dt=RegExp("^"+We.call(B).replace(L,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),mt=gt?et.Buffer:void 0,Pt=et.Symbol,Jt=et.Uint8Array,At=ke(Object.getPrototypeOf,Object),Dn=Object.create,$n=ze.propertyIsEnumerable,Li=yr.splice,_r=Object.getOwnPropertySymbols,Mn=mt?mt.isBuffer:void 0,ls=ke(Object.keys,Object),Pn=he(et,"DataView"),dn=he(et,"Map"),ue=he(et,"Promise"),Un=he(et,"Set"),Nr=he(et,"WeakMap"),fn=he(Object,"create"),Ar=Ut(Pn),pn=Ut(dn),wr=Ut(ue),Er=Ut(Un),Tr=Ut(Nr),Ke=Pt?Pt.prototype:void 0,cs=Ke?Ke.valueOf:void 0;function Oe(o){var u=-1,m=o?o.length:0;for(this.clear();++u<m;){var T=o[u];this.set(T[0],T[1])}}function Ci(){this.__data__=fn?fn(null):{}}function Si(o){return this.has(o)&&delete this.__data__[o]}function ki(o){var u=this.__data__;if(fn){var m=u[o];return m===n?void 0:m}return B.call(u,o)?u[o]:void 0}function us(o){var u=this.__data__;return fn?u[o]!==void 0:B.call(u,o)}function xr(o,u){var m=this.__data__;return m[o]=fn&&u===void 0?n:u,this}Oe.prototype.clear=Ci,Oe.prototype.delete=Si,Oe.prototype.get=ki,Oe.prototype.has=us,Oe.prototype.set=xr;function kt(o){var u=-1,m=o?o.length:0;for(this.clear();++u<m;){var T=o[u];this.set(T[0],T[1])}}function qi(){this.__data__=[]}function Oi(o){var u=this.__data__,m=Rn(u,o);if(m<0)return!1;var T=u.length-1;return m==T?u.pop():Li.call(u,m,1),!0}function Ii(o){var u=this.__data__,m=Rn(u,o);return m<0?void 0:u[m][1]}function Bi(o){return Rn(this.__data__,o)>-1}function ji(o,u){var m=this.__data__,T=Rn(m,o);return T<0?m.push([o,u]):m[T][1]=u,this}kt.prototype.clear=qi,kt.prototype.delete=Oi,kt.prototype.get=Ii,kt.prototype.has=Bi,kt.prototype.set=ji;function Bt(o){var u=-1,m=o?o.length:0;for(this.clear();++u<m;){var T=o[u];this.set(T[0],T[1])}}function Di(){this.__data__={hash:new Oe,map:new(dn||kt),string:new Oe}}function $i(o){return mn(this,o).delete(o)}function Mi(o){return mn(this,o).get(o)}function Pi(o){return mn(this,o).has(o)}function Ui(o,u){return mn(this,o).set(o,u),this}Bt.prototype.clear=Di,Bt.prototype.delete=$i,Bt.prototype.get=Mi,Bt.prototype.has=Pi,Bt.prototype.set=Ui;function zt(o){this.__data__=new kt(o)}function Hi(){this.__data__=new kt}function Ri(o){return this.__data__.delete(o)}function Fi(o){return this.__data__.get(o)}function zi(o){return this.__data__.has(o)}function Wi(o,u){var m=this.__data__;if(m instanceof kt){var T=m.__data__;if(!dn||T.length<e-1)return T.push([o,u]),this;m=this.__data__=new Bt(T)}return m.set(o,u),this}zt.prototype.clear=Hi,zt.prototype.delete=Ri,zt.prototype.get=Fi,zt.prototype.has=zi,zt.prototype.set=Wi;function Hn(o,u){var m=kr(o)||zn(o)?ut(o.length,String):[],T=m.length,J=!!T;for(var K in o)B.call(o,K)&&!(J&&(K=="length"||io(K,T)))&&m.push(K);return m}function hs(o,u,m){var T=o[u];(!(B.call(o,u)&&ms(T,m))||m===void 0&&!(u in o))&&(o[u]=m)}function Rn(o,u){for(var m=o.length;m--;)if(ms(o[m][0],u))return m;return-1}function ye(o,u){return o&&Sr(u,Or(u),o)}function Lr(o,u,m,T,J,K,ct){var at;if(T&&(at=K?T(o,J,K,ct):T(o)),at!==void 0)return at;if(!_e(o))return o;var Et=kr(o);if(Et){if(at=ro(o),!u)return to(o,at)}else{var ft=Be(o),jt=ft==g||ft==v;if(bs(o))return Fn(o,u);if(ft==_||ft==i||jt&&!K){if(Nt(o))return K?o:{};if(at=ve(jt?{}:o),!u)return eo(o,ye(at,o))}else{if(!j[ft])return K?o:{};at=so(o,ft,Lr,u)}}ct||(ct=new zt);var Wt=ct.get(o);if(Wt)return Wt;if(ct.set(o,at),!Et)var Lt=m?no(o):Or(o);return it(Lt||o,function(Dt,qt){Lt&&(qt=Dt,Dt=o[qt]),hs(at,qt,Lr(Dt,u,m,T,qt,o,ct))}),at}function Ki(o){return _e(o)?Dn(o):{}}function Vi(o,u,m){var T=u(o);return kr(o)?T:Y(T,m(o))}function Gi(o){return Q.call(o)}function Zi(o){if(!_e(o)||ao(o))return!1;var u=qr(o)||Nt(o)?dt:M;return u.test(Ut(o))}function Xi(o){if(!ps(o))return ls(o);var u=[];for(var m in Object(o))B.call(o,m)&&m!="constructor"&&u.push(m);return u}function Fn(o,u){if(u)return o.slice();var m=new o.constructor(o.length);return o.copy(m),m}function Cr(o){var u=new o.constructor(o.byteLength);return new Jt(u).set(new Jt(o)),u}function gn(o,u){var m=u?Cr(o.buffer):o.buffer;return new o.constructor(m,o.byteOffset,o.byteLength)}function ds(o,u,m){var T=u?m(xt(o),!0):xt(o);return ot(T,yt,new o.constructor)}function fs(o){var u=new o.constructor(o.source,I.exec(o));return u.lastIndex=o.lastIndex,u}function Yi(o,u,m){var T=u?m(un(o),!0):un(o);return ot(T,X,new o.constructor)}function Qi(o){return cs?Object(cs.call(o)):{}}function Ji(o,u){var m=u?Cr(o.buffer):o.buffer;return new o.constructor(m,o.byteOffset,o.length)}function to(o,u){var m=-1,T=o.length;for(u||(u=Array(T));++m<T;)u[m]=o[m];return u}function Sr(o,u,m,T){m||(m={});for(var J=-1,K=u.length;++J<K;){var ct=u[J],at=void 0;hs(m,ct,at===void 0?o[ct]:at)}return m}function eo(o,u){return Sr(o,Ie(o),u)}function no(o){return Vi(o,Or,Ie)}function mn(o,u){var m=o.__data__;return oo(u)?m[typeof u=="string"?"string":"hash"]:m.map}function he(o,u){var m=lt(o,u);return Zi(m)?m:void 0}var Ie=_r?ke(_r,Object):co,Be=Gi;(Pn&&Be(new Pn(new ArrayBuffer(1)))!=nt||dn&&Be(new dn)!=f||ue&&Be(ue.resolve())!=N||Un&&Be(new Un)!=E||Nr&&Be(new Nr)!=U)&&(Be=function(o){var u=Q.call(o),m=u==_?o.constructor:void 0,T=m?Ut(m):void 0;if(T)switch(T){case Ar:return nt;case pn:return f;case wr:return N;case Er:return E;case Tr:return U}return u});function ro(o){var u=o.length,m=o.constructor(u);return u&&typeof o[0]=="string"&&B.call(o,"index")&&(m.index=o.index,m.input=o.input),m}function ve(o){return typeof o.constructor=="function"&&!ps(o)?Ki(At(o)):{}}function so(o,u,m,T){var J=o.constructor;switch(u){case $:return Cr(o);case l:case c:return new J(+o);case nt:return gn(o,T);case ht:case st:case tt:case V:case p:case w:case y:case S:case O:return Ji(o,T);case f:return ds(o,T,m);case b:case C:return new J(o);case A:return fs(o);case E:return Yi(o,T,m);case q:return Qi(o)}}function io(o,u){return u=u??s,!!u&&(typeof o=="number"||R.test(o))&&o>-1&&o%1==0&&o<u}function oo(o){var u=typeof o;return u=="string"||u=="number"||u=="symbol"||u=="boolean"?o!=="__proto__":o===null}function ao(o){return!!qe&&qe in o}function ps(o){var u=o&&o.constructor,m=typeof u=="function"&&u.prototype||ze;return o===m}function Ut(o){if(o!=null){try{return We.call(o)}catch{}try{return o+""}catch{}}return""}function gs(o){return Lr(o,!0,!0)}function ms(o,u){return o===u||o!==o&&u!==u}function zn(o){return lo(o)&&B.call(o,"callee")&&(!$n.call(o,"callee")||Q.call(o)==i)}var kr=Array.isArray;function Wn(o){return o!=null&&ys(o.length)&&!qr(o)}function lo(o){return vs(o)&&Wn(o)}var bs=Mn||uo;function qr(o){var u=_e(o)?Q.call(o):"";return u==g||u==v}function ys(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=s}function _e(o){var u=typeof o;return!!o&&(u=="object"||u=="function")}function vs(o){return!!o&&typeof o=="object"}function Or(o){return Wn(o)?Hn(o):Xi(o)}function co(){return[]}function uo(){return!1}r.exports=gs})(sr,sr.exports)),sr.exports}var ir={exports:{}};ir.exports;var Wa;function Ka(){return Wa||(Wa=1,(function(r,t){var e=200,n="__lodash_hash_undefined__",s=1,i=2,a=9007199254740991,l="[object Arguments]",c="[object Array]",h="[object AsyncFunction]",g="[object Boolean]",v="[object Date]",f="[object Error]",b="[object Function]",_="[object GeneratorFunction]",N="[object Map]",A="[object Number]",E="[object Null]",C="[object Object]",q="[object Promise]",U="[object Proxy]",$="[object RegExp]",nt="[object Set]",ht="[object String]",st="[object Symbol]",tt="[object Undefined]",V="[object WeakMap]",p="[object ArrayBuffer]",w="[object DataView]",y="[object Float32Array]",S="[object Float64Array]",O="[object Int8Array]",L="[object Int16Array]",I="[object Int32Array]",M="[object Uint8Array]",R="[object Uint8ClampedArray]",j="[object Uint16Array]",G="[object Uint32Array]",Z=/[\\^$.*+?()[\]{}|]/g,et=/^\[object .+?Constructor\]$/,rt=/^(?:0|[1-9]\d*)$/,W={};W[y]=W[S]=W[O]=W[L]=W[I]=W[M]=W[R]=W[j]=W[G]=!0,W[l]=W[c]=W[p]=W[g]=W[w]=W[v]=W[f]=W[b]=W[N]=W[A]=W[C]=W[$]=W[nt]=W[ht]=W[V]=!1;var gt=typeof Ue=="object"&&Ue&&Ue.Object===Object&&Ue,yt=typeof self=="object"&&self&&self.Object===Object&&self,X=gt||yt||Function("return this")(),it=t&&!t.nodeType&&t,Y=it&&!0&&r&&!r.nodeType&&r,ot=Y&&Y.exports===it,ut=ot&&gt.process,lt=(function(){try{return ut&&ut.binding&&ut.binding("util")}catch{}})(),Nt=lt&&lt.isTypedArray;function xt(o,u){for(var m=-1,T=o==null?0:o.length,J=0,K=[];++m<T;){var ct=o[m];u(ct,m,o)&&(K[J++]=ct)}return K}function ke(o,u){for(var m=-1,T=u.length,J=o.length;++m<T;)o[J+m]=u[m];return o}function un(o,u){for(var m=-1,T=o==null?0:o.length;++m<T;)if(u(o[m],m,o))return!0;return!1}function yr(o,u){for(var m=-1,T=Array(o);++m<o;)T[m]=u(m);return T}function vr(o){return function(u){return o(u)}}function ze(o,u){return o.has(u)}function hn(o,u){return o==null?void 0:o[u]}function qe(o){var u=-1,m=Array(o.size);return o.forEach(function(T,J){m[++u]=[J,T]}),m}function We(o,u){return function(m){return o(u(m))}}function B(o){var u=-1,m=Array(o.size);return o.forEach(function(T){m[++u]=T}),m}var Q=Array.prototype,dt=Function.prototype,mt=Object.prototype,Pt=X["__core-js_shared__"],Jt=dt.toString,At=mt.hasOwnProperty,Dn=(function(){var o=/[^.]+$/.exec(Pt&&Pt.keys&&Pt.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""})(),$n=mt.toString,Li=RegExp("^"+Jt.call(At).replace(Z,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),_r=ot?X.Buffer:void 0,Mn=X.Symbol,ls=X.Uint8Array,Pn=mt.propertyIsEnumerable,dn=Q.splice,ue=Mn?Mn.toStringTag:void 0,Un=Object.getOwnPropertySymbols,Nr=_r?_r.isBuffer:void 0,fn=We(Object.keys,Object),Ar=Ie(X,"DataView"),pn=Ie(X,"Map"),wr=Ie(X,"Promise"),Er=Ie(X,"Set"),Tr=Ie(X,"WeakMap"),Ke=Ie(Object,"create"),cs=Ut(Ar),Oe=Ut(pn),Ci=Ut(wr),Si=Ut(Er),ki=Ut(Tr),us=Mn?Mn.prototype:void 0,xr=us?us.valueOf:void 0;function kt(o){var u=-1,m=o==null?0:o.length;for(this.clear();++u<m;){var T=o[u];this.set(T[0],T[1])}}function qi(){this.__data__=Ke?Ke(null):{},this.size=0}function Oi(o){var u=this.has(o)&&delete this.__data__[o];return this.size-=u?1:0,u}function Ii(o){var u=this.__data__;if(Ke){var m=u[o];return m===n?void 0:m}return At.call(u,o)?u[o]:void 0}function Bi(o){var u=this.__data__;return Ke?u[o]!==void 0:At.call(u,o)}function ji(o,u){var m=this.__data__;return this.size+=this.has(o)?0:1,m[o]=Ke&&u===void 0?n:u,this}kt.prototype.clear=qi,kt.prototype.delete=Oi,kt.prototype.get=Ii,kt.prototype.has=Bi,kt.prototype.set=ji;function Bt(o){var u=-1,m=o==null?0:o.length;for(this.clear();++u<m;){var T=o[u];this.set(T[0],T[1])}}function Di(){this.__data__=[],this.size=0}function $i(o){var u=this.__data__,m=Fn(u,o);if(m<0)return!1;var T=u.length-1;return m==T?u.pop():dn.call(u,m,1),--this.size,!0}function Mi(o){var u=this.__data__,m=Fn(u,o);return m<0?void 0:u[m][1]}function Pi(o){return Fn(this.__data__,o)>-1}function Ui(o,u){var m=this.__data__,T=Fn(m,o);return T<0?(++this.size,m.push([o,u])):m[T][1]=u,this}Bt.prototype.clear=Di,Bt.prototype.delete=$i,Bt.prototype.get=Mi,Bt.prototype.has=Pi,Bt.prototype.set=Ui;function zt(o){var u=-1,m=o==null?0:o.length;for(this.clear();++u<m;){var T=o[u];this.set(T[0],T[1])}}function Hi(){this.size=0,this.__data__={hash:new kt,map:new(pn||Bt),string:new kt}}function Ri(o){var u=he(this,o).delete(o);return this.size-=u?1:0,u}function Fi(o){return he(this,o).get(o)}function zi(o){return he(this,o).has(o)}function Wi(o,u){var m=he(this,o),T=m.size;return m.set(o,u),this.size+=m.size==T?0:1,this}zt.prototype.clear=Hi,zt.prototype.delete=Ri,zt.prototype.get=Fi,zt.prototype.has=zi,zt.prototype.set=Wi;function Hn(o){var u=-1,m=o==null?0:o.length;for(this.__data__=new zt;++u<m;)this.add(o[u])}function hs(o){return this.__data__.set(o,n),this}function Rn(o){return this.__data__.has(o)}Hn.prototype.add=Hn.prototype.push=hs,Hn.prototype.has=Rn;function ye(o){var u=this.__data__=new Bt(o);this.size=u.size}function Lr(){this.__data__=new Bt,this.size=0}function Ki(o){var u=this.__data__,m=u.delete(o);return this.size=u.size,m}function Vi(o){return this.__data__.get(o)}function Gi(o){return this.__data__.has(o)}function Zi(o,u){var m=this.__data__;if(m instanceof Bt){var T=m.__data__;if(!pn||T.length<e-1)return T.push([o,u]),this.size=++m.size,this;m=this.__data__=new zt(T)}return m.set(o,u),this.size=m.size,this}ye.prototype.clear=Lr,ye.prototype.delete=Ki,ye.prototype.get=Vi,ye.prototype.has=Gi,ye.prototype.set=Zi;function Xi(o,u){var m=zn(o),T=!m&&ms(o),J=!m&&!T&&Wn(o),K=!m&&!T&&!J&&vs(o),ct=m||T||J||K,at=ct?yr(o.length,String):[],Et=at.length;for(var ft in o)At.call(o,ft)&&!(ct&&(ft=="length"||J&&(ft=="offset"||ft=="parent")||K&&(ft=="buffer"||ft=="byteLength"||ft=="byteOffset")||so(ft,Et)))&&at.push(ft);return at}function Fn(o,u){for(var m=o.length;m--;)if(gs(o[m][0],u))return m;return-1}function Cr(o,u,m){var T=u(o);return zn(o)?T:ke(T,m(o))}function gn(o){return o==null?o===void 0?tt:E:ue&&ue in Object(o)?Be(o):ps(o)}function ds(o){return _e(o)&&gn(o)==l}function fs(o,u,m,T,J){return o===u?!0:o==null||u==null||!_e(o)&&!_e(u)?o!==o&&u!==u:Yi(o,u,m,T,fs,J)}function Yi(o,u,m,T,J,K){var ct=zn(o),at=zn(u),Et=ct?c:ve(o),ft=at?c:ve(u);Et=Et==l?C:Et,ft=ft==l?C:ft;var jt=Et==C,Wt=ft==C,Lt=Et==ft;if(Lt&&Wn(o)){if(!Wn(u))return!1;ct=!0,jt=!1}if(Lt&&!jt)return K||(K=new ye),ct||vs(o)?Sr(o,u,m,T,J,K):eo(o,u,Et,m,T,J,K);if(!(m&s)){var Dt=jt&&At.call(o,"__wrapped__"),qt=Wt&&At.call(u,"__wrapped__");if(Dt||qt){var Ve=Dt?o.value():o,je=qt?u.value():u;return K||(K=new ye),J(Ve,je,m,T,K)}}return Lt?(K||(K=new ye),no(o,u,m,T,J,K)):!1}function Qi(o){if(!ys(o)||oo(o))return!1;var u=bs(o)?Li:et;return u.test(Ut(o))}function Ji(o){return _e(o)&&qr(o.length)&&!!W[gn(o)]}function to(o){if(!ao(o))return fn(o);var u=[];for(var m in Object(o))At.call(o,m)&&m!="constructor"&&u.push(m);return u}function Sr(o,u,m,T,J,K){var ct=m&s,at=o.length,Et=u.length;if(at!=Et&&!(ct&&Et>at))return!1;var ft=K.get(o);if(ft&&K.get(u))return ft==u;var jt=-1,Wt=!0,Lt=m&i?new Hn:void 0;for(K.set(o,u),K.set(u,o);++jt<at;){var Dt=o[jt],qt=u[jt];if(T)var Ve=ct?T(qt,Dt,jt,u,o,K):T(Dt,qt,jt,o,u,K);if(Ve!==void 0){if(Ve)continue;Wt=!1;break}if(Lt){if(!un(u,function(je,bn){if(!ze(Lt,bn)&&(Dt===je||J(Dt,je,m,T,K)))return Lt.push(bn)})){Wt=!1;break}}else if(!(Dt===qt||J(Dt,qt,m,T,K))){Wt=!1;break}}return K.delete(o),K.delete(u),Wt}function eo(o,u,m,T,J,K,ct){switch(m){case w:if(o.byteLength!=u.byteLength||o.byteOffset!=u.byteOffset)return!1;o=o.buffer,u=u.buffer;case p:return!(o.byteLength!=u.byteLength||!K(new ls(o),new ls(u)));case g:case v:case A:return gs(+o,+u);case f:return o.name==u.name&&o.message==u.message;case $:case ht:return o==u+"";case N:var at=qe;case nt:var Et=T&s;if(at||(at=B),o.size!=u.size&&!Et)return!1;var ft=ct.get(o);if(ft)return ft==u;T|=i,ct.set(o,u);var jt=Sr(at(o),at(u),T,J,K,ct);return ct.delete(o),jt;case st:if(xr)return xr.call(o)==xr.call(u)}return!1}function no(o,u,m,T,J,K){var ct=m&s,at=mn(o),Et=at.length,ft=mn(u),jt=ft.length;if(Et!=jt&&!ct)return!1;for(var Wt=Et;Wt--;){var Lt=at[Wt];if(!(ct?Lt in u:At.call(u,Lt)))return!1}var Dt=K.get(o);if(Dt&&K.get(u))return Dt==u;var qt=!0;K.set(o,u),K.set(u,o);for(var Ve=ct;++Wt<Et;){Lt=at[Wt];var je=o[Lt],bn=u[Lt];if(T)var Gl=ct?T(bn,je,Lt,u,o,K):T(je,bn,Lt,o,u,K);if(!(Gl===void 0?je===bn||J(je,bn,m,T,K):Gl)){qt=!1;break}Ve||(Ve=Lt=="constructor")}if(qt&&!Ve){var _s=o.constructor,Ns=u.constructor;_s!=Ns&&"constructor"in o&&"constructor"in u&&!(typeof _s=="function"&&_s instanceof _s&&typeof Ns=="function"&&Ns instanceof Ns)&&(qt=!1)}return K.delete(o),K.delete(u),qt}function mn(o){return Cr(o,Or,ro)}function he(o,u){var m=o.__data__;return io(u)?m[typeof u=="string"?"string":"hash"]:m.map}function Ie(o,u){var m=hn(o,u);return Qi(m)?m:void 0}function Be(o){var u=At.call(o,ue),m=o[ue];try{o[ue]=void 0;var T=!0}catch{}var J=$n.call(o);return T&&(u?o[ue]=m:delete o[ue]),J}var ro=Un?function(o){return o==null?[]:(o=Object(o),xt(Un(o),function(u){return Pn.call(o,u)}))}:co,ve=gn;(Ar&&ve(new Ar(new ArrayBuffer(1)))!=w||pn&&ve(new pn)!=N||wr&&ve(wr.resolve())!=q||Er&&ve(new Er)!=nt||Tr&&ve(new Tr)!=V)&&(ve=function(o){var u=gn(o),m=u==C?o.constructor:void 0,T=m?Ut(m):"";if(T)switch(T){case cs:return w;case Oe:return N;case Ci:return q;case Si:return nt;case ki:return V}return u});function so(o,u){return u=u??a,!!u&&(typeof o=="number"||rt.test(o))&&o>-1&&o%1==0&&o<u}function io(o){var u=typeof o;return u=="string"||u=="number"||u=="symbol"||u=="boolean"?o!=="__proto__":o===null}function oo(o){return!!Dn&&Dn in o}function ao(o){var u=o&&o.constructor,m=typeof u=="function"&&u.prototype||mt;return o===m}function ps(o){return $n.call(o)}function Ut(o){if(o!=null){try{return Jt.call(o)}catch{}try{return o+""}catch{}}return""}function gs(o,u){return o===u||o!==o&&u!==u}var ms=ds((function(){return arguments})())?ds:function(o){return _e(o)&&At.call(o,"callee")&&!Pn.call(o,"callee")},zn=Array.isArray;function kr(o){return o!=null&&qr(o.length)&&!bs(o)}var Wn=Nr||uo;function lo(o,u){return fs(o,u)}function bs(o){if(!ys(o))return!1;var u=gn(o);return u==b||u==_||u==h||u==U}function qr(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=a}function ys(o){var u=typeof o;return o!=null&&(u=="object"||u=="function")}function _e(o){return o!=null&&typeof o=="object"}var vs=Nt?vr(Nt):Ji;function Or(o){return kr(o)?Xi(o):to(o)}function co(){return[]}function uo(){return!1}r.exports=lo})(ir,ir.exports)),ir.exports}var Zr={},Va;function Pp(){if(Va)return Zr;Va=1,Object.defineProperty(Zr,"__esModule",{value:!0});const r=za(),t=Ka();var e;return(function(n){function s(c={},h={},g=!1){typeof c!="object"&&(c={}),typeof h!="object"&&(h={});let v=r(h);g||(v=Object.keys(v).reduce((f,b)=>(v[b]!=null&&(f[b]=v[b]),f),{}));for(const f in c)c[f]!==void 0&&h[f]===void 0&&(v[f]=c[f]);return Object.keys(v).length>0?v:void 0}n.compose=s;function i(c={},h={}){typeof c!="object"&&(c={}),typeof h!="object"&&(h={});const g=Object.keys(c).concat(Object.keys(h)).reduce((v,f)=>(t(c[f],h[f])||(v[f]=h[f]===void 0?null:h[f]),v),{});return Object.keys(g).length>0?g:void 0}n.diff=i;function a(c={},h={}){c=c||{};const g=Object.keys(h).reduce((v,f)=>(h[f]!==c[f]&&c[f]!==void 0&&(v[f]=h[f]),v),{});return Object.keys(c).reduce((v,f)=>(c[f]!==h[f]&&h[f]===void 0&&(v[f]=null),v),g)}n.invert=a;function l(c,h,g=!1){if(typeof c!="object")return h;if(typeof h!="object")return;if(!g)return h;const v=Object.keys(h).reduce((f,b)=>(c[b]===void 0&&(f[b]=h[b]),f),{});return Object.keys(v).length>0?v:void 0}n.transform=l})(e||(e={})),Zr.default=e,Zr}var Xr={},Ga;function Za(){if(Ga)return Xr;Ga=1,Object.defineProperty(Xr,"__esModule",{value:!0});var r;return(function(t){function e(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}t.length=e})(r||(r={})),Xr.default=r,Xr}var Yr={},Xa;function Up(){if(Xa)return Yr;Xa=1,Object.defineProperty(Yr,"__esModule",{value:!0});const r=Za();class t{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,a=r.default.length(s);if(n>=a-i?(n=a-i,this.index+=1,this.offset=0):this.offset+=n,typeof s.delete=="number")return{delete:n};{const l={};return s.attributes&&(l.attributes=s.attributes),typeof s.retain=="number"?l.retain=n:typeof s.retain=="object"&&s.retain!==null?l.retain=s.retain:typeof s.insert=="string"?l.insert=s.insert.substr(i,n):l.insert=s.insert,l}}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(),a=this.ops.slice(this.index);return this.offset=n,this.index=s,[i].concat(a)}}else return[]}}return Yr.default=t,Yr}var Ya;function Hp(){return Ya||(Ya=1,(function(r,t){Object.defineProperty(t,"__esModule",{value:!0}),t.AttributeMap=t.OpIterator=t.Op=void 0;const e=Mp(),n=za(),s=Ka(),i=Pp();t.AttributeMap=i.default;const a=Za();t.Op=a.default;const l=Up();t.OpIterator=l.default;const c="\0",h=(v,f)=>{if(typeof v!="object"||v===null)throw new Error(`cannot retain a ${typeof v}`);if(typeof f!="object"||f===null)throw new Error(`cannot retain a ${typeof f}`);const b=Object.keys(v)[0];if(!b||b!==Object.keys(f)[0])throw new Error(`embed types not matched: ${b} != ${Object.keys(f)[0]}`);return[b,v[b],f[b]]};class g{constructor(f){Array.isArray(f)?this.ops=f:f!=null&&Array.isArray(f.ops)?this.ops=f.ops:this.ops=[]}static registerEmbed(f,b){this.handlers[f]=b}static unregisterEmbed(f){delete this.handlers[f]}static getHandler(f){const b=this.handlers[f];if(!b)throw new Error(`no handlers for embed type "${f}"`);return b}insert(f,b){const _={};return typeof f=="string"&&f.length===0?this:(_.insert=f,b!=null&&typeof b=="object"&&Object.keys(b).length>0&&(_.attributes=b),this.push(_))}delete(f){return f<=0?this:this.push({delete:f})}retain(f,b){if(typeof f=="number"&&f<=0)return this;const _={retain:f};return b!=null&&typeof b=="object"&&Object.keys(b).length>0&&(_.attributes=b),this.push(_)}push(f){let b=this.ops.length,_=this.ops[b-1];if(f=n(f),typeof _=="object"){if(typeof f.delete=="number"&&typeof _.delete=="number")return this.ops[b-1]={delete:_.delete+f.delete},this;if(typeof _.delete=="number"&&f.insert!=null&&(b-=1,_=this.ops[b-1],typeof _!="object"))return this.ops.unshift(f),this;if(s(f.attributes,_.attributes)){if(typeof f.insert=="string"&&typeof _.insert=="string")return this.ops[b-1]={insert:_.insert+f.insert},typeof f.attributes=="object"&&(this.ops[b-1].attributes=f.attributes),this;if(typeof f.retain=="number"&&typeof _.retain=="number")return this.ops[b-1]={retain:_.retain+f.retain},typeof f.attributes=="object"&&(this.ops[b-1].attributes=f.attributes),this}}return b===this.ops.length?this.ops.push(f):this.ops.splice(b,0,f),this}chop(){const f=this.ops[this.ops.length-1];return f&&typeof f.retain=="number"&&!f.attributes&&this.ops.pop(),this}filter(f){return this.ops.filter(f)}forEach(f){this.ops.forEach(f)}map(f){return this.ops.map(f)}partition(f){const b=[],_=[];return this.forEach(N=>{(f(N)?b:_).push(N)}),[b,_]}reduce(f,b){return this.ops.reduce(f,b)}changeLength(){return this.reduce((f,b)=>b.insert?f+a.default.length(b):b.delete?f-b.delete:f,0)}length(){return this.reduce((f,b)=>f+a.default.length(b),0)}slice(f=0,b=1/0){const _=[],N=new l.default(this.ops);let A=0;for(;A<b&&N.hasNext();){let E;A<f?E=N.next(f-A):(E=N.next(b-A),_.push(E)),A+=a.default.length(E)}return new g(_)}compose(f){const b=new l.default(this.ops),_=new l.default(f.ops),N=[],A=_.peek();if(A!=null&&typeof A.retain=="number"&&A.attributes==null){let C=A.retain;for(;b.peekType()==="insert"&&b.peekLength()<=C;)C-=b.peekLength(),N.push(b.next());A.retain-C>0&&_.next(A.retain-C)}const E=new g(N);for(;b.hasNext()||_.hasNext();)if(_.peekType()==="insert")E.push(_.next());else if(b.peekType()==="delete")E.push(b.next());else{const C=Math.min(b.peekLength(),_.peekLength()),q=b.next(C),U=_.next(C);if(U.retain){const $={};if(typeof q.retain=="number")$.retain=typeof U.retain=="number"?C:U.retain;else if(typeof U.retain=="number")q.retain==null?$.insert=q.insert:$.retain=q.retain;else{const ht=q.retain==null?"insert":"retain",[st,tt,V]=h(q[ht],U.retain),p=g.getHandler(st);$[ht]={[st]:p.compose(tt,V,ht==="retain")}}const nt=i.default.compose(q.attributes,U.attributes,typeof q.retain=="number");if(nt&&($.attributes=nt),E.push($),!_.hasNext()&&s(E.ops[E.ops.length-1],$)){const ht=new g(b.rest());return E.concat(ht).chop()}}else typeof U.delete=="number"&&(typeof q.retain=="number"||typeof q.retain=="object"&&q.retain!==null)&&E.push(U)}return E.chop()}concat(f){const b=new g(this.ops.slice());return f.ops.length>0&&(b.push(f.ops[0]),b.ops=b.ops.concat(f.ops.slice(1))),b}diff(f,b){if(this.ops===f.ops)return new g;const _=[this,f].map(q=>q.map(U=>{if(U.insert!=null)return typeof U.insert=="string"?U.insert:c;const $=q===f?"on":"with";throw new Error("diff() called "+$+" non-document")}).join("")),N=new g,A=e(_[0],_[1],b,!0),E=new l.default(this.ops),C=new l.default(f.ops);return A.forEach(q=>{let U=q[1].length;for(;U>0;){let $=0;switch(q[0]){case e.INSERT:$=Math.min(C.peekLength(),U),N.push(C.next($));break;case e.DELETE:$=Math.min(U,E.peekLength()),E.next($),N.delete($);break;case e.EQUAL:$=Math.min(E.peekLength(),C.peekLength(),U);const nt=E.next($),ht=C.next($);s(nt.insert,ht.insert)?N.retain($,i.default.diff(nt.attributes,ht.attributes)):N.push(ht).delete($);break}U-=$}}),N.chop()}eachLine(f,b=`
2
+ `){const _=new l.default(this.ops);let N=new g,A=0;for(;_.hasNext();){if(_.peekType()!=="insert")return;const E=_.peek(),C=a.default.length(E)-_.peekLength(),q=typeof E.insert=="string"?E.insert.indexOf(b,C)-C:-1;if(q<0)N.push(_.next());else if(q>0)N.push(_.next(q));else{if(f(N,_.next(1).attributes||{},A)===!1)return;A+=1,N=new g}}N.length()>0&&f(N,{},A)}invert(f){const b=new g;return this.reduce((_,N)=>{if(N.insert)b.delete(a.default.length(N));else{if(typeof N.retain=="number"&&N.attributes==null)return b.retain(N.retain),_+N.retain;if(N.delete||typeof N.retain=="number"){const A=N.delete||N.retain;return f.slice(_,_+A).forEach(C=>{N.delete?b.push(C):N.retain&&N.attributes&&b.retain(a.default.length(C),i.default.invert(N.attributes,C.attributes))}),_+A}else if(typeof N.retain=="object"&&N.retain!==null){const A=f.slice(_,_+1),E=new l.default(A.ops).next(),[C,q,U]=h(N.retain,E.insert),$=g.getHandler(C);return b.retain({[C]:$.invert(q,U)},i.default.invert(N.attributes,E.attributes)),_+1}}return _},0),b.chop()}transform(f,b=!1){if(b=!!b,typeof f=="number")return this.transformPosition(f,b);const _=f,N=new l.default(this.ops),A=new l.default(_.ops),E=new g;for(;N.hasNext()||A.hasNext();)if(N.peekType()==="insert"&&(b||A.peekType()!=="insert"))E.retain(a.default.length(N.next()));else if(A.peekType()==="insert")E.push(A.next());else{const C=Math.min(N.peekLength(),A.peekLength()),q=N.next(C),U=A.next(C);if(q.delete)continue;if(U.delete)E.push(U);else{const $=q.retain,nt=U.retain;let ht=typeof nt=="object"&&nt!==null?nt:C;if(typeof $=="object"&&$!==null&&typeof nt=="object"&&nt!==null){const st=Object.keys($)[0];if(st===Object.keys(nt)[0]){const tt=g.getHandler(st);tt&&(ht={[st]:tt.transform($[st],nt[st],b)})}}E.retain(ht,i.default.transform(q.attributes,U.attributes,b))}}return E.chop()}transformPosition(f,b=!1){b=!!b;const _=new l.default(this.ops);let N=0;for(;_.hasNext()&&N<=f;){const A=_.peekLength(),E=_.peekType();if(_.next(),E==="delete"){f-=Math.min(A,f-N);continue}else E==="insert"&&(N<f||!b)&&(f+=A);N+=A}return f}}g.Op=a.default,g.OpIterator=l.default,g.AttributeMap=i.default,g.handlers={},t.default=g,r.exports=g,r.exports.default=g})(Gr,Gr.exports)),Gr.exports}var Mt=Hp();const H=Ha(Mt);class ie extends Vt{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return""}}ie.blotName="break",ie.tagName="BR";let oe=class extends Vr{};const Rp={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Qr(r){return r.replace(/[&<>"']/g,t=>Rp[t])}const be=class be extends Ks{static compare(t,e){const n=be.order.indexOf(t),s=be.order.indexOf(e);return n>=0||s>=0?n-s:t===e?0:t<e?-1:1}formatAt(t,e,n,s){if(be.compare(this.statics.blotName,n)<0&&this.scroll.query(n,F.BLOT)){const i=this.isolate(t,e);s&&i.wrap(n,s)}else super.formatAt(t,e,n,s)}optimize(t){if(super.optimize(t),this.parent instanceof be&&be.compare(this.statics.blotName,this.parent.statics.blotName)>0){const e=this.parent.isolate(this.offset(),this.length());this.moveChildren(e),e.wrap(this)}}};D(be,"allowedChildren",[be,ie,Vt,oe]),D(be,"order",["cursor","inline","link","underline","strike","italic","bold","script","code"]);let ge=be;const Qa=1;class St extends rr{constructor(){super(...arguments);D(this,"cache",{})}delta(){return this.cache.delta==null&&(this.cache.delta=Ja(this)),this.cache.delta}deleteAt(e,n){super.deleteAt(e,n),this.cache={}}formatAt(e,n,s,i){n<=0||(this.scroll.query(s,F.BLOCK)?e+n===this.length()&&this.format(s,i):super.formatAt(e,Math.min(n,this.length()-e-1),s,i),this.cache={})}insertAt(e,n,s){if(s!=null){super.insertAt(e,n,s),this.cache={};return}if(n.length===0)return;const i=n.split(`
3
+ `),a=i.shift();a.length>0&&(e<this.length()-1||this.children.tail==null?super.insertAt(Math.min(e,this.length()-1),a):this.children.tail.insertAt(this.children.tail.length(),a),this.cache={});let l=this;i.reduce((c,h)=>(l=l.split(c,!0),l.insertAt(0,h),h.length),e+a.length)}insertBefore(e,n){const{head:s}=this.children;super.insertBefore(e,n),s instanceof ie&&s.remove(),this.cache={}}length(){return this.cache.length==null&&(this.cache.length=super.length()+Qa),this.cache.length}moveChildren(e,n){super.moveChildren(e,n),this.cache={}}optimize(e){super.optimize(e),this.cache={}}path(e){return super.path(e,!0)}removeChild(e){super.removeChild(e),this.cache={}}split(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(n&&(e===0||e>=this.length()-Qa)){const i=this.clone();return e===0?(this.parent.insertBefore(i,this),this):(this.parent.insertBefore(i,this.next),i)}const s=super.split(e,n);return this.cache={},s}}St.blotName="block",St.tagName="P",St.defaultChild=ie,St.allowedChildren=[ie,ge,Vt,oe];class Gt extends Vt{attach(){super.attach(),this.attributes=new Wr(this.domNode)}delta(){return new H().insert(this.value(),{...this.formats(),...this.attributes.values()})}format(t,e){const n=this.scroll.query(t,F.BLOCK_ATTRIBUTE);n!=null&&this.attributes.attribute(n,e)}formatAt(t,e,n,s){this.format(n,s)}insertAt(t,e,n){if(n!=null){super.insertAt(t,e,n);return}const s=e.split(`
4
+ `),i=s.pop(),a=s.map(c=>{const h=this.scroll.create(St.blotName);return h.insertAt(0,c),h}),l=this.split(t);a.forEach(c=>{this.parent.insertBefore(c,l)}),i&&this.parent.insertBefore(this.scroll.create("text",i),l)}}Gt.scope=F.BLOCK_BLOT;function Ja(r){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return r.descendants(Ot).reduce((e,n)=>n.length()===0?e:e.insert(n.value(),Zt(n,{},t)),new H).insert(`
5
+ `,Zt(r))}function Zt(r){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return r==null||("formats"in r&&typeof r.formats=="function"&&(t={...t,...r.formats()},e&&delete t["code-token"]),r.parent==null||r.parent.statics.blotName==="scroll"||r.parent.statics.scope!==r.statics.scope)?t:Zt(r.parent,t,e)}const Qt=class Qt extends Vt{static value(){}constructor(t,e,n){super(t,e),this.selection=n,this.textNode=document.createTextNode(Qt.CONTENTS),this.domNode.appendChild(this.textNode),this.savedLength=0}detach(){this.parent!=null&&this.parent.removeChild(this)}format(t,e){if(this.savedLength!==0){super.format(t,e);return}let n=this,s=0;for(;n!=null&&n.statics.scope!==F.BLOCK_BLOT;)s+=n.offset(n.parent),n=n.parent;n!=null&&(this.savedLength=Qt.CONTENTS.length,n.optimize(),n.formatAt(s,Qt.CONTENTS.length,t,e),this.savedLength=0)}index(t,e){return t===this.textNode?0:super.index(t,e)}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 t=this.selection.getNativeRange();for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);const e=this.prev instanceof oe?this.prev:null,n=e?e.length():0,s=this.next instanceof oe?this.next:null,i=s?s.text:"",{textNode:a}=this,l=a.data.split(Qt.CONTENTS).join("");a.data=Qt.CONTENTS;let c;if(e)c=e,(l||s)&&(e.insertAt(e.length(),l+i),s&&s.remove());else if(s)c=s,s.insertAt(0,l);else{const h=document.createTextNode(l);c=this.scroll.create(h),this.parent.insertBefore(c,this)}if(this.remove(),t){const h=(f,b)=>e&&f===e.domNode?b:f===a?n+b-1:s&&f===s.domNode?n+l.length+b:null,g=h(t.start.node,t.start.offset),v=h(t.end.node,t.end.offset);if(g!==null&&v!==null)return{startNode:c.domNode,startOffset:g,endNode:c.domNode,endOffset:v}}return null}update(t,e){if(t.some(n=>n.type==="characterData"&&n.target===this.textNode)){const n=this.restore();n&&(e.range=n)}}optimize(t){super.optimize(t);let{parent:e}=this;for(;e;){if(e.domNode.tagName==="A"){this.savedLength=Qt.CONTENTS.length,e.isolate(this.offset(e),this.length()).unwrap(),this.savedLength=0;break}e=e.parent}}value(){return""}};D(Qt,"blotName","cursor"),D(Qt,"className","ql-cursor"),D(Qt,"tagName","span"),D(Qt,"CONTENTS","\uFEFF");let kn=Qt;var Ys={exports:{}},tl;function Fp(){return tl||(tl=1,(function(r){var t=Object.prototype.hasOwnProperty,e="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(e=!1));function s(c,h,g){this.fn=c,this.context=h,this.once=g||!1}function i(c,h,g,v,f){if(typeof g!="function")throw new TypeError("The listener must be a function");var b=new s(g,v||c,f),_=e?e+h:h;return c._events[_]?c._events[_].fn?c._events[_]=[c._events[_],b]:c._events[_].push(b):(c._events[_]=b,c._eventsCount++),c}function a(c,h){--c._eventsCount===0?c._events=new n:delete c._events[h]}function l(){this._events=new n,this._eventsCount=0}l.prototype.eventNames=function(){var h=[],g,v;if(this._eventsCount===0)return h;for(v in g=this._events)t.call(g,v)&&h.push(e?v.slice(1):v);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(g)):h},l.prototype.listeners=function(h){var g=e?e+h:h,v=this._events[g];if(!v)return[];if(v.fn)return[v.fn];for(var f=0,b=v.length,_=new Array(b);f<b;f++)_[f]=v[f].fn;return _},l.prototype.listenerCount=function(h){var g=e?e+h:h,v=this._events[g];return v?v.fn?1:v.length:0},l.prototype.emit=function(h,g,v,f,b,_){var N=e?e+h:h;if(!this._events[N])return!1;var A=this._events[N],E=arguments.length,C,q;if(A.fn){switch(A.once&&this.removeListener(h,A.fn,void 0,!0),E){case 1:return A.fn.call(A.context),!0;case 2:return A.fn.call(A.context,g),!0;case 3:return A.fn.call(A.context,g,v),!0;case 4:return A.fn.call(A.context,g,v,f),!0;case 5:return A.fn.call(A.context,g,v,f,b),!0;case 6:return A.fn.call(A.context,g,v,f,b,_),!0}for(q=1,C=new Array(E-1);q<E;q++)C[q-1]=arguments[q];A.fn.apply(A.context,C)}else{var U=A.length,$;for(q=0;q<U;q++)switch(A[q].once&&this.removeListener(h,A[q].fn,void 0,!0),E){case 1:A[q].fn.call(A[q].context);break;case 2:A[q].fn.call(A[q].context,g);break;case 3:A[q].fn.call(A[q].context,g,v);break;case 4:A[q].fn.call(A[q].context,g,v,f);break;default:if(!C)for($=1,C=new Array(E-1);$<E;$++)C[$-1]=arguments[$];A[q].fn.apply(A[q].context,C)}}return!0},l.prototype.on=function(h,g,v){return i(this,h,g,v,!1)},l.prototype.once=function(h,g,v){return i(this,h,g,v,!0)},l.prototype.removeListener=function(h,g,v,f){var b=e?e+h:h;if(!this._events[b])return this;if(!g)return a(this,b),this;var _=this._events[b];if(_.fn)_.fn===g&&(!f||_.once)&&(!v||_.context===v)&&a(this,b);else{for(var N=0,A=[],E=_.length;N<E;N++)(_[N].fn!==g||f&&!_[N].once||v&&_[N].context!==v)&&A.push(_[N]);A.length?this._events[b]=A.length===1?A[0]:A:a(this,b)}return this},l.prototype.removeAllListeners=function(h){var g;return h?(g=e?e+h:h,this._events[g]&&a(this,g)):(this._events=new n,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=e,l.EventEmitter=l,r.exports=l})(Ys)),Ys.exports}var zp=Fp();const Wp=Ha(zp),Qs=new WeakMap,Js=["error","warn","log","info"];let ti="warn";function el(r){if(ti&&Js.indexOf(r)<=Js.indexOf(ti)){for(var t=arguments.length,e=new Array(t>1?t-1:0),n=1;n<t;n++)e[n-1]=arguments[n];console[r](...e)}}function xe(r){return Js.reduce((t,e)=>(t[e]=el.bind(console,e,r),t),{})}xe.level=r=>{ti=r},el.level=xe.level;const ei=xe("quill:events");["selectionchange","mousedown","mouseup","click"].forEach(r=>{document.addEventListener(r,function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];Array.from(document.querySelectorAll(".ql-container")).forEach(s=>{const i=Qs.get(s);i&&i.emitter&&i.emitter.handleDOM(...e)})})});class P extends Wp{constructor(){super(),this.domListeners={},this.on("error",ei.error)}emit(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return ei.log.call(ei,...e),super.emit(...e)}handleDOM(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),s=1;s<e;s++)n[s-1]=arguments[s];(this.domListeners[t.type]||[]).forEach(i=>{let{node:a,handler:l}=i;(t.target===a||a.contains(t.target))&&l(t,...n)})}listenDOM(t,e,n){this.domListeners[t]||(this.domListeners[t]=[]),this.domListeners[t].push({node:e,handler:n})}}D(P,"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"}),D(P,"sources",{API:"api",SILENT:"silent",USER:"user"});const ni=xe("quill:selection");class He{constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.index=t,this.length=e}}class Kp{constructor(t,e){this.emitter=e,this.scroll=t,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=this.scroll.create("cursor",this),this.savedRange=new He(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,P.sources.USER),1)}),this.emitter.on(P.events.SCROLL_BEFORE_UPDATE,()=>{if(!this.hasFocus())return;const n=this.getNativeRange();n!=null&&n.start.node!==this.cursor.textNode&&this.emitter.once(P.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 a=i.some(l=>l.type==="characterData"||l.type==="childList"||l.type==="attributes"&&l.target===this.root);this.update(a?P.sources.SILENT:s)}catch{}})}),this.emitter.on(P.events.SCROLL_OPTIMIZE,(n,s)=>{if(s.range){const{startNode:i,startOffset:a,endNode:l,endOffset:c}=s.range;this.setNativeRange(i,a,l,c),this.update(P.sources.SILENT)}}),this.update(P.sources.SILENT)}handleComposition(){this.emitter.on(P.events.COMPOSITION_BEFORE_START,()=>{this.composing=!0}),this.emitter.on(P.events.COMPOSITION_END,()=>{if(this.composing=!1,this.cursor.parent){const t=this.cursor.restore();if(!t)return;setTimeout(()=>{this.setNativeRange(t.startNode,t.startOffset,t.endNode,t.endOffset)},1)}})}handleDragging(){this.emitter.listenDOM("mousedown",document.body,()=>{this.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,()=>{this.mouseDown=!1,this.update(P.sources.USER)})}focus(){this.hasFocus()||(this.root.focus({preventScroll:!0}),this.setRange(this.savedRange))}format(t,e){this.scroll.update();const n=this.getNativeRange();if(!(n==null||!n.native.collapsed||this.scroll.query(t,F.BLOCK))){if(n.start.node!==this.cursor.textNode){const s=this.scroll.find(n.start.node,!1);if(s==null)return;if(s instanceof Ot){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(t,e),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}getBounds(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const n=this.scroll.length();t=Math.min(t,n-1),e=Math.min(t+e,n-1)-t;let s,[i,a]=this.scroll.leaf(t);if(i==null)return null;if(e>0&&a===i.length()){const[g]=this.scroll.leaf(t+1);if(g){const[v]=this.scroll.line(t),[f]=this.scroll.line(t+1);v===f&&(i=g,a=0)}}[s,a]=i.position(a,!0);const l=document.createRange();if(e>0)return l.setStart(s,a),[i,a]=this.scroll.leaf(t+e),i==null?null:([s,a]=i.position(a,!0),l.setEnd(s,a),l.getBoundingClientRect());let c="left",h;if(s instanceof Text){if(!s.data.length)return null;a<s.data.length?(l.setStart(s,a),l.setEnd(s,a+1)):(l.setStart(s,a-1),l.setEnd(s,a),c="right"),h=l.getBoundingClientRect()}else{if(!(i.domNode instanceof Element))return null;h=i.domNode.getBoundingClientRect(),a>0&&(c="right")}return{bottom:h.top+h.height,height:h.height,left:h[c],right:h[c],top:h.top,width:0}}getNativeRange(){const t=document.getSelection();if(t==null||t.rangeCount<=0)return null;const e=t.getRangeAt(0);if(e==null)return null;const n=this.normalizeNative(e);return ni.info("getNativeRange",n),n}getRange(){const t=this.scroll.domNode;if("isConnected"in t&&!t.isConnected)return[null,null];const e=this.getNativeRange();return e==null?[null,null]:[this.normalizedToRange(e),e]}hasFocus(){return document.activeElement===this.root||document.activeElement!=null&&ri(this.root,document.activeElement)}normalizedToRange(t){const e=[[t.start.node,t.start.offset]];t.native.collapsed||e.push([t.end.node,t.end.offset]);const n=e.map(a=>{const[l,c]=a,h=this.scroll.find(l,!0),g=h.offset(this.scroll);return c===0?g:h instanceof Ot?g+h.index(l,c):g+h.length()}),s=Math.min(Math.max(...n),this.scroll.length()-1),i=Math.min(s,...n);return new He(i,s-i)}normalizeNative(t){if(!ri(this.root,t.startContainer)||!t.collapsed&&!ri(this.root,t.endContainer))return null;const e={start:{node:t.startContainer,offset:t.startOffset},end:{node:t.endContainer,offset:t.endOffset},native:t};return[e.start,e.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}),e}rangeToNative(t){const e=this.scroll.length(),n=(s,i)=>{s=Math.min(e-1,s);const[a,l]=this.scroll.leaf(s);return a?a.position(l,i):[null,-1]};return[...n(t.index,!1),...n(t.index+t.length,!0)]}setNativeRange(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:e,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(ni.info("setNativeRange",t,e,n,s),t!=null&&(this.root.parentNode==null||t.parentNode==null||n.parentNode==null))return;const a=document.getSelection();if(a!=null)if(t!=null){this.hasFocus()||this.root.focus({preventScroll:!0});const{native:l}=this.getNativeRange()||{};if(l==null||i||t!==l.startContainer||e!==l.startOffset||n!==l.endContainer||s!==l.endOffset){t instanceof Element&&t.tagName==="BR"&&(e=Array.from(t.parentNode.childNodes).indexOf(t),t=t.parentNode),n instanceof Element&&n.tagName==="BR"&&(s=Array.from(n.parentNode.childNodes).indexOf(n),n=n.parentNode);const c=document.createRange();c.setStart(t,e),c.setEnd(n,s),a.removeAllRanges(),a.addRange(c)}}else a.removeAllRanges(),this.root.blur()}setRange(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:P.sources.API;if(typeof e=="string"&&(n=e,e=!1),ni.info("setRange",t),t!=null){const s=this.rangeToNative(t);this.setNativeRange(...s,e)}else this.setNativeRange(null);this.update(n)}update(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:P.sources.USER;const e=this.lastRange,[n,s]=this.getRange();if(this.lastRange=n,this.lastNative=s,this.lastRange!=null&&(this.savedRange=this.lastRange),!zs(e,this.lastRange)){if(!this.composing&&s!=null&&s.native.collapsed&&s.start.node!==this.cursor.textNode){const a=this.cursor.restore();a&&this.setNativeRange(a.startNode,a.startOffset,a.endNode,a.endOffset)}const i=[P.events.SELECTION_CHANGE,En(this.lastRange),En(e),t];this.emitter.emit(P.events.EDITOR_CHANGE,...i),t!==P.sources.SILENT&&this.emitter.emit(...i)}}}function ri(r,t){try{t.parentNode}catch{return!1}return r.contains(t)}const Vp=/^[ -~]*$/;class Gp{constructor(t){this.scroll=t,this.delta=this.getDelta()}applyDelta(t){this.scroll.update();let e=this.scroll.length();this.scroll.batchStart();const n=nl(t),s=new H;return Xp(n.ops.slice()).reduce((a,l)=>{const c=Mt.Op.length(l);let h=l.attributes||{},g=!1,v=!1;if(l.insert!=null){if(s.retain(c),typeof l.insert=="string"){const _=l.insert;v=!_.endsWith(`
6
+ `)&&(e<=a||!!this.scroll.descendant(Gt,a)[0]),this.scroll.insertAt(a,_);const[N,A]=this.scroll.line(a);let E=Me({},Zt(N));if(N instanceof St){const[C]=N.descendant(Ot,A);C&&(E=Me(E,Zt(C)))}h=Mt.AttributeMap.diff(E,h)||{}}else if(typeof l.insert=="object"){const _=Object.keys(l.insert)[0];if(_==null)return a;const N=this.scroll.query(_,F.INLINE)!=null;if(N)(e<=a||this.scroll.descendant(Gt,a)[0])&&(v=!0);else if(a>0){const[A,E]=this.scroll.descendant(Ot,a-1);A instanceof oe?A.value()[E]!==`
7
+ `&&(g=!0):A instanceof Vt&&A.statics.scope===F.INLINE_BLOT&&(g=!0)}if(this.scroll.insertAt(a,_,l.insert[_]),N){const[A]=this.scroll.descendant(Ot,a);if(A){const E=Me({},Zt(A));h=Mt.AttributeMap.diff(E,h)||{}}}}e+=c}else if(s.push(l),l.retain!==null&&typeof l.retain=="object"){const _=Object.keys(l.retain)[0];if(_==null)return a;this.scroll.updateEmbedAt(a,_,l.retain[_])}Object.keys(h).forEach(_=>{this.scroll.formatAt(a,c,_,h[_])});const f=g?1:0,b=v?1:0;return e+=f+b,s.retain(f),s.delete(b),a+c+f+b},0),s.reduce((a,l)=>typeof l.delete=="number"?(this.scroll.deleteAt(a,l.delete),a):a+Mt.Op.length(l),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(n)}deleteText(t,e){return this.scroll.deleteAt(t,e),this.update(new H().retain(t).delete(e))}formatLine(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.scroll.update(),Object.keys(n).forEach(i=>{this.scroll.lines(t,Math.max(e,1)).forEach(a=>{a.format(i,n[i])})}),this.scroll.optimize();const s=new H().retain(t).retain(e,En(n));return this.update(s)}formatText(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.keys(n).forEach(i=>{this.scroll.formatAt(t,e,i,n[i])});const s=new H().retain(t).retain(e,En(n));return this.update(s)}getContents(t,e){return this.delta.slice(t,t+e)}getDelta(){return this.scroll.lines().reduce((t,e)=>t.concat(e.delta()),new H)}getFormat(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=[],s=[];e===0?this.scroll.path(t).forEach(l=>{const[c]=l;c instanceof St?n.push(c):c instanceof Ot&&s.push(c)}):(n=this.scroll.lines(t,e),s=this.scroll.descendants(Ot,t,e));const[i,a]=[n,s].map(l=>{const c=l.shift();if(c==null)return{};let h=Zt(c);for(;Object.keys(h).length>0;){const g=l.shift();if(g==null)return h;h=Zp(Zt(g),h)}return h});return{...i,...a}}getHTML(t,e){const[n,s]=this.scroll.line(t);if(n){const i=n.length();return n.length()>=s+e&&!(s===0&&e===i)?or(n,s,e,!0):or(this.scroll,t,e,!0)}return""}getText(t,e){return this.getContents(t,e).filter(n=>typeof n.insert=="string").map(n=>n.insert).join("")}insertContents(t,e){const n=nl(e),s=new H().retain(t).concat(n);return this.scroll.insertContents(t,n),this.update(s)}insertEmbed(t,e,n){return this.scroll.insertAt(t,e,n),this.update(new H().retain(t).insert({[e]:n}))}insertText(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return e=e.replace(/\r\n/g,`
8
+ `).replace(/\r/g,`
9
+ `),this.scroll.insertAt(t,e),Object.keys(n).forEach(s=>{this.scroll.formatAt(t,e.length,s,n[s])}),this.update(new H().retain(t).insert(e,En(n)))}isBlank(){if(this.scroll.children.length===0)return!0;if(this.scroll.children.length>1)return!1;const t=this.scroll.children.head;if((t==null?void 0:t.statics.blotName)!==St.blotName)return!1;const e=t;return e.children.length>1?!1:e.children.head instanceof ie}removeFormat(t,e){const n=this.getText(t,e),[s,i]=this.scroll.line(t+e);let a=0,l=new H;s!=null&&(a=s.length()-i,l=s.delta().slice(i,i+a-1).insert(`
10
+ `));const h=this.getContents(t,e+a).diff(new H().insert(n).concat(l)),g=new H().retain(t).concat(h);return this.applyDelta(g)}update(t){let e=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(e.length===1&&e[0].type==="characterData"&&e[0].target.data.match(Vp)&&this.scroll.find(e[0].target)){const i=this.scroll.find(e[0].target),a=Zt(i),l=i.offset(this.scroll),c=e[0].oldValue.replace(kn.CONTENTS,""),h=new H().insert(c),g=new H().insert(i.value()),v=n&&{oldRange:rl(n.oldRange,-l),newRange:rl(n.newRange,-l)};t=new H().retain(l).concat(h.diff(g,v)).reduce((b,_)=>_.insert?b.insert(_.insert,a):b.push(_),new H),this.delta=s.compose(t)}else this.delta=this.getDelta(),(!t||!zs(s.compose(t),this.delta))&&(t=s.diff(this.delta,n));return t}}function qn(r,t,e){if(r.length===0){const[b]=si(e.pop());return t<=0?`</li></${b}>`:`</li></${b}>${qn([],t-1,e)}`}const[{child:n,offset:s,length:i,indent:a,type:l},...c]=r,[h,g]=si(l);if(a>t)return e.push(l),a===t+1?`<${h}><li${g}>${or(n,s,i)}${qn(c,a,e)}`:`<${h}><li>${qn(r,t+1,e)}`;const v=e[e.length-1];if(a===t&&l===v)return`</li><li${g}>${or(n,s,i)}${qn(c,a,e)}`;const[f]=si(e.pop());return`</li></${f}>${qn(r,t-1,e)}`}function or(r,t,e){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if("html"in r&&typeof r.html=="function")return r.html(t,e);if(r instanceof oe)return Qr(r.value().slice(t,t+e)).replaceAll(" ","&nbsp;");if(r instanceof se){if(r.statics.blotName==="list-container"){const h=[];return r.children.forEachAt(t,e,(g,v,f)=>{const b="formats"in g&&typeof g.formats=="function"?g.formats():{};h.push({child:g,offset:v,length:f,indent:b.indent||0,type:b.list})}),qn(h,-1,[])}const s=[];if(r.children.forEachAt(t,e,(h,g,v)=>{s.push(or(h,g,v))}),n||r.statics.blotName==="list")return s.join("");const{outerHTML:i,innerHTML:a}=r.domNode,[l,c]=i.split(`>${a}<`);return l==="<table"?`<table style="border: 1px solid #000;">${s.join("")}<${c}`:`${l}>${s.join("")}<${c}`}return r.domNode instanceof Element?r.domNode.outerHTML:""}function Zp(r,t){return Object.keys(t).reduce((e,n)=>{if(r[n]==null)return e;const s=t[n];return s===r[n]?e[n]=s:Array.isArray(s)?s.indexOf(r[n])<0?e[n]=s.concat([r[n]]):e[n]=s:e[n]=[s,r[n]],e},{})}function si(r){const t=r==="ordered"?"ol":"ul";switch(r){case"checked":return[t,' data-list="checked"'];case"unchecked":return[t,' data-list="unchecked"'];default:return[t,""]}}function nl(r){return r.reduce((t,e)=>{if(typeof e.insert=="string"){const n=e.insert.replace(/\r\n/g,`
11
+ `).replace(/\r/g,`
12
+ `);return t.insert(n,e.attributes)}return t.push(e)},new H)}function rl(r,t){let{index:e,length:n}=r;return new He(e+t,n)}function Xp(r){const t=[];return r.forEach(e=>{typeof e.insert=="string"?e.insert.split(`
13
+ `).forEach((s,i)=>{i&&t.push({insert:`
14
+ `,attributes:e.attributes}),s&&t.push({insert:s,attributes:e.attributes})}):t.push(e)}),t}class Xt{constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.quill=t,this.options=e}}D(Xt,"DEFAULTS",{});const Jr="\uFEFF";class ii extends Vt{constructor(t,e){super(t,e),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(Jr),this.rightGuard=document.createTextNode(Jr),this.domNode.appendChild(this.leftGuard),this.domNode.appendChild(this.contentNode),this.domNode.appendChild(this.rightGuard)}index(t,e){return t===this.leftGuard?0:t===this.rightGuard?1:super.index(t,e)}restore(t){let e=null,n;const s=t.data.split(Jr).join("");if(t===this.leftGuard)if(this.prev instanceof oe){const i=this.prev.length();this.prev.insertAt(i,s),e={startNode:this.prev.domNode,startOffset:i+s.length}}else n=document.createTextNode(s),this.parent.insertBefore(this.scroll.create(n),this),e={startNode:n,startOffset:s.length};else t===this.rightGuard&&(this.next instanceof oe?(this.next.insertAt(0,s),e={startNode:this.next.domNode,startOffset:s.length}):(n=document.createTextNode(s),this.parent.insertBefore(this.scroll.create(n),this.next),e={startNode:n,startOffset:s.length}));return t.data=Jr,e}update(t,e){t.forEach(n=>{if(n.type==="characterData"&&(n.target===this.leftGuard||n.target===this.rightGuard)){const s=this.restore(n.target);s&&(e.range=s)}})}}class Yp{constructor(t,e){D(this,"isComposing",!1);this.scroll=t,this.emitter=e,this.setupListeners()}setupListeners(){this.scroll.domNode.addEventListener("compositionstart",t=>{this.isComposing||this.handleCompositionStart(t)}),this.scroll.domNode.addEventListener("compositionend",t=>{this.isComposing&&queueMicrotask(()=>{this.handleCompositionEnd(t)})})}handleCompositionStart(t){const e=t.target instanceof Node?this.scroll.find(t.target,!0):null;e&&!(e instanceof ii)&&(this.emitter.emit(P.events.COMPOSITION_BEFORE_START,t),this.scroll.batchStart(),this.emitter.emit(P.events.COMPOSITION_START,t),this.isComposing=!0)}handleCompositionEnd(t){this.emitter.emit(P.events.COMPOSITION_BEFORE_END,t),this.scroll.batchEnd(),this.emitter.emit(P.events.COMPOSITION_END,t),this.isComposing=!1}}const mr=class mr{constructor(t,e){D(this,"modules",{});this.quill=t,this.options=e}init(){Object.keys(this.options.modules).forEach(t=>{this.modules[t]==null&&this.addModule(t)})}addModule(t){const e=this.quill.constructor.import(`modules/${t}`);return this.modules[t]=new e(this.quill,this.options.modules[t]||{}),this.modules[t]}};D(mr,"DEFAULTS",{modules:{}}),D(mr,"themes",{default:mr});let On=mr;const Qp=r=>r.parentElement||r.getRootNode().host||null,Jp=r=>{const t=r.getBoundingClientRect(),e="offsetWidth"in r&&Math.abs(t.width)/r.offsetWidth||1,n="offsetHeight"in r&&Math.abs(t.height)/r.offsetHeight||1;return{top:t.top,right:t.left+r.clientWidth*e,bottom:t.top+r.clientHeight*n,left:t.left}},ts=r=>{const t=parseInt(r,10);return Number.isNaN(t)?0:t},sl=(r,t,e,n,s,i)=>r<e&&t>n?0:r<e?-(e-r+s):t>n?t-r>n-e?r+s-e:t-n+i:0,tg=(r,t)=>{var i,a,l;const e=r.ownerDocument;let n=t,s=r;for(;s;){const c=s===e.body,h=c?{top:0,right:((i=window.visualViewport)==null?void 0:i.width)??e.documentElement.clientWidth,bottom:((a=window.visualViewport)==null?void 0:a.height)??e.documentElement.clientHeight,left:0}:Jp(s),g=getComputedStyle(s),v=sl(n.left,n.right,h.left,h.right,ts(g.scrollPaddingLeft),ts(g.scrollPaddingRight)),f=sl(n.top,n.bottom,h.top,h.bottom,ts(g.scrollPaddingTop),ts(g.scrollPaddingBottom));if(v||f)if(c)(l=e.defaultView)==null||l.scrollBy(v,f);else{const{scrollLeft:b,scrollTop:_}=s;f&&(s.scrollTop+=f),v&&(s.scrollLeft+=v);const N=s.scrollLeft-b,A=s.scrollTop-_;n={left:n.left-N,top:n.top-A,right:n.right-N,bottom:n.bottom-A}}s=c||g.position==="fixed"?null:Qp(s)}},eg=100,ng=["block","break","cursor","inline","scroll","text"],rg=(r,t,e)=>{const n=new xn;return ng.forEach(s=>{const i=t.query(s);i&&n.register(i)}),r.forEach(s=>{let i=t.query(s);i||e.error(`Cannot register "${s}" specified in "formats" config. Are you sure it was registered?`);let a=0;for(;i;)if(n.register(i),i="blotName"in i?i.requiredContainer??null:null,a+=1,a>eg){e.error(`Cycle detected in registering blot requiredContainer: "${s}"`);break}}),n},In=xe("quill"),es=new xn;se.uiClass="ql-ui";const ce=class ce{static debug(t){t===!0&&(t="log"),xe.level(t)}static find(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Qs.get(t)||es.find(t,e)}static import(t){return this.imports[t]==null&&In.error(`Cannot import ${t}. Are you sure it was registered?`),this.imports[t]}static register(){if(typeof(arguments.length<=0?void 0:arguments[0])!="string"){const t=arguments.length<=0?void 0:arguments[0],e=!!(!(arguments.length<=1)&&arguments[1]),n="attrName"in t?t.attrName:t.blotName;typeof n=="string"?this.register(`formats/${n}`,t,e):Object.keys(t).forEach(s=>{this.register(s,t[s],e)})}else{const t=arguments.length<=0?void 0:arguments[0],e=arguments.length<=1?void 0:arguments[1],n=!!(!(arguments.length<=2)&&arguments[2]);this.imports[t]!=null&&!n&&In.warn(`Overwriting ${t} with`,e),this.imports[t]=e,(t.startsWith("blots/")||t.startsWith("formats/"))&&e&&typeof e!="boolean"&&e.blotName!=="abstract"&&es.register(e),typeof e.register=="function"&&e.register(es)}}constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.options=sg(t,e),this.container=this.options.container,this.container==null){In.error("Invalid Quill container",t);return}this.options.debug&&ce.debug(this.options.debug);const n=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",Qs.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new P;const s=Gs.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 Gp(this.scroll),this.selection=new Kp(this.scroll,this.emitter),this.composition=new Yp(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(P.events.EDITOR_CHANGE,a=>{a===P.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())}),this.emitter.on(P.events.SCROLL_UPDATE,(a,l)=>{const c=this.selection.lastRange,[h]=this.selection.getRange(),g=c&&h?{oldRange:c,newRange:h}:void 0;ae.call(this,()=>this.editor.update(null,l,g),a)}),this.emitter.on(P.events.SCROLL_EMBED_UPDATE,(a,l)=>{const c=this.selection.lastRange,[h]=this.selection.getRange(),g=c&&h?{oldRange:c,newRange:h}:void 0;ae.call(this,()=>{const v=new H().retain(a.offset(this)).retain({[a.statics.blotName]:l});return this.editor.update(v,[],g)},ce.sources.USER)}),n){const a=this.clipboard.convert({html:`${n}<p><br></p>`,text:`
15
+ `});this.setContents(a)}this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable(),this.allowReadOnlyEdits=!1}addContainer(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof t=="string"){const n=t;t=document.createElement("div"),t.classList.add(n)}return this.container.insertBefore(t,e),t}blur(){this.selection.setRange(null)}deleteText(t,e,n){return[t,e,,n]=Le(t,e,n),ae.call(this,()=>this.editor.deleteText(t,e),n,t,-1*e)}disable(){this.enable(!1)}editReadOnly(t){this.allowReadOnlyEdits=!0;const e=t();return this.allowReadOnlyEdits=!1,e}enable(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(t),this.container.classList.toggle("ql-disabled",!t)}focus(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.selection.focus(),t.preventScroll||this.scrollSelectionIntoView()}format(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:P.sources.API;return ae.call(this,()=>{const s=this.getSelection(!0);let i=new H;if(s==null)return i;if(this.scroll.query(t,F.BLOCK))i=this.editor.formatLine(s.index,s.length,{[t]:e});else{if(s.length===0)return this.selection.format(t,e),i;i=this.editor.formatText(s.index,s.length,{[t]:e})}return this.setSelection(s,P.sources.SILENT),i},n)}formatLine(t,e,n,s,i){let a;return[t,e,a,i]=Le(t,e,n,s,i),ae.call(this,()=>this.editor.formatLine(t,e,a),i,t,0)}formatText(t,e,n,s,i){let a;return[t,e,a,i]=Le(t,e,n,s,i),ae.call(this,()=>this.editor.formatText(t,e,a),i,t,0)}getBounds(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=null;if(typeof t=="number"?n=this.selection.getBounds(t,e):n=this.selection.getBounds(t.index,t.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 t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-t;return[t,e]=Le(t,e),this.editor.getContents(t,e)}getFormat(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof t=="number"?this.editor.getFormat(t,e):this.editor.getFormat(t.index,t.length)}getIndex(t){return t.offset(this.scroll)}getLength(){return this.scroll.length()}getLeaf(t){return this.scroll.leaf(t)}getLine(t){return this.scroll.line(t)}getLines(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof t!="number"?this.scroll.lines(t.index,t.length):this.scroll.lines(t,e)}getModule(t){return this.theme.modules[t]}getSelection(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1)&&this.focus(),this.update(),this.selection.getRange()[0]}getSemanticHTML(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;return typeof t=="number"&&(e=e??this.getLength()-t),[t,e]=Le(t,e),this.editor.getHTML(t,e)}getText(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;return typeof t=="number"&&(e=e??this.getLength()-t),[t,e]=Le(t,e),this.editor.getText(t,e)}hasFocus(){return this.selection.hasFocus()}insertEmbed(t,e,n){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:ce.sources.API;return ae.call(this,()=>this.editor.insertEmbed(t,e,n),s,t)}insertText(t,e,n,s,i){let a;return[t,,a,i]=Le(t,0,n,s,i),ae.call(this,()=>this.editor.insertText(t,e,a),i,t,e.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(t,e,n){return[t,e,,n]=Le(t,e,n),ae.call(this,()=>this.editor.removeFormat(t,e),n,t)}scrollRectIntoView(t){tg(this.root,t)}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 t=this.selection.lastRange,e=t&&this.selection.getBounds(t.index,t.length);e&&this.scrollRectIntoView(e)}setContents(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:P.sources.API;return ae.call(this,()=>{t=new H(t);const n=this.getLength(),s=this.editor.deleteText(0,n),i=this.editor.insertContents(0,t),a=this.editor.deleteText(this.getLength()-1,1);return s.compose(i).compose(a)},e)}setSelection(t,e,n){t==null?this.selection.setRange(null,e||ce.sources.API):([t,e,,n]=Le(t,e,n),this.selection.setRange(new He(Math.max(0,t),e),n),n!==P.sources.SILENT&&this.scrollSelectionIntoView())}setText(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:P.sources.API;const n=new H().insert(t);return this.setContents(n,e)}update(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:P.sources.USER;const e=this.scroll.update(t);return this.selection.update(t),e}updateContents(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:P.sources.API;return ae.call(this,()=>(t=new H(t),this.editor.applyDelta(t)),e,!0)}};D(ce,"DEFAULTS",{bounds:null,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0},placeholder:"",readOnly:!1,registry:es,theme:"default"}),D(ce,"events",P.events),D(ce,"sources",P.sources),D(ce,"version","2.0.3"),D(ce,"imports",{delta:H,parchment:Ua,"core/module":Xt,"core/theme":On});let x=ce;function il(r){return typeof r=="string"?document.querySelector(r):r}function oi(r){return Object.entries(r??{}).reduce((t,e)=>{let[n,s]=e;return{...t,[n]:s===!0?{}:s}},{})}function ol(r){return Object.fromEntries(Object.entries(r).filter(t=>t[1]!==void 0))}function sg(r,t){const e=il(r);if(!e)throw new Error("Invalid Quill container");const s=!t.theme||t.theme===x.DEFAULTS.theme?On:x.import(`themes/${t.theme}`);if(!s)throw new Error(`Invalid theme ${t.theme}. Did you register it?`);const{modules:i,...a}=x.DEFAULTS,{modules:l,...c}=s.DEFAULTS;let h=oi(t.modules);h!=null&&h.toolbar&&h.toolbar.constructor!==Object&&(h={...h,toolbar:{container:h.toolbar}});const g=Me({},oi(i),oi(l),h),v={...a,...ol(c),...ol(t)};let f=t.registry;return f?t.formats&&In.warn('Ignoring "formats" option because "registry" is specified'):f=t.formats?rg(t.formats,v.registry,In):v.registry,{...v,registry:f,container:e,theme:s,modules:Object.entries(g).reduce((b,_)=>{let[N,A]=_;if(!A)return b;const E=x.import(`modules/${N}`);return E==null?(In.error(`Cannot load ${N} module. Are you sure you registered it?`),b):{...b,[N]:Me({},E.DEFAULTS||{},A)}},{}),bounds:il(v.bounds)}}function ae(r,t,e,n){if(!this.isEnabled()&&t===P.sources.USER&&!this.allowReadOnlyEdits)return new H;let s=e==null?null:this.getSelection();const i=this.editor.delta,a=r();if(s!=null&&(e===!0&&(e=s.index),n==null?s=al(s,a,t):n!==0&&(s=al(s,e,n,t)),this.setSelection(s,P.sources.SILENT)),a.length()>0){const l=[P.events.TEXT_CHANGE,a,i,t];this.emitter.emit(P.events.EDITOR_CHANGE,...l),t!==P.sources.SILENT&&this.emitter.emit(...l)}return a}function Le(r,t,e,n,s){let i={};return typeof r.index=="number"&&typeof r.length=="number"?typeof t!="number"?(s=n,n=e,e=t,t=r.length,r=r.index):(t=r.length,r=r.index):typeof t!="number"&&(s=n,n=e,e=t,t=0),typeof e=="object"?(i=e,s=n):typeof e=="string"&&(n!=null?i[e]=n:s=e),s=s||P.sources.API,[r,t,i,s]}function al(r,t,e,n){const s=typeof e=="number"?e:0;if(r==null)return null;let i,a;return t&&typeof t.transformPosition=="function"?[i,a]=[r.index,r.index+r.length].map(l=>t.transformPosition(l,n!==P.sources.USER)):[i,a]=[r.index,r.index+r.length].map(l=>l<t||l===t&&n===P.sources.USER?l:s>=0?l+s:Math.max(t,l+s)),new He(i,a-i)}class an extends Kr{}function ll(r){return r instanceof St||r instanceof Gt}function cl(r){return typeof r.updateContent=="function"}class Bn extends Gs{constructor(t,e,n){let{emitter:s}=n;super(t,e),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 t=this.batch;this.batch=!1,this.update(t)}emitMount(t){this.emitter.emit(P.events.SCROLL_BLOT_MOUNT,t)}emitUnmount(t){this.emitter.emit(P.events.SCROLL_BLOT_UNMOUNT,t)}emitEmbedUpdate(t,e){this.emitter.emit(P.events.SCROLL_EMBED_UPDATE,t,e)}deleteAt(t,e){const[n,s]=this.line(t),[i]=this.line(t+e);if(super.deleteAt(t,e),i!=null&&n!==i&&s>0){if(n instanceof Gt||i instanceof Gt){this.optimize();return}const a=i.children.head instanceof ie?null:i.children.head;n.moveChildren(i,a),n.remove()}this.optimize()}enable(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",t?"true":"false")}formatAt(t,e,n,s){super.formatAt(t,e,n,s),this.optimize()}insertAt(t,e,n){if(t>=this.length())if(n==null||this.scroll.query(e,F.BLOCK)==null){const s=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(s),n==null&&e.endsWith(`
16
+ `)?s.insertAt(0,e.slice(0,-1),n):s.insertAt(0,e,n)}else{const s=this.scroll.create(e,n);this.appendChild(s)}else super.insertAt(t,e,n);this.optimize()}insertBefore(t,e){if(t.statics.scope===F.INLINE_BLOT){const n=this.scroll.create(this.statics.defaultChild.blotName);n.appendChild(t),super.insertBefore(n,e)}else super.insertBefore(t,e)}insertContents(t,e){const n=this.deltaToRenderBlocks(e.concat(new H().insert(`
17
+ `))),s=n.pop();if(s==null)return;this.batchStart();const i=n.shift();if(i){const c=i.type==="block"&&(i.delta.length()===0||!this.descendant(Gt,t)[0]&&t<this.length()),h=i.type==="block"?i.delta:new H().insert({[i.key]:i.value});ai(this,t,h);const g=i.type==="block"?1:0,v=t+h.length()+g;c&&this.insertAt(v-1,`
18
+ `);const f=Zt(this.line(t)[0]),b=Mt.AttributeMap.diff(f,i.attributes)||{};Object.keys(b).forEach(_=>{this.formatAt(v-1,1,_,b[_])}),t=v}let[a,l]=this.children.find(t);if(n.length&&(a&&(a=a.split(l),l=0),n.forEach(c=>{if(c.type==="block"){const h=this.createBlock(c.attributes,a||void 0);ai(h,0,c.delta)}else{const h=this.create(c.key,c.value);this.insertBefore(h,a||void 0),Object.keys(c.attributes).forEach(g=>{h.format(g,c.attributes[g])})}})),s.type==="block"&&s.delta.length()){const c=a?a.offset(a.scroll)+l:this.length();ai(this,c,s.delta)}this.batchEnd(),this.optimize()}isEnabled(){return this.domNode.getAttribute("contenteditable")==="true"}leaf(t){const e=this.path(t).pop();if(!e)return[null,-1];const[n,s]=e;return n instanceof Ot?[n,s]:[null,-1]}line(t){return t===this.length()?this.line(t-1):this.descendant(ll,t)}lines(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;const n=(s,i,a)=>{let l=[],c=a;return s.children.forEachAt(i,a,(h,g,v)=>{ll(h)?l.push(h):h instanceof Kr&&(l=l.concat(n(h,g,c))),c-=v}),l};return n(this,t,e)}optimize(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch||(super.optimize(t,e),t.length>0&&this.emitter.emit(P.events.SCROLL_OPTIMIZE,t,e))}path(t){return super.path(t).slice(1)}remove(){}update(t){if(this.batch){Array.isArray(t)&&(this.batch=this.batch.concat(t));return}let e=P.sources.USER;typeof t=="string"&&(e=t),Array.isArray(t)||(t=this.observer.takeRecords()),t=t.filter(n=>{let{target:s}=n;const i=this.find(s,!0);return i&&!cl(i)}),t.length>0&&this.emitter.emit(P.events.SCROLL_BEFORE_UPDATE,e,t),super.update(t.concat([])),t.length>0&&this.emitter.emit(P.events.SCROLL_UPDATE,e,t)}updateEmbedAt(t,e,n){const[s]=this.descendant(i=>i instanceof Gt,t);s&&s.statics.blotName===e&&cl(s)&&s.updateContent(n)}handleDragStart(t){t.preventDefault()}deltaToRenderBlocks(t){const e=[];let n=new H;return t.forEach(s=>{const i=s==null?void 0:s.insert;if(i)if(typeof i=="string"){const a=i.split(`
19
+ `);a.slice(0,-1).forEach(c=>{n.insert(c,s.attributes),e.push({type:"block",delta:n,attributes:s.attributes??{}}),n=new H});const l=a[a.length-1];l&&n.insert(l,s.attributes)}else{const a=Object.keys(i)[0];if(!a)return;this.query(a,F.INLINE)?n.push(s):(n.length()&&e.push({type:"block",delta:n,attributes:{}}),n=new H,e.push({type:"blockEmbed",key:a,value:i[a],attributes:s.attributes??{}}))}}),n.length()&&e.push({type:"block",delta:n,attributes:{}}),e}createBlock(t,e){let n;const s={};Object.entries(t).forEach(l=>{let[c,h]=l;this.query(c,F.BLOCK&F.BLOT)!=null?n=c:s[c]=h});const i=this.create(n||this.statics.defaultChild.blotName,n?t[n]:void 0);this.insertBefore(i,e||void 0);const a=i.length();return Object.entries(s).forEach(l=>{let[c,h]=l;i.formatAt(0,a,c,h)}),i}}D(Bn,"blotName","scroll"),D(Bn,"className","ql-editor"),D(Bn,"tagName","DIV"),D(Bn,"defaultChild",St),D(Bn,"allowedChildren",[St,Gt,an]);function ai(r,t,e){e.reduce((n,s)=>{const i=Mt.Op.length(s);let a=s.attributes||{};if(s.insert!=null){if(typeof s.insert=="string"){const l=s.insert;r.insertAt(n,l);const[c]=r.descendant(Ot,n),h=Zt(c);a=Mt.AttributeMap.diff(h,a)||{}}else if(typeof s.insert=="object"){const l=Object.keys(s.insert)[0];if(l==null)return n;if(r.insertAt(n,l,s.insert[l]),r.scroll.query(l,F.INLINE)!=null){const[h]=r.descendant(Ot,n),g=Zt(h);a=Mt.AttributeMap.diff(g,a)||{}}}}return Object.keys(a).forEach(l=>{r.formatAt(n,i,l,a[l])}),n+i},t)}const li={scope:F.BLOCK,whitelist:["right","center","justify"]},ig=new pe("align","align",li),ul=new re("align","ql-align",li),hl=new Pe("align","text-align",li);class dl extends Pe{value(t){let e=super.value(t);return e.startsWith("rgb(")?(e=e.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),`#${e.split(",").map(s=>`00${parseInt(s,10).toString(16)}`.slice(-2)).join("")}`):e}}const og=new re("color","ql-color",{scope:F.INLINE}),ci=new dl("color","color",{scope:F.INLINE}),ag=new re("background","ql-bg",{scope:F.INLINE}),ui=new dl("background","background-color",{scope:F.INLINE});class ln extends an{static create(t){const e=super.create(t);return e.setAttribute("spellcheck","false"),e}code(t,e){return this.children.map(n=>n.length()<=1?"":n.domNode.innerText).join(`
20
+ `).slice(t,t+e)}html(t,e){return`<pre>
21
+ ${Qr(this.code(t,e))}
22
+ </pre>`}}class It extends St{static register(){x.register(ln)}}D(It,"TAB"," ");class hi extends ge{}hi.blotName="code",hi.tagName="CODE",It.blotName="code-block",It.className="ql-code-block",It.tagName="DIV",ln.blotName="code-block-container",ln.className="ql-code-block-container",ln.tagName="DIV",ln.allowedChildren=[It],It.allowedChildren=[oe,ie,kn],It.requiredContainer=ln;const di={scope:F.BLOCK,whitelist:["rtl"]},fl=new pe("direction","dir",di),pl=new re("direction","ql-direction",di),gl=new Pe("direction","direction",di),ml={scope:F.INLINE,whitelist:["serif","monospace"]},bl=new re("font","ql-font",ml);class lg extends Pe{value(t){return super.value(t).replace(/["']/g,"")}}const yl=new lg("font","font-family",ml),vl=new re("size","ql-size",{scope:F.INLINE,whitelist:["small","large","huge"]}),_l=new Pe("size","font-size",{scope:F.INLINE,whitelist:["10px","18px","32px"]}),cg=xe("quill:keyboard"),ug=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class ns extends Xt{static match(t,e){return["altKey","ctrlKey","metaKey","shiftKey"].some(n=>!!e[n]!==t[n]&&e[n]!==null)?!1:e.key===t.key||e.key===t.which}constructor(t,e){super(t,e),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(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=dg(t);if(s==null){cg.warn("Attempted to add invalid keyboard binding",s);return}typeof e=="function"&&(e={handler:e}),typeof n=="function"&&(n={handler:n}),(Array.isArray(s.key)?s.key:[s.key]).forEach(a=>{const l={...s,key:a,...e,...n};this.bindings[l.key]=this.bindings[l.key]||[],this.bindings[l.key].push(l)})}listen(){this.quill.root.addEventListener("keydown",t=>{if(t.defaultPrevented||t.isComposing||t.keyCode===229&&(t.key==="Enter"||t.key==="Backspace"))return;const s=(this.bindings[t.key]||[]).concat(this.bindings[t.which]||[]).filter(E=>ns.match(t,E));if(s.length===0)return;const i=x.find(t.target,!0);if(i&&i.scroll!==this.quill.scroll)return;const a=this.quill.getSelection();if(a==null||!this.quill.hasFocus())return;const[l,c]=this.quill.getLine(a.index),[h,g]=this.quill.getLeaf(a.index),[v,f]=a.length===0?[h,g]:this.quill.getLeaf(a.index+a.length),b=h instanceof Vr?h.value().slice(0,g):"",_=v instanceof Vr?v.value().slice(f):"",N={collapsed:a.length===0,empty:a.length===0&&l.length()<=1,format:this.quill.getFormat(a),line:l,offset:c,prefix:b,suffix:_,event:t};s.some(E=>{if(E.collapsed!=null&&E.collapsed!==N.collapsed||E.empty!=null&&E.empty!==N.empty||E.offset!=null&&E.offset!==N.offset)return!1;if(Array.isArray(E.format)){if(E.format.every(C=>N.format[C]==null))return!1}else if(typeof E.format=="object"&&!Object.keys(E.format).every(C=>E.format[C]===!0?N.format[C]!=null:E.format[C]===!1?N.format[C]==null:zs(E.format[C],N.format[C])))return!1;return E.prefix!=null&&!E.prefix.test(N.prefix)||E.suffix!=null&&!E.suffix.test(N.suffix)?!1:E.handler.call(this,a,N,E)!==!0})&&t.preventDefault()})}handleBackspace(t,e){const n=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(e.prefix)?2:1;if(t.index===0||this.quill.getLength()<=1)return;let s={};const[i]=this.quill.getLine(t.index);let a=new H().retain(t.index-n).delete(n);if(e.offset===0){const[l]=this.quill.getLine(t.index-1);if(l&&!(l.statics.blotName==="block"&&l.length()<=1)){const h=i.formats(),g=this.quill.getFormat(t.index-1,1);if(s=Mt.AttributeMap.diff(h,g)||{},Object.keys(s).length>0){const v=new H().retain(t.index+i.length()-2).retain(1,s);a=a.compose(v)}}}this.quill.updateContents(a,x.sources.USER),this.quill.focus()}handleDelete(t,e){const n=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(e.suffix)?2:1;if(t.index>=this.quill.getLength()-n)return;let s={};const[i]=this.quill.getLine(t.index);let a=new H().retain(t.index).delete(n);if(e.offset>=i.length()-1){const[l]=this.quill.getLine(t.index+1);if(l){const c=i.formats(),h=this.quill.getFormat(t.index,1);s=Mt.AttributeMap.diff(c,h)||{},Object.keys(s).length>0&&(a=a.retain(l.length()-1).retain(1,s))}}this.quill.updateContents(a,x.sources.USER),this.quill.focus()}handleDeleteRange(t){pi({range:t,quill:this.quill}),this.quill.focus()}handleEnter(t,e){const n=Object.keys(e.format).reduce((i,a)=>(this.quill.scroll.query(a,F.BLOCK)&&!Array.isArray(e.format[a])&&(i[a]=e.format[a]),i),{}),s=new H().retain(t.index).delete(t.length).insert(`
23
+ `,n);this.quill.updateContents(s,x.sources.USER),this.quill.setSelection(t.index+1,x.sources.SILENT),this.quill.focus()}}const hg={bindings:{bold:fi("bold"),italic:fi("italic"),underline:fi("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(r,t){return t.collapsed&&t.offset!==0?!0:(this.quill.format("indent","+1",x.sources.USER),!1)}},outdent:{key:"Tab",shiftKey:!0,format:["blockquote","indent","list"],handler(r,t){return t.collapsed&&t.offset!==0?!0:(this.quill.format("indent","-1",x.sources.USER),!1)}},"outdent backspace":{key:"Backspace",collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler(r,t){t.format.indent!=null?this.quill.format("indent","-1",x.sources.USER):t.format.list!=null&&this.quill.format("list",!1,x.sources.USER)}},"indent code-block":Nl(!0),"outdent code-block":Nl(!1),"remove tab":{key:"Tab",shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(r){this.quill.deleteText(r.index-1,1,x.sources.USER)}},tab:{key:"Tab",handler(r,t){if(t.format.table)return!0;this.quill.history.cutoff();const e=new H().retain(r.index).delete(r.length).insert(" ");return this.quill.updateContents(e,x.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(r.index+1,x.sources.SILENT),!1}},"blockquote empty enter":{key:"Enter",collapsed:!0,format:["blockquote"],empty:!0,handler(){this.quill.format("blockquote",!1,x.sources.USER)}},"list empty enter":{key:"Enter",collapsed:!0,format:["list"],empty:!0,handler(r,t){const e={list:!1};t.format.indent&&(e.indent=!1),this.quill.formatLine(r.index,r.length,e,x.sources.USER)}},"checklist enter":{key:"Enter",collapsed:!0,format:{list:"checked"},handler(r){const[t,e]=this.quill.getLine(r.index),n={...t.formats(),list:"checked"},s=new H().retain(r.index).insert(`
24
+ `,n).retain(t.length()-e-1).retain(1,{list:"unchecked"});this.quill.updateContents(s,x.sources.USER),this.quill.setSelection(r.index+1,x.sources.SILENT),this.quill.scrollSelectionIntoView()}},"header enter":{key:"Enter",collapsed:!0,format:["header"],suffix:/^$/,handler(r,t){const[e,n]=this.quill.getLine(r.index),s=new H().retain(r.index).insert(`
25
+ `,t.format).retain(e.length()-n-1).retain(1,{header:null});this.quill.updateContents(s,x.sources.USER),this.quill.setSelection(r.index+1,x.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 t=this.quill.getModule("table");if(t){const[e,n,s,i]=t.getTable(r),a=fg(e,n,s,i);if(a==null)return;let l=e.offset();if(a<0){const c=new H().retain(l).insert(`
26
+ `);this.quill.updateContents(c,x.sources.USER),this.quill.setSelection(r.index+1,r.length,x.sources.SILENT)}else if(a>0){l+=e.length();const c=new H().retain(l).insert(`
27
+ `);this.quill.updateContents(c,x.sources.USER),this.quill.setSelection(l,x.sources.USER)}}}},"table tab":{key:"Tab",shiftKey:null,format:["table"],handler(r,t){const{event:e,line:n}=t,s=n.offset(this.quill.scroll);e.shiftKey?this.quill.setSelection(s-1,x.sources.USER):this.quill.setSelection(s+n.length(),x.sources.USER)}},"list autofill":{key:" ",shiftKey:null,collapsed:!0,format:{"code-block":!1,blockquote:!1,table:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler(r,t){if(this.quill.scroll.query("list")==null)return!0;const{length:e}=t.prefix,[n,s]=this.quill.getLine(r.index);if(s>e)return!0;let i;switch(t.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," ",x.sources.USER),this.quill.history.cutoff();const a=new H().retain(r.index-s).delete(e+1).retain(n.length()-2-s).retain(1,{list:i});return this.quill.updateContents(a,x.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(r.index-e,x.sources.SILENT),!1}},"code exit":{key:"Enter",collapsed:!0,format:["code-block"],prefix:/^$/,suffix:/^\s*$/,handler(r){const[t,e]=this.quill.getLine(r.index);let n=2,s=t;for(;s!=null&&s.length()<=1&&s.formats()["code-block"];)if(s=s.prev,n-=1,n<=0){const i=new H().retain(r.index+t.length()-e-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(i,x.sources.USER),this.quill.setSelection(r.index-1,x.sources.SILENT),!1}return!0}},"embed left":rs("ArrowLeft",!1),"embed left shift":rs("ArrowLeft",!0),"embed right":rs("ArrowRight",!1),"embed right shift":rs("ArrowRight",!0),"table down":Al(!1),"table up":Al(!0)}};ns.DEFAULTS=hg;function Nl(r){return{key:"Tab",shiftKey:!r,format:{"code-block":!0},handler(t,e){let{event:n}=e;const s=this.quill.scroll.query("code-block"),{TAB:i}=s;if(t.length===0&&!n.shiftKey){this.quill.insertText(t.index,i,x.sources.USER),this.quill.setSelection(t.index+i.length,x.sources.SILENT);return}const a=t.length===0?this.quill.getLines(t.index,1):this.quill.getLines(t);let{index:l,length:c}=t;a.forEach((h,g)=>{r?(h.insertAt(0,i),g===0?l+=i.length:c+=i.length):h.domNode.textContent.startsWith(i)&&(h.deleteAt(0,i.length),g===0?l-=i.length:c-=i.length)}),this.quill.update(x.sources.USER),this.quill.setSelection(l,c,x.sources.SILENT)}}}function rs(r,t){return{key:r,shiftKey:t,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 Vt?(r==="ArrowLeft"?t?this.quill.setSelection(n.index-1,n.length+1,x.sources.USER):this.quill.setSelection(n.index-1,x.sources.USER):t?this.quill.setSelection(n.index,n.length+1,x.sources.USER):this.quill.setSelection(n.index+n.length+1,x.sources.USER),!1):!0}}}function fi(r){return{key:r[0],shortKey:!0,handler(t,e){this.quill.format(r,!e.format[r],x.sources.USER)}}}function Al(r){return{key:r?"ArrowUp":"ArrowDown",collapsed:!0,format:["table"],handler(t,e){const n=r?"prev":"next",s=e.line,i=s.parent[n];if(i!=null){if(i.statics.blotName==="table-row"){let a=i.children.head,l=s;for(;l.prev!=null;)l=l.prev,a=a.next;const c=a.offset(this.quill.scroll)+Math.min(e.offset,a.length()-1);this.quill.setSelection(c,0,x.sources.USER)}}else{const a=s.table()[n];a!=null&&(r?this.quill.setSelection(a.offset(this.quill.scroll)+a.length()-1,0,x.sources.USER):this.quill.setSelection(a.offset(this.quill.scroll),0,x.sources.USER))}return!1}}}function dg(r){if(typeof r=="string"||typeof r=="number")r={key:r};else if(typeof r=="object")r=En(r);else return null;return r.shortKey&&(r[ug]=r.shortKey,delete r.shortKey),r}function pi(r){let{quill:t,range:e}=r;const n=t.getLines(e);let s={};if(n.length>1){const i=n[0].formats(),a=n[n.length-1].formats();s=Mt.AttributeMap.diff(a,i)||{}}t.deleteText(e,x.sources.USER),Object.keys(s).length>0&&t.formatLine(e.index,1,s,x.sources.USER),t.setSelection(e.index,x.sources.SILENT)}function fg(r,t,e,n){return t.prev==null&&t.next==null?e.prev==null&&e.next==null?n===0?-1:1:e.prev==null?-1:1:t.prev==null?-1:t.next==null?1:null}const pg=/font-weight:\s*normal/,gg=["P","OL","UL"],wl=r=>r&&gg.includes(r.tagName),mg=r=>{Array.from(r.querySelectorAll("br")).filter(t=>wl(t.previousElementSibling)&&wl(t.nextElementSibling)).forEach(t=>{var e;(e=t.parentNode)==null||e.removeChild(t)})},bg=r=>{Array.from(r.querySelectorAll('b[style*="font-weight"]')).filter(t=>{var e;return(e=t.getAttribute("style"))==null?void 0:e.match(pg)}).forEach(t=>{var n;const e=r.createDocumentFragment();e.append(...t.childNodes),(n=t.parentNode)==null||n.replaceChild(e,t)})};function yg(r){r.querySelector('[id^="docs-internal-guid-"]')&&(bg(r),mg(r))}const vg=/\bmso-list:[^;]*ignore/i,_g=/\bmso-list:[^;]*\bl(\d+)/i,Ng=/\bmso-list:[^;]*\blevel(\d+)/i,Ag=(r,t)=>{const e=r.getAttribute("style"),n=e==null?void 0:e.match(_g);if(!n)return null;const s=Number(n[1]),i=e==null?void 0:e.match(Ng),a=i?Number(i[1]):1,l=new RegExp(`@list l${s}:level${a}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,"i"),c=t.match(l),h=c&&c[1]==="bullet"?"bullet":"ordered";return{id:s,indent:a,type:h,element:r}},wg=r=>{var a,l;const t=Array.from(r.querySelectorAll("[style*=mso-list]")),e=[],n=[];t.forEach(c=>{(c.getAttribute("style")||"").match(vg)?e.push(c):n.push(c)}),e.forEach(c=>{var h;return(h=c.parentNode)==null?void 0:h.removeChild(c)});const s=r.documentElement.innerHTML,i=n.map(c=>Ag(c,s)).filter(c=>c);for(;i.length;){const c=[];let h=i.shift();for(;h;)c.push(h),h=i.length&&((a=i[0])==null?void 0:a.element)===h.element.nextElementSibling&&i[0].id===h.id?i.shift():null;const g=document.createElement("ul");c.forEach(b=>{const _=document.createElement("li");_.setAttribute("data-list",b.type),b.indent>1&&_.setAttribute("class",`ql-indent-${b.indent-1}`),_.innerHTML=b.element.innerHTML,g.appendChild(_)});const v=(l=c[0])==null?void 0:l.element,{parentNode:f}=v??{};v&&(f==null||f.replaceChild(g,v)),c.slice(1).forEach(b=>{let{element:_}=b;f==null||f.removeChild(_)})}};function Eg(r){r.documentElement.getAttribute("xmlns:w")==="urn:schemas-microsoft-com:office:word"&&wg(r)}const Tg=[Eg,yg],xg=r=>{r.documentElement&&Tg.forEach(t=>{t(r)})},Lg=xe("quill:clipboard"),Cg=[[Node.TEXT_NODE,Ug],[Node.TEXT_NODE,Ll],["br",Ig],[Node.ELEMENT_NODE,Ll],[Node.ELEMENT_NODE,Og],[Node.ELEMENT_NODE,qg],[Node.ELEMENT_NODE,Mg],["li",Dg],["ol, ul",$g],["pre",Bg],["tr",Pg],["b",mi("bold")],["i",mi("italic")],["strike",mi("strike")],["style",jg]],Sg=[ig,fl].reduce((r,t)=>(r[t.keyName]=t,r),{}),El=[hl,ui,ci,gl,yl,_l].reduce((r,t)=>(r[t.keyName]=t,r),{});class Tl extends Xt{constructor(t,e){super(t,e),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=[],Cg.concat(this.options.matchers??[]).forEach(n=>{let[s,i]=n;this.addMatcher(s,i)})}addMatcher(t,e){this.matchers.push([t,e])}convert(t){let{html:e,text:n}=t,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(s[It.blotName])return new H().insert(n||"",{[It.blotName]:s[It.blotName]});if(!e)return new H().insert(n||"",s);const i=this.convertHTML(e);return ar(i,`
28
+ `)&&(i.ops[i.ops.length-1].attributes==null||s.table)?i.compose(new H().retain(i.length()-1).delete(1)):i}normalizeHTML(t){xg(t)}convertHTML(t){const e=new DOMParser().parseFromString(t,"text/html");this.normalizeHTML(e);const n=e.body,s=new WeakMap,[i,a]=this.prepareMatching(n,s);return gi(this.quill.scroll,n,i,a,s)}dangerouslyPasteHTML(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:x.sources.API;if(typeof t=="string"){const s=this.convert({html:t,text:""});this.quill.setContents(s,e),this.quill.setSelection(0,x.sources.SILENT)}else{const s=this.convert({html:e,text:""});this.quill.updateContents(new H().retain(t).concat(s),n),this.quill.setSelection(t+s.length(),x.sources.SILENT)}}onCaptureCopy(t){var a,l;let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(t.defaultPrevented)return;t.preventDefault();const[n]=this.quill.selection.getRange();if(n==null)return;const{html:s,text:i}=this.onCopy(n,e);(a=t.clipboardData)==null||a.setData("text/plain",i),(l=t.clipboardData)==null||l.setData("text/html",s),e&&pi({range:n,quill:this.quill})}normalizeURIList(t){return t.split(/\r?\n/).filter(e=>e[0]!=="#").join(`
29
+ `)}onCapturePaste(t){var a,l,c,h,g;if(t.defaultPrevented||!this.quill.isEnabled())return;t.preventDefault();const e=this.quill.getSelection(!0);if(e==null)return;const n=(a=t.clipboardData)==null?void 0:a.getData("text/html");let s=(l=t.clipboardData)==null?void 0:l.getData("text/plain");if(!n&&!s){const v=(c=t.clipboardData)==null?void 0:c.getData("text/uri-list");v&&(s=this.normalizeURIList(v))}const i=Array.from(((h=t.clipboardData)==null?void 0:h.files)||[]);if(!n&&i.length>0){this.quill.uploader.upload(e,i);return}if(n&&i.length>0){const v=new DOMParser().parseFromString(n,"text/html");if(v.body.childElementCount===1&&((g=v.body.firstElementChild)==null?void 0:g.tagName)==="IMG"){this.quill.uploader.upload(e,i);return}}this.onPaste(e,{html:n,text:s})}onCopy(t){const e=this.quill.getText(t);return{html:this.quill.getSemanticHTML(t),text:e}}onPaste(t,e){let{text:n,html:s}=e;const i=this.quill.getFormat(t.index),a=this.convert({text:n,html:s},i);Lg.log("onPaste",a,{text:n,html:s});const l=new H().retain(t.index).delete(t.length).concat(a);this.quill.updateContents(l,x.sources.USER),this.quill.setSelection(l.length()-t.length,x.sources.SILENT),this.quill.scrollSelectionIntoView()}prepareMatching(t,e){const n=[],s=[];return this.matchers.forEach(i=>{const[a,l]=i;switch(a){case Node.TEXT_NODE:s.push(l);break;case Node.ELEMENT_NODE:n.push(l);break;default:Array.from(t.querySelectorAll(a)).forEach(c=>{if(e.has(c)){const h=e.get(c);h==null||h.push(l)}else e.set(c,[l])});break}}),[n,s]}}D(Tl,"DEFAULTS",{matchers:[]});function cn(r,t,e,n){return n.query(t)?r.reduce((s,i)=>{if(!i.insert)return s;if(i.attributes&&i.attributes[t])return s.push(i);const a=e?{[t]:e}:{};return s.insert(i.insert,{...a,...i.attributes})},new H):r}function ar(r,t){let e="";for(let n=r.ops.length-1;n>=0&&e.length<t.length;--n){const s=r.ops[n];if(typeof s.insert!="string")break;e=s.insert+e}return e.slice(-1*t.length)===t}function Re(r,t){if(!(r instanceof Element))return!1;const e=t.query(r);return e&&e.prototype instanceof Vt?!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 kg(r,t){return r.previousElementSibling&&r.nextElementSibling&&!Re(r.previousElementSibling,t)&&!Re(r.nextElementSibling,t)}const ss=new WeakMap;function xl(r){return r==null?!1:(ss.has(r)||(r.tagName==="PRE"?ss.set(r,!0):ss.set(r,xl(r.parentNode))),ss.get(r))}function gi(r,t,e,n,s){return t.nodeType===t.TEXT_NODE?n.reduce((i,a)=>a(t,i,r),new H):t.nodeType===t.ELEMENT_NODE?Array.from(t.childNodes||[]).reduce((i,a)=>{let l=gi(r,a,e,n,s);return a.nodeType===t.ELEMENT_NODE&&(l=e.reduce((c,h)=>h(a,c,r),l),l=(s.get(a)||[]).reduce((c,h)=>h(a,c,r),l)),i.concat(l)},new H):new H}function mi(r){return(t,e,n)=>cn(e,r,!0,n)}function qg(r,t,e){const n=pe.keys(r),s=re.keys(r),i=Pe.keys(r),a={};return n.concat(s).concat(i).forEach(l=>{let c=e.query(l,F.ATTRIBUTE);c!=null&&(a[c.attrName]=c.value(r),a[c.attrName])||(c=Sg[l],c!=null&&(c.attrName===l||c.keyName===l)&&(a[c.attrName]=c.value(r)||void 0),c=El[l],c!=null&&(c.attrName===l||c.keyName===l)&&(c=El[l],a[c.attrName]=c.value(r)||void 0))}),Object.entries(a).reduce((l,c)=>{let[h,g]=c;return cn(l,h,g,e)},t)}function Og(r,t,e){const n=e.query(r);if(n==null)return t;if(n.prototype instanceof Vt){const s={},i=n.value(r);if(i!=null)return s[n.blotName]=i,new H().insert(s,n.formats(r,e))}else if(n.prototype instanceof rr&&!ar(t,`
30
+ `)&&t.insert(`
31
+ `),"blotName"in n&&"formats"in n&&typeof n.formats=="function")return cn(t,n.blotName,n.formats(r,e),e);return t}function Ig(r,t){return ar(t,`
32
+ `)||t.insert(`
33
+ `),t}function Bg(r,t,e){const n=e.query("code-block"),s=n&&"formats"in n&&typeof n.formats=="function"?n.formats(r,e):!0;return cn(t,"code-block",s,e)}function jg(){return new H}function Dg(r,t,e){const n=e.query(r);if(n==null||n.blotName!=="list"||!ar(t,`
34
+ `))return t;let s=-1,i=r.parentNode;for(;i!=null;)["OL","UL"].includes(i.tagName)&&(s+=1),i=i.parentNode;return s<=0?t:t.reduce((a,l)=>l.insert?l.attributes&&typeof l.attributes.indent=="number"?a.push(l):a.insert(l.insert,{indent:s,...l.attributes||{}}):a,new H)}function $g(r,t,e){const n=r;let s=n.tagName==="OL"?"ordered":"bullet";const i=n.getAttribute("data-checked");return i&&(s=i==="true"?"checked":"unchecked"),cn(t,"list",s,e)}function Ll(r,t,e){if(!ar(t,`
35
+ `)){if(Re(r,e)&&(r.childNodes.length>0||r instanceof HTMLParagraphElement))return t.insert(`
36
+ `);if(t.length()>0&&r.nextSibling){let n=r.nextSibling;for(;n!=null;){if(Re(n,e))return t.insert(`
37
+ `);const s=e.query(n);if(s&&s.prototype instanceof Gt)return t.insert(`
38
+ `);n=n.firstChild}}}return t}function Mg(r,t,e){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),t=Object.entries(n).reduce((a,l)=>{let[c,h]=l;return cn(a,c,h,e)},t),parseFloat(s.textIndent||0)>0?new H().insert(" ").concat(t):t}function Pg(r,t,e){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 l=Array.from(n.querySelectorAll("tr")).indexOf(r)+1;return cn(t,"table",l,e)}return t}function Ug(r,t,e){var s;let n=r.data;if(((s=r.parentElement)==null?void 0:s.tagName)==="O:P")return t.insert(n.trim());if(!xl(r)){if(n.trim().length===0&&n.includes(`
39
+ `)&&!kg(r,e))return t;n=n.replace(/[^\S\u00a0]/g," "),n=n.replace(/ {2,}/g," "),(r.previousSibling==null&&r.parentElement!=null&&Re(r.parentElement,e)||r.previousSibling instanceof Element&&Re(r.previousSibling,e))&&(n=n.replace(/^ /,"")),(r.nextSibling==null&&r.parentElement!=null&&Re(r.parentElement,e)||r.nextSibling instanceof Element&&Re(r.nextSibling,e))&&(n=n.replace(/ $/,"")),n=n.replaceAll(" "," ")}return t.insert(n)}class Cl extends Xt{constructor(e,n){super(e,n);D(this,"lastRecorded",0);D(this,"ignoreChange",!1);D(this,"stack",{undo:[],redo:[]});D(this,"currentRange",null);this.quill.on(x.events.EDITOR_CHANGE,(s,i,a,l)=>{s===x.events.SELECTION_CHANGE?i&&l!==x.sources.SILENT&&(this.currentRange=i):s===x.events.TEXT_CHANGE&&(this.ignoreChange||(!this.options.userOnly||l===x.sources.USER?this.record(i,a):this.transform(i)),this.currentRange=bi(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(e,n){if(this.stack[e].length===0)return;const s=this.stack[e].pop();if(!s)return;const i=this.quill.getContents(),a=s.delta.invert(i);this.stack[n].push({delta:a,range:bi(s.range,a)}),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(s.delta,x.sources.USER),this.ignoreChange=!1,this.restoreSelection(s)}clear(){this.stack={undo:[],redo:[]}}cutoff(){this.lastRecorded=0}record(e,n){if(e.ops.length===0)return;this.stack.redo=[];let s=e.invert(n),i=this.currentRange;const a=Date.now();if(this.lastRecorded+this.options.delay>a&&this.stack.undo.length>0){const l=this.stack.undo.pop();l&&(s=s.compose(l.delta),i=l.range)}else this.lastRecorded=a;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(e){Sl(this.stack.undo,e),Sl(this.stack.redo,e)}undo(){this.change("undo","redo")}restoreSelection(e){if(e.range)this.quill.setSelection(e.range,x.sources.USER);else{const n=Rg(this.quill.scroll,e.delta);this.quill.setSelection(n,x.sources.USER)}}}D(Cl,"DEFAULTS",{delay:1e3,maxStack:100,userOnly:!1});function Sl(r,t){let e=t;for(let n=r.length-1;n>=0;n-=1){const s=r[n];r[n]={delta:e.transform(s.delta,!0),range:s.range&&bi(s.range,e)},e=s.delta.transform(e),r[n].delta.length()===0&&r.splice(n,1)}}function Hg(r,t){const e=t.ops[t.ops.length-1];return e==null?!1:e.insert!=null?typeof e.insert=="string"&&e.insert.endsWith(`
40
+ `):e.attributes!=null?Object.keys(e.attributes).some(n=>r.query(n,F.BLOCK)!=null):!1}function Rg(r,t){const e=t.reduce((s,i)=>s+(i.delete||0),0);let n=t.length()-e;return Hg(r,t)&&(n-=1),n}function bi(r,t){if(!r)return r;const e=t.transformPosition(r.index),n=t.transformPosition(r.index+r.length);return{index:e,length:n-e}}class kl extends Xt{constructor(t,e){super(t,e),t.root.addEventListener("drop",n=>{var a;n.preventDefault();let s=null;if(document.caretRangeFromPoint)s=document.caretRangeFromPoint(n.clientX,n.clientY);else if(document.caretPositionFromPoint){const l=document.caretPositionFromPoint(n.clientX,n.clientY);s=document.createRange(),s.setStart(l.offsetNode,l.offset),s.setEnd(l.offsetNode,l.offset)}const i=s&&t.selection.normalizeNative(s);if(i){const l=t.selection.normalizedToRange(i);(a=n.dataTransfer)!=null&&a.files&&this.upload(l,n.dataTransfer.files)}})}upload(t,e){const n=[];Array.from(e).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,t,n)}}kl.DEFAULTS={mimetypes:["image/png","image/jpeg"],handler(r,t){if(!this.quill.scroll.query("image"))return;const e=t.map(n=>new Promise(s=>{const i=new FileReader;i.onload=()=>{s(i.result)},i.readAsDataURL(n)}));Promise.all(e).then(n=>{const s=n.reduce((i,a)=>i.insert({image:a}),new H().retain(r.index).delete(r.length));this.quill.updateContents(s,P.sources.USER),this.quill.setSelection(r.index+n.length,P.sources.SILENT)})}};const Fg=["insertText","insertReplacementText"];class zg extends Xt{constructor(t,e){super(t,e),t.root.addEventListener("beforeinput",n=>{this.handleBeforeInput(n)}),/Android/i.test(navigator.userAgent)||t.on(x.events.COMPOSITION_BEFORE_START,()=>{this.handleCompositionStart()})}deleteRange(t){pi({range:t,quill:this.quill})}replaceText(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(t.length===0)return!1;if(e){const n=this.quill.getFormat(t.index,1);this.deleteRange(t),this.quill.updateContents(new H().retain(t.index).insert(e,n),x.sources.USER)}else this.deleteRange(t);return this.quill.setSelection(t.index+e.length,0,x.sources.SILENT),!0}handleBeforeInput(t){if(this.quill.composition.isComposing||t.defaultPrevented||!Fg.includes(t.inputType))return;const e=t.getTargetRanges?t.getTargetRanges()[0]:null;if(!e||e.collapsed===!0)return;const n=Wg(t);if(n==null)return;const s=this.quill.selection.normalizeNative(e),i=s?this.quill.selection.normalizedToRange(s):null;i&&this.replaceText(i,n)&&t.preventDefault()}handleCompositionStart(){const t=this.quill.getSelection();t&&this.replaceText(t)}}function Wg(r){var t;return typeof r.data=="string"?r.data:(t=r.dataTransfer)!=null&&t.types.includes("text/plain")?r.dataTransfer.getData("text/plain"):null}const Kg=/Mac/i.test(navigator.platform),Vg=100,Gg=r=>!!(r.key==="ArrowLeft"||r.key==="ArrowRight"||r.key==="ArrowUp"||r.key==="ArrowDown"||r.key==="Home"||Kg&&r.key==="a"&&r.ctrlKey===!0);class Zg extends Xt{constructor(e,n){super(e,n);D(this,"isListening",!1);D(this,"selectionChangeDeadline",0);this.handleArrowKeys(),this.handleNavigationShortcuts()}handleArrowKeys(){this.quill.keyboard.addBinding({key:["ArrowLeft","ArrowRight"],offset:0,shiftKey:null,handler(e,n){let{line:s,event:i}=n;if(!(s instanceof se)||!s.uiNode)return!0;const a=getComputedStyle(s.domNode).direction==="rtl";return a&&i.key!=="ArrowRight"||!a&&i.key!=="ArrowLeft"?!0:(this.quill.setSelection(e.index-1,e.length+(i.shiftKey?1:0),x.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",e=>{!e.defaultPrevented&&Gg(e)&&this.ensureListeningToSelectionChange()})}ensureListeningToSelectionChange(){if(this.selectionChangeDeadline=Date.now()+Vg,this.isListening)return;this.isListening=!0;const e=()=>{this.isListening=!1,Date.now()<=this.selectionChangeDeadline&&this.handleSelectionChange()};document.addEventListener("selectionchange",e,{once:!0})}handleSelectionChange(){const e=document.getSelection();if(!e)return;const n=e.getRangeAt(0);if(n.collapsed!==!0||n.startOffset!==0)return;const s=this.quill.scroll.find(n.startContainer);if(!(s instanceof se)||!s.uiNode)return;const i=document.createRange();i.setStartAfter(s.uiNode),i.setEndAfter(s.uiNode),e.removeAllRanges(),e.addRange(i)}}x.register({"blots/block":St,"blots/block/embed":Gt,"blots/break":ie,"blots/container":an,"blots/cursor":kn,"blots/embed":ii,"blots/inline":ge,"blots/scroll":Bn,"blots/text":oe,"modules/clipboard":Tl,"modules/history":Cl,"modules/keyboard":ns,"modules/uploader":kl,"modules/input":zg,"modules/uiNode":Zg});class Xg extends re{add(t,e){let n=0;if(e==="+1"||e==="-1"){const s=this.value(t)||0;n=e==="+1"?s+1:s-1}else typeof e=="number"&&(n=e);return n===0?(this.remove(t),!0):super.add(t,n.toString())}canAdd(t,e){return super.canAdd(t,e)||super.canAdd(t,parseInt(e,10))}value(t){return parseInt(super.value(t),10)||void 0}}const Yg=new Xg("indent","ql-indent",{scope:F.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class yi extends St{}D(yi,"blotName","blockquote"),D(yi,"tagName","blockquote");class vi extends St{static formats(t){return this.tagName.indexOf(t.tagName)+1}}D(vi,"blotName","header"),D(vi,"tagName",["H1","H2","H3","H4","H5","H6"]);class lr extends an{}lr.blotName="list-container",lr.tagName="OL";class cr extends St{static create(t){const e=super.create();return e.setAttribute("data-list",t),e}static formats(t){return t.getAttribute("data-list")||void 0}static register(){x.register(lr)}constructor(t,e){super(t,e);const n=e.ownerDocument.createElement("span"),s=i=>{if(!t.isEnabled())return;const a=this.statics.formats(e,t);a==="checked"?(this.format("list","unchecked"),i.preventDefault()):a==="unchecked"&&(this.format("list","checked"),i.preventDefault())};n.addEventListener("mousedown",s),n.addEventListener("touchstart",s),this.attachUI(n)}format(t,e){t===this.statics.blotName&&e?this.domNode.setAttribute("data-list",e):super.format(t,e)}}cr.blotName="list",cr.tagName="LI",lr.allowedChildren=[cr],cr.requiredContainer=lr;class ur extends ge{static create(){return super.create()}static formats(){return!0}optimize(t){super.optimize(t),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}D(ur,"blotName","bold"),D(ur,"tagName",["STRONG","B"]);class _i extends ur{}D(_i,"blotName","italic"),D(_i,"tagName",["EM","I"]);class Fe extends ge{static create(t){const e=super.create(t);return e.setAttribute("href",this.sanitize(t)),e.setAttribute("rel","noopener noreferrer"),e.setAttribute("target","_blank"),e}static formats(t){return t.getAttribute("href")}static sanitize(t){return ql(t,this.PROTOCOL_WHITELIST)?t:this.SANITIZED_URL}format(t,e){t!==this.statics.blotName||!e?super.format(t,e):this.domNode.setAttribute("href",this.constructor.sanitize(e))}}D(Fe,"blotName","link"),D(Fe,"tagName","A"),D(Fe,"SANITIZED_URL","about:blank"),D(Fe,"PROTOCOL_WHITELIST",["http","https","mailto","tel","sms"]);function ql(r,t){const e=document.createElement("a");e.href=r;const n=e.href.slice(0,e.href.indexOf(":"));return t.indexOf(n)>-1}class Ni extends ge{static create(t){return t==="super"?document.createElement("sup"):t==="sub"?document.createElement("sub"):super.create(t)}static formats(t){if(t.tagName==="SUB")return"sub";if(t.tagName==="SUP")return"super"}}D(Ni,"blotName","script"),D(Ni,"tagName",["SUB","SUP"]);class Ai extends ur{}D(Ai,"blotName","strike"),D(Ai,"tagName",["S","STRIKE"]);class wi extends ge{}D(wi,"blotName","underline"),D(wi,"tagName","U");class is extends ii{static create(t){if(window.katex==null)throw new Error("Formula module requires KaTeX.");const e=super.create(t);return typeof t=="string"&&(window.katex.render(t,e,{throwOnError:!1,errorColor:"#f00"}),e.setAttribute("data-value",t)),e}static value(t){return t.getAttribute("data-value")}html(){const{formula:t}=this.value();return`<span>${t}</span>`}}D(is,"blotName","formula"),D(is,"className","ql-formula"),D(is,"tagName","SPAN");const Ol=["alt","height","width"];class Ei extends Vt{static create(t){const e=super.create(t);return typeof t=="string"&&e.setAttribute("src",this.sanitize(t)),e}static formats(t){return Ol.reduce((e,n)=>(t.hasAttribute(n)&&(e[n]=t.getAttribute(n)),e),{})}static match(t){return/\.(jpe?g|gif|png)$/.test(t)||/^data:image\/.+;base64/.test(t)}static sanitize(t){return ql(t,["http","https","data"])?t:"//:0"}static value(t){return t.getAttribute("src")}format(t,e){Ol.indexOf(t)>-1?e?this.domNode.setAttribute(t,e):this.domNode.removeAttribute(t):super.format(t,e)}}D(Ei,"blotName","image"),D(Ei,"tagName","IMG");const Il=["height","width"];class os extends Gt{static create(t){const e=super.create(t);return e.setAttribute("frameborder","0"),e.setAttribute("allowfullscreen","true"),e.setAttribute("src",this.sanitize(t)),e}static formats(t){return Il.reduce((e,n)=>(t.hasAttribute(n)&&(e[n]=t.getAttribute(n)),e),{})}static sanitize(t){return Fe.sanitize(t)}static value(t){return t.getAttribute("src")}format(t,e){Il.indexOf(t)>-1?e?this.domNode.setAttribute(t,e):this.domNode.removeAttribute(t):super.format(t,e)}html(){const{video:t}=this.value();return`<a href="${t}">${t}</a>`}}D(os,"blotName","video"),D(os,"className","ql-video"),D(os,"tagName","IFRAME");const hr=new re("code-token","hljs",{scope:F.INLINE});class Ce extends ge{static formats(t,e){for(;t!=null&&t!==e.domNode;){if(t.classList&&t.classList.contains(It.className))return super.formats(t,e);t=t.parentNode}}constructor(t,e,n){super(t,e,n),hr.add(this.domNode,n)}format(t,e){t!==Ce.blotName?super.format(t,e):e?hr.add(this.domNode,e):(hr.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),hr.value(this.domNode)||this.unwrap()}}Ce.blotName="code-token",Ce.className="ql-token";class Yt extends It{static create(t){const e=super.create(t);return typeof t=="string"&&e.setAttribute("data-language",t),e}static formats(t){return t.getAttribute("data-language")||"plain"}static register(){}format(t,e){t===this.statics.blotName&&e?this.domNode.setAttribute("data-language",e):super.format(t,e)}replaceWith(t,e){return this.formatAt(0,this.length(),Ce.blotName,!1),super.replaceWith(t,e)}}class dr extends ln{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(t,e){t===Yt.blotName&&(this.forceNext=!0,this.children.forEach(n=>{n.format(t,e)}))}formatAt(t,e,n,s){n===Yt.blotName&&(this.forceNext=!0),super.formatAt(t,e,n,s)}highlight(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.children.head==null)return;const s=`${Array.from(this.domNode.childNodes).filter(a=>a!==this.uiNode).map(a=>a.textContent).join(`
41
+ `)}
42
+ `,i=Yt.formats(this.children.head.domNode);if(e||this.forceNext||this.cachedText!==s){if(s.trim().length>0||this.cachedText==null){const a=this.children.reduce((c,h)=>c.concat(Ja(h,!1)),new H),l=t(s,i);a.diff(l).reduce((c,h)=>{let{retain:g,attributes:v}=h;return g?(v&&Object.keys(v).forEach(f=>{[Yt.blotName,Ce.blotName].includes(f)&&this.formatAt(c,g,f,v[f])}),c+g):c},0)}this.cachedText=s,this.forceNext=!1}}html(t,e){const[n]=this.children.find(t);return`<pre data-language="${n?Yt.formats(n.domNode):"plain"}">
43
+ ${Qr(this.code(t,e))}
44
+ </pre>`}optimize(t){if(super.optimize(t),this.parent!=null&&this.children.head!=null&&this.uiNode!=null){const e=Yt.formats(this.children.head.domNode);e!==this.uiNode.value&&(this.uiNode.value=e)}}}dr.allowedChildren=[Yt],Yt.requiredContainer=dr,Yt.allowedChildren=[Ce,kn,oe,ie];const Qg=(r,t,e)=>{if(typeof r.versionString=="string"){const n=r.versionString.split(".")[0];if(parseInt(n,10)>=11)return r.highlight(e,{language:t}).value}return r.highlight(t,e).value};class Bl extends Xt{static register(){x.register(Ce,!0),x.register(Yt,!0),x.register(dr,!0)}constructor(t,e){if(super(t,e),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(x.events.SCROLL_BLOT_MOUNT,t=>{if(!(t instanceof dr))return;const e=this.quill.root.ownerDocument.createElement("select");this.options.languages.forEach(n=>{let{key:s,label:i}=n;const a=e.ownerDocument.createElement("option");a.textContent=i,a.setAttribute("value",s),e.appendChild(a)}),e.addEventListener("change",()=>{t.format(Yt.blotName,e.value),this.quill.root.focus(),this.highlight(t,!0)}),t.uiNode==null&&(t.attachUI(e),t.children.head&&(e.value=Yt.formats(t.children.head.domNode)))})}initTimer(){let t=null;this.quill.on(x.events.SCROLL_OPTIMIZE,()=>{t&&clearTimeout(t),t=setTimeout(()=>{this.highlight(),t=null},this.options.interval)})}highlight(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.quill.selection.composing)return;this.quill.update(x.sources.USER);const n=this.quill.getSelection();(t==null?this.quill.scroll.descendants(dr):[t]).forEach(i=>{i.highlight(this.highlightBlot,e)}),this.quill.update(x.sources.SILENT),n!=null&&this.quill.setSelection(n,x.sources.SILENT)}highlightBlot(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"plain";if(e=this.languages[e]?e:"plain",e==="plain")return Qr(t).split(`
45
+ `).reduce((s,i,a)=>(a!==0&&s.insert(`
46
+ `,{[It.blotName]:e}),s.insert(i)),new H);const n=this.quill.root.ownerDocument.createElement("div");return n.classList.add(It.className),n.innerHTML=Qg(this.options.hljs,e,t),gi(this.quill.scroll,n,[(s,i)=>{const a=hr.value(s);return a?i.compose(new H().retain(i.length(),{[Ce.blotName]:a})):i}],[(s,i)=>s.data.split(`
47
+ `).reduce((a,l,c)=>(c!==0&&a.insert(`
48
+ `,{[It.blotName]:e}),a.insert(l)),i)],new WeakMap)}}Bl.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 br=class br extends St{static create(t){const e=super.create();return t?e.setAttribute("data-row",t):e.setAttribute("data-row",Ti()),e}static formats(t){if(t.hasAttribute("data-row"))return t.getAttribute("data-row")}cellOffset(){return this.parent?this.parent.children.indexOf(this):-1}format(t,e){t===br.blotName&&e?this.domNode.setAttribute("data-row",e):super.format(t,e)}row(){return this.parent}rowOffset(){return this.row()?this.row().rowOffset():-1}table(){return this.row()&&this.row().table()}};D(br,"blotName","table"),D(br,"tagName","TD");let le=br;class Se extends an{checkMerge(){if(super.checkMerge()&&this.next.children.head!=null){const t=this.children.head.formats(),e=this.children.tail.formats(),n=this.next.children.head.formats(),s=this.next.children.tail.formats();return t.table===e.table&&t.table===n.table&&t.table===s.table}return!1}optimize(t){super.optimize(t),this.children.forEach(e=>{if(e.next==null)return;const n=e.formats(),s=e.next.formats();if(n.table!==s.table){const i=this.splitAfter(e);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}}D(Se,"blotName","table-row"),D(Se,"tagName","TR");class me extends an{}D(me,"blotName","table-body"),D(me,"tagName","TBODY");class jn extends an{balanceCells(){const t=this.descendants(Se),e=t.reduce((n,s)=>Math.max(s.children.length,n),0);t.forEach(n=>{new Array(e-n.children.length).fill(0).forEach(()=>{let s;n.children.head!=null&&(s=le.formats(n.children.head.domNode));const i=this.scroll.create(le.blotName,s);n.appendChild(i),i.optimize()})})}cells(t){return this.rows().map(e=>e.children.at(t))}deleteColumn(t){const[e]=this.descendant(me);e==null||e.children.head==null||e.children.forEach(n=>{const s=n.children.at(t);s!=null&&s.remove()})}insertColumn(t){const[e]=this.descendant(me);e==null||e.children.head==null||e.children.forEach(n=>{const s=n.children.at(t),i=le.formats(n.children.head.domNode),a=this.scroll.create(le.blotName,i);n.insertBefore(a,s)})}insertRow(t){const[e]=this.descendant(me);if(e==null||e.children.head==null)return;const n=Ti(),s=this.scroll.create(Se.blotName);e.children.head.children.forEach(()=>{const a=this.scroll.create(le.blotName,n);s.appendChild(a)});const i=e.children.at(t);e.insertBefore(s,i)}rows(){const t=this.children.head;return t==null?[]:t.children.map(e=>e)}}D(jn,"blotName","table-container"),D(jn,"tagName","TABLE"),jn.allowedChildren=[me],me.requiredContainer=jn,me.allowedChildren=[Se],Se.requiredContainer=me,Se.allowedChildren=[le],le.requiredContainer=Se;function Ti(){return`row-${Math.random().toString(36).slice(2,6)}`}class Jg extends Xt{static register(){x.register(le),x.register(Se),x.register(me),x.register(jn)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(jn).forEach(t=>{t.balanceCells()})}deleteColumn(){const[t,,e]=this.getTable();e!=null&&(t.deleteColumn(e.cellOffset()),this.quill.update(x.sources.USER))}deleteRow(){const[,t]=this.getTable();t!=null&&(t.remove(),this.quill.update(x.sources.USER))}deleteTable(){const[t]=this.getTable();if(t==null)return;const e=t.offset();t.remove(),this.quill.update(x.sources.USER),this.quill.setSelection(e,x.sources.SILENT)}getTable(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.quill.getSelection();if(t==null)return[null,null,null,-1];const[e,n]=this.quill.getLine(t.index);if(e==null||e.statics.blotName!==le.blotName)return[null,null,null,-1];const s=e.parent;return[s.parent.parent,s,e,n]}insertColumn(t){const e=this.quill.getSelection();if(!e)return;const[n,s,i]=this.getTable(e);if(i==null)return;const a=i.cellOffset();n.insertColumn(a+t),this.quill.update(x.sources.USER);let l=s.rowOffset();t===0&&(l+=1),this.quill.setSelection(e.index+l,e.length,x.sources.SILENT)}insertColumnLeft(){this.insertColumn(0)}insertColumnRight(){this.insertColumn(1)}insertRow(t){const e=this.quill.getSelection();if(!e)return;const[n,s,i]=this.getTable(e);if(i==null)return;const a=s.rowOffset();n.insertRow(a+t),this.quill.update(x.sources.USER),t>0?this.quill.setSelection(e,x.sources.SILENT):this.quill.setSelection(e.index+s.children.length,e.length,x.sources.SILENT)}insertRowAbove(){this.insertRow(0)}insertRowBelow(){this.insertRow(1)}insertTable(t,e){const n=this.quill.getSelection();if(n==null)return;const s=new Array(t).fill(0).reduce(i=>{const a=new Array(e).fill(`
49
+ `).join("");return i.insert(a,{table:Ti()})},new H().retain(n.index));this.quill.updateContents(s,x.sources.USER),this.quill.setSelection(n.index,x.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(x.events.SCROLL_OPTIMIZE,t=>{t.some(e=>["TD","TR","TBODY","TABLE"].includes(e.target.tagName)?(this.quill.once(x.events.TEXT_CHANGE,(n,s,i)=>{i===x.sources.USER&&this.balanceTables()}),!0):!1)})}}const jl=xe("quill:toolbar");class xi extends Xt{constructor(t,e){var n,s;if(super(t,e),Array.isArray(this.options.container)){const i=document.createElement("div");i.setAttribute("role","toolbar"),t1(i,this.options.container),(s=(n=t.container)==null?void 0:n.parentNode)==null||s.insertBefore(i,t.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)){jl.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 l;const a=(l=this.options.handlers)==null?void 0:l[i];a&&this.addHandler(i,a)}),Array.from(this.container.querySelectorAll("button, select")).forEach(i=>{this.attach(i)}),this.quill.on(x.events.EDITOR_CHANGE,()=>{const[i]=this.quill.selection.getRange();this.update(i)})}addHandler(t,e){this.handlers[t]=e}attach(t){let e=Array.from(t.classList).find(s=>s.indexOf("ql-")===0);if(!e)return;if(e=e.slice(3),t.tagName==="BUTTON"&&t.setAttribute("type","button"),this.handlers[e]==null&&this.quill.scroll.query(e)==null){jl.warn("ignoring attaching to nonexistent format",e,t);return}const n=t.tagName==="SELECT"?"change":"click";t.addEventListener(n,s=>{let i;if(t.tagName==="SELECT"){if(t.selectedIndex<0)return;const l=t.options[t.selectedIndex];l.hasAttribute("selected")?i=!1:i=l.value||!1}else t.classList.contains("ql-active")?i=!1:i=t.value||!t.hasAttribute("value"),s.preventDefault();this.quill.focus();const[a]=this.quill.selection.getRange();if(this.handlers[e]!=null)this.handlers[e].call(this,i);else if(this.quill.scroll.query(e).prototype instanceof Vt){if(i=prompt(`Enter ${e}`),!i)return;this.quill.updateContents(new H().retain(a.index).delete(a.length).insert({[e]:i}),x.sources.USER)}else this.quill.format(e,i,x.sources.USER);this.update(a)}),this.controls.push([e,t])}update(t){const e=t==null?{}:this.quill.getFormat(t);this.controls.forEach(n=>{const[s,i]=n;if(i.tagName==="SELECT"){let a=null;if(t==null)a=null;else if(e[s]==null)a=i.querySelector("option[selected]");else if(!Array.isArray(e[s])){let l=e[s];typeof l=="string"&&(l=l.replace(/"/g,'\\"')),a=i.querySelector(`option[value="${l}"]`)}a==null?(i.value="",i.selectedIndex=-1):a.selected=!0}else if(t==null)i.classList.remove("ql-active"),i.setAttribute("aria-pressed","false");else if(i.hasAttribute("value")){const a=e[s],l=a===i.getAttribute("value")||a!=null&&a.toString()===i.getAttribute("value")||a==null&&!i.getAttribute("value");i.classList.toggle("ql-active",l),i.setAttribute("aria-pressed",l.toString())}else{const a=e[s]!=null;i.classList.toggle("ql-active",a),i.setAttribute("aria-pressed",a.toString())}})}}xi.DEFAULTS={};function Dl(r,t,e){const n=document.createElement("button");n.setAttribute("type","button"),n.classList.add(`ql-${t}`),n.setAttribute("aria-pressed","false"),e!=null?(n.value=e,n.setAttribute("aria-label",`${t}: ${e}`)):n.setAttribute("aria-label",t),r.appendChild(n)}function t1(r,t){Array.isArray(t[0])||(t=[t]),t.forEach(e=>{const n=document.createElement("span");n.classList.add("ql-formats"),e.forEach(s=>{if(typeof s=="string")Dl(n,s);else{const i=Object.keys(s)[0],a=s[i];Array.isArray(a)?e1(n,i,a):Dl(n,i,a)}}),r.appendChild(n)})}function e1(r,t,e){const n=document.createElement("select");n.classList.add(`ql-${t}`),e.forEach(s=>{const i=document.createElement("option");s!==!1?i.setAttribute("value",String(s)):i.setAttribute("selected","selected"),n.appendChild(i)}),r.appendChild(n)}xi.DEFAULTS={container:null,handlers:{clean(){const r=this.quill.getSelection();if(r!=null)if(r.length===0){const t=this.quill.getFormat();Object.keys(t).forEach(e=>{this.quill.scroll.query(e,F.INLINE)!=null&&this.quill.format(e,!1,x.sources.USER)})}else this.quill.removeFormat(r.index,r.length,x.sources.USER)},direction(r){const{align:t}=this.quill.getFormat();r==="rtl"&&t==null?this.quill.format("align","right",x.sources.USER):!r&&t==="right"&&this.quill.format("align",!1,x.sources.USER),this.quill.format("direction",r,x.sources.USER)},indent(r){const t=this.quill.getSelection(),e=this.quill.getFormat(t),n=parseInt(e.indent||0,10);if(r==="+1"||r==="-1"){let s=r==="+1"?1:-1;e.direction==="rtl"&&(s*=-1),this.quill.format("indent",n+s,x.sources.USER)}},link(r){r===!0&&(r=prompt("Enter link URL:")),this.quill.format("link",r,x.sources.USER)},list(r){const t=this.quill.getSelection(),e=this.quill.getFormat(t);r==="check"?e.list==="checked"||e.list==="unchecked"?this.quill.format("list",!1,x.sources.USER):this.quill.format("list","unchecked",x.sources.USER):this.quill.format("list",r,x.sources.USER)}}};const n1='<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>',r1='<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>',s1='<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>',i1='<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>',o1='<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>',a1='<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>',l1='<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>',c1='<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>',$l='<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>',fr={align:{"":n1,center:r1,right:s1,justify:i1},background:o1,blockquote:a1,bold:l1,clean:c1,code:$l,"code-block":$l,color:'<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>',direction:{"":'<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>',rtl:'<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>'},formula:'<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>',header:{1:'<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>',2:'<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>',3:'<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>',4:'<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>',5:'<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>',6:'<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>'},italic:'<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>',image:'<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>',indent:{"+1":'<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>',"-1":'<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>'},link:'<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>',list:{bullet:'<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>',check:'<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>',ordered:'<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>'},script:{sub:'<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>',super:'<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>'},strike:'<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>',table:'<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>',underline:'<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>',video:'<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>'},u1='<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 Ml=0;function Pl(r,t){r.setAttribute(t,`${r.getAttribute(t)!=="true"}`)}class as{constructor(t){this.select=t,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",()=>{this.togglePicker()}),this.label.addEventListener("keydown",e=>{switch(e.key){case"Enter":this.togglePicker();break;case"Escape":this.escape(),e.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}togglePicker(){this.container.classList.toggle("ql-expanded"),Pl(this.label,"aria-expanded"),Pl(this.options,"aria-hidden")}buildItem(t){const e=document.createElement("span");e.tabIndex="0",e.setAttribute("role","button"),e.classList.add("ql-picker-item");const n=t.getAttribute("value");return n&&e.setAttribute("data-value",n),t.textContent&&e.setAttribute("data-label",t.textContent),e.addEventListener("click",()=>{this.selectItem(e,!0)}),e.addEventListener("keydown",s=>{switch(s.key){case"Enter":this.selectItem(e,!0),s.preventDefault();break;case"Escape":this.escape(),s.preventDefault();break}}),e}buildLabel(){const t=document.createElement("span");return t.classList.add("ql-picker-label"),t.innerHTML=u1,t.tabIndex="0",t.setAttribute("role","button"),t.setAttribute("aria-expanded","false"),this.container.appendChild(t),t}buildOptions(){const t=document.createElement("span");t.classList.add("ql-picker-options"),t.setAttribute("aria-hidden","true"),t.tabIndex="-1",t.id=`ql-picker-options-${Ml}`,Ml+=1,this.label.setAttribute("aria-controls",t.id),this.options=t,Array.from(this.select.options).forEach(e=>{const n=this.buildItem(e);t.appendChild(n),e.selected===!0&&this.selectItem(n)}),this.container.appendChild(t)}buildPicker(){Array.from(this.select.attributes).forEach(t=>{this.container.setAttribute(t.name,t.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(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const n=this.container.querySelector(".ql-selected");t!==n&&(n!=null&&n.classList.remove("ql-selected"),t!=null&&(t.classList.add("ql-selected"),this.select.selectedIndex=Array.from(t.parentNode.children).indexOf(t),t.hasAttribute("data-value")?this.label.setAttribute("data-value",t.getAttribute("data-value")):this.label.removeAttribute("data-value"),t.hasAttribute("data-label")?this.label.setAttribute("data-label",t.getAttribute("data-label")):this.label.removeAttribute("data-label"),e&&(this.select.dispatchEvent(new Event("change")),this.close())))}update(){let t;if(this.select.selectedIndex>-1){const n=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];t=this.select.options[this.select.selectedIndex],this.selectItem(n)}else this.selectItem(null);const e=t!=null&&t!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",e)}}class Ul extends as{constructor(t,e){super(t),this.label.innerHTML=e,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(t){const e=super.buildItem(t);return e.style.backgroundColor=t.getAttribute("value")||"",e}selectItem(t,e){super.selectItem(t,e);const n=this.label.querySelector(".ql-color-label"),s=t&&t.getAttribute("data-value")||"";n&&(n.tagName==="line"?n.style.stroke=s:n.style.fill=s)}}class Hl extends as{constructor(t,e){super(t),this.container.classList.add("ql-icon-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).forEach(n=>{n.innerHTML=e[n.getAttribute("data-value")||""]}),this.defaultItem=this.container.querySelector(".ql-selected"),this.selectItem(this.defaultItem)}selectItem(t,e){super.selectItem(t,e);const n=t||this.defaultItem;if(n!=null){if(this.label.innerHTML===n.innerHTML)return;this.label.innerHTML=n.innerHTML}}}const h1=r=>{const{overflowY:t}=getComputedStyle(r,null);return t!=="visible"&&t!=="clip"};class Rl{constructor(t,e){this.quill=t,this.boundsContainer=e||document.body,this.root=t.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,h1(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(t){const e=t.left+t.width/2-this.root.offsetWidth/2,n=t.bottom+this.quill.root.scrollTop;this.root.style.left=`${e}px`,this.root.style.top=`${n}px`,this.root.classList.remove("ql-flip");const s=this.boundsContainer.getBoundingClientRect(),i=this.root.getBoundingClientRect();let a=0;if(i.right>s.right&&(a=s.right-i.right,this.root.style.left=`${e+a}px`),i.left<s.left&&(a=s.left-i.left,this.root.style.left=`${e+a}px`),i.bottom>s.bottom){const l=i.bottom-i.top,c=t.bottom-t.top+l;this.root.style.top=`${n-c}px`,this.root.classList.add("ql-flip")}return a}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}const d1=[!1,"center","right","justify"],f1=["#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"],p1=[!1,"serif","monospace"],g1=["1","2","3",!1],m1=["small",!1,"large","huge"];class pr extends On{constructor(t,e){super(t,e);const n=s=>{if(!document.body.contains(t.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()})};t.emitter.listenDOM("click",document.body,n)}addModule(t){const e=super.addModule(t);return t==="toolbar"&&this.extendToolbar(e),e}buildButtons(t,e){Array.from(t).forEach(n=>{(n.getAttribute("class")||"").split(/\s+/).forEach(i=>{if(i.startsWith("ql-")&&(i=i.slice(3),e[i]!=null))if(i==="direction")n.innerHTML=e[i][""]+e[i].rtl;else if(typeof e[i]=="string")n.innerHTML=e[i];else{const a=n.value||"";a!=null&&e[i][a]&&(n.innerHTML=e[i][a])}})})}buildPickers(t,e){this.pickers=Array.from(t).map(s=>{if(s.classList.contains("ql-align")&&(s.querySelector("option")==null&&gr(s,d1),typeof e.align=="object"))return new Hl(s,e.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&&gr(s,f1,i==="background"?"#ffffff":"#000000"),new Ul(s,e[i])}return s.querySelector("option")==null&&(s.classList.contains("ql-font")?gr(s,p1):s.classList.contains("ql-header")?gr(s,g1):s.classList.contains("ql-size")&&gr(s,m1)),new as(s)});const n=()=>{this.pickers.forEach(s=>{s.update()})};this.quill.on(P.events.EDITOR_CHANGE,n)}}pr.DEFAULTS=Me({},On.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 t=this.quill.getSelection(!0);this.quill.uploader.upload(t,r.files),r.value=""}),this.container.appendChild(r)),r.click()},video(){this.quill.theme.tooltip.edit("video")}}}}});class Fl extends Rl{constructor(t,e){super(t,e),this.textbox=this.root.querySelector('input[type="text"]'),this.listen()}listen(){this.textbox.addEventListener("keydown",t=>{t.key==="Enter"?(this.save(),t.preventDefault()):t.key==="Escape"&&(this.cancel(),t.preventDefault())})}cancel(){this.hide(),this.restoreFocus()}edit(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",e=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;e!=null?this.textbox.value=e:t!==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-${t}`)||""),this.root.setAttribute("data-mode",t)}restoreFocus(){this.quill.focus({preventScroll:!0})}save(){let{value:t}=this.textbox;switch(this.root.getAttribute("data-mode")){case"link":{const{scrollTop:e}=this.quill.root;this.linkRange?(this.quill.formatText(this.linkRange,"link",t,P.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",t,P.sources.USER)),this.quill.root.scrollTop=e;break}case"video":t=b1(t);case"formula":{if(!t)break;const e=this.quill.getSelection(!0);if(e!=null){const n=e.index+e.length;this.quill.insertEmbed(n,this.root.getAttribute("data-mode"),t,P.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(n+1," ",P.sources.USER),this.quill.setSelection(n+2,P.sources.USER)}break}}this.textbox.value="",this.hide()}}function b1(r){let t=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 t?`${t[1]||"https"}://www.youtube.com/embed/${t[2]}?showinfo=0`:(t=r.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?`${t[1]||"https"}://player.vimeo.com/video/${t[2]}/`:r}function gr(r,t){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;t.forEach(n=>{const s=document.createElement("option");n===e?s.setAttribute("selected","selected"):s.setAttribute("value",String(n)),r.appendChild(s)})}const y1=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class zl extends Fl{constructor(t,e){super(t,e),this.quill.on(P.events.EDITOR_CHANGE,(n,s,i,a)=>{if(n===P.events.SELECTION_CHANGE)if(s!=null&&s.length>0&&a===P.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width=`${this.root.offsetWidth}px`;const l=this.quill.getLines(s.index,s.length);if(l.length===1){const c=this.quill.getBounds(s);c!=null&&this.position(c)}else{const c=l[l.length-1],h=this.quill.getIndex(c),g=Math.min(c.length()-1,s.index+s.length-h),v=this.quill.getBounds(new He(h,g));v!=null&&this.position(v)}}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(P.events.SCROLL_OPTIMIZE,()=>{setTimeout(()=>{if(this.root.classList.contains("ql-hidden"))return;const t=this.quill.getSelection();if(t!=null){const e=this.quill.getBounds(t);e!=null&&this.position(e)}},1)})}cancel(){this.show()}position(t){const e=super.position(t),n=this.root.querySelector(".ql-tooltip-arrow");return n.style.marginLeft="",e!==0&&(n.style.marginLeft=`${-1*e-n.offsetWidth/2}px`),e}}D(zl,"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 Wl extends pr{constructor(t,e){e.modules.toolbar!=null&&e.modules.toolbar.container==null&&(e.modules.toolbar.container=y1),super(t,e),this.quill.container.classList.add("ql-bubble")}extendToolbar(t){this.tooltip=new zl(this.quill,this.options.bounds),t.container!=null&&(this.tooltip.root.appendChild(t.container),this.buildButtons(t.container.querySelectorAll("button"),fr),this.buildPickers(t.container.querySelectorAll("select"),fr))}}Wl.DEFAULTS=Me({},pr.DEFAULTS,{modules:{toolbar:{handlers:{link(r){r?this.quill.theme.tooltip.edit():this.quill.format("link",!1,x.sources.USER)}}}}});const v1=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class Kl extends Fl{constructor(){super(...arguments);D(this,"preview",this.root.querySelector("a.ql-preview"))}listen(){super.listen(),this.root.querySelector("a.ql-action").addEventListener("click",e=>{this.root.classList.contains("ql-editing")?this.save():this.edit("link",this.preview.textContent),e.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",e=>{if(this.linkRange!=null){const n=this.linkRange;this.restoreFocus(),this.quill.formatText(n,"link",!1,P.sources.USER),delete this.linkRange}e.preventDefault(),this.hide()}),this.quill.on(P.events.SELECTION_CHANGE,(e,n,s)=>{if(e!=null){if(e.length===0&&s===P.sources.USER){const[i,a]=this.quill.scroll.descendant(Fe,e.index);if(i!=null){this.linkRange=new He(e.index-a,i.length());const l=Fe.formats(i.domNode);this.preview.textContent=l,this.preview.setAttribute("href",l),this.show();const c=this.quill.getBounds(this.linkRange);c!=null&&this.position(c);return}}else delete this.linkRange;this.hide()}})}show(){super.show(),this.root.removeAttribute("data-mode")}}D(Kl,"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 Vl extends pr{constructor(t,e){e.modules.toolbar!=null&&e.modules.toolbar.container==null&&(e.modules.toolbar.container=v1),super(t,e),this.quill.container.classList.add("ql-snow")}extendToolbar(t){t.container!=null&&(t.container.classList.add("ql-snow"),this.buildButtons(t.container.querySelectorAll("button"),fr),this.buildPickers(t.container.querySelectorAll("select"),fr),this.tooltip=new Kl(this.quill,this.options.bounds),t.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"k",shortKey:!0},(e,n)=>{t.handlers.link.call(t,!n.format.link)}))}}Vl.DEFAULTS=Me({},pr.DEFAULTS,{modules:{toolbar:{handlers:{link(r){if(r){const t=this.quill.getSelection();if(t==null||t.length===0)return;let e=this.quill.getText(t);/^\S+@\S+\.\S+$/.test(e)&&e.indexOf("mailto:")!==0&&(e=`mailto:${e}`);const{tooltip:n}=this.quill.theme;n.edit("link",e)}else this.quill.format("link",!1,x.sources.USER)}}}}}),x.register({"attributors/attribute/direction":fl,"attributors/class/align":ul,"attributors/class/background":ag,"attributors/class/color":og,"attributors/class/direction":pl,"attributors/class/font":bl,"attributors/class/size":vl,"attributors/style/align":hl,"attributors/style/background":ui,"attributors/style/color":ci,"attributors/style/direction":gl,"attributors/style/font":yl,"attributors/style/size":_l},!0),x.register({"formats/align":ul,"formats/direction":pl,"formats/indent":Yg,"formats/background":ui,"formats/color":ci,"formats/font":bl,"formats/size":vl,"formats/blockquote":yi,"formats/code-block":It,"formats/header":vi,"formats/list":cr,"formats/bold":ur,"formats/code":hi,"formats/italic":_i,"formats/link":Fe,"formats/script":Ni,"formats/strike":Ai,"formats/underline":wi,"formats/formula":is,"formats/image":Ei,"formats/video":os,"modules/syntax":Bl,"modules/table":Jg,"modules/toolbar":xi,"themes/bubble":Wl,"themes/snow":Vl,"ui/icons":fr,"ui/picker":as,"ui/icon-picker":Hl,"ui/color-picker":Ul,"ui/tooltip":Rl},!0);const _1=Object.freeze(Object.defineProperty({__proto__:null,AttributeMap:Mt.AttributeMap,Delta:H,Module:Xt,Op:Mt.Op,OpIterator:Mt.OpIterator,Parchment:Ua,Range:He,default:x},Symbol.toStringTag,{value:"Module"}));z.AlertBox=Hc,z.Breadcrumb=Nc,z.Card=jr,z.Chip=To,z.ConfirmDialog=Jc,z.ContrastButton=ic,z.Dropdown=Ac,z.FileUploadDropzone=Mc,z.IconCard=Ic,z.InputText=Tc,z.Modal=Bo,z.MultiSelect=Ec,z.OrderStatusTag=Do,z.OrderTable=ou,z.PrimaryButton=vo,z.ProductTable=tu,z.ProductTableIconAddButton=Dr,z.RichTextEditor=lc,z.SecondaryButton=As,z.SelectButton=xc,z.SideMenu=Rc,z.Spinner=cc,z.Tabs=oc,z.TertiaryButton=sc,z.Timeline=lu,z.Toast=Oo,z.ToastProvider=Yc,z.TopNav=zc,z.Wizard=au,z.useToast=Qc,Object.defineProperty(z,Symbol.toStringTag,{value:"Module"})}));