cc-viewer 1.6.327 → 1.6.329
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/cli.js +12 -5
- package/dist/assets/App-j3FcuV1C.css +1 -0
- package/dist/assets/App-zGAU2EYM.js +2 -0
- package/dist/assets/{MdxEditorPanel-BV07xvRx.js → MdxEditorPanel-5Pb0ZTc6.js} +1 -1
- package/dist/assets/{Mobile-BOO1P7Gs.js → Mobile-BYT_A8TX.js} +1 -1
- package/dist/assets/{_baseUniq-Bd-sKzQW.js → _baseUniq-jDC_lFvH.js} +1 -1
- package/dist/assets/{arc-D_6rT0rI.js → arc-D_MHcfPz.js} +1 -1
- package/dist/assets/{architectureDiagram-Q4EWVU46-ClH0N8bK.js → architectureDiagram-Q4EWVU46-D3LhuQ4p.js} +1 -1
- package/dist/assets/{blockDiagram-DXYQGD6D-VBVbHV93.js → blockDiagram-DXYQGD6D-Bi9G2rJp.js} +1 -1
- package/dist/assets/{c4Diagram-AHTNJAMY-CHd3FVhr.js → c4Diagram-AHTNJAMY-DlY0w3X4.js} +1 -1
- package/dist/assets/{channel-DtAIDDMS.js → channel-C87hLHco.js} +1 -1
- package/dist/assets/{chunk-4BX2VUAB-ldBMt7Zz.js → chunk-4BX2VUAB-DodXg0hV.js} +1 -1
- package/dist/assets/{chunk-4TB4RGXK-BpaavRFi.js → chunk-4TB4RGXK-Ba2E_IX7.js} +1 -1
- package/dist/assets/{chunk-55IACEB6-CCQR_GqB.js → chunk-55IACEB6-CWG3ZdRs.js} +1 -1
- package/dist/assets/{chunk-EDXVE4YY-B94gGHJo.js → chunk-EDXVE4YY-lT5M-dRo.js} +1 -1
- package/dist/assets/{chunk-FMBD7UC4-D2pvMCHW.js → chunk-FMBD7UC4-BY_2pfoq.js} +1 -1
- package/dist/assets/{chunk-OYMX7WX6-BC1K8PFw.js → chunk-OYMX7WX6-DzLhEX7n.js} +1 -1
- package/dist/assets/{chunk-QZHKN3VN-BlKIHWPg.js → chunk-QZHKN3VN-BvdoGurF.js} +1 -1
- package/dist/assets/{chunk-YZCP3GAM-CO46Dpuq.js → chunk-YZCP3GAM-C7rlhtyD.js} +1 -1
- package/dist/assets/classDiagram-6PBFFD2Q-DiOul2Ap.js +1 -0
- package/dist/assets/classDiagram-v2-HSJHXN6E-DiOul2Ap.js +1 -0
- package/dist/assets/clone-r-iPz1mj.js +1 -0
- package/dist/assets/{cose-bilkent-S5V4N54A-UW2sc3aR.js → cose-bilkent-S5V4N54A-DhsYplMy.js} +1 -1
- package/dist/assets/{dagre-KV5264BT-nawhI5CM.js → dagre-KV5264BT-PLnp9yct.js} +1 -1
- package/dist/assets/{diagram-5BDNPKRD-BrLDz-85.js → diagram-5BDNPKRD-DqvSM_bo.js} +1 -1
- package/dist/assets/{diagram-G4DWMVQ6-DDT86i03.js → diagram-G4DWMVQ6-DYN80unA.js} +1 -1
- package/dist/assets/{diagram-MMDJMWI5-BQMzmHLU.js → diagram-MMDJMWI5-D-jv3M8U.js} +1 -1
- package/dist/assets/{diagram-TYMM5635-BX7-PwHQ.js → diagram-TYMM5635-BbVwY3fb.js} +1 -1
- package/dist/assets/{erDiagram-SMLLAGMA-IwLVLNv0.js → erDiagram-SMLLAGMA-9-rp8xsO.js} +1 -1
- package/dist/assets/{flowDiagram-DWJPFMVM-B8_X77WK.js → flowDiagram-DWJPFMVM-Bu_JuIe2.js} +1 -1
- package/dist/assets/{ganttDiagram-T4ZO3ILL-DgeHpfKD.js → ganttDiagram-T4ZO3ILL-B-PvSqDf.js} +1 -1
- package/dist/assets/{gitGraphDiagram-UUTBAWPF-GImqd44T.js → gitGraphDiagram-UUTBAWPF-DGloG4Vg.js} +1 -1
- package/dist/assets/{graph-BFNvFrIw.js → graph-CbR0Gq9P.js} +1 -1
- package/dist/assets/{index-CL43Q_T6.js → index-70lDhcDm.js} +1 -1
- package/dist/assets/{index-DH6neeAn.js → index-7ibWcMau.js} +1 -1
- package/dist/assets/{index-DqxWEMZG.js → index-CtLTny8H.js} +1 -1
- package/dist/assets/{index-Zcwywgin.js → index-CtigeZCJ.js} +1 -1
- package/dist/assets/{index-CG43hSOO.js → index-D8UlD-Rs.js} +1 -1
- package/dist/assets/index-DENLOp7J.js +2 -0
- package/dist/assets/{index-DYZfyIFS.js → index-Dyqfqy0-.js} +1 -1
- package/dist/assets/{index-SMWE-umF.js → index-jdQotxUf.js} +1 -1
- package/dist/assets/{infoDiagram-42DDH7IO-DafQ4Zwr.js → infoDiagram-42DDH7IO-FGosRpTG.js} +1 -1
- package/dist/assets/{ishikawaDiagram-UXIWVN3A-CsS59UI8.js → ishikawaDiagram-UXIWVN3A-BlclfpV5.js} +1 -1
- package/dist/assets/{journeyDiagram-VCZTEJTY-C8OZZC2d.js → journeyDiagram-VCZTEJTY--UkR986E.js} +1 -1
- package/dist/assets/{jszip.min-DWTs-GDW.js → jszip.min-PwTGeWmJ.js} +1 -1
- package/dist/assets/{kanban-definition-6JOO6SKY-BThryIIr.js → kanban-definition-6JOO6SKY-1oO9JAku.js} +1 -1
- package/dist/assets/{layout-B2c4ocGM.js → layout-DKdPIoav.js} +1 -1
- package/dist/assets/{linear-whLrOj6w.js → linear-D2uKszhd.js} +1 -1
- package/dist/assets/mermaid.core-Adp4RVnV.js +7 -0
- package/dist/assets/{min-DcYONCON.js → min-Czdk6h6Y.js} +1 -1
- package/dist/assets/{mindmap-definition-QFDTVHPH-B7cxL7F7.js → mindmap-definition-QFDTVHPH-Bs7NLrcq.js} +1 -1
- package/dist/assets/{pieDiagram-DEJITSTG-C5W3T882.js → pieDiagram-DEJITSTG-D7z6f5QH.js} +1 -1
- package/dist/assets/{quadrantDiagram-34T5L4WZ-DOZS2aRU.js → quadrantDiagram-34T5L4WZ-2rae23Td.js} +1 -1
- package/dist/assets/{requirementDiagram-MS252O5E-C_ZtyqTm.js → requirementDiagram-MS252O5E-B4uC_pLr.js} +1 -1
- package/dist/assets/{sankeyDiagram-XADWPNL6-DImjFcUx.js → sankeyDiagram-XADWPNL6-xo0rKzRA.js} +1 -1
- package/dist/assets/{seqResourceLoaders-D6YenrBg.css → seqResourceLoaders-BFMsIN74.css} +1 -1
- package/dist/assets/seqResourceLoaders-C7QiLG9L.js +2 -0
- package/dist/assets/{sequenceDiagram-FGHM5R23-BQwGiH06.js → sequenceDiagram-FGHM5R23-3zQ_CXGR.js} +1 -1
- package/dist/assets/{stateDiagram-FHFEXIEX-D8zGNMAW.js → stateDiagram-FHFEXIEX-BnAvwAN8.js} +1 -1
- package/dist/assets/{stateDiagram-v2-QKLJ7IA2-DY86eLVa.js → stateDiagram-v2-QKLJ7IA2-Q4raD3B2.js} +1 -1
- package/dist/assets/{timeline-definition-GMOUNBTQ-LfDkNw95.js → timeline-definition-GMOUNBTQ-BMSMoqEA.js} +1 -1
- package/dist/assets/{vendor-antd-x2KtHa4R.js → vendor-antd-TJ9xmLQO.js} +1 -1
- package/dist/assets/{vendor-codemirror-z6VSi4ab.js → vendor-codemirror-CIGft5iF.js} +1 -1
- package/dist/assets/vendor-mdxeditor-BuIUwnOf.js +2 -0
- package/dist/assets/{vendor-qrcode-Dtu30dr9.js → vendor-qrcode-BOhJZrOT.js} +1 -1
- package/dist/assets/{vendor-virtuoso-BhHaLmft.js → vendor-virtuoso-CyrVCdOW.js} +1 -1
- package/dist/assets/{vennDiagram-DHZGUBPP-DRRBdcoR.js → vennDiagram-DHZGUBPP-Dd_tCka1.js} +1 -1
- package/dist/assets/{wardley-RL74JXVD-DtWPL3Ou.js → wardley-RL74JXVD-DGkrRuSv.js} +1 -1
- package/dist/assets/{wardleyDiagram-NUSXRM2D-CDGkjbzC.js → wardleyDiagram-NUSXRM2D-DlbDpNJR.js} +1 -1
- package/dist/assets/{xychartDiagram-5P7HB3ND-drrUfgKK.js → xychartDiagram-5P7HB3ND-CtBG1yl-.js} +1 -1
- package/dist/index.html +7 -7
- package/package.json +1 -1
- package/server/lib/im-append-system.js +160 -0
- package/server/lib/im-lang.js +1 -1
- package/server/lib/im-skills.js +1 -1
- package/server/lib/system-prompt-files.js +133 -0
- package/server/pty-manager.js +58 -2
- package/server/routes/expert.js +72 -0
- package/server/routes/files-fs.js +16 -0
- package/server/routes/im.js +12 -11
- package/server/server.js +11 -4
- package/dist/assets/App-DD3p9gdp.css +0 -1
- package/dist/assets/App-DkRFGCYS.js +0 -2
- package/dist/assets/classDiagram-6PBFFD2Q-BVr-1vS2.js +0 -1
- package/dist/assets/classDiagram-v2-HSJHXN6E-BVr-1vS2.js +0 -1
- package/dist/assets/clone-BLbDEtop.js +0 -1
- package/dist/assets/index-BzkiNZxR.js +0 -2
- package/dist/assets/mermaid.core-CVxcxPSX.js +0 -7
- package/dist/assets/seqResourceLoaders-BYpuRR7f.js +0 -2
- package/dist/assets/vendor-mdxeditor-Zi3mchEB.js +0 -2
- package/server/lib/im-claude-md.js +0 -114
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-codemirror-z6VSi4ab.js","assets/vendor-antd-x2KtHa4R.js","assets/index-SMWE-umF.js","assets/index-CG43hSOO.js","assets/index-DqxWEMZG.js","assets/index-DYZfyIFS.js","assets/index-DH6neeAn.js","assets/dockerfile-Du7niAGi.js","assets/simple-mode-CoQRusFX.js","assets/factor-C7nC06Ta.js","assets/nsis-ooFGduGn.js","assets/pug-DRSo4eCK.js","assets/javascript-Cet1BUca.js","assets/index-CL43Q_T6.js","assets/index-Zcwywgin.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
var __defProp=Object.defineProperty,__publicField=(obj,key,value)=>((obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value:value}):obj[key]=value)(obj,"symbol"!=typeof key?key+"":key,value);import{a as reactExports,R as React__default,d as reactDomExports,e as classNames,f as React,c as ReactDOM,g as getDefaultExportFromCjs,b as _extends,_ as _objectWithoutPropertiesLoose$1,h as commonjsGlobal}from"./vendor-antd-x2KtHa4R.js";import{j as jsxRuntimeExports,L as LanguageDescription,a as LanguageSupport,S as StreamLanguage,s as syntaxHighlighting,E as EditorView,H as HighlightStyle,t as tags,l as lineNumbers,h as highlightActiveLineGutter,b as highlightSpecialChars,c as history,f as foldGutter,d as drawSelection,e as dropCursor,g as EditorState,i as indentOnInput,k as defaultHighlightStyle,m as bracketMatching,n as closeBrackets,o as autocompletion,r as rectangularSelection,p as crosshairCursor,q as highlightActiveLine,u as highlightSelectionMatches,v as keymap,w as closeBracketsKeymap,x as defaultKeymap,y as searchKeymap,z as historyKeymap,A as foldKeymap,B as completionKeymap,C as lintKeymap,D as indentWithTab,P as Prec,F as Compartment,G as StateEffect,I as ChangeSet,J as StyleModule,K as StateField,M as Decoration,V as ViewPlugin,N as Facet,O as gutter,R as RangeSet,Q as RangeSetBuilder,W as WidgetType,T as GutterMarker,U as markdown}from"./vendor-codemirror-z6VSi4ab.js";const seen={},__vitePreload=function(baseModule,deps,importerUrl){let promise=Promise.resolve();if(deps&&deps.length>0){let allSettled2=function(promises){return Promise.all(promises.map(p2=>Promise.resolve(p2).then(value=>({status:"fulfilled",value:value}),reason=>({status:"rejected",reason:reason}))))};document.getElementsByTagName("link");const cspNonceMeta=document.querySelector("meta[property=csp-nonce]"),cspNonce=(null==cspNonceMeta?void 0:cspNonceMeta.nonce)||(null==cspNonceMeta?void 0:cspNonceMeta.getAttribute("nonce"));promise=allSettled2(deps.map(dep=>{if((dep=function(dep){return"/"+dep}(dep))in seen)return;seen[dep]=!0;const isCss=dep.endsWith(".css"),cssSelector=isCss?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${dep}"]${cssSelector}`))return;const link2=document.createElement("link");return link2.rel=isCss?"stylesheet":"modulepreload",isCss||(link2.as="script"),link2.crossOrigin="",link2.href=dep,cspNonce&&link2.setAttribute("nonce",cspNonce),document.head.appendChild(link2),isCss?new Promise((res,rej)=>{link2.addEventListener("load",res),link2.addEventListener("error",()=>rej(new Error(`Unable to preload CSS for ${dep}`)))}):void 0}))}function handlePreloadError(err){const e2=new Event("vite:preloadError",{cancelable:!0});if(e2.payload=err,window.dispatchEvent(e2),!e2.defaultPrevented)throw err}return promise.then(res=>{for(const item of res||[])"rejected"===item.status&&handlePreloadError(item.reason);return baseModule().catch(handlePreloadError)})};var N$6=Object.defineProperty,p$4=(s2,t2,e2)=>((s2,t2,e2)=>t2 in s2?N$6(s2,t2,{enumerable:!0,configurable:!0,writable:!0,value:e2}):s2[t2]=e2)(s2,"symbol"!=typeof t2?t2+"":t2,e2);let S$5=class S{constructor(t2=new Map){this.map=t2}clone(){return new S(new Map(this.map))}increment(t2){const e2=this.map.get(t2)??0;this.map.set(t2,e2+1)}decrement(t2,e2){let n2=this.map.get(t2);void 0!==n2&&(n2-=1,this.map.set(t2,n2),0===n2&&e2())}},k$4=class{constructor(){p$4(this,"map",new Map)}getOrCreate(t2){let e2=this.map.get(t2);return void 0===e2&&(e2=new Set,this.map.set(t2,e2)),e2}get(t2){return this.map.get(t2)}use(t2,e2){const n2=this.get(t2);void 0!==n2&&e2(n2)}delete(t2){return this.map.delete(t2)}};function d$4(s2,t2){return t2(s2),s2}function x$7(){}function O$3(s2,t2){return s2===t2}const C$4=new Map;let T$1=class{constructor(t2={}){p$4(this,"subscriptions",new k$4),p$4(this,"singletonSubscriptions",new Map),p$4(this,"graph",new k$4),p$4(this,"state",new Map),p$4(this,"distinctNodes",new Map),p$4(this,"executionMaps",new Map),p$4(this,"definitionRegistry",new Set),p$4(this,"combinedCells",[]);for(const e2 of Object.getOwnPropertySymbols(t2))this.state.set(e2,t2[e2])}cellInstance(t2,e2=!0,n2=Symbol()){return this.state.has(n2)||this.state.set(n2,t2),!1!==e2&&!this.distinctNodes.has(n2)&&this.distinctNodes.set(n2,!0===e2?O$3:e2),n2}signalInstance(t2=!0,e2=Symbol()){return!1!==t2&&this.distinctNodes.set(e2,!0===t2?O$3:t2),e2}sub(t2,e2){this.register(t2);const n2=this.subscriptions.getOrCreate(t2);return n2.add(e2),()=>n2.delete(e2)}singletonSub(t2,e2){return this.register(t2),void 0===e2?this.singletonSubscriptions.delete(t2):this.singletonSubscriptions.set(t2,e2),()=>this.singletonSubscriptions.delete(t2)}resetSingletonSubs(){this.singletonSubscriptions.clear()}subMultiple(t2,e2){const n2=this.signalInstance();return this.connect({map:i2=>(...r2)=>{i2(r2)},sink:n2,sources:t2}),this.sub(n2,e2)}pubIn(t2){var a2;const e2=Reflect.ownKeys(t2),n2=this.getExecutionMap(e2),i2=n2.refCount.clone(),r2=n2.participatingNodes.slice(),o2=new Map(this.state),l2=h2=>{this.graph.use(h2,c2=>{for(const{sources:u2,sink:y2}of c2)u2.has(h2)&&i2.decrement(y2,()=>{r2.splice(r2.indexOf(y2),1),l2(y2)})})};for(;;){const h2=r2.shift();if(void 0===h2)break;const c2=h2;let u2=!1;const y2=m3=>{const f3=this.distinctNodes.get(c2);null!=f3&&f3(o2.get(c2),m3)?u2=!1:(u2=!0,o2.set(c2,m3),this.state.has(c2)&&this.state.set(c2,m3))};if(Object.prototype.hasOwnProperty.call(t2,c2)?y2(t2[c2]):n2.projections.use(c2,m3=>{for(const f3 of m3){const M2=[...Array.from(f3.sources),...Array.from(f3.pulls)].map(v2=>o2.get(v2));f3.map(y2)(...M2)}}),u2){const m3=o2.get(c2);this.inContext(()=>{this.subscriptions.use(c2,f3=>{for(const M2 of f3)M2(m3)})}),null==(a2=this.singletonSubscriptions.get(c2))||a2(m3)}else l2(c2)}}connect({sources:t2,pulls:e2=[],map:n2,sink:i2}){const r2={map:n2,pulls:new Set(e2),sink:this.register(i2),sources:new Set(t2)};for(const o2 of[...t2,...e2])this.register(o2),this.graph.getOrCreate(o2).add(r2);this.executionMaps.clear()}pub(t2,e2){this.pubIn({[t2]:e2})}pipe(t2,...e2){return this.combineOperators(...e2)(t2)}transformer(...t2){return e2=>d$4(this.signalInstance(),n2=>(this.link(this.pipe(n2,...t2),e2),n2))}link(t2,e2){this.connect({map:n2=>i2=>{n2(i2)},sink:e2,sources:[t2]})}combine(...t2){return d$4(this.signalInstance(),e2=>{this.connect({map:n2=>(...i2)=>{n2(i2)},sink:e2,sources:t2})})}combineCells(...t2){const e2=this.combinedCells.find(i2=>t2.length===i2.sources.length&&t2.every((r2,o2)=>r2===i2.sources[o2]));if(e2)return e2.cell;const n2=this.cellInstance(t2.map(i2=>this.getValue(i2)),!0);return this.connect({map:i2=>(...r2)=>{i2(r2)},sink:n2,sources:t2}),this.combinedCells.push({sources:t2,cell:n2}),n2}getValue(t2){return this.register(t2),this.state.get(t2)}getValues(t2){return t2.map(e2=>this.getValue(e2))}register(t2){const e2=C$4.get(t2);return void 0===e2||this.definitionRegistry.has(t2)?t2:(this.definitionRegistry.add(t2),d$4("cell"===e2.type?this.cellInstance(e2.initial,e2.distinct,t2):this.signalInstance(e2.distinct,t2),n2=>{this.inContext(()=>{e2.init(this,n2)})}))}inContext(t2){return t2()}changeWith(t2,e2,n2){this.connect({sources:[e2],pulls:[t2],sink:t2,map:i2=>(r2,o2)=>{i2(n2(o2,r2))}})}calculateExecutionMap(t2){const e2=[],n2=new Set,i2=new k$4,r2=new S$5,o2=new k$4,l2=(a2,h2=0)=>{r2.increment(a2),!n2.has(a2)&&(this.register(a2),i2.use(a2,c2=>{h2=Math.max(...Array.from(c2).map(u2=>e2.indexOf(u2)))+1}),this.graph.use(a2,c2=>{for(const u2 of c2)u2.sources.has(a2)?(o2.getOrCreate(u2.sink).add(u2),l2(u2.sink,h2)):i2.getOrCreate(u2.sink).add(a2)}),n2.add(a2),e2.splice(h2,0,a2))};return t2.forEach(l2),{participatingNodes:e2,pendingPulls:i2,projections:o2,refCount:r2}}getExecutionMap(t2){let e2=t2;if(1===t2.length){e2=t2[0];const i2=this.executionMaps.get(e2);if(void 0!==i2)return i2}else for(const[i2,r2]of this.executionMaps.entries())if(Array.isArray(i2)&&i2.length===t2.length&&i2.every(o2=>t2.includes(o2)))return r2;const n2=this.calculateExecutionMap(t2);return this.executionMaps.set(e2,n2),n2}combineOperators(...t2){return e2=>{for(const n2 of t2)e2=n2(e2,this);return e2}}};function $$4(s2,t2=x$7,e2=!0){return d$4(Symbol(),n2=>{C$4.set(n2,{type:"cell",distinct:e2,initial:s2,init:t2})})}function K$3(s2=x$7,t2=!1){return d$4(Symbol(),e2=>{C$4.set(e2,{type:"signal",distinct:t2,init:s2})})}function q$3(s2=x$7){return d$4(Symbol(),t2=>{C$4.set(t2,{type:"signal",distinct:!1,init:s2})})}const V$3=reactExports.createContext(null);function R$6(){const s2=reactExports.useContext(V$3);if(null===s2)throw new Error("useRealm must be used within a RealmContextProvider");return s2}function E$4(s2){const t2=R$6();t2.register(s2);const e2=reactExports.useCallback(n2=>t2.sub(s2,n2),[t2,s2]);return reactExports.useSyncExternalStore(e2,()=>t2.getValue(s2),()=>t2.getValue(s2))}function X$3(...s2){const t2=R$6();return E$4(reactExports.useMemo(()=>t2.combineCells.apply(t2,s2),[t2,...s2]))}function A$4(s2){const t2=R$6();return t2.register(s2),reactExports.useCallback(e2=>{t2.pub(s2,e2)},[t2,s2])}function _$3(s2){return(t2,e2)=>{const n2=e2.signalInstance();return e2.connect({map:i2=>r2=>{i2(s2(r2))},sink:n2,sources:[t2]}),n2}}function tt$4(...s2){return(t2,e2)=>{const n2=e2.signalInstance();return e2.connect({map:i2=>(...r2)=>{i2(r2)},pulls:s2,sink:n2,sources:[t2]}),n2}}function et$5(s2){return(t2,e2)=>{const n2=e2.signalInstance();return e2.connect({map:i2=>()=>{i2(s2)},sink:n2,sources:[t2]}),n2}}function nt$4(s2){return(t2,e2)=>{const n2=e2.signalInstance();return e2.connect({map:i2=>r2=>{s2(r2)&&i2(r2)},sink:n2,sources:[t2]}),n2}}function it$4(s2,t2){return(e2,n2)=>{const i2=n2.signalInstance();return n2.connect({map:r2=>o2=>{r2(t2=s2(t2,o2))},sink:i2,sources:[e2]}),i2}}function noop$2(){}function realmPlugin(plugin){return function(params){return{init:realm=>{var _a;return null==(_a=plugin.init)?void 0:_a.call(plugin,realm,params)},postInit:realm=>{var _a;return null==(_a=plugin.postInit)?void 0:_a.call(plugin,realm,params)},update:realm=>{var _a;return null==(_a=plugin.update)?void 0:_a.call(plugin,realm,params)}}}}function RealmWithPlugins({children:children,plugins:plugins}){const theRealm=React__default.useMemo(()=>{return arg=new T$1,(r2=>{var _a,_b;for(const plugin of plugins)null==(_a=plugin.init)||_a.call(plugin,r2);for(const plugin of plugins)null==(_b=plugin.postInit)||_b.call(plugin,r2)})(arg),arg;var arg},[]);return React__default.useEffect(()=>{var _a;for(const plugin of plugins)null==(_a=plugin.update)||_a.call(plugin,theRealm)}),React__default.createElement(V$3.Provider,{value:theRealm},children)}const r$1=reactExports.createContext(null);function t$3(n2,e2){let r2=null;return null!=n2&&(r2=n2[1]),{getTheme:function(){return null!=e2?e2:null!=r2?r2.getTheme():null}}}function o$5(){const n2=reactExports.useContext(r$1);return null==n2&&function(n3,...e2){const r2=new URL("https://lexical.dev/docs/error"),t2=new URLSearchParams;t2.append("code",n3);for(const n4 of e2)t2.append("v",n4);throw r2.search=t2.toString(),Error(`Minified Lexical error #${n3}; visit ${r2.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(8),n2}function t$2(t2,...e2){const n2=new URL("https://lexical.dev/docs/error"),r2=new URLSearchParams;r2.append("code",t2);for(const t3 of e2)r2.append("v",t3);throw n2.search=r2.toString(),Error(`Minified Lexical error #${t2}; visit ${n2.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const e$3="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,n$3=e$3&&"documentMode"in document?document.documentMode:null,r=e$3&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),i$2=e$3&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),s$2=!(!e$3||!("InputEvent"in window)||n$3)&&"getTargetRanges"in new window.InputEvent("input"),o$4=e$3&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),l$2=e$3&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,c$3=e$3&&/Android/.test(navigator.userAgent),a$4=e$3&&/^(?=.*Chrome).*/i.test(navigator.userAgent),u$2=e$3&&c$3&&a$4,f$5=e$3&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!a$4;function d$3(...t2){const e2=[];for(const n2 of t2)if(n2&&"string"==typeof n2)for(const[t3]of n2.matchAll(/\S+/g))e2.push(t3);return e2}const C$3=0,S$4=1,v$4=2,P$2=1,D$2=2,F$1=3,L$4=4,I$5=5,K$2=6,z$3=o$4||l$2||f$5?" ":"",R$5=i$2?" ":z$3,W$2={bold:1,capitalize:1024,code:16,highlight:128,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},J$6={directionless:1,unmergeable:2},$$3={center:2,end:6,justify:4,left:1,right:3,start:5},j$4={[D$2]:"center",[K$2]:"end",[L$4]:"justify",[P$2]:"left",[F$1]:"right",[I$5]:"start"},U$4={normal:0,segmented:2,token:1},V$2={[C$3]:"normal",[v$4]:"segmented",[S$4]:"token"};function q$2(t2,e2,n2,r2,i2,s2){let o2=t2.getFirstChild();for(;null!==o2;){const t3=o2.__key;o2.__parent===e2&&(hi(o2)&&q$2(o2,t3,n2,r2,i2,s2),n2.has(t3)||s2.delete(t3),i2.push(t3)),o2=o2.getNextSibling()}}let X$2=!1,Q$3=0;function Z$4(t2){Q$3=t2.timeStamp}function tt$3(t2,e2,n2){const r2="BR"===t2.nodeName,i2=e2.__lexicalLineBreak;return i2&&(t2===i2||r2&&t2.previousSibling===i2)||r2&&void 0!==ys(t2,n2)}function et$4(t2,e2,n2){const r2=ho(no(n2));let i2=null,s2=null;null!==r2&&r2.anchorNode===t2&&(i2=r2.anchorOffset,s2=r2.focusOffset);const o2=t2.nodeValue;null!==o2&&Ms(e2,o2,i2,s2,!1)}function nt$3(t2,e2,n2){if(ar(t2)){const e3=t2.anchor.getNode();if(e3.is(n2)&&t2.format!==e3.getFormat())return!1}return ss(e2)&&n2.isAttached()}function rt$4(t2,e2,n2,r2){for(let i2=t2;i2&&!Ao(i2);i2=qs(i2)){const t3=ys(i2,e2);if(void 0!==t3){const e3=_s(t3,n2);if(e3)return pi(e3)||!yo(i2)?void 0:[i2,e3]}else if(i2===r2)return[r2,vs(n2)]}}function it$3(t2,e2,n2){X$2=!0;const r2=performance.now()-Q$3>100;try{ai(t2,()=>{const s2=wr()||t2.getEditorState().read(()=>{const t4=wr();return null!==t4?t4.clone():null}),o2=new Map,l2=t2.getRootElement(),c2=t2._editorState,a2=t2._blockCursorElement;let u2=!1,f3="";for(let n3=0;n3<e2.length;n3++){const d3=e2[n3],h2=d3.type,g2=d3.target,_2=rt$4(g2,t2,c2,l2);if(!_2)continue;const[p2,y2]=_2;if("characterData"===h2)r2&&Zn(y2)&&ss(g2)&&nt$3(s2,g2,y2)&&et$4(g2,y2,t2);else if("childList"===h2){u2=!0;const e3=d3.addedNodes;for(let n5=0;n5<e3.length;n5++){const r4=e3[n5],s3=ps(r4),o3=r4.parentNode;if(null!=o3&&r4!==a2&&null===s3&&!tt$3(r4,o3,t2)){if(i$2){const t3=(yo(r4)?r4.innerText:null)||r4.nodeValue;t3&&(f3+=t3)}o3.removeChild(r4)}}const n4=d3.removedNodes,r3=n4.length;if(r3>0){let e4=0;for(let i2=0;i2<r3;i2++){const r4=n4[i2];(tt$3(r4,g2,t2)||a2===r4)&&(g2.appendChild(r4),e4++)}r3!==e4&&o2.set(p2,y2)}}}if(o2.size>0)for(const[e3,n3]of o2)n3.reconcileObservedMutation(e3,t2);const d2=n2.takeRecords();if(d2.length>0){for(let e3=0;e3<d2.length;e3++){const n3=d2[e3],r3=n3.addedNodes,i2=n3.target;for(let e4=0;e4<r3.length;e4++){const n4=r3[e4],s3=n4.parentNode;null==s3||"BR"!==n4.nodeName||tt$3(n4,i2,t2)||s3.removeChild(n4)}}n2.takeRecords()}null!==s2&&(u2&&ks(s2),i$2&&Us(t2)&&s2.insertRawText(f3))})}finally{X$2=!1}}function st$2(t2){const e2=t2._observer;null!==e2&&it$3(t2,e2.takeRecords(),e2)}function ot$2(t2){var t3;t3=t2,0===Q$3&&no(t3).addEventListener("textInput",Z$4,!0),t2._observer=new MutationObserver((e2,n2)=>{it$3(t2,e2,n2)})}function dt$2(t2){const e2=new Map,n2=new Set;for(let r2="function"==typeof t2?t2:t2.replace;r2.prototype&&void 0!==r2.prototype.getType;r2=Object.getPrototypeOf(r2)){const{ownNodeConfig:t3}=Do(r2);if(t3&&t3.stateConfigs)for(const r3 of t3.stateConfigs){let t4;"stateConfig"in r3?(t4=r3.stateConfig,r3.flat&&n2.add(t4.key)):t4=r3,e2.set(t4.key,t4)}}return{flatKeys:n2,sharedConfigMap:e2}}let ht$3=class ht{constructor(t2,e2,n2=void 0,r2=new Map,i2=void 0){this.node=t2,this.sharedNodeState=e2,this.unknownState=n2,this.knownState=r2;const{sharedConfigMap:s2}=this.sharedNodeState,o2=void 0!==i2?i2:function(t3,e3,n3){let r3=n3.size;if(e3)for(const i3 in e3){const e4=t3.get(i3);e4&&n3.has(e4)||r3++}return r3}(s2,n2,r2);this.size=o2}getValue(t2){const e2=this.knownState.get(t2);if(void 0!==e2)return e2;this.sharedNodeState.sharedConfigMap.set(t2.key,t2);let n2=t2.defaultValue;if(this.unknownState&&t2.key in this.unknownState){const e3=this.unknownState[t2.key];void 0!==e3&&(n2=t2.parse(e3)),this.updateFromKnown(t2,n2)}return n2}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){const t2={...this.unknownState},e2={};for(const[e3,n2]of this.knownState)e3.isEqual(n2,e3.defaultValue)?delete t2[e3.key]:t2[e3.key]=e3.unparse(n2);for(const n2 of this.sharedNodeState.flatKeys)n2 in t2&&(e2[n2]=t2[n2],delete t2[n2]);return pt$3(t2)&&(e2.$=t2),e2}getWritable(t2){if(this.node===t2)return this;const{sharedNodeState:e2,unknownState:n2}=this,r2=new Map(this.knownState);return new ht(t2,e2,function(t3,e3,n3){let r3;if(n3)for(const[i2,s2]of Object.entries(n3)){const n4=t3.get(i2);n4?e3.has(n4)||e3.set(n4,n4.parse(s2)):(r3=r3||{},r3[i2]=s2)}return r3}(e2.sharedConfigMap,r2,n2),r2,this.size)}updateFromKnown(t2,e2){const n2=t2.key;this.sharedNodeState.sharedConfigMap.set(n2,t2);const{knownState:r2,unknownState:i2}=this;r2.has(t2)||i2&&n2 in i2||(i2&&(delete i2[n2],this.unknownState=pt$3(i2)),this.size++),r2.set(t2,e2)}updateFromUnknown(t2,e2){const n2=this.sharedNodeState.sharedConfigMap.get(t2);n2?this.updateFromKnown(n2,n2.parse(e2)):(this.unknownState=this.unknownState||{},t2 in this.unknownState||this.size++,this.unknownState[t2]=e2)}updateFromJSON(t2){const{knownState:e2}=this;for(const t3 of e2.keys())e2.set(t3,t3.defaultValue);if(this.size=e2.size,this.unknownState=void 0,t2)for(const[e3,n2]of Object.entries(t2))this.updateFromUnknown(e3,n2)}};function _t$3(t2){return t2.__state?t2.__state.sharedNodeState:Hi(To(),t2.getType()).sharedNodeState}function pt$3(t2){if(t2)for(const e2 in t2)return t2}function mt$3(t2,e2,n2){for(const[r2,i2]of e2.knownState){if(t2.has(r2.key))continue;t2.add(r2.key);const e3=n2?n2.getValue(r2):r2.defaultValue;if(e3!==i2&&!r2.isEqual(e3,i2))return!0}return!1}function xt$2(t2,e2,n2){const{unknownState:r2}=e2,i2=n2?n2.unknownState:void 0;if(r2)for(const[e3,n3]of Object.entries(r2))if(!t2.has(e3)&&(t2.add(e3),n3!==(i2?i2[e3]:void 0)))return!0;return!1}function Ct$4(t2,e2){const n2=t2.__state;return n2&&n2.node===t2?n2.getWritable(e2):n2}function St$4(t2,e2){const n2=t2.__mode,r2=t2.__format,i2=t2.__style,s2=e2.__mode,o2=e2.__format,l2=e2.__style,c2=t2.__state,a2=e2.__state;return(null===n2||n2===s2)&&(null===r2||r2===o2)&&(null===i2||i2===l2)&&(null===t2.__state||c2===a2||function(t3,e3){if(t3===e3)return!0;if(t3&&e3&&t3.size!==e3.size)return!1;const n3=new Set;return!(t3&&mt$3(n3,t3,e3)||e3&&mt$3(n3,e3,t3)||t3&&xt$2(n3,t3,e3)||e3&&xt$2(n3,e3,t3))}(c2,a2))}function vt$4(t2,e2){const n2=t2.mergeWithSibling(e2),r2=Gr()._normalizedNodes;return r2.add(t2.__key),r2.add(e2.__key),n2}function kt$1(t2){let e2,n2,r2=t2;if(""!==r2.__text||!r2.isSimpleText()||r2.isUnmergeable()){for(;null!==(e2=r2.getPreviousSibling())&&Zn(e2)&&e2.isSimpleText()&&!e2.isUnmergeable();){if(""!==e2.__text){if(St$4(e2,r2)){r2=vt$4(e2,r2);break}break}e2.remove()}for(;null!==(n2=r2.getNextSibling())&&Zn(n2)&&n2.isSimpleText()&&!n2.isUnmergeable();){if(""!==n2.__text){if(St$4(r2,n2)){r2=vt$4(r2,n2);break}break}n2.remove()}}else r2.remove()}function Tt$3(t2){return Nt$3(t2.anchor),Nt$3(t2.focus),t2}function Nt$3(t2){for(;"element"===t2.type;){const e2=t2.getNode(),n2=t2.offset;let r2,i2;if(n2===e2.getChildrenSize()?(r2=e2.getChildAtIndex(n2-1),i2=!0):(r2=e2.getChildAtIndex(n2),i2=!1),Zn(r2)){t2.set(r2.__key,i2?r2.getTextContentSize():0,"text",!0);break}if(!hi(r2))break;t2.set(r2.__key,i2?r2.getChildrenSize():0,"element",!0)}}let bt$2,wt$3,Et$2,Ot$1,Mt$2,At$2,Pt$3,Dt$1,Ft$2,Lt$2,It$2="",Kt=null,zt="",Bt$1="",Rt$1=!1,Wt=!1;function Jt(t2,e2){const n2=Pt$3.get(t2);if(null!==e2){const n3=se(t2);n3.parentNode===e2&&e2.removeChild(n3)}if(Dt$1.has(t2)||wt$3._keyToDOMMap.delete(t2),hi(n2)){const t3=te(n2,Pt$3);$t$1(t3,0,t3.length-1,null)}void 0!==n2&&Ws(Lt$2,Et$2,Ot$1,n2,"destroyed")}function $t$1(t2,e2,n2,r2){let i2=e2;for(;i2<=n2;++i2){const e3=t2[i2];void 0!==e3&&Jt(e3,r2)}}function jt(t2,e2){t2.setProperty("text-align",e2)}const Ut="40px";function Vt(t2,e2){const n2=bt$2.theme.indent;if("string"==typeof n2){const r3=t2.classList.contains(n2);e2>0&&!r3?t2.classList.add(n2):e2<1&&r3&&t2.classList.remove(n2)}const r2=getComputedStyle(t2).getPropertyValue("--lexical-indent-base-value")||Ut;t2.style.setProperty("padding-inline-start",0===e2?"":`calc(${e2} * ${r2})`)}function Yt(t2,e2){const n2=t2.style;0===e2?jt(n2,""):1===e2?jt(n2,"left"):2===e2?jt(n2,"center"):3===e2?jt(n2,"right"):4===e2?jt(n2,"justify"):5===e2?jt(n2,"start"):6===e2&&jt(n2,"end")}function Ht(t2,e2){const n2=function(t3){const e3=t3.__dir;if(null!==e3)return e3;if(mi(t3))return null;const n3=t3.getParentOrThrow();return mi(n3)&&null===n3.__dir?"auto":null}(e2);null!==n2?t2.dir=n2:t2.removeAttribute("dir")}function qt(e2,n2){const r2=Dt$1.get(e2);void 0===r2&&t$2(60);const i2=r2.createDOM(bt$2,wt$3);if(function(t2,e3,n3){const r3=n3._keyToDOMMap;var n4;n4=t2,e3[`__lexicalKey_${n3._key}`]=n4,r3.set(t2,e3)}(e2,i2,wt$3),Zn(r2)?i2.setAttribute("data-lexical-text","true"):pi(r2)&&i2.setAttribute("data-lexical-decorator","true"),hi(r2)){const t2=r2.__indent,e3=r2.__size;if(Ht(i2,r2),0!==t2&&Vt(i2,t2),0!==e3){const t3=e3-1;Gt(te(r2,Dt$1),r2,0,t3,r2.getDOMSlot(i2))}const n3=r2.__format;0!==n3&&Yt(i2,n3),r2.isInline()||Qt(null,r2,i2),Ys(r2)&&(It$2+="\n\n",Bt$1+="\n\n")}else{const t2=r2.getTextContent();if(pi(r2)){const t3=r2.decorate(wt$3,bt$2);null!==t3&&ne(e2,t3),i2.contentEditable="false"}It$2+=t2,Bt$1+=t2}return null!==n2&&n2.insertChild(i2),Ws(Lt$2,Et$2,Ot$1,r2,"created"),i2}function Gt(t2,e2,n2,r2,i2){const s2=It$2;It$2="";let o2=n2;for(;o2<=r2;++o2){qt(t2[o2],i2);const e3=Dt$1.get(t2[o2]);null!==e3&&Zn(e3)&&(null===Kt&&(Kt=e3.getFormat()),""===zt&&(zt=e3.getStyle()))}Ys(e2)&&(It$2+="\n\n"),i2.element.__lexicalTextContent=It$2,It$2=s2+It$2}function Xt(t2,e2){if(t2){const n2=t2.__last;if(n2){const t3=e2.get(n2);if(t3)return Ln(t3)?"line-break":pi(t3)&&t3.isInline()?"decorator":null}return"empty"}return null}function Qt(t2,e2,n2){const r2=Xt(t2,Pt$3),i2=Xt(e2,Dt$1);r2!==i2&&e2.getDOMSlot(n2).setManagedLineBreak(i2)}function te(e2,n2){const r2=[];let i2=e2.__first;for(;null!==i2;){const e3=n2.get(i2);void 0===e3&&t$2(101),r2.push(i2),i2=e3.__next}return r2}function ee$1(e2,n2){const r2=Pt$3.get(e2);let i2=Dt$1.get(e2);void 0!==r2&&void 0!==i2||t$2(61);const s2=Rt$1||At$2.has(e2)||Mt$2.has(e2),o2=Hs(wt$3,e2);if(r2===i2&&!s2){if(hi(r2)){const t2=o2.__lexicalTextContent;void 0!==t2&&(It$2+=t2,Bt$1+=t2)}else{const t2=r2.getTextContent();Bt$1+=t2,It$2+=t2}return o2}if(r2!==i2&&s2&&Ws(Lt$2,Et$2,Ot$1,i2,"updated"),i2.updateDOM(r2,o2,bt$2)){const r3=qt(e2,null);return null===n2&&t$2(62),n2.replaceChild(r3,o2),Jt(e2,null),r3}if(hi(r2)&&hi(i2)){const t2=i2.__indent;(Rt$1||t2!==r2.__indent)&&Vt(o2,t2);const e3=i2.__format;if((Rt$1||e3!==r2.__format)&&Yt(o2,e3),s2&&(function(e2,n2,r2){var i2,t2;Kt=null,zt="",function(e3,n3,r3){const i3=It$2,s2=e3.__size,o2=n3.__size;It$2="";const l2=r3.element;if(1===s2&&1===o2){const t2=e3.__first,r4=n3.__first;if(t2===r4)ee$1(t2,l2);else{const e4=se(t2),n4=qt(r4,null);try{l2.replaceChild(n4,e4)}catch(i5){if("object"==typeof i5&&null!=i5){const s3=`${i5.toString()} Parent: ${l2.tagName}, new child: {tag: ${n4.tagName} key: ${r4}}, old child: {tag: ${e4.tagName}, key: ${t2}}.`;throw new Error(s3)}throw i5}Jt(t2,null)}const i4=Dt$1.get(r4);Zn(i4)&&(null===Kt&&(Kt=i4.getFormat()),""===zt&&(zt=i4.getStyle()))}else{const i4=te(e3,Pt$3),c2=te(n3,Dt$1);if(i4.length!==s2&&t$2(227),c2.length!==o2&&t$2(228),0===s2)0!==o2&&Gt(c2,n3,0,o2-1,r3);else if(0===o2){if(0!==s2){const t2=null==r3.after&&null==r3.before&&null==r3.element.__lexicalLineBreak;$t$1(i4,0,s2-1,t2?null:l2),t2&&(l2.textContent="")}}else!function(t2,e4,n4,r4,i5,s3){const o3=r4-1,l3=i5-1;let c3,a2,u2=s3.getFirstChild(),f3=0,d2=0;for(;f3<=o3&&d2<=l3;){const t3=e4[f3],r5=n4[d2];if(t3===r5)u2=re(ee$1(r5,s3.element)),f3++,d2++;else{void 0===c3&&(c3=new Set(e4)),void 0===a2&&(a2=new Set(n4));const i7=a2.has(t3),o4=c3.has(r5);if(i7)if(o4){const t4=Hs(wt$3,r5);t4===u2?u2=re(ee$1(r5,s3.element)):(s3.withBefore(u2).insertChild(t4),ee$1(r5,s3.element)),f3++,d2++}else qt(r5,s3.withBefore(u2)),d2++;else u2=re(se(t3)),Jt(t3,s3.element),f3++}const i6=Dt$1.get(r5);null!==i6&&Zn(i6)&&(null===Kt&&(Kt=i6.getFormat()),""===zt&&(zt=i6.getStyle()))}const h2=f3>o3,g2=d2>l3;if(h2&&!g2){const e5=n4[l3+1],r5=void 0===e5?null:wt$3.getElementByKey(e5);Gt(n4,t2,d2,l3,s3.withBefore(r5))}else g2&&!h2&&$t$1(e4,f3,o3,s3.element)}(n3,i4,c2,s2,o2,r3)}Ys(n3)&&(It$2+="\n\n"),l2.__lexicalTextContent=It$2,It$2=i3+It$2}(e2,n2,n2.getDOMSlot(r2)),i2=n2,null==Kt||Kt===i2.__textFormat||Wt||i2.setTextFormat(Kt),t2=n2,""===zt||zt===t2.__textStyle||Wt||t2.setTextStyle(zt)}(r2,i2,o2),mi(i2)||i2.isInline()||Qt(r2,i2,o2)),Ys(i2)&&(It$2+="\n\n",Bt$1+="\n\n"),(Rt$1||i2.__dir!==r2.__dir)&&(Ht(o2,i2),mi(i2)&&!Rt$1))for(const t3 of i2.getChildren())hi(t3)&&Ht(Hs(wt$3,t3.getKey()),t3)}else{const t2=i2.getTextContent();if(pi(i2)){const t3=i2.decorate(wt$3,bt$2);null!==t3&&ne(e2,t3)}It$2+=t2,Bt$1+=t2}if(!Wt&&mi(i2)&&i2.__cachedText!==Bt$1){const t2=i2.getWritable();t2.__cachedText=Bt$1,i2=t2}return o2}function ne(t2,e2){let n2=wt$3._pendingDecorators;const r2=wt$3._decorators;if(null===n2){if(r2[t2]===e2)return;n2=xs(wt$3)}n2[t2]=e2}function re(t2){let e2=t2.nextSibling;return null!==e2&&e2===wt$3._blockCursorElement&&(e2=e2.nextSibling),e2}function se(e2){const n2=Ft$2.get(e2);return void 0===n2&&t$2(75,e2),n2}function oe$1(t2){return{type:t2}}const le=oe$1("SELECTION_CHANGE_COMMAND"),ce=oe$1("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),ae=oe$1("CLICK_COMMAND"),ue=oe$1("DELETE_CHARACTER_COMMAND"),fe=oe$1("INSERT_LINE_BREAK_COMMAND"),de=oe$1("INSERT_PARAGRAPH_COMMAND"),he=oe$1("CONTROLLED_TEXT_INSERTION_COMMAND"),ge=oe$1("PASTE_COMMAND"),_e=oe$1("REMOVE_TEXT_COMMAND"),pe=oe$1("DELETE_WORD_COMMAND"),ye=oe$1("DELETE_LINE_COMMAND"),me=oe$1("FORMAT_TEXT_COMMAND"),xe=oe$1("UNDO_COMMAND"),Ce=oe$1("REDO_COMMAND"),Se=oe$1("KEYDOWN_COMMAND"),ve=oe$1("KEY_ARROW_RIGHT_COMMAND"),ke=oe$1("MOVE_TO_END"),Te=oe$1("KEY_ARROW_LEFT_COMMAND"),Ne=oe$1("MOVE_TO_START"),be=oe$1("KEY_ARROW_UP_COMMAND"),we=oe$1("KEY_ARROW_DOWN_COMMAND"),Ee=oe$1("KEY_ENTER_COMMAND"),Oe=oe$1("KEY_SPACE_COMMAND"),Me=oe$1("KEY_BACKSPACE_COMMAND"),Ae=oe$1("KEY_ESCAPE_COMMAND"),Pe=oe$1("KEY_DELETE_COMMAND"),De=oe$1("KEY_TAB_COMMAND"),Fe=oe$1("INSERT_TAB_COMMAND"),Le=oe$1("INDENT_CONTENT_COMMAND"),Ie=oe$1("OUTDENT_CONTENT_COMMAND"),Ke=oe$1("DROP_COMMAND"),ze=oe$1("FORMAT_ELEMENT_COMMAND"),Be=oe$1("DRAGSTART_COMMAND"),Re=oe$1("DRAGOVER_COMMAND"),We=oe$1("DRAGEND_COMMAND"),Je=oe$1("COPY_COMMAND"),$e=oe$1("CUT_COMMAND"),je=oe$1("SELECT_ALL_COMMAND"),Ue=oe$1("CLEAR_EDITOR_COMMAND"),Ve=oe$1("CLEAR_HISTORY_COMMAND"),Ye=oe$1("CAN_REDO_COMMAND"),He=oe$1("CAN_UNDO_COMMAND"),qe=oe$1("FOCUS_COMMAND"),Ge=oe$1("BLUR_COMMAND"),Xe=oe$1("KEY_MODIFIER_COMMAND"),Qe=Object.freeze({}),tn=[["keydown",function(t2,e2){if(!(en=t2.timeStamp,nn=t2.key,e2.isComposing()||Vs(e2,Se,t2)||null==t2.key)){if(fn&&Ks(t2))return ai(e2,()=>{Sn(e2,dn)}),fn=!1,void(dn="");if(Fs(t2,"ArrowRight",{shiftKey:"any"}))Vs(e2,ve,t2);else if(function(t3){return Fs(t3,"ArrowRight",Ls)}(t2))Vs(e2,ke,t2);else if(function(t3){return Fs(t3,"ArrowLeft",{shiftKey:"any"})}(t2))Vs(e2,Te,t2);else if(function(t3){return Fs(t3,"ArrowLeft",Ls)}(t2))Vs(e2,Ne,t2);else if(function(t3){return Fs(t3,"ArrowUp",{altKey:"any",shiftKey:"any"})}(t2))Vs(e2,be,t2);else if(function(t3){return Fs(t3,"ArrowDown",{altKey:"any",shiftKey:"any"})}(t2))Vs(e2,we,t2);else if(function(t3){return Fs(t3,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:!0})}(t2))an=!0,Vs(e2,Ee,t2);else if(function(t3){return" "===t3.key}(t2))Vs(e2,Oe,t2);else if(function(t3){return r&&Fs(t3,"o",{ctrlKey:!0})}(t2))t2.preventDefault(),an=!0,Vs(e2,fe,!0);else if(function(t3){return Fs(t3,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any"})}(t2))an=!1,Vs(e2,Ee,t2);else if(function(t3){return Fs(t3,"Backspace",{shiftKey:"any"})||r&&Fs(t3,"h",{ctrlKey:!0})}(t2))Ks(t2)?Vs(e2,Me,t2):(t2.preventDefault(),Vs(e2,ue,!0));else if(function(t3){return"Escape"===t3.key}(t2))Vs(e2,Ae,t2);else if(function(t3){return Fs(t3,"Delete",{})||r&&Fs(t3,"d",{ctrlKey:!0})}(t2))!function(t3){return"Delete"===t3.key}(t2)?(t2.preventDefault(),Vs(e2,ue,!1)):Vs(e2,Pe,t2);else if(function(t3){return Fs(t3,"Backspace",Is)}(t2))t2.preventDefault(),Vs(e2,pe,!0);else if(function(t3){return Fs(t3,"Delete",Is)}(t2))t2.preventDefault(),Vs(e2,pe,!1);else if(function(t3){return r&&Fs(t3,"Backspace",{metaKey:!0})}(t2))t2.preventDefault(),Vs(e2,ye,!0);else if(function(t3){return r&&(Fs(t3,"Delete",{metaKey:!0})||Fs(t3,"k",{ctrlKey:!0}))}(t2))t2.preventDefault(),Vs(e2,ye,!1);else if(function(t3){return Fs(t3,"b",Ls)}(t2))t2.preventDefault(),Vs(e2,me,"bold");else if(function(t3){return Fs(t3,"u",Ls)}(t2))t2.preventDefault(),Vs(e2,me,"underline");else if(function(t3){return Fs(t3,"i",Ls)}(t2))t2.preventDefault(),Vs(e2,me,"italic");else if(function(t3){return Fs(t3,"Tab",{shiftKey:"any"})}(t2))Vs(e2,De,t2);else if(function(t3){return Fs(t3,"z",Ls)}(t2))t2.preventDefault(),Vs(e2,xe,void 0);else if(function(t3){return r?Fs(t3,"z",{metaKey:!0,shiftKey:!0}):Fs(t3,"y",{ctrlKey:!0})||Fs(t3,"z",{ctrlKey:!0,shiftKey:!0})}(t2))t2.preventDefault(),Vs(e2,Ce,void 0);else{const n2=e2._editorState._selection;null===n2||ar(n2)?zs(t2)&&(t2.preventDefault(),Vs(e2,je,t2)):function(t3){return Fs(t3,"c",Ls)}(t2)?(t2.preventDefault(),Vs(e2,Je,t2)):function(t3){return Fs(t3,"x",Ls)}(t2)?(t2.preventDefault(),Vs(e2,$e,t2)):zs(t2)&&(t2.preventDefault(),Vs(e2,je,t2))}(function(t3){return t3.ctrlKey||t3.shiftKey||t3.altKey||t3.metaKey})(t2)&&Vs(e2,Xe,t2)}}],["pointerdown",function(t2,e2){const n2=t2.target,r2=t2.pointerType;mo(n2)&&"touch"!==r2&&"pen"!==r2&&0===t2.button&&ai(e2,()=>{Xi(n2)||(cn=!0)})}],["compositionstart",function(t2,e2){ai(e2,()=>{const n2=wr();if(ar(n2)&&!e2.isComposing()){const r2=n2.anchor,i2=n2.anchor.getNode();hs(r2.key),(t2.timeStamp<en+30||"element"===r2.type||!n2.isCollapsed()||i2.getFormat()!==n2.format||Zn(i2)&&i2.getStyle()!==n2.style)&&Vs(e2,he,R$5)}})}],["compositionend",function(t2,e2){i$2?un=!0:l$2||!o$4&&!f$5?ai(e2,()=>{Sn(e2,t2.data)}):(fn=!0,dn=t2.data)}],["input",function(t2,e2){t2.stopPropagation(),ai(e2,()=>{if(yo(t2.target)&&Xi(t2.target))return;const n2=wr(),r2=t2.data,c2=Cn(t2);if(null!=r2&&ar(n2)&&_n(n2,c2,r2,t2.timeStamp,!1)){un&&(Sn(e2,r2),un=!1);const c3=n2.anchor.getNode(),a2=ho(no(e2));if(null===a2)return;const u2=n2.isBackward(),d2=u2?n2.anchor.offset:n2.focus.offset,h2=u2?n2.focus.offset:n2.anchor.offset;s$2&&!n2.isCollapsed()&&Zn(c3)&&null!==a2.anchorNode&&c3.getTextContent().slice(0,d2)+r2+c3.getTextContent().slice(d2+h2)===Es(a2.anchorNode)||Vs(e2,he,r2);const g2=r2.length;i$2&&g2>1&&"insertCompositionText"===t2.inputType&&!e2.isComposing()&&(n2.anchor.offset-=g2),o$4||l$2||f$5||!e2.isComposing()||(en=0,hs(null))}else Os(!1,e2,null!==r2?r2:void 0),un&&(Sn(e2,r2||void 0),un=!1);!function(){Yr();st$2(Gr())}()},{event:t2}),sn=null}],["click",function(t2,e2){ai(e2,()=>{const n2=wr(),r2=ho(no(e2)),i2=Er();if(r2)if(ar(n2)){const e3=n2.anchor,s2=e3.getNode();if("element"===e3.type&&0===e3.offset&&n2.isCollapsed()&&!mi(s2)&&1===Ss().getChildrenSize()&&s2.getTopLevelElementOrThrow().isEmpty()&&null!==i2&&n2.is(i2))r2.removeAllRanges(),n2.dirty=!0;else if(3===t2.detail&&!n2.isCollapsed()&&s2!==n2.focus.getNode()){const t3=function(t4,e4){let n3=t4;for(;n3!==Ss()&&null!=n3;){if(e4(n3))return n3;n3=n3.getParent()}return null}(s2,t4=>hi(t4)&&!t4.isInline());hi(t3)&&t3.select(0)}}else if("touch"===t2.pointerType||"pen"===t2.pointerType){const n3=r2.anchorNode;(yo(n3)||ss(n3))&&ks(br(i2,r2,e2,t2))}Vs(e2,ae,t2)})}],["cut",Qe],["copy",Qe],["dragstart",Qe],["dragover",Qe],["dragend",Qe],["paste",Qe],["focus",Qe],["blur",Qe],["drop",Qe]];s$2&&tn.push(["beforeinput",(e2,n2)=>function(e3,n3){const r2=e3.inputType,s2=Cn(e3);"deleteCompositionText"===r2||i$2&&Us(n3)||"insertCompositionText"!==r2&&ai(n3,()=>{const i2=wr();if("deleteContentBackward"===r2){if(null===i2){const t2=Er();if(!ar(t2))return;ks(t2.clone())}if(ar(i2)){const r3=i2.anchor.key===i2.focus.key;if(o2=e3.timeStamp,"MediaLast"===nn&&o2<en+30&&n3.isComposing()&&r3){if(hs(null),en=0,setTimeout(()=>{ai(n3,()=>{hs(null)})},30),ar(i2)){const e4=i2.anchor.getNode();e4.markDirty(),Zn(e4)||t$2(142),xn(i2,e4)}}else{hs(null),e3.preventDefault();const t2=i2.anchor.getNode(),s3=t2.getTextContent(),o3=t2.canInsertTextAfter(),l2=0===i2.anchor.offset&&i2.focus.offset===s3.length;let c3=u$2&&r3&&!l2&&o3;if(c3&&i2.isCollapsed()&&(c3=!pi(js(i2.anchor,!0))),!c3){Vs(n3,ue,!0);const t3=wr();u$2&&ar(t3)&&t3.isCollapsed()&&(hn=t3,setTimeout(()=>hn=null))}}return}}var o2;if(!ar(i2))return;const c2=e3.data;null!==sn&&Os(!1,n3,sn),i2.dirty&&null===sn||!i2.isCollapsed()||mi(i2.anchor.getNode())||null===s2||i2.applyDOMRange(s2),sn=null;const a2=i2.anchor,f3=i2.focus,d2=a2.getNode(),h2=f3.getNode();if("insertText"!==r2&&"insertTranspose"!==r2)switch(e3.preventDefault(),r2){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":Vs(n3,he,e3);break;case"insertFromComposition":hs(null),Vs(n3,he,e3);break;case"insertLineBreak":hs(null),Vs(n3,fe,!1);break;case"insertParagraph":hs(null),an&&!l$2?(an=!1,Vs(n3,fe,!1)):Vs(n3,de,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":Vs(n3,ge,e3);break;case"deleteByComposition":((t2=d2)!==(e4=h2)||hi(t2)||hi(e4)||!rs(t2)||!rs(e4))&&Vs(n3,_e,e3);break;case"deleteByDrag":case"deleteByCut":Vs(n3,_e,e3);break;case"deleteContent":Vs(n3,ue,!1);break;case"deleteWordBackward":Vs(n3,pe,!0);break;case"deleteWordForward":Vs(n3,pe,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":Vs(n3,ye,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":Vs(n3,ye,!1);break;case"formatStrikeThrough":Vs(n3,me,"strikethrough");break;case"formatBold":Vs(n3,me,"bold");break;case"formatItalic":Vs(n3,me,"italic");break;case"formatUnderline":Vs(n3,me,"underline");break;case"historyUndo":Vs(n3,xe,void 0);break;case"historyRedo":Vs(n3,Ce,void 0)}else{if("\n"===c2)e3.preventDefault(),Vs(n3,fe,!1);else if("\n\n"===c2)e3.preventDefault(),Vs(n3,de,void 0);else if(null==c2&&e3.dataTransfer){const t2=e3.dataTransfer.getData("text/plain");e3.preventDefault(),i2.insertRawText(t2)}else null!=c2&&_n(i2,s2,c2,e3.timeStamp,!0)?(e3.preventDefault(),Vs(n3,he,c2)):sn=c2;rn=e3.timeStamp}var t2,e4})}(e2,n2)]);let en=0,nn=null,rn=0,sn=null;const on=new WeakMap;let ln=!1,cn=!1,an=!1,un=!1,fn=!1,dn="",hn=null,gn=[0,"",0,"root",0];function _n(t2,e2,n2,r2,i2){const o2=t2.anchor,l2=t2.focus,c2=o2.getNode(),a2=Gr(),u2=ho(no(a2)),f3=null!==u2?u2.anchorNode:null,d2=o2.key,h2=a2.getElementByKey(d2),g2=n2.length;return d2!==l2.key||!Zn(c2)||(!i2&&(!s$2||rn<r2+50)||c2.isDirty()&&g2<2||Ns(n2))&&o2.offset!==l2.offset&&!c2.isComposing()||is(c2)||c2.isDirty()&&g2>1||(i2||!s$2)&&null!==h2&&!c2.isComposing()&&f3!==ls(h2)||null!==u2&&null!==e2&&(!e2.collapsed||e2.startContainer!==u2.anchorNode||e2.startOffset!==u2.anchorOffset)||c2.getFormat()!==t2.format||c2.getStyle()!==t2.style||function(t3,e3){if(e3.isSegmented())return!0;if(!t3.isCollapsed())return!1;const n3=t3.anchor.offset,r3=e3.getParentOrThrow(),i3=rs(e3);return 0===n3?!e3.canInsertTextBefore()||!r3.canInsertTextBefore()&&!e3.isComposing()||i3||function(t4){const e4=t4.getPreviousSibling();return(Zn(e4)||hi(e4)&&e4.isInline())&&!e4.canInsertTextAfter()}(e3):n3===e3.getTextContentSize()&&(!e3.canInsertTextAfter()||!r3.canInsertTextAfter()&&!e3.isComposing()||i3)}(t2,c2)}function pn(t2,e2){return ss(t2)&&null!==t2.nodeValue&&0!==e2&&e2!==t2.nodeValue.length}function yn(e2,n2,r2){const{anchorNode:i2,anchorOffset:s2,focusNode:o2,focusOffset:l2}=e2;ln&&(ln=!1,pn(i2,s2)&&pn(o2,l2)&&!hn)||ai(n2,()=>{if(!r2)return void ks(null);if(!Zi(n2,i2,o2))return;let c2=wr();if(hn&&ar(c2)&&c2.isCollapsed()){const t2=c2.anchor,e3=hn.anchor;(t2.key===e3.key&&t2.offset===e3.offset+1||1===t2.offset&&e3.getNode().is(t2.getNode().getPreviousSibling()))&&(c2=hn.clone(),ks(c2))}if(hn=null,ar(c2)){const r3=c2.anchor,i3=r3.getNode();if(c2.isCollapsed()){"Range"===e2.type&&e2.anchorNode===e2.focusNode&&(c2.dirty=!0);const s3=no(n2).event,o3=s3?s3.timeStamp:performance.now(),[l3,a2,u2,f3,d2]=gn,h2=Ss(),g2=!1===n2.isComposing()&&""===h2.getTextContent();if(o3<d2+200&&r3.offset===u2&&r3.key===f3)mn(c2,l3,a2);else if("text"===r3.type)Zn(i3)||t$2(141),xn(c2,i3);else if("element"===r3.type&&!g2){hi(i3)||t$2(259);const e3=r3.getNode();e3.isEmpty()?mn(c2,(e4=e3).getTextFormat(),e4.getTextStyle()):mn(c2,0,"")}}else{const t2=r3.key,e3=c2.focus.key,n3=c2.getNodes(),i4=n3.length,o3=c2.isBackward(),a2=o3?l2:s2,u2=o3?s2:l2,f3=o3?e3:t2,d2=o3?t2:e3;let h2=2047,g2=!1;for(let t3=0;t3<i4;t3++){const e4=n3[t3],r4=e4.getTextContentSize();if(Zn(e4)&&0!==r4&&!(0===t3&&e4.__key===f3&&a2===r4||t3===i4-1&&e4.__key===d2&&0===u2)&&(g2=!0,h2&=e4.getFormat(),0===h2))break}c2.format=g2?h2:0}}var e4;Vs(n2,le,void 0)})}function mn(t2,e2,n2){t2.format===e2&&t2.style===n2||(t2.format=e2,t2.style=n2,t2.dirty=!0)}function xn(t2,e2){mn(t2,e2.getFormat(),e2.getStyle())}function Cn(t2){if(!t2.getTargetRanges)return null;const e2=t2.getTargetRanges();return 0===e2.length?null:e2[0]}function Sn(t2,e2){const n2=t2._compositionKey;if(hs(null),null!==n2&&null!=e2){if(""===e2){const e3=_s(n2),r2=ls(t2.getElementByKey(n2));return void(null!==r2&&null!==r2.nodeValue&&Zn(e3)&&Ms(e3,r2.nodeValue,null,null,!0))}if("\n"===e2[e2.length-1]){const e3=wr();if(ar(e3)){const n3=e3.focus;return e3.anchor.set(n3.key,n3.offset,n3.type),void Vs(t2,Ee,null)}}}Os(!0,t2,e2)}function vn(t2){let e2=t2.__lexicalEventHandles;return void 0===e2&&(e2=[],t2.__lexicalEventHandles=e2),e2}const kn=new Map;function Tn(t2){const e2=function(t2){const e2=eo(t2);return e2?e2.getSelection():null}(t2.target);if(null===e2)return;const n2=es(e2.anchorNode);if(null===n2)return;cn&&(cn=!1,ai(n2,()=>{const r3=Er(),i3=e2.anchorNode;(yo(i3)||ss(i3))&&ks(br(r3,e2,n2,t2))}));const r2=bs(n2),i2=r2[r2.length-1],s2=i2._key,o2=kn.get(s2),l2=o2||i2;l2!==n2&&yn(e2,l2,!1),yn(e2,n2,!0),n2!==i2?kn.set(s2,n2):o2&&kn.delete(s2)}function Nn(t2){t2._lexicalHandled=!0}function bn(t2){return!0===t2._lexicalHandled}function On(t2,e2,n2){Yr();const r2=t2.__key,i2=t2.getParent();if(null===i2)return;const s2=function(t3){const e3=wr();if(!ar(e3)||!hi(t3))return e3;const{anchor:n3,focus:r3}=e3,i3=n3.getNode(),s3=r3.getNode();return to(i3,t3)&&n3.set(t3.__key,0,"element"),to(s3,t3)&&r3.set(t3.__key,0,"element"),e3}(t2);let o2=!1;if(ar(s2)&&e2){const e3=s2.anchor,n3=s2.focus;e3.key===r2&&(Ar(e3,t2,i2,t2.getPreviousSibling(),t2.getNextSibling()),o2=!0),n3.key===r2&&(Ar(n3,t2,i2,t2.getPreviousSibling(),t2.getNextSibling()),o2=!0)}else fr(s2)&&e2&&t2.isSelected()&&t2.selectPrevious();if(ar(s2)&&e2&&!o2){const e3=t2.getIndexWithinParent();fs(t2),Or(s2,i2,e3,-1)}else fs(t2);n2||so(i2)||i2.canBeEmpty()||!i2.isEmpty()||On(i2,e2),e2&&s2&&mi(i2)&&i2.isEmpty()&&i2.selectEnd()}class An{static getType(){const{ownNodeType:e2}=Do(this);return void 0===e2&&t$2(64,this.name),e2}static clone(e2){t$2(65,this.name)}$config(){return{}}config(t2,e2){const n2=e2.extends||Object.getPrototypeOf(this.constructor);return Object.assign(e2,{extends:n2,type:t2}),{[t2]:e2}}afterCloneFrom(t2){this.__key===t2.__key?(this.__parent=t2.__parent,this.__next=t2.__next,this.__prev=t2.__prev,this.__state=t2.__state):t2.__state&&(this.__state=t2.__state.getWritable(this))}constructor(t2){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",{configurable:!0,enumerable:!1,value:void 0,writable:!0}),us(this,t2)}getType(){return this.__type}isInline(){t$2(137,this.constructor.name)}isAttached(){let t2=this.__key;for(;null!==t2;){if("root"===t2)return!0;const e2=_s(t2);if(null===e2)break;t2=e2.__parent}return!1}isSelected(t2){const e2=t2||wr();if(null==e2)return!1;const n2=e2.getNodes().some(t3=>t3.__key===this.__key);if(Zn(this))return n2;if(ar(e2)&&"element"===e2.anchor.type&&"element"===e2.focus.type){if(e2.isCollapsed())return!1;const t3=this.getParent();if(pi(this)&&this.isInline()&&t3){const n3=e2.isBackward()?e2.focus:e2.anchor;if(t3.is(n3.getNode())&&n3.offset===t3.getChildrenSize()&&this.is(t3.getLastChild()))return!1}}return n2}getKey(){return this.__key}getIndexWithinParent(){const t2=this.getParent();if(null===t2)return-1;let e2=t2.getFirstChild(),n2=0;for(;null!==e2;){if(this.is(e2))return n2;n2++,e2=e2.getNextSibling()}return-1}getParent(){const t2=this.getLatest().__parent;return null===t2?null:_s(t2)}getParentOrThrow(){const e2=this.getParent();return null===e2&&t$2(66,this.__key),e2}getTopLevelElement(){let e2=this;for(;null!==e2;){const n2=e2.getParent();if(so(n2))return hi(e2)||e2===this&&pi(e2)||t$2(194),e2;e2=n2}return null}getTopLevelElementOrThrow(){const e2=this.getTopLevelElement();return null===e2&&t$2(67,this.__key),e2}getParents(){const t2=[];let e2=this.getParent();for(;null!==e2;)t2.push(e2),e2=e2.getParent();return t2}getParentKeys(){const t2=[];let e2=this.getParent();for(;null!==e2;)t2.push(e2.__key),e2=e2.getParent();return t2}getPreviousSibling(){const t2=this.getLatest().__prev;return null===t2?null:_s(t2)}getPreviousSiblings(){const t2=[],e2=this.getParent();if(null===e2)return t2;let n2=e2.getFirstChild();for(;null!==n2&&!n2.is(this);)t2.push(n2),n2=n2.getNextSibling();return t2}getNextSibling(){const t2=this.getLatest().__next;return null===t2?null:_s(t2)}getNextSiblings(){const t2=[];let e2=this.getNextSibling();for(;null!==e2;)t2.push(e2),e2=e2.getNextSibling();return t2}getCommonAncestor(t2){const e2=hi(this)?this:this.getParent(),n2=hi(t2)?t2:t2.getParent(),r2=e2&&n2?gl(e2,n2):null;return r2?r2.commonAncestor:null}is(t2){return null!=t2&&this.__key===t2.__key}isBefore(e2){const n2=gl(this,e2);return null!==n2&&("descendant"===n2.type||("branch"===n2.type?-1===fl(n2):("same"!==n2.type&&"ancestor"!==n2.type&&t$2(279),!1)))}isParentOf(t2){const e2=gl(this,t2);return null!==e2&&"ancestor"===e2.type}getNodesBetween(e2){const n2=this.isBefore(e2),r2=[],i2=new Set;let s2=this;for(;null!==s2;){const o2=s2.__key;if(i2.has(o2)||(i2.add(o2),r2.push(s2)),s2===e2)break;const l2=hi(s2)?n2?s2.getFirstChild():s2.getLastChild():null;if(null!==l2){s2=l2;continue}const c2=n2?s2.getNextSibling():s2.getPreviousSibling();if(null!==c2){s2=c2;continue}const a2=s2.getParentOrThrow();if(i2.has(a2.__key)||r2.push(a2),a2===e2)break;let u2=null,f3=a2;do{if(null===f3&&t$2(68),u2=n2?f3.getNextSibling():f3.getPreviousSibling(),f3=f3.getParent(),null===f3)break;null!==u2||i2.has(f3.__key)||r2.push(f3)}while(null===u2);s2=u2}return n2||r2.reverse(),r2}isDirty(){const t2=Gr()._dirtyLeaves;return null!==t2&&t2.has(this.__key)}getLatest(){const e2=_s(this.__key);return null===e2&&t$2(113),e2}getWritable(){Yr();const t2=qr(),e2=Gr(),n2=t2._nodeMap,r2=this.__key,i2=this.getLatest(),s2=e2._cloneNotNeeded,o2=wr();if(null!==o2&&o2.setCachedNodes(null),s2.has(r2))return ds(i2),i2;const l2=Eo(i2);return s2.add(r2),ds(l2),n2.set(r2,l2),l2}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(e2,n2){t$2(70)}updateDOM(e2,n2,r2){t$2(71)}exportDOM(t2){return{element:this.createDOM(t2._config,t2)}}exportJSON(){const t2=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...t2}}static importJSON(e2){t$2(18,this.name)}updateFromJSON(t2){return function(t3,e2){const n2=t3.getWritable(),r2=e2.$;let i2=r2;for(const t4 of _t$3(n2).flatKeys)t4 in e2&&(void 0!==i2&&i2!==r2||(i2={...r2}),i2[t4]=e2[t4]);return(n2.__state||i2)&&function(t2){const e2=t2.getWritable(),n2=e2.__state?e2.__state.getWritable(e2):new ht$3(e2,_t$3(e2));return e2.__state=n2,n2}(t3).updateFromJSON(i2),n2}(this,t2)}static transform(){return null}remove(t2){On(this,!0,t2)}replace(e2,n2){Yr();let r2=wr();null!==r2&&(r2=r2.clone()),co(this,e2);const i2=this.getLatest(),s2=this.__key,o2=e2.__key,l2=e2.getWritable(),c2=this.getParentOrThrow().getWritable(),a2=c2.__size;fs(l2);const u2=i2.getPreviousSibling(),f3=i2.getNextSibling(),d2=i2.__prev,h2=i2.__next,g2=i2.__parent;if(On(i2,!1,!0),null===u2?c2.__first=o2:u2.getWritable().__next=o2,l2.__prev=d2,null===f3?c2.__last=o2:f3.getWritable().__prev=o2,l2.__next=h2,l2.__parent=g2,c2.__size=a2,n2&&(hi(this)&&hi(l2)||t$2(139),this.getChildren().forEach(t2=>{l2.append(t2)})),ar(r2)){ks(r2);const t2=r2.anchor,e3=r2.focus;t2.key===s2&&lr(t2,l2),e3.key===s2&&lr(e3,l2)}return gs()===s2&&hs(o2),l2}insertAfter(t2,e2=!0){Yr(),co(this,t2);const n2=this.getWritable(),r2=t2.getWritable(),i2=r2.getParent(),s2=wr();let o2=!1,l2=!1;if(null!==i2){const e3=t2.getIndexWithinParent();if(fs(r2),ar(s2)){const t3=i2.__key,n3=s2.anchor,r3=s2.focus;o2="element"===n3.type&&n3.key===t3&&n3.offset===e3+1,l2="element"===r3.type&&r3.key===t3&&r3.offset===e3+1}}const c2=this.getNextSibling(),a2=this.getParentOrThrow().getWritable(),u2=r2.__key,f3=n2.__next;if(null===c2?a2.__last=u2:c2.getWritable().__prev=u2,a2.__size++,n2.__next=u2,r2.__next=f3,r2.__prev=n2.__key,r2.__parent=n2.__parent,e2&&ar(s2)){const t3=this.getIndexWithinParent();Or(s2,a2,t3+1);const e3=a2.__key;o2&&s2.anchor.set(e3,t3+2,"element"),l2&&s2.focus.set(e3,t3+2,"element")}return t2}insertBefore(t2,e2=!0){Yr(),co(this,t2);const n2=this.getWritable(),r2=t2.getWritable(),i2=r2.__key;fs(r2);const s2=this.getPreviousSibling(),o2=this.getParentOrThrow().getWritable(),l2=n2.__prev,c2=this.getIndexWithinParent();null===s2?o2.__first=i2:s2.getWritable().__next=i2,o2.__size++,n2.__prev=i2,r2.__prev=l2,r2.__next=n2.__key,r2.__parent=n2.__parent;const a2=wr();return e2&&ar(a2)&&Or(a2,this.getParentOrThrow(),c2),t2}isParentRequired(){return!1}createParentElementNode(){return Fi()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(t2,e2){Yr();const n2=this.getPreviousSibling(),r2=this.getParentOrThrow();if(null===n2)return r2.select(0,0);if(hi(n2))return n2.select();if(!Zn(n2)){const t3=n2.getIndexWithinParent()+1;return r2.select(t3,t3)}return n2.select(t2,e2)}selectNext(t2,e2){Yr();const n2=this.getNextSibling(),r2=this.getParentOrThrow();if(null===n2)return r2.select();if(hi(n2))return n2.select(0,0);if(!Zn(n2)){const t3=n2.getIndexWithinParent();return r2.select(t3,t3)}return n2.select(t2,e2)}markDirty(){this.getWritable()}reconcileObservedMutation(t2,e2){this.markDirty()}}class Pn extends An{static getType(){return"linebreak"}static clone(t2){return new Pn(t2.__key)}constructor(t2){super(t2)}getTextContent(){return"\n"}createDOM(){return document.createElement("br")}updateDOM(){return!1}isInline(){return!0}static importDOM(){return{br:t2=>function(t3){const e2=t3.parentElement;if(null!==e2&&So(e2)){const n2=e2.firstChild;if(n2===t3||n2.nextSibling===t3&&In(n2)){const n3=e2.lastChild;if(n3===t3||n3.previousSibling===t3&&In(n3))return!0}}return!1}(t2)||function(t3){const e2=t3.parentElement;if(null!==e2&&So(e2)){const n2=e2.firstChild;if(n2===t3||n2.nextSibling===t3&&In(n2))return!1;const r2=e2.lastChild;if(r2===t3||r2.previousSibling===t3&&In(r2))return!0}return!1}(t2)?null:{conversion:Dn,priority:0}}}static importJSON(t2){return Fn().updateFromJSON(t2)}}function Dn(t2){return{node:Fn()}}function Fn(){return lo(new Pn)}function Ln(t2){return t2 instanceof Pn}function In(t2){return ss(t2)&&/^( |\t|\r?\n)+$/.test(t2.textContent||"")}function Kn(t2,e2){return 16&e2?"code":128&e2?"mark":32&e2?"sub":64&e2?"sup":null}function zn(t2,e2){return 1&e2?"strong":2&e2?"em":"span"}function Bn(t2,e2,n2,r2,i2){const s2=r2.classList;let o2=Rs(i2,"base");void 0!==o2&&s2.add(...o2),o2=Rs(i2,"underlineStrikethrough");let l2=!1;const c2=8&e2&&4&e2;void 0!==o2&&(8&n2&&4&n2?(l2=!0,c2||s2.add(...o2)):c2&&s2.remove(...o2));for(const t3 in W$2){const r3=W$2[t3];if(o2=Rs(i2,t3),void 0!==o2)if(n2&r3){if(l2&&("underline"===t3||"strikethrough"===t3)){e2&r3&&s2.remove(...o2);continue}e2&r3&&(!c2||"underline"!==t3)&&"strikethrough"!==t3||s2.add(...o2)}else e2&r3&&s2.remove(...o2)}}function Rn(t2,e2,n2){const r2=e2.firstChild,s2=n2.isComposing(),o2=t2+(s2?z$3:"");if(null==r2)e2.textContent=o2;else{const t3=r2.nodeValue;if(t3!==o2)if(s2||i$2){const[e3,n3,i2]=function(t4,e4){const n4=t4.length,r3=e4.length;let i3=0,s3=0;for(;i3<n4&&i3<r3&&t4[i3]===e4[i3];)i3++;for(;s3+i3<n4&&s3+i3<r3&&t4[n4-s3-1]===e4[r3-s3-1];)s3++;return[i3,n4-i3-s3,e4.slice(i3,r3-s3)]}(t3,o2);0!==n3&&r2.deleteData(e3,n3),r2.insertData(e3,i2)}else r2.nodeValue=o2}}function Wn(t2,e2,n2,r2,i2,s2){Rn(i2,t2,e2);const o2=s2.theme.text;void 0!==o2&&Bn(0,0,r2,t2,o2)}function Jn(t2,e2){const n2=document.createElement(e2);return n2.appendChild(t2),n2}class $n extends An{static getType(){return"text"}static clone(t2){return new $n(t2.__text,t2.__key)}afterCloneFrom(t2){super.afterCloneFrom(t2),this.__text=t2.__text,this.__format=t2.__format,this.__style=t2.__style,this.__mode=t2.__mode,this.__detail=t2.__detail}constructor(t2="",e2){super(e2),this.__text=t2,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){const t2=this.getLatest();return V$2[t2.__mode]}getStyle(){return this.getLatest().__style}isToken(){return 1===this.getLatest().__mode}isComposing(){return this.__key===gs()}isSegmented(){return 2===this.getLatest().__mode}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(t2){const e2=W$2[t2];return!!(this.getFormat()&e2)}isSimpleText(){return"text"===this.__type&&0===this.__mode}getTextContent(){return this.getLatest().__text}getFormatFlags(t2,e2){return cs(this.getLatest().__format,t2,e2)}canHaveFormat(){return!0}isInline(){return!0}createDOM(t2,e2){const n2=this.__format,r2=Kn(0,n2),i2=zn(0,n2),s2=null===r2?i2:r2,o2=document.createElement(s2);let l2=o2;this.hasFormat("code")&&o2.setAttribute("spellcheck","false"),null!==r2&&(l2=document.createElement(i2),o2.appendChild(l2)),Wn(l2,this,0,n2,this.__text,t2);const c2=this.__style;return""!==c2&&(o2.style.cssText=c2),o2}updateDOM(e2,n2,r2){const i2=this.__text,s2=e2.__format,o2=this.__format,l2=Kn(0,s2),c2=Kn(0,o2),a2=zn(0,s2),u2=zn(0,o2);if((null===l2?a2:l2)!==(null===c2?u2:c2))return!0;if(l2===c2&&a2!==u2){const e3=n2.firstChild;null==e3&&t$2(48);const s3=document.createElement(u2);return Wn(s3,this,0,o2,i2,r2),n2.replaceChild(s3,e3),!1}let f3=n2;null!==c2&&null!==l2&&(f3=n2.firstChild,null==f3&&t$2(49)),Rn(i2,f3,this);const d2=r2.theme.text;void 0!==d2&&s2!==o2&&Bn(0,s2,o2,f3,d2);const h2=e2.__style,g2=this.__style;return h2!==g2&&(n2.style.cssText=g2),!1}static importDOM(){return{"#text":()=>({conversion:Hn,priority:0}),b:()=>({conversion:Un,priority:0}),code:()=>({conversion:Xn,priority:0}),em:()=>({conversion:Xn,priority:0}),i:()=>({conversion:Xn,priority:0}),mark:()=>({conversion:Xn,priority:0}),s:()=>({conversion:Xn,priority:0}),span:()=>({conversion:jn,priority:0}),strong:()=>({conversion:Xn,priority:0}),sub:()=>({conversion:Xn,priority:0}),sup:()=>({conversion:Xn,priority:0}),u:()=>({conversion:Xn,priority:0})}}static importJSON(t2){return Qn().updateFromJSON(t2)}updateFromJSON(t2){return super.updateFromJSON(t2).setTextContent(t2.text).setFormat(t2.format).setDetail(t2.detail).setMode(t2.mode).setStyle(t2.style)}exportDOM(e2){let{element:n2}=super.exportDOM(e2);return yo(n2)||t$2(132),n2.style.whiteSpace="pre-wrap",this.hasFormat("lowercase")?n2.style.textTransform="lowercase":this.hasFormat("uppercase")?n2.style.textTransform="uppercase":this.hasFormat("capitalize")&&(n2.style.textTransform="capitalize"),this.hasFormat("bold")&&(n2=Jn(n2,"b")),this.hasFormat("italic")&&(n2=Jn(n2,"i")),this.hasFormat("strikethrough")&&(n2=Jn(n2,"s")),this.hasFormat("underline")&&(n2=Jn(n2,"u")),{element:n2}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(t2,e2){}setFormat(t2){const e2=this.getWritable();return e2.__format="string"==typeof t2?W$2[t2]:t2,e2}setDetail(t2){const e2=this.getWritable();return e2.__detail="string"==typeof t2?J$6[t2]:t2,e2}setStyle(t2){const e2=this.getWritable();return e2.__style=t2,e2}toggleFormat(t2){const e2=cs(this.getFormat(),t2,null);return this.setFormat(e2)}toggleDirectionless(){const t2=this.getWritable();return t2.__detail^=1,t2}toggleUnmergeable(){const t2=this.getWritable();return t2.__detail^=2,t2}setMode(t2){const e2=U$4[t2];if(this.__mode===e2)return this;const n2=this.getWritable();return n2.__mode=e2,n2}setTextContent(t2){if(this.__text===t2)return this;const e2=this.getWritable();return e2.__text=t2,e2}select(t2,e2){Yr();let n2=t2,r2=e2;const i2=wr(),s2=this.getTextContent(),o2=this.__key;if("string"==typeof s2){const t3=s2.length;void 0===n2&&(n2=t3),void 0===r2&&(r2=t3)}else n2=0,r2=0;if(!ar(i2))return vr(o2,n2,o2,r2,"text","text");{const t3=gs();t3!==i2.anchor.key&&t3!==i2.focus.key||hs(o2),i2.setTextNodeRange(this,n2,this,r2)}return i2}selectStart(){return this.select(0,0)}selectEnd(){const t2=this.getTextContentSize();return this.select(t2,t2)}spliceText(t2,e2,n2,r2){const i2=this.getWritable(),s2=i2.__text,o2=n2.length;let l2=t2;l2<0&&(l2=o2+l2,l2<0&&(l2=0));const c2=wr();if(r2&&ar(c2)){const e3=t2+o2;c2.setTextNodeRange(i2,e3,i2,e3)}const a2=s2.slice(0,l2)+n2+s2.slice(l2+e2);return i2.__text=a2,i2}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...t2){Yr();const e2=this.getLatest(),n2=e2.getTextContent();if(""===n2)return[];const r2=e2.__key,i2=gs(),s2=n2.length;t2.sort((t3,e3)=>t3-e3),t2.push(s2);const o2=[],l2=t2.length;for(let e3=0,r3=0;e3<s2&&r3<=l2;r3++){const i3=t2[r3];i3>e3&&(o2.push(n2.slice(e3,i3)),e3=i3)}const c2=o2.length;if(1===c2)return[e2];const a2=o2[0],u2=e2.getParent();let f3;const d2=e2.getFormat(),h2=e2.getStyle(),g2=e2.__detail;let _2=!1,p2=null,y2=null;const m3=wr();if(ar(m3)){const[t3,e3]=m3.isBackward()?[m3.focus,m3.anchor]:[m3.anchor,m3.focus];"text"===t3.type&&t3.key===r2&&(p2=t3),"text"===e3.type&&e3.key===r2&&(y2=e3)}e2.isSegmented()?(f3=Qn(a2),f3.__format=d2,f3.__style=h2,f3.__detail=g2,f3.__state=Ct$4(e2,f3),_2=!0):f3=e2.setTextContent(a2);const x2=[f3];for(let t3=1;t3<c2;t3++){const n3=Qn(o2[t3]);n3.__format=d2,n3.__style=h2,n3.__detail=g2,n3.__state=Ct$4(e2,n3);const s3=n3.__key;i2===r2&&hs(s3),x2.push(n3)}const C2=p2?p2.offset:null,S3=y2?y2.offset:null;let v2=0;for(const t3 of x2){if(!p2&&!y2)break;const e3=v2+t3.getTextContentSize();if(null!==p2&&null!==C2&&C2<=e3&&C2>=v2&&(p2.set(t3.getKey(),C2-v2,"text"),C2<e3&&(p2=null)),null!==y2&&null!==S3&&S3<=e3&&S3>=v2){y2.set(t3.getKey(),S3-v2,"text");break}v2=e3}if(null!==u2){!function(t4){const e4=t4.getPreviousSibling(),n3=t4.getNextSibling();null!==e4&&ds(e4),null!==n3&&ds(n3)}(this);const t3=u2.getWritable(),e3=this.getIndexWithinParent();_2?(t3.splice(e3,0,x2),this.remove()):t3.splice(e3,1,x2),ar(m3)&&Or(m3,u2,e3,c2-1)}return x2}mergeWithSibling(e2){const n2=e2===this.getPreviousSibling();n2||e2===this.getNextSibling()||t$2(50);const r2=this.__key,i2=e2.__key,s2=this.__text,o2=s2.length;gs()===i2&&hs(r2);const l2=wr();if(ar(l2)){const t2=l2.anchor,s3=l2.focus;null!==t2&&t2.key===i2&&Pr(t2,n2,r2,e2,o2),null!==s3&&s3.key===i2&&Pr(s3,n2,r2,e2,o2)}const c2=e2.__text,a2=n2?c2+s2:s2+c2;this.setTextContent(a2);const u2=this.getWritable();return e2.remove(),u2}isTextEntity(){return!1}}function jn(t2){return{forChild:tr(t2.style),node:null}}function Un(t2){const e2=t2,n2="normal"===e2.style.fontWeight;return{forChild:tr(e2.style,n2?void 0:"bold"),node:null}}const Vn=new WeakMap;function Yn(t2){if(!yo(t2))return!1;if("PRE"===t2.nodeName)return!0;const e2=t2.style.whiteSpace;return"string"==typeof e2&&e2.startsWith("pre")}function Hn(e2){const n2=e2;null===e2.parentElement&&t$2(129);let r2=n2.textContent||"";if(null!==function(t2){let e3,n3=t2.parentNode;const r3=[t2];for(;null!==n3&&void 0===(e3=Vn.get(n3))&&!Yn(n3);)r3.push(n3),n3=n3.parentNode;const i2=void 0===e3?n3:e3;for(let t3=0;t3<r3.length;t3++)Vn.set(r3[t3],i2);return i2}(n2)){const t2=r2.split(/(\r?\n|\t)/),e3=[],n3=t2.length;for(let r3=0;r3<n3;r3++){const n4=t2[r3];"\n"===n4||"\r\n"===n4?e3.push(Fn()):"\t"===n4?e3.push(nr()):""!==n4&&e3.push(Qn(n4))}return{node:e3}}if(r2=r2.replace(/\r/g,"").replace(/[ \t\n]+/g," "),""===r2)return{node:null};if(" "===r2[0]){let t2=n2,e3=!0;for(;null!==t2&&null!==(t2=qn(t2,!1));){const n3=t2.textContent||"";if(n3.length>0){/[ \t\n]$/.test(n3)&&(r2=r2.slice(1)),e3=!1;break}}e3&&(r2=r2.slice(1))}if(" "===r2[r2.length-1]){let t2=n2,e3=!0;for(;null!==t2&&null!==(t2=qn(t2,!0));)if((t2.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){e3=!1;break}e3&&(r2=r2.slice(0,r2.length-1))}return""===r2?{node:null}:{node:Qn(r2)}}function qn(t2,e2){let n2=t2;for(;;){let t3;for(;null===(t3=e2?n2.nextSibling:n2.previousSibling);){const t4=n2.parentElement;if(null===t4)return null;n2=t4}if(n2=t3,yo(n2)){const t4=n2.style.display;if(""===t4&&!Co(n2)||""!==t4&&!t4.startsWith("inline"))return null}let r2=n2;for(;null!==(r2=e2?n2.firstChild:n2.lastChild);)n2=r2;if(ss(n2))return n2;if("BR"===n2.nodeName)return null}}const Gn={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function Xn(t2){const e2=Gn[t2.nodeName.toLowerCase()];return void 0===e2?{node:null}:{forChild:tr(t2.style,e2),node:null}}function Qn(t2=""){return lo(new $n(t2))}function Zn(t2){return t2 instanceof $n}function tr(t2,e2){const n2=t2.fontWeight,r2=t2.textDecoration.split(" "),i2="700"===n2||"bold"===n2,s2=r2.includes("line-through"),o2="italic"===t2.fontStyle,l2=r2.includes("underline"),c2=t2.verticalAlign;return t3=>Zn(t3)?(i2&&!t3.hasFormat("bold")&&t3.toggleFormat("bold"),s2&&!t3.hasFormat("strikethrough")&&t3.toggleFormat("strikethrough"),o2&&!t3.hasFormat("italic")&&t3.toggleFormat("italic"),l2&&!t3.hasFormat("underline")&&t3.toggleFormat("underline"),"sub"!==c2||t3.hasFormat("subscript")||t3.toggleFormat("subscript"),"super"!==c2||t3.hasFormat("superscript")||t3.toggleFormat("superscript"),e2&&!t3.hasFormat(e2)&&t3.toggleFormat(e2),t3):t3}class er extends $n{static getType(){return"tab"}static clone(t2){return new er(t2.__key)}constructor(t2){super("\t",t2),this.__detail=2}static importDOM(){return null}createDOM(t2){const e2=super.createDOM(t2),n2=Rs(t2.theme,"tab");return void 0!==n2&&e2.classList.add(...n2),e2}static importJSON(t2){return nr().updateFromJSON(t2)}setTextContent(e2){return"\t"!==e2&&""!==e2&&t$2(126),super.setTextContent("\t")}spliceText(e2,n2,r2,i2){return""===r2&&0===n2||"\t"===r2&&1===n2||t$2(286),this}setDetail(e2){return 2!==e2&&t$2(127),this}setMode(e2){return"normal"!==e2&&t$2(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function nr(){return lo(new er)}function rr(t2){return t2 instanceof er}class ir{constructor(t2,e2,n2){this._selection=null,this.key=t2,this.offset=e2,this.type=n2}is(t2){return this.key===t2.key&&this.offset===t2.offset&&this.type===t2.type}isBefore(t2){return this.key===t2.key?this.offset<t2.offset:ul(Tl(_l(this,"next")),Tl(_l(t2,"next")))<0}getNode(){const e2=_s(this.key);return null===e2&&t$2(20),e2}set(t2,e2,n2,r2){const i2=this._selection,s2=this.key;r2&&this.key===t2&&this.offset===e2&&this.type===n2||(this.key=t2,this.offset=e2,this.type=n2,Vr()||(gs()===s2&&hs(t2),null!==i2&&(i2.setCachedNodes(null),i2.dirty=!0)))}}function sr(t2,e2,n2){return new ir(t2,e2,n2)}function or(t2,e2){let n2=e2.__key,r2=t2.offset,i2="element";if(Zn(e2)){i2="text";const t3=e2.getTextContentSize();r2>t3&&(r2=t3)}else if(!hi(e2)){const t3=e2.getNextSibling();if(Zn(t3))n2=t3.__key,r2=0,i2="text";else{const t4=e2.getParent();t4&&(n2=t4.__key,r2=e2.getIndexWithinParent()+1)}}t2.set(n2,r2,i2)}function lr(t2,e2){if(hi(e2)){const n2=e2.getLastDescendant();hi(n2)||Zn(n2)?or(t2,n2):or(t2,e2)}else or(t2,e2)}class cr{constructor(t2){this._cachedNodes=null,this._nodes=t2,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(t2){this._cachedNodes=t2}is(t2){if(!fr(t2))return!1;const e2=this._nodes,n2=t2._nodes;return e2.size===n2.size&&Array.from(e2).every(t3=>n2.has(t3))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(t2){this.dirty=!0,this._nodes.add(t2),this._cachedNodes=null}delete(t2){this.dirty=!0,this._nodes.delete(t2),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(t2){return this._nodes.has(t2)}clone(){return new cr(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(t2){}insertText(){}insertNodes(t2){const e2=this.getNodes(),n2=e2.length,r2=e2[n2-1];let i2;if(Zn(r2))i2=r2.select();else{const t3=r2.getIndexWithinParent()+1;i2=r2.getParentOrThrow().select(t3,t3)}i2.insertNodes(t2);for(let t3=0;t3<n2;t3++)e2[t3].remove()}getNodes(){const t2=this._cachedNodes;if(null!==t2)return t2;const e2=this._nodes,n2=[];for(const t3 of e2){const e3=_s(t3);null!==e3&&n2.push(e3)}return Vr()||(this._cachedNodes=n2),n2}getTextContent(){const t2=this.getNodes();let e2="";for(let n2=0;n2<t2.length;n2++)e2+=t2[n2].getTextContent();return e2}deleteNodes(){const t2=this.getNodes();if((wr()||Er())===this&&t2[0]){const e2=Go(t2[0],"next");yl(cl(e2,e2))}for(const e2 of t2)e2.remove()}}function ar(t2){return t2 instanceof ur}class ur{constructor(t2,e2,n2,r2){this.anchor=t2,this.focus=e2,t2._selection=this,e2._selection=this,this._cachedNodes=null,this.format=n2,this.style=r2,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(t2){this._cachedNodes=t2}is(t2){return!!ar(t2)&&this.anchor.is(t2.anchor)&&this.focus.is(t2.focus)&&this.format===t2.format&&this.style===t2.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const t2=this._cachedNodes;if(null!==t2)return t2;const e2=function(t3){const e3=[],[n2,r2]=t3.getTextSlices();n2&&e3.push(n2.caret.origin);const i2=new Set,s2=new Set;for(const n3 of t3)if(Vo(n3)){const{origin:t4}=n3;0===e3.length?i2.add(t4):(s2.add(t4),e3.push(t4))}else{const{origin:t4}=n3;hi(t4)&&s2.has(t4)||e3.push(t4)}if(r2&&e3.push(r2.caret.origin),Uo(t3.focus)&&hi(t3.focus.origin)&&null===t3.focus.getNodeAtCaret())for(let n3=tl(t3.focus.origin,"previous");Vo(n3)&&i2.has(n3.origin)&&!n3.origin.isEmpty()&&n3.origin.is(e3[e3.length-1]);n3=nl(n3))i2.delete(n3.origin),e3.pop();for(;e3.length>1;){const t4=e3[e3.length-1];if(!hi(t4)||s2.has(t4)||t4.isEmpty()||i2.has(t4))break;e3.pop()}if(0===e3.length&&t3.isCollapsed()){const n3=Tl(t3.anchor),r3=Tl(t3.anchor.getFlipped()),i3=t4=>$o(t4)?t4.origin:t4.getNodeAtCaret(),s3=i3(n3)||i3(r3)||(t3.anchor.getNodeAtCaret()?n3.origin:r3.origin);e3.push(s3)}return e3}(wl(xl(this),"next"));return Vr()||(this._cachedNodes=e2),e2}setTextNodeRange(t2,e2,n2,r2){this.anchor.set(t2.__key,e2,"text"),this.focus.set(n2.__key,r2,"text")}getTextContent(){const t2=this.getNodes();if(0===t2.length)return"";const e2=t2[0],n2=t2[t2.length-1],r2=this.anchor,i2=this.focus,s2=r2.isBefore(i2),[o2,l2]=hr(this);let c2="",a2=!0;for(let u2=0;u2<t2.length;u2++){const f3=t2[u2];if(hi(f3)&&!f3.isInline())a2||(c2+="\n"),a2=!f3.isEmpty();else if(a2=!1,Zn(f3)){let t3=f3.getTextContent();f3===e2?f3===n2?"element"===r2.type&&"element"===i2.type&&i2.offset!==r2.offset||(t3=o2<l2?t3.slice(o2,l2):t3.slice(l2,o2)):t3=s2?t3.slice(o2):t3.slice(l2):f3===n2&&(t3=s2?t3.slice(0,l2):t3.slice(0,o2)),c2+=t3}else!pi(f3)&&!Ln(f3)||f3===n2&&this.isCollapsed()||(c2+=f3.getTextContent())}return c2}applyDOMRange(t2){const e2=Gr(),n2=e2.getEditorState()._selection,r2=Cr(t2.startContainer,t2.startOffset,t2.endContainer,t2.endOffset,e2,n2);if(null===r2)return;const[i2,s2]=r2;this.anchor.set(i2.key,i2.offset,i2.type,!0),this.focus.set(s2.key,s2.offset,s2.type,!0),Tt$3(this)}clone(){const t2=this.anchor,e2=this.focus;return new ur(sr(t2.key,t2.offset,t2.type),sr(e2.key,e2.offset,e2.type),this.format,this.style)}toggleFormat(t2){this.format=cs(this.format,t2,null),this.dirty=!0}setFormat(t2){this.format=t2,this.dirty=!0}setStyle(t2){this.style=t2,this.dirty=!0}hasFormat(t2){const e2=W$2[t2];return!!(this.format&e2)}insertRawText(t2){const e2=t2.split(/(\r?\n|\t)/),n2=[],r2=e2.length;for(let t3=0;t3<r2;t3++){const r3=e2[t3];"\n"===r3||"\r\n"===r3?n2.push(Fn()):"\t"===r3?n2.push(nr()):n2.push(Qn(r3))}this.insertNodes(n2)}insertText(e2){const n2=this.anchor,r2=this.focus,i2=this.format,s2=this.style;let o2=n2,l2=r2;!this.isCollapsed()&&r2.isBefore(n2)&&(o2=r2,l2=n2),"element"===o2.type&&function(t2,e3,n3,r3){const i3=t2.getNode(),s3=i3.getChildAtIndex(t2.offset),o3=Qn();if(o3.setFormat(n3),o3.setStyle(r3),Li(s3))s3.splice(0,0,[o3]);else{const t3=mi(i3)?Fi().append(o3):o3;null===s3?i3.append(t3):s3.insertBefore(t3)}t2.is(e3)&&e3.set(o3.__key,0,"text"),t2.set(o3.__key,0,"text")}(o2,l2,i2,s2),"element"===l2.type&&pl(l2,Tl(_l(l2,"next")));const c2=o2.offset;let a2=l2.offset;const u2=this.getNodes(),f3=u2.length;let d2=u2[0];Zn(d2)||t$2(26);const h2=d2.getTextContent().length,g2=d2.getParentOrThrow();let _2=u2[f3-1];if(1===f3&&"element"===l2.type&&(a2=h2,l2.set(o2.key,a2,"text")),this.isCollapsed()&&c2===h2&&(is(d2)||!d2.canInsertTextAfter()||!g2.canInsertTextAfter()&&null===d2.getNextSibling())){let t2=d2.getNextSibling();if(Zn(t2)&&t2.canInsertTextBefore()&&!is(t2)||(t2=Qn(),t2.setFormat(i2),t2.setStyle(s2),g2.canInsertTextAfter()?d2.insertAfter(t2):g2.insertAfter(t2)),t2.select(0,0),d2=t2,""!==e2)return void this.insertText(e2)}else if(this.isCollapsed()&&0===c2&&(is(d2)||!d2.canInsertTextBefore()||!g2.canInsertTextBefore()&&null===d2.getPreviousSibling())){let t2=d2.getPreviousSibling();if(Zn(t2)&&!is(t2)||(t2=Qn(),t2.setFormat(i2),g2.canInsertTextBefore()?d2.insertBefore(t2):g2.insertBefore(t2)),t2.select(),d2=t2,""!==e2)return void this.insertText(e2)}else if(d2.isSegmented()&&c2!==h2){const t2=Qn(d2.getTextContent());t2.setFormat(i2),d2.replace(t2),d2=t2}else if(!this.isCollapsed()&&""!==e2){const t2=_2.getParent();if(!g2.canInsertTextBefore()||!g2.canInsertTextAfter()||hi(t2)&&(!t2.canInsertTextBefore()||!t2.canInsertTextAfter()))return this.insertText(""),xr(this.anchor,this.focus,null),void this.insertText(e2)}if(1===f3){if(rs(d2)){const t3=Qn(e2);return t3.select(),void d2.replace(t3)}const t2=d2.getFormat(),n3=d2.getStyle();if(c2!==a2||t2===i2&&n3===s2){if(rr(d2)){const t3=Qn(e2);return t3.setFormat(i2),t3.setStyle(s2),t3.select(),void d2.replace(t3)}}else{if(""!==d2.getTextContent()){const t3=Qn(e2);if(t3.setFormat(i2),t3.setStyle(s2),t3.select(),0===c2)d2.insertBefore(t3,!1);else{const[e3]=d2.splitText(c2);e3.insertAfter(t3,!1)}return void(t3.isComposing()&&"text"===this.anchor.type&&(this.anchor.offset-=e2.length))}d2.setFormat(i2),d2.setStyle(s2)}const r3=a2-c2;d2=d2.spliceText(c2,r3,e2,!0),""===d2.getTextContent()?d2.remove():"text"===this.anchor.type&&(d2.isComposing()?this.anchor.offset-=e2.length:(this.format=t2,this.style=n3))}else{const t2=new Set([...d2.getParentKeys(),..._2.getParentKeys()]),n3=hi(d2)?d2:d2.getParentOrThrow();let r3=hi(_2)?_2:_2.getParentOrThrow(),i3=_2;if(!n3.is(r3)&&r3.isInline())do{i3=r3,r3=r3.getParentOrThrow()}while(r3.isInline());if("text"===l2.type&&(0!==a2||""===_2.getTextContent())||"element"===l2.type&&_2.getIndexWithinParent()<a2)if(Zn(_2)&&!rs(_2)&&a2!==_2.getTextContentSize()){if(_2.isSegmented()){const t3=Qn(_2.getTextContent());_2.replace(t3),_2=t3}mi(l2.getNode())||"text"!==l2.type||(_2=_2.spliceText(0,a2,"")),t2.add(_2.__key)}else{const t3=_2.getParentOrThrow();t3.canBeEmpty()||1!==t3.getChildrenSize()?_2.remove():t3.remove()}else t2.add(_2.__key);const s3=r3.getChildren(),o3=new Set(u2),g3=n3.is(r3),p2=n3.isInline()&&null===d2.getNextSibling()?n3:d2;for(let t3=s3.length-1;t3>=0;t3--){const e3=s3[t3];if(e3.is(d2)||hi(e3)&&e3.isParentOf(d2))break;e3.isAttached()&&(!o3.has(e3)||e3.is(i3)?g3||p2.insertAfter(e3,!1):e3.remove())}if(!g3){let e3=r3,n4=null;for(;null!==e3;){const r4=e3.getChildren(),i4=r4.length;(0===i4||r4[i4-1].is(n4))&&(t2.delete(e3.__key),n4=e3),e3=e3.getParent()}}if(rs(d2))if(c2===h2)d2.select();else{const t3=Qn(e2);t3.select(),d2.replace(t3)}else d2=d2.spliceText(c2,h2-c2,e2,!0),""===d2.getTextContent()?d2.remove():d2.isComposing()&&"text"===this.anchor.type&&(this.anchor.offset-=e2.length);for(let e3=1;e3<f3;e3++){const n4=u2[e3],r4=n4.__key;t2.has(r4)||n4.remove()}}}removeText(){const t2=wr()===this;ml(this,function(e2,n2="removeEmptySlices"){if(e2.isCollapsed())return e2;const r2="root",i2="next";let s2=n2;const o2=wl(e2,i2),l2=Sl(o2.anchor,r2),c2=Sl(o2.focus.getFlipped(),r2),a2=new Set,u2=[];for(const t2 of o2.iterNodeCarets(r2))if(Vo(t2))a2.add(t2.origin.getKey());else if(Uo(t2)){const{origin:e3}=t2;hi(e3)&&!a2.has(e3.getKey())||u2.push(e3)}for(const t2 of u2)t2.remove();for(const t2 of o2.getTextSlices()){if(!t2)continue;const{origin:e3}=t2.caret,n3=e3.getTextContentSize(),r3=Cl(Go(e3,i2)),o3=e3.getMode();if(Math.abs(t2.distance)===n3&&"removeEmptySlices"===s2||"token"===o3&&0!==t2.distance)r3.remove();else if(0!==t2.distance){s2="removeEmptySlices";let e4=t2.removeTextSlice();const n4=t2.caret.origin;if("segmented"===o3){const t3=e4.origin,n5=Qn(t3.getTextContent()).setStyle(t3.getStyle()).setFormat(t3.getFormat());r3.replaceOrInsert(n5),e4=Xo(n5,i2,e4.offset)}n4.is(l2[0].origin)&&(l2[0]=e4),n4.is(c2[0].origin)&&(c2[0]=e4.getFlipped())}}let f3,d2;for(const t2 of l2)if(vl(t2)){f3=Tl(t2);break}for(const t2 of c2)if(vl(t2)){d2=Tl(t2);break}const h2=function(t2,e3,n3){if(!t2||!e3)return null;const r3=t2.getParentAtCaret(),i3=e3.getParentAtCaret();if(!r3||!i3)return null;const s3=r3.getParents().reverse();s3.push(r3);const o3=i3.getParents().reverse();o3.push(i3);const l3=Math.min(s3.length,o3.length);let c3;for(c3=0;c3<l3&&s3[c3]===o3[c3];c3++);const a3=(t3,e4)=>{let n4;for(let r4=c3;r4<t3.length;r4++){const i4=t3[r4];if(so(i4))return;!n4&&e4(i4)&&(n4=i4)}return n4},u3=a3(s3,vo),f4=u3&&a3(o3,t3=>n3.has(t3.getKey())&&vo(t3));return u3&&f4?[u3,f4]:null}(f3,d2,a2);if(h2){const[t2,e3]=h2;tl(t2,"previous").splice(0,e3.getChildren()),e3.remove()}const g2=[f3,d2,...l2,...c2].find(vl);if(g2)return ll(bl(Tl(g2),e2.direction));t$2(269,JSON.stringify(l2.map(t2=>t2.origin.__key)))}(xl(this))),t2&&wr()!==this&&ks(this)}formatText(t2,e2=null){if(this.isCollapsed())return this.toggleFormat(t2),void hs(null);const n2=this.getNodes(),r2=[];for(const t3 of n2)Zn(t3)&&r2.push(t3);const i2=e3=>{n2.forEach(n3=>{if(hi(n3)){const r3=n3.getFormatFlags(t2,e3);n3.setTextFormat(r3)}})},s2=r2.length;if(0===s2)return this.toggleFormat(t2),hs(null),void i2(e2);const o2=this.anchor,l2=this.focus,c2=this.isBackward(),a2=c2?l2:o2,u2=c2?o2:l2;let f3=0,d2=r2[0],h2="element"===a2.type?0:a2.offset;if("text"===a2.type&&h2===d2.getTextContentSize()&&(f3=1,d2=r2[1],h2=0),null==d2)return;const g2=d2.getFormatFlags(t2,e2);i2(g2);const _2=s2-1;let p2=r2[_2];const y2="text"===u2.type?u2.offset:p2.getTextContentSize();if(d2.is(p2)){if(h2===y2)return;if(is(d2)||0===h2&&y2===d2.getTextContentSize())d2.setFormat(g2);else{const t3=d2.splitText(h2,y2),e3=0===h2?t3[0]:t3[1];e3.setFormat(g2),"text"===a2.type&&a2.set(e3.__key,0,"text"),"text"===u2.type&&u2.set(e3.__key,y2-h2,"text")}return void(this.format=g2)}0===h2||is(d2)||([,d2]=d2.splitText(h2),h2=0),d2.setFormat(g2);const m3=p2.getFormatFlags(t2,g2);y2>0&&(y2===p2.getTextContentSize()||is(p2)||([p2]=p2.splitText(y2)),p2.setFormat(m3));for(let e3=f3+1;e3<_2;e3++){const n3=r2[e3],i3=n3.getFormatFlags(t2,m3);n3.setFormat(i3)}"text"===a2.type&&a2.set(d2.__key,h2,"text"),"text"===u2.type&&u2.set(p2.__key,y2,"text"),this.format=g2|m3}insertNodes(e2){if(0===e2.length)return;if(this.isCollapsed()||this.removeText(),"root"===this.anchor.key){this.insertParagraph();const n3=wr();return ar(n3)||t$2(134),n3.insertNodes(e2)}const n2=(this.isBackward()?this.focus:this.anchor).getNode(),r2=ko(n2,vo),i2=e2[e2.length-1];if(hi(r2)&&"__language"in r2){if("__language"in e2[0])this.insertText(e2[0].getTextContent());else{const t2=Kr(this);r2.splice(t2,0,e2),i2.selectEnd()}return}if(!e2.some(t2=>(hi(t2)||pi(t2))&&!t2.isInline())){hi(r2)||t$2(211,n2.constructor.name,n2.getType());const s3=Kr(this);return r2.splice(s3,0,e2),void i2.selectEnd()}const s2=function(t2){const e3=Fi();let n3=null;for(let r3=0;r3<t2.length;r3++){const i3=t2[r3],s3=Ln(i3);if(s3||pi(i3)&&i3.isInline()||hi(i3)&&i3.isInline()||Zn(i3)||i3.isParentRequired()){if(null===n3&&(n3=i3.createParentElementNode(),e3.append(n3),s3))continue;null!==n3&&n3.append(i3)}else e3.append(i3),n3=null}return e3}(e2),o2=s2.getLastDescendant(),l2=s2.getChildren(),c2=hi(r2)&&r2.isEmpty()?null:this.insertParagraph(),a2=l2[l2.length-1];let u2=l2[0];var f3;hi(f3=u2)&&vo(f3)&&!f3.isEmpty()&&hi(r2)&&(!r2.isEmpty()||r2.canMergeWhenEmpty())&&(hi(r2)||t$2(211,n2.constructor.name,n2.getType()),r2.append(...u2.getChildren()),u2=l2[1]),u2&&(null===r2&&t$2(212,n2.constructor.name,n2.getType()),function(e3,n3){const i3=n3.getParentOrThrow().getLastChild();let s3=n3;const o3=[n3];for(;s3!==i3;)s3.getNextSibling()||t$2(140),s3=s3.getNextSibling(),o3.push(s3);let l3=e3;for(const t2 of o3)l3=l3.insertAfter(t2)}(r2,u2));const d2=ko(o2,vo);c2&&hi(d2)&&(c2.canMergeWhenEmpty()||vo(a2))&&(d2.append(...c2.getChildren()),c2.remove()),hi(r2)&&r2.isEmpty()&&r2.remove(),o2.selectEnd();const h2=hi(r2)?r2.getLastChild():null;Ln(h2)&&d2!==r2&&h2.remove()}insertParagraph(){if("root"===this.anchor.key){const t2=Fi();return Ss().splice(this.anchor.offset,0,[t2]),t2.select(),t2}const e2=Kr(this),n2=ko(this.anchor.getNode(),vo);hi(n2)||t$2(213);const r2=n2.getChildAtIndex(e2),i2=r2?[r2,...r2.getNextSiblings()]:[],s2=n2.insertNewAfter(this,!1);return s2?(s2.append(...i2),s2.selectStart(),s2):null}insertLineBreak(t2){const e2=Fn();if(this.insertNodes([e2]),t2){const t3=e2.getParentOrThrow(),n2=e2.getIndexWithinParent();t3.select(n2,n2)}}extract(){const t2=this.getNodes(),e2=t2.length,n2=e2-1,r2=this.anchor,i2=this.focus;let s2=t2[0],o2=t2[n2];const[l2,c2]=hr(this);if(0===e2)return[];if(1===e2){if(Zn(s2)&&!this.isCollapsed()){const t3=l2>c2?c2:l2,e3=l2>c2?l2:c2,n3=s2.splitText(t3,e3),r3=0===t3?n3[0]:n3[1];return null!=r3?[r3]:[]}return[s2]}const a2=r2.isBefore(i2);if(Zn(s2)){const e3=a2?l2:c2;e3===s2.getTextContentSize()?t2.shift():0!==e3&&([,s2]=s2.splitText(e3),t2[0]=s2)}if(Zn(o2)){const e3=o2.getTextContent().length,r3=a2?c2:l2;0===r3?t2.pop():r3!==e3&&([o2]=o2.splitText(r3),t2[n2]=o2)}return t2}modify(t2,e2,n2){if(Br(this,t2,e2,n2))return;const r2="move"===t2,i2=Gr(),s2=ho(no(i2));if(!s2)return;const o2=i2._blockCursorElement,l2=i2._rootElement,c2=this.focus.getNode();if(null===l2||null===o2||!hi(c2)||c2.isInline()||c2.canBeEmpty()||fo(o2,i2,l2),this.dirty){let t3=Hs(i2,this.anchor.key),e3=Hs(i2,this.focus.key);"text"===this.anchor.type&&(t3=ls(t3)),"text"===this.focus.type&&(e3=ls(e3)),t3&&e3&&Dr(s2,t3,this.anchor.offset,e3,this.focus.offset)}if(e3=t2,n3=e2?"backward":"forward",r3=n2,s2.modify(e3,n3,r3),s2.rangeCount>0){const t3=s2.getRangeAt(0),n3=this.anchor.getNode(),i3=mi(n3)?n3:function(t2){let e2=t2.getParentOrThrow();for(;null!==e2;){if(so(e2))return e2;e2=e2.getParentOrThrow()}return e2}(n3);if(this.applyDOMRange(t3),this.dirty=!0,!r2){const n4=this.getNodes(),r3=[];let o3=!1;for(let t4=0;t4<n4.length;t4++){const e3=n4[t4];to(e3,i3)?r3.push(e3):o3=!0}if(o3&&r3.length>0)if(e2){const t4=r3[0];hi(t4)?t4.selectStart():t4.getParentOrThrow().selectStart()}else{const t4=r3[r3.length-1];hi(t4)?t4.selectEnd():t4.getParentOrThrow().selectEnd()}s2.anchorNode===t3.startContainer&&s2.anchorOffset===t3.startOffset||function(t4){const e3=t4.focus,n5=t4.anchor,r4=n5.key,i4=n5.offset,s3=n5.type;n5.set(e3.key,e3.offset,e3.type,!0),e3.set(r4,i4,s3,!0)}(this)}}var e3,n3,r3;"lineboundary"===n2&&Br(this,t2,e2,n2,"decorators")}forwardDeletion(t2,e2,n2){if(!n2&&("element"===t2.type&&hi(e2)&&t2.offset===e2.getChildrenSize()||"text"===t2.type&&t2.offset===e2.getTextContentSize())){const t3=e2.getParent(),n3=e2.getNextSibling()||(null===t3?null:t3.getNextSibling());if(hi(n3)&&n3.isShadowRoot())return!0}return!1}deleteCharacter(t2){const e2=this.isCollapsed();if(this.isCollapsed()){const e3=this.anchor;let n2=e3.getNode();if(this.forwardDeletion(e3,n2,t2))return;const r2=ol(_l(e3,t2?"previous":"next"));if(r2.getTextSlices().every(t3=>null===t3||0===t3.distance)){let t3={type:"initial"};for(const e4 of r2.iterNodeCarets("shadowRoot"))if(Vo(e4))if(e4.origin.isInline());else{if(e4.origin.isShadowRoot()){if("merge-block"===t3.type)break;if(hi(r2.anchor.origin)&&r2.anchor.origin.isEmpty()){const t4=Tl(e4);ml(this,cl(t4,t4)),r2.anchor.origin.remove()}return}"merge-next-block"!==t3.type&&"merge-block"!==t3.type||(t3={block:t3.block,caret:e4,type:"merge-block"})}else{if("merge-block"===t3.type)break;if(Uo(e4)){if(hi(e4.origin)){if(e4.origin.isInline()){if(!e4.origin.isParentOf(r2.anchor.origin))break}else t3={block:e4.origin,type:"merge-next-block"};continue}if(pi(e4.origin)){if(e4.origin.isIsolated());else if("merge-next-block"===t3.type&&(e4.origin.isKeyboardSelectable()||!e4.origin.isInline())&&hi(r2.anchor.origin)&&r2.anchor.origin.isEmpty()){r2.anchor.origin.remove();const t4=Tr();t4.add(e4.origin.getKey()),ks(t4)}else e4.origin.remove();return}break}}if("merge-block"===t3.type){const{caret:e4,block:n3}=t3;return ml(this,cl(!e4.origin.isEmpty()&&n3.isEmpty()?Cl(Go(n3,e4.direction)):r2.anchor,e4)),this.removeText()}}const i2=this.focus;if(this.modify("extend",t2,"character"),this.isCollapsed()){if(t2&&0===e3.offset&&gr(this,e3.getNode()))return}else{const r3="text"===i2.type?i2.getNode():null;if(n2="text"===e3.type?e3.getNode():null,null!==r3&&r3.isSegmented()){const e4=i2.offset,s2=r3.getTextContentSize();if(r3.is(n2)||t2&&e4!==s2||!t2&&0!==e4)return void pr(r3,t2,e4)}else if(null!==n2&&n2.isSegmented()){const i3=e3.offset,s2=n2.getTextContentSize();if(n2.is(r3)||t2&&0!==i3||!t2&&i3!==s2)return void pr(n2,t2,i3)}!function(t3,e4){const n3=t3.anchor,r4=t3.focus,i3=n3.getNode();if(i3===r4.getNode()&&"text"===n3.type&&"text"===r4.type){const t4=n3.offset,s3=r4.offset,o2=t4<s3,l2=o2?t4:s3,c2=o2?s3:t4,a2=c2-1;l2!==a2&&!Ns(t5=i3.getTextContent().slice(l2,c2))&&!_r(t5)&&(e4?r4.set(r4.key,a2,r4.type):n3.set(n3.key,a2,n3.type))}var t5}(this,t2)}}if(this.removeText(),t2&&!e2&&this.isCollapsed()&&"element"===this.anchor.type&&0===this.anchor.offset){const t3=this.anchor.getNode();t3.isEmpty()&&mi(t3.getParent())&&null===t3.getPreviousSibling()&&gr(this,t3)}}deleteLine(t2){this.isCollapsed()&&this.modify("extend",t2,"lineboundary"),this.isCollapsed()?this.deleteCharacter(t2):this.removeText()}deleteWord(t2){if(this.isCollapsed()){const e2=this.anchor,n2=e2.getNode();if(this.forwardDeletion(e2,n2,t2))return;this.modify("extend",t2,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function fr(t2){return t2 instanceof cr}function dr(t2){const e2=t2.offset;if("text"===t2.type)return e2;const n2=t2.getNode();return e2===n2.getChildrenSize()?n2.getTextContent().length:0}function hr(t2){const e2=t2.getStartEndPoints();if(null===e2)return[0,0];const[n2,r2]=e2;return"element"===n2.type&&"element"===r2.type&&n2.key===r2.key&&n2.offset===r2.offset?[0,0]:[dr(n2),dr(r2)]}function gr(t2,e2){for(let n2=e2;n2;n2=n2.getParent()){if(hi(n2)){if(n2.collapseAtStart(t2))return!0;if(so(n2))break}if(n2.getPreviousSibling())break}return!1}const _r=(()=>{try{const t2=new RegExp("\\p{Emoji}","u"),e2=t2.test.bind(t2);if(e2("❤️")&&e2("#️⃣")&&e2("👍"))return e2}catch(t2){}return()=>!1})();function pr(t2,e2,n2){const r2=t2,i2=r2.getTextContent().split(/(?=\s)/g),s2=i2.length;let o2=0,l2=0;for(let t3=0;t3<s2;t3++){const r3=t3===s2-1;if(l2=o2,o2+=i2[t3].length,e2&&o2===n2||o2>n2||r3){i2.splice(t3,1),r3&&(l2=void 0);break}}const c2=i2.join("").trim();""===c2?r2.remove():(r2.setTextContent(c2),r2.select(l2,l2))}function yr(e2,n2,r2,i2){let s2,o2=n2;if(yo(e2)){let l2=!1;const c2=e2.childNodes,a2=c2.length,u2=i2._blockCursorElement;o2===a2&&(l2=!0,o2=a2-1);let f3=c2[o2],d2=!1;if(f3===u2)f3=c2[o2+1],d2=!0;else if(null!==u2){const t2=u2.parentNode;e2===t2&&n2>Array.prototype.indexOf.call(t2.children,u2)&&o2--}if(s2=Ts(f3),Zn(s2))o2=Qo(s2,l2?"next":"previous");else{let c3=Ts(e2);if(null===c3)return null;if(hi(c3)){const a3=i2.getElementByKey(c3.getKey());null===a3&&t$2(214);const u3=c3.getDOMSlot(a3);[c3,o2]=u3.resolveChildIndex(c3,a3,e2,n2),hi(c3)||t$2(215),l2&&o2>=c3.getChildrenSize()&&(o2=Math.max(0,c3.getChildrenSize()-1));let f4=c3.getChildAtIndex(o2);if(hi(f4)&&function(t2,e3,n3){const r3=t2.getParent();return null===n3||null===r3||!r3.canBeEmpty()||r3!==n3.getNode()}(f4,0,r2)){const t2=l2?f4.getLastDescendant():f4.getFirstDescendant();null===t2?c3=f4:(f4=t2,c3=hi(f4)?f4:f4.getParentOrThrow()),o2=0}Zn(f4)?(s2=f4,c3=null,o2=Qo(f4,l2?"next":"previous")):f4!==c3&&l2&&!d2&&(hi(c3)||t$2(216),o2=Math.min(c3.getChildrenSize(),o2+1))}else{const t2=c3.getIndexWithinParent();o2=0===n2&&pi(c3)&&Ts(e2)===c3?t2:t2+1,c3=c3.getParentOrThrow()}if(hi(c3))return sr(c3.__key,o2,"element")}}else s2=Ts(e2);return Zn(s2)?sr(s2.__key,Qo(s2,o2,"clamp"),"text"):null}function mr(t2,e2,n2){const r2=t2.offset,i2=t2.getNode();if(0===r2){const r3=i2.getPreviousSibling(),s2=i2.getParent();if(e2){if((n2||!e2)&&null===r3&&hi(s2)&&s2.isInline()){const e3=s2.getPreviousSibling();Zn(e3)&&t2.set(e3.__key,e3.getTextContent().length,"text")}}else hi(r3)&&!n2&&r3.isInline()?t2.set(r3.__key,r3.getChildrenSize(),"element"):Zn(r3)&&t2.set(r3.__key,r3.getTextContent().length,"text")}else if(r2===i2.getTextContent().length){const r3=i2.getNextSibling(),s2=i2.getParent();if(e2&&hi(r3)&&r3.isInline())t2.set(r3.__key,0,"element");else if((n2||e2)&&null===r3&&hi(s2)&&s2.isInline()&&!s2.canInsertTextAfter()){const e3=s2.getNextSibling();Zn(e3)&&t2.set(e3.__key,0,"text")}}}function xr(t2,e2,n2){if("text"===t2.type&&"text"===e2.type){const r2=t2.isBefore(e2),i2=t2.is(e2);mr(t2,r2,i2),mr(e2,!r2,i2),i2&&e2.set(t2.key,t2.offset,t2.type);const s2=Gr();if(s2.isComposing()&&s2._compositionKey!==t2.key&&ar(n2)){const r3=n2.anchor,i3=n2.focus;t2.set(r3.key,r3.offset,r3.type,!0),e2.set(i3.key,i3.offset,i3.type,!0)}}}function Cr(t2,e2,n2,r2,i2,s2){if(null===t2||null===n2||!Zi(i2,t2,n2))return null;const o2=yr(t2,e2,ar(s2)?s2.anchor:null,i2);if(null===o2)return null;const l2=yr(n2,r2,ar(s2)?s2.focus:null,i2);if(null===l2)return null;if("element"===o2.type&&"element"===l2.type){const e3=Ts(t2),r3=Ts(n2);if(pi(e3)&&pi(r3))return null}return xr(o2,l2,s2),[o2,l2]}function Sr(t2){return hi(t2)&&!t2.isInline()}function vr(t2,e2,n2,r2,i2,s2){const o2=qr(),l2=new ur(sr(t2,e2,i2),sr(n2,r2,s2),0,"");return l2.dirty=!0,o2._selection=l2,l2}function kr(){const t2=sr("root",0,"element"),e2=sr("root",0,"element");return new ur(t2,e2,0,"")}function Tr(){return new cr(new Set)}function br(t2,e2,n2,r2){const i2=n2._window;if(null===i2)return null;const s2=r2||i2.event,o2=s2?s2.type:void 0,l2="selectionchange"===o2,c2=!X$2&&(l2||"beforeinput"===o2||"compositionstart"===o2||"compositionend"===o2||"click"===o2&&s2&&3===s2.detail||"drop"===o2||void 0===o2);let a2,u2,f3,d2;if(ar(t2)&&!c2)return t2.clone();if(null===e2)return null;if(a2=e2.anchorNode,u2=e2.focusNode,f3=e2.anchorOffset,d2=e2.focusOffset,l2&&ar(t2)&&!Zi(n2,a2,u2))return t2.clone();const h2=Cr(a2,f3,u2,d2,n2,t2);if(null===h2)return null;const[g2,_2]=h2;return new ur(g2,_2,ar(t2)?t2.format:0,ar(t2)?t2.style:"")}function wr(){return qr()._selection}function Er(){return Gr()._editorState._selection}function Or(t2,e2,n2,r2=1){const i2=t2.anchor,s2=t2.focus,o2=i2.getNode(),l2=s2.getNode();if(!e2.is(o2)&&!e2.is(l2))return;const c2=e2.__key;if(t2.isCollapsed()){const e3=i2.offset;if(n2<=e3&&r2>0||n2<e3&&r2<0){const n3=Math.max(0,e3+r2);i2.set(c2,n3,"element"),s2.set(c2,n3,"element"),Mr(t2)}}else{const o3=t2.isBackward(),l3=o3?s2:i2,a2=l3.getNode(),u2=o3?i2:s2,f3=u2.getNode();if(e2.is(a2)){const t3=l3.offset;(n2<=t3&&r2>0||n2<t3&&r2<0)&&l3.set(c2,Math.max(0,t3+r2),"element")}if(e2.is(f3)){const t3=u2.offset;(n2<=t3&&r2>0||n2<t3&&r2<0)&&u2.set(c2,Math.max(0,t3+r2),"element")}}Mr(t2)}function Mr(t2){const e2=t2.anchor,n2=e2.offset,r2=t2.focus,i2=r2.offset,s2=e2.getNode(),o2=r2.getNode();if(t2.isCollapsed()){if(!hi(s2))return;const t3=s2.getChildrenSize(),i3=n2>=t3,o3=i3?s2.getChildAtIndex(t3-1):s2.getChildAtIndex(n2);if(Zn(o3)){let t4=0;i3&&(t4=o3.getTextContentSize()),e2.set(o3.__key,t4,"text"),r2.set(o3.__key,t4,"text")}}else{if(hi(s2)){const t3=s2.getChildrenSize(),r3=n2>=t3,i3=r3?s2.getChildAtIndex(t3-1):s2.getChildAtIndex(n2);if(Zn(i3)){let t4=0;r3&&(t4=i3.getTextContentSize()),e2.set(i3.__key,t4,"text")}}if(hi(o2)){const t3=o2.getChildrenSize(),e3=i2>=t3,n3=e3?o2.getChildAtIndex(t3-1):o2.getChildAtIndex(i2);if(Zn(n3)){let t4=0;e3&&(t4=n3.getTextContentSize()),r2.set(n3.__key,t4,"text")}}}}function Ar(t2,e2,n2,r2,i2){let s2=null,o2=0,l2=null;null!==r2?(s2=r2.__key,Zn(r2)?(o2=r2.getTextContentSize(),l2="text"):hi(r2)&&(o2=r2.getChildrenSize(),l2="element")):null!==i2&&(s2=i2.__key,Zn(i2)?l2="text":hi(i2)&&(l2="element")),null!==s2&&null!==l2?t2.set(s2,o2,l2):(o2=e2.getIndexWithinParent(),-1===o2&&(o2=n2.getChildrenSize()),t2.set(n2.__key,o2,"element"))}function Pr(t2,e2,n2,r2,i2){"text"===t2.type?t2.set(n2,t2.offset+(e2?0:i2),"text"):t2.offset>r2.getIndexWithinParent()&&t2.set(t2.key,t2.offset-1,"element")}function Dr(t2,e2,n2,r2,i2){try{t2.setBaseAndExtent(e2,n2,r2,i2)}catch(t3){}}function Lr(t2){let e2=wr()||Er();null===e2&&(e2=Ss().selectEnd()),e2.insertNodes(t2)}function Kr(e2){let n2=e2;e2.isCollapsed()||n2.removeText();const r2=wr();ar(r2)&&(n2=r2),ar(n2)||t$2(161);const i2=n2.anchor;let s2=i2.getNode(),o2=i2.offset;for(;!vo(s2);){const t2=s2;if([s2,o2]=zr(s2,o2),t2.is(s2))break}return o2}function zr(t2,e2){const n2=t2.getParent();if(!n2){const t3=Fi();return Ss().append(t3),t3.select(),[Ss(),0]}if(Zn(t2)){const r3=t2.splitText(e2);if(0===r3.length)return[n2,t2.getIndexWithinParent()];const i2=0===e2?0:1;return[n2,r3[0].getIndexWithinParent()+i2]}if(!hi(t2)||0===e2)return[n2,t2.getIndexWithinParent()];const r2=t2.getChildAtIndex(e2);if(r2){const n3=new ur(sr(t2.__key,e2,"element"),sr(t2.__key,e2,"element"),0,""),i2=t2.insertNewAfter(n3);i2&&i2.append(r2,...r2.getNextSiblings())}return[n2,t2.getIndexWithinParent()+1]}function Br(t2,e2,n2,r2,i2="decorators-and-blocks"){if("move"===e2&&"character"===r2&&!t2.isCollapsed()){const[e3,r3]=n2===t2.isBackward()?[t2.focus,t2.anchor]:[t2.anchor,t2.focus];return r3.set(e3.key,e3.offset,e3.type),!0}const s2=_l(t2.focus,n2?"previous":"next"),o2="lineboundary"===r2,l2="move"===e2;let c2=s2,a2="decorators-and-blocks"===i2;if(!Nl(c2)){for(const t3 of c2){a2=!1;const{origin:e3}=t3;if(!pi(e3)||e3.isIsolated()||(c2=t3,!o2||!e3.isInline()))break}if(a2)for(const t3 of ol(s2).iterNodeCarets("extend"===e2?"shadowRoot":"root")){if(Vo(t3))t3.origin.isInline()||(c2=t3);else{if(hi(t3.origin))continue;pi(t3.origin)&&!t3.origin.isInline()&&(c2=t3)}break}}if(c2===s2)return!1;if(l2&&!o2&&pi(c2.origin)&&c2.origin.isKeyboardSelectable()){const t3=Tr();return t3.add(c2.origin.getKey()),ks(t3),!0}return c2=Tl(c2),l2&&pl(t2.anchor,c2),pl(t2.focus,c2),a2||!o2}let Rr=null,Wr=null,Jr=!1,$r=!1,jr=0;const Ur={characterData:!0,childList:!0,subtree:!0};function Vr(){return Jr||null!==Rr&&Rr._readOnly}function Yr(){Jr&&t$2(13)}function Hr(){jr>99&&t$2(14)}function qr(){return null===Rr&&t$2(195,Xr()),Rr}function Gr(){return null===Wr&&t$2(196,Xr()),Wr}function Xr(){let t2=0;const e2=new Set,n2=$i.version;if("undefined"!=typeof window)for(const r3 of document.querySelectorAll("[contenteditable]")){const i2=ns(r3);if(ts(i2))t2++;else if(i2){let t3=String(i2.constructor.version||"<0.17.1");t3===n2&&(t3+=" (separately built, likely a bundler configuration issue)"),e2.add(t3)}}let r2=` Detected on the page: ${t2} compatible editor(s) with version ${n2}`;return e2.size&&(r2+=` and incompatible editors with versions ${Array.from(e2).join(", ")}`),r2}function Zr(t2,e2,n2){const r2=e2.__type,i2=Hi(t2,r2);let s2=n2.get(r2);void 0===s2&&(s2=Array.from(i2.transforms),n2.set(r2,s2));const o2=s2.length;for(let t3=0;t3<o2&&(s2[t3](e2),e2.isAttached());t3++);}function ti(t2,e2){return void 0!==t2&&t2.__key!==e2&&t2.isAttached()}function ei(t2,e2){if(!e2)return;const n2=t2._updateTags;let r2=e2;Array.isArray(e2)||(r2=[e2]);for(const t3 of r2)n2.add(t3)}function ni(t2){return ri(t2,Gr()._nodes)}function ri(e2,n2){const r2=e2.type,i2=n2.get(r2);void 0===i2&&t$2(17,r2);const s2=i2.klass;e2.type!==s2.getType()&&t$2(18,s2.name);const o2=s2.importJSON(e2),l2=e2.children;if(hi(o2)&&Array.isArray(l2))for(let t2=0;t2<l2.length;t2++){const e3=ri(l2[t2],n2);o2.append(e3)}return o2}function ii(t2,e2,n2){const r2=Rr,i2=Jr,s2=Wr;Rr=e2,Jr=!0,Wr=t2;try{return n2()}finally{Rr=r2,Jr=i2,Wr=s2}}function si(t2,e2){const n2=t2._pendingEditorState,r2=t2._rootElement,i2=t2._headless||null===r2;if(null===n2)return;const s2=t2._editorState,o2=s2._selection,l2=n2._selection,c2=0!==t2._dirtyType,a2=Rr,u2=Jr,f3=Wr,h2=t2._updating,g2=t2._observer;let _2=null;if(t2._pendingEditorState=null,t2._editorState=n2,!i2&&c2&&null!==g2){Wr=t2,Rr=n2,Jr=!1,t2._updating=!0;try{const e3=t2._dirtyType,r3=t2._dirtyElements,i3=t2._dirtyLeaves;g2.disconnect(),_2=function(t2,e2,n2,r2,i2,s2){It$2="",Bt$1="",Rt$1=2===r2,wt$3=n2,bt$2=n2._config,Et$2=n2._nodes,Ot$1=wt$3._listeners.mutation,Mt$2=i2,At$2=s2,Pt$3=t2._nodeMap,Dt$1=e2._nodeMap,Wt=e2._readOnly,Ft$2=new Map(n2._keyToDOMMap);const o2=new Map;return Lt$2=o2,ee$1("root",null),wt$3=void 0,Et$2=void 0,Mt$2=void 0,At$2=void 0,Pt$3=void 0,Dt$1=void 0,bt$2=void 0,Ft$2=void 0,Lt$2=void 0,o2}(s2,n2,t2,e3,r3,i3)}catch(e3){if(e3 instanceof Error&&t2._onError(e3),$r)throw e3;return Wi(t2,null,r2,n2),ot$2(t2),t2._dirtyType=2,$r=!0,si(t2,s2),void($r=!1)}finally{g2.observe(r2,Ur),t2._updating=h2,Rr=a2,Jr=u2,Wr=f3}}n2._readOnly||(n2._readOnly=!0);const p2=t2._dirtyLeaves,m3=t2._dirtyElements,C2=t2._normalizedNodes,S3=t2._updateTags,v2=t2._deferred;c2&&(t2._dirtyType=0,t2._cloneNotNeeded.clear(),t2._dirtyLeaves=new Set,t2._dirtyElements=new Map,t2._normalizedNodes=new Set,t2._updateTags=new Set),function(t3,e3){const n3=t3._decorators;let r3=t3._pendingDecorators||n3;const i3=e3._nodeMap;let s3;for(s3 in r3)i3.has(s3)||(r3===n3&&(r3=xs(t3)),delete r3[s3])}(t2,n2);const k3=i2?null:ho(no(t2));if(t2._editable&&null!==k3&&(c2||null===l2||l2.dirty)&&null!==r2&&!S3.has(Mi)){Wr=t2,Rr=n2;try{if(null!==g2&&g2.disconnect(),c2||null===l2||l2.dirty){const e3=t2._blockCursorElement;null!==e3&&fo(e3,t2,r2),function(t2,e2,n2,r2,i2,s2){const l2=r2.anchorNode,c2=r2.focusNode,a2=r2.anchorOffset,u2=r2.focusOffset,f3=document.activeElement;if(i2.has(wi)&&f3!==s2||null!==f3&&Qi(f3))return;if(!ar(e2))return void(null!==t2&&Zi(n2,l2,c2)&&r2.removeAllRanges());const d2=e2.anchor,h2=e2.focus,g2=d2.key,_2=h2.key,p2=Hs(n2,g2),y2=Hs(n2,_2),m3=d2.offset,x2=h2.offset,C2=e2.format,S3=e2.style,v2=e2.isCollapsed();let k3=p2,T3=y2,N2=!1;if("text"===d2.type){k3=ls(p2);const t3=d2.getNode();N2=t3.getFormat()!==C2||t3.getStyle()!==S3}else ar(t2)&&"text"===t2.anchor.type&&(N2=!0);var b2,w2,E2,O2,M2;if("text"===h2.type&&(T3=ls(y2)),null!==k3&&null!==T3&&(v2&&(null===t2||N2||ar(t2)&&(t2.format!==C2||t2.style!==S3))&&(b2=C2,w2=S3,E2=m3,O2=g2,M2=performance.now(),gn=[b2,w2,E2,O2,M2]),a2!==m3||u2!==x2||l2!==k3||c2!==T3||"Range"===r2.type&&v2||(null!==f3&&s2.contains(f3)||s2.focus({preventScroll:!0}),"element"===d2.type))){if(Dr(r2,k3,m3,T3,x2),!i2.has(Oi)&&e2.isCollapsed()&&null!==s2&&s2===document.activeElement){const t3=ar(e2)&&"element"===e2.anchor.type?k3.childNodes[m3]||null:r2.rangeCount>0?r2.getRangeAt(0):null;if(null!==t3){let e3;if(t3 instanceof Text){const n3=document.createRange();n3.selectNode(t3),e3=n3.getBoundingClientRect()}else e3=t3.getBoundingClientRect();!function(t4,e4,n3){const r3=Gs(n3),i3=eo(r3);if(null===r3||null===i3)return;let{top:s3,bottom:o3}=e4,l3=0,c3=0,a3=n3;for(;null!==a3;){const e5=a3===r3.body;if(e5)l3=0,c3=no(t4).innerHeight;else{const t5=a3.getBoundingClientRect();l3=t5.top,c3=t5.bottom}let n4=0;if(s3<l3?n4=-(l3-s3):o3>c3&&(n4=o3-c3),0!==n4)if(e5)i3.scrollBy(0,n4);else{const t5=a3.scrollTop;a3.scrollTop+=n4;const e6=a3.scrollTop-t5;s3-=e6,o3-=e6}if(e5)break;a3=qs(a3)}}(n2,e3,s2)}}ln=!0}}(o2,l2,t2,k3,S3,r2)}!function(t3,e3,n3){let r3=t3._blockCursorElement;if(ar(n3)&&n3.isCollapsed()&&"element"===n3.anchor.type&&e3.contains(document.activeElement)){const i3=n3.anchor,s3=i3.getNode(),o3=i3.offset;let l3=!1,c3=null;if(o3===s3.getChildrenSize())uo(s3.getChildAtIndex(o3-1))&&(l3=!0);else{const e4=s3.getChildAtIndex(o3);if(null!==e4&&uo(e4)){const n4=e4.getPreviousSibling();(null===n4||uo(n4))&&(l3=!0,c3=t3.getElementByKey(e4.__key))}}if(l3){const n4=t3.getElementByKey(s3.__key);return null===r3&&(t3._blockCursorElement=r3=function(t4){const e4=t4.theme,n5=document.createElement("div");n5.contentEditable="false",n5.setAttribute("data-lexical-cursor","true");let r4=e4.blockCursor;if(void 0!==r4){if("string"==typeof r4){const t5=d$3(r4);r4=e4.blockCursor=t5}void 0!==r4&&n5.classList.add(...r4)}return n5}(t3._config)),e3.style.caretColor="transparent",void(null===c3?n4.appendChild(r3):n4.insertBefore(r3,c3))}}null!==r3&&fo(r3,t3,e3)}(t2,r2,l2)}finally{null!==g2&&g2.observe(r2,Ur),Wr=f3,Rr=a2}}null!==_2&&function(t3,e3,n3,r3,i3){const s3=Array.from(t3._listeners.mutation),o3=s3.length;for(let t4=0;t4<o3;t4++){const[o4,l3]=s3[t4];for(const t5 of l3){const s4=e3.get(t5);void 0!==s4&&o4(s4,{dirtyLeaves:r3,prevEditorState:i3,updateTags:n3})}}}(t2,_2,S3,p2,s2),ar(l2)||null===l2||null!==o2&&o2.is(l2)||t2.dispatchCommand(le,void 0);const T3=t2._pendingDecorators;null!==T3&&(t2._decorators=T3,t2._pendingDecorators=null,oi("decorator",t2,!0,T3)),function(t3,e3,n3){const r3=Cs(e3),i3=Cs(n3);r3!==i3&&oi("textcontent",t3,!0,i3)}(t2,e2||s2,n2),oi("update",t2,!0,{dirtyElements:m3,dirtyLeaves:p2,editorState:n2,mutatedNodes:_2,normalizedNodes:C2,prevEditorState:e2||s2,tags:S3}),function(t3,e3){if(t3._deferred=[],0!==e3.length){const n3=t3._updating;t3._updating=!0;try{for(let t4=0;t4<e3.length;t4++)e3[t4]()}finally{t3._updating=n3}}}(t2,v2),function(t3){const e3=t3._updates;if(0!==e3.length){const n3=e3.shift();if(n3){const[e4,r3]=n3;ci(t3,e4,r3)}}}(t2)}function oi(t2,e2,n2,...r2){const i2=e2._updating;e2._updating=n2;try{const n3=Array.from(e2._listeners[t2]);for(let t3=0;t3<n3.length;t3++)n3[t3].apply(null,r2)}finally{e2._updating=i2}}function li(e2,n2){const r2=e2._updates;let i2=n2||!1;for(;0!==r2.length;){const n3=r2.shift();if(n3){const[r3,s2]=n3,o2=e2._pendingEditorState;let l2;void 0!==s2&&(l2=s2.onUpdate,s2.skipTransforms&&(i2=!0),s2.discrete&&(null===o2&&t$2(191),o2._flushSync=!0),l2&&e2._deferred.push(l2),ei(e2,s2.tag)),null==o2?ci(e2,r3,s2):r3()}}return i2}function ci(e2,n2,r2){const i2=e2._updateTags;let s2,o2=!1,l2=!1;void 0!==r2&&(s2=r2.onUpdate,ei(e2,r2.tag),o2=r2.skipTransforms||!1,l2=r2.discrete||!1),s2&&e2._deferred.push(s2);const c2=e2._editorState;let a2=e2._pendingEditorState,u2=!1;(null===a2||a2._readOnly)&&(a2=e2._pendingEditorState=xi(a2||c2),u2=!0),a2._flushSync=l2;const f3=Rr,d2=Jr,h2=Wr,g2=e2._updating;Rr=a2,Jr=!1,e2._updating=!0,Wr=e2;const _2=e2._headless||null===e2.getRootElement();Ui(null);try{u2&&(_2?null!==c2._selection&&(a2._selection=c2._selection.clone()):a2._selection=function(t2,e3){const n3=t2.getEditorState()._selection,r3=ho(no(t2));return ar(n3)||null==n3?br(n3,r3,t2,e3):n3.clone()}(e2,r2&&r2.event||null));const i3=e2._compositionKey;n2(),o2=li(e2,o2),function(t2,e3){const n3=e3.getEditorState()._selection,r3=t2._selection;if(ar(r3)){const t3=r3.anchor,e4=r3.focus;let i4;if("text"===t3.type&&(i4=t3.getNode(),i4.selectionTransform(n3,r3)),"text"===e4.type){const t4=e4.getNode();i4!==t4&&t4.selectionTransform(n3,r3)}}}(a2,e2),0!==e2._dirtyType&&(o2?function(t2,e3){const n3=e3._dirtyLeaves,r3=t2._nodeMap;for(const t3 of n3){const e4=r3.get(t3);Zn(e4)&&e4.isAttached()&&e4.isSimpleText()&&!e4.isUnmergeable()&&kt$1(e4)}}(a2,e2):function(t2,e3){const n3=e3._dirtyLeaves,r3=e3._dirtyElements,i4=t2._nodeMap,s4=gs(),o3=new Map;let l3=n3,c3=l3.size,a3=r3,u3=a3.size;for(;c3>0||u3>0;){if(c3>0){e3._dirtyLeaves=new Set;for(const t3 of l3){const r4=i4.get(t3);Zn(r4)&&r4.isAttached()&&r4.isSimpleText()&&!r4.isUnmergeable()&&kt$1(r4),void 0!==r4&&ti(r4,s4)&&Zr(e3,r4,o3),n3.add(t3)}if(l3=e3._dirtyLeaves,c3=l3.size,c3>0){jr++;continue}}e3._dirtyLeaves=new Set,e3._dirtyElements=new Map,a3.delete("root")&&a3.set("root",!0);for(const t3 of a3){const n4=t3[0],l4=t3[1];if(r3.set(n4,l4),!l4)continue;const c4=i4.get(n4);void 0!==c4&&ti(c4,s4)&&Zr(e3,c4,o3)}l3=e3._dirtyLeaves,c3=l3.size,a3=e3._dirtyElements,u3=a3.size,jr++}e3._dirtyLeaves=n3,e3._dirtyElements=r3}(a2,e2),li(e2),function(t2,e3,n3,r3){const i4=t2._nodeMap,s4=e3._nodeMap,o3=[];for(const[t3]of r3){const e4=s4.get(t3);void 0!==e4&&(e4.isAttached()||(hi(e4)&&q$2(e4,t3,i4,s4,o3,r3),i4.has(t3)||r3.delete(t3),o3.push(t3)))}for(const t3 of o3)s4.delete(t3);for(const t3 of n3){const e4=s4.get(t3);void 0===e4||e4.isAttached()||(i4.has(t3)||n3.delete(t3),s4.delete(t3))}}(c2,a2,e2._dirtyLeaves,e2._dirtyElements)),i3!==e2._compositionKey&&(a2._flushSync=!0);const s3=a2._selection;if(ar(s3)){const e3=a2._nodeMap,n3=s3.anchor.key,r3=s3.focus.key;void 0!==e3.get(n3)&&void 0!==e3.get(r3)||t$2(19)}else fr(s3)&&0===s3._nodes.size&&(a2._selection=null)}catch(t2){return t2 instanceof Error&&e2._onError(t2),e2._pendingEditorState=c2,e2._dirtyType=2,e2._cloneNotNeeded.clear(),e2._dirtyLeaves=new Set,e2._dirtyElements.clear(),void si(e2)}finally{Rr=f3,Jr=d2,Wr=h2,e2._updating=g2,jr=0}0!==e2._dirtyType||e2._deferred.length>0||function(t2,e3){const n3=e3.getEditorState()._selection,r3=t2._selection;if(null!==r3){if(r3.dirty||!r3.is(n3))return!0}else if(null!==n3)return!0;return!1}(a2,e2)?a2._flushSync?(a2._flushSync=!1,si(e2)):u2&&Gi(()=>{si(e2)}):(a2._flushSync=!1,u2&&(i2.clear(),e2._deferred=[],e2._pendingEditorState=null))}function ai(t2,e2,n2){Wr===t2&&void 0===n2?e2():ci(t2,e2,n2)}class ui{constructor(t2,e2,n2){this.element=t2,this.before=e2||null,this.after=n2||null}withBefore(t2){return new ui(this.element,t2,this.after)}withAfter(t2){return new ui(this.element,this.before,t2)}withElement(t2){return this.element===t2?this:new ui(t2,this.before,this.after)}insertChild(e2){const n2=this.before||this.getManagedLineBreak();return null!==n2&&n2.parentElement!==this.element&&t$2(222),this.element.insertBefore(e2,n2),this}removeChild(e2){return e2.parentElement!==this.element&&t$2(223),this.element.removeChild(e2),this}replaceChild(e2,n2){return n2.parentElement!==this.element&&t$2(224),this.element.replaceChild(e2,n2),this}getFirstChild(){const t2=this.after?this.after.nextSibling:this.element.firstChild;return t2===this.before||t2===this.getManagedLineBreak()?null:t2}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(t2){if(null===t2)this.removeManagedLineBreak();else{const e2="decorator"===t2&&(l$2||o$4);this.insertManagedLineBreak(e2)}}removeManagedLineBreak(){const t2=this.getManagedLineBreak();if(t2){const e2=this.element,n2="IMG"===t2.nodeName?t2.nextSibling:null;n2&&e2.removeChild(n2),e2.removeChild(t2),e2.__lexicalLineBreak=void 0}}insertManagedLineBreak(t2){const e2=this.getManagedLineBreak();if(e2){if(t2===("IMG"===e2.nodeName))return;this.removeManagedLineBreak()}const n2=this.element,r2=this.before,i2=document.createElement("br");if(n2.insertBefore(i2,r2),t2){const t3=document.createElement("img");t3.setAttribute("data-lexical-linebreak","true"),t3.style.cssText="display: inline !important; border: 0px !important; margin: 0px !important;",t3.alt="",n2.insertBefore(t3,i2),n2.__lexicalLineBreak=t3}else n2.__lexicalLineBreak=i2}getFirstChildOffset(){let t2=0;for(let e2=this.after;null!==e2;e2=e2.previousSibling)t2++;return t2}resolveChildIndex(t2,e2,n2,r2){if(n2===this.element){const e3=this.getFirstChildOffset();return[t2,Math.min(e3+t2.getChildrenSize(),Math.max(e3,r2))]}const i2=fi(e2,n2);i2.push(r2);const s2=fi(e2,this.element);let o2=t2.getIndexWithinParent();for(let t3=0;t3<s2.length;t3++){const e3=i2[t3],n3=s2[t3];if(void 0===e3||e3<n3)break;if(e3>n3){o2+=1;break}}return[t2.getParentOrThrow(),o2]}}function fi(e2,n2){const r2=[];let i2=n2;for(;i2!==e2&&null!==i2;i2=i2.parentNode){let t2=0;for(let e3=i2.previousSibling;null!==e3;e3=e3.previousSibling)t2++;r2.push(t2)}return i2!==e2&&t$2(225),r2.reverse()}class di extends An{constructor(t2){super(t2),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle=""}afterCloneFrom(t2){super.afterCloneFrom(t2),this.__key===t2.__key&&(this.__first=t2.__first,this.__last=t2.__last,this.__size=t2.__size),this.__indent=t2.__indent,this.__format=t2.__format,this.__style=t2.__style,this.__dir=t2.__dir,this.__textFormat=t2.__textFormat,this.__textStyle=t2.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){const t2=this.getFormat();return j$4[t2]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){const t2=[];let e2=this.getFirstChild();for(;null!==e2;)t2.push(e2),e2=e2.getNextSibling();return t2}getChildrenKeys(){const t2=[];let e2=this.getFirstChild();for(;null!==e2;)t2.push(e2.__key),e2=e2.getNextSibling();return t2}getChildrenSize(){return this.getLatest().__size}isEmpty(){return 0===this.getChildrenSize()}isDirty(){const t2=Gr()._dirtyElements;return null!==t2&&t2.has(this.__key)}isLastChild(){const t2=this.getLatest(),e2=this.getParentOrThrow().getLastChild();return null!==e2&&e2.is(t2)}getAllTextNodes(){const t2=[];let e2=this.getFirstChild();for(;null!==e2;){if(Zn(e2)&&t2.push(e2),hi(e2)){const n2=e2.getAllTextNodes();t2.push(...n2)}e2=e2.getNextSibling()}return t2}getFirstDescendant(){let t2=this.getFirstChild();for(;hi(t2);){const e2=t2.getFirstChild();if(null===e2)break;t2=e2}return t2}getLastDescendant(){let t2=this.getLastChild();for(;hi(t2);){const e2=t2.getLastChild();if(null===e2)break;t2=e2}return t2}getDescendantByIndex(t2){const e2=this.getChildren(),n2=e2.length;if(t2>=n2){const t3=e2[n2-1];return hi(t3)&&t3.getLastDescendant()||t3||null}const r2=e2[t2];return hi(r2)&&r2.getFirstDescendant()||r2||null}getFirstChild(){const t2=this.getLatest().__first;return null===t2?null:_s(t2)}getFirstChildOrThrow(){const e2=this.getFirstChild();return null===e2&&t$2(45,this.__key),e2}getLastChild(){const t2=this.getLatest().__last;return null===t2?null:_s(t2)}getLastChildOrThrow(){const e2=this.getLastChild();return null===e2&&t$2(96,this.__key),e2}getChildAtIndex(t2){const e2=this.getChildrenSize();let n2,r2;if(t2<e2/2){for(n2=this.getFirstChild(),r2=0;null!==n2&&r2<=t2;){if(r2===t2)return n2;n2=n2.getNextSibling(),r2++}return null}for(n2=this.getLastChild(),r2=e2-1;null!==n2&&r2>=t2;){if(r2===t2)return n2;n2=n2.getPreviousSibling(),r2--}return null}getTextContent(){let t2="";const e2=this.getChildren(),n2=e2.length;for(let r2=0;r2<n2;r2++){const i2=e2[r2];t2+=i2.getTextContent(),hi(i2)&&r2!==n2-1&&!i2.isInline()&&(t2+="\n\n")}return t2}getTextContentSize(){let t2=0;const e2=this.getChildren(),n2=e2.length;for(let r2=0;r2<n2;r2++){const i2=e2[r2];t2+=i2.getTextContentSize(),hi(i2)&&r2!==n2-1&&!i2.isInline()&&(t2+=2)}return t2}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(t2){if(""!==t2){const e2=$$3[t2];return!!(this.getFormat()&e2)}return!1}hasTextFormat(t2){const e2=W$2[t2];return!!(this.getTextFormat()&e2)}getFormatFlags(t2,e2){return cs(this.getLatest().__textFormat,t2,e2)}getTextStyle(){return this.getLatest().__textStyle}select(t2,e2){Yr();const n2=wr();let r2=t2,i2=e2;const s2=this.getChildrenSize();if(!this.canBeEmpty())if(0===t2&&0===e2){const t3=this.getFirstChild();if(Zn(t3)||hi(t3))return t3.select(0,0)}else if(!(void 0!==t2&&t2!==s2||void 0!==e2&&e2!==s2)){const t3=this.getLastChild();if(Zn(t3)||hi(t3))return t3.select()}void 0===r2&&(r2=s2),void 0===i2&&(i2=s2);const o2=this.__key;return ar(n2)?(n2.anchor.set(o2,r2,"element"),n2.focus.set(o2,i2,"element"),n2.dirty=!0,n2):vr(o2,r2,o2,i2,"element","element")}selectStart(){const t2=this.getFirstDescendant();return t2?t2.selectStart():this.select()}selectEnd(){const t2=this.getLastDescendant();return t2?t2.selectEnd():this.select()}clear(){const t2=this.getWritable();return this.getChildren().forEach(t3=>t3.remove()),t2}append(...t2){return this.splice(this.getChildrenSize(),0,t2)}setDirection(t2){const e2=this.getWritable();return e2.__dir=t2,e2}setFormat(t2){return this.getWritable().__format=""!==t2?$$3[t2]:0,this}setStyle(t2){return this.getWritable().__style=t2||"",this}setTextFormat(t2){const e2=this.getWritable();return e2.__textFormat=t2,e2}setTextStyle(t2){const e2=this.getWritable();return e2.__textStyle=t2,e2}setIndent(t2){return this.getWritable().__indent=t2,this}splice(e2,n2,r2){const i2=r2.length,s2=this.getChildrenSize(),o2=this.getWritable();e2+n2<=s2||t$2(226,String(e2),String(n2),String(s2));const l2=o2.__key,c2=[],a2=[],u2=this.getChildAtIndex(e2+n2);let f3=null,d2=s2-n2+i2;if(0!==e2)if(e2===s2)f3=this.getLastChild();else{const t2=this.getChildAtIndex(e2);null!==t2&&(f3=t2.getPreviousSibling())}if(n2>0){let e3=null===f3?this.getFirstChild():f3.getNextSibling();for(let r3=0;r3<n2;r3++){null===e3&&t$2(100);const n3=e3.getNextSibling(),r4=e3.__key;fs(e3.getWritable()),a2.push(r4),e3=n3}}let h2=f3;for(let e3=0;e3<i2;e3++){const n3=r2[e3];null!==h2&&n3.is(h2)&&(f3=h2=h2.getPreviousSibling());const i3=n3.getWritable();i3.__parent===l2&&d2--,fs(i3);const s3=n3.__key;if(null===h2)o2.__first=s3,i3.__prev=null;else{const t2=h2.getWritable();t2.__next=s3,i3.__prev=t2.__key}n3.__key===l2&&t$2(76),i3.__parent=l2,c2.push(s3),h2=n3}if(e2+n2===s2)null!==h2&&(h2.getWritable().__next=null,o2.__last=h2.__key);else if(null!==u2){const t2=u2.getWritable();if(null!==h2){const e3=h2.getWritable();t2.__prev=h2.__key,e3.__next=u2.__key}else t2.__prev=null}if(o2.__size=d2,a2.length){const t2=wr();if(ar(t2)){const e3=new Set(a2),n3=new Set(c2),{anchor:r3,focus:i3}=t2;gi(r3,e3,n3)&&Ar(r3,r3.getNode(),this,f3,u2),gi(i3,e3,n3)&&Ar(i3,i3.getNode(),this,f3,u2),0!==d2||this.canBeEmpty()||so(this)||this.remove()}}return o2}getDOMSlot(t2){return new ui(t2)}exportDOM(t2){const{element:e2}=super.exportDOM(t2);if(yo(e2)){const t3=this.getIndent();t3>0&&(e2.style.paddingInlineStart=40*t3+"px");const n2=this.getDirection();n2&&(e2.dir=n2)}return{element:e2}}exportJSON(){const t2={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},e2=this.getTextFormat(),n2=this.getTextStyle();return 0!==e2&&(t2.textFormat=e2),""!==n2&&(t2.textStyle=n2),t2}updateFromJSON(t2){return super.updateFromJSON(t2).setFormat(t2.format).setIndent(t2.indent).setDirection(t2.direction).setTextFormat(t2.textFormat||0).setTextStyle(t2.textStyle||"")}insertNewAfter(t2,e2){return null}canIndent(){return!0}collapseAtStart(t2){return!1}excludeFromCopy(t2){return!1}canReplaceWith(t2){return!0}canInsertAfter(t2){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(t2){return!1}extractWithChild(t2,e2,n2){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(t2,e2){const n2=this.getDOMSlot(t2);let r2=n2.getFirstChild();for(let t3=this.getFirstChild();t3;t3=t3.getNextSibling()){const i2=e2.getElementByKey(t3.getKey());null!==i2&&(null==r2?(n2.insertChild(i2),r2=i2):r2!==i2&&n2.replaceChild(i2,r2),r2=r2.nextSibling)}}}function hi(t2){return t2 instanceof di}function gi(t2,e2,n2){let r2=t2.getNode();for(;r2;){const t3=r2.__key;if(e2.has(t3)&&!n2.has(t3))return!0;r2=r2.getParent()}return!1}class _i extends An{decorate(e2,n2){t$2(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function pi(t2){return t2 instanceof _i}class yi extends di{static getType(){return"root"}static clone(){return new yi}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){t$2(51)}getTextContent(){const t2=this.__cachedText;return!Vr()&&0!==Gr()._dirtyType||null===t2?super.getTextContent():t2}remove(){t$2(52)}replace(e2){t$2(53)}insertBefore(e2){t$2(54)}insertAfter(e2){t$2(55)}updateDOM(t2,e2){return!1}splice(e2,n2,r2){for(const e3 of r2)hi(e3)||pi(e3)||t$2(282);return super.splice(e2,n2,r2)}static importJSON(t2){return Ss().updateFromJSON(t2)}collapseAtStart(){return!0}}function mi(t2){return t2 instanceof yi}function xi(t2){return new vi(new Map(t2._nodeMap))}function Ci(){return new vi(new Map([["root",new yi]]))}function Si(e2){const n2=e2.exportJSON(),r2=e2.constructor;if(n2.type!==r2.getType()&&t$2(130,r2.name),hi(e2)){const i2=n2.children;Array.isArray(i2)||t$2(59,r2.name);const s2=e2.getChildren();for(let t2=0;t2<s2.length;t2++){const e3=Si(s2[t2]);i2.push(e3)}}return n2}class vi{constructor(t2,e2){this._nodeMap=t2,this._selection=e2||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return 1===this._nodeMap.size&&null===this._selection}read(t2,e2){return ii(e2&&e2.editor||null,this,t2)}clone(t2){const e2=new vi(this._nodeMap,void 0===t2?this._selection:t2);return e2._readOnly=!0,e2}toJSON(){return ii(null,this,()=>({root:Si(Ss())}))}}const ki="historic",Ni="history-merge",wi="collaboration",Oi="skip-scroll-into-view",Mi="skip-dom-selection";class Ai extends di{static getType(){return"artificial"}createDOM(t2){return document.createElement("div")}}class Pi extends di{static getType(){return"paragraph"}static clone(t2){return new Pi(t2.__key)}createDOM(t2){const e2=document.createElement("p"),n2=Rs(t2.theme,"paragraph");return void 0!==n2&&e2.classList.add(...n2),e2}updateDOM(t2,e2,n2){return!1}static importDOM(){return{p:t2=>({conversion:Di,priority:0})}}exportDOM(t2){const{element:e2}=super.exportDOM(t2);if(yo(e2)){this.isEmpty()&&e2.append(document.createElement("br"));const t3=this.getFormatType();t3&&(e2.style.textAlign=t3)}return{element:e2}}static importJSON(t2){return Fi().updateFromJSON(t2)}exportJSON(){return{...super.exportJSON(),textFormat:this.getTextFormat(),textStyle:this.getTextStyle()}}insertNewAfter(t2,e2){const n2=Fi();n2.setTextFormat(t2.format),n2.setTextStyle(t2.style);const r2=this.getDirection();return n2.setDirection(r2),n2.setFormat(this.getFormatType()),n2.setStyle(this.getStyle()),this.insertAfter(n2,e2),n2}collapseAtStart(){const t2=this.getChildren();if(0===t2.length||Zn(t2[0])&&""===t2[0].getTextContent().trim()){if(null!==this.getNextSibling())return this.selectNext(),this.remove(),!0;if(null!==this.getPreviousSibling())return this.selectPrevious(),this.remove(),!0}return!1}}function Di(t2){const e2=Fi();return t2.style&&(e2.setFormat(t2.style.textAlign),Oo(t2,e2)),{node:e2}}function Fi(){return lo(new Pi)}function Li(t2){return t2 instanceof Pi}function Wi(t2,e2,n2,r2){const i2=t2._keyToDOMMap;i2.clear(),t2._editorState=Ci(),t2._pendingEditorState=r2,t2._compositionKey=null,t2._dirtyType=0,t2._cloneNotNeeded.clear(),t2._dirtyLeaves=new Set,t2._dirtyElements.clear(),t2._normalizedNodes=new Set,t2._updateTags=new Set,t2._updates=[],t2._blockCursorElement=null;const s2=t2._observer;null!==s2&&(s2.disconnect(),t2._observer=null),null!==e2&&(e2.textContent=""),null!==n2&&(n2.textContent="",i2.set("root",n2))}function Ji(t2){const e2=t2||{},n2=Wr,r2=e2.theme||{},i2=void 0===t2?n2:e2.parentEditor||null,s2=e2.disableEvents||!1,o2=Ci(),l2=e2.namespace||(null!==i2?i2._config.namespace:ws()),c2=e2.editorState,a2=[yi,$n,Pn,er,Pi,Ai,...e2.nodes||[]],{onError:u2,html:f3}=e2,d2=void 0===e2.editable||e2.editable;let h2;if(void 0===t2&&null!==n2)h2=n2._nodes;else{h2=new Map;for(let t3=0;t3<a2.length;t3++){let e3=a2[t3],n3=null,r3=null;if("function"!=typeof e3){const t4=e3;e3=t4.replace,n3=t4.with,r3=t4.withKlass||null}const{ownNodeConfig:i3}=Do(e3),s3=e3.getType(),o3=e3.transform(),l3=new Set;i3&&i3.$transform&&l3.add(i3.$transform),null!==o3&&l3.add(o3),h2.set(s3,{exportDOM:f3&&f3.export?f3.export.get(e3):void 0,klass:e3,replace:n3,replaceWithKlass:r3,sharedNodeState:dt$2(a2[t3]),transforms:l3})}}const g2=new $i(o2,i2,h2,{disableEvents:s2,namespace:l2,theme:r2},u2||console.error,function(t3,e3){const n3=new Map,r3=new Set,i3=t4=>{Object.keys(t4).forEach(e4=>{let r4=n3.get(e4);void 0===r4&&(r4=[],n3.set(e4,r4)),r4.push(t4[e4])})};return t3.forEach(t4=>{const e4=t4.klass.importDOM;if(null==e4||r3.has(e4))return;r3.add(e4);const n4=e4.call(t4.klass);null!==n4&&i3(n4)}),e3&&i3(e3),n3}(h2,f3?f3.import:void 0),d2,t2);return void 0!==c2&&(g2._pendingEditorState=c2,g2._dirtyType=2),g2}class $i{constructor(t2,e2,n2,r2,i2,s2,o2,l2){this._createEditorArgs=l2,this._parentEditor=e2,this._rootElement=null,this._editorState=t2,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=r2,this._nodes=n2,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=ws(),this._onError=i2,this._htmlConversions=s2,this._editable=o2,this._headless=null!==e2&&e2._headless,this._window=null,this._blockCursorElement=null}isComposing(){return null!=this._compositionKey}registerUpdateListener(t2){const e2=this._listeners.update;return e2.add(t2),()=>{e2.delete(t2)}}registerEditableListener(t2){const e2=this._listeners.editable;return e2.add(t2),()=>{e2.delete(t2)}}registerDecoratorListener(t2){const e2=this._listeners.decorator;return e2.add(t2),()=>{e2.delete(t2)}}registerTextContentListener(t2){const e2=this._listeners.textcontent;return e2.add(t2),()=>{e2.delete(t2)}}registerRootListener(t2){const e2=this._listeners.root;return t2(this._rootElement,null),e2.add(t2),()=>{t2(null,this._rootElement),e2.delete(t2)}}registerCommand(e2,n2,r2){void 0===r2&&t$2(35);const i2=this._commands;i2.has(e2)||i2.set(e2,[new Set,new Set,new Set,new Set,new Set]);const s2=i2.get(e2);void 0===s2&&t$2(36,String(e2));const o2=s2[r2];return o2.add(n2),()=>{o2.delete(n2),s2.every(t2=>0===t2.size)&&i2.delete(e2)}}registerMutationListener(t2,e2,n2){const r2=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(t2)).klass,i2=this._listeners.mutation;let s2=i2.get(e2);void 0===s2&&(s2=new Set,i2.set(e2,s2)),s2.add(r2);const o2=n2&&n2.skipInitialization;return void 0!==o2&&o2||this.initializeMutationListener(e2,r2),()=>{s2.delete(r2),0===s2.size&&i2.delete(e2)}}getRegisteredNode(e2){const n2=this._nodes.get(e2.getType());return void 0===n2&&t$2(37,e2.name),n2}resolveRegisteredNodeAfterReplacements(t2){for(;t2.replaceWithKlass;)t2=this.getRegisteredNode(t2.replaceWithKlass);return t2}initializeMutationListener(t2,e2){const n2=this._editorState,r2=wo(n2).get(e2.getType());if(!r2)return;const i2=new Map;for(const t3 of r2.keys())i2.set(t3,"created");i2.size>0&&t2(i2,{dirtyLeaves:new Set,prevEditorState:n2,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(t2,e2){const n2=this.getRegisteredNode(t2);return n2.transforms.add(e2),n2}registerNodeTransform(t2,e2){const n2=this.registerNodeTransformToKlass(t2,e2),r2=[n2],i2=n2.replaceWithKlass;if(null!=i2){const t3=this.registerNodeTransformToKlass(i2,e2);r2.push(t3)}return function(t3,e3){const n3=wo(t3.getEditorState()),r3=[];for(const t4 of e3){const e4=n3.get(t4);e4&&r3.push(e4)}0!==r3.length&&t3.update(()=>{for(const t4 of r3)for(const e4 of t4.keys()){const t5=_s(e4);t5&&t5.markDirty()}},null===t3._pendingEditorState?{tag:Ni}:void 0)}(this,r2.map(t3=>t3.klass.getType())),()=>{r2.forEach(t3=>t3.transforms.delete(e2))}}hasNode(t2){return this._nodes.has(t2.getType())}hasNodes(t2){return t2.every(this.hasNode.bind(this))}dispatchCommand(t2,e2){return Vs(this,t2,e2)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(t2){const e2=this._rootElement;if(t2!==e2){const n2=Rs(this._config.theme,"root"),r2=this._pendingEditorState||this._editorState;if(this._rootElement=t2,Wi(this,e2,t2,r2),null!==e2&&(this._config.disableEvents||function(e2){const n2=e2.ownerDocument,r2=on.get(n2);if(void 0===r2)return;const i2=r2-1;i2>=0||t$2(164),on.set(n2,i2),0===i2&&n2.removeEventListener("selectionchange",Tn);const s2=ns(e2);ts(s2)?(function(t2){if(null!==t2._parentEditor){const e3=bs(t2),n3=e3[e3.length-1]._key;kn.get(n3)===t2&&kn.delete(n3)}else kn.delete(t2._key)}(s2),e2.__lexicalEditor=null):s2&&t$2(198);const o2=vn(e2);for(let t2=0;t2<o2.length;t2++)o2[t2]();e2.__lexicalEventHandles=[]}(e2),null!=n2&&e2.classList.remove(...n2)),null!==t2){const e3=eo(t2),r3=t2.style;r3.userSelect="text",r3.whiteSpace="pre-wrap",r3.wordBreak="break-word",t2.setAttribute("data-lexical-editor","true"),this._window=e3,this._dirtyType=2,ot$2(this),this._updateTags.add(Ni),si(this),this._config.disableEvents||function(t3,e4){const n3=t3.ownerDocument,r4=on.get(n3);(void 0===r4||r4<1)&&n3.addEventListener("selectionchange",Tn),on.set(n3,(r4||0)+1),t3.__lexicalEditor=e4;const i2=vn(t3);for(let n4=0;n4<tn.length;n4++){const[r5,s2]=tn[n4],o2="function"==typeof s2?t4=>{bn(t4)||(Nn(t4),(e4.isEditable()||"click"===r5)&&s2(t4,e4))}:t4=>{if(bn(t4))return;Nn(t4);const n5=e4.isEditable();switch(r5){case"cut":return n5&&Vs(e4,$e,t4);case"copy":return Vs(e4,Je,t4);case"paste":return n5&&Vs(e4,ge,t4);case"dragstart":return n5&&Vs(e4,Be,t4);case"dragover":return n5&&Vs(e4,Re,t4);case"dragend":return n5&&Vs(e4,We,t4);case"focus":return n5&&Vs(e4,qe,t4);case"blur":return n5&&Vs(e4,Ge,t4);case"drop":return n5&&Vs(e4,Ke,t4)}};t3.addEventListener(r5,o2),i2.push(()=>{t3.removeEventListener(r5,o2)})}}(t2,this),null!=n2&&t2.classList.add(...n2)}else this._window=null,this._updateTags.add(Ni),si(this);oi("root",this,!1,t2,e2)}}getElementByKey(t2){return this._keyToDOMMap.get(t2)||null}getEditorState(){return this._editorState}setEditorState(e2,n2){e2.isEmpty()&&t$2(38);let r2=e2;r2._readOnly&&(r2=xi(e2),r2._selection=e2._selection?e2._selection.clone():null),st$2(this);const i2=this._pendingEditorState,s2=this._updateTags,o2=void 0!==n2?n2.tag:null;null===i2||i2.isEmpty()||(null!=o2&&s2.add(o2),si(this)),this._pendingEditorState=r2,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,null!=o2&&s2.add(o2),this._updating||si(this)}parseEditorState(t2,e2){return function(t3,e3,n2){const r2=Ci(),i2=Rr,s2=Jr,o2=Wr,l2=e3._dirtyElements,c2=e3._dirtyLeaves,a2=e3._cloneNotNeeded,u2=e3._dirtyType;e3._dirtyElements=new Map,e3._dirtyLeaves=new Set,e3._cloneNotNeeded=new Set,e3._dirtyType=0,Rr=r2,Jr=!1,Wr=e3,Ui(null);try{const i3=e3._nodes;ri(t3.root,i3),n2&&n2(),r2._readOnly=!0}catch(t4){t4 instanceof Error&&e3._onError(t4)}finally{e3._dirtyElements=l2,e3._dirtyLeaves=c2,e3._cloneNotNeeded=a2,e3._dirtyType=u2,Rr=i2,Jr=s2,Wr=o2}return r2}("string"==typeof t2?JSON.parse(t2):t2,this,e2)}read(t2){return si(this),this.getEditorState().read(t2,{editor:this})}update(t2,e2){var t3,e3,n2;e3=t2,n2=e2,(t3=this)._updating?t3._updates.push([e3,n2]):ci(t3,e3,n2)}focus(t2,e2={}){const n2=this._rootElement;null!==n2&&(n2.setAttribute("autocapitalize","off"),ai(this,()=>{const r2=wr(),i2=Ss();null!==r2?r2.dirty||ks(r2.clone()):0!==i2.getChildrenSize()&&("rootStart"===e2.defaultSelection?i2.selectStart():i2.selectEnd()),function(t2){Yr(),Gr()._updateTags.add(t2)}("focus"),function(t2){Yr(),Gr()._deferred.push(t2)}(()=>{n2.removeAttribute("autocapitalize"),t2&&t2()})}),null===this._pendingEditorState&&n2.removeAttribute("autocapitalize"))}blur(){const t2=this._rootElement;null!==t2&&t2.blur();const e2=ho(this._window);null!==e2&&e2.removeAllRanges()}isEditable(){return this._editable}setEditable(t2){this._editable!==t2&&(this._editable=t2,oi("editable",this,!0,t2))}toJSON(){return{editorState:this._editorState.toJSON()}}}$i.version="0.35.0+prod.esm";let ji=null;function Ui(t2){ji=t2}let Vi=1;function Hi(e2,n2){const r2=qi(e2,n2);return void 0===r2&&t$2(30,n2),r2}function qi(t2,e2){return t2._nodes.get(e2)}const Gi="function"==typeof queueMicrotask?queueMicrotask:t2=>{Promise.resolve().then(t2)};function Xi(t2){return pi(ms(t2))}function Qi(t2){const e2=document.activeElement;if(!yo(e2))return!1;const n2=e2.nodeName;return pi(ms(t2))&&("INPUT"===n2||"TEXTAREA"===n2||"true"===e2.contentEditable&&null==ns(e2))}function Zi(t2,e2,n2){const r2=t2.getRootElement();try{return null!==r2&&r2.contains(e2)&&r2.contains(n2)&&null!==e2&&!Qi(e2)&&es(e2)===t2}catch(t3){return!1}}function ts(t2){return t2 instanceof $i}function es(t2){let e2=t2;for(;null!=e2;){const t3=ns(e2);if(ts(t3))return t3;e2=qs(e2)}return null}function ns(t2){return t2?t2.__lexicalEditor:null}function rs(t2){return rr(t2)||t2.isToken()}function is(t2){return rs(t2)||t2.isSegmented()}function ss(t2){return mo(t2)&&3===t2.nodeType}function ls(t2){let e2=t2;for(;null!=e2;){if(ss(e2))return e2;e2=e2.firstChild}return null}function cs(t2,e2,n2){const r2=W$2[e2];if(null!==n2&&(t2&r2)==(n2&r2))return t2;let i2=t2^r2;return"subscript"===e2?i2&=-65:"superscript"===e2?i2&=-33:"lowercase"===e2?(i2&=-513,i2&=-1025):"uppercase"===e2?(i2&=-257,i2&=-1025):"capitalize"===e2&&(i2&=-257,i2&=-513),i2}function as(t2){return Zn(t2)||Ln(t2)||pi(t2)}function us(t2,e2){const n2=function(){const t3=ji;return ji=null,t3}();if(null!=(e2=e2||n2&&n2.__key))return void(t2.__key=e2);Yr(),Hr();const r2=Gr(),i2=qr(),s2=""+Vi++;i2._nodeMap.set(s2,t2),hi(t2)?r2._dirtyElements.set(s2,!0):r2._dirtyLeaves.add(s2),r2._cloneNotNeeded.add(s2),r2._dirtyType=1,t2.__key=s2}function fs(t2){const e2=t2.getParent();if(null!==e2){const n2=t2.getWritable(),r2=e2.getWritable(),i2=t2.getPreviousSibling(),s2=t2.getNextSibling(),o2=null!==s2?s2.__key:null,l2=null!==i2?i2.__key:null,c2=null!==i2?i2.getWritable():null,a2=null!==s2?s2.getWritable():null;null===i2&&(r2.__first=o2),null===s2&&(r2.__last=l2),null!==c2&&(c2.__next=o2),null!==a2&&(a2.__prev=l2),n2.__prev=null,n2.__next=null,n2.__parent=null,r2.__size--}}function ds(t2){Hr();const e2=t2.getLatest(),n2=e2.__parent,r2=qr(),i2=Gr(),s2=r2._nodeMap,o2=i2._dirtyElements;null!==n2&&function(t3,e3,n3){let r3=t3;for(;null!==r3;){if(n3.has(r3))return;const t4=e3.get(r3);if(void 0===t4)break;n3.set(r3,!1),r3=t4.__parent}}(n2,s2,o2);const l2=e2.__key;i2._dirtyType=1,hi(t2)?o2.set(l2,!0):i2._dirtyLeaves.add(l2)}function hs(t2){Yr();const e2=Gr(),n2=e2._compositionKey;if(t2!==n2){if(e2._compositionKey=t2,null!==n2){const t3=_s(n2);null!==t3&&t3.getWritable()}if(null!==t2){const e3=_s(t2);null!==e3&&e3.getWritable()}}}function gs(){return Vr()?null:Gr()._compositionKey}function _s(t2,e2){const n2=(e2||qr())._nodeMap.get(t2);return void 0===n2?null:n2}function ps(t2,e2){const n2=ys(t2,Gr());return void 0!==n2?_s(n2,e2):null}function ys(t2,e2){return t2[`__lexicalKey_${e2._key}`]}function ms(t2,e2){let n2=t2;for(;null!=n2;){const t3=ps(n2,e2);if(null!==t3)return t3;n2=qs(n2)}return null}function xs(t2){const e2=t2._decorators,n2=Object.assign({},e2);return t2._pendingDecorators=n2,n2}function Cs(t2){return t2.read(()=>Ss().getTextContent())}function Ss(){return vs(qr())}function vs(t2){return t2._nodeMap.get("root")}function ks(t2){Yr();const e2=qr();null!==t2&&(t2.dirty=!0,t2.setCachedNodes(null)),e2._selection=t2}function Ts(t2){const e2=Gr(),n2=function(t3,e3){let n3=t3;for(;null!=n3;){const t4=ys(n3,e3);if(void 0!==t4)return t4;n3=qs(n3)}return null}(t2,e2);return null===n2?t2===e2.getRootElement()?_s("root"):null:_s(n2)}function Ns(t2){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(t2)}function bs(t2){const e2=[];let n2=t2;for(;null!==n2;)e2.push(n2),n2=n2._parentEditor;return e2}function ws(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function Es(t2){return ss(t2)?t2.nodeValue:null}function Os(t2,e2,n2){const r2=ho(no(e2));if(null===r2)return;const i2=r2.anchorNode;let{anchorOffset:s2,focusOffset:o2}=r2;if(null!==i2){let e3=Es(i2);const r3=ms(i2);if(null!==e3&&Zn(r3)){if(e3===z$3&&n2){const t3=n2.length;e3=n2,s2=t3,o2=t3}null!==e3&&Ms(r3,e3,s2,o2,t2)}}}function Ms(t2,e2,n2,r2,i2){let s2=t2;if(s2.isAttached()&&(i2||!s2.isDirty())){const c2=s2.isComposing();let a2=e2;(c2||i2)&&e2[e2.length-1]===z$3&&(a2=e2.slice(0,-1));const u2=s2.getTextContent();if(i2||a2!==u2){if(""===a2){if(hs(null),o$4||l$2||f$5)s2.remove();else{const t3=Gr();setTimeout(()=>{t3.update(()=>{s2.isAttached()&&s2.remove()})},20)}return}const e3=s2.getParent(),i3=Er(),u3=s2.getTextContentSize(),d2=gs(),h2=s2.getKey();if(s2.isToken()||null!==d2&&h2===d2&&!c2||ar(i3)&&(null!==e3&&!e3.canInsertTextBefore()&&0===i3.anchor.offset||i3.anchor.key===t2.__key&&0===i3.anchor.offset&&!s2.canInsertTextBefore()&&!c2||i3.focus.key===t2.__key&&i3.focus.offset===u3&&!s2.canInsertTextAfter()&&!c2))return void s2.markDirty();const g2=wr();if(!ar(g2)||null===n2||null===r2)return void As(s2,a2,g2);if(g2.setTextNodeRange(s2,n2,s2,r2),s2.isSegmented()){const t3=Qn(s2.getTextContent());s2.replace(t3),s2=t3}As(s2,a2,g2)}}}function As(t2,e2,n2){if(t2.setTextContent(e2),ar(n2)){const e3=t2.getKey();for(const r2 of["anchor","focus"]){const i2=n2[r2];"text"===i2.type&&i2.key===e3&&(i2.offset=Qo(t2,i2.offset,"clamp"))}}}function Ps(t2,e2,n2){const r2=e2[n2]||!1;return"any"===r2||r2===t2[n2]}function Fs(t2,e2,n2){return function(t2,e2){return Ps(t2,e2,"altKey")&&Ps(t2,e2,"ctrlKey")&&Ps(t2,e2,"shiftKey")&&Ps(t2,e2,"metaKey")}(t2,n2)&&t2.key.toLowerCase()===e2.toLowerCase()}const Ls={ctrlKey:!r,metaKey:r},Is={altKey:r,ctrlKey:!r};function Ks(t2){return"Backspace"===t2.key}function zs(t2){return Fs(t2,"a",Ls)}function Rs(t2,e2){void 0===t2.__lexicalClassNameCache&&(t2.__lexicalClassNameCache={});const n2=t2.__lexicalClassNameCache,r2=n2[e2];if(void 0!==r2)return r2;const i2=t2[e2];if("string"==typeof i2){const t3=d$3(i2);return n2[e2]=t3,t3}return i2}function Ws(e2,n2,r2,i2,s2){if(0===r2.size)return;const o2=i2.__type,l2=i2.__key,c2=n2.get(o2);void 0===c2&&t$2(33,o2);const a2=c2.klass;let u2=e2.get(a2);void 0===u2&&(u2=new Map,e2.set(a2,u2));const f3=u2.get(l2),d2="destroyed"===f3&&"created"===s2;(void 0===f3||d2)&&u2.set(l2,d2?"updated":s2)}function $s(t2,e2,n2){const r2=t2.getParent();let i2=n2,s2=t2;return null!==r2&&(e2&&0===n2?(i2=s2.getIndexWithinParent(),s2=r2):e2||n2!==s2.getChildrenSize()||(i2=s2.getIndexWithinParent()+1,s2=r2)),s2.getChildAtIndex(e2?i2-1:i2)}function js(t2,e2){const n2=t2.offset;if("element"===t2.type)return $s(t2.getNode(),e2,n2);{const r2=t2.getNode();if(e2&&0===n2||!e2&&n2===r2.getTextContentSize()){const t3=e2?r2.getPreviousSibling():r2.getNextSibling();return null===t3?$s(r2.getParentOrThrow(),e2,r2.getIndexWithinParent()+(e2?0:1)):t3}}return null}function Us(t2){const e2=no(t2).event,n2=e2&&e2.inputType;return"insertFromPaste"===n2||"insertFromPasteAsQuotation"===n2}function Vs(t2,e2,n2){return function(t3,e3,n3){const r2=bs(t3);for(let i2=4;i2>=0;i2--)for(let s2=0;s2<r2.length;s2++){const o2=r2[s2],l2=o2._commands.get(e3);if(void 0!==l2){const e4=l2[i2];if(void 0!==e4){const r3=Array.from(e4),i3=r3.length;let s3=!1;if(ai(o2,()=>{for(let e5=0;e5<i3;e5++)if(r3[e5](n3,t3))return void(s3=!0)}),s3)return s3}}}return!1}(t2,e2,n2)}function Ys(t2){return!mi(t2)&&!t2.isLastChild()&&!t2.isInline()}function Hs(e2,n2){const r2=e2._keyToDOMMap.get(n2);return void 0===r2&&t$2(75,n2),r2}function qs(t2){const e2=t2.assignedSlot||t2.parentElement;return xo(e2)?e2.host:e2}function Gs(t2){return function(t2){return mo(t2)&&9===t2.nodeType}(t2)?t2:yo(t2)?t2.ownerDocument:null}function to(t2,e2){let n2=t2.getParent();for(;null!==n2;){if(n2.is(e2))return!0;n2=n2.getParent()}return!1}function eo(t2){const e2=Gs(t2);return e2?e2.defaultView:null}function no(e2){const n2=e2._window;return null===n2&&t$2(78),n2}function so(t2){return mi(t2)||hi(t2)&&t2.isShadowRoot()}function oo(t2){const e2=t2.constructor.clone(t2);return us(e2,null),e2.afterCloneFrom(t2),e2}function lo(e2){const n2=Gr(),r2=e2.getType(),i2=qi(n2,r2);void 0===i2&&t$2(200,e2.constructor.name,r2);const{replace:s2,replaceWithKlass:o2}=i2;if(null!==s2){const n3=s2(e2),i3=n3.constructor;return null!==o2?n3 instanceof o2||t$2(201,o2.name,o2.getType(),i3.name,i3.getType(),e2.constructor.name,r2):n3 instanceof e2.constructor&&i3!==e2.constructor||t$2(202,i3.name,i3.getType(),e2.constructor.name,r2),n3.__key===e2.__key&&t$2(203,e2.constructor.name,r2,i3.name,i3.getType()),n3}return e2}function co(e2,n2){!mi(e2.getParent())||hi(n2)||pi(n2)||t$2(99)}function uo(t2){return(pi(t2)||hi(t2)&&!t2.canBeEmpty())&&!t2.isInline()}function fo(t2,e2,n2){n2.style.removeProperty("caret-color"),e2._blockCursorElement=null;const r2=t2.parentElement;null!==r2&&r2.removeChild(t2)}function ho(t2){return e$3?(t2||window).getSelection():null}function po(t2){return yo(t2)&&"A"===t2.tagName}function yo(t2){return mo(t2)&&1===t2.nodeType}function mo(t2){return"object"==typeof t2&&null!==t2&&"nodeType"in t2&&"number"==typeof t2.nodeType}function xo(t2){return mo(t2)&&11===t2.nodeType}function Co(t2){const e2=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return null!==t2.nodeName.match(e2)}function So(t2){const e2=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return null!==t2.nodeName.match(e2)}function vo(t2){if(pi(t2)&&!t2.isInline())return!0;if(!hi(t2)||so(t2))return!1;const e2=t2.getFirstChild(),n2=null===e2||Ln(e2)||Zn(e2)||e2.isInline();return!t2.isInline()&&!1!==t2.canBeEmpty()&&n2}function ko(t2,e2){let n2=t2;for(;null!==n2&&null!==n2.getParent()&&!e2(n2);)n2=n2.getParentOrThrow();return e2(n2)?n2:null}function To(){return Gr()}const No=new WeakMap,bo=new Map;function wo(e2){if(!e2._readOnly&&e2.isEmpty())return bo;e2._readOnly||t$2(192);let n2=No.get(e2);return n2||(n2=function(t2){const e3=new Map;for(const[n3,r2]of t2._nodeMap){const t3=r2.__type;let i2=e3.get(t3);i2||(i2=new Map,e3.set(t3,i2)),i2.set(n3,r2)}return e3}(e2),No.set(e2,n2)),n2}function Eo(t2){const e2=t2.constructor.clone(t2);return e2.afterCloneFrom(t2),e2}function Oo(t2,e2){const n2=parseInt(t2.style.paddingInlineStart,10)||0,r2=Math.round(n2/40);e2.setIndent(r2)}function Ao(t2){return!0===t2.__lexicalUnmanaged}function Po(t2,e2){return t3=t2,e3=e2,Object.prototype.hasOwnProperty.call(t3,e3)&&t2[e2]!==An[e2];var t3,e3}function Do(t2){const e2="$config"in t2.prototype?t2.prototype.$config():void 0,n2=function(t3){return t3===_i||t3===di||t3===An}(t2),r2=!n2&&Po(t2,"getType")?t2.getType():void 0;let i2,s2=r2;if(e2)if(r2)i2=e2[r2];else for(const[t3,n3]of Object.entries(e2))s2=t3,i2=n3;if(!n2&&s2&&(Po(t2,"getType")||(t2.getType=()=>s2),Po(t2,"clone")||(t2.clone=e3=>(Ui(e3),new t2)),Po(t2,"importJSON")||(t2.importJSON=i2&&i2.$importJSON||(e3=>(new t2).updateFromJSON(e3))),!Po(t2,"importDOM")&&i2)){const{importDOM:e3}=i2;e3&&(t2.importDOM=()=>e3)}return{ownNodeConfig:i2,ownNodeType:s2}}const Lo={next:"previous",previous:"next"};class Io{constructor(t2){this.origin=t2}[Symbol.iterator](){return al({hasNext:Uo,initial:this.getAdjacentCaret(),map:t2=>t2,step:t2=>t2.getAdjacentCaret()})}getAdjacentCaret(){return Go(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return Go(this.origin,this.direction)}remove(){const t2=this.getNodeAtCaret();return t2&&t2.remove(),this}replaceOrInsert(t2,e2){const n2=this.getNodeAtCaret();return t2.is(this.origin)||t2.is(n2)||(null===n2?this.insert(t2):n2.replace(t2,e2)),this}splice(e2,n2,r2="next"){const i2=r2===this.direction?n2:Array.from(n2).reverse();let s2=this;const o2=this.getParentAtCaret(),l2=new Map;for(let t2=s2.getAdjacentCaret();null!==t2&&l2.size<e2;t2=t2.getAdjacentCaret()){const e3=t2.origin.getWritable();l2.set(e3.getKey(),e3)}for(const e3 of i2){if(l2.size>0){const n3=s2.getNodeAtCaret();if(n3)if(l2.delete(n3.getKey()),l2.delete(e3.getKey()),n3.is(e3)||s2.origin.is(e3));else{const t2=e3.getParent();t2&&t2.is(o2)&&e3.remove(),n3.replace(e3)}else null===n3&&t$2(263,Array.from(l2).join(" "))}else s2.insert(e3);s2=Go(e3,this.direction)}for(const t2 of l2.values())t2.remove();return this}}class Ko extends Io{constructor(){super(...arguments),__publicField(this,"type","child")}getLatest(){const t2=this.origin.getLatest();return t2===this.origin?this:tl(t2,this.direction)}getParentCaret(t2="root"){return Go(Ro(this.getParentAtCaret(),t2),this.direction)}getFlipped(){const t2=Bo(this.direction);return Go(this.getNodeAtCaret(),t2)||tl(this.origin,t2)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(t2){return t2 instanceof Ko&&this.direction===t2.direction&&this.origin.is(t2.origin)}isSamePointCaret(t2){return this.isSameNodeCaret(t2)}}const zo={root:mi,shadowRoot:so};function Bo(t2){return Lo[t2]}function Ro(t2,e2="root"){return zo[e2](t2)?null:t2}class Wo extends Io{constructor(){super(...arguments),__publicField(this,"type","sibling")}getLatest(){const t2=this.origin.getLatest();return t2===this.origin?this:Go(t2,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return hi(this.origin)?tl(this.origin,this.direction):null}getParentCaret(t2="root"){return Go(Ro(this.getParentAtCaret(),t2),this.direction)}getFlipped(){const t2=Bo(this.direction);return Go(this.getNodeAtCaret(),t2)||tl(this.origin.getParentOrThrow(),t2)}isSamePointCaret(t2){return t2 instanceof Wo&&this.direction===t2.direction&&this.origin.is(t2.origin)}isSameNodeCaret(t2){return(t2 instanceof Wo||t2 instanceof Jo)&&this.direction===t2.direction&&this.origin.is(t2.origin)}}class Jo extends Io{constructor(t2,e2){super(t2),__publicField(this,"type","text"),this.offset=e2}getLatest(){const t2=this.origin.getLatest();return t2===this.origin?this:Xo(t2,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(t2="root"){return Go(Ro(this.getParentAtCaret(),t2),this.direction)}getFlipped(){return Xo(this.origin,Bo(this.direction),this.offset)}isSamePointCaret(t2){return t2 instanceof Jo&&this.direction===t2.direction&&this.origin.is(t2.origin)&&this.offset===t2.offset}isSameNodeCaret(t2){return(t2 instanceof Wo||t2 instanceof Jo)&&this.direction===t2.direction&&this.origin.is(t2.origin)}getSiblingCaret(){return Go(this.origin,this.direction)}}function $o(t2){return t2 instanceof Jo}function Uo(t2){return t2 instanceof Wo}function Vo(t2){return t2 instanceof Ko}const Yo={next:class extends Jo{constructor(){super(...arguments),__publicField(this,"direction","next")}getNodeAtCaret(){return this.origin.getNextSibling()}insert(t2){return this.origin.insertAfter(t2),this}},previous:class extends Jo{constructor(){super(...arguments),__publicField(this,"direction","previous")}getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(t2){return this.origin.insertBefore(t2),this}}},Ho={next:class extends Wo{constructor(){super(...arguments),__publicField(this,"direction","next")}getNodeAtCaret(){return this.origin.getNextSibling()}insert(t2){return this.origin.insertAfter(t2),this}},previous:class extends Wo{constructor(){super(...arguments),__publicField(this,"direction","previous")}getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(t2){return this.origin.insertBefore(t2),this}}},qo={next:class extends Ko{constructor(){super(...arguments),__publicField(this,"direction","next")}getNodeAtCaret(){return this.origin.getFirstChild()}insert(t2){return this.origin.splice(0,0,[t2]),this}},previous:class extends Ko{constructor(){super(...arguments),__publicField(this,"direction","previous")}getNodeAtCaret(){return this.origin.getLastChild()}insert(t2){return this.origin.splice(this.origin.getChildrenSize(),0,[t2]),this}}};function Go(t2,e2){return t2?new Ho[e2](t2):null}function Xo(t2,e2,n2){return t2?new Yo[e2](t2,Qo(t2,n2)):null}function Qo(t2,e2,n2="error"){const r2=t2.getTextContentSize();let i2="next"===e2?r2:"previous"===e2?0:e2;return(i2<0||i2>r2)&&("clamp"!==n2&&function(t3,...e3){const n3=new URL("https://lexical.dev/docs/error"),r3=new URLSearchParams;r3.append("code",t3);for(const t4 of e3)r3.append("v",t4);n3.search=r3.toString(),console.warn(`Minified Lexical warning #${t3}; visit ${n3.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(284,String(e2),String(r2),t2.getKey()),i2=i2<0?0:r2),i2}function Zo(t2,e2){return new il(t2,e2)}function tl(t2,e2){return hi(t2)?new qo[e2](t2):null}function nl(t2){return t2&&function(t2){return t2&&t2.getChildCaret()||t2}(t2.getAdjacentCaret())}class rl{constructor(t2,e2,n2){__publicField(this,"type","node-caret-range"),this.anchor=t2,this.focus=e2,this.direction=n2}getLatest(){const t2=this.anchor.getLatest(),e2=this.focus.getLatest();return t2===this.anchor&&e2===this.focus?this:new rl(t2,e2,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){const t2=t3=>{const e3=this[t3].getLatest();return $o(e3)?function(t4,e4){const{direction:n3,origin:r2}=t4;return Zo(t4,Qo(r2,"focus"===e4?Bo(n3):n3)-t4.offset)}(e3,t3):null},e2=t2("anchor"),n2=t2("focus");if(e2&&n2){const{caret:t3}=e2,{caret:r2}=n2;if(t3.isSameNodeCaret(r2))return[Zo(t3,r2.offset-t3.offset),null]}return[e2,n2]}iterNodeCarets(t2="root"){const e2=$o(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),n2=this.focus.getLatest(),r2=$o(n2),i2=e3=>e3.isSameNodeCaret(n2)?null:nl(e3)||e3.getParentCaret(t2);return al({hasNext:t3=>null!==t3&&!(r2&&n2.isSameNodeCaret(t3)),initial:e2.isSameNodeCaret(n2)?null:i2(e2),map:t3=>t3,step:i2})}[Symbol.iterator](){return this.iterNodeCarets("root")}}class il{constructor(t2,e2){__publicField(this,"type","slice"),this.caret=t2,this.distance=e2}getSliceIndices(){const{distance:t2,caret:{offset:e2}}=this,n2=e2+t2;return n2<e2?[n2,e2]:[e2,n2]}getTextContent(){const[t2,e2]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(t2,e2)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){const{caret:{origin:t2,direction:e2}}=this,[n2,r2]=this.getSliceIndices(),i2=t2.getTextContent();return Xo(t2.setTextContent(i2.slice(0,n2)+i2.slice(r2)),e2,n2)}}function ol(t2){return cl(t2,Go(Ss(),t2.direction))}function ll(t2){return cl(t2,t2)}function cl(e2,n2){return e2.direction!==n2.direction&&t$2(265),new rl(e2,n2,e2.direction)}function al(t2){const{initial:e2,hasNext:n2,step:r2,map:i2}=t2;let s2=e2;return{[Symbol.iterator](){return this},next(){if(!n2(s2))return{done:!0,value:void 0};const t3={done:!1,value:i2(s2)};return s2=r2(s2),t3}}}function ul(e2,n2){const r2=gl(e2.origin,n2.origin);switch(null===r2&&t$2(275,e2.origin.getKey(),n2.origin.getKey()),r2.type){case"same":{const t2="text"===e2.type,r3="text"===n2.type;return t2&&r3?(t3=e2.offset,e3=n2.offset,Math.sign(t3-e3)):e2.type===n2.type?0:t2?-1:r3?1:"child"===e2.type?-1:1}case"ancestor":return"child"===e2.type?-1:1;case"descendant":return"child"===n2.type?1:-1;case"branch":return fl(r2)}var t3,e3}function fl(t2){const{a:e2,b:n2}=t2,r2=e2.__key,i2=n2.__key;let s2=e2,o2=n2;for(;s2&&o2;s2=s2.getNextSibling(),o2=o2.getNextSibling()){if(s2.__key===i2)return-1;if(o2.__key===r2)return 1}return null===s2?1:-1}function dl(t2,e2){return e2.is(t2)}function hl(t2){return hi(t2)?[t2.getLatest(),null]:[t2.getParent(),t2.getLatest()]}function gl(e2,n2){if(e2.is(n2))return{commonAncestor:e2,type:"same"};const r2=new Map;for(let[t2,n3]=hl(e2);t2;n3=t2,t2=t2.getParent())r2.set(t2,n3);for(let[i2,s2]=hl(n2);i2;s2=i2,i2=i2.getParent()){const o2=r2.get(i2);if(void 0!==o2)return null===o2?(dl(e2,i2)||t$2(276),{commonAncestor:i2,type:"ancestor"}):null===s2?(dl(n2,i2)||t$2(277),{commonAncestor:i2,type:"descendant"}):((hi(o2)||dl(e2,o2))&&(hi(s2)||dl(n2,s2))&&i2.is(o2.getParent())&&i2.is(s2.getParent())||t$2(278),{a:o2,b:s2,commonAncestor:i2,type:"branch"})}return null}function _l(e2,n2){const{type:r2,key:i2,offset:s2}=e2,o2=function(e2){const n2=_s(e2);return null===n2&&t$2(63,e2),n2}(e2.key);return"text"===r2?(Zn(o2)||t$2(266,o2.getType(),i2),Xo(o2,n2,s2)):(hi(o2)||t$2(267,o2.getType(),i2),function(t2,e2,n2){let r2=tl(t2,"next");for(let t3=0;t3<e2;t3++){const t4=r2.getAdjacentCaret();if(null===t4)break;r2=t4}return bl(r2,n2)}(o2,e2.offset,n2))}function pl(e2,n2){const{origin:r2,direction:i2}=n2,s2="next"===i2;$o(n2)?e2.set(r2.getKey(),n2.offset,"text"):Uo(n2)?Zn(r2)?e2.set(r2.getKey(),Qo(r2,i2),"text"):e2.set(r2.getParentOrThrow().getKey(),r2.getIndexWithinParent()+(s2?1:0),"element"):(Vo(n2)&&hi(r2)||t$2(268),e2.set(r2.getKey(),s2?0:r2.getChildrenSize(),"element"))}function yl(t2){const e2=wr(),n2=ar(e2)?e2:kr();return ml(n2,t2),ks(n2),n2}function ml(t2,e2){pl(t2.anchor,e2.anchor),pl(t2.focus,e2.focus)}function xl(t2){const{anchor:e2,focus:n2}=t2,r2=_l(e2,"next"),i2=_l(n2,"next"),s2=ul(r2,i2)<=0?"next":"previous";return cl(bl(r2,s2),bl(i2,s2))}function Cl(t2){const{direction:e2,origin:n2}=t2,r2=Go(n2,Bo(e2)).getNodeAtCaret();return r2?Go(r2,e2):tl(n2.getParentOrThrow(),e2)}function Sl(t2,e2="root"){const n2=[t2];for(let r2=Vo(t2)?t2.getParentCaret(e2):t2.getSiblingCaret();null!==r2;r2=r2.getParentCaret(e2))n2.push(Cl(r2));return n2}function vl(t2){return!!t2&&t2.origin.isAttached()}function Tl(t2){const e2=function(t3){let e3=t3;for(;Vo(e3);){const t4=nl(e3);if(!Vo(t4))break;e3=t4}return e3}(t2.getLatest()),{direction:n2}=e2;if(Zn(e2.origin))return $o(e2)?e2:Xo(e2.origin,n2,n2);const r2=e2.getAdjacentCaret();return Uo(r2)&&Zn(r2.origin)?Xo(r2.origin,n2,Bo(n2)):e2}function Nl(t2){return $o(t2)&&t2.offset!==Qo(t2.origin,t2.direction)}function bl(t2,e2){return t2.direction===e2?t2:t2.getFlipped()}function wl(t2,e2){return t2.direction===e2?t2:cl(bl(t2.focus,e2),bl(t2.anchor,e2))}function Ml(e2){const{origin:n2,offset:r2,direction:i2}=e2;if(r2===Qo(n2,i2))return e2.getSiblingCaret();if(r2===Qo(n2,Bo(i2)))return Cl(e2.getSiblingCaret());const[s2]=n2.splitText(r2);return Zn(s2)||t$2(281),bl(Go(s2,"next"),i2)}function Al(t2,e2){return!0}function Pl(t2,{$copyElementNode:e2=oo,$splitTextPointCaretNext:n2=Ml,rootMode:r2="shadowRoot",$shouldSplit:i2=Al}={}){if($o(t2))return n2(t2);const s2=t2.getParentCaret(r2);if(s2){const{origin:n3}=s2;if(Vo(t2)&&(!n3.canBeEmpty()||!i2(n3,"first")))return Cl(s2);const r3=function(t3){const e3=[];for(let n4=t3.getAdjacentCaret();n4;n4=n4.getAdjacentCaret())e3.push(n4.origin);return e3}(t2);(r3.length>0||n3.canBeEmpty()&&i2(n3,"last"))&&s2.insert(e2(n3).splice(0,0,r3))}return s2}const C$2=new Map;function I$4(e2){const t2={};if(!e2)return t2;const n2=e2.split(";");for(const e3 of n2)if(""!==e3){const[n3,o2]=e3.split(/:([^]+)/);n3&&o2&&(t2[n3.trim()]=o2.trim())}return t2}function B$2(e2){let t2=C$2.get(e2);return void 0===t2&&(t2=I$4(e2),C$2.set(e2,t2)),t2}function b$5(e2){const n2=To().getElementByKey(e2.getKey());if(null===n2)return null;const o2=n2.ownerDocument.defaultView;return null===o2?null:o2.getComputedStyle(n2)}function O$2(e2){return b$5(mi(e2)?e2:e2.getParentOrThrow())}function R$4(e2){const t2=O$2(e2);return null!==t2&&"rtl"===t2.direction}function z$2(e2,t2){const n2=e2.getStartEndPoints();if(t2.isSelected(e2)&&!is(t2)&&null!==n2){const[o2,r2]=n2,s2=e2.isBackward(),i2=o2.getNode(),c2=r2.getNode(),f3=t2.is(i2),u2=t2.is(c2);if(f3||u2){const[n3,o3]=hr(e2),r3=i2.is(c2),f4=t2.is(s2?c2:i2),u3=t2.is(s2?i2:c2);let g2,a2=0;r3?(a2=n3>o3?o3:n3,g2=n3>o3?n3:o3):f4?(a2=s2?o3:n3,g2=void 0):u3&&(a2=0,g2=s2?n3:o3),t2.__text=t2.__text.slice(a2,g2)}}return t2}function A$2(e2){if("text"===e2.type)return e2.offset===e2.getNode().getTextContentSize();const t2=e2.getNode();return hi(t2)||function(e2,...t2){const n2=new URL("https://lexical.dev/docs/error"),o2=new URLSearchParams;o2.append("code",e2);for(const e3 of t2)o2.append("v",e3);throw n2.search=o2.toString(),Error(`Minified Lexical error #${e2}; visit ${n2.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(177),e2.offset===t2.getChildrenSize()}function L$3(e2){const t2=e2.getStyle(),n2=I$4(t2);C$2.set(t2,n2)}function j$3(e2,t2){const n2=e2.getFormatType(),o2=e2.getIndent();n2!==t2.getFormatType()&&t2.setFormat(n2),o2!==t2.getIndent()&&t2.setIndent(o2)}function G$2(e2){const t2=J$5(e2);return null!==t2&&"vertical-rl"===t2.writingMode}function J$5(e2){const t2=e2.anchor.getNode();return hi(t2)?b$5(t2):O$2(t2)}function Q$2(e2,t2){let n2=G$2(e2)?!t2:t2;Z$3(e2)&&(n2=!n2);const o2=_l(e2.focus,n2?"previous":"next");if(Nl(o2))return!1;for(const e3 of ol(o2)){if(Vo(e3))return!e3.origin.isInline();if(!hi(e3.origin)){if(pi(e3.origin))return!0;break}}return!1}function Z$3(e2){const t2=J$5(e2);return null!==t2&&"rtl"===t2.direction}function ee(e2,t2,n2){const o2=Z$3(e2);let l2;l2=G$2(e2)||o2?!n2:n2,function(e2,t2,n2,o2){e2.modify(t2?"extend":"move",n2,o2)}(e2,t2,l2,"character")}function oe(e2,t2){let n2=e2;for(;null!==n2&&null!==n2.getParent()&&!t2(n2);)n2=n2.getParentOrThrow();return t2(n2)?n2:null}function N$3(t2,...e2){const n2=new URL("https://lexical.dev/docs/error"),o2=new URLSearchParams;o2.append("code",t2);for(const t3 of e2)o2.append("v",t3);throw n2.search=o2.toString(),Error(`Minified Lexical error #${t2}; visit ${n2.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const M$5="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,R$3=M$5&&"documentMode"in document?document.documentMode:null,B$1=M$5&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);function I$3(...t2){const e2=[];for(const n2 of t2)if(n2&&"string"==typeof n2)for(const[t3]of n2.matchAll(/\S+/g))e2.push(t3);return e2}function j$2(...t2){return()=>{for(let e2=t2.length-1;e2>=0;e2--)t2[e2]();t2.length=0}}M$5&&"InputEvent"in window&&!R$3&&new window.InputEvent("input");function rt$3(t2,...e2){const n2=I$3(...e2);n2.length>0&&t2.classList.add(...n2)}function it$2(t2,...e2){const n2=I$3(...e2);n2.length>0&&t2.classList.remove(...n2)}function ct$2(t2){return t2?t2.getAdjacentCaret():null}function vt$3(t2,e2){let n2=t2;for(;null!=n2;){if(n2 instanceof e2)return n2;n2=n2.getParent()}return null}function yt$3(t2){const e2=wt$2(t2,t3=>hi(t3)&&!t3.isInline());return hi(e2)||N$3(4,t2.__key),e2}const wt$2=(t2,e2)=>{let n2=t2;for(;n2!==Ss()&&null!=n2;){if(e2(n2))return n2;n2=n2.getParent()}return null};function St$3(t2){const o2=wr()||Er();let r2;if(ar(o2))r2=_l(o2.focus,"next");else{if(null!=o2){const t3=o2.getNodes(),e2=t3[t3.length-1];e2&&(r2=Go(e2,"next"))}r2=r2||tl(Ss(),"previous").getFlipped().insert(Fi())}const c2=function(t2,e2,n2){let o2=bl(e2,"next");for(let t3=o2;t3;t3=Pl(t3,n2))o2=t3;return $o(o2)&&N$3(283),o2.insert(t2.isInline()?Fi().append(t2):t2),bl(Go(t2.getLatest(),"next"),e2.direction)}(t2,r2),f3=nl(c2);return yl(ll(Vo(f3)?Tl(f3):c2)),t2.getLatest()}function Ct$3(t2,e2){const n2=e2();return t2.replace(n2),n2.append(t2),n2}function Lt$1(t2,e2){return null!==t2&&Object.getPrototypeOf(t2).constructor.name===e2.name}let Nt$2=!(B$1||!M$5)&&void 0;function M$4(t2,e2){let n2=Date.now(),r2=0;return(o2,i2,c2,s2,p2,S3)=>{const k3=Date.now();if(S3.has(ki))return r2=0,n2=k3,2;const y2=function(t2,e2,n2,r2,o2){if(null===t2||0===n2.size&&0===r2.size&&!o2)return 0;const i2=e2._selection,c2=t2._selection;if(o2)return 1;if(!(ar(i2)&&ar(c2)&&c2.isCollapsed()&&i2.isCollapsed()))return 0;const s2=function(t3,e3,n3){const r3=t3._nodeMap,o3=[];for(const t4 of e3){const e4=r3.get(t4);void 0!==e4&&o3.push(e4)}for(const[t4,e4]of n3){if(!e4)continue;const n4=r3.get(t4);void 0===n4||mi(n4)||o3.push(n4)}return o3}(e2,n2,r2);if(0===s2.length)return 0;if(s2.length>1){const n3=e2._nodeMap,r3=n3.get(i2.anchor.key),o3=n3.get(c2.anchor.key);return r3&&o3&&!t2._nodeMap.has(r3.__key)&&Zn(r3)&&1===r3.__text.length&&1===i2.anchor.offset?2:0}const a2=s2[0],u2=t2._nodeMap.get(a2.__key);if(!Zn(u2)||!Zn(a2)||u2.__mode!==a2.__mode)return 0;const d2=u2.__text,m3=a2.__text;if(d2===m3)return 0;const h2=i2.anchor,_2=c2.anchor;if(h2.key!==_2.key||"text"!==h2.type)return 0;const x2=h2.offset,M2=_2.offset,z2=m3.length-d2.length;return 1===z2&&M2===x2-1?2:-1===z2&&M2===x2+1?3:-1===z2&&M2===x2?4:0}(o2,i2,s2,p2,t2.isComposing()),C2=(()=>{const a2=null===c2||c2.editor===t2,C3=S3.has("history-push");if(!C3&&a2&&S3.has(Ni))return 0;if(null===o2)return 1;const x2=i2._selection;return s2.size>0||p2.size>0?!1===C3&&0!==y2&&y2===r2&&k3<n2+e2&&a2||1===s2.size&&function(t3,e3,n3){const r3=e3._nodeMap.get(t3),o3=n3._nodeMap.get(t3),i3=e3._selection,c3=n3._selection;return!(ar(i3)&&ar(c3)&&"element"===i3.anchor.type&&"element"===i3.focus.type&&"text"===c3.anchor.type&&"text"===c3.focus.type||!Zn(r3)||!Zn(o3)||r3.__parent!==o3.__parent)&&JSON.stringify(e3.read(()=>r3.exportJSON()))===JSON.stringify(n3.read(()=>o3.exportJSON()))}(Array.from(s2)[0],o2,i2)?0:1:null!==x2?0:2})();return n2=k3,r2=y2,C2}}function z$1(t2){t2.undoStack=[],t2.redoStack=[],t2.current=null}function a$3({delay:a2,externalHistoryState:c2}){const[l2]=o$5();return function(t2,a3,c3=1e3){const l3=reactExports.useMemo(()=>a3||{current:null,redoStack:[],undoStack:[]},[a3]);reactExports.useEffect(()=>function(u2,d2,l2){const f3=M$4(u2,l2);return j$2(u2.registerCommand(xe,()=>(function(t2,e2){const n2=e2.redoStack,r2=e2.undoStack;if(0!==r2.length){const o2=e2.current,i2=r2.pop();null!==o2&&(n2.push(o2),t2.dispatchCommand(Ye,!0)),0===r2.length&&t2.dispatchCommand(He,!1),e2.current=i2||null,i2&&i2.editor.setEditorState(i2.editorState,{tag:ki})}}(u2,d2),!0),0),u2.registerCommand(Ce,()=>(function(t2,e2){const n2=e2.redoStack,r2=e2.undoStack;if(0!==n2.length){const o2=e2.current;null!==o2&&(r2.push(o2),t2.dispatchCommand(He,!0));const i2=n2.pop();0===n2.length&&t2.dispatchCommand(Ye,!1),e2.current=i2||null,i2&&i2.editor.setEditorState(i2.editorState,{tag:ki})}}(u2,d2),!0),0),u2.registerCommand(Ue,()=>(z$1(d2),!1),0),u2.registerCommand(Ve,()=>(z$1(d2),u2.dispatchCommand(Ye,!1),u2.dispatchCommand(He,!1),!0),0),u2.registerUpdateListener(({editorState:t2,prevEditorState:e2,dirtyLeaves:n2,dirtyElements:r2,tags:o2})=>{const i2=d2.current,a2=d2.redoStack,l3=d2.undoStack,p3=null===i2?null:i2.editorState;if(null!==i2&&t2===p3)return;const m3=f3(e2,t2,i2,n2,r2,o2);if(1===m3)0!==a2.length&&(d2.redoStack=[],u2.dispatchCommand(Ye,!1)),null!==i2&&(l3.push({...i2}),u2.dispatchCommand(He,!0));else if(2===m3)return;d2.current={editor:u2,editorState:t2}}))}(t2,l3,c3),[c3,t2,l3])}(l2,c2,a2),null}function x$4(t2,o2,u2,f3=null){let a2=null===f3||o2.isSelected(f3);const d2=hi(o2)&&o2.excludeFromCopy("html");let p2=o2;if(null!==f3){let n2=Eo(o2);n2=Zn(n2)&&null!==f3?z$2(f3,n2):n2,p2=n2}const h2=hi(p2)?p2.getChildren():[],m3=qi(t2,p2.getType());let g2;g2=m3&&void 0!==m3.exportDOM?m3.exportDOM(t2,p2):p2.exportDOM(t2);const{element:y2,after:w2}=g2;if(!y2)return!1;const b2=document.createDocumentFragment();for(let e2=0;e2<h2.length;e2++){const n2=h2[e2],r2=x$4(t2,n2,b2,f3);!a2&&hi(o2)&&r2&&o2.extractWithChild(n2,f3,"html")&&(a2=!0)}if(a2&&!d2){if((yo(y2)||xo(y2))&&y2.append(b2),u2.append(y2),w2){const e2=w2.call(p2,y2);e2&&(xo(y2)?y2.replaceChildren(e2):y2.replaceWith(e2))}}else u2.append(b2);return a2}const y$1=new Set(["STYLE","SCRIPT"]);function w$2(e2,n2,o2,r2,i2=new Map,s2){let c2=[];if(y$1.has(e2.nodeName))return c2;let m3=null;const g2=function(e3,n3){const{nodeName:t2}=e3,o3=n3._htmlConversions.get(t2.toLowerCase());let l2=null;if(void 0!==o3)for(const n4 of o3){const t3=n4(e3);null!==t3&&(null===l2||(l2.priority||0)<=(t3.priority||0))&&(l2=t3)}return null!==l2?l2.conversion:null}(e2,n2),x2=g2?g2(e2):null;let C2=null;if(null!==x2){C2=x2.after;const n3=x2.node;if(m3=Array.isArray(n3)?n3[n3.length-1]:n3,null!==m3){for(const[,e3]of i2)if(m3=e3(m3,s2),!m3)break;m3&&c2.push(...Array.isArray(n3)?n3:[m3])}null!=x2.forChild&&i2.set(e2.nodeName,x2.forChild)}const S3=e2.childNodes;let v2=[];const N2=(null==m3||!so(m3))&&(null!=m3&&Sr(m3)||r2);for(let e3=0;e3<S3.length;e3++)v2.push(...w$2(S3[e3],n2,o2,N2,new Map(i2),m3));return null!=C2&&(v2=C2(v2)),So(e2)&&(v2=function(e2,n2,t2){const o2=e2.style.textAlign,l2=[];let r2=[];for(let e3=0;e3<n2.length;e3++){const i2=n2[e3];if(Sr(i2))o2&&!i2.getFormat()&&i2.setFormat(o2),l2.push(i2);else if(r2.push(i2),e3===n2.length-1||e3<n2.length-1&&Sr(n2[e3+1])){const e4=t2();e4.setFormat(o2),e4.append(...r2),l2.push(e4),r2=[]}}return l2}(e2,v2,N2?()=>{const e3=new Ai;return o2.push(e3),e3}:Fi)),null==m3?v2.length>0?c2=c2.concat(v2):So(e2)&&(null!=(e3=e2).nextSibling&&null!=e3.previousSibling&&Co(e3.nextSibling)&&Co(e3.previousSibling))&&(c2=c2.concat(Fn())):hi(m3)&&m3.append(...v2),c2;var e3}function D$1(t2,...e2){const n2=new URL("https://lexical.dev/docs/error"),o2=new URLSearchParams;o2.append("code",t2);for(const t3 of e2)o2.append("v",t3);throw n2.search=o2.toString(),Error(`Minified Lexical error #${t2}; visit ${n2.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function A$1(t2,n2,o2){const r2=t2.getData("application/x-lexical-editor");if(r2)try{const t3=JSON.parse(r2);if(t3.namespace===o2._config.namespace&&Array.isArray(t3.nodes))return P$1(o2,function(t2){const e2=[];for(let o2=0;o2<t2.length;o2++){const i2=ni(t2[o2]);Zn(i2)&&L$3(i2),e2.push(i2)}return e2}(t3.nodes),n2)}catch(t3){}const c2=t2.getData("text/html"),a2=t2.getData("text/plain");if(c2&&a2!==c2)try{return P$1(o2,function(e2,n2){const t2=n2.body?n2.body.childNodes:[];let o2=[];const l2=[];for(let n3=0;n3<t2.length;n3++){const r2=t2[n3];if(!y$1.has(r2.nodeName)){const n4=w$2(r2,e2,l2,!1);null!==n4&&(o2=o2.concat(n4))}}return function(e3){for(const n3 of e3)n3.getNextSibling()instanceof Ai&&n3.insertAfter(Fn());for(const n3 of e3){const e4=n3.getChildren();for(const t3 of e4)n3.insertBefore(t3);n3.remove()}}(l2),o2}(o2,(new DOMParser).parseFromString((t4=c2,window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:t5=>t5}).createHTML(t4):t4),"text/html")),n2)}catch(t3){}var t4;const u2=a2||t2.getData("text/uri-list");if(null!=u2)if(ar(n2)){const t3=u2.split(/(\r?\n|\t)/);""===t3[t3.length-1]&&t3.pop();for(let e2=0;e2<t3.length;e2++){const n3=wr();if(ar(n3)){const o3=t3[e2];"\n"===o3||"\r\n"===o3?n3.insertParagraph():"\t"===o3?n3.insertNodes([nr()]):n3.insertText(o3)}}}else n2.insertRawText(u2)}function P$1(t2,e2,n2){t2.dispatchCommand(ce,{nodes:e2,selection:n2})||(n2.insertNodes(e2),function(t3){if(ar(t3)&&t3.isCollapsed()){let n3=null;const o2=_l(t3.anchor,"previous");if(o2)if($o(o2))n3=o2.origin;else{const t4=cl(o2,tl(Ss(),"next").getFlipped());for(const e4 of t4){if(Zn(e4.origin)){n3=e4.origin;break}if(hi(e4.origin)&&!e4.origin.isInline())break}}if(n3&&Zn(n3)){const e4=n3.getFormat(),o3=n3.getStyle();t3.format===e4&&t3.style===o3||(t3.format=e4,t3.style=o3,t3.dirty=!0)}}}(n2))}function _(t2,e2,n2,r2=[]){let i2=null===e2||n2.isSelected(e2);const l2=hi(n2)&&n2.excludeFromCopy("html");let s2=n2;if(null!==e2){let t3=Eo(n2);t3=Zn(t3)&&null!==e2?z$2(e2,t3):t3,s2=t3}const c2=hi(s2)?s2.getChildren():[],a2=function(t3){const e3=t3.exportJSON(),n3=t3.constructor;if(e3.type!==n3.getType()&&D$1(58,n3.name),hi(t3)){const t4=e3.children;Array.isArray(t4)||D$1(59,n3.name)}return e3}(s2);if(Zn(s2)){const t3=s2.__text;t3.length>0?a2.text=t3:i2=!1}for(let o2=0;o2<c2.length;o2++){const r3=c2[o2],l3=_(t2,e2,r3,a2.children);!i2&&hi(n2)&&l3&&n2.extractWithChild(r3,e2,"clone")&&(i2=!0)}if(i2&&!l2)r2.push(a2);else if(Array.isArray(a2.children))for(let t3=0;t3<a2.children.length;t3++){const e3=a2.children[t3];r2.push(e3)}return i2}let b$3=null;async function F(t2,e2,n2){if(null!==b$3)return!1;if(null!==e2)return new Promise((o3,r2)=>{t2.update(()=>{o3(M$3(t2,e2,n2))})});const o2=t2.getRootElement(),i2=t2._window||window,l2=window.document,s2=ho(i2);if(null===o2||null===s2)return!1;const c2=l2.createElement("span");c2.style.cssText="position: fixed; top: -1000px;",c2.append(l2.createTextNode("#")),o2.append(c2);const a2=new Range;return a2.setStart(c2,0),a2.setEnd(c2,1),s2.removeAllRanges(),s2.addRange(a2),new Promise((e3,o3)=>{const i3=t2.registerCommand(Je,o4=>(Lt$1(o4,ClipboardEvent)&&(i3(),null!==b$3&&(window.clearTimeout(b$3),b$3=null),e3(M$3(t2,o4,n2))),!0),4);b$3=window.setTimeout(()=>{i3(),b$3=null,e3(!1)},50),l2.execCommand("copy"),c2.remove()})}function M$3(t2,e2,n2){if(void 0===n2){const e3=ho(t2._window);if(!e3)return!1;const o3=e3.anchorNode,r2=e3.focusNode;if(null!==o3&&null!==r2&&!Zi(t2,o3,r2))return!1;const i2=wr();if(null===i2)return!1;n2=function(t2=wr()){const e2={"text/plain":t2?t2.getTextContent():""};if(t2){const n2=To();for(const[o2,r2]of O$1){const i2=r2(n2,t2);null!==i2&&(e2[o2]=i2)}}return e2}(i2)}e2.preventDefault();const o2=e2.clipboardData;return null!==o2&&(function(t2,e2){for(const n2 in e2){const o2=e2[n2];void 0!==o2&&t2.setData(n2,o2)}}(o2,n2),!0)}const O$1=[["text/html",function(e2,n2=wr()){return null==n2&&D$1(166),ar(n2)&&n2.isCollapsed()||0===n2.getNodes().length?"":function(e2,n2){if("undefined"==typeof document||"undefined"==typeof window&&void 0===global.window)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const t2=document.createElement("div"),l2=Ss().getChildren();for(let o2=0;o2<l2.length;o2++)x$4(e2,l2[o2],t2,n2);return t2.innerHTML}(e2,n2)}],["application/x-lexical-editor",function(t2,e2=wr()){return null==e2&&D$1(166),ar(e2)&&e2.isCollapsed()||0===e2.getNodes().length?null:JSON.stringify(function(t2,e2){const n2=[],o2=Ss().getChildren();for(let r2=0;r2<o2.length;r2++)_(t2,e2,o2[r2],n2);return{namespace:t2._config.namespace,nodes:n2}}(t2,e2))}]];function mt$2(t2,e2){if(void 0!==document.caretRangeFromPoint){const n2=document.caretRangeFromPoint(t2,e2);return null===n2?null:{node:n2.startContainer,offset:n2.startOffset}}if("undefined"!==document.caretPositionFromPoint){const n2=document.caretPositionFromPoint(t2,e2);return null===n2?null:{node:n2.offsetNode,offset:n2.offset}}return null}const ft$1="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,gt$2=ft$1&&"documentMode"in document?document.documentMode:null,pt$2=!(!ft$1||!("InputEvent"in window)||gt$2)&&"getTargetRanges"in new window.InputEvent("input"),ht$2=ft$1&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Ct$2=ft$1&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,vt$2=ft$1&&/^(?=.*Chrome).*/i.test(navigator.userAgent),yt$2=ft$1&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!vt$2,Dt=oe$1("DRAG_DROP_PASTE_FILE");let xt$1=class xt extends di{static getType(){return"quote"}static clone(t2){return new xt(t2.__key)}createDOM(t2){const e2=document.createElement("blockquote");return rt$3(e2,t2.theme.quote),e2}updateDOM(t2,e2){return!1}static importDOM(){return{blockquote:t2=>({conversion:_t$2,priority:0})}}exportDOM(t2){const{element:e2}=super.exportDOM(t2);if(yo(e2)){this.isEmpty()&&e2.append(document.createElement("br"));const t3=this.getFormatType();t3&&(e2.style.textAlign=t3);const n2=this.getDirection();n2&&(e2.dir=n2)}return{element:e2}}static importJSON(t2){return Nt$1().updateFromJSON(t2)}insertNewAfter(t2,e2){const n2=Fi(),r2=this.getDirection();return n2.setDirection(r2),this.insertAfter(n2,e2),n2}collapseAtStart(){const t2=Fi();return this.getChildren().forEach(e2=>t2.append(e2)),this.replace(t2),!0}canMergeWhenEmpty(){return!0}};function Nt$1(){return lo(new xt$1)}function wt$1(t2){return t2 instanceof xt$1}let Et$1=class Et extends di{static getType(){return"heading"}static clone(t2){return new Et(t2.__tag,t2.__key)}constructor(t2,e2){super(e2),this.__tag=t2}getTag(){return this.__tag}setTag(t2){const e2=this.getWritable();return this.__tag=t2,e2}createDOM(t2){const e2=this.__tag,n2=document.createElement(e2),r2=t2.theme.heading;if(void 0!==r2){rt$3(n2,r2[e2])}return n2}updateDOM(t2,e2,n2){return t2.__tag!==this.__tag}static importDOM(){return{h1:t2=>({conversion:Tt$2,priority:0}),h2:t2=>({conversion:Tt$2,priority:0}),h3:t2=>({conversion:Tt$2,priority:0}),h4:t2=>({conversion:Tt$2,priority:0}),h5:t2=>({conversion:Tt$2,priority:0}),h6:t2=>({conversion:Tt$2,priority:0}),p:t2=>{const e2=t2.firstChild;return null!==e2&&Ot(e2)?{conversion:()=>({node:null}),priority:3}:null},span:t2=>Ot(t2)?{conversion:t3=>({node:At("h1")}),priority:3}:null}}exportDOM(t2){const{element:e2}=super.exportDOM(t2);if(yo(e2)){this.isEmpty()&&e2.append(document.createElement("br"));const t3=this.getFormatType();t3&&(e2.style.textAlign=t3);const n2=this.getDirection();n2&&(e2.dir=n2)}return{element:e2}}static importJSON(t2){return At(t2.tag).updateFromJSON(t2)}updateFromJSON(t2){return super.updateFromJSON(t2).setTag(t2.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(t2,e2=!0){const n2=t2?t2.anchor.offset:0,r2=this.getLastDescendant(),o2=!r2||t2&&t2.anchor.key===r2.getKey()&&n2===r2.getTextContentSize()||!t2?Fi():At(this.getTag()),i2=this.getDirection();if(o2.setDirection(i2),this.insertAfter(o2,e2),0===n2&&!this.isEmpty()&&t2){const t3=Fi();t3.select(),this.replace(t3,!0)}return o2}collapseAtStart(){const t2=this.isEmpty()?Fi():At(this.getTag());return this.getChildren().forEach(e2=>t2.append(e2)),this.replace(t2),!0}extractWithChild(){return!0}};function Ot(t2){return"span"===t2.nodeName.toLowerCase()&&"26pt"===t2.style.fontSize}function Tt$2(t2){const e2=t2.nodeName.toLowerCase();let n2=null;return"h1"!==e2&&"h2"!==e2&&"h3"!==e2&&"h4"!==e2&&"h5"!==e2&&"h6"!==e2||(n2=At(e2),null!==t2.style&&(Oo(t2,n2),n2.setFormat(t2.style.textAlign))),{node:n2}}function _t$2(t2){const e2=Nt$1();return null!==t2.style&&(e2.setFormat(t2.style.textAlign),Oo(t2,e2)),{node:e2}}function At(t2="h1"){return lo(new Et$1(t2))}function Ft$1(t2){return t2 instanceof Et$1}function Pt$1(t2){let e2=null;if(Lt$1(t2,DragEvent)?e2=t2.dataTransfer:Lt$1(t2,ClipboardEvent)&&(e2=t2.clipboardData),null===e2)return[!1,[],!1];const n2=e2.types,r2=n2.includes("Files"),o2=n2.includes("text/html")||n2.includes("text/plain");return[r2,Array.from(e2.files),o2]}function St$2(t2){const e2=wr();if(!ar(e2))return!1;const n2=new Set,r2=e2.getNodes();for(let e3=0;e3<r2.length;e3++){const o2=r2[e3],i2=o2.getKey();if(n2.has(i2))continue;const s2=wt$2(o2,t3=>hi(t3)&&!t3.isInline());if(null===s2)continue;const a2=s2.getKey();s2.canIndent()&&!n2.has(a2)&&(n2.add(a2),t2(s2))}return n2.size>0}function It$1(t2){return pi(ms(t2))}function Mt(t2){for(const e2 of["lowercase","uppercase","capitalize"])t2.hasFormat(e2)&&t2.toggleFormat(e2)}function bt$1(i2){return j$2(i2.registerCommand(ae,t2=>{const e2=wr();return!!fr(e2)&&(e2.clear(),!0)},0),i2.registerCommand(ue,t2=>{const e2=wr();return ar(e2)?(e2.deleteCharacter(t2),!0):!!fr(e2)&&(e2.deleteNodes(),!0)},0),i2.registerCommand(pe,t2=>{const e2=wr();return!!ar(e2)&&(e2.deleteWord(t2),!0)},0),i2.registerCommand(ye,t2=>{const e2=wr();return!!ar(e2)&&(e2.deleteLine(t2),!0)},0),i2.registerCommand(he,e2=>{const n2=wr();if("string"==typeof e2)null!==n2&&n2.insertText(e2);else{if(null===n2)return!1;const r2=e2.dataTransfer;if(null!=r2)A$1(r2,n2,i2);else if(ar(n2)){const t2=e2.data;return t2&&n2.insertText(t2),!0}}return!0},0),i2.registerCommand(_e,()=>{const t2=wr();return!!ar(t2)&&(t2.removeText(),!0)},0),i2.registerCommand(me,t2=>{const e2=wr();return!!ar(e2)&&(e2.formatText(t2),!0)},0),i2.registerCommand(ze,t2=>{const e2=wr();if(!ar(e2)&&!fr(e2))return!1;const n2=e2.getNodes();for(const e3 of n2){const n3=wt$2(e3,t3=>hi(t3)&&!t3.isInline());null!==n3&&n3.setFormat(t2)}return!0},0),i2.registerCommand(fe,t2=>{const e2=wr();return!!ar(e2)&&(e2.insertLineBreak(t2),!0)},0),i2.registerCommand(de,()=>{const t2=wr();return!!ar(t2)&&(t2.insertParagraph(),!0)},0),i2.registerCommand(Fe,()=>(Lr([nr()]),!0),0),i2.registerCommand(Le,()=>St$2(t2=>{const e2=t2.getIndent();t2.setIndent(e2+1)}),0),i2.registerCommand(Ie,()=>St$2(t2=>{const e2=t2.getIndent();e2>0&&t2.setIndent(Math.max(0,e2-1))}),0),i2.registerCommand(be,t2=>{const e2=wr();if(fr(e2)){const t3=e2.getNodes();if(t3.length>0)return t3[0].selectPrevious(),!0}else if(ar(e2)){const n2=js(e2.focus,!0);if(!t2.shiftKey&&pi(n2)&&!n2.isIsolated()&&!n2.isInline())return n2.selectPrevious(),t2.preventDefault(),!0}return!1},0),i2.registerCommand(we,t2=>{const e2=wr();if(fr(e2)){const t3=e2.getNodes();if(t3.length>0)return t3[0].selectNext(0,0),!0}else if(ar(e2)){if(function(t3){const e3=t3.focus;return"root"===e3.key&&e3.offset===Ss().getChildrenSize()}(e2))return t2.preventDefault(),!0;const n2=js(e2.focus,!1);if(!t2.shiftKey&&pi(n2)&&!n2.isIsolated()&&!n2.isInline())return n2.selectNext(),t2.preventDefault(),!0}return!1},0),i2.registerCommand(Te,t2=>{const e2=wr();if(fr(e2)){const r2=e2.getNodes();if(r2.length>0)return t2.preventDefault(),R$4(r2[0])?r2[0].selectNext(0,0):r2[0].selectPrevious(),!0}if(!ar(e2))return!1;if(Q$2(e2,!0)){const n2=t2.shiftKey;return t2.preventDefault(),ee(e2,n2,!0),!0}return!1},0),i2.registerCommand(ve,t2=>{const e2=wr();if(fr(e2)){const r2=e2.getNodes();if(r2.length>0)return t2.preventDefault(),R$4(r2[0])?r2[0].selectPrevious():r2[0].selectNext(0,0),!0}if(!ar(e2))return!1;const i3=t2.shiftKey;return!!Q$2(e2,!1)&&(t2.preventDefault(),ee(e2,i3,!1),!0)},0),i2.registerCommand(Me,t2=>{if(It$1(t2.target))return!1;const e2=wr();if(ar(e2)){if(function(t3){if(!t3.isCollapsed())return!1;const{anchor:e3}=t3;if(0!==e3.offset)return!1;const n2=e3.getNode();if(mi(n2))return!1;const r2=yt$3(n2);return r2.getIndent()>0&&(r2.is(n2)||n2.is(r2.getFirstDescendant()))}(e2))return t2.preventDefault(),i2.dispatchCommand(Ie,void 0);if(Ct$2&&"ko-KR"===navigator.language)return!1}else if(!fr(e2))return!1;return t2.preventDefault(),i2.dispatchCommand(ue,!0)},0),i2.registerCommand(Pe,t2=>{if(It$1(t2.target))return!1;const e2=wr();return!(!ar(e2)&&!fr(e2))&&(t2.preventDefault(),i2.dispatchCommand(ue,!1))},0),i2.registerCommand(Ee,t2=>{const e2=wr();if(!ar(e2))return!1;if(Mt(e2),null!==t2){if((Ct$2||ht$2||yt$2)&&pt$2)return!1;if(t2.preventDefault(),t2.shiftKey)return i2.dispatchCommand(fe,!1)}return i2.dispatchCommand(de,void 0)},0),i2.registerCommand(Ae,()=>!!ar(wr())&&(i2.blur(),!0),0),i2.registerCommand(Ke,t2=>{const[,e2]=Pt$1(t2);if(e2.length>0){const n3=mt$2(t2.clientX,t2.clientY);if(null!==n3){const{offset:t3,node:r2}=n3,o2=ms(r2);if(null!==o2){const e3=kr();if(Zn(o2))e3.anchor.set(o2.getKey(),t3,"text"),e3.focus.set(o2.getKey(),t3,"text");else{const t4=o2.getParentOrThrow().getKey(),n5=o2.getIndexWithinParent()+1;e3.anchor.set(t4,n5,"element"),e3.focus.set(t4,n5,"element")}ks(Tt$3(e3))}i2.dispatchCommand(Dt,e2)}return t2.preventDefault(),!0}return!!ar(wr())},0),i2.registerCommand(Be,t2=>{const[e2]=Pt$1(t2),n2=wr();return!(e2&&!ar(n2))},0),i2.registerCommand(Re,t2=>{const[e2]=Pt$1(t2),n2=wr();if(e2&&!ar(n2))return!1;const r2=mt$2(t2.clientX,t2.clientY);if(null!==r2){pi(ms(r2.node))&&t2.preventDefault()}return!0},0),i2.registerCommand(je,()=>(function(t2){const e2=Ss();if(ar(t2)){const e3=t2.anchor,n2=t2.focus,r2=e3.getNode().getTopLevelElementOrThrow().getParentOrThrow();return e3.set(r2.getKey(),0,"element"),n2.set(r2.getKey(),r2.getChildrenSize(),"element"),Tt$3(t2),t2}{const t3=e2.select(0,e2.getChildrenSize());ks(Tt$3(t3))}}(),!0),0),i2.registerCommand(Je,t2=>(F(i2,Lt$1(t2,ClipboardEvent)?t2:null),!0),0),i2.registerCommand($e,t2=>(async function(t3,n2){await F(n2,Lt$1(t3,ClipboardEvent)?t3:null),n2.update(()=>{const t4=wr();ar(t4)?t4.removeText():fr(t4)&&t4.getNodes().forEach(t5=>t5.remove())})}(t2,i2),!0),0),i2.registerCommand(ge,e2=>{const[,n2,r2]=Pt$1(e2);return n2.length>0&&!r2?(i2.dispatchCommand(Dt,n2),!0):(!mo(e2.target)||!Qi(e2.target))&&(null!==wr()&&(n3=i2,(e3=e2).preventDefault(),n3.update(()=>{const r3=wr(),o2=Lt$1(e3,InputEvent)||Lt$1(e3,KeyboardEvent)?null:e3.clipboardData;null!=o2&&null!==r3&&A$1(o2,r3,n3)},{tag:"paste"}),!0));var e3,n3},0),i2.registerCommand(Oe,t2=>{const e2=wr();return ar(e2)&&Mt(e2),!1},0),i2.registerCommand(De,t2=>{const e2=wr();return ar(e2)&&Mt(e2),!1},0))}function splice(list2,start2,remove,items){const end=list2.length;let parameters,chunkStart=0;if(start2=start2<0?-start2>end?0:end+start2:start2>end?end:start2,remove=remove>0?remove:0,items.length<1e4)parameters=Array.from(items),parameters.unshift(start2,remove),list2.splice(...parameters);else for(remove&&list2.splice(start2,remove);chunkStart<items.length;)parameters=items.slice(chunkStart,chunkStart+1e4),parameters.unshift(start2,0),list2.splice(...parameters),chunkStart+=1e4,start2+=1e4}function push(list2,items){return list2.length>0?(splice(list2,list2.length,0,items),list2):items}const asciiAlpha=regexCheck(/[A-Za-z]/),asciiAlphanumeric=regexCheck(/[\dA-Za-z]/),asciiAtext=regexCheck(/[#-'*+\--9=?A-Z^-~]/);function asciiControl(code2){return null!==code2&&(code2<32||127===code2)}const asciiDigit=regexCheck(/\d/),asciiHexDigit=regexCheck(/[\dA-Fa-f]/),asciiPunctuation=regexCheck(/[!-/:-@[-`{-~]/);function markdownLineEnding(code2){return null!==code2&&code2<-2}function markdownLineEndingOrSpace(code2){return null!==code2&&(code2<0||32===code2)}function markdownSpace(code2){return-2===code2||-1===code2||32===code2}const unicodePunctuation=regexCheck(new RegExp("\\p{P}|\\p{S}","u")),unicodeWhitespace=regexCheck(/\s/);function regexCheck(regex){return function(code2){return null!==code2&&code2>-1&®ex.test(String.fromCharCode(code2))}}function classifyCharacter(code2){return null===code2||markdownLineEndingOrSpace(code2)||unicodeWhitespace(code2)?1:unicodePunctuation(code2)?2:void 0}function resolveAll(constructs2,events,context){const called=[];let index2=-1;for(;++index2<constructs2.length;){const resolve=constructs2[index2].resolveAll;resolve&&!called.includes(resolve)&&(events=resolve(events,context),called.push(resolve))}return events}function gfmStrikethrough(options){let single={}.singleTilde;const tokenizer={name:"strikethrough",tokenize:function(effects,ok2,nok){const previous2=this.previous,events=this.events;let size2=0;return function(code2){if(126===previous2&&"characterEscape"!==events[events.length-1][1].type)return nok(code2);return effects.enter("strikethroughSequenceTemporary"),more(code2)};function more(code2){const before=classifyCharacter(previous2);if(126===code2)return size2>1?nok(code2):(effects.consume(code2),size2++,more);if(size2<2&&!single)return nok(code2);const token=effects.exit("strikethroughSequenceTemporary"),after=classifyCharacter(code2);return token._open=!after||2===after&&Boolean(before),token._close=!before||2===before&&Boolean(after),ok2(code2)}},resolveAll:function(events,context){let index2=-1;for(;++index2<events.length;)if("enter"===events[index2][0]&&"strikethroughSequenceTemporary"===events[index2][1].type&&events[index2][1]._close){let open=index2;for(;open--;)if("exit"===events[open][0]&&"strikethroughSequenceTemporary"===events[open][1].type&&events[open][1]._open&&events[index2][1].end.offset-events[index2][1].start.offset===events[open][1].end.offset-events[open][1].start.offset){events[index2][1].type="strikethroughSequence",events[open][1].type="strikethroughSequence";const strikethrough2={type:"strikethrough",start:Object.assign({},events[open][1].start),end:Object.assign({},events[index2][1].end)},text2={type:"strikethroughText",start:Object.assign({},events[open][1].end),end:Object.assign({},events[index2][1].start)},nextEvents=[["enter",strikethrough2,context],["enter",events[open][1],context],["exit",events[open][1],context],["enter",text2,context]],insideSpan2=context.parser.constructs.insideSpan.null;insideSpan2&&splice(nextEvents,nextEvents.length,0,resolveAll(insideSpan2,events.slice(open+1,index2),context)),splice(nextEvents,nextEvents.length,0,[["exit",text2,context],["enter",events[index2][1],context],["exit",events[index2][1],context],["exit",strikethrough2,context]]),splice(events,open-1,index2-open+3,nextEvents),index2=open+nextEvents.length-2;break}}index2=-1;for(;++index2<events.length;)"strikethroughSequenceTemporary"===events[index2][1].type&&(events[index2][1].type="data");return events}};return null==single&&(single=!0),{text:{126:tokenizer},insideSpan:{null:[tokenizer]},attentionMarkers:{null:[126]}}}const constructsWithoutStrikethrough=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];function enterStrikethrough(token){this.enter({type:"delete",children:[]},token)}function exitStrikethrough(token){this.exit(token)}function handleDelete(node2,_2,state,info){const tracker=state.createTracker(info),exit2=state.enter("strikethrough");let value=tracker.move("~~");return value+=state.containerPhrasing(node2,{...tracker.current(),before:value,after:"~"}),value+=tracker.move("~~"),exit2(),value}handleDelete.peek=function(){return"~"},handleMark.peek=function(){return"="};var highlightMarkFromMarkdown={canContainEols:["highlight"],enter:{highlight:function(token){this.enter({type:"highlight",children:[]},token)}},exit:{highlight:function(token){this.exit(token)}}};var highlightMarkToMarkdown={unsafe:[{character:"=",inConstruct:"phrasing",notInConstruct:["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"]}],handlers:{highlight:handleMark}};function handleMark(node2,_2,state,info){const tracker=state.createTracker(info),exit2=state.enter("highlight");let value=tracker.move("==");return value+=tracker.move(state.containerPhrasing(node2,{before:value,after:"=",...tracker.current()})),value+=tracker.move("=="),exit2(),value}function ccount(value,character){const source=String(value);if("string"!=typeof character)throw new TypeError("Expected character");let count2=0,index2=source.indexOf(character);for(;-1!==index2;)count2++,index2=source.indexOf(character,index2+character.length);return count2}const characterEntitiesLegacy=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],characterReferenceInvalid={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"};function isDecimal(character){const code2="string"==typeof character?character.charCodeAt(0):character;return code2>=48&&code2<=57}function isHexadecimal(character){const code2="string"==typeof character?character.charCodeAt(0):character;return code2>=97&&code2<=102||code2>=65&&code2<=70||code2>=48&&code2<=57}function isAlphanumerical(character){return function(character){const code2="string"==typeof character?character.charCodeAt(0):character;return code2>=97&&code2<=122||code2>=65&&code2<=90}(character)||isDecimal(character)}const element=document.createElement("i");function decodeNamedCharacterReference(value){const characterReference2="&"+value+";";element.innerHTML=characterReference2;const character=element.textContent;return(59!==character.charCodeAt(character.length-1)||"semi"===value)&&(character!==characterReference2&&character)}const messages=["","Named character references must be terminated by a semicolon","Numeric character references must be terminated by a semicolon","Named character references cannot be empty","Numeric character references cannot be empty","Named character references must be known","Numeric character references cannot be disallowed","Numeric character references cannot be outside the permissible Unicode range"];function prohibited(code2){return code2>=55296&&code2<=57343||code2>1114111}function disallowed(code2){return code2>=1&&code2<=8||11===code2||code2>=13&&code2<=31||code2>=127&&code2<=159||code2>=64976&&code2<=65007||!(65535&~code2)||65534==(65535&code2)}const defaultSubsetRegex=/["&'<>`]/g,surrogatePairsRegex=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,controlCharactersRegex=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,regexEscapeRegex=/[|\\{}()[\]^$+*?.]/g,subsetToRegexCache=new WeakMap;function core(value,options){return value=value.replace(options.subset?function(subset){let cached=subsetToRegexCache.get(subset);cached||(cached=function(subset){const groups=[];let index2=-1;for(;++index2<subset.length;)groups.push(subset[index2].replace(regexEscapeRegex,"\\$&"));return new RegExp("(?:"+groups.join("|")+")","g")}(subset),subsetToRegexCache.set(subset,cached));return cached}(options.subset):defaultSubsetRegex,basic),options.subset||options.escapeOnly?value:value.replace(surrogatePairsRegex,function(pair,index2,all2){return options.format(1024*(pair.charCodeAt(0)-55296)+pair.charCodeAt(1)-56320+65536,all2.charCodeAt(index2+2),options)}).replace(controlCharactersRegex,basic);function basic(character,index2,all2){return options.format(character.charCodeAt(0),all2.charCodeAt(index2+1),options)}}function formatBasic(code2){return"&#x"+code2.toString(16).toUpperCase()+";"}function stringifyEntitiesLight(value,options){return core(value,Object.assign({format:formatBasic},options))}function stringifyPosition(value){return value&&"object"==typeof value?"position"in value||"type"in value?position(value.position):"start"in value||"end"in value?position(value):"line"in value||"column"in value?point$1(value):"":""}function point$1(point2){return index$1(point2&&point2.line)+":"+index$1(point2&&point2.column)}function position(pos){return point$1(pos&&pos.start)+"-"+point$1(pos&&pos.end)}function index$1(value){return value&&"number"==typeof value?value:1}class VFileMessage extends Error{constructor(causeOrReason,optionsOrParentOrPlace,origin){super(),"string"==typeof optionsOrParentOrPlace&&(origin=optionsOrParentOrPlace,optionsOrParentOrPlace=void 0);let reason="",options={},legacyCause=!1;if(optionsOrParentOrPlace&&(options="line"in optionsOrParentOrPlace&&"column"in optionsOrParentOrPlace||"start"in optionsOrParentOrPlace&&"end"in optionsOrParentOrPlace?{place:optionsOrParentOrPlace}:"type"in optionsOrParentOrPlace?{ancestors:[optionsOrParentOrPlace],place:optionsOrParentOrPlace.position}:{...optionsOrParentOrPlace}),"string"==typeof causeOrReason?reason=causeOrReason:!options.cause&&causeOrReason&&(legacyCause=!0,reason=causeOrReason.message,options.cause=causeOrReason),!options.ruleId&&!options.source&&"string"==typeof origin){const index2=origin.indexOf(":");-1===index2?options.ruleId=origin:(options.source=origin.slice(0,index2),options.ruleId=origin.slice(index2+1))}if(!options.place&&options.ancestors&&options.ancestors){const parent=options.ancestors[options.ancestors.length-1];parent&&(options.place=parent.position)}const start2=options.place&&"start"in options.place?options.place.start:options.place;this.ancestors=options.ancestors||void 0,this.cause=options.cause||void 0,this.column=start2?start2.column:void 0,this.fatal=void 0,this.file="",this.message=reason,this.line=start2?start2.line:void 0,this.name=stringifyPosition(options.place)||"1:1",this.place=options.place||void 0,this.reason=this.message,this.ruleId=options.ruleId||void 0,this.source=options.source||void 0,this.stack=legacyCause&&options.cause&&"string"==typeof options.cause.stack?options.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}VFileMessage.prototype.file="",VFileMessage.prototype.name="",VFileMessage.prototype.reason="",VFileMessage.prototype.message="",VFileMessage.prototype.stack="",VFileMessage.prototype.column=void 0,VFileMessage.prototype.line=void 0,VFileMessage.prototype.ancestors=void 0,VFileMessage.prototype.cause=void 0,VFileMessage.prototype.fatal=void 0,VFileMessage.prototype.place=void 0,VFileMessage.prototype.ruleId=void 0,VFileMessage.prototype.source=void 0;function mdxJsxFromMarkdown(){return{canContainEols:["mdxJsxTextElement"],enter:{mdxJsxFlowTag:enterMdxJsxTag,mdxJsxFlowTagClosingMarker:enterMdxJsxTagClosingMarker,mdxJsxFlowTagAttribute:enterMdxJsxTagAttribute,mdxJsxFlowTagExpressionAttribute:enterMdxJsxTagExpressionAttribute,mdxJsxFlowTagAttributeValueLiteral:buffer,mdxJsxFlowTagAttributeValueExpression:buffer,mdxJsxFlowTagSelfClosingMarker:enterMdxJsxTagSelfClosingMarker,mdxJsxTextTag:enterMdxJsxTag,mdxJsxTextTagClosingMarker:enterMdxJsxTagClosingMarker,mdxJsxTextTagAttribute:enterMdxJsxTagAttribute,mdxJsxTextTagExpressionAttribute:enterMdxJsxTagExpressionAttribute,mdxJsxTextTagAttributeValueLiteral:buffer,mdxJsxTextTagAttributeValueExpression:buffer,mdxJsxTextTagSelfClosingMarker:enterMdxJsxTagSelfClosingMarker},exit:{mdxJsxFlowTagClosingMarker:exitMdxJsxTagClosingMarker,mdxJsxFlowTagNamePrimary:exitMdxJsxTagNamePrimary,mdxJsxFlowTagNameMember:exitMdxJsxTagNameMember,mdxJsxFlowTagNameLocal:exitMdxJsxTagNameLocal,mdxJsxFlowTagExpressionAttribute:exitMdxJsxTagExpressionAttribute,mdxJsxFlowTagExpressionAttributeValue:data,mdxJsxFlowTagAttributeNamePrimary:exitMdxJsxTagAttributeNamePrimary,mdxJsxFlowTagAttributeNameLocal:exitMdxJsxTagAttributeNameLocal,mdxJsxFlowTagAttributeValueLiteral:exitMdxJsxTagAttributeValueLiteral,mdxJsxFlowTagAttributeValueLiteralValue:data,mdxJsxFlowTagAttributeValueExpression:exitMdxJsxTagAttributeValueExpression,mdxJsxFlowTagAttributeValueExpressionValue:data,mdxJsxFlowTagSelfClosingMarker:exitMdxJsxTagSelfClosingMarker,mdxJsxFlowTag:exitMdxJsxTag,mdxJsxTextTagClosingMarker:exitMdxJsxTagClosingMarker,mdxJsxTextTagNamePrimary:exitMdxJsxTagNamePrimary,mdxJsxTextTagNameMember:exitMdxJsxTagNameMember,mdxJsxTextTagNameLocal:exitMdxJsxTagNameLocal,mdxJsxTextTagExpressionAttribute:exitMdxJsxTagExpressionAttribute,mdxJsxTextTagExpressionAttributeValue:data,mdxJsxTextTagAttributeNamePrimary:exitMdxJsxTagAttributeNamePrimary,mdxJsxTextTagAttributeNameLocal:exitMdxJsxTagAttributeNameLocal,mdxJsxTextTagAttributeValueLiteral:exitMdxJsxTagAttributeValueLiteral,mdxJsxTextTagAttributeValueLiteralValue:data,mdxJsxTextTagAttributeValueExpression:exitMdxJsxTagAttributeValueExpression,mdxJsxTextTagAttributeValueExpressionValue:data,mdxJsxTextTagSelfClosingMarker:exitMdxJsxTagSelfClosingMarker,mdxJsxTextTag:exitMdxJsxTag}};function buffer(){this.buffer()}function point2(d2){return{line:d2.line,column:d2.column,offset:d2.offset}}function data(token){this.config.enter.data.call(this,token),this.config.exit.data.call(this,token)}function enterMdxJsxTag(token){const tag={name:void 0,attributes:[],close:!1,selfClosing:!1,start:token.start,end:token.end};this.data.mdxJsxTagStack||(this.data.mdxJsxTagStack=[]),this.data.mdxJsxTag=tag,this.buffer()}function enterMdxJsxTagClosingMarker(token){if(0===this.data.mdxJsxTagStack.length)throw new VFileMessage("Unexpected closing slash `/` in tag, expected an open tag first",{start:token.start,end:token.end},"mdast-util-mdx-jsx:unexpected-closing-slash")}function enterMdxJsxTagAnyAttribute(token){if(this.data.mdxJsxTag.close)throw new VFileMessage("Unexpected attribute in closing tag, expected the end of the tag",{start:token.start,end:token.end},"mdast-util-mdx-jsx:unexpected-attribute")}function enterMdxJsxTagSelfClosingMarker(token){if(this.data.mdxJsxTag.close)throw new VFileMessage("Unexpected self-closing slash `/` in closing tag, expected the end of the tag",{start:token.start,end:token.end},"mdast-util-mdx-jsx:unexpected-self-closing-slash")}function exitMdxJsxTagClosingMarker(){this.data.mdxJsxTag.close=!0}function exitMdxJsxTagNamePrimary(token){this.data.mdxJsxTag.name=this.sliceSerialize(token)}function exitMdxJsxTagNameMember(token){this.data.mdxJsxTag.name+="."+this.sliceSerialize(token)}function exitMdxJsxTagNameLocal(token){this.data.mdxJsxTag.name+=":"+this.sliceSerialize(token)}function enterMdxJsxTagAttribute(token){const tag=this.data.mdxJsxTag;enterMdxJsxTagAnyAttribute.call(this,token),tag.attributes.push({type:"mdxJsxAttribute",name:"",value:null,position:{start:point2(token.start),end:void 0}})}function enterMdxJsxTagExpressionAttribute(token){const tag=this.data.mdxJsxTag;enterMdxJsxTagAnyAttribute.call(this,token),tag.attributes.push({type:"mdxJsxExpressionAttribute",value:"",position:{start:point2(token.start),end:void 0}}),this.buffer()}function exitMdxJsxTagExpressionAttribute(token){const tag=this.data.mdxJsxTag,tail=tag.attributes[tag.attributes.length-1];tail.type;const estree=token.estree;tail.value=this.resume(),tail.position,tail.position.end=point2(token.end),estree&&(tail.data={estree:estree})}function exitMdxJsxTagAttributeNamePrimary(token){const tag=this.data.mdxJsxTag,node2=tag.attributes[tag.attributes.length-1];node2.type,node2.name=this.sliceSerialize(token),node2.position,node2.position.end=point2(token.end)}function exitMdxJsxTagAttributeNameLocal(token){const tag=this.data.mdxJsxTag,node2=tag.attributes[tag.attributes.length-1];node2.type,node2.name+=":"+this.sliceSerialize(token),node2.position,node2.position.end=point2(token.end)}function exitMdxJsxTagAttributeValueLiteral(token){const tag=this.data.mdxJsxTag,node2=tag.attributes[tag.attributes.length-1];node2.value=function(value,options){const settings=options||{},additional="string"==typeof settings.additional?settings.additional.charCodeAt(0):settings.additional,result=[];let point2,indent2,index2=0,lines=-1,queue="";settings.position&&("start"in settings.position||"indent"in settings.position?(indent2=settings.position.indent,point2=settings.position.start):point2=settings.position);let character,line=(point2?point2.line:0)||1,column=(point2?point2.column:0)||1,previous2=now();for(index2--;++index2<=value.length;)if(10===character&&(column=(indent2?indent2[lines]:0)||1),character=value.charCodeAt(index2),38===character){const following=value.charCodeAt(index2+1);if(9===following||10===following||12===following||32===following||38===following||60===following||Number.isNaN(following)||additional&&following===additional){queue+=String.fromCharCode(character),column++;continue}const start2=index2+1;let type,begin=start2,end=start2;if(35===following){end=++begin;const following2=value.charCodeAt(end);88===following2||120===following2?(type="hexadecimal",end=++begin):type="decimal"}else type="named";let characterReferenceCharacters="",characterReference2="",characters="";const test="named"===type?isAlphanumerical:"decimal"===type?isDecimal:isHexadecimal;for(end--;++end<=value.length;){const following2=value.charCodeAt(end);if(!test(following2))break;characters+=String.fromCharCode(following2),"named"===type&&characterEntitiesLegacy.includes(characters)&&(characterReferenceCharacters=characters,characterReference2=decodeNamedCharacterReference(characters))}let terminated=59===value.charCodeAt(end);if(terminated){end++;const namedReference="named"===type&&decodeNamedCharacterReference(characters);namedReference&&(characterReferenceCharacters=characters,characterReference2=namedReference)}let diff3=1+end-start2,reference="";if(terminated||!1!==settings.nonTerminated)if(characters)if("named"===type){if(terminated&&!characterReference2)warning(5,1);else if(characterReferenceCharacters!==characters&&(end=begin+characterReferenceCharacters.length,diff3=1+end-begin,terminated=!1),!terminated){const reason=characterReferenceCharacters?1:3;if(settings.attribute){const following2=value.charCodeAt(end);61===following2?(warning(reason,diff3),characterReference2=""):isAlphanumerical(following2)?characterReference2="":warning(reason,diff3)}else warning(reason,diff3)}reference=characterReference2}else{terminated||warning(2,diff3);let referenceCode=Number.parseInt(characters,"hexadecimal"===type?16:10);if(prohibited(referenceCode))warning(7,diff3),reference=String.fromCharCode(65533);else if(referenceCode in characterReferenceInvalid)warning(6,diff3),reference=characterReferenceInvalid[referenceCode];else{let output="";disallowed(referenceCode)&&warning(6,diff3),referenceCode>65535&&(referenceCode-=65536,output+=String.fromCharCode(referenceCode>>>10|55296),referenceCode=56320|1023&referenceCode),reference=output+String.fromCharCode(referenceCode)}}else"named"!==type&&warning(4,diff3);if(reference){flush(),previous2=now(),index2=end-1,column+=end-start2+1,result.push(reference);const next=now();next.offset++,settings.reference&&settings.reference.call(settings.referenceContext||void 0,reference,{start:previous2,end:next},value.slice(start2-1,end)),previous2=next}else characters=value.slice(start2-1,end),queue+=characters,column+=characters.length,index2=end-1}else 10===character&&(line++,lines++,column=0),Number.isNaN(character)?flush():(queue+=String.fromCharCode(character),column++);return result.join("");function now(){return{line:line,column:column,offset:index2+((point2?point2.offset:0)||0)}}function warning(code2,offset2){let position2;settings.warning&&(position2=now(),position2.column+=offset2,position2.offset+=offset2,settings.warning.call(settings.warningContext||void 0,messages[code2],position2,code2))}function flush(){queue&&(result.push(queue),settings.text&&settings.text.call(settings.textContext||void 0,queue,{start:previous2,end:now()}),queue="")}}(this.resume(),{nonTerminated:!1}),node2.position,node2.position.end=point2(token.end)}function exitMdxJsxTagAttributeValueExpression(token){const tag=this.data.mdxJsxTag,tail=tag.attributes[tag.attributes.length-1];tail.type;const node2={type:"mdxJsxAttributeValueExpression",value:this.resume()},estree=token.estree;estree&&(node2.data={estree:estree}),tail.value=node2,tail.position,tail.position.end=point2(token.end)}function exitMdxJsxTagSelfClosingMarker(){this.data.mdxJsxTag.selfClosing=!0}function exitMdxJsxTag(token){const tag=this.data.mdxJsxTag,stack=this.data.mdxJsxTagStack,tail=stack[stack.length-1];if(tag.close&&tail.name!==tag.name)throw new VFileMessage("Unexpected closing tag `"+serializeAbbreviatedTag(tag)+"`, expected corresponding closing tag for `"+serializeAbbreviatedTag(tail)+"` ("+stringifyPosition(tail)+")",{start:token.start,end:token.end},"mdast-util-mdx-jsx:end-tag-mismatch");this.resume(),tag.close?stack.pop():this.enter({type:"mdxJsxTextTag"===token.type?"mdxJsxTextElement":"mdxJsxFlowElement",name:tag.name||null,attributes:tag.attributes,children:[]},token,onErrorRightIsTag),tag.selfClosing||tag.close?this.exit(token,onErrorLeftIsTag):stack.push(tag)}function onErrorRightIsTag(closing,open){const stack=this.data.mdxJsxTagStack,tag=stack[stack.length-1],place=closing?" before the end of `"+closing.type+"`":"",position2=closing?{start:closing.start,end:closing.end}:void 0;throw new VFileMessage("Expected a closing tag for `"+serializeAbbreviatedTag(tag)+"` ("+stringifyPosition({start:open.start,end:open.end})+")"+place,position2,"mdast-util-mdx-jsx:end-tag-mismatch")}function onErrorLeftIsTag(a2,b2){const tag=this.data.mdxJsxTag;throw new VFileMessage("Expected the closing tag `"+serializeAbbreviatedTag(tag)+"` either after the end of `"+b2.type+"` ("+stringifyPosition(b2.end)+") or another opening tag after the start of `"+b2.type+"` ("+stringifyPosition(b2.start)+")",{start:a2.start,end:a2.end},"mdast-util-mdx-jsx:end-tag-mismatch")}function serializeAbbreviatedTag(tag){return"<"+(tag.close?"/":"")+(tag.name||"")+">"}}function mdxJsxToMarkdown(options){const options_={},quote=options_.quote||'"',quoteSmart=options_.quoteSmart||!1,tightSelfClosing=options_.tightSelfClosing||!1,printWidth=options_.printWidth||Number.POSITIVE_INFINITY,alternative='"'===quote?"'":'"';if('"'!==quote&&"'"!==quote)throw new Error("Cannot serialize attribute values with `"+quote+"` for `options.quote`, expected `\"`, or `'`");return mdxElement.peek=peekElement,{handlers:{mdxJsxFlowElement:mdxElement,mdxJsxTextElement:mdxElement},unsafe:[{character:"<",inConstruct:["phrasing"]},{atBreak:!0,character:"<"}],fences:!0,resourceLink:!0};function mdxElement(node2,_2,state,info){const flow2="mdxJsxFlowElement"===node2.type,selfClosing=!!node2.name&&(!node2.children||0===node2.children.length),currentIndent=createIndent(inferDepth(state)),trackerOneLine=state.createTracker(info),trackerMultiLine=state.createTracker(info),serializedAttributes=[],prefix=(flow2?currentIndent:"")+"<"+(node2.name||""),exit2=state.enter(node2.type);if(trackerOneLine.move(prefix),trackerMultiLine.move(prefix),node2.attributes&&node2.attributes.length>0){if(!node2.name)throw new Error("Cannot serialize fragment w/ attributes");let index2=-1;for(;++index2<node2.attributes.length;){const attribute=node2.attributes[index2];let result;if("mdxJsxExpressionAttribute"===attribute.type)result="{"+(attribute.value||"")+"}";else{if(!attribute.name)throw new Error("Cannot serialize attribute w/o name");const value2=attribute.value,left=attribute.name;let right="";if(null==value2);else if("object"==typeof value2)right="{"+(value2.value||"")+"}";else{const appliedQuote=quoteSmart&&ccount(value2,quote)>ccount(value2,alternative)?alternative:quote;right=appliedQuote+stringifyEntitiesLight(value2,{subset:[appliedQuote]})+appliedQuote}result=left+(right?"=":"")+right}serializedAttributes.push(result)}}let attributesOnTheirOwnLine=!1;const attributesOnOneLine=serializedAttributes.join(" ");flow2&&(/\r?\n|\r/.test(attributesOnOneLine)||trackerOneLine.current().now.column+attributesOnOneLine.length+(selfClosing?tightSelfClosing?2:3:1)>printWidth)&&(attributesOnTheirOwnLine=!0);let tracker=trackerOneLine,value=prefix;if(attributesOnTheirOwnLine){tracker=trackerMultiLine;let index2=-1;for(;++index2<serializedAttributes.length;)serializedAttributes[index2]=currentIndent+" "+serializedAttributes[index2];value+=tracker.move("\n"+serializedAttributes.join("\n")+"\n"+currentIndent)}else attributesOnOneLine&&(value+=tracker.move(" "+attributesOnOneLine));return selfClosing&&(value+=tracker.move((tightSelfClosing||attributesOnTheirOwnLine?"":" ")+"/")),value+=tracker.move(">"),node2.children&&node2.children.length>0&&("mdxJsxTextElement"===node2.type?value+=tracker.move(state.containerPhrasing(node2,{...tracker.current(),before:">",after:"<"})):(tracker.shift(2),value+=tracker.move("\n"),value+=tracker.move(function(parent,state,info){const indexStack=state.indexStack,children=parent.children,tracker=state.createTracker(info),currentIndent=createIndent(inferDepth(state)),results=[];let index2=-1;indexStack.push(-1);for(;++index2<children.length;){const child=children[index2];indexStack[indexStack.length-1]=index2;const childInfo={before:"\n",after:"\n",...tracker.current()},result=state.handle(child,parent,state,childInfo),serializedChild="mdxJsxFlowElement"===child.type?result:state.indentLines(result,function(line,_2,blank){return(blank?"":currentIndent)+line});results.push(tracker.move(serializedChild)),"list"!==child.type&&(state.bulletLastUsed=void 0),index2<children.length-1&&results.push(tracker.move("\n\n"))}return indexStack.pop(),results.join("")}(node2,state,tracker.current())),value+=tracker.move("\n"))),selfClosing||(value+=tracker.move((flow2?currentIndent:"")+"</"+(node2.name||"")+">")),exit2(),value}}function inferDepth(state){let depth=0,index2=state.stack.length;for(;--index2>-1;){const name=state.stack[index2];if("blockquote"===name||"listItem"===name)break;"mdxJsxFlowElement"===name&&depth++}return depth}function createIndent(depth){return" ".repeat(depth)}function peekElement(){return"<"}var has=Object.prototype.hasOwnProperty;function find(iter,tar,key){for(key of iter.keys())if(dequal(key,tar))return key}function dequal(foo,bar){var ctor,len,tmp;if(foo===bar)return!0;if(foo&&bar&&(ctor=foo.constructor)===bar.constructor){if(ctor===Date)return foo.getTime()===bar.getTime();if(ctor===RegExp)return foo.toString()===bar.toString();if(ctor===Array){if((len=foo.length)===bar.length)for(;len--&&dequal(foo[len],bar[len]););return-1===len}if(ctor===Set){if(foo.size!==bar.size)return!1;for(len of foo){if((tmp=len)&&"object"==typeof tmp&&!(tmp=find(bar,tmp)))return!1;if(!bar.has(tmp))return!1}return!0}if(ctor===Map){if(foo.size!==bar.size)return!1;for(len of foo){if((tmp=len[0])&&"object"==typeof tmp&&!(tmp=find(bar,tmp)))return!1;if(!dequal(len[1],bar.get(tmp)))return!1}return!0}if(ctor===ArrayBuffer)foo=new Uint8Array(foo),bar=new Uint8Array(bar);else if(ctor===DataView){if((len=foo.byteLength)===bar.byteLength)for(;len--&&foo.getInt8(len)===bar.getInt8(len););return-1===len}if(ArrayBuffer.isView(foo)){if((len=foo.byteLength)===bar.byteLength)for(;len--&&foo[len]===bar[len];);return-1===len}if(!ctor||"object"==typeof foo){for(ctor in len=0,foo){if(has.call(foo,ctor)&&++len&&!has.call(bar,ctor))return!1;if(!(ctor in bar)||!dequal(foo[ctor],bar[ctor]))return!1}return Object.keys(bar).length===len}}return foo!=foo&&bar!=bar}let FORCE_COLOR,NODE_DISABLE_COLORS,NO_COLOR,TERM,isTTY=!0;"undefined"!=typeof process&&(({FORCE_COLOR:FORCE_COLOR,NODE_DISABLE_COLORS:NODE_DISABLE_COLORS,NO_COLOR:NO_COLOR,TERM:TERM}={}||{}),isTTY=process.stdout&&process.stdout.isTTY);const $$2={enabled:!NODE_DISABLE_COLORS&&null==NO_COLOR&&"dumb"!==TERM&&(null!=FORCE_COLOR&&"0"!==FORCE_COLOR||isTTY),reset:init(0,0),bold:init(1,22),dim:init(2,22),italic:init(3,23),underline:init(4,24),inverse:init(7,27),hidden:init(8,28),strikethrough:init(9,29),black:init(30,39),red:init(31,39),green:init(32,39),yellow:init(33,39),blue:init(34,39),magenta:init(35,39),cyan:init(36,39),white:init(37,39),gray:init(90,39),grey:init(90,39),bgBlack:init(40,49),bgRed:init(41,49),bgGreen:init(42,49),bgYellow:init(43,49),bgBlue:init(44,49),bgMagenta:init(45,49),bgCyan:init(46,49),bgWhite:init(47,49)};function run(arr,str){let tmp,i2=0,beg="",end="";for(;i2<arr.length;i2++)tmp=arr[i2],beg+=tmp.open,end+=tmp.close,~str.indexOf(tmp.close)&&(str=str.replace(tmp.rgx,tmp.close+tmp.open));return beg+str+end}function init(open,close){let blk={open:`[${open}m`,close:`[${close}m`,rgx:new RegExp(`\\x1b\\[${close}m`,"g")};return function(txt){return void 0!==this&&void 0!==this.has?(~this.has.indexOf(open)||(this.has.push(open),this.keys.push(blk)),void 0===txt?this:$$2.enabled?run(this.keys,txt+""):txt+""):void 0===txt?function(has2,keys){let ctx={has:has2,keys:keys};return ctx.reset=$$2.reset.bind(ctx),ctx.bold=$$2.bold.bind(ctx),ctx.dim=$$2.dim.bind(ctx),ctx.italic=$$2.italic.bind(ctx),ctx.underline=$$2.underline.bind(ctx),ctx.inverse=$$2.inverse.bind(ctx),ctx.hidden=$$2.hidden.bind(ctx),ctx.strikethrough=$$2.strikethrough.bind(ctx),ctx.black=$$2.black.bind(ctx),ctx.red=$$2.red.bind(ctx),ctx.green=$$2.green.bind(ctx),ctx.yellow=$$2.yellow.bind(ctx),ctx.blue=$$2.blue.bind(ctx),ctx.magenta=$$2.magenta.bind(ctx),ctx.cyan=$$2.cyan.bind(ctx),ctx.white=$$2.white.bind(ctx),ctx.gray=$$2.gray.bind(ctx),ctx.grey=$$2.grey.bind(ctx),ctx.bgBlack=$$2.bgBlack.bind(ctx),ctx.bgRed=$$2.bgRed.bind(ctx),ctx.bgGreen=$$2.bgGreen.bind(ctx),ctx.bgYellow=$$2.bgYellow.bind(ctx),ctx.bgBlue=$$2.bgBlue.bind(ctx),ctx.bgMagenta=$$2.bgMagenta.bind(ctx),ctx.bgCyan=$$2.bgCyan.bind(ctx),ctx.bgWhite=$$2.bgWhite.bind(ctx),ctx}([open],[blk]):$$2.enabled?run([blk],txt+""):txt+""}}function Diff(){}function buildValues(diff3,lastComponent,newString,oldString,useLongestToken){for(var nextComponent,components=[];lastComponent;)components.push(lastComponent),nextComponent=lastComponent.previousComponent,delete lastComponent.previousComponent,lastComponent=nextComponent;components.reverse();for(var componentPos=0,componentLen=components.length,newPos=0,oldPos=0;componentPos<componentLen;componentPos++){var component=components[componentPos];if(component.removed){if(component.value=diff3.join(oldString.slice(oldPos,oldPos+component.count)),oldPos+=component.count,componentPos&&components[componentPos-1].added){var tmp=components[componentPos-1];components[componentPos-1]=components[componentPos],components[componentPos]=tmp}}else{if(!component.added&&useLongestToken){var value=newString.slice(newPos,newPos+component.count);value=value.map(function(value2,i2){var oldValue=oldString[oldPos+i2];return oldValue.length>value2.length?oldValue:value2}),component.value=diff3.join(value)}else component.value=diff3.join(newString.slice(newPos,newPos+component.count));newPos+=component.count,component.added||(oldPos+=component.count)}}var finalComponent=components[componentLen-1];return componentLen>1&&"string"==typeof finalComponent.value&&(finalComponent.added||finalComponent.removed)&&diff3.equals("",finalComponent.value)&&(components[componentLen-2].value+=finalComponent.value,components.pop()),components}Diff.prototype={diff:function(oldString,newString){var _options$timeout,options=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},callback=options.callback;"function"==typeof options&&(callback=options,options={}),this.options=options;var self2=this;function done(value){return callback?(setTimeout(function(){callback(void 0,value)},0),!0):value}oldString=this.castInput(oldString),newString=this.castInput(newString),oldString=this.removeEmpty(this.tokenize(oldString));var newLen=(newString=this.removeEmpty(this.tokenize(newString))).length,oldLen=oldString.length,editLength=1,maxEditLength=newLen+oldLen;options.maxEditLength&&(maxEditLength=Math.min(maxEditLength,options.maxEditLength));var maxExecutionTime=null!==(_options$timeout=options.timeout)&&void 0!==_options$timeout?_options$timeout:1/0,abortAfterTimestamp=Date.now()+maxExecutionTime,bestPath=[{oldPos:-1,lastComponent:void 0}],newPos=this.extractCommon(bestPath[0],newString,oldString,0);if(bestPath[0].oldPos+1>=oldLen&&newPos+1>=newLen)return done([{value:this.join(newString),count:newString.length}]);var minDiagonalToConsider=-1/0,maxDiagonalToConsider=1/0;function execEditLength(){for(var diagonalPath=Math.max(minDiagonalToConsider,-editLength);diagonalPath<=Math.min(maxDiagonalToConsider,editLength);diagonalPath+=2){var basePath=void 0,removePath=bestPath[diagonalPath-1],addPath=bestPath[diagonalPath+1];removePath&&(bestPath[diagonalPath-1]=void 0);var canAdd=!1;if(addPath){var addPathNewPos=addPath.oldPos-diagonalPath;canAdd=addPath&&0<=addPathNewPos&&addPathNewPos<newLen}var canRemove=removePath&&removePath.oldPos+1<oldLen;if(canAdd||canRemove){if(basePath=!canRemove||canAdd&&removePath.oldPos+1<addPath.oldPos?self2.addToPath(addPath,!0,void 0,0):self2.addToPath(removePath,void 0,!0,1),newPos=self2.extractCommon(basePath,newString,oldString,diagonalPath),basePath.oldPos+1>=oldLen&&newPos+1>=newLen)return done(buildValues(self2,basePath.lastComponent,newString,oldString,self2.useLongestToken));bestPath[diagonalPath]=basePath,basePath.oldPos+1>=oldLen&&(maxDiagonalToConsider=Math.min(maxDiagonalToConsider,diagonalPath-1)),newPos+1>=newLen&&(minDiagonalToConsider=Math.max(minDiagonalToConsider,diagonalPath+1))}else bestPath[diagonalPath]=void 0}editLength++}if(callback)!function exec(){setTimeout(function(){if(editLength>maxEditLength||Date.now()>abortAfterTimestamp)return callback();execEditLength()||exec()},0)}();else for(;editLength<=maxEditLength&&Date.now()<=abortAfterTimestamp;){var ret=execEditLength();if(ret)return ret}},addToPath:function(path,added,removed,oldPosInc){var last=path.lastComponent;return last&&last.added===added&&last.removed===removed?{oldPos:path.oldPos+oldPosInc,lastComponent:{count:last.count+1,added:added,removed:removed,previousComponent:last.previousComponent}}:{oldPos:path.oldPos+oldPosInc,lastComponent:{count:1,added:added,removed:removed,previousComponent:last}}},extractCommon:function(basePath,newString,oldString,diagonalPath){for(var newLen=newString.length,oldLen=oldString.length,oldPos=basePath.oldPos,newPos=oldPos-diagonalPath,commonCount=0;newPos+1<newLen&&oldPos+1<oldLen&&this.equals(newString[newPos+1],oldString[oldPos+1]);)newPos++,oldPos++,commonCount++;return commonCount&&(basePath.lastComponent={count:commonCount,previousComponent:basePath.lastComponent}),basePath.oldPos=oldPos,newPos},equals:function(left,right){return this.options.comparator?this.options.comparator(left,right):left===right||this.options.ignoreCase&&left.toLowerCase()===right.toLowerCase()},removeEmpty:function(array){for(var ret=[],i2=0;i2<array.length;i2++)array[i2]&&ret.push(array[i2]);return ret},castInput:function(value){return value},tokenize:function(value){return value.split("")},join:function(chars){return chars.join("")}};var extendedWordChars=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,reWhitespace=/\S/,wordDiff=new Diff;wordDiff.equals=function(left,right){return this.options.ignoreCase&&(left=left.toLowerCase(),right=right.toLowerCase()),left===right||this.options.ignoreWhitespace&&!reWhitespace.test(left)&&!reWhitespace.test(right)},wordDiff.tokenize=function(value){for(var tokens=value.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),i2=0;i2<tokens.length-1;i2++)!tokens[i2+1]&&tokens[i2+2]&&extendedWordChars.test(tokens[i2])&&extendedWordChars.test(tokens[i2+2])&&(tokens[i2]+=tokens[i2+2],tokens.splice(i2+1,2),i2--);return tokens};var lineDiff=new Diff;function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj2){return typeof obj2}:function(obj2){return obj2&&"function"==typeof Symbol&&obj2.constructor===Symbol&&obj2!==Symbol.prototype?"symbol":typeof obj2})(obj)}lineDiff.tokenize=function(value){this.options.stripTrailingCr&&(value=value.replace(/\r\n/g,"\n"));var retLines=[],linesAndNewlines=value.split(/(\n|\r\n)/);linesAndNewlines[linesAndNewlines.length-1]||linesAndNewlines.pop();for(var i2=0;i2<linesAndNewlines.length;i2++){var line=linesAndNewlines[i2];i2%2&&!this.options.newlineIsToken?retLines[retLines.length-1]+=line:(this.options.ignoreWhitespace&&(line=line.trim()),retLines.push(line))}return retLines},(new Diff).tokenize=function(value){return value.split(/(\S.+?[.!?])(?=\s+|$)/)},(new Diff).tokenize=function(value){return value.split(/([{}:;,]|\s+)/)};var objectPrototypeToString=Object.prototype.toString,jsonDiff=new Diff;function canonicalize(obj,stack,replacementStack,replacer,key){var i2,canonicalizedObj;for(stack=stack||[],replacementStack=replacementStack||[],replacer&&(obj=replacer(key,obj)),i2=0;i2<stack.length;i2+=1)if(stack[i2]===obj)return replacementStack[i2];if("[object Array]"===objectPrototypeToString.call(obj)){for(stack.push(obj),canonicalizedObj=new Array(obj.length),replacementStack.push(canonicalizedObj),i2=0;i2<obj.length;i2+=1)canonicalizedObj[i2]=canonicalize(obj[i2],stack,replacementStack,replacer,key);return stack.pop(),replacementStack.pop(),canonicalizedObj}if(obj&&obj.toJSON&&(obj=obj.toJSON()),"object"===_typeof(obj)&&null!==obj){stack.push(obj),canonicalizedObj={},replacementStack.push(canonicalizedObj);var _key,sortedKeys=[];for(_key in obj)obj.hasOwnProperty(_key)&&sortedKeys.push(_key);for(sortedKeys.sort(),i2=0;i2<sortedKeys.length;i2+=1)canonicalizedObj[_key=sortedKeys[i2]]=canonicalize(obj[_key],stack,replacementStack,replacer,_key);stack.pop(),replacementStack.pop()}else canonicalizedObj=obj;return canonicalizedObj}jsonDiff.useLongestToken=!0,jsonDiff.tokenize=lineDiff.tokenize,jsonDiff.castInput=function(value){var _this$options=this.options,undefinedReplacement=_this$options.undefinedReplacement,_this$options$stringi=_this$options.stringifyReplacer,stringifyReplacer=void 0===_this$options$stringi?function(k3,v2){return void 0===v2?undefinedReplacement:v2}:_this$options$stringi;return"string"==typeof value?value:JSON.stringify(canonicalize(value,null,null,stringifyReplacer),stringifyReplacer," ")},jsonDiff.equals=function(left,right){return Diff.prototype.equals.call(jsonDiff,left.replace(/,([\r\n])/g,"$1"),right.replace(/,([\r\n])/g,"$1"))};var arrayDiff=new Diff;function dedent(str){let arr=(str=str.replace(/\r?\n/g,"\n")).match(/^[ \t]*(?=\S)/gm),i2=0,min2=1/0,len=(arr||[]).length;for(;i2<len;i2++)min2=Math.min(min2,arr[i2].length);return len&&min2?str.replace(new RegExp(`^[ \\t]{${min2}}`,"gm"),""):str}arrayDiff.tokenize=function(value){return value.slice()},arrayDiff.join=arrayDiff.removeEmpty=function(value){return value},$$2.red,$$2.grey,$$2.green,$$2.dim().italic,$$2.dim("→"),$$2.dim("·"),$$2.dim("↵");class Assertion extends Error{constructor(opts={}){super(opts.message),this.name="Assertion",this.code="ERR_ASSERTION",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.details=opts.details||!1,this.generated=!!opts.generated,this.operator=opts.operator,this.expects=opts.expects,this.actual=opts.actual}}function assert(bool,actual,expects,operator,detailer,backup,msg){if(bool)return;if(msg instanceof Error)throw msg;throw new Assertion({actual:actual,expects:expects,operator:operator,message:msg||backup,details:detailer,generated:!msg})}function not(val,msg){assert(!val,!0,!1,"not",!1,"Expected value to be falsey",msg)}not.ok=not,not.equal=function(val,exp,msg){assert(!dequal(val,exp),val,exp,"not.equal",!1,"Expected values not to be deeply equal",msg)},not.type=function(val,exp,msg){let tmp=typeof val;assert(tmp!==exp,tmp,exp,"not.type",!1,`Expected "${tmp}" not to be "${exp}"`,msg)},not.instance=function(val,exp,msg){assert(!(val instanceof exp),val,exp,"not.instance",!1,`Expected value not to be an instance of ${"`"+(exp.name||exp.constructor.name)+"`"}`,msg)},not.snapshot=function(val,exp,msg){assert((val=dedent(val))!==(exp=dedent(exp)),val,exp,"not.snapshot",!1,"Expected value not to match snapshot",msg)},not.fixture=function(val,exp,msg){assert((val=dedent(val))!==(exp=dedent(exp)),val,exp,"not.fixture",!1,"Expected value not to match fixture",msg)},not.match=function(val,exp,msg){"string"==typeof exp?assert(!val.includes(exp),val,exp,"not.match",!1,`Expected value not to include "${exp}" substring`,msg):assert(!exp.test(val),val,exp,"not.match",!1,`Expected value not to match \`${String(exp)}\` pattern`,msg)},not.throws=function(blk,exp,msg){msg||"string"!=typeof exp||(msg=exp,exp=null);try{blk()}catch(err){"function"==typeof exp?assert(!exp(err),!0,!1,"not.throws",!1,"Expected function not to throw matching exception",msg):exp instanceof RegExp?assert(!exp.test(err.message),!0,!1,"not.throws",!1,`Expected function not to throw exception matching \`${String(exp)}\` pattern`,msg):exp||assert(!1,!0,!1,"not.throws",!1,"Expected function not to throw",msg)}};const codes_eof=null,codes_exclamationMark=33,codes_dash=45,codes_equalsTo=61,codes_greaterThan=62,constants_attentionSideAfter=2,types_data="data",types_lineEnding="lineEnding",types_linePrefix="linePrefix",types_characterEscape="characterEscape";function highlightMark(){const tokenizer={name:"highlight",tokenize:function(effects,ok2,nok){const previous2=this.previous,events=this.events;let size2=0;return function(code2){if(function(val,msg){assert(!!val,!1,!0,"ok",!1,"Expected value to be truthy",msg)}(code2===codes_equalsTo,"expected `=`"),previous2===codes_equalsTo&&events[events.length-1][1].type!==types_characterEscape)return nok(code2);return effects.enter("highlightSequenceTemporary"),more(code2)};function more(code2){const before=classifyCharacter(previous2);if(code2===codes_equalsTo)return size2>1?nok(code2):(effects.consume(code2),size2++,more);if(size2<2)return nok(code2);const token=effects.exit("highlightSequenceTemporary"),after=classifyCharacter(code2);return token._open=!after||after===constants_attentionSideAfter&&Boolean(before),token._close=!before||before===constants_attentionSideAfter&&Boolean(after),ok2(code2)}},resolveAll:function(events,context){let index2=-1;for(;++index2<events.length;)if("enter"===events[index2][0]&&"highlightSequenceTemporary"===events[index2][1].type&&events[index2][1]._close){let open=index2;for(;open--;)if("exit"===events[open][0]&&"highlightSequenceTemporary"===events[open][1].type&&events[open][1]._open&&events[index2][1].end.offset-events[index2][1].start.offset===events[open][1].end.offset-events[open][1].start.offset){events[index2][1].type="highlightSequence",events[open][1].type="highlightSequence";const highlight={type:"highlight",start:Object.assign({},events[open][1].start),end:Object.assign({},events[index2][1].end)},text2={type:"highlightText",start:Object.assign({},events[open][1].end),end:Object.assign({},events[index2][1].start)},nextEvents=[["enter",highlight,context],["enter",events[open][1],context],["exit",events[open][1],context],["enter",text2,context]],insideSpan2=context.parser.constructs.insideSpan.null;insideSpan2&&splice(nextEvents,nextEvents.length,0,resolveAll(insideSpan2,events.slice(open+1,index2),context)),splice(nextEvents,nextEvents.length,0,[["exit",text2,context],["enter",events[index2][1],context],["exit",events[index2][1],context],["exit",highlight,context]]),splice(events,open-1,index2-open+3,nextEvents),index2=open+nextEvents.length-2;break}}index2=-1;for(;++index2<events.length;)"highlightSequenceTemporary"===events[index2][1].type&&(events[index2][1].type=types_data);return events}};return{text:{[codes_equalsTo]:tokenizer},insideSpan:{null:[tokenizer]},attentionMarkers:{null:[codes_equalsTo]}}}const startRe=/[$_\p{ID_Start}]/u,contRe=/[$_\u{200C}\u{200D}\p{ID_Continue}]/u,contReJsx=/[-$_\u{200C}\u{200D}\p{ID_Continue}]/u,emptyOptions$1={};function start(code2){return!!code2&&startRe.test(String.fromCodePoint(code2))}function cont(code2,options){const re2=(options||emptyOptions$1).jsx?contReJsx:contRe;return!!code2&&re2.test(String.fromCodePoint(code2))}function factorySpace(effects,ok2,type,max2){const limit=max2?max2-1:Number.POSITIVE_INFINITY;let size2=0;return function(code2){if(markdownSpace(code2))return effects.enter(type),prefix(code2);return ok2(code2)};function prefix(code2){return markdownSpace(code2)&&size2++<limit?(effects.consume(code2),prefix):(effects.exit(type),ok2(code2))}}const own$3={}.hasOwnProperty,CONTINUE$1=Symbol("continue"),EXIT$1=Symbol("exit"),SKIP$1=Symbol("skip");function toResult$1(value){return Array.isArray(value)?value:"number"==typeof value?[CONTINUE$1,value]:[value]}function nodelike(value){return Boolean(value&&"object"==typeof value&&"type"in value&&"string"==typeof value.type&&value.type.length>0)}function eventsToAcorn(events,options){const prefix=options.prefix||"",suffix=options.suffix||"",acornOptions=Object.assign({},options.acornOptions),comments=[],tokens=[],onComment=acornOptions.onComment,onToken=acornOptions.onToken;let estree,exception,swallow=!1;const acornConfig=Object.assign({},acornOptions,{onComment:comments,preserveParens:!0});onToken&&(acornConfig.onToken=tokens);const collection=function(events,tokenTypes){const result={value:"",stops:[]};let index2=-1;for(;++index2<events.length;){const event=events[index2];if("enter"===event[0]){const type=event[1].type;if("lineEnding"===type||tokenTypes.includes(type)){const chunks=event[2].sliceStream(event[1]);for(;chunks.length>0&&-1===chunks[0];)chunks.shift();const value=serializeChunks$1(chunks);result.stops.push([result.value.length,event[1].start]),result.value+=value,result.stops.push([result.value.length,event[1].end])}}}return result}(events,options.tokenTypes),source=collection.value,value=prefix+source+suffix,isEmptyExpression=empty$1(source);if(isEmptyExpression&&!options.allowEmpty)throw new VFileMessage("Unexpected empty expression",{place:parseOffsetToUnistPoint(0),ruleId:"unexpected-empty-expression",source:"micromark-extension-mdx-expression"});try{estree=options.expression&&!isEmptyExpression?options.acorn.parseExpressionAt(value,0,acornConfig):options.acorn.parse(value,acornConfig)}catch(error_){const error=error_,point2=parseOffsetToUnistPoint(error.pos);error.message=String(error.message).replace(/ \(\d+:\d+\)$/,""),error.pos=point2.offset,error.loc={line:point2.line,column:point2.column-1},exception=error,swallow=error.raisedAt>=prefix.length+source.length||"Unterminated comment"===error.message}if(estree&&options.expression&&!isEmptyExpression)if(empty$1(value.slice(estree.end,value.length-suffix.length)))estree={type:"Program",start:0,end:prefix.length+source.length,body:[{type:"ExpressionStatement",expression:estree,start:0,end:prefix.length+source.length}],sourceType:"module",comments:[]};else{const point2=parseOffsetToUnistPoint(estree.end),error=new Error("Unexpected content after expression");error.pos=point2.offset,error.loc={line:point2.line,column:point2.column-1},exception=error,estree=void 0}if(estree){if(estree.comments=comments,function(tree,visitor){let enter,leave;"function"==typeof visitor?enter=visitor:visitor&&"object"==typeof visitor&&(visitor.enter&&(enter=visitor.enter),visitor.leave&&(leave=visitor.leave)),function build(node2,key,index2,parents){return nodelike(node2)&&(visit2.displayName="node ("+node2.type+")"),visit2;function visit2(){const result=enter?toResult$1(enter(node2,key,index2,parents)):[];if(result[0]===EXIT$1)return result;if(result[0]!==SKIP$1){let cKey;for(cKey in node2)if(own$3.call(node2,cKey)&&node2[cKey]&&"object"==typeof node2[cKey]&&"data"!==cKey&&"position"!==cKey){const grandparents=parents.concat(node2),value=node2[cKey];if(Array.isArray(value)){const nodes=value;let cIndex=0;for(;cIndex>-1&&cIndex<nodes.length;){const subvalue=nodes[cIndex];if(nodelike(subvalue)){const subresult=build(subvalue,cKey,cIndex,grandparents)();if(subresult[0]===EXIT$1)return subresult;cIndex="number"==typeof subresult[1]?subresult[1]:cIndex+1}else cIndex++}}else if(nodelike(value)){const subresult=build(value,cKey,void 0,grandparents)();if(subresult[0]===EXIT$1)return subresult}}}return leave?toResult$1(leave(node2,key,index2,parents)):result}}(tree,void 0,void 0,[])()}(estree,function(esnode,field,index2,parents){let context=parents[parents.length-1],property=field;"ParenthesizedExpression"===esnode.type&&context&&property&&("number"==typeof index2&&(context=context[property],property=index2),context[property]=esnode.expression),fixPosition(esnode)}),Array.isArray(onComment))onComment.push(...comments);else if("function"==typeof onComment)for(const comment2 of comments)onComment("Block"===comment2.type,comment2.value,comment2.start,comment2.end,comment2.loc.start,comment2.loc.end);for(const token of tokens)token.end<=prefix.length||token.start-prefix.length>=source.length||(fixPosition(token),Array.isArray(onToken)?onToken.push(token):onToken(token))}return{estree:estree,error:exception,swallow:swallow};function fixPosition(nodeOrToken){const pointStart=parseOffsetToUnistPoint(nodeOrToken.start),pointEnd=parseOffsetToUnistPoint(nodeOrToken.end);nodeOrToken.start=pointStart.offset,nodeOrToken.end=pointEnd.offset,nodeOrToken.loc={start:{line:pointStart.line,column:pointStart.column-1,offset:pointStart.offset},end:{line:pointEnd.line,column:pointEnd.column-1,offset:pointEnd.offset}},nodeOrToken.range=[nodeOrToken.start,nodeOrToken.end]}function parseOffsetToUnistPoint(acornOffset){let sourceOffset=acornOffset-prefix.length;sourceOffset<0?sourceOffset=0:sourceOffset>source.length&&(sourceOffset=source.length);let point2=function(stops,relative){let index2=0;for(;index2<stops.length&&stops[index2][0]<=relative;)index2+=1;if(0===index2)return;const[stopRelative,stopAbsolute]=stops[index2-1],rest=relative-stopRelative;return{line:stopAbsolute.line,column:stopAbsolute.column+rest,offset:stopAbsolute.offset+rest}}(collection.stops,sourceOffset);return point2||(point2={line:options.start.line,column:options.start.column,offset:options.start.offset}),point2}}function empty$1(value){return/^\s*$/.test(value.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\/\/[^\r\n]*(\r\n|\n|\r)/g,""))}function serializeChunks$1(chunks){let index2=-1;const result=[];let atTab;for(;++index2<chunks.length;){const chunk=chunks[index2];let value;if("string"==typeof chunk)value=chunk;else switch(chunk){case-5:value="\r";break;case-4:value="\n";break;case-3:value="\r\n";break;case-2:value="\t";break;case-1:if(atTab)continue;value=" ";break;default:value=String.fromCharCode(chunk)}atTab=-2===chunk,result.push(value)}return result.join("")}function positionFromEstree(node2){const nodeLike=node2||{},loc=nodeLike.loc||{},range=nodeLike.range||[void 0,void 0],start2=pointOrUndefined(loc.start,range[0]||nodeLike.start),end=pointOrUndefined(loc.end,range[1]||nodeLike.end);if(start2&&end)return{start:start2,end:end}}function pointOrUndefined(estreePoint,estreeOffset){if(estreePoint&&"object"==typeof estreePoint){const line="line"in estreePoint?numberOrUndefined(estreePoint.line):void 0,column="column"in estreePoint?numberOrUndefined(estreePoint.column):void 0;if(line&&void 0!==column)return{line:line,column:column+1,offset:numberOrUndefined(estreeOffset)}}}function numberOrUndefined(value){return"number"==typeof value&&value>-1?value:void 0}const trouble$1="https://github.com/micromark/micromark-extension-mdx-expression/tree/main/packages/micromark-extension-mdx-expression",nonSpreadHash="#unexpected-type-in-code-expected-an-object-spread-spread";function factoryMdxExpression(effects,ok2,type,markerType,chunkType,acorn,acornOptions,addResult,spread,allowEmpty,allowLazy){const self2=this,eventStart=this.events.length+3;let pointStart,lastCrash,size2=0;return function(code2){return effects.enter(type),effects.enter(markerType),effects.consume(code2),effects.exit(markerType),pointStart=self2.now(),before};function before(code2){if(null===code2){if(lastCrash)throw lastCrash;const error=new VFileMessage("Unexpected end of file in expression, expected a corresponding closing brace for `{`",{place:self2.now(),ruleId:"unexpected-eof",source:"micromark-extension-mdx-expression"});throw error.url=trouble$1+"#unexpected-end-of-file-in-expression-expected-a-corresponding-closing-brace-for-",error}if(markdownLineEnding(code2))return effects.enter("lineEnding"),effects.consume(code2),effects.exit("lineEnding"),eolAfter;if(125===code2&&0===size2){const next=acorn?mdxExpressionParse.call(self2,acorn,acornOptions,chunkType,eventStart,pointStart,allowEmpty||!1,spread||!1):{type:"ok",estree:void 0};if("ok"===next.type){effects.enter(markerType),effects.consume(code2),effects.exit(markerType);const token=effects.exit(type);return addResult&&next.estree&&Object.assign(token,{estree:next.estree}),ok2}return lastCrash=next.message,effects.enter(chunkType),effects.consume(code2),inside}return effects.enter(chunkType),inside(code2)}function inside(code2){return 125===code2&&0===size2||null===code2||markdownLineEnding(code2)?(effects.exit(chunkType),before(code2)):(123!==code2||acorn?125===code2&&(size2-=1):size2+=1,effects.consume(code2),inside)}function eolAfter(code2){const now=self2.now();if(now.line!==pointStart.line&&!allowLazy&&self2.parser.lazy[now.line]){const error=new VFileMessage("Unexpected lazy line in expression in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",{place:self2.now(),ruleId:"unexpected-lazy",source:"micromark-extension-mdx-expression"});throw error.url=trouble$1+"#unexpected-lazy-line-in-expression-in-container-expected-line-to-be-prefixed",error}return markdownSpace(code2)?factorySpace(effects,before,"linePrefix",3)(code2):before(code2)}}function mdxExpressionParse(acorn,acornOptions,chunkType,eventStart,pointStart,allowEmpty,spread){const result=eventsToAcorn(this.events.slice(eventStart),{acorn:acorn,tokenTypes:[chunkType],acornOptions:acornOptions,start:pointStart,expression:!0,allowEmpty:allowEmpty,prefix:spread?"({":"",suffix:spread?"})":""}),estree=result.estree;if(spread&&estree){const head=estree.body[0];if("ExpressionStatement"!==head.type||"ObjectExpression"!==head.expression.type){const place=positionFromEstree(head),error=new VFileMessage("Unexpected `"+head.type+"` in code: expected an object spread (`{...spread}`)",{place:place.start,ruleId:"non-spread",source:"micromark-extension-mdx-expression"});throw error.url=trouble$1+nonSpreadHash,error}if(head.expression.properties[1]){const place=positionFromEstree(head.expression.properties[1]),error=new VFileMessage("Unexpected extra content in spread: only a single spread is supported",{place:place.start,ruleId:"spread-extra",source:"micromark-extension-mdx-expression"});throw error.url=trouble$1+"#unexpected-extra-content-in-spread-only-a-single-spread-is-supported",error}if(head.expression.properties[0]&&"SpreadElement"!==head.expression.properties[0].type){const place=positionFromEstree(head.expression.properties[0]),error=new VFileMessage("Unexpected `"+head.expression.properties[0].type+"` in code: only spread elements are supported",{place:place.start,ruleId:"non-spread",source:"micromark-extension-mdx-expression"});throw error.url=trouble$1+nonSpreadHash,error}}if(result.error){const error=new VFileMessage("Could not parse expression with acorn",{cause:result.error,place:{line:result.error.loc.line,column:result.error.loc.column+1,offset:result.error.pos},ruleId:"acorn",source:"micromark-extension-mdx-expression"});return error.url=trouble$1+"#could-not-parse-expression-with-acorn",{type:"nok",message:error}}return{type:"ok",estree:estree}}const trouble="https://github.com/micromark/micromark-extension-mdx-jsx";function factoryTag(effects,ok2,nok,acorn,acornOptions,addResult,allowLazy,tagType,tagMarkerType,tagClosingMarkerType,tagSelfClosingMarker,tagNameType,tagNamePrimaryType,tagNameMemberMarkerType,tagNameMemberType,tagNamePrefixMarkerType,tagNameLocalType,tagExpressionAttributeType,tagExpressionAttributeMarkerType,tagExpressionAttributeValueType,tagAttributeType,tagAttributeNameType,tagAttributeNamePrimaryType,tagAttributeNamePrefixMarkerType,tagAttributeNameLocalType,tagAttributeInitializerMarkerType,tagAttributeValueLiteralType,tagAttributeValueLiteralMarkerType,tagAttributeValueLiteralValueType,tagAttributeValueExpressionType,tagAttributeValueExpressionMarkerType,tagAttributeValueExpressionValueType){const self2=this;let returnState,marker;return function(code2){return effects.enter(tagType),effects.enter(tagMarkerType),effects.consume(code2),effects.exit(tagMarkerType),startAfter};function startAfter(code2){return markdownLineEndingOrSpace(code2)?nok(code2):(returnState=nameBefore,esWhitespaceStart(code2))}function nameBefore(code2){return 47===code2?(effects.enter(tagClosingMarkerType),effects.consume(code2),effects.exit(tagClosingMarkerType),returnState=closingTagNameBefore,esWhitespaceStart):62===code2?tagEnd(code2):null!==code2&&code2>=0&&start(code2)?(effects.enter(tagNameType),effects.enter(tagNamePrimaryType),effects.consume(code2),primaryName):void crash(code2,"before name","a character that can start a name, such as a letter, `$`, or `_`"+(33===code2?" (note: to create a comment in MDX, use `{/* text */}`)":""))}function closingTagNameBefore(code2){return 62===code2?tagEnd(code2):null!==code2&&code2>=0&&start(code2)?(effects.enter(tagNameType),effects.enter(tagNamePrimaryType),effects.consume(code2),primaryName):void crash(code2,"before name","a character that can start a name, such as a letter, `$`, or `_`"+(42===code2||47===code2?" (note: JS comments in JSX tags are not supported in MDX)":""))}function primaryName(code2){return null!==code2&&code2>=0&&cont(code2,{jsx:!0})?(effects.consume(code2),primaryName):46===code2||47===code2||58===code2||62===code2||123===code2||markdownLineEndingOrSpace(code2)||unicodeWhitespace(code2)?(effects.exit(tagNamePrimaryType),returnState=primaryNameAfter,esWhitespaceStart(code2)):void crash(code2,"in name","a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(64===code2?" (note: to create a link in MDX, use `[text](url)`)":""))}function primaryNameAfter(code2){return 46===code2?(effects.enter(tagNameMemberMarkerType),effects.consume(code2),effects.exit(tagNameMemberMarkerType),returnState=memberNameBefore,esWhitespaceStart):58===code2?(effects.enter(tagNamePrefixMarkerType),effects.consume(code2),effects.exit(tagNamePrefixMarkerType),returnState=localNameBefore,esWhitespaceStart):47===code2||62===code2||123===code2||null!==code2&&code2>=0&&start(code2)?(effects.exit(tagNameType),attributeBefore(code2)):void crash(code2,"after name","a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function memberNameBefore(code2){if(null!==code2&&code2>=0&&start(code2))return effects.enter(tagNameMemberType),effects.consume(code2),memberName;crash(code2,"before member name","a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function memberName(code2){return null!==code2&&code2>=0&&cont(code2,{jsx:!0})?(effects.consume(code2),memberName):46===code2||47===code2||62===code2||123===code2||markdownLineEndingOrSpace(code2)||unicodeWhitespace(code2)?(effects.exit(tagNameMemberType),returnState=memberNameAfter,esWhitespaceStart(code2)):void crash(code2,"in member name","a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(64===code2?" (note: to create a link in MDX, use `[text](url)`)":""))}function memberNameAfter(code2){return 46===code2?(effects.enter(tagNameMemberMarkerType),effects.consume(code2),effects.exit(tagNameMemberMarkerType),returnState=memberNameBefore,esWhitespaceStart):47===code2||62===code2||123===code2||null!==code2&&code2>=0&&start(code2)?(effects.exit(tagNameType),attributeBefore(code2)):void crash(code2,"after member name","a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function localNameBefore(code2){if(null!==code2&&code2>=0&&start(code2))return effects.enter(tagNameLocalType),effects.consume(code2),localName;crash(code2,"before local name","a character that can start a name, such as a letter, `$`, or `_`"+(43===code2||null!==code2&&code2>46&&code2<58?" (note: to create a link in MDX, use `[text](url)`)":""))}function localName(code2){return null!==code2&&code2>=0&&cont(code2,{jsx:!0})?(effects.consume(code2),localName):47===code2||62===code2||123===code2||markdownLineEndingOrSpace(code2)||unicodeWhitespace(code2)?(effects.exit(tagNameLocalType),returnState=localNameAfter,esWhitespaceStart(code2)):void crash(code2,"in local name","a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag")}function localNameAfter(code2){if(47===code2||62===code2||123===code2||null!==code2&&code2>=0&&start(code2))return effects.exit(tagNameType),attributeBefore(code2);crash(code2,"after local name","a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function attributeBefore(code2){return 47===code2?(effects.enter(tagSelfClosingMarker),effects.consume(code2),effects.exit(tagSelfClosingMarker),returnState=selfClosing,esWhitespaceStart):62===code2?tagEnd(code2):123===code2?factoryMdxExpression.call(self2,effects,attributeExpressionAfter,tagExpressionAttributeType,tagExpressionAttributeMarkerType,tagExpressionAttributeValueType,acorn,acornOptions,addResult,!0,!1,allowLazy)(code2):null!==code2&&code2>=0&&start(code2)?(effects.enter(tagAttributeType),effects.enter(tagAttributeNameType),effects.enter(tagAttributeNamePrimaryType),effects.consume(code2),attributePrimaryName):void crash(code2,"before attribute name","a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function attributeExpressionAfter(code2){return returnState=attributeBefore,esWhitespaceStart(code2)}function attributePrimaryName(code2){return null!==code2&&code2>=0&&cont(code2,{jsx:!0})?(effects.consume(code2),attributePrimaryName):47===code2||58===code2||61===code2||62===code2||123===code2||markdownLineEndingOrSpace(code2)||unicodeWhitespace(code2)?(effects.exit(tagAttributeNamePrimaryType),returnState=attributePrimaryNameAfter,esWhitespaceStart(code2)):void crash(code2,"in attribute name","an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function attributePrimaryNameAfter(code2){return 58===code2?(effects.enter(tagAttributeNamePrefixMarkerType),effects.consume(code2),effects.exit(tagAttributeNamePrefixMarkerType),returnState=attributeLocalNameBefore,esWhitespaceStart):61===code2?(effects.exit(tagAttributeNameType),effects.enter(tagAttributeInitializerMarkerType),effects.consume(code2),effects.exit(tagAttributeInitializerMarkerType),returnState=attributeValueBefore,esWhitespaceStart):47===code2||62===code2||123===code2||markdownLineEndingOrSpace(code2)||unicodeWhitespace(code2)||null!==code2&&code2>=0&&start(code2)?(effects.exit(tagAttributeNameType),effects.exit(tagAttributeType),returnState=attributeBefore,esWhitespaceStart(code2)):void crash(code2,"after attribute name","a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function attributeLocalNameBefore(code2){if(null!==code2&&code2>=0&&start(code2))return effects.enter(tagAttributeNameLocalType),effects.consume(code2),attributeLocalName;crash(code2,"before local attribute name","a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function attributeLocalName(code2){return null!==code2&&code2>=0&&cont(code2,{jsx:!0})?(effects.consume(code2),attributeLocalName):47===code2||61===code2||62===code2||123===code2||markdownLineEndingOrSpace(code2)||unicodeWhitespace(code2)?(effects.exit(tagAttributeNameLocalType),effects.exit(tagAttributeNameType),returnState=attributeLocalNameAfter,esWhitespaceStart(code2)):void crash(code2,"in local attribute name","an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function attributeLocalNameAfter(code2){return 61===code2?(effects.enter(tagAttributeInitializerMarkerType),effects.consume(code2),effects.exit(tagAttributeInitializerMarkerType),returnState=attributeValueBefore,esWhitespaceStart):47===code2||62===code2||123===code2||null!==code2&&code2>=0&&start(code2)?(effects.exit(tagAttributeType),attributeBefore(code2)):void crash(code2,"after local attribute name","a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function attributeValueBefore(code2){return 34===code2||39===code2?(effects.enter(tagAttributeValueLiteralType),effects.enter(tagAttributeValueLiteralMarkerType),effects.consume(code2),effects.exit(tagAttributeValueLiteralMarkerType),marker=code2,attributeValueQuotedStart):123===code2?factoryMdxExpression.call(self2,effects,attributeValueExpressionAfter,tagAttributeValueExpressionType,tagAttributeValueExpressionMarkerType,tagAttributeValueExpressionValueType,acorn,acornOptions,addResult,!1,!1,allowLazy)(code2):void crash(code2,"before attribute value","a character that can start an attribute value, such as `\"`, `'`, or `{`"+(60===code2?" (note: to use an element or fragment as a prop value in MDX, use `{<element />}`)":""))}function attributeValueExpressionAfter(code2){return effects.exit(tagAttributeType),returnState=attributeBefore,esWhitespaceStart(code2)}function attributeValueQuotedStart(code2){return null===code2&&crash(code2,"in attribute value","a corresponding closing quote `"+String.fromCodePoint(marker)+"`"),code2===marker?(effects.enter(tagAttributeValueLiteralMarkerType),effects.consume(code2),effects.exit(tagAttributeValueLiteralMarkerType),effects.exit(tagAttributeValueLiteralType),effects.exit(tagAttributeType),marker=void 0,returnState=attributeBefore,esWhitespaceStart):markdownLineEnding(code2)?(returnState=attributeValueQuotedStart,esWhitespaceStart(code2)):(effects.enter(tagAttributeValueLiteralValueType),attributeValueQuoted(code2))}function attributeValueQuoted(code2){return null===code2||code2===marker||markdownLineEnding(code2)?(effects.exit(tagAttributeValueLiteralValueType),attributeValueQuotedStart(code2)):(effects.consume(code2),attributeValueQuoted)}function selfClosing(code2){if(62===code2)return tagEnd(code2);crash(code2,"after self-closing slash","`>` to end the tag"+(42===code2||47===code2?" (note: JS comments in JSX tags are not supported in MDX)":""))}function tagEnd(code2){return effects.enter(tagMarkerType),effects.consume(code2),effects.exit(tagMarkerType),effects.exit(tagType),ok2}function esWhitespaceStart(code2){return markdownLineEnding(code2)?(effects.enter("lineEnding"),effects.consume(code2),effects.exit("lineEnding"),esWhitespaceEolAfter):markdownSpace(code2)||unicodeWhitespace(code2)?(effects.enter("esWhitespace"),esWhitespaceInside(code2)):returnState(code2)}function esWhitespaceInside(code2){return markdownLineEnding(code2)?(effects.exit("esWhitespace"),esWhitespaceStart(code2)):markdownSpace(code2)||unicodeWhitespace(code2)?(effects.consume(code2),esWhitespaceInside):(effects.exit("esWhitespace"),returnState(code2))}function esWhitespaceEolAfter(code2){if(!allowLazy&&self2.parser.lazy[self2.now().line]){const error=new VFileMessage("Unexpected lazy line in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",self2.now(),"micromark-extension-mdx-jsx:unexpected-lazy");throw error.url=trouble+"#unexpected-lazy-line-in-container-expected-line-to-be",error}return esWhitespaceStart(code2)}function crash(code2,at2,expect){const error=new VFileMessage("Unexpected "+(null===code2?"end of file":"character `"+(96===code2?"` ` `":String.fromCodePoint(code2))+"` ("+function(code2){return"U+"+code2.toString(16).toUpperCase().padStart(4,"0")}(code2)+")")+" "+at2+", expected "+expect,self2.now(),"micromark-extension-mdx-jsx:unexpected-"+(null===code2?"eof":"character"));throw error.url=trouble+(null===code2?"#unexpected-end-of-file-at-expected-expect":"#unexpected-character-at-expected-expect"),error}}function jsxText(acorn,options){return{name:"mdxJsxTextTag",tokenize:function(effects,ok2,nok){return factoryTag.call(this,effects,ok2,nok,acorn,options.acornOptions,options.addResult,!0,"mdxJsxTextTag","mdxJsxTextTagMarker","mdxJsxTextTagClosingMarker","mdxJsxTextTagSelfClosingMarker","mdxJsxTextTagName","mdxJsxTextTagNamePrimary","mdxJsxTextTagNameMemberMarker","mdxJsxTextTagNameMember","mdxJsxTextTagNamePrefixMarker","mdxJsxTextTagNameLocal","mdxJsxTextTagExpressionAttribute","mdxJsxTextTagExpressionAttributeMarker","mdxJsxTextTagExpressionAttributeValue","mdxJsxTextTagAttribute","mdxJsxTextTagAttributeName","mdxJsxTextTagAttributeNamePrimary","mdxJsxTextTagAttributeNamePrefixMarker","mdxJsxTextTagAttributeNameLocal","mdxJsxTextTagAttributeInitializerMarker","mdxJsxTextTagAttributeValueLiteral","mdxJsxTextTagAttributeValueLiteralMarker","mdxJsxTextTagAttributeValueLiteralValue","mdxJsxTextTagAttributeValueExpression","mdxJsxTextTagAttributeValueExpressionMarker","mdxJsxTextTagAttributeValueExpressionValue")}}}function jsxFlow(acorn,options){return{concrete:!0,name:"mdxJsxFlowTag",tokenize:function(effects,ok2,nok){const self2=this;return start2;function start2(code2){return function(code2){return factoryTag.call(self2,effects,after,nok,acorn,options.acornOptions,options.addResult,!1,"mdxJsxFlowTag","mdxJsxFlowTagMarker","mdxJsxFlowTagClosingMarker","mdxJsxFlowTagSelfClosingMarker","mdxJsxFlowTagName","mdxJsxFlowTagNamePrimary","mdxJsxFlowTagNameMemberMarker","mdxJsxFlowTagNameMember","mdxJsxFlowTagNamePrefixMarker","mdxJsxFlowTagNameLocal","mdxJsxFlowTagExpressionAttribute","mdxJsxFlowTagExpressionAttributeMarker","mdxJsxFlowTagExpressionAttributeValue","mdxJsxFlowTagAttribute","mdxJsxFlowTagAttributeName","mdxJsxFlowTagAttributeNamePrimary","mdxJsxFlowTagAttributeNamePrefixMarker","mdxJsxFlowTagAttributeNameLocal","mdxJsxFlowTagAttributeInitializerMarker","mdxJsxFlowTagAttributeValueLiteral","mdxJsxFlowTagAttributeValueLiteralMarker","mdxJsxFlowTagAttributeValueLiteralValue","mdxJsxFlowTagAttributeValueExpression","mdxJsxFlowTagAttributeValueExpressionMarker","mdxJsxFlowTagAttributeValueExpressionValue")(code2)}(code2)}function after(code2){return markdownSpace(code2)?factorySpace(effects,end,"whitespace")(code2):end(code2)}function end(code2){const leftBraceValue=self2.parser.constructs.flow[123],constructs2=Array.isArray(leftBraceValue)?leftBraceValue:leftBraceValue?[leftBraceValue]:[];let expression;for(const construct of constructs2)if("mdxFlowExpression"===construct.name){expression=construct;break}return 60===code2?start2(code2):123===code2&&expression?effects.attempt(expression,end,nok)(code2):null===code2||markdownLineEnding(code2)?ok2(code2):nok(code2)}}}}function mdxJsx(options){const settings={},acorn=settings.acorn;let acornOptions;if(acorn){if(!acorn.parse||!acorn.parseExpressionAt)throw new Error("Expected a proper `acorn` instance passed in as `options.acorn`");acornOptions=Object.assign({ecmaVersion:2024,sourceType:"module"},settings.acornOptions,{locations:!0})}else if(settings.acornOptions||settings.addResult)throw new Error("Expected an `acorn` instance passed in as `options.acorn`");return{flow:{60:jsxFlow(acorn||void 0,{acornOptions:acornOptions,addResult:settings.addResult||void 0})},text:{60:jsxText(acorn||void 0,{acornOptions:acornOptions,addResult:settings.addResult||void 0})}}}const own$2={}.hasOwnProperty;const own$1={}.hasOwnProperty;function configure$1(base,extension2){let key,index2=-1;if(extension2.extensions)for(;++index2<extension2.extensions.length;)configure$1(base,extension2.extensions[index2]);for(key in extension2)if(own$1.call(extension2,key))switch(key){case"extensions":break;case"unsafe":case"join":list$2(base[key],extension2[key]);break;case"handlers":map$2(base[key],extension2[key]);break;default:base.options[key]=extension2[key]}return base}function list$2(left,right){right&&left.push(...right)}function map$2(left,right){right&&Object.assign(left,right)}function map$1(line,_2,blank){return">"+(blank?"":" ")+line}function patternInScope(stack,pattern){return listInScope(stack,pattern.inConstruct,!0)&&!listInScope(stack,pattern.notInConstruct,!1)}function listInScope(stack,list2,none){if("string"==typeof list2&&(list2=[list2]),!list2||0===list2.length)return none;let index2=-1;for(;++index2<list2.length;)if(stack.includes(list2[index2]))return!0;return!1}function hardBreak(_2,_1,state,info){let index2=-1;for(;++index2<state.unsafe.length;)if("\n"===state.unsafe[index2].character&&patternInScope(state.stack,state.unsafe[index2]))return/[ \t]/.test(info.before)?"":" ";return"\\\n"}function formatCodeAsIndented(node2,state){return Boolean(!1===state.options.fences&&node2.value&&!node2.lang&&/[^ \r\n]/.test(node2.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(node2.value))}function map(line,_2,blank){return(blank?"":" ")+line}function checkQuote(state){const marker=state.options.quote||'"';if('"'!==marker&&"'"!==marker)throw new Error("Cannot serialize title with `"+marker+"` for `options.quote`, expected `\"`, or `'`");return marker}function encodeCharacterReference(code2){return"&#x"+code2.toString(16).toUpperCase()+";"}function encodeInfo(outside,inside,marker){const outsideKind=classifyCharacter(outside),insideKind=classifyCharacter(inside);return void 0===outsideKind?void 0===insideKind?"_"===marker?{inside:!0,outside:!0}:{inside:!1,outside:!1}:1===insideKind?{inside:!0,outside:!0}:{inside:!1,outside:!0}:1===outsideKind?void 0===insideKind?{inside:!1,outside:!1}:1===insideKind?{inside:!0,outside:!0}:{inside:!1,outside:!1}:void 0===insideKind?{inside:!1,outside:!1}:1===insideKind?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function emphasis(node2,_2,state,info){const marker=function(state){const marker=state.options.emphasis||"*";if("*"!==marker&&"_"!==marker)throw new Error("Cannot serialize emphasis with `"+marker+"` for `options.emphasis`, expected `*`, or `_`");return marker}(state),exit2=state.enter("emphasis"),tracker=state.createTracker(info),before=tracker.move(marker);let between2=tracker.move(state.containerPhrasing(node2,{after:marker,before:before,...tracker.current()}));const betweenHead=between2.charCodeAt(0),open=encodeInfo(info.before.charCodeAt(info.before.length-1),betweenHead,marker);open.inside&&(between2=encodeCharacterReference(betweenHead)+between2.slice(1));const betweenTail=between2.charCodeAt(between2.length-1),close=encodeInfo(info.after.charCodeAt(0),betweenTail,marker);close.inside&&(between2=between2.slice(0,-1)+encodeCharacterReference(betweenTail));const after=tracker.move(marker);return exit2(),state.attentionEncodeSurroundingInfo={after:close.outside,before:open.outside},before+between2+after}emphasis.peek=function(_2,_1,state){return state.options.emphasis||"*"};const convert=function(test){if(null==test)return ok;if("function"==typeof test)return castFactory(test);if("object"==typeof test)return Array.isArray(test)?function(tests){const checks=[];let index2=-1;for(;++index2<tests.length;)checks[index2]=convert(tests[index2]);return castFactory(any);function any(...parameters){let index3=-1;for(;++index3<checks.length;)if(checks[index3].apply(this,parameters))return!0;return!1}}(test):function(check){const checkAsRecord=check;return castFactory(all2);function all2(node2){const nodeAsRecord=node2;let key;for(key in check)if(nodeAsRecord[key]!==checkAsRecord[key])return!1;return!0}}(test);if("string"==typeof test)return function(check){return castFactory(type);function type(node2){return node2&&node2.type===check}}(test);throw new Error("Expected function, string, or object as test")};function castFactory(testFunction){return function(value,index2,parent){return Boolean(function(value){return null!==value&&"object"==typeof value&&"type"in value}(value)&&testFunction.call(this,value,"number"==typeof index2?index2:void 0,parent||void 0))}}function ok(){return!0}const empty=[];function visitParents(tree,test,visitor,reverse){let check;"function"==typeof test&&"function"!=typeof visitor?(reverse=visitor,visitor=test):check=test;const is2=convert(check),step=reverse?-1:1;!function factory(node2,index2,parents){const value=node2&&"object"==typeof node2?node2:{};if("string"==typeof value.type){const name="string"==typeof value.tagName?value.tagName:"string"==typeof value.name?value.name:void 0;Object.defineProperty(visit2,"name",{value:"node ("+node2.type+(name?"<"+name+">":"")+")"})}return visit2;function visit2(){let subresult,offset2,grandparents,result=empty;if((!test||is2(node2,index2,parents[parents.length-1]||void 0))&&(result=function(value){if(Array.isArray(value))return value;if("number"==typeof value)return[true,value];return null==value?empty:[value]}(visitor(node2,parents)),false===result[0]))return result;if("children"in node2&&node2.children){const nodeAsParent=node2;if(nodeAsParent.children&&"skip"!==result[0])for(offset2=(reverse?nodeAsParent.children.length:-1)+step,grandparents=parents.concat(nodeAsParent);offset2>-1&&offset2<nodeAsParent.children.length;){const child=nodeAsParent.children[offset2];if(subresult=factory(child,offset2,grandparents)(),false===subresult[0])return subresult;offset2="number"==typeof subresult[1]?subresult[1]:offset2+step}}return result}}(tree,void 0,[])()}const emptyOptions={};function toString(value,options){return one(value,"boolean"!=typeof emptyOptions.includeImageAlt||emptyOptions.includeImageAlt,"boolean"!=typeof emptyOptions.includeHtml||emptyOptions.includeHtml)}function one(value,includeImageAlt,includeHtml){if(function(value){return Boolean(value&&"object"==typeof value)}(value)){if("value"in value)return"html"!==value.type||includeHtml?value.value:"";if(includeImageAlt&&"alt"in value&&value.alt)return value.alt;if("children"in value)return all(value.children,includeImageAlt,includeHtml)}return Array.isArray(value)?all(value,includeImageAlt,includeHtml):""}function all(values,includeImageAlt,includeHtml){const result=[];let index2=-1;for(;++index2<values.length;)result[index2]=one(values[index2],includeImageAlt,includeHtml);return result.join("")}function formatHeadingAsSetext(node2,state){let literalWithBreak=!1;return function(tree,testOrVisitor,visitorOrReverse,maybeReverse){let reverse,test,visitor;"function"==typeof testOrVisitor&&"function"!=typeof visitorOrReverse?(test=void 0,visitor=testOrVisitor,reverse=visitorOrReverse):(test=testOrVisitor,visitor=visitorOrReverse,reverse=maybeReverse),visitParents(tree,test,function(node2,parents){const parent=parents[parents.length-1],index2=parent?parent.children.indexOf(node2):void 0;return visitor(node2,index2,parent)},reverse)}(node2,function(node3){if("value"in node3&&/\r?\n|\r/.test(node3.value)||"break"===node3.type)return literalWithBreak=!0,false}),Boolean((!node2.depth||node2.depth<3)&&toString(node2)&&(state.options.setext||literalWithBreak))}function html(node2){return node2.value||""}function image(node2,_2,state,info){const quote=checkQuote(state),suffix='"'===quote?"Quote":"Apostrophe",exit2=state.enter("image");let subexit=state.enter("label");const tracker=state.createTracker(info);let value=tracker.move("![");return value+=tracker.move(state.safe(node2.alt,{before:value,after:"]",...tracker.current()})),value+=tracker.move("]("),subexit(),!node2.url&&node2.title||/[\0- \u007F]/.test(node2.url)?(subexit=state.enter("destinationLiteral"),value+=tracker.move("<"),value+=tracker.move(state.safe(node2.url,{before:value,after:">",...tracker.current()})),value+=tracker.move(">")):(subexit=state.enter("destinationRaw"),value+=tracker.move(state.safe(node2.url,{before:value,after:node2.title?" ":")",...tracker.current()}))),subexit(),node2.title&&(subexit=state.enter(`title${suffix}`),value+=tracker.move(" "+quote),value+=tracker.move(state.safe(node2.title,{before:value,after:quote,...tracker.current()})),value+=tracker.move(quote),subexit()),value+=tracker.move(")"),exit2(),value}function imageReference(node2,_2,state,info){const type=node2.referenceType,exit2=state.enter("imageReference");let subexit=state.enter("label");const tracker=state.createTracker(info);let value=tracker.move("![");const alt=state.safe(node2.alt,{before:value,after:"]",...tracker.current()});value+=tracker.move(alt+"]["),subexit();const stack=state.stack;state.stack=[],subexit=state.enter("reference");const reference=state.safe(state.associationId(node2),{before:value,after:"]",...tracker.current()});return subexit(),state.stack=stack,exit2(),"full"!==type&&alt&&alt===reference?"shortcut"===type?value=value.slice(0,-1):value+=tracker.move("]"):value+=tracker.move(reference+"]"),value}function inlineCode(node2,_2,state){let value=node2.value||"",sequence="`",index2=-1;for(;new RegExp("(^|[^`])"+sequence+"([^`]|$)").test(value);)sequence+="`";for(/[^ \r\n]/.test(value)&&(/^[ \r\n]/.test(value)&&/[ \r\n]$/.test(value)||/^`|`$/.test(value))&&(value=" "+value+" ");++index2<state.unsafe.length;){const pattern=state.unsafe[index2],expression=state.compilePattern(pattern);let match;if(pattern.atBreak)for(;match=expression.exec(value);){let position2=match.index;10===value.charCodeAt(position2)&&13===value.charCodeAt(position2-1)&&position2--,value=value.slice(0,position2)+" "+value.slice(match.index+1)}}return sequence+value+sequence}function formatLinkAsAutolink(node2,state){const raw=toString(node2);return Boolean(!state.options.resourceLink&&node2.url&&!node2.title&&node2.children&&1===node2.children.length&&"text"===node2.children[0].type&&(raw===node2.url||"mailto:"+raw===node2.url)&&/^[a-z][a-z+.-]+:/i.test(node2.url)&&!/[\0- <>\u007F]/.test(node2.url))}function link(node2,_2,state,info){const quote=checkQuote(state),suffix='"'===quote?"Quote":"Apostrophe",tracker=state.createTracker(info);let exit2,subexit;if(formatLinkAsAutolink(node2,state)){const stack=state.stack;state.stack=[],exit2=state.enter("autolink");let value2=tracker.move("<");return value2+=tracker.move(state.containerPhrasing(node2,{before:value2,after:">",...tracker.current()})),value2+=tracker.move(">"),exit2(),state.stack=stack,value2}exit2=state.enter("link"),subexit=state.enter("label");let value=tracker.move("[");return value+=tracker.move(state.containerPhrasing(node2,{before:value,after:"](",...tracker.current()})),value+=tracker.move("]("),subexit(),!node2.url&&node2.title||/[\0- \u007F]/.test(node2.url)?(subexit=state.enter("destinationLiteral"),value+=tracker.move("<"),value+=tracker.move(state.safe(node2.url,{before:value,after:">",...tracker.current()})),value+=tracker.move(">")):(subexit=state.enter("destinationRaw"),value+=tracker.move(state.safe(node2.url,{before:value,after:node2.title?" ":")",...tracker.current()}))),subexit(),node2.title&&(subexit=state.enter(`title${suffix}`),value+=tracker.move(" "+quote),value+=tracker.move(state.safe(node2.title,{before:value,after:quote,...tracker.current()})),value+=tracker.move(quote),subexit()),value+=tracker.move(")"),exit2(),value}function linkReference(node2,_2,state,info){const type=node2.referenceType,exit2=state.enter("linkReference");let subexit=state.enter("label");const tracker=state.createTracker(info);let value=tracker.move("[");const text2=state.containerPhrasing(node2,{before:value,after:"]",...tracker.current()});value+=tracker.move(text2+"]["),subexit();const stack=state.stack;state.stack=[],subexit=state.enter("reference");const reference=state.safe(state.associationId(node2),{before:value,after:"]",...tracker.current()});return subexit(),state.stack=stack,exit2(),"full"!==type&&text2&&text2===reference?"shortcut"===type?value=value.slice(0,-1):value+=tracker.move("]"):value+=tracker.move(reference+"]"),value}function checkBullet(state){const marker=state.options.bullet||"*";if("*"!==marker&&"+"!==marker&&"-"!==marker)throw new Error("Cannot serialize items with `"+marker+"` for `options.bullet`, expected `*`, `+`, or `-`");return marker}function checkRule(state){const marker=state.options.rule||"*";if("*"!==marker&&"-"!==marker&&"_"!==marker)throw new Error("Cannot serialize rules with `"+marker+"` for `options.rule`, expected `*`, `-`, or `_`");return marker}html.peek=function(){return"<"},image.peek=function(){return"!"},imageReference.peek=function(){return"!"},inlineCode.peek=function(){return"`"},link.peek=function(node2,_2,state){return formatLinkAsAutolink(node2,state)?"<":"["},linkReference.peek=function(){return"["};const phrasing=convert(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function strong(node2,_2,state,info){const marker=function(state){const marker=state.options.strong||"*";if("*"!==marker&&"_"!==marker)throw new Error("Cannot serialize strong with `"+marker+"` for `options.strong`, expected `*`, or `_`");return marker}(state),exit2=state.enter("strong"),tracker=state.createTracker(info),before=tracker.move(marker+marker);let between2=tracker.move(state.containerPhrasing(node2,{after:marker,before:before,...tracker.current()}));const betweenHead=between2.charCodeAt(0),open=encodeInfo(info.before.charCodeAt(info.before.length-1),betweenHead,marker);open.inside&&(between2=encodeCharacterReference(betweenHead)+between2.slice(1));const betweenTail=between2.charCodeAt(between2.length-1),close=encodeInfo(info.after.charCodeAt(0),betweenTail,marker);close.inside&&(between2=between2.slice(0,-1)+encodeCharacterReference(betweenTail));const after=tracker.move(marker+marker);return exit2(),state.attentionEncodeSurroundingInfo={after:close.outside,before:open.outside},before+between2+after}strong.peek=function(_2,_1,state){return state.options.strong||"*"};const handle={blockquote:function(node2,_2,state,info){const exit2=state.enter("blockquote"),tracker=state.createTracker(info);tracker.move("> "),tracker.shift(2);const value=state.indentLines(state.containerFlow(node2,tracker.current()),map$1);return exit2(),value},break:hardBreak,code:function(node2,_2,state,info){const marker=function(state){const marker=state.options.fence||"`";if("`"!==marker&&"~"!==marker)throw new Error("Cannot serialize code with `"+marker+"` for `options.fence`, expected `` ` `` or `~`");return marker}(state),raw=node2.value||"",suffix="`"===marker?"GraveAccent":"Tilde";if(formatCodeAsIndented(node2,state)){const exit3=state.enter("codeIndented"),value2=state.indentLines(raw,map);return exit3(),value2}const tracker=state.createTracker(info),sequence=marker.repeat(Math.max(function(value,substring){const source=String(value);let index2=source.indexOf(substring),expected=index2,count2=0,max2=0;if("string"!=typeof substring)throw new TypeError("Expected substring");for(;-1!==index2;)index2===expected?++count2>max2&&(max2=count2):count2=1,expected=index2+substring.length,index2=source.indexOf(substring,expected);return max2}(raw,marker)+1,3)),exit2=state.enter("codeFenced");let value=tracker.move(sequence);if(node2.lang){const subexit=state.enter(`codeFencedLang${suffix}`);value+=tracker.move(state.safe(node2.lang,{before:value,after:" ",encode:["`"],...tracker.current()})),subexit()}if(node2.lang&&node2.meta){const subexit=state.enter(`codeFencedMeta${suffix}`);value+=tracker.move(" "),value+=tracker.move(state.safe(node2.meta,{before:value,after:"\n",encode:["`"],...tracker.current()})),subexit()}return value+=tracker.move("\n"),raw&&(value+=tracker.move(raw+"\n")),value+=tracker.move(sequence),exit2(),value},definition:function(node2,_2,state,info){const quote=checkQuote(state),suffix='"'===quote?"Quote":"Apostrophe",exit2=state.enter("definition");let subexit=state.enter("label");const tracker=state.createTracker(info);let value=tracker.move("[");return value+=tracker.move(state.safe(state.associationId(node2),{before:value,after:"]",...tracker.current()})),value+=tracker.move("]: "),subexit(),!node2.url||/[\0- \u007F]/.test(node2.url)?(subexit=state.enter("destinationLiteral"),value+=tracker.move("<"),value+=tracker.move(state.safe(node2.url,{before:value,after:">",...tracker.current()})),value+=tracker.move(">")):(subexit=state.enter("destinationRaw"),value+=tracker.move(state.safe(node2.url,{before:value,after:node2.title?" ":"\n",...tracker.current()}))),subexit(),node2.title&&(subexit=state.enter(`title${suffix}`),value+=tracker.move(" "+quote),value+=tracker.move(state.safe(node2.title,{before:value,after:quote,...tracker.current()})),value+=tracker.move(quote),subexit()),exit2(),value},emphasis:emphasis,hardBreak:hardBreak,heading:function(node2,_2,state,info){const rank=Math.max(Math.min(6,node2.depth||1),1),tracker=state.createTracker(info);if(formatHeadingAsSetext(node2,state)){const exit3=state.enter("headingSetext"),subexit2=state.enter("phrasing"),value2=state.containerPhrasing(node2,{...tracker.current(),before:"\n",after:"\n"});return subexit2(),exit3(),value2+"\n"+(1===rank?"=":"-").repeat(value2.length-(Math.max(value2.lastIndexOf("\r"),value2.lastIndexOf("\n"))+1))}const sequence="#".repeat(rank),exit2=state.enter("headingAtx"),subexit=state.enter("phrasing");tracker.move(sequence+" ");let value=state.containerPhrasing(node2,{before:"# ",after:"\n",...tracker.current()});return/^[\t ]/.test(value)&&(value=encodeCharacterReference(value.charCodeAt(0))+value.slice(1)),value=value?sequence+" "+value:sequence,state.options.closeAtx&&(value+=" "+sequence),subexit(),exit2(),value},html:html,image:image,imageReference:imageReference,inlineCode:inlineCode,link:link,linkReference:linkReference,list:function(node2,parent,state,info){const exit2=state.enter("list"),bulletCurrent=state.bulletCurrent;let bullet=node2.ordered?function(state){const marker=state.options.bulletOrdered||".";if("."!==marker&&")"!==marker)throw new Error("Cannot serialize items with `"+marker+"` for `options.bulletOrdered`, expected `.` or `)`");return marker}(state):checkBullet(state);const bulletOther=node2.ordered?"."===bullet?")":".":function(state){const bullet=checkBullet(state),bulletOther=state.options.bulletOther;if(!bulletOther)return"*"===bullet?"-":"*";if("*"!==bulletOther&&"+"!==bulletOther&&"-"!==bulletOther)throw new Error("Cannot serialize items with `"+bulletOther+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(bulletOther===bullet)throw new Error("Expected `bullet` (`"+bullet+"`) and `bulletOther` (`"+bulletOther+"`) to be different");return bulletOther}(state);let useDifferentMarker=!(!parent||!state.bulletLastUsed)&&bullet===state.bulletLastUsed;if(!node2.ordered){const firstListItem=node2.children?node2.children[0]:void 0;if("*"!==bullet&&"-"!==bullet||!firstListItem||firstListItem.children&&firstListItem.children[0]||"list"!==state.stack[state.stack.length-1]||"listItem"!==state.stack[state.stack.length-2]||"list"!==state.stack[state.stack.length-3]||"listItem"!==state.stack[state.stack.length-4]||0!==state.indexStack[state.indexStack.length-1]||0!==state.indexStack[state.indexStack.length-2]||0!==state.indexStack[state.indexStack.length-3]||(useDifferentMarker=!0),checkRule(state)===bullet&&firstListItem){let index2=-1;for(;++index2<node2.children.length;){const item=node2.children[index2];if(item&&"listItem"===item.type&&item.children&&item.children[0]&&"thematicBreak"===item.children[0].type){useDifferentMarker=!0;break}}}}useDifferentMarker&&(bullet=bulletOther),state.bulletCurrent=bullet;const value=state.containerFlow(node2,info);return state.bulletLastUsed=bullet,state.bulletCurrent=bulletCurrent,exit2(),value},listItem:function(node2,parent,state,info){const listItemIndent=function(state){const style=state.options.listItemIndent||"one";if("tab"!==style&&"one"!==style&&"mixed"!==style)throw new Error("Cannot serialize items with `"+style+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return style}(state);let bullet=state.bulletCurrent||checkBullet(state);parent&&"list"===parent.type&&parent.ordered&&(bullet=("number"==typeof parent.start&&parent.start>-1?parent.start:1)+(!1===state.options.incrementListMarker?0:parent.children.indexOf(node2))+bullet);let size2=bullet.length+1;("tab"===listItemIndent||"mixed"===listItemIndent&&(parent&&"list"===parent.type&&parent.spread||node2.spread))&&(size2=4*Math.ceil(size2/4));const tracker=state.createTracker(info);tracker.move(bullet+" ".repeat(size2-bullet.length)),tracker.shift(size2);const exit2=state.enter("listItem"),value=state.indentLines(state.containerFlow(node2,tracker.current()),function(line,index2,blank){if(index2)return(blank?"":" ".repeat(size2))+line;return(blank?bullet:bullet+" ".repeat(size2-bullet.length))+line});return exit2(),value},paragraph:function(node2,_2,state,info){const exit2=state.enter("paragraph"),subexit=state.enter("phrasing"),value=state.containerPhrasing(node2,info);return subexit(),exit2(),value},root:function(node2,_2,state,info){return(node2.children.some(function(d2){return phrasing(d2)})?state.containerPhrasing:state.containerFlow).call(state,node2,info)},strong:strong,text:function(node2,_2,state,info){return state.safe(node2.value,info)},thematicBreak:function(_2,_1,state){const value=(checkRule(state)+(state.options.ruleSpaces?" ":"")).repeat(function(state){const repetition=state.options.ruleRepetition||3;if(repetition<3)throw new Error("Cannot serialize rules with repetition `"+repetition+"` for `options.ruleRepetition`, expected `3` or more");return repetition}(state));return state.options.ruleSpaces?value.slice(0,-1):value}},join2=[function(left,right,parent,state){if("code"===right.type&&formatCodeAsIndented(right,state)&&("list"===left.type||left.type===right.type&&formatCodeAsIndented(left,state)))return!1;if("spread"in parent&&"boolean"==typeof parent.spread){if("paragraph"===left.type&&(left.type===right.type||"definition"===right.type||"heading"===right.type&&formatHeadingAsSetext(right,state)))return;return parent.spread?1:0}}];const fullPhrasingSpans=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],unsafe=[{character:"\t",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"\t",before:"[\\r\\n]",inConstruct:"phrasing"},{character:"\t",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"\r",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:"\n",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"!",after:"\\[",inConstruct:"phrasing",notInConstruct:fullPhrasingSpans},{character:'"',inConstruct:"titleQuote"},{atBreak:!0,character:"#"},{character:"#",inConstruct:"headingAtx",after:"(?:[\r\n]|$)"},{character:"&",after:"[#A-Za-z]",inConstruct:"phrasing"},{character:"'",inConstruct:"titleApostrophe"},{character:"(",inConstruct:"destinationRaw"},{before:"\\]",character:"(",inConstruct:"phrasing",notInConstruct:fullPhrasingSpans},{atBreak:!0,before:"\\d+",character:")"},{character:")",inConstruct:"destinationRaw"},{atBreak:!0,character:"*",after:"(?:[ \t\r\n*])"},{character:"*",inConstruct:"phrasing",notInConstruct:fullPhrasingSpans},{atBreak:!0,character:"+",after:"(?:[ \t\r\n])"},{atBreak:!0,character:"-",after:"(?:[ \t\r\n-])"},{atBreak:!0,before:"\\d+",character:".",after:"(?:[ \t\r\n]|$)"},{atBreak:!0,character:"<",after:"[!/?A-Za-z]"},{character:"<",after:"[!/?A-Za-z]",inConstruct:"phrasing",notInConstruct:fullPhrasingSpans},{character:"<",inConstruct:"destinationLiteral"},{atBreak:!0,character:"="},{atBreak:!0,character:">"},{character:">",inConstruct:"destinationLiteral"},{atBreak:!0,character:"["},{character:"[",inConstruct:"phrasing",notInConstruct:fullPhrasingSpans},{character:"[",inConstruct:["label","reference"]},{character:"\\",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"]",inConstruct:["label","reference"]},{atBreak:!0,character:"_"},{character:"_",inConstruct:"phrasing",notInConstruct:fullPhrasingSpans},{atBreak:!0,character:"`"},{character:"`",inConstruct:["codeFencedLangGraveAccent","codeFencedMetaGraveAccent"]},{character:"`",inConstruct:"phrasing",notInConstruct:fullPhrasingSpans},{atBreak:!0,character:"~"}];function decodeNumericCharacterReference(value,base){const code2=Number.parseInt(value,base);return code2<9||11===code2||code2>13&&code2<32||code2>126&&code2<160||code2>55295&&code2<57344||code2>64975&&code2<65008||!(65535&~code2)||65534==(65535&code2)||code2>1114111?"�":String.fromCodePoint(code2)}const characterEscapeOrReference=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function decodeString(value){return value.replace(characterEscapeOrReference,decode)}function decode($0,$1,$2){if($1)return $1;if(35===$2.charCodeAt(0)){const head2=$2.charCodeAt(1),hex=120===head2||88===head2;return decodeNumericCharacterReference($2.slice(hex?2:1),hex?16:10)}return decodeNamedCharacterReference($2)||$0}function association(node2){return node2.label||!node2.identifier?node2.label||"":decodeString(node2.identifier)}function compilePattern(pattern){if(!pattern._compiled){const before=(pattern.atBreak?"[\\r\\n][\\t ]*":"")+(pattern.before?"(?:"+pattern.before+")":"");pattern._compiled=new RegExp((before?"("+before+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(pattern.character)?"\\":"")+pattern.character+(pattern.after?"(?:"+pattern.after+")":""),"g")}return pattern._compiled}function between(left,right,parent,state){let index2=state.join.length;for(;index2--;){const result=state.join[index2](left,right,parent,state);if(!0===result||1===result)break;if("number"==typeof result)return"\n".repeat(1+result);if(!1===result)return"\n\n\x3c!----\x3e\n\n"}return"\n\n"}const eol=/\r?\n|\r/g;function indentLines(value,map2){const result=[];let match,start2=0,line=0;for(;match=eol.exec(value);)one2(value.slice(start2,match.index)),result.push(match[0]),start2=match.index+match[0].length,line++;return one2(value.slice(start2)),result.join("");function one2(value2){result.push(map2(value2,line,!value2))}}function numerical(a2,b2){return a2-b2}function escapeBackslashes(value,after){const expression=/\\(?=[!-/:-@[-`{-~])/g,positions=[],results=[],whole=value+after;let match,index2=-1,start2=0;for(;match=expression.exec(whole);)positions.push(match.index);for(;++index2<positions.length;)start2!==positions[index2]&&results.push(value.slice(start2,positions[index2])),results.push("\\"),start2=positions[index2];return results.push(value.slice(start2)),results.join("")}function track(config){const options=config||{},now=options.now||{};let lineShift=options.lineShift||0,line=now.line||1,column=now.column||1;return{move:function(input){const value=input||"",chunks=value.split(/\r?\n|\r/g),tail=chunks[chunks.length-1];return line+=chunks.length-1,column=1===chunks.length?column+tail.length:1+tail.length+lineShift,value},current:function(){return{now:{line:line,column:column},lineShift:lineShift}},shift:function(value){lineShift+=value}}}function toMarkdown(tree,options){const settings=options||{},state={associationId:association,containerPhrasing:containerPhrasingBound,containerFlow:containerFlowBound,createTracker:track,compilePattern:compilePattern,enter:function(name){return state.stack.push(name),function(){state.stack.pop()}},handlers:{...handle},handle:void 0,indentLines:indentLines,indexStack:[],join:[...join2],options:{},safe:safeBound,stack:[],unsafe:[...unsafe]};configure$1(state,settings),state.options.tightDefinitions&&state.join.push(joinDefinition),state.handle=function(key,options){const settings=options||{};function one2(value,...parameters){let fn2=one2.invalid;const handlers=one2.handlers;if(value&&own$2.call(value,key)){const id=String(value[key]);fn2=own$2.call(handlers,id)?handlers[id]:one2.unknown}if(fn2)return fn2.call(this,value,...parameters)}return one2.handlers=settings.handlers||{},one2.invalid=settings.invalid,one2.unknown=settings.unknown,one2}("type",{invalid:invalid$1,unknown:unknown,handlers:state.handlers});let result=state.handle(tree,void 0,state,{before:"\n",after:"\n",now:{line:1,column:1},lineShift:0});return result&&10!==result.charCodeAt(result.length-1)&&13!==result.charCodeAt(result.length-1)&&(result+="\n"),result}function invalid$1(value){throw new Error("Cannot handle value `"+value+"`, expected node")}function unknown(value){throw new Error("Cannot handle unknown node `"+value.type+"`")}function joinDefinition(left,right){if("definition"===left.type&&left.type===right.type)return 0}function containerPhrasingBound(parent,info){return function(parent,state,info){const indexStack=state.indexStack,children=parent.children||[],results=[];let encodeAfter,index2=-1,before=info.before;indexStack.push(-1);let tracker=state.createTracker(info);for(;++index2<children.length;){const child=children[index2];let after;if(indexStack[indexStack.length-1]=index2,index2+1<children.length){let handle2=state.handle.handlers[children[index2+1].type];handle2&&handle2.peek&&(handle2=handle2.peek),after=handle2?handle2(children[index2+1],parent,state,{before:"",after:"",...tracker.current()}).charAt(0):""}else after=info.after;results.length>0&&("\r"===before||"\n"===before)&&"html"===child.type&&(results[results.length-1]=results[results.length-1].replace(/(\r?\n|\r)$/," "),before=" ",tracker=state.createTracker(info),tracker.move(results.join("")));let value=state.handle(child,parent,state,{...tracker.current(),after:after,before:before});encodeAfter&&encodeAfter===value.slice(0,1)&&(value=encodeCharacterReference(encodeAfter.charCodeAt(0))+value.slice(1));const encodingInfo=state.attentionEncodeSurroundingInfo;state.attentionEncodeSurroundingInfo=void 0,encodeAfter=void 0,encodingInfo&&(results.length>0&&encodingInfo.before&&before===results[results.length-1].slice(-1)&&(results[results.length-1]=results[results.length-1].slice(0,-1)+encodeCharacterReference(before.charCodeAt(0))),encodingInfo.after&&(encodeAfter=after)),tracker.move(value),results.push(value),before=value.slice(-1)}return indexStack.pop(),results.join("")}(parent,this,info)}function containerFlowBound(parent,info){return function(parent,state,info){const indexStack=state.indexStack,children=parent.children||[],tracker=state.createTracker(info),results=[];let index2=-1;for(indexStack.push(-1);++index2<children.length;){const child=children[index2];indexStack[indexStack.length-1]=index2,results.push(tracker.move(state.handle(child,parent,state,{before:"\n",after:"\n",...tracker.current()}))),"list"!==child.type&&(state.bulletLastUsed=void 0),index2<children.length-1&&results.push(tracker.move(between(child,children[index2+1],parent,state)))}return indexStack.pop(),results.join("")}(parent,this,info)}function safeBound(value,config){return function(state,input,config){const value=(config.before||"")+(input||"")+(config.after||""),positions=[],result=[],infos={};let index2=-1;for(;++index2<state.unsafe.length;){const pattern=state.unsafe[index2];if(!patternInScope(state.stack,pattern))continue;const expression=state.compilePattern(pattern);let match;for(;match=expression.exec(value);){const before="before"in pattern||Boolean(pattern.atBreak),after="after"in pattern,position2=match.index+(before?match[1].length:0);positions.includes(position2)?(infos[position2].before&&!before&&(infos[position2].before=!1),infos[position2].after&&!after&&(infos[position2].after=!1)):(positions.push(position2),infos[position2]={before:before,after:after})}}positions.sort(numerical);let start2=config.before?config.before.length:0;const end=value.length-(config.after?config.after.length:0);for(index2=-1;++index2<positions.length;){const position2=positions[index2];position2<start2||position2>=end||position2+1<end&&positions[index2+1]===position2+1&&infos[position2].after&&!infos[position2+1].before&&!infos[position2+1].after||positions[index2-1]===position2-1&&infos[position2].before&&!infos[position2-1].before&&!infos[position2-1].after||(start2!==position2&&result.push(escapeBackslashes(value.slice(start2,position2),"\\")),start2=position2,!/[!-/:-@[-`{-~]/.test(value.charAt(position2))||config.encode&&config.encode.includes(value.charAt(position2))?(result.push(encodeCharacterReference(value.charCodeAt(position2))),start2++):result.push("\\"))}return result.push(escapeBackslashes(value.slice(start2,end),config.after)),result.join("")}(this,value,config)}const MDX_NODE_TYPES=["mdxJsxTextElement","mdxJsxFlowElement"];function isMdastHTMLNode(node2){return MDX_NODE_TYPES.includes(node2.type)&&htmlTags.includes(node2.name)}const htmlTags=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","input","ins","kbd","label","legend","li","link","main","map","mark","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"];function mergeStyleAttributes(style1,style2){const mergedStyleObject={...styleToObject(style1),...styleToObject(style2)};var styleObject;return styleObject=mergedStyleObject,Object.entries(styleObject).map(([key,value])=>`${key}: ${value}`).join("; ")}function styleToObject(style){const styleObject={};return style.split(";").filter(pair=>""!==pair.trim()).forEach(pair=>{const[key,value]=pair.split(":").map(part=>part.trim());styleObject[key]=value}),styleObject}function exportLexicalTreeToMdast({root:root2,visitors:visitors,jsxComponentDescriptors:jsxComponentDescriptors,jsxIsAvailable:jsxIsAvailable,addImportStatements:addImportStatements=!0}){let unistRoot=null;const referredComponents=new Set,knownImportSources=new Map;function registerReferredComponent(componentName,importStatement){referredComponents.add(componentName),importStatement&&knownImportSources.set(componentName,{...importStatement})}function appendToParent(parentNode,node2){if(null===unistRoot)return unistRoot=node2,unistRoot;if(!function(node2){return node2.children instanceof Array}(parentNode))throw new Error("Attempting to append children to a non-parent");const siblings=parentNode.children,prevSibling=siblings.at(-1);if(prevSibling){const joinVisitor=visitors.find(visitor=>{var _a;return null==(_a=visitor.shouldJoin)?void 0:_a.call(visitor,prevSibling,node2)});if(joinVisitor){const joinedNode=joinVisitor.join(prevSibling,node2);return siblings.splice(siblings.length-1,1,joinedNode),joinedNode}}return siblings.push(node2),node2}function visitChildren(lexicalNode,parentNode){lexicalNode.getChildren().forEach(lexicalChild=>{visit2(lexicalChild,parentNode)})}function visit2(lexicalNode,mdastParent,usedVisitors=null){var _a;const visitor=visitors.find((visitor2,index2)=>{var _a2;return!(null==usedVisitors?void 0:usedVisitors.has(index2))&&(null==(_a2=visitor2.testLexicalNode)?void 0:_a2.call(visitor2,lexicalNode))});if(!visitor)throw new Error(`no lexical visitor found for ${lexicalNode.getType()}`,{cause:lexicalNode});null==(_a=visitor.visitLexicalNode)||_a.call(visitor,{lexicalNode:lexicalNode,mdastParent:mdastParent,actions:{addAndStepInto(type,props={},hasChildren=!0){const newNode={type:type,...props,...hasChildren?{children:[]}:{}};appendToParent(mdastParent,newNode),hi(lexicalNode)&&hasChildren&&visitChildren(lexicalNode,newNode)},appendToParent:appendToParent,visitChildren:visitChildren,visit:visit2,registerReferredComponent:registerReferredComponent,nextVisitor(){visit2(lexicalNode,mdastParent,(usedVisitors??new Set).add(visitors.indexOf(visitor)))}}})}if(visitors=visitors.sort((a2,b2)=>(b2.priority??0)-(a2.priority??0)),visit2(root2,null),null===unistRoot)throw new Error("traversal ended with no root element");const importsMap=new Map,defaultImportsMap=new Map;for(const componentName of referredComponents){const descriptor=jsxComponentDescriptors.find(descriptor2=>descriptor2.name===componentName)??knownImportSources.get(componentName)??jsxComponentDescriptors.find(descriptor2=>"*"===descriptor2.name);if(!descriptor)throw new Error(`Component ${componentName} is used but not imported`);if(descriptor.source)if(descriptor.defaultExport)defaultImportsMap.set(componentName,descriptor.source);else{const{source:source}=descriptor,existing=importsMap.get(source);existing?existing.push(componentName):importsMap.set(source,[componentName])}}if(!addImportStatements){for(const[path,names]of importsMap.entries()){const cleaned=names.filter(n2=>knownImportSources.has(n2));cleaned.length>0?importsMap.set(path,cleaned):importsMap.delete(path)}for(const key of defaultImportsMap.keys())knownImportSources.has(key)||defaultImportsMap.delete(key)}const imports=Array.from(importsMap).map(([source,componentNames])=>({type:"mdxjsEsm",value:`import { ${componentNames.join(", ")} } from '${source}'`}));imports.push(...Array.from(defaultImportsMap).map(([componentName,source])=>({type:"mdxjsEsm",value:`import ${componentName} from '${source}'`})));const typedRoot=unistRoot,frontmatter=typedRoot.children.find(child=>"yaml"===child.type);return frontmatter?typedRoot.children.splice(typedRoot.children.indexOf(frontmatter)+1,0,...imports):typedRoot.children.unshift(...imports),fixWrappingWhitespace(typedRoot,[]),collapseNestedHtmlTags(typedRoot),jsxIsAvailable||convertUnderlineJsxToHtml(typedRoot),typedRoot}function collapseNestedHtmlTags(node2){if("children"in node2&&node2.children.length>0){if(isMdastHTMLNode(node2)&&1===node2.children.length){const onlyChild=node2.children[0];"mdxJsxTextElement"===onlyChild.type&&"span"===onlyChild.name&&(onlyChild.attributes.forEach(attribute=>{if("mdxJsxAttribute"===attribute.type){const parentAttribute=node2.attributes.find(attr=>"mdxJsxAttribute"===attr.type&&attr.name===attribute.name);if(parentAttribute)if("className"===attribute.name){const mergedClassesSet=new Set([...parentAttribute.value.split(" "),...attribute.value.split(" ")]);parentAttribute.value=Array.from(mergedClassesSet).join(" ")}else"style"===attribute.name&&(parentAttribute.value=mergeStyleAttributes(parentAttribute.value,attribute.value));else node2.attributes.push(attribute)}}),node2.children=onlyChild.children)}node2.children.forEach(child=>{collapseNestedHtmlTags(child)})}}function convertUnderlineJsxToHtml(node2){if(Object.hasOwn(node2,"children")){const nodeAsParent=node2,newChildren=[];nodeAsParent.children.forEach(child=>{"mdxJsxTextElement"===child.type&&"u"===child.name?newChildren.push({type:"html",value:"<u>"},...child.children,{type:"html",value:"</u>"}):(newChildren.push(child),convertUnderlineJsxToHtml(child))}),nodeAsParent.children=newChildren}}const TRAILING_WHITESPACE_REGEXP=/\s+$/,LEADING_WHITESPACE_REGEXP=/^\s+/;function fixWrappingWhitespace(node2,parentChain){if("strong"===node2.type||"emphasis"===node2.type){const lastChild=node2.children.at(-1);if("text"===(null==lastChild?void 0:lastChild.type)){const trailingWhitespace=TRAILING_WHITESPACE_REGEXP.exec(lastChild.value);if(trailingWhitespace){lastChild.value=lastChild.value.replace(TRAILING_WHITESPACE_REGEXP,"");const parent=parentChain.at(-1);parent&&(parent.children.splice(parent.children.indexOf(node2)+1,0,{type:"text",value:trailingWhitespace[0]}),fixWrappingWhitespace(parent,parentChain.slice(0,-1)))}}const firstChild=node2.children.at(0);if("text"===(null==firstChild?void 0:firstChild.type)){const leadingWhitespace=LEADING_WHITESPACE_REGEXP.exec(firstChild.value);if(leadingWhitespace){firstChild.value=firstChild.value.replace(LEADING_WHITESPACE_REGEXP,"");const parent=parentChain.at(-1);parent&&(parent.children.splice(parent.children.indexOf(node2),0,{type:"text",value:leadingWhitespace[0]}),fixWrappingWhitespace(parent,parentChain.slice(0,-1)))}}}if("children"in node2&&node2.children.length>0){const nodeAsParent=node2;nodeAsParent.children.forEach(child=>{fixWrappingWhitespace(child,[...parentChain,nodeAsParent])})}}const hasOwnProperty={}.hasOwnProperty;function syntaxExtension(all2,extension2){let hook;for(hook in extension2){const left=(hasOwnProperty.call(all2,hook)?all2[hook]:void 0)||(all2[hook]={}),right=extension2[hook];let code2;if(right)for(code2 in right){hasOwnProperty.call(left,code2)||(left[code2]=[]);const value=right[code2];constructs(left[code2],Array.isArray(value)?value:value?[value]:[])}}}function constructs(existing,list2){let index2=-1;const before=[];for(;++index2<list2.length;)("after"===list2[index2].add?existing:before).push(list2[index2]);splice(existing,0,0,before)}function normalizeIdentifier(value){return value.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const content$1={tokenize:function(effects){const contentStart=effects.attempt(this.parser.constructs.contentInitial,function(code2){if(null===code2)return void effects.consume(code2);return effects.enter("lineEnding"),effects.consume(code2),effects.exit("lineEnding"),factorySpace(effects,contentStart,"linePrefix")},function(code2){return effects.enter("paragraph"),lineStart(code2)});let previous2;return contentStart;function lineStart(code2){const token=effects.enter("chunkText",{contentType:"text",previous:previous2});return previous2&&(previous2.next=token),previous2=token,data(code2)}function data(code2){return null===code2?(effects.exit("chunkText"),effects.exit("paragraph"),void effects.consume(code2)):markdownLineEnding(code2)?(effects.consume(code2),effects.exit("chunkText"),lineStart):(effects.consume(code2),data)}}};const document$2={tokenize:function(effects){const self2=this,stack=[];let childFlow,childToken,lineStartOffset,continued=0;return start2;function start2(code2){if(continued<stack.length){const item=stack[continued];return self2.containerState=item[1],effects.attempt(item[0].continuation,documentContinue,checkNewContainers)(code2)}return checkNewContainers(code2)}function documentContinue(code2){if(continued++,self2.containerState._closeFlow){self2.containerState._closeFlow=void 0,childFlow&&closeFlow();const indexBeforeExits=self2.events.length;let point2,indexBeforeFlow=indexBeforeExits;for(;indexBeforeFlow--;)if("exit"===self2.events[indexBeforeFlow][0]&&"chunkFlow"===self2.events[indexBeforeFlow][1].type){point2=self2.events[indexBeforeFlow][1].end;break}exitContainers(continued);let index2=indexBeforeExits;for(;index2<self2.events.length;)self2.events[index2][1].end={...point2},index2++;return splice(self2.events,indexBeforeFlow+1,0,self2.events.slice(indexBeforeExits)),self2.events.length=index2,checkNewContainers(code2)}return start2(code2)}function checkNewContainers(code2){if(continued===stack.length){if(!childFlow)return documentContinued(code2);if(childFlow.currentConstruct&&childFlow.currentConstruct.concrete)return flowStart(code2);self2.interrupt=Boolean(childFlow.currentConstruct&&!childFlow._gfmTableDynamicInterruptHack)}return self2.containerState={},effects.check(containerConstruct,thereIsANewContainer,thereIsNoNewContainer)(code2)}function thereIsANewContainer(code2){return childFlow&&closeFlow(),exitContainers(continued),documentContinued(code2)}function thereIsNoNewContainer(code2){return self2.parser.lazy[self2.now().line]=continued!==stack.length,lineStartOffset=self2.now().offset,flowStart(code2)}function documentContinued(code2){return self2.containerState={},effects.attempt(containerConstruct,containerContinue,flowStart)(code2)}function containerContinue(code2){return continued++,stack.push([self2.currentConstruct,self2.containerState]),documentContinued(code2)}function flowStart(code2){return null===code2?(childFlow&&closeFlow(),exitContainers(0),void effects.consume(code2)):(childFlow=childFlow||self2.parser.flow(self2.now()),effects.enter("chunkFlow",{_tokenizer:childFlow,contentType:"flow",previous:childToken}),flowContinue(code2))}function flowContinue(code2){return null===code2?(writeToChild(effects.exit("chunkFlow"),!0),exitContainers(0),void effects.consume(code2)):markdownLineEnding(code2)?(effects.consume(code2),writeToChild(effects.exit("chunkFlow")),continued=0,self2.interrupt=void 0,start2):(effects.consume(code2),flowContinue)}function writeToChild(token,endOfFile){const stream=self2.sliceStream(token);if(endOfFile&&stream.push(null),token.previous=childToken,childToken&&(childToken.next=token),childToken=token,childFlow.defineSkip(token.start),childFlow.write(stream),self2.parser.lazy[token.start.line]){let index2=childFlow.events.length;for(;index2--;)if(childFlow.events[index2][1].start.offset<lineStartOffset&&(!childFlow.events[index2][1].end||childFlow.events[index2][1].end.offset>lineStartOffset))return;const indexBeforeExits=self2.events.length;let seen2,point2,indexBeforeFlow=indexBeforeExits;for(;indexBeforeFlow--;)if("exit"===self2.events[indexBeforeFlow][0]&&"chunkFlow"===self2.events[indexBeforeFlow][1].type){if(seen2){point2=self2.events[indexBeforeFlow][1].end;break}seen2=!0}for(exitContainers(continued),index2=indexBeforeExits;index2<self2.events.length;)self2.events[index2][1].end={...point2},index2++;splice(self2.events,indexBeforeFlow+1,0,self2.events.slice(indexBeforeExits)),self2.events.length=index2}}function exitContainers(size2){let index2=stack.length;for(;index2-- >size2;){const entry=stack[index2];self2.containerState=entry[1],entry[0].exit.call(self2,effects)}stack.length=size2}function closeFlow(){childFlow.write([null]),childToken=void 0,childFlow=void 0,self2.containerState._closeFlow=void 0}}},containerConstruct={tokenize:function(effects,ok2,nok){return factorySpace(effects,effects.attempt(this.parser.constructs.document,ok2,nok),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}};const attention={name:"attention",resolveAll:function(events,context){let open,group,text2,openingSequence,closingSequence,use,nextEvents,offset2,index2=-1;for(;++index2<events.length;)if("enter"===events[index2][0]&&"attentionSequence"===events[index2][1].type&&events[index2][1]._close)for(open=index2;open--;)if("exit"===events[open][0]&&"attentionSequence"===events[open][1].type&&events[open][1]._open&&context.sliceSerialize(events[open][1]).charCodeAt(0)===context.sliceSerialize(events[index2][1]).charCodeAt(0)){if((events[open][1]._close||events[index2][1]._open)&&(events[index2][1].end.offset-events[index2][1].start.offset)%3&&!((events[open][1].end.offset-events[open][1].start.offset+events[index2][1].end.offset-events[index2][1].start.offset)%3))continue;use=events[open][1].end.offset-events[open][1].start.offset>1&&events[index2][1].end.offset-events[index2][1].start.offset>1?2:1;const start2={...events[open][1].end},end={...events[index2][1].start};movePoint(start2,-use),movePoint(end,use),openingSequence={type:use>1?"strongSequence":"emphasisSequence",start:start2,end:{...events[open][1].end}},closingSequence={type:use>1?"strongSequence":"emphasisSequence",start:{...events[index2][1].start},end:end},text2={type:use>1?"strongText":"emphasisText",start:{...events[open][1].end},end:{...events[index2][1].start}},group={type:use>1?"strong":"emphasis",start:{...openingSequence.start},end:{...closingSequence.end}},events[open][1].end={...openingSequence.start},events[index2][1].start={...closingSequence.end},nextEvents=[],events[open][1].end.offset-events[open][1].start.offset&&(nextEvents=push(nextEvents,[["enter",events[open][1],context],["exit",events[open][1],context]])),nextEvents=push(nextEvents,[["enter",group,context],["enter",openingSequence,context],["exit",openingSequence,context],["enter",text2,context]]),nextEvents=push(nextEvents,resolveAll(context.parser.constructs.insideSpan.null,events.slice(open+1,index2),context)),nextEvents=push(nextEvents,[["exit",text2,context],["enter",closingSequence,context],["exit",closingSequence,context],["exit",group,context]]),events[index2][1].end.offset-events[index2][1].start.offset?(offset2=2,nextEvents=push(nextEvents,[["enter",events[index2][1],context],["exit",events[index2][1],context]])):offset2=0,splice(events,open-1,index2-open+3,nextEvents),index2=open+nextEvents.length-offset2-2;break}index2=-1;for(;++index2<events.length;)"attentionSequence"===events[index2][1].type&&(events[index2][1].type="data");return events},tokenize:function(effects,ok2){const attentionMarkers2=this.parser.constructs.attentionMarkers.null,previous2=this.previous,before=classifyCharacter(previous2);let marker;return function(code2){return marker=code2,effects.enter("attentionSequence"),inside(code2)};function inside(code2){if(code2===marker)return effects.consume(code2),inside;const token=effects.exit("attentionSequence"),after=classifyCharacter(code2),open=!after||2===after&&before||attentionMarkers2.includes(code2),close=!before||2===before&&after||attentionMarkers2.includes(previous2);return token._open=Boolean(42===marker?open:open&&(before||!close)),token._close=Boolean(42===marker?close:close&&(after||!open)),ok2(code2)}}};function movePoint(point2,offset2){point2.column+=offset2,point2.offset+=offset2,point2._bufferIndex+=offset2}const autolink={name:"autolink",tokenize:function(effects,ok2,nok){let size2=0;return function(code2){return effects.enter("autolink"),effects.enter("autolinkMarker"),effects.consume(code2),effects.exit("autolinkMarker"),effects.enter("autolinkProtocol"),open};function open(code2){return asciiAlpha(code2)?(effects.consume(code2),schemeOrEmailAtext):64===code2?nok(code2):emailAtext(code2)}function schemeOrEmailAtext(code2){return 43===code2||45===code2||46===code2||asciiAlphanumeric(code2)?(size2=1,schemeInsideOrEmailAtext(code2)):emailAtext(code2)}function schemeInsideOrEmailAtext(code2){return 58===code2?(effects.consume(code2),size2=0,urlInside):(43===code2||45===code2||46===code2||asciiAlphanumeric(code2))&&size2++<32?(effects.consume(code2),schemeInsideOrEmailAtext):(size2=0,emailAtext(code2))}function urlInside(code2){return 62===code2?(effects.exit("autolinkProtocol"),effects.enter("autolinkMarker"),effects.consume(code2),effects.exit("autolinkMarker"),effects.exit("autolink"),ok2):null===code2||32===code2||60===code2||asciiControl(code2)?nok(code2):(effects.consume(code2),urlInside)}function emailAtext(code2){return 64===code2?(effects.consume(code2),emailAtSignOrDot):asciiAtext(code2)?(effects.consume(code2),emailAtext):nok(code2)}function emailAtSignOrDot(code2){return asciiAlphanumeric(code2)?emailLabel(code2):nok(code2)}function emailLabel(code2){return 46===code2?(effects.consume(code2),size2=0,emailAtSignOrDot):62===code2?(effects.exit("autolinkProtocol").type="autolinkEmail",effects.enter("autolinkMarker"),effects.consume(code2),effects.exit("autolinkMarker"),effects.exit("autolink"),ok2):emailValue(code2)}function emailValue(code2){if((45===code2||asciiAlphanumeric(code2))&&size2++<63){const next=45===code2?emailValue:emailLabel;return effects.consume(code2),next}return nok(code2)}}};const blankLine={partial:!0,tokenize:function(effects,ok2,nok){return function(code2){return markdownSpace(code2)?factorySpace(effects,after,"linePrefix")(code2):after(code2)};function after(code2){return null===code2||markdownLineEnding(code2)?ok2(code2):nok(code2)}}};const blockQuote={continuation:{tokenize:function(effects,ok2,nok){const self2=this;return function(code2){if(markdownSpace(code2))return factorySpace(effects,contBefore,"linePrefix",self2.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(code2);return contBefore(code2)};function contBefore(code2){return effects.attempt(blockQuote,ok2,nok)(code2)}}},exit:function(effects){effects.exit("blockQuote")},name:"blockQuote",tokenize:function(effects,ok2,nok){const self2=this;return function(code2){if(62===code2){const state=self2.containerState;return state.open||(effects.enter("blockQuote",{_container:!0}),state.open=!0),effects.enter("blockQuotePrefix"),effects.enter("blockQuoteMarker"),effects.consume(code2),effects.exit("blockQuoteMarker"),after}return nok(code2)};function after(code2){return markdownSpace(code2)?(effects.enter("blockQuotePrefixWhitespace"),effects.consume(code2),effects.exit("blockQuotePrefixWhitespace"),effects.exit("blockQuotePrefix"),ok2):(effects.exit("blockQuotePrefix"),ok2(code2))}}};const characterEscape={name:"characterEscape",tokenize:function(effects,ok2,nok){return function(code2){return effects.enter("characterEscape"),effects.enter("escapeMarker"),effects.consume(code2),effects.exit("escapeMarker"),inside};function inside(code2){return asciiPunctuation(code2)?(effects.enter("characterEscapeValue"),effects.consume(code2),effects.exit("characterEscapeValue"),effects.exit("characterEscape"),ok2):nok(code2)}}};const characterReference={name:"characterReference",tokenize:function(effects,ok2,nok){const self2=this;let max2,test,size2=0;return function(code2){return effects.enter("characterReference"),effects.enter("characterReferenceMarker"),effects.consume(code2),effects.exit("characterReferenceMarker"),open};function open(code2){return 35===code2?(effects.enter("characterReferenceMarkerNumeric"),effects.consume(code2),effects.exit("characterReferenceMarkerNumeric"),numeric):(effects.enter("characterReferenceValue"),max2=31,test=asciiAlphanumeric,value(code2))}function numeric(code2){return 88===code2||120===code2?(effects.enter("characterReferenceMarkerHexadecimal"),effects.consume(code2),effects.exit("characterReferenceMarkerHexadecimal"),effects.enter("characterReferenceValue"),max2=6,test=asciiHexDigit,value):(effects.enter("characterReferenceValue"),max2=7,test=asciiDigit,value(code2))}function value(code2){if(59===code2&&size2){const token=effects.exit("characterReferenceValue");return test!==asciiAlphanumeric||decodeNamedCharacterReference(self2.sliceSerialize(token))?(effects.enter("characterReferenceMarker"),effects.consume(code2),effects.exit("characterReferenceMarker"),effects.exit("characterReference"),ok2):nok(code2)}return test(code2)&&size2++<max2?(effects.consume(code2),value):nok(code2)}}};const nonLazyContinuation={partial:!0,tokenize:function(effects,ok2,nok){const self2=this;return function(code2){if(null===code2)return nok(code2);return effects.enter("lineEnding"),effects.consume(code2),effects.exit("lineEnding"),lineStart};function lineStart(code2){return self2.parser.lazy[self2.now().line]?nok(code2):ok2(code2)}}},codeFenced={concrete:!0,name:"codeFenced",tokenize:function(effects,ok2,nok){const self2=this,closeStart={partial:!0,tokenize:function(effects2,ok3,nok2){let size2=0;return startBefore;function startBefore(code2){return effects2.enter("lineEnding"),effects2.consume(code2),effects2.exit("lineEnding"),start3}function start3(code2){return effects2.enter("codeFencedFence"),markdownSpace(code2)?factorySpace(effects2,beforeSequenceClose,"linePrefix",self2.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(code2):beforeSequenceClose(code2)}function beforeSequenceClose(code2){return code2===marker?(effects2.enter("codeFencedFenceSequence"),sequenceClose(code2)):nok2(code2)}function sequenceClose(code2){return code2===marker?(size2++,effects2.consume(code2),sequenceClose):size2>=sizeOpen?(effects2.exit("codeFencedFenceSequence"),markdownSpace(code2)?factorySpace(effects2,sequenceCloseAfter,"whitespace")(code2):sequenceCloseAfter(code2)):nok2(code2)}function sequenceCloseAfter(code2){return null===code2||markdownLineEnding(code2)?(effects2.exit("codeFencedFence"),ok3(code2)):nok2(code2)}}};let marker,initialPrefix=0,sizeOpen=0;return function(code2){return function(code2){const tail=self2.events[self2.events.length-1];return initialPrefix=tail&&"linePrefix"===tail[1].type?tail[2].sliceSerialize(tail[1],!0).length:0,marker=code2,effects.enter("codeFenced"),effects.enter("codeFencedFence"),effects.enter("codeFencedFenceSequence"),sequenceOpen(code2)}(code2)};function sequenceOpen(code2){return code2===marker?(sizeOpen++,effects.consume(code2),sequenceOpen):sizeOpen<3?nok(code2):(effects.exit("codeFencedFenceSequence"),markdownSpace(code2)?factorySpace(effects,infoBefore,"whitespace")(code2):infoBefore(code2))}function infoBefore(code2){return null===code2||markdownLineEnding(code2)?(effects.exit("codeFencedFence"),self2.interrupt?ok2(code2):effects.check(nonLazyContinuation,atNonLazyBreak,after)(code2)):(effects.enter("codeFencedFenceInfo"),effects.enter("chunkString",{contentType:"string"}),info(code2))}function info(code2){return null===code2||markdownLineEnding(code2)?(effects.exit("chunkString"),effects.exit("codeFencedFenceInfo"),infoBefore(code2)):markdownSpace(code2)?(effects.exit("chunkString"),effects.exit("codeFencedFenceInfo"),factorySpace(effects,metaBefore,"whitespace")(code2)):96===code2&&code2===marker?nok(code2):(effects.consume(code2),info)}function metaBefore(code2){return null===code2||markdownLineEnding(code2)?infoBefore(code2):(effects.enter("codeFencedFenceMeta"),effects.enter("chunkString",{contentType:"string"}),meta(code2))}function meta(code2){return null===code2||markdownLineEnding(code2)?(effects.exit("chunkString"),effects.exit("codeFencedFenceMeta"),infoBefore(code2)):96===code2&&code2===marker?nok(code2):(effects.consume(code2),meta)}function atNonLazyBreak(code2){return effects.attempt(closeStart,after,contentBefore)(code2)}function contentBefore(code2){return effects.enter("lineEnding"),effects.consume(code2),effects.exit("lineEnding"),contentStart}function contentStart(code2){return initialPrefix>0&&markdownSpace(code2)?factorySpace(effects,beforeContentChunk,"linePrefix",initialPrefix+1)(code2):beforeContentChunk(code2)}function beforeContentChunk(code2){return null===code2||markdownLineEnding(code2)?effects.check(nonLazyContinuation,atNonLazyBreak,after)(code2):(effects.enter("codeFlowValue"),contentChunk(code2))}function contentChunk(code2){return null===code2||markdownLineEnding(code2)?(effects.exit("codeFlowValue"),beforeContentChunk(code2)):(effects.consume(code2),contentChunk)}function after(code2){return effects.exit("codeFenced"),ok2(code2)}}};const codeIndented={name:"codeIndented",tokenize:function(effects,ok2,nok){const self2=this;return function(code2){return effects.enter("codeIndented"),factorySpace(effects,afterPrefix,"linePrefix",5)(code2)};function afterPrefix(code2){const tail=self2.events[self2.events.length-1];return tail&&"linePrefix"===tail[1].type&&tail[2].sliceSerialize(tail[1],!0).length>=4?atBreak(code2):nok(code2)}function atBreak(code2){return null===code2?after(code2):markdownLineEnding(code2)?effects.attempt(furtherStart,atBreak,after)(code2):(effects.enter("codeFlowValue"),inside(code2))}function inside(code2){return null===code2||markdownLineEnding(code2)?(effects.exit("codeFlowValue"),atBreak(code2)):(effects.consume(code2),inside)}function after(code2){return effects.exit("codeIndented"),ok2(code2)}}},furtherStart={partial:!0,tokenize:function(effects,ok2,nok){const self2=this;return furtherStart2;function furtherStart2(code2){return self2.parser.lazy[self2.now().line]?nok(code2):markdownLineEnding(code2)?(effects.enter("lineEnding"),effects.consume(code2),effects.exit("lineEnding"),furtherStart2):factorySpace(effects,afterPrefix,"linePrefix",5)(code2)}function afterPrefix(code2){const tail=self2.events[self2.events.length-1];return tail&&"linePrefix"===tail[1].type&&tail[2].sliceSerialize(tail[1],!0).length>=4?ok2(code2):markdownLineEnding(code2)?furtherStart2(code2):nok(code2)}}};const codeText={name:"codeText",previous:function(code2){return 96!==code2||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(events){let index2,enter,tailExitIndex=events.length-4,headEnterIndex=3;if(!("lineEnding"!==events[headEnterIndex][1].type&&"space"!==events[headEnterIndex][1].type||"lineEnding"!==events[tailExitIndex][1].type&&"space"!==events[tailExitIndex][1].type))for(index2=headEnterIndex;++index2<tailExitIndex;)if("codeTextData"===events[index2][1].type){events[headEnterIndex][1].type="codeTextPadding",events[tailExitIndex][1].type="codeTextPadding",headEnterIndex+=2,tailExitIndex-=2;break}index2=headEnterIndex-1,tailExitIndex++;for(;++index2<=tailExitIndex;)void 0===enter?index2!==tailExitIndex&&"lineEnding"!==events[index2][1].type&&(enter=index2):index2!==tailExitIndex&&"lineEnding"!==events[index2][1].type||(events[enter][1].type="codeTextData",index2!==enter+2&&(events[enter][1].end=events[index2-1][1].end,events.splice(enter+2,index2-enter-2),tailExitIndex-=index2-enter-2,index2=enter+2),enter=void 0);return events},tokenize:function(effects,ok2,nok){let size2,token,sizeOpen=0;return function(code2){return effects.enter("codeText"),effects.enter("codeTextSequence"),sequenceOpen(code2)};function sequenceOpen(code2){return 96===code2?(effects.consume(code2),sizeOpen++,sequenceOpen):(effects.exit("codeTextSequence"),between2(code2))}function between2(code2){return null===code2?nok(code2):32===code2?(effects.enter("space"),effects.consume(code2),effects.exit("space"),between2):96===code2?(token=effects.enter("codeTextSequence"),size2=0,sequenceClose(code2)):markdownLineEnding(code2)?(effects.enter("lineEnding"),effects.consume(code2),effects.exit("lineEnding"),between2):(effects.enter("codeTextData"),data(code2))}function data(code2){return null===code2||32===code2||96===code2||markdownLineEnding(code2)?(effects.exit("codeTextData"),between2(code2)):(effects.consume(code2),data)}function sequenceClose(code2){return 96===code2?(effects.consume(code2),size2++,sequenceClose):size2===sizeOpen?(effects.exit("codeTextSequence"),effects.exit("codeText"),ok2(code2)):(token.type="codeTextData",data(code2))}}};class SpliceBuffer{constructor(initial){this.left=initial?[...initial]:[],this.right=[]}get(index2){if(index2<0||index2>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+index2+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return index2<this.left.length?this.left[index2]:this.right[this.right.length-index2+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(start2,end){const stop=null==end?Number.POSITIVE_INFINITY:end;return stop<this.left.length?this.left.slice(start2,stop):start2>this.left.length?this.right.slice(this.right.length-stop+this.left.length,this.right.length-start2+this.left.length).reverse():this.left.slice(start2).concat(this.right.slice(this.right.length-stop+this.left.length).reverse())}splice(start2,deleteCount,items){const count2=deleteCount||0;this.setCursor(Math.trunc(start2));const removed=this.right.splice(this.right.length-count2,Number.POSITIVE_INFINITY);return items&&chunkedPush(this.left,items),removed.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(item){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(item)}pushMany(items){this.setCursor(Number.POSITIVE_INFINITY),chunkedPush(this.left,items)}unshift(item){this.setCursor(0),this.right.push(item)}unshiftMany(items){this.setCursor(0),chunkedPush(this.right,items.reverse())}setCursor(n2){if(!(n2===this.left.length||n2>this.left.length&&0===this.right.length||n2<0&&0===this.left.length))if(n2<this.left.length){const removed=this.left.splice(n2,Number.POSITIVE_INFINITY);chunkedPush(this.right,removed.reverse())}else{const removed=this.right.splice(this.left.length+this.right.length-n2,Number.POSITIVE_INFINITY);chunkedPush(this.left,removed.reverse())}}}function chunkedPush(list2,right){let chunkStart=0;if(right.length<1e4)list2.push(...right);else for(;chunkStart<right.length;)list2.push(...right.slice(chunkStart,chunkStart+1e4)),chunkStart+=1e4}function subtokenize(eventsArray){const jumps={};let event,lineIndex,otherIndex,otherEvent,parameters,subevents,more,index2=-1;const events=new SpliceBuffer(eventsArray);for(;++index2<events.length;){for(;index2 in jumps;)index2=jumps[index2];if(event=events.get(index2),index2&&"chunkFlow"===event[1].type&&"listItemPrefix"===events.get(index2-1)[1].type&&(subevents=event[1]._tokenizer.events,otherIndex=0,otherIndex<subevents.length&&"lineEndingBlank"===subevents[otherIndex][1].type&&(otherIndex+=2),otherIndex<subevents.length&&"content"===subevents[otherIndex][1].type))for(;++otherIndex<subevents.length&&"content"!==subevents[otherIndex][1].type;)"chunkText"===subevents[otherIndex][1].type&&(subevents[otherIndex][1]._isInFirstContentOfListItem=!0,otherIndex++);if("enter"===event[0])event[1].contentType&&(Object.assign(jumps,subcontent(events,index2)),index2=jumps[index2],more=!0);else if(event[1]._container){for(otherIndex=index2,lineIndex=void 0;otherIndex--;)if(otherEvent=events.get(otherIndex),"lineEnding"===otherEvent[1].type||"lineEndingBlank"===otherEvent[1].type)"enter"===otherEvent[0]&&(lineIndex&&(events.get(lineIndex)[1].type="lineEndingBlank"),otherEvent[1].type="lineEnding",lineIndex=otherIndex);else if("linePrefix"!==otherEvent[1].type&&"listItemIndent"!==otherEvent[1].type)break;lineIndex&&(event[1].end={...events.get(lineIndex)[1].start},parameters=events.slice(lineIndex,index2),parameters.unshift(event),events.splice(lineIndex,index2-lineIndex+1,parameters))}}return splice(eventsArray,0,Number.POSITIVE_INFINITY,events.slice(0)),!more}function subcontent(events,eventIndex){const token=events.get(eventIndex)[1],context=events.get(eventIndex)[2];let startPosition=eventIndex-1;const startPositions=[];let tokenizer=token._tokenizer;tokenizer||(tokenizer=context.parser[token.contentType](token.start),token._contentTypeTextTrailing&&(tokenizer._contentTypeTextTrailing=!0));const childEvents=tokenizer.events,jumps=[],gaps={};let stream,previous2,index2=-1,current=token,adjust=0,start2=0;const breaks=[start2];for(;current;){for(;events.get(++startPosition)[1]!==current;);startPositions.push(startPosition),current._tokenizer||(stream=context.sliceStream(current),current.next||stream.push(null),previous2&&tokenizer.defineSkip(current.start),current._isInFirstContentOfListItem&&(tokenizer._gfmTasklistFirstContentOfListItem=!0),tokenizer.write(stream),current._isInFirstContentOfListItem&&(tokenizer._gfmTasklistFirstContentOfListItem=void 0)),previous2=current,current=current.next}for(current=token;++index2<childEvents.length;)"exit"===childEvents[index2][0]&&"enter"===childEvents[index2-1][0]&&childEvents[index2][1].type===childEvents[index2-1][1].type&&childEvents[index2][1].start.line!==childEvents[index2][1].end.line&&(start2=index2+1,breaks.push(start2),current._tokenizer=void 0,current.previous=void 0,current=current.next);for(tokenizer.events=[],current?(current._tokenizer=void 0,current.previous=void 0):breaks.pop(),index2=breaks.length;index2--;){const slice=childEvents.slice(breaks[index2],breaks[index2+1]),start3=startPositions.pop();jumps.push([start3,start3+slice.length-1]),events.splice(start3,2,slice)}for(jumps.reverse(),index2=-1;++index2<jumps.length;)gaps[adjust+jumps[index2][0]]=adjust+jumps[index2][1],adjust+=jumps[index2][1]-jumps[index2][0]-1;return gaps}const content={resolve:function(events){return subtokenize(events),events},tokenize:function(effects,ok2){let previous2;return function(code2){return effects.enter("content"),previous2=effects.enter("chunkContent",{contentType:"content"}),chunkInside(code2)};function chunkInside(code2){return null===code2?contentEnd(code2):markdownLineEnding(code2)?effects.check(continuationConstruct,contentContinue,contentEnd)(code2):(effects.consume(code2),chunkInside)}function contentEnd(code2){return effects.exit("chunkContent"),effects.exit("content"),ok2(code2)}function contentContinue(code2){return effects.consume(code2),effects.exit("chunkContent"),previous2.next=effects.enter("chunkContent",{contentType:"content",previous:previous2}),previous2=previous2.next,chunkInside}}},continuationConstruct={partial:!0,tokenize:function(effects,ok2,nok){const self2=this;return function(code2){return effects.exit("chunkContent"),effects.enter("lineEnding"),effects.consume(code2),effects.exit("lineEnding"),factorySpace(effects,prefixed,"linePrefix")};function prefixed(code2){if(null===code2||markdownLineEnding(code2))return nok(code2);const tail=self2.events[self2.events.length-1];return!self2.parser.constructs.disable.null.includes("codeIndented")&&tail&&"linePrefix"===tail[1].type&&tail[2].sliceSerialize(tail[1],!0).length>=4?ok2(code2):effects.interrupt(self2.parser.constructs.flow,nok,ok2)(code2)}}};function factoryDestination(effects,ok2,nok,type,literalType,literalMarkerType,rawType,stringType,max2){const limit=max2||Number.POSITIVE_INFINITY;let balance=0;return function(code2){if(60===code2)return effects.enter(type),effects.enter(literalType),effects.enter(literalMarkerType),effects.consume(code2),effects.exit(literalMarkerType),enclosedBefore;if(null===code2||32===code2||41===code2||asciiControl(code2))return nok(code2);return effects.enter(type),effects.enter(rawType),effects.enter(stringType),effects.enter("chunkString",{contentType:"string"}),raw(code2)};function enclosedBefore(code2){return 62===code2?(effects.enter(literalMarkerType),effects.consume(code2),effects.exit(literalMarkerType),effects.exit(literalType),effects.exit(type),ok2):(effects.enter(stringType),effects.enter("chunkString",{contentType:"string"}),enclosed(code2))}function enclosed(code2){return 62===code2?(effects.exit("chunkString"),effects.exit(stringType),enclosedBefore(code2)):null===code2||60===code2||markdownLineEnding(code2)?nok(code2):(effects.consume(code2),92===code2?enclosedEscape:enclosed)}function enclosedEscape(code2){return 60===code2||62===code2||92===code2?(effects.consume(code2),enclosed):enclosed(code2)}function raw(code2){return balance||null!==code2&&41!==code2&&!markdownLineEndingOrSpace(code2)?balance<limit&&40===code2?(effects.consume(code2),balance++,raw):41===code2?(effects.consume(code2),balance--,raw):null===code2||32===code2||40===code2||asciiControl(code2)?nok(code2):(effects.consume(code2),92===code2?rawEscape:raw):(effects.exit("chunkString"),effects.exit(stringType),effects.exit(rawType),effects.exit(type),ok2(code2))}function rawEscape(code2){return 40===code2||41===code2||92===code2?(effects.consume(code2),raw):raw(code2)}}function factoryLabel(effects,ok2,nok,type,markerType,stringType){const self2=this;let seen2,size2=0;return function(code2){return effects.enter(type),effects.enter(markerType),effects.consume(code2),effects.exit(markerType),effects.enter(stringType),atBreak};function atBreak(code2){return size2>999||null===code2||91===code2||93===code2&&!seen2||94===code2&&!size2&&"_hiddenFootnoteSupport"in self2.parser.constructs?nok(code2):93===code2?(effects.exit(stringType),effects.enter(markerType),effects.consume(code2),effects.exit(markerType),effects.exit(type),ok2):markdownLineEnding(code2)?(effects.enter("lineEnding"),effects.consume(code2),effects.exit("lineEnding"),atBreak):(effects.enter("chunkString",{contentType:"string"}),labelInside(code2))}function labelInside(code2){return null===code2||91===code2||93===code2||markdownLineEnding(code2)||size2++>999?(effects.exit("chunkString"),atBreak(code2)):(effects.consume(code2),seen2||(seen2=!markdownSpace(code2)),92===code2?labelEscape:labelInside)}function labelEscape(code2){return 91===code2||92===code2||93===code2?(effects.consume(code2),size2++,labelInside):labelInside(code2)}}function factoryTitle(effects,ok2,nok,type,markerType,stringType){let marker;return function(code2){if(34===code2||39===code2||40===code2)return effects.enter(type),effects.enter(markerType),effects.consume(code2),effects.exit(markerType),marker=40===code2?41:code2,begin;return nok(code2)};function begin(code2){return code2===marker?(effects.enter(markerType),effects.consume(code2),effects.exit(markerType),effects.exit(type),ok2):(effects.enter(stringType),atBreak(code2))}function atBreak(code2){return code2===marker?(effects.exit(stringType),begin(marker)):null===code2?nok(code2):markdownLineEnding(code2)?(effects.enter("lineEnding"),effects.consume(code2),effects.exit("lineEnding"),factorySpace(effects,atBreak,"linePrefix")):(effects.enter("chunkString",{contentType:"string"}),inside(code2))}function inside(code2){return code2===marker||null===code2||markdownLineEnding(code2)?(effects.exit("chunkString"),atBreak(code2)):(effects.consume(code2),92===code2?escape:inside)}function escape(code2){return code2===marker||92===code2?(effects.consume(code2),inside):inside(code2)}}function factoryWhitespace(effects,ok2){let seen2;return function start2(code2){if(markdownLineEnding(code2))return effects.enter("lineEnding"),effects.consume(code2),effects.exit("lineEnding"),seen2=!0,start2;if(markdownSpace(code2))return factorySpace(effects,start2,seen2?"linePrefix":"lineSuffix")(code2);return ok2(code2)}}const definition={name:"definition",tokenize:function(effects,ok2,nok){const self2=this;let identifier;return function(code2){return effects.enter("definition"),function(code2){return factoryLabel.call(self2,effects,labelAfter,nok,"definitionLabel","definitionLabelMarker","definitionLabelString")(code2)}(code2)};function labelAfter(code2){return identifier=normalizeIdentifier(self2.sliceSerialize(self2.events[self2.events.length-1][1]).slice(1,-1)),58===code2?(effects.enter("definitionMarker"),effects.consume(code2),effects.exit("definitionMarker"),markerAfter):nok(code2)}function markerAfter(code2){return markdownLineEndingOrSpace(code2)?factoryWhitespace(effects,destinationBefore)(code2):destinationBefore(code2)}function destinationBefore(code2){return factoryDestination(effects,destinationAfter,nok,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(code2)}function destinationAfter(code2){return effects.attempt(titleBefore,after,after)(code2)}function after(code2){return markdownSpace(code2)?factorySpace(effects,afterWhitespace,"whitespace")(code2):afterWhitespace(code2)}function afterWhitespace(code2){return null===code2||markdownLineEnding(code2)?(effects.exit("definition"),self2.parser.defined.push(identifier),ok2(code2)):nok(code2)}}},titleBefore={partial:!0,tokenize:function(effects,ok2,nok){return function(code2){return markdownLineEndingOrSpace(code2)?factoryWhitespace(effects,beforeMarker)(code2):nok(code2)};function beforeMarker(code2){return factoryTitle(effects,titleAfter,nok,"definitionTitle","definitionTitleMarker","definitionTitleString")(code2)}function titleAfter(code2){return markdownSpace(code2)?factorySpace(effects,titleAfterOptionalWhitespace,"whitespace")(code2):titleAfterOptionalWhitespace(code2)}function titleAfterOptionalWhitespace(code2){return null===code2||markdownLineEnding(code2)?ok2(code2):nok(code2)}}};const hardBreakEscape={name:"hardBreakEscape",tokenize:function(effects,ok2,nok){return function(code2){return effects.enter("hardBreakEscape"),effects.consume(code2),after};function after(code2){return markdownLineEnding(code2)?(effects.exit("hardBreakEscape"),ok2(code2)):nok(code2)}}};const headingAtx={name:"headingAtx",resolve:function(events,context){let content2,text2,contentEnd=events.length-2,contentStart=3;"whitespace"===events[contentStart][1].type&&(contentStart+=2);contentEnd-2>contentStart&&"whitespace"===events[contentEnd][1].type&&(contentEnd-=2);"atxHeadingSequence"===events[contentEnd][1].type&&(contentStart===contentEnd-1||contentEnd-4>contentStart&&"whitespace"===events[contentEnd-2][1].type)&&(contentEnd-=contentStart+1===contentEnd?2:4);contentEnd>contentStart&&(content2={type:"atxHeadingText",start:events[contentStart][1].start,end:events[contentEnd][1].end},text2={type:"chunkText",start:events[contentStart][1].start,end:events[contentEnd][1].end,contentType:"text"},splice(events,contentStart,contentEnd-contentStart+1,[["enter",content2,context],["enter",text2,context],["exit",text2,context],["exit",content2,context]]));return events},tokenize:function(effects,ok2,nok){let size2=0;return function(code2){return effects.enter("atxHeading"),function(code2){return effects.enter("atxHeadingSequence"),sequenceOpen(code2)}(code2)};function sequenceOpen(code2){return 35===code2&&size2++<6?(effects.consume(code2),sequenceOpen):null===code2||markdownLineEndingOrSpace(code2)?(effects.exit("atxHeadingSequence"),atBreak(code2)):nok(code2)}function atBreak(code2){return 35===code2?(effects.enter("atxHeadingSequence"),sequenceFurther(code2)):null===code2||markdownLineEnding(code2)?(effects.exit("atxHeading"),ok2(code2)):markdownSpace(code2)?factorySpace(effects,atBreak,"whitespace")(code2):(effects.enter("atxHeadingText"),data(code2))}function sequenceFurther(code2){return 35===code2?(effects.consume(code2),sequenceFurther):(effects.exit("atxHeadingSequence"),atBreak(code2))}function data(code2){return null===code2||35===code2||markdownLineEndingOrSpace(code2)?(effects.exit("atxHeadingText"),atBreak(code2)):(effects.consume(code2),data)}}};const htmlBlockNames=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],htmlRawNames=["pre","script","style","textarea"],htmlFlow={concrete:!0,name:"htmlFlow",resolveTo:function(events){let index2=events.length;for(;index2--&&("enter"!==events[index2][0]||"htmlFlow"!==events[index2][1].type););index2>1&&"linePrefix"===events[index2-2][1].type&&(events[index2][1].start=events[index2-2][1].start,events[index2+1][1].start=events[index2-2][1].start,events.splice(index2-2,2));return events},tokenize:function(effects,ok2,nok){const self2=this;let marker,closingTag,buffer,index2,markerB;return function(code2){return function(code2){return effects.enter("htmlFlow"),effects.enter("htmlFlowData"),effects.consume(code2),open}(code2)};function open(code2){return 33===code2?(effects.consume(code2),declarationOpen):47===code2?(effects.consume(code2),closingTag=!0,tagCloseStart):63===code2?(effects.consume(code2),marker=3,self2.interrupt?ok2:continuationDeclarationInside):asciiAlpha(code2)?(effects.consume(code2),buffer=String.fromCharCode(code2),tagName):nok(code2)}function declarationOpen(code2){return 45===code2?(effects.consume(code2),marker=2,commentOpenInside):91===code2?(effects.consume(code2),marker=5,index2=0,cdataOpenInside):asciiAlpha(code2)?(effects.consume(code2),marker=4,self2.interrupt?ok2:continuationDeclarationInside):nok(code2)}function commentOpenInside(code2){return 45===code2?(effects.consume(code2),self2.interrupt?ok2:continuationDeclarationInside):nok(code2)}function cdataOpenInside(code2){return code2==="CDATA[".charCodeAt(index2++)?(effects.consume(code2),6===index2?self2.interrupt?ok2:continuation:cdataOpenInside):nok(code2)}function tagCloseStart(code2){return asciiAlpha(code2)?(effects.consume(code2),buffer=String.fromCharCode(code2),tagName):nok(code2)}function tagName(code2){if(null===code2||47===code2||62===code2||markdownLineEndingOrSpace(code2)){const slash=47===code2,name=buffer.toLowerCase();return slash||closingTag||!htmlRawNames.includes(name)?htmlBlockNames.includes(buffer.toLowerCase())?(marker=6,slash?(effects.consume(code2),basicSelfClosing):self2.interrupt?ok2(code2):continuation(code2)):(marker=7,self2.interrupt&&!self2.parser.lazy[self2.now().line]?nok(code2):closingTag?completeClosingTagAfter(code2):completeAttributeNameBefore(code2)):(marker=1,self2.interrupt?ok2(code2):continuation(code2))}return 45===code2||asciiAlphanumeric(code2)?(effects.consume(code2),buffer+=String.fromCharCode(code2),tagName):nok(code2)}function basicSelfClosing(code2){return 62===code2?(effects.consume(code2),self2.interrupt?ok2:continuation):nok(code2)}function completeClosingTagAfter(code2){return markdownSpace(code2)?(effects.consume(code2),completeClosingTagAfter):completeEnd(code2)}function completeAttributeNameBefore(code2){return 47===code2?(effects.consume(code2),completeEnd):58===code2||95===code2||asciiAlpha(code2)?(effects.consume(code2),completeAttributeName):markdownSpace(code2)?(effects.consume(code2),completeAttributeNameBefore):completeEnd(code2)}function completeAttributeName(code2){return 45===code2||46===code2||58===code2||95===code2||asciiAlphanumeric(code2)?(effects.consume(code2),completeAttributeName):completeAttributeNameAfter(code2)}function completeAttributeNameAfter(code2){return 61===code2?(effects.consume(code2),completeAttributeValueBefore):markdownSpace(code2)?(effects.consume(code2),completeAttributeNameAfter):completeAttributeNameBefore(code2)}function completeAttributeValueBefore(code2){return null===code2||60===code2||61===code2||62===code2||96===code2?nok(code2):34===code2||39===code2?(effects.consume(code2),markerB=code2,completeAttributeValueQuoted):markdownSpace(code2)?(effects.consume(code2),completeAttributeValueBefore):completeAttributeValueUnquoted(code2)}function completeAttributeValueQuoted(code2){return code2===markerB?(effects.consume(code2),markerB=null,completeAttributeValueQuotedAfter):null===code2||markdownLineEnding(code2)?nok(code2):(effects.consume(code2),completeAttributeValueQuoted)}function completeAttributeValueUnquoted(code2){return null===code2||34===code2||39===code2||47===code2||60===code2||61===code2||62===code2||96===code2||markdownLineEndingOrSpace(code2)?completeAttributeNameAfter(code2):(effects.consume(code2),completeAttributeValueUnquoted)}function completeAttributeValueQuotedAfter(code2){return 47===code2||62===code2||markdownSpace(code2)?completeAttributeNameBefore(code2):nok(code2)}function completeEnd(code2){return 62===code2?(effects.consume(code2),completeAfter):nok(code2)}function completeAfter(code2){return null===code2||markdownLineEnding(code2)?continuation(code2):markdownSpace(code2)?(effects.consume(code2),completeAfter):nok(code2)}function continuation(code2){return 45===code2&&2===marker?(effects.consume(code2),continuationCommentInside):60===code2&&1===marker?(effects.consume(code2),continuationRawTagOpen):62===code2&&4===marker?(effects.consume(code2),continuationClose):63===code2&&3===marker?(effects.consume(code2),continuationDeclarationInside):93===code2&&5===marker?(effects.consume(code2),continuationCdataInside):!markdownLineEnding(code2)||6!==marker&&7!==marker?null===code2||markdownLineEnding(code2)?(effects.exit("htmlFlowData"),continuationStart(code2)):(effects.consume(code2),continuation):(effects.exit("htmlFlowData"),effects.check(blankLineBefore,continuationAfter,continuationStart)(code2))}function continuationStart(code2){return effects.check(nonLazyContinuationStart,continuationStartNonLazy,continuationAfter)(code2)}function continuationStartNonLazy(code2){return effects.enter("lineEnding"),effects.consume(code2),effects.exit("lineEnding"),continuationBefore}function continuationBefore(code2){return null===code2||markdownLineEnding(code2)?continuationStart(code2):(effects.enter("htmlFlowData"),continuation(code2))}function continuationCommentInside(code2){return 45===code2?(effects.consume(code2),continuationDeclarationInside):continuation(code2)}function continuationRawTagOpen(code2){return 47===code2?(effects.consume(code2),buffer="",continuationRawEndTag):continuation(code2)}function continuationRawEndTag(code2){if(62===code2){const name=buffer.toLowerCase();return htmlRawNames.includes(name)?(effects.consume(code2),continuationClose):continuation(code2)}return asciiAlpha(code2)&&buffer.length<8?(effects.consume(code2),buffer+=String.fromCharCode(code2),continuationRawEndTag):continuation(code2)}function continuationCdataInside(code2){return 93===code2?(effects.consume(code2),continuationDeclarationInside):continuation(code2)}function continuationDeclarationInside(code2){return 62===code2?(effects.consume(code2),continuationClose):45===code2&&2===marker?(effects.consume(code2),continuationDeclarationInside):continuation(code2)}function continuationClose(code2){return null===code2||markdownLineEnding(code2)?(effects.exit("htmlFlowData"),continuationAfter(code2)):(effects.consume(code2),continuationClose)}function continuationAfter(code2){return effects.exit("htmlFlow"),ok2(code2)}}},blankLineBefore={partial:!0,tokenize:function(effects,ok2,nok){return function(code2){return effects.enter("lineEnding"),effects.consume(code2),effects.exit("lineEnding"),effects.attempt(blankLine,ok2,nok)}}},nonLazyContinuationStart={partial:!0,tokenize:function(effects,ok2,nok){const self2=this;return function(code2){if(markdownLineEnding(code2))return effects.enter("lineEnding"),effects.consume(code2),effects.exit("lineEnding"),after;return nok(code2)};function after(code2){return self2.parser.lazy[self2.now().line]?nok(code2):ok2(code2)}}};const htmlText={name:"htmlText",tokenize:function(effects,ok2,nok){const self2=this;let marker,index2,returnState;return function(code2){return effects.enter("htmlText"),effects.enter("htmlTextData"),effects.consume(code2),open};function open(code2){return 33===code2?(effects.consume(code2),declarationOpen):47===code2?(effects.consume(code2),tagCloseStart):63===code2?(effects.consume(code2),instruction):asciiAlpha(code2)?(effects.consume(code2),tagOpen):nok(code2)}function declarationOpen(code2){return 45===code2?(effects.consume(code2),commentOpenInside):91===code2?(effects.consume(code2),index2=0,cdataOpenInside):asciiAlpha(code2)?(effects.consume(code2),declaration):nok(code2)}function commentOpenInside(code2){return 45===code2?(effects.consume(code2),commentEnd):nok(code2)}function comment2(code2){return null===code2?nok(code2):45===code2?(effects.consume(code2),commentClose):markdownLineEnding(code2)?(returnState=comment2,lineEndingBefore(code2)):(effects.consume(code2),comment2)}function commentClose(code2){return 45===code2?(effects.consume(code2),commentEnd):comment2(code2)}function commentEnd(code2){return 62===code2?end(code2):45===code2?commentClose(code2):comment2(code2)}function cdataOpenInside(code2){return code2==="CDATA[".charCodeAt(index2++)?(effects.consume(code2),6===index2?cdata:cdataOpenInside):nok(code2)}function cdata(code2){return null===code2?nok(code2):93===code2?(effects.consume(code2),cdataClose):markdownLineEnding(code2)?(returnState=cdata,lineEndingBefore(code2)):(effects.consume(code2),cdata)}function cdataClose(code2){return 93===code2?(effects.consume(code2),cdataEnd):cdata(code2)}function cdataEnd(code2){return 62===code2?end(code2):93===code2?(effects.consume(code2),cdataEnd):cdata(code2)}function declaration(code2){return null===code2||62===code2?end(code2):markdownLineEnding(code2)?(returnState=declaration,lineEndingBefore(code2)):(effects.consume(code2),declaration)}function instruction(code2){return null===code2?nok(code2):63===code2?(effects.consume(code2),instructionClose):markdownLineEnding(code2)?(returnState=instruction,lineEndingBefore(code2)):(effects.consume(code2),instruction)}function instructionClose(code2){return 62===code2?end(code2):instruction(code2)}function tagCloseStart(code2){return asciiAlpha(code2)?(effects.consume(code2),tagClose):nok(code2)}function tagClose(code2){return 45===code2||asciiAlphanumeric(code2)?(effects.consume(code2),tagClose):tagCloseBetween(code2)}function tagCloseBetween(code2){return markdownLineEnding(code2)?(returnState=tagCloseBetween,lineEndingBefore(code2)):markdownSpace(code2)?(effects.consume(code2),tagCloseBetween):end(code2)}function tagOpen(code2){return 45===code2||asciiAlphanumeric(code2)?(effects.consume(code2),tagOpen):47===code2||62===code2||markdownLineEndingOrSpace(code2)?tagOpenBetween(code2):nok(code2)}function tagOpenBetween(code2){return 47===code2?(effects.consume(code2),end):58===code2||95===code2||asciiAlpha(code2)?(effects.consume(code2),tagOpenAttributeName):markdownLineEnding(code2)?(returnState=tagOpenBetween,lineEndingBefore(code2)):markdownSpace(code2)?(effects.consume(code2),tagOpenBetween):end(code2)}function tagOpenAttributeName(code2){return 45===code2||46===code2||58===code2||95===code2||asciiAlphanumeric(code2)?(effects.consume(code2),tagOpenAttributeName):tagOpenAttributeNameAfter(code2)}function tagOpenAttributeNameAfter(code2){return 61===code2?(effects.consume(code2),tagOpenAttributeValueBefore):markdownLineEnding(code2)?(returnState=tagOpenAttributeNameAfter,lineEndingBefore(code2)):markdownSpace(code2)?(effects.consume(code2),tagOpenAttributeNameAfter):tagOpenBetween(code2)}function tagOpenAttributeValueBefore(code2){return null===code2||60===code2||61===code2||62===code2||96===code2?nok(code2):34===code2||39===code2?(effects.consume(code2),marker=code2,tagOpenAttributeValueQuoted):markdownLineEnding(code2)?(returnState=tagOpenAttributeValueBefore,lineEndingBefore(code2)):markdownSpace(code2)?(effects.consume(code2),tagOpenAttributeValueBefore):(effects.consume(code2),tagOpenAttributeValueUnquoted)}function tagOpenAttributeValueQuoted(code2){return code2===marker?(effects.consume(code2),marker=void 0,tagOpenAttributeValueQuotedAfter):null===code2?nok(code2):markdownLineEnding(code2)?(returnState=tagOpenAttributeValueQuoted,lineEndingBefore(code2)):(effects.consume(code2),tagOpenAttributeValueQuoted)}function tagOpenAttributeValueUnquoted(code2){return null===code2||34===code2||39===code2||60===code2||61===code2||96===code2?nok(code2):47===code2||62===code2||markdownLineEndingOrSpace(code2)?tagOpenBetween(code2):(effects.consume(code2),tagOpenAttributeValueUnquoted)}function tagOpenAttributeValueQuotedAfter(code2){return 47===code2||62===code2||markdownLineEndingOrSpace(code2)?tagOpenBetween(code2):nok(code2)}function end(code2){return 62===code2?(effects.consume(code2),effects.exit("htmlTextData"),effects.exit("htmlText"),ok2):nok(code2)}function lineEndingBefore(code2){return effects.exit("htmlTextData"),effects.enter("lineEnding"),effects.consume(code2),effects.exit("lineEnding"),lineEndingAfter}function lineEndingAfter(code2){return markdownSpace(code2)?factorySpace(effects,lineEndingAfterPrefix,"linePrefix",self2.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(code2):lineEndingAfterPrefix(code2)}function lineEndingAfterPrefix(code2){return effects.enter("htmlTextData"),returnState(code2)}}};const labelEnd={name:"labelEnd",resolveAll:function(events){let index2=-1;const newEvents=[];for(;++index2<events.length;){const token=events[index2][1];if(newEvents.push(events[index2]),"labelImage"===token.type||"labelLink"===token.type||"labelEnd"===token.type){const offset2="labelImage"===token.type?4:2;token.type="data",index2+=offset2}}events.length!==newEvents.length&&splice(events,0,events.length,newEvents);return events},resolveTo:function(events,context){let token,open,close,media,index2=events.length,offset2=0;for(;index2--;)if(token=events[index2][1],open){if("link"===token.type||"labelLink"===token.type&&token._inactive)break;"enter"===events[index2][0]&&"labelLink"===token.type&&(token._inactive=!0)}else if(close){if("enter"===events[index2][0]&&("labelImage"===token.type||"labelLink"===token.type)&&!token._balanced&&(open=index2,"labelLink"!==token.type)){offset2=2;break}}else"labelEnd"===token.type&&(close=index2);const group={type:"labelLink"===events[open][1].type?"link":"image",start:{...events[open][1].start},end:{...events[events.length-1][1].end}},label={type:"label",start:{...events[open][1].start},end:{...events[close][1].end}},text2={type:"labelText",start:{...events[open+offset2+2][1].end},end:{...events[close-2][1].start}};return media=[["enter",group,context],["enter",label,context]],media=push(media,events.slice(open+1,open+offset2+3)),media=push(media,[["enter",text2,context]]),media=push(media,resolveAll(context.parser.constructs.insideSpan.null,events.slice(open+offset2+4,close-3),context)),media=push(media,[["exit",text2,context],events[close-2],events[close-1],["exit",label,context]]),media=push(media,events.slice(close+1)),media=push(media,[["exit",group,context]]),splice(events,open,events.length,media),events},tokenize:function(effects,ok2,nok){const self2=this;let labelStart,defined,index2=self2.events.length;for(;index2--;)if(("labelImage"===self2.events[index2][1].type||"labelLink"===self2.events[index2][1].type)&&!self2.events[index2][1]._balanced){labelStart=self2.events[index2][1];break}return function(code2){if(!labelStart)return nok(code2);if(labelStart._inactive)return labelEndNok(code2);return defined=self2.parser.defined.includes(normalizeIdentifier(self2.sliceSerialize({start:labelStart.end,end:self2.now()}))),effects.enter("labelEnd"),effects.enter("labelMarker"),effects.consume(code2),effects.exit("labelMarker"),effects.exit("labelEnd"),after};function after(code2){return 40===code2?effects.attempt(resourceConstruct,labelEndOk,defined?labelEndOk:labelEndNok)(code2):91===code2?effects.attempt(referenceFullConstruct,labelEndOk,defined?referenceNotFull:labelEndNok)(code2):defined?labelEndOk(code2):labelEndNok(code2)}function referenceNotFull(code2){return effects.attempt(referenceCollapsedConstruct,labelEndOk,labelEndNok)(code2)}function labelEndOk(code2){return ok2(code2)}function labelEndNok(code2){return labelStart._balanced=!0,nok(code2)}}},resourceConstruct={tokenize:function(effects,ok2,nok){return function(code2){return effects.enter("resource"),effects.enter("resourceMarker"),effects.consume(code2),effects.exit("resourceMarker"),resourceBefore};function resourceBefore(code2){return markdownLineEndingOrSpace(code2)?factoryWhitespace(effects,resourceOpen)(code2):resourceOpen(code2)}function resourceOpen(code2){return 41===code2?resourceEnd(code2):factoryDestination(effects,resourceDestinationAfter,resourceDestinationMissing,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(code2)}function resourceDestinationAfter(code2){return markdownLineEndingOrSpace(code2)?factoryWhitespace(effects,resourceBetween)(code2):resourceEnd(code2)}function resourceDestinationMissing(code2){return nok(code2)}function resourceBetween(code2){return 34===code2||39===code2||40===code2?factoryTitle(effects,resourceTitleAfter,nok,"resourceTitle","resourceTitleMarker","resourceTitleString")(code2):resourceEnd(code2)}function resourceTitleAfter(code2){return markdownLineEndingOrSpace(code2)?factoryWhitespace(effects,resourceEnd)(code2):resourceEnd(code2)}function resourceEnd(code2){return 41===code2?(effects.enter("resourceMarker"),effects.consume(code2),effects.exit("resourceMarker"),effects.exit("resource"),ok2):nok(code2)}}},referenceFullConstruct={tokenize:function(effects,ok2,nok){const self2=this;return function(code2){return factoryLabel.call(self2,effects,referenceFullAfter,referenceFullMissing,"reference","referenceMarker","referenceString")(code2)};function referenceFullAfter(code2){return self2.parser.defined.includes(normalizeIdentifier(self2.sliceSerialize(self2.events[self2.events.length-1][1]).slice(1,-1)))?ok2(code2):nok(code2)}function referenceFullMissing(code2){return nok(code2)}}},referenceCollapsedConstruct={tokenize:function(effects,ok2,nok){return function(code2){return effects.enter("reference"),effects.enter("referenceMarker"),effects.consume(code2),effects.exit("referenceMarker"),referenceCollapsedOpen};function referenceCollapsedOpen(code2){return 93===code2?(effects.enter("referenceMarker"),effects.consume(code2),effects.exit("referenceMarker"),effects.exit("reference"),ok2):nok(code2)}}};const labelStartImage={name:"labelStartImage",resolveAll:labelEnd.resolveAll,tokenize:function(effects,ok2,nok){const self2=this;return function(code2){return effects.enter("labelImage"),effects.enter("labelImageMarker"),effects.consume(code2),effects.exit("labelImageMarker"),open};function open(code2){return 91===code2?(effects.enter("labelMarker"),effects.consume(code2),effects.exit("labelMarker"),effects.exit("labelImage"),after):nok(code2)}function after(code2){return 94===code2&&"_hiddenFootnoteSupport"in self2.parser.constructs?nok(code2):ok2(code2)}}};const labelStartLink={name:"labelStartLink",resolveAll:labelEnd.resolveAll,tokenize:function(effects,ok2,nok){const self2=this;return function(code2){return effects.enter("labelLink"),effects.enter("labelMarker"),effects.consume(code2),effects.exit("labelMarker"),effects.exit("labelLink"),after};function after(code2){return 94===code2&&"_hiddenFootnoteSupport"in self2.parser.constructs?nok(code2):ok2(code2)}}};const lineEnding={name:"lineEnding",tokenize:function(effects,ok2){return function(code2){return effects.enter("lineEnding"),effects.consume(code2),effects.exit("lineEnding"),factorySpace(effects,ok2,"linePrefix")}}};const thematicBreak={name:"thematicBreak",tokenize:function(effects,ok2,nok){let marker,size2=0;return function(code2){return effects.enter("thematicBreak"),function(code2){return marker=code2,atBreak(code2)}(code2)};function atBreak(code2){return code2===marker?(effects.enter("thematicBreakSequence"),sequence(code2)):size2>=3&&(null===code2||markdownLineEnding(code2))?(effects.exit("thematicBreak"),ok2(code2)):nok(code2)}function sequence(code2){return code2===marker?(effects.consume(code2),size2++,sequence):(effects.exit("thematicBreakSequence"),markdownSpace(code2)?factorySpace(effects,atBreak,"whitespace")(code2):atBreak(code2))}}};const list={continuation:{tokenize:function(effects,ok2,nok){const self2=this;return self2.containerState._closeFlow=void 0,effects.check(blankLine,function(code2){return self2.containerState.furtherBlankLines=self2.containerState.furtherBlankLines||self2.containerState.initialBlankLine,factorySpace(effects,ok2,"listItemIndent",self2.containerState.size+1)(code2)},function(code2){if(self2.containerState.furtherBlankLines||!markdownSpace(code2))return self2.containerState.furtherBlankLines=void 0,self2.containerState.initialBlankLine=void 0,notInCurrentItem(code2);return self2.containerState.furtherBlankLines=void 0,self2.containerState.initialBlankLine=void 0,effects.attempt(indentConstruct,ok2,notInCurrentItem)(code2)});function notInCurrentItem(code2){return self2.containerState._closeFlow=!0,self2.interrupt=void 0,factorySpace(effects,effects.attempt(list,ok2,nok),"linePrefix",self2.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(code2)}}},exit:function(effects){effects.exit(this.containerState.type)},name:"list",tokenize:function(effects,ok2,nok){const self2=this,tail=self2.events[self2.events.length-1];let initialSize=tail&&"linePrefix"===tail[1].type?tail[2].sliceSerialize(tail[1],!0).length:0,size2=0;return function(code2){const kind=self2.containerState.type||(42===code2||43===code2||45===code2?"listUnordered":"listOrdered");if("listUnordered"===kind?!self2.containerState.marker||code2===self2.containerState.marker:asciiDigit(code2)){if(self2.containerState.type||(self2.containerState.type=kind,effects.enter(kind,{_container:!0})),"listUnordered"===kind)return effects.enter("listItemPrefix"),42===code2||45===code2?effects.check(thematicBreak,nok,atMarker)(code2):atMarker(code2);if(!self2.interrupt||49===code2)return effects.enter("listItemPrefix"),effects.enter("listItemValue"),inside(code2)}return nok(code2)};function inside(code2){return asciiDigit(code2)&&++size2<10?(effects.consume(code2),inside):(!self2.interrupt||size2<2)&&(self2.containerState.marker?code2===self2.containerState.marker:41===code2||46===code2)?(effects.exit("listItemValue"),atMarker(code2)):nok(code2)}function atMarker(code2){return effects.enter("listItemMarker"),effects.consume(code2),effects.exit("listItemMarker"),self2.containerState.marker=self2.containerState.marker||code2,effects.check(blankLine,self2.interrupt?nok:onBlank,effects.attempt(listItemPrefixWhitespaceConstruct,endOfPrefix,otherPrefix))}function onBlank(code2){return self2.containerState.initialBlankLine=!0,initialSize++,endOfPrefix(code2)}function otherPrefix(code2){return markdownSpace(code2)?(effects.enter("listItemPrefixWhitespace"),effects.consume(code2),effects.exit("listItemPrefixWhitespace"),endOfPrefix):nok(code2)}function endOfPrefix(code2){return self2.containerState.size=initialSize+self2.sliceSerialize(effects.exit("listItemPrefix"),!0).length,ok2(code2)}}},listItemPrefixWhitespaceConstruct={partial:!0,tokenize:function(effects,ok2,nok){const self2=this;return factorySpace(effects,function(code2){const tail=self2.events[self2.events.length-1];return!markdownSpace(code2)&&tail&&"listItemPrefixWhitespace"===tail[1].type?ok2(code2):nok(code2)},"listItemPrefixWhitespace",self2.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},indentConstruct={partial:!0,tokenize:function(effects,ok2,nok){const self2=this;return factorySpace(effects,function(code2){const tail=self2.events[self2.events.length-1];return tail&&"listItemIndent"===tail[1].type&&tail[2].sliceSerialize(tail[1],!0).length===self2.containerState.size?ok2(code2):nok(code2)},"listItemIndent",self2.containerState.size+1)}};const setextUnderline={name:"setextUnderline",resolveTo:function(events,context){let content2,text2,definition2,index2=events.length;for(;index2--;)if("enter"===events[index2][0]){if("content"===events[index2][1].type){content2=index2;break}"paragraph"===events[index2][1].type&&(text2=index2)}else"content"===events[index2][1].type&&events.splice(index2,1),definition2||"definition"!==events[index2][1].type||(definition2=index2);const heading2={type:"setextHeading",start:{...events[content2][1].start},end:{...events[events.length-1][1].end}};events[text2][1].type="setextHeadingText",definition2?(events.splice(text2,0,["enter",heading2,context]),events.splice(definition2+1,0,["exit",events[content2][1],context]),events[content2][1].end={...events[definition2][1].end}):events[content2][1]=heading2;return events.push(["exit",heading2,context]),events},tokenize:function(effects,ok2,nok){const self2=this;let marker;return function(code2){let paragraph2,index2=self2.events.length;for(;index2--;)if("lineEnding"!==self2.events[index2][1].type&&"linePrefix"!==self2.events[index2][1].type&&"content"!==self2.events[index2][1].type){paragraph2="paragraph"===self2.events[index2][1].type;break}if(!self2.parser.lazy[self2.now().line]&&(self2.interrupt||paragraph2))return effects.enter("setextHeadingLine"),marker=code2,function(code2){return effects.enter("setextHeadingLineSequence"),inside(code2)}(code2);return nok(code2)};function inside(code2){return code2===marker?(effects.consume(code2),inside):(effects.exit("setextHeadingLineSequence"),markdownSpace(code2)?factorySpace(effects,after,"lineSuffix")(code2):after(code2))}function after(code2){return null===code2||markdownLineEnding(code2)?(effects.exit("setextHeadingLine"),ok2(code2)):nok(code2)}}};const flow$1={tokenize:function(effects){const self2=this,initial=effects.attempt(blankLine,function(code2){if(null===code2)return void effects.consume(code2);return effects.enter("lineEndingBlank"),effects.consume(code2),effects.exit("lineEndingBlank"),self2.currentConstruct=void 0,initial},effects.attempt(this.parser.constructs.flowInitial,afterConstruct,factorySpace(effects,effects.attempt(this.parser.constructs.flow,afterConstruct,effects.attempt(content,afterConstruct)),"linePrefix")));return initial;function afterConstruct(code2){if(null!==code2)return effects.enter("lineEnding"),effects.consume(code2),effects.exit("lineEnding"),self2.currentConstruct=void 0,initial;effects.consume(code2)}}};const resolver={resolveAll:createResolver()},string$1=initializeFactory("string"),text$1=initializeFactory("text");function initializeFactory(field){return{resolveAll:createResolver("text"===field?resolveAllLineSuffixes:void 0),tokenize:function(effects){const self2=this,constructs2=this.parser.constructs[field],text2=effects.attempt(constructs2,start2,notText);return start2;function start2(code2){return atBreak(code2)?text2(code2):notText(code2)}function notText(code2){if(null!==code2)return effects.enter("data"),effects.consume(code2),data;effects.consume(code2)}function data(code2){return atBreak(code2)?(effects.exit("data"),text2(code2)):(effects.consume(code2),data)}function atBreak(code2){if(null===code2)return!0;const list2=constructs2[code2];let index2=-1;if(list2)for(;++index2<list2.length;){const item=list2[index2];if(!item.previous||item.previous.call(self2,self2.previous))return!0}return!1}}}}function createResolver(extraResolver){return function(events,context){let enter,index2=-1;for(;++index2<=events.length;)void 0===enter?events[index2]&&"data"===events[index2][1].type&&(enter=index2,index2++):events[index2]&&"data"===events[index2][1].type||(index2!==enter+2&&(events[enter][1].end=events[index2-1][1].end,events.splice(enter+2,index2-enter-2),index2=enter+2),enter=void 0);return extraResolver?extraResolver(events,context):events}}function resolveAllLineSuffixes(events,context){let eventIndex=0;for(;++eventIndex<=events.length;)if((eventIndex===events.length||"lineEnding"===events[eventIndex][1].type)&&"data"===events[eventIndex-1][1].type){const data=events[eventIndex-1][1],chunks=context.sliceStream(data);let tabs,index2=chunks.length,bufferIndex=-1,size2=0;for(;index2--;){const chunk=chunks[index2];if("string"==typeof chunk){for(bufferIndex=chunk.length;32===chunk.charCodeAt(bufferIndex-1);)size2++,bufferIndex--;if(bufferIndex)break;bufferIndex=-1}else if(-2===chunk)tabs=!0,size2++;else if(-1!==chunk){index2++;break}}if(context._contentTypeTextTrailing&&eventIndex===events.length&&(size2=0),size2){const token={type:eventIndex===events.length||tabs||size2<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:index2?bufferIndex:data.start._bufferIndex+bufferIndex,_index:data.start._index+index2,line:data.end.line,column:data.end.column-size2,offset:data.end.offset-size2},end:{...data.end}};data.end={...token.start},data.start.offset===data.end.offset?Object.assign(data,token):(events.splice(eventIndex,0,["enter",token,context],["exit",token,context]),eventIndex+=2)}eventIndex++}return events}const document$1={42:list,43:list,45:list,48:list,49:list,50:list,51:list,52:list,53:list,54:list,55:list,56:list,57:list,62:blockQuote},contentInitial={91:definition},flowInitial={[-2]:codeIndented,[-1]:codeIndented,32:codeIndented},flow={35:headingAtx,42:thematicBreak,45:[setextUnderline,thematicBreak],60:htmlFlow,61:setextUnderline,95:thematicBreak,96:codeFenced,126:codeFenced},string={38:characterReference,92:characterEscape},text={[-5]:lineEnding,[-4]:lineEnding,[-3]:lineEnding,33:labelStartImage,38:characterReference,42:attention,60:[autolink,htmlText],91:labelStartLink,92:[hardBreakEscape,characterEscape],93:labelEnd,95:attention,96:codeText},insideSpan={null:[attention,resolver]},defaultConstructs=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:contentInitial,disable:{null:[]},document:document$1,flow:flow,flowInitial:flowInitial,insideSpan:insideSpan,string:string,text:text},Symbol.toStringTag,{value:"Module"}));function createTokenizer(parser,initialize,from){let point2={_bufferIndex:-1,_index:0,line:from&&from.line||1,column:from&&from.column||1,offset:from&&from.offset||0};const columnStart={},resolveAllConstructs=[];let chunks=[],stack=[];const effects={attempt:constructFactory(function(construct,info){addResult(construct,info.from)}),check:constructFactory(onsuccessfulcheck),consume:function(code2){markdownLineEnding(code2)?(point2.line++,point2.column=1,point2.offset+=-3===code2?2:1,accountForPotentialSkip()):-1!==code2&&(point2.column++,point2.offset++);point2._bufferIndex<0?point2._index++:(point2._bufferIndex++,point2._bufferIndex===chunks[point2._index].length&&(point2._bufferIndex=-1,point2._index++));context.previous=code2},enter:function(type,fields){const token=fields||{};return token.type=type,token.start=now(),context.events.push(["enter",token,context]),stack.push(token),token},exit:function(type){const token=stack.pop();return token.end=now(),context.events.push(["exit",token,context]),token},interrupt:constructFactory(onsuccessfulcheck,{interrupt:!0})},context={code:null,containerState:{},defineSkip:function(value){columnStart[value.line]=value.column,accountForPotentialSkip()},events:[],now:now,parser:parser,previous:null,sliceSerialize:function(token,expandTabs){return function(chunks,expandTabs){let index2=-1;const result=[];let atTab;for(;++index2<chunks.length;){const chunk=chunks[index2];let value;if("string"==typeof chunk)value=chunk;else switch(chunk){case-5:value="\r";break;case-4:value="\n";break;case-3:value="\r\n";break;case-2:value=expandTabs?" ":"\t";break;case-1:if(!expandTabs&&atTab)continue;value=" ";break;default:value=String.fromCharCode(chunk)}atTab=-2===chunk,result.push(value)}return result.join("")}(sliceStream(token),expandTabs)},sliceStream:sliceStream,write:function(slice){if(chunks=push(chunks,slice),main(),null!==chunks[chunks.length-1])return[];return addResult(initialize,0),context.events=resolveAll(resolveAllConstructs,context.events,context),context.events}};let state=initialize.tokenize.call(context,effects);return initialize.resolveAll&&resolveAllConstructs.push(initialize),context;function sliceStream(token){return function(chunks,token){const startIndex=token.start._index,startBufferIndex=token.start._bufferIndex,endIndex=token.end._index,endBufferIndex=token.end._bufferIndex;let view;if(startIndex===endIndex)view=[chunks[startIndex].slice(startBufferIndex,endBufferIndex)];else{if(view=chunks.slice(startIndex,endIndex),startBufferIndex>-1){const head=view[0];"string"==typeof head?view[0]=head.slice(startBufferIndex):view.shift()}endBufferIndex>0&&view.push(chunks[endIndex].slice(0,endBufferIndex))}return view}(chunks,token)}function now(){const{_bufferIndex:_bufferIndex,_index:_index,line:line,column:column,offset:offset2}=point2;return{_bufferIndex:_bufferIndex,_index:_index,line:line,column:column,offset:offset2}}function main(){let chunkIndex;for(;point2._index<chunks.length;){const chunk=chunks[point2._index];if("string"==typeof chunk)for(chunkIndex=point2._index,point2._bufferIndex<0&&(point2._bufferIndex=0);point2._index===chunkIndex&&point2._bufferIndex<chunk.length;)go2(chunk.charCodeAt(point2._bufferIndex));else go2(chunk)}}function go2(code2){state=state(code2)}function onsuccessfulcheck(_2,info){info.restore()}function constructFactory(onreturn,fields){return function(constructs2,returnState,bogusState){let listOfConstructs,constructIndex,currentConstruct,info;return Array.isArray(constructs2)?handleListOfConstructs(constructs2):"tokenize"in constructs2?handleListOfConstructs([constructs2]):function(map2){return start2;function start2(code2){const left=null!==code2&&map2[code2],all2=null!==code2&&map2.null;return handleListOfConstructs([...Array.isArray(left)?left:left?[left]:[],...Array.isArray(all2)?all2:all2?[all2]:[]])(code2)}}(constructs2);function handleListOfConstructs(list2){return listOfConstructs=list2,constructIndex=0,0===list2.length?bogusState:handleConstruct(list2[constructIndex])}function handleConstruct(construct){return function(code2){info=function(){const startPoint=now(),startPrevious=context.previous,startCurrentConstruct=context.currentConstruct,startEventsIndex=context.events.length,startStack=Array.from(stack);return{from:startEventsIndex,restore:restore};function restore(){point2=startPoint,context.previous=startPrevious,context.currentConstruct=startCurrentConstruct,context.events.length=startEventsIndex,stack=startStack,accountForPotentialSkip()}}(),currentConstruct=construct,construct.partial||(context.currentConstruct=construct);if(construct.name&&context.parser.constructs.disable.null.includes(construct.name))return nok();return construct.tokenize.call(fields?Object.assign(Object.create(context),fields):context,effects,ok2,nok)(code2)}}function ok2(code2){return onreturn(currentConstruct,info),returnState}function nok(code2){return info.restore(),++constructIndex<listOfConstructs.length?handleConstruct(listOfConstructs[constructIndex]):bogusState}}}function addResult(construct,from2){construct.resolveAll&&!resolveAllConstructs.includes(construct)&&resolveAllConstructs.push(construct),construct.resolve&&splice(context.events,from2,context.events.length-from2,construct.resolve(context.events.slice(from2),context)),construct.resolveTo&&(context.events=construct.resolveTo(context.events,context))}function accountForPotentialSkip(){point2.line in columnStart&&point2.column<2&&(point2.column=columnStart[point2.line],point2.offset+=columnStart[point2.line]-1)}}function parse$1(options){const parser={constructs:function(extensions){const all2={};let index2=-1;for(;++index2<extensions.length;)syntaxExtension(all2,extensions[index2]);return all2}([defaultConstructs,...(options||{}).extensions||[]]),content:create(content$1),defined:[],document:create(document$2),flow:create(flow$1),lazy:{},string:create(string$1),text:create(text$1)};return parser;function create(initial){return function(from){return createTokenizer(parser,initial,from)}}}const search=/[\0\t\n\r]/g;const own={}.hasOwnProperty;function fromMarkdown(value,encoding,options){return encoding&&"object"==typeof encoding&&(options=encoding,encoding=void 0),function(options){const config={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:opener(link2),autolinkProtocol:onenterdata,autolinkEmail:onenterdata,atxHeading:opener(heading2),blockQuote:opener(blockQuote2),characterEscape:onenterdata,characterReference:onenterdata,codeFenced:opener(codeFlow),codeFencedFenceInfo:buffer,codeFencedFenceMeta:buffer,codeIndented:opener(codeFlow,buffer),codeText:opener(codeText2,buffer),codeTextData:onenterdata,data:onenterdata,codeFlowValue:onenterdata,definition:opener(definition2),definitionDestinationString:buffer,definitionLabelString:buffer,definitionTitleString:buffer,emphasis:opener(emphasis2),hardBreakEscape:opener(hardBreak2),hardBreakTrailing:opener(hardBreak2),htmlFlow:opener(html2,buffer),htmlFlowData:onenterdata,htmlText:opener(html2,buffer),htmlTextData:onenterdata,image:opener(image2),label:buffer,link:opener(link2),listItem:opener(listItem2),listItemValue:onenterlistitemvalue,listOrdered:opener(list2,onenterlistordered),listUnordered:opener(list2),paragraph:opener(paragraph2),reference:onenterreference,referenceString:buffer,resourceDestinationString:buffer,resourceTitleString:buffer,setextHeading:opener(heading2),strong:opener(strong2),thematicBreak:opener(thematicBreak2)},exit:{atxHeading:closer(),atxHeadingSequence:onexitatxheadingsequence,autolink:closer(),autolinkEmail:onexitautolinkemail,autolinkProtocol:onexitautolinkprotocol,blockQuote:closer(),characterEscapeValue:onexitdata,characterReferenceMarkerHexadecimal:onexitcharacterreferencemarker,characterReferenceMarkerNumeric:onexitcharacterreferencemarker,characterReferenceValue:onexitcharacterreferencevalue,characterReference:onexitcharacterreference,codeFenced:closer(onexitcodefenced),codeFencedFence:onexitcodefencedfence,codeFencedFenceInfo:onexitcodefencedfenceinfo,codeFencedFenceMeta:onexitcodefencedfencemeta,codeFlowValue:onexitdata,codeIndented:closer(onexitcodeindented),codeText:closer(onexitcodetext),codeTextData:onexitdata,data:onexitdata,definition:closer(),definitionDestinationString:onexitdefinitiondestinationstring,definitionLabelString:onexitdefinitionlabelstring,definitionTitleString:onexitdefinitiontitlestring,emphasis:closer(),hardBreakEscape:closer(onexithardbreak),hardBreakTrailing:closer(onexithardbreak),htmlFlow:closer(onexithtmlflow),htmlFlowData:onexitdata,htmlText:closer(onexithtmltext),htmlTextData:onexitdata,image:closer(onexitimage),label:onexitlabel,labelText:onexitlabeltext,lineEnding:onexitlineending,link:closer(onexitlink),listItem:closer(),listOrdered:closer(),listUnordered:closer(),paragraph:closer(),referenceString:onexitreferencestring,resourceDestinationString:onexitresourcedestinationstring,resourceTitleString:onexitresourcetitlestring,resource:onexitresource,setextHeading:closer(onexitsetextheading),setextHeadingLineSequence:onexitsetextheadinglinesequence,setextHeadingText:onexitsetextheadingtext,strong:closer(),thematicBreak:closer()}};configure(config,(options||{}).mdastExtensions||[]);const data={};return compile;function compile(events){let tree={type:"root",children:[]};const context={stack:[tree],tokenStack:[],config:config,enter:enter,exit:exit2,buffer:buffer,resume:resume,data:data},listStack=[];let index2=-1;for(;++index2<events.length;)if("listOrdered"===events[index2][1].type||"listUnordered"===events[index2][1].type)if("enter"===events[index2][0])listStack.push(index2);else{index2=prepareList(events,listStack.pop(),index2)}for(index2=-1;++index2<events.length;){const handler=config[events[index2][0]];own.call(handler,events[index2][1].type)&&handler[events[index2][1].type].call(Object.assign({sliceSerialize:events[index2][2].sliceSerialize},context),events[index2][1])}if(context.tokenStack.length>0){const tail=context.tokenStack[context.tokenStack.length-1];(tail[1]||defaultOnError).call(context,void 0,tail[0])}for(tree.position={start:point(events.length>0?events[0][1].start:{line:1,column:1,offset:0}),end:point(events.length>0?events[events.length-2][1].end:{line:1,column:1,offset:0})},index2=-1;++index2<config.transforms.length;)tree=config.transforms[index2](tree)||tree;return tree}function prepareList(events,start2,length){let listItem3,lineIndex,firstBlankLineIndex,atMarker,index2=start2-1,containerBalance=-1,listSpread=!1;for(;++index2<=length;){const event=events[index2];switch(event[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===event[0]?containerBalance++:containerBalance--,atMarker=void 0;break;case"lineEndingBlank":"enter"===event[0]&&(!listItem3||atMarker||containerBalance||firstBlankLineIndex||(firstBlankLineIndex=index2),atMarker=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:atMarker=void 0}if(!containerBalance&&"enter"===event[0]&&"listItemPrefix"===event[1].type||-1===containerBalance&&"exit"===event[0]&&("listUnordered"===event[1].type||"listOrdered"===event[1].type)){if(listItem3){let tailIndex=index2;for(lineIndex=void 0;tailIndex--;){const tailEvent=events[tailIndex];if("lineEnding"===tailEvent[1].type||"lineEndingBlank"===tailEvent[1].type){if("exit"===tailEvent[0])continue;lineIndex&&(events[lineIndex][1].type="lineEndingBlank",listSpread=!0),tailEvent[1].type="lineEnding",lineIndex=tailIndex}else if("linePrefix"!==tailEvent[1].type&&"blockQuotePrefix"!==tailEvent[1].type&&"blockQuotePrefixWhitespace"!==tailEvent[1].type&&"blockQuoteMarker"!==tailEvent[1].type&&"listItemIndent"!==tailEvent[1].type)break}firstBlankLineIndex&&(!lineIndex||firstBlankLineIndex<lineIndex)&&(listItem3._spread=!0),listItem3.end=Object.assign({},lineIndex?events[lineIndex][1].start:event[1].end),events.splice(lineIndex||index2,0,["exit",listItem3,event[2]]),index2++,length++}if("listItemPrefix"===event[1].type){const item={type:"listItem",_spread:!1,start:Object.assign({},event[1].start),end:void 0};listItem3=item,events.splice(index2,0,["enter",item,event[2]]),index2++,length++,firstBlankLineIndex=void 0,atMarker=!0}}}return events[start2][1]._spread=listSpread,length}function opener(create,and){return open;function open(token){enter.call(this,create(token),token),and&&and.call(this,token)}}function buffer(){this.stack.push({type:"fragment",children:[]})}function enter(node2,token,errorHandler){this.stack[this.stack.length-1].children.push(node2),this.stack.push(node2),this.tokenStack.push([token,errorHandler||void 0]),node2.position={start:point(token.start),end:void 0}}function closer(and){return close;function close(token){and&&and.call(this,token),exit2.call(this,token)}}function exit2(token,onExitError){const node2=this.stack.pop(),open=this.tokenStack.pop();if(!open)throw new Error("Cannot close `"+token.type+"` ("+stringifyPosition({start:token.start,end:token.end})+"): it’s not open");if(open[0].type!==token.type)if(onExitError)onExitError.call(this,token,open[0]);else{(open[1]||defaultOnError).call(this,token,open[0])}node2.position.end=point(token.end)}function resume(){return toString(this.stack.pop())}function onenterlistordered(){this.data.expectingFirstListItemValue=!0}function onenterlistitemvalue(token){if(this.data.expectingFirstListItemValue){this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(token),10),this.data.expectingFirstListItemValue=void 0}}function onexitcodefencedfenceinfo(){const data2=this.resume();this.stack[this.stack.length-1].lang=data2}function onexitcodefencedfencemeta(){const data2=this.resume();this.stack[this.stack.length-1].meta=data2}function onexitcodefencedfence(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function onexitcodefenced(){const data2=this.resume();this.stack[this.stack.length-1].value=data2.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function onexitcodeindented(){const data2=this.resume();this.stack[this.stack.length-1].value=data2.replace(/(\r?\n|\r)$/g,"")}function onexitdefinitionlabelstring(token){const label=this.resume(),node2=this.stack[this.stack.length-1];node2.label=label,node2.identifier=normalizeIdentifier(this.sliceSerialize(token)).toLowerCase()}function onexitdefinitiontitlestring(){const data2=this.resume();this.stack[this.stack.length-1].title=data2}function onexitdefinitiondestinationstring(){const data2=this.resume();this.stack[this.stack.length-1].url=data2}function onexitatxheadingsequence(token){const node2=this.stack[this.stack.length-1];if(!node2.depth){const depth=this.sliceSerialize(token).length;node2.depth=depth}}function onexitsetextheadingtext(){this.data.setextHeadingSlurpLineEnding=!0}function onexitsetextheadinglinesequence(token){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(token).codePointAt(0)?1:2}function onexitsetextheading(){this.data.setextHeadingSlurpLineEnding=void 0}function onenterdata(token){const siblings=this.stack[this.stack.length-1].children;let tail=siblings[siblings.length-1];tail&&"text"===tail.type||(tail=text2(),tail.position={start:point(token.start),end:void 0},siblings.push(tail)),this.stack.push(tail)}function onexitdata(token){const tail=this.stack.pop();tail.value+=this.sliceSerialize(token),tail.position.end=point(token.end)}function onexitlineending(token){const context=this.stack[this.stack.length-1];if(this.data.atHardBreak){return context.children[context.children.length-1].position.end=point(token.end),void(this.data.atHardBreak=void 0)}!this.data.setextHeadingSlurpLineEnding&&config.canContainEols.includes(context.type)&&(onenterdata.call(this,token),onexitdata.call(this,token))}function onexithardbreak(){this.data.atHardBreak=!0}function onexithtmlflow(){const data2=this.resume();this.stack[this.stack.length-1].value=data2}function onexithtmltext(){const data2=this.resume();this.stack[this.stack.length-1].value=data2}function onexitcodetext(){const data2=this.resume();this.stack[this.stack.length-1].value=data2}function onexitlink(){const node2=this.stack[this.stack.length-1];if(this.data.inReference){const referenceType=this.data.referenceType||"shortcut";node2.type+="Reference",node2.referenceType=referenceType,delete node2.url,delete node2.title}else delete node2.identifier,delete node2.label;this.data.referenceType=void 0}function onexitimage(){const node2=this.stack[this.stack.length-1];if(this.data.inReference){const referenceType=this.data.referenceType||"shortcut";node2.type+="Reference",node2.referenceType=referenceType,delete node2.url,delete node2.title}else delete node2.identifier,delete node2.label;this.data.referenceType=void 0}function onexitlabeltext(token){const string2=this.sliceSerialize(token),ancestor=this.stack[this.stack.length-2];ancestor.label=decodeString(string2),ancestor.identifier=normalizeIdentifier(string2).toLowerCase()}function onexitlabel(){const fragment=this.stack[this.stack.length-1],value=this.resume(),node2=this.stack[this.stack.length-1];if(this.data.inReference=!0,"link"===node2.type){const children=fragment.children;node2.children=children}else node2.alt=value}function onexitresourcedestinationstring(){const data2=this.resume();this.stack[this.stack.length-1].url=data2}function onexitresourcetitlestring(){const data2=this.resume();this.stack[this.stack.length-1].title=data2}function onexitresource(){this.data.inReference=void 0}function onenterreference(){this.data.referenceType="collapsed"}function onexitreferencestring(token){const label=this.resume(),node2=this.stack[this.stack.length-1];node2.label=label,node2.identifier=normalizeIdentifier(this.sliceSerialize(token)).toLowerCase(),this.data.referenceType="full"}function onexitcharacterreferencemarker(token){this.data.characterReferenceType=token.type}function onexitcharacterreferencevalue(token){const data2=this.sliceSerialize(token),type=this.data.characterReferenceType;let value;if(type)value=decodeNumericCharacterReference(data2,"characterReferenceMarkerNumeric"===type?10:16),this.data.characterReferenceType=void 0;else{value=decodeNamedCharacterReference(data2)}this.stack[this.stack.length-1].value+=value}function onexitcharacterreference(token){this.stack.pop().position.end=point(token.end)}function onexitautolinkprotocol(token){onexitdata.call(this,token);this.stack[this.stack.length-1].url=this.sliceSerialize(token)}function onexitautolinkemail(token){onexitdata.call(this,token);this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(token)}function blockQuote2(){return{type:"blockquote",children:[]}}function codeFlow(){return{type:"code",lang:null,meta:null,value:""}}function codeText2(){return{type:"inlineCode",value:""}}function definition2(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function emphasis2(){return{type:"emphasis",children:[]}}function heading2(){return{type:"heading",depth:0,children:[]}}function hardBreak2(){return{type:"break"}}function html2(){return{type:"html",value:""}}function image2(){return{type:"image",title:null,url:"",alt:null}}function link2(){return{type:"link",title:null,url:"",children:[]}}function list2(token){return{type:"list",ordered:"listOrdered"===token.type,start:null,spread:token._spread,children:[]}}function listItem2(token){return{type:"listItem",spread:token._spread,checked:null,children:[]}}function paragraph2(){return{type:"paragraph",children:[]}}function strong2(){return{type:"strong",children:[]}}function text2(){return{type:"text",value:""}}function thematicBreak2(){return{type:"thematicBreak"}}}(options)(function(events){for(;!subtokenize(events););return events}(parse$1(options).document().write(function(){let atCarriageReturn,column=1,buffer="",start2=!0;return function(value,encoding,end){const chunks=[];let match,next,startPosition,endPosition,code2;for(value=buffer+("string"==typeof value?value.toString():new TextDecoder(encoding||void 0).decode(value)),startPosition=0,buffer="",start2&&(65279===value.charCodeAt(0)&&startPosition++,start2=void 0);startPosition<value.length;){if(search.lastIndex=startPosition,match=search.exec(value),endPosition=match&&void 0!==match.index?match.index:value.length,code2=value.charCodeAt(endPosition),!match){buffer=value.slice(startPosition);break}if(10===code2&&startPosition===endPosition&&atCarriageReturn)chunks.push(-3),atCarriageReturn=void 0;else switch(atCarriageReturn&&(chunks.push(-5),atCarriageReturn=void 0),startPosition<endPosition&&(chunks.push(value.slice(startPosition,endPosition)),column+=endPosition-startPosition),code2){case 0:chunks.push(65533),column++;break;case 9:for(next=4*Math.ceil(column/4),chunks.push(-2);column++<next;)chunks.push(-1);break;case 10:chunks.push(-4),column=1;break;default:atCarriageReturn=!0,column=1}startPosition=endPosition+1}return end&&(atCarriageReturn&&chunks.push(-5),buffer&&chunks.push(buffer),chunks.push(null)),chunks}}()(value,encoding,!0))))}function point(d2){return{line:d2.line,column:d2.column,offset:d2.offset}}function configure(combined,extensions){let index2=-1;for(;++index2<extensions.length;){const value=extensions[index2];Array.isArray(value)?configure(combined,value):extension(combined,value)}}function extension(combined,extension2){let key;for(key in extension2)if(own.call(extension2,key))switch(key){case"canContainEols":{const right=extension2[key];right&&combined[key].push(...right);break}case"transforms":{const right=extension2[key];right&&combined[key].push(...right);break}case"enter":case"exit":{const right=extension2[key];right&&Object.assign(combined[key],right);break}}}function defaultOnError(left,right){throw left?new Error("Cannot close `"+left.type+"` ("+stringifyPosition({start:left.start,end:left.end})+"): a different token (`"+right.type+"`, "+stringifyPosition({start:right.start,end:right.end})+") is open"):new Error("Cannot close document, a token (`"+right.type+"`, "+stringifyPosition({start:right.start,end:right.end})+") is still open")}function isParent(node2){return node2.children instanceof Array}class MarkdownParseError extends Error{constructor(message,cause){super(message),this.name="MarkdownParseError",this.cause=cause}}class UnrecognizedMarkdownConstructError extends Error{constructor(message){super(message),this.name="UnrecognizedMarkdownConstructError"}}function importMdastTreeToLexical({root:root2,mdastRoot:mdastRoot,visitors:visitors,...descriptors}){const formattingMap=new WeakMap,styleMap=new WeakMap,metaData=function(mdastNode){const importsMap=new Map;return"root"!==mdastNode.type?{importDeclarations:{}}:(mdastNode.children.filter(n2=>"mdxjsEsm"===n2.type).filter(n2=>n2.value.startsWith("import ")).forEach(imp=>{var _a,_b;((null==(_b=null==(_a=imp.data)?void 0:_a.estree)?void 0:_b.body)??[]).forEach(declaration=>{"ImportDeclaration"===declaration.type&&declaration.specifiers.forEach(specifier=>{importsMap.set(specifier.local.name,{source:`${declaration.source.value}`,defaultExport:"ImportDefaultSpecifier"===specifier.type})})})}),{importDeclarations:Object.fromEntries(importsMap.entries())})}(mdastRoot);function visitChildren(mdastNode,lexicalParent){if(!isParent(mdastNode))throw new Error("Attempting to visit children of a non-parent");mdastNode.children.forEach(child=>{visit2(child,lexicalParent,mdastNode)})}function visit2(mdastNode,lexicalParent,mdastParent,skipVisitors=null){const visitor=visitors.find((visitor2,index2)=>!(null==skipVisitors?void 0:skipVisitors.has(index2))&&("string"==typeof visitor2.testNode?visitor2.testNode===mdastNode.type:visitor2.testNode(mdastNode,descriptors)));if(!visitor)try{throw new UnrecognizedMarkdownConstructError(`Unsupported markdown syntax: ${toMarkdown(mdastNode)}`)}catch(_e2){throw new UnrecognizedMarkdownConstructError(`Parsing of the following markdown structure failed: ${JSON.stringify({type:mdastNode.type,name:"name"in mdastNode?mdastNode.name:"N/A"})}`)}visitor.visitNode({mdastNode:mdastNode,lexicalParent:lexicalParent,mdastParent:mdastParent,descriptors:descriptors,metaData:metaData,actions:{visitChildren:visitChildren,nextVisitor(){visit2(mdastNode,lexicalParent,mdastParent,(skipVisitors??new Set).add(visitors.indexOf(visitor)))},addAndStepInto(lexicalNode){lexicalParent.append(lexicalNode),isParent(mdastNode)&&visitChildren(mdastNode,lexicalNode)},addFormatting(format,node2){node2||isParent(mdastNode)&&(node2=mdastNode),node2&&formattingMap.set(node2,format|(formattingMap.get(mdastParent)??0))},removeFormatting(format,node2){node2||isParent(mdastNode)&&(node2=mdastNode),node2&&formattingMap.set(node2,format^(formattingMap.get(mdastParent)??0))},getParentFormatting:()=>formattingMap.get(mdastParent)??0,addStyle(style,node2){node2||isParent(mdastNode)&&(node2=mdastNode),node2&&styleMap.set(node2,style)},getParentStyle:()=>styleMap.get(mdastParent)??""}})}visitors=visitors.sort((a2,b2)=>(b2.priority??0)-(a2.priority??0)),visit2(mdastRoot,root2,null)}var __defProp$3=Object.defineProperty,__publicField$3=(obj,key,value)=>(((obj,key,value)=>{key in obj?__defProp$3(obj,key,{enumerable:!0,configurable:!0,writable:!0,value:value}):obj[key]=value})(obj,"symbol"!=typeof key?key+"":key,value),value);class GenericHTMLNode extends di{constructor(tag,type,attributes,key){super(key),__publicField$3(this,"__tag"),__publicField$3(this,"__nodeType"),__publicField$3(this,"__attributes"),this.__tag=tag,this.__nodeType=type,this.__attributes=attributes}static getType(){return"generic-html"}static clone(node2){return new GenericHTMLNode(node2.__tag,node2.__nodeType,node2.__attributes,node2.__key)}getTag(){return this.__tag}getNodeType(){return this.__nodeType}getAttributes(){return this.__attributes}updateAttributes(attributes){this.getWritable().__attributes=attributes}getStyle(){var _a;return null==(_a=this.__attributes.find(attribute=>"style"===attribute.name))?void 0:_a.value}createDOM(){const tag=this.__tag,element2=document.createElement(tag);return this.__attributes.forEach(attribute=>{element2.setAttribute(attribute.name,attribute.value)}),element2}updateDOM(){return!1}static importDOM(){return{}}exportDOM(editor){const{element:element2}=super.exportDOM(editor);return{element:element2}}static importJSON(serializedNode){const node2=$createGenericHTMLNode(serializedNode.tag,serializedNode.mdxType,serializedNode.attributes);return node2.setFormat(serializedNode.format),node2.setIndent(serializedNode.indent),node2.setDirection(serializedNode.direction),node2}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),attributes:this.__attributes,mdxType:this.__nodeType,type:"generic-html",version:1}}extractWithChild(){return!0}isInline(){return"mdxJsxTextElement"===this.__nodeType}}function $createGenericHTMLNode(tag,type,attributes){return lo(new GenericHTMLNode(tag,type,attributes))}const LexicalGenericHTMLVisitor={testLexicalNode:function(node2){return node2 instanceof GenericHTMLNode},visitLexicalNode({actions:actions,lexicalNode:lexicalNode}){actions.addAndStepInto("mdxJsxTextElement",{name:lexicalNode.getTag(),type:lexicalNode.getNodeType(),attributes:lexicalNode.getAttributes()})},priority:-100},LexicalLinebreakVisitor={testLexicalNode:Ln,visitLexicalNode:({mdastParent:mdastParent,actions:actions})=>{actions.appendToParent(mdastParent,{type:"text",value:"\n"})}},LexicalParagraphVisitor={testLexicalNode:Li,visitLexicalNode:({actions:actions})=>{actions.addAndStepInto("paragraph")}},LexicalRootVisitor={testLexicalNode:mi,visitLexicalNode:({actions:actions})=>{actions.addAndStepInto("root")}};function isMdastText(mdastNode){return"text"===mdastNode.type}const JOINABLE_TAGS=["u","span","sub","sup"],LexicalTextVisitor={shouldJoin:(prevNode,currentNode)=>{if(["text","emphasis","strong","highlight"].includes(prevNode.type))return prevNode.type===currentNode.type;if("mdxJsxTextElement"===prevNode.type&&"mdxJsxTextElement"===currentNode.type&&JOINABLE_TAGS.includes(currentNode.name)){const currentMdxNode=currentNode;return prevNode.name===currentMdxNode.name&&JSON.stringify(prevNode.attributes)===JSON.stringify(currentMdxNode.attributes)}return!1},join:(prevNode,currentNode)=>isMdastText(prevNode)&&isMdastText(currentNode)?{type:"text",value:prevNode.value+currentNode.value}:{...prevNode,children:[...prevNode.children,...currentNode.children]},testLexicalNode:Zn,visitLexicalNode:({lexicalNode:lexicalNode,mdastParent:mdastParent,actions:actions})=>{const previousSibling=lexicalNode.getPreviousSibling(),prevFormat=Zn(previousSibling)?previousSibling.getFormat():0,textContent=lexicalNode.getTextContent(),format=lexicalNode.getFormat(),style=lexicalNode.getStyle();let localParentNode=mdastParent;style&&(localParentNode=actions.appendToParent(localParentNode,{type:"mdxJsxTextElement",name:"span",children:[],attributes:[{type:"mdxJsxAttribute",name:"style",value:style}]})),prevFormat&format&8&&(localParentNode=actions.appendToParent(localParentNode,{type:"mdxJsxTextElement",name:"u",children:[],attributes:[]})),prevFormat&format&64&&(localParentNode=actions.appendToParent(localParentNode,{type:"mdxJsxTextElement",name:"sup",children:[],attributes:[]})),prevFormat&format&32&&(localParentNode=actions.appendToParent(localParentNode,{type:"mdxJsxTextElement",name:"sub",children:[],attributes:[]})),prevFormat&format&2&&(localParentNode=actions.appendToParent(localParentNode,{type:"emphasis",children:[]})),prevFormat&format&1&&(localParentNode=actions.appendToParent(localParentNode,{type:"strong",children:[]})),prevFormat&format&4&&(localParentNode=actions.appendToParent(localParentNode,{type:"delete",children:[]})),prevFormat&format&128&&(localParentNode=actions.appendToParent(localParentNode,{type:"highlight",children:[]})),8&format&&!(8&prevFormat)&&(localParentNode=actions.appendToParent(localParentNode,{type:"mdxJsxTextElement",name:"u",children:[],attributes:[]})),64&format&&!(64&prevFormat)&&(localParentNode=actions.appendToParent(localParentNode,{type:"mdxJsxTextElement",name:"sup",children:[],attributes:[]})),32&format&&!(32&prevFormat)&&(localParentNode=actions.appendToParent(localParentNode,{type:"mdxJsxTextElement",name:"sub",children:[],attributes:[]})),2&format&&!(2&prevFormat)&&(localParentNode=actions.appendToParent(localParentNode,{type:"emphasis",children:[]})),1&format&&!(1&prevFormat)&&(localParentNode=actions.appendToParent(localParentNode,{type:"strong",children:[]})),4&format&&!(4&prevFormat)&&(localParentNode=actions.appendToParent(localParentNode,{type:"delete",children:[]})),128&format&&!(128&prevFormat)&&(localParentNode=actions.appendToParent(localParentNode,{type:"highlight",children:[]})),16&format?actions.appendToParent(localParentNode,{type:"inlineCode",value:textContent}):actions.appendToParent(localParentNode,{type:"text",value:textContent})}},MdastBreakVisitor={testNode:"break",visitNode:function({lexicalParent:lexicalParent}){lexicalParent.append(Fn())}};function buildFormattingVisitors(tag,format){return[{testNode:node2=>"mdxJsxTextElement"===node2.type&&node2.name===tag,visitNode({actions:actions,mdastNode:mdastNode,lexicalParent:lexicalParent}){actions.addFormatting(format),actions.visitChildren(mdastNode,lexicalParent)}},{testNode:node2=>"html"===node2.type&&node2.value===`<${tag}>`,visitNode({actions:actions,mdastParent:mdastParent}){actions.addFormatting(format,mdastParent)}},{testNode:node2=>"html"===node2.type&&node2.value===`</${tag}>`,visitNode({actions:actions,mdastParent:mdastParent}){actions.removeFormatting(format,mdastParent)}}]}const StrikeThroughVisitor={testNode:"delete",visitNode({mdastNode:mdastNode,actions:actions,lexicalParent:lexicalParent}){actions.addFormatting(4),actions.visitChildren(mdastNode,lexicalParent)}},HighlightVisitor={testNode:"highlight",visitNode({mdastNode:mdastNode,actions:actions,lexicalParent:lexicalParent}){actions.addFormatting(128),actions.visitChildren(mdastNode,lexicalParent)}},MdCodeVisitor={testNode:"inlineCode",visitNode({mdastNode:mdastNode,actions:actions}){actions.addAndStepInto(Qn(mdastNode.value).setFormat(16|actions.getParentFormatting()))}},formattingVisitors=[{testNode:"emphasis",visitNode({mdastNode:mdastNode,actions:actions,lexicalParent:lexicalParent}){actions.addFormatting(2),actions.visitChildren(mdastNode,lexicalParent)}},{testNode:"strong",visitNode({mdastNode:mdastNode,actions:actions,lexicalParent:lexicalParent}){actions.addFormatting(1),actions.visitChildren(mdastNode,lexicalParent)}},...buildFormattingVisitors("u",8),...buildFormattingVisitors("code",16),MdCodeVisitor,StrikeThroughVisitor,HighlightVisitor,...buildFormattingVisitors("sup",64),...buildFormattingVisitors("sub",32)],MdastHTMLVisitor={testNode:isMdastHTMLNode,visitNode:function({mdastNode:mdastNode,actions:actions,lexicalParent:lexicalParent}){"span"===mdastNode.name&&1===mdastNode.attributes.length&&"mdxJsxAttribute"===mdastNode.attributes[0].type&&"style"===mdastNode.attributes[0].name?(actions.addStyle(mdastNode.attributes[0].value,mdastNode),actions.visitChildren(mdastNode,lexicalParent)):actions.addAndStepInto($createGenericHTMLNode(mdastNode.name,mdastNode.type,mdastNode.attributes))},priority:-100},lexicalTypesThatShouldSkipParagraphs=["listitem","admonition"],MdastParagraphVisitor={testNode:"paragraph",visitNode:function({mdastNode:mdastNode,lexicalParent:lexicalParent,actions:actions}){lexicalTypesThatShouldSkipParagraphs.includes(lexicalParent.getType())?actions.visitChildren(mdastNode,lexicalParent):actions.addAndStepInto(Fi())}},MdastRootVisitor={testNode:"root",visitNode({actions:actions,mdastNode:mdastNode,lexicalParent:lexicalParent}){actions.visitChildren(mdastNode,lexicalParent)}},MdastTextVisitor={testNode:"text",visitNode({mdastNode:mdastNode,actions:actions}){const node2=Qn(mdastNode.value);node2.setFormat(actions.getParentFormatting());const style=actions.getParentStyle();""!==style&&node2.setStyle(style),actions.addAndStepInto(node2)}},SharedHistoryPlugin=()=>React__default.createElement(a$3,{externalHistoryState:E$4(historyState$)});const tokenize2=(effects,ok2,nok)=>{return function(code2){return effects.enter("comment"),effects.consume(code2),open};function open(code2){return code2===codes_exclamationMark?(effects.consume(code2),declarationOpen):nok(code2)}function declarationOpen(code2){return code2===codes_dash?(effects.consume(code2),commentOpen):nok(code2)}function commentOpen(code2){return code2===codes_dash?(effects.consume(code2),commentStart):nok(code2)}function commentStart(code2){return code2===codes_greaterThan?nok(code2):markdownLineEnding(code2)?atLineEnding(code2):(effects.enter(types_data),code2===codes_dash?(effects.consume(code2),commentStartDash):comment2(code2))}function commentStartDash(code2){return code2===codes_greaterThan?nok(code2):comment2(code2)}function comment2(code2){return code2===codes_eof?nok(code2):code2===codes_dash?(effects.consume(code2),commentClose):markdownLineEnding(code2)?(effects.exit(types_data),atLineEnding(code2)):(effects.consume(code2),comment2)}function atLineEnding(code2){return effects.enter(types_lineEnding),effects.consume(code2),effects.exit(types_lineEnding),factorySpace(effects,afterPrefix,types_linePrefix)}function afterPrefix(code2){return markdownLineEnding(code2)?atLineEnding(code2):(effects.enter(types_data),comment2(code2))}function commentClose(code2){return code2===codes_dash?(effects.consume(code2),end):comment2(code2)}function end(code2){return code2===codes_greaterThan?(effects.exit(types_data),effects.enter("commentEnd"),effects.consume(code2),effects.exit("commentEnd"),effects.exit("comment"),ok2(code2)):code2===codes_dash?(effects.consume(code2),end):comment2(code2)}},comment={flow:{60:{tokenize:tokenize2,concrete:!0}},text:{60:{tokenize:tokenize2}}},lexicalTheme={text:{bold:"_bold_1tncs_10",italic:"_italic_1tncs_14",underline:"_underline_1tncs_18",code:"_code_1tncs_52",strikethrough:"_strikethrough_1tncs_34",subscript:"_subscript_1tncs_42",superscript:"_superscript_1tncs_47",underlineStrikethrough:"_underlineStrikethrough_1tncs_38"},list:{listitem:"_listitem_1tncs_69",listitemChecked:"_listItemChecked_1tncs_73",listitemUnchecked:"_listItemUnchecked_1tncs_74",nested:{listitem:"_nestedListItem_1tncs_59"}},admonition:{danger:"_admonitionDanger_1tncs_151",info:"_admonitionInfo_1tncs_152",note:"_admonitionNote_1tncs_153",tip:"_admonitionTip_1tncs_154",caution:"_admonitionCaution_1tncs_155"}},NESTED_EDITOR_UPDATED_COMMAND=oe$1("NESTED_EDITOR_UPDATED_COMMAND"),rootEditor$=$$4(null),activeEditor$=$$4(null),contentEditableClassName$=$$4(""),spellCheck$=$$4(!0),readOnly$=$$4(!1,r2=>{r2.sub(r2.pipe(readOnly$,tt$4(rootEditor$)),([readOnly,rootEditor])=>{null==rootEditor||rootEditor.setEditable(!readOnly)})}),placeholder$=$$4(""),autoFocus$=$$4(!1),inFocus$=$$4(!1),currentFormat$=$$4(0),markdownProcessingError$=$$4(null),markdownErrorSignal$=K$3(r2=>{r2.link(r2.pipe(markdownProcessingError$,nt$4(e2=>null!==e2)),markdownErrorSignal$)}),applyFormat$=K$3(r2=>{r2.sub(r2.pipe(applyFormat$,tt$4(activeEditor$)),([format,theEditor])=>{null==theEditor||theEditor.dispatchCommand(me,format)})}),currentSelection$=$$4(null,r2=>{r2.sub(r2.pipe(currentSelection$,tt$4(activeEditor$)),([selection2,theEditor])=>{if(!selection2||!theEditor)return;const anchorNode=selection2.anchor.getNode();let element2="root"===anchorNode.getKey()?anchorNode:wt$2(anchorNode,e2=>{const parent=e2.getParent();return null!==parent&&so(parent)});element2??(element2=anchorNode.getTopLevelElementOrThrow());const elementKey=element2.getKey();if(null!==theEditor.getElementByKey(elementKey)){const blockType=Ft$1(element2)?element2.getTag():element2.getType();r2.pub(currentBlockType$,blockType)}})}),initialMarkdown$=$$4(""),markdown$=$$4(""),initialMarkdownNormalize$=$$4(!1),markdownSignal$=K$3(r2=>{r2.link(markdown$,markdownSignal$),r2.sub(initialMarkdown$,md=>{r2.pubIn({[initialMarkdownNormalize$]:!0,[markdown$]:md})})}),mutableMarkdownSignal$=K$3(r2=>{r2.link(r2.pipe(markdownSignal$,tt$4(muteChange$),nt$4(([,muted])=>!muted),_$3(([value])=>value)),mutableMarkdownSignal$)},!0),importVisitors$=$$4([]),usedLexicalNodes$=$$4([]),syntaxExtensions$=$$4([]),mdastExtensions$=$$4([]),exportVisitors$=$$4([]),toMarkdownExtensions$=$$4([]),toMarkdownOptions$=$$4({}),jsxIsAvailable$=$$4(!1),jsxComponentDescriptors$=$$4([]),directiveDescriptors$=$$4([]),codeBlockEditorDescriptors$=$$4([]),editorRootElementRef$=$$4(null),editorWrapperElementRef$=$$4(null),contentEditableRef$=$$4(null),addLexicalNode$=Appender(usedLexicalNodes$),addImportVisitor$=Appender(importVisitors$),addSyntaxExtension$=Appender(syntaxExtensions$),addMdastExtension$=Appender(mdastExtensions$),addExportVisitor$=Appender(exportVisitors$),addToMarkdownExtension$=Appender(toMarkdownExtensions$),muteChange$=$$4(!1),setMarkdown$=K$3(r2=>{r2.sub(r2.pipe(setMarkdown$,tt$4(markdown$,rootEditor$,inFocus$),nt$4(([newMarkdown,oldMarkdown])=>newMarkdown.trim()!==oldMarkdown.trim())),([theNewMarkdownValue,,editor,inFocus])=>{r2.pub(muteChange$,!0),null==editor||editor.update(()=>{Ss().clear(),tryImportingMarkdown(r2,Ss(),theNewMarkdownValue),inFocus?editor.focus():ks(null)},{onUpdate:()=>{r2.pub(muteChange$,!1)}})})}),insertMarkdown$=K$3(r2=>{r2.sub(r2.pipe(insertMarkdown$,tt$4(activeEditor$,inFocus$)),([markdownToInsert,editor,inFocus])=>{null==editor||editor.update(()=>{const selection2=wr();if(null!==selection2){const importPoint={children:[],append(node2){this.children.push(node2)},getType:()=>selection2.getNodes()[0].getType()};tryImportingMarkdown(r2,importPoint,markdownToInsert),Lr(importPoint.children)}inFocus?editor.focus():ks(null)})})});function rebind(){return it$4((teardowns,[subs,activeEditorValue])=>(teardowns.forEach(teardown=>{if(!teardown)throw new Error("You have a subscription that does not return a teardown");teardown()}),activeEditorValue?subs.map(s2=>s2(activeEditorValue)):[]),[])}const contentEditableWrapperElement$=$$4(null),activeEditorSubscriptions$=$$4([],r2=>{r2.pipe(r2.combine(activeEditorSubscriptions$,activeEditor$),rebind())}),rootEditorSubscriptions$=$$4([],r2=>{r2.pipe(r2.combine(rootEditorSubscriptions$,rootEditor$),rebind())}),editorInFocus$=$$4(null,noop$2,(prev,next)=>Boolean(prev&&next&&prev.editorRef===next.editorRef)),onBlur$=K$3(),iconComponentFor$=$$4(name=>{throw new Error(`No icon component for ${name}`)});function Appender(cell$,init2){return K$3((r2,sig$)=>{r2.changeWith(cell$,sig$,(values,newValue)=>{Array.isArray(newValue)||(newValue=[newValue]);let result=values;for(const v2 of newValue)values.includes(v2)||(result=[...result,v2]);return result}),null==init2||init2(r2,sig$)})}function handleSelectionChange(r2){const selection2=wr();ar(selection2)&&r2.pubIn({[currentSelection$]:selection2,[currentFormat$]:selection2.format})}const createRootEditorSubscription$=Appender(rootEditorSubscriptions$,(r2,sig$)=>{r2.pub(sig$,[rootEditor=>rootEditor.registerCommand(le,(_2,theActiveEditor)=>(r2.pubIn({[activeEditor$]:theActiveEditor,[inFocus$]:!0}),null===theActiveEditor._parentEditor&&theActiveEditor.getEditorState().read(()=>{r2.pub(editorInFocus$,{rootNode:Ss(),editorType:"lexical",editorRef:theActiveEditor})}),handleSelectionChange(r2),!1),4),rootEditor=>rootEditor.registerUpdateListener(({dirtyElements:dirtyElements,dirtyLeaves:dirtyLeaves,editorState:editorState})=>{if(null!==r2.getValue(markdownProcessingError$))return;if(0===dirtyElements.size&&0===dirtyLeaves.size)return;let theNewMarkdownValue;editorState.read(()=>{Ss().getLastChild()instanceof _i&&rootEditor.update(()=>{Ss().append(Fi())},{discrete:!0}),theNewMarkdownValue=function({root:root2,toMarkdownOptions:toMarkdownOptions,toMarkdownExtensions:toMarkdownExtensions,visitors:visitors,jsxComponentDescriptors:jsxComponentDescriptors,jsxIsAvailable:jsxIsAvailable}){return toMarkdown(exportLexicalTreeToMdast({root:root2,visitors:visitors,jsxComponentDescriptors:jsxComponentDescriptors,jsxIsAvailable:jsxIsAvailable}),{extensions:toMarkdownExtensions,...toMarkdownOptions})+"\n"}({root:Ss(),visitors:r2.getValue(exportVisitors$),jsxComponentDescriptors:r2.getValue(jsxComponentDescriptors$),toMarkdownExtensions:r2.getValue(toMarkdownExtensions$),toMarkdownOptions:r2.getValue(toMarkdownOptions$),jsxIsAvailable:r2.getValue(jsxIsAvailable$)})}),r2.pub(markdown$,theNewMarkdownValue.trim()),r2.pub(initialMarkdownNormalize$,!1)}),rootEditor=>rootEditor.registerCommand(qe,()=>(r2.pub(inFocus$,!0),!1),4)])}),createActiveEditorSubscription$=Appender(activeEditorSubscriptions$,(r2,sig$)=>{r2.pub(sig$,[editor=>editor.registerUpdateListener(({editorState:editorState})=>{editorState.read(()=>{handleSelectionChange(r2)})}),editor=>editor.registerCommand(Ge,payload=>{var _a;const theRootEditor=r2.getValue(rootEditor$);if(theRootEditor){!(null==(_a=theRootEditor.getRootElement())?void 0:_a.contains(payload.relatedTarget))&&r2.pubIn({[inFocus$]:!1,[onBlur$]:payload})}return!1},4)])});function tryImportingMarkdown(r2,node2,markdownValue){try{!function({root:root2,markdown:markdown2,visitors:visitors,syntaxExtensions:syntaxExtensions,mdastExtensions:mdastExtensions,...descriptors}){var _a;let mdastRoot;try{mdastRoot=fromMarkdown(markdown2,{extensions:syntaxExtensions,mdastExtensions:mdastExtensions})}catch(e2){throw e2 instanceof Error?new MarkdownParseError(`Error parsing markdown: ${e2.message}`,e2):new MarkdownParseError(`Error parsing markdown: ${e2}`,e2)}0===mdastRoot.children.length&&mdastRoot.children.push({type:"paragraph",children:[]}),"paragraph"!==(null==(_a=mdastRoot.children.at(-1))?void 0:_a.type)&&mdastRoot.children.push({type:"paragraph",children:[]}),importMdastTreeToLexical({root:root2,mdastRoot:mdastRoot,visitors:visitors,...descriptors})}({root:node2,visitors:r2.getValue(importVisitors$),mdastExtensions:r2.getValue(mdastExtensions$),markdown:markdownValue,syntaxExtensions:r2.getValue(syntaxExtensions$),jsxComponentDescriptors:r2.getValue(jsxComponentDescriptors$),directiveDescriptors:r2.getValue(directiveDescriptors$),codeBlockEditorDescriptors:r2.getValue(codeBlockEditorDescriptors$)}),r2.pub(markdownProcessingError$,null)}catch(e2){if(!(e2 instanceof MarkdownParseError||e2 instanceof UnrecognizedMarkdownConstructError))throw e2;r2.pubIn({[markdown$]:markdownValue,[markdownProcessingError$]:{error:e2.message,source:markdownValue}})}}const composerChildren$=$$4([]),addComposerChild$=Appender(composerChildren$),topAreaChildren$=$$4([]),addTopAreaChild$=Appender(topAreaChildren$),bottomAreaChildren$=$$4([]),addBottomAreaChild$=Appender(bottomAreaChildren$),editorWrappers$=$$4([]),addEditorWrapper$=Appender(editorWrappers$),addNestedEditorChild$=Appender($$4([])),tableCellEditorChildren$=$$4([]),addTableCellEditorChild$=Appender(tableCellEditorChildren$),editorInTable$=$$4(!1,r2=>{r2.link(r2.pipe(activeEditor$,_$3(editor=>{var _a,_b;return["td","th"].includes((null==(_b=null==(_a=null==editor?void 0:editor.getRootElement())?void 0:_a.parentNode)?void 0:_b.nodeName.toLowerCase())??"")})),editorInTable$)}),historyState$=$$4({current:null,redoStack:[],undoStack:[]}),currentBlockType$=$$4("");K$3();const convertSelectionToNode$=K$3(r2=>{r2.sub(r2.pipe(convertSelectionToNode$,tt$4(activeEditor$)),([factory,editor])=>{null==editor||editor.update(()=>{const selection2=wr();ar(selection2)&&(!function(e2,t2,n2=j$3){if(null===e2)return;const o2=e2.getStartEndPoints(),l2=new Map;let s2=null;if(o2){const[e3,t3]=o2;s2=kr(),s2.anchor.set(e3.key,e3.offset,e3.type),s2.focus.set(t3.key,t3.offset,t3.type);const n3=oe(e3.getNode(),vo),i2=oe(t3.getNode(),vo);hi(n3)&&l2.set(n3.getKey(),n3),hi(i2)&&l2.set(i2.getKey(),i2)}for(const t3 of e2.getNodes())if(hi(t3)&&vo(t3))l2.set(t3.getKey(),t3);else if(null===o2){const e3=oe(t3,vo);hi(e3)&&l2.set(e3.getKey(),e3)}for(const[e3,o3]of l2){const l3=t2();n2(o3,l3),o3.replace(l3,!0),s2&&(e3===s2.anchor.key&&s2.anchor.set(l3.getKey(),s2.anchor.offset,s2.anchor.type),e3===s2.focus.key&&s2.focus.set(l3.getKey(),s2.focus.offset,s2.focus.type))}s2&&e2.is(wr())&&ks(s2)}(selection2,factory),setTimeout(()=>{editor.focus()}))})})}),insertDecoratorNode$=K$3(r2=>{r2.sub(r2.pipe(insertDecoratorNode$,tt$4(activeEditor$)),([nodeFactory,theEditor])=>{null==theEditor||theEditor.focus(()=>{theEditor.getEditorState().read(()=>{ar(wr())&&(theEditor.update(()=>{const node2=nodeFactory();node2.isInline()?(Lr([node2]),so(node2.getParentOrThrow())&&Ct$3(node2,Fi).selectEnd()):St$3(node2),setTimeout(()=>{"select"in node2&&"function"==typeof node2.select&&node2.select()})}),setTimeout(()=>{theEditor.dispatchCommand(NESTED_EDITOR_UPDATED_COMMAND,void 0)}))})},{defaultSelection:"rootEnd"})})}),viewMode$=$$4("rich-text",r2=>{function currentNextViewMode(){return it$4((prev,next)=>({current:prev.next,next:next}),{current:"rich-text",next:"rich-text"})}r2.sub(r2.pipe(viewMode$,currentNextViewMode(),tt$4(markdownSourceEditorValue$)),([{current:current},markdownSourceFromEditor])=>{"source"!==current&&"diff"!==current||r2.pub(setMarkdown$,markdownSourceFromEditor)}),r2.sub(r2.pipe(viewMode$,currentNextViewMode(),nt$4(mode=>"rich-text"===mode.current),tt$4(activeEditor$)),([,editor])=>{null==editor||editor.dispatchCommand(NESTED_EDITOR_UPDATED_COMMAND,void 0)})}),markdownSourceEditorValue$=$$4("",r2=>{r2.link(markdown$,markdownSourceEditorValue$),r2.link(markdownSourceEditorValue$,markdownSignal$)},!0),activePlugins$=$$4([]),addActivePlugin$=Appender(activePlugins$),translation$=$$4(()=>{throw new Error("No translation function provided")}),lexicalTheme$=$$4(lexicalTheme),corePlugin=realmPlugin({init(r2,params){const initialMarkdown=(null==params?void 0:params.initialMarkdown)??"";r2.register(createRootEditorSubscription$),r2.register(createActiveEditorSubscription$),r2.register(markdownSignal$),r2.register(markdownSourceEditorValue$),r2.pubIn({[initialMarkdown$]:(null==params?void 0:params.trim)?initialMarkdown.trim():initialMarkdown,[iconComponentFor$]:null==params?void 0:params.iconComponentFor,[addImportVisitor$]:[MdastRootVisitor,MdastParagraphVisitor,MdastTextVisitor,MdastBreakVisitor,...formattingVisitors],[addLexicalNode$]:[Pi,$n,GenericHTMLNode],[addExportVisitor$]:[LexicalRootVisitor,LexicalParagraphVisitor,LexicalTextVisitor,LexicalLinebreakVisitor,LexicalGenericHTMLVisitor],[contentEditableClassName$]:null==params?void 0:params.contentEditableClassName,[spellCheck$]:null==params?void 0:params.spellCheck,[toMarkdownOptions$]:null==params?void 0:params.toMarkdownOptions,[autoFocus$]:null==params?void 0:params.autoFocus,[placeholder$]:null==params?void 0:params.placeholder,[readOnly$]:null==params?void 0:params.readOnly,[translation$]:null==params?void 0:params.translation,[addMdastExtension$]:[{canContainEols:["delete"],enter:{strikethrough:enterStrikethrough},exit:{strikethrough:exitStrikethrough}},highlightMarkFromMarkdown],[addSyntaxExtension$]:[gfmStrikethrough(),highlightMark()],[addToMarkdownExtension$]:[mdxJsxToMarkdown(),{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:constructsWithoutStrikethrough}],handlers:{delete:handleDelete}},highlightMarkToMarkdown],[lexicalTheme$]:(null==params?void 0:params.lexicalTheme)??lexicalTheme}),r2.singletonSub(markdownErrorSignal$,null==params?void 0:params.onError),r2.singletonSub(mutableMarkdownSignal$,value=>{null==params||params.onChange(value,r2.getValue(initialMarkdownNormalize$))}),r2.singletonSub(onBlur$,null==params?void 0:params.onBlur),(null==params?void 0:params.suppressHtmlProcessing)||r2.pubIn({[addMdastExtension$]:[mdxJsxFromMarkdown(),{canContainEols:["comment"],enter:{comment(_2){this.buffer()}},exit:{comment(token){this.resume()}}}],[addSyntaxExtension$]:[mdxJsx(),{disable:{null:["autolink","codeIndented","htmlFlow","htmlText"]}},comment],[addImportVisitor$]:MdastHTMLVisitor}),(null==params?void 0:params.suppressSharedHistory)||r2.pub(addComposerChild$,SharedHistoryPlugin)},postInit(r2,params){const newEditor=Ji({editable:!0!==(null==params?void 0:params.readOnly),namespace:(null==params?void 0:params.lexicalEditorNamespace)??"MDXEditor",nodes:[...r2.getValue(usedLexicalNodes$),...(null==params?void 0:params.additionalLexicalNodes)??[]],onError:error=>{throw error},theme:r2.getValue(lexicalTheme$)});null!==(null==params?void 0:params.editorState)&&newEditor.update(()=>{const markdown2=(null==params?void 0:params.initialMarkdown.trim())??"";tryImportingMarkdown(r2,Ss(),markdown2);const autoFocusValue=null==params?void 0:params.autoFocus;if(autoFocusValue){if(!0===autoFocusValue)return void setTimeout(()=>{newEditor.focus(noop$2,{defaultSelection:"rootStart"})});setTimeout(()=>{newEditor.focus(noop$2,{defaultSelection:autoFocusValue.defaultSelection??"rootStart"})})}}),r2.pub(rootEditor$,newEditor),r2.pub(activeEditor$,newEditor)},update(realm,params){realm.pubIn({[contentEditableClassName$]:null==params?void 0:params.contentEditableClassName,[spellCheck$]:null==params?void 0:params.spellCheck,[toMarkdownOptions$]:null==params?void 0:params.toMarkdownOptions,[autoFocus$]:null==params?void 0:params.autoFocus,[placeholder$]:null==params?void 0:params.placeholder,[readOnly$]:null==params?void 0:params.readOnly}),realm.singletonSub(mutableMarkdownSignal$,value=>{null==params||params.onChange(value,realm.getValue(initialMarkdownNormalize$))}),realm.singletonSub(onBlur$,null==params?void 0:params.onBlur),realm.singletonSub(markdownErrorSignal$,null==params?void 0:params.onError)}});function useTranslation(){return E$4(translation$)}function f$4(t2,e2=!0){if(t2)return!1;let n2=Ss().getTextContent();return e2&&(n2=n2.trim()),""===n2}function g$2(t2){return()=>function(o2){if(!f$4(o2,!1))return!1;const l2=Ss().getChildren(),s2=l2.length;if(s2>1)return!1;for(let t2=0;t2<s2;t2++){const o3=l2[t2];if(pi(o3))return!1;if(hi(o3)){if(!Li(o3))return!1;if(0!==o3.__indent)return!1;const e2=o3.getChildren(),n2=e2.length;for(let r2=0;r2<n2;r2++)if(!Zn(e2[t2]))return!1}}return!0}(t2)}const m$2="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?reactExports.useLayoutEffect:reactExports.useEffect;const b$2=reactExports.forwardRef(function({editor:e2,ariaActiveDescendant:t2,ariaAutoComplete:i2,ariaControls:a2,ariaDescribedBy:d2,ariaErrorMessage:c2,ariaExpanded:s2,ariaInvalid:u2,ariaLabel:f3,ariaLabelledBy:b2,ariaMultiline:p2,ariaOwns:x2,ariaRequired:E2,autoCapitalize:v2,className:w2,id:y2,role:C2="textbox",spellCheck:g2=!0,style:h2,tabIndex:L2,"data-testid":D2,...I2},R2){const[k3,q2]=reactExports.useState(e2.isEditable()),z2=reactExports.useCallback(t3=>{t3&&t3.ownerDocument&&t3.ownerDocument.defaultView?e2.setRootElement(t3):e2.setRootElement(null)},[e2]),A2=reactExports.useMemo(()=>function(...e3){return t3=>{e3.forEach(e4=>{"function"==typeof e4?e4(t3):null!=e4&&(e4.current=t3)})}}(R2,z2),[z2,R2]);return m$2(()=>(q2(e2.isEditable()),e2.registerEditableListener(e3=>{q2(e3)})),[e2]),jsxRuntimeExports.jsx("div",{"aria-activedescendant":k3?t2:void 0,"aria-autocomplete":k3?i2:"none","aria-controls":k3?a2:void 0,"aria-describedby":d2,...null!=c2?{"aria-errormessage":c2}:{},"aria-expanded":k3&&"combobox"===C2?!!s2:void 0,...null!=u2?{"aria-invalid":u2}:{},"aria-label":f3,"aria-labelledby":b2,"aria-multiline":p2,"aria-owns":k3?x2:void 0,"aria-readonly":!k3||void 0,"aria-required":E2,autoCapitalize:v2,className:w2,contentEditable:k3,"data-testid":D2,id:y2,ref:A2,role:C2,spellCheck:g2,style:h2,tabIndex:L2,...I2})});function p$2(e2){return e2.getEditorState().read(g$2(e2.isComposing()))}const x$3=reactExports.forwardRef(function(t2,i2){const{placeholder:a2,...r2}=t2,[n2]=o$5();return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(b$2,{editor:n2,...r2,ref:i2}),null!=a2&&jsxRuntimeExports.jsx(v$2,{editor:n2,content:a2})]})});function v$2({content:e2,editor:i2}){const a2=function(e3){const[t2,i3]=reactExports.useState(()=>p$2(e3));return m$2(()=>{function t3(){const t4=p$2(e3);i3(t4)}return t3(),j$2(e3.registerUpdateListener(()=>{t3()}),e3.registerEditableListener(()=>{t3()}))},[e3]),t2}(i2),[n2,o2]=reactExports.useState(i2.isEditable());if(reactExports.useLayoutEffect(()=>(o2(i2.isEditable()),i2.registerEditableListener(e3=>{o2(e3)})),[i2]),!a2)return null;let d2=null;return"function"==typeof e2?d2=e2(n2):null!==e2&&(d2=e2),null===d2?null:jsxRuntimeExports.jsx("div",{"aria-hidden":!0,children:d2})}function t$1(r2,e2){return(t$1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r3,e3){return r3.__proto__=e3,r3})(r2,e2)}var o$3={error:null},n$2=function(e2){var n2,a2;function s2(){for(var r2,t2=arguments.length,n3=new Array(t2),a3=0;a3<t2;a3++)n3[a3]=arguments[a3];return(r2=e2.call.apply(e2,[this].concat(n3))||this).state=o$3,r2.resetErrorBoundary=function(){for(var e3,t3=arguments.length,o2=new Array(t3),n4=0;n4<t3;n4++)o2[n4]=arguments[n4];null==r2.props.onReset||(e3=r2.props).onReset.apply(e3,o2),r2.reset()},r2}a2=e2,(n2=s2).prototype=Object.create(a2.prototype),n2.prototype.constructor=n2,t$1(n2,a2),s2.getDerivedStateFromError=function(r2){return{error:r2}};var i2=s2.prototype;return i2.reset=function(){this.setState(o$3)},i2.componentDidCatch=function(r2,e3){var t2,o2;null==(t2=(o2=this.props).onError)||t2.call(o2,r2,e3)},i2.componentDidUpdate=function(r2,e3){var t2,o2,n3,a3,s3=this.state.error,i3=this.props.resetKeys;null!==s3&&null!==e3.error&&(void 0===(n3=r2.resetKeys)&&(n3=[]),void 0===(a3=i3)&&(a3=[]),n3.length!==a3.length||n3.some(function(r3,e4){return!Object.is(r3,a3[e4])}))&&(null==(t2=(o2=this.props).onResetKeysChange)||t2.call(o2,r2.resetKeys,i3),this.reset())},i2.render=function(){var e3=this.state.error,t2=this.props,o2=t2.fallbackRender,n3=t2.FallbackComponent,a3=t2.fallback;if(null!==e3){var s3={error:e3,resetErrorBoundary:this.resetErrorBoundary};if(reactExports.isValidElement(a3))return a3;if("function"==typeof o2)return o2(s3);if(n3)return reactExports.createElement(n3,s3);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},s2}(reactExports.Component);function a$2({children:r2,onError:t2}){return jsxRuntimeExports.jsx(n$2,{fallback:jsxRuntimeExports.jsx("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:t2,children:r2})}const c$1="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?reactExports.useLayoutEffect:reactExports.useEffect;function u$1(e2){return{initialValueFn:()=>e2.isEditable(),subscribe:n2=>e2.registerEditableListener(n2)}}const g$1="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?reactExports.useLayoutEffect:reactExports.useEffect;function E(t2){return t2.getEditorState().read(g$2(t2.isComposing()))}function h$4({contentEditable:e2,placeholder:r2=null,ErrorBoundary:n2}){const[E2]=o$5(),h2=function(t2,e3){const[r3,o2]=reactExports.useState(()=>t2.getDecorators());return g$1(()=>t2.registerDecoratorListener(t3=>{reactDomExports.flushSync(()=>{o2(t3)})}),[t2]),reactExports.useEffect(()=>{o2(t2.getDecorators())},[t2]),reactExports.useMemo(()=>{const o3=[],n3=Object.keys(r3);for(let i2=0;i2<n3.length;i2++){const c2=n3[i2],l2=jsxRuntimeExports.jsx(e3,{onError:e4=>t2._onError(e4),children:jsxRuntimeExports.jsx(reactExports.Suspense,{fallback:null,children:r3[c2]})}),u2=t2.getElementByKey(c2);null!==u2&&o3.push(reactDomExports.createPortal(l2,u2,c2))}return o3},[e3,r3,t2])}(E2,n2);return g$1(()=>j$2(bt$1(t2),function(o2){const i2=window.location.origin,a2=a3=>{if(a3.origin!==i2)return;const r2=o2.getRootElement();if(document.activeElement!==r2)return;const s2=a3.data;if("string"==typeof s2){let i3;try{i3=JSON.parse(s2)}catch(e2){return}if(i3&&"nuanria_messaging"===i3.protocol&&"request"===i3.type){const r3=i3.payload;if(r3&&"makeChanges"===r3.functionId){const i4=r3.args;if(i4){const[r4,s3,c2,g2,d2,f3]=i4;o2.update(()=>{const o3=wr();if(ar(o3)){const e2=o3.anchor;let t2=e2.getNode(),i5=0,f4=0;if(Zn(t2)&&r4>=0&&s3>=0&&(i5=r4,f4=r4+s3,o3.setTextNodeRange(t2,i5,t2,f4)),i5===f4&&""===c2||(o3.insertRawText(c2),t2=e2.getNode()),Zn(t2)){i5=g2,f4=g2+d2;const e3=t2.getTextContentSize();i5=i5>e3?e3:i5,f4=f4>e3?e3:f4,o3.setTextNodeRange(t2,i5,t2,f4)}a3.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",a2,!0),()=>{window.removeEventListener("message",a2,!0)}}(t2)),[t2=E2]),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[e2,jsxRuntimeExports.jsx(w$1,{content:r2}),h2]});var t2}function w$1({content:r2}){const[n2]=o$5(),i2=function(t2){const[e2,r3]=reactExports.useState(()=>E(t2));return g$1(()=>{function e3(){const e4=E(t2);r3(e4)}return e3(),j$2(t2.registerUpdateListener(()=>{e3()}),t2.registerEditableListener(()=>{e3()}))},[t2]),e2}(n2),l2=function(n2){const[t2]=o$5(),u2=reactExports.useMemo(()=>n2(t2),[t2,n2]),[a2,l2]=reactExports.useState(()=>u2.initialValueFn()),d2=reactExports.useRef(a2);return c$1(()=>{const{initialValueFn:e2,subscribe:n3}=u2,t3=e2();return d2.current!==t3&&(d2.current=t3,l2(t3)),n3(e3=>{d2.current=e3,l2(e3)})},[u2,n2]),a2}(u$1);return i2?"function"==typeof r2?r2(l2):r2:null}const defaultSvgIcons={undo:React__default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React__default.createElement("path",{d:"M7.202 18.5V17H14.3788C15.4224 17 16.3205 16.6554 17.073 15.9663C17.8257 15.2773 18.202 14.4263 18.202 13.4135C18.202 12.4007 17.8257 11.5512 17.073 10.8652C16.3205 10.1794 15.4224 9.8365 14.3788 9.8365H7.35775L10.1402 12.6193L9.0865 13.673L4.5 9.0865L9.0865 4.5L10.1402 5.55375L7.35775 8.3365H14.3788C15.8416 8.3365 17.0945 8.82467 18.1375 9.801C19.1805 10.7773 19.702 11.9815 19.702 13.4135C19.702 14.8455 19.1805 16.0513 18.1375 17.0308C17.0945 18.0103 15.8416 18.5 14.3788 18.5H7.202Z",fill:"currentColor"})),redo:React__default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React__default.createElement("path",{d:"M9.6211 18.5C8.15827 18.5 6.90535 18.0103 5.86235 17.0308C4.81935 16.0513 4.29785 14.8455 4.29785 13.4135C4.29785 11.9815 4.81935 10.7773 5.86235 9.801C6.90535 8.82467 8.15827 8.3365 9.6211 8.3365H16.6421L13.8596 5.55375L14.9134 4.5L19.4999 9.0865L14.9134 13.673L13.8596 12.6193L16.6421 9.8365H9.6211C8.57744 9.8365 7.67935 10.1794 6.92685 10.8652C6.17418 11.5512 5.79785 12.4007 5.79785 13.4135C5.79785 14.4263 6.17418 15.2773 6.92685 15.9663C7.67935 16.6554 8.57744 17 9.6211 17H16.7979V18.5H9.6211Z",fill:"currentColor"})),format_bold:React__default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React__default.createElement("path",{d:"M7.33838 18.625V5.375H12.1999C13.219 5.375 14.1405 5.69233 14.9644 6.327C15.788 6.9615 16.1999 7.816 16.1999 8.8905C16.1999 9.63783 16.0194 10.2471 15.6584 10.7182C15.2975 11.1894 14.9088 11.5314 14.4921 11.7442C15.005 11.9211 15.4947 12.2708 15.9614 12.7933C16.428 13.3158 16.6614 14.0193 16.6614 14.9038C16.6614 16.1819 16.1902 17.1217 15.2479 17.723C14.3055 18.3243 13.3562 18.625 12.3999 18.625H7.33838ZM9.48838 16.6328H12.3191C13.1063 16.6328 13.6627 16.4142 13.9884 15.977C14.314 15.5398 14.4769 15.1206 14.4769 14.7192C14.4769 14.3179 14.314 13.8987 13.9884 13.4615C13.6627 13.0243 13.0909 12.8058 12.2729 12.8058H9.48838V16.6328ZM9.48838 10.875H12.0826C12.6903 10.875 13.172 10.7013 13.5279 10.3538C13.8835 10.0064 14.0614 9.59042 14.0614 9.10575C14.0614 8.59042 13.8733 8.16925 13.4971 7.84225C13.1208 7.51542 12.6595 7.352 12.1134 7.352H9.48838V10.875Z",fill:"currentColor"})),format_italic:React__default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React__default.createElement("path",{d:"M5.39404 18.625V16.8173H9.21129L12.4518 7.18275H8.63454V5.375H17.7883V7.18275H14.2785L11.0383 16.8173H14.5478V18.625H5.39404Z",fill:"currentColor"})),format_underlined:React__default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React__default.createElement("path",{d:"M5.34619 22.125V20.625H18.6537V22.125H5.34619ZM11.9999 18.5287C10.4448 18.5287 9.23102 18.0566 8.35869 17.1125C7.48619 16.1683 7.04994 14.9032 7.04994 13.3172V5.41345H8.90369V13.4095C8.90369 14.4198 9.17228 15.2295 9.70944 15.8385C10.2466 16.4475 11.0101 16.752 11.9999 16.752C12.9898 16.752 13.7533 16.4475 14.2904 15.8385C14.8276 15.2295 15.0962 14.4198 15.0962 13.4095V5.41345H16.9499V13.3172C16.9499 14.9032 16.5137 16.1683 15.6412 17.1125C14.7689 18.0566 13.5551 18.5287 11.9999 18.5287Z",fill:"currentColor"})),format_highlight:React__default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"},React__default.createElement("path",{d:"m9 11-6 6v3h9l3-3"}),React__default.createElement("path",{d:"m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4"})),code:React__default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React__default.createElement("path",{d:"M7.99994 17.6537L2.34619 11.9999L7.99994 6.34619L9.06919 7.41544L4.46919 12.0154L9.05369 16.5999L7.99994 17.6537ZM15.9999 17.6537L14.9307 16.5844L19.5307 11.9844L14.9462 7.39994L15.9999 6.34619L21.6537 11.9999L15.9999 17.6537Z",fill:"currentColor"})),strikeThrough:React__default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React__default.createElement("path",{d:"M12.15 19.6923C10.9732 19.6923 9.9315 19.359 9.025 18.6923C8.11867 18.0256 7.45525 17.1128 7.03475 15.9538L8.6385 15.2635C8.91667 16.0444 9.3545 16.6867 9.952 17.1905C10.5493 17.6944 11.2923 17.9463 12.1808 17.9463C12.9578 17.9463 13.6744 17.7508 14.3307 17.3598C14.9872 16.9686 15.3155 16.3487 15.3155 15.5C15.3155 15.123 15.2555 14.7968 15.1355 14.5213C15.0157 14.2456 14.8462 13.9885 14.627 13.75H16.677C16.7987 13.9705 16.8932 14.2256 16.9605 14.5153C17.0278 14.8051 17.0615 15.1334 17.0615 15.5C17.0615 16.8372 16.5747 17.8702 15.601 18.599C14.6272 19.3279 13.4768 19.6923 12.15 19.6923ZM2.25 11.75V10.25H21.75V11.75H2.25ZM12.05 4.19629C13.0475 4.19629 13.9123 4.42704 14.6443 4.88854C15.3763 5.35004 15.9673 6.05896 16.4173 7.01529L14.823 7.73079C14.6218 7.26029 14.2978 6.84462 13.851 6.48379C13.4042 6.12279 12.8141 5.94229 12.0808 5.94229C11.2244 5.94229 10.5392 6.16221 10.025 6.60204C9.51083 7.04171 9.264 7.59104 9.2845 8.25004H7.5385C7.50133 7.16421 7.89783 6.21712 8.728 5.40879C9.558 4.60046 10.6653 4.19629 12.05 4.19629Z",fill:"currentColor"})),superscript:React__default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React__default.createElement("path",{d:"M16.6924 8V6.2115C16.6924 5.95383 16.7786 5.73875 16.9511 5.56625C17.1235 5.39392 17.3385 5.30775 17.5961 5.30775H19.5001V4.38475H16.6924V3.5H19.4809C19.7385 3.5 19.9536 3.58625 20.1261 3.75875C20.2985 3.93108 20.3846 4.14617 20.3846 4.404V5.2885C20.3846 5.54617 20.2985 5.76125 20.1261 5.93375C19.9536 6.10608 19.7385 6.19225 19.4809 6.19225H17.5771V7.1155H20.3846V8H16.6924ZM4.44238 18.5L8.84638 11.6287L4.77713 5.30775H6.74438L9.95963 10.404H10.0214L13.2501 5.30775H15.2329L11.1194 11.6287L15.5579 18.5H13.5751L10.0214 12.9308H9.95963L6.42513 18.5H4.44238Z",fill:"currentColor"})),subscript:React__default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React__default.createElement("path",{d:"M16.6924 20.5V18.7115C16.6924 18.4538 16.7786 18.2387 16.9511 18.0662C17.1235 17.8939 17.3385 17.8077 17.5961 17.8077H19.5001V16.8845H16.6924V16H19.4809C19.7385 16 19.9536 16.0863 20.1261 16.2587C20.2985 16.4311 20.3846 16.6461 20.3846 16.9038V17.7885C20.3846 18.0462 20.2985 18.2612 20.1261 18.4337C19.9536 18.6061 19.7385 18.6923 19.4809 18.6923H17.5771V19.6152H20.3846V20.5H16.6924ZM4.44238 18.6923L8.84638 11.8212L4.77713 5.5H6.74438L9.95963 10.5962H10.0214L13.2501 5.5H15.2329L11.1194 11.8212L15.5579 18.6923H13.5751L10.0214 13.123H9.95963L6.42513 18.6923H4.44238Z",fill:"currentColor"})),format_list_bulleted:React__default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React__default.createElement("path",{d:"M9.30775 18.75V17.25H20.5V18.75H9.30775ZM9.30775 12.75V11.25H20.5V12.75H9.30775ZM9.30775 6.75005V5.25005H20.5V6.75005H9.30775ZM5.1635 19.6635C4.706 19.6635 4.31442 19.5006 3.98875 19.1748C3.66292 18.8491 3.5 18.4575 3.5 18C3.5 17.5425 3.66292 17.151 3.98875 16.8253C4.31442 16.4995 4.706 16.3365 5.1635 16.3365C5.621 16.3365 6.01258 16.4995 6.33825 16.8253C6.66408 17.151 6.827 17.5425 6.827 18C6.827 18.4575 6.66408 18.8491 6.33825 19.1748C6.01258 19.5006 5.621 19.6635 5.1635 19.6635ZM5.1635 13.6635C4.706 13.6635 4.31442 13.5006 3.98875 13.1748C3.66292 12.8491 3.5 12.4575 3.5 12C3.5 11.5425 3.66292 11.151 3.98875 10.8253C4.31442 10.4995 4.706 10.3365 5.1635 10.3365C5.621 10.3365 6.01258 10.4995 6.33825 10.8253C6.66408 11.151 6.827 11.5425 6.827 12C6.827 12.4575 6.66408 12.8491 6.33825 13.1748C6.01258 13.5006 5.621 13.6635 5.1635 13.6635ZM5.1635 7.66355C4.706 7.66355 4.31442 7.50063 3.98875 7.1748C3.66292 6.84913 3.5 6.45755 3.5 6.00005C3.5 5.54255 3.66292 5.15096 3.98875 4.8253C4.31442 4.49946 4.706 4.33655 5.1635 4.33655C5.621 4.33655 6.01258 4.49946 6.33825 4.8253C6.66408 5.15096 6.827 5.54255 6.827 6.00005C6.827 6.45755 6.66408 6.84913 6.33825 7.1748C6.01258 7.50063 5.621 7.66355 5.1635 7.66355Z",fill:"currentColor"})),format_list_numbered:React__default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React__default.createElement("path",{d:"M3.5 21.5V20.3078H6V19.25H4.5V18.0577H6V17H3.5V15.8077H6.34625C6.58592 15.8077 6.78683 15.8888 6.949 16.051C7.11117 16.2132 7.19225 16.4141 7.19225 16.6538V17.8462C7.19225 18.0859 7.11117 18.2868 6.949 18.449C6.78683 18.6112 6.58592 18.6923 6.34625 18.6923C6.58592 18.6923 6.78683 18.7733 6.949 18.9355C7.11117 19.0977 7.19225 19.2987 7.19225 19.5385V20.6538C7.19225 20.8936 7.11117 21.0946 6.949 21.2568C6.78683 21.4189 6.58592 21.5 6.34625 21.5H3.5ZM3.5 14.8463V12.25C3.5 12.0103 3.58108 11.8093 3.74325 11.647C3.90542 11.4848 4.10642 11.4038 4.34625 11.4038H6V10.3462H3.5V9.15375H6.34625C6.58592 9.15375 6.78683 9.23483 6.949 9.397C7.11117 9.55933 7.19225 9.76033 7.19225 10V11.75C7.19225 11.9897 7.11117 12.1907 6.949 12.353C6.78683 12.5152 6.58592 12.5963 6.34625 12.5963H4.69225V13.6538H7.19225V14.8463H3.5ZM5 8.19225V3.69225H3.5V2.5H6.19225V8.19225H5ZM9.30775 18.75V17.25H20.5V18.75H9.30775ZM9.30775 12.75V11.25H20.5V12.75H9.30775ZM9.30775 6.75V5.25H20.5V6.75H9.30775Z",fill:"currentColor"})),format_list_checked:React__default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React__default.createElement("path",{d:"M5.69425 18.452L2.5 15.2578L3.54425 14.2135L5.66925 16.3385L9.91925 12.0885L10.9635 13.1578L5.69425 18.452ZM5.69425 10.8365L2.5 7.64227L3.54425 6.59802L5.66925 8.72302L9.91925 4.47302L10.9635 5.54227L5.69425 10.8365ZM13.0095 16.5578V15.0578H21.5095V16.5578H13.0095ZM13.0095 8.94227V7.44227H21.5095V8.94227H13.0095Z",fill:"currentColor"})),link:React__default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React__default.createElement("path",{d:"M10.8077 16.5385H7.0385C5.78283 16.5385 4.7125 16.096 3.8275 15.211C2.9425 14.3262 2.5 13.256 2.5 12.0005C2.5 10.745 2.9425 9.67471 3.8275 8.78955C4.7125 7.90421 5.78283 7.46155 7.0385 7.46155H10.8077V8.96155H7.0385C6.19867 8.96155 5.48233 9.25805 4.8895 9.85105C4.2965 10.444 4 11.1604 4 12C4 12.8397 4.2965 13.556 4.8895 14.149C5.48233 14.742 6.19867 15.0385 7.0385 15.0385H10.8077V16.5385ZM8.25 12.75V11.25H15.75V12.75H8.25ZM13.1923 16.5385V15.0385H16.9615C17.8013 15.0385 18.5177 14.742 19.1105 14.149C19.7035 13.556 20 12.8397 20 12C20 11.1604 19.7035 10.444 19.1105 9.85105C18.5177 9.25805 17.8013 8.96155 16.9615 8.96155H13.1923V7.46155H16.9615C18.2172 7.46155 19.2875 7.90405 20.1725 8.78905C21.0575 9.67388 21.5 10.744 21.5 11.9995C21.5 13.255 21.0575 14.3254 20.1725 15.2105C19.2875 16.0959 18.2172 16.5385 16.9615 16.5385H13.1923Z",fill:"currentColor"})),add_photo:React__default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React__default.createElement("path",{d:"M5.11537 20.5C4.6182 20.5 4.19262 20.323 3.83862 19.969C3.48462 19.615 3.30762 19.1894 3.30762 18.6922V5.30773C3.30762 4.81056 3.48462 4.38498 3.83862 4.03098C4.19262 3.67698 4.6182 3.49998 5.11537 3.49998H13.8076V4.99998H5.11537C5.02553 4.99998 4.95178 5.02881 4.89412 5.08648C4.83645 5.14415 4.80762 5.2179 4.80762 5.30773V18.6922C4.80762 18.7821 4.83645 18.8558 4.89412 18.9135C4.95178 18.9711 5.02553 19 5.11537 19H18.4999C18.5895 19 18.6633 18.9711 18.7211 18.9135C18.7788 18.8558 18.8076 18.7821 18.8076 18.6922V9.99998H20.3076V18.6922C20.3076 19.1894 20.1306 19.615 19.7766 19.969C19.4226 20.323 18.997 20.5 18.4999 20.5H5.11537ZM17.1921 8.61523V6.61523H15.1921V5.11548H17.1921V3.11548H18.6921V5.11548H20.6921V6.61523H18.6921V8.61523H17.1921ZM6.55762 16.75H17.1344L13.8459 12.3655L11.0384 16.0192L9.03837 13.4615L6.55762 16.75Z",fill:"currentColor"})),table:React__default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React__default.createElement("path",{d:"M3.5 18.6923V5.30775C3.5 4.81058 3.677 4.385 4.031 4.031C4.385 3.677 4.81058 3.5 5.30775 3.5H18.6923C19.1894 3.5 19.615 3.677 19.969 4.031C20.323 4.385 20.5 4.81058 20.5 5.30775V18.6923C20.5 19.1894 20.323 19.615 19.969 19.969C19.615 20.323 19.1894 20.5 18.6923 20.5H5.30775C4.81058 20.5 4.385 20.323 4.031 19.969C3.677 19.615 3.5 19.1894 3.5 18.6923ZM5 9.077H19V5.30775C19 5.21792 18.9712 5.14417 18.9135 5.0865C18.8558 5.02883 18.7821 5 18.6923 5H5.30775C5.21792 5 5.14417 5.02883 5.0865 5.0865C5.02883 5.14417 5 5.21792 5 5.30775V9.077ZM10.1615 14.0385H13.8385V10.577H10.1615V14.0385ZM10.1615 19H13.8385V15.5385H10.1615V19ZM5 14.0385H8.6615V10.577H5V14.0385ZM15.3385 14.0385H19V10.577H15.3385V14.0385ZM5.30775 19H8.6615V15.5385H5V18.6923C5 18.7821 5.02883 18.8558 5.0865 18.9135C5.14417 18.9712 5.21792 19 5.30775 19ZM15.3385 19H18.6923C18.7821 19 18.8558 18.9712 18.9135 18.9135C18.9712 18.8558 19 18.7821 19 18.6923V15.5385H15.3385V19Z",fill:"currentColor"})),horizontal_rule:React__default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React__default.createElement("path",{d:"M4.5 12.75V11.25H19.5V12.75H4.5Z",fill:"currentColor"})),frontmatter:React__default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React__default.createElement("path",{d:"M4.5 8.75V7.25H8.5V8.75H4.5Z",fill:"currentColor"}),React__default.createElement("path",{d:"M4.5 14.75V13.25H8.5V14.75H4.5Z",fill:"currentColor"}),React__default.createElement("path",{d:"M9.5 8.75V7.25H13.5V8.75H9.5Z",fill:"currentColor"}),React__default.createElement("path",{d:"M9.5 14.75V13.25H13.5V14.75H9.5Z",fill:"currentColor"}),React__default.createElement("path",{d:"M14.5 8.75V7.25H18.5V8.75H14.5Z",fill:"currentColor"}),React__default.createElement("path",{d:"M14.5 14.75V13.25H18.5V14.75H14.5Z",fill:"currentColor"})),frame_source:React__default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React__default.createElement("path",{d:"M8.6 15.2443L5.35575 12L8.6 8.75575L9.64425 9.825L7.46925 12L9.64425 14.175L8.6 15.2443ZM15.4 15.2443L14.3558 14.175L16.5307 12L14.3558 9.825L15.4 8.75575L18.6443 12L15.4 15.2443ZM5.30775 20.5C4.80258 20.5 4.375 20.325 4.025 19.975C3.675 19.625 3.5 19.1974 3.5 18.6923V15H5V18.6923C5 18.7692 5.03208 18.8398 5.09625 18.9038C5.16025 18.9679 5.23075 19 5.30775 19H9V20.5H5.30775ZM15 20.5V19H18.6923C18.7692 19 18.8398 18.9679 18.9038 18.9038C18.9679 18.8398 19 18.7692 19 18.6923V15H20.5V18.6923C20.5 19.1974 20.325 19.625 19.975 19.975C19.625 20.325 19.1974 20.5 18.6923 20.5H15ZM3.5 9V5.30775C3.5 4.80258 3.675 4.375 4.025 4.025C4.375 3.675 4.80258 3.5 5.30775 3.5H9V5H5.30775C5.23075 5 5.16025 5.03208 5.09625 5.09625C5.03208 5.16025 5 5.23075 5 5.30775V9H3.5ZM19 9V5.30775C19 5.23075 18.9679 5.16025 18.9038 5.09625C18.8398 5.03208 18.7692 5 18.6923 5H15V3.5H18.6923C19.1974 3.5 19.625 3.675 19.975 4.025C20.325 4.375 20.5 4.80258 20.5 5.30775V9H19Z",fill:"currentColor"})),arrow_drop_down:React__default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React__default.createElement("path",{d:"M11.9999 14.6537L7.59619 10.25H16.4037L11.9999 14.6537Z",fill:"currentColor"})),admonition:React__default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React__default.createElement("path",{d:"M12.0001 21.4C11.7654 21.4 11.5385 21.3548 11.3193 21.2645C11.1002 21.174 10.9002 21.0435 10.7193 20.873L3.1271 13.2807C2.9566 13.0999 2.8261 12.8999 2.7356 12.6807C2.64526 12.4616 2.6001 12.2346 2.6001 12C2.6001 11.7653 2.64526 11.5358 2.7356 11.3115C2.8261 11.0871 2.9566 10.8897 3.1271 10.7192L10.7193 3.12698C10.9002 2.94614 11.1002 2.81314 11.3193 2.72798C11.5385 2.64264 11.7654 2.59998 12.0001 2.59998C12.2348 2.59998 12.4643 2.64264 12.6886 2.72798C12.9129 2.81314 13.1103 2.94614 13.2808 3.12698L20.8731 10.7192C21.0539 10.8897 21.1869 11.0871 21.2721 11.3115C21.3574 11.5358 21.4001 11.7653 21.4001 12C21.4001 12.2346 21.3574 12.4616 21.2721 12.6807C21.1869 12.8999 21.0539 13.0999 20.8731 13.2807L13.2808 20.873C13.1103 21.0435 12.9129 21.174 12.6886 21.2645C12.4643 21.3548 12.2348 21.4 12.0001 21.4ZM12.2213 19.8037L19.8039 12.2212C19.8552 12.1699 19.8808 12.0961 19.8808 12C19.8808 11.9038 19.8552 11.8301 19.8039 11.7787L12.2213 4.19623C12.17 4.14489 12.0963 4.11923 12.0001 4.11923C11.9039 4.11923 11.8302 4.14489 11.7788 4.19623L4.19635 11.7787C4.14501 11.8301 4.11935 11.9038 4.11935 12C4.11935 12.0961 4.14501 12.1699 4.19635 12.2212L11.7788 19.8037C11.8302 19.8551 11.9039 19.8807 12.0001 19.8807C12.0963 19.8807 12.17 19.8551 12.2213 19.8037ZM11.2501 13.0865H12.7501V7.47123H11.2501V13.0865ZM12.0001 15.702C12.2258 15.702 12.4168 15.6237 12.5731 15.4672C12.7296 15.3109 12.8078 15.1199 12.8078 14.8942C12.8078 14.6686 12.7296 14.4776 12.5731 14.3212C12.4168 14.1647 12.2258 14.0865 12.0001 14.0865C11.7744 14.0865 11.5834 14.1647 11.4271 14.3212C11.2706 14.4776 11.1923 14.6686 11.1923 14.8942C11.1923 15.1199 11.2706 15.3109 11.4271 15.4672C11.5834 15.6237 11.7744 15.702 12.0001 15.702Z",fill:"currentColor"})),sandpack:React__default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React__default.createElement("path",{d:"M12.9999 22.5C12.4947 22.5 12.0671 22.325 11.7171 21.975C11.3671 21.625 11.1921 21.1974 11.1921 20.6922V7.30775C11.1921 6.80258 11.3671 6.375 11.7171 6.025C12.0671 5.675 12.4947 5.5 12.9999 5.5H16.3844C16.8895 5.5 17.3171 5.675 17.6671 6.025C18.0171 6.375 18.1921 6.80258 18.1921 7.30775V20.6922C18.1921 21.1974 18.0171 21.625 17.6671 21.975C17.3171 22.325 16.8895 22.5 16.3844 22.5H12.9999ZM12.6921 7.30775V20.6922C12.6921 20.7692 12.7242 20.8398 12.7884 20.9038C12.8524 20.9679 12.9229 21 12.9999 21H16.3844C16.4614 21 16.5319 20.9679 16.5959 20.9038C16.66 20.8398 16.6921 20.7692 16.6921 20.6922V7.30775C16.6921 7.23075 16.66 7.16025 16.5959 7.09625C16.5319 7.03208 16.4614 7 16.3844 7H12.9999C12.9229 7 12.8524 7.03208 12.7884 7.09625C12.7242 7.16025 12.6921 7.23075 12.6921 7.30775ZM6.61537 18.5C6.1102 18.5 5.68262 18.325 5.33262 17.975C4.98262 17.625 4.80762 17.1974 4.80762 16.6923V3.30775C4.80762 2.80258 4.98262 2.375 5.33262 2.025C5.68262 1.675 6.1102 1.5 6.61537 1.5H9.99987C10.505 1.5 10.9326 1.675 11.2826 2.025C11.6326 2.375 11.8076 2.80258 11.8076 3.30775V16.6923C11.8076 17.1974 11.6326 17.625 11.2826 17.975C10.9326 18.325 10.505 18.5 9.99987 18.5H6.61537ZM6.30762 3.30775V16.6923C6.30762 16.7692 6.3397 16.8398 6.40387 16.9038C6.46787 16.9679 6.53837 17 6.61537 17H9.99987C10.0769 17 10.1474 16.9679 10.2114 16.9038C10.2755 16.8398 10.3076 16.7692 10.3076 16.6923V3.30775C10.3076 3.23075 10.2755 3.16025 10.2114 3.09625C10.1474 3.03208 10.0769 3 9.99987 3H6.61537C6.53837 3 6.46787 3.03208 6.40387 3.09625C6.3397 3.16025 6.30762 3.23075 6.30762 3.30775Z",fill:"currentColor"})),rich_text:React__default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React__default.createElement("path",{d:"M5.30775 20.5C4.80258 20.5 4.375 20.325 4.025 19.975C3.675 19.625 3.5 19.1974 3.5 18.6923V5.30775C3.5 4.80258 3.675 4.375 4.025 4.025C4.375 3.675 4.80258 3.5 5.30775 3.5H18.6923C19.1974 3.5 19.625 3.675 19.975 4.025C20.325 4.375 20.5 4.80258 20.5 5.30775V18.6923C20.5 19.1974 20.325 19.625 19.975 19.975C19.625 20.325 19.1974 20.5 18.6923 20.5H5.30775ZM5.30775 19H18.6923C18.7692 19 18.8398 18.9679 18.9038 18.9038C18.9679 18.8398 19 18.7692 19 18.6923V5.30775C19 5.23075 18.9679 5.16025 18.9038 5.09625C18.8398 5.03208 18.7692 5 18.6923 5H5.30775C5.23075 5 5.16025 5.03208 5.09625 5.09625C5.03208 5.16025 5 5.23075 5 5.30775V18.6923C5 18.7692 5.03208 18.8398 5.09625 18.9038C5.16025 18.9679 5.23075 19 5.30775 19ZM6.75 17H17.3268L14 12.3655L11.2308 16.0192L9 13.4615L6.75 17Z",fill:"currentColor"}),React__default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 12V6.5H9.1925C9.5925 6.5 9.9425 6.65 10.2425 6.95C10.5425 7.25 10.6925 7.6 10.6925 8V8.6925C10.6925 9.03733 10.605 9.32675 10.43 9.56075C10.255 9.79458 10.0168 9.97817 9.7155 10.1115L10.6155 12H9.404L8.504 10.1925H7.1925V12H6ZM9.1925 9H7.1925V7.6925H9.1925C9.26933 7.6925 9.33983 7.7245 9.404 7.7885C9.468 7.85267 9.5 7.92317 9.5 8V8.6925C9.5 8.76933 9.468 8.83983 9.404 8.904C9.33983 8.968 9.26933 9 9.1925 9Z",fill:"currentColor"}),React__default.createElement("path",{d:"M12.5 7H17.5V8.25H12.5V7Z",fill:"currentColor"}),React__default.createElement("path",{d:"M12.5 9.25H17.5V10.5H12.5V9.25Z",fill:"currentColor"})),difference:React__default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React__default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.30775 20.5C4.80258 20.5 4.375 20.325 4.025 19.975C3.675 19.625 3.5 19.1974 3.5 18.6923V5.30775C3.5 4.80258 3.675 4.375 4.025 4.025C4.375 3.675 4.80258 3.5 5.30775 3.5H18.6923C19.1974 3.5 19.625 3.675 19.975 4.025C20.325 4.375 20.5 4.80258 20.5 5.30775V18.6923C20.5 19.1974 20.325 19.625 19.975 19.975C19.625 20.325 19.1974 20.5 18.6923 20.5H5.30775ZM18.6923 19H5.30775C5.23075 19 5.16025 18.9679 5.09625 18.9038C5.03208 18.8398 5 18.7692 5 18.6923V5.30775C5 5.23075 5.03208 5.16025 5.09625 5.09625C5.16025 5.03208 5.23075 5 5.30775 5H18.6923C18.7692 5 18.8398 5.03208 18.9038 5.09625C18.9679 5.16025 19 5.23075 19 5.30775V18.6923C19 18.7692 18.9679 18.8398 18.9038 18.9038C18.8398 18.9679 18.7692 19 18.6923 19Z",fill:"currentColor"}),React__default.createElement("rect",{x:"9",y:"10",width:"5.5",height:"1.5",fill:"currentColor"}),React__default.createElement("rect",{x:"9",y:"15",width:"5.5",height:"1.5",fill:"currentColor"}),React__default.createElement("rect",{x:"11",y:"8",width:"1.5",height:"5.5",fill:"currentColor"})),markdown:React__default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React__default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.30775 20.5C4.80258 20.5 4.375 20.325 4.025 19.975C3.675 19.625 3.5 19.1974 3.5 18.6923V5.30775C3.5 4.80258 3.675 4.375 4.025 4.025C4.375 3.675 4.80258 3.5 5.30775 3.5H18.6923C19.1974 3.5 19.625 3.675 19.975 4.025C20.325 4.375 20.5 4.80258 20.5 5.30775V18.6923C20.5 19.1974 20.325 19.625 19.975 19.975C19.625 20.325 19.1974 20.5 18.6923 20.5H5.30775ZM18.6923 19H5.30775C5.23075 19 5.16025 18.9679 5.09625 18.9038C5.03208 18.8398 5 18.7692 5 18.6923V5.30775C5 5.23075 5.03208 5.16025 5.09625 5.09625C5.16025 5.03208 5.23075 5 5.30775 5H18.6923C18.7692 5 18.8398 5.03208 18.9038 5.09625C18.9679 5.16025 19 5.23075 19 5.30775V18.6923C19 18.7692 18.9679 18.8398 18.9038 18.9038C18.8398 18.9679 18.7692 19 18.6923 19Z",fill:"currentColor"}),React__default.createElement("path",{d:"M13 15H11.5V11L9.5 14L7.5 11V15H6V8H7.5L9.5 11L11.5 8H13V15Z",fill:"currentColor"}),React__default.createElement("path",{d:"M15.9921 15.5833L13.2886 12.8797L14.0546 12.1137L15.4504 13.5016V7.99597L16.5336 7.99993V13.5016L17.9296 12.1137L18.6954 12.8797L15.9921 15.5833Z",fill:"currentColor"})),open_in_new:React__default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React__default.createElement("path",{d:"M5.30775 20.5C4.80258 20.5 4.375 20.325 4.025 19.975C3.675 19.625 3.5 19.1974 3.5 18.6923V5.30775C3.5 4.80258 3.675 4.375 4.025 4.025C4.375 3.675 4.80258 3.5 5.30775 3.5H11.6152V5H5.30775C5.23075 5 5.16025 5.03208 5.09625 5.09625C5.03208 5.16025 5 5.23075 5 5.30775V18.6923C5 18.7692 5.03208 18.8398 5.09625 18.9038C5.16025 18.9679 5.23075 19 5.30775 19H18.6923C18.7692 19 18.8398 18.9679 18.9038 18.9038C18.9679 18.8398 19 18.7692 19 18.6923V12.3848H20.5V18.6923C20.5 19.1974 20.325 19.625 19.975 19.975C19.625 20.325 19.1974 20.5 18.6923 20.5H5.30775ZM9.71925 15.3345L8.6655 14.2808L17.9462 5H14V3.5H20.5V10H19V6.05375L9.71925 15.3345Z",fill:"currentColor"})),link_off:React__default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React__default.createElement("path",{d:"M18.8843 16.1038L17.7498 14.9385C18.4228 14.7552 18.9661 14.3946 19.3796 13.8568C19.7931 13.319 19.9998 12.7 19.9998 12C19.9998 11.1604 19.705 10.444 19.1153 9.85105C18.5255 9.25805 17.8139 8.96155 16.9806 8.96155H13.1728V7.46155H16.9806C18.2293 7.46155 19.2947 7.90422 20.1768 8.78955C21.0588 9.67472 21.4998 10.7449 21.4998 12C21.4998 12.8859 21.262 13.6951 20.7863 14.4278C20.3107 15.1606 19.6767 15.7193 18.8843 16.1038ZM15.5806 12.75L14.0806 11.25H15.7306V12.75H15.5806ZM20.1461 22.2538L1.74609 3.8538L2.79984 2.80005L21.1998 21.2L20.1461 22.2538ZM10.8268 16.5386H7.03834C5.78318 16.5386 4.71301 16.0959 3.82784 15.2105C2.94251 14.3254 2.49984 13.2552 2.49984 12C2.49984 10.8885 2.85784 9.91322 3.57384 9.07405C4.28984 8.23505 5.18826 7.72838 6.26909 7.55405H6.49984L7.90759 8.96155H7.03834C6.19851 8.96155 5.48218 9.25805 4.88934 9.85105C4.29634 10.444 3.99984 11.1604 3.99984 12C3.99984 12.8397 4.29634 13.556 4.88934 14.149C5.48218 14.742 6.19851 15.0385 7.03834 15.0385H10.8268V16.5386ZM8.26909 12.75V11.25H10.2113L11.6863 12.75H8.26909Z",fill:"currentColor"})),edit:React__default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React__default.createElement("path",{d:"M5 19H6.2615L16.498 8.7635L15.2365 7.502L5 17.7385V19ZM3.5 20.5V17.1155L16.6905 3.93075C16.8417 3.79342 17.0086 3.68733 17.1913 3.6125C17.3741 3.5375 17.5658 3.5 17.7663 3.5C17.9668 3.5 18.1609 3.53558 18.3488 3.60675C18.5367 3.67792 18.7032 3.79108 18.848 3.94625L20.0693 5.18275C20.2244 5.32758 20.335 5.49425 20.401 5.68275C20.467 5.87125 20.5 6.05975 20.5 6.24825C20.5 6.44942 20.4657 6.64133 20.397 6.824C20.3283 7.00683 20.2191 7.17383 20.0693 7.325L6.8845 20.5H3.5ZM15.8562 8.14375L15.2365 7.502L16.498 8.7635L15.8562 8.14375Z",fill:"currentColor"})),content_copy:React__default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React__default.createElement("path",{d:"M9.05775 17.5C8.55258 17.5 8.125 17.325 7.775 16.975C7.425 16.625 7.25 16.1974 7.25 15.6923V4.30775C7.25 3.80258 7.425 3.375 7.775 3.025C8.125 2.675 8.55258 2.5 9.05775 2.5H17.4423C17.9474 2.5 18.375 2.675 18.725 3.025C19.075 3.375 19.25 3.80258 19.25 4.30775V15.6923C19.25 16.1974 19.075 16.625 18.725 16.975C18.375 17.325 17.9474 17.5 17.4423 17.5H9.05775ZM9.05775 16H17.4423C17.5192 16 17.5898 15.9679 17.6538 15.9038C17.7179 15.8398 17.75 15.7692 17.75 15.6923V4.30775C17.75 4.23075 17.7179 4.16025 17.6538 4.09625C17.5898 4.03208 17.5192 4 17.4423 4H9.05775C8.98075 4 8.91025 4.03208 8.84625 4.09625C8.78208 4.16025 8.75 4.23075 8.75 4.30775V15.6923C8.75 15.7692 8.78208 15.8398 8.84625 15.9038C8.91025 15.9679 8.98075 16 9.05775 16ZM5.55775 21C5.05258 21 4.625 20.825 4.275 20.475C3.925 20.125 3.75 19.6974 3.75 19.1923V6.30775H5.25V19.1923C5.25 19.2693 5.28208 19.3398 5.34625 19.4038C5.41025 19.4679 5.48075 19.5 5.55775 19.5H15.4423V21H5.55775Z",fill:"currentColor"})),more_horiz:React__default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React__default.createElement("path",{d:"M6.23096 13.5C5.81846 13.5 5.46537 13.3531 5.17171 13.0592C4.87787 12.7656 4.73096 12.4125 4.73096 12C4.73096 11.5875 4.87787 11.2344 5.17171 10.9408C5.46537 10.6469 5.81846 10.5 6.23096 10.5C6.64346 10.5 6.99662 10.6469 7.29046 10.9408C7.58412 11.2344 7.73096 11.5875 7.73096 12C7.73096 12.4125 7.58412 12.7656 7.29046 13.0592C6.99662 13.3531 6.64346 13.5 6.23096 13.5ZM12.0002 13.5C11.5877 13.5 11.2346 13.3531 10.941 13.0592C10.6471 12.7656 10.5002 12.4125 10.5002 12C10.5002 11.5875 10.6471 11.2344 10.941 10.9408C11.2346 10.6469 11.5877 10.5 12.0002 10.5C12.4127 10.5 12.7658 10.6469 13.0595 10.9408C13.3533 11.2344 13.5002 11.5875 13.5002 12C13.5002 12.4125 13.3533 12.7656 13.0595 13.0592C12.7658 13.3531 12.4127 13.5 12.0002 13.5ZM17.7695 13.5C17.357 13.5 17.0038 13.3531 16.71 13.0592C16.4163 12.7656 16.2695 12.4125 16.2695 12C16.2695 11.5875 16.4163 11.2344 16.71 10.9408C17.0038 10.6469 17.357 10.5 17.7695 10.5C18.182 10.5 18.535 10.6469 18.8287 10.9408C19.1225 11.2344 19.2695 11.5875 19.2695 12C19.2695 12.4125 19.1225 12.7656 18.8287 13.0592C18.535 13.3531 18.182 13.5 17.7695 13.5Z",fill:"currentColor"})),more_vert:React__default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React__default.createElement("path",{d:"M12 19.2692C11.5875 19.2692 11.2344 19.1223 10.9408 18.8285C10.6469 18.5348 10.5 18.1817 10.5 17.7692C10.5 17.3567 10.6469 17.0035 10.9408 16.7097C11.2344 16.416 11.5875 16.2692 12 16.2692C12.4125 16.2692 12.7656 16.416 13.0592 16.7097C13.3531 17.0035 13.5 17.3567 13.5 17.7692C13.5 18.1817 13.3531 18.5348 13.0592 18.8285C12.7656 19.1223 12.4125 19.2692 12 19.2692ZM12 13.5C11.5875 13.5 11.2344 13.353 10.9408 13.0592C10.6469 12.7655 10.5 12.4125 10.5 12C10.5 11.5875 10.6469 11.2344 10.9408 10.9407C11.2344 10.6469 11.5875 10.5 12 10.5C12.4125 10.5 12.7656 10.6469 13.0592 10.9407C13.3531 11.2344 13.5 11.5875 13.5 12C13.5 12.4125 13.3531 12.7655 13.0592 13.0592C12.7656 13.353 12.4125 13.5 12 13.5ZM12 7.73071C11.5875 7.73071 11.2344 7.58388 10.9408 7.29021C10.6469 6.99638 10.5 6.64321 10.5 6.23071C10.5 5.81821 10.6469 5.46513 10.9408 5.17146C11.2344 4.87763 11.5875 4.73071 12 4.73071C12.4125 4.73071 12.7656 4.87763 13.0592 5.17146C13.3531 5.46513 13.5 5.81821 13.5 6.23071C13.5 6.64321 13.3531 6.99638 13.0592 7.29021C12.7656 7.58388 12.4125 7.73071 12 7.73071Z",fill:"currentColor"})),close:React__default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React__default.createElement("path",{d:"M6.39994 18.6538L5.34619 17.6L10.9462 12L5.34619 6.4L6.39994 5.34625L11.9999 10.9463L17.5999 5.34625L18.6537 6.4L13.0537 12L18.6537 17.6L17.5999 18.6538L11.9999 13.0538L6.39994 18.6538Z",fill:"currentColor"})),settings:React__default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React__default.createElement("path",{d:"M9.69225 21.5L9.3115 18.4538C9.04367 18.3641 8.769 18.2385 8.4875 18.077C8.20617 17.9153 7.95459 17.7422 7.73275 17.5577L4.9115 18.75L2.604 14.75L5.04425 12.9058C5.02125 12.7571 5.00492 12.6077 4.99525 12.4578C4.98559 12.3078 4.98075 12.1583 4.98075 12.0095C4.98075 11.8673 4.98559 11.7228 4.99525 11.576C5.00492 11.4292 5.02125 11.2686 5.04425 11.0943L2.604 9.25L4.9115 5.26925L7.723 6.452C7.96417 6.261 8.22159 6.08633 8.49525 5.928C8.76892 5.76967 9.03784 5.64242 9.302 5.54625L9.69225 2.5H14.3078L14.6885 5.55575C14.9885 5.66475 15.2599 5.792 15.5028 5.9375C15.7458 6.083 15.991 6.2545 16.2385 6.452L19.0885 5.26925L21.396 9.25L18.9173 11.123C18.9531 11.2845 18.9727 11.4355 18.976 11.576C18.9792 11.7163 18.9808 11.8577 18.9808 12C18.9808 12.1358 18.9775 12.274 18.971 12.4145C18.9647 12.5548 18.9417 12.7154 18.902 12.8963L21.3615 14.75L19.0538 18.75L16.2385 17.548C15.991 17.7455 15.7384 17.9202 15.4808 18.072C15.2231 18.224 14.959 18.3481 14.6885 18.4443L14.3078 21.5H9.69225ZM11 20H12.9655L13.325 17.3212C13.8353 17.1879 14.3017 16.9985 14.724 16.753C15.1465 16.5073 15.5539 16.1916 15.9463 15.8057L18.4308 16.85L19.4155 15.15L17.2463 13.5155C17.3296 13.2565 17.3863 13.0026 17.4163 12.7537C17.4464 12.5051 17.4615 12.2538 17.4615 12C17.4615 11.7397 17.4464 11.4884 17.4163 11.2463C17.3863 11.0039 17.3296 10.7564 17.2463 10.5038L19.4345 8.85L18.45 7.15L15.9365 8.2095C15.6018 7.85183 15.2009 7.53583 14.7338 7.2615C14.2664 6.98717 13.7937 6.79292 13.3155 6.67875L13 4H11.0155L10.6845 6.66925C10.1743 6.78975 9.70325 6.97433 9.27125 7.223C8.83909 7.47183 8.42684 7.79233 8.0345 8.1845L5.55 7.15L4.5655 8.85L6.725 10.4595C6.64167 10.6968 6.58334 10.9437 6.55 11.2C6.51667 11.4563 6.5 11.7262 6.5 12.0095C6.5 12.2698 6.51667 12.525 6.55 12.775C6.58334 13.025 6.6385 13.2718 6.7155 13.5155L4.5655 15.15L5.55 16.85L8.025 15.8C8.4045 16.1897 8.81025 16.5089 9.24225 16.7578C9.67442 17.0064 10.152 17.1974 10.675 17.3307L11 20ZM12.0115 15C12.8435 15 13.5515 14.708 14.1355 14.124C14.7195 13.54 15.0115 12.832 15.0115 12C15.0115 11.168 14.7195 10.46 14.1355 9.876C13.5515 9.292 12.8435 9 12.0115 9C11.1692 9 10.4586 9.292 9.87975 9.876C9.30092 10.46 9.0115 11.168 9.0115 12C9.0115 12.832 9.30092 13.54 9.87975 14.124C10.4586 14.708 11.1692 15 12.0115 15Z",fill:"currentColor"})),delete_big:React__default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React__default.createElement("path",{d:"M7.30775 20.5C6.80908 20.5 6.38308 20.3234 6.02975 19.9702C5.67658 19.6169 5.5 19.1909 5.5 18.6922V5.99998H4.5V4.49998H9V3.61548H15V4.49998H19.5V5.99998H18.5V18.6922C18.5 19.1974 18.325 19.625 17.975 19.975C17.625 20.325 17.1974 20.5 16.6923 20.5H7.30775ZM17 5.99998H7V18.6922C7 18.7821 7.02883 18.8558 7.0865 18.9135C7.14417 18.9711 7.21792 19 7.30775 19H16.6923C16.7692 19 16.8398 18.9679 16.9038 18.9037C16.9679 18.8397 17 18.7692 17 18.6922V5.99998ZM9.404 17H10.9037V7.99998H9.404V17ZM13.0962 17H14.596V7.99998H13.0962V17Z",fill:"currentColor"})),delete_small:React__default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React__default.createElement("path",{d:"M7.30775 20.5C6.80908 20.5 6.38308 20.3234 6.02975 19.9702C5.67658 19.6169 5.5 19.1909 5.5 18.6922V5.99998H4.5V4.49998H9V3.61548H15V4.49998H19.5V5.99998H18.5V18.6922C18.5 19.1974 18.325 19.625 17.975 19.975C17.625 20.325 17.1974 20.5 16.6923 20.5H7.30775ZM17 5.99998H7V18.6922C7 18.7821 7.02883 18.8558 7.0865 18.9135C7.14417 18.9711 7.21792 19 7.30775 19H16.6923C16.7692 19 16.8398 18.9679 16.9038 18.9037C16.9679 18.8397 17 18.7692 17 18.6922V5.99998ZM9.404 17H10.9037V7.99998H9.404V17ZM13.0962 17H14.596V7.99998H13.0962V17Z",fill:"currentColor"})),format_align_center:React__default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React__default.createElement("path",{d:"M3.5 20.5V19H20.5V20.5H3.5ZM7.5 16.625V15.125H16.5V16.625H7.5ZM3.5 12.75V11.25H20.5V12.75H3.5ZM7.5 8.875V7.375H16.5V8.875H7.5ZM3.5 5V3.5H20.5V5H3.5Z",fill:"currentColor"})),format_align_left:React__default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React__default.createElement("path",{d:"M3.5 20.5V19H20.5V20.5H3.5ZM3.5 16.625V15.125H14.5V16.625H3.5ZM3.5 12.75V11.25H20.5V12.75H3.5ZM3.5 8.875V7.375H14.5V8.875H3.5ZM3.5 5V3.5H20.5V5H3.5Z",fill:"currentColor"})),format_align_right:React__default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React__default.createElement("path",{d:"M3.5 5V3.5H20.5V5H3.5ZM9.5 8.875V7.375H20.5V8.875H9.5ZM3.5 12.75V11.25H20.5V12.75H3.5ZM9.5 16.625V15.125H20.5V16.625H9.5ZM3.5 20.5V19H20.5V20.5H3.5Z",fill:"currentColor"})),add_row:React__default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React__default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.025 10.2077C4.375 9.85775 4.80258 9.68275 5.30775 9.68275H6.5V11.1827H5.30775C5.21792 11.1827 5.14417 11.2116 5.0865 11.2693C5.02883 11.3269 5 11.4007 5 11.4905V16.1923C5 16.2821 5.02883 16.3558 5.0865 16.4135C5.14417 16.4712 5.21792 16.5 5.30775 16.5H18.6923C18.7821 16.5 18.8558 16.4712 18.9135 16.4135C18.9712 16.3558 19 16.2821 19 16.1923V11.4905C19 11.4007 18.9712 11.3269 18.9135 11.2693C18.8558 11.2116 18.7821 11.1827 18.6923 11.1827H17.6923V9.68275H18.6923C19.1974 9.68275 19.625 9.85775 19.975 10.2077C20.325 10.5577 20.5 10.9853 20.5 11.4905V16.1923C20.5 16.6974 20.325 17.125 19.975 17.475C19.625 17.825 19.1974 18 18.6923 18H5.30775C4.80258 18 4.375 17.825 4.025 17.475C3.675 17.125 3.5 16.6974 3.5 16.1923V11.4905C3.5 10.9853 3.675 10.5577 4.025 10.2077Z",fill:"currentColor"}),React__default.createElement("path",{d:"M11.3848 9.68275V7.5H12.8848V9.68275H15V11.1827H12.8848V13.2307H11.3848V11.1827H9.26925V9.68275H11.3848Z",fill:"currentColor"})),add_column:React__default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React__default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.70775 4.025C9.35775 4.375 9.18275 4.80258 9.18275 5.30775V6.5H10.6827V5.30775C10.6827 5.21792 10.7116 5.14417 10.7693 5.0865C10.8269 5.02883 10.9007 5 10.9905 5H15.6923C15.7821 5 15.8558 5.02883 15.9135 5.0865C15.9712 5.14417 16 5.21792 16 5.30775V18.6923C16 18.7821 15.9712 18.8558 15.9135 18.9135C15.8558 18.9712 15.7821 19 15.6923 19H10.9905C10.9007 19 10.8269 18.9712 10.7693 18.9135C10.7116 18.8558 10.6827 18.7821 10.6827 18.6923V17.6923H9.18275V18.6923C9.18275 19.1974 9.35775 19.625 9.70775 19.975C10.0577 20.325 10.4853 20.5 10.9905 20.5H15.6923C16.1974 20.5 16.625 20.325 16.975 19.975C17.325 19.625 17.5 19.1974 17.5 18.6923V5.30775C17.5 4.80258 17.325 4.375 16.975 4.025C16.625 3.675 16.1974 3.5 15.6923 3.5H10.9905C10.4853 3.5 10.0577 3.675 9.70775 4.025Z",fill:"currentColor"}),React__default.createElement("path",{d:"M9.18275 11.3848H7V12.8848H9.18275V15H10.6827V12.8848H12.7307V11.3848H10.6827V9.26925H9.18275V11.3848Z",fill:"currentColor"})),insert_col_left:React__default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React__default.createElement("path",{d:"M13.0001 20.1152H8.67713H8.75388H8.69238H13.0001ZM7.19238 19.8075C7.19238 20.3127 7.36738 20.7402 7.71738 21.0902C8.06738 21.4402 8.49497 21.6152 9.00013 21.6152H12.6924C13.1975 21.6152 13.6251 21.4402 13.9751 21.0902C14.3251 20.7402 14.5001 20.3127 14.5001 19.8075V10.423H13.0001V19.8075C13.0001 19.8973 12.9713 19.9711 12.9136 20.0287C12.856 20.0864 12.7822 20.1152 12.6924 20.1152H9.00013C8.9103 20.1152 8.83655 20.0864 8.77888 20.0287C8.72122 19.9711 8.69238 19.8973 8.69238 19.8075V4.69223C8.26422 4.74357 7.90722 4.93299 7.62138 5.26048C7.33538 5.58798 7.19238 5.97548 7.19238 6.42298V19.8075ZM13.0001 2.49998V4.61523H10.8846V6.11523H13.0001V8.23073H14.5001V6.11523H16.6154V4.61523H14.5001V2.49998H13.0001Z",fill:"currentColor"})),insert_row_above:React__default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React__default.createElement("path",{d:"M20.1152 9.99987V14.3229V14.2461V14.3076V9.99987ZM19.8075 15.8076C20.3127 15.8076 20.7402 15.6326 21.0902 15.2826C21.4402 14.9326 21.6152 14.505 21.6152 13.9999V10.3076C21.6152 9.80245 21.4402 9.37487 21.0902 9.02487C20.7402 8.67487 20.3127 8.49987 19.8075 8.49987H10.423V9.99987H19.8075C19.8973 9.99987 19.9711 10.0287 20.0287 10.0864C20.0864 10.144 20.1152 10.2178 20.1152 10.3076V13.9999C20.1152 14.0897 20.0864 14.1635 20.0287 14.2211C19.9711 14.2788 19.8973 14.3076 19.8075 14.3076H4.69223C4.74357 14.7358 4.93299 15.0928 5.26048 15.3786C5.58798 15.6646 5.97548 15.8076 6.42298 15.8076H19.8075ZM2.49998 9.99987H4.61523V12.1154H6.11523V9.99987H8.23073V8.49987H6.11523V6.38462H4.61523V8.49987H2.49998V9.99987Z",fill:"currentColor"})),insert_row_below:React__default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React__default.createElement("path",{d:"M20.1152 14.1924V9.86939V9.94614V9.88464V14.1924ZM19.8075 8.38464C20.3127 8.38464 20.7402 8.55964 21.0902 8.90964C21.4402 9.25964 21.6152 9.68723 21.6152 10.1924V13.8846C21.6152 14.3898 21.4402 14.8174 21.0902 15.1674C20.7402 15.5174 20.3127 15.6924 19.8075 15.6924H10.423V14.1924H19.8075C19.8973 14.1924 19.9711 14.1636 20.0287 14.1059C20.0864 14.0482 20.1152 13.9745 20.1152 13.8846V10.1924C20.1152 10.1026 20.0864 10.0288 20.0287 9.97114C19.9711 9.91348 19.8973 9.88464 19.8075 9.88464H4.69223C4.74357 9.45648 4.93299 9.09948 5.26048 8.81364C5.58798 8.52764 5.97548 8.38464 6.42298 8.38464H19.8075ZM2.49998 14.1924H4.61523V12.0769H6.11523V14.1924H8.23073V15.6924H6.11523V17.8076H4.61523V15.6924H2.49998V14.1924Z",fill:"currentColor"})),insert_col_right:React__default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React__default.createElement("path",{d:"M10.8075 20.1152H15.1305H15.0537H15.1152H10.8075ZM16.6152 19.8075C16.6152 20.3127 16.4402 20.7402 16.0902 21.0902C15.7402 21.4402 15.3127 21.6152 14.8075 21.6152H11.1152C10.6101 21.6152 10.1825 21.4402 9.83248 21.0902C9.48248 20.7402 9.30748 20.3127 9.30748 19.8075V10.423H10.8075V19.8075C10.8075 19.8973 10.8363 19.9711 10.894 20.0287C10.9517 20.0864 11.0254 20.1152 11.1152 20.1152H14.8075C14.8973 20.1152 14.9711 20.0864 15.0287 20.0287C15.0864 19.9711 15.1152 19.8973 15.1152 19.8075V4.69223C15.5434 4.74357 15.9004 4.93299 16.1862 5.26048C16.4722 5.58798 16.6152 5.97548 16.6152 6.42298V19.8075ZM10.8075 2.49998V4.61523H12.923V6.11523H10.8075V8.23073H9.30748V6.11523H7.19223V4.61523H9.30748V2.49998H10.8075Z",fill:"currentColor"})),check:React__default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React__default.createElement("path",{d:"M9.54983 17.6537L4.21533 12.3192L5.28433 11.25L9.54983 15.5155L18.7153 6.34998L19.7843 7.41923L9.54983 17.6537Z",fill:"currentColor"}))},styles_editorRoot="_editorRoot_1e2ox_53",styles_editorWrapper="_editorWrapper_1e2ox_155",styles_toolbarRoot="_toolbarRoot_1e2ox_162",styles_readOnlyToolbarRoot="_readOnlyToolbarRoot_1e2ox_189",styles_toolbarToggleItem="_toolbarToggleItem_1e2ox_208",styles_toolbarGroupOfGroups="_toolbarGroupOfGroups_1e2ox_219",styles_toolbarToggleSingleGroup="_toolbarToggleSingleGroup_1e2ox_224",styles_toolbarButton="_toolbarButton_1e2ox_239",styles_selectContainer="_selectContainer_1e2ox_288",styles_selectItem="_selectItem_1e2ox_301",styles_selectTrigger="_selectTrigger_1e2ox_308",styles_selectDropdownArrow="_selectDropdownArrow_1e2ox_374",styles_contentEditable="_contentEditable_1e2ox_380",styles_codeMirrorWrapper="_codeMirrorWrapper_1e2ox_392",styles_codeMirrorToolbar="_codeMirrorToolbar_1e2ox_409",styles_iconButton="_iconButton_1e2ox_457",styles_primaryButton="_primaryButton_1e2ox_507",styles_secondaryButton="_secondaryButton_1e2ox_508",styles_linkDialogEditForm="_linkDialogEditForm_1e2ox_541",styles_linkDialogAnchor="_linkDialogAnchor_1e2ox_587",styles_linkDialogPopoverContent="_linkDialogPopoverContent_1e2ox_601",styles_tableColumnEditorPopoverContent="_tableColumnEditorPopoverContent_1e2ox_602",styles_dialogContent="_dialogContent_1e2ox_603",styles_popoverArrow="_popoverArrow_1e2ox_650",styles_linkDialogPreviewAnchor="_linkDialogPreviewAnchor_1e2ox_654",styles_tooltipTrigger="_tooltipTrigger_1e2ox_677",styles_tooltipContent="_tooltipContent_1e2ox_681",styles_actionButton="_actionButton_1e2ox_695",styles_tableEditor="_tableEditor_1e2ox_714",styles_toolCell="_toolCell_1e2ox_725",styles_tableColumnEditorTrigger="_tableColumnEditorTrigger_1e2ox_744",styles_addRowButton="_addRowButton_1e2ox_746",styles_addColumnButton="_addColumnButton_1e2ox_747",styles_tableColumnEditorToolbar="_tableColumnEditorToolbar_1e2ox_789",styles_toggleGroupRoot="_toggleGroupRoot_1e2ox_802",styles_tableToolsColumn="_tableToolsColumn_1e2ox_820",styles_leftAlignedCell="_leftAlignedCell_1e2ox_829",styles_rightAlignedCell="_rightAlignedCell_1e2ox_833",styles_centeredCell="_centeredCell_1e2ox_837",styles_dialogOverlay="_dialogOverlay_1e2ox_870",styles_focusedImage="_focusedImage_1e2ox_916",styles_imageWrapper="_imageWrapper_1e2ox_920",styles_editImageToolbar="_editImageToolbar_1e2ox_933",styles_editImageButton="_editImageButton_1e2ox_937",styles_diffSourceToggleWrapper="_diffSourceToggleWrapper_1e2ox_986",styles_ggDiffSourceToggle="_ggDiffSourceToggle_1e2ox_994",styles_diffSourceToggle="_diffSourceToggle_1e2ox_986",styles_toolbarTitleMode="_toolbarTitleMode_1e2ox_1027",styles_imageControlWrapperResizing="_imageControlWrapperResizing_1e2ox_1032",styles_imageResizer="_imageResizer_1e2ox_1036",styles_imageResizerN="_imageResizerN_1e2ox_1045",styles_imageResizerNe="_imageResizerNe_1e2ox_1051",styles_imageResizerE="_imageResizerE_1e2ox_1057",styles_imageResizerSe="_imageResizerSe_1e2ox_1063",styles_imageResizerS="_imageResizerS_1e2ox_1063",styles_imageResizerSw="_imageResizerSw_1e2ox_1075",styles_imageResizerW="_imageResizerW_1e2ox_1081",styles_imageResizerNw="_imageResizerNw_1e2ox_1087",styles_imagePlaceholder="_imagePlaceholder_1e2ox_1093",styles_imageDimensionsContainer="_imageDimensionsContainer_1e2ox_1101",styles_placeholder="_placeholder_1e2ox_1106",styles_rootContentEditableWrapper="_rootContentEditableWrapper_1e2ox_1119",styles_downshiftInputWrapper="_downshiftInputWrapper_1e2ox_1129",styles_downshiftInput="_downshiftInput_1e2ox_1129",styles_downshiftAutocompleteContainer="_downshiftAutocompleteContainer_1e2ox_1160",styles_textInput="_textInput_1e2ox_1206",styles_multiFieldForm="_multiFieldForm_1e2ox_1214",styles_formField="_formField_1e2ox_1220",styles_markdownParseError="_markdownParseError_1e2ox_1231",styles_popupContainer="_popupContainer_1e2ox_1240",h$3=new Set(["http:","https:","mailto:","sms:","tel:"]);class g extends di{static getType(){return"link"}static clone(t2){return new g(t2.__url,{rel:t2.__rel,target:t2.__target,title:t2.__title},t2.__key)}constructor(t2="",e2={},r2){super(r2);const{target:n2=null,rel:i2=null,title:s2=null}=e2;this.__url=t2,this.__target=n2,this.__rel=i2,this.__title=s2}createDOM(e2){const r2=document.createElement("a");return this.updateLinkDOM(null,r2,e2),rt$3(r2,e2.theme.link),r2}updateLinkDOM(t2,r2,n2){if(po(r2)){t2&&t2.__url===this.__url||(r2.href=this.sanitizeUrl(this.__url));for(const e2 of["target","rel","title"]){const n3=`__${e2}`,i2=this[n3];t2&&t2[n3]===i2||(i2?r2[e2]=i2:r2.removeAttribute(e2))}}}updateDOM(t2,e2,r2){return this.updateLinkDOM(t2,e2,r2),!1}static importDOM(){return{a:t2=>({conversion:f$2,priority:1})}}static importJSON(t2){return d$2().updateFromJSON(t2)}updateFromJSON(t2){return super.updateFromJSON(t2).setURL(t2.url).setRel(t2.rel||null).setTarget(t2.target||null).setTitle(t2.title||null)}sanitizeUrl(t2){t2=S$1(t2);try{const e2=new URL(S$1(t2));if(!h$3.has(e2.protocol))return"about:blank"}catch(e2){return t2}return t2}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(t2){const e2=this.getWritable();return e2.__url=t2,e2}getTarget(){return this.getLatest().__target}setTarget(t2){const e2=this.getWritable();return e2.__target=t2,e2}getRel(){return this.getLatest().__rel}setRel(t2){const e2=this.getWritable();return e2.__rel=t2,e2}getTitle(){return this.getLatest().__title}setTitle(t2){const e2=this.getWritable();return e2.__title=t2,e2}insertNewAfter(t2,e2=!0){const r2=d$2(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(r2,e2),r2}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(t2,e2,r2){if(!ar(e2))return!1;const n2=e2.anchor.getNode(),i2=e2.focus.getNode();return this.isParentOf(n2)&&this.isParentOf(i2)&&e2.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}}function f$2(t2){let r2=null;if(po(t2)){const e2=t2.textContent;(null!==e2&&""!==e2||t2.children.length>0)&&(r2=d$2(t2.getAttribute("href")||"",{rel:t2.getAttribute("rel"),target:t2.getAttribute("target"),title:t2.getAttribute("title")}))}return{node:r2}}function d$2(t2="",e2){return lo(new g(t2,e2))}function p$1(t2){return t2 instanceof g}let m$1=class m extends g{constructor(t2="",e2={},r2){super(t2,e2,r2),this.__isUnlinked=void 0!==e2.isUnlinked&&null!==e2.isUnlinked&&e2.isUnlinked}static getType(){return"autolink"}static clone(t2){return new m(t2.__url,{isUnlinked:t2.__isUnlinked,rel:t2.__rel,target:t2.__target,title:t2.__title},t2.__key)}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(t2){const e2=this.getWritable();return e2.__isUnlinked=t2,e2}createDOM(t2){return this.__isUnlinked?document.createElement("span"):super.createDOM(t2)}updateDOM(t2,e2,r2){return super.updateDOM(t2,e2,r2)||t2.__isUnlinked!==this.__isUnlinked}static importJSON(t2){return U$3().updateFromJSON(t2)}updateFromJSON(t2){return super.updateFromJSON(t2).setIsUnlinked(t2.isUnlinked||!1)}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}insertNewAfter(t2,e2=!0){const r2=this.getParentOrThrow().insertNewAfter(t2,e2);if(hi(r2)){const t3=U$3(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return r2.append(t3),t3}return null}};function U$3(t2="",e2){return lo(new m$1(t2,e2))}function O(t2){return t2 instanceof m$1}const k$1=oe$1("TOGGLE_LINK_COMMAND");function N$1(t2,e2){if("element"===t2.type){const r2=t2.getNode();return hi(r2)||function(t3,...e3){const r3=new URL("https://lexical.dev/docs/error"),n2=new URLSearchParams;n2.append("code",t3);for(const t4 of e3)n2.append("v",t4);throw r3.search=n2.toString(),Error(`Minified Lexical error #${t3}; visit ${r3.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(252),r2.getChildren()[t2.offset+e2]||null}return null}function v$1(t2,e2={}){const{target:n2,title:i2}=e2,l2=void 0===e2.rel?"noreferrer":e2.rel,h2=wr();if(null===h2||!ar(h2)&&!fr(h2))return;if(fr(h2)){const e3=h2.getNodes();if(0===e3.length)return;return void e3.forEach(e4=>{if(null===t2){const t3=wt$2(e4,t4=>!O(t4)&&p$1(t4));t3&&(t3.insertBefore(e4),0===t3.getChildren().length&&t3.remove())}else{const i3=wt$2(e4,t3=>!O(t3)&&p$1(t3));if(i3)i3.setURL(t2),void 0!==n2&&i3.setTarget(n2),void 0!==l2&&i3.setRel(l2);else{const r2=d$2(t2,{rel:l2,target:n2});e4.insertBefore(r2),r2.append(e4)}}})}const g2=h2.extract();if(null===t2)return void g2.forEach(t3=>{const e3=wt$2(t3,t4=>!O(t4)&&p$1(t4));if(e3){const t4=e3.getChildren();for(let r2=0;r2<t4.length;r2++)e3.insertBefore(t4[r2]);e3.remove()}});const f3=new Set,m3=e3=>{f3.has(e3.getKey())||(f3.add(e3.getKey()),e3.setURL(t2),void 0!==n2&&e3.setTarget(n2),void 0!==l2&&e3.setRel(l2),void 0!==i2&&e3.setTitle(i2))};if(1===g2.length){const t3=x$2(g2[0],p$1);if(null!==t3)return m3(t3)}!function(t3){const e3=wr();if(!ar(e3))return t3();const r2=Tt$3(e3),n3=r2.isBackward(),i3=N$1(r2.anchor,n3?-1:0),l3=N$1(r2.focus,n3?0:-1);if(t3(),i3||l3){const t4=wr();if(ar(t4)){const e4=t4.clone();if(i3){const t5=i3.getParent();t5&&e4.anchor.set(t5.getKey(),i3.getIndexWithinParent()+(n3?1:0),"element")}if(l3){const t5=l3.getParent();t5&&e4.focus.set(t5.getKey(),l3.getIndexWithinParent()+(n3?0:1),"element")}ks(Tt$3(e4))}}}(()=>{let e3=null;for(const r2 of g2){if(!r2.isAttached())continue;const s2=x$2(r2,p$1);if(s2){m3(s2);continue}if(hi(r2)){if(!r2.isInline())continue;if(p$1(r2)){if(!(O(r2)||null!==e3&&e3.getParentOrThrow().isParentOf(r2))){m3(r2),e3=r2;continue}for(const t3 of r2.getChildren())r2.insertBefore(t3);r2.remove();continue}}const u2=r2.getPreviousSibling();p$1(u2)&&u2.is(e3)?u2.append(r2):(e3=d$2(t2,{rel:l2,target:n2,title:i2}),r2.insertAfter(e3),e3.append(r2))}})}function x$2(t2,e2){let r2=t2;for(;null!==r2&&null!==r2.getParent()&&!e2(r2);)r2=r2.getParentOrThrow();return e2(r2)?r2:null}const L$1=/^\+?[0-9\s()-]{5,}$/;function S$1(t2){return t2.match(/^[a-z][a-z0-9+.-]*:/i)||t2.match(/^[/#.]/)?t2:t2.includes("@")?`mailto:${t2}`:L$1.test(t2)?`tel:${t2}`:`https://${t2}`}function I$2(t2,...e2){const n2=new URL("https://lexical.dev/docs/error"),r2=new URLSearchParams;r2.append("code",t2);for(const t3 of e2)r2.append("v",t3);throw n2.search=r2.toString(),Error(`Minified Lexical error #${t2}; visit ${n2.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function M$2(t2){let e2=1,n2=t2.getParent();for(;null!=n2;){if(nt$2(n2)){const t3=n2.getParent();if(at(t3)){e2++,n2=t3.getParent();continue}I$2(40)}return e2}return e2}function R$2(t2){let e2=t2.getParent();at(e2)||I$2(40);let n2=e2;for(;null!==n2;)n2=n2.getParent(),at(n2)&&(e2=n2);return e2}function B(t2){let e2=[];const n2=t2.getChildren().filter(nt$2);for(let t3=0;t3<n2.length;t3++){const r2=n2[t3],i2=r2.getFirstChild();at(i2)?e2=e2.concat(B(i2)):e2.push(r2)}return e2}function K$1(t2){return nt$2(t2)&&at(t2.getFirstChild())}function W$1(t2){return et$2().append(t2)}function J$2(t2,e2){return nt$2(t2)&&(0===e2.length||1===e2.length&&t2.is(e2[0])&&0===t2.getChildrenSize())}function $$1(t2){const e2=wr();if(null!==e2){let n2=e2.getNodes();if(ar(e2)){const r3=e2.getStartEndPoints();null===r3&&I$2(143);const[i2]=r3,s2=i2.getNode(),o2=s2.getParent();if(so(s2)){const t3=s2.getFirstChild();if(t3)n2=t3.selectStart().getNodes();else{const t4=Fi();s2.append(t4),n2=t4.select().getNodes()}}else if(J$2(s2,n2)){const e3=ct$1(t2);if(so(o2)){s2.replace(e3);const t3=et$2();hi(s2)&&(t3.setFormat(s2.getFormatType()),t3.setIndent(s2.getIndent())),e3.append(t3)}else if(nt$2(s2)){const t3=s2.getParentOrThrow();U$2(e3,t3.getChildren()),t3.replace(e3)}return}}const r2=new Set;for(let e3=0;e3<n2.length;e3++){const i2=n2[e3];if(hi(i2)&&i2.isEmpty()&&!nt$2(i2)&&!r2.has(i2.getKey())){V$1(i2,t2);continue}let s2=as(i2)?i2.getParent():nt$2(i2)&&i2.isEmpty()?i2:null;for(;null!=s2;){const e4=s2.getKey();if(at(s2)){if(!r2.has(e4)){const n3=ct$1(t2);U$2(n3,s2.getChildren()),s2.replace(n3),r2.add(e4)}break}{const n3=s2.getParent();if(so(n3)&&!r2.has(e4)){r2.add(e4),V$1(s2,t2);break}s2=n3}}}}}function U$2(t2,e2){t2.splice(t2.getChildrenSize(),0,e2)}function V$1(t2,e2){if(at(t2))return t2;const n2=t2.getPreviousSibling(),r2=t2.getNextSibling(),i2=et$2();let s2;if(U$2(i2,t2.getChildren()),at(n2)&&e2===n2.getListType())n2.append(i2),at(r2)&&e2===r2.getListType()&&(U$2(n2,r2.getChildren()),r2.remove()),s2=n2;else if(at(r2)&&e2===r2.getListType())r2.getFirstChildOrThrow().insertBefore(i2),s2=r2;else{const n3=ct$1(e2);n3.append(i2),t2.replace(n3),s2=n3}return i2.setFormat(t2.getFormatType()),i2.setIndent(t2.getIndent()),t2.remove(),s2}function z(t2,e2){const n2=t2.getLastChild(),r2=e2.getFirstChild();n2&&r2&&K$1(n2)&&K$1(r2)&&(z(n2.getFirstChild(),r2.getFirstChild()),r2.remove());const i2=e2.getChildren();i2.length>0&&t2.append(...i2),e2.remove()}function H(t2){const e2="check"!==t2.getListType();let n2=t2.getStart();for(const r2 of t2.getChildren())nt$2(r2)&&(r2.getValue()!==n2&&r2.setValue(n2),e2&&null!=r2.getLatest().__checked&&r2.setChecked(void 0),at(r2.getFirstChild())||n2++)}function X$1(t2){const e2=new Set;if(K$1(t2)||e2.has(t2.getKey()))return;const n2=t2.getParent(),r2=t2.getNextSibling(),i2=t2.getPreviousSibling();if(K$1(r2)&&K$1(i2)){const n3=i2.getFirstChild();if(at(n3)){n3.append(t2);const i3=r2.getFirstChild();at(i3)&&(U$2(n3,i3.getChildren()),r2.remove(),e2.add(r2.getKey()))}}else if(K$1(r2)){const e3=r2.getFirstChild();if(at(e3)){const n3=e3.getFirstChild();null!==n3&&n3.insertBefore(t2)}}else if(K$1(i2)){const e3=i2.getFirstChild();at(e3)&&e3.append(t2)}else if(at(n2)){const e3=et$2().setTextFormat(t2.getTextFormat()).setTextStyle(t2.getTextStyle()),s2=ct$1(n2.getListType()).setTextFormat(n2.getTextFormat()).setTextStyle(n2.getTextStyle());e3.append(s2),s2.append(t2),i2?i2.insertAfter(e3):r2?r2.insertBefore(e3):n2.append(e3)}}function j$1(t2){if(K$1(t2))return;const e2=t2.getParent(),n2=e2?e2.getParent():void 0;if(at(n2?n2.getParent():void 0)&&nt$2(n2)&&at(e2)){const r2=e2?e2.getFirstChild():void 0,i2=e2?e2.getLastChild():void 0;if(t2.is(r2))n2.insertBefore(t2),e2.isEmpty()&&n2.remove();else if(t2.is(i2))n2.insertAfter(t2),e2.isEmpty()&&n2.remove();else{const r3=e2.getListType(),i3=et$2(),s2=ct$1(r3);i3.append(s2),t2.getPreviousSiblings().forEach(t3=>s2.append(t3));const o2=et$2(),l2=ct$1(r3);o2.append(l2),U$2(l2,t2.getNextSiblings()),n2.insertBefore(i3),n2.insertAfter(o2),n2.replace(t2)}}}function Q$1(...t2){const e2=[];for(const n2 of t2)if(n2&&"string"==typeof n2)for(const[t3]of n2.matchAll(/\S+/g))e2.push(t3);return e2}let Y$2=class extends di{$config(){return this.config("listitem",{$transform:t2=>{if(null==t2.__checked)return;const e2=t2.getParent();at(e2)&&"check"!==e2.getListType()&&null!=t2.getChecked()&&t2.setChecked(void 0)},extends:di,importDOM:{li:()=>({conversion:Z$2,priority:0})}})}constructor(t2=1,e2=void 0,n2){super(n2),this.__value=void 0===t2?1:t2,this.__checked=e2}afterCloneFrom(t2){super.afterCloneFrom(t2),this.__value=t2.__value,this.__checked=t2.__checked}createDOM(t2){const e2=document.createElement("li");return this.updateListItemDOM(null,e2,t2),e2}updateListItemDOM(t2,r2,i2){const s2=this.getParent();var t3,e2,n2;at(s2)&&"check"===s2.getListType()&&(t3=r2,n2=t2,at((e2=this).getFirstChild())?(t3.removeAttribute("role"),t3.removeAttribute("tabIndex"),t3.removeAttribute("aria-checked")):(t3.setAttribute("role","checkbox"),t3.setAttribute("tabIndex","-1"),n2&&e2.__checked===n2.__checked||t3.setAttribute("aria-checked",e2.getChecked()?"true":"false"))),r2.value=this.__value,function(t3,r3,i3){const s3=[],o3=[],l3=r3.list,c2=l3?l3.listitem:void 0;let a2;if(l3&&l3.nested&&(a2=l3.nested.listitem),void 0!==c2&&s3.push(...Q$1(c2)),l3){const t4=i3.getParent(),e2=at(t4)&&"check"===t4.getListType(),n2=i3.getChecked();e2&&!n2||o3.push(l3.listitemUnchecked),e2&&n2||o3.push(l3.listitemChecked),e2&&s3.push(n2?l3.listitemChecked:l3.listitemUnchecked)}if(void 0!==a2){const t4=Q$1(a2);i3.getChildren().some(t5=>at(t5))?s3.push(...t4):o3.push(...t4)}o3.length>0&&it$2(t3,...o3),s3.length>0&&rt$3(t3,...s3)}(r2,i2.theme,this);const o2=t2?t2.__style:"",l2=this.__style;o2!==l2&&(""===l2?r2.removeAttribute("style"):r2.style.cssText=l2),function(t3,e2,n2){const r3=B$2(e2.__textStyle);for(const e3 in r3)t3.style.setProperty(`--listitem-marker-${e3}`,r3[e3]);if(n2)for(const e3 in B$2(n2.__textStyle))e3 in r3||t3.style.removeProperty(`--listitem-marker-${e3}`)}(r2,this,t2)}updateDOM(t2,e2,n2){const r2=e2;return this.updateListItemDOM(t2,r2,n2),!1}updateFromJSON(t2){return super.updateFromJSON(t2).setValue(t2.value).setChecked(t2.checked)}exportDOM(t2){const e2=this.createDOM(t2._config),n2=this.getFormatType();n2&&(e2.style.textAlign=n2);const r2=this.getDirection();return r2&&(e2.dir=r2),{element:e2}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...t2){for(let e2=0;e2<t2.length;e2++){const n2=t2[e2];if(hi(n2)&&this.canMergeWith(n2)){const t3=n2.getChildren();this.append(...t3),n2.remove()}else super.append(n2)}return this}replace(t2,e2){if(nt$2(t2))return super.replace(t2);this.setIndent(0);const n2=this.getParentOrThrow();if(!at(n2))return t2;if(n2.__first===this.getKey())n2.insertBefore(t2);else if(n2.__last===this.getKey())n2.insertAfter(t2);else{const e3=ct$1(n2.getListType());let r2=this.getNextSibling();for(;r2;){const t3=r2;r2=r2.getNextSibling(),e3.append(t3)}n2.insertAfter(t2),t2.insertAfter(e3)}return e2&&(hi(t2)||I$2(139),this.getChildren().forEach(e3=>{t2.append(e3)})),this.remove(),0===n2.getChildrenSize()&&n2.remove(),t2}insertAfter(t2,e2=!0){const n2=this.getParentOrThrow();if(at(n2)||I$2(39),nt$2(t2))return super.insertAfter(t2,e2);const r2=this.getNextSiblings();if(n2.insertAfter(t2,e2),0!==r2.length){const i2=ct$1(n2.getListType());r2.forEach(t3=>i2.append(t3)),t2.insertAfter(i2,e2)}return t2}remove(t2){const e2=this.getPreviousSibling(),n2=this.getNextSibling();super.remove(t2),e2&&n2&&K$1(e2)&&K$1(n2)&&(z(e2.getFirstChild(),n2.getFirstChild()),n2.remove())}insertNewAfter(t2,e2=!0){const n2=et$2().updateFromJSON(this.exportJSON()).setChecked(!this.getChecked()&&void 0);return this.insertAfter(n2,e2),n2}collapseAtStart(t2){const e2=Fi();this.getChildren().forEach(t3=>e2.append(t3));const n2=this.getParentOrThrow(),r2=n2.getParentOrThrow(),i2=nt$2(r2);if(1===n2.getChildrenSize())if(i2)n2.remove(),r2.select();else{n2.insertBefore(e2),n2.remove();const r3=t2.anchor,i3=t2.focus,s2=e2.getKey();"element"===r3.type&&r3.getNode().is(this)&&r3.set(s2,r3.offset,"element"),"element"===i3.type&&i3.getNode().is(this)&&i3.set(s2,i3.offset,"element")}else n2.insertBefore(e2),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(t2){const e2=this.getWritable();return e2.__value=t2,e2}getChecked(){const t2=this.getLatest();let e2;const n2=this.getParent();return at(n2)&&(e2=n2.getListType()),"check"===e2?Boolean(t2.__checked):void 0}setChecked(t2){const e2=this.getWritable();return e2.__checked=t2,e2}toggleChecked(){const t2=this.getWritable();return t2.setChecked(!t2.__checked)}getIndent(){const t2=this.getParent();if(null===t2||!this.isAttached())return this.getLatest().__indent;let e2=t2.getParentOrThrow(),n2=0;for(;nt$2(e2);)e2=e2.getParentOrThrow().getParentOrThrow(),n2++;return n2}setIndent(t2){"number"!=typeof t2&&I$2(117),(t2=Math.floor(t2))>=0||I$2(199);let e2=this.getIndent();for(;e2!==t2;)e2<t2?(X$1(this),e2++):(j$1(this),e2--);return this}canInsertAfter(t2){return nt$2(t2)}canReplaceWith(t2){return nt$2(t2)}canMergeWith(t2){return nt$2(t2)||Li(t2)}extractWithChild(t2,e2){if(!ar(e2))return!1;const n2=e2.anchor.getNode(),r2=e2.focus.getNode();return this.isParentOf(n2)&&this.isParentOf(r2)&&this.getTextContent().length===e2.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return ct$1("bullet")}canMergeWhenEmpty(){return!0}};function Z$2(t2){if(t2.classList.contains("task-list-item"))for(const e3 of t2.children)if("INPUT"===e3.tagName)return tt$2(e3);const e2=t2.getAttribute("aria-checked");return{node:et$2("true"===e2||"false"!==e2&&void 0)}}function tt$2(t2){return"checkbox"!==t2.getAttribute("type")?{node:null}:{node:et$2(t2.hasAttribute("checked"))}}function et$2(t2){return lo(new Y$2(void 0,t2))}function nt$2(t2){return t2 instanceof Y$2}let rt$2=class extends di{$config(){return this.config("list",{$transform:t2=>{!function(t3){const e2=t3.getNextSibling();at(e2)&&t3.getListType()===e2.getListType()&&z(t3,e2)}(t2),H(t2)},extends:di,importDOM:{ol:()=>({conversion:ot$1,priority:0}),ul:()=>({conversion:ot$1,priority:0})}})}constructor(t2="number",e2=1,n2){super(n2);const r2=lt$1[t2]||t2;this.__listType=r2,this.__tag="number"===r2?"ol":"ul",this.__start=e2}afterCloneFrom(t2){super.afterCloneFrom(t2),this.__listType=t2.__listType,this.__tag=t2.__tag,this.__start=t2.__start}getTag(){return this.getLatest().__tag}setListType(t2){const e2=this.getWritable();return e2.__listType=t2,e2.__tag="number"===t2?"ol":"ul",e2}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(t2){const e2=this.getWritable();return e2.__start=t2,e2}createDOM(t2,e2){const n2=this.__tag,r2=document.createElement(n2);return 1!==this.__start&&r2.setAttribute("start",String(this.__start)),r2.__lexicalListType=this.__listType,it$1(r2,t2.theme,this),r2}updateDOM(t2,e2,n2){return t2.__tag!==this.__tag||(it$1(e2,n2.theme,this),!1)}updateFromJSON(t2){return super.updateFromJSON(t2).setListType(t2.listType).setStart(t2.start)}exportDOM(t2){const e2=this.createDOM(t2._config,t2);return yo(e2)&&(1!==this.__start&&e2.setAttribute("start",String(this.__start)),"check"===this.__listType&&e2.setAttribute("__lexicalListType","check")),{element:e2}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}splice(t2,e2,n2){let r2=n2;for(let t3=0;t3<n2.length;t3++){const e3=n2[t3];nt$2(e3)||(r2===n2&&(r2=[...n2]),r2[t3]=et$2().append(!hi(e3)||at(e3)||e3.isInline()?e3:Qn(e3.getTextContent())))}return super.splice(t2,e2,r2)}extractWithChild(t2){return nt$2(t2)}};function it$1(t2,r2,i2){const s2=[],o2=[],l2=r2.list;if(void 0!==l2){const t3=l2[`${i2.__tag}Depth`]||[],e2=M$2(i2)-1,n2=e2%t3.length,r3=t3[n2],c2=l2[i2.__tag];let a2;const g2=l2.nested,u2=l2.checklist;if(void 0!==g2&&g2.list&&(a2=g2.list),void 0!==c2&&s2.push(c2),void 0!==u2&&"check"===i2.__listType&&s2.push(u2),void 0!==r3){s2.push(...Q$1(r3));for(let e3=0;e3<t3.length;e3++)e3!==n2&&o2.push(i2.__tag+e3)}if(void 0!==a2){const t4=Q$1(a2);e2>1?s2.push(...t4):o2.push(...t4)}}o2.length>0&&it$2(t2,...o2),s2.length>0&&rt$3(t2,...s2)}function st$1(t2){const e2=[];for(let n2=0;n2<t2.length;n2++){const r2=t2[n2];if(nt$2(r2)){e2.push(r2);const t3=r2.getChildren();t3.length>1&&t3.forEach(t4=>{at(t4)&&e2.push(W$1(t4))})}else e2.push(W$1(r2))}return e2}function ot$1(t2){const e2=t2.nodeName.toLowerCase();let n2=null;return"ol"===e2?n2=ct$1("number",t2.start):"ul"===e2&&(n2=function(t3){if("check"===t3.getAttribute("__lexicallisttype")||t3.classList.contains("contains-task-list"))return!0;for(const e3 of t3.childNodes)if(yo(e3)&&e3.hasAttribute("aria-checked"))return!0;return!1}(t2)?ct$1("check"):ct$1("bullet")),{after:st$1,node:n2}}const lt$1={ol:"number",ul:"bullet"};function ct$1(t2="number",e2=1){return lo(new rt$2(t2,e2))}function at(t2){return t2 instanceof rt$2}const gt$1=oe$1("INSERT_CHECK_LIST_COMMAND");function ht$1(t2,e2){const n2=t2.target;if(!yo(n2))return;const i2=n2.firstChild;if(yo(i2)&&("UL"===i2.tagName||"OL"===i2.tagName))return;const s2=n2.parentNode;if(!s2||"check"!==s2.__lexicalListType)return;const l2=n2.getBoundingClientRect(),c2=function(t2){let e2=1;if(function(){if(void 0===Nt$2){const t3=document.createElement("div");t3.style.cssText="position: absolute; opacity: 0; width: 100px; left: -1000px;",document.body.appendChild(t3);const e3=t3.getBoundingClientRect();t3.style.setProperty("zoom","2"),Nt$2=t3.getBoundingClientRect().width===e3.width,document.body.removeChild(t3)}return Nt$2}())for(;t2;)e2*=Number(window.getComputedStyle(t2).getPropertyValue("zoom")),t2=t2.parentElement;return e2}(n2),a2=t2.clientX/c2,g2=window.getComputedStyle?window.getComputedStyle(n2,"::before"):{width:"0px"},u2=parseFloat(g2.width),h2="touch"===t2.pointerType?32:0;("rtl"===n2.dir?a2<l2.right+h2&&a2>l2.right-u2-h2:a2>l2.left-h2&&a2<l2.left+u2+h2)&&e2()}function ft(t2){ht$1(t2,()=>{if(yo(t2.target)){const e2=t2.target,n2=es(e2);null!=n2&&n2.isEditable()&&n2.update(()=>{const t3=ms(e2);nt$2(t3)&&(e2.focus(),t3.toggleChecked())})}})}function dt$1(t2){ht$1(t2,()=>{t2.preventDefault()})}function pt$1(){const t2=document.activeElement;return yo(t2)&&"LI"===t2.tagName&&null!=t2.parentNode&&"check"===t2.parentNode.__lexicalListType?t2:null}function mt$1(t2,e2,n2){const r2=pt$1();return null!=r2&&e2.update(()=>{const i2=ms(r2);if(!nt$2(i2))return;const s2=function(t3,e3){let n3=e3?t3.getPreviousSibling():t3.getNextSibling(),r3=t3;for(;null==n3&&nt$2(r3);)r3=r3.getParentOrThrow().getParent(),null!=r3&&(n3=e3?r3.getPreviousSibling():r3.getNextSibling());for(;nt$2(n3);){const t4=e3?n3.getLastChild():n3.getFirstChild();if(!at(t4))return n3;n3=e3?t4.getLastChild():t4.getFirstChild()}return null}(i2,n2);if(null!=s2){s2.selectStart();const n3=e2.getElementByKey(s2.__key);null!=n3&&(t2.preventDefault(),setTimeout(()=>{n3.focus()},0))}}),!1}const _t$1=oe$1("UPDATE_LIST_START_COMMAND"),yt$1=oe$1("INSERT_UNORDERED_LIST_COMMAND"),Ct$1=oe$1("INSERT_ORDERED_LIST_COMMAND"),Tt$1=oe$1("REMOVE_LIST_COMMAND");function St$1(t2){return j$2(t2.registerCommand(Ct$1,()=>($$1("number"),!0),1),t2.registerCommand(_t$1,t3=>{const{listNodeKey:e2,newStart:n2}=t3,r2=_s(e2);return!!at(r2)&&("number"===r2.getListType()&&(r2.setStart(n2),H(r2)),!0)},1),t2.registerCommand(yt$1,()=>($$1("bullet"),!0),1),t2.registerCommand(Tt$1,()=>(function(){const e2=wr();if(ar(e2)){const n2=new Set,r2=e2.getNodes(),i2=e2.anchor.getNode();if(J$2(i2,r2))n2.add(R$2(i2));else for(let e3=0;e3<r2.length;e3++){const i3=r2[e3];if(as(i3)){const e4=vt$3(i3,Y$2);null!=e4&&n2.add(R$2(e4))}}for(const t2 of n2){let n3=t2;const r3=B(t2);for(const t3 of r3){const r4=Fi().setTextStyle(e2.style).setTextFormat(e2.format);U$2(r4,t3.getChildren()),n3.insertAfter(r4),n3=r4,t3.__key===e2.anchor.key&&pl(e2.anchor,Tl(tl(r4,"next"))),t3.__key===e2.focus.key&&pl(e2.focus,Tl(tl(r4,"next"))),t3.remove()}t2.remove()}}}(),!0),1),t2.registerCommand(de,()=>function(){const t2=wr();if(!ar(t2)||!t2.isCollapsed())return!1;const e2=t2.anchor.getNode();if(!nt$2(e2)||0!==e2.getChildrenSize())return!1;const n2=R$2(e2),r2=e2.getParent();at(r2)||I$2(40);const i2=r2.getParent();let s2;if(so(i2))s2=Fi(),n2.insertAfter(s2);else{if(!nt$2(i2))return!1;s2=et$2(),i2.insertAfter(s2)}s2.setTextStyle(t2.style).setTextFormat(t2.format).select();const o2=e2.getNextSiblings();if(o2.length>0){const t3=ct$1(r2.getListType());if(nt$2(s2)){const e3=et$2();e3.append(t3),s2.insertAfter(e3)}else s2.insertAfter(t3);t3.append(...o2)}return function(t3){let e3=t3;for(;null==e3.getNextSibling()&&null==e3.getPreviousSibling();){const t4=e3.getParent();if(null==t4||!nt$2(t4)&&!at(t4))break;e3=t4}e3.remove()}(e2),!0}(),1),t2.registerNodeTransform(Y$2,t3=>{const e2=t3.getFirstChild();if(e2){if(Zn(e2)){const n2=e2.getStyle(),r2=e2.getFormat();t3.getTextStyle()!==n2&&t3.setTextStyle(n2),t3.getTextFormat()!==r2&&t3.setTextFormat(r2)}}else{const e3=wr();ar(e3)&&(e3.style!==t3.getTextStyle()||e3.format!==t3.getTextFormat())&&e3.isCollapsed()&&t3.is(e3.anchor.getNode())&&t3.setTextStyle(e3.style).setTextFormat(e3.format)}}),t2.registerNodeTransform($n,t3=>{const e2=t3.getParent();if(nt$2(e2)&&t3.is(e2.getFirstChild())){const n2=t3.getStyle(),r2=t3.getFormat();n2===e2.getTextStyle()&&r2===e2.getTextFormat()||e2.setTextStyle(n2).setTextFormat(r2)}}))}const WILL_CHANGE_CONTAINING_BLOCK_PROPS=["transform","perspective","filter","backdrop-filter","contain","container-type"],CONTAIN_VALUES_CREATING_CONTAINING_BLOCK=["layout","paint","strict","content"];function getSelectionRectangle(editor){const selection2=wr(),nativeSelection=window.getSelection(),activeElement=document.activeElement,rootElement=editor.getRootElement();if(null!==selection2&&null!==nativeSelection&&null!==rootElement&&rootElement.contains(nativeSelection.anchorNode)&&editor.isEditable()){const domRange=nativeSelection.getRangeAt(0);let rect;if(nativeSelection.isCollapsed){let node2=nativeSelection.anchorNode;3==(null==node2?void 0:node2.nodeType)&&(node2=node2.parentNode),rect=node2.getBoundingClientRect(),rect.width=0}else if(nativeSelection.anchorNode===rootElement){let inner=rootElement;for(;null!=inner.firstElementChild;)inner=inner.firstElementChild;rect=inner.getBoundingClientRect()}else rect=domRange.getBoundingClientRect();const fixedContainer=function(element2){let current=null==element2?void 0:element2.parentElement;for(;current;){const style=window.getComputedStyle(current),hasRelevantWillChange=style.willChange.split(",").map(v2=>v2.trim()).some(prop=>WILL_CHANGE_CONTAINING_BLOCK_PROPS.includes(prop));if("none"!==style.transform||"none"!==style.perspective||"none"!==style.filter||"none"!==style.backdropFilter||CONTAIN_VALUES_CREATING_CONTAINING_BLOCK.includes(style.contain)||"normal"!==style.containerType||"auto"===style.contentVisibility||hasRelevantWillChange)return current;current=current.parentElement}return null}(rootElement);if(fixedContainer){const containerRect=fixedContainer.getBoundingClientRect();return{top:Math.round(rect.top-containerRect.top),left:Math.round(rect.left-containerRect.left),width:Math.round(rect.width),height:Math.round(rect.height)}}return{top:Math.round(rect.top),left:Math.round(rect.left),width:Math.round(rect.width),height:Math.round(rect.height)}}return null==activeElement||activeElement.className,null}function getSelectionAsMarkdown(editor,_exportParams){let markdown2="";return editor.getEditorState().read(()=>{const selection2=wr();if(!selection2||!ar(selection2)||selection2.isCollapsed())return;const nodes=selection2.getNodes();if(0===nodes.length)return;const parentNodes=new Set;nodes.forEach(node2=>{let current=node2;for(;current;){if(Ft$1(current)||nt$2(current)||"paragraph"===current.getType()||"quote"===current.getType()){hi(current)&&parentNodes.add(current);break}current=current.getParent()}});const nodesToProcess=parentNodes.size>0?Array.from(parentNodes):nodes;function nodeToMarkdown(node2){if(Ft$1(node2)){const level=parseInt(node2.getTag().replace("h","")),headingText=node2.getChildren().map(child=>nodeToMarkdown(child)).join("");return"#".repeat(level)+" "+headingText+"\n\n"}if(nt$2(node2)){const parent=node2.getParent();return(parent&&at(parent)&&"number"===parent.getListType()?"1. ":"- ")+node2.getChildren().map(child=>nodeToMarkdown(child)).join("")+"\n"}if(at(node2)){return node2.getChildren().map(child=>nodeToMarkdown(child)).join("")+"\n"}if(Zn(node2)){let text2=node2.getTextContent();const format=node2.getFormat();return 16&format?`\`${text2}\``:(1&format&&(text2=`**${text2}**`),2&format&&(text2=`*${text2}*`),4&format&&(text2=`~~${text2}~~`),text2)}if(p$1(node2)){const url=node2.getURL(),title=node2.getTitle(),linkText=node2.getChildren().map(child=>nodeToMarkdown(child)).join("");return title?`[${linkText}](${url} "${title}")`:`[${linkText}](${url})`}if(hi(node2)){return node2.getChildren().map(child=>nodeToMarkdown(child)).join("")}return node2.getTextContent()}markdown2=nodesToProcess.map(node2=>nodeToMarkdown(node2)).join("")}),markdown2.trim()}const LexicalProvider=({children:children})=>{const rootEditor=E$4(rootEditor$),composerContextValue=React__default.useMemo(()=>[rootEditor,t$3(null,lexicalTheme)],[rootEditor]);return React__default.createElement(r$1.Provider,{value:composerContextValue},children)},RichTextEditor=()=>{const t2=useTranslation(),setContentEditableRef=A$4(contentEditableRef$),setEditorRootWrapperElement=A$4(contentEditableWrapperElement$),[contentEditableClassName,spellCheck,composerChildren,topAreaChildren,editorWrappers,placeholder2,bottomAreaChildren]=X$3(contentEditableClassName$,spellCheck$,composerChildren$,topAreaChildren$,editorWrappers$,placeholder$,bottomAreaChildren$);return React__default.createElement(React__default.Fragment,null,topAreaChildren.map((Child,index2)=>React__default.createElement(Child,{key:index2})),React__default.createElement(RenderRecursiveWrappers,{wrappers:editorWrappers},React__default.createElement("div",{className:classNames(styles_rootContentEditableWrapper,"mdxeditor-root-contenteditable")},React__default.createElement(h$4,{contentEditable:React__default.createElement("div",{ref:el2=>{setEditorRootWrapperElement(el2),setContentEditableRef(el2?{current:el2}:null)}},React__default.createElement(x$3,{className:classNames(styles_contentEditable,contentEditableClassName),ariaLabel:t2("contentArea.editableMarkdown","editable markdown"),spellCheck:spellCheck})),placeholder:React__default.createElement("div",{className:classNames(styles_contentEditable,styles_placeholder,contentEditableClassName)},React__default.createElement("p",null,placeholder2)),ErrorBoundary:a$2}))),composerChildren.map((Child,index2)=>React__default.createElement(Child,{key:index2})),bottomAreaChildren.map((Child,index2)=>React__default.createElement(Child,{key:index2})))},DEFAULT_MARKDOWN_OPTIONS={listItemIndent:"one"},defaultIconComponentFor=name=>defaultSvgIcons[name];function defaultTranslation(key,defaultValue,interpolations={}){let value=defaultValue;for(const[k3,v2]of Object.entries(interpolations))value=value.replaceAll(`{{${k3}}}`,String(v2));return value}const RenderRecursiveWrappers=({wrappers:wrappers,children:children})=>{if(0===wrappers.length)return React__default.createElement(React__default.Fragment,null,children);const Wrapper=wrappers[0];return React__default.createElement(Wrapper,null,React__default.createElement(RenderRecursiveWrappers,{wrappers:wrappers.slice(1)},children))},EditorRootElement=({children:children,className:className,overlayContainer:overlayContainer})=>{const editorRootElementRef=React__default.useRef(null),wrapperElementRef=React__default.useRef(null),setEditorRootElementRef=A$4(editorRootElementRef$),setEditorWrapperElementRef=A$4(editorWrapperElementRef$);return React__default.useEffect(()=>{const popupContainer2=document.createElement("div");popupContainer2.classList.add("mdxeditor-popup-container",styles_editorRoot,styles_popupContainer,...(className??"").trim().split(" ").filter(Boolean));return(overlayContainer??document.body).appendChild(popupContainer2),editorRootElementRef.current=popupContainer2,setEditorRootElementRef(editorRootElementRef),setEditorWrapperElementRef(wrapperElementRef),()=>{popupContainer2.remove()}},[className,editorRootElementRef,overlayContainer,setEditorRootElementRef,setEditorWrapperElementRef]),React__default.createElement("div",{className:classNames("mdxeditor",styles_editorRoot,styles_editorWrapper,className),ref:wrapperElementRef},children)},Methods=({mdxRef:mdxRef})=>{const realm=R$6();return React__default.useImperativeHandle(mdxRef,()=>({getMarkdown:()=>{const viewMode=realm.getValue(viewMode$);return"source"===viewMode||"diff"===viewMode?realm.getValue(markdownSourceEditorValue$):realm.getValue(markdown$)},setMarkdown:markdown2=>{realm.pub(setMarkdown$,markdown2)},insertMarkdown:markdown2=>{realm.pub(insertMarkdown$,markdown2)},focus:(callbackFn,opts)=>{var _a;null==(_a=realm.getValue(rootEditor$))||_a.focus(callbackFn,opts)},getContentEditableHTML:()=>{var _a;return(null==(_a=realm.getValue(contentEditableRef$))?void 0:_a.current.innerHTML)??""},getSelectionMarkdown:()=>{const viewMode=realm.getValue(viewMode$);if("source"===viewMode||"diff"===viewMode)return"";const activeEditor=realm.getValue(activeEditor$);return activeEditor?(realm.getValue(exportVisitors$),realm.getValue(toMarkdownExtensions$),realm.getValue(toMarkdownOptions$),realm.getValue(jsxComponentDescriptors$),realm.getValue(jsxIsAvailable$),getSelectionAsMarkdown(activeEditor)):""}}),[realm]),null},MDXEditor=React__default.forwardRef((props,ref)=>React__default.createElement(RealmWithPlugins,{plugins:[corePlugin({contentEditableClassName:props.contentEditableClassName??"",spellCheck:props.spellCheck??!0,initialMarkdown:props.markdown,onChange:props.onChange??noop$2,onBlur:props.onBlur??noop$2,toMarkdownOptions:props.toMarkdownOptions??DEFAULT_MARKDOWN_OPTIONS,autoFocus:props.autoFocus??!1,placeholder:props.placeholder??"",readOnly:Boolean(props.readOnly),iconComponentFor:props.iconComponentFor??defaultIconComponentFor,suppressHtmlProcessing:props.suppressHtmlProcessing??!1,onError:props.onError??noop$2,translation:props.translation??defaultTranslation,trim:props.trim??!0,lexicalTheme:props.lexicalTheme,..."editorState"in props?{editorState:props.editorState}:{},suppressSharedHistory:props.suppressSharedHistory??!1,additionalLexicalNodes:props.additionalLexicalNodes??[],lexicalEditorNamespace:props.lexicalEditorNamespace??"MDXEditor"}),...props.plugins??[]]},React__default.createElement(EditorRootElement,{className:props.className,overlayContainer:props.overlayContainer},React__default.createElement(LexicalProvider,null,React__default.createElement(RichTextEditor,null))),React__default.createElement(Methods,{mdxRef:ref}))),CAN_USE_DOM="undefined"!=typeof window&&void 0!==window.document.createElement,IS_APPLE=CAN_USE_DOM&&(()=>{var _a;const platform2=null==(_a=navigator.userAgentData)?void 0:_a.platform;return platform2?/mac/i.test(platform2):/Mac|iPod|iPhone|iPad/.test(navigator.userAgent)})();const LexicalHeadingVisitor={testLexicalNode:Ft$1,visitLexicalNode:({lexicalNode:lexicalNode,actions:actions})=>{const depth=parseInt(lexicalNode.getTag()[1],10);actions.addAndStepInto("heading",{depth:depth})}},MdastHeadingVisitor={testNode:"heading",visitNode:function({mdastNode:mdastNode,actions:actions}){actions.addAndStepInto(At(`h${mdastNode.depth}`))}},FORMATTING_KEYS=["Digit0","Digit1","Digit2","Digit3","Digit4","Digit5","Digit6"],ALL_HEADING_LEVELS=[1,2,3,4,5,6],CODE_TO_HEADING_LEVEL_MAP={Digit1:1,Digit2:2,Digit3:3,Digit4:4,Digit5:5,Digit6:6},allowedHeadingLevels$=$$4(ALL_HEADING_LEVELS,r2=>{r2.pub(createRootEditorSubscription$,theRootEditor=>theRootEditor.registerCommand(Se,event=>{const{code:code2,ctrlKey:ctrlKey,metaKey:metaKey,altKey:altKey}=event;return!!(FORMATTING_KEYS.includes(code2)&&function(metaKey,ctrlKey){return IS_APPLE?metaKey:ctrlKey}(metaKey,ctrlKey)&&altKey)&&(event.preventDefault(),theRootEditor.update(()=>{if("Digit0"===code2)r2.pub(convertSelectionToNode$,()=>Fi());else{const allowedHeadingLevels=r2.getValue(allowedHeadingLevels$),requestedHeadingLevel=CODE_TO_HEADING_LEVEL_MAP[code2];allowedHeadingLevels.includes(requestedHeadingLevel)&&r2.pub(convertSelectionToNode$,()=>At(`h${requestedHeadingLevel}`))}}),!0)},1))}),headingsPlugin=realmPlugin({init(realm){realm.pubIn({[addActivePlugin$]:"headings",[addImportVisitor$]:MdastHeadingVisitor,[addLexicalNode$]:Et$1,[addExportVisitor$]:LexicalHeadingVisitor})},update(realm,params){realm.pub(allowedHeadingLevels$,(null==params?void 0:params.allowedHeadingLevels)??ALL_HEADING_LEVELS)}});function d$1(e2,t2){return e2.getEditorState().read(()=>{const e3=_s(t2);return null!==e3&&e3.isSelected()})}function u(c2){const[u2]=o$5(),[p2,s2]=reactExports.useState(()=>d$1(u2,c2));return reactExports.useEffect(()=>{let e2=!0;const t2=u2.registerUpdateListener(()=>{e2&&s2(d$1(u2,c2))});return()=>{e2=!1,t2()}},[u2,c2]),[p2,reactExports.useCallback(e2=>{u2.update(()=>{let a2=wr();fr(a2)||(a2=Tr(),ks(a2)),fr(a2)&&(e2?a2.add(c2):a2.delete(c2))})},[u2,c2]),reactExports.useCallback(()=>{u2.update(()=>{const e2=wr();fr(e2)&&e2.clear()})},[u2])]}const p=oe$1("INSERT_HORIZONTAL_RULE_COMMAND");function d({nodeKey:c2}){const[i2]=o$5(),[u$12,s2,p2]=u(c2);return reactExports.useEffect(()=>j$2(i2.registerCommand(ae,e2=>{const t2=i2.getElementByKey(c2);return e2.target===t2&&(e2.shiftKey||p2(),s2(!u$12),!0)},1)),[p2,i2,u$12,c2,s2]),reactExports.useEffect(()=>{const e2=i2.getElementByKey(c2),t2=i2._config.theme.hrSelected??"selected";null!==e2&&(u$12?rt$3(e2,t2):it$2(e2,t2))},[i2,u$12,c2]),null}let f$1=class f extends _i{static getType(){return"horizontalrule"}static clone(e2){return new f(e2.__key)}static importJSON(e2){return y().updateFromJSON(e2)}static importDOM(){return{hr:()=>({conversion:x$1,priority:0})}}exportDOM(){return{element:document.createElement("hr")}}createDOM(e2){const t2=document.createElement("hr");return rt$3(t2,e2.theme.hr),t2}getTextContent(){return"\n"}isInline(){return!1}updateDOM(){return!1}decorate(){return jsxRuntimeExports.jsx(d,{nodeKey:this.__key})}};function x$1(){return{node:y()}}function y(){return lo(new f$1)}function h$2(e2){return e2 instanceof f$1}function n$1(){const[n2]=o$5();return reactExports.useEffect(()=>n2.registerCommand(p,o2=>{const r2=wr();if(!ar(r2))return!1;if(null!==r2.focus.getNode()){St$3(y())}return!0},0),[n2]),null}const LexicalThematicBreakVisitor={testLexicalNode:h$2,visitLexicalNode({actions:actions}){actions.addAndStepInto("thematicBreak")}},MdastThematicBreakVisitor={testNode:"thematicBreak",visitNode({actions:actions}){actions.addAndStepInto(y())}},insertThematicBreak$=q$3(r2=>{r2.sub(r2.pipe(insertThematicBreak$,tt$4(activeEditor$)),([,theEditor])=>{null==theEditor||theEditor.dispatchCommand(p,void 0)})}),thematicBreakPlugin=realmPlugin({init(realm){realm.pubIn({[addActivePlugin$]:"thematicBreak",[addImportVisitor$]:MdastThematicBreakVisitor,[addLexicalNode$]:f$1,[addExportVisitor$]:LexicalThematicBreakVisitor,[addComposerChild$]:n$1})}}),MdastListVisitor={testNode:"list",visitNode:function({mdastNode:mdastNode,lexicalParent:lexicalParent,actions:actions}){const lexicalNode=ct$1(mdastNode.children.some(e2=>"boolean"==typeof e2.checked)?"check":mdastNode.ordered?"number":"bullet");if(nt$2(lexicalParent)){const dedicatedParent=et$2();dedicatedParent.append(lexicalNode),lexicalParent.insertAfter(dedicatedParent)}else lexicalParent.append(lexicalNode);actions.visitChildren(mdastNode,lexicalNode)}},MdastListItemVisitor={testNode:"listItem",visitNode({mdastNode:mdastNode,actions:actions,lexicalParent:lexicalParent}){const isChecked="check"===lexicalParent.getListType()?mdastNode.checked??!1:void 0;actions.addAndStepInto(et$2(isChecked))}},LexicalListVisitor={testLexicalNode:at,visitLexicalNode:({lexicalNode:lexicalNode,actions:actions})=>{actions.addAndStepInto("list",{ordered:"number"===lexicalNode.getListType(),spread:!1})}},LexicalListItemVisitor={testLexicalNode:nt$2,visitLexicalNode:({lexicalNode:lexicalNode,mdastParent:mdastParent,actions:actions})=>{const children=lexicalNode.getChildren(),firstChild=children[0];if(1===children.length&&at(firstChild)){const prevListItemNode=mdastParent.children.at(-1);prevListItemNode?actions.visitChildren(lexicalNode,prevListItemNode):actions.visitChildren(firstChild,mdastParent)}else{const parentList=lexicalNode.getParent(),listItem2=actions.appendToParent(mdastParent,{type:"listItem",checked:"check"===parentList.getListType()?Boolean(lexicalNode.getChecked()):void 0,spread:!1,children:[]});let surroundingParagraph=null;for(const child of lexicalNode.getChildren())Zn(child)||Ln(child)||child.isInline()&&(hi(child)||pi(child))?(surroundingParagraph??(surroundingParagraph=actions.appendToParent(listItem2,{type:"paragraph",children:[]})),actions.visit(child,surroundingParagraph)):(surroundingParagraph=null,actions.visit(child,listItem2))}}};function h$1({maxIndent:e2}){const[n2]=o$5();return reactExports.useEffect(()=>{return g2=e2,j$2((t2=n2).registerCommand(De,e2=>{const o2=wr();if(!ar(o2))return!1;e2.preventDefault();const u2=function(t3){if(function(t2,e2){const n2=[];for(let o2=0;o2<t2.length;o2++){const r2=e2(t2[o2]);null!==r2&&n2.push(r2)}return n2}(t3.getNodes(),t4=>Sr(t4)&&t4.canIndent()?t4:null).length>0)return!0;const o3=t3.anchor,c2=t3.focus,i2=c2.isBefore(o3)?c2:o3,a2=yt$3(i2.getNode());if(a2.canIndent()){const t4=a2.getKey();let e4=kr();if(e4.anchor.set(t4,0,"element"),e4.focus.set(t4,0,"element"),e4=Tt$3(e4),e4.anchor.is(i2))return!0}return!1}(o2)?e2.shiftKey?Ie:Le:Fe;return t2.dispatchCommand(u2,void 0)},0),t2.registerCommand(Le,()=>{if(null==g2)return!1;const t3=wr();if(!ar(t3))return!1;const e2=t3.getNodes().map(t4=>yt$3(t4).getIndent());return Math.max(...e2)+1>=g2},4));var t2,g2},[n2,e2]),null}function e$2(){const[e2]=o$5();return reactExports.useEffect(()=>{return j$2((t2=e2).registerCommand(gt$1,()=>($$1("check"),!0),1),t2.registerCommand(we,e2=>mt$1(e2,t2,!1),1),t2.registerCommand(be,e2=>mt$1(e2,t2,!0),1),t2.registerCommand(Ae,()=>{if(null!=pt$1()){const e2=t2.getRootElement();return null!=e2&&e2.focus(),!0}return!1},1),t2.registerCommand(Oe,e2=>{const n2=pt$1();return!(null==n2||!t2.isEditable()||(t2.update(()=>{const t3=ms(n2);nt$2(t3)&&(e2.preventDefault(),t3.toggleChecked())}),0))},1),t2.registerCommand(Te,e2=>t2.getEditorState().read(()=>{const n2=wr();if(ar(n2)&&n2.isCollapsed()){const{anchor:r2}=n2,i2="element"===r2.type;if(i2||0===r2.offset){const n3=r2.getNode(),o2=wt$2(n3,t3=>hi(t3)&&!t3.isInline());if(nt$2(o2)){const r3=o2.getParent();if(at(r3)&&"check"===r3.getListType()&&(i2||o2.getFirstDescendant()===n3)){const n4=t2.getElementByKey(o2.__key);if(null!=n4&&document.activeElement!==n4)return n4.focus(),e2.preventDefault(),!0}}}}return!1}),1),t2.registerRootListener((t3,e2)=>{null!==t3&&(t3.addEventListener("click",ft),t3.addEventListener("pointerdown",dt$1)),null!==e2&&(e2.removeEventListener("click",ft),e2.removeEventListener("pointerdown",dt$1))}));var t2},[e2]),null}function s({hasStrictIndent:s2=!1}){const[c2]=o$5();return reactExports.useEffect(()=>{if(!c2.hasNodes([rt$2,Y$2]))throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[c2]),reactExports.useEffect(()=>{if(s2)return function(t2){const e2=t3=>{const e3=t3.getParent();if(at(t3.getFirstChild())||!at(e3))return;const n2=wt$2(t3,t4=>nt$2(t4)&&at(t4.getParent())&&nt$2(t4.getPreviousSibling()));if(null===n2&&t3.getIndent()>0)t3.setIndent(0);else if(nt$2(n2)){const r2=n2.getPreviousSibling();if(nt$2(r2)){const i2=function(t4){let e4=t4,n4=e4.getFirstChild();for(;at(n4);){const t5=n4.getLastChild();if(!nt$2(t5))break;e4=t5,n4=e4.getFirstChild()}return e4}(r2).getParent();if(at(i2)){const n4=M$2(i2);n4+1<M$2(e3)&&t3.setIndent(n4)}}}};return t2.registerNodeTransform(rt$2,t3=>{const n2=[t3];for(;n2.length>0;){const t4=n2.shift();if(at(t4))for(const r2 of t4.getChildren())if(nt$2(r2)){e2(r2);const t5=r2.getFirstChild();at(t5)&&n2.push(t5)}}})}(c2)},[c2,s2]),r2=c2,reactExports.useEffect(()=>St$1(r2),[r2]),null;var r2}const tasklistCheck={name:"tasklistCheck",tokenize:function(effects,ok2,nok){const self2=this;return function(code2){if(null!==self2.previous||!self2._gfmTasklistFirstContentOfListItem)return nok(code2);return effects.enter("taskListCheck"),effects.enter("taskListCheckMarker"),effects.consume(code2),effects.exit("taskListCheckMarker"),inside};function inside(code2){return markdownLineEndingOrSpace(code2)?(effects.enter("taskListCheckValueUnchecked"),effects.consume(code2),effects.exit("taskListCheckValueUnchecked"),close):88===code2||120===code2?(effects.enter("taskListCheckValueChecked"),effects.consume(code2),effects.exit("taskListCheckValueChecked"),close):nok(code2)}function close(code2){return 93===code2?(effects.enter("taskListCheckMarker"),effects.consume(code2),effects.exit("taskListCheckMarker"),effects.exit("taskListCheck"),after):nok(code2)}function after(code2){return markdownLineEnding(code2)?ok2(code2):markdownSpace(code2)?effects.check({tokenize:spaceThenNonSpace},ok2,nok)(code2):nok(code2)}}};function spaceThenNonSpace(effects,ok2,nok){return factorySpace(effects,function(code2){return null===code2?nok(code2):ok2(code2)},"whitespace")}function exitCheck(token){const node2=this.stack[this.stack.length-2];node2.type,node2.checked="taskListCheckValueChecked"===token.type}function exitParagraphWithTaskListItem(token){const parent=this.stack[this.stack.length-2];if(parent&&"listItem"===parent.type&&"boolean"==typeof parent.checked){const node2=this.stack[this.stack.length-1];node2.type;const head=node2.children[0];if(head&&"text"===head.type){const siblings=parent.children;let firstParaghraph,index2=-1;for(;++index2<siblings.length;){const sibling=siblings[index2];if("paragraph"===sibling.type){firstParaghraph=sibling;break}}firstParaghraph===node2&&(head.value=head.value.slice(1),0===head.value.length?node2.children.shift():node2.position&&head.position&&"number"==typeof head.position.start.offset&&(head.position.start.column++,head.position.start.offset++,node2.position.start=Object.assign({},head.position.start)))}}this.exit(token)}function listItemWithTaskListItem(node2,parent,state,info){const head=node2.children[0],checkable="boolean"==typeof node2.checked&&head&&"paragraph"===head.type,checkbox="["+(node2.checked?"x":" ")+"] ",tracker=state.createTracker(info);checkable&&tracker.move(checkbox);let value=handle.listItem(node2,parent,state,{...info,...tracker.current()});return checkable&&(value=value.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,function($0){return $0+checkbox})),value}const ListTypeCommandMap=new Map([["number",Ct$1],["bullet",yt$1],["check",gt$1],["",Tt$1]]),currentListType$=$$4("",r2=>{r2.sub(r2.pipe(currentSelection$,tt$4(activeEditor$)),([selection2,theEditor])=>{if(!selection2||!theEditor)return;const anchorNode=selection2.anchor.getNode();let element2="root"===anchorNode.getKey()?anchorNode:wt$2(anchorNode,e2=>{const parent=e2.getParent();return null!==parent&&so(parent)});element2??(element2=anchorNode.getTopLevelElementOrThrow());const elementKey=element2.getKey();if(null!==theEditor.getElementByKey(elementKey))if(at(element2)){const parentList=vt$3(anchorNode,rt$2),type=parentList?parentList.getListType():element2.getListType();r2.pub(currentListType$,type)}else r2.pub(currentListType$,"")})}),applyListType$=K$3(r2=>{r2.sub(r2.pipe(applyListType$,tt$4(activeEditor$)),([listType,theEditor])=>{null==theEditor||theEditor.dispatchCommand(ListTypeCommandMap.get(listType),void 0)})}),listsPlugin=realmPlugin({init(realm){var _a;null==(_a=realm.getValue(rootEditor$))||_a.registerCommand(Le,()=>!function(maxDepth){const selection2=wr();if(!ar(selection2))return!1;const elementNodesInSelection=function(selection2){const nodesInSelection=selection2.getNodes();if(0===nodesInSelection.length)return new Set([selection2.anchor.getNode().getParentOrThrow(),selection2.focus.getNode().getParentOrThrow()]);return new Set(nodesInSelection.map(n2=>hi(n2)?n2:n2.getParentOrThrow()))}(selection2);let totalDepth=0;for(const elementNode of elementNodesInSelection)if(at(elementNode))totalDepth=Math.max(M$2(elementNode)+1,totalDepth);else if(nt$2(elementNode)){const parent=elementNode.getParent();if(1===(null==parent?void 0:parent.getChildren().length)){const grandParentListItem=parent.getParent();if(nt$2(grandParentListItem)&&1===grandParentListItem.getChildren().length)return!1}if(!at(parent))throw new Error("ListMaxIndentLevelPlugin: A ListItemNode must have a ListNode for a parent.");totalDepth=Math.max(M$2(parent)+1,totalDepth)}return totalDepth<=maxDepth}(7),4),realm.pubIn({[addActivePlugin$]:"lists",[addMdastExtension$]:{exit:{taskListCheckValueChecked:exitCheck,taskListCheckValueUnchecked:exitCheck,paragraph:exitParagraphWithTaskListItem}},[addSyntaxExtension$]:{text:{91:tasklistCheck}},[addImportVisitor$]:[MdastListVisitor,MdastListItemVisitor],[addLexicalNode$]:[Y$2,rt$2],[addExportVisitor$]:[LexicalListVisitor,LexicalListItemVisitor],[addToMarkdownExtension$]:{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:listItemWithTaskListItem}},[addComposerChild$]:[h$1,s,e$2],[addNestedEditorChild$]:[h$1,s,e$2]})}});function defaultStringLength(value){return value.length}function serialize(value){return null==value?"":String(value)}function toAlignment(value){const code2="string"==typeof value?value.codePointAt(0):0;return 67===code2||99===code2?99:76===code2||108===code2?108:82===code2||114===code2?114:0}function enterTable(token){const align=token._align;this.enter({type:"table",align:align.map(function(d2){return"none"===d2?null:d2}),children:[]},token),this.data.inTable=!0}function exitTable(token){this.exit(token),this.data.inTable=void 0}function enterRow(token){this.enter({type:"tableRow",children:[]},token)}function exit(token){this.exit(token)}function enterCell(token){this.enter({type:"tableCell",children:[]},token)}function exitCodeText(token){let value=this.resume();this.data.inTable&&(value=value.replace(/\\([\\|])/g,replace));const node2=this.stack[this.stack.length-1];node2.type,node2.value=value,this.exit(token)}function replace($0,$1){return"|"===$1?$1:$0}function gfmTableToMarkdown(options){const settings=options||{},padding=settings.tableCellPadding,alignDelimiters=settings.tablePipeAlign,stringLength=settings.stringLength,around=padding?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:"\n",inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[\t :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:function(node2,parent,state){let value=handle.inlineCode(node2,parent,state);state.stack.includes("tableCell")&&(value=value.replace(/\|/g,"\\$&"));return value},table:function(node2,_2,state,info){return serializeData(function(node2,state,info){const children=node2.children;let index2=-1;const result=[],subexit=state.enter("table");for(;++index2<children.length;)result[index2]=handleTableRowAsData(children[index2],state,info);return subexit(),result}(node2,state,info),node2.align)},tableCell:handleTableCell,tableRow:function(node2,_2,state,info){const value=serializeData([handleTableRowAsData(node2,state,info)]);return value.slice(0,value.indexOf("\n"))}}};function handleTableCell(node2,_2,state,info){const exit2=state.enter("tableCell"),subexit=state.enter("phrasing"),value=state.containerPhrasing(node2,{...info,before:around,after:around});return subexit(),exit2(),value}function serializeData(matrix,align){return function(table,options){const settings=options||{},align=(settings.align||[]).concat(),stringLength=settings.stringLength||defaultStringLength,alignments=[],cellMatrix=[],sizeMatrix=[],longestCellByColumn=[];let mostCellsPerRow=0,rowIndex=-1;for(;++rowIndex<table.length;){const row2=[],sizes2=[];let columnIndex2=-1;for(table[rowIndex].length>mostCellsPerRow&&(mostCellsPerRow=table[rowIndex].length);++columnIndex2<table[rowIndex].length;){const cell=serialize(table[rowIndex][columnIndex2]);if(!1!==settings.alignDelimiters){const size2=stringLength(cell);sizes2[columnIndex2]=size2,(void 0===longestCellByColumn[columnIndex2]||size2>longestCellByColumn[columnIndex2])&&(longestCellByColumn[columnIndex2]=size2)}row2.push(cell)}cellMatrix[rowIndex]=row2,sizeMatrix[rowIndex]=sizes2}let columnIndex=-1;if("object"==typeof align&&"length"in align)for(;++columnIndex<mostCellsPerRow;)alignments[columnIndex]=toAlignment(align[columnIndex]);else{const code2=toAlignment(align);for(;++columnIndex<mostCellsPerRow;)alignments[columnIndex]=code2}columnIndex=-1;const row=[],sizes=[];for(;++columnIndex<mostCellsPerRow;){const code2=alignments[columnIndex];let before="",after="";99===code2?(before=":",after=":"):108===code2?before=":":114===code2&&(after=":");let size2=!1===settings.alignDelimiters?1:Math.max(1,longestCellByColumn[columnIndex]-before.length-after.length);const cell=before+"-".repeat(size2)+after;!1!==settings.alignDelimiters&&(size2=before.length+size2+after.length,size2>longestCellByColumn[columnIndex]&&(longestCellByColumn[columnIndex]=size2),sizes[columnIndex]=size2),row[columnIndex]=cell}cellMatrix.splice(1,0,row),sizeMatrix.splice(1,0,sizes),rowIndex=-1;const lines=[];for(;++rowIndex<cellMatrix.length;){const row2=cellMatrix[rowIndex],sizes2=sizeMatrix[rowIndex];columnIndex=-1;const line=[];for(;++columnIndex<mostCellsPerRow;){const cell=row2[columnIndex]||"";let before="",after="";if(!1!==settings.alignDelimiters){const size2=longestCellByColumn[columnIndex]-(sizes2[columnIndex]||0),code2=alignments[columnIndex];114===code2?before=" ".repeat(size2):99===code2?size2%2?(before=" ".repeat(size2/2+.5),after=" ".repeat(size2/2-.5)):(before=" ".repeat(size2/2),after=before):after=" ".repeat(size2)}!1===settings.delimiterStart||columnIndex||line.push("|"),!1===settings.padding||!1===settings.alignDelimiters&&""===cell||!1===settings.delimiterStart&&!columnIndex||line.push(" "),!1!==settings.alignDelimiters&&line.push(before),line.push(cell),!1!==settings.alignDelimiters&&line.push(after),!1!==settings.padding&&line.push(" "),!1===settings.delimiterEnd&&columnIndex===mostCellsPerRow-1||line.push("|")}lines.push(!1===settings.delimiterEnd?line.join("").replace(/ +$/,""):line.join(""))}return lines.join("\n")}(matrix,{align:align,alignDelimiters:alignDelimiters,padding:padding,stringLength:stringLength})}function handleTableRowAsData(node2,state,info){const children=node2.children;let index2=-1;const result=[],subexit=state.enter("tableRow");for(;++index2<children.length;)result[index2]=handleTableCell(children[index2],0,state,info);return subexit(),result}}class EditMap{constructor(){this.map=[]}add(index2,remove,add){!function(editMap,at2,remove,add){let index2=0;if(0===remove&&0===add.length)return;for(;index2<editMap.map.length;){if(editMap.map[index2][0]===at2)return editMap.map[index2][1]+=remove,void editMap.map[index2][2].push(...add);index2+=1}editMap.map.push([at2,remove,add])}(this,index2,remove,add)}consume(events){if(this.map.sort(function(a2,b2){return a2[0]-b2[0]}),0===this.map.length)return;let index2=this.map.length;const vecs=[];for(;index2>0;)index2-=1,vecs.push(events.slice(this.map[index2][0]+this.map[index2][1]),this.map[index2][2]),events.length=this.map[index2][0];vecs.push(events.slice()),events.length=0;let slice=vecs.pop();for(;slice;){for(const element2 of slice)events.push(element2);slice=vecs.pop()}this.map.length=0}}function gfmTableAlign(events,index2){let inDelimiterRow=!1;const align=[];for(;index2<events.length;){const event=events[index2];if(inDelimiterRow){if("enter"===event[0])"tableContent"===event[1].type&&align.push("tableDelimiterMarker"===events[index2+1][1].type?"left":"none");else if("tableContent"===event[1].type){if("tableDelimiterMarker"===events[index2-1][1].type){const alignIndex=align.length-1;align[alignIndex]="left"===align[alignIndex]?"center":"right"}}else if("tableDelimiterRow"===event[1].type)break}else"enter"===event[0]&&"tableDelimiterRow"===event[1].type&&(inDelimiterRow=!0);index2+=1}return align}function tokenizeTable(effects,ok2,nok){const self2=this;let seen2,size2=0,sizeB=0;return function(code2){let index2=self2.events.length-1;for(;index2>-1;){const type=self2.events[index2][1].type;if("lineEnding"!==type&&"linePrefix"!==type)break;index2--}const tail=index2>-1?self2.events[index2][1].type:null,next="tableHead"===tail||"tableRow"===tail?bodyRowStart:headRowBefore;if(next===bodyRowStart&&self2.parser.lazy[self2.now().line])return nok(code2);return next(code2)};function headRowBefore(code2){return effects.enter("tableHead"),effects.enter("tableRow"),function(code2){if(124===code2)return headRowBreak(code2);return seen2=!0,sizeB+=1,headRowBreak(code2)}(code2)}function headRowBreak(code2){return null===code2?nok(code2):markdownLineEnding(code2)?sizeB>1?(sizeB=0,self2.interrupt=!0,effects.exit("tableRow"),effects.enter("lineEnding"),effects.consume(code2),effects.exit("lineEnding"),headDelimiterStart):nok(code2):markdownSpace(code2)?factorySpace(effects,headRowBreak,"whitespace")(code2):(sizeB+=1,seen2&&(seen2=!1,size2+=1),124===code2?(effects.enter("tableCellDivider"),effects.consume(code2),effects.exit("tableCellDivider"),seen2=!0,headRowBreak):(effects.enter("data"),headRowData(code2)))}function headRowData(code2){return null===code2||124===code2||markdownLineEndingOrSpace(code2)?(effects.exit("data"),headRowBreak(code2)):(effects.consume(code2),92===code2?headRowEscape:headRowData)}function headRowEscape(code2){return 92===code2||124===code2?(effects.consume(code2),headRowData):headRowData(code2)}function headDelimiterStart(code2){return self2.interrupt=!1,self2.parser.lazy[self2.now().line]?nok(code2):(effects.enter("tableDelimiterRow"),seen2=!1,markdownSpace(code2)?factorySpace(effects,headDelimiterBefore,"linePrefix",self2.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(code2):headDelimiterBefore(code2))}function headDelimiterBefore(code2){return 45===code2||58===code2?headDelimiterValueBefore(code2):124===code2?(seen2=!0,effects.enter("tableCellDivider"),effects.consume(code2),effects.exit("tableCellDivider"),headDelimiterCellBefore):headDelimiterNok(code2)}function headDelimiterCellBefore(code2){return markdownSpace(code2)?factorySpace(effects,headDelimiterValueBefore,"whitespace")(code2):headDelimiterValueBefore(code2)}function headDelimiterValueBefore(code2){return 58===code2?(sizeB+=1,seen2=!0,effects.enter("tableDelimiterMarker"),effects.consume(code2),effects.exit("tableDelimiterMarker"),headDelimiterLeftAlignmentAfter):45===code2?(sizeB+=1,headDelimiterLeftAlignmentAfter(code2)):null===code2||markdownLineEnding(code2)?headDelimiterCellAfter(code2):headDelimiterNok(code2)}function headDelimiterLeftAlignmentAfter(code2){return 45===code2?(effects.enter("tableDelimiterFiller"),headDelimiterFiller(code2)):headDelimiterNok(code2)}function headDelimiterFiller(code2){return 45===code2?(effects.consume(code2),headDelimiterFiller):58===code2?(seen2=!0,effects.exit("tableDelimiterFiller"),effects.enter("tableDelimiterMarker"),effects.consume(code2),effects.exit("tableDelimiterMarker"),headDelimiterRightAlignmentAfter):(effects.exit("tableDelimiterFiller"),headDelimiterRightAlignmentAfter(code2))}function headDelimiterRightAlignmentAfter(code2){return markdownSpace(code2)?factorySpace(effects,headDelimiterCellAfter,"whitespace")(code2):headDelimiterCellAfter(code2)}function headDelimiterCellAfter(code2){return 124===code2?headDelimiterBefore(code2):(null===code2||markdownLineEnding(code2))&&seen2&&size2===sizeB?(effects.exit("tableDelimiterRow"),effects.exit("tableHead"),ok2(code2)):headDelimiterNok(code2)}function headDelimiterNok(code2){return nok(code2)}function bodyRowStart(code2){return effects.enter("tableRow"),bodyRowBreak(code2)}function bodyRowBreak(code2){return 124===code2?(effects.enter("tableCellDivider"),effects.consume(code2),effects.exit("tableCellDivider"),bodyRowBreak):null===code2||markdownLineEnding(code2)?(effects.exit("tableRow"),ok2(code2)):markdownSpace(code2)?factorySpace(effects,bodyRowBreak,"whitespace")(code2):(effects.enter("data"),bodyRowData(code2))}function bodyRowData(code2){return null===code2||124===code2||markdownLineEndingOrSpace(code2)?(effects.exit("data"),bodyRowBreak(code2)):(effects.consume(code2),92===code2?bodyRowEscape:bodyRowData)}function bodyRowEscape(code2){return 92===code2||124===code2?(effects.consume(code2),bodyRowData):bodyRowData(code2)}}function resolveTable(events,context){let currentTable,currentBody,currentCell,index2=-1,inFirstCellAwaitingPipe=!0,rowKind=0,lastCell=[0,0,0,0],cell=[0,0,0,0],afterHeadAwaitingFirstBodyRow=!1,lastTableEnd=0;const map2=new EditMap;for(;++index2<events.length;){const event=events[index2],token=event[1];"enter"===event[0]?"tableHead"===token.type?(afterHeadAwaitingFirstBodyRow=!1,0!==lastTableEnd&&(flushTableEnd(map2,context,lastTableEnd,currentTable,currentBody),currentBody=void 0,lastTableEnd=0),currentTable={type:"table",start:Object.assign({},token.start),end:Object.assign({},token.end)},map2.add(index2,0,[["enter",currentTable,context]])):"tableRow"===token.type||"tableDelimiterRow"===token.type?(inFirstCellAwaitingPipe=!0,currentCell=void 0,lastCell=[0,0,0,0],cell=[0,index2+1,0,0],afterHeadAwaitingFirstBodyRow&&(afterHeadAwaitingFirstBodyRow=!1,currentBody={type:"tableBody",start:Object.assign({},token.start),end:Object.assign({},token.end)},map2.add(index2,0,[["enter",currentBody,context]])),rowKind="tableDelimiterRow"===token.type?2:currentBody?3:1):!rowKind||"data"!==token.type&&"tableDelimiterMarker"!==token.type&&"tableDelimiterFiller"!==token.type?"tableCellDivider"===token.type&&(inFirstCellAwaitingPipe?inFirstCellAwaitingPipe=!1:(0!==lastCell[1]&&(cell[0]=cell[1],currentCell=flushCell(map2,context,lastCell,rowKind,void 0,currentCell)),lastCell=cell,cell=[lastCell[1],index2,0,0])):(inFirstCellAwaitingPipe=!1,0===cell[2]&&(0!==lastCell[1]&&(cell[0]=cell[1],currentCell=flushCell(map2,context,lastCell,rowKind,void 0,currentCell),lastCell=[0,0,0,0]),cell[2]=index2)):"tableHead"===token.type?(afterHeadAwaitingFirstBodyRow=!0,lastTableEnd=index2):"tableRow"===token.type||"tableDelimiterRow"===token.type?(lastTableEnd=index2,0!==lastCell[1]?(cell[0]=cell[1],currentCell=flushCell(map2,context,lastCell,rowKind,index2,currentCell)):0!==cell[1]&&(currentCell=flushCell(map2,context,cell,rowKind,index2,currentCell)),rowKind=0):!rowKind||"data"!==token.type&&"tableDelimiterMarker"!==token.type&&"tableDelimiterFiller"!==token.type||(cell[3]=index2)}for(0!==lastTableEnd&&flushTableEnd(map2,context,lastTableEnd,currentTable,currentBody),map2.consume(context.events),index2=-1;++index2<context.events.length;){const event=context.events[index2];"enter"===event[0]&&"table"===event[1].type&&(event[1]._align=gfmTableAlign(context.events,index2))}return events}function flushCell(map2,context,range,rowKind,rowEnd,previousCell){const groupName=1===rowKind?"tableHeader":2===rowKind?"tableDelimiter":"tableData";0!==range[0]&&(previousCell.end=Object.assign({},getPoint(context.events,range[0])),map2.add(range[0],0,[["exit",previousCell,context]]));const now=getPoint(context.events,range[1]);if(previousCell={type:groupName,start:Object.assign({},now),end:Object.assign({},now)},map2.add(range[1],0,[["enter",previousCell,context]]),0!==range[2]){const relatedStart=getPoint(context.events,range[2]),relatedEnd=getPoint(context.events,range[3]),valueToken={type:"tableContent",start:Object.assign({},relatedStart),end:Object.assign({},relatedEnd)};if(map2.add(range[2],0,[["enter",valueToken,context]]),2!==rowKind){const start2=context.events[range[2]],end=context.events[range[3]];if(start2[1].end=Object.assign({},end[1].end),start2[1].type="chunkText",start2[1].contentType="text",range[3]>range[2]+1){const a2=range[2]+1,b2=range[3]-range[2]-1;map2.add(a2,b2,[])}}map2.add(range[3]+1,0,[["exit",valueToken,context]])}return void 0!==rowEnd&&(previousCell.end=Object.assign({},getPoint(context.events,rowEnd)),map2.add(rowEnd,0,[["exit",previousCell,context]]),previousCell=void 0),previousCell}function flushTableEnd(map2,context,index2,table,tableBody){const exits=[],related=getPoint(context.events,index2);tableBody&&(tableBody.end=Object.assign({},related),exits.push(["exit",tableBody,context])),table.end=Object.assign({},related),exits.push(["exit",table,context]),map2.add(index2+1,0,exits)}function getPoint(events,index2){const event=events[index2],side="enter"===event[0]?"start":"end";return event[1][side]}const o$1=[["Cat","rgb(125, 50, 0)"],["Dog","rgb(100, 0, 0)"],["Rabbit","rgb(150, 0, 0)"],["Frog","rgb(200, 0, 0)"],["Fox","rgb(200, 75, 0)"],["Hedgehog","rgb(0, 75, 0)"],["Pigeon","rgb(0, 125, 0)"],["Squirrel","rgb(75, 100, 0)"],["Bear","rgb(125, 100, 0)"],["Tiger","rgb(0, 0, 150)"],["Leopard","rgb(0, 0, 200)"],["Zebra","rgb(0, 0, 250)"],["Wolf","rgb(0, 100, 150)"],["Owl","rgb(0, 100, 100)"],["Gull","rgb(100, 0, 100)"],["Squid","rgb(150, 0, 150)"]],b$1=o$1[Math.floor(Math.random()*o$1.length)],e$1=reactExports.createContext({clientID:0,color:b$1[1],isCollabActive:!1,name:b$1[0],yjsDocMap:new Map});function f2(e2){const t2=new Set,{ownNodeConfig:o2}=Do(e2),r2=e2.transform();if(o2){const e3=o2.$transform;e3&&t2.add(e3)}return r2&&t2.add(r2),t2}function h({initialEditor:i2,children:h2,initialNodes:u2,initialTheme:g2,skipCollabChecks:x2,skipEditableListener:_2}){const v2=reactExports.useRef(!1),w2=reactExports.useContext(r$1);null==w2&&function(e2,...t2){const o2=new URL("https://lexical.dev/docs/error"),r2=new URLSearchParams;r2.append("code",e2);for(const e3 of t2)r2.append("v",e3);throw o2.search=r2.toString(),Error(`Minified Lexical error #${e2}; visit ${o2.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(9);const[E2,{getTheme:k3}]=w2,C2=reactExports.useMemo(()=>{const e2=g2||k3()||void 0,t2=t$3(w2,e2);void 0!==e2&&(i2._config.theme=e2),i2._parentEditor=i2._parentEditor||E2;const s2=i2._createEditorArgs,a2=s2&&s2.namespace;if(u2){a2||(i2._config.namespace=E2._config.namespace);for(let e3 of u2){let t3=null,o2=null;if("function"!=typeof e3){const r2=e3;e3=r2.replace,t3=r2.with,o2=r2.withKlass||null}const s3=qi(i2,e3.getType());i2._nodes.set(e3.getType(),{exportDOM:s3?s3.exportDOM:void 0,klass:e3,replace:t3,replaceWithKlass:o2,sharedNodeState:dt$2(e3),transforms:f2(e3)})}}else if(s2&&s2.nodes)a2||(i2._config.namespace=E2._config.namespace);else{const e3=i2._nodes=new Map(E2._nodes);a2||(i2._config.namespace=E2._config.namespace);for(const[t3,o2]of e3)i2._nodes.set(t3,{exportDOM:o2.exportDOM,klass:o2.klass,replace:o2.replace,replaceWithKlass:o2.replaceWithKlass,sharedNodeState:dt$2(o2.klass),transforms:f2(o2.klass)})}return[i2,t2]},[]),{isCollabActive:b2,yjsDocMap:L2}=reactExports.useContext(e$1),M2=x2||v2.current||L2.has(i2.getKey());return reactExports.useEffect(()=>{M2&&(v2.current=!0)},[M2]),reactExports.useEffect(()=>{if(!_2){const e2=e3=>i2.setEditable(e3);return e2(E2.isEditable()),E2.registerEditableListener(e2)}},[i2,E2,_2]),jsxRuntimeExports.jsx(r$1.Provider,{value:C2,children:!b2||M2?h2:null})}function composeEventHandlers(originalEventHandler,ourEventHandler,{checkForDefaultPrevented:checkForDefaultPrevented=!0}={}){return function(event){if(null==originalEventHandler||originalEventHandler(event),!1===checkForDefaultPrevented||!event.defaultPrevented)return null==ourEventHandler?void 0:ourEventHandler(event)}}function setRef(ref,value){if("function"==typeof ref)return ref(value);null!=ref&&(ref.current=value)}function composeRefs(...refs){return node2=>{let hasCleanup=!1;const cleanups=refs.map(ref=>{const cleanup=setRef(ref,node2);return hasCleanup||"function"!=typeof cleanup||(hasCleanup=!0),cleanup});if(hasCleanup)return()=>{for(let i2=0;i2<cleanups.length;i2++){const cleanup=cleanups[i2];"function"==typeof cleanup?cleanup():setRef(refs[i2],null)}}}}function useComposedRefs(...refs){return reactExports.useCallback(composeRefs(...refs),refs)}function createContextScope(scopeName,createContextScopeDeps=[]){let defaultContexts=[];const createScope=()=>{const scopeContexts=defaultContexts.map(defaultContext=>reactExports.createContext(defaultContext));return function(scope){const contexts=(null==scope?void 0:scope[scopeName])||scopeContexts;return reactExports.useMemo(()=>({[`__scope${scopeName}`]:{...scope,[scopeName]:contexts}}),[scope,contexts])}};return createScope.scopeName=scopeName,[function(rootComponentName,defaultContext){const BaseContext=reactExports.createContext(defaultContext),index2=defaultContexts.length;defaultContexts=[...defaultContexts,defaultContext];const Provider2=props=>{var _a;const{scope:scope,children:children,...context}=props,Context=(null==(_a=null==scope?void 0:scope[scopeName])?void 0:_a[index2])||BaseContext,value=reactExports.useMemo(()=>context,Object.values(context));return jsxRuntimeExports.jsx(Context.Provider,{value:value,children:children})};return Provider2.displayName=rootComponentName+"Provider",[Provider2,function(consumerName,scope){var _a;const Context=(null==(_a=null==scope?void 0:scope[scopeName])?void 0:_a[index2])||BaseContext,context=reactExports.useContext(Context);if(context)return context;if(void 0!==defaultContext)return defaultContext;throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``)}]},composeContextScopes(createScope,...createContextScopeDeps)]}function composeContextScopes(...scopes){const baseScope=scopes[0];if(1===scopes.length)return baseScope;const createScope=()=>{const scopeHooks=scopes.map(createScope2=>({useScope:createScope2(),scopeName:createScope2.scopeName}));return function(overrideScopes){const nextScopes=scopeHooks.reduce((nextScopes2,{useScope:useScope,scopeName:scopeName})=>({...nextScopes2,...useScope(overrideScopes)[`__scope${scopeName}`]}),{});return reactExports.useMemo(()=>({[`__scope${baseScope.scopeName}`]:nextScopes}),[nextScopes])}};return createScope.scopeName=baseScope.scopeName,createScope}function createSlot(ownerName){const SlotClone=createSlotClone(ownerName),Slot2=reactExports.forwardRef((props,forwardedRef)=>{const{children:children,...slotProps}=props,childrenArray=reactExports.Children.toArray(children),slottable=childrenArray.find(isSlottable);if(slottable){const newElement=slottable.props.children,newChildren=childrenArray.map(child=>child===slottable?reactExports.Children.count(newElement)>1?reactExports.Children.only(null):reactExports.isValidElement(newElement)?newElement.props.children:null:child);return jsxRuntimeExports.jsx(SlotClone,{...slotProps,ref:forwardedRef,children:reactExports.isValidElement(newElement)?reactExports.cloneElement(newElement,void 0,newChildren):null})}return jsxRuntimeExports.jsx(SlotClone,{...slotProps,ref:forwardedRef,children:children})});return Slot2.displayName=`${ownerName}.Slot`,Slot2}function createSlotClone(ownerName){const SlotClone=reactExports.forwardRef((props,forwardedRef)=>{const{children:children,...slotProps}=props;if(reactExports.isValidElement(children)){const childrenRef=function(element2){var _a,_b;let getter=null==(_a=Object.getOwnPropertyDescriptor(element2.props,"ref"))?void 0:_a.get,mayWarn=getter&&"isReactWarning"in getter&&getter.isReactWarning;if(mayWarn)return element2.ref;if(getter=null==(_b=Object.getOwnPropertyDescriptor(element2,"ref"))?void 0:_b.get,mayWarn=getter&&"isReactWarning"in getter&&getter.isReactWarning,mayWarn)return element2.props.ref;return element2.props.ref||element2.ref}(children),props2=function(slotProps,childProps){const overrideProps={...childProps};for(const propName in childProps){const slotPropValue=slotProps[propName],childPropValue=childProps[propName];/^on[A-Z]/.test(propName)?slotPropValue&&childPropValue?overrideProps[propName]=(...args)=>{const result=childPropValue(...args);return slotPropValue(...args),result}:slotPropValue&&(overrideProps[propName]=slotPropValue):"style"===propName?overrideProps[propName]={...slotPropValue,...childPropValue}:"className"===propName&&(overrideProps[propName]=[slotPropValue,childPropValue].filter(Boolean).join(" "))}return{...slotProps,...overrideProps}}(slotProps,children.props);return children.type!==reactExports.Fragment&&(props2.ref=forwardedRef?composeRefs(forwardedRef,childrenRef):childrenRef),reactExports.cloneElement(children,props2)}return reactExports.Children.count(children)>1?reactExports.Children.only(null):null});return SlotClone.displayName=`${ownerName}.SlotClone`,SlotClone}var SLOTTABLE_IDENTIFIER=Symbol("radix.slottable");function createSlottable(ownerName){const Slottable2=({children:children})=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:children});return Slottable2.displayName=`${ownerName}.Slottable`,Slottable2.__radixId=SLOTTABLE_IDENTIFIER,Slottable2}function isSlottable(child){return reactExports.isValidElement(child)&&"function"==typeof child.type&&"__radixId"in child.type&&child.type.__radixId===SLOTTABLE_IDENTIFIER}var Primitive=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((primitive,node2)=>{const Slot2=createSlot(`Primitive.${node2}`),Node2=reactExports.forwardRef((props,forwardedRef)=>{const{asChild:asChild,...primitiveProps}=props,Comp=asChild?Slot2:node2;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),jsxRuntimeExports.jsx(Comp,{...primitiveProps,ref:forwardedRef})});return Node2.displayName=`Primitive.${node2}`,{...primitive,[node2]:Node2}},{});function useCallbackRef$1(callback){const callbackRef=reactExports.useRef(callback);return reactExports.useEffect(()=>{callbackRef.current=callback}),reactExports.useMemo(()=>(...args)=>{var _a;return null==(_a=callbackRef.current)?void 0:_a.call(callbackRef,...args)},[])}var originalBodyPointerEvents,DismissableLayerContext=reactExports.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),DismissableLayer=reactExports.forwardRef((props,forwardedRef)=>{const{disableOutsidePointerEvents:disableOutsidePointerEvents=!1,onEscapeKeyDown:onEscapeKeyDown,onPointerDownOutside:onPointerDownOutside,onFocusOutside:onFocusOutside,onInteractOutside:onInteractOutside,onDismiss:onDismiss,...layerProps}=props,context=reactExports.useContext(DismissableLayerContext),[node2,setNode]=reactExports.useState(null),ownerDocument=(null==node2?void 0:node2.ownerDocument)??(null==globalThis?void 0:globalThis.document),[,force]=reactExports.useState({}),composedRefs=useComposedRefs(forwardedRef,node22=>setNode(node22)),layers=Array.from(context.layers),[highestLayerWithOutsidePointerEventsDisabled]=[...context.layersWithOutsidePointerEventsDisabled].slice(-1),highestLayerWithOutsidePointerEventsDisabledIndex=layers.indexOf(highestLayerWithOutsidePointerEventsDisabled),index2=node2?layers.indexOf(node2):-1,isBodyPointerEventsDisabled=context.layersWithOutsidePointerEventsDisabled.size>0,isPointerEventsEnabled=index2>=highestLayerWithOutsidePointerEventsDisabledIndex,pointerDownOutside=function(onPointerDownOutside,ownerDocument=(null==globalThis?void 0:globalThis.document)){const handlePointerDownOutside=useCallbackRef$1(onPointerDownOutside),isPointerInsideReactTreeRef=reactExports.useRef(!1),handleClickRef=reactExports.useRef(()=>{});return reactExports.useEffect(()=>{const handlePointerDown=event=>{if(event.target&&!isPointerInsideReactTreeRef.current){let handleAndDispatchPointerDownOutsideEvent2=function(){handleAndDispatchCustomEvent("dismissableLayer.pointerDownOutside",handlePointerDownOutside,eventDetail,{discrete:!0})};const eventDetail={originalEvent:event};"touch"===event.pointerType?(ownerDocument.removeEventListener("click",handleClickRef.current),handleClickRef.current=handleAndDispatchPointerDownOutsideEvent2,ownerDocument.addEventListener("click",handleClickRef.current,{once:!0})):handleAndDispatchPointerDownOutsideEvent2()}else ownerDocument.removeEventListener("click",handleClickRef.current);isPointerInsideReactTreeRef.current=!1},timerId=window.setTimeout(()=>{ownerDocument.addEventListener("pointerdown",handlePointerDown)},0);return()=>{window.clearTimeout(timerId),ownerDocument.removeEventListener("pointerdown",handlePointerDown),ownerDocument.removeEventListener("click",handleClickRef.current)}},[ownerDocument,handlePointerDownOutside]),{onPointerDownCapture:()=>isPointerInsideReactTreeRef.current=!0}}(event=>{const target=event.target,isPointerDownOnBranch=[...context.branches].some(branch=>branch.contains(target));isPointerEventsEnabled&&!isPointerDownOnBranch&&(null==onPointerDownOutside||onPointerDownOutside(event),null==onInteractOutside||onInteractOutside(event),event.defaultPrevented||null==onDismiss||onDismiss())},ownerDocument),focusOutside=function(onFocusOutside,ownerDocument=(null==globalThis?void 0:globalThis.document)){const handleFocusOutside=useCallbackRef$1(onFocusOutside),isFocusInsideReactTreeRef=reactExports.useRef(!1);return reactExports.useEffect(()=>{const handleFocus=event=>{if(event.target&&!isFocusInsideReactTreeRef.current){handleAndDispatchCustomEvent("dismissableLayer.focusOutside",handleFocusOutside,{originalEvent:event},{discrete:!1})}};return ownerDocument.addEventListener("focusin",handleFocus),()=>ownerDocument.removeEventListener("focusin",handleFocus)},[ownerDocument,handleFocusOutside]),{onFocusCapture:()=>isFocusInsideReactTreeRef.current=!0,onBlurCapture:()=>isFocusInsideReactTreeRef.current=!1}}(event=>{const target=event.target;[...context.branches].some(branch=>branch.contains(target))||(null==onFocusOutside||onFocusOutside(event),null==onInteractOutside||onInteractOutside(event),event.defaultPrevented||null==onDismiss||onDismiss())},ownerDocument);return function(onEscapeKeyDownProp,ownerDocument=(null==globalThis?void 0:globalThis.document)){const onEscapeKeyDown=useCallbackRef$1(onEscapeKeyDownProp);reactExports.useEffect(()=>{const handleKeyDown=event=>{"Escape"===event.key&&onEscapeKeyDown(event)};return ownerDocument.addEventListener("keydown",handleKeyDown,{capture:!0}),()=>ownerDocument.removeEventListener("keydown",handleKeyDown,{capture:!0})},[onEscapeKeyDown,ownerDocument])}(event=>{index2===context.layers.size-1&&(null==onEscapeKeyDown||onEscapeKeyDown(event),!event.defaultPrevented&&onDismiss&&(event.preventDefault(),onDismiss()))},ownerDocument),reactExports.useEffect(()=>{if(node2)return disableOutsidePointerEvents&&(0===context.layersWithOutsidePointerEventsDisabled.size&&(originalBodyPointerEvents=ownerDocument.body.style.pointerEvents,ownerDocument.body.style.pointerEvents="none"),context.layersWithOutsidePointerEventsDisabled.add(node2)),context.layers.add(node2),dispatchUpdate(),()=>{disableOutsidePointerEvents&&1===context.layersWithOutsidePointerEventsDisabled.size&&(ownerDocument.body.style.pointerEvents=originalBodyPointerEvents)}},[node2,ownerDocument,disableOutsidePointerEvents,context]),reactExports.useEffect(()=>()=>{node2&&(context.layers.delete(node2),context.layersWithOutsidePointerEventsDisabled.delete(node2),dispatchUpdate())},[node2,context]),reactExports.useEffect(()=>{const handleUpdate=()=>force({});return document.addEventListener("dismissableLayer.update",handleUpdate),()=>document.removeEventListener("dismissableLayer.update",handleUpdate)},[]),jsxRuntimeExports.jsx(Primitive.div,{...layerProps,ref:composedRefs,style:{pointerEvents:isBodyPointerEventsDisabled?isPointerEventsEnabled?"auto":"none":void 0,...props.style},onFocusCapture:composeEventHandlers(props.onFocusCapture,focusOutside.onFocusCapture),onBlurCapture:composeEventHandlers(props.onBlurCapture,focusOutside.onBlurCapture),onPointerDownCapture:composeEventHandlers(props.onPointerDownCapture,pointerDownOutside.onPointerDownCapture)})});DismissableLayer.displayName="DismissableLayer";function dispatchUpdate(){const event=new CustomEvent("dismissableLayer.update");document.dispatchEvent(event)}function handleAndDispatchCustomEvent(name,handler,detail,{discrete:discrete}){const target=detail.originalEvent.target,event=new CustomEvent(name,{bubbles:!1,cancelable:!0,detail:detail});handler&&target.addEventListener(name,handler,{once:!0}),discrete?function(target,event){target&&reactDomExports.flushSync(()=>target.dispatchEvent(event))}(target,event):target.dispatchEvent(event)}reactExports.forwardRef((props,forwardedRef)=>{const context=reactExports.useContext(DismissableLayerContext),ref=reactExports.useRef(null),composedRefs=useComposedRefs(forwardedRef,ref);return reactExports.useEffect(()=>{const node2=ref.current;if(node2)return context.branches.add(node2),()=>{context.branches.delete(node2)}},[context.branches]),jsxRuntimeExports.jsx(Primitive.div,{...props,ref:composedRefs})}).displayName="DismissableLayerBranch";var count$1=0;function useFocusGuards(){reactExports.useEffect(()=>{const edgeGuards=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",edgeGuards[0]??createFocusGuard()),document.body.insertAdjacentElement("beforeend",edgeGuards[1]??createFocusGuard()),count$1++,()=>{1===count$1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(node2=>node2.remove()),count$1--}},[])}function createFocusGuard(){const element2=document.createElement("span");return element2.setAttribute("data-radix-focus-guard",""),element2.tabIndex=0,element2.style.outline="none",element2.style.opacity="0",element2.style.position="fixed",element2.style.pointerEvents="none",element2}var EVENT_OPTIONS$1={bubbles:!1,cancelable:!0},FocusScope=reactExports.forwardRef((props,forwardedRef)=>{const{loop:loop=!1,trapped:trapped=!1,onMountAutoFocus:onMountAutoFocusProp,onUnmountAutoFocus:onUnmountAutoFocusProp,...scopeProps}=props,[container,setContainer]=reactExports.useState(null),onMountAutoFocus=useCallbackRef$1(onMountAutoFocusProp),onUnmountAutoFocus=useCallbackRef$1(onUnmountAutoFocusProp),lastFocusedElementRef=reactExports.useRef(null),composedRefs=useComposedRefs(forwardedRef,node2=>setContainer(node2)),focusScope=reactExports.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;reactExports.useEffect(()=>{if(trapped){let handleFocusIn2=function(event){if(focusScope.paused||!container)return;const target=event.target;container.contains(target)?lastFocusedElementRef.current=target:focus(lastFocusedElementRef.current,{select:!0})},handleFocusOut2=function(event){if(focusScope.paused||!container)return;const relatedTarget=event.relatedTarget;null!==relatedTarget&&(container.contains(relatedTarget)||focus(lastFocusedElementRef.current,{select:!0}))},handleMutations2=function(mutations){if(document.activeElement===document.body)for(const mutation of mutations)mutation.removedNodes.length>0&&focus(container)};document.addEventListener("focusin",handleFocusIn2),document.addEventListener("focusout",handleFocusOut2);const mutationObserver=new MutationObserver(handleMutations2);return container&&mutationObserver.observe(container,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",handleFocusIn2),document.removeEventListener("focusout",handleFocusOut2),mutationObserver.disconnect()}}},[trapped,container,focusScope.paused]),reactExports.useEffect(()=>{if(container){focusScopesStack.add(focusScope);const previouslyFocusedElement=document.activeElement;if(!container.contains(previouslyFocusedElement)){const mountEvent=new CustomEvent("focusScope.autoFocusOnMount",EVENT_OPTIONS$1);container.addEventListener("focusScope.autoFocusOnMount",onMountAutoFocus),container.dispatchEvent(mountEvent),mountEvent.defaultPrevented||(!function(candidates,{select:select=!1}={}){const previouslyFocusedElement=document.activeElement;for(const candidate of candidates)if(focus(candidate,{select:select}),document.activeElement!==previouslyFocusedElement)return}((items=getTabbableCandidates(container),items.filter(item=>"A"!==item.tagName)),{select:!0}),document.activeElement===previouslyFocusedElement&&focus(container))}return()=>{container.removeEventListener("focusScope.autoFocusOnMount",onMountAutoFocus),setTimeout(()=>{const unmountEvent=new CustomEvent("focusScope.autoFocusOnUnmount",EVENT_OPTIONS$1);container.addEventListener("focusScope.autoFocusOnUnmount",onUnmountAutoFocus),container.dispatchEvent(unmountEvent),unmountEvent.defaultPrevented||focus(previouslyFocusedElement??document.body,{select:!0}),container.removeEventListener("focusScope.autoFocusOnUnmount",onUnmountAutoFocus),focusScopesStack.remove(focusScope)},0)}}var items},[container,onMountAutoFocus,onUnmountAutoFocus,focusScope]);const handleKeyDown=reactExports.useCallback(event=>{if(!loop&&!trapped)return;if(focusScope.paused)return;const isTabKey="Tab"===event.key&&!event.altKey&&!event.ctrlKey&&!event.metaKey,focusedElement=document.activeElement;if(isTabKey&&focusedElement){const container2=event.currentTarget,[first,last]=function(container){const candidates=getTabbableCandidates(container),first=findVisible(candidates,container),last=findVisible(candidates.reverse(),container);return[first,last]}(container2);first&&last?event.shiftKey||focusedElement!==last?event.shiftKey&&focusedElement===first&&(event.preventDefault(),loop&&focus(last,{select:!0})):(event.preventDefault(),loop&&focus(first,{select:!0})):focusedElement===container2&&event.preventDefault()}},[loop,trapped,focusScope.paused]);return jsxRuntimeExports.jsx(Primitive.div,{tabIndex:-1,...scopeProps,ref:composedRefs,onKeyDown:handleKeyDown})});function getTabbableCandidates(container){const nodes=[],walker=document.createTreeWalker(container,NodeFilter.SHOW_ELEMENT,{acceptNode:node2=>{const isHiddenInput="INPUT"===node2.tagName&&"hidden"===node2.type;return node2.disabled||node2.hidden||isHiddenInput?NodeFilter.FILTER_SKIP:node2.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;walker.nextNode();)nodes.push(walker.currentNode);return nodes}function findVisible(elements,container){for(const element2 of elements)if(!isHidden(element2,{upTo:container}))return element2}function isHidden(node2,{upTo:upTo}){if("hidden"===getComputedStyle(node2).visibility)return!0;for(;node2;){if(void 0!==upTo&&node2===upTo)return!1;if("none"===getComputedStyle(node2).display)return!0;node2=node2.parentElement}return!1}function focus(element2,{select:select=!1}={}){if(element2&&element2.focus){const previouslyFocusedElement=document.activeElement;element2.focus({preventScroll:!0}),element2!==previouslyFocusedElement&&function(element2){return element2 instanceof HTMLInputElement&&"select"in element2}(element2)&&select&&element2.select()}}FocusScope.displayName="FocusScope";var focusScopesStack=function(){let stack=[];return{add(focusScope){const activeFocusScope=stack[0];focusScope!==activeFocusScope&&(null==activeFocusScope||activeFocusScope.pause()),stack=arrayRemove(stack,focusScope),stack.unshift(focusScope)},remove(focusScope){var _a;stack=arrayRemove(stack,focusScope),null==(_a=stack[0])||_a.resume()}}}();function arrayRemove(array,item){const updatedArray=[...array],index2=updatedArray.indexOf(item);return-1!==index2&&updatedArray.splice(index2,1),updatedArray}var useLayoutEffect2=(null==globalThis?void 0:globalThis.document)?reactExports.useLayoutEffect:()=>{},useReactId=React[" useId ".trim().toString()]||(()=>{}),count=0;function useId(deterministicId){const[id,setId]=reactExports.useState(useReactId());return useLayoutEffect2(()=>{setId(reactId=>reactId??String(count++))},[deterministicId]),deterministicId||(id?`radix-${id}`:"")}const sides=["top","right","bottom","left"],min=Math.min,max=Math.max,round=Math.round,floor=Math.floor,createCoords=v2=>({x:v2,y:v2}),oppositeSideMap={left:"right",right:"left",bottom:"top",top:"bottom"};function clamp$2(start2,value,end){return max(start2,min(value,end))}function evaluate(value,param){return"function"==typeof value?value(param):value}function getSide(placement){return placement.split("-")[0]}function getAlignment(placement){return placement.split("-")[1]}function getOppositeAxis(axis){return"x"===axis?"y":"x"}function getAxisLength(axis){return"y"===axis?"height":"width"}function getSideAxis(placement){const firstChar=placement[0];return"t"===firstChar||"b"===firstChar?"y":"x"}function getAlignmentAxis(placement){return getOppositeAxis(getSideAxis(placement))}function getOppositeAlignmentPlacement(placement){return placement.includes("start")?placement.replace("start","end"):placement.replace("end","start")}const lrPlacement=["left","right"],rlPlacement=["right","left"],tbPlacement=["top","bottom"],btPlacement=["bottom","top"];function getOppositeAxisPlacements(placement,flipAlignment,direction,rtl){const alignment=getAlignment(placement);let list2=function(side,isStart,rtl){switch(side){case"top":case"bottom":return rtl?isStart?rlPlacement:lrPlacement:isStart?lrPlacement:rlPlacement;case"left":case"right":return isStart?tbPlacement:btPlacement;default:return[]}}(getSide(placement),"start"===direction,rtl);return alignment&&(list2=list2.map(side=>side+"-"+alignment),flipAlignment&&(list2=list2.concat(list2.map(getOppositeAlignmentPlacement)))),list2}function getOppositePlacement(placement){const side=getSide(placement);return oppositeSideMap[side]+placement.slice(side.length)}function getPaddingObject(padding){return"number"!=typeof padding?function(padding){return{top:0,right:0,bottom:0,left:0,...padding}}(padding):{top:padding,right:padding,bottom:padding,left:padding}}function rectToClientRect(rect){const{x:x2,y:y2,width:width,height:height}=rect;return{width:width,height:height,top:y2,left:x2,right:x2+width,bottom:y2+height,x:x2,y:y2}}function computeCoordsFromPlacement(_ref,placement,rtl){let{reference:reference,floating:floating}=_ref;const sideAxis=getSideAxis(placement),alignmentAxis=getAlignmentAxis(placement),alignLength=getAxisLength(alignmentAxis),side=getSide(placement),isVertical="y"===sideAxis,commonX=reference.x+reference.width/2-floating.width/2,commonY=reference.y+reference.height/2-floating.height/2,commonAlign=reference[alignLength]/2-floating[alignLength]/2;let coords;switch(side){case"top":coords={x:commonX,y:reference.y-floating.height};break;case"bottom":coords={x:commonX,y:reference.y+reference.height};break;case"right":coords={x:reference.x+reference.width,y:commonY};break;case"left":coords={x:reference.x-floating.width,y:commonY};break;default:coords={x:reference.x,y:reference.y}}switch(getAlignment(placement)){case"start":coords[alignmentAxis]-=commonAlign*(rtl&&isVertical?-1:1);break;case"end":coords[alignmentAxis]+=commonAlign*(rtl&&isVertical?-1:1)}return coords}async function detectOverflow(state,options){var _await$platform$isEle;void 0===options&&(options={});const{x:x2,y:y2,platform:platform2,rects:rects,elements:elements,strategy:strategy}=state,{boundary:boundary="clippingAncestors",rootBoundary:rootBoundary="viewport",elementContext:elementContext="floating",altBoundary:altBoundary=!1,padding:padding=0}=evaluate(options,state),paddingObject=getPaddingObject(padding),element2=elements[altBoundary?"floating"===elementContext?"reference":"floating":elementContext],clippingClientRect=rectToClientRect(await platform2.getClippingRect({element:null==(_await$platform$isEle=await(null==platform2.isElement?void 0:platform2.isElement(element2)))||_await$platform$isEle?element2:element2.contextElement||await(null==platform2.getDocumentElement?void 0:platform2.getDocumentElement(elements.floating)),boundary:boundary,rootBoundary:rootBoundary,strategy:strategy})),rect="floating"===elementContext?{x:x2,y:y2,width:rects.floating.width,height:rects.floating.height}:rects.reference,offsetParent=await(null==platform2.getOffsetParent?void 0:platform2.getOffsetParent(elements.floating)),offsetScale=await(null==platform2.isElement?void 0:platform2.isElement(offsetParent))&&await(null==platform2.getScale?void 0:platform2.getScale(offsetParent))||{x:1,y:1},elementClientRect=rectToClientRect(platform2.convertOffsetParentRelativeRectToViewportRelativeRect?await platform2.convertOffsetParentRelativeRectToViewportRelativeRect({elements:elements,rect:rect,offsetParent:offsetParent,strategy:strategy}):rect);return{top:(clippingClientRect.top-elementClientRect.top+paddingObject.top)/offsetScale.y,bottom:(elementClientRect.bottom-clippingClientRect.bottom+paddingObject.bottom)/offsetScale.y,left:(clippingClientRect.left-elementClientRect.left+paddingObject.left)/offsetScale.x,right:(elementClientRect.right-clippingClientRect.right+paddingObject.right)/offsetScale.x}}function getSideOffsets(overflow,rect){return{top:overflow.top-rect.height,right:overflow.right-rect.width,bottom:overflow.bottom-rect.height,left:overflow.left-rect.width}}function isAnySideFullyClipped(overflow){return sides.some(side=>overflow[side]>=0)}const originSides=new Set(["left","top"]);function hasWindow(){return"undefined"!=typeof window}function getNodeName(node2){return isNode(node2)?(node2.nodeName||"").toLowerCase():"#document"}function getWindow(node2){var _node$ownerDocument;return(null==node2||null==(_node$ownerDocument=node2.ownerDocument)?void 0:_node$ownerDocument.defaultView)||window}function getDocumentElement(node2){var _ref;return null==(_ref=(isNode(node2)?node2.ownerDocument:node2.document)||window.document)?void 0:_ref.documentElement}function isNode(value){return!!hasWindow()&&(value instanceof Node||value instanceof getWindow(value).Node)}function isElement(value){return!!hasWindow()&&(value instanceof Element||value instanceof getWindow(value).Element)}function isHTMLElement$1(value){return!!hasWindow()&&(value instanceof HTMLElement||value instanceof getWindow(value).HTMLElement)}function isShadowRoot(value){return!(!hasWindow()||"undefined"==typeof ShadowRoot)&&(value instanceof ShadowRoot||value instanceof getWindow(value).ShadowRoot)}function isOverflowElement(element2){const{overflow:overflow,overflowX:overflowX,overflowY:overflowY,display:display}=getComputedStyle$1(element2);return/auto|scroll|overlay|hidden|clip/.test(overflow+overflowY+overflowX)&&"inline"!==display&&"contents"!==display}function isTableElement(element2){return/^(table|td|th)$/.test(getNodeName(element2))}function isTopLayer(element2){try{if(element2.matches(":popover-open"))return!0}catch(_e2){}try{return element2.matches(":modal")}catch(_e2){return!1}}const willChangeRe=/transform|translate|scale|rotate|perspective|filter/,containRe=/paint|layout|strict|content/,isNotNone=value=>!!value&&"none"!==value;let isWebKitValue;function isContainingBlock(elementOrCss){const css=isElement(elementOrCss)?getComputedStyle$1(elementOrCss):elementOrCss;return isNotNone(css.transform)||isNotNone(css.translate)||isNotNone(css.scale)||isNotNone(css.rotate)||isNotNone(css.perspective)||!isWebKit()&&(isNotNone(css.backdropFilter)||isNotNone(css.filter))||willChangeRe.test(css.willChange||"")||containRe.test(css.contain||"")}function isWebKit(){return null==isWebKitValue&&(isWebKitValue="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),isWebKitValue}function isLastTraversableNode(node2){return/^(html|body|#document)$/.test(getNodeName(node2))}function getComputedStyle$1(element2){return getWindow(element2).getComputedStyle(element2)}function getNodeScroll(element2){return isElement(element2)?{scrollLeft:element2.scrollLeft,scrollTop:element2.scrollTop}:{scrollLeft:element2.scrollX,scrollTop:element2.scrollY}}function getParentNode(node2){if("html"===getNodeName(node2))return node2;const result=node2.assignedSlot||node2.parentNode||isShadowRoot(node2)&&node2.host||getDocumentElement(node2);return isShadowRoot(result)?result.host:result}function getNearestOverflowAncestor(node2){const parentNode=getParentNode(node2);return isLastTraversableNode(parentNode)?node2.ownerDocument?node2.ownerDocument.body:node2.body:isHTMLElement$1(parentNode)&&isOverflowElement(parentNode)?parentNode:getNearestOverflowAncestor(parentNode)}function getOverflowAncestors(node2,list2,traverseIframes){var _node$ownerDocument2;void 0===list2&&(list2=[]),void 0===traverseIframes&&(traverseIframes=!0);const scrollableAncestor=getNearestOverflowAncestor(node2),isBody=scrollableAncestor===(null==(_node$ownerDocument2=node2.ownerDocument)?void 0:_node$ownerDocument2.body),win=getWindow(scrollableAncestor);if(isBody){const frameElement=getFrameElement(win);return list2.concat(win,win.visualViewport||[],isOverflowElement(scrollableAncestor)?scrollableAncestor:[],frameElement&&traverseIframes?getOverflowAncestors(frameElement):[])}return list2.concat(scrollableAncestor,getOverflowAncestors(scrollableAncestor,[],traverseIframes))}function getFrameElement(win){return win.parent&&Object.getPrototypeOf(win.parent)?win.frameElement:null}function getCssDimensions(element2){const css=getComputedStyle$1(element2);let width=parseFloat(css.width)||0,height=parseFloat(css.height)||0;const hasOffset=isHTMLElement$1(element2),offsetWidth=hasOffset?element2.offsetWidth:width,offsetHeight=hasOffset?element2.offsetHeight:height,shouldFallback=round(width)!==offsetWidth||round(height)!==offsetHeight;return shouldFallback&&(width=offsetWidth,height=offsetHeight),{width:width,height:height,$:shouldFallback}}function unwrapElement(element2){return isElement(element2)?element2:element2.contextElement}function getScale(element2){const domElement=unwrapElement(element2);if(!isHTMLElement$1(domElement))return createCoords(1);const rect=domElement.getBoundingClientRect(),{width:width,height:height,$:$2}=getCssDimensions(domElement);let x2=($2?round(rect.width):rect.width)/width,y2=($2?round(rect.height):rect.height)/height;return x2&&Number.isFinite(x2)||(x2=1),y2&&Number.isFinite(y2)||(y2=1),{x:x2,y:y2}}const noOffsets=createCoords(0);function getVisualOffsets(element2){const win=getWindow(element2);return isWebKit()&&win.visualViewport?{x:win.visualViewport.offsetLeft,y:win.visualViewport.offsetTop}:noOffsets}function getBoundingClientRect(element2,includeScale,isFixedStrategy,offsetParent){void 0===includeScale&&(includeScale=!1),void 0===isFixedStrategy&&(isFixedStrategy=!1);const clientRect=element2.getBoundingClientRect(),domElement=unwrapElement(element2);let scale=createCoords(1);includeScale&&(offsetParent?isElement(offsetParent)&&(scale=getScale(offsetParent)):scale=getScale(element2));const visualOffsets=function(element2,isFixed,floatingOffsetParent){return void 0===isFixed&&(isFixed=!1),!(!floatingOffsetParent||isFixed&&floatingOffsetParent!==getWindow(element2))&&isFixed}(domElement,isFixedStrategy,offsetParent)?getVisualOffsets(domElement):createCoords(0);let x2=(clientRect.left+visualOffsets.x)/scale.x,y2=(clientRect.top+visualOffsets.y)/scale.y,width=clientRect.width/scale.x,height=clientRect.height/scale.y;if(domElement){const win=getWindow(domElement),offsetWin=offsetParent&&isElement(offsetParent)?getWindow(offsetParent):offsetParent;let currentWin=win,currentIFrame=getFrameElement(currentWin);for(;currentIFrame&&offsetParent&&offsetWin!==currentWin;){const iframeScale=getScale(currentIFrame),iframeRect=currentIFrame.getBoundingClientRect(),css=getComputedStyle$1(currentIFrame),left=iframeRect.left+(currentIFrame.clientLeft+parseFloat(css.paddingLeft))*iframeScale.x,top=iframeRect.top+(currentIFrame.clientTop+parseFloat(css.paddingTop))*iframeScale.y;x2*=iframeScale.x,y2*=iframeScale.y,width*=iframeScale.x,height*=iframeScale.y,x2+=left,y2+=top,currentWin=getWindow(currentIFrame),currentIFrame=getFrameElement(currentWin)}}return rectToClientRect({width:width,height:height,x:x2,y:y2})}function getWindowScrollBarX(element2,rect){const leftScroll=getNodeScroll(element2).scrollLeft;return rect?rect.left+leftScroll:getBoundingClientRect(getDocumentElement(element2)).left+leftScroll}function getHTMLOffset(documentElement,scroll){const htmlRect=documentElement.getBoundingClientRect();return{x:htmlRect.left+scroll.scrollLeft-getWindowScrollBarX(documentElement,htmlRect),y:htmlRect.top+scroll.scrollTop}}function getClientRectFromClippingAncestor(element2,clippingAncestor,strategy){let rect;if("viewport"===clippingAncestor)rect=function(element2,strategy){const win=getWindow(element2),html2=getDocumentElement(element2),visualViewport=win.visualViewport;let width=html2.clientWidth,height=html2.clientHeight,x2=0,y2=0;if(visualViewport){width=visualViewport.width,height=visualViewport.height;const visualViewportBased=isWebKit();(!visualViewportBased||visualViewportBased&&"fixed"===strategy)&&(x2=visualViewport.offsetLeft,y2=visualViewport.offsetTop)}const windowScrollbarX=getWindowScrollBarX(html2);if(windowScrollbarX<=0){const doc=html2.ownerDocument,body=doc.body,bodyStyles=getComputedStyle(body),bodyMarginInline="CSS1Compat"===doc.compatMode&&parseFloat(bodyStyles.marginLeft)+parseFloat(bodyStyles.marginRight)||0,clippingStableScrollbarWidth=Math.abs(html2.clientWidth-body.clientWidth-bodyMarginInline);clippingStableScrollbarWidth<=25&&(width-=clippingStableScrollbarWidth)}else windowScrollbarX<=25&&(width+=windowScrollbarX);return{width:width,height:height,x:x2,y:y2}}(element2,strategy);else if("document"===clippingAncestor)rect=function(element2){const html2=getDocumentElement(element2),scroll=getNodeScroll(element2),body=element2.ownerDocument.body,width=max(html2.scrollWidth,html2.clientWidth,body.scrollWidth,body.clientWidth),height=max(html2.scrollHeight,html2.clientHeight,body.scrollHeight,body.clientHeight);let x2=-scroll.scrollLeft+getWindowScrollBarX(element2);const y2=-scroll.scrollTop;return"rtl"===getComputedStyle$1(body).direction&&(x2+=max(html2.clientWidth,body.clientWidth)-width),{width:width,height:height,x:x2,y:y2}}(getDocumentElement(element2));else if(isElement(clippingAncestor))rect=function(element2,strategy){const clientRect=getBoundingClientRect(element2,!0,"fixed"===strategy),top=clientRect.top+element2.clientTop,left=clientRect.left+element2.clientLeft,scale=isHTMLElement$1(element2)?getScale(element2):createCoords(1);return{width:element2.clientWidth*scale.x,height:element2.clientHeight*scale.y,x:left*scale.x,y:top*scale.y}}(clippingAncestor,strategy);else{const visualOffsets=getVisualOffsets(element2);rect={x:clippingAncestor.x-visualOffsets.x,y:clippingAncestor.y-visualOffsets.y,width:clippingAncestor.width,height:clippingAncestor.height}}return rectToClientRect(rect)}function hasFixedPositionAncestor(element2,stopNode){const parentNode=getParentNode(element2);return!(parentNode===stopNode||!isElement(parentNode)||isLastTraversableNode(parentNode))&&("fixed"===getComputedStyle$1(parentNode).position||hasFixedPositionAncestor(parentNode,stopNode))}function getRectRelativeToOffsetParent(element2,offsetParent,strategy){const isOffsetParentAnElement=isHTMLElement$1(offsetParent),documentElement=getDocumentElement(offsetParent),isFixed="fixed"===strategy,rect=getBoundingClientRect(element2,!0,isFixed,offsetParent);let scroll={scrollLeft:0,scrollTop:0};const offsets=createCoords(0);function setLeftRTLScrollbarOffset(){offsets.x=getWindowScrollBarX(documentElement)}if(isOffsetParentAnElement||!isOffsetParentAnElement&&!isFixed)if(("body"!==getNodeName(offsetParent)||isOverflowElement(documentElement))&&(scroll=getNodeScroll(offsetParent)),isOffsetParentAnElement){const offsetRect=getBoundingClientRect(offsetParent,!0,isFixed,offsetParent);offsets.x=offsetRect.x+offsetParent.clientLeft,offsets.y=offsetRect.y+offsetParent.clientTop}else documentElement&&setLeftRTLScrollbarOffset();isFixed&&!isOffsetParentAnElement&&documentElement&&setLeftRTLScrollbarOffset();const htmlOffset=!documentElement||isOffsetParentAnElement||isFixed?createCoords(0):getHTMLOffset(documentElement,scroll);return{x:rect.left+scroll.scrollLeft-offsets.x-htmlOffset.x,y:rect.top+scroll.scrollTop-offsets.y-htmlOffset.y,width:rect.width,height:rect.height}}function isStaticPositioned(element2){return"static"===getComputedStyle$1(element2).position}function getTrueOffsetParent(element2,polyfill){if(!isHTMLElement$1(element2)||"fixed"===getComputedStyle$1(element2).position)return null;if(polyfill)return polyfill(element2);let rawOffsetParent=element2.offsetParent;return getDocumentElement(element2)===rawOffsetParent&&(rawOffsetParent=rawOffsetParent.ownerDocument.body),rawOffsetParent}function getOffsetParent(element2,polyfill){const win=getWindow(element2);if(isTopLayer(element2))return win;if(!isHTMLElement$1(element2)){let svgOffsetParent=getParentNode(element2);for(;svgOffsetParent&&!isLastTraversableNode(svgOffsetParent);){if(isElement(svgOffsetParent)&&!isStaticPositioned(svgOffsetParent))return svgOffsetParent;svgOffsetParent=getParentNode(svgOffsetParent)}return win}let offsetParent=getTrueOffsetParent(element2,polyfill);for(;offsetParent&&isTableElement(offsetParent)&&isStaticPositioned(offsetParent);)offsetParent=getTrueOffsetParent(offsetParent,polyfill);return offsetParent&&isLastTraversableNode(offsetParent)&&isStaticPositioned(offsetParent)&&!isContainingBlock(offsetParent)?win:offsetParent||function(element2){let currentNode=getParentNode(element2);for(;isHTMLElement$1(currentNode)&&!isLastTraversableNode(currentNode);){if(isContainingBlock(currentNode))return currentNode;if(isTopLayer(currentNode))return null;currentNode=getParentNode(currentNode)}return null}(element2)||win}const platform={convertOffsetParentRelativeRectToViewportRelativeRect:function(_ref){let{elements:elements,rect:rect,offsetParent:offsetParent,strategy:strategy}=_ref;const isFixed="fixed"===strategy,documentElement=getDocumentElement(offsetParent),topLayer=!!elements&&isTopLayer(elements.floating);if(offsetParent===documentElement||topLayer&&isFixed)return rect;let scroll={scrollLeft:0,scrollTop:0},scale=createCoords(1);const offsets=createCoords(0),isOffsetParentAnElement=isHTMLElement$1(offsetParent);if((isOffsetParentAnElement||!isOffsetParentAnElement&&!isFixed)&&(("body"!==getNodeName(offsetParent)||isOverflowElement(documentElement))&&(scroll=getNodeScroll(offsetParent)),isOffsetParentAnElement)){const offsetRect=getBoundingClientRect(offsetParent);scale=getScale(offsetParent),offsets.x=offsetRect.x+offsetParent.clientLeft,offsets.y=offsetRect.y+offsetParent.clientTop}const htmlOffset=!documentElement||isOffsetParentAnElement||isFixed?createCoords(0):getHTMLOffset(documentElement,scroll);return{width:rect.width*scale.x,height:rect.height*scale.y,x:rect.x*scale.x-scroll.scrollLeft*scale.x+offsets.x+htmlOffset.x,y:rect.y*scale.y-scroll.scrollTop*scale.y+offsets.y+htmlOffset.y}},getDocumentElement:getDocumentElement,getClippingRect:function(_ref){let{element:element2,boundary:boundary,rootBoundary:rootBoundary,strategy:strategy}=_ref;const clippingAncestors=[..."clippingAncestors"===boundary?isTopLayer(element2)?[]:function(element2,cache){const cachedResult=cache.get(element2);if(cachedResult)return cachedResult;let result=getOverflowAncestors(element2,[],!1).filter(el2=>isElement(el2)&&"body"!==getNodeName(el2)),currentContainingBlockComputedStyle=null;const elementIsFixed="fixed"===getComputedStyle$1(element2).position;let currentNode=elementIsFixed?getParentNode(element2):element2;for(;isElement(currentNode)&&!isLastTraversableNode(currentNode);){const computedStyle=getComputedStyle$1(currentNode),currentNodeIsContaining=isContainingBlock(currentNode);currentNodeIsContaining||"fixed"!==computedStyle.position||(currentContainingBlockComputedStyle=null),(elementIsFixed?!currentNodeIsContaining&&!currentContainingBlockComputedStyle:!currentNodeIsContaining&&"static"===computedStyle.position&¤tContainingBlockComputedStyle&&("absolute"===currentContainingBlockComputedStyle.position||"fixed"===currentContainingBlockComputedStyle.position)||isOverflowElement(currentNode)&&!currentNodeIsContaining&&hasFixedPositionAncestor(element2,currentNode))?result=result.filter(ancestor=>ancestor!==currentNode):currentContainingBlockComputedStyle=computedStyle,currentNode=getParentNode(currentNode)}return cache.set(element2,result),result}(element2,this._c):[].concat(boundary),rootBoundary],firstRect=getClientRectFromClippingAncestor(element2,clippingAncestors[0],strategy);let top=firstRect.top,right=firstRect.right,bottom=firstRect.bottom,left=firstRect.left;for(let i2=1;i2<clippingAncestors.length;i2++){const rect=getClientRectFromClippingAncestor(element2,clippingAncestors[i2],strategy);top=max(rect.top,top),right=min(rect.right,right),bottom=min(rect.bottom,bottom),left=max(rect.left,left)}return{width:right-left,height:bottom-top,x:left,y:top}},getOffsetParent:getOffsetParent,getElementRects:async function(data){const getOffsetParentFn=this.getOffsetParent||getOffsetParent,getDimensionsFn=this.getDimensions,floatingDimensions=await getDimensionsFn(data.floating);return{reference:getRectRelativeToOffsetParent(data.reference,await getOffsetParentFn(data.floating),data.strategy),floating:{x:0,y:0,width:floatingDimensions.width,height:floatingDimensions.height}}},getClientRects:function(element2){return Array.from(element2.getClientRects())},getDimensions:function(element2){const{width:width,height:height}=getCssDimensions(element2);return{width:width,height:height}},getScale:getScale,isElement:isElement,isRTL:function(element2){return"rtl"===getComputedStyle$1(element2).direction}};function rectsAreEqual(a2,b2){return a2.x===b2.x&&a2.y===b2.y&&a2.width===b2.width&&a2.height===b2.height}function autoUpdate(reference,floating,update,options){void 0===options&&(options={});const{ancestorScroll:ancestorScroll=!0,ancestorResize:ancestorResize=!0,elementResize:elementResize="function"==typeof ResizeObserver,layoutShift:layoutShift="function"==typeof IntersectionObserver,animationFrame:animationFrame=!1}=options,referenceEl=unwrapElement(reference),ancestors=ancestorScroll||ancestorResize?[...referenceEl?getOverflowAncestors(referenceEl):[],...floating?getOverflowAncestors(floating):[]]:[];ancestors.forEach(ancestor=>{ancestorScroll&&ancestor.addEventListener("scroll",update,{passive:!0}),ancestorResize&&ancestor.addEventListener("resize",update)});const cleanupIo=referenceEl&&layoutShift?function(element2,onMove){let timeoutId,io2=null;const root2=getDocumentElement(element2);function cleanup(){var _io;clearTimeout(timeoutId),null==(_io=io2)||_io.disconnect(),io2=null}return function refresh(skip,threshold){void 0===skip&&(skip=!1),void 0===threshold&&(threshold=1),cleanup();const elementRectForRootMargin=element2.getBoundingClientRect(),{left:left,top:top,width:width,height:height}=elementRectForRootMargin;if(skip||onMove(),!width||!height)return;const options={rootMargin:-floor(top)+"px "+-floor(root2.clientWidth-(left+width))+"px "+-floor(root2.clientHeight-(top+height))+"px "+-floor(left)+"px",threshold:max(0,min(1,threshold))||1};let isFirstUpdate=!0;function handleObserve(entries){const ratio=entries[0].intersectionRatio;if(ratio!==threshold){if(!isFirstUpdate)return refresh();ratio?refresh(!1,ratio):timeoutId=setTimeout(()=>{refresh(!1,1e-7)},1e3)}1!==ratio||rectsAreEqual(elementRectForRootMargin,element2.getBoundingClientRect())||refresh(),isFirstUpdate=!1}try{io2=new IntersectionObserver(handleObserve,{...options,root:root2.ownerDocument})}catch(_e2){io2=new IntersectionObserver(handleObserve,options)}io2.observe(element2)}(!0),cleanup}(referenceEl,update):null;let frameId,reobserveFrame=-1,resizeObserver=null;elementResize&&(resizeObserver=new ResizeObserver(_ref=>{let[firstEntry]=_ref;firstEntry&&firstEntry.target===referenceEl&&resizeObserver&&floating&&(resizeObserver.unobserve(floating),cancelAnimationFrame(reobserveFrame),reobserveFrame=requestAnimationFrame(()=>{var _resizeObserver;null==(_resizeObserver=resizeObserver)||_resizeObserver.observe(floating)})),update()}),referenceEl&&!animationFrame&&resizeObserver.observe(referenceEl),floating&&resizeObserver.observe(floating));let prevRefRect=animationFrame?getBoundingClientRect(reference):null;return animationFrame&&function frameLoop(){const nextRefRect=getBoundingClientRect(reference);prevRefRect&&!rectsAreEqual(prevRefRect,nextRefRect)&&update();prevRefRect=nextRefRect,frameId=requestAnimationFrame(frameLoop)}(),update(),()=>{var _resizeObserver2;ancestors.forEach(ancestor=>{ancestorScroll&&ancestor.removeEventListener("scroll",update),ancestorResize&&ancestor.removeEventListener("resize",update)}),null==cleanupIo||cleanupIo(),null==(_resizeObserver2=resizeObserver)||_resizeObserver2.disconnect(),resizeObserver=null,animationFrame&&cancelAnimationFrame(frameId)}}const offset$1=function(options){return void 0===options&&(options=0),{name:"offset",options:options,async fn(state){var _middlewareData$offse,_middlewareData$arrow;const{x:x2,y:y2,placement:placement,middlewareData:middlewareData}=state,diffCoords=await async function(state,options){const{placement:placement,platform:platform2,elements:elements}=state,rtl=await(null==platform2.isRTL?void 0:platform2.isRTL(elements.floating)),side=getSide(placement),alignment=getAlignment(placement),isVertical="y"===getSideAxis(placement),mainAxisMulti=originSides.has(side)?-1:1,crossAxisMulti=rtl&&isVertical?-1:1,rawValue=evaluate(options,state);let{mainAxis:mainAxis,crossAxis:crossAxis,alignmentAxis:alignmentAxis}="number"==typeof rawValue?{mainAxis:rawValue,crossAxis:0,alignmentAxis:null}:{mainAxis:rawValue.mainAxis||0,crossAxis:rawValue.crossAxis||0,alignmentAxis:rawValue.alignmentAxis};return alignment&&"number"==typeof alignmentAxis&&(crossAxis="end"===alignment?-1*alignmentAxis:alignmentAxis),isVertical?{x:crossAxis*crossAxisMulti,y:mainAxis*mainAxisMulti}:{x:mainAxis*mainAxisMulti,y:crossAxis*crossAxisMulti}}(state,options);return placement===(null==(_middlewareData$offse=middlewareData.offset)?void 0:_middlewareData$offse.placement)&&null!=(_middlewareData$arrow=middlewareData.arrow)&&_middlewareData$arrow.alignmentOffset?{}:{x:x2+diffCoords.x,y:y2+diffCoords.y,data:{...diffCoords,placement:placement}}}}},shift$1=function(options){return void 0===options&&(options={}),{name:"shift",options:options,async fn(state){const{x:x2,y:y2,placement:placement,platform:platform2}=state,{mainAxis:checkMainAxis=!0,crossAxis:checkCrossAxis=!1,limiter:limiter={fn:_ref=>{let{x:x3,y:y3}=_ref;return{x:x3,y:y3}}},...detectOverflowOptions}=evaluate(options,state),coords={x:x2,y:y2},overflow=await platform2.detectOverflow(state,detectOverflowOptions),crossAxis=getSideAxis(getSide(placement)),mainAxis=getOppositeAxis(crossAxis);let mainAxisCoord=coords[mainAxis],crossAxisCoord=coords[crossAxis];if(checkMainAxis){const maxSide="y"===mainAxis?"bottom":"right";mainAxisCoord=clamp$2(mainAxisCoord+overflow["y"===mainAxis?"top":"left"],mainAxisCoord,mainAxisCoord-overflow[maxSide])}if(checkCrossAxis){const maxSide="y"===crossAxis?"bottom":"right";crossAxisCoord=clamp$2(crossAxisCoord+overflow["y"===crossAxis?"top":"left"],crossAxisCoord,crossAxisCoord-overflow[maxSide])}const limitedCoords=limiter.fn({...state,[mainAxis]:mainAxisCoord,[crossAxis]:crossAxisCoord});return{...limitedCoords,data:{x:limitedCoords.x-x2,y:limitedCoords.y-y2,enabled:{[mainAxis]:checkMainAxis,[crossAxis]:checkCrossAxis}}}}}},flip$1=function(options){return void 0===options&&(options={}),{name:"flip",options:options,async fn(state){var _middlewareData$arrow,_middlewareData$flip;const{placement:placement,middlewareData:middlewareData,rects:rects,initialPlacement:initialPlacement,platform:platform2,elements:elements}=state,{mainAxis:checkMainAxis=!0,crossAxis:checkCrossAxis=!0,fallbackPlacements:specifiedFallbackPlacements,fallbackStrategy:fallbackStrategy="bestFit",fallbackAxisSideDirection:fallbackAxisSideDirection="none",flipAlignment:flipAlignment=!0,...detectOverflowOptions}=evaluate(options,state);if(null!=(_middlewareData$arrow=middlewareData.arrow)&&_middlewareData$arrow.alignmentOffset)return{};const side=getSide(placement),initialSideAxis=getSideAxis(initialPlacement),isBasePlacement=getSide(initialPlacement)===initialPlacement,rtl=await(null==platform2.isRTL?void 0:platform2.isRTL(elements.floating)),fallbackPlacements=specifiedFallbackPlacements||(isBasePlacement||!flipAlignment?[getOppositePlacement(initialPlacement)]:function(placement){const oppositePlacement=getOppositePlacement(placement);return[getOppositeAlignmentPlacement(placement),oppositePlacement,getOppositeAlignmentPlacement(oppositePlacement)]}(initialPlacement)),hasFallbackAxisSideDirection="none"!==fallbackAxisSideDirection;!specifiedFallbackPlacements&&hasFallbackAxisSideDirection&&fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement,flipAlignment,fallbackAxisSideDirection,rtl));const placements=[initialPlacement,...fallbackPlacements],overflow=await platform2.detectOverflow(state,detectOverflowOptions),overflows=[];let overflowsData=(null==(_middlewareData$flip=middlewareData.flip)?void 0:_middlewareData$flip.overflows)||[];if(checkMainAxis&&overflows.push(overflow[side]),checkCrossAxis){const sides2=function(placement,rects,rtl){void 0===rtl&&(rtl=!1);const alignment=getAlignment(placement),alignmentAxis=getAlignmentAxis(placement),length=getAxisLength(alignmentAxis);let mainAlignmentSide="x"===alignmentAxis?alignment===(rtl?"end":"start")?"right":"left":"start"===alignment?"bottom":"top";return rects.reference[length]>rects.floating[length]&&(mainAlignmentSide=getOppositePlacement(mainAlignmentSide)),[mainAlignmentSide,getOppositePlacement(mainAlignmentSide)]}(placement,rects,rtl);overflows.push(overflow[sides2[0]],overflow[sides2[1]])}if(overflowsData=[...overflowsData,{placement:placement,overflows:overflows}],!overflows.every(side2=>side2<=0)){var _middlewareData$flip2,_overflowsData$filter;const nextIndex=((null==(_middlewareData$flip2=middlewareData.flip)?void 0:_middlewareData$flip2.index)||0)+1,nextPlacement=placements[nextIndex];if(nextPlacement){if(!("alignment"===checkCrossAxis&&initialSideAxis!==getSideAxis(nextPlacement))||overflowsData.every(d2=>getSideAxis(d2.placement)!==initialSideAxis||d2.overflows[0]>0))return{data:{index:nextIndex,overflows:overflowsData},reset:{placement:nextPlacement}}}let resetPlacement=null==(_overflowsData$filter=overflowsData.filter(d2=>d2.overflows[0]<=0).sort((a2,b2)=>a2.overflows[1]-b2.overflows[1])[0])?void 0:_overflowsData$filter.placement;if(!resetPlacement)switch(fallbackStrategy){case"bestFit":{var _overflowsData$filter2;const placement2=null==(_overflowsData$filter2=overflowsData.filter(d2=>{if(hasFallbackAxisSideDirection){const currentSideAxis=getSideAxis(d2.placement);return currentSideAxis===initialSideAxis||"y"===currentSideAxis}return!0}).map(d2=>[d2.placement,d2.overflows.filter(overflow2=>overflow2>0).reduce((acc,overflow2)=>acc+overflow2,0)]).sort((a2,b2)=>a2[1]-b2[1])[0])?void 0:_overflowsData$filter2[0];placement2&&(resetPlacement=placement2);break}case"initialPlacement":resetPlacement=initialPlacement}if(placement!==resetPlacement)return{reset:{placement:resetPlacement}}}return{}}}},size$1=function(options){return void 0===options&&(options={}),{name:"size",options:options,async fn(state){var _state$middlewareData,_state$middlewareData2;const{placement:placement,rects:rects,platform:platform2,elements:elements}=state,{apply:apply=()=>{},...detectOverflowOptions}=evaluate(options,state),overflow=await platform2.detectOverflow(state,detectOverflowOptions),side=getSide(placement),alignment=getAlignment(placement),isYAxis="y"===getSideAxis(placement),{width:width,height:height}=rects.floating;let heightSide,widthSide;"top"===side||"bottom"===side?(heightSide=side,widthSide=alignment===(await(null==platform2.isRTL?void 0:platform2.isRTL(elements.floating))?"start":"end")?"left":"right"):(widthSide=side,heightSide="end"===alignment?"top":"bottom");const maximumClippingHeight=height-overflow.top-overflow.bottom,maximumClippingWidth=width-overflow.left-overflow.right,overflowAvailableHeight=min(height-overflow[heightSide],maximumClippingHeight),overflowAvailableWidth=min(width-overflow[widthSide],maximumClippingWidth),noShift=!state.middlewareData.shift;let availableHeight=overflowAvailableHeight,availableWidth=overflowAvailableWidth;if(null!=(_state$middlewareData=state.middlewareData.shift)&&_state$middlewareData.enabled.x&&(availableWidth=maximumClippingWidth),null!=(_state$middlewareData2=state.middlewareData.shift)&&_state$middlewareData2.enabled.y&&(availableHeight=maximumClippingHeight),noShift&&!alignment){const xMin=max(overflow.left,0),xMax=max(overflow.right,0),yMin=max(overflow.top,0),yMax=max(overflow.bottom,0);isYAxis?availableWidth=width-2*(0!==xMin||0!==xMax?xMin+xMax:max(overflow.left,overflow.right)):availableHeight=height-2*(0!==yMin||0!==yMax?yMin+yMax:max(overflow.top,overflow.bottom))}await apply({...state,availableWidth:availableWidth,availableHeight:availableHeight});const nextDimensions=await platform2.getDimensions(elements.floating);return width!==nextDimensions.width||height!==nextDimensions.height?{reset:{rects:!0}}:{}}}},hide$1=function(options){return void 0===options&&(options={}),{name:"hide",options:options,async fn(state){const{rects:rects,platform:platform2}=state,{strategy:strategy="referenceHidden",...detectOverflowOptions}=evaluate(options,state);switch(strategy){case"referenceHidden":{const offsets=getSideOffsets(await platform2.detectOverflow(state,{...detectOverflowOptions,elementContext:"reference"}),rects.reference);return{data:{referenceHiddenOffsets:offsets,referenceHidden:isAnySideFullyClipped(offsets)}}}case"escaped":{const offsets=getSideOffsets(await platform2.detectOverflow(state,{...detectOverflowOptions,altBoundary:!0}),rects.floating);return{data:{escapedOffsets:offsets,escaped:isAnySideFullyClipped(offsets)}}}default:return{}}}}},arrow$2=options=>({name:"arrow",options:options,async fn(state){const{x:x2,y:y2,placement:placement,rects:rects,platform:platform2,elements:elements,middlewareData:middlewareData}=state,{element:element2,padding:padding=0}=evaluate(options,state)||{};if(null==element2)return{};const paddingObject=getPaddingObject(padding),coords={x:x2,y:y2},axis=getAlignmentAxis(placement),length=getAxisLength(axis),arrowDimensions=await platform2.getDimensions(element2),isYAxis="y"===axis,minProp=isYAxis?"top":"left",maxProp=isYAxis?"bottom":"right",clientProp=isYAxis?"clientHeight":"clientWidth",endDiff=rects.reference[length]+rects.reference[axis]-coords[axis]-rects.floating[length],startDiff=coords[axis]-rects.reference[axis],arrowOffsetParent=await(null==platform2.getOffsetParent?void 0:platform2.getOffsetParent(element2));let clientSize=arrowOffsetParent?arrowOffsetParent[clientProp]:0;clientSize&&await(null==platform2.isElement?void 0:platform2.isElement(arrowOffsetParent))||(clientSize=elements.floating[clientProp]||rects.floating[length]);const centerToReference=endDiff/2-startDiff/2,largestPossiblePadding=clientSize/2-arrowDimensions[length]/2-1,minPadding=min(paddingObject[minProp],largestPossiblePadding),maxPadding=min(paddingObject[maxProp],largestPossiblePadding),min$1=minPadding,max2=clientSize-arrowDimensions[length]-maxPadding,center=clientSize/2-arrowDimensions[length]/2+centerToReference,offset2=clamp$2(min$1,center,max2),shouldAddOffset=!middlewareData.arrow&&null!=getAlignment(placement)&¢er!==offset2&&rects.reference[length]/2-(center<min$1?minPadding:maxPadding)-arrowDimensions[length]/2<0,alignmentOffset=shouldAddOffset?center<min$1?center-min$1:center-max2:0;return{[axis]:coords[axis]+alignmentOffset,data:{[axis]:offset2,centerOffset:center-offset2-alignmentOffset,...shouldAddOffset&&{alignmentOffset:alignmentOffset}},reset:shouldAddOffset}}}),limitShift$1=function(options){return void 0===options&&(options={}),{options:options,fn(state){const{x:x2,y:y2,placement:placement,rects:rects,middlewareData:middlewareData}=state,{offset:offset2=0,mainAxis:checkMainAxis=!0,crossAxis:checkCrossAxis=!0}=evaluate(options,state),coords={x:x2,y:y2},crossAxis=getSideAxis(placement),mainAxis=getOppositeAxis(crossAxis);let mainAxisCoord=coords[mainAxis],crossAxisCoord=coords[crossAxis];const rawOffset=evaluate(offset2,state),computedOffset="number"==typeof rawOffset?{mainAxis:rawOffset,crossAxis:0}:{mainAxis:0,crossAxis:0,...rawOffset};if(checkMainAxis){const len="y"===mainAxis?"height":"width",limitMin=rects.reference[mainAxis]-rects.floating[len]+computedOffset.mainAxis,limitMax=rects.reference[mainAxis]+rects.reference[len]-computedOffset.mainAxis;mainAxisCoord<limitMin?mainAxisCoord=limitMin:mainAxisCoord>limitMax&&(mainAxisCoord=limitMax)}if(checkCrossAxis){var _middlewareData$offse,_middlewareData$offse2;const len="y"===mainAxis?"width":"height",isOriginSide=originSides.has(getSide(placement)),limitMin=rects.reference[crossAxis]-rects.floating[len]+(isOriginSide&&(null==(_middlewareData$offse=middlewareData.offset)?void 0:_middlewareData$offse[crossAxis])||0)+(isOriginSide?0:computedOffset.crossAxis),limitMax=rects.reference[crossAxis]+rects.reference[len]+(isOriginSide?0:(null==(_middlewareData$offse2=middlewareData.offset)?void 0:_middlewareData$offse2[crossAxis])||0)-(isOriginSide?computedOffset.crossAxis:0);crossAxisCoord<limitMin?crossAxisCoord=limitMin:crossAxisCoord>limitMax&&(crossAxisCoord=limitMax)}return{[mainAxis]:mainAxisCoord,[crossAxis]:crossAxisCoord}}}},computePosition=(reference,floating,options)=>{const cache=new Map,mergedOptions={platform:platform,...options},platformWithCache={...mergedOptions.platform,_c:cache};return(async(reference,floating,config)=>{const{placement:placement="bottom",strategy:strategy="absolute",middleware:middleware=[],platform:platform2}=config,platformWithDetectOverflow=platform2.detectOverflow?platform2:{...platform2,detectOverflow:detectOverflow},rtl=await(null==platform2.isRTL?void 0:platform2.isRTL(floating));let rects=await platform2.getElementRects({reference:reference,floating:floating,strategy:strategy}),{x:x2,y:y2}=computeCoordsFromPlacement(rects,placement,rtl),statefulPlacement=placement,resetCount=0;const middlewareData={};for(let i2=0;i2<middleware.length;i2++){const currentMiddleware=middleware[i2];if(!currentMiddleware)continue;const{name:name,fn:fn2}=currentMiddleware,{x:nextX,y:nextY,data:data,reset:reset}=await fn2({x:x2,y:y2,initialPlacement:placement,placement:statefulPlacement,strategy:strategy,middlewareData:middlewareData,rects:rects,platform:platformWithDetectOverflow,elements:{reference:reference,floating:floating}});x2=null!=nextX?nextX:x2,y2=null!=nextY?nextY:y2,middlewareData[name]={...middlewareData[name],...data},reset&&resetCount<50&&(resetCount++,"object"==typeof reset&&(reset.placement&&(statefulPlacement=reset.placement),reset.rects&&(rects=!0===reset.rects?await platform2.getElementRects({reference:reference,floating:floating,strategy:strategy}):reset.rects),({x:x2,y:y2}=computeCoordsFromPlacement(rects,statefulPlacement,rtl))),i2=-1)}return{x:x2,y:y2,placement:statefulPlacement,strategy:strategy,middlewareData:middlewareData}})(reference,floating,{...mergedOptions,platform:platformWithCache})};var index="undefined"!=typeof document?reactExports.useLayoutEffect:function(){};function deepEqual$1(a2,b2){if(a2===b2)return!0;if(typeof a2!=typeof b2)return!1;if("function"==typeof a2&&a2.toString()===b2.toString())return!0;let length,i2,keys;if(a2&&b2&&"object"==typeof a2){if(Array.isArray(a2)){if(length=a2.length,length!==b2.length)return!1;for(i2=length;0!==i2--;)if(!deepEqual$1(a2[i2],b2[i2]))return!1;return!0}if(keys=Object.keys(a2),length=keys.length,length!==Object.keys(b2).length)return!1;for(i2=length;0!==i2--;)if(!{}.hasOwnProperty.call(b2,keys[i2]))return!1;for(i2=length;0!==i2--;){const key=keys[i2];if(("_owner"!==key||!a2.$$typeof)&&!deepEqual$1(a2[key],b2[key]))return!1}return!0}return a2!=a2&&b2!=b2}function getDPR(element2){if("undefined"==typeof window)return 1;return(element2.ownerDocument.defaultView||window).devicePixelRatio||1}function roundByDPR(element2,value){const dpr=getDPR(element2);return Math.round(value*dpr)/dpr}function useLatestRef$1(value){const ref=reactExports.useRef(value);return index(()=>{ref.current=value}),ref}const offset=(options,deps)=>{const result=offset$1(options);return{name:result.name,fn:result.fn,options:[options,deps]}},shift=(options,deps)=>{const result=shift$1(options);return{name:result.name,fn:result.fn,options:[options,deps]}},limitShift=(options,deps)=>({fn:limitShift$1(options).fn,options:[options,deps]}),flip=(options,deps)=>{const result=flip$1(options);return{name:result.name,fn:result.fn,options:[options,deps]}},size=(options,deps)=>{const result=size$1(options);return{name:result.name,fn:result.fn,options:[options,deps]}},hide=(options,deps)=>{const result=hide$1(options);return{name:result.name,fn:result.fn,options:[options,deps]}},arrow=(options,deps)=>{const result=(options=>({name:"arrow",options:options,fn(state){const{element:element2,padding:padding}="function"==typeof options?options(state):options;return element2&&(value=element2,{}.hasOwnProperty.call(value,"current"))?null!=element2.current?arrow$2({element:element2.current,padding:padding}).fn(state):{}:element2?arrow$2({element:element2,padding:padding}).fn(state):{};var value}}))(options);return{name:result.name,fn:result.fn,options:[options,deps]}};var Arrow$1=reactExports.forwardRef((props,forwardedRef)=>{const{children:children,width:width=10,height:height=5,...arrowProps}=props;return jsxRuntimeExports.jsx(Primitive.svg,{...arrowProps,ref:forwardedRef,width:width,height:height,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:props.asChild?children:jsxRuntimeExports.jsx("polygon",{points:"0,0 30,0 15,10"})})});Arrow$1.displayName="Arrow";var Root$5=Arrow$1;var[createPopperContext,createPopperScope]=createContextScope("Popper"),[PopperProvider,usePopperContext]=createPopperContext("Popper"),Popper=props=>{const{__scopePopper:__scopePopper,children:children}=props,[anchor,setAnchor]=reactExports.useState(null);return jsxRuntimeExports.jsx(PopperProvider,{scope:__scopePopper,anchor:anchor,onAnchorChange:setAnchor,children:children})};Popper.displayName="Popper";var PopperAnchor=reactExports.forwardRef((props,forwardedRef)=>{const{__scopePopper:__scopePopper,virtualRef:virtualRef,...anchorProps}=props,context=usePopperContext("PopperAnchor",__scopePopper),ref=reactExports.useRef(null),composedRefs=useComposedRefs(forwardedRef,ref),anchorRef=reactExports.useRef(null);return reactExports.useEffect(()=>{const previousAnchor=anchorRef.current;anchorRef.current=(null==virtualRef?void 0:virtualRef.current)||ref.current,previousAnchor!==anchorRef.current&&context.onAnchorChange(anchorRef.current)}),virtualRef?null:jsxRuntimeExports.jsx(Primitive.div,{...anchorProps,ref:composedRefs})});PopperAnchor.displayName="PopperAnchor";var[PopperContentProvider,useContentContext]=createPopperContext("PopperContent"),PopperContent=reactExports.forwardRef((props,forwardedRef)=>{var _a,_b,_c,_d,_e2,_f;const{__scopePopper:__scopePopper,side:side="bottom",sideOffset:sideOffset=0,align:align="center",alignOffset:alignOffset=0,arrowPadding:arrowPadding=0,avoidCollisions:avoidCollisions=!0,collisionBoundary:collisionBoundary=[],collisionPadding:collisionPaddingProp=0,sticky:sticky="partial",hideWhenDetached:hideWhenDetached=!1,updatePositionStrategy:updatePositionStrategy="optimized",onPlaced:onPlaced,...contentProps}=props,context=usePopperContext("PopperContent",__scopePopper),[content2,setContent2]=reactExports.useState(null),composedRefs=useComposedRefs(forwardedRef,node2=>setContent2(node2)),[arrow$12,setArrow]=reactExports.useState(null),arrowSize=function(element2){const[size2,setSize]=reactExports.useState(void 0);return useLayoutEffect2(()=>{if(element2){setSize({width:element2.offsetWidth,height:element2.offsetHeight});const resizeObserver=new ResizeObserver(entries=>{if(!Array.isArray(entries))return;if(!entries.length)return;const entry=entries[0];let width,height;if("borderBoxSize"in entry){const borderSizeEntry=entry.borderBoxSize,borderSize=Array.isArray(borderSizeEntry)?borderSizeEntry[0]:borderSizeEntry;width=borderSize.inlineSize,height=borderSize.blockSize}else width=element2.offsetWidth,height=element2.offsetHeight;setSize({width:width,height:height})});return resizeObserver.observe(element2,{box:"border-box"}),()=>resizeObserver.unobserve(element2)}setSize(void 0)},[element2]),size2}(arrow$12),arrowWidth=(null==arrowSize?void 0:arrowSize.width)??0,arrowHeight=(null==arrowSize?void 0:arrowSize.height)??0,desiredPlacement=side+("center"!==align?"-"+align:""),collisionPadding="number"==typeof collisionPaddingProp?collisionPaddingProp:{top:0,right:0,bottom:0,left:0,...collisionPaddingProp},boundary=Array.isArray(collisionBoundary)?collisionBoundary:[collisionBoundary],hasExplicitBoundaries=boundary.length>0,detectOverflowOptions={padding:collisionPadding,boundary:boundary.filter(isNotNull),altBoundary:hasExplicitBoundaries},{refs:refs,floatingStyles:floatingStyles,placement:placement,isPositioned:isPositioned,middlewareData:middlewareData}=function(options){void 0===options&&(options={});const{placement:placement="bottom",strategy:strategy="absolute",middleware:middleware=[],platform:platform2,elements:{reference:externalReference,floating:externalFloating}={},transform:transform=!0,whileElementsMounted:whileElementsMounted,open:open}=options,[data,setData]=reactExports.useState({x:0,y:0,strategy:strategy,placement:placement,middlewareData:{},isPositioned:!1}),[latestMiddleware,setLatestMiddleware]=reactExports.useState(middleware);deepEqual$1(latestMiddleware,middleware)||setLatestMiddleware(middleware);const[_reference,_setReference]=reactExports.useState(null),[_floating,_setFloating]=reactExports.useState(null),setReference=reactExports.useCallback(node2=>{node2!==referenceRef.current&&(referenceRef.current=node2,_setReference(node2))},[]),setFloating=reactExports.useCallback(node2=>{node2!==floatingRef.current&&(floatingRef.current=node2,_setFloating(node2))},[]),referenceEl=externalReference||_reference,floatingEl=externalFloating||_floating,referenceRef=reactExports.useRef(null),floatingRef=reactExports.useRef(null),dataRef=reactExports.useRef(data),hasWhileElementsMounted=null!=whileElementsMounted,whileElementsMountedRef=useLatestRef$1(whileElementsMounted),platformRef=useLatestRef$1(platform2),openRef=useLatestRef$1(open),update=reactExports.useCallback(()=>{if(!referenceRef.current||!floatingRef.current)return;const config={placement:placement,strategy:strategy,middleware:latestMiddleware};platformRef.current&&(config.platform=platformRef.current),computePosition(referenceRef.current,floatingRef.current,config).then(data2=>{const fullData={...data2,isPositioned:!1!==openRef.current};isMountedRef.current&&!deepEqual$1(dataRef.current,fullData)&&(dataRef.current=fullData,reactDomExports.flushSync(()=>{setData(fullData)}))})},[latestMiddleware,placement,strategy,platformRef,openRef]);index(()=>{!1===open&&dataRef.current.isPositioned&&(dataRef.current.isPositioned=!1,setData(data2=>({...data2,isPositioned:!1})))},[open]);const isMountedRef=reactExports.useRef(!1);index(()=>(isMountedRef.current=!0,()=>{isMountedRef.current=!1}),[]),index(()=>{if(referenceEl&&(referenceRef.current=referenceEl),floatingEl&&(floatingRef.current=floatingEl),referenceEl&&floatingEl){if(whileElementsMountedRef.current)return whileElementsMountedRef.current(referenceEl,floatingEl,update);update()}},[referenceEl,floatingEl,update,whileElementsMountedRef,hasWhileElementsMounted]);const refs=reactExports.useMemo(()=>({reference:referenceRef,floating:floatingRef,setReference:setReference,setFloating:setFloating}),[setReference,setFloating]),elements=reactExports.useMemo(()=>({reference:referenceEl,floating:floatingEl}),[referenceEl,floatingEl]),floatingStyles=reactExports.useMemo(()=>{const initialStyles={position:strategy,left:0,top:0};if(!elements.floating)return initialStyles;const x2=roundByDPR(elements.floating,data.x),y2=roundByDPR(elements.floating,data.y);return transform?{...initialStyles,transform:"translate("+x2+"px, "+y2+"px)",...getDPR(elements.floating)>=1.5&&{willChange:"transform"}}:{position:strategy,left:x2,top:y2}},[strategy,transform,elements.floating,data.x,data.y]);return reactExports.useMemo(()=>({...data,update:update,refs:refs,elements:elements,floatingStyles:floatingStyles}),[data,update,refs,elements,floatingStyles])}({strategy:"fixed",placement:desiredPlacement,whileElementsMounted:(...args)=>autoUpdate(...args,{animationFrame:"always"===updatePositionStrategy}),elements:{reference:context.anchor},middleware:[offset({mainAxis:sideOffset+arrowHeight,alignmentAxis:alignOffset}),avoidCollisions&&shift({mainAxis:!0,crossAxis:!1,limiter:"partial"===sticky?limitShift():void 0,...detectOverflowOptions}),avoidCollisions&&flip({...detectOverflowOptions}),size({...detectOverflowOptions,apply:({elements:elements,rects:rects,availableWidth:availableWidth,availableHeight:availableHeight})=>{const{width:anchorWidth,height:anchorHeight}=rects.reference,contentStyle=elements.floating.style;contentStyle.setProperty("--radix-popper-available-width",`${availableWidth}px`),contentStyle.setProperty("--radix-popper-available-height",`${availableHeight}px`),contentStyle.setProperty("--radix-popper-anchor-width",`${anchorWidth}px`),contentStyle.setProperty("--radix-popper-anchor-height",`${anchorHeight}px`)}}),arrow$12&&arrow({element:arrow$12,padding:arrowPadding}),transformOrigin({arrowWidth:arrowWidth,arrowHeight:arrowHeight}),hideWhenDetached&&hide({strategy:"referenceHidden",...detectOverflowOptions})]}),[placedSide,placedAlign]=getSideAndAlignFromPlacement(placement),handlePlaced=useCallbackRef$1(onPlaced);useLayoutEffect2(()=>{isPositioned&&(null==handlePlaced||handlePlaced())},[isPositioned,handlePlaced]);const arrowX=null==(_a=middlewareData.arrow)?void 0:_a.x,arrowY=null==(_b=middlewareData.arrow)?void 0:_b.y,cannotCenterArrow=0!==(null==(_c=middlewareData.arrow)?void 0:_c.centerOffset),[contentZIndex,setContentZIndex]=reactExports.useState();return useLayoutEffect2(()=>{content2&&setContentZIndex(window.getComputedStyle(content2).zIndex)},[content2]),jsxRuntimeExports.jsx("div",{ref:refs.setFloating,"data-radix-popper-content-wrapper":"",style:{...floatingStyles,transform:isPositioned?floatingStyles.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:contentZIndex,"--radix-popper-transform-origin":[null==(_d=middlewareData.transformOrigin)?void 0:_d.x,null==(_e2=middlewareData.transformOrigin)?void 0:_e2.y].join(" "),...(null==(_f=middlewareData.hide)?void 0:_f.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:props.dir,children:jsxRuntimeExports.jsx(PopperContentProvider,{scope:__scopePopper,placedSide:placedSide,onArrowChange:setArrow,arrowX:arrowX,arrowY:arrowY,shouldHideArrow:cannotCenterArrow,children:jsxRuntimeExports.jsx(Primitive.div,{"data-side":placedSide,"data-align":placedAlign,...contentProps,ref:composedRefs,style:{...contentProps.style,animation:isPositioned?void 0:"none"}})})})});PopperContent.displayName="PopperContent";var OPPOSITE_SIDE={top:"bottom",right:"left",bottom:"top",left:"right"},PopperArrow=reactExports.forwardRef(function(props,forwardedRef){const{__scopePopper:__scopePopper,...arrowProps}=props,contentContext=useContentContext("PopperArrow",__scopePopper),baseSide=OPPOSITE_SIDE[contentContext.placedSide];return jsxRuntimeExports.jsx("span",{ref:contentContext.onArrowChange,style:{position:"absolute",left:contentContext.arrowX,top:contentContext.arrowY,[baseSide]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[contentContext.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[contentContext.placedSide],visibility:contentContext.shouldHideArrow?"hidden":void 0},children:jsxRuntimeExports.jsx(Root$5,{...arrowProps,ref:forwardedRef,style:{...arrowProps.style,display:"block"}})})});function isNotNull(value){return null!==value}PopperArrow.displayName="PopperArrow";var transformOrigin=options=>({name:"transformOrigin",options:options,fn(data){var _a,_b,_c;const{placement:placement,rects:rects,middlewareData:middlewareData}=data,isArrowHidden=0!==(null==(_a=middlewareData.arrow)?void 0:_a.centerOffset),arrowWidth=isArrowHidden?0:options.arrowWidth,arrowHeight=isArrowHidden?0:options.arrowHeight,[placedSide,placedAlign]=getSideAndAlignFromPlacement(placement),noArrowAlign={start:"0%",center:"50%",end:"100%"}[placedAlign],arrowXCenter=((null==(_b=middlewareData.arrow)?void 0:_b.x)??0)+arrowWidth/2,arrowYCenter=((null==(_c=middlewareData.arrow)?void 0:_c.y)??0)+arrowHeight/2;let x2="",y2="";return"bottom"===placedSide?(x2=isArrowHidden?noArrowAlign:`${arrowXCenter}px`,y2=-arrowHeight+"px"):"top"===placedSide?(x2=isArrowHidden?noArrowAlign:`${arrowXCenter}px`,y2=`${rects.floating.height+arrowHeight}px`):"right"===placedSide?(x2=-arrowHeight+"px",y2=isArrowHidden?noArrowAlign:`${arrowYCenter}px`):"left"===placedSide&&(x2=`${rects.floating.width+arrowHeight}px`,y2=isArrowHidden?noArrowAlign:`${arrowYCenter}px`),{data:{x:x2,y:y2}}}});function getSideAndAlignFromPlacement(placement){const[side,align="center"]=placement.split("-");return[side,align]}var Root2$3=Popper,Anchor=PopperAnchor,Content$1=PopperContent,Arrow=PopperArrow,Portal$4=reactExports.forwardRef((props,forwardedRef)=>{var _a;const{container:containerProp,...portalProps}=props,[mounted,setMounted]=reactExports.useState(!1);useLayoutEffect2(()=>setMounted(!0),[]);const container=containerProp||mounted&&(null==(_a=null==globalThis?void 0:globalThis.document)?void 0:_a.body);return container?ReactDOM.createPortal(jsxRuntimeExports.jsx(Primitive.div,{...portalProps,ref:forwardedRef}),container):null});Portal$4.displayName="Portal";var Presence=props=>{const{present:present,children:children}=props,presence=function(present){const[node2,setNode]=reactExports.useState(),stylesRef=reactExports.useRef(null),prevPresentRef=reactExports.useRef(present),prevAnimationNameRef=reactExports.useRef("none"),initialState=present?"mounted":"unmounted",[state,send]=function(initialState,machine){return reactExports.useReducer((state,event)=>machine[state][event]??state,initialState)}(initialState,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return reactExports.useEffect(()=>{const currentAnimationName=getAnimationName(stylesRef.current);prevAnimationNameRef.current="mounted"===state?currentAnimationName:"none"},[state]),useLayoutEffect2(()=>{const styles2=stylesRef.current,wasPresent=prevPresentRef.current;if(wasPresent!==present){const prevAnimationName=prevAnimationNameRef.current,currentAnimationName=getAnimationName(styles2);if(present)send("MOUNT");else if("none"===currentAnimationName||"none"===(null==styles2?void 0:styles2.display))send("UNMOUNT");else{send(wasPresent&&prevAnimationName!==currentAnimationName?"ANIMATION_OUT":"UNMOUNT")}prevPresentRef.current=present}},[present,send]),useLayoutEffect2(()=>{if(node2){let timeoutId;const ownerWindow=node2.ownerDocument.defaultView??window,handleAnimationEnd=event=>{const isCurrentAnimation=getAnimationName(stylesRef.current).includes(CSS.escape(event.animationName));if(event.target===node2&&isCurrentAnimation&&(send("ANIMATION_END"),!prevPresentRef.current)){const currentFillMode=node2.style.animationFillMode;node2.style.animationFillMode="forwards",timeoutId=ownerWindow.setTimeout(()=>{"forwards"===node2.style.animationFillMode&&(node2.style.animationFillMode=currentFillMode)})}},handleAnimationStart=event=>{event.target===node2&&(prevAnimationNameRef.current=getAnimationName(stylesRef.current))};return node2.addEventListener("animationstart",handleAnimationStart),node2.addEventListener("animationcancel",handleAnimationEnd),node2.addEventListener("animationend",handleAnimationEnd),()=>{ownerWindow.clearTimeout(timeoutId),node2.removeEventListener("animationstart",handleAnimationStart),node2.removeEventListener("animationcancel",handleAnimationEnd),node2.removeEventListener("animationend",handleAnimationEnd)}}send("ANIMATION_END")},[node2,send]),{isPresent:["mounted","unmountSuspended"].includes(state),ref:reactExports.useCallback(node22=>{stylesRef.current=node22?getComputedStyle(node22):null,setNode(node22)},[])}}(present),child="function"==typeof children?children({present:presence.isPresent}):reactExports.Children.only(children),ref=useComposedRefs(presence.ref,function(element2){var _a,_b;let getter=null==(_a=Object.getOwnPropertyDescriptor(element2.props,"ref"))?void 0:_a.get,mayWarn=getter&&"isReactWarning"in getter&&getter.isReactWarning;if(mayWarn)return element2.ref;if(getter=null==(_b=Object.getOwnPropertyDescriptor(element2,"ref"))?void 0:_b.get,mayWarn=getter&&"isReactWarning"in getter&&getter.isReactWarning,mayWarn)return element2.props.ref;return element2.props.ref||element2.ref}(child));return"function"==typeof children||presence.isPresent?reactExports.cloneElement(child,{ref:ref}):null};function getAnimationName(styles2){return(null==styles2?void 0:styles2.animationName)||"none"}Presence.displayName="Presence";var useInsertionEffect=React[" useInsertionEffect ".trim().toString()]||useLayoutEffect2;function useControllableState({prop:prop,defaultProp:defaultProp,onChange:onChange=()=>{},caller:caller}){const[uncontrolledProp,setUncontrolledProp,onChangeRef]=function({defaultProp:defaultProp,onChange:onChange}){const[value,setValue]=reactExports.useState(defaultProp),prevValueRef=reactExports.useRef(value),onChangeRef=reactExports.useRef(onChange);return useInsertionEffect(()=>{onChangeRef.current=onChange},[onChange]),reactExports.useEffect(()=>{var _a;prevValueRef.current!==value&&(null==(_a=onChangeRef.current)||_a.call(onChangeRef,value),prevValueRef.current=value)},[value,prevValueRef]),[value,setValue,onChangeRef]}({defaultProp:defaultProp,onChange:onChange}),isControlled=void 0!==prop,value=isControlled?prop:uncontrolledProp;{const isControlledRef=reactExports.useRef(void 0!==prop);reactExports.useEffect(()=>{const wasControlled=isControlledRef.current;if(wasControlled!==isControlled){const from=wasControlled?"controlled":"uncontrolled",to2=isControlled?"controlled":"uncontrolled";console.warn(`${caller} is changing from ${from} to ${to2}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}isControlledRef.current=isControlled},[isControlled,caller])}const setValue=reactExports.useCallback(nextValue=>{var _a;if(isControlled){const value2=function(value){return"function"==typeof value}(nextValue)?nextValue(prop):nextValue;value2!==prop&&(null==(_a=onChangeRef.current)||_a.call(onChangeRef,value2))}else setUncontrolledProp(nextValue)},[isControlled,prop,setUncontrolledProp,onChangeRef]);return[value,setValue]}var counterMap=new WeakMap,uncontrolledNodes=new WeakMap,markerMap={},lockCount=0,unwrapHost=function(node2){return node2&&(node2.host||unwrapHost(node2.parentNode))},applyAttributeToOthers=function(originalTarget,parentNode,markerName,controlAttribute){var targets=function(parent,targets){return targets.map(function(target){if(parent.contains(target))return target;var correctedTarget=unwrapHost(target);return correctedTarget&&parent.contains(correctedTarget)?correctedTarget:(console.error("aria-hidden",target,"in not contained inside",parent,". Doing nothing"),null)}).filter(function(x2){return Boolean(x2)})}(parentNode,Array.isArray(originalTarget)?originalTarget:[originalTarget]);markerMap[markerName]||(markerMap[markerName]=new WeakMap);var markerCounter=markerMap[markerName],hiddenNodes=[],elementsToKeep=new Set,elementsToStop=new Set(targets),keep=function(el2){el2&&!elementsToKeep.has(el2)&&(elementsToKeep.add(el2),keep(el2.parentNode))};targets.forEach(keep);var deep=function(parent){parent&&!elementsToStop.has(parent)&&Array.prototype.forEach.call(parent.children,function(node2){if(elementsToKeep.has(node2))deep(node2);else try{var attr=node2.getAttribute(controlAttribute),alreadyHidden=null!==attr&&"false"!==attr,counterValue=(counterMap.get(node2)||0)+1,markerValue=(markerCounter.get(node2)||0)+1;counterMap.set(node2,counterValue),markerCounter.set(node2,markerValue),hiddenNodes.push(node2),1===counterValue&&alreadyHidden&&uncontrolledNodes.set(node2,!0),1===markerValue&&node2.setAttribute(markerName,"true"),alreadyHidden||node2.setAttribute(controlAttribute,"true")}catch(e2){console.error("aria-hidden: cannot operate on ",node2,e2)}})};return deep(parentNode),elementsToKeep.clear(),lockCount++,function(){hiddenNodes.forEach(function(node2){var counterValue=counterMap.get(node2)-1,markerValue=markerCounter.get(node2)-1;counterMap.set(node2,counterValue),markerCounter.set(node2,markerValue),counterValue||(uncontrolledNodes.has(node2)||node2.removeAttribute(controlAttribute),uncontrolledNodes.delete(node2)),markerValue||node2.removeAttribute(markerName)}),--lockCount||(counterMap=new WeakMap,counterMap=new WeakMap,uncontrolledNodes=new WeakMap,markerMap={})}},hideOthers=function(originalTarget,parentNode,markerName){void 0===markerName&&(markerName="data-aria-hidden");var targets=Array.from(Array.isArray(originalTarget)?originalTarget:[originalTarget]),activeParentNode=function(originalTarget){return"undefined"==typeof document?null:(Array.isArray(originalTarget)?originalTarget[0]:originalTarget).ownerDocument.body}(originalTarget);return activeParentNode?(targets.push.apply(targets,Array.from(activeParentNode.querySelectorAll("[aria-live], script"))),applyAttributeToOthers(targets,activeParentNode,markerName,"aria-hidden")):function(){return null}},__assign=function(){return __assign=Object.assign||function(t2){for(var s2,i2=1,n2=arguments.length;i2<n2;i2++)for(var p2 in s2=arguments[i2])Object.prototype.hasOwnProperty.call(s2,p2)&&(t2[p2]=s2[p2]);return t2},__assign.apply(this,arguments)};function __rest(s2,e2){var t2={};for(var p2 in s2)Object.prototype.hasOwnProperty.call(s2,p2)&&e2.indexOf(p2)<0&&(t2[p2]=s2[p2]);if(null!=s2&&"function"==typeof Object.getOwnPropertySymbols){var i2=0;for(p2=Object.getOwnPropertySymbols(s2);i2<p2.length;i2++)e2.indexOf(p2[i2])<0&&Object.prototype.propertyIsEnumerable.call(s2,p2[i2])&&(t2[p2[i2]]=s2[p2[i2]])}return t2}"function"==typeof SuppressedError&&SuppressedError;function assignRef(ref,value){return"function"==typeof ref?ref(value):ref&&(ref.current=value),ref}var useIsomorphicLayoutEffect$2="undefined"!=typeof window?reactExports.useLayoutEffect:reactExports.useEffect,currentValues=new WeakMap;function useMergeRefs(refs,defaultValue){var initialValue,callback,ref,callbackRef=(initialValue=null,callback=function(newValue){return refs.forEach(function(ref){return assignRef(ref,newValue)})},(ref=reactExports.useState(function(){return{value:initialValue,callback:callback,facade:{get current(){return ref.value},set current(value){var last=ref.value;last!==value&&(ref.value=value,ref.callback(value,last))}}}})[0]).callback=callback,ref.facade);return useIsomorphicLayoutEffect$2(function(){var oldValue=currentValues.get(callbackRef);if(oldValue){var prevRefs_1=new Set(oldValue),nextRefs_1=new Set(refs),current_1=callbackRef.current;prevRefs_1.forEach(function(ref){nextRefs_1.has(ref)||assignRef(ref,null)}),nextRefs_1.forEach(function(ref){prevRefs_1.has(ref)||assignRef(ref,current_1)})}currentValues.set(callbackRef,refs)},[refs]),callbackRef}function ItoI(a2){return a2}var SideCar$1=function(_a){var sideCar=_a.sideCar,rest=__rest(_a,["sideCar"]);if(!sideCar)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var Target=sideCar.read();if(!Target)throw new Error("Sidecar medium not found");return reactExports.createElement(Target,__assign({},rest))};SideCar$1.isSideCarExport=!0;var effectCar=function(options){void 0===options&&(options={});var medium=function(defaults,middleware){void 0===middleware&&(middleware=ItoI);var buffer=[],assigned=!1;return{read:function(){if(assigned)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return buffer.length?buffer[buffer.length-1]:defaults},useMedium:function(data){var item=middleware(data,assigned);return buffer.push(item),function(){buffer=buffer.filter(function(x2){return x2!==item})}},assignSyncMedium:function(cb){for(assigned=!0;buffer.length;){var cbs=buffer;buffer=[],cbs.forEach(cb)}buffer={push:function(x2){return cb(x2)},filter:function(){return buffer}}},assignMedium:function(cb){assigned=!0;var pendingQueue=[];if(buffer.length){var cbs=buffer;buffer=[],cbs.forEach(cb),pendingQueue=buffer}var executeQueue=function(){var cbs2=pendingQueue;pendingQueue=[],cbs2.forEach(cb)},cycle=function(){return Promise.resolve().then(executeQueue)};cycle(),buffer={push:function(x2){pendingQueue.push(x2),cycle()},filter:function(filter){return pendingQueue=pendingQueue.filter(filter),buffer}}}}}(null);return medium.options=__assign({async:!0,ssr:!1},options),medium}(),nothing=function(){},RemoveScroll=reactExports.forwardRef(function(props,parentRef){var ref=reactExports.useRef(null),_a=reactExports.useState({onScrollCapture:nothing,onWheelCapture:nothing,onTouchMoveCapture:nothing}),callbacks=_a[0],setCallbacks=_a[1],forwardProps=props.forwardProps,children=props.children,className=props.className,removeScrollBar=props.removeScrollBar,enabled=props.enabled,shards=props.shards,sideCar=props.sideCar,noRelative=props.noRelative,noIsolation=props.noIsolation,inert=props.inert,allowPinchZoom=props.allowPinchZoom,_b=props.as,Container=void 0===_b?"div":_b,gapMode=props.gapMode,rest=__rest(props,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),SideCar2=sideCar,containerRef=useMergeRefs([ref,parentRef]),containerProps=__assign(__assign({},rest),callbacks);return reactExports.createElement(reactExports.Fragment,null,enabled&&reactExports.createElement(SideCar2,{sideCar:effectCar,removeScrollBar:removeScrollBar,shards:shards,noRelative:noRelative,noIsolation:noIsolation,inert:inert,setCallbacks:setCallbacks,allowPinchZoom:!!allowPinchZoom,lockRef:ref,gapMode:gapMode}),forwardProps?reactExports.cloneElement(reactExports.Children.only(children),__assign(__assign({},containerProps),{ref:containerRef})):reactExports.createElement(Container,__assign({},containerProps,{className:className,ref:containerRef}),children))});RemoveScroll.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},RemoveScroll.classNames={fullWidth:"width-before-scroll-bar",zeroRight:"right-scroll-bar-position"};function makeStyleTag(){if(!document)return null;var tag=document.createElement("style");tag.type="text/css";var nonce=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return nonce&&tag.setAttribute("nonce",nonce),tag}var stylesheetSingleton=function(){var counter=0,stylesheet=null;return{add:function(style){var tag,css;0==counter&&(stylesheet=makeStyleTag())&&(css=style,(tag=stylesheet).styleSheet?tag.styleSheet.cssText=css:tag.appendChild(document.createTextNode(css)),function(tag){(document.head||document.getElementsByTagName("head")[0]).appendChild(tag)}(stylesheet)),counter++},remove:function(){! --counter&&stylesheet&&(stylesheet.parentNode&&stylesheet.parentNode.removeChild(stylesheet),stylesheet=null)}}},styleSingleton=function(){var sheet,useStyle=(sheet=stylesheetSingleton(),function(styles2,isDynamic){reactExports.useEffect(function(){return sheet.add(styles2),function(){sheet.remove()}},[styles2&&isDynamic])});return function(_a){var styles2=_a.styles,dynamic=_a.dynamic;return useStyle(styles2,dynamic),null}},zeroGap={left:0,top:0,right:0,gap:0},parse=function(x2){return parseInt(x2||"",10)||0},getGapWidth=function(gapMode){if(void 0===gapMode&&(gapMode="margin"),"undefined"==typeof window)return zeroGap;var offsets=function(gapMode){var cs2=window.getComputedStyle(document.body),left=cs2["padding"===gapMode?"paddingLeft":"marginLeft"],top=cs2["padding"===gapMode?"paddingTop":"marginTop"],right=cs2["padding"===gapMode?"paddingRight":"marginRight"];return[parse(left),parse(top),parse(right)]}(gapMode),documentWidth=document.documentElement.clientWidth,windowWidth=window.innerWidth;return{left:offsets[0],top:offsets[1],right:offsets[2],gap:Math.max(0,windowWidth-documentWidth+offsets[2]-offsets[0])}},Style=styleSingleton(),lockAttribute="data-scroll-locked",getStyles=function(_a,allowRelative,gapMode,important){var left=_a.left,top=_a.top,right=_a.right,gap=_a.gap;return void 0===gapMode&&(gapMode="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(important,";\n padding-right: ").concat(gap,"px ").concat(important,";\n }\n body[").concat(lockAttribute,"] {\n overflow: hidden ").concat(important,";\n overscroll-behavior: contain;\n ").concat([allowRelative&&"position: relative ".concat(important,";"),"margin"===gapMode&&"\n padding-left: ".concat(left,"px;\n padding-top: ").concat(top,"px;\n padding-right: ").concat(right,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(gap,"px ").concat(important,";\n "),"padding"===gapMode&&"padding-right: ".concat(gap,"px ").concat(important,";")].filter(Boolean).join(""),"\n }\n \n .").concat("right-scroll-bar-position"," {\n right: ").concat(gap,"px ").concat(important,";\n }\n \n .").concat("width-before-scroll-bar"," {\n margin-right: ").concat(gap,"px ").concat(important,";\n }\n \n .").concat("right-scroll-bar-position"," .").concat("right-scroll-bar-position"," {\n right: 0 ").concat(important,";\n }\n \n .").concat("width-before-scroll-bar"," .").concat("width-before-scroll-bar"," {\n margin-right: 0 ").concat(important,";\n }\n \n body[").concat(lockAttribute,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(gap,"px;\n }\n")},getCurrentUseCounter=function(){var counter=parseInt(document.body.getAttribute(lockAttribute)||"0",10);return isFinite(counter)?counter:0},RemoveScrollBar=function(_a){var noRelative=_a.noRelative,noImportant=_a.noImportant,_b=_a.gapMode,gapMode=void 0===_b?"margin":_b;reactExports.useEffect(function(){return document.body.setAttribute(lockAttribute,(getCurrentUseCounter()+1).toString()),function(){var newCounter=getCurrentUseCounter()-1;newCounter<=0?document.body.removeAttribute(lockAttribute):document.body.setAttribute(lockAttribute,newCounter.toString())}},[]);var gap=reactExports.useMemo(function(){return getGapWidth(gapMode)},[gapMode]);return reactExports.createElement(Style,{styles:getStyles(gap,!noRelative,gapMode,noImportant?"":"!important")})},passiveSupported=!1;if("undefined"!=typeof window)try{var options=Object.defineProperty({},"passive",{get:function(){return passiveSupported=!0,!0}});window.addEventListener("test",options,options),window.removeEventListener("test",options,options)}catch(err){passiveSupported=!1}var nonPassive=!!passiveSupported&&{passive:!1},elementCanBeScrolled=function(node2,overflow){if(!(node2 instanceof Element))return!1;var styles2=window.getComputedStyle(node2);return"hidden"!==styles2[overflow]&&!(styles2.overflowY===styles2.overflowX&&!function(node2){return"TEXTAREA"===node2.tagName}(node2)&&"visible"===styles2[overflow])},locationCouldBeScrolled=function(axis,node2){var ownerDocument=node2.ownerDocument,current=node2;do{if("undefined"!=typeof ShadowRoot&¤t instanceof ShadowRoot&&(current=current.host),elementCouldBeScrolled(axis,current)){var _a=getScrollVariables(axis,current);if(_a[1]>_a[2])return!0}current=current.parentNode}while(current&¤t!==ownerDocument.body);return!1},elementCouldBeScrolled=function(axis,node2){return"v"===axis?function(node2){return elementCanBeScrolled(node2,"overflowY")}(node2):function(node2){return elementCanBeScrolled(node2,"overflowX")}(node2)},getScrollVariables=function(axis,node2){return"v"===axis?[(_a=node2).scrollTop,_a.scrollHeight,_a.clientHeight]:function(_a){return[_a.scrollLeft,_a.scrollWidth,_a.clientWidth]}(node2);var _a},getTouchXY=function(event){return"changedTouches"in event?[event.changedTouches[0].clientX,event.changedTouches[0].clientY]:[0,0]},getDeltaXY=function(event){return[event.deltaX,event.deltaY]},extractRef=function(ref){return ref&&"current"in ref?ref.current:ref},generateStyle=function(id){return"\n .block-interactivity-".concat(id," {pointer-events: none;}\n .allow-interactivity-").concat(id," {pointer-events: all;}\n")},idCounter$1=0,lockStack=[];function getOutermostShadowParent(node2){for(var shadowParent=null;null!==node2;)node2 instanceof ShadowRoot&&(shadowParent=node2.host,node2=node2.host),node2=node2.parentNode;return shadowParent}const SideCar=(exported=function(props){var shouldPreventQueue=reactExports.useRef([]),touchStartRef=reactExports.useRef([0,0]),activeAxis=reactExports.useRef(),id=reactExports.useState(idCounter$1++)[0],Style2=reactExports.useState(styleSingleton)[0],lastProps=reactExports.useRef(props);reactExports.useEffect(function(){lastProps.current=props},[props]),reactExports.useEffect(function(){if(props.inert){document.body.classList.add("block-interactivity-".concat(id));var allow_1=function(to2,from,pack){if(pack||2===arguments.length)for(var ar2,i2=0,l2=from.length;i2<l2;i2++)!ar2&&i2 in from||(ar2||(ar2=Array.prototype.slice.call(from,0,i2)),ar2[i2]=from[i2]);return to2.concat(ar2||Array.prototype.slice.call(from))}([props.lockRef.current],(props.shards||[]).map(extractRef),!0).filter(Boolean);return allow_1.forEach(function(el2){return el2.classList.add("allow-interactivity-".concat(id))}),function(){document.body.classList.remove("block-interactivity-".concat(id)),allow_1.forEach(function(el2){return el2.classList.remove("allow-interactivity-".concat(id))})}}},[props.inert,props.lockRef.current,props.shards]);var shouldCancelEvent=reactExports.useCallback(function(event,parent){if("touches"in event&&2===event.touches.length||"wheel"===event.type&&event.ctrlKey)return!lastProps.current.allowPinchZoom;var currentAxis,touch=getTouchXY(event),touchStart=touchStartRef.current,deltaX="deltaX"in event?event.deltaX:touchStart[0]-touch[0],deltaY="deltaY"in event?event.deltaY:touchStart[1]-touch[1],target=event.target,moveDirection=Math.abs(deltaX)>Math.abs(deltaY)?"h":"v";if("touches"in event&&"h"===moveDirection&&"range"===target.type)return!1;var selection2=window.getSelection(),anchorNode=selection2&&selection2.anchorNode;if(anchorNode&&(anchorNode===target||anchorNode.contains(target)))return!1;var canBeScrolledInMainDirection=locationCouldBeScrolled(moveDirection,target);if(!canBeScrolledInMainDirection)return!0;if(canBeScrolledInMainDirection?currentAxis=moveDirection:(currentAxis="v"===moveDirection?"h":"v",canBeScrolledInMainDirection=locationCouldBeScrolled(moveDirection,target)),!canBeScrolledInMainDirection)return!1;if(!activeAxis.current&&"changedTouches"in event&&(deltaX||deltaY)&&(activeAxis.current=currentAxis),!currentAxis)return!0;var cancelingAxis=activeAxis.current||currentAxis;return function(axis,endTarget,event,sourceDelta){var directionFactor=function(axis,direction){return"h"===axis&&"rtl"===direction?-1:1}(axis,window.getComputedStyle(endTarget).direction),delta=directionFactor*sourceDelta,target=event.target,targetInLock=endTarget.contains(target),shouldCancelScroll=!1,isDeltaPositive=delta>0,availableScroll=0,availableScrollTop=0;do{if(!target)break;var _a=getScrollVariables(axis,target),position2=_a[0],elementScroll=_a[1]-_a[2]-directionFactor*position2;(position2||elementScroll)&&elementCouldBeScrolled(axis,target)&&(availableScroll+=elementScroll,availableScrollTop+=position2);var parent_1=target.parentNode;target=parent_1&&parent_1.nodeType===Node.DOCUMENT_FRAGMENT_NODE?parent_1.host:parent_1}while(!targetInLock&&target!==document.body||targetInLock&&(endTarget.contains(target)||endTarget===target));return(isDeltaPositive&&Math.abs(availableScroll)<1||!isDeltaPositive&&Math.abs(availableScrollTop)<1)&&(shouldCancelScroll=!0),shouldCancelScroll}(cancelingAxis,parent,event,"h"===cancelingAxis?deltaX:deltaY)},[]),shouldPrevent=reactExports.useCallback(function(_event){var event=_event;if(lockStack.length&&lockStack[lockStack.length-1]===Style2){var delta="deltaY"in event?getDeltaXY(event):getTouchXY(event),sourceEvent=shouldPreventQueue.current.filter(function(e2){return e2.name===event.type&&(e2.target===event.target||event.target===e2.shadowParent)&&(x2=e2.delta,y2=delta,x2[0]===y2[0]&&x2[1]===y2[1]);var x2,y2})[0];if(sourceEvent&&sourceEvent.should)event.cancelable&&event.preventDefault();else if(!sourceEvent){var shardNodes=(lastProps.current.shards||[]).map(extractRef).filter(Boolean).filter(function(node2){return node2.contains(event.target)});(shardNodes.length>0?shouldCancelEvent(event,shardNodes[0]):!lastProps.current.noIsolation)&&event.cancelable&&event.preventDefault()}}},[]),shouldCancel=reactExports.useCallback(function(name,delta,target,should){var event={name:name,delta:delta,target:target,should:should,shadowParent:getOutermostShadowParent(target)};shouldPreventQueue.current.push(event),setTimeout(function(){shouldPreventQueue.current=shouldPreventQueue.current.filter(function(e2){return e2!==event})},1)},[]),scrollTouchStart=reactExports.useCallback(function(event){touchStartRef.current=getTouchXY(event),activeAxis.current=void 0},[]),scrollWheel=reactExports.useCallback(function(event){shouldCancel(event.type,getDeltaXY(event),event.target,shouldCancelEvent(event,props.lockRef.current))},[]),scrollTouchMove=reactExports.useCallback(function(event){shouldCancel(event.type,getTouchXY(event),event.target,shouldCancelEvent(event,props.lockRef.current))},[]);reactExports.useEffect(function(){return lockStack.push(Style2),props.setCallbacks({onScrollCapture:scrollWheel,onWheelCapture:scrollWheel,onTouchMoveCapture:scrollTouchMove}),document.addEventListener("wheel",shouldPrevent,nonPassive),document.addEventListener("touchmove",shouldPrevent,nonPassive),document.addEventListener("touchstart",scrollTouchStart,nonPassive),function(){lockStack=lockStack.filter(function(inst){return inst!==Style2}),document.removeEventListener("wheel",shouldPrevent,nonPassive),document.removeEventListener("touchmove",shouldPrevent,nonPassive),document.removeEventListener("touchstart",scrollTouchStart,nonPassive)}},[]);var removeScrollBar=props.removeScrollBar,inert=props.inert;return reactExports.createElement(reactExports.Fragment,null,inert?reactExports.createElement(Style2,{styles:generateStyle(id)}):null,removeScrollBar?reactExports.createElement(RemoveScrollBar,{noRelative:props.noRelative,gapMode:props.gapMode}):null)},effectCar.useMedium(exported),SideCar$1);var exported,ReactRemoveScroll=reactExports.forwardRef(function(props,ref){return reactExports.createElement(RemoveScroll,__assign({},props,{ref:ref,sideCar:SideCar}))});ReactRemoveScroll.classNames=RemoveScroll.classNames;var[createPopoverContext]=createContextScope("Popover",[createPopperScope]),usePopperScope$2=createPopperScope(),[PopoverProvider,usePopoverContext]=createPopoverContext("Popover"),Popover=props=>{const{__scopePopover:__scopePopover,children:children,open:openProp,defaultOpen:defaultOpen,onOpenChange:onOpenChange,modal:modal=!1}=props,popperScope=usePopperScope$2(__scopePopover),triggerRef=reactExports.useRef(null),[hasCustomAnchor,setHasCustomAnchor]=reactExports.useState(!1),[open,setOpen]=useControllableState({prop:openProp,defaultProp:defaultOpen??!1,onChange:onOpenChange,caller:"Popover"});return jsxRuntimeExports.jsx(Root2$3,{...popperScope,children:jsxRuntimeExports.jsx(PopoverProvider,{scope:__scopePopover,contentId:useId(),triggerRef:triggerRef,open:open,onOpenChange:setOpen,onOpenToggle:reactExports.useCallback(()=>setOpen(prevOpen=>!prevOpen),[setOpen]),hasCustomAnchor:hasCustomAnchor,onCustomAnchorAdd:reactExports.useCallback(()=>setHasCustomAnchor(!0),[]),onCustomAnchorRemove:reactExports.useCallback(()=>setHasCustomAnchor(!1),[]),modal:modal,children:children})})};Popover.displayName="Popover";var PopoverAnchor=reactExports.forwardRef((props,forwardedRef)=>{const{__scopePopover:__scopePopover,...anchorProps}=props,context=usePopoverContext("PopoverAnchor",__scopePopover),popperScope=usePopperScope$2(__scopePopover),{onCustomAnchorAdd:onCustomAnchorAdd,onCustomAnchorRemove:onCustomAnchorRemove}=context;return reactExports.useEffect(()=>(onCustomAnchorAdd(),()=>onCustomAnchorRemove()),[onCustomAnchorAdd,onCustomAnchorRemove]),jsxRuntimeExports.jsx(Anchor,{...popperScope,...anchorProps,ref:forwardedRef})});PopoverAnchor.displayName="PopoverAnchor";var PopoverTrigger=reactExports.forwardRef((props,forwardedRef)=>{const{__scopePopover:__scopePopover,...triggerProps}=props,context=usePopoverContext("PopoverTrigger",__scopePopover),popperScope=usePopperScope$2(__scopePopover),composedTriggerRef=useComposedRefs(forwardedRef,context.triggerRef),trigger=jsxRuntimeExports.jsx(Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":context.open,"aria-controls":context.contentId,"data-state":getState$2(context.open),...triggerProps,ref:composedTriggerRef,onClick:composeEventHandlers(props.onClick,context.onOpenToggle)});return context.hasCustomAnchor?trigger:jsxRuntimeExports.jsx(Anchor,{asChild:!0,...popperScope,children:trigger})});PopoverTrigger.displayName="PopoverTrigger";var[PortalProvider$2,usePortalContext$2]=createPopoverContext("PopoverPortal",{forceMount:void 0}),PopoverPortal=props=>{const{__scopePopover:__scopePopover,forceMount:forceMount,children:children,container:container}=props,context=usePopoverContext("PopoverPortal",__scopePopover);return jsxRuntimeExports.jsx(PortalProvider$2,{scope:__scopePopover,forceMount:forceMount,children:jsxRuntimeExports.jsx(Presence,{present:forceMount||context.open,children:jsxRuntimeExports.jsx(Portal$4,{asChild:!0,container:container,children:children})})})};PopoverPortal.displayName="PopoverPortal";var PopoverContent=reactExports.forwardRef((props,forwardedRef)=>{const portalContext=usePortalContext$2("PopoverContent",props.__scopePopover),{forceMount:forceMount=portalContext.forceMount,...contentProps}=props,context=usePopoverContext("PopoverContent",props.__scopePopover);return jsxRuntimeExports.jsx(Presence,{present:forceMount||context.open,children:context.modal?jsxRuntimeExports.jsx(PopoverContentModal,{...contentProps,ref:forwardedRef}):jsxRuntimeExports.jsx(PopoverContentNonModal,{...contentProps,ref:forwardedRef})})});PopoverContent.displayName="PopoverContent";var Slot$2=createSlot("PopoverContent.RemoveScroll"),PopoverContentModal=reactExports.forwardRef((props,forwardedRef)=>{const context=usePopoverContext("PopoverContent",props.__scopePopover),contentRef=reactExports.useRef(null),composedRefs=useComposedRefs(forwardedRef,contentRef),isRightClickOutsideRef=reactExports.useRef(!1);return reactExports.useEffect(()=>{const content2=contentRef.current;if(content2)return hideOthers(content2)},[]),jsxRuntimeExports.jsx(ReactRemoveScroll,{as:Slot$2,allowPinchZoom:!0,children:jsxRuntimeExports.jsx(PopoverContentImpl,{...props,ref:composedRefs,trapFocus:context.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:composeEventHandlers(props.onCloseAutoFocus,event=>{var _a;event.preventDefault(),isRightClickOutsideRef.current||null==(_a=context.triggerRef.current)||_a.focus()}),onPointerDownOutside:composeEventHandlers(props.onPointerDownOutside,event=>{const originalEvent=event.detail.originalEvent,ctrlLeftClick=0===originalEvent.button&&!0===originalEvent.ctrlKey,isRightClick=2===originalEvent.button||ctrlLeftClick;isRightClickOutsideRef.current=isRightClick},{checkForDefaultPrevented:!1}),onFocusOutside:composeEventHandlers(props.onFocusOutside,event=>event.preventDefault(),{checkForDefaultPrevented:!1})})})}),PopoverContentNonModal=reactExports.forwardRef((props,forwardedRef)=>{const context=usePopoverContext("PopoverContent",props.__scopePopover),hasInteractedOutsideRef=reactExports.useRef(!1),hasPointerDownOutsideRef=reactExports.useRef(!1);return jsxRuntimeExports.jsx(PopoverContentImpl,{...props,ref:forwardedRef,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:event=>{var _a,_b;null==(_a=props.onCloseAutoFocus)||_a.call(props,event),event.defaultPrevented||(hasInteractedOutsideRef.current||null==(_b=context.triggerRef.current)||_b.focus(),event.preventDefault()),hasInteractedOutsideRef.current=!1,hasPointerDownOutsideRef.current=!1},onInteractOutside:event=>{var _a,_b;null==(_a=props.onInteractOutside)||_a.call(props,event),event.defaultPrevented||(hasInteractedOutsideRef.current=!0,"pointerdown"===event.detail.originalEvent.type&&(hasPointerDownOutsideRef.current=!0));const target=event.target;(null==(_b=context.triggerRef.current)?void 0:_b.contains(target))&&event.preventDefault(),"focusin"===event.detail.originalEvent.type&&hasPointerDownOutsideRef.current&&event.preventDefault()}})}),PopoverContentImpl=reactExports.forwardRef((props,forwardedRef)=>{const{__scopePopover:__scopePopover,trapFocus:trapFocus,onOpenAutoFocus:onOpenAutoFocus,onCloseAutoFocus:onCloseAutoFocus,disableOutsidePointerEvents:disableOutsidePointerEvents,onEscapeKeyDown:onEscapeKeyDown,onPointerDownOutside:onPointerDownOutside,onFocusOutside:onFocusOutside,onInteractOutside:onInteractOutside,...contentProps}=props,context=usePopoverContext("PopoverContent",__scopePopover),popperScope=usePopperScope$2(__scopePopover);return useFocusGuards(),jsxRuntimeExports.jsx(FocusScope,{asChild:!0,loop:!0,trapped:trapFocus,onMountAutoFocus:onOpenAutoFocus,onUnmountAutoFocus:onCloseAutoFocus,children:jsxRuntimeExports.jsx(DismissableLayer,{asChild:!0,disableOutsidePointerEvents:disableOutsidePointerEvents,onInteractOutside:onInteractOutside,onEscapeKeyDown:onEscapeKeyDown,onPointerDownOutside:onPointerDownOutside,onFocusOutside:onFocusOutside,onDismiss:()=>context.onOpenChange(!1),children:jsxRuntimeExports.jsx(Content$1,{"data-state":getState$2(context.open),role:"dialog",id:context.contentId,...popperScope,...contentProps,ref:forwardedRef,style:{...contentProps.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})});reactExports.forwardRef((props,forwardedRef)=>{const{__scopePopover:__scopePopover,...closeProps}=props,context=usePopoverContext("PopoverClose",__scopePopover);return jsxRuntimeExports.jsx(Primitive.button,{type:"button",...closeProps,ref:forwardedRef,onClick:composeEventHandlers(props.onClick,()=>context.onOpenChange(!1))})}).displayName="PopoverClose";var PopoverArrow=reactExports.forwardRef((props,forwardedRef)=>{const{__scopePopover:__scopePopover,...arrowProps}=props,popperScope=usePopperScope$2(__scopePopover);return jsxRuntimeExports.jsx(Arrow,{...popperScope,...arrowProps,ref:forwardedRef})});function getState$2(open){return open?"open":"closed"}PopoverArrow.displayName="PopoverArrow";var Root2$2=Popover,Anchor2=PopoverAnchor,Portal$3=PopoverPortal,Content2$2=PopoverContent,Arrow2$1=PopoverArrow;function createCollection(name){const PROVIDER_NAME2=name+"CollectionProvider",[createCollectionContext,createCollectionScope2]=createContextScope(PROVIDER_NAME2),[CollectionProviderImpl,useCollectionContext]=createCollectionContext(PROVIDER_NAME2,{collectionRef:{current:null},itemMap:new Map}),CollectionProvider=props=>{const{scope:scope,children:children}=props,ref=React__default.useRef(null),itemMap=React__default.useRef(new Map).current;return jsxRuntimeExports.jsx(CollectionProviderImpl,{scope:scope,itemMap:itemMap,collectionRef:ref,children:children})};CollectionProvider.displayName=PROVIDER_NAME2;const COLLECTION_SLOT_NAME=name+"CollectionSlot",CollectionSlotImpl=createSlot(COLLECTION_SLOT_NAME),CollectionSlot=React__default.forwardRef((props,forwardedRef)=>{const{scope:scope,children:children}=props,composedRefs=useComposedRefs(forwardedRef,useCollectionContext(COLLECTION_SLOT_NAME,scope).collectionRef);return jsxRuntimeExports.jsx(CollectionSlotImpl,{ref:composedRefs,children:children})});CollectionSlot.displayName=COLLECTION_SLOT_NAME;const ITEM_SLOT_NAME=name+"CollectionItemSlot",ITEM_DATA_ATTR="data-radix-collection-item",CollectionItemSlotImpl=createSlot(ITEM_SLOT_NAME),CollectionItemSlot=React__default.forwardRef((props,forwardedRef)=>{const{scope:scope,children:children,...itemData}=props,ref=React__default.useRef(null),composedRefs=useComposedRefs(forwardedRef,ref),context=useCollectionContext(ITEM_SLOT_NAME,scope);return React__default.useEffect(()=>(context.itemMap.set(ref,{ref:ref,...itemData}),()=>{context.itemMap.delete(ref)})),jsxRuntimeExports.jsx(CollectionItemSlotImpl,{[ITEM_DATA_ATTR]:"",ref:composedRefs,children:children})});return CollectionItemSlot.displayName=ITEM_SLOT_NAME,[{Provider:CollectionProvider,Slot:CollectionSlot,ItemSlot:CollectionItemSlot},function(scope){const context=useCollectionContext(name+"CollectionConsumer",scope);return React__default.useCallback(()=>{const collectionNode=context.collectionRef.current;if(!collectionNode)return[];const orderedNodes=Array.from(collectionNode.querySelectorAll("[data-radix-collection-item]"));return Array.from(context.itemMap.values()).sort((a2,b2)=>orderedNodes.indexOf(a2.ref.current)-orderedNodes.indexOf(b2.ref.current))},[context.collectionRef,context.itemMap])},createCollectionScope2]}var DirectionContext=reactExports.createContext(void 0);function useDirection(localDir){const globalDir=reactExports.useContext(DirectionContext);return localDir||globalDir||"ltr"}var ENTRY_FOCUS="rovingFocusGroup.onEntryFocus",EVENT_OPTIONS={bubbles:!1,cancelable:!0},[Collection$1,useCollection$1,createCollectionScope$1]=createCollection("RovingFocusGroup"),[createRovingFocusGroupContext,createRovingFocusGroupScope]=createContextScope("RovingFocusGroup",[createCollectionScope$1]),[RovingFocusProvider,useRovingFocusContext]=createRovingFocusGroupContext("RovingFocusGroup"),RovingFocusGroup=reactExports.forwardRef((props,forwardedRef)=>jsxRuntimeExports.jsx(Collection$1.Provider,{scope:props.__scopeRovingFocusGroup,children:jsxRuntimeExports.jsx(Collection$1.Slot,{scope:props.__scopeRovingFocusGroup,children:jsxRuntimeExports.jsx(RovingFocusGroupImpl,{...props,ref:forwardedRef})})}));RovingFocusGroup.displayName="RovingFocusGroup";var RovingFocusGroupImpl=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeRovingFocusGroup:__scopeRovingFocusGroup,orientation:orientation,loop:loop=!1,dir:dir,currentTabStopId:currentTabStopIdProp,defaultCurrentTabStopId:defaultCurrentTabStopId,onCurrentTabStopIdChange:onCurrentTabStopIdChange,onEntryFocus:onEntryFocus,preventScrollOnEntryFocus:preventScrollOnEntryFocus=!1,...groupProps}=props,ref=reactExports.useRef(null),composedRefs=useComposedRefs(forwardedRef,ref),direction=useDirection(dir),[currentTabStopId,setCurrentTabStopId]=useControllableState({prop:currentTabStopIdProp,defaultProp:defaultCurrentTabStopId??null,onChange:onCurrentTabStopIdChange,caller:"RovingFocusGroup"}),[isTabbingBackOut,setIsTabbingBackOut]=reactExports.useState(!1),handleEntryFocus=useCallbackRef$1(onEntryFocus),getItems=useCollection$1(__scopeRovingFocusGroup),isClickFocusRef=reactExports.useRef(!1),[focusableItemsCount,setFocusableItemsCount]=reactExports.useState(0);return reactExports.useEffect(()=>{const node2=ref.current;if(node2)return node2.addEventListener(ENTRY_FOCUS,handleEntryFocus),()=>node2.removeEventListener(ENTRY_FOCUS,handleEntryFocus)},[handleEntryFocus]),jsxRuntimeExports.jsx(RovingFocusProvider,{scope:__scopeRovingFocusGroup,orientation:orientation,dir:direction,loop:loop,currentTabStopId:currentTabStopId,onItemFocus:reactExports.useCallback(tabStopId=>setCurrentTabStopId(tabStopId),[setCurrentTabStopId]),onItemShiftTab:reactExports.useCallback(()=>setIsTabbingBackOut(!0),[]),onFocusableItemAdd:reactExports.useCallback(()=>setFocusableItemsCount(prevCount=>prevCount+1),[]),onFocusableItemRemove:reactExports.useCallback(()=>setFocusableItemsCount(prevCount=>prevCount-1),[]),children:jsxRuntimeExports.jsx(Primitive.div,{tabIndex:isTabbingBackOut||0===focusableItemsCount?-1:0,"data-orientation":orientation,...groupProps,ref:composedRefs,style:{outline:"none",...props.style},onMouseDown:composeEventHandlers(props.onMouseDown,()=>{isClickFocusRef.current=!0}),onFocus:composeEventHandlers(props.onFocus,event=>{const isKeyboardFocus=!isClickFocusRef.current;if(event.target===event.currentTarget&&isKeyboardFocus&&!isTabbingBackOut){const entryFocusEvent=new CustomEvent(ENTRY_FOCUS,EVENT_OPTIONS);if(event.currentTarget.dispatchEvent(entryFocusEvent),!entryFocusEvent.defaultPrevented){const items=getItems().filter(item=>item.focusable);focusFirst([items.find(item=>item.active),items.find(item=>item.id===currentTabStopId),...items].filter(Boolean).map(item=>item.ref.current),preventScrollOnEntryFocus)}}isClickFocusRef.current=!1}),onBlur:composeEventHandlers(props.onBlur,()=>setIsTabbingBackOut(!1))})})}),RovingFocusGroupItem=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeRovingFocusGroup:__scopeRovingFocusGroup,focusable:focusable=!0,active:active=!1,tabStopId:tabStopId,children:children,...itemProps}=props,autoId=useId(),id=tabStopId||autoId,context=useRovingFocusContext("RovingFocusGroupItem",__scopeRovingFocusGroup),isCurrentTabStop=context.currentTabStopId===id,getItems=useCollection$1(__scopeRovingFocusGroup),{onFocusableItemAdd:onFocusableItemAdd,onFocusableItemRemove:onFocusableItemRemove,currentTabStopId:currentTabStopId}=context;return reactExports.useEffect(()=>{if(focusable)return onFocusableItemAdd(),()=>onFocusableItemRemove()},[focusable,onFocusableItemAdd,onFocusableItemRemove]),jsxRuntimeExports.jsx(Collection$1.ItemSlot,{scope:__scopeRovingFocusGroup,id:id,focusable:focusable,active:active,children:jsxRuntimeExports.jsx(Primitive.span,{tabIndex:isCurrentTabStop?0:-1,"data-orientation":context.orientation,...itemProps,ref:forwardedRef,onMouseDown:composeEventHandlers(props.onMouseDown,event=>{focusable?context.onItemFocus(id):event.preventDefault()}),onFocus:composeEventHandlers(props.onFocus,()=>context.onItemFocus(id)),onKeyDown:composeEventHandlers(props.onKeyDown,event=>{if("Tab"===event.key&&event.shiftKey)return void context.onItemShiftTab();if(event.target!==event.currentTarget)return;const focusIntent=function(event,orientation,dir){const key=function(key,dir){return"rtl"!==dir?key:"ArrowLeft"===key?"ArrowRight":"ArrowRight"===key?"ArrowLeft":key}(event.key,dir);return"vertical"===orientation&&["ArrowLeft","ArrowRight"].includes(key)||"horizontal"===orientation&&["ArrowUp","ArrowDown"].includes(key)?void 0:MAP_KEY_TO_FOCUS_INTENT[key]}(event,context.orientation,context.dir);if(void 0!==focusIntent){if(event.metaKey||event.ctrlKey||event.altKey||event.shiftKey)return;event.preventDefault();let candidateNodes=getItems().filter(item=>item.focusable).map(item=>item.ref.current);if("last"===focusIntent)candidateNodes.reverse();else if("prev"===focusIntent||"next"===focusIntent){"prev"===focusIntent&&candidateNodes.reverse();const currentIndex=candidateNodes.indexOf(event.currentTarget);candidateNodes=context.loop?(startIndex=currentIndex+1,(array=candidateNodes).map((_2,index2)=>array[(startIndex+index2)%array.length])):candidateNodes.slice(currentIndex+1)}setTimeout(()=>focusFirst(candidateNodes))}var array,startIndex}),children:"function"==typeof children?children({isCurrentTabStop:isCurrentTabStop,hasTabStop:null!=currentTabStopId}):children})})});RovingFocusGroupItem.displayName="RovingFocusGroupItem";var MAP_KEY_TO_FOCUS_INTENT={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function focusFirst(candidates,preventScroll=!1){const PREVIOUSLY_FOCUSED_ELEMENT=document.activeElement;for(const candidate of candidates){if(candidate===PREVIOUSLY_FOCUSED_ELEMENT)return;if(candidate.focus({preventScroll:preventScroll}),document.activeElement!==PREVIOUSLY_FOCUSED_ELEMENT)return}}var Root$4=RovingFocusGroup,Item$1=RovingFocusGroupItem,DEFAULT_ORIENTATION="horizontal",ORIENTATIONS=["horizontal","vertical"],Separator$3=reactExports.forwardRef((props,forwardedRef)=>{const{decorative:decorative,orientation:orientationProp=DEFAULT_ORIENTATION,...domProps}=props,orientation=function(orientation){return ORIENTATIONS.includes(orientation)}(orientationProp)?orientationProp:DEFAULT_ORIENTATION,semanticProps=decorative?{role:"none"}:{"aria-orientation":"vertical"===orientation?orientation:void 0,role:"separator"};return jsxRuntimeExports.jsx(Primitive.div,{"data-orientation":orientation,...semanticProps,...domProps,ref:forwardedRef})});Separator$3.displayName="Separator";var Root$3=Separator$3,Toggle=reactExports.forwardRef((props,forwardedRef)=>{const{pressed:pressedProp,defaultPressed:defaultPressed,onPressedChange:onPressedChange,...buttonProps}=props,[pressed,setPressed]=useControllableState({prop:pressedProp,onChange:onPressedChange,defaultProp:defaultPressed??!1,caller:"Toggle"});return jsxRuntimeExports.jsx(Primitive.button,{type:"button","aria-pressed":pressed,"data-state":pressed?"on":"off","data-disabled":props.disabled?"":void 0,...buttonProps,ref:forwardedRef,onClick:composeEventHandlers(props.onClick,()=>{props.disabled||setPressed(!pressed)})})});Toggle.displayName="Toggle";var[createToggleGroupContext,createToggleGroupScope]=createContextScope("ToggleGroup",[createRovingFocusGroupScope]),useRovingFocusGroupScope$1=createRovingFocusGroupScope(),ToggleGroup$1=React__default.forwardRef((props,forwardedRef)=>{const{type:type,...toggleGroupProps}=props;if("single"===type){const singleProps=toggleGroupProps;return jsxRuntimeExports.jsx(ToggleGroupImplSingle,{...singleProps,ref:forwardedRef})}if("multiple"===type){const multipleProps=toggleGroupProps;return jsxRuntimeExports.jsx(ToggleGroupImplMultiple,{...multipleProps,ref:forwardedRef})}throw new Error("Missing prop `type` expected on `ToggleGroup`")});ToggleGroup$1.displayName="ToggleGroup";var[ToggleGroupValueProvider,useToggleGroupValueContext]=createToggleGroupContext("ToggleGroup"),ToggleGroupImplSingle=React__default.forwardRef((props,forwardedRef)=>{const{value:valueProp,defaultValue:defaultValue,onValueChange:onValueChange=()=>{},...toggleGroupSingleProps}=props,[value,setValue]=useControllableState({prop:valueProp,defaultProp:defaultValue??"",onChange:onValueChange,caller:"ToggleGroup"});return jsxRuntimeExports.jsx(ToggleGroupValueProvider,{scope:props.__scopeToggleGroup,type:"single",value:React__default.useMemo(()=>value?[value]:[],[value]),onItemActivate:setValue,onItemDeactivate:React__default.useCallback(()=>setValue(""),[setValue]),children:jsxRuntimeExports.jsx(ToggleGroupImpl,{...toggleGroupSingleProps,ref:forwardedRef})})}),ToggleGroupImplMultiple=React__default.forwardRef((props,forwardedRef)=>{const{value:valueProp,defaultValue:defaultValue,onValueChange:onValueChange=()=>{},...toggleGroupMultipleProps}=props,[value,setValue]=useControllableState({prop:valueProp,defaultProp:defaultValue??[],onChange:onValueChange,caller:"ToggleGroup"}),handleButtonActivate=React__default.useCallback(itemValue=>setValue((prevValue=[])=>[...prevValue,itemValue]),[setValue]),handleButtonDeactivate=React__default.useCallback(itemValue=>setValue((prevValue=[])=>prevValue.filter(value2=>value2!==itemValue)),[setValue]);return jsxRuntimeExports.jsx(ToggleGroupValueProvider,{scope:props.__scopeToggleGroup,type:"multiple",value:value,onItemActivate:handleButtonActivate,onItemDeactivate:handleButtonDeactivate,children:jsxRuntimeExports.jsx(ToggleGroupImpl,{...toggleGroupMultipleProps,ref:forwardedRef})})});ToggleGroup$1.displayName="ToggleGroup";var[ToggleGroupContext,useToggleGroupContext]=createToggleGroupContext("ToggleGroup"),ToggleGroupImpl=React__default.forwardRef((props,forwardedRef)=>{const{__scopeToggleGroup:__scopeToggleGroup,disabled:disabled=!1,rovingFocus:rovingFocus=!0,orientation:orientation,dir:dir,loop:loop=!0,...toggleGroupProps}=props,rovingFocusGroupScope=useRovingFocusGroupScope$1(__scopeToggleGroup),direction=useDirection(dir),commonProps={role:"group",dir:direction,...toggleGroupProps};return jsxRuntimeExports.jsx(ToggleGroupContext,{scope:__scopeToggleGroup,rovingFocus:rovingFocus,disabled:disabled,children:rovingFocus?jsxRuntimeExports.jsx(Root$4,{asChild:!0,...rovingFocusGroupScope,orientation:orientation,dir:direction,loop:loop,children:jsxRuntimeExports.jsx(Primitive.div,{...commonProps,ref:forwardedRef})}):jsxRuntimeExports.jsx(Primitive.div,{...commonProps,ref:forwardedRef})})}),ToggleGroupItem=React__default.forwardRef((props,forwardedRef)=>{const valueContext=useToggleGroupValueContext("ToggleGroupItem",props.__scopeToggleGroup),context=useToggleGroupContext("ToggleGroupItem",props.__scopeToggleGroup),rovingFocusGroupScope=useRovingFocusGroupScope$1(props.__scopeToggleGroup),pressed=valueContext.value.includes(props.value),disabled=context.disabled||props.disabled,commonProps={...props,pressed:pressed,disabled:disabled},ref=React__default.useRef(null);return context.rovingFocus?jsxRuntimeExports.jsx(Item$1,{asChild:!0,...rovingFocusGroupScope,focusable:!disabled,active:pressed,ref:ref,children:jsxRuntimeExports.jsx(ToggleGroupItemImpl,{...commonProps,ref:forwardedRef})}):jsxRuntimeExports.jsx(ToggleGroupItemImpl,{...commonProps,ref:forwardedRef})});ToggleGroupItem.displayName="ToggleGroupItem";var ToggleGroupItemImpl=React__default.forwardRef((props,forwardedRef)=>{const{__scopeToggleGroup:__scopeToggleGroup,value:value,...itemProps}=props,valueContext=useToggleGroupValueContext("ToggleGroupItem",__scopeToggleGroup),singleProps={role:"radio","aria-checked":props.pressed,"aria-pressed":void 0},typeProps="single"===valueContext.type?singleProps:void 0;return jsxRuntimeExports.jsx(Toggle,{...typeProps,...itemProps,ref:forwardedRef,onPressedChange:pressed=>{pressed?valueContext.onItemActivate(value):valueContext.onItemDeactivate(value)}})}),Root2$1=ToggleGroup$1,Item2=ToggleGroupItem,[createToolbarContext]=createContextScope("Toolbar",[createRovingFocusGroupScope,createToggleGroupScope]),useRovingFocusGroupScope=createRovingFocusGroupScope(),useToggleGroupScope=createToggleGroupScope(),[ToolbarProvider,useToolbarContext]=createToolbarContext("Toolbar"),Toolbar=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeToolbar:__scopeToolbar,orientation:orientation="horizontal",dir:dir,loop:loop=!0,...toolbarProps}=props,rovingFocusGroupScope=useRovingFocusGroupScope(__scopeToolbar),direction=useDirection(dir);return jsxRuntimeExports.jsx(ToolbarProvider,{scope:__scopeToolbar,orientation:orientation,dir:direction,children:jsxRuntimeExports.jsx(Root$4,{asChild:!0,...rovingFocusGroupScope,orientation:orientation,dir:direction,loop:loop,children:jsxRuntimeExports.jsx(Primitive.div,{role:"toolbar","aria-orientation":orientation,dir:direction,...toolbarProps,ref:forwardedRef})})})});Toolbar.displayName="Toolbar";var ToolbarSeparator=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeToolbar:__scopeToolbar,...separatorProps}=props,context=useToolbarContext("ToolbarSeparator",__scopeToolbar);return jsxRuntimeExports.jsx(Root$3,{orientation:"horizontal"===context.orientation?"vertical":"horizontal",...separatorProps,ref:forwardedRef})});ToolbarSeparator.displayName="ToolbarSeparator";var ToolbarButton=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeToolbar:__scopeToolbar,...buttonProps}=props,rovingFocusGroupScope=useRovingFocusGroupScope(__scopeToolbar);return jsxRuntimeExports.jsx(Item$1,{asChild:!0,...rovingFocusGroupScope,focusable:!props.disabled,children:jsxRuntimeExports.jsx(Primitive.button,{type:"button",...buttonProps,ref:forwardedRef})})});ToolbarButton.displayName="ToolbarButton";reactExports.forwardRef((props,forwardedRef)=>{const{__scopeToolbar:__scopeToolbar,...linkProps}=props,rovingFocusGroupScope=useRovingFocusGroupScope(__scopeToolbar);return jsxRuntimeExports.jsx(Item$1,{asChild:!0,...rovingFocusGroupScope,focusable:!0,children:jsxRuntimeExports.jsx(Primitive.a,{...linkProps,ref:forwardedRef,onKeyDown:composeEventHandlers(props.onKeyDown,event=>{" "===event.key&&event.currentTarget.click()})})})}).displayName="ToolbarLink";var ToolbarToggleGroup=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeToolbar:__scopeToolbar,...toggleGroupProps}=props,context=useToolbarContext("ToolbarToggleGroup",__scopeToolbar),toggleGroupScope=useToggleGroupScope(__scopeToolbar);return jsxRuntimeExports.jsx(Root2$1,{"data-orientation":context.orientation,dir:context.dir,...toggleGroupScope,...toggleGroupProps,ref:forwardedRef,rovingFocus:!1})});ToolbarToggleGroup.displayName="ToolbarToggleGroup";var ToolbarToggleItem$1=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeToolbar:__scopeToolbar,...toggleItemProps}=props,toggleGroupScope=useToggleGroupScope(__scopeToolbar),scope={__scopeToolbar:props.__scopeToolbar};return jsxRuntimeExports.jsx(ToolbarButton,{asChild:!0,...scope,children:jsxRuntimeExports.jsx(Item2,{...toggleGroupScope,...toggleItemProps,ref:forwardedRef})})});ToolbarToggleItem$1.displayName="ToolbarToggleItem";var Root4=Toolbar,Separator$2=ToolbarSeparator,Button$1=ToolbarButton,ToggleGroup=ToolbarToggleGroup,ToggleItem=ToolbarToggleItem$1;function isPartOftheEditorUI(element2,editorRoot2){return null!==element2&&element2!==editorRoot2&&(!(void 0===element2.dataset.editorDialog&&void 0===element2.dataset.toolbarItem&&!element2.dataset.editorDropdown)||isPartOftheEditorUI(element2.parentElement,editorRoot2))}const getCellType=rowIndex=>0===rowIndex?"th":"td",AlignToTailwindClassMap={center:styles_centeredCell,left:styles_leftAlignedCell,right:styles_rightAlignedCell},TableEditor=({mdastNode:mdastNode,parentEditor:parentEditor,lexicalTable:lexicalTable})=>{const[activeCell,setActiveCell]=React__default.useState(null),[iconComponentFor,readOnly]=X$3(iconComponentFor$,readOnly$),getCellKey=React__default.useMemo(()=>cell=>(cell.__cacheKey??(cell.__cacheKey=function(){const hex=[...Array(256).keys()].map(index2=>index2.toString(16).padStart(2,"0")),r2=crypto.getRandomValues(new Uint8Array(16));return r2[6]=15&r2[6]|64,r2[8]=63&r2[8]|128,[...r2.entries()].map(([index2,int])=>[4,6,8,10].includes(index2)?`-${hex[int]}`:hex[int]).join("")}()),cell.__cacheKey),[]),setActiveCellWithBoundaries=React__default.useCallback(cell=>{const colCount=lexicalTable.getColCount();if(null===cell)return void setActiveCell(null);let[colIndex,rowIndex]=cell;return colIndex>colCount-1&&(colIndex=0,rowIndex++),colIndex<0&&(colIndex=colCount-1,rowIndex-=1),rowIndex>lexicalTable.getRowCount()-1?(setActiveCell(null),void parentEditor.update(()=>{if(lexicalTable.getLatest().getNextSibling())lexicalTable.getLatest().selectNext();else{const newParagraph=Fi();lexicalTable.insertAfter(newParagraph),newParagraph.select()}})):rowIndex<0?(setActiveCell(null),void parentEditor.update(()=>{lexicalTable.getLatest().selectPrevious()})):void setActiveCell([colIndex,rowIndex])},[lexicalTable,parentEditor]);React__default.useEffect(()=>{lexicalTable.focusEmitter.subscribe(setActiveCellWithBoundaries)},[lexicalTable,setActiveCellWithBoundaries]);const addRowToBottom=React__default.useCallback(e2=>{e2.preventDefault(),parentEditor.update(()=>{lexicalTable.addRowToBottom(),setActiveCell([0,lexicalTable.getRowCount()])})},[parentEditor,lexicalTable]),addColumnToRight=React__default.useCallback(e2=>{e2.preventDefault(),parentEditor.update(()=>{lexicalTable.addColumnToRight(),setActiveCell([lexicalTable.getColCount(),0])})},[parentEditor,lexicalTable]),[highlightedCoordinates,setHighlightedCoordinates]=React__default.useState([-1,-1]),onTableMouseOver=React__default.useCallback(e2=>{let tableCell=e2.target;for(;tableCell&&!["TH","TD"].includes(tableCell.tagName);){if(tableCell===e2.currentTarget)return;tableCell=tableCell.parentElement}if(null===tableCell)return;const tableRow=tableCell.parentElement,colIndex="TFOOT"===tableRow.parentElement.tagName?-1:Array.from(tableRow.children).indexOf(tableCell),rowIndex="TH"===tableCell.tagName?-1:Array.from(tableRow.parentElement.children).indexOf(tableRow);setHighlightedCoordinates([colIndex,rowIndex])},[]),t2=useTranslation();return React__default.createElement("table",{className:styles_tableEditor,onMouseOver:onTableMouseOver,onMouseLeave:()=>{setHighlightedCoordinates([-1,-1])}},React__default.createElement("colgroup",null,readOnly?null:React__default.createElement("col",null),Array.from({length:mdastNode.children[0].children.length},(_2,colIndex)=>{const currentColumnAlign=(mdastNode.align??[])[colIndex]??"left",className=AlignToTailwindClassMap[currentColumnAlign];return React__default.createElement("col",{key:colIndex,className:className})}),readOnly?null:React__default.createElement("col",null)),readOnly||React__default.createElement("thead",null,React__default.createElement("tr",null,React__default.createElement("th",{className:styles_tableToolsColumn}),Array.from({length:mdastNode.children[0].children.length},(_2,colIndex)=>React__default.createElement("th",{key:colIndex,"data-tool-cell":!0},React__default.createElement(ColumnEditor,{setActiveCellWithBoundaries:setActiveCellWithBoundaries,parentEditor:parentEditor,colIndex:colIndex,highlightedCoordinates:highlightedCoordinates,lexicalTable:lexicalTable,align:(mdastNode.align??[])[colIndex]}))),React__default.createElement("th",{className:styles_tableToolsColumn,"data-tool-cell":!0},React__default.createElement("button",{className:styles_iconButton,type:"button",title:t2("table.deleteTable","Delete table"),onClick:e2=>{e2.preventDefault(),parentEditor.update(()=>{lexicalTable.selectNext(),lexicalTable.remove()})}},iconComponentFor("delete_small"))))),React__default.createElement("tbody",null,mdastNode.children.map((row,rowIndex)=>{const CellElement=getCellType(rowIndex);return React__default.createElement("tr",{key:rowIndex},readOnly||React__default.createElement(CellElement,{className:styles_toolCell,"data-tool-cell":!0},React__default.createElement(RowEditor,{setActiveCellWithBoundaries:setActiveCellWithBoundaries,parentEditor:parentEditor,rowIndex:rowIndex,highlightedCoordinates:highlightedCoordinates,lexicalTable:lexicalTable})),row.children.map((mdastCell,colIndex)=>{var _a;return React__default.createElement(Cell,{align:null==(_a=mdastNode.align)?void 0:_a[colIndex],key:getCellKey(mdastCell),contents:mdastCell.children,setActiveCell:setActiveCellWithBoundaries,rowIndex:rowIndex,colIndex:colIndex,lexicalTable:lexicalTable,parentEditor:parentEditor,activeCell:readOnly?[-1,-1]:activeCell})}),readOnly||0===rowIndex&&React__default.createElement("th",{rowSpan:lexicalTable.getRowCount(),"data-tool-cell":!0},React__default.createElement("button",{type:"button",className:styles_addColumnButton,onClick:addColumnToRight},iconComponentFor("add_column"))))})),readOnly||React__default.createElement("tfoot",null,React__default.createElement("tr",null,React__default.createElement("th",null),React__default.createElement("th",{colSpan:lexicalTable.getColCount(),"data-tool-cell":!0},React__default.createElement("button",{type:"button",className:styles_addRowButton,onClick:addRowToBottom},iconComponentFor("add_row"))),React__default.createElement("th",null))))},Cell=({align:align,...props})=>{const{activeCell:activeCell,setActiveCell:setActiveCell}=props,isActive=Boolean(activeCell&&activeCell[0]===props.colIndex&&activeCell[1]===props.rowIndex),className=AlignToTailwindClassMap[align??"left"],CellElement=getCellType(props.rowIndex);return React__default.createElement(CellElement,{className:className,"data-active":isActive,onClick:()=>{setActiveCell([props.colIndex,props.rowIndex])}},React__default.createElement(CellEditor,{...props,focus:isActive}))},CellEditor=({focus:focus2,setActiveCell:setActiveCell,parentEditor:parentEditor,lexicalTable:lexicalTable,contents:contents,colIndex:colIndex,rowIndex:rowIndex})=>{const[importVisitors,exportVisitors,usedLexicalNodes,jsxComponentDescriptors,directiveDescriptors,codeBlockEditorDescriptors,jsxIsAvailable,rootEditor,tableCellEditorChildren]=X$3(importVisitors$,exportVisitors$,usedLexicalNodes$,jsxComponentDescriptors$,directiveDescriptors$,codeBlockEditorDescriptors$,jsxIsAvailable$,rootEditor$,tableCellEditorChildren$),[editor]=React__default.useState(()=>{const editor2=Ji({nodes:usedLexicalNodes,theme:lexicalTheme,namespace:"TableCellEditor"});return editor2.update(()=>{importMdastTreeToLexical({root:Ss(),mdastRoot:{type:"root",children:[{type:"paragraph",children:contents}]},visitors:importVisitors,jsxComponentDescriptors:jsxComponentDescriptors,directiveDescriptors:directiveDescriptors,codeBlockEditorDescriptors:codeBlockEditorDescriptors})}),editor2}),saveAndFocus=React__default.useCallback(nextCell=>{editor.getEditorState().read(()=>{const mdast=exportLexicalTreeToMdast({root:Ss(),jsxComponentDescriptors:jsxComponentDescriptors,visitors:exportVisitors,jsxIsAvailable:jsxIsAvailable});parentEditor.update(()=>{lexicalTable.updateCellContents(colIndex,rowIndex,mdast.children[0].children)},{discrete:!0}),parentEditor.dispatchCommand(NESTED_EDITOR_UPDATED_COMMAND,void 0)}),setActiveCell(nextCell)},[colIndex,editor,exportVisitors,jsxComponentDescriptors,jsxIsAvailable,lexicalTable,parentEditor,rowIndex,setActiveCell]);return React__default.useEffect(()=>j$2(editor.registerCommand(De,payload=>{payload.preventDefault();const nextCell=payload.shiftKey?[colIndex-1,rowIndex]:[colIndex+1,rowIndex];return saveAndFocus(nextCell),!0},4),editor.registerCommand(qe,()=>(setActiveCell([colIndex,rowIndex]),!1),1),editor.registerCommand(Ee,payload=>{null==payload||payload.preventDefault();const nextCell=(null==payload?void 0:payload.shiftKey)?[colIndex,rowIndex-1]:[colIndex,rowIndex+1];return saveAndFocus(nextCell),!0},4),editor.registerCommand(Ge,payload=>!isPartOftheEditorUI(payload.relatedTarget,rootEditor.getRootElement())&&(saveAndFocus(null),!0),0),editor.registerCommand(NESTED_EDITOR_UPDATED_COMMAND,()=>(saveAndFocus(null),!0),0)),[colIndex,editor,rootEditor,rowIndex,saveAndFocus,setActiveCell]),React__default.useEffect(()=>{focus2&&editor.focus()},[focus2,editor]),React__default.createElement(h,{initialEditor:editor},React__default.createElement(h$4,{contentEditable:React__default.createElement(x$3,null),placeholder:React__default.createElement("div",null),ErrorBoundary:a$2}),tableCellEditorChildren.map((Child,index2)=>React__default.createElement(Child,{key:index2})),React__default.createElement(a$3,null))},ColumnEditor=({parentEditor:parentEditor,highlightedCoordinates:highlightedCoordinates,align:align,lexicalTable:lexicalTable,colIndex:colIndex,setActiveCellWithBoundaries:setActiveCellWithBoundaries})=>{const[editorRootElementRef,iconComponentFor]=X$3(editorRootElementRef$,iconComponentFor$),insertColumnAt=React__default.useCallback(colIndex2=>{parentEditor.update(()=>{lexicalTable.insertColumnAt(colIndex2)}),setActiveCellWithBoundaries([colIndex2,0])},[parentEditor,lexicalTable,setActiveCellWithBoundaries]),deleteColumnAt=React__default.useCallback(colIndex2=>{parentEditor.update(()=>{lexicalTable.deleteColumnAt(colIndex2)})},[parentEditor,lexicalTable]),setColumnAlign=React__default.useCallback((colIndex2,align2)=>{parentEditor.update(()=>{lexicalTable.setColumnAlign(colIndex2,align2)})},[parentEditor,lexicalTable]),t2=useTranslation();return React__default.createElement(Root2$2,null,React__default.createElement(PopoverTrigger,{className:styles_tableColumnEditorTrigger,"data-active":highlightedCoordinates[0]===colIndex+1,title:t2("table.columnMenu","Column menu")},iconComponentFor("more_horiz")),React__default.createElement(Portal$3,{container:null==editorRootElementRef?void 0:editorRootElementRef.current},React__default.createElement(PopoverContent,{className:classNames(styles_tableColumnEditorPopoverContent),onOpenAutoFocus:e2=>{e2.preventDefault()},sideOffset:5,side:"top"},React__default.createElement(Root4,{className:styles_tableColumnEditorToolbar},React__default.createElement(ToggleGroup,{className:styles_toggleGroupRoot,onValueChange:value=>{setColumnAlign(colIndex,value)},value:align??"left",type:"single","aria-label":t2("table.textAlignment","Text alignment")},React__default.createElement(ToggleItem,{value:"left",title:t2("table.alignLeft","Align left")},iconComponentFor("format_align_left")),React__default.createElement(ToggleItem,{value:"center",title:t2("table.alignCenter","Align center")},iconComponentFor("format_align_center")),React__default.createElement(ToggleItem,{value:"right",title:t2("table.alignRight","Align right")},iconComponentFor("format_align_right"))),React__default.createElement(Separator$2,null),React__default.createElement(Button$1,{onClick:insertColumnAt.bind(null,colIndex),title:t2("table.insertColumnLeft","Insert a column to the left of this one")},iconComponentFor("insert_col_left")),React__default.createElement(Button$1,{onClick:insertColumnAt.bind(null,colIndex+1),title:t2("table.insertColumnRight","Insert a column to the right of this one")},iconComponentFor("insert_col_right")),React__default.createElement(Button$1,{onClick:deleteColumnAt.bind(null,colIndex),title:t2("table.deleteColumn","Delete this column")},iconComponentFor("delete_small"))),React__default.createElement(Arrow2$1,{className:styles_popoverArrow}))))},RowEditor=({parentEditor:parentEditor,highlightedCoordinates:highlightedCoordinates,lexicalTable:lexicalTable,rowIndex:rowIndex,setActiveCellWithBoundaries:setActiveCellWithBoundaries})=>{const[editorRootElementRef,iconComponentFor]=X$3(editorRootElementRef$,iconComponentFor$),insertRowAt=React__default.useCallback(rowIndex2=>{parentEditor.update(()=>{lexicalTable.insertRowAt(rowIndex2)}),setActiveCellWithBoundaries([0,rowIndex2])},[parentEditor,lexicalTable,setActiveCellWithBoundaries]),deleteRowAt=React__default.useCallback(rowIndex2=>{parentEditor.update(()=>{lexicalTable.deleteRowAt(rowIndex2)})},[parentEditor,lexicalTable]),t2=useTranslation();return React__default.createElement(Root2$2,null,React__default.createElement(PopoverTrigger,{className:styles_tableColumnEditorTrigger,"data-active":highlightedCoordinates[1]===rowIndex,title:t2("table.rowMenu","Row menu")},iconComponentFor("more_horiz")),React__default.createElement(Portal$3,{container:null==editorRootElementRef?void 0:editorRootElementRef.current},React__default.createElement(PopoverContent,{className:classNames(styles_tableColumnEditorPopoverContent),onOpenAutoFocus:e2=>{e2.preventDefault()},sideOffset:5,side:"bottom"},React__default.createElement(Root4,{className:styles_tableColumnEditorToolbar},React__default.createElement(Button$1,{onClick:insertRowAt.bind(null,rowIndex),title:t2("table.insertRowAbove","Insert a row above this one")},iconComponentFor("insert_row_above")),React__default.createElement(Button$1,{onClick:insertRowAt.bind(null,rowIndex+1),title:t2("table.insertRowBelow","Insert a row below this one")},iconComponentFor("insert_row_below")),React__default.createElement(Button$1,{onClick:deleteRowAt.bind(null,rowIndex),title:t2("table.deleteRow","Delete this row")},iconComponentFor("delete_small"))),React__default.createElement(Arrow2$1,{className:styles_popoverArrow}))))};var __defProp$2=Object.defineProperty,__publicField$2=(obj,key,value)=>(((obj,key,value)=>{key in obj?__defProp$2(obj,key,{enumerable:!0,configurable:!0,writable:!0,value:value}):obj[key]=value})(obj,"symbol"!=typeof key?key+"":key,value),value);const EMPTY_CELL={type:"tableCell",children:[]};class TableNode extends _i{constructor(mdastNode,key){super(key),__publicField$2(this,"__mdastNode"),__publicField$2(this,"focusEmitter",function(){let subscription=noop$2;return{publish:coords=>{subscription(coords)},subscribe:cb=>{subscription=cb}}}()),this.__mdastNode=mdastNode??{type:"table",children:[]}}static getType(){return"table"}static clone(node2){return new TableNode(structuredClone(node2.__mdastNode),node2.__key)}static importJSON(serializedNode){return $createTableNode(serializedNode.mdastNode)}static importDOM(){return{table:()=>({conversion:$convertTableElement,priority:3})}}exportJSON(){return{mdastNode:structuredClone(this.__mdastNode),type:"table",version:1}}getMdastNode(){return this.__mdastNode}getRowCount(){return this.__mdastNode.children.length}getColCount(){var _a;return(null==(_a=this.__mdastNode.children[0])?void 0:_a.children.length)||0}createDOM(){return document.createElement("div")}updateDOM(){return!1}updateCellContents(colIndex,rowIndex,children){const table=this.getWritable().__mdastNode,row=table.children[rowIndex],cells=row.children,cell=cells[colIndex],cellsClone=Array.from(cells),cellClone={...cell,children:children},rowClone={...row,children:cellsClone};cellsClone[colIndex]=cellClone,table.children[rowIndex]=rowClone}insertColumnAt(colIndex){const table=this.getWritable().__mdastNode;for(let rowIndex=0;rowIndex<table.children.length;rowIndex++){const row=table.children[rowIndex],cells=row.children,cellsClone=Array.from(cells),rowClone={...row,children:cellsClone};cellsClone.splice(colIndex,0,structuredClone(EMPTY_CELL)),table.children[rowIndex]=rowClone}table.align&&table.align.length>0&&table.align.splice(colIndex,0,"left")}deleteColumnAt(colIndex){const table=this.getWritable().__mdastNode;for(let rowIndex=0;rowIndex<table.children.length;rowIndex++){const row=table.children[rowIndex],cells=row.children,cellsClone=Array.from(cells),rowClone={...row,children:cellsClone};cellsClone.splice(colIndex,1),table.children[rowIndex]=rowClone}}insertRowAt(y2){const table=this.getWritable().__mdastNode,newRow={type:"tableRow",children:Array.from({length:this.getColCount()},()=>structuredClone(EMPTY_CELL))};table.children.splice(y2,0,newRow)}deleteRowAt(rowIndex){1===this.getRowCount()?(this.selectNext(),this.remove()):this.getWritable().__mdastNode.children.splice(rowIndex,1)}addRowToBottom(){this.insertRowAt(this.getRowCount())}addColumnToRight(){this.insertColumnAt(this.getColCount())}setColumnAlign(colIndex,align){const table=this.getWritable().__mdastNode;table.align??(table.align=[]),table.align[colIndex]=align}decorate(parentEditor){return React__default.createElement(TableEditor,{lexicalTable:this,mdastNode:this.__mdastNode,parentEditor:parentEditor})}select(coords){this.focusEmitter.publish(coords??[0,0])}isInline(){return!1}}function $createTableNode(mdastNode){return new TableNode(mdastNode)}function $convertTableElement(element2){const rows=element2.querySelectorAll("tr"),children=Array.from(rows).map(row=>({type:"tableRow",children:Array.from(row.querySelectorAll("td, th")).map(cell=>({type:"tableCell",children:[{type:"text",value:cell.textContent}]}))}));return{node:new TableNode({type:"table",children:children})}}const LexicalTableVisitor={testLexicalNode:function(node2){return node2 instanceof TableNode},visitLexicalNode({actions:actions,mdastParent:mdastParent,lexicalNode:lexicalNode}){actions.appendToParent(mdastParent,lexicalNode.getMdastNode())}},MdastTableVisitor={testNode:"table",visitNode({mdastNode:mdastNode,lexicalParent:lexicalParent}){lexicalParent.append($createTableNode(mdastNode))}};const insertTable$=K$3(r2=>{r2.link(r2.pipe(insertTable$,_$3(({rows:rows,columns:columns})=>()=>$createTableNode(function(rows=1,columns=1){const table={type:"table",children:[]};for(let i2=0;i2<rows;i2++){const tableRow={type:"tableRow",children:[]};for(let j2=0;j2<columns;j2++){const cell={type:"tableCell",children:[]};tableRow.children.push(cell)}table.children.push(tableRow)}return table}(rows,columns)))),insertDecoratorNode$)}),tablePlugin=realmPlugin({init(realm,params){realm.pubIn({[addMdastExtension$]:{enter:{table:enterTable,tableData:enterCell,tableHeader:enterCell,tableRow:enterRow},exit:{codeText:exitCodeText,table:exitTable,tableData:exit,tableHeader:exit,tableRow:exit}},[addSyntaxExtension$]:{flow:{null:{name:"table",tokenize:tokenizeTable,resolveAll:resolveTable}}},[addImportVisitor$]:MdastTableVisitor,[addLexicalNode$]:TableNode,[addExportVisitor$]:LexicalTableVisitor,[addToMarkdownExtension$]:gfmTableToMarkdown({tableCellPadding:(null==params?void 0:params.tableCellPadding)??!0,tablePipeAlign:(null==params?void 0:params.tablePipeAlign)??!0})})}}),MdastLinkVisitor={testNode:"link",visitNode({mdastNode:mdastNode,actions:actions}){actions.addAndStepInto(d$2(mdastNode.url,{title:mdastNode.title}))}},LexicalLinkVisitor={testLexicalNode:p$1,visitLexicalNode:({lexicalNode:lexicalNode,actions:actions})=>{actions.addAndStepInto("link",{url:lexicalNode.getURL(),title:lexicalNode.getTitle()})}};function c({validateUrl:c2,attributes:p2}){const[f3]=o$5();return reactExports.useEffect(()=>{if(!f3.hasNodes([g]))throw new Error("LinkPlugin: LinkNode not registered on editor");return j$2(f3.registerCommand(k$1,t2=>{if(null===t2)return v$1(t2),!0;if("string"==typeof t2)return!(void 0!==c2&&!c2(t2)||(v$1(t2,p2),0));{const{url:r2,target:o2,rel:i2,title:l2}=t2;return v$1(r2,{...p2,rel:i2,target:o2,title:l2}),!0}},1),void 0!==c2?f3.registerCommand(ge,t2=>{const e2=wr();if(!ar(e2)||e2.isCollapsed()||!Lt$1(t2,ClipboardEvent))return!1;if(null===t2.clipboardData)return!1;const o2=t2.clipboardData.getData("text");return!!c2(o2)&&!e2.getNodes().some(t3=>hi(t3))&&(f3.dispatchCommand(k$1,{...p2,url:o2}),t2.preventDefault(),!0)},1):()=>{})},[f3,c2,p2]),null}function m2(t2,e2=t3=>t3){return n2=>{const r2=t2.exec(n2);return null===r2?null:{index:r2.index,length:r2[0].length,text:r2[0],url:e2(r2[0])}}}function T2(t2,e2){for(let n2=0;n2<e2.length;n2++){const r2=e2[n2](t2);if(r2)return r2}return null}const C=/[.,;\s]/;function S2(t2){return C.test(t2)}function b(t2){return S2(t2[t2.length-1])}function U$1(t2){return S2(t2[0])}function v(t2){let e2=t2.getPreviousSibling();return hi(e2)&&(e2=e2.getLastDescendant()),null===e2||Ln(e2)||Zn(e2)&&b(e2.getTextContent())}function L(t2){let e2=t2.getNextSibling();return hi(e2)&&(e2=e2.getFirstDescendant()),null===e2||Ln(e2)||Zn(e2)&&U$1(e2.getTextContent())}function R$1(t2,e2,n2,r2){return!!(t2>0?S2(n2[t2-1]):v(r2[0]))&&(e2<n2.length?S2(n2[e2]):L(r2[r2.length-1]))}function k2(t2,e2,n2){const r2=[],l2=[],o2=[];let i2=0,s2=0;const u2=[...t2];for(;u2.length>0;){const t3=u2[0],g2=t3.getTextContent().length,c2=s2;s2+g2<=e2?(r2.push(t3),i2+=g2):c2>=n2?o2.push(t3):l2.push(t3),s2+=g2,u2.shift()}return[i2,r2,l2,o2]}function D(t2,e2,n2,r2){const o2=U$3(r2.url,r2.attributes);if(1===t2.length){let l2,i2=t2[0];0===e2?[l2,i2]=i2.splitText(n2):[,l2,i2]=i2.splitText(e2,n2);const s2=Qn(r2.text);return s2.setFormat(l2.getFormat()),s2.setDetail(l2.getDetail()),s2.setStyle(l2.getStyle()),o2.append(s2),l2.replace(o2),i2}if(t2.length>1){const r3=t2[0];let l2,i2=r3.getTextContent().length;0===e2?l2=r3:[,l2]=r3.splitText(e2);const s2=[];let c2;for(let e3=1;e3<t2.length;e3++){const r4=t2[e3],l3=r4.getTextContent().length,o3=i2;if(o3<n2)if(i2+l3<=n2)s2.push(r4);else{const[t3,e4]=r4.splitText(n2-o3);s2.push(t3),c2=e4}i2+=l3}const f3=wr(),x2=f3?f3.getNodes().find(Zn):void 0,d2=Qn(l2.getTextContent());return d2.setFormat(l2.getFormat()),d2.setDetail(l2.getDetail()),d2.setStyle(l2.getStyle()),o2.append(d2,...s2),x2&&x2===l2&&(ar(f3)?d2.select(f3.anchor.offset,f3.focus.offset):fr(f3)&&d2.select(0,d2.getTextContent().length)),l2.replace(o2),c2}}function N(t2,e2,n2){const r2=t2.getChildren(),l2=r2.length;for(let e3=0;e3<l2;e3++){const l3=r2[e3];if(!Zn(l3)||!l3.isSimpleText())return I$1(t2),void n2(null,t2.getURL())}const o2=t2.getTextContent(),i2=T2(o2,e2);if(null===i2||i2.text!==o2)return I$1(t2),void n2(null,t2.getURL());if(!v(t2)||!L(t2))return I$1(t2),void n2(null,t2.getURL());const s2=t2.getURL();if(s2!==i2.url&&(t2.setURL(i2.url),n2(i2.url,s2)),i2.attributes){const e3=t2.getRel();e3!==i2.attributes.rel&&(t2.setRel(i2.attributes.rel||null),n2(i2.attributes.rel||null,e3));const r3=t2.getTarget();r3!==i2.attributes.target&&(t2.setTarget(i2.attributes.target||null),n2(i2.attributes.target||null,r3))}}function I$1(t2){const e2=t2.getChildren();for(let n2=e2.length-1;n2>=0;n2--)t2.insertAfter(e2[n2]);return t2.remove(),e2.map(t3=>t3.getLatest())}function w({matchers:t2,onChange:e2}){const[n2]=o$5();return l2=n2,o2=t2,f3=e2,reactExports.useEffect(()=>{l2.hasNodes([m$1])||function(t2,...e2){const n2=new URL("https://lexical.dev/docs/error"),r2=new URLSearchParams;r2.append("code",t2);for(const t3 of e2)r2.append("v",t3);throw n2.search=r2.toString(),Error(`Minified Lexical error #${t2}; visit ${n2.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(77);const x2=(t2,e2)=>{f3&&f3(t2,e2)};return j$2(l2.registerNodeTransform($n,t2=>{const r2=t2.getParentOrThrow(),l3=t2.getPreviousSibling();O(r2)&&!r2.getIsUnlinked()?N(r2,o2,x2):p$1(r2)||(!t2.isSimpleText()||!U$1(t2.getTextContent())&&O(l3)||function(t3,e3,n2){let r3=[...t3];const l4=r3.map(t4=>t4.getTextContent()).join("");let o3,i2=l4,s2=0;for(;(o3=T2(i2,e3))&&null!==o3;){const t4=o3.index,e4=t4+o3.length;if(R$1(s2+t4,s2+e4,l4,r3)){const[l5,,i3,u2]=k2(r3,s2+t4,s2+e4),g2=D(i3,s2+t4-l5,s2+e4-l5,o3);r3=g2?[g2,...u2]:u2,n2(o3.url,null),s2=0}else s2+=e4;i2=i2.substring(e4)}}(function(t3){const e3=[t3];let n2=t3.getNextSibling();for(;null!==n2&&Zn(n2)&&n2.isSimpleText()&&(e3.push(n2),!/[\s]/.test(n2.getTextContent()));)n2=n2.getNextSibling();return e3}(t2),o2,x2),function(t3,n2,r3){const l4=t3.getPreviousSibling(),o3=t3.getNextSibling(),i2=t3.getTextContent();var s2;!O(l4)||l4.getIsUnlinked()||U$1(i2)&&(s2=i2,!(l4.isEmailURI()?/^\.[a-zA-Z]{2,}/.test(s2):/^\.[a-zA-Z0-9]{1,}/.test(s2)))||(l4.append(t3),N(l4,n2,r3),r3(null,l4.getURL())),!O(o3)||o3.getIsUnlinked()||b(i2)||(I$1(o3),N(o3,n2,r3),r3(null,o3.getURL()))}(t2,o2,x2))}),l2.registerCommand(k$1,t2=>{const n2=wr();return!(null!==t2||!ar(n2)||(n2.extract().forEach(t3=>{const n3=t3.getParent();O(n3)&&(n3.setIsUnlinked(!n3.getIsUnlinked()),n3.markDirty())}),1))},1))},[l2,o2,f3]),null;var l2,o2,f3}const MATCHERS=[m2(/((https?:\/\/(www\.)?)|(www\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/,text2=>text2.startsWith("http")?text2:`https://${text2}`),m2(/(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))/,text2=>`mailto:${text2}`)],LexicalAutoLinkPlugin=()=>React__default.createElement(w,{matchers:MATCHERS}),disableAutoLink$=$$4(!1),linkPlugin=realmPlugin({init(realm,params){const disableAutoLink=Boolean(null==params?void 0:params.disableAutoLink),linkPluginProps=(null==params?void 0:params.validateUrl)?{validateUrl:params.validateUrl}:{},EditorChild=()=>React__default.createElement(React__default.Fragment,null,React__default.createElement(c,{...linkPluginProps}),disableAutoLink?null:React__default.createElement(LexicalAutoLinkPlugin,null));realm.pubIn({[addActivePlugin$]:"link",[addImportVisitor$]:MdastLinkVisitor,[addLexicalNode$]:[g,m$1],[addExportVisitor$]:LexicalLinkVisitor,[disableAutoLink$]:disableAutoLink,[addNestedEditorChild$]:EditorChild,[addTableCellEditorChild$]:EditorChild,[addComposerChild$]:EditorChild})}});var _excluded$2C=["color"],ImageIcon=reactExports.forwardRef(function(_ref,forwardedRef){var _ref$color=_ref.color,color2=void 0===_ref$color?"currentColor":_ref$color,props=function(source,excluded){if(null==source)return{};var key,i2,target={},sourceKeys=Object.keys(source);for(i2=0;i2<sourceKeys.length;i2++)key=sourceKeys[i2],excluded.indexOf(key)>=0||(target[key]=source[key]);return target}(_ref,_excluded$2C);return reactExports.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props,{ref:forwardedRef}),reactExports.createElement("path",{d:"M2.5 1H12.5C13.3284 1 14 1.67157 14 2.5V12.5C14 13.3284 13.3284 14 12.5 14H2.5C1.67157 14 1 13.3284 1 12.5V2.5C1 1.67157 1.67157 1 2.5 1ZM2.5 2C2.22386 2 2 2.22386 2 2.5V8.3636L3.6818 6.6818C3.76809 6.59551 3.88572 6.54797 4.00774 6.55007C4.12975 6.55216 4.24568 6.60372 4.32895 6.69293L7.87355 10.4901L10.6818 7.6818C10.8575 7.50607 11.1425 7.50607 11.3182 7.6818L13 9.3636V2.5C13 2.22386 12.7761 2 12.5 2H2.5ZM2 12.5V9.6364L3.98887 7.64753L7.5311 11.4421L8.94113 13H2.5C2.22386 13 2 12.7761 2 12.5ZM12.5 13H10.155L8.48336 11.153L11 8.6364L13 10.6364V12.5C13 12.7761 12.7761 13 12.5 13ZM6.64922 5.5C6.64922 5.03013 7.03013 4.64922 7.5 4.64922C7.96987 4.64922 8.35078 5.03013 8.35078 5.5C8.35078 5.96987 7.96987 6.35078 7.5 6.35078C7.03013 6.35078 6.64922 5.96987 6.64922 5.5ZM7.5 3.74922C6.53307 3.74922 5.74922 4.53307 5.74922 5.5C5.74922 6.46693 6.53307 7.25078 7.5 7.25078C8.46693 7.25078 9.25078 6.46693 9.25078 5.5C9.25078 4.53307 8.46693 3.74922 7.5 3.74922Z",fill:color2,fillRule:"evenodd",clipRule:"evenodd"}))});const ImagePlaceholder=()=>React__default.createElement("div",{className:styles_imagePlaceholder},React__default.createElement(ImageIcon,null));function EditImageToolbar(props){const{nodeKey:nodeKey,imageSource:imageSource,initialImagePath:initialImagePath,title:title,alt:alt,width:width,height:height}=props,[disableImageSettingsButton,iconComponentFor,readOnly]=X$3(disableImageSettingsButton$,iconComponentFor$,readOnly$),[editor]=o$5(),openEditImageDialog=A$4(openEditImageDialog$),t2=useTranslation();return React__default.createElement("div",{className:styles_editImageToolbar},React__default.createElement("button",{className:styles_iconButton,type:"button",title:t2("imageEditor.deleteImage","Delete image"),disabled:readOnly,onClick:e2=>{e2.preventDefault(),editor.update(()=>{var _a;null==(_a=_s(nodeKey))||_a.remove()})}},iconComponentFor("delete_small")),!disableImageSettingsButton&&React__default.createElement("button",{type:"button",className:classNames(styles_iconButton,styles_editImageButton),title:t2("imageEditor.editImage","Edit image"),disabled:readOnly,onClick:()=>{openEditImageDialog({nodeKey:nodeKey,initialValues:{src:initialImagePath??imageSource,title:title,altText:alt,width:parseImageDimension(width),height:parseImageDimension(height)}})}},iconComponentFor("settings")))}var[createDialogContext]=createContextScope("Dialog"),[DialogProvider,useDialogContext]=createDialogContext("Dialog"),Dialog=props=>{const{__scopeDialog:__scopeDialog,children:children,open:openProp,defaultOpen:defaultOpen,onOpenChange:onOpenChange,modal:modal=!0}=props,triggerRef=reactExports.useRef(null),contentRef=reactExports.useRef(null),[open,setOpen]=useControllableState({prop:openProp,defaultProp:defaultOpen??!1,onChange:onOpenChange,caller:"Dialog"});return jsxRuntimeExports.jsx(DialogProvider,{scope:__scopeDialog,triggerRef:triggerRef,contentRef:contentRef,contentId:useId(),titleId:useId(),descriptionId:useId(),open:open,onOpenChange:setOpen,onOpenToggle:reactExports.useCallback(()=>setOpen(prevOpen=>!prevOpen),[setOpen]),modal:modal,children:children})};Dialog.displayName="Dialog";reactExports.forwardRef((props,forwardedRef)=>{const{__scopeDialog:__scopeDialog,...triggerProps}=props,context=useDialogContext("DialogTrigger",__scopeDialog),composedTriggerRef=useComposedRefs(forwardedRef,context.triggerRef);return jsxRuntimeExports.jsx(Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":context.open,"aria-controls":context.contentId,"data-state":getState$1(context.open),...triggerProps,ref:composedTriggerRef,onClick:composeEventHandlers(props.onClick,context.onOpenToggle)})}).displayName="DialogTrigger";var[PortalProvider$1,usePortalContext$1]=createDialogContext("DialogPortal",{forceMount:void 0}),DialogPortal=props=>{const{__scopeDialog:__scopeDialog,forceMount:forceMount,children:children,container:container}=props,context=useDialogContext("DialogPortal",__scopeDialog);return jsxRuntimeExports.jsx(PortalProvider$1,{scope:__scopeDialog,forceMount:forceMount,children:reactExports.Children.map(children,child=>jsxRuntimeExports.jsx(Presence,{present:forceMount||context.open,children:jsxRuntimeExports.jsx(Portal$4,{asChild:!0,container:container,children:child})}))})};DialogPortal.displayName="DialogPortal";var DialogOverlay=reactExports.forwardRef((props,forwardedRef)=>{const portalContext=usePortalContext$1("DialogOverlay",props.__scopeDialog),{forceMount:forceMount=portalContext.forceMount,...overlayProps}=props,context=useDialogContext("DialogOverlay",props.__scopeDialog);return context.modal?jsxRuntimeExports.jsx(Presence,{present:forceMount||context.open,children:jsxRuntimeExports.jsx(DialogOverlayImpl,{...overlayProps,ref:forwardedRef})}):null});DialogOverlay.displayName="DialogOverlay";var Slot$1=createSlot("DialogOverlay.RemoveScroll"),DialogOverlayImpl=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeDialog:__scopeDialog,...overlayProps}=props,context=useDialogContext("DialogOverlay",__scopeDialog);return jsxRuntimeExports.jsx(ReactRemoveScroll,{as:Slot$1,allowPinchZoom:!0,shards:[context.contentRef],children:jsxRuntimeExports.jsx(Primitive.div,{"data-state":getState$1(context.open),...overlayProps,ref:forwardedRef,style:{pointerEvents:"auto",...overlayProps.style}})})}),DialogContent=reactExports.forwardRef((props,forwardedRef)=>{const portalContext=usePortalContext$1("DialogContent",props.__scopeDialog),{forceMount:forceMount=portalContext.forceMount,...contentProps}=props,context=useDialogContext("DialogContent",props.__scopeDialog);return jsxRuntimeExports.jsx(Presence,{present:forceMount||context.open,children:context.modal?jsxRuntimeExports.jsx(DialogContentModal,{...contentProps,ref:forwardedRef}):jsxRuntimeExports.jsx(DialogContentNonModal,{...contentProps,ref:forwardedRef})})});DialogContent.displayName="DialogContent";var DialogContentModal=reactExports.forwardRef((props,forwardedRef)=>{const context=useDialogContext("DialogContent",props.__scopeDialog),contentRef=reactExports.useRef(null),composedRefs=useComposedRefs(forwardedRef,context.contentRef,contentRef);return reactExports.useEffect(()=>{const content2=contentRef.current;if(content2)return hideOthers(content2)},[]),jsxRuntimeExports.jsx(DialogContentImpl,{...props,ref:composedRefs,trapFocus:context.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:composeEventHandlers(props.onCloseAutoFocus,event=>{var _a;event.preventDefault(),null==(_a=context.triggerRef.current)||_a.focus()}),onPointerDownOutside:composeEventHandlers(props.onPointerDownOutside,event=>{const originalEvent=event.detail.originalEvent,ctrlLeftClick=0===originalEvent.button&&!0===originalEvent.ctrlKey;(2===originalEvent.button||ctrlLeftClick)&&event.preventDefault()}),onFocusOutside:composeEventHandlers(props.onFocusOutside,event=>event.preventDefault())})}),DialogContentNonModal=reactExports.forwardRef((props,forwardedRef)=>{const context=useDialogContext("DialogContent",props.__scopeDialog),hasInteractedOutsideRef=reactExports.useRef(!1),hasPointerDownOutsideRef=reactExports.useRef(!1);return jsxRuntimeExports.jsx(DialogContentImpl,{...props,ref:forwardedRef,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:event=>{var _a,_b;null==(_a=props.onCloseAutoFocus)||_a.call(props,event),event.defaultPrevented||(hasInteractedOutsideRef.current||null==(_b=context.triggerRef.current)||_b.focus(),event.preventDefault()),hasInteractedOutsideRef.current=!1,hasPointerDownOutsideRef.current=!1},onInteractOutside:event=>{var _a,_b;null==(_a=props.onInteractOutside)||_a.call(props,event),event.defaultPrevented||(hasInteractedOutsideRef.current=!0,"pointerdown"===event.detail.originalEvent.type&&(hasPointerDownOutsideRef.current=!0));const target=event.target;(null==(_b=context.triggerRef.current)?void 0:_b.contains(target))&&event.preventDefault(),"focusin"===event.detail.originalEvent.type&&hasPointerDownOutsideRef.current&&event.preventDefault()}})}),DialogContentImpl=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeDialog:__scopeDialog,trapFocus:trapFocus,onOpenAutoFocus:onOpenAutoFocus,onCloseAutoFocus:onCloseAutoFocus,...contentProps}=props,context=useDialogContext("DialogContent",__scopeDialog),contentRef=reactExports.useRef(null),composedRefs=useComposedRefs(forwardedRef,contentRef);return useFocusGuards(),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(FocusScope,{asChild:!0,loop:!0,trapped:trapFocus,onMountAutoFocus:onOpenAutoFocus,onUnmountAutoFocus:onCloseAutoFocus,children:jsxRuntimeExports.jsx(DismissableLayer,{role:"dialog",id:context.contentId,"aria-describedby":context.descriptionId,"aria-labelledby":context.titleId,"data-state":getState$1(context.open),...contentProps,ref:composedRefs,onDismiss:()=>context.onOpenChange(!1)})}),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(TitleWarning,{titleId:context.titleId}),jsxRuntimeExports.jsx(DescriptionWarning,{contentRef:contentRef,descriptionId:context.descriptionId})]})]})}),DialogTitle=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeDialog:__scopeDialog,...titleProps}=props,context=useDialogContext("DialogTitle",__scopeDialog);return jsxRuntimeExports.jsx(Primitive.h2,{id:context.titleId,...titleProps,ref:forwardedRef})});DialogTitle.displayName="DialogTitle";reactExports.forwardRef((props,forwardedRef)=>{const{__scopeDialog:__scopeDialog,...descriptionProps}=props,context=useDialogContext("DialogDescription",__scopeDialog);return jsxRuntimeExports.jsx(Primitive.p,{id:context.descriptionId,...descriptionProps,ref:forwardedRef})}).displayName="DialogDescription";var DialogClose=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeDialog:__scopeDialog,...closeProps}=props,context=useDialogContext("DialogClose",__scopeDialog);return jsxRuntimeExports.jsx(Primitive.button,{type:"button",...closeProps,ref:forwardedRef,onClick:composeEventHandlers(props.onClick,()=>context.onOpenChange(!1))})});function getState$1(open){return open?"open":"closed"}DialogClose.displayName="DialogClose";var[WarningProvider,useWarningContext]=function(rootComponentName,defaultContext){const Context=reactExports.createContext(defaultContext),Provider2=props=>{const{children:children,...context}=props,value=reactExports.useMemo(()=>context,Object.values(context));return jsxRuntimeExports.jsx(Context.Provider,{value:value,children:children})};return Provider2.displayName=rootComponentName+"Provider",[Provider2,function(consumerName){const context=reactExports.useContext(Context);if(context)return context;if(void 0!==defaultContext)return defaultContext;throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``)}]}("DialogTitleWarning",{contentName:"DialogContent",titleName:"DialogTitle",docsSlug:"dialog"}),TitleWarning=({titleId:titleId})=>{const titleWarningContext=useWarningContext("DialogTitleWarning"),MESSAGE=`\`${titleWarningContext.contentName}\` requires a \`${titleWarningContext.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${titleWarningContext.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`;return reactExports.useEffect(()=>{if(titleId){document.getElementById(titleId)||console.error(MESSAGE)}},[MESSAGE,titleId]),null},DescriptionWarning=({contentRef:contentRef,descriptionId:descriptionId})=>{const MESSAGE=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${useWarningContext("DialogDescriptionWarning").contentName}}.`;return reactExports.useEffect(()=>{var _a;const describedById=null==(_a=contentRef.current)?void 0:_a.getAttribute("aria-describedby");if(descriptionId&&describedById){document.getElementById(descriptionId)||console.warn(MESSAGE)}},[MESSAGE,contentRef,descriptionId]),null},Root$2=Dialog,Portal$2=DialogPortal,Overlay=DialogOverlay,Content=DialogContent,Title=DialogTitle,Close=DialogClose,isCheckBoxInput=element2=>"checkbox"===element2.type,isDateObject=value=>value instanceof Date,isNullOrUndefined=value=>null==value;const isObjectType=value=>"object"==typeof value;var isObject=value=>!isNullOrUndefined(value)&&!Array.isArray(value)&&isObjectType(value)&&!isDateObject(value),getEventValue=event=>isObject(event)&&event.target?isCheckBoxInput(event.target)?event.target.checked:event.target.value:event,isNameInFieldArray=(names,name)=>name.split(".").some((part,index2,arr)=>!isNaN(Number(part))&&names.has(arr.slice(0,index2).join("."))),isWeb="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function cloneObject(data){if(data instanceof Date)return new Date(data);const isFileListInstance="undefined"!=typeof FileList&&data instanceof FileList;if(isWeb&&(data instanceof Blob||isFileListInstance))return data;const isArray=Array.isArray(data);if(!(isArray||isObject(data)&&(tempObject=>{const prototypeCopy=tempObject.constructor&&tempObject.constructor.prototype;return isObject(prototypeCopy)&&prototypeCopy.hasOwnProperty("isPrototypeOf")})(data)))return data;const copy=isArray?[]:Object.create(Object.getPrototypeOf(data));for(const key in data)Object.prototype.hasOwnProperty.call(data,key)&&(copy[key]=cloneObject(data[key]));return copy}var isKey=value=>/^\w*$/.test(value),isUndefined=val=>void 0===val,compact=value=>Array.isArray(value)?value.filter(Boolean):[],stringToPath=input=>compact(input.replace(/["|']|\]/g,"").split(/\.|\[/)),get=(object,path,defaultValue)=>{if(!path||!isObject(object))return defaultValue;const result=(isKey(path)?[path]:stringToPath(path)).reduce((result2,key)=>isNullOrUndefined(result2)?void 0:result2[key],object);return isUndefined(result)||result===object?isUndefined(object[path])?defaultValue:object[path]:result},isBoolean=value=>"boolean"==typeof value,isFunction=value=>"function"==typeof value,set=(object,path,value)=>{let index2=-1;const tempPath=isKey(path)?[path]:stringToPath(path),length=tempPath.length,lastIndex=length-1;for(;++index2<length;){const key=tempPath[index2];let newValue=value;if(index2!==lastIndex){const objValue=object[key];newValue=isObject(objValue)||Array.isArray(objValue)?objValue:isNaN(+tempPath[index2+1])?{}:[]}if("__proto__"===key||"constructor"===key||"prototype"===key)return;object[key]=newValue,object=object[key]}};const EVENTS_BLUR="blur",EVENTS_FOCUS_OUT="focusout",EVENTS_CHANGE="change",EVENTS_SUBMIT="submit",EVENTS_TRIGGER="trigger",EVENTS_VALID="valid",VALIDATION_MODE_onBlur="onBlur",VALIDATION_MODE_onChange="onChange",VALIDATION_MODE_onSubmit="onSubmit",VALIDATION_MODE_onTouched="onTouched",VALIDATION_MODE_all="all",INPUT_VALIDATION_RULES_max="max",INPUT_VALIDATION_RULES_min="min",INPUT_VALIDATION_RULES_maxLength="maxLength",INPUT_VALIDATION_RULES_minLength="minLength",INPUT_VALIDATION_RULES_pattern="pattern",INPUT_VALIDATION_RULES_required="required",INPUT_VALIDATION_RULES_validate="validate",HookFormControlContext=React__default.createContext(null);HookFormControlContext.displayName="HookFormControlContext";const useFormControlContext=()=>React__default.useContext(HookFormControlContext);var getProxyFormState=(formState,control,localProxyFormState,isRoot=!0)=>{const result={defaultValues:control._defaultValues};for(const key in formState)Object.defineProperty(result,key,{get:()=>{const _key=key;return control._proxyFormState[_key]!==VALIDATION_MODE_all&&(control._proxyFormState[_key]=!isRoot||VALIDATION_MODE_all),localProxyFormState&&(localProxyFormState[_key]=!0),formState[_key]}});return result};const useIsomorphicLayoutEffect$1="undefined"!=typeof window?React__default.useLayoutEffect:React__default.useEffect;var isString=value=>"string"==typeof value,generateWatchOutput=(names,_names,formValues,isGlobal,defaultValue)=>isString(names)?(isGlobal&&_names.watch.add(names),get(formValues,names,defaultValue)):Array.isArray(names)?names.map(fieldName=>(isGlobal&&_names.watch.add(fieldName),get(formValues,fieldName))):(isGlobal&&(_names.watchAll=!0),formValues),isPrimitive=value=>isNullOrUndefined(value)||!isObjectType(value);function deepEqual(object1,object2,visited=new WeakSet){if(object1===object2)return!0;if(isPrimitive(object1)||isPrimitive(object2))return Object.is(object1,object2);if(isDateObject(object1)&&isDateObject(object2))return Object.is(object1.getTime(),object2.getTime());const keys1=Object.keys(object1),keys2=Object.keys(object2);if(keys1.length!==keys2.length)return!1;if(visited.has(object1)||visited.has(object2))return!0;visited.add(object1),visited.add(object2);for(const key of keys1){const val1=object1[key];if(!(key in object2))return!1;if("ref"!==key){const val2=object2[key];if(isDateObject(val1)&&isDateObject(val2)||(isObject(val1)||Array.isArray(val1))&&(isObject(val2)||Array.isArray(val2))?!deepEqual(val1,val2,visited):!Object.is(val1,val2))return!1}}return!0}function useController(props){const formControl=useFormControlContext(),{name:name,disabled:disabled,control:control=formControl,shouldUnregister:shouldUnregister,defaultValue:defaultValue,exact:exact=!0}=props,isArrayField=isNameInFieldArray(control._names.array,name),defaultValueMemo=React__default.useMemo(()=>get(control._formValues,name,get(control._defaultValues,name,defaultValue)),[control,name,defaultValue]),value=function(props){const formControl=useFormControlContext(),{control:control=formControl,name:name,defaultValue:defaultValue,disabled:disabled,exact:exact,compute:compute}=props||{},_defaultValue=React__default.useRef(defaultValue),_compute=React__default.useRef(compute),_computeFormValues=React__default.useRef(void 0),_prevControl=React__default.useRef(control),_prevName=React__default.useRef(name);_compute.current=compute;const[value,updateValue]=React__default.useState(()=>{const defaultValue2=control._getWatch(name,_defaultValue.current);return _compute.current?_compute.current(defaultValue2):defaultValue2}),getCurrentOutput=React__default.useCallback(values=>{const formValues=generateWatchOutput(name,control._names,values||control._formValues,!1,_defaultValue.current);return _compute.current?_compute.current(formValues):formValues},[control._formValues,control._names,name]),refreshValue=React__default.useCallback(values=>{if(!disabled){const formValues=generateWatchOutput(name,control._names,values||control._formValues,!1,_defaultValue.current);if(_compute.current){const computedFormValues=_compute.current(formValues);deepEqual(computedFormValues,_computeFormValues.current)||(updateValue(computedFormValues),_computeFormValues.current=computedFormValues)}else updateValue(formValues)}},[control._formValues,control._names,disabled,name]);useIsomorphicLayoutEffect$1(()=>(_prevControl.current===control&&deepEqual(_prevName.current,name)||(_prevControl.current=control,_prevName.current=name,refreshValue()),control._subscribe({name:name,formState:{values:!0},exact:exact,callback:formState=>{refreshValue(formState.values)}})),[control,exact,name,refreshValue]),React__default.useEffect(()=>control._removeUnmounted());const controlChanged=_prevControl.current!==control,prevName=_prevName.current,computedOutput=React__default.useMemo(()=>{if(disabled)return null;const nameChanged=!controlChanged&&!deepEqual(prevName,name);return controlChanged||nameChanged?getCurrentOutput():null},[disabled,controlChanged,name,prevName,getCurrentOutput]);return null!==computedOutput?computedOutput:value}({control:control,name:name,defaultValue:defaultValueMemo,exact:exact}),formState=function(props){const formControl=useFormControlContext(),{control:control=formControl,disabled:disabled,name:name,exact:exact}=props||{},[formState,updateFormState]=React__default.useState(control._formState),_localProxyFormState=React__default.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return useIsomorphicLayoutEffect$1(()=>control._subscribe({name:name,formState:_localProxyFormState.current,exact:exact,callback:formState2=>{!disabled&&updateFormState({...control._formState,...formState2})}}),[name,disabled,exact]),React__default.useEffect(()=>{_localProxyFormState.current.isValid&&control._setValid(!0)},[control]),React__default.useMemo(()=>getProxyFormState(formState,control,_localProxyFormState.current,!1),[formState,control])}({control:control,name:name,exact:exact}),_props=React__default.useRef(props),_previousNameRef=React__default.useRef(void 0),_registerProps=React__default.useRef(control.register(name,{...props.rules,value:value,...isBoolean(props.disabled)?{disabled:props.disabled}:{}}));_props.current=props;const fieldState=React__default.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!get(formState.errors,name)},isDirty:{enumerable:!0,get:()=>!!get(formState.dirtyFields,name)},isTouched:{enumerable:!0,get:()=>!!get(formState.touchedFields,name)},isValidating:{enumerable:!0,get:()=>!!get(formState.validatingFields,name)},error:{enumerable:!0,get:()=>get(formState.errors,name)}}),[formState,name]),onChange=React__default.useCallback(event=>_registerProps.current.onChange({target:{value:getEventValue(event),name:name},type:EVENTS_CHANGE}),[name]),onBlur=React__default.useCallback(()=>_registerProps.current.onBlur({target:{value:get(control._formValues,name),name:name},type:EVENTS_BLUR}),[name,control._formValues]),ref=React__default.useCallback(elm=>{const field2=get(control._fields,name);field2&&field2._f&&elm&&(field2._f.ref={focus:()=>isFunction(elm.focus)&&elm.focus(),select:()=>isFunction(elm.select)&&elm.select(),setCustomValidity:message=>isFunction(elm.setCustomValidity)&&elm.setCustomValidity(message),reportValidity:()=>isFunction(elm.reportValidity)&&elm.reportValidity()})},[control._fields,name]),field=React__default.useMemo(()=>({name:name,value:value,...isBoolean(disabled)||formState.disabled?{disabled:formState.disabled||disabled}:{},onChange:onChange,onBlur:onBlur,ref:ref}),[name,disabled,formState.disabled,onChange,onBlur,ref,value]);return React__default.useEffect(()=>{const _shouldUnregisterField=control._options.shouldUnregister||shouldUnregister,previousName=_previousNameRef.current;previousName&&previousName!==name&&!isArrayField&&control.unregister(previousName),control.register(name,{..._props.current.rules,...isBoolean(_props.current.disabled)?{disabled:_props.current.disabled}:{}});const updateMounted=(name2,value2)=>{const field2=get(control._fields,name2);field2&&field2._f&&(field2._f.mount=value2)};if(updateMounted(name,!0),_shouldUnregisterField){const value2=cloneObject(get(control._options.defaultValues,name,_props.current.defaultValue));set(control._defaultValues,name,value2),isUndefined(get(control._formValues,name))&&set(control._formValues,name,value2)}return!isArrayField&&control.register(name),_previousNameRef.current=name,()=>{(isArrayField?_shouldUnregisterField&&!control._state.action:_shouldUnregisterField)?control.unregister(name):updateMounted(name,!1)}},[name,control,isArrayField,shouldUnregister]),React__default.useEffect(()=>{control._setDisabledField({disabled:disabled,name:name})},[disabled,name,control]),React__default.useMemo(()=>({field:field,formState:formState,fieldState:fieldState}),[field,formState,fieldState])}const Controller=props=>props.render(useController(props));React__default.createContext(null).displayName="HookFormContext";var appendErrors=(name,validateAllFieldCriteria,errors,type,message)=>validateAllFieldCriteria?{...errors[name],types:{...errors[name]&&errors[name].types?errors[name].types:{},[type]:message||!0}}:{},convertToArrayPayload=value=>Array.isArray(value)?value:[value],createSubject=()=>{let _observers=[];return{get observers(){return _observers},next:value=>{for(const observer of _observers)observer.next&&observer.next(value)},subscribe:observer=>(_observers.push(observer),{unsubscribe:()=>{_observers=_observers.filter(o2=>o2!==observer)}}),unsubscribe:()=>{_observers=[]}}};function extractFormValues(fieldsState,formValues){const values={};for(const key in fieldsState)if(fieldsState.hasOwnProperty(key)){const fieldState=fieldsState[key],fieldValue=formValues[key];if(fieldState&&isObject(fieldState)&&fieldValue){const nestedFieldsState=extractFormValues(fieldState,fieldValue);isObject(nestedFieldsState)&&(values[key]=nestedFieldsState)}else fieldsState[key]&&(values[key]=fieldValue)}return values}var isEmptyObject=value=>isObject(value)&&!Object.keys(value).length,isFileInput=element2=>"file"===element2.type,isHTMLElement=value=>{if(!isWeb)return!1;const owner=value?value.ownerDocument:0;return value instanceof(owner&&owner.defaultView?owner.defaultView.HTMLElement:HTMLElement)},isMultipleSelect=element2=>"select-multiple"===element2.type,isRadioInput=element2=>"radio"===element2.type,live=ref=>isHTMLElement(ref)&&ref.isConnected;function unset(object,path){if(isString(path)&&Object.prototype.hasOwnProperty.call(object,path))return delete object[path],object;const paths=Array.isArray(path)?path:isKey(path)?[path]:stringToPath(path),childObject=1===paths.length?object:function(object,updatePath){const length=updatePath.slice(0,-1).length;let index2=0;for(;index2<length;)object=isUndefined(object)?index2++:object[updatePath[index2++]];return object}(object,paths),index2=paths.length-1,key=paths[index2];return childObject&&delete childObject[key],0!==index2&&(isObject(childObject)&&isEmptyObject(childObject)||Array.isArray(childObject)&&function(obj){for(const key in obj)if(obj.hasOwnProperty(key)&&!isUndefined(obj[key]))return!1;return!0}(childObject))&&unset(object,paths.slice(0,-1)),object}function isTraversable(value){return Array.isArray(value)||isObject(value)&&!(data=>{for(const key in data)if(isFunction(data[key]))return!0;return!1})(value)}function markFieldsDirty(data,fields={}){for(const key in data){const value=data[key];isTraversable(value)?(fields[key]=Array.isArray(value)?[]:{},markFieldsDirty(value,fields[key])):isUndefined(value)||(fields[key]=!0)}return fields}function getDirtyFields(data,formValues,dirtyFieldsFromValues){dirtyFieldsFromValues||(dirtyFieldsFromValues=markFieldsDirty(formValues));for(const key in data){const value=data[key];if(isTraversable(value))isUndefined(formValues)||isPrimitive(dirtyFieldsFromValues[key])?dirtyFieldsFromValues[key]=markFieldsDirty(value,Array.isArray(value)?[]:{}):getDirtyFields(value,isNullOrUndefined(formValues)?{}:formValues[key],dirtyFieldsFromValues[key]);else{const formValue=formValues[key];dirtyFieldsFromValues[key]=!deepEqual(value,formValue)}}return dirtyFieldsFromValues}const defaultResult={value:!1,isValid:!1},validResult={value:!0,isValid:!0};var getCheckboxValue=options=>{if(Array.isArray(options)){if(options.length>1){const values=options.filter(option=>option&&option.checked&&!option.disabled).map(option=>option.value);return{value:values,isValid:!!values.length}}return options[0].checked&&!options[0].disabled?options[0].attributes&&!isUndefined(options[0].attributes.value)?isUndefined(options[0].value)||""===options[0].value?validResult:{value:options[0].value,isValid:!0}:validResult:defaultResult}return defaultResult},getFieldValueAs=(value,{valueAsNumber:valueAsNumber,valueAsDate:valueAsDate,setValueAs:setValueAs})=>isUndefined(value)?value:valueAsNumber?""===value?NaN:value?+value:value:valueAsDate&&isString(value)?new Date(value):setValueAs?setValueAs(value):value;const defaultReturn={isValid:!1,value:null};var getRadioValue=options=>Array.isArray(options)?options.reduce((previous2,option)=>option&&option.checked&&!option.disabled?{isValid:!0,value:option.value}:previous2,defaultReturn):defaultReturn;function getFieldValue(_f){const ref=_f.ref;return isFileInput(ref)?ref.files:isRadioInput(ref)?getRadioValue(_f.refs).value:isMultipleSelect(ref)?[...ref.selectedOptions].map(({value:value})=>value):isCheckBoxInput(ref)?getCheckboxValue(_f.refs).value:getFieldValueAs(isUndefined(ref.value)?_f.ref.value:ref.value,_f)}var isRegex=value=>value instanceof RegExp,getRuleValue=rule=>isUndefined(rule)?rule:isRegex(rule)?rule.source:isObject(rule)?isRegex(rule.value)?rule.value.source:rule.value:rule,getValidationModes=mode=>({isOnSubmit:!mode||mode===VALIDATION_MODE_onSubmit,isOnBlur:mode===VALIDATION_MODE_onBlur,isOnChange:mode===VALIDATION_MODE_onChange,isOnAll:mode===VALIDATION_MODE_all,isOnTouch:mode===VALIDATION_MODE_onTouched});var hasPromiseValidation=fieldReference=>!!fieldReference&&!!fieldReference.validate&&!!(isFunction(fieldReference.validate)&&"AsyncFunction"===fieldReference.validate.constructor.name||isObject(fieldReference.validate)&&Object.values(fieldReference.validate).find(validateFunction=>"AsyncFunction"===validateFunction.constructor.name)),isWatched=(name,_names,isBlurEvent)=>!isBlurEvent&&(_names.watchAll||_names.watch.has(name)||[..._names.watch].some(watchName=>name.startsWith(watchName)&&/^\.\w+/.test(name.slice(watchName.length))));const iterateFieldsByAction=(fields,action,fieldsNames,abortEarly)=>{for(const key of fieldsNames||Object.keys(fields)){const field=get(fields,key);if(field){const{_f:_f,...currentField}=field;if(_f){if(_f.refs&&_f.refs[0]&&action(_f.refs[0],key)&&!abortEarly)return!0;if(_f.ref&&action(_f.ref,_f.name)&&!abortEarly)return!0;if(iterateFieldsByAction(currentField,action))break}else if(isObject(currentField)&&iterateFieldsByAction(currentField,action))break}}};function schemaErrorLookup(errors,_fields,name){const error=get(errors,name);if(error||isKey(name))return{error:error,name:name};const names=name.split(".");for(;names.length;){const fieldName=names.join("."),field=get(_fields,fieldName),foundError=get(errors,fieldName);if(field&&!Array.isArray(field)&&name!==fieldName)return{name:name};if(foundError&&foundError.type)return{name:fieldName,error:foundError};if(foundError&&foundError.root&&foundError.root.type)return{name:`${fieldName}.root`,error:foundError.root};names.pop()}return{name:name}}var updateFieldArrayRootError=(errors,error,name)=>{const fieldArrayErrors=convertToArrayPayload(get(errors,name));return set(fieldArrayErrors,"root",error[name]),set(errors,name,fieldArrayErrors),errors};function getValidateError(result,ref,type="validate"){if(isString(result)||Array.isArray(result)&&result.every(isString)||isBoolean(result)&&!result)return{type:type,message:isString(result)?result:"",ref:ref}}var getValueAndMessage=validationData=>isObject(validationData)&&!isRegex(validationData)?validationData:{value:validationData,message:""},validateField=async(field,disabledFieldNames,formValues,validateAllFieldCriteria,shouldUseNativeValidation,isFieldArray)=>{const{ref:ref,refs:refs,required:required,maxLength:maxLength,minLength:minLength,min:min2,max:max2,pattern:pattern,validate:validate,name:name,valueAsNumber:valueAsNumber,mount:mount}=field._f,inputValue=get(formValues,name);if(!mount||disabledFieldNames.has(name))return{};const inputRef=refs?refs[0]:ref,setCustomValidity=message=>{shouldUseNativeValidation&&inputRef.reportValidity&&(inputRef.setCustomValidity(isBoolean(message)?"":message||""),inputRef.reportValidity())},error={},isRadio=isRadioInput(ref),isCheckBox=isCheckBoxInput(ref),isRadioOrCheckbox2=isRadio||isCheckBox,isEmpty=(valueAsNumber||isFileInput(ref))&&isUndefined(ref.value)&&isUndefined(inputValue)||isHTMLElement(ref)&&""===ref.value||""===inputValue||Array.isArray(inputValue)&&!inputValue.length,appendErrorsCurry=appendErrors.bind(null,name,validateAllFieldCriteria,error),getMinMaxMessage=(exceedMax,maxLengthMessage,minLengthMessage,maxType=INPUT_VALIDATION_RULES_maxLength,minType=INPUT_VALIDATION_RULES_minLength)=>{const message=exceedMax?maxLengthMessage:minLengthMessage;error[name]={type:exceedMax?maxType:minType,message:message,ref:ref,...appendErrorsCurry(exceedMax?maxType:minType,message)}};if(isFieldArray?!Array.isArray(inputValue)||!inputValue.length:required&&(!isRadioOrCheckbox2&&(isEmpty||isNullOrUndefined(inputValue))||isBoolean(inputValue)&&!inputValue||isCheckBox&&!getCheckboxValue(refs).isValid||isRadio&&!getRadioValue(refs).isValid)){const{value:value,message:message}=isString(required)?{value:!!required,message:required}:getValueAndMessage(required);if(value&&(error[name]={type:INPUT_VALIDATION_RULES_required,message:message,ref:inputRef,...appendErrorsCurry(INPUT_VALIDATION_RULES_required,message)},!validateAllFieldCriteria))return setCustomValidity(message),error}if(!(isEmpty||isNullOrUndefined(min2)&&isNullOrUndefined(max2))){let exceedMax,exceedMin;const maxOutput=getValueAndMessage(max2),minOutput=getValueAndMessage(min2);if(isNullOrUndefined(inputValue)||isNaN(inputValue)){const valueDate=ref.valueAsDate||new Date(inputValue),convertTimeToDate=time=>new Date((new Date).toDateString()+" "+time),isTime="time"==ref.type,isWeek="week"==ref.type;isString(maxOutput.value)&&inputValue&&(exceedMax=isTime?convertTimeToDate(inputValue)>convertTimeToDate(maxOutput.value):isWeek?inputValue>maxOutput.value:valueDate>new Date(maxOutput.value)),isString(minOutput.value)&&inputValue&&(exceedMin=isTime?convertTimeToDate(inputValue)<convertTimeToDate(minOutput.value):isWeek?inputValue<minOutput.value:valueDate<new Date(minOutput.value))}else{const valueNumber=ref.valueAsNumber||(inputValue?+inputValue:inputValue);isNullOrUndefined(maxOutput.value)||(exceedMax=valueNumber>maxOutput.value),isNullOrUndefined(minOutput.value)||(exceedMin=valueNumber<minOutput.value)}if((exceedMax||exceedMin)&&(getMinMaxMessage(!!exceedMax,maxOutput.message,minOutput.message,INPUT_VALIDATION_RULES_max,INPUT_VALIDATION_RULES_min),!validateAllFieldCriteria))return setCustomValidity(error[name].message),error}if((maxLength||minLength)&&!isEmpty&&(isString(inputValue)||isFieldArray&&Array.isArray(inputValue))){const maxLengthOutput=getValueAndMessage(maxLength),minLengthOutput=getValueAndMessage(minLength),exceedMax=!isNullOrUndefined(maxLengthOutput.value)&&inputValue.length>+maxLengthOutput.value,exceedMin=!isNullOrUndefined(minLengthOutput.value)&&inputValue.length<+minLengthOutput.value;if((exceedMax||exceedMin)&&(getMinMaxMessage(exceedMax,maxLengthOutput.message,minLengthOutput.message),!validateAllFieldCriteria))return setCustomValidity(error[name].message),error}if(pattern&&!isEmpty&&isString(inputValue)){const{value:patternValue,message:message}=getValueAndMessage(pattern);if(isRegex(patternValue)&&!inputValue.match(patternValue)&&(error[name]={type:INPUT_VALIDATION_RULES_pattern,message:message,ref:ref,...appendErrorsCurry(INPUT_VALIDATION_RULES_pattern,message)},!validateAllFieldCriteria))return setCustomValidity(message),error}if(validate)if(isFunction(validate)){const validateError=getValidateError(await validate(inputValue,formValues),inputRef);if(validateError&&(error[name]={...validateError,...appendErrorsCurry(INPUT_VALIDATION_RULES_validate,validateError.message)},!validateAllFieldCriteria))return setCustomValidity(validateError.message),error}else if(isObject(validate)){let validationResult={};for(const key in validate){if(!isEmptyObject(validationResult)&&!validateAllFieldCriteria)break;const validateError=getValidateError(await validate[key](inputValue,formValues),inputRef,key);validateError&&(validationResult={...validateError,...appendErrorsCurry(key,validateError.message)},setCustomValidity(validateError.message),validateAllFieldCriteria&&(error[name]=validationResult))}if(!isEmptyObject(validationResult)&&(error[name]={ref:inputRef,...validationResult},!validateAllFieldCriteria))return error}return setCustomValidity(!0),error};const defaultOptions={mode:VALIDATION_MODE_onSubmit,reValidateMode:VALIDATION_MODE_onChange,shouldFocusError:!0};function createFormControl(props={}){let delayErrorCallback,_options={...defaultOptions,...props},_formState={submitCount:0,isDirty:!1,isReady:!1,isLoading:isFunction(_options.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:_options.errors||{},disabled:_options.disabled||!1},_fields={},_defaultValues=(isObject(_options.defaultValues)||isObject(_options.values))&&cloneObject(_options.defaultValues||_options.values)||{},_formValues=_options.shouldUnregister?{}:cloneObject(_defaultValues),_state={action:!1,mount:!1,watch:!1,keepIsValid:!1},_names={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},timer=0;const defaultProxyFormState={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},_proxyFormState={...defaultProxyFormState};let _proxySubscribeFormState={..._proxyFormState};const _subjects={array:createSubject(),state:createSubject()},shouldDisplayAllAssociatedErrors=_options.criteriaMode===VALIDATION_MODE_all,_setValid=async shouldUpdateValid=>{if(!_state.keepIsValid&&!_options.disabled&&(_proxyFormState.isValid||_proxySubscribeFormState.isValid||shouldUpdateValid)){let isValid;_options.resolver?(isValid=isEmptyObject((await _runSchema()).errors),_updateIsValidating()):isValid=await executeBuiltInValidation({fields:_fields,onlyCheckValid:!0,eventType:EVENTS_VALID}),isValid!==_formState.isValid&&_subjects.state.next({isValid:isValid})}},_updateIsValidating=(names,isValidating)=>{!_options.disabled&&(_proxyFormState.isValidating||_proxyFormState.validatingFields||_proxySubscribeFormState.isValidating||_proxySubscribeFormState.validatingFields)&&((names||Array.from(_names.mount)).forEach(name=>{name&&(isValidating?set(_formState.validatingFields,name,isValidating):unset(_formState.validatingFields,name))}),_subjects.state.next({validatingFields:_formState.validatingFields,isValidating:!isEmptyObject(_formState.validatingFields)}))},_updateDirtyFields=name=>{const fullDirtyFields=getDirtyFields(_defaultValues,_formValues),rootName=(name=>name.substring(0,name.search(/\.\d+(\.|$)/))||name)(name);set(_formState.dirtyFields,rootName,get(fullDirtyFields,rootName))},updateValidAndValue=(name,shouldSkipSetValueAs,value,ref)=>{const field=get(_fields,name);if(field){const defaultValue=get(_formValues,name,isUndefined(value)?get(_defaultValues,name):value);isUndefined(defaultValue)||ref&&ref.defaultChecked||shouldSkipSetValueAs?set(_formValues,name,shouldSkipSetValueAs?defaultValue:getFieldValue(field._f)):setFieldValue(name,defaultValue),_state.mount&&!_state.action&&_setValid()}},updateTouchAndDirty=(name,fieldValue,isBlurEvent,shouldDirty,shouldRender)=>{let shouldUpdateField=!1,isPreviousDirty=!1;const output={name:name};if(!_options.disabled){if(!isBlurEvent||shouldDirty){(_proxyFormState.isDirty||_proxySubscribeFormState.isDirty)&&(isPreviousDirty=_formState.isDirty,_formState.isDirty=output.isDirty=_getDirty(),shouldUpdateField=isPreviousDirty!==output.isDirty);const isCurrentFieldPristine=deepEqual(get(_defaultValues,name),fieldValue);isPreviousDirty=!!get(_formState.dirtyFields,name),isCurrentFieldPristine?unset(_formState.dirtyFields,name):set(_formState.dirtyFields,name,!0),output.dirtyFields=_formState.dirtyFields,shouldUpdateField=shouldUpdateField||(_proxyFormState.dirtyFields||_proxySubscribeFormState.dirtyFields)&&isPreviousDirty!==!isCurrentFieldPristine}if(isBlurEvent){const isPreviousFieldTouched=get(_formState.touchedFields,name);isPreviousFieldTouched||(set(_formState.touchedFields,name,isBlurEvent),output.touchedFields=_formState.touchedFields,shouldUpdateField=shouldUpdateField||(_proxyFormState.touchedFields||_proxySubscribeFormState.touchedFields)&&isPreviousFieldTouched!==isBlurEvent)}shouldUpdateField&&shouldRender&&_subjects.state.next(output)}return shouldUpdateField?output:{}},shouldRenderByError=(name,isValid,error,fieldState)=>{const previousFieldError=get(_formState.errors,name),shouldUpdateValid=(_proxyFormState.isValid||_proxySubscribeFormState.isValid)&&isBoolean(isValid)&&_formState.isValid!==isValid;var callback;if(_options.delayError&&error?(callback=()=>((name,error)=>{set(_formState.errors,name,error),_subjects.state.next({errors:_formState.errors})})(name,error),delayErrorCallback=wait=>{clearTimeout(timer),timer=setTimeout(callback,wait)},delayErrorCallback(_options.delayError)):(clearTimeout(timer),delayErrorCallback=null,error?set(_formState.errors,name,error):unset(_formState.errors,name)),(error?!deepEqual(previousFieldError,error):previousFieldError)||!isEmptyObject(fieldState)||shouldUpdateValid){const updatedFormState={...fieldState,...shouldUpdateValid&&isBoolean(isValid)?{isValid:isValid}:{},errors:_formState.errors,name:name};_formState={..._formState,...updatedFormState},_subjects.state.next(updatedFormState)}},_runSchema=async name=>(_updateIsValidating(name,!0),await _options.resolver(_formValues,_options.context,((fieldsNames,_fields,criteriaMode,shouldUseNativeValidation)=>{const fields={};for(const name of fieldsNames){const field=get(_fields,name);field&&set(fields,name,field._f)}return{criteriaMode:criteriaMode,names:[...fieldsNames],fields:fields,shouldUseNativeValidation:shouldUseNativeValidation}})(name||_names.mount,_fields,_options.criteriaMode,_options.shouldUseNativeValidation))),validateForm=async({name:name,eventType:eventType})=>{if(props.validate){const result=await props.validate({formValues:_formValues,formState:_formState,name:name,eventType:eventType});if(isObject(result))for(const key in result){result[key]&&setError(`form.${key}`,{message:isString(result.message)?result.message:"",type:INPUT_VALIDATION_RULES_validate})}else isString(result)||!result?setError("form",{message:result||"",type:INPUT_VALIDATION_RULES_validate}):clearErrors("form");return result}return!0},executeBuiltInValidation=async({fields:fields,onlyCheckValid:onlyCheckValid,name:name,eventType:eventType,context:context={valid:!0,runRootValidation:!1}})=>{if(props.validate){context.runRootValidation=!0;if(!(await validateForm({name:name,eventType:eventType}))&&(context.valid=!1,onlyCheckValid))return context.valid}for(const name2 in fields){const field=fields[name2];if(field){const{_f:_f,...fieldValue}=field;if(_f){const isFieldArrayRoot=_names.array.has(_f.name),isPromiseFunction=field._f&&hasPromiseValidation(field._f);isPromiseFunction&&_proxyFormState.validatingFields&&_updateIsValidating([_f.name],!0);const fieldError=await validateField(field,_names.disabled,_formValues,shouldDisplayAllAssociatedErrors,_options.shouldUseNativeValidation&&!onlyCheckValid,isFieldArrayRoot);if(isPromiseFunction&&_proxyFormState.validatingFields&&_updateIsValidating([_f.name]),fieldError[_f.name]&&(context.valid=!1,onlyCheckValid))break;if(!onlyCheckValid&&(get(fieldError,_f.name)?isFieldArrayRoot?updateFieldArrayRootError(_formState.errors,fieldError,_f.name):set(_formState.errors,_f.name,fieldError[_f.name]):unset(_formState.errors,_f.name)),props.shouldUseNativeValidation&&fieldError[_f.name])break}!isEmptyObject(fieldValue)&&await executeBuiltInValidation({context:context,onlyCheckValid:onlyCheckValid,fields:fieldValue,name:name2,eventType:eventType})}}return context.valid},_getDirty=(name,data)=>!_options.disabled&&(name&&data&&set(_formValues,name,data),!deepEqual(getValues(),_defaultValues)),_getWatch=(names,defaultValue,isGlobal)=>generateWatchOutput(names,_names,{..._state.mount?_formValues:isUndefined(defaultValue)?_defaultValues:isString(names)?{[names]:defaultValue}:defaultValue},isGlobal,defaultValue),setFieldValue=(name,value,options={})=>{const field=get(_fields,name);let fieldValue=value;if(field){const fieldReference=field._f;fieldReference&&(!fieldReference.disabled&&set(_formValues,name,getFieldValueAs(value,fieldReference)),fieldValue=isHTMLElement(fieldReference.ref)&&isNullOrUndefined(value)?"":value,isMultipleSelect(fieldReference.ref)?[...fieldReference.ref.options].forEach(optionRef=>optionRef.selected=fieldValue.includes(optionRef.value)):fieldReference.refs?isCheckBoxInput(fieldReference.ref)?fieldReference.refs.forEach(checkboxRef=>{checkboxRef.defaultChecked&&checkboxRef.disabled||(Array.isArray(fieldValue)?checkboxRef.checked=!!fieldValue.find(data=>data===checkboxRef.value):checkboxRef.checked=fieldValue===checkboxRef.value||!!fieldValue)}):fieldReference.refs.forEach(radioRef=>radioRef.checked=radioRef.value===fieldValue):isFileInput(fieldReference.ref)?fieldReference.ref.value="":(fieldReference.ref.value=fieldValue,fieldReference.ref.type||_subjects.state.next({name:name,values:cloneObject(_formValues)})))}(options.shouldDirty||options.shouldTouch)&&updateTouchAndDirty(name,fieldValue,options.shouldTouch,options.shouldDirty,!0),options.shouldValidate&&trigger(name)},setValues=(name,value,options)=>{for(const fieldKey in value){if(!value.hasOwnProperty(fieldKey))return;const fieldValue=value[fieldKey],fieldName=name+"."+fieldKey,field=get(_fields,fieldName);(_names.array.has(name)||isObject(fieldValue)||field&&!field._f)&&!isDateObject(fieldValue)?setValues(fieldName,fieldValue,options):setFieldValue(fieldName,fieldValue,options)}},setValue=(name,value,options={})=>{const field=get(_fields,name),isFieldArray=_names.array.has(name),cloneValue=cloneObject(value),isValueUnchanged=deepEqual(get(_formValues,name),cloneValue);if(set(_formValues,name,cloneValue),isFieldArray)_subjects.array.next({name:name,values:cloneObject(_formValues)}),options.shouldDirty&&(_updateDirtyFields(name),_subjects.state.next({name:name,dirtyFields:_formState.dirtyFields,isDirty:_getDirty(name,cloneValue)}));else{const isEmpty=Array.isArray(cloneValue)&&!cloneValue.length||isEmptyObject(cloneValue);!field||field._f||isNullOrUndefined(cloneValue)||isEmpty?setFieldValue(name,cloneValue,options):setValues(name,cloneValue,options)}isValueUnchanged||(isWatched(name,_names)?_subjects.state.next({..._formState,name:name,values:cloneObject(_formValues)}):_subjects.state.next({name:_state.mount?name:void 0,values:cloneObject(_formValues)}))},onChange=async event=>{_state.mount=!0;const target=event.target;let name=target.name,isFieldValueUpdated=!0;const field=get(_fields,name),_updateIsFieldValueUpdated=fieldValue=>{isFieldValueUpdated=Number.isNaN(fieldValue)||isDateObject(fieldValue)&&isNaN(fieldValue.getTime())||deepEqual(fieldValue,get(_formValues,name,fieldValue))},validationModeBeforeSubmit=getValidationModes(_options.mode),validationModeAfterSubmit=getValidationModes(_options.reValidateMode);if(field){let error,isValid;const fieldValue=target.type?getFieldValue(field._f):getEventValue(event),isBlurEvent=event.type===EVENTS_BLUR||event.type===EVENTS_FOCUS_OUT,shouldSkipValidation=!(options=>options.mount&&(options.required||options.min||options.max||options.maxLength||options.minLength||options.pattern||options.validate))(field._f)&&!props.validate&&!_options.resolver&&!get(_formState.errors,name)&&!field._f.deps||((isBlurEvent,isTouched,isSubmitted,reValidateMode,mode)=>!mode.isOnAll&&(!isSubmitted&&mode.isOnTouch?!(isTouched||isBlurEvent):(isSubmitted?reValidateMode.isOnBlur:mode.isOnBlur)?!isBlurEvent:!(isSubmitted?reValidateMode.isOnChange:mode.isOnChange)||isBlurEvent))(isBlurEvent,get(_formState.touchedFields,name),_formState.isSubmitted,validationModeAfterSubmit,validationModeBeforeSubmit),watched=isWatched(name,_names,isBlurEvent);set(_formValues,name,fieldValue),isBlurEvent?target&&target.readOnly||(field._f.onBlur&&field._f.onBlur(event),delayErrorCallback&&delayErrorCallback(0)):field._f.onChange&&field._f.onChange(event);const fieldState=updateTouchAndDirty(name,fieldValue,isBlurEvent),shouldRender=!isEmptyObject(fieldState)||watched;if(!isBlurEvent&&_subjects.state.next({name:name,type:event.type,values:cloneObject(_formValues)}),shouldSkipValidation)return(_proxyFormState.isValid||_proxySubscribeFormState.isValid)&&("onBlur"===_options.mode?isBlurEvent&&_setValid():isBlurEvent||_setValid()),shouldRender&&_subjects.state.next({name:name,...watched?{}:fieldState});if(!_options.resolver&&props.validate&&await validateForm({name:name,eventType:event.type}),!isBlurEvent&&watched&&_subjects.state.next({..._formState}),_options.resolver){const{errors:errors}=await _runSchema([name]);if(_updateIsValidating([name]),_updateIsFieldValueUpdated(fieldValue),isFieldValueUpdated){const previousErrorLookupResult=schemaErrorLookup(_formState.errors,_fields,name),errorLookupResult=schemaErrorLookup(errors,_fields,previousErrorLookupResult.name||name);error=errorLookupResult.error,name=errorLookupResult.name,isValid=isEmptyObject(errors)}}else _updateIsValidating([name],!0),error=(await validateField(field,_names.disabled,_formValues,shouldDisplayAllAssociatedErrors,_options.shouldUseNativeValidation))[name],_updateIsValidating([name]),_updateIsFieldValueUpdated(fieldValue),isFieldValueUpdated&&(error?isValid=!1:(_proxyFormState.isValid||_proxySubscribeFormState.isValid)&&(isValid=await executeBuiltInValidation({fields:_fields,onlyCheckValid:!0,name:name,eventType:event.type})));isFieldValueUpdated&&(field._f.deps&&(!Array.isArray(field._f.deps)||field._f.deps.length>0)&&trigger(field._f.deps),shouldRenderByError(name,isValid,error,fieldState))}},_focusInput=(ref,key)=>{if(get(_formState.errors,key)&&ref.focus)return ref.focus(),1},trigger=async(name,options={})=>{let isValid,validationResult;const fieldNames=convertToArrayPayload(name);if(_options.resolver){const errors=await(async names=>{const{errors:errors}=await _runSchema(names);if(_updateIsValidating(names),names)for(const name of names){const error=get(errors,name);error?set(_formState.errors,name,error):unset(_formState.errors,name)}else _formState.errors=errors;return errors})(isUndefined(name)?name:fieldNames);isValid=isEmptyObject(errors),validationResult=name?!fieldNames.some(name2=>get(errors,name2)):isValid}else name?(validationResult=(await Promise.all(fieldNames.map(async fieldName=>{const field=get(_fields,fieldName);return await executeBuiltInValidation({fields:field&&field._f?{[fieldName]:field}:field,eventType:EVENTS_TRIGGER})}))).every(Boolean),(validationResult||_formState.isValid)&&_setValid()):validationResult=isValid=await executeBuiltInValidation({fields:_fields,name:name,eventType:EVENTS_TRIGGER});return _subjects.state.next({...!isString(name)||(_proxyFormState.isValid||_proxySubscribeFormState.isValid)&&isValid!==_formState.isValid?{}:{name:name},..._options.resolver||!name?{isValid:isValid}:{},errors:_formState.errors}),options.shouldFocus&&!validationResult&&iterateFieldsByAction(_fields,_focusInput,name?fieldNames:_names.mount),validationResult},getValues=(fieldNames,config)=>{let values={..._state.mount?_formValues:_defaultValues};return config&&(values=extractFormValues(config.dirtyFields?_formState.dirtyFields:_formState.touchedFields,values)),isUndefined(fieldNames)?values:isString(fieldNames)?get(values,fieldNames):fieldNames.map(name=>get(values,name))},getFieldState=(name,formState)=>({invalid:!!get((formState||_formState).errors,name),isDirty:!!get((formState||_formState).dirtyFields,name),error:get((formState||_formState).errors,name),isValidating:!!get(_formState.validatingFields,name),isTouched:!!get((formState||_formState).touchedFields,name)}),clearErrors=name=>{const names=name?convertToArrayPayload(name):void 0;null==names||names.forEach(inputName=>unset(_formState.errors,inputName)),names?names.forEach(inputName=>{_subjects.state.next({name:inputName,errors:_formState.errors})}):_subjects.state.next({errors:{}})},setError=(name,error,options)=>{const ref=(get(_fields,name,{_f:{}})._f||{}).ref,currentError=get(_formState.errors,name)||{},{ref:currentRef,message:message,type:type,...restOfErrorTree}=currentError;set(_formState.errors,name,{...restOfErrorTree,...error,ref:ref}),_subjects.state.next({name:name,errors:_formState.errors,isValid:!1}),options&&options.shouldFocus&&ref&&ref.focus&&ref.focus()},_subscribe=props2=>_subjects.state.subscribe({next:formState=>{if(name=props2.name,signalName=formState.name,exact=props2.exact,(!name||!signalName||name===signalName||convertToArrayPayload(name).some(currentName=>currentName&&(exact?currentName===signalName:currentName.startsWith(signalName)||signalName.startsWith(currentName))))&&((formStateData,_proxyFormState,updateFormState,isRoot)=>{updateFormState(formStateData);const{name:name,...formState}=formStateData;return isEmptyObject(formState)||Object.keys(formState).length>=Object.keys(_proxyFormState).length||Object.keys(formState).find(key=>_proxyFormState[key]===(!isRoot||VALIDATION_MODE_all))})(formState,props2.formState||_proxyFormState,_setFormState,props2.reRenderRoot)){const snapshot={..._formValues};props2.callback({values:snapshot,..._formState,...formState,defaultValues:_defaultValues})}var name,signalName,exact}}).unsubscribe,unregister=(name,options={})=>{for(const fieldName of name?convertToArrayPayload(name):_names.mount)_names.mount.delete(fieldName),_names.array.delete(fieldName),options.keepValue||(unset(_fields,fieldName),unset(_formValues,fieldName)),!options.keepError&&unset(_formState.errors,fieldName),!options.keepDirty&&unset(_formState.dirtyFields,fieldName),!options.keepTouched&&unset(_formState.touchedFields,fieldName),!options.keepIsValidating&&unset(_formState.validatingFields,fieldName),!_options.shouldUnregister&&!options.keepDefaultValue&&unset(_defaultValues,fieldName);_subjects.state.next({values:cloneObject(_formValues)}),_subjects.state.next({..._formState,...options.keepDirty?{isDirty:_getDirty()}:{}}),!options.keepIsValid&&_setValid()},_setDisabledField=({disabled:disabled,name:name})=>{if(isBoolean(disabled)&&_state.mount||disabled||_names.disabled.has(name)){const disabledStateChanged=_names.disabled.has(name)!==!!disabled;disabled?_names.disabled.add(name):_names.disabled.delete(name),disabledStateChanged&&_state.mount&&!_state.action&&_setValid()}},register=(name,options={})=>{let field=get(_fields,name);const disabledIsDefined=isBoolean(options.disabled)||isBoolean(_options.disabled),shouldRevalidateRemount=!_names.registerName.has(name)&&field&&field._f&&!field._f.mount;return set(_fields,name,{...field||{},_f:{...field&&field._f?field._f:{ref:{name:name}},name:name,mount:!0,...options}}),_names.mount.add(name),field&&!shouldRevalidateRemount?_setDisabledField({disabled:isBoolean(options.disabled)?options.disabled:_options.disabled,name:name}):updateValidAndValue(name,!0,options.value),{...disabledIsDefined?{disabled:options.disabled||_options.disabled}:{},..._options.progressive?{required:!!options.required,min:getRuleValue(options.min),max:getRuleValue(options.max),minLength:getRuleValue(options.minLength),maxLength:getRuleValue(options.maxLength),pattern:getRuleValue(options.pattern)}:{},name:name,onChange:onChange,onBlur:onChange,ref:ref=>{if(ref){_names.registerName.add(name),register(name,options),_names.registerName.delete(name),field=get(_fields,name);const fieldRef=isUndefined(ref.value)&&ref.querySelectorAll&&ref.querySelectorAll("input,select,textarea")[0]||ref,radioOrCheckbox=(ref=>isRadioInput(ref)||isCheckBoxInput(ref))(fieldRef),refs=field._f.refs||[];if(radioOrCheckbox?refs.find(option=>option===fieldRef):fieldRef===field._f.ref)return;set(_fields,name,{_f:{...field._f,...radioOrCheckbox?{refs:[...refs.filter(live),fieldRef,...Array.isArray(get(_defaultValues,name))?[{}]:[]],ref:{type:fieldRef.type,name:name}}:{ref:fieldRef}}}),updateValidAndValue(name,!1,void 0,fieldRef)}else field=get(_fields,name,{}),field._f&&(field._f.mount=!1),(_options.shouldUnregister||options.shouldUnregister)&&(!isNameInFieldArray(_names.array,name)||!_state.action)&&_names.unMount.add(name)}}},_focusError=()=>_options.shouldFocusError&&iterateFieldsByAction(_fields,_focusInput,_names.mount),handleSubmit=(onValid,onInvalid)=>async e2=>{let onValidError;e2&&(e2.preventDefault&&e2.preventDefault(),e2.persist&&e2.persist());let fieldValues=cloneObject(_formValues);if(_subjects.state.next({isSubmitting:!0}),_options.resolver){const{errors:errors,values:values}=await _runSchema();_updateIsValidating(),_formState.errors=errors,fieldValues=cloneObject(values)}else await executeBuiltInValidation({fields:_fields,eventType:EVENTS_SUBMIT});if(_names.disabled.size)for(const name of _names.disabled)unset(fieldValues,name);if(unset(_formState.errors,"root"),isEmptyObject(_formState.errors)){_subjects.state.next({errors:{}});try{await onValid(fieldValues,e2)}catch(error){onValidError=error}}else onInvalid&&await onInvalid({..._formState.errors},e2),_focusError(),setTimeout(_focusError);if(_subjects.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:isEmptyObject(_formState.errors)&&!onValidError,submitCount:_formState.submitCount+1,errors:_formState.errors}),onValidError)throw onValidError},_reset=(formValues,keepStateOptions={})=>{const updatedValues=formValues?cloneObject(formValues):_defaultValues,cloneUpdatedValues=cloneObject(updatedValues),isEmptyResetValues=isEmptyObject(formValues),values=isEmptyResetValues?_defaultValues:cloneUpdatedValues;if(keepStateOptions.keepDefaultValues||(_defaultValues=updatedValues),!keepStateOptions.keepValues){if(keepStateOptions.keepDirtyValues){const fieldsToCheck=new Set([..._names.mount,...Object.keys(getDirtyFields(_defaultValues,_formValues))]);for(const fieldName of Array.from(fieldsToCheck)){const isDirty=get(_formState.dirtyFields,fieldName),existingValue=get(_formValues,fieldName),newValue=get(values,fieldName);isDirty&&!isUndefined(existingValue)?set(values,fieldName,existingValue):isDirty||isUndefined(newValue)||setValue(fieldName,newValue)}}else{if(isWeb&&isUndefined(formValues))for(const name of _names.mount){const field=get(_fields,name);if(field&&field._f){const fieldReference=Array.isArray(field._f.refs)?field._f.refs[0]:field._f.ref;if(isHTMLElement(fieldReference)){const form=fieldReference.closest("form");if(form){form.reset();break}}}}if(keepStateOptions.keepFieldsRef)for(const fieldName of _names.mount)setValue(fieldName,get(values,fieldName));else _fields={}}_formValues=_options.shouldUnregister?keepStateOptions.keepDefaultValues?cloneObject(_defaultValues):{}:cloneObject(values),_subjects.array.next({values:{...values}}),_subjects.state.next({values:{...values}})}_names={mount:keepStateOptions.keepDirtyValues?_names.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},_state.mount=!_proxyFormState.isValid||!!keepStateOptions.keepIsValid||!!keepStateOptions.keepDirtyValues||!_options.shouldUnregister&&!isEmptyObject(values),_state.watch=!!_options.shouldUnregister,_state.keepIsValid=!!keepStateOptions.keepIsValid,_state.action=!1,keepStateOptions.keepErrors||(_formState.errors={}),_subjects.state.next({submitCount:keepStateOptions.keepSubmitCount?_formState.submitCount:0,isDirty:!isEmptyResetValues&&(keepStateOptions.keepDirty?_formState.isDirty:!(!keepStateOptions.keepDefaultValues||deepEqual(formValues,_defaultValues))),isSubmitted:!!keepStateOptions.keepIsSubmitted&&_formState.isSubmitted,dirtyFields:isEmptyResetValues?{}:keepStateOptions.keepDirtyValues?keepStateOptions.keepDefaultValues&&_formValues?getDirtyFields(_defaultValues,_formValues):_formState.dirtyFields:keepStateOptions.keepDefaultValues&&formValues?getDirtyFields(_defaultValues,formValues):keepStateOptions.keepDirty?_formState.dirtyFields:{},touchedFields:keepStateOptions.keepTouched?_formState.touchedFields:{},errors:keepStateOptions.keepErrors?_formState.errors:{},isSubmitSuccessful:!!keepStateOptions.keepIsSubmitSuccessful&&_formState.isSubmitSuccessful,isSubmitting:!1,defaultValues:_defaultValues})},reset=(formValues,keepStateOptions)=>_reset(isFunction(formValues)?formValues(_formValues):formValues,{..._options.resetOptions,...keepStateOptions}),_setFormState=updatedFormState=>{_formState={..._formState,...updatedFormState}},methods={control:{register:register,unregister:unregister,getFieldState:getFieldState,handleSubmit:handleSubmit,setError:setError,_subscribe:_subscribe,_runSchema:_runSchema,_updateIsValidating:_updateIsValidating,_focusError:_focusError,_getWatch:_getWatch,_getDirty:_getDirty,_setValid:_setValid,_setFieldArray:(name,values=[],method,args,shouldSetValues=!0,shouldUpdateFieldsAndState=!0)=>{if(args&&method&&!_options.disabled){if(_state.action=!0,shouldUpdateFieldsAndState&&Array.isArray(get(_fields,name))){const fieldValues=method(get(_fields,name),args.argA,args.argB);shouldSetValues&&set(_fields,name,fieldValues)}if(shouldUpdateFieldsAndState&&Array.isArray(get(_formState.errors,name))){const errors=method(get(_formState.errors,name),args.argA,args.argB);shouldSetValues&&set(_formState.errors,name,errors),((ref,name)=>{!compact(get(ref,name)).length&&unset(ref,name)})(_formState.errors,name)}if((_proxyFormState.touchedFields||_proxySubscribeFormState.touchedFields)&&shouldUpdateFieldsAndState&&Array.isArray(get(_formState.touchedFields,name))){const touchedFields=method(get(_formState.touchedFields,name),args.argA,args.argB);shouldSetValues&&set(_formState.touchedFields,name,touchedFields)}(_proxyFormState.dirtyFields||_proxySubscribeFormState.dirtyFields)&&_updateDirtyFields(name),_subjects.state.next({name:name,isDirty:_getDirty(name,values),dirtyFields:_formState.dirtyFields,errors:_formState.errors,isValid:_formState.isValid})}else set(_formValues,name,values)},_setDisabledField:_setDisabledField,_setErrors:errors=>{_formState.errors=errors,_subjects.state.next({errors:_formState.errors,isValid:!1})},_getFieldArray:name=>compact(get(_state.mount?_formValues:_defaultValues,name,_options.shouldUnregister?get(_defaultValues,name,[]):[])),_reset:_reset,_resetDefaultValues:()=>isFunction(_options.defaultValues)&&_options.defaultValues().then(values=>{reset(values,_options.resetOptions),_subjects.state.next({isLoading:!1})}),_removeUnmounted:()=>{for(const name of _names.unMount){const field=get(_fields,name);field&&(field._f.refs?field._f.refs.every(ref=>!live(ref)):!live(field._f.ref))&&unregister(name)}_names.unMount=new Set},_disableForm:disabled=>{isBoolean(disabled)&&(_subjects.state.next({disabled:disabled}),iterateFieldsByAction(_fields,(ref,name)=>{const currentField=get(_fields,name);currentField&&(ref.disabled=currentField._f.disabled||disabled,Array.isArray(currentField._f.refs)&¤tField._f.refs.forEach(inputRef=>{inputRef.disabled=currentField._f.disabled||disabled}))},0,!1))},_subjects:_subjects,_proxyFormState:_proxyFormState,get _fields(){return _fields},get _formValues(){return _formValues},get _state(){return _state},set _state(value){_state=value},get _defaultValues(){return _defaultValues},get _names(){return _names},set _names(value){_names=value},get _formState(){return _formState},get _options(){return _options},set _options(value){_options={..._options,...value}}},subscribe:props2=>(_state.mount=!0,_proxySubscribeFormState={..._proxySubscribeFormState,...props2.formState},_subscribe({...props2,formState:{...defaultProxyFormState,...props2.formState}})),trigger:trigger,register:register,handleSubmit:handleSubmit,watch:(name,defaultValue)=>isFunction(name)?_subjects.state.subscribe({next:payload=>"values"in payload&&name(payload.values||_getWatch(void 0,defaultValue),payload)}):_getWatch(name,defaultValue,!0),setValue:setValue,getValues:getValues,reset:reset,resetField:(name,options={})=>{get(_fields,name)&&(isUndefined(options.defaultValue)?setValue(name,cloneObject(get(_defaultValues,name))):(setValue(name,options.defaultValue),set(_defaultValues,name,cloneObject(options.defaultValue))),options.keepTouched||unset(_formState.touchedFields,name),options.keepDirty||(unset(_formState.dirtyFields,name),_formState.isDirty=options.defaultValue?_getDirty(name,cloneObject(get(_defaultValues,name))):_getDirty()),options.keepError||(unset(_formState.errors,name),_proxyFormState.isValid&&_setValid()),_subjects.state.next({..._formState}))},clearErrors:clearErrors,unregister:unregister,setError:setError,setFocus:(name,options={})=>{const field=get(_fields,name),fieldReference=field&&field._f;if(fieldReference){const fieldRef=fieldReference.refs?fieldReference.refs[0]:fieldReference.ref;fieldRef.focus&&setTimeout(()=>{fieldRef.focus(),options.shouldSelect&&isFunction(fieldRef.select)&&fieldRef.select()})}},getFieldState:getFieldState};return{...methods,formControl:methods}}function useForm(props={}){const _formControl=React__default.useRef(void 0),_values=React__default.useRef(void 0),[formState,updateFormState]=React__default.useState({isDirty:!1,isValidating:!1,isLoading:isFunction(props.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:props.errors||{},disabled:props.disabled||!1,isReady:!1,defaultValues:isFunction(props.defaultValues)?void 0:props.defaultValues});if(!_formControl.current)if(props.formControl)_formControl.current={...props.formControl,formState:formState},props.defaultValues&&!isFunction(props.defaultValues)&&props.formControl.reset(props.defaultValues,props.resetOptions);else{const{formControl:formControl,...rest}=createFormControl(props);_formControl.current={...rest,formState:formState}}const control=_formControl.current.control;return control._options=props,useIsomorphicLayoutEffect$1(()=>{const sub=control._subscribe({formState:control._proxyFormState,callback:()=>updateFormState({...control._formState}),reRenderRoot:!0});return updateFormState(data=>({...data,isReady:!0})),control._formState.isReady=!0,sub},[control]),React__default.useEffect(()=>control._disableForm(props.disabled),[control,props.disabled]),React__default.useEffect(()=>{props.mode&&(control._options.mode=props.mode),props.reValidateMode&&(control._options.reValidateMode=props.reValidateMode)},[control,props.mode,props.reValidateMode]),React__default.useEffect(()=>{props.errors&&(control._setErrors(props.errors),control._focusError())},[control,props.errors]),React__default.useEffect(()=>{props.shouldUnregister&&control._subjects.state.next({values:control._getWatch()})},[control,props.shouldUnregister]),React__default.useEffect(()=>{if(control._proxyFormState.isDirty){const isDirty=control._getDirty();isDirty!==formState.isDirty&&control._subjects.state.next({isDirty:isDirty})}},[control,formState.isDirty]),React__default.useEffect(()=>{var _a;props.values&&!deepEqual(props.values,_values.current)?(control._reset(props.values,{keepFieldsRef:!0,...control._options.resetOptions}),(null===(_a=control._options.resetOptions)||void 0===_a?void 0:_a.keepIsValid)||control._setValid(),_values.current=props.values,updateFormState(state=>({...state}))):control._resetDefaultValues()},[control,props.values]),React__default.useEffect(()=>{control._state.mount||(control._setValid(),control._state.mount=!0),control._state.watch&&(control._state.watch=!1,control._subjects.state.next({...control._formState})),control._removeUnmounted()}),_formControl.current.formState=React__default.useMemo(()=>getProxyFormState(formState,control),[control,formState]),_formControl.current}var ReactPropTypesSecret_1,hasRequiredReactPropTypesSecret,factoryWithThrowingShims,hasRequiredFactoryWithThrowingShims,hasRequiredPropTypes,propTypes={exports:{}};function requireReactPropTypesSecret(){if(hasRequiredReactPropTypesSecret)return ReactPropTypesSecret_1;hasRequiredReactPropTypesSecret=1;return ReactPropTypesSecret_1="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function requireFactoryWithThrowingShims(){if(hasRequiredFactoryWithThrowingShims)return factoryWithThrowingShims;hasRequiredFactoryWithThrowingShims=1;var ReactPropTypesSecret=requireReactPropTypesSecret();function emptyFunction(){}function emptyFunctionWithReset(){}return emptyFunctionWithReset.resetWarningCache=emptyFunction,factoryWithThrowingShims=function(){function shim(props,propName,componentName,location,propFullName,secret){if(secret!==ReactPropTypesSecret){var err=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw err.name="Invariant Violation",err}}function getShim(){return shim}shim.isRequired=shim;var ReactPropTypes={array:shim,bigint:shim,bool:shim,func:shim,number:shim,object:shim,string:shim,symbol:shim,any:shim,arrayOf:getShim,element:shim,elementType:shim,instanceOf:getShim,node:shim,objectOf:getShim,oneOf:getShim,oneOfType:getShim,shape:getShim,exact:getShim,checkPropTypes:emptyFunctionWithReset,resetWarningCache:emptyFunction};return ReactPropTypes.PropTypes=ReactPropTypes,ReactPropTypes}}function requirePropTypes(){return hasRequiredPropTypes||(hasRequiredPropTypes=1,propTypes.exports=requireFactoryWithThrowingShims()()),propTypes.exports}const PropTypes=getDefaultExportFromCjs(requirePropTypes());var hasRequiredReactIs_production_min,hasRequiredReactIs,reactIs={exports:{}},reactIs_production_min={};hasRequiredReactIs||(hasRequiredReactIs=1,reactIs.exports=function(){if(hasRequiredReactIs_production_min)return reactIs_production_min;hasRequiredReactIs_production_min=1;var b2=60103,c2=60106,d2=60107,e2=60108,f3=60114,g2=60109,h2=60110,k3=60112,l2=60113,m3=60120,n2=60115,p2=60116,q2=60121,r2=60122,u2=60117,v2=60129,w2=60131;if("function"==typeof Symbol&&Symbol.for){var x2=Symbol.for;b2=x2("react.element"),c2=x2("react.portal"),d2=x2("react.fragment"),e2=x2("react.strict_mode"),f3=x2("react.profiler"),g2=x2("react.provider"),h2=x2("react.context"),k3=x2("react.forward_ref"),l2=x2("react.suspense"),m3=x2("react.suspense_list"),n2=x2("react.memo"),p2=x2("react.lazy"),q2=x2("react.block"),r2=x2("react.server.block"),u2=x2("react.fundamental"),v2=x2("react.debug_trace_mode"),w2=x2("react.legacy_hidden")}function y2(a2){if("object"==typeof a2&&null!==a2){var t2=a2.$$typeof;switch(t2){case b2:switch(a2=a2.type){case d2:case f3:case e2:case l2:case m3:return a2;default:switch(a2=a2&&a2.$$typeof){case h2:case k3:case p2:case n2:case g2:return a2;default:return t2}}case c2:return t2}}}var z2=g2,A2=b2,B2=k3,C2=d2,D2=p2,E2=n2,F2=c2,G2=f3,H2=e2,I2=l2;return reactIs_production_min.ContextConsumer=h2,reactIs_production_min.ContextProvider=z2,reactIs_production_min.Element=A2,reactIs_production_min.ForwardRef=B2,reactIs_production_min.Fragment=C2,reactIs_production_min.Lazy=D2,reactIs_production_min.Memo=E2,reactIs_production_min.Portal=F2,reactIs_production_min.Profiler=G2,reactIs_production_min.StrictMode=H2,reactIs_production_min.Suspense=I2,reactIs_production_min.isAsyncMode=function(){return!1},reactIs_production_min.isConcurrentMode=function(){return!1},reactIs_production_min.isContextConsumer=function(a2){return y2(a2)===h2},reactIs_production_min.isContextProvider=function(a2){return y2(a2)===g2},reactIs_production_min.isElement=function(a2){return"object"==typeof a2&&null!==a2&&a2.$$typeof===b2},reactIs_production_min.isForwardRef=function(a2){return y2(a2)===k3},reactIs_production_min.isFragment=function(a2){return y2(a2)===d2},reactIs_production_min.isLazy=function(a2){return y2(a2)===p2},reactIs_production_min.isMemo=function(a2){return y2(a2)===n2},reactIs_production_min.isPortal=function(a2){return y2(a2)===c2},reactIs_production_min.isProfiler=function(a2){return y2(a2)===f3},reactIs_production_min.isStrictMode=function(a2){return y2(a2)===e2},reactIs_production_min.isSuspense=function(a2){return y2(a2)===l2},reactIs_production_min.isValidElementType=function(a2){return"string"==typeof a2||"function"==typeof a2||a2===d2||a2===f3||a2===v2||a2===e2||a2===l2||a2===m3||a2===w2||"object"==typeof a2&&null!==a2&&(a2.$$typeof===p2||a2.$$typeof===n2||a2.$$typeof===g2||a2.$$typeof===h2||a2.$$typeof===k3||a2.$$typeof===u2||a2.$$typeof===q2||a2[0]===r2)},reactIs_production_min.typeOf=y2,reactIs_production_min}()),reactIs.exports;let e=e2=>"object"==typeof e2&&null!=e2&&1===e2.nodeType,t=(e2,t2)=>(!t2||"hidden"!==e2)&&"visible"!==e2&&"clip"!==e2,n=(e2,n2)=>{if(e2.clientHeight<e2.scrollHeight||e2.clientWidth<e2.scrollWidth){let l2=getComputedStyle(e2,null);return t(l2.overflowY,n2)||t(l2.overflowX,n2)||(e3=>{let t2=(e4=>{if(!e4.ownerDocument||!e4.ownerDocument.defaultView)return null;try{return e4.ownerDocument.defaultView.frameElement}catch(e5){return null}})(e3);return!!t2&&(t2.clientHeight<e3.scrollHeight||t2.clientWidth<e3.scrollWidth)})(e2)}return!1},l=(e2,t2,n2,l2,i2,o2,r2,d2)=>o2<e2&&r2>t2||o2>e2&&r2<t2?0:o2<=e2&&d2<=n2||r2>=t2&&d2>=n2?o2-e2-l2:r2>t2&&d2<n2||o2<e2&&d2>n2?r2-t2+i2:0,i$1=e2=>{let t2=e2.parentElement;return null==t2?e2.getRootNode().host||null:t2};var idCounter=0;function noop2(){}function isOrContainsNode(parent,child,environment){return parent===child||child instanceof environment.Node&&parent.contains&&parent.contains(child)}function debounce(fn2,time){var timeoutId;function cancel(){timeoutId&&clearTimeout(timeoutId)}function wrapper(){for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];cancel(),timeoutId=setTimeout(function(){timeoutId=null,fn2.apply(void 0,args)},time)}return wrapper.cancel=cancel,wrapper}function callAllEventHandlers(){for(var _len2=arguments.length,fns=new Array(_len2),_key2=0;_key2<_len2;_key2++)fns[_key2]=arguments[_key2];return function(event){for(var _len3=arguments.length,args=new Array(_len3>1?_len3-1:0),_key3=1;_key3<_len3;_key3++)args[_key3-1]=arguments[_key3];return fns.some(function(fn2){return fn2&&fn2.apply(void 0,[event].concat(args)),event.preventDownshiftDefault||event.hasOwnProperty("nativeEvent")&&event.nativeEvent.preventDownshiftDefault})}}function handleRefs(){for(var _len4=arguments.length,refs=new Array(_len4),_key4=0;_key4<_len4;_key4++)refs[_key4]=arguments[_key4];return function(node2){refs.forEach(function(ref){"function"==typeof ref?ref(node2):ref&&(ref.current=node2)})}}function getState(state,props){return Object.keys(state).reduce(function(prevState,key){return prevState[key]=isControlledProp(props,key)?props[key]:state[key],prevState},{})}function isControlledProp(props,key){return void 0!==props[key]}function getNextWrappingIndex(moveAmount,baseIndex,itemCount,getItemNodeFromIndex,circular){if(void 0===circular&&(circular=!0),0===itemCount)return-1;var itemsLastIndex=itemCount-1;("number"!=typeof baseIndex||baseIndex<0||baseIndex>=itemCount)&&(baseIndex=moveAmount>0?-1:itemsLastIndex+1);var newIndex=baseIndex+moveAmount;newIndex<0?newIndex=circular?itemsLastIndex:0:newIndex>itemsLastIndex&&(newIndex=circular?0:itemsLastIndex);var nonDisabledNewIndex=getNextNonDisabledIndex(moveAmount,newIndex,itemCount,getItemNodeFromIndex,circular);return-1===nonDisabledNewIndex?baseIndex>=itemCount?-1:baseIndex:nonDisabledNewIndex}function getNextNonDisabledIndex(moveAmount,baseIndex,itemCount,getItemNodeFromIndex,circular){var currentElementNode=getItemNodeFromIndex(baseIndex);if(!currentElementNode||!currentElementNode.hasAttribute("disabled"))return baseIndex;if(moveAmount>0){for(var index2=baseIndex+1;index2<itemCount;index2++)if(!getItemNodeFromIndex(index2).hasAttribute("disabled"))return index2}else for(var _index=baseIndex-1;_index>=0;_index--)if(!getItemNodeFromIndex(_index).hasAttribute("disabled"))return _index;return circular?moveAmount>0?getNextNonDisabledIndex(1,0,itemCount,getItemNodeFromIndex,!1):getNextNonDisabledIndex(-1,itemCount-1,itemCount,getItemNodeFromIndex,!1):-1}function targetWithinDownshift(target,downshiftElements,environment,checkActiveElement){return void 0===checkActiveElement&&(checkActiveElement=!0),downshiftElements.some(function(contextNode){return contextNode&&(isOrContainsNode(contextNode,target,environment)||checkActiveElement&&isOrContainsNode(contextNode,environment.document.activeElement,environment))})}var cleanupStatus=debounce(function(documentProp){getStatusDiv(documentProp).textContent=""},500);function getStatusDiv(documentProp){void 0===documentProp&&(documentProp=document);var statusDiv=documentProp.getElementById("a11y-status-message");return statusDiv||((statusDiv=documentProp.createElement("div")).setAttribute("id","a11y-status-message"),statusDiv.setAttribute("role","status"),statusDiv.setAttribute("aria-live","polite"),statusDiv.setAttribute("aria-relevant","additions text"),Object.assign(statusDiv.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),documentProp.body.appendChild(statusDiv),statusDiv)}var _excluded$3=["isInitialMount","highlightedIndex","items","environment"],dropdownDefaultStateValues={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""};function callOnChangeProps(action,state,newState){var props=action.props,type=action.type,changes={};Object.keys(state).forEach(function(key){!function(key,action,state,newState){var props=action.props,type=action.type,handler="on"+capitalizeString(key)+"Change";props[handler]&&void 0!==newState[key]&&newState[key]!==state[key]&&props[handler](_extends({type:type},newState))}(key,action,state,newState),newState[key]!==state[key]&&(changes[key]=newState[key])}),props.onStateChange&&Object.keys(changes).length&&props.onStateChange(_extends({type:type},changes))}var updateA11yStatus=debounce(function(getA11yMessage,document2){var status,documentProp,div;status=getA11yMessage(),div=getStatusDiv(documentProp=document2),status&&(div.textContent=status,cleanupStatus(documentProp))},200),useIsomorphicLayoutEffect="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?reactExports.useLayoutEffect:reactExports.useEffect;function useElementIds(_ref){var _ref$id=_ref.id,id=void 0===_ref$id?"downshift-"+String(idCounter++):_ref$id,labelId=_ref.labelId,menuId=_ref.menuId,getItemId=_ref.getItemId,toggleButtonId=_ref.toggleButtonId,inputId=_ref.inputId;return reactExports.useRef({labelId:labelId||id+"-label",menuId:menuId||id+"-menu",getItemId:getItemId||function(index2){return id+"-item-"+index2},toggleButtonId:toggleButtonId||id+"-toggle-button",inputId:inputId||id+"-input"}).current}function capitalizeString(string2){return""+string2.slice(0,1).toUpperCase()+string2.slice(1)}function useLatestRef(val){var ref=reactExports.useRef(val);return ref.current=val,ref}var defaultProps$3={itemToString:function(item){return item?String(item):""},stateReducer:function(s2,a2){return a2.changes},getA11ySelectionMessage:function(selectionParameters){var selectedItem=selectionParameters.selectedItem,itemToStringLocal=selectionParameters.itemToString;return selectedItem?itemToStringLocal(selectedItem)+" has been selected.":""},scrollIntoView:function(node2,menuNode){node2&&((t2,o2)=>{var r2,d2,h2,f3,u2,s2;if("undefined"==typeof document)return[];let{inline:g2,boundary:m3,skipOverflowHiddenElements:p2}=o2,w2="function"==typeof m3?m3:e2=>e2!==m3;if(!e(t2))throw new TypeError("Invalid target");let W2=document.scrollingElement||document.documentElement,H2=[],b2=t2;for(;e(b2)&&w2(b2);){if(b2=i$1(b2),b2===W2){H2.push(b2);break}null!=b2&&b2===document.body&&n(b2)&&!n(document.documentElement)||null!=b2&&n(b2,p2)&&H2.push(b2)}let v2=null!=(d2=null==(r2=window.visualViewport)?void 0:r2.width)?d2:innerWidth,y2=null!=(f3=null==(h2=window.visualViewport)?void 0:h2.height)?f3:innerHeight,E2=null!=(u2=window.scrollX)?u2:pageXOffset,M2=null!=(s2=window.scrollY)?s2:pageYOffset,{height:x2,width:I2,top:C2,right:R2,bottom:T3,left:V2}=t2.getBoundingClientRect(),k3=C2,B2="center"===g2?V2+I2/2:"end"===g2?R2:V2,D2=[];for(let e2=0;e2<H2.length;e2++){let t3=H2[e2],{height:n2,width:i2,top:o3,right:r3,bottom:d3,left:h3}=t3.getBoundingClientRect();if(C2>=0&&V2>=0&&T3<=y2&&R2<=v2&&C2>=o3&&T3<=d3&&V2>=h3&&R2<=r3)return D2;let f4=getComputedStyle(t3),u3=parseInt(f4.borderLeftWidth,10),s3=parseInt(f4.borderTopWidth,10),m4=parseInt(f4.borderRightWidth,10),p3=parseInt(f4.borderBottomWidth,10),w3=0,b3=0,O2="offsetWidth"in t3?t3.offsetWidth-t3.clientWidth-u3-m4:0,X2="offsetHeight"in t3?t3.offsetHeight-t3.clientHeight-s3-p3:0,Y4="offsetWidth"in t3?0===t3.offsetWidth?0:i2/t3.offsetWidth:0,L2="offsetHeight"in t3?0===t3.offsetHeight?0:n2/t3.offsetHeight:0;if(W2===t3)w3=l(M2,M2+y2,y2,s3,p3,M2+k3,M2+k3+x2,x2),b3="start"===g2?B2:"center"===g2?B2-v2/2:"end"===g2?B2-v2:l(E2,E2+v2,v2,u3,m4,E2+B2,E2+B2+I2,I2),w3=Math.max(0,w3+M2),b3=Math.max(0,b3+E2);else{w3=l(o3,d3,n2,s3,p3+X2,k3,k3+x2,x2),b3="start"===g2?B2-h3-u3:"center"===g2?B2-(h3+i2/2)+O2/2:"end"===g2?B2-r3+m4+O2:l(h3,r3,i2,u3,m4+O2,B2,B2+I2,I2);let{scrollLeft:e3,scrollTop:f5}=t3;w3=Math.max(0,Math.min(f5+w3/L2,t3.scrollHeight-n2/L2+X2)),b3=Math.max(0,Math.min(e3+b3/Y4,t3.scrollWidth-i2/Y4+O2)),k3+=f5-w3,B2+=e3-b3}D2.push({el:t3,top:w3,left:b3})}return D2})(node2,{boundary:menuNode}).forEach(function(_ref){var el2=_ref.el,top=_ref.top,left=_ref.left;el2.scrollTop=top,el2.scrollLeft=left})},environment:"undefined"==typeof window?{}:window};function getDefaultValue$1(props,propKey,defaultStateValues2){void 0===defaultStateValues2&&(defaultStateValues2=dropdownDefaultStateValues);var defaultValue=props["default"+capitalizeString(propKey)];return void 0!==defaultValue?defaultValue:defaultStateValues2[propKey]}function getInitialValue$1(props,propKey,defaultStateValues2){void 0===defaultStateValues2&&(defaultStateValues2=dropdownDefaultStateValues);var value=props[propKey];if(void 0!==value)return value;var initialValue=props["initial"+capitalizeString(propKey)];return void 0!==initialValue?initialValue:getDefaultValue$1(props,propKey,defaultStateValues2)}function getHighlightedIndexOnOpen(props,state,offset2){var items=props.items,initialHighlightedIndex=props.initialHighlightedIndex,defaultHighlightedIndex=props.defaultHighlightedIndex,selectedItem=state.selectedItem,highlightedIndex=state.highlightedIndex;return 0===items.length?-1:void 0!==initialHighlightedIndex&&highlightedIndex===initialHighlightedIndex?initialHighlightedIndex:void 0!==defaultHighlightedIndex?defaultHighlightedIndex:selectedItem?items.indexOf(selectedItem):0===offset2?-1:offset2<0?items.length-1:0}function useA11yMessageSetter(getA11yMessage,dependencyArray,_ref2){var isInitialMount=_ref2.isInitialMount,highlightedIndex=_ref2.highlightedIndex,items=_ref2.items,environment=_ref2.environment,rest=_objectWithoutPropertiesLoose$1(_ref2,_excluded$3);reactExports.useEffect(function(){isInitialMount||updateA11yStatus(function(){return getA11yMessage(_extends({highlightedIndex:highlightedIndex,highlightedItem:items[highlightedIndex],resultCount:items.length},rest))},environment.document)},dependencyArray)}var useControlPropsValidator=noop2;function getChangesOnSelection(props,highlightedIndex,inputValue){var _props$items;void 0===inputValue&&(inputValue=!0);var shouldSelect=(null==(_props$items=props.items)?void 0:_props$items.length)&&highlightedIndex>=0;return _extends({isOpen:!1,highlightedIndex:-1},shouldSelect&&_extends({selectedItem:props.items[highlightedIndex],isOpen:getDefaultValue$1(props,"isOpen"),highlightedIndex:getDefaultValue$1(props,"highlightedIndex")},inputValue&&{inputValue:props.itemToString(props.items[highlightedIndex])}))}PropTypes.array.isRequired,PropTypes.func,PropTypes.func,PropTypes.func,PropTypes.number,PropTypes.number,PropTypes.number,PropTypes.bool,PropTypes.bool,PropTypes.bool,PropTypes.any,PropTypes.any,PropTypes.any,PropTypes.string,PropTypes.string,PropTypes.string,PropTypes.func,PropTypes.string,PropTypes.func,PropTypes.func,PropTypes.func,PropTypes.func,PropTypes.func,PropTypes.shape({addEventListener:PropTypes.func,removeEventListener:PropTypes.func,document:PropTypes.shape({getElementById:PropTypes.func,activeElement:PropTypes.any,body:PropTypes.any})}),__assign(__assign({},defaultProps$3),{getA11yStatusMessage:function(_a){var isOpen=_a.isOpen,resultCount=_a.resultCount,previousResultCount=_a.previousResultCount;return isOpen?resultCount?resultCount!==previousResultCount?"".concat(resultCount," result").concat(1===resultCount?" is":"s are"," available, use up and down arrow keys to navigate. Press Enter or Space Bar keys to select."):"":"No results are available.":""}});var stateChangeTypes$1=Object.freeze({__proto__:null,InputKeyDownArrowDown:0,InputKeyDownArrowUp:1,InputKeyDownEscape:2,InputKeyDownHome:3,InputKeyDownEnd:4,InputKeyDownPageUp:5,InputKeyDownPageDown:6,InputKeyDownEnter:7,InputChange:8,InputBlur:9,InputFocus:10,MenuMouseLeave:11,ItemMouseMove:12,ItemClick:13,ToggleButtonClick:14,FunctionToggleMenu:15,FunctionOpenMenu:16,FunctionCloseMenu:17,FunctionSetHighlightedIndex:18,FunctionSelectItem:19,FunctionSetInputValue:20,FunctionReset:21,ControlledPropUpdatedSelectedItem:22});function getInitialState$1(props){var initialState=function(props){var selectedItem=getInitialValue$1(props,"selectedItem"),isOpen=getInitialValue$1(props,"isOpen"),highlightedIndex=getInitialValue$1(props,"highlightedIndex"),inputValue=getInitialValue$1(props,"inputValue");return{highlightedIndex:highlightedIndex<0&&selectedItem&&isOpen?props.items.indexOf(selectedItem):highlightedIndex,isOpen:isOpen,selectedItem:selectedItem,inputValue:inputValue}}(props),selectedItem=initialState.selectedItem,inputValue=initialState.inputValue;return""===inputValue&&selectedItem&&void 0===props.defaultInputValue&&void 0===props.initialInputValue&&void 0===props.inputValue&&(inputValue=props.itemToString(selectedItem)),_extends({},initialState,{inputValue:inputValue})}function useControlledReducer(reducer,initialState,props){var previousSelectedItemRef=reactExports.useRef(),_useEnhancedReducer=function(reducer,initialState,props){var prevStateRef=reactExports.useRef(),actionRef=reactExports.useRef(),enhancedReducer=reactExports.useCallback(function(state2,action2){actionRef.current=action2,state2=getState(state2,action2.props);var changes=reducer(state2,action2);return action2.props.stateReducer(state2,_extends({},action2,{changes:changes}))},[reducer]),_useReducer=reactExports.useReducer(enhancedReducer,initialState),state=_useReducer[0],dispatch=_useReducer[1],propsRef=useLatestRef(props),dispatchWithProps=reactExports.useCallback(function(action2){return dispatch(_extends({props:propsRef.current},action2))},[propsRef]),action=actionRef.current;return reactExports.useEffect(function(){action&&prevStateRef.current&&prevStateRef.current!==state&&callOnChangeProps(action,getState(prevStateRef.current,action.props),state),prevStateRef.current=state},[state,props,action]),[state,dispatchWithProps]}(reducer,initialState,props),state=_useEnhancedReducer[0],dispatch=_useEnhancedReducer[1];return reactExports.useEffect(function(){isControlledProp(props,"selectedItem")&&(props.selectedItemChanged(previousSelectedItemRef.current,props.selectedItem)&&dispatch({type:22,inputValue:props.itemToString(props.selectedItem)}),previousSelectedItemRef.current=state.selectedItem===previousSelectedItemRef.current?props.selectedItem:state.selectedItem)},[state.selectedItem,props.selectedItem]),[getState(state,props),dispatch]}PropTypes.array.isRequired,PropTypes.func,PropTypes.func,PropTypes.func,PropTypes.func,PropTypes.number,PropTypes.number,PropTypes.number,PropTypes.bool,PropTypes.bool,PropTypes.bool,PropTypes.any,PropTypes.any,PropTypes.any,PropTypes.string,PropTypes.string,PropTypes.string,PropTypes.string,PropTypes.string,PropTypes.string,PropTypes.func,PropTypes.string,PropTypes.string,PropTypes.func,PropTypes.func,PropTypes.func,PropTypes.func,PropTypes.func,PropTypes.func,PropTypes.shape({addEventListener:PropTypes.func,removeEventListener:PropTypes.func,document:PropTypes.shape({getElementById:PropTypes.func,activeElement:PropTypes.any,body:PropTypes.any})});var defaultProps$1=_extends({},defaultProps$3,{selectedItemChanged:function(prevItem,item){return prevItem!==item},getA11yStatusMessage:function(_ref2){var isOpen=_ref2.isOpen,resultCount=_ref2.resultCount,previousResultCount=_ref2.previousResultCount;return isOpen?resultCount?resultCount!==previousResultCount?resultCount+" result"+(1===resultCount?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":"":"No results are available.":""}});function downshiftUseComboboxReducer(state,action){var _props$items,changes,type=action.type,props=action.props,altKey=action.altKey;switch(type){case 13:changes={isOpen:getDefaultValue$1(props,"isOpen"),highlightedIndex:getDefaultValue$1(props,"highlightedIndex"),selectedItem:props.items[action.index],inputValue:props.itemToString(props.items[action.index])};break;case 0:changes=state.isOpen?{highlightedIndex:getNextWrappingIndex(1,state.highlightedIndex,props.items.length,action.getItemNodeFromIndex,!0)}:{highlightedIndex:altKey&&null==state.selectedItem?-1:getHighlightedIndexOnOpen(props,state,1,action.getItemNodeFromIndex),isOpen:props.items.length>=0};break;case 1:changes=state.isOpen?altKey?getChangesOnSelection(props,state.highlightedIndex):{highlightedIndex:getNextWrappingIndex(-1,state.highlightedIndex,props.items.length,action.getItemNodeFromIndex,!0)}:{highlightedIndex:getHighlightedIndexOnOpen(props,state,-1,action.getItemNodeFromIndex),isOpen:props.items.length>=0};break;case 7:changes=getChangesOnSelection(props,state.highlightedIndex);break;case 2:changes=_extends({isOpen:!1,highlightedIndex:-1},!state.isOpen&&{selectedItem:null,inputValue:""});break;case 5:changes={highlightedIndex:getNextWrappingIndex(-10,state.highlightedIndex,props.items.length,action.getItemNodeFromIndex,!1)};break;case 6:changes={highlightedIndex:getNextWrappingIndex(10,state.highlightedIndex,props.items.length,action.getItemNodeFromIndex,!1)};break;case 3:changes={highlightedIndex:getNextNonDisabledIndex(1,0,props.items.length,action.getItemNodeFromIndex,!1)};break;case 4:changes={highlightedIndex:getNextNonDisabledIndex(-1,props.items.length-1,props.items.length,action.getItemNodeFromIndex,!1)};break;case 9:changes=_extends({isOpen:!1,highlightedIndex:-1},state.highlightedIndex>=0&&(null==(_props$items=props.items)?void 0:_props$items.length)&&action.selectItem&&{selectedItem:props.items[state.highlightedIndex],inputValue:props.itemToString(props.items[state.highlightedIndex])});break;case 8:changes={isOpen:!0,highlightedIndex:getDefaultValue$1(props,"highlightedIndex"),inputValue:action.inputValue};break;case 10:changes={isOpen:!0,highlightedIndex:getHighlightedIndexOnOpen(props,state,0)};break;case 19:changes={selectedItem:action.selectedItem,inputValue:props.itemToString(action.selectedItem)};break;case 22:changes={inputValue:action.inputValue};break;default:return function(state,action,stateChangeTypes2){var changes,type=action.type,props=action.props;switch(type){case stateChangeTypes2.ItemMouseMove:changes={highlightedIndex:action.disabled?-1:action.index};break;case stateChangeTypes2.MenuMouseLeave:changes={highlightedIndex:-1};break;case stateChangeTypes2.ToggleButtonClick:case stateChangeTypes2.FunctionToggleMenu:changes={isOpen:!state.isOpen,highlightedIndex:state.isOpen?-1:getHighlightedIndexOnOpen(props,state,0)};break;case stateChangeTypes2.FunctionOpenMenu:changes={isOpen:!0,highlightedIndex:getHighlightedIndexOnOpen(props,state,0)};break;case stateChangeTypes2.FunctionCloseMenu:changes={isOpen:!1};break;case stateChangeTypes2.FunctionSetHighlightedIndex:changes={highlightedIndex:action.highlightedIndex};break;case stateChangeTypes2.FunctionSetInputValue:changes={inputValue:action.inputValue};break;case stateChangeTypes2.FunctionReset:changes={highlightedIndex:getDefaultValue$1(props,"highlightedIndex"),isOpen:getDefaultValue$1(props,"isOpen"),selectedItem:getDefaultValue$1(props,"selectedItem"),inputValue:getDefaultValue$1(props,"inputValue")};break;default:throw new Error("Reducer called without proper action type.")}return _extends({},state,changes)}(state,action,stateChangeTypes$1)}return _extends({},state,changes)}var _excluded$1=["onMouseLeave","refKey","ref"],_excluded2$1=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],_excluded3=["onClick","onPress","refKey","ref"],_excluded4=["onKeyDown","onChange","onInput","onFocus","onBlur","onChangeText","refKey","ref"];function useCombobox(userProps){void 0===userProps&&(userProps={});var props=_extends({},defaultProps$1,userProps),initialIsOpen=props.initialIsOpen,defaultIsOpen=props.defaultIsOpen,items=props.items,scrollIntoView2=props.scrollIntoView,environment=props.environment,getA11yStatusMessage2=props.getA11yStatusMessage,getA11ySelectionMessage2=props.getA11ySelectionMessage,itemToString2=props.itemToString,_useControlledReducer=useControlledReducer(downshiftUseComboboxReducer,getInitialState$1(props),props),state=_useControlledReducer[0],dispatch=_useControlledReducer[1],isOpen=state.isOpen,highlightedIndex=state.highlightedIndex,selectedItem=state.selectedItem,inputValue=state.inputValue,menuRef=reactExports.useRef(null),itemRefs=reactExports.useRef({}),inputRef=reactExports.useRef(null),toggleButtonRef=reactExports.useRef(null),isInitialMountRef=reactExports.useRef(!0),elementIds=useElementIds(props),previousResultCountRef=reactExports.useRef(),latest=useLatestRef({state:state,props:props}),getItemNodeFromIndex=reactExports.useCallback(function(index2){return itemRefs.current[elementIds.getItemId(index2)]},[elementIds]);useA11yMessageSetter(getA11yStatusMessage2,[isOpen,highlightedIndex,inputValue,items],_extends({isInitialMount:isInitialMountRef.current,previousResultCount:previousResultCountRef.current,items:items,environment:environment,itemToString:itemToString2},state)),useA11yMessageSetter(getA11ySelectionMessage2,[selectedItem],_extends({isInitialMount:isInitialMountRef.current,previousResultCount:previousResultCountRef.current,items:items,environment:environment,itemToString:itemToString2},state));var shouldScrollRef=function(_ref3){var highlightedIndex=_ref3.highlightedIndex,isOpen=_ref3.isOpen,itemRefs=_ref3.itemRefs,getItemNodeFromIndex=_ref3.getItemNodeFromIndex,menuElement=_ref3.menuElement,scrollIntoViewProp=_ref3.scrollIntoView,shouldScrollRef=reactExports.useRef(!0);return useIsomorphicLayoutEffect(function(){highlightedIndex<0||!isOpen||!Object.keys(itemRefs.current).length||(!1===shouldScrollRef.current?shouldScrollRef.current=!0:scrollIntoViewProp(getItemNodeFromIndex(highlightedIndex),menuElement))},[highlightedIndex]),shouldScrollRef}({menuElement:menuRef.current,highlightedIndex:highlightedIndex,isOpen:isOpen,itemRefs:itemRefs,scrollIntoView:scrollIntoView2,getItemNodeFromIndex:getItemNodeFromIndex});useControlPropsValidator({isInitialMount:isInitialMountRef.current}),reactExports.useEffect(function(){(initialIsOpen||defaultIsOpen||isOpen)&&inputRef.current&&inputRef.current.focus()},[]),reactExports.useEffect(function(){isInitialMountRef.current||(previousResultCountRef.current=items.length)});var mouseAndTouchTrackersRef=function(isOpen,downshiftElementRefs,environment,handleBlur){var mouseAndTouchTrackersRef=reactExports.useRef({isMouseDown:!1,isTouchMove:!1});return reactExports.useEffect(function(){if(null!=(null==environment?void 0:environment.addEventListener)){var onMouseDown=function(){mouseAndTouchTrackersRef.current.isMouseDown=!0},onMouseUp=function(event){mouseAndTouchTrackersRef.current.isMouseDown=!1,isOpen&&!targetWithinDownshift(event.target,downshiftElementRefs.map(function(ref){return ref.current}),environment)&&handleBlur()},onTouchStart=function(){mouseAndTouchTrackersRef.current.isTouchMove=!1},onTouchMove=function(){mouseAndTouchTrackersRef.current.isTouchMove=!0},onTouchEnd=function(event){!isOpen||mouseAndTouchTrackersRef.current.isTouchMove||targetWithinDownshift(event.target,downshiftElementRefs.map(function(ref){return ref.current}),environment,!1)||handleBlur()};return environment.addEventListener("mousedown",onMouseDown),environment.addEventListener("mouseup",onMouseUp),environment.addEventListener("touchstart",onTouchStart),environment.addEventListener("touchmove",onTouchMove),environment.addEventListener("touchend",onTouchEnd),function(){environment.removeEventListener("mousedown",onMouseDown),environment.removeEventListener("mouseup",onMouseUp),environment.removeEventListener("touchstart",onTouchStart),environment.removeEventListener("touchmove",onTouchMove),environment.removeEventListener("touchend",onTouchEnd)}}},[isOpen,environment]),mouseAndTouchTrackersRef}(isOpen,[inputRef,menuRef,toggleButtonRef],environment,function(){dispatch({type:9,selectItem:!1})}),setGetterPropCallInfo=noop2;reactExports.useEffect(function(){return isInitialMountRef.current=!1,function(){isInitialMountRef.current=!0}},[]),reactExports.useEffect(function(){var _environment$document;if(isOpen){if((null==(_environment$document=environment.document)?void 0:_environment$document.activeElement)!==inputRef.current){var _inputRef$current;null==inputRef||null==(_inputRef$current=inputRef.current)||_inputRef$current.focus()}}else itemRefs.current={}},[isOpen,environment]);var inputKeyDownHandlers=reactExports.useMemo(function(){return{ArrowDown:function(event){event.preventDefault(),dispatch({type:0,altKey:event.altKey,getItemNodeFromIndex:getItemNodeFromIndex})},ArrowUp:function(event){event.preventDefault(),dispatch({type:1,altKey:event.altKey,getItemNodeFromIndex:getItemNodeFromIndex})},Home:function(event){latest.current.state.isOpen&&(event.preventDefault(),dispatch({type:3,getItemNodeFromIndex:getItemNodeFromIndex}))},End:function(event){latest.current.state.isOpen&&(event.preventDefault(),dispatch({type:4,getItemNodeFromIndex:getItemNodeFromIndex}))},Escape:function(event){var latestState=latest.current.state;(latestState.isOpen||latestState.inputValue||latestState.selectedItem||latestState.highlightedIndex>-1)&&(event.preventDefault(),dispatch({type:2}))},Enter:function(event){latest.current.state.isOpen&&229!==event.which&&(event.preventDefault(),dispatch({type:7,getItemNodeFromIndex:getItemNodeFromIndex}))},PageUp:function(event){latest.current.state.isOpen&&(event.preventDefault(),dispatch({type:5,getItemNodeFromIndex:getItemNodeFromIndex}))},PageDown:function(event){latest.current.state.isOpen&&(event.preventDefault(),dispatch({type:6,getItemNodeFromIndex:getItemNodeFromIndex}))}}},[dispatch,latest,getItemNodeFromIndex]),getLabelProps=reactExports.useCallback(function(labelProps){return _extends({id:elementIds.labelId,htmlFor:elementIds.inputId},labelProps)},[elementIds]),getMenuProps=reactExports.useCallback(function(_temp,_temp2){var _extends2,_ref=void 0===_temp?{}:_temp,onMouseLeave=_ref.onMouseLeave,_ref$refKey=_ref.refKey,refKey=void 0===_ref$refKey?"ref":_ref$refKey,ref=_ref.ref,rest=_objectWithoutPropertiesLoose$1(_ref,_excluded$1);return(void 0===_temp2?{}:_temp2).suppressRefError,_extends(((_extends2={})[refKey]=handleRefs(ref,function(menuNode){menuRef.current=menuNode}),_extends2.id=elementIds.menuId,_extends2.role="listbox",_extends2["aria-labelledby"]=rest&&rest["aria-label"]?void 0:""+elementIds.labelId,_extends2.onMouseLeave=callAllEventHandlers(onMouseLeave,function(){dispatch({type:11})}),_extends2),rest)},[dispatch,setGetterPropCallInfo,elementIds]),getItemProps=reactExports.useCallback(function(_temp3){var _extends3,_ref4,_ref3=void 0===_temp3?{}:_temp3,itemProp=_ref3.item,indexProp=_ref3.index,_ref3$refKey=_ref3.refKey,refKey=void 0===_ref3$refKey?"ref":_ref3$refKey,ref=_ref3.ref,onMouseMove=_ref3.onMouseMove,onMouseDown=_ref3.onMouseDown,onClick=_ref3.onClick;_ref3.onPress;var disabled=_ref3.disabled,rest=_objectWithoutPropertiesLoose$1(_ref3,_excluded2$1),_latest$current=latest.current,latestProps=_latest$current.props,latestState=_latest$current.state,_getItemAndIndex=function(itemProp,indexProp,items,errorMessage){var item,index2;if(void 0===itemProp){if(void 0===indexProp)throw new Error(errorMessage);item=items[indexProp],index2=indexProp}else index2=void 0===indexProp?items.indexOf(itemProp):indexProp,item=itemProp;return[item,index2]}(itemProp,indexProp,latestProps.items,"Pass either item or index to getItemProps!"),index2=_getItemAndIndex[1],customClickHandler=onClick;return _extends(((_extends3={})[refKey]=handleRefs(ref,function(itemNode){itemNode&&(itemRefs.current[elementIds.getItemId(index2)]=itemNode)}),_extends3.disabled=disabled,_extends3.role="option",_extends3["aria-selected"]=""+(index2===latestState.highlightedIndex),_extends3.id=elementIds.getItemId(index2),_extends3),!disabled&&((_ref4={}).onClick=callAllEventHandlers(customClickHandler,function(){dispatch({type:13,index:index2})}),_ref4),{onMouseMove:callAllEventHandlers(onMouseMove,function(){index2!==latestState.highlightedIndex&&(shouldScrollRef.current=!1,dispatch({type:12,index:index2,disabled:disabled}))}),onMouseDown:callAllEventHandlers(onMouseDown,function(e2){return e2.preventDefault()})},rest)},[dispatch,latest,shouldScrollRef,elementIds]),getToggleButtonProps=reactExports.useCallback(function(_temp4){var _extends4,_ref5=void 0===_temp4?{}:_temp4,onClick=_ref5.onClick;_ref5.onPress;var _ref5$refKey=_ref5.refKey,refKey=void 0===_ref5$refKey?"ref":_ref5$refKey,ref=_ref5.ref,rest=_objectWithoutPropertiesLoose$1(_ref5,_excluded3),latestState=latest.current.state;return _extends(((_extends4={})[refKey]=handleRefs(ref,function(toggleButtonNode){toggleButtonRef.current=toggleButtonNode}),_extends4["aria-controls"]=elementIds.menuId,_extends4["aria-expanded"]=latestState.isOpen,_extends4.id=elementIds.toggleButtonId,_extends4.tabIndex=-1,_extends4),!rest.disabled&&_extends({},{onClick:callAllEventHandlers(onClick,function(){dispatch({type:14})})}),rest)},[dispatch,latest,elementIds]),getInputProps=reactExports.useCallback(function(_temp5,_temp6){var _extends5,_ref6=void 0===_temp5?{}:_temp5,onKeyDown=_ref6.onKeyDown,onChange=_ref6.onChange,onInput=_ref6.onInput,onFocus=_ref6.onFocus,onBlur=_ref6.onBlur;_ref6.onChangeText;var _ref6$refKey=_ref6.refKey,refKey=void 0===_ref6$refKey?"ref":_ref6$refKey,ref=_ref6.ref,rest=_objectWithoutPropertiesLoose$1(_ref6,_excluded4);(void 0===_temp6?{}:_temp6).suppressRefError;var _eventHandlers,latestState=latest.current.state,eventHandlers={};rest.disabled||((_eventHandlers={}).onChange=callAllEventHandlers(onChange,onInput,function(event){dispatch({type:8,inputValue:event.target.value})}),_eventHandlers.onKeyDown=callAllEventHandlers(onKeyDown,function(event){var key=function(event){var key=event.key,keyCode=event.keyCode;return keyCode>=37&&keyCode<=40&&0!==key.indexOf("Arrow")?"Arrow"+key:key}(event);key&&inputKeyDownHandlers[key]&&inputKeyDownHandlers[key](event)}),_eventHandlers.onBlur=callAllEventHandlers(onBlur,function(event){if(latestState.isOpen&&!mouseAndTouchTrackersRef.current.isMouseDown){var isBlurByTabChange=null===event.relatedTarget&&environment.document.activeElement!==environment.document.body;dispatch({type:9,selectItem:!isBlurByTabChange})}}),_eventHandlers.onFocus=callAllEventHandlers(onFocus,function(){latestState.isOpen||dispatch({type:10})}),eventHandlers=_eventHandlers);return _extends(((_extends5={})[refKey]=handleRefs(ref,function(inputNode){inputRef.current=inputNode}),_extends5["aria-activedescendant"]=latestState.isOpen&&latestState.highlightedIndex>-1?elementIds.getItemId(latestState.highlightedIndex):"",_extends5["aria-autocomplete"]="list",_extends5["aria-controls"]=elementIds.menuId,_extends5["aria-expanded"]=latestState.isOpen,_extends5["aria-labelledby"]=rest&&rest["aria-label"]?void 0:""+elementIds.labelId,_extends5.autoComplete="off",_extends5.id=elementIds.inputId,_extends5.role="combobox",_extends5.value=latestState.inputValue,_extends5),eventHandlers,rest)},[setGetterPropCallInfo,latest,elementIds,inputKeyDownHandlers,dispatch,mouseAndTouchTrackersRef,environment]),toggleMenu=reactExports.useCallback(function(){dispatch({type:15})},[dispatch]),closeMenu=reactExports.useCallback(function(){dispatch({type:17})},[dispatch]),openMenu=reactExports.useCallback(function(){dispatch({type:16})},[dispatch]),setHighlightedIndex=reactExports.useCallback(function(newHighlightedIndex){dispatch({type:18,highlightedIndex:newHighlightedIndex})},[dispatch]),selectItem2=reactExports.useCallback(function(newSelectedItem){dispatch({type:19,selectedItem:newSelectedItem})},[dispatch]);return{getItemProps:getItemProps,getLabelProps:getLabelProps,getMenuProps:getMenuProps,getInputProps:getInputProps,getToggleButtonProps:getToggleButtonProps,toggleMenu:toggleMenu,openMenu:openMenu,closeMenu:closeMenu,setHighlightedIndex:setHighlightedIndex,setInputValue:reactExports.useCallback(function(newInputValue){dispatch({type:20,inputValue:newInputValue})},[dispatch]),selectItem:selectItem2,reset:reactExports.useCallback(function(){dispatch({type:21})},[dispatch]),highlightedIndex:highlightedIndex,isOpen:isOpen,selectedItem:selectedItem,inputValue:inputValue}}useCombobox.stateChangeTypes=stateChangeTypes$1,PropTypes.array,PropTypes.array,PropTypes.array,PropTypes.func,PropTypes.func,PropTypes.func,PropTypes.number,PropTypes.number,PropTypes.number,PropTypes.func,PropTypes.func,PropTypes.string,PropTypes.string,PropTypes.shape({addEventListener:PropTypes.func,removeEventListener:PropTypes.func,document:PropTypes.shape({getElementById:PropTypes.func,activeElement:PropTypes.any,body:PropTypes.any})});const DownshiftAutoComplete=props=>props.suggestions.length>0?React__default.createElement(DownshiftAutoCompleteWithSuggestions,{...props}):React__default.createElement("input",{className:styles_textInput,size:40,autoFocus:!0,...props.register(props.inputName)}),DownshiftAutoCompleteWithSuggestions=({autofocus:autofocus,suggestions:suggestions,control:control,inputName:inputName,placeholder:placeholder2,initialInputValue:initialInputValue,setValue:setValue})=>{const[items,setItems]=React__default.useState(suggestions.slice(0,20)),iconComponentFor=E$4(iconComponentFor$),enableAutoComplete=suggestions.length>0,{isOpen:isOpen,getToggleButtonProps:getToggleButtonProps,getMenuProps:getMenuProps,getInputProps:getInputProps,highlightedIndex:highlightedIndex,getItemProps:getItemProps,selectedItem:selectedItem}=useCombobox({initialInputValue:initialInputValue,onInputValueChange({inputValue:inputValue=""}){setValue(inputName,inputValue),inputValue=inputValue.toLowerCase()||"";const matchingItems=[];for(const suggestion of suggestions)if(suggestion.toLowerCase().includes(inputValue)&&(matchingItems.push(suggestion),matchingItems.length>=20))break;setItems(matchingItems)},items:items,itemToString:item=>item??""}),dropdownIsVisible=isOpen&&items.length>0;return React__default.createElement("div",{className:styles_downshiftAutocompleteContainer},React__default.createElement("div",{"data-visible-dropdown":dropdownIsVisible,className:styles_downshiftInputWrapper},React__default.createElement(Controller,{name:inputName,control:control,render:({field:field})=>{const downshiftSrcProps=getInputProps();return React__default.createElement("input",{...downshiftSrcProps,name:field.name,placeholder:placeholder2,className:styles_downshiftInput,size:30,"data-editor-dialog":!0,autoFocus:autofocus})}}),enableAutoComplete&&React__default.createElement("button",{"aria-label":"toggle menu",type:"button",...getToggleButtonProps()},iconComponentFor("arrow_drop_down"))),React__default.createElement("div",{className:styles_downshiftAutocompleteContainer},React__default.createElement("ul",{...getMenuProps(),"data-visible":dropdownIsVisible},items.map((item,index2)=>React__default.createElement("li",{"data-selected":selectedItem===item,"data-highlighted":highlightedIndex===index2,key:`${item}${index2}`,...getItemProps({item:item,index:index2})},item)))))},ImageDialog=()=>{const[imageAutocompleteSuggestions,state,editorRootElementRef,imageUploadHandler,allowSetImageDimensions]=X$3(imageAutocompleteSuggestions$,imageDialogState$,editorRootElementRef$,imageUploadHandler$,allowSetImageDimensions$),saveImage=A$4(saveImage$),closeImageDialog=A$4(closeImageDialog$),t2=useTranslation(),{register:register,handleSubmit:handleSubmit,control:control,setValue:setValue,reset:reset}=useForm({values:"editing"===state.type?state.initialValues:{}}),resetFormState=()=>{reset({src:"",title:"",altText:"",width:void 0,height:void 0})};return"inactive"===state.type?null:React__default.createElement(Root$2,{open:!0,onOpenChange:open=>{open||(closeImageDialog(),resetFormState())}},React__default.createElement(Portal$2,{container:null==editorRootElementRef?void 0:editorRootElementRef.current},React__default.createElement(Overlay,{className:styles_dialogOverlay}),React__default.createElement(Content,{className:styles_dialogContent,onOpenAutoFocus:e2=>{e2.preventDefault()}},React__default.createElement(Title,null,t2("uploadImage.dialogTitle","Upload an image")),React__default.createElement("form",{onSubmit:async e2=>{e2.preventDefault(),e2.stopPropagation(),await handleSubmit(saveImage)(e2),resetFormState()},className:styles_multiFieldForm},null===imageUploadHandler?React__default.createElement("input",{type:"hidden",accept:"image/*",...register("file")}):React__default.createElement("div",{className:styles_formField},React__default.createElement("label",{htmlFor:"file"},t2("uploadImage.uploadInstructions","Upload an image from your device:")),React__default.createElement("input",{type:"file",accept:"image/*",...register("file")})),React__default.createElement("div",{className:styles_formField},React__default.createElement("label",{htmlFor:"src"},null!==imageUploadHandler?t2("uploadImage.addViaUrlInstructions","Or add an image from an URL:"):t2("uploadImage.addViaUrlInstructionsNoUpload","Add an image from an URL:")),React__default.createElement(DownshiftAutoComplete,{register:register,initialInputValue:"editing"===state.type?state.initialValues.src??"":"",inputName:"src",suggestions:imageAutocompleteSuggestions,setValue:setValue,control:control,placeholder:t2("uploadImage.autoCompletePlaceholder","Select or paste an image src")})),React__default.createElement("div",{className:styles_formField},React__default.createElement("label",{htmlFor:"alt"},t2("uploadImage.alt","Alt:")),React__default.createElement("input",{type:"text",...register("altText"),className:styles_textInput})),React__default.createElement("div",{className:styles_formField},React__default.createElement("label",{htmlFor:"title"},t2("uploadImage.title","Title:")),React__default.createElement("input",{type:"text",...register("title"),className:styles_textInput})),allowSetImageDimensions&&React__default.createElement("div",{className:styles_imageDimensionsContainer},React__default.createElement("div",{className:styles_formField},React__default.createElement("label",{htmlFor:"width"},t2("uploadImage.width","Width:")),React__default.createElement("input",{type:"number",min:0,...register("width"),className:styles_textInput})),React__default.createElement("div",{className:styles_formField},React__default.createElement("label",{htmlFor:"height"},t2("uploadImage.height","Height:")),React__default.createElement("input",{type:"number",min:0,...register("height"),className:styles_textInput}))),React__default.createElement("div",{style:{display:"flex",justifyContent:"flex-end",gap:"var(--spacing-2)"}},React__default.createElement("button",{type:"submit",title:t2("dialogControls.save","Save"),"aria-label":t2("dialogControls.save","Save"),className:classNames(styles_primaryButton)},t2("dialogControls.save","Save")),React__default.createElement(Close,{asChild:!0},React__default.createElement("button",{type:"reset",title:t2("dialogControls.cancel","Cancel"),"aria-label":t2("dialogControls.cancel","Cancel"),className:classNames(styles_secondaryButton)},t2("dialogControls.cancel","Cancel"))))))))};function clamp$1(value,min2,max2){return Math.min(Math.max(value,min2),max2)}const Direction_east=1,Direction_north=8,Direction_south=2,Direction_west=4;function ImageResizer({onResizeStart:onResizeStart,onResizeEnd:onResizeEnd,imageRef:imageRef,maxWidth:maxWidth,editor:editor}){const controlWrapperRef=reactExports.useRef(null),userSelect=reactExports.useRef({priority:"",value:"default"}),positioningRef=reactExports.useRef({currentHeight:0,currentWidth:0,direction:0,isResizing:!1,ratio:0,startHeight:0,startWidth:0,startX:0,startY:0}),editorRootElement=editor.getRootElement(),maxWidthContainer=maxWidth??(null!==editorRootElement?editorRootElement.getBoundingClientRect().width-20:100),maxHeightContainer=null!==editorRootElement?editorRootElement.getBoundingClientRect().height-20:100,handlePointerDown=(event,direction)=>{if(!editor.isEditable())return;const image2=imageRef.current,controlWrapper=controlWrapperRef.current;if(null!==image2&&null!==controlWrapper){event.preventDefault();const{width:width,height:height}=image2.getBoundingClientRect(),positioning=positioningRef.current;positioning.startWidth=width,positioning.startHeight=height,positioning.ratio=width/height,positioning.currentWidth=width,positioning.currentHeight=height,positioning.startX=event.clientX,positioning.startY=event.clientY,positioning.isResizing=!0,positioning.direction=direction,(direction=>{const cursorDir=direction===Direction_east||direction===Direction_west?"ew":direction===Direction_north||direction===Direction_south?"ns":direction&Direction_north&&direction&Direction_west||direction&Direction_south&&direction&Direction_east?"nwse":"nesw";null!==editorRootElement&&editorRootElement.style.setProperty("cursor",`${cursorDir}-resize`,"important"),null!==document.body&&(document.body.style.setProperty("cursor",`${cursorDir}-resize`,"important"),userSelect.current.value=document.body.style.getPropertyValue("-webkit-user-select"),userSelect.current.priority=document.body.style.getPropertyPriority("-webkit-user-select"),document.body.style.setProperty("-webkit-user-select","none","important"))})(direction),onResizeStart(),controlWrapper.classList.add(styles_imageControlWrapperResizing),image2.style.height=`${height}px`,image2.style.width=`${width}px`,document.addEventListener("pointermove",handlePointerMove),document.addEventListener("pointerup",handlePointerUp)}},handlePointerMove=event=>{const image2=imageRef.current,positioning=positioningRef.current,isHorizontal=positioning.direction&(Direction_east|Direction_west),isVertical=positioning.direction&(Direction_south|Direction_north);if(null!==image2&&positioning.isResizing)if(isHorizontal&&isVertical){let diff3=Math.floor(positioning.startX-event.clientX);diff3=positioning.direction&Direction_east?-diff3:diff3;const width=clamp$1(positioning.startWidth+diff3,100,maxWidthContainer),height=width/positioning.ratio;image2.style.width=`${width}px`,image2.style.height=`${height}px`,positioning.currentHeight=height,positioning.currentWidth=width}else if(isVertical){let diff3=Math.floor(positioning.startY-event.clientY);diff3=positioning.direction&Direction_south?-diff3:diff3;const height=clamp$1(positioning.startHeight+diff3,100,maxHeightContainer);image2.style.height=`${height}px`,positioning.currentHeight=height}else{let diff3=Math.floor(positioning.startX-event.clientX);diff3=positioning.direction&Direction_east?-diff3:diff3;const width=clamp$1(positioning.startWidth+diff3,100,maxWidthContainer);image2.style.width=`${width}px`,positioning.currentWidth=width}},handlePointerUp=()=>{const image2=imageRef.current,positioning=positioningRef.current,controlWrapper=controlWrapperRef.current;if(null!==image2&&null!==controlWrapper&&positioning.isResizing){const width=positioning.currentWidth,height=positioning.currentHeight;positioning.startWidth=0,positioning.startHeight=0,positioning.ratio=0,positioning.startX=0,positioning.startY=0,positioning.currentWidth=0,positioning.currentHeight=0,positioning.isResizing=!1,controlWrapper.classList.remove(styles_imageControlWrapperResizing),null!==editorRootElement&&editorRootElement.style.setProperty("cursor","text"),null!==document.body&&(document.body.style.setProperty("cursor","default"),document.body.style.setProperty("-webkit-user-select",userSelect.current.value,userSelect.current.priority)),onResizeEnd(width,height),document.removeEventListener("pointermove",handlePointerMove),document.removeEventListener("pointerup",handlePointerUp)}};return reactExports.createElement("div",{ref:controlWrapperRef},reactExports.createElement("div",{className:classNames(styles_imageResizer,styles_imageResizerN),onPointerDown:event=>{handlePointerDown(event,Direction_north)}}),reactExports.createElement("div",{className:classNames(styles_imageResizer,styles_imageResizerNe),onPointerDown:event=>{handlePointerDown(event,Direction_north|Direction_east)}}),reactExports.createElement("div",{className:classNames(styles_imageResizer,styles_imageResizerE),onPointerDown:event=>{handlePointerDown(event,Direction_east)}}),reactExports.createElement("div",{className:classNames(styles_imageResizer,styles_imageResizerSe),onPointerDown:event=>{handlePointerDown(event,Direction_south|Direction_east)}}),reactExports.createElement("div",{className:classNames(styles_imageResizer,styles_imageResizerS),onPointerDown:event=>{handlePointerDown(event,Direction_south)}}),reactExports.createElement("div",{className:classNames(styles_imageResizer,styles_imageResizerSw),onPointerDown:event=>{handlePointerDown(event,Direction_south|Direction_west)}}),reactExports.createElement("div",{className:classNames(styles_imageResizer,styles_imageResizerW),onPointerDown:event=>{handlePointerDown(event,Direction_west)}}),reactExports.createElement("div",{className:classNames(styles_imageResizer,styles_imageResizerNw),onPointerDown:event=>{handlePointerDown(event,Direction_north|Direction_west)}}))}const BROKEN_IMG_URI="data:image/svg+xml;charset=utf-8,"+encodeURIComponent('\n <svg id="imgLoadError" xmlns="http://www.w3.org/2000/svg" width="100" height="100">\n <rect x="0" y="0" width="100" height="100" fill="none" stroke="red" stroke-width="4" stroke-dasharray="4" />\n <text x="50" y="55" text-anchor="middle" font-size="20" fill="red">⚠️</text>\n </svg>\n'),imgCache={__cache:{},read(src){if(this.__cache[src]||(this.__cache[src]=new Promise(resolve=>{const img=new Image;img.onerror=()=>{this.__cache[src]=BROKEN_IMG_URI,resolve()},img.onload=()=>{this.__cache[src]=src,resolve()},img.src=src})),this.__cache[src]instanceof Promise)throw this.__cache[src];return this.__cache[src]}};function LazyImage({title:title,alt:alt,className:className,imageRef:imageRef,src:src,width:width,height:height}){return React__default.createElement("img",{className:className??void 0,alt:alt,src:imgCache.read(src),title:title,ref:imageRef,draggable:"false",width:width,height:height})}function ImageEditor({src:src,title:title,alt:alt,nodeKey:nodeKey,width:width,height:height,rest:rest}){const[ImagePlaceholderComponent,disableImageResize,allowSetImageDimensions,imagePreviewHandler,readOnly,EditImageToolbar2]=X$3(imagePlaceholder$,disableImageResize$,allowSetImageDimensions$,imagePreviewHandler$,readOnly$,editImageToolbarComponent$),imageRef=React__default.useRef(null),buttonRef=React__default.useRef(null),[isSelected,setSelected,clearSelection]=u(nodeKey),[editor]=o$5(),[selection2,setSelection]=React__default.useState(null),activeEditorRef=React__default.useRef(null),[isResizing,setIsResizing]=React__default.useState(!1),[imageSource,setImageSource]=React__default.useState(null),[initialImagePath,setInitialImagePath]=React__default.useState(null),onDelete=React__default.useCallback(payload=>{if(isSelected&&fr(wr())){payload.preventDefault();const node2=_s(nodeKey);$isImageNode(node2)&&node2.remove()}return!1},[isSelected,nodeKey]),onEnter=React__default.useCallback(event=>{const latestSelection=wr(),buttonElem=buttonRef.current;return!(!isSelected||!fr(latestSelection)||1!==latestSelection.getNodes().length||null===buttonElem||buttonElem===document.activeElement)&&(event.preventDefault(),buttonElem.focus(),!0)},[isSelected]),onEscape=React__default.useCallback(event=>buttonRef.current===event.target&&(ks(null),editor.update(()=>{setSelected(!0);const parentRootElement=editor.getRootElement();null!==parentRootElement&&parentRootElement.focus()}),!0),[editor,setSelected]);React__default.useEffect(()=>{if(imagePreviewHandler){(async()=>{initialImagePath||setInitialImagePath(src);const updatedSrc=await imagePreviewHandler(src);setImageSource(updatedSrc)})().catch(e2=>{console.error(e2)})}else setImageSource(src)},[src,imagePreviewHandler,initialImagePath]),React__default.useEffect(()=>{if(allowSetImageDimensions&&imageRef.current){const{current:image2}=imageRef;syncDimensionWithImageResizer(image2,"width",width),syncDimensionWithImageResizer(image2,"height",height)}},[allowSetImageDimensions,width,height]),React__default.useEffect(()=>{let isMounted=!0;const unregister=j$2(editor.registerUpdateListener(({editorState:editorState})=>{isMounted&&setSelection(editorState.read(()=>wr()))}),editor.registerCommand(le,(_2,activeEditor)=>(activeEditorRef.current=activeEditor,!1),1),editor.registerCommand(ae,payload=>{const event=payload;return!!isResizing||event.target===imageRef.current&&(event.shiftKey?setSelected(!isSelected):(clearSelection(),setSelected(!0)),!0)},1),editor.registerCommand(Be,event=>event.target===imageRef.current&&(event.preventDefault(),!0),1),editor.registerCommand(Pe,onDelete,1),editor.registerCommand(Me,onDelete,1),editor.registerCommand(Ee,onEnter,1),editor.registerCommand(Ae,onEscape,1));return()=>{isMounted=!1,unregister()}},[clearSelection,editor,isResizing,isSelected,nodeKey,onDelete,onEnter,onEscape,setSelected]);const draggable=fr(selection2),isFocused=isSelected,passedClassName=React__default.useMemo(()=>{if(0===rest.length)return null;const className=rest.find(attr=>"mdxJsxAttribute"===attr.type&&("class"===attr.name||"className"===attr.name));return className?className.value:null},[rest]);return null!==imageSource?React__default.createElement(React__default.Suspense,{fallback:ImagePlaceholderComponent?React__default.createElement(ImagePlaceholderComponent,null):null},React__default.createElement("div",{className:styles_imageWrapper,"data-editor-block-type":"image"},React__default.createElement("div",{draggable:draggable},React__default.createElement(LazyImage,{width:width,height:height,className:classNames({[styles_focusedImage]:isFocused},passedClassName),src:imageSource,title:title??"",alt:alt??"",imageRef:imageRef})),draggable&&isFocused&&!disableImageResize&&React__default.createElement(ImageResizer,{editor:editor,imageRef:imageRef,onResizeStart:()=>{setIsResizing(!0)},onResizeEnd:(nextWidth,nextHeight)=>{setTimeout(()=>{setIsResizing(!1)},200),editor.update(()=>{const node2=_s(nodeKey);$isImageNode(node2)&&node2.setWidthAndHeight(nextWidth,nextHeight)})}}),readOnly||React__default.createElement(EditImageToolbar2,{nodeKey:nodeKey,imageSource:imageSource,initialImagePath:initialImagePath,title:title??"",alt:alt??"",width:width,height:height}))):null}const syncDimensionWithImageResizer=(image2,key,value)=>{"number"==typeof value?image2.style[key]=`${value}px`:image2.style.removeProperty(key)};var __defProp$1=Object.defineProperty,__publicField$1=(obj,key,value)=>(((obj,key,value)=>{key in obj?__defProp$1(obj,key,{enumerable:!0,configurable:!0,writable:!0,value:value}):obj[key]=value})(obj,"symbol"!=typeof key?key+"":key,value),value);function convertImageElement(domNode){if(domNode instanceof HTMLImageElement){const{alt:altText,src:src,title:title,width:width,height:height}=domNode;return{node:$createImageNode({altText:altText,src:src,title:title,width:width||void 0,height:height||void 0})}}return null}class ImageNode extends _i{constructor(src,altText,title,width,height,rest,key){super(key),__publicField$1(this,"__src"),__publicField$1(this,"__altText"),__publicField$1(this,"__title"),__publicField$1(this,"__width"),__publicField$1(this,"__height"),__publicField$1(this,"__rest"),this.__src=src,this.__title=title,this.__altText=altText,this.__width=width??"inherit",this.__height=height??"inherit",this.__rest=rest??[]}static getType(){return"image"}static clone(node2){return new ImageNode(node2.__src,node2.__altText,node2.__title,node2.__width,node2.__height,node2.__rest,node2.__key)}afterCloneFrom(prevNode){super.afterCloneFrom(prevNode),this.__src=prevNode.__src,this.__altText=prevNode.__altText,this.__title=prevNode.__title,this.__width=prevNode.__width,this.__height=prevNode.__height,this.__rest=prevNode.__rest}static importJSON(serializedNode){const{altText:altText,title:title,src:src,width:width,rest:rest,height:height}=serializedNode;return $createImageNode({altText:altText,title:title,src:src,height:height,width:width,rest:rest})}exportDOM(){const element2=document.createElement("img");return element2.setAttribute("src",this.__src),element2.setAttribute("alt",this.__altText),this.__title&&element2.setAttribute("title",this.__title),"inherit"!==this.__width&&this.__width&&element2.setAttribute("width",this.__width.toString()),"inherit"!==this.__height&&this.__height&&element2.setAttribute("height",this.__height.toString()),{element:element2}}static importDOM(){return{img:()=>({conversion:convertImageElement,priority:0})}}exportJSON(){return{altText:this.getAltText(),title:this.getTitle(),height:"inherit"===this.__height?void 0:this.__height,width:"inherit"===this.__width?void 0:this.__width,src:this.getSrc(),rest:this.__rest,type:"image",version:1}}setWidthAndHeight(width,height){const writable=this.getWritable();writable.__width=width,writable.__height=height}createDOM(config,_editor){const span=document.createElement("span"),className=config.theme.image;return void 0!==className&&(span.className=className),span}updateDOM(){return!1}getSrc(){return this.__src}getAltText(){return this.__altText}getTitle(){return this.__title}getHeight(){return this.__height}getWidth(){return this.__width}getRest(){return this.__rest}setTitle(title){this.getWritable().__title=title}setSrc(src){this.getWritable().__src=src}setAltText(altText){this.getWritable().__altText=altText??""}shouldBeSerializedAsElement(){return"inherit"!==this.__width||"inherit"!==this.__height||this.__rest.length>0}decorate(_parentEditor){return React__default.createElement(ImageEditor,{src:this.getSrc(),title:this.getTitle(),nodeKey:this.getKey(),width:this.__width,height:this.__height,alt:this.__altText,rest:this.__rest})}}function $createImageNode(params){const{altText:altText,title:title,src:src,key:key,width:width,height:height,rest:rest}=params;return new ImageNode(src,altText,title,width,height,rest,key)}function $isImageNode(node2){return node2 instanceof ImageNode}const LexicalImageVisitor={testLexicalNode:$isImageNode,visitLexicalNode({mdastParent:mdastParent,lexicalNode:lexicalNode,actions:actions}){if(lexicalNode.shouldBeSerializedAsElement()){const img=new Image;"inherit"!==lexicalNode.getHeight()&&(img.height=lexicalNode.getHeight()),"inherit"!==lexicalNode.getWidth()&&(img.width=lexicalNode.getWidth()),lexicalNode.getAltText()&&(img.alt=lexicalNode.getAltText()),lexicalNode.getTitle()&&(img.title=lexicalNode.getTitle());for(const attr of lexicalNode.getRest())"mdxJsxAttribute"===attr.type&&"string"==typeof attr.value&&img.setAttribute(attr.name,attr.value);actions.appendToParent(mdastParent,{type:"html",value:img.outerHTML.replace(/>$/,` src="${lexicalNode.getSrc()}" />`)})}else actions.appendToParent(mdastParent,{type:"image",url:lexicalNode.getSrc(),alt:lexicalNode.getAltText(),title:lexicalNode.getTitle()})}},MdastImageVisitor={testNode:"image",visitNode({mdastNode:mdastNode,actions:actions}){actions.addAndStepInto($createImageNode({src:mdastNode.url,altText:mdastNode.alt??"",title:mdastNode.title??""}))}},MdastHtmlImageVisitor={testNode:node2=>"html"===node2.type&&node2.value.trim().startsWith("<img"),visitNode({mdastNode:mdastNode,lexicalParent:lexicalParent}){const wrapper=document.createElement("div");wrapper.innerHTML=mdastNode.value;const img=wrapper.querySelector("img");if(!img)throw new Error("Invalid HTML image");const image2=$createImageNode({src:img.src||"",altText:img.alt,title:img.title,width:img.width||void 0,height:img.height||void 0});if("root"===lexicalParent.getType()){const paragraph2=Fi();paragraph2.append(image2),lexicalParent.append(paragraph2)}else lexicalParent.append(image2)}};function getAttributeValue(node2,attributeName){const attribute=node2.attributes.find(a2=>"mdxJsxAttribute"===a2.type&&a2.name===attributeName);if(attribute)return attribute.value}const MdastJsxImageVisitor={testNode:node2=>("mdxJsxTextElement"===node2.type||"mdxJsxFlowElement"===node2.type)&&"img"===node2.name,visitNode({mdastNode:mdastNode,lexicalParent:lexicalParent}){const src=getAttributeValue(mdastNode,"src");if(!src)return;const altText=getAttributeValue(mdastNode,"alt")??"",title=getAttributeValue(mdastNode,"title"),height=getAttributeValue(mdastNode,"height"),width=getAttributeValue(mdastNode,"width"),rest=mdastNode.attributes.filter(a2=>"mdxJsxAttribute"===a2.type&&!["src","alt","title","height","width"].includes(a2.name)),image2=$createImageNode({src:src,altText:altText,title:title,width:width?parseInt(width,10):void 0,height:height?parseInt(height,10):void 0,rest:rest});if("root"===lexicalParent.getType()){const paragraph2=Fi();paragraph2.append(image2),lexicalParent.append(paragraph2)}else lexicalParent.append(image2)}},internalInsertImage$=K$3(r2=>{r2.sub(r2.pipe(internalInsertImage$,tt$4(activeEditor$)),([values,theEditor])=>{null==theEditor||theEditor.update(()=>{const imageNode=$createImageNode({altText:values.altText??"",src:values.src,title:values.title??"",width:parseImageDimension(values.width),height:parseImageDimension(values.height)});Lr([imageNode]),so(imageNode.getParentOrThrow())&&Ct$3(imageNode,Fi).selectEnd()})})}),insertImage$=K$3(r2=>{r2.sub(r2.pipe(insertImage$,tt$4(imageUploadHandler$)),([values,imageUploadHandler])=>{const handler=src=>{r2.pub(internalInsertImage$,{...values,src:src})};"file"in values?null==imageUploadHandler||imageUploadHandler(values.file).then(handler).catch(e2=>{throw e2}):handler(values.src)})}),imageAutocompleteSuggestions$=$$4([]),disableImageResize$=$$4(!1),imageUploadHandler$=$$4(null),imagePreviewHandler$=$$4(null),imagePlaceholder$=$$4(null),imageDialogState$=$$4({type:"inactive"},r2=>{r2.sub(r2.pipe(saveImage$,tt$4(activeEditor$,imageUploadHandler$,imageDialogState$,allowSetImageDimensions$)),([values,theEditor,imageUploadHandler,dialogState,allowSetImageDimensions])=>{const handler="editing"===dialogState.type?src=>{null==theEditor||theEditor.update(()=>{const{nodeKey:nodeKey}=dialogState,imageNode=_s(nodeKey);if(imageNode.setTitle(values.title),imageNode.setAltText(values.altText),imageNode.setSrc(src),allowSetImageDimensions){const width=parseImageDimension(values.width),height=parseImageDimension(values.height);imageNode.setWidthAndHeight(width??"inherit",height??"inherit")}}),r2.pub(imageDialogState$,{type:"inactive"})}:src=>{r2.pub(internalInsertImage$,{...values,src:src}),r2.pub(imageDialogState$,{type:"inactive"})};values.file&&values.file.length>0?null==imageUploadHandler||imageUploadHandler(values.file.item(0)).then(handler).catch(e2=>{throw e2}):values.src&&handler(values.src)}),r2.pub(createActiveEditorSubscription$,editor=>{const theUploadHandler=r2.getValue(imageUploadHandler$);return j$2(editor.registerCommand(INSERT_IMAGE_COMMAND,payload=>{const imageNode=$createImageNode(payload);return Lr([imageNode]),so(imageNode.getParentOrThrow())&&Ct$3(imageNode,Fi).selectEnd(),!0},0),editor.registerCommand(Be,event=>function(event){const node2=getImageNodeInSelection();if(!node2)return!1;const dataTransfer=event.dataTransfer;if(!dataTransfer)return!1;dataTransfer.setData("text/plain","_");const img=document.createElement("img");return img.src=TRANSPARENT_IMAGE,dataTransfer.setDragImage(img,0,0),dataTransfer.setData("application/x-lexical-drag",JSON.stringify({data:{altText:node2.__altText,title:node2.__title,key:node2.getKey(),src:node2.__src},type:"image"})),!0}(event),3),editor.registerCommand(Re,event=>function(event,hasUploadHandler){var _a;if(hasUploadHandler){let cbPayload=Array.from((null==(_a=event.dataTransfer)?void 0:_a.items)??[]);if(cbPayload=cbPayload.filter(i2=>i2.type.includes("image")),cbPayload.length>0)return event.preventDefault(),!0}if(!getImageNodeInSelection())return!1;canDropImage(event)||event.preventDefault();return!0}(event,!!theUploadHandler),1),editor.registerCommand(Ke,event=>function(event,editor,imageUploadHandler){var _a;let cbPayload=Array.from((null==(_a=event.dataTransfer)?void 0:_a.items)??[]);if(cbPayload=cbPayload.filter(i2=>i2.type.includes("image")),cbPayload.length>0&&null!==imageUploadHandler)return event.preventDefault(),Promise.all(cbPayload.map(image2=>"string"===image2.kind?new Promise(rs2=>{image2.getAsString(rs2)}):imageUploadHandler(image2.getAsFile()))).then(urls=>{urls.forEach(url=>{editor.dispatchCommand(INSERT_IMAGE_COMMAND,{src:url,altText:""})})}).catch(e2=>{throw e2}),!0;const node2=getImageNodeInSelection();if(!node2)return!1;const data=function(event){var _a;const dragData=null==(_a=event.dataTransfer)?void 0:_a.getData("application/x-lexical-drag");if(!dragData)return null;const{type:type,data:data}=JSON.parse(dragData);if("image"!==type)return null;return data}(event);if(!data)return!1;if(event.preventDefault(),canDropImage(event)){const range=function(event){let range;const target=event.target,targetWindow=null==target?null:9===target.nodeType?target.defaultView:target.ownerDocument.defaultView,domSelection=getDOMSelection(targetWindow);if(document.caretRangeFromPoint)range=document.caretRangeFromPoint(event.clientX,event.clientY);else{if(!event.rangeParent||null===domSelection)throw Error("Cannot get the selection when dragging");domSelection.collapse(event.rangeParent,event.rangeOffset??0),range=domSelection.getRangeAt(0)}return range}(event);node2.remove();const rangeSelection=kr();null!=range&&rangeSelection.applyDOMRange(range),ks(rangeSelection),editor.dispatchCommand(INSERT_IMAGE_COMMAND,data)}return!0}(event,editor,r2.getValue(imageUploadHandler$)),3),editor.registerCommand(ge,event=>{var _a,_b;if(!theUploadHandler){let fromWeb=Array.from((null==(_a=event.clipboardData)?void 0:_a.items)??[]);return fromWeb=fromWeb.filter(i2=>i2.type.includes("text")),!fromWeb.length||0===fromWeb.length}const cbPayload=Array.from((null==(_b=event.clipboardData)?void 0:_b.items)??[]);if(cbPayload.some(item=>!item.type.includes("image")))return!1;if(!cbPayload.length||0===cbPayload.length)return!1;const imageUploadHandlerValue=r2.getValue(imageUploadHandler$);return Promise.all(cbPayload.map(file=>imageUploadHandlerValue(file.getAsFile()))).then(urls=>{urls.forEach(url=>{editor.dispatchCommand(INSERT_IMAGE_COMMAND,{src:url,altText:""})})}).catch(e2=>{throw e2}),!0},4))})}),openNewImageDialog$=q$3(r2=>{r2.link(r2.pipe(openNewImageDialog$,et$5({type:"new"})),imageDialogState$)}),openEditImageDialog$=K$3(r2=>{r2.link(r2.pipe(openEditImageDialog$,_$3(payload=>({type:"editing",...payload}))),imageDialogState$)}),closeImageDialog$=q$3(r2=>{r2.link(r2.pipe(closeImageDialog$,et$5({type:"inactive"})),imageDialogState$)}),disableImageSettingsButton$=$$4(!1),allowSetImageDimensions$=$$4(!1),saveImage$=K$3(),editImageToolbarComponent$=$$4(EditImageToolbar),parseImageDimension=value=>{if(void 0===value)return;const parsed=parseInt(String(value),10);return Number.isNaN(parsed)?void 0:parsed},imagePlugin=realmPlugin({init(realm,params){realm.pubIn({[addImportVisitor$]:[MdastImageVisitor,MdastHtmlImageVisitor,MdastJsxImageVisitor],[addLexicalNode$]:ImageNode,[addExportVisitor$]:LexicalImageVisitor,[addComposerChild$]:(null==params?void 0:params.ImageDialog)??ImageDialog,[imageUploadHandler$]:(null==params?void 0:params.imageUploadHandler)??null,[imageAutocompleteSuggestions$]:(null==params?void 0:params.imageAutocompleteSuggestions)??[],[disableImageResize$]:Boolean(null==params?void 0:params.disableImageResize),[disableImageSettingsButton$]:Boolean(null==params?void 0:params.disableImageSettingsButton),[allowSetImageDimensions$]:Boolean(null==params?void 0:params.allowSetImageDimensions),[imagePreviewHandler$]:(null==params?void 0:params.imagePreviewHandler)??null,[editImageToolbarComponent$]:(null==params?void 0:params.EditImageToolbar)??EditImageToolbar,[imagePlaceholder$]:(null==params?void 0:params.imagePlaceholder)??ImagePlaceholder})},update(realm,params){realm.pubIn({[imageUploadHandler$]:(null==params?void 0:params.imageUploadHandler)??null,[imageAutocompleteSuggestions$]:(null==params?void 0:params.imageAutocompleteSuggestions)??[],[disableImageResize$]:Boolean(null==params?void 0:params.disableImageResize),[imagePreviewHandler$]:(null==params?void 0:params.imagePreviewHandler)??null,[allowSetImageDimensions$]:Boolean(null==params?void 0:params.allowSetImageDimensions),[editImageToolbarComponent$]:(null==params?void 0:params.EditImageToolbar)??EditImageToolbar,[imagePlaceholder$]:(null==params?void 0:params.imagePlaceholder)??ImagePlaceholder})}}),getDOMSelection=targetWindow=>CAN_USE_DOM?(targetWindow??window).getSelection():null,INSERT_IMAGE_COMMAND=oe$1("INSERT_IMAGE_COMMAND"),TRANSPARENT_IMAGE="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";function getImageNodeInSelection(){const selection2=wr();if(!fr(selection2))return null;const node2=selection2.getNodes()[0];return $isImageNode(node2)?node2:null}function canDropImage(event){const target=event.target;return!!(target&&target instanceof HTMLElement&&target.parentElement)}const MdastBlockQuoteVisitor={testNode:"blockquote",visitNode({actions:actions}){actions.addAndStepInto(Nt$1())}},LexicalQuoteVisitor={testLexicalNode:wt$1,visitLexicalNode:({actions:actions})=>{actions.addAndStepInto("blockquote")}},quotePlugin=realmPlugin({init(realm){realm.pubIn({[addActivePlugin$]:"quote",[addImportVisitor$]:MdastBlockQuoteVisitor,[addLexicalNode$]:xt$1,[addExportVisitor$]:LexicalQuoteVisitor})}});function voidEmitter(){let subscription=noop$2;return{publish:()=>{subscription()},subscribe:cb=>{subscription=cb}}}var __defProp2=Object.defineProperty,__publicField2=(obj,key,value)=>(((obj,key,value)=>{key in obj?__defProp2(obj,key,{enumerable:!0,configurable:!0,writable:!0,value:value}):obj[key]=value})(obj,"symbol"!=typeof key?key+"":key,value),value);class CodeBlockNode extends _i{constructor(code2,language,meta,key){super(key),__publicField2(this,"__code"),__publicField2(this,"__meta"),__publicField2(this,"__language"),__publicField2(this,"__focusEmitter",voidEmitter()),__publicField2(this,"setCode",code3=>{code3!==this.__code&&(this.getWritable().__code=code3)}),__publicField2(this,"setMeta",meta2=>{meta2!==this.__meta&&(this.getWritable().__meta=meta2)}),__publicField2(this,"setLanguage",language2=>{language2!==this.__language&&(this.getWritable().__language=language2)}),__publicField2(this,"select",()=>{this.__focusEmitter.publish()}),this.__code=code2,this.__meta=meta,this.__language=language}static getType(){return"codeblock"}static clone(node2){return new CodeBlockNode(node2.__code,node2.__language,node2.__meta,node2.__key)}afterCloneFrom(prevNode){super.afterCloneFrom(prevNode),this.__code=prevNode.__code,this.__meta=prevNode.__meta,this.__language=prevNode.__language,this.__focusEmitter=voidEmitter()}static importJSON(serializedNode){const{code:code2,meta:meta,language:language}=serializedNode;return $createCodeBlockNode({code:code2,language:language,meta:meta})}static importDOM(){return{pre:()=>({conversion:$convertPreElement,priority:3})}}exportJSON(){return{code:this.getCode(),language:this.getLanguage(),meta:this.getMeta(),type:"codeblock",version:1}}createDOM(_config,_editor){return document.createElement("div")}updateDOM(){return!1}getCode(){return this.__code}getMeta(){return this.__meta}getLanguage(){return this.__language}decorate(editor){return React__default.createElement(CodeBlockEditorContainer,{parentEditor:editor,code:this.getCode(),meta:this.getMeta(),language:this.getLanguage(),codeBlockNode:this,nodeKey:this.getKey(),focusEmitter:this.__focusEmitter})}isInline(){return!1}}const CodeBlockEditorContext=React__default.createContext(null),CodeBlockEditorContextProvider=({parentEditor:parentEditor,lexicalNode:lexicalNode,children:children})=>{const contextValue=React__default.useMemo(()=>({lexicalNode:lexicalNode,parentEditor:parentEditor,setCode:code2=>{parentEditor.update(()=>{lexicalNode.setCode(code2),setTimeout(()=>{parentEditor.dispatchCommand(NESTED_EDITOR_UPDATED_COMMAND,void 0)},0)})},setLanguage:language=>{parentEditor.update(()=>{lexicalNode.setLanguage(language)})},setMeta:meta=>{parentEditor.update(()=>{lexicalNode.setMeta(meta)})}}),[lexicalNode,parentEditor]);return React__default.createElement(CodeBlockEditorContext.Provider,{value:contextValue},children)};function useCodeBlockEditorContext(){const context=React__default.useContext(CodeBlockEditorContext);if(!context)throw new Error("useCodeBlockEditor must be used within a CodeBlockEditor");return context}const CodeBlockEditorContainer=props=>{const codeBlockEditorDescriptors=E$4(codeBlockEditorDescriptors$),defaultCodeBlockLanguage=E$4(defaultCodeBlockLanguage$);let descriptor=codeBlockEditorDescriptors.sort((a2,b2)=>b2.priority-a2.priority).find(descriptor2=>descriptor2.match(props.language||"",props.meta||""));if(descriptor??(descriptor=codeBlockEditorDescriptors.find(descriptor2=>descriptor2.match(defaultCodeBlockLanguage||"",props.meta||""))),!descriptor)throw new Error(`No CodeBlockEditor registered for language=${props.language} meta=${props.meta}`);const Editor=descriptor.Editor,{codeBlockNode:_2,parentEditor:__,...restProps}=props;return React__default.createElement(CodeBlockEditorContextProvider,{parentEditor:props.parentEditor,lexicalNode:props.codeBlockNode},React__default.createElement(Editor,{...restProps}))};function $createCodeBlockNode(options){const{code:code2="",language:language="",meta:meta=""}=options;return new CodeBlockNode(code2,language,meta)}function $convertPreElement(element2){const preElement=element2,code2=preElement.textContent,classAttribute=element2.getAttribute("class")??"",dataLanguageAttribute=element2.getAttribute("data-language")??"",languageMatch=/language-(\w+)/.exec(classAttribute);return{node:$createCodeBlockNode({code:code2,language:languageMatch?languageMatch[1]:dataLanguageAttribute,meta:preElement.getAttribute("data-meta")??""})}}const CodeBlockVisitor={testLexicalNode:function(node2){return node2 instanceof CodeBlockNode},visitLexicalNode:({lexicalNode:lexicalNode,actions:actions})=>{actions.addAndStepInto("code",{value:lexicalNode.getCode(),lang:lexicalNode.getLanguage(),meta:lexicalNode.getMeta()})}},MdastCodeVisitor={testNode:(node2,{codeBlockEditorDescriptors:codeBlockEditorDescriptors})=>{if("code"===node2.type){return void 0!==codeBlockEditorDescriptors.find(descriptor2=>descriptor2.match(node2.lang,node2.meta))}return!1},visitNode({mdastNode:mdastNode,actions:actions}){actions.addAndStepInto($createCodeBlockNode({code:mdastNode.value,language:mdastNode.lang??"",meta:mdastNode.meta??""}))}},defaultCodeBlockLanguage$=$$4(""),insertCodeBlock$=K$3(r2=>{r2.link(r2.pipe(insertCodeBlock$,tt$4(defaultCodeBlockLanguage$),_$3(([payload,defaultCodeBlockLanguage])=>()=>$createCodeBlockNode({language:defaultCodeBlockLanguage,...payload}))),insertDecoratorNode$)}),appendCodeBlockEditorDescriptor$=Appender(codeBlockEditorDescriptors$),codeBlockPlugin=realmPlugin({update(realm,params){realm.pub(defaultCodeBlockLanguage$,(null==params?void 0:params.defaultCodeBlockLanguage)??"")},init(realm,params){realm.pubIn({[addActivePlugin$]:"codeblock",[codeBlockEditorDescriptors$]:(null==params?void 0:params.codeBlockEditorDescriptors)??[],[addImportVisitor$]:MdastCodeVisitor,[addLexicalNode$]:CodeBlockNode,[addExportVisitor$]:CodeBlockVisitor})}});function legacy(parser){return new LanguageSupport(StreamLanguage.define(parser))}function sql(dialectName){return __vitePreload(()=>import("./vendor-codemirror-z6VSi4ab.js").then(n2=>n2.aC),__vite__mapDeps([0,1])).then(m3=>m3.sql({dialect:m3[dialectName]}))}const languages=[LanguageDescription.of({name:"C",extensions:["c","h","ino"],load:()=>__vitePreload(()=>import("./vendor-codemirror-z6VSi4ab.js").then(n2=>n2.at),__vite__mapDeps([0,1])).then(m3=>m3.cpp())}),LanguageDescription.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load:()=>__vitePreload(()=>import("./vendor-codemirror-z6VSi4ab.js").then(n2=>n2.at),__vite__mapDeps([0,1])).then(m3=>m3.cpp())}),LanguageDescription.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load:()=>sql("Cassandra")}),LanguageDescription.of({name:"CSS",extensions:["css"],load:()=>__vitePreload(()=>import("./vendor-codemirror-z6VSi4ab.js").then(n2=>n2.av),__vite__mapDeps([0,1])).then(m3=>m3.css())}),LanguageDescription.of({name:"Go",extensions:["go"],load:()=>__vitePreload(()=>import("./vendor-codemirror-z6VSi4ab.js").then(n2=>n2.aD),__vite__mapDeps([0,1])).then(m3=>m3.go())}),LanguageDescription.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load:()=>__vitePreload(()=>import("./vendor-codemirror-z6VSi4ab.js").then(n2=>n2.aw),__vite__mapDeps([0,1])).then(m3=>m3.html())}),LanguageDescription.of({name:"Java",extensions:["java"],load:()=>__vitePreload(()=>import("./vendor-codemirror-z6VSi4ab.js").then(n2=>n2.as),__vite__mapDeps([0,1])).then(m3=>m3.java())}),LanguageDescription.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load:()=>__vitePreload(()=>import("./vendor-codemirror-z6VSi4ab.js").then(n2=>n2.aq),__vite__mapDeps([0,1])).then(m3=>m3.javascript())}),LanguageDescription.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load:()=>__vitePreload(()=>import("./index-SMWE-umF.js"),__vite__mapDeps([2,0,1])).then(m3=>m3.jinja())}),LanguageDescription.of({name:"JSON",alias:["json5"],extensions:["json","map"],load:()=>__vitePreload(()=>import("./vendor-codemirror-z6VSi4ab.js").then(n2=>n2.az),__vite__mapDeps([0,1])).then(m3=>m3.json())}),LanguageDescription.of({name:"JSX",extensions:["jsx"],load:()=>__vitePreload(()=>import("./vendor-codemirror-z6VSi4ab.js").then(n2=>n2.aq),__vite__mapDeps([0,1])).then(m3=>m3.javascript({jsx:!0}))}),LanguageDescription.of({name:"LESS",extensions:["less"],load:()=>__vitePreload(()=>import("./index-CG43hSOO.js"),__vite__mapDeps([3,0,1])).then(m3=>m3.less())}),LanguageDescription.of({name:"Liquid",extensions:["liquid"],load:()=>__vitePreload(()=>import("./index-DqxWEMZG.js"),__vite__mapDeps([4,0,1])).then(m3=>m3.liquid())}),LanguageDescription.of({name:"MariaDB SQL",load:()=>sql("MariaSQL")}),LanguageDescription.of({name:"Markdown",extensions:["md","markdown","mkd"],load:()=>__vitePreload(()=>import("./vendor-codemirror-z6VSi4ab.js").then(n2=>n2.aB),__vite__mapDeps([0,1])).then(m3=>m3.markdown())}),LanguageDescription.of({name:"MS SQL",load:()=>sql("MSSQL")}),LanguageDescription.of({name:"MySQL",load:()=>sql("MySQL")}),LanguageDescription.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load:()=>__vitePreload(()=>import("./vendor-codemirror-z6VSi4ab.js").then(n2=>n2.ax),__vite__mapDeps([0,1])).then(m3=>m3.php())}),LanguageDescription.of({name:"PLSQL",extensions:["pls"],load:()=>sql("PLSQL")}),LanguageDescription.of({name:"PostgreSQL",load:()=>sql("PostgreSQL")}),LanguageDescription.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load:()=>__vitePreload(()=>import("./vendor-codemirror-z6VSi4ab.js").then(n2=>n2.ar),__vite__mapDeps([0,1])).then(m3=>m3.python())}),LanguageDescription.of({name:"Rust",extensions:["rs"],load:()=>__vitePreload(()=>import("./vendor-codemirror-z6VSi4ab.js").then(n2=>n2.au),__vite__mapDeps([0,1])).then(m3=>m3.rust())}),LanguageDescription.of({name:"Sass",extensions:["sass"],load:()=>__vitePreload(()=>import("./index-DYZfyIFS.js"),__vite__mapDeps([5,0,1])).then(m3=>m3.sass({indented:!0}))}),LanguageDescription.of({name:"SCSS",extensions:["scss"],load:()=>__vitePreload(()=>import("./index-DYZfyIFS.js"),__vite__mapDeps([5,0,1])).then(m3=>m3.sass())}),LanguageDescription.of({name:"SQL",extensions:["sql"],load:()=>sql("StandardSQL")}),LanguageDescription.of({name:"SQLite",load:()=>sql("SQLite")}),LanguageDescription.of({name:"TSX",extensions:["tsx"],load:()=>__vitePreload(()=>import("./vendor-codemirror-z6VSi4ab.js").then(n2=>n2.aq),__vite__mapDeps([0,1])).then(m3=>m3.javascript({jsx:!0,typescript:!0}))}),LanguageDescription.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load:()=>__vitePreload(()=>import("./vendor-codemirror-z6VSi4ab.js").then(n2=>n2.aq),__vite__mapDeps([0,1])).then(m3=>m3.javascript({typescript:!0}))}),LanguageDescription.of({name:"WebAssembly",extensions:["wat","wast"],load:()=>__vitePreload(()=>import("./index-DH6neeAn.js"),__vite__mapDeps([6,0,1])).then(m3=>m3.wast())}),LanguageDescription.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load:()=>__vitePreload(()=>import("./vendor-codemirror-z6VSi4ab.js").then(n2=>n2.ay),__vite__mapDeps([0,1])).then(m3=>m3.xml())}),LanguageDescription.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load:()=>__vitePreload(()=>import("./vendor-codemirror-z6VSi4ab.js").then(n2=>n2.aA),__vite__mapDeps([0,1])).then(m3=>m3.yaml())}),LanguageDescription.of({name:"APL",extensions:["dyalog","apl"],load:()=>__vitePreload(()=>import("./apl-B8ZmNFqK.js"),[]).then(m3=>legacy(m3.apl))}),LanguageDescription.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load:()=>__vitePreload(()=>import("./asciiarmor-CIte6N-S.js"),[]).then(m3=>legacy(m3.asciiArmor))}),LanguageDescription.of({name:"ASN.1",extensions:["asn","asn1"],load:()=>__vitePreload(()=>import("./asn1-Ax1-z1nk.js"),[]).then(m3=>legacy(m3.asn1({})))}),LanguageDescription.of({name:"Asterisk",filename:/^extensions\.conf$/i,load:()=>__vitePreload(()=>import("./asterisk-CLHf-iRz.js"),[]).then(m3=>legacy(m3.asterisk))}),LanguageDescription.of({name:"Brainfuck",extensions:["b","bf"],load:()=>__vitePreload(()=>import("./brainfuck-CdLnmYpe.js"),[]).then(m3=>legacy(m3.brainfuck))}),LanguageDescription.of({name:"Cobol",extensions:["cob","cpy"],load:()=>__vitePreload(()=>import("./cobol-DN1mHbgw.js"),[]).then(m3=>legacy(m3.cobol))}),LanguageDescription.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load:()=>__vitePreload(()=>import("./clike-BDgEuk0n.js"),[]).then(m3=>legacy(m3.csharp))}),LanguageDescription.of({name:"Clojure",extensions:["clj","cljc","cljx"],load:()=>__vitePreload(()=>import("./clojure-CrPxgQZl.js"),[]).then(m3=>legacy(m3.clojure))}),LanguageDescription.of({name:"ClojureScript",extensions:["cljs"],load:()=>__vitePreload(()=>import("./clojure-CrPxgQZl.js"),[]).then(m3=>legacy(m3.clojure))}),LanguageDescription.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load:()=>__vitePreload(()=>import("./css-BeQRP3p5.js"),[]).then(m3=>legacy(m3.gss))}),LanguageDescription.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load:()=>__vitePreload(()=>import("./cmake-BknZiLBu.js"),[]).then(m3=>legacy(m3.cmake))}),LanguageDescription.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load:()=>__vitePreload(()=>import("./coffeescript-DTAwRC7M.js"),[]).then(m3=>legacy(m3.coffeeScript))}),LanguageDescription.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load:()=>__vitePreload(()=>import("./commonlisp-B4DJ--Bo.js"),[]).then(m3=>legacy(m3.commonLisp))}),LanguageDescription.of({name:"Cypher",extensions:["cyp","cypher"],load:()=>__vitePreload(()=>import("./cypher-BzELKutH.js"),[]).then(m3=>legacy(m3.cypher))}),LanguageDescription.of({name:"Cython",extensions:["pyx","pxd","pxi"],load:()=>__vitePreload(()=>import("./python-BSflc812.js"),[]).then(m3=>legacy(m3.cython))}),LanguageDescription.of({name:"Crystal",extensions:["cr"],load:()=>__vitePreload(()=>import("./crystal-DoipYOOv.js"),[]).then(m3=>legacy(m3.crystal))}),LanguageDescription.of({name:"D",extensions:["d"],load:()=>__vitePreload(()=>import("./d-Mh2Rawoc.js"),[]).then(m3=>legacy(m3.d))}),LanguageDescription.of({name:"Dart",extensions:["dart"],load:()=>__vitePreload(()=>import("./clike-BDgEuk0n.js"),[]).then(m3=>legacy(m3.dart))}),LanguageDescription.of({name:"diff",extensions:["diff","patch"],load:()=>__vitePreload(()=>import("./diff-B1OtBbfz.js"),[]).then(m3=>legacy(m3.diff))}),LanguageDescription.of({name:"Dockerfile",filename:/^Dockerfile$/,load:()=>__vitePreload(()=>import("./dockerfile-Du7niAGi.js"),__vite__mapDeps([7,8])).then(m3=>legacy(m3.dockerFile))}),LanguageDescription.of({name:"DTD",extensions:["dtd"],load:()=>__vitePreload(()=>import("./dtd-So5hjSa8.js"),[]).then(m3=>legacy(m3.dtd))}),LanguageDescription.of({name:"Dylan",extensions:["dylan","dyl","intr"],load:()=>__vitePreload(()=>import("./dylan-Co15g-RX.js"),[]).then(m3=>legacy(m3.dylan))}),LanguageDescription.of({name:"EBNF",load:()=>__vitePreload(()=>import("./ebnf-DWrAnno4.js"),[]).then(m3=>legacy(m3.ebnf))}),LanguageDescription.of({name:"ECL",extensions:["ecl"],load:()=>__vitePreload(()=>import("./ecl-8tbf0rUT.js"),[]).then(m3=>legacy(m3.ecl))}),LanguageDescription.of({name:"edn",extensions:["edn"],load:()=>__vitePreload(()=>import("./clojure-CrPxgQZl.js"),[]).then(m3=>legacy(m3.clojure))}),LanguageDescription.of({name:"Eiffel",extensions:["e"],load:()=>__vitePreload(()=>import("./eiffel-BXtlUtEg.js"),[]).then(m3=>legacy(m3.eiffel))}),LanguageDescription.of({name:"Elm",extensions:["elm"],load:()=>__vitePreload(()=>import("./elm-BwiUluiH.js"),[]).then(m3=>legacy(m3.elm))}),LanguageDescription.of({name:"Erlang",extensions:["erl"],load:()=>__vitePreload(()=>import("./erlang-CrHBLi-m.js"),[]).then(m3=>legacy(m3.erlang))}),LanguageDescription.of({name:"Esper",load:()=>__vitePreload(()=>import("./sql-CbOjXfBR.js"),[]).then(m3=>legacy(m3.esper))}),LanguageDescription.of({name:"Factor",extensions:["factor"],load:()=>__vitePreload(()=>import("./factor-C7nC06Ta.js"),__vite__mapDeps([9,8])).then(m3=>legacy(m3.factor))}),LanguageDescription.of({name:"FCL",load:()=>__vitePreload(()=>import("./fcl-DKWfryFT.js"),[]).then(m3=>legacy(m3.fcl))}),LanguageDescription.of({name:"Forth",extensions:["forth","fth","4th"],load:()=>__vitePreload(()=>import("./forth-Cg8ASoTj.js"),[]).then(m3=>legacy(m3.forth))}),LanguageDescription.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load:()=>__vitePreload(()=>import("./fortran-BHf_qfFx.js"),[]).then(m3=>legacy(m3.fortran))}),LanguageDescription.of({name:"F#",alias:["fsharp"],extensions:["fs"],load:()=>__vitePreload(()=>import("./mllike-naqhAFf1.js"),[]).then(m3=>legacy(m3.fSharp))}),LanguageDescription.of({name:"Gas",extensions:["s"],load:()=>__vitePreload(()=>import("./gas-cj_2N_z1.js"),[]).then(m3=>legacy(m3.gas))}),LanguageDescription.of({name:"Gherkin",extensions:["feature"],load:()=>__vitePreload(()=>import("./gherkin-BiuTaH40.js"),[]).then(m3=>legacy(m3.gherkin))}),LanguageDescription.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load:()=>__vitePreload(()=>import("./groovy-Bq8cXYUU.js"),[]).then(m3=>legacy(m3.groovy))}),LanguageDescription.of({name:"Haskell",extensions:["hs"],load:()=>__vitePreload(()=>import("./haskell-1ANuaeie.js"),[]).then(m3=>legacy(m3.haskell))}),LanguageDescription.of({name:"Haxe",extensions:["hx"],load:()=>__vitePreload(()=>import("./haxe-BUNSvWf_.js"),[]).then(m3=>legacy(m3.haxe))}),LanguageDescription.of({name:"HXML",extensions:["hxml"],load:()=>__vitePreload(()=>import("./haxe-BUNSvWf_.js"),[]).then(m3=>legacy(m3.hxml))}),LanguageDescription.of({name:"HTTP",load:()=>__vitePreload(()=>import("./http-DPC2IRQA.js"),[]).then(m3=>legacy(m3.http))}),LanguageDescription.of({name:"IDL",extensions:["pro"],load:()=>__vitePreload(()=>import("./idl-DDbIciu_.js"),[]).then(m3=>legacy(m3.idl))}),LanguageDescription.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load:()=>__vitePreload(()=>import("./javascript-Cet1BUca.js"),[]).then(m3=>legacy(m3.jsonld))}),LanguageDescription.of({name:"Julia",extensions:["jl"],load:()=>__vitePreload(()=>import("./julia-CdxLCr68.js"),[]).then(m3=>legacy(m3.julia))}),LanguageDescription.of({name:"Kotlin",extensions:["kt","kts"],load:()=>__vitePreload(()=>import("./clike-BDgEuk0n.js"),[]).then(m3=>legacy(m3.kotlin))}),LanguageDescription.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load:()=>__vitePreload(()=>import("./livescript-Bw1Vw7Ae.js"),[]).then(m3=>legacy(m3.liveScript))}),LanguageDescription.of({name:"Lua",extensions:["lua"],load:()=>__vitePreload(()=>import("./lua-DR965aq8.js"),[]).then(m3=>legacy(m3.lua))}),LanguageDescription.of({name:"mIRC",extensions:["mrc"],load:()=>__vitePreload(()=>import("./mirc-CMLrLVMT.js"),[]).then(m3=>legacy(m3.mirc))}),LanguageDescription.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load:()=>__vitePreload(()=>import("./mathematica-BXSv1_O1.js"),[]).then(m3=>legacy(m3.mathematica))}),LanguageDescription.of({name:"Modelica",extensions:["mo"],load:()=>__vitePreload(()=>import("./modelica-BvadsaHY.js"),[]).then(m3=>legacy(m3.modelica))}),LanguageDescription.of({name:"MUMPS",extensions:["mps"],load:()=>__vitePreload(()=>import("./mumps-DKTl5Nyj.js"),[]).then(m3=>legacy(m3.mumps))}),LanguageDescription.of({name:"Mbox",extensions:["mbox"],load:()=>__vitePreload(()=>import("./mbox-CWY0keg3.js"),[]).then(m3=>legacy(m3.mbox))}),LanguageDescription.of({name:"Nginx",filename:/nginx.*\.conf$/i,load:()=>__vitePreload(()=>import("./nginx-DWR90-d1.js"),[]).then(m3=>legacy(m3.nginx))}),LanguageDescription.of({name:"NSIS",extensions:["nsh","nsi"],load:()=>__vitePreload(()=>import("./nsis-ooFGduGn.js"),__vite__mapDeps([10,8])).then(m3=>legacy(m3.nsis))}),LanguageDescription.of({name:"NTriples",extensions:["nt","nq"],load:()=>__vitePreload(()=>import("./ntriples-q5jkU4X1.js"),[]).then(m3=>legacy(m3.ntriples))}),LanguageDescription.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load:()=>__vitePreload(()=>import("./clike-BDgEuk0n.js"),[]).then(m3=>legacy(m3.objectiveC))}),LanguageDescription.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load:()=>__vitePreload(()=>import("./clike-BDgEuk0n.js"),[]).then(m3=>legacy(m3.objectiveCpp))}),LanguageDescription.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load:()=>__vitePreload(()=>import("./mllike-naqhAFf1.js"),[]).then(m3=>legacy(m3.oCaml))}),LanguageDescription.of({name:"Octave",extensions:["m"],load:()=>__vitePreload(()=>import("./octave-Deu9Ci7_.js"),[]).then(m3=>legacy(m3.octave))}),LanguageDescription.of({name:"Oz",extensions:["oz"],load:()=>__vitePreload(()=>import("./oz-cTQm1aoB.js"),[]).then(m3=>legacy(m3.oz))}),LanguageDescription.of({name:"Pascal",extensions:["p","pas"],load:()=>__vitePreload(()=>import("./pascal-Oh3VmczP.js"),[]).then(m3=>legacy(m3.pascal))}),LanguageDescription.of({name:"Perl",extensions:["pl","pm"],load:()=>__vitePreload(()=>import("./perl-BddWF1HQ.js"),[]).then(m3=>legacy(m3.perl))}),LanguageDescription.of({name:"Pig",extensions:["pig"],load:()=>__vitePreload(()=>import("./pig-g5ZQNIDr.js"),[]).then(m3=>legacy(m3.pig))}),LanguageDescription.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load:()=>__vitePreload(()=>import("./powershell-CNmQNFVJ.js"),[]).then(m3=>legacy(m3.powerShell))}),LanguageDescription.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load:()=>__vitePreload(()=>import("./properties-B41DXfv6.js"),[]).then(m3=>legacy(m3.properties))}),LanguageDescription.of({name:"ProtoBuf",extensions:["proto"],load:()=>__vitePreload(()=>import("./protobuf-eEBl31OJ.js"),[]).then(m3=>legacy(m3.protobuf))}),LanguageDescription.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load:()=>__vitePreload(()=>import("./pug-DRSo4eCK.js"),__vite__mapDeps([11,12])).then(m3=>legacy(m3.pug))}),LanguageDescription.of({name:"Puppet",extensions:["pp"],load:()=>__vitePreload(()=>import("./puppet-ClfRubAD.js"),[]).then(m3=>legacy(m3.puppet))}),LanguageDescription.of({name:"Q",extensions:["q"],load:()=>__vitePreload(()=>import("./q-BBDx3N9Y.js"),[]).then(m3=>legacy(m3.q))}),LanguageDescription.of({name:"R",alias:["rscript"],extensions:["r","R"],load:()=>__vitePreload(()=>import("./r-CByC1eO8.js"),[]).then(m3=>legacy(m3.r))}),LanguageDescription.of({name:"RPM Changes",load:()=>__vitePreload(()=>import("./rpm-8t935XkD.js"),[]).then(m3=>legacy(m3.rpmChanges))}),LanguageDescription.of({name:"RPM Spec",extensions:["spec"],load:()=>__vitePreload(()=>import("./rpm-8t935XkD.js"),[]).then(m3=>legacy(m3.rpmSpec))}),LanguageDescription.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load:()=>__vitePreload(()=>import("./ruby-CAgbkLZh.js"),[]).then(m3=>legacy(m3.ruby))}),LanguageDescription.of({name:"SAS",extensions:["sas"],load:()=>__vitePreload(()=>import("./sas-C-JWcRvo.js"),[]).then(m3=>legacy(m3.sas))}),LanguageDescription.of({name:"Scala",extensions:["scala"],load:()=>__vitePreload(()=>import("./clike-BDgEuk0n.js"),[]).then(m3=>legacy(m3.scala))}),LanguageDescription.of({name:"Scheme",extensions:["scm","ss"],load:()=>__vitePreload(()=>import("./scheme-D7o9RjUX.js"),[]).then(m3=>legacy(m3.scheme))}),LanguageDescription.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load:()=>__vitePreload(()=>import("./shell-BXA79DV6.js"),[]).then(m3=>legacy(m3.shell))}),LanguageDescription.of({name:"Sieve",extensions:["siv","sieve"],load:()=>__vitePreload(()=>import("./sieve-DNwyl0rd.js"),[]).then(m3=>legacy(m3.sieve))}),LanguageDescription.of({name:"Smalltalk",extensions:["st"],load:()=>__vitePreload(()=>import("./smalltalk-DggktV6S.js"),[]).then(m3=>legacy(m3.smalltalk))}),LanguageDescription.of({name:"Solr",load:()=>__vitePreload(()=>import("./solr-D7NRuIPM.js"),[]).then(m3=>legacy(m3.solr))}),LanguageDescription.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load:()=>__vitePreload(()=>import("./mllike-naqhAFf1.js"),[]).then(m3=>legacy(m3.sml))}),LanguageDescription.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load:()=>__vitePreload(()=>import("./sparql-Cr71deJQ.js"),[]).then(m3=>legacy(m3.sparql))}),LanguageDescription.of({name:"Spreadsheet",alias:["excel","formula"],load:()=>__vitePreload(()=>import("./spreadsheet-BMD3tYqw.js"),[]).then(m3=>legacy(m3.spreadsheet))}),LanguageDescription.of({name:"Squirrel",extensions:["nut"],load:()=>__vitePreload(()=>import("./clike-BDgEuk0n.js"),[]).then(m3=>legacy(m3.squirrel))}),LanguageDescription.of({name:"Stylus",extensions:["styl"],load:()=>__vitePreload(()=>import("./stylus-nWZizI-c.js"),[]).then(m3=>legacy(m3.stylus))}),LanguageDescription.of({name:"Swift",extensions:["swift"],load:()=>__vitePreload(()=>import("./swift-DOhLK5SG.js"),[]).then(m3=>legacy(m3.swift))}),LanguageDescription.of({name:"sTeX",load:()=>__vitePreload(()=>import("./stex-iDPIkRmr.js"),[]).then(m3=>legacy(m3.stex))}),LanguageDescription.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load:()=>__vitePreload(()=>import("./stex-iDPIkRmr.js"),[]).then(m3=>legacy(m3.stex))}),LanguageDescription.of({name:"SystemVerilog",extensions:["v","sv","svh"],load:()=>__vitePreload(()=>import("./verilog-nrfFvR12.js"),[]).then(m3=>legacy(m3.verilog))}),LanguageDescription.of({name:"Tcl",extensions:["tcl"],load:()=>__vitePreload(()=>import("./tcl-CQhJd1WY.js"),[]).then(m3=>legacy(m3.tcl))}),LanguageDescription.of({name:"Textile",extensions:["textile"],load:()=>__vitePreload(()=>import("./textile-D9XqfVtL.js"),[]).then(m3=>legacy(m3.textile))}),LanguageDescription.of({name:"TiddlyWiki",load:()=>__vitePreload(()=>import("./tiddlywiki-DfOYgVky.js"),[]).then(m3=>legacy(m3.tiddlyWiki))}),LanguageDescription.of({name:"Tiki wiki",load:()=>__vitePreload(()=>import("./tiki-a0_YLWvV.js"),[]).then(m3=>legacy(m3.tiki))}),LanguageDescription.of({name:"TOML",extensions:["toml"],load:()=>__vitePreload(()=>import("./toml-ekl3F1YB.js"),[]).then(m3=>legacy(m3.toml))}),LanguageDescription.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load:()=>__vitePreload(()=>import("./troff-Bh_pcXF1.js"),[]).then(m3=>legacy(m3.troff))}),LanguageDescription.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load:()=>__vitePreload(()=>import("./ttcn-M6363IRW.js"),[]).then(m3=>legacy(m3.ttcn))}),LanguageDescription.of({name:"TTCN_CFG",extensions:["cfg"],load:()=>__vitePreload(()=>import("./ttcn-cfg-7I2DgJEN.js"),[]).then(m3=>legacy(m3.ttcnCfg))}),LanguageDescription.of({name:"Turtle",extensions:["ttl"],load:()=>__vitePreload(()=>import("./turtle-B5jdxH6D.js"),[]).then(m3=>legacy(m3.turtle))}),LanguageDescription.of({name:"Web IDL",extensions:["webidl"],load:()=>__vitePreload(()=>import("./webidl-RIQoSXDx.js"),[]).then(m3=>legacy(m3.webIDL))}),LanguageDescription.of({name:"VB.NET",extensions:["vb"],load:()=>__vitePreload(()=>import("./vb-DM-xPmVv.js"),[]).then(m3=>legacy(m3.vb))}),LanguageDescription.of({name:"VBScript",extensions:["vbs"],load:()=>__vitePreload(()=>import("./vbscript-B0qu41Yc.js"),[]).then(m3=>legacy(m3.vbScript))}),LanguageDescription.of({name:"Velocity",extensions:["vtl"],load:()=>__vitePreload(()=>import("./velocity-FCgsuVHf.js"),[]).then(m3=>legacy(m3.velocity))}),LanguageDescription.of({name:"Verilog",extensions:["v"],load:()=>__vitePreload(()=>import("./verilog-nrfFvR12.js"),[]).then(m3=>legacy(m3.verilog))}),LanguageDescription.of({name:"VHDL",extensions:["vhd","vhdl"],load:()=>__vitePreload(()=>import("./vhdl-WlDXtV-W.js"),[]).then(m3=>legacy(m3.vhdl))}),LanguageDescription.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load:()=>__vitePreload(()=>import("./xquery-BN45G3lJ.js"),[]).then(m3=>legacy(m3.xQuery))}),LanguageDescription.of({name:"Yacas",extensions:["ys"],load:()=>__vitePreload(()=>import("./yacas-U6gaIVhD.js"),[]).then(m3=>legacy(m3.yacas))}),LanguageDescription.of({name:"Z80",extensions:["z80"],load:()=>__vitePreload(()=>import("./z80-CFe5BHbK.js"),[]).then(m3=>legacy(m3.z80))}),LanguageDescription.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load:()=>__vitePreload(()=>import("./mscgen-DOr-Q10p.js"),[]).then(m3=>legacy(m3.mscgen))}),LanguageDescription.of({name:"Xù",extensions:["xu"],load:()=>__vitePreload(()=>import("./mscgen-DOr-Q10p.js"),[]).then(m3=>legacy(m3.xu))}),LanguageDescription.of({name:"MsGenny",extensions:["msgenny"],load:()=>__vitePreload(()=>import("./mscgen-DOr-Q10p.js"),[]).then(m3=>legacy(m3.msgenny))}),LanguageDescription.of({name:"Vue",extensions:["vue"],load:()=>__vitePreload(()=>import("./index-CL43Q_T6.js"),__vite__mapDeps([13,0,1])).then(m3=>m3.vue())}),LanguageDescription.of({name:"Angular Template",load:()=>__vitePreload(()=>import("./index-Zcwywgin.js"),__vite__mapDeps([14,0,1])).then(m3=>m3.angular())})],base0A="#5e81ac",base0C="#d08770",basicLightTheme=EditorView.theme({"&":{color:"#2e3440",backgroundColor:"#ffffff"},".cm-content":{caretColor:"#3b4252"},".cm-cursor, .cm-dropCursor":{borderLeftColor:"#3b4252"},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"#eceff4"},".cm-panels":{backgroundColor:"#eceff4",color:"#4c566a"},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #4c566a"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#e5e9f0"},".cm-activeLine":{backgroundColor:"#eceff4"},".cm-selectionMatch":{backgroundColor:"#e5e9f0"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{outline:"1px solid #4c566a"},"&.cm-focused .cm-matchingBracket":{backgroundColor:"#eceff4"},".cm-gutters":{backgroundColor:"#eceff4",color:"#2e3440",border:"none"},".cm-activeLineGutter":{backgroundColor:"#eceff4"},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:"#3b4252"},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:"#3b4252",borderBottomColor:"#3b4252"},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:"#eceff4",color:"#4c566a"}}},{dark:!1}),basicLightHighlightStyle=HighlightStyle.define([{tag:tags.keyword,color:base0A},{tag:[tags.name,tags.deleted,tags.character,tags.propertyName,tags.macroName],color:base0C},{tag:[tags.variableName],color:base0C},{tag:[tags.function(tags.variableName)],color:base0A},{tag:[tags.labelName],color:"#81a1c1"},{tag:[tags.color,tags.constant(tags.name),tags.standard(tags.name)],color:base0A},{tag:[tags.definition(tags.name),tags.separator],color:"#a3be8c"},{tag:[tags.brace],color:"#8fbcbb"},{tag:[tags.annotation],color:"#d30102"},{tag:[tags.number,tags.changed,tags.annotation,tags.modifier,tags.self,tags.namespace],color:"#88c0d0"},{tag:[tags.typeName,tags.className],color:"#ebcb8b"},{tag:[tags.operator,tags.operatorKeyword],color:"#a3be8c"},{tag:[tags.tagName],color:"#b48ead"},{tag:[tags.squareBracket],color:"#bf616a"},{tag:[tags.angleBracket],color:base0C},{tag:[tags.attributeName],color:"#ebcb8b"},{tag:[tags.regexp],color:base0A},{tag:[tags.quote],color:"#3b4252"},{tag:[tags.string],color:base0C},{tag:tags.link,color:"#8fbcbb",textDecoration:"underline",textUnderlinePosition:"under"},{tag:[tags.url,tags.escape,tags.special(tags.string)],color:base0C},{tag:[tags.meta],color:"#88c0d0"},{tag:[tags.comment],color:"#434c5e",fontStyle:"italic"},{tag:tags.strong,fontWeight:"bold",color:base0A},{tag:tags.emphasis,fontStyle:"italic",color:base0A},{tag:tags.strikethrough,textDecoration:"line-through"},{tag:tags.heading,fontWeight:"bold",color:base0A},{tag:tags.special(tags.heading1),fontWeight:"bold",color:base0A},{tag:tags.heading1,fontWeight:"bold",color:base0A},{tag:[tags.heading2,tags.heading3,tags.heading4],fontWeight:"bold",color:base0A},{tag:[tags.heading5,tags.heading6],color:base0A},{tag:[tags.atom,tags.bool,tags.special(tags.variableName)],color:base0C},{tag:[tags.processingInstruction,tags.inserted],color:"#8fbcbb"},{tag:[tags.contentSeparator],color:"#ebcb8b"},{tag:tags.invalid,color:"#434c5e",borderBottom:"1px dotted #d30102"}]),basicLight=[basicLightTheme,syntaxHighlighting(basicLightHighlightStyle)],basicSetup=(()=>[lineNumbers(),highlightActiveLineGutter(),highlightSpecialChars(),history(),foldGutter(),drawSelection(),dropCursor(),EditorState.allowMultipleSelections.of(!0),indentOnInput(),syntaxHighlighting(defaultHighlightStyle,{fallback:!0}),bracketMatching(),closeBrackets(),autocompletion(),rectangularSelection(),crosshairCursor(),highlightActiveLine(),highlightSelectionMatches(),keymap.of([...closeBracketsKeymap,...defaultKeymap,...searchKeymap,...historyKeymap,...foldKeymap,...completionKeymap,...lintKeymap])])();function clamp(value,[min2,max2]){return Math.min(max2,Math.max(min2,value))}var VISUALLY_HIDDEN_STYLES=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),VisuallyHidden=reactExports.forwardRef((props,forwardedRef)=>jsxRuntimeExports.jsx(Primitive.span,{...props,ref:forwardedRef,style:{...VISUALLY_HIDDEN_STYLES,...props.style}}));VisuallyHidden.displayName="VisuallyHidden";var Root$1=VisuallyHidden,OPEN_KEYS=[" ","Enter","ArrowUp","ArrowDown"],SELECTION_KEYS=[" ","Enter"],[Collection,useCollection,createCollectionScope]=createCollection("Select"),[createSelectContext]=createContextScope("Select",[createCollectionScope,createPopperScope]),usePopperScope$1=createPopperScope(),[SelectProvider,useSelectContext]=createSelectContext("Select"),[SelectNativeOptionsProvider,useSelectNativeOptionsContext]=createSelectContext("Select"),Select$1=props=>{const{__scopeSelect:__scopeSelect,children:children,open:openProp,defaultOpen:defaultOpen,onOpenChange:onOpenChange,value:valueProp,defaultValue:defaultValue,onValueChange:onValueChange,dir:dir,name:name,autoComplete:autoComplete,disabled:disabled,required:required,form:form}=props,popperScope=usePopperScope$1(__scopeSelect),[trigger,setTrigger]=reactExports.useState(null),[valueNode,setValueNode]=reactExports.useState(null),[valueNodeHasChildren,setValueNodeHasChildren]=reactExports.useState(!1),direction=useDirection(dir),[open,setOpen]=useControllableState({prop:openProp,defaultProp:defaultOpen??!1,onChange:onOpenChange,caller:"Select"}),[value,setValue]=useControllableState({prop:valueProp,defaultProp:defaultValue,onChange:onValueChange,caller:"Select"}),triggerPointerDownPosRef=reactExports.useRef(null),isFormControl=!trigger||(form||!!trigger.closest("form")),[nativeOptionsSet,setNativeOptionsSet]=reactExports.useState(new Set),nativeSelectKey=Array.from(nativeOptionsSet).map(option=>option.props.value).join(";");return jsxRuntimeExports.jsx(Root2$3,{...popperScope,children:jsxRuntimeExports.jsxs(SelectProvider,{required:required,scope:__scopeSelect,trigger:trigger,onTriggerChange:setTrigger,valueNode:valueNode,onValueNodeChange:setValueNode,valueNodeHasChildren:valueNodeHasChildren,onValueNodeHasChildrenChange:setValueNodeHasChildren,contentId:useId(),value:value,onValueChange:setValue,open:open,onOpenChange:setOpen,dir:direction,triggerPointerDownPosRef:triggerPointerDownPosRef,disabled:disabled,children:[jsxRuntimeExports.jsx(Collection.Provider,{scope:__scopeSelect,children:jsxRuntimeExports.jsx(SelectNativeOptionsProvider,{scope:props.__scopeSelect,onNativeOptionAdd:reactExports.useCallback(option=>{setNativeOptionsSet(prev=>new Set(prev).add(option))},[]),onNativeOptionRemove:reactExports.useCallback(option=>{setNativeOptionsSet(prev=>{const optionsSet=new Set(prev);return optionsSet.delete(option),optionsSet})},[]),children:children})}),isFormControl?jsxRuntimeExports.jsxs(SelectBubbleInput,{"aria-hidden":!0,required:required,tabIndex:-1,name:name,autoComplete:autoComplete,value:value,onChange:event=>setValue(event.target.value),disabled:disabled,form:form,children:[void 0===value?jsxRuntimeExports.jsx("option",{value:""}):null,Array.from(nativeOptionsSet)]},nativeSelectKey):null]})})};Select$1.displayName="Select";var SelectTrigger$1=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeSelect:__scopeSelect,disabled:disabled=!1,...triggerProps}=props,popperScope=usePopperScope$1(__scopeSelect),context=useSelectContext("SelectTrigger",__scopeSelect),isDisabled=context.disabled||disabled,composedRefs=useComposedRefs(forwardedRef,context.onTriggerChange),getItems=useCollection(__scopeSelect),pointerTypeRef=reactExports.useRef("touch"),[searchRef,handleTypeaheadSearch,resetTypeahead]=useTypeaheadSearch(search2=>{const enabledItems=getItems().filter(item=>!item.disabled),currentItem=enabledItems.find(item=>item.value===context.value),nextItem=findNextItem(enabledItems,search2,currentItem);void 0!==nextItem&&context.onValueChange(nextItem.value)}),handleOpen=pointerEvent=>{isDisabled||(context.onOpenChange(!0),resetTypeahead()),pointerEvent&&(context.triggerPointerDownPosRef.current={x:Math.round(pointerEvent.pageX),y:Math.round(pointerEvent.pageY)})};return jsxRuntimeExports.jsx(Anchor,{asChild:!0,...popperScope,children:jsxRuntimeExports.jsx(Primitive.button,{type:"button",role:"combobox","aria-controls":context.contentId,"aria-expanded":context.open,"aria-required":context.required,"aria-autocomplete":"none",dir:context.dir,"data-state":context.open?"open":"closed",disabled:isDisabled,"data-disabled":isDisabled?"":void 0,"data-placeholder":shouldShowPlaceholder(context.value)?"":void 0,...triggerProps,ref:composedRefs,onClick:composeEventHandlers(triggerProps.onClick,event=>{event.currentTarget.focus(),"mouse"!==pointerTypeRef.current&&handleOpen(event)}),onPointerDown:composeEventHandlers(triggerProps.onPointerDown,event=>{pointerTypeRef.current=event.pointerType;const target=event.target;target.hasPointerCapture(event.pointerId)&&target.releasePointerCapture(event.pointerId),0===event.button&&!1===event.ctrlKey&&"mouse"===event.pointerType&&(handleOpen(event),event.preventDefault())}),onKeyDown:composeEventHandlers(triggerProps.onKeyDown,event=>{const isTypingAhead=""!==searchRef.current;event.ctrlKey||event.altKey||event.metaKey||1!==event.key.length||handleTypeaheadSearch(event.key),isTypingAhead&&" "===event.key||OPEN_KEYS.includes(event.key)&&(handleOpen(),event.preventDefault())})})})});SelectTrigger$1.displayName="SelectTrigger";var SelectValue=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeSelect:__scopeSelect,className:className,style:style,children:children,placeholder:placeholder2="",...valueProps}=props,context=useSelectContext("SelectValue",__scopeSelect),{onValueNodeHasChildrenChange:onValueNodeHasChildrenChange}=context,hasChildren=void 0!==children,composedRefs=useComposedRefs(forwardedRef,context.onValueNodeChange);return useLayoutEffect2(()=>{onValueNodeHasChildrenChange(hasChildren)},[onValueNodeHasChildrenChange,hasChildren]),jsxRuntimeExports.jsx(Primitive.span,{...valueProps,ref:composedRefs,style:{pointerEvents:"none"},children:shouldShowPlaceholder(context.value)?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:placeholder2}):children})});SelectValue.displayName="SelectValue";var SelectIcon=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeSelect:__scopeSelect,children:children,...iconProps}=props;return jsxRuntimeExports.jsx(Primitive.span,{"aria-hidden":!0,...iconProps,ref:forwardedRef,children:children||"▼"})});SelectIcon.displayName="SelectIcon";var SelectPortal=props=>jsxRuntimeExports.jsx(Portal$4,{asChild:!0,...props});SelectPortal.displayName="SelectPortal";var SelectContent$1=reactExports.forwardRef((props,forwardedRef)=>{const context=useSelectContext("SelectContent",props.__scopeSelect),[fragment,setFragment]=reactExports.useState();if(useLayoutEffect2(()=>{setFragment(new DocumentFragment)},[]),!context.open){const frag=fragment;return frag?reactDomExports.createPortal(jsxRuntimeExports.jsx(SelectContentProvider,{scope:props.__scopeSelect,children:jsxRuntimeExports.jsx(Collection.Slot,{scope:props.__scopeSelect,children:jsxRuntimeExports.jsx("div",{children:props.children})})}),frag):null}return jsxRuntimeExports.jsx(SelectContentImpl,{...props,ref:forwardedRef})});SelectContent$1.displayName="SelectContent";var CONTENT_MARGIN=10,[SelectContentProvider,useSelectContentContext]=createSelectContext("SelectContent"),Slot=createSlot("SelectContent.RemoveScroll"),SelectContentImpl=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeSelect:__scopeSelect,position:position2="item-aligned",onCloseAutoFocus:onCloseAutoFocus,onEscapeKeyDown:onEscapeKeyDown,onPointerDownOutside:onPointerDownOutside,side:side,sideOffset:sideOffset,align:align,alignOffset:alignOffset,arrowPadding:arrowPadding,collisionBoundary:collisionBoundary,collisionPadding:collisionPadding,sticky:sticky,hideWhenDetached:hideWhenDetached,avoidCollisions:avoidCollisions,...contentProps}=props,context=useSelectContext("SelectContent",__scopeSelect),[content2,setContent2]=reactExports.useState(null),[viewport,setViewport]=reactExports.useState(null),composedRefs=useComposedRefs(forwardedRef,node2=>setContent2(node2)),[selectedItem,setSelectedItem]=reactExports.useState(null),[selectedItemText,setSelectedItemText]=reactExports.useState(null),getItems=useCollection(__scopeSelect),[isPositioned,setIsPositioned]=reactExports.useState(!1),firstValidItemFoundRef=reactExports.useRef(!1);reactExports.useEffect(()=>{if(content2)return hideOthers(content2)},[content2]),useFocusGuards();const focusFirst2=reactExports.useCallback(candidates=>{const[firstItem,...restItems]=getItems().map(item=>item.ref.current),[lastItem]=restItems.slice(-1),PREVIOUSLY_FOCUSED_ELEMENT=document.activeElement;for(const candidate of candidates){if(candidate===PREVIOUSLY_FOCUSED_ELEMENT)return;if(null==candidate||candidate.scrollIntoView({block:"nearest"}),candidate===firstItem&&viewport&&(viewport.scrollTop=0),candidate===lastItem&&viewport&&(viewport.scrollTop=viewport.scrollHeight),null==candidate||candidate.focus(),document.activeElement!==PREVIOUSLY_FOCUSED_ELEMENT)return}},[getItems,viewport]),focusSelectedItem=reactExports.useCallback(()=>focusFirst2([selectedItem,content2]),[focusFirst2,selectedItem,content2]);reactExports.useEffect(()=>{isPositioned&&focusSelectedItem()},[isPositioned,focusSelectedItem]);const{onOpenChange:onOpenChange,triggerPointerDownPosRef:triggerPointerDownPosRef}=context;reactExports.useEffect(()=>{if(content2){let pointerMoveDelta={x:0,y:0};const handlePointerMove=event=>{var _a,_b;pointerMoveDelta={x:Math.abs(Math.round(event.pageX)-((null==(_a=triggerPointerDownPosRef.current)?void 0:_a.x)??0)),y:Math.abs(Math.round(event.pageY)-((null==(_b=triggerPointerDownPosRef.current)?void 0:_b.y)??0))}},handlePointerUp=event=>{pointerMoveDelta.x<=10&&pointerMoveDelta.y<=10?event.preventDefault():content2.contains(event.target)||onOpenChange(!1),document.removeEventListener("pointermove",handlePointerMove),triggerPointerDownPosRef.current=null};return null!==triggerPointerDownPosRef.current&&(document.addEventListener("pointermove",handlePointerMove),document.addEventListener("pointerup",handlePointerUp,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",handlePointerMove),document.removeEventListener("pointerup",handlePointerUp,{capture:!0})}}},[content2,onOpenChange,triggerPointerDownPosRef]),reactExports.useEffect(()=>{const close=()=>onOpenChange(!1);return window.addEventListener("blur",close),window.addEventListener("resize",close),()=>{window.removeEventListener("blur",close),window.removeEventListener("resize",close)}},[onOpenChange]);const[searchRef,handleTypeaheadSearch]=useTypeaheadSearch(search2=>{const enabledItems=getItems().filter(item=>!item.disabled),currentItem=enabledItems.find(item=>item.ref.current===document.activeElement),nextItem=findNextItem(enabledItems,search2,currentItem);nextItem&&setTimeout(()=>nextItem.ref.current.focus())}),itemRefCallback=reactExports.useCallback((node2,value,disabled)=>{const isFirstValidItem=!firstValidItemFoundRef.current&&!disabled;(void 0!==context.value&&context.value===value||isFirstValidItem)&&(setSelectedItem(node2),isFirstValidItem&&(firstValidItemFoundRef.current=!0))},[context.value]),handleItemLeave=reactExports.useCallback(()=>null==content2?void 0:content2.focus(),[content2]),itemTextRefCallback=reactExports.useCallback((node2,value,disabled)=>{const isFirstValidItem=!firstValidItemFoundRef.current&&!disabled;(void 0!==context.value&&context.value===value||isFirstValidItem)&&setSelectedItemText(node2)},[context.value]),SelectPosition="popper"===position2?SelectPopperPosition:SelectItemAlignedPosition,popperContentProps=SelectPosition===SelectPopperPosition?{side:side,sideOffset:sideOffset,align:align,alignOffset:alignOffset,arrowPadding:arrowPadding,collisionBoundary:collisionBoundary,collisionPadding:collisionPadding,sticky:sticky,hideWhenDetached:hideWhenDetached,avoidCollisions:avoidCollisions}:{};return jsxRuntimeExports.jsx(SelectContentProvider,{scope:__scopeSelect,content:content2,viewport:viewport,onViewportChange:setViewport,itemRefCallback:itemRefCallback,selectedItem:selectedItem,onItemLeave:handleItemLeave,itemTextRefCallback:itemTextRefCallback,focusSelectedItem:focusSelectedItem,selectedItemText:selectedItemText,position:position2,isPositioned:isPositioned,searchRef:searchRef,children:jsxRuntimeExports.jsx(ReactRemoveScroll,{as:Slot,allowPinchZoom:!0,children:jsxRuntimeExports.jsx(FocusScope,{asChild:!0,trapped:context.open,onMountAutoFocus:event=>{event.preventDefault()},onUnmountAutoFocus:composeEventHandlers(onCloseAutoFocus,event=>{var _a;null==(_a=context.trigger)||_a.focus({preventScroll:!0}),event.preventDefault()}),children:jsxRuntimeExports.jsx(DismissableLayer,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:onEscapeKeyDown,onPointerDownOutside:onPointerDownOutside,onFocusOutside:event=>event.preventDefault(),onDismiss:()=>context.onOpenChange(!1),children:jsxRuntimeExports.jsx(SelectPosition,{role:"listbox",id:context.contentId,"data-state":context.open?"open":"closed",dir:context.dir,onContextMenu:event=>event.preventDefault(),...contentProps,...popperContentProps,onPlaced:()=>setIsPositioned(!0),ref:composedRefs,style:{display:"flex",flexDirection:"column",outline:"none",...contentProps.style},onKeyDown:composeEventHandlers(contentProps.onKeyDown,event=>{const isModifierKey=event.ctrlKey||event.altKey||event.metaKey;if("Tab"===event.key&&event.preventDefault(),isModifierKey||1!==event.key.length||handleTypeaheadSearch(event.key),["ArrowUp","ArrowDown","Home","End"].includes(event.key)){let candidateNodes=getItems().filter(item=>!item.disabled).map(item=>item.ref.current);if(["ArrowUp","End"].includes(event.key)&&(candidateNodes=candidateNodes.slice().reverse()),["ArrowUp","ArrowDown"].includes(event.key)){const currentElement=event.target,currentIndex=candidateNodes.indexOf(currentElement);candidateNodes=candidateNodes.slice(currentIndex+1)}setTimeout(()=>focusFirst2(candidateNodes)),event.preventDefault()}})})})})})})});SelectContentImpl.displayName="SelectContentImpl";var SelectItemAlignedPosition=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeSelect:__scopeSelect,onPlaced:onPlaced,...popperProps}=props,context=useSelectContext("SelectContent",__scopeSelect),contentContext=useSelectContentContext("SelectContent",__scopeSelect),[contentWrapper,setContentWrapper]=reactExports.useState(null),[content2,setContent2]=reactExports.useState(null),composedRefs=useComposedRefs(forwardedRef,node2=>setContent2(node2)),getItems=useCollection(__scopeSelect),shouldExpandOnScrollRef=reactExports.useRef(!1),shouldRepositionRef=reactExports.useRef(!0),{viewport:viewport,selectedItem:selectedItem,selectedItemText:selectedItemText,focusSelectedItem:focusSelectedItem}=contentContext,position2=reactExports.useCallback(()=>{if(context.trigger&&context.valueNode&&contentWrapper&&content2&&viewport&&selectedItem&&selectedItemText){const triggerRect=context.trigger.getBoundingClientRect(),contentRect=content2.getBoundingClientRect(),valueNodeRect=context.valueNode.getBoundingClientRect(),itemTextRect=selectedItemText.getBoundingClientRect();if("rtl"!==context.dir){const itemTextOffset=itemTextRect.left-contentRect.left,left=valueNodeRect.left-itemTextOffset,leftDelta=triggerRect.left-left,minContentWidth=triggerRect.width+leftDelta,contentWidth=Math.max(minContentWidth,contentRect.width),rightEdge=window.innerWidth-CONTENT_MARGIN,clampedLeft=clamp(left,[CONTENT_MARGIN,Math.max(CONTENT_MARGIN,rightEdge-contentWidth)]);contentWrapper.style.minWidth=minContentWidth+"px",contentWrapper.style.left=clampedLeft+"px"}else{const itemTextOffset=contentRect.right-itemTextRect.right,right=window.innerWidth-valueNodeRect.right-itemTextOffset,rightDelta=window.innerWidth-triggerRect.right-right,minContentWidth=triggerRect.width+rightDelta,contentWidth=Math.max(minContentWidth,contentRect.width),leftEdge=window.innerWidth-CONTENT_MARGIN,clampedRight=clamp(right,[CONTENT_MARGIN,Math.max(CONTENT_MARGIN,leftEdge-contentWidth)]);contentWrapper.style.minWidth=minContentWidth+"px",contentWrapper.style.right=clampedRight+"px"}const items=getItems(),availableHeight=window.innerHeight-2*CONTENT_MARGIN,itemsHeight=viewport.scrollHeight,contentStyles=window.getComputedStyle(content2),contentBorderTopWidth=parseInt(contentStyles.borderTopWidth,10),contentPaddingTop=parseInt(contentStyles.paddingTop,10),contentBorderBottomWidth=parseInt(contentStyles.borderBottomWidth,10),fullContentHeight=contentBorderTopWidth+contentPaddingTop+itemsHeight+parseInt(contentStyles.paddingBottom,10)+contentBorderBottomWidth,minContentHeight=Math.min(5*selectedItem.offsetHeight,fullContentHeight),viewportStyles=window.getComputedStyle(viewport),viewportPaddingTop=parseInt(viewportStyles.paddingTop,10),viewportPaddingBottom=parseInt(viewportStyles.paddingBottom,10),topEdgeToTriggerMiddle=triggerRect.top+triggerRect.height/2-CONTENT_MARGIN,triggerMiddleToBottomEdge=availableHeight-topEdgeToTriggerMiddle,selectedItemHalfHeight=selectedItem.offsetHeight/2,contentTopToItemMiddle=contentBorderTopWidth+contentPaddingTop+(selectedItem.offsetTop+selectedItemHalfHeight),itemMiddleToContentBottom=fullContentHeight-contentTopToItemMiddle;if(contentTopToItemMiddle<=topEdgeToTriggerMiddle){const isLastItem=items.length>0&&selectedItem===items[items.length-1].ref.current;contentWrapper.style.bottom="0px";const viewportOffsetBottom=content2.clientHeight-viewport.offsetTop-viewport.offsetHeight,height=contentTopToItemMiddle+Math.max(triggerMiddleToBottomEdge,selectedItemHalfHeight+(isLastItem?viewportPaddingBottom:0)+viewportOffsetBottom+contentBorderBottomWidth);contentWrapper.style.height=height+"px"}else{const isFirstItem=items.length>0&&selectedItem===items[0].ref.current;contentWrapper.style.top="0px";const height=Math.max(topEdgeToTriggerMiddle,contentBorderTopWidth+viewport.offsetTop+(isFirstItem?viewportPaddingTop:0)+selectedItemHalfHeight)+itemMiddleToContentBottom;contentWrapper.style.height=height+"px",viewport.scrollTop=contentTopToItemMiddle-topEdgeToTriggerMiddle+viewport.offsetTop}contentWrapper.style.margin=`${CONTENT_MARGIN}px 0`,contentWrapper.style.minHeight=minContentHeight+"px",contentWrapper.style.maxHeight=availableHeight+"px",null==onPlaced||onPlaced(),requestAnimationFrame(()=>shouldExpandOnScrollRef.current=!0)}},[getItems,context.trigger,context.valueNode,contentWrapper,content2,viewport,selectedItem,selectedItemText,context.dir,onPlaced]);useLayoutEffect2(()=>position2(),[position2]);const[contentZIndex,setContentZIndex]=reactExports.useState();useLayoutEffect2(()=>{content2&&setContentZIndex(window.getComputedStyle(content2).zIndex)},[content2]);const handleScrollButtonChange=reactExports.useCallback(node2=>{node2&&!0===shouldRepositionRef.current&&(position2(),null==focusSelectedItem||focusSelectedItem(),shouldRepositionRef.current=!1)},[position2,focusSelectedItem]);return jsxRuntimeExports.jsx(SelectViewportProvider,{scope:__scopeSelect,contentWrapper:contentWrapper,shouldExpandOnScrollRef:shouldExpandOnScrollRef,onScrollButtonChange:handleScrollButtonChange,children:jsxRuntimeExports.jsx("div",{ref:setContentWrapper,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:contentZIndex},children:jsxRuntimeExports.jsx(Primitive.div,{...popperProps,ref:composedRefs,style:{boxSizing:"border-box",maxHeight:"100%",...popperProps.style}})})})});SelectItemAlignedPosition.displayName="SelectItemAlignedPosition";var SelectPopperPosition=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeSelect:__scopeSelect,align:align="start",collisionPadding:collisionPadding=CONTENT_MARGIN,...popperProps}=props,popperScope=usePopperScope$1(__scopeSelect);return jsxRuntimeExports.jsx(Content$1,{...popperScope,...popperProps,ref:forwardedRef,align:align,collisionPadding:collisionPadding,style:{boxSizing:"border-box",...popperProps.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});SelectPopperPosition.displayName="SelectPopperPosition";var[SelectViewportProvider,useSelectViewportContext]=createSelectContext("SelectContent",{}),SelectViewport=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeSelect:__scopeSelect,nonce:nonce,...viewportProps}=props,contentContext=useSelectContentContext("SelectViewport",__scopeSelect),viewportContext=useSelectViewportContext("SelectViewport",__scopeSelect),composedRefs=useComposedRefs(forwardedRef,contentContext.onViewportChange),prevScrollTopRef=reactExports.useRef(0);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:nonce}),jsxRuntimeExports.jsx(Collection.Slot,{scope:__scopeSelect,children:jsxRuntimeExports.jsx(Primitive.div,{"data-radix-select-viewport":"",role:"presentation",...viewportProps,ref:composedRefs,style:{position:"relative",flex:1,overflow:"hidden auto",...viewportProps.style},onScroll:composeEventHandlers(viewportProps.onScroll,event=>{const viewport=event.currentTarget,{contentWrapper:contentWrapper,shouldExpandOnScrollRef:shouldExpandOnScrollRef}=viewportContext;if((null==shouldExpandOnScrollRef?void 0:shouldExpandOnScrollRef.current)&&contentWrapper){const scrolledBy=Math.abs(prevScrollTopRef.current-viewport.scrollTop);if(scrolledBy>0){const availableHeight=window.innerHeight-2*CONTENT_MARGIN,cssMinHeight=parseFloat(contentWrapper.style.minHeight),cssHeight=parseFloat(contentWrapper.style.height),prevHeight=Math.max(cssMinHeight,cssHeight);if(prevHeight<availableHeight){const nextHeight=prevHeight+scrolledBy,clampedNextHeight=Math.min(availableHeight,nextHeight),heightDiff=nextHeight-clampedNextHeight;contentWrapper.style.height=clampedNextHeight+"px","0px"===contentWrapper.style.bottom&&(viewport.scrollTop=heightDiff>0?heightDiff:0,contentWrapper.style.justifyContent="flex-end")}}}prevScrollTopRef.current=viewport.scrollTop})})})]})});SelectViewport.displayName="SelectViewport";var[SelectGroupContextProvider,useSelectGroupContext]=createSelectContext("SelectGroup");reactExports.forwardRef((props,forwardedRef)=>{const{__scopeSelect:__scopeSelect,...groupProps}=props,groupId=useId();return jsxRuntimeExports.jsx(SelectGroupContextProvider,{scope:__scopeSelect,id:groupId,children:jsxRuntimeExports.jsx(Primitive.div,{role:"group","aria-labelledby":groupId,...groupProps,ref:forwardedRef})})}).displayName="SelectGroup";reactExports.forwardRef((props,forwardedRef)=>{const{__scopeSelect:__scopeSelect,...labelProps}=props,groupContext=useSelectGroupContext("SelectLabel",__scopeSelect);return jsxRuntimeExports.jsx(Primitive.div,{id:groupContext.id,...labelProps,ref:forwardedRef})}).displayName="SelectLabel";var[SelectItemContextProvider,useSelectItemContext]=createSelectContext("SelectItem"),SelectItem$1=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeSelect:__scopeSelect,value:value,disabled:disabled=!1,textValue:textValueProp,...itemProps}=props,context=useSelectContext("SelectItem",__scopeSelect),contentContext=useSelectContentContext("SelectItem",__scopeSelect),isSelected=context.value===value,[textValue,setTextValue]=reactExports.useState(textValueProp??""),[isFocused,setIsFocused]=reactExports.useState(!1),composedRefs=useComposedRefs(forwardedRef,node2=>{var _a;return null==(_a=contentContext.itemRefCallback)?void 0:_a.call(contentContext,node2,value,disabled)}),textId=useId(),pointerTypeRef=reactExports.useRef("touch"),handleSelect=()=>{disabled||(context.onValueChange(value),context.onOpenChange(!1))};if(""===value)throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return jsxRuntimeExports.jsx(SelectItemContextProvider,{scope:__scopeSelect,value:value,disabled:disabled,textId:textId,isSelected:isSelected,onItemTextChange:reactExports.useCallback(node2=>{setTextValue(prevTextValue=>prevTextValue||((null==node2?void 0:node2.textContent)??"").trim())},[]),children:jsxRuntimeExports.jsx(Collection.ItemSlot,{scope:__scopeSelect,value:value,disabled:disabled,textValue:textValue,children:jsxRuntimeExports.jsx(Primitive.div,{role:"option","aria-labelledby":textId,"data-highlighted":isFocused?"":void 0,"aria-selected":isSelected&&isFocused,"data-state":isSelected?"checked":"unchecked","aria-disabled":disabled||void 0,"data-disabled":disabled?"":void 0,tabIndex:disabled?void 0:-1,...itemProps,ref:composedRefs,onFocus:composeEventHandlers(itemProps.onFocus,()=>setIsFocused(!0)),onBlur:composeEventHandlers(itemProps.onBlur,()=>setIsFocused(!1)),onClick:composeEventHandlers(itemProps.onClick,()=>{"mouse"!==pointerTypeRef.current&&handleSelect()}),onPointerUp:composeEventHandlers(itemProps.onPointerUp,()=>{"mouse"===pointerTypeRef.current&&handleSelect()}),onPointerDown:composeEventHandlers(itemProps.onPointerDown,event=>{pointerTypeRef.current=event.pointerType}),onPointerMove:composeEventHandlers(itemProps.onPointerMove,event=>{var _a;pointerTypeRef.current=event.pointerType,disabled?null==(_a=contentContext.onItemLeave)||_a.call(contentContext):"mouse"===pointerTypeRef.current&&event.currentTarget.focus({preventScroll:!0})}),onPointerLeave:composeEventHandlers(itemProps.onPointerLeave,event=>{var _a;event.currentTarget===document.activeElement&&(null==(_a=contentContext.onItemLeave)||_a.call(contentContext))}),onKeyDown:composeEventHandlers(itemProps.onKeyDown,event=>{var _a;""!==(null==(_a=contentContext.searchRef)?void 0:_a.current)&&" "===event.key||(SELECTION_KEYS.includes(event.key)&&handleSelect()," "===event.key&&event.preventDefault())})})})})});SelectItem$1.displayName="SelectItem";var SelectItemText=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeSelect:__scopeSelect,className:className,style:style,...itemTextProps}=props,context=useSelectContext("SelectItemText",__scopeSelect),contentContext=useSelectContentContext("SelectItemText",__scopeSelect),itemContext=useSelectItemContext("SelectItemText",__scopeSelect),nativeOptionsContext=useSelectNativeOptionsContext("SelectItemText",__scopeSelect),[itemTextNode,setItemTextNode]=reactExports.useState(null),composedRefs=useComposedRefs(forwardedRef,node2=>setItemTextNode(node2),itemContext.onItemTextChange,node2=>{var _a;return null==(_a=contentContext.itemTextRefCallback)?void 0:_a.call(contentContext,node2,itemContext.value,itemContext.disabled)}),textContent=null==itemTextNode?void 0:itemTextNode.textContent,nativeOption=reactExports.useMemo(()=>jsxRuntimeExports.jsx("option",{value:itemContext.value,disabled:itemContext.disabled,children:textContent},itemContext.value),[itemContext.disabled,itemContext.value,textContent]),{onNativeOptionAdd:onNativeOptionAdd,onNativeOptionRemove:onNativeOptionRemove}=nativeOptionsContext;return useLayoutEffect2(()=>(onNativeOptionAdd(nativeOption),()=>onNativeOptionRemove(nativeOption)),[onNativeOptionAdd,onNativeOptionRemove,nativeOption]),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Primitive.span,{id:itemContext.textId,...itemTextProps,ref:composedRefs}),itemContext.isSelected&&context.valueNode&&!context.valueNodeHasChildren?reactDomExports.createPortal(itemTextProps.children,context.valueNode):null]})});SelectItemText.displayName="SelectItemText";reactExports.forwardRef((props,forwardedRef)=>{const{__scopeSelect:__scopeSelect,...itemIndicatorProps}=props;return useSelectItemContext("SelectItemIndicator",__scopeSelect).isSelected?jsxRuntimeExports.jsx(Primitive.span,{"aria-hidden":!0,...itemIndicatorProps,ref:forwardedRef}):null}).displayName="SelectItemIndicator";reactExports.forwardRef((props,forwardedRef)=>{const contentContext=useSelectContentContext("SelectScrollUpButton",props.__scopeSelect),viewportContext=useSelectViewportContext("SelectScrollUpButton",props.__scopeSelect),[canScrollUp,setCanScrollUp]=reactExports.useState(!1),composedRefs=useComposedRefs(forwardedRef,viewportContext.onScrollButtonChange);return useLayoutEffect2(()=>{if(contentContext.viewport&&contentContext.isPositioned){let handleScroll2=function(){const canScrollUp2=viewport.scrollTop>0;setCanScrollUp(canScrollUp2)};const viewport=contentContext.viewport;return handleScroll2(),viewport.addEventListener("scroll",handleScroll2),()=>viewport.removeEventListener("scroll",handleScroll2)}},[contentContext.viewport,contentContext.isPositioned]),canScrollUp?jsxRuntimeExports.jsx(SelectScrollButtonImpl,{...props,ref:composedRefs,onAutoScroll:()=>{const{viewport:viewport,selectedItem:selectedItem}=contentContext;viewport&&selectedItem&&(viewport.scrollTop=viewport.scrollTop-selectedItem.offsetHeight)}}):null}).displayName="SelectScrollUpButton";reactExports.forwardRef((props,forwardedRef)=>{const contentContext=useSelectContentContext("SelectScrollDownButton",props.__scopeSelect),viewportContext=useSelectViewportContext("SelectScrollDownButton",props.__scopeSelect),[canScrollDown,setCanScrollDown]=reactExports.useState(!1),composedRefs=useComposedRefs(forwardedRef,viewportContext.onScrollButtonChange);return useLayoutEffect2(()=>{if(contentContext.viewport&&contentContext.isPositioned){let handleScroll2=function(){const maxScroll=viewport.scrollHeight-viewport.clientHeight,canScrollDown2=Math.ceil(viewport.scrollTop)<maxScroll;setCanScrollDown(canScrollDown2)};const viewport=contentContext.viewport;return handleScroll2(),viewport.addEventListener("scroll",handleScroll2),()=>viewport.removeEventListener("scroll",handleScroll2)}},[contentContext.viewport,contentContext.isPositioned]),canScrollDown?jsxRuntimeExports.jsx(SelectScrollButtonImpl,{...props,ref:composedRefs,onAutoScroll:()=>{const{viewport:viewport,selectedItem:selectedItem}=contentContext;viewport&&selectedItem&&(viewport.scrollTop=viewport.scrollTop+selectedItem.offsetHeight)}}):null}).displayName="SelectScrollDownButton";var SelectScrollButtonImpl=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeSelect:__scopeSelect,onAutoScroll:onAutoScroll,...scrollIndicatorProps}=props,contentContext=useSelectContentContext("SelectScrollButton",__scopeSelect),autoScrollTimerRef=reactExports.useRef(null),getItems=useCollection(__scopeSelect),clearAutoScrollTimer=reactExports.useCallback(()=>{null!==autoScrollTimerRef.current&&(window.clearInterval(autoScrollTimerRef.current),autoScrollTimerRef.current=null)},[]);return reactExports.useEffect(()=>()=>clearAutoScrollTimer(),[clearAutoScrollTimer]),useLayoutEffect2(()=>{var _a;const activeItem=getItems().find(item=>item.ref.current===document.activeElement);null==(_a=null==activeItem?void 0:activeItem.ref.current)||_a.scrollIntoView({block:"nearest"})},[getItems]),jsxRuntimeExports.jsx(Primitive.div,{"aria-hidden":!0,...scrollIndicatorProps,ref:forwardedRef,style:{flexShrink:0,...scrollIndicatorProps.style},onPointerDown:composeEventHandlers(scrollIndicatorProps.onPointerDown,()=>{null===autoScrollTimerRef.current&&(autoScrollTimerRef.current=window.setInterval(onAutoScroll,50))}),onPointerMove:composeEventHandlers(scrollIndicatorProps.onPointerMove,()=>{var _a;null==(_a=contentContext.onItemLeave)||_a.call(contentContext),null===autoScrollTimerRef.current&&(autoScrollTimerRef.current=window.setInterval(onAutoScroll,50))}),onPointerLeave:composeEventHandlers(scrollIndicatorProps.onPointerLeave,()=>{clearAutoScrollTimer()})})}),SelectSeparator=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeSelect:__scopeSelect,...separatorProps}=props;return jsxRuntimeExports.jsx(Primitive.div,{"aria-hidden":!0,...separatorProps,ref:forwardedRef})});SelectSeparator.displayName="SelectSeparator";reactExports.forwardRef((props,forwardedRef)=>{const{__scopeSelect:__scopeSelect,...arrowProps}=props,popperScope=usePopperScope$1(__scopeSelect),context=useSelectContext("SelectArrow",__scopeSelect),contentContext=useSelectContentContext("SelectArrow",__scopeSelect);return context.open&&"popper"===contentContext.position?jsxRuntimeExports.jsx(Arrow,{...popperScope,...arrowProps,ref:forwardedRef}):null}).displayName="SelectArrow";var SelectBubbleInput=reactExports.forwardRef(({__scopeSelect:__scopeSelect,value:value,...props},forwardedRef)=>{const ref=reactExports.useRef(null),composedRefs=useComposedRefs(forwardedRef,ref),prevValue=function(value){const ref=reactExports.useRef({value:value,previous:value});return reactExports.useMemo(()=>(ref.current.value!==value&&(ref.current.previous=ref.current.value,ref.current.value=value),ref.current.previous),[value])}(value);return reactExports.useEffect(()=>{const select=ref.current;if(!select)return;const selectProto=window.HTMLSelectElement.prototype,setValue=Object.getOwnPropertyDescriptor(selectProto,"value").set;if(prevValue!==value&&setValue){const event=new Event("change",{bubbles:!0});setValue.call(select,value),select.dispatchEvent(event)}},[prevValue,value]),jsxRuntimeExports.jsx(Primitive.select,{...props,style:{...VISUALLY_HIDDEN_STYLES,...props.style},ref:composedRefs,defaultValue:value})});function shouldShowPlaceholder(value){return""===value||void 0===value}function useTypeaheadSearch(onSearchChange){const handleSearchChange=useCallbackRef$1(onSearchChange),searchRef=reactExports.useRef(""),timerRef=reactExports.useRef(0),handleTypeaheadSearch=reactExports.useCallback(key=>{const search2=searchRef.current+key;handleSearchChange(search2),function updateSearch(value){searchRef.current=value,window.clearTimeout(timerRef.current),""!==value&&(timerRef.current=window.setTimeout(()=>updateSearch(""),1e3))}(search2)},[handleSearchChange]),resetTypeahead=reactExports.useCallback(()=>{searchRef.current="",window.clearTimeout(timerRef.current)},[]);return reactExports.useEffect(()=>()=>window.clearTimeout(timerRef.current),[]),[searchRef,handleTypeaheadSearch,resetTypeahead]}function findNextItem(items,search2,currentItem){const normalizedSearch=search2.length>1&&Array.from(search2).every(char=>char===search2[0])?search2[0]:search2,currentItemIndex=currentItem?items.indexOf(currentItem):-1;let wrappedItems=(array=items,startIndex=Math.max(currentItemIndex,0),array.map((_2,index2)=>array[(startIndex+index2)%array.length]));var array,startIndex;1===normalizedSearch.length&&(wrappedItems=wrappedItems.filter(v2=>v2!==currentItem));const nextItem=wrappedItems.find(item=>item.textValue.toLowerCase().startsWith(normalizedSearch.toLowerCase()));return nextItem!==currentItem?nextItem:void 0}SelectBubbleInput.displayName="SelectBubbleInput";var Root2=Select$1,Trigger$1=SelectTrigger$1,Value=SelectValue,Icon=SelectIcon,Portal$1=SelectPortal,Content2$1=SelectContent$1,Viewport=SelectViewport,Item=SelectItem$1,ItemText=SelectItemText,Separator$1=SelectSeparator,[createTooltipContext]=createContextScope("Tooltip",[createPopperScope]),usePopperScope=createPopperScope(),DEFAULT_DELAY_DURATION=700,[TooltipProviderContextProvider,useTooltipProviderContext]=createTooltipContext("TooltipProvider"),TooltipProvider=props=>{const{__scopeTooltip:__scopeTooltip,delayDuration:delayDuration=DEFAULT_DELAY_DURATION,skipDelayDuration:skipDelayDuration=300,disableHoverableContent:disableHoverableContent=!1,children:children}=props,isOpenDelayedRef=reactExports.useRef(!0),isPointerInTransitRef=reactExports.useRef(!1),skipDelayTimerRef=reactExports.useRef(0);return reactExports.useEffect(()=>{const skipDelayTimer=skipDelayTimerRef.current;return()=>window.clearTimeout(skipDelayTimer)},[]),jsxRuntimeExports.jsx(TooltipProviderContextProvider,{scope:__scopeTooltip,isOpenDelayedRef:isOpenDelayedRef,delayDuration:delayDuration,onOpen:reactExports.useCallback(()=>{window.clearTimeout(skipDelayTimerRef.current),isOpenDelayedRef.current=!1},[]),onClose:reactExports.useCallback(()=>{window.clearTimeout(skipDelayTimerRef.current),skipDelayTimerRef.current=window.setTimeout(()=>isOpenDelayedRef.current=!0,skipDelayDuration)},[skipDelayDuration]),isPointerInTransitRef:isPointerInTransitRef,onPointerInTransitChange:reactExports.useCallback(inTransit=>{isPointerInTransitRef.current=inTransit},[]),disableHoverableContent:disableHoverableContent,children:children})};TooltipProvider.displayName="TooltipProvider";var[TooltipContextProvider,useTooltipContext]=createTooltipContext("Tooltip"),Tooltip=props=>{const{__scopeTooltip:__scopeTooltip,children:children,open:openProp,defaultOpen:defaultOpen,onOpenChange:onOpenChange,disableHoverableContent:disableHoverableContentProp,delayDuration:delayDurationProp}=props,providerContext=useTooltipProviderContext("Tooltip",props.__scopeTooltip),popperScope=usePopperScope(__scopeTooltip),[trigger,setTrigger]=reactExports.useState(null),contentId=useId(),openTimerRef=reactExports.useRef(0),disableHoverableContent=disableHoverableContentProp??providerContext.disableHoverableContent,delayDuration=delayDurationProp??providerContext.delayDuration,wasOpenDelayedRef=reactExports.useRef(!1),[open,setOpen]=useControllableState({prop:openProp,defaultProp:defaultOpen??!1,onChange:open2=>{open2?(providerContext.onOpen(),document.dispatchEvent(new CustomEvent("tooltip.open"))):providerContext.onClose(),null==onOpenChange||onOpenChange(open2)},caller:"Tooltip"}),stateAttribute=reactExports.useMemo(()=>open?wasOpenDelayedRef.current?"delayed-open":"instant-open":"closed",[open]),handleOpen=reactExports.useCallback(()=>{window.clearTimeout(openTimerRef.current),openTimerRef.current=0,wasOpenDelayedRef.current=!1,setOpen(!0)},[setOpen]),handleClose=reactExports.useCallback(()=>{window.clearTimeout(openTimerRef.current),openTimerRef.current=0,setOpen(!1)},[setOpen]),handleDelayedOpen=reactExports.useCallback(()=>{window.clearTimeout(openTimerRef.current),openTimerRef.current=window.setTimeout(()=>{wasOpenDelayedRef.current=!0,setOpen(!0),openTimerRef.current=0},delayDuration)},[delayDuration,setOpen]);return reactExports.useEffect(()=>()=>{openTimerRef.current&&(window.clearTimeout(openTimerRef.current),openTimerRef.current=0)},[]),jsxRuntimeExports.jsx(Root2$3,{...popperScope,children:jsxRuntimeExports.jsx(TooltipContextProvider,{scope:__scopeTooltip,contentId:contentId,open:open,stateAttribute:stateAttribute,trigger:trigger,onTriggerChange:setTrigger,onTriggerEnter:reactExports.useCallback(()=>{providerContext.isOpenDelayedRef.current?handleDelayedOpen():handleOpen()},[providerContext.isOpenDelayedRef,handleDelayedOpen,handleOpen]),onTriggerLeave:reactExports.useCallback(()=>{disableHoverableContent?handleClose():(window.clearTimeout(openTimerRef.current),openTimerRef.current=0)},[handleClose,disableHoverableContent]),onOpen:handleOpen,onClose:handleClose,disableHoverableContent:disableHoverableContent,children:children})})};Tooltip.displayName="Tooltip";var TooltipTrigger=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeTooltip:__scopeTooltip,...triggerProps}=props,context=useTooltipContext("TooltipTrigger",__scopeTooltip),providerContext=useTooltipProviderContext("TooltipTrigger",__scopeTooltip),popperScope=usePopperScope(__scopeTooltip),composedRefs=useComposedRefs(forwardedRef,reactExports.useRef(null),context.onTriggerChange),isPointerDownRef=reactExports.useRef(!1),hasPointerMoveOpenedRef=reactExports.useRef(!1),handlePointerUp=reactExports.useCallback(()=>isPointerDownRef.current=!1,[]);return reactExports.useEffect(()=>()=>document.removeEventListener("pointerup",handlePointerUp),[handlePointerUp]),jsxRuntimeExports.jsx(Anchor,{asChild:!0,...popperScope,children:jsxRuntimeExports.jsx(Primitive.button,{"aria-describedby":context.open?context.contentId:void 0,"data-state":context.stateAttribute,...triggerProps,ref:composedRefs,onPointerMove:composeEventHandlers(props.onPointerMove,event=>{"touch"!==event.pointerType&&(hasPointerMoveOpenedRef.current||providerContext.isPointerInTransitRef.current||(context.onTriggerEnter(),hasPointerMoveOpenedRef.current=!0))}),onPointerLeave:composeEventHandlers(props.onPointerLeave,()=>{context.onTriggerLeave(),hasPointerMoveOpenedRef.current=!1}),onPointerDown:composeEventHandlers(props.onPointerDown,()=>{context.open&&context.onClose(),isPointerDownRef.current=!0,document.addEventListener("pointerup",handlePointerUp,{once:!0})}),onFocus:composeEventHandlers(props.onFocus,()=>{isPointerDownRef.current||context.onOpen()}),onBlur:composeEventHandlers(props.onBlur,context.onClose),onClick:composeEventHandlers(props.onClick,context.onClose)})})});TooltipTrigger.displayName="TooltipTrigger";var[PortalProvider,usePortalContext]=createTooltipContext("TooltipPortal",{forceMount:void 0}),TooltipPortal=props=>{const{__scopeTooltip:__scopeTooltip,forceMount:forceMount,children:children,container:container}=props,context=useTooltipContext("TooltipPortal",__scopeTooltip);return jsxRuntimeExports.jsx(PortalProvider,{scope:__scopeTooltip,forceMount:forceMount,children:jsxRuntimeExports.jsx(Presence,{present:forceMount||context.open,children:jsxRuntimeExports.jsx(Portal$4,{asChild:!0,container:container,children:children})})})};TooltipPortal.displayName="TooltipPortal";var TooltipContent=reactExports.forwardRef((props,forwardedRef)=>{const portalContext=usePortalContext("TooltipContent",props.__scopeTooltip),{forceMount:forceMount=portalContext.forceMount,side:side="top",...contentProps}=props,context=useTooltipContext("TooltipContent",props.__scopeTooltip);return jsxRuntimeExports.jsx(Presence,{present:forceMount||context.open,children:context.disableHoverableContent?jsxRuntimeExports.jsx(TooltipContentImpl,{side:side,...contentProps,ref:forwardedRef}):jsxRuntimeExports.jsx(TooltipContentHoverable,{side:side,...contentProps,ref:forwardedRef})})}),TooltipContentHoverable=reactExports.forwardRef((props,forwardedRef)=>{const context=useTooltipContext("TooltipContent",props.__scopeTooltip),providerContext=useTooltipProviderContext("TooltipContent",props.__scopeTooltip),ref=reactExports.useRef(null),composedRefs=useComposedRefs(forwardedRef,ref),[pointerGraceArea,setPointerGraceArea]=reactExports.useState(null),{trigger:trigger,onClose:onClose}=context,content2=ref.current,{onPointerInTransitChange:onPointerInTransitChange}=providerContext,handleRemoveGraceArea=reactExports.useCallback(()=>{setPointerGraceArea(null),onPointerInTransitChange(!1)},[onPointerInTransitChange]),handleCreateGraceArea=reactExports.useCallback((event,hoverTarget)=>{const currentTarget=event.currentTarget,exitPoint={x:event.clientX,y:event.clientY},paddedExitPoints=function(exitPoint,exitSide,padding=5){const paddedExitPoints=[];switch(exitSide){case"top":paddedExitPoints.push({x:exitPoint.x-padding,y:exitPoint.y+padding},{x:exitPoint.x+padding,y:exitPoint.y+padding});break;case"bottom":paddedExitPoints.push({x:exitPoint.x-padding,y:exitPoint.y-padding},{x:exitPoint.x+padding,y:exitPoint.y-padding});break;case"left":paddedExitPoints.push({x:exitPoint.x+padding,y:exitPoint.y-padding},{x:exitPoint.x+padding,y:exitPoint.y+padding});break;case"right":paddedExitPoints.push({x:exitPoint.x-padding,y:exitPoint.y-padding},{x:exitPoint.x-padding,y:exitPoint.y+padding})}return paddedExitPoints}(exitPoint,function(point2,rect){const top=Math.abs(rect.top-point2.y),bottom=Math.abs(rect.bottom-point2.y),right=Math.abs(rect.right-point2.x),left=Math.abs(rect.left-point2.x);switch(Math.min(top,bottom,right,left)){case left:return"left";case right:return"right";case top:return"top";case bottom:return"bottom";default:throw new Error("unreachable")}}(exitPoint,currentTarget.getBoundingClientRect())),graceArea=function(points){const newPoints=points.slice();return newPoints.sort((a2,b2)=>a2.x<b2.x?-1:a2.x>b2.x?1:a2.y<b2.y?-1:a2.y>b2.y?1:0),function(points){if(points.length<=1)return points.slice();const upperHull=[];for(let i2=0;i2<points.length;i2++){const p2=points[i2];for(;upperHull.length>=2;){const q2=upperHull[upperHull.length-1],r2=upperHull[upperHull.length-2];if(!((q2.x-r2.x)*(p2.y-r2.y)>=(q2.y-r2.y)*(p2.x-r2.x)))break;upperHull.pop()}upperHull.push(p2)}upperHull.pop();const lowerHull=[];for(let i2=points.length-1;i2>=0;i2--){const p2=points[i2];for(;lowerHull.length>=2;){const q2=lowerHull[lowerHull.length-1],r2=lowerHull[lowerHull.length-2];if(!((q2.x-r2.x)*(p2.y-r2.y)>=(q2.y-r2.y)*(p2.x-r2.x)))break;lowerHull.pop()}lowerHull.push(p2)}return lowerHull.pop(),1===upperHull.length&&1===lowerHull.length&&upperHull[0].x===lowerHull[0].x&&upperHull[0].y===lowerHull[0].y?upperHull:upperHull.concat(lowerHull)}(newPoints)}([...paddedExitPoints,...function(rect){const{top:top,right:right,bottom:bottom,left:left}=rect;return[{x:left,y:top},{x:right,y:top},{x:right,y:bottom},{x:left,y:bottom}]}(hoverTarget.getBoundingClientRect())]);setPointerGraceArea(graceArea),onPointerInTransitChange(!0)},[onPointerInTransitChange]);return reactExports.useEffect(()=>()=>handleRemoveGraceArea(),[handleRemoveGraceArea]),reactExports.useEffect(()=>{if(trigger&&content2){const handleTriggerLeave=event=>handleCreateGraceArea(event,content2),handleContentLeave=event=>handleCreateGraceArea(event,trigger);return trigger.addEventListener("pointerleave",handleTriggerLeave),content2.addEventListener("pointerleave",handleContentLeave),()=>{trigger.removeEventListener("pointerleave",handleTriggerLeave),content2.removeEventListener("pointerleave",handleContentLeave)}}},[trigger,content2,handleCreateGraceArea,handleRemoveGraceArea]),reactExports.useEffect(()=>{if(pointerGraceArea){const handleTrackPointerGrace=event=>{const target=event.target,pointerPosition={x:event.clientX,y:event.clientY},hasEnteredTarget=(null==trigger?void 0:trigger.contains(target))||(null==content2?void 0:content2.contains(target)),isPointerOutsideGraceArea=!function(point2,polygon){const{x:x2,y:y2}=point2;let inside=!1;for(let i2=0,j2=polygon.length-1;i2<polygon.length;j2=i2++){const ii2=polygon[i2],jj=polygon[j2],xi2=ii2.x,yi2=ii2.y,xj=jj.x,yj=jj.y;yi2>y2!=yj>y2&&x2<(xj-xi2)*(y2-yi2)/(yj-yi2)+xi2&&(inside=!inside)}return inside}(pointerPosition,pointerGraceArea);hasEnteredTarget?handleRemoveGraceArea():isPointerOutsideGraceArea&&(handleRemoveGraceArea(),onClose())};return document.addEventListener("pointermove",handleTrackPointerGrace),()=>document.removeEventListener("pointermove",handleTrackPointerGrace)}},[trigger,content2,pointerGraceArea,onClose,handleRemoveGraceArea]),jsxRuntimeExports.jsx(TooltipContentImpl,{...props,ref:composedRefs})}),[VisuallyHiddenContentContextProvider,useVisuallyHiddenContentContext]=createTooltipContext("Tooltip",{isInside:!1}),Slottable=createSlottable("TooltipContent"),TooltipContentImpl=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeTooltip:__scopeTooltip,children:children,"aria-label":ariaLabel,onEscapeKeyDown:onEscapeKeyDown,onPointerDownOutside:onPointerDownOutside,...contentProps}=props,context=useTooltipContext("TooltipContent",__scopeTooltip),popperScope=usePopperScope(__scopeTooltip),{onClose:onClose}=context;return reactExports.useEffect(()=>(document.addEventListener("tooltip.open",onClose),()=>document.removeEventListener("tooltip.open",onClose)),[onClose]),reactExports.useEffect(()=>{if(context.trigger){const handleScroll2=event=>{const target=event.target;(null==target?void 0:target.contains(context.trigger))&&onClose()};return window.addEventListener("scroll",handleScroll2,{capture:!0}),()=>window.removeEventListener("scroll",handleScroll2,{capture:!0})}},[context.trigger,onClose]),jsxRuntimeExports.jsx(DismissableLayer,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:onEscapeKeyDown,onPointerDownOutside:onPointerDownOutside,onFocusOutside:event=>event.preventDefault(),onDismiss:onClose,children:jsxRuntimeExports.jsxs(Content$1,{"data-state":context.stateAttribute,...popperScope,...contentProps,ref:forwardedRef,style:{...contentProps.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[jsxRuntimeExports.jsx(Slottable,{children:children}),jsxRuntimeExports.jsx(VisuallyHiddenContentContextProvider,{scope:__scopeTooltip,isInside:!0,children:jsxRuntimeExports.jsx(Root$1,{id:context.contentId,role:"tooltip",children:ariaLabel||children})})]})})});TooltipContent.displayName="TooltipContent";var TooltipArrow=reactExports.forwardRef((props,forwardedRef)=>{const{__scopeTooltip:__scopeTooltip,...arrowProps}=props,popperScope=usePopperScope(__scopeTooltip);return useVisuallyHiddenContentContext("TooltipArrow",__scopeTooltip).isInside?null:jsxRuntimeExports.jsx(Arrow,{...popperScope,...arrowProps,ref:forwardedRef})});TooltipArrow.displayName="TooltipArrow";var Provider=TooltipProvider,Root3=Tooltip,Trigger=TooltipTrigger,Portal=TooltipPortal,Content2=TooltipContent,Arrow2=TooltipArrow;const TooltipWrap=React__default.forwardRef(({title:title,children:children},ref)=>{const editorRootElementRef=E$4(editorRootElementRef$);return React__default.createElement(Provider,{delayDuration:100},React__default.createElement(Root3,null,React__default.createElement(Trigger,{ref:ref,asChild:!0},React__default.createElement("span",{className:styles_tooltipTrigger},children)),React__default.createElement(Portal,{container:null==editorRootElementRef?void 0:editorRootElementRef.current},React__default.createElement(Content2,{className:classNames(styles_tooltipContent),sideOffset:10},title))))}),SelectItem=React__default.forwardRef(({children:children,className:className,...props},forwardedRef)=>React__default.createElement(Item,{...props,ref:forwardedRef,className:classNames(className,styles_selectItem)},React__default.createElement(ItemText,null,children))),SelectTrigger=({title:title,placeholder:placeholder2,className:className})=>{const[readOnly,iconComponentFor]=X$3(readOnly$,iconComponentFor$);return React__default.createElement(TooltipWrap,{title:title},React__default.createElement(Trigger$1,{"aria-label":placeholder2,className:classNames(styles_selectTrigger,className),"data-toolbar-item":!0,disabled:readOnly},React__default.createElement(Value,{placeholder:placeholder2}),React__default.createElement(Icon,{className:styles_selectDropdownArrow},iconComponentFor("arrow_drop_down"))))},SelectContent=({children:children,className:className=styles_selectContainer})=>{const editorRootElementRef=E$4(editorRootElementRef$);return React__default.createElement(Portal$1,{container:null==editorRootElementRef?void 0:editorRootElementRef.current},React__default.createElement(Content2$1,{className:classNames(className,"mdxeditor-select-content"),onCloseAutoFocus:e2=>{e2.preventDefault()},position:"popper"},React__default.createElement(Viewport,{"data-editor-dropdown":!0,style:{maxHeight:"var(--radix-select-content-available-height)"}},children)))},Select=props=>React__default.createElement(Root2,{value:props.value||"",onValueChange:props.onChange,disabled:props.disabled},React__default.createElement(SelectTrigger,{title:props.triggerTitle,placeholder:props.placeholder}),React__default.createElement(SelectContent,null,props.items.map((item,index2)=>"separator"===item?React__default.createElement(Separator$1,{key:index2}):React__default.createElement(SelectItem,{key:index2,value:item.value},item.label)))),CodeMirrorEditor=({language:language,nodeKey:nodeKey,code:code2,focusEmitter:focusEmitter})=>{const t2=useTranslation(),{parentEditor:parentEditor,lexicalNode:lexicalNode}=useCodeBlockEditorContext(),[readOnly,codeMirrorExtensions,autoLoadLanguageSupport,iconComponentFor,codeBlockLanguages]=X$3(readOnly$,codeMirrorExtensions$,codeMirrorAutoLoadLanguageSupport$,iconComponentFor$,codeBlockLanguages$),codeMirrorRef=function(nodeKey,editorType,language,focusEmitter){const activeEditor=E$4(activeEditor$),setEditorInFocus=A$4(editorInFocus$),codeMirrorRef=React__default.useRef(null),{lexicalNode:lexicalNode}=useCodeBlockEditorContext(),atBottom=React__default.useRef(!1),atTop=React__default.useRef(!1),onFocusHandler=React__default.useCallback(()=>{setEditorInFocus({editorType:editorType,rootNode:lexicalNode,editorRef:codeMirrorRef.current})},[editorType,lexicalNode,setEditorInFocus]),onKeyDownHandler=React__default.useCallback(e2=>{var _a,_b,_c,_d,_e2,_f;if("ArrowDown"===e2.key){const state=null==(_b=null==(_a=codeMirrorRef.current)?void 0:_a.getCodemirror())?void 0:_b.state;state&&state.doc.length===state.selection.ranges[0].to&&(atBottom.current?(null==activeEditor||activeEditor.update(()=>{var _a2,_b2;const node2=_s(nodeKey);node2.getNextSibling()?(null==(_b2=null==(_a2=codeMirrorRef.current)?void 0:_a2.getCodemirror())||_b2.contentDOM.blur(),node2.selectNext()):node2.insertAfter(Fi())}),atBottom.current=!1):atBottom.current=!0)}else if("ArrowUp"===e2.key){const state=null==(_d=null==(_c=codeMirrorRef.current)?void 0:_c.getCodemirror())?void 0:_d.state;state&&0===state.selection.ranges[0].from&&(atTop.current?(null==activeEditor||activeEditor.update(()=>{var _a2,_b2;const node2=_s(nodeKey);node2.getPreviousSibling()&&(null==(_b2=null==(_a2=codeMirrorRef.current)?void 0:_a2.getCodemirror())||_b2.contentDOM.blur(),node2.selectPrevious())}),atTop.current=!1):atTop.current=!0)}else if("Enter"===e2.key)e2.stopPropagation();else if("Backspace"===e2.key||"Delete"===e2.key){const state=null==(_f=null==(_e2=codeMirrorRef.current)?void 0:_e2.getCodemirror())?void 0:_f.state;0===(null==state?void 0:state.doc.length)&&(null==activeEditor||activeEditor.update(()=>{_s(nodeKey).remove()}))}},[activeEditor,nodeKey]);return React__default.useEffect(()=>{const codeMirror=codeMirrorRef.current;return setTimeout(()=>{var _a,_b;null==(_a=null==codeMirror?void 0:codeMirror.getCodemirror())||_a.contentDOM.addEventListener("focus",onFocusHandler),null==(_b=null==codeMirror?void 0:codeMirror.getCodemirror())||_b.contentDOM.addEventListener("keydown",onKeyDownHandler)},300),()=>{var _a,_b;null==(_a=null==codeMirror?void 0:codeMirror.getCodemirror())||_a.contentDOM.removeEventListener("focus",onFocusHandler),null==(_b=null==codeMirror?void 0:codeMirror.getCodemirror())||_b.contentDOM.removeEventListener("keydown",onKeyDownHandler)}},[codeMirrorRef,onFocusHandler,onKeyDownHandler,language]),React__default.useEffect(()=>{focusEmitter.subscribe(()=>{var _a,_b;null==(_b=null==(_a=codeMirrorRef.current)?void 0:_a.getCodemirror())||_b.focus(),onFocusHandler()})},[focusEmitter,codeMirrorRef,nodeKey,onFocusHandler]),codeMirrorRef}(nodeKey,"codeblock",language,focusEmitter),{setCode:setCode}=useCodeBlockEditorContext(),editorViewRef=React__default.useRef(null),elRef=React__default.useRef(null),{value:selectValue,items:selectItems}=React__default.useMemo(()=>function(normalized,language){const value=normalized.keyMap[language]??language;if(!value||normalized.items.some(item=>item.value===value))return{value:value,items:normalized.items};return{value:value,items:[...normalized.items,{value:value,label:language}]}}(codeBlockLanguages,language),[codeBlockLanguages,language]),setCodeRef=React__default.useRef(setCode);return setCodeRef.current=setCode,codeMirrorRef.current={getCodemirror:()=>editorViewRef.current},React__default.useEffect(()=>{const el2=elRef.current;return(async()=>{const extensions=[...codeMirrorExtensions,basicSetup,basicLight,lineNumbers(),keymap.of([indentWithTab]),EditorView.lineWrapping,EditorView.updateListener.of(({state:state})=>{setCodeRef.current(state.doc.toString())}),EditorView.domEventHandlers({focus:()=>{parentEditor.update(()=>{ks(null)})}})];if(readOnly&&extensions.push(EditorState.readOnly.of(!0)),""!==language){const canonical=codeBlockLanguages.keyMap[language]??language,providedSupport=codeBlockLanguages.supportMap[canonical];if(providedSupport)extensions.push(providedSupport.extension);else if(autoLoadLanguageSupport){const languageData=languages.find(l2=>l2.name===language||l2.alias.includes(language)||l2.extensions.includes(language));if(languageData)try{const languageSupport=await languageData.load();extensions.push(languageSupport.extension)}catch(_e2){console.warn("failed to load language support for",language)}}}el2.innerHTML="",editorViewRef.current=new EditorView({parent:el2,state:EditorState.create({doc:code2,extensions:extensions})}),el2.addEventListener("keydown",stopPropagationHandler)})(),()=>{var _a;null==(_a=editorViewRef.current)||_a.destroy(),editorViewRef.current=null,el2.removeEventListener("keydown",stopPropagationHandler)}},[readOnly,language,...codeMirrorExtensions]),React__default.createElement("div",{className:styles_codeMirrorWrapper},React__default.createElement("div",{className:styles_codeMirrorToolbar},React__default.createElement(Select,{disabled:readOnly,value:selectValue,onChange:language2=>{parentEditor.update(()=>{lexicalNode.setLanguage(language2===EMPTY_VALUE?"":language2),setTimeout(()=>{parentEditor.update(()=>{lexicalNode.getLatest().select()})})})},triggerTitle:t2("codeBlock.selectLanguage","Select code block language"),placeholder:t2("codeBlock.inlineLanguage","Language"),items:selectItems}),React__default.createElement("button",{className:styles_iconButton,type:"button",disabled:readOnly,title:t2("codeblock.delete","Delete code block"),onClick:e2=>{e2.preventDefault(),parentEditor.update(()=>{lexicalNode.remove()})}},iconComponentFor("delete_small"))),React__default.createElement("div",{ref:elRef}))};function stopPropagationHandler(ev){ev.stopPropagation()}const EMPTY_VALUE="__EMPTY_VALUE__";function normalizeCodeBlockLanguages(input){var _a;const items=[],keyMap={},supportMap={};if(Array.isArray(input))for(const lang of input){const rawCanonical=(null==(_a=lang.alias)?void 0:_a[0])??lang.name.toLowerCase(),canonical=rawCanonical||EMPTY_VALUE;if(items.push({value:canonical,label:lang.name}),keyMap[rawCanonical]=canonical,lang.alias)for(const alias of lang.alias)keyMap[alias]=canonical;if(lang.extensions)for(const ext of lang.extensions)keyMap[ext]=canonical;keyMap[lang.name.toLowerCase()]=canonical,lang.support&&(supportMap[canonical]=lang.support)}else{const firstKeyByLabel={};for(const[key,label]of Object.entries(input))label in firstKeyByLabel||(firstKeyByLabel[label]=key,items.push({value:key||EMPTY_VALUE,label:label})),keyMap[key]=firstKeyByLabel[label]||EMPTY_VALUE}return{items:items,keyMap:keyMap,supportMap:supportMap}}const codeBlockLanguages$=$$4(normalizeCodeBlockLanguages({js:"JavaScript",ts:"TypeScript",tsx:"TypeScript (React)",jsx:"JavaScript (React)",css:"CSS"})),insertCodeMirror$=K$3(r2=>{r2.link(r2.pipe(insertCodeMirror$,_$3(({language:language,code:code2})=>({code:code2,language:language,meta:""}))),insertCodeBlock$)}),codeMirrorExtensions$=$$4([]),codeMirrorAutoLoadLanguageSupport$=$$4(!0),codeMirrorPlugin=realmPlugin({update(r2,params){r2.pubIn({[codeBlockLanguages$]:normalizeCodeBlockLanguages((null==params?void 0:params.codeBlockLanguages)??{}),[codeMirrorExtensions$]:(null==params?void 0:params.codeMirrorExtensions)??[],[codeMirrorAutoLoadLanguageSupport$]:(null==params?void 0:params.autoLoadLanguageSupport)??!0})},init(r2,params){const normalized=normalizeCodeBlockLanguages((null==params?void 0:params.codeBlockLanguages)??{});r2.pubIn({[codeBlockLanguages$]:normalized,[codeMirrorExtensions$]:(null==params?void 0:params.codeMirrorExtensions)??[],[appendCodeBlockEditorDescriptor$]:{match:(_language,meta)=>!meta,priority:1,Editor:CodeMirrorEditor},[codeMirrorAutoLoadLanguageSupport$]:(null==params?void 0:params.autoLoadLanguageSupport)??!0})}});function LinkEditForm({url:url,title:title,text:text2,onSubmit:onSubmit,onCancel:onCancel,linkAutocompleteSuggestions:linkAutocompleteSuggestions,showLinkTitleField:showLinkTitleField,showAnchorTextField:showAnchorTextField}){const{register:register,handleSubmit:handleSubmit,control:control,setValue:setValue,reset:_2}=useForm({values:{url:url,title:title,text:text2}}),t2=useTranslation();return React__default.createElement("form",{onSubmit:e2=>{handleSubmit(onSubmit)(e2),e2.stopPropagation(),e2.preventDefault()},onReset:e2=>{e2.stopPropagation(),onCancel()},onKeyDown:e2=>{"Escape"===e2.key&&(e2.stopPropagation(),onCancel())},className:classNames(styles_multiFieldForm,styles_linkDialogEditForm)},React__default.createElement("div",{className:styles_formField},React__default.createElement("label",{htmlFor:"link-url"},t2("createLink.url","URL")),React__default.createElement(DownshiftAutoComplete,{register:register,initialInputValue:url,inputName:"url",suggestions:linkAutocompleteSuggestions,setValue:setValue,control:control,placeholder:t2("createLink.urlPlaceholder","Select or paste an URL"),autofocus:!0})),showAnchorTextField?React__default.createElement("div",{className:styles_formField},React__default.createElement("label",{htmlFor:"link-text",title:t2("createLink.textTooltip","The text to be displayed for the link")},t2("createLink.text","Anchor text")),React__default.createElement("input",{id:"link-text",className:styles_textInput,size:40,...register("text")})):null,showLinkTitleField?React__default.createElement("div",{className:styles_formField},React__default.createElement("label",{htmlFor:"link-title",title:t2("createLink.titleTooltip","The link's title attribute, shown on hover")},t2("createLink.title","Link title")),React__default.createElement("input",{id:"link-title",className:styles_textInput,size:40,...register("title")})):null,React__default.createElement("div",{style:{display:"flex",justifyContent:"flex-end",gap:"var(--spacing-2)"}},React__default.createElement("button",{type:"submit",title:t2("createLink.saveTooltip","Set URL"),"aria-label":t2("createLink.saveTooltip","Set URL"),className:classNames(styles_primaryButton)},t2("dialogControls.save","Save")),React__default.createElement("button",{type:"reset",title:t2("createLink.cancelTooltip","Cancel change"),"aria-label":t2("createLink.cancelTooltip","Cancel change"),className:classNames(styles_secondaryButton)},t2("dialogControls.cancel","Cancel"))))}const LinkDialog=()=>{const[editorRootElementRef,activeEditor,iconComponentFor,linkDialogState,linkAutocompleteSuggestions,onClickLinkCallback,showLinkTitleField]=X$3(editorRootElementRef$,activeEditor$,iconComponentFor$,linkDialogState$,linkAutocompleteSuggestions$,onClickLinkCallback$,showLinkTitleField$),publishWindowChange=A$4(onWindowChange$),updateLink=A$4(updateLink$),cancelLinkEdit=A$4(cancelLinkEdit$),switchFromPreviewToLinkEdit=A$4(switchFromPreviewToLinkEdit$),removeLink=A$4(removeLink$);React__default.useEffect(()=>{const update=()=>{null==activeEditor||activeEditor.getEditorState().read(()=>{publishWindowChange(!0)})};return window.addEventListener("resize",update),window.addEventListener("scroll",update),()=>{window.removeEventListener("resize",update),window.removeEventListener("scroll",update)}},[activeEditor,publishWindowChange]);const[copyUrlTooltipOpen,setCopyUrlTooltipOpen]=React__default.useState(!1),t2=useTranslation();if("inactive"===linkDialogState.type)return null;const theRect=linkDialogState.rectangle,urlIsExternal="preview"===linkDialogState.type&&linkDialogState.url.startsWith("http");return React__default.createElement(Root2$2,{open:!0},React__default.createElement(Anchor2,{"data-visible":"edit"===linkDialogState.type,className:styles_linkDialogAnchor,style:{top:`${theRect.top}px`,left:`${theRect.left}px`,width:`${theRect.width}px`,height:`${theRect.height}px`}}),React__default.createElement(Portal$3,{container:null==editorRootElementRef?void 0:editorRootElementRef.current},React__default.createElement(Content2$2,{className:classNames(styles_linkDialogPopoverContent),sideOffset:5,onOpenAutoFocus:e2=>{e2.preventDefault()},key:linkDialogState.linkNodeKey},"edit"===linkDialogState.type&&React__default.createElement(LinkEditForm,{url:linkDialogState.url,title:linkDialogState.title,text:linkDialogState.text,onSubmit:updateLink,onCancel:cancelLinkEdit.bind(null),linkAutocompleteSuggestions:linkAutocompleteSuggestions,showLinkTitleField:showLinkTitleField,showAnchorTextField:linkDialogState.withAnchorText}),"preview"===linkDialogState.type&&React__default.createElement(React__default.Fragment,null,React__default.createElement("a",{className:styles_linkDialogPreviewAnchor,href:linkDialogState.url,...urlIsExternal?{target:"_blank",rel:"noreferrer"}:{},onClick:e2=>{null!==onClickLinkCallback&&(e2.preventDefault(),onClickLinkCallback(linkDialogState.url))},title:urlIsExternal?t2("linkPreview.open","Open {{url}} in new window",{url:linkDialogState.url}):linkDialogState.url},React__default.createElement("span",null,linkDialogState.url),urlIsExternal&&iconComponentFor("open_in_new")),React__default.createElement(ActionButton,{onClick:()=>{switchFromPreviewToLinkEdit()},title:t2("linkPreview.edit","Edit link URL"),"aria-label":t2("linkPreview.edit","Edit link URL")},iconComponentFor("edit")),React__default.createElement(Provider,null,React__default.createElement(Root3,{open:copyUrlTooltipOpen},React__default.createElement(Trigger,{asChild:!0},React__default.createElement(ActionButton,{title:t2("linkPreview.copyToClipboard","Copy to clipboard"),"aria-label":t2("linkPreview.copyToClipboard","Copy to clipboard"),onClick:()=>{window.navigator.clipboard.writeText(linkDialogState.url).then(()=>{setCopyUrlTooltipOpen(!0),setTimeout(()=>{setCopyUrlTooltipOpen(!1)},1e3)})}},iconComponentFor(copyUrlTooltipOpen?"check":"content_copy"))),React__default.createElement(Portal,{container:null==editorRootElementRef?void 0:editorRootElementRef.current},React__default.createElement(Content2,{className:classNames(styles_tooltipContent),sideOffset:5},t2("linkPreview.copied","Copied!"),React__default.createElement(Arrow2,null))))),React__default.createElement(ActionButton,{title:t2("linkPreview.remove","Remove link"),"aria-label":t2("linkPreview.remove","Remove link"),onClick:()=>{removeLink()}},iconComponentFor("link_off"))),React__default.createElement(Arrow2$1,{className:styles_popoverArrow}))))},ActionButton=React__default.forwardRef(({className:className,...props},ref)=>React__default.createElement("button",{className:classNames(styles_actionButton,className),ref:ref,...props}));function getLinkNodeInSelection(selection2){if(!selection2)return null;const node2=function(selection2){try{const anchor=selection2.anchor,focus2=selection2.focus,anchorNode=selection2.anchor.getNode(),focusNode=selection2.focus.getNode();return anchorNode===focusNode?anchorNode:selection2.isBackward()?A$2(focus2)?anchorNode:focusNode:A$2(anchor)?anchorNode:focusNode}catch{return null}}(selection2);if(null===node2)return null;const parent=node2.getParent();return p$1(parent)?parent:p$1(node2)?node2:null}const onWindowChange$=K$3(),linkDialogState$=$$4({type:"inactive"},r2=>{r2.pub(createActiveEditorSubscription$,editor=>editor.registerCommand(Ae,()=>"preview"===r2.getValue(linkDialogState$).type&&(r2.pub(linkDialogState$,{type:"inactive"}),!0),1)),r2.sub(r2.pipe(viewMode$),viewMode=>{"rich-text"!==viewMode&&r2.pub(linkDialogState$,{type:"inactive"})}),r2.pub(createActiveEditorSubscription$,editor=>editor.registerCommand(Se,event=>{if("k"===event.key&&(IS_APPLE?event.metaKey:event.ctrlKey)&&!r2.getValue(readOnly$)){return!!ar(wr())&&(r2.pub(openLinkEditDialog$),event.stopPropagation(),event.preventDefault(),!0)}return!1},3)),r2.sub(r2.pipe(switchFromPreviewToLinkEdit$,tt$4(linkDialogState$,activeEditor$)),([,state,editor])=>{if("preview"!==state.type)throw new Error("Cannot switch to edit mode when not in preview mode");setTimeout(()=>{null==editor||editor.getEditorState().read(()=>{const node2=_s(state.linkNodeKey),withAnchorText=!!p$1(node2)&&(node2.getTextContent().length>0&&node2.getChildrenSize()<=1),text2=withAnchorText&&node2?node2.getTextContent():"";r2.pub(linkDialogState$,{type:"edit",initialUrl:state.url,url:state.url,title:state.title,text:text2,withAnchorText:withAnchorText,linkNodeKey:state.linkNodeKey,rectangle:state.rectangle})})})}),r2.sub(r2.pipe(updateLink$,tt$4(activeEditor$,linkDialogState$,currentSelection$)),([payload,editor,state,selection2])=>{var _a,_b,_c;const text2=(null==(_a=payload.text)?void 0:_a.trim())??"",url=(null==(_b=payload.url)?void 0:_b.trim())??"",title=(null==(_c=payload.title)?void 0:_c.trim())??"";if(""!==url){if(null==selection2?void 0:selection2.isCollapsed()){const linkContent=text2||title||url;null==editor||editor.update(()=>{const linkNode=getLinkNodeInSelection(selection2);if(linkNode)if(O(linkNode)){const newLinkNode=d$2(url,{title:title});newLinkNode.append(Qn(text2)),linkNode.replace(newLinkNode),newLinkNode.select()}else linkNode.setURL(url),linkNode.setTitle(title),updateLinkText(linkNode.getFirstChild(),text2);else{const node2=d$2(url,{title:title});node2.append(Qn(linkContent)),Lr([node2]),node2.select()}},{discrete:!0})}else null==editor||editor.update(()=>{updateLinkText(null==selection2?void 0:selection2.anchor.getNode(),text2)}),null==editor||editor.dispatchCommand(k$1,{url:url,title:title});r2.pub(linkDialogState$,{type:"preview",linkNodeKey:state.linkNodeKey,rectangle:state.rectangle,title:title,url:url})}else"edit"===state.type&&""!==state.initialUrl&&(null==editor||editor.dispatchCommand(k$1,null)),r2.pub(linkDialogState$,{type:"inactive"})}),r2.link(r2.pipe(cancelLinkEdit$,tt$4(linkDialogState$,activeEditor$),_$3(([,state,editor])=>{if("edit"===state.type)return null==editor||editor.focus(),""===state.initialUrl?{type:"inactive"}:{type:"preview",url:state.initialUrl,linkNodeKey:state.linkNodeKey,rectangle:state.rectangle};throw new Error("Cannot cancel edit when not in edit mode")})),linkDialogState$),r2.link(r2.pipe(r2.combine(currentSelection$,onWindowChange$),tt$4(activeEditor$,linkDialogState$,readOnly$),_$3(([[selection2],activeEditor,_2,readOnly])=>{if(ar(selection2)&&activeEditor&&!readOnly){const node2=getLinkNodeInSelection(selection2);if(!selection2.isCollapsed())return{type:"inactive"};if(node2){const rect=getSelectionRectangle(activeEditor);return rect?{type:"preview",url:node2.getURL(),linkNodeKey:node2.getKey(),title:node2.getTitle(),rectangle:rect}:{type:"inactive"}}return{type:"inactive"}}return{type:"inactive"}})),linkDialogState$)}),updateLink$=K$3(),cancelLinkEdit$=q$3();q$3();const switchFromPreviewToLinkEdit$=q$3(),removeLink$=q$3(r2=>{r2.sub(r2.pipe(removeLink$,tt$4(activeEditor$)),([,editor])=>{null==editor||editor.dispatchCommand(k$1,null)})}),openLinkEditDialog$=q$3(r2=>{r2.sub(r2.pipe(openLinkEditDialog$,tt$4(currentSelection$,activeEditor$),nt$4(([,selection2])=>ar(selection2))),([,selection2,editor])=>{null==editor||editor.focus(()=>{setTimeout(()=>{editor.getEditorState().read(()=>{const linkNode=getLinkNodeInSelection(selection2),rectangle=getSelectionRectangle(editor),initialUrl=(null==linkNode?void 0:linkNode.getURL())??"",url=(null==linkNode?void 0:linkNode.getURL())??"",title=(null==linkNode?void 0:linkNode.getTitle())??"",linkNodeKey=(null==linkNode?void 0:linkNode.getKey())??"",withAnchorText=linkNode?linkNode.getTextContent().length>0&&linkNode.getChildrenSize()<=1:Boolean(null==selection2?void 0:selection2.isCollapsed()),text2=withAnchorText&&linkNode?linkNode.getTextContent():"";r2.pub(linkDialogState$,{type:"edit",initialUrl:initialUrl,url:url,title:title,text:text2,withAnchorText:withAnchorText,linkNodeKey:linkNodeKey,rectangle:rectangle})})})})})}),linkAutocompleteSuggestions$=$$4([]),onClickLinkCallback$=$$4(null),onReadOnlyClickLinkCallback$=$$4(null,r2=>{r2.pub(createActiveEditorSubscription$,editor=>{function onClick(event){const[readOnly,callback]=r2.getValues([readOnly$,onReadOnlyClickLinkCallback$]);readOnly&&null!==callback&&editor.update(()=>{const nearestNode=ms(event.target);if(null!==nearestNode){const targetNode=wt$2(nearestNode,node2=>node2 instanceof g);null!==targetNode&&callback(event,targetNode,targetNode.getURL())}})}return editor.registerRootListener((rootElement,prevRoot)=>{rootElement&&rootElement.addEventListener("click",onClick),prevRoot&&prevRoot.removeEventListener("click",onClick)})})});function updateLinkText(node2,text2){Zn(node2)&&text2&&(node2.setTextContent(text2),node2.selectStart())}const showLinkTitleField$=$$4(!0),linkDialogPlugin=realmPlugin({init(r2,params){r2.pub(addComposerChild$,(null==params?void 0:params.LinkDialog)??LinkDialog),r2.pub(onClickLinkCallback$,(null==params?void 0:params.onClickLinkCallback)??null),r2.pub(onReadOnlyClickLinkCallback$,(null==params?void 0:params.onReadOnlyClickLinkCallback)??null),r2.pub(showLinkTitleField$,(null==params?void 0:params.showLinkTitleField)??!0)},update(r2,params={}){r2.pub(linkAutocompleteSuggestions$,params.linkAutocompleteSuggestions??[])}});function decorateWithRef(Component,decoratedProps){return React__default.forwardRef((props,ref)=>{const className=classNames(decoratedProps.className,props.className);return React__default.createElement(Component,{...decoratedProps,...props,className:className,ref:ref})})}const Root=({readOnly:readOnly,children:children,className:className})=>React__default.createElement(Root4,{className:classNames("mdxeditor-toolbar",styles_toolbarRoot,{[styles_readOnlyToolbarRoot]:readOnly},className),...readOnly?{tabIndex:-1}:{}},children),Button=decorateWithRef(Button$1,{className:styles_toolbarButton,"data-toolbar-item":!0}),ButtonWithTooltip=(Component=Button,({title:title,children:children,...props})=>React__default.createElement(Component,{"aria-label":title,...props},React__default.createElement(TooltipWrap,{title:title},children)));var Component;const ToolbarToggleItem=decorateWithRef(ToggleItem,{className:styles_toolbarToggleItem,"data-toolbar-item":!0});decorateWithRef(ToggleGroup,{type:"single",className:styles_toolbarToggleSingleGroup});const ToggleSingleGroupWithItem=React__default.forwardRef(({on:on2,title:title,children:children,disabled:disabled,...props},forwardedRef)=>React__default.createElement(ToggleGroup,{type:"single",className:styles_toolbarToggleSingleGroup,...props,value:on2?"on":"off",ref:forwardedRef},React__default.createElement(ToolbarToggleItem,{"aria-label":title,value:"on",disabled:disabled},React__default.createElement(TooltipWrap,{title:title},children)))),MultipleChoiceToggleGroup=({items:items})=>React__default.createElement("div",{className:styles_toolbarGroupOfGroups},items.map((item,index2)=>React__default.createElement(ToggleSingleGroupWithItem,{key:index2,title:item.title,on:item.active,onValueChange:v2=>{item.onChange("on"===v2)},disabled:item.disabled},item.contents))),SingleChoiceToggleGroup=({value:value,onChange:onChange,className:className,ggClassName:ggClassName,items:items,disabled:disabled})=>{const t2=useTranslation();return React__default.createElement("div",{className:classNames(styles_toolbarGroupOfGroups,ggClassName)},React__default.createElement(ToggleGroup,{"aria-label":t2("toolbar.toggleGroup","toggle group"),type:"single",className:classNames(styles_toolbarToggleSingleGroup,className),onValueChange:onChange,value:value||"",disabled:disabled,onFocus:e2=>{e2.preventDefault()}},items.map((item,index2)=>React__default.createElement(ToolbarToggleItem,{key:index2,"aria-label":item.title,value:item.value},React__default.createElement(TooltipWrap,{title:item.title},item.contents)))))},Separator=Separator$2,toolbarContents$=$$4(()=>null),toolbarClassName$=$$4(""),DEFAULT_TOOLBAR_CONTENTS=()=>"This is an empty toolbar. Pass `{toolbarContents: () => { return <>toolbar components</> }}` to the toolbarPlugin to customize it.",toolbarPlugin=realmPlugin({init(realm,params){const toolbarPositionSymbol="bottom"===(null==params?void 0:params.toolbarPosition)?addBottomAreaChild$:addTopAreaChild$;realm.pubIn({[toolbarContents$]:(null==params?void 0:params.toolbarContents)??DEFAULT_TOOLBAR_CONTENTS,[toolbarClassName$]:(null==params?void 0:params.toolbarClassName)??"",[toolbarPositionSymbol]:()=>{const[toolbarContents,readOnly,toolbarClassName]=X$3(toolbarContents$,readOnly$,toolbarClassName$);return React__default.createElement(Root,{className:toolbarClassName,readOnly:readOnly},toolbarContents())}})},update(realm,params){realm.pub(toolbarContents$,(null==params?void 0:params.toolbarContents)??DEFAULT_TOOLBAR_CONTENTS),realm.pub(toolbarClassName$,(null==params?void 0:params.toolbarClassName)??"")}});class Change{constructor(fromA,toA,fromB,toB){this.fromA=fromA,this.toA=toA,this.fromB=fromB,this.toB=toB}offset(offA,offB=offA){return new Change(this.fromA+offA,this.toA+offA,this.fromB+offB,this.toB+offB)}}function findDiff(a2,fromA,toA,b2,fromB,toB){if(a2==b2)return[];let prefix=commonPrefix(a2,fromA,toA,b2,fromB,toB),suffix=commonSuffix(a2,fromA+prefix,toA,b2,fromB+prefix,toB),lenA=(toA-=suffix)-(fromA+=prefix),lenB=(toB-=suffix)-(fromB+=prefix);if(!lenA||!lenB)return[new Change(fromA,toA,fromB,toB)];if(lenA>lenB){let found=a2.slice(fromA,toA).indexOf(b2.slice(fromB,toB));if(found>-1)return[new Change(fromA,fromA+found,fromB,fromB),new Change(fromA+found+lenB,toA,toB,toB)]}else if(lenB>lenA){let found=b2.slice(fromB,toB).indexOf(a2.slice(fromA,toA));if(found>-1)return[new Change(fromA,fromA,fromB,fromB+found),new Change(toA,toA,fromB+found+lenA,toB)]}if(1==lenA||1==lenB)return[new Change(fromA,toA,fromB,toB)];let half=halfMatch(a2,fromA,toA,b2,fromB,toB);if(half){let[sharedA,sharedB,sharedLen]=half;return findDiff(a2,fromA,sharedA,b2,fromB,sharedB).concat(findDiff(a2,sharedA+sharedLen,toA,b2,sharedB+sharedLen,toB))}return function(a2,fromA,toA,b2,fromB,toB){let lenA=toA-fromA,lenB=toB-fromB;if(scanLimit<1e9&&Math.min(lenA,lenB)>16*scanLimit||timeout>0&&Date.now()>timeout)return Math.min(lenA,lenB)>64*scanLimit?[new Change(fromA,toA,fromB,toB)]:crudeMatch(a2,fromA,toA,b2,fromB,toB);let off=Math.ceil((lenA+lenB)/2);frontier1.reset(off),frontier2.reset(off);let match1=(x2,y2)=>a2.charCodeAt(fromA+x2)==b2.charCodeAt(fromB+y2),match2=(x2,y2)=>a2.charCodeAt(toA-x2-1)==b2.charCodeAt(toB-y2-1),test1=(lenA-lenB)%2!=0?frontier2:null,test2=test1?null:frontier1;for(let depth=0;depth<off;depth++){if(depth>scanLimit||timeout>0&&!(63&depth)&&Date.now()>timeout)return crudeMatch(a2,fromA,toA,b2,fromB,toB);let done=frontier1.advance(depth,lenA,lenB,off,test1,!1,match1)||frontier2.advance(depth,lenA,lenB,off,test2,!0,match2);if(done)return bisect(a2,fromA,toA,fromA+done[0],b2,fromB,toB,fromB+done[1])}return[new Change(fromA,toA,fromB,toB)]}(a2,fromA,toA,b2,fromB,toB)}let scanLimit=1e9,timeout=0,crude=!1;class Frontier{constructor(){this.vec=[]}reset(off){this.len=off<<1;for(let i2=0;i2<this.len;i2++)this.vec[i2]=-1;this.vec[off+1]=0,this.start=this.end=0}advance(depth,lenX,lenY,vOff,other,fromBack,match){for(let k3=-depth+this.start;k3<=depth-this.end;k3+=2){let off=vOff+k3,x2=k3==-depth||k3!=depth&&this.vec[off-1]<this.vec[off+1]?this.vec[off+1]:this.vec[off-1]+1,y2=x2-k3;for(;x2<lenX&&y2<lenY&&match(x2,y2);)x2++,y2++;if(this.vec[off]=x2,x2>lenX)this.end+=2;else if(y2>lenY)this.start+=2;else if(other){let offOther=vOff+(lenX-lenY)-k3;if(offOther>=0&&offOther<this.len&&-1!=other.vec[offOther])if(fromBack){let xOther=other.vec[offOther];if(xOther>=lenX-x2)return[xOther,vOff+xOther-offOther]}else{if(x2>=lenX-other.vec[offOther])return[x2,y2]}}}return null}}const frontier1=new Frontier,frontier2=new Frontier;function bisect(a2,fromA,toA,splitA,b2,fromB,toB,splitB){let stop=!1;return validIndex(a2,splitA)||++splitA!=toA||(stop=!0),validIndex(b2,splitB)||++splitB!=toB||(stop=!0),stop?[new Change(fromA,toA,fromB,toB)]:findDiff(a2,fromA,splitA,b2,fromB,splitB).concat(findDiff(a2,splitA,toA,b2,splitB,toB))}function chunkSize(lenA,lenB){let size2=1,max2=Math.min(lenA,lenB);for(;size2<max2;)size2<<=1;return size2}function commonPrefix(a2,fromA,toA,b2,fromB,toB){if(fromA==toA||fromA==toB||a2.charCodeAt(fromA)!=b2.charCodeAt(fromB))return 0;let chunk=chunkSize(toA-fromA,toB-fromB);for(let pA=fromA,pB=fromB;;){let endA=pA+chunk,endB=pB+chunk;if(endA>toA||endB>toB||a2.slice(pA,endA)!=b2.slice(pB,endB)){if(1==chunk)return pA-fromA-(validIndex(a2,pA)?0:1);chunk>>=1}else{if(endA==toA||endB==toB)return endA-fromA;pA=endA,pB=endB}}}function commonSuffix(a2,fromA,toA,b2,fromB,toB){if(fromA==toA||fromB==toB||a2.charCodeAt(toA-1)!=b2.charCodeAt(toB-1))return 0;let chunk=chunkSize(toA-fromA,toB-fromB);for(let pA=toA,pB=toB;;){let sA=pA-chunk,sB=pB-chunk;if(sA<fromA||sB<fromB||a2.slice(sA,pA)!=b2.slice(sB,pB)){if(1==chunk)return toA-pA-(validIndex(a2,pA)?0:1);chunk>>=1}else{if(sA==fromA||sB==fromB)return toA-sA;pA=sA,pB=sB}}}function findMatch(a2,fromA,toA,b2,fromB,toB,size2,divideTo){let rangeB=b2.slice(fromB,toB),best=null;for(;;){if(best||size2<divideTo)return best;for(let start2=fromA+size2;;){validIndex(a2,start2)||start2++;let end=start2+size2;if(validIndex(a2,end)||(end+=end==start2+1?1:-1),end>=toA)break;let seed=a2.slice(start2,end),found=-1;for(;-1!=(found=rangeB.indexOf(seed,found+1));){let prefixAfter=commonPrefix(a2,end,toA,b2,fromB+found+seed.length,toB),suffixBefore=commonSuffix(a2,fromA,start2,b2,fromB,fromB+found),length=seed.length+prefixAfter+suffixBefore;(!best||best[2]<length)&&(best=[start2-suffixBefore,fromB+found-suffixBefore,length])}start2=end}if(divideTo<0)return best;size2>>=1}}function halfMatch(a2,fromA,toA,b2,fromB,toB){let lenA=toA-fromA,lenB=toB-fromB;if(lenA<lenB){let result=halfMatch(b2,fromB,toB,a2,fromA,toA);return result&&[result[1],result[0],result[2]]}return lenA<4||2*lenB<lenA?null:findMatch(a2,fromA,toA,b2,fromB,toB,Math.floor(lenA/4),-1)}function crudeMatch(a2,fromA,toA,b2,fromB,toB){crude=!0;let result,lenA=toA-fromA,lenB=toB-fromB;if(lenA<lenB){let inv=findMatch(b2,fromB,toB,a2,fromA,toA,Math.floor(lenA/6),50);result=inv&&[inv[1],inv[0],inv[2]]}else result=findMatch(a2,fromA,toA,b2,fromB,toB,Math.floor(lenB/6),50);if(!result)return[new Change(fromA,toA,fromB,toB)];let[sharedA,sharedB,sharedLen]=result;return findDiff(a2,fromA,sharedA,b2,fromB,sharedB).concat(findDiff(a2,sharedA+sharedLen,toA,b2,sharedB+sharedLen,toB))}function mergeAdjacent(changes,minGap){for(let i2=1;i2<changes.length;i2++){let prev=changes[i2-1],cur=changes[i2];prev.toA>cur.fromA-minGap&&prev.toB>cur.fromB-minGap&&(changes[i2-1]=new Change(prev.fromA,cur.toA,prev.fromB,cur.toB),changes.splice(i2--,1))}}let wordChar;try{wordChar=new RegExp("[\\p{Alphabetic}\\p{Number}]","u")}catch(_2){}function asciiWordChar(code2){return code2>48&&code2<58||code2>64&&code2<91||code2>96&&code2<123}function wordCharAfter(s2,pos){if(pos==s2.length)return 0;let next=s2.charCodeAt(pos);return next<192?asciiWordChar(next)?1:0:wordChar?isSurrogate1(next)&&pos!=s2.length-1?wordChar.test(s2.slice(pos,pos+2))?2:0:wordChar.test(String.fromCharCode(next))?1:0:0}function wordCharBefore(s2,pos){if(!pos)return 0;let prev=s2.charCodeAt(pos-1);return prev<192?asciiWordChar(prev)?1:0:wordChar?isSurrogate2(prev)&&1!=pos?wordChar.test(s2.slice(pos-2,pos))?2:0:wordChar.test(String.fromCharCode(prev))?1:0:0}const MAX_SCAN=8;function findWordBoundaryAfter(s2,pos,max2){if(pos==s2.length||!wordCharBefore(s2,pos))return pos;for(let cur=pos,end=pos+max2,i2=0;i2<MAX_SCAN;i2++){let size2=wordCharAfter(s2,cur);if(!size2||cur+size2>end)return cur;cur+=size2}return pos}function findWordBoundaryBefore(s2,pos,max2){if(!pos||!wordCharAfter(s2,pos))return pos;for(let cur=pos,end=pos-max2,i2=0;i2<MAX_SCAN;i2++){let size2=wordCharBefore(s2,cur);if(!size2||cur-size2<end)return cur;cur-=size2}return pos}function findLineBreakBefore(s2,pos,stop){for(;pos!=stop;pos--)if(10==s2.charCodeAt(pos-1))return pos;return-1}function findLineBreakAfter(s2,pos,stop){for(;pos!=stop;pos++)if(10==s2.charCodeAt(pos))return pos;return-1}const isSurrogate1=code2=>code2>=55296&&code2<=56319,isSurrogate2=code2=>code2>=56320&&code2<=57343;function validIndex(s2,index2){return!index2||index2==s2.length||!isSurrogate1(s2.charCodeAt(index2-1))||!isSurrogate2(s2.charCodeAt(index2))}function diff2(a2,b2,config){var _a;let override=null==config?void 0:config.override;return override?override(a2,b2):(scanLimit=(null!==(_a=null==config?void 0:config.scanLimit)&&void 0!==_a?_a:1e9)>>1,timeout=(null==config?void 0:config.timeout)?Date.now()+config.timeout:0,crude=!1,function(a2,b2,changes){for(;;){mergeAdjacent(changes,1);let moved=!1;for(let i2=0;i2<changes.length;i2++){let pre,post,ch=changes[i2];(pre=commonPrefix(a2,ch.fromA,ch.toA,b2,ch.fromB,ch.toB))&&(ch=changes[i2]=new Change(ch.fromA+pre,ch.toA,ch.fromB+pre,ch.toB)),(post=commonSuffix(a2,ch.fromA,ch.toA,b2,ch.fromB,ch.toB))&&(ch=changes[i2]=new Change(ch.fromA,ch.toA-post,ch.fromB,ch.toB-post));let lenA=ch.toA-ch.fromA,lenB=ch.toB-ch.fromB;if(lenA&&lenB)continue;let beforeLen=ch.fromA-(i2?changes[i2-1].toA:0),afterLen=(i2<changes.length-1?changes[i2+1].fromA:a2.length)-ch.toA;if(!beforeLen||!afterLen)continue;let text2=lenA?a2.slice(ch.fromA,ch.toA):b2.slice(ch.fromB,ch.toB);beforeLen<=text2.length&&a2.slice(ch.fromA-beforeLen,ch.fromA)==text2.slice(text2.length-beforeLen)?(changes[i2]=new Change(ch.fromA-beforeLen,ch.toA-beforeLen,ch.fromB-beforeLen,ch.toB-beforeLen),moved=!0):afterLen<=text2.length&&a2.slice(ch.toA,ch.toA+afterLen)==text2.slice(0,afterLen)&&(changes[i2]=new Change(ch.fromA+afterLen,ch.toA+afterLen,ch.fromB+afterLen,ch.toB+afterLen),moved=!0)}if(!moved)break}return changes}(a2,b2,findDiff(a2,0,a2.length,b2,0,b2.length)))}function diffIsPrecise(){return!crude}function presentableDiff(a2,b2,config){return function(changes,a2,b2){for(let posA=0,i2=0;i2<changes.length;i2++){let change=changes[i2],lenA=change.toA-change.fromA,lenB=change.toB-change.fromB;if(lenA&&lenB||lenA>3||lenB>3){let nextChangeA=i2==changes.length-1?a2.length:changes[i2+1].fromA,maxScanBefore=change.fromA-posA,maxScanAfter=nextChangeA-change.toA,boundBefore=findWordBoundaryBefore(a2,change.fromA,maxScanBefore),boundAfter=findWordBoundaryAfter(a2,change.toA,maxScanAfter),lenBefore=change.fromA-boundBefore,lenAfter=boundAfter-change.toA;if((!lenA||!lenB)&&lenBefore&&lenAfter){let changeLen=Math.max(lenA,lenB),[changeText,changeFrom,changeTo]=lenA?[a2,change.fromA,change.toA]:[b2,change.fromB,change.toB];changeLen>lenBefore&&a2.slice(boundBefore,change.fromA)==changeText.slice(changeTo-lenBefore,changeTo)?(change=changes[i2]=new Change(boundBefore,boundBefore+lenA,change.fromB-lenBefore,change.toB-lenBefore),boundBefore=change.fromA,boundAfter=findWordBoundaryAfter(a2,change.toA,nextChangeA-change.toA)):changeLen>lenAfter&&a2.slice(change.toA,boundAfter)==changeText.slice(changeFrom,changeFrom+lenAfter)&&(change=changes[i2]=new Change(boundAfter-lenA,boundAfter,change.fromB+lenAfter,change.toB+lenAfter),boundAfter=change.toA,boundBefore=findWordBoundaryBefore(a2,change.fromA,change.fromA-posA)),lenBefore=change.fromA-boundBefore,lenAfter=boundAfter-change.toA}if(lenBefore||lenAfter)change=changes[i2]=new Change(change.fromA-lenBefore,change.toA+lenAfter,change.fromB-lenBefore,change.toB+lenAfter);else if(lenA){if(!lenB){let len,first=findLineBreakAfter(a2,change.fromA,change.toA),last=first<0?-1:findLineBreakBefore(a2,change.toA,change.fromA);first>-1&&(len=first-change.fromA)<=maxScanAfter&&a2.slice(change.fromA,first)==a2.slice(change.toA,change.toA+len)?change=changes[i2]=change.offset(len):last>-1&&(len=change.toA-last)<=maxScanBefore&&a2.slice(change.fromA-len,change.fromA)==a2.slice(last,change.toA)&&(change=changes[i2]=change.offset(-len))}}else{let len,first=findLineBreakAfter(b2,change.fromB,change.toB),last=first<0?-1:findLineBreakBefore(b2,change.toB,change.fromB);first>-1&&(len=first-change.fromB)<=maxScanAfter&&b2.slice(change.fromB,first)==b2.slice(change.toB,change.toB+len)?change=changes[i2]=change.offset(len):last>-1&&(len=change.toB-last)<=maxScanBefore&&b2.slice(change.fromB-len,change.fromB)==b2.slice(last,change.toB)&&(change=changes[i2]=change.offset(-len))}}posA=change.toA}return mergeAdjacent(changes,3),changes}(diff2(a2,b2,config),a2,b2)}const mergeConfig=Facet.define({combine:values=>values[0]}),setChunks=StateEffect.define(),computeChunks=Facet.define(),ChunkField=StateField.define({create:state=>null,update(current,tr2){for(let e2 of tr2.effects)e2.is(setChunks)&&(current=e2.value);for(let comp of tr2.state.facet(computeChunks))current=comp(current,tr2);return current}});class Chunk{constructor(changes,fromA,toA,fromB,toB,precise=!0){this.changes=changes,this.fromA=fromA,this.toA=toA,this.fromB=fromB,this.toB=toB,this.precise=precise}offset(offA,offB){return offA||offB?new Chunk(this.changes,this.fromA+offA,this.toA+offA,this.fromB+offB,this.toB+offB,this.precise):this}get endA(){return Math.max(this.fromA,this.toA-1)}get endB(){return Math.max(this.fromB,this.toB-1)}static build(a2,b2,conf){return toChunks(presentableDiff(a2.toString(),b2.toString(),conf),a2,b2,0,0,diffIsPrecise())}static updateA(chunks,a2,b2,changes,conf){return updateChunks(findRangesForChange(chunks,changes,!0,b2.length),chunks,a2,b2,conf)}static updateB(chunks,a2,b2,changes,conf){return updateChunks(findRangesForChange(chunks,changes,!1,a2.length),chunks,a2,b2,conf)}}function fromLine(fromA,fromB,a2,b2){let lineA=a2.lineAt(fromA),lineB=b2.lineAt(fromB);return lineA.to==fromA&&lineB.to==fromB&&fromA<a2.length&&fromB<b2.length?[fromA+1,fromB+1]:[lineA.from,lineB.from]}function toLine(toA,toB,a2,b2){let lineA=a2.lineAt(toA),lineB=b2.lineAt(toB);return lineA.from==toA&&lineB.from==toB?[toA,toB]:[lineA.to+1,lineB.to+1]}function toChunks(changes,a2,b2,offA,offB,precise){let chunks=[];for(let i2=0;i2<changes.length;i2++){let change=changes[i2],[fromA,fromB]=fromLine(change.fromA+offA,change.fromB+offB,a2,b2),[toA,toB]=toLine(change.toA+offA,change.toB+offB,a2,b2),chunk=[change.offset(-fromA+offA,-fromB+offB)];for(;i2<changes.length-1;){let next=changes[i2+1],[nextA,nextB]=fromLine(next.fromA+offA,next.fromB+offB,a2,b2);if(nextA>toA+1&&nextB>toB+1)break;chunk.push(next.offset(-fromA+offA,-fromB+offB)),[toA,toB]=toLine(next.toA+offA,next.toB+offB,a2,b2),i2++}chunks.push(new Chunk(chunk,fromA,Math.max(fromA,toA),fromB,Math.max(fromB,toB),precise))}return chunks}const updateMargin=1e3;function findPos(chunks,pos,isA,start2){let lo2=0,hi2=chunks.length;for(;;){if(lo2==hi2){let refA=0,refB=0;lo2&&({toA:refA,toB:refB}=chunks[lo2-1]);let off=pos-(isA?refA:refB);return[refA+off,refB+off]}let mid=lo2+hi2>>1,chunk=chunks[mid],[from,to2]=isA?[chunk.fromA,chunk.toA]:[chunk.fromB,chunk.toB];if(from>pos)hi2=mid;else{if(!(to2<=pos))return start2?[chunk.fromA,chunk.fromB]:[chunk.toA,chunk.toB];lo2=mid+1}}}function findRangesForChange(chunks,changes,isA,otherLen){let ranges=[];return changes.iterChangedRanges((cFromA,cToA,cFromB,cToB)=>{let fromA=0,toA=isA?changes.length:otherLen,fromB=0,toB=isA?otherLen:changes.length;cFromA>updateMargin&&([fromA,fromB]=findPos(chunks,cFromA-updateMargin,isA,!0)),cToA<changes.length-updateMargin&&([toA,toB]=findPos(chunks,cToA+updateMargin,isA,!1));let last,lenDiff=cToB-cFromB-(cToA-cFromA),[diffA,diffB]=isA?[lenDiff,0]:[0,lenDiff];ranges.length&&(last=ranges[ranges.length-1]).toA>=fromA?ranges[ranges.length-1]={fromA:last.fromA,fromB:last.fromB,toA:toA,toB:toB,diffA:last.diffA+diffA,diffB:last.diffB+diffB}:ranges.push({fromA:fromA,toA:toA,fromB:fromB,toB:toB,diffA:diffA,diffB:diffB})}),ranges}function updateChunks(ranges,chunks,a2,b2,conf){if(!ranges.length)return chunks;let result=[];for(let i2=0,offA=0,offB=0,chunkI=0;;i2++){let range=i2==ranges.length?null:ranges[i2],fromA=range?range.fromA+offA:a2.length,fromB=range?range.fromB+offB:b2.length;for(;chunkI<chunks.length;){let next=chunks[chunkI];if(range&&(next.toA+offA>fromA||next.toB+offB>fromB))break;result.push(next.offset(offA,offB)),chunkI++}if(!range)break;let toA=range.toA+offA+range.diffA,toB=range.toB+offB+range.diffB,diff3=presentableDiff(a2.sliceString(fromA,toA),b2.sliceString(fromB,toB),conf);for(let chunk of toChunks(diff3,a2,b2,fromA,fromB,diffIsPrecise()))result.push(chunk);for(offA+=range.diffA,offB+=range.diffB;chunkI<chunks.length;){let next=chunks[chunkI];if(next.fromA+offA>toA&&next.fromB+offB>toB)break;chunkI++}}return result}const defaultDiffConfig={scanLimit:500},decorateChunks=ViewPlugin.fromClass(class{constructor(view){({deco:this.deco,gutter:this.gutter}=getChunkDeco(view))}update(update){var s1,s2;(update.docChanged||update.viewportChanged||(s1=update.startState,s2=update.state,s1.field(ChunkField,!1)!=s2.field(ChunkField,!1))||function(s1,s2){return s1.facet(mergeConfig)!=s2.facet(mergeConfig)}(update.startState,update.state))&&({deco:this.deco,gutter:this.gutter}=getChunkDeco(update.view))}},{decorations:d2=>d2.deco}),changeGutter=Prec.low(gutter({class:"cm-changeGutter",markers:view=>{var _a;return(null===(_a=view.plugin(decorateChunks))||void 0===_a?void 0:_a.gutter)||RangeSet.empty}}));const changedLine=Decoration.line({class:"cm-changedLine"}),changedText=Decoration.mark({class:"cm-changedText"}),inserted=Decoration.mark({tagName:"ins",class:"cm-insertedLine"}),deleted=Decoration.mark({tagName:"del",class:"cm-deletedLine"}),changedLineGutterMarker=new class extends GutterMarker{constructor(){super(...arguments),this.elementClass="cm-changedLineGutter"}};function buildChunkDeco(chunk,doc,isA,highlight,builder,gutterBuilder){let from=isA?chunk.fromA:chunk.fromB,to2=isA?chunk.toA:chunk.toB,changeI=0;if(from!=to2){builder.add(from,from,changedLine),builder.add(from,to2,isA?deleted:inserted),gutterBuilder&&gutterBuilder.add(from,from,changedLineGutterMarker);for(let iter=doc.iterRange(from,to2-1),pos=from;!iter.next().done;){if(iter.lineBreak){pos++,builder.add(pos,pos,changedLine),gutterBuilder&&gutterBuilder.add(pos,pos,changedLineGutterMarker);continue}let lineEnd=pos+iter.value.length;if(highlight)for(;changeI<chunk.changes.length;){let nextChange=chunk.changes[changeI],nextFrom=from+(isA?nextChange.fromA:nextChange.fromB),nextTo=from+(isA?nextChange.toA:nextChange.toB),chFrom=Math.max(pos,nextFrom),chTo=Math.min(lineEnd,nextTo);if(chFrom<chTo&&builder.add(chFrom,chTo,changedText),!(nextTo<lineEnd))break;changeI++}pos=lineEnd}}}function getChunkDeco(view){let chunks=view.state.field(ChunkField),{side:side,highlightChanges:highlightChanges,markGutter:markGutter,overrideChunk:overrideChunk}=view.state.facet(mergeConfig),isA="a"==side,builder=new RangeSetBuilder,gutterBuilder=markGutter?new RangeSetBuilder:null,{from:from,to:to2}=view.viewport;for(let chunk of chunks){if((isA?chunk.fromA:chunk.fromB)>=to2)break;(isA?chunk.toA:chunk.toB)>from&&(overrideChunk&&overrideChunk(view.state,chunk,builder,gutterBuilder)||buildChunkDeco(chunk,view.state.doc,isA,highlightChanges,builder,gutterBuilder))}return{deco:builder.finish(),gutter:gutterBuilder&&gutterBuilder.finish()}}class Spacer extends WidgetType{constructor(height){super(),this.height=height}eq(other){return this.height==other.height}toDOM(){let elt=document.createElement("div");return elt.className="cm-mergeSpacer",elt.style.height=this.height+"px",elt}updateDOM(dom){return dom.style.height=this.height+"px",!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}const adjustSpacers=StateEffect.define({map:(value,mapping)=>value.map(mapping)}),Spacers=StateField.define({create:()=>Decoration.none,update:(spacers,tr2)=>{for(let e2 of tr2.effects)if(e2.is(adjustSpacers))return e2.value;return spacers.map(tr2.changes)},provide:f3=>EditorView.decorations.from(f3)});function compareSpacers(a2,b2){if(a2.size!=b2.size)return!1;let iA=a2.iter(),iB=b2.iter();for(;iA.value;){if(iA.from!=iB.from||Math.abs(iA.value.spec.widget.height-iB.value.spec.widget.height)>1)return!1;iA.next(),iB.next()}return!0}const uncollapseUnchanged=StateEffect.define({map:(value,change)=>change.mapPos(value)});class CollapseWidget extends WidgetType{constructor(lines){super(),this.lines=lines}eq(other){return this.lines==other.lines}toDOM(view){let outer=document.createElement("div");return outer.className="cm-collapsedLines",outer.textContent=view.state.phrase("$ unchanged lines",this.lines),outer.addEventListener("click",e2=>{let pos=view.posAtDOM(e2.target);view.dispatch({effects:uncollapseUnchanged.of(pos)});let{side:side,sibling:sibling}=view.state.facet(mergeConfig);sibling&&sibling().dispatch({effects:uncollapseUnchanged.of(mapPos(pos,view.state.field(ChunkField),"a"==side))})}),outer}ignoreEvent(e2){return e2 instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return"collapsed-unchanged-code"}}function mapPos(pos,chunks,isA){let startOur=0,startOther=0;for(let i2=0;;i2++){let next=i2<chunks.length?chunks[i2]:null;if(!next||(isA?next.fromA:next.fromB)>=pos)return startOther+(pos-startOur);[startOur,startOther]=isA?[next.toA,next.toB]:[next.toB,next.toA]}}const CollapsedRanges=StateField.define({create:state=>Decoration.none,update(deco,tr2){deco=deco.map(tr2.changes);for(let e2 of tr2.effects)e2.is(uncollapseUnchanged)&&(deco=deco.update({filter:from=>from!=e2.value}));return deco},provide:f3=>EditorView.decorations.from(f3)});function collapseUnchanged({margin:margin=3,minSize:minSize=4}){return CollapsedRanges.init(state=>function(state,margin,minLines){let builder=new RangeSetBuilder,isA="a"==state.facet(mergeConfig).side,chunks=state.field(ChunkField),prevLine=1;for(let i2=0;;i2++){let chunk=i2<chunks.length?chunks[i2]:null,collapseFrom=i2?prevLine+margin:1,collapseTo=chunk?state.doc.lineAt(isA?chunk.fromA:chunk.fromB).number-1-margin:state.doc.lines,lines=collapseTo-collapseFrom+1;if(lines>=minLines&&builder.add(state.doc.line(collapseFrom).from,state.doc.line(collapseTo).to,Decoration.replace({widget:new CollapseWidget(lines),block:!0})),!chunk)break;prevLine=state.doc.lineAt(Math.min(state.doc.length,isA?chunk.toA:chunk.toB)).number}return builder.finish()}(state,margin,minSize))}const externalTheme=EditorView.styleModule.of(new StyleModule({".cm-mergeView":{overflowY:"auto"},".cm-mergeViewEditors":{display:"flex",alignItems:"stretch"},".cm-mergeViewEditor":{flexGrow:1,flexBasis:0,overflow:"hidden"},".cm-merge-revert":{width:"1.6em",flexGrow:0,flexShrink:0,position:"relative"},".cm-merge-revert button":{position:"absolute",display:"block",width:"100%",boxSizing:"border-box",textAlign:"center",background:"none",border:"none",font:"inherit",cursor:"pointer"}})),baseTheme=EditorView.baseTheme({".cm-mergeView & .cm-scroller, .cm-mergeView &":{height:"auto !important",overflowY:"visible !important"},"&.cm-merge-a .cm-changedLine, .cm-deletedChunk":{backgroundColor:"rgba(160, 128, 100, .08)"},"&.cm-merge-b .cm-changedLine, .cm-inlineChangedLine":{backgroundColor:"rgba(100, 160, 128, .08)"},"&light.cm-merge-a .cm-changedText, &light .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ee443366, #ee443366) bottom/100% 2px no-repeat"},"&dark.cm-merge-a .cm-changedText, &dark .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ffaa9966, #ffaa9966) bottom/100% 2px no-repeat"},"&light.cm-merge-b .cm-changedText":{background:"linear-gradient(#22bb22aa, #22bb22aa) bottom/100% 2px no-repeat"},"&dark.cm-merge-b .cm-changedText":{background:"linear-gradient(#88ff88aa, #88ff88aa) bottom/100% 2px no-repeat"},"&.cm-merge-b .cm-deletedText":{background:"#ff000033"},".cm-insertedLine, .cm-deletedLine, .cm-deletedLine del":{textDecoration:"none"},".cm-deletedChunk":{paddingLeft:"6px","& .cm-chunkButtons":{position:"absolute",insetInlineEnd:"5px"},"& button":{border:"none",cursor:"pointer",color:"white",margin:"0 2px",borderRadius:"3px","&[name=accept]":{background:"#2a2"},"&[name=reject]":{background:"#d43"}}},".cm-collapsedLines":{padding:"5px 5px 5px 10px",cursor:"pointer","&:before":{content:'"⦚"',marginInlineEnd:"7px"},"&:after":{content:'"⦚"',marginInlineStart:"7px"}},"&light .cm-collapsedLines":{color:"#444",background:"linear-gradient(to bottom, transparent 0, #f3f3f3 30%, #f3f3f3 70%, transparent 100%)"},"&dark .cm-collapsedLines":{color:"#ddd",background:"linear-gradient(to bottom, transparent 0, #222 30%, #222 70%, transparent 100%)"},".cm-changeGutter":{width:"3px",paddingLeft:"1px"},"&light.cm-merge-a .cm-changedLineGutter, &light .cm-deletedLineGutter":{background:"#e43"},"&dark.cm-merge-a .cm-changedLineGutter, &dark .cm-deletedLineGutter":{background:"#fa9"},"&light.cm-merge-b .cm-changedLineGutter":{background:"#2b2"},"&dark.cm-merge-b .cm-changedLineGutter":{background:"#8f8"},".cm-inlineChangedLineGutter":{background:"#75d"}}),collapseCompartment=new Compartment,configCompartment=new Compartment;class MergeView{constructor(config){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=config.diffConfig||defaultDiffConfig;let sharedExtensions=[Prec.low(decorateChunks),baseTheme,externalTheme,Spacers,EditorView.updateListener.of(update=>{this.measuring<0&&(update.heightChanged||update.viewportChanged)&&!update.transactions.some(tr2=>tr2.effects.some(e2=>e2.is(adjustSpacers)))&&this.measure()})],configA=[mergeConfig.of({side:"a",sibling:()=>this.b,highlightChanges:!1!==config.highlightChanges,markGutter:!1!==config.gutter})];!1!==config.gutter&&configA.push(changeGutter);let stateA=EditorState.create({doc:config.a.doc,selection:config.a.selection,extensions:[config.a.extensions||[],EditorView.editorAttributes.of({class:"cm-merge-a"}),configCompartment.of(configA),sharedExtensions]}),configB=[mergeConfig.of({side:"b",sibling:()=>this.a,highlightChanges:!1!==config.highlightChanges,markGutter:!1!==config.gutter})];!1!==config.gutter&&configB.push(changeGutter);let stateB=EditorState.create({doc:config.b.doc,selection:config.b.selection,extensions:[config.b.extensions||[],EditorView.editorAttributes.of({class:"cm-merge-b"}),configCompartment.of(configB),sharedExtensions]});this.chunks=Chunk.build(stateA.doc,stateB.doc,this.diffConf);let add=[ChunkField.init(()=>this.chunks),collapseCompartment.of(config.collapseUnchanged?collapseUnchanged(config.collapseUnchanged):[])];stateA=stateA.update({effects:StateEffect.appendConfig.of(add)}).state,stateB=stateB.update({effects:StateEffect.appendConfig.of(add)}).state,this.dom=document.createElement("div"),this.dom.className="cm-mergeView",this.editorDOM=this.dom.appendChild(document.createElement("div")),this.editorDOM.className="cm-mergeViewEditors";let orientation=config.orientation||"a-b",wrapA=document.createElement("div");wrapA.className="cm-mergeViewEditor";let wrapB=document.createElement("div");wrapB.className="cm-mergeViewEditor",this.editorDOM.appendChild("a-b"==orientation?wrapA:wrapB),this.editorDOM.appendChild("a-b"==orientation?wrapB:wrapA),this.a=new EditorView({state:stateA,parent:wrapA,root:config.root,dispatchTransactions:trs=>this.dispatch(trs,this.a)}),this.b=new EditorView({state:stateB,parent:wrapB,root:config.root,dispatchTransactions:trs=>this.dispatch(trs,this.b)}),this.setupRevertControls(!!config.revertControls,"b-to-a"==config.revertControls,config.renderRevertControl),config.parent&&config.parent.appendChild(this.dom),this.scheduleMeasure()}dispatch(trs,target){if(trs.some(tr2=>tr2.docChanged)){let last=trs[trs.length-1],changes=trs.reduce((chs,tr2)=>chs.compose(tr2.changes),ChangeSet.empty(trs[0].startState.doc.length));this.chunks=target==this.a?Chunk.updateA(this.chunks,last.newDoc,this.b.state.doc,changes,this.diffConf):Chunk.updateB(this.chunks,this.a.state.doc,last.newDoc,changes,this.diffConf),target.update([...trs,last.state.update({effects:setChunks.of(this.chunks)})]);let other=target==this.a?this.b:this.a;other.update([other.state.update({effects:setChunks.of(this.chunks)})]),this.scheduleMeasure()}else target.update(trs)}reconfigure(config){if("diffConfig"in config&&(this.diffConf=config.diffConfig),"orientation"in config){let aB="b-a"!=config.orientation;if(aB!=(this.editorDOM.firstChild==this.a.dom.parentNode)){let domA=this.a.dom.parentNode,domB=this.b.dom.parentNode;domA.remove(),domB.remove(),this.editorDOM.insertBefore(aB?domA:domB,this.editorDOM.firstChild),this.editorDOM.appendChild(aB?domB:domA),this.revertToLeft=!this.revertToLeft,this.revertDOM&&(this.revertDOM.textContent="")}}if("revertControls"in config||"renderRevertControl"in config){let controls=!!this.revertDOM,toA=this.revertToA,render=this.renderRevert;"revertControls"in config&&(controls=!!config.revertControls,toA="b-to-a"==config.revertControls),"renderRevertControl"in config&&(render=config.renderRevertControl),this.setupRevertControls(controls,toA,render)}let highlight="highlightChanges"in config,gutter2="gutter"in config,collapse="collapseUnchanged"in config;if(highlight||gutter2||collapse){let effectsA=[],effectsB=[];if(highlight||gutter2){let currentConfig=this.a.state.facet(mergeConfig),markGutter=gutter2?!1!==config.gutter:currentConfig.markGutter,highlightChanges=highlight?!1!==config.highlightChanges:currentConfig.highlightChanges;effectsA.push(configCompartment.reconfigure([mergeConfig.of({side:"a",sibling:()=>this.b,highlightChanges:highlightChanges,markGutter:markGutter}),markGutter?changeGutter:[]])),effectsB.push(configCompartment.reconfigure([mergeConfig.of({side:"b",sibling:()=>this.a,highlightChanges:highlightChanges,markGutter:markGutter}),markGutter?changeGutter:[]]))}if(collapse){let effect=collapseCompartment.reconfigure(config.collapseUnchanged?collapseUnchanged(config.collapseUnchanged):[]);effectsA.push(effect),effectsB.push(effect)}this.a.dispatch({effects:effectsA}),this.b.dispatch({effects:effectsB})}this.scheduleMeasure()}setupRevertControls(controls,toA,render){this.revertToA=toA,this.revertToLeft=this.revertToA==(this.editorDOM.firstChild==this.a.dom.parentNode),this.renderRevert=render,!controls&&this.revertDOM?(this.revertDOM.remove(),this.revertDOM=null):controls&&!this.revertDOM?(this.revertDOM=this.editorDOM.insertBefore(document.createElement("div"),this.editorDOM.firstChild.nextSibling),this.revertDOM.addEventListener("mousedown",e2=>this.revertClicked(e2)),this.revertDOM.className="cm-merge-revert"):this.revertDOM&&(this.revertDOM.textContent="")}scheduleMeasure(){if(this.measuring<0){let win=this.dom.ownerDocument.defaultView||window;this.measuring=win.requestAnimationFrame(()=>{this.measuring=-1,this.measure()})}}measure(){!function(a2,b2,chunks){let buildA=new RangeSetBuilder,buildB=new RangeSetBuilder,spacersA=a2.state.field(Spacers).iter(),spacersB=b2.state.field(Spacers).iter(),posA=0,posB=0,offA=0,offB=0,vpA=a2.viewport,vpB=b2.viewport;for(let chunkI=0;;chunkI++){let chunk=chunkI<chunks.length?chunks[chunkI]:null,endA=chunk?chunk.fromA:a2.state.doc.length,endB=chunk?chunk.fromB:b2.state.doc.length;if(posA<endA){let diff3=a2.lineBlockAt(posA).top+offA-(b2.lineBlockAt(posB).top+offB);diff3<-.01?(offA-=diff3,buildA.add(posA,posA,Decoration.widget({widget:new Spacer(-diff3),block:!0,side:-1}))):diff3>.01&&(offB+=diff3,buildB.add(posB,posB,Decoration.widget({widget:new Spacer(diff3),block:!0,side:-1})))}if(endA>posA+1e3&&posA<vpA.from&&endA>vpA.from&&posB<vpB.from&&endB>vpB.from){let off=Math.min(vpA.from-posA,vpB.from-posB);posA+=off,posB+=off,chunkI--}else{if(!chunk)break;posA=chunk.toA,posB=chunk.toB}for(;spacersA.value&&spacersA.from<posA;)offA-=spacersA.value.spec.widget.height,spacersA.next();for(;spacersB.value&&spacersB.from<posB;)offB-=spacersB.value.spec.widget.height,spacersB.next()}for(;spacersA.value;)offA-=spacersA.value.spec.widget.height,spacersA.next();for(;spacersB.value;)offB-=spacersB.value.spec.widget.height,spacersB.next();let docDiff=a2.contentHeight+offA-(b2.contentHeight+offB);docDiff<.01?buildA.add(a2.state.doc.length,a2.state.doc.length,Decoration.widget({widget:new Spacer(-docDiff),block:!0,side:1})):docDiff>.01&&buildB.add(b2.state.doc.length,b2.state.doc.length,Decoration.widget({widget:new Spacer(docDiff),block:!0,side:1}));let decoA=buildA.finish(),decoB=buildB.finish();compareSpacers(decoA,a2.state.field(Spacers))||a2.dispatch({effects:adjustSpacers.of(decoA)}),compareSpacers(decoB,b2.state.field(Spacers))||b2.dispatch({effects:adjustSpacers.of(decoB)})}(this.a,this.b,this.chunks),this.revertDOM&&this.updateRevertButtons()}updateRevertButtons(){let dom=this.revertDOM,next=dom.firstChild,vpA=this.a.viewport,vpB=this.b.viewport;for(let i2=0;i2<this.chunks.length;i2++){let chunk=this.chunks[i2];if(chunk.fromA>vpA.to||chunk.fromB>vpB.to)break;if(chunk.fromA<vpA.from||chunk.fromB<vpB.from)continue;let top=this.a.lineBlockAt(chunk.fromA).top+"px";for(;next&&+next.dataset.chunk<i2;)next=rm(next);next&&next.dataset.chunk==String(i2)?(next.style.top!=top&&(next.style.top=top),next=next.nextSibling):dom.insertBefore(this.renderRevertButton(top,i2),next)}for(;next;)next=rm(next)}renderRevertButton(top,chunk){let elt;if(this.renderRevert)elt=this.renderRevert();else{elt=document.createElement("button");let text2=this.a.state.phrase("Revert this chunk");elt.setAttribute("aria-label",text2),elt.setAttribute("title",text2),elt.textContent=this.revertToLeft?"⇜":"⇝"}return elt.style.top=top,elt.setAttribute("data-chunk",String(chunk)),elt}revertClicked(e2){let chunk,target=e2.target;for(;target&&target.parentNode!=this.revertDOM;)target=target.parentNode;if(target&&(chunk=this.chunks[target.dataset.chunk])){let[source,dest,srcFrom,srcTo,destFrom,destTo]=this.revertToA?[this.b,this.a,chunk.fromB,chunk.toB,chunk.fromA,chunk.toA]:[this.a,this.b,chunk.fromA,chunk.toA,chunk.fromB,chunk.toB],insert=source.state.sliceDoc(srcFrom,Math.max(srcFrom,srcTo-1));srcFrom!=srcTo&&destTo<=dest.state.doc.length&&(insert+=source.state.lineBreak),dest.dispatch({changes:{from:destFrom,to:Math.min(dest.state.doc.length,destTo),insert:insert},userEvent:"revert"}),e2.preventDefault()}}destroy(){this.a.destroy(),this.b.destroy(),this.measuring>-1&&(this.dom.ownerDocument.defaultView||window).cancelAnimationFrame(this.measuring),this.dom.remove()}}function rm(elt){let next=elt.nextSibling;return elt.remove(),next}const COMMON_STATE_CONFIG_EXTENSIONS=[basicSetup,basicLight,markdown(),lineNumbers(),EditorView.lineWrapping],SourceEditor=()=>{const[markdown2,readOnly,cmExtensions]=X$3(markdown$,readOnly$,cmExtensions$),updateMarkdown=A$4(markdownSourceEditorValue$),triggerOnBlur=A$4(onBlur$),editorViewRef=React__default.useRef(null),ref=React__default.useCallback(el2=>{var _a;if(null!==el2){const extensions=[...cmExtensions,...COMMON_STATE_CONFIG_EXTENSIONS,EditorView.updateListener.of(({state:state})=>{updateMarkdown(state.doc.toString())}),EditorView.focusChangeEffect.of((_2,focused)=>(focused||triggerOnBlur(new FocusEvent("blur")),null))];readOnly&&extensions.push(EditorState.readOnly.of(!0)),el2.innerHTML="",editorViewRef.current=new EditorView({parent:el2,state:EditorState.create({doc:markdown2,extensions:extensions})})}else null==(_a=editorViewRef.current)||_a.destroy(),editorViewRef.current=null},[markdown2,readOnly,updateMarkdown,cmExtensions,triggerOnBlur]);return React__default.createElement("div",{ref:ref,className:"cm-sourceView mdxeditor-source-editor"})};function setContent(view,content2){void 0!==view&&view.dispatch({changes:{from:0,to:view.state.doc.length,insert:content2}})}const DiffViewer=()=>{const realm=R$6(),[newMarkdown,oldMarkdown,readOnly,readOnlyDiff]=X$3(markdown$,diffMarkdown$,readOnly$,readOnlyDiff$),onUpdate=A$4(markdownSourceEditorValue$),elRef=React__default.useRef(null),cmMergeViewRef=React__default.useRef(null),cmExtensions=E$4(cmExtensions$),triggerOnBlur=A$4(onBlur$);return React__default.useEffect(()=>realm.sub(diffMarkdown$,newDiffMarkdown=>{var _a;setContent(null==(_a=cmMergeViewRef.current)?void 0:_a.a,newDiffMarkdown)}),[realm]),React__default.useEffect(()=>realm.sub(markdown$,newMarkdown2=>{var _a;setContent(null==(_a=cmMergeViewRef.current)?void 0:_a.b,newMarkdown2)}),[realm]),React__default.useEffect(()=>{const isReadOnly=readOnly||readOnlyDiff,revertParams=isReadOnly?{renderRevertControl:void 0,revertControls:void 0}:{renderRevertControl:()=>{const el2=document.createElement("button");return el2.classList.add("cm-merge-revert"),el2.appendChild(document.createTextNode("⮕")),el2},revertControls:"a-to-b"};return cmMergeViewRef.current=new MergeView({...revertParams,parent:elRef.current,orientation:"a-b",gutter:!0,a:{doc:oldMarkdown,extensions:[...cmExtensions,...COMMON_STATE_CONFIG_EXTENSIONS,EditorState.readOnly.of(!0)]},b:{doc:newMarkdown,extensions:[...cmExtensions,...COMMON_STATE_CONFIG_EXTENSIONS,EditorState.readOnly.of(isReadOnly),EditorView.updateListener.of(({state:state})=>{const md=state.doc.toString();onUpdate(md)}),EditorView.focusChangeEffect.of((_2,focused)=>(focused||triggerOnBlur(new FocusEvent("blur")),null))]}}),()=>{var _a;null==(_a=cmMergeViewRef.current)||_a.destroy(),cmMergeViewRef.current=null}},[onUpdate,cmExtensions]),React__default.createElement("div",{ref:elRef,className:"mdxeditor-diff-editor"})},DiffSourceWrapper=({children:children})=>{const[error,viewMode]=X$3(markdownProcessingError$,viewMode$);return React__default.createElement("div",{className:"mdxeditor-diff-source-wrapper"},error?React__default.createElement("div",{className:styles_markdownParseError},React__default.createElement("p",null,error.error,"."),React__default.createElement("p",null,"You can fix the errors in source mode and switch to rich text mode when you are ready.")):null,React__default.createElement("div",{className:"mdxeditor-rich-text-editor",style:{display:"rich-text"===viewMode&&null==error?"block":"none"}},children),"diff"===viewMode?React__default.createElement(DiffViewer,null):null,"source"===viewMode?React__default.createElement(SourceEditor,null):null)},diffMarkdown$=$$4(""),cmExtensions$=$$4([]),readOnlyDiff$=$$4(!1),diffSourcePlugin=realmPlugin({update:(r2,params)=>{r2.pub(diffMarkdown$,(null==params?void 0:params.diffMarkdown)??"")},init(r2,params){r2.pubIn({[diffMarkdown$]:(null==params?void 0:params.diffMarkdown)??"",[cmExtensions$]:(null==params?void 0:params.codeMirrorExtensions)??[],[addEditorWrapper$]:DiffSourceWrapper,[readOnlyDiff$]:(null==params?void 0:params.readOnlyDiff)??!1,[viewMode$]:(null==params?void 0:params.viewMode)??"rich-text"})}});var hasRequiredPrism,module,Prism2,powershell,prism={exports:{}};hasRequiredPrism||(hasRequiredPrism=1,module=prism,Prism2=function(_self2){var lang=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,uniqueId=0,plainTextGrammar={},_2={manual:_self2.Prism&&_self2.Prism.manual,disableWorkerMessageHandler:_self2.Prism&&_self2.Prism.disableWorkerMessageHandler,util:{encode:function encode(tokens){return tokens instanceof Token?new Token(tokens.type,encode(tokens.content),tokens.alias):Array.isArray(tokens)?tokens.map(encode):tokens.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(o2){return Object.prototype.toString.call(o2).slice(8,-1)},objId:function(obj){return obj.__id||Object.defineProperty(obj,"__id",{value:++uniqueId}),obj.__id},clone:function deepClone(o2,visited){var clone,id;switch(visited=visited||{},_2.util.type(o2)){case"Object":if(id=_2.util.objId(o2),visited[id])return visited[id];for(var key in clone={},visited[id]=clone,o2)o2.hasOwnProperty(key)&&(clone[key]=deepClone(o2[key],visited));return clone;case"Array":return id=_2.util.objId(o2),visited[id]?visited[id]:(clone=[],visited[id]=clone,o2.forEach(function(v2,i2){clone[i2]=deepClone(v2,visited)}),clone);default:return o2}},getLanguage:function(element2){for(;element2;){var m3=lang.exec(element2.className);if(m3)return m3[1].toLowerCase();element2=element2.parentElement}return"none"},setLanguage:function(element2,language){element2.className=element2.className.replace(RegExp(lang,"gi"),""),element2.classList.add("language-"+language)},currentScript:function(){if("undefined"==typeof document)return null;if(document.currentScript&&"SCRIPT"===document.currentScript.tagName)return document.currentScript;try{throw new Error}catch(err){var src=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(err.stack)||[])[1];if(src){var scripts=document.getElementsByTagName("script");for(var i2 in scripts)if(scripts[i2].src==src)return scripts[i2]}return null}},isActive:function(element2,className,defaultActivation){for(var no2="no-"+className;element2;){var classList=element2.classList;if(classList.contains(className))return!0;if(classList.contains(no2))return!1;element2=element2.parentElement}return!!defaultActivation}},languages:{plain:plainTextGrammar,plaintext:plainTextGrammar,text:plainTextGrammar,txt:plainTextGrammar,extend:function(id,redef){var lang2=_2.util.clone(_2.languages[id]);for(var key in redef)lang2[key]=redef[key];return lang2},insertBefore:function(inside,before,insert,root2){var grammar=(root2=root2||_2.languages)[inside],ret={};for(var token in grammar)if(grammar.hasOwnProperty(token)){if(token==before)for(var newToken in insert)insert.hasOwnProperty(newToken)&&(ret[newToken]=insert[newToken]);insert.hasOwnProperty(token)||(ret[token]=grammar[token])}var old=root2[inside];return root2[inside]=ret,_2.languages.DFS(_2.languages,function(key,value){value===old&&key!=inside&&(this[key]=ret)}),ret},DFS:function DFS(o2,callback,type,visited){visited=visited||{};var objId=_2.util.objId;for(var i2 in o2)if(o2.hasOwnProperty(i2)){callback.call(o2,i2,o2[i2],type||i2);var property=o2[i2],propertyType=_2.util.type(property);"Object"!==propertyType||visited[objId(property)]?"Array"!==propertyType||visited[objId(property)]||(visited[objId(property)]=!0,DFS(property,callback,i2,visited)):(visited[objId(property)]=!0,DFS(property,callback,null,visited))}}},plugins:{},highlightAll:function(async,callback){_2.highlightAllUnder(document,async,callback)},highlightAllUnder:function(container,async,callback){var env={callback:callback,container:container,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};_2.hooks.run("before-highlightall",env),env.elements=Array.prototype.slice.apply(env.container.querySelectorAll(env.selector)),_2.hooks.run("before-all-elements-highlight",env);for(var element2,i2=0;element2=env.elements[i2++];)_2.highlightElement(element2,!0===async,env.callback)},highlightElement:function(element2,async,callback){var language=_2.util.getLanguage(element2),grammar=_2.languages[language];_2.util.setLanguage(element2,language);var parent=element2.parentElement;parent&&"pre"===parent.nodeName.toLowerCase()&&_2.util.setLanguage(parent,language);var env={element:element2,language:language,grammar:grammar,code:element2.textContent};function insertHighlightedCode(highlightedCode){env.highlightedCode=highlightedCode,_2.hooks.run("before-insert",env),env.element.innerHTML=env.highlightedCode,_2.hooks.run("after-highlight",env),_2.hooks.run("complete",env),callback&&callback.call(env.element)}if(_2.hooks.run("before-sanity-check",env),(parent=env.element.parentElement)&&"pre"===parent.nodeName.toLowerCase()&&!parent.hasAttribute("tabindex")&&parent.setAttribute("tabindex","0"),!env.code)return _2.hooks.run("complete",env),void(callback&&callback.call(env.element));if(_2.hooks.run("before-highlight",env),env.grammar)if(async&&_self2.Worker){var worker=new Worker(_2.filename);worker.onmessage=function(evt){insertHighlightedCode(evt.data)},worker.postMessage(JSON.stringify({language:env.language,code:env.code,immediateClose:!0}))}else insertHighlightedCode(_2.highlight(env.code,env.grammar,env.language));else insertHighlightedCode(_2.util.encode(env.code))},highlight:function(text2,grammar,language){var env={code:text2,grammar:grammar,language:language};if(_2.hooks.run("before-tokenize",env),!env.grammar)throw new Error('The language "'+env.language+'" has no grammar.');return env.tokens=_2.tokenize(env.code,env.grammar),_2.hooks.run("after-tokenize",env),Token.stringify(_2.util.encode(env.tokens),env.language)},tokenize:function(text2,grammar){var rest=grammar.rest;if(rest){for(var token in rest)grammar[token]=rest[token];delete grammar.rest}var tokenList=new LinkedList;return addAfter(tokenList,tokenList.head,text2),matchGrammar(text2,tokenList,grammar,tokenList.head,0),function(list2){for(var array=[],node2=list2.head.next;node2!==list2.tail;)array.push(node2.value),node2=node2.next;return array}(tokenList)},hooks:{all:{},add:function(name,callback){var hooks=_2.hooks.all;hooks[name]=hooks[name]||[],hooks[name].push(callback)},run:function(name,env){var callbacks=_2.hooks.all[name];if(callbacks&&callbacks.length)for(var callback,i2=0;callback=callbacks[i2++];)callback(env)}},Token:Token};function Token(type,content2,alias,matchedStr){this.type=type,this.content=content2,this.alias=alias,this.length=0|(matchedStr||"").length}function matchPattern(pattern,pos,text2,lookbehind){pattern.lastIndex=pos;var match=pattern.exec(text2);if(match&&lookbehind&&match[1]){var lookbehindLength=match[1].length;match.index+=lookbehindLength,match[0]=match[0].slice(lookbehindLength)}return match}function matchGrammar(text2,tokenList,grammar,startNode,startPos,rematch){for(var token in grammar)if(grammar.hasOwnProperty(token)&&grammar[token]){var patterns=grammar[token];patterns=Array.isArray(patterns)?patterns:[patterns];for(var j2=0;j2<patterns.length;++j2){if(rematch&&rematch.cause==token+","+j2)return;var patternObj=patterns[j2],inside=patternObj.inside,lookbehind=!!patternObj.lookbehind,greedy=!!patternObj.greedy,alias=patternObj.alias;if(greedy&&!patternObj.pattern.global){var flags=patternObj.pattern.toString().match(/[imsuy]*$/)[0];patternObj.pattern=RegExp(patternObj.pattern.source,flags+"g")}for(var pattern=patternObj.pattern||patternObj,currentNode=startNode.next,pos=startPos;currentNode!==tokenList.tail&&!(rematch&&pos>=rematch.reach);pos+=currentNode.value.length,currentNode=currentNode.next){var str=currentNode.value;if(tokenList.length>text2.length)return;if(!(str instanceof Token)){var match,removeCount=1;if(greedy){if(!(match=matchPattern(pattern,pos,text2,lookbehind))||match.index>=text2.length)break;var from=match.index,to2=match.index+match[0].length,p2=pos;for(p2+=currentNode.value.length;from>=p2;)p2+=(currentNode=currentNode.next).value.length;if(pos=p2-=currentNode.value.length,currentNode.value instanceof Token)continue;for(var k3=currentNode;k3!==tokenList.tail&&(p2<to2||"string"==typeof k3.value);k3=k3.next)removeCount++,p2+=k3.value.length;removeCount--,str=text2.slice(pos,p2),match.index-=pos}else if(!(match=matchPattern(pattern,0,str,lookbehind)))continue;from=match.index;var matchStr=match[0],before=str.slice(0,from),after=str.slice(from+matchStr.length),reach=pos+str.length;rematch&&reach>rematch.reach&&(rematch.reach=reach);var removeFrom=currentNode.prev;if(before&&(removeFrom=addAfter(tokenList,removeFrom,before),pos+=before.length),removeRange(tokenList,removeFrom,removeCount),currentNode=addAfter(tokenList,removeFrom,new Token(token,inside?_2.tokenize(matchStr,inside):matchStr,alias,matchStr)),after&&addAfter(tokenList,currentNode,after),removeCount>1){var nestedRematch={cause:token+","+j2,reach:reach};matchGrammar(text2,tokenList,grammar,currentNode.prev,pos,nestedRematch),rematch&&nestedRematch.reach>rematch.reach&&(rematch.reach=nestedRematch.reach)}}}}}}function LinkedList(){var head={value:null,prev:null,next:null},tail={value:null,prev:head,next:null};head.next=tail,this.head=head,this.tail=tail,this.length=0}function addAfter(list2,node2,value){var next=node2.next,newNode={value:value,prev:node2,next:next};return node2.next=newNode,next.prev=newNode,list2.length++,newNode}function removeRange(list2,node2,count2){for(var next=node2.next,i2=0;i2<count2&&next!==list2.tail;i2++)next=next.next;node2.next=next,next.prev=node2,list2.length-=i2}if(_self2.Prism=_2,Token.stringify=function stringify(o2,language){if("string"==typeof o2)return o2;if(Array.isArray(o2)){var s2="";return o2.forEach(function(e2){s2+=stringify(e2,language)}),s2}var env={type:o2.type,content:stringify(o2.content,language),tag:"span",classes:["token",o2.type],attributes:{},language:language},aliases=o2.alias;aliases&&(Array.isArray(aliases)?Array.prototype.push.apply(env.classes,aliases):env.classes.push(aliases)),_2.hooks.run("wrap",env);var attributes="";for(var name in env.attributes)attributes+=" "+name+'="'+(env.attributes[name]||"").replace(/"/g,""")+'"';return"<"+env.tag+' class="'+env.classes.join(" ")+'"'+attributes+">"+env.content+"</"+env.tag+">"},!_self2.document)return _self2.addEventListener?(_2.disableWorkerMessageHandler||_self2.addEventListener("message",function(evt){var message=JSON.parse(evt.data),lang2=message.language,code2=message.code,immediateClose=message.immediateClose;_self2.postMessage(_2.highlight(code2,_2.languages[lang2],lang2)),immediateClose&&_self2.close()},!1),_2):_2;var script=_2.util.currentScript();function highlightAutomaticallyCallback(){_2.manual||_2.highlightAll()}if(script&&(_2.filename=script.src,script.hasAttribute("data-manual")&&(_2.manual=!0)),!_2.manual){var readyState=document.readyState;"loading"===readyState||"interactive"===readyState&&script&&script.defer?document.addEventListener("DOMContentLoaded",highlightAutomaticallyCallback):window.requestAnimationFrame?window.requestAnimationFrame(highlightAutomaticallyCallback):window.setTimeout(highlightAutomaticallyCallback,16)}return _2}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{}),module.exports&&(module.exports=Prism2),void 0!==commonjsGlobal&&(commonjsGlobal.Prism=Prism2),Prism2.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},Prism2.languages.markup.tag.inside["attr-value"].inside.entity=Prism2.languages.markup.entity,Prism2.languages.markup.doctype.inside["internal-subset"].inside=Prism2.languages.markup,Prism2.hooks.add("wrap",function(env){"entity"===env.type&&(env.attributes.title=env.content.replace(/&/,"&"))}),Object.defineProperty(Prism2.languages.markup.tag,"addInlined",{value:function(tagName,lang){var includedCdataInside={};includedCdataInside["language-"+lang]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism2.languages[lang]},includedCdataInside.cdata=/^<!\[CDATA\[|\]\]>$/i;var inside={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:includedCdataInside}};inside["language-"+lang]={pattern:/[\s\S]+/,inside:Prism2.languages[lang]};var def={};def[tagName]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return tagName}),"i"),lookbehind:!0,greedy:!0,inside:inside},Prism2.languages.insertBefore("markup","cdata",def)}}),Object.defineProperty(Prism2.languages.markup.tag,"addAttribute",{value:function(attrName,lang){Prism2.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+attrName+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[lang,"language-"+lang],inside:Prism2.languages[lang]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),Prism2.languages.html=Prism2.languages.markup,Prism2.languages.mathml=Prism2.languages.markup,Prism2.languages.svg=Prism2.languages.markup,Prism2.languages.xml=Prism2.languages.extend("markup",{}),Prism2.languages.ssml=Prism2.languages.xml,Prism2.languages.atom=Prism2.languages.xml,Prism2.languages.rss=Prism2.languages.xml,function(Prism3){var string2=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;Prism3.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+string2.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+string2.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+string2.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+string2.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:string2,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},Prism3.languages.css.atrule.inside.rest=Prism3.languages.css;var markup=Prism3.languages.markup;markup&&(markup.tag.addInlined("style","css"),markup.tag.addAttribute("style","css"))}(Prism2),Prism2.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},Prism2.languages.javascript=Prism2.languages.extend("clike",{"class-name":[Prism2.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism2.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Prism2.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism2.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism2.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism2.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism2.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism2.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism2.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism2.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),Prism2.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),Prism2.languages.markup&&(Prism2.languages.markup.tag.addInlined("script","javascript"),Prism2.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),Prism2.languages.js=Prism2.languages.javascript,function(){if(void 0!==Prism2&&"undefined"!=typeof document){Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var EXTENSIONS={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},SELECTOR='pre[data-src]:not([data-src-status="loaded"]):not([data-src-status="loading"])';Prism2.hooks.add("before-highlightall",function(env){env.selector+=", "+SELECTOR}),Prism2.hooks.add("before-sanity-check",function(env){var pre=env.element;if(pre.matches(SELECTOR)){env.code="",pre.setAttribute("data-src-status","loading");var code2=pre.appendChild(document.createElement("CODE"));code2.textContent="Loading…";var src=pre.getAttribute("data-src"),language=env.language;if("none"===language){var extension2=(/\.(\w+)$/.exec(src)||[,"none"])[1];language=EXTENSIONS[extension2]||extension2}Prism2.util.setLanguage(code2,language),Prism2.util.setLanguage(pre,language);var autoloader=Prism2.plugins.autoloader;autoloader&&autoloader.loadLanguages(language),function(src,success,error){var xhr=new XMLHttpRequest;xhr.open("GET",src,!0),xhr.onreadystatechange=function(){4==xhr.readyState&&(xhr.status<400&&xhr.responseText?success(xhr.responseText):xhr.status>=400?error("✖ Error "+xhr.status+" while fetching file: "+xhr.statusText):error("✖ Error: File does not exist or is empty"))},xhr.send(null)}(src,function(text2){pre.setAttribute("data-src-status","loaded");var range=function(range){var m3=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(range||"");if(m3){var start2=Number(m3[1]),comma=m3[2],end=m3[3];return comma?end?[start2,Number(end)]:[start2,void 0]:[start2,start2]}}(pre.getAttribute("data-range"));if(range){var lines=text2.split(/\r\n?|\n/g),start2=range[0],end=null==range[1]?lines.length:range[1];start2<0&&(start2+=lines.length),start2=Math.max(0,Math.min(start2-1,lines.length)),end<0&&(end+=lines.length),end=Math.max(0,Math.min(end,lines.length)),text2=lines.slice(start2,end).join("\n"),pre.hasAttribute("data-start")||pre.setAttribute("data-start",String(start2+1))}code2.textContent=text2,Prism2.highlightElement(code2)},function(error){pre.setAttribute("data-src-status","failed"),code2.textContent=error})}}),Prism2.plugins.fileHighlight={highlight:function(container){for(var element2,elements=(container||document).querySelectorAll(SELECTOR),i2=0;element2=elements[i2++];)Prism2.highlightElement(element2)}};var logged=!1;Prism2.fileHighlight=function(){logged||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),logged=!0),Prism2.plugins.fileHighlight.highlight.apply(this,arguments)}}}()),Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),Prism.languages.js=Prism.languages.javascript,Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup,Prism.hooks.add("wrap",function(env){"entity"===env.type&&(env.attributes.title=env.content.replace(/&/,"&"))}),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(tagName,lang){var includedCdataInside={};includedCdataInside["language-"+lang]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[lang]},includedCdataInside.cdata=/^<!\[CDATA\[|\]\]>$/i;var inside={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:includedCdataInside}};inside["language-"+lang]={pattern:/[\s\S]+/,inside:Prism.languages[lang]};var def={};def[tagName]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return tagName}),"i"),lookbehind:!0,greedy:!0,inside:inside},Prism.languages.insertBefore("markup","cdata",def)}}),Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(attrName,lang){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+attrName+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[lang,"language-"+lang],inside:Prism.languages[lang]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.ssml=Prism.languages.xml,Prism.languages.atom=Prism.languages.xml,Prism.languages.rss=Prism.languages.xml,function(Prism2){var inner=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function createInline(pattern){return pattern=pattern.replace(/<inner>/g,function(){return inner}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+pattern+")")}var tableCell=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,tableRow=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return tableCell}),tableLine=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;Prism2.languages.markdown=Prism2.languages.extend("markup",{}),Prism2.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:Prism2.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+tableRow+tableLine+"(?:"+tableRow+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+tableRow+tableLine+")(?:"+tableRow+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(tableCell),inside:Prism2.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+tableRow+")"+tableLine+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+tableRow+"$"),inside:{"table-header":{pattern:RegExp(tableCell),alias:"important",inside:Prism2.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:createInline(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:createInline(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:createInline(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:createInline(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(token){["url","bold","italic","strike","code-snippet"].forEach(function(inside){token!==inside&&(Prism2.languages.markdown[token].inside.content.inside[inside]=Prism2.languages.markdown[inside])})}),Prism2.hooks.add("after-tokenize",function(env){"markdown"!==env.language&&"md"!==env.language||function walkTokens(tokens){if(tokens&&"string"!=typeof tokens)for(var i2=0,l2=tokens.length;i2<l2;i2++){var token=tokens[i2];if("code"===token.type){var codeLang=token.content[1],codeBlock=token.content[3];if(codeLang&&codeBlock&&"code-language"===codeLang.type&&"code-block"===codeBlock.type&&"string"==typeof codeLang.content){var lang=codeLang.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),alias="language-"+(lang=(/[a-z][\w-]*/i.exec(lang)||[""])[0].toLowerCase());codeBlock.alias?"string"==typeof codeBlock.alias?codeBlock.alias=[codeBlock.alias,alias]:codeBlock.alias.push(alias):codeBlock.alias=[alias]}}else walkTokens(token.content)}}(env.tokens)}),Prism2.hooks.add("wrap",function(env){if("code-block"===env.type){for(var codeLang="",i2=0,l2=env.classes.length;i2<l2;i2++){var cls=env.classes[i2],match=/language-(.+)/.exec(cls);if(match){codeLang=match[1];break}}var html2,grammar=Prism2.languages[codeLang];if(grammar)env.content=Prism2.highlight((html2=env.content,html2.replace(tagPattern,"").replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(m3,code2){var value;if("#"===(code2=code2.toLowerCase())[0])return value="x"===code2[1]?parseInt(code2.slice(2),16):Number(code2.slice(1)),fromCodePoint(value);var known=KNOWN_ENTITY_NAMES[code2];return known||m3})),grammar,codeLang);else if(codeLang&&"none"!==codeLang&&Prism2.plugins.autoloader){var id="md-"+(new Date).valueOf()+"-"+Math.floor(1e16*Math.random());env.attributes.id=id,Prism2.plugins.autoloader.loadLanguages(codeLang,function(){var ele=document.getElementById(id);ele&&(ele.innerHTML=Prism2.highlight(ele.textContent,Prism2.languages[codeLang],codeLang))})}}});var tagPattern=RegExp(Prism2.languages.markup.tag.pattern.source,"gi"),KNOWN_ENTITY_NAMES={amp:"&",lt:"<",gt:">",quot:'"'},fromCodePoint=String.fromCodePoint||String.fromCharCode;Prism2.languages.md=Prism2.languages.markdown}(Prism),Prism.languages.c=Prism.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),Prism.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),Prism.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}}),Prism.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete Prism.languages.c.boolean,function(Prism2){var string2=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;Prism2.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+string2.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+string2.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+string2.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+string2.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:string2,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},Prism2.languages.css.atrule.inside.rest=Prism2.languages.css;var markup=Prism2.languages.markup;markup&&(markup.tag.addInlined("style","css"),markup.tag.addAttribute("style","css"))}(Prism),Prism.languages.objectivec=Prism.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete Prism.languages.objectivec["class-name"],Prism.languages.objc=Prism.languages.objectivec,Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},(powershell=Prism.languages.powershell={comment:[{pattern:/(^|[^`])<#[\s\S]*?#>/,lookbehind:!0},{pattern:/(^|[^`])#.*/,lookbehind:!0}],string:[{pattern:/"(?:`[\s\S]|[^`"])*"/,greedy:!0,inside:null},{pattern:/'(?:[^']|'')*'/,greedy:!0}],namespace:/\[[a-z](?:\[(?:\[[^\]]*\]|[^\[\]])*\]|[^\[\]])*\]/i,boolean:/\$(?:false|true)\b/i,variable:/\$\w+\b/,function:[/\b(?:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|ForEach|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Sort|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Tee|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Where|Write)-[a-z]+\b/i,/\b(?:ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i],keyword:/\b(?:Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i,operator:{pattern:/(^|\W)(?:!|-(?:b?(?:and|x?or)|as|(?:Not)?(?:Contains|In|Like|Match)|eq|ge|gt|is(?:Not)?|Join|le|lt|ne|not|Replace|sh[lr])\b|-[-=]?|\+[+=]?|[*\/%]=?)/i,lookbehind:!0},punctuation:/[|{}[\];(),.]/}).string[0].inside={function:{pattern:/(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,lookbehind:!0,inside:powershell},boolean:powershell.boolean,variable:powershell.variable};var hasRequiredPrismPython;hasRequiredPrismPython||(hasRequiredPrismPython=1,Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python);var hasRequiredPrismRust;hasRequiredPrismRust||(hasRequiredPrismRust=1,function(Prism2){for(var multilineComment=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,i2=0;i2<2;i2++)multilineComment=multilineComment.replace(/<self>/g,function(){return multilineComment});multilineComment=multilineComment.replace(/<self>/g,function(){return/[^\s\S]/.source}),Prism2.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+multilineComment),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},Prism2.languages.rust["closure-params"].inside.rest=Prism2.languages.rust,Prism2.languages.rust.attribute.inside.string=Prism2.languages.rust.string}(Prism)),Prism.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+/(?:elseif|if)\b/.source+"(?:[ \t]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},Prism.languages.swift["string-literal"].forEach(function(rule){rule.inside.interpolation.inside=Prism.languages.swift});var hasRequiredPrismTypescript;hasRequiredPrismTypescript||(hasRequiredPrismTypescript=1,function(Prism2){Prism2.languages.typescript=Prism2.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),Prism2.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete Prism2.languages.typescript.parameter,delete Prism2.languages.typescript["literal-property"];var typeInside=Prism2.languages.extend("typescript",{});delete typeInside["class-name"],Prism2.languages.typescript["class-name"].inside=typeInside,Prism2.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:typeInside}}}}),Prism2.languages.ts=Prism2.languages.typescript}(Prism));var hasRequiredPrismJava;hasRequiredPrismJava||(hasRequiredPrismJava=1,function(Prism2){var keywords=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,classNamePrefix=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,className={pattern:RegExp(/(^|[^\w.])/.source+classNamePrefix+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};Prism2.languages.java=Prism2.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[className,{pattern:RegExp(/(^|[^\w.])/.source+classNamePrefix+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:className.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+classNamePrefix+/[A-Z]\w*\b/.source),lookbehind:!0,inside:className.inside}],keyword:keywords,function:[Prism2.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),Prism2.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),Prism2.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":className,keyword:keywords,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+classNamePrefix+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:className.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+classNamePrefix+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:className.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,function(){return keywords.source})),lookbehind:!0,inside:{punctuation:/\./}}})}(Prism));var hasRequiredPrismCpp;function I(e2,n2){for(const r2 of e2.childNodes){if(yo(r2)&&r2.tagName===n2)return!0;I(r2,n2)}return!1}hasRequiredPrismCpp||(hasRequiredPrismCpp=1,function(Prism2){var keyword=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,modName=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return keyword.source});Prism2.languages.cpp=Prism2.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return keyword.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:keyword,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),Prism2.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return modName})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),Prism2.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:Prism2.languages.cpp}}}}),Prism2.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),Prism2.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:Prism2.languages.extend("cpp",{})}}),Prism2.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},Prism2.languages.cpp["base-clause"])}(Prism));const M$1="data-language",J$1="data-highlight-language",R="data-theme";class K extends di{static getType(){return"code"}static clone(t2){return new K(t2.__language,t2.__key)}constructor(t2,e2){super(e2),this.__language=t2||void 0,this.__isSyntaxHighlightSupported=!1,this.__theme=void 0}afterCloneFrom(t2){super.afterCloneFrom(t2),this.__language=t2.__language,this.__theme=t2.__theme,this.__isSyntaxHighlightSupported=t2.__isSyntaxHighlightSupported}createDOM(t2){const n2=document.createElement("code");rt$3(n2,t2.theme.code),n2.setAttribute("spellcheck","false");const r2=this.getLanguage();r2&&(n2.setAttribute(M$1,r2),this.getIsSyntaxHighlightSupported()&&n2.setAttribute(J$1,r2));const i2=this.getTheme();i2&&n2.setAttribute(R,i2);const o2=this.getStyle();return o2&&n2.setAttribute("style",o2),n2}updateDOM(t2,e2,n2){const r2=this.__language,i2=t2.__language;r2?r2!==i2&&e2.setAttribute(M$1,r2):i2&&e2.removeAttribute(M$1);const o2=this.__isSyntaxHighlightSupported;t2.__isSyntaxHighlightSupported&&i2?o2&&r2?r2!==i2&&e2.setAttribute(J$1,r2):e2.removeAttribute(J$1):o2&&r2&&e2.setAttribute(J$1,r2);const s2=this.__theme,u2=t2.__theme;s2?s2!==u2&&e2.setAttribute(R,s2):u2&&e2.removeAttribute(R);const l2=this.__style,c2=t2.__style;return l2?l2!==c2&&e2.setAttribute("style",l2):c2&&e2.removeAttribute("style"),!1}exportDOM(t2){const n2=document.createElement("pre");rt$3(n2,t2._config.theme.code),n2.setAttribute("spellcheck","false");const r2=this.getLanguage();r2&&(n2.setAttribute(M$1,r2),this.getIsSyntaxHighlightSupported()&&n2.setAttribute(J$1,r2));const i2=this.getTheme();i2&&n2.setAttribute(R,i2);const o2=this.getStyle();return o2&&n2.setAttribute("style",o2),{element:n2}}static importDOM(){return{code:t2=>null!=t2.textContent&&(/\r?\n/.test(t2.textContent)||I(t2,"BR"))?{conversion:q,priority:1}:null,div:()=>({conversion:U,priority:1}),pre:()=>({conversion:q,priority:0}),table:t2=>V(t2)?{conversion:X,priority:3}:null,td:t2=>{const e2=t2,n2=e2.closest("table");return e2.classList.contains("js-file-line")||n2&&V(n2)?{conversion:Q,priority:3}:null},tr:t2=>{const e2=t2.closest("table");return e2&&V(e2)?{conversion:Q,priority:3}:null}}}static importJSON(t2){return $().updateFromJSON(t2)}updateFromJSON(t2){return super.updateFromJSON(t2).setLanguage(t2.language).setTheme(t2.theme)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),theme:this.getTheme()}}insertNewAfter(t2,e2=!0){const n2=this.getChildren(),r2=n2.length;if(r2>=2&&"\n"===n2[r2-1].getTextContent()&&"\n"===n2[r2-2].getTextContent()&&t2.isCollapsed()&&t2.anchor.key===this.__key&&t2.anchor.offset===r2){n2[r2-1].remove(),n2[r2-2].remove();const t3=Fi();return this.insertAfter(t3,e2),t3}const{anchor:i2,focus:o2}=t2,g2=(i2.isBefore(o2)?i2:o2).getNode();if(Zn(g2)){let t3=function(t2){return function(t2,e2){let n2=t2;for(let i2=Go(t2,e2);i2&&(et$1(i2.origin)||rr(i2.origin));i2=ct$2(i2))n2=i2.origin;return n2}(t2,"previous")}(g2);const e3=[];for(;;)if(rr(t3))e3.push(nr()),t3=t3.getNextSibling();else{if(!et$1(t3))break;{let n4=0;const r4=t3.getTextContent(),i3=t3.getTextContentSize();for(;n4<i3&&" "===r4[n4];)n4++;if(0!==n4&&e3.push(tt$1(" ".repeat(n4))),n4!==i3)break;t3=t3.getNextSibling()}}const n3=g2.splitText(i2.offset)[0],r3=0===i2.offset?0:1,o3=n3.getIndexWithinParent()+r3,s2=g2.getParentOrThrow(),u2=[Fn(),...e3];s2.splice(o3,0,u2);const f3=e3[e3.length-1];f3?f3.select():0===i2.offset?n3.selectPrevious():n3.getNextSibling().selectNext(0,0)}if(W(g2)){const{offset:e3}=t2.anchor;g2.splice(e3,0,[Fn()]),g2.select(e3+1,e3+1)}return null}canIndent(){return!1}collapseAtStart(){const t2=Fi();return this.getChildren().forEach(e2=>t2.append(e2)),this.replace(t2),!0}setLanguage(t2){const e2=this.getWritable();return e2.__language=t2||void 0,e2}getLanguage(){return this.getLatest().__language}setIsSyntaxHighlightSupported(t2){const e2=this.getWritable();return e2.__isSyntaxHighlightSupported=t2,e2}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}setTheme(t2){const e2=this.getWritable();return e2.__theme=t2||void 0,e2}getTheme(){return this.getLatest().__theme}}function $(t2,e2){return function(t2){const e2=To();return Yr(),new(e2.resolveRegisteredNodeAfterReplacements(e2.getRegisteredNode(t2)).klass)}(K).setLanguage(t2).setTheme(e2)}function W(t2){return t2 instanceof K}function q(t2){return{node:$(t2.getAttribute(M$1))}}function U(t2){const e2=t2,n2=G(e2);return n2||function(t3){let e3=t3.parentElement;for(;null!==e3;){if(G(e3))return!0;e3=e3.parentElement}return!1}(e2)?{node:n2?$():null}:{node:null}}function X(){return{node:$()}}function Q(){return{node:null}}function G(t2){return null!==t2.style.fontFamily.match("monospace")}function V(t2){return t2.classList.contains("js-file-line-container")}let Y$1=class Y2 extends $n{constructor(t2="",e2,n2){super(t2,n2),this.__highlightType=e2}static getType(){return"code-highlight"}static clone(t2){return new Y2(t2.__text,t2.__highlightType||void 0,t2.__key)}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(t2){const e2=this.getWritable();return e2.__highlightType=t2||void 0,e2}canHaveFormat(){return!1}createDOM(t2){const n2=super.createDOM(t2);return rt$3(n2,Z$1(t2.theme,this.__highlightType)),n2}updateDOM(t2,r2,i2){const o2=super.updateDOM(t2,r2,i2),s2=Z$1(i2.theme,t2.__highlightType),u2=Z$1(i2.theme,this.__highlightType);return s2!==u2&&(s2&&it$2(r2,s2),u2&&rt$3(r2,u2)),o2}static importJSON(t2){return tt$1().updateFromJSON(t2)}updateFromJSON(t2){return super.updateFromJSON(t2).setHighlightType(t2.highlightType)}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType()}}setFormat(t2){return this}isParentRequired(){return!0}createParentElementNode(){return $()}};function Z$1(t2,e2){return e2&&t2&&t2.codeHighlight&&t2.codeHighlight[e2]}function tt$1(t2="",e2){return lo(new Y$1(t2,e2))}function et$1(t2){return t2 instanceof Y$1}function j(t2,e2){const n2={};for(const o2 of t2){const t3=e2(o2);t3&&(n2[t3]?n2[t3].push(o2):n2[t3]=[o2])}return n2}!function(t2){t2.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var e2={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(e2).forEach(function(n2){var r2=e2[n2],i2=[];/^\w+$/.test(n2)||i2.push(/\w+/.exec(n2)[0]),"diff"===n2&&i2.push("bold"),t2.languages.diff[n2]={pattern:RegExp("^(?:["+r2+"].*(?:\r\n?|\n|(?![\\s\\S])))+","m"),alias:i2,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(n2)[0]}}}}),Object.defineProperty(t2.languages.diff,"PREFIXES",{value:e2})}(Prism);const A=/[!-/:-@[-`{-~\s]/;function Y3(t2,...e2){const n2=new URL("https://lexical.dev/docs/error"),o2=new URLSearchParams;o2.append("code",t2);for(const t3 of e2)o2.append("v",t3);throw n2.search=o2.toString(),Error(`Minified Lexical error #${t2}; visit ${n2.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Z(t2,e2,n2){const o2=n2.length;for(let r2=e2;r2>=o2;r2--){const e3=r2-o2;if(tt(t2,e3,n2,0,o2)&&" "!==t2[e3+o2])return e3}return-1}function tt(t2,e2,n2,o2,r2){for(let i2=0;i2<r2;i2++)if(t2[e2+i2]!==n2[o2+i2])return!1;return!0}function et(t2,n2=_t){const o2=function(t2){const e2=j(t2,t3=>t3.type);return{element:e2.element||[],multilineElement:e2["multiline-element"]||[],textFormat:e2["text-format"]||[],textMatch:e2["text-match"]||[]}}(n2),r2=j(o2.textFormat,({tag:t3})=>t3[t3.length-1]),l2=j(o2.textMatch,({trigger:t3})=>t3);for(const e2 of n2){const n3=e2.type;if("element"===n3||"text-match"===n3||"multiline-element"===n3){const n4=e2.dependencies;for(const e3 of n4)t2.hasNode(e3)||Y3(173,e3.getType())}}return t2.registerUpdateListener(({tags:n3,dirtyLeaves:o3,editorState:r3,prevEditorState:i2})=>{if(n3.has(wi)||n3.has(ki))return;if(t2.isComposing())return;const l3=r3.read(wr),f3=i2.read(wr);if(!ar(f3)||!ar(l3)||!l3.isCollapsed()||l3.is(f3))return;const p2=l3.anchor.key,d2=l3.anchor.offset,h2=r3._nodeMap.get(p2);!Zn(h2)||!o3.has(p2)||1!==d2&&d2>f3.anchor.offset+1||t2.update(()=>{if(!function(t2){return Zn(t2)&&!t2.hasFormat("code")}(h2))return;const t3=h2.getParent();null===t3||W(t3)||((t3,n3,c3)=>{(function(t4,e2,n4,o3){if(!so(t4.getParent())||t4.getFirstChild()!==e2)return!1;const i2=e2.getTextContent();if(" "!==i2[n4-1])return!1;for(const{regExp:r4,replace:s2}of o3){const o4=i2.match(r4);if(o4&&o4[0].length===(o4[0].endsWith(" ")?n4:n4-1)){const r5=e2.getNextSiblings(),[i3,l3]=e2.splitText(n4);if(!1!==s2(t4,l3?[l3,...r5]:r5,o4,!1))return i3.remove(),!0}}return!1})(t3,n3,c3,o2.element)||function(t4,e2,n4,o3){if(!so(t4.getParent())||t4.getFirstChild()!==e2)return!1;const i2=e2.getTextContent();if(" "!==i2[n4-1])return!1;for(const{regExpStart:r4,replace:s2,regExpEnd:l3}of o3){if(l3&&!("optional"in l3)||l3&&"optional"in l3&&!l3.optional)continue;const o4=i2.match(r4);if(o4&&o4[0].length===(o4[0].endsWith(" ")?n4:n4-1)){const r5=e2.getNextSiblings(),[i3,l4]=e2.splitText(n4);if(!1!==s2(t4,l4?[l4,...r5]:r5,o4,null,null,!1))return i3.remove(),!0}}return!1}(t3,n3,c3,o2.multilineElement)||function(t4,e2,n4){let o3=t4.getTextContent();const r3=n4[o3[e2-1]];if(null==r3)return!1;e2<o3.length&&(o3=o3.slice(0,e2));for(const e3 of r3){if(!e3.replace||!e3.regExp)continue;const n5=o3.match(e3.regExp);if(null===n5)continue;const r4=n5.index||0,i2=r4+n5[0].length;let s2;return 0===r4?[s2]=t4.splitText(i2):[,s2]=t4.splitText(r4,i2),s2.selectNext(0,0),e3.replace(s2,n5),!0}return!1}(n3,c3,l2)||function(t4,n4,o3){const r3=t4.getTextContent(),l3=n4-1,c4=r3[l3],f3=o3[c4];if(!f3)return!1;for(const n5 of f3){const{tag:o4}=n5,f4=o4.length,a2=l3-f4+1;if(f4>1&&!tt(r3,a2,o4,0,f4))continue;if(" "===r3[a2-1])continue;const u2=r3[l3+1];if(!1===n5.intraword&&u2&&!A.test(u2))continue;const p2=t4;let m3=p2,x2=Z(r3,a2,o4),T3=m3;for(;x2<0&&(T3=T3.getPreviousSibling())&&!Ln(T3);)if(Zn(T3)){if(T3.hasFormat("code"))continue;const t5=T3.getTextContent();m3=T3,x2=Z(t5,t5.length,o4)}if(x2<0)continue;if(m3===p2&&x2+f4===a2)continue;const C2=m3.getTextContent();if(x2>0&&C2[x2-1]===c4)continue;const E2=C2[x2-1];if(!1===n5.intraword&&E2&&!A.test(E2))continue;const y2=p2.getTextContent(),v2=y2.slice(0,a2)+y2.slice(l3+1);p2.setTextContent(v2);const S3=m3===p2?v2:C2;m3.setTextContent(S3.slice(0,x2)+S3.slice(x2+f4));const $2=wr(),b2=kr();ks(b2);const F2=l3-f4*(m3===p2?2:1)+1;b2.anchor.set(m3.__key,x2,"text"),b2.focus.set(p2.__key,F2,"text");for(const t5 of n5.format)b2.hasFormat(t5)||b2.formatText(t5);b2.anchor.set(b2.focus.key,b2.focus.offset,b2.focus.type);for(const t5 of n5.format)b2.hasFormat(t5)&&b2.toggleFormat(t5);return ar($2)&&(b2.format=$2.format),!0}}(n3,c3,r2)})(t3,h2,l3.anchor.offset)})})}const gt=t2=>(e2,n2,o2,r2)=>{const i2=t2(o2);i2.append(...n2),e2.replace(i2),r2||i2.select(0,0)},pt=t2=>(e2,n2,o2,r2)=>{const i2=e2.getPreviousSibling(),s2=e2.getNextSibling(),l2=et$2("check"===t2?"x"===o2[3]:void 0);if(at(s2)&&s2.getListType()===t2){const t3=s2.getFirstChild();null!==t3?t3.insertBefore(l2):s2.append(l2),e2.remove()}else if(at(i2)&&i2.getListType()===t2)i2.append(l2),e2.remove();else{const n3=ct$1(t2,"number"===t2?Number(o2[2]):void 0);n3.append(l2),e2.replace(n3)}l2.append(...n2),r2||l2.select(0,0);const c2=function(t3){const e3=t3.match(/\t/g),n3=t3.match(/ /g);let o3=0;return e3&&(o3+=e3.length),n3&&(o3+=Math.floor(n3.length/4)),o3}(o2[1]);c2&&l2.setIndent(c2)},dt=(t2,e2,n2)=>{const o2=[],r2=t2.getChildren();let i2=0;for(const s2 of r2)if(nt$2(s2)){if(1===s2.getChildrenSize()){const t3=s2.getFirstChild();if(at(t3)){o2.push(dt(t3,e2,n2+1));continue}}const r3=" ".repeat(4*n2),l2=t2.getListType(),c2="number"===l2?`${t2.getStart()+i2}. `:"check"===l2?`- [${s2.getChecked()?"x":" "}] `:"- ";o2.push(r3+c2+e2(s2)),i2++}return o2.join("\n")},ht2={dependencies:[Et$1],export:(t2,e2)=>{if(!Ft$1(t2))return null;const n2=Number(t2.getTag().slice(1));return"#".repeat(n2)+" "+e2(t2)},regExp:/^(#{1,6})\s/,replace:gt(t2=>At("h"+t2[1].length)),type:"element"},mt={dependencies:[xt$1],export:(t2,e2)=>{if(!wt$1(t2))return null;const n2=e2(t2).split("\n"),o2=[];for(const t3 of n2)o2.push("> "+t3);return o2.join("\n")},regExp:/^>\s/,replace:(t2,e2,n2,o2)=>{if(o2){const n3=t2.getPreviousSibling();if(wt$1(n3))return n3.splice(n3.getChildrenSize(),0,[Fn(),...e2]),void t2.remove()}const r2=Nt$1();r2.append(...e2),t2.replace(r2),o2||r2.select(0,0)},type:"element"},xt2={dependencies:[K],export:t2=>{if(!W(t2))return null;const e2=t2.getTextContent();return"```"+(t2.getLanguage()||"")+(e2?"\n"+e2:"")+"\n```"},regExpEnd:{optional:!0,regExp:/[ \t]*```$/},regExpStart:/^[ \t]*```([\w-]+)?/,replace:(t2,e2,n2,o2,r2,i2)=>{let s2,c2;if(!e2&&r2){if(1===r2.length)o2?(s2=$(),c2=n2[1]+r2[0]):(s2=$(n2[1]),c2=r2[0].startsWith(" ")?r2[0].slice(1):r2[0]);else{if(s2=$(n2[1]),0===r2[0].trim().length)for(;r2.length>0&&!r2[0].length;)r2.shift();else r2[0]=r2[0].startsWith(" ")?r2[0].slice(1):r2[0];for(;r2.length>0&&!r2[r2.length-1].length;)r2.pop();c2=r2.join("\n")}const e3=Qn(c2);s2.append(e3),t2.append(s2)}else e2&>(t3=>$(t3?t3[1]:void 0))(t2,e2,n2,i2)},type:"multiline-element"},Tt={dependencies:[rt$2,Y$2],export:(t2,e2)=>at(t2)?dt(t2,e2,0):null,regExp:/^(\s*)[-*+]\s/,replace:pt("bullet"),type:"element"},Ct={dependencies:[rt$2,Y$2],export:(t2,e2)=>at(t2)?dt(t2,e2,0):null,regExp:/^(\s*)(?:-\s)?\s?(\[(\s|x)?\])\s/i,replace:pt("check"),type:"element"},Et2={dependencies:[rt$2,Y$2],export:(t2,e2)=>at(t2)?dt(t2,e2,0):null,regExp:/^(\s*)(\d{1,})\.\s/,replace:pt("number"),type:"element"},yt={format:["code"],tag:"`",type:"text-format"},St={format:["bold","italic"],tag:"***",type:"text-format"},$t={format:["bold","italic"],intraword:!1,tag:"___",type:"text-format"},bt={format:["bold"],tag:"**",type:"text-format"},Ft={format:["bold"],intraword:!1,tag:"__",type:"text-format"},Nt={format:["italic"],tag:"*",type:"text-format"},wt={format:["italic"],intraword:!1,tag:"_",type:"text-format"},kt={dependencies:[g],export:(t2,e2,n2)=>{if(!p$1(t2)||O(t2))return null;const o2=t2.getTitle(),r2=e2(t2);return o2?`[${r2}](${t2.getURL()} "${o2}")`:`[${r2}](${t2.getURL()})`},importRegExp:/(?:\[(.*?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[(.*?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(t2,e2)=>{const[,n2,o2,r2]=e2,i2=d$2(o2,{title:r2}),s2=n2.split("[").length-1,c2=n2.split("]").length-1;let f3=n2,a2="";if(s2<c2)return;if(s2>c2){const t3=n2.split("[");a2="["+t3[0],f3=t3.slice(1).join("[")}const u2=Qn(f3);return u2.setFormat(t2.getFormat()),i2.append(u2),t2.replace(i2),a2&&i2.insertBefore(Qn(a2)),u2},trigger:")",type:"text-match"},_t=[...[ht2,mt,Tt,Et2],...[xt2],...[yt,St,$t,bt,Ft,{format:["highlight"],tag:"==",type:"text-format"},Nt,wt,{format:["strikethrough"],tag:"~~",type:"text-format"}],...[kt]],i=[{dependencies:[f$1],export:e2=>h$2(e2)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(e2,r2,t2,o2)=>{const l2=y();o2||null!=e2.getNextSibling()?e2.replace(l2):e2.insertBefore(l2),l2.selectNext()},type:"element"},..._t];function a({transformers:e2=i}){const[o2]=o$5();return reactExports.useEffect(()=>et(o2,e2),[o2,e2]),null}const markdownShortcutPlugin=realmPlugin({init(realm){const pluginIds=realm.getValue(activePlugins$),allowedHeadingLevels=pluginIds.includes("headings")?realm.getValue(allowedHeadingLevels$):[],transformers=function(pluginIds,allowedHeadingLevels){const transformers=[St,$t,bt,Ft,yt,Nt,wt];if(pluginIds.includes("headings")){const minHeadingLevel=Math.min(...allowedHeadingLevels),maxHeadingLevel=Math.max(...allowedHeadingLevels),headingRegExp=new RegExp(`^(#{${minHeadingLevel},${maxHeadingLevel}})\\s`),HEADING={dependencies:[Et$1],export:(node2,exportChildren)=>{if(!Ft$1(node2))return null;const level=Number(node2.getTag().slice(1));return"#".repeat(level)+" "+exportChildren(node2)},regExp:headingRegExp,replace:createBlockNode(match=>At(`h${match[1].length}`)),type:"element"};transformers.push(HEADING)}pluginIds.includes("thematicBreak")&&transformers.push(THEMATIC_BREAK);pluginIds.includes("quote")&&transformers.push(mt);pluginIds.includes("link")&&transformers.push(kt);pluginIds.includes("lists")&&transformers.push(Et2,Tt,Ct);if(pluginIds.includes("codeblock")){const codeTransformerCopy={...xt2,dependencies:[CodeBlockNode],replace:(parentNode,_children,match)=>{const codeBlockNode=$createCodeBlockNode({code:"",language:match[1]??"",meta:""});parentNode.selectPrevious(),parentNode.replace(codeBlockNode),setTimeout(()=>{codeBlockNode.select()},80)}};transformers.push(codeTransformerCopy)}return transformers}(pluginIds,allowedHeadingLevels),tableCellTransformers=transformers.filter(t2=>!LIST_TRANSFORMERS.has(t2));realm.pubIn({[addComposerChild$]:()=>React__default.createElement(a,{transformers:transformers}),[addNestedEditorChild$]:()=>React__default.createElement(a,{transformers:transformers}),[addTableCellEditorChild$]:()=>React__default.createElement(a,{transformers:tableCellTransformers})})}}),createBlockNode=createNode=>(parentNode,children,match)=>{const node2=createNode(match);node2.append(...children),parentNode.replace(node2),node2.select(0,0)},THEMATIC_BREAK={dependencies:[f$1],export:node2=>h$2(node2)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(parentNode,_1,_2,isImport)=>{const line=y();isImport||null!=parentNode.getNextSibling()?parentNode.replace(line):parentNode.insertBefore(line),line.selectNext()},type:"element"},LIST_TRANSFORMERS=new Set([Et2,Tt,Ct]);const BlockTypeSelect=()=>{const convertSelectionToNode=A$4(convertSelectionToNode$),currentBlockType=E$4(currentBlockType$),activePlugins=E$4(activePlugins$),hasQuote=activePlugins.includes("quote"),hasHeadings=activePlugins.includes("headings"),t2=useTranslation();if(!hasQuote&&!hasHeadings)return null;const items=[{label:t2("toolbar.blockTypes.paragraph","Paragraph"),value:"paragraph"}];if(hasQuote&&items.push({label:t2("toolbar.blockTypes.quote","Quote"),value:"quote"}),hasHeadings){const allowedHeadingLevels=E$4(allowedHeadingLevels$);items.push(...allowedHeadingLevels.map(n2=>({label:t2("toolbar.blockTypes.heading","Heading {{level}}",{level:n2}),value:`h${n2}`})))}return React__default.createElement(Select,{value:currentBlockType,onChange:blockType=>{switch(blockType){case"quote":convertSelectionToNode(()=>Nt$1());break;case"paragraph":convertSelectionToNode(()=>Fi());break;case"":break;default:if(!blockType.startsWith("h"))throw new Error(`Unknown block type: ${blockType}`);convertSelectionToNode(()=>At(blockType))}},triggerTitle:t2("toolbar.blockTypeSelect.selectBlockTypeTooltip","Select block type"),placeholder:t2("toolbar.blockTypeSelect.placeholder","Block type"),items:items})},FormatButton=({format:format,addTitle:addTitle,removeTitle:removeTitle,icon:icon,formatName:formatName})=>{const[currentFormat,iconComponentFor]=X$3(currentFormat$,iconComponentFor$),applyFormat=A$4(applyFormat$),active=0!==(currentFormat&format);return React__default.createElement(ToggleSingleGroupWithItem,{title:active?removeTitle:addTitle,on:active,onValueChange:()=>{applyFormat(formatName)}},iconComponentFor(icon))},BoldItalicUnderlineToggles=({options:options})=>{const t2=useTranslation(),showAllButtons=void 0===options;return React__default.createElement("div",{className:styles_toolbarGroupOfGroups},showAllButtons||options.includes("Bold")?React__default.createElement(FormatButton,{format:1,addTitle:t2("toolbar.bold","Bold"),removeTitle:t2("toolbar.removeBold","Remove bold"),icon:"format_bold",formatName:"bold"}):null,showAllButtons||options.includes("Italic")?React__default.createElement(FormatButton,{format:2,addTitle:t2("toolbar.italic","Italic"),removeTitle:t2("toolbar.removeItalic","Remove italic"),icon:"format_italic",formatName:"italic"}):null,showAllButtons||options.includes("Underline")?React__default.createElement(FormatButton,{format:8,addTitle:t2("toolbar.underline","Underline"),removeTitle:t2("toolbar.removeUnderline","Remove underline"),icon:"format_underlined",formatName:"underline"}):null)},CodeToggle=()=>{const[currentFormat,iconComponentFor]=X$3(currentFormat$,iconComponentFor$),applyFormat=A$4(applyFormat$),t2=useTranslation(),codeIsOn=!!(16¤tFormat),title=codeIsOn?t2("toolbar.removeInlineCode","Remove code format"):t2("toolbar.inlineCode","Inline code format");return React__default.createElement(MultipleChoiceToggleGroup,{items:[{title:title,contents:iconComponentFor("code"),active:codeIsOn,onChange:applyFormat.bind(null,"code")}]})},CreateLink=()=>{const openLinkDialog=A$4(openLinkEditDialog$),iconComponentFor=E$4(iconComponentFor$),t2=useTranslation();return React__default.createElement(ButtonWithTooltip,{"aria-label":t2("toolbar.link","Create link"),title:t2("toolbar.link","Create link"),onClick:_2=>{openLinkDialog()}},iconComponentFor("link"))},DiffSourceToggleWrapper=({children:children,SourceToolbar:SourceToolbar,options:options=["rich-text","diff","source"]})=>{const[viewMode,iconComponentFor]=X$3(viewMode$,iconComponentFor$),changeViewMode=A$4(viewMode$),t2=useTranslation(),toggleGroupItems=[];return options.includes("rich-text")&&toggleGroupItems.push({title:t2("toolbar.richText","Rich text"),contents:iconComponentFor("rich_text"),value:"rich-text"}),options.includes("diff")&&toggleGroupItems.push({title:t2("toolbar.diffMode","Diff mode"),contents:iconComponentFor("difference"),value:"diff"}),options.includes("source")&&toggleGroupItems.push({title:t2("toolbar.source","Source mode"),contents:iconComponentFor("markdown"),value:"source"}),React__default.createElement(React__default.Fragment,null,"rich-text"===viewMode?children:"diff"===viewMode?React__default.createElement("span",{className:styles_toolbarTitleMode},t2("toolbar.diffMode","Diff mode")):SourceToolbar??React__default.createElement("span",{className:styles_toolbarTitleMode},t2("toolbar.source","Source mode")),React__default.createElement("div",{className:styles_diffSourceToggleWrapper},React__default.createElement(SingleChoiceToggleGroup,{className:styles_diffSourceToggle,ggClassName:styles_ggDiffSourceToggle,value:viewMode,items:toggleGroupItems,onChange:value=>{changeViewMode(""===value?"rich-text":value)}})))},InsertCodeBlock=()=>{const insertCodeBlock=A$4(insertCodeBlock$),iconComponentFor=E$4(iconComponentFor$),t2=useTranslation();return React__default.createElement(ButtonWithTooltip,{title:t2("toolbar.codeBlock","Insert Code Block"),onClick:()=>{insertCodeBlock({})}},iconComponentFor("frame_source"))},InsertImage=React__default.forwardRef((_2,forwardedRef)=>{const openNewImageDialog=A$4(openNewImageDialog$),[readOnly,iconComponentFor]=X$3(readOnly$,iconComponentFor$),t2=useTranslation();return React__default.createElement(Button$1,{"aria-label":t2("toolbar.image","Insert image"),className:styles_toolbarButton,ref:forwardedRef,disabled:readOnly,onClick:()=>{openNewImageDialog()}},React__default.createElement(TooltipWrap,{title:t2("toolbar.image","Insert image")},iconComponentFor("add_photo")))}),InsertTable=()=>{const iconComponentFor=E$4(iconComponentFor$),insertTable=A$4(insertTable$),t2=useTranslation(),isDisabled=E$4(editorInTable$);return React__default.createElement(ButtonWithTooltip,{title:t2("toolbar.table","Insert Table"),onClick:()=>{insertTable({rows:3,columns:3})},...isDisabled?{"aria-disabled":!0,"data-disabled":!0,disabled:!0}:{}},iconComponentFor("table"))},InsertThematicBreak=()=>{const insertThematicBreak=A$4(insertThematicBreak$),iconComponentFor=E$4(iconComponentFor$),t2=useTranslation();return React__default.createElement(ButtonWithTooltip,{title:t2("toolbar.thematicBreak","Insert thematic break"),onClick:()=>{insertThematicBreak()}},iconComponentFor("horizontal_rule"))},ICON_NAME_MAP={bullet:"format_list_bulleted",number:"format_list_numbered",check:"format_list_checked"},ListsToggle=({options:options=["bullet","number","check"]})=>{const[currentListType,iconComponentFor,inTable]=X$3(currentListType$,iconComponentFor$,editorInTable$),applyListType=A$4(applyListType$),t2=useTranslation(),LIST_TITLE_MAP={bullet:t2("toolbar.bulletedList","Bulleted list"),number:t2("toolbar.numberedList","Numbered list"),check:t2("toolbar.checkList","Check list")},items=options.map(type=>({value:type,title:LIST_TITLE_MAP[type],contents:iconComponentFor(ICON_NAME_MAP[type])}));return React__default.createElement(SingleChoiceToggleGroup,{value:currentListType||"",items:items,onChange:applyListType,disabled:inTable})},UndoRedo=()=>{const[iconComponentFor,activeEditor]=X$3(iconComponentFor$,activeEditor$),[canUndo,setCanUndo]=React__default.useState(!1),[canRedo,setCanRedo]=React__default.useState(!1),t2=useTranslation();return React__default.useEffect(()=>{if(activeEditor)return j$2(activeEditor.registerCommand(He,payload=>(setCanUndo(payload),!1),4),activeEditor.registerCommand(Ye,payload=>(setCanRedo(payload),!1),4))},[activeEditor]),React__default.createElement(MultipleChoiceToggleGroup,{items:[{title:t2("toolbar.undo","Undo {{shortcut}}",{shortcut:IS_APPLE?"⌘Z":"Ctrl+Z"}),disabled:!canUndo,contents:iconComponentFor("undo"),active:!1,onChange:()=>null==activeEditor?void 0:activeEditor.dispatchCommand(xe,void 0)},{title:t2("toolbar.redo","Redo {{shortcut}}",{shortcut:IS_APPLE?"⌘Y":"Ctrl+Y"}),disabled:!canRedo,contents:iconComponentFor("redo"),active:!1,onChange:()=>null==activeEditor?void 0:activeEditor.dispatchCommand(Ce,void 0)}]})};export{BoldItalicUnderlineToggles as B,CodeToggle as C,DiffSourceToggleWrapper as D,InsertImage as I,ListsToggle as L,MDXEditor as M,Separator as S,UndoRedo as U,__vitePreload as _,linkPlugin as a,linkDialogPlugin as b,codeBlockPlugin as c,codeMirrorPlugin as d,thematicBreakPlugin as e,diffSourcePlugin as f,toolbarPlugin as g,headingsPlugin as h,imagePlugin as i,BlockTypeSelect as j,CreateLink as k,listsPlugin as l,markdownShortcutPlugin as m,InsertTable as n,InsertCodeBlock as o,InsertThematicBreak as p,quotePlugin as q,tablePlugin as t};
|