@cmgfi/clear-ds 1.2.4 → 1.2.5
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.
- package/dist/index.cjs +36 -36
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +2 -23
- package/dist/index.mjs +3318 -3315
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),x=require("react"),Ut=require("react-dom"),ip="_wrapper_soper_7",op="_disabled_soper_15",lp="_input_soper_21",ap="_box_soper_35",cp="_sm_soper_50",dp="_checkmark_soper_54",up="_dash_soper_58",hp="_label_soper_61",fp="_md_soper_66",pp="_lg_soper_82",mp="_indeterminate_soper_118",gp="_invalid_soper_154",bp="_helperText_soper_217",yp="_errorText_soper_225 _helperText_soper_217",kt={wrapper:ip,disabled:op,input:lp,box:ap,sm:cp,checkmark:dp,dash:up,label:hp,md:fp,lg:pp,indeterminate:mp,invalid:gp,helperText:bp,errorText:yp},Gn=x.forwardRef(({label:t,indeterminate:e=!1,invalid:n=!1,helperText:r,size:s="md",disabled:i=!1,id:o,className:l,...a},c)=>{const u=x.useRef(null),h=c??u;x.useEffect(()=>{h.current&&(h.current.indeterminate=e)},[e,h]);const p=[kt.wrapper,kt[s],i?kt.disabled:"",n?kt.invalid:"",e?kt.indeterminate:"",l??""].filter(Boolean).join(" ");return d.jsxs("div",{children:[d.jsxs("label",{className:p,htmlFor:o,children:[d.jsx("input",{ref:h,type:"checkbox",id:o,disabled:i,className:kt.input,"aria-invalid":n||void 0,...a}),d.jsxs("span",{className:kt.box,"aria-hidden":"true",children:[d.jsx("svg",{className:kt.checkmark,viewBox:"0 0 11 11",children:d.jsx("polyline",{points:"1.5,5.5 4.5,8.5 9.5,2.5"})}),d.jsx("span",{className:kt.dash})]}),t&&d.jsx("span",{className:kt.label,children:t})]}),r&&d.jsx("span",{className:n?kt.errorText:kt.helperText,children:r})]})});Gn.displayName="Checkbox";const xp="_root_k9kb0_9",vp="_labelRow_k9kb0_19",_p="_labelText_k9kb0_25",kp="_requiredMark_k9kb0_31",wp="_inputWrap_k9kb0_39",Cp="_sm_k9kb0_53",Sp="_nativeInput_k9kb0_60",Np="_md_k9kb0_65",Ap="_lg_k9kb0_77",Tp="_iconSlot_k9kb0_113",Ep="_iconSlotSuffix_k9kb0_125",Mp="_disabled_k9kb0_131",jp="_invalid_k9kb0_146",Ip="_helperText_k9kb0_195",pt={root:xp,labelRow:vp,labelText:_p,requiredMark:kp,inputWrap:wp,sm:Cp,nativeInput:Sp,md:Np,lg:Ap,iconSlot:Tp,iconSlotSuffix:Ep,disabled:Mp,invalid:jp,helperText:Ip};let Dp=0;const gs=x.forwardRef(({label:t,required:e=!1,helperText:n,invalid:r=!1,size:s="md",prefixIcon:i,suffixIcon:o,disabled:l=!1,id:a,className:c,...u},h)=>{const p=a??`inputtext-${++Dp}`,f=[pt.root,pt[s],r?pt.invalid:"",l?pt.disabled:"",c??""].filter(Boolean).join(" ");return d.jsxs("div",{className:f,children:[t&&d.jsxs("label",{className:pt.labelRow,htmlFor:p,children:[d.jsx("span",{className:pt.labelText,children:t}),e&&d.jsx("span",{className:pt.requiredMark,"aria-hidden":"true",children:"*"})]}),d.jsxs("div",{className:pt.inputWrap,children:[i&&d.jsx("span",{className:pt.iconSlot,"aria-hidden":"true",children:i}),d.jsx("input",{ref:h,id:p,disabled:l,required:e,"aria-invalid":r||void 0,"aria-describedby":n?`${p}-helper`:void 0,className:pt.nativeInput,...u}),o&&d.jsx("span",{className:`${pt.iconSlot} ${pt.iconSlotSuffix}`,"aria-hidden":"true",children:o})]}),n&&d.jsx("span",{id:`${p}-helper`,className:pt.helperText,children:n})]})});gs.displayName="InputText";const Op="_listbox_fb69z_9",Rp="_invalid_fb69z_22",Lp="_listboxDisabled_fb69z_27",Bp="_header_fb69z_33",$p="_labelRow_fb69z_42",Pp="_label_fb69z_42",zp="_required_fb69z_55",Fp="_inputWrap_fb69z_63",Hp="_filterInput_fb69z_79",Wp="_iconSearch_fb69z_105",Vp="_iconButton_fb69z_121",qp="_helperText_fb69z_146",Up="_errorText_fb69z_153 _helperText_fb69z_146",Kp="_list_fb69z_9",Gp="_option_fb69z_169",Jp="_optionGroupItem_fb69z_184",Yp="_optionDisabled_fb69z_189",Qp="_optionHighlight_fb69z_200",Xp="_optionLabel_fb69z_212",Zp="_optionLabelDisabled_fb69z_220",em="_groupHeader_fb69z_226",tm="_checkbox_fb69z_238",nm="_checkboxChecked_fb69z_253",rm="_checkboxDisabled_fb69z_259",sm="_checkmark_fb69z_265",im="_checkmarkDisabled_fb69z_277",xe={listbox:Op,invalid:Rp,listboxDisabled:Lp,header:Bp,labelRow:$p,label:Pp,required:zp,inputWrap:Fp,filterInput:Hp,iconSearch:Wp,iconButton:Vp,helperText:qp,errorText:Up,list:Kp,option:Gp,optionGroupItem:Jp,optionDisabled:Yp,optionHighlight:Qp,optionLabel:Xp,optionLabelDisabled:Zp,groupHeader:em,checkbox:tm,checkboxChecked:nm,checkboxDisabled:rm,checkmark:sm,checkmarkDisabled:im};function om(t){return t.length>0&&"items"in t[0]}const wd=x.forwardRef(({options:t,value:e,onChange:n,multiple:r=!1,filter:s=!1,filterPlaceholder:i="Search…",label:o,required:l=!1,helperText:a,invalid:c=!1,disabled:u=!1,className:h,style:p},f)=>{const m=x.useId(),g=`${m}-filter`,b=`${m}-helper`,[y,v]=x.useState(""),_=x.useMemo(()=>e==null?[]:Array.isArray(e)?e:[e],[e]),w=om(t);function k(T){return!s||!y?!0:T.toLowerCase().includes(y.toLowerCase())}function C(T){if(!u)if(r){const P=_.includes(T)?_.filter(L=>L!==T):[..._,T];n==null||n(P)}else n==null||n(_[0]===T?null:T)}function N(T,P=!1){if(!k(T.label))return null;const L=_.includes(T.value),R=u||T.disabled,H=[xe.option,L?xe.optionHighlight:"",R?xe.optionDisabled:"",P?xe.optionGroupItem:""].filter(Boolean).join(" "),U=L&&R;return d.jsxs("div",{role:"option","aria-selected":L,"aria-disabled":R||void 0,className:H,onClick:()=>!R&&C(T.value),tabIndex:R?-1:0,onKeyDown:M=>{(M.key==="Enter"||M.key===" ")&&(M.preventDefault(),R||C(T.value))},children:[r&&d.jsx("span",{"aria-hidden":"true",className:[xe.checkbox,L&&!R?xe.checkboxChecked:"",R?xe.checkboxDisabled:""].filter(Boolean).join(" "),children:L&&d.jsx("svg",{className:U?`${xe.checkmark} ${xe.checkmarkDisabled}`:xe.checkmark,viewBox:"0 0 11 11",children:d.jsx("polyline",{points:"1.5,5.5 4.5,8.5 9.5,2.5"})})}),d.jsx("span",{className:R?`${xe.optionLabel} ${xe.optionLabelDisabled}`:xe.optionLabel,children:T.label})]},T.value)}function O(){return w?t.map(T=>{const P=T.items.map(L=>N(L,!0)).filter(Boolean);return P.length===0?null:d.jsxs("div",{children:[d.jsx("div",{className:xe.groupHeader,children:T.label}),P]},T.label)}):t.map(T=>N(T))}const B=[xe.listbox,c?xe.invalid:"",u?xe.listboxDisabled:"",h??""].filter(Boolean).join(" "),S=s||!!(o||a);return d.jsxs("div",{ref:f,className:B,style:p,children:[S&&d.jsxs("div",{className:xe.header,children:[o&&d.jsxs("div",{className:xe.labelRow,children:[d.jsx("label",{className:xe.label,htmlFor:g,children:o}),l&&d.jsx("span",{className:xe.required,"aria-hidden":"true",children:"*"})]}),s&&d.jsxs("div",{className:xe.inputWrap,children:[d.jsx("input",{id:g,type:"text",className:xe.filterInput,placeholder:i,value:y,onChange:T=>v(T.target.value),disabled:u,required:l,"aria-invalid":c||void 0,"aria-describedby":a?b:void 0}),y?d.jsx("button",{type:"button",className:xe.iconButton,onClick:()=>v(""),"aria-label":"Clear filter",tabIndex:-1,disabled:u,children:d.jsx("svg",{viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:d.jsx("path",{d:"M5 5L9 9M9 5L5 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}):d.jsx("span",{className:xe.iconSearch,"aria-hidden":"true",children:d.jsxs("svg",{viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("circle",{cx:"6",cy:"6",r:"4.5",stroke:"currentColor",strokeWidth:"1.5"}),d.jsx("path",{d:"M9.5 9.5L12.5 12.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})})]}),a&&d.jsx("span",{id:b,className:c?xe.errorText:xe.helperText,children:a})]}),d.jsx("div",{role:"listbox","aria-multiselectable":r||void 0,"aria-disabled":u||void 0,className:xe.list,children:O()})]})});wd.displayName="ListBox";const lm="_wrapper_1o7x9_7",am="_disabled_1o7x9_15",cm="_input_1o7x9_21",dm="_circle_1o7x9_35",um="_sm_1o7x9_50",hm="_dot_1o7x9_54",fm="_label_1o7x9_58",pm="_md_1o7x9_63",mm="_lg_1o7x9_76",gm="_invalid_1o7x9_151",bm="_helperText_1o7x9_175",ym="_errorText_1o7x9_183 _helperText_1o7x9_175",zt={wrapper:lm,disabled:am,input:cm,circle:dm,sm:um,dot:hm,label:fm,md:pm,lg:mm,invalid:gm,helperText:bm,errorText:ym},Cd=x.forwardRef(({label:t,invalid:e=!1,helperText:n,size:r="md",disabled:s=!1,id:i,className:o,...l},a)=>{const c=x.useRef(null),u=a??c,h=[zt.wrapper,zt[r],s?zt.disabled:"",e?zt.invalid:"",o??""].filter(Boolean).join(" ");return d.jsxs("div",{children:[d.jsxs("label",{className:h,htmlFor:i,children:[d.jsx("input",{ref:u,type:"radio",id:i,disabled:s,className:zt.input,"aria-invalid":e||void 0,...l}),d.jsx("span",{className:zt.circle,"aria-hidden":"true",children:d.jsx("span",{className:zt.dot})}),t&&d.jsx("span",{className:zt.label,children:t})]}),n&&d.jsx("span",{className:e?zt.errorText:zt.helperText,children:n})]})});Cd.displayName="RadioButton";const xm="_chip_12hjq_1",vm="_dismissible_12hjq_21",_m="_label_12hjq_33",km="_dismiss_12hjq_21",ks={chip:xm,dismissible:vm,label:_m,dismiss:km},wm={"red-darkest":{bg:"var(--red-800)",text:"var(--red-100)"},"red-dark":{bg:"var(--red-200)",text:"var(--red-900)"},"red-light":{bg:"var(--red-100)",text:"var(--red-800)"},"yellow-darkest":{bg:"var(--yellow-800)",text:"var(--yellow-50)"},"yellow-dark":{bg:"var(--yellow-300)",text:"var(--yellow-800)"},"yellow-light":{bg:"var(--yellow-100)",text:"var(--yellow-900)"},"green-darkest":{bg:"var(--green-800)",text:"var(--green-50)"},"green-dark":{bg:"var(--green-300)",text:"var(--green-800)"},"green-light":{bg:"var(--green-100)",text:"var(--green-800)"},"blue-darkest":{bg:"var(--blue-800)",text:"var(--blue-50)"},"blue-dark":{bg:"var(--blue-300)",text:"var(--blue-900)"},"blue-light":{bg:"var(--blue-100)",text:"var(--blue-900)"},"navy-darkest":{bg:"var(--navy-700)",text:"var(--navy-50)"},"navy-dark":{bg:"var(--navy-400)",text:"var(--navy-50)"},"navy-light":{bg:"var(--navy-100)",text:"var(--navy-800)"}};function Gs({label:t,color:e,dismissible:n=!0,onDismiss:r,style:s,forceFocus:i}){const o=wm[e],l={"--c-bg":o.bg,"--c-text":o.text,...i?{boxShadow:"var(--focus-ring)",outline:"none"}:void 0,...s};return d.jsxs("span",{className:`${ks.chip}${n?` ${ks.dismissible}`:""}`,style:l,children:[d.jsx("span",{className:ks.label,children:t}),n&&d.jsx("button",{type:"button",className:ks.dismiss,onClick:r,"aria-label":`Remove ${t}`,children:d.jsx("i",{className:"pi pi-times","aria-hidden":"true"})})]})}Gs.displayName="MiscChip";const Cm="_root_18kn1_10",Sm="_rootDisabled_18kn1_18",Nm="_field_18kn1_24",Am="_labelRow_18kn1_32",Tm="_label_18kn1_32",Em="_required_18kn1_44",Mm="_trigger_18kn1_52",jm="_triggerOpen_18kn1_69",Im="_triggerInvalid_18kn1_74",Dm="_triggerDisabled_18kn1_79",Om="_sm_18kn1_90",Rm="_lg_18kn1_91",Lm="_triggerContent_18kn1_95",Bm="_placeholder_18kn1_105",$m="_md_18kn1_112",Pm="_chips_18kn1_117",zm="_chip_18kn1_117",Fm="_chipLabel_18kn1_134",Hm="_chipRemove_18kn1_142",Wm="_chevron_18kn1_170",Vm="_helperText_18kn1_191",qm="_errorText_18kn1_198 _helperText_18kn1_191",Um="_dropdown_18kn1_205",Km="_dropdownHeader_18kn1_220",Gm="_hiddenInput_18kn1_231",Jm="_selectAllWrap_18kn1_243",Ym="_cbBox_18kn1_258",Qm="_cbChecked_18kn1_272",Xm="_cbIndeterminate_18kn1_277",Zm="_cbCheckmark_18kn1_282",eg="_cbDash_18kn1_293",tg="_searchWrap_18kn1_302",ng="_searchIcon_18kn1_315",rg="_searchInput_18kn1_329",sg="_searchClear_18kn1_345",ig="_optionList_18kn1_365",og="_option_18kn1_365",lg="_optionDisabled_18kn1_390",ag="_optionHighlight_18kn1_400",cg="_optionCb_18kn1_415",dg="_optionCbChecked_18kn1_429",ug="_optionCbCheckmark_18kn1_434",hg="_optionLabel_18kn1_447",fg="_optionLabelHighlight_18kn1_456",pg="_optionChipWrap_18kn1_462",mg="_footer_18kn1_471",gg="_noResults_18kn1_483",Z={root:Cm,rootDisabled:Sm,field:Nm,labelRow:Am,label:Tm,required:Em,trigger:Mm,triggerOpen:jm,triggerInvalid:Im,triggerDisabled:Dm,sm:Om,lg:Rm,triggerContent:Lm,placeholder:Bm,md:$m,chips:Pm,chip:zm,chipLabel:Fm,chipRemove:Hm,chevron:Wm,helperText:Vm,errorText:qm,dropdown:Um,dropdownHeader:Km,hiddenInput:Gm,selectAllWrap:Jm,cbBox:Ym,cbChecked:Qm,cbIndeterminate:Xm,cbCheckmark:Zm,cbDash:eg,searchWrap:tg,searchIcon:ng,searchInput:rg,searchClear:sg,optionList:ig,option:og,optionDisabled:lg,optionHighlight:ag,optionCb:cg,optionCbChecked:dg,optionCbCheckmark:ug,optionLabel:hg,optionLabelHighlight:fg,optionChipWrap:pg,footer:mg,noResults:gg},Sd=x.forwardRef(({options:t,value:e,onChange:n,placeholder:r="Select options…",label:s,required:i=!1,helperText:o,invalid:l=!1,disabled:a=!1,filter:c=!0,filterPlaceholder:u="Search…",showSelectAll:h=!0,size:p="md",footer:f,className:m,style:g},b)=>{const y=x.useId(),v=`${y}-dropdown`,_=`${y}-trigger`,w=`${y}-helper`,[k,C]=x.useState(!1),[N,O]=x.useState(""),B=x.useRef(null),S=x.useRef(null),T=j=>{B.current=j,typeof b=="function"?b(j):b&&(b.current=j)},P=e??[],L=x.useMemo(()=>t.filter(j=>!j.disabled),[t]),R=L.length>0&&L.every(j=>P.includes(j.value)),U=!!L.some(j=>P.includes(j.value))&&!R;x.useEffect(()=>{if(!k)return;function j(Y){var te;(te=B.current)!=null&&te.contains(Y.target)||(C(!1),O(""))}return document.addEventListener("mousedown",j),()=>document.removeEventListener("mousedown",j)},[k]),x.useEffect(()=>{S.current&&(S.current.indeterminate=U)},[U]),x.useEffect(()=>{if(!k)return;function j(Y){Y.key==="Escape"&&(C(!1),O(""))}return document.addEventListener("keydown",j),()=>document.removeEventListener("keydown",j)},[k]);const M=x.useMemo(()=>{if(!c||!N)return t;const j=N.toLowerCase();return t.filter(Y=>Y.label.toLowerCase().includes(j))},[t,c,N]);function $(){a||C(j=>(j&&O(""),!j))}function W(j){const Y=P.includes(j)?P.filter(te=>te!==j):[...P,j];n==null||n(Y)}function ie(j){n==null||n(P.filter(Y=>Y!==j))}function ce(){const j=L.map(Y=>Y.value);R?n==null||n(P.filter(Y=>!j.includes(Y))):n==null||n([...new Set([...P,...j])])}function Te(j){j.key==="Enter"||j.key===" "?(j.preventDefault(),$()):j.key==="Escape"?(C(!1),O("")):j.key==="ArrowDown"&&!k&&(j.preventDefault(),C(!0))}const q=[Z.root,Z[p],a?Z.rootDisabled:"",m??""].filter(Boolean).join(" "),he=[Z.trigger,k?Z.triggerOpen:"",l?Z.triggerInvalid:"",a?Z.triggerDisabled:""].filter(Boolean).join(" ");return d.jsxs("div",{ref:T,className:q,style:g,children:[d.jsxs("div",{className:Z.field,children:[s&&d.jsxs("div",{className:Z.labelRow,children:[d.jsx("label",{className:Z.label,htmlFor:_,children:s}),i&&d.jsx("span",{className:Z.required,"aria-hidden":"true",children:"*"})]}),d.jsxs("div",{id:_,role:"combobox","aria-haspopup":"listbox","aria-expanded":k,"aria-controls":v,"aria-required":i||void 0,"aria-invalid":l||void 0,"aria-describedby":o?w:void 0,"aria-disabled":a||void 0,tabIndex:a?-1:0,className:he,onClick:$,onKeyDown:Te,children:[d.jsx("span",{className:Z.triggerContent,children:P.length===0?d.jsx("span",{className:Z.placeholder,children:r}):d.jsx("span",{className:Z.chips,children:P.map(j=>{const Y=t.find(te=>te.value===j);return Y?Y.chip?d.jsx("span",{onMouseDown:te=>te.stopPropagation(),onClick:te=>te.stopPropagation(),children:d.jsx(Gs,{label:Y.label,color:Y.chip.color,dismissible:!a,onDismiss:()=>ie(j)})},j):d.jsxs("span",{className:Z.chip,children:[d.jsx("span",{className:Z.chipLabel,children:Y.label}),!a&&d.jsx("button",{type:"button",className:Z.chipRemove,onMouseDown:te=>te.stopPropagation(),onClick:te=>{te.stopPropagation(),ie(j)},"aria-label":`Remove ${Y.label}`,tabIndex:-1,children:d.jsx("svg",{viewBox:"0 0 8 8",fill:"none",children:d.jsx("path",{d:"M1 1l6 6M7 1l-6 6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]},j):null})})}),d.jsx("span",{className:Z.chevron,"aria-hidden":"true",children:d.jsx("svg",{viewBox:"0 0 14 8",fill:"none",children:d.jsx("path",{d:"M1 1l6 6 6-6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),o&&d.jsx("span",{id:w,className:l?Z.errorText:Z.helperText,children:o})]}),k&&d.jsxs("div",{id:v,role:"listbox","aria-multiselectable":"true",className:Z.dropdown,children:[d.jsxs("div",{className:Z.dropdownHeader,children:[h&&d.jsxs("span",{className:Z.selectAllWrap,onClick:ce,"aria-label":"Select all",role:"checkbox","aria-checked":R?!0:U?"mixed":!1,tabIndex:0,onKeyDown:j=>{(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),ce())},children:[d.jsx("input",{ref:S,type:"checkbox",className:Z.hiddenInput,checked:R,onChange:ce}),d.jsxs("span",{"aria-hidden":"true",className:[Z.cbBox,R?Z.cbChecked:"",U?Z.cbIndeterminate:""].filter(Boolean).join(" "),children:[R&&d.jsx("svg",{className:Z.cbCheckmark,viewBox:"0 0 11 11",children:d.jsx("polyline",{points:"1.5,5.5 4.5,8.5 9.5,2.5"})}),U&&d.jsx("span",{className:Z.cbDash})]})]}),c&&d.jsxs("div",{className:Z.searchWrap,children:[d.jsx("span",{className:Z.searchIcon,"aria-hidden":"true",children:d.jsxs("svg",{viewBox:"0 0 14 14",fill:"none",children:[d.jsx("circle",{cx:"6",cy:"6",r:"4.5",stroke:"currentColor",strokeWidth:"1.5"}),d.jsx("path",{d:"M9.5 9.5L12.5 12.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}),d.jsx("input",{type:"text",className:Z.searchInput,placeholder:u,value:N,onChange:j=>O(j.target.value),"aria-label":"Filter options",autoComplete:"off"}),N&&d.jsx("button",{type:"button",className:Z.searchClear,onClick:()=>O(""),"aria-label":"Clear filter",tabIndex:-1,children:d.jsx("svg",{viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M5 5l4 4M9 5l-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]})]}),d.jsx("div",{className:Z.optionList,children:M.length===0?d.jsx("div",{className:Z.noResults,children:"No results"}):M.map(j=>{const Y=P.includes(j.value),te=j.disabled,Ye=[Z.option,Y?Z.optionHighlight:"",te?Z.optionDisabled:""].filter(Boolean).join(" ");return d.jsxs("div",{role:"option","aria-selected":Y,"aria-disabled":te||void 0,className:Ye,onClick:()=>!te&&W(j.value),tabIndex:te?-1:0,onKeyDown:ht=>{(ht.key==="Enter"||ht.key===" ")&&!te&&(ht.preventDefault(),W(j.value))},children:[d.jsx("span",{"aria-hidden":"true",className:[Z.optionCb,Y?Z.optionCbChecked:""].filter(Boolean).join(" "),children:Y&&d.jsx("svg",{className:Z.optionCbCheckmark,viewBox:"0 0 11 11",children:d.jsx("polyline",{points:"1.5,5.5 4.5,8.5 9.5,2.5"})})}),j.chip?d.jsx("span",{className:Z.optionChipWrap,children:d.jsx(Gs,{label:j.label,color:j.chip.color,dismissible:!1})}):d.jsx("span",{className:Y?`${Z.optionLabel} ${Z.optionLabelHighlight}`:Z.optionLabel,children:j.label})]},j.value)})}),f&&d.jsx("div",{className:Z.footer,children:f})]})]})});Sd.displayName="MultiSelect";const bg="_root_bzv3d_10",yg="_rootDisabled_bzv3d_18",xg="_field_bzv3d_24",vg="_labelRow_bzv3d_32",_g="_label_bzv3d_32",kg="_required_bzv3d_44",wg="_trigger_bzv3d_52",Cg="_triggerOpen_bzv3d_68",Sg="_triggerDisabled_bzv3d_68",Ng="_triggerInvalid_bzv3d_68",Ag="_lg_bzv3d_91",Tg="_triggerContent_bzv3d_95",Eg="_placeholder_bzv3d_101",Mg="_triggerValue_bzv3d_113",jg="_sm_bzv3d_138",Ig="_md_bzv3d_140",Dg="_chevron_bzv3d_147",Og="_chevronInvalid_bzv3d_167",Rg="_chevronDisabled_bzv3d_172",Lg="_helperText_bzv3d_178",Bg="_errorText_bzv3d_185 _helperText_bzv3d_178",$g="_dropdown_bzv3d_192",Pg="_filterHeader_bzv3d_207",zg="_searchWrap_bzv3d_212",Fg="_searchIcon_bzv3d_223",Hg="_searchInput_bzv3d_237",Wg="_searchClear_bzv3d_253",Vg="_optionList_bzv3d_273",qg="_option_bzv3d_273",Ug="_optionDisabled_bzv3d_297",Kg="_optionHighlight_bzv3d_308",Gg="_optionLabel_bzv3d_319",Jg="_optionLabelHighlight_bzv3d_327",Yg="_noResults_bzv3d_333",fe={root:bg,rootDisabled:yg,field:xg,labelRow:vg,label:_g,required:kg,trigger:wg,triggerOpen:Cg,triggerDisabled:Sg,triggerInvalid:Ng,lg:Ag,triggerContent:Tg,placeholder:Eg,triggerValue:Mg,sm:jg,md:Ig,chevron:Dg,chevronInvalid:Og,chevronDisabled:Rg,helperText:Lg,errorText:Bg,dropdown:$g,filterHeader:Pg,searchWrap:zg,searchIcon:Fg,searchInput:Hg,searchClear:Wg,optionList:Vg,option:qg,optionDisabled:Ug,optionHighlight:Kg,optionLabel:Gg,optionLabelHighlight:Jg,noResults:Yg},pr=x.forwardRef(({options:t,value:e,onChange:n,placeholder:r="Select…",label:s,required:i=!1,helperText:o,invalid:l=!1,disabled:a=!1,filter:c=!1,filterPlaceholder:u="Search…",size:h="md",className:p,style:f},m)=>{const g=x.useId(),b=`${g}-dropdown`,y=`${g}-trigger`,v=`${g}-helper`,[_,w]=x.useState(!1),[k,C]=x.useState(""),N=x.useRef(null),O=x.useRef(null),B=x.useRef(null),[S,T]=x.useState(null),P=q=>{N.current=q,typeof m=="function"?m(q):m&&(m.current=q)},L=t.find(q=>q.value===e)??null;x.useEffect(()=>{if(!_)return;function q(he){var Y,te;const j=he.target;!((Y=N.current)!=null&&Y.contains(j))&&!((te=B.current)!=null&&te.contains(j))&&(w(!1),C(""))}return document.addEventListener("mousedown",q),()=>document.removeEventListener("mousedown",q)},[_]),x.useEffect(()=>{if(!_)return;function q(){var j;const he=(j=O.current)==null?void 0:j.getBoundingClientRect();he&&T({top:he.bottom+2,left:he.left,width:he.width})}return q(),window.addEventListener("scroll",q,!0),window.addEventListener("resize",q),()=>{window.removeEventListener("scroll",q,!0),window.removeEventListener("resize",q)}},[_]),x.useEffect(()=>{if(!_)return;function q(he){he.key==="Escape"&&(w(!1),C(""))}return document.addEventListener("keydown",q),()=>document.removeEventListener("keydown",q)},[_]);const R=x.useRef(!1);x.useLayoutEffect(()=>{var he;if(!_){R.current=!1;return}if(!S||R.current)return;const q=(he=B.current)==null?void 0:he.querySelector('[role="option"][aria-selected="true"]');q&&(q.scrollIntoView({block:"start"}),R.current=!0)},[_,S]);const H=x.useMemo(()=>{if(!c||!k)return t;const q=k.toLowerCase();return t.filter(he=>he.label.toLowerCase().includes(q))},[t,c,k]);function U(){a||w(q=>(q&&C(""),!q))}function M(q){n==null||n(q),w(!1),C("")}function $(q){q.key==="Enter"||q.key===" "?(q.preventDefault(),U()):q.key==="Escape"?(w(!1),C("")):q.key==="ArrowDown"&&!_&&(q.preventDefault(),w(!0))}const W=!!L,ie=[fe.root,fe[h],a?fe.rootDisabled:"",p??""].filter(Boolean).join(" "),ce=[fe.trigger,_?fe.triggerOpen:"",l?fe.triggerInvalid:"",a?fe.triggerDisabled:"",W&&!l&&!a?fe.triggerFilled:""].filter(Boolean).join(" "),Te=[fe.chevron,l?fe.chevronInvalid:"",a?fe.chevronDisabled:""].filter(Boolean).join(" ");return d.jsxs("div",{ref:P,className:ie,style:f,children:[d.jsxs("div",{className:fe.field,children:[s&&d.jsxs("div",{className:fe.labelRow,children:[d.jsx("label",{className:fe.label,htmlFor:y,children:s}),i&&d.jsx("span",{className:fe.required,"aria-hidden":"true",children:"*"})]}),d.jsxs("div",{ref:O,id:y,role:"combobox","aria-haspopup":"listbox","aria-expanded":_,"aria-controls":b,"aria-required":i||void 0,"aria-invalid":l||void 0,"aria-describedby":o?v:void 0,"aria-disabled":a||void 0,tabIndex:a?-1:0,className:ce,onClick:U,onKeyDown:$,children:[d.jsx("span",{className:fe.triggerContent,children:L?d.jsx("span",{className:fe.triggerValue,children:L.label}):d.jsx("span",{className:fe.placeholder,children:r})}),d.jsx("span",{className:Te,"aria-hidden":"true",children:d.jsx("svg",{viewBox:"0 0 14 8",fill:"none",children:d.jsx("path",{d:"M1 1l6 6 6-6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),o&&d.jsx("span",{id:v,className:l?fe.errorText:fe.helperText,children:o})]}),_&&S&&Ut.createPortal(d.jsxs("div",{ref:B,"data-popover-root":"",id:b,role:"listbox",className:fe.dropdown,style:{top:S.top,left:S.left,width:S.width},children:[c&&d.jsx("div",{className:fe.filterHeader,children:d.jsxs("div",{className:fe.searchWrap,children:[d.jsx("span",{className:fe.searchIcon,"aria-hidden":"true",children:d.jsxs("svg",{viewBox:"0 0 14 14",fill:"none",children:[d.jsx("circle",{cx:"6",cy:"6",r:"4.5",stroke:"currentColor",strokeWidth:"1.5"}),d.jsx("path",{d:"M9.5 9.5L12.5 12.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}),d.jsx("input",{type:"text",className:fe.searchInput,placeholder:u,value:k,onChange:q=>C(q.target.value),"aria-label":"Filter options",autoComplete:"off"}),k&&d.jsx("button",{type:"button",className:fe.searchClear,onClick:()=>C(""),"aria-label":"Clear filter",tabIndex:-1,children:d.jsx("svg",{viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M5 5l4 4M9 5l-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]})}),d.jsx("div",{className:fe.optionList,children:H.length===0?d.jsx("div",{className:fe.noResults,children:"No results"}):H.map(q=>{const he=q.value===e,j=q.disabled,Y=[fe.option,he?fe.optionHighlight:"",j?fe.optionDisabled:""].filter(Boolean).join(" ");return d.jsx("div",{role:"option","aria-selected":he,"aria-disabled":j||void 0,className:Y,onClick:()=>!j&&M(q.value),tabIndex:j?-1:0,onKeyDown:te=>{(te.key==="Enter"||te.key===" ")&&!j&&(te.preventDefault(),M(q.value))},children:d.jsx("span",{className:he?`${fe.optionLabel} ${fe.optionLabelHighlight}`:fe.optionLabel,children:q.label})},q.value)})})]}),document.body)]})});pr.displayName="Select";const Qg="_btn_1wdnr_7",Xg="_disabled_1wdnr_21",Zg="_sm_1wdnr_27",eb="_md_1wdnr_33",tb="_lg_1wdnr_39",nb="_icon_1wdnr_47",rb="_primary_1wdnr_59",sb="_secondary_1wdnr_68",ib="_ghost_1wdnr_78",ob="_danger_1wdnr_87",Ar={btn:Qg,disabled:Xg,sm:Zg,md:eb,lg:tb,icon:nb,primary:rb,secondary:sb,ghost:ib,danger:ob},lb="_wrapper_wreg1_4",ab="_tooltip_wreg1_17",cb="_placement_top_wreg1_59",db="_placement_bottom_wreg1_69",ub="_placement_left_wreg1_79",hb="_placement_right_wreg1_89",so={wrapper:lb,tooltip:ab,placement_top:cb,placement_bottom:db,placement_left:ub,placement_right:hb},ws=8,Cs=44;function er({content:t,children:e,placement:n="top",delay:r=200,disabled:s=!1,maxWidth:i=140,className:o}){const[l,a]=x.useState(null),c=x.useRef(null),u=x.useRef(null),h=x.useId(),p=l!==null,f=x.useCallback(()=>{const y=c.current;if(!y)return null;const v=y.getBoundingClientRect(),_=window.innerWidth,w=window.innerHeight;let k=n;k==="top"&&v.top<Cs?k="bottom":k==="bottom"&&w-v.bottom<Cs?k="top":k==="left"&&v.left<Cs?k="right":k==="right"&&_-v.right<Cs&&(k="left");const C=v.left+v.width/2,N=v.top+v.height/2;switch(k){case"bottom":return{top:v.bottom+ws,left:C,transform:"translate(-50%, 0)",placement:k};case"left":return{top:N,left:v.left-ws,transform:"translate(-100%, -50%)",placement:k};case"right":return{top:N,left:v.right+ws,transform:"translate(0, -50%)",placement:k};case"top":default:return{top:v.top-ws,left:C,transform:"translate(-50%, -100%)",placement:k}}},[n]),m=()=>{s||(u.current&&clearTimeout(u.current),u.current=setTimeout(()=>a(f()),r))},g=()=>{u.current&&clearTimeout(u.current),a(null)};x.useLayoutEffect(()=>{if(!p)return;const y=()=>a(f()),v={capture:!0,passive:!0};return window.addEventListener("scroll",y,v),window.addEventListener("resize",y),()=>{window.removeEventListener("scroll",y,v),window.removeEventListener("resize",y)}},[p,f]),x.useEffect(()=>()=>{u.current&&clearTimeout(u.current)},[]);const b=[so.tooltip,so[`placement_${(l==null?void 0:l.placement)??n}`],o??""].filter(Boolean).join(" ");return d.jsxs("span",{ref:c,className:so.wrapper,onMouseEnter:m,onMouseLeave:g,onFocus:m,onBlur:g,children:[d.jsx("span",{"aria-describedby":p?h:void 0,children:e}),p&&l&&typeof document<"u"&&Ut.createPortal(d.jsx("div",{id:h,role:"tooltip",className:b,style:{maxWidth:i,top:l.top,left:l.left,transform:l.transform},"aria-hidden":!1,children:t}),document.body)]})}er.displayName="Tooltip";const dt=x.forwardRef(({icon:t,variant:e="primary",size:n="md",className:r,disabled:s,tooltipPlacement:i="top","aria-label":o,...l},a)=>{const c=[Ar.btn,Ar[e],Ar[n],s?Ar.disabled:"",r??""].filter(Boolean).join(" ");return d.jsx(er,{content:o,placement:i,children:d.jsx("button",{ref:a,className:c,disabled:s,"aria-label":o,...l,children:d.jsx("span",{className:Ar.icon,"aria-hidden":"true",children:t})})})});dt.displayName="IconButton";const fb="_root_k08lc_10",pb="_field_k08lc_20",mb="_labelRow_k08lc_28",gb="_label_k08lc_28",bb="_required_k08lc_40",yb="_inputWrap_k08lc_48",xb="_inputWrapDisabled_k08lc_60",vb="_inputWrapInvalid_k08lc_60",_b="_inputWrapOpen_k08lc_65",kb="_input_k08lc_48",wb="_calIconBtn_k08lc_102",Cb="_helperText_k08lc_128",Sb="_errorText_k08lc_135 _helperText_k08lc_128",Nb="_calendar_k08lc_144",Ab="_calHeader_k08lc_161",Tb="_titleGroup_k08lc_171",Eb="_titleBtn_k08lc_178",Mb="_titleText_k08lc_196",jb="_dayView_k08lc_207",Ib="_weekRow_k08lc_212",Db="_weekRowWithWk_k08lc_217",Ob="_weekdayCell_k08lc_223",Rb="_wkLabel_k08lc_233",Lb="_cell_k08lc_239",Bb="_wkCell_k08lc_252",$b="_cellDisabled_k08lc_262",Pb="_dayCircle_k08lc_262",zb="_cellOutside_k08lc_277",Fb="_cellSelected_k08lc_292",Hb="_cellToday_k08lc_297",Wb="_dayCircleSelected_k08lc_320",Vb="_dayCircleToday_k08lc_326",qb="_monthGrid_k08lc_335",Ub="_monthCell_k08lc_342",Kb="_monthCellSelected_k08lc_356",Gb="_yearGrid_k08lc_373",Jb="_yearCell_k08lc_380",Yb="_yearCellSelected_k08lc_394",Qb="_footer_k08lc_411",Xb="_clearBtn_k08lc_421",Zb="_todayBtn_k08lc_442",Q={root:fb,field:pb,labelRow:mb,label:gb,required:bb,inputWrap:yb,inputWrapDisabled:xb,inputWrapInvalid:vb,inputWrapOpen:_b,input:kb,calIconBtn:wb,helperText:Cb,errorText:Sb,calendar:Nb,calHeader:Ab,titleGroup:Tb,titleBtn:Eb,titleText:Mb,dayView:jb,weekRow:Ib,weekRowWithWk:Db,weekdayCell:Ob,wkLabel:Rb,cell:Lb,wkCell:Bb,cellDisabled:$b,dayCircle:Pb,cellOutside:zb,cellSelected:Fb,cellToday:Hb,dayCircleSelected:Wb,dayCircleToday:Vb,monthGrid:qb,monthCell:Ub,monthCellSelected:Kb,yearGrid:Gb,yearCell:Jb,yearCellSelected:Yb,footer:Qb,clearBtn:Xb,todayBtn:Zb},ey=["Su","Mo","Tu","We","Th","Fr","Sa"],Sa=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ss(t){const e=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0");return`${e}/${n}/${t.getFullYear()}`}function Na(t){const e=t.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/);if(!e)return null;const n=parseInt(e[1],10)-1,r=parseInt(e[2],10),s=parseInt(e[3],10);if(n<0||n>11||r<1||r>31||s<1e3)return null;const i=new Date(s,n,r);return i.getFullYear()!==s||i.getMonth()!==n||i.getDate()!==r?null:i}function Tr(t,e){return t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate()}function Ns(t,e,n){if(e){const r=new Date(e.getFullYear(),e.getMonth(),e.getDate());if(t<r)return!0}if(n){const r=new Date(n.getFullYear(),n.getMonth(),n.getDate());if(t>r)return!0}return!1}function ty(t,e){const n=new Date(t,e,1),r=new Date(t,e+1,0),s=new Date(n);s.setDate(s.getDate()-s.getDay());const i=new Date(r);i.setDate(i.getDate()+(6-i.getDay()));const o=[],l=new Date(s);for(;l<=i;){const a=[];for(let c=0;c<7;c++)a.push(new Date(l)),l.setDate(l.getDate()+1);o.push(a)}return o}function ny(t){const e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()));e.setUTCDate(e.getUTCDate()+4-(e.getUTCDay()||7));const n=new Date(Date.UTC(e.getUTCFullYear(),0,1));return Math.ceil(((e.getTime()-n.getTime())/864e5+1)/7)}function io(t){return Math.floor(t/8)*8}const ry=()=>d.jsxs("svg",{viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("rect",{x:"1",y:"2.5",width:"12",height:"10",rx:"1.5",stroke:"currentColor",strokeWidth:"1.5"}),d.jsx("path",{d:"M1 6h12",stroke:"currentColor",strokeWidth:"1.5"}),d.jsx("path",{d:"M4.5 1v3M9.5 1v3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),sy=()=>d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M9 11L5 7l4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),iy=()=>d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M5 3l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Nl=x.forwardRef(({value:t,onChange:e,label:n,required:r=!1,helperText:s,invalid:i=!1,disabled:o=!1,placeholder:l="MM/DD/YYYY",minDate:a,maxDate:c,showWeekNumbers:u=!0,id:h,className:p,style:f},m)=>{const g=x.useId(),b=h??`${g}-input`,y=`${g}-helper`,[v,_]=x.useState(!1),[w,k]=x.useState("day"),[C,N]=x.useState(()=>(t==null?void 0:t.getFullYear())??new Date().getFullYear()),[O,B]=x.useState(()=>(t==null?void 0:t.getMonth())??new Date().getMonth()),[S,T]=x.useState(()=>t?Ss(t):""),P=x.useRef(null),L=x.useRef(null),R=x.useRef(null),H=x.useRef(null),[U,M]=x.useState(null),$=D=>{P.current=D,typeof m=="function"?m(D):m&&(m.current=D)},W=new Date;W.setHours(0,0,0,0),x.useEffect(()=>{const D=t?Ss(t):"";L.current!==document.activeElement&&T(D),t&&(N(t.getFullYear()),B(t.getMonth()))},[t]),x.useEffect(()=>{if(!v)return;function D(ee){var ke,vt;const ge=ee.target;!((ke=P.current)!=null&&ke.contains(ge))&&!((vt=H.current)!=null&&vt.contains(ge))&&ce()}return document.addEventListener("mousedown",D),()=>document.removeEventListener("mousedown",D)},[v]),x.useEffect(()=>{if(!v)return;function D(){var ge;const ee=(ge=R.current)==null?void 0:ge.getBoundingClientRect();ee&&M({top:ee.bottom+4,left:ee.left})}return D(),window.addEventListener("scroll",D,!0),window.addEventListener("resize",D),()=>{window.removeEventListener("scroll",D,!0),window.removeEventListener("resize",D)}},[v]),x.useEffect(()=>{if(!v)return;function D(ee){ee.key==="Escape"&&ce()}return document.addEventListener("keydown",D),()=>document.removeEventListener("keydown",D)},[v]);function ie(){o||_(D=>(D||k("day"),!0))}function ce(){_(!1),k("day")}function Te(){w==="day"?O===0?(B(11),N(D=>D-1)):B(D=>D-1):N(w==="month"?D=>D-1:D=>io(D)-8)}function q(){w==="day"?O===11?(B(0),N(D=>D+1)):B(D=>D+1):N(w==="month"?D=>D+1:D=>io(D)+8)}function he(D){Ns(D,a,c)||((D.getMonth()!==O||D.getFullYear()!==C)&&(B(D.getMonth()),N(D.getFullYear())),e==null||e(D),T(Ss(D)),ce())}function j(D){B(D),k("day")}function Y(D){N(D),k("month")}function te(){const D=new Date;D.setHours(0,0,0,0),!Ns(D,a,c)&&(e==null||e(D),T(Ss(D)),N(D.getFullYear()),B(D.getMonth()),ce())}function Ye(){e==null||e(null),T("")}function ht(D){const ee=D.target.value;if(T(ee),ee===""){e==null||e(null);return}const ge=Na(ee);ge&&(N(ge.getFullYear()),B(ge.getMonth()),e==null||e(ge))}function Bt(D){if(D.key==="Enter"){const ee=Na(S);ee&&(e==null||e(ee),ce())}}function Dt(D,ee){const ge=[Q.cell],ke=Tr(D,W),vt=t?Tr(D,t):!1,ft=Ns(D,a,c);return ee||ge.push(Q.cellOutside),ft&&ge.push(Q.cellDisabled),vt?ge.push(Q.cellSelected):ke&&ge.push(Q.cellToday),ge.filter(Boolean).join(" ")}function rr(D){const ee=[Q.dayCircle],ge=t?Tr(D,t):!1,ke=Tr(D,W);return ge?ee.push(Q.dayCircleSelected):ke&&ee.push(Q.dayCircleToday),ee.join(" ")}function an(D){const ee=[Q.monthCell];return t&&t.getMonth()===D&&t.getFullYear()===C&&ee.push(Q.monthCellSelected),ee.join(" ")}function $t(D){const ee=[Q.yearCell];return t&&t.getFullYear()===D&&ee.push(Q.yearCellSelected),ee.join(" ")}const Pt=ty(C,O),Gt=io(C),wr=Array.from({length:8},(D,ee)=>Gt+ee),sr=()=>w==="day"?d.jsxs("div",{className:Q.titleGroup,children:[d.jsx("button",{type:"button",className:Q.titleBtn,onClick:()=>k("month"),children:Sa[O]}),d.jsx("button",{type:"button",className:Q.titleBtn,onClick:()=>k("year"),children:C})]}):w==="month"?d.jsx("span",{className:Q.titleText,children:C}):d.jsxs("span",{className:Q.titleText,children:[Gt," – ",Gt+7]}),Cr=[Q.inputWrap,v?Q.inputWrapOpen:"",i?Q.inputWrapInvalid:"",o?Q.inputWrapDisabled:""].filter(Boolean).join(" "),G=[Q.root,p??""].filter(Boolean).join(" ");return d.jsxs("div",{ref:$,className:G,style:f,children:[d.jsxs("div",{className:Q.field,children:[n&&d.jsxs("div",{className:Q.labelRow,children:[d.jsx("label",{className:Q.label,htmlFor:b,children:n}),r&&d.jsx("span",{className:Q.required,"aria-hidden":"true",children:"*"})]}),d.jsxs("div",{ref:R,className:Cr,children:[d.jsx("input",{ref:L,id:b,type:"text",className:Q.input,value:S,placeholder:l,disabled:o,required:r,"aria-invalid":i||void 0,"aria-describedby":s?y:void 0,onChange:ht,onFocus:ie,onKeyDown:Bt,autoComplete:"off"}),d.jsx("button",{type:"button",className:Q.calIconBtn,onClick:()=>v?ce():ie(),tabIndex:-1,"aria-label":v?"Close calendar":"Open calendar",disabled:o,children:d.jsx(ry,{})})]}),s&&d.jsx("span",{id:y,className:i?Q.errorText:Q.helperText,children:s})]}),v&&U&&Ut.createPortal(d.jsxs("div",{ref:H,"data-popover-root":"",className:Q.calendar,style:{top:U.top,left:U.left},role:"dialog","aria-label":"Date picker",children:[d.jsxs("div",{className:Q.calHeader,children:[d.jsx(dt,{icon:d.jsx(sy,{}),variant:"ghost",size:"sm",onClick:Te,"aria-label":"Previous"}),sr(),d.jsx(dt,{icon:d.jsx(iy,{}),variant:"ghost",size:"sm",onClick:q,"aria-label":"Next"})]}),w==="day"&&d.jsxs("div",{className:Q.dayView,children:[d.jsxs("div",{className:u?Q.weekRowWithWk:Q.weekRow,children:[u&&d.jsx("div",{className:`${Q.weekdayCell} ${Q.wkLabel}`,children:"Wk"}),ey.map(D=>d.jsx("div",{className:Q.weekdayCell,children:D},D))]}),Pt.map((D,ee)=>{const ge=ke=>ke.getMonth()===O&&ke.getFullYear()===C;return d.jsxs("div",{className:u?Q.weekRowWithWk:Q.weekRow,children:[u&&d.jsx("div",{className:`${Q.cell} ${Q.wkCell}`,children:ny(D[0])}),D.map((ke,vt)=>{const ft=Ns(ke,a,c);return d.jsx("div",{className:Dt(ke,ge(ke)),onClick:()=>!ft&&he(ke),role:"button",tabIndex:ft?-1:0,"aria-label":ke.toDateString(),"aria-pressed":t?Tr(ke,t):!1,"aria-disabled":ft||void 0,onKeyDown:Jt=>{(Jt.key==="Enter"||Jt.key===" ")&&!ft&&(Jt.preventDefault(),he(ke))},children:d.jsx("div",{className:rr(ke),children:ke.getDate()})},vt)})]},ee)})]}),w==="month"&&d.jsx("div",{className:Q.monthGrid,children:Sa.map((D,ee)=>d.jsx("div",{className:an(ee),onClick:()=>j(ee),role:"button",tabIndex:0,onKeyDown:ge=>{(ge.key==="Enter"||ge.key===" ")&&(ge.preventDefault(),j(ee))},children:D},D))}),w==="year"&&d.jsx("div",{className:Q.yearGrid,children:wr.map(D=>d.jsx("div",{className:$t(D),onClick:()=>Y(D),role:"button",tabIndex:0,onKeyDown:ee=>{(ee.key==="Enter"||ee.key===" ")&&(ee.preventDefault(),Y(D))},children:D},D))}),w==="day"&&d.jsxs("div",{className:Q.footer,children:[d.jsx("button",{type:"button",className:Q.clearBtn,onClick:Ye,children:"Clear"}),d.jsx("button",{type:"button",className:Q.todayBtn,onClick:te,children:"Today"})]})]}),document.body)]})});Nl.displayName="DatePicker";const oy="_calendar_1smvj_7",ly="_plain_1smvj_20",ay="_calHeader_1smvj_29",cy="_titleGroup_1smvj_38",dy="_titleBtn_1smvj_45",uy="_titleText_1smvj_63",hy="_dayView_1smvj_74",fy="_weekRow_1smvj_79",py="_weekRowWithWk_1smvj_84",my="_weekdayCell_1smvj_90",gy="_wkLabel_1smvj_100",by="_cell_1smvj_106",yy="_wkCell_1smvj_119",xy="_cellDisabled_1smvj_129",vy="_dayCircle_1smvj_129",_y="_cellOutside_1smvj_144",ky="_cellSelected_1smvj_159",wy="_cellToday_1smvj_163",Cy="_dayCircleSelected_1smvj_185",Sy="_dayCircleToday_1smvj_191",Ny="_monthGrid_1smvj_200",Ay="_monthCell_1smvj_207",Ty="_monthCellSelected_1smvj_221",Ey="_yearGrid_1smvj_238",My="_yearCell_1smvj_245",jy="_yearCellSelected_1smvj_259",pe={calendar:oy,plain:ly,calHeader:ay,titleGroup:cy,titleBtn:dy,titleText:uy,dayView:hy,weekRow:fy,weekRowWithWk:py,weekdayCell:my,wkLabel:gy,cell:by,wkCell:yy,cellDisabled:xy,dayCircle:vy,cellOutside:_y,cellSelected:ky,cellToday:wy,dayCircleSelected:Cy,dayCircleToday:Sy,monthGrid:Ny,monthCell:Ay,monthCellSelected:Ty,yearGrid:Ey,yearCell:My,yearCellSelected:jy},Iy=["Su","Mo","Tu","We","Th","Fr","Sa"],Aa=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Er(t,e){return t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate()}function oo(t,e,n){if(e){const r=new Date(e.getFullYear(),e.getMonth(),e.getDate());if(t<r)return!0}if(n){const r=new Date(n.getFullYear(),n.getMonth(),n.getDate());if(t>r)return!0}return!1}function Dy(t,e){const n=new Date(t,e,1),r=new Date(t,e+1,0),s=new Date(n);s.setDate(s.getDate()-s.getDay());const i=new Date(r);i.setDate(i.getDate()+(6-i.getDay()));const o=[],l=new Date(s);for(;l<=i;){const a=[];for(let c=0;c<7;c++)a.push(new Date(l)),l.setDate(l.getDate()+1);o.push(a)}return o}function Oy(t){const e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()));e.setUTCDate(e.getUTCDate()+4-(e.getUTCDay()||7));const n=new Date(Date.UTC(e.getUTCFullYear(),0,1));return Math.ceil(((e.getTime()-n.getTime())/864e5+1)/7)}function lo(t){return Math.floor(t/8)*8}const Ry=()=>d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M9 11L5 7l4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Ly=()=>d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M5 3l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Nd=x.forwardRef(({value:t,onChange:e,minDate:n,maxDate:r,showWeekNumbers:s=!1,variant:i="card",defaultMonth:o,id:l,className:a,style:c},u)=>{const h=t??o??new Date,[p,f]=x.useState("day"),[m,g]=x.useState(h.getFullYear()),[b,y]=x.useState(h.getMonth()),v=new Date;v.setHours(0,0,0,0),x.useEffect(()=>{t&&(g(t.getFullYear()),y(t.getMonth()))},[t]);function _(){p==="day"?b===0?(y(11),g(M=>M-1)):y(M=>M-1):g(p==="month"?M=>M-1:M=>lo(M)-8)}function w(){p==="day"?b===11?(y(0),g(M=>M+1)):y(M=>M+1):g(p==="month"?M=>M+1:M=>lo(M)+8)}function k(M){oo(M,n,r)||((M.getMonth()!==b||M.getFullYear()!==m)&&(y(M.getMonth()),g(M.getFullYear())),e==null||e(M))}function C(M){y(M),f("day")}function N(M){g(M),f("month")}function O(M,$){const W=[pe.cell],ie=Er(M,v),ce=t?Er(M,t):!1,Te=oo(M,n,r);return $||W.push(pe.cellOutside),Te&&W.push(pe.cellDisabled),ce?W.push(pe.cellSelected):ie&&W.push(pe.cellToday),W.filter(Boolean).join(" ")}function B(M){const $=[pe.dayCircle],W=t?Er(M,t):!1,ie=Er(M,v);return W?$.push(pe.dayCircleSelected):ie&&$.push(pe.dayCircleToday),$.join(" ")}function S(M){const $=[pe.monthCell];return t&&t.getMonth()===M&&t.getFullYear()===m&&$.push(pe.monthCellSelected),$.join(" ")}function T(M){const $=[pe.yearCell];return t&&t.getFullYear()===M&&$.push(pe.yearCellSelected),$.join(" ")}const P=Dy(m,b),L=lo(m),R=Array.from({length:8},(M,$)=>L+$),H=()=>p==="day"?d.jsxs("div",{className:pe.titleGroup,children:[d.jsx("button",{type:"button",className:pe.titleBtn,onClick:()=>f("month"),children:Aa[b]}),d.jsx("button",{type:"button",className:pe.titleBtn,onClick:()=>f("year"),children:m})]}):p==="month"?d.jsx("span",{className:pe.titleText,children:m}):d.jsxs("span",{className:pe.titleText,children:[L," – ",L+7]}),U=[pe.calendar,i==="plain"?pe.plain:"",a].filter(Boolean).join(" ");return d.jsxs("div",{ref:u,id:l,className:U,style:c,role:"group","aria-label":"Calendar",children:[d.jsxs("div",{className:pe.calHeader,children:[d.jsx(dt,{icon:d.jsx(Ry,{}),variant:"ghost",size:"sm",onClick:_,"aria-label":"Previous"}),H(),d.jsx(dt,{icon:d.jsx(Ly,{}),variant:"ghost",size:"sm",onClick:w,"aria-label":"Next"})]}),p==="day"&&d.jsxs("div",{className:pe.dayView,children:[d.jsxs("div",{className:s?pe.weekRowWithWk:pe.weekRow,children:[s&&d.jsx("div",{className:`${pe.weekdayCell} ${pe.wkLabel}`,children:"Wk"}),Iy.map(M=>d.jsx("div",{className:pe.weekdayCell,children:M},M))]}),P.map((M,$)=>{const W=ie=>ie.getMonth()===b&&ie.getFullYear()===m;return d.jsxs("div",{className:s?pe.weekRowWithWk:pe.weekRow,children:[s&&d.jsx("div",{className:`${pe.cell} ${pe.wkCell}`,children:Oy(M[0])}),M.map((ie,ce)=>{const Te=oo(ie,n,r);return d.jsx("div",{className:O(ie,W(ie)),onClick:()=>!Te&&k(ie),role:"button",tabIndex:Te?-1:0,"aria-label":ie.toDateString(),"aria-pressed":t?Er(ie,t):!1,"aria-disabled":Te||void 0,onKeyDown:q=>{(q.key==="Enter"||q.key===" ")&&!Te&&(q.preventDefault(),k(ie))},children:d.jsx("div",{className:B(ie),children:ie.getDate()})},ce)})]},$)})]}),p==="month"&&d.jsx("div",{className:pe.monthGrid,children:Aa.map((M,$)=>d.jsx("div",{className:S($),onClick:()=>C($),role:"button",tabIndex:0,onKeyDown:W=>{(W.key==="Enter"||W.key===" ")&&(W.preventDefault(),C($))},children:M},M))}),p==="year"&&d.jsx("div",{className:pe.yearGrid,children:R.map(M=>d.jsx("div",{className:T(M),onClick:()=>N(M),role:"button",tabIndex:0,onKeyDown:$=>{($.key==="Enter"||$.key===" ")&&($.preventDefault(),N(M))},children:M},M))})]})});Nd.displayName="Calendar";const By="_root_2twxf_9",$y="_labelRow_2twxf_18",Py="_label_2twxf_18",zy="_required_2twxf_30",Fy="_group_2twxf_41",Hy="_btn_2twxf_50",Wy="_btnSelected_2twxf_76",Vy="_btnDisabled_2twxf_76",qy="_count_2twxf_109",Uy="_badge_2twxf_117",Ky="_btnLabel_2twxf_132",Gy="_optionIcon_2twxf_136",Jy="_splitButton_2twxf_148",Yy="_splitButtonDisabled_2twxf_157",Qy="_splitMain_2twxf_163",Xy="_placeholder_2twxf_193",Zy="_splitChevron_2twxf_199",ex="_chevronIcon_2twxf_219",tx="_dropdown_2twxf_228",nx="_dropdownRow_2twxf_244",rx="_dropdownRowSelected_2twxf_259",sx="_dropdownLabelSelected_2twxf_273",ix="_sizeSm_2twxf_282",ox="_sizeMd_2twxf_289",lx="_sizeLg_2twxf_296",se={root:By,labelRow:$y,label:Py,required:zy,group:Fy,btn:Hy,btnSelected:Wy,btnDisabled:Vy,count:qy,badge:Uy,btnLabel:Ky,optionIcon:Gy,splitButton:Jy,splitButtonDisabled:Yy,splitMain:Qy,placeholder:Xy,splitChevron:Zy,chevronIcon:ex,dropdown:tx,dropdownRow:nx,dropdownRowSelected:rx,dropdownLabelSelected:sx,sizeSm:ix,sizeMd:ox,sizeLg:lx};function ao({opt:t,labelClassName:e,countClassName:n,badgeClassName:r,iconClassName:s}){return d.jsxs(d.Fragment,{children:[t.icon&&d.jsx("span",{className:s,"aria-hidden":"true",children:t.icon}),d.jsx("span",{className:e,children:t.label}),t.count!==void 0&&d.jsx("span",{className:n,children:t.count}),t.badge&&d.jsx("span",{className:r,style:{backgroundColor:t.badge.color},"aria-label":`${t.badge.value}`,children:t.badge.value})]})}const Al=x.forwardRef(({options:t,value:e,onChange:n,variant:r="group",size:s="md",label:i,required:o=!1,disabled:l=!1,placeholder:a="Select…",className:c,style:u},h)=>{const p=x.useId(),[f,m]=x.useState(!1),g=x.useRef(null),b=k=>{g.current=k,typeof h=="function"?h(k):h&&(h.current=k)};x.useEffect(()=>{if(!f)return;function k(C){var N;(N=g.current)!=null&&N.contains(C.target)||m(!1)}return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[f]),x.useEffect(()=>{if(!f)return;function k(C){C.key==="Escape"&&m(!1)}return document.addEventListener("keydown",k),()=>document.removeEventListener("keydown",k)},[f]);const y=t.find(k=>k.value===e)??null;function v(k){l||(n==null||n(k),m(!1))}const _=s==="sm"?se.sizeSm:s==="lg"?se.sizeLg:se.sizeMd,w=[se.root,_,c??""].filter(Boolean).join(" ");return r==="group"?d.jsxs("div",{ref:b,className:w,style:u,children:[i&&d.jsxs("div",{className:se.labelRow,children:[d.jsx("span",{className:se.label,children:i}),o&&d.jsx("span",{className:se.required,"aria-hidden":"true",children:"*"})]}),d.jsx("div",{className:se.group,role:"group","aria-label":i??"Select button group","aria-disabled":l||void 0,children:t.map((k,C)=>{const N=C===0,O=C===t.length-1,B=k.value===e,S=t.length===1?se.btnSingle:N?se.btnLeft:O?se.btnRight:se.btnMiddle,T=[se.btn,S,B?se.btnSelected:"",l?se.btnDisabled:""].filter(Boolean).join(" ");return d.jsx("button",{id:`${p}-${k.value}`,type:"button",className:T,onClick:()=>v(k.value),"aria-pressed":B,disabled:l,children:d.jsx(ao,{opt:k,labelClassName:se.btnLabel,countClassName:se.count,badgeClassName:se.badge,iconClassName:se.optionIcon})},k.value)})})]}):d.jsxs("div",{ref:b,className:w,style:u,children:[i&&d.jsxs("div",{className:se.labelRow,children:[d.jsx("span",{className:se.label,children:i}),o&&d.jsx("span",{className:se.required,"aria-hidden":"true",children:"*"})]}),d.jsxs("div",{className:[se.splitButton,l?se.splitButtonDisabled:""].filter(Boolean).join(" "),"aria-disabled":l||void 0,children:[d.jsx("button",{type:"button",className:se.splitMain,onClick:()=>!l&&m(k=>!k),"aria-haspopup":"listbox","aria-expanded":f,disabled:l,children:y?d.jsx(ao,{opt:y,labelClassName:se.btnLabel,countClassName:se.count,badgeClassName:se.badge,iconClassName:se.optionIcon}):d.jsx("span",{className:se.placeholder,children:a})}),d.jsx("button",{type:"button",className:se.splitChevron,onClick:()=>!l&&m(k=>!k),"aria-label":f?"Close options":"Open options",tabIndex:-1,disabled:l,children:d.jsx("span",{className:se.chevronIcon,"aria-hidden":"true",children:d.jsx("i",{className:"pi pi-chevron-down"})})}),f&&d.jsx("div",{role:"listbox","aria-label":i??"Options",className:se.dropdown,children:t.map(k=>{const C=k.value===e,N=[se.dropdownRow,C?se.dropdownRowSelected:""].filter(Boolean).join(" ");return d.jsx("div",{role:"option","aria-selected":C,className:N,onClick:()=>v(k.value),tabIndex:0,onKeyDown:O=>{(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),v(k.value))},children:d.jsx(ao,{opt:k,labelClassName:C?`${se.btnLabel} ${se.dropdownLabelSelected}`:se.btnLabel,countClassName:se.count,badgeClassName:se.badge,iconClassName:se.optionIcon})},k.value)})})]})]})});Al.displayName="SelectButton";const ax="_root_12r37_8",cx="_labelRow_12r37_17",dx="_label_12r37_17",ux="_required_12r37_29",hx="_outer_12r37_37",fx="_inner_12r37_46",px="_innerDisabled_12r37_57",mx="_innerInvalid_12r37_57",gx="_textarea_12r37_95",bx="_textareaAutoGrow_12r37_122",yx="_bottomRow_12r37_130",xx="_helperText_12r37_139",vx="_errorText_12r37_146 _helperText_12r37_139",_x="_counter_12r37_153",kx="_innerWithCounter_12r37_164",wx="_textareaWithInnerCounter_12r37_169",Cx="_counterInside_12r37_174 _counter_12r37_153",Ve={root:ax,labelRow:cx,label:dx,required:ux,outer:hx,inner:fx,innerDisabled:px,innerInvalid:mx,textarea:gx,textareaAutoGrow:bx,bottomRow:yx,helperText:xx,errorText:vx,counter:_x,innerWithCounter:kx,textareaWithInnerCounter:wx,counterInside:Cx},Ad=x.forwardRef(({label:t,showLabel:e=!0,required:n=!1,helperText:r,invalid:s=!1,rows:i=3,autoGrow:o=!1,disabled:l=!1,maxLength:a,counterPlacement:c="outside",id:u,className:h,style:p,value:f,defaultValue:m,onChange:g,...b},y)=>{const v=x.useId(),_=u??`${v}-textarea`,w=`${v}-helper`,k=x.useRef(null),C=y??k,[N,O]=x.useState(()=>f!==void 0?String(f??"").length:m!==void 0?String(m??"").length:0);x.useEffect(()=>{f!==void 0&&O(String(f??"").length)},[f]),x.useEffect(()=>{if(!o||!C.current)return;const H=C.current;H.style.height="auto",H.style.height=`${H.scrollHeight}px`},[o,f,N,C]);function B(H){O(H.target.value.length),g==null||g(H)}const S=a!==void 0,T=c==="inside",P=Ve.outer,L=[Ve.inner,s?Ve.innerInvalid:"",l?Ve.innerDisabled:"",T&&S?Ve.innerWithCounter:""].filter(Boolean).join(" "),R=[Ve.textarea,o?Ve.textareaAutoGrow:"",T&&S?Ve.textareaWithInnerCounter:""].filter(Boolean).join(" ");return d.jsxs("div",{className:[Ve.root,h??""].filter(Boolean).join(" "),style:p,children:[t&&e&&d.jsxs("div",{className:Ve.labelRow,children:[d.jsx("label",{className:Ve.label,htmlFor:_,children:t}),n&&d.jsx("span",{className:Ve.required,"aria-hidden":"true",children:"*"})]}),d.jsxs("div",{className:P,children:[d.jsxs("div",{className:L,children:[d.jsx("textarea",{ref:C,id:_,rows:o?void 0:i,maxLength:a,disabled:l,required:n,"aria-invalid":s||void 0,"aria-label":!e&&t?t:void 0,"aria-describedby":[r?w:"",S?`${v}-counter`:""].filter(Boolean).join(" ")||void 0,className:R,value:f,defaultValue:m,onChange:B,...b}),T&&S&&d.jsxs("span",{id:`${v}-counter`,className:Ve.counterInside,"aria-live":"polite",children:[N,"/",a]})]}),(r||!T&&S)&&d.jsxs("div",{className:Ve.bottomRow,children:[r?d.jsx("span",{id:w,className:s?Ve.errorText:Ve.helperText,children:r}):d.jsx("span",{}),!T&&S&&d.jsxs("span",{id:`${v}-counter`,className:Ve.counter,"aria-live":"polite",children:[N,"/",a]})]})]})]})});Ad.displayName="TextArea";var Ko={exports:{}},co={};/**
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),x=require("react"),Ut=require("react-dom"),ip="_wrapper_soper_7",op="_disabled_soper_15",lp="_input_soper_21",ap="_box_soper_35",cp="_sm_soper_50",dp="_checkmark_soper_54",up="_dash_soper_58",hp="_label_soper_61",fp="_md_soper_66",pp="_lg_soper_82",mp="_indeterminate_soper_118",gp="_invalid_soper_154",bp="_helperText_soper_217",yp="_errorText_soper_225 _helperText_soper_217",kt={wrapper:ip,disabled:op,input:lp,box:ap,sm:cp,checkmark:dp,dash:up,label:hp,md:fp,lg:pp,indeterminate:mp,invalid:gp,helperText:bp,errorText:yp},Gn=x.forwardRef(({label:t,indeterminate:e=!1,invalid:n=!1,helperText:r,size:s="md",disabled:i=!1,id:o,className:l,...a},c)=>{const u=x.useRef(null),h=c??u;x.useEffect(()=>{h.current&&(h.current.indeterminate=e)},[e,h]);const p=[kt.wrapper,kt[s],i?kt.disabled:"",n?kt.invalid:"",e?kt.indeterminate:"",l??""].filter(Boolean).join(" ");return d.jsxs("div",{children:[d.jsxs("label",{className:p,htmlFor:o,children:[d.jsx("input",{ref:h,type:"checkbox",id:o,disabled:i,className:kt.input,"aria-invalid":n||void 0,...a}),d.jsxs("span",{className:kt.box,"aria-hidden":"true",children:[d.jsx("svg",{className:kt.checkmark,viewBox:"0 0 11 11",children:d.jsx("polyline",{points:"1.5,5.5 4.5,8.5 9.5,2.5"})}),d.jsx("span",{className:kt.dash})]}),t&&d.jsx("span",{className:kt.label,children:t})]}),r&&d.jsx("span",{className:n?kt.errorText:kt.helperText,children:r})]})});Gn.displayName="Checkbox";const xp="_root_k9kb0_9",vp="_labelRow_k9kb0_19",_p="_labelText_k9kb0_25",kp="_requiredMark_k9kb0_31",wp="_inputWrap_k9kb0_39",Cp="_sm_k9kb0_53",Sp="_nativeInput_k9kb0_60",Np="_md_k9kb0_65",Ap="_lg_k9kb0_77",Tp="_iconSlot_k9kb0_113",Ep="_iconSlotSuffix_k9kb0_125",Mp="_disabled_k9kb0_131",jp="_invalid_k9kb0_146",Ip="_helperText_k9kb0_195",pt={root:xp,labelRow:vp,labelText:_p,requiredMark:kp,inputWrap:wp,sm:Cp,nativeInput:Sp,md:Np,lg:Ap,iconSlot:Tp,iconSlotSuffix:Ep,disabled:Mp,invalid:jp,helperText:Ip};let Dp=0;const gs=x.forwardRef(({label:t,required:e=!1,helperText:n,invalid:r=!1,size:s="md",prefixIcon:i,suffixIcon:o,disabled:l=!1,id:a,className:c,...u},h)=>{const p=a??`inputtext-${++Dp}`,f=[pt.root,pt[s],r?pt.invalid:"",l?pt.disabled:"",c??""].filter(Boolean).join(" ");return d.jsxs("div",{className:f,children:[t&&d.jsxs("label",{className:pt.labelRow,htmlFor:p,children:[d.jsx("span",{className:pt.labelText,children:t}),e&&d.jsx("span",{className:pt.requiredMark,"aria-hidden":"true",children:"*"})]}),d.jsxs("div",{className:pt.inputWrap,children:[i&&d.jsx("span",{className:pt.iconSlot,"aria-hidden":"true",children:i}),d.jsx("input",{ref:h,id:p,disabled:l,required:e,"aria-invalid":r||void 0,"aria-describedby":n?`${p}-helper`:void 0,className:pt.nativeInput,...u}),o&&d.jsx("span",{className:`${pt.iconSlot} ${pt.iconSlotSuffix}`,"aria-hidden":"true",children:o})]}),n&&d.jsx("span",{id:`${p}-helper`,className:pt.helperText,children:n})]})});gs.displayName="InputText";const Op="_listbox_fb69z_9",Rp="_invalid_fb69z_22",Lp="_listboxDisabled_fb69z_27",Bp="_header_fb69z_33",$p="_labelRow_fb69z_42",Pp="_label_fb69z_42",zp="_required_fb69z_55",Fp="_inputWrap_fb69z_63",Hp="_filterInput_fb69z_79",Wp="_iconSearch_fb69z_105",Vp="_iconButton_fb69z_121",qp="_helperText_fb69z_146",Up="_errorText_fb69z_153 _helperText_fb69z_146",Kp="_list_fb69z_9",Gp="_option_fb69z_169",Jp="_optionGroupItem_fb69z_184",Yp="_optionDisabled_fb69z_189",Qp="_optionHighlight_fb69z_200",Xp="_optionLabel_fb69z_212",Zp="_optionLabelDisabled_fb69z_220",em="_groupHeader_fb69z_226",tm="_checkbox_fb69z_238",nm="_checkboxChecked_fb69z_253",rm="_checkboxDisabled_fb69z_259",sm="_checkmark_fb69z_265",im="_checkmarkDisabled_fb69z_277",be={listbox:Op,invalid:Rp,listboxDisabled:Lp,header:Bp,labelRow:$p,label:Pp,required:zp,inputWrap:Fp,filterInput:Hp,iconSearch:Wp,iconButton:Vp,helperText:qp,errorText:Up,list:Kp,option:Gp,optionGroupItem:Jp,optionDisabled:Yp,optionHighlight:Qp,optionLabel:Xp,optionLabelDisabled:Zp,groupHeader:em,checkbox:tm,checkboxChecked:nm,checkboxDisabled:rm,checkmark:sm,checkmarkDisabled:im};function om(t){return t.length>0&&"items"in t[0]}const wd=x.forwardRef(({options:t,value:e,onChange:n,multiple:r=!1,filter:s=!1,filterPlaceholder:i="Search…",label:o,required:l=!1,helperText:a,invalid:c=!1,disabled:u=!1,className:h,style:p},f)=>{const m=x.useId(),g=`${m}-filter`,b=`${m}-helper`,[y,v]=x.useState(""),_=x.useMemo(()=>e==null?[]:Array.isArray(e)?e:[e],[e]),w=om(t);function k(T){return!s||!y?!0:T.toLowerCase().includes(y.toLowerCase())}function C(T){if(!u)if(r){const P=_.includes(T)?_.filter(L=>L!==T):[..._,T];n==null||n(P)}else n==null||n(_[0]===T?null:T)}function S(T,P=!1){if(!k(T.label))return null;const L=_.includes(T.value),R=u||T.disabled,H=[be.option,L?be.optionHighlight:"",R?be.optionDisabled:"",P?be.optionGroupItem:""].filter(Boolean).join(" "),q=L&&R;return d.jsxs("div",{role:"option","aria-selected":L,"aria-disabled":R||void 0,className:H,onClick:()=>!R&&C(T.value),tabIndex:R?-1:0,onKeyDown:j=>{(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),R||C(T.value))},children:[r&&d.jsx("span",{"aria-hidden":"true",className:[be.checkbox,L&&!R?be.checkboxChecked:"",R?be.checkboxDisabled:""].filter(Boolean).join(" "),children:L&&d.jsx("svg",{className:q?`${be.checkmark} ${be.checkmarkDisabled}`:be.checkmark,viewBox:"0 0 11 11",children:d.jsx("polyline",{points:"1.5,5.5 4.5,8.5 9.5,2.5"})})}),d.jsx("span",{className:R?`${be.optionLabel} ${be.optionLabelDisabled}`:be.optionLabel,children:T.label})]},T.value)}function O(){return w?t.map(T=>{const P=T.items.map(L=>S(L,!0)).filter(Boolean);return P.length===0?null:d.jsxs("div",{children:[d.jsx("div",{className:be.groupHeader,children:T.label}),P]},T.label)}):t.map(T=>S(T))}const B=[be.listbox,c?be.invalid:"",u?be.listboxDisabled:"",h??""].filter(Boolean).join(" "),N=s||!!(o||a);return d.jsxs("div",{ref:f,className:B,style:p,children:[N&&d.jsxs("div",{className:be.header,children:[o&&d.jsxs("div",{className:be.labelRow,children:[d.jsx("label",{className:be.label,htmlFor:g,children:o}),l&&d.jsx("span",{className:be.required,"aria-hidden":"true",children:"*"})]}),s&&d.jsxs("div",{className:be.inputWrap,children:[d.jsx("input",{id:g,type:"text",className:be.filterInput,placeholder:i,value:y,onChange:T=>v(T.target.value),disabled:u,required:l,"aria-invalid":c||void 0,"aria-describedby":a?b:void 0}),y?d.jsx("button",{type:"button",className:be.iconButton,onClick:()=>v(""),"aria-label":"Clear filter",tabIndex:-1,disabled:u,children:d.jsx("svg",{viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:d.jsx("path",{d:"M5 5L9 9M9 5L5 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}):d.jsx("span",{className:be.iconSearch,"aria-hidden":"true",children:d.jsxs("svg",{viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("circle",{cx:"6",cy:"6",r:"4.5",stroke:"currentColor",strokeWidth:"1.5"}),d.jsx("path",{d:"M9.5 9.5L12.5 12.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})})]}),a&&d.jsx("span",{id:b,className:c?be.errorText:be.helperText,children:a})]}),d.jsx("div",{role:"listbox","aria-multiselectable":r||void 0,"aria-disabled":u||void 0,className:be.list,children:O()})]})});wd.displayName="ListBox";const lm="_wrapper_1o7x9_7",am="_disabled_1o7x9_15",cm="_input_1o7x9_21",dm="_circle_1o7x9_35",um="_sm_1o7x9_50",hm="_dot_1o7x9_54",fm="_label_1o7x9_58",pm="_md_1o7x9_63",mm="_lg_1o7x9_76",gm="_invalid_1o7x9_151",bm="_helperText_1o7x9_175",ym="_errorText_1o7x9_183 _helperText_1o7x9_175",zt={wrapper:lm,disabled:am,input:cm,circle:dm,sm:um,dot:hm,label:fm,md:pm,lg:mm,invalid:gm,helperText:bm,errorText:ym},Cd=x.forwardRef(({label:t,invalid:e=!1,helperText:n,size:r="md",disabled:s=!1,id:i,className:o,...l},a)=>{const c=x.useRef(null),u=a??c,h=[zt.wrapper,zt[r],s?zt.disabled:"",e?zt.invalid:"",o??""].filter(Boolean).join(" ");return d.jsxs("div",{children:[d.jsxs("label",{className:h,htmlFor:i,children:[d.jsx("input",{ref:u,type:"radio",id:i,disabled:s,className:zt.input,"aria-invalid":e||void 0,...l}),d.jsx("span",{className:zt.circle,"aria-hidden":"true",children:d.jsx("span",{className:zt.dot})}),t&&d.jsx("span",{className:zt.label,children:t})]}),n&&d.jsx("span",{className:e?zt.errorText:zt.helperText,children:n})]})});Cd.displayName="RadioButton";const xm="_chip_12hjq_1",vm="_dismissible_12hjq_21",_m="_label_12hjq_33",km="_dismiss_12hjq_21",ks={chip:xm,dismissible:vm,label:_m,dismiss:km},wm={"red-darkest":{bg:"var(--red-800)",text:"var(--red-100)"},"red-dark":{bg:"var(--red-200)",text:"var(--red-900)"},"red-light":{bg:"var(--red-100)",text:"var(--red-800)"},"yellow-darkest":{bg:"var(--yellow-800)",text:"var(--yellow-50)"},"yellow-dark":{bg:"var(--yellow-300)",text:"var(--yellow-800)"},"yellow-light":{bg:"var(--yellow-100)",text:"var(--yellow-900)"},"green-darkest":{bg:"var(--green-800)",text:"var(--green-50)"},"green-dark":{bg:"var(--green-300)",text:"var(--green-800)"},"green-light":{bg:"var(--green-100)",text:"var(--green-800)"},"blue-darkest":{bg:"var(--blue-800)",text:"var(--blue-50)"},"blue-dark":{bg:"var(--blue-300)",text:"var(--blue-900)"},"blue-light":{bg:"var(--blue-100)",text:"var(--blue-900)"},"navy-darkest":{bg:"var(--navy-700)",text:"var(--navy-50)"},"navy-dark":{bg:"var(--navy-400)",text:"var(--navy-50)"},"navy-light":{bg:"var(--navy-100)",text:"var(--navy-800)"}};function Gs({label:t,color:e,dismissible:n=!0,onDismiss:r,style:s,forceFocus:i}){const o=wm[e],l={"--c-bg":o.bg,"--c-text":o.text,...i?{boxShadow:"var(--focus-ring)",outline:"none"}:void 0,...s};return d.jsxs("span",{className:`${ks.chip}${n?` ${ks.dismissible}`:""}`,style:l,children:[d.jsx("span",{className:ks.label,children:t}),n&&d.jsx("button",{type:"button",className:ks.dismiss,onClick:r,"aria-label":`Remove ${t}`,children:d.jsx("i",{className:"pi pi-times","aria-hidden":"true"})})]})}Gs.displayName="MiscChip";const Cm="_root_18kn1_10",Sm="_rootDisabled_18kn1_18",Nm="_field_18kn1_24",Am="_labelRow_18kn1_32",Tm="_label_18kn1_32",Em="_required_18kn1_44",Mm="_trigger_18kn1_52",jm="_triggerOpen_18kn1_69",Im="_triggerInvalid_18kn1_74",Dm="_triggerDisabled_18kn1_79",Om="_sm_18kn1_90",Rm="_lg_18kn1_91",Lm="_triggerContent_18kn1_95",Bm="_placeholder_18kn1_105",$m="_md_18kn1_112",Pm="_chips_18kn1_117",zm="_chip_18kn1_117",Fm="_chipLabel_18kn1_134",Hm="_chipRemove_18kn1_142",Wm="_chevron_18kn1_170",Vm="_helperText_18kn1_191",qm="_errorText_18kn1_198 _helperText_18kn1_191",Um="_dropdown_18kn1_205",Km="_dropdownHeader_18kn1_220",Gm="_hiddenInput_18kn1_231",Jm="_selectAllWrap_18kn1_243",Ym="_cbBox_18kn1_258",Qm="_cbChecked_18kn1_272",Xm="_cbIndeterminate_18kn1_277",Zm="_cbCheckmark_18kn1_282",eg="_cbDash_18kn1_293",tg="_searchWrap_18kn1_302",ng="_searchIcon_18kn1_315",rg="_searchInput_18kn1_329",sg="_searchClear_18kn1_345",ig="_optionList_18kn1_365",og="_option_18kn1_365",lg="_optionDisabled_18kn1_390",ag="_optionHighlight_18kn1_400",cg="_optionCb_18kn1_415",dg="_optionCbChecked_18kn1_429",ug="_optionCbCheckmark_18kn1_434",hg="_optionLabel_18kn1_447",fg="_optionLabelHighlight_18kn1_456",pg="_optionChipWrap_18kn1_462",mg="_footer_18kn1_471",gg="_noResults_18kn1_483",Z={root:Cm,rootDisabled:Sm,field:Nm,labelRow:Am,label:Tm,required:Em,trigger:Mm,triggerOpen:jm,triggerInvalid:Im,triggerDisabled:Dm,sm:Om,lg:Rm,triggerContent:Lm,placeholder:Bm,md:$m,chips:Pm,chip:zm,chipLabel:Fm,chipRemove:Hm,chevron:Wm,helperText:Vm,errorText:qm,dropdown:Um,dropdownHeader:Km,hiddenInput:Gm,selectAllWrap:Jm,cbBox:Ym,cbChecked:Qm,cbIndeterminate:Xm,cbCheckmark:Zm,cbDash:eg,searchWrap:tg,searchIcon:ng,searchInput:rg,searchClear:sg,optionList:ig,option:og,optionDisabled:lg,optionHighlight:ag,optionCb:cg,optionCbChecked:dg,optionCbCheckmark:ug,optionLabel:hg,optionLabelHighlight:fg,optionChipWrap:pg,footer:mg,noResults:gg},Sd=x.forwardRef(({options:t,value:e,onChange:n,placeholder:r="Select options…",label:s,required:i=!1,helperText:o,invalid:l=!1,disabled:a=!1,filter:c=!0,filterPlaceholder:u="Search…",showSelectAll:h=!0,size:p="md",footer:f,className:m,style:g},b)=>{const y=x.useId(),v=`${y}-dropdown`,_=`${y}-trigger`,w=`${y}-helper`,[k,C]=x.useState(!1),[S,O]=x.useState(""),B=x.useRef(null),N=x.useRef(null),T=A=>{B.current=A,typeof b=="function"?b(A):b&&(b.current=A)},P=e??[],L=x.useMemo(()=>t.filter(A=>!A.disabled),[t]),R=L.length>0&&L.every(A=>P.includes(A.value)),q=!!L.some(A=>P.includes(A.value))&&!R;x.useEffect(()=>{if(!k)return;function A(U){var Y;(Y=B.current)!=null&&Y.contains(U.target)||(C(!1),O(""))}return document.addEventListener("mousedown",A),()=>document.removeEventListener("mousedown",A)},[k]),x.useEffect(()=>{N.current&&(N.current.indeterminate=q)},[q]),x.useEffect(()=>{if(!k)return;function A(U){U.key==="Escape"&&(C(!1),O(""))}return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[k]);const j=x.useMemo(()=>{if(!c||!S)return t;const A=S.toLowerCase();return t.filter(U=>U.label.toLowerCase().includes(A))},[t,c,S]);function $(){a||C(A=>(A&&O(""),!A))}function W(A){const U=P.includes(A)?P.filter(Y=>Y!==A):[...P,A];n==null||n(U)}function se(A){n==null||n(P.filter(U=>U!==A))}function ae(){const A=L.map(U=>U.value);R?n==null||n(P.filter(U=>!A.includes(U))):n==null||n([...new Set([...P,...A])])}function Ne(A){A.key==="Enter"||A.key===" "?(A.preventDefault(),$()):A.key==="Escape"?(C(!1),O("")):A.key==="ArrowDown"&&!k&&(A.preventDefault(),C(!0))}const je=[Z.root,Z[p],a?Z.rootDisabled:"",m??""].filter(Boolean).join(" "),Be=[Z.trigger,k?Z.triggerOpen:"",l?Z.triggerInvalid:"",a?Z.triggerDisabled:""].filter(Boolean).join(" ");return d.jsxs("div",{ref:T,className:je,style:g,children:[d.jsxs("div",{className:Z.field,children:[s&&d.jsxs("div",{className:Z.labelRow,children:[d.jsx("label",{className:Z.label,htmlFor:_,children:s}),i&&d.jsx("span",{className:Z.required,"aria-hidden":"true",children:"*"})]}),d.jsxs("div",{id:_,role:"combobox","aria-haspopup":"listbox","aria-expanded":k,"aria-controls":v,"aria-required":i||void 0,"aria-invalid":l||void 0,"aria-describedby":o?w:void 0,"aria-disabled":a||void 0,tabIndex:a?-1:0,className:Be,onClick:$,onKeyDown:Ne,children:[d.jsx("span",{className:Z.triggerContent,children:P.length===0?d.jsx("span",{className:Z.placeholder,children:r}):d.jsx("span",{className:Z.chips,children:P.map(A=>{const U=t.find(Y=>Y.value===A);return U?U.chip?d.jsx("span",{onMouseDown:Y=>Y.stopPropagation(),onClick:Y=>Y.stopPropagation(),children:d.jsx(Gs,{label:U.label,color:U.chip.color,dismissible:!a,onDismiss:()=>se(A)})},A):d.jsxs("span",{className:Z.chip,children:[d.jsx("span",{className:Z.chipLabel,children:U.label}),!a&&d.jsx("button",{type:"button",className:Z.chipRemove,onMouseDown:Y=>Y.stopPropagation(),onClick:Y=>{Y.stopPropagation(),se(A)},"aria-label":`Remove ${U.label}`,tabIndex:-1,children:d.jsx("svg",{viewBox:"0 0 8 8",fill:"none",children:d.jsx("path",{d:"M1 1l6 6M7 1l-6 6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]},A):null})})}),d.jsx("span",{className:Z.chevron,"aria-hidden":"true",children:d.jsx("svg",{viewBox:"0 0 14 8",fill:"none",children:d.jsx("path",{d:"M1 1l6 6 6-6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),o&&d.jsx("span",{id:w,className:l?Z.errorText:Z.helperText,children:o})]}),k&&d.jsxs("div",{id:v,role:"listbox","aria-multiselectable":"true",className:Z.dropdown,children:[d.jsxs("div",{className:Z.dropdownHeader,children:[h&&d.jsxs("span",{className:Z.selectAllWrap,onClick:ae,"aria-label":"Select all",role:"checkbox","aria-checked":R?!0:q?"mixed":!1,tabIndex:0,onKeyDown:A=>{(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),ae())},children:[d.jsx("input",{ref:N,type:"checkbox",className:Z.hiddenInput,checked:R,onChange:ae}),d.jsxs("span",{"aria-hidden":"true",className:[Z.cbBox,R?Z.cbChecked:"",q?Z.cbIndeterminate:""].filter(Boolean).join(" "),children:[R&&d.jsx("svg",{className:Z.cbCheckmark,viewBox:"0 0 11 11",children:d.jsx("polyline",{points:"1.5,5.5 4.5,8.5 9.5,2.5"})}),q&&d.jsx("span",{className:Z.cbDash})]})]}),c&&d.jsxs("div",{className:Z.searchWrap,children:[d.jsx("span",{className:Z.searchIcon,"aria-hidden":"true",children:d.jsxs("svg",{viewBox:"0 0 14 14",fill:"none",children:[d.jsx("circle",{cx:"6",cy:"6",r:"4.5",stroke:"currentColor",strokeWidth:"1.5"}),d.jsx("path",{d:"M9.5 9.5L12.5 12.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}),d.jsx("input",{type:"text",className:Z.searchInput,placeholder:u,value:S,onChange:A=>O(A.target.value),"aria-label":"Filter options",autoComplete:"off"}),S&&d.jsx("button",{type:"button",className:Z.searchClear,onClick:()=>O(""),"aria-label":"Clear filter",tabIndex:-1,children:d.jsx("svg",{viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M5 5l4 4M9 5l-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]})]}),d.jsx("div",{className:Z.optionList,children:j.length===0?d.jsx("div",{className:Z.noResults,children:"No results"}):j.map(A=>{const U=P.includes(A.value),Y=A.disabled,Ie=[Z.option,U?Z.optionHighlight:"",Y?Z.optionDisabled:""].filter(Boolean).join(" ");return d.jsxs("div",{role:"option","aria-selected":U,"aria-disabled":Y||void 0,className:Ie,onClick:()=>!Y&&W(A.value),tabIndex:Y?-1:0,onKeyDown:$e=>{($e.key==="Enter"||$e.key===" ")&&!Y&&($e.preventDefault(),W(A.value))},children:[d.jsx("span",{"aria-hidden":"true",className:[Z.optionCb,U?Z.optionCbChecked:""].filter(Boolean).join(" "),children:U&&d.jsx("svg",{className:Z.optionCbCheckmark,viewBox:"0 0 11 11",children:d.jsx("polyline",{points:"1.5,5.5 4.5,8.5 9.5,2.5"})})}),A.chip?d.jsx("span",{className:Z.optionChipWrap,children:d.jsx(Gs,{label:A.label,color:A.chip.color,dismissible:!1})}):d.jsx("span",{className:U?`${Z.optionLabel} ${Z.optionLabelHighlight}`:Z.optionLabel,children:A.label})]},A.value)})}),f&&d.jsx("div",{className:Z.footer,children:f})]})]})});Sd.displayName="MultiSelect";const bg="_root_1t9zz_10",yg="_rootDisabled_1t9zz_18",xg="_field_1t9zz_24",vg="_labelRow_1t9zz_32",_g="_label_1t9zz_32",kg="_required_1t9zz_44",wg="_trigger_1t9zz_52",Cg="_triggerOpen_1t9zz_68",Sg="_triggerDisabled_1t9zz_68",Ng="_triggerInvalid_1t9zz_68",Ag="_lg_1t9zz_91",Tg="_triggerContent_1t9zz_95",Eg="_placeholder_1t9zz_101",Mg="_triggerValue_1t9zz_113",jg="_sm_1t9zz_138",Ig="_md_1t9zz_140",Dg="_chevron_1t9zz_147",Og="_chevronInvalid_1t9zz_167",Rg="_chevronDisabled_1t9zz_172",Lg="_leadingIcon_1t9zz_178",Bg="_helperText_1t9zz_196",$g="_errorText_1t9zz_203 _helperText_1t9zz_196",Pg="_dropdown_1t9zz_210",zg="_filterHeader_1t9zz_225",Fg="_searchWrap_1t9zz_230",Hg="_searchIcon_1t9zz_241",Wg="_searchInput_1t9zz_255",Vg="_searchClear_1t9zz_271",qg="_optionList_1t9zz_291",Ug="_option_1t9zz_291",Kg="_optionDisabled_1t9zz_315",Gg="_optionHighlight_1t9zz_326",Jg="_optionLabel_1t9zz_337",Yg="_optionLabelHighlight_1t9zz_345",Qg="_noResults_1t9zz_351",ue={root:bg,rootDisabled:yg,field:xg,labelRow:vg,label:_g,required:kg,trigger:wg,triggerOpen:Cg,triggerDisabled:Sg,triggerInvalid:Ng,lg:Ag,triggerContent:Tg,placeholder:Eg,triggerValue:Mg,sm:jg,md:Ig,chevron:Dg,chevronInvalid:Og,chevronDisabled:Rg,leadingIcon:Lg,helperText:Bg,errorText:$g,dropdown:Pg,filterHeader:zg,searchWrap:Fg,searchIcon:Hg,searchInput:Wg,searchClear:Vg,optionList:qg,option:Ug,optionDisabled:Kg,optionHighlight:Gg,optionLabel:Jg,optionLabelHighlight:Yg,noResults:Qg},Xg=d.jsx("i",{className:"pi pi-search"}),pr=x.forwardRef(({options:t,value:e,onChange:n,placeholder:r="Select…",label:s,required:i=!1,helperText:o,invalid:l=!1,disabled:a=!1,filter:c=!1,filterPlaceholder:u="Search…",size:h="md",leadingIcon:p,className:f,style:m},g)=>{const b=x.useId(),y=`${b}-dropdown`,v=`${b}-trigger`,_=`${b}-helper`,[w,k]=x.useState(!1),[C,S]=x.useState(""),O=x.useRef(null),B=x.useRef(null),N=x.useRef(null),[T,P]=x.useState(null),L=A=>{O.current=A,typeof g=="function"?g(A):g&&(g.current=A)},R=t.find(A=>A.value===e)??null;x.useEffect(()=>{if(!w)return;function A(U){var Ie,$e;const Y=U.target;!((Ie=O.current)!=null&&Ie.contains(Y))&&!(($e=N.current)!=null&&$e.contains(Y))&&(k(!1),S(""))}return document.addEventListener("mousedown",A),()=>document.removeEventListener("mousedown",A)},[w]),x.useEffect(()=>{if(!w)return;function A(){var Y;const U=(Y=B.current)==null?void 0:Y.getBoundingClientRect();U&&P({top:U.bottom+2,left:U.left,width:U.width})}return A(),window.addEventListener("scroll",A,!0),window.addEventListener("resize",A),()=>{window.removeEventListener("scroll",A,!0),window.removeEventListener("resize",A)}},[w]),x.useEffect(()=>{if(!w)return;function A(U){U.key==="Escape"&&(k(!1),S(""))}return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[w]);const H=x.useRef(!1);x.useLayoutEffect(()=>{var U;if(!w){H.current=!1;return}if(!T||H.current)return;const A=(U=N.current)==null?void 0:U.querySelector('[role="option"][aria-selected="true"]');A&&(A.scrollIntoView({block:"start"}),H.current=!0)},[w,T]);const q=x.useMemo(()=>{if(!c||!C)return t;const A=C.toLowerCase();return t.filter(U=>U.label.toLowerCase().includes(A))},[t,c,C]);function j(){a||k(A=>(A&&S(""),!A))}function $(A){n==null||n(A),k(!1),S("")}function W(A){A.key==="Enter"||A.key===" "?(A.preventDefault(),j()):A.key==="Escape"?(k(!1),S("")):A.key==="ArrowDown"&&!w&&(A.preventDefault(),k(!0))}const se=!!R,ae=p===!0?Xg:p||null,Ne=[ue.root,ue[h],a?ue.rootDisabled:"",f??""].filter(Boolean).join(" "),je=[ue.trigger,w?ue.triggerOpen:"",l?ue.triggerInvalid:"",a?ue.triggerDisabled:"",se&&!l&&!a?ue.triggerFilled:""].filter(Boolean).join(" "),Be=[ue.chevron,l?ue.chevronInvalid:"",a?ue.chevronDisabled:""].filter(Boolean).join(" ");return d.jsxs("div",{ref:L,className:Ne,style:m,children:[d.jsxs("div",{className:ue.field,children:[s&&d.jsxs("div",{className:ue.labelRow,children:[d.jsx("label",{className:ue.label,htmlFor:v,children:s}),i&&d.jsx("span",{className:ue.required,"aria-hidden":"true",children:"*"})]}),d.jsxs("div",{ref:B,id:v,role:"combobox","aria-haspopup":"listbox","aria-expanded":w,"aria-controls":y,"aria-required":i||void 0,"aria-invalid":l||void 0,"aria-describedby":o?_:void 0,"aria-disabled":a||void 0,tabIndex:a?-1:0,className:je,onClick:j,onKeyDown:W,children:[ae&&d.jsx("span",{className:ue.leadingIcon,"aria-hidden":"true",children:ae}),d.jsx("span",{className:ue.triggerContent,children:R?d.jsx("span",{className:ue.triggerValue,children:R.label}):d.jsx("span",{className:ue.placeholder,children:r})}),d.jsx("span",{className:Be,"aria-hidden":"true",children:d.jsx("svg",{viewBox:"0 0 14 8",fill:"none",children:d.jsx("path",{d:"M1 1l6 6 6-6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),o&&d.jsx("span",{id:_,className:l?ue.errorText:ue.helperText,children:o})]}),w&&T&&Ut.createPortal(d.jsxs("div",{ref:N,"data-popover-root":"",id:y,role:"listbox",className:ue.dropdown,style:{top:T.top,left:T.left,width:T.width},children:[c&&d.jsx("div",{className:ue.filterHeader,children:d.jsxs("div",{className:ue.searchWrap,children:[d.jsx("span",{className:ue.searchIcon,"aria-hidden":"true",children:d.jsxs("svg",{viewBox:"0 0 14 14",fill:"none",children:[d.jsx("circle",{cx:"6",cy:"6",r:"4.5",stroke:"currentColor",strokeWidth:"1.5"}),d.jsx("path",{d:"M9.5 9.5L12.5 12.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}),d.jsx("input",{type:"text",className:ue.searchInput,placeholder:u,value:C,onChange:A=>S(A.target.value),"aria-label":"Filter options",autoComplete:"off"}),C&&d.jsx("button",{type:"button",className:ue.searchClear,onClick:()=>S(""),"aria-label":"Clear filter",tabIndex:-1,children:d.jsx("svg",{viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M5 5l4 4M9 5l-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]})}),d.jsx("div",{className:ue.optionList,children:q.length===0?d.jsx("div",{className:ue.noResults,children:"No results"}):q.map(A=>{const U=A.value===e,Y=A.disabled,Ie=[ue.option,U?ue.optionHighlight:"",Y?ue.optionDisabled:""].filter(Boolean).join(" ");return d.jsx("div",{role:"option","aria-selected":U,"aria-disabled":Y||void 0,className:Ie,onClick:()=>!Y&&$(A.value),tabIndex:Y?-1:0,onKeyDown:$e=>{($e.key==="Enter"||$e.key===" ")&&!Y&&($e.preventDefault(),$(A.value))},children:d.jsx("span",{className:U?`${ue.optionLabel} ${ue.optionLabelHighlight}`:ue.optionLabel,children:A.label})},A.value)})})]}),document.body)]})});pr.displayName="Select";const Zg="_btn_1wdnr_7",eb="_disabled_1wdnr_21",tb="_sm_1wdnr_27",nb="_md_1wdnr_33",rb="_lg_1wdnr_39",sb="_icon_1wdnr_47",ib="_primary_1wdnr_59",ob="_secondary_1wdnr_68",lb="_ghost_1wdnr_78",ab="_danger_1wdnr_87",Ar={btn:Zg,disabled:eb,sm:tb,md:nb,lg:rb,icon:sb,primary:ib,secondary:ob,ghost:lb,danger:ab},cb="_wrapper_wreg1_4",db="_tooltip_wreg1_17",ub="_placement_top_wreg1_59",hb="_placement_bottom_wreg1_69",fb="_placement_left_wreg1_79",pb="_placement_right_wreg1_89",so={wrapper:cb,tooltip:db,placement_top:ub,placement_bottom:hb,placement_left:fb,placement_right:pb},ws=8,Cs=44;function er({content:t,children:e,placement:n="top",delay:r=200,disabled:s=!1,maxWidth:i=140,className:o}){const[l,a]=x.useState(null),c=x.useRef(null),u=x.useRef(null),h=x.useId(),p=l!==null,f=x.useCallback(()=>{const y=c.current;if(!y)return null;const v=y.getBoundingClientRect(),_=window.innerWidth,w=window.innerHeight;let k=n;k==="top"&&v.top<Cs?k="bottom":k==="bottom"&&w-v.bottom<Cs?k="top":k==="left"&&v.left<Cs?k="right":k==="right"&&_-v.right<Cs&&(k="left");const C=v.left+v.width/2,S=v.top+v.height/2;switch(k){case"bottom":return{top:v.bottom+ws,left:C,transform:"translate(-50%, 0)",placement:k};case"left":return{top:S,left:v.left-ws,transform:"translate(-100%, -50%)",placement:k};case"right":return{top:S,left:v.right+ws,transform:"translate(0, -50%)",placement:k};case"top":default:return{top:v.top-ws,left:C,transform:"translate(-50%, -100%)",placement:k}}},[n]),m=()=>{s||(u.current&&clearTimeout(u.current),u.current=setTimeout(()=>a(f()),r))},g=()=>{u.current&&clearTimeout(u.current),a(null)};x.useLayoutEffect(()=>{if(!p)return;const y=()=>a(f()),v={capture:!0,passive:!0};return window.addEventListener("scroll",y,v),window.addEventListener("resize",y),()=>{window.removeEventListener("scroll",y,v),window.removeEventListener("resize",y)}},[p,f]),x.useEffect(()=>()=>{u.current&&clearTimeout(u.current)},[]);const b=[so.tooltip,so[`placement_${(l==null?void 0:l.placement)??n}`],o??""].filter(Boolean).join(" ");return d.jsxs("span",{ref:c,className:so.wrapper,onMouseEnter:m,onMouseLeave:g,onFocus:m,onBlur:g,children:[d.jsx("span",{"aria-describedby":p?h:void 0,children:e}),p&&l&&typeof document<"u"&&Ut.createPortal(d.jsx("div",{id:h,role:"tooltip",className:b,style:{maxWidth:i,top:l.top,left:l.left,transform:l.transform},"aria-hidden":!1,children:t}),document.body)]})}er.displayName="Tooltip";const ut=x.forwardRef(({icon:t,variant:e="primary",size:n="md",className:r,disabled:s,tooltipPlacement:i="top","aria-label":o,...l},a)=>{const c=[Ar.btn,Ar[e],Ar[n],s?Ar.disabled:"",r??""].filter(Boolean).join(" ");return d.jsx(er,{content:o,placement:i,children:d.jsx("button",{ref:a,className:c,disabled:s,"aria-label":o,...l,children:d.jsx("span",{className:Ar.icon,"aria-hidden":"true",children:t})})})});ut.displayName="IconButton";const mb="_root_k08lc_10",gb="_field_k08lc_20",bb="_labelRow_k08lc_28",yb="_label_k08lc_28",xb="_required_k08lc_40",vb="_inputWrap_k08lc_48",_b="_inputWrapDisabled_k08lc_60",kb="_inputWrapInvalid_k08lc_60",wb="_inputWrapOpen_k08lc_65",Cb="_input_k08lc_48",Sb="_calIconBtn_k08lc_102",Nb="_helperText_k08lc_128",Ab="_errorText_k08lc_135 _helperText_k08lc_128",Tb="_calendar_k08lc_144",Eb="_calHeader_k08lc_161",Mb="_titleGroup_k08lc_171",jb="_titleBtn_k08lc_178",Ib="_titleText_k08lc_196",Db="_dayView_k08lc_207",Ob="_weekRow_k08lc_212",Rb="_weekRowWithWk_k08lc_217",Lb="_weekdayCell_k08lc_223",Bb="_wkLabel_k08lc_233",$b="_cell_k08lc_239",Pb="_wkCell_k08lc_252",zb="_cellDisabled_k08lc_262",Fb="_dayCircle_k08lc_262",Hb="_cellOutside_k08lc_277",Wb="_cellSelected_k08lc_292",Vb="_cellToday_k08lc_297",qb="_dayCircleSelected_k08lc_320",Ub="_dayCircleToday_k08lc_326",Kb="_monthGrid_k08lc_335",Gb="_monthCell_k08lc_342",Jb="_monthCellSelected_k08lc_356",Yb="_yearGrid_k08lc_373",Qb="_yearCell_k08lc_380",Xb="_yearCellSelected_k08lc_394",Zb="_footer_k08lc_411",ey="_clearBtn_k08lc_421",ty="_todayBtn_k08lc_442",Q={root:mb,field:gb,labelRow:bb,label:yb,required:xb,inputWrap:vb,inputWrapDisabled:_b,inputWrapInvalid:kb,inputWrapOpen:wb,input:Cb,calIconBtn:Sb,helperText:Nb,errorText:Ab,calendar:Tb,calHeader:Eb,titleGroup:Mb,titleBtn:jb,titleText:Ib,dayView:Db,weekRow:Ob,weekRowWithWk:Rb,weekdayCell:Lb,wkLabel:Bb,cell:$b,wkCell:Pb,cellDisabled:zb,dayCircle:Fb,cellOutside:Hb,cellSelected:Wb,cellToday:Vb,dayCircleSelected:qb,dayCircleToday:Ub,monthGrid:Kb,monthCell:Gb,monthCellSelected:Jb,yearGrid:Yb,yearCell:Qb,yearCellSelected:Xb,footer:Zb,clearBtn:ey,todayBtn:ty},ny=["Su","Mo","Tu","We","Th","Fr","Sa"],Sa=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ss(t){const e=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0");return`${e}/${n}/${t.getFullYear()}`}function Na(t){const e=t.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/);if(!e)return null;const n=parseInt(e[1],10)-1,r=parseInt(e[2],10),s=parseInt(e[3],10);if(n<0||n>11||r<1||r>31||s<1e3)return null;const i=new Date(s,n,r);return i.getFullYear()!==s||i.getMonth()!==n||i.getDate()!==r?null:i}function Tr(t,e){return t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate()}function Ns(t,e,n){if(e){const r=new Date(e.getFullYear(),e.getMonth(),e.getDate());if(t<r)return!0}if(n){const r=new Date(n.getFullYear(),n.getMonth(),n.getDate());if(t>r)return!0}return!1}function ry(t,e){const n=new Date(t,e,1),r=new Date(t,e+1,0),s=new Date(n);s.setDate(s.getDate()-s.getDay());const i=new Date(r);i.setDate(i.getDate()+(6-i.getDay()));const o=[],l=new Date(s);for(;l<=i;){const a=[];for(let c=0;c<7;c++)a.push(new Date(l)),l.setDate(l.getDate()+1);o.push(a)}return o}function sy(t){const e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()));e.setUTCDate(e.getUTCDate()+4-(e.getUTCDay()||7));const n=new Date(Date.UTC(e.getUTCFullYear(),0,1));return Math.ceil(((e.getTime()-n.getTime())/864e5+1)/7)}function io(t){return Math.floor(t/8)*8}const iy=()=>d.jsxs("svg",{viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("rect",{x:"1",y:"2.5",width:"12",height:"10",rx:"1.5",stroke:"currentColor",strokeWidth:"1.5"}),d.jsx("path",{d:"M1 6h12",stroke:"currentColor",strokeWidth:"1.5"}),d.jsx("path",{d:"M4.5 1v3M9.5 1v3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),oy=()=>d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M9 11L5 7l4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),ly=()=>d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M5 3l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Nl=x.forwardRef(({value:t,onChange:e,label:n,required:r=!1,helperText:s,invalid:i=!1,disabled:o=!1,placeholder:l="MM/DD/YYYY",minDate:a,maxDate:c,showWeekNumbers:u=!0,id:h,className:p,style:f},m)=>{const g=x.useId(),b=h??`${g}-input`,y=`${g}-helper`,[v,_]=x.useState(!1),[w,k]=x.useState("day"),[C,S]=x.useState(()=>(t==null?void 0:t.getFullYear())??new Date().getFullYear()),[O,B]=x.useState(()=>(t==null?void 0:t.getMonth())??new Date().getMonth()),[N,T]=x.useState(()=>t?Ss(t):""),P=x.useRef(null),L=x.useRef(null),R=x.useRef(null),H=x.useRef(null),[q,j]=x.useState(null),$=D=>{P.current=D,typeof m=="function"?m(D):m&&(m.current=D)},W=new Date;W.setHours(0,0,0,0),x.useEffect(()=>{const D=t?Ss(t):"";L.current!==document.activeElement&&T(D),t&&(S(t.getFullYear()),B(t.getMonth()))},[t]),x.useEffect(()=>{if(!v)return;function D(ee){var ve,vt;const pe=ee.target;!((ve=P.current)!=null&&ve.contains(pe))&&!((vt=H.current)!=null&&vt.contains(pe))&&ae()}return document.addEventListener("mousedown",D),()=>document.removeEventListener("mousedown",D)},[v]),x.useEffect(()=>{if(!v)return;function D(){var pe;const ee=(pe=R.current)==null?void 0:pe.getBoundingClientRect();ee&&j({top:ee.bottom+4,left:ee.left})}return D(),window.addEventListener("scroll",D,!0),window.addEventListener("resize",D),()=>{window.removeEventListener("scroll",D,!0),window.removeEventListener("resize",D)}},[v]),x.useEffect(()=>{if(!v)return;function D(ee){ee.key==="Escape"&&ae()}return document.addEventListener("keydown",D),()=>document.removeEventListener("keydown",D)},[v]);function se(){o||_(D=>(D||k("day"),!0))}function ae(){_(!1),k("day")}function Ne(){w==="day"?O===0?(B(11),S(D=>D-1)):B(D=>D-1):S(w==="month"?D=>D-1:D=>io(D)-8)}function je(){w==="day"?O===11?(B(0),S(D=>D+1)):B(D=>D+1):S(w==="month"?D=>D+1:D=>io(D)+8)}function Be(D){Ns(D,a,c)||((D.getMonth()!==O||D.getFullYear()!==C)&&(B(D.getMonth()),S(D.getFullYear())),e==null||e(D),T(Ss(D)),ae())}function A(D){B(D),k("day")}function U(D){S(D),k("month")}function Y(){const D=new Date;D.setHours(0,0,0,0),!Ns(D,a,c)&&(e==null||e(D),T(Ss(D)),S(D.getFullYear()),B(D.getMonth()),ae())}function Ie(){e==null||e(null),T("")}function $e(D){const ee=D.target.value;if(T(ee),ee===""){e==null||e(null);return}const pe=Na(ee);pe&&(S(pe.getFullYear()),B(pe.getMonth()),e==null||e(pe))}function Bt(D){if(D.key==="Enter"){const ee=Na(N);ee&&(e==null||e(ee),ae())}}function Dt(D,ee){const pe=[Q.cell],ve=Tr(D,W),vt=t?Tr(D,t):!1,ft=Ns(D,a,c);return ee||pe.push(Q.cellOutside),ft&&pe.push(Q.cellDisabled),vt?pe.push(Q.cellSelected):ve&&pe.push(Q.cellToday),pe.filter(Boolean).join(" ")}function rr(D){const ee=[Q.dayCircle],pe=t?Tr(D,t):!1,ve=Tr(D,W);return pe?ee.push(Q.dayCircleSelected):ve&&ee.push(Q.dayCircleToday),ee.join(" ")}function an(D){const ee=[Q.monthCell];return t&&t.getMonth()===D&&t.getFullYear()===C&&ee.push(Q.monthCellSelected),ee.join(" ")}function $t(D){const ee=[Q.yearCell];return t&&t.getFullYear()===D&&ee.push(Q.yearCellSelected),ee.join(" ")}const Pt=ry(C,O),Gt=io(C),wr=Array.from({length:8},(D,ee)=>Gt+ee),sr=()=>w==="day"?d.jsxs("div",{className:Q.titleGroup,children:[d.jsx("button",{type:"button",className:Q.titleBtn,onClick:()=>k("month"),children:Sa[O]}),d.jsx("button",{type:"button",className:Q.titleBtn,onClick:()=>k("year"),children:C})]}):w==="month"?d.jsx("span",{className:Q.titleText,children:C}):d.jsxs("span",{className:Q.titleText,children:[Gt," – ",Gt+7]}),Cr=[Q.inputWrap,v?Q.inputWrapOpen:"",i?Q.inputWrapInvalid:"",o?Q.inputWrapDisabled:""].filter(Boolean).join(" "),G=[Q.root,p??""].filter(Boolean).join(" ");return d.jsxs("div",{ref:$,className:G,style:f,children:[d.jsxs("div",{className:Q.field,children:[n&&d.jsxs("div",{className:Q.labelRow,children:[d.jsx("label",{className:Q.label,htmlFor:b,children:n}),r&&d.jsx("span",{className:Q.required,"aria-hidden":"true",children:"*"})]}),d.jsxs("div",{ref:R,className:Cr,children:[d.jsx("input",{ref:L,id:b,type:"text",className:Q.input,value:N,placeholder:l,disabled:o,required:r,"aria-invalid":i||void 0,"aria-describedby":s?y:void 0,onChange:$e,onFocus:se,onKeyDown:Bt,autoComplete:"off"}),d.jsx("button",{type:"button",className:Q.calIconBtn,onClick:()=>v?ae():se(),tabIndex:-1,"aria-label":v?"Close calendar":"Open calendar",disabled:o,children:d.jsx(iy,{})})]}),s&&d.jsx("span",{id:y,className:i?Q.errorText:Q.helperText,children:s})]}),v&&q&&Ut.createPortal(d.jsxs("div",{ref:H,"data-popover-root":"",className:Q.calendar,style:{top:q.top,left:q.left},role:"dialog","aria-label":"Date picker",children:[d.jsxs("div",{className:Q.calHeader,children:[d.jsx(ut,{icon:d.jsx(oy,{}),variant:"ghost",size:"sm",onClick:Ne,"aria-label":"Previous"}),sr(),d.jsx(ut,{icon:d.jsx(ly,{}),variant:"ghost",size:"sm",onClick:je,"aria-label":"Next"})]}),w==="day"&&d.jsxs("div",{className:Q.dayView,children:[d.jsxs("div",{className:u?Q.weekRowWithWk:Q.weekRow,children:[u&&d.jsx("div",{className:`${Q.weekdayCell} ${Q.wkLabel}`,children:"Wk"}),ny.map(D=>d.jsx("div",{className:Q.weekdayCell,children:D},D))]}),Pt.map((D,ee)=>{const pe=ve=>ve.getMonth()===O&&ve.getFullYear()===C;return d.jsxs("div",{className:u?Q.weekRowWithWk:Q.weekRow,children:[u&&d.jsx("div",{className:`${Q.cell} ${Q.wkCell}`,children:sy(D[0])}),D.map((ve,vt)=>{const ft=Ns(ve,a,c);return d.jsx("div",{className:Dt(ve,pe(ve)),onClick:()=>!ft&&Be(ve),role:"button",tabIndex:ft?-1:0,"aria-label":ve.toDateString(),"aria-pressed":t?Tr(ve,t):!1,"aria-disabled":ft||void 0,onKeyDown:Jt=>{(Jt.key==="Enter"||Jt.key===" ")&&!ft&&(Jt.preventDefault(),Be(ve))},children:d.jsx("div",{className:rr(ve),children:ve.getDate()})},vt)})]},ee)})]}),w==="month"&&d.jsx("div",{className:Q.monthGrid,children:Sa.map((D,ee)=>d.jsx("div",{className:an(ee),onClick:()=>A(ee),role:"button",tabIndex:0,onKeyDown:pe=>{(pe.key==="Enter"||pe.key===" ")&&(pe.preventDefault(),A(ee))},children:D},D))}),w==="year"&&d.jsx("div",{className:Q.yearGrid,children:wr.map(D=>d.jsx("div",{className:$t(D),onClick:()=>U(D),role:"button",tabIndex:0,onKeyDown:ee=>{(ee.key==="Enter"||ee.key===" ")&&(ee.preventDefault(),U(D))},children:D},D))}),w==="day"&&d.jsxs("div",{className:Q.footer,children:[d.jsx("button",{type:"button",className:Q.clearBtn,onClick:Ie,children:"Clear"}),d.jsx("button",{type:"button",className:Q.todayBtn,onClick:Y,children:"Today"})]})]}),document.body)]})});Nl.displayName="DatePicker";const ay="_calendar_1smvj_7",cy="_plain_1smvj_20",dy="_calHeader_1smvj_29",uy="_titleGroup_1smvj_38",hy="_titleBtn_1smvj_45",fy="_titleText_1smvj_63",py="_dayView_1smvj_74",my="_weekRow_1smvj_79",gy="_weekRowWithWk_1smvj_84",by="_weekdayCell_1smvj_90",yy="_wkLabel_1smvj_100",xy="_cell_1smvj_106",vy="_wkCell_1smvj_119",_y="_cellDisabled_1smvj_129",ky="_dayCircle_1smvj_129",wy="_cellOutside_1smvj_144",Cy="_cellSelected_1smvj_159",Sy="_cellToday_1smvj_163",Ny="_dayCircleSelected_1smvj_185",Ay="_dayCircleToday_1smvj_191",Ty="_monthGrid_1smvj_200",Ey="_monthCell_1smvj_207",My="_monthCellSelected_1smvj_221",jy="_yearGrid_1smvj_238",Iy="_yearCell_1smvj_245",Dy="_yearCellSelected_1smvj_259",he={calendar:ay,plain:cy,calHeader:dy,titleGroup:uy,titleBtn:hy,titleText:fy,dayView:py,weekRow:my,weekRowWithWk:gy,weekdayCell:by,wkLabel:yy,cell:xy,wkCell:vy,cellDisabled:_y,dayCircle:ky,cellOutside:wy,cellSelected:Cy,cellToday:Sy,dayCircleSelected:Ny,dayCircleToday:Ay,monthGrid:Ty,monthCell:Ey,monthCellSelected:My,yearGrid:jy,yearCell:Iy,yearCellSelected:Dy},Oy=["Su","Mo","Tu","We","Th","Fr","Sa"],Aa=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Er(t,e){return t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate()}function oo(t,e,n){if(e){const r=new Date(e.getFullYear(),e.getMonth(),e.getDate());if(t<r)return!0}if(n){const r=new Date(n.getFullYear(),n.getMonth(),n.getDate());if(t>r)return!0}return!1}function Ry(t,e){const n=new Date(t,e,1),r=new Date(t,e+1,0),s=new Date(n);s.setDate(s.getDate()-s.getDay());const i=new Date(r);i.setDate(i.getDate()+(6-i.getDay()));const o=[],l=new Date(s);for(;l<=i;){const a=[];for(let c=0;c<7;c++)a.push(new Date(l)),l.setDate(l.getDate()+1);o.push(a)}return o}function Ly(t){const e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()));e.setUTCDate(e.getUTCDate()+4-(e.getUTCDay()||7));const n=new Date(Date.UTC(e.getUTCFullYear(),0,1));return Math.ceil(((e.getTime()-n.getTime())/864e5+1)/7)}function lo(t){return Math.floor(t/8)*8}const By=()=>d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M9 11L5 7l4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),$y=()=>d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M5 3l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Nd=x.forwardRef(({value:t,onChange:e,minDate:n,maxDate:r,showWeekNumbers:s=!1,variant:i="card",defaultMonth:o,id:l,className:a,style:c},u)=>{const h=t??o??new Date,[p,f]=x.useState("day"),[m,g]=x.useState(h.getFullYear()),[b,y]=x.useState(h.getMonth()),v=new Date;v.setHours(0,0,0,0),x.useEffect(()=>{t&&(g(t.getFullYear()),y(t.getMonth()))},[t]);function _(){p==="day"?b===0?(y(11),g(j=>j-1)):y(j=>j-1):g(p==="month"?j=>j-1:j=>lo(j)-8)}function w(){p==="day"?b===11?(y(0),g(j=>j+1)):y(j=>j+1):g(p==="month"?j=>j+1:j=>lo(j)+8)}function k(j){oo(j,n,r)||((j.getMonth()!==b||j.getFullYear()!==m)&&(y(j.getMonth()),g(j.getFullYear())),e==null||e(j))}function C(j){y(j),f("day")}function S(j){g(j),f("month")}function O(j,$){const W=[he.cell],se=Er(j,v),ae=t?Er(j,t):!1,Ne=oo(j,n,r);return $||W.push(he.cellOutside),Ne&&W.push(he.cellDisabled),ae?W.push(he.cellSelected):se&&W.push(he.cellToday),W.filter(Boolean).join(" ")}function B(j){const $=[he.dayCircle],W=t?Er(j,t):!1,se=Er(j,v);return W?$.push(he.dayCircleSelected):se&&$.push(he.dayCircleToday),$.join(" ")}function N(j){const $=[he.monthCell];return t&&t.getMonth()===j&&t.getFullYear()===m&&$.push(he.monthCellSelected),$.join(" ")}function T(j){const $=[he.yearCell];return t&&t.getFullYear()===j&&$.push(he.yearCellSelected),$.join(" ")}const P=Ry(m,b),L=lo(m),R=Array.from({length:8},(j,$)=>L+$),H=()=>p==="day"?d.jsxs("div",{className:he.titleGroup,children:[d.jsx("button",{type:"button",className:he.titleBtn,onClick:()=>f("month"),children:Aa[b]}),d.jsx("button",{type:"button",className:he.titleBtn,onClick:()=>f("year"),children:m})]}):p==="month"?d.jsx("span",{className:he.titleText,children:m}):d.jsxs("span",{className:he.titleText,children:[L," – ",L+7]}),q=[he.calendar,i==="plain"?he.plain:"",a].filter(Boolean).join(" ");return d.jsxs("div",{ref:u,id:l,className:q,style:c,role:"group","aria-label":"Calendar",children:[d.jsxs("div",{className:he.calHeader,children:[d.jsx(ut,{icon:d.jsx(By,{}),variant:"ghost",size:"sm",onClick:_,"aria-label":"Previous"}),H(),d.jsx(ut,{icon:d.jsx($y,{}),variant:"ghost",size:"sm",onClick:w,"aria-label":"Next"})]}),p==="day"&&d.jsxs("div",{className:he.dayView,children:[d.jsxs("div",{className:s?he.weekRowWithWk:he.weekRow,children:[s&&d.jsx("div",{className:`${he.weekdayCell} ${he.wkLabel}`,children:"Wk"}),Oy.map(j=>d.jsx("div",{className:he.weekdayCell,children:j},j))]}),P.map((j,$)=>{const W=se=>se.getMonth()===b&&se.getFullYear()===m;return d.jsxs("div",{className:s?he.weekRowWithWk:he.weekRow,children:[s&&d.jsx("div",{className:`${he.cell} ${he.wkCell}`,children:Ly(j[0])}),j.map((se,ae)=>{const Ne=oo(se,n,r);return d.jsx("div",{className:O(se,W(se)),onClick:()=>!Ne&&k(se),role:"button",tabIndex:Ne?-1:0,"aria-label":se.toDateString(),"aria-pressed":t?Er(se,t):!1,"aria-disabled":Ne||void 0,onKeyDown:je=>{(je.key==="Enter"||je.key===" ")&&!Ne&&(je.preventDefault(),k(se))},children:d.jsx("div",{className:B(se),children:se.getDate()})},ae)})]},$)})]}),p==="month"&&d.jsx("div",{className:he.monthGrid,children:Aa.map((j,$)=>d.jsx("div",{className:N($),onClick:()=>C($),role:"button",tabIndex:0,onKeyDown:W=>{(W.key==="Enter"||W.key===" ")&&(W.preventDefault(),C($))},children:j},j))}),p==="year"&&d.jsx("div",{className:he.yearGrid,children:R.map(j=>d.jsx("div",{className:T(j),onClick:()=>S(j),role:"button",tabIndex:0,onKeyDown:$=>{($.key==="Enter"||$.key===" ")&&($.preventDefault(),S(j))},children:j},j))})]})});Nd.displayName="Calendar";const Py="_root_2twxf_9",zy="_labelRow_2twxf_18",Fy="_label_2twxf_18",Hy="_required_2twxf_30",Wy="_group_2twxf_41",Vy="_btn_2twxf_50",qy="_btnSelected_2twxf_76",Uy="_btnDisabled_2twxf_76",Ky="_count_2twxf_109",Gy="_badge_2twxf_117",Jy="_btnLabel_2twxf_132",Yy="_optionIcon_2twxf_136",Qy="_splitButton_2twxf_148",Xy="_splitButtonDisabled_2twxf_157",Zy="_splitMain_2twxf_163",e1="_placeholder_2twxf_193",t1="_splitChevron_2twxf_199",n1="_chevronIcon_2twxf_219",r1="_dropdown_2twxf_228",s1="_dropdownRow_2twxf_244",i1="_dropdownRowSelected_2twxf_259",o1="_dropdownLabelSelected_2twxf_273",l1="_sizeSm_2twxf_282",a1="_sizeMd_2twxf_289",c1="_sizeLg_2twxf_296",re={root:Py,labelRow:zy,label:Fy,required:Hy,group:Wy,btn:Vy,btnSelected:qy,btnDisabled:Uy,count:Ky,badge:Gy,btnLabel:Jy,optionIcon:Yy,splitButton:Qy,splitButtonDisabled:Xy,splitMain:Zy,placeholder:e1,splitChevron:t1,chevronIcon:n1,dropdown:r1,dropdownRow:s1,dropdownRowSelected:i1,dropdownLabelSelected:o1,sizeSm:l1,sizeMd:a1,sizeLg:c1};function ao({opt:t,labelClassName:e,countClassName:n,badgeClassName:r,iconClassName:s}){return d.jsxs(d.Fragment,{children:[t.icon&&d.jsx("span",{className:s,"aria-hidden":"true",children:t.icon}),d.jsx("span",{className:e,children:t.label}),t.count!==void 0&&d.jsx("span",{className:n,children:t.count}),t.badge&&d.jsx("span",{className:r,style:{backgroundColor:t.badge.color},"aria-label":`${t.badge.value}`,children:t.badge.value})]})}const Al=x.forwardRef(({options:t,value:e,onChange:n,variant:r="group",size:s="md",label:i,required:o=!1,disabled:l=!1,placeholder:a="Select…",className:c,style:u},h)=>{const p=x.useId(),[f,m]=x.useState(!1),g=x.useRef(null),b=k=>{g.current=k,typeof h=="function"?h(k):h&&(h.current=k)};x.useEffect(()=>{if(!f)return;function k(C){var S;(S=g.current)!=null&&S.contains(C.target)||m(!1)}return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[f]),x.useEffect(()=>{if(!f)return;function k(C){C.key==="Escape"&&m(!1)}return document.addEventListener("keydown",k),()=>document.removeEventListener("keydown",k)},[f]);const y=t.find(k=>k.value===e)??null;function v(k){l||(n==null||n(k),m(!1))}const _=s==="sm"?re.sizeSm:s==="lg"?re.sizeLg:re.sizeMd,w=[re.root,_,c??""].filter(Boolean).join(" ");return r==="group"?d.jsxs("div",{ref:b,className:w,style:u,children:[i&&d.jsxs("div",{className:re.labelRow,children:[d.jsx("span",{className:re.label,children:i}),o&&d.jsx("span",{className:re.required,"aria-hidden":"true",children:"*"})]}),d.jsx("div",{className:re.group,role:"group","aria-label":i??"Select button group","aria-disabled":l||void 0,children:t.map((k,C)=>{const S=C===0,O=C===t.length-1,B=k.value===e,N=t.length===1?re.btnSingle:S?re.btnLeft:O?re.btnRight:re.btnMiddle,T=[re.btn,N,B?re.btnSelected:"",l?re.btnDisabled:""].filter(Boolean).join(" ");return d.jsx("button",{id:`${p}-${k.value}`,type:"button",className:T,onClick:()=>v(k.value),"aria-pressed":B,disabled:l,children:d.jsx(ao,{opt:k,labelClassName:re.btnLabel,countClassName:re.count,badgeClassName:re.badge,iconClassName:re.optionIcon})},k.value)})})]}):d.jsxs("div",{ref:b,className:w,style:u,children:[i&&d.jsxs("div",{className:re.labelRow,children:[d.jsx("span",{className:re.label,children:i}),o&&d.jsx("span",{className:re.required,"aria-hidden":"true",children:"*"})]}),d.jsxs("div",{className:[re.splitButton,l?re.splitButtonDisabled:""].filter(Boolean).join(" "),"aria-disabled":l||void 0,children:[d.jsx("button",{type:"button",className:re.splitMain,onClick:()=>!l&&m(k=>!k),"aria-haspopup":"listbox","aria-expanded":f,disabled:l,children:y?d.jsx(ao,{opt:y,labelClassName:re.btnLabel,countClassName:re.count,badgeClassName:re.badge,iconClassName:re.optionIcon}):d.jsx("span",{className:re.placeholder,children:a})}),d.jsx("button",{type:"button",className:re.splitChevron,onClick:()=>!l&&m(k=>!k),"aria-label":f?"Close options":"Open options",tabIndex:-1,disabled:l,children:d.jsx("span",{className:re.chevronIcon,"aria-hidden":"true",children:d.jsx("i",{className:"pi pi-chevron-down"})})}),f&&d.jsx("div",{role:"listbox","aria-label":i??"Options",className:re.dropdown,children:t.map(k=>{const C=k.value===e,S=[re.dropdownRow,C?re.dropdownRowSelected:""].filter(Boolean).join(" ");return d.jsx("div",{role:"option","aria-selected":C,className:S,onClick:()=>v(k.value),tabIndex:0,onKeyDown:O=>{(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),v(k.value))},children:d.jsx(ao,{opt:k,labelClassName:C?`${re.btnLabel} ${re.dropdownLabelSelected}`:re.btnLabel,countClassName:re.count,badgeClassName:re.badge,iconClassName:re.optionIcon})},k.value)})})]})]})});Al.displayName="SelectButton";const d1="_root_12r37_8",u1="_labelRow_12r37_17",h1="_label_12r37_17",f1="_required_12r37_29",p1="_outer_12r37_37",m1="_inner_12r37_46",g1="_innerDisabled_12r37_57",b1="_innerInvalid_12r37_57",y1="_textarea_12r37_95",x1="_textareaAutoGrow_12r37_122",v1="_bottomRow_12r37_130",_1="_helperText_12r37_139",k1="_errorText_12r37_146 _helperText_12r37_139",w1="_counter_12r37_153",C1="_innerWithCounter_12r37_164",S1="_textareaWithInnerCounter_12r37_169",N1="_counterInside_12r37_174 _counter_12r37_153",Ue={root:d1,labelRow:u1,label:h1,required:f1,outer:p1,inner:m1,innerDisabled:g1,innerInvalid:b1,textarea:y1,textareaAutoGrow:x1,bottomRow:v1,helperText:_1,errorText:k1,counter:w1,innerWithCounter:C1,textareaWithInnerCounter:S1,counterInside:N1},Ad=x.forwardRef(({label:t,showLabel:e=!0,required:n=!1,helperText:r,invalid:s=!1,rows:i=3,autoGrow:o=!1,disabled:l=!1,maxLength:a,counterPlacement:c="outside",id:u,className:h,style:p,value:f,defaultValue:m,onChange:g,...b},y)=>{const v=x.useId(),_=u??`${v}-textarea`,w=`${v}-helper`,k=x.useRef(null),C=y??k,[S,O]=x.useState(()=>f!==void 0?String(f??"").length:m!==void 0?String(m??"").length:0);x.useEffect(()=>{f!==void 0&&O(String(f??"").length)},[f]),x.useEffect(()=>{if(!o||!C.current)return;const H=C.current;H.style.height="auto",H.style.height=`${H.scrollHeight}px`},[o,f,S,C]);function B(H){O(H.target.value.length),g==null||g(H)}const N=a!==void 0,T=c==="inside",P=Ue.outer,L=[Ue.inner,s?Ue.innerInvalid:"",l?Ue.innerDisabled:"",T&&N?Ue.innerWithCounter:""].filter(Boolean).join(" "),R=[Ue.textarea,o?Ue.textareaAutoGrow:"",T&&N?Ue.textareaWithInnerCounter:""].filter(Boolean).join(" ");return d.jsxs("div",{className:[Ue.root,h??""].filter(Boolean).join(" "),style:p,children:[t&&e&&d.jsxs("div",{className:Ue.labelRow,children:[d.jsx("label",{className:Ue.label,htmlFor:_,children:t}),n&&d.jsx("span",{className:Ue.required,"aria-hidden":"true",children:"*"})]}),d.jsxs("div",{className:P,children:[d.jsxs("div",{className:L,children:[d.jsx("textarea",{ref:C,id:_,rows:o?void 0:i,maxLength:a,disabled:l,required:n,"aria-invalid":s||void 0,"aria-label":!e&&t?t:void 0,"aria-describedby":[r?w:"",N?`${v}-counter`:""].filter(Boolean).join(" ")||void 0,className:R,value:f,defaultValue:m,onChange:B,...b}),T&&N&&d.jsxs("span",{id:`${v}-counter`,className:Ue.counterInside,"aria-live":"polite",children:[S,"/",a]})]}),(r||!T&&N)&&d.jsxs("div",{className:Ue.bottomRow,children:[r?d.jsx("span",{id:w,className:s?Ue.errorText:Ue.helperText,children:r}):d.jsx("span",{}),!T&&N&&d.jsxs("span",{id:`${v}-counter`,className:Ue.counter,"aria-live":"polite",children:[S,"/",a]})]})]})]})});Ad.displayName="TextArea";var Ko={exports:{}},co={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* use-sync-external-store-shim.production.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Ta;function
|
|
9
|
+
*/var Ta;function A1(){if(Ta)return co;Ta=1;var t=x;function e(h,p){return h===p&&(h!==0||1/h===1/p)||h!==h&&p!==p}var n=typeof Object.is=="function"?Object.is:e,r=t.useState,s=t.useEffect,i=t.useLayoutEffect,o=t.useDebugValue;function l(h,p){var f=p(),m=r({inst:{value:f,getSnapshot:p}}),g=m[0].inst,b=m[1];return i(function(){g.value=f,g.getSnapshot=p,a(g)&&b({inst:g})},[h,f,p]),s(function(){return a(g)&&b({inst:g}),h(function(){a(g)&&b({inst:g})})},[h]),o(f),f}function a(h){var p=h.getSnapshot;h=h.value;try{var f=p();return!n(h,f)}catch{return!0}}function c(h,p){return p()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:l;return co.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:u,co}var uo={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* use-sync-external-store-shim.development.js
|
|
12
12
|
*
|
|
@@ -14,19 +14,19 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var Ea;function Nx(){return Ea||(Ea=1,process.env.NODE_ENV!=="production"&&function(){function t(f,m){return f===m&&(f!==0||1/f===1/m)||f!==f&&m!==m}function e(f,m){u||s.startTransition===void 0||(u=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var g=m();if(!h){var b=m();i(g,b)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),h=!0)}b=o({inst:{value:g,getSnapshot:m}});var y=b[0].inst,v=b[1];return a(function(){y.value=g,y.getSnapshot=m,n(y)&&v({inst:y})},[f,g,m]),l(function(){return n(y)&&v({inst:y}),f(function(){n(y)&&v({inst:y})})},[f]),c(g),g}function n(f){var m=f.getSnapshot;f=f.value;try{var g=m();return!i(f,g)}catch{return!0}}function r(f,m){return m()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var s=x,i=typeof Object.is=="function"?Object.is:t,o=s.useState,l=s.useEffect,a=s.useLayoutEffect,c=s.useDebugValue,u=!1,h=!1,p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:e;uo.useSyncExternalStore=s.useSyncExternalStore!==void 0?s.useSyncExternalStore:p,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),uo}process.env.NODE_ENV==="production"?Ko.exports=Sx():Ko.exports=Nx();var Pi=Ko.exports;function Ue(t){this.content=t}Ue.prototype={constructor:Ue,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,s=r.find(t),i=r.content.slice();return s==-1?i.push(n||t,e):(i[s+1]=e,n&&(i[s]=n)),new Ue(i)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new Ue(n)},addToStart:function(t,e){return new Ue([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Ue(n)},addBefore:function(t,e,n){var r=this.remove(e),s=r.content.slice(),i=r.find(t);return s.splice(i==-1?s.length:i,0,e,n),new Ue(s)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=Ue.from(t),t.size?new Ue(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Ue.from(t),t.size?new Ue(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Ue.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};Ue.from=function(t){if(t instanceof Ue)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Ue(e)};function Td(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let s=t.child(r),i=e.child(r);if(s==i){n+=s.nodeSize;continue}if(!s.sameMarkup(i))return n;if(s.isText&&s.text!=i.text){for(let o=0;s.text[o]==i.text[o];o++)n++;return n}if(s.content.size||i.content.size){let o=Td(s.content,i.content,n+1);if(o!=null)return o}n+=s.nodeSize}}function Ed(t,e,n,r){for(let s=t.childCount,i=e.childCount;;){if(s==0||i==0)return s==i?null:{a:n,b:r};let o=t.child(--s),l=e.child(--i),a=o.nodeSize;if(o==l){n-=a,r-=a;continue}if(!o.sameMarkup(l))return{a:n,b:r};if(o.isText&&o.text!=l.text){let c=0,u=Math.min(o.text.length,l.text.length);for(;c<u&&o.text[o.text.length-c-1]==l.text[l.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(o.content.size||l.content.size){let c=Ed(o.content,l.content,n-1,r-1);if(c)return c}n-=a,r-=a}}class E{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,s=0,i){for(let o=0,l=0;l<n;o++){let a=this.content[o],c=l+a.nodeSize;if(c>e&&r(a,s+l,i||null,o)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,n-u),r,s+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,s){let i="",o=!0;return this.nodesBetween(e,n,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,n-a):l.isLeaf?s?typeof s=="function"?s(l):s:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(o?o=!1:i+=r),i+=c},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,s=this.content.slice(),i=0;for(n.isText&&n.sameMarkup(r)&&(s[s.length-1]=n.withText(n.text+r.text),i=1);i<e.content.length;i++)s.push(e.content[i]);return new E(s,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],s=0;if(n>e)for(let i=0,o=0;o<n;i++){let l=this.content[i],a=o+l.nodeSize;a>e&&((o<e||a>n)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,n-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,n-o-1))),r.push(l),s+=l.nodeSize),o=a}return new E(r,s)}cutByIndex(e,n){return e==n?E.empty:e==0&&n==this.content.length?this:new E(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let s=this.content.slice(),i=this.size+n.nodeSize-r.nodeSize;return s[e]=n,new E(s,i)}addToStart(e){return new E([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new E(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let s=this.content[n];e(s,r,n),r+=s.nodeSize}}findDiffStart(e,n=0){return Td(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return Ed(this,e,n,r)}findIndex(e){if(e==0)return As(0,e);if(e==this.size)return As(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let s=this.child(n),i=r+s.nodeSize;if(i>=e)return i==e?As(n+1,i):As(n,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return E.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return E.fromArray(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return E.empty;let n,r=0;for(let s=0;s<e.length;s++){let i=e[s];r+=i.nodeSize,s&&i.isText&&e[s-1].sameMarkup(i)?(n||(n=e.slice(0,s)),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new E(n||e,r)}static from(e){if(!e)return E.empty;if(e instanceof E)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new E([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}E.empty=new E([],0);const ho={index:0,offset:0};function As(t,e){return ho.index=t,ho.offset=e,ho}function Js(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!Js(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Js(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let _e=class Go{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let s=0;s<e.length;s++){let i=e[s];if(this.eq(i))return e;if(this.type.excludes(i.type))n||(n=e.slice(0,s));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(n||(n=e.slice(0,s)),n.push(this),r=!0),n&&n.push(i)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Js(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let s=r.create(n.attrs);return r.checkAttrs(s.attrs),s}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Go.none;if(e instanceof Go)return[e];let n=e.slice();return n.sort((r,s)=>r.type.rank-s.type.rank),n}};_e.none=[];class Ys extends Error{}class F{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=jd(this.content,e+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new F(r,this.openStart,this.openEnd)}removeBetween(e,n){return new F(Md(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return F.empty;let r=n.openStart||0,s=n.openEnd||0;if(typeof r!="number"||typeof s!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new F(E.fromJSON(e,n.content),r,s)}static maxOpen(e,n=!0){let r=0,s=0;for(let i=e.firstChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.lastChild)s++;return new F(e,r,s)}}F.empty=new F(E.empty,0,0);function Md(t,e,n){let{index:r,offset:s}=t.findIndex(e),i=t.maybeChild(r),{index:o,offset:l}=t.findIndex(n);if(s==e||i.isText){if(l!=n&&!t.child(o).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=o)throw new RangeError("Removing non-flat range");return t.replaceChild(r,i.copy(Md(i.content,e-s-1,n-s-1)))}function jd(t,e,n,r,s,i){let{index:o,offset:l}=t.findIndex(e),a=t.maybeChild(o);if(l==e||a.isText)return i&&r<=0&&s<=0&&!i.canReplace(o,o,n)?null:t.cut(0,e).append(n).append(t.cut(e));let c=jd(a.content,e-l-1,n,o==0?r-1:0,o==t.childCount-1?s-1:0,a);return c&&t.replaceChild(o,a.copy(c))}function Ax(t,e,n){if(n.openStart>t.depth)throw new Ys("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Ys("Inconsistent open depths");return Id(t,e,n,0)}function Id(t,e,n,r){let s=t.index(r),i=t.node(r);if(s==e.index(r)&&r<t.depth-n.openStart){let o=Id(t,e,n,r+1);return i.copy(i.content.replaceChild(s,o))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let o=t.parent,l=o.content;return Vn(o,l.cut(0,t.parentOffset).append(n.content).append(l.cut(e.parentOffset)))}else{let{start:o,end:l}=Tx(n,t);return Vn(i,Od(t,o,l,e,r))}else return Vn(i,Qs(t,e,r))}function Dd(t,e){if(!e.type.compatibleContent(t.type))throw new Ys("Cannot join "+e.type.name+" onto "+t.type.name)}function Jo(t,e,n){let r=t.node(n);return Dd(r,e.node(n)),r}function Wn(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Vr(t,e,n,r){let s=(e||t).node(n),i=0,o=e?e.index(n):s.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(Wn(t.nodeAfter,r),i++));for(let l=i;l<o;l++)Wn(s.child(l),r);e&&e.depth==n&&e.textOffset&&Wn(e.nodeBefore,r)}function Vn(t,e){return t.type.checkContent(e),t.copy(e)}function Od(t,e,n,r,s){let i=t.depth>s&&Jo(t,e,s+1),o=r.depth>s&&Jo(n,r,s+1),l=[];return Vr(null,t,s,l),i&&o&&e.index(s)==n.index(s)?(Dd(i,o),Wn(Vn(i,Od(t,e,n,r,s+1)),l)):(i&&Wn(Vn(i,Qs(t,e,s+1)),l),Vr(e,n,s,l),o&&Wn(Vn(o,Qs(n,r,s+1)),l)),Vr(r,null,s,l),new E(l)}function Qs(t,e,n){let r=[];if(Vr(null,t,n,r),t.depth>n){let s=Jo(t,e,n+1);Wn(Vn(s,Qs(t,e,n+1)),r)}return Vr(e,null,n,r),new E(r)}function Tx(t,e){let n=e.depth-t.openStart,s=e.node(n).copy(t.content);for(let i=n-1;i>=0;i--)s=e.node(i).copy(E.from(s));return{start:s.resolveNoCache(t.openStart+n),end:s.resolveNoCache(s.content.size-t.openEnd-n)}}class ts{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],s=e.child(n);return r?e.child(n).cut(r):s}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],s=n==0?0:this.path[n*3-1]+1;for(let i=0;i<e;i++)s+=r.child(i).nodeSize;return s}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return _e.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),s=e.maybeChild(n);if(!r){let l=r;r=s,s=l}let i=r.marks;for(var o=0;o<i.length;o++)i[o].type.spec.inclusive===!1&&(!s||!i[o].isInSet(s.marks))&&(i=i[o--].removeFromSet(i));return i}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,s=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!s||!r[i].isInSet(s.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new Xs(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],s=0,i=n;for(let o=e;;){let{index:l,offset:a}=o.content.findIndex(i),c=i-a;if(r.push(o,l,s+a),!c||(o=o.child(l),o.isText))break;i=c-1,s+=a+1}return new ts(n,r,i)}static resolveCached(e,n){let r=Ma.get(e);if(r)for(let i=0;i<r.elts.length;i++){let o=r.elts[i];if(o.pos==n)return o}else Ma.set(e,r=new Ex);let s=r.elts[r.i]=ts.resolve(e,n);return r.i=(r.i+1)%Mx,s}}class Ex{constructor(){this.elts=[],this.i=0}}const Mx=12,Ma=new WeakMap;class Xs{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const jx=Object.create(null);class Mt{constructor(e,n,r,s=_e.none){this.type=e,this.attrs=n,this.marks=s,this.content=r||E.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,s=0){this.content.nodesBetween(e,n,r,s,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,s){return this.content.textBetween(e,n,r,s)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&Js(this.attrs,n||e.defaultAttrs||jx)&&_e.sameSet(this.marks,r||_e.none)}copy(e=null){return e==this.content?this:new Mt(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Mt(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return F.empty;let s=this.resolve(e),i=this.resolve(n),o=r?0:s.sharedDepth(n),l=s.start(o),c=s.node(o).content.cut(s.pos-l,i.pos-l);return new F(c,s.depth-o,i.depth-o)}replace(e,n,r){return Ax(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:s}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(s==e||n.isText)return n;e-=s+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let s=this.content.child(n-1);return{node:s,index:n-1,offset:r-s.nodeSize}}resolve(e){return ts.resolveCached(this,e)}resolveNoCache(e){return ts.resolve(this,e)}rangeHasMark(e,n,r){let s=!1;return n>e&&this.nodesBetween(e,n,i=>(r.isInSet(i.marks)&&(s=!0),!s)),s}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Rd(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=E.empty,s=0,i=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,s,i),l=o&&o.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let a=s;a<i;a++)if(!this.type.allowsMarks(r.child(a).marks))return!1;return!0}canReplaceWith(e,n,r,s){if(s&&!this.type.allowsMarks(s))return!1;let i=this.contentMatchAt(e).matchType(r),o=i&&i.matchFragment(this.content,n);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=_e.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!_e.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let s=E.fromJSON(e,n.content),i=e.nodeType(n.type).create(n.attrs,s,r);return i.type.checkAttrs(i.attrs),i}}Mt.prototype.text=void 0;class Zs extends Mt{constructor(e,n,r,s){if(super(e,n,null,s),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Rd(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Zs(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Zs(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Rd(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Jn{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new Ix(e,n);if(r.next==null)return Jn.empty;let s=Ld(r);r.next&&r.err("Unexpected trailing text");let i=Px($x(s));return zx(i,r),i}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let s=this;for(let i=n;s&&i<r;i++)s=s.matchType(e.child(i).type);return s}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let s=[this];function i(o,l){let a=o.matchFragment(e,r);if(a&&(!n||a.validEnd))return E.from(l.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:u,next:h}=o.next[c];if(!(u.isText||u.hasRequiredAttrs())&&s.indexOf(h)==-1){s.push(h);let p=i(h,l.concat(u));if(p)return p}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let s=r.shift(),i=s.match;if(i.matchType(e)){let o=[];for(let l=s;l.type;l=l.via)o.push(l.type);return o.reverse()}for(let o=0;o<i.next.length;o++){let{type:l,next:a}=i.next[o];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in n)&&(!s.type||a.validEnd)&&(r.push({match:l.contentMatch,type:l,via:s}),n[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let s=0;s<r.next.length;s++)e.indexOf(r.next[s].next)==-1&&n(r.next[s].next)}return n(this),e.map((r,s)=>{let i=s+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)i+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return i}).join(`
|
|
18
|
-
`)}}Jn.empty=new Jn(!0);class Ix{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Ld(t){let e=[];do e.push(Dx(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Dx(t){let e=[];do e.push(Ox(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function Ox(t){let e=Bx(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=Rx(t,e);else break;return e}function ja(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function Rx(t,e){let n=ja(t),r=n;return t.eat(",")&&(t.next!="}"?r=ja(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function Lx(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let s=[];for(let i in n){let o=n[i];o.isInGroup(e)&&s.push(o)}return s.length==0&&t.err("No node type or group '"+e+"' found"),s}function Bx(t){if(t.eat("(")){let e=Ld(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=Lx(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function $x(t){let e=[[]];return s(i(t,0),n()),e;function n(){return e.push([])-1}function r(o,l,a){let c={term:a,to:l};return e[o].push(c),c}function s(o,l){o.forEach(a=>a.to=l)}function i(o,l){if(o.type=="choice")return o.exprs.reduce((a,c)=>a.concat(i(c,l)),[]);if(o.type=="seq")for(let a=0;;a++){let c=i(o.exprs[a],l);if(a==o.exprs.length-1)return c;s(c,l=n())}else if(o.type=="star"){let a=n();return r(l,a),s(i(o.expr,a),a),[r(a)]}else if(o.type=="plus"){let a=n();return s(i(o.expr,l),a),s(i(o.expr,a),a),[r(a)]}else{if(o.type=="opt")return[r(l)].concat(i(o.expr,l));if(o.type=="range"){let a=l;for(let c=0;c<o.min;c++){let u=n();s(i(o.expr,a),u),a=u}if(o.max==-1)s(i(o.expr,a),a);else for(let c=o.min;c<o.max;c++){let u=n();r(a,u),s(i(o.expr,a),u),a=u}return[r(a)]}else{if(o.type=="name")return[r(l,void 0,o.value)];throw new Error("Unknown expr type")}}}}function Bd(t,e){return e-t}function Ia(t,e){let n=[];return r(e),n.sort(Bd);function r(s){let i=t[s];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(s);for(let o=0;o<i.length;o++){let{term:l,to:a}=i[o];!l&&n.indexOf(a)==-1&&r(a)}}}function Px(t){let e=Object.create(null);return n(Ia(t,0));function n(r){let s=[];r.forEach(o=>{t[o].forEach(({term:l,to:a})=>{if(!l)return;let c;for(let u=0;u<s.length;u++)s[u][0]==l&&(c=s[u][1]);Ia(t,a).forEach(u=>{c||s.push([l,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let i=e[r.join(",")]=new Jn(r.indexOf(t.length-1)>-1);for(let o=0;o<s.length;o++){let l=s[o][1].sort(Bd);i.next.push({type:s[o][0],next:e[l.join(",")]||n(l)})}return i}}function zx(t,e){for(let n=0,r=[t];n<r.length;n++){let s=r[n],i=!s.validEnd,o=[];for(let l=0;l<s.next.length;l++){let{type:a,next:c}=s.next[l];o.push(a.name),i&&!(a.isText||a.hasRequiredAttrs())&&(i=!1),r.indexOf(c)==-1&&r.push(c)}i&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function $d(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function Pd(t,e){let n=Object.create(null);for(let r in t){let s=e&&e[r];if(s===void 0){let i=t[r];if(i.hasDefault)s=i.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=s}return n}function zd(t,e,n,r){for(let s in e)if(!(s in t))throw new RangeError(`Unsupported attribute ${s} for ${n} of type ${s}`);for(let s in t){let i=t[s];i.validate&&i.validate(e[s])}}function Fd(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new Hx(t,r,e[r]);return n}let Da=class Hd{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=Fd(e,r.attrs),this.defaultAttrs=$d(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Jn.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Pd(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Mt(this,this.computeAttrs(e),E.from(n),_e.setFrom(r))}createChecked(e=null,n,r){return n=E.from(n),this.checkContent(n),new Mt(this,this.computeAttrs(e),n,_e.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=E.from(n),n.size){let o=this.contentMatch.fillBefore(n);if(!o)return null;n=o.append(n)}let s=this.contentMatch.matchFragment(n),i=s&&s.fillBefore(E.empty,!0);return i?new Mt(this,e,n.append(i),_e.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){zd(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:_e.none:e}static compile(e,n){let r=Object.create(null);e.forEach((i,o)=>r[i]=new Hd(i,n,o));let s=n.spec.topNode||"doc";if(!r[s])throw new RangeError("Schema is missing its top node type ('"+s+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function Fx(t,e,n){let r=n.split("|");return s=>{let i=s===null?"null":typeof s;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${i}`)}}class Hx{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?Fx(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class zi{constructor(e,n,r,s){this.name=e,this.rank=n,this.schema=r,this.spec=s,this.attrs=Fd(e,s.attrs),this.excluded=null;let i=$d(this.attrs);this.instance=i?new _e(this,i):null}create(e=null){return!e&&this.instance?this.instance:new _e(this,Pd(this.attrs,e))}static compile(e,n){let r=Object.create(null),s=0;return e.forEach((i,o)=>r[i]=new zi(i,s++,n,o)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){zd(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class Wd{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let s in e)n[s]=e[s];n.nodes=Ue.from(e.nodes),n.marks=Ue.from(e.marks||{}),this.nodes=Da.compile(this.spec.nodes,this),this.marks=zi.compile(this.spec.marks,this);let r=Object.create(null);for(let s in this.nodes){if(s in this.marks)throw new RangeError(s+" can not be both a node and a mark");let i=this.nodes[s],o=i.spec.content||"",l=i.spec.marks;if(i.contentMatch=r[o]||(r[o]=Jn.parse(o,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=l=="_"?null:l?Oa(this,l.split(" ")):l==""||!i.inlineContent?[]:null}for(let s in this.marks){let i=this.marks[s],o=i.spec.excludes;i.excluded=o==null?[i]:o==""?[]:Oa(this,o.split(" "))}this.nodeFromJSON=s=>Mt.fromJSON(this,s),this.markFromJSON=s=>_e.fromJSON(this,s),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,s){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Da){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,s)}text(e,n){let r=this.nodes.text;return new Zs(r,r.defaultAttrs,e,_e.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function Oa(t,e){let n=[];for(let r=0;r<e.length;r++){let s=e[r],i=t.marks[s],o=i;if(i)n.push(i);else for(let l in t.marks){let a=t.marks[l];(s=="_"||a.spec.group&&a.spec.group.split(" ").indexOf(s)>-1)&&n.push(o=a)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function Wx(t){return t.tag!=null}function Vx(t){return t.style!=null}class vn{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(s=>{if(Wx(s))this.tags.push(s);else if(Vx(s)){let i=/[^=]*/.exec(s.style)[0];r.indexOf(i)<0&&r.push(i),this.styles.push(s)}}),this.normalizeLists=!this.tags.some(s=>{if(!/^(ul|ol)\b/.test(s.tag)||!s.node)return!1;let i=e.nodes[s.node];return i.contentMatch.matchType(i)})}parse(e,n={}){let r=new La(this,n,!1);return r.addAll(e,_e.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new La(this,n,!0);return r.addAll(e,_e.none,n.from,n.to),F.maxOpen(r.finish())}matchTag(e,n,r){for(let s=r?this.tags.indexOf(r)+1:0;s<this.tags.length;s++){let i=this.tags[s];if(Kx(e,i.tag)&&(i.namespace===void 0||e.namespaceURI==i.namespace)&&(!i.context||n.matchesContext(i.context))){if(i.getAttrs){let o=i.getAttrs(e);if(o===!1)continue;i.attrs=o||void 0}return i}}}matchStyle(e,n,r,s){for(let i=s?this.styles.indexOf(s)+1:0;i<this.styles.length;i++){let o=this.styles[i],l=o.style;if(!(l.indexOf(e)!=0||o.context&&!r.matchesContext(o.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=n))){if(o.getAttrs){let a=o.getAttrs(n);if(a===!1)continue;o.attrs=a||void 0}return o}}}static schemaRules(e){let n=[];function r(s){let i=s.priority==null?50:s.priority,o=0;for(;o<n.length;o++){let l=n[o];if((l.priority==null?50:l.priority)<i)break}n.splice(o,0,s)}for(let s in e.marks){let i=e.marks[s].spec.parseDOM;i&&i.forEach(o=>{r(o=Ba(o)),o.mark||o.ignore||o.clearMark||(o.mark=s)})}for(let s in e.nodes){let i=e.nodes[s].spec.parseDOM;i&&i.forEach(o=>{r(o=Ba(o)),o.node||o.ignore||o.mark||(o.node=s)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new vn(e,vn.schemaRules(e)))}}const Vd={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},qx={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},qd={ol:!0,ul:!0},ns=1,Yo=2,qr=4;function Ra(t,e,n){return e!=null?(e?ns:0)|(e==="full"?Yo:0):t&&t.whitespace=="pre"?ns|Yo:n&~qr}class Ts{constructor(e,n,r,s,i,o){this.type=e,this.attrs=n,this.marks=r,this.solid=s,this.options=o,this.content=[],this.activeMarks=_e.none,this.match=i||(o&qr?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(E.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,s;return(s=r.findWrapping(e.type))?(this.match=r,s):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&ns)){let r=this.content[this.content.length-1],s;if(r&&r.isText&&(s=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==s[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-s[0].length))}}let n=E.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(E.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Vd.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class La{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let s=n.topNode,i,o=Ra(null,n.preserveWhitespace,0)|(r?qr:0);s?i=new Ts(s.type,s.attrs,_e.none,!0,n.topMatch||s.type.contentMatch,o):r?i=new Ts(null,null,_e.none,!0,null,o):i=new Ts(e.schema.topNodeType,null,_e.none,!0,null,o),this.nodes=[i],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,s=this.top,i=s.options&Yo?"full":this.localPreserveWS||(s.options&ns)>0,{schema:o}=this.parser;if(i==="full"||s.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(i)if(i==="full")r=r.replace(/\r\n?/g,`
|
|
19
|
-
`);else if(o.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(o.linebreakReplacement.create())){let l=r.split(/\r?\n|\r/);for(let a=0;a<l.length;a++)a&&this.insertNode(o.linebreakReplacement.create(),n,!0),l[a]&&this.insertNode(o.text(l[a]),n,!/\S/.test(l[a]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let l=s.content[s.content.length-1],a=e.previousSibling;(!l||a&&a.nodeName=="BR"||l.isText&&/[ \t\r\n\u000c]$/.test(l.text))&&(r=r.slice(1))}r&&this.insertNode(o.text(r),n,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let s=this.localPreserveWS,i=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),l;qd.hasOwnProperty(o)&&this.parser.normalizeLists&&
|
|
20
|
-
`),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let s=0;s<this.parser.matchedStyles.length;s++){let i=this.parser.matchedStyles[s],o=r.getPropertyValue(i);if(o)for(let l=void 0;;){let a=this.parser.matchStyle(i,o,this,l);if(!a)break;if(a.ignore)return null;if(a.clearMark?n=n.filter(c=>!a.clearMark(c)):n=n.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return n}addElementByRule(e,n,r,s){let i,o;if(n.node)if(o=this.parser.schema.nodes[n.node],o.isLeaf)this.insertNode(o.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let a=this.enter(o,n.attrs||null,r,n.preserveWhitespace);a&&(i=!0,r=a)}else{let a=this.parser.schema.marks[n.mark];r=r.concat(a.create(n.attrs))}let l=this.top;if(o&&o.isLeaf)this.findInside(e);else if(s)this.addElement(e,r,s);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a,r,!1));else{let a=e;typeof n.contentElement=="string"?a=e.querySelector(n.contentElement):typeof n.contentElement=="function"?a=n.contentElement(e):n.contentElement&&(a=n.contentElement),this.findAround(e,a,!0),this.addAll(a,r),this.findAround(e,a,!1)}i&&this.sync(l)&&this.open--}addAll(e,n,r,s){let i=r||0;for(let o=r?e.childNodes[r]:e.firstChild,l=s==null?null:e.childNodes[s];o!=l;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o,n);this.findAtPoint(e,i)}findPlace(e,n,r){let s,i;for(let o=this.open,l=0;o>=0;o--){let a=this.nodes[o],c=a.findWrapping(e);if(c&&(!s||s.length>c.length+l)&&(s=c,i=a,!c.length))break;if(a.solid){if(r)break;l+=2}}if(!s)return null;this.sync(i);for(let o=0;o<s.length;o++)n=this.enterInner(s[o],null,n,!1);return n}insertNode(e,n,r){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(n=this.enterInner(i,null,n))}let s=this.findPlace(e,n,r);if(s){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let o=_e.none;for(let l of s.concat(e.marks))(i.type?i.type.allowsMarkType(l.type):$a(l.type,e.type))&&(o=l.addToSet(o));return i.content.push(e.mark(o)),!0}return!1}enter(e,n,r,s){let i=this.findPlace(e.create(n),r,!1);return i&&(i=this.enterInner(e,n,r,!0,s)),i}enterInner(e,n,r,s=!1,i){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let l=Ra(e,i,o.options);o.options&qr&&o.content.length==0&&(l|=qr);let a=_e.none;return r=r.filter(c=>(o.type?o.type.allowsMarkType(c.type):$a(c.type,e))?(a=c.addToSet(a),!1):!0),this.nodes.push(new Ts(e,n,a,s,null,l)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=ns)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let s=r.length-1;s>=0;s--)e+=r[s].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let s=0;s<this.find.length;s++)this.find[s].pos==null&&e.nodeType==1&&e.contains(this.find[s].node)&&n.compareDocumentPosition(this.find[s].node)&(r?2:4)&&(this.find[s].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,s=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(s?0:1),o=(l,a)=>{for(;l>=0;l--){let c=n[l];if(c==""){if(l==n.length-1||l==0)continue;for(;a>=i;a--)if(o(l-1,a))return!0;return!1}else{let u=a>0||a==0&&s?this.nodes[a].type:r&&a>=i?r.node(a-i).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;a--}}return!0};return o(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function Ux(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&qd.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function Kx(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Ba(t){let e={};for(let n in t)e[n]=t[n];return e}function $a(t,e){let n=e.schema.nodes;for(let r in n){let s=n[r];if(!s.allowsMarkType(t))continue;let i=[],o=l=>{i.push(l);for(let a=0;a<l.edgeCount;a++){let{type:c,next:u}=l.edge(a);if(c==e||i.indexOf(u)<0&&o(u))return!0}};if(o(s.contentMatch))return!0}}class tr{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=Es(n).createDocumentFragment());let s=r,i=[];return e.forEach(o=>{if(i.length||o.marks.length){let l=0,a=0;for(;l<i.length&&a<o.marks.length;){let c=o.marks[a];if(!this.marks[c.type.name]){a++;continue}if(!c.eq(i[l][0])||c.type.spec.spanning===!1)break;l++,a++}for(;l<i.length;)s=i.pop()[1];for(;a<o.marks.length;){let c=o.marks[a++],u=this.serializeMark(c,o.isInline,n);u&&(i.push([c,s]),s.appendChild(u.dom),s=u.contentDOM||u.dom)}}s.appendChild(this.serializeNodeInner(o,n))}),r}serializeNodeInner(e,n){if(e.isText)return Es(n).createTextNode(e.text);let{dom:r,contentDOM:s}=Ws(Es(n),this.nodes[e.type.name](e),null,e.attrs);if(s){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,s)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let s=e.marks.length-1;s>=0;s--){let i=this.serializeMark(e.marks[s],e.isInline,n);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(e,n,r={}){let s=this.marks[e.type.name];return s&&Ws(Es(r),s(e,n),null,e.attrs)}static renderSpec(e,n,r=null,s){return typeof n=="string"?{dom:e.createTextNode(n)}:Ws(e,n,r,s)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new tr(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=Pa(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return Pa(e.marks)}}function Pa(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Es(t){return t.document||window.document}const za=new WeakMap;function Gx(t){let e=za.get(t);return e===void 0&&za.set(t,e=Jx(t)),e}function Jx(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let s=0;s<r.length;s++)n(r[s]);else for(let s in r)n(r[s])}return n(t),e}function Ws(t,e,n,r){if(e.nodeType==1)return{dom:e};if(e.dom&&e.dom.nodeType==1)return e;let s=e[0],i;if(typeof s!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(i=Gx(r))&&i.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=s.indexOf(" ");o>0&&(n=s.slice(0,o),s=s.slice(o+1));let l,a=n?t.createElementNS(n,s):t.createElement(s),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let h in c)if(c[h]!=null){let p=h.indexOf(" ");p>0?a.setAttributeNS(h.slice(0,p),h.slice(p+1),c[h]):h=="style"&&a.style?a.style.cssText=c[h]:a.setAttribute(h,c[h])}}for(let h=u;h<e.length;h++){let p=e[h];if(p===0){if(h<e.length-1||h>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else if(typeof p=="string")a.appendChild(t.createTextNode(p));else{let{dom:f,contentDOM:m}=Ws(t,p,n,r);if(a.appendChild(f),m){if(l)throw new RangeError("Multiple content holes");l=m}}}return{dom:a,contentDOM:l}}const Ud=65535,Kd=Math.pow(2,16);function Yx(t,e){return t+e*Kd}function Fa(t){return t&Ud}function Qx(t){return(t-(t&Ud))/Kd}const Gd=1,Jd=2,Vs=4,Yd=8;class Qo{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&Yd)>0}get deletedBefore(){return(this.delInfo&(Gd|Vs))>0}get deletedAfter(){return(this.delInfo&(Jd|Vs))>0}get deletedAcross(){return(this.delInfo&Vs)>0}}class yt{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&yt.empty)return yt.empty}recover(e){let n=0,r=Fa(e);if(!this.inverted)for(let s=0;s<r;s++)n+=this.ranges[s*3+2]-this.ranges[s*3+1];return this.ranges[r*3]+n+Qx(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let s=0,i=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?s:0);if(a>e)break;let c=this.ranges[l+i],u=this.ranges[l+o],h=a+c;if(e<=h){let p=c?e==a?-1:e==h?1:n:n,f=a+s+(p<0?0:u);if(r)return f;let m=e==(n<0?a:h)?null:Yx(l/3,e-a),g=e==a?Jd:e==h?Gd:Vs;return(n<0?e!=a:e!=h)&&(g|=Yd),new Qo(f,g,m)}s+=u-c}return r?e+s:new Qo(e+s,0,null)}touches(e,n){let r=0,s=Fa(n),i=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?r:0);if(a>e)break;let c=this.ranges[l+i],u=a+c;if(e<=u&&l==s*3)return!0;r+=this.ranges[l+o]-c}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let s=0,i=0;s<this.ranges.length;s+=3){let o=this.ranges[s],l=o-(this.inverted?i:0),a=o+(this.inverted?0:i),c=this.ranges[s+n],u=this.ranges[s+r];e(l,l+c,a,a+u),i+=u-c}}invert(){return new yt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?yt.empty:new yt(e<0?[0,-e,0]:[0,0,e])}}yt.empty=new yt([]);class rs{constructor(e,n,r=0,s=e?e.length:0){this.mirror=n,this.from=r,this.to=s,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new rs(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,r=this._maps.length;n<e._maps.length;n++){let s=e.getMirror(n);this.appendMap(e._maps[n],s!=null&&s<n?r+s:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this._maps.length+e._maps.length;n>=0;n--){let s=e.getMirror(n);this.appendMap(e._maps[n].invert(),s!=null&&s>n?r-s-1:void 0)}}invert(){let e=new rs;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let s=0;for(let i=this.from;i<this.to;i++){let o=this._maps[i],l=o.mapResult(e,n);if(l.recover!=null){let a=this.getMirror(i);if(a!=null&&a>i&&a<this.to){i=a,e=this._maps[a].recover(l.recover);continue}}s|=l.delInfo,e=l.pos}return r?e:new Qo(e,s,null)}}const fo=Object.create(null);class nt{getMap(){return yt.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=fo[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in fo)throw new RangeError("Duplicate use of step JSON ID "+e);return fo[e]=n,n.prototype.jsonID=e,n}}class $e{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new $e(e,null)}static fail(e){return new $e(null,e)}static fromReplace(e,n,r,s){try{return $e.ok(e.replace(n,r,s))}catch(i){if(i instanceof Ys)return $e.fail(i.message);throw i}}}function Tl(t,e,n){let r=[];for(let s=0;s<t.childCount;s++){let i=t.child(s);i.content.size&&(i=i.copy(Tl(i.content,e,i))),i.isInline&&(i=e(i,n,s)),r.push(i)}return E.fromArray(r)}class bn extends nt{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),s=r.node(r.sharedDepth(this.to)),i=new F(Tl(n.content,(o,l)=>!o.isAtom||!l.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),s),n.openStart,n.openEnd);return $e.fromReplace(e,this.from,this.to,i)}invert(){return new Rt(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new bn(n.pos,r.pos,this.mark)}merge(e){return e instanceof bn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new bn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new bn(n.from,n.to,e.markFromJSON(n.mark))}}nt.jsonID("addMark",bn);class Rt extends nt{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new F(Tl(n.content,s=>s.mark(this.mark.removeFromSet(s.marks)),e),n.openStart,n.openEnd);return $e.fromReplace(e,this.from,this.to,r)}invert(){return new bn(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Rt(n.pos,r.pos,this.mark)}merge(e){return e instanceof Rt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Rt(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Rt(n.from,n.to,e.markFromJSON(n.mark))}}nt.jsonID("removeMark",Rt);class yn extends nt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return $e.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return $e.fromReplace(e,this.pos,this.pos+1,new F(E.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let s=0;s<n.marks.length;s++)if(!n.marks[s].isInSet(r))return new yn(this.pos,n.marks[s]);return new yn(this.pos,this.mark)}}return new Yn(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new yn(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new yn(n.pos,e.markFromJSON(n.mark))}}nt.jsonID("addNodeMark",yn);class Yn extends nt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return $e.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return $e.fromReplace(e,this.pos,this.pos+1,new F(E.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new yn(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Yn(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Yn(n.pos,e.markFromJSON(n.mark))}}nt.jsonID("removeNodeMark",Yn);class Be extends nt{constructor(e,n,r,s=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=s}apply(e){return this.structure&&Xo(e,this.from,this.to)?$e.fail("Structure replace would overwrite content"):$e.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new yt([this.from,this.to-this.from,this.slice.size])}invert(e){return new Be(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.to,-1),r=this.from==this.to&&Be.MAP_BIAS<0?n:e.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new Be(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof Be)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?F.empty:new F(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Be(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?F.empty:new F(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Be(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Be(n.from,n.to,F.fromJSON(e,n.slice),!!n.structure)}}Be.MAP_BIAS=1;nt.jsonID("replace",Be);class He extends nt{constructor(e,n,r,s,i,o,l=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=s,this.slice=i,this.insert=o,this.structure=l}apply(e){if(this.structure&&(Xo(e,this.from,this.gapFrom)||Xo(e,this.gapTo,this.to)))return $e.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return $e.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?$e.fromReplace(e,this.from,this.to,r):$e.fail("Content does not fit in gap")}getMap(){return new yt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new He(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),s=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||s<n.pos||i>r.pos?null:new He(n.pos,r.pos,s,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new He(n.from,n.to,n.gapFrom,n.gapTo,F.fromJSON(e,n.slice),n.insert,!!n.structure)}}nt.jsonID("replaceAround",He);function Xo(t,e,n){let r=t.resolve(e),s=n-e,i=r.depth;for(;s>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,s--;if(s>0){let o=r.node(i).maybeChild(r.indexAfter(i));for(;s>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,s--}}return!1}function Xx(t,e,n,r){let s=[],i=[],o,l;t.doc.nodesBetween(e,n,(a,c,u)=>{if(!a.isInline)return;let h=a.marks;if(!r.isInSet(h)&&u.type.allowsMarkType(r.type)){let p=Math.max(c,e),f=Math.min(c+a.nodeSize,n),m=r.addToSet(h);for(let g=0;g<h.length;g++)h[g].isInSet(m)||(o&&o.to==p&&o.mark.eq(h[g])?o.to=f:s.push(o=new Rt(p,f,h[g])));l&&l.to==p?l.to=f:i.push(l=new bn(p,f,r))}}),s.forEach(a=>t.step(a)),i.forEach(a=>t.step(a))}function Zx(t,e,n,r){let s=[],i=0;t.doc.nodesBetween(e,n,(o,l)=>{if(!o.isInline)return;i++;let a=null;if(r instanceof zi){let c=o.marks,u;for(;u=r.isInSet(c);)(a||(a=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(o.marks)&&(a=[r]):a=o.marks;if(a&&a.length){let c=Math.min(l+o.nodeSize,n);for(let u=0;u<a.length;u++){let h=a[u],p;for(let f=0;f<s.length;f++){let m=s[f];m.step==i-1&&h.eq(s[f].style)&&(p=m)}p?(p.to=c,p.step=i):s.push({style:h,from:Math.max(l,e),to:c,step:i})}}}),s.forEach(o=>t.step(new Rt(o.from,o.to,o.style)))}function El(t,e,n,r=n.contentMatch,s=!0){let i=t.doc.nodeAt(e),o=[],l=e+1;for(let a=0;a<i.childCount;a++){let c=i.child(a),u=l+c.nodeSize,h=r.matchType(c.type);if(!h)o.push(new Be(l,u,F.empty));else{r=h;for(let p=0;p<c.marks.length;p++)n.allowsMarkType(c.marks[p].type)||t.step(new Rt(l,u,c.marks[p]));if(s&&c.isText&&n.whitespace!="pre"){let p,f=/\r?\n|\r/g,m;for(;p=f.exec(c.text);)m||(m=new F(E.from(n.schema.text(" ",n.allowedMarks(c.marks))),0,0)),o.push(new Be(l+p.index,l+p.index+p[0].length,m))}}l=u}if(!r.validEnd){let a=r.fillBefore(E.empty,!0);t.replace(l,l,new F(a,0,0))}for(let a=o.length-1;a>=0;a--)t.step(o[a])}function e1(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function _r(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth,s=0,i=0;;--r){let o=t.$from.node(r),l=t.$from.index(r)+s,a=t.$to.indexAfter(r)-i;if(r<t.depth&&o.canReplace(l,a,n))return r;if(r==0||o.type.spec.isolating||!e1(o,l,a))break;l&&(s=1),a<o.childCount&&(i=1)}return null}function t1(t,e,n){let{$from:r,$to:s,depth:i}=e,o=r.before(i+1),l=s.after(i+1),a=o,c=l,u=E.empty,h=0;for(let m=i,g=!1;m>n;m--)g||r.index(m)>0?(g=!0,u=E.from(r.node(m).copy(u)),h++):a--;let p=E.empty,f=0;for(let m=i,g=!1;m>n;m--)g||s.after(m+1)<s.end(m)?(g=!0,p=E.from(s.node(m).copy(p)),f++):c++;t.step(new He(a,c,o,l,new F(u.append(p),h,f),u.size-h,!0))}function Ml(t,e,n=null,r=t){let s=n1(t,e),i=s&&r1(r,e);return i?s.map(Ha).concat({type:e,attrs:n}).concat(i.map(Ha)):null}function Ha(t){return{type:t,attrs:null}}function n1(t,e){let{parent:n,startIndex:r,endIndex:s}=t,i=n.contentMatchAt(r).findWrapping(e);if(!i)return null;let o=i.length?i[0]:e;return n.canReplaceWith(r,s,o)?i:null}function r1(t,e){let{parent:n,startIndex:r,endIndex:s}=t,i=n.child(r),o=e.contentMatch.findWrapping(i.type);if(!o)return null;let a=(o.length?o[o.length-1]:e).contentMatch;for(let c=r;a&&c<s;c++)a=a.matchType(n.child(c).type);return!a||!a.validEnd?null:o}function s1(t,e,n){let r=E.empty;for(let o=n.length-1;o>=0;o--){if(r.size){let l=n[o].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=E.from(n[o].type.create(n[o].attrs,r))}let s=e.start,i=e.end;t.step(new He(s,i,s,i,new F(r,0,0),n.length,!0))}function i1(t,e,n,r,s){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=t.steps.length;t.doc.nodesBetween(e,n,(o,l)=>{let a=typeof s=="function"?s(o):s;if(o.isTextblock&&!o.hasMarkup(r,a)&&o1(t.doc,t.mapping.slice(i).map(l),r)){let c=null;if(r.schema.linebreakReplacement){let f=r.whitespace=="pre",m=!!r.contentMatch.matchType(r.schema.linebreakReplacement);f&&!m?c=!1:!f&&m&&(c=!0)}c===!1&&Xd(t,o,l,i),El(t,t.mapping.slice(i).map(l,1),r,void 0,c===null);let u=t.mapping.slice(i),h=u.map(l,1),p=u.map(l+o.nodeSize,1);return t.step(new He(h,p,h+1,p-1,new F(E.from(r.create(a,null,o.marks)),0,0),1,!0)),c===!0&&Qd(t,o,l,i),!1}})}function Qd(t,e,n,r){e.forEach((s,i)=>{if(s.isText){let o,l=/\r?\n|\r/g;for(;o=l.exec(s.text);){let a=t.mapping.slice(r).map(n+1+i+o.index);t.replaceWith(a,a+1,e.type.schema.linebreakReplacement.create())}}})}function Xd(t,e,n,r){e.forEach((s,i)=>{if(s.type==s.type.schema.linebreakReplacement){let o=t.mapping.slice(r).map(n+1+i);t.replaceWith(o,o+1,e.type.schema.text(`
|
|
21
|
-
`))}})}function o1(t,e,n){let r=t.resolve(e),s=r.index();return r.parent.canReplaceWith(s,s+1,n)}function l1(t,e,n,r,s){let i=t.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let o=n.create(r,null,s||i.marks);if(i.isLeaf)return t.replaceWith(e,e+i.nodeSize,o);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new He(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new F(E.from(o),0,0),1,!0))}function sn(t,e,n=1,r){let s=t.resolve(e),i=s.depth-n,o=r&&r[r.length-1]||s.parent;if(i<0||s.parent.type.spec.isolating||!s.parent.canReplace(s.index(),s.parent.childCount)||!o.type.validContent(s.parent.content.cutByIndex(s.index(),s.parent.childCount)))return!1;for(let c=s.depth-1,u=n-2;c>i;c--,u--){let h=s.node(c),p=s.index(c);if(h.type.spec.isolating)return!1;let f=h.content.cutByIndex(p,h.childCount),m=r&&r[u+1];m&&(f=f.replaceChild(0,m.type.create(m.attrs)));let g=r&&r[u]||h;if(!h.canReplace(p+1,h.childCount)||!g.type.validContent(f))return!1}let l=s.indexAfter(i),a=r&&r[0];return s.node(i).canReplaceWith(l,l,a?a.type:s.node(i+1).type)}function a1(t,e,n=1,r){let s=t.doc.resolve(e),i=E.empty,o=E.empty;for(let l=s.depth,a=s.depth-n,c=n-1;l>a;l--,c--){i=E.from(s.node(l).copy(i));let u=r&&r[c];o=E.from(u?u.type.create(u.attrs,o):s.node(l).copy(o))}t.step(new Be(e,e,new F(i.append(o),n,n),!0))}function An(t,e){let n=t.resolve(e),r=n.index();return Zd(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function c1(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let s=0;s<e.childCount;s++){let i=e.child(s),o=i.type==r?t.type.schema.nodes.text:i.type;if(n=n.matchType(o),!n||!t.type.allowsMarks(i.marks))return!1}return n.validEnd}function Zd(t,e){return!!(t&&e&&!t.isLeaf&&c1(t,e))}function Fi(t,e,n=-1){let r=t.resolve(e);for(let s=r.depth;;s--){let i,o,l=r.index(s);if(s==r.depth?(i=r.nodeBefore,o=r.nodeAfter):n>0?(i=r.node(s+1),l++,o=r.node(s).maybeChild(l)):(i=r.node(s).maybeChild(l-1),o=r.node(s+1)),i&&!i.isTextblock&&Zd(i,o)&&r.node(s).canReplace(l,l+1))return e;if(s==0)break;e=n<0?r.before(s):r.after(s)}}function d1(t,e,n){let r=null,{linebreakReplacement:s}=t.doc.type.schema,i=t.doc.resolve(e-n),o=i.node().type;if(s&&o.inlineContent){let u=o.whitespace=="pre",h=!!o.contentMatch.matchType(s);u&&!h?r=!1:!u&&h&&(r=!0)}let l=t.steps.length;if(r===!1){let u=t.doc.resolve(e+n);Xd(t,u.node(),u.before(),l)}o.inlineContent&&El(t,e+n-1,o,i.node().contentMatchAt(i.index()),r==null);let a=t.mapping.slice(l),c=a.map(e-n);if(t.step(new Be(c,a.map(e+n,-1),F.empty,!0)),r===!0){let u=t.doc.resolve(c);Qd(t,u.node(),u.before(),t.steps.length)}return t}function u1(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let s=r.depth-1;s>=0;s--){let i=r.index(s);if(r.node(s).canReplaceWith(i,i,n))return r.before(s+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(let s=r.depth-1;s>=0;s--){let i=r.indexAfter(s);if(r.node(s).canReplaceWith(i,i,n))return r.after(s+1);if(i<r.node(s).childCount)return null}return null}function eu(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let s=n.content;for(let i=0;i<n.openStart;i++)s=s.firstChild.content;for(let i=1;i<=(n.openStart==0&&n.size?2:1);i++)for(let o=r.depth;o>=0;o--){let l=o==r.depth?0:r.pos<=(r.start(o+1)+r.end(o+1))/2?-1:1,a=r.index(o)+(l>0?1:0),c=r.node(o),u=!1;if(i==1)u=c.canReplace(a,a,s);else{let h=c.contentMatchAt(a).findWrapping(s.firstChild.type);u=h&&c.canReplaceWith(a,a,h[0])}if(u)return l==0?r.pos:l<0?r.before(o+1):r.after(o+1)}return null}function Hi(t,e,n=e,r=F.empty){if(e==n&&!r.size)return null;let s=t.resolve(e),i=t.resolve(n);return tu(s,i,r)?new Be(e,n,r):new h1(s,i,r).fit()}function tu(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class h1{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=E.empty;for(let s=0;s<=e.depth;s++){let i=e.node(s);this.frontier.push({type:i.type,match:i.contentMatchAt(e.indexAfter(s))})}for(let s=e.depth;s>0;s--)this.placed=E.from(e.node(s).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,s=this.close(e<0?this.$to:r.doc.resolve(e));if(!s)return null;let i=this.placed,o=r.depth,l=s.depth;for(;o&&l&&i.childCount==1;)i=i.firstChild.content,o--,l--;let a=new F(i,o,l);return e>-1?new He(r.pos,e,this.$to.pos,this.$to.end(),a,n):a.size||r.pos!=this.$to.pos?new Be(r.pos,s.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,s=this.unplaced.openEnd;r<e;r++){let i=n.firstChild;if(n.childCount>1&&(s=0),i.type.spec.isolating&&s<=r){e=r;break}n=i.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let s,i=null;r?(i=po(this.unplaced.content,r-1).firstChild,s=i.content):s=this.unplaced.content;let o=s.firstChild;for(let l=this.depth;l>=0;l--){let{type:a,match:c}=this.frontier[l],u,h=null;if(n==1&&(o?c.matchType(o.type)||(h=c.fillBefore(E.from(o),!1)):i&&a.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:l,parent:i,inject:h};if(n==2&&o&&(u=c.findWrapping(o.type)))return{sliceDepth:r,frontierDepth:l,parent:i,wrap:u};if(i&&c.matchType(i.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,s=po(e,n);return!s.childCount||s.firstChild.isLeaf?!1:(this.unplaced=new F(e,n+1,Math.max(r,s.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,s=po(e,n);if(s.childCount<=1&&n>0){let i=e.size-n<=n+s.size;this.unplaced=new F(Pr(e,n-1,1),n-1,i?n-1:r)}else this.unplaced=new F(Pr(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:s,wrap:i}){for(;this.depth>n;)this.closeFrontierNode();if(i)for(let g=0;g<i.length;g++)this.openFrontierNode(i[g]);let o=this.unplaced,l=r?r.content:o.content,a=o.openStart-e,c=0,u=[],{match:h,type:p}=this.frontier[n];if(s){for(let g=0;g<s.childCount;g++)u.push(s.child(g));h=h.matchFragment(s)}let f=l.size+e-(o.content.size-o.openEnd);for(;c<l.childCount;){let g=l.child(c),b=h.matchType(g.type);if(!b)break;c++,(c>1||a==0||g.content.size)&&(h=b,u.push(nu(g.mark(p.allowedMarks(g.marks)),c==1?a:0,c==l.childCount?f:-1)))}let m=c==l.childCount;m||(f=-1),this.placed=zr(this.placed,n,E.from(u)),this.frontier[n].match=h,m&&f<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,b=l;g<f;g++){let y=b.lastChild;this.frontier.push({type:y.type,match:y.contentMatchAt(y.childCount)}),b=y.content}this.unplaced=m?e==0?F.empty:new F(Pr(o.content,e-1,1),e-1,f<0?o.openEnd:e-1):new F(Pr(o.content,e,c),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!mo(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,s=this.$to.after(r);for(;r>1&&s==this.$to.end(--r);)++s;return s}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:s}=this.frontier[n],i=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),o=mo(e,n,s,r,i);if(o){for(let l=n-1;l>=0;l--){let{match:a,type:c}=this.frontier[l],u=mo(e,l,c,a,!0);if(!u||u.childCount)continue e}return{depth:n,fit:o,move:i?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=zr(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let s=e.node(r),i=s.type.contentMatch.fillBefore(s.content,!0,e.index(r));this.openFrontierNode(s.type,s.attrs,i)}return e}openFrontierNode(e,n=null,r){let s=this.frontier[this.depth];s.match=s.match.matchType(e),this.placed=zr(this.placed,this.depth,E.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(E.empty,!0);n.childCount&&(this.placed=zr(this.placed,this.frontier.length,n))}}function Pr(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Pr(t.firstChild.content,e-1,n)))}function zr(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(zr(t.lastChild.content,e-1,n)))}function po(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function nu(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,nu(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(E.empty,!0)))),t.copy(r)}function mo(t,e,n,r,s){let i=t.node(e),o=s?t.indexAfter(e):t.index(e);if(o==i.childCount&&!n.compatibleContent(i.type))return null;let l=r.fillBefore(i.content,!0,o);return l&&!f1(n,i.content,o)?l:null}function f1(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function p1(t){return t.spec.defining||t.spec.definingForContent}function m1(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let s=t.doc.resolve(e),i=t.doc.resolve(n);if(tu(s,i,r))return t.step(new Be(e,n,r));let o=su(s,i);o[o.length-1]==0&&o.pop();let l=-(s.depth+1);o.unshift(l);for(let p=s.depth,f=s.pos-1;p>0;p--,f--){let m=s.node(p).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;o.indexOf(p)>-1?l=p:s.before(p)==f&&o.splice(1,0,-p)}let a=o.indexOf(l),c=[],u=r.openStart;for(let p=r.content,f=0;;f++){let m=p.firstChild;if(c.push(m),f==r.openStart)break;p=m.content}for(let p=u-1;p>=0;p--){let f=c[p],m=p1(f.type);if(m&&!f.sameMarkup(s.node(Math.abs(l)-1)))u=p;else if(m||!f.type.isTextblock)break}for(let p=r.openStart;p>=0;p--){let f=(p+u+1)%(r.openStart+1),m=c[f];if(m)for(let g=0;g<o.length;g++){let b=o[(g+a)%o.length],y=!0;b<0&&(y=!1,b=-b);let v=s.node(b-1),_=s.index(b-1);if(v.canReplaceWith(_,_,m.type,m.marks))return t.replace(s.before(b),y?i.after(b):n,new F(ru(r.content,0,r.openStart,f),f,r.openEnd))}}let h=t.steps.length;for(let p=o.length-1;p>=0&&(t.replace(e,n,r),!(t.steps.length>h));p--){let f=o[p];f<0||(e=s.before(f),n=i.after(f))}}function ru(t,e,n,r,s){if(e<n){let i=t.firstChild;t=t.replaceChild(0,i.copy(ru(i.content,e+1,n,r,i)))}if(e>r){let i=s.contentMatchAt(0),o=i.fillBefore(t).append(t);t=o.append(i.matchFragment(o).fillBefore(E.empty,!0))}return t}function g1(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let s=u1(t.doc,e,r.type);s!=null&&(e=n=s)}t.replaceRange(e,n,new F(E.from(r),0,0))}function b1(t,e,n){let r=t.doc.resolve(e),s=t.doc.resolve(n);if(r.parent.isTextblock&&s.parent.isTextblock&&r.start()!=s.start()&&r.parentOffset==0&&s.parentOffset==0){let o=r.sharedDepth(n),l=!1;for(let a=r.depth;a>o;a--)r.node(a).type.spec.isolating&&(l=!0);for(let a=s.depth;a>o;a--)s.node(a).type.spec.isolating&&(l=!0);if(!l){for(let a=r.depth;a>0&&e==r.start(a);a--)e=r.before(a);for(let a=s.depth;a>0&&n==s.start(a);a--)n=s.before(a);r=t.doc.resolve(e),s=t.doc.resolve(n)}}let i=su(r,s);for(let o=0;o<i.length;o++){let l=i[o],a=o==i.length-1;if(a&&l==0||r.node(l).type.contentMatch.validEnd)return t.delete(r.start(l),s.end(l));if(l>0&&(a||r.node(l-1).canReplace(r.index(l-1),s.indexAfter(l-1))))return t.delete(r.before(l),s.after(l))}for(let o=1;o<=r.depth&&o<=s.depth;o++)if(e-r.start(o)==r.depth-o&&n>r.end(o)&&s.end(o)-n!=s.depth-o&&r.start(o-1)==s.start(o-1)&&r.node(o-1).canReplace(r.index(o-1),s.index(o-1)))return t.delete(r.before(o),n);t.delete(e,n)}function su(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let s=r;s>=0;s--){let i=t.start(s);if(i<t.pos-(t.depth-s)||e.end(s)>e.pos+(e.depth-s)||t.node(s).type.spec.isolating||e.node(s).type.spec.isolating)break;(i==e.start(s)||s==t.depth&&s==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&s&&e.start(s-1)==i-1)&&n.push(s)}return n}class hr extends nt{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return $e.fail("No node at attribute step's position");let r=Object.create(null);for(let i in n.attrs)r[i]=n.attrs[i];r[this.attr]=this.value;let s=n.type.create(r,null,n.marks);return $e.fromReplace(e,this.pos,this.pos+1,new F(E.from(s),0,n.isLeaf?0:1))}getMap(){return yt.empty}invert(e){return new hr(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new hr(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new hr(n.pos,n.attr,n.value)}}nt.jsonID("attr",hr);class ss extends nt{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let s in e.attrs)n[s]=e.attrs[s];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return $e.ok(r)}getMap(){return yt.empty}invert(e){return new ss(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new ss(n.attr,n.value)}}nt.jsonID("docAttr",ss);let mr=class extends Error{};mr=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};mr.prototype=Object.create(Error.prototype);mr.prototype.constructor=mr;mr.prototype.name="TransformError";class iu{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new rs}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new mr(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,n=-1e9;for(let r=0;r<this.mapping.maps.length;r++){let s=this.mapping.maps[r];r&&(e=s.map(e,1),n=s.map(n,-1)),s.forEach((i,o,l,a)=>{e=Math.min(e,l),n=Math.max(n,a)})}return e==1e9?null:{from:e,to:n}}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=F.empty){let s=Hi(this.doc,e,n,r);return s&&this.step(s),this}replaceWith(e,n,r){return this.replace(e,n,new F(E.from(r),0,0))}delete(e,n){return this.replace(e,n,F.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return m1(this,e,n,r),this}replaceRangeWith(e,n,r){return g1(this,e,n,r),this}deleteRange(e,n){return b1(this,e,n),this}lift(e,n){return t1(this,e,n),this}join(e,n=1){return d1(this,e,n),this}wrap(e,n){return s1(this,e,n),this}setBlockType(e,n=e,r,s=null){return i1(this,e,n,r,s),this}setNodeMarkup(e,n,r=null,s){return l1(this,e,n,r,s),this}setNodeAttribute(e,n,r){return this.step(new hr(e,n,r)),this}setDocAttribute(e,n){return this.step(new ss(e,n)),this}addNodeMark(e,n){return this.step(new yn(e,n)),this}removeNodeMark(e,n){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n instanceof _e)n.isInSet(r.marks)&&this.step(new Yn(e,n));else{let s=r.marks,i,o=[];for(;i=n.isInSet(s);)o.push(new Yn(e,i)),s=i.removeFromSet(s);for(let l=o.length-1;l>=0;l--)this.step(o[l])}return this}split(e,n=1,r){return a1(this,e,n,r),this}addMark(e,n,r){return Xx(this,e,n,r),this}removeMark(e,n,r){return Zx(this,e,n,r),this}clearIncompatible(e,n,r){return El(this,e,n,r),this}}const go=Object.create(null);class le{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new y1(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=F.empty){let r=n.content.lastChild,s=null;for(let l=0;l<n.openEnd;l++)s=r,r=r.lastChild;let i=e.steps.length,o=this.ranges;for(let l=0;l<o.length;l++){let{$from:a,$to:c}=o[l],u=e.mapping.slice(i);e.replaceRange(u.map(a.pos),u.map(c.pos),l?F.empty:n),l==0&&qa(e,i,(r?r.isInline:s&&s.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,s=this.ranges;for(let i=0;i<s.length;i++){let{$from:o,$to:l}=s[i],a=e.mapping.slice(r),c=a.map(o.pos),u=a.map(l.pos);i?e.deleteRange(c,u):(e.replaceRangeWith(c,u,n),qa(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let s=e.parent.inlineContent?new X(e):ar(e.node(0),e.parent,e.pos,e.index(),n,r);if(s)return s;for(let i=e.depth-1;i>=0;i--){let o=n<0?ar(e.node(0),e.node(i),e.before(i+1),e.index(i),n,r):ar(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,n,r);if(o)return o}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new xt(e.node(0))}static atStart(e){return ar(e,e,0,0,1)||new xt(e)}static atEnd(e){return ar(e,e,e.content.size,e.childCount,-1)||new xt(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=go[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in go)throw new RangeError("Duplicate use of selection JSON ID "+e);return go[e]=n,n.prototype.jsonID=e,n}getBookmark(){return X.between(this.$anchor,this.$head).getBookmark()}}le.prototype.visible=!0;class y1{constructor(e,n){this.$from=e,this.$to=n}}let Wa=!1;function Va(t){!Wa&&!t.parent.inlineContent&&(Wa=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class X extends le{constructor(e,n=e){Va(e),Va(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return le.near(r);let s=e.resolve(n.map(this.anchor));return new X(s.parent.inlineContent?s:r,r)}replace(e,n=F.empty){if(super.replace(e,n),n==F.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof X&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Wi(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new X(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let s=e.resolve(n);return new this(s,r==n?s:e.resolve(r))}static between(e,n,r){let s=e.pos-n.pos;if((!r||s)&&(r=s>=0?1:-1),!n.parent.inlineContent){let i=le.findFrom(n,r,!0)||le.findFrom(n,-r,!0);if(i)n=i.$head;else return le.near(n,r)}return e.parent.inlineContent||(s==0?e=n:(e=(le.findFrom(e,-r,!0)||le.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=s<0&&(e=n))),new X(e,n)}}le.jsonID("text",X);class Wi{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Wi(e.map(this.anchor),e.map(this.head))}resolve(e){return X.between(e.resolve(this.anchor),e.resolve(this.head))}}class J extends le{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:s}=n.mapResult(this.anchor),i=e.resolve(s);return r?le.near(i):new J(i)}content(){return new F(E.from(this.node),0,0)}eq(e){return e instanceof J&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new jl(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new J(e.resolve(n.anchor))}static create(e,n){return new J(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}J.prototype.visible=!1;le.jsonID("node",J);class jl{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new Wi(r,r):new jl(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&J.isSelectable(r)?new J(n):le.near(n)}}class xt extends le{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=F.empty){if(n==F.empty){e.delete(0,e.doc.content.size);let r=le.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new xt(e)}map(e){return new xt(e)}eq(e){return e instanceof xt}getBookmark(){return x1}}le.jsonID("all",xt);const x1={map(){return this},resolve(t){return new xt(t)}};function ar(t,e,n,r,s,i=!1){if(e.inlineContent)return X.create(t,n);for(let o=r-(s>0?0:1);s>0?o<e.childCount:o>=0;o+=s){let l=e.child(o);if(l.isAtom){if(!i&&J.isSelectable(l))return J.create(t,n-(s<0?l.nodeSize:0))}else{let a=ar(t,l,n+s,s<0?l.childCount:0,s,i);if(a)return a}n+=l.nodeSize*s}return null}function qa(t,e,n){let r=t.steps.length-1;if(r<e)return;let s=t.steps[r];if(!(s instanceof Be||s instanceof He))return;let i=t.mapping.maps[r],o;i.forEach((l,a,c,u)=>{o==null&&(o=u)}),t.setSelection(le.near(t.doc.resolve(o),n))}const Ua=1,Ms=2,Ka=4;class v1 extends iu{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|Ua)&~Ms,this.storedMarks=null,this}get selectionSet(){return(this.updated&Ua)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Ms,this}ensureMarks(e){return _e.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Ms)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~Ms,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||_e.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let s=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(s.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),!e)return this.deleteRange(n,r);let i=this.storedMarks;if(!i){let o=this.doc.resolve(n);i=r==n?o.marks():o.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,s.text(e,i)),!this.selection.empty&&this.selection.to==n+e.length&&this.setSelection(le.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=Ka,this}get scrolledIntoView(){return(this.updated&Ka)>0}}function Ga(t,e){return!e||!t?t:t.bind(e)}class Fr{constructor(e,n,r){this.name=e,this.init=Ga(n.init,r),this.apply=Ga(n.apply,r)}}const _1=[new Fr("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Fr("selection",{init(t,e){return t.selection||le.atStart(e.doc)},apply(t){return t.selection}}),new Fr("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Fr("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class bo{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=_1.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Fr(r.key,r.spec.state,r))})}}class ur{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let s=this.config.plugins[r];if(s.spec.filterTransaction&&!s.spec.filterTransaction.call(s,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),s=null;for(;;){let i=!1;for(let o=0;o<this.config.plugins.length;o++){let l=this.config.plugins[o];if(l.spec.appendTransaction){let a=s?s[o].n:0,c=s?s[o].state:this,u=a<n.length&&l.spec.appendTransaction.call(l,a?n.slice(a):n,c,r);if(u&&r.filterTransaction(u,o)){if(u.setMeta("appendedTransaction",e),!s){s=[];for(let h=0;h<this.config.plugins.length;h++)s.push(h<o?{state:r,n:n.length}:{state:this,n:0})}n.push(u),r=r.applyInner(u),i=!0}s&&(s[o]={state:r,n:n.length})}}if(!i)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new ur(this.config),r=this.config.fields;for(let s=0;s<r.length;s++){let i=r[s];n[i.name]=i.apply(e,this[i.name],this,n)}return n}get tr(){return new v1(this)}static create(e){let n=new bo(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new ur(n);for(let s=0;s<n.fields.length;s++)r[n.fields[s].name]=n.fields[s].init(e,r);return r}reconfigure(e){let n=new bo(this.schema,e.plugins),r=n.fields,s=new ur(n);for(let i=0;i<r.length;i++){let o=r[i].name;s[o]=this.hasOwnProperty(o)?this[o]:r[i].init(e,s)}return s}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let s=e[r],i=s.spec.state;i&&i.toJSON&&(n[r]=i.toJSON.call(s,this[s.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let s=new bo(e.schema,e.plugins),i=new ur(s);return s.fields.forEach(o=>{if(o.name=="doc")i.doc=Mt.fromJSON(e.schema,n.doc);else if(o.name=="selection")i.selection=le.fromJSON(i.doc,n.selection);else if(o.name=="storedMarks")n.storedMarks&&(i.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let l in r){let a=r[l],c=a.spec.state;if(a.key==o.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,l)){i[o.name]=c.fromJSON.call(a,e,n[l],i);return}}i[o.name]=o.init(e,i)}}),i}}function ou(t,e,n){for(let r in t){let s=t[r];s instanceof Function?s=s.bind(e):r=="handleDOMEvents"&&(s=ou(s,e,{})),n[r]=s}return n}class Ae{constructor(e){this.spec=e,this.props={},e.props&&ou(e.props,this,this.props),this.key=e.key?e.key.key:lu("plugin")}getState(e){return e[this.key]}}const yo=Object.create(null);function lu(t){return t in yo?t+"$"+ ++yo[t]:(yo[t]=0,t+"$")}class Le{constructor(e="key"){this.key=lu(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const au=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function cu(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const du=(t,e,n)=>{let r=cu(t,n);if(!r)return!1;let s=Il(r);if(!s){let o=r.blockRange(),l=o&&_r(o);return l==null?!1:(e&&e(t.tr.lift(o,l).scrollIntoView()),!0)}let i=s.nodeBefore;if(xu(t,s,e,-1))return!0;if(r.parent.content.size==0&&(gr(i,"end")||J.isSelectable(i)))for(let o=r.depth;;o--){let l=Hi(t.doc,r.before(o),r.after(o),F.empty);if(l&&l.slice.size<l.to-l.from){if(e){let a=t.tr.step(l);a.setSelection(gr(i,"end")?le.findFrom(a.doc.resolve(a.mapping.map(s.pos,-1)),-1):J.create(a.doc,s.pos-i.nodeSize)),e(a.scrollIntoView())}return!0}if(o==1||r.node(o-1).childCount>1)break}return i.isAtom&&s.depth==r.depth-1?(e&&e(t.tr.delete(s.pos-i.nodeSize,s.pos).scrollIntoView()),!0):!1},k1=(t,e,n)=>{let r=cu(t,n);if(!r)return!1;let s=Il(r);return s?uu(t,s,e):!1},w1=(t,e,n)=>{let r=fu(t,n);if(!r)return!1;let s=Dl(r);return s?uu(t,s,e):!1};function uu(t,e,n){let r=e.nodeBefore,s=r,i=e.pos-1;for(;!s.isTextblock;i--){if(s.type.spec.isolating)return!1;let u=s.lastChild;if(!u)return!1;s=u}let o=e.nodeAfter,l=o,a=e.pos+1;for(;!l.isTextblock;a++){if(l.type.spec.isolating)return!1;let u=l.firstChild;if(!u)return!1;l=u}let c=Hi(t.doc,i,a,F.empty);if(!c||c.from!=i||c instanceof Be&&c.slice.size>=a-i)return!1;if(n){let u=t.tr.step(c);u.setSelection(X.create(u.doc,i)),n(u.scrollIntoView())}return!0}function gr(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const hu=(t,e,n)=>{let{$head:r,empty:s}=t.selection,i=r;if(!s)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;i=Il(r)}let o=i&&i.nodeBefore;return!o||!J.isSelectable(o)?!1:(e&&e(t.tr.setSelection(J.create(t.doc,i.pos-o.nodeSize)).scrollIntoView()),!0)};function Il(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function fu(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const pu=(t,e,n)=>{let r=fu(t,n);if(!r)return!1;let s=Dl(r);if(!s)return!1;let i=s.nodeAfter;if(xu(t,s,e,1))return!0;if(r.parent.content.size==0&&(gr(i,"start")||J.isSelectable(i))){let o=Hi(t.doc,r.before(),r.after(),F.empty);if(o&&o.slice.size<o.to-o.from){if(e){let l=t.tr.step(o);l.setSelection(gr(i,"start")?le.findFrom(l.doc.resolve(l.mapping.map(s.pos)),1):J.create(l.doc,l.mapping.map(s.pos))),e(l.scrollIntoView())}return!0}}return i.isAtom&&s.depth==r.depth-1?(e&&e(t.tr.delete(s.pos,s.pos+i.nodeSize).scrollIntoView()),!0):!1},mu=(t,e,n)=>{let{$head:r,empty:s}=t.selection,i=r;if(!s)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;i=Dl(r)}let o=i&&i.nodeAfter;return!o||!J.isSelectable(o)?!1:(e&&e(t.tr.setSelection(J.create(t.doc,i.pos)).scrollIntoView()),!0)};function Dl(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const C1=(t,e)=>{let n=t.selection,r=n instanceof J,s;if(r){if(n.node.isTextblock||!An(t.doc,n.from))return!1;s=n.from}else if(s=Fi(t.doc,n.from,-1),s==null)return!1;if(e){let i=t.tr.join(s);r&&i.setSelection(J.create(i.doc,s-t.doc.resolve(s).nodeBefore.nodeSize)),e(i.scrollIntoView())}return!0},S1=(t,e)=>{let n=t.selection,r;if(n instanceof J){if(n.node.isTextblock||!An(t.doc,n.to))return!1;r=n.to}else if(r=Fi(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},N1=(t,e)=>{let{$from:n,$to:r}=t.selection,s=n.blockRange(r),i=s&&_r(s);return i==null?!1:(e&&e(t.tr.lift(s,i).scrollIntoView()),!0)},gu=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
|
|
22
|
-
`).scrollIntoView()),!0)};function Ol(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const A1=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let s=n.node(-1),i=n.indexAfter(-1),o=Ol(s.contentMatchAt(i));if(!o||!s.canReplaceWith(i,i,o))return!1;if(e){let l=n.after(),a=t.tr.replaceWith(l,l,o.createAndFill());a.setSelection(le.near(a.doc.resolve(l),1)),e(a.scrollIntoView())}return!0},bu=(t,e)=>{let n=t.selection,{$from:r,$to:s}=n;if(n instanceof xt||r.parent.inlineContent||s.parent.inlineContent)return!1;let i=Ol(s.parent.contentMatchAt(s.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){let o=(!r.parentOffset&&s.index()<s.parent.childCount?r:s).pos,l=t.tr.insert(o,i.createAndFill());l.setSelection(X.create(l.doc,o+1)),e(l.scrollIntoView())}return!0},yu=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let i=n.before();if(sn(t.doc,i))return e&&e(t.tr.split(i).scrollIntoView()),!0}let r=n.blockRange(),s=r&&_r(r);return s==null?!1:(e&&e(t.tr.lift(r,s).scrollIntoView()),!0)};function T1(t){return(e,n)=>{let{$from:r,$to:s}=e.selection;if(e.selection instanceof J&&e.selection.node.isBlock)return!r.parentOffset||!sn(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let i=[],o,l,a=!1,c=!1;for(let f=r.depth;;f--)if(r.node(f).isBlock){a=r.end(f)==r.pos+(r.depth-f),c=r.start(f)==r.pos-(r.depth-f),l=Ol(r.node(f-1).contentMatchAt(r.indexAfter(f-1))),i.unshift(a&&l?{type:l}:null),o=f;break}else{if(f==1)return!1;i.unshift(null)}let u=e.tr;(e.selection instanceof X||e.selection instanceof xt)&&u.deleteSelection();let h=u.mapping.map(r.pos),p=sn(u.doc,h,i.length,i);if(p||(i[0]=l?{type:l}:null,p=sn(u.doc,h,i.length,i)),!p)return!1;if(u.split(h,i.length,i),!a&&c&&r.node(o).type!=l){let f=u.mapping.map(r.before(o)),m=u.doc.resolve(f);l&&r.node(o-1).canReplaceWith(m.index(),m.index()+1,l)&&u.setNodeMarkup(u.mapping.map(r.before(o)),l)}return n&&n(u.scrollIntoView()),!0}}const E1=T1(),M1=(t,e)=>{let{$from:n,to:r}=t.selection,s,i=n.sharedDepth(r);return i==0?!1:(s=n.before(i),e&&e(t.tr.setSelection(J.create(t.doc,s))),!0)};function j1(t,e,n){let r=e.nodeBefore,s=e.nodeAfter,i=e.index();return!r||!s||!r.type.compatibleContent(s.type)?!1:!r.content.size&&e.parent.canReplace(i-1,i)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(i,i+1)||!(s.isTextblock||An(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function xu(t,e,n,r){let s=e.nodeBefore,i=e.nodeAfter,o,l,a=s.type.spec.isolating||i.type.spec.isolating;if(!a&&j1(t,e,n))return!0;let c=!a&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(o=(l=s.contentMatchAt(s.childCount)).findWrapping(i.type))&&l.matchType(o[0]||i.type).validEnd){if(n){let f=e.pos+i.nodeSize,m=E.empty;for(let y=o.length-1;y>=0;y--)m=E.from(o[y].create(null,m));m=E.from(s.copy(m));let g=t.tr.step(new He(e.pos-1,f,e.pos,f,new F(m,1,0),o.length,!0)),b=g.doc.resolve(f+2*o.length);b.nodeAfter&&b.nodeAfter.type==s.type&&An(g.doc,b.pos)&&g.join(b.pos),n(g.scrollIntoView())}return!0}let u=i.type.spec.isolating||r>0&&a?null:le.findFrom(e,1),h=u&&u.$from.blockRange(u.$to),p=h&&_r(h);if(p!=null&&p>=e.depth)return n&&n(t.tr.lift(h,p).scrollIntoView()),!0;if(c&&gr(i,"start",!0)&&gr(s,"end")){let f=s,m=[];for(;m.push(f),!f.isTextblock;)f=f.lastChild;let g=i,b=1;for(;!g.isTextblock;g=g.firstChild)b++;if(f.canReplace(f.childCount,f.childCount,g.content)){if(n){let y=E.empty;for(let _=m.length-1;_>=0;_--)y=E.from(m[_].copy(y));let v=t.tr.step(new He(e.pos-m.length,e.pos+i.nodeSize,e.pos+b,e.pos+i.nodeSize-b,new F(y,m.length,0),0,!0));n(v.scrollIntoView())}return!0}}return!1}function vu(t){return function(e,n){let r=e.selection,s=t<0?r.$from:r.$to,i=s.depth;for(;s.node(i).isInline;){if(!i)return!1;i--}return s.node(i).isTextblock?(n&&n(e.tr.setSelection(X.create(e.doc,t<0?s.start(i):s.end(i)))),!0):!1}}const I1=vu(-1),D1=vu(1);function O1(t,e=null){return function(n,r){let{$from:s,$to:i}=n.selection,o=s.blockRange(i),l=o&&Ml(o,t,e);return l?(r&&r(n.tr.wrap(o,l).scrollIntoView()),!0):!1}}function Ja(t,e=null){return function(n,r){let s=!1;for(let i=0;i<n.selection.ranges.length&&!s;i++){let{$from:{pos:o},$to:{pos:l}}=n.selection.ranges[i];n.doc.nodesBetween(o,l,(a,c)=>{if(s)return!1;if(!(!a.isTextblock||a.hasMarkup(t,e)))if(a.type==t)s=!0;else{let u=n.doc.resolve(c),h=u.index();s=u.parent.canReplaceWith(h,h+1,t)}})}if(!s)return!1;if(r){let i=n.tr;for(let o=0;o<n.selection.ranges.length;o++){let{$from:{pos:l},$to:{pos:a}}=n.selection.ranges[o];i.setBlockType(l,a,t,e)}r(i.scrollIntoView())}return!0}}function Rl(...t){return function(e,n,r){for(let s=0;s<t.length;s++)if(t[s](e,n,r))return!0;return!1}}Rl(au,du,hu);Rl(au,pu,mu);Rl(gu,bu,yu,E1);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function R1(t,e=null){return function(n,r){let{$from:s,$to:i}=n.selection,o=s.blockRange(i);if(!o)return!1;let l=r?n.tr:null;return L1(l,o,t,e)?(r&&r(l.scrollIntoView()),!0):!1}}function L1(t,e,n,r=null){let s=!1,i=e,o=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let a=o.resolve(e.start-2);i=new Xs(a,a,e.depth),e.endIndex<e.parent.childCount&&(e=new Xs(e.$from,o.resolve(e.$to.end(e.depth)),e.depth)),s=!0}let l=Ml(i,n,r,e);return l?(t&&B1(t,e,l,s,n),!0):!1}function B1(t,e,n,r,s){let i=E.empty;for(let u=n.length-1;u>=0;u--)i=E.from(n[u].type.create(n[u].attrs,i));t.step(new He(e.start-(r?2:0),e.end,e.start,e.end,new F(i,0,0),n.length,!0));let o=0;for(let u=0;u<n.length;u++)n[u].type==s&&(o=u+1);let l=n.length-o,a=e.start+n.length-(r?2:0),c=e.parent;for(let u=e.startIndex,h=e.endIndex,p=!0;u<h;u++,p=!1)!p&&sn(t.doc,a,l)&&(t.split(a,l),a+=2*l),a+=c.child(u).nodeSize;return t}function $1(t){return function(e,n){let{$from:r,$to:s}=e.selection,i=r.blockRange(s,o=>o.childCount>0&&o.firstChild.type==t);return i?n?r.node(i.depth-1).type==t?P1(e,n,t,i):z1(e,n,i):!0:!1}}function P1(t,e,n,r){let s=t.tr,i=r.end,o=r.$to.end(r.depth);i<o&&(s.step(new He(i-1,o,i,o,new F(E.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Xs(s.doc.resolve(r.$from.pos),s.doc.resolve(o),r.depth));const l=_r(r);if(l==null)return!1;s.lift(r,l);let a=s.doc.resolve(s.mapping.map(i,-1)-1);return An(s.doc,a.pos)&&a.nodeBefore.type==a.nodeAfter.type&&s.join(a.pos),e(s.scrollIntoView()),!0}function z1(t,e,n){let r=t.tr,s=n.parent;for(let f=n.end,m=n.endIndex-1,g=n.startIndex;m>g;m--)f-=s.child(m).nodeSize,r.delete(f-1,f+1);let i=r.doc.resolve(n.start),o=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let l=n.startIndex==0,a=n.endIndex==s.childCount,c=i.node(-1),u=i.index(-1);if(!c.canReplace(u+(l?0:1),u+1,o.content.append(a?E.empty:E.from(s))))return!1;let h=i.pos,p=h+o.nodeSize;return r.step(new He(h-(l?1:0),p+(a?1:0),h+1,p-1,new F((l?E.empty:E.from(s.copy(E.empty))).append(a?E.empty:E.from(s.copy(E.empty))),l?0:1,a?0:1),l?0:1)),e(r.scrollIntoView()),!0}function F1(t){return function(e,n){let{$from:r,$to:s}=e.selection,i=r.blockRange(s,c=>c.childCount>0&&c.firstChild.type==t);if(!i)return!1;let o=i.startIndex;if(o==0)return!1;let l=i.parent,a=l.child(o-1);if(a.type!=t)return!1;if(n){let c=a.lastChild&&a.lastChild.type==l.type,u=E.from(c?t.create():null),h=new F(E.from(t.create(null,E.from(l.type.create(null,u)))),c?3:1,0),p=i.start,f=i.end;n(e.tr.step(new He(p-(c?3:1),f,p,f,h,1,!0)).scrollIntoView())}return!0}}const Ke=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},br=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let Zo=null;const tn=function(t,e,n){let r=Zo||(Zo=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},H1=function(){Zo=null},Qn=function(t,e,n,r){return n&&(Ya(t,e,n,r,-1)||Ya(t,e,n,r,1))},W1=/^(img|br|input|textarea|hr)$/i;function Ya(t,e,n,r,s){for(var i;;){if(t==n&&e==r)return!0;if(e==(s<0?0:Et(t))){let o=t.parentNode;if(!o||o.nodeType!=1||bs(t)||W1.test(t.nodeName)||t.contentEditable=="false")return!1;e=Ke(t)+(s<0?0:1),t=o}else if(t.nodeType==1){let o=t.childNodes[e+(s<0?-1:0)];if(o.nodeType==1&&o.contentEditable=="false")if(!((i=o.pmViewDesc)===null||i===void 0)&&i.ignoreForSelection)e+=s;else return!1;else t=o,e=s<0?Et(t):0}else return!1}}function Et(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function V1(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=Et(t)}else if(t.parentNode&&!bs(t))e=Ke(t),t=t.parentNode;else return null}}function q1(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!bs(t))e=Ke(t)+1,t=t.parentNode;else return null}}function U1(t,e,n){for(let r=e==0,s=e==Et(t);r||s;){if(t==n)return!0;let i=Ke(t);if(t=t.parentNode,!t)return!1;r=r&&i==0,s=s&&i==Et(t)}}function bs(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const Vi=function(t){return t.focusNode&&Qn(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Ln(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function K1(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function G1(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(Et(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(Et(r.startContainer),r.startOffset)}}}const Vt=typeof navigator<"u"?navigator:null,Qa=typeof document<"u"?document:null,Tn=Vt&&Vt.userAgent||"",el=/Edge\/(\d+)/.exec(Tn),_u=/MSIE \d/.exec(Tn),tl=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Tn),ut=!!(_u||tl||el),_n=_u?document.documentMode:tl?+tl[1]:el?+el[1]:0,jt=!ut&&/gecko\/(\d+)/i.test(Tn);jt&&+(/Firefox\/(\d+)/.exec(Tn)||[0,0])[1];const nl=!ut&&/Chrome\/(\d+)/.exec(Tn),Je=!!nl,ku=nl?+nl[1]:0,tt=!ut&&!!Vt&&/Apple Computer/.test(Vt.vendor),yr=tt&&(/Mobile\/\w+/.test(Tn)||!!Vt&&Vt.maxTouchPoints>2),Tt=yr||(Vt?/Mac/.test(Vt.platform):!1),wu=Vt?/Win/.test(Vt.platform):!1,rn=/Android \d/.test(Tn),ys=!!Qa&&"webkitFontSmoothing"in Qa.documentElement.style,J1=ys?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Y1(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Yt(t,e){return typeof t=="number"?t:t[e]}function Q1(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function Xa(t,e,n){let r=t.someProp("scrollThreshold")||0,s=t.someProp("scrollMargin")||5,i=t.dom.ownerDocument;for(let o=n||t.dom;o;){if(o.nodeType!=1){o=br(o);continue}let l=o,a=l==i.body,c=a?Y1(i):Q1(l),u=0,h=0;if(e.top<c.top+Yt(r,"top")?h=-(c.top-e.top+Yt(s,"top")):e.bottom>c.bottom-Yt(r,"bottom")&&(h=e.bottom-e.top>c.bottom-c.top?e.top+Yt(s,"top")-c.top:e.bottom-c.bottom+Yt(s,"bottom")),e.left<c.left+Yt(r,"left")?u=-(c.left-e.left+Yt(s,"left")):e.right>c.right-Yt(r,"right")&&(u=e.right-c.right+Yt(s,"right")),u||h)if(a)i.defaultView.scrollBy(u,h);else{let f=l.scrollLeft,m=l.scrollTop;h&&(l.scrollTop+=h),u&&(l.scrollLeft+=u);let g=l.scrollLeft-f,b=l.scrollTop-m;e={left:e.left-g,top:e.top-b,right:e.right-g,bottom:e.bottom-b}}let p=a?"fixed":getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(p))break;o=p=="absolute"?o.offsetParent:br(o)}}function X1(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,s;for(let i=(e.left+e.right)/2,o=n+1;o<Math.min(innerHeight,e.bottom);o+=5){let l=t.root.elementFromPoint(i,o);if(!l||l==t.dom||!t.dom.contains(l))continue;let a=l.getBoundingClientRect();if(a.top>=n-20){r=l,s=a.top;break}}return{refDOM:r,refTop:s,stack:Cu(t.dom)}}function Cu(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=br(r));return e}function Z1({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;Su(n,r==0?0:r-e)}function Su(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:s,left:i}=t[n];r.scrollTop!=s+e&&(r.scrollTop=s+e),r.scrollLeft!=i&&(r.scrollLeft=i)}}let or=null;function ev(t){if(t.setActive)return t.setActive();if(or)return t.focus(or);let e=Cu(t);t.focus(or==null?{get preventScroll(){return or={preventScroll:!0},!0}}:void 0),or||(or=!1,Su(e,0))}function Nu(t,e){let n,r=2e8,s,i=0,o=e.top,l=e.top,a,c;for(let u=t.firstChild,h=0;u;u=u.nextSibling,h++){let p;if(u.nodeType==1)p=u.getClientRects();else if(u.nodeType==3)p=tn(u).getClientRects();else continue;for(let f=0;f<p.length;f++){let m=p[f];if(m.top<=o&&m.bottom>=l){o=Math.max(m.bottom,o),l=Math.min(m.top,l);let g=m.left>e.left?m.left-e.left:m.right<e.left?e.left-m.right:0;if(g<r){n=u,r=g,s=g&&n.nodeType==3?{left:m.right<e.left?m.right:m.left,top:e.top}:e,u.nodeType==1&&g&&(i=h+(e.left>=(m.left+m.right)/2?1:0));continue}}else m.top>e.top&&!a&&m.left<=e.left&&m.right>=e.left&&(a=u,c={left:Math.max(m.left,Math.min(m.right,e.left)),top:m.top});!n&&(e.left>=m.right&&e.top>=m.top||e.left>=m.left&&e.top>=m.bottom)&&(i=h+1)}}return!n&&a&&(n=a,s=c,r=0),n&&n.nodeType==3?tv(n,s):!n||r&&n.nodeType==1?{node:t,offset:i}:Nu(n,s)}function tv(t,e){let n=t.nodeValue.length,r=document.createRange(),s;for(let i=0;i<n;i++){r.setEnd(t,i+1),r.setStart(t,i);let o=hn(r,1);if(o.top!=o.bottom&&Ll(e,o)){s={node:t,offset:i+(e.left>=(o.left+o.right)/2?1:0)};break}}return r.detach(),s||{node:t,offset:0}}function Ll(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function nv(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function rv(t,e,n){let{node:r,offset:s}=Nu(e,n),i=-1;if(r.nodeType==1&&!r.firstChild){let o=r.getBoundingClientRect();i=o.left!=o.right&&n.left>(o.left+o.right)/2?1:-1}return t.docView.posFromDOM(r,s,i)}function sv(t,e,n,r){let s=-1;for(let i=e,o=!1;i!=t.dom;){let l=t.docView.nearestDesc(i,!0),a;if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent||!l.contentDOM)&&((a=l.dom.getBoundingClientRect()).width||a.height)&&(l.node.isBlock&&l.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(l.dom.nodeName)&&(!o&&a.left>r.left||a.top>r.top?s=l.posBefore:(!o&&a.right<r.left||a.bottom<r.top)&&(s=l.posAfter),o=!0),!l.contentDOM&&s<0&&!l.node.isText))return(l.node.isBlock?r.top<(a.top+a.bottom)/2:r.left<(a.left+a.right)/2)?l.posBefore:l.posAfter;i=l.dom.parentNode}return s>-1?s:t.docView.posFromDOM(e,n,-1)}function Au(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let s=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),i=s;;){let o=t.childNodes[i];if(o.nodeType==1){let l=o.getClientRects();for(let a=0;a<l.length;a++){let c=l[a];if(Ll(e,c))return Au(o,e,c)}}if((i=(i+1)%r)==s)break}return t}function iv(t,e){let n=t.dom.ownerDocument,r,s=0,i=G1(n,e.left,e.top);i&&({node:r,offset:s}=i);let o=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),l;if(!o||!t.dom.contains(o.nodeType!=1?o.parentNode:o)){let c=t.dom.getBoundingClientRect();if(!Ll(e,c)||(o=Au(t.dom,e,c),!o))return null}if(tt)for(let c=o;r&&c;c=br(c))c.draggable&&(r=void 0);if(o=nv(o,e),r){if(jt&&r.nodeType==1&&(s=Math.min(s,r.childNodes.length),s<r.childNodes.length)){let u=r.childNodes[s],h;u.nodeName=="IMG"&&(h=u.getBoundingClientRect()).right<=e.left&&h.bottom>e.top&&s++}let c;ys&&s&&r.nodeType==1&&(c=r.childNodes[s-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&s--,r==t.dom&&s==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?l=t.state.doc.content.size:(s==0||r.nodeType!=1||r.childNodes[s-1].nodeName!="BR")&&(l=sv(t,r,s,e))}l==null&&(l=rv(t,o,e));let a=t.docView.nearestDesc(o,!0);return{pos:l,inside:a?a.posAtStart-a.border:-1}}function Za(t){return t.top<t.bottom||t.left<t.right}function hn(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(Za(r))return r}return Array.prototype.find.call(n,Za)||t.getBoundingClientRect()}const ov=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Tu(t,e,n){let{node:r,offset:s,atom:i}=t.docView.domFromPos(e,n<0?-1:1),o=ys||jt;if(r.nodeType==3)if(o&&(ov.test(r.nodeValue)||(n<0?!s:s==r.nodeValue.length))){let a=hn(tn(r,s,s),n);if(jt&&s&&/\s/.test(r.nodeValue[s-1])&&s<r.nodeValue.length){let c=hn(tn(r,s-1,s-1),-1);if(c.top==a.top){let u=hn(tn(r,s,s+1),-1);if(u.top!=a.top)return Mr(u,u.left<c.left)}}return a}else{let a=s,c=s,u=n<0?1:-1;return n<0&&!s?(c++,u=-1):n>=0&&s==r.nodeValue.length?(a--,u=1):n<0?a--:c++,Mr(hn(tn(r,a,c),u),u<0)}if(!t.state.doc.resolve(e-(i||0)).parent.inlineContent){if(i==null&&s&&(n<0||s==Et(r))){let a=r.childNodes[s-1];if(a.nodeType==1)return xo(a.getBoundingClientRect(),!1)}if(i==null&&s<Et(r)){let a=r.childNodes[s];if(a.nodeType==1)return xo(a.getBoundingClientRect(),!0)}return xo(r.getBoundingClientRect(),n>=0)}if(i==null&&s&&(n<0||s==Et(r))){let a=r.childNodes[s-1],c=a.nodeType==3?tn(a,Et(a)-(o?0:1)):a.nodeType==1&&(a.nodeName!="BR"||!a.nextSibling)?a:null;if(c)return Mr(hn(c,1),!1)}if(i==null&&s<Et(r)){let a=r.childNodes[s];for(;a.pmViewDesc&&a.pmViewDesc.ignoreForCoords;)a=a.nextSibling;let c=a?a.nodeType==3?tn(a,0,o?0:1):a.nodeType==1?a:null:null;if(c)return Mr(hn(c,-1),!0)}return Mr(hn(r.nodeType==3?tn(r):r,-n),n>=0)}function Mr(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function xo(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function Eu(t,e,n){let r=t.state,s=t.root.activeElement;r!=e&&t.updateState(e),s!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),s!=t.dom&&s&&s.focus()}}function lv(t,e,n){let r=e.selection,s=n=="up"?r.$from:r.$to;return Eu(t,e,()=>{let{node:i}=t.docView.domFromPos(s.pos,n=="up"?-1:1);for(;;){let l=t.docView.nearestDesc(i,!0);if(!l)break;if(l.node.isBlock){i=l.contentDOM||l.dom;break}i=l.dom.parentNode}let o=Tu(t,s.pos,1);for(let l=i.firstChild;l;l=l.nextSibling){let a;if(l.nodeType==1)a=l.getClientRects();else if(l.nodeType==3)a=tn(l,0,l.nodeValue.length).getClientRects();else continue;for(let c=0;c<a.length;c++){let u=a[c];if(u.bottom>u.top+1&&(n=="up"?o.top-u.top>(u.bottom-o.top)*2:u.bottom-o.bottom>(o.bottom-u.top)*2))return!1}}return!0})}const av=/[\u0590-\u08ac]/;function cv(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let s=r.parentOffset,i=!s,o=s==r.parent.content.size,l=t.domSelection();return l?!av.test(r.parent.textContent)||!l.modify?n=="left"||n=="backward"?i:o:Eu(t,e,()=>{let{focusNode:a,focusOffset:c,anchorNode:u,anchorOffset:h}=t.domSelectionRange(),p=l.caretBidiLevel;l.modify("move",n,"character");let f=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:m,focusOffset:g}=t.domSelectionRange(),b=m&&!f.contains(m.nodeType==1?m:m.parentNode)||a==m&&c==g;try{l.collapse(u,h),a&&(a!=u||c!=h)&&l.extend&&l.extend(a,c)}catch{}return p!=null&&(l.caretBidiLevel=p),b}):r.pos==r.start()||r.pos==r.end()}let ec=null,tc=null,nc=!1;function dv(t,e,n){return ec==e&&tc==n?nc:(ec=e,tc=n,nc=n=="up"||n=="down"?lv(t,e,n):cv(t,e,n))}const It=0,rc=1,Bn=2,qt=3;class xs{constructor(e,n,r,s){this.parent=e,this.children=n,this.dom=r,this.contentDOM=s,this.dirty=It,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,r=this.posAtStart;;n++){let s=this.children[n];if(s==e)return r;r+=s.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let i,o;if(e==this.contentDOM)i=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.previousSibling}for(;i&&!((o=i.pmViewDesc)&&o.parent==this);)i=i.previousSibling;return i?this.posBeforeChild(o)+o.size:this.posAtStart}else{let i,o;if(e==this.contentDOM)i=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.nextSibling}for(;i&&!((o=i.pmViewDesc)&&o.parent==this);)i=i.nextSibling;return i?this.posBeforeChild(o):this.posAtEnd}let s;if(e==this.dom&&this.contentDOM)s=n>Ke(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))s=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let i=e;;i=i.parentNode){if(i==this.dom){s=!1;break}if(i.previousSibling)break}if(s==null&&n==e.childNodes.length)for(let i=e;;i=i.parentNode){if(i==this.dom){s=!0;break}if(i.nextSibling)break}}return s??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,s=e;s;s=s.parentNode){let i=this.getDesc(s),o;if(i&&(!n||i.node))if(r&&(o=i.nodeDOM)&&!(o.nodeType==1?o.contains(e.nodeType==1?e:e.parentNode):o==e))r=!1;else return i}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let s=e;s;s=s.parentNode){let i=this.getDesc(s);if(i)return i.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let s=this.children[n],i=r+s.size;if(r==e&&i!=r){for(;!s.border&&s.children.length;)for(let o=0;o<s.children.length;o++){let l=s.children[o];if(l.size){s=l;break}}return s}if(e<i)return s.descAt(e-r-s.border);r=i}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,s=0;for(let i=0;r<this.children.length;r++){let o=this.children[r],l=i+o.size;if(l>e||o instanceof ju){s=e-i;break}i=l}if(s)return this.children[r].domFromPos(s-this.children[r].border,n);for(let i;r&&!(i=this.children[r-1]).size&&i instanceof Mu&&i.side>=0;r--);if(n<=0){let i,o=!0;for(;i=r?this.children[r-1]:null,!(!i||i.dom.parentNode==this.contentDOM);r--,o=!1);return i&&n&&o&&!i.border&&!i.domAtom?i.domFromPos(i.size,n):{node:this.contentDOM,offset:i?Ke(i.dom)+1:0}}else{let i,o=!0;for(;i=r<this.children.length?this.children[r]:null,!(!i||i.dom.parentNode==this.contentDOM);r++,o=!1);return i&&o&&!i.border&&!i.domAtom?i.domFromPos(0,n):{node:this.contentDOM,offset:i?Ke(i.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let s=-1,i=-1;for(let o=r,l=0;;l++){let a=this.children[l],c=o+a.size;if(s==-1&&e<=c){let u=o+a.border;if(e>=u&&n<=c-a.border&&a.node&&a.contentDOM&&this.contentDOM.contains(a.contentDOM))return a.parseRange(e,n,u);e=o;for(let h=l;h>0;h--){let p=this.children[h-1];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(1)){s=Ke(p.dom)+1;break}e-=p.size}s==-1&&(s=0)}if(s>-1&&(c>n||l==this.children.length-1)){n=c;for(let u=l+1;u<this.children.length;u++){let h=this.children[u];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(-1)){i=Ke(h.dom);break}n+=h.size}i==-1&&(i=this.contentDOM.childNodes.length);break}o=c}return{node:this.contentDOM,from:e,to:n,fromOffset:s,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,s=!1){let i=Math.min(e,n),o=Math.max(e,n);for(let f=0,m=0;f<this.children.length;f++){let g=this.children[f],b=m+g.size;if(i>m&&o<b)return g.setSelection(e-m-g.border,n-m-g.border,r,s);m=b}let l=this.domFromPos(e,e?-1:1),a=n==e?l:this.domFromPos(n,n?-1:1),c=r.root.getSelection(),u=r.domSelectionRange(),h=!1;if((jt||tt)&&e==n){let{node:f,offset:m}=l;if(f.nodeType==3){if(h=!!(m&&f.nodeValue[m-1]==`
|
|
23
|
-
`),h&&m==f.nodeValue.length)for(let g=f,b;g;g=g.parentNode){if(b=g.nextSibling){b.nodeName=="BR"&&(l=a={node:b.parentNode,offset:Ke(b)+1});break}let y=g.pmViewDesc;if(y&&y.node&&y.node.isBlock)break}}else{let g=f.childNodes[m-1];h=g&&(g.nodeName=="BR"||g.contentEditable=="false")}}if(jt&&u.focusNode&&u.focusNode!=a.node&&u.focusNode.nodeType==1){let f=u.focusNode.childNodes[u.focusOffset];f&&f.contentEditable=="false"&&(s=!0)}if(!(s||h&&tt)&&Qn(l.node,l.offset,u.anchorNode,u.anchorOffset)&&Qn(a.node,a.offset,u.focusNode,u.focusOffset))return;let p=!1;if((c.extend||e==n)&&!(h&&jt)){c.collapse(l.node,l.offset);try{e!=n&&c.extend(a.node,a.offset),p=!0}catch{}}if(!p){if(e>n){let m=l;l=a,a=m}let f=document.createRange();f.setEnd(a.node,a.offset),f.setStart(l.node,l.offset),c.removeAllRanges(),c.addRange(f)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,s=0;s<this.children.length;s++){let i=this.children[s],o=r+i.size;if(r==o?e<=o&&n>=r:e<o&&n>r){let l=r+i.border,a=o-i.border;if(e>=l&&n<=a){this.dirty=e==r||n==o?Bn:rc,e==l&&n==a&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=qt:i.markDirty(e-l,n-l);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?Bn:qt}r=o}this.dirty=Bn}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?Bn:rc;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class Mu extends xs{constructor(e,n,r,s){let i,o=n.type.toDOM;if(typeof o=="function"&&(o=o(r,()=>{if(!i)return s;if(i.parent)return i.parent.posBeforeChild(i)})),!n.type.spec.raw){if(o.nodeType!=1){let l=document.createElement("span");l.appendChild(o),o=l}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=n,this.widget=n,i=this}matchesWidget(e){return this.dirty==It&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class uv extends xs{constructor(e,n,r,s){super(e,[],n,null),this.textDOM=r,this.text=s}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class Xn extends xs{constructor(e,n,r,s,i){super(e,[],r,s),this.mark=n,this.spec=i}static create(e,n,r,s){let i=s.nodeViews[n.type.name],o=i&&i(n,s,r);return(!o||!o.dom)&&(o=tr.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new Xn(e,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&qt||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=qt&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=It){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=It}}slice(e,n,r){let s=Xn.create(this.parent,this.mark,!0,r),i=this.children,o=this.size;n<o&&(i=sl(i,n,o,r)),e>0&&(i=sl(i,0,e,r));for(let l=0;l<i.length;l++)i[l].parent=s;return s.children=i,s}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class kn extends xs{constructor(e,n,r,s,i,o,l,a,c){super(e,[],i,o),this.node=n,this.outerDeco=r,this.innerDeco=s,this.nodeDOM=l}static create(e,n,r,s,i,o){let l=i.nodeViews[n.type.name],a,c=l&&l(n,i,()=>{if(!a)return o;if(a.parent)return a.parent.posBeforeChild(a)},r,s),u=c&&c.dom,h=c&&c.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:h}=tr.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!h&&!n.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),n.type.spec.draggable&&(u.draggable=!0));let p=u;return u=Ou(u,r,n),c?a=new hv(e,n,r,s,u,h||null,p,c,i,o+1):n.isText?new qi(e,n,r,s,u,p,i):new kn(e,n,r,s,u,h||null,p,i,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>E.empty)}return e}matchesNode(e,n,r){return this.dirty==It&&e.eq(this.node)&&ei(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,s=n,i=e.composing?this.localCompositionInfo(e,n):null,o=i&&i.pos>-1?i:null,l=i&&i.pos<0,a=new pv(this,o&&o.node,e);bv(this.node,this.innerDeco,(c,u,h)=>{c.spec.marks?a.syncToMarks(c.spec.marks,r,e,u):c.type.side>=0&&!h&&a.syncToMarks(u==this.node.childCount?_e.none:this.node.child(u).marks,r,e,u),a.placeWidget(c,e,s)},(c,u,h,p)=>{a.syncToMarks(c.marks,r,e,p);let f;a.findNodeMatch(c,u,h,p)||l&&e.state.selection.from>s&&e.state.selection.to<s+c.nodeSize&&(f=a.findIndexWithChild(i.node))>-1&&a.updateNodeAt(c,u,h,f,e)||a.updateNextNode(c,u,h,e,p,s)||a.addNode(c,u,h,e,s),s+=c.nodeSize}),a.syncToMarks([],r,e,0),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||this.dirty==Bn)&&(o&&this.protectLocalComposition(e,o),Iu(this.contentDOM,this.children,e),yr&&yv(this.dom))}localCompositionInfo(e,n){let{from:r,to:s}=e.state.selection;if(!(e.state.selection instanceof X)||r<n||s>n+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let o=i.nodeValue,l=xv(this.node.content,o,r-n,s-n);return l<0?null:{node:i,pos:l,text:o}}else return{node:i,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:s}){if(this.getDesc(n))return;let i=n;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let o=new uv(this,i,n,s);e.input.compositionNodes.push(o),this.children=sl(this.children,r,r+s.length,e,o)}update(e,n,r,s){return this.dirty==qt||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,s),!0)}updateInner(e,n,r,s){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(s,this.posAtStart),this.dirty=It}updateOuterDeco(e){if(ei(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=Du(this.dom,this.nodeDOM,rl(this.outerDeco,this.node,n),rl(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function sc(t,e,n,r,s){Ou(r,e,t);let i=new kn(void 0,t,e,n,r,r,r,s,0);return i.contentDOM&&i.updateChildren(s,0),i}class qi extends kn{constructor(e,n,r,s,i,o,l){super(e,n,r,s,i,null,o,l,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,s){return this.dirty==qt||this.dirty!=It&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=It||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,s.trackWrites==this.nodeDOM&&(s.trackWrites=null)),this.node=e,this.dirty=It,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let s=this.node.cut(e,n),i=document.createTextNode(s.text);return new qi(this.parent,s,this.outerDeco,this.innerDeco,i,i,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=qt)}get domAtom(){return!1}isText(e){return this.node.text==e}}class ju extends xs{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==It&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class hv extends kn{constructor(e,n,r,s,i,o,l,a,c,u){super(e,n,r,s,i,o,l,c,u),this.spec=a}update(e,n,r,s){if(this.dirty==qt)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,n,r);return i&&this.updateInner(e,n,r,s),i}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,s)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,s){this.spec.setSelection?this.spec.setSelection(e,n,r.root):super.setSelection(e,n,r,s)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function Iu(t,e,n){let r=t.firstChild,s=!1;for(let i=0;i<e.length;i++){let o=e[i],l=o.dom;if(l.parentNode==t){for(;l!=r;)r=ic(r),s=!0;r=r.nextSibling}else s=!0,t.insertBefore(l,r);if(o instanceof Xn){let a=r?r.previousSibling:t.lastChild;Iu(o.contentDOM,o.children,n),r=a?a.nextSibling:t.firstChild}}for(;r;)r=ic(r),s=!0;s&&n.trackWrites==t&&(n.trackWrites=null)}const Ur=function(t){t&&(this.nodeName=t)};Ur.prototype=Object.create(null);const $n=[new Ur];function rl(t,e,n){if(t.length==0)return $n;let r=n?$n[0]:new Ur,s=[r];for(let i=0;i<t.length;i++){let o=t[i].type.attrs;if(o){o.nodeName&&s.push(r=new Ur(o.nodeName));for(let l in o){let a=o[l];a!=null&&(n&&s.length==1&&s.push(r=new Ur(e.isInline?"span":"div")),l=="class"?r.class=(r.class?r.class+" ":"")+a:l=="style"?r.style=(r.style?r.style+";":"")+a:l!="nodeName"&&(r[l]=a))}}}return s}function Du(t,e,n,r){if(n==$n&&r==$n)return e;let s=e;for(let i=0;i<r.length;i++){let o=r[i],l=n[i];if(i){let a;l&&l.nodeName==o.nodeName&&s!=t&&(a=s.parentNode)&&a.nodeName.toLowerCase()==o.nodeName||(a=document.createElement(o.nodeName),a.pmIsDeco=!0,a.appendChild(s),l=$n[0]),s=a}fv(s,l||$n[0],o)}return s}function fv(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],s=n.class?n.class.split(" ").filter(Boolean):[];for(let i=0;i<r.length;i++)s.indexOf(r[i])==-1&&t.classList.remove(r[i]);for(let i=0;i<s.length;i++)r.indexOf(s[i])==-1&&t.classList.add(s[i]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,s;for(;s=r.exec(e.style);)t.style.removeProperty(s[1])}n.style&&(t.style.cssText+=n.style)}}function Ou(t,e,n){return Du(t,t,$n,rl(e,n,t.nodeType!=1))}function ei(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function ic(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class pv{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=mv(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r,s){let i=0,o=this.stack.length>>1,l=Math.min(o,e.length);for(;i<l&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=It,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let a=-1,c=this.top.children.length;s<this.preMatch.index&&(c=Math.min(this.index+3,c));for(let u=this.index;u<c;u++){let h=this.top.children[u];if(h.matchesMark(e[o])&&!this.isLocked(h.dom)){a=u;break}}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let u=Xn.create(this.top,e[o],n,r);this.top.children.splice(this.index,0,u),this.top=u,this.changed=!0}this.index=0,o++}}findNodeMatch(e,n,r,s){let i=-1,o;if(s>=this.preMatch.index&&(o=this.preMatch.matches[s-this.preMatch.index]).parent==this.top&&o.matchesNode(e,n,r))i=this.top.children.indexOf(o,this.index);else for(let l=this.index,a=Math.min(this.top.children.length,l+5);l<a;l++){let c=this.top.children[l];if(c.matchesNode(e,n,r)&&!this.preMatch.matched.has(c)){i=l;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,n,r,s,i){let o=this.top.children[s];return o.dirty==qt&&o.dom==o.contentDOM&&(o.dirty=Bn),o.update(e,n,r,i)?(this.destroyBetween(this.index,s),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let s=this.index;s<this.top.children.length;s++)if(this.top.children[s]==r)return s}return-1}e=n}}updateNextNode(e,n,r,s,i,o){for(let l=this.index;l<this.top.children.length;l++){let a=this.top.children[l];if(a instanceof kn){let c=this.preMatch.matched.get(a);if(c!=null&&c!=i)return!1;let u=a.dom,h,p=this.isLocked(u)&&!(e.isText&&a.node&&a.node.isText&&a.nodeDOM.nodeValue==e.text&&a.dirty!=qt&&ei(n,a.outerDeco));if(!p&&a.update(e,n,r,s))return this.destroyBetween(this.index,l),a.dom!=u&&(this.changed=!0),this.index++,!0;if(!p&&(h=this.recreateWrapper(a,e,n,r,s,o)))return this.destroyBetween(this.index,l),this.top.children[this.index]=h,h.contentDOM&&(h.dirty=Bn,h.updateChildren(s,o+1),h.dirty=It),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,s,i,o){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!ei(r,e.outerDeco)||!s.eq(e.innerDeco))return null;let l=kn.create(this.top,n,r,s,i,o);if(l.contentDOM){l.children=e.children,e.children=[];for(let a of l.children)a.parent=l}return e.destroy(),l}addNode(e,n,r,s,i){let o=kn.create(this.top,e,n,r,s,i);o.contentDOM&&o.updateChildren(s,i+1),this.top.children.splice(this.index++,0,o),this.changed=!0}placeWidget(e,n,r){let s=this.index<this.top.children.length?this.top.children[this.index]:null;if(s&&s.matchesWidget(e)&&(e==s.widget||!s.widget.type.toDOM.parentNode))this.index++;else{let i=new Mu(this.top,e,n,r);this.top.children.splice(this.index++,0,i),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof Xn;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof qi)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((tt||Je)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let s=new ju(this.top,[],r,null);n!=this.top?n.children.push(s):n.children.splice(this.index++,0,s),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function mv(t,e){let n=e,r=n.children.length,s=t.childCount,i=new Map,o=[];e:for(;s>0;){let l;for(;;)if(r){let c=n.children[r-1];if(c instanceof Xn)n=c,r=c.children.length;else{l=c,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let a=l.node;if(a){if(a!=t.child(s-1))break;--s,i.set(l,s),o.push(l)}}return{index:s,matched:i,matches:o.reverse()}}function gv(t,e){return t.type.side-e.type.side}function bv(t,e,n,r){let s=e.locals(t),i=0;if(s.length==0){for(let c=0;c<t.childCount;c++){let u=t.child(c);r(u,s,e.forChild(i,u),c),i+=u.nodeSize}return}let o=0,l=[],a=null;for(let c=0;;){let u,h;for(;o<s.length&&s[o].to==i;){let b=s[o++];b.widget&&(u?(h||(h=[u])).push(b):u=b)}if(u)if(h){h.sort(gv);for(let b=0;b<h.length;b++)n(h[b],c,!!a)}else n(u,c,!!a);let p,f;if(a)f=-1,p=a,a=null;else if(c<t.childCount)f=c,p=t.child(c++);else break;for(let b=0;b<l.length;b++)l[b].to<=i&&l.splice(b--,1);for(;o<s.length&&s[o].from<=i&&s[o].to>i;)l.push(s[o++]);let m=i+p.nodeSize;if(p.isText){let b=m;o<s.length&&s[o].from<b&&(b=s[o].from);for(let y=0;y<l.length;y++)l[y].to<b&&(b=l[y].to);b<m&&(a=p.cut(b-i),p=p.cut(0,b-i),m=b,f=-1)}else for(;o<s.length&&s[o].to<m;)o++;let g=p.isInline&&!p.isLeaf?l.filter(b=>!b.inline):l.slice();r(p,g,e.forChild(i,p),f),i=m}}function yv(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function xv(t,e,n,r){for(let s=0,i=0;s<t.childCount&&i<=r;){let o=t.child(s++),l=i;if(i+=o.nodeSize,!o.isText)continue;let a=o.text;for(;s<t.childCount;){let c=t.child(s++);if(i+=c.nodeSize,!c.isText)break;a+=c.text}if(i>=n){if(i>=r&&a.slice(r-e.length-l,r-l)==e)return r-e.length;let c=l<r?a.lastIndexOf(e,r-l-1):-1;if(c>=0&&c+e.length+l>=n)return l+c;if(n==r&&a.length>=r+e.length-l&&a.slice(r-l,r-l+e.length)==e)return r}}return-1}function sl(t,e,n,r,s){let i=[];for(let o=0,l=0;o<t.length;o++){let a=t[o],c=l,u=l+=a.size;c>=n||u<=e?i.push(a):(c<e&&i.push(a.slice(0,e-c,r)),s&&(i.push(s),s=void 0),u>n&&i.push(a.slice(n-c,a.size,r)))}return i}function Bl(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let s=t.docView.nearestDesc(n.focusNode),i=s&&s.size==0,o=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let l=r.resolve(o),a,c;if(Vi(n)){for(a=o;s&&!s.node;)s=s.parent;let h=s.node;if(s&&h.isAtom&&J.isSelectable(h)&&s.parent&&!(h.isInline&&U1(n.focusNode,n.focusOffset,s.dom))){let p=s.posBefore;c=new J(o==p?l:r.resolve(p))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let h=o,p=o;for(let f=0;f<n.rangeCount;f++){let m=n.getRangeAt(f);h=Math.min(h,t.docView.posFromDOM(m.startContainer,m.startOffset,1)),p=Math.max(p,t.docView.posFromDOM(m.endContainer,m.endOffset,-1))}if(h<0)return null;[a,o]=p==t.state.selection.anchor?[p,h]:[h,p],l=r.resolve(o)}else a=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(a<0)return null}let u=r.resolve(a);if(!c){let h=e=="pointer"||t.state.selection.head<l.pos&&!i?1:-1;c=$l(t,u,l,h)}return c}function Ru(t){return t.editable?t.hasFocus():Bu(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function on(t,e=!1){let n=t.state.selection;if(Lu(t,n),!!Ru(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&Je){let r=t.domSelectionRange(),s=t.domObserver.currentSelection;if(r.anchorNode&&s.anchorNode&&Qn(r.anchorNode,r.anchorOffset,s.anchorNode,s.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)_v(t);else{let{anchor:r,head:s}=n,i,o;oc&&!(n instanceof X)&&(n.$from.parent.inlineContent||(i=lc(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(o=lc(t,n.to))),t.docView.setSelection(r,s,t,e),oc&&(i&&ac(i),o&&ac(o)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&vv(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const oc=tt||Je&&ku<63;function lc(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),s=r<n.childNodes.length?n.childNodes[r]:null,i=r?n.childNodes[r-1]:null;if(tt&&s&&s.contentEditable=="false")return vo(s);if((!s||s.contentEditable=="false")&&(!i||i.contentEditable=="false")){if(s)return vo(s);if(i)return vo(i)}}function vo(t){return t.contentEditable="true",tt&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function ac(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function vv(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,s=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=s)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!Ru(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function _v(t){let e=t.domSelection();if(!e)return;let n=t.cursorWrapper.dom,r=n.nodeName=="IMG";r?e.collapse(n.parentNode,Ke(n)+1):e.collapse(n,0),!r&&!t.state.selection.visible&&ut&&_n<=11&&(n.disabled=!0,n.disabled=!1)}function Lu(t,e){if(e instanceof J){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(cc(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else cc(t)}function cc(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function $l(t,e,n,r){return t.someProp("createSelectionBetween",s=>s(t,e,n))||X.between(e,n,r)}function dc(t){return t.editable&&!t.hasFocus()?!1:Bu(t)}function Bu(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function kv(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return Qn(e.node,e.offset,n.anchorNode,n.anchorOffset)}function il(t,e){let{$anchor:n,$head:r}=t.selection,s=e>0?n.max(r):n.min(r),i=s.parent.inlineContent?s.depth?t.doc.resolve(e>0?s.after():s.before()):null:s;return i&&le.findFrom(i,e)}function fn(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function uc(t,e,n){let r=t.state.selection;if(r instanceof X)if(n.indexOf("s")>-1){let{$head:s}=r,i=s.textOffset?null:e<0?s.nodeBefore:s.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let o=t.state.doc.resolve(s.pos+i.nodeSize*(e<0?-1:1));return fn(t,new X(r.$anchor,o))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let s=il(t.state,e);return s&&s instanceof J?fn(t,s):!1}else if(!(Tt&&n.indexOf("m")>-1)){let s=r.$head,i=s.textOffset?null:e<0?s.nodeBefore:s.nodeAfter,o;if(!i||i.isText)return!1;let l=e<0?s.pos-i.nodeSize:s.pos;return i.isAtom||(o=t.docView.descAt(l))&&!o.contentDOM?J.isSelectable(i)?fn(t,new J(e<0?t.state.doc.resolve(s.pos-i.nodeSize):s)):ys?fn(t,new X(t.state.doc.resolve(e<0?l:l+i.nodeSize))):!1:!1}}else return!1;else{if(r instanceof J&&r.node.isInline)return fn(t,new X(e>0?r.$to:r.$from));{let s=il(t.state,e);return s?fn(t,s):!1}}}function ti(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Kr(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function lr(t,e){return e<0?wv(t):Cv(t)}function wv(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let s,i,o=!1;for(jt&&n.nodeType==1&&r<ti(n)&&Kr(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(n.nodeType!=1)break;{let l=n.childNodes[r-1];if(Kr(l,-1))s=n,i=--r;else if(l.nodeType==3)n=l,r=n.nodeValue.length;else break}}else{if($u(n))break;{let l=n.previousSibling;for(;l&&Kr(l,-1);)s=n.parentNode,i=Ke(l),l=l.previousSibling;if(l)n=l,r=ti(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}o?ol(t,n,r):s&&ol(t,s,i)}function Cv(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let s=ti(n),i,o;for(;;)if(r<s){if(n.nodeType!=1)break;let l=n.childNodes[r];if(Kr(l,1))i=n,o=++r;else break}else{if($u(n))break;{let l=n.nextSibling;for(;l&&Kr(l,1);)i=l.parentNode,o=Ke(l)+1,l=l.nextSibling;if(l)n=l,r=0,s=ti(n);else{if(n=n.parentNode,n==t.dom)break;r=s=0}}}i&&ol(t,i,o)}function $u(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function Sv(t,e){for(;t&&e==t.childNodes.length&&!bs(t);)e=Ke(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=0}}function Nv(t,e){for(;t&&!e&&!bs(t);)e=Ke(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=t.childNodes.length}}function ol(t,e,n){if(e.nodeType!=3){let i,o;(o=Sv(e,n))?(e=o,n=0):(i=Nv(e,n))&&(e=i,n=i.nodeValue.length)}let r=t.domSelection();if(!r)return;if(Vi(r)){let i=document.createRange();i.setEnd(e,n),i.setStart(e,n),r.removeAllRanges(),r.addRange(i)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:s}=t;setTimeout(()=>{t.state==s&&on(t)},50)}function hc(t,e){let n=t.state.doc.resolve(e);if(!(Je||wu)&&n.parent.inlineContent){let s=t.coordsAtPos(e);if(e>n.start()){let i=t.coordsAtPos(e-1),o=(i.top+i.bottom)/2;if(o>s.top&&o<s.bottom&&Math.abs(i.left-s.left)>1)return i.left<s.left?"ltr":"rtl"}if(e<n.end()){let i=t.coordsAtPos(e+1),o=(i.top+i.bottom)/2;if(o>s.top&&o<s.bottom&&Math.abs(i.left-s.left)>1)return i.left>s.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function fc(t,e,n){let r=t.state.selection;if(r instanceof X&&!r.empty||n.indexOf("s")>-1||Tt&&n.indexOf("m")>-1)return!1;let{$from:s,$to:i}=r;if(!s.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let o=il(t.state,e);if(o&&o instanceof J)return fn(t,o)}if(!s.parent.inlineContent){let o=e<0?s:i,l=r instanceof xt?le.near(o,e):le.findFrom(o,e);return l?fn(t,l):!1}return!1}function pc(t,e){if(!(t.state.selection instanceof X))return!0;let{$head:n,$anchor:r,empty:s}=t.state.selection;if(!n.sameParent(r))return!0;if(!s)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let i=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let o=t.state.tr;return e<0?o.delete(n.pos-i.nodeSize,n.pos):o.delete(n.pos,n.pos+i.nodeSize),t.dispatch(o),!0}return!1}function mc(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function Av(t){if(!tt||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;mc(t,r,"true"),setTimeout(()=>mc(t,r,"false"),20)}return!1}function Tv(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function Ev(t,e){let n=e.keyCode,r=Tv(e);if(n==8||Tt&&n==72&&r=="c")return pc(t,-1)||lr(t,-1);if(n==46&&!e.shiftKey||Tt&&n==68&&r=="c")return pc(t,1)||lr(t,1);if(n==13||n==27)return!0;if(n==37||Tt&&n==66&&r=="c"){let s=n==37?hc(t,t.state.selection.from)=="ltr"?-1:1:-1;return uc(t,s,r)||lr(t,s)}else if(n==39||Tt&&n==70&&r=="c"){let s=n==39?hc(t,t.state.selection.from)=="ltr"?1:-1:1;return uc(t,s,r)||lr(t,s)}else{if(n==38||Tt&&n==80&&r=="c")return fc(t,-1,r)||lr(t,-1);if(n==40||Tt&&n==78&&r=="c")return Av(t)||fc(t,1,r)||lr(t,1);if(r==(Tt?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function Pl(t,e){t.someProp("transformCopied",f=>{e=f(e,t)});let n=[],{content:r,openStart:s,openEnd:i}=e;for(;s>1&&i>1&&r.childCount==1&&r.firstChild.childCount==1;){s--,i--;let f=r.firstChild;n.push(f.type.name,f.attrs!=f.type.defaultAttrs?f.attrs:null),r=f.content}let o=t.someProp("clipboardSerializer")||tr.fromSchema(t.state.schema),l=Vu(),a=l.createElement("div");a.appendChild(o.serializeFragment(r,{document:l}));let c=a.firstChild,u,h=0;for(;c&&c.nodeType==1&&(u=Wu[c.nodeName.toLowerCase()]);){for(let f=u.length-1;f>=0;f--){let m=l.createElement(u[f]);for(;a.firstChild;)m.appendChild(a.firstChild);a.appendChild(m),h++}c=a.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${s} ${i}${h?` -${h}`:""} ${JSON.stringify(n)}`);let p=t.someProp("clipboardTextSerializer",f=>f(e,t))||e.content.textBetween(0,e.content.size,`
|
|
24
|
-
|
|
25
|
-
`);return{dom:a,text:p,slice:e}}function Pu(t,e,n,r,s){let i=s.parent.type.spec.code,o,l;if(!n&&!e)return null;let a=!!e&&(r||i||!n);if(a){if(t.someProp("transformPastedText",p=>{e=p(e,i||r,t)}),i)return l=new F(
|
|
26
|
-
`))),0,0),t.someProp("transformPasted",p=>{l=p(l,t,!0)}),l;let h=t.someProp("clipboardTextParser",p=>p(e,s,r,t));if(h)l=h;else{let p=s.marks(),{schema:f}=t.state,m=tr.fromSchema(f);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(g=>{let b=o.appendChild(document.createElement("p"));g&&b.appendChild(m.serializeNode(f.text(g,p)))})}}else t.someProp("transformPastedHTML",h=>{n=h(n,t)}),o=Dv(n),ys&&Ov(o);let c=o&&o.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let h=+u[3];h>0;h--){let p=o.firstChild;for(;p&&p.nodeType!=1;)p=p.nextSibling;if(!p)break;o=p}if(l||(l=(t.someProp("clipboardParser")||t.someProp("domParser")||vn.fromSchema(t.state.schema)).parseSlice(o,{preserveWhitespace:!!(a||u),context:s,ruleFromNode(p){return p.nodeName=="BR"&&!p.nextSibling&&p.parentNode&&!Mv.test(p.parentNode.nodeName)?{ignore:!0}:null}})),u)l=Rv(gc(l,+u[1],+u[2]),u[4]);else if(l=F.maxOpen(jv(l.content,s),!0),l.openStart||l.openEnd){let h=0,p=0;for(let f=l.content.firstChild;h<l.openStart&&!f.type.spec.isolating;h++,f=f.firstChild);for(let f=l.content.lastChild;p<l.openEnd&&!f.type.spec.isolating;p++,f=f.lastChild);l=gc(l,h,p)}return t.someProp("transformPasted",h=>{l=h(l,t,a)}),l}const Mv=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function jv(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let s=e.node(n).contentMatchAt(e.index(n)),i,o=[];if(t.forEach(l=>{if(!o)return;let a=s.findWrapping(l.type),c;if(!a)return o=null;if(c=o.length&&i.length&&Fu(a,i,l,o[o.length-1],0))o[o.length-1]=c;else{o.length&&(o[o.length-1]=Hu(o[o.length-1],i.length));let u=zu(l,a);o.push(u),s=s.matchType(u.type),i=a}}),o)return E.from(o)}return t}function zu(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,E.from(t));return t}function Fu(t,e,n,r,s){if(s<t.length&&s<e.length&&t[s]==e[s]){let i=Fu(t,e,n,r.lastChild,s+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(s==t.length-1?n.type:t[s+1]))return r.copy(r.content.append(E.from(zu(n,t,s+1))))}}function Hu(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,Hu(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(E.empty,!0);return t.copy(n.append(r))}function ll(t,e,n,r,s,i){let o=e<0?t.firstChild:t.lastChild,l=o.content;return t.childCount>1&&(i=0),s<r-1&&(l=ll(l,e,n,r,s+1,i)),s>=n&&(l=e<0?o.contentMatchAt(0).fillBefore(l,i<=s).append(l):l.append(o.contentMatchAt(o.childCount).fillBefore(E.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,o.copy(l))}function gc(t,e,n){return e<t.openStart&&(t=new F(ll(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new F(ll(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const Wu={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let bc=null;function Vu(){return bc||(bc=document.implementation.createHTMLDocument("title"))}let _o=null;function Iv(t){let e=window.trustedTypes;return e?(_o||(_o=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),_o.createHTML(t)):t}function Dv(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=Vu().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),s;if((s=r&&Wu[r[1].toLowerCase()])&&(t=s.map(i=>"<"+i+">").join("")+t+s.map(i=>"</"+i+">").reverse().join("")),n.innerHTML=Iv(t),s)for(let i=0;i<s.length;i++)n=n.querySelector(s[i])||n;return n}function Ov(t){let e=t.querySelectorAll(Je?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function Rv(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:s,openStart:i,openEnd:o}=t;for(let l=r.length-2;l>=0;l-=2){let a=n.nodes[r[l]];if(!a||a.hasRequiredAttrs())break;s=E.from(a.create(r[l+1],s)),i++,o++}return new F(s,i,o)}const st={},it={},Lv={touchstart:!0,touchmove:!0};class Bv{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function $v(t){for(let e in st){let n=st[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{zv(t,r)&&!zl(t,r)&&(t.editable||!(r.type in it))&&n(t,r)},Lv[e]?{passive:!0}:void 0)}tt&&t.dom.addEventListener("input",()=>null),al(t)}function xn(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function Pv(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function al(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>zl(t,r))})}function zl(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function zv(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function Fv(t,e){!zl(t,e)&&st[e.type]&&(t.editable||!(e.type in it))&&st[e.type](t,e)}it.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!Uu(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(rn&&Je&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),yr&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",s=>s(t,Ln(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||Ev(t,n)?n.preventDefault():xn(t,"key")};it.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};it.keypress=(t,e)=>{let n=e;if(Uu(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Tt&&n.metaKey)return;if(t.someProp("handleKeyPress",s=>s(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof X)||!r.$from.sameParent(r.$to)){let s=String.fromCharCode(n.charCode),i=()=>t.state.tr.insertText(s).scrollIntoView();!/[\r\n]/.test(s)&&!t.someProp("handleTextInput",o=>o(t,r.$from.pos,r.$to.pos,s,i))&&t.dispatch(i()),n.preventDefault()}};function Ui(t){return{left:t.clientX,top:t.clientY}}function Hv(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function Fl(t,e,n,r,s){if(r==-1)return!1;let i=t.state.doc.resolve(r);for(let o=i.depth+1;o>0;o--)if(t.someProp(e,l=>o>i.depth?l(t,n,i.nodeAfter,i.before(o),s,!0):l(t,n,i.node(o),i.before(o),s,!1)))return!0;return!1}function fr(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function Wv(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&J.isSelectable(r)?(fr(t,new J(n)),!0):!1}function Vv(t,e){if(e==-1)return!1;let n=t.state.selection,r,s;n instanceof J&&(r=n.node);let i=t.state.doc.resolve(e);for(let o=i.depth+1;o>0;o--){let l=o>i.depth?i.nodeAfter:i.node(o);if(J.isSelectable(l)){r&&n.$from.depth>0&&o>=n.$from.depth&&i.before(n.$from.depth+1)==n.$from.pos?s=i.before(n.$from.depth):s=i.before(o);break}}return s!=null?(fr(t,J.create(t.state.doc,s)),!0):!1}function qv(t,e,n,r,s){return Fl(t,"handleClickOn",e,n,r)||t.someProp("handleClick",i=>i(t,e,r))||(s?Vv(t,n):Wv(t,n))}function Uv(t,e,n,r){return Fl(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",s=>s(t,e,r))}function Kv(t,e,n,r){return Fl(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",s=>s(t,e,r))||Gv(t,n,r)}function Gv(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(fr(t,X.create(r,0,r.content.size)),!0):!1;let s=r.resolve(e);for(let i=s.depth+1;i>0;i--){let o=i>s.depth?s.nodeAfter:s.node(i),l=s.before(i);if(o.inlineContent)fr(t,X.create(r,l+1,l+1+o.content.size));else if(J.isSelectable(o))fr(t,J.create(r,l));else continue;return!0}}function Hl(t){return ni(t)}const qu=Tt?"metaKey":"ctrlKey";st.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Hl(t),s=Date.now(),i="singleClick";s-t.input.lastClick.time<500&&Hv(n,t.input.lastClick)&&!n[qu]&&t.input.lastClick.button==n.button&&(t.input.lastClick.type=="singleClick"?i="doubleClick":t.input.lastClick.type=="doubleClick"&&(i="tripleClick")),t.input.lastClick={time:s,x:n.clientX,y:n.clientY,type:i,button:n.button};let o=t.posAtCoords(Ui(n));o&&(i=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new Jv(t,o,n,!!r)):(i=="doubleClick"?Uv:Kv)(t,o.pos,o.inside,n)?n.preventDefault():xn(t,"pointer"))};class Jv{constructor(e,n,r,s){this.view=e,this.pos=n,this.event=r,this.flushed=s,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[qu],this.allowDefault=r.shiftKey;let i,o;if(n.inside>-1)i=e.state.doc.nodeAt(n.inside),o=n.inside;else{let u=e.state.doc.resolve(n.pos);i=u.parent,o=u.depth?u.before():0}const l=s?null:r.target,a=l?e.docView.nearestDesc(l,!0):null;this.target=a&&a.nodeDOM.nodeType==1?a.nodeDOM:null;let{selection:c}=e.state;r.button==0&&(i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof J&&c.from<=o&&c.to>o)&&(this.mightDrag={node:i,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&jt&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),xn(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>on(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Ui(e))),this.updateAllowDefault(e),this.allowDefault||!n?xn(this.view,"pointer"):qv(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||tt&&this.mightDrag&&!this.mightDrag.node.isAtom||Je&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(fr(this.view,le.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):xn(this.view,"pointer")}move(e){this.updateAllowDefault(e),xn(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}st.touchstart=t=>{t.input.lastTouch=Date.now(),Hl(t),xn(t,"pointer")};st.touchmove=t=>{t.input.lastTouch=Date.now(),xn(t,"pointer")};st.contextmenu=t=>Hl(t);function Uu(t,e){return t.composing?!0:tt&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const Yv=rn?5e3:-1;it.compositionstart=it.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof X&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||Je&&wu&&Qv(t)))t.markCursor=t.state.storedMarks||n.marks(),ni(t,!0),t.markCursor=null;else if(ni(t,!e.selection.empty),jt&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let s=r.focusNode,i=r.focusOffset;s&&s.nodeType==1&&i!=0;){let o=i<0?s.lastChild:s.childNodes[i-1];if(!o)break;if(o.nodeType==3){let l=t.domSelection();l&&l.collapse(o,o.nodeValue.length);break}else s=o,i=-1}}t.input.composing=!0}Ku(t,Yv)};function Qv(t){let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(!e||e.nodeType!=1||n>=e.childNodes.length)return!1;let r=e.childNodes[n];return r.nodeType==1&&r.contentEditable=="false"}it.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.badSafariComposition?t.domObserver.forceFlush():t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,Ku(t,20))};function Ku(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>ni(t),e))}function Gu(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Zv());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function Xv(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=V1(e.focusNode,e.focusOffset),r=q1(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let s=r.pmViewDesc,i=t.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!s||!s.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let o=n.pmViewDesc;if(!(!o||!o.isText(n.nodeValue)))return r}}return n||r}function Zv(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function ni(t,e=!1){if(!(rn&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Gu(t),e||t.docView&&t.docView.dirty){let n=Bl(t),r=t.state.selection;return n&&!n.eq(r)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function e0(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),s=document.createRange();s.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(s),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const is=ut&&_n<15||yr&&J1<604;st.copy=it.cut=(t,e)=>{let n=e,r=t.state.selection,s=n.type=="cut";if(r.empty)return;let i=is?null:n.clipboardData,o=r.content(),{dom:l,text:a}=Pl(t,o);i?(n.preventDefault(),i.clearData(),i.setData("text/html",l.innerHTML),i.setData("text/plain",a)):e0(t,l),s&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function t0(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function n0(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let s=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?ls(t,r.value,null,s,e):ls(t,r.textContent,r.innerHTML,s,e)},50)}function ls(t,e,n,r,s){let i=Pu(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",a=>a(t,s,i||F.empty)))return!0;if(!i)return!1;let o=t0(i),l=o?t.state.tr.replaceSelectionWith(o,r):t.state.tr.replaceSelection(i);return t.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Ju(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}it.paste=(t,e)=>{let n=e;if(t.composing&&!rn)return;let r=is?null:n.clipboardData,s=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&ls(t,Ju(r),r.getData("text/html"),s,n)?n.preventDefault():n0(t,n)};class Yu{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const r0=Tt?"altKey":"ctrlKey";function Qu(t,e){let n;return t.someProp("dragCopies",r=>{n=n||r(e)}),n!=null?!n:!e[r0]}st.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let s=t.state.selection,i=s.empty?null:t.posAtCoords(Ui(n)),o;if(!(i&&i.pos>=s.from&&i.pos<=(s instanceof J?s.to-1:s.to))){if(r&&r.mightDrag)o=J.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let h=t.docView.nearestDesc(n.target,!0);h&&h.node.type.spec.draggable&&h!=t.docView&&(o=J.create(t.state.doc,h.posBefore))}}let l=(o||t.state.selection).content(),{dom:a,text:c,slice:u}=Pl(t,l);(!n.dataTransfer.files.length||!Je||ku>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(is?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",is||n.dataTransfer.setData("text/plain",c),t.dragging=new Yu(u,Qu(t,n),o)};st.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};it.dragover=it.dragenter=(t,e)=>e.preventDefault();it.drop=(t,e)=>{try{s0(t,e,t.dragging)}finally{t.dragging=null}};function s0(t,e,n){if(!e.dataTransfer)return;let r=t.posAtCoords(Ui(e));if(!r)return;let s=t.state.doc.resolve(r.pos),i=n&&n.slice;i?t.someProp("transformPasted",f=>{i=f(i,t,!1)}):i=Pu(t,Ju(e.dataTransfer),is?null:e.dataTransfer.getData("text/html"),!1,s);let o=!!(n&&Qu(t,e));if(t.someProp("handleDrop",f=>f(t,e,i||F.empty,o))){e.preventDefault();return}if(!i)return;e.preventDefault();let l=i?eu(t.state.doc,s.pos,i):s.pos;l==null&&(l=s.pos);let a=t.state.tr;if(o){let{node:f}=n;f?f.replace(a):a.deleteSelection()}let c=a.mapping.map(l),u=i.openStart==0&&i.openEnd==0&&i.content.childCount==1,h=a.doc;if(u?a.replaceRangeWith(c,c,i.content.firstChild):a.replaceRange(c,c,i),a.doc.eq(h))return;let p=a.doc.resolve(c);if(u&&J.isSelectable(i.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(i.content.firstChild))a.setSelection(new J(p));else{let f=a.mapping.map(l);a.mapping.maps[a.mapping.maps.length-1].forEach((m,g,b,y)=>f=y),a.setSelection($l(t,p,a.doc.resolve(f)))}t.focus(),t.dispatch(a.setMeta("uiEvent","drop"))}st.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&on(t)},20))};st.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};st.beforeinput=(t,e)=>{if(Je&&rn&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",i=>i(t,Ln(8,"Backspace")))))return;let{$cursor:s}=t.state.selection;s&&s.pos>0&&t.dispatch(t.state.tr.delete(s.pos-1,s.pos).scrollIntoView())},50)}};for(let t in it)st[t]=it[t];function as(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class ri{constructor(e,n){this.toDOM=e,this.spec=n||qn,this.side=this.spec.side||0}map(e,n,r,s){let{pos:i,deleted:o}=e.mapResult(n.from+s,this.side<0?-1:1);return o?null:new et(i-r,i-r,this)}valid(){return!0}eq(e){return this==e||e instanceof ri&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&as(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class wn{constructor(e,n){this.attrs=e,this.spec=n||qn}map(e,n,r,s){let i=e.map(n.from+s,this.spec.inclusiveStart?-1:1)-r,o=e.map(n.to+s,this.spec.inclusiveEnd?1:-1)-r;return i>=o?null:new et(i,o,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof wn&&as(this.attrs,e.attrs)&&as(this.spec,e.spec)}static is(e){return e.type instanceof wn}destroy(){}}class Wl{constructor(e,n){this.attrs=e,this.spec=n||qn}map(e,n,r,s){let i=e.mapResult(n.from+s,1);if(i.deleted)return null;let o=e.mapResult(n.to+s,-1);return o.deleted||o.pos<=i.pos?null:new et(i.pos-r,o.pos-r,this)}valid(e,n){let{index:r,offset:s}=e.content.findIndex(n.from),i;return s==n.from&&!(i=e.child(r)).isText&&s+i.nodeSize==n.to}eq(e){return this==e||e instanceof Wl&&as(this.attrs,e.attrs)&&as(this.spec,e.spec)}destroy(){}}class et{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new et(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,r){return this.type.map(e,this,n,r)}static widget(e,n,r){return new et(e,e,new ri(n,r))}static inline(e,n,r,s){return new et(e,n,new wn(r,s))}static node(e,n,r,s){return new et(e,n,new Wl(r,s))}get spec(){return this.type.spec}get inline(){return this.type instanceof wn}get widget(){return this.type instanceof ri}}const cr=[],qn={};class Ne{constructor(e,n){this.local=e.length?e:cr,this.children=n.length?n:cr}static create(e,n){return n.length?si(n,e,0,qn):Ze}find(e,n,r){let s=[];return this.findInner(e??0,n??1e9,s,0,r),s}findInner(e,n,r,s,i){for(let o=0;o<this.local.length;o++){let l=this.local[o];l.from<=n&&l.to>=e&&(!i||i(l.spec))&&r.push(l.copy(l.from+s,l.to+s))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<n&&this.children[o+1]>e){let l=this.children[o]+1;this.children[o+2].findInner(e-l,n-l,r,s+l,i)}}map(e,n,r){return this==Ze||e.maps.length==0?this:this.mapInner(e,n,0,0,r||qn)}mapInner(e,n,r,s,i){let o;for(let l=0;l<this.local.length;l++){let a=this.local[l].map(e,r,s);a&&a.type.valid(n,a)?(o||(o=[])).push(a):i.onRemove&&i.onRemove(this.local[l].spec)}return this.children.length?i0(this.children,o||[],e,n,r,s,i):o?new Ne(o.sort(Un),cr):Ze}add(e,n){return n.length?this==Ze?Ne.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let s,i=0;e.forEach((l,a)=>{let c=a+r,u;if(u=Zu(n,l,c)){for(s||(s=this.children.slice());i<s.length&&s[i]<a;)i+=3;s[i]==a?s[i+2]=s[i+2].addInner(l,u,c+1):s.splice(i,0,a,a+l.nodeSize,si(u,l,c+1,qn)),i+=3}});let o=Xu(i?eh(n):n,-r);for(let l=0;l<o.length;l++)o[l].type.valid(e,o[l])||o.splice(l--,1);return new Ne(o.length?this.local.concat(o).sort(Un):this.local,s||this.children)}remove(e){return e.length==0||this==Ze?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,s=this.local;for(let i=0;i<r.length;i+=3){let o,l=r[i]+n,a=r[i+1]+n;for(let u=0,h;u<e.length;u++)(h=e[u])&&h.from>l&&h.to<a&&(e[u]=null,(o||(o=[])).push(h));if(!o)continue;r==this.children&&(r=this.children.slice());let c=r[i+2].removeInner(o,l+1);c!=Ze?r[i+2]=c:(r.splice(i,3),i-=3)}if(s.length){for(let i=0,o;i<e.length;i++)if(o=e[i])for(let l=0;l<s.length;l++)s[l].eq(o,n)&&(s==this.local&&(s=this.local.slice()),s.splice(l--,1))}return r==this.children&&s==this.local?this:s.length||r.length?new Ne(s,r):Ze}forChild(e,n){if(this==Ze)return this;if(n.isLeaf)return Ne.empty;let r,s;for(let l=0;l<this.children.length;l+=3)if(this.children[l]>=e){this.children[l]==e&&(r=this.children[l+2]);break}let i=e+1,o=i+n.content.size;for(let l=0;l<this.local.length;l++){let a=this.local[l];if(a.from<o&&a.to>i&&a.type instanceof wn){let c=Math.max(i,a.from)-i,u=Math.min(o,a.to)-i;c<u&&(s||(s=[])).push(a.copy(c,u))}}if(s){let l=new Ne(s.sort(Un),cr);return r?new gn([l,r]):l}return r||Ze}eq(e){if(this==e)return!0;if(!(e instanceof Ne)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return Vl(this.localsInner(e))}localsInner(e){if(this==Ze)return cr;if(e.inlineContent||!this.local.some(wn.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof wn||n.push(this.local[r]);return n}forEachSet(e){e(this)}}Ne.empty=new Ne([],[]);Ne.removeOverlap=Vl;const Ze=Ne.empty;class gn{constructor(e){this.members=e}map(e,n){const r=this.members.map(s=>s.map(e,n,qn));return gn.from(r)}forChild(e,n){if(n.isLeaf)return Ne.empty;let r=[];for(let s=0;s<this.members.length;s++){let i=this.members[s].forChild(e,n);i!=Ze&&(i instanceof gn?r=r.concat(i.members):r.push(i))}return gn.from(r)}eq(e){if(!(e instanceof gn)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let s=0;s<this.members.length;s++){let i=this.members[s].localsInner(e);if(i.length)if(!n)n=i;else{r&&(n=n.slice(),r=!1);for(let o=0;o<i.length;o++)n.push(i[o])}}return n?Vl(r?n:n.sort(Un)):cr}static from(e){switch(e.length){case 0:return Ze;case 1:return e[0];default:return new gn(e.every(n=>n instanceof Ne)?e:e.reduce((n,r)=>n.concat(r instanceof Ne?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function i0(t,e,n,r,s,i,o){let l=t.slice();for(let c=0,u=i;c<n.maps.length;c++){let h=0;n.maps[c].forEach((p,f,m,g)=>{let b=g-m-(f-p);for(let y=0;y<l.length;y+=3){let v=l[y+1];if(v<0||p>v+u-h)continue;let _=l[y]+u-h;f>=_?l[y+1]=p<=_?-2:-1:p>=u&&b&&(l[y]+=b,l[y+1]+=b)}h+=b}),u=n.maps[c].map(u,-1)}let a=!1;for(let c=0;c<l.length;c+=3)if(l[c+1]<0){if(l[c+1]==-2){a=!0,l[c+1]=-1;continue}let u=n.map(t[c]+i),h=u-s;if(h<0||h>=r.content.size){a=!0;continue}let p=n.map(t[c+1]+i,-1),f=p-s,{index:m,offset:g}=r.content.findIndex(h),b=r.maybeChild(m);if(b&&g==h&&g+b.nodeSize==f){let y=l[c+2].mapInner(n,b,u+1,t[c]+i+1,o);y!=Ze?(l[c]=h,l[c+1]=f,l[c+2]=y):(l[c+1]=-2,a=!0)}else a=!0}if(a){let c=o0(l,t,e,n,s,i,o),u=si(c,r,0,o);e=u.local;for(let h=0;h<l.length;h+=3)l[h+1]<0&&(l.splice(h,3),h-=3);for(let h=0,p=0;h<u.children.length;h+=3){let f=u.children[h];for(;p<l.length&&l[p]<f;)p+=3;l.splice(p,0,u.children[h],u.children[h+1],u.children[h+2])}}return new Ne(e.sort(Un),l)}function Xu(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let s=t[r];n.push(new et(s.from+e,s.to+e,s.type))}return n}function o0(t,e,n,r,s,i,o){function l(a,c){for(let u=0;u<a.local.length;u++){let h=a.local[u].map(r,s,c);h?n.push(h):o.onRemove&&o.onRemove(a.local[u].spec)}for(let u=0;u<a.children.length;u+=3)l(a.children[u+2],a.children[u]+c+1)}for(let a=0;a<t.length;a+=3)t[a+1]==-1&&l(t[a+2],e[a]+i+1);return n}function Zu(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,s=null;for(let i=0,o;i<t.length;i++)(o=t[i])&&o.from>n&&o.to<r&&((s||(s=[])).push(o),t[i]=null);return s}function eh(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function si(t,e,n,r){let s=[],i=!1;e.forEach((l,a)=>{let c=Zu(t,l,a+n);if(c){i=!0;let u=si(c,l,n+a+1,r);u!=Ze&&s.push(a,a+l.nodeSize,u)}});let o=Xu(i?eh(t):t,-n).sort(Un);for(let l=0;l<o.length;l++)o[l].type.valid(e,o[l])||(r.onRemove&&r.onRemove(o[l].spec),o.splice(l--,1));return o.length||s.length?new Ne(o,s):Ze}function Un(t,e){return t.from-e.from||t.to-e.to}function Vl(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let s=n+1;s<e.length;s++){let i=e[s];if(i.from==r.from){i.to!=r.to&&(e==t&&(e=t.slice()),e[s]=i.copy(i.from,r.to),yc(e,s+1,i.copy(r.to,i.to)));continue}else{i.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,i.from),yc(e,s,r.copy(i.from,r.to)));break}}}return e}function yc(t,e,n){for(;e<t.length&&Un(n,t[e])>0;)e++;t.splice(e,0,n)}function ko(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=Ze&&e.push(r)}),t.cursorWrapper&&e.push(Ne.create(t.state.doc,[t.cursorWrapper.deco])),gn.from(e)}const l0={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},a0=ut&&_n<=11;class c0{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class d0{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new c0,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let s=0;s<r.length;s++)this.queue.push(r[s]);ut&&_n<=11&&r.some(s=>s.type=="childList"&&s.removedNodes.length||s.type=="characterData"&&s.oldValue.length>s.target.nodeValue.length)?this.flushSoon():tt&&e.composing&&r.some(s=>s.type=="childList"&&s.target.nodeName=="TR")?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),a0&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,l0)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(dc(this.view)){if(this.suppressingSelectionUpdates)return on(this.view);if(ut&&_n<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Qn(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let i=e.focusNode;i;i=br(i))n.add(i);for(let i=e.anchorNode;i;i=br(i))if(n.has(i)){r=i;break}let s=r&&this.view.docView.nearestDesc(r);if(s&&s.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),s=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&dc(e)&&!this.ignoreSelectionChange(r),i=-1,o=-1,l=!1,a=[];if(e.editable)for(let u=0;u<n.length;u++){let h=this.registerMutation(n[u],a);h&&(i=i<0?h.from:Math.min(h.from,i),o=o<0?h.to:Math.max(h.to,o),h.typeOver&&(l=!0))}if(a.some(u=>u.nodeName=="BR")&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46)){for(let u of a)if(u.nodeName=="BR"&&u.parentNode){let h=u.nextSibling;for(;h&&h.nodeType==1;){if(h.contentEditable=="false"){u.parentNode.removeChild(u);break}h=h.firstChild}}}else if(jt&&a.length){let u=a.filter(h=>h.nodeName=="BR");if(u.length==2){let[h,p]=u;h.parentNode&&h.parentNode.parentNode==p.parentNode?p.remove():h.remove()}else{let{focusNode:h}=this.currentSelection;for(let p of u){let f=p.parentNode;f&&f.nodeName=="LI"&&(!h||f0(e,h)!=f)&&p.remove()}}}let c=null;i<0&&s&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Vi(r)&&(c=Bl(e))&&c.eq(le.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,on(e),this.currentSelection.set(r),e.scrollToSelection()):(i>-1||s)&&(i>-1&&(e.docView.markDirty(i,o),u0(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,p0(e,a)),this.handleDOMChange(i,o,l,a),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||on(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;u<e.addedNodes.length;u++){let h=e.addedNodes[u];n.push(h),h.nodeType==3&&(this.lastChangedTextNode=h)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let s=e.previousSibling,i=e.nextSibling;if(ut&&_n<=11&&e.addedNodes.length)for(let u=0;u<e.addedNodes.length;u++){let{previousSibling:h,nextSibling:p}=e.addedNodes[u];(!h||Array.prototype.indexOf.call(e.addedNodes,h)<0)&&(s=h),(!p||Array.prototype.indexOf.call(e.addedNodes,p)<0)&&(i=p)}let o=s&&s.parentNode==e.target?Ke(s)+1:0,l=r.localPosFromDOM(e.target,o,-1),a=i&&i.parentNode==e.target?Ke(i):e.target.childNodes.length,c=r.localPosFromDOM(e.target,a,1);return{from:l,to:c}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let xc=new WeakMap,vc=!1;function u0(t){if(!xc.has(t)&&(xc.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=jt,vc)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),vc=!0}}function _c(t,e){let n=e.startContainer,r=e.startOffset,s=e.endContainer,i=e.endOffset,o=t.domAtPos(t.state.selection.anchor);return Qn(o.node,o.offset,s,i)&&([n,r,s,i]=[s,i,n,r]),{anchorNode:n,anchorOffset:r,focusNode:s,focusOffset:i}}function h0(t,e){if(e.getComposedRanges){let s=e.getComposedRanges(t.root)[0];if(s)return _c(t,s)}let n;function r(s){s.preventDefault(),s.stopImmediatePropagation(),n=s.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?_c(t,n):null}function f0(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let r=t.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function p0(t,e){var n;let{focusNode:r,focusOffset:s}=t.domSelectionRange();for(let i of e)if(((n=i.parentNode)===null||n===void 0?void 0:n.nodeName)=="TR"){let o=i.nextSibling;for(;o&&o.nodeName!="TD"&&o.nodeName!="TH";)o=o.nextSibling;if(o){let l=o;for(;;){let a=l.firstChild;if(!a||a.nodeType!=1||a.contentEditable=="false"||/^(BR|IMG)$/.test(a.nodeName))break;l=a}l.insertBefore(i,l.firstChild),r==i&&t.domSelection().collapse(i,s)}else i.parentNode.removeChild(i)}}function m0(t,e,n){let{node:r,fromOffset:s,toOffset:i,from:o,to:l}=t.docView.parseRange(e,n),a=t.domSelectionRange(),c,u=a.anchorNode;if(u&&t.dom.contains(u.nodeType==1?u:u.parentNode)&&(c=[{node:u,offset:a.anchorOffset}],Vi(a)||c.push({node:a.focusNode,offset:a.focusOffset})),Je&&t.input.lastKeyCode===8)for(let b=i;b>s;b--){let y=r.childNodes[b-1],v=y.pmViewDesc;if(y.nodeName=="BR"&&!v){i=b;break}if(!v||v.size)break}let h=t.state.doc,p=t.someProp("domParser")||vn.fromSchema(t.state.schema),f=h.resolve(o),m=null,g=p.parse(r,{topNode:f.parent,topMatch:f.parent.contentMatchAt(f.index()),topOpen:!0,from:s,to:i,preserveWhitespace:f.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:g0,context:f});if(c&&c[0].pos!=null){let b=c[0].pos,y=c[1]&&c[1].pos;y==null&&(y=b),m={anchor:b+o,head:y+o}}return{doc:g,sel:m,from:o,to:l}}function g0(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(tt&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||tt&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const b0=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function y0(t,e,n,r,s){let i=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let N=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,O=Bl(t,N);if(O&&!t.state.selection.eq(O)){if(Je&&rn&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",S=>S(t,Ln(13,"Enter"))))return;let B=t.state.tr.setSelection(O);N=="pointer"?B.setMeta("pointer",!0):N=="key"&&B.scrollIntoView(),i&&B.setMeta("composition",i),t.dispatch(B)}return}let o=t.state.doc.resolve(e),l=o.sharedDepth(n);e=o.before(l+1),n=t.state.doc.resolve(n).after(l+1);let a=t.state.selection,c=m0(t,e,n),u=t.state.doc,h=u.slice(c.from,c.to),p,f;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(p=t.state.selection.to,f="end"):(p=t.state.selection.from,f="start"),t.input.lastKeyCode=null;let m=_0(h.content,c.doc.content,c.from,p,f);if(m&&t.input.domChangeCount++,(yr&&t.input.lastIOSEnter>Date.now()-225||rn)&&s.some(N=>N.nodeType==1&&!b0.test(N.nodeName))&&(!m||m.endA>=m.endB)&&t.someProp("handleKeyDown",N=>N(t,Ln(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!m)if(r&&a instanceof X&&!a.empty&&a.$head.sameParent(a.$anchor)&&!t.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))m={start:a.from,endA:a.to,endB:a.to};else{if(c.sel){let N=kc(t,t.state.doc,c.sel);if(N&&!N.eq(t.state.selection)){let O=t.state.tr.setSelection(N);i&&O.setMeta("composition",i),t.dispatch(O)}}return}t.state.selection.from<t.state.selection.to&&m.start==m.endB&&t.state.selection instanceof X&&(m.start>t.state.selection.from&&m.start<=t.state.selection.from+2&&t.state.selection.from>=c.from?m.start=t.state.selection.from:m.endA<t.state.selection.to&&m.endA>=t.state.selection.to-2&&t.state.selection.to<=c.to&&(m.endB+=t.state.selection.to-m.endA,m.endA=t.state.selection.to)),ut&&_n<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>c.from&&c.doc.textBetween(m.start-c.from-1,m.start-c.from+1)==" "&&(m.start--,m.endA--,m.endB--);let g=c.doc.resolveNoCache(m.start-c.from),b=c.doc.resolveNoCache(m.endB-c.from),y=u.resolve(m.start),v=g.sameParent(b)&&g.parent.inlineContent&&y.end()>=m.endA;if((yr&&t.input.lastIOSEnter>Date.now()-225&&(!v||s.some(N=>N.nodeName=="DIV"||N.nodeName=="P"))||!v&&g.pos<c.doc.content.size&&(!g.sameParent(b)||!g.parent.inlineContent)&&g.pos<b.pos&&!/\S/.test(c.doc.textBetween(g.pos,b.pos,"","")))&&t.someProp("handleKeyDown",N=>N(t,Ln(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>m.start&&v0(u,m.start,m.endA,g,b)&&t.someProp("handleKeyDown",N=>N(t,Ln(8,"Backspace")))){rn&&Je&&t.domObserver.suppressSelectionUpdates();return}Je&&m.endB==m.start&&(t.input.lastChromeDelete=Date.now()),rn&&!v&&g.start()!=b.start()&&b.parentOffset==0&&g.depth==b.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==m.endA&&(m.endB-=2,b=c.doc.resolveNoCache(m.endB-c.from),setTimeout(()=>{t.someProp("handleKeyDown",function(N){return N(t,Ln(13,"Enter"))})},20));let _=m.start,w=m.endA,k=N=>{let O=N||t.state.tr.replace(_,w,c.doc.slice(m.start-c.from,m.endB-c.from));if(c.sel){let B=kc(t,O.doc,c.sel);B&&!(Je&&t.composing&&B.empty&&(m.start!=m.endB||t.input.lastChromeDelete<Date.now()-100)&&(B.head==_||B.head==O.mapping.map(w)-1)||ut&&B.empty&&B.head==_)&&O.setSelection(B)}return i&&O.setMeta("composition",i),O.scrollIntoView()},C;if(v)if(g.pos==b.pos){ut&&_n<=11&&g.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>on(t),20));let N=k(t.state.tr.delete(_,w)),O=u.resolve(m.start).marksAcross(u.resolve(m.endA));O&&N.ensureMarks(O),t.dispatch(N)}else if(m.endA==m.endB&&(C=x0(g.parent.content.cut(g.parentOffset,b.parentOffset),y.parent.content.cut(y.parentOffset,m.endA-y.start())))){let N=k(t.state.tr);C.type=="add"?N.addMark(_,w,C.mark):N.removeMark(_,w,C.mark),t.dispatch(N)}else if(g.parent.child(g.index()).isText&&g.index()==b.index()-(b.textOffset?0:1)){let N=g.parent.textBetween(g.parentOffset,b.parentOffset),O=()=>k(t.state.tr.insertText(N,_,w));t.someProp("handleTextInput",B=>B(t,_,w,N,O))||t.dispatch(O())}else t.dispatch(k());else t.dispatch(k())}function kc(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:$l(t,e.resolve(n.anchor),e.resolve(n.head))}function x0(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,s=n,i=r,o,l,a;for(let u=0;u<r.length;u++)s=r[u].removeFromSet(s);for(let u=0;u<n.length;u++)i=n[u].removeFromSet(i);if(s.length==1&&i.length==0)l=s[0],o="add",a=u=>u.mark(l.addToSet(u.marks));else if(s.length==0&&i.length==1)l=i[0],o="remove",a=u=>u.mark(l.removeFromSet(u.marks));else return null;let c=[];for(let u=0;u<e.childCount;u++)c.push(a(e.child(u)));if(E.from(c).eq(t))return{mark:l,type:o}}function v0(t,e,n,r,s){if(n-e<=s.pos-r.pos||wo(r,!0,!1)<s.pos)return!1;let i=t.resolve(e);if(!r.parent.isTextblock){let l=i.nodeAfter;return l!=null&&n==e+l.nodeSize}if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let o=t.resolve(wo(i,!0,!0));return!o.parent.isTextblock||o.pos>n||wo(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function wo(t,e,n){let r=t.depth,s=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,s++,e=!1;if(n){let i=t.node(r).maybeChild(t.indexAfter(r));for(;i&&!i.isLeaf;)i=i.firstChild,s++}return s}function _0(t,e,n,r,s){let i=t.findDiffStart(e,n);if(i==null)return null;let{a:o,b:l}=t.findDiffEnd(e,n+t.size,n+e.size);if(s=="end"){let a=Math.max(0,i-Math.min(o,l));r-=o+a-i}if(o<i&&t.size<e.size){let a=r<=i&&r>=o?i-r:0;i-=a,i&&i<e.size&&wc(e.textBetween(i-1,i+1))&&(i+=a?1:-1),l=i+(l-o),o=i}else if(l<i){let a=r<=i&&r>=l?i-r:0;i-=a,i&&i<t.size&&wc(t.textBetween(i-1,i+1))&&(i+=a?1:-1),o=i+(o-l),l=i}return{start:i,endA:o,endB:l}}function wc(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}class th{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new Bv,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(Tc),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Nc(this),Sc(this),this.nodeViews=Ac(this),this.docView=sc(this.state.doc,Cc(this),ko(this),this.dom,this),this.domObserver=new d0(this,(r,s,i,o)=>y0(this,r,s,i,o)),this.domObserver.start(),$v(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&al(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Tc),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let s=this.state,i=!1,o=!1;e.storedMarks&&this.composing&&(Gu(this),o=!0),this.state=e;let l=s.plugins!=e.plugins||this._props.plugins!=n.plugins;if(l||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let f=Ac(this);w0(f,this.nodeViews)&&(this.nodeViews=f,i=!0)}(l||n.handleDOMEvents!=this._props.handleDOMEvents)&&al(this),this.editable=Nc(this),Sc(this);let a=ko(this),c=Cc(this),u=s.plugins!=e.plugins&&!s.doc.eq(e.doc)?"reset":e.scrollToSelection>s.scrollToSelection?"to selection":"preserve",h=i||!this.docView.matchesNode(e.doc,c,a);(h||!e.selection.eq(s.selection))&&(o=!0);let p=u=="preserve"&&o&&this.dom.style.overflowAnchor==null&&X1(this);if(o){this.domObserver.stop();let f=h&&(ut||Je)&&!this.composing&&!s.selection.empty&&!e.selection.empty&&k0(s.selection,e.selection);if(h){let m=Je?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Xv(this)),(i||!this.docView.update(e.doc,c,a,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=sc(e.doc,c,a,this.dom,this)),m&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(f=!0)}f||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&kv(this))?on(this,f):(Lu(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(s),!((r=this.dragging)===null||r===void 0)&&r.node&&!s.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,s),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():p&&Z1(p)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof J){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&Xa(this,n.getBoundingClientRect(),e)}else Xa(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,e)}}updateDraggedNode(e,n){let r=e.node,s=-1;if(r.from<this.state.doc.content.size&&this.state.doc.nodeAt(r.from)==r.node)s=r.from;else{let i=r.from+(this.state.doc.content.size-n.doc.content.size);(i>0&&i<this.state.doc.content.size&&this.state.doc.nodeAt(i))==r.node&&(s=i)}this.dragging=new Yu(e.slice,e.move,s<0?void 0:J.create(this.state.doc,s))}someProp(e,n){let r=this._props&&this._props[e],s;if(r!=null&&(s=n?n(r):r))return s;for(let o=0;o<this.directPlugins.length;o++){let l=this.directPlugins[o].props[e];if(l!=null&&(s=n?n(l):l))return s}let i=this.state.plugins;if(i)for(let o=0;o<i.length;o++){let l=i[o].props[e];if(l!=null&&(s=n?n(l):l))return s}}hasFocus(){if(ut){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&ev(this.dom),on(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return iv(this,e)}coordsAtPos(e,n=1){return Tu(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let s=this.docView.posFromDOM(e,n,r);if(s==null)throw new RangeError("DOM position not inside the editor");return s}endOfTextblock(e,n){return dv(this,n||this.state,e)}pasteHTML(e,n){return ls(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return ls(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return Pl(this,e)}destroy(){this.docView&&(Pv(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],ko(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,H1())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return Fv(this,e)}domSelectionRange(){let e=this.domSelection();return e?tt&&this.root.nodeType===11&&K1(this.dom.ownerDocument)==this.dom&&h0(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}th.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function Cc(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[et.node(0,t.state.doc.content.size,e)]}function Sc(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:et.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function Nc(t){return!t.someProp("editable",e=>e(t.state)===!1)}function k0(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function Ac(t){let e=Object.create(null);function n(r){for(let s in r)Object.prototype.hasOwnProperty.call(e,s)||(e[s]=r[s])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function w0(t,e){let n=0,r=0;for(let s in t){if(t[s]!=e[s])return!0;n++}for(let s in e)r++;return n!=r}function Tc(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Cn={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},ii={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},C0=typeof navigator<"u"&&/Mac/.test(navigator.platform),S0=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Ge=0;Ge<10;Ge++)Cn[48+Ge]=Cn[96+Ge]=String(Ge);for(var Ge=1;Ge<=24;Ge++)Cn[Ge+111]="F"+Ge;for(var Ge=65;Ge<=90;Ge++)Cn[Ge]=String.fromCharCode(Ge+32),ii[Ge]=String.fromCharCode(Ge);for(var Co in Cn)ii.hasOwnProperty(Co)||(ii[Co]=Cn[Co]);function N0(t){var e=C0&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||S0&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?ii:Cn)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const A0=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),T0=typeof navigator<"u"&&/Win/.test(navigator.platform);function E0(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,s,i,o;for(let l=0;l<e.length-1;l++){let a=e[l];if(/^(cmd|meta|m)$/i.test(a))o=!0;else if(/^a(lt)?$/i.test(a))r=!0;else if(/^(c|ctrl|control)$/i.test(a))s=!0;else if(/^s(hift)?$/i.test(a))i=!0;else if(/^mod$/i.test(a))A0?o=!0:s=!0;else throw new Error("Unrecognized modifier name: "+a)}return r&&(n="Alt-"+n),s&&(n="Ctrl-"+n),o&&(n="Meta-"+n),i&&(n="Shift-"+n),n}function M0(t){let e=Object.create(null);for(let n in t)e[E0(n)]=t[n];return e}function So(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function j0(t){return new Ae({props:{handleKeyDown:nh(t)}})}function nh(t){let e=M0(t);return function(n,r){let s=N0(r),i,o=e[So(s,r)];if(o&&o(n.state,n.dispatch,n))return!0;if(s.length==1&&s!=" "){if(r.shiftKey){let l=e[So(s,r,!1)];if(l&&l(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(T0&&r.ctrlKey&&r.altKey)&&(i=Cn[r.keyCode])&&i!=s){let l=e[So(i,r)];if(l&&l(n.state,n.dispatch,n))return!0}}return!1}}var I0=Object.defineProperty,ql=(t,e)=>{for(var n in e)I0(t,n,{get:e[n],enumerable:!0})};function Ki(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:s}=n,{storedMarks:i}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return i},get selection(){return r},get doc(){return s},get tr(){return r=n.selection,s=n.doc,i=n.storedMarks,n}}}var Gi=class{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:e,state:n}=this,{view:r}=e,{tr:s}=n,i=this.buildProps(s);return Object.fromEntries(Object.entries(t).map(([o,l])=>[o,(...c)=>{const u=l(...c)(i);return!s.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(s),u}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,e=!0){const{rawCommands:n,editor:r,state:s}=this,{view:i}=r,o=[],l=!!t,a=t||s.tr,c=()=>(!l&&e&&!a.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(a),o.every(h=>h===!0)),u={...Object.fromEntries(Object.entries(n).map(([h,p])=>[h,(...m)=>{const g=this.buildProps(a,e),b=p(...m)(g);return o.push(b),u}])),run:c};return u}createCan(t){const{rawCommands:e,state:n}=this,r=!1,s=t||n.tr,i=this.buildProps(s,r);return{...Object.fromEntries(Object.entries(e).map(([l,a])=>[l,(...c)=>a(...c)({...i,dispatch:void 0})])),chain:()=>this.createChain(s,r)}}buildProps(t,e=!0){const{rawCommands:n,editor:r,state:s}=this,{view:i}=r,o={tr:t,editor:r,view:i,state:Ki({state:s,transaction:t}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t,e),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(n).map(([l,a])=>[l,(...c)=>a(...c)(o)]))}};return o}},rh={};ql(rh,{blur:()=>D0,clearContent:()=>O0,clearNodes:()=>R0,command:()=>L0,createParagraphNear:()=>B0,cut:()=>$0,deleteCurrentNode:()=>P0,deleteNode:()=>z0,deleteRange:()=>F0,deleteSelection:()=>V0,enter:()=>q0,exitCode:()=>U0,extendMarkRange:()=>K0,first:()=>G0,focus:()=>Y0,forEach:()=>Q0,insertContent:()=>X0,insertContentAt:()=>t_,joinBackward:()=>s_,joinDown:()=>r_,joinForward:()=>i_,joinItemBackward:()=>o_,joinItemForward:()=>l_,joinTextblockBackward:()=>a_,joinTextblockForward:()=>c_,joinUp:()=>n_,keyboardShortcut:()=>u_,lift:()=>h_,liftEmptyBlock:()=>f_,liftListItem:()=>p_,newlineInCode:()=>m_,resetAttributes:()=>g_,scrollIntoView:()=>b_,selectAll:()=>y_,selectNodeBackward:()=>x_,selectNodeForward:()=>v_,selectParentNode:()=>__,selectTextblockEnd:()=>k_,selectTextblockStart:()=>w_,setContent:()=>C_,setMark:()=>q_,setMeta:()=>U_,setNode:()=>K_,setNodeSelection:()=>G_,setTextDirection:()=>J_,setTextSelection:()=>Y_,sinkListItem:()=>Q_,splitBlock:()=>X_,splitListItem:()=>Z_,toggleList:()=>tk,toggleMark:()=>nk,toggleNode:()=>rk,toggleWrap:()=>sk,undoInputRule:()=>ik,unsetAllMarks:()=>ok,unsetMark:()=>lk,unsetTextDirection:()=>ak,updateAttributes:()=>ck,wrapIn:()=>dk,wrapInList:()=>uk});var D0=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),O0=(t=!0)=>({commands:e})=>e.setContent("",{emitUpdate:t}),R0=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:s}=r;return n&&s.forEach(({$from:i,$to:o})=>{t.doc.nodesBetween(i.pos,o.pos,(l,a)=>{if(l.type.isText)return;const{doc:c,mapping:u}=e,h=c.resolve(u.map(a)),p=c.resolve(u.map(a+l.nodeSize)),f=h.blockRange(p);if(!f)return;const m=_r(f);if(l.type.isTextblock){const{defaultType:g}=h.parent.contentMatchAt(h.index());e.setNodeMarkup(f.start,g)}(m||m===0)&&e.lift(f,m)})}),!0},L0=t=>e=>t(e),B0=()=>({state:t,dispatch:e})=>bu(t,e),$0=(t,e)=>({editor:n,tr:r})=>{const{state:s}=n,i=s.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const o=r.mapping.map(e);return r.insert(o,i.content),r.setSelection(new X(r.doc.resolve(Math.max(o-1,0)))),!0},P0=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const s=t.selection.$anchor;for(let i=s.depth;i>0;i-=1)if(s.node(i).type===r.type){if(e){const l=s.before(i),a=s.after(i);t.delete(l,a).scrollIntoView()}return!0}return!1};function Pe(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}var z0=t=>({tr:e,state:n,dispatch:r})=>{const s=Pe(t,n.schema),i=e.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===s){if(r){const a=i.before(o),c=i.after(o);e.delete(a,c).scrollIntoView()}return!0}return!1},F0=t=>({tr:e,dispatch:n})=>{const{from:r,to:s}=t;return n&&e.delete(r,s),!0},H0=t=>t.content?/^text(\*|\+)/.test(t.content):!1,Ec=(t,e,n)=>{if(!t.parent.isInline||n==="left"&&t.pos>t.start()||n==="right"&&t.pos<t.end())return t.pos;const r=e.nodes[t.parent.type.name].spec;return H0(r)?n==="left"?t.start()-1:t.end()+1:t.pos},W0=(t,e,n)=>{const r=Ec(t,n,"left"),s=Ec(e,n,"right");return{from:r,to:s}},V0=()=>({state:t,dispatch:e})=>{const{$from:n,$to:r}=t.selection;if(t.selection.empty)return!1;const{from:s,to:i}=W0(n,r,t.schema);return e&&(t.tr.deleteRange(s,i).scrollIntoView(),e(t.tr)),!0},q0=()=>({commands:t})=>t.keyboardShortcut("Enter"),U0=()=>({state:t,dispatch:e})=>A1(t,e);function Ul(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function oi(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(s=>n.strict?e[s]===t[s]:Ul(e[s])?e[s].test(t[s]):e[s]===t[s]):!0}function sh(t,e,n={}){return t.find(r=>r.type===e&&oi(Object.fromEntries(Object.keys(n).map(s=>[s,r.attrs[s]])),n))}function Mc(t,e,n={}){return!!sh(t,e,n)}function Kl(t,e,n){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if((!r.node||!r.node.marks.some(c=>c.type===e))&&(r=t.parent.childBefore(t.parentOffset)),!r.node||!r.node.marks.some(c=>c.type===e))return;if(!n){const c=r.node.marks.find(u=>u.type===e);c&&(n=c.attrs)}if(!sh([...r.node.marks],e,n))return;let i=r.index,o=t.start()+r.offset,l=i+1,a=o+r.node.nodeSize;for(;i>0&&Mc([...t.parent.child(i-1).marks],e,n);)i-=1,o-=t.parent.child(i).nodeSize;for(;l<t.parent.childCount&&Mc([...t.parent.child(l).marks],e,n);)a+=t.parent.child(l).nodeSize,l+=1;return{from:o,to:a}}function ln(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}var K0=(t,e)=>({tr:n,state:r,dispatch:s})=>{const i=ln(t,r.schema),{doc:o,selection:l}=n,{$from:a,from:c,to:u}=l;if(s){const h=Kl(a,i,e);if(h&&h.from<=c&&h.to>=u){const p=X.create(o,h.from,h.to);n.setSelection(p)}}return!0},G0=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1};function ih(t){return t instanceof X}function Pn(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function oh(t,e=null){if(!e)return null;const n=le.atStart(t),r=le.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const s=n.from,i=r.to;return e==="all"?X.create(t,Pn(0,s,i),Pn(t.content.size,s,i)):X.create(t,Pn(e,s,i),Pn(e,s,i))}function jc(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function li(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function J0(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var Y0=(t=null,e={})=>({editor:n,view:r,tr:s,dispatch:i})=>{e={scrollIntoView:!0,...e};const o=()=>{(li()||jc())&&r.dom.focus(),J0()&&!li()&&!jc()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&t===null||t===!1)return!0}catch{return!1}if(i&&t===null&&!ih(n.state.selection))return o(),!0;const l=oh(s.doc,t)||n.state.selection,a=n.state.selection.eq(l);return i&&(a||s.setSelection(l),a&&s.storedMarks&&s.setStoredMarks(s.storedMarks),o()),!0},Q0=(t,e)=>n=>t.every((r,s)=>e(r,{...n,index:s})),X0=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),lh=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&lh(r)}return t};function js(t){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return lh(n)}function cs(t,e,n){if(t instanceof Mt||t instanceof E)return t;n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,s=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return E.fromArray(t.map(l=>e.nodeFromJSON(l)));const o=e.nodeFromJSON(t);return n.errorOnInvalidContent&&o.check(),o}catch(i){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:i});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",i),cs("",e,n)}if(s){if(n.errorOnInvalidContent){let o=!1,l="";const a=new Wd({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(o=!0,l=typeof c=="string"?c:c.outerHTML,null)}]}})});if(n.slice?vn.fromSchema(a).parseSlice(js(t),n.parseOptions):vn.fromSchema(a).parse(js(t),n.parseOptions),n.errorOnInvalidContent&&o)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${l}`)})}const i=vn.fromSchema(e);return n.slice?i.parseSlice(js(t),n.parseOptions).content:i.parse(js(t),n.parseOptions)}return cs("",e,n)}function Z0(t,e,n){const r=t.steps.length-1;if(r<e)return;const s=t.steps[r];if(!(s instanceof Be||s instanceof He))return;const i=t.mapping.maps[r];let o=0;i.forEach((l,a,c,u)=>{o===0&&(o=u)}),t.setSelection(le.near(t.doc.resolve(o),n))}var e_=t=>!("type"in t),t_=(t,e,n)=>({tr:r,dispatch:s,editor:i})=>{var o;if(s){n={parseOptions:i.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let l;const a=b=>{i.emit("contentError",{editor:i,error:b,disableCollaboration:()=>{"collaboration"in i.storage&&typeof i.storage.collaboration=="object"&&i.storage.collaboration&&(i.storage.collaboration.isDisabled=!0)}})},c={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!i.options.enableContentCheck&&i.options.emitContentError)try{cs(e,i.schema,{parseOptions:c,errorOnInvalidContent:!0})}catch(b){a(b)}try{l=cs(e,i.schema,{parseOptions:c,errorOnInvalidContent:(o=n.errorOnInvalidContent)!=null?o:i.options.enableContentCheck})}catch(b){return a(b),!1}let{from:u,to:h}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},p=!0,f=!0;if((e_(l)?l:[l]).forEach(b=>{b.check(),p=p?b.isText&&b.marks.length===0:!1,f=f?b.isBlock:!1}),u===h&&f){const{parent:b}=r.doc.resolve(u);b.isTextblock&&!b.type.spec.code&&!b.childCount&&(u-=1,h+=1)}let g;if(p){if(Array.isArray(e))g=e.map(b=>b.text||"").join("");else if(e instanceof E){let b="";e.forEach(y=>{y.text&&(b+=y.text)}),g=b}else typeof e=="object"&&e&&e.text?g=e.text:g=e;r.insertText(g,u,h)}else{g=l;const b=r.doc.resolve(u),y=b.node(),v=b.parentOffset===0,_=y.isText||y.isTextblock,w=y.content.size>0;v&&_&&w&&f&&(u=Math.max(0,u-1)),r.replaceWith(u,h,g)}n.updateSelection&&Z0(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:u,text:g}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:u,text:g})}return!0},n_=()=>({state:t,dispatch:e})=>C1(t,e),r_=()=>({state:t,dispatch:e})=>S1(t,e),s_=()=>({state:t,dispatch:e})=>du(t,e),i_=()=>({state:t,dispatch:e})=>pu(t,e),o_=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Fi(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},l_=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Fi(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},a_=()=>({state:t,dispatch:e})=>k1(t,e),c_=()=>({state:t,dispatch:e})=>w1(t,e);function ah(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function d_(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,s,i,o;for(let l=0;l<e.length-1;l+=1){const a=e[l];if(/^(cmd|meta|m)$/i.test(a))o=!0;else if(/^a(lt)?$/i.test(a))r=!0;else if(/^(c|ctrl|control)$/i.test(a))s=!0;else if(/^s(hift)?$/i.test(a))i=!0;else if(/^mod$/i.test(a))li()||ah()?o=!0:s=!0;else throw new Error(`Unrecognized modifier name: ${a}`)}return r&&(n=`Alt-${n}`),s&&(n=`Ctrl-${n}`),o&&(n=`Meta-${n}`),i&&(n=`Shift-${n}`),n}var u_=t=>({editor:e,view:n,tr:r,dispatch:s})=>{const i=d_(t).split(/-(?!$)/),o=i.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),l=new KeyboardEvent("keydown",{key:o==="Space"?" ":o,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),a=e.captureTransaction(()=>{n.someProp("handleKeyDown",c=>c(n,l))});return a==null||a.steps.forEach(c=>{const u=c.map(r.mapping);u&&s&&r.maybeStep(u)}),!0};function Sn(t,e,n={}){const{from:r,to:s,empty:i}=t.selection,o=e?Pe(e,t.schema):null,l=[];t.doc.nodesBetween(r,s,(h,p)=>{if(h.isText)return;const f=Math.max(r,p),m=Math.min(s,p+h.nodeSize);l.push({node:h,from:f,to:m})});const a=s-r,c=l.filter(h=>o?o.name===h.node.type.name:!0).filter(h=>oi(h.node.attrs,n,{strict:!1}));return i?!!c.length:c.reduce((h,p)=>h+p.to-p.from,0)>=a}var h_=(t,e={})=>({state:n,dispatch:r})=>{const s=Pe(t,n.schema);return Sn(n,s,e)?N1(n,r):!1},f_=()=>({state:t,dispatch:e})=>yu(t,e),p_=t=>({state:e,dispatch:n})=>{const r=Pe(t,e.schema);return $1(r)(e,n)},m_=()=>({state:t,dispatch:e})=>gu(t,e);function Ji(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function Ic(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,s)=>(n.includes(s)||(r[s]=t[s]),r),{})}var g_=(t,e)=>({tr:n,state:r,dispatch:s})=>{let i=null,o=null;const l=Ji(typeof t=="string"?t:t.name,r.schema);if(!l)return!1;l==="node"&&(i=Pe(t,r.schema)),l==="mark"&&(o=ln(t,r.schema));let a=!1;return n.selection.ranges.forEach(c=>{r.doc.nodesBetween(c.$from.pos,c.$to.pos,(u,h)=>{i&&i===u.type&&(a=!0,s&&n.setNodeMarkup(h,void 0,Ic(u.attrs,e))),o&&u.marks.length&&u.marks.forEach(p=>{o===p.type&&(a=!0,s&&n.addMark(h,h+u.nodeSize,o.create(Ic(p.attrs,e))))})})}),a},b_=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),y_=()=>({tr:t,dispatch:e})=>{if(e){const n=new xt(t.doc);t.setSelection(n)}return!0},x_=()=>({state:t,dispatch:e})=>hu(t,e),v_=()=>({state:t,dispatch:e})=>mu(t,e),__=()=>({state:t,dispatch:e})=>M1(t,e),k_=()=>({state:t,dispatch:e})=>D1(t,e),w_=()=>({state:t,dispatch:e})=>I1(t,e);function cl(t,e,n={},r={}){return cs(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var C_=(t,{errorOnInvalidContent:e,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:s,tr:i,dispatch:o,commands:l})=>{const{doc:a}=i;if(r.preserveWhitespace!=="full"){const c=cl(t,s.schema,r,{errorOnInvalidContent:e??s.options.enableContentCheck});return o&&i.replaceWith(0,a.content.size,c).setMeta("preventUpdate",!n),!0}return o&&i.setMeta("preventUpdate",!n),l.insertContentAt({from:0,to:a.content.size},t,{parseOptions:r,errorOnInvalidContent:e??s.options.enableContentCheck})};function ch(t,e){const n=ln(e,t.schema),{from:r,to:s,empty:i}=t.selection,o=[];i?(t.storedMarks&&o.push(...t.storedMarks),o.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,s,a=>{o.push(...a.marks)});const l=o.find(a=>a.type.name===n.name);return l?{...l.attrs}:{}}function dh(t,e){const n=new iu(t);return e.forEach(r=>{r.steps.forEach(s=>{n.step(s)})}),n}function S_(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function N_(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,(s,i)=>{n(s)&&r.push({node:s,pos:i})}),r}function A_(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function Yi(t){return e=>A_(e.$from,t)}function K(t,e,n){return t.config[e]===void 0&&t.parent?K(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?K(t.parent,e,n):null}):t.config[e]}function Gl(t){return t.map(e=>{const n={name:e.name,options:e.options,storage:e.storage},r=K(e,"addExtensions",n);return r?[e,...Gl(r())]:e}).flat(10)}function Jl(t,e){const n=tr.fromSchema(e).serializeFragment(t),s=document.implementation.createHTMLDocument().createElement("div");return s.appendChild(n),s.innerHTML}function uh(t){return typeof t=="function"}function be(t,e=void 0,...n){return uh(t)?e?t.bind(e)(...n):t(...n):t}function T_(t={}){return Object.keys(t).length===0&&t.constructor===Object}function xr(t){const e=t.filter(s=>s.type==="extension"),n=t.filter(s=>s.type==="node"),r=t.filter(s=>s.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function hh(t){const e=[],{nodeExtensions:n,markExtensions:r}=xr(t),s=[...n,...r],i={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},o=n.filter(c=>c.name!=="text").map(c=>c.name),l=r.map(c=>c.name),a=[...o,...l];return t.forEach(c=>{const u={name:c.name,options:c.options,storage:c.storage,extensions:s},h=K(c,"addGlobalAttributes",u);if(!h)return;h().forEach(f=>{let m;Array.isArray(f.types)?m=f.types:f.types==="*"?m=a:f.types==="nodes"?m=o:f.types==="marks"?m=l:m=[],m.forEach(g=>{Object.entries(f.attributes).forEach(([b,y])=>{e.push({type:g,name:b,attribute:{...i,...y}})})})})}),s.forEach(c=>{const u={name:c.name,options:c.options,storage:c.storage},h=K(c,"addAttributes",u);if(!h)return;const p=h();Object.entries(p).forEach(([f,m])=>{const g={...i,...m};typeof(g==null?void 0:g.default)=="function"&&(g.default=g.default()),g!=null&&g.isRequired&&(g==null?void 0:g.default)===void 0&&delete g.default,e.push({type:c.name,name:f,attribute:g})})}),e}function E_(t){const e=[];let n="",r=!1,s=!1,i=0;const o=t.length;for(let l=0;l<o;l+=1){const a=t[l];if(a==="'"&&!s){r=!r,n+=a;continue}if(a==='"'&&!r){s=!s,n+=a;continue}if(!r&&!s){if(a==="("){i+=1,n+=a;continue}if(a===")"&&i>0){i-=1,n+=a;continue}if(a===";"&&i===0){e.push(n),n="";continue}}n+=a}return n&&e.push(n),e}function Dc(t){const e=[],n=E_(t||""),r=n.length;for(let s=0;s<r;s+=1){const i=n[s],o=i.indexOf(":");if(o===-1)continue;const l=i.slice(0,o).trim(),a=i.slice(o+1).trim();l&&a&&e.push([l,a])}return e}function ve(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([s,i])=>{if(!r[s]){r[s]=i;return}if(s==="class"){const l=i?String(i).split(" "):[],a=r[s]?r[s].split(" "):[],c=l.filter(u=>!a.includes(u));r[s]=[...a,...c].join(" ")}else if(s==="style"){const l=new Map([...Dc(r[s]),...Dc(i)]);r[s]=Array.from(l.entries()).map(([a,c])=>`${a}: ${c}`).join("; ")}else r[s]=i}),r},{})}function ds(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>ve(n,r),{})}function M_(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function Oc(t,e){return"style"in t?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const s=e.reduce((i,o)=>{const l=o.attribute.parseHTML?o.attribute.parseHTML(n):M_(n.getAttribute(o.name));return l==null?i:{...i,[o.name]:l}},{});return{...r,...s}}}}function Rc(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&T_(n)?!1:n!=null))}function Lc(t){var e,n;const r={};return!((e=t==null?void 0:t.attribute)!=null&&e.isRequired)&&"default"in((t==null?void 0:t.attribute)||{})&&(r.default=t.attribute.default),((n=t==null?void 0:t.attribute)==null?void 0:n.validate)!==void 0&&(r.validate=t.attribute.validate),[t.name,r]}function j_(t,e){var n;const r=hh(t),{nodeExtensions:s,markExtensions:i}=xr(t),o=(n=s.find(c=>K(c,"topNode")))==null?void 0:n.name,l=Object.fromEntries(s.map(c=>{const u=r.filter(y=>y.type===c.name),h={name:c.name,options:c.options,storage:c.storage,editor:e},p=t.reduce((y,v)=>{const _=K(v,"extendNodeSchema",h);return{...y,..._?_(c):{}}},{}),f=Rc({...p,content:be(K(c,"content",h)),marks:be(K(c,"marks",h)),group:be(K(c,"group",h)),inline:be(K(c,"inline",h)),atom:be(K(c,"atom",h)),selectable:be(K(c,"selectable",h)),draggable:be(K(c,"draggable",h)),code:be(K(c,"code",h)),whitespace:be(K(c,"whitespace",h)),linebreakReplacement:be(K(c,"linebreakReplacement",h)),defining:be(K(c,"defining",h)),isolating:be(K(c,"isolating",h)),attrs:Object.fromEntries(u.map(Lc))}),m=be(K(c,"parseHTML",h));m&&(f.parseDOM=m.map(y=>Oc(y,u)));const g=K(c,"renderHTML",h);g&&(f.toDOM=y=>g({node:y,HTMLAttributes:ds(y,u)}));const b=K(c,"renderText",h);return b&&(f.toText=b),[c.name,f]})),a=Object.fromEntries(i.map(c=>{const u=r.filter(b=>b.type===c.name),h={name:c.name,options:c.options,storage:c.storage,editor:e},p=t.reduce((b,y)=>{const v=K(y,"extendMarkSchema",h);return{...b,...v?v(c):{}}},{}),f=Rc({...p,inclusive:be(K(c,"inclusive",h)),excludes:be(K(c,"excludes",h)),group:be(K(c,"group",h)),spanning:be(K(c,"spanning",h)),code:be(K(c,"code",h)),attrs:Object.fromEntries(u.map(Lc))}),m=be(K(c,"parseHTML",h));m&&(f.parseDOM=m.map(b=>Oc(b,u)));const g=K(c,"renderHTML",h);return g&&(f.toDOM=b=>g({mark:b,HTMLAttributes:ds(b,u)})),[c.name,f]}));return new Wd({topNode:o,nodes:l,marks:a})}function I_(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}function Gr(t){return t.sort((n,r)=>{const s=K(n,"priority")||100,i=K(r,"priority")||100;return s>i?-1:s<i?1:0})}function fh(t){const e=Gr(Gl(t)),n=I_(e.map(r=>r.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(r=>`'${r}'`).join(", ")}]. This can lead to issues.`),e}function ph(t,e,n){const{from:r,to:s}=e,{blockSeparator:i=`
|
|
27
|
-
|
|
28
|
-
`,textSerializers:o={}}=n||{};let l="";return t.nodesBetween(r,s,(a,c,u,h)=>{var p;a.isBlock&&c>r&&(l+=i);const f=o==null?void 0:o[a.type.name];if(f)return u&&(l+=f({node:a,pos:c,parent:u,index:h,range:e})),!1;a.isText&&(l+=(p=a==null?void 0:a.text)==null?void 0:p.slice(Math.max(r,c)-c,s-c))}),l}function D_(t,e){const n={from:0,to:t.content.size};return ph(t,n,e)}function mh(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}function O_(t,e){const n=Pe(e,t.schema),{from:r,to:s}=t.selection,i=[];t.doc.nodesBetween(r,s,l=>{i.push(l)});const o=i.reverse().find(l=>l.type.name===n.name);return o?{...o.attrs}:{}}function gh(t,e){const n=Ji(typeof e=="string"?e:e.name,t.schema);return n==="node"?O_(t,e):n==="mark"?ch(t,e):{}}function R_(t,e=JSON.stringify){const n={};return t.filter(r=>{const s=e(r);return Object.prototype.hasOwnProperty.call(n,s)?!1:n[s]=!0})}function L_(t){const e=R_(t);return e.length===1?e:e.filter((n,r)=>!e.filter((i,o)=>o!==r).some(i=>n.oldRange.from>=i.oldRange.from&&n.oldRange.to<=i.oldRange.to&&n.newRange.from>=i.newRange.from&&n.newRange.to<=i.newRange.to))}function bh(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach((s,i)=>{const o=[];if(s.ranges.length)s.forEach((l,a)=>{o.push({from:l,to:a})});else{const{from:l,to:a}=n[i];if(l===void 0||a===void 0)return;o.push({from:l,to:a})}o.forEach(({from:l,to:a})=>{const c=e.slice(i).map(l,-1),u=e.slice(i).map(a),h=e.invert().map(c,-1),p=e.invert().map(u);r.push({oldRange:{from:h,to:p},newRange:{from:c,to:u}})})}),L_(r)}function Yl(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(s=>{const i=n.resolve(t),o=Kl(i,s.type);o&&r.push({mark:s,...o})}):n.nodesBetween(t,e,(s,i)=>{!s||(s==null?void 0:s.nodeSize)===void 0||r.push(...s.marks.map(o=>({from:i,to:i+s.nodeSize,mark:o})))}),r}var B_=(t,e,n,r=20)=>{const s=t.doc.resolve(n);let i=r,o=null;for(;i>0&&o===null;){const l=s.node(i);(l==null?void 0:l.type.name)===e?o=l:i-=1}return[o,i]};function jr(t,e){return e.nodes[t]||e.marks[t]||null}function qs(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const s=t.find(i=>i.type===e&&i.name===r);return s?s.attribute.keepOnSplit:!1}))}var $_=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(s,i,o,l)=>{var a,c;const u=((c=(a=s.type.spec).toText)==null?void 0:c.call(a,{node:s,pos:i,parent:o,index:l}))||s.textContent||"%leaf%";n+=s.isAtom&&!s.isText?u:u.slice(0,Math.max(0,r-i))}),n};function dl(t,e,n={}){const{empty:r,ranges:s}=t.selection,i=e?ln(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(h=>i?i.name===h.type.name:!0).find(h=>oi(h.attrs,n,{strict:!1}));let o=0;const l=[];if(s.forEach(({$from:h,$to:p})=>{const f=h.pos,m=p.pos;t.doc.nodesBetween(f,m,(g,b)=>{if(i&&g.inlineContent&&!g.type.allowsMarkType(i))return!1;if(!g.isText&&!g.marks.length)return;const y=Math.max(f,b),v=Math.min(m,b+g.nodeSize),_=v-y;o+=_,l.push(...g.marks.map(w=>({mark:w,from:y,to:v})))})}),o===0)return!1;const a=l.filter(h=>i?i.name===h.mark.type.name:!0).filter(h=>oi(h.mark.attrs,n,{strict:!1})).reduce((h,p)=>h+p.to-p.from,0),c=l.filter(h=>i?h.mark.type!==i&&h.mark.type.excludes(i):!0).reduce((h,p)=>h+p.to-p.from,0);return(a>0?a+c:a)>=o}function P_(t,e,n={}){if(!e)return Sn(t,null,n)||dl(t,null,n);const r=Ji(e,t.schema);return r==="node"?Sn(t,e,n):r==="mark"?dl(t,e,n):!1}var z_=(t,e)=>{const{$from:n,$to:r,$anchor:s}=t.selection;if(e){const i=Yi(l=>l.type.name===e)(t.selection);if(!i)return!1;const o=t.doc.resolve(i.pos+1);return s.pos+1===o.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},F_=t=>{const{$from:e,$to:n}=t.selection;return!(e.parentOffset>0||e.pos!==n.pos)};function Bc(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function No(t,e){const{nodeExtensions:n}=xr(e),r=n.find(o=>o.name===t);if(!r)return!1;const s={name:r.name,options:r.options,storage:r.storage},i=be(K(r,"group",s));return typeof i!="string"?!1:i.split(" ").includes("list")}function us(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return!/\S/.test((r=t.text)!=null?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let s=!0;return t.content.forEach(i=>{s!==!1&&(us(i,{ignoreWhitespace:n,checkChildren:e})||(s=!1))}),s}return!1}function yh(t){return t instanceof J}var xh=class vh{constructor(e){this.position=e}static fromJSON(e){return new vh(e.position)}toJSON(){return{position:this.position}}};function H_(t,e){const n=e.mapping.mapResult(t.position);return{position:new xh(n.pos),mapResult:n}}function W_(t){return new xh(t)}function V_(t,e,n){var r;const{selection:s}=e;let i=null;if(ih(s)&&(i=s.$cursor),i){const l=(r=t.storedMarks)!=null?r:i.marks();return i.parent.type.allowsMarkType(n)&&(!!n.isInSet(l)||!l.some(c=>c.type.excludes(n)))}const{ranges:o}=s;return o.some(({$from:l,$to:a})=>{let c=l.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(l.pos,a.pos,(u,h,p)=>{if(c)return!1;if(u.isInline){const f=!p||p.type.allowsMarkType(n),m=!!n.isInSet(u.marks)||!u.marks.some(g=>g.type.excludes(n));c=f&&m}return!c}),c})}var q_=(t,e={})=>({tr:n,state:r,dispatch:s})=>{const{selection:i}=n,{empty:o,ranges:l}=i,a=ln(t,r.schema);if(s)if(o){const c=ch(r,a);n.addStoredMark(a.create({...c,...e}))}else l.forEach(c=>{const u=c.$from.pos,h=c.$to.pos;r.doc.nodesBetween(u,h,(p,f)=>{const m=Math.max(f,u),g=Math.min(f+p.nodeSize,h);p.marks.find(y=>y.type===a)?p.marks.forEach(y=>{a===y.type&&n.addMark(m,g,a.create({...y.attrs,...e}))}):n.addMark(m,g,a.create(e))})});return V_(r,n,a)},U_=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),K_=(t,e={})=>({state:n,dispatch:r,chain:s})=>{const i=Pe(t,n.schema);let o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),i.isTextblock?s().command(({commands:l})=>Ja(i,{...o,...e})(n)?!0:l.clearNodes()).command(({state:l})=>Ja(i,{...o,...e})(l,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},G_=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,s=Pn(t,0,r.content.size),i=J.create(r,s);e.setSelection(i)}return!0},J_=(t,e)=>({tr:n,state:r,dispatch:s})=>{const{selection:i}=r;let o,l;return typeof e=="number"?(o=e,l=e):e&&"from"in e&&"to"in e?(o=e.from,l=e.to):(o=i.from,l=i.to),s&&n.doc.nodesBetween(o,l,(a,c)=>{a.isText||n.setNodeMarkup(c,void 0,{...a.attrs,dir:t})}),!0},Y_=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:s,to:i}=typeof t=="number"?{from:t,to:t}:t,o=X.atStart(r).from,l=X.atEnd(r).to,a=Pn(s,o,l),c=Pn(i,o,l),u=X.create(r,a,c);e.setSelection(u)}return!0},Q_=t=>({state:e,dispatch:n})=>{const r=Pe(t,e.schema);return F1(r)(e,n)};function $c(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(s=>e==null?void 0:e.includes(s.type.name));t.tr.ensureMarks(r)}}var X_=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:s})=>{const{selection:i,doc:o}=e,{$from:l,$to:a}=i,c=s.extensionManager.attributes,u=qs(c,l.node().type.name,l.node().attrs);if(i instanceof J&&i.node.isBlock)return!l.parentOffset||!sn(o,l.pos)?!1:(r&&(t&&$c(n,s.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;const h=a.parentOffset===a.parent.content.size,p=l.depth===0?void 0:S_(l.node(-1).contentMatchAt(l.indexAfter(-1)));let f=h&&p?[{type:p,attrs:u}]:void 0,m=sn(e.doc,e.mapping.map(l.pos),1,f);if(!f&&!m&&sn(e.doc,e.mapping.map(l.pos),1,p?[{type:p}]:void 0)&&(m=!0,f=p?[{type:p,attrs:u}]:void 0),r){if(m&&(i instanceof X&&e.deleteSelection(),e.split(e.mapping.map(l.pos),1,f),p&&!h&&!l.parentOffset&&l.parent.type!==p)){const g=e.mapping.map(l.before()),b=e.doc.resolve(g);l.node(-1).canReplaceWith(b.index(),b.index()+1,p)&&e.setNodeMarkup(e.mapping.map(l.before()),p)}t&&$c(n,s.extensionManager.splittableMarks),e.scrollIntoView()}return m},Z_=(t,e={})=>({tr:n,state:r,dispatch:s,editor:i})=>{var o;const l=Pe(t,r.schema),{$from:a,$to:c}=r.selection,u=r.selection.node;if(u&&u.isBlock||a.depth<2||!a.sameParent(c))return!1;const h=a.node(-1);if(h.type!==l)return!1;const p=i.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==l||a.index(-2)!==a.node(-2).childCount-1)return!1;if(s){let y=E.empty;const v=a.index(-1)?1:a.index(-2)?2:3;for(let O=a.depth-v;O>=a.depth-3;O-=1)y=E.from(a.node(O).copy(y));const _=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,w={...qs(p,a.node().type.name,a.node().attrs),...e},k=((o=l.contentMatch.defaultType)==null?void 0:o.createAndFill(w))||void 0;y=y.append(E.from(l.createAndFill(null,k)||void 0));const C=a.before(a.depth-(v-1));n.replace(C,a.after(-_),new F(y,4-v,0));let N=-1;n.doc.nodesBetween(C,n.doc.content.size,(O,B)=>{if(N>-1)return!1;O.isTextblock&&O.content.size===0&&(N=B+1)}),N>-1&&n.setSelection(X.near(n.doc.resolve(N))),n.scrollIntoView()}return!0}const f=c.pos===a.end()?h.contentMatchAt(0).defaultType:null,m={...qs(p,h.type.name,h.attrs),...e},g={...qs(p,a.node().type.name,a.node().attrs),...e};n.delete(a.pos,c.pos);const b=f?[{type:l,attrs:m},{type:f,attrs:g}]:[{type:l,attrs:m}];if(!sn(n.doc,a.pos,2))return!1;if(s){const{selection:y,storedMarks:v}=r,{splittableMarks:_}=i.extensionManager,w=v||y.$to.parentOffset&&y.$from.marks();if(n.split(a.pos,2,b).scrollIntoView(),!w||!s)return!0;const k=w.filter(C=>_.includes(C.type.name));n.ensureMarks(k)}return!0},Ao=(t,e)=>{const n=Yi(o=>o.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const s=t.doc.nodeAt(r);return n.node.type===(s==null?void 0:s.type)&&An(t.doc,n.pos)&&t.join(n.pos),!0},To=(t,e)=>{const n=Yi(o=>o.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const s=t.doc.nodeAt(r);return n.node.type===(s==null?void 0:s.type)&&An(t.doc,r)&&t.join(r),!0};function ek(t){const e=t.doc,n=e.firstChild;if(!n)return null;const r=e.resolve(1),s=e.resolve(n.nodeSize-1);return X.between(r,s)}var tk=(t,e,n,r={})=>({editor:s,tr:i,state:o,dispatch:l,chain:a,commands:c,can:u})=>{const{extensions:h,splittableMarks:p}=s.extensionManager,f=Pe(t,o.schema),m=Pe(e,o.schema),{selection:g,storedMarks:b}=o,{$from:y,$to:v}=g,_=y.blockRange(v),w=b||g.$to.parentOffset&&g.$from.marks();if(!_)return!1;const k=Yi(L=>No(L.type.name,h))(g),C=g.from===0&&g.to===o.doc.content.size,N=o.doc.content.content,O=N.length===1?N[0]:null,B=C&&O&&No(O.type.name,h)?{node:O,pos:0}:null,S=k??B,T=!!k&&_.depth>=1&&_.depth-k.depth<=1,P=!!B;if((T||P)&&S){if(S.node.type===f)return C&&P?a().command(({tr:L,dispatch:R})=>{const H=ek(L);return H?(L.setSelection(H),R&&R(L),!0):!1}).liftListItem(m).run():c.liftListItem(m);if(No(S.node.type.name,h)&&f.validContent(S.node.content))return a().command(()=>(i.setNodeMarkup(S.pos,f),!0)).command(()=>Ao(i,f)).command(()=>To(i,f)).run()}return!n||!w||!l?a().command(()=>u().wrapInList(f,r)?!0:c.clearNodes()).wrapInList(f,r).command(()=>Ao(i,f)).command(()=>To(i,f)).run():a().command(()=>{const L=u().wrapInList(f,r),R=w.filter(H=>p.includes(H.type.name));return i.ensureMarks(R),L?!0:c.clearNodes()}).wrapInList(f,r).command(()=>Ao(i,f)).command(()=>To(i,f)).run()},nk=(t,e={},n={})=>({state:r,commands:s})=>{const{extendEmptyMarkRange:i=!1}=n,o=ln(t,r.schema);return dl(r,o,e)?s.unsetMark(o,{extendEmptyMarkRange:i}):s.setMark(o,e)},rk=(t,e,n={})=>({state:r,commands:s})=>{const i=Pe(t,r.schema),o=Pe(e,r.schema),l=Sn(r,i,n);let a;return r.selection.$anchor.sameParent(r.selection.$head)&&(a=r.selection.$anchor.parent.attrs),l?s.setNode(o,a):s.setNode(i,{...a,...n})},sk=(t,e={})=>({state:n,commands:r})=>{const s=Pe(t,n.schema);return Sn(n,s,e)?r.lift(s):r.wrapIn(s,e)},ik=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const s=n[r];let i;if(s.spec.isInputRules&&(i=s.getState(t))){if(e){const o=t.tr,l=i.transform;for(let a=l.steps.length-1;a>=0;a-=1)o.step(l.steps[a].invert(l.docs[a]));if(i.text){const a=o.doc.resolve(i.from).marks();o.replaceWith(i.from,i.to,t.schema.text(i.text,a))}else o.delete(i.from,i.to)}return!0}}return!1},ok=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:s}=n;return r||e&&s.forEach(i=>{t.removeMark(i.$from.pos,i.$to.pos)}),!0},lk=(t,e={})=>({tr:n,state:r,dispatch:s})=>{var i;const{extendEmptyMarkRange:o=!1}=e,{selection:l}=n,a=ln(t,r.schema),{$from:c,empty:u,ranges:h}=l;if(!s)return!0;if(u&&o){let{from:p,to:f}=l;const m=(i=c.marks().find(b=>b.type===a))==null?void 0:i.attrs,g=Kl(c,a,m);g&&(p=g.from,f=g.to),n.removeMark(p,f,a)}else h.forEach(p=>{n.removeMark(p.$from.pos,p.$to.pos,a)});return n.removeStoredMark(a),!0},ak=t=>({tr:e,state:n,dispatch:r})=>{const{selection:s}=n;let i,o;return typeof t=="number"?(i=t,o=t):t&&"from"in t&&"to"in t?(i=t.from,o=t.to):(i=s.from,o=s.to),r&&e.doc.nodesBetween(i,o,(l,a)=>{if(l.isText)return;const c={...l.attrs};delete c.dir,e.setNodeMarkup(a,void 0,c)}),!0},ck=(t,e={})=>({tr:n,state:r,dispatch:s})=>{let i=null,o=null;const l=Ji(typeof t=="string"?t:t.name,r.schema);if(!l)return!1;l==="node"&&(i=Pe(t,r.schema)),l==="mark"&&(o=ln(t,r.schema));let a=!1;return n.selection.ranges.forEach(c=>{const u=c.$from.pos,h=c.$to.pos;let p,f,m,g;n.selection.empty?r.doc.nodesBetween(u,h,(b,y)=>{i&&i===b.type&&(a=!0,m=Math.max(y,u),g=Math.min(y+b.nodeSize,h),p=y,f=b)}):r.doc.nodesBetween(u,h,(b,y)=>{y<u&&i&&i===b.type&&(a=!0,m=Math.max(y,u),g=Math.min(y+b.nodeSize,h),p=y,f=b),y>=u&&y<=h&&(i&&i===b.type&&(a=!0,s&&n.setNodeMarkup(y,void 0,{...b.attrs,...e})),o&&b.marks.length&&b.marks.forEach(v=>{if(o===v.type&&(a=!0,s)){const _=Math.max(y,u),w=Math.min(y+b.nodeSize,h);n.addMark(_,w,o.create({...v.attrs,...e}))}}))}),f&&(p!==void 0&&s&&n.setNodeMarkup(p,void 0,{...f.attrs,...e}),o&&f.marks.length&&f.marks.forEach(b=>{o===b.type&&s&&n.addMark(m,g,o.create({...b.attrs,...e}))}))}),a},dk=(t,e={})=>({state:n,dispatch:r})=>{const s=Pe(t,n.schema);return O1(s,e)(n,r)},uk=(t,e={})=>({state:n,dispatch:r})=>{const s=Pe(t,n.schema);return R1(s,e)(n,r)},hk=class{constructor(){this.callbacks={}}on(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}emit(t,...e){const n=this.callbacks[t];return n&&n.forEach(r=>r.apply(this,e)),this}off(t,e){const n=this.callbacks[t];return n&&(e?this.callbacks[t]=n.filter(r=>r!==e):delete this.callbacks[t]),this}once(t,e){const n=(...r)=>{this.off(t,n),e.apply(this,r)};return this.on(t,n)}removeAllListeners(){this.callbacks={}}},Qi=class{constructor(t){var e;this.find=t.find,this.handler=t.handler,this.undoable=(e=t.undoable)!=null?e:!0}},fk=(t,e)=>{if(Ul(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function Is(t){var e;const{editor:n,from:r,to:s,text:i,rules:o,plugin:l}=t,{view:a}=n;if(a.composing)return!1;const c=a.state.doc.resolve(r);if(c.parent.type.spec.code||(e=c.nodeBefore||c.nodeAfter)!=null&&e.marks.find(p=>p.type.spec.code))return!1;let u=!1;const h=$_(c)+i;return o.forEach(p=>{if(u)return;const f=fk(h,p.find);if(!f)return;const m=a.state.tr,g=Ki({state:a.state,transaction:m}),b={from:r-(f[0].length-i.length),to:s},{commands:y,chain:v,can:_}=new Gi({editor:n,state:g});p.handler({state:g,range:b,match:f,commands:y,chain:v,can:_})===null||!m.steps.length||(p.undoable&&m.setMeta(l,{transform:m,from:r,to:s,text:i}),a.dispatch(m),u=!0)}),u}function pk(t){const{editor:e,rules:n}=t,r=new Ae({state:{init(){return null},apply(s,i,o){const l=s.getMeta(r);if(l)return l;const a=s.getMeta("applyInputRules");return!!a&&setTimeout(()=>{let{text:u}=a;typeof u=="string"?u=u:u=Jl(E.from(u),o.schema);const{from:h}=a,p=h+u.length;Is({editor:e,from:h,to:p,text:u,rules:n,plugin:r})}),s.selectionSet||s.docChanged?null:i}},props:{handleTextInput(s,i,o,l){return Is({editor:e,from:i,to:o,text:l,rules:n,plugin:r})},handleDOMEvents:{compositionend:s=>(setTimeout(()=>{const{$cursor:i}=s.state.selection;i&&Is({editor:e,from:i.pos,to:i.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(s,i){if(i.key!=="Enter")return!1;const{$cursor:o}=s.state.selection;return o?Is({editor:e,from:o.pos,to:o.pos,text:`
|
|
29
|
-
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function mk(t){return Object.prototype.toString.call(t).slice(8,-1)}function Ds(t){return mk(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function _h(t,e){const n={...t};return Ds(t)&&Ds(e)&&Object.keys(e).forEach(r=>{Ds(e[r])&&Ds(t[r])?n[r]=_h(t[r],e[r]):n[r]=e[r]}),n}var Ql=class{constructor(t={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...t},this.name=this.config.name}get options(){return{...be(K(this,"addOptions",{name:this.name}))}}get storage(){return{...be(K(this,"addStorage",{name:this.name,options:this.options}))}}configure(t={}){const e=this.extend({...this.config,addOptions:()=>_h(this.options,t)});return e.name=this.name,e.parent=this.parent,this.child=null,e}extend(t={}){const e=new this.constructor({...this.config,...t});return e.parent=this,this.child=e,e.name="name"in t?t.name:e.parent.name,e}},Kt=class kh extends Ql{constructor(){super(...arguments),this.type="mark"}static create(e={}){const n=typeof e=="function"?e():e;return new kh(n)}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,s=e.state.selection.$from;if(s.pos===s.end()){const o=s.marks();if(!!!o.find(c=>(c==null?void 0:c.type.name)===n.name))return!1;const a=o.find(c=>(c==null?void 0:c.type.name)===n.name);return a&&r.removeStoredMark(a),r.insertText(" ",s.pos),e.view.dispatch(r),!0}return!1}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}};function gk(t){return typeof t=="number"}var bk=class{constructor(t){this.find=t.find,this.handler=t.handler}},yk=(t,e,n)=>{if(Ul(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(s=>{const i=[s.text];return i.index=s.index,i.input=t,i.data=s.data,s.replaceWith&&(s.text.includes(s.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),i.push(s.replaceWith)),i}):[]};function xk(t){const{editor:e,state:n,from:r,to:s,rule:i,pasteEvent:o,dropEvent:l}=t,{commands:a,chain:c,can:u}=new Gi({editor:e,state:n}),h=[];return n.doc.nodesBetween(r,s,(f,m)=>{var g,b,y,v,_;if((b=(g=f.type)==null?void 0:g.spec)!=null&&b.code||!(f.isText||f.isTextblock||f.isInline))return;const w=(_=(v=(y=f.content)==null?void 0:y.size)!=null?v:f.nodeSize)!=null?_:0,k=Math.max(r,m),C=Math.min(s,m+w);if(k>=C)return;const N=f.isText?f.text||"":f.textBetween(k-m,C-m,void 0,"");yk(N,i.find,o).forEach(B=>{if(B.index===void 0)return;const S=k+B.index+1,T=S+B[0].length,P={from:n.tr.mapping.map(S),to:n.tr.mapping.map(T)},L=i.handler({state:n,range:P,match:B,commands:a,chain:c,can:u,pasteEvent:o,dropEvent:l});h.push(L)})}),h.every(f=>f!==null)}var Os=null,vk=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)==null||e.setData("text/html",t),n};function _k(t){const{editor:e,rules:n}=t;let r=null,s=!1,i=!1,o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,l;try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}const a=({state:u,from:h,to:p,rule:f,pasteEvt:m})=>{const g=u.tr,b=Ki({state:u,transaction:g});if(!(!xk({editor:e,state:b,from:Math.max(h-1,0),to:p.b-1,rule:f,pasteEvent:m,dropEvent:l})||!g.steps.length)){try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}return o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,g}};return n.map(u=>new Ae({view(h){const p=m=>{var g;r=(g=h.dom.parentElement)!=null&&g.contains(m.target)?h.dom.parentElement:null,r&&(Os=e)},f=()=>{Os&&(Os=null)};return window.addEventListener("dragstart",p),window.addEventListener("dragend",f),{destroy(){window.removeEventListener("dragstart",p),window.removeEventListener("dragend",f)}}},props:{handleDOMEvents:{drop:(h,p)=>{if(i=r===h.dom.parentElement,l=p,!i){const f=Os;f!=null&&f.isEditable&&setTimeout(()=>{const m=f.state.selection;m&&f.commands.deleteRange({from:m.from,to:m.to})},10)}return!1},paste:(h,p)=>{var f;const m=(f=p.clipboardData)==null?void 0:f.getData("text/html");return o=p,s=!!(m!=null&&m.includes("data-pm-slice")),!1}}},appendTransaction:(h,p,f)=>{const m=h[0],g=m.getMeta("uiEvent")==="paste"&&!s,b=m.getMeta("uiEvent")==="drop"&&!i,y=m.getMeta("applyPasteRules"),v=!!y;if(!g&&!b&&!v)return;if(v){let{text:k}=y;typeof k=="string"?k=k:k=Jl(E.from(k),f.schema);const{from:C}=y,N=C+k.length,O=vk(k);return a({rule:u,state:f,from:C,to:{b:N},pasteEvt:O})}const _=p.doc.content.findDiffStart(f.doc.content),w=p.doc.content.findDiffEnd(f.doc.content);if(!(!gk(_)||!w||_===w.b))return a({rule:u,state:f,from:_,to:w,pasteEvt:o})}}))}var Xi=class{constructor(t,e){this.splittableMarks=[],this.editor=e,this.baseExtensions=t,this.extensions=fh(t),this.schema=j_(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((t,e)=>{const n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:jr(e.name,this.schema)},r=K(e,"addCommands",n);return r?{...t,...r()}:t},{})}get plugins(){const{editor:t}=this;return Gr([...this.extensions].reverse()).flatMap(r=>{const s={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:t,type:jr(r.name,this.schema)},i=[],o=K(r,"addKeyboardShortcuts",s);let l={};if(r.type==="mark"&&K(r,"exitable",s)&&(l.ArrowRight=()=>Kt.handleExit({editor:t,mark:r})),o){const p=Object.fromEntries(Object.entries(o()).map(([f,m])=>[f,()=>m({editor:t})]));l={...l,...p}}const a=j0(l);i.push(a);const c=K(r,"addInputRules",s);if(Bc(r,t.options.enableInputRules)&&c){const p=c();if(p&&p.length){const f=pk({editor:t,rules:p}),m=Array.isArray(f)?f:[f];i.push(...m)}}const u=K(r,"addPasteRules",s);if(Bc(r,t.options.enablePasteRules)&&u){const p=u();if(p&&p.length){const f=_k({editor:t,rules:p});i.push(...f)}}const h=K(r,"addProseMirrorPlugins",s);if(h){const p=h();i.push(...p)}return i})}get attributes(){return hh(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=xr(this.extensions);return Object.fromEntries(e.filter(n=>!!K(n,"addNodeView")).map(n=>{const r=this.attributes.filter(a=>a.type===n.name),s={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:Pe(n.name,this.schema)},i=K(n,"addNodeView",s);if(!i)return[];const o=i();if(!o)return[];const l=(a,c,u,h,p)=>{const f=ds(a,r);return o({node:a,view:c,getPos:u,decorations:h,innerDecorations:p,editor:t,extension:n,HTMLAttributes:f})};return[n.name,l]}))}dispatchTransaction(t){const{editor:e}=this;return Gr([...this.extensions].reverse()).reduceRight((r,s)=>{const i={name:s.name,options:s.options,storage:this.editor.extensionStorage[s.name],editor:e,type:jr(s.name,this.schema)},o=K(s,"dispatchTransaction",i);return o?l=>{o.call(i,{transaction:l,next:r})}:r},t)}transformPastedHTML(t){const{editor:e}=this;return Gr([...this.extensions]).reduce((r,s)=>{const i={name:s.name,options:s.options,storage:this.editor.extensionStorage[s.name],editor:e,type:jr(s.name,this.schema)},o=K(s,"transformPastedHTML",i);return o?(l,a)=>{const c=r(l,a);return o.call(i,c)}:r},t||(r=>r))}get markViews(){const{editor:t}=this,{markExtensions:e}=xr(this.extensions);return Object.fromEntries(e.filter(n=>!!K(n,"addMarkView")).map(n=>{const r=this.attributes.filter(l=>l.type===n.name),s={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:ln(n.name,this.schema)},i=K(n,"addMarkView",s);if(!i)return[];const o=(l,a,c)=>{const u=ds(l,r);return i()({mark:l,view:a,inline:c,editor:t,extension:n,HTMLAttributes:u,updateAttributes:h=>{Bk(l,t,h)}})};return[n.name,o]}))}destroy(){this.extensions.forEach(t=>{let e=t;for(;e.parent;){const n=e.parent;n.child===e&&(n.child=null),e=n}}),this.extensions=[],this.baseExtensions=[],this.schema=null,this.editor=null}setupExtensions(){const t=this.extensions;this.editor.extensionStorage=Object.fromEntries(t.map(e=>[e.name,e.storage])),t.forEach(e=>{var n;const r={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:jr(e.name,this.schema)};e.type==="mark"&&((n=be(K(e,"keepOnSplit",r)))==null||n)&&this.splittableMarks.push(e.name);const s=K(e,"onBeforeCreate",r),i=K(e,"onCreate",r),o=K(e,"onUpdate",r),l=K(e,"onSelectionUpdate",r),a=K(e,"onTransaction",r),c=K(e,"onFocus",r),u=K(e,"onBlur",r),h=K(e,"onDestroy",r);s&&this.editor.on("beforeCreate",s),i&&this.editor.on("create",i),o&&this.editor.on("update",o),l&&this.editor.on("selectionUpdate",l),a&&this.editor.on("transaction",a),c&&this.editor.on("focus",c),u&&this.editor.on("blur",u),h&&this.editor.on("destroy",h)})}};Xi.resolve=fh;Xi.sort=Gr;Xi.flatten=Gl;var kk={};ql(kk,{ClipboardTextSerializer:()=>Ch,Commands:()=>Sh,Delete:()=>Nh,Drop:()=>Ah,Editable:()=>Th,FocusEvents:()=>Mh,Keymap:()=>jh,Paste:()=>Ih,Tabindex:()=>Dh,TextDirection:()=>Oh,focusEventsPluginKey:()=>Eh});var Ie=class wh extends Ql{constructor(){super(...arguments),this.type="extension"}static create(e={}){const n=typeof e=="function"?e():e;return new wh(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},Ch=Ie.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Ae({key:new Le("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:s}=e,{ranges:i}=s,o=Math.min(...i.map(u=>u.$from.pos)),l=Math.max(...i.map(u=>u.$to.pos)),a=mh(n);return ph(r,{from:o,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:a})}}})]}}),Sh=Ie.create({name:"commands",addCommands(){return{...rh}}}),Nh=Ie.create({name:"delete",onUpdate({transaction:t,appendedTransactions:e}){var n,r,s;const i=()=>{var o,l,a,c;if((c=(a=(l=(o=this.editor.options.coreExtensionOptions)==null?void 0:o.delete)==null?void 0:l.filterTransaction)==null?void 0:a.call(l,t))!=null?c:t.getMeta("y-sync$"))return;const u=dh(t.before,[t,...e]);bh(u).forEach(f=>{u.mapping.mapResult(f.oldRange.from).deletedAfter&&u.mapping.mapResult(f.oldRange.to).deletedBefore&&u.before.nodesBetween(f.oldRange.from,f.oldRange.to,(m,g)=>{const b=g+m.nodeSize-2,y=f.oldRange.from<=g&&b<=f.oldRange.to;this.editor.emit("delete",{type:"node",node:m,from:g,to:b,newFrom:u.mapping.map(g),newTo:u.mapping.map(b),deletedRange:f.oldRange,newRange:f.newRange,partial:!y,editor:this.editor,transaction:t,combinedTransform:u})})});const p=u.mapping;u.steps.forEach((f,m)=>{var g,b;if(f instanceof Rt){const y=p.slice(m).map(f.from,-1),v=p.slice(m).map(f.to),_=p.invert().map(y,-1),w=p.invert().map(v),k=y>0?(g=u.doc.nodeAt(y-1))==null?void 0:g.marks.some(N=>N.eq(f.mark)):!1,C=(b=u.doc.nodeAt(v))==null?void 0:b.marks.some(N=>N.eq(f.mark));this.editor.emit("delete",{type:"mark",mark:f.mark,from:f.from,to:f.to,deletedRange:{from:_,to:w},newRange:{from:y,to:v},partial:!!(C||k),editor:this.editor,transaction:t,combinedTransform:u})}})};(s=(r=(n=this.editor.options.coreExtensionOptions)==null?void 0:n.delete)==null?void 0:r.async)==null||s?setTimeout(i,0):i()}}),Ah=Ie.create({name:"drop",addProseMirrorPlugins(){return[new Ae({key:new Le("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),Th=Ie.create({name:"editable",addProseMirrorPlugins(){return[new Ae({key:new Le("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Eh=new Le("focusEvents"),Mh=Ie.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new Ae({key:Eh,props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),jh=Ie.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:o})=>[()=>o.undoInputRule(),()=>o.command(({tr:l})=>{const{selection:a,doc:c}=l,{empty:u,$anchor:h}=a,{pos:p,parent:f}=h,m=h.parent.isTextblock&&p>0?l.doc.resolve(p-1):h,g=m.parent.type.spec.isolating,b=h.pos-h.parentOffset,y=g&&m.parent.childCount===1?b===h.pos:le.atStart(c).from===p;return!u||!f.type.isTextblock||f.textContent.length||!y||y&&h.parent.type.name==="paragraph"?!1:o.clearNodes()}),()=>o.deleteSelection(),()=>o.joinBackward(),()=>o.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:o})=>[()=>o.deleteSelection(),()=>o.deleteCurrentNode(),()=>o.joinForward(),()=>o.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:o})=>[()=>o.newlineInCode(),()=>o.createParagraphNear(),()=>o.liftEmptyBlock(),()=>o.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},s={...r},i={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return li()||ah()?i:s},addProseMirrorPlugins(){return[new Ae({key:new Le("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(g=>g.getMeta("composition")))return;const r=t.some(g=>g.docChanged)&&!e.doc.eq(n.doc),s=t.some(g=>g.getMeta("preventClearDocument"));if(!r||s)return;const{empty:i,from:o,to:l}=e.selection,a=le.atStart(e.doc).from,c=le.atEnd(e.doc).to;if(i||!(o===a&&l===c)||!us(n.doc))return;const p=n.tr,f=Ki({state:n,transaction:p}),{commands:m}=new Gi({editor:this.editor,state:f});if(m.clearNodes(),!!p.steps.length)return p}})]}}),Ih=Ie.create({name:"paste",addProseMirrorPlugins(){return[new Ae({key:new Le("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),Dh=Ie.create({name:"tabindex",addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new Ae({key:new Le("tabindex"),props:{attributes:()=>{var t;return!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:(t=this.options.value)!=null?t:"0"}}}})]}}),Oh=Ie.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:t}=xr(this.extensions);return[{types:t.filter(e=>e.name!=="text").map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{const n=e.getAttribute("dir");return n&&(n==="ltr"||n==="rtl"||n==="auto")?n:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new Ae({key:new Le("textDirection"),props:{attributes:()=>{const t=this.options.direction;return t?{dir:t}:{}}}})]}}),wk=class Hr{constructor(e,n,r=!1,s=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=s}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!=null?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new Hr(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new Hr(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new Hr(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const s=n.isBlock&&!n.isTextblock,i=n.isAtom&&!n.isText,o=n.isInline,l=this.pos+r+(i?0:1);if(l<0||l>this.resolvedPos.doc.nodeSize-2)return;const a=this.resolvedPos.doc.resolve(l);if(!s&&!o&&a.depth<=this.depth)return;const c=new Hr(a,this.editor,s,s||o?n:null);s&&(c.actualDepth=this.depth+1),e.push(c)}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,s=this.parent;for(;s&&!r;){if(s.node.type.name===e)if(Object.keys(n).length>0){const i=s.node.attrs,o=Object.keys(n);for(let l=0;l<o.length;l+=1){const a=o[l];if(i[a]!==n[a])break}}else r=s;s=s.parent}return r}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},r=!1){let s=[];if(!this.children||this.children.length===0)return s;const i=Object.keys(n);return this.children.forEach(o=>{r&&s.length>0||(o.node.type.name===e&&i.every(a=>n[a]===o.node.attrs[a])&&s.push(o),!(r&&s.length>0)&&(s=s.concat(o.querySelectorAll(e,n,r))))}),s}setAttribute(e){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}},Ck=`.ProseMirror {
|
|
17
|
+
*/var Ea;function T1(){return Ea||(Ea=1,process.env.NODE_ENV!=="production"&&function(){function t(f,m){return f===m&&(f!==0||1/f===1/m)||f!==f&&m!==m}function e(f,m){u||s.startTransition===void 0||(u=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var g=m();if(!h){var b=m();i(g,b)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),h=!0)}b=o({inst:{value:g,getSnapshot:m}});var y=b[0].inst,v=b[1];return a(function(){y.value=g,y.getSnapshot=m,n(y)&&v({inst:y})},[f,g,m]),l(function(){return n(y)&&v({inst:y}),f(function(){n(y)&&v({inst:y})})},[f]),c(g),g}function n(f){var m=f.getSnapshot;f=f.value;try{var g=m();return!i(f,g)}catch{return!0}}function r(f,m){return m()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var s=x,i=typeof Object.is=="function"?Object.is:t,o=s.useState,l=s.useEffect,a=s.useLayoutEffect,c=s.useDebugValue,u=!1,h=!1,p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:e;uo.useSyncExternalStore=s.useSyncExternalStore!==void 0?s.useSyncExternalStore:p,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),uo}process.env.NODE_ENV==="production"?Ko.exports=A1():Ko.exports=T1();var Pi=Ko.exports;function Ge(t){this.content=t}Ge.prototype={constructor:Ge,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,s=r.find(t),i=r.content.slice();return s==-1?i.push(n||t,e):(i[s+1]=e,n&&(i[s]=n)),new Ge(i)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new Ge(n)},addToStart:function(t,e){return new Ge([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Ge(n)},addBefore:function(t,e,n){var r=this.remove(e),s=r.content.slice(),i=r.find(t);return s.splice(i==-1?s.length:i,0,e,n),new Ge(s)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=Ge.from(t),t.size?new Ge(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Ge.from(t),t.size?new Ge(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Ge.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};Ge.from=function(t){if(t instanceof Ge)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Ge(e)};function Td(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let s=t.child(r),i=e.child(r);if(s==i){n+=s.nodeSize;continue}if(!s.sameMarkup(i))return n;if(s.isText&&s.text!=i.text){for(let o=0;s.text[o]==i.text[o];o++)n++;return n}if(s.content.size||i.content.size){let o=Td(s.content,i.content,n+1);if(o!=null)return o}n+=s.nodeSize}}function Ed(t,e,n,r){for(let s=t.childCount,i=e.childCount;;){if(s==0||i==0)return s==i?null:{a:n,b:r};let o=t.child(--s),l=e.child(--i),a=o.nodeSize;if(o==l){n-=a,r-=a;continue}if(!o.sameMarkup(l))return{a:n,b:r};if(o.isText&&o.text!=l.text){let c=0,u=Math.min(o.text.length,l.text.length);for(;c<u&&o.text[o.text.length-c-1]==l.text[l.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(o.content.size||l.content.size){let c=Ed(o.content,l.content,n-1,r-1);if(c)return c}n-=a,r-=a}}class M{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,s=0,i){for(let o=0,l=0;l<n;o++){let a=this.content[o],c=l+a.nodeSize;if(c>e&&r(a,s+l,i||null,o)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,n-u),r,s+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,s){let i="",o=!0;return this.nodesBetween(e,n,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,n-a):l.isLeaf?s?typeof s=="function"?s(l):s:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(o?o=!1:i+=r),i+=c},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,s=this.content.slice(),i=0;for(n.isText&&n.sameMarkup(r)&&(s[s.length-1]=n.withText(n.text+r.text),i=1);i<e.content.length;i++)s.push(e.content[i]);return new M(s,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],s=0;if(n>e)for(let i=0,o=0;o<n;i++){let l=this.content[i],a=o+l.nodeSize;a>e&&((o<e||a>n)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,n-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,n-o-1))),r.push(l),s+=l.nodeSize),o=a}return new M(r,s)}cutByIndex(e,n){return e==n?M.empty:e==0&&n==this.content.length?this:new M(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let s=this.content.slice(),i=this.size+n.nodeSize-r.nodeSize;return s[e]=n,new M(s,i)}addToStart(e){return new M([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new M(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let s=this.content[n];e(s,r,n),r+=s.nodeSize}}findDiffStart(e,n=0){return Td(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return Ed(this,e,n,r)}findIndex(e){if(e==0)return As(0,e);if(e==this.size)return As(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let s=this.child(n),i=r+s.nodeSize;if(i>=e)return i==e?As(n+1,i):As(n,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return M.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return M.fromArray(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return M.empty;let n,r=0;for(let s=0;s<e.length;s++){let i=e[s];r+=i.nodeSize,s&&i.isText&&e[s-1].sameMarkup(i)?(n||(n=e.slice(0,s)),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new M(n||e,r)}static from(e){if(!e)return M.empty;if(e instanceof M)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new M([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}M.empty=new M([],0);const ho={index:0,offset:0};function As(t,e){return ho.index=t,ho.offset=e,ho}function Js(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!Js(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Js(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let xe=class Go{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let s=0;s<e.length;s++){let i=e[s];if(this.eq(i))return e;if(this.type.excludes(i.type))n||(n=e.slice(0,s));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(n||(n=e.slice(0,s)),n.push(this),r=!0),n&&n.push(i)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Js(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let s=r.create(n.attrs);return r.checkAttrs(s.attrs),s}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Go.none;if(e instanceof Go)return[e];let n=e.slice();return n.sort((r,s)=>r.type.rank-s.type.rank),n}};xe.none=[];class Ys extends Error{}class F{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=jd(this.content,e+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new F(r,this.openStart,this.openEnd)}removeBetween(e,n){return new F(Md(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return F.empty;let r=n.openStart||0,s=n.openEnd||0;if(typeof r!="number"||typeof s!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new F(M.fromJSON(e,n.content),r,s)}static maxOpen(e,n=!0){let r=0,s=0;for(let i=e.firstChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.lastChild)s++;return new F(e,r,s)}}F.empty=new F(M.empty,0,0);function Md(t,e,n){let{index:r,offset:s}=t.findIndex(e),i=t.maybeChild(r),{index:o,offset:l}=t.findIndex(n);if(s==e||i.isText){if(l!=n&&!t.child(o).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=o)throw new RangeError("Removing non-flat range");return t.replaceChild(r,i.copy(Md(i.content,e-s-1,n-s-1)))}function jd(t,e,n,r,s,i){let{index:o,offset:l}=t.findIndex(e),a=t.maybeChild(o);if(l==e||a.isText)return i&&r<=0&&s<=0&&!i.canReplace(o,o,n)?null:t.cut(0,e).append(n).append(t.cut(e));let c=jd(a.content,e-l-1,n,o==0?r-1:0,o==t.childCount-1?s-1:0,a);return c&&t.replaceChild(o,a.copy(c))}function E1(t,e,n){if(n.openStart>t.depth)throw new Ys("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Ys("Inconsistent open depths");return Id(t,e,n,0)}function Id(t,e,n,r){let s=t.index(r),i=t.node(r);if(s==e.index(r)&&r<t.depth-n.openStart){let o=Id(t,e,n,r+1);return i.copy(i.content.replaceChild(s,o))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let o=t.parent,l=o.content;return Vn(o,l.cut(0,t.parentOffset).append(n.content).append(l.cut(e.parentOffset)))}else{let{start:o,end:l}=M1(n,t);return Vn(i,Od(t,o,l,e,r))}else return Vn(i,Qs(t,e,r))}function Dd(t,e){if(!e.type.compatibleContent(t.type))throw new Ys("Cannot join "+e.type.name+" onto "+t.type.name)}function Jo(t,e,n){let r=t.node(n);return Dd(r,e.node(n)),r}function Wn(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Vr(t,e,n,r){let s=(e||t).node(n),i=0,o=e?e.index(n):s.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(Wn(t.nodeAfter,r),i++));for(let l=i;l<o;l++)Wn(s.child(l),r);e&&e.depth==n&&e.textOffset&&Wn(e.nodeBefore,r)}function Vn(t,e){return t.type.checkContent(e),t.copy(e)}function Od(t,e,n,r,s){let i=t.depth>s&&Jo(t,e,s+1),o=r.depth>s&&Jo(n,r,s+1),l=[];return Vr(null,t,s,l),i&&o&&e.index(s)==n.index(s)?(Dd(i,o),Wn(Vn(i,Od(t,e,n,r,s+1)),l)):(i&&Wn(Vn(i,Qs(t,e,s+1)),l),Vr(e,n,s,l),o&&Wn(Vn(o,Qs(n,r,s+1)),l)),Vr(r,null,s,l),new M(l)}function Qs(t,e,n){let r=[];if(Vr(null,t,n,r),t.depth>n){let s=Jo(t,e,n+1);Wn(Vn(s,Qs(t,e,n+1)),r)}return Vr(e,null,n,r),new M(r)}function M1(t,e){let n=e.depth-t.openStart,s=e.node(n).copy(t.content);for(let i=n-1;i>=0;i--)s=e.node(i).copy(M.from(s));return{start:s.resolveNoCache(t.openStart+n),end:s.resolveNoCache(s.content.size-t.openEnd-n)}}class ts{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],s=e.child(n);return r?e.child(n).cut(r):s}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],s=n==0?0:this.path[n*3-1]+1;for(let i=0;i<e;i++)s+=r.child(i).nodeSize;return s}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return xe.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),s=e.maybeChild(n);if(!r){let l=r;r=s,s=l}let i=r.marks;for(var o=0;o<i.length;o++)i[o].type.spec.inclusive===!1&&(!s||!i[o].isInSet(s.marks))&&(i=i[o--].removeFromSet(i));return i}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,s=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!s||!r[i].isInSet(s.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new Xs(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],s=0,i=n;for(let o=e;;){let{index:l,offset:a}=o.content.findIndex(i),c=i-a;if(r.push(o,l,s+a),!c||(o=o.child(l),o.isText))break;i=c-1,s+=a+1}return new ts(n,r,i)}static resolveCached(e,n){let r=Ma.get(e);if(r)for(let i=0;i<r.elts.length;i++){let o=r.elts[i];if(o.pos==n)return o}else Ma.set(e,r=new j1);let s=r.elts[r.i]=ts.resolve(e,n);return r.i=(r.i+1)%I1,s}}class j1{constructor(){this.elts=[],this.i=0}}const I1=12,Ma=new WeakMap;class Xs{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const D1=Object.create(null);class Mt{constructor(e,n,r,s=xe.none){this.type=e,this.attrs=n,this.marks=s,this.content=r||M.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,s=0){this.content.nodesBetween(e,n,r,s,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,s){return this.content.textBetween(e,n,r,s)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&Js(this.attrs,n||e.defaultAttrs||D1)&&xe.sameSet(this.marks,r||xe.none)}copy(e=null){return e==this.content?this:new Mt(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Mt(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return F.empty;let s=this.resolve(e),i=this.resolve(n),o=r?0:s.sharedDepth(n),l=s.start(o),c=s.node(o).content.cut(s.pos-l,i.pos-l);return new F(c,s.depth-o,i.depth-o)}replace(e,n,r){return E1(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:s}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(s==e||n.isText)return n;e-=s+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let s=this.content.child(n-1);return{node:s,index:n-1,offset:r-s.nodeSize}}resolve(e){return ts.resolveCached(this,e)}resolveNoCache(e){return ts.resolve(this,e)}rangeHasMark(e,n,r){let s=!1;return n>e&&this.nodesBetween(e,n,i=>(r.isInSet(i.marks)&&(s=!0),!s)),s}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Rd(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=M.empty,s=0,i=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,s,i),l=o&&o.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let a=s;a<i;a++)if(!this.type.allowsMarks(r.child(a).marks))return!1;return!0}canReplaceWith(e,n,r,s){if(s&&!this.type.allowsMarks(s))return!1;let i=this.contentMatchAt(e).matchType(r),o=i&&i.matchFragment(this.content,n);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=xe.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!xe.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let s=M.fromJSON(e,n.content),i=e.nodeType(n.type).create(n.attrs,s,r);return i.type.checkAttrs(i.attrs),i}}Mt.prototype.text=void 0;class Zs extends Mt{constructor(e,n,r,s){if(super(e,n,null,s),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Rd(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Zs(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Zs(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Rd(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Jn{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new O1(e,n);if(r.next==null)return Jn.empty;let s=Ld(r);r.next&&r.err("Unexpected trailing text");let i=F1(z1(s));return H1(i,r),i}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let s=this;for(let i=n;s&&i<r;i++)s=s.matchType(e.child(i).type);return s}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let s=[this];function i(o,l){let a=o.matchFragment(e,r);if(a&&(!n||a.validEnd))return M.from(l.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:u,next:h}=o.next[c];if(!(u.isText||u.hasRequiredAttrs())&&s.indexOf(h)==-1){s.push(h);let p=i(h,l.concat(u));if(p)return p}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let s=r.shift(),i=s.match;if(i.matchType(e)){let o=[];for(let l=s;l.type;l=l.via)o.push(l.type);return o.reverse()}for(let o=0;o<i.next.length;o++){let{type:l,next:a}=i.next[o];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in n)&&(!s.type||a.validEnd)&&(r.push({match:l.contentMatch,type:l,via:s}),n[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let s=0;s<r.next.length;s++)e.indexOf(r.next[s].next)==-1&&n(r.next[s].next)}return n(this),e.map((r,s)=>{let i=s+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)i+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return i}).join(`
|
|
18
|
+
`)}}Jn.empty=new Jn(!0);class O1{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Ld(t){let e=[];do e.push(R1(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function R1(t){let e=[];do e.push(L1(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function L1(t){let e=P1(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=B1(t,e);else break;return e}function ja(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function B1(t,e){let n=ja(t),r=n;return t.eat(",")&&(t.next!="}"?r=ja(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function $1(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let s=[];for(let i in n){let o=n[i];o.isInGroup(e)&&s.push(o)}return s.length==0&&t.err("No node type or group '"+e+"' found"),s}function P1(t){if(t.eat("(")){let e=Ld(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=$1(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function z1(t){let e=[[]];return s(i(t,0),n()),e;function n(){return e.push([])-1}function r(o,l,a){let c={term:a,to:l};return e[o].push(c),c}function s(o,l){o.forEach(a=>a.to=l)}function i(o,l){if(o.type=="choice")return o.exprs.reduce((a,c)=>a.concat(i(c,l)),[]);if(o.type=="seq")for(let a=0;;a++){let c=i(o.exprs[a],l);if(a==o.exprs.length-1)return c;s(c,l=n())}else if(o.type=="star"){let a=n();return r(l,a),s(i(o.expr,a),a),[r(a)]}else if(o.type=="plus"){let a=n();return s(i(o.expr,l),a),s(i(o.expr,a),a),[r(a)]}else{if(o.type=="opt")return[r(l)].concat(i(o.expr,l));if(o.type=="range"){let a=l;for(let c=0;c<o.min;c++){let u=n();s(i(o.expr,a),u),a=u}if(o.max==-1)s(i(o.expr,a),a);else for(let c=o.min;c<o.max;c++){let u=n();r(a,u),s(i(o.expr,a),u),a=u}return[r(a)]}else{if(o.type=="name")return[r(l,void 0,o.value)];throw new Error("Unknown expr type")}}}}function Bd(t,e){return e-t}function Ia(t,e){let n=[];return r(e),n.sort(Bd);function r(s){let i=t[s];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(s);for(let o=0;o<i.length;o++){let{term:l,to:a}=i[o];!l&&n.indexOf(a)==-1&&r(a)}}}function F1(t){let e=Object.create(null);return n(Ia(t,0));function n(r){let s=[];r.forEach(o=>{t[o].forEach(({term:l,to:a})=>{if(!l)return;let c;for(let u=0;u<s.length;u++)s[u][0]==l&&(c=s[u][1]);Ia(t,a).forEach(u=>{c||s.push([l,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let i=e[r.join(",")]=new Jn(r.indexOf(t.length-1)>-1);for(let o=0;o<s.length;o++){let l=s[o][1].sort(Bd);i.next.push({type:s[o][0],next:e[l.join(",")]||n(l)})}return i}}function H1(t,e){for(let n=0,r=[t];n<r.length;n++){let s=r[n],i=!s.validEnd,o=[];for(let l=0;l<s.next.length;l++){let{type:a,next:c}=s.next[l];o.push(a.name),i&&!(a.isText||a.hasRequiredAttrs())&&(i=!1),r.indexOf(c)==-1&&r.push(c)}i&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function $d(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function Pd(t,e){let n=Object.create(null);for(let r in t){let s=e&&e[r];if(s===void 0){let i=t[r];if(i.hasDefault)s=i.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=s}return n}function zd(t,e,n,r){for(let s in e)if(!(s in t))throw new RangeError(`Unsupported attribute ${s} for ${n} of type ${s}`);for(let s in t){let i=t[s];i.validate&&i.validate(e[s])}}function Fd(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new V1(t,r,e[r]);return n}let Da=class Hd{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=Fd(e,r.attrs),this.defaultAttrs=$d(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Jn.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Pd(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Mt(this,this.computeAttrs(e),M.from(n),xe.setFrom(r))}createChecked(e=null,n,r){return n=M.from(n),this.checkContent(n),new Mt(this,this.computeAttrs(e),n,xe.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=M.from(n),n.size){let o=this.contentMatch.fillBefore(n);if(!o)return null;n=o.append(n)}let s=this.contentMatch.matchFragment(n),i=s&&s.fillBefore(M.empty,!0);return i?new Mt(this,e,n.append(i),xe.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){zd(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:xe.none:e}static compile(e,n){let r=Object.create(null);e.forEach((i,o)=>r[i]=new Hd(i,n,o));let s=n.spec.topNode||"doc";if(!r[s])throw new RangeError("Schema is missing its top node type ('"+s+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function W1(t,e,n){let r=n.split("|");return s=>{let i=s===null?"null":typeof s;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${i}`)}}class V1{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?W1(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class zi{constructor(e,n,r,s){this.name=e,this.rank=n,this.schema=r,this.spec=s,this.attrs=Fd(e,s.attrs),this.excluded=null;let i=$d(this.attrs);this.instance=i?new xe(this,i):null}create(e=null){return!e&&this.instance?this.instance:new xe(this,Pd(this.attrs,e))}static compile(e,n){let r=Object.create(null),s=0;return e.forEach((i,o)=>r[i]=new zi(i,s++,n,o)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){zd(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class Wd{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let s in e)n[s]=e[s];n.nodes=Ge.from(e.nodes),n.marks=Ge.from(e.marks||{}),this.nodes=Da.compile(this.spec.nodes,this),this.marks=zi.compile(this.spec.marks,this);let r=Object.create(null);for(let s in this.nodes){if(s in this.marks)throw new RangeError(s+" can not be both a node and a mark");let i=this.nodes[s],o=i.spec.content||"",l=i.spec.marks;if(i.contentMatch=r[o]||(r[o]=Jn.parse(o,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=l=="_"?null:l?Oa(this,l.split(" ")):l==""||!i.inlineContent?[]:null}for(let s in this.marks){let i=this.marks[s],o=i.spec.excludes;i.excluded=o==null?[i]:o==""?[]:Oa(this,o.split(" "))}this.nodeFromJSON=s=>Mt.fromJSON(this,s),this.markFromJSON=s=>xe.fromJSON(this,s),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,s){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Da){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,s)}text(e,n){let r=this.nodes.text;return new Zs(r,r.defaultAttrs,e,xe.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function Oa(t,e){let n=[];for(let r=0;r<e.length;r++){let s=e[r],i=t.marks[s],o=i;if(i)n.push(i);else for(let l in t.marks){let a=t.marks[l];(s=="_"||a.spec.group&&a.spec.group.split(" ").indexOf(s)>-1)&&n.push(o=a)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function q1(t){return t.tag!=null}function U1(t){return t.style!=null}class vn{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(s=>{if(q1(s))this.tags.push(s);else if(U1(s)){let i=/[^=]*/.exec(s.style)[0];r.indexOf(i)<0&&r.push(i),this.styles.push(s)}}),this.normalizeLists=!this.tags.some(s=>{if(!/^(ul|ol)\b/.test(s.tag)||!s.node)return!1;let i=e.nodes[s.node];return i.contentMatch.matchType(i)})}parse(e,n={}){let r=new La(this,n,!1);return r.addAll(e,xe.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new La(this,n,!0);return r.addAll(e,xe.none,n.from,n.to),F.maxOpen(r.finish())}matchTag(e,n,r){for(let s=r?this.tags.indexOf(r)+1:0;s<this.tags.length;s++){let i=this.tags[s];if(J1(e,i.tag)&&(i.namespace===void 0||e.namespaceURI==i.namespace)&&(!i.context||n.matchesContext(i.context))){if(i.getAttrs){let o=i.getAttrs(e);if(o===!1)continue;i.attrs=o||void 0}return i}}}matchStyle(e,n,r,s){for(let i=s?this.styles.indexOf(s)+1:0;i<this.styles.length;i++){let o=this.styles[i],l=o.style;if(!(l.indexOf(e)!=0||o.context&&!r.matchesContext(o.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=n))){if(o.getAttrs){let a=o.getAttrs(n);if(a===!1)continue;o.attrs=a||void 0}return o}}}static schemaRules(e){let n=[];function r(s){let i=s.priority==null?50:s.priority,o=0;for(;o<n.length;o++){let l=n[o];if((l.priority==null?50:l.priority)<i)break}n.splice(o,0,s)}for(let s in e.marks){let i=e.marks[s].spec.parseDOM;i&&i.forEach(o=>{r(o=Ba(o)),o.mark||o.ignore||o.clearMark||(o.mark=s)})}for(let s in e.nodes){let i=e.nodes[s].spec.parseDOM;i&&i.forEach(o=>{r(o=Ba(o)),o.node||o.ignore||o.mark||(o.node=s)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new vn(e,vn.schemaRules(e)))}}const Vd={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},K1={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},qd={ol:!0,ul:!0},ns=1,Yo=2,qr=4;function Ra(t,e,n){return e!=null?(e?ns:0)|(e==="full"?Yo:0):t&&t.whitespace=="pre"?ns|Yo:n&~qr}class Ts{constructor(e,n,r,s,i,o){this.type=e,this.attrs=n,this.marks=r,this.solid=s,this.options=o,this.content=[],this.activeMarks=xe.none,this.match=i||(o&qr?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(M.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,s;return(s=r.findWrapping(e.type))?(this.match=r,s):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&ns)){let r=this.content[this.content.length-1],s;if(r&&r.isText&&(s=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==s[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-s[0].length))}}let n=M.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(M.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Vd.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class La{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let s=n.topNode,i,o=Ra(null,n.preserveWhitespace,0)|(r?qr:0);s?i=new Ts(s.type,s.attrs,xe.none,!0,n.topMatch||s.type.contentMatch,o):r?i=new Ts(null,null,xe.none,!0,null,o):i=new Ts(e.schema.topNodeType,null,xe.none,!0,null,o),this.nodes=[i],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,s=this.top,i=s.options&Yo?"full":this.localPreserveWS||(s.options&ns)>0,{schema:o}=this.parser;if(i==="full"||s.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(i)if(i==="full")r=r.replace(/\r\n?/g,`
|
|
19
|
+
`);else if(o.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(o.linebreakReplacement.create())){let l=r.split(/\r?\n|\r/);for(let a=0;a<l.length;a++)a&&this.insertNode(o.linebreakReplacement.create(),n,!0),l[a]&&this.insertNode(o.text(l[a]),n,!/\S/.test(l[a]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let l=s.content[s.content.length-1],a=e.previousSibling;(!l||a&&a.nodeName=="BR"||l.isText&&/[ \t\r\n\u000c]$/.test(l.text))&&(r=r.slice(1))}r&&this.insertNode(o.text(r),n,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let s=this.localPreserveWS,i=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),l;qd.hasOwnProperty(o)&&this.parser.normalizeLists&&G1(e);let a=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,r));e:if(a?a.ignore:K1.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,n);else if(!a||a.skip||a.closeParent){a&&a.closeParent?this.open=Math.max(0,this.open-1):a&&a.skip.nodeType&&(e=a.skip);let c,u=this.needsBlock;if(Vd.hasOwnProperty(o))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),c=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let h=a&&a.skip?n:this.readStyles(e,n);h&&this.addAll(e,h),c&&this.sync(i),this.needsBlock=u}else{let c=this.readStyles(e,n);c&&this.addElementByRule(e,a,c,a.consuming===!1?l:void 0)}this.localPreserveWS=s}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
20
|
+
`),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let s=0;s<this.parser.matchedStyles.length;s++){let i=this.parser.matchedStyles[s],o=r.getPropertyValue(i);if(o)for(let l=void 0;;){let a=this.parser.matchStyle(i,o,this,l);if(!a)break;if(a.ignore)return null;if(a.clearMark?n=n.filter(c=>!a.clearMark(c)):n=n.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return n}addElementByRule(e,n,r,s){let i,o;if(n.node)if(o=this.parser.schema.nodes[n.node],o.isLeaf)this.insertNode(o.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let a=this.enter(o,n.attrs||null,r,n.preserveWhitespace);a&&(i=!0,r=a)}else{let a=this.parser.schema.marks[n.mark];r=r.concat(a.create(n.attrs))}let l=this.top;if(o&&o.isLeaf)this.findInside(e);else if(s)this.addElement(e,r,s);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a,r,!1));else{let a=e;typeof n.contentElement=="string"?a=e.querySelector(n.contentElement):typeof n.contentElement=="function"?a=n.contentElement(e):n.contentElement&&(a=n.contentElement),this.findAround(e,a,!0),this.addAll(a,r),this.findAround(e,a,!1)}i&&this.sync(l)&&this.open--}addAll(e,n,r,s){let i=r||0;for(let o=r?e.childNodes[r]:e.firstChild,l=s==null?null:e.childNodes[s];o!=l;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o,n);this.findAtPoint(e,i)}findPlace(e,n,r){let s,i;for(let o=this.open,l=0;o>=0;o--){let a=this.nodes[o],c=a.findWrapping(e);if(c&&(!s||s.length>c.length+l)&&(s=c,i=a,!c.length))break;if(a.solid){if(r)break;l+=2}}if(!s)return null;this.sync(i);for(let o=0;o<s.length;o++)n=this.enterInner(s[o],null,n,!1);return n}insertNode(e,n,r){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(n=this.enterInner(i,null,n))}let s=this.findPlace(e,n,r);if(s){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let o=xe.none;for(let l of s.concat(e.marks))(i.type?i.type.allowsMarkType(l.type):$a(l.type,e.type))&&(o=l.addToSet(o));return i.content.push(e.mark(o)),!0}return!1}enter(e,n,r,s){let i=this.findPlace(e.create(n),r,!1);return i&&(i=this.enterInner(e,n,r,!0,s)),i}enterInner(e,n,r,s=!1,i){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let l=Ra(e,i,o.options);o.options&qr&&o.content.length==0&&(l|=qr);let a=xe.none;return r=r.filter(c=>(o.type?o.type.allowsMarkType(c.type):$a(c.type,e))?(a=c.addToSet(a),!1):!0),this.nodes.push(new Ts(e,n,a,s,null,l)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=ns)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let s=r.length-1;s>=0;s--)e+=r[s].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let s=0;s<this.find.length;s++)this.find[s].pos==null&&e.nodeType==1&&e.contains(this.find[s].node)&&n.compareDocumentPosition(this.find[s].node)&(r?2:4)&&(this.find[s].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,s=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(s?0:1),o=(l,a)=>{for(;l>=0;l--){let c=n[l];if(c==""){if(l==n.length-1||l==0)continue;for(;a>=i;a--)if(o(l-1,a))return!0;return!1}else{let u=a>0||a==0&&s?this.nodes[a].type:r&&a>=i?r.node(a-i).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;a--}}return!0};return o(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function G1(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&qd.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function J1(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Ba(t){let e={};for(let n in t)e[n]=t[n];return e}function $a(t,e){let n=e.schema.nodes;for(let r in n){let s=n[r];if(!s.allowsMarkType(t))continue;let i=[],o=l=>{i.push(l);for(let a=0;a<l.edgeCount;a++){let{type:c,next:u}=l.edge(a);if(c==e||i.indexOf(u)<0&&o(u))return!0}};if(o(s.contentMatch))return!0}}class tr{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=Es(n).createDocumentFragment());let s=r,i=[];return e.forEach(o=>{if(i.length||o.marks.length){let l=0,a=0;for(;l<i.length&&a<o.marks.length;){let c=o.marks[a];if(!this.marks[c.type.name]){a++;continue}if(!c.eq(i[l][0])||c.type.spec.spanning===!1)break;l++,a++}for(;l<i.length;)s=i.pop()[1];for(;a<o.marks.length;){let c=o.marks[a++],u=this.serializeMark(c,o.isInline,n);u&&(i.push([c,s]),s.appendChild(u.dom),s=u.contentDOM||u.dom)}}s.appendChild(this.serializeNodeInner(o,n))}),r}serializeNodeInner(e,n){if(e.isText)return Es(n).createTextNode(e.text);let{dom:r,contentDOM:s}=Ws(Es(n),this.nodes[e.type.name](e),null,e.attrs);if(s){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,s)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let s=e.marks.length-1;s>=0;s--){let i=this.serializeMark(e.marks[s],e.isInline,n);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(e,n,r={}){let s=this.marks[e.type.name];return s&&Ws(Es(r),s(e,n),null,e.attrs)}static renderSpec(e,n,r=null,s){return typeof n=="string"?{dom:e.createTextNode(n)}:Ws(e,n,r,s)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new tr(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=Pa(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return Pa(e.marks)}}function Pa(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Es(t){return t.document||window.document}const za=new WeakMap;function Y1(t){let e=za.get(t);return e===void 0&&za.set(t,e=Q1(t)),e}function Q1(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let s=0;s<r.length;s++)n(r[s]);else for(let s in r)n(r[s])}return n(t),e}function Ws(t,e,n,r){if(e.nodeType==1)return{dom:e};if(e.dom&&e.dom.nodeType==1)return e;let s=e[0],i;if(typeof s!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(i=Y1(r))&&i.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=s.indexOf(" ");o>0&&(n=s.slice(0,o),s=s.slice(o+1));let l,a=n?t.createElementNS(n,s):t.createElement(s),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let h in c)if(c[h]!=null){let p=h.indexOf(" ");p>0?a.setAttributeNS(h.slice(0,p),h.slice(p+1),c[h]):h=="style"&&a.style?a.style.cssText=c[h]:a.setAttribute(h,c[h])}}for(let h=u;h<e.length;h++){let p=e[h];if(p===0){if(h<e.length-1||h>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else if(typeof p=="string")a.appendChild(t.createTextNode(p));else{let{dom:f,contentDOM:m}=Ws(t,p,n,r);if(a.appendChild(f),m){if(l)throw new RangeError("Multiple content holes");l=m}}}return{dom:a,contentDOM:l}}const Ud=65535,Kd=Math.pow(2,16);function X1(t,e){return t+e*Kd}function Fa(t){return t&Ud}function Z1(t){return(t-(t&Ud))/Kd}const Gd=1,Jd=2,Vs=4,Yd=8;class Qo{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&Yd)>0}get deletedBefore(){return(this.delInfo&(Gd|Vs))>0}get deletedAfter(){return(this.delInfo&(Jd|Vs))>0}get deletedAcross(){return(this.delInfo&Vs)>0}}class yt{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&yt.empty)return yt.empty}recover(e){let n=0,r=Fa(e);if(!this.inverted)for(let s=0;s<r;s++)n+=this.ranges[s*3+2]-this.ranges[s*3+1];return this.ranges[r*3]+n+Z1(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let s=0,i=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?s:0);if(a>e)break;let c=this.ranges[l+i],u=this.ranges[l+o],h=a+c;if(e<=h){let p=c?e==a?-1:e==h?1:n:n,f=a+s+(p<0?0:u);if(r)return f;let m=e==(n<0?a:h)?null:X1(l/3,e-a),g=e==a?Jd:e==h?Gd:Vs;return(n<0?e!=a:e!=h)&&(g|=Yd),new Qo(f,g,m)}s+=u-c}return r?e+s:new Qo(e+s,0,null)}touches(e,n){let r=0,s=Fa(n),i=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?r:0);if(a>e)break;let c=this.ranges[l+i],u=a+c;if(e<=u&&l==s*3)return!0;r+=this.ranges[l+o]-c}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let s=0,i=0;s<this.ranges.length;s+=3){let o=this.ranges[s],l=o-(this.inverted?i:0),a=o+(this.inverted?0:i),c=this.ranges[s+n],u=this.ranges[s+r];e(l,l+c,a,a+u),i+=u-c}}invert(){return new yt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?yt.empty:new yt(e<0?[0,-e,0]:[0,0,e])}}yt.empty=new yt([]);class rs{constructor(e,n,r=0,s=e?e.length:0){this.mirror=n,this.from=r,this.to=s,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new rs(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,r=this._maps.length;n<e._maps.length;n++){let s=e.getMirror(n);this.appendMap(e._maps[n],s!=null&&s<n?r+s:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this._maps.length+e._maps.length;n>=0;n--){let s=e.getMirror(n);this.appendMap(e._maps[n].invert(),s!=null&&s>n?r-s-1:void 0)}}invert(){let e=new rs;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let s=0;for(let i=this.from;i<this.to;i++){let o=this._maps[i],l=o.mapResult(e,n);if(l.recover!=null){let a=this.getMirror(i);if(a!=null&&a>i&&a<this.to){i=a,e=this._maps[a].recover(l.recover);continue}}s|=l.delInfo,e=l.pos}return r?e:new Qo(e,s,null)}}const fo=Object.create(null);class rt{getMap(){return yt.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=fo[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in fo)throw new RangeError("Duplicate use of step JSON ID "+e);return fo[e]=n,n.prototype.jsonID=e,n}}class ze{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new ze(e,null)}static fail(e){return new ze(null,e)}static fromReplace(e,n,r,s){try{return ze.ok(e.replace(n,r,s))}catch(i){if(i instanceof Ys)return ze.fail(i.message);throw i}}}function Tl(t,e,n){let r=[];for(let s=0;s<t.childCount;s++){let i=t.child(s);i.content.size&&(i=i.copy(Tl(i.content,e,i))),i.isInline&&(i=e(i,n,s)),r.push(i)}return M.fromArray(r)}class bn extends rt{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),s=r.node(r.sharedDepth(this.to)),i=new F(Tl(n.content,(o,l)=>!o.isAtom||!l.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),s),n.openStart,n.openEnd);return ze.fromReplace(e,this.from,this.to,i)}invert(){return new Rt(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new bn(n.pos,r.pos,this.mark)}merge(e){return e instanceof bn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new bn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new bn(n.from,n.to,e.markFromJSON(n.mark))}}rt.jsonID("addMark",bn);class Rt extends rt{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new F(Tl(n.content,s=>s.mark(this.mark.removeFromSet(s.marks)),e),n.openStart,n.openEnd);return ze.fromReplace(e,this.from,this.to,r)}invert(){return new bn(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Rt(n.pos,r.pos,this.mark)}merge(e){return e instanceof Rt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Rt(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Rt(n.from,n.to,e.markFromJSON(n.mark))}}rt.jsonID("removeMark",Rt);class yn extends rt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return ze.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return ze.fromReplace(e,this.pos,this.pos+1,new F(M.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let s=0;s<n.marks.length;s++)if(!n.marks[s].isInSet(r))return new yn(this.pos,n.marks[s]);return new yn(this.pos,this.mark)}}return new Yn(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new yn(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new yn(n.pos,e.markFromJSON(n.mark))}}rt.jsonID("addNodeMark",yn);class Yn extends rt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return ze.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return ze.fromReplace(e,this.pos,this.pos+1,new F(M.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new yn(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Yn(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Yn(n.pos,e.markFromJSON(n.mark))}}rt.jsonID("removeNodeMark",Yn);class Pe extends rt{constructor(e,n,r,s=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=s}apply(e){return this.structure&&Xo(e,this.from,this.to)?ze.fail("Structure replace would overwrite content"):ze.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new yt([this.from,this.to-this.from,this.slice.size])}invert(e){return new Pe(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.to,-1),r=this.from==this.to&&Pe.MAP_BIAS<0?n:e.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new Pe(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof Pe)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?F.empty:new F(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Pe(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?F.empty:new F(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Pe(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Pe(n.from,n.to,F.fromJSON(e,n.slice),!!n.structure)}}Pe.MAP_BIAS=1;rt.jsonID("replace",Pe);class Ve extends rt{constructor(e,n,r,s,i,o,l=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=s,this.slice=i,this.insert=o,this.structure=l}apply(e){if(this.structure&&(Xo(e,this.from,this.gapFrom)||Xo(e,this.gapTo,this.to)))return ze.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return ze.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?ze.fromReplace(e,this.from,this.to,r):ze.fail("Content does not fit in gap")}getMap(){return new yt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new Ve(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),s=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||s<n.pos||i>r.pos?null:new Ve(n.pos,r.pos,s,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Ve(n.from,n.to,n.gapFrom,n.gapTo,F.fromJSON(e,n.slice),n.insert,!!n.structure)}}rt.jsonID("replaceAround",Ve);function Xo(t,e,n){let r=t.resolve(e),s=n-e,i=r.depth;for(;s>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,s--;if(s>0){let o=r.node(i).maybeChild(r.indexAfter(i));for(;s>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,s--}}return!1}function ex(t,e,n,r){let s=[],i=[],o,l;t.doc.nodesBetween(e,n,(a,c,u)=>{if(!a.isInline)return;let h=a.marks;if(!r.isInSet(h)&&u.type.allowsMarkType(r.type)){let p=Math.max(c,e),f=Math.min(c+a.nodeSize,n),m=r.addToSet(h);for(let g=0;g<h.length;g++)h[g].isInSet(m)||(o&&o.to==p&&o.mark.eq(h[g])?o.to=f:s.push(o=new Rt(p,f,h[g])));l&&l.to==p?l.to=f:i.push(l=new bn(p,f,r))}}),s.forEach(a=>t.step(a)),i.forEach(a=>t.step(a))}function tx(t,e,n,r){let s=[],i=0;t.doc.nodesBetween(e,n,(o,l)=>{if(!o.isInline)return;i++;let a=null;if(r instanceof zi){let c=o.marks,u;for(;u=r.isInSet(c);)(a||(a=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(o.marks)&&(a=[r]):a=o.marks;if(a&&a.length){let c=Math.min(l+o.nodeSize,n);for(let u=0;u<a.length;u++){let h=a[u],p;for(let f=0;f<s.length;f++){let m=s[f];m.step==i-1&&h.eq(s[f].style)&&(p=m)}p?(p.to=c,p.step=i):s.push({style:h,from:Math.max(l,e),to:c,step:i})}}}),s.forEach(o=>t.step(new Rt(o.from,o.to,o.style)))}function El(t,e,n,r=n.contentMatch,s=!0){let i=t.doc.nodeAt(e),o=[],l=e+1;for(let a=0;a<i.childCount;a++){let c=i.child(a),u=l+c.nodeSize,h=r.matchType(c.type);if(!h)o.push(new Pe(l,u,F.empty));else{r=h;for(let p=0;p<c.marks.length;p++)n.allowsMarkType(c.marks[p].type)||t.step(new Rt(l,u,c.marks[p]));if(s&&c.isText&&n.whitespace!="pre"){let p,f=/\r?\n|\r/g,m;for(;p=f.exec(c.text);)m||(m=new F(M.from(n.schema.text(" ",n.allowedMarks(c.marks))),0,0)),o.push(new Pe(l+p.index,l+p.index+p[0].length,m))}}l=u}if(!r.validEnd){let a=r.fillBefore(M.empty,!0);t.replace(l,l,new F(a,0,0))}for(let a=o.length-1;a>=0;a--)t.step(o[a])}function nx(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function _r(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth,s=0,i=0;;--r){let o=t.$from.node(r),l=t.$from.index(r)+s,a=t.$to.indexAfter(r)-i;if(r<t.depth&&o.canReplace(l,a,n))return r;if(r==0||o.type.spec.isolating||!nx(o,l,a))break;l&&(s=1),a<o.childCount&&(i=1)}return null}function rx(t,e,n){let{$from:r,$to:s,depth:i}=e,o=r.before(i+1),l=s.after(i+1),a=o,c=l,u=M.empty,h=0;for(let m=i,g=!1;m>n;m--)g||r.index(m)>0?(g=!0,u=M.from(r.node(m).copy(u)),h++):a--;let p=M.empty,f=0;for(let m=i,g=!1;m>n;m--)g||s.after(m+1)<s.end(m)?(g=!0,p=M.from(s.node(m).copy(p)),f++):c++;t.step(new Ve(a,c,o,l,new F(u.append(p),h,f),u.size-h,!0))}function Ml(t,e,n=null,r=t){let s=sx(t,e),i=s&&ix(r,e);return i?s.map(Ha).concat({type:e,attrs:n}).concat(i.map(Ha)):null}function Ha(t){return{type:t,attrs:null}}function sx(t,e){let{parent:n,startIndex:r,endIndex:s}=t,i=n.contentMatchAt(r).findWrapping(e);if(!i)return null;let o=i.length?i[0]:e;return n.canReplaceWith(r,s,o)?i:null}function ix(t,e){let{parent:n,startIndex:r,endIndex:s}=t,i=n.child(r),o=e.contentMatch.findWrapping(i.type);if(!o)return null;let a=(o.length?o[o.length-1]:e).contentMatch;for(let c=r;a&&c<s;c++)a=a.matchType(n.child(c).type);return!a||!a.validEnd?null:o}function ox(t,e,n){let r=M.empty;for(let o=n.length-1;o>=0;o--){if(r.size){let l=n[o].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=M.from(n[o].type.create(n[o].attrs,r))}let s=e.start,i=e.end;t.step(new Ve(s,i,s,i,new F(r,0,0),n.length,!0))}function lx(t,e,n,r,s){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=t.steps.length;t.doc.nodesBetween(e,n,(o,l)=>{let a=typeof s=="function"?s(o):s;if(o.isTextblock&&!o.hasMarkup(r,a)&&ax(t.doc,t.mapping.slice(i).map(l),r)){let c=null;if(r.schema.linebreakReplacement){let f=r.whitespace=="pre",m=!!r.contentMatch.matchType(r.schema.linebreakReplacement);f&&!m?c=!1:!f&&m&&(c=!0)}c===!1&&Xd(t,o,l,i),El(t,t.mapping.slice(i).map(l,1),r,void 0,c===null);let u=t.mapping.slice(i),h=u.map(l,1),p=u.map(l+o.nodeSize,1);return t.step(new Ve(h,p,h+1,p-1,new F(M.from(r.create(a,null,o.marks)),0,0),1,!0)),c===!0&&Qd(t,o,l,i),!1}})}function Qd(t,e,n,r){e.forEach((s,i)=>{if(s.isText){let o,l=/\r?\n|\r/g;for(;o=l.exec(s.text);){let a=t.mapping.slice(r).map(n+1+i+o.index);t.replaceWith(a,a+1,e.type.schema.linebreakReplacement.create())}}})}function Xd(t,e,n,r){e.forEach((s,i)=>{if(s.type==s.type.schema.linebreakReplacement){let o=t.mapping.slice(r).map(n+1+i);t.replaceWith(o,o+1,e.type.schema.text(`
|
|
21
|
+
`))}})}function ax(t,e,n){let r=t.resolve(e),s=r.index();return r.parent.canReplaceWith(s,s+1,n)}function cx(t,e,n,r,s){let i=t.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let o=n.create(r,null,s||i.marks);if(i.isLeaf)return t.replaceWith(e,e+i.nodeSize,o);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new Ve(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new F(M.from(o),0,0),1,!0))}function sn(t,e,n=1,r){let s=t.resolve(e),i=s.depth-n,o=r&&r[r.length-1]||s.parent;if(i<0||s.parent.type.spec.isolating||!s.parent.canReplace(s.index(),s.parent.childCount)||!o.type.validContent(s.parent.content.cutByIndex(s.index(),s.parent.childCount)))return!1;for(let c=s.depth-1,u=n-2;c>i;c--,u--){let h=s.node(c),p=s.index(c);if(h.type.spec.isolating)return!1;let f=h.content.cutByIndex(p,h.childCount),m=r&&r[u+1];m&&(f=f.replaceChild(0,m.type.create(m.attrs)));let g=r&&r[u]||h;if(!h.canReplace(p+1,h.childCount)||!g.type.validContent(f))return!1}let l=s.indexAfter(i),a=r&&r[0];return s.node(i).canReplaceWith(l,l,a?a.type:s.node(i+1).type)}function dx(t,e,n=1,r){let s=t.doc.resolve(e),i=M.empty,o=M.empty;for(let l=s.depth,a=s.depth-n,c=n-1;l>a;l--,c--){i=M.from(s.node(l).copy(i));let u=r&&r[c];o=M.from(u?u.type.create(u.attrs,o):s.node(l).copy(o))}t.step(new Pe(e,e,new F(i.append(o),n,n),!0))}function An(t,e){let n=t.resolve(e),r=n.index();return Zd(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function ux(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let s=0;s<e.childCount;s++){let i=e.child(s),o=i.type==r?t.type.schema.nodes.text:i.type;if(n=n.matchType(o),!n||!t.type.allowsMarks(i.marks))return!1}return n.validEnd}function Zd(t,e){return!!(t&&e&&!t.isLeaf&&ux(t,e))}function Fi(t,e,n=-1){let r=t.resolve(e);for(let s=r.depth;;s--){let i,o,l=r.index(s);if(s==r.depth?(i=r.nodeBefore,o=r.nodeAfter):n>0?(i=r.node(s+1),l++,o=r.node(s).maybeChild(l)):(i=r.node(s).maybeChild(l-1),o=r.node(s+1)),i&&!i.isTextblock&&Zd(i,o)&&r.node(s).canReplace(l,l+1))return e;if(s==0)break;e=n<0?r.before(s):r.after(s)}}function hx(t,e,n){let r=null,{linebreakReplacement:s}=t.doc.type.schema,i=t.doc.resolve(e-n),o=i.node().type;if(s&&o.inlineContent){let u=o.whitespace=="pre",h=!!o.contentMatch.matchType(s);u&&!h?r=!1:!u&&h&&(r=!0)}let l=t.steps.length;if(r===!1){let u=t.doc.resolve(e+n);Xd(t,u.node(),u.before(),l)}o.inlineContent&&El(t,e+n-1,o,i.node().contentMatchAt(i.index()),r==null);let a=t.mapping.slice(l),c=a.map(e-n);if(t.step(new Pe(c,a.map(e+n,-1),F.empty,!0)),r===!0){let u=t.doc.resolve(c);Qd(t,u.node(),u.before(),t.steps.length)}return t}function fx(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let s=r.depth-1;s>=0;s--){let i=r.index(s);if(r.node(s).canReplaceWith(i,i,n))return r.before(s+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(let s=r.depth-1;s>=0;s--){let i=r.indexAfter(s);if(r.node(s).canReplaceWith(i,i,n))return r.after(s+1);if(i<r.node(s).childCount)return null}return null}function eu(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let s=n.content;for(let i=0;i<n.openStart;i++)s=s.firstChild.content;for(let i=1;i<=(n.openStart==0&&n.size?2:1);i++)for(let o=r.depth;o>=0;o--){let l=o==r.depth?0:r.pos<=(r.start(o+1)+r.end(o+1))/2?-1:1,a=r.index(o)+(l>0?1:0),c=r.node(o),u=!1;if(i==1)u=c.canReplace(a,a,s);else{let h=c.contentMatchAt(a).findWrapping(s.firstChild.type);u=h&&c.canReplaceWith(a,a,h[0])}if(u)return l==0?r.pos:l<0?r.before(o+1):r.after(o+1)}return null}function Hi(t,e,n=e,r=F.empty){if(e==n&&!r.size)return null;let s=t.resolve(e),i=t.resolve(n);return tu(s,i,r)?new Pe(e,n,r):new px(s,i,r).fit()}function tu(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class px{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=M.empty;for(let s=0;s<=e.depth;s++){let i=e.node(s);this.frontier.push({type:i.type,match:i.contentMatchAt(e.indexAfter(s))})}for(let s=e.depth;s>0;s--)this.placed=M.from(e.node(s).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,s=this.close(e<0?this.$to:r.doc.resolve(e));if(!s)return null;let i=this.placed,o=r.depth,l=s.depth;for(;o&&l&&i.childCount==1;)i=i.firstChild.content,o--,l--;let a=new F(i,o,l);return e>-1?new Ve(r.pos,e,this.$to.pos,this.$to.end(),a,n):a.size||r.pos!=this.$to.pos?new Pe(r.pos,s.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,s=this.unplaced.openEnd;r<e;r++){let i=n.firstChild;if(n.childCount>1&&(s=0),i.type.spec.isolating&&s<=r){e=r;break}n=i.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let s,i=null;r?(i=po(this.unplaced.content,r-1).firstChild,s=i.content):s=this.unplaced.content;let o=s.firstChild;for(let l=this.depth;l>=0;l--){let{type:a,match:c}=this.frontier[l],u,h=null;if(n==1&&(o?c.matchType(o.type)||(h=c.fillBefore(M.from(o),!1)):i&&a.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:l,parent:i,inject:h};if(n==2&&o&&(u=c.findWrapping(o.type)))return{sliceDepth:r,frontierDepth:l,parent:i,wrap:u};if(i&&c.matchType(i.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,s=po(e,n);return!s.childCount||s.firstChild.isLeaf?!1:(this.unplaced=new F(e,n+1,Math.max(r,s.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,s=po(e,n);if(s.childCount<=1&&n>0){let i=e.size-n<=n+s.size;this.unplaced=new F(Pr(e,n-1,1),n-1,i?n-1:r)}else this.unplaced=new F(Pr(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:s,wrap:i}){for(;this.depth>n;)this.closeFrontierNode();if(i)for(let g=0;g<i.length;g++)this.openFrontierNode(i[g]);let o=this.unplaced,l=r?r.content:o.content,a=o.openStart-e,c=0,u=[],{match:h,type:p}=this.frontier[n];if(s){for(let g=0;g<s.childCount;g++)u.push(s.child(g));h=h.matchFragment(s)}let f=l.size+e-(o.content.size-o.openEnd);for(;c<l.childCount;){let g=l.child(c),b=h.matchType(g.type);if(!b)break;c++,(c>1||a==0||g.content.size)&&(h=b,u.push(nu(g.mark(p.allowedMarks(g.marks)),c==1?a:0,c==l.childCount?f:-1)))}let m=c==l.childCount;m||(f=-1),this.placed=zr(this.placed,n,M.from(u)),this.frontier[n].match=h,m&&f<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,b=l;g<f;g++){let y=b.lastChild;this.frontier.push({type:y.type,match:y.contentMatchAt(y.childCount)}),b=y.content}this.unplaced=m?e==0?F.empty:new F(Pr(o.content,e-1,1),e-1,f<0?o.openEnd:e-1):new F(Pr(o.content,e,c),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!mo(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,s=this.$to.after(r);for(;r>1&&s==this.$to.end(--r);)++s;return s}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:s}=this.frontier[n],i=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),o=mo(e,n,s,r,i);if(o){for(let l=n-1;l>=0;l--){let{match:a,type:c}=this.frontier[l],u=mo(e,l,c,a,!0);if(!u||u.childCount)continue e}return{depth:n,fit:o,move:i?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=zr(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let s=e.node(r),i=s.type.contentMatch.fillBefore(s.content,!0,e.index(r));this.openFrontierNode(s.type,s.attrs,i)}return e}openFrontierNode(e,n=null,r){let s=this.frontier[this.depth];s.match=s.match.matchType(e),this.placed=zr(this.placed,this.depth,M.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(M.empty,!0);n.childCount&&(this.placed=zr(this.placed,this.frontier.length,n))}}function Pr(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Pr(t.firstChild.content,e-1,n)))}function zr(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(zr(t.lastChild.content,e-1,n)))}function po(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function nu(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,nu(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(M.empty,!0)))),t.copy(r)}function mo(t,e,n,r,s){let i=t.node(e),o=s?t.indexAfter(e):t.index(e);if(o==i.childCount&&!n.compatibleContent(i.type))return null;let l=r.fillBefore(i.content,!0,o);return l&&!mx(n,i.content,o)?l:null}function mx(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function gx(t){return t.spec.defining||t.spec.definingForContent}function bx(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let s=t.doc.resolve(e),i=t.doc.resolve(n);if(tu(s,i,r))return t.step(new Pe(e,n,r));let o=su(s,i);o[o.length-1]==0&&o.pop();let l=-(s.depth+1);o.unshift(l);for(let p=s.depth,f=s.pos-1;p>0;p--,f--){let m=s.node(p).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;o.indexOf(p)>-1?l=p:s.before(p)==f&&o.splice(1,0,-p)}let a=o.indexOf(l),c=[],u=r.openStart;for(let p=r.content,f=0;;f++){let m=p.firstChild;if(c.push(m),f==r.openStart)break;p=m.content}for(let p=u-1;p>=0;p--){let f=c[p],m=gx(f.type);if(m&&!f.sameMarkup(s.node(Math.abs(l)-1)))u=p;else if(m||!f.type.isTextblock)break}for(let p=r.openStart;p>=0;p--){let f=(p+u+1)%(r.openStart+1),m=c[f];if(m)for(let g=0;g<o.length;g++){let b=o[(g+a)%o.length],y=!0;b<0&&(y=!1,b=-b);let v=s.node(b-1),_=s.index(b-1);if(v.canReplaceWith(_,_,m.type,m.marks))return t.replace(s.before(b),y?i.after(b):n,new F(ru(r.content,0,r.openStart,f),f,r.openEnd))}}let h=t.steps.length;for(let p=o.length-1;p>=0&&(t.replace(e,n,r),!(t.steps.length>h));p--){let f=o[p];f<0||(e=s.before(f),n=i.after(f))}}function ru(t,e,n,r,s){if(e<n){let i=t.firstChild;t=t.replaceChild(0,i.copy(ru(i.content,e+1,n,r,i)))}if(e>r){let i=s.contentMatchAt(0),o=i.fillBefore(t).append(t);t=o.append(i.matchFragment(o).fillBefore(M.empty,!0))}return t}function yx(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let s=fx(t.doc,e,r.type);s!=null&&(e=n=s)}t.replaceRange(e,n,new F(M.from(r),0,0))}function xx(t,e,n){let r=t.doc.resolve(e),s=t.doc.resolve(n);if(r.parent.isTextblock&&s.parent.isTextblock&&r.start()!=s.start()&&r.parentOffset==0&&s.parentOffset==0){let o=r.sharedDepth(n),l=!1;for(let a=r.depth;a>o;a--)r.node(a).type.spec.isolating&&(l=!0);for(let a=s.depth;a>o;a--)s.node(a).type.spec.isolating&&(l=!0);if(!l){for(let a=r.depth;a>0&&e==r.start(a);a--)e=r.before(a);for(let a=s.depth;a>0&&n==s.start(a);a--)n=s.before(a);r=t.doc.resolve(e),s=t.doc.resolve(n)}}let i=su(r,s);for(let o=0;o<i.length;o++){let l=i[o],a=o==i.length-1;if(a&&l==0||r.node(l).type.contentMatch.validEnd)return t.delete(r.start(l),s.end(l));if(l>0&&(a||r.node(l-1).canReplace(r.index(l-1),s.indexAfter(l-1))))return t.delete(r.before(l),s.after(l))}for(let o=1;o<=r.depth&&o<=s.depth;o++)if(e-r.start(o)==r.depth-o&&n>r.end(o)&&s.end(o)-n!=s.depth-o&&r.start(o-1)==s.start(o-1)&&r.node(o-1).canReplace(r.index(o-1),s.index(o-1)))return t.delete(r.before(o),n);t.delete(e,n)}function su(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let s=r;s>=0;s--){let i=t.start(s);if(i<t.pos-(t.depth-s)||e.end(s)>e.pos+(e.depth-s)||t.node(s).type.spec.isolating||e.node(s).type.spec.isolating)break;(i==e.start(s)||s==t.depth&&s==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&s&&e.start(s-1)==i-1)&&n.push(s)}return n}class hr extends rt{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return ze.fail("No node at attribute step's position");let r=Object.create(null);for(let i in n.attrs)r[i]=n.attrs[i];r[this.attr]=this.value;let s=n.type.create(r,null,n.marks);return ze.fromReplace(e,this.pos,this.pos+1,new F(M.from(s),0,n.isLeaf?0:1))}getMap(){return yt.empty}invert(e){return new hr(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new hr(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new hr(n.pos,n.attr,n.value)}}rt.jsonID("attr",hr);class ss extends rt{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let s in e.attrs)n[s]=e.attrs[s];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return ze.ok(r)}getMap(){return yt.empty}invert(e){return new ss(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new ss(n.attr,n.value)}}rt.jsonID("docAttr",ss);let mr=class extends Error{};mr=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};mr.prototype=Object.create(Error.prototype);mr.prototype.constructor=mr;mr.prototype.name="TransformError";class iu{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new rs}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new mr(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,n=-1e9;for(let r=0;r<this.mapping.maps.length;r++){let s=this.mapping.maps[r];r&&(e=s.map(e,1),n=s.map(n,-1)),s.forEach((i,o,l,a)=>{e=Math.min(e,l),n=Math.max(n,a)})}return e==1e9?null:{from:e,to:n}}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=F.empty){let s=Hi(this.doc,e,n,r);return s&&this.step(s),this}replaceWith(e,n,r){return this.replace(e,n,new F(M.from(r),0,0))}delete(e,n){return this.replace(e,n,F.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return bx(this,e,n,r),this}replaceRangeWith(e,n,r){return yx(this,e,n,r),this}deleteRange(e,n){return xx(this,e,n),this}lift(e,n){return rx(this,e,n),this}join(e,n=1){return hx(this,e,n),this}wrap(e,n){return ox(this,e,n),this}setBlockType(e,n=e,r,s=null){return lx(this,e,n,r,s),this}setNodeMarkup(e,n,r=null,s){return cx(this,e,n,r,s),this}setNodeAttribute(e,n,r){return this.step(new hr(e,n,r)),this}setDocAttribute(e,n){return this.step(new ss(e,n)),this}addNodeMark(e,n){return this.step(new yn(e,n)),this}removeNodeMark(e,n){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n instanceof xe)n.isInSet(r.marks)&&this.step(new Yn(e,n));else{let s=r.marks,i,o=[];for(;i=n.isInSet(s);)o.push(new Yn(e,i)),s=i.removeFromSet(s);for(let l=o.length-1;l>=0;l--)this.step(o[l])}return this}split(e,n=1,r){return dx(this,e,n,r),this}addMark(e,n,r){return ex(this,e,n,r),this}removeMark(e,n,r){return tx(this,e,n,r),this}clearIncompatible(e,n,r){return El(this,e,n,r),this}}const go=Object.create(null);class oe{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new vx(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=F.empty){let r=n.content.lastChild,s=null;for(let l=0;l<n.openEnd;l++)s=r,r=r.lastChild;let i=e.steps.length,o=this.ranges;for(let l=0;l<o.length;l++){let{$from:a,$to:c}=o[l],u=e.mapping.slice(i);e.replaceRange(u.map(a.pos),u.map(c.pos),l?F.empty:n),l==0&&qa(e,i,(r?r.isInline:s&&s.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,s=this.ranges;for(let i=0;i<s.length;i++){let{$from:o,$to:l}=s[i],a=e.mapping.slice(r),c=a.map(o.pos),u=a.map(l.pos);i?e.deleteRange(c,u):(e.replaceRangeWith(c,u,n),qa(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let s=e.parent.inlineContent?new X(e):ar(e.node(0),e.parent,e.pos,e.index(),n,r);if(s)return s;for(let i=e.depth-1;i>=0;i--){let o=n<0?ar(e.node(0),e.node(i),e.before(i+1),e.index(i),n,r):ar(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,n,r);if(o)return o}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new xt(e.node(0))}static atStart(e){return ar(e,e,0,0,1)||new xt(e)}static atEnd(e){return ar(e,e,e.content.size,e.childCount,-1)||new xt(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=go[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in go)throw new RangeError("Duplicate use of selection JSON ID "+e);return go[e]=n,n.prototype.jsonID=e,n}getBookmark(){return X.between(this.$anchor,this.$head).getBookmark()}}oe.prototype.visible=!0;class vx{constructor(e,n){this.$from=e,this.$to=n}}let Wa=!1;function Va(t){!Wa&&!t.parent.inlineContent&&(Wa=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class X extends oe{constructor(e,n=e){Va(e),Va(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return oe.near(r);let s=e.resolve(n.map(this.anchor));return new X(s.parent.inlineContent?s:r,r)}replace(e,n=F.empty){if(super.replace(e,n),n==F.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof X&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Wi(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new X(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let s=e.resolve(n);return new this(s,r==n?s:e.resolve(r))}static between(e,n,r){let s=e.pos-n.pos;if((!r||s)&&(r=s>=0?1:-1),!n.parent.inlineContent){let i=oe.findFrom(n,r,!0)||oe.findFrom(n,-r,!0);if(i)n=i.$head;else return oe.near(n,r)}return e.parent.inlineContent||(s==0?e=n:(e=(oe.findFrom(e,-r,!0)||oe.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=s<0&&(e=n))),new X(e,n)}}oe.jsonID("text",X);class Wi{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Wi(e.map(this.anchor),e.map(this.head))}resolve(e){return X.between(e.resolve(this.anchor),e.resolve(this.head))}}class J extends oe{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:s}=n.mapResult(this.anchor),i=e.resolve(s);return r?oe.near(i):new J(i)}content(){return new F(M.from(this.node),0,0)}eq(e){return e instanceof J&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new jl(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new J(e.resolve(n.anchor))}static create(e,n){return new J(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}J.prototype.visible=!1;oe.jsonID("node",J);class jl{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new Wi(r,r):new jl(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&J.isSelectable(r)?new J(n):oe.near(n)}}class xt extends oe{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=F.empty){if(n==F.empty){e.delete(0,e.doc.content.size);let r=oe.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new xt(e)}map(e){return new xt(e)}eq(e){return e instanceof xt}getBookmark(){return _x}}oe.jsonID("all",xt);const _x={map(){return this},resolve(t){return new xt(t)}};function ar(t,e,n,r,s,i=!1){if(e.inlineContent)return X.create(t,n);for(let o=r-(s>0?0:1);s>0?o<e.childCount:o>=0;o+=s){let l=e.child(o);if(l.isAtom){if(!i&&J.isSelectable(l))return J.create(t,n-(s<0?l.nodeSize:0))}else{let a=ar(t,l,n+s,s<0?l.childCount:0,s,i);if(a)return a}n+=l.nodeSize*s}return null}function qa(t,e,n){let r=t.steps.length-1;if(r<e)return;let s=t.steps[r];if(!(s instanceof Pe||s instanceof Ve))return;let i=t.mapping.maps[r],o;i.forEach((l,a,c,u)=>{o==null&&(o=u)}),t.setSelection(oe.near(t.doc.resolve(o),n))}const Ua=1,Ms=2,Ka=4;class kx extends iu{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|Ua)&~Ms,this.storedMarks=null,this}get selectionSet(){return(this.updated&Ua)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Ms,this}ensureMarks(e){return xe.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Ms)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~Ms,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||xe.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let s=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(s.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),!e)return this.deleteRange(n,r);let i=this.storedMarks;if(!i){let o=this.doc.resolve(n);i=r==n?o.marks():o.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,s.text(e,i)),!this.selection.empty&&this.selection.to==n+e.length&&this.setSelection(oe.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=Ka,this}get scrolledIntoView(){return(this.updated&Ka)>0}}function Ga(t,e){return!e||!t?t:t.bind(e)}class Fr{constructor(e,n,r){this.name=e,this.init=Ga(n.init,r),this.apply=Ga(n.apply,r)}}const wx=[new Fr("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Fr("selection",{init(t,e){return t.selection||oe.atStart(e.doc)},apply(t){return t.selection}}),new Fr("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Fr("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class bo{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=wx.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Fr(r.key,r.spec.state,r))})}}class ur{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let s=this.config.plugins[r];if(s.spec.filterTransaction&&!s.spec.filterTransaction.call(s,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),s=null;for(;;){let i=!1;for(let o=0;o<this.config.plugins.length;o++){let l=this.config.plugins[o];if(l.spec.appendTransaction){let a=s?s[o].n:0,c=s?s[o].state:this,u=a<n.length&&l.spec.appendTransaction.call(l,a?n.slice(a):n,c,r);if(u&&r.filterTransaction(u,o)){if(u.setMeta("appendedTransaction",e),!s){s=[];for(let h=0;h<this.config.plugins.length;h++)s.push(h<o?{state:r,n:n.length}:{state:this,n:0})}n.push(u),r=r.applyInner(u),i=!0}s&&(s[o]={state:r,n:n.length})}}if(!i)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new ur(this.config),r=this.config.fields;for(let s=0;s<r.length;s++){let i=r[s];n[i.name]=i.apply(e,this[i.name],this,n)}return n}get tr(){return new kx(this)}static create(e){let n=new bo(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new ur(n);for(let s=0;s<n.fields.length;s++)r[n.fields[s].name]=n.fields[s].init(e,r);return r}reconfigure(e){let n=new bo(this.schema,e.plugins),r=n.fields,s=new ur(n);for(let i=0;i<r.length;i++){let o=r[i].name;s[o]=this.hasOwnProperty(o)?this[o]:r[i].init(e,s)}return s}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let s=e[r],i=s.spec.state;i&&i.toJSON&&(n[r]=i.toJSON.call(s,this[s.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let s=new bo(e.schema,e.plugins),i=new ur(s);return s.fields.forEach(o=>{if(o.name=="doc")i.doc=Mt.fromJSON(e.schema,n.doc);else if(o.name=="selection")i.selection=oe.fromJSON(i.doc,n.selection);else if(o.name=="storedMarks")n.storedMarks&&(i.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let l in r){let a=r[l],c=a.spec.state;if(a.key==o.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,l)){i[o.name]=c.fromJSON.call(a,e,n[l],i);return}}i[o.name]=o.init(e,i)}}),i}}function ou(t,e,n){for(let r in t){let s=t[r];s instanceof Function?s=s.bind(e):r=="handleDOMEvents"&&(s=ou(s,e,{})),n[r]=s}return n}class Se{constructor(e){this.spec=e,this.props={},e.props&&ou(e.props,this,this.props),this.key=e.key?e.key.key:lu("plugin")}getState(e){return e[this.key]}}const yo=Object.create(null);function lu(t){return t in yo?t+"$"+ ++yo[t]:(yo[t]=0,t+"$")}class Le{constructor(e="key"){this.key=lu(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const au=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function cu(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const du=(t,e,n)=>{let r=cu(t,n);if(!r)return!1;let s=Il(r);if(!s){let o=r.blockRange(),l=o&&_r(o);return l==null?!1:(e&&e(t.tr.lift(o,l).scrollIntoView()),!0)}let i=s.nodeBefore;if(xu(t,s,e,-1))return!0;if(r.parent.content.size==0&&(gr(i,"end")||J.isSelectable(i)))for(let o=r.depth;;o--){let l=Hi(t.doc,r.before(o),r.after(o),F.empty);if(l&&l.slice.size<l.to-l.from){if(e){let a=t.tr.step(l);a.setSelection(gr(i,"end")?oe.findFrom(a.doc.resolve(a.mapping.map(s.pos,-1)),-1):J.create(a.doc,s.pos-i.nodeSize)),e(a.scrollIntoView())}return!0}if(o==1||r.node(o-1).childCount>1)break}return i.isAtom&&s.depth==r.depth-1?(e&&e(t.tr.delete(s.pos-i.nodeSize,s.pos).scrollIntoView()),!0):!1},Cx=(t,e,n)=>{let r=cu(t,n);if(!r)return!1;let s=Il(r);return s?uu(t,s,e):!1},Sx=(t,e,n)=>{let r=fu(t,n);if(!r)return!1;let s=Dl(r);return s?uu(t,s,e):!1};function uu(t,e,n){let r=e.nodeBefore,s=r,i=e.pos-1;for(;!s.isTextblock;i--){if(s.type.spec.isolating)return!1;let u=s.lastChild;if(!u)return!1;s=u}let o=e.nodeAfter,l=o,a=e.pos+1;for(;!l.isTextblock;a++){if(l.type.spec.isolating)return!1;let u=l.firstChild;if(!u)return!1;l=u}let c=Hi(t.doc,i,a,F.empty);if(!c||c.from!=i||c instanceof Pe&&c.slice.size>=a-i)return!1;if(n){let u=t.tr.step(c);u.setSelection(X.create(u.doc,i)),n(u.scrollIntoView())}return!0}function gr(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const hu=(t,e,n)=>{let{$head:r,empty:s}=t.selection,i=r;if(!s)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;i=Il(r)}let o=i&&i.nodeBefore;return!o||!J.isSelectable(o)?!1:(e&&e(t.tr.setSelection(J.create(t.doc,i.pos-o.nodeSize)).scrollIntoView()),!0)};function Il(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function fu(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const pu=(t,e,n)=>{let r=fu(t,n);if(!r)return!1;let s=Dl(r);if(!s)return!1;let i=s.nodeAfter;if(xu(t,s,e,1))return!0;if(r.parent.content.size==0&&(gr(i,"start")||J.isSelectable(i))){let o=Hi(t.doc,r.before(),r.after(),F.empty);if(o&&o.slice.size<o.to-o.from){if(e){let l=t.tr.step(o);l.setSelection(gr(i,"start")?oe.findFrom(l.doc.resolve(l.mapping.map(s.pos)),1):J.create(l.doc,l.mapping.map(s.pos))),e(l.scrollIntoView())}return!0}}return i.isAtom&&s.depth==r.depth-1?(e&&e(t.tr.delete(s.pos,s.pos+i.nodeSize).scrollIntoView()),!0):!1},mu=(t,e,n)=>{let{$head:r,empty:s}=t.selection,i=r;if(!s)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;i=Dl(r)}let o=i&&i.nodeAfter;return!o||!J.isSelectable(o)?!1:(e&&e(t.tr.setSelection(J.create(t.doc,i.pos)).scrollIntoView()),!0)};function Dl(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const Nx=(t,e)=>{let n=t.selection,r=n instanceof J,s;if(r){if(n.node.isTextblock||!An(t.doc,n.from))return!1;s=n.from}else if(s=Fi(t.doc,n.from,-1),s==null)return!1;if(e){let i=t.tr.join(s);r&&i.setSelection(J.create(i.doc,s-t.doc.resolve(s).nodeBefore.nodeSize)),e(i.scrollIntoView())}return!0},Ax=(t,e)=>{let n=t.selection,r;if(n instanceof J){if(n.node.isTextblock||!An(t.doc,n.to))return!1;r=n.to}else if(r=Fi(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},Tx=(t,e)=>{let{$from:n,$to:r}=t.selection,s=n.blockRange(r),i=s&&_r(s);return i==null?!1:(e&&e(t.tr.lift(s,i).scrollIntoView()),!0)},gu=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
|
|
22
|
+
`).scrollIntoView()),!0)};function Ol(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const Ex=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let s=n.node(-1),i=n.indexAfter(-1),o=Ol(s.contentMatchAt(i));if(!o||!s.canReplaceWith(i,i,o))return!1;if(e){let l=n.after(),a=t.tr.replaceWith(l,l,o.createAndFill());a.setSelection(oe.near(a.doc.resolve(l),1)),e(a.scrollIntoView())}return!0},bu=(t,e)=>{let n=t.selection,{$from:r,$to:s}=n;if(n instanceof xt||r.parent.inlineContent||s.parent.inlineContent)return!1;let i=Ol(s.parent.contentMatchAt(s.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){let o=(!r.parentOffset&&s.index()<s.parent.childCount?r:s).pos,l=t.tr.insert(o,i.createAndFill());l.setSelection(X.create(l.doc,o+1)),e(l.scrollIntoView())}return!0},yu=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let i=n.before();if(sn(t.doc,i))return e&&e(t.tr.split(i).scrollIntoView()),!0}let r=n.blockRange(),s=r&&_r(r);return s==null?!1:(e&&e(t.tr.lift(r,s).scrollIntoView()),!0)};function Mx(t){return(e,n)=>{let{$from:r,$to:s}=e.selection;if(e.selection instanceof J&&e.selection.node.isBlock)return!r.parentOffset||!sn(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let i=[],o,l,a=!1,c=!1;for(let f=r.depth;;f--)if(r.node(f).isBlock){a=r.end(f)==r.pos+(r.depth-f),c=r.start(f)==r.pos-(r.depth-f),l=Ol(r.node(f-1).contentMatchAt(r.indexAfter(f-1))),i.unshift(a&&l?{type:l}:null),o=f;break}else{if(f==1)return!1;i.unshift(null)}let u=e.tr;(e.selection instanceof X||e.selection instanceof xt)&&u.deleteSelection();let h=u.mapping.map(r.pos),p=sn(u.doc,h,i.length,i);if(p||(i[0]=l?{type:l}:null,p=sn(u.doc,h,i.length,i)),!p)return!1;if(u.split(h,i.length,i),!a&&c&&r.node(o).type!=l){let f=u.mapping.map(r.before(o)),m=u.doc.resolve(f);l&&r.node(o-1).canReplaceWith(m.index(),m.index()+1,l)&&u.setNodeMarkup(u.mapping.map(r.before(o)),l)}return n&&n(u.scrollIntoView()),!0}}const jx=Mx(),Ix=(t,e)=>{let{$from:n,to:r}=t.selection,s,i=n.sharedDepth(r);return i==0?!1:(s=n.before(i),e&&e(t.tr.setSelection(J.create(t.doc,s))),!0)};function Dx(t,e,n){let r=e.nodeBefore,s=e.nodeAfter,i=e.index();return!r||!s||!r.type.compatibleContent(s.type)?!1:!r.content.size&&e.parent.canReplace(i-1,i)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(i,i+1)||!(s.isTextblock||An(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function xu(t,e,n,r){let s=e.nodeBefore,i=e.nodeAfter,o,l,a=s.type.spec.isolating||i.type.spec.isolating;if(!a&&Dx(t,e,n))return!0;let c=!a&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(o=(l=s.contentMatchAt(s.childCount)).findWrapping(i.type))&&l.matchType(o[0]||i.type).validEnd){if(n){let f=e.pos+i.nodeSize,m=M.empty;for(let y=o.length-1;y>=0;y--)m=M.from(o[y].create(null,m));m=M.from(s.copy(m));let g=t.tr.step(new Ve(e.pos-1,f,e.pos,f,new F(m,1,0),o.length,!0)),b=g.doc.resolve(f+2*o.length);b.nodeAfter&&b.nodeAfter.type==s.type&&An(g.doc,b.pos)&&g.join(b.pos),n(g.scrollIntoView())}return!0}let u=i.type.spec.isolating||r>0&&a?null:oe.findFrom(e,1),h=u&&u.$from.blockRange(u.$to),p=h&&_r(h);if(p!=null&&p>=e.depth)return n&&n(t.tr.lift(h,p).scrollIntoView()),!0;if(c&&gr(i,"start",!0)&&gr(s,"end")){let f=s,m=[];for(;m.push(f),!f.isTextblock;)f=f.lastChild;let g=i,b=1;for(;!g.isTextblock;g=g.firstChild)b++;if(f.canReplace(f.childCount,f.childCount,g.content)){if(n){let y=M.empty;for(let _=m.length-1;_>=0;_--)y=M.from(m[_].copy(y));let v=t.tr.step(new Ve(e.pos-m.length,e.pos+i.nodeSize,e.pos+b,e.pos+i.nodeSize-b,new F(y,m.length,0),0,!0));n(v.scrollIntoView())}return!0}}return!1}function vu(t){return function(e,n){let r=e.selection,s=t<0?r.$from:r.$to,i=s.depth;for(;s.node(i).isInline;){if(!i)return!1;i--}return s.node(i).isTextblock?(n&&n(e.tr.setSelection(X.create(e.doc,t<0?s.start(i):s.end(i)))),!0):!1}}const Ox=vu(-1),Rx=vu(1);function Lx(t,e=null){return function(n,r){let{$from:s,$to:i}=n.selection,o=s.blockRange(i),l=o&&Ml(o,t,e);return l?(r&&r(n.tr.wrap(o,l).scrollIntoView()),!0):!1}}function Ja(t,e=null){return function(n,r){let s=!1;for(let i=0;i<n.selection.ranges.length&&!s;i++){let{$from:{pos:o},$to:{pos:l}}=n.selection.ranges[i];n.doc.nodesBetween(o,l,(a,c)=>{if(s)return!1;if(!(!a.isTextblock||a.hasMarkup(t,e)))if(a.type==t)s=!0;else{let u=n.doc.resolve(c),h=u.index();s=u.parent.canReplaceWith(h,h+1,t)}})}if(!s)return!1;if(r){let i=n.tr;for(let o=0;o<n.selection.ranges.length;o++){let{$from:{pos:l},$to:{pos:a}}=n.selection.ranges[o];i.setBlockType(l,a,t,e)}r(i.scrollIntoView())}return!0}}function Rl(...t){return function(e,n,r){for(let s=0;s<t.length;s++)if(t[s](e,n,r))return!0;return!1}}Rl(au,du,hu);Rl(au,pu,mu);Rl(gu,bu,yu,jx);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function Bx(t,e=null){return function(n,r){let{$from:s,$to:i}=n.selection,o=s.blockRange(i);if(!o)return!1;let l=r?n.tr:null;return $x(l,o,t,e)?(r&&r(l.scrollIntoView()),!0):!1}}function $x(t,e,n,r=null){let s=!1,i=e,o=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let a=o.resolve(e.start-2);i=new Xs(a,a,e.depth),e.endIndex<e.parent.childCount&&(e=new Xs(e.$from,o.resolve(e.$to.end(e.depth)),e.depth)),s=!0}let l=Ml(i,n,r,e);return l?(t&&Px(t,e,l,s,n),!0):!1}function Px(t,e,n,r,s){let i=M.empty;for(let u=n.length-1;u>=0;u--)i=M.from(n[u].type.create(n[u].attrs,i));t.step(new Ve(e.start-(r?2:0),e.end,e.start,e.end,new F(i,0,0),n.length,!0));let o=0;for(let u=0;u<n.length;u++)n[u].type==s&&(o=u+1);let l=n.length-o,a=e.start+n.length-(r?2:0),c=e.parent;for(let u=e.startIndex,h=e.endIndex,p=!0;u<h;u++,p=!1)!p&&sn(t.doc,a,l)&&(t.split(a,l),a+=2*l),a+=c.child(u).nodeSize;return t}function zx(t){return function(e,n){let{$from:r,$to:s}=e.selection,i=r.blockRange(s,o=>o.childCount>0&&o.firstChild.type==t);return i?n?r.node(i.depth-1).type==t?Fx(e,n,t,i):Hx(e,n,i):!0:!1}}function Fx(t,e,n,r){let s=t.tr,i=r.end,o=r.$to.end(r.depth);i<o&&(s.step(new Ve(i-1,o,i,o,new F(M.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Xs(s.doc.resolve(r.$from.pos),s.doc.resolve(o),r.depth));const l=_r(r);if(l==null)return!1;s.lift(r,l);let a=s.doc.resolve(s.mapping.map(i,-1)-1);return An(s.doc,a.pos)&&a.nodeBefore.type==a.nodeAfter.type&&s.join(a.pos),e(s.scrollIntoView()),!0}function Hx(t,e,n){let r=t.tr,s=n.parent;for(let f=n.end,m=n.endIndex-1,g=n.startIndex;m>g;m--)f-=s.child(m).nodeSize,r.delete(f-1,f+1);let i=r.doc.resolve(n.start),o=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let l=n.startIndex==0,a=n.endIndex==s.childCount,c=i.node(-1),u=i.index(-1);if(!c.canReplace(u+(l?0:1),u+1,o.content.append(a?M.empty:M.from(s))))return!1;let h=i.pos,p=h+o.nodeSize;return r.step(new Ve(h-(l?1:0),p+(a?1:0),h+1,p-1,new F((l?M.empty:M.from(s.copy(M.empty))).append(a?M.empty:M.from(s.copy(M.empty))),l?0:1,a?0:1),l?0:1)),e(r.scrollIntoView()),!0}function Wx(t){return function(e,n){let{$from:r,$to:s}=e.selection,i=r.blockRange(s,c=>c.childCount>0&&c.firstChild.type==t);if(!i)return!1;let o=i.startIndex;if(o==0)return!1;let l=i.parent,a=l.child(o-1);if(a.type!=t)return!1;if(n){let c=a.lastChild&&a.lastChild.type==l.type,u=M.from(c?t.create():null),h=new F(M.from(t.create(null,M.from(l.type.create(null,u)))),c?3:1,0),p=i.start,f=i.end;n(e.tr.step(new Ve(p-(c?3:1),f,p,f,h,1,!0)).scrollIntoView())}return!0}}const Je=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},br=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let Zo=null;const tn=function(t,e,n){let r=Zo||(Zo=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},Vx=function(){Zo=null},Qn=function(t,e,n,r){return n&&(Ya(t,e,n,r,-1)||Ya(t,e,n,r,1))},qx=/^(img|br|input|textarea|hr)$/i;function Ya(t,e,n,r,s){for(var i;;){if(t==n&&e==r)return!0;if(e==(s<0?0:Et(t))){let o=t.parentNode;if(!o||o.nodeType!=1||bs(t)||qx.test(t.nodeName)||t.contentEditable=="false")return!1;e=Je(t)+(s<0?0:1),t=o}else if(t.nodeType==1){let o=t.childNodes[e+(s<0?-1:0)];if(o.nodeType==1&&o.contentEditable=="false")if(!((i=o.pmViewDesc)===null||i===void 0)&&i.ignoreForSelection)e+=s;else return!1;else t=o,e=s<0?Et(t):0}else return!1}}function Et(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Ux(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=Et(t)}else if(t.parentNode&&!bs(t))e=Je(t),t=t.parentNode;else return null}}function Kx(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!bs(t))e=Je(t)+1,t=t.parentNode;else return null}}function Gx(t,e,n){for(let r=e==0,s=e==Et(t);r||s;){if(t==n)return!0;let i=Je(t);if(t=t.parentNode,!t)return!1;r=r&&i==0,s=s&&i==Et(t)}}function bs(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const Vi=function(t){return t.focusNode&&Qn(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Ln(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function Jx(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function Yx(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(Et(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(Et(r.startContainer),r.startOffset)}}}const Vt=typeof navigator<"u"?navigator:null,Qa=typeof document<"u"?document:null,Tn=Vt&&Vt.userAgent||"",el=/Edge\/(\d+)/.exec(Tn),_u=/MSIE \d/.exec(Tn),tl=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Tn),ht=!!(_u||tl||el),_n=_u?document.documentMode:tl?+tl[1]:el?+el[1]:0,jt=!ht&&/gecko\/(\d+)/i.test(Tn);jt&&+(/Firefox\/(\d+)/.exec(Tn)||[0,0])[1];const nl=!ht&&/Chrome\/(\d+)/.exec(Tn),Qe=!!nl,ku=nl?+nl[1]:0,nt=!ht&&!!Vt&&/Apple Computer/.test(Vt.vendor),yr=nt&&(/Mobile\/\w+/.test(Tn)||!!Vt&&Vt.maxTouchPoints>2),Tt=yr||(Vt?/Mac/.test(Vt.platform):!1),wu=Vt?/Win/.test(Vt.platform):!1,rn=/Android \d/.test(Tn),ys=!!Qa&&"webkitFontSmoothing"in Qa.documentElement.style,Qx=ys?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Xx(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Yt(t,e){return typeof t=="number"?t:t[e]}function Zx(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function Xa(t,e,n){let r=t.someProp("scrollThreshold")||0,s=t.someProp("scrollMargin")||5,i=t.dom.ownerDocument;for(let o=n||t.dom;o;){if(o.nodeType!=1){o=br(o);continue}let l=o,a=l==i.body,c=a?Xx(i):Zx(l),u=0,h=0;if(e.top<c.top+Yt(r,"top")?h=-(c.top-e.top+Yt(s,"top")):e.bottom>c.bottom-Yt(r,"bottom")&&(h=e.bottom-e.top>c.bottom-c.top?e.top+Yt(s,"top")-c.top:e.bottom-c.bottom+Yt(s,"bottom")),e.left<c.left+Yt(r,"left")?u=-(c.left-e.left+Yt(s,"left")):e.right>c.right-Yt(r,"right")&&(u=e.right-c.right+Yt(s,"right")),u||h)if(a)i.defaultView.scrollBy(u,h);else{let f=l.scrollLeft,m=l.scrollTop;h&&(l.scrollTop+=h),u&&(l.scrollLeft+=u);let g=l.scrollLeft-f,b=l.scrollTop-m;e={left:e.left-g,top:e.top-b,right:e.right-g,bottom:e.bottom-b}}let p=a?"fixed":getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(p))break;o=p=="absolute"?o.offsetParent:br(o)}}function e0(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,s;for(let i=(e.left+e.right)/2,o=n+1;o<Math.min(innerHeight,e.bottom);o+=5){let l=t.root.elementFromPoint(i,o);if(!l||l==t.dom||!t.dom.contains(l))continue;let a=l.getBoundingClientRect();if(a.top>=n-20){r=l,s=a.top;break}}return{refDOM:r,refTop:s,stack:Cu(t.dom)}}function Cu(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=br(r));return e}function t0({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;Su(n,r==0?0:r-e)}function Su(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:s,left:i}=t[n];r.scrollTop!=s+e&&(r.scrollTop=s+e),r.scrollLeft!=i&&(r.scrollLeft=i)}}let or=null;function n0(t){if(t.setActive)return t.setActive();if(or)return t.focus(or);let e=Cu(t);t.focus(or==null?{get preventScroll(){return or={preventScroll:!0},!0}}:void 0),or||(or=!1,Su(e,0))}function Nu(t,e){let n,r=2e8,s,i=0,o=e.top,l=e.top,a,c;for(let u=t.firstChild,h=0;u;u=u.nextSibling,h++){let p;if(u.nodeType==1)p=u.getClientRects();else if(u.nodeType==3)p=tn(u).getClientRects();else continue;for(let f=0;f<p.length;f++){let m=p[f];if(m.top<=o&&m.bottom>=l){o=Math.max(m.bottom,o),l=Math.min(m.top,l);let g=m.left>e.left?m.left-e.left:m.right<e.left?e.left-m.right:0;if(g<r){n=u,r=g,s=g&&n.nodeType==3?{left:m.right<e.left?m.right:m.left,top:e.top}:e,u.nodeType==1&&g&&(i=h+(e.left>=(m.left+m.right)/2?1:0));continue}}else m.top>e.top&&!a&&m.left<=e.left&&m.right>=e.left&&(a=u,c={left:Math.max(m.left,Math.min(m.right,e.left)),top:m.top});!n&&(e.left>=m.right&&e.top>=m.top||e.left>=m.left&&e.top>=m.bottom)&&(i=h+1)}}return!n&&a&&(n=a,s=c,r=0),n&&n.nodeType==3?r0(n,s):!n||r&&n.nodeType==1?{node:t,offset:i}:Nu(n,s)}function r0(t,e){let n=t.nodeValue.length,r=document.createRange(),s;for(let i=0;i<n;i++){r.setEnd(t,i+1),r.setStart(t,i);let o=hn(r,1);if(o.top!=o.bottom&&Ll(e,o)){s={node:t,offset:i+(e.left>=(o.left+o.right)/2?1:0)};break}}return r.detach(),s||{node:t,offset:0}}function Ll(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function s0(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function i0(t,e,n){let{node:r,offset:s}=Nu(e,n),i=-1;if(r.nodeType==1&&!r.firstChild){let o=r.getBoundingClientRect();i=o.left!=o.right&&n.left>(o.left+o.right)/2?1:-1}return t.docView.posFromDOM(r,s,i)}function o0(t,e,n,r){let s=-1;for(let i=e,o=!1;i!=t.dom;){let l=t.docView.nearestDesc(i,!0),a;if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent||!l.contentDOM)&&((a=l.dom.getBoundingClientRect()).width||a.height)&&(l.node.isBlock&&l.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(l.dom.nodeName)&&(!o&&a.left>r.left||a.top>r.top?s=l.posBefore:(!o&&a.right<r.left||a.bottom<r.top)&&(s=l.posAfter),o=!0),!l.contentDOM&&s<0&&!l.node.isText))return(l.node.isBlock?r.top<(a.top+a.bottom)/2:r.left<(a.left+a.right)/2)?l.posBefore:l.posAfter;i=l.dom.parentNode}return s>-1?s:t.docView.posFromDOM(e,n,-1)}function Au(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let s=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),i=s;;){let o=t.childNodes[i];if(o.nodeType==1){let l=o.getClientRects();for(let a=0;a<l.length;a++){let c=l[a];if(Ll(e,c))return Au(o,e,c)}}if((i=(i+1)%r)==s)break}return t}function l0(t,e){let n=t.dom.ownerDocument,r,s=0,i=Yx(n,e.left,e.top);i&&({node:r,offset:s}=i);let o=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),l;if(!o||!t.dom.contains(o.nodeType!=1?o.parentNode:o)){let c=t.dom.getBoundingClientRect();if(!Ll(e,c)||(o=Au(t.dom,e,c),!o))return null}if(nt)for(let c=o;r&&c;c=br(c))c.draggable&&(r=void 0);if(o=s0(o,e),r){if(jt&&r.nodeType==1&&(s=Math.min(s,r.childNodes.length),s<r.childNodes.length)){let u=r.childNodes[s],h;u.nodeName=="IMG"&&(h=u.getBoundingClientRect()).right<=e.left&&h.bottom>e.top&&s++}let c;ys&&s&&r.nodeType==1&&(c=r.childNodes[s-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&s--,r==t.dom&&s==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?l=t.state.doc.content.size:(s==0||r.nodeType!=1||r.childNodes[s-1].nodeName!="BR")&&(l=o0(t,r,s,e))}l==null&&(l=i0(t,o,e));let a=t.docView.nearestDesc(o,!0);return{pos:l,inside:a?a.posAtStart-a.border:-1}}function Za(t){return t.top<t.bottom||t.left<t.right}function hn(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(Za(r))return r}return Array.prototype.find.call(n,Za)||t.getBoundingClientRect()}const a0=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Tu(t,e,n){let{node:r,offset:s,atom:i}=t.docView.domFromPos(e,n<0?-1:1),o=ys||jt;if(r.nodeType==3)if(o&&(a0.test(r.nodeValue)||(n<0?!s:s==r.nodeValue.length))){let a=hn(tn(r,s,s),n);if(jt&&s&&/\s/.test(r.nodeValue[s-1])&&s<r.nodeValue.length){let c=hn(tn(r,s-1,s-1),-1);if(c.top==a.top){let u=hn(tn(r,s,s+1),-1);if(u.top!=a.top)return Mr(u,u.left<c.left)}}return a}else{let a=s,c=s,u=n<0?1:-1;return n<0&&!s?(c++,u=-1):n>=0&&s==r.nodeValue.length?(a--,u=1):n<0?a--:c++,Mr(hn(tn(r,a,c),u),u<0)}if(!t.state.doc.resolve(e-(i||0)).parent.inlineContent){if(i==null&&s&&(n<0||s==Et(r))){let a=r.childNodes[s-1];if(a.nodeType==1)return xo(a.getBoundingClientRect(),!1)}if(i==null&&s<Et(r)){let a=r.childNodes[s];if(a.nodeType==1)return xo(a.getBoundingClientRect(),!0)}return xo(r.getBoundingClientRect(),n>=0)}if(i==null&&s&&(n<0||s==Et(r))){let a=r.childNodes[s-1],c=a.nodeType==3?tn(a,Et(a)-(o?0:1)):a.nodeType==1&&(a.nodeName!="BR"||!a.nextSibling)?a:null;if(c)return Mr(hn(c,1),!1)}if(i==null&&s<Et(r)){let a=r.childNodes[s];for(;a.pmViewDesc&&a.pmViewDesc.ignoreForCoords;)a=a.nextSibling;let c=a?a.nodeType==3?tn(a,0,o?0:1):a.nodeType==1?a:null:null;if(c)return Mr(hn(c,-1),!0)}return Mr(hn(r.nodeType==3?tn(r):r,-n),n>=0)}function Mr(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function xo(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function Eu(t,e,n){let r=t.state,s=t.root.activeElement;r!=e&&t.updateState(e),s!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),s!=t.dom&&s&&s.focus()}}function c0(t,e,n){let r=e.selection,s=n=="up"?r.$from:r.$to;return Eu(t,e,()=>{let{node:i}=t.docView.domFromPos(s.pos,n=="up"?-1:1);for(;;){let l=t.docView.nearestDesc(i,!0);if(!l)break;if(l.node.isBlock){i=l.contentDOM||l.dom;break}i=l.dom.parentNode}let o=Tu(t,s.pos,1);for(let l=i.firstChild;l;l=l.nextSibling){let a;if(l.nodeType==1)a=l.getClientRects();else if(l.nodeType==3)a=tn(l,0,l.nodeValue.length).getClientRects();else continue;for(let c=0;c<a.length;c++){let u=a[c];if(u.bottom>u.top+1&&(n=="up"?o.top-u.top>(u.bottom-o.top)*2:u.bottom-o.bottom>(o.bottom-u.top)*2))return!1}}return!0})}const d0=/[\u0590-\u08ac]/;function u0(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let s=r.parentOffset,i=!s,o=s==r.parent.content.size,l=t.domSelection();return l?!d0.test(r.parent.textContent)||!l.modify?n=="left"||n=="backward"?i:o:Eu(t,e,()=>{let{focusNode:a,focusOffset:c,anchorNode:u,anchorOffset:h}=t.domSelectionRange(),p=l.caretBidiLevel;l.modify("move",n,"character");let f=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:m,focusOffset:g}=t.domSelectionRange(),b=m&&!f.contains(m.nodeType==1?m:m.parentNode)||a==m&&c==g;try{l.collapse(u,h),a&&(a!=u||c!=h)&&l.extend&&l.extend(a,c)}catch{}return p!=null&&(l.caretBidiLevel=p),b}):r.pos==r.start()||r.pos==r.end()}let ec=null,tc=null,nc=!1;function h0(t,e,n){return ec==e&&tc==n?nc:(ec=e,tc=n,nc=n=="up"||n=="down"?c0(t,e,n):u0(t,e,n))}const It=0,rc=1,Bn=2,qt=3;class xs{constructor(e,n,r,s){this.parent=e,this.children=n,this.dom=r,this.contentDOM=s,this.dirty=It,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,r=this.posAtStart;;n++){let s=this.children[n];if(s==e)return r;r+=s.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let i,o;if(e==this.contentDOM)i=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.previousSibling}for(;i&&!((o=i.pmViewDesc)&&o.parent==this);)i=i.previousSibling;return i?this.posBeforeChild(o)+o.size:this.posAtStart}else{let i,o;if(e==this.contentDOM)i=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.nextSibling}for(;i&&!((o=i.pmViewDesc)&&o.parent==this);)i=i.nextSibling;return i?this.posBeforeChild(o):this.posAtEnd}let s;if(e==this.dom&&this.contentDOM)s=n>Je(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))s=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let i=e;;i=i.parentNode){if(i==this.dom){s=!1;break}if(i.previousSibling)break}if(s==null&&n==e.childNodes.length)for(let i=e;;i=i.parentNode){if(i==this.dom){s=!0;break}if(i.nextSibling)break}}return s??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,s=e;s;s=s.parentNode){let i=this.getDesc(s),o;if(i&&(!n||i.node))if(r&&(o=i.nodeDOM)&&!(o.nodeType==1?o.contains(e.nodeType==1?e:e.parentNode):o==e))r=!1;else return i}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let s=e;s;s=s.parentNode){let i=this.getDesc(s);if(i)return i.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let s=this.children[n],i=r+s.size;if(r==e&&i!=r){for(;!s.border&&s.children.length;)for(let o=0;o<s.children.length;o++){let l=s.children[o];if(l.size){s=l;break}}return s}if(e<i)return s.descAt(e-r-s.border);r=i}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,s=0;for(let i=0;r<this.children.length;r++){let o=this.children[r],l=i+o.size;if(l>e||o instanceof ju){s=e-i;break}i=l}if(s)return this.children[r].domFromPos(s-this.children[r].border,n);for(let i;r&&!(i=this.children[r-1]).size&&i instanceof Mu&&i.side>=0;r--);if(n<=0){let i,o=!0;for(;i=r?this.children[r-1]:null,!(!i||i.dom.parentNode==this.contentDOM);r--,o=!1);return i&&n&&o&&!i.border&&!i.domAtom?i.domFromPos(i.size,n):{node:this.contentDOM,offset:i?Je(i.dom)+1:0}}else{let i,o=!0;for(;i=r<this.children.length?this.children[r]:null,!(!i||i.dom.parentNode==this.contentDOM);r++,o=!1);return i&&o&&!i.border&&!i.domAtom?i.domFromPos(0,n):{node:this.contentDOM,offset:i?Je(i.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let s=-1,i=-1;for(let o=r,l=0;;l++){let a=this.children[l],c=o+a.size;if(s==-1&&e<=c){let u=o+a.border;if(e>=u&&n<=c-a.border&&a.node&&a.contentDOM&&this.contentDOM.contains(a.contentDOM))return a.parseRange(e,n,u);e=o;for(let h=l;h>0;h--){let p=this.children[h-1];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(1)){s=Je(p.dom)+1;break}e-=p.size}s==-1&&(s=0)}if(s>-1&&(c>n||l==this.children.length-1)){n=c;for(let u=l+1;u<this.children.length;u++){let h=this.children[u];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(-1)){i=Je(h.dom);break}n+=h.size}i==-1&&(i=this.contentDOM.childNodes.length);break}o=c}return{node:this.contentDOM,from:e,to:n,fromOffset:s,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,s=!1){let i=Math.min(e,n),o=Math.max(e,n);for(let f=0,m=0;f<this.children.length;f++){let g=this.children[f],b=m+g.size;if(i>m&&o<b)return g.setSelection(e-m-g.border,n-m-g.border,r,s);m=b}let l=this.domFromPos(e,e?-1:1),a=n==e?l:this.domFromPos(n,n?-1:1),c=r.root.getSelection(),u=r.domSelectionRange(),h=!1;if((jt||nt)&&e==n){let{node:f,offset:m}=l;if(f.nodeType==3){if(h=!!(m&&f.nodeValue[m-1]==`
|
|
23
|
+
`),h&&m==f.nodeValue.length)for(let g=f,b;g;g=g.parentNode){if(b=g.nextSibling){b.nodeName=="BR"&&(l=a={node:b.parentNode,offset:Je(b)+1});break}let y=g.pmViewDesc;if(y&&y.node&&y.node.isBlock)break}}else{let g=f.childNodes[m-1];h=g&&(g.nodeName=="BR"||g.contentEditable=="false")}}if(jt&&u.focusNode&&u.focusNode!=a.node&&u.focusNode.nodeType==1){let f=u.focusNode.childNodes[u.focusOffset];f&&f.contentEditable=="false"&&(s=!0)}if(!(s||h&&nt)&&Qn(l.node,l.offset,u.anchorNode,u.anchorOffset)&&Qn(a.node,a.offset,u.focusNode,u.focusOffset))return;let p=!1;if((c.extend||e==n)&&!(h&&jt)){c.collapse(l.node,l.offset);try{e!=n&&c.extend(a.node,a.offset),p=!0}catch{}}if(!p){if(e>n){let m=l;l=a,a=m}let f=document.createRange();f.setEnd(a.node,a.offset),f.setStart(l.node,l.offset),c.removeAllRanges(),c.addRange(f)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,s=0;s<this.children.length;s++){let i=this.children[s],o=r+i.size;if(r==o?e<=o&&n>=r:e<o&&n>r){let l=r+i.border,a=o-i.border;if(e>=l&&n<=a){this.dirty=e==r||n==o?Bn:rc,e==l&&n==a&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=qt:i.markDirty(e-l,n-l);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?Bn:qt}r=o}this.dirty=Bn}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?Bn:rc;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class Mu extends xs{constructor(e,n,r,s){let i,o=n.type.toDOM;if(typeof o=="function"&&(o=o(r,()=>{if(!i)return s;if(i.parent)return i.parent.posBeforeChild(i)})),!n.type.spec.raw){if(o.nodeType!=1){let l=document.createElement("span");l.appendChild(o),o=l}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=n,this.widget=n,i=this}matchesWidget(e){return this.dirty==It&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class f0 extends xs{constructor(e,n,r,s){super(e,[],n,null),this.textDOM=r,this.text=s}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class Xn extends xs{constructor(e,n,r,s,i){super(e,[],r,s),this.mark=n,this.spec=i}static create(e,n,r,s){let i=s.nodeViews[n.type.name],o=i&&i(n,s,r);return(!o||!o.dom)&&(o=tr.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new Xn(e,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&qt||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=qt&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=It){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=It}}slice(e,n,r){let s=Xn.create(this.parent,this.mark,!0,r),i=this.children,o=this.size;n<o&&(i=sl(i,n,o,r)),e>0&&(i=sl(i,0,e,r));for(let l=0;l<i.length;l++)i[l].parent=s;return s.children=i,s}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class kn extends xs{constructor(e,n,r,s,i,o,l,a,c){super(e,[],i,o),this.node=n,this.outerDeco=r,this.innerDeco=s,this.nodeDOM=l}static create(e,n,r,s,i,o){let l=i.nodeViews[n.type.name],a,c=l&&l(n,i,()=>{if(!a)return o;if(a.parent)return a.parent.posBeforeChild(a)},r,s),u=c&&c.dom,h=c&&c.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:h}=tr.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!h&&!n.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),n.type.spec.draggable&&(u.draggable=!0));let p=u;return u=Ou(u,r,n),c?a=new p0(e,n,r,s,u,h||null,p,c,i,o+1):n.isText?new qi(e,n,r,s,u,p,i):new kn(e,n,r,s,u,h||null,p,i,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>M.empty)}return e}matchesNode(e,n,r){return this.dirty==It&&e.eq(this.node)&&ei(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,s=n,i=e.composing?this.localCompositionInfo(e,n):null,o=i&&i.pos>-1?i:null,l=i&&i.pos<0,a=new g0(this,o&&o.node,e);x0(this.node,this.innerDeco,(c,u,h)=>{c.spec.marks?a.syncToMarks(c.spec.marks,r,e,u):c.type.side>=0&&!h&&a.syncToMarks(u==this.node.childCount?xe.none:this.node.child(u).marks,r,e,u),a.placeWidget(c,e,s)},(c,u,h,p)=>{a.syncToMarks(c.marks,r,e,p);let f;a.findNodeMatch(c,u,h,p)||l&&e.state.selection.from>s&&e.state.selection.to<s+c.nodeSize&&(f=a.findIndexWithChild(i.node))>-1&&a.updateNodeAt(c,u,h,f,e)||a.updateNextNode(c,u,h,e,p,s)||a.addNode(c,u,h,e,s),s+=c.nodeSize}),a.syncToMarks([],r,e,0),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||this.dirty==Bn)&&(o&&this.protectLocalComposition(e,o),Iu(this.contentDOM,this.children,e),yr&&v0(this.dom))}localCompositionInfo(e,n){let{from:r,to:s}=e.state.selection;if(!(e.state.selection instanceof X)||r<n||s>n+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let o=i.nodeValue,l=_0(this.node.content,o,r-n,s-n);return l<0?null:{node:i,pos:l,text:o}}else return{node:i,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:s}){if(this.getDesc(n))return;let i=n;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let o=new f0(this,i,n,s);e.input.compositionNodes.push(o),this.children=sl(this.children,r,r+s.length,e,o)}update(e,n,r,s){return this.dirty==qt||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,s),!0)}updateInner(e,n,r,s){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(s,this.posAtStart),this.dirty=It}updateOuterDeco(e){if(ei(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=Du(this.dom,this.nodeDOM,rl(this.outerDeco,this.node,n),rl(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function sc(t,e,n,r,s){Ou(r,e,t);let i=new kn(void 0,t,e,n,r,r,r,s,0);return i.contentDOM&&i.updateChildren(s,0),i}class qi extends kn{constructor(e,n,r,s,i,o,l){super(e,n,r,s,i,null,o,l,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,s){return this.dirty==qt||this.dirty!=It&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=It||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,s.trackWrites==this.nodeDOM&&(s.trackWrites=null)),this.node=e,this.dirty=It,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let s=this.node.cut(e,n),i=document.createTextNode(s.text);return new qi(this.parent,s,this.outerDeco,this.innerDeco,i,i,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=qt)}get domAtom(){return!1}isText(e){return this.node.text==e}}class ju extends xs{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==It&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class p0 extends kn{constructor(e,n,r,s,i,o,l,a,c,u){super(e,n,r,s,i,o,l,c,u),this.spec=a}update(e,n,r,s){if(this.dirty==qt)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,n,r);return i&&this.updateInner(e,n,r,s),i}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,s)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,s){this.spec.setSelection?this.spec.setSelection(e,n,r.root):super.setSelection(e,n,r,s)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function Iu(t,e,n){let r=t.firstChild,s=!1;for(let i=0;i<e.length;i++){let o=e[i],l=o.dom;if(l.parentNode==t){for(;l!=r;)r=ic(r),s=!0;r=r.nextSibling}else s=!0,t.insertBefore(l,r);if(o instanceof Xn){let a=r?r.previousSibling:t.lastChild;Iu(o.contentDOM,o.children,n),r=a?a.nextSibling:t.firstChild}}for(;r;)r=ic(r),s=!0;s&&n.trackWrites==t&&(n.trackWrites=null)}const Ur=function(t){t&&(this.nodeName=t)};Ur.prototype=Object.create(null);const $n=[new Ur];function rl(t,e,n){if(t.length==0)return $n;let r=n?$n[0]:new Ur,s=[r];for(let i=0;i<t.length;i++){let o=t[i].type.attrs;if(o){o.nodeName&&s.push(r=new Ur(o.nodeName));for(let l in o){let a=o[l];a!=null&&(n&&s.length==1&&s.push(r=new Ur(e.isInline?"span":"div")),l=="class"?r.class=(r.class?r.class+" ":"")+a:l=="style"?r.style=(r.style?r.style+";":"")+a:l!="nodeName"&&(r[l]=a))}}}return s}function Du(t,e,n,r){if(n==$n&&r==$n)return e;let s=e;for(let i=0;i<r.length;i++){let o=r[i],l=n[i];if(i){let a;l&&l.nodeName==o.nodeName&&s!=t&&(a=s.parentNode)&&a.nodeName.toLowerCase()==o.nodeName||(a=document.createElement(o.nodeName),a.pmIsDeco=!0,a.appendChild(s),l=$n[0]),s=a}m0(s,l||$n[0],o)}return s}function m0(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],s=n.class?n.class.split(" ").filter(Boolean):[];for(let i=0;i<r.length;i++)s.indexOf(r[i])==-1&&t.classList.remove(r[i]);for(let i=0;i<s.length;i++)r.indexOf(s[i])==-1&&t.classList.add(s[i]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,s;for(;s=r.exec(e.style);)t.style.removeProperty(s[1])}n.style&&(t.style.cssText+=n.style)}}function Ou(t,e,n){return Du(t,t,$n,rl(e,n,t.nodeType!=1))}function ei(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function ic(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class g0{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=b0(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r,s){let i=0,o=this.stack.length>>1,l=Math.min(o,e.length);for(;i<l&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=It,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let a=-1,c=this.top.children.length;s<this.preMatch.index&&(c=Math.min(this.index+3,c));for(let u=this.index;u<c;u++){let h=this.top.children[u];if(h.matchesMark(e[o])&&!this.isLocked(h.dom)){a=u;break}}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let u=Xn.create(this.top,e[o],n,r);this.top.children.splice(this.index,0,u),this.top=u,this.changed=!0}this.index=0,o++}}findNodeMatch(e,n,r,s){let i=-1,o;if(s>=this.preMatch.index&&(o=this.preMatch.matches[s-this.preMatch.index]).parent==this.top&&o.matchesNode(e,n,r))i=this.top.children.indexOf(o,this.index);else for(let l=this.index,a=Math.min(this.top.children.length,l+5);l<a;l++){let c=this.top.children[l];if(c.matchesNode(e,n,r)&&!this.preMatch.matched.has(c)){i=l;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,n,r,s,i){let o=this.top.children[s];return o.dirty==qt&&o.dom==o.contentDOM&&(o.dirty=Bn),o.update(e,n,r,i)?(this.destroyBetween(this.index,s),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let s=this.index;s<this.top.children.length;s++)if(this.top.children[s]==r)return s}return-1}e=n}}updateNextNode(e,n,r,s,i,o){for(let l=this.index;l<this.top.children.length;l++){let a=this.top.children[l];if(a instanceof kn){let c=this.preMatch.matched.get(a);if(c!=null&&c!=i)return!1;let u=a.dom,h,p=this.isLocked(u)&&!(e.isText&&a.node&&a.node.isText&&a.nodeDOM.nodeValue==e.text&&a.dirty!=qt&&ei(n,a.outerDeco));if(!p&&a.update(e,n,r,s))return this.destroyBetween(this.index,l),a.dom!=u&&(this.changed=!0),this.index++,!0;if(!p&&(h=this.recreateWrapper(a,e,n,r,s,o)))return this.destroyBetween(this.index,l),this.top.children[this.index]=h,h.contentDOM&&(h.dirty=Bn,h.updateChildren(s,o+1),h.dirty=It),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,s,i,o){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!ei(r,e.outerDeco)||!s.eq(e.innerDeco))return null;let l=kn.create(this.top,n,r,s,i,o);if(l.contentDOM){l.children=e.children,e.children=[];for(let a of l.children)a.parent=l}return e.destroy(),l}addNode(e,n,r,s,i){let o=kn.create(this.top,e,n,r,s,i);o.contentDOM&&o.updateChildren(s,i+1),this.top.children.splice(this.index++,0,o),this.changed=!0}placeWidget(e,n,r){let s=this.index<this.top.children.length?this.top.children[this.index]:null;if(s&&s.matchesWidget(e)&&(e==s.widget||!s.widget.type.toDOM.parentNode))this.index++;else{let i=new Mu(this.top,e,n,r);this.top.children.splice(this.index++,0,i),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof Xn;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof qi)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((nt||Qe)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let s=new ju(this.top,[],r,null);n!=this.top?n.children.push(s):n.children.splice(this.index++,0,s),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function b0(t,e){let n=e,r=n.children.length,s=t.childCount,i=new Map,o=[];e:for(;s>0;){let l;for(;;)if(r){let c=n.children[r-1];if(c instanceof Xn)n=c,r=c.children.length;else{l=c,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let a=l.node;if(a){if(a!=t.child(s-1))break;--s,i.set(l,s),o.push(l)}}return{index:s,matched:i,matches:o.reverse()}}function y0(t,e){return t.type.side-e.type.side}function x0(t,e,n,r){let s=e.locals(t),i=0;if(s.length==0){for(let c=0;c<t.childCount;c++){let u=t.child(c);r(u,s,e.forChild(i,u),c),i+=u.nodeSize}return}let o=0,l=[],a=null;for(let c=0;;){let u,h;for(;o<s.length&&s[o].to==i;){let b=s[o++];b.widget&&(u?(h||(h=[u])).push(b):u=b)}if(u)if(h){h.sort(y0);for(let b=0;b<h.length;b++)n(h[b],c,!!a)}else n(u,c,!!a);let p,f;if(a)f=-1,p=a,a=null;else if(c<t.childCount)f=c,p=t.child(c++);else break;for(let b=0;b<l.length;b++)l[b].to<=i&&l.splice(b--,1);for(;o<s.length&&s[o].from<=i&&s[o].to>i;)l.push(s[o++]);let m=i+p.nodeSize;if(p.isText){let b=m;o<s.length&&s[o].from<b&&(b=s[o].from);for(let y=0;y<l.length;y++)l[y].to<b&&(b=l[y].to);b<m&&(a=p.cut(b-i),p=p.cut(0,b-i),m=b,f=-1)}else for(;o<s.length&&s[o].to<m;)o++;let g=p.isInline&&!p.isLeaf?l.filter(b=>!b.inline):l.slice();r(p,g,e.forChild(i,p),f),i=m}}function v0(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function _0(t,e,n,r){for(let s=0,i=0;s<t.childCount&&i<=r;){let o=t.child(s++),l=i;if(i+=o.nodeSize,!o.isText)continue;let a=o.text;for(;s<t.childCount;){let c=t.child(s++);if(i+=c.nodeSize,!c.isText)break;a+=c.text}if(i>=n){if(i>=r&&a.slice(r-e.length-l,r-l)==e)return r-e.length;let c=l<r?a.lastIndexOf(e,r-l-1):-1;if(c>=0&&c+e.length+l>=n)return l+c;if(n==r&&a.length>=r+e.length-l&&a.slice(r-l,r-l+e.length)==e)return r}}return-1}function sl(t,e,n,r,s){let i=[];for(let o=0,l=0;o<t.length;o++){let a=t[o],c=l,u=l+=a.size;c>=n||u<=e?i.push(a):(c<e&&i.push(a.slice(0,e-c,r)),s&&(i.push(s),s=void 0),u>n&&i.push(a.slice(n-c,a.size,r)))}return i}function Bl(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let s=t.docView.nearestDesc(n.focusNode),i=s&&s.size==0,o=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let l=r.resolve(o),a,c;if(Vi(n)){for(a=o;s&&!s.node;)s=s.parent;let h=s.node;if(s&&h.isAtom&&J.isSelectable(h)&&s.parent&&!(h.isInline&&Gx(n.focusNode,n.focusOffset,s.dom))){let p=s.posBefore;c=new J(o==p?l:r.resolve(p))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let h=o,p=o;for(let f=0;f<n.rangeCount;f++){let m=n.getRangeAt(f);h=Math.min(h,t.docView.posFromDOM(m.startContainer,m.startOffset,1)),p=Math.max(p,t.docView.posFromDOM(m.endContainer,m.endOffset,-1))}if(h<0)return null;[a,o]=p==t.state.selection.anchor?[p,h]:[h,p],l=r.resolve(o)}else a=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(a<0)return null}let u=r.resolve(a);if(!c){let h=e=="pointer"||t.state.selection.head<l.pos&&!i?1:-1;c=$l(t,u,l,h)}return c}function Ru(t){return t.editable?t.hasFocus():Bu(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function on(t,e=!1){let n=t.state.selection;if(Lu(t,n),!!Ru(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&Qe){let r=t.domSelectionRange(),s=t.domObserver.currentSelection;if(r.anchorNode&&s.anchorNode&&Qn(r.anchorNode,r.anchorOffset,s.anchorNode,s.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)w0(t);else{let{anchor:r,head:s}=n,i,o;oc&&!(n instanceof X)&&(n.$from.parent.inlineContent||(i=lc(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(o=lc(t,n.to))),t.docView.setSelection(r,s,t,e),oc&&(i&&ac(i),o&&ac(o)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&k0(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const oc=nt||Qe&&ku<63;function lc(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),s=r<n.childNodes.length?n.childNodes[r]:null,i=r?n.childNodes[r-1]:null;if(nt&&s&&s.contentEditable=="false")return vo(s);if((!s||s.contentEditable=="false")&&(!i||i.contentEditable=="false")){if(s)return vo(s);if(i)return vo(i)}}function vo(t){return t.contentEditable="true",nt&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function ac(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function k0(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,s=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=s)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!Ru(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function w0(t){let e=t.domSelection();if(!e)return;let n=t.cursorWrapper.dom,r=n.nodeName=="IMG";r?e.collapse(n.parentNode,Je(n)+1):e.collapse(n,0),!r&&!t.state.selection.visible&&ht&&_n<=11&&(n.disabled=!0,n.disabled=!1)}function Lu(t,e){if(e instanceof J){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(cc(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else cc(t)}function cc(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function $l(t,e,n,r){return t.someProp("createSelectionBetween",s=>s(t,e,n))||X.between(e,n,r)}function dc(t){return t.editable&&!t.hasFocus()?!1:Bu(t)}function Bu(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function C0(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return Qn(e.node,e.offset,n.anchorNode,n.anchorOffset)}function il(t,e){let{$anchor:n,$head:r}=t.selection,s=e>0?n.max(r):n.min(r),i=s.parent.inlineContent?s.depth?t.doc.resolve(e>0?s.after():s.before()):null:s;return i&&oe.findFrom(i,e)}function fn(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function uc(t,e,n){let r=t.state.selection;if(r instanceof X)if(n.indexOf("s")>-1){let{$head:s}=r,i=s.textOffset?null:e<0?s.nodeBefore:s.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let o=t.state.doc.resolve(s.pos+i.nodeSize*(e<0?-1:1));return fn(t,new X(r.$anchor,o))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let s=il(t.state,e);return s&&s instanceof J?fn(t,s):!1}else if(!(Tt&&n.indexOf("m")>-1)){let s=r.$head,i=s.textOffset?null:e<0?s.nodeBefore:s.nodeAfter,o;if(!i||i.isText)return!1;let l=e<0?s.pos-i.nodeSize:s.pos;return i.isAtom||(o=t.docView.descAt(l))&&!o.contentDOM?J.isSelectable(i)?fn(t,new J(e<0?t.state.doc.resolve(s.pos-i.nodeSize):s)):ys?fn(t,new X(t.state.doc.resolve(e<0?l:l+i.nodeSize))):!1:!1}}else return!1;else{if(r instanceof J&&r.node.isInline)return fn(t,new X(e>0?r.$to:r.$from));{let s=il(t.state,e);return s?fn(t,s):!1}}}function ti(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Kr(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function lr(t,e){return e<0?S0(t):N0(t)}function S0(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let s,i,o=!1;for(jt&&n.nodeType==1&&r<ti(n)&&Kr(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(n.nodeType!=1)break;{let l=n.childNodes[r-1];if(Kr(l,-1))s=n,i=--r;else if(l.nodeType==3)n=l,r=n.nodeValue.length;else break}}else{if($u(n))break;{let l=n.previousSibling;for(;l&&Kr(l,-1);)s=n.parentNode,i=Je(l),l=l.previousSibling;if(l)n=l,r=ti(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}o?ol(t,n,r):s&&ol(t,s,i)}function N0(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let s=ti(n),i,o;for(;;)if(r<s){if(n.nodeType!=1)break;let l=n.childNodes[r];if(Kr(l,1))i=n,o=++r;else break}else{if($u(n))break;{let l=n.nextSibling;for(;l&&Kr(l,1);)i=l.parentNode,o=Je(l)+1,l=l.nextSibling;if(l)n=l,r=0,s=ti(n);else{if(n=n.parentNode,n==t.dom)break;r=s=0}}}i&&ol(t,i,o)}function $u(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function A0(t,e){for(;t&&e==t.childNodes.length&&!bs(t);)e=Je(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=0}}function T0(t,e){for(;t&&!e&&!bs(t);)e=Je(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=t.childNodes.length}}function ol(t,e,n){if(e.nodeType!=3){let i,o;(o=A0(e,n))?(e=o,n=0):(i=T0(e,n))&&(e=i,n=i.nodeValue.length)}let r=t.domSelection();if(!r)return;if(Vi(r)){let i=document.createRange();i.setEnd(e,n),i.setStart(e,n),r.removeAllRanges(),r.addRange(i)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:s}=t;setTimeout(()=>{t.state==s&&on(t)},50)}function hc(t,e){let n=t.state.doc.resolve(e);if(!(Qe||wu)&&n.parent.inlineContent){let s=t.coordsAtPos(e);if(e>n.start()){let i=t.coordsAtPos(e-1),o=(i.top+i.bottom)/2;if(o>s.top&&o<s.bottom&&Math.abs(i.left-s.left)>1)return i.left<s.left?"ltr":"rtl"}if(e<n.end()){let i=t.coordsAtPos(e+1),o=(i.top+i.bottom)/2;if(o>s.top&&o<s.bottom&&Math.abs(i.left-s.left)>1)return i.left>s.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function fc(t,e,n){let r=t.state.selection;if(r instanceof X&&!r.empty||n.indexOf("s")>-1||Tt&&n.indexOf("m")>-1)return!1;let{$from:s,$to:i}=r;if(!s.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let o=il(t.state,e);if(o&&o instanceof J)return fn(t,o)}if(!s.parent.inlineContent){let o=e<0?s:i,l=r instanceof xt?oe.near(o,e):oe.findFrom(o,e);return l?fn(t,l):!1}return!1}function pc(t,e){if(!(t.state.selection instanceof X))return!0;let{$head:n,$anchor:r,empty:s}=t.state.selection;if(!n.sameParent(r))return!0;if(!s)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let i=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let o=t.state.tr;return e<0?o.delete(n.pos-i.nodeSize,n.pos):o.delete(n.pos,n.pos+i.nodeSize),t.dispatch(o),!0}return!1}function mc(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function E0(t){if(!nt||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;mc(t,r,"true"),setTimeout(()=>mc(t,r,"false"),20)}return!1}function M0(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function j0(t,e){let n=e.keyCode,r=M0(e);if(n==8||Tt&&n==72&&r=="c")return pc(t,-1)||lr(t,-1);if(n==46&&!e.shiftKey||Tt&&n==68&&r=="c")return pc(t,1)||lr(t,1);if(n==13||n==27)return!0;if(n==37||Tt&&n==66&&r=="c"){let s=n==37?hc(t,t.state.selection.from)=="ltr"?-1:1:-1;return uc(t,s,r)||lr(t,s)}else if(n==39||Tt&&n==70&&r=="c"){let s=n==39?hc(t,t.state.selection.from)=="ltr"?1:-1:1;return uc(t,s,r)||lr(t,s)}else{if(n==38||Tt&&n==80&&r=="c")return fc(t,-1,r)||lr(t,-1);if(n==40||Tt&&n==78&&r=="c")return E0(t)||fc(t,1,r)||lr(t,1);if(r==(Tt?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function Pl(t,e){t.someProp("transformCopied",f=>{e=f(e,t)});let n=[],{content:r,openStart:s,openEnd:i}=e;for(;s>1&&i>1&&r.childCount==1&&r.firstChild.childCount==1;){s--,i--;let f=r.firstChild;n.push(f.type.name,f.attrs!=f.type.defaultAttrs?f.attrs:null),r=f.content}let o=t.someProp("clipboardSerializer")||tr.fromSchema(t.state.schema),l=Vu(),a=l.createElement("div");a.appendChild(o.serializeFragment(r,{document:l}));let c=a.firstChild,u,h=0;for(;c&&c.nodeType==1&&(u=Wu[c.nodeName.toLowerCase()]);){for(let f=u.length-1;f>=0;f--){let m=l.createElement(u[f]);for(;a.firstChild;)m.appendChild(a.firstChild);a.appendChild(m),h++}c=a.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${s} ${i}${h?` -${h}`:""} ${JSON.stringify(n)}`);let p=t.someProp("clipboardTextSerializer",f=>f(e,t))||e.content.textBetween(0,e.content.size,`
|
|
24
|
+
|
|
25
|
+
`);return{dom:a,text:p,slice:e}}function Pu(t,e,n,r,s){let i=s.parent.type.spec.code,o,l;if(!n&&!e)return null;let a=!!e&&(r||i||!n);if(a){if(t.someProp("transformPastedText",p=>{e=p(e,i||r,t)}),i)return l=new F(M.from(t.state.schema.text(e.replace(/\r\n?/g,`
|
|
26
|
+
`))),0,0),t.someProp("transformPasted",p=>{l=p(l,t,!0)}),l;let h=t.someProp("clipboardTextParser",p=>p(e,s,r,t));if(h)l=h;else{let p=s.marks(),{schema:f}=t.state,m=tr.fromSchema(f);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(g=>{let b=o.appendChild(document.createElement("p"));g&&b.appendChild(m.serializeNode(f.text(g,p)))})}}else t.someProp("transformPastedHTML",h=>{n=h(n,t)}),o=R0(n),ys&&L0(o);let c=o&&o.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let h=+u[3];h>0;h--){let p=o.firstChild;for(;p&&p.nodeType!=1;)p=p.nextSibling;if(!p)break;o=p}if(l||(l=(t.someProp("clipboardParser")||t.someProp("domParser")||vn.fromSchema(t.state.schema)).parseSlice(o,{preserveWhitespace:!!(a||u),context:s,ruleFromNode(p){return p.nodeName=="BR"&&!p.nextSibling&&p.parentNode&&!I0.test(p.parentNode.nodeName)?{ignore:!0}:null}})),u)l=B0(gc(l,+u[1],+u[2]),u[4]);else if(l=F.maxOpen(D0(l.content,s),!0),l.openStart||l.openEnd){let h=0,p=0;for(let f=l.content.firstChild;h<l.openStart&&!f.type.spec.isolating;h++,f=f.firstChild);for(let f=l.content.lastChild;p<l.openEnd&&!f.type.spec.isolating;p++,f=f.lastChild);l=gc(l,h,p)}return t.someProp("transformPasted",h=>{l=h(l,t,a)}),l}const I0=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function D0(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let s=e.node(n).contentMatchAt(e.index(n)),i,o=[];if(t.forEach(l=>{if(!o)return;let a=s.findWrapping(l.type),c;if(!a)return o=null;if(c=o.length&&i.length&&Fu(a,i,l,o[o.length-1],0))o[o.length-1]=c;else{o.length&&(o[o.length-1]=Hu(o[o.length-1],i.length));let u=zu(l,a);o.push(u),s=s.matchType(u.type),i=a}}),o)return M.from(o)}return t}function zu(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,M.from(t));return t}function Fu(t,e,n,r,s){if(s<t.length&&s<e.length&&t[s]==e[s]){let i=Fu(t,e,n,r.lastChild,s+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(s==t.length-1?n.type:t[s+1]))return r.copy(r.content.append(M.from(zu(n,t,s+1))))}}function Hu(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,Hu(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(M.empty,!0);return t.copy(n.append(r))}function ll(t,e,n,r,s,i){let o=e<0?t.firstChild:t.lastChild,l=o.content;return t.childCount>1&&(i=0),s<r-1&&(l=ll(l,e,n,r,s+1,i)),s>=n&&(l=e<0?o.contentMatchAt(0).fillBefore(l,i<=s).append(l):l.append(o.contentMatchAt(o.childCount).fillBefore(M.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,o.copy(l))}function gc(t,e,n){return e<t.openStart&&(t=new F(ll(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new F(ll(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const Wu={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let bc=null;function Vu(){return bc||(bc=document.implementation.createHTMLDocument("title"))}let _o=null;function O0(t){let e=window.trustedTypes;return e?(_o||(_o=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),_o.createHTML(t)):t}function R0(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=Vu().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),s;if((s=r&&Wu[r[1].toLowerCase()])&&(t=s.map(i=>"<"+i+">").join("")+t+s.map(i=>"</"+i+">").reverse().join("")),n.innerHTML=O0(t),s)for(let i=0;i<s.length;i++)n=n.querySelector(s[i])||n;return n}function L0(t){let e=t.querySelectorAll(Qe?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function B0(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:s,openStart:i,openEnd:o}=t;for(let l=r.length-2;l>=0;l-=2){let a=n.nodes[r[l]];if(!a||a.hasRequiredAttrs())break;s=M.from(a.create(r[l+1],s)),i++,o++}return new F(s,i,o)}const it={},ot={},$0={touchstart:!0,touchmove:!0};class P0{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function z0(t){for(let e in it){let n=it[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{H0(t,r)&&!zl(t,r)&&(t.editable||!(r.type in ot))&&n(t,r)},$0[e]?{passive:!0}:void 0)}nt&&t.dom.addEventListener("input",()=>null),al(t)}function xn(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function F0(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function al(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>zl(t,r))})}function zl(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function H0(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function W0(t,e){!zl(t,e)&&it[e.type]&&(t.editable||!(e.type in ot))&&it[e.type](t,e)}ot.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!Uu(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(rn&&Qe&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),yr&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",s=>s(t,Ln(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||j0(t,n)?n.preventDefault():xn(t,"key")};ot.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};ot.keypress=(t,e)=>{let n=e;if(Uu(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Tt&&n.metaKey)return;if(t.someProp("handleKeyPress",s=>s(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof X)||!r.$from.sameParent(r.$to)){let s=String.fromCharCode(n.charCode),i=()=>t.state.tr.insertText(s).scrollIntoView();!/[\r\n]/.test(s)&&!t.someProp("handleTextInput",o=>o(t,r.$from.pos,r.$to.pos,s,i))&&t.dispatch(i()),n.preventDefault()}};function Ui(t){return{left:t.clientX,top:t.clientY}}function V0(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function Fl(t,e,n,r,s){if(r==-1)return!1;let i=t.state.doc.resolve(r);for(let o=i.depth+1;o>0;o--)if(t.someProp(e,l=>o>i.depth?l(t,n,i.nodeAfter,i.before(o),s,!0):l(t,n,i.node(o),i.before(o),s,!1)))return!0;return!1}function fr(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function q0(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&J.isSelectable(r)?(fr(t,new J(n)),!0):!1}function U0(t,e){if(e==-1)return!1;let n=t.state.selection,r,s;n instanceof J&&(r=n.node);let i=t.state.doc.resolve(e);for(let o=i.depth+1;o>0;o--){let l=o>i.depth?i.nodeAfter:i.node(o);if(J.isSelectable(l)){r&&n.$from.depth>0&&o>=n.$from.depth&&i.before(n.$from.depth+1)==n.$from.pos?s=i.before(n.$from.depth):s=i.before(o);break}}return s!=null?(fr(t,J.create(t.state.doc,s)),!0):!1}function K0(t,e,n,r,s){return Fl(t,"handleClickOn",e,n,r)||t.someProp("handleClick",i=>i(t,e,r))||(s?U0(t,n):q0(t,n))}function G0(t,e,n,r){return Fl(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",s=>s(t,e,r))}function J0(t,e,n,r){return Fl(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",s=>s(t,e,r))||Y0(t,n,r)}function Y0(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(fr(t,X.create(r,0,r.content.size)),!0):!1;let s=r.resolve(e);for(let i=s.depth+1;i>0;i--){let o=i>s.depth?s.nodeAfter:s.node(i),l=s.before(i);if(o.inlineContent)fr(t,X.create(r,l+1,l+1+o.content.size));else if(J.isSelectable(o))fr(t,J.create(r,l));else continue;return!0}}function Hl(t){return ni(t)}const qu=Tt?"metaKey":"ctrlKey";it.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Hl(t),s=Date.now(),i="singleClick";s-t.input.lastClick.time<500&&V0(n,t.input.lastClick)&&!n[qu]&&t.input.lastClick.button==n.button&&(t.input.lastClick.type=="singleClick"?i="doubleClick":t.input.lastClick.type=="doubleClick"&&(i="tripleClick")),t.input.lastClick={time:s,x:n.clientX,y:n.clientY,type:i,button:n.button};let o=t.posAtCoords(Ui(n));o&&(i=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new Q0(t,o,n,!!r)):(i=="doubleClick"?G0:J0)(t,o.pos,o.inside,n)?n.preventDefault():xn(t,"pointer"))};class Q0{constructor(e,n,r,s){this.view=e,this.pos=n,this.event=r,this.flushed=s,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[qu],this.allowDefault=r.shiftKey;let i,o;if(n.inside>-1)i=e.state.doc.nodeAt(n.inside),o=n.inside;else{let u=e.state.doc.resolve(n.pos);i=u.parent,o=u.depth?u.before():0}const l=s?null:r.target,a=l?e.docView.nearestDesc(l,!0):null;this.target=a&&a.nodeDOM.nodeType==1?a.nodeDOM:null;let{selection:c}=e.state;r.button==0&&(i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof J&&c.from<=o&&c.to>o)&&(this.mightDrag={node:i,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&jt&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),xn(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>on(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Ui(e))),this.updateAllowDefault(e),this.allowDefault||!n?xn(this.view,"pointer"):K0(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||nt&&this.mightDrag&&!this.mightDrag.node.isAtom||Qe&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(fr(this.view,oe.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):xn(this.view,"pointer")}move(e){this.updateAllowDefault(e),xn(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}it.touchstart=t=>{t.input.lastTouch=Date.now(),Hl(t),xn(t,"pointer")};it.touchmove=t=>{t.input.lastTouch=Date.now(),xn(t,"pointer")};it.contextmenu=t=>Hl(t);function Uu(t,e){return t.composing?!0:nt&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const X0=rn?5e3:-1;ot.compositionstart=ot.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof X&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||Qe&&wu&&Z0(t)))t.markCursor=t.state.storedMarks||n.marks(),ni(t,!0),t.markCursor=null;else if(ni(t,!e.selection.empty),jt&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let s=r.focusNode,i=r.focusOffset;s&&s.nodeType==1&&i!=0;){let o=i<0?s.lastChild:s.childNodes[i-1];if(!o)break;if(o.nodeType==3){let l=t.domSelection();l&&l.collapse(o,o.nodeValue.length);break}else s=o,i=-1}}t.input.composing=!0}Ku(t,X0)};function Z0(t){let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(!e||e.nodeType!=1||n>=e.childNodes.length)return!1;let r=e.childNodes[n];return r.nodeType==1&&r.contentEditable=="false"}ot.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.badSafariComposition?t.domObserver.forceFlush():t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,Ku(t,20))};function Ku(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>ni(t),e))}function Gu(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=tv());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function ev(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=Ux(e.focusNode,e.focusOffset),r=Kx(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let s=r.pmViewDesc,i=t.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!s||!s.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let o=n.pmViewDesc;if(!(!o||!o.isText(n.nodeValue)))return r}}return n||r}function tv(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function ni(t,e=!1){if(!(rn&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Gu(t),e||t.docView&&t.docView.dirty){let n=Bl(t),r=t.state.selection;return n&&!n.eq(r)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function nv(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),s=document.createRange();s.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(s),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const is=ht&&_n<15||yr&&Qx<604;it.copy=ot.cut=(t,e)=>{let n=e,r=t.state.selection,s=n.type=="cut";if(r.empty)return;let i=is?null:n.clipboardData,o=r.content(),{dom:l,text:a}=Pl(t,o);i?(n.preventDefault(),i.clearData(),i.setData("text/html",l.innerHTML),i.setData("text/plain",a)):nv(t,l),s&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function rv(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function sv(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let s=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?ls(t,r.value,null,s,e):ls(t,r.textContent,r.innerHTML,s,e)},50)}function ls(t,e,n,r,s){let i=Pu(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",a=>a(t,s,i||F.empty)))return!0;if(!i)return!1;let o=rv(i),l=o?t.state.tr.replaceSelectionWith(o,r):t.state.tr.replaceSelection(i);return t.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Ju(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}ot.paste=(t,e)=>{let n=e;if(t.composing&&!rn)return;let r=is?null:n.clipboardData,s=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&ls(t,Ju(r),r.getData("text/html"),s,n)?n.preventDefault():sv(t,n)};class Yu{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const iv=Tt?"altKey":"ctrlKey";function Qu(t,e){let n;return t.someProp("dragCopies",r=>{n=n||r(e)}),n!=null?!n:!e[iv]}it.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let s=t.state.selection,i=s.empty?null:t.posAtCoords(Ui(n)),o;if(!(i&&i.pos>=s.from&&i.pos<=(s instanceof J?s.to-1:s.to))){if(r&&r.mightDrag)o=J.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let h=t.docView.nearestDesc(n.target,!0);h&&h.node.type.spec.draggable&&h!=t.docView&&(o=J.create(t.state.doc,h.posBefore))}}let l=(o||t.state.selection).content(),{dom:a,text:c,slice:u}=Pl(t,l);(!n.dataTransfer.files.length||!Qe||ku>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(is?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",is||n.dataTransfer.setData("text/plain",c),t.dragging=new Yu(u,Qu(t,n),o)};it.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};ot.dragover=ot.dragenter=(t,e)=>e.preventDefault();ot.drop=(t,e)=>{try{ov(t,e,t.dragging)}finally{t.dragging=null}};function ov(t,e,n){if(!e.dataTransfer)return;let r=t.posAtCoords(Ui(e));if(!r)return;let s=t.state.doc.resolve(r.pos),i=n&&n.slice;i?t.someProp("transformPasted",f=>{i=f(i,t,!1)}):i=Pu(t,Ju(e.dataTransfer),is?null:e.dataTransfer.getData("text/html"),!1,s);let o=!!(n&&Qu(t,e));if(t.someProp("handleDrop",f=>f(t,e,i||F.empty,o))){e.preventDefault();return}if(!i)return;e.preventDefault();let l=i?eu(t.state.doc,s.pos,i):s.pos;l==null&&(l=s.pos);let a=t.state.tr;if(o){let{node:f}=n;f?f.replace(a):a.deleteSelection()}let c=a.mapping.map(l),u=i.openStart==0&&i.openEnd==0&&i.content.childCount==1,h=a.doc;if(u?a.replaceRangeWith(c,c,i.content.firstChild):a.replaceRange(c,c,i),a.doc.eq(h))return;let p=a.doc.resolve(c);if(u&&J.isSelectable(i.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(i.content.firstChild))a.setSelection(new J(p));else{let f=a.mapping.map(l);a.mapping.maps[a.mapping.maps.length-1].forEach((m,g,b,y)=>f=y),a.setSelection($l(t,p,a.doc.resolve(f)))}t.focus(),t.dispatch(a.setMeta("uiEvent","drop"))}it.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&on(t)},20))};it.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};it.beforeinput=(t,e)=>{if(Qe&&rn&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",i=>i(t,Ln(8,"Backspace")))))return;let{$cursor:s}=t.state.selection;s&&s.pos>0&&t.dispatch(t.state.tr.delete(s.pos-1,s.pos).scrollIntoView())},50)}};for(let t in ot)it[t]=ot[t];function as(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class ri{constructor(e,n){this.toDOM=e,this.spec=n||qn,this.side=this.spec.side||0}map(e,n,r,s){let{pos:i,deleted:o}=e.mapResult(n.from+s,this.side<0?-1:1);return o?null:new tt(i-r,i-r,this)}valid(){return!0}eq(e){return this==e||e instanceof ri&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&as(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class wn{constructor(e,n){this.attrs=e,this.spec=n||qn}map(e,n,r,s){let i=e.map(n.from+s,this.spec.inclusiveStart?-1:1)-r,o=e.map(n.to+s,this.spec.inclusiveEnd?1:-1)-r;return i>=o?null:new tt(i,o,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof wn&&as(this.attrs,e.attrs)&&as(this.spec,e.spec)}static is(e){return e.type instanceof wn}destroy(){}}class Wl{constructor(e,n){this.attrs=e,this.spec=n||qn}map(e,n,r,s){let i=e.mapResult(n.from+s,1);if(i.deleted)return null;let o=e.mapResult(n.to+s,-1);return o.deleted||o.pos<=i.pos?null:new tt(i.pos-r,o.pos-r,this)}valid(e,n){let{index:r,offset:s}=e.content.findIndex(n.from),i;return s==n.from&&!(i=e.child(r)).isText&&s+i.nodeSize==n.to}eq(e){return this==e||e instanceof Wl&&as(this.attrs,e.attrs)&&as(this.spec,e.spec)}destroy(){}}class tt{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new tt(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,r){return this.type.map(e,this,n,r)}static widget(e,n,r){return new tt(e,e,new ri(n,r))}static inline(e,n,r,s){return new tt(e,n,new wn(r,s))}static node(e,n,r,s){return new tt(e,n,new Wl(r,s))}get spec(){return this.type.spec}get inline(){return this.type instanceof wn}get widget(){return this.type instanceof ri}}const cr=[],qn={};class Ce{constructor(e,n){this.local=e.length?e:cr,this.children=n.length?n:cr}static create(e,n){return n.length?si(n,e,0,qn):et}find(e,n,r){let s=[];return this.findInner(e??0,n??1e9,s,0,r),s}findInner(e,n,r,s,i){for(let o=0;o<this.local.length;o++){let l=this.local[o];l.from<=n&&l.to>=e&&(!i||i(l.spec))&&r.push(l.copy(l.from+s,l.to+s))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<n&&this.children[o+1]>e){let l=this.children[o]+1;this.children[o+2].findInner(e-l,n-l,r,s+l,i)}}map(e,n,r){return this==et||e.maps.length==0?this:this.mapInner(e,n,0,0,r||qn)}mapInner(e,n,r,s,i){let o;for(let l=0;l<this.local.length;l++){let a=this.local[l].map(e,r,s);a&&a.type.valid(n,a)?(o||(o=[])).push(a):i.onRemove&&i.onRemove(this.local[l].spec)}return this.children.length?lv(this.children,o||[],e,n,r,s,i):o?new Ce(o.sort(Un),cr):et}add(e,n){return n.length?this==et?Ce.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let s,i=0;e.forEach((l,a)=>{let c=a+r,u;if(u=Zu(n,l,c)){for(s||(s=this.children.slice());i<s.length&&s[i]<a;)i+=3;s[i]==a?s[i+2]=s[i+2].addInner(l,u,c+1):s.splice(i,0,a,a+l.nodeSize,si(u,l,c+1,qn)),i+=3}});let o=Xu(i?eh(n):n,-r);for(let l=0;l<o.length;l++)o[l].type.valid(e,o[l])||o.splice(l--,1);return new Ce(o.length?this.local.concat(o).sort(Un):this.local,s||this.children)}remove(e){return e.length==0||this==et?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,s=this.local;for(let i=0;i<r.length;i+=3){let o,l=r[i]+n,a=r[i+1]+n;for(let u=0,h;u<e.length;u++)(h=e[u])&&h.from>l&&h.to<a&&(e[u]=null,(o||(o=[])).push(h));if(!o)continue;r==this.children&&(r=this.children.slice());let c=r[i+2].removeInner(o,l+1);c!=et?r[i+2]=c:(r.splice(i,3),i-=3)}if(s.length){for(let i=0,o;i<e.length;i++)if(o=e[i])for(let l=0;l<s.length;l++)s[l].eq(o,n)&&(s==this.local&&(s=this.local.slice()),s.splice(l--,1))}return r==this.children&&s==this.local?this:s.length||r.length?new Ce(s,r):et}forChild(e,n){if(this==et)return this;if(n.isLeaf)return Ce.empty;let r,s;for(let l=0;l<this.children.length;l+=3)if(this.children[l]>=e){this.children[l]==e&&(r=this.children[l+2]);break}let i=e+1,o=i+n.content.size;for(let l=0;l<this.local.length;l++){let a=this.local[l];if(a.from<o&&a.to>i&&a.type instanceof wn){let c=Math.max(i,a.from)-i,u=Math.min(o,a.to)-i;c<u&&(s||(s=[])).push(a.copy(c,u))}}if(s){let l=new Ce(s.sort(Un),cr);return r?new gn([l,r]):l}return r||et}eq(e){if(this==e)return!0;if(!(e instanceof Ce)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return Vl(this.localsInner(e))}localsInner(e){if(this==et)return cr;if(e.inlineContent||!this.local.some(wn.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof wn||n.push(this.local[r]);return n}forEachSet(e){e(this)}}Ce.empty=new Ce([],[]);Ce.removeOverlap=Vl;const et=Ce.empty;class gn{constructor(e){this.members=e}map(e,n){const r=this.members.map(s=>s.map(e,n,qn));return gn.from(r)}forChild(e,n){if(n.isLeaf)return Ce.empty;let r=[];for(let s=0;s<this.members.length;s++){let i=this.members[s].forChild(e,n);i!=et&&(i instanceof gn?r=r.concat(i.members):r.push(i))}return gn.from(r)}eq(e){if(!(e instanceof gn)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let s=0;s<this.members.length;s++){let i=this.members[s].localsInner(e);if(i.length)if(!n)n=i;else{r&&(n=n.slice(),r=!1);for(let o=0;o<i.length;o++)n.push(i[o])}}return n?Vl(r?n:n.sort(Un)):cr}static from(e){switch(e.length){case 0:return et;case 1:return e[0];default:return new gn(e.every(n=>n instanceof Ce)?e:e.reduce((n,r)=>n.concat(r instanceof Ce?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function lv(t,e,n,r,s,i,o){let l=t.slice();for(let c=0,u=i;c<n.maps.length;c++){let h=0;n.maps[c].forEach((p,f,m,g)=>{let b=g-m-(f-p);for(let y=0;y<l.length;y+=3){let v=l[y+1];if(v<0||p>v+u-h)continue;let _=l[y]+u-h;f>=_?l[y+1]=p<=_?-2:-1:p>=u&&b&&(l[y]+=b,l[y+1]+=b)}h+=b}),u=n.maps[c].map(u,-1)}let a=!1;for(let c=0;c<l.length;c+=3)if(l[c+1]<0){if(l[c+1]==-2){a=!0,l[c+1]=-1;continue}let u=n.map(t[c]+i),h=u-s;if(h<0||h>=r.content.size){a=!0;continue}let p=n.map(t[c+1]+i,-1),f=p-s,{index:m,offset:g}=r.content.findIndex(h),b=r.maybeChild(m);if(b&&g==h&&g+b.nodeSize==f){let y=l[c+2].mapInner(n,b,u+1,t[c]+i+1,o);y!=et?(l[c]=h,l[c+1]=f,l[c+2]=y):(l[c+1]=-2,a=!0)}else a=!0}if(a){let c=av(l,t,e,n,s,i,o),u=si(c,r,0,o);e=u.local;for(let h=0;h<l.length;h+=3)l[h+1]<0&&(l.splice(h,3),h-=3);for(let h=0,p=0;h<u.children.length;h+=3){let f=u.children[h];for(;p<l.length&&l[p]<f;)p+=3;l.splice(p,0,u.children[h],u.children[h+1],u.children[h+2])}}return new Ce(e.sort(Un),l)}function Xu(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let s=t[r];n.push(new tt(s.from+e,s.to+e,s.type))}return n}function av(t,e,n,r,s,i,o){function l(a,c){for(let u=0;u<a.local.length;u++){let h=a.local[u].map(r,s,c);h?n.push(h):o.onRemove&&o.onRemove(a.local[u].spec)}for(let u=0;u<a.children.length;u+=3)l(a.children[u+2],a.children[u]+c+1)}for(let a=0;a<t.length;a+=3)t[a+1]==-1&&l(t[a+2],e[a]+i+1);return n}function Zu(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,s=null;for(let i=0,o;i<t.length;i++)(o=t[i])&&o.from>n&&o.to<r&&((s||(s=[])).push(o),t[i]=null);return s}function eh(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function si(t,e,n,r){let s=[],i=!1;e.forEach((l,a)=>{let c=Zu(t,l,a+n);if(c){i=!0;let u=si(c,l,n+a+1,r);u!=et&&s.push(a,a+l.nodeSize,u)}});let o=Xu(i?eh(t):t,-n).sort(Un);for(let l=0;l<o.length;l++)o[l].type.valid(e,o[l])||(r.onRemove&&r.onRemove(o[l].spec),o.splice(l--,1));return o.length||s.length?new Ce(o,s):et}function Un(t,e){return t.from-e.from||t.to-e.to}function Vl(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let s=n+1;s<e.length;s++){let i=e[s];if(i.from==r.from){i.to!=r.to&&(e==t&&(e=t.slice()),e[s]=i.copy(i.from,r.to),yc(e,s+1,i.copy(r.to,i.to)));continue}else{i.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,i.from),yc(e,s,r.copy(i.from,r.to)));break}}}return e}function yc(t,e,n){for(;e<t.length&&Un(n,t[e])>0;)e++;t.splice(e,0,n)}function ko(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=et&&e.push(r)}),t.cursorWrapper&&e.push(Ce.create(t.state.doc,[t.cursorWrapper.deco])),gn.from(e)}const cv={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},dv=ht&&_n<=11;class uv{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class hv{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new uv,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let s=0;s<r.length;s++)this.queue.push(r[s]);ht&&_n<=11&&r.some(s=>s.type=="childList"&&s.removedNodes.length||s.type=="characterData"&&s.oldValue.length>s.target.nodeValue.length)?this.flushSoon():nt&&e.composing&&r.some(s=>s.type=="childList"&&s.target.nodeName=="TR")?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),dv&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,cv)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(dc(this.view)){if(this.suppressingSelectionUpdates)return on(this.view);if(ht&&_n<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Qn(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let i=e.focusNode;i;i=br(i))n.add(i);for(let i=e.anchorNode;i;i=br(i))if(n.has(i)){r=i;break}let s=r&&this.view.docView.nearestDesc(r);if(s&&s.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),s=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&dc(e)&&!this.ignoreSelectionChange(r),i=-1,o=-1,l=!1,a=[];if(e.editable)for(let u=0;u<n.length;u++){let h=this.registerMutation(n[u],a);h&&(i=i<0?h.from:Math.min(h.from,i),o=o<0?h.to:Math.max(h.to,o),h.typeOver&&(l=!0))}if(a.some(u=>u.nodeName=="BR")&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46)){for(let u of a)if(u.nodeName=="BR"&&u.parentNode){let h=u.nextSibling;for(;h&&h.nodeType==1;){if(h.contentEditable=="false"){u.parentNode.removeChild(u);break}h=h.firstChild}}}else if(jt&&a.length){let u=a.filter(h=>h.nodeName=="BR");if(u.length==2){let[h,p]=u;h.parentNode&&h.parentNode.parentNode==p.parentNode?p.remove():h.remove()}else{let{focusNode:h}=this.currentSelection;for(let p of u){let f=p.parentNode;f&&f.nodeName=="LI"&&(!h||mv(e,h)!=f)&&p.remove()}}}let c=null;i<0&&s&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Vi(r)&&(c=Bl(e))&&c.eq(oe.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,on(e),this.currentSelection.set(r),e.scrollToSelection()):(i>-1||s)&&(i>-1&&(e.docView.markDirty(i,o),fv(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,gv(e,a)),this.handleDOMChange(i,o,l,a),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||on(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;u<e.addedNodes.length;u++){let h=e.addedNodes[u];n.push(h),h.nodeType==3&&(this.lastChangedTextNode=h)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let s=e.previousSibling,i=e.nextSibling;if(ht&&_n<=11&&e.addedNodes.length)for(let u=0;u<e.addedNodes.length;u++){let{previousSibling:h,nextSibling:p}=e.addedNodes[u];(!h||Array.prototype.indexOf.call(e.addedNodes,h)<0)&&(s=h),(!p||Array.prototype.indexOf.call(e.addedNodes,p)<0)&&(i=p)}let o=s&&s.parentNode==e.target?Je(s)+1:0,l=r.localPosFromDOM(e.target,o,-1),a=i&&i.parentNode==e.target?Je(i):e.target.childNodes.length,c=r.localPosFromDOM(e.target,a,1);return{from:l,to:c}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let xc=new WeakMap,vc=!1;function fv(t){if(!xc.has(t)&&(xc.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=jt,vc)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),vc=!0}}function _c(t,e){let n=e.startContainer,r=e.startOffset,s=e.endContainer,i=e.endOffset,o=t.domAtPos(t.state.selection.anchor);return Qn(o.node,o.offset,s,i)&&([n,r,s,i]=[s,i,n,r]),{anchorNode:n,anchorOffset:r,focusNode:s,focusOffset:i}}function pv(t,e){if(e.getComposedRanges){let s=e.getComposedRanges(t.root)[0];if(s)return _c(t,s)}let n;function r(s){s.preventDefault(),s.stopImmediatePropagation(),n=s.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?_c(t,n):null}function mv(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let r=t.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function gv(t,e){var n;let{focusNode:r,focusOffset:s}=t.domSelectionRange();for(let i of e)if(((n=i.parentNode)===null||n===void 0?void 0:n.nodeName)=="TR"){let o=i.nextSibling;for(;o&&o.nodeName!="TD"&&o.nodeName!="TH";)o=o.nextSibling;if(o){let l=o;for(;;){let a=l.firstChild;if(!a||a.nodeType!=1||a.contentEditable=="false"||/^(BR|IMG)$/.test(a.nodeName))break;l=a}l.insertBefore(i,l.firstChild),r==i&&t.domSelection().collapse(i,s)}else i.parentNode.removeChild(i)}}function bv(t,e,n){let{node:r,fromOffset:s,toOffset:i,from:o,to:l}=t.docView.parseRange(e,n),a=t.domSelectionRange(),c,u=a.anchorNode;if(u&&t.dom.contains(u.nodeType==1?u:u.parentNode)&&(c=[{node:u,offset:a.anchorOffset}],Vi(a)||c.push({node:a.focusNode,offset:a.focusOffset})),Qe&&t.input.lastKeyCode===8)for(let b=i;b>s;b--){let y=r.childNodes[b-1],v=y.pmViewDesc;if(y.nodeName=="BR"&&!v){i=b;break}if(!v||v.size)break}let h=t.state.doc,p=t.someProp("domParser")||vn.fromSchema(t.state.schema),f=h.resolve(o),m=null,g=p.parse(r,{topNode:f.parent,topMatch:f.parent.contentMatchAt(f.index()),topOpen:!0,from:s,to:i,preserveWhitespace:f.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:yv,context:f});if(c&&c[0].pos!=null){let b=c[0].pos,y=c[1]&&c[1].pos;y==null&&(y=b),m={anchor:b+o,head:y+o}}return{doc:g,sel:m,from:o,to:l}}function yv(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(nt&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||nt&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const xv=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function vv(t,e,n,r,s){let i=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let S=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,O=Bl(t,S);if(O&&!t.state.selection.eq(O)){if(Qe&&rn&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",N=>N(t,Ln(13,"Enter"))))return;let B=t.state.tr.setSelection(O);S=="pointer"?B.setMeta("pointer",!0):S=="key"&&B.scrollIntoView(),i&&B.setMeta("composition",i),t.dispatch(B)}return}let o=t.state.doc.resolve(e),l=o.sharedDepth(n);e=o.before(l+1),n=t.state.doc.resolve(n).after(l+1);let a=t.state.selection,c=bv(t,e,n),u=t.state.doc,h=u.slice(c.from,c.to),p,f;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(p=t.state.selection.to,f="end"):(p=t.state.selection.from,f="start"),t.input.lastKeyCode=null;let m=wv(h.content,c.doc.content,c.from,p,f);if(m&&t.input.domChangeCount++,(yr&&t.input.lastIOSEnter>Date.now()-225||rn)&&s.some(S=>S.nodeType==1&&!xv.test(S.nodeName))&&(!m||m.endA>=m.endB)&&t.someProp("handleKeyDown",S=>S(t,Ln(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!m)if(r&&a instanceof X&&!a.empty&&a.$head.sameParent(a.$anchor)&&!t.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))m={start:a.from,endA:a.to,endB:a.to};else{if(c.sel){let S=kc(t,t.state.doc,c.sel);if(S&&!S.eq(t.state.selection)){let O=t.state.tr.setSelection(S);i&&O.setMeta("composition",i),t.dispatch(O)}}return}t.state.selection.from<t.state.selection.to&&m.start==m.endB&&t.state.selection instanceof X&&(m.start>t.state.selection.from&&m.start<=t.state.selection.from+2&&t.state.selection.from>=c.from?m.start=t.state.selection.from:m.endA<t.state.selection.to&&m.endA>=t.state.selection.to-2&&t.state.selection.to<=c.to&&(m.endB+=t.state.selection.to-m.endA,m.endA=t.state.selection.to)),ht&&_n<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>c.from&&c.doc.textBetween(m.start-c.from-1,m.start-c.from+1)==" "&&(m.start--,m.endA--,m.endB--);let g=c.doc.resolveNoCache(m.start-c.from),b=c.doc.resolveNoCache(m.endB-c.from),y=u.resolve(m.start),v=g.sameParent(b)&&g.parent.inlineContent&&y.end()>=m.endA;if((yr&&t.input.lastIOSEnter>Date.now()-225&&(!v||s.some(S=>S.nodeName=="DIV"||S.nodeName=="P"))||!v&&g.pos<c.doc.content.size&&(!g.sameParent(b)||!g.parent.inlineContent)&&g.pos<b.pos&&!/\S/.test(c.doc.textBetween(g.pos,b.pos,"","")))&&t.someProp("handleKeyDown",S=>S(t,Ln(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>m.start&&kv(u,m.start,m.endA,g,b)&&t.someProp("handleKeyDown",S=>S(t,Ln(8,"Backspace")))){rn&&Qe&&t.domObserver.suppressSelectionUpdates();return}Qe&&m.endB==m.start&&(t.input.lastChromeDelete=Date.now()),rn&&!v&&g.start()!=b.start()&&b.parentOffset==0&&g.depth==b.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==m.endA&&(m.endB-=2,b=c.doc.resolveNoCache(m.endB-c.from),setTimeout(()=>{t.someProp("handleKeyDown",function(S){return S(t,Ln(13,"Enter"))})},20));let _=m.start,w=m.endA,k=S=>{let O=S||t.state.tr.replace(_,w,c.doc.slice(m.start-c.from,m.endB-c.from));if(c.sel){let B=kc(t,O.doc,c.sel);B&&!(Qe&&t.composing&&B.empty&&(m.start!=m.endB||t.input.lastChromeDelete<Date.now()-100)&&(B.head==_||B.head==O.mapping.map(w)-1)||ht&&B.empty&&B.head==_)&&O.setSelection(B)}return i&&O.setMeta("composition",i),O.scrollIntoView()},C;if(v)if(g.pos==b.pos){ht&&_n<=11&&g.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>on(t),20));let S=k(t.state.tr.delete(_,w)),O=u.resolve(m.start).marksAcross(u.resolve(m.endA));O&&S.ensureMarks(O),t.dispatch(S)}else if(m.endA==m.endB&&(C=_v(g.parent.content.cut(g.parentOffset,b.parentOffset),y.parent.content.cut(y.parentOffset,m.endA-y.start())))){let S=k(t.state.tr);C.type=="add"?S.addMark(_,w,C.mark):S.removeMark(_,w,C.mark),t.dispatch(S)}else if(g.parent.child(g.index()).isText&&g.index()==b.index()-(b.textOffset?0:1)){let S=g.parent.textBetween(g.parentOffset,b.parentOffset),O=()=>k(t.state.tr.insertText(S,_,w));t.someProp("handleTextInput",B=>B(t,_,w,S,O))||t.dispatch(O())}else t.dispatch(k());else t.dispatch(k())}function kc(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:$l(t,e.resolve(n.anchor),e.resolve(n.head))}function _v(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,s=n,i=r,o,l,a;for(let u=0;u<r.length;u++)s=r[u].removeFromSet(s);for(let u=0;u<n.length;u++)i=n[u].removeFromSet(i);if(s.length==1&&i.length==0)l=s[0],o="add",a=u=>u.mark(l.addToSet(u.marks));else if(s.length==0&&i.length==1)l=i[0],o="remove",a=u=>u.mark(l.removeFromSet(u.marks));else return null;let c=[];for(let u=0;u<e.childCount;u++)c.push(a(e.child(u)));if(M.from(c).eq(t))return{mark:l,type:o}}function kv(t,e,n,r,s){if(n-e<=s.pos-r.pos||wo(r,!0,!1)<s.pos)return!1;let i=t.resolve(e);if(!r.parent.isTextblock){let l=i.nodeAfter;return l!=null&&n==e+l.nodeSize}if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let o=t.resolve(wo(i,!0,!0));return!o.parent.isTextblock||o.pos>n||wo(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function wo(t,e,n){let r=t.depth,s=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,s++,e=!1;if(n){let i=t.node(r).maybeChild(t.indexAfter(r));for(;i&&!i.isLeaf;)i=i.firstChild,s++}return s}function wv(t,e,n,r,s){let i=t.findDiffStart(e,n);if(i==null)return null;let{a:o,b:l}=t.findDiffEnd(e,n+t.size,n+e.size);if(s=="end"){let a=Math.max(0,i-Math.min(o,l));r-=o+a-i}if(o<i&&t.size<e.size){let a=r<=i&&r>=o?i-r:0;i-=a,i&&i<e.size&&wc(e.textBetween(i-1,i+1))&&(i+=a?1:-1),l=i+(l-o),o=i}else if(l<i){let a=r<=i&&r>=l?i-r:0;i-=a,i&&i<t.size&&wc(t.textBetween(i-1,i+1))&&(i+=a?1:-1),o=i+(o-l),l=i}return{start:i,endA:o,endB:l}}function wc(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}class th{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new P0,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(Tc),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Nc(this),Sc(this),this.nodeViews=Ac(this),this.docView=sc(this.state.doc,Cc(this),ko(this),this.dom,this),this.domObserver=new hv(this,(r,s,i,o)=>vv(this,r,s,i,o)),this.domObserver.start(),z0(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&al(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Tc),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let s=this.state,i=!1,o=!1;e.storedMarks&&this.composing&&(Gu(this),o=!0),this.state=e;let l=s.plugins!=e.plugins||this._props.plugins!=n.plugins;if(l||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let f=Ac(this);Sv(f,this.nodeViews)&&(this.nodeViews=f,i=!0)}(l||n.handleDOMEvents!=this._props.handleDOMEvents)&&al(this),this.editable=Nc(this),Sc(this);let a=ko(this),c=Cc(this),u=s.plugins!=e.plugins&&!s.doc.eq(e.doc)?"reset":e.scrollToSelection>s.scrollToSelection?"to selection":"preserve",h=i||!this.docView.matchesNode(e.doc,c,a);(h||!e.selection.eq(s.selection))&&(o=!0);let p=u=="preserve"&&o&&this.dom.style.overflowAnchor==null&&e0(this);if(o){this.domObserver.stop();let f=h&&(ht||Qe)&&!this.composing&&!s.selection.empty&&!e.selection.empty&&Cv(s.selection,e.selection);if(h){let m=Qe?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=ev(this)),(i||!this.docView.update(e.doc,c,a,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=sc(e.doc,c,a,this.dom,this)),m&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(f=!0)}f||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&C0(this))?on(this,f):(Lu(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(s),!((r=this.dragging)===null||r===void 0)&&r.node&&!s.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,s),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():p&&t0(p)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof J){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&Xa(this,n.getBoundingClientRect(),e)}else Xa(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,e)}}updateDraggedNode(e,n){let r=e.node,s=-1;if(r.from<this.state.doc.content.size&&this.state.doc.nodeAt(r.from)==r.node)s=r.from;else{let i=r.from+(this.state.doc.content.size-n.doc.content.size);(i>0&&i<this.state.doc.content.size&&this.state.doc.nodeAt(i))==r.node&&(s=i)}this.dragging=new Yu(e.slice,e.move,s<0?void 0:J.create(this.state.doc,s))}someProp(e,n){let r=this._props&&this._props[e],s;if(r!=null&&(s=n?n(r):r))return s;for(let o=0;o<this.directPlugins.length;o++){let l=this.directPlugins[o].props[e];if(l!=null&&(s=n?n(l):l))return s}let i=this.state.plugins;if(i)for(let o=0;o<i.length;o++){let l=i[o].props[e];if(l!=null&&(s=n?n(l):l))return s}}hasFocus(){if(ht){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&n0(this.dom),on(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return l0(this,e)}coordsAtPos(e,n=1){return Tu(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let s=this.docView.posFromDOM(e,n,r);if(s==null)throw new RangeError("DOM position not inside the editor");return s}endOfTextblock(e,n){return h0(this,n||this.state,e)}pasteHTML(e,n){return ls(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return ls(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return Pl(this,e)}destroy(){this.docView&&(F0(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],ko(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,Vx())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return W0(this,e)}domSelectionRange(){let e=this.domSelection();return e?nt&&this.root.nodeType===11&&Jx(this.dom.ownerDocument)==this.dom&&pv(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}th.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function Cc(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[tt.node(0,t.state.doc.content.size,e)]}function Sc(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:tt.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function Nc(t){return!t.someProp("editable",e=>e(t.state)===!1)}function Cv(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function Ac(t){let e=Object.create(null);function n(r){for(let s in r)Object.prototype.hasOwnProperty.call(e,s)||(e[s]=r[s])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function Sv(t,e){let n=0,r=0;for(let s in t){if(t[s]!=e[s])return!0;n++}for(let s in e)r++;return n!=r}function Tc(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Cn={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},ii={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Nv=typeof navigator<"u"&&/Mac/.test(navigator.platform),Av=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Ye=0;Ye<10;Ye++)Cn[48+Ye]=Cn[96+Ye]=String(Ye);for(var Ye=1;Ye<=24;Ye++)Cn[Ye+111]="F"+Ye;for(var Ye=65;Ye<=90;Ye++)Cn[Ye]=String.fromCharCode(Ye+32),ii[Ye]=String.fromCharCode(Ye);for(var Co in Cn)ii.hasOwnProperty(Co)||(ii[Co]=Cn[Co]);function Tv(t){var e=Nv&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||Av&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?ii:Cn)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const Ev=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),Mv=typeof navigator<"u"&&/Win/.test(navigator.platform);function jv(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,s,i,o;for(let l=0;l<e.length-1;l++){let a=e[l];if(/^(cmd|meta|m)$/i.test(a))o=!0;else if(/^a(lt)?$/i.test(a))r=!0;else if(/^(c|ctrl|control)$/i.test(a))s=!0;else if(/^s(hift)?$/i.test(a))i=!0;else if(/^mod$/i.test(a))Ev?o=!0:s=!0;else throw new Error("Unrecognized modifier name: "+a)}return r&&(n="Alt-"+n),s&&(n="Ctrl-"+n),o&&(n="Meta-"+n),i&&(n="Shift-"+n),n}function Iv(t){let e=Object.create(null);for(let n in t)e[jv(n)]=t[n];return e}function So(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function Dv(t){return new Se({props:{handleKeyDown:nh(t)}})}function nh(t){let e=Iv(t);return function(n,r){let s=Tv(r),i,o=e[So(s,r)];if(o&&o(n.state,n.dispatch,n))return!0;if(s.length==1&&s!=" "){if(r.shiftKey){let l=e[So(s,r,!1)];if(l&&l(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(Mv&&r.ctrlKey&&r.altKey)&&(i=Cn[r.keyCode])&&i!=s){let l=e[So(i,r)];if(l&&l(n.state,n.dispatch,n))return!0}}return!1}}var Ov=Object.defineProperty,ql=(t,e)=>{for(var n in e)Ov(t,n,{get:e[n],enumerable:!0})};function Ki(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:s}=n,{storedMarks:i}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return i},get selection(){return r},get doc(){return s},get tr(){return r=n.selection,s=n.doc,i=n.storedMarks,n}}}var Gi=class{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:e,state:n}=this,{view:r}=e,{tr:s}=n,i=this.buildProps(s);return Object.fromEntries(Object.entries(t).map(([o,l])=>[o,(...c)=>{const u=l(...c)(i);return!s.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(s),u}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,e=!0){const{rawCommands:n,editor:r,state:s}=this,{view:i}=r,o=[],l=!!t,a=t||s.tr,c=()=>(!l&&e&&!a.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(a),o.every(h=>h===!0)),u={...Object.fromEntries(Object.entries(n).map(([h,p])=>[h,(...m)=>{const g=this.buildProps(a,e),b=p(...m)(g);return o.push(b),u}])),run:c};return u}createCan(t){const{rawCommands:e,state:n}=this,r=!1,s=t||n.tr,i=this.buildProps(s,r);return{...Object.fromEntries(Object.entries(e).map(([l,a])=>[l,(...c)=>a(...c)({...i,dispatch:void 0})])),chain:()=>this.createChain(s,r)}}buildProps(t,e=!0){const{rawCommands:n,editor:r,state:s}=this,{view:i}=r,o={tr:t,editor:r,view:i,state:Ki({state:s,transaction:t}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t,e),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(n).map(([l,a])=>[l,(...c)=>a(...c)(o)]))}};return o}},rh={};ql(rh,{blur:()=>Rv,clearContent:()=>Lv,clearNodes:()=>Bv,command:()=>$v,createParagraphNear:()=>Pv,cut:()=>zv,deleteCurrentNode:()=>Fv,deleteNode:()=>Hv,deleteRange:()=>Wv,deleteSelection:()=>Uv,enter:()=>Kv,exitCode:()=>Gv,extendMarkRange:()=>Jv,first:()=>Yv,focus:()=>Xv,forEach:()=>Zv,insertContent:()=>e_,insertContentAt:()=>r_,joinBackward:()=>o_,joinDown:()=>i_,joinForward:()=>l_,joinItemBackward:()=>a_,joinItemForward:()=>c_,joinTextblockBackward:()=>d_,joinTextblockForward:()=>u_,joinUp:()=>s_,keyboardShortcut:()=>f_,lift:()=>p_,liftEmptyBlock:()=>m_,liftListItem:()=>g_,newlineInCode:()=>b_,resetAttributes:()=>y_,scrollIntoView:()=>x_,selectAll:()=>v_,selectNodeBackward:()=>__,selectNodeForward:()=>k_,selectParentNode:()=>w_,selectTextblockEnd:()=>C_,selectTextblockStart:()=>S_,setContent:()=>N_,setMark:()=>K_,setMeta:()=>G_,setNode:()=>J_,setNodeSelection:()=>Y_,setTextDirection:()=>Q_,setTextSelection:()=>X_,sinkListItem:()=>Z_,splitBlock:()=>ek,splitListItem:()=>tk,toggleList:()=>rk,toggleMark:()=>sk,toggleNode:()=>ik,toggleWrap:()=>ok,undoInputRule:()=>lk,unsetAllMarks:()=>ak,unsetMark:()=>ck,unsetTextDirection:()=>dk,updateAttributes:()=>uk,wrapIn:()=>hk,wrapInList:()=>fk});var Rv=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),Lv=(t=!0)=>({commands:e})=>e.setContent("",{emitUpdate:t}),Bv=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:s}=r;return n&&s.forEach(({$from:i,$to:o})=>{t.doc.nodesBetween(i.pos,o.pos,(l,a)=>{if(l.type.isText)return;const{doc:c,mapping:u}=e,h=c.resolve(u.map(a)),p=c.resolve(u.map(a+l.nodeSize)),f=h.blockRange(p);if(!f)return;const m=_r(f);if(l.type.isTextblock){const{defaultType:g}=h.parent.contentMatchAt(h.index());e.setNodeMarkup(f.start,g)}(m||m===0)&&e.lift(f,m)})}),!0},$v=t=>e=>t(e),Pv=()=>({state:t,dispatch:e})=>bu(t,e),zv=(t,e)=>({editor:n,tr:r})=>{const{state:s}=n,i=s.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const o=r.mapping.map(e);return r.insert(o,i.content),r.setSelection(new X(r.doc.resolve(Math.max(o-1,0)))),!0},Fv=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const s=t.selection.$anchor;for(let i=s.depth;i>0;i-=1)if(s.node(i).type===r.type){if(e){const l=s.before(i),a=s.after(i);t.delete(l,a).scrollIntoView()}return!0}return!1};function Fe(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}var Hv=t=>({tr:e,state:n,dispatch:r})=>{const s=Fe(t,n.schema),i=e.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===s){if(r){const a=i.before(o),c=i.after(o);e.delete(a,c).scrollIntoView()}return!0}return!1},Wv=t=>({tr:e,dispatch:n})=>{const{from:r,to:s}=t;return n&&e.delete(r,s),!0},Vv=t=>t.content?/^text(\*|\+)/.test(t.content):!1,Ec=(t,e,n)=>{if(!t.parent.isInline||n==="left"&&t.pos>t.start()||n==="right"&&t.pos<t.end())return t.pos;const r=e.nodes[t.parent.type.name].spec;return Vv(r)?n==="left"?t.start()-1:t.end()+1:t.pos},qv=(t,e,n)=>{const r=Ec(t,n,"left"),s=Ec(e,n,"right");return{from:r,to:s}},Uv=()=>({state:t,dispatch:e})=>{const{$from:n,$to:r}=t.selection;if(t.selection.empty)return!1;const{from:s,to:i}=qv(n,r,t.schema);return e&&(t.tr.deleteRange(s,i).scrollIntoView(),e(t.tr)),!0},Kv=()=>({commands:t})=>t.keyboardShortcut("Enter"),Gv=()=>({state:t,dispatch:e})=>Ex(t,e);function Ul(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function oi(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(s=>n.strict?e[s]===t[s]:Ul(e[s])?e[s].test(t[s]):e[s]===t[s]):!0}function sh(t,e,n={}){return t.find(r=>r.type===e&&oi(Object.fromEntries(Object.keys(n).map(s=>[s,r.attrs[s]])),n))}function Mc(t,e,n={}){return!!sh(t,e,n)}function Kl(t,e,n){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if((!r.node||!r.node.marks.some(c=>c.type===e))&&(r=t.parent.childBefore(t.parentOffset)),!r.node||!r.node.marks.some(c=>c.type===e))return;if(!n){const c=r.node.marks.find(u=>u.type===e);c&&(n=c.attrs)}if(!sh([...r.node.marks],e,n))return;let i=r.index,o=t.start()+r.offset,l=i+1,a=o+r.node.nodeSize;for(;i>0&&Mc([...t.parent.child(i-1).marks],e,n);)i-=1,o-=t.parent.child(i).nodeSize;for(;l<t.parent.childCount&&Mc([...t.parent.child(l).marks],e,n);)a+=t.parent.child(l).nodeSize,l+=1;return{from:o,to:a}}function ln(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}var Jv=(t,e)=>({tr:n,state:r,dispatch:s})=>{const i=ln(t,r.schema),{doc:o,selection:l}=n,{$from:a,from:c,to:u}=l;if(s){const h=Kl(a,i,e);if(h&&h.from<=c&&h.to>=u){const p=X.create(o,h.from,h.to);n.setSelection(p)}}return!0},Yv=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1};function ih(t){return t instanceof X}function Pn(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function oh(t,e=null){if(!e)return null;const n=oe.atStart(t),r=oe.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const s=n.from,i=r.to;return e==="all"?X.create(t,Pn(0,s,i),Pn(t.content.size,s,i)):X.create(t,Pn(e,s,i),Pn(e,s,i))}function jc(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function li(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function Qv(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var Xv=(t=null,e={})=>({editor:n,view:r,tr:s,dispatch:i})=>{e={scrollIntoView:!0,...e};const o=()=>{(li()||jc())&&r.dom.focus(),Qv()&&!li()&&!jc()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&t===null||t===!1)return!0}catch{return!1}if(i&&t===null&&!ih(n.state.selection))return o(),!0;const l=oh(s.doc,t)||n.state.selection,a=n.state.selection.eq(l);return i&&(a||s.setSelection(l),a&&s.storedMarks&&s.setStoredMarks(s.storedMarks),o()),!0},Zv=(t,e)=>n=>t.every((r,s)=>e(r,{...n,index:s})),e_=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),lh=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&lh(r)}return t};function js(t){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return lh(n)}function cs(t,e,n){if(t instanceof Mt||t instanceof M)return t;n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,s=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return M.fromArray(t.map(l=>e.nodeFromJSON(l)));const o=e.nodeFromJSON(t);return n.errorOnInvalidContent&&o.check(),o}catch(i){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:i});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",i),cs("",e,n)}if(s){if(n.errorOnInvalidContent){let o=!1,l="";const a=new Wd({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(o=!0,l=typeof c=="string"?c:c.outerHTML,null)}]}})});if(n.slice?vn.fromSchema(a).parseSlice(js(t),n.parseOptions):vn.fromSchema(a).parse(js(t),n.parseOptions),n.errorOnInvalidContent&&o)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${l}`)})}const i=vn.fromSchema(e);return n.slice?i.parseSlice(js(t),n.parseOptions).content:i.parse(js(t),n.parseOptions)}return cs("",e,n)}function t_(t,e,n){const r=t.steps.length-1;if(r<e)return;const s=t.steps[r];if(!(s instanceof Pe||s instanceof Ve))return;const i=t.mapping.maps[r];let o=0;i.forEach((l,a,c,u)=>{o===0&&(o=u)}),t.setSelection(oe.near(t.doc.resolve(o),n))}var n_=t=>!("type"in t),r_=(t,e,n)=>({tr:r,dispatch:s,editor:i})=>{var o;if(s){n={parseOptions:i.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let l;const a=b=>{i.emit("contentError",{editor:i,error:b,disableCollaboration:()=>{"collaboration"in i.storage&&typeof i.storage.collaboration=="object"&&i.storage.collaboration&&(i.storage.collaboration.isDisabled=!0)}})},c={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!i.options.enableContentCheck&&i.options.emitContentError)try{cs(e,i.schema,{parseOptions:c,errorOnInvalidContent:!0})}catch(b){a(b)}try{l=cs(e,i.schema,{parseOptions:c,errorOnInvalidContent:(o=n.errorOnInvalidContent)!=null?o:i.options.enableContentCheck})}catch(b){return a(b),!1}let{from:u,to:h}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},p=!0,f=!0;if((n_(l)?l:[l]).forEach(b=>{b.check(),p=p?b.isText&&b.marks.length===0:!1,f=f?b.isBlock:!1}),u===h&&f){const{parent:b}=r.doc.resolve(u);b.isTextblock&&!b.type.spec.code&&!b.childCount&&(u-=1,h+=1)}let g;if(p){if(Array.isArray(e))g=e.map(b=>b.text||"").join("");else if(e instanceof M){let b="";e.forEach(y=>{y.text&&(b+=y.text)}),g=b}else typeof e=="object"&&e&&e.text?g=e.text:g=e;r.insertText(g,u,h)}else{g=l;const b=r.doc.resolve(u),y=b.node(),v=b.parentOffset===0,_=y.isText||y.isTextblock,w=y.content.size>0;v&&_&&w&&f&&(u=Math.max(0,u-1)),r.replaceWith(u,h,g)}n.updateSelection&&t_(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:u,text:g}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:u,text:g})}return!0},s_=()=>({state:t,dispatch:e})=>Nx(t,e),i_=()=>({state:t,dispatch:e})=>Ax(t,e),o_=()=>({state:t,dispatch:e})=>du(t,e),l_=()=>({state:t,dispatch:e})=>pu(t,e),a_=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Fi(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},c_=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Fi(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},d_=()=>({state:t,dispatch:e})=>Cx(t,e),u_=()=>({state:t,dispatch:e})=>Sx(t,e);function ah(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function h_(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,s,i,o;for(let l=0;l<e.length-1;l+=1){const a=e[l];if(/^(cmd|meta|m)$/i.test(a))o=!0;else if(/^a(lt)?$/i.test(a))r=!0;else if(/^(c|ctrl|control)$/i.test(a))s=!0;else if(/^s(hift)?$/i.test(a))i=!0;else if(/^mod$/i.test(a))li()||ah()?o=!0:s=!0;else throw new Error(`Unrecognized modifier name: ${a}`)}return r&&(n=`Alt-${n}`),s&&(n=`Ctrl-${n}`),o&&(n=`Meta-${n}`),i&&(n=`Shift-${n}`),n}var f_=t=>({editor:e,view:n,tr:r,dispatch:s})=>{const i=h_(t).split(/-(?!$)/),o=i.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),l=new KeyboardEvent("keydown",{key:o==="Space"?" ":o,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),a=e.captureTransaction(()=>{n.someProp("handleKeyDown",c=>c(n,l))});return a==null||a.steps.forEach(c=>{const u=c.map(r.mapping);u&&s&&r.maybeStep(u)}),!0};function Sn(t,e,n={}){const{from:r,to:s,empty:i}=t.selection,o=e?Fe(e,t.schema):null,l=[];t.doc.nodesBetween(r,s,(h,p)=>{if(h.isText)return;const f=Math.max(r,p),m=Math.min(s,p+h.nodeSize);l.push({node:h,from:f,to:m})});const a=s-r,c=l.filter(h=>o?o.name===h.node.type.name:!0).filter(h=>oi(h.node.attrs,n,{strict:!1}));return i?!!c.length:c.reduce((h,p)=>h+p.to-p.from,0)>=a}var p_=(t,e={})=>({state:n,dispatch:r})=>{const s=Fe(t,n.schema);return Sn(n,s,e)?Tx(n,r):!1},m_=()=>({state:t,dispatch:e})=>yu(t,e),g_=t=>({state:e,dispatch:n})=>{const r=Fe(t,e.schema);return zx(r)(e,n)},b_=()=>({state:t,dispatch:e})=>gu(t,e);function Ji(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function Ic(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,s)=>(n.includes(s)||(r[s]=t[s]),r),{})}var y_=(t,e)=>({tr:n,state:r,dispatch:s})=>{let i=null,o=null;const l=Ji(typeof t=="string"?t:t.name,r.schema);if(!l)return!1;l==="node"&&(i=Fe(t,r.schema)),l==="mark"&&(o=ln(t,r.schema));let a=!1;return n.selection.ranges.forEach(c=>{r.doc.nodesBetween(c.$from.pos,c.$to.pos,(u,h)=>{i&&i===u.type&&(a=!0,s&&n.setNodeMarkup(h,void 0,Ic(u.attrs,e))),o&&u.marks.length&&u.marks.forEach(p=>{o===p.type&&(a=!0,s&&n.addMark(h,h+u.nodeSize,o.create(Ic(p.attrs,e))))})})}),a},x_=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),v_=()=>({tr:t,dispatch:e})=>{if(e){const n=new xt(t.doc);t.setSelection(n)}return!0},__=()=>({state:t,dispatch:e})=>hu(t,e),k_=()=>({state:t,dispatch:e})=>mu(t,e),w_=()=>({state:t,dispatch:e})=>Ix(t,e),C_=()=>({state:t,dispatch:e})=>Rx(t,e),S_=()=>({state:t,dispatch:e})=>Ox(t,e);function cl(t,e,n={},r={}){return cs(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var N_=(t,{errorOnInvalidContent:e,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:s,tr:i,dispatch:o,commands:l})=>{const{doc:a}=i;if(r.preserveWhitespace!=="full"){const c=cl(t,s.schema,r,{errorOnInvalidContent:e??s.options.enableContentCheck});return o&&i.replaceWith(0,a.content.size,c).setMeta("preventUpdate",!n),!0}return o&&i.setMeta("preventUpdate",!n),l.insertContentAt({from:0,to:a.content.size},t,{parseOptions:r,errorOnInvalidContent:e??s.options.enableContentCheck})};function ch(t,e){const n=ln(e,t.schema),{from:r,to:s,empty:i}=t.selection,o=[];i?(t.storedMarks&&o.push(...t.storedMarks),o.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,s,a=>{o.push(...a.marks)});const l=o.find(a=>a.type.name===n.name);return l?{...l.attrs}:{}}function dh(t,e){const n=new iu(t);return e.forEach(r=>{r.steps.forEach(s=>{n.step(s)})}),n}function A_(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function T_(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,(s,i)=>{n(s)&&r.push({node:s,pos:i})}),r}function E_(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function Yi(t){return e=>E_(e.$from,t)}function K(t,e,n){return t.config[e]===void 0&&t.parent?K(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?K(t.parent,e,n):null}):t.config[e]}function Gl(t){return t.map(e=>{const n={name:e.name,options:e.options,storage:e.storage},r=K(e,"addExtensions",n);return r?[e,...Gl(r())]:e}).flat(10)}function Jl(t,e){const n=tr.fromSchema(e).serializeFragment(t),s=document.implementation.createHTMLDocument().createElement("div");return s.appendChild(n),s.innerHTML}function uh(t){return typeof t=="function"}function me(t,e=void 0,...n){return uh(t)?e?t.bind(e)(...n):t(...n):t}function M_(t={}){return Object.keys(t).length===0&&t.constructor===Object}function xr(t){const e=t.filter(s=>s.type==="extension"),n=t.filter(s=>s.type==="node"),r=t.filter(s=>s.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function hh(t){const e=[],{nodeExtensions:n,markExtensions:r}=xr(t),s=[...n,...r],i={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},o=n.filter(c=>c.name!=="text").map(c=>c.name),l=r.map(c=>c.name),a=[...o,...l];return t.forEach(c=>{const u={name:c.name,options:c.options,storage:c.storage,extensions:s},h=K(c,"addGlobalAttributes",u);if(!h)return;h().forEach(f=>{let m;Array.isArray(f.types)?m=f.types:f.types==="*"?m=a:f.types==="nodes"?m=o:f.types==="marks"?m=l:m=[],m.forEach(g=>{Object.entries(f.attributes).forEach(([b,y])=>{e.push({type:g,name:b,attribute:{...i,...y}})})})})}),s.forEach(c=>{const u={name:c.name,options:c.options,storage:c.storage},h=K(c,"addAttributes",u);if(!h)return;const p=h();Object.entries(p).forEach(([f,m])=>{const g={...i,...m};typeof(g==null?void 0:g.default)=="function"&&(g.default=g.default()),g!=null&&g.isRequired&&(g==null?void 0:g.default)===void 0&&delete g.default,e.push({type:c.name,name:f,attribute:g})})}),e}function j_(t){const e=[];let n="",r=!1,s=!1,i=0;const o=t.length;for(let l=0;l<o;l+=1){const a=t[l];if(a==="'"&&!s){r=!r,n+=a;continue}if(a==='"'&&!r){s=!s,n+=a;continue}if(!r&&!s){if(a==="("){i+=1,n+=a;continue}if(a===")"&&i>0){i-=1,n+=a;continue}if(a===";"&&i===0){e.push(n),n="";continue}}n+=a}return n&&e.push(n),e}function Dc(t){const e=[],n=j_(t||""),r=n.length;for(let s=0;s<r;s+=1){const i=n[s],o=i.indexOf(":");if(o===-1)continue;const l=i.slice(0,o).trim(),a=i.slice(o+1).trim();l&&a&&e.push([l,a])}return e}function ye(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([s,i])=>{if(!r[s]){r[s]=i;return}if(s==="class"){const l=i?String(i).split(" "):[],a=r[s]?r[s].split(" "):[],c=l.filter(u=>!a.includes(u));r[s]=[...a,...c].join(" ")}else if(s==="style"){const l=new Map([...Dc(r[s]),...Dc(i)]);r[s]=Array.from(l.entries()).map(([a,c])=>`${a}: ${c}`).join("; ")}else r[s]=i}),r},{})}function ds(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>ye(n,r),{})}function I_(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function Oc(t,e){return"style"in t?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const s=e.reduce((i,o)=>{const l=o.attribute.parseHTML?o.attribute.parseHTML(n):I_(n.getAttribute(o.name));return l==null?i:{...i,[o.name]:l}},{});return{...r,...s}}}}function Rc(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&M_(n)?!1:n!=null))}function Lc(t){var e,n;const r={};return!((e=t==null?void 0:t.attribute)!=null&&e.isRequired)&&"default"in((t==null?void 0:t.attribute)||{})&&(r.default=t.attribute.default),((n=t==null?void 0:t.attribute)==null?void 0:n.validate)!==void 0&&(r.validate=t.attribute.validate),[t.name,r]}function D_(t,e){var n;const r=hh(t),{nodeExtensions:s,markExtensions:i}=xr(t),o=(n=s.find(c=>K(c,"topNode")))==null?void 0:n.name,l=Object.fromEntries(s.map(c=>{const u=r.filter(y=>y.type===c.name),h={name:c.name,options:c.options,storage:c.storage,editor:e},p=t.reduce((y,v)=>{const _=K(v,"extendNodeSchema",h);return{...y,..._?_(c):{}}},{}),f=Rc({...p,content:me(K(c,"content",h)),marks:me(K(c,"marks",h)),group:me(K(c,"group",h)),inline:me(K(c,"inline",h)),atom:me(K(c,"atom",h)),selectable:me(K(c,"selectable",h)),draggable:me(K(c,"draggable",h)),code:me(K(c,"code",h)),whitespace:me(K(c,"whitespace",h)),linebreakReplacement:me(K(c,"linebreakReplacement",h)),defining:me(K(c,"defining",h)),isolating:me(K(c,"isolating",h)),attrs:Object.fromEntries(u.map(Lc))}),m=me(K(c,"parseHTML",h));m&&(f.parseDOM=m.map(y=>Oc(y,u)));const g=K(c,"renderHTML",h);g&&(f.toDOM=y=>g({node:y,HTMLAttributes:ds(y,u)}));const b=K(c,"renderText",h);return b&&(f.toText=b),[c.name,f]})),a=Object.fromEntries(i.map(c=>{const u=r.filter(b=>b.type===c.name),h={name:c.name,options:c.options,storage:c.storage,editor:e},p=t.reduce((b,y)=>{const v=K(y,"extendMarkSchema",h);return{...b,...v?v(c):{}}},{}),f=Rc({...p,inclusive:me(K(c,"inclusive",h)),excludes:me(K(c,"excludes",h)),group:me(K(c,"group",h)),spanning:me(K(c,"spanning",h)),code:me(K(c,"code",h)),attrs:Object.fromEntries(u.map(Lc))}),m=me(K(c,"parseHTML",h));m&&(f.parseDOM=m.map(b=>Oc(b,u)));const g=K(c,"renderHTML",h);return g&&(f.toDOM=b=>g({mark:b,HTMLAttributes:ds(b,u)})),[c.name,f]}));return new Wd({topNode:o,nodes:l,marks:a})}function O_(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}function Gr(t){return t.sort((n,r)=>{const s=K(n,"priority")||100,i=K(r,"priority")||100;return s>i?-1:s<i?1:0})}function fh(t){const e=Gr(Gl(t)),n=O_(e.map(r=>r.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(r=>`'${r}'`).join(", ")}]. This can lead to issues.`),e}function ph(t,e,n){const{from:r,to:s}=e,{blockSeparator:i=`
|
|
27
|
+
|
|
28
|
+
`,textSerializers:o={}}=n||{};let l="";return t.nodesBetween(r,s,(a,c,u,h)=>{var p;a.isBlock&&c>r&&(l+=i);const f=o==null?void 0:o[a.type.name];if(f)return u&&(l+=f({node:a,pos:c,parent:u,index:h,range:e})),!1;a.isText&&(l+=(p=a==null?void 0:a.text)==null?void 0:p.slice(Math.max(r,c)-c,s-c))}),l}function R_(t,e){const n={from:0,to:t.content.size};return ph(t,n,e)}function mh(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}function L_(t,e){const n=Fe(e,t.schema),{from:r,to:s}=t.selection,i=[];t.doc.nodesBetween(r,s,l=>{i.push(l)});const o=i.reverse().find(l=>l.type.name===n.name);return o?{...o.attrs}:{}}function gh(t,e){const n=Ji(typeof e=="string"?e:e.name,t.schema);return n==="node"?L_(t,e):n==="mark"?ch(t,e):{}}function B_(t,e=JSON.stringify){const n={};return t.filter(r=>{const s=e(r);return Object.prototype.hasOwnProperty.call(n,s)?!1:n[s]=!0})}function $_(t){const e=B_(t);return e.length===1?e:e.filter((n,r)=>!e.filter((i,o)=>o!==r).some(i=>n.oldRange.from>=i.oldRange.from&&n.oldRange.to<=i.oldRange.to&&n.newRange.from>=i.newRange.from&&n.newRange.to<=i.newRange.to))}function bh(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach((s,i)=>{const o=[];if(s.ranges.length)s.forEach((l,a)=>{o.push({from:l,to:a})});else{const{from:l,to:a}=n[i];if(l===void 0||a===void 0)return;o.push({from:l,to:a})}o.forEach(({from:l,to:a})=>{const c=e.slice(i).map(l,-1),u=e.slice(i).map(a),h=e.invert().map(c,-1),p=e.invert().map(u);r.push({oldRange:{from:h,to:p},newRange:{from:c,to:u}})})}),$_(r)}function Yl(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(s=>{const i=n.resolve(t),o=Kl(i,s.type);o&&r.push({mark:s,...o})}):n.nodesBetween(t,e,(s,i)=>{!s||(s==null?void 0:s.nodeSize)===void 0||r.push(...s.marks.map(o=>({from:i,to:i+s.nodeSize,mark:o})))}),r}var P_=(t,e,n,r=20)=>{const s=t.doc.resolve(n);let i=r,o=null;for(;i>0&&o===null;){const l=s.node(i);(l==null?void 0:l.type.name)===e?o=l:i-=1}return[o,i]};function jr(t,e){return e.nodes[t]||e.marks[t]||null}function qs(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const s=t.find(i=>i.type===e&&i.name===r);return s?s.attribute.keepOnSplit:!1}))}var z_=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(s,i,o,l)=>{var a,c;const u=((c=(a=s.type.spec).toText)==null?void 0:c.call(a,{node:s,pos:i,parent:o,index:l}))||s.textContent||"%leaf%";n+=s.isAtom&&!s.isText?u:u.slice(0,Math.max(0,r-i))}),n};function dl(t,e,n={}){const{empty:r,ranges:s}=t.selection,i=e?ln(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(h=>i?i.name===h.type.name:!0).find(h=>oi(h.attrs,n,{strict:!1}));let o=0;const l=[];if(s.forEach(({$from:h,$to:p})=>{const f=h.pos,m=p.pos;t.doc.nodesBetween(f,m,(g,b)=>{if(i&&g.inlineContent&&!g.type.allowsMarkType(i))return!1;if(!g.isText&&!g.marks.length)return;const y=Math.max(f,b),v=Math.min(m,b+g.nodeSize),_=v-y;o+=_,l.push(...g.marks.map(w=>({mark:w,from:y,to:v})))})}),o===0)return!1;const a=l.filter(h=>i?i.name===h.mark.type.name:!0).filter(h=>oi(h.mark.attrs,n,{strict:!1})).reduce((h,p)=>h+p.to-p.from,0),c=l.filter(h=>i?h.mark.type!==i&&h.mark.type.excludes(i):!0).reduce((h,p)=>h+p.to-p.from,0);return(a>0?a+c:a)>=o}function F_(t,e,n={}){if(!e)return Sn(t,null,n)||dl(t,null,n);const r=Ji(e,t.schema);return r==="node"?Sn(t,e,n):r==="mark"?dl(t,e,n):!1}var H_=(t,e)=>{const{$from:n,$to:r,$anchor:s}=t.selection;if(e){const i=Yi(l=>l.type.name===e)(t.selection);if(!i)return!1;const o=t.doc.resolve(i.pos+1);return s.pos+1===o.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},W_=t=>{const{$from:e,$to:n}=t.selection;return!(e.parentOffset>0||e.pos!==n.pos)};function Bc(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function No(t,e){const{nodeExtensions:n}=xr(e),r=n.find(o=>o.name===t);if(!r)return!1;const s={name:r.name,options:r.options,storage:r.storage},i=me(K(r,"group",s));return typeof i!="string"?!1:i.split(" ").includes("list")}function us(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return!/\S/.test((r=t.text)!=null?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let s=!0;return t.content.forEach(i=>{s!==!1&&(us(i,{ignoreWhitespace:n,checkChildren:e})||(s=!1))}),s}return!1}function yh(t){return t instanceof J}var xh=class vh{constructor(e){this.position=e}static fromJSON(e){return new vh(e.position)}toJSON(){return{position:this.position}}};function V_(t,e){const n=e.mapping.mapResult(t.position);return{position:new xh(n.pos),mapResult:n}}function q_(t){return new xh(t)}function U_(t,e,n){var r;const{selection:s}=e;let i=null;if(ih(s)&&(i=s.$cursor),i){const l=(r=t.storedMarks)!=null?r:i.marks();return i.parent.type.allowsMarkType(n)&&(!!n.isInSet(l)||!l.some(c=>c.type.excludes(n)))}const{ranges:o}=s;return o.some(({$from:l,$to:a})=>{let c=l.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(l.pos,a.pos,(u,h,p)=>{if(c)return!1;if(u.isInline){const f=!p||p.type.allowsMarkType(n),m=!!n.isInSet(u.marks)||!u.marks.some(g=>g.type.excludes(n));c=f&&m}return!c}),c})}var K_=(t,e={})=>({tr:n,state:r,dispatch:s})=>{const{selection:i}=n,{empty:o,ranges:l}=i,a=ln(t,r.schema);if(s)if(o){const c=ch(r,a);n.addStoredMark(a.create({...c,...e}))}else l.forEach(c=>{const u=c.$from.pos,h=c.$to.pos;r.doc.nodesBetween(u,h,(p,f)=>{const m=Math.max(f,u),g=Math.min(f+p.nodeSize,h);p.marks.find(y=>y.type===a)?p.marks.forEach(y=>{a===y.type&&n.addMark(m,g,a.create({...y.attrs,...e}))}):n.addMark(m,g,a.create(e))})});return U_(r,n,a)},G_=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),J_=(t,e={})=>({state:n,dispatch:r,chain:s})=>{const i=Fe(t,n.schema);let o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),i.isTextblock?s().command(({commands:l})=>Ja(i,{...o,...e})(n)?!0:l.clearNodes()).command(({state:l})=>Ja(i,{...o,...e})(l,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},Y_=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,s=Pn(t,0,r.content.size),i=J.create(r,s);e.setSelection(i)}return!0},Q_=(t,e)=>({tr:n,state:r,dispatch:s})=>{const{selection:i}=r;let o,l;return typeof e=="number"?(o=e,l=e):e&&"from"in e&&"to"in e?(o=e.from,l=e.to):(o=i.from,l=i.to),s&&n.doc.nodesBetween(o,l,(a,c)=>{a.isText||n.setNodeMarkup(c,void 0,{...a.attrs,dir:t})}),!0},X_=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:s,to:i}=typeof t=="number"?{from:t,to:t}:t,o=X.atStart(r).from,l=X.atEnd(r).to,a=Pn(s,o,l),c=Pn(i,o,l),u=X.create(r,a,c);e.setSelection(u)}return!0},Z_=t=>({state:e,dispatch:n})=>{const r=Fe(t,e.schema);return Wx(r)(e,n)};function $c(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(s=>e==null?void 0:e.includes(s.type.name));t.tr.ensureMarks(r)}}var ek=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:s})=>{const{selection:i,doc:o}=e,{$from:l,$to:a}=i,c=s.extensionManager.attributes,u=qs(c,l.node().type.name,l.node().attrs);if(i instanceof J&&i.node.isBlock)return!l.parentOffset||!sn(o,l.pos)?!1:(r&&(t&&$c(n,s.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;const h=a.parentOffset===a.parent.content.size,p=l.depth===0?void 0:A_(l.node(-1).contentMatchAt(l.indexAfter(-1)));let f=h&&p?[{type:p,attrs:u}]:void 0,m=sn(e.doc,e.mapping.map(l.pos),1,f);if(!f&&!m&&sn(e.doc,e.mapping.map(l.pos),1,p?[{type:p}]:void 0)&&(m=!0,f=p?[{type:p,attrs:u}]:void 0),r){if(m&&(i instanceof X&&e.deleteSelection(),e.split(e.mapping.map(l.pos),1,f),p&&!h&&!l.parentOffset&&l.parent.type!==p)){const g=e.mapping.map(l.before()),b=e.doc.resolve(g);l.node(-1).canReplaceWith(b.index(),b.index()+1,p)&&e.setNodeMarkup(e.mapping.map(l.before()),p)}t&&$c(n,s.extensionManager.splittableMarks),e.scrollIntoView()}return m},tk=(t,e={})=>({tr:n,state:r,dispatch:s,editor:i})=>{var o;const l=Fe(t,r.schema),{$from:a,$to:c}=r.selection,u=r.selection.node;if(u&&u.isBlock||a.depth<2||!a.sameParent(c))return!1;const h=a.node(-1);if(h.type!==l)return!1;const p=i.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==l||a.index(-2)!==a.node(-2).childCount-1)return!1;if(s){let y=M.empty;const v=a.index(-1)?1:a.index(-2)?2:3;for(let O=a.depth-v;O>=a.depth-3;O-=1)y=M.from(a.node(O).copy(y));const _=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,w={...qs(p,a.node().type.name,a.node().attrs),...e},k=((o=l.contentMatch.defaultType)==null?void 0:o.createAndFill(w))||void 0;y=y.append(M.from(l.createAndFill(null,k)||void 0));const C=a.before(a.depth-(v-1));n.replace(C,a.after(-_),new F(y,4-v,0));let S=-1;n.doc.nodesBetween(C,n.doc.content.size,(O,B)=>{if(S>-1)return!1;O.isTextblock&&O.content.size===0&&(S=B+1)}),S>-1&&n.setSelection(X.near(n.doc.resolve(S))),n.scrollIntoView()}return!0}const f=c.pos===a.end()?h.contentMatchAt(0).defaultType:null,m={...qs(p,h.type.name,h.attrs),...e},g={...qs(p,a.node().type.name,a.node().attrs),...e};n.delete(a.pos,c.pos);const b=f?[{type:l,attrs:m},{type:f,attrs:g}]:[{type:l,attrs:m}];if(!sn(n.doc,a.pos,2))return!1;if(s){const{selection:y,storedMarks:v}=r,{splittableMarks:_}=i.extensionManager,w=v||y.$to.parentOffset&&y.$from.marks();if(n.split(a.pos,2,b).scrollIntoView(),!w||!s)return!0;const k=w.filter(C=>_.includes(C.type.name));n.ensureMarks(k)}return!0},Ao=(t,e)=>{const n=Yi(o=>o.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const s=t.doc.nodeAt(r);return n.node.type===(s==null?void 0:s.type)&&An(t.doc,n.pos)&&t.join(n.pos),!0},To=(t,e)=>{const n=Yi(o=>o.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const s=t.doc.nodeAt(r);return n.node.type===(s==null?void 0:s.type)&&An(t.doc,r)&&t.join(r),!0};function nk(t){const e=t.doc,n=e.firstChild;if(!n)return null;const r=e.resolve(1),s=e.resolve(n.nodeSize-1);return X.between(r,s)}var rk=(t,e,n,r={})=>({editor:s,tr:i,state:o,dispatch:l,chain:a,commands:c,can:u})=>{const{extensions:h,splittableMarks:p}=s.extensionManager,f=Fe(t,o.schema),m=Fe(e,o.schema),{selection:g,storedMarks:b}=o,{$from:y,$to:v}=g,_=y.blockRange(v),w=b||g.$to.parentOffset&&g.$from.marks();if(!_)return!1;const k=Yi(L=>No(L.type.name,h))(g),C=g.from===0&&g.to===o.doc.content.size,S=o.doc.content.content,O=S.length===1?S[0]:null,B=C&&O&&No(O.type.name,h)?{node:O,pos:0}:null,N=k??B,T=!!k&&_.depth>=1&&_.depth-k.depth<=1,P=!!B;if((T||P)&&N){if(N.node.type===f)return C&&P?a().command(({tr:L,dispatch:R})=>{const H=nk(L);return H?(L.setSelection(H),R&&R(L),!0):!1}).liftListItem(m).run():c.liftListItem(m);if(No(N.node.type.name,h)&&f.validContent(N.node.content))return a().command(()=>(i.setNodeMarkup(N.pos,f),!0)).command(()=>Ao(i,f)).command(()=>To(i,f)).run()}return!n||!w||!l?a().command(()=>u().wrapInList(f,r)?!0:c.clearNodes()).wrapInList(f,r).command(()=>Ao(i,f)).command(()=>To(i,f)).run():a().command(()=>{const L=u().wrapInList(f,r),R=w.filter(H=>p.includes(H.type.name));return i.ensureMarks(R),L?!0:c.clearNodes()}).wrapInList(f,r).command(()=>Ao(i,f)).command(()=>To(i,f)).run()},sk=(t,e={},n={})=>({state:r,commands:s})=>{const{extendEmptyMarkRange:i=!1}=n,o=ln(t,r.schema);return dl(r,o,e)?s.unsetMark(o,{extendEmptyMarkRange:i}):s.setMark(o,e)},ik=(t,e,n={})=>({state:r,commands:s})=>{const i=Fe(t,r.schema),o=Fe(e,r.schema),l=Sn(r,i,n);let a;return r.selection.$anchor.sameParent(r.selection.$head)&&(a=r.selection.$anchor.parent.attrs),l?s.setNode(o,a):s.setNode(i,{...a,...n})},ok=(t,e={})=>({state:n,commands:r})=>{const s=Fe(t,n.schema);return Sn(n,s,e)?r.lift(s):r.wrapIn(s,e)},lk=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const s=n[r];let i;if(s.spec.isInputRules&&(i=s.getState(t))){if(e){const o=t.tr,l=i.transform;for(let a=l.steps.length-1;a>=0;a-=1)o.step(l.steps[a].invert(l.docs[a]));if(i.text){const a=o.doc.resolve(i.from).marks();o.replaceWith(i.from,i.to,t.schema.text(i.text,a))}else o.delete(i.from,i.to)}return!0}}return!1},ak=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:s}=n;return r||e&&s.forEach(i=>{t.removeMark(i.$from.pos,i.$to.pos)}),!0},ck=(t,e={})=>({tr:n,state:r,dispatch:s})=>{var i;const{extendEmptyMarkRange:o=!1}=e,{selection:l}=n,a=ln(t,r.schema),{$from:c,empty:u,ranges:h}=l;if(!s)return!0;if(u&&o){let{from:p,to:f}=l;const m=(i=c.marks().find(b=>b.type===a))==null?void 0:i.attrs,g=Kl(c,a,m);g&&(p=g.from,f=g.to),n.removeMark(p,f,a)}else h.forEach(p=>{n.removeMark(p.$from.pos,p.$to.pos,a)});return n.removeStoredMark(a),!0},dk=t=>({tr:e,state:n,dispatch:r})=>{const{selection:s}=n;let i,o;return typeof t=="number"?(i=t,o=t):t&&"from"in t&&"to"in t?(i=t.from,o=t.to):(i=s.from,o=s.to),r&&e.doc.nodesBetween(i,o,(l,a)=>{if(l.isText)return;const c={...l.attrs};delete c.dir,e.setNodeMarkup(a,void 0,c)}),!0},uk=(t,e={})=>({tr:n,state:r,dispatch:s})=>{let i=null,o=null;const l=Ji(typeof t=="string"?t:t.name,r.schema);if(!l)return!1;l==="node"&&(i=Fe(t,r.schema)),l==="mark"&&(o=ln(t,r.schema));let a=!1;return n.selection.ranges.forEach(c=>{const u=c.$from.pos,h=c.$to.pos;let p,f,m,g;n.selection.empty?r.doc.nodesBetween(u,h,(b,y)=>{i&&i===b.type&&(a=!0,m=Math.max(y,u),g=Math.min(y+b.nodeSize,h),p=y,f=b)}):r.doc.nodesBetween(u,h,(b,y)=>{y<u&&i&&i===b.type&&(a=!0,m=Math.max(y,u),g=Math.min(y+b.nodeSize,h),p=y,f=b),y>=u&&y<=h&&(i&&i===b.type&&(a=!0,s&&n.setNodeMarkup(y,void 0,{...b.attrs,...e})),o&&b.marks.length&&b.marks.forEach(v=>{if(o===v.type&&(a=!0,s)){const _=Math.max(y,u),w=Math.min(y+b.nodeSize,h);n.addMark(_,w,o.create({...v.attrs,...e}))}}))}),f&&(p!==void 0&&s&&n.setNodeMarkup(p,void 0,{...f.attrs,...e}),o&&f.marks.length&&f.marks.forEach(b=>{o===b.type&&s&&n.addMark(m,g,o.create({...b.attrs,...e}))}))}),a},hk=(t,e={})=>({state:n,dispatch:r})=>{const s=Fe(t,n.schema);return Lx(s,e)(n,r)},fk=(t,e={})=>({state:n,dispatch:r})=>{const s=Fe(t,n.schema);return Bx(s,e)(n,r)},pk=class{constructor(){this.callbacks={}}on(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}emit(t,...e){const n=this.callbacks[t];return n&&n.forEach(r=>r.apply(this,e)),this}off(t,e){const n=this.callbacks[t];return n&&(e?this.callbacks[t]=n.filter(r=>r!==e):delete this.callbacks[t]),this}once(t,e){const n=(...r)=>{this.off(t,n),e.apply(this,r)};return this.on(t,n)}removeAllListeners(){this.callbacks={}}},Qi=class{constructor(t){var e;this.find=t.find,this.handler=t.handler,this.undoable=(e=t.undoable)!=null?e:!0}},mk=(t,e)=>{if(Ul(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function Is(t){var e;const{editor:n,from:r,to:s,text:i,rules:o,plugin:l}=t,{view:a}=n;if(a.composing)return!1;const c=a.state.doc.resolve(r);if(c.parent.type.spec.code||(e=c.nodeBefore||c.nodeAfter)!=null&&e.marks.find(p=>p.type.spec.code))return!1;let u=!1;const h=z_(c)+i;return o.forEach(p=>{if(u)return;const f=mk(h,p.find);if(!f)return;const m=a.state.tr,g=Ki({state:a.state,transaction:m}),b={from:r-(f[0].length-i.length),to:s},{commands:y,chain:v,can:_}=new Gi({editor:n,state:g});p.handler({state:g,range:b,match:f,commands:y,chain:v,can:_})===null||!m.steps.length||(p.undoable&&m.setMeta(l,{transform:m,from:r,to:s,text:i}),a.dispatch(m),u=!0)}),u}function gk(t){const{editor:e,rules:n}=t,r=new Se({state:{init(){return null},apply(s,i,o){const l=s.getMeta(r);if(l)return l;const a=s.getMeta("applyInputRules");return!!a&&setTimeout(()=>{let{text:u}=a;typeof u=="string"?u=u:u=Jl(M.from(u),o.schema);const{from:h}=a,p=h+u.length;Is({editor:e,from:h,to:p,text:u,rules:n,plugin:r})}),s.selectionSet||s.docChanged?null:i}},props:{handleTextInput(s,i,o,l){return Is({editor:e,from:i,to:o,text:l,rules:n,plugin:r})},handleDOMEvents:{compositionend:s=>(setTimeout(()=>{const{$cursor:i}=s.state.selection;i&&Is({editor:e,from:i.pos,to:i.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(s,i){if(i.key!=="Enter")return!1;const{$cursor:o}=s.state.selection;return o?Is({editor:e,from:o.pos,to:o.pos,text:`
|
|
29
|
+
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function bk(t){return Object.prototype.toString.call(t).slice(8,-1)}function Ds(t){return bk(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function _h(t,e){const n={...t};return Ds(t)&&Ds(e)&&Object.keys(e).forEach(r=>{Ds(e[r])&&Ds(t[r])?n[r]=_h(t[r],e[r]):n[r]=e[r]}),n}var Ql=class{constructor(t={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...t},this.name=this.config.name}get options(){return{...me(K(this,"addOptions",{name:this.name}))}}get storage(){return{...me(K(this,"addStorage",{name:this.name,options:this.options}))}}configure(t={}){const e=this.extend({...this.config,addOptions:()=>_h(this.options,t)});return e.name=this.name,e.parent=this.parent,this.child=null,e}extend(t={}){const e=new this.constructor({...this.config,...t});return e.parent=this,this.child=e,e.name="name"in t?t.name:e.parent.name,e}},Kt=class kh extends Ql{constructor(){super(...arguments),this.type="mark"}static create(e={}){const n=typeof e=="function"?e():e;return new kh(n)}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,s=e.state.selection.$from;if(s.pos===s.end()){const o=s.marks();if(!!!o.find(c=>(c==null?void 0:c.type.name)===n.name))return!1;const a=o.find(c=>(c==null?void 0:c.type.name)===n.name);return a&&r.removeStoredMark(a),r.insertText(" ",s.pos),e.view.dispatch(r),!0}return!1}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}};function yk(t){return typeof t=="number"}var xk=class{constructor(t){this.find=t.find,this.handler=t.handler}},vk=(t,e,n)=>{if(Ul(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(s=>{const i=[s.text];return i.index=s.index,i.input=t,i.data=s.data,s.replaceWith&&(s.text.includes(s.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),i.push(s.replaceWith)),i}):[]};function _k(t){const{editor:e,state:n,from:r,to:s,rule:i,pasteEvent:o,dropEvent:l}=t,{commands:a,chain:c,can:u}=new Gi({editor:e,state:n}),h=[];return n.doc.nodesBetween(r,s,(f,m)=>{var g,b,y,v,_;if((b=(g=f.type)==null?void 0:g.spec)!=null&&b.code||!(f.isText||f.isTextblock||f.isInline))return;const w=(_=(v=(y=f.content)==null?void 0:y.size)!=null?v:f.nodeSize)!=null?_:0,k=Math.max(r,m),C=Math.min(s,m+w);if(k>=C)return;const S=f.isText?f.text||"":f.textBetween(k-m,C-m,void 0,"");vk(S,i.find,o).forEach(B=>{if(B.index===void 0)return;const N=k+B.index+1,T=N+B[0].length,P={from:n.tr.mapping.map(N),to:n.tr.mapping.map(T)},L=i.handler({state:n,range:P,match:B,commands:a,chain:c,can:u,pasteEvent:o,dropEvent:l});h.push(L)})}),h.every(f=>f!==null)}var Os=null,kk=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)==null||e.setData("text/html",t),n};function wk(t){const{editor:e,rules:n}=t;let r=null,s=!1,i=!1,o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,l;try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}const a=({state:u,from:h,to:p,rule:f,pasteEvt:m})=>{const g=u.tr,b=Ki({state:u,transaction:g});if(!(!_k({editor:e,state:b,from:Math.max(h-1,0),to:p.b-1,rule:f,pasteEvent:m,dropEvent:l})||!g.steps.length)){try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}return o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,g}};return n.map(u=>new Se({view(h){const p=m=>{var g;r=(g=h.dom.parentElement)!=null&&g.contains(m.target)?h.dom.parentElement:null,r&&(Os=e)},f=()=>{Os&&(Os=null)};return window.addEventListener("dragstart",p),window.addEventListener("dragend",f),{destroy(){window.removeEventListener("dragstart",p),window.removeEventListener("dragend",f)}}},props:{handleDOMEvents:{drop:(h,p)=>{if(i=r===h.dom.parentElement,l=p,!i){const f=Os;f!=null&&f.isEditable&&setTimeout(()=>{const m=f.state.selection;m&&f.commands.deleteRange({from:m.from,to:m.to})},10)}return!1},paste:(h,p)=>{var f;const m=(f=p.clipboardData)==null?void 0:f.getData("text/html");return o=p,s=!!(m!=null&&m.includes("data-pm-slice")),!1}}},appendTransaction:(h,p,f)=>{const m=h[0],g=m.getMeta("uiEvent")==="paste"&&!s,b=m.getMeta("uiEvent")==="drop"&&!i,y=m.getMeta("applyPasteRules"),v=!!y;if(!g&&!b&&!v)return;if(v){let{text:k}=y;typeof k=="string"?k=k:k=Jl(M.from(k),f.schema);const{from:C}=y,S=C+k.length,O=kk(k);return a({rule:u,state:f,from:C,to:{b:S},pasteEvt:O})}const _=p.doc.content.findDiffStart(f.doc.content),w=p.doc.content.findDiffEnd(f.doc.content);if(!(!yk(_)||!w||_===w.b))return a({rule:u,state:f,from:_,to:w,pasteEvt:o})}}))}var Xi=class{constructor(t,e){this.splittableMarks=[],this.editor=e,this.baseExtensions=t,this.extensions=fh(t),this.schema=D_(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((t,e)=>{const n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:jr(e.name,this.schema)},r=K(e,"addCommands",n);return r?{...t,...r()}:t},{})}get plugins(){const{editor:t}=this;return Gr([...this.extensions].reverse()).flatMap(r=>{const s={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:t,type:jr(r.name,this.schema)},i=[],o=K(r,"addKeyboardShortcuts",s);let l={};if(r.type==="mark"&&K(r,"exitable",s)&&(l.ArrowRight=()=>Kt.handleExit({editor:t,mark:r})),o){const p=Object.fromEntries(Object.entries(o()).map(([f,m])=>[f,()=>m({editor:t})]));l={...l,...p}}const a=Dv(l);i.push(a);const c=K(r,"addInputRules",s);if(Bc(r,t.options.enableInputRules)&&c){const p=c();if(p&&p.length){const f=gk({editor:t,rules:p}),m=Array.isArray(f)?f:[f];i.push(...m)}}const u=K(r,"addPasteRules",s);if(Bc(r,t.options.enablePasteRules)&&u){const p=u();if(p&&p.length){const f=wk({editor:t,rules:p});i.push(...f)}}const h=K(r,"addProseMirrorPlugins",s);if(h){const p=h();i.push(...p)}return i})}get attributes(){return hh(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=xr(this.extensions);return Object.fromEntries(e.filter(n=>!!K(n,"addNodeView")).map(n=>{const r=this.attributes.filter(a=>a.type===n.name),s={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:Fe(n.name,this.schema)},i=K(n,"addNodeView",s);if(!i)return[];const o=i();if(!o)return[];const l=(a,c,u,h,p)=>{const f=ds(a,r);return o({node:a,view:c,getPos:u,decorations:h,innerDecorations:p,editor:t,extension:n,HTMLAttributes:f})};return[n.name,l]}))}dispatchTransaction(t){const{editor:e}=this;return Gr([...this.extensions].reverse()).reduceRight((r,s)=>{const i={name:s.name,options:s.options,storage:this.editor.extensionStorage[s.name],editor:e,type:jr(s.name,this.schema)},o=K(s,"dispatchTransaction",i);return o?l=>{o.call(i,{transaction:l,next:r})}:r},t)}transformPastedHTML(t){const{editor:e}=this;return Gr([...this.extensions]).reduce((r,s)=>{const i={name:s.name,options:s.options,storage:this.editor.extensionStorage[s.name],editor:e,type:jr(s.name,this.schema)},o=K(s,"transformPastedHTML",i);return o?(l,a)=>{const c=r(l,a);return o.call(i,c)}:r},t||(r=>r))}get markViews(){const{editor:t}=this,{markExtensions:e}=xr(this.extensions);return Object.fromEntries(e.filter(n=>!!K(n,"addMarkView")).map(n=>{const r=this.attributes.filter(l=>l.type===n.name),s={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:ln(n.name,this.schema)},i=K(n,"addMarkView",s);if(!i)return[];const o=(l,a,c)=>{const u=ds(l,r);return i()({mark:l,view:a,inline:c,editor:t,extension:n,HTMLAttributes:u,updateAttributes:h=>{Pk(l,t,h)}})};return[n.name,o]}))}destroy(){this.extensions.forEach(t=>{let e=t;for(;e.parent;){const n=e.parent;n.child===e&&(n.child=null),e=n}}),this.extensions=[],this.baseExtensions=[],this.schema=null,this.editor=null}setupExtensions(){const t=this.extensions;this.editor.extensionStorage=Object.fromEntries(t.map(e=>[e.name,e.storage])),t.forEach(e=>{var n;const r={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:jr(e.name,this.schema)};e.type==="mark"&&((n=me(K(e,"keepOnSplit",r)))==null||n)&&this.splittableMarks.push(e.name);const s=K(e,"onBeforeCreate",r),i=K(e,"onCreate",r),o=K(e,"onUpdate",r),l=K(e,"onSelectionUpdate",r),a=K(e,"onTransaction",r),c=K(e,"onFocus",r),u=K(e,"onBlur",r),h=K(e,"onDestroy",r);s&&this.editor.on("beforeCreate",s),i&&this.editor.on("create",i),o&&this.editor.on("update",o),l&&this.editor.on("selectionUpdate",l),a&&this.editor.on("transaction",a),c&&this.editor.on("focus",c),u&&this.editor.on("blur",u),h&&this.editor.on("destroy",h)})}};Xi.resolve=fh;Xi.sort=Gr;Xi.flatten=Gl;var Ck={};ql(Ck,{ClipboardTextSerializer:()=>Ch,Commands:()=>Sh,Delete:()=>Nh,Drop:()=>Ah,Editable:()=>Th,FocusEvents:()=>Mh,Keymap:()=>jh,Paste:()=>Ih,Tabindex:()=>Dh,TextDirection:()=>Oh,focusEventsPluginKey:()=>Eh});var Me=class wh extends Ql{constructor(){super(...arguments),this.type="extension"}static create(e={}){const n=typeof e=="function"?e():e;return new wh(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},Ch=Me.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Se({key:new Le("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:s}=e,{ranges:i}=s,o=Math.min(...i.map(u=>u.$from.pos)),l=Math.max(...i.map(u=>u.$to.pos)),a=mh(n);return ph(r,{from:o,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:a})}}})]}}),Sh=Me.create({name:"commands",addCommands(){return{...rh}}}),Nh=Me.create({name:"delete",onUpdate({transaction:t,appendedTransactions:e}){var n,r,s;const i=()=>{var o,l,a,c;if((c=(a=(l=(o=this.editor.options.coreExtensionOptions)==null?void 0:o.delete)==null?void 0:l.filterTransaction)==null?void 0:a.call(l,t))!=null?c:t.getMeta("y-sync$"))return;const u=dh(t.before,[t,...e]);bh(u).forEach(f=>{u.mapping.mapResult(f.oldRange.from).deletedAfter&&u.mapping.mapResult(f.oldRange.to).deletedBefore&&u.before.nodesBetween(f.oldRange.from,f.oldRange.to,(m,g)=>{const b=g+m.nodeSize-2,y=f.oldRange.from<=g&&b<=f.oldRange.to;this.editor.emit("delete",{type:"node",node:m,from:g,to:b,newFrom:u.mapping.map(g),newTo:u.mapping.map(b),deletedRange:f.oldRange,newRange:f.newRange,partial:!y,editor:this.editor,transaction:t,combinedTransform:u})})});const p=u.mapping;u.steps.forEach((f,m)=>{var g,b;if(f instanceof Rt){const y=p.slice(m).map(f.from,-1),v=p.slice(m).map(f.to),_=p.invert().map(y,-1),w=p.invert().map(v),k=y>0?(g=u.doc.nodeAt(y-1))==null?void 0:g.marks.some(S=>S.eq(f.mark)):!1,C=(b=u.doc.nodeAt(v))==null?void 0:b.marks.some(S=>S.eq(f.mark));this.editor.emit("delete",{type:"mark",mark:f.mark,from:f.from,to:f.to,deletedRange:{from:_,to:w},newRange:{from:y,to:v},partial:!!(C||k),editor:this.editor,transaction:t,combinedTransform:u})}})};(s=(r=(n=this.editor.options.coreExtensionOptions)==null?void 0:n.delete)==null?void 0:r.async)==null||s?setTimeout(i,0):i()}}),Ah=Me.create({name:"drop",addProseMirrorPlugins(){return[new Se({key:new Le("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),Th=Me.create({name:"editable",addProseMirrorPlugins(){return[new Se({key:new Le("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Eh=new Le("focusEvents"),Mh=Me.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new Se({key:Eh,props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),jh=Me.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:o})=>[()=>o.undoInputRule(),()=>o.command(({tr:l})=>{const{selection:a,doc:c}=l,{empty:u,$anchor:h}=a,{pos:p,parent:f}=h,m=h.parent.isTextblock&&p>0?l.doc.resolve(p-1):h,g=m.parent.type.spec.isolating,b=h.pos-h.parentOffset,y=g&&m.parent.childCount===1?b===h.pos:oe.atStart(c).from===p;return!u||!f.type.isTextblock||f.textContent.length||!y||y&&h.parent.type.name==="paragraph"?!1:o.clearNodes()}),()=>o.deleteSelection(),()=>o.joinBackward(),()=>o.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:o})=>[()=>o.deleteSelection(),()=>o.deleteCurrentNode(),()=>o.joinForward(),()=>o.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:o})=>[()=>o.newlineInCode(),()=>o.createParagraphNear(),()=>o.liftEmptyBlock(),()=>o.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},s={...r},i={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return li()||ah()?i:s},addProseMirrorPlugins(){return[new Se({key:new Le("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(g=>g.getMeta("composition")))return;const r=t.some(g=>g.docChanged)&&!e.doc.eq(n.doc),s=t.some(g=>g.getMeta("preventClearDocument"));if(!r||s)return;const{empty:i,from:o,to:l}=e.selection,a=oe.atStart(e.doc).from,c=oe.atEnd(e.doc).to;if(i||!(o===a&&l===c)||!us(n.doc))return;const p=n.tr,f=Ki({state:n,transaction:p}),{commands:m}=new Gi({editor:this.editor,state:f});if(m.clearNodes(),!!p.steps.length)return p}})]}}),Ih=Me.create({name:"paste",addProseMirrorPlugins(){return[new Se({key:new Le("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),Dh=Me.create({name:"tabindex",addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new Se({key:new Le("tabindex"),props:{attributes:()=>{var t;return!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:(t=this.options.value)!=null?t:"0"}}}})]}}),Oh=Me.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:t}=xr(this.extensions);return[{types:t.filter(e=>e.name!=="text").map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{const n=e.getAttribute("dir");return n&&(n==="ltr"||n==="rtl"||n==="auto")?n:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new Se({key:new Le("textDirection"),props:{attributes:()=>{const t=this.options.direction;return t?{dir:t}:{}}}})]}}),Sk=class Hr{constructor(e,n,r=!1,s=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=s}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!=null?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new Hr(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new Hr(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new Hr(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const s=n.isBlock&&!n.isTextblock,i=n.isAtom&&!n.isText,o=n.isInline,l=this.pos+r+(i?0:1);if(l<0||l>this.resolvedPos.doc.nodeSize-2)return;const a=this.resolvedPos.doc.resolve(l);if(!s&&!o&&a.depth<=this.depth)return;const c=new Hr(a,this.editor,s,s||o?n:null);s&&(c.actualDepth=this.depth+1),e.push(c)}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,s=this.parent;for(;s&&!r;){if(s.node.type.name===e)if(Object.keys(n).length>0){const i=s.node.attrs,o=Object.keys(n);for(let l=0;l<o.length;l+=1){const a=o[l];if(i[a]!==n[a])break}}else r=s;s=s.parent}return r}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},r=!1){let s=[];if(!this.children||this.children.length===0)return s;const i=Object.keys(n);return this.children.forEach(o=>{r&&s.length>0||(o.node.type.name===e&&i.every(a=>n[a]===o.node.attrs[a])&&s.push(o),!(r&&s.length>0)&&(s=s.concat(o.querySelectorAll(e,n,r))))}),s}setAttribute(e){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}},Nk=`.ProseMirror {
|
|
30
30
|
position: relative;
|
|
31
31
|
}
|
|
32
32
|
|
|
@@ -96,18 +96,18 @@ img.ProseMirror-separator {
|
|
|
96
96
|
|
|
97
97
|
.ProseMirror-focused .ProseMirror-gapcursor {
|
|
98
98
|
display: block;
|
|
99
|
-
}`;function
|
|
99
|
+
}`;function Ak(t,e,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const s=document.createElement("style");return e&&s.setAttribute("nonce",e),s.setAttribute("data-tiptap-style",""),s.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(s),s}var Tk=class extends pk{constructor(t={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:r})=>{throw r},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:V_,createMappablePosition:q_},this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:r,slice:s,moved:i})=>this.options.onDrop(r,s,i)),this.on("paste",({event:r,slice:s})=>this.options.onPaste(r,s)),this.on("delete",this.options.onDelete);const e=this.createDoc(),n=oh(e,this.options.autofocus);this.editorState=ur.create({doc:e,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(t){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(t),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const t=this.editorView.dom;t!=null&&t.editor&&delete t.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(t){console.warn("Failed to remove CSS element:",t)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=Ak(Nk,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,e=!0){this.setOptions({editable:t}),e&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:t=>{this.editorState=t},dispatch:t=>{this.dispatchTransaction(t)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(t,e)=>{if(this.editorView)return this.editorView[e];if(e==="state")return this.editorState;if(e in t)return Reflect.get(t,e);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${e}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(t,e){const n=uh(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(t){if(this.isDestroyed)return;const e=this.state.plugins;let n=e;if([].concat(t).forEach(s=>{const i=typeof s=="string"?`${s}$`:s.key;n=n.filter(o=>!o.key.startsWith(i))}),e.length===n.length)return;const r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var t,e,n,r;const i=[...this.options.enableCoreExtensions?[Th,Ch.configure({blockSeparator:(e=(t=this.options.coreExtensionOptions)==null?void 0:t.clipboardTextSerializer)==null?void 0:e.blockSeparator}),Sh,Mh,jh,Dh.configure({value:(r=(n=this.options.coreExtensionOptions)==null?void 0:n.tabindex)==null?void 0:r.value}),Ah,Ih,Nh,Oh.configure({direction:this.options.textDirection})].filter(o=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[o.name]!==!1:!0):[],...this.options.extensions].filter(o=>["extension","node","mark"].includes(o==null?void 0:o.type));this.extensionManager=new Xi(i,this)}createCommandManager(){this.commandManager=new Gi({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let t;try{t=cl(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(e.message))throw e;this.emit("contentError",{editor:this,error:e,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(n=>n.name!=="collaboration"),this.createExtensionManager()}}),t=cl(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return t}createView(t){const{editorProps:e,enableExtensionDispatchTransaction:n}=this.options,r=e.dispatchTransaction||this.dispatchTransaction.bind(this),s=n?this.extensionManager.dispatchTransaction(r):r,i=e.transformPastedHTML,o=this.extensionManager.transformPastedHTML(i);this.editorView=new th(t,{...e,attributes:{role:"textbox",...e==null?void 0:e.attributes},dispatchTransaction:s,transformPastedHTML:o,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const l=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(l),this.prependClass(),this.injectCSS();const a=this.view.dom;a.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(c=>{var u;return(u=this.capturedTransaction)==null?void 0:u.step(c)});return}const{state:e,transactions:n}=this.state.applyTransaction(t),r=!this.state.selection.eq(e.selection),s=n.includes(t),i=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:t,nextState:e}),!s)return;this.view.updateState(e),this.emit("transaction",{editor:this,transaction:t,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:t});const o=n.findLast(c=>c.getMeta("focus")||c.getMeta("blur")),l=o==null?void 0:o.getMeta("focus"),a=o==null?void 0:o.getMeta("blur");l&&this.emit("focus",{editor:this,event:l.event,transaction:o}),a&&this.emit("blur",{editor:this,event:a.event,transaction:o}),!(t.getMeta("preventUpdate")||!n.some(c=>c.docChanged)||i.doc.eq(e.doc))&&this.emit("update",{editor:this,transaction:t,appendedTransactions:n.slice(1)})}getAttributes(t){return gh(this.state,t)}isActive(t,e){const n=typeof t=="string"?t:null,r=typeof t=="string"?e:t;return F_(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Jl(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e=`
|
|
100
100
|
|
|
101
|
-
`,textSerializers:n={}}=t||{};return D_(this.state.doc,{blockSeparator:e,textSerializers:{...mh(this.schema),...n}})}get isEmpty(){return us(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit("destroy"),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){var t,e;return(e=(t=this.editorView)==null?void 0:t.isDestroyed)!=null?e:!0}$node(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelector(t,e))||null}$nodes(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelectorAll(t,e))||null}$pos(t){const e=this.state.doc.resolve(t),n=t>0&&e.nodeAfter&&!e.nodeAfter.isText?e.nodeAfter:null;return new wk(e,this,!1,n)}get $doc(){return this.$pos(0)}};function Zn(t){return new Qi({find:t.find,handler:({state:e,range:n,match:r})=>{const s=be(t.getAttributes,void 0,r);if(s===!1||s===null)return null;const{tr:i}=e,o=r[r.length-1],l=r[0];if(o){const a=l.search(/\S/),c=n.from+l.indexOf(o),u=c+o.length;if(Yl(n.from,n.to,e.doc).filter(f=>f.mark.type.excluded.find(g=>g===t.type&&g!==f.mark.type)).filter(f=>f.to>c).length)return null;u<n.to&&i.delete(u,n.to),c>n.from&&i.delete(n.from+a,c);const p=n.from+a+o.length;i.addMark(n.from+a,p,t.type.create(s||{})),i.removeStoredMark(t.type)}},undoable:t.undoable})}function Rh(t){return new Qi({find:t.find,handler:({state:e,range:n,match:r})=>{const s=be(t.getAttributes,void 0,r)||{},{tr:i}=e,o=n.from;let l=n.to;const a=t.type.create(s);if(r[1]){const c=r[0].lastIndexOf(r[1]);let u=o+c;u>l?u=l:l=u+r[1].length;const h=r[0][r[0].length-1];i.insertText(h,o+r[0].length-1),i.replaceWith(u,l,a)}else if(r[0]){const c=t.type.isInline?o:o-1;i.insert(c,t.type.create(s)).delete(i.mapping.map(o),i.mapping.map(l))}i.scrollIntoView()},undoable:t.undoable})}function ul(t){return new Qi({find:t.find,handler:({state:e,range:n,match:r})=>{const s=e.doc.resolve(n.from),i=be(t.getAttributes,void 0,r)||{};if(!s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,i)},undoable:t.undoable})}function vr(t){return new Qi({find:t.find,handler:({state:e,range:n,match:r,chain:s})=>{const i=be(t.getAttributes,void 0,r)||{},o=e.tr.delete(n.from,n.to),a=o.doc.resolve(n.from).blockRange(),c=a&&Ml(a,t.type,i);if(!c)return null;if(o.wrap(a,c),t.keepMarks&&t.editor){const{selection:h,storedMarks:p}=e,{splittableMarks:f}=t.editor.extensionManager,m=p||h.$to.parentOffset&&h.$from.marks();if(m){const g=m.filter(b=>f.includes(b.type.name));o.ensureMarks(g)}}if(t.keepAttributes){const h=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";s().updateAttributes(h,i).run()}const u=o.doc.resolve(n.from-1).nodeBefore;u&&u.type===t.type&&An(o.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,u))&&o.join(n.from-1)},undoable:t.undoable})}var Ak=t=>"touches"in t,Tk=class{constructor(t){this.directions=["bottom-left","bottom-right","top-left","top-right"],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:"",wrapper:"",handle:"",resizing:""},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.lastEditableState=void 0,this.handleMap=new Map,this.handleMouseMove=l=>{if(!this.isResizing||!this.activeHandle)return;const a=l.clientX-this.startX,c=l.clientY-this.startY;this.handleResize(a,c)},this.handleTouchMove=l=>{if(!this.isResizing||!this.activeHandle)return;const a=l.touches[0];if(!a)return;const c=a.clientX-this.startX,u=a.clientY-this.startY;this.handleResize(c,u)},this.handleMouseUp=()=>{if(!this.isResizing)return;const l=this.element.offsetWidth,a=this.element.offsetHeight;this.onCommit(l,a),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)},this.handleKeyDown=l=>{l.key==="Shift"&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=l=>{l.key==="Shift"&&(this.isShiftKeyPressed=!1)};var e,n,r,s,i,o;this.node=t.node,this.editor=t.editor,this.element=t.element,this.contentElement=t.contentElement,this.getPos=t.getPos,this.onResize=t.onResize,this.onCommit=t.onCommit,this.onUpdate=t.onUpdate,(e=t.options)!=null&&e.min&&(this.minSize={...this.minSize,...t.options.min}),(n=t.options)!=null&&n.max&&(this.maxSize=t.options.max),(r=t==null?void 0:t.options)!=null&&r.directions&&(this.directions=t.options.directions),(s=t.options)!=null&&s.preserveAspectRatio&&(this.preserveAspectRatio=t.options.preserveAspectRatio),(i=t.options)!=null&&i.className&&(this.classNames={container:t.options.className.container||"",wrapper:t.options.className.wrapper||"",handle:t.options.className.handle||"",resizing:t.options.className.resizing||""}),(o=t.options)!=null&&o.createCustomHandle&&(this.createCustomHandle=t.options.createCustomHandle),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles(),this.editor.on("update",this.handleEditorUpdate.bind(this))}get dom(){return this.container}get contentDOM(){var t;return(t=this.contentElement)!=null?t:null}handleEditorUpdate(){const t=this.editor.isEditable;t!==this.lastEditableState&&(this.lastEditableState=t,t?t&&this.handleMap.size===0&&this.attachHandles():this.removeHandles())}update(t,e,n){return t.type!==this.node.type?!1:(this.node=t,this.onUpdate?this.onUpdate(t,e,n):!0)}destroy(){this.isResizing&&(this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.editor.off("update",this.handleEditorUpdate.bind(this)),this.container.remove()}createContainer(){const t=document.createElement("div");return t.dataset.resizeContainer="",t.dataset.node=this.node.type.name,t.style.display=this.node.type.isInline?"inline-flex":"flex",this.classNames.container&&(t.className=this.classNames.container),t.appendChild(this.wrapper),t}createWrapper(){const t=document.createElement("div");return t.style.position="relative",t.style.display="block",t.dataset.resizeWrapper="",this.classNames.wrapper&&(t.className=this.classNames.wrapper),t.appendChild(this.element),t}createHandle(t){const e=document.createElement("div");return e.dataset.resizeHandle=t,e.style.position="absolute",this.classNames.handle&&(e.className=this.classNames.handle),e}positionHandle(t,e){const n=e.includes("top"),r=e.includes("bottom"),s=e.includes("left"),i=e.includes("right");n&&(t.style.top="0"),r&&(t.style.bottom="0"),s&&(t.style.left="0"),i&&(t.style.right="0"),(e==="top"||e==="bottom")&&(t.style.left="0",t.style.right="0"),(e==="left"||e==="right")&&(t.style.top="0",t.style.bottom="0")}attachHandles(){this.directions.forEach(t=>{let e;this.createCustomHandle?e=this.createCustomHandle(t):e=this.createHandle(t),e instanceof HTMLElement||(console.warn(`[ResizableNodeView] createCustomHandle("${t}") did not return an HTMLElement. Falling back to default handle.`),e=this.createHandle(t)),this.createCustomHandle||this.positionHandle(e,t),e.addEventListener("mousedown",n=>this.handleResizeStart(n,t)),e.addEventListener("touchstart",n=>this.handleResizeStart(n,t)),this.handleMap.set(t,e),this.wrapper.appendChild(e)})}removeHandles(){this.handleMap.forEach(t=>t.remove()),this.handleMap.clear()}applyInitialSize(){const t=this.node.attrs.width,e=this.node.attrs.height;t?(this.element.style.width=`${t}px`,this.initialWidth=t):this.initialWidth=this.element.offsetWidth,e?(this.element.style.height=`${e}px`,this.initialHeight=e):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(t,e){t.preventDefault(),t.stopPropagation(),this.isResizing=!0,this.activeHandle=e,Ak(t)?(this.startX=t.touches[0].clientX,this.startY=t.touches[0].clientY):(this.startX=t.clientX,this.startY=t.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight),this.getPos(),this.container.dataset.resizeState="true",this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("touchmove",this.handleTouchMove),document.addEventListener("mouseup",this.handleMouseUp),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}handleResize(t,e){if(!this.activeHandle)return;const n=this.preserveAspectRatio||this.isShiftKeyPressed,{width:r,height:s}=this.calculateNewDimensions(this.activeHandle,t,e),i=this.applyConstraints(r,s,n);this.element.style.width=`${i.width}px`,this.element.style.height=`${i.height}px`,this.onResize&&this.onResize(i.width,i.height)}calculateNewDimensions(t,e,n){let r=this.startWidth,s=this.startHeight;const i=t.includes("right"),o=t.includes("left"),l=t.includes("bottom"),a=t.includes("top");return i?r=this.startWidth+e:o&&(r=this.startWidth-e),l?s=this.startHeight+n:a&&(s=this.startHeight-n),(t==="right"||t==="left")&&(r=this.startWidth+(i?e:-e)),(t==="top"||t==="bottom")&&(s=this.startHeight+(l?n:-n)),this.preserveAspectRatio||this.isShiftKeyPressed?this.applyAspectRatio(r,s,t):{width:r,height:s}}applyConstraints(t,e,n){var r,s,i,o;if(!n){let c=Math.max(this.minSize.width,t),u=Math.max(this.minSize.height,e);return(r=this.maxSize)!=null&&r.width&&(c=Math.min(this.maxSize.width,c)),(s=this.maxSize)!=null&&s.height&&(u=Math.min(this.maxSize.height,u)),{width:c,height:u}}let l=t,a=e;return l<this.minSize.width&&(l=this.minSize.width,a=l/this.aspectRatio),a<this.minSize.height&&(a=this.minSize.height,l=a*this.aspectRatio),(i=this.maxSize)!=null&&i.width&&l>this.maxSize.width&&(l=this.maxSize.width,a=l/this.aspectRatio),(o=this.maxSize)!=null&&o.height&&a>this.maxSize.height&&(a=this.maxSize.height,l=a*this.aspectRatio),{width:l,height:a}}applyAspectRatio(t,e,n){const r=n==="left"||n==="right",s=n==="top"||n==="bottom";return r?{width:t,height:t/this.aspectRatio}:s?{width:e*this.aspectRatio,height:e}:{width:t,height:t/this.aspectRatio}}};function Ek(t,e){const{selection:n}=t,{$from:r}=n;if(n instanceof J){const i=r.index();return r.parent.canReplaceWith(i,i+1,e)}let s=r.depth;for(;s>=0;){const i=r.index(s);if(r.node(s).contentMatchAt(i).matchType(e))return!0;s-=1}return!1}function Mk(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function jk(t,e){const n=t.getAttribute("style");if(!n)return null;const r=n.split(";").map(i=>i.trim()).filter(Boolean),s=e.toLowerCase();for(let i=r.length-1;i>=0;i-=1){const o=r[i],l=o.indexOf(":");if(l===-1)continue;if(o.slice(0,l).trim().toLowerCase()===s)return o.slice(l+1).trim()}return null}var Ik={};ql(Ik,{createAtomBlockMarkdownSpec:()=>Dk,createBlockMarkdownSpec:()=>Ok,createInlineMarkdownSpec:()=>Lh,parseAttributes:()=>Xl,parseIndentedBlocks:()=>hl,renderNestedMarkdownContent:()=>ea,serializeAttributes:()=>Zl});function Xl(t){if(!(t!=null&&t.trim()))return{};const e={},n=[],r=t.replace(/["']([^"']*)["']/g,c=>(n.push(c),`__QUOTED_${n.length-1}__`)),s=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(s){const c=s.map(u=>u.trim().slice(1));e.class=c.join(" ")}const i=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);i&&(e.id=i[1]);const o=/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g;Array.from(r.matchAll(o)).forEach(([,c,u])=>{var h;const p=parseInt(((h=u.match(/__QUOTED_(\d+)__/))==null?void 0:h[1])||"0",10),f=n[p];f&&(e[c]=f.slice(1,-1))});const a=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return a&&a.split(/\s+/).filter(Boolean).forEach(u=>{u.match(/^[a-zA-Z][\w-]*$/)&&(e[u]=!0)}),e}function Zl(t){if(!t||Object.keys(t).length===0)return"";const e=[];return t.class&&String(t.class).split(/\s+/).filter(Boolean).forEach(r=>e.push(`.${r}`)),t.id&&e.push(`#${t.id}`),Object.entries(t).forEach(([n,r])=>{n==="class"||n==="id"||(r===!0?e.push(n):r!==!1&&r!=null&&e.push(`${n}="${String(r)}"`))}),e.join(" ")}function Dk(t){const{nodeName:e,name:n,parseAttributes:r=Xl,serializeAttributes:s=Zl,defaultAttributes:i={},requiredAttributes:o=[],allowedAttributes:l}=t,a=n||e,c=u=>{if(!l)return u;const h={};return l.forEach(p=>{p in u&&(h[p]=u[p])}),h};return{parseMarkdown:(u,h)=>{const p={...i,...u.attributes};return h.createNode(e,p,[])},markdownTokenizer:{name:e,level:"block",start(u){var h;const p=new RegExp(`^:::${a}(?:\\s|$)`,"m"),f=(h=u.match(p))==null?void 0:h.index;return f!==void 0?f:-1},tokenize(u,h,p){const f=new RegExp(`^:::${a}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),m=u.match(f);if(!m)return;const g=m[1]||"",b=r(g);if(!o.find(v=>!(v in b)))return{type:e,raw:m[0],attributes:b}}},renderMarkdown:u=>{const h=c(u.attrs||{}),p=s(h),f=p?` {${p}}`:"";return`:::${a}${f} :::`}}}function Ok(t){const{nodeName:e,name:n,getContent:r,parseAttributes:s=Xl,serializeAttributes:i=Zl,defaultAttributes:o={},content:l="block",allowedAttributes:a}=t,c=n||e,u=h=>{if(!a)return h;const p={};return a.forEach(f=>{f in h&&(p[f]=h[f])}),p};return{parseMarkdown:(h,p)=>{let f;if(r){const g=r(h);f=typeof g=="string"?[{type:"text",text:g}]:g}else l==="block"?f=p.parseChildren(h.tokens||[]):f=p.parseInline(h.tokens||[]);const m={...o,...h.attributes};return p.createNode(e,m,f)},markdownTokenizer:{name:e,level:"block",start(h){var p;const f=new RegExp(`^:::${c}`,"m"),m=(p=h.match(f))==null?void 0:p.index;return m!==void 0?m:-1},tokenize(h,p,f){var m;const g=new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),b=h.match(g);if(!b)return;const[y,v=""]=b,_=s(v);let w=1;const k=y.length;let C="";const N=/^:::([\w-]*)(\s.*)?/gm,O=h.slice(k);for(N.lastIndex=0;;){const B=N.exec(O);if(B===null)break;const S=B.index,T=B[1];if(!((m=B[2])!=null&&m.endsWith(":::"))){if(T)w+=1;else if(w-=1,w===0){const P=O.slice(0,S);C=P.trim();const L=h.slice(0,k+S+B[0].length);let R=[];if(C)if(l==="block")for(R=f.blockTokens(P),R.forEach(H=>{H.text&&(!H.tokens||H.tokens.length===0)&&(H.tokens=f.inlineTokens(H.text))});R.length>0;){const H=R[R.length-1];if(H.type==="paragraph"&&(!H.text||H.text.trim()===""))R.pop();else break}else R=f.inlineTokens(C);return{type:e,raw:L,attributes:_,content:C,tokens:R}}}}}},renderMarkdown:(h,p)=>{const f=u(h.attrs||{}),m=i(f),g=m?` {${m}}`:"",b=p.renderChildren(h.content||[],`
|
|
101
|
+
`,textSerializers:n={}}=t||{};return R_(this.state.doc,{blockSeparator:e,textSerializers:{...mh(this.schema),...n}})}get isEmpty(){return us(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit("destroy"),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){var t,e;return(e=(t=this.editorView)==null?void 0:t.isDestroyed)!=null?e:!0}$node(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelector(t,e))||null}$nodes(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelectorAll(t,e))||null}$pos(t){const e=this.state.doc.resolve(t),n=t>0&&e.nodeAfter&&!e.nodeAfter.isText?e.nodeAfter:null;return new Sk(e,this,!1,n)}get $doc(){return this.$pos(0)}};function Zn(t){return new Qi({find:t.find,handler:({state:e,range:n,match:r})=>{const s=me(t.getAttributes,void 0,r);if(s===!1||s===null)return null;const{tr:i}=e,o=r[r.length-1],l=r[0];if(o){const a=l.search(/\S/),c=n.from+l.indexOf(o),u=c+o.length;if(Yl(n.from,n.to,e.doc).filter(f=>f.mark.type.excluded.find(g=>g===t.type&&g!==f.mark.type)).filter(f=>f.to>c).length)return null;u<n.to&&i.delete(u,n.to),c>n.from&&i.delete(n.from+a,c);const p=n.from+a+o.length;i.addMark(n.from+a,p,t.type.create(s||{})),i.removeStoredMark(t.type)}},undoable:t.undoable})}function Rh(t){return new Qi({find:t.find,handler:({state:e,range:n,match:r})=>{const s=me(t.getAttributes,void 0,r)||{},{tr:i}=e,o=n.from;let l=n.to;const a=t.type.create(s);if(r[1]){const c=r[0].lastIndexOf(r[1]);let u=o+c;u>l?u=l:l=u+r[1].length;const h=r[0][r[0].length-1];i.insertText(h,o+r[0].length-1),i.replaceWith(u,l,a)}else if(r[0]){const c=t.type.isInline?o:o-1;i.insert(c,t.type.create(s)).delete(i.mapping.map(o),i.mapping.map(l))}i.scrollIntoView()},undoable:t.undoable})}function ul(t){return new Qi({find:t.find,handler:({state:e,range:n,match:r})=>{const s=e.doc.resolve(n.from),i=me(t.getAttributes,void 0,r)||{};if(!s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,i)},undoable:t.undoable})}function vr(t){return new Qi({find:t.find,handler:({state:e,range:n,match:r,chain:s})=>{const i=me(t.getAttributes,void 0,r)||{},o=e.tr.delete(n.from,n.to),a=o.doc.resolve(n.from).blockRange(),c=a&&Ml(a,t.type,i);if(!c)return null;if(o.wrap(a,c),t.keepMarks&&t.editor){const{selection:h,storedMarks:p}=e,{splittableMarks:f}=t.editor.extensionManager,m=p||h.$to.parentOffset&&h.$from.marks();if(m){const g=m.filter(b=>f.includes(b.type.name));o.ensureMarks(g)}}if(t.keepAttributes){const h=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";s().updateAttributes(h,i).run()}const u=o.doc.resolve(n.from-1).nodeBefore;u&&u.type===t.type&&An(o.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,u))&&o.join(n.from-1)},undoable:t.undoable})}var Ek=t=>"touches"in t,Mk=class{constructor(t){this.directions=["bottom-left","bottom-right","top-left","top-right"],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:"",wrapper:"",handle:"",resizing:""},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.lastEditableState=void 0,this.handleMap=new Map,this.handleMouseMove=l=>{if(!this.isResizing||!this.activeHandle)return;const a=l.clientX-this.startX,c=l.clientY-this.startY;this.handleResize(a,c)},this.handleTouchMove=l=>{if(!this.isResizing||!this.activeHandle)return;const a=l.touches[0];if(!a)return;const c=a.clientX-this.startX,u=a.clientY-this.startY;this.handleResize(c,u)},this.handleMouseUp=()=>{if(!this.isResizing)return;const l=this.element.offsetWidth,a=this.element.offsetHeight;this.onCommit(l,a),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)},this.handleKeyDown=l=>{l.key==="Shift"&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=l=>{l.key==="Shift"&&(this.isShiftKeyPressed=!1)};var e,n,r,s,i,o;this.node=t.node,this.editor=t.editor,this.element=t.element,this.contentElement=t.contentElement,this.getPos=t.getPos,this.onResize=t.onResize,this.onCommit=t.onCommit,this.onUpdate=t.onUpdate,(e=t.options)!=null&&e.min&&(this.minSize={...this.minSize,...t.options.min}),(n=t.options)!=null&&n.max&&(this.maxSize=t.options.max),(r=t==null?void 0:t.options)!=null&&r.directions&&(this.directions=t.options.directions),(s=t.options)!=null&&s.preserveAspectRatio&&(this.preserveAspectRatio=t.options.preserveAspectRatio),(i=t.options)!=null&&i.className&&(this.classNames={container:t.options.className.container||"",wrapper:t.options.className.wrapper||"",handle:t.options.className.handle||"",resizing:t.options.className.resizing||""}),(o=t.options)!=null&&o.createCustomHandle&&(this.createCustomHandle=t.options.createCustomHandle),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles(),this.editor.on("update",this.handleEditorUpdate.bind(this))}get dom(){return this.container}get contentDOM(){var t;return(t=this.contentElement)!=null?t:null}handleEditorUpdate(){const t=this.editor.isEditable;t!==this.lastEditableState&&(this.lastEditableState=t,t?t&&this.handleMap.size===0&&this.attachHandles():this.removeHandles())}update(t,e,n){return t.type!==this.node.type?!1:(this.node=t,this.onUpdate?this.onUpdate(t,e,n):!0)}destroy(){this.isResizing&&(this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.editor.off("update",this.handleEditorUpdate.bind(this)),this.container.remove()}createContainer(){const t=document.createElement("div");return t.dataset.resizeContainer="",t.dataset.node=this.node.type.name,t.style.display=this.node.type.isInline?"inline-flex":"flex",this.classNames.container&&(t.className=this.classNames.container),t.appendChild(this.wrapper),t}createWrapper(){const t=document.createElement("div");return t.style.position="relative",t.style.display="block",t.dataset.resizeWrapper="",this.classNames.wrapper&&(t.className=this.classNames.wrapper),t.appendChild(this.element),t}createHandle(t){const e=document.createElement("div");return e.dataset.resizeHandle=t,e.style.position="absolute",this.classNames.handle&&(e.className=this.classNames.handle),e}positionHandle(t,e){const n=e.includes("top"),r=e.includes("bottom"),s=e.includes("left"),i=e.includes("right");n&&(t.style.top="0"),r&&(t.style.bottom="0"),s&&(t.style.left="0"),i&&(t.style.right="0"),(e==="top"||e==="bottom")&&(t.style.left="0",t.style.right="0"),(e==="left"||e==="right")&&(t.style.top="0",t.style.bottom="0")}attachHandles(){this.directions.forEach(t=>{let e;this.createCustomHandle?e=this.createCustomHandle(t):e=this.createHandle(t),e instanceof HTMLElement||(console.warn(`[ResizableNodeView] createCustomHandle("${t}") did not return an HTMLElement. Falling back to default handle.`),e=this.createHandle(t)),this.createCustomHandle||this.positionHandle(e,t),e.addEventListener("mousedown",n=>this.handleResizeStart(n,t)),e.addEventListener("touchstart",n=>this.handleResizeStart(n,t)),this.handleMap.set(t,e),this.wrapper.appendChild(e)})}removeHandles(){this.handleMap.forEach(t=>t.remove()),this.handleMap.clear()}applyInitialSize(){const t=this.node.attrs.width,e=this.node.attrs.height;t?(this.element.style.width=`${t}px`,this.initialWidth=t):this.initialWidth=this.element.offsetWidth,e?(this.element.style.height=`${e}px`,this.initialHeight=e):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(t,e){t.preventDefault(),t.stopPropagation(),this.isResizing=!0,this.activeHandle=e,Ek(t)?(this.startX=t.touches[0].clientX,this.startY=t.touches[0].clientY):(this.startX=t.clientX,this.startY=t.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight),this.getPos(),this.container.dataset.resizeState="true",this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("touchmove",this.handleTouchMove),document.addEventListener("mouseup",this.handleMouseUp),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}handleResize(t,e){if(!this.activeHandle)return;const n=this.preserveAspectRatio||this.isShiftKeyPressed,{width:r,height:s}=this.calculateNewDimensions(this.activeHandle,t,e),i=this.applyConstraints(r,s,n);this.element.style.width=`${i.width}px`,this.element.style.height=`${i.height}px`,this.onResize&&this.onResize(i.width,i.height)}calculateNewDimensions(t,e,n){let r=this.startWidth,s=this.startHeight;const i=t.includes("right"),o=t.includes("left"),l=t.includes("bottom"),a=t.includes("top");return i?r=this.startWidth+e:o&&(r=this.startWidth-e),l?s=this.startHeight+n:a&&(s=this.startHeight-n),(t==="right"||t==="left")&&(r=this.startWidth+(i?e:-e)),(t==="top"||t==="bottom")&&(s=this.startHeight+(l?n:-n)),this.preserveAspectRatio||this.isShiftKeyPressed?this.applyAspectRatio(r,s,t):{width:r,height:s}}applyConstraints(t,e,n){var r,s,i,o;if(!n){let c=Math.max(this.minSize.width,t),u=Math.max(this.minSize.height,e);return(r=this.maxSize)!=null&&r.width&&(c=Math.min(this.maxSize.width,c)),(s=this.maxSize)!=null&&s.height&&(u=Math.min(this.maxSize.height,u)),{width:c,height:u}}let l=t,a=e;return l<this.minSize.width&&(l=this.minSize.width,a=l/this.aspectRatio),a<this.minSize.height&&(a=this.minSize.height,l=a*this.aspectRatio),(i=this.maxSize)!=null&&i.width&&l>this.maxSize.width&&(l=this.maxSize.width,a=l/this.aspectRatio),(o=this.maxSize)!=null&&o.height&&a>this.maxSize.height&&(a=this.maxSize.height,l=a*this.aspectRatio),{width:l,height:a}}applyAspectRatio(t,e,n){const r=n==="left"||n==="right",s=n==="top"||n==="bottom";return r?{width:t,height:t/this.aspectRatio}:s?{width:e*this.aspectRatio,height:e}:{width:t,height:t/this.aspectRatio}}};function jk(t,e){const{selection:n}=t,{$from:r}=n;if(n instanceof J){const i=r.index();return r.parent.canReplaceWith(i,i+1,e)}let s=r.depth;for(;s>=0;){const i=r.index(s);if(r.node(s).contentMatchAt(i).matchType(e))return!0;s-=1}return!1}function Ik(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function Dk(t,e){const n=t.getAttribute("style");if(!n)return null;const r=n.split(";").map(i=>i.trim()).filter(Boolean),s=e.toLowerCase();for(let i=r.length-1;i>=0;i-=1){const o=r[i],l=o.indexOf(":");if(l===-1)continue;if(o.slice(0,l).trim().toLowerCase()===s)return o.slice(l+1).trim()}return null}var Ok={};ql(Ok,{createAtomBlockMarkdownSpec:()=>Rk,createBlockMarkdownSpec:()=>Lk,createInlineMarkdownSpec:()=>Lh,parseAttributes:()=>Xl,parseIndentedBlocks:()=>hl,renderNestedMarkdownContent:()=>ea,serializeAttributes:()=>Zl});function Xl(t){if(!(t!=null&&t.trim()))return{};const e={},n=[],r=t.replace(/["']([^"']*)["']/g,c=>(n.push(c),`__QUOTED_${n.length-1}__`)),s=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(s){const c=s.map(u=>u.trim().slice(1));e.class=c.join(" ")}const i=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);i&&(e.id=i[1]);const o=/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g;Array.from(r.matchAll(o)).forEach(([,c,u])=>{var h;const p=parseInt(((h=u.match(/__QUOTED_(\d+)__/))==null?void 0:h[1])||"0",10),f=n[p];f&&(e[c]=f.slice(1,-1))});const a=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return a&&a.split(/\s+/).filter(Boolean).forEach(u=>{u.match(/^[a-zA-Z][\w-]*$/)&&(e[u]=!0)}),e}function Zl(t){if(!t||Object.keys(t).length===0)return"";const e=[];return t.class&&String(t.class).split(/\s+/).filter(Boolean).forEach(r=>e.push(`.${r}`)),t.id&&e.push(`#${t.id}`),Object.entries(t).forEach(([n,r])=>{n==="class"||n==="id"||(r===!0?e.push(n):r!==!1&&r!=null&&e.push(`${n}="${String(r)}"`))}),e.join(" ")}function Rk(t){const{nodeName:e,name:n,parseAttributes:r=Xl,serializeAttributes:s=Zl,defaultAttributes:i={},requiredAttributes:o=[],allowedAttributes:l}=t,a=n||e,c=u=>{if(!l)return u;const h={};return l.forEach(p=>{p in u&&(h[p]=u[p])}),h};return{parseMarkdown:(u,h)=>{const p={...i,...u.attributes};return h.createNode(e,p,[])},markdownTokenizer:{name:e,level:"block",start(u){var h;const p=new RegExp(`^:::${a}(?:\\s|$)`,"m"),f=(h=u.match(p))==null?void 0:h.index;return f!==void 0?f:-1},tokenize(u,h,p){const f=new RegExp(`^:::${a}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),m=u.match(f);if(!m)return;const g=m[1]||"",b=r(g);if(!o.find(v=>!(v in b)))return{type:e,raw:m[0],attributes:b}}},renderMarkdown:u=>{const h=c(u.attrs||{}),p=s(h),f=p?` {${p}}`:"";return`:::${a}${f} :::`}}}function Lk(t){const{nodeName:e,name:n,getContent:r,parseAttributes:s=Xl,serializeAttributes:i=Zl,defaultAttributes:o={},content:l="block",allowedAttributes:a}=t,c=n||e,u=h=>{if(!a)return h;const p={};return a.forEach(f=>{f in h&&(p[f]=h[f])}),p};return{parseMarkdown:(h,p)=>{let f;if(r){const g=r(h);f=typeof g=="string"?[{type:"text",text:g}]:g}else l==="block"?f=p.parseChildren(h.tokens||[]):f=p.parseInline(h.tokens||[]);const m={...o,...h.attributes};return p.createNode(e,m,f)},markdownTokenizer:{name:e,level:"block",start(h){var p;const f=new RegExp(`^:::${c}`,"m"),m=(p=h.match(f))==null?void 0:p.index;return m!==void 0?m:-1},tokenize(h,p,f){var m;const g=new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),b=h.match(g);if(!b)return;const[y,v=""]=b,_=s(v);let w=1;const k=y.length;let C="";const S=/^:::([\w-]*)(\s.*)?/gm,O=h.slice(k);for(S.lastIndex=0;;){const B=S.exec(O);if(B===null)break;const N=B.index,T=B[1];if(!((m=B[2])!=null&&m.endsWith(":::"))){if(T)w+=1;else if(w-=1,w===0){const P=O.slice(0,N);C=P.trim();const L=h.slice(0,k+N+B[0].length);let R=[];if(C)if(l==="block")for(R=f.blockTokens(P),R.forEach(H=>{H.text&&(!H.tokens||H.tokens.length===0)&&(H.tokens=f.inlineTokens(H.text))});R.length>0;){const H=R[R.length-1];if(H.type==="paragraph"&&(!H.text||H.text.trim()===""))R.pop();else break}else R=f.inlineTokens(C);return{type:e,raw:L,attributes:_,content:C,tokens:R}}}}}},renderMarkdown:(h,p)=>{const f=u(h.attrs||{}),m=i(f),g=m?` {${m}}`:"",b=p.renderChildren(h.content||[],`
|
|
102
102
|
|
|
103
103
|
`);return`:::${c}${g}
|
|
104
104
|
|
|
105
105
|
${b}
|
|
106
106
|
|
|
107
|
-
:::`}}}function
|
|
107
|
+
:::`}}}function Bk(t){if(!t.trim())return{};const e={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=n.exec(t);for(;r!==null;){const[,s,i,o]=r;e[s]=i||o,r=n.exec(t)}return e}function $k(t){return Object.entries(t).filter(([,e])=>e!=null).map(([e,n])=>`${e}="${n}"`).join(" ")}function Lh(t){const{nodeName:e,name:n,getContent:r,parseAttributes:s=Bk,serializeAttributes:i=$k,defaultAttributes:o={},selfClosing:l=!1,allowedAttributes:a}=t,c=n||e,u=p=>{if(!a)return p;const f={};return a.forEach(m=>{const g=typeof m=="string"?m:m.name,b=typeof m=="string"?void 0:m.skipIfDefault;if(g in p){const y=p[g];if(b!==void 0&&y===b)return;f[g]=y}}),f},h=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(p,f)=>{const m={...o,...p.attributes};if(l)return f.createNode(e,m);const g=r?r(p):p.content||"";return g?f.createNode(e,m,[f.createTextNode(g)]):f.createNode(e,m,[])},markdownTokenizer:{name:e,level:"inline",start(p){const f=l?new RegExp(`\\[${h}\\s*[^\\]]*\\]`):new RegExp(`\\[${h}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${h}\\]`),m=p.match(f),g=m==null?void 0:m.index;return g!==void 0?g:-1},tokenize(p,f,m){const g=l?new RegExp(`^\\[${h}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${h}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${h}\\]`),b=p.match(g);if(!b)return;let y="",v="";if(l){const[,w]=b;v=w}else{const[,w,k]=b;v=w,y=k||""}const _=s(v.trim());return{type:e,raw:b[0],content:y.trim(),attributes:_}}},renderMarkdown:p=>{let f="";r?f=r(p):p.content&&p.content.length>0&&(f=p.content.filter(y=>y.type==="text").map(y=>y.text).join(""));const m=u(p.attrs||{}),g=i(m),b=g?` ${g}`:"";return l?`[${c}${b}]`:`[${c}${b}]${f}[/${c}]`}}}function hl(t,e,n){var r,s,i,o;const l=t.split(`
|
|
108
108
|
`),a=[];let c="",u=0;const h=e.baseIndentSize||2;for(;u<l.length;){const p=l[u],f=p.match(e.itemPattern);if(!f){if(a.length>0)break;if(p.trim()===""){u+=1,c=`${c}${p}
|
|
109
109
|
`;continue}else return}const m=e.extractItemData(f),{indentLevel:g,mainContent:b}=m;c=`${c}${p}
|
|
110
|
-
`;const y=[b];for(u+=1;u<l.length;){const k=l[u];if(k.trim()===""){const
|
|
110
|
+
`;const y=[b];for(u+=1;u<l.length;){const k=l[u];if(k.trim()===""){const S=l.slice(u+1).findIndex(N=>N.trim()!=="");if(S===-1)break;if((((s=(r=l[u+1+S].match(/^(\s*)/))==null?void 0:r[1])==null?void 0:s.length)||0)>g){y.push(k),c=`${c}${k}
|
|
111
111
|
`,u+=1;continue}else break}if((((o=(i=k.match(/^(\s*)/))==null?void 0:i[1])==null?void 0:o.length)||0)>g)y.push(k),c=`${c}${k}
|
|
112
112
|
`,u+=1;else break}let v;const _=y.slice(1);if(_.length>0){const k=_.map(C=>C.slice(g+h)).join(`
|
|
113
113
|
`);k.trim()&&(e.customNestedParser?v=e.customNestedParser(k):v=n.blockTokens(k))}const w=e.createToken(m,v);a.push(w)}if(a.length!==0)return{items:a,raw:c}}function ea(t,e,n,r){if(!t||!Array.isArray(t.content))return"";const s=typeof n=="function"?n(r):n,[i,...o]=t.content,l=e.renderChildren([i]);let a=`${s}${l}`;return o&&o.length>0&&o.forEach((c,u)=>{var h,p;const f=(p=(h=e.renderChild)==null?void 0:h.call(e,c,u+1))!=null?p:e.renderChildren([c]);if(f!=null){const m=f.split(`
|
|
@@ -115,7 +115,7 @@ ${b}
|
|
|
115
115
|
`);a+=c.type==="paragraph"?`
|
|
116
116
|
|
|
117
117
|
${m}`:`
|
|
118
|
-
${m}`}}),a}function
|
|
118
|
+
${m}`}}),a}function Pk(t,e,n={}){const{state:r}=e,{doc:s,tr:i}=r,o=t;s.descendants((l,a)=>{const c=i.mapping.map(a),u=i.mapping.map(a)+l.nodeSize;let h=null;if(l.marks.forEach(f=>{if(f!==o)return!1;h=f}),!h)return;let p=!1;if(Object.keys(n).forEach(f=>{n[f]!==h.attrs[f]&&(p=!0)}),p){const f=t.type.create({...t.attrs,...n});i.removeMark(c,u,t.type),i.addMark(c,u,f)}}),i.docChanged&&e.view.dispatch(i)}var lt=class Bh extends Ql{constructor(){super(...arguments),this.type="node"}static create(e={}){const n=typeof e=="function"?e():e;return new Bh(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}};function Nn(t){return new xk({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:s})=>{const i=me(t.getAttributes,void 0,r,s);if(i===!1||i===null)return null;const{tr:o}=e,l=r[r.length-1],a=r[0];let c=n.to;if(l){const u=a.search(/\S/),h=n.from+a.indexOf(l),p=h+l.length;if(Yl(n.from,n.to,e.doc).filter(g=>g.mark.type.excluded.find(y=>y===t.type&&y!==g.mark.type)).filter(g=>g.to>h).length)return null;p<n.to&&o.delete(p,n.to),h>n.from&&o.delete(n.from+u,h),c=n.from+u+l.length,o.addMark(n.from+u,c,t.type.create(i||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||o.removeStoredMark(t.type)}}})}const{getOwnPropertyNames:zk,getOwnPropertySymbols:Fk}=Object,{hasOwnProperty:Hk}=Object.prototype;function Eo(t,e){return function(r,s,i){return t(r,s,i)&&e(r,s,i)}}function Rs(t){return function(n,r,s){if(!n||!r||typeof n!="object"||typeof r!="object")return t(n,r,s);const{cache:i}=s,o=i.get(n),l=i.get(r);if(o&&l)return o===r&&l===n;i.set(n,r),i.set(r,n);const a=t(n,r,s);return i.delete(n),i.delete(r),a}}function Wk(t){return t!=null?t[Symbol.toStringTag]:void 0}function Pc(t){return zk(t).concat(Fk(t))}const Vk=Object.hasOwn||((t,e)=>Hk.call(t,e));function nr(t,e){return t===e||!t&&!e&&t!==t&&e!==e}const qk="__v",Uk="__o",Kk="_owner",{getOwnPropertyDescriptor:zc,keys:Fc}=Object;function Gk(t,e){return t.byteLength===e.byteLength&&ai(new Uint8Array(t),new Uint8Array(e))}function Jk(t,e,n){let r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function Yk(t,e){return t.byteLength===e.byteLength&&ai(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function Qk(t,e){return nr(t.getTime(),e.getTime())}function Xk(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function Zk(t,e){return t===e}function Hc(t,e,n){const r=t.size;if(r!==e.size)return!1;if(!r)return!0;const s=new Array(r),i=t.entries();let o,l,a=0;for(;(o=i.next())&&!o.done;){const c=e.entries();let u=!1,h=0;for(;(l=c.next())&&!l.done;){if(s[h]){h++;continue}const p=o.value,f=l.value;if(n.equals(p[0],f[0],a,h,t,e,n)&&n.equals(p[1],f[1],p[0],f[0],t,e,n)){u=s[h]=!0;break}h++}if(!u)return!1;a++}return!0}const ew=nr;function tw(t,e,n){const r=Fc(t);let s=r.length;if(Fc(e).length!==s)return!1;for(;s-- >0;)if(!$h(t,e,n,r[s]))return!1;return!0}function Ir(t,e,n){const r=Pc(t);let s=r.length;if(Pc(e).length!==s)return!1;let i,o,l;for(;s-- >0;)if(i=r[s],!$h(t,e,n,i)||(o=zc(t,i),l=zc(e,i),(o||l)&&(!o||!l||o.configurable!==l.configurable||o.enumerable!==l.enumerable||o.writable!==l.writable)))return!1;return!0}function nw(t,e){return nr(t.valueOf(),e.valueOf())}function rw(t,e){return t.source===e.source&&t.flags===e.flags}function Wc(t,e,n){const r=t.size;if(r!==e.size)return!1;if(!r)return!0;const s=new Array(r),i=t.values();let o,l;for(;(o=i.next())&&!o.done;){const a=e.values();let c=!1,u=0;for(;(l=a.next())&&!l.done;){if(!s[u]&&n.equals(o.value,l.value,o.value,l.value,t,e,n)){c=s[u]=!0;break}u++}if(!c)return!1}return!0}function ai(t,e){let n=t.byteLength;if(e.byteLength!==n||t.byteOffset!==e.byteOffset)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}function sw(t,e){return t.hostname===e.hostname&&t.pathname===e.pathname&&t.protocol===e.protocol&&t.port===e.port&&t.hash===e.hash&&t.username===e.username&&t.password===e.password}function $h(t,e,n,r){return(r===Kk||r===Uk||r===qk)&&(t.$$typeof||e.$$typeof)?!0:Vk(e,r)&&n.equals(t[r],e[r],r,r,t,e,n)}const iw="[object ArrayBuffer]",ow="[object Arguments]",lw="[object Boolean]",aw="[object DataView]",cw="[object Date]",dw="[object Error]",uw="[object Map]",hw="[object Number]",fw="[object Object]",pw="[object RegExp]",mw="[object Set]",gw="[object String]",bw={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},yw="[object URL]",xw=Object.prototype.toString;function vw({areArrayBuffersEqual:t,areArraysEqual:e,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:s,areFunctionsEqual:i,areMapsEqual:o,areNumbersEqual:l,areObjectsEqual:a,arePrimitiveWrappersEqual:c,areRegExpsEqual:u,areSetsEqual:h,areTypedArraysEqual:p,areUrlsEqual:f,unknownTagComparators:m}){return function(b,y,v){if(b===y)return!0;if(b==null||y==null)return!1;const _=typeof b;if(_!==typeof y)return!1;if(_!=="object")return _==="number"?l(b,y,v):_==="function"?i(b,y,v):!1;const w=b.constructor;if(w!==y.constructor)return!1;if(w===Object)return a(b,y,v);if(Array.isArray(b))return e(b,y,v);if(w===Date)return r(b,y,v);if(w===RegExp)return u(b,y,v);if(w===Map)return o(b,y,v);if(w===Set)return h(b,y,v);const k=xw.call(b);if(k===cw)return r(b,y,v);if(k===pw)return u(b,y,v);if(k===uw)return o(b,y,v);if(k===mw)return h(b,y,v);if(k===fw)return typeof b.then!="function"&&typeof y.then!="function"&&a(b,y,v);if(k===yw)return f(b,y,v);if(k===dw)return s(b,y,v);if(k===ow)return a(b,y,v);if(bw[k])return p(b,y,v);if(k===iw)return t(b,y,v);if(k===aw)return n(b,y,v);if(k===lw||k===hw||k===gw)return c(b,y,v);if(m){let C=m[k];if(!C){const S=Wk(b);S&&(C=m[S])}if(C)return C(b,y,v)}return!1}}function _w({circular:t,createCustomConfig:e,strict:n}){let r={areArrayBuffersEqual:Gk,areArraysEqual:n?Ir:Jk,areDataViewsEqual:Yk,areDatesEqual:Qk,areErrorsEqual:Xk,areFunctionsEqual:Zk,areMapsEqual:n?Eo(Hc,Ir):Hc,areNumbersEqual:ew,areObjectsEqual:n?Ir:tw,arePrimitiveWrappersEqual:nw,areRegExpsEqual:rw,areSetsEqual:n?Eo(Wc,Ir):Wc,areTypedArraysEqual:n?Eo(ai,Ir):ai,areUrlsEqual:sw,unknownTagComparators:void 0};if(e&&(r=Object.assign({},r,e(r))),t){const s=Rs(r.areArraysEqual),i=Rs(r.areMapsEqual),o=Rs(r.areObjectsEqual),l=Rs(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:s,areMapsEqual:i,areObjectsEqual:o,areSetsEqual:l})}return r}function kw(t){return function(e,n,r,s,i,o,l){return t(e,n,l)}}function ww({circular:t,comparator:e,createState:n,equals:r,strict:s}){if(n)return function(l,a){const{cache:c=t?new WeakMap:void 0,meta:u}=n();return e(l,a,{cache:c,equals:r,meta:u,strict:s})};if(t)return function(l,a){return e(l,a,{cache:new WeakMap,equals:r,meta:void 0,strict:s})};const i={cache:void 0,equals:r,meta:void 0,strict:s};return function(l,a){return e(l,a,i)}}const Cw=En();En({strict:!0});En({circular:!0});En({circular:!0,strict:!0});En({createInternalComparator:()=>nr});En({strict:!0,createInternalComparator:()=>nr});En({circular:!0,createInternalComparator:()=>nr});En({circular:!0,createInternalComparator:()=>nr,strict:!0});function En(t={}){const{circular:e=!1,createInternalComparator:n,createState:r,strict:s=!1}=t,i=_w(t),o=vw(i),l=n?n(o):kw(o);return ww({circular:e,comparator:o,createState:r,equals:l,strict:s})}var fl={exports:{}},Mo={};/**
|
|
119
119
|
* @license React
|
|
120
120
|
* use-sync-external-store-shim/with-selector.production.js
|
|
121
121
|
*
|
|
@@ -123,7 +123,7 @@ ${m}`}}),a}function Bk(t,e,n={}){const{state:r}=e,{doc:s,tr:i}=r,o=t;s.descendan
|
|
|
123
123
|
*
|
|
124
124
|
* This source code is licensed under the MIT license found in the
|
|
125
125
|
* LICENSE file in the root directory of this source tree.
|
|
126
|
-
*/var Vc;function
|
|
126
|
+
*/var Vc;function Sw(){if(Vc)return Mo;Vc=1;var t=x,e=Pi;function n(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var r=typeof Object.is=="function"?Object.is:n,s=e.useSyncExternalStore,i=t.useRef,o=t.useEffect,l=t.useMemo,a=t.useDebugValue;return Mo.useSyncExternalStoreWithSelector=function(c,u,h,p,f){var m=i(null);if(m.current===null){var g={hasValue:!1,value:null};m.current=g}else g=m.current;m=l(function(){function y(C){if(!v){if(v=!0,_=C,C=p(C),f!==void 0&&g.hasValue){var S=g.value;if(f(S,C))return w=S}return w=C}if(S=w,r(_,C))return S;var O=p(C);return f!==void 0&&f(S,O)?(_=C,S):(_=C,w=O)}var v=!1,_,w,k=h===void 0?null:h;return[function(){return y(u())},k===null?void 0:function(){return y(k())}]},[u,h,p,f]);var b=s(c,m[0],m[1]);return o(function(){g.hasValue=!0,g.value=b},[b]),a(b),b},Mo}var jo={};/**
|
|
127
127
|
* @license React
|
|
128
128
|
* use-sync-external-store-shim/with-selector.development.js
|
|
129
129
|
*
|
|
@@ -131,11 +131,11 @@ ${m}`}}),a}function Bk(t,e,n={}){const{state:r}=e,{doc:s,tr:i}=r,o=t;s.descendan
|
|
|
131
131
|
*
|
|
132
132
|
* This source code is licensed under the MIT license found in the
|
|
133
133
|
* LICENSE file in the root directory of this source tree.
|
|
134
|
-
*/var qc;function Cw(){return qc||(qc=1,process.env.NODE_ENV!=="production"&&function(){function t(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var e=x,n=Pi,r=typeof Object.is=="function"?Object.is:t,s=n.useSyncExternalStore,i=e.useRef,o=e.useEffect,l=e.useMemo,a=e.useDebugValue;jo.useSyncExternalStoreWithSelector=function(c,u,h,p,f){var m=i(null);if(m.current===null){var g={hasValue:!1,value:null};m.current=g}else g=m.current;m=l(function(){function y(C){if(!v){if(v=!0,_=C,C=p(C),f!==void 0&&g.hasValue){var N=g.value;if(f(N,C))return w=N}return w=C}if(N=w,r(_,C))return N;var O=p(C);return f!==void 0&&f(N,O)?(_=C,N):(_=C,w=O)}var v=!1,_,w,k=h===void 0?null:h;return[function(){return y(u())},k===null?void 0:function(){return y(k())}]},[u,h,p,f]);var b=s(c,m[0],m[1]);return o(function(){g.hasValue=!0,g.value=b},[b]),a(b),b},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),jo}process.env.NODE_ENV==="production"?fl.exports=ww():fl.exports=Cw();var Sw=fl.exports,Nw=(...t)=>e=>{t.forEach(n=>{typeof n=="function"?n(e):n&&(n.current=e)})},Aw=({contentComponent:t})=>{const e=Pi.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return d.jsx(d.Fragment,{children:Object.values(e)})};function Tw(){const t=new Set;let e={};return{subscribe(n){return t.add(n),()=>{t.delete(n)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(n,r){e={...e,[n]:Ut.createPortal(r.reactElement,r.element,n)},t.forEach(s=>s())},removeRenderer(n){const r={...e};delete r[n],e=r,t.forEach(s=>s())}}}var Ew=class extends x.Component{constructor(t){super(t),this.editorContentRef=x.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var t;const e=this.props.editor;if(e&&!e.isDestroyed&&((t=e.view.dom)!=null&&t.parentNode)){if(e.contentComponent)return;const n=this.editorContentRef.current;n.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:n}),e.contentComponent=Tw(),e.createNodeViews(),e.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){var t;const e=this.props.editor;if(e){e.isEditorContentInitialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null;try{if(!((t=e.view.dom)!=null&&t.parentNode))return;const n=document.createElement("div");n.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:n})}catch{}}}render(){const{editor:t,innerRef:e,...n}=this.props;return d.jsxs(d.Fragment,{children:[d.jsx("div",{ref:Nw(e,this.editorContentRef),...n}),(t==null?void 0:t.contentComponent)&&d.jsx(Aw,{contentComponent:t.contentComponent})]})}},Mw=x.forwardRef((t,e)=>{const n=x.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return x.createElement(Ew,{key:n,innerRef:e,...t})}),Ph=x.memo(Mw),jw=typeof window<"u"?x.useLayoutEffect:x.useEffect,Iw=class{constructor(t){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=t,this.lastSnapshot={editor:t,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(t){return this.subscribers.add(t),()=>{this.subscribers.delete(t)}}watch(t){if(this.editor=t,this.editor){const e=()=>{this.transactionNumber+=1,this.subscribers.forEach(r=>r())},n=this.editor;return n.on("transaction",e),()=>{n.off("transaction",e)}}}};function Dw(t){var e;const[n]=x.useState(()=>new Iw(t.editor)),r=Sw.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,t.selector,(e=t.equalityFn)!=null?e:kw);return jw(()=>n.watch(t.editor),[t.editor,n]),x.useDebugValue(r),r}var Uc=process.env.NODE_ENV!=="production",zh=typeof window>"u",Ow=zh||!!(typeof window<"u"&&window.next),Rw=class Fh{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){const e=this.options.current.immediatelyRender;let n=e??!0;return zh?(n&&Uc&&console.warn("SSR detected. `immediatelyRender` has been set to false to avoid hydration mismatches"),n=!1):Ow&&e===void 0&&(n=!1,Uc&&console.warn("Next.js detected. `immediatelyRender` defaults to false to avoid hydration mismatches. Pass `immediatelyRender: true` explicitly if you are rendering the editor only on the client.")),n?this.createEditor():null}createEditor(){const e={...this.options.current,onBeforeCreate:(...r)=>{var s,i;return(i=(s=this.options.current).onBeforeCreate)==null?void 0:i.call(s,...r)},onBlur:(...r)=>{var s,i;return(i=(s=this.options.current).onBlur)==null?void 0:i.call(s,...r)},onCreate:(...r)=>{var s,i;return(i=(s=this.options.current).onCreate)==null?void 0:i.call(s,...r)},onDestroy:(...r)=>{var s,i;return(i=(s=this.options.current).onDestroy)==null?void 0:i.call(s,...r)},onFocus:(...r)=>{var s,i;return(i=(s=this.options.current).onFocus)==null?void 0:i.call(s,...r)},onSelectionUpdate:(...r)=>{var s,i;return(i=(s=this.options.current).onSelectionUpdate)==null?void 0:i.call(s,...r)},onTransaction:(...r)=>{var s,i;return(i=(s=this.options.current).onTransaction)==null?void 0:i.call(s,...r)},onUpdate:(...r)=>{var s,i;return(i=(s=this.options.current).onUpdate)==null?void 0:i.call(s,...r)},onContentError:(...r)=>{var s,i;return(i=(s=this.options.current).onContentError)==null?void 0:i.call(s,...r)},onDrop:(...r)=>{var s,i;return(i=(s=this.options.current).onDrop)==null?void 0:i.call(s,...r)},onPaste:(...r)=>{var s,i;return(i=(s=this.options.current).onPaste)==null?void 0:i.call(s,...r)},onDelete:(...r)=>{var s,i;return(i=(s=this.options.current).onDelete)==null?void 0:i.call(s,...r)}};return new Nk(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,n){return Object.keys(e).every(r=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(r)?!0:r==="extensions"&&e.extensions&&n.extensions?e.extensions.length!==n.extensions.length?!1:e.extensions.every((s,i)=>{var o;return s===((o=n.extensions)==null?void 0:o[i])}):e[r]===n[r])}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?Fh.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((r,s)=>r===e[s]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function Lw(t={},e=[]){const n=x.useRef(t);n.current=t;const[r]=x.useState(()=>new Rw(n)),s=Pi.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return x.useDebugValue(s),x.useEffect(r.onRender(e)),Dw({editor:s,selector:({transactionNumber:i})=>t.shouldRerenderOnTransaction===!1||t.shouldRerenderOnTransaction===void 0?null:t.immediatelyRender&&i===0?0:i+1}),s}var Hh=x.createContext({editor:null});Hh.Consumer;var Bw=x.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),$w=()=>x.useContext(Bw);x.forwardRef((t,e)=>{const{onDragStart:n}=$w(),r=t.as||"div";return d.jsx(r,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})});function Kc(t){return!!(typeof t=="function"&&t.prototype&&t.prototype.isReactComponent)}function Gc(t){return!!(typeof t=="object"&&t.$$typeof&&(t.$$typeof.toString()==="Symbol(react.forward_ref)"||t.$$typeof.description==="react.forward_ref"))}function Pw(t){return!!(typeof t=="object"&&t.$$typeof&&(t.$$typeof.toString()==="Symbol(react.memo)"||t.$$typeof.description==="react.memo"))}function zw(t){if(Kc(t)||Gc(t))return!0;if(Pw(t)){const e=t.type;if(e)return Kc(e)||Gc(e)}return!1}function Fw(){try{if(x.version)return parseInt(x.version.split(".")[0],10)>=19}catch{}return!1}var Hw=class{constructor(t,{editor:e,props:n={},as:r="div",className:s=""}){this.ref=null,this.destroyed=!1,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=t,this.editor=e,this.props=n,this.element=document.createElement(r),this.element.classList.add("react-renderer"),s&&this.element.classList.add(...s.split(" ")),this.editor.isEditorContentInitialized?Ut.flushSync(()=>{this.render()}):queueMicrotask(()=>{this.destroyed||this.render()})}render(){var t;if(this.destroyed)return;const e=this.component,n=this.props,r=this.editor,s=Fw(),i=zw(e),o={...n};o.ref&&!(s||i)&&delete o.ref,!o.ref&&(s||i)&&(o.ref=l=>{this.ref=l}),this.reactElement=d.jsx(e,{...o}),(t=r==null?void 0:r.contentComponent)==null||t.setRenderer(this.id,this)}updateProps(t={}){if(this.destroyed)return;let e=!1;const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const s=n[r];if(t[s]!==this.props[s]){e=!0;break}}e&&(this.props={...this.props,...t},this.render())}destroy(){var t;this.destroyed=!0;const e=this.editor;(t=e==null?void 0:e.contentComponent)==null||t.removeRenderer(this.id);try{this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}catch{}}updateAttributes(t){Object.keys(t).forEach(e=>{this.element.setAttribute(e,t[e])})}};x.createContext({markViewContentRef:()=>{}});var ta=x.createContext({get editor(){throw new Error("useTiptap must be used within a <Tiptap> provider")}});ta.displayName="TiptapContext";var Ww=()=>x.useContext(ta);function Wh({editor:t,instance:e,children:n}){const r=t??e;if(!r)throw new Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");const s=x.useMemo(()=>({editor:r}),[r]),i=x.useMemo(()=>({editor:r}),[r]);return d.jsx(Hh.Provider,{value:i,children:d.jsx(ta.Provider,{value:s,children:n})})}Wh.displayName="Tiptap";function Vh({...t}){const{editor:e}=Ww();return d.jsx(Ph,{editor:e,...t})}Vh.displayName="Tiptap.Content";Object.assign(Wh,{Content:Vh});var ci=(t,e)=>{if(t==="slot")return 0;if(t instanceof Function)return t(e);const{children:n,...r}=e??{};if(t==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[t,r,n]},Vw=/^\s*>\s$/,qw=ot.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return ci("blockquote",{...ve(this.options.HTMLAttributes,t),children:ci("slot",{})})},parseMarkdown:(t,e)=>{var n;const r=(n=e.parseBlockChildren)!=null?n:e.parseChildren;return e.createNode("blockquote",void 0,r(t.tokens||[]))},renderMarkdown:(t,e)=>{if(!t.content)return"";const n=">",r=[];return t.content.forEach((s,i)=>{var o,l;const u=((l=(o=e.renderChild)==null?void 0:o.call(e,s,i))!=null?l:e.renderChildren([s])).split(`
|
|
134
|
+
*/var qc;function Nw(){return qc||(qc=1,process.env.NODE_ENV!=="production"&&function(){function t(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var e=x,n=Pi,r=typeof Object.is=="function"?Object.is:t,s=n.useSyncExternalStore,i=e.useRef,o=e.useEffect,l=e.useMemo,a=e.useDebugValue;jo.useSyncExternalStoreWithSelector=function(c,u,h,p,f){var m=i(null);if(m.current===null){var g={hasValue:!1,value:null};m.current=g}else g=m.current;m=l(function(){function y(C){if(!v){if(v=!0,_=C,C=p(C),f!==void 0&&g.hasValue){var S=g.value;if(f(S,C))return w=S}return w=C}if(S=w,r(_,C))return S;var O=p(C);return f!==void 0&&f(S,O)?(_=C,S):(_=C,w=O)}var v=!1,_,w,k=h===void 0?null:h;return[function(){return y(u())},k===null?void 0:function(){return y(k())}]},[u,h,p,f]);var b=s(c,m[0],m[1]);return o(function(){g.hasValue=!0,g.value=b},[b]),a(b),b},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),jo}process.env.NODE_ENV==="production"?fl.exports=Sw():fl.exports=Nw();var Aw=fl.exports,Tw=(...t)=>e=>{t.forEach(n=>{typeof n=="function"?n(e):n&&(n.current=e)})},Ew=({contentComponent:t})=>{const e=Pi.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return d.jsx(d.Fragment,{children:Object.values(e)})};function Mw(){const t=new Set;let e={};return{subscribe(n){return t.add(n),()=>{t.delete(n)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(n,r){e={...e,[n]:Ut.createPortal(r.reactElement,r.element,n)},t.forEach(s=>s())},removeRenderer(n){const r={...e};delete r[n],e=r,t.forEach(s=>s())}}}var jw=class extends x.Component{constructor(t){super(t),this.editorContentRef=x.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var t;const e=this.props.editor;if(e&&!e.isDestroyed&&((t=e.view.dom)!=null&&t.parentNode)){if(e.contentComponent)return;const n=this.editorContentRef.current;n.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:n}),e.contentComponent=Mw(),e.createNodeViews(),e.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){var t;const e=this.props.editor;if(e){e.isEditorContentInitialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null;try{if(!((t=e.view.dom)!=null&&t.parentNode))return;const n=document.createElement("div");n.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:n})}catch{}}}render(){const{editor:t,innerRef:e,...n}=this.props;return d.jsxs(d.Fragment,{children:[d.jsx("div",{ref:Tw(e,this.editorContentRef),...n}),(t==null?void 0:t.contentComponent)&&d.jsx(Ew,{contentComponent:t.contentComponent})]})}},Iw=x.forwardRef((t,e)=>{const n=x.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return x.createElement(jw,{key:n,innerRef:e,...t})}),Ph=x.memo(Iw),Dw=typeof window<"u"?x.useLayoutEffect:x.useEffect,Ow=class{constructor(t){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=t,this.lastSnapshot={editor:t,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(t){return this.subscribers.add(t),()=>{this.subscribers.delete(t)}}watch(t){if(this.editor=t,this.editor){const e=()=>{this.transactionNumber+=1,this.subscribers.forEach(r=>r())},n=this.editor;return n.on("transaction",e),()=>{n.off("transaction",e)}}}};function Rw(t){var e;const[n]=x.useState(()=>new Ow(t.editor)),r=Aw.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,t.selector,(e=t.equalityFn)!=null?e:Cw);return Dw(()=>n.watch(t.editor),[t.editor,n]),x.useDebugValue(r),r}var Uc=process.env.NODE_ENV!=="production",zh=typeof window>"u",Lw=zh||!!(typeof window<"u"&&window.next),Bw=class Fh{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){const e=this.options.current.immediatelyRender;let n=e??!0;return zh?(n&&Uc&&console.warn("SSR detected. `immediatelyRender` has been set to false to avoid hydration mismatches"),n=!1):Lw&&e===void 0&&(n=!1,Uc&&console.warn("Next.js detected. `immediatelyRender` defaults to false to avoid hydration mismatches. Pass `immediatelyRender: true` explicitly if you are rendering the editor only on the client.")),n?this.createEditor():null}createEditor(){const e={...this.options.current,onBeforeCreate:(...r)=>{var s,i;return(i=(s=this.options.current).onBeforeCreate)==null?void 0:i.call(s,...r)},onBlur:(...r)=>{var s,i;return(i=(s=this.options.current).onBlur)==null?void 0:i.call(s,...r)},onCreate:(...r)=>{var s,i;return(i=(s=this.options.current).onCreate)==null?void 0:i.call(s,...r)},onDestroy:(...r)=>{var s,i;return(i=(s=this.options.current).onDestroy)==null?void 0:i.call(s,...r)},onFocus:(...r)=>{var s,i;return(i=(s=this.options.current).onFocus)==null?void 0:i.call(s,...r)},onSelectionUpdate:(...r)=>{var s,i;return(i=(s=this.options.current).onSelectionUpdate)==null?void 0:i.call(s,...r)},onTransaction:(...r)=>{var s,i;return(i=(s=this.options.current).onTransaction)==null?void 0:i.call(s,...r)},onUpdate:(...r)=>{var s,i;return(i=(s=this.options.current).onUpdate)==null?void 0:i.call(s,...r)},onContentError:(...r)=>{var s,i;return(i=(s=this.options.current).onContentError)==null?void 0:i.call(s,...r)},onDrop:(...r)=>{var s,i;return(i=(s=this.options.current).onDrop)==null?void 0:i.call(s,...r)},onPaste:(...r)=>{var s,i;return(i=(s=this.options.current).onPaste)==null?void 0:i.call(s,...r)},onDelete:(...r)=>{var s,i;return(i=(s=this.options.current).onDelete)==null?void 0:i.call(s,...r)}};return new Tk(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,n){return Object.keys(e).every(r=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(r)?!0:r==="extensions"&&e.extensions&&n.extensions?e.extensions.length!==n.extensions.length?!1:e.extensions.every((s,i)=>{var o;return s===((o=n.extensions)==null?void 0:o[i])}):e[r]===n[r])}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?Fh.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((r,s)=>r===e[s]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function $w(t={},e=[]){const n=x.useRef(t);n.current=t;const[r]=x.useState(()=>new Bw(n)),s=Pi.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return x.useDebugValue(s),x.useEffect(r.onRender(e)),Rw({editor:s,selector:({transactionNumber:i})=>t.shouldRerenderOnTransaction===!1||t.shouldRerenderOnTransaction===void 0?null:t.immediatelyRender&&i===0?0:i+1}),s}var Hh=x.createContext({editor:null});Hh.Consumer;var Pw=x.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),zw=()=>x.useContext(Pw);x.forwardRef((t,e)=>{const{onDragStart:n}=zw(),r=t.as||"div";return d.jsx(r,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})});function Kc(t){return!!(typeof t=="function"&&t.prototype&&t.prototype.isReactComponent)}function Gc(t){return!!(typeof t=="object"&&t.$$typeof&&(t.$$typeof.toString()==="Symbol(react.forward_ref)"||t.$$typeof.description==="react.forward_ref"))}function Fw(t){return!!(typeof t=="object"&&t.$$typeof&&(t.$$typeof.toString()==="Symbol(react.memo)"||t.$$typeof.description==="react.memo"))}function Hw(t){if(Kc(t)||Gc(t))return!0;if(Fw(t)){const e=t.type;if(e)return Kc(e)||Gc(e)}return!1}function Ww(){try{if(x.version)return parseInt(x.version.split(".")[0],10)>=19}catch{}return!1}var Vw=class{constructor(t,{editor:e,props:n={},as:r="div",className:s=""}){this.ref=null,this.destroyed=!1,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=t,this.editor=e,this.props=n,this.element=document.createElement(r),this.element.classList.add("react-renderer"),s&&this.element.classList.add(...s.split(" ")),this.editor.isEditorContentInitialized?Ut.flushSync(()=>{this.render()}):queueMicrotask(()=>{this.destroyed||this.render()})}render(){var t;if(this.destroyed)return;const e=this.component,n=this.props,r=this.editor,s=Ww(),i=Hw(e),o={...n};o.ref&&!(s||i)&&delete o.ref,!o.ref&&(s||i)&&(o.ref=l=>{this.ref=l}),this.reactElement=d.jsx(e,{...o}),(t=r==null?void 0:r.contentComponent)==null||t.setRenderer(this.id,this)}updateProps(t={}){if(this.destroyed)return;let e=!1;const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const s=n[r];if(t[s]!==this.props[s]){e=!0;break}}e&&(this.props={...this.props,...t},this.render())}destroy(){var t;this.destroyed=!0;const e=this.editor;(t=e==null?void 0:e.contentComponent)==null||t.removeRenderer(this.id);try{this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}catch{}}updateAttributes(t){Object.keys(t).forEach(e=>{this.element.setAttribute(e,t[e])})}};x.createContext({markViewContentRef:()=>{}});var ta=x.createContext({get editor(){throw new Error("useTiptap must be used within a <Tiptap> provider")}});ta.displayName="TiptapContext";var qw=()=>x.useContext(ta);function Wh({editor:t,instance:e,children:n}){const r=t??e;if(!r)throw new Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");const s=x.useMemo(()=>({editor:r}),[r]),i=x.useMemo(()=>({editor:r}),[r]);return d.jsx(Hh.Provider,{value:i,children:d.jsx(ta.Provider,{value:s,children:n})})}Wh.displayName="Tiptap";function Vh({...t}){const{editor:e}=qw();return d.jsx(Ph,{editor:e,...t})}Vh.displayName="Tiptap.Content";Object.assign(Wh,{Content:Vh});var ci=(t,e)=>{if(t==="slot")return 0;if(t instanceof Function)return t(e);const{children:n,...r}=e??{};if(t==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[t,r,n]},Uw=/^\s*>\s$/,Kw=lt.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return ci("blockquote",{...ye(this.options.HTMLAttributes,t),children:ci("slot",{})})},parseMarkdown:(t,e)=>{var n;const r=(n=e.parseBlockChildren)!=null?n:e.parseChildren;return e.createNode("blockquote",void 0,r(t.tokens||[]))},renderMarkdown:(t,e)=>{if(!t.content)return"";const n=">",r=[];return t.content.forEach((s,i)=>{var o,l;const u=((l=(o=e.renderChild)==null?void 0:o.call(e,s,i))!=null?l:e.renderChildren([s])).split(`
|
|
135
135
|
`).map(h=>h.trim()===""?n:`${n} ${h}`);r.push(u.join(`
|
|
136
136
|
`))}),r.join(`
|
|
137
137
|
${n}
|
|
138
|
-
`)},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[vr({find:
|
|
138
|
+
`)},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[vr({find:Uw,type:this.type})]}}),Gw=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,Jw=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,Yw=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,Qw=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,Xw=Kt.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return ci("strong",{...ye(this.options.HTMLAttributes,t),children:ci("slot",{})})},markdownTokenName:"strong",parseMarkdown:(t,e)=>e.applyMark("bold",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"<strong>",close:"</strong>"}},renderMarkdown:(t,e)=>`**${e.renderChildren(t)}**`,addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Zn({find:Gw,type:this.type}),Zn({find:Yw,type:this.type})]},addPasteRules(){return[Nn({find:Jw,type:this.type}),Nn({find:Qw,type:this.type})]}}),Zw=/(^|[^`])`([^`]+)`(?!`)$/,eC=/(^|[^`])`([^`]+)`(?!`)/g,tC=Kt.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",ye(this.options.HTMLAttributes,t),0]},markdownTokenName:"codespan",parseMarkdown:(t,e)=>e.applyMark("code",[{type:"text",text:t.text||""}]),renderMarkdown:(t,e)=>t.content?`\`${e.renderChildren(t.content)}\``:"",addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Zn({find:Zw,type:this.type})]},addPasteRules(){return[Nn({find:eC,type:this.type})]}}),Io=4,nC=/^```([a-z]+)?[\s\n]$/,rC=/^~~~([a-z]+)?[\s\n]$/,sC=lt.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:Io,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options;if(!n)return null;const i=[...((e=t.firstElementChild)==null?void 0:e.classList)||[]].filter(o=>o.startsWith(n)).map(o=>o.replace(n,""))[0];return i||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",ye(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(t,e)=>{var n,r;return((n=t.raw)==null?void 0:n.startsWith("```"))===!1&&((r=t.raw)==null?void 0:r.startsWith("~~~"))===!1&&t.codeBlockStyle!=="indented"?[]:e.createNode("codeBlock",{language:t.lang||null},t.text?[e.createTextNode(t.text)]:[])},renderMarkdown:(t,e)=>{var n;let r="";const s=((n=t.attrs)==null?void 0:n.language)||"";return t.content?r=[`\`\`\`${s}`,e.renderChildren(t.content),"```"].join(`
|
|
139
139
|
`):r=`\`\`\`${s}
|
|
140
140
|
|
|
141
141
|
\`\`\``,r},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;const n=(e=this.options.tabSize)!=null?e:Io,{state:r}=t,{selection:s}=r,{$from:i,empty:o}=s;if(i.parent.type!==this.type)return!1;const l=" ".repeat(n);return o?t.commands.insertContent(l):t.commands.command(({tr:a})=>{const{from:c,to:u}=s,f=r.doc.textBetween(c,u,`
|
|
@@ -151,25 +151,25 @@ ${n}
|
|
|
151
151
|
`).map(f=>{var m;const g=((m=f.match(/^ */))==null?void 0:m[0])||"",b=Math.min(g.length,n);return f.slice(b)}).join(`
|
|
152
152
|
`);return l.replaceWith(a,c,r.schema.text(p)),!0})},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:s}=n;if(!s||r.parent.type!==this.type)return!1;const i=r.parentOffset===r.parent.nodeSize-2,o=r.parent.textContent.endsWith(`
|
|
153
153
|
|
|
154
|
-
`);return!i||!o?!1:t.chain().command(({tr:l})=>(l.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:r}=e,{$from:s,empty:i}=n;if(!i||s.parent.type!==this.type||!(s.parentOffset===s.parent.nodeSize-2))return!1;const l=s.after();return l===void 0?!1:r.nodeAt(l)?t.commands.command(({tr:c})=>(c.setSelection(
|
|
155
|
-
`));return o.replaceSelectionWith(this.type.create({language:i},a)),o.selection.$from.parent.type!==this.type&&o.setSelection(X.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.setMeta("paste",!0),t.dispatch(o),!0}}})]}}),
|
|
154
|
+
`);return!i||!o?!1:t.chain().command(({tr:l})=>(l.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:r}=e,{$from:s,empty:i}=n;if(!i||s.parent.type!==this.type||!(s.parentOffset===s.parent.nodeSize-2))return!1;const l=s.after();return l===void 0?!1:r.nodeAt(l)?t.commands.command(({tr:c})=>(c.setSelection(oe.near(r.resolve(l))),!0)):t.commands.exitCode()}}},addInputRules(){return[ul({find:nC,type:this.type,getAttributes:t=>({language:t[1]})}),ul({find:rC,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new Se({key:new Le("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),s=r?JSON.parse(r):void 0,i=s==null?void 0:s.mode;if(!n||!i)return!1;const{tr:o,schema:l}=t.state,a=l.text(n.replace(/\r\n?/g,`
|
|
155
|
+
`));return o.replaceSelectionWith(this.type.create({language:i},a)),o.selection.$from.parent.type!==this.type&&o.setSelection(X.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.setMeta("paste",!0),t.dispatch(o),!0}}})]}}),iC=lt.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
|
|
156
156
|
|
|
157
|
-
`):""}),
|
|
157
|
+
`):""}),oC=lt.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",ye(this.options.HTMLAttributes,t)]},renderText(){return`
|
|
158
158
|
`},renderMarkdown:()=>`
|
|
159
|
-
`,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:s,storedMarks:i}=n;if(s.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:l}=r.extensionManager,a=i||s.$to.parentOffset&&s.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:u})=>{if(u&&a&&o){const h=a.filter(p=>l.includes(p.type.name));c.ensureMarks(h)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),iC=ot.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,ve(this.options.HTMLAttributes,e),0]},parseMarkdown:(t,e)=>e.createNode("heading",{level:t.depth||1},e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>{var n;const r=(n=t.attrs)!=null&&n.level?parseInt(t.attrs.level,10):1,s="#".repeat(r);return t.content?`${s} ${e.renderChildren(t.content)}`:""},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>ul({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),oC=ot.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",ve(this.options.HTMLAttributes,t)]},markdownTokenName:"hr",parseMarkdown:(t,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!Ek(e,e.schema.nodes[this.name]))return!1;const{selection:n}=e,{$to:r}=n,s=t();return yh(n)?s.insertContentAt(r.pos,{type:this.name}):s.insertContent({type:this.name}),s.command(({state:i,tr:o,dispatch:l})=>{if(l){const{$to:a}=o.selection,c=a.end();if(a.nodeAfter)a.nodeAfter.isTextblock?o.setSelection(X.create(o.doc,a.pos+1)):a.nodeAfter.isBlock?o.setSelection(J.create(o.doc,a.pos)):o.setSelection(X.create(o.doc,a.pos));else{const u=i.schema.nodes[this.options.nextNodeType]||a.parent.type.contentMatch.defaultType,h=u==null?void 0:u.create();h&&(o.insert(c,h),o.setSelection(X.create(o.doc,c+1)))}o.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Rh({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),lC=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,aC=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,cC=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,dC=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,uC=Kt.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",ve(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(t,e)=>e.applyMark("italic",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"<em>",close:"</em>"}},renderMarkdown:(t,e)=>`*${e.renderChildren(t)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Zn({find:lC,type:this.type}),Zn({find:cC,type:this.type})]},addPasteRules(){return[Nn({find:aC,type:this.type}),Nn({find:dC,type:this.type})]}});const hC="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",fC="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",pl="numeric",ml="ascii",gl="alpha",Jr="asciinumeric",Wr="alphanumeric",bl="domain",qh="emoji",pC="scheme",mC="slashscheme",Do="whitespace";function gC(t,e){return t in e||(e[t]=[]),e[t]}function zn(t,e,n){e[pl]&&(e[Jr]=!0,e[Wr]=!0),e[ml]&&(e[Jr]=!0,e[gl]=!0),e[Jr]&&(e[Wr]=!0),e[gl]&&(e[Wr]=!0),e[Wr]&&(e[bl]=!0),e[qh]&&(e[bl]=!0);for(const r in e){const s=gC(r,n);s.indexOf(t)<0&&s.push(t)}}function bC(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function ct(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}ct.groups={};ct.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let r=0;r<e.jr.length;r++){const s=e.jr[r][0],i=e.jr[r][1];if(i&&s.test(t))return i}return e.jd},has(t,e=!1){return e?t in this.j:!!this.go(t)},ta(t,e,n,r){for(let s=0;s<t.length;s++)this.tt(t[s],e,n,r)},tr(t,e,n,r){r=r||ct.groups;let s;return e&&e.j?s=e:(s=new ct(e),n&&r&&zn(e,n,r)),this.jr.push([t,s]),s},ts(t,e,n,r){let s=this;const i=t.length;if(!i)return s;for(let o=0;o<i-1;o++)s=s.tt(t[o]);return s.tt(t[i-1],e,n,r)},tt(t,e,n,r){r=r||ct.groups;const s=this;if(e&&e.j)return s.j[t]=e,e;const i=e;let o,l=s.go(t);if(l?(o=new ct,Object.assign(o.j,l.j),o.jr.push.apply(o.jr,l.jr),o.jd=l.jd,o.t=l.t):o=new ct,i){if(r)if(o.t&&typeof o.t=="string"){const a=Object.assign(bC(o.t,r),n);zn(i,a,r)}else n&&zn(i,n,r);o.t=i}return s.j[t]=o,o}};const ae=(t,e,n,r,s)=>t.ta(e,n,r,s),Me=(t,e,n,r,s)=>t.tr(e,n,r,s),Jc=(t,e,n,r,s)=>t.ts(e,n,r,s),I=(t,e,n,r,s)=>t.tt(e,n,r,s),en="WORD",yl="UWORD",Uh="ASCIINUMERICAL",Kh="ALPHANUMERICAL",hs="LOCALHOST",xl="TLD",vl="UTLD",Us="SCHEME",dr="SLASH_SCHEME",na="NUM",_l="WS",ra="NL",Yr="OPENBRACE",Qr="CLOSEBRACE",di="OPENBRACKET",ui="CLOSEBRACKET",hi="OPENPAREN",fi="CLOSEPAREN",pi="OPENANGLEBRACKET",mi="CLOSEANGLEBRACKET",gi="FULLWIDTHLEFTPAREN",bi="FULLWIDTHRIGHTPAREN",yi="LEFTCORNERBRACKET",xi="RIGHTCORNERBRACKET",vi="LEFTWHITECORNERBRACKET",_i="RIGHTWHITECORNERBRACKET",ki="FULLWIDTHLESSTHAN",wi="FULLWIDTHGREATERTHAN",Ci="AMPERSAND",Si="APOSTROPHE",Ni="ASTERISK",pn="AT",Ai="BACKSLASH",Ti="BACKTICK",Ei="CARET",Fn="COLON",sa="COMMA",Mi="DOLLAR",Ft="DOT",ji="EQUALS",ia="EXCLAMATION",At="HYPHEN",Xr="PERCENT",Ii="PIPE",Di="PLUS",Oi="POUND",Zr="QUERY",oa="QUOTE",Gh="FULLWIDTHMIDDLEDOT",la="SEMI",Ht="SLASH",es="TILDE",Ri="UNDERSCORE",Jh="EMOJI",Li="SYM";var Yh=Object.freeze({__proto__:null,ALPHANUMERICAL:Kh,AMPERSAND:Ci,APOSTROPHE:Si,ASCIINUMERICAL:Uh,ASTERISK:Ni,AT:pn,BACKSLASH:Ai,BACKTICK:Ti,CARET:Ei,CLOSEANGLEBRACKET:mi,CLOSEBRACE:Qr,CLOSEBRACKET:ui,CLOSEPAREN:fi,COLON:Fn,COMMA:sa,DOLLAR:Mi,DOT:Ft,EMOJI:Jh,EQUALS:ji,EXCLAMATION:ia,FULLWIDTHGREATERTHAN:wi,FULLWIDTHLEFTPAREN:gi,FULLWIDTHLESSTHAN:ki,FULLWIDTHMIDDLEDOT:Gh,FULLWIDTHRIGHTPAREN:bi,HYPHEN:At,LEFTCORNERBRACKET:yi,LEFTWHITECORNERBRACKET:vi,LOCALHOST:hs,NL:ra,NUM:na,OPENANGLEBRACKET:pi,OPENBRACE:Yr,OPENBRACKET:di,OPENPAREN:hi,PERCENT:Xr,PIPE:Ii,PLUS:Di,POUND:Oi,QUERY:Zr,QUOTE:oa,RIGHTCORNERBRACKET:xi,RIGHTWHITECORNERBRACKET:_i,SCHEME:Us,SEMI:la,SLASH:Ht,SLASH_SCHEME:dr,SYM:Li,TILDE:es,TLD:xl,UNDERSCORE:Ri,UTLD:vl,UWORD:yl,WORD:en,WS:_l});const Qt=/[a-z]/,Dr=new RegExp("\\p{L}","u"),Oo=new RegExp("\\p{Emoji}","u"),Xt=/\d/,Ro=/\s/,Yc="\r",Lo=`
|
|
160
|
-
`,
|
|
159
|
+
`,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:s,storedMarks:i}=n;if(s.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:l}=r.extensionManager,a=i||s.$to.parentOffset&&s.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:u})=>{if(u&&a&&o){const h=a.filter(p=>l.includes(p.type.name));c.ensureMarks(h)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),lC=lt.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,ye(this.options.HTMLAttributes,e),0]},parseMarkdown:(t,e)=>e.createNode("heading",{level:t.depth||1},e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>{var n;const r=(n=t.attrs)!=null&&n.level?parseInt(t.attrs.level,10):1,s="#".repeat(r);return t.content?`${s} ${e.renderChildren(t.content)}`:""},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>ul({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),aC=lt.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",ye(this.options.HTMLAttributes,t)]},markdownTokenName:"hr",parseMarkdown:(t,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!jk(e,e.schema.nodes[this.name]))return!1;const{selection:n}=e,{$to:r}=n,s=t();return yh(n)?s.insertContentAt(r.pos,{type:this.name}):s.insertContent({type:this.name}),s.command(({state:i,tr:o,dispatch:l})=>{if(l){const{$to:a}=o.selection,c=a.end();if(a.nodeAfter)a.nodeAfter.isTextblock?o.setSelection(X.create(o.doc,a.pos+1)):a.nodeAfter.isBlock?o.setSelection(J.create(o.doc,a.pos)):o.setSelection(X.create(o.doc,a.pos));else{const u=i.schema.nodes[this.options.nextNodeType]||a.parent.type.contentMatch.defaultType,h=u==null?void 0:u.create();h&&(o.insert(c,h),o.setSelection(X.create(o.doc,c+1)))}o.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Rh({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),cC=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,dC=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,uC=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,hC=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,fC=Kt.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",ye(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(t,e)=>e.applyMark("italic",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"<em>",close:"</em>"}},renderMarkdown:(t,e)=>`*${e.renderChildren(t)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Zn({find:cC,type:this.type}),Zn({find:uC,type:this.type})]},addPasteRules(){return[Nn({find:dC,type:this.type}),Nn({find:hC,type:this.type})]}});const pC="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",mC="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",pl="numeric",ml="ascii",gl="alpha",Jr="asciinumeric",Wr="alphanumeric",bl="domain",qh="emoji",gC="scheme",bC="slashscheme",Do="whitespace";function yC(t,e){return t in e||(e[t]=[]),e[t]}function zn(t,e,n){e[pl]&&(e[Jr]=!0,e[Wr]=!0),e[ml]&&(e[Jr]=!0,e[gl]=!0),e[Jr]&&(e[Wr]=!0),e[gl]&&(e[Wr]=!0),e[Wr]&&(e[bl]=!0),e[qh]&&(e[bl]=!0);for(const r in e){const s=yC(r,n);s.indexOf(t)<0&&s.push(t)}}function xC(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function dt(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}dt.groups={};dt.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let r=0;r<e.jr.length;r++){const s=e.jr[r][0],i=e.jr[r][1];if(i&&s.test(t))return i}return e.jd},has(t,e=!1){return e?t in this.j:!!this.go(t)},ta(t,e,n,r){for(let s=0;s<t.length;s++)this.tt(t[s],e,n,r)},tr(t,e,n,r){r=r||dt.groups;let s;return e&&e.j?s=e:(s=new dt(e),n&&r&&zn(e,n,r)),this.jr.push([t,s]),s},ts(t,e,n,r){let s=this;const i=t.length;if(!i)return s;for(let o=0;o<i-1;o++)s=s.tt(t[o]);return s.tt(t[i-1],e,n,r)},tt(t,e,n,r){r=r||dt.groups;const s=this;if(e&&e.j)return s.j[t]=e,e;const i=e;let o,l=s.go(t);if(l?(o=new dt,Object.assign(o.j,l.j),o.jr.push.apply(o.jr,l.jr),o.jd=l.jd,o.t=l.t):o=new dt,i){if(r)if(o.t&&typeof o.t=="string"){const a=Object.assign(xC(o.t,r),n);zn(i,a,r)}else n&&zn(i,n,r);o.t=i}return s.j[t]=o,o}};const le=(t,e,n,r,s)=>t.ta(e,n,r,s),Te=(t,e,n,r,s)=>t.tr(e,n,r,s),Jc=(t,e,n,r,s)=>t.ts(e,n,r,s),I=(t,e,n,r,s)=>t.tt(e,n,r,s),en="WORD",yl="UWORD",Uh="ASCIINUMERICAL",Kh="ALPHANUMERICAL",hs="LOCALHOST",xl="TLD",vl="UTLD",Us="SCHEME",dr="SLASH_SCHEME",na="NUM",_l="WS",ra="NL",Yr="OPENBRACE",Qr="CLOSEBRACE",di="OPENBRACKET",ui="CLOSEBRACKET",hi="OPENPAREN",fi="CLOSEPAREN",pi="OPENANGLEBRACKET",mi="CLOSEANGLEBRACKET",gi="FULLWIDTHLEFTPAREN",bi="FULLWIDTHRIGHTPAREN",yi="LEFTCORNERBRACKET",xi="RIGHTCORNERBRACKET",vi="LEFTWHITECORNERBRACKET",_i="RIGHTWHITECORNERBRACKET",ki="FULLWIDTHLESSTHAN",wi="FULLWIDTHGREATERTHAN",Ci="AMPERSAND",Si="APOSTROPHE",Ni="ASTERISK",pn="AT",Ai="BACKSLASH",Ti="BACKTICK",Ei="CARET",Fn="COLON",sa="COMMA",Mi="DOLLAR",Ft="DOT",ji="EQUALS",ia="EXCLAMATION",At="HYPHEN",Xr="PERCENT",Ii="PIPE",Di="PLUS",Oi="POUND",Zr="QUERY",oa="QUOTE",Gh="FULLWIDTHMIDDLEDOT",la="SEMI",Ht="SLASH",es="TILDE",Ri="UNDERSCORE",Jh="EMOJI",Li="SYM";var Yh=Object.freeze({__proto__:null,ALPHANUMERICAL:Kh,AMPERSAND:Ci,APOSTROPHE:Si,ASCIINUMERICAL:Uh,ASTERISK:Ni,AT:pn,BACKSLASH:Ai,BACKTICK:Ti,CARET:Ei,CLOSEANGLEBRACKET:mi,CLOSEBRACE:Qr,CLOSEBRACKET:ui,CLOSEPAREN:fi,COLON:Fn,COMMA:sa,DOLLAR:Mi,DOT:Ft,EMOJI:Jh,EQUALS:ji,EXCLAMATION:ia,FULLWIDTHGREATERTHAN:wi,FULLWIDTHLEFTPAREN:gi,FULLWIDTHLESSTHAN:ki,FULLWIDTHMIDDLEDOT:Gh,FULLWIDTHRIGHTPAREN:bi,HYPHEN:At,LEFTCORNERBRACKET:yi,LEFTWHITECORNERBRACKET:vi,LOCALHOST:hs,NL:ra,NUM:na,OPENANGLEBRACKET:pi,OPENBRACE:Yr,OPENBRACKET:di,OPENPAREN:hi,PERCENT:Xr,PIPE:Ii,PLUS:Di,POUND:Oi,QUERY:Zr,QUOTE:oa,RIGHTCORNERBRACKET:xi,RIGHTWHITECORNERBRACKET:_i,SCHEME:Us,SEMI:la,SLASH:Ht,SLASH_SCHEME:dr,SYM:Li,TILDE:es,TLD:xl,UNDERSCORE:Ri,UTLD:vl,UWORD:yl,WORD:en,WS:_l});const Qt=/[a-z]/,Dr=new RegExp("\\p{L}","u"),Oo=new RegExp("\\p{Emoji}","u"),Xt=/\d/,Ro=/\s/,Yc="\r",Lo=`
|
|
160
|
+
`,vC="️",_C="",Bo="";let Ls=null,Bs=null;function kC(t=[]){const e={};dt.groups=e;const n=new dt;Ls==null&&(Ls=Qc(pC)),Bs==null&&(Bs=Qc(mC)),I(n,"'",Si),I(n,"{",Yr),I(n,"}",Qr),I(n,"[",di),I(n,"]",ui),I(n,"(",hi),I(n,")",fi),I(n,"<",pi),I(n,">",mi),I(n,"(",gi),I(n,")",bi),I(n,"「",yi),I(n,"」",xi),I(n,"『",vi),I(n,"』",_i),I(n,"<",ki),I(n,">",wi),I(n,"&",Ci),I(n,"*",Ni),I(n,"@",pn),I(n,"`",Ti),I(n,"^",Ei),I(n,":",Fn),I(n,",",sa),I(n,"$",Mi),I(n,".",Ft),I(n,"=",ji),I(n,"!",ia),I(n,"-",At),I(n,"%",Xr),I(n,"|",Ii),I(n,"+",Di),I(n,"#",Oi),I(n,"?",Zr),I(n,'"',oa),I(n,"/",Ht),I(n,";",la),I(n,"~",es),I(n,"_",Ri),I(n,"\\",Ai),I(n,"・",Gh);const r=Te(n,Xt,na,{[pl]:!0});Te(r,Xt,r);const s=Te(r,Qt,Uh,{[Jr]:!0}),i=Te(r,Dr,Kh,{[Wr]:!0}),o=Te(n,Qt,en,{[ml]:!0});Te(o,Xt,s),Te(o,Qt,o),Te(s,Xt,s),Te(s,Qt,s);const l=Te(n,Dr,yl,{[gl]:!0});Te(l,Qt),Te(l,Xt,i),Te(l,Dr,l),Te(i,Xt,i),Te(i,Qt),Te(i,Dr,i);const a=I(n,Lo,ra,{[Do]:!0}),c=I(n,Yc,_l,{[Do]:!0}),u=Te(n,Ro,_l,{[Do]:!0});I(n,Bo,u),I(c,Lo,a),I(c,Bo,u),Te(c,Ro,u),I(u,Yc),I(u,Lo),Te(u,Ro,u),I(u,Bo,u);const h=Te(n,Oo,Jh,{[qh]:!0});I(h,"#"),Te(h,Oo,h),I(h,vC,h);const p=I(h,_C);I(p,"#"),Te(p,Oo,h);const f=[[Qt,o],[Xt,s]],m=[[Qt,null],[Dr,l],[Xt,i]];for(let g=0;g<Ls.length;g++)dn(n,Ls[g],xl,en,f);for(let g=0;g<Bs.length;g++)dn(n,Bs[g],vl,yl,m);zn(xl,{tld:!0,ascii:!0},e),zn(vl,{utld:!0,alpha:!0},e),dn(n,"file",Us,en,f),dn(n,"mailto",Us,en,f),dn(n,"http",dr,en,f),dn(n,"https",dr,en,f),dn(n,"ftp",dr,en,f),dn(n,"ftps",dr,en,f),zn(Us,{scheme:!0,ascii:!0},e),zn(dr,{slashscheme:!0,ascii:!0},e),t=t.sort((g,b)=>g[0]>b[0]?1:-1);for(let g=0;g<t.length;g++){const b=t[g][0],v=t[g][1]?{[gC]:!0}:{[bC]:!0};b.indexOf("-")>=0?v[bl]=!0:Qt.test(b)?Xt.test(b)?v[Jr]=!0:v[ml]=!0:v[pl]=!0,Jc(n,b,b,v)}return Jc(n,"localhost",hs,{ascii:!0}),n.jd=new dt(Li),{start:n,tokens:Object.assign({groups:e},Yh)}}function Qh(t,e){const n=wC(e.replace(/[A-Z]/g,l=>l.toLowerCase())),r=n.length,s=[];let i=0,o=0;for(;o<r;){let l=t,a=null,c=0,u=null,h=-1,p=-1;for(;o<r&&(a=l.go(n[o]));)l=a,l.accepts()?(h=0,p=0,u=l):h>=0&&(h+=n[o].length,p++),c+=n[o].length,i+=n[o].length,o++;i-=h,o-=p,c-=h,s.push({t:u.t,v:e.slice(i-c,i),s:i-c,e:i})}return s}function wC(t){const e=[],n=t.length;let r=0;for(;r<n;){let s=t.charCodeAt(r),i,o=s<55296||s>56319||r+1===n||(i=t.charCodeAt(r+1))<56320||i>57343?t[r]:t.slice(r,r+2);e.push(o),r+=o.length}return e}function dn(t,e,n,r,s){let i;const o=e.length;for(let l=0;l<o-1;l++){const a=e[l];t.j[a]?i=t.j[a]:(i=new dt(r),i.jr=s.slice(),t.j[a]=i),t=i}return i=new dt(n),i.jr=s.slice(),t.j[e[o-1]]=i,i}function Qc(t){const e=[],n=[];let r=0,s="0123456789";for(;r<t.length;){let i=0;for(;s.indexOf(t[r+i])>=0;)i++;if(i>0){e.push(n.join(""));for(let o=parseInt(t.substring(r,r+i),10);o>0;o--)n.pop();r+=i}else n.push(t[r]),r++}return e}const fs={defaultProtocol:"http",events:null,format:Xc,formatHref:Xc,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function aa(t,e=null){let n=Object.assign({},fs);t&&(n=Object.assign(n,t instanceof aa?t.o:t));const r=n.ignoreTags,s=[];for(let i=0;i<r.length;i++)s.push(r[i].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=s}aa.prototype={o:fs,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const r=e!=null;let s=this.o[t];return s&&(typeof s=="object"?(s=n.t in s?s[n.t]:fs[t],typeof s=="function"&&r&&(s=s(e,n))):typeof s=="function"&&r&&(s=s(e,n.t,n)),s)},getObj(t,e,n){let r=this.o[t];return typeof r=="function"&&e!=null&&(r=r(e,n.t,n)),r},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function Xc(t){return t}function Xh(t,e){this.t="token",this.v=t,this.tk=e}Xh.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=fs.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),s=t.get("tagName",n,e),i=this.toFormattedString(t),o={},l=t.get("className",n,e),a=t.get("target",n,e),c=t.get("rel",n,e),u=t.getObj("attributes",n,e),h=t.getObj("events",n,e);return o.href=r,l&&(o.class=l),a&&(o.target=a),c&&(o.rel=c),u&&Object.assign(o,u),{tagName:s,attributes:o,content:i,eventListeners:h}}};function Zi(t,e){class n extends Xh{constructor(s,i){super(s,i),this.t=t}}for(const r in e)n.prototype[r]=e[r];return n.t=t,n}const CC=Zi("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Zc=Zi("text"),SC=Zi("nl"),$s=Zi("url",{isLink:!0,toHref(t=fs.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==hs&&t[1].t===Fn}}),wt=t=>new dt(t);function NC({groups:t}){const e=t.domain.concat([Ci,Ni,pn,Ai,Ti,Ei,Mi,ji,At,na,Xr,Ii,Di,Oi,Ht,Li,es,Ri]),n=[Si,Fn,sa,Ft,ia,Xr,Zr,oa,la,pi,mi,Yr,Qr,ui,di,hi,fi,gi,bi,yi,xi,vi,_i,ki,wi],r=[Ci,Si,Ni,Ai,Ti,Ei,Mi,ji,At,Yr,Qr,Xr,Ii,Di,Oi,Zr,Ht,Li,es,Ri],s=wt(),i=I(s,es);le(i,r,i),le(i,t.domain,i);const o=wt(),l=wt(),a=wt();le(s,t.domain,o),le(s,t.scheme,l),le(s,t.slashscheme,a),le(o,r,i),le(o,t.domain,o);const c=I(o,pn);I(i,pn,c),I(l,pn,c),I(a,pn,c);const u=I(i,Ft);le(u,r,i),le(u,t.domain,i);const h=wt();le(c,t.domain,h),le(h,t.domain,h);const p=I(h,Ft);le(p,t.domain,h);const f=wt(CC);le(p,t.tld,f),le(p,t.utld,f),I(c,hs,f);const m=I(h,At);I(m,At,m),le(m,t.domain,h),le(f,t.domain,h),I(f,Ft,p),I(f,At,m);const g=I(o,At),b=I(o,Ft);I(g,At,g),le(g,t.domain,o),le(b,r,i),le(b,t.domain,o);const y=wt($s);le(b,t.tld,y),le(b,t.utld,y),le(y,t.domain,o),le(y,r,i),I(y,Ft,b),I(y,At,g),I(y,pn,c);const v=I(y,Fn),_=wt($s);le(v,t.numeric,_);const w=wt($s),k=wt();le(w,e,w),le(w,n,k),le(k,e,w),le(k,n,k),I(y,Ht,w),I(_,Ht,w);const C=I(l,Fn),S=I(a,Fn),O=I(S,Ht),B=I(O,Ht);le(l,t.domain,o),I(l,Ft,b),I(l,At,g),le(a,t.domain,o),I(a,Ft,b),I(a,At,g),le(C,t.domain,w),I(C,Ht,w),I(C,Zr,w),le(B,t.domain,w),le(B,e,w),I(B,Ht,w);const N=[[Yr,Qr],[di,ui],[hi,fi],[pi,mi],[gi,bi],[yi,xi],[vi,_i],[ki,wi]];for(let T=0;T<N.length;T++){const[P,L]=N[T],R=I(w,P);I(k,P,R);const H=wt($s);le(R,e,H);const q=wt();le(R,n,q),I(R,L,w),le(H,e,H),le(H,n,q),le(q,e,H),le(q,n,q),I(H,L,w),I(q,L,w)}return I(s,hs,y),I(s,ra,SC),{start:s,tokens:Yh}}function AC(t,e,n){let r=n.length,s=0,i=[],o=[];for(;s<r;){let l=t,a=null,c=null,u=0,h=null,p=-1;for(;s<r&&!(a=l.go(n[s].t));)o.push(n[s++]);for(;s<r&&(c=a||l.go(n[s].t));)a=null,l=c,l.accepts()?(p=0,h=l):p>=0&&p++,s++,u++;if(p<0)s-=u,s<r&&(o.push(n[s]),s++);else{o.length>0&&(i.push($o(Zc,e,o)),o=[]),s-=p,u-=p;const f=h.t,m=n.slice(s-u,s);i.push($o(f,e,m))}}return o.length>0&&i.push($o(Zc,e,o)),i}function $o(t,e,n){const r=n[0].s,s=n[n.length-1].e,i=e.slice(r,s);return new t(i,n)}const TC=typeof console<"u"&&console&&console.warn||(()=>{}),EC="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",_e={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function MC(){return dt.groups={},_e.scanner=null,_e.parser=null,_e.tokenQueue=[],_e.pluginQueue=[],_e.customSchemes=[],_e.initialized=!1,_e}function ed(t,e=!1){if(_e.initialized&&TC(`linkifyjs: already initialized - will not register custom scheme "${t}" ${EC}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
|
|
161
161
|
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
162
162
|
2. Cannot start or end with "-"
|
|
163
|
-
3. "-" cannot repeat`);
|
|
164
|
-
`):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(
|
|
163
|
+
3. "-" cannot repeat`);_e.customSchemes.push([t,e])}function jC(){_e.scanner=kC(_e.customSchemes);for(let t=0;t<_e.tokenQueue.length;t++)_e.tokenQueue[t][1]({scanner:_e.scanner});_e.parser=NC(_e.scanner.tokens);for(let t=0;t<_e.pluginQueue.length;t++)_e.pluginQueue[t][1]({scanner:_e.scanner,parser:_e.parser});return _e.initialized=!0,_e}function ca(t){return _e.initialized||jC(),AC(_e.parser.start,t,Qh(_e.scanner.start,t))}ca.scan=Qh;function Zh(t,e=null,n=null){if(e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const r=new aa(n),s=ca(t),i=[];for(let o=0;o<s.length;o++){const l=s[o];l.isLink&&(!e||l.t===e)&&r.check(l)&&i.push(l.toFormattedObject(r))}return i}var da="[\0- -\u2029 ]",IC=new RegExp(da),DC=new RegExp(`${da}$`),OC=new RegExp(da,"g");function RC(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function LC(t){return new Se({key:new Le("autolink"),appendTransaction:(e,n,r)=>{const s=e.some(c=>c.docChanged)&&!n.doc.eq(r.doc),i=e.some(c=>c.getMeta("preventAutolink"));if(!s||i)return;const{tr:o}=r,l=dh(n.doc,[...e]);if(bh(l).forEach(({newRange:c})=>{const u=T_(r.doc,c,f=>f.isTextblock);let h,p;if(u.length>1)h=u[0],p=r.doc.textBetween(h.pos,h.pos+h.node.nodeSize,void 0," ");else if(u.length){const f=r.doc.textBetween(c.from,c.to," "," ");if(!DC.test(f))return;h=u[0],p=r.doc.textBetween(h.pos,c.to,void 0," ")}if(h&&p){const f=p.split(IC).filter(Boolean);if(f.length<=0)return!1;const m=f[f.length-1],g=h.pos+p.lastIndexOf(m);if(!m)return!1;const b=ca(m).map(y=>y.toObject(t.defaultProtocol));if(!RC(b))return!1;b.filter(y=>y.isLink).map(y=>({...y,from:g+y.start+1,to:g+y.end+1})).filter(y=>r.schema.marks.code?!r.doc.rangeHasMark(y.from,y.to,r.schema.marks.code):!0).filter(y=>t.validate(y.value)).filter(y=>t.shouldAutoLink(y.value)).forEach(y=>{Yl(y.from,y.to,r.doc).some(v=>v.mark.type===t.type)||o.addMark(y.from,y.to,t.type.create({href:y.href}))})}}),!!o.steps.length)return o}})}function BC(t){return new Se({key:new Le("handleClickLink"),props:{handleClick:(e,n,r)=>{var s,i;if(r.button!==0||!e.editable)return!1;let o=null;if(r.target instanceof HTMLAnchorElement)o=r.target;else{const a=r.target;if(!a)return!1;const c=t.editor.view.dom;o=a.closest("a"),o&&!c.contains(o)&&(o=null)}if(!o)return!1;let l=!1;if(t.enableClickSelection&&(l=t.editor.commands.extendMarkRange(t.type.name)),t.openOnClick){const a=gh(e.state,t.type.name),c=(s=o.href)!=null?s:a.href,u=(i=o.target)!=null?i:a.target;c&&(window.open(c,u),l=!0)}return l}}})}function $C(t){return new Se({key:new Le("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{shouldAutoLink:s}=t,{state:i}=e,{selection:o}=i,{empty:l}=o;if(l)return!1;let a="";r.content.forEach(u=>{a+=u.textContent});const c=Zh(a,{defaultProtocol:t.defaultProtocol}).find(u=>u.isLink&&u.value===a);return!a||!c||s!==void 0&&!s(c.value)?!1:t.editor.commands.setMark(t.type,{href:c.href})}}})}function jn(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const s=typeof r=="string"?r:r.scheme;s&&n.push(s)}),!t||t.replace(OC,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var ef=Kt.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){ed(t);return}ed(t.scheme,t.optionalSlashes)})},onDestroy(){MC()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!jn(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>{const e=/^[a-z][a-z0-9+.-]*:\/\//i.test(t),n=/^[a-z][a-z0-9+.-]*:/i.test(t);if(e||n&&!t.includes("@"))return!0;const s=(t.includes("@")?t.split("@").pop():t).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(s)||!/\./.test(s))}}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:n=>!!jn(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!jn(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",ye(this.options.HTMLAttributes,t),0]:["a",ye(this.options.HTMLAttributes,{...t,href:""}),0]},markdownTokenName:"link",parseMarkdown:(t,e)=>e.applyMark("link",e.parseInline(t.tokens||[]),{href:t.href,title:t.title||null}),renderMarkdown:(t,e)=>{var n,r,s,i;const o=(r=(n=t.attrs)==null?void 0:n.href)!=null?r:"",l=(i=(s=t.attrs)==null?void 0:s.title)!=null?i:"",a=e.renderChildren(t);return l?`[${a}](${o} "${l}")`:`[${a}](${o})`},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!jn(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{const{href:n}=t||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:r=>!!jn(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[Nn({find:t=>{const e=[];if(t){const{protocols:n,defaultProtocol:r}=this.options,s=Zh(t).filter(i=>i.isLink&&this.options.isAllowedUri(i.value,{defaultValidate:o=>!!jn(o,n),protocols:n,defaultProtocol:r}));s.length&&s.forEach(i=>{this.options.shouldAutoLink(i.value)&&e.push({text:i.value,data:{href:i.href},index:i.start})})}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)==null?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push(LC({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:s=>!!jn(s,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),t.push(BC({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push($C({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),t}}),PC=ef,zC=Object.defineProperty,FC=(t,e)=>{for(var n in e)zC(t,n,{get:e[n],enumerable:!0})},HC="listItem",td="textStyle",nd=/^\s*([-+*])\s$/,tf=lt.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",ye(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>t.type!=="list"||t.ordered?[]:{type:"bulletList",content:t.items?e.parseChildren(t.items):[]},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
|
|
164
|
+
`):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(HC,this.editor.getAttributes(td)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=vr({find:nd,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=vr({find:nd,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(td),editor:this.editor})),[t]}});function WC(t){var e,n;const r=(e=t.tokens)==null?void 0:e[0];return!!(t.text&&((n=t.tokens)==null?void 0:n.length)===1&&(r==null?void 0:r.type)==="list"&&r.ordered&&r.raw===t.text)}function VC(t,e){return e.tokenizeInline?e.parseInline(e.tokenizeInline(t)):e.parseInline([{type:"text",raw:t,text:t}])}var nf=lt.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",ye(this.options.HTMLAttributes,t),0]},markdownTokenName:"list_item",parseMarkdown:(t,e)=>{var n;if(t.type!=="list_item")return[];const r=(n=e.parseBlockChildren)!=null?n:e.parseChildren;let s=[];if(t.tokens&&t.tokens.length>0){if(WC(t))return{type:"listItem",content:[{type:"paragraph",content:VC(t.text||"",e)}]};if(t.tokens.some(o=>o.type==="paragraph"))s=r(t.tokens);else{const o=t.tokens[0];if(o&&o.type==="text"&&o.tokens&&o.tokens.length>0){if(s=[{type:"paragraph",content:e.parseInline(o.tokens)}],t.tokens.length>1){const a=t.tokens.slice(1),c=r(a);s.push(...c)}}else s=r(t.tokens)}}return s.length===0&&(s=[{type:"paragraph",content:[]}]),{type:"listItem",content:s}},renderMarkdown:(t,e,n)=>ea(t,e,r=>{var s,i;return r.parentType==="bulletList"?"- ":r.parentType==="orderedList"?`${(((i=(s=r.meta)==null?void 0:s.parentAttrs)==null?void 0:i.start)||1)+r.index}. `:"- "},n),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),qC={};FC(qC,{findListItemPos:()=>vs,getNextListDepth:()=>ua,handleBackspace:()=>kl,handleDelete:()=>wl,hasListBefore:()=>rf,hasListItemAfter:()=>UC,hasListItemBefore:()=>sf,listItemHasSubList:()=>of,nextListIsDeeper:()=>lf,nextListIsHigher:()=>af});var vs=(t,e)=>{const{$from:n}=e.selection,r=Fe(t,e.schema);let s=null,i=n.depth,o=n.pos,l=null;for(;i>0&&l===null;)s=n.node(i),s.type===r?l=i:(i-=1,o-=1);return l===null?null:{$pos:e.doc.resolve(o),depth:l}},ua=(t,e)=>{const n=vs(t,e);if(!n)return!1;const[,r]=P_(e,t,n.$pos.pos+4);return r},rf=(t,e,n)=>{const{$anchor:r}=t.selection,s=Math.max(0,r.pos-2),i=t.doc.resolve(s).node();return!(!i||!n.includes(i.type.name))},sf=(t,e)=>{var n;const{$anchor:r}=e.selection,s=e.doc.resolve(r.pos-2);return!(s.index()===0||((n=s.nodeBefore)==null?void 0:n.type.name)!==t)},of=(t,e,n)=>{if(!n)return!1;const r=Fe(t,e.schema);let s=!1;return n.descendants(i=>{i.type===r&&(s=!0)}),s},kl=(t,e,n)=>{if(t.commands.undoInputRule())return!0;if(t.state.selection.from!==t.state.selection.to)return!1;if(!Sn(t.state,e)&&rf(t.state,e,n)){const{$anchor:l}=t.state.selection,a=t.state.doc.resolve(l.before()-1),c=[];a.node().descendants((p,f)=>{p.type.name===e&&c.push({node:p,pos:f})});const u=c.at(-1);if(!u)return!1;const h=t.state.doc.resolve(a.start()+u.pos+1);return t.chain().cut({from:l.start()-1,to:l.end()+1},h.end()).joinForward().run()}if(!Sn(t.state,e)||!W_(t.state))return!1;const r=vs(e,t.state);if(!r)return!1;const i=t.state.doc.resolve(r.$pos.pos-2).node(r.depth),o=of(e,t.state,i);return sf(e,t.state)&&!o?t.commands.joinItemBackward():t.chain().liftListItem(e).run()},lf=(t,e)=>{const n=ua(t,e),r=vs(t,e);return!r||!n?!1:n>r.depth},af=(t,e)=>{const n=ua(t,e),r=vs(t,e);return!r||!n?!1:n<r.depth},wl=(t,e)=>{if(!Sn(t.state,e)||!H_(t.state,e))return!1;const{selection:n}=t.state,{$from:r,$to:s}=n;return!n.empty&&r.sameParent(s)?!1:lf(e,t.state)?t.chain().focus(t.state.selection.from+4).lift(e).joinBackward().run():af(e,t.state)?t.chain().joinForward().joinBackward().run():t.commands.joinItemForward()},UC=(t,e)=>{var n;const{$anchor:r}=e.selection,s=e.doc.resolve(r.pos-r.parentOffset-2);return!(s.index()===s.parent.childCount-1||((n=s.nodeAfter)==null?void 0:n.type.name)!==t)},cf=Me.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&wl(t,n)&&(e=!0)}),e},"Mod-Delete":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&wl(t,n)&&(e=!0)}),e},Backspace:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{t.state.schema.nodes[n]!==void 0&&kl(t,n,r)&&(e=!0)}),e},"Mod-Backspace":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{t.state.schema.nodes[n]!==void 0&&kl(t,n,r)&&(e=!0)}),e}}}}),rd=/^(\s*)(\d+)\.\s+(.*)$/,KC=/^\s/;function GC(t){const e=t.trimStart();return/^[-+*]\s+/.test(e)||/^\d+\.\s+/.test(e)||/^>\s?/.test(e)||/^```/.test(e)||/^~~~/.test(e)}function JC(t){const e=[],n=[];let r=!1;return t.forEach(s=>{if(r){n.push(s);return}if(s.trim()===""){r=!0,n.push(s);return}if(e.length>0&&GC(s)){r=!0,n.push(s);return}e.push(s)}),{paragraphLines:e,blockLines:n}}function YC(t){const e=[];let n=0,r=0;for(;n<t.length;){const s=t[n],i=s.match(rd);if(!i)break;const[,o,l,a]=i,c=o.length,u=[a];let h=n+1;const p=[s];let f=!1;for(;h<t.length;){const m=t[h];if(m.match(rd))break;if(m.trim()==="")p.push(m),u.push(""),f=!0,h+=1;else if(m.match(KC))p.push(m),u.push(m.slice(c+2)),h+=1;else{if(f)break;p.push(m),u.push(m),h+=1}}e.push({indent:c,number:parseInt(l,10),content:u.join(`
|
|
165
165
|
`).trim(),contentLines:u,raw:p.join(`
|
|
166
|
-
`)}),r=h,n=h}return[e,r]}function df(t,e,n){const r=[];let s=0;for(;s<t.length;){const i=t[s];if(i.indent===e){const{paragraphLines:o,blockLines:l}=
|
|
166
|
+
`)}),r=h,n=h}return[e,r]}function df(t,e,n){const r=[];let s=0;for(;s<t.length;){const i=t[s];if(i.indent===e){const{paragraphLines:o,blockLines:l}=JC(i.contentLines),a=o.join(`
|
|
167
167
|
`).trim(),c=[];a&&c.push({type:"paragraph",raw:a,tokens:n.inlineTokens(a)});const u=l.join(`
|
|
168
168
|
`).trim();if(u){const f=n.blockTokens(u);c.push(...f)}let h=s+1;const p=[];for(;h<t.length&&t[h].indent>e;)p.push(t[h]),h+=1;if(p.length>0){const f=Math.min(...p.map(g=>g.indent)),m=df(p,f,n);c.push({type:"list",ordered:!0,start:p[0].number,items:m,raw:p.map(g=>g.raw).join(`
|
|
169
|
-
`)})}r.push({type:"list_item",raw:i.raw,tokens:c}),s=h}else s+=1}return r}function
|
|
169
|
+
`)})}r.push({type:"list_item",raw:i.raw,tokens:c}),s=h}else s+=1}return r}function QC(t,e){return t.map(n=>{if(n.type!=="list_item")return e.parseChildren([n])[0];const r=[];return n.tokens&&n.tokens.length>0&&n.tokens.forEach(s=>{if(s.type==="paragraph"||s.type==="list"||s.type==="blockquote"||s.type==="code")r.push(...e.parseChildren([s]));else if(s.type==="text"&&s.tokens){const i=e.parseChildren([s]);r.push({type:"paragraph",content:i})}else{const i=e.parseChildren([s]);i.length>0&&r.push(...i)}}),{type:"listItem",content:r}})}var XC="listItem",sd="textStyle",id=/^(\d+)\.\s$/,uf=lt.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",ye(this.options.HTMLAttributes,n),0]:["ol",ye(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>{if(t.type!=="list"||!t.ordered)return[];const n=t.start||1,r=t.items?QC(t.items,e):[];return n!==1?{type:"orderedList",attrs:{start:n},content:r}:{type:"orderedList",content:r}},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
|
|
170
170
|
`):"",markdownTokenizer:{name:"orderedList",level:"block",start:t=>{const e=t.match(/^(\s*)(\d+)\.\s+/),n=e==null?void 0:e.index;return n!==void 0?n:-1},tokenize:(t,e,n)=>{var r;const s=t.split(`
|
|
171
|
-
`),[i,o]=
|
|
172
|
-
`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(
|
|
173
|
-
`):"",markdownTokenizer:{name:"taskList",level:"block",start(t){var e;const n=(e=t.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:e.index;return n!==void 0?n:-1},tokenize(t,e,n){const r=i=>{const o=hl(i,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:l=>({indentLevel:l[1].length,mainContent:l[4],checked:l[3].toLowerCase()==="x"}),createToken:(l,a)=>({type:"taskItem",raw:"",mainContent:l.mainContent,indentLevel:l.indentLevel,checked:l.checked,text:l.mainContent,tokens:n.inlineTokens(l.mainContent),nestedTokens:a}),customNestedParser:r},n);return o?[{type:"taskList",raw:o.raw,items:o.items}]:n.blockTokens(i)},s=hl(t,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:i=>({indentLevel:i[1].length,mainContent:i[4],checked:i[3].toLowerCase()==="x"}),createToken:(i,o)=>({type:"taskItem",raw:"",mainContent:i.mainContent,indentLevel:i.indentLevel,checked:i.checked,text:i.mainContent,tokens:n.inlineTokens(i.mainContent),nestedTokens:o}),customNestedParser:r},n);if(s)return{type:"taskList",raw:s.raw,items:s.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});Ie.create({name:"listKit",addExtensions(){const t=[];return this.options.bulletList!==!1&&t.push(tf.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(nf.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(cf.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(uf.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(hf.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(ff.configure(this.options.taskList)),t}});var Ps=" ",Po=" ",XC=ot.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",ve(this.options.HTMLAttributes,t),0]},parseMarkdown:(t,e)=>{const n=t.tokens||[];if(n.length===1&&n[0].type==="image")return e.parseChildren([n[0]]);const r=e.parseInline(n);return n.length===1&&n[0].type==="text"&&(n[0].raw===Ps||n[0].text===Ps||n[0].raw===Po||n[0].text===Po)&&r.length===1&&r[0].type==="text"&&(r[0].text===Ps||r[0].text===Po)?e.createNode("paragraph",void 0,[]):e.createNode("paragraph",void 0,r)},renderMarkdown:(t,e,n)=>{var r,s;if(!t)return"";const i=Array.isArray(t.content)?t.content:[];if(i.length===0){const o=Array.isArray((r=n==null?void 0:n.previousNode)==null?void 0:r.content)?n.previousNode.content:[];return((s=n==null?void 0:n.previousNode)==null?void 0:s.type)==="paragraph"&&o.length===0?Ps:""}return e.renderChildren(i)},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),ZC=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,eS=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,tS=Kt.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",ve(this.options.HTMLAttributes,t),0]},markdownTokenName:"del",parseMarkdown:(t,e)=>e.applyMark("strike",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`~~${e.renderChildren(t)}~~`,addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Zn({find:ZC,type:this.type})]},addPasteRules(){return[Nn({find:eS,type:this.type})]}}),nS=ot.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),pf=Kt.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",ve(this.options.HTMLAttributes,t),0]},parseMarkdown(t,e){return e.applyMark(this.name||"underline",e.parseInline(t.tokens||[]))},renderMarkdown(t,e){return`++${e.renderChildren(t)}++`},markdownTokenizer:{name:"underline",level:"inline",start(t){return t.indexOf("++")},tokenize(t,e,n){const s=/^(\+\+)([\s\S]+?)(\+\+)/.exec(t);if(!s)return;const i=s[2].trim();return{type:"underline",raw:s[0],text:i,tokens:n.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),rS=pf;function sS(t={}){return new Ae({view(e){return new iS(e,t)}})}class iS{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(s=>{let i=o=>{this[s](o)};return e.dom.addEventListener(s,i),{name:s,handler:i}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r,s=this.editorView.dom,i=s.getBoundingClientRect(),o=i.width/s.offsetWidth,l=i.height/s.offsetHeight;if(n){let h=e.nodeBefore,p=e.nodeAfter;if(h||p){let f=this.editorView.nodeDOM(this.cursorPos-(h?h.nodeSize:0));if(f){let m=f.getBoundingClientRect(),g=h?m.bottom:m.top;h&&p&&(g=(g+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let b=this.width/2*l;r={left:m.left,right:m.right,top:g-b,bottom:g+b}}}}if(!r){let h=this.editorView.coordsAtPos(this.cursorPos),p=this.width/2*o;r={left:h.left-p,right:h.left+p,top:h.top,bottom:h.bottom}}let a=this.editorView.dom.offsetParent;this.element||(this.element=a.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let c,u;if(!a||a==document.body&&getComputedStyle(a).position=="static")c=-pageXOffset,u=-pageYOffset;else{let h=a.getBoundingClientRect(),p=h.width/a.offsetWidth,f=h.height/a.offsetHeight;c=h.left-a.scrollLeft*p,u=h.top-a.scrollTop*f}this.element.style.left=(r.left-c)/o+"px",this.element.style.top=(r.top-u)/l+"px",this.element.style.width=(r.right-r.left)/o+"px",this.element.style.height=(r.bottom-r.top)/l+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),s=r&&r.type.spec.disableDropCursor,i=typeof s=="function"?s(this.editorView,n,e):s;if(n&&!i){let o=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=eu(this.editorView.state.doc,o,this.editorView.dragging.slice);l!=null&&(o=l)}this.setCursor(o),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class je extends le{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return je.valid(r)?new je(r):le.near(r)}content(){return F.empty}eq(e){return e instanceof je&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new je(e.resolve(n.pos))}getBookmark(){return new ha(this.anchor)}static valid(e){let n=e.parent;if(n.inlineContent||!oS(e)||!lS(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let s=n.contentMatchAt(e.index()).defaultType;return s&&s.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&je.valid(e))return e;let s=e.pos,i=null;for(let o=e.depth;;o--){let l=e.node(o);if(n>0?e.indexAfter(o)<l.childCount:e.index(o)>0){i=l.child(n>0?e.indexAfter(o):e.index(o)-1);break}else if(o==0)return null;s+=n;let a=e.doc.resolve(s);if(je.valid(a))return a}for(;;){let o=n>0?i.firstChild:i.lastChild;if(!o){if(i.isAtom&&!i.isText&&!J.isSelectable(i)){e=e.doc.resolve(s+i.nodeSize*n),r=!1;continue e}break}i=o,s+=n;let l=e.doc.resolve(s);if(je.valid(l))return l}return null}}}je.prototype.visible=!1;je.findFrom=je.findGapCursorFrom;le.jsonID("gapcursor",je);class ha{constructor(e){this.pos=e}map(e){return new ha(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return je.valid(n)?new je(n):le.near(n)}}function mf(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}function oS(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let s=r.child(n-1);;s=s.lastChild){if(s.childCount==0&&!s.inlineContent||mf(s.type))return!0;if(s.inlineContent)return!1}}return!0}function lS(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let s=r.child(n);;s=s.firstChild){if(s.childCount==0&&!s.inlineContent||mf(s.type))return!0;if(s.inlineContent)return!1}}return!0}function aS(){return new Ae({props:{decorations:hS,createSelectionBetween(t,e,n){return e.pos==n.pos&&je.valid(n)?new je(n):null},handleClick:dS,handleKeyDown:cS,handleDOMEvents:{beforeinput:uS}}})}const cS=nh({ArrowLeft:zs("horiz",-1),ArrowRight:zs("horiz",1),ArrowUp:zs("vert",-1),ArrowDown:zs("vert",1)});function zs(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,s,i){let o=r.selection,l=e>0?o.$to:o.$from,a=o.empty;if(o instanceof X){if(!i.endOfTextblock(n)||l.depth==0)return!1;a=!1,l=r.doc.resolve(e>0?l.after():l.before())}let c=je.findGapCursorFrom(l,e,a);return c?(s&&s(r.tr.setSelection(new je(c))),!0):!1}}function dS(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!je.valid(r))return!1;let s=t.posAtCoords({left:n.clientX,top:n.clientY});return s&&s.inside>-1&&J.isSelectable(t.state.doc.nodeAt(s.inside))?!1:(t.dispatch(t.state.tr.setSelection(new je(r))),!0)}function uS(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof je))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let s=E.empty;for(let o=r.length-1;o>=0;o--)s=E.from(r[o].createAndFill(null,s));let i=t.state.tr.replace(n.pos,n.pos,new F(s,0,0));return i.setSelection(X.near(i.doc.resolve(n.pos+1))),t.dispatch(i),!1}function hS(t){if(!(t.selection instanceof je))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Ne.create(t.doc,[et.widget(t.selection.head,e,{key:"gapcursor"})])}var Bi=200,We=function(){};We.prototype.append=function(e){return e.length?(e=We.from(e),!this.length&&e||e.length<Bi&&this.leafAppend(e)||this.length<Bi&&e.leafPrepend(this)||this.appendInner(e)):this};We.prototype.prepend=function(e){return e.length?We.from(e).append(this):this};We.prototype.appendInner=function(e){return new fS(this,e)};We.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?We.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};We.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};We.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)};We.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var s=[];return this.forEach(function(i,o){return s.push(e(i,o))},n,r),s};We.from=function(e){return e instanceof We?e:e&&e.length?new gf(e):We.empty};var gf=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(s,i){return s==0&&i==this.length?this:new e(this.values.slice(s,i))},e.prototype.getInner=function(s){return this.values[s]},e.prototype.forEachInner=function(s,i,o,l){for(var a=i;a<o;a++)if(s(this.values[a],l+a)===!1)return!1},e.prototype.forEachInvertedInner=function(s,i,o,l){for(var a=i-1;a>=o;a--)if(s(this.values[a],l+a)===!1)return!1},e.prototype.leafAppend=function(s){if(this.length+s.length<=Bi)return new e(this.values.concat(s.flatten()))},e.prototype.leafPrepend=function(s){if(this.length+s.length<=Bi)return new e(s.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(We);We.empty=new gf([]);var fS=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,s,i,o){var l=this.left.length;if(s<l&&this.left.forEachInner(r,s,Math.min(i,l),o)===!1||i>l&&this.right.forEachInner(r,Math.max(s-l,0),Math.min(this.length,i)-l,o+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,s,i,o){var l=this.left.length;if(s>l&&this.right.forEachInvertedInner(r,s-l,Math.max(i,l)-l,o+l)===!1||i<l&&this.left.forEachInvertedInner(r,Math.min(s,l),i,o)===!1)return!1},e.prototype.sliceInner=function(r,s){if(r==0&&s==this.length)return this;var i=this.left.length;return s<=i?this.left.slice(r,s):r>=i?this.right.slice(r-i,s-i):this.left.slice(r,i).append(this.right.slice(0,s-i))},e.prototype.leafAppend=function(r){var s=this.right.leafAppend(r);if(s)return new e(this.left,s)},e.prototype.leafPrepend=function(r){var s=this.left.leafPrepend(r);if(s)return new e(s,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(We);const pS=500;class Ot{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let s,i;n&&(s=this.remapping(r,this.items.length),i=s.maps.length);let o=e.tr,l,a,c=[],u=[];return this.items.forEach((h,p)=>{if(!h.step){s||(s=this.remapping(r,p+1),i=s.maps.length),i--,u.push(h);return}if(s){u.push(new Wt(h.map));let f=h.step.map(s.slice(i)),m;f&&o.maybeStep(f).doc&&(m=o.mapping.maps[o.mapping.maps.length-1],c.push(new Wt(m,void 0,void 0,c.length+u.length))),i--,m&&s.appendMap(m,i)}else o.maybeStep(h.step);if(h.selection)return l=s?h.selection.map(s.slice(i)):h.selection,a=new Ot(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:a,transform:o,selection:l}}addTransform(e,n,r,s){let i=[],o=this.eventCount,l=this.items,a=!s&&l.length?l.get(l.length-1):null;for(let u=0;u<e.steps.length;u++){let h=e.steps[u].invert(e.docs[u]),p=new Wt(e.mapping.maps[u],h,n),f;(f=a&&a.merge(p))&&(p=f,u?i.pop():l=l.slice(0,l.length-1)),i.push(p),n&&(o++,n=void 0),s||(a=p)}let c=o-r.depth;return c>gS&&(l=mS(l,c),o-=c),new Ot(l.append(i),o)}remapping(e,n){let r=new rs;return this.items.forEach((s,i)=>{let o=s.mirrorOffset!=null&&i-s.mirrorOffset>=e?r.maps.length-s.mirrorOffset:void 0;r.appendMap(s.map,o)},e,n),r}addMaps(e){return this.eventCount==0?this:new Ot(this.items.append(e.map(n=>new Wt(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],s=Math.max(0,this.items.length-n),i=e.mapping,o=e.steps.length,l=this.eventCount;this.items.forEach(p=>{p.selection&&l--},s);let a=n;this.items.forEach(p=>{let f=i.getMirror(--a);if(f==null)return;o=Math.min(o,f);let m=i.maps[f];if(p.step){let g=e.steps[f].invert(e.docs[f]),b=p.selection&&p.selection.map(i.slice(a+1,f));b&&l++,r.push(new Wt(m,g,b))}else r.push(new Wt(m))},s);let c=[];for(let p=n;p<o;p++)c.push(new Wt(i.maps[p]));let u=this.items.slice(0,s).append(c).append(r),h=new Ot(u,l);return h.emptyItemCount()>pS&&(h=h.compress(this.items.length-r.length)),h}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,s=[],i=0;return this.items.forEach((o,l)=>{if(l>=e)s.push(o),o.selection&&i++;else if(o.step){let a=o.step.map(n.slice(r)),c=a&&a.getMap();if(r--,c&&n.appendMap(c,r),a){let u=o.selection&&o.selection.map(n.slice(r));u&&i++;let h=new Wt(c.invert(),a,u),p,f=s.length-1;(p=s.length&&s[f].merge(h))?s[f]=p:s.push(h)}}else o.map&&r--},this.items.length,0),new Ot(We.from(s.reverse()),i)}}Ot.empty=new Ot(We.empty,0);function mS(t,e){let n;return t.forEach((r,s)=>{if(r.selection&&e--==0)return n=s,!1}),t.slice(n)}class Wt{constructor(e,n,r,s){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=s}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new Wt(n.getMap().invert(),n,this.selection)}}}class mn{constructor(e,n,r,s,i){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=s,this.prevComposition=i}}const gS=20;function bS(t,e,n,r){let s=n.getMeta(Kn),i;if(s)return s.historyState;n.getMeta(vS)&&(t=new mn(t.done,t.undone,null,0,-1));let o=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(o&&o.getMeta(Kn))return o.getMeta(Kn).redo?new mn(t.done.addTransform(n,void 0,r,Ks(e)),t.undone,od(n.mapping.maps),t.prevTime,t.prevComposition):new mn(t.done,t.undone.addTransform(n,void 0,r,Ks(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let l=n.getMeta("composition"),a=t.prevTime==0||!o&&t.prevComposition!=l&&(t.prevTime<(n.time||0)-r.newGroupDelay||!yS(n,t.prevRanges)),c=o?zo(t.prevRanges,n.mapping):od(n.mapping.maps);return new mn(t.done.addTransform(n,a?e.selection.getBookmark():void 0,r,Ks(e)),Ot.empty,c,n.time,l??t.prevComposition)}else return(i=n.getMeta("rebased"))?new mn(t.done.rebased(n,i),t.undone.rebased(n,i),zo(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new mn(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),zo(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function yS(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,s)=>{for(let i=0;i<e.length;i+=2)r<=e[i+1]&&s>=e[i]&&(n=!0)}),n}function od(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,s,i,o)=>e.push(i,o));return e}function zo(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let s=e.map(t[r],1),i=e.map(t[r+1],-1);s<=i&&n.push(s,i)}return n}function xS(t,e,n){let r=Ks(e),s=Kn.get(e).spec.config,i=(n?t.undone:t.done).popEvent(e,r);if(!i)return null;let o=i.selection.resolve(i.transform.doc),l=(n?t.done:t.undone).addTransform(i.transform,e.selection.getBookmark(),s,r),a=new mn(n?l:i.remaining,n?i.remaining:l,null,0,-1);return i.transform.setSelection(o).setMeta(Kn,{redo:n,historyState:a})}let Fo=!1,ld=null;function Ks(t){let e=t.plugins;if(ld!=e){Fo=!1,ld=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Fo=!0;break}}return Fo}const Kn=new Le("history"),vS=new Le("closeHistory");function _S(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Ae({key:Kn,state:{init(){return new mn(Ot.empty,Ot.empty,null,0,-1)},apply(e,n,r){return bS(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,s=r=="historyUndo"?yf:r=="historyRedo"?xf:null;return!s||!e.editable?!1:(n.preventDefault(),s(e.state,e.dispatch))}}}})}function bf(t,e){return(n,r)=>{let s=Kn.getState(n);if(!s||(t?s.undone:s.done).eventCount==0)return!1;if(r){let i=xS(s,n,t);i&&r(e?i.scrollIntoView():i)}return!0}}const yf=bf(!1,!0),xf=bf(!0,!0);Ie.create({name:"characterCount",addOptions(){return{limit:null,autoTrim:!0,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc;if(((t==null?void 0:t.mode)||this.options.mode)==="textSize"){const r=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(r)}return e.nodeSize},this.storage.words=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc,n=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let t=!1;return[new Ae({key:new Le("characterCount"),appendTransaction:(e,n,r)=>{if(t)return;const s=this.options.limit,i=this.options.autoTrim;if(s==null||s===0||i===!1){t=!0;return}const o=this.storage.characters({node:r.doc});if(o>s){const l=o-s,a=0,c=l;console.warn(`[CharacterCount] Initial content exceeded limit of ${s} characters. Content was automatically trimmed.`);const u=r.tr.deleteRange(a,c);return t=!0,u}t=!0},filterTransaction:(e,n)=>{const r=this.options.limit;if(!e.docChanged||r===0||r===null||r===void 0)return!0;const s=this.storage.characters({node:n.doc}),i=this.storage.characters({node:e.doc});if(i<=r||s>r&&i>r&&i<=s)return!0;if(s>r&&i>r&&i>s||!e.getMeta("paste"))return!1;const l=e.selection.$head.pos,a=i-r,c=l-a,u=l;return e.deleteRange(c,u),!(this.storage.characters({node:e.doc})>r)}})]}});var kS=Ie.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[sS(this.options)]}});Ie.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new Ae({key:new Le("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:s}=e,i=[];if(!n||!r)return Ne.create(t,[]);let o=0;this.options.mode==="deepest"&&t.descendants((a,c)=>{if(a.isText)return;if(!(s>=c&&s<=c+a.nodeSize-1))return!1;o+=1});let l=0;return t.descendants((a,c)=>{if(a.isText||!(s>=c&&s<=c+a.nodeSize-1))return!1;if(l+=1,this.options.mode==="deepest"&&o-l>0||this.options.mode==="shallowest"&&l>1)return this.options.mode==="deepest";i.push(et.node(c,c+a.nodeSize,{class:this.options.className}))}),Ne.create(t,i)}}})]}});var wS=Ie.create({name:"gapCursor",addProseMirrorPlugins(){return[aS()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=be(K(t,"allowGapCursor",n)))!=null?e:null}}}),vf="placeholder",ps=new Le("tiptap__placeholder"),ad=200;function cd(t){const{editor:e,placeholder:n,dataAttribute:r,pos:s,node:i,isEmptyDoc:o,hasAnchor:l,classes:{emptyNode:a,emptyEditor:c}}=t,u=[a];return o&&u.push(c),et.node(s,s+i.nodeSize,{class:u.join(" "),[r]:typeof n=="function"?n({editor:e,node:i,pos:s,hasAnchor:l}):n})}function CS({editor:t,options:e,dataAttribute:n,doc:r,selection:s}){var i,o;if(!(t.isEditable||!e.showOnlyWhenEditable))return null;const{anchor:a}=s,c=[],u=t.isEmpty,h={emptyEditor:e.emptyEditorClass,emptyNode:e.emptyNodeClass};if(e.showOnlyCurrent&&!e.includeChildren){const f=r.resolve(a),m=f.depth>0?f.node(1):f.nodeAfter,g=f.depth>0?f.before(1):a;if(m&&m.type.isTextblock&&us(m)){const b=a>=g&&a<=g+m.nodeSize;c.push(cd({editor:t,isEmptyDoc:u,dataAttribute:n,hasAnchor:b,placeholder:e.placeholder,classes:h,node:m,pos:g}))}}else{const f=ps.getState(t.state),m=(i=f==null?void 0:f.topPos)!=null?i:0,g=(o=f==null?void 0:f.bottomPos)!=null?o:r.content.size;r.nodesBetween(m,g,(b,y)=>{const v=a>=y&&a<=y+b.nodeSize,_=!b.isLeaf&&us(b);return b.type.isTextblock&&(v||!e.showOnlyCurrent)&&_&&c.push(cd({editor:t,isEmptyDoc:u,dataAttribute:n,hasAnchor:v,placeholder:e.placeholder,classes:h,node:b,pos:y})),e.includeChildren})}return Ne.create(r,c)}function SS(t){return t.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}function NS(t){const e=getComputedStyle(t),n=`${e.overflow} ${e.overflowY} ${e.overflowX}`;return/auto|scroll|overlay/.test(n)}function AS(t){let e=t;for(;e;){if(NS(e))return e;const n=e.parentElement;if(!n){const r=e.getRootNode();if(r instanceof ShadowRoot){e=r.host;continue}return window}e=n}return window}function TS(t){return t===window?{top:0,bottom:window.innerHeight}:t.getBoundingClientRect()}function ES({doc:t,view:e,scrollContainer:n}){const r=e.dom.getBoundingClientRect(),s=n?TS(n):{top:0,bottom:window.innerHeight},i=Math.max(r.top,s.top)-ad,o=Math.min(r.bottom,s.bottom)+ad;if(i>=o)return{top:0,bottom:t.content.size};const a=getComputedStyle(e.dom).direction==="rtl"?Math.max(r.right-2,r.left+2):r.left+2,c=e.posAtCoords({left:a,top:i+2}),u=e.posAtCoords({left:a,top:o-2});return{top:c?c.pos:0,bottom:u?u.pos:t.content.size}}var MS={init(){return{topPos:null,bottomPos:null}},apply(t,e){const n=t.getMeta(ps);return n!=null&&n.positions?{topPos:n.positions.top,bottomPos:n.positions.bottom}:t.docChanged?{topPos:e.topPos!==null?t.mapping.map(e.topPos):null,bottomPos:e.bottomPos!==null?t.mapping.map(e.bottomPos):null}:e}};function jS(t){const e=AS(t.dom),n=()=>{const l=ES({view:t,doc:t.state.doc,scrollContainer:e}),a=ps.getState(t.state);if((a==null?void 0:a.topPos)===l.top&&(a==null?void 0:a.bottomPos)===l.bottom)return;const c=t.state.tr.setMeta(ps,{positions:l});t.dispatch(c)};let r=null,s=0;const i=150,o=()=>{r===null&&(r=requestAnimationFrame(()=>{r=null;const l=performance.now();l-s>=i?(s=l,n()):o()}))};return e.addEventListener("scroll",o,{passive:!0}),n(),{update(l,a){t.state.doc.content.size!==a.doc.content.size&&o()},destroy:()=>{r!==null&&cancelAnimationFrame(r),e.removeEventListener("scroll",o)}}}function IS({editor:t,options:e}){const n=e.dataAttribute?`data-${SS(e.dataAttribute)}`:`data-${vf}`;return new Ae({key:ps,state:MS,view:jS,props:{decorations:({doc:r,selection:s})=>CS({editor:t,options:e,dataAttribute:n,doc:r,selection:s})}})}var DS=Ie.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:vf,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[IS({editor:this.editor,options:this.options})]}});Ie.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:t,options:e}=this;return[new Ae({key:new Le("selection"),props:{decorations(n){return n.selection.empty||t.isFocused||!t.isEditable||yh(n.selection)||t.view.dragging?null:Ne.create(n.doc,[et.inline(n.selection.from,n.selection.to,{class:e.className})])}}})]}});var OS="skipTrailingNode";function dd({types:t,node:e}){return e&&Array.isArray(t)&&t.includes(e.type)||(e==null?void 0:e.type)===t}var RS=Ie.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var t;const e=new Le(this.name),n=this.options.node||((t=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:t.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,s])=>s).filter(s=>(this.options.notAfter||[]).concat(n).includes(s.name));return[new Ae({key:e,appendTransaction:(s,i,o)=>{const{doc:l,tr:a,schema:c}=o,u=e.getState(o),h=l.content.size,p=c.nodes[n];if(!s.some(f=>f.getMeta(OS))&&u)return a.insert(h,p.create())},state:{init:(s,i)=>{const o=i.tr.doc.lastChild;return!dd({node:o,types:r})},apply:(s,i)=>{if(!s.docChanged||s.getMeta("__uniqueIDTransaction"))return i;const o=s.doc.lastChild;return!dd({node:o,types:r})}}})]}}),LS=Ie.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>yf(t,e),redo:()=>({state:t,dispatch:e})=>xf(t,e)}},addProseMirrorPlugins(){return[_S(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),BS=Ie.create({name:"starterKit",addExtensions(){var t,e,n,r;const s=[];return this.options.bold!==!1&&s.push(Yw.configure(this.options.bold)),this.options.blockquote!==!1&&s.push(qw.configure(this.options.blockquote)),this.options.bulletList!==!1&&s.push(tf.configure(this.options.bulletList)),this.options.code!==!1&&s.push(Zw.configure(this.options.code)),this.options.codeBlock!==!1&&s.push(nC.configure(this.options.codeBlock)),this.options.document!==!1&&s.push(rC.configure(this.options.document)),this.options.dropcursor!==!1&&s.push(kS.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&s.push(wS.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&s.push(sC.configure(this.options.hardBreak)),this.options.heading!==!1&&s.push(iC.configure(this.options.heading)),this.options.undoRedo!==!1&&s.push(LS.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&s.push(oC.configure(this.options.horizontalRule)),this.options.italic!==!1&&s.push(uC.configure(this.options.italic)),this.options.listItem!==!1&&s.push(nf.configure(this.options.listItem)),this.options.listKeymap!==!1&&s.push(cf.configure((t=this.options)==null?void 0:t.listKeymap)),this.options.link!==!1&&s.push(ef.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&s.push(uf.configure(this.options.orderedList)),this.options.paragraph!==!1&&s.push(XC.configure(this.options.paragraph)),this.options.strike!==!1&&s.push(tS.configure(this.options.strike)),this.options.text!==!1&&s.push(nS.configure(this.options.text)),this.options.underline!==!1&&s.push(pf.configure((n=this.options)==null?void 0:n.underline)),this.options.trailingNode!==!1&&s.push(RS.configure((r=this.options)==null?void 0:r.trailingNode)),s}}),$S=BS,PS=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,zS=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,FS=Kt.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:t=>t.getAttribute("data-color")||jk(t,"background-color")||t.style.backgroundColor,renderHTML:t=>t.color?{"data-color":t.color,style:`background-color: ${t.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:t}){return["mark",ve(this.options.HTMLAttributes,t),0]},renderMarkdown:(t,e)=>`==${e.renderChildren(t)}==`,parseMarkdown:(t,e)=>e.applyMark("highlight",e.parseInline(t.tokens||[])),markdownTokenizer:{name:"highlight",level:"inline",start:t=>t.indexOf("=="),tokenize(t,e,n){const s=/^(==)([^=]+)(==)/.exec(t);if(s){const i=s[2].trim(),o=n.inlineTokens(i);return{type:"highlight",raw:s[0],text:i,tokens:o}}}},addCommands(){return{setHighlight:t=>({commands:e})=>e.setMark(this.name,t),toggleHighlight:t=>({commands:e})=>e.toggleMark(this.name,t),unsetHighlight:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Zn({find:PS,type:this.type})]},addPasteRules(){return[Nn({find:zS,type:this.type})]}}),HS=FS,WS=Kt.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(t){return t!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sub",ve(this.options.HTMLAttributes,t),0]},addCommands(){return{setSubscript:()=>({commands:t})=>t.setMark(this.name),toggleSubscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSubscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),VS=WS,qS=Kt.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(t){return t!=="super"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sup",ve(this.options.HTMLAttributes,t),0]},addCommands(){return{setSuperscript:()=>({commands:t})=>t.setMark(this.name),toggleSuperscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSuperscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),US=qS,KS=Ie.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>{const e=t.style.textAlign;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:t=>t.textAlign?{style:`text-align: ${t.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.map(n=>e.updateAttributes(n,{textAlign:t})).some(n=>n):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.map(e=>t.resetAttributes(e,"textAlign")).some(e=>e),toggleTextAlign:t=>({editor:e,commands:n})=>this.options.alignments.includes(t)?e.isActive({textAlign:t})?n.unsetTextAlign():n.setTextAlign(t):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),GS=KS,JS=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,YS=ot.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",ve(this.options.HTMLAttributes,t)]},parseMarkdown:(t,e)=>e.createNode("image",{src:t.href,title:t.title,alt:t.text}),renderMarkdown:t=>{var e,n,r,s,i,o;const l=(n=(e=t.attrs)==null?void 0:e.src)!=null?n:"",a=(s=(r=t.attrs)==null?void 0:r.alt)!=null?s:"",c=(o=(i=t.attrs)==null?void 0:i.title)!=null?o:"";return c?``:``},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>"u")return null;const{directions:t,minWidth:e,minHeight:n,alwaysPreserveAspectRatio:r}=this.options.resize;return({node:s,getPos:i,HTMLAttributes:o,editor:l})=>{const a=document.createElement("img");Object.entries(o).forEach(([h,p])=>{if(p!=null)switch(h){case"width":case"height":break;default:a.setAttribute(h,p);break}}),a.src=o.src;const c=new Tk({element:a,editor:l,node:s,getPos:i,onResize:(h,p)=>{a.style.width=`${h}px`,a.style.height=`${p}px`},onCommit:(h,p)=>{const f=i();f!==void 0&&this.editor.chain().setNodeSelection(f).updateAttributes(this.name,{width:h,height:p}).run()},onUpdate:(h,p,f)=>h.type===s.type,options:{directions:t,min:{width:e,height:n},preserveAspectRatio:r===!0}}),u=c.dom;return u.style.visibility="hidden",u.style.pointerEvents="none",a.onload=()=>{u.style.visibility="",u.style.pointerEvents=""},c}},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[Rh({find:JS,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}}),QS=YS;function XS(t){var e;const{char:n,allowSpaces:r,allowToIncludeChar:s,allowedPrefixes:i,startOfLine:o,$position:l}=t,a=r&&!s,c=Mk(n),u=new RegExp(`\\s${c}$`),h=o?"^":"",p=s?"":c,f=a?new RegExp(`${h}${c}.*?(?=\\s${p}|$)`,"gm"):new RegExp(`${h}(?:^)?${c}[^\\s${p}]*`,"gm"),m=((e=l.nodeBefore)==null?void 0:e.isText)&&l.nodeBefore.text;if(!m)return null;const g=l.pos-m.length,b=Array.from(m.matchAll(f)).pop();if(!b||b.input===void 0||b.index===void 0)return null;const y=b.input.slice(Math.max(0,b.index-1),b.index),v=new RegExp(`^[${i==null?void 0:i.join("")}\0]?$`).test(y);if(i!==null&&!v)return null;const _=g+b.index;let w=_+b[0].length;return a&&u.test(m.slice(w-1,w+1))&&(b[0]+=" ",w+=1),_<l.pos&&w>=l.pos?{range:{from:_,to:w},query:b[0].slice(n.length),text:b[0]}:null}function ZS(t){return t.docChanged?t.steps.some(e=>{const n=e.slice;if(!(n!=null&&n.content))return!1;const r=n.content.textBetween(0,n.content.size,`
|
|
174
|
-
`);return/\s/.test(r)}):!1}var eN=new Le("suggestion");function tN({pluginKey:t=eN,editor:e,char:n="@",allowSpaces:r=!1,allowToIncludeChar:s=!1,allowedPrefixes:i=[" "],startOfLine:o=!1,decorationTag:l="span",decorationClass:a="suggestion",decorationContent:c="",decorationEmptyClass:u="is-empty",command:h=()=>null,items:p=()=>[],render:f=()=>({}),allow:m=()=>!0,findSuggestionMatch:g=XS,shouldShow:b,shouldResetDismissed:y}){let v;const _=f==null?void 0:f(),w=r&&!s,k=()=>{const S=e.state.selection.$anchor.pos,T=e.view.coordsAtPos(S),{top:P,right:L,bottom:R,left:H}=T;try{return new DOMRect(H,P,L-H,R-P)}catch{return null}},C=(S,T)=>T?()=>{const P=t.getState(e.state),L=P==null?void 0:P.decorationId,R=S.dom.querySelector(`[data-decoration-id="${L}"]`);return(R==null?void 0:R.getBoundingClientRect())||null}:k,N=({match:S,dismissedRange:T,state:P,transaction:L})=>y!=null&&y({editor:e,state:P,range:T,match:S,transaction:L,allowSpaces:w})?!1:w?S.range.from===T.from:S.range.from===T.from&&!ZS(L);function O(S,T){var P;try{const R=t.getState(S.state),H=R!=null&&R.decorationId?S.dom.querySelector(`[data-decoration-id="${R.decorationId}"]`):null,U={editor:e,range:(R==null?void 0:R.range)||{from:0,to:0},query:(R==null?void 0:R.query)||null,text:(R==null?void 0:R.text)||null,items:[],command:M=>h({editor:e,range:(R==null?void 0:R.range)||{from:0,to:0},props:M}),decorationNode:H,clientRect:C(S,H)};(P=_==null?void 0:_.onExit)==null||P.call(_,U)}catch{}const L=S.state.tr.setMeta(T,{exit:!0});S.dispatch(L)}const B=new Ae({key:t,view(){return{update:async(S,T)=>{var P,L,R,H,U,M,$;const W=(P=this.key)==null?void 0:P.getState(T),ie=(L=this.key)==null?void 0:L.getState(S.state),ce=W.active&&ie.active&&W.range.from!==ie.range.from,Te=!W.active&&ie.active,q=W.active&&!ie.active,he=!Te&&!q&&W.query!==ie.query,j=Te||ce&&he,Y=he||ce,te=q||ce&&he;if(!j&&!Y&&!te)return;const Ye=te&&!j?W:ie,ht=S.dom.querySelector(`[data-decoration-id="${Ye.decorationId}"]`);v={editor:e,range:Ye.range,query:Ye.query,text:Ye.text,items:[],command:Bt=>h({editor:e,range:Ye.range,props:Bt}),decorationNode:ht,clientRect:C(S,ht)},j&&((R=_==null?void 0:_.onBeforeStart)==null||R.call(_,v)),Y&&((H=_==null?void 0:_.onBeforeUpdate)==null||H.call(_,v)),(Y||j)&&(v.items=await p({editor:e,query:Ye.query})),te&&((U=_==null?void 0:_.onExit)==null||U.call(_,v)),Y&&((M=_==null?void 0:_.onUpdate)==null||M.call(_,v)),j&&(($=_==null?void 0:_.onStart)==null||$.call(_,v))},destroy:()=>{var S;v&&((S=_==null?void 0:_.onExit)==null||S.call(_,v))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1,dismissedRange:null}},apply(S,T,P,L){const{isEditable:R}=e,{composing:H}=e.view,{selection:U}=S,{empty:M,from:$}=U,W={...T},ie=S.getMeta(t);if(ie&&ie.exit)return W.active=!1,W.decorationId=null,W.range={from:0,to:0},W.query=null,W.text=null,W.dismissedRange=T.active?{...T.range}:T.dismissedRange,W;if(W.composing=H,S.docChanged&&W.dismissedRange!==null&&(W.dismissedRange={from:S.mapping.map(W.dismissedRange.from),to:S.mapping.map(W.dismissedRange.to)}),R&&(M||e.view.composing)){($<T.range.from||$>T.range.to)&&!H&&!T.composing&&(W.active=!1);const ce=g({char:n,allowSpaces:r,allowToIncludeChar:s,allowedPrefixes:i,startOfLine:o,$position:U.$from}),Te=`id_${Math.floor(Math.random()*4294967295)}`;ce&&m({editor:e,state:L,range:ce.range,isActive:T.active})&&(!b||b({editor:e,range:ce.range,query:ce.query,text:ce.text,transaction:S}))?(W.dismissedRange!==null&&!N({match:ce,dismissedRange:W.dismissedRange,state:L,transaction:S})&&(W.dismissedRange=null),W.dismissedRange===null?(W.active=!0,W.decorationId=T.decorationId?T.decorationId:Te,W.range=ce.range,W.query=ce.query,W.text=ce.text):W.active=!1):(ce||(W.dismissedRange=null),W.active=!1)}else W.active=!1;return W.active||(W.decorationId=null,W.range={from:0,to:0},W.query=null,W.text=null),W}},props:{handleKeyDown(S,T){var P,L;const{active:R,range:H}=B.getState(S.state);if(!R)return!1;if(T.key==="Escape"||T.key==="Esc"){const M=B.getState(S.state);return(P=_==null?void 0:_.onKeyDown)==null||P.call(_,{view:S,event:T,range:M.range}),O(S,t),!0}return((L=_==null?void 0:_.onKeyDown)==null?void 0:L.call(_,{view:S,event:T,range:H}))||!1},decorations(S){const{active:T,range:P,decorationId:L,query:R}=B.getState(S);if(!T)return null;const H=!(R!=null&&R.length),U=[a];return H&&U.push(u),Ne.create(S.doc,[et.inline(P.from,P.to,{nodeName:l,class:U.join(" "),"data-decoration-id":L,"data-decoration-content":c})])}}});return B}function nN({editor:t,overrideSuggestionOptions:e,extensionName:n,char:r="@"}){const s=new Le;return{editor:t,char:r,pluginKey:s,command:({editor:i,range:o,props:l})=>{var a,c,u;const h=i.view.state.selection.$to.nodeAfter;((a=h==null?void 0:h.text)==null?void 0:a.startsWith(" "))&&(o.to+=1),i.chain().focus().insertContentAt(o,[{type:n,attrs:{...l,mentionSuggestionChar:r}},{type:"text",text:" "}]).run(),(u=(c=i.view.dom.ownerDocument.defaultView)==null?void 0:c.getSelection())==null||u.collapseToEnd()},allow:({state:i,range:o})=>{const l=i.doc.resolve(o.from),a=i.schema.nodes[n];return!!l.parent.type.contentMatch.matchType(a)},...e}}function _f(t){return(t.options.suggestions.length?t.options.suggestions:[t.options.suggestion]).map(e=>nN({editor:t.editor,overrideSuggestionOptions:e,extensionName:t.name,char:e.char}))}function ud(t,e){const n=_f(t),r=n.find(s=>s.char===e);return r||(n.length?n[0]:null)}var rN=ot.create({name:"mention",priority:101,addOptions(){return{HTMLAttributes:{},renderText({node:t,suggestion:e}){var n,r;return`${(n=e==null?void 0:e.char)!=null?n:"@"}${(r=t.attrs.label)!=null?r:t.attrs.id}`},deleteTriggerWithBackspace:!1,renderHTML({options:t,node:e,suggestion:n}){var r,s;return["span",ve(this.HTMLAttributes,t.HTMLAttributes),`${(r=n==null?void 0:n.char)!=null?r:"@"}${(s=e.attrs.label)!=null?s:e.attrs.id}`]},suggestions:[],suggestion:{}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes(){return{id:{default:null,parseHTML:t=>t.getAttribute("data-id"),renderHTML:t=>t.id?{"data-id":t.id}:{}},label:{default:null,parseHTML:t=>t.getAttribute("data-label"),renderHTML:t=>t.label?{"data-label":t.label}:{}},mentionSuggestionChar:{default:"@",parseHTML:t=>t.getAttribute("data-mention-suggestion-char"),renderHTML:t=>({"data-mention-suggestion-char":t.mentionSuggestionChar})}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:t,HTMLAttributes:e}){const n=ud(this,t.attrs.mentionSuggestionChar);if(this.options.renderLabel!==void 0)return console.warn("renderLabel is deprecated use renderText and renderHTML instead"),["span",ve({"data-type":this.name},this.options.HTMLAttributes,e),this.options.renderLabel({options:this.options,node:t,suggestion:n})];const r={...this.options};r.HTMLAttributes=ve({"data-type":this.name},this.options.HTMLAttributes,e);const s=this.options.renderHTML({options:r,node:t,suggestion:n});return typeof s=="string"?["span",ve({"data-type":this.name},this.options.HTMLAttributes,e),s]:s},...Lh({nodeName:"mention",name:"@",selfClosing:!0,allowedAttributes:["id","label",{name:"mentionSuggestionChar",skipIfDefault:"@"}],parseAttributes:t=>{const e={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=n.exec(t);for(;r!==null;){const[,s,i,o]=r,l=i??o;e[s==="char"?"mentionSuggestionChar":s]=l,r=n.exec(t)}return e},serializeAttributes:t=>Object.entries(t).filter(([,e])=>e!=null).map(([e,n])=>`${e==="mentionSuggestionChar"?"char":e}="${n}"`).join(" ")}),renderText({node:t}){const e={options:this.options,node:t,suggestion:ud(this,t.attrs.mentionSuggestionChar)};return this.options.renderLabel!==void 0?(console.warn("renderLabel is deprecated use renderText and renderHTML instead"),this.options.renderLabel(e)):this.options.renderText(e)},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:t,state:e})=>{let n=!1;const{selection:r}=e,{empty:s,anchor:i}=r;if(!s)return!1;let o=new Mt,l=0;return e.doc.nodesBetween(i-1,i,(a,c)=>{if(a.type.name===this.name)return n=!0,o=a,l=c,!1}),n&&t.insertText(this.options.deleteTriggerWithBackspace?"":o.attrs.mentionSuggestionChar,l,l+o.nodeSize),n})}},addProseMirrorPlugins(){return _f(this).map(tN)}}),sN=rN;const iN="_dropdown_rtanl_1",oN="_item_rtanl_14",lN="_itemSelected_rtanl_32",aN="_empty_rtanl_37",Or={dropdown:iN,item:oN,itemSelected:lN,empty:aN},kf=x.forwardRef(({items:t,command:e},n)=>{const[r,s]=x.useState(0);return x.useEffect(()=>s(0),[t]),x.useImperativeHandle(n,()=>({onKeyDown(i){if(i.key==="ArrowUp")return t.length&&s(o=>(o+t.length-1)%t.length),!0;if(i.key==="ArrowDown")return t.length&&s(o=>(o+1)%t.length),!0;if(i.key==="Enter"){const o=t[r];return o&&e(o),!0}return!1}})),t.length?d.jsx("div",{className:Or.dropdown,children:t.map((i,o)=>d.jsx("button",{type:"button",className:[Or.item,o===r?Or.itemSelected:""].filter(Boolean).join(" "),onMouseEnter:()=>s(o),onClick:()=>e(i),children:i.label},i.id))}):d.jsx("div",{className:Or.dropdown,children:d.jsx("div",{className:Or.empty,children:"No results"})})});kf.displayName="MentionList";const cN="_root_8iz1d_7",dN="_labelRow_8iz1d_15",uN="_label_8iz1d_15",hN="_required_8iz1d_25",fN="_outer_8iz1d_32",pN="_inner_8iz1d_40",mN="_innerDisabled_8iz1d_50",gN="_innerInvalid_8iz1d_50",bN="_innerWithCounter_8iz1d_84",yN="_innerWithToolbar_8iz1d_89",xN="_toolbar_8iz1d_95",vN="_innerOnFocusMode_8iz1d_107",_N="_toolbarAbsolute_8iz1d_112",kN="_toolbarHidden_8iz1d_121",wN="_editorOnFocusTransition_8iz1d_127",CN="_toolbarBtn_8iz1d_132",SN="_toolbarBtnActive_8iz1d_157",NN="_labelBold_8iz1d_166",AN="_labelItalic_8iz1d_167",TN="_labelUnderline_8iz1d_168",EN="_labelStrike_8iz1d_169",MN="_labelHeading_8iz1d_170",jN="_labelSubscript_8iz1d_171",IN="_labelSuperscript_8iz1d_172",DN="_divider_8iz1d_175",ON="_urlBar_8iz1d_185",RN="_urlInput_8iz1d_193",LN="_urlConfirm_8iz1d_212",BN="_urlCancel_8iz1d_213",$N="_editor_8iz1d_127",PN="_editorWithInnerCounter_8iz1d_340",zN="_counter_8iz1d_351",FN="_counterInside_8iz1d_359",HN="_bottomRow_8iz1d_372",WN="_helperText_8iz1d_378",VN="_errorText_8iz1d_384 _helperText_8iz1d_378",oe={root:cN,labelRow:dN,label:uN,required:hN,outer:fN,inner:pN,innerDisabled:mN,innerInvalid:gN,innerWithCounter:bN,innerWithToolbar:yN,toolbar:xN,innerOnFocusMode:vN,toolbarAbsolute:_N,toolbarHidden:kN,editorOnFocusTransition:wN,toolbarBtn:CN,toolbarBtnActive:SN,labelBold:NN,labelItalic:AN,labelUnderline:TN,labelStrike:EN,labelHeading:MN,labelSubscript:jN,labelSuperscript:IN,divider:DN,urlBar:ON,urlInput:RN,urlConfirm:LN,urlCancel:BN,editor:$N,editorWithInnerCounter:PN,counter:zN,counterInside:FN,bottomRow:HN,helperText:WN,errorText:VN};function Oe({label:t,active:e,onAction:n,disabled:r,children:s}){return d.jsx(er,{content:t,placement:"top",delay:300,children:d.jsx("button",{type:"button",className:[oe.toolbarBtn,e?oe.toolbarBtnActive:""].filter(Boolean).join(" "),onMouseDown:i=>{i.preventDefault(),n()},"aria-label":t,"aria-pressed":e,disabled:r,children:s})})}const qN=[{id:"1",label:"John Smith (Borrower)"},{id:"2",label:"Jane Doe (Co-Borrower)"},{id:"3",label:"Mike Johnson (Loan Officer)"},{id:"4",label:"Sarah Lee (Processor)"},{id:"5",label:"TitleCo Inc. (Title Company)"},{id:"6",label:"First National Bank (Lender)"},{id:"7",label:"Apex Appraisals (Appraiser)"}];function UN(t){return{items:async({query:e})=>{const n=t??qN,r=typeof n=="function"?await n(e):n,s=e.toLowerCase();return r.filter(i=>i.label.toLowerCase().includes(s)).slice(0,8)},render:()=>{let e=null,n=null;const r=s=>{const i=s.clientRect,o=i==null?void 0:i();o&&n&&(n.style.top=`${o.bottom+window.scrollY+4}px`,n.style.left=`${o.left+window.scrollX}px`)};return{onStart(s){n=document.createElement("div"),n.style.cssText="position:absolute;z-index:9999;",document.body.appendChild(n),e=new Hw(kf,{props:s,editor:s.editor}),n.appendChild(e.element),r(s)},onUpdate(s){e==null||e.updateProps(s),r(s)},onKeyDown({event:s}){var i;return((i=e==null?void 0:e.ref)==null?void 0:i.onKeyDown(s))??!1},onExit(){n==null||n.remove(),e==null||e.destroy(),n=null,e=null}}}}}const wf=x.forwardRef((t,e)=>{const{label:n,showLabel:r=!0,required:s,helperText:i,helperTextContent:o="Helper text",invalid:l,disabled:a,placeholder:c,defaultValue:u,onChange:h,maxLength:p,counterPlacement:f="outside",toolbarMode:m="always",showBold:g,showItalic:b,showUnderline:y,showStrike:v,showCode:_,showHighlight:w,showSubscript:k,showSuperscript:C,showHeading:N,headingLevels:O=[1,2,3],showBlockquote:B,showCodeBlock:S,showBulletList:T,showOrderedList:P,showTaskList:L,showHorizontalRule:R,showTextAlign:H,showLink:U,showImage:M,showMention:$,showUndo:W,showRedo:ie,mentionSuggestions:ce,className:Te,style:q,...he}=t,j=x.useId(),Y=`${j}-helper`,te=!!i,[Ye,ht]=x.useState(!1),[Bt,Dt]=x.useState(!1),[rr,an]=x.useState(!1),[$t,Pt]=x.useState(""),Gt=x.useRef(null),wr=Bt||rr,[sr,Cr]=x.useState(0),G=Lw({extensions:[$S.configure({link:!1,underline:!1}),rS,HS,VS,US,ff,hf.configure({nested:!0}),GS.configure({types:["heading","paragraph"]}),BC.configure({openOnClick:!1}),QS,sN.configure({suggestion:UN(ce)}),DS.configure({placeholder:c??""})],content:u,editable:!a,onUpdate({editor:re}){h==null||h(re.getHTML()),Cr(re.getText().length)}});function D(){!G||!$t.trim()||(G.chain().focus().setLink({href:$t.trim()}).run(),Dt(!1),Pt(""))}function ee(){!G||!$t.trim()||(G.chain().focus().setImage({src:$t.trim()}).run(),an(!1),Pt(""))}function ge(){Dt(!1),an(!1),Pt(""),G==null||G.commands.focus()}const ke=g||b||y||v||_||w||k||C,vt=N||B||S,ft=T||P||L||R,Jt=H,Sr=U||M||$,Nr=W||ie,cn=ke||vt||ft||Jt||Sr||Nr,A=m==="on-focus",V=cn&&A&&!Ye,de=[ke,vt,ft,Jt,Sr,Nr];function ne(re){return!!de[re]&&de.slice(re+1).some(Boolean)}const De=typeof p=="number",_t=f==="inside",_s=[oe.inner,l?oe.innerInvalid:"",a?oe.innerDisabled:"",_t&&De?oe.innerWithCounter:"",cn&&!A?oe.innerWithToolbar:"",cn&&A?oe.innerOnFocusMode:""].filter(Boolean).join(" "),to=[oe.editor,_t&&De?oe.editorWithInnerCounter:""].filter(Boolean).join(" ");return d.jsxs("div",{ref:e,className:[oe.root,Te??""].filter(Boolean).join(" "),style:q,...he,children:[n&&r&&d.jsxs("div",{className:oe.labelRow,children:[d.jsx("label",{className:oe.label,htmlFor:`${j}-editor`,children:n}),s&&d.jsx("span",{className:oe.required,"aria-hidden":"true",children:"*"})]}),d.jsxs("div",{className:oe.outer,children:[d.jsxs("div",{className:_s,onFocus:()=>ht(!0),onBlur:re=>{re.currentTarget.contains(re.relatedTarget)||ht(!1)},children:[cn&&G&&d.jsxs("div",{className:[oe.toolbar,A?oe.toolbarAbsolute:"",V?oe.toolbarHidden:""].filter(Boolean).join(" "),role:"toolbar","aria-label":"Text formatting","aria-hidden":V||void 0,children:[ke&&d.jsxs(d.Fragment,{children:[g&&d.jsx(Oe,{label:"Bold",active:G.isActive("bold"),onAction:()=>G.chain().focus().toggleBold().run(),disabled:a,children:d.jsx("span",{className:oe.labelBold,children:"B"})}),b&&d.jsx(Oe,{label:"Italic",active:G.isActive("italic"),onAction:()=>G.chain().focus().toggleItalic().run(),disabled:a,children:d.jsx("span",{className:oe.labelItalic,children:"I"})}),y&&d.jsx(Oe,{label:"Underline",active:G.isActive("underline"),onAction:()=>G.chain().focus().toggleUnderline().run(),disabled:a,children:d.jsx("span",{className:oe.labelUnderline,children:"U"})}),v&&d.jsx(Oe,{label:"Strikethrough",active:G.isActive("strike"),onAction:()=>G.chain().focus().toggleStrike().run(),disabled:a,children:d.jsx("span",{className:oe.labelStrike,children:"S"})}),_&&d.jsx(Oe,{label:"Inline code",active:G.isActive("code"),onAction:()=>G.chain().focus().toggleCode().run(),disabled:a,children:d.jsx("i",{className:"pi pi-code","aria-hidden":"true"})}),w&&d.jsx(Oe,{label:"Highlight",active:G.isActive("highlight"),onAction:()=>G.chain().focus().toggleHighlight().run(),disabled:a,children:d.jsx("i",{className:"pi pi-pencil","aria-hidden":"true"})}),k&&d.jsx(Oe,{label:"Subscript",active:G.isActive("subscript"),onAction:()=>G.chain().focus().toggleSubscript().run(),disabled:a,children:d.jsx("span",{className:oe.labelSubscript,children:"x₂"})}),C&&d.jsx(Oe,{label:"Superscript",active:G.isActive("superscript"),onAction:()=>G.chain().focus().toggleSuperscript().run(),disabled:a,children:d.jsx("span",{className:oe.labelSuperscript,children:"x²"})})]}),ne(0)&&d.jsx("span",{className:oe.divider}),vt&&d.jsxs(d.Fragment,{children:[N&&O.map(re=>d.jsx(Oe,{label:`Heading ${re}`,active:G.isActive("heading",{level:re}),onAction:()=>G.chain().focus().toggleHeading({level:re}).run(),disabled:a,children:d.jsxs("span",{className:oe.labelHeading,children:["H",re]})},re)),B&&d.jsx(Oe,{label:"Blockquote",active:G.isActive("blockquote"),onAction:()=>G.chain().focus().toggleBlockquote().run(),disabled:a,children:d.jsx("i",{className:"pi pi-comment","aria-hidden":"true"})}),S&&d.jsx(Oe,{label:"Code block",active:G.isActive("codeBlock"),onAction:()=>G.chain().focus().toggleCodeBlock().run(),disabled:a,children:d.jsx("i",{className:"pi pi-code","aria-hidden":"true"})})]}),ne(1)&&d.jsx("span",{className:oe.divider}),ft&&d.jsxs(d.Fragment,{children:[T&&d.jsx(Oe,{label:"Bullet list",active:G.isActive("bulletList"),onAction:()=>G.chain().focus().toggleBulletList().run(),disabled:a,children:d.jsx("i",{className:"pi pi-list","aria-hidden":"true"})}),P&&d.jsx(Oe,{label:"Ordered list",active:G.isActive("orderedList"),onAction:()=>G.chain().focus().toggleOrderedList().run(),disabled:a,children:d.jsx("i",{className:"pi pi-sort-amount-down-alt","aria-hidden":"true"})}),L&&d.jsx(Oe,{label:"Task list",active:G.isActive("taskList"),onAction:()=>G.chain().focus().toggleTaskList().run(),disabled:a,children:d.jsx("i",{className:"pi pi-check-square","aria-hidden":"true"})}),R&&d.jsx(Oe,{label:"Horizontal rule",onAction:()=>G.chain().focus().setHorizontalRule().run(),disabled:a,children:d.jsx("i",{className:"pi pi-minus","aria-hidden":"true"})})]}),ne(2)&&d.jsx("span",{className:oe.divider}),Jt&&H&&d.jsx(d.Fragment,{children:["left","center","right","justify"].map(re=>d.jsx(Oe,{label:`Align ${re}`,active:G.isActive({textAlign:re}),onAction:()=>G.chain().focus().setTextAlign(re).run(),disabled:a,children:d.jsx("i",{className:`pi pi-align-${re}`,"aria-hidden":"true"})},re))}),ne(3)&&d.jsx("span",{className:oe.divider}),Sr&&d.jsxs(d.Fragment,{children:[U&&d.jsx(Oe,{label:"Link",active:G.isActive("link"),onAction:()=>{G.isActive("link")?G.chain().focus().unsetLink().run():(an(!1),Dt(!0),Pt(""),requestAnimationFrame(()=>{var re;return(re=Gt.current)==null?void 0:re.focus()}))},disabled:a,children:d.jsx("i",{className:"pi pi-link","aria-hidden":"true"})}),M&&d.jsx(Oe,{label:"Image",onAction:()=>{Dt(!1),an(!0),Pt(""),requestAnimationFrame(()=>{var re;return(re=Gt.current)==null?void 0:re.focus()})},disabled:a,children:d.jsx("i",{className:"pi pi-image","aria-hidden":"true"})}),$&&d.jsx(Oe,{label:"Mention",onAction:()=>G.chain().focus().insertContent("@").run(),disabled:a,children:d.jsx("i",{className:"pi pi-at","aria-hidden":"true"})})]}),ne(4)&&d.jsx("span",{className:oe.divider}),Nr&&d.jsxs(d.Fragment,{children:[W&&d.jsx(Oe,{label:"Undo",onAction:()=>G.chain().focus().undo().run(),disabled:a||!G.can().undo(),children:d.jsx("i",{className:"pi pi-undo","aria-hidden":"true"})}),ie&&d.jsx(Oe,{label:"Redo",onAction:()=>G.chain().focus().redo().run(),disabled:a||!G.can().redo(),children:d.jsx("i",{className:"pi pi-refresh","aria-hidden":"true"})})]})]}),wr&&d.jsxs("div",{className:oe.urlBar,children:[d.jsx("input",{ref:Gt,type:"url",className:oe.urlInput,value:$t,onChange:re=>Pt(re.target.value),placeholder:Bt?"https://example.com":"Image URL…",onKeyDown:re=>{re.key==="Enter"&&(re.preventDefault(),Bt?D():ee()),re.key==="Escape"&&ge()}}),d.jsx("button",{type:"button",className:oe.urlConfirm,onMouseDown:re=>{re.preventDefault(),Bt?D():ee()},children:d.jsx("i",{className:"pi pi-check","aria-hidden":"true"})}),d.jsx("button",{type:"button",className:oe.urlCancel,onMouseDown:re=>{re.preventDefault(),ge()},children:d.jsx("i",{className:"pi pi-times","aria-hidden":"true"})})]}),d.jsx("div",{id:`${j}-editor`,className:[to,A&&cn?oe.editorOnFocusTransition:""].filter(Boolean).join(" "),style:A&&cn?{paddingTop:Ye?48:9}:void 0,"aria-label":!r&&n?n:void 0,"aria-required":s||void 0,"aria-invalid":l||void 0,"aria-describedby":[te?Y:"",De?`${j}-counter`:""].filter(Boolean).join(" ")||void 0,onClick:re=>{re.target===re.currentTarget&&(G==null||G.chain().focus("end").run())},children:d.jsx(Ph,{editor:G})}),_t&&De&&d.jsxs("span",{id:`${j}-counter`,className:oe.counterInside,"aria-live":"polite",children:[sr,"/",p]})]}),(te||!_t&&De)&&d.jsxs("div",{className:oe.bottomRow,children:[te?d.jsx("span",{id:Y,className:l?oe.errorText:oe.helperText,children:o}):d.jsx("span",{}),!_t&&De&&d.jsxs("span",{id:`${j}-counter`,className:oe.counter,"aria-live":"polite",children:[sr,"/",p]})]})]})]})});wf.displayName="RichTextEditor";const KN="_wrapper_17bsd_10",GN="_disabled_17bsd_18",JN="_input_17bsd_24",YN="_track_17bsd_38",QN="_thumb_17bsd_53",XN="_labelText_17bsd_125",ZN="_helperText_17bsd_139",In={wrapper:KN,disabled:GN,input:JN,track:YN,thumb:QN,labelText:XN,helperText:ZN},Cf=x.forwardRef(({label:t,helperText:e,disabled:n=!1,id:r,className:s,...i},o)=>{const l=x.useRef(null),a=o??l,c=[In.wrapper,n?In.disabled:"",s??""].filter(Boolean).join(" ");return d.jsxs("div",{children:[d.jsxs("label",{className:c,htmlFor:r,children:[d.jsx("input",{ref:a,type:"checkbox",id:r,disabled:n,className:In.input,role:"switch",...i}),d.jsx("span",{className:In.track,"aria-hidden":"true",children:d.jsx("span",{className:In.thumb})}),t&&d.jsx("span",{className:In.labelText,children:t})]}),e&&d.jsx("span",{className:In.helperText,children:e})]})});Cf.displayName="ToggleSwitch";const eA="_btn_1pyug_10",tA="_disabled_1pyug_28",nA="_sm_1pyug_34",rA="_md_1pyug_40",sA="_lg_1pyug_46",iA="_primary_1pyug_56",oA="_secondary_1pyug_82",lA="_ghost_1pyug_110",aA="_danger_1pyug_133",cA="_link_1pyug_156",dA="_linkLabel_1pyug_181",uA="_icon_1pyug_189",hA="_badge_1pyug_204",Zt={btn:eA,disabled:tA,sm:nA,md:rA,lg:sA,primary:iA,secondary:oA,ghost:lA,danger:aA,link:cA,linkLabel:dA,icon:uA,badge:hA},Fe=x.forwardRef(({variant:t="primary",size:e="md",leadingIcon:n,trailingIcon:r,badge:s,children:i,className:o,disabled:l,...a},c)=>{const u=[Zt.btn,Zt[t],Zt[e],l?Zt.disabled:"",o??""].filter(Boolean).join(" ");return d.jsxs("button",{ref:c,className:u,disabled:l,...a,children:[n&&d.jsx("span",{className:Zt.icon,"aria-hidden":"true",children:n}),t==="link"?d.jsx("span",{className:Zt.linkLabel,children:i}):d.jsx("span",{className:Zt.label,children:i}),s!==void 0&&d.jsx("span",{className:Zt.badge,"aria-label":`${s} notifications`,children:s}),r&&d.jsx("span",{className:Zt.icon,"aria-hidden":"true",children:r})]})});Fe.displayName="Button";const fA="_root_1jl5o_6",pA="_btn_1jl5o_13",mA="_disabled_1jl5o_30",gA="_sm_1jl5o_35",bA="_md_1jl5o_36",yA="_lg_1jl5o_37",xA="_primary_1jl5o_40",vA="_btnOpen_1jl5o_44",_A="_secondary_1jl5o_46",kA="_ghost_1jl5o_52",wA="_danger_1jl5o_58",CA="_icon_1jl5o_65",SA="_chevron_1jl5o_73",NA="_dropdown_1jl5o_98",AA="_item_1jl5o_115",TA="_itemDisabled_1jl5o_130",EA="_itemIcon_1jl5o_143",MA="_divider_1jl5o_153",rt={root:fA,btn:pA,disabled:mA,sm:gA,md:bA,lg:yA,primary:xA,btnOpen:vA,secondary:_A,ghost:kA,danger:wA,icon:CA,chevron:SA,dropdown:NA,item:AA,itemDisabled:TA,itemIcon:EA,divider:MA},$i=x.forwardRef(({label:t,items:e,onSelect:n,variant:r="primary",size:s="md",leadingIcon:i,disabled:o,className:l,style:a,...c},u)=>{const[h,p]=x.useState(!1),f=x.useRef(null),m=y=>{f.current=y,typeof u=="function"?u(y):u&&(u.current=y)};x.useEffect(()=>{if(!h)return;function y(v){var _;(_=f.current)!=null&&_.contains(v.target)||p(!1)}return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[h]),x.useEffect(()=>{if(!h)return;function y(v){v.key==="Escape"&&p(!1)}return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[h]);function g(y){y.disabled||(n==null||n(y.value),p(!1))}const b=[rt.btn,rt[r],rt[s],h?rt.btnOpen:"",o?rt.disabled:""].filter(Boolean).join(" ");return d.jsxs("div",{ref:m,className:[rt.root,l??""].filter(Boolean).join(" "),style:a,children:[d.jsxs("button",{type:"button",className:b,disabled:o,onClick:()=>!o&&p(y=>!y),"aria-haspopup":"menu","aria-expanded":h,...c,children:[i&&d.jsx("span",{className:rt.icon,"aria-hidden":"true",children:i}),d.jsx("span",{className:rt.label,children:t}),d.jsx("span",{className:rt.chevron,"aria-hidden":"true",children:d.jsx("i",{className:"pi pi-chevron-down"})})]}),h&&d.jsx("div",{role:"menu",className:rt.dropdown,children:e.map((y,v)=>d.jsxs("div",{children:[y.divider&&d.jsx("div",{className:rt.divider,role:"separator"}),d.jsxs("div",{role:"menuitem","aria-disabled":y.disabled||void 0,className:[rt.item,y.disabled?rt.itemDisabled:""].filter(Boolean).join(" "),onClick:()=>g(y),tabIndex:y.disabled?-1:0,onKeyDown:_=>{(_.key==="Enter"||_.key===" ")&&!y.disabled&&(_.preventDefault(),g(y))},children:[y.icon&&d.jsx("span",{className:rt.itemIcon,"aria-hidden":"true",children:y.icon}),d.jsx("span",{className:rt.itemLabel,children:y.label})]})]},y.value??v))})]})});$i.displayName="DropdownButton";const jA="_btn_12vzq_7",IA="_sm_12vzq_24",DA="_md_12vzq_30",OA="_lg_12vzq_36",RA="_disabled_12vzq_44",Ho={btn:jA,sm:IA,md:DA,lg:OA,disabled:RA},Lt=x.forwardRef(({"aria-label":t="Close",size:e="sm",className:n,disabled:r,...s},i)=>{const o=[Ho.btn,Ho[e],r?Ho.disabled:"",n??""].filter(Boolean).join(" ");return d.jsx(er,{content:t,placement:"top",children:d.jsx("button",{ref:i,type:"button","aria-label":t,className:o,disabled:r,...s,children:d.jsx("i",{className:"pi pi-times","aria-hidden":"true"})})})});Lt.displayName="CloseButton";const LA="_root_1f5g5_9",BA="_main_1f5g5_17",$A="_disabled_1f5g5_38",PA="_primaryMain_1f5g5_47",zA="_secondaryMain_1f5g5_59",FA="_trigger_1f5g5_72",HA="_primaryTrigger_1f5g5_94",WA="_secondaryTrigger_1f5g5_105",VA="_chevron_1f5g5_117",qA="_triggerOpen_1f5g5_125",UA="_icon_1f5g5_131",KA="_mainSm_1f5g5_140",GA="_triggerSm_1f5g5_147",JA="_mainLg_1f5g5_152",YA="_triggerLg_1f5g5_159",QA="_dropdown_1f5g5_187",XA="_item_1f5g5_202",ZA="_itemDisabled_1f5g5_217",eT="_itemIcon_1f5g5_230",ze={root:LA,main:BA,disabled:$A,primaryMain:PA,secondaryMain:zA,trigger:FA,primaryTrigger:HA,secondaryTrigger:WA,chevron:VA,triggerOpen:qA,icon:UA,mainSm:KA,triggerSm:GA,mainLg:JA,triggerLg:YA,dropdown:QA,item:XA,itemDisabled:ZA,itemIcon:eT},fa=x.forwardRef(({label:t,onAction:e,items:n,onSelect:r,variant:s="primary",size:i="md",leadingIcon:o,disabled:l=!1,triggerAriaLabel:a="More options",className:c,style:u},h)=>{const[p,f]=x.useState(!1),m=x.useRef(null),g=_=>{m.current=_,typeof h=="function"?h(_):h&&(h.current=_)};x.useEffect(()=>{if(!p)return;function _(w){var k;(k=m.current)!=null&&k.contains(w.target)||f(!1)}return document.addEventListener("mousedown",_),()=>document.removeEventListener("mousedown",_)},[p]),x.useEffect(()=>{if(!p)return;function _(w){w.key==="Escape"&&f(!1)}return document.addEventListener("keydown",_),()=>document.removeEventListener("keydown",_)},[p]);function b(_){_.disabled||(r==null||r(_.value),f(!1))}const y=[ze.main,ze[`${s}Main`],i==="sm"?ze.mainSm:i==="lg"?ze.mainLg:"",l?ze.disabled:""].filter(Boolean).join(" "),v=[ze.trigger,ze[`${s}Trigger`],i==="sm"?ze.triggerSm:i==="lg"?ze.triggerLg:"",p?ze.triggerOpen:"",l?ze.disabled:""].filter(Boolean).join(" ");return d.jsxs("div",{ref:g,className:[ze.root,c??""].filter(Boolean).join(" "),style:u,children:[d.jsxs("button",{type:"button",className:y,onClick:()=>!l&&(e==null?void 0:e()),disabled:l,children:[o&&d.jsx("span",{className:ze.icon,"aria-hidden":"true",children:o}),d.jsx("span",{className:ze.label,children:t})]}),d.jsx(er,{content:a,placement:"top",children:d.jsx("button",{type:"button",className:v,onClick:()=>!l&&f(_=>!_),disabled:l,"aria-haspopup":"menu","aria-expanded":p,"aria-label":a,children:d.jsx("span",{className:ze.chevron,"aria-hidden":"true",children:d.jsx("i",{className:"pi pi-chevron-down"})})})}),p&&d.jsx("div",{role:"menu",className:ze.dropdown,children:n.map((_,w)=>d.jsxs("div",{role:"menuitem","aria-disabled":_.disabled||void 0,className:[ze.item,_.disabled?ze.itemDisabled:""].filter(Boolean).join(" "),onClick:()=>b(_),tabIndex:_.disabled?-1:0,onKeyDown:k=>{(k.key==="Enter"||k.key===" ")&&!_.disabled&&(k.preventDefault(),b(_))},children:[_.icon&&d.jsx("span",{className:ze.itemIcon,"aria-hidden":"true",children:_.icon}),d.jsx("span",{children:_.label})]},_.value??w))})]})});fa.displayName="SplitButton";const tT="_container_1ieud_9",nT="_containerFull_1ieud_20",rT="_navBtn_1ieud_29",sT="_navBtnDisabled_1ieud_46",iT="_navBtnSelected_1ieud_56",oT="_navBtnContent_1ieud_79",lT="_pageNumber_1ieud_90",aT="_ellipsis_1ieud_100",cT="_reportText_1ieud_116",dT="_fullLeft_1ieud_129",uT="_fullRight_1ieud_135",hT="_rowsLabel_1ieud_141",fT="_entriesCount_1ieud_149",bt={container:tT,containerFull:nT,navBtn:rT,navBtnDisabled:sT,navBtnSelected:iT,navBtnContent:oT,pageNumber:lT,ellipsis:aT,reportText:cT,fullLeft:dT,fullRight:uT,rowsLabel:hT,entriesCount:fT};function pT(t,e,n){if(e<=n+2)return Array.from({length:e},(l,a)=>a+1);const r=Math.floor(n/2);let s=Math.max(1,t-r),i=Math.min(e,s+n-1);i-s<n-1&&(s=Math.max(1,i-n+1));const o=[];s>1&&(o.push(1),s>2&&o.push("..."));for(let l=s;l<=i;l++)o.push(l);return i<e&&(i<e-1&&o.push("..."),o.push(e)),o}const Sf=()=>d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M10 3L6 7l4 4M5 3v8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Nf=()=>d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M9 3L5 7l4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Af=()=>d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M5 3l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Tf=()=>d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M4 3l4 4-4 4M9 3v8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function nn({onClick:t,disabled:e,selected:n,"aria-label":r,children:s}){const i=[bt.navBtn,n?bt.navBtnSelected:"",e?bt.navBtnDisabled:""].filter(Boolean).join(" ");return d.jsx("button",{type:"button",className:i,onClick:t,disabled:e,"aria-label":r,"aria-current":n?"page":void 0,children:d.jsx("span",{className:bt.navBtnContent,children:s})})}function hd({currentPage:t,totalPages:e,pageLinkSize:n,onPage:r}){const s=pT(t,e,n);return d.jsxs(d.Fragment,{children:[d.jsx(nn,{onClick:()=>r(0),disabled:t===0,"aria-label":"First page",children:d.jsx(Sf,{})}),d.jsx(nn,{onClick:()=>r(t-1),disabled:t===0,"aria-label":"Previous page",children:d.jsx(Nf,{})}),s.map((i,o)=>i==="..."?d.jsx("span",{className:bt.ellipsis,children:"…"},`ellipsis-${o}`):d.jsx(nn,{onClick:()=>r(i-1),selected:i-1===t,"aria-label":`Page ${i}`,children:d.jsx("span",{className:bt.pageNumber,children:i})},i)),d.jsx(nn,{onClick:()=>r(t+1),disabled:t>=e-1,"aria-label":"Next page",children:d.jsx(Af,{})}),d.jsx(nn,{onClick:()=>r(e-1),disabled:t>=e-1,"aria-label":"Last page",children:d.jsx(Tf,{})})]})}const Ef=x.forwardRef(({totalRecords:t,first:e,rows:n,onPageChange:r,template:s="pages",rowsPerPageOptions:i=[10,25,50,100],pageLinkSize:o=5,className:l,style:a},c)=>{const u=Math.max(1,Math.ceil(t/n)),h=Math.floor(e/n);function p(v){const _=Math.max(0,Math.min(v,u-1));r({first:_*n,rows:n,page:_})}function f(v){r({first:0,rows:v,page:0})}const m=i.map(v=>({label:String(v),value:String(v)})),g=t===0?0:e+1,b=Math.min(e+n,t),y=[bt.container,s==="full"?bt.containerFull:"",l??""].filter(Boolean).join(" ");return s==="report"?d.jsxs("div",{ref:c,className:y,style:a,role:"navigation","aria-label":"Pagination",children:[d.jsx(nn,{onClick:()=>p(0),disabled:h===0,"aria-label":"First page",children:d.jsx(Sf,{})}),d.jsx(nn,{onClick:()=>p(h-1),disabled:h===0,"aria-label":"Previous page",children:d.jsx(Nf,{})}),d.jsxs("span",{className:bt.reportText,children:["Showing ",g," to ",b," of ",t," entries"]}),d.jsx(nn,{onClick:()=>p(h+1),disabled:h>=u-1,"aria-label":"Next page",children:d.jsx(Af,{})}),d.jsx(nn,{onClick:()=>p(u-1),disabled:h>=u-1,"aria-label":"Last page",children:d.jsx(Tf,{})})]}):s==="full"?d.jsxs("div",{ref:c,className:y,style:a,role:"navigation","aria-label":"Pagination",children:[d.jsxs("div",{className:bt.fullLeft,children:[d.jsx("span",{className:bt.rowsLabel,children:"Results per page:"}),d.jsx(pr,{options:m,value:String(n),onChange:v=>v&&f(Number(v)),size:"sm",style:{width:80}}),d.jsxs("span",{className:bt.entriesCount,children:[b-g+(t>0?1:0)," entries"]})]}),d.jsx("div",{className:bt.fullRight,children:d.jsx(hd,{currentPage:h,totalPages:u,pageLinkSize:o,onPage:p})})]}):d.jsxs("div",{ref:c,className:y,style:a,role:"navigation","aria-label":"Pagination",children:[d.jsx(hd,{currentPage:h,totalPages:u,pageLinkSize:o,onPage:p}),d.jsx(pr,{options:m,value:String(n),onChange:v=>v&&f(Number(v)),size:"sm",style:{width:80}})]})});Ef.displayName="Paginator";const mT="_root_6qfeg_8",gT="_panel_6qfeg_17",bT="_panelHeader_6qfeg_31",yT="_filterWrap_6qfeg_47",xT="_filterIcon_6qfeg_55",vT="_filterInput_6qfeg_63",_T="_filterClear_6qfeg_79",kT="_list_6qfeg_98",wT="_item_6qfeg_110",CT="_itemDisabled_6qfeg_124",ST="_itemSelected_6qfeg_133",NT="_itemContent_6qfeg_148",AT="_itemIcon_6qfeg_156",TT="_itemLabel_6qfeg_162",ET="_checkbox_6qfeg_174",MT="_checkboxChecked_6qfeg_188",jT="_checkboxDisabled_6qfeg_193",IT="_checkmark_6qfeg_198",DT="_controls_6qfeg_211",OT="_ctrlBtn_6qfeg_223",RT="_ctrlBtnDisabled_6qfeg_248",Re={root:mT,panel:gT,panelHeader:bT,filterWrap:yT,filterIcon:xT,filterInput:vT,filterClear:_T,list:kT,item:wT,itemDisabled:CT,itemSelected:ST,itemContent:NT,itemIcon:AT,itemLabel:TT,checkbox:ET,checkboxChecked:MT,checkboxDisabled:jT,checkmark:IT,controls:DT,ctrlBtn:OT,ctrlBtnDisabled:RT},LT=()=>d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M5 3l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),BT=()=>d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M2 3l4 4-4 4M7 3l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),$T=()=>d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M9 3L5 7l4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),PT=()=>d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M12 3L8 7l4 4M7 3L3 7l4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),zT=()=>d.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:[d.jsx("circle",{cx:"5.5",cy:"5.5",r:"3.5",stroke:"currentColor",strokeWidth:"1.5"}),d.jsx("path",{d:"M8.5 8.5L11 11",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),FT=()=>d.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:d.jsx("path",{d:"M2 2l8 8M10 2L2 10",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})});function HT({checked:t,disabled:e}){return d.jsx("span",{className:[Re.checkbox,t?Re.checkboxChecked:"",e?Re.checkboxDisabled:""].filter(Boolean).join(" "),"aria-hidden":"true",children:t&&d.jsx("svg",{className:Re.checkmark,viewBox:"0 0 11 11",children:d.jsx("polyline",{points:"1.5,5.5 4.5,8.5 9.5,2.5"})})})}function Fs({onClick:t,disabled:e,"aria-label":n,children:r}){return d.jsx("button",{type:"button",className:[Re.ctrlBtn,e?Re.ctrlBtnDisabled:""].filter(Boolean).join(" "),onClick:t,disabled:e,"aria-label":n,children:r})}function fd({header:t,items:e,selectedIds:n,onToggle:r,itemTemplate:s,filter:i,filterValue:o,onFilterChange:l,filterPlaceholder:a="Filter...",showCheckbox:c=!0,ariaLabel:u}){const h=x.useMemo(()=>{if(!i||!o.trim())return e;const p=o.toLowerCase();return e.filter(f=>String(f.label??"").toLowerCase().includes(p))},[e,i,o]);return d.jsxs("div",{className:Re.panel,children:[t!=null&&d.jsx("div",{className:Re.panelHeader,children:t}),i&&d.jsxs("div",{className:Re.filterWrap,children:[d.jsx("span",{className:Re.filterIcon,children:d.jsx(zT,{})}),d.jsx("input",{type:"text",className:Re.filterInput,value:o,onChange:p=>l(p.target.value),placeholder:a,"aria-label":`Filter ${u}`}),o&&d.jsx("button",{type:"button",className:Re.filterClear,onClick:()=>l(""),"aria-label":"Clear filter",children:d.jsx(FT,{})})]}),d.jsx("ul",{className:Re.list,role:"listbox","aria-label":u,"aria-multiselectable":"true",children:h.map(p=>{const f=n.has(p.id);return d.jsxs("li",{role:"option","aria-selected":f,"aria-disabled":p.disabled||void 0,className:[Re.item,f?Re.itemSelected:"",p.disabled?Re.itemDisabled:""].filter(Boolean).join(" "),onClick:()=>!p.disabled&&r(p.id),tabIndex:p.disabled?-1:0,onKeyDown:m=>{(m.key===" "||m.key==="Enter")&&!p.disabled&&(m.preventDefault(),r(p.id))},children:[c&&d.jsx(HT,{checked:f,disabled:p.disabled}),s?s(p):d.jsxs("span",{className:Re.itemContent,children:[p.icon&&d.jsx("i",{className:`${p.icon} ${Re.itemIcon}`,"aria-hidden":"true"}),d.jsx("span",{className:Re.itemLabel,children:p.label})]})]},p.id)})})]})}const Mf=x.forwardRef(({sourceItems:t,targetItems:e,onChange:n,sourceHeader:r,targetHeader:s,itemTemplate:i,filter:o=!1,sourceFilterPlaceholder:l,targetFilterPlaceholder:a,showMoveAll:c=!0,showCheckbox:u=!0,className:h,style:p},f)=>{const[m,g]=x.useState(new Set),[b,y]=x.useState(new Set),[v,_]=x.useState(""),[w,k]=x.useState("");function C(U){g(M=>{const $=new Set(M);return $.has(U)?$.delete(U):$.add(U),$})}function N(U){y(M=>{const $=new Set(M);return $.has(U)?$.delete(U):$.add(U),$})}function O(){const U=t.filter($=>m.has($.id)),M=t.filter($=>!m.has($.id));n({source:M,target:[...e,...U]}),g(new Set)}function B(){const U=t.filter($=>!$.disabled),M=t.filter($=>$.disabled);n({source:M,target:[...e,...U]}),g(new Set)}function S(){const U=e.filter($=>b.has($.id)),M=e.filter($=>!b.has($.id));n({source:[...t,...U],target:M}),y(new Set)}function T(){const U=e.filter($=>!$.disabled),M=e.filter($=>$.disabled);n({source:[...t,...U],target:M}),y(new Set)}const P=m.size>0,L=b.size>0,R=t.some(U=>!U.disabled),H=e.some(U=>!U.disabled);return d.jsxs("div",{ref:f,className:[Re.root,h??""].filter(Boolean).join(" "),style:p,children:[d.jsx(fd,{header:r,items:t,selectedIds:m,onToggle:C,itemTemplate:i,filter:o,filterValue:v,onFilterChange:_,filterPlaceholder:l,showCheckbox:u,ariaLabel:"Source list"}),d.jsxs("div",{className:Re.controls,role:"group","aria-label":"Move controls",children:[c&&d.jsx(Fs,{onClick:B,disabled:!R,"aria-label":"Move all to target",children:d.jsx(BT,{})}),d.jsx(Fs,{onClick:O,disabled:!P,"aria-label":"Move selected to target",children:d.jsx(LT,{})}),d.jsx(Fs,{onClick:S,disabled:!L,"aria-label":"Move selected to source",children:d.jsx($T,{})}),c&&d.jsx(Fs,{onClick:T,disabled:!H,"aria-label":"Move all to source",children:d.jsx(PT,{})})]}),d.jsx(fd,{header:s,items:e,selectedIds:b,onToggle:N,itemTemplate:i,filter:o,filterValue:w,onFilterChange:k,filterPlaceholder:a,showCheckbox:u,ariaLabel:"Target list"})]})});Mf.displayName="Picklist";const WT="_card_9z683_6",VT="_cardClickable_9z683_17",qT="_body_9z683_35",UT="_caption_9z683_45",KT="_title_9z683_53",GT="_subTitle_9z683_62",JT="_content_9z683_71",YT="_footer_9z683_79",un={card:WT,cardClickable:VT,body:qT,caption:UT,title:KT,subTitle:GT,content:JT,footer:YT},jf=x.forwardRef(({title:t,subTitle:e,footer:n,children:r,onClick:s,className:i,style:o},l)=>{const a=s!=null,c=t!=null||e!=null||r!=null;return d.jsx("div",{ref:l,className:[un.card,a?un.cardClickable:"",i??""].filter(Boolean).join(" "),style:o,onClick:s,role:a?"button":void 0,tabIndex:a?0:void 0,onKeyDown:a?u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),s==null||s(u))}:void 0,children:d.jsxs("div",{className:un.body,children:[c&&d.jsxs("div",{className:un.caption,children:[t!=null&&d.jsx("div",{className:un.title,children:t}),e!=null&&d.jsx("div",{className:un.subTitle,children:e}),r!=null&&d.jsx("div",{className:un.content,children:r})]}),n!=null&&d.jsx("div",{className:un.footer,children:n})]})})});jf.displayName="Card";const QT="_accordion_7a03y_6",XT="_item_7a03y_16",ZT="_itemDisabled_7a03y_21",eE="_header_7a03y_28",tE="_titleGroup_7a03y_52",nE="_title_7a03y_52",rE="_badge_7a03y_71",sE="_headerRight_7a03y_90",iE="_headerAction_7a03y_97",oE="_chevron_7a03y_105",lE="_chevronOpen_7a03y_114",aE="_contentOuter_7a03y_120",cE="_contentOpen_7a03y_126",dE="_contentInner_7a03y_130",uE="_variant_simple_7a03y_139",hE="_contentBody_7a03y_164",fE="_variant_page_7a03y_173",pE="_variant_panel_7a03y_211",mE="_variant_flyout_7a03y_246",qe={accordion:QT,item:XT,itemDisabled:ZT,header:eE,titleGroup:tE,title:nE,badge:rE,headerRight:sE,headerAction:iE,chevron:oE,chevronOpen:lE,contentOuter:aE,contentOpen:cE,contentInner:dE,variant_simple:uE,contentBody:hE,variant_page:fE,variant_panel:pE,variant_flyout:mE},If=x.forwardRef(({items:t,variant:e="page",openIds:n,onChange:r,multiple:s=!1,className:i,style:o},l)=>{const a=c=>{const u=n.includes(c);r(s?u?n.filter(h=>h!==c):[...n,c]:u?[]:[c])};return d.jsx("div",{ref:l,className:[qe.accordion,qe[`variant_${e}`],i??""].filter(Boolean).join(" "),style:o,children:t.map(c=>{const u=n.includes(c.id),h=`accordion-header-${c.id}`,p=`accordion-panel-${c.id}`,f=(e==="panel"||e==="flyout")&&c.badge!=null,m=e==="panel"||e==="flyout";return d.jsxs("div",{className:[qe.item,u?qe.itemOpen:"",c.disabled?qe.itemDisabled:""].filter(Boolean).join(" "),children:[d.jsxs("button",{id:h,className:qe.header,"aria-expanded":u,"aria-controls":p,disabled:c.disabled,onClick:()=>a(c.id),children:[d.jsxs("span",{className:qe.titleGroup,children:[d.jsx("span",{className:qe.title,children:c.title}),f&&d.jsx("span",{className:qe.badge,children:c.badge})]}),d.jsxs("span",{className:qe.headerRight,children:[c.headerAction!=null&&d.jsx("span",{className:qe.headerAction,onClick:g=>g.stopPropagation(),children:c.headerAction}),d.jsx("span",{className:[qe.chevron,u?qe.chevronOpen:""].join(" "),children:d.jsx("i",{className:m?"pi pi-angle-down":"pi pi-chevron-down"})})]})]}),d.jsx("div",{id:p,role:"region","aria-labelledby":h,className:[qe.contentOuter,u?qe.contentOpen:""].join(" "),children:d.jsx("div",{className:qe.contentInner,children:d.jsx("div",{className:qe.contentBody,children:c.content})})})]},c.id)})})});If.displayName="Accordion";const gE="_tabs_sya1k_6",bE="_tablist_sya1k_14",yE="_tab_sya1k_6",xE="_tabIcon_sya1k_51",vE="_tabLabel_sya1k_61",_E="_tabPipe_sya1k_67",kE="_tabCount_sya1k_77",wE="_tabDisabled_sya1k_86",CE="_tabActive_sya1k_86",SE="_panel_sya1k_117",NE="_nav_sya1k_128",Ct={tabs:gE,tablist:bE,tab:yE,tabIcon:xE,tabLabel:vE,tabPipe:_E,tabCount:kE,tabDisabled:wE,tabActive:CE,panel:SE,nav:NE},Df=x.forwardRef(({tabs:t,activeTab:e,onChange:n,variant:r="panel",className:s,style:i},o)=>{const l=t.find(u=>u.id===e),a=r==="nav",c=a?"nav":"div";return d.jsxs(c,{ref:o,className:[Ct.tabs,a?Ct.nav:"",s??""].filter(Boolean).join(" "),style:i,children:[d.jsx("div",{className:Ct.tablist,role:a?void 0:"tablist",children:t.map(u=>{const h=u.id===e,p=`tabpanel-${u.id}`,f=`tab-${u.id}`;return d.jsxs("button",{id:f,role:a?void 0:"tab","aria-selected":a?void 0:h,"aria-current":a&&h?"page":void 0,"aria-disabled":u.disabled,"aria-controls":a?void 0:p,disabled:u.disabled,className:[Ct.tab,h?Ct.tabActive:"",u.disabled?Ct.tabDisabled:""].filter(Boolean).join(" "),onClick:()=>{u.disabled||n(u.id)},children:[u.icon!=null&&d.jsx("span",{className:Ct.tabIcon,children:u.icon}),d.jsx("span",{className:Ct.tabLabel,children:u.label}),u.icon2!=null&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:Ct.tabPipe,children:"|"}),d.jsx("span",{className:Ct.tabIcon,children:u.icon2})]}),u.count!=null&&d.jsx("span",{className:Ct.tabCount,children:u.count})]},u.id)})}),!a&&l!=null&&l.content!=null&&d.jsx("div",{id:`tabpanel-${l.id}`,role:"tabpanel","aria-labelledby":`tab-${l.id}`,className:Ct.panel,children:l.content})]})});Df.displayName="Tabs";const AE="_bannerTabs_1emwd_6",TE="_track_1emwd_15",EE="_card_1emwd_31",ME="_cardDisabled_1emwd_55",jE="_cardActive_1emwd_55",IE="_labelRow_1emwd_88",DE="_label_1emwd_88",OE="_labelSep_1emwd_103",RE="_lockIcon_1emwd_110",LE="_statusIndicator_1emwd_117",BE="_subtitle_1emwd_123",$E="_docs_1emwd_133",PE="_badgeGroups_1emwd_139",zE="_badgeGroupWrap_1emwd_146",FE="_badgeGroup_1emwd_139",HE="_badgeGroupPipe_1emwd_160",WE="_badge_1emwd_139",VE="_badgeShape_1emwd_182",qE="_badgeShapeCircle_1emwd_189",UE="_badgeShapeDiamond_1emwd_194",KE="_badgeNum_1emwd_202",GE="_arrow_1emwd_239",JE="_arrowLeft_1emwd_270",YE="_arrowRight_1emwd_274",QE="_fadeMask_1emwd_280",me={bannerTabs:AE,track:TE,card:EE,cardDisabled:ME,cardActive:jE,labelRow:IE,label:DE,labelSep:OE,lockIcon:RE,statusIndicator:LE,subtitle:BE,docs:$E,badgeGroups:PE,badgeGroupWrap:zE,badgeGroup:FE,badgeGroupPipe:HE,badge:WE,badgeShape:VE,badgeShapeCircle:qE,badgeShapeDiamond:UE,badgeNum:KE,arrow:GE,arrowLeft:JE,arrowRight:YE,fadeMask:QE},XE={green:"#66BB5F",yellow:"#F5C664",red:"#E53935",gray:"transparent"},ZE={green:"#66BB5F",yellow:"#F5C664",red:"#E53935",gray:"#94A3B8"};function pd({shape:t,color:e}){const n=XE[e],r=ZE[e],s=9;return t==="dot"?d.jsx("span",{className:me.statusIndicator,style:{width:s,height:s,borderRadius:"50%",background:n,border:`1px solid ${r}`,flexShrink:0}}):t==="diamond"?d.jsx("span",{className:me.statusIndicator,style:{width:s,height:s,background:n,border:`1px solid ${r}`,transform:"rotate(45deg)",flexShrink:0}}):t==="square"?d.jsx("span",{className:me.statusIndicator,style:{width:s,height:s,background:n,border:`1px solid ${r}`,flexShrink:0}}):d.jsx("span",{className:me.statusIndicator,style:{width:s,height:s,borderRadius:"50%",background:"transparent",border:"1.5px solid #94A3B8",flexShrink:0}})}const eM=[{shape:"square",color:"var(--red-500, #EB1000)"},{shape:"diamond",color:"var(--yellow-500, #FBDE0B)"},{shape:"circle",color:"var(--green-300, #6FB864)"}],tM=[{shape:"square",color:"var(--teal-600, #138890)"},{shape:"square",color:"var(--green-600, #22A34A)"},{shape:"square",color:"var(--teal-500, #32A4AC)"}],nM="var(--surface-500, #ADB5BD)";function rM({shape:t,color:e,count:n,tooltip:r,diamondGroup0:s}){const i=n===0,o=i?nM:e,l=i?"var(--navy-900, #0D1117)":s?"var(--navy-800, #171D22)":"#ffffff";return d.jsxs("span",{className:me.badge,"data-tooltip":r,children:[d.jsx("span",{className:[me.badgeShape,t==="circle"?me.badgeShapeCircle:"",t==="diamond"?me.badgeShapeDiamond:""].filter(Boolean).join(" "),style:{background:o}}),d.jsx("span",{className:me.badgeNum,style:{color:l},children:n})]})}const pa=x.forwardRef(({items:t,activeId:e,onChange:n,className:r,style:s},i)=>{const o=x.useRef(null),[l,a]=x.useState(!1),[c,u]=x.useState(!1),h=x.useCallback(()=>{const f=o.current;f!=null&&(a(f.scrollLeft>0),u(f.scrollLeft+f.clientWidth<f.scrollWidth-1))},[]);x.useEffect(()=>{const f=o.current;if(f==null)return;h(),f.addEventListener("scroll",h,{passive:!0});const m=new ResizeObserver(h);return m.observe(f),()=>{f.removeEventListener("scroll",h),m.disconnect()}},[h]);const p=f=>{var m;(m=o.current)==null||m.scrollBy({left:f==="left"?-200:200,behavior:"smooth"})};return d.jsxs("div",{ref:i,className:[me.bannerTabs,r??""].filter(Boolean).join(" "),style:s,children:[l&&d.jsx("button",{className:[me.arrow,me.arrowLeft].join(" "),onClick:()=>p("left"),"aria-label":"Scroll left",tabIndex:-1,children:d.jsx("i",{className:"pi pi-chevron-left"})}),d.jsx("div",{className:me.track,ref:o,children:t.map(f=>{const m=f.id===e;return d.jsxs("button",{className:[me.card,m?me.cardActive:"",f.disabled?me.cardDisabled:""].filter(Boolean).join(" "),onClick:()=>{f.disabled||n(f.id)},disabled:f.disabled,"aria-pressed":m,"aria-disabled":f.disabled,children:[d.jsxs("div",{className:me.labelRow,children:[d.jsx(pd,{shape:f.status.shape,color:f.status.color}),d.jsx("span",{className:me.label,children:f.label}),f.subLabel!=null&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:me.labelSep,children:"/"}),f.subStatus!=null&&d.jsx(pd,{shape:f.subStatus.shape,color:f.subStatus.color}),d.jsx("span",{className:me.label,children:f.subLabel})]}),f.locked&&d.jsx("i",{className:`pi pi-lock ${me.lockIcon}`})]}),d.jsx("div",{className:me.subtitle,children:f.subtitle}),f.badgeGroups!=null&&f.badgeGroups.length>0&&d.jsx("div",{className:me.badgeGroups,children:f.badgeGroups.map((g,b)=>d.jsxs("div",{className:me.badgeGroupWrap,children:[b>0&&d.jsx("span",{className:me.badgeGroupPipe,children:"|"}),d.jsx("div",{className:me.badgeGroup,children:g.badges.map((y,v)=>{const w=(b===0?eM:tM)[v]??{shape:"square",color:"var(--teal-600, #138890)"},k=y.shape??w.shape;return d.jsx(rM,{shape:k,color:y.color??w.color,count:y.count,tooltip:y.tooltip,diamondGroup0:b===0&&k==="diamond"},v)})})]},b))}),f.docs!=null&&d.jsx("div",{className:me.docs,children:f.docs})]},f.id)})}),c&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:me.fadeMask}),d.jsx("button",{className:[me.arrow,me.arrowRight].join(" "),onClick:()=>p("right"),"aria-label":"Scroll right",tabIndex:-1,children:d.jsx("i",{className:"pi pi-chevron-right"})})]})]})});pa.displayName="BannerTabs";const sM="_overlay_54tc7_3",iM="_overlayOpen_54tc7_17",oM="_drawer_54tc7_34",lM="_side_right_54tc7_44",aM="_side_left_54tc7_49",cM="_open_54tc7_54",dM="_header_54tc7_60",uM="_headerTitle_54tc7_69",hM="_title_54tc7_77",fM="_subtitle_54tc7_85",pM="_body_54tc7_95",mM="_footer_54tc7_105",gM="_footerShadow_54tc7_117",bM="_tertiaryGroup_54tc7_128",mt={overlay:sM,overlayOpen:iM,drawer:oM,side_right:lM,side_left:aM,open:cM,header:dM,headerTitle:uM,title:hM,subtitle:fM,body:pM,footer:mM,footerShadow:gM,tertiaryGroup:bM},Of=x.forwardRef(({isOpen:t,onClose:e,title:n,subtitle:r,children:s,primaryAction:i,secondaryAction:o,tertiaryActions:l,side:a="right",width:c=800,className:u,style:h},p)=>{const f=x.useRef(null),[m,g]=x.useState(!1);x.useEffect(()=>{if(!t)return;const _=w=>{w.key==="Escape"&&e()};return document.addEventListener("keydown",_),()=>document.removeEventListener("keydown",_)},[t,e]);const b=x.useCallback(()=>{const _=f.current;if(!_){g(!1);return}const w=_.scrollHeight-_.scrollTop-_.clientHeight>2;g(w)},[]);x.useEffect(()=>{if(!t)return;const _=requestAnimationFrame(b),w=f.current;if(!w)return;w.addEventListener("scroll",b);const k=new ResizeObserver(b);return k.observe(w),()=>{cancelAnimationFrame(_),w.removeEventListener("scroll",b),k.disconnect()}},[t,b]);const y=[mt.drawer,mt[`side_${a}`],t?mt.open:"",u??""].filter(Boolean).join(" "),v=[mt.overlay,t?mt.overlayOpen:""].filter(Boolean).join(" ");return Ut.createPortal(d.jsx("div",{className:v,"data-side":a,onClick:t?e:void 0,"aria-hidden":!t,children:d.jsxs("div",{ref:p,role:"dialog","aria-modal":"true","aria-label":n??"Drawer",className:y,style:{width:c,...h},onClick:_=>_.stopPropagation(),children:[d.jsxs("div",{className:mt.header,children:[d.jsxs("div",{className:mt.headerTitle,children:[n&&d.jsx("span",{className:mt.title,children:n}),r&&d.jsx("div",{className:mt.subtitle,children:r})]}),d.jsx(Lt,{"aria-label":"Close drawer",onClick:e})]}),d.jsx("div",{ref:f,className:mt.body,children:s}),d.jsxs("div",{className:mt.footer,children:[m&&d.jsx("div",{className:mt.footerShadow,"aria-hidden":"true"}),l&&l.length>0&&d.jsx("div",{className:mt.tertiaryGroup,children:l.map((_,w)=>d.jsx(Fe,{variant:"ghost",size:"md",onClick:_.onClick,disabled:_.disabled,children:_.label},w))}),o&&d.jsx(Fe,{variant:"secondary",size:"md",onClick:o.onClick,disabled:o.disabled,children:o.label}),d.jsx(Fe,{variant:"primary",size:"md",onClick:i.onClick,disabled:i.disabled,children:i.label})]})]})}),document.body)});Of.displayName="Drawer";const yM="_container_7u9if_3",xM="_toast_7u9if_17",vM="_toastEnter_7u9if_52",_M="_toastExit_7u9if_56",kM="_content_7u9if_62",wM="_contentVertical_7u9if_69",CM="_contentHorizontal_7u9if_74",SM="_icon_7u9if_82",NM="_text_7u9if_91",AM="_textVertical_7u9if_96",TM="_textHorizontal_7u9if_102",EM="_title_7u9if_110",MM="_detail_7u9if_118",gt={container:yM,toast:xM,toastEnter:vM,toastExit:_M,content:kM,contentVertical:wM,contentHorizontal:CM,icon:SM,text:NM,textVertical:AM,textHorizontal:TM,title:EM,detail:MM},Cl=new Set;let Hn=[];function Sl(){Cl.forEach(t=>t([...Hn]))}function Rf(t){Hn=Hn.map(e=>e.id===t?{...e,exiting:!0}:e),Sl(),setTimeout(()=>{Hn=Hn.filter(e=>e.id!==t),Sl()},300)}function Hs(t,e,n,r={}){const s={id:crypto.randomUUID(),severity:t,title:e,detail:n,layout:r.layout??"horizontal",duration:r.duration??5e3};Hn=[...Hn,s],Sl(),s.duration>0&&setTimeout(()=>Rf(s.id),s.duration)}const jM={success:(t,e,n)=>Hs("success",t,e,n),info:(t,e,n)=>Hs("info",t,e,n),warn:(t,e,n)=>Hs("warn",t,e,n),error:(t,e,n)=>Hs("error",t,e,n)},IM={success:{icon:"pi-check",bgVar:"--green-50",borderVar:"--green-700",titleVar:"--green-700",iconVar:"--green-600"},info:{icon:"pi-info-circle",bgVar:"--blue-50",borderVar:"--blue-600",titleVar:"--blue-600",iconVar:"--blue-600"},warn:{icon:"pi-exclamation-triangle",bgVar:"--yellow-50",borderVar:"--yellow-800",titleVar:"--yellow-800",iconVar:"--yellow-600"},error:{icon:"pi-times-circle",bgVar:"--red-50",borderVar:"--red-600",titleVar:"--red-600",iconVar:"--red-500"}},DM={success:{bg:"#edf8ea",border:"#1a760b",title:"#1a760b",icon:"#16a34a"},info:{bg:"#f5f9ff",border:"#326fd1",title:"#326fd1",icon:"#2563eb"},warn:{bg:"#fffce7",border:"#695d05",title:"#695d05",icon:"#ca8a04"},error:{bg:"#fff5f5",border:"#d60f00",title:"#d60f00",icon:"#dc2626"}};function Lf({id:t,severity:e,title:n,detail:r,layout:s="horizontal",exiting:i,onClose:o}){const l=IM[e],a=DM[e],c=`toast-desc-${t}`,u=s==="vertical",h={"--t-bg":`var(${l.bgVar}, ${a.bg})`,"--t-border":`var(${l.borderVar}, ${a.border})`,"--t-title":`var(${l.titleVar}, ${a.title})`,"--t-icon":`var(${l.iconVar}, ${a.icon})`};return d.jsx("div",{role:"alert","aria-live":"assertive","aria-atomic":"true","aria-describedby":r?c:void 0,className:[gt.toast,i?gt.toastExit:gt.toastEnter].join(" "),style:h,children:d.jsxs("div",{className:[gt.content,u?gt.contentVertical:gt.contentHorizontal].join(" "),children:[d.jsx("i",{className:`pi ${l.icon} ${gt.icon}`,"aria-hidden":"true"}),d.jsxs("div",{className:[gt.text,u?gt.textVertical:gt.textHorizontal].join(" "),children:[d.jsx("span",{className:gt.title,children:n}),r&&d.jsx("span",{id:c,className:gt.detail,children:r})]}),d.jsx(Lt,{"aria-label":"Dismiss notification",onClick:o})]})})}function Bf(){const[t,e]=x.useState([]);return x.useEffect(()=>(Cl.add(e),()=>{Cl.delete(e)}),[]),t.length===0?null:Ut.createPortal(d.jsx("div",{className:gt.container,"aria-label":"Notifications",children:t.map(n=>d.jsx(Lf,{...n,onClose:()=>Rf(n.id)},n.id))}),document.body)}Bf.displayName="Toaster";function $f({severity:t,title:e,detail:n,layout:r="horizontal",onClose:s}){const i=x.useId();return d.jsx(Lf,{id:i,severity:t,title:e,detail:n,layout:r,onClose:s??(()=>{})})}$f.displayName="Toast";const OM="_wrapper_ety4d_1",RM="_track_ety4d_10",LM="_trackError_ety4d_18",BM="_fill_ety4d_24",$M="_errorMessage_ety4d_37",Rr={wrapper:OM,track:RM,trackError:LM,fill:BM,errorMessage:$M};function Pf({value:t,max:e=100,error:n=!1,errorMessage:r,"aria-label":s}){const i=Math.min(Math.max(t,0),e),o=e>0?i/e*100:0;return d.jsxs("div",{className:Rr.wrapper,children:[d.jsx("div",{role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":e,"aria-label":s,className:[Rr.track,n?Rr.trackError:""].join(" ").trim(),children:!n&&d.jsx("div",{className:Rr.fill,style:{width:`${o}%`}})}),n&&r&&d.jsx("p",{className:Rr.errorMessage,children:r})]})}Pf.displayName="ProgressBar";const PM="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAfCAYAAAD0ma06AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAOdEVYdFNvZnR3YXJlAEZpZ21hnrGWYwAABe9JREFUeAG9VwlslEUUfm/m/7e7LbCFlqsSEJRgFNREkGI5ypEgRBI5FkjEasEggiwtpTc123Jsa3VbLDXWGORspIUoRoJQg0AJh0GCSJBIEQNoLErva7v/zPj+LVQKLeVIfckmM2/mf9+75r23CPdJNlfWgEBdmySRvYioBisF/RBQgoJyyaAMpTrRpGlHGxOd1+4lBzsDsrs9UzjyeFBqlJTyImN4XgKrBpDAkfWQSj3LQA1XAAEkzEsaHKC7n1amxH3zQID27OzB6NM8DFUAyd5cceb4biguFu3d7Zu9NajZ99cEkNoyxtkkBcpKlpfWC1+0Ny3hUqeAdveHs7nCOcgx40Zi7C+3n4W5CgIboMESUGf4yj+Ir7/z254ZnhFcx3USYAZJr5UCUqtSY/M6BLSv88xlGj5RmRjrNvdWt2eIDXAeRWscMAwHUD1bLyusUAjnQMl9AmFXTfLKMj/f5WJ2S3ASR5UOiFxJuboyZeX6uwAD1+aNDODGsMrk2B2Baz20htWI7BWKCYdOCcmTsLNOqIzmtBavBK/PdVJIcmjJCDSlMjXOrbW6IjPTLpUvuDIptjBEoZs0TzRNILAWYwB+Y4BHBKrTCOwGAIVT4CBkaizJG003Qkj9+d24elW6czKFgV8wlG+RIqwlmeCPNhYG5+Q8jl5vJSprIX08/ZbWUsm9jCl3RVLcsY5se9rlslwP7BklhEwmgUNusqXfMlT/SGFMrU5NOP0foFIYlp5uawoI3kSbeTcDVC4VLqlKif0K7pNI6WBshFREWEFbnZ7IT02GmNmUFn+51fG3FqGZnvcUYLrpQWKW1aN3clNS0hV4CArJ2vCGFHJ0SDceW+Z0em8/8wP2yvA8wyx4hqzSKFhXmwEmtWbcw5MpW93J9CcN19X7fjAiyTCtJvGRwaA9ML8WYVlZw6hIXfDfQDhbnrDqOehC0iiV5tJb8W/o8bqhi0nTGExGFFQQ0NdQ2/gtdDFpHOVI9KeOulzlclVBFxNZKIOov9ErxXPwPxB1E0F9TYLGjFqTEelyadCFxHQC1OhnQRFqMmr7W4MishK6QxcRY0zWmKC6JoaajB/fTqqWdhYBj0BUrbDg1BR7u4AWLr43LdTAGPpCQUx/k8llkxH5mXM4PCTlHx6T1FhXfza/ZPTYuwBRMw5R/EBnEgMBF5jMo0tzv6P0XRSZv7QbPCDlHAyPoEfmogFroGFhh/MORax3FDla+ymzNTbu0Jhq0DmBampZZL7DD4JSZPfoLjIdRVGP3S9YbulYB2P8AC3rqZQso9S/Sh0jeWzva+dyD48a7wcsdeb9raMo1sxMRTHIZuu7xDwoWbTxT97U+BEztG0Ltr358r2AsvZEdM8+OC5ZGvA5tf3rmvJNiok89rFP2iagUpeoqjzFpLaRqmvLk59RGBfa7G26SDNIMGeqhsDnfPl6QYl5tnDPwjDp8+ZZwAi1WORWJnxnrL3lr82+Gh5iWJ9n0DxBA7GYcxnGmNjeaBWrUsNPlpvf5pWOcSgBReRe5WMqfOX44z+09sNpm5dGUbZuMS2lzC0P1NXMrXM3Hb91vmTPrAiLxFma5ptqYWKYTqbrKKWmiSs6UyXCJzYnTT3SOhVsLA130hTiUTRESYnpKyYec/lDdbtrZm9ftJaDSmX+t6l8nBsZPYIqs/Om72vTRB0O4OOipwWV1nWrL57bdlb1FA2wWfsNzKIBebm5JxdvWT7hRDTcbFd3jYnzd0av1pSxhkqeWX3oBxcog9Pqb3j3b1r0dS10QNn7X+pjsYoolPguTeeDTPlCyk/w54oYp7OsVeF2B+GoXa8ttCjhJkv76P6yRz8urlqYcYFzVaaBPB+gvHUqAHvR+31SBzWCprcR1Obs2JIZPgpLwjsRJzcgtm3EHY76iwtnhOq2gFSqswuoMIT6QbGlDGqc4gzSv+bEpzCYcSeeqmYodgdJXBM98cTv7cnt9M9M/F5HP5TeySR4OkcxmhQYzLlgJjgnp3GOV7gSpwwlS3UQO2OmtGRoR/Qv6vWE/P0RxtUAAAAASUVORK5CYII=",zM="_wrapper_19qsy_1",FM="_ring_19qsy_10",HM="_ringLg_19qsy_18",WM="_svg_19qsy_25",VM="_spin_19qsy_1",qM="_logo_19qsy_42",UM="_label_19qsy_52",Dn={wrapper:zM,ring:FM,ringLg:HM,svg:WM,spin:VM,logo:qM,label:UM,"label--light":"_label--light_19qsy_59","label--dark":"_label--dark_19qsy_63"},KM={sm:{px:20,r:8.5,sw:3},md:{px:32,r:14.5,sw:3},lg:{px:36,r:16.5,sw:3}};function zf({size:t="md",label:e,theme:n="light","aria-label":r}){const i=`ps-grad-${x.useId().replace(/:/g,"")}`,{px:o,r:l,sw:a}=KM[t],c=2*Math.PI*l,u=c*.75,h=c*.25,p=t==="lg";return d.jsxs("div",{className:Dn.wrapper,role:"status","aria-label":r??"Loading",children:[d.jsxs("div",{className:[Dn.ring,p?Dn.ringLg:""].join(" ").trim(),children:[d.jsxs("svg",{width:o,height:o,viewBox:`0 0 ${o} ${o}`,className:Dn.svg,"aria-hidden":"true",children:[d.jsx("defs",{children:d.jsxs("linearGradient",{id:i,x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[d.jsx("stop",{offset:"0%",stopColor:"var(--teal-600, #138890)"}),d.jsx("stop",{offset:"100%",stopColor:"var(--green-300, #6FB864)"})]})}),d.jsx("circle",{cx:o/2,cy:o/2,r:l,fill:"none",stroke:"var(--surface-300, #F4F4F5)",strokeWidth:a}),d.jsx("circle",{cx:o/2,cy:o/2,r:l,fill:"none",stroke:`url(#${i})`,strokeWidth:a,strokeDasharray:`${u} ${h}`,strokeLinecap:"round"})]}),p&&d.jsx("img",{src:PM,alt:"","aria-hidden":"true",className:Dn.logo})]}),e&&d.jsx("span",{className:[Dn.label,Dn[`label--${n}`]].join(" "),children:e})]})}zf.displayName="ProgressSpinner";const GM="_chip_2a8wk_1",JM="_label_2a8wk_27",YM="_dismiss_2a8wk_33",Wo={chip:GM,label:JM,dismiss:YM},QM={plain:{bgVar:"--navy-50",bg:"#EAEBEC",textVar:"--teal-900",text:"#18474A"},contrast:{bgVar:"--teal-900",bg:"#18474A",text:"#ffffff"},error:{bgVar:"--red-500",bg:"#EB1000",text:"#ffffff"},warning:{bgVar:"--yellow-400",bg:"#FCE53C",textVar:"--yellow-900",text:"#514908"},informative:{bgVar:"--blue-400",bg:"#609AF8",text:"#ffffff"},success:{bgVar:"--green-500",bg:"#1E830E",text:"#ffffff"}};function Ff({label:t,severity:e,dismissible:n=!0,onDismiss:r}){const s=QM[e],i={"--c-bg":`var(${s.bgVar}, ${s.bg})`,"--c-text":s.textVar?`var(${s.textVar}, ${s.text})`:s.text};return d.jsxs("span",{className:Wo.chip,style:i,children:[d.jsx("span",{className:Wo.label,children:t}),n&&d.jsx("button",{type:"button",className:Wo.dismiss,onClick:r,"aria-label":`Remove ${t}`,children:d.jsx("i",{className:"pi pi-times","aria-hidden":"true"})})]})}Ff.displayName="SeverityChip";const XM="_chip_1b2ko_1",ZM="_avatar_1b2ko_38",ej="_label_1b2ko_53",tj="_dismiss_1b2ko_59",Lr={chip:XM,avatar:ZM,label:ej,dismiss:tj};function Hf({label:t,leading:e,trailing:n,dismissible:r=!0,onDismiss:s}){return d.jsxs("span",{className:Lr.chip,"data-leading":e?"true":void 0,"data-trailing":n?"true":void 0,children:[e&&d.jsx("span",{className:Lr.avatar,children:e}),d.jsx("span",{className:Lr.label,children:t}),n&&d.jsx("span",{className:Lr.avatar,children:n}),r&&d.jsx("button",{type:"button",className:Lr.dismiss,onClick:s,"aria-label":`Remove ${t}`,children:d.jsx("i",{className:"pi pi-times","aria-hidden":"true"})})]})}Hf.displayName="ProfileChip";const nj="_chip_4qp0t_1",rj="_dot_4qp0t_28",sj="_label_4qp0t_35",Vo={chip:nj,dot:rj,label:sj},ij={green:{dotVar:"--green-500",dot:"#1E830E"},red:{dotVar:"--red-500",dot:"#EB1000"},yellow:{dotVar:"--yellow-400",dot:"#FCE53C"},grey:{dotVar:"--navy-300",dot:"#70777D"}};function Wf({label:t,color:e}){const n=ij[e];return d.jsxs("span",{className:Vo.chip,children:[d.jsx("span",{className:Vo.dot,style:{background:`var(${n.dotVar}, ${n.dot})`},"aria-hidden":"true"}),d.jsx("span",{className:Vo.label,children:t})]})}Wf.displayName="AUSChip";const oj="_banner_lfuvj_1",lj="_icon_lfuvj_16",aj="_text_lfuvj_25",cj="_title_lfuvj_34",dj="_detail_lfuvj_42",Br={banner:oj,icon:lj,text:aj,title:cj,detail:dj},uj={success:{icon:"pi-check",bgVar:"--green-50",borderVar:"--green-700",colorVar:"--green-700",bg:"#edf8ea",border:"#1a760b",color:"#1a760b"},info:{icon:"pi-info-circle",bgVar:"--blue-50",borderVar:"--blue-600",colorVar:"--blue-600",bg:"#f5f9ff",border:"#326fd1",color:"#326fd1"},warn:{icon:"pi-exclamation-triangle",bgVar:"--yellow-50",borderVar:"--yellow-800",colorVar:"--yellow-800",bg:"#fefaed",border:"#695d05",color:"#695d05"},error:{icon:"pi-exclamation-circle",bgVar:"--red-50",borderVar:"--red-600",colorVar:"--red-600",bg:"#fff5f5",border:"#d60f00",color:"#d60f00"},neutral:{icon:"pi-info-circle",bgVar:"--teal-50",borderVar:"--teal-700",colorVar:"--teal-700",bg:"#eaf6f7",border:"#186368",color:"#186368"}};function ma({severity:t,title:e,detail:n,closable:r=!0,onClose:s}){const i=uj[t],o={"--a-bg":`var(${i.bgVar}, ${i.bg})`,"--a-border":`var(${i.borderVar}, ${i.border})`,"--a-color":`var(${i.colorVar}, ${i.color})`};return d.jsxs("div",{role:"alert",className:Br.banner,style:o,children:[d.jsx("i",{className:`pi ${i.icon} ${Br.icon}`,"aria-hidden":"true"}),d.jsxs("div",{className:Br.text,children:[d.jsx("span",{className:Br.title,children:e}),n&&d.jsx("span",{className:Br.detail,children:n})]}),r&&d.jsx(Lt,{"aria-label":"Dismiss",onClick:s})]})}ma.displayName="BannerAlert";const hj="_alert_1cttt_1",fj="_icon_1cttt_12",pj="_message_1cttt_21",qo={alert:hj,icon:fj,message:pj},mj={success:{icon:"pi-check",bgVar:"--green-50",colorVar:"--green-700",bg:"#edf8ea",color:"#1a760b"},info:{icon:"pi-info-circle",bgVar:"--blue-50",colorVar:"--blue-600",bg:"#f5f9ff",color:"#326fd1"},warn:{icon:"pi-exclamation-triangle",bgVar:"--yellow-50",colorVar:"--yellow-800",bg:"#fffce7",color:"#695d05"},error:{icon:"pi-exclamation-circle",bgVar:"--red-50",colorVar:"--red-600",bg:"#fff5f5",color:"#d60f00"}};function Vf({severity:t,message:e,closable:n=!0,onClose:r}){const s=mj[t],i={"--a-bg":`var(${s.bgVar}, ${s.bg})`,"--a-color":`var(${s.colorVar}, ${s.color})`};return d.jsxs("div",{role:"alert",className:qo.alert,style:i,children:[d.jsx("i",{className:`pi ${s.icon} ${qo.icon}`,"aria-hidden":"true"}),d.jsx("span",{className:qo.message,children:e}),n&&d.jsx(Lt,{"aria-label":"Dismiss",onClick:r})]})}Vf.displayName="InlineContainedAlert";const gj="_alert_p3w47_1",bj="_icon_p3w47_9",yj="_message_p3w47_18",Uo={alert:gj,icon:bj,message:yj},xj={success:{icon:"pi-check",colorVar:"--green-700",color:"#1a760b"},info:{icon:"pi-info-circle",colorVar:"--blue-600",color:"#326fd1"},warn:{icon:"pi-exclamation-triangle",colorVar:"--yellow-800",color:"#695d05"},error:{icon:"pi-exclamation-circle",colorVar:"--red-600",color:"#d60f00"}};function qf({severity:t,message:e}){const n=xj[t],r={"--a-color":`var(${n.colorVar}, ${n.color})`};return d.jsxs("div",{role:"status",className:Uo.alert,style:r,children:[d.jsx("i",{className:`pi ${n.icon} ${Uo.icon}`,"aria-hidden":"true"}),d.jsx("span",{className:Uo.message,children:e})]})}qf.displayName="InlineAlert";const vj="_container_88she_3",_j="_dropzone_88she_15",kj="_dragOver_88she_40",wj="_dropText_88she_45",Cj="_browseLink_88she_51",Sj="_hiddenInput_88she_57",Nj="_errorMessage_88she_63",Aj="_fileList_88she_79",Tj="_tableHeader_88she_83",Ej="_colName_88she_92",Mj="_colType_88she_101",jj="_fileRow_88she_111",Ij="_fileName_88she_119",Dj="_docTypeWrap_88she_130",Oj="_removeBtn_88she_137",Rj="_footer_88she_157",Qe={container:vj,dropzone:_j,dragOver:kj,dropText:wj,browseLink:Cj,hiddenInput:Sj,errorMessage:Nj,fileList:Aj,tableHeader:Tj,colName:Ej,colType:Mj,fileRow:jj,fileName:Ij,docTypeWrap:Dj,removeBtn:Oj,footer:Rj},Uf=["Miscellaneous","Agreements","Bank Statement","Hazard Insurance Binder","Pay Stub","Personal Identification","Purchase Agreement","Tax Return Transcript"],Lj=".html,.heic,.jpeg,.jpg,.png,.gif,.bmp,.tiff,.tif,.pdf,.doc,.docx,.xls,.xlsx";function Bj(t,e){return e.split(",").map(r=>r.trim().toLowerCase()).some(r=>t.name.toLowerCase().endsWith(r))}function Kf({onFilesAdded:t,onUpload:e,docTypes:n=Uf,accept:r=Lj,initialFiles:s,className:i,style:o}){const[l,a]=x.useState([]),[c,u]=x.useState(!1),[h,p]=x.useState(null),f=x.useRef(null),m=x.useId();x.useEffect(()=>{s&&s.length>0&&a(s.map(S=>({id:crypto.randomUUID(),file:S,docType:""})))},[]);const g=l.length>0&&l.every(S=>S.docType!==""),b=n.map(S=>({label:S,value:S})),y=x.useCallback(S=>{p(null);const T=[],P=[];if(S.forEach(L=>{Bj(L,r)?T.push(L):P.push(L)}),P.length>0&&p("File format not supported. Please try again."),T.length>0){const L=T.map(R=>({id:crypto.randomUUID(),file:R,docType:""}));a(R=>[...R,...L]),t==null||t(T)}},[r,t]),v=S=>{S.preventDefault(),u(!0)},_=S=>{S.currentTarget.contains(S.relatedTarget)||u(!1)},w=S=>{S.preventDefault(),u(!1),y(Array.from(S.dataTransfer.files))},k=S=>{S.target.files&&S.target.files.length>0&&(y(Array.from(S.target.files)),S.target.value="")},C=()=>{var S;(S=f.current)==null||S.click()},N=(S,T)=>{a(P=>P.map(L=>L.id===S?{...L,docType:T??""}:L))},O=S=>{a(T=>T.filter(P=>P.id!==S))},B=()=>{g&&(e(l.map(({file:S,docType:T})=>({file:S,docType:T}))),a([]),p(null))};return d.jsxs("div",{className:[Qe.container,i??""].filter(Boolean).join(" "),style:o,children:[d.jsxs("div",{className:[Qe.dropzone,c?Qe.dragOver:""].filter(Boolean).join(" "),onDragOver:v,onDragLeave:_,onDrop:w,onClick:C,role:"button",tabIndex:0,"aria-label":"File upload area. Click or drop files here.",onKeyDown:S=>{(S.key==="Enter"||S.key===" ")&&C()},children:[d.jsxs("span",{className:Qe.dropText,children:["Drop file(s) here or"," ",d.jsx("span",{className:Qe.browseLink,children:"browse"})]}),d.jsx("input",{ref:f,id:m,type:"file",multiple:!0,accept:r,className:Qe.hiddenInput,onChange:k,tabIndex:-1})]}),h&&d.jsxs("div",{className:Qe.errorMessage,role:"alert",children:[d.jsx("i",{className:"pi pi-exclamation-triangle","aria-hidden":"true"}),h]}),l.length>0&&d.jsxs("div",{className:Qe.fileList,children:[d.jsxs("div",{className:Qe.tableHeader,children:[d.jsx("span",{className:Qe.colName,children:"Document Name"}),d.jsx("span",{className:Qe.colType,children:"Document Type"})]}),l.map(S=>d.jsxs("div",{className:Qe.fileRow,children:[d.jsx("span",{className:Qe.fileName,title:S.file.name,children:S.file.name}),d.jsx("div",{className:Qe.docTypeWrap,children:d.jsx(pr,{options:b,value:S.docType||null,onChange:T=>N(S.id,T),placeholder:"Select Doc Type",filter:!0,size:"sm",style:{width:"100%"}})}),d.jsx("button",{type:"button",className:Qe.removeBtn,onClick:()=>O(S.id),"aria-label":`Remove ${S.file.name}`,children:d.jsx("i",{className:"pi pi-times-circle","aria-hidden":"true"})})]},S.id))]}),d.jsx("div",{className:Qe.footer,children:d.jsx(Fe,{variant:"primary",size:"md",onClick:B,disabled:!g,children:"Upload"})})]})}Kf.displayName="FileUpload";const $j="_overlay_keczm_3",Pj="_modal_keczm_19",zj="_header_keczm_36",Fj="_headerTitle_keczm_45",Hj="_title_keczm_50",Wj="_body_keczm_60",Vj="_footer_keczm_72",On={overlay:$j,modal:Pj,header:zj,headerTitle:Fj,title:Hj,body:Wj,footer:Vj},Gf=x.forwardRef(({isOpen:t,onClose:e,title:n,children:r,footer:s,scrim:i=!0,width:o=510,className:l,style:a},c)=>(x.useEffect(()=>{if(!t)return;const u=h=>{h.key==="Escape"&&e()};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[t,e]),t?Ut.createPortal(d.jsx("div",{className:On.overlay,"data-scrim":i,onClick:i?e:void 0,children:d.jsxs("div",{ref:c,role:"dialog","aria-modal":"true","aria-label":n??"Modal",className:[On.modal,l??""].filter(Boolean).join(" "),style:{width:o,...a},onClick:u=>u.stopPropagation(),children:[d.jsxs("div",{className:On.header,children:[d.jsx("div",{className:On.headerTitle,children:n&&d.jsx("span",{className:On.title,children:n})}),d.jsx(Lt,{"aria-label":"Close",onClick:e})]}),d.jsx("div",{className:On.body,children:r}),s&&d.jsx("div",{className:On.footer,children:s})]})}),document.body):null));Gf.displayName="Modal";const qj="_triggerWrap_5kkmc_3",Uj="_scrim_5kkmc_15",Kj="_popup_5kkmc_24",Gj="_header_5kkmc_82",Jj="_title_5kkmc_89",Yj="_body_5kkmc_101",Qj="_footer_5kkmc_107",Rn={triggerWrap:qj,scrim:Uj,popup:Kj,header:Gj,title:Jj,body:Yj,footer:Qj},md=10,Jf=x.forwardRef(({isOpen:t,onClose:e,trigger:n,title:r,children:s,footer:i,placement:o="bottom",align:l="right",width:a=360,className:c,style:u},h)=>{const p=x.useRef(null),[f,m]=x.useState(null),g=x.useCallback(()=>{if(!p.current)return null;const b=p.current.getBoundingClientRect(),y=b.left+b.width/2;let v=l==="right"?b.left:b.right-a;v=Math.max(8,Math.min(v,window.innerWidth-a-8));const _=y-v;return o==="bottom"?{top:b.bottom+md,left:v,arrowLeft:_}:{bottom:window.innerHeight-b.top+md,left:v,arrowLeft:_}},[o,l,a]);return x.useLayoutEffect(()=>{if(!t){m(null);return}m(g())},[t,g]),d.jsxs(d.Fragment,{children:[d.jsx("span",{ref:p,className:Rn.triggerWrap,children:n}),t&&f&&Ut.createPortal(d.jsxs(d.Fragment,{children:[d.jsx("div",{className:Rn.scrim,onClick:e,"aria-hidden":"true"}),d.jsxs("div",{ref:h,role:"dialog","aria-modal":"true","aria-label":r??"Popup",className:[Rn.popup,c??""].filter(Boolean).join(" "),"data-placement":o,style:{width:a,top:f.top,bottom:f.bottom,left:f.left,"--popup-arrow-left":`${f.arrowLeft}px`,...u},children:[r&&d.jsxs("div",{className:Rn.header,children:[d.jsx("span",{className:Rn.title,children:r}),d.jsx(Lt,{"aria-label":"Close popup",onClick:e})]}),d.jsx("div",{className:Rn.body,children:s}),i&&d.jsx("div",{className:Rn.footer,children:i})]})]}),document.body)]})});Jf.displayName="Popup";const Xj="_panel_qk0fv_1",Zj="_open_qk0fv_19",eI="_compact_qk0fv_23",tI="_header_qk0fv_29",nI="_titleBar_qk0fv_36",rI="_titleBarNoTitle_qk0fv_43",sI="_titleGroup_qk0fv_48",iI="_title_qk0fv_36",oI="_subtitle_qk0fv_63",lI="_actions_qk0fv_72",aI="_headerContent_qk0fv_79",cI="_body_qk0fv_85",St={panel:Xj,open:Zj,compact:eI,header:tI,titleBar:nI,titleBarNoTitle:rI,titleGroup:sI,title:iI,subtitle:oI,actions:lI,headerContent:aI,body:cI},Yf=x.forwardRef(({isOpen:t,onClose:e,title:n,subtitle:r,onSave:s,headerContent:i,width:o=470,children:l,className:a,style:c},u)=>{const h=o<400,p=[St.panel,t?St.open:"",h?St.compact:"",a??""].filter(Boolean).join(" "),f=d.jsxs("div",{className:St.actions,children:[s&&d.jsx(Fe,{variant:"primary",size:"sm",onClick:s,children:"Save"}),d.jsx(Lt,{"aria-label":"Close panel",onClick:e})]});return d.jsxs("div",{ref:u,role:"dialog","aria-modal":"false","aria-label":n??"Side panel",className:p,style:{width:o,...c},children:[d.jsxs("div",{className:St.header,children:[n?d.jsxs("div",{className:St.titleBar,children:[d.jsxs("div",{className:St.titleGroup,children:[d.jsx("span",{className:St.title,children:n}),r&&d.jsx("div",{className:St.subtitle,children:r})]}),f]}):d.jsx("div",{className:St.titleBarNoTitle,children:f}),i&&d.jsx("div",{className:St.headerContent,children:i})]}),d.jsx("div",{className:St.body,children:l})]})});Yf.displayName="SidePanel";const dI="_layout_1qi6d_1",uI={layout:dI},Qf=x.forwardRef(({open:t,panelWidth:e=470,children:n,className:r,style:s},i)=>{const o=[uI.layout,r??""].filter(Boolean).join(" ");return d.jsx("div",{ref:i,className:o,style:{paddingRight:t?e:0,...s},children:n})});Qf.displayName="SidePanelLayout";const hI="_nav_1w7cn_6",fI="_leftSection_1w7cn_21",pI="_applicantWrap_1w7cn_30",mI="_applicantTrigger_1w7cn_35",gI="_applicantIcon_1w7cn_64",bI="_applicantLabel_1w7cn_72",yI="_applicantChevron_1w7cn_80",xI="_applicantMenu_1w7cn_88",vI="_applicantOption_1w7cn_101",_I="_applicantOptionSelected_1w7cn_115",kI="_applicantDivider_1w7cn_129",wI="_applicantAddBtn_1w7cn_135",CI="_sortWrap_1w7cn_163",SI="_sortBtn_1w7cn_168",NI="_sortBtnIcon_1w7cn_191",AI="_sortBtnChevron_1w7cn_198",TI="_sortMenu_1w7cn_204",EI="_sortMenuItem_1w7cn_217",MI="_divider_1w7cn_250",jI="_tabsSection_1w7cn_259",II="_ausButtons_1w7cn_275",DI="_spacer_1w7cn_284",OI="_tab_1w7cn_259",RI="_tabDisabled_1w7cn_309",LI="_tabActive_1w7cn_309",Ce={nav:hI,leftSection:fI,applicantWrap:pI,applicantTrigger:mI,applicantIcon:gI,applicantLabel:bI,applicantChevron:yI,applicantMenu:xI,applicantOption:vI,applicantOptionSelected:_I,applicantDivider:kI,applicantAddBtn:wI,sortWrap:CI,sortBtn:SI,sortBtnIcon:NI,sortBtnChevron:AI,sortMenu:TI,sortMenuItem:EI,divider:MI,tabsSection:jI,ausButtons:II,spacer:DI,tab:OI,tabDisabled:RI,tabActive:LI},ga=()=>d.jsx("i",{className:"pi pi-arrow-right","aria-hidden":"true"}),ba=()=>d.jsx("i",{className:"pi pi-replay","aria-hidden":"true"}),BI=()=>d.jsx("i",{className:"pi pi-user","aria-hidden":"true"}),$I=()=>d.jsx("i",{className:"pi pi-plus-circle","aria-hidden":"true"}),PI=()=>d.jsx("i",{className:"pi pi-user-plus","aria-hidden":"true"}),kr=()=>d.jsx("svg",{width:"10",height:"6",viewBox:"0 0 10 6",fill:"none","aria-hidden":"true",children:d.jsx("path",{d:"M1 1l4 4 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function ya({applicants:t,selectedApplicantId:e,onApplicantChange:n,onAddApplicant:r,height:s=35}){const[i,o]=x.useState(!1),l=x.useRef(null);x.useEffect(()=>{if(!i)return;function c(u){var h;(h=l.current)!=null&&h.contains(u.target)||o(!1)}return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[i]),x.useEffect(()=>{if(!i)return;function c(u){u.key==="Escape"&&o(!1)}return document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)},[i]);const a=t.find(c=>c.id===e);return d.jsxs("div",{ref:l,className:Ce.applicantWrap,children:[d.jsxs("button",{type:"button",className:Ce.applicantTrigger,style:s!==35?{height:s}:void 0,onClick:()=>o(c=>!c),"aria-haspopup":"listbox","aria-expanded":i,children:[d.jsx("span",{className:Ce.applicantIcon,children:d.jsx(BI,{})}),d.jsx("span",{className:Ce.applicantLabel,children:(a==null?void 0:a.label)??""}),d.jsx("span",{className:Ce.applicantChevron,children:d.jsx(kr,{})})]}),i&&d.jsxs("div",{role:"listbox",className:Ce.applicantMenu,children:[t.map(c=>d.jsx("div",{role:"option","aria-selected":c.id===e,className:[Ce.applicantOption,c.id===e?Ce.applicantOptionSelected:""].filter(Boolean).join(" "),tabIndex:0,onClick:()=>{n(c.id),o(!1)},onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),n(c.id),o(!1))},children:c.label},c.id)),r&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:Ce.applicantDivider}),d.jsxs("button",{type:"button",className:Ce.applicantAddBtn,onClick:()=>{r(),o(!1)},children:[d.jsx($I,{}),"New Applicant"]})]})]})]})}function xa({sortItems:t,onSortSelect:e,height:n=35,width:r=47}){const[s,i]=x.useState(!1),o=x.useRef(null);x.useEffect(()=>{if(!s)return;function a(c){var u;(u=o.current)!=null&&u.contains(c.target)||i(!1)}return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[s]),x.useEffect(()=>{if(!s)return;function a(c){c.key==="Escape"&&i(!1)}return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[s]);const l=n!==35||r!==47?{height:n,width:r}:void 0;return d.jsxs("div",{ref:o,className:Ce.sortWrap,children:[d.jsxs("button",{type:"button",className:Ce.sortBtn,style:l,onClick:()=>i(a=>!a),"aria-haspopup":"menu","aria-expanded":s,"aria-label":"Sort applicants",children:[d.jsx("span",{className:Ce.sortBtnIcon,children:d.jsx(PI,{})}),d.jsx("span",{className:Ce.sortBtnChevron,children:d.jsx(kr,{})})]}),s&&d.jsx("div",{role:"menu",className:Ce.sortMenu,children:t.map(a=>d.jsx("button",{type:"button",role:"menuitem",disabled:a.disabled,className:Ce.sortMenuItem,onClick:()=>{e==null||e(a.value),i(!1)},children:a.label},a.value))})]})}const va=x.forwardRef(function(e,n){const{applicants:r,selectedApplicantId:s,onApplicantChange:i,onAddApplicant:o,sortItems:l,onSortSelect:a,tabs:c,activeTabId:u,onTabChange:h,onNextValidation:p,nextValidationBadge:f,onBackToAUS:m,className:g,style:b}=e;return d.jsxs("div",{ref:n,className:[Ce.nav,g??""].filter(Boolean).join(" "),style:b,children:[d.jsxs("div",{className:Ce.leftSection,children:[d.jsx(ya,{applicants:r,selectedApplicantId:s,onApplicantChange:i,onAddApplicant:o}),l&&l.length>0&&d.jsx(xa,{sortItems:l,onSortSelect:a})]}),d.jsx("div",{className:Ce.divider,"aria-hidden":"true"}),d.jsxs("div",{className:Ce.tabsSection,role:"tablist",children:[(p||m)&&d.jsxs("div",{className:Ce.ausButtons,children:[p&&d.jsx(Fe,{variant:"danger",size:"sm",leadingIcon:d.jsx(ga,{}),badge:f,onClick:p,children:"Next Validation"}),m&&d.jsx(Fe,{variant:"secondary",size:"sm",leadingIcon:d.jsx(ba,{}),onClick:m,children:"Back to AUS"})]}),c.map(y=>d.jsx("button",{type:"button",role:"tab",className:[Ce.tab,y.id===u?Ce.tabActive:"",y.disabled?Ce.tabDisabled:""].filter(Boolean).join(" "),"aria-selected":y.id===u,"aria-disabled":y.disabled,disabled:y.disabled,onClick:()=>{y.disabled||h(y.id)},children:y.label},y.id)),d.jsx("div",{className:Ce.spacer,"aria-hidden":"true"})]})]})});va.displayName="URLATabsNav";const zI="_nav_9yblg_5",FI="_row1_9yblg_19",HI="_borrowerBlock_9yblg_27",WI="_borrowerName_9yblg_34",VI="_loanDetailsBtn_9yblg_41",qI="_divider_9yblg_68",UI="_ausButtons_9yblg_76",KI="_tabsSection_9yblg_85",GI="_tab_9yblg_85",JI="_tabDisabled_9yblg_116",YI="_tabActive_9yblg_116",QI="_spacer_9yblg_136",XI="_stripBadge_9yblg_142",lt={nav:zI,row1:FI,borrowerBlock:HI,borrowerName:WI,loanDetailsBtn:VI,divider:qI,ausButtons:UI,tabsSection:KI,tab:GI,tabDisabled:JI,tabActive:YI,spacer:QI,stripBadge:XI},Xf=x.forwardRef(function(e,n){const{borrowerName:r,onLoanDetailsClick:s,applicants:i,selectedApplicantId:o,onApplicantChange:l,onAddApplicant:a,sortItems:c,onSortSelect:u,onNextValidation:h,nextValidationBadge:p,onBackToAUS:f,tabs:m,activeTabId:g,onTabChange:b,tabStripBadge:y,className:v,style:_}=e;return d.jsxs("div",{ref:n,className:[lt.nav,v].filter(Boolean).join(" "),style:_,children:[d.jsxs("div",{className:lt.row1,children:[d.jsxs("div",{className:lt.borrowerBlock,children:[d.jsx("span",{className:lt.borrowerName,children:r}),d.jsxs("button",{type:"button",className:lt.loanDetailsBtn,onClick:s,children:["Loan Details",d.jsx("i",{className:"pi pi-info-circle","aria-hidden":"true"})]})]}),d.jsx("div",{className:lt.divider,"aria-hidden":"true"}),d.jsx(ya,{applicants:i,selectedApplicantId:o,onApplicantChange:l,onAddApplicant:a,height:35}),c&&c.length>0&&d.jsx(xa,{sortItems:c,onSortSelect:u,height:35}),d.jsx("div",{className:lt.divider,"aria-hidden":"true"}),(h||f)&&d.jsxs("div",{className:lt.ausButtons,children:[h&&d.jsx(Fe,{variant:"danger",size:"sm",leadingIcon:d.jsx(ga,{}),badge:p,onClick:h,children:"Next Validation"}),f&&d.jsx(Fe,{variant:"secondary",size:"sm",leadingIcon:d.jsx(ba,{}),onClick:f,children:"Back to AUS"})]})]}),d.jsxs("div",{className:lt.tabsSection,role:"tablist",children:[m.map(w=>d.jsx("button",{type:"button",role:"tab",className:[lt.tab,w.id===g?lt.tabActive:"",w.disabled?lt.tabDisabled:""].filter(Boolean).join(" "),"aria-selected":w.id===g,"aria-disabled":w.disabled,disabled:w.disabled,onClick:()=>{w.disabled||b(w.id)},children:w.label},w.id)),d.jsx("div",{className:lt.spacer,"aria-hidden":"true"}),y!=null&&y>0&&d.jsx("span",{className:lt.stripBadge,"aria-label":`${y} items`,children:y})]})]})});Xf.displayName="URLATabsNavTablet";const ZI="_container_14o10_5",eD="_row1_14o10_17",tD="_borrowerBlock_14o10_27",nD="_borrowerName_14o10_35",rD="_loanDetailsBtn_14o10_44",sD="_rightControls_14o10_72",iD="_sectionWrap_14o10_82",oD="_sectionTrigger_14o10_87",lD="_sectionLabel_14o10_110",aD="_sectionChevron_14o10_118",cD="_sortPill_14o10_128",dD="_actionsWrap_14o10_155",uD="_actionsBtn_14o10_160",hD="_saveBtn_14o10_190",fD="_row2_14o10_217",pD="_ausButtons_14o10_226",mD="_tabDropdownWrap_14o10_236",gD="_tabDropdownTrigger_14o10_242",bD="_tabDropdownLabel_14o10_265",yD="_tabDropdownChevron_14o10_273",xD="_tabDropdownMenu_14o10_280",vD="_dropdownMenu_14o10_295",_D="_dropdownOption_14o10_308",kD="_dropdownOptionSelected_14o10_327",wD="_dropdownOptionDisabled_14o10_327",ye={container:ZI,row1:eD,borrowerBlock:tD,borrowerName:nD,loanDetailsBtn:rD,rightControls:sD,sectionWrap:iD,sectionTrigger:oD,sectionLabel:lD,sectionChevron:aD,sortPill:cD,actionsWrap:dD,actionsBtn:uD,saveBtn:hD,row2:fD,ausButtons:pD,tabDropdownWrap:mD,tabDropdownTrigger:gD,tabDropdownLabel:bD,tabDropdownChevron:yD,tabDropdownMenu:xD,dropdownMenu:vD,dropdownOption:_D,dropdownOptionSelected:kD,dropdownOptionDisabled:wD};function CD({label:t,items:e,onSelect:n}){const[r,s]=x.useState(!1),i=x.useRef(null);return x.useEffect(()=>{if(!r)return;function o(l){var a;(a=i.current)!=null&&a.contains(l.target)||s(!1)}return document.addEventListener("mousedown",o),()=>document.removeEventListener("mousedown",o)},[r]),x.useEffect(()=>{if(!r)return;function o(l){l.key==="Escape"&&s(!1)}return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[r]),d.jsxs("div",{ref:i,className:ye.sectionWrap,children:[d.jsxs("button",{type:"button",className:ye.sectionTrigger,onClick:()=>s(o=>!o),"aria-haspopup":"listbox","aria-expanded":r,children:[d.jsx("span",{className:ye.sectionLabel,children:t}),d.jsx("span",{className:ye.sectionChevron,children:d.jsx(kr,{})})]}),r&&e&&e.length>0&&d.jsx("div",{role:"listbox",className:ye.dropdownMenu,children:e.map(o=>d.jsx("div",{role:"option","aria-selected":o.label===t,className:[ye.dropdownOption,o.label===t?ye.dropdownOptionSelected:""].filter(Boolean).join(" "),tabIndex:0,onClick:()=>{n==null||n(o.value),s(!1)},onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),n==null||n(o.value),s(!1))},children:o.label},o.value))})]})}function SD({items:t,onSelect:e}){const[n,r]=x.useState(!1),s=x.useRef(null);return x.useEffect(()=>{if(!n)return;function i(o){var l;(l=s.current)!=null&&l.contains(o.target)||r(!1)}return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[n]),x.useEffect(()=>{if(!n)return;function i(o){o.key==="Escape"&&r(!1)}return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[n]),d.jsxs("div",{ref:s,className:ye.actionsWrap,children:[d.jsxs("button",{type:"button",className:ye.actionsBtn,onClick:()=>r(i=>!i),"aria-haspopup":"menu","aria-expanded":n,children:["Actions",d.jsx(kr,{})]}),n&&d.jsx("div",{role:"menu",className:ye.dropdownMenu,children:t.map(i=>d.jsx("button",{type:"button",role:"menuitem",disabled:i.disabled,className:ye.dropdownOption,onClick:()=>{e==null||e(i.value),r(!1)},children:i.label},i.value))})]})}function ND({tabs:t,activeTabId:e,onTabChange:n}){const[r,s]=x.useState(!1),i=x.useRef(null);x.useEffect(()=>{if(!r)return;function l(a){var c;(c=i.current)!=null&&c.contains(a.target)||s(!1)}return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[r]),x.useEffect(()=>{if(!r)return;function l(a){a.key==="Escape"&&s(!1)}return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[r]);const o=t.find(l=>l.id===e);return d.jsxs("div",{ref:i,className:ye.tabDropdownWrap,children:[d.jsxs("button",{type:"button",className:ye.tabDropdownTrigger,onClick:()=>s(l=>!l),"aria-haspopup":"listbox","aria-expanded":r,"aria-label":"Select tab",children:[d.jsx("span",{className:ye.tabDropdownLabel,children:(o==null?void 0:o.label)??""}),d.jsx("span",{className:ye.tabDropdownChevron,children:d.jsx(kr,{})})]}),r&&d.jsx("div",{role:"listbox",className:ye.tabDropdownMenu,children:t.map(l=>d.jsx("div",{role:"option","aria-selected":l.id===e,"aria-disabled":l.disabled,className:[ye.dropdownOption,l.id===e?ye.dropdownOptionSelected:"",l.disabled?ye.dropdownOptionDisabled:""].filter(Boolean).join(" "),tabIndex:l.disabled?-1:0,onClick:()=>{l.disabled||(n(l.id),s(!1))},onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&!l.disabled&&(a.preventDefault(),n(l.id),s(!1))},children:l.label},l.id))})]})}const _a=x.forwardRef(function(e,n){const{borrowerName:r,onLoanDetailsClick:s,sectionLabel:i,sectionItems:o,onSectionSelect:l,onSectionSort:a,actionItems:c,onActionSelect:u,onSave:h,applicants:p,selectedApplicantId:f,onApplicantChange:m,onAddApplicant:g,sortItems:b,onSortSelect:y,onNextValidation:v,nextValidationBadge:_,onBackToAUS:w,tabs:k,activeTabId:C,onTabChange:N,className:O,style:B}=e;return d.jsxs("div",{ref:n,className:[ye.container,O].filter(Boolean).join(" "),style:B,children:[d.jsxs("div",{className:ye.row1,children:[d.jsxs("div",{className:ye.borrowerBlock,children:[d.jsx("span",{className:ye.borrowerName,children:r}),d.jsxs("button",{type:"button",className:ye.loanDetailsBtn,onClick:s,children:["Loan Details",d.jsx("i",{className:"pi pi-info-circle","aria-hidden":"true"})]})]}),d.jsxs("div",{className:ye.rightControls,children:[d.jsx(CD,{label:i,items:o,onSelect:l}),a&&d.jsx("button",{type:"button",className:ye.sortPill,onClick:a,"aria-label":"Sort sections",children:d.jsx(kr,{})}),c&&c.length>0&&d.jsx(SD,{items:c,onSelect:u}),h&&d.jsx("button",{type:"button",className:ye.saveBtn,onClick:h,"aria-label":"Save",children:d.jsx("i",{className:"pi pi-save","aria-hidden":"true"})})]})]}),d.jsxs("div",{className:ye.row2,children:[(v||w)&&d.jsxs("div",{className:ye.ausButtons,children:[v&&d.jsx(Fe,{variant:"danger",size:"sm",leadingIcon:d.jsx(ga,{}),badge:_,onClick:v,children:"Next Validation"}),w&&d.jsx(Fe,{variant:"secondary",size:"sm",leadingIcon:d.jsx(ba,{}),onClick:w,children:"Back to AUS"})]}),d.jsx(ya,{applicants:p,selectedApplicantId:f,onApplicantChange:m,onAddApplicant:g,height:44}),b&&b.length>0&&d.jsx(xa,{sortItems:b,onSortSelect:y,height:44,width:62}),d.jsx(ND,{tabs:k,activeTabId:C,onTabChange:N})]})]})});_a.displayName="URLATabsNavMobile";const AD="_bar_n62yy_1",TD="_leftGroup_n62yy_15",ED="_brand_n62yy_22",MD="_navGroup_n62yy_28",jD="_logo_n62yy_34",ID="_version_n62yy_40",DD="_navWrap_n62yy_48",OD="_navItem_n62yy_53",RD="_navItemOpen_n62yy_76",LD="_navItemPrimary_n62yy_80",BD="_navChevron_n62yy_91",$D="_navChevronOpen_n62yy_97",PD="_dropdownPanel_n62yy_102",zD="_dropdownItem_n62yy_116",FD="_dropdownDivider_n62yy_149",HD="_searchWrap_n62yy_156",WD="_search_n62yy_156",VD="_rightGroup_n62yy_172",qD="_profileArea_n62yy_180",UD="_profilePill_n62yy_186",KD="_roleLabel_n62yy_193",GD="_avatarWrap_n62yy_200",JD="_avatarBtn_n62yy_205",YD="_profilePanel_n62yy_232",Se={bar:AD,leftGroup:TD,brand:ED,navGroup:MD,logo:jD,version:ID,navWrap:DD,navItem:OD,navItemOpen:RD,navItemPrimary:LD,navChevron:BD,navChevronOpen:$D,dropdownPanel:PD,dropdownItem:zD,dropdownDivider:FD,searchWrap:HD,search:WD,rightGroup:VD,profileArea:qD,profilePill:UD,roleLabel:KD,avatarWrap:GD,avatarBtn:JD,profilePanel:YD},Zf="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAAcCAYAAAD2izi6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAOdEVYdFNvZnR3YXJlAEZpZ21hnrGWYwAADIZJREFUeAHtWglwFFUafn1MT889k8yRTCZ3SEgIpxA3gJEzIKAU7KIuCmupoFW6sOyK7oIonmgpW4KWeC2lILfLoYRgQIlIjLDkgpBwBEIg12Qymfvoe19PJjAJJAFX2Sr0r+qZ6Xf8773v/XeCgN4Jgw8Hxo3DSan0LiI1fT5uThoFWEbH84JPcDvq2Obmb9nL53dTpaV1cCwanseDXxEhvbQh5jvuIIOzHy4ksgfn0TUnjzAnTu7mvLY6wGIIHqVKwuKSJ2GZWXdhKrWaczvcbEXFCue7b68FXcD/SgkXPzTPv7LUuPeQQzZ3fk5/E5T507P1az6qMvxri2D8dLtPPeW+NNB5CWjEMKLHNAm4TShSAkOSo/9wwwG6tXWv+8Vn14iN2nHjtLRcNRZPSB7J80CPSXAv29h8grt0piRYUdHQNVnz1KKJ0pyxBwXIkq4q+4Prn2/8G3SCGFLpIbkT2gQA1FKpDD9eXCACKIDbgJCIbyH6vfWbqMKvVnkLdlVrH3liNj4yZx2iUBoFrxsIwSCUTyigHMSDkABUoQSCIDjp4z++6P7g3bUhLvn5iqiZ91/EZAo9daJ8rvudt7aCMFDZOXlWaDuNhFRGV5YUScFtQl0AourHn5jKt7RdgsrWJp85t5Z3OaIEv49D9QZMQICba2mp4i7V1yNSmQS1JA7EDYYhsB8TaAqgplgmuHljtrzxfBM7b8EZiKwZT0pptt4/w9K10O0KYMjmgbQ0iRBkzqNxZi05bqqVqaul8Lh4wDk6ivx7ti4I7N3bdL3Jqj/Oz5VOmLKNt7bGS6fPOMMhKIfQNCZwwm4I3izQaesYcBtTp6E3GFDa3sHK8ib+GAIvMZmgC3akOlb+fRoErxX04q09WzYcbV/wUALnsC9C5EqA4DjGuhyL7H97UgRPvJzbGjyRxENioLQ0oN2yp449f5aSJKVgbReqcbBzpwiuCFxvIYkQflDnqyveVT+6oA4otYh77Vv7QOfFsODmCY3gC8LrCz36+4szkfDD99EPQN9OrD8eV/YhAsjpX3h1O3/pAiNJTJL6318dDQEVJ98oACIjxL3+48KIxW82mO4Ke7j41MwHlVr9UoIkM6AtJVAU5RiaavZ5nJvra/GXASgT+lgjZDL0ZnO6NtryhlypzUMQXhkajwJXwOs95rN1LGtqOlsVPvv1zhi6RKPRaIiypL4PbfZ4BMEUnV2CM+BxFbVdPvdnp9PpEvkiIDdXZnl6iZ9paeZ5u+N126qXVoBfgPpwIqHbtqRkpsYkplZRAb+MYxkebg29IioCDI5QlCdlCtTpcS48X/7Dx+DagD0EyODc8f/BcWIk5BMCGtJVHkDgCVKBshx9/GTpoVHgWhBDEp81fMyTMrVmXcDnuYYHJF6h0qL21sszLtRW7kN1CQmPCHarII0xoGHwMHBrCU0dOGK4KSH5rN/jxDmWFUi5AgU8X8Uw1G6Wpo9ISVkQSiLq93mCKlL+UcaI3LdAJ3hdGIeAGJ431cOz3HAIHiuVkQghldoYOrifoYL7JQTRKCHlKBX0sTzLDhuRN90DOsHDI/aCmBMyxpBK5Tq/101jGI5IpAoHQ9H7GJreL5XJ3AiKoT6Pg44yxe01m1PicfngrLkI5UPYJvfhMJNbmYaJlyXoYmKO+z1uGpdICCilBYjPNqumrKybA0rLGvGwWm/cGPR5aIVC84w5LXNLc11tJei0ZVDyJnxHB3ykABlIVWqu5XT9gNbW0xcjeZiTkzNi4geeDPo9SNDvlg/KyTt46tjhSRFDeIMleWcg4OVwiHjA73297sSh5ZE8MkfkbsAkxDyf182pTabPUImCTCWUUsBWVmwGt5649GGj1vu9HqiyAGdZ9GD1seIZZWVlPQ08WldTvqm9pWmyRCongn4vazTFfQ3C9ldjHJAiwfE8UcNkCiVeUVwog+BdBt2jB6S5vv58+eFCmVSmEC+Ol5KKiTExMYaucSaTyYjhwIgABMNQtKHuxDERvEiNxGrLS+djEtIFJ2AQ5BwUJhcqCQGn0Ewl+D+QQh31oPhNylVozfFvJoebexp3ESjh0rmTBzmGKoEGEUdRHPoKs15s18dqn6MCQR7DUdzabHsYhB0S6O5phTBfwd5mm49B/aSDfoHUGpd0jWMRTRLHMQBaC+DosH0RnhepkaHffpfjAIpiok0kcRxhoUSSAPM7aCCiPWcOADt28OAW5KohAAQk5FCgWtHZOXfDS0QUvY1HEAGaL04tGnWWZWBhSDYWNu8mJbIJAhBQXCIHjZ7Tu/vZu0A5m3bhRiOgAj5EodLkw7ZlYodESimEsG9HUaGjNwau9tY9Co0W8AJC4RKMZwielglywgj7OBPmutMKwDFwc9QVr/WM2/okn49VR7CA9o8f2t+cLo/IcyxQKJTx4m+oRjrouQEiCAywWv397EGwwjHmAbxoYyXQZhquMpcIV6NEpDdnira1XPociA8kHOOC7UiAVmtS4+9uAeBrg0Y7gBuTUdNeciYAbjwWRB/4a3J2bLxG+c6SyhLQe4zVjWC4QXWdFaqDF6rVaUQAJLgRQlASEZCwlHTKDd+5bn8ZkAgRJqIVfr9ZTesWf+J8u+17LEaXbBqe+NhpKMrVH27fdM+O5fsLS16bAm4s8g8Fr7MXpR5FMV4am37n2uemH10MbqCwarc32hKR7NAhpHI5W/l90SjwE4hnaVhWQ/VQLJHoxMQ0e0PD2T7WRmISEjIE4ecpnKOu2rq1ymg5IpOjxow5ecmwDW/9rmL573ctEet54ip4bxsJ9zFbLkw6F/RzUmsDXRyTJFu0tT7fnj/PFA26F1WvR3Qw4K+BIsALDKONGzh0Rh9zQvvQ6/Uqi8Ui02qTtCDsIR1226cYtOYUFeTjYgdsA53gXU8FQ97XaE7bSFOBnwVBtGHbt+WkAnMyVhudvnD0IdjGVLy3r9J1rmnz4oplYsrTpYrdQgL4CFMey1JvOJ9vV2vxtPIi29Cnxx4Zf+oH9xOOVn/UyvW/s86ZMwjvb31nW/M8kpRhDPQKJkPMV7GJAzJ6WY8dNnpyTULWKLcxZbDfkpkq1hpFoNDm+rMfwgxDtI+8ALjBWSPHrAPdA+0uHlzWiDEfwAsbLtoA8DOQeEDUWnRshmVi1hGkPZgwbdOfXtn30GcrDj67fU/bfUOqV7U8L9R/V/tV2faalTTlq6d8LBZvUWZOe8y8LGt01NSWs866NStPJRRttIbsTsYQch4gMFC4vXHpjh2n+qvGCM0NdeW6GPNOGHfNgvEdHZOQWqPR6Qtcdvubfre1CSWjYeYkn2Awxb9O+b1SnhJY6DnZ6tJvpoIIM+G0Ns5SRRt2QZFmUIx4csjoyTM6Wpr+EaRdxyhoaTVaZU60MX41vCejwHN10HlchOnhJPA/UlfVQZj9xeICQAWnaPQKrKOpefGeR7eKVWbxbxn09GW5U4blW1aZEqSDjFE47m51uBtO2I6cLGpZ/uUn9Se6xq0vzyulKO536mji9EPphzJBhA3tIxcO2dDsO8cXwExkGgSAhZIENVIifsACOA84hoGZHcfC+AyTKlWesm/36kD3SlFonew7xi4iFKo1MIflkU4mMCKWhEaKXhqmiawCqgvvaiZoiaYatqVD/9NQU1aSJDKJSUobZzQnHoKxEoDFixfqa6teATcA4JVDLCx97oz3UluSSiclOJ+3+JNZn08MA9BbeBLa+L0LUxIWvpxU1XAmoI1PV3hnxh5UgR7F1BF33eOGQ+UEKcd+PLAL7cEv5LUtSQPvjjbHfQ5DfIsIWsjQQ00TgYRDAh5Hy5t11eUvgesXakN7MVhSBsTGJ30Js4SBEDAReCAGvfAdyoe/1nrBlmOznfKOnHBvK88wethvrSw5ECcyiE/Lzo9NSPlanOd1298+U3l0KbhBAEUKSdHjBY8fISVgDOXy0OY0DdF07vK2i/vqX3OcVJwui8hPB40bpBw0lBozYX78mzotMtTVzoDYeOTCvebDqeDaMIa4+r5SfK5XL7xSg1OpVNGkLjaTgA5TwHhXkPbXdjQ1NYKIshfo/TwhHjqdTiNTRWVDMTRzAmcLwmTVefGiE3SqfU8eWMT+kM49gr7KZt0WBD1BnL36ngeG5Cdu9bc5AecLCDqTFFHC/IDAWD/t9rNqHUoQuEAGnEHAMywwp8jA0ULrM6/Or1oNfrky/k0F6T9h/E+i65Xqr/yHwaSnhs0cMNLwlygTMRhHeR2GsKgE5QCOcrwEE9wuO3XqXJn7o8YfTJuLi4s50Ld0/Ea/0bX0XxB9nrPY0cBvAAAAAElFTkSuQmCC";function ms(...t){return t.filter(Boolean).join(" ")}function QD(){return d.jsx("svg",{width:"10",height:"6",viewBox:"0 0 10 6",fill:"none","aria-hidden":"true",children:d.jsx("path",{d:"M1 1L5 5L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function ep({items:t,onSelect:e,className:n}){return d.jsx("div",{role:"menu",className:ms(Se.dropdownPanel,n),children:t.map(r=>r.divider?d.jsx("div",{className:Se.dropdownDivider},r.value):d.jsxs("button",{role:"menuitem",className:Se.dropdownItem,disabled:r.disabled,onClick:()=>e(r.value),children:[r.icon,r.label]},r.value))})}function XD({id:t,label:e,items:n,onSelect:r,isPrimary:s}){const[i,o]=x.useState(!1),l=x.useRef(null);return x.useEffect(()=>{if(!i)return;function a(u){l.current&&!l.current.contains(u.target)&&o(!1)}function c(u){u.key==="Escape"&&o(!1)}return document.addEventListener("mousedown",a),document.addEventListener("keydown",c),()=>{document.removeEventListener("mousedown",a),document.removeEventListener("keydown",c)}},[i]),d.jsxs("div",{ref:l,className:Se.navWrap,children:[d.jsxs("button",{className:ms(Se.navItem,i&&Se.navItemOpen,s&&Se.navItemPrimary),onClick:()=>o(a=>!a),"aria-haspopup":"menu","aria-expanded":i,children:[s&&d.jsx("i",{className:"pi pi-plus-circle","aria-hidden":"true"}),e,n&&n.length>0&&d.jsx("span",{className:ms(Se.navChevron,i&&Se.navChevronOpen),children:d.jsx(QD,{})})]}),i&&n&&n.length>0&&d.jsx(ep,{items:n,onSelect:a=>{r==null||r(a),o(!1)}})]})}function ZD(t){const e=t.trim().split(/\s+/);return e.length===1?e[0].slice(0,2).toUpperCase():(e[0][0]+e[e.length-1][0]).toUpperCase()}function eO({profile:t}){const[e,n]=x.useState(!1),r=x.useRef(null),s=t.initials??ZD(t.name);return x.useEffect(()=>{if(!e)return;function i(l){r.current&&!r.current.contains(l.target)&&n(!1)}function o(l){l.key==="Escape"&&n(!1)}return document.addEventListener("mousedown",i),document.addEventListener("keydown",o),()=>{document.removeEventListener("mousedown",i),document.removeEventListener("keydown",o)}},[e]),d.jsxs("div",{className:ms(Se.profileArea,t.role&&Se.profilePill),children:[t.role&&d.jsx("span",{className:Se.roleLabel,children:t.role}),d.jsxs("div",{ref:r,className:Se.avatarWrap,children:[d.jsx("button",{className:Se.avatarBtn,onClick:()=>n(i=>!i),"aria-haspopup":"menu","aria-expanded":e,"aria-label":`${t.name} — open profile menu`,children:s}),e&&t.menuItems&&t.menuItems.length>0&&d.jsx(ep,{items:t.menuItems,className:Se.profilePanel,onSelect:i=>{var o;(o=t.onMenuSelect)==null||o.call(t,i),n(!1)}})]})]})}const tp=x.forwardRef(function(e,n){const{version:r,navItems:s,onSearch:i,searchPlaceholder:o,profile:l,className:a,style:c}=e;return d.jsxs("div",{ref:n,className:ms(Se.bar,a),style:c,children:[d.jsxs("div",{className:Se.leftGroup,children:[d.jsxs("span",{className:Se.brand,children:[d.jsx("img",{src:Zf,alt:"Clear",className:Se.logo}),r&&d.jsx("span",{className:Se.version,children:r})]}),d.jsx("div",{className:Se.navGroup,children:s.map(u=>d.jsx(XD,{...u},u.id))})]}),d.jsx("div",{className:Se.searchWrap,children:d.jsx(gs,{className:Se.search,prefixIcon:d.jsx("i",{className:"pi pi-search","aria-hidden":"true"}),placeholder:o??"Search Leads and Loans",onChange:u=>i==null?void 0:i(u.target.value),"aria-label":"Search"})}),d.jsx("div",{className:Se.rightGroup,children:d.jsx(eO,{profile:l})})]})}),tO="_bar_avirz_1",nO="_left_avirz_14",rO="_center_avirz_21",sO="_right_avirz_29",iO="_logo_avirz_37",oO="_logoClip_avirz_44",lO="_borrowerName_avirz_51",aO="_infoIcon_avirz_58",cO="_iconBtn_avirz_76",dO="_searchBtn_avirz_101",uO="_avatarWrap_avirz_106",hO="_avatarBtn_avirz_111",fO="_dropdownPanel_avirz_139",pO="_dropdownItem_avirz_154",mO="_dropdownDivider_avirz_187",Xe={bar:tO,left:nO,center:rO,right:sO,logo:iO,logoClip:oO,borrowerName:lO,infoIcon:aO,iconBtn:cO,searchBtn:dO,avatarWrap:uO,avatarBtn:hO,dropdownPanel:fO,dropdownItem:pO,dropdownDivider:mO},gO="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAcCAYAAACUJBTQAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAlmVYSWZNTQAqAAAACAAGARIAAwAAAAEAAQAAARoABQAAAAEAAABWARsABQAAAAEAAABeASgAAwAAAAEAAgAAATEAAgAAAAYAAABmh2kABAAAAAEAAABsAAAAAAAAAEgAAAABAAAASAAAAAFGaWdtYQAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGaADAAQAAAABAAAAHAAAAAD0nSgiAAAACXBIWXMAAAsTAAALEwEAmpwYAAABwGlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNi4wLjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyIKICAgICAgICAgICAgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIj4KICAgICAgICAgPHRpZmY6T3JpZW50YXRpb24+MTwvdGlmZjpPcmllbnRhdGlvbj4KICAgICAgICAgPHhtcDpDcmVhdG9yVG9vbD5GaWdtYTwveG1wOkNyZWF0b3JUb29sPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4Kc6r2JgAABhdJREFUSA2tVQlMVEcYnnfse8vusiywy8q1nEIVERrQiqClakBjLZWKpliJUUETLdJW28ajmmpjW6tVNLVaNY2tiEbrUZDEkyoVTYSVw4NyCcoNwr7Csvv2HZ15+Fogtajpn8ybmf//vv//5583Mxh4thDQxIP4eFJJ01OooJA00st/AuAcroIg9olMdw3X3HyFe1R7xl5cXAOx+FNXwnCX2HAFnCMd5hUVpbQlv1dAjQufyt6rKHKUV5zheztqAEdgpJuzP+EdMIMYM3YK4azV8kw3w5nNG3v2fJMNuQPJ/YtjWUWigcuGLWs98q52O6WmTZQNz+o1CbPH6XcfKDMcOiZ6/HiiT5v4VjDEokTllUkTmS9loN9/5CLb2prHbPp4NzLo4uN1rMo5jjQFRAsC0BMKspd73FzON1b9bjObG2Syy8rM6fTEuEsidMmWlcyz7PzyFLShQIJcLtSL7nsPH7UX/LqtN/90pW7x8mQyeuI+TK3xEHsZINpsAJBwoTwsOaUAuFoDRFHsYW/f3MR8vweVCYCEBLVb0vyHhJNaby8vTWV2bc9FfuUguHbZ8plCS3sjoEC7Kin1vmDpdhOtfTyuNxAQxfAtLWV8Y309RjspcB+/V0iDYTy0EyJrB7jR02HL+Wmc6nFtE7covQpG9yL9A5vb5r/pg2IPBAkOpp0nTfXHVE46ZfzMm46a+3bS25fmHjUU2G4Xpffn5TUh8HBxfjcthp6WeFxkLL6YkobecB6wLCHy4pmuj1bMhXgFbI6BIDExTrTO6KVbmFbD1tXYSb8Aij2XG2w5daoOgtBeod9ShG2wIC5qgm7DlvcVQSHZwMECR0tTZs+mT/dAPfqJONgkkLThxmNnRa72DzthCiDa6yppsHkz2jQetuHOEW+wSJurXZI+C2h0GJO9/Tw0SjoZJK1E/9nWE5ha/Tbh5aOwfrfTnSkutkAACvC8gvzIyQweS3wcwFIpQ0NScAIj+HuVW2GAJ9DyIgGQIznA8DGaA9LVZFosdrWJ9CgD3rgmayPUjXhiJeYLfEhV+NhUzN6HcU3Mtae8F13FiOFwhVoZRGlowN0x54yIfkkACQ+xM0FhAGMdd17Sx4g0nMQ4goJBCGs3C9EESElBeyL9dSOynxOAKwjBQQksEFWUB+TwRsIS/ZzcwTA5KbkfbAM4wds6sX4GuAT5vo4sBhfdaH1sqAYOpWt/CPrZE3zBhwERWd9GTn4KGcLFhc6O6wRgReOrfksRoHL/iaMTsuadhEN0JaCTO5Kg+4lPzgy6FTvPreir/NfQE4G4qOyS4Jb7NdkadxXmpMI9QlOmBkAt2fqbef07pz9A7wG6s4ZkJbEGPqg0yOY4Vjej2mbl6bYGtnCUv1Nmbn1CV8Iiozu0SUniDcevlCrVRI+jrYMNyZh8FZHMe8/fsVQ35aw2ryuDc+mSg/3geqOxmLg0THukNqFLqyODSy90RKyKK3rj7g1meXer1W3z4UltKSlhUoJoSbiLQXPdMN47neixuQQmh5LVv5Rdrrt4t7q/xXI5qzC9M2iCIQquqUofqLLpvNWayDjPqFW7w/fPWeH7A9NqbTq0sdyU83V9O/TFL9kQsIugSdPtws61+7aUFUGdlJ2UVfLJ1fnAbkt00auJJ03Nq88uyUWvHQUbO3tdTGJkgs82o4kO83AjSaa1m2ko7yiquNCy/tzB+nIZd7h0arHdzk/SulMPFoZcHQP10m0sl0B6XDKKP6nqbWz3d3alKb6vt/Dg3J+nQyDaFykR2A8XycmcjEBTxuf+ZQ1V/TrfEHVvkuclZwiUfCKCHASNpayX5S8rUipArN3yJ+sV7EI1VT86/vB8/RfdFeoHJSUlDgREEhYfpgmLsMdOS/P9ylWHRVg6HcDTF6ub43UtCJrRXsh7OSQI4kqBknfMWjA+wS/X2t4D+L5+0dVIYxo1NBKclWWsnNYVpyhSVPb32IDg4IBXoBO4VdC2Zmta2Q7o4+8VIIdIBq9kQPPP2RBmrIxMGh1tyHIzUuEkLrgSGIcr4DNO4rygIODL3mW/W13CHHh8w5hTWFiIbm9Uvv/9FpcT+8/+L2NoT1d8TFvQAAAAAElFTkSuQmCC";function bO(t){const e=t.trim().split(/\s+/);return e.length===1?e[0].slice(0,2).toUpperCase():(e[0][0]+e[e.length-1][0]).toUpperCase()}function yO({items:t,onSelect:e}){return d.jsx("div",{role:"menu",className:Xe.dropdownPanel,children:t.map(n=>n.divider?d.jsx("div",{className:Xe.dropdownDivider},n.value):d.jsxs("button",{role:"menuitem",className:Xe.dropdownItem,disabled:n.disabled,onClick:()=>e(n.value),children:[n.icon,n.label]},n.value))})}function xO({profile:t}){const[e,n]=x.useState(!1),r=x.useRef(null),s=t.initials??bO(t.name);return x.useEffect(()=>{if(!e)return;function i(l){r.current&&!r.current.contains(l.target)&&n(!1)}function o(l){l.key==="Escape"&&n(!1)}return document.addEventListener("mousedown",i),document.addEventListener("keydown",o),()=>{document.removeEventListener("mousedown",i),document.removeEventListener("keydown",o)}},[e]),d.jsxs("div",{ref:r,className:Xe.avatarWrap,children:[d.jsx("button",{className:Xe.avatarBtn,onClick:()=>n(i=>!i),"aria-haspopup":"menu","aria-expanded":e,"aria-label":`${t.name} — open profile menu`,children:s}),e&&t.menuItems&&t.menuItems.length>0&&d.jsx(yO,{items:t.menuItems,onSelect:i=>{var o;(o=t.onMenuSelect)==null||o.call(t,i),n(!1)}})]})}function np({borrower:t,onMenuOpen:e,onSearchOpen:n,profile:r,className:s,style:i}){const o=!!t;return d.jsxs("div",{className:[Xe.bar,s].filter(Boolean).join(" "),style:i,children:[d.jsxs("div",{className:Xe.left,children:[d.jsx("button",{className:Xe.iconBtn,onClick:e,"aria-label":"Open menu",children:d.jsx("i",{className:"pi pi-bars","aria-hidden":"true"})}),o&&d.jsx("img",{src:gO,alt:"Clear",className:Xe.logoClip})]}),d.jsx("div",{className:Xe.center,children:o?d.jsxs(d.Fragment,{children:[d.jsx("span",{className:Xe.borrowerName,children:t.name}),d.jsx("button",{className:Xe.infoIcon,onClick:t.onInfoClick,"aria-label":"Borrower info",children:d.jsx("i",{className:"pi pi-info-circle","aria-hidden":"true"})})]}):d.jsx("img",{src:Zf,alt:"Clear",className:Xe.logo})}),d.jsxs("div",{className:Xe.right,children:[d.jsx("button",{className:[Xe.iconBtn,Xe.searchBtn].join(" "),onClick:n,"aria-label":"Open search",children:d.jsx("i",{className:"pi pi-search","aria-hidden":"true"})}),d.jsx(xO,{profile:r})]})]})}const vO="_wrap_ojyp7_6",_O="_btn_ojyp7_13",kO="_btnMd_ojyp7_28",wO="_btnSm_ojyp7_33",CO="_btnLg_ojyp7_39",SO="_boltIcon_ojyp7_46",NO="_chevronIcon_ojyp7_47",AO="_btnBasic_ojyp7_66",TO="_btnFilled_ojyp7_82",EO="_menu_ojyp7_111",MO="_menuItem_ojyp7_124",jO="_menuItemDisabled_ojyp7_139",IO="_menuItemIcon_ojyp7_152",DO="_menuDivider_ojyp7_159",at={wrap:vO,btn:_O,btnMd:kO,btnSm:wO,btnLg:CO,boltIcon:SO,chevronIcon:NO,btnBasic:AO,btnFilled:TO,menu:EO,menuItem:MO,menuItemDisabled:jO,menuItemIcon:IO,menuDivider:DO},eo=x.forwardRef(function({variant:e="basic",size:n="md",items:r,onSelect:s,disabled:i,"aria-label":o="Quick actions",className:l,style:a},c){const[u,h]=x.useState(!1),p=x.useRef(null);x.useEffect(()=>{if(!u)return;function g(b){var y;(y=p.current)!=null&&y.contains(b.target)||h(!1)}return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[u]),x.useEffect(()=>{if(!u)return;function g(b){b.key==="Escape"&&h(!1)}return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[u]);const f=g=>{h(!1),s(g)},m=[at.btn,n==="sm"?at.btnSm:n==="lg"?at.btnLg:at.btnMd,e==="filled"?at.btnFilled:at.btnBasic].filter(Boolean).join(" ");return d.jsxs("div",{ref:p,className:[at.wrap,l??""].filter(Boolean).join(" "),style:a,children:[d.jsx(er,{content:o,placement:"top",children:d.jsxs("button",{ref:c,type:"button",className:m,disabled:i,"aria-label":o,"aria-haspopup":"menu","aria-expanded":u,onClick:()=>h(g=>!g),children:[d.jsx("span",{className:at.boltIcon,"aria-hidden":"true",children:d.jsx("i",{className:"pi pi-bolt"})}),d.jsx("span",{className:at.chevronIcon,"aria-hidden":"true",children:d.jsx("i",{className:"pi pi-chevron-down"})})]})}),u&&d.jsx("div",{role:"menu",className:at.menu,children:r.map(g=>g.divider?d.jsx("div",{className:at.menuDivider,role:"separator"},g.value):d.jsxs("div",{role:"menuitem",className:[at.menuItem,g.disabled?at.menuItemDisabled:""].filter(Boolean).join(" "),tabIndex:g.disabled?-1:0,"aria-disabled":g.disabled,onClick:()=>{g.disabled||f(g.value)},onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&!g.disabled&&(b.preventDefault(),f(g.value))},children:[g.icon&&d.jsx("span",{className:at.menuItemIcon,"aria-hidden":"true",children:g.icon}),g.label]},g.value))})]})});eo.displayName="LightningButton";const OO="_nav_8y8kv_6",RO="_mainRow_8y8kv_18",LO="_menuToggle_8y8kv_29",BO="_tabsArea_8y8kv_56",$O="_actions_8y8kv_66",PO="_actionItem_8y8kv_75",zO="_divider_8y8kv_83",FO="_navBadgeDrop_8y8kv_94",HO="_navBadgeDropBtn_8y8kv_99",WO="_navBadgeDropLabel_8y8kv_128",VO="_navBadgeDropChevron_8y8kv_132",qO="_navBadgeDropBadge_8y8kv_139",UO="_navBadgeDropMenu_8y8kv_156",KO="_navBadgeDropItem_8y8kv_169",GO="_navBadgeDropItemDisabled_8y8kv_184",JO="_conditionBadge_8y8kv_199",YO="_conditionDismiss_8y8kv_213",QO="_backBtn_8y8kv_234",XO="_breadcrumbs_8y8kv_259",ZO="_breadcrumbItem_8y8kv_268",eR="_breadcrumbDot_8y8kv_281",tR="_status_green_8y8kv_288",nR="_status_yellow_8y8kv_289",rR="_status_red_8y8kv_290",sR="_status_gray_8y8kv_291",iR="_breadcrumbText_8y8kv_293",oR="_breadcrumbLabel_8y8kv_299",lR="_breadcrumbSublabel_8y8kv_309",aR="_expandBtn_8y8kv_319",cR="_toolbarRow_8y8kv_346",dR="_toolbarLeft_8y8kv_356",uR="_toolbarCenter_8y8kv_362",hR="_toolbarRight_8y8kv_369",ue={nav:OO,mainRow:RO,menuToggle:LO,tabsArea:BO,actions:$O,actionItem:PO,divider:zO,navBadgeDrop:FO,navBadgeDropBtn:HO,navBadgeDropLabel:WO,navBadgeDropChevron:VO,navBadgeDropBadge:qO,navBadgeDropMenu:UO,navBadgeDropItem:KO,navBadgeDropItemDisabled:GO,conditionBadge:JO,conditionDismiss:YO,backBtn:QO,breadcrumbs:XO,breadcrumbItem:ZO,breadcrumbDot:eR,status_green:tR,status_yellow:nR,status_red:rR,status_gray:sR,breadcrumbText:iR,breadcrumbLabel:oR,breadcrumbSublabel:lR,expandBtn:aR,toolbarRow:cR,toolbarLeft:dR,toolbarCenter:uR,toolbarRight:hR},fR=()=>d.jsx("svg",{width:"18",height:"14",viewBox:"0 0 18 14",fill:"none","aria-hidden":"true",children:d.jsx("path",{d:"M0 1h18M0 7h18M0 13h18",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})}),gd=()=>d.jsx("i",{className:"pi pi-refresh","aria-hidden":"true"}),pR=()=>d.jsx("svg",{width:"7",height:"12",viewBox:"0 0 7 12",fill:"none","aria-hidden":"true",children:d.jsx("path",{d:"M1 1l5 5-5 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),mR=()=>d.jsx("svg",{width:"7",height:"12",viewBox:"0 0 7 12",fill:"none","aria-hidden":"true",children:d.jsx("path",{d:"M6 1L1 6l5 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),gR=()=>d.jsx("svg",{width:"10",height:"6",viewBox:"0 0 10 6",fill:"none","aria-hidden":"true",children:d.jsx("path",{d:"M1 1l4 4 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function bR({label:t,badge:e,items:n,onSelect:r}){const[s,i]=x.useState(!1),o=x.useRef(null);return x.useEffect(()=>{if(!s)return;function l(a){var c;(c=o.current)!=null&&c.contains(a.target)||i(!1)}return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[s]),x.useEffect(()=>{if(!s)return;function l(a){a.key==="Escape"&&i(!1)}return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[s]),d.jsxs("div",{ref:o,className:ue.navBadgeDrop,children:[d.jsxs("button",{type:"button",className:ue.navBadgeDropBtn,onClick:()=>i(l=>!l),"aria-haspopup":"menu","aria-expanded":s,children:[d.jsx("span",{className:ue.navBadgeDropLabel,children:t}),d.jsx("span",{className:ue.navBadgeDropChevron,children:d.jsx(gR,{})}),d.jsx("span",{className:ue.navBadgeDropBadge,children:e})]}),s&&d.jsx("div",{role:"menu",className:ue.navBadgeDropMenu,children:n.map(l=>d.jsxs("div",{role:"menuitem",className:[ue.navBadgeDropItem,l.disabled?ue.navBadgeDropItemDisabled:""].filter(Boolean).join(" "),tabIndex:l.disabled?-1:0,"aria-disabled":l.disabled,onClick:()=>{l.disabled||(r==null||r(l.value),i(!1))},onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&!l.disabled&&(a.preventDefault(),r==null||r(l.value),i(!1))},children:[l.icon&&d.jsx("span",{"aria-hidden":"true",children:l.icon}),l.label]},l.value))})]})}function yR(t){const e=!t.label;return t.lightning&&t.items?d.jsx(eo,{variant:t.lightningVariant??"filled",size:"sm",items:t.items,onSelect:t.onSelect??(()=>{}),"aria-label":t.ariaLabel??"Quick actions"},t.value):e&&t.items?d.jsx($i,{label:"",leadingIcon:t.icon,variant:"secondary",size:"sm",items:t.items,onSelect:t.onSelect,"aria-label":t.ariaLabel??t.value},t.value):e?d.jsx(dt,{icon:t.icon,variant:"secondary",size:"sm","aria-label":t.ariaLabel??t.value,onClick:t.onClick},t.value):t.items&&t.badge!=null?d.jsx(bR,{label:t.label??"",badge:t.badge,items:t.items,onSelect:t.onSelect},t.value):t.items?d.jsx($i,{label:t.label??"",leadingIcon:t.icon,variant:t.variant??"secondary",size:"sm",items:t.items,onSelect:t.onSelect},t.value):d.jsx(Fe,{variant:t.variant??"secondary",size:"sm",leadingIcon:t.icon,onClick:t.onClick,children:t.label},t.value)}const rp=x.forwardRef(function(e,n){const{tabs:r,activeTabId:s,onTabChange:i,onMenuToggle:o,secondaryActions:l=[],onRefresh:a,primaryLabel:c="Save Loan",onPrimary:u,primaryItems:h,onPrimarySelect:p,condition:f,toolbar:m,banner:g,collapsed:b=!1,collapsedSection:y,onCollapsedBack:v,onExpandTabs:_,collapsedQuickItems:w=[],onCollapsedQuickAction:k}=e,C=r.find(T=>T.id===s),N=T=>[ue.breadcrumbDot,T?ue[`status_${T}`]:""].filter(Boolean).join(" "),O=u&&(h!=null&&h.length?d.jsx(fa,{label:c,onAction:u,items:h,onSelect:p,variant:"primary",size:"sm"}):d.jsx(Fe,{variant:"primary",size:"sm",onClick:u,children:c})),B=d.jsxs("div",{className:ue.actions,children:[f&&d.jsxs("div",{className:ue.conditionBadge,children:[d.jsx("span",{className:ue.conditionLabel,children:f.label}),f.onDismiss&&d.jsx("button",{className:ue.conditionDismiss,onClick:f.onDismiss,"aria-label":"Dismiss condition",children:d.jsx("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"none","aria-hidden":"true",children:d.jsx("path",{d:"M1 1l7 7M8 1L1 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}),l.map(T=>d.jsxs("div",{className:ue.actionItem,children:[T.dividerBefore&&d.jsx("span",{className:ue.divider,"aria-hidden":"true"}),yR(T)]},T.value)),a&&d.jsx(dt,{variant:"secondary",size:"sm","aria-label":"Refresh",icon:d.jsx(gd,{}),onClick:a}),O]}),S=d.jsxs("div",{className:ue.actions,children:[w.length>0&&d.jsx(eo,{variant:"filled",size:"sm",items:w,onSelect:k??(()=>{}),"aria-label":"Quick actions"}),a&&d.jsx(dt,{variant:"secondary",size:"sm","aria-label":"Refresh",icon:d.jsx(gd,{}),onClick:a}),O]});return d.jsxs("nav",{ref:n,className:[ue.nav,b?ue.collapsed:""].filter(Boolean).join(" "),children:[d.jsxs("div",{className:ue.mainRow,children:[d.jsx("button",{className:ue.menuToggle,onClick:o,"aria-label":"Toggle menu",children:d.jsx(fR,{})}),b?d.jsxs(d.Fragment,{children:[v&&d.jsx("button",{className:ue.backBtn,onClick:v,"aria-label":"Back",children:d.jsx(mR,{})}),d.jsxs("div",{className:ue.breadcrumbs,children:[y&&d.jsxs("div",{className:ue.breadcrumbItem,children:[y.status&&d.jsx("span",{className:N(y.status)}),d.jsxs("div",{className:ue.breadcrumbText,children:[d.jsx("span",{className:ue.breadcrumbLabel,children:y.label}),y.subLabel&&d.jsx("span",{className:ue.breadcrumbSublabel,children:y.subLabel})]})]}),C&&d.jsxs("div",{className:ue.breadcrumbItem,children:[C.status.shape!=="none"&&d.jsx("span",{className:N(C.status.color)}),d.jsxs("div",{className:ue.breadcrumbText,children:[d.jsxs("span",{className:ue.breadcrumbLabel,children:[C.label,C.subLabel?` / ${C.subLabel}`:""]}),C.subtitle&&d.jsx("span",{className:ue.breadcrumbSublabel,children:C.subtitle})]})]})]}),_&&d.jsx("button",{className:ue.expandBtn,onClick:_,"aria-label":"Show all tabs",children:d.jsx(pR,{})}),S]}):d.jsxs(d.Fragment,{children:[d.jsx("div",{className:ue.tabsArea,children:d.jsx(pa,{items:r,activeId:s,onChange:i})}),B]})]}),m&&!b&&d.jsxs("div",{className:ue.toolbarRow,children:[m.left&&d.jsx("div",{className:ue.toolbarLeft,children:m.left}),m.center&&d.jsx("div",{className:ue.toolbarCenter,children:m.center}),m.right&&d.jsx("div",{className:ue.toolbarRight,children:m.right})]}),g&&!b&&d.jsx(ma,{severity:g.severity??"warn",title:g.title,detail:g.detail,closable:g.closable??!0,onClose:g.onClose})]})}),xR="_wrapper_14b3i_8",vR="_wrapperScrollable_14b3i_18",_R="_scrollContainer_14b3i_22",kR="_table_14b3i_29",wR="_headerRow_14b3i_41",CR="_headerCell_14b3i_45",SR="_md_14b3i_58",NR="_sm_14b3i_59",AR="_headerCellSortable_14b3i_61",TR="_headerCellContent_14b3i_69",ER="_headerText_14b3i_76",MR="_sortIcon_14b3i_83",jR="_sortIconActive_14b3i_91",IR="_sortPriority_14b3i_95",DR="_filterBtnWrap_14b3i_104",OR="_filterBtn_14b3i_104",RR="_filterBtnActive_14b3i_130",LR="_expandCol_14b3i_138",BR="_selectCol_14b3i_139",$R="_editCol_14b3i_140",PR="_bodyRow_14b3i_149",zR="_bodyCell_14b3i_154",FR="_rowSelected_14b3i_158",HR="_rowStriped_14b3i_163",WR="_rowClickable_14b3i_167",VR="_expandCell_14b3i_189",qR="_selectCell_14b3i_190",UR="_editCell_14b3i_191",KR="_expandBtn_14b3i_197",GR="_groupRow_14b3i_219",JR="_groupCell_14b3i_223",YR="_groupToggle_14b3i_236",QR="_groupLabel_14b3i_244",XR="_groupCount_14b3i_248",ZR="_expansionRow_14b3i_256",eL="_expansionCell_14b3i_260",tL="_cellEditWrap_14b3i_272",nL="_cellInput_14b3i_284",rL="_rowEditBtns_14b3i_298",sL="_footerRow_14b3i_309",iL="_footerCell_14b3i_313",oL="_emptyCell_14b3i_325",lL="_loadingOverlay_14b3i_333",aL="_skeleton_14b3i_341",cL="_shimmer_14b3i_1",dL="_filterPopover_14b3i_360",uL="_filterBody_14b3i_382",hL="_filterRule_14b3i_391",fL="_filterOperatorRow_14b3i_397",pL="_filterOperatorBtn_14b3i_403",mL="_filterOperatorActive_14b3i_416",gL="_filterRuleRow_14b3i_422",bL="_filterInputRow_14b3i_428",yL="_filterSelect_14b3i_434",xL="_filterInput_14b3i_428",vL="_filterFieldFull_14b3i_461",_L="_filterRemoveBtn_14b3i_474",kL="_filterAddRule_14b3i_494",wL="_filterChecklist_14b3i_506",CL="_filterCheckItem_14b3i_514",SL="_filterGroup_14b3i_532",NL="_filterGroupHeader_14b3i_538",AL="_filterGroupLabel_14b3i_545",TL="_filterGroupClear_14b3i_553",EL="_filterFooter_14b3i_564",ML="_filterResetBtn_14b3i_574",jL="_filterApplyBtn_14b3i_591",z={wrapper:xR,wrapperScrollable:vR,scrollContainer:_R,table:kR,headerRow:wR,headerCell:CR,md:SR,sm:NR,headerCellSortable:AR,headerCellContent:TR,headerText:ER,sortIcon:MR,sortIconActive:jR,sortPriority:IR,filterBtnWrap:DR,filterBtn:OR,filterBtnActive:RR,expandCol:LR,selectCol:BR,editCol:$R,bodyRow:PR,bodyCell:zR,rowSelected:FR,rowStriped:HR,rowClickable:WR,expandCell:VR,selectCell:qR,editCell:UR,expandBtn:KR,groupRow:GR,groupCell:JR,groupToggle:YR,groupLabel:QR,groupCount:XR,expansionRow:ZR,expansionCell:eL,cellEditWrap:tL,cellInput:nL,rowEditBtns:rL,footerRow:sL,footerCell:iL,emptyCell:oL,loadingOverlay:lL,skeleton:aL,shimmer:cL,filterPopover:dL,filterBody:uL,filterRule:hL,filterOperatorRow:fL,filterOperatorBtn:pL,filterOperatorActive:mL,filterRuleRow:gL,filterInputRow:bL,filterSelect:yL,filterInput:xL,filterFieldFull:vL,filterRemoveBtn:_L,filterAddRule:kL,filterChecklist:wL,filterCheckItem:CL,filterGroup:SL,filterGroupHeader:NL,filterGroupLabel:AL,filterGroupClear:TL,filterFooter:EL,filterResetBtn:ML,filterApplyBtn:jL},bd=d.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:d.jsx("path",{d:"M1 1l8 8M9 1l-8 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})});function IL(t){const e=t.match(/^(\d{4})-(\d{2})-(\d{2})$/);return e?new Date(parseInt(e[1],10),parseInt(e[2],10)-1,parseInt(e[3],10)):null}function DL(t){const e=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0");return`${e}-${n}-${r}`}const OL=[{label:"Contains",value:"contains"},{label:"Starts with",value:"startsWith"},{label:"Ends with",value:"endsWith"},{label:"Equals",value:"equals"},{label:"Not equals",value:"notEquals"},{label:"Greater than",value:"gt"},{label:"Less than",value:"lt"},{label:"Blank",value:"blank"},{label:"Not blank",value:"notBlank"}],RL=[{label:"Date equal to",value:"dateEquals"},{label:"Date not equal to",value:"dateNotEquals"},{label:"Date before",value:"dateBefore"},{label:"Date after",value:"dateAfter"},{label:"Date on or before",value:"dateOnOrBefore"},{label:"Date on or after",value:"dateOnOrAfter"},{label:"Blank",value:"blank"},{label:"Not blank",value:"notBlank"}],yd=new Set(["blank","notBlank"]);function LL({value:t,dataType:e,onApply:n,onReset:r,onClose:s}){var m;const i=e==="date"?RL:OL,o=i[0].value,[l,a]=x.useState((m=t==null?void 0:t.rules)!=null&&m.length?t.rules:[{matchMode:o,value:""}]),[c,u]=x.useState((t==null?void 0:t.operator)??"and");function h(g,b){a(y=>y.map((v,_)=>_===g?{...v,...b}:v))}function p(){a(g=>[...g,{matchMode:o,value:""}])}function f(g){a(b=>b.filter((y,v)=>v!==g))}return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:z.filterBody,children:[l.map((g,b)=>d.jsxs("div",{className:z.filterRule,children:[b>0&&d.jsx("div",{className:z.filterOperatorRow,children:d.jsx(Al,{options:[{label:"AND",value:"and"},{label:"OR",value:"or"}],value:c,onChange:y=>u(y)})}),d.jsxs("div",{className:z.filterRuleRow,children:[d.jsx("div",{className:z.filterFieldFull,children:d.jsx(pr,{options:i,value:g.matchMode,onChange:y=>y&&h(b,{matchMode:y}),style:{width:"100%"}})}),!yd.has(g.matchMode)&&d.jsxs("div",{className:z.filterInputRow,children:[d.jsx("div",{className:z.filterFieldFull,children:e==="date"?d.jsx(Nl,{value:g.value?IL(g.value):null,onChange:y=>h(b,{value:y?DL(y):""}),style:{width:"100%"}}):d.jsx(gs,{placeholder:"Value",value:g.value,onChange:y=>h(b,{value:y.target.value})})}),l.length>1&&d.jsx(dt,{variant:"ghost",size:"sm",icon:bd,"aria-label":"Remove rule",onClick:()=>f(b)})]}),yd.has(g.matchMode)&&l.length>1&&d.jsx("div",{className:z.filterInputRow,children:d.jsx(dt,{variant:"ghost",size:"sm",icon:bd,"aria-label":"Remove rule",onClick:()=>f(b)})})]})]},b)),d.jsx(Fe,{variant:"ghost",size:"sm",onClick:p,style:{alignSelf:"flex-start"},children:"+ Add rule"})]}),d.jsx(ka,{onReset:r,onApply:()=>n({operator:c,rules:l}),onClose:s})]})}function BL({options:t=[],value:e,onApply:n,onReset:r,onClose:s}){const[i,o]=x.useState(new Set(e??[])),[l,a]=x.useState(""),c=t.filter(g=>g.label.toLowerCase().includes(l.toLowerCase())),u=c.length>0&&c.every(g=>i.has(g.value)),p=c.some(g=>i.has(g.value))&&!u;function f(g){o(b=>{const y=new Set(b);return y.has(g)?y.delete(g):y.add(g),y})}function m(){o(u?g=>{const b=new Set(g);return c.forEach(y=>b.delete(y.value)),b}:g=>{const b=new Set(g);return c.forEach(y=>b.add(y.value)),b})}return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:z.filterBody,children:[d.jsx(gs,{placeholder:"Search…",value:l,onChange:g=>a(g.target.value),prefixIcon:d.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:[d.jsx("circle",{cx:"6",cy:"6",r:"4.5",stroke:"currentColor",strokeWidth:"1.5"}),d.jsx("path",{d:"M9.5 9.5L12.5 12.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}),d.jsxs("div",{className:z.filterChecklist,children:[d.jsx(Gn,{label:"Select All",checked:u,indeterminate:p,onChange:m}),c.map(g=>d.jsx(Gn,{label:g.label,checked:i.has(g.value),onChange:()=>f(g.value)},String(g.value)))]})]}),d.jsx(ka,{onReset:r,onApply:()=>n(Array.from(i)),onClose:s})]})}function $L({groups:t=[],value:e,onApply:n,onReset:r,onClose:s}){const[i,o]=x.useState(new Set(e??[]));function l(c){o(u=>{const h=new Set(u);return h.has(c)?h.delete(c):h.add(c),h})}function a(c){o(u=>{const h=new Set(u);return c.options.forEach(p=>h.delete(p.value)),h})}return d.jsxs(d.Fragment,{children:[d.jsx("div",{className:z.filterBody,children:t.map(c=>d.jsxs("div",{className:z.filterGroup,children:[d.jsxs("div",{className:z.filterGroupHeader,children:[d.jsx("span",{className:z.filterGroupLabel,children:c.label}),d.jsx(Fe,{variant:"link",size:"sm",onClick:()=>a(c),children:"Clear All"})]}),c.options.map(u=>d.jsx(Gn,{label:u.label,checked:i.has(u.value),onChange:()=>l(u.value)},String(u.value)))]},c.label))}),d.jsx(ka,{onReset:r,onApply:()=>n(Array.from(i)),onClose:s})]})}function ka({onReset:t,onApply:e,onClose:n}){return d.jsxs("div",{className:z.filterFooter,children:[d.jsx(Fe,{variant:"secondary",size:"sm",onClick:()=>{t(),n()},children:"Reset"}),d.jsx(Fe,{variant:"primary",size:"sm",onClick:()=>{e(),n()},children:"Apply"})]})}function PL({config:t,onClose:e,anchorRef:n}){const r=x.useRef(null),[s,i]=x.useState(null);x.useEffect(()=>{function l(){var f;const a=(f=n.current)==null?void 0:f.getBoundingClientRect();if(!a)return;const c=280,u=360;let h=a.bottom+4,p=a.left;p+c>window.innerWidth-8&&(p=Math.max(8,a.right-c)),h+u>window.innerHeight-8&&(h=Math.max(8,a.top-u-4)),i({top:h,left:p})}return l(),window.addEventListener("scroll",l,!0),window.addEventListener("resize",l),()=>{window.removeEventListener("scroll",l,!0),window.removeEventListener("resize",l)}},[n]),x.useEffect(()=>{function l(a){const c=a.target;c.closest("[data-popover-root]")||r.current&&!r.current.contains(c)&&n.current&&!n.current.contains(c)&&e()}return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[e,n]),x.useEffect(()=>{function l(a){a.key==="Escape"&&e()}return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[e]);function o(){var l;(l=t.onChange)==null||l.call(t,null)}return s?Ut.createPortal(d.jsxs("div",{ref:r,"data-popover-root":"",className:z.filterPopover,style:{top:s.top,left:s.left},children:[t.type==="rule"&&d.jsx(LL,{value:t.value,dataType:t.dataType??"text",onApply:l=>{var a;return(a=t.onChange)==null?void 0:a.call(t,l)},onReset:o,onClose:e}),t.type==="checklist"&&d.jsx(BL,{options:t.options,value:t.value,onApply:l=>{var a;return(a=t.onChange)==null?void 0:a.call(t,l)},onReset:o,onClose:e}),t.type==="grouped-checklist"&&d.jsx($L,{groups:t.groups,value:t.value,onApply:l=>{var a;return(a=t.onChange)==null?void 0:a.call(t,l)},onReset:o,onClose:e})]}),document.body):null}function xd(t){return t.length>0&&typeof t[0]=="object"&&t[0]!==null&&"label"in t[0]&&"data"in t[0]}function Nt(t,e){return t[e]}function $r(t,e){return t[e]}function zL(){return d.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:d.jsx("path",{d:"M5 2L2 6h6L5 2z",fill:"currentColor"})})}function FL(){return d.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:d.jsx("path",{d:"M5 8L2 4h6L5 8z",fill:"currentColor"})})}function HL(){return d.jsxs("svg",{width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",children:[d.jsx("path",{d:"M5 2L2 6h6L5 2z",fill:"currentColor",opacity:"0.3"}),d.jsx("path",{d:"M5 12L2 8h6l-3 4z",fill:"currentColor",opacity:"0.3"})]})}function WL({active:t}){return d.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:d.jsx("path",{d:"M1 2h8M2.5 5h5M4 8h2",stroke:t?"var(--teal-700,#047880)":"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function vd(){return d.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:d.jsx("path",{d:"M4 2l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function _d(){return d.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:d.jsx("path",{d:"M2 4l4 4 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}const kd=()=>d.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:d.jsx("path",{d:"M2 6l3 3 5-5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),VL=()=>d.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:d.jsx("path",{d:"M8 2l2 2-6 6H2V8l6-6z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function wa({data:t,columns:e,dataKey:n="id",selectionMode:r="none",selection:s,onSelectionChange:i,sortMode:o="single",sortField:l,sortOrder:a,multiSortMeta:c,onSort:u,expansion:h,editMode:p,onRowEditSave:f,onRowEditCancel:m,onCellEdit:g,stripedRows:b=!1,size:y="md",showFooter:v=!1,loading:_=!1,emptyMessage:w="No data found.",scrollable:k=!1,scrollHeight:C,className:N,style:O}){const[B,S]=x.useState(new Set),[T,P]=x.useState(()=>xd(t)?new Set(t.filter(A=>A.defaultExpanded!==!1).map(A=>A.label)):new Set),[L,R]=x.useState(null),[H,U]=x.useState(null),[M,$]=x.useState({}),[W,ie]=x.useState(null),ce=x.useRef(new Map),Te=xd(t),q=Te?t.flatMap(A=>A.data):t,he=!!h,j=r==="multiple",Y=p==="row",te=e.length+(he?1:0)+(j?1:0)+(Y?1:0);function Ye(A){var V;return o==="multiple"&&c?((V=c.find(de=>de.field===A))==null?void 0:V.order)??0:l===A?a??0:0}function ht(A){if(o!=="multiple"||!c)return null;const V=c.findIndex(de=>de.field===A);return V>=0?V+1:null}function Bt(A){if(!u)return;const de=Ye(A)===1?-1:1;if(o==="multiple"){const ne=c?[...c]:[],De=ne.findIndex(_t=>_t.field===A);De>=0?ne[De]={field:A,order:de}:ne.push({field:A,order:de}),u({field:A,order:de,multiSortMeta:ne})}else u({field:A,order:de})}function Dt(A){if(!s)return!1;const V=Nt(A,n);return Array.isArray(s)?s.some(de=>Nt(de,n)===V):Nt(s,n)===V}function rr(A){if(!(r==="none"&&p!=="cell")){if(r==="single")i==null||i(Dt(A)?null:A);else if(r==="multiple"){const V=Array.isArray(s)?[...s]:[],de=Nt(A,n),ne=V.findIndex(De=>Nt(De,n)===de);ne>=0?V.splice(ne,1):V.push(A),i==null||i(V)}}}function an(A){i==null||i(A?[...q]:[])}const $t=q.length>0&&q.every(A=>Dt(A)),Pt=!$t&&q.some(A=>Dt(A));function Gt(A){const V=h?Nt(A,h.dataKey):Nt(A,n);S(de=>{const ne=new Set(de);return ne.has(V)?ne.delete(V):ne.add(V),ne})}function wr(A){const V=h?Nt(A,h.dataKey):Nt(A,n);return B.has(V)}function sr(A){const V=Nt(A,n),de={};e.forEach(ne=>{de[ne.field]=$r(A,ne.field)}),R(V),$(de)}function Cr(A){const V={...A,...M};f==null||f(V,A),R(null),$({})}function G(){R(null),$({}),m==null||m()}function D(A,V){const de=Nt(A,n);U({rowKey:de,field:V}),$({[V]:$r(A,V)})}function ee(A,V){const de={...A,[V]:M[V]};g==null||g(de,V,M[V]),U(null),$({})}function ge(A){return ce.current.has(A)||ce.current.set(A,{current:null}),ce.current.get(A)}function ke(A){var de;if(!((de=A.filter)!=null&&de.value))return!1;const V=A.filter.value;return Array.isArray(V)?V.length>0:typeof V=="object"&&V!==null?(V.rules??[]).some(De=>De.value!==""):!1}const vt=()=>d.jsx("thead",{children:d.jsxs("tr",{className:z.headerRow,children:[he&&d.jsx("th",{className:`${z.headerCell} ${z.expandCol}`}),j&&d.jsx("th",{className:`${z.headerCell} ${z.selectCol}`,children:d.jsx(Gn,{checked:$t,indeterminate:Pt,onChange:A=>an(A.target.checked),"aria-label":"Select all rows",size:"sm"})}),e.map(A=>{const V=Ye(A.field),de=ht(A.field),ne=A.filter?ge(A.field):null;return d.jsx("th",{className:`${z.headerCell} ${A.sortable?z.headerCellSortable:""}`,style:{width:A.width,textAlign:A.align??"left"},onClick:()=>A.sortable&&Bt(A.field),"aria-sort":V===1?"ascending":V===-1?"descending":"none",children:d.jsxs("span",{className:z.headerCellContent,children:[d.jsx("span",{className:z.headerText,children:A.header}),A.sortable&&d.jsxs("span",{className:`${z.sortIcon} ${V!==0?z.sortIconActive:""}`,children:[V===1?d.jsx(zL,{}):V===-1?d.jsx(FL,{}):d.jsx(HL,{}),de!==null&&d.jsx("span",{className:z.sortPriority,children:de})]}),A.filter&&d.jsxs("div",{className:z.filterBtnWrap,onClick:De=>De.stopPropagation(),children:[d.jsx("button",{ref:ne,type:"button",className:`${z.filterBtn} ${ke(A)?z.filterBtnActive:""}`,"aria-label":`Filter ${A.header}`,onClick:()=>ie(De=>De===A.field?null:A.field),children:d.jsx(WL,{active:ke(A)})}),W===A.field&&ne&&d.jsx(PL,{config:A.filter,onClose:()=>ie(null),anchorRef:ne})]})]})},A.field)}),Y&&d.jsx("th",{className:`${z.headerCell} ${z.editCol}`})]})}),ft=x.useCallback((A,V,de)=>{const ne=Nt(A,n),De=Dt(A),_t=he&&wr(A),_s=p==="row"&&L===ne,to=[z.bodyRow,De?z.rowSelected:"",b&&de?z.rowStriped:"",r!=="none"?z.rowClickable:""].filter(Boolean).join(" "),re=e.map(Ee=>{const no=p==="cell"&&H!=null&&H.rowKey===ne&&H.field===Ee.field,Ca=_s||no;let ir;return Ca&&Ee.editor?ir=Ee.editor({...A,...M},Ee.field,Mn=>$(ro=>({...ro,[Ee.field]:Mn}))):Ca?ir=d.jsx("input",{className:z.cellInput,value:String(M[Ee.field]??$r(A,Ee.field)??""),onChange:Mn=>$(ro=>({...ro,[Ee.field]:Mn.target.value}))}):Ee.body?ir=Ee.body(A,V):ir=String($r(A,Ee.field)??""),d.jsx("td",{className:z.bodyCell,style:{textAlign:Ee.align??"left"},onClick:()=>{p==="cell"&&Ee.editor&&!no&&(H&&ee(A,H.field),D(A,Ee.field))},children:no?d.jsxs("div",{className:z.cellEditWrap,children:[ir,d.jsx(dt,{variant:"ghost",size:"sm",icon:d.jsx(kd,{}),"aria-label":"Confirm edit",onClick:Mn=>{Mn.stopPropagation(),ee(A,Ee.field)}}),d.jsx(Lt,{size:"sm","aria-label":"Cancel edit",onClick:Mn=>{Mn.stopPropagation(),U(null),$({})}})]}):ir},Ee.field)});return d.jsxs(d.Fragment,{children:[d.jsxs("tr",{className:to,onClick:()=>{r!=="none"&&rr(A)},"aria-selected":r!=="none"?De:void 0,children:[he&&d.jsx("td",{className:`${z.bodyCell} ${z.expandCell}`,children:d.jsx("button",{type:"button",className:z.expandBtn,onClick:Ee=>{Ee.stopPropagation(),Gt(A)},"aria-label":_t?"Collapse row":"Expand row","aria-expanded":_t,children:_t?d.jsx(_d,{}):d.jsx(vd,{})})}),j&&d.jsx("td",{className:`${z.bodyCell} ${z.selectCell}`,onClick:Ee=>Ee.stopPropagation(),children:d.jsx(Gn,{checked:De,onChange:()=>rr(A),"aria-label":"Select row",size:"sm"})}),re,Y&&d.jsx("td",{className:`${z.bodyCell} ${z.editCell}`,onClick:Ee=>Ee.stopPropagation(),children:_s?d.jsxs("div",{className:z.rowEditBtns,children:[d.jsx(dt,{variant:"ghost",size:"sm",icon:d.jsx(kd,{}),"aria-label":"Save row",onClick:()=>Cr(A)}),d.jsx(Lt,{size:"sm","aria-label":"Cancel edit",onClick:G})]}):d.jsx(dt,{variant:"ghost",size:"sm",icon:d.jsx(VL,{}),"aria-label":"Edit row",onClick:()=>sr(A)})})]},String(ne)),he&&_t&&h&&d.jsx("tr",{className:z.expansionRow,children:d.jsx("td",{colSpan:te,className:z.expansionCell,children:h.template?h.template(A):h.childKey?d.jsx(wa,{data:$r(A,String(h.childKey))??[],columns:h.columns??e,dataKey:n,selectionMode:r,stripedRows:b,size:y,showFooter:v,editMode:p}):null})},`${String(ne)}-expansion`)]})},[e,L,H,M,B,s,b,he,j,Y,r,p]),Jt=()=>_?d.jsx("tbody",{children:Array.from({length:5}).map((A,V)=>d.jsx("tr",{className:z.bodyRow,children:Array.from({length:te}).map((de,ne)=>d.jsx("td",{className:z.bodyCell,children:d.jsx("span",{className:z.skeleton})},ne))},V))}):q.length===0?d.jsx("tbody",{children:d.jsx("tr",{children:d.jsx("td",{colSpan:te,className:z.emptyCell,children:w})})}):Te?d.jsx("tbody",{children:t.map(A=>{const V=T.has(A.label);return d.jsxs(d.Fragment,{children:[d.jsx("tr",{className:z.groupRow,onClick:()=>P(de=>{const ne=new Set(de);return ne.has(A.label)?ne.delete(A.label):ne.add(A.label),ne}),children:d.jsxs("td",{colSpan:te,className:z.groupCell,children:[d.jsx("span",{className:z.groupToggle,children:V?d.jsx(_d,{}):d.jsx(vd,{})}),d.jsx("span",{className:z.groupLabel,children:A.label}),d.jsxs("span",{className:z.groupCount,children:["(",A.data.length,")"]})]})},`group-${A.label}`),V&&A.data.map((de,ne)=>ft(de,ne,ne%2!==0))]})})}):d.jsx("tbody",{children:t.map((A,V)=>ft(A,V,V%2!==0))}),Sr=()=>!v||!e.some(V=>V.footer!==void 0)?null:d.jsx("tfoot",{children:d.jsxs("tr",{className:z.footerRow,children:[he&&d.jsx("td",{className:z.footerCell}),j&&d.jsx("td",{className:z.footerCell}),e.map(V=>d.jsx("td",{className:z.footerCell,style:{textAlign:V.align??"left"},children:typeof V.footer=="function"?V.footer(q):V.footer},V.field)),Y&&d.jsx("td",{className:z.footerCell})]})}),Nr=[z.table,z[y],b?z.striped:""].filter(Boolean).join(" "),cn=[z.wrapper,k?z.wrapperScrollable:"",N??""].filter(Boolean).join(" ");return d.jsxs("div",{className:cn,style:O,children:[d.jsx("div",{className:z.scrollContainer,style:k&&C?{maxHeight:C,overflowY:"auto"}:void 0,children:d.jsxs("table",{className:Nr,role:"grid",children:[vt(),Jt(),Sr()]})}),_&&d.jsx("div",{className:z.loadingOverlay,"aria-busy":"true","aria-label":"Loading"})]})}wa.displayName="DataTable";const qL="_shell_1l18z_1",sp={shell:qL};function UL({topBar:t,loanBannerNav:e,urlATabsNav:n,className:r,style:s}){return d.jsxs("div",{className:[sp.shell,r].filter(Boolean).join(" "),style:s,children:[d.jsx(tp,{...t}),e&&d.jsx(rp,{...e}),n&&d.jsx(va,{...n})]})}function KL({topBar:t,urlATabsNavMobile:e,className:n,style:r}){const s=!!t.borrower&&!!e;return d.jsxs("div",{className:[sp.shell,n].filter(Boolean).join(" "),style:r,children:[d.jsx(np,{...t}),s&&d.jsx(_a,{...e})]})}exports.AUSChip=Wf;exports.Accordion=If;exports.BannerAlert=ma;exports.BannerTabs=pa;exports.Button=Fe;exports.Calendar=Nd;exports.Card=jf;exports.Checkbox=Gn;exports.CloseButton=Lt;exports.DEFAULT_DOC_TYPES=Uf;exports.DataTable=wa;exports.DatePicker=Nl;exports.Drawer=Of;exports.DropdownButton=$i;exports.FileUpload=Kf;exports.FullNav=UL;exports.FullNavMobile=KL;exports.IconButton=dt;exports.InlineAlert=qf;exports.InlineContainedAlert=Vf;exports.InputText=gs;exports.LightningButton=eo;exports.ListBox=wd;exports.LoanBannerNav=rp;exports.MiscChip=Gs;exports.Modal=Gf;exports.MultiSelect=Sd;exports.Paginator=Ef;exports.Picklist=Mf;exports.Popup=Jf;exports.ProfileChip=Hf;exports.ProgressBar=Pf;exports.ProgressSpinner=zf;exports.RadioButton=Cd;exports.RichTextEditor=wf;exports.Select=pr;exports.SelectButton=Al;exports.SeverityChip=Ff;exports.SidePanel=Yf;exports.SidePanelLayout=Qf;exports.SplitButton=fa;exports.Tabs=Df;exports.TextArea=Ad;exports.Toast=$f;exports.Toaster=Bf;exports.ToggleSwitch=Cf;exports.Tooltip=er;exports.TopBar=tp;exports.TopBarMobile=np;exports.URLATabsNav=va;exports.URLATabsNavMobile=_a;exports.URLATabsNavTablet=Xf;exports.toast=jM;
|
|
171
|
+
`),[i,o]=YC(s);if(i.length===0)return;const l=df(i,0,n);return l.length===0?void 0:{type:"list",ordered:!0,start:((r=i[0])==null?void 0:r.number)||1,items:l,raw:s.slice(0,o).join(`
|
|
172
|
+
`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(XC,this.editor.getAttributes(sd)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=vr({find:id,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=vr({find:id,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(sd)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),ZC=/^\s*(\[([( |x])?\])\s$/,hf=lt.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{const e=t.getAttribute("data-checked");return e===""||e==="true"},renderHTML:t=>({"data-checked":t.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:t,HTMLAttributes:e}){return["li",ye(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(t,e)=>{const n=[];if(t.tokens&&t.tokens.length>0?n.push(e.createNode("paragraph",{},e.parseInline(t.tokens))):t.text?n.push(e.createNode("paragraph",{},[e.createNode("text",{text:t.text})])):n.push(e.createNode("paragraph",{},[])),t.nestedTokens&&t.nestedTokens.length>0){const r=e.parseChildren(t.nestedTokens);n.push(...r)}return e.createNode("taskItem",{checked:t.checked||!1},n)},renderMarkdown:(t,e)=>{var n;const s=`- [${(n=t.attrs)!=null&&n.checked?"x":" "}] `;return ea(t,e,s)},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:n,editor:r})=>{const s=document.createElement("li"),i=document.createElement("label"),o=document.createElement("span"),l=document.createElement("input"),a=document.createElement("div"),c=h=>{var p,f;l.ariaLabel=((f=(p=this.options.a11y)==null?void 0:p.checkboxLabel)==null?void 0:f.call(p,h,l.checked))||`Task item checkbox for ${h.textContent||"empty task item"}`};c(t),i.contentEditable="false",l.type="checkbox",l.addEventListener("mousedown",h=>h.preventDefault()),l.addEventListener("change",h=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){l.checked=!l.checked;return}const{checked:p}=h.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:f})=>{const m=n();if(typeof m!="number")return!1;const g=f.doc.nodeAt(m);return f.setNodeMarkup(m,void 0,{...g==null?void 0:g.attrs,checked:p}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,p)||(l.checked=!l.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([h,p])=>{s.setAttribute(h,p)}),s.dataset.checked=t.attrs.checked,l.checked=t.attrs.checked,i.append(l,o),s.append(i,a),Object.entries(e).forEach(([h,p])=>{s.setAttribute(h,p)});let u=new Set(Object.keys(e));return{dom:s,contentDOM:a,update:h=>{if(h.type!==this.type)return!1;s.dataset.checked=h.attrs.checked,l.checked=h.attrs.checked,c(h);const p=r.extensionManager.attributes,f=ds(h,p),m=new Set(Object.keys(f)),g=this.options.HTMLAttributes;return u.forEach(b=>{m.has(b)||(b in g?s.setAttribute(b,g[b]):s.removeAttribute(b))}),Object.entries(f).forEach(([b,y])=>{y==null?b in g?s.setAttribute(b,g[b]):s.removeAttribute(b):s.setAttribute(b,y)}),u=m,!0}}}},addInputRules(){return[vr({find:ZC,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),ff=lt.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:t}){return["ul",ye(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},parseMarkdown:(t,e)=>e.createNode("taskList",{},e.parseChildren(t.items||[])),renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
|
|
173
|
+
`):"",markdownTokenizer:{name:"taskList",level:"block",start(t){var e;const n=(e=t.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:e.index;return n!==void 0?n:-1},tokenize(t,e,n){const r=i=>{const o=hl(i,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:l=>({indentLevel:l[1].length,mainContent:l[4],checked:l[3].toLowerCase()==="x"}),createToken:(l,a)=>({type:"taskItem",raw:"",mainContent:l.mainContent,indentLevel:l.indentLevel,checked:l.checked,text:l.mainContent,tokens:n.inlineTokens(l.mainContent),nestedTokens:a}),customNestedParser:r},n);return o?[{type:"taskList",raw:o.raw,items:o.items}]:n.blockTokens(i)},s=hl(t,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:i=>({indentLevel:i[1].length,mainContent:i[4],checked:i[3].toLowerCase()==="x"}),createToken:(i,o)=>({type:"taskItem",raw:"",mainContent:i.mainContent,indentLevel:i.indentLevel,checked:i.checked,text:i.mainContent,tokens:n.inlineTokens(i.mainContent),nestedTokens:o}),customNestedParser:r},n);if(s)return{type:"taskList",raw:s.raw,items:s.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});Me.create({name:"listKit",addExtensions(){const t=[];return this.options.bulletList!==!1&&t.push(tf.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(nf.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(cf.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(uf.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(hf.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(ff.configure(this.options.taskList)),t}});var Ps=" ",Po=" ",eS=lt.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",ye(this.options.HTMLAttributes,t),0]},parseMarkdown:(t,e)=>{const n=t.tokens||[];if(n.length===1&&n[0].type==="image")return e.parseChildren([n[0]]);const r=e.parseInline(n);return n.length===1&&n[0].type==="text"&&(n[0].raw===Ps||n[0].text===Ps||n[0].raw===Po||n[0].text===Po)&&r.length===1&&r[0].type==="text"&&(r[0].text===Ps||r[0].text===Po)?e.createNode("paragraph",void 0,[]):e.createNode("paragraph",void 0,r)},renderMarkdown:(t,e,n)=>{var r,s;if(!t)return"";const i=Array.isArray(t.content)?t.content:[];if(i.length===0){const o=Array.isArray((r=n==null?void 0:n.previousNode)==null?void 0:r.content)?n.previousNode.content:[];return((s=n==null?void 0:n.previousNode)==null?void 0:s.type)==="paragraph"&&o.length===0?Ps:""}return e.renderChildren(i)},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),tS=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,nS=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,rS=Kt.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",ye(this.options.HTMLAttributes,t),0]},markdownTokenName:"del",parseMarkdown:(t,e)=>e.applyMark("strike",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`~~${e.renderChildren(t)}~~`,addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Zn({find:tS,type:this.type})]},addPasteRules(){return[Nn({find:nS,type:this.type})]}}),sS=lt.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),pf=Kt.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",ye(this.options.HTMLAttributes,t),0]},parseMarkdown(t,e){return e.applyMark(this.name||"underline",e.parseInline(t.tokens||[]))},renderMarkdown(t,e){return`++${e.renderChildren(t)}++`},markdownTokenizer:{name:"underline",level:"inline",start(t){return t.indexOf("++")},tokenize(t,e,n){const s=/^(\+\+)([\s\S]+?)(\+\+)/.exec(t);if(!s)return;const i=s[2].trim();return{type:"underline",raw:s[0],text:i,tokens:n.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),iS=pf;function oS(t={}){return new Se({view(e){return new lS(e,t)}})}class lS{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(s=>{let i=o=>{this[s](o)};return e.dom.addEventListener(s,i),{name:s,handler:i}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r,s=this.editorView.dom,i=s.getBoundingClientRect(),o=i.width/s.offsetWidth,l=i.height/s.offsetHeight;if(n){let h=e.nodeBefore,p=e.nodeAfter;if(h||p){let f=this.editorView.nodeDOM(this.cursorPos-(h?h.nodeSize:0));if(f){let m=f.getBoundingClientRect(),g=h?m.bottom:m.top;h&&p&&(g=(g+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let b=this.width/2*l;r={left:m.left,right:m.right,top:g-b,bottom:g+b}}}}if(!r){let h=this.editorView.coordsAtPos(this.cursorPos),p=this.width/2*o;r={left:h.left-p,right:h.left+p,top:h.top,bottom:h.bottom}}let a=this.editorView.dom.offsetParent;this.element||(this.element=a.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let c,u;if(!a||a==document.body&&getComputedStyle(a).position=="static")c=-pageXOffset,u=-pageYOffset;else{let h=a.getBoundingClientRect(),p=h.width/a.offsetWidth,f=h.height/a.offsetHeight;c=h.left-a.scrollLeft*p,u=h.top-a.scrollTop*f}this.element.style.left=(r.left-c)/o+"px",this.element.style.top=(r.top-u)/l+"px",this.element.style.width=(r.right-r.left)/o+"px",this.element.style.height=(r.bottom-r.top)/l+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),s=r&&r.type.spec.disableDropCursor,i=typeof s=="function"?s(this.editorView,n,e):s;if(n&&!i){let o=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=eu(this.editorView.state.doc,o,this.editorView.dragging.slice);l!=null&&(o=l)}this.setCursor(o),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class Ee extends oe{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return Ee.valid(r)?new Ee(r):oe.near(r)}content(){return F.empty}eq(e){return e instanceof Ee&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Ee(e.resolve(n.pos))}getBookmark(){return new ha(this.anchor)}static valid(e){let n=e.parent;if(n.inlineContent||!aS(e)||!cS(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let s=n.contentMatchAt(e.index()).defaultType;return s&&s.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&Ee.valid(e))return e;let s=e.pos,i=null;for(let o=e.depth;;o--){let l=e.node(o);if(n>0?e.indexAfter(o)<l.childCount:e.index(o)>0){i=l.child(n>0?e.indexAfter(o):e.index(o)-1);break}else if(o==0)return null;s+=n;let a=e.doc.resolve(s);if(Ee.valid(a))return a}for(;;){let o=n>0?i.firstChild:i.lastChild;if(!o){if(i.isAtom&&!i.isText&&!J.isSelectable(i)){e=e.doc.resolve(s+i.nodeSize*n),r=!1;continue e}break}i=o,s+=n;let l=e.doc.resolve(s);if(Ee.valid(l))return l}return null}}}Ee.prototype.visible=!1;Ee.findFrom=Ee.findGapCursorFrom;oe.jsonID("gapcursor",Ee);class ha{constructor(e){this.pos=e}map(e){return new ha(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return Ee.valid(n)?new Ee(n):oe.near(n)}}function mf(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}function aS(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let s=r.child(n-1);;s=s.lastChild){if(s.childCount==0&&!s.inlineContent||mf(s.type))return!0;if(s.inlineContent)return!1}}return!0}function cS(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let s=r.child(n);;s=s.firstChild){if(s.childCount==0&&!s.inlineContent||mf(s.type))return!0;if(s.inlineContent)return!1}}return!0}function dS(){return new Se({props:{decorations:pS,createSelectionBetween(t,e,n){return e.pos==n.pos&&Ee.valid(n)?new Ee(n):null},handleClick:hS,handleKeyDown:uS,handleDOMEvents:{beforeinput:fS}}})}const uS=nh({ArrowLeft:zs("horiz",-1),ArrowRight:zs("horiz",1),ArrowUp:zs("vert",-1),ArrowDown:zs("vert",1)});function zs(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,s,i){let o=r.selection,l=e>0?o.$to:o.$from,a=o.empty;if(o instanceof X){if(!i.endOfTextblock(n)||l.depth==0)return!1;a=!1,l=r.doc.resolve(e>0?l.after():l.before())}let c=Ee.findGapCursorFrom(l,e,a);return c?(s&&s(r.tr.setSelection(new Ee(c))),!0):!1}}function hS(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!Ee.valid(r))return!1;let s=t.posAtCoords({left:n.clientX,top:n.clientY});return s&&s.inside>-1&&J.isSelectable(t.state.doc.nodeAt(s.inside))?!1:(t.dispatch(t.state.tr.setSelection(new Ee(r))),!0)}function fS(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof Ee))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let s=M.empty;for(let o=r.length-1;o>=0;o--)s=M.from(r[o].createAndFill(null,s));let i=t.state.tr.replace(n.pos,n.pos,new F(s,0,0));return i.setSelection(X.near(i.doc.resolve(n.pos+1))),t.dispatch(i),!1}function pS(t){if(!(t.selection instanceof Ee))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Ce.create(t.doc,[tt.widget(t.selection.head,e,{key:"gapcursor"})])}var Bi=200,qe=function(){};qe.prototype.append=function(e){return e.length?(e=qe.from(e),!this.length&&e||e.length<Bi&&this.leafAppend(e)||this.length<Bi&&e.leafPrepend(this)||this.appendInner(e)):this};qe.prototype.prepend=function(e){return e.length?qe.from(e).append(this):this};qe.prototype.appendInner=function(e){return new mS(this,e)};qe.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?qe.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};qe.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};qe.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)};qe.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var s=[];return this.forEach(function(i,o){return s.push(e(i,o))},n,r),s};qe.from=function(e){return e instanceof qe?e:e&&e.length?new gf(e):qe.empty};var gf=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(s,i){return s==0&&i==this.length?this:new e(this.values.slice(s,i))},e.prototype.getInner=function(s){return this.values[s]},e.prototype.forEachInner=function(s,i,o,l){for(var a=i;a<o;a++)if(s(this.values[a],l+a)===!1)return!1},e.prototype.forEachInvertedInner=function(s,i,o,l){for(var a=i-1;a>=o;a--)if(s(this.values[a],l+a)===!1)return!1},e.prototype.leafAppend=function(s){if(this.length+s.length<=Bi)return new e(this.values.concat(s.flatten()))},e.prototype.leafPrepend=function(s){if(this.length+s.length<=Bi)return new e(s.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(qe);qe.empty=new gf([]);var mS=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,s,i,o){var l=this.left.length;if(s<l&&this.left.forEachInner(r,s,Math.min(i,l),o)===!1||i>l&&this.right.forEachInner(r,Math.max(s-l,0),Math.min(this.length,i)-l,o+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,s,i,o){var l=this.left.length;if(s>l&&this.right.forEachInvertedInner(r,s-l,Math.max(i,l)-l,o+l)===!1||i<l&&this.left.forEachInvertedInner(r,Math.min(s,l),i,o)===!1)return!1},e.prototype.sliceInner=function(r,s){if(r==0&&s==this.length)return this;var i=this.left.length;return s<=i?this.left.slice(r,s):r>=i?this.right.slice(r-i,s-i):this.left.slice(r,i).append(this.right.slice(0,s-i))},e.prototype.leafAppend=function(r){var s=this.right.leafAppend(r);if(s)return new e(this.left,s)},e.prototype.leafPrepend=function(r){var s=this.left.leafPrepend(r);if(s)return new e(s,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(qe);const gS=500;class Ot{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let s,i;n&&(s=this.remapping(r,this.items.length),i=s.maps.length);let o=e.tr,l,a,c=[],u=[];return this.items.forEach((h,p)=>{if(!h.step){s||(s=this.remapping(r,p+1),i=s.maps.length),i--,u.push(h);return}if(s){u.push(new Wt(h.map));let f=h.step.map(s.slice(i)),m;f&&o.maybeStep(f).doc&&(m=o.mapping.maps[o.mapping.maps.length-1],c.push(new Wt(m,void 0,void 0,c.length+u.length))),i--,m&&s.appendMap(m,i)}else o.maybeStep(h.step);if(h.selection)return l=s?h.selection.map(s.slice(i)):h.selection,a=new Ot(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:a,transform:o,selection:l}}addTransform(e,n,r,s){let i=[],o=this.eventCount,l=this.items,a=!s&&l.length?l.get(l.length-1):null;for(let u=0;u<e.steps.length;u++){let h=e.steps[u].invert(e.docs[u]),p=new Wt(e.mapping.maps[u],h,n),f;(f=a&&a.merge(p))&&(p=f,u?i.pop():l=l.slice(0,l.length-1)),i.push(p),n&&(o++,n=void 0),s||(a=p)}let c=o-r.depth;return c>yS&&(l=bS(l,c),o-=c),new Ot(l.append(i),o)}remapping(e,n){let r=new rs;return this.items.forEach((s,i)=>{let o=s.mirrorOffset!=null&&i-s.mirrorOffset>=e?r.maps.length-s.mirrorOffset:void 0;r.appendMap(s.map,o)},e,n),r}addMaps(e){return this.eventCount==0?this:new Ot(this.items.append(e.map(n=>new Wt(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],s=Math.max(0,this.items.length-n),i=e.mapping,o=e.steps.length,l=this.eventCount;this.items.forEach(p=>{p.selection&&l--},s);let a=n;this.items.forEach(p=>{let f=i.getMirror(--a);if(f==null)return;o=Math.min(o,f);let m=i.maps[f];if(p.step){let g=e.steps[f].invert(e.docs[f]),b=p.selection&&p.selection.map(i.slice(a+1,f));b&&l++,r.push(new Wt(m,g,b))}else r.push(new Wt(m))},s);let c=[];for(let p=n;p<o;p++)c.push(new Wt(i.maps[p]));let u=this.items.slice(0,s).append(c).append(r),h=new Ot(u,l);return h.emptyItemCount()>gS&&(h=h.compress(this.items.length-r.length)),h}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,s=[],i=0;return this.items.forEach((o,l)=>{if(l>=e)s.push(o),o.selection&&i++;else if(o.step){let a=o.step.map(n.slice(r)),c=a&&a.getMap();if(r--,c&&n.appendMap(c,r),a){let u=o.selection&&o.selection.map(n.slice(r));u&&i++;let h=new Wt(c.invert(),a,u),p,f=s.length-1;(p=s.length&&s[f].merge(h))?s[f]=p:s.push(h)}}else o.map&&r--},this.items.length,0),new Ot(qe.from(s.reverse()),i)}}Ot.empty=new Ot(qe.empty,0);function bS(t,e){let n;return t.forEach((r,s)=>{if(r.selection&&e--==0)return n=s,!1}),t.slice(n)}class Wt{constructor(e,n,r,s){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=s}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new Wt(n.getMap().invert(),n,this.selection)}}}class mn{constructor(e,n,r,s,i){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=s,this.prevComposition=i}}const yS=20;function xS(t,e,n,r){let s=n.getMeta(Kn),i;if(s)return s.historyState;n.getMeta(kS)&&(t=new mn(t.done,t.undone,null,0,-1));let o=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(o&&o.getMeta(Kn))return o.getMeta(Kn).redo?new mn(t.done.addTransform(n,void 0,r,Ks(e)),t.undone,od(n.mapping.maps),t.prevTime,t.prevComposition):new mn(t.done,t.undone.addTransform(n,void 0,r,Ks(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let l=n.getMeta("composition"),a=t.prevTime==0||!o&&t.prevComposition!=l&&(t.prevTime<(n.time||0)-r.newGroupDelay||!vS(n,t.prevRanges)),c=o?zo(t.prevRanges,n.mapping):od(n.mapping.maps);return new mn(t.done.addTransform(n,a?e.selection.getBookmark():void 0,r,Ks(e)),Ot.empty,c,n.time,l??t.prevComposition)}else return(i=n.getMeta("rebased"))?new mn(t.done.rebased(n,i),t.undone.rebased(n,i),zo(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new mn(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),zo(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function vS(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,s)=>{for(let i=0;i<e.length;i+=2)r<=e[i+1]&&s>=e[i]&&(n=!0)}),n}function od(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,s,i,o)=>e.push(i,o));return e}function zo(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let s=e.map(t[r],1),i=e.map(t[r+1],-1);s<=i&&n.push(s,i)}return n}function _S(t,e,n){let r=Ks(e),s=Kn.get(e).spec.config,i=(n?t.undone:t.done).popEvent(e,r);if(!i)return null;let o=i.selection.resolve(i.transform.doc),l=(n?t.done:t.undone).addTransform(i.transform,e.selection.getBookmark(),s,r),a=new mn(n?l:i.remaining,n?i.remaining:l,null,0,-1);return i.transform.setSelection(o).setMeta(Kn,{redo:n,historyState:a})}let Fo=!1,ld=null;function Ks(t){let e=t.plugins;if(ld!=e){Fo=!1,ld=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Fo=!0;break}}return Fo}const Kn=new Le("history"),kS=new Le("closeHistory");function wS(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Se({key:Kn,state:{init(){return new mn(Ot.empty,Ot.empty,null,0,-1)},apply(e,n,r){return xS(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,s=r=="historyUndo"?yf:r=="historyRedo"?xf:null;return!s||!e.editable?!1:(n.preventDefault(),s(e.state,e.dispatch))}}}})}function bf(t,e){return(n,r)=>{let s=Kn.getState(n);if(!s||(t?s.undone:s.done).eventCount==0)return!1;if(r){let i=_S(s,n,t);i&&r(e?i.scrollIntoView():i)}return!0}}const yf=bf(!1,!0),xf=bf(!0,!0);Me.create({name:"characterCount",addOptions(){return{limit:null,autoTrim:!0,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc;if(((t==null?void 0:t.mode)||this.options.mode)==="textSize"){const r=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(r)}return e.nodeSize},this.storage.words=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc,n=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let t=!1;return[new Se({key:new Le("characterCount"),appendTransaction:(e,n,r)=>{if(t)return;const s=this.options.limit,i=this.options.autoTrim;if(s==null||s===0||i===!1){t=!0;return}const o=this.storage.characters({node:r.doc});if(o>s){const l=o-s,a=0,c=l;console.warn(`[CharacterCount] Initial content exceeded limit of ${s} characters. Content was automatically trimmed.`);const u=r.tr.deleteRange(a,c);return t=!0,u}t=!0},filterTransaction:(e,n)=>{const r=this.options.limit;if(!e.docChanged||r===0||r===null||r===void 0)return!0;const s=this.storage.characters({node:n.doc}),i=this.storage.characters({node:e.doc});if(i<=r||s>r&&i>r&&i<=s)return!0;if(s>r&&i>r&&i>s||!e.getMeta("paste"))return!1;const l=e.selection.$head.pos,a=i-r,c=l-a,u=l;return e.deleteRange(c,u),!(this.storage.characters({node:e.doc})>r)}})]}});var CS=Me.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[oS(this.options)]}});Me.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new Se({key:new Le("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:s}=e,i=[];if(!n||!r)return Ce.create(t,[]);let o=0;this.options.mode==="deepest"&&t.descendants((a,c)=>{if(a.isText)return;if(!(s>=c&&s<=c+a.nodeSize-1))return!1;o+=1});let l=0;return t.descendants((a,c)=>{if(a.isText||!(s>=c&&s<=c+a.nodeSize-1))return!1;if(l+=1,this.options.mode==="deepest"&&o-l>0||this.options.mode==="shallowest"&&l>1)return this.options.mode==="deepest";i.push(tt.node(c,c+a.nodeSize,{class:this.options.className}))}),Ce.create(t,i)}}})]}});var SS=Me.create({name:"gapCursor",addProseMirrorPlugins(){return[dS()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=me(K(t,"allowGapCursor",n)))!=null?e:null}}}),vf="placeholder",ps=new Le("tiptap__placeholder"),ad=200;function cd(t){const{editor:e,placeholder:n,dataAttribute:r,pos:s,node:i,isEmptyDoc:o,hasAnchor:l,classes:{emptyNode:a,emptyEditor:c}}=t,u=[a];return o&&u.push(c),tt.node(s,s+i.nodeSize,{class:u.join(" "),[r]:typeof n=="function"?n({editor:e,node:i,pos:s,hasAnchor:l}):n})}function NS({editor:t,options:e,dataAttribute:n,doc:r,selection:s}){var i,o;if(!(t.isEditable||!e.showOnlyWhenEditable))return null;const{anchor:a}=s,c=[],u=t.isEmpty,h={emptyEditor:e.emptyEditorClass,emptyNode:e.emptyNodeClass};if(e.showOnlyCurrent&&!e.includeChildren){const f=r.resolve(a),m=f.depth>0?f.node(1):f.nodeAfter,g=f.depth>0?f.before(1):a;if(m&&m.type.isTextblock&&us(m)){const b=a>=g&&a<=g+m.nodeSize;c.push(cd({editor:t,isEmptyDoc:u,dataAttribute:n,hasAnchor:b,placeholder:e.placeholder,classes:h,node:m,pos:g}))}}else{const f=ps.getState(t.state),m=(i=f==null?void 0:f.topPos)!=null?i:0,g=(o=f==null?void 0:f.bottomPos)!=null?o:r.content.size;r.nodesBetween(m,g,(b,y)=>{const v=a>=y&&a<=y+b.nodeSize,_=!b.isLeaf&&us(b);return b.type.isTextblock&&(v||!e.showOnlyCurrent)&&_&&c.push(cd({editor:t,isEmptyDoc:u,dataAttribute:n,hasAnchor:v,placeholder:e.placeholder,classes:h,node:b,pos:y})),e.includeChildren})}return Ce.create(r,c)}function AS(t){return t.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}function TS(t){const e=getComputedStyle(t),n=`${e.overflow} ${e.overflowY} ${e.overflowX}`;return/auto|scroll|overlay/.test(n)}function ES(t){let e=t;for(;e;){if(TS(e))return e;const n=e.parentElement;if(!n){const r=e.getRootNode();if(r instanceof ShadowRoot){e=r.host;continue}return window}e=n}return window}function MS(t){return t===window?{top:0,bottom:window.innerHeight}:t.getBoundingClientRect()}function jS({doc:t,view:e,scrollContainer:n}){const r=e.dom.getBoundingClientRect(),s=n?MS(n):{top:0,bottom:window.innerHeight},i=Math.max(r.top,s.top)-ad,o=Math.min(r.bottom,s.bottom)+ad;if(i>=o)return{top:0,bottom:t.content.size};const a=getComputedStyle(e.dom).direction==="rtl"?Math.max(r.right-2,r.left+2):r.left+2,c=e.posAtCoords({left:a,top:i+2}),u=e.posAtCoords({left:a,top:o-2});return{top:c?c.pos:0,bottom:u?u.pos:t.content.size}}var IS={init(){return{topPos:null,bottomPos:null}},apply(t,e){const n=t.getMeta(ps);return n!=null&&n.positions?{topPos:n.positions.top,bottomPos:n.positions.bottom}:t.docChanged?{topPos:e.topPos!==null?t.mapping.map(e.topPos):null,bottomPos:e.bottomPos!==null?t.mapping.map(e.bottomPos):null}:e}};function DS(t){const e=ES(t.dom),n=()=>{const l=jS({view:t,doc:t.state.doc,scrollContainer:e}),a=ps.getState(t.state);if((a==null?void 0:a.topPos)===l.top&&(a==null?void 0:a.bottomPos)===l.bottom)return;const c=t.state.tr.setMeta(ps,{positions:l});t.dispatch(c)};let r=null,s=0;const i=150,o=()=>{r===null&&(r=requestAnimationFrame(()=>{r=null;const l=performance.now();l-s>=i?(s=l,n()):o()}))};return e.addEventListener("scroll",o,{passive:!0}),n(),{update(l,a){t.state.doc.content.size!==a.doc.content.size&&o()},destroy:()=>{r!==null&&cancelAnimationFrame(r),e.removeEventListener("scroll",o)}}}function OS({editor:t,options:e}){const n=e.dataAttribute?`data-${AS(e.dataAttribute)}`:`data-${vf}`;return new Se({key:ps,state:IS,view:DS,props:{decorations:({doc:r,selection:s})=>NS({editor:t,options:e,dataAttribute:n,doc:r,selection:s})}})}var RS=Me.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:vf,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[OS({editor:this.editor,options:this.options})]}});Me.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:t,options:e}=this;return[new Se({key:new Le("selection"),props:{decorations(n){return n.selection.empty||t.isFocused||!t.isEditable||yh(n.selection)||t.view.dragging?null:Ce.create(n.doc,[tt.inline(n.selection.from,n.selection.to,{class:e.className})])}}})]}});var LS="skipTrailingNode";function dd({types:t,node:e}){return e&&Array.isArray(t)&&t.includes(e.type)||(e==null?void 0:e.type)===t}var BS=Me.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var t;const e=new Le(this.name),n=this.options.node||((t=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:t.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,s])=>s).filter(s=>(this.options.notAfter||[]).concat(n).includes(s.name));return[new Se({key:e,appendTransaction:(s,i,o)=>{const{doc:l,tr:a,schema:c}=o,u=e.getState(o),h=l.content.size,p=c.nodes[n];if(!s.some(f=>f.getMeta(LS))&&u)return a.insert(h,p.create())},state:{init:(s,i)=>{const o=i.tr.doc.lastChild;return!dd({node:o,types:r})},apply:(s,i)=>{if(!s.docChanged||s.getMeta("__uniqueIDTransaction"))return i;const o=s.doc.lastChild;return!dd({node:o,types:r})}}})]}}),$S=Me.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>yf(t,e),redo:()=>({state:t,dispatch:e})=>xf(t,e)}},addProseMirrorPlugins(){return[wS(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),PS=Me.create({name:"starterKit",addExtensions(){var t,e,n,r;const s=[];return this.options.bold!==!1&&s.push(Xw.configure(this.options.bold)),this.options.blockquote!==!1&&s.push(Kw.configure(this.options.blockquote)),this.options.bulletList!==!1&&s.push(tf.configure(this.options.bulletList)),this.options.code!==!1&&s.push(tC.configure(this.options.code)),this.options.codeBlock!==!1&&s.push(sC.configure(this.options.codeBlock)),this.options.document!==!1&&s.push(iC.configure(this.options.document)),this.options.dropcursor!==!1&&s.push(CS.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&s.push(SS.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&s.push(oC.configure(this.options.hardBreak)),this.options.heading!==!1&&s.push(lC.configure(this.options.heading)),this.options.undoRedo!==!1&&s.push($S.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&s.push(aC.configure(this.options.horizontalRule)),this.options.italic!==!1&&s.push(fC.configure(this.options.italic)),this.options.listItem!==!1&&s.push(nf.configure(this.options.listItem)),this.options.listKeymap!==!1&&s.push(cf.configure((t=this.options)==null?void 0:t.listKeymap)),this.options.link!==!1&&s.push(ef.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&s.push(uf.configure(this.options.orderedList)),this.options.paragraph!==!1&&s.push(eS.configure(this.options.paragraph)),this.options.strike!==!1&&s.push(rS.configure(this.options.strike)),this.options.text!==!1&&s.push(sS.configure(this.options.text)),this.options.underline!==!1&&s.push(pf.configure((n=this.options)==null?void 0:n.underline)),this.options.trailingNode!==!1&&s.push(BS.configure((r=this.options)==null?void 0:r.trailingNode)),s}}),zS=PS,FS=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,HS=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,WS=Kt.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:t=>t.getAttribute("data-color")||Dk(t,"background-color")||t.style.backgroundColor,renderHTML:t=>t.color?{"data-color":t.color,style:`background-color: ${t.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:t}){return["mark",ye(this.options.HTMLAttributes,t),0]},renderMarkdown:(t,e)=>`==${e.renderChildren(t)}==`,parseMarkdown:(t,e)=>e.applyMark("highlight",e.parseInline(t.tokens||[])),markdownTokenizer:{name:"highlight",level:"inline",start:t=>t.indexOf("=="),tokenize(t,e,n){const s=/^(==)([^=]+)(==)/.exec(t);if(s){const i=s[2].trim(),o=n.inlineTokens(i);return{type:"highlight",raw:s[0],text:i,tokens:o}}}},addCommands(){return{setHighlight:t=>({commands:e})=>e.setMark(this.name,t),toggleHighlight:t=>({commands:e})=>e.toggleMark(this.name,t),unsetHighlight:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Zn({find:FS,type:this.type})]},addPasteRules(){return[Nn({find:HS,type:this.type})]}}),VS=WS,qS=Kt.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(t){return t!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sub",ye(this.options.HTMLAttributes,t),0]},addCommands(){return{setSubscript:()=>({commands:t})=>t.setMark(this.name),toggleSubscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSubscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),US=qS,KS=Kt.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(t){return t!=="super"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sup",ye(this.options.HTMLAttributes,t),0]},addCommands(){return{setSuperscript:()=>({commands:t})=>t.setMark(this.name),toggleSuperscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSuperscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),GS=KS,JS=Me.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>{const e=t.style.textAlign;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:t=>t.textAlign?{style:`text-align: ${t.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.map(n=>e.updateAttributes(n,{textAlign:t})).some(n=>n):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.map(e=>t.resetAttributes(e,"textAlign")).some(e=>e),toggleTextAlign:t=>({editor:e,commands:n})=>this.options.alignments.includes(t)?e.isActive({textAlign:t})?n.unsetTextAlign():n.setTextAlign(t):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),YS=JS,QS=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,XS=lt.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",ye(this.options.HTMLAttributes,t)]},parseMarkdown:(t,e)=>e.createNode("image",{src:t.href,title:t.title,alt:t.text}),renderMarkdown:t=>{var e,n,r,s,i,o;const l=(n=(e=t.attrs)==null?void 0:e.src)!=null?n:"",a=(s=(r=t.attrs)==null?void 0:r.alt)!=null?s:"",c=(o=(i=t.attrs)==null?void 0:i.title)!=null?o:"";return c?``:``},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>"u")return null;const{directions:t,minWidth:e,minHeight:n,alwaysPreserveAspectRatio:r}=this.options.resize;return({node:s,getPos:i,HTMLAttributes:o,editor:l})=>{const a=document.createElement("img");Object.entries(o).forEach(([h,p])=>{if(p!=null)switch(h){case"width":case"height":break;default:a.setAttribute(h,p);break}}),a.src=o.src;const c=new Mk({element:a,editor:l,node:s,getPos:i,onResize:(h,p)=>{a.style.width=`${h}px`,a.style.height=`${p}px`},onCommit:(h,p)=>{const f=i();f!==void 0&&this.editor.chain().setNodeSelection(f).updateAttributes(this.name,{width:h,height:p}).run()},onUpdate:(h,p,f)=>h.type===s.type,options:{directions:t,min:{width:e,height:n},preserveAspectRatio:r===!0}}),u=c.dom;return u.style.visibility="hidden",u.style.pointerEvents="none",a.onload=()=>{u.style.visibility="",u.style.pointerEvents=""},c}},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[Rh({find:QS,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}}),ZS=XS;function eN(t){var e;const{char:n,allowSpaces:r,allowToIncludeChar:s,allowedPrefixes:i,startOfLine:o,$position:l}=t,a=r&&!s,c=Ik(n),u=new RegExp(`\\s${c}$`),h=o?"^":"",p=s?"":c,f=a?new RegExp(`${h}${c}.*?(?=\\s${p}|$)`,"gm"):new RegExp(`${h}(?:^)?${c}[^\\s${p}]*`,"gm"),m=((e=l.nodeBefore)==null?void 0:e.isText)&&l.nodeBefore.text;if(!m)return null;const g=l.pos-m.length,b=Array.from(m.matchAll(f)).pop();if(!b||b.input===void 0||b.index===void 0)return null;const y=b.input.slice(Math.max(0,b.index-1),b.index),v=new RegExp(`^[${i==null?void 0:i.join("")}\0]?$`).test(y);if(i!==null&&!v)return null;const _=g+b.index;let w=_+b[0].length;return a&&u.test(m.slice(w-1,w+1))&&(b[0]+=" ",w+=1),_<l.pos&&w>=l.pos?{range:{from:_,to:w},query:b[0].slice(n.length),text:b[0]}:null}function tN(t){return t.docChanged?t.steps.some(e=>{const n=e.slice;if(!(n!=null&&n.content))return!1;const r=n.content.textBetween(0,n.content.size,`
|
|
174
|
+
`);return/\s/.test(r)}):!1}var nN=new Le("suggestion");function rN({pluginKey:t=nN,editor:e,char:n="@",allowSpaces:r=!1,allowToIncludeChar:s=!1,allowedPrefixes:i=[" "],startOfLine:o=!1,decorationTag:l="span",decorationClass:a="suggestion",decorationContent:c="",decorationEmptyClass:u="is-empty",command:h=()=>null,items:p=()=>[],render:f=()=>({}),allow:m=()=>!0,findSuggestionMatch:g=eN,shouldShow:b,shouldResetDismissed:y}){let v;const _=f==null?void 0:f(),w=r&&!s,k=()=>{const N=e.state.selection.$anchor.pos,T=e.view.coordsAtPos(N),{top:P,right:L,bottom:R,left:H}=T;try{return new DOMRect(H,P,L-H,R-P)}catch{return null}},C=(N,T)=>T?()=>{const P=t.getState(e.state),L=P==null?void 0:P.decorationId,R=N.dom.querySelector(`[data-decoration-id="${L}"]`);return(R==null?void 0:R.getBoundingClientRect())||null}:k,S=({match:N,dismissedRange:T,state:P,transaction:L})=>y!=null&&y({editor:e,state:P,range:T,match:N,transaction:L,allowSpaces:w})?!1:w?N.range.from===T.from:N.range.from===T.from&&!tN(L);function O(N,T){var P;try{const R=t.getState(N.state),H=R!=null&&R.decorationId?N.dom.querySelector(`[data-decoration-id="${R.decorationId}"]`):null,q={editor:e,range:(R==null?void 0:R.range)||{from:0,to:0},query:(R==null?void 0:R.query)||null,text:(R==null?void 0:R.text)||null,items:[],command:j=>h({editor:e,range:(R==null?void 0:R.range)||{from:0,to:0},props:j}),decorationNode:H,clientRect:C(N,H)};(P=_==null?void 0:_.onExit)==null||P.call(_,q)}catch{}const L=N.state.tr.setMeta(T,{exit:!0});N.dispatch(L)}const B=new Se({key:t,view(){return{update:async(N,T)=>{var P,L,R,H,q,j,$;const W=(P=this.key)==null?void 0:P.getState(T),se=(L=this.key)==null?void 0:L.getState(N.state),ae=W.active&&se.active&&W.range.from!==se.range.from,Ne=!W.active&&se.active,je=W.active&&!se.active,Be=!Ne&&!je&&W.query!==se.query,A=Ne||ae&&Be,U=Be||ae,Y=je||ae&&Be;if(!A&&!U&&!Y)return;const Ie=Y&&!A?W:se,$e=N.dom.querySelector(`[data-decoration-id="${Ie.decorationId}"]`);v={editor:e,range:Ie.range,query:Ie.query,text:Ie.text,items:[],command:Bt=>h({editor:e,range:Ie.range,props:Bt}),decorationNode:$e,clientRect:C(N,$e)},A&&((R=_==null?void 0:_.onBeforeStart)==null||R.call(_,v)),U&&((H=_==null?void 0:_.onBeforeUpdate)==null||H.call(_,v)),(U||A)&&(v.items=await p({editor:e,query:Ie.query})),Y&&((q=_==null?void 0:_.onExit)==null||q.call(_,v)),U&&((j=_==null?void 0:_.onUpdate)==null||j.call(_,v)),A&&(($=_==null?void 0:_.onStart)==null||$.call(_,v))},destroy:()=>{var N;v&&((N=_==null?void 0:_.onExit)==null||N.call(_,v))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1,dismissedRange:null}},apply(N,T,P,L){const{isEditable:R}=e,{composing:H}=e.view,{selection:q}=N,{empty:j,from:$}=q,W={...T},se=N.getMeta(t);if(se&&se.exit)return W.active=!1,W.decorationId=null,W.range={from:0,to:0},W.query=null,W.text=null,W.dismissedRange=T.active?{...T.range}:T.dismissedRange,W;if(W.composing=H,N.docChanged&&W.dismissedRange!==null&&(W.dismissedRange={from:N.mapping.map(W.dismissedRange.from),to:N.mapping.map(W.dismissedRange.to)}),R&&(j||e.view.composing)){($<T.range.from||$>T.range.to)&&!H&&!T.composing&&(W.active=!1);const ae=g({char:n,allowSpaces:r,allowToIncludeChar:s,allowedPrefixes:i,startOfLine:o,$position:q.$from}),Ne=`id_${Math.floor(Math.random()*4294967295)}`;ae&&m({editor:e,state:L,range:ae.range,isActive:T.active})&&(!b||b({editor:e,range:ae.range,query:ae.query,text:ae.text,transaction:N}))?(W.dismissedRange!==null&&!S({match:ae,dismissedRange:W.dismissedRange,state:L,transaction:N})&&(W.dismissedRange=null),W.dismissedRange===null?(W.active=!0,W.decorationId=T.decorationId?T.decorationId:Ne,W.range=ae.range,W.query=ae.query,W.text=ae.text):W.active=!1):(ae||(W.dismissedRange=null),W.active=!1)}else W.active=!1;return W.active||(W.decorationId=null,W.range={from:0,to:0},W.query=null,W.text=null),W}},props:{handleKeyDown(N,T){var P,L;const{active:R,range:H}=B.getState(N.state);if(!R)return!1;if(T.key==="Escape"||T.key==="Esc"){const j=B.getState(N.state);return(P=_==null?void 0:_.onKeyDown)==null||P.call(_,{view:N,event:T,range:j.range}),O(N,t),!0}return((L=_==null?void 0:_.onKeyDown)==null?void 0:L.call(_,{view:N,event:T,range:H}))||!1},decorations(N){const{active:T,range:P,decorationId:L,query:R}=B.getState(N);if(!T)return null;const H=!(R!=null&&R.length),q=[a];return H&&q.push(u),Ce.create(N.doc,[tt.inline(P.from,P.to,{nodeName:l,class:q.join(" "),"data-decoration-id":L,"data-decoration-content":c})])}}});return B}function sN({editor:t,overrideSuggestionOptions:e,extensionName:n,char:r="@"}){const s=new Le;return{editor:t,char:r,pluginKey:s,command:({editor:i,range:o,props:l})=>{var a,c,u;const h=i.view.state.selection.$to.nodeAfter;((a=h==null?void 0:h.text)==null?void 0:a.startsWith(" "))&&(o.to+=1),i.chain().focus().insertContentAt(o,[{type:n,attrs:{...l,mentionSuggestionChar:r}},{type:"text",text:" "}]).run(),(u=(c=i.view.dom.ownerDocument.defaultView)==null?void 0:c.getSelection())==null||u.collapseToEnd()},allow:({state:i,range:o})=>{const l=i.doc.resolve(o.from),a=i.schema.nodes[n];return!!l.parent.type.contentMatch.matchType(a)},...e}}function _f(t){return(t.options.suggestions.length?t.options.suggestions:[t.options.suggestion]).map(e=>sN({editor:t.editor,overrideSuggestionOptions:e,extensionName:t.name,char:e.char}))}function ud(t,e){const n=_f(t),r=n.find(s=>s.char===e);return r||(n.length?n[0]:null)}var iN=lt.create({name:"mention",priority:101,addOptions(){return{HTMLAttributes:{},renderText({node:t,suggestion:e}){var n,r;return`${(n=e==null?void 0:e.char)!=null?n:"@"}${(r=t.attrs.label)!=null?r:t.attrs.id}`},deleteTriggerWithBackspace:!1,renderHTML({options:t,node:e,suggestion:n}){var r,s;return["span",ye(this.HTMLAttributes,t.HTMLAttributes),`${(r=n==null?void 0:n.char)!=null?r:"@"}${(s=e.attrs.label)!=null?s:e.attrs.id}`]},suggestions:[],suggestion:{}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes(){return{id:{default:null,parseHTML:t=>t.getAttribute("data-id"),renderHTML:t=>t.id?{"data-id":t.id}:{}},label:{default:null,parseHTML:t=>t.getAttribute("data-label"),renderHTML:t=>t.label?{"data-label":t.label}:{}},mentionSuggestionChar:{default:"@",parseHTML:t=>t.getAttribute("data-mention-suggestion-char"),renderHTML:t=>({"data-mention-suggestion-char":t.mentionSuggestionChar})}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:t,HTMLAttributes:e}){const n=ud(this,t.attrs.mentionSuggestionChar);if(this.options.renderLabel!==void 0)return console.warn("renderLabel is deprecated use renderText and renderHTML instead"),["span",ye({"data-type":this.name},this.options.HTMLAttributes,e),this.options.renderLabel({options:this.options,node:t,suggestion:n})];const r={...this.options};r.HTMLAttributes=ye({"data-type":this.name},this.options.HTMLAttributes,e);const s=this.options.renderHTML({options:r,node:t,suggestion:n});return typeof s=="string"?["span",ye({"data-type":this.name},this.options.HTMLAttributes,e),s]:s},...Lh({nodeName:"mention",name:"@",selfClosing:!0,allowedAttributes:["id","label",{name:"mentionSuggestionChar",skipIfDefault:"@"}],parseAttributes:t=>{const e={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=n.exec(t);for(;r!==null;){const[,s,i,o]=r,l=i??o;e[s==="char"?"mentionSuggestionChar":s]=l,r=n.exec(t)}return e},serializeAttributes:t=>Object.entries(t).filter(([,e])=>e!=null).map(([e,n])=>`${e==="mentionSuggestionChar"?"char":e}="${n}"`).join(" ")}),renderText({node:t}){const e={options:this.options,node:t,suggestion:ud(this,t.attrs.mentionSuggestionChar)};return this.options.renderLabel!==void 0?(console.warn("renderLabel is deprecated use renderText and renderHTML instead"),this.options.renderLabel(e)):this.options.renderText(e)},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:t,state:e})=>{let n=!1;const{selection:r}=e,{empty:s,anchor:i}=r;if(!s)return!1;let o=new Mt,l=0;return e.doc.nodesBetween(i-1,i,(a,c)=>{if(a.type.name===this.name)return n=!0,o=a,l=c,!1}),n&&t.insertText(this.options.deleteTriggerWithBackspace?"":o.attrs.mentionSuggestionChar,l,l+o.nodeSize),n})}},addProseMirrorPlugins(){return _f(this).map(rN)}}),oN=iN;const lN="_dropdown_rtanl_1",aN="_item_rtanl_14",cN="_itemSelected_rtanl_32",dN="_empty_rtanl_37",Or={dropdown:lN,item:aN,itemSelected:cN,empty:dN},kf=x.forwardRef(({items:t,command:e},n)=>{const[r,s]=x.useState(0);return x.useEffect(()=>s(0),[t]),x.useImperativeHandle(n,()=>({onKeyDown(i){if(i.key==="ArrowUp")return t.length&&s(o=>(o+t.length-1)%t.length),!0;if(i.key==="ArrowDown")return t.length&&s(o=>(o+1)%t.length),!0;if(i.key==="Enter"){const o=t[r];return o&&e(o),!0}return!1}})),t.length?d.jsx("div",{className:Or.dropdown,children:t.map((i,o)=>d.jsx("button",{type:"button",className:[Or.item,o===r?Or.itemSelected:""].filter(Boolean).join(" "),onMouseEnter:()=>s(o),onClick:()=>e(i),children:i.label},i.id))}):d.jsx("div",{className:Or.dropdown,children:d.jsx("div",{className:Or.empty,children:"No results"})})});kf.displayName="MentionList";const uN="_root_8iz1d_7",hN="_labelRow_8iz1d_15",fN="_label_8iz1d_15",pN="_required_8iz1d_25",mN="_outer_8iz1d_32",gN="_inner_8iz1d_40",bN="_innerDisabled_8iz1d_50",yN="_innerInvalid_8iz1d_50",xN="_innerWithCounter_8iz1d_84",vN="_innerWithToolbar_8iz1d_89",_N="_toolbar_8iz1d_95",kN="_innerOnFocusMode_8iz1d_107",wN="_toolbarAbsolute_8iz1d_112",CN="_toolbarHidden_8iz1d_121",SN="_editorOnFocusTransition_8iz1d_127",NN="_toolbarBtn_8iz1d_132",AN="_toolbarBtnActive_8iz1d_157",TN="_labelBold_8iz1d_166",EN="_labelItalic_8iz1d_167",MN="_labelUnderline_8iz1d_168",jN="_labelStrike_8iz1d_169",IN="_labelHeading_8iz1d_170",DN="_labelSubscript_8iz1d_171",ON="_labelSuperscript_8iz1d_172",RN="_divider_8iz1d_175",LN="_urlBar_8iz1d_185",BN="_urlInput_8iz1d_193",$N="_urlConfirm_8iz1d_212",PN="_urlCancel_8iz1d_213",zN="_editor_8iz1d_127",FN="_editorWithInnerCounter_8iz1d_340",HN="_counter_8iz1d_351",WN="_counterInside_8iz1d_359",VN="_bottomRow_8iz1d_372",qN="_helperText_8iz1d_378",UN="_errorText_8iz1d_384 _helperText_8iz1d_378",ie={root:uN,labelRow:hN,label:fN,required:pN,outer:mN,inner:gN,innerDisabled:bN,innerInvalid:yN,innerWithCounter:xN,innerWithToolbar:vN,toolbar:_N,innerOnFocusMode:kN,toolbarAbsolute:wN,toolbarHidden:CN,editorOnFocusTransition:SN,toolbarBtn:NN,toolbarBtnActive:AN,labelBold:TN,labelItalic:EN,labelUnderline:MN,labelStrike:jN,labelHeading:IN,labelSubscript:DN,labelSuperscript:ON,divider:RN,urlBar:LN,urlInput:BN,urlConfirm:$N,urlCancel:PN,editor:zN,editorWithInnerCounter:FN,counter:HN,counterInside:WN,bottomRow:VN,helperText:qN,errorText:UN};function Oe({label:t,active:e,onAction:n,disabled:r,children:s}){return d.jsx(er,{content:t,placement:"top",delay:300,children:d.jsx("button",{type:"button",className:[ie.toolbarBtn,e?ie.toolbarBtnActive:""].filter(Boolean).join(" "),onMouseDown:i=>{i.preventDefault(),n()},"aria-label":t,"aria-pressed":e,disabled:r,children:s})})}const KN=[{id:"1",label:"John Smith (Borrower)"},{id:"2",label:"Jane Doe (Co-Borrower)"},{id:"3",label:"Mike Johnson (Loan Officer)"},{id:"4",label:"Sarah Lee (Processor)"},{id:"5",label:"TitleCo Inc. (Title Company)"},{id:"6",label:"First National Bank (Lender)"},{id:"7",label:"Apex Appraisals (Appraiser)"}];function GN(t){return{items:async({query:e})=>{const n=t??KN,r=typeof n=="function"?await n(e):n,s=e.toLowerCase();return r.filter(i=>i.label.toLowerCase().includes(s)).slice(0,8)},render:()=>{let e=null,n=null;const r=s=>{const i=s.clientRect,o=i==null?void 0:i();o&&n&&(n.style.top=`${o.bottom+window.scrollY+4}px`,n.style.left=`${o.left+window.scrollX}px`)};return{onStart(s){n=document.createElement("div"),n.style.cssText="position:absolute;z-index:9999;",document.body.appendChild(n),e=new Vw(kf,{props:s,editor:s.editor}),n.appendChild(e.element),r(s)},onUpdate(s){e==null||e.updateProps(s),r(s)},onKeyDown({event:s}){var i;return((i=e==null?void 0:e.ref)==null?void 0:i.onKeyDown(s))??!1},onExit(){n==null||n.remove(),e==null||e.destroy(),n=null,e=null}}}}}const wf=x.forwardRef((t,e)=>{const{label:n,showLabel:r=!0,required:s,helperText:i,helperTextContent:o="Helper text",invalid:l,disabled:a,placeholder:c,defaultValue:u,onChange:h,maxLength:p,counterPlacement:f="outside",toolbarMode:m="always",showBold:g,showItalic:b,showUnderline:y,showStrike:v,showCode:_,showHighlight:w,showSubscript:k,showSuperscript:C,showHeading:S,headingLevels:O=[1,2,3],showBlockquote:B,showCodeBlock:N,showBulletList:T,showOrderedList:P,showTaskList:L,showHorizontalRule:R,showTextAlign:H,showLink:q,showImage:j,showMention:$,showUndo:W,showRedo:se,mentionSuggestions:ae,className:Ne,style:je,...Be}=t,A=x.useId(),U=`${A}-helper`,Y=!!i,[Ie,$e]=x.useState(!1),[Bt,Dt]=x.useState(!1),[rr,an]=x.useState(!1),[$t,Pt]=x.useState(""),Gt=x.useRef(null),wr=Bt||rr,[sr,Cr]=x.useState(0),G=$w({extensions:[zS.configure({link:!1,underline:!1}),iS,VS,US,GS,ff,hf.configure({nested:!0}),YS.configure({types:["heading","paragraph"]}),PC.configure({openOnClick:!1}),ZS,oN.configure({suggestion:GN(ae)}),RS.configure({placeholder:c??""})],content:u,editable:!a,onUpdate({editor:ne}){h==null||h(ne.getHTML()),Cr(ne.getText().length)}});function D(){!G||!$t.trim()||(G.chain().focus().setLink({href:$t.trim()}).run(),Dt(!1),Pt(""))}function ee(){!G||!$t.trim()||(G.chain().focus().setImage({src:$t.trim()}).run(),an(!1),Pt(""))}function pe(){Dt(!1),an(!1),Pt(""),G==null||G.commands.focus()}const ve=g||b||y||v||_||w||k||C,vt=S||B||N,ft=T||P||L||R,Jt=H,Sr=q||j||$,Nr=W||se,cn=ve||vt||ft||Jt||Sr||Nr,E=m==="on-focus",V=cn&&E&&!Ie,ce=[ve,vt,ft,Jt,Sr,Nr];function te(ne){return!!ce[ne]&&ce.slice(ne+1).some(Boolean)}const De=typeof p=="number",_t=f==="inside",_s=[ie.inner,l?ie.innerInvalid:"",a?ie.innerDisabled:"",_t&&De?ie.innerWithCounter:"",cn&&!E?ie.innerWithToolbar:"",cn&&E?ie.innerOnFocusMode:""].filter(Boolean).join(" "),to=[ie.editor,_t&&De?ie.editorWithInnerCounter:""].filter(Boolean).join(" ");return d.jsxs("div",{ref:e,className:[ie.root,Ne??""].filter(Boolean).join(" "),style:je,...Be,children:[n&&r&&d.jsxs("div",{className:ie.labelRow,children:[d.jsx("label",{className:ie.label,htmlFor:`${A}-editor`,children:n}),s&&d.jsx("span",{className:ie.required,"aria-hidden":"true",children:"*"})]}),d.jsxs("div",{className:ie.outer,children:[d.jsxs("div",{className:_s,onFocus:()=>$e(!0),onBlur:ne=>{ne.currentTarget.contains(ne.relatedTarget)||$e(!1)},children:[cn&&G&&d.jsxs("div",{className:[ie.toolbar,E?ie.toolbarAbsolute:"",V?ie.toolbarHidden:""].filter(Boolean).join(" "),role:"toolbar","aria-label":"Text formatting","aria-hidden":V||void 0,children:[ve&&d.jsxs(d.Fragment,{children:[g&&d.jsx(Oe,{label:"Bold",active:G.isActive("bold"),onAction:()=>G.chain().focus().toggleBold().run(),disabled:a,children:d.jsx("span",{className:ie.labelBold,children:"B"})}),b&&d.jsx(Oe,{label:"Italic",active:G.isActive("italic"),onAction:()=>G.chain().focus().toggleItalic().run(),disabled:a,children:d.jsx("span",{className:ie.labelItalic,children:"I"})}),y&&d.jsx(Oe,{label:"Underline",active:G.isActive("underline"),onAction:()=>G.chain().focus().toggleUnderline().run(),disabled:a,children:d.jsx("span",{className:ie.labelUnderline,children:"U"})}),v&&d.jsx(Oe,{label:"Strikethrough",active:G.isActive("strike"),onAction:()=>G.chain().focus().toggleStrike().run(),disabled:a,children:d.jsx("span",{className:ie.labelStrike,children:"S"})}),_&&d.jsx(Oe,{label:"Inline code",active:G.isActive("code"),onAction:()=>G.chain().focus().toggleCode().run(),disabled:a,children:d.jsx("i",{className:"pi pi-code","aria-hidden":"true"})}),w&&d.jsx(Oe,{label:"Highlight",active:G.isActive("highlight"),onAction:()=>G.chain().focus().toggleHighlight().run(),disabled:a,children:d.jsx("i",{className:"pi pi-pencil","aria-hidden":"true"})}),k&&d.jsx(Oe,{label:"Subscript",active:G.isActive("subscript"),onAction:()=>G.chain().focus().toggleSubscript().run(),disabled:a,children:d.jsx("span",{className:ie.labelSubscript,children:"x₂"})}),C&&d.jsx(Oe,{label:"Superscript",active:G.isActive("superscript"),onAction:()=>G.chain().focus().toggleSuperscript().run(),disabled:a,children:d.jsx("span",{className:ie.labelSuperscript,children:"x²"})})]}),te(0)&&d.jsx("span",{className:ie.divider}),vt&&d.jsxs(d.Fragment,{children:[S&&O.map(ne=>d.jsx(Oe,{label:`Heading ${ne}`,active:G.isActive("heading",{level:ne}),onAction:()=>G.chain().focus().toggleHeading({level:ne}).run(),disabled:a,children:d.jsxs("span",{className:ie.labelHeading,children:["H",ne]})},ne)),B&&d.jsx(Oe,{label:"Blockquote",active:G.isActive("blockquote"),onAction:()=>G.chain().focus().toggleBlockquote().run(),disabled:a,children:d.jsx("i",{className:"pi pi-comment","aria-hidden":"true"})}),N&&d.jsx(Oe,{label:"Code block",active:G.isActive("codeBlock"),onAction:()=>G.chain().focus().toggleCodeBlock().run(),disabled:a,children:d.jsx("i",{className:"pi pi-code","aria-hidden":"true"})})]}),te(1)&&d.jsx("span",{className:ie.divider}),ft&&d.jsxs(d.Fragment,{children:[T&&d.jsx(Oe,{label:"Bullet list",active:G.isActive("bulletList"),onAction:()=>G.chain().focus().toggleBulletList().run(),disabled:a,children:d.jsx("i",{className:"pi pi-list","aria-hidden":"true"})}),P&&d.jsx(Oe,{label:"Ordered list",active:G.isActive("orderedList"),onAction:()=>G.chain().focus().toggleOrderedList().run(),disabled:a,children:d.jsx("i",{className:"pi pi-sort-amount-down-alt","aria-hidden":"true"})}),L&&d.jsx(Oe,{label:"Task list",active:G.isActive("taskList"),onAction:()=>G.chain().focus().toggleTaskList().run(),disabled:a,children:d.jsx("i",{className:"pi pi-check-square","aria-hidden":"true"})}),R&&d.jsx(Oe,{label:"Horizontal rule",onAction:()=>G.chain().focus().setHorizontalRule().run(),disabled:a,children:d.jsx("i",{className:"pi pi-minus","aria-hidden":"true"})})]}),te(2)&&d.jsx("span",{className:ie.divider}),Jt&&H&&d.jsx(d.Fragment,{children:["left","center","right","justify"].map(ne=>d.jsx(Oe,{label:`Align ${ne}`,active:G.isActive({textAlign:ne}),onAction:()=>G.chain().focus().setTextAlign(ne).run(),disabled:a,children:d.jsx("i",{className:`pi pi-align-${ne}`,"aria-hidden":"true"})},ne))}),te(3)&&d.jsx("span",{className:ie.divider}),Sr&&d.jsxs(d.Fragment,{children:[q&&d.jsx(Oe,{label:"Link",active:G.isActive("link"),onAction:()=>{G.isActive("link")?G.chain().focus().unsetLink().run():(an(!1),Dt(!0),Pt(""),requestAnimationFrame(()=>{var ne;return(ne=Gt.current)==null?void 0:ne.focus()}))},disabled:a,children:d.jsx("i",{className:"pi pi-link","aria-hidden":"true"})}),j&&d.jsx(Oe,{label:"Image",onAction:()=>{Dt(!1),an(!0),Pt(""),requestAnimationFrame(()=>{var ne;return(ne=Gt.current)==null?void 0:ne.focus()})},disabled:a,children:d.jsx("i",{className:"pi pi-image","aria-hidden":"true"})}),$&&d.jsx(Oe,{label:"Mention",onAction:()=>G.chain().focus().insertContent("@").run(),disabled:a,children:d.jsx("i",{className:"pi pi-at","aria-hidden":"true"})})]}),te(4)&&d.jsx("span",{className:ie.divider}),Nr&&d.jsxs(d.Fragment,{children:[W&&d.jsx(Oe,{label:"Undo",onAction:()=>G.chain().focus().undo().run(),disabled:a||!G.can().undo(),children:d.jsx("i",{className:"pi pi-undo","aria-hidden":"true"})}),se&&d.jsx(Oe,{label:"Redo",onAction:()=>G.chain().focus().redo().run(),disabled:a||!G.can().redo(),children:d.jsx("i",{className:"pi pi-refresh","aria-hidden":"true"})})]})]}),wr&&d.jsxs("div",{className:ie.urlBar,children:[d.jsx("input",{ref:Gt,type:"url",className:ie.urlInput,value:$t,onChange:ne=>Pt(ne.target.value),placeholder:Bt?"https://example.com":"Image URL…",onKeyDown:ne=>{ne.key==="Enter"&&(ne.preventDefault(),Bt?D():ee()),ne.key==="Escape"&&pe()}}),d.jsx("button",{type:"button",className:ie.urlConfirm,onMouseDown:ne=>{ne.preventDefault(),Bt?D():ee()},children:d.jsx("i",{className:"pi pi-check","aria-hidden":"true"})}),d.jsx("button",{type:"button",className:ie.urlCancel,onMouseDown:ne=>{ne.preventDefault(),pe()},children:d.jsx("i",{className:"pi pi-times","aria-hidden":"true"})})]}),d.jsx("div",{id:`${A}-editor`,className:[to,E&&cn?ie.editorOnFocusTransition:""].filter(Boolean).join(" "),style:E&&cn?{paddingTop:Ie?48:9}:void 0,"aria-label":!r&&n?n:void 0,"aria-required":s||void 0,"aria-invalid":l||void 0,"aria-describedby":[Y?U:"",De?`${A}-counter`:""].filter(Boolean).join(" ")||void 0,onClick:ne=>{ne.target===ne.currentTarget&&(G==null||G.chain().focus("end").run())},children:d.jsx(Ph,{editor:G})}),_t&&De&&d.jsxs("span",{id:`${A}-counter`,className:ie.counterInside,"aria-live":"polite",children:[sr,"/",p]})]}),(Y||!_t&&De)&&d.jsxs("div",{className:ie.bottomRow,children:[Y?d.jsx("span",{id:U,className:l?ie.errorText:ie.helperText,children:o}):d.jsx("span",{}),!_t&&De&&d.jsxs("span",{id:`${A}-counter`,className:ie.counter,"aria-live":"polite",children:[sr,"/",p]})]})]})]})});wf.displayName="RichTextEditor";const JN="_wrapper_17bsd_10",YN="_disabled_17bsd_18",QN="_input_17bsd_24",XN="_track_17bsd_38",ZN="_thumb_17bsd_53",eA="_labelText_17bsd_125",tA="_helperText_17bsd_139",In={wrapper:JN,disabled:YN,input:QN,track:XN,thumb:ZN,labelText:eA,helperText:tA},Cf=x.forwardRef(({label:t,helperText:e,disabled:n=!1,id:r,className:s,...i},o)=>{const l=x.useRef(null),a=o??l,c=[In.wrapper,n?In.disabled:"",s??""].filter(Boolean).join(" ");return d.jsxs("div",{children:[d.jsxs("label",{className:c,htmlFor:r,children:[d.jsx("input",{ref:a,type:"checkbox",id:r,disabled:n,className:In.input,role:"switch",...i}),d.jsx("span",{className:In.track,"aria-hidden":"true",children:d.jsx("span",{className:In.thumb})}),t&&d.jsx("span",{className:In.labelText,children:t})]}),e&&d.jsx("span",{className:In.helperText,children:e})]})});Cf.displayName="ToggleSwitch";const nA="_btn_1pyug_10",rA="_disabled_1pyug_28",sA="_sm_1pyug_34",iA="_md_1pyug_40",oA="_lg_1pyug_46",lA="_primary_1pyug_56",aA="_secondary_1pyug_82",cA="_ghost_1pyug_110",dA="_danger_1pyug_133",uA="_link_1pyug_156",hA="_linkLabel_1pyug_181",fA="_icon_1pyug_189",pA="_badge_1pyug_204",Zt={btn:nA,disabled:rA,sm:sA,md:iA,lg:oA,primary:lA,secondary:aA,ghost:cA,danger:dA,link:uA,linkLabel:hA,icon:fA,badge:pA},We=x.forwardRef(({variant:t="primary",size:e="md",leadingIcon:n,trailingIcon:r,badge:s,children:i,className:o,disabled:l,...a},c)=>{const u=[Zt.btn,Zt[t],Zt[e],l?Zt.disabled:"",o??""].filter(Boolean).join(" ");return d.jsxs("button",{ref:c,className:u,disabled:l,...a,children:[n&&d.jsx("span",{className:Zt.icon,"aria-hidden":"true",children:n}),t==="link"?d.jsx("span",{className:Zt.linkLabel,children:i}):d.jsx("span",{className:Zt.label,children:i}),s!==void 0&&d.jsx("span",{className:Zt.badge,"aria-label":`${s} notifications`,children:s}),r&&d.jsx("span",{className:Zt.icon,"aria-hidden":"true",children:r})]})});We.displayName="Button";const mA="_root_1jl5o_6",gA="_btn_1jl5o_13",bA="_disabled_1jl5o_30",yA="_sm_1jl5o_35",xA="_md_1jl5o_36",vA="_lg_1jl5o_37",_A="_primary_1jl5o_40",kA="_btnOpen_1jl5o_44",wA="_secondary_1jl5o_46",CA="_ghost_1jl5o_52",SA="_danger_1jl5o_58",NA="_icon_1jl5o_65",AA="_chevron_1jl5o_73",TA="_dropdown_1jl5o_98",EA="_item_1jl5o_115",MA="_itemDisabled_1jl5o_130",jA="_itemIcon_1jl5o_143",IA="_divider_1jl5o_153",st={root:mA,btn:gA,disabled:bA,sm:yA,md:xA,lg:vA,primary:_A,btnOpen:kA,secondary:wA,ghost:CA,danger:SA,icon:NA,chevron:AA,dropdown:TA,item:EA,itemDisabled:MA,itemIcon:jA,divider:IA},$i=x.forwardRef(({label:t,items:e,onSelect:n,variant:r="primary",size:s="md",leadingIcon:i,disabled:o,className:l,style:a,...c},u)=>{const[h,p]=x.useState(!1),f=x.useRef(null),m=y=>{f.current=y,typeof u=="function"?u(y):u&&(u.current=y)};x.useEffect(()=>{if(!h)return;function y(v){var _;(_=f.current)!=null&&_.contains(v.target)||p(!1)}return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[h]),x.useEffect(()=>{if(!h)return;function y(v){v.key==="Escape"&&p(!1)}return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[h]);function g(y){y.disabled||(n==null||n(y.value),p(!1))}const b=[st.btn,st[r],st[s],h?st.btnOpen:"",o?st.disabled:""].filter(Boolean).join(" ");return d.jsxs("div",{ref:m,className:[st.root,l??""].filter(Boolean).join(" "),style:a,children:[d.jsxs("button",{type:"button",className:b,disabled:o,onClick:()=>!o&&p(y=>!y),"aria-haspopup":"menu","aria-expanded":h,...c,children:[i&&d.jsx("span",{className:st.icon,"aria-hidden":"true",children:i}),d.jsx("span",{className:st.label,children:t}),d.jsx("span",{className:st.chevron,"aria-hidden":"true",children:d.jsx("i",{className:"pi pi-chevron-down"})})]}),h&&d.jsx("div",{role:"menu",className:st.dropdown,children:e.map((y,v)=>d.jsxs("div",{children:[y.divider&&d.jsx("div",{className:st.divider,role:"separator"}),d.jsxs("div",{role:"menuitem","aria-disabled":y.disabled||void 0,className:[st.item,y.disabled?st.itemDisabled:""].filter(Boolean).join(" "),onClick:()=>g(y),tabIndex:y.disabled?-1:0,onKeyDown:_=>{(_.key==="Enter"||_.key===" ")&&!y.disabled&&(_.preventDefault(),g(y))},children:[y.icon&&d.jsx("span",{className:st.itemIcon,"aria-hidden":"true",children:y.icon}),d.jsx("span",{className:st.itemLabel,children:y.label})]})]},y.value??v))})]})});$i.displayName="DropdownButton";const DA="_btn_12vzq_7",OA="_sm_12vzq_24",RA="_md_12vzq_30",LA="_lg_12vzq_36",BA="_disabled_12vzq_44",Ho={btn:DA,sm:OA,md:RA,lg:LA,disabled:BA},Lt=x.forwardRef(({"aria-label":t="Close",size:e="sm",className:n,disabled:r,...s},i)=>{const o=[Ho.btn,Ho[e],r?Ho.disabled:"",n??""].filter(Boolean).join(" ");return d.jsx(er,{content:t,placement:"top",children:d.jsx("button",{ref:i,type:"button","aria-label":t,className:o,disabled:r,...s,children:d.jsx("i",{className:"pi pi-times","aria-hidden":"true"})})})});Lt.displayName="CloseButton";const $A="_root_1f5g5_9",PA="_main_1f5g5_17",zA="_disabled_1f5g5_38",FA="_primaryMain_1f5g5_47",HA="_secondaryMain_1f5g5_59",WA="_trigger_1f5g5_72",VA="_primaryTrigger_1f5g5_94",qA="_secondaryTrigger_1f5g5_105",UA="_chevron_1f5g5_117",KA="_triggerOpen_1f5g5_125",GA="_icon_1f5g5_131",JA="_mainSm_1f5g5_140",YA="_triggerSm_1f5g5_147",QA="_mainLg_1f5g5_152",XA="_triggerLg_1f5g5_159",ZA="_dropdown_1f5g5_187",eT="_item_1f5g5_202",tT="_itemDisabled_1f5g5_217",nT="_itemIcon_1f5g5_230",He={root:$A,main:PA,disabled:zA,primaryMain:FA,secondaryMain:HA,trigger:WA,primaryTrigger:VA,secondaryTrigger:qA,chevron:UA,triggerOpen:KA,icon:GA,mainSm:JA,triggerSm:YA,mainLg:QA,triggerLg:XA,dropdown:ZA,item:eT,itemDisabled:tT,itemIcon:nT},fa=x.forwardRef(({label:t,onAction:e,items:n,onSelect:r,variant:s="primary",size:i="md",leadingIcon:o,disabled:l=!1,triggerAriaLabel:a="More options",className:c,style:u},h)=>{const[p,f]=x.useState(!1),m=x.useRef(null),g=_=>{m.current=_,typeof h=="function"?h(_):h&&(h.current=_)};x.useEffect(()=>{if(!p)return;function _(w){var k;(k=m.current)!=null&&k.contains(w.target)||f(!1)}return document.addEventListener("mousedown",_),()=>document.removeEventListener("mousedown",_)},[p]),x.useEffect(()=>{if(!p)return;function _(w){w.key==="Escape"&&f(!1)}return document.addEventListener("keydown",_),()=>document.removeEventListener("keydown",_)},[p]);function b(_){_.disabled||(r==null||r(_.value),f(!1))}const y=[He.main,He[`${s}Main`],i==="sm"?He.mainSm:i==="lg"?He.mainLg:"",l?He.disabled:""].filter(Boolean).join(" "),v=[He.trigger,He[`${s}Trigger`],i==="sm"?He.triggerSm:i==="lg"?He.triggerLg:"",p?He.triggerOpen:"",l?He.disabled:""].filter(Boolean).join(" ");return d.jsxs("div",{ref:g,className:[He.root,c??""].filter(Boolean).join(" "),style:u,children:[d.jsxs("button",{type:"button",className:y,onClick:()=>!l&&(e==null?void 0:e()),disabled:l,children:[o&&d.jsx("span",{className:He.icon,"aria-hidden":"true",children:o}),d.jsx("span",{className:He.label,children:t})]}),d.jsx(er,{content:a,placement:"top",children:d.jsx("button",{type:"button",className:v,onClick:()=>!l&&f(_=>!_),disabled:l,"aria-haspopup":"menu","aria-expanded":p,"aria-label":a,children:d.jsx("span",{className:He.chevron,"aria-hidden":"true",children:d.jsx("i",{className:"pi pi-chevron-down"})})})}),p&&d.jsx("div",{role:"menu",className:He.dropdown,children:n.map((_,w)=>d.jsxs("div",{role:"menuitem","aria-disabled":_.disabled||void 0,className:[He.item,_.disabled?He.itemDisabled:""].filter(Boolean).join(" "),onClick:()=>b(_),tabIndex:_.disabled?-1:0,onKeyDown:k=>{(k.key==="Enter"||k.key===" ")&&!_.disabled&&(k.preventDefault(),b(_))},children:[_.icon&&d.jsx("span",{className:He.itemIcon,"aria-hidden":"true",children:_.icon}),d.jsx("span",{children:_.label})]},_.value??w))})]})});fa.displayName="SplitButton";const rT="_container_1ieud_9",sT="_containerFull_1ieud_20",iT="_navBtn_1ieud_29",oT="_navBtnDisabled_1ieud_46",lT="_navBtnSelected_1ieud_56",aT="_navBtnContent_1ieud_79",cT="_pageNumber_1ieud_90",dT="_ellipsis_1ieud_100",uT="_reportText_1ieud_116",hT="_fullLeft_1ieud_129",fT="_fullRight_1ieud_135",pT="_rowsLabel_1ieud_141",mT="_entriesCount_1ieud_149",bt={container:rT,containerFull:sT,navBtn:iT,navBtnDisabled:oT,navBtnSelected:lT,navBtnContent:aT,pageNumber:cT,ellipsis:dT,reportText:uT,fullLeft:hT,fullRight:fT,rowsLabel:pT,entriesCount:mT};function gT(t,e,n){if(e<=n+2)return Array.from({length:e},(l,a)=>a+1);const r=Math.floor(n/2);let s=Math.max(1,t-r),i=Math.min(e,s+n-1);i-s<n-1&&(s=Math.max(1,i-n+1));const o=[];s>1&&(o.push(1),s>2&&o.push("..."));for(let l=s;l<=i;l++)o.push(l);return i<e&&(i<e-1&&o.push("..."),o.push(e)),o}const Sf=()=>d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M10 3L6 7l4 4M5 3v8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Nf=()=>d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M9 3L5 7l4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Af=()=>d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M5 3l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Tf=()=>d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M4 3l4 4-4 4M9 3v8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function nn({onClick:t,disabled:e,selected:n,"aria-label":r,children:s}){const i=[bt.navBtn,n?bt.navBtnSelected:"",e?bt.navBtnDisabled:""].filter(Boolean).join(" ");return d.jsx("button",{type:"button",className:i,onClick:t,disabled:e,"aria-label":r,"aria-current":n?"page":void 0,children:d.jsx("span",{className:bt.navBtnContent,children:s})})}function hd({currentPage:t,totalPages:e,pageLinkSize:n,onPage:r}){const s=gT(t,e,n);return d.jsxs(d.Fragment,{children:[d.jsx(nn,{onClick:()=>r(0),disabled:t===0,"aria-label":"First page",children:d.jsx(Sf,{})}),d.jsx(nn,{onClick:()=>r(t-1),disabled:t===0,"aria-label":"Previous page",children:d.jsx(Nf,{})}),s.map((i,o)=>i==="..."?d.jsx("span",{className:bt.ellipsis,children:"…"},`ellipsis-${o}`):d.jsx(nn,{onClick:()=>r(i-1),selected:i-1===t,"aria-label":`Page ${i}`,children:d.jsx("span",{className:bt.pageNumber,children:i})},i)),d.jsx(nn,{onClick:()=>r(t+1),disabled:t>=e-1,"aria-label":"Next page",children:d.jsx(Af,{})}),d.jsx(nn,{onClick:()=>r(e-1),disabled:t>=e-1,"aria-label":"Last page",children:d.jsx(Tf,{})})]})}const Ef=x.forwardRef(({totalRecords:t,first:e,rows:n,onPageChange:r,template:s="pages",rowsPerPageOptions:i=[10,25,50,100],pageLinkSize:o=5,className:l,style:a},c)=>{const u=Math.max(1,Math.ceil(t/n)),h=Math.floor(e/n);function p(v){const _=Math.max(0,Math.min(v,u-1));r({first:_*n,rows:n,page:_})}function f(v){r({first:0,rows:v,page:0})}const m=i.map(v=>({label:String(v),value:String(v)})),g=t===0?0:e+1,b=Math.min(e+n,t),y=[bt.container,s==="full"?bt.containerFull:"",l??""].filter(Boolean).join(" ");return s==="report"?d.jsxs("div",{ref:c,className:y,style:a,role:"navigation","aria-label":"Pagination",children:[d.jsx(nn,{onClick:()=>p(0),disabled:h===0,"aria-label":"First page",children:d.jsx(Sf,{})}),d.jsx(nn,{onClick:()=>p(h-1),disabled:h===0,"aria-label":"Previous page",children:d.jsx(Nf,{})}),d.jsxs("span",{className:bt.reportText,children:["Showing ",g," to ",b," of ",t," entries"]}),d.jsx(nn,{onClick:()=>p(h+1),disabled:h>=u-1,"aria-label":"Next page",children:d.jsx(Af,{})}),d.jsx(nn,{onClick:()=>p(u-1),disabled:h>=u-1,"aria-label":"Last page",children:d.jsx(Tf,{})})]}):s==="full"?d.jsxs("div",{ref:c,className:y,style:a,role:"navigation","aria-label":"Pagination",children:[d.jsxs("div",{className:bt.fullLeft,children:[d.jsx("span",{className:bt.rowsLabel,children:"Results per page:"}),d.jsx(pr,{options:m,value:String(n),onChange:v=>v&&f(Number(v)),size:"sm",style:{width:80}}),d.jsxs("span",{className:bt.entriesCount,children:[b-g+(t>0?1:0)," entries"]})]}),d.jsx("div",{className:bt.fullRight,children:d.jsx(hd,{currentPage:h,totalPages:u,pageLinkSize:o,onPage:p})})]}):d.jsxs("div",{ref:c,className:y,style:a,role:"navigation","aria-label":"Pagination",children:[d.jsx(hd,{currentPage:h,totalPages:u,pageLinkSize:o,onPage:p}),d.jsx(pr,{options:m,value:String(n),onChange:v=>v&&f(Number(v)),size:"sm",style:{width:80}})]})});Ef.displayName="Paginator";const bT="_root_6qfeg_8",yT="_panel_6qfeg_17",xT="_panelHeader_6qfeg_31",vT="_filterWrap_6qfeg_47",_T="_filterIcon_6qfeg_55",kT="_filterInput_6qfeg_63",wT="_filterClear_6qfeg_79",CT="_list_6qfeg_98",ST="_item_6qfeg_110",NT="_itemDisabled_6qfeg_124",AT="_itemSelected_6qfeg_133",TT="_itemContent_6qfeg_148",ET="_itemIcon_6qfeg_156",MT="_itemLabel_6qfeg_162",jT="_checkbox_6qfeg_174",IT="_checkboxChecked_6qfeg_188",DT="_checkboxDisabled_6qfeg_193",OT="_checkmark_6qfeg_198",RT="_controls_6qfeg_211",LT="_ctrlBtn_6qfeg_223",BT="_ctrlBtnDisabled_6qfeg_248",Re={root:bT,panel:yT,panelHeader:xT,filterWrap:vT,filterIcon:_T,filterInput:kT,filterClear:wT,list:CT,item:ST,itemDisabled:NT,itemSelected:AT,itemContent:TT,itemIcon:ET,itemLabel:MT,checkbox:jT,checkboxChecked:IT,checkboxDisabled:DT,checkmark:OT,controls:RT,ctrlBtn:LT,ctrlBtnDisabled:BT},$T=()=>d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M5 3l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),PT=()=>d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M2 3l4 4-4 4M7 3l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),zT=()=>d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M9 3L5 7l4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),FT=()=>d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{d:"M12 3L8 7l4 4M7 3L3 7l4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),HT=()=>d.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:[d.jsx("circle",{cx:"5.5",cy:"5.5",r:"3.5",stroke:"currentColor",strokeWidth:"1.5"}),d.jsx("path",{d:"M8.5 8.5L11 11",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),WT=()=>d.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:d.jsx("path",{d:"M2 2l8 8M10 2L2 10",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})});function VT({checked:t,disabled:e}){return d.jsx("span",{className:[Re.checkbox,t?Re.checkboxChecked:"",e?Re.checkboxDisabled:""].filter(Boolean).join(" "),"aria-hidden":"true",children:t&&d.jsx("svg",{className:Re.checkmark,viewBox:"0 0 11 11",children:d.jsx("polyline",{points:"1.5,5.5 4.5,8.5 9.5,2.5"})})})}function Fs({onClick:t,disabled:e,"aria-label":n,children:r}){return d.jsx("button",{type:"button",className:[Re.ctrlBtn,e?Re.ctrlBtnDisabled:""].filter(Boolean).join(" "),onClick:t,disabled:e,"aria-label":n,children:r})}function fd({header:t,items:e,selectedIds:n,onToggle:r,itemTemplate:s,filter:i,filterValue:o,onFilterChange:l,filterPlaceholder:a="Filter...",showCheckbox:c=!0,ariaLabel:u}){const h=x.useMemo(()=>{if(!i||!o.trim())return e;const p=o.toLowerCase();return e.filter(f=>String(f.label??"").toLowerCase().includes(p))},[e,i,o]);return d.jsxs("div",{className:Re.panel,children:[t!=null&&d.jsx("div",{className:Re.panelHeader,children:t}),i&&d.jsxs("div",{className:Re.filterWrap,children:[d.jsx("span",{className:Re.filterIcon,children:d.jsx(HT,{})}),d.jsx("input",{type:"text",className:Re.filterInput,value:o,onChange:p=>l(p.target.value),placeholder:a,"aria-label":`Filter ${u}`}),o&&d.jsx("button",{type:"button",className:Re.filterClear,onClick:()=>l(""),"aria-label":"Clear filter",children:d.jsx(WT,{})})]}),d.jsx("ul",{className:Re.list,role:"listbox","aria-label":u,"aria-multiselectable":"true",children:h.map(p=>{const f=n.has(p.id);return d.jsxs("li",{role:"option","aria-selected":f,"aria-disabled":p.disabled||void 0,className:[Re.item,f?Re.itemSelected:"",p.disabled?Re.itemDisabled:""].filter(Boolean).join(" "),onClick:()=>!p.disabled&&r(p.id),tabIndex:p.disabled?-1:0,onKeyDown:m=>{(m.key===" "||m.key==="Enter")&&!p.disabled&&(m.preventDefault(),r(p.id))},children:[c&&d.jsx(VT,{checked:f,disabled:p.disabled}),s?s(p):d.jsxs("span",{className:Re.itemContent,children:[p.icon&&d.jsx("i",{className:`${p.icon} ${Re.itemIcon}`,"aria-hidden":"true"}),d.jsx("span",{className:Re.itemLabel,children:p.label})]})]},p.id)})})]})}const Mf=x.forwardRef(({sourceItems:t,targetItems:e,onChange:n,sourceHeader:r,targetHeader:s,itemTemplate:i,filter:o=!1,sourceFilterPlaceholder:l,targetFilterPlaceholder:a,showMoveAll:c=!0,showCheckbox:u=!0,className:h,style:p},f)=>{const[m,g]=x.useState(new Set),[b,y]=x.useState(new Set),[v,_]=x.useState(""),[w,k]=x.useState("");function C(q){g(j=>{const $=new Set(j);return $.has(q)?$.delete(q):$.add(q),$})}function S(q){y(j=>{const $=new Set(j);return $.has(q)?$.delete(q):$.add(q),$})}function O(){const q=t.filter($=>m.has($.id)),j=t.filter($=>!m.has($.id));n({source:j,target:[...e,...q]}),g(new Set)}function B(){const q=t.filter($=>!$.disabled),j=t.filter($=>$.disabled);n({source:j,target:[...e,...q]}),g(new Set)}function N(){const q=e.filter($=>b.has($.id)),j=e.filter($=>!b.has($.id));n({source:[...t,...q],target:j}),y(new Set)}function T(){const q=e.filter($=>!$.disabled),j=e.filter($=>$.disabled);n({source:[...t,...q],target:j}),y(new Set)}const P=m.size>0,L=b.size>0,R=t.some(q=>!q.disabled),H=e.some(q=>!q.disabled);return d.jsxs("div",{ref:f,className:[Re.root,h??""].filter(Boolean).join(" "),style:p,children:[d.jsx(fd,{header:r,items:t,selectedIds:m,onToggle:C,itemTemplate:i,filter:o,filterValue:v,onFilterChange:_,filterPlaceholder:l,showCheckbox:u,ariaLabel:"Source list"}),d.jsxs("div",{className:Re.controls,role:"group","aria-label":"Move controls",children:[c&&d.jsx(Fs,{onClick:B,disabled:!R,"aria-label":"Move all to target",children:d.jsx(PT,{})}),d.jsx(Fs,{onClick:O,disabled:!P,"aria-label":"Move selected to target",children:d.jsx($T,{})}),d.jsx(Fs,{onClick:N,disabled:!L,"aria-label":"Move selected to source",children:d.jsx(zT,{})}),c&&d.jsx(Fs,{onClick:T,disabled:!H,"aria-label":"Move all to source",children:d.jsx(FT,{})})]}),d.jsx(fd,{header:s,items:e,selectedIds:b,onToggle:S,itemTemplate:i,filter:o,filterValue:w,onFilterChange:k,filterPlaceholder:a,showCheckbox:u,ariaLabel:"Target list"})]})});Mf.displayName="Picklist";const qT="_card_9z683_6",UT="_cardClickable_9z683_17",KT="_body_9z683_35",GT="_caption_9z683_45",JT="_title_9z683_53",YT="_subTitle_9z683_62",QT="_content_9z683_71",XT="_footer_9z683_79",un={card:qT,cardClickable:UT,body:KT,caption:GT,title:JT,subTitle:YT,content:QT,footer:XT},jf=x.forwardRef(({title:t,subTitle:e,footer:n,children:r,onClick:s,className:i,style:o},l)=>{const a=s!=null,c=t!=null||e!=null||r!=null;return d.jsx("div",{ref:l,className:[un.card,a?un.cardClickable:"",i??""].filter(Boolean).join(" "),style:o,onClick:s,role:a?"button":void 0,tabIndex:a?0:void 0,onKeyDown:a?u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),s==null||s(u))}:void 0,children:d.jsxs("div",{className:un.body,children:[c&&d.jsxs("div",{className:un.caption,children:[t!=null&&d.jsx("div",{className:un.title,children:t}),e!=null&&d.jsx("div",{className:un.subTitle,children:e}),r!=null&&d.jsx("div",{className:un.content,children:r})]}),n!=null&&d.jsx("div",{className:un.footer,children:n})]})})});jf.displayName="Card";const ZT="_accordion_7a03y_6",eE="_item_7a03y_16",tE="_itemDisabled_7a03y_21",nE="_header_7a03y_28",rE="_titleGroup_7a03y_52",sE="_title_7a03y_52",iE="_badge_7a03y_71",oE="_headerRight_7a03y_90",lE="_headerAction_7a03y_97",aE="_chevron_7a03y_105",cE="_chevronOpen_7a03y_114",dE="_contentOuter_7a03y_120",uE="_contentOpen_7a03y_126",hE="_contentInner_7a03y_130",fE="_variant_simple_7a03y_139",pE="_contentBody_7a03y_164",mE="_variant_page_7a03y_173",gE="_variant_panel_7a03y_211",bE="_variant_flyout_7a03y_246",Ke={accordion:ZT,item:eE,itemDisabled:tE,header:nE,titleGroup:rE,title:sE,badge:iE,headerRight:oE,headerAction:lE,chevron:aE,chevronOpen:cE,contentOuter:dE,contentOpen:uE,contentInner:hE,variant_simple:fE,contentBody:pE,variant_page:mE,variant_panel:gE,variant_flyout:bE},If=x.forwardRef(({items:t,variant:e="page",openIds:n,onChange:r,multiple:s=!1,className:i,style:o},l)=>{const a=c=>{const u=n.includes(c);r(s?u?n.filter(h=>h!==c):[...n,c]:u?[]:[c])};return d.jsx("div",{ref:l,className:[Ke.accordion,Ke[`variant_${e}`],i??""].filter(Boolean).join(" "),style:o,children:t.map(c=>{const u=n.includes(c.id),h=`accordion-header-${c.id}`,p=`accordion-panel-${c.id}`,f=(e==="panel"||e==="flyout")&&c.badge!=null,m=e==="panel"||e==="flyout";return d.jsxs("div",{className:[Ke.item,u?Ke.itemOpen:"",c.disabled?Ke.itemDisabled:""].filter(Boolean).join(" "),children:[d.jsxs("button",{id:h,className:Ke.header,"aria-expanded":u,"aria-controls":p,disabled:c.disabled,onClick:()=>a(c.id),children:[d.jsxs("span",{className:Ke.titleGroup,children:[d.jsx("span",{className:Ke.title,children:c.title}),f&&d.jsx("span",{className:Ke.badge,children:c.badge})]}),d.jsxs("span",{className:Ke.headerRight,children:[c.headerAction!=null&&d.jsx("span",{className:Ke.headerAction,onClick:g=>g.stopPropagation(),children:c.headerAction}),d.jsx("span",{className:[Ke.chevron,u?Ke.chevronOpen:""].join(" "),children:d.jsx("i",{className:m?"pi pi-angle-down":"pi pi-chevron-down"})})]})]}),d.jsx("div",{id:p,role:"region","aria-labelledby":h,className:[Ke.contentOuter,u?Ke.contentOpen:""].join(" "),children:d.jsx("div",{className:Ke.contentInner,children:d.jsx("div",{className:Ke.contentBody,children:c.content})})})]},c.id)})})});If.displayName="Accordion";const yE="_tabs_sya1k_6",xE="_tablist_sya1k_14",vE="_tab_sya1k_6",_E="_tabIcon_sya1k_51",kE="_tabLabel_sya1k_61",wE="_tabPipe_sya1k_67",CE="_tabCount_sya1k_77",SE="_tabDisabled_sya1k_86",NE="_tabActive_sya1k_86",AE="_panel_sya1k_117",TE="_nav_sya1k_128",Ct={tabs:yE,tablist:xE,tab:vE,tabIcon:_E,tabLabel:kE,tabPipe:wE,tabCount:CE,tabDisabled:SE,tabActive:NE,panel:AE,nav:TE},Df=x.forwardRef(({tabs:t,activeTab:e,onChange:n,variant:r="panel",className:s,style:i},o)=>{const l=t.find(u=>u.id===e),a=r==="nav",c=a?"nav":"div";return d.jsxs(c,{ref:o,className:[Ct.tabs,a?Ct.nav:"",s??""].filter(Boolean).join(" "),style:i,children:[d.jsx("div",{className:Ct.tablist,role:a?void 0:"tablist",children:t.map(u=>{const h=u.id===e,p=`tabpanel-${u.id}`,f=`tab-${u.id}`;return d.jsxs("button",{id:f,role:a?void 0:"tab","aria-selected":a?void 0:h,"aria-current":a&&h?"page":void 0,"aria-disabled":u.disabled,"aria-controls":a?void 0:p,disabled:u.disabled,className:[Ct.tab,h?Ct.tabActive:"",u.disabled?Ct.tabDisabled:""].filter(Boolean).join(" "),onClick:()=>{u.disabled||n(u.id)},children:[u.icon!=null&&d.jsx("span",{className:Ct.tabIcon,children:u.icon}),d.jsx("span",{className:Ct.tabLabel,children:u.label}),u.icon2!=null&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:Ct.tabPipe,children:"|"}),d.jsx("span",{className:Ct.tabIcon,children:u.icon2})]}),u.count!=null&&d.jsx("span",{className:Ct.tabCount,children:u.count})]},u.id)})}),!a&&l!=null&&l.content!=null&&d.jsx("div",{id:`tabpanel-${l.id}`,role:"tabpanel","aria-labelledby":`tab-${l.id}`,className:Ct.panel,children:l.content})]})});Df.displayName="Tabs";const EE="_bannerTabs_1emwd_6",ME="_track_1emwd_15",jE="_card_1emwd_31",IE="_cardDisabled_1emwd_55",DE="_cardActive_1emwd_55",OE="_labelRow_1emwd_88",RE="_label_1emwd_88",LE="_labelSep_1emwd_103",BE="_lockIcon_1emwd_110",$E="_statusIndicator_1emwd_117",PE="_subtitle_1emwd_123",zE="_docs_1emwd_133",FE="_badgeGroups_1emwd_139",HE="_badgeGroupWrap_1emwd_146",WE="_badgeGroup_1emwd_139",VE="_badgeGroupPipe_1emwd_160",qE="_badge_1emwd_139",UE="_badgeShape_1emwd_182",KE="_badgeShapeCircle_1emwd_189",GE="_badgeShapeDiamond_1emwd_194",JE="_badgeNum_1emwd_202",YE="_arrow_1emwd_239",QE="_arrowLeft_1emwd_270",XE="_arrowRight_1emwd_274",ZE="_fadeMask_1emwd_280",fe={bannerTabs:EE,track:ME,card:jE,cardDisabled:IE,cardActive:DE,labelRow:OE,label:RE,labelSep:LE,lockIcon:BE,statusIndicator:$E,subtitle:PE,docs:zE,badgeGroups:FE,badgeGroupWrap:HE,badgeGroup:WE,badgeGroupPipe:VE,badge:qE,badgeShape:UE,badgeShapeCircle:KE,badgeShapeDiamond:GE,badgeNum:JE,arrow:YE,arrowLeft:QE,arrowRight:XE,fadeMask:ZE},eM={green:"#66BB5F",yellow:"#F5C664",red:"#E53935",gray:"transparent"},tM={green:"#66BB5F",yellow:"#F5C664",red:"#E53935",gray:"#94A3B8"};function pd({shape:t,color:e}){const n=eM[e],r=tM[e],s=9;return t==="dot"?d.jsx("span",{className:fe.statusIndicator,style:{width:s,height:s,borderRadius:"50%",background:n,border:`1px solid ${r}`,flexShrink:0}}):t==="diamond"?d.jsx("span",{className:fe.statusIndicator,style:{width:s,height:s,background:n,border:`1px solid ${r}`,transform:"rotate(45deg)",flexShrink:0}}):t==="square"?d.jsx("span",{className:fe.statusIndicator,style:{width:s,height:s,background:n,border:`1px solid ${r}`,flexShrink:0}}):d.jsx("span",{className:fe.statusIndicator,style:{width:s,height:s,borderRadius:"50%",background:"transparent",border:"1.5px solid #94A3B8",flexShrink:0}})}const nM=[{shape:"square",color:"var(--red-500, #EB1000)"},{shape:"diamond",color:"var(--yellow-500, #FBDE0B)"},{shape:"circle",color:"var(--green-300, #6FB864)"}],rM=[{shape:"square",color:"var(--teal-600, #138890)"},{shape:"square",color:"var(--green-600, #22A34A)"},{shape:"square",color:"var(--teal-500, #32A4AC)"}],sM="var(--surface-500, #ADB5BD)";function iM({shape:t,color:e,count:n,tooltip:r,diamondGroup0:s}){const i=n===0,o=i?sM:e,l=i?"var(--navy-900, #0D1117)":s?"var(--navy-800, #171D22)":"#ffffff";return d.jsxs("span",{className:fe.badge,"data-tooltip":r,children:[d.jsx("span",{className:[fe.badgeShape,t==="circle"?fe.badgeShapeCircle:"",t==="diamond"?fe.badgeShapeDiamond:""].filter(Boolean).join(" "),style:{background:o}}),d.jsx("span",{className:fe.badgeNum,style:{color:l},children:n})]})}const pa=x.forwardRef(({items:t,activeId:e,onChange:n,className:r,style:s},i)=>{const o=x.useRef(null),[l,a]=x.useState(!1),[c,u]=x.useState(!1),h=x.useCallback(()=>{const f=o.current;f!=null&&(a(f.scrollLeft>0),u(f.scrollLeft+f.clientWidth<f.scrollWidth-1))},[]);x.useEffect(()=>{const f=o.current;if(f==null)return;h(),f.addEventListener("scroll",h,{passive:!0});const m=new ResizeObserver(h);return m.observe(f),()=>{f.removeEventListener("scroll",h),m.disconnect()}},[h]);const p=f=>{var m;(m=o.current)==null||m.scrollBy({left:f==="left"?-200:200,behavior:"smooth"})};return d.jsxs("div",{ref:i,className:[fe.bannerTabs,r??""].filter(Boolean).join(" "),style:s,children:[l&&d.jsx("button",{className:[fe.arrow,fe.arrowLeft].join(" "),onClick:()=>p("left"),"aria-label":"Scroll left",tabIndex:-1,children:d.jsx("i",{className:"pi pi-chevron-left"})}),d.jsx("div",{className:fe.track,ref:o,children:t.map(f=>{const m=f.id===e;return d.jsxs("button",{className:[fe.card,m?fe.cardActive:"",f.disabled?fe.cardDisabled:""].filter(Boolean).join(" "),onClick:()=>{f.disabled||n(f.id)},disabled:f.disabled,"aria-pressed":m,"aria-disabled":f.disabled,children:[d.jsxs("div",{className:fe.labelRow,children:[d.jsx(pd,{shape:f.status.shape,color:f.status.color}),d.jsx("span",{className:fe.label,children:f.label}),f.subLabel!=null&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:fe.labelSep,children:"/"}),f.subStatus!=null&&d.jsx(pd,{shape:f.subStatus.shape,color:f.subStatus.color}),d.jsx("span",{className:fe.label,children:f.subLabel})]}),f.locked&&d.jsx("i",{className:`pi pi-lock ${fe.lockIcon}`})]}),d.jsx("div",{className:fe.subtitle,children:f.subtitle}),f.badgeGroups!=null&&f.badgeGroups.length>0&&d.jsx("div",{className:fe.badgeGroups,children:f.badgeGroups.map((g,b)=>d.jsxs("div",{className:fe.badgeGroupWrap,children:[b>0&&d.jsx("span",{className:fe.badgeGroupPipe,children:"|"}),d.jsx("div",{className:fe.badgeGroup,children:g.badges.map((y,v)=>{const w=(b===0?nM:rM)[v]??{shape:"square",color:"var(--teal-600, #138890)"},k=y.shape??w.shape;return d.jsx(iM,{shape:k,color:y.color??w.color,count:y.count,tooltip:y.tooltip,diamondGroup0:b===0&&k==="diamond"},v)})})]},b))}),f.docs!=null&&d.jsx("div",{className:fe.docs,children:f.docs})]},f.id)})}),c&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:fe.fadeMask}),d.jsx("button",{className:[fe.arrow,fe.arrowRight].join(" "),onClick:()=>p("right"),"aria-label":"Scroll right",tabIndex:-1,children:d.jsx("i",{className:"pi pi-chevron-right"})})]})]})});pa.displayName="BannerTabs";const oM="_overlay_54tc7_3",lM="_overlayOpen_54tc7_17",aM="_drawer_54tc7_34",cM="_side_right_54tc7_44",dM="_side_left_54tc7_49",uM="_open_54tc7_54",hM="_header_54tc7_60",fM="_headerTitle_54tc7_69",pM="_title_54tc7_77",mM="_subtitle_54tc7_85",gM="_body_54tc7_95",bM="_footer_54tc7_105",yM="_footerShadow_54tc7_117",xM="_tertiaryGroup_54tc7_128",mt={overlay:oM,overlayOpen:lM,drawer:aM,side_right:cM,side_left:dM,open:uM,header:hM,headerTitle:fM,title:pM,subtitle:mM,body:gM,footer:bM,footerShadow:yM,tertiaryGroup:xM},Of=x.forwardRef(({isOpen:t,onClose:e,title:n,subtitle:r,children:s,primaryAction:i,secondaryAction:o,tertiaryActions:l,side:a="right",width:c=800,className:u,style:h},p)=>{const f=x.useRef(null),[m,g]=x.useState(!1);x.useEffect(()=>{if(!t)return;const _=w=>{w.key==="Escape"&&e()};return document.addEventListener("keydown",_),()=>document.removeEventListener("keydown",_)},[t,e]);const b=x.useCallback(()=>{const _=f.current;if(!_){g(!1);return}const w=_.scrollHeight-_.scrollTop-_.clientHeight>2;g(w)},[]);x.useEffect(()=>{if(!t)return;const _=requestAnimationFrame(b),w=f.current;if(!w)return;w.addEventListener("scroll",b);const k=new ResizeObserver(b);return k.observe(w),()=>{cancelAnimationFrame(_),w.removeEventListener("scroll",b),k.disconnect()}},[t,b]);const y=[mt.drawer,mt[`side_${a}`],t?mt.open:"",u??""].filter(Boolean).join(" "),v=[mt.overlay,t?mt.overlayOpen:""].filter(Boolean).join(" ");return Ut.createPortal(d.jsx("div",{className:v,"data-side":a,onClick:t?e:void 0,"aria-hidden":!t,children:d.jsxs("div",{ref:p,role:"dialog","aria-modal":"true","aria-label":n??"Drawer",className:y,style:{width:c,...h},onClick:_=>_.stopPropagation(),children:[d.jsxs("div",{className:mt.header,children:[d.jsxs("div",{className:mt.headerTitle,children:[n&&d.jsx("span",{className:mt.title,children:n}),r&&d.jsx("div",{className:mt.subtitle,children:r})]}),d.jsx(Lt,{"aria-label":"Close drawer",onClick:e})]}),d.jsx("div",{ref:f,className:mt.body,children:s}),d.jsxs("div",{className:mt.footer,children:[m&&d.jsx("div",{className:mt.footerShadow,"aria-hidden":"true"}),l&&l.length>0&&d.jsx("div",{className:mt.tertiaryGroup,children:l.map((_,w)=>d.jsx(We,{variant:"ghost",size:"md",onClick:_.onClick,disabled:_.disabled,children:_.label},w))}),o&&d.jsx(We,{variant:"secondary",size:"md",onClick:o.onClick,disabled:o.disabled,children:o.label}),d.jsx(We,{variant:"primary",size:"md",onClick:i.onClick,disabled:i.disabled,children:i.label})]})]})}),document.body)});Of.displayName="Drawer";const vM="_container_7u9if_3",_M="_toast_7u9if_17",kM="_toastEnter_7u9if_52",wM="_toastExit_7u9if_56",CM="_content_7u9if_62",SM="_contentVertical_7u9if_69",NM="_contentHorizontal_7u9if_74",AM="_icon_7u9if_82",TM="_text_7u9if_91",EM="_textVertical_7u9if_96",MM="_textHorizontal_7u9if_102",jM="_title_7u9if_110",IM="_detail_7u9if_118",gt={container:vM,toast:_M,toastEnter:kM,toastExit:wM,content:CM,contentVertical:SM,contentHorizontal:NM,icon:AM,text:TM,textVertical:EM,textHorizontal:MM,title:jM,detail:IM},Cl=new Set;let Hn=[];function Sl(){Cl.forEach(t=>t([...Hn]))}function Rf(t){Hn=Hn.map(e=>e.id===t?{...e,exiting:!0}:e),Sl(),setTimeout(()=>{Hn=Hn.filter(e=>e.id!==t),Sl()},300)}function Hs(t,e,n,r={}){const s={id:crypto.randomUUID(),severity:t,title:e,detail:n,layout:r.layout??"horizontal",duration:r.duration??5e3};Hn=[...Hn,s],Sl(),s.duration>0&&setTimeout(()=>Rf(s.id),s.duration)}const DM={success:(t,e,n)=>Hs("success",t,e,n),info:(t,e,n)=>Hs("info",t,e,n),warn:(t,e,n)=>Hs("warn",t,e,n),error:(t,e,n)=>Hs("error",t,e,n)},OM={success:{icon:"pi-check",bgVar:"--green-50",borderVar:"--green-700",titleVar:"--green-700",iconVar:"--green-600"},info:{icon:"pi-info-circle",bgVar:"--blue-50",borderVar:"--blue-600",titleVar:"--blue-600",iconVar:"--blue-600"},warn:{icon:"pi-exclamation-triangle",bgVar:"--yellow-50",borderVar:"--yellow-800",titleVar:"--yellow-800",iconVar:"--yellow-600"},error:{icon:"pi-times-circle",bgVar:"--red-50",borderVar:"--red-600",titleVar:"--red-600",iconVar:"--red-500"}},RM={success:{bg:"#edf8ea",border:"#1a760b",title:"#1a760b",icon:"#16a34a"},info:{bg:"#f5f9ff",border:"#326fd1",title:"#326fd1",icon:"#2563eb"},warn:{bg:"#fffce7",border:"#695d05",title:"#695d05",icon:"#ca8a04"},error:{bg:"#fff5f5",border:"#d60f00",title:"#d60f00",icon:"#dc2626"}};function Lf({id:t,severity:e,title:n,detail:r,layout:s="horizontal",exiting:i,onClose:o}){const l=OM[e],a=RM[e],c=`toast-desc-${t}`,u=s==="vertical",h={"--t-bg":`var(${l.bgVar}, ${a.bg})`,"--t-border":`var(${l.borderVar}, ${a.border})`,"--t-title":`var(${l.titleVar}, ${a.title})`,"--t-icon":`var(${l.iconVar}, ${a.icon})`};return d.jsx("div",{role:"alert","aria-live":"assertive","aria-atomic":"true","aria-describedby":r?c:void 0,className:[gt.toast,i?gt.toastExit:gt.toastEnter].join(" "),style:h,children:d.jsxs("div",{className:[gt.content,u?gt.contentVertical:gt.contentHorizontal].join(" "),children:[d.jsx("i",{className:`pi ${l.icon} ${gt.icon}`,"aria-hidden":"true"}),d.jsxs("div",{className:[gt.text,u?gt.textVertical:gt.textHorizontal].join(" "),children:[d.jsx("span",{className:gt.title,children:n}),r&&d.jsx("span",{id:c,className:gt.detail,children:r})]}),d.jsx(Lt,{"aria-label":"Dismiss notification",onClick:o})]})})}function Bf(){const[t,e]=x.useState([]);return x.useEffect(()=>(Cl.add(e),()=>{Cl.delete(e)}),[]),t.length===0?null:Ut.createPortal(d.jsx("div",{className:gt.container,"aria-label":"Notifications",children:t.map(n=>d.jsx(Lf,{...n,onClose:()=>Rf(n.id)},n.id))}),document.body)}Bf.displayName="Toaster";function $f({severity:t,title:e,detail:n,layout:r="horizontal",onClose:s}){const i=x.useId();return d.jsx(Lf,{id:i,severity:t,title:e,detail:n,layout:r,onClose:s??(()=>{})})}$f.displayName="Toast";const LM="_wrapper_ety4d_1",BM="_track_ety4d_10",$M="_trackError_ety4d_18",PM="_fill_ety4d_24",zM="_errorMessage_ety4d_37",Rr={wrapper:LM,track:BM,trackError:$M,fill:PM,errorMessage:zM};function Pf({value:t,max:e=100,error:n=!1,errorMessage:r,"aria-label":s}){const i=Math.min(Math.max(t,0),e),o=e>0?i/e*100:0;return d.jsxs("div",{className:Rr.wrapper,children:[d.jsx("div",{role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":e,"aria-label":s,className:[Rr.track,n?Rr.trackError:""].join(" ").trim(),children:!n&&d.jsx("div",{className:Rr.fill,style:{width:`${o}%`}})}),n&&r&&d.jsx("p",{className:Rr.errorMessage,children:r})]})}Pf.displayName="ProgressBar";const FM="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAfCAYAAAD0ma06AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAOdEVYdFNvZnR3YXJlAEZpZ21hnrGWYwAABe9JREFUeAG9VwlslEUUfm/m/7e7LbCFlqsSEJRgFNREkGI5ypEgRBI5FkjEasEggiwtpTc123Jsa3VbLDXWGORspIUoRoJQg0AJh0GCSJBIEQNoLErva7v/zPj+LVQKLeVIfckmM2/mf9+75r23CPdJNlfWgEBdmySRvYioBisF/RBQgoJyyaAMpTrRpGlHGxOd1+4lBzsDsrs9UzjyeFBqlJTyImN4XgKrBpDAkfWQSj3LQA1XAAEkzEsaHKC7n1amxH3zQID27OzB6NM8DFUAyd5cceb4biguFu3d7Zu9NajZ99cEkNoyxtkkBcpKlpfWC1+0Ny3hUqeAdveHs7nCOcgx40Zi7C+3n4W5CgIboMESUGf4yj+Ir7/z254ZnhFcx3USYAZJr5UCUqtSY/M6BLSv88xlGj5RmRjrNvdWt2eIDXAeRWscMAwHUD1bLyusUAjnQMl9AmFXTfLKMj/f5WJ2S3ASR5UOiFxJuboyZeX6uwAD1+aNDODGsMrk2B2Baz20htWI7BWKCYdOCcmTsLNOqIzmtBavBK/PdVJIcmjJCDSlMjXOrbW6IjPTLpUvuDIptjBEoZs0TzRNILAWYwB+Y4BHBKrTCOwGAIVT4CBkaizJG003Qkj9+d24elW6czKFgV8wlG+RIqwlmeCPNhYG5+Q8jl5vJSprIX08/ZbWUsm9jCl3RVLcsY5se9rlslwP7BklhEwmgUNusqXfMlT/SGFMrU5NOP0foFIYlp5uawoI3kSbeTcDVC4VLqlKif0K7pNI6WBshFREWEFbnZ7IT02GmNmUFn+51fG3FqGZnvcUYLrpQWKW1aN3clNS0hV4CArJ2vCGFHJ0SDceW+Z0em8/8wP2yvA8wyx4hqzSKFhXmwEmtWbcw5MpW93J9CcN19X7fjAiyTCtJvGRwaA9ML8WYVlZw6hIXfDfQDhbnrDqOehC0iiV5tJb8W/o8bqhi0nTGExGFFQQ0NdQ2/gtdDFpHOVI9KeOulzlclVBFxNZKIOov9ErxXPwPxB1E0F9TYLGjFqTEelyadCFxHQC1OhnQRFqMmr7W4MishK6QxcRY0zWmKC6JoaajB/fTqqWdhYBj0BUrbDg1BR7u4AWLr43LdTAGPpCQUx/k8llkxH5mXM4PCTlHx6T1FhXfza/ZPTYuwBRMw5R/EBnEgMBF5jMo0tzv6P0XRSZv7QbPCDlHAyPoEfmogFroGFhh/MORax3FDla+ymzNTbu0Jhq0DmBampZZL7DD4JSZPfoLjIdRVGP3S9YbulYB2P8AC3rqZQso9S/Sh0jeWzva+dyD48a7wcsdeb9raMo1sxMRTHIZuu7xDwoWbTxT97U+BEztG0Ltr358r2AsvZEdM8+OC5ZGvA5tf3rmvJNiok89rFP2iagUpeoqjzFpLaRqmvLk59RGBfa7G26SDNIMGeqhsDnfPl6QYl5tnDPwjDp8+ZZwAi1WORWJnxnrL3lr82+Gh5iWJ9n0DxBA7GYcxnGmNjeaBWrUsNPlpvf5pWOcSgBReRe5WMqfOX44z+09sNpm5dGUbZuMS2lzC0P1NXMrXM3Hb91vmTPrAiLxFma5ptqYWKYTqbrKKWmiSs6UyXCJzYnTT3SOhVsLA130hTiUTRESYnpKyYec/lDdbtrZm9ftJaDSmX+t6l8nBsZPYIqs/Om72vTRB0O4OOipwWV1nWrL57bdlb1FA2wWfsNzKIBebm5JxdvWT7hRDTcbFd3jYnzd0av1pSxhkqeWX3oBxcog9Pqb3j3b1r0dS10QNn7X+pjsYoolPguTeeDTPlCyk/w54oYp7OsVeF2B+GoXa8ttCjhJkv76P6yRz8urlqYcYFzVaaBPB+gvHUqAHvR+31SBzWCprcR1Obs2JIZPgpLwjsRJzcgtm3EHY76iwtnhOq2gFSqswuoMIT6QbGlDGqc4gzSv+bEpzCYcSeeqmYodgdJXBM98cTv7cnt9M9M/F5HP5TeySR4OkcxmhQYzLlgJjgnp3GOV7gSpwwlS3UQO2OmtGRoR/Qv6vWE/P0RxtUAAAAASUVORK5CYII=",HM="_wrapper_19qsy_1",WM="_ring_19qsy_10",VM="_ringLg_19qsy_18",qM="_svg_19qsy_25",UM="_spin_19qsy_1",KM="_logo_19qsy_42",GM="_label_19qsy_52",Dn={wrapper:HM,ring:WM,ringLg:VM,svg:qM,spin:UM,logo:KM,label:GM,"label--light":"_label--light_19qsy_59","label--dark":"_label--dark_19qsy_63"},JM={sm:{px:20,r:8.5,sw:3},md:{px:32,r:14.5,sw:3},lg:{px:36,r:16.5,sw:3}};function zf({size:t="md",label:e,theme:n="light","aria-label":r}){const i=`ps-grad-${x.useId().replace(/:/g,"")}`,{px:o,r:l,sw:a}=JM[t],c=2*Math.PI*l,u=c*.75,h=c*.25,p=t==="lg";return d.jsxs("div",{className:Dn.wrapper,role:"status","aria-label":r??"Loading",children:[d.jsxs("div",{className:[Dn.ring,p?Dn.ringLg:""].join(" ").trim(),children:[d.jsxs("svg",{width:o,height:o,viewBox:`0 0 ${o} ${o}`,className:Dn.svg,"aria-hidden":"true",children:[d.jsx("defs",{children:d.jsxs("linearGradient",{id:i,x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[d.jsx("stop",{offset:"0%",stopColor:"var(--teal-600, #138890)"}),d.jsx("stop",{offset:"100%",stopColor:"var(--green-300, #6FB864)"})]})}),d.jsx("circle",{cx:o/2,cy:o/2,r:l,fill:"none",stroke:"var(--surface-300, #F4F4F5)",strokeWidth:a}),d.jsx("circle",{cx:o/2,cy:o/2,r:l,fill:"none",stroke:`url(#${i})`,strokeWidth:a,strokeDasharray:`${u} ${h}`,strokeLinecap:"round"})]}),p&&d.jsx("img",{src:FM,alt:"","aria-hidden":"true",className:Dn.logo})]}),e&&d.jsx("span",{className:[Dn.label,Dn[`label--${n}`]].join(" "),children:e})]})}zf.displayName="ProgressSpinner";const YM="_chip_2a8wk_1",QM="_label_2a8wk_27",XM="_dismiss_2a8wk_33",Wo={chip:YM,label:QM,dismiss:XM},ZM={plain:{bgVar:"--navy-50",bg:"#EAEBEC",textVar:"--teal-900",text:"#18474A"},contrast:{bgVar:"--teal-900",bg:"#18474A",text:"#ffffff"},error:{bgVar:"--red-500",bg:"#EB1000",text:"#ffffff"},warning:{bgVar:"--yellow-400",bg:"#FCE53C",textVar:"--yellow-900",text:"#514908"},informative:{bgVar:"--blue-400",bg:"#609AF8",text:"#ffffff"},success:{bgVar:"--green-500",bg:"#1E830E",text:"#ffffff"}};function Ff({label:t,severity:e,dismissible:n=!0,onDismiss:r}){const s=ZM[e],i={"--c-bg":`var(${s.bgVar}, ${s.bg})`,"--c-text":s.textVar?`var(${s.textVar}, ${s.text})`:s.text};return d.jsxs("span",{className:Wo.chip,style:i,children:[d.jsx("span",{className:Wo.label,children:t}),n&&d.jsx("button",{type:"button",className:Wo.dismiss,onClick:r,"aria-label":`Remove ${t}`,children:d.jsx("i",{className:"pi pi-times","aria-hidden":"true"})})]})}Ff.displayName="SeverityChip";const ej="_chip_1b2ko_1",tj="_avatar_1b2ko_38",nj="_label_1b2ko_53",rj="_dismiss_1b2ko_59",Lr={chip:ej,avatar:tj,label:nj,dismiss:rj};function Hf({label:t,leading:e,trailing:n,dismissible:r=!0,onDismiss:s}){return d.jsxs("span",{className:Lr.chip,"data-leading":e?"true":void 0,"data-trailing":n?"true":void 0,children:[e&&d.jsx("span",{className:Lr.avatar,children:e}),d.jsx("span",{className:Lr.label,children:t}),n&&d.jsx("span",{className:Lr.avatar,children:n}),r&&d.jsx("button",{type:"button",className:Lr.dismiss,onClick:s,"aria-label":`Remove ${t}`,children:d.jsx("i",{className:"pi pi-times","aria-hidden":"true"})})]})}Hf.displayName="ProfileChip";const sj="_chip_4qp0t_1",ij="_dot_4qp0t_28",oj="_label_4qp0t_35",Vo={chip:sj,dot:ij,label:oj},lj={green:{dotVar:"--green-500",dot:"#1E830E"},red:{dotVar:"--red-500",dot:"#EB1000"},yellow:{dotVar:"--yellow-400",dot:"#FCE53C"},grey:{dotVar:"--navy-300",dot:"#70777D"}};function Wf({label:t,color:e}){const n=lj[e];return d.jsxs("span",{className:Vo.chip,children:[d.jsx("span",{className:Vo.dot,style:{background:`var(${n.dotVar}, ${n.dot})`},"aria-hidden":"true"}),d.jsx("span",{className:Vo.label,children:t})]})}Wf.displayName="AUSChip";const aj="_banner_lfuvj_1",cj="_icon_lfuvj_16",dj="_text_lfuvj_25",uj="_title_lfuvj_34",hj="_detail_lfuvj_42",Br={banner:aj,icon:cj,text:dj,title:uj,detail:hj},fj={success:{icon:"pi-check",bgVar:"--green-50",borderVar:"--green-700",colorVar:"--green-700",bg:"#edf8ea",border:"#1a760b",color:"#1a760b"},info:{icon:"pi-info-circle",bgVar:"--blue-50",borderVar:"--blue-600",colorVar:"--blue-600",bg:"#f5f9ff",border:"#326fd1",color:"#326fd1"},warn:{icon:"pi-exclamation-triangle",bgVar:"--yellow-50",borderVar:"--yellow-800",colorVar:"--yellow-800",bg:"#fefaed",border:"#695d05",color:"#695d05"},error:{icon:"pi-exclamation-circle",bgVar:"--red-50",borderVar:"--red-600",colorVar:"--red-600",bg:"#fff5f5",border:"#d60f00",color:"#d60f00"},neutral:{icon:"pi-info-circle",bgVar:"--teal-50",borderVar:"--teal-700",colorVar:"--teal-700",bg:"#eaf6f7",border:"#186368",color:"#186368"}};function ma({severity:t,title:e,detail:n,closable:r=!0,onClose:s}){const i=fj[t],o={"--a-bg":`var(${i.bgVar}, ${i.bg})`,"--a-border":`var(${i.borderVar}, ${i.border})`,"--a-color":`var(${i.colorVar}, ${i.color})`};return d.jsxs("div",{role:"alert",className:Br.banner,style:o,children:[d.jsx("i",{className:`pi ${i.icon} ${Br.icon}`,"aria-hidden":"true"}),d.jsxs("div",{className:Br.text,children:[d.jsx("span",{className:Br.title,children:e}),n&&d.jsx("span",{className:Br.detail,children:n})]}),r&&d.jsx(Lt,{"aria-label":"Dismiss",onClick:s})]})}ma.displayName="BannerAlert";const pj="_alert_1cttt_1",mj="_icon_1cttt_12",gj="_message_1cttt_21",qo={alert:pj,icon:mj,message:gj},bj={success:{icon:"pi-check",bgVar:"--green-50",colorVar:"--green-700",bg:"#edf8ea",color:"#1a760b"},info:{icon:"pi-info-circle",bgVar:"--blue-50",colorVar:"--blue-600",bg:"#f5f9ff",color:"#326fd1"},warn:{icon:"pi-exclamation-triangle",bgVar:"--yellow-50",colorVar:"--yellow-800",bg:"#fffce7",color:"#695d05"},error:{icon:"pi-exclamation-circle",bgVar:"--red-50",colorVar:"--red-600",bg:"#fff5f5",color:"#d60f00"}};function Vf({severity:t,message:e,closable:n=!0,onClose:r}){const s=bj[t],i={"--a-bg":`var(${s.bgVar}, ${s.bg})`,"--a-color":`var(${s.colorVar}, ${s.color})`};return d.jsxs("div",{role:"alert",className:qo.alert,style:i,children:[d.jsx("i",{className:`pi ${s.icon} ${qo.icon}`,"aria-hidden":"true"}),d.jsx("span",{className:qo.message,children:e}),n&&d.jsx(Lt,{"aria-label":"Dismiss",onClick:r})]})}Vf.displayName="InlineContainedAlert";const yj="_alert_p3w47_1",xj="_icon_p3w47_9",vj="_message_p3w47_18",Uo={alert:yj,icon:xj,message:vj},_j={success:{icon:"pi-check",colorVar:"--green-700",color:"#1a760b"},info:{icon:"pi-info-circle",colorVar:"--blue-600",color:"#326fd1"},warn:{icon:"pi-exclamation-triangle",colorVar:"--yellow-800",color:"#695d05"},error:{icon:"pi-exclamation-circle",colorVar:"--red-600",color:"#d60f00"}};function qf({severity:t,message:e}){const n=_j[t],r={"--a-color":`var(${n.colorVar}, ${n.color})`};return d.jsxs("div",{role:"status",className:Uo.alert,style:r,children:[d.jsx("i",{className:`pi ${n.icon} ${Uo.icon}`,"aria-hidden":"true"}),d.jsx("span",{className:Uo.message,children:e})]})}qf.displayName="InlineAlert";const kj="_container_88she_3",wj="_dropzone_88she_15",Cj="_dragOver_88she_40",Sj="_dropText_88she_45",Nj="_browseLink_88she_51",Aj="_hiddenInput_88she_57",Tj="_errorMessage_88she_63",Ej="_fileList_88she_79",Mj="_tableHeader_88she_83",jj="_colName_88she_92",Ij="_colType_88she_101",Dj="_fileRow_88she_111",Oj="_fileName_88she_119",Rj="_docTypeWrap_88she_130",Lj="_removeBtn_88she_137",Bj="_footer_88she_157",Xe={container:kj,dropzone:wj,dragOver:Cj,dropText:Sj,browseLink:Nj,hiddenInput:Aj,errorMessage:Tj,fileList:Ej,tableHeader:Mj,colName:jj,colType:Ij,fileRow:Dj,fileName:Oj,docTypeWrap:Rj,removeBtn:Lj,footer:Bj},Uf=["Miscellaneous","Agreements","Bank Statement","Hazard Insurance Binder","Pay Stub","Personal Identification","Purchase Agreement","Tax Return Transcript"],$j=".html,.heic,.jpeg,.jpg,.png,.gif,.bmp,.tiff,.tif,.pdf,.doc,.docx,.xls,.xlsx";function Pj(t,e){return e.split(",").map(r=>r.trim().toLowerCase()).some(r=>t.name.toLowerCase().endsWith(r))}function Kf({onFilesAdded:t,onUpload:e,docTypes:n=Uf,accept:r=$j,initialFiles:s,className:i,style:o}){const[l,a]=x.useState([]),[c,u]=x.useState(!1),[h,p]=x.useState(null),f=x.useRef(null),m=x.useId();x.useEffect(()=>{s&&s.length>0&&a(s.map(N=>({id:crypto.randomUUID(),file:N,docType:""})))},[]);const g=l.length>0&&l.every(N=>N.docType!==""),b=n.map(N=>({label:N,value:N})),y=x.useCallback(N=>{p(null);const T=[],P=[];if(N.forEach(L=>{Pj(L,r)?T.push(L):P.push(L)}),P.length>0&&p("File format not supported. Please try again."),T.length>0){const L=T.map(R=>({id:crypto.randomUUID(),file:R,docType:""}));a(R=>[...R,...L]),t==null||t(T)}},[r,t]),v=N=>{N.preventDefault(),u(!0)},_=N=>{N.currentTarget.contains(N.relatedTarget)||u(!1)},w=N=>{N.preventDefault(),u(!1),y(Array.from(N.dataTransfer.files))},k=N=>{N.target.files&&N.target.files.length>0&&(y(Array.from(N.target.files)),N.target.value="")},C=()=>{var N;(N=f.current)==null||N.click()},S=(N,T)=>{a(P=>P.map(L=>L.id===N?{...L,docType:T??""}:L))},O=N=>{a(T=>T.filter(P=>P.id!==N))},B=()=>{g&&(e(l.map(({file:N,docType:T})=>({file:N,docType:T}))),a([]),p(null))};return d.jsxs("div",{className:[Xe.container,i??""].filter(Boolean).join(" "),style:o,children:[d.jsxs("div",{className:[Xe.dropzone,c?Xe.dragOver:""].filter(Boolean).join(" "),onDragOver:v,onDragLeave:_,onDrop:w,onClick:C,role:"button",tabIndex:0,"aria-label":"File upload area. Click or drop files here.",onKeyDown:N=>{(N.key==="Enter"||N.key===" ")&&C()},children:[d.jsxs("span",{className:Xe.dropText,children:["Drop file(s) here or"," ",d.jsx("span",{className:Xe.browseLink,children:"browse"})]}),d.jsx("input",{ref:f,id:m,type:"file",multiple:!0,accept:r,className:Xe.hiddenInput,onChange:k,tabIndex:-1})]}),h&&d.jsxs("div",{className:Xe.errorMessage,role:"alert",children:[d.jsx("i",{className:"pi pi-exclamation-triangle","aria-hidden":"true"}),h]}),l.length>0&&d.jsxs("div",{className:Xe.fileList,children:[d.jsxs("div",{className:Xe.tableHeader,children:[d.jsx("span",{className:Xe.colName,children:"Document Name"}),d.jsx("span",{className:Xe.colType,children:"Document Type"})]}),l.map(N=>d.jsxs("div",{className:Xe.fileRow,children:[d.jsx("span",{className:Xe.fileName,title:N.file.name,children:N.file.name}),d.jsx("div",{className:Xe.docTypeWrap,children:d.jsx(pr,{options:b,value:N.docType||null,onChange:T=>S(N.id,T),placeholder:"Select Doc Type",filter:!0,size:"sm",style:{width:"100%"}})}),d.jsx("button",{type:"button",className:Xe.removeBtn,onClick:()=>O(N.id),"aria-label":`Remove ${N.file.name}`,children:d.jsx("i",{className:"pi pi-times-circle","aria-hidden":"true"})})]},N.id))]}),d.jsx("div",{className:Xe.footer,children:d.jsx(We,{variant:"primary",size:"md",onClick:B,disabled:!g,children:"Upload"})})]})}Kf.displayName="FileUpload";const zj="_overlay_keczm_3",Fj="_modal_keczm_19",Hj="_header_keczm_36",Wj="_headerTitle_keczm_45",Vj="_title_keczm_50",qj="_body_keczm_60",Uj="_footer_keczm_72",On={overlay:zj,modal:Fj,header:Hj,headerTitle:Wj,title:Vj,body:qj,footer:Uj},Gf=x.forwardRef(({isOpen:t,onClose:e,title:n,children:r,footer:s,scrim:i=!0,width:o=510,className:l,style:a},c)=>(x.useEffect(()=>{if(!t)return;const u=h=>{h.key==="Escape"&&e()};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[t,e]),t?Ut.createPortal(d.jsx("div",{className:On.overlay,"data-scrim":i,onClick:i?e:void 0,children:d.jsxs("div",{ref:c,role:"dialog","aria-modal":"true","aria-label":n??"Modal",className:[On.modal,l??""].filter(Boolean).join(" "),style:{width:o,...a},onClick:u=>u.stopPropagation(),children:[d.jsxs("div",{className:On.header,children:[d.jsx("div",{className:On.headerTitle,children:n&&d.jsx("span",{className:On.title,children:n})}),d.jsx(Lt,{"aria-label":"Close",onClick:e})]}),d.jsx("div",{className:On.body,children:r}),s&&d.jsx("div",{className:On.footer,children:s})]})}),document.body):null));Gf.displayName="Modal";const Kj="_triggerWrap_5kkmc_3",Gj="_scrim_5kkmc_15",Jj="_popup_5kkmc_24",Yj="_header_5kkmc_82",Qj="_title_5kkmc_89",Xj="_body_5kkmc_101",Zj="_footer_5kkmc_107",Rn={triggerWrap:Kj,scrim:Gj,popup:Jj,header:Yj,title:Qj,body:Xj,footer:Zj},md=10,Jf=x.forwardRef(({isOpen:t,onClose:e,trigger:n,title:r,children:s,footer:i,placement:o="bottom",align:l="right",width:a=360,className:c,style:u},h)=>{const p=x.useRef(null),[f,m]=x.useState(null),g=x.useCallback(()=>{if(!p.current)return null;const b=p.current.getBoundingClientRect(),y=b.left+b.width/2;let v=l==="right"?b.left:b.right-a;v=Math.max(8,Math.min(v,window.innerWidth-a-8));const _=y-v;return o==="bottom"?{top:b.bottom+md,left:v,arrowLeft:_}:{bottom:window.innerHeight-b.top+md,left:v,arrowLeft:_}},[o,l,a]);return x.useLayoutEffect(()=>{if(!t){m(null);return}m(g())},[t,g]),d.jsxs(d.Fragment,{children:[d.jsx("span",{ref:p,className:Rn.triggerWrap,children:n}),t&&f&&Ut.createPortal(d.jsxs(d.Fragment,{children:[d.jsx("div",{className:Rn.scrim,onClick:e,"aria-hidden":"true"}),d.jsxs("div",{ref:h,role:"dialog","aria-modal":"true","aria-label":r??"Popup",className:[Rn.popup,c??""].filter(Boolean).join(" "),"data-placement":o,style:{width:a,top:f.top,bottom:f.bottom,left:f.left,"--popup-arrow-left":`${f.arrowLeft}px`,...u},children:[r&&d.jsxs("div",{className:Rn.header,children:[d.jsx("span",{className:Rn.title,children:r}),d.jsx(Lt,{"aria-label":"Close popup",onClick:e})]}),d.jsx("div",{className:Rn.body,children:s}),i&&d.jsx("div",{className:Rn.footer,children:i})]})]}),document.body)]})});Jf.displayName="Popup";const eI="_panel_qk0fv_1",tI="_open_qk0fv_19",nI="_compact_qk0fv_23",rI="_header_qk0fv_29",sI="_titleBar_qk0fv_36",iI="_titleBarNoTitle_qk0fv_43",oI="_titleGroup_qk0fv_48",lI="_title_qk0fv_36",aI="_subtitle_qk0fv_63",cI="_actions_qk0fv_72",dI="_headerContent_qk0fv_79",uI="_body_qk0fv_85",St={panel:eI,open:tI,compact:nI,header:rI,titleBar:sI,titleBarNoTitle:iI,titleGroup:oI,title:lI,subtitle:aI,actions:cI,headerContent:dI,body:uI},Yf=x.forwardRef(({isOpen:t,onClose:e,title:n,subtitle:r,onSave:s,headerContent:i,width:o=470,children:l,className:a,style:c},u)=>{const h=o<400,p=[St.panel,t?St.open:"",h?St.compact:"",a??""].filter(Boolean).join(" "),f=d.jsxs("div",{className:St.actions,children:[s&&d.jsx(We,{variant:"primary",size:"sm",onClick:s,children:"Save"}),d.jsx(Lt,{"aria-label":"Close panel",onClick:e})]});return d.jsxs("div",{ref:u,role:"dialog","aria-modal":"false","aria-label":n??"Side panel",className:p,style:{width:o,...c},children:[d.jsxs("div",{className:St.header,children:[n?d.jsxs("div",{className:St.titleBar,children:[d.jsxs("div",{className:St.titleGroup,children:[d.jsx("span",{className:St.title,children:n}),r&&d.jsx("div",{className:St.subtitle,children:r})]}),f]}):d.jsx("div",{className:St.titleBarNoTitle,children:f}),i&&d.jsx("div",{className:St.headerContent,children:i})]}),d.jsx("div",{className:St.body,children:l})]})});Yf.displayName="SidePanel";const hI="_layout_1qi6d_1",fI={layout:hI},Qf=x.forwardRef(({open:t,panelWidth:e=470,children:n,className:r,style:s},i)=>{const o=[fI.layout,r??""].filter(Boolean).join(" ");return d.jsx("div",{ref:i,className:o,style:{paddingRight:t?e:0,...s},children:n})});Qf.displayName="SidePanelLayout";const pI="_nav_1w7cn_6",mI="_leftSection_1w7cn_21",gI="_applicantWrap_1w7cn_30",bI="_applicantTrigger_1w7cn_35",yI="_applicantIcon_1w7cn_64",xI="_applicantLabel_1w7cn_72",vI="_applicantChevron_1w7cn_80",_I="_applicantMenu_1w7cn_88",kI="_applicantOption_1w7cn_101",wI="_applicantOptionSelected_1w7cn_115",CI="_applicantDivider_1w7cn_129",SI="_applicantAddBtn_1w7cn_135",NI="_sortWrap_1w7cn_163",AI="_sortBtn_1w7cn_168",TI="_sortBtnIcon_1w7cn_191",EI="_sortBtnChevron_1w7cn_198",MI="_sortMenu_1w7cn_204",jI="_sortMenuItem_1w7cn_217",II="_divider_1w7cn_250",DI="_tabsSection_1w7cn_259",OI="_ausButtons_1w7cn_275",RI="_spacer_1w7cn_284",LI="_tab_1w7cn_259",BI="_tabDisabled_1w7cn_309",$I="_tabActive_1w7cn_309",ke={nav:pI,leftSection:mI,applicantWrap:gI,applicantTrigger:bI,applicantIcon:yI,applicantLabel:xI,applicantChevron:vI,applicantMenu:_I,applicantOption:kI,applicantOptionSelected:wI,applicantDivider:CI,applicantAddBtn:SI,sortWrap:NI,sortBtn:AI,sortBtnIcon:TI,sortBtnChevron:EI,sortMenu:MI,sortMenuItem:jI,divider:II,tabsSection:DI,ausButtons:OI,spacer:RI,tab:LI,tabDisabled:BI,tabActive:$I},ga=()=>d.jsx("i",{className:"pi pi-arrow-right","aria-hidden":"true"}),ba=()=>d.jsx("i",{className:"pi pi-replay","aria-hidden":"true"}),PI=()=>d.jsx("i",{className:"pi pi-user","aria-hidden":"true"}),zI=()=>d.jsx("i",{className:"pi pi-plus-circle","aria-hidden":"true"}),FI=()=>d.jsx("i",{className:"pi pi-user-plus","aria-hidden":"true"}),kr=()=>d.jsx("svg",{width:"10",height:"6",viewBox:"0 0 10 6",fill:"none","aria-hidden":"true",children:d.jsx("path",{d:"M1 1l4 4 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function ya({applicants:t,selectedApplicantId:e,onApplicantChange:n,onAddApplicant:r,height:s=35}){const[i,o]=x.useState(!1),l=x.useRef(null);x.useEffect(()=>{if(!i)return;function c(u){var h;(h=l.current)!=null&&h.contains(u.target)||o(!1)}return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[i]),x.useEffect(()=>{if(!i)return;function c(u){u.key==="Escape"&&o(!1)}return document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)},[i]);const a=t.find(c=>c.id===e);return d.jsxs("div",{ref:l,className:ke.applicantWrap,children:[d.jsxs("button",{type:"button",className:ke.applicantTrigger,style:s!==35?{height:s}:void 0,onClick:()=>o(c=>!c),"aria-haspopup":"listbox","aria-expanded":i,children:[d.jsx("span",{className:ke.applicantIcon,children:d.jsx(PI,{})}),d.jsx("span",{className:ke.applicantLabel,children:(a==null?void 0:a.label)??""}),d.jsx("span",{className:ke.applicantChevron,children:d.jsx(kr,{})})]}),i&&d.jsxs("div",{role:"listbox",className:ke.applicantMenu,children:[t.map(c=>d.jsx("div",{role:"option","aria-selected":c.id===e,className:[ke.applicantOption,c.id===e?ke.applicantOptionSelected:""].filter(Boolean).join(" "),tabIndex:0,onClick:()=>{n(c.id),o(!1)},onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),n(c.id),o(!1))},children:c.label},c.id)),r&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:ke.applicantDivider}),d.jsxs("button",{type:"button",className:ke.applicantAddBtn,onClick:()=>{r(),o(!1)},children:[d.jsx(zI,{}),"New Applicant"]})]})]})]})}function xa({sortItems:t,onSortSelect:e,height:n=35,width:r=47}){const[s,i]=x.useState(!1),o=x.useRef(null);x.useEffect(()=>{if(!s)return;function a(c){var u;(u=o.current)!=null&&u.contains(c.target)||i(!1)}return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[s]),x.useEffect(()=>{if(!s)return;function a(c){c.key==="Escape"&&i(!1)}return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[s]);const l=n!==35||r!==47?{height:n,width:r}:void 0;return d.jsxs("div",{ref:o,className:ke.sortWrap,children:[d.jsxs("button",{type:"button",className:ke.sortBtn,style:l,onClick:()=>i(a=>!a),"aria-haspopup":"menu","aria-expanded":s,"aria-label":"Sort applicants",children:[d.jsx("span",{className:ke.sortBtnIcon,children:d.jsx(FI,{})}),d.jsx("span",{className:ke.sortBtnChevron,children:d.jsx(kr,{})})]}),s&&d.jsx("div",{role:"menu",className:ke.sortMenu,children:t.map(a=>d.jsx("button",{type:"button",role:"menuitem",disabled:a.disabled,className:ke.sortMenuItem,onClick:()=>{e==null||e(a.value),i(!1)},children:a.label},a.value))})]})}const va=x.forwardRef(function(e,n){const{applicants:r,selectedApplicantId:s,onApplicantChange:i,onAddApplicant:o,sortItems:l,onSortSelect:a,tabs:c,activeTabId:u,onTabChange:h,onNextValidation:p,nextValidationBadge:f,onBackToAUS:m,className:g,style:b}=e;return d.jsxs("div",{ref:n,className:[ke.nav,g??""].filter(Boolean).join(" "),style:b,children:[d.jsxs("div",{className:ke.leftSection,children:[d.jsx(ya,{applicants:r,selectedApplicantId:s,onApplicantChange:i,onAddApplicant:o}),l&&l.length>0&&d.jsx(xa,{sortItems:l,onSortSelect:a})]}),d.jsx("div",{className:ke.divider,"aria-hidden":"true"}),d.jsxs("div",{className:ke.tabsSection,role:"tablist",children:[(p||m)&&d.jsxs("div",{className:ke.ausButtons,children:[p&&d.jsx(We,{variant:"danger",size:"sm",leadingIcon:d.jsx(ga,{}),badge:f,onClick:p,children:"Next Validation"}),m&&d.jsx(We,{variant:"secondary",size:"sm",leadingIcon:d.jsx(ba,{}),onClick:m,children:"Back to AUS"})]}),c.map(y=>d.jsx("button",{type:"button",role:"tab",className:[ke.tab,y.id===u?ke.tabActive:"",y.disabled?ke.tabDisabled:""].filter(Boolean).join(" "),"aria-selected":y.id===u,"aria-disabled":y.disabled,disabled:y.disabled,onClick:()=>{y.disabled||h(y.id)},children:y.label},y.id)),d.jsx("div",{className:ke.spacer,"aria-hidden":"true"})]})]})});va.displayName="URLATabsNav";const HI="_nav_9yblg_5",WI="_row1_9yblg_19",VI="_borrowerBlock_9yblg_27",qI="_borrowerName_9yblg_34",UI="_loanDetailsBtn_9yblg_41",KI="_divider_9yblg_68",GI="_ausButtons_9yblg_76",JI="_tabsSection_9yblg_85",YI="_tab_9yblg_85",QI="_tabDisabled_9yblg_116",XI="_tabActive_9yblg_116",ZI="_spacer_9yblg_136",eD="_stripBadge_9yblg_142",at={nav:HI,row1:WI,borrowerBlock:VI,borrowerName:qI,loanDetailsBtn:UI,divider:KI,ausButtons:GI,tabsSection:JI,tab:YI,tabDisabled:QI,tabActive:XI,spacer:ZI,stripBadge:eD},Xf=x.forwardRef(function(e,n){const{borrowerName:r,onLoanDetailsClick:s,applicants:i,selectedApplicantId:o,onApplicantChange:l,onAddApplicant:a,sortItems:c,onSortSelect:u,onNextValidation:h,nextValidationBadge:p,onBackToAUS:f,tabs:m,activeTabId:g,onTabChange:b,tabStripBadge:y,className:v,style:_}=e;return d.jsxs("div",{ref:n,className:[at.nav,v].filter(Boolean).join(" "),style:_,children:[d.jsxs("div",{className:at.row1,children:[d.jsxs("div",{className:at.borrowerBlock,children:[d.jsx("span",{className:at.borrowerName,children:r}),d.jsxs("button",{type:"button",className:at.loanDetailsBtn,onClick:s,children:["Loan Details",d.jsx("i",{className:"pi pi-info-circle","aria-hidden":"true"})]})]}),d.jsx("div",{className:at.divider,"aria-hidden":"true"}),d.jsx(ya,{applicants:i,selectedApplicantId:o,onApplicantChange:l,onAddApplicant:a,height:35}),c&&c.length>0&&d.jsx(xa,{sortItems:c,onSortSelect:u,height:35}),d.jsx("div",{className:at.divider,"aria-hidden":"true"}),(h||f)&&d.jsxs("div",{className:at.ausButtons,children:[h&&d.jsx(We,{variant:"danger",size:"sm",leadingIcon:d.jsx(ga,{}),badge:p,onClick:h,children:"Next Validation"}),f&&d.jsx(We,{variant:"secondary",size:"sm",leadingIcon:d.jsx(ba,{}),onClick:f,children:"Back to AUS"})]})]}),d.jsxs("div",{className:at.tabsSection,role:"tablist",children:[m.map(w=>d.jsx("button",{type:"button",role:"tab",className:[at.tab,w.id===g?at.tabActive:"",w.disabled?at.tabDisabled:""].filter(Boolean).join(" "),"aria-selected":w.id===g,"aria-disabled":w.disabled,disabled:w.disabled,onClick:()=>{w.disabled||b(w.id)},children:w.label},w.id)),d.jsx("div",{className:at.spacer,"aria-hidden":"true"}),y!=null&&y>0&&d.jsx("span",{className:at.stripBadge,"aria-label":`${y} items`,children:y})]})]})});Xf.displayName="URLATabsNavTablet";const tD="_container_14o10_5",nD="_row1_14o10_17",rD="_borrowerBlock_14o10_27",sD="_borrowerName_14o10_35",iD="_loanDetailsBtn_14o10_44",oD="_rightControls_14o10_72",lD="_sectionWrap_14o10_82",aD="_sectionTrigger_14o10_87",cD="_sectionLabel_14o10_110",dD="_sectionChevron_14o10_118",uD="_sortPill_14o10_128",hD="_actionsWrap_14o10_155",fD="_actionsBtn_14o10_160",pD="_saveBtn_14o10_190",mD="_row2_14o10_217",gD="_ausButtons_14o10_226",bD="_tabDropdownWrap_14o10_236",yD="_tabDropdownTrigger_14o10_242",xD="_tabDropdownLabel_14o10_265",vD="_tabDropdownChevron_14o10_273",_D="_tabDropdownMenu_14o10_280",kD="_dropdownMenu_14o10_295",wD="_dropdownOption_14o10_308",CD="_dropdownOptionSelected_14o10_327",SD="_dropdownOptionDisabled_14o10_327",ge={container:tD,row1:nD,borrowerBlock:rD,borrowerName:sD,loanDetailsBtn:iD,rightControls:oD,sectionWrap:lD,sectionTrigger:aD,sectionLabel:cD,sectionChevron:dD,sortPill:uD,actionsWrap:hD,actionsBtn:fD,saveBtn:pD,row2:mD,ausButtons:gD,tabDropdownWrap:bD,tabDropdownTrigger:yD,tabDropdownLabel:xD,tabDropdownChevron:vD,tabDropdownMenu:_D,dropdownMenu:kD,dropdownOption:wD,dropdownOptionSelected:CD,dropdownOptionDisabled:SD};function ND({label:t,items:e,onSelect:n}){const[r,s]=x.useState(!1),i=x.useRef(null);return x.useEffect(()=>{if(!r)return;function o(l){var a;(a=i.current)!=null&&a.contains(l.target)||s(!1)}return document.addEventListener("mousedown",o),()=>document.removeEventListener("mousedown",o)},[r]),x.useEffect(()=>{if(!r)return;function o(l){l.key==="Escape"&&s(!1)}return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[r]),d.jsxs("div",{ref:i,className:ge.sectionWrap,children:[d.jsxs("button",{type:"button",className:ge.sectionTrigger,onClick:()=>s(o=>!o),"aria-haspopup":"listbox","aria-expanded":r,children:[d.jsx("span",{className:ge.sectionLabel,children:t}),d.jsx("span",{className:ge.sectionChevron,children:d.jsx(kr,{})})]}),r&&e&&e.length>0&&d.jsx("div",{role:"listbox",className:ge.dropdownMenu,children:e.map(o=>d.jsx("div",{role:"option","aria-selected":o.label===t,className:[ge.dropdownOption,o.label===t?ge.dropdownOptionSelected:""].filter(Boolean).join(" "),tabIndex:0,onClick:()=>{n==null||n(o.value),s(!1)},onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),n==null||n(o.value),s(!1))},children:o.label},o.value))})]})}function AD({items:t,onSelect:e}){const[n,r]=x.useState(!1),s=x.useRef(null);return x.useEffect(()=>{if(!n)return;function i(o){var l;(l=s.current)!=null&&l.contains(o.target)||r(!1)}return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[n]),x.useEffect(()=>{if(!n)return;function i(o){o.key==="Escape"&&r(!1)}return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[n]),d.jsxs("div",{ref:s,className:ge.actionsWrap,children:[d.jsxs("button",{type:"button",className:ge.actionsBtn,onClick:()=>r(i=>!i),"aria-haspopup":"menu","aria-expanded":n,children:["Actions",d.jsx(kr,{})]}),n&&d.jsx("div",{role:"menu",className:ge.dropdownMenu,children:t.map(i=>d.jsx("button",{type:"button",role:"menuitem",disabled:i.disabled,className:ge.dropdownOption,onClick:()=>{e==null||e(i.value),r(!1)},children:i.label},i.value))})]})}function TD({tabs:t,activeTabId:e,onTabChange:n}){const[r,s]=x.useState(!1),i=x.useRef(null);x.useEffect(()=>{if(!r)return;function l(a){var c;(c=i.current)!=null&&c.contains(a.target)||s(!1)}return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[r]),x.useEffect(()=>{if(!r)return;function l(a){a.key==="Escape"&&s(!1)}return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[r]);const o=t.find(l=>l.id===e);return d.jsxs("div",{ref:i,className:ge.tabDropdownWrap,children:[d.jsxs("button",{type:"button",className:ge.tabDropdownTrigger,onClick:()=>s(l=>!l),"aria-haspopup":"listbox","aria-expanded":r,"aria-label":"Select tab",children:[d.jsx("span",{className:ge.tabDropdownLabel,children:(o==null?void 0:o.label)??""}),d.jsx("span",{className:ge.tabDropdownChevron,children:d.jsx(kr,{})})]}),r&&d.jsx("div",{role:"listbox",className:ge.tabDropdownMenu,children:t.map(l=>d.jsx("div",{role:"option","aria-selected":l.id===e,"aria-disabled":l.disabled,className:[ge.dropdownOption,l.id===e?ge.dropdownOptionSelected:"",l.disabled?ge.dropdownOptionDisabled:""].filter(Boolean).join(" "),tabIndex:l.disabled?-1:0,onClick:()=>{l.disabled||(n(l.id),s(!1))},onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&!l.disabled&&(a.preventDefault(),n(l.id),s(!1))},children:l.label},l.id))})]})}const _a=x.forwardRef(function(e,n){const{borrowerName:r,onLoanDetailsClick:s,sectionLabel:i,sectionItems:o,onSectionSelect:l,onSectionSort:a,actionItems:c,onActionSelect:u,onSave:h,applicants:p,selectedApplicantId:f,onApplicantChange:m,onAddApplicant:g,sortItems:b,onSortSelect:y,onNextValidation:v,nextValidationBadge:_,onBackToAUS:w,tabs:k,activeTabId:C,onTabChange:S,className:O,style:B}=e;return d.jsxs("div",{ref:n,className:[ge.container,O].filter(Boolean).join(" "),style:B,children:[d.jsxs("div",{className:ge.row1,children:[d.jsxs("div",{className:ge.borrowerBlock,children:[d.jsx("span",{className:ge.borrowerName,children:r}),d.jsxs("button",{type:"button",className:ge.loanDetailsBtn,onClick:s,children:["Loan Details",d.jsx("i",{className:"pi pi-info-circle","aria-hidden":"true"})]})]}),d.jsxs("div",{className:ge.rightControls,children:[d.jsx(ND,{label:i,items:o,onSelect:l}),a&&d.jsx("button",{type:"button",className:ge.sortPill,onClick:a,"aria-label":"Sort sections",children:d.jsx(kr,{})}),c&&c.length>0&&d.jsx(AD,{items:c,onSelect:u}),h&&d.jsx("button",{type:"button",className:ge.saveBtn,onClick:h,"aria-label":"Save",children:d.jsx("i",{className:"pi pi-save","aria-hidden":"true"})})]})]}),d.jsxs("div",{className:ge.row2,children:[(v||w)&&d.jsxs("div",{className:ge.ausButtons,children:[v&&d.jsx(We,{variant:"danger",size:"sm",leadingIcon:d.jsx(ga,{}),badge:_,onClick:v,children:"Next Validation"}),w&&d.jsx(We,{variant:"secondary",size:"sm",leadingIcon:d.jsx(ba,{}),onClick:w,children:"Back to AUS"})]}),d.jsx(ya,{applicants:p,selectedApplicantId:f,onApplicantChange:m,onAddApplicant:g,height:44}),b&&b.length>0&&d.jsx(xa,{sortItems:b,onSortSelect:y,height:44,width:62}),d.jsx(TD,{tabs:k,activeTabId:C,onTabChange:S})]})]})});_a.displayName="URLATabsNavMobile";const ED="_bar_n62yy_1",MD="_leftGroup_n62yy_15",jD="_brand_n62yy_22",ID="_navGroup_n62yy_28",DD="_logo_n62yy_34",OD="_version_n62yy_40",RD="_navWrap_n62yy_48",LD="_navItem_n62yy_53",BD="_navItemOpen_n62yy_76",$D="_navItemPrimary_n62yy_80",PD="_navChevron_n62yy_91",zD="_navChevronOpen_n62yy_97",FD="_dropdownPanel_n62yy_102",HD="_dropdownItem_n62yy_116",WD="_dropdownDivider_n62yy_149",VD="_searchWrap_n62yy_156",qD="_search_n62yy_156",UD="_rightGroup_n62yy_172",KD="_profileArea_n62yy_180",GD="_profilePill_n62yy_186",JD="_roleLabel_n62yy_193",YD="_avatarWrap_n62yy_200",QD="_avatarBtn_n62yy_205",XD="_profilePanel_n62yy_232",we={bar:ED,leftGroup:MD,brand:jD,navGroup:ID,logo:DD,version:OD,navWrap:RD,navItem:LD,navItemOpen:BD,navItemPrimary:$D,navChevron:PD,navChevronOpen:zD,dropdownPanel:FD,dropdownItem:HD,dropdownDivider:WD,searchWrap:VD,search:qD,rightGroup:UD,profileArea:KD,profilePill:GD,roleLabel:JD,avatarWrap:YD,avatarBtn:QD,profilePanel:XD},Zf="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAAcCAYAAAD2izi6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAOdEVYdFNvZnR3YXJlAEZpZ21hnrGWYwAADIZJREFUeAHtWglwFFUafn1MT889k8yRTCZ3SEgIpxA3gJEzIKAU7KIuCmupoFW6sOyK7oIonmgpW4KWeC2lILfLoYRgQIlIjLDkgpBwBEIg12Qymfvoe19PJjAJJAFX2Sr0r+qZ6Xf8773v/XeCgN4Jgw8Hxo3DSan0LiI1fT5uThoFWEbH84JPcDvq2Obmb9nL53dTpaV1cCwanseDXxEhvbQh5jvuIIOzHy4ksgfn0TUnjzAnTu7mvLY6wGIIHqVKwuKSJ2GZWXdhKrWaczvcbEXFCue7b68FXcD/SgkXPzTPv7LUuPeQQzZ3fk5/E5T507P1az6qMvxri2D8dLtPPeW+NNB5CWjEMKLHNAm4TShSAkOSo/9wwwG6tXWv+8Vn14iN2nHjtLRcNRZPSB7J80CPSXAv29h8grt0piRYUdHQNVnz1KKJ0pyxBwXIkq4q+4Prn2/8G3SCGFLpIbkT2gQA1FKpDD9eXCACKIDbgJCIbyH6vfWbqMKvVnkLdlVrH3liNj4yZx2iUBoFrxsIwSCUTyigHMSDkABUoQSCIDjp4z++6P7g3bUhLvn5iqiZ91/EZAo9daJ8rvudt7aCMFDZOXlWaDuNhFRGV5YUScFtQl0AourHn5jKt7RdgsrWJp85t5Z3OaIEv49D9QZMQICba2mp4i7V1yNSmQS1JA7EDYYhsB8TaAqgplgmuHljtrzxfBM7b8EZiKwZT0pptt4/w9K10O0KYMjmgbQ0iRBkzqNxZi05bqqVqaul8Lh4wDk6ivx7ti4I7N3bdL3Jqj/Oz5VOmLKNt7bGS6fPOMMhKIfQNCZwwm4I3izQaesYcBtTp6E3GFDa3sHK8ib+GAIvMZmgC3akOlb+fRoErxX04q09WzYcbV/wUALnsC9C5EqA4DjGuhyL7H97UgRPvJzbGjyRxENioLQ0oN2yp449f5aSJKVgbReqcbBzpwiuCFxvIYkQflDnqyveVT+6oA4otYh77Vv7QOfFsODmCY3gC8LrCz36+4szkfDD99EPQN9OrD8eV/YhAsjpX3h1O3/pAiNJTJL6318dDQEVJ98oACIjxL3+48KIxW82mO4Ke7j41MwHlVr9UoIkM6AtJVAU5RiaavZ5nJvra/GXASgT+lgjZDL0ZnO6NtryhlypzUMQXhkajwJXwOs95rN1LGtqOlsVPvv1zhi6RKPRaIiypL4PbfZ4BMEUnV2CM+BxFbVdPvdnp9PpEvkiIDdXZnl6iZ9paeZ5u+N126qXVoBfgPpwIqHbtqRkpsYkplZRAb+MYxkebg29IioCDI5QlCdlCtTpcS48X/7Dx+DagD0EyODc8f/BcWIk5BMCGtJVHkDgCVKBshx9/GTpoVHgWhBDEp81fMyTMrVmXcDnuYYHJF6h0qL21sszLtRW7kN1CQmPCHarII0xoGHwMHBrCU0dOGK4KSH5rN/jxDmWFUi5AgU8X8Uw1G6Wpo9ISVkQSiLq93mCKlL+UcaI3LdAJ3hdGIeAGJ431cOz3HAIHiuVkQghldoYOrifoYL7JQTRKCHlKBX0sTzLDhuRN90DOsHDI/aCmBMyxpBK5Tq/101jGI5IpAoHQ9H7GJreL5XJ3AiKoT6Pg44yxe01m1PicfngrLkI5UPYJvfhMJNbmYaJlyXoYmKO+z1uGpdICCilBYjPNqumrKybA0rLGvGwWm/cGPR5aIVC84w5LXNLc11tJei0ZVDyJnxHB3ykABlIVWqu5XT9gNbW0xcjeZiTkzNi4geeDPo9SNDvlg/KyTt46tjhSRFDeIMleWcg4OVwiHjA73297sSh5ZE8MkfkbsAkxDyf182pTabPUImCTCWUUsBWVmwGt5649GGj1vu9HqiyAGdZ9GD1seIZZWVlPQ08WldTvqm9pWmyRCongn4vazTFfQ3C9ldjHJAiwfE8UcNkCiVeUVwog+BdBt2jB6S5vv58+eFCmVSmEC+Ol5KKiTExMYaucSaTyYjhwIgABMNQtKHuxDERvEiNxGrLS+djEtIFJ2AQ5BwUJhcqCQGn0Ewl+D+QQh31oPhNylVozfFvJoebexp3ESjh0rmTBzmGKoEGEUdRHPoKs15s18dqn6MCQR7DUdzabHsYhB0S6O5phTBfwd5mm49B/aSDfoHUGpd0jWMRTRLHMQBaC+DosH0RnhepkaHffpfjAIpiok0kcRxhoUSSAPM7aCCiPWcOADt28OAW5KohAAQk5FCgWtHZOXfDS0QUvY1HEAGaL04tGnWWZWBhSDYWNu8mJbIJAhBQXCIHjZ7Tu/vZu0A5m3bhRiOgAj5EodLkw7ZlYodESimEsG9HUaGjNwau9tY9Co0W8AJC4RKMZwielglywgj7OBPmutMKwDFwc9QVr/WM2/okn49VR7CA9o8f2t+cLo/IcyxQKJTx4m+oRjrouQEiCAywWv397EGwwjHmAbxoYyXQZhquMpcIV6NEpDdnira1XPociA8kHOOC7UiAVmtS4+9uAeBrg0Y7gBuTUdNeciYAbjwWRB/4a3J2bLxG+c6SyhLQe4zVjWC4QXWdFaqDF6rVaUQAJLgRQlASEZCwlHTKDd+5bn8ZkAgRJqIVfr9ZTesWf+J8u+17LEaXbBqe+NhpKMrVH27fdM+O5fsLS16bAm4s8g8Fr7MXpR5FMV4am37n2uemH10MbqCwarc32hKR7NAhpHI5W/l90SjwE4hnaVhWQ/VQLJHoxMQ0e0PD2T7WRmISEjIE4ecpnKOu2rq1ymg5IpOjxow5ecmwDW/9rmL573ctEet54ip4bxsJ9zFbLkw6F/RzUmsDXRyTJFu0tT7fnj/PFA26F1WvR3Qw4K+BIsALDKONGzh0Rh9zQvvQ6/Uqi8Ui02qTtCDsIR1226cYtOYUFeTjYgdsA53gXU8FQ97XaE7bSFOBnwVBtGHbt+WkAnMyVhudvnD0IdjGVLy3r9J1rmnz4oplYsrTpYrdQgL4CFMey1JvOJ9vV2vxtPIi29Cnxx4Zf+oH9xOOVn/UyvW/s86ZMwjvb31nW/M8kpRhDPQKJkPMV7GJAzJ6WY8dNnpyTULWKLcxZbDfkpkq1hpFoNDm+rMfwgxDtI+8ALjBWSPHrAPdA+0uHlzWiDEfwAsbLtoA8DOQeEDUWnRshmVi1hGkPZgwbdOfXtn30GcrDj67fU/bfUOqV7U8L9R/V/tV2faalTTlq6d8LBZvUWZOe8y8LGt01NSWs866NStPJRRttIbsTsYQch4gMFC4vXHpjh2n+qvGCM0NdeW6GPNOGHfNgvEdHZOQWqPR6Qtcdvubfre1CSWjYeYkn2Awxb9O+b1SnhJY6DnZ6tJvpoIIM+G0Ns5SRRt2QZFmUIx4csjoyTM6Wpr+EaRdxyhoaTVaZU60MX41vCejwHN10HlchOnhJPA/UlfVQZj9xeICQAWnaPQKrKOpefGeR7eKVWbxbxn09GW5U4blW1aZEqSDjFE47m51uBtO2I6cLGpZ/uUn9Se6xq0vzyulKO536mji9EPphzJBhA3tIxcO2dDsO8cXwExkGgSAhZIENVIifsACOA84hoGZHcfC+AyTKlWesm/36kD3SlFonew7xi4iFKo1MIflkU4mMCKWhEaKXhqmiawCqgvvaiZoiaYatqVD/9NQU1aSJDKJSUobZzQnHoKxEoDFixfqa6teATcA4JVDLCx97oz3UluSSiclOJ+3+JNZn08MA9BbeBLa+L0LUxIWvpxU1XAmoI1PV3hnxh5UgR7F1BF33eOGQ+UEKcd+PLAL7cEv5LUtSQPvjjbHfQ5DfIsIWsjQQ00TgYRDAh5Hy5t11eUvgesXakN7MVhSBsTGJ30Js4SBEDAReCAGvfAdyoe/1nrBlmOznfKOnHBvK88wethvrSw5ECcyiE/Lzo9NSPlanOd1298+U3l0KbhBAEUKSdHjBY8fISVgDOXy0OY0DdF07vK2i/vqX3OcVJwui8hPB40bpBw0lBozYX78mzotMtTVzoDYeOTCvebDqeDaMIa4+r5SfK5XL7xSg1OpVNGkLjaTgA5TwHhXkPbXdjQ1NYKIshfo/TwhHjqdTiNTRWVDMTRzAmcLwmTVefGiE3SqfU8eWMT+kM49gr7KZt0WBD1BnL36ngeG5Cdu9bc5AecLCDqTFFHC/IDAWD/t9rNqHUoQuEAGnEHAMywwp8jA0ULrM6/Or1oNfrky/k0F6T9h/E+i65Xqr/yHwaSnhs0cMNLwlygTMRhHeR2GsKgE5QCOcrwEE9wuO3XqXJn7o8YfTJuLi4s50Ld0/Ea/0bX0XxB9nrPY0cBvAAAAAElFTkSuQmCC";function ms(...t){return t.filter(Boolean).join(" ")}function ZD(){return d.jsx("svg",{width:"10",height:"6",viewBox:"0 0 10 6",fill:"none","aria-hidden":"true",children:d.jsx("path",{d:"M1 1L5 5L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function ep({items:t,onSelect:e,className:n}){return d.jsx("div",{role:"menu",className:ms(we.dropdownPanel,n),children:t.map(r=>r.divider?d.jsx("div",{className:we.dropdownDivider},r.value):d.jsxs("button",{role:"menuitem",className:we.dropdownItem,disabled:r.disabled,onClick:()=>e(r.value),children:[r.icon,r.label]},r.value))})}function eO({id:t,label:e,items:n,onSelect:r,isPrimary:s}){const[i,o]=x.useState(!1),l=x.useRef(null);return x.useEffect(()=>{if(!i)return;function a(u){l.current&&!l.current.contains(u.target)&&o(!1)}function c(u){u.key==="Escape"&&o(!1)}return document.addEventListener("mousedown",a),document.addEventListener("keydown",c),()=>{document.removeEventListener("mousedown",a),document.removeEventListener("keydown",c)}},[i]),d.jsxs("div",{ref:l,className:we.navWrap,children:[d.jsxs("button",{className:ms(we.navItem,i&&we.navItemOpen,s&&we.navItemPrimary),onClick:()=>o(a=>!a),"aria-haspopup":"menu","aria-expanded":i,children:[s&&d.jsx("i",{className:"pi pi-plus-circle","aria-hidden":"true"}),e,n&&n.length>0&&d.jsx("span",{className:ms(we.navChevron,i&&we.navChevronOpen),children:d.jsx(ZD,{})})]}),i&&n&&n.length>0&&d.jsx(ep,{items:n,onSelect:a=>{r==null||r(a),o(!1)}})]})}function tO(t){const e=t.trim().split(/\s+/);return e.length===1?e[0].slice(0,2).toUpperCase():(e[0][0]+e[e.length-1][0]).toUpperCase()}function nO({profile:t}){const[e,n]=x.useState(!1),r=x.useRef(null),s=t.initials??tO(t.name);return x.useEffect(()=>{if(!e)return;function i(l){r.current&&!r.current.contains(l.target)&&n(!1)}function o(l){l.key==="Escape"&&n(!1)}return document.addEventListener("mousedown",i),document.addEventListener("keydown",o),()=>{document.removeEventListener("mousedown",i),document.removeEventListener("keydown",o)}},[e]),d.jsxs("div",{className:ms(we.profileArea,t.role&&we.profilePill),children:[t.role&&d.jsx("span",{className:we.roleLabel,children:t.role}),d.jsxs("div",{ref:r,className:we.avatarWrap,children:[d.jsx("button",{className:we.avatarBtn,onClick:()=>n(i=>!i),"aria-haspopup":"menu","aria-expanded":e,"aria-label":`${t.name} — open profile menu`,children:s}),e&&t.menuItems&&t.menuItems.length>0&&d.jsx(ep,{items:t.menuItems,className:we.profilePanel,onSelect:i=>{var o;(o=t.onMenuSelect)==null||o.call(t,i),n(!1)}})]})]})}const tp=x.forwardRef(function(e,n){const{version:r,navItems:s,onSearch:i,searchPlaceholder:o,profile:l,className:a,style:c}=e;return d.jsxs("div",{ref:n,className:ms(we.bar,a),style:c,children:[d.jsxs("div",{className:we.leftGroup,children:[d.jsxs("span",{className:we.brand,children:[d.jsx("img",{src:Zf,alt:"Clear",className:we.logo}),r&&d.jsx("span",{className:we.version,children:r})]}),d.jsx("div",{className:we.navGroup,children:s.map(u=>d.jsx(eO,{...u},u.id))})]}),d.jsx("div",{className:we.searchWrap,children:d.jsx(gs,{className:we.search,prefixIcon:d.jsx("i",{className:"pi pi-search","aria-hidden":"true"}),placeholder:o??"Search Leads and Loans",onChange:u=>i==null?void 0:i(u.target.value),"aria-label":"Search"})}),d.jsx("div",{className:we.rightGroup,children:d.jsx(nO,{profile:l})})]})}),rO="_bar_avirz_1",sO="_left_avirz_14",iO="_center_avirz_21",oO="_right_avirz_29",lO="_logo_avirz_37",aO="_logoClip_avirz_44",cO="_borrowerName_avirz_51",dO="_infoIcon_avirz_58",uO="_iconBtn_avirz_76",hO="_searchBtn_avirz_101",fO="_avatarWrap_avirz_106",pO="_avatarBtn_avirz_111",mO="_dropdownPanel_avirz_139",gO="_dropdownItem_avirz_154",bO="_dropdownDivider_avirz_187",Ze={bar:rO,left:sO,center:iO,right:oO,logo:lO,logoClip:aO,borrowerName:cO,infoIcon:dO,iconBtn:uO,searchBtn:hO,avatarWrap:fO,avatarBtn:pO,dropdownPanel:mO,dropdownItem:gO,dropdownDivider:bO},yO="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAcCAYAAACUJBTQAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAlmVYSWZNTQAqAAAACAAGARIAAwAAAAEAAQAAARoABQAAAAEAAABWARsABQAAAAEAAABeASgAAwAAAAEAAgAAATEAAgAAAAYAAABmh2kABAAAAAEAAABsAAAAAAAAAEgAAAABAAAASAAAAAFGaWdtYQAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGaADAAQAAAABAAAAHAAAAAD0nSgiAAAACXBIWXMAAAsTAAALEwEAmpwYAAABwGlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNi4wLjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyIKICAgICAgICAgICAgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIj4KICAgICAgICAgPHRpZmY6T3JpZW50YXRpb24+MTwvdGlmZjpPcmllbnRhdGlvbj4KICAgICAgICAgPHhtcDpDcmVhdG9yVG9vbD5GaWdtYTwveG1wOkNyZWF0b3JUb29sPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4Kc6r2JgAABhdJREFUSA2tVQlMVEcYnnfse8vusiywy8q1nEIVERrQiqClakBjLZWKpliJUUETLdJW28ajmmpjW6tVNLVaNY2tiEbrUZDEkyoVTYSVw4NyCcoNwr7Csvv2HZ15+Fogtajpn8ybmf//vv//5583Mxh4thDQxIP4eFJJ01OooJA00st/AuAcroIg9olMdw3X3HyFe1R7xl5cXAOx+FNXwnCX2HAFnCMd5hUVpbQlv1dAjQufyt6rKHKUV5zheztqAEdgpJuzP+EdMIMYM3YK4azV8kw3w5nNG3v2fJMNuQPJ/YtjWUWigcuGLWs98q52O6WmTZQNz+o1CbPH6XcfKDMcOiZ6/HiiT5v4VjDEokTllUkTmS9loN9/5CLb2prHbPp4NzLo4uN1rMo5jjQFRAsC0BMKspd73FzON1b9bjObG2Syy8rM6fTEuEsidMmWlcyz7PzyFLShQIJcLtSL7nsPH7UX/LqtN/90pW7x8mQyeuI+TK3xEHsZINpsAJBwoTwsOaUAuFoDRFHsYW/f3MR8vweVCYCEBLVb0vyHhJNaby8vTWV2bc9FfuUguHbZ8plCS3sjoEC7Kin1vmDpdhOtfTyuNxAQxfAtLWV8Y309RjspcB+/V0iDYTy0EyJrB7jR02HL+Wmc6nFtE7covQpG9yL9A5vb5r/pg2IPBAkOpp0nTfXHVE46ZfzMm46a+3bS25fmHjUU2G4Xpffn5TUh8HBxfjcthp6WeFxkLL6YkobecB6wLCHy4pmuj1bMhXgFbI6BIDExTrTO6KVbmFbD1tXYSb8Aij2XG2w5daoOgtBeod9ShG2wIC5qgm7DlvcVQSHZwMECR0tTZs+mT/dAPfqJONgkkLThxmNnRa72DzthCiDa6yppsHkz2jQetuHOEW+wSJurXZI+C2h0GJO9/Tw0SjoZJK1E/9nWE5ha/Tbh5aOwfrfTnSkutkAACvC8gvzIyQweS3wcwFIpQ0NScAIj+HuVW2GAJ9DyIgGQIznA8DGaA9LVZFosdrWJ9CgD3rgmayPUjXhiJeYLfEhV+NhUzN6HcU3Mtae8F13FiOFwhVoZRGlowN0x54yIfkkACQ+xM0FhAGMdd17Sx4g0nMQ4goJBCGs3C9EESElBeyL9dSOynxOAKwjBQQksEFWUB+TwRsIS/ZzcwTA5KbkfbAM4wds6sX4GuAT5vo4sBhfdaH1sqAYOpWt/CPrZE3zBhwERWd9GTn4KGcLFhc6O6wRgReOrfksRoHL/iaMTsuadhEN0JaCTO5Kg+4lPzgy6FTvPreir/NfQE4G4qOyS4Jb7NdkadxXmpMI9QlOmBkAt2fqbef07pz9A7wG6s4ZkJbEGPqg0yOY4Vjej2mbl6bYGtnCUv1Nmbn1CV8Iiozu0SUniDcevlCrVRI+jrYMNyZh8FZHMe8/fsVQ35aw2ryuDc+mSg/3geqOxmLg0THukNqFLqyODSy90RKyKK3rj7g1meXer1W3z4UltKSlhUoJoSbiLQXPdMN47neixuQQmh5LVv5Rdrrt4t7q/xXI5qzC9M2iCIQquqUofqLLpvNWayDjPqFW7w/fPWeH7A9NqbTq0sdyU83V9O/TFL9kQsIugSdPtws61+7aUFUGdlJ2UVfLJ1fnAbkt00auJJ03Nq88uyUWvHQUbO3tdTGJkgs82o4kO83AjSaa1m2ko7yiquNCy/tzB+nIZd7h0arHdzk/SulMPFoZcHQP10m0sl0B6XDKKP6nqbWz3d3alKb6vt/Dg3J+nQyDaFykR2A8XycmcjEBTxuf+ZQ1V/TrfEHVvkuclZwiUfCKCHASNpayX5S8rUipArN3yJ+sV7EI1VT86/vB8/RfdFeoHJSUlDgREEhYfpgmLsMdOS/P9ylWHRVg6HcDTF6ub43UtCJrRXsh7OSQI4kqBknfMWjA+wS/X2t4D+L5+0dVIYxo1NBKclWWsnNYVpyhSVPb32IDg4IBXoBO4VdC2Zmta2Q7o4+8VIIdIBq9kQPPP2RBmrIxMGh1tyHIzUuEkLrgSGIcr4DNO4rygIODL3mW/W13CHHh8w5hTWFiIbm9Uvv/9FpcT+8/+L2NoT1d8TFvQAAAAAElFTkSuQmCC";function xO(t){const e=t.trim().split(/\s+/);return e.length===1?e[0].slice(0,2).toUpperCase():(e[0][0]+e[e.length-1][0]).toUpperCase()}function vO({items:t,onSelect:e}){return d.jsx("div",{role:"menu",className:Ze.dropdownPanel,children:t.map(n=>n.divider?d.jsx("div",{className:Ze.dropdownDivider},n.value):d.jsxs("button",{role:"menuitem",className:Ze.dropdownItem,disabled:n.disabled,onClick:()=>e(n.value),children:[n.icon,n.label]},n.value))})}function _O({profile:t}){const[e,n]=x.useState(!1),r=x.useRef(null),s=t.initials??xO(t.name);return x.useEffect(()=>{if(!e)return;function i(l){r.current&&!r.current.contains(l.target)&&n(!1)}function o(l){l.key==="Escape"&&n(!1)}return document.addEventListener("mousedown",i),document.addEventListener("keydown",o),()=>{document.removeEventListener("mousedown",i),document.removeEventListener("keydown",o)}},[e]),d.jsxs("div",{ref:r,className:Ze.avatarWrap,children:[d.jsx("button",{className:Ze.avatarBtn,onClick:()=>n(i=>!i),"aria-haspopup":"menu","aria-expanded":e,"aria-label":`${t.name} — open profile menu`,children:s}),e&&t.menuItems&&t.menuItems.length>0&&d.jsx(vO,{items:t.menuItems,onSelect:i=>{var o;(o=t.onMenuSelect)==null||o.call(t,i),n(!1)}})]})}function np({borrower:t,onMenuOpen:e,onSearchOpen:n,profile:r,className:s,style:i}){const o=!!t;return d.jsxs("div",{className:[Ze.bar,s].filter(Boolean).join(" "),style:i,children:[d.jsxs("div",{className:Ze.left,children:[d.jsx("button",{className:Ze.iconBtn,onClick:e,"aria-label":"Open menu",children:d.jsx("i",{className:"pi pi-bars","aria-hidden":"true"})}),o&&d.jsx("img",{src:yO,alt:"Clear",className:Ze.logoClip})]}),d.jsx("div",{className:Ze.center,children:o?d.jsxs(d.Fragment,{children:[d.jsx("span",{className:Ze.borrowerName,children:t.name}),d.jsx("button",{className:Ze.infoIcon,onClick:t.onInfoClick,"aria-label":"Borrower info",children:d.jsx("i",{className:"pi pi-info-circle","aria-hidden":"true"})})]}):d.jsx("img",{src:Zf,alt:"Clear",className:Ze.logo})}),d.jsxs("div",{className:Ze.right,children:[d.jsx("button",{className:[Ze.iconBtn,Ze.searchBtn].join(" "),onClick:n,"aria-label":"Open search",children:d.jsx("i",{className:"pi pi-search","aria-hidden":"true"})}),d.jsx(_O,{profile:r})]})]})}const kO="_wrap_ojyp7_6",wO="_btn_ojyp7_13",CO="_btnMd_ojyp7_28",SO="_btnSm_ojyp7_33",NO="_btnLg_ojyp7_39",AO="_boltIcon_ojyp7_46",TO="_chevronIcon_ojyp7_47",EO="_btnBasic_ojyp7_66",MO="_btnFilled_ojyp7_82",jO="_menu_ojyp7_111",IO="_menuItem_ojyp7_124",DO="_menuItemDisabled_ojyp7_139",OO="_menuItemIcon_ojyp7_152",RO="_menuDivider_ojyp7_159",ct={wrap:kO,btn:wO,btnMd:CO,btnSm:SO,btnLg:NO,boltIcon:AO,chevronIcon:TO,btnBasic:EO,btnFilled:MO,menu:jO,menuItem:IO,menuItemDisabled:DO,menuItemIcon:OO,menuDivider:RO},eo=x.forwardRef(function({variant:e="basic",size:n="md",items:r,onSelect:s,disabled:i,"aria-label":o="Quick actions",className:l,style:a},c){const[u,h]=x.useState(!1),p=x.useRef(null);x.useEffect(()=>{if(!u)return;function g(b){var y;(y=p.current)!=null&&y.contains(b.target)||h(!1)}return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[u]),x.useEffect(()=>{if(!u)return;function g(b){b.key==="Escape"&&h(!1)}return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[u]);const f=g=>{h(!1),s(g)},m=[ct.btn,n==="sm"?ct.btnSm:n==="lg"?ct.btnLg:ct.btnMd,e==="filled"?ct.btnFilled:ct.btnBasic].filter(Boolean).join(" ");return d.jsxs("div",{ref:p,className:[ct.wrap,l??""].filter(Boolean).join(" "),style:a,children:[d.jsx(er,{content:o,placement:"top",children:d.jsxs("button",{ref:c,type:"button",className:m,disabled:i,"aria-label":o,"aria-haspopup":"menu","aria-expanded":u,onClick:()=>h(g=>!g),children:[d.jsx("span",{className:ct.boltIcon,"aria-hidden":"true",children:d.jsx("i",{className:"pi pi-bolt"})}),d.jsx("span",{className:ct.chevronIcon,"aria-hidden":"true",children:d.jsx("i",{className:"pi pi-chevron-down"})})]})}),u&&d.jsx("div",{role:"menu",className:ct.menu,children:r.map(g=>g.divider?d.jsx("div",{className:ct.menuDivider,role:"separator"},g.value):d.jsxs("div",{role:"menuitem",className:[ct.menuItem,g.disabled?ct.menuItemDisabled:""].filter(Boolean).join(" "),tabIndex:g.disabled?-1:0,"aria-disabled":g.disabled,onClick:()=>{g.disabled||f(g.value)},onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&!g.disabled&&(b.preventDefault(),f(g.value))},children:[g.icon&&d.jsx("span",{className:ct.menuItemIcon,"aria-hidden":"true",children:g.icon}),g.label]},g.value))})]})});eo.displayName="LightningButton";const LO="_nav_8y8kv_6",BO="_mainRow_8y8kv_18",$O="_menuToggle_8y8kv_29",PO="_tabsArea_8y8kv_56",zO="_actions_8y8kv_66",FO="_actionItem_8y8kv_75",HO="_divider_8y8kv_83",WO="_navBadgeDrop_8y8kv_94",VO="_navBadgeDropBtn_8y8kv_99",qO="_navBadgeDropLabel_8y8kv_128",UO="_navBadgeDropChevron_8y8kv_132",KO="_navBadgeDropBadge_8y8kv_139",GO="_navBadgeDropMenu_8y8kv_156",JO="_navBadgeDropItem_8y8kv_169",YO="_navBadgeDropItemDisabled_8y8kv_184",QO="_conditionBadge_8y8kv_199",XO="_conditionDismiss_8y8kv_213",ZO="_backBtn_8y8kv_234",eR="_breadcrumbs_8y8kv_259",tR="_breadcrumbItem_8y8kv_268",nR="_breadcrumbDot_8y8kv_281",rR="_status_green_8y8kv_288",sR="_status_yellow_8y8kv_289",iR="_status_red_8y8kv_290",oR="_status_gray_8y8kv_291",lR="_breadcrumbText_8y8kv_293",aR="_breadcrumbLabel_8y8kv_299",cR="_breadcrumbSublabel_8y8kv_309",dR="_expandBtn_8y8kv_319",uR="_toolbarRow_8y8kv_346",hR="_toolbarLeft_8y8kv_356",fR="_toolbarCenter_8y8kv_362",pR="_toolbarRight_8y8kv_369",de={nav:LO,mainRow:BO,menuToggle:$O,tabsArea:PO,actions:zO,actionItem:FO,divider:HO,navBadgeDrop:WO,navBadgeDropBtn:VO,navBadgeDropLabel:qO,navBadgeDropChevron:UO,navBadgeDropBadge:KO,navBadgeDropMenu:GO,navBadgeDropItem:JO,navBadgeDropItemDisabled:YO,conditionBadge:QO,conditionDismiss:XO,backBtn:ZO,breadcrumbs:eR,breadcrumbItem:tR,breadcrumbDot:nR,status_green:rR,status_yellow:sR,status_red:iR,status_gray:oR,breadcrumbText:lR,breadcrumbLabel:aR,breadcrumbSublabel:cR,expandBtn:dR,toolbarRow:uR,toolbarLeft:hR,toolbarCenter:fR,toolbarRight:pR},mR=()=>d.jsx("svg",{width:"18",height:"14",viewBox:"0 0 18 14",fill:"none","aria-hidden":"true",children:d.jsx("path",{d:"M0 1h18M0 7h18M0 13h18",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})}),gd=()=>d.jsx("i",{className:"pi pi-refresh","aria-hidden":"true"}),gR=()=>d.jsx("svg",{width:"7",height:"12",viewBox:"0 0 7 12",fill:"none","aria-hidden":"true",children:d.jsx("path",{d:"M1 1l5 5-5 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),bR=()=>d.jsx("svg",{width:"7",height:"12",viewBox:"0 0 7 12",fill:"none","aria-hidden":"true",children:d.jsx("path",{d:"M6 1L1 6l5 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),yR=()=>d.jsx("svg",{width:"10",height:"6",viewBox:"0 0 10 6",fill:"none","aria-hidden":"true",children:d.jsx("path",{d:"M1 1l4 4 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function xR({label:t,badge:e,items:n,onSelect:r}){const[s,i]=x.useState(!1),o=x.useRef(null);return x.useEffect(()=>{if(!s)return;function l(a){var c;(c=o.current)!=null&&c.contains(a.target)||i(!1)}return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[s]),x.useEffect(()=>{if(!s)return;function l(a){a.key==="Escape"&&i(!1)}return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[s]),d.jsxs("div",{ref:o,className:de.navBadgeDrop,children:[d.jsxs("button",{type:"button",className:de.navBadgeDropBtn,onClick:()=>i(l=>!l),"aria-haspopup":"menu","aria-expanded":s,children:[d.jsx("span",{className:de.navBadgeDropLabel,children:t}),d.jsx("span",{className:de.navBadgeDropChevron,children:d.jsx(yR,{})}),d.jsx("span",{className:de.navBadgeDropBadge,children:e})]}),s&&d.jsx("div",{role:"menu",className:de.navBadgeDropMenu,children:n.map(l=>d.jsxs("div",{role:"menuitem",className:[de.navBadgeDropItem,l.disabled?de.navBadgeDropItemDisabled:""].filter(Boolean).join(" "),tabIndex:l.disabled?-1:0,"aria-disabled":l.disabled,onClick:()=>{l.disabled||(r==null||r(l.value),i(!1))},onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&!l.disabled&&(a.preventDefault(),r==null||r(l.value),i(!1))},children:[l.icon&&d.jsx("span",{"aria-hidden":"true",children:l.icon}),l.label]},l.value))})]})}function vR(t){const e=!t.label;return t.lightning&&t.items?d.jsx(eo,{variant:t.lightningVariant??"filled",size:"sm",items:t.items,onSelect:t.onSelect??(()=>{}),"aria-label":t.ariaLabel??"Quick actions"},t.value):e&&t.items?d.jsx($i,{label:"",leadingIcon:t.icon,variant:"secondary",size:"sm",items:t.items,onSelect:t.onSelect,"aria-label":t.ariaLabel??t.value},t.value):e?d.jsx(ut,{icon:t.icon,variant:"secondary",size:"sm","aria-label":t.ariaLabel??t.value,onClick:t.onClick},t.value):t.items&&t.badge!=null?d.jsx(xR,{label:t.label??"",badge:t.badge,items:t.items,onSelect:t.onSelect},t.value):t.items?d.jsx($i,{label:t.label??"",leadingIcon:t.icon,variant:t.variant??"secondary",size:"sm",items:t.items,onSelect:t.onSelect},t.value):d.jsx(We,{variant:t.variant??"secondary",size:"sm",leadingIcon:t.icon,onClick:t.onClick,children:t.label},t.value)}const rp=x.forwardRef(function(e,n){const{tabs:r,activeTabId:s,onTabChange:i,onMenuToggle:o,secondaryActions:l=[],onRefresh:a,primaryLabel:c="Save Loan",onPrimary:u,primaryItems:h,onPrimarySelect:p,condition:f,toolbar:m,banner:g,collapsed:b=!1,collapsedSection:y,onCollapsedBack:v,onExpandTabs:_,collapsedQuickItems:w=[],onCollapsedQuickAction:k}=e,C=r.find(T=>T.id===s),S=T=>[de.breadcrumbDot,T?de[`status_${T}`]:""].filter(Boolean).join(" "),O=u&&(h!=null&&h.length?d.jsx(fa,{label:c,onAction:u,items:h,onSelect:p,variant:"primary",size:"sm"}):d.jsx(We,{variant:"primary",size:"sm",onClick:u,children:c})),B=d.jsxs("div",{className:de.actions,children:[f&&d.jsxs("div",{className:de.conditionBadge,children:[d.jsx("span",{className:de.conditionLabel,children:f.label}),f.onDismiss&&d.jsx("button",{className:de.conditionDismiss,onClick:f.onDismiss,"aria-label":"Dismiss condition",children:d.jsx("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"none","aria-hidden":"true",children:d.jsx("path",{d:"M1 1l7 7M8 1L1 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}),l.map(T=>d.jsxs("div",{className:de.actionItem,children:[T.dividerBefore&&d.jsx("span",{className:de.divider,"aria-hidden":"true"}),vR(T)]},T.value)),a&&d.jsx(ut,{variant:"secondary",size:"sm","aria-label":"Refresh",icon:d.jsx(gd,{}),onClick:a}),O]}),N=d.jsxs("div",{className:de.actions,children:[w.length>0&&d.jsx(eo,{variant:"filled",size:"sm",items:w,onSelect:k??(()=>{}),"aria-label":"Quick actions"}),a&&d.jsx(ut,{variant:"secondary",size:"sm","aria-label":"Refresh",icon:d.jsx(gd,{}),onClick:a}),O]});return d.jsxs("nav",{ref:n,className:[de.nav,b?de.collapsed:""].filter(Boolean).join(" "),children:[d.jsxs("div",{className:de.mainRow,children:[d.jsx("button",{className:de.menuToggle,onClick:o,"aria-label":"Toggle menu",children:d.jsx(mR,{})}),b?d.jsxs(d.Fragment,{children:[v&&d.jsx("button",{className:de.backBtn,onClick:v,"aria-label":"Back",children:d.jsx(bR,{})}),d.jsxs("div",{className:de.breadcrumbs,children:[y&&d.jsxs("div",{className:de.breadcrumbItem,children:[y.status&&d.jsx("span",{className:S(y.status)}),d.jsxs("div",{className:de.breadcrumbText,children:[d.jsx("span",{className:de.breadcrumbLabel,children:y.label}),y.subLabel&&d.jsx("span",{className:de.breadcrumbSublabel,children:y.subLabel})]})]}),C&&d.jsxs("div",{className:de.breadcrumbItem,children:[C.status.shape!=="none"&&d.jsx("span",{className:S(C.status.color)}),d.jsxs("div",{className:de.breadcrumbText,children:[d.jsxs("span",{className:de.breadcrumbLabel,children:[C.label,C.subLabel?` / ${C.subLabel}`:""]}),C.subtitle&&d.jsx("span",{className:de.breadcrumbSublabel,children:C.subtitle})]})]})]}),_&&d.jsx("button",{className:de.expandBtn,onClick:_,"aria-label":"Show all tabs",children:d.jsx(gR,{})}),N]}):d.jsxs(d.Fragment,{children:[d.jsx("div",{className:de.tabsArea,children:d.jsx(pa,{items:r,activeId:s,onChange:i})}),B]})]}),m&&!b&&d.jsxs("div",{className:de.toolbarRow,children:[m.left&&d.jsx("div",{className:de.toolbarLeft,children:m.left}),m.center&&d.jsx("div",{className:de.toolbarCenter,children:m.center}),m.right&&d.jsx("div",{className:de.toolbarRight,children:m.right})]}),g&&!b&&d.jsx(ma,{severity:g.severity??"warn",title:g.title,detail:g.detail,closable:g.closable??!0,onClose:g.onClose})]})}),_R="_wrapper_14b3i_8",kR="_wrapperScrollable_14b3i_18",wR="_scrollContainer_14b3i_22",CR="_table_14b3i_29",SR="_headerRow_14b3i_41",NR="_headerCell_14b3i_45",AR="_md_14b3i_58",TR="_sm_14b3i_59",ER="_headerCellSortable_14b3i_61",MR="_headerCellContent_14b3i_69",jR="_headerText_14b3i_76",IR="_sortIcon_14b3i_83",DR="_sortIconActive_14b3i_91",OR="_sortPriority_14b3i_95",RR="_filterBtnWrap_14b3i_104",LR="_filterBtn_14b3i_104",BR="_filterBtnActive_14b3i_130",$R="_expandCol_14b3i_138",PR="_selectCol_14b3i_139",zR="_editCol_14b3i_140",FR="_bodyRow_14b3i_149",HR="_bodyCell_14b3i_154",WR="_rowSelected_14b3i_158",VR="_rowStriped_14b3i_163",qR="_rowClickable_14b3i_167",UR="_expandCell_14b3i_189",KR="_selectCell_14b3i_190",GR="_editCell_14b3i_191",JR="_expandBtn_14b3i_197",YR="_groupRow_14b3i_219",QR="_groupCell_14b3i_223",XR="_groupToggle_14b3i_236",ZR="_groupLabel_14b3i_244",eL="_groupCount_14b3i_248",tL="_expansionRow_14b3i_256",nL="_expansionCell_14b3i_260",rL="_cellEditWrap_14b3i_272",sL="_cellInput_14b3i_284",iL="_rowEditBtns_14b3i_298",oL="_footerRow_14b3i_309",lL="_footerCell_14b3i_313",aL="_emptyCell_14b3i_325",cL="_loadingOverlay_14b3i_333",dL="_skeleton_14b3i_341",uL="_shimmer_14b3i_1",hL="_filterPopover_14b3i_360",fL="_filterBody_14b3i_382",pL="_filterRule_14b3i_391",mL="_filterOperatorRow_14b3i_397",gL="_filterOperatorBtn_14b3i_403",bL="_filterOperatorActive_14b3i_416",yL="_filterRuleRow_14b3i_422",xL="_filterInputRow_14b3i_428",vL="_filterSelect_14b3i_434",_L="_filterInput_14b3i_428",kL="_filterFieldFull_14b3i_461",wL="_filterRemoveBtn_14b3i_474",CL="_filterAddRule_14b3i_494",SL="_filterChecklist_14b3i_506",NL="_filterCheckItem_14b3i_514",AL="_filterGroup_14b3i_532",TL="_filterGroupHeader_14b3i_538",EL="_filterGroupLabel_14b3i_545",ML="_filterGroupClear_14b3i_553",jL="_filterFooter_14b3i_564",IL="_filterResetBtn_14b3i_574",DL="_filterApplyBtn_14b3i_591",z={wrapper:_R,wrapperScrollable:kR,scrollContainer:wR,table:CR,headerRow:SR,headerCell:NR,md:AR,sm:TR,headerCellSortable:ER,headerCellContent:MR,headerText:jR,sortIcon:IR,sortIconActive:DR,sortPriority:OR,filterBtnWrap:RR,filterBtn:LR,filterBtnActive:BR,expandCol:$R,selectCol:PR,editCol:zR,bodyRow:FR,bodyCell:HR,rowSelected:WR,rowStriped:VR,rowClickable:qR,expandCell:UR,selectCell:KR,editCell:GR,expandBtn:JR,groupRow:YR,groupCell:QR,groupToggle:XR,groupLabel:ZR,groupCount:eL,expansionRow:tL,expansionCell:nL,cellEditWrap:rL,cellInput:sL,rowEditBtns:iL,footerRow:oL,footerCell:lL,emptyCell:aL,loadingOverlay:cL,skeleton:dL,shimmer:uL,filterPopover:hL,filterBody:fL,filterRule:pL,filterOperatorRow:mL,filterOperatorBtn:gL,filterOperatorActive:bL,filterRuleRow:yL,filterInputRow:xL,filterSelect:vL,filterInput:_L,filterFieldFull:kL,filterRemoveBtn:wL,filterAddRule:CL,filterChecklist:SL,filterCheckItem:NL,filterGroup:AL,filterGroupHeader:TL,filterGroupLabel:EL,filterGroupClear:ML,filterFooter:jL,filterResetBtn:IL,filterApplyBtn:DL},bd=d.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:d.jsx("path",{d:"M1 1l8 8M9 1l-8 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})});function OL(t){const e=t.match(/^(\d{4})-(\d{2})-(\d{2})$/);return e?new Date(parseInt(e[1],10),parseInt(e[2],10)-1,parseInt(e[3],10)):null}function RL(t){const e=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0");return`${e}-${n}-${r}`}const LL=[{label:"Contains",value:"contains"},{label:"Starts with",value:"startsWith"},{label:"Ends with",value:"endsWith"},{label:"Equals",value:"equals"},{label:"Not equals",value:"notEquals"},{label:"Greater than",value:"gt"},{label:"Less than",value:"lt"},{label:"Blank",value:"blank"},{label:"Not blank",value:"notBlank"}],BL=[{label:"Date equal to",value:"dateEquals"},{label:"Date not equal to",value:"dateNotEquals"},{label:"Date before",value:"dateBefore"},{label:"Date after",value:"dateAfter"},{label:"Date on or before",value:"dateOnOrBefore"},{label:"Date on or after",value:"dateOnOrAfter"},{label:"Blank",value:"blank"},{label:"Not blank",value:"notBlank"}],yd=new Set(["blank","notBlank"]);function $L({value:t,dataType:e,onApply:n,onReset:r,onClose:s}){var m;const i=e==="date"?BL:LL,o=i[0].value,[l,a]=x.useState((m=t==null?void 0:t.rules)!=null&&m.length?t.rules:[{matchMode:o,value:""}]),[c,u]=x.useState((t==null?void 0:t.operator)??"and");function h(g,b){a(y=>y.map((v,_)=>_===g?{...v,...b}:v))}function p(){a(g=>[...g,{matchMode:o,value:""}])}function f(g){a(b=>b.filter((y,v)=>v!==g))}return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:z.filterBody,children:[l.map((g,b)=>d.jsxs("div",{className:z.filterRule,children:[b>0&&d.jsx("div",{className:z.filterOperatorRow,children:d.jsx(Al,{options:[{label:"AND",value:"and"},{label:"OR",value:"or"}],value:c,onChange:y=>u(y)})}),d.jsxs("div",{className:z.filterRuleRow,children:[d.jsx("div",{className:z.filterFieldFull,children:d.jsx(pr,{options:i,value:g.matchMode,onChange:y=>y&&h(b,{matchMode:y}),style:{width:"100%"}})}),!yd.has(g.matchMode)&&d.jsxs("div",{className:z.filterInputRow,children:[d.jsx("div",{className:z.filterFieldFull,children:e==="date"?d.jsx(Nl,{value:g.value?OL(g.value):null,onChange:y=>h(b,{value:y?RL(y):""}),style:{width:"100%"}}):d.jsx(gs,{placeholder:"Value",value:g.value,onChange:y=>h(b,{value:y.target.value})})}),l.length>1&&d.jsx(ut,{variant:"ghost",size:"sm",icon:bd,"aria-label":"Remove rule",onClick:()=>f(b)})]}),yd.has(g.matchMode)&&l.length>1&&d.jsx("div",{className:z.filterInputRow,children:d.jsx(ut,{variant:"ghost",size:"sm",icon:bd,"aria-label":"Remove rule",onClick:()=>f(b)})})]})]},b)),d.jsx(We,{variant:"ghost",size:"sm",onClick:p,style:{alignSelf:"flex-start"},children:"+ Add rule"})]}),d.jsx(ka,{onReset:r,onApply:()=>n({operator:c,rules:l}),onClose:s})]})}function PL({options:t=[],value:e,onApply:n,onReset:r,onClose:s}){const[i,o]=x.useState(new Set(e??[])),[l,a]=x.useState(""),c=t.filter(g=>g.label.toLowerCase().includes(l.toLowerCase())),u=c.length>0&&c.every(g=>i.has(g.value)),p=c.some(g=>i.has(g.value))&&!u;function f(g){o(b=>{const y=new Set(b);return y.has(g)?y.delete(g):y.add(g),y})}function m(){o(u?g=>{const b=new Set(g);return c.forEach(y=>b.delete(y.value)),b}:g=>{const b=new Set(g);return c.forEach(y=>b.add(y.value)),b})}return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:z.filterBody,children:[d.jsx(gs,{placeholder:"Search…",value:l,onChange:g=>a(g.target.value),prefixIcon:d.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:[d.jsx("circle",{cx:"6",cy:"6",r:"4.5",stroke:"currentColor",strokeWidth:"1.5"}),d.jsx("path",{d:"M9.5 9.5L12.5 12.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}),d.jsxs("div",{className:z.filterChecklist,children:[d.jsx(Gn,{label:"Select All",checked:u,indeterminate:p,onChange:m}),c.map(g=>d.jsx(Gn,{label:g.label,checked:i.has(g.value),onChange:()=>f(g.value)},String(g.value)))]})]}),d.jsx(ka,{onReset:r,onApply:()=>n(Array.from(i)),onClose:s})]})}function zL({groups:t=[],value:e,onApply:n,onReset:r,onClose:s}){const[i,o]=x.useState(new Set(e??[]));function l(c){o(u=>{const h=new Set(u);return h.has(c)?h.delete(c):h.add(c),h})}function a(c){o(u=>{const h=new Set(u);return c.options.forEach(p=>h.delete(p.value)),h})}return d.jsxs(d.Fragment,{children:[d.jsx("div",{className:z.filterBody,children:t.map(c=>d.jsxs("div",{className:z.filterGroup,children:[d.jsxs("div",{className:z.filterGroupHeader,children:[d.jsx("span",{className:z.filterGroupLabel,children:c.label}),d.jsx(We,{variant:"link",size:"sm",onClick:()=>a(c),children:"Clear All"})]}),c.options.map(u=>d.jsx(Gn,{label:u.label,checked:i.has(u.value),onChange:()=>l(u.value)},String(u.value)))]},c.label))}),d.jsx(ka,{onReset:r,onApply:()=>n(Array.from(i)),onClose:s})]})}function ka({onReset:t,onApply:e,onClose:n}){return d.jsxs("div",{className:z.filterFooter,children:[d.jsx(We,{variant:"secondary",size:"sm",onClick:()=>{t(),n()},children:"Reset"}),d.jsx(We,{variant:"primary",size:"sm",onClick:()=>{e(),n()},children:"Apply"})]})}function FL({config:t,onClose:e,anchorRef:n}){const r=x.useRef(null),[s,i]=x.useState(null);x.useEffect(()=>{function l(){var f;const a=(f=n.current)==null?void 0:f.getBoundingClientRect();if(!a)return;const c=280,u=360;let h=a.bottom+4,p=a.left;p+c>window.innerWidth-8&&(p=Math.max(8,a.right-c)),h+u>window.innerHeight-8&&(h=Math.max(8,a.top-u-4)),i({top:h,left:p})}return l(),window.addEventListener("scroll",l,!0),window.addEventListener("resize",l),()=>{window.removeEventListener("scroll",l,!0),window.removeEventListener("resize",l)}},[n]),x.useEffect(()=>{function l(a){const c=a.target;c.closest("[data-popover-root]")||r.current&&!r.current.contains(c)&&n.current&&!n.current.contains(c)&&e()}return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[e,n]),x.useEffect(()=>{function l(a){a.key==="Escape"&&e()}return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[e]);function o(){var l;(l=t.onChange)==null||l.call(t,null)}return s?Ut.createPortal(d.jsxs("div",{ref:r,"data-popover-root":"",className:z.filterPopover,style:{top:s.top,left:s.left},children:[t.type==="rule"&&d.jsx($L,{value:t.value,dataType:t.dataType??"text",onApply:l=>{var a;return(a=t.onChange)==null?void 0:a.call(t,l)},onReset:o,onClose:e}),t.type==="checklist"&&d.jsx(PL,{options:t.options,value:t.value,onApply:l=>{var a;return(a=t.onChange)==null?void 0:a.call(t,l)},onReset:o,onClose:e}),t.type==="grouped-checklist"&&d.jsx(zL,{groups:t.groups,value:t.value,onApply:l=>{var a;return(a=t.onChange)==null?void 0:a.call(t,l)},onReset:o,onClose:e})]}),document.body):null}function xd(t){return t.length>0&&typeof t[0]=="object"&&t[0]!==null&&"label"in t[0]&&"data"in t[0]}function Nt(t,e){return t[e]}function $r(t,e){return t[e]}function HL(){return d.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:d.jsx("path",{d:"M5 2L2 6h6L5 2z",fill:"currentColor"})})}function WL(){return d.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:d.jsx("path",{d:"M5 8L2 4h6L5 8z",fill:"currentColor"})})}function VL(){return d.jsxs("svg",{width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",children:[d.jsx("path",{d:"M5 2L2 6h6L5 2z",fill:"currentColor",opacity:"0.3"}),d.jsx("path",{d:"M5 12L2 8h6l-3 4z",fill:"currentColor",opacity:"0.3"})]})}function qL({active:t}){return d.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:d.jsx("path",{d:"M1 2h8M2.5 5h5M4 8h2",stroke:t?"var(--teal-700,#047880)":"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function vd(){return d.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:d.jsx("path",{d:"M4 2l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function _d(){return d.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:d.jsx("path",{d:"M2 4l4 4 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}const kd=()=>d.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:d.jsx("path",{d:"M2 6l3 3 5-5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),UL=()=>d.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:d.jsx("path",{d:"M8 2l2 2-6 6H2V8l6-6z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function wa({data:t,columns:e,dataKey:n="id",selectionMode:r="none",selection:s,onSelectionChange:i,sortMode:o="single",sortField:l,sortOrder:a,multiSortMeta:c,onSort:u,expansion:h,editMode:p,onRowEditSave:f,onRowEditCancel:m,onCellEdit:g,stripedRows:b=!1,size:y="md",showFooter:v=!1,loading:_=!1,emptyMessage:w="No data found.",scrollable:k=!1,scrollHeight:C,className:S,style:O}){const[B,N]=x.useState(new Set),[T,P]=x.useState(()=>xd(t)?new Set(t.filter(E=>E.defaultExpanded!==!1).map(E=>E.label)):new Set),[L,R]=x.useState(null),[H,q]=x.useState(null),[j,$]=x.useState({}),[W,se]=x.useState(null),ae=x.useRef(new Map),Ne=xd(t),je=Ne?t.flatMap(E=>E.data):t,Be=!!h,A=r==="multiple",U=p==="row",Y=e.length+(Be?1:0)+(A?1:0)+(U?1:0);function Ie(E){var V;return o==="multiple"&&c?((V=c.find(ce=>ce.field===E))==null?void 0:V.order)??0:l===E?a??0:0}function $e(E){if(o!=="multiple"||!c)return null;const V=c.findIndex(ce=>ce.field===E);return V>=0?V+1:null}function Bt(E){if(!u)return;const ce=Ie(E)===1?-1:1;if(o==="multiple"){const te=c?[...c]:[],De=te.findIndex(_t=>_t.field===E);De>=0?te[De]={field:E,order:ce}:te.push({field:E,order:ce}),u({field:E,order:ce,multiSortMeta:te})}else u({field:E,order:ce})}function Dt(E){if(!s)return!1;const V=Nt(E,n);return Array.isArray(s)?s.some(ce=>Nt(ce,n)===V):Nt(s,n)===V}function rr(E){if(!(r==="none"&&p!=="cell")){if(r==="single")i==null||i(Dt(E)?null:E);else if(r==="multiple"){const V=Array.isArray(s)?[...s]:[],ce=Nt(E,n),te=V.findIndex(De=>Nt(De,n)===ce);te>=0?V.splice(te,1):V.push(E),i==null||i(V)}}}function an(E){i==null||i(E?[...je]:[])}const $t=je.length>0&&je.every(E=>Dt(E)),Pt=!$t&&je.some(E=>Dt(E));function Gt(E){const V=h?Nt(E,h.dataKey):Nt(E,n);N(ce=>{const te=new Set(ce);return te.has(V)?te.delete(V):te.add(V),te})}function wr(E){const V=h?Nt(E,h.dataKey):Nt(E,n);return B.has(V)}function sr(E){const V=Nt(E,n),ce={};e.forEach(te=>{ce[te.field]=$r(E,te.field)}),R(V),$(ce)}function Cr(E){const V={...E,...j};f==null||f(V,E),R(null),$({})}function G(){R(null),$({}),m==null||m()}function D(E,V){const ce=Nt(E,n);q({rowKey:ce,field:V}),$({[V]:$r(E,V)})}function ee(E,V){const ce={...E,[V]:j[V]};g==null||g(ce,V,j[V]),q(null),$({})}function pe(E){return ae.current.has(E)||ae.current.set(E,{current:null}),ae.current.get(E)}function ve(E){var ce;if(!((ce=E.filter)!=null&&ce.value))return!1;const V=E.filter.value;return Array.isArray(V)?V.length>0:typeof V=="object"&&V!==null?(V.rules??[]).some(De=>De.value!==""):!1}const vt=()=>d.jsx("thead",{children:d.jsxs("tr",{className:z.headerRow,children:[Be&&d.jsx("th",{className:`${z.headerCell} ${z.expandCol}`}),A&&d.jsx("th",{className:`${z.headerCell} ${z.selectCol}`,children:d.jsx(Gn,{checked:$t,indeterminate:Pt,onChange:E=>an(E.target.checked),"aria-label":"Select all rows",size:"sm"})}),e.map(E=>{const V=Ie(E.field),ce=$e(E.field),te=E.filter?pe(E.field):null;return d.jsx("th",{className:`${z.headerCell} ${E.sortable?z.headerCellSortable:""}`,style:{width:E.width,textAlign:E.align??"left"},onClick:()=>E.sortable&&Bt(E.field),"aria-sort":V===1?"ascending":V===-1?"descending":"none",children:d.jsxs("span",{className:z.headerCellContent,children:[d.jsx("span",{className:z.headerText,children:E.header}),E.sortable&&d.jsxs("span",{className:`${z.sortIcon} ${V!==0?z.sortIconActive:""}`,children:[V===1?d.jsx(HL,{}):V===-1?d.jsx(WL,{}):d.jsx(VL,{}),ce!==null&&d.jsx("span",{className:z.sortPriority,children:ce})]}),E.filter&&d.jsxs("div",{className:z.filterBtnWrap,onClick:De=>De.stopPropagation(),children:[d.jsx("button",{ref:te,type:"button",className:`${z.filterBtn} ${ve(E)?z.filterBtnActive:""}`,"aria-label":`Filter ${E.header}`,onClick:()=>se(De=>De===E.field?null:E.field),children:d.jsx(qL,{active:ve(E)})}),W===E.field&&te&&d.jsx(FL,{config:E.filter,onClose:()=>se(null),anchorRef:te})]})]})},E.field)}),U&&d.jsx("th",{className:`${z.headerCell} ${z.editCol}`})]})}),ft=x.useCallback((E,V,ce)=>{const te=Nt(E,n),De=Dt(E),_t=Be&&wr(E),_s=p==="row"&&L===te,to=[z.bodyRow,De?z.rowSelected:"",b&&ce?z.rowStriped:"",r!=="none"?z.rowClickable:""].filter(Boolean).join(" "),ne=e.map(Ae=>{const no=p==="cell"&&H!=null&&H.rowKey===te&&H.field===Ae.field,Ca=_s||no;let ir;return Ca&&Ae.editor?ir=Ae.editor({...E,...j},Ae.field,Mn=>$(ro=>({...ro,[Ae.field]:Mn}))):Ca?ir=d.jsx("input",{className:z.cellInput,value:String(j[Ae.field]??$r(E,Ae.field)??""),onChange:Mn=>$(ro=>({...ro,[Ae.field]:Mn.target.value}))}):Ae.body?ir=Ae.body(E,V):ir=String($r(E,Ae.field)??""),d.jsx("td",{className:z.bodyCell,style:{textAlign:Ae.align??"left"},onClick:()=>{p==="cell"&&Ae.editor&&!no&&(H&&ee(E,H.field),D(E,Ae.field))},children:no?d.jsxs("div",{className:z.cellEditWrap,children:[ir,d.jsx(ut,{variant:"ghost",size:"sm",icon:d.jsx(kd,{}),"aria-label":"Confirm edit",onClick:Mn=>{Mn.stopPropagation(),ee(E,Ae.field)}}),d.jsx(Lt,{size:"sm","aria-label":"Cancel edit",onClick:Mn=>{Mn.stopPropagation(),q(null),$({})}})]}):ir},Ae.field)});return d.jsxs(d.Fragment,{children:[d.jsxs("tr",{className:to,onClick:()=>{r!=="none"&&rr(E)},"aria-selected":r!=="none"?De:void 0,children:[Be&&d.jsx("td",{className:`${z.bodyCell} ${z.expandCell}`,children:d.jsx("button",{type:"button",className:z.expandBtn,onClick:Ae=>{Ae.stopPropagation(),Gt(E)},"aria-label":_t?"Collapse row":"Expand row","aria-expanded":_t,children:_t?d.jsx(_d,{}):d.jsx(vd,{})})}),A&&d.jsx("td",{className:`${z.bodyCell} ${z.selectCell}`,onClick:Ae=>Ae.stopPropagation(),children:d.jsx(Gn,{checked:De,onChange:()=>rr(E),"aria-label":"Select row",size:"sm"})}),ne,U&&d.jsx("td",{className:`${z.bodyCell} ${z.editCell}`,onClick:Ae=>Ae.stopPropagation(),children:_s?d.jsxs("div",{className:z.rowEditBtns,children:[d.jsx(ut,{variant:"ghost",size:"sm",icon:d.jsx(kd,{}),"aria-label":"Save row",onClick:()=>Cr(E)}),d.jsx(Lt,{size:"sm","aria-label":"Cancel edit",onClick:G})]}):d.jsx(ut,{variant:"ghost",size:"sm",icon:d.jsx(UL,{}),"aria-label":"Edit row",onClick:()=>sr(E)})})]},String(te)),Be&&_t&&h&&d.jsx("tr",{className:z.expansionRow,children:d.jsx("td",{colSpan:Y,className:z.expansionCell,children:h.template?h.template(E):h.childKey?d.jsx(wa,{data:$r(E,String(h.childKey))??[],columns:h.columns??e,dataKey:n,selectionMode:r,stripedRows:b,size:y,showFooter:v,editMode:p}):null})},`${String(te)}-expansion`)]})},[e,L,H,j,B,s,b,Be,A,U,r,p]),Jt=()=>_?d.jsx("tbody",{children:Array.from({length:5}).map((E,V)=>d.jsx("tr",{className:z.bodyRow,children:Array.from({length:Y}).map((ce,te)=>d.jsx("td",{className:z.bodyCell,children:d.jsx("span",{className:z.skeleton})},te))},V))}):je.length===0?d.jsx("tbody",{children:d.jsx("tr",{children:d.jsx("td",{colSpan:Y,className:z.emptyCell,children:w})})}):Ne?d.jsx("tbody",{children:t.map(E=>{const V=T.has(E.label);return d.jsxs(d.Fragment,{children:[d.jsx("tr",{className:z.groupRow,onClick:()=>P(ce=>{const te=new Set(ce);return te.has(E.label)?te.delete(E.label):te.add(E.label),te}),children:d.jsxs("td",{colSpan:Y,className:z.groupCell,children:[d.jsx("span",{className:z.groupToggle,children:V?d.jsx(_d,{}):d.jsx(vd,{})}),d.jsx("span",{className:z.groupLabel,children:E.label}),d.jsxs("span",{className:z.groupCount,children:["(",E.data.length,")"]})]})},`group-${E.label}`),V&&E.data.map((ce,te)=>ft(ce,te,te%2!==0))]})})}):d.jsx("tbody",{children:t.map((E,V)=>ft(E,V,V%2!==0))}),Sr=()=>!v||!e.some(V=>V.footer!==void 0)?null:d.jsx("tfoot",{children:d.jsxs("tr",{className:z.footerRow,children:[Be&&d.jsx("td",{className:z.footerCell}),A&&d.jsx("td",{className:z.footerCell}),e.map(V=>d.jsx("td",{className:z.footerCell,style:{textAlign:V.align??"left"},children:typeof V.footer=="function"?V.footer(je):V.footer},V.field)),U&&d.jsx("td",{className:z.footerCell})]})}),Nr=[z.table,z[y],b?z.striped:""].filter(Boolean).join(" "),cn=[z.wrapper,k?z.wrapperScrollable:"",S??""].filter(Boolean).join(" ");return d.jsxs("div",{className:cn,style:O,children:[d.jsx("div",{className:z.scrollContainer,style:k&&C?{maxHeight:C,overflowY:"auto"}:void 0,children:d.jsxs("table",{className:Nr,role:"grid",children:[vt(),Jt(),Sr()]})}),_&&d.jsx("div",{className:z.loadingOverlay,"aria-busy":"true","aria-label":"Loading"})]})}wa.displayName="DataTable";const KL="_shell_1l18z_1",sp={shell:KL};function GL({topBar:t,loanBannerNav:e,urlATabsNav:n,className:r,style:s}){return d.jsxs("div",{className:[sp.shell,r].filter(Boolean).join(" "),style:s,children:[d.jsx(tp,{...t}),e&&d.jsx(rp,{...e}),n&&d.jsx(va,{...n})]})}function JL({topBar:t,urlATabsNavMobile:e,className:n,style:r}){const s=!!t.borrower&&!!e;return d.jsxs("div",{className:[sp.shell,n].filter(Boolean).join(" "),style:r,children:[d.jsx(np,{...t}),s&&d.jsx(_a,{...e})]})}exports.AUSChip=Wf;exports.Accordion=If;exports.BannerAlert=ma;exports.BannerTabs=pa;exports.Button=We;exports.Calendar=Nd;exports.Card=jf;exports.Checkbox=Gn;exports.CloseButton=Lt;exports.DEFAULT_DOC_TYPES=Uf;exports.DataTable=wa;exports.DatePicker=Nl;exports.Drawer=Of;exports.DropdownButton=$i;exports.FileUpload=Kf;exports.FullNav=GL;exports.FullNavMobile=JL;exports.IconButton=ut;exports.InlineAlert=qf;exports.InlineContainedAlert=Vf;exports.InputText=gs;exports.LightningButton=eo;exports.ListBox=wd;exports.LoanBannerNav=rp;exports.MiscChip=Gs;exports.Modal=Gf;exports.MultiSelect=Sd;exports.Paginator=Ef;exports.Picklist=Mf;exports.Popup=Jf;exports.ProfileChip=Hf;exports.ProgressBar=Pf;exports.ProgressSpinner=zf;exports.RadioButton=Cd;exports.RichTextEditor=wf;exports.Select=pr;exports.SelectButton=Al;exports.SeverityChip=Ff;exports.SidePanel=Yf;exports.SidePanelLayout=Qf;exports.SplitButton=fa;exports.Tabs=Df;exports.TextArea=Ad;exports.Toast=$f;exports.Toaster=Bf;exports.ToggleSwitch=Cf;exports.Tooltip=er;exports.TopBar=tp;exports.TopBarMobile=np;exports.URLATabsNav=va;exports.URLATabsNavMobile=_a;exports.URLATabsNavTablet=Xf;exports.toast=DM;
|
|
175
175
|
//# sourceMappingURL=index.cjs.map
|