const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-DPB4Rf0C-BGgsGAY9.js","assets/html-B50bmoVb-Cb86E5ej.js","assets/javascript-C25yR2R2-wDzz0qaB.js","assets/css-CECN5uSL-DPfMkruS.js","assets/angular-ts-CTOR2ofC-k8fsuEIJ.js","assets/scss-B1FaCqwR-D5j8Lzl0.js","assets/apl-CjNiDgad-CT4Sbzkr.js","assets/xml-C2J0sS9M-wPCL2nsB.js","assets/java-DY6VlHhP-CylS5w8V.js","assets/json-DxJze_jm-Cp-IABpG.js","assets/astro-CFFExE8Q-HUi9-hH-.js","assets/typescript-RycA9KXf-BPQ3VLAy.js","assets/postcss-05aHdL-n-CXtECtnM.js","assets/tsx-B8rCNbgL-COt5Ahok.js","assets/blade-CRa6j5zS-DjoTdYFr.js","assets/html-derivative-C6bxFbFW-Iy97gZi_.js","assets/sql-Cn_v3PB0-BLtJtn59.js","assets/bsl-NkNNwerW-COH_2WFP.js","assets/sdbl-B7T8abf4-DVxCFoDh.js","assets/cairo-DM6WF2e3-DtzH3ucv.js","assets/python-BFNSHbwJ-B6aJPvgy.js","assets/cobol-HihOMwht-CEH5cA2t.js","assets/coffee-DGBR_nr_-BGq2hPi0.js","assets/cpp-Cj177cuW-CX9fafSh.js","assets/regexp-BazyLpPg-CDVJQ6XC.js","assets/glsl-CkUcVZNK-Bf0UjSP5.js","assets/c-eeMepfLm-BIGW1oBm.js","assets/crystal-CRJyc4G--DiK3qIky.js","assets/shellscript-InADTalH-Yzrsuije.js","assets/edge-BYQkOzbF-DYO1BWoQ.js","assets/elixir-Dh036GMp-Bmki-TVL.js","assets/elm-BtNbw_Cd-Bp18OckW.js","assets/erb-CS4zioBv-CIsDXqOo.js","assets/ruby-DMPw6uKF-che4axXI.js","assets/haml-NZLVzu_R-C8mKtd0e.js","assets/graphql-CBu2ehBn-Cr253Gy9.js","assets/jsx-BtKADgXT-g9-lgVsj.js","assets/lua-kX5WP_P5-BiSz3S93.js","assets/yaml-DaO7k5B1-Buea-lGh.js","assets/erlang-DNcDT8Hi-BWqZUIhL.js","assets/markdown-CrScaQ96-Cvjx9yec.js","assets/fortran-fixed-form-DUsA-VGo-CqycLhgt.js","assets/fortran-free-form-DPIT_jbP-D22FLkUw.js","assets/fsharp-CYOiIVNx-C_zLmMdw.js","assets/gdresource-BwtMIoBm-DAu1Gww7.js","assets/gdshader-Bk8fF6yr-DkwncUOv.js","assets/gdscript-BifyeYhI-DTMYz4Jt.js","assets/git-commit-Bd32YZ0K-DKnZnecv.js","assets/diff-BxzP2J8R-D97Zzqfu.js","assets/git-rebase-ZWUFO_T4-PODeWoq4.js","assets/glimmer-js-DkxNrfPT-CYvKIGv7.js","assets/glimmer-ts-D6YZEmK_-BwkeDeeu.js","assets/hack-ItRNKiEb-Dz4s7CVj.js","assets/handlebars-mxStpSE7-B5GnhLue.js","assets/http-DLvAkeD--BNfsu0Nw.js","assets/hurl-CgkFN90t-RkzLjdXO.js","assets/csv-CmYOceLb-Co7V7EpZ.js","assets/hxml-GbqSQCLa-MyDbT556.js","assets/haxe-TztHsm5T-CzTSHFRz.js","assets/jinja-CFW5uAwY-CRnS6Ysd.js","assets/jison-DdreslRX-C_aDQymB.js","assets/julia--2-efCjg-ZfD7vPuG.js","assets/r-Bm0uF0U2-DiinP2Uv.js","assets/latex-Cs75fyNk-BaSXX46b.js","assets/tex-DpOayVob-BUPSY20p.js","assets/liquid-CHzkx3jT-zQly3uxw.js","assets/marko-ls0Jg2j8-CH6c4llz.js","assets/less-B1GLI2Di-B1dDrJ26.js","assets/mdc-uaivvctV-DArzT8kn.js","assets/nginx-5vhPAEw3-DWisHew1.js","assets/nim-QAjRdh9w-DCY1hsTS.js","assets/perl-DkVrgJBg-BOYFiEPK.js","assets/php-j2zCzTEz-D4sqbyu8.js","assets/pug-XOw9Q1Ho-ibTSJqKJ.js","assets/qml-rTNXsquU-ChczqDSS.js","assets/razor-B1z-bksM-BImEwUiZ.js","assets/csharp-C7yUs7-w-K5feNrxe.js","assets/rst-CcbeA9zE-DJw32adD.js","assets/cmake-BJz8BOTU-D1j8_8rp.js","assets/sas-fpEvgATw-BHxbuS_h.js","assets/shaderlab-Cr62-Wb4-DBlXx3uy.js","assets/hlsl-Bk8TCZNL-D3lLCCz7.js","assets/shellsession-DiDJNQdy-DyhC3EVy.js","assets/soy-C1-6njHa-gzSMiW6X.js","assets/sparql-B0KWFEri-hRQCfo7w.js","assets/turtle-_H59FV7D-BsS91CYL.js","assets/stata-B8c5fTjX-C93OJGXX.js","assets/svelte-5UasyOg7-zJZT0dEM.js","assets/templ-peLZIM2D-BFctp3GS.js","assets/go-ChxJuLYK-Dn2_MT6a.js","assets/ts-tags-ioVe2PKw-KHYt7rNi.js","assets/twig-CcRLVyUg-C7btHcUR.js","assets/vue-DOVAQqiz-Cv_ide59.js","assets/vue-html-C7WI2elu-3aWFIZnF.js","assets/vue-vine-D386fra9-CJV7hRr5.js","assets/stylus-CyKEU1Ej-BEDo0Tqx.js","assets/xsl-BmSZphgC-CVyS_1ZI.js"])))=>i.map(i=>d[i]); var p3=Object.defineProperty;var CS=t=>{throw TypeError(t)};var f3=(t,e,n)=>e in t?p3(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var V=(t,e,n)=>f3(t,typeof e!="symbol"?e+"":e,n),tg=(t,e,n)=>e.has(t)||CS("Cannot "+n);var vi=(t,e,n)=>(tg(t,e,"read from private field"),n?n.call(t):e.get(t)),Oh=(t,e,n)=>e.has(t)?CS("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),DS=(t,e,n,r)=>(tg(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),co=(t,e,n)=>(tg(t,e,"access private method"),n);import{j as E,r as v,y as Ne,aL as pl,_ as k,z as iA,aM as sA}from"./vendor-BKmmeuxg.js";var AS={};function oA(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e{const o=bn("rte-toolbar",e&&"rte-toolbar--dense",n&&"rte-toolbar--vertical",r);return E.jsx("div",{className:o,...i,ref:s,children:t})});li.displayName="Toolbar";const Ni=v.forwardRef(({horizontal:t,className:e,...n},r)=>{const i=bn("bg-neutral-200 dark:bg-neutral-800 rte-toolbar__divider",t&&"rte-toolbar__divider--horizontal",e);return E.jsx("div",{className:i,ref:r,...n})});Ni.displayName="Toolbar.Divider";function ve(t,e,{checkForDefaultPrevented:n=!0}={}){return function(r){if(t==null||t(r),n===!1||!r.defaultPrevented)return e==null?void 0:e(r)}}function PS(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function xf(...t){return e=>{let n=!1;const r=t.map(i=>{const s=PS(i,e);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let i=0;i{const{children:o,...a}=s,l=v.useMemo(()=>a,Object.values(a));return E.jsx(n.Provider,{value:l,children:o})};r.displayName=t+"Provider";function i(s){const o=v.useContext(n);if(o)return o;if(e!==void 0)return e;throw new Error(`\`${s}\` must be used within \`${t}\``)}return[r,i]}function Ys(t,e=[]){let n=[];function r(s,o){const a=v.createContext(o),l=n.length;n=[...n,o];const c=h=>{var y;const{scope:d,children:p,...f}=h,m=((y=d==null?void 0:d[t])==null?void 0:y[l])||a,g=v.useMemo(()=>f,Object.values(f));return E.jsx(m.Provider,{value:g,children:p})};c.displayName=s+"Provider";function u(h,d){var m;const p=((m=d==null?void 0:d[t])==null?void 0:m[l])||a,f=v.useContext(p);if(f)return f;if(o!==void 0)return o;throw new Error(`\`${h}\` must be used within \`${s}\``)}return[c,u]}const i=()=>{const s=n.map(o=>v.createContext(o));return function(o){const a=(o==null?void 0:o[t])||s;return v.useMemo(()=>({[`__scope${t}`]:{...o,[t]:a}}),[o,a])}};return i.scopeName=t,[r,g3(i,...e)]}function g3(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(i){const s=r.reduce((o,{useScope:a,scopeName:l})=>{const c=a(i)[`__scope${l}`];return{...o,...c}},{});return v.useMemo(()=>({[`__scope${e.scopeName}`]:s}),[s])}};return n.scopeName=e.scopeName,n}function Ba(t){const e=O3(t),n=v.forwardRef((r,i)=>{const{children:s,...o}=r,a=v.Children.toArray(s),l=a.find(b3);if(l){const c=l.props.children,u=a.map(h=>h===l?v.Children.count(c)>1?v.Children.only(null):v.isValidElement(c)?c.props.children:null:h);return E.jsx(e,{...o,ref:i,children:v.isValidElement(c)?v.cloneElement(c,void 0,u):null})}return E.jsx(e,{...o,ref:i,children:s})});return n.displayName=`${t}.Slot`,n}function O3(t){const e=v.forwardRef((n,r)=>{const{children:i,...s}=n;if(v.isValidElement(i)){const o=v3(i),a=E3(s,i.props);return i.type!==v.Fragment&&(a.ref=r?xf(r,o):o),v.cloneElement(i,a)}return v.Children.count(i)>1?v.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var aA=Symbol("radix.slottable");function y3(t){const e=({children:n})=>E.jsx(E.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=aA,e}function b3(t){return v.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===aA}function E3(t,e){const n={...e};for(const r in e){const i=t[r],s=e[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...o)=>{const a=s(...o);return i(...o),a}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...t,...n}}function v3(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var T3=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],pt=T3.reduce((t,e)=>{const n=Ba(`Primitive.${e}`),r=v.forwardRef((i,s)=>{const{asChild:o,...a}=i,l=o?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),E.jsx(l,{...a,ref:s})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function lA(t,e){t&&pl.flushSync(()=>t.dispatchEvent(e))}function Wi(t){const e=v.useRef(t);return v.useEffect(()=>{e.current=t}),v.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function S3(t,e=globalThis==null?void 0:globalThis.document){const n=Wi(t);v.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var w3="DismissableLayer",JO="dismissableLayer.update",k3="dismissableLayer.pointerDownOutside",_3="dismissableLayer.focusOutside",NS,cA=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ru=v.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:o,onDismiss:a,...l}=t,c=v.useContext(cA),[u,h]=v.useState(null),d=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=v.useState({}),f=_t(e,C=>h(C)),m=Array.from(c.layers),[g]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),y=m.indexOf(g),b=u?m.indexOf(u):-1,T=c.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,w=D3(C=>{const N=C.target,$=[...c.branches].some(I=>I.contains(N));!S||$||(i==null||i(C),o==null||o(C),C.defaultPrevented||(a==null||a()))},d),A=A3(C=>{const N=C.target;[...c.branches].some($=>$.contains(N))||(s==null||s(C),o==null||o(C),C.defaultPrevented||(a==null||a()))},d);return S3(C=>{b===c.layers.size-1&&(r==null||r(C),!C.defaultPrevented&&a&&(C.preventDefault(),a()))},d),v.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(NS=d.body.style.pointerEvents,d.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),RS(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(d.body.style.pointerEvents=NS)}},[u,d,n,c]),v.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),RS())},[u,c]),v.useEffect(()=>{const C=()=>p({});return document.addEventListener(JO,C),()=>document.removeEventListener(JO,C)},[]),E.jsx(pt.div,{...l,ref:f,style:{pointerEvents:T?S?"auto":"none":void 0,...t.style},onFocusCapture:ve(t.onFocusCapture,A.onFocusCapture),onBlurCapture:ve(t.onBlurCapture,A.onBlurCapture),onPointerDownCapture:ve(t.onPointerDownCapture,w.onPointerDownCapture)})});Ru.displayName=w3;var x3="DismissableLayerBranch",C3=v.forwardRef((t,e)=>{const n=v.useContext(cA),r=v.useRef(null),i=_t(e,r);return v.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),E.jsx(pt.div,{...t,ref:i})});C3.displayName=x3;function D3(t,e=globalThis==null?void 0:globalThis.document){const n=Wi(t),r=v.useRef(!1),i=v.useRef(()=>{});return v.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let l=function(){uA(k3,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=l,e.addEventListener("click",i.current,{once:!0})):l()}else e.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",s),e.removeEventListener("click",i.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function A3(t,e=globalThis==null?void 0:globalThis.document){const n=Wi(t),r=v.useRef(!1);return v.useEffect(()=>{const i=s=>{s.target&&!r.current&&uA(_3,n,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function RS(){const t=new CustomEvent(JO);document.dispatchEvent(t)}function uA(t,e,n,{discrete:r}){const i=n.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?lA(i,s):i.dispatchEvent(s)}var ng=0;function yE(){v.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??MS()),document.body.insertAdjacentElement("beforeend",t[1]??MS()),ng++,()=>{ng===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),ng--}},[])}function MS(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var rg="focusScope.autoFocusOnMount",ig="focusScope.autoFocusOnUnmount",IS={bubbles:!1,cancelable:!0},P3="FocusScope",Cf=v.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=t,[a,l]=v.useState(null),c=Wi(i),u=Wi(s),h=v.useRef(null),d=_t(e,m=>l(m)),p=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let m=function(T){if(p.paused||!a)return;const S=T.target;a.contains(S)?h.current=S:fs(h.current,{select:!0})},g=function(T){if(p.paused||!a)return;const S=T.relatedTarget;S!==null&&(a.contains(S)||fs(h.current,{select:!0}))},y=function(T){if(document.activeElement===document.body)for(const S of T)S.removedNodes.length>0&&fs(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",g);const b=new MutationObserver(y);return a&&b.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",g),b.disconnect()}}},[r,a,p.paused]),v.useEffect(()=>{if(a){QS.add(p);const m=document.activeElement;if(!a.contains(m)){const g=new CustomEvent(rg,IS);a.addEventListener(rg,c),a.dispatchEvent(g),g.defaultPrevented||(N3(Q3(hA(a)),{select:!0}),document.activeElement===m&&fs(a))}return()=>{a.removeEventListener(rg,c),setTimeout(()=>{const g=new CustomEvent(ig,IS);a.addEventListener(ig,u),a.dispatchEvent(g),g.defaultPrevented||fs(m??document.body,{select:!0}),a.removeEventListener(ig,u),QS.remove(p)},0)}}},[a,c,u,p]);const f=v.useCallback(m=>{if(!n&&!r||p.paused)return;const g=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,y=document.activeElement;if(g&&y){const b=m.currentTarget,[T,S]=R3(b);T&&S?!m.shiftKey&&y===S?(m.preventDefault(),n&&fs(T,{select:!0})):m.shiftKey&&y===T&&(m.preventDefault(),n&&fs(S,{select:!0})):y===b&&m.preventDefault()}},[n,r,p.paused]);return E.jsx(pt.div,{tabIndex:-1,...o,ref:d,onKeyDown:f})});Cf.displayName=P3;function N3(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(fs(r,{select:e}),document.activeElement!==n)return}function R3(t){const e=hA(t),n=LS(e,t),r=LS(e.reverse(),t);return[n,r]}function hA(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function LS(t,e){for(const n of t)if(!M3(n,{upTo:e}))return n}function M3(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function I3(t){return t instanceof HTMLInputElement&&"select"in t}function fs(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&I3(t)&&e&&t.select()}}var QS=L3();function L3(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=$S(t,e),t.unshift(e)},remove(e){var n;t=$S(t,e),(n=t[0])==null||n.resume()}}}function $S(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function Q3(t){return t.filter(e=>e.tagName!=="A")}var Vs=globalThis!=null&&globalThis.document?v.useLayoutEffect:()=>{},$3=sA[" useId ".trim().toString()]||(()=>{}),F3=0;function Is(t){const[e,n]=v.useState($3());return Vs(()=>{n(r=>r??String(F3++))},[t]),e?`radix-${e}`:""}const dA=["top","right","bottom","left"],FS=["start","end"],BS=dA.reduce((t,e)=>t.concat(e,e+"-"+FS[0],e+"-"+FS[1]),[]),kr=Math.min,dn=Math.max,Yd=Math.round,yh=Math.floor,si=t=>({x:t,y:t}),B3={left:"right",right:"left",bottom:"top",top:"bottom"},j3={start:"end",end:"start"};function ey(t,e,n){return dn(t,kr(e,n))}function _r(t,e){return typeof t=="function"?t(e):t}function Yn(t){return t.split("-")[0]}function wr(t){return t.split("-")[1]}function bE(t){return t==="x"?"y":"x"}function EE(t){return t==="y"?"height":"width"}const z3=new Set(["top","bottom"]);function vr(t){return z3.has(Yn(t))?"y":"x"}function vE(t){return bE(vr(t))}function pA(t,e,n){n===void 0&&(n=!1);const r=wr(t),i=vE(t),s=EE(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=Jd(o)),[o,Jd(o)]}function V3(t){const e=Jd(t);return[Kd(t),e,Kd(e)]}function Kd(t){return t.replace(/start|end/g,e=>j3[e])}const jS=["left","right"],zS=["right","left"],U3=["top","bottom"],H3=["bottom","top"];function X3(t,e,n){switch(t){case"top":case"bottom":return n?e?zS:jS:e?jS:zS;case"left":case"right":return e?U3:H3;default:return[]}}function q3(t,e,n,r){const i=wr(t);let s=X3(Yn(t),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(Kd)))),s}function Jd(t){return t.replace(/left|right|bottom|top/g,e=>B3[e])}function Z3(t){return{top:0,right:0,bottom:0,left:0,...t}}function TE(t){return typeof t!="number"?Z3(t):{top:t,right:t,bottom:t,left:t}}function ja(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function VS(t,e,n){let{reference:r,floating:i}=t;const s=vr(e),o=vE(e),a=EE(o),l=Yn(e),c=s==="y",u=r.x+r.width/2-i.width/2,h=r.y+r.height/2-i.height/2,d=r[a]/2-i[a]/2;let p;switch(l){case"top":p={x:u,y:r.y-i.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:h};break;case"left":p={x:r.x-i.width,y:h};break;default:p={x:r.x,y:r.y}}switch(wr(e)){case"start":p[o]-=d*(n&&c?-1:1);break;case"end":p[o]+=d*(n&&c?-1:1);break}return p}const W3=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,a=s.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(e));let c=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:h}=VS(c,r,l),d=r,p={},f=0;for(let m=0;m({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:s,platform:o,elements:a,middlewareData:l}=e,{element:c,padding:u=0}=_r(t,e)||{};if(c==null)return{};const h=TE(u),d={x:n,y:r},p=vE(i),f=EE(p),m=await o.getDimensions(c),g=p==="y",y=g?"top":"left",b=g?"bottom":"right",T=g?"clientHeight":"clientWidth",S=s.reference[f]+s.reference[p]-d[p]-s.floating[f],w=d[p]-s.reference[p],A=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c));let C=A?A[T]:0;(!C||!await(o.isElement==null?void 0:o.isElement(A)))&&(C=a.floating[T]||s.floating[f]);const N=S/2-w/2,$=C/2-m[f]/2-1,I=kr(h[y],$),L=kr(h[b],$),Z=I,B=C-m[f]-L,j=C/2-m[f]/2+N,U=ey(Z,j,B),J=!l.arrow&&wr(i)!=null&&j!==U&&s.reference[f]/2-(jwr(r)===t),...n.filter(r=>wr(r)!==t)]:n.filter(r=>Yn(r)===r)).filter(r=>t?wr(r)===t||(e?Kd(r)!==r:!1):!0)}const K3=function(t){return t===void 0&&(t={}),{name:"autoPlacement",options:t,async fn(e){var n,r,i;const{rects:s,middlewareData:o,placement:a,platform:l,elements:c}=e,{crossAxis:u=!1,alignment:h,allowedPlacements:d=BS,autoAlignment:p=!0,...f}=_r(t,e),m=h!==void 0||d===BS?Y3(h||null,p,d):d,g=await za(e,f),y=((n=o.autoPlacement)==null?void 0:n.index)||0,b=m[y];if(b==null)return{};const T=pA(b,s,await(l.isRTL==null?void 0:l.isRTL(c.floating)));if(a!==b)return{reset:{placement:m[0]}};const S=[g[Yn(b)],g[T[0]],g[T[1]]],w=[...((r=o.autoPlacement)==null?void 0:r.overflows)||[],{placement:b,overflows:S}],A=m[y+1];if(A)return{data:{index:y+1,overflows:w},reset:{placement:A}};const C=w.map($=>{const I=wr($.placement);return[$.placement,I&&u?$.overflows.slice(0,2).reduce((L,Z)=>L+Z,0):$.overflows[0],$.overflows]}).sort(($,I)=>$[1]-I[1]),N=((i=C.filter($=>$[2].slice(0,wr($[0])?2:3).every(I=>I<=0))[0])==null?void 0:i[0])||C[0][0];return N!==a?{data:{index:y+1,overflows:w},reset:{placement:N}}:{}}}},J3=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:s,rects:o,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:u=!0,crossAxis:h=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:m=!0,...g}=_r(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const y=Yn(i),b=vr(a),T=Yn(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(c.floating)),w=d||(T||!m?[Jd(a)]:V3(a)),A=f!=="none";!d&&A&&w.push(...q3(a,m,f,S));const C=[a,...w],N=await za(e,g),$=[];let I=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&$.push(N[y]),h){const j=pA(i,o,S);$.push(N[j[0]],N[j[1]])}if(I=[...I,{placement:i,overflows:$}],!$.every(j=>j<=0)){var L,Z;const j=(((L=s.flip)==null?void 0:L.index)||0)+1,U=C[j];if(U&&(!(h==="alignment"&&b!==vr(U))||I.every(fe=>vr(fe.placement)===b?fe.overflows[0]>0:!0)))return{data:{index:j,overflows:I},reset:{placement:U}};let J=(Z=I.filter(fe=>fe.overflows[0]<=0).sort((fe,z)=>fe.overflows[1]-z.overflows[1])[0])==null?void 0:Z.placement;if(!J)switch(p){case"bestFit":{var B;const fe=(B=I.filter(z=>{if(A){const ne=vr(z.placement);return ne===b||ne==="y"}return!0}).map(z=>[z.placement,z.overflows.filter(ne=>ne>0).reduce((ne,Oe)=>ne+Oe,0)]).sort((z,ne)=>z[1]-ne[1])[0])==null?void 0:B[0];fe&&(J=fe);break}case"initialPlacement":J=a;break}if(i!==J)return{reset:{placement:J}}}return{}}}};function US(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function HS(t){return dA.some(e=>t[e]>=0)}const e5=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...i}=_r(t,e);switch(r){case"referenceHidden":{const s=await za(e,{...i,elementContext:"reference"}),o=US(s,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:HS(o)}}}case"escaped":{const s=await za(e,{...i,altBoundary:!0}),o=US(s,n.floating);return{data:{escapedOffsets:o,escaped:HS(o)}}}default:return{}}}}};function fA(t){const e=kr(...t.map(s=>s.left)),n=kr(...t.map(s=>s.top)),r=dn(...t.map(s=>s.right)),i=dn(...t.map(s=>s.bottom));return{x:e,y:n,width:r-e,height:i-n}}function t5(t){const e=t.slice().sort((i,s)=>i.y-s.y),n=[];let r=null;for(let i=0;ir.height/2?n.push([s]):n[n.length-1].push(s),r=s}return n.map(i=>ja(fA(i)))}const n5=function(t){return t===void 0&&(t={}),{name:"inline",options:t,async fn(e){const{placement:n,elements:r,rects:i,platform:s,strategy:o}=e,{padding:a=2,x:l,y:c}=_r(t,e),u=Array.from(await(s.getClientRects==null?void 0:s.getClientRects(r.reference))||[]),h=t5(u),d=ja(fA(u)),p=TE(a);function f(){if(h.length===2&&h[0].left>h[1].right&&l!=null&&c!=null)return h.find(g=>l>g.left-p.left&&lg.top-p.top&&c=2){if(vr(n)==="y"){const I=h[0],L=h[h.length-1],Z=Yn(n)==="top",B=I.top,j=L.bottom,U=Z?I.left:L.left,J=Z?I.right:L.right,fe=J-U,z=j-B;return{top:B,bottom:j,left:U,right:J,width:fe,height:z,x:U,y:B}}const g=Yn(n)==="left",y=dn(...h.map(I=>I.right)),b=kr(...h.map(I=>I.left)),T=h.filter(I=>g?I.left===b:I.right===y),S=T[0].top,w=T[T.length-1].bottom,A=b,C=y,N=C-A,$=w-S;return{top:S,bottom:w,left:A,right:C,width:N,height:$,x:A,y:S}}return d}const m=await s.getElementRects({reference:{getBoundingClientRect:f},floating:r.floating,strategy:o});return i.reference.x!==m.reference.x||i.reference.y!==m.reference.y||i.reference.width!==m.reference.width||i.reference.height!==m.reference.height?{reset:{rects:m}}:{}}}},mA=new Set(["left","top"]);async function r5(t,e){const{placement:n,platform:r,elements:i}=t,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Yn(n),a=wr(n),l=vr(n)==="y",c=mA.has(o)?-1:1,u=s&&l?-1:1,h=_r(e,t);let{mainAxis:d,crossAxis:p,alignmentAxis:f}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof f=="number"&&(p=a==="end"?f*-1:f),l?{x:p*u,y:d*c}:{x:d*c,y:p*u}}const i5=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:s,placement:o,middlewareData:a}=e,l=await r5(e,t);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:o}}}}},s5=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:g=>{let{x:y,y:b}=g;return{x:y,y:b}}},...l}=_r(t,e),c={x:n,y:r},u=await za(e,l),h=vr(Yn(i)),d=bE(h);let p=c[d],f=c[h];if(s){const g=d==="y"?"top":"left",y=d==="y"?"bottom":"right",b=p+u[g],T=p-u[y];p=ey(b,p,T)}if(o){const g=h==="y"?"top":"left",y=h==="y"?"bottom":"right",b=f+u[g],T=f-u[y];f=ey(b,f,T)}const m=a.fn({...e,[d]:p,[h]:f});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[d]:s,[h]:o}}}}}},o5=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:i,rects:s,middlewareData:o}=e,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=_r(t,e),u={x:n,y:r},h=vr(i),d=bE(h);let p=u[d],f=u[h];const m=_r(a,e),g=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const T=d==="y"?"height":"width",S=s.reference[d]-s.floating[T]+g.mainAxis,w=s.reference[d]+s.reference[T]-g.mainAxis;pw&&(p=w)}if(c){var y,b;const T=d==="y"?"width":"height",S=mA.has(Yn(i)),w=s.reference[h]-s.floating[T]+(S&&((y=o.offset)==null?void 0:y[h])||0)+(S?0:g.crossAxis),A=s.reference[h]+s.reference[T]+(S?0:((b=o.offset)==null?void 0:b[h])||0)-(S?g.crossAxis:0);fA&&(f=A)}return{[d]:p,[h]:f}}}},a5=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:i,rects:s,platform:o,elements:a}=e,{apply:l=()=>{},...c}=_r(t,e),u=await za(e,c),h=Yn(i),d=wr(i),p=vr(i)==="y",{width:f,height:m}=s.floating;let g,y;h==="top"||h==="bottom"?(g=h,y=d===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(y=h,g=d==="end"?"top":"bottom");const b=m-u.top-u.bottom,T=f-u.left-u.right,S=kr(m-u[g],b),w=kr(f-u[y],T),A=!e.middlewareData.shift;let C=S,N=w;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(N=T),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(C=b),A&&!d){const I=dn(u.left,0),L=dn(u.right,0),Z=dn(u.top,0),B=dn(u.bottom,0);p?N=f-2*(I!==0||L!==0?I+L:dn(u.left,u.right)):C=m-2*(Z!==0||B!==0?Z+B:dn(u.top,u.bottom))}await l({...e,availableWidth:N,availableHeight:C});const $=await o.getDimensions(a.floating);return f!==$.width||m!==$.height?{reset:{rects:!0}}:{}}}};function Df(){return typeof window<"u"}function fl(t){return gA(t)?(t.nodeName||"").toLowerCase():"#document"}function Zn(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function pi(t){var e;return(e=(gA(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function gA(t){return Df()?t instanceof Node||t instanceof Zn(t).Node:!1}function xr(t){return Df()?t instanceof Element||t instanceof Zn(t).Element:!1}function ci(t){return Df()?t instanceof HTMLElement||t instanceof Zn(t).HTMLElement:!1}function XS(t){return!Df()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Zn(t).ShadowRoot}const l5=new Set(["inline","contents"]);function Mu(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=Cr(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!l5.has(i)}const c5=new Set(["table","td","th"]);function u5(t){return c5.has(fl(t))}const h5=[":popover-open",":modal"];function Af(t){return h5.some(e=>{try{return t.matches(e)}catch{return!1}})}const d5=["transform","translate","scale","rotate","perspective"],p5=["transform","translate","scale","rotate","perspective","filter"],f5=["paint","layout","strict","content"];function SE(t){const e=wE(),n=xr(t)?Cr(t):t;return d5.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||p5.some(r=>(n.willChange||"").includes(r))||f5.some(r=>(n.contain||"").includes(r))}function m5(t){let e=Us(t);for(;ci(e)&&!Va(e);){if(SE(e))return e;if(Af(e))return null;e=Us(e)}return null}function wE(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const g5=new Set(["html","body","#document"]);function Va(t){return g5.has(fl(t))}function Cr(t){return Zn(t).getComputedStyle(t)}function Pf(t){return xr(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Us(t){if(fl(t)==="html")return t;const e=t.assignedSlot||t.parentNode||XS(t)&&t.host||pi(t);return XS(e)?e.host:e}function OA(t){const e=Us(t);return Va(e)?t.ownerDocument?t.ownerDocument.body:t.body:ci(e)&&Mu(e)?e:OA(e)}function Uc(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=OA(t),s=i===((r=t.ownerDocument)==null?void 0:r.body),o=Zn(i);if(s){const a=ty(o);return e.concat(o,o.visualViewport||[],Mu(i)?i:[],a&&n?Uc(a):[])}return e.concat(i,Uc(i,[],n))}function ty(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function yA(t){const e=Cr(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=ci(t),s=i?t.offsetWidth:n,o=i?t.offsetHeight:r,a=Yd(n)!==s||Yd(r)!==o;return a&&(n=s,r=o),{width:n,height:r,$:a}}function kE(t){return xr(t)?t:t.contextElement}function Da(t){const e=kE(t);if(!ci(e))return si(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:s}=yA(e);let o=(s?Yd(n.width):n.width)/r,a=(s?Yd(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const O5=si(0);function bA(t){const e=Zn(t);return!wE()||!e.visualViewport?O5:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function y5(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Zn(t)?!1:e}function Ro(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=kE(t);let o=si(1);e&&(r?xr(r)&&(o=Da(r)):o=Da(t));const a=y5(s,n,r)?bA(s):si(0);let l=(i.left+a.x)/o.x,c=(i.top+a.y)/o.y,u=i.width/o.x,h=i.height/o.y;if(s){const d=Zn(s),p=r&&xr(r)?Zn(r):r;let f=d,m=ty(f);for(;m&&r&&p!==f;){const g=Da(m),y=m.getBoundingClientRect(),b=Cr(m),T=y.left+(m.clientLeft+parseFloat(b.paddingLeft))*g.x,S=y.top+(m.clientTop+parseFloat(b.paddingTop))*g.y;l*=g.x,c*=g.y,u*=g.x,h*=g.y,l+=T,c+=S,f=Zn(m),m=ty(f)}}return ja({width:u,height:h,x:l,y:c})}function Nf(t,e){const n=Pf(t).scrollLeft;return e?e.left+n:Ro(pi(t)).left+n}function EA(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-Nf(t,n),i=n.top+e.scrollTop;return{x:r,y:i}}function b5(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const s=i==="fixed",o=pi(r),a=e?Af(e.floating):!1;if(r===o||a&&s)return n;let l={scrollLeft:0,scrollTop:0},c=si(1);const u=si(0),h=ci(r);if((h||!h&&!s)&&((fl(r)!=="body"||Mu(o))&&(l=Pf(r)),ci(r))){const p=Ro(r);c=Da(r),u.x=p.x+r.clientLeft,u.y=p.y+r.clientTop}const d=o&&!h&&!s?EA(o,l):si(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+d.x,y:n.y*c.y-l.scrollTop*c.y+u.y+d.y}}function E5(t){return Array.from(t.getClientRects())}function v5(t){const e=pi(t),n=Pf(t),r=t.ownerDocument.body,i=dn(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=dn(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+Nf(t);const a=-n.scrollTop;return Cr(r).direction==="rtl"&&(o+=dn(e.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}const qS=25;function T5(t,e){const n=Zn(t),r=pi(t),i=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;const u=wE();(!u||u&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}const c=Nf(r);if(c<=0){const u=r.ownerDocument,h=u.body,d=getComputedStyle(h),p=u.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,f=Math.abs(r.clientWidth-h.clientWidth-p);f<=qS&&(s-=f)}else c<=qS&&(s+=c);return{width:s,height:o,x:a,y:l}}const S5=new Set(["absolute","fixed"]);function w5(t,e){const n=Ro(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,s=ci(t)?Da(t):si(1),o=t.clientWidth*s.x,a=t.clientHeight*s.y,l=i*s.x,c=r*s.y;return{width:o,height:a,x:l,y:c}}function ZS(t,e,n){let r;if(e==="viewport")r=T5(t,n);else if(e==="document")r=v5(pi(t));else if(xr(e))r=w5(e,n);else{const i=bA(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return ja(r)}function vA(t,e){const n=Us(t);return n===e||!xr(n)||Va(n)?!1:Cr(n).position==="fixed"||vA(n,e)}function k5(t,e){const n=e.get(t);if(n)return n;let r=Uc(t,[],!1).filter(a=>xr(a)&&fl(a)!=="body"),i=null;const s=Cr(t).position==="fixed";let o=s?Us(t):t;for(;xr(o)&&!Va(o);){const a=Cr(o),l=SE(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&i&&S5.has(i.position)||Mu(o)&&!l&&vA(t,o))?r=r.filter(c=>c!==o):i=a,o=Us(o)}return e.set(t,r),r}function _5(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const s=[...n==="clippingAncestors"?Af(e)?[]:k5(e,this._c):[].concat(n),r],o=s[0],a=s.reduce((l,c)=>{const u=ZS(e,c,i);return l.top=dn(u.top,l.top),l.right=kr(u.right,l.right),l.bottom=kr(u.bottom,l.bottom),l.left=dn(u.left,l.left),l},ZS(e,o,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function x5(t){const{width:e,height:n}=yA(t);return{width:e,height:n}}function C5(t,e,n){const r=ci(e),i=pi(e),s=n==="fixed",o=Ro(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const l=si(0);function c(){l.x=Nf(i)}if(r||!r&&!s)if((fl(e)!=="body"||Mu(i))&&(a=Pf(e)),r){const p=Ro(e,!0,s,e);l.x=p.x+e.clientLeft,l.y=p.y+e.clientTop}else i&&c();s&&!r&&i&&c();const u=i&&!r&&!s?EA(i,a):si(0),h=o.left+a.scrollLeft-l.x-u.x,d=o.top+a.scrollTop-l.y-u.y;return{x:h,y:d,width:o.width,height:o.height}}function sg(t){return Cr(t).position==="static"}function WS(t,e){if(!ci(t)||Cr(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return pi(t)===n&&(n=n.ownerDocument.body),n}function TA(t,e){const n=Zn(t);if(Af(t))return n;if(!ci(t)){let i=Us(t);for(;i&&!Va(i);){if(xr(i)&&!sg(i))return i;i=Us(i)}return n}let r=WS(t,e);for(;r&&u5(r)&&sg(r);)r=WS(r,e);return r&&Va(r)&&sg(r)&&!SE(r)?n:r||m5(t)||n}const D5=async function(t){const e=this.getOffsetParent||TA,n=this.getDimensions,r=await n(t.floating);return{reference:C5(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function A5(t){return Cr(t).direction==="rtl"}const P5={convertOffsetParentRelativeRectToViewportRelativeRect:b5,getDocumentElement:pi,getClippingRect:_5,getOffsetParent:TA,getElementRects:D5,getClientRects:E5,getDimensions:x5,getScale:Da,isElement:xr,isRTL:A5};function SA(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function N5(t,e){let n=null,r;const i=pi(t);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const c=t.getBoundingClientRect(),{left:u,top:h,width:d,height:p}=c;if(a||e(),!d||!p)return;const f=yh(h),m=yh(i.clientWidth-(u+d)),g=yh(i.clientHeight-(h+p)),y=yh(u),b={rootMargin:-f+"px "+-m+"px "+-g+"px "+-y+"px",threshold:dn(0,kr(1,l))||1};let T=!0;function S(w){const A=w[0].intersectionRatio;if(A!==l){if(!T)return o();A?o(!1,A):r=setTimeout(()=>{o(!1,1e-7)},1e3)}A===1&&!SA(c,t.getBoundingClientRect())&&o(),T=!1}try{n=new IntersectionObserver(S,{...b,root:i.ownerDocument})}catch{n=new IntersectionObserver(S,b)}n.observe(t)}return o(!0),s}function R5(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=kE(t),u=i||s?[...c?Uc(c):[],...Uc(e)]:[];u.forEach(y=>{i&&y.addEventListener("scroll",n,{passive:!0}),s&&y.addEventListener("resize",n)});const h=c&&a?N5(c,n):null;let d=-1,p=null;o&&(p=new ResizeObserver(y=>{let[b]=y;b&&b.target===c&&p&&(p.unobserve(e),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var T;(T=p)==null||T.observe(e)})),n()}),c&&!l&&p.observe(c),p.observe(e));let f,m=l?Ro(t):null;l&&g();function g(){const y=Ro(t);m&&!SA(m,y)&&n(),m=y,f=requestAnimationFrame(g)}return n(),()=>{var y;u.forEach(b=>{i&&b.removeEventListener("scroll",n),s&&b.removeEventListener("resize",n)}),h==null||h(),(y=p)==null||y.disconnect(),p=null,l&&cancelAnimationFrame(f)}}const wA=i5,M5=K3,kA=s5,_A=J3,xA=a5,CA=e5,ny=G3,I5=n5,L5=o5,DA=(t,e,n)=>{const r=new Map,i={platform:P5,...n},s={...i.platform,_c:r};return W3(t,e,{...i,platform:s})};var Q5=typeof document<"u",$5=function(){},bd=Q5?v.useLayoutEffect:$5;function ep(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!ep(t[r],e[r]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const s=i[r];if(!(s==="_owner"&&t.$$typeof)&&!ep(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function AA(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function GS(t,e){const n=AA(t);return Math.round(e*n)/n}function og(t){const e=v.useRef(t);return bd(()=>{e.current=t}),e}function F5(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:l,open:c}=t,[u,h]=v.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[d,p]=v.useState(r);ep(d,r)||p(r);const[f,m]=v.useState(null),[g,y]=v.useState(null),b=v.useCallback(z=>{z!==A.current&&(A.current=z,m(z))},[]),T=v.useCallback(z=>{z!==C.current&&(C.current=z,y(z))},[]),S=s||f,w=o||g,A=v.useRef(null),C=v.useRef(null),N=v.useRef(u),$=l!=null,I=og(l),L=og(i),Z=og(c),B=v.useCallback(()=>{if(!A.current||!C.current)return;const z={placement:e,strategy:n,middleware:d};L.current&&(z.platform=L.current),DA(A.current,C.current,z).then(ne=>{const Oe={...ne,isPositioned:Z.current!==!1};j.current&&!ep(N.current,Oe)&&(N.current=Oe,pl.flushSync(()=>{h(Oe)}))})},[d,e,n,L,Z]);bd(()=>{c===!1&&N.current.isPositioned&&(N.current.isPositioned=!1,h(z=>({...z,isPositioned:!1})))},[c]);const j=v.useRef(!1);bd(()=>(j.current=!0,()=>{j.current=!1}),[]),bd(()=>{if(S&&(A.current=S),w&&(C.current=w),S&&w){if(I.current)return I.current(S,w,B);B()}},[S,w,B,I,$]);const U=v.useMemo(()=>({reference:A,floating:C,setReference:b,setFloating:T}),[b,T]),J=v.useMemo(()=>({reference:S,floating:w}),[S,w]),fe=v.useMemo(()=>{const z={position:n,left:0,top:0};if(!J.floating)return z;const ne=GS(J.floating,u.x),Oe=GS(J.floating,u.y);return a?{...z,transform:"translate("+ne+"px, "+Oe+"px)",...AA(J.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ne,top:Oe}},[n,a,J.floating,u.x,u.y]);return v.useMemo(()=>({...u,update:B,refs:U,elements:J,floatingStyles:fe}),[u,B,U,J,fe])}const B5=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:i}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?ny({element:r.current,padding:i}).fn(n):{}:r?ny({element:r,padding:i}).fn(n):{}}}},j5=(t,e)=>({...wA(t),options:[t,e]}),z5=(t,e)=>({...kA(t),options:[t,e]}),V5=(t,e)=>({...L5(t),options:[t,e]}),U5=(t,e)=>({..._A(t),options:[t,e]}),H5=(t,e)=>({...xA(t),options:[t,e]}),X5=(t,e)=>({...CA(t),options:[t,e]}),q5=(t,e)=>({...B5(t),options:[t,e]});var Z5="Arrow",PA=v.forwardRef((t,e)=>{const{children:n,width:r=10,height:i=5,...s}=t;return E.jsx(pt.svg,{...s,ref:e,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:E.jsx("polygon",{points:"0,0 30,0 15,10"})})});PA.displayName=Z5;var W5=PA;function G5(t){const[e,n]=v.useState(void 0);return Vs(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,a;if("borderBoxSize"in s){const l=s.borderBoxSize,c=Array.isArray(l)?l[0]:l;o=c.inlineSize,a=c.blockSize}else o=t.offsetWidth,a=t.offsetHeight;n({width:o,height:a})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var _E="Popper",[NA,ml]=Ys(_E),[Y5,RA]=NA(_E),MA=t=>{const{__scopePopper:e,children:n}=t,[r,i]=v.useState(null);return E.jsx(Y5,{scope:e,anchor:r,onAnchorChange:i,children:n})};MA.displayName=_E;var IA="PopperAnchor",LA=v.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...i}=t,s=RA(IA,n),o=v.useRef(null),a=_t(e,o),l=v.useRef(null);return v.useEffect(()=>{const c=l.current;l.current=(r==null?void 0:r.current)||o.current,c!==l.current&&s.onAnchorChange(l.current)}),r?null:E.jsx(pt.div,{...i,ref:a})});LA.displayName=IA;var xE="PopperContent",[K5,J5]=NA(xE),QA=v.forwardRef((t,e)=>{var Ge,Qr,mt,Jn,ls,bi;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:o=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:h="partial",hideWhenDetached:d=!1,updatePositionStrategy:p="optimized",onPlaced:f,...m}=t,g=RA(xE,n),[y,b]=v.useState(null),T=_t(e,so=>b(so)),[S,w]=v.useState(null),A=G5(S),C=(A==null?void 0:A.width)??0,N=(A==null?void 0:A.height)??0,$=r+(s!=="center"?"-"+s:""),I=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},L=Array.isArray(c)?c:[c],Z=L.length>0,B={padding:I,boundary:L.filter(t0),altBoundary:Z},{refs:j,floatingStyles:U,placement:J,isPositioned:fe,middlewareData:z}=F5({strategy:"fixed",placement:$,whileElementsMounted:(...so)=>R5(...so,{animationFrame:p==="always"}),elements:{reference:g.anchor},middleware:[j5({mainAxis:i+N,alignmentAxis:o}),l&&z5({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?V5():void 0,...B}),l&&U5({...B}),H5({...B,apply:({elements:so,rects:Vm,availableWidth:Um,availableHeight:Hm})=>{const{width:Xm,height:qm}=Vm.reference,oo=so.floating.style;oo.setProperty("--radix-popper-available-width",`${Um}px`),oo.setProperty("--radix-popper-available-height",`${Hm}px`),oo.setProperty("--radix-popper-anchor-width",`${Xm}px`),oo.setProperty("--radix-popper-anchor-height",`${qm}px`)}}),S&&q5({element:S,padding:a}),n0({arrowWidth:C,arrowHeight:N}),d&&X5({strategy:"referenceHidden",...B})]}),[ne,Oe]=BA(J),He=Wi(f);Vs(()=>{fe&&(He==null||He())},[fe,He]);const it=(Ge=z.arrow)==null?void 0:Ge.x,Le=(Qr=z.arrow)==null?void 0:Qr.y,Xe=((mt=z.arrow)==null?void 0:mt.centerOffset)!==0,[vt,An]=v.useState();return Vs(()=>{y&&An(window.getComputedStyle(y).zIndex)},[y]),E.jsx("div",{ref:j.setFloating,"data-radix-popper-content-wrapper":"",style:{...U,transform:fe?U.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:vt,"--radix-popper-transform-origin":[(Jn=z.transformOrigin)==null?void 0:Jn.x,(ls=z.transformOrigin)==null?void 0:ls.y].join(" "),...((bi=z.hide)==null?void 0:bi.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:E.jsx(K5,{scope:n,placedSide:ne,onArrowChange:w,arrowX:it,arrowY:Le,shouldHideArrow:Xe,children:E.jsx(pt.div,{"data-side":ne,"data-align":Oe,...m,ref:T,style:{...m.style,animation:fe?void 0:"none"}})})})});QA.displayName=xE;var $A="PopperArrow",e0={top:"bottom",right:"left",bottom:"top",left:"right"},FA=v.forwardRef(function(t,e){const{__scopePopper:n,...r}=t,i=J5($A,n),s=e0[i.placedSide];return E.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:E.jsx(W5,{...r,ref:e,style:{...r.style,display:"block"}})})});FA.displayName=$A;function t0(t){return t!==null}var n0=t=>({name:"transformOrigin",options:t,fn(e){var m,g,y;const{placement:n,rects:r,middlewareData:i}=e,s=((m=i.arrow)==null?void 0:m.centerOffset)!==0,o=s?0:t.arrowWidth,a=s?0:t.arrowHeight,[l,c]=BA(n),u={start:"0%",center:"50%",end:"100%"}[c],h=(((g=i.arrow)==null?void 0:g.x)??0)+o/2,d=(((y=i.arrow)==null?void 0:y.y)??0)+a/2;let p="",f="";return l==="bottom"?(p=s?u:`${h}px`,f=`${-a}px`):l==="top"?(p=s?u:`${h}px`,f=`${r.floating.height+a}px`):l==="right"?(p=`${-a}px`,f=s?u:`${d}px`):l==="left"&&(p=`${r.floating.width+a}px`,f=s?u:`${d}px`),{data:{x:p,y:f}}}});function BA(t){const[e,n="center"]=t.split("-");return[e,n]}var CE=MA,Rf=LA,DE=QA,AE=FA,r0="Portal",PE=v.forwardRef((t,e)=>{var a;const{container:n,...r}=t,[i,s]=v.useState(!1);Vs(()=>s(!0),[]);const o=n||i&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return o?iA.createPortal(E.jsx(pt.div,{...r,ref:e}),o):null});PE.displayName=r0;function i0(t,e){return v.useReducer((n,r)=>e[n][r]??n,t)}var fi=t=>{const{present:e,children:n}=t,r=s0(e),i=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),s=_t(r.ref,o0(i));return typeof n=="function"||r.isPresent?v.cloneElement(i,{ref:s}):null};fi.displayName="Presence";function s0(t){const[e,n]=v.useState(),r=v.useRef(null),i=v.useRef(t),s=v.useRef("none"),o=t?"mounted":"unmounted",[a,l]=i0(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const c=bh(r.current);s.current=a==="mounted"?c:"none"},[a]),Vs(()=>{const c=r.current,u=i.current;if(u!==t){const h=s.current,d=bh(c);t?l("MOUNT"):d==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&h!==d?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,l]),Vs(()=>{if(e){let c;const u=e.ownerDocument.defaultView??window,h=p=>{const f=bh(r.current).includes(CSS.escape(p.animationName));if(p.target===e&&f&&(l("ANIMATION_END"),!i.current)){const m=e.style.animationFillMode;e.style.animationFillMode="forwards",c=u.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=m)})}},d=p=>{p.target===e&&(s.current=bh(r.current))};return e.addEventListener("animationstart",d),e.addEventListener("animationcancel",h),e.addEventListener("animationend",h),()=>{u.clearTimeout(c),e.removeEventListener("animationstart",d),e.removeEventListener("animationcancel",h),e.removeEventListener("animationend",h)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:v.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function bh(t){return(t==null?void 0:t.animationName)||"none"}function o0(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var a0=sA[" useInsertionEffect ".trim().toString()]||Vs;function Iu({prop:t,defaultProp:e,onChange:n=()=>{},caller:r}){const[i,s,o]=l0({defaultProp:e,onChange:n}),a=t!==void 0,l=a?t:i;{const u=v.useRef(t!==void 0);v.useEffect(()=>{const h=u.current;h!==a&&console.warn(`${r} is changing from ${h?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. 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.`),u.current=a},[a,r])}const c=v.useCallback(u=>{var h;if(a){const d=c0(u)?u(t):u;d!==t&&((h=o.current)==null||h.call(o,d))}else s(u)},[a,t,s,o]);return[l,c]}function l0({defaultProp:t,onChange:e}){const[n,r]=v.useState(t),i=v.useRef(n),s=v.useRef(e);return a0(()=>{s.current=e},[e]),v.useEffect(()=>{var o;i.current!==n&&((o=s.current)==null||o.call(s,n),i.current=n)},[n,i]),[n,r,s]}function c0(t){return typeof t=="function"}var u0=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},aa=new WeakMap,Eh=new WeakMap,vh={},ag=0,jA=function(t){return t&&(t.host||jA(t.parentNode))},h0=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=jA(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},d0=function(t,e,n,r){var i=h0(e,Array.isArray(t)?t:[t]);vh[n]||(vh[n]=new WeakMap);var s=vh[n],o=[],a=new Set,l=new Set(i),c=function(h){!h||a.has(h)||(a.add(h),c(h.parentNode))};i.forEach(c);var u=function(h){!h||l.has(h)||Array.prototype.forEach.call(h.children,function(d){if(a.has(d))u(d);else try{var p=d.getAttribute(r),f=p!==null&&p!=="false",m=(aa.get(d)||0)+1,g=(s.get(d)||0)+1;aa.set(d,m),s.set(d,g),o.push(d),m===1&&f&&Eh.set(d,!0),g===1&&d.setAttribute(n,"true"),f||d.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",d,y)}})};return u(e),a.clear(),ag++,function(){o.forEach(function(h){var d=aa.get(h)-1,p=s.get(h)-1;aa.set(h,d),s.set(h,p),d||(Eh.has(h)||h.removeAttribute(r),Eh.delete(h)),p||h.removeAttribute(n)}),ag--,ag||(aa=new WeakMap,aa=new WeakMap,Eh=new WeakMap,vh={})}},NE=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),i=u0(t);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),d0(r,i,n,"aria-hidden")):function(){return null}},Jr=function(){return Jr=Object.assign||function(t){for(var e,n=1,r=arguments.length;n"u")return D0;var e=A0(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},N0=HA(),Aa="data-scroll-locked",R0=function(t,e,n,r){var i=t.left,s=t.top,o=t.right,a=t.gap;return n===void 0&&(n="margin"),` .`.concat(f0,` { overflow: hidden `).concat(r,`; padding-right: `).concat(a,"px ").concat(r,`; } body[`).concat(Aa,`] { overflow: hidden `).concat(r,`; overscroll-behavior: contain; `).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&` padding-left: `.concat(i,`px; padding-top: `).concat(s,`px; padding-right: `).concat(o,`px; margin-left:0; margin-top:0; margin-right: `).concat(a,"px ").concat(r,`; `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),` } .`).concat(Ed,` { right: `).concat(a,"px ").concat(r,`; } .`).concat(vd,` { margin-right: `).concat(a,"px ").concat(r,`; } .`).concat(Ed," .").concat(Ed,` { right: 0 `).concat(r,`; } .`).concat(vd," .").concat(vd,` { margin-right: 0 `).concat(r,`; } body[`).concat(Aa,`] { `).concat(m0,": ").concat(a,`px; } `)},KS=function(){var t=parseInt(document.body.getAttribute(Aa)||"0",10);return isFinite(t)?t:0},M0=function(){v.useEffect(function(){return document.body.setAttribute(Aa,(KS()+1).toString()),function(){var t=KS()-1;t<=0?document.body.removeAttribute(Aa):document.body.setAttribute(Aa,t.toString())}},[])},I0=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,i=r===void 0?"margin":r;M0();var s=v.useMemo(function(){return P0(i)},[i]);return v.createElement(N0,{styles:R0(s,!e,i,n?"":"!important")})},ry=!1;if(typeof window<"u")try{var Th=Object.defineProperty({},"passive",{get:function(){return ry=!0,!0}});window.addEventListener("test",Th,Th),window.removeEventListener("test",Th,Th)}catch{ry=!1}var la=ry?{passive:!1}:!1,L0=function(t){return t.tagName==="TEXTAREA"},XA=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!L0(t)&&n[e]==="visible")},Q0=function(t){return XA(t,"overflowY")},$0=function(t){return XA(t,"overflowX")},JS=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=qA(t,r);if(i){var s=ZA(t,r),o=s[1],a=s[2];if(o>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},F0=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},B0=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},qA=function(t,e){return t==="v"?Q0(e):$0(e)},ZA=function(t,e){return t==="v"?F0(e):B0(e)},j0=function(t,e){return t==="h"&&e==="rtl"?-1:1},z0=function(t,e,n,r,i){var s=j0(t,window.getComputedStyle(e).direction),o=s*r,a=n.target,l=e.contains(a),c=!1,u=o>0,h=0,d=0;do{if(!a)break;var p=ZA(t,a),f=p[0],m=p[1],g=p[2],y=m-g-s*f;(f||y)&&qA(t,a)&&(h+=y,d+=f);var b=a.parentNode;a=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!l&&a!==document.body||l&&(e.contains(a)||e===a));return(u&&Math.abs(h)<1||!u&&Math.abs(d)<1)&&(c=!0),c},Sh=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},ew=function(t){return[t.deltaX,t.deltaY]},tw=function(t){return t&&"current"in t?t.current:t},V0=function(t,e){return t[0]===e[0]&&t[1]===e[1]},U0=function(t){return` .block-interactivity-`.concat(t,` {pointer-events: none;} .allow-interactivity-`).concat(t,` {pointer-events: all;} `)},H0=0,ca=[];function X0(t){var e=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),i=v.useState(H0++)[0],s=v.useState(HA)[0],o=v.useRef(t);v.useEffect(function(){o.current=t},[t]),v.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var m=p0([t.lockRef.current],(t.shards||[]).map(tw)).filter(Boolean);return m.forEach(function(g){return g.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),m.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var a=v.useCallback(function(m,g){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!o.current.allowPinchZoom;var y=Sh(m),b=n.current,T="deltaX"in m?m.deltaX:b[0]-y[0],S="deltaY"in m?m.deltaY:b[1]-y[1],w,A=m.target,C=Math.abs(T)>Math.abs(S)?"h":"v";if("touches"in m&&C==="h"&&A.type==="range")return!1;var N=JS(C,A);if(!N)return!0;if(N?w=C:(w=C==="v"?"h":"v",N=JS(C,A)),!N)return!1;if(!r.current&&"changedTouches"in m&&(T||S)&&(r.current=w),!w)return!0;var $=r.current||w;return z0($,g,m,$==="h"?T:S)},[]),l=v.useCallback(function(m){var g=m;if(!(!ca.length||ca[ca.length-1]!==s)){var y="deltaY"in g?ew(g):Sh(g),b=e.current.filter(function(w){return w.name===g.type&&(w.target===g.target||g.target===w.shadowParent)&&V0(w.delta,y)})[0];if(b&&b.should){g.cancelable&&g.preventDefault();return}if(!b){var T=(o.current.shards||[]).map(tw).filter(Boolean).filter(function(w){return w.contains(g.target)}),S=T.length>0?a(g,T[0]):!o.current.noIsolation;S&&g.cancelable&&g.preventDefault()}}},[]),c=v.useCallback(function(m,g,y,b){var T={name:m,delta:g,target:y,should:b,shadowParent:q0(y)};e.current.push(T),setTimeout(function(){e.current=e.current.filter(function(S){return S!==T})},1)},[]),u=v.useCallback(function(m){n.current=Sh(m),r.current=void 0},[]),h=v.useCallback(function(m){c(m.type,ew(m),m.target,a(m,t.lockRef.current))},[]),d=v.useCallback(function(m){c(m.type,Sh(m),m.target,a(m,t.lockRef.current))},[]);v.useEffect(function(){return ca.push(s),t.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:d}),document.addEventListener("wheel",l,la),document.addEventListener("touchmove",l,la),document.addEventListener("touchstart",u,la),function(){ca=ca.filter(function(m){return m!==s}),document.removeEventListener("wheel",l,la),document.removeEventListener("touchmove",l,la),document.removeEventListener("touchstart",u,la)}},[]);var p=t.removeScrollBar,f=t.inert;return v.createElement(v.Fragment,null,f?v.createElement(s,{styles:U0(i)}):null,p?v.createElement(I0,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function q0(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const Z0=T0(UA,X0);var If=v.forwardRef(function(t,e){return v.createElement(Mf,Jr({},t,{ref:e,sideCar:Z0}))});If.classNames=Mf.classNames;var Lf="Popover",[WA]=Ys(Lf,[ml]),Lu=ml(),[W0,Yo]=WA(Lf),GA=t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:o=!1}=t,a=Lu(e),l=v.useRef(null),[c,u]=v.useState(!1),[h,d]=Iu({prop:r,defaultProp:i??!1,onChange:s,caller:Lf});return E.jsx(CE,{...a,children:E.jsx(W0,{scope:e,contentId:Is(),triggerRef:l,open:h,onOpenChange:d,onOpenToggle:v.useCallback(()=>d(p=>!p),[d]),hasCustomAnchor:c,onCustomAnchorAdd:v.useCallback(()=>u(!0),[]),onCustomAnchorRemove:v.useCallback(()=>u(!1),[]),modal:o,children:n})})};GA.displayName=Lf;var YA="PopoverAnchor",G0=v.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=Yo(YA,n),s=Lu(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:a}=i;return v.useEffect(()=>(o(),()=>a()),[o,a]),E.jsx(Rf,{...s,...r,ref:e})});G0.displayName=YA;var KA="PopoverTrigger",JA=v.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=Yo(KA,n),s=Lu(n),o=_t(e,i.triggerRef),a=E.jsx(pt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":rP(i.open),...r,ref:o,onClick:ve(t.onClick,i.onOpenToggle)});return i.hasCustomAnchor?a:E.jsx(Rf,{asChild:!0,...s,children:a})});JA.displayName=KA;var Y0="PopoverPortal",[rye,K0]=WA(Y0,{forceMount:void 0}),Ua="PopoverContent",eP=v.forwardRef((t,e)=>{const n=K0(Ua,t.__scopePopover),{forceMount:r=n.forceMount,...i}=t,s=Yo(Ua,t.__scopePopover);return E.jsx(fi,{present:r||s.open,children:s.modal?E.jsx(ej,{...i,ref:e}):E.jsx(tj,{...i,ref:e})})});eP.displayName=Ua;var J0=Ba("PopoverContent.RemoveScroll"),ej=v.forwardRef((t,e)=>{const n=Yo(Ua,t.__scopePopover),r=v.useRef(null),i=_t(e,r),s=v.useRef(!1);return v.useEffect(()=>{const o=r.current;if(o)return NE(o)},[]),E.jsx(If,{as:J0,allowPinchZoom:!0,children:E.jsx(tP,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ve(t.onCloseAutoFocus,o=>{var a;o.preventDefault(),s.current||((a=n.triggerRef.current)==null||a.focus())}),onPointerDownOutside:ve(t.onPointerDownOutside,o=>{const a=o.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,c=a.button===2||l;s.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:ve(t.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),tj=v.forwardRef((t,e)=>{const n=Yo(Ua,t.__scopePopover),r=v.useRef(!1),i=v.useRef(!1);return E.jsx(tP,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o,a;(o=t.onCloseAutoFocus)==null||o.call(t,s),s.defaultPrevented||(r.current||((a=n.triggerRef.current)==null||a.focus()),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{var a,l;(a=t.onInteractOutside)==null||a.call(t,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=s.target;(l=n.triggerRef.current)!=null&&l.contains(o)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),tP=v.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:o,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...h}=t,d=Yo(Ua,n),p=Lu(n);return yE(),E.jsx(Cf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:E.jsx(Ru,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>d.onOpenChange(!1),children:E.jsx(DE,{"data-state":rP(d.open),role:"dialog",id:d.contentId,...p,...h,ref:e,style:{...h.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)"}})})})}),nP="PopoverClose",Qf=v.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=Yo(nP,n);return E.jsx(pt.button,{type:"button",...r,ref:e,onClick:ve(t.onClick,()=>i.onOpenChange(!1))})});Qf.displayName=nP;var nj="PopoverArrow",rj=v.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=Lu(n);return E.jsx(AE,{...i,...r,ref:e})});rj.displayName=nj;function rP(t){return t?"open":"closed"}var ij=GA,sj=JA,iP=eP,oj=Qf;const aj=7,lj=5,cj=({onCreate:t})=>{const[e,n]=v.useState({cols:1,rows:1}),r=(s,o)=>sArray.from({length:lj},(s,o)=>E.jsx("div",{className:"rte-tb__row",children:Array.from({length:aj},(a,l)=>E.jsx("div",{className:bn("rte-tb__cell",r(o,l)&&"rte-tb__cell--active"),onMouseMove:()=>n({cols:l+1,rows:o+1}),onClick:()=>t==null?void 0:t(e)},`col-${l}`))},`row-${o}`)),[e]);return E.jsxs("div",{className:"rte-tb__builder",children:[E.jsx(Qf,{asChild:!0,children:E.jsx("div",{className:"rte-tb__grid",children:i})}),E.jsxs("div",{style:{textAlign:"center",marginBlock:3},children:[e.rows," x ",e.cols]})]})};function $f(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var nw={exports:{}},hg={},rw;function uj(){if(rw)return hg;rw=1;var t=Ne;function e(h,d){return h===d&&(h!==0||1/h===1/d)||h!==h&&d!==d}var n=typeof Object.is=="function"?Object.is:e,r=t.useState,i=t.useEffect,s=t.useLayoutEffect,o=t.useDebugValue;function a(h,d){var p=d(),f=r({inst:{value:p,getSnapshot:d}}),m=f[0].inst,g=f[1];return s(function(){m.value=p,m.getSnapshot=d,l(m)&&g({inst:m})},[h,p,d]),i(function(){return l(m)&&g({inst:m}),h(function(){l(m)&&g({inst:m})})},[h]),o(p),p}function l(h){var d=h.getSnapshot;h=h.value;try{var p=d();return!n(h,p)}catch{return!0}}function c(h,d){return d()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return hg.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:u,hg}var iw;function sP(){return iw||(iw=1,nw.exports=uj()),nw.exports}var oP=sP();function Kt(t){this.content=t}Kt.prototype={constructor:Kt,find:function(t){for(var e=0;e>1}};Kt.from=function(t){if(t instanceof Kt)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Kt(e)};function aP(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),s=e.child(r);if(i==s){n+=i.nodeSize;continue}if(!i.sameMarkup(s))return n;if(i.isText&&i.text!=s.text){for(let o=0;i.text[o]==s.text[o];o++)n++;return n}if(i.content.size||s.content.size){let o=aP(i.content,s.content,n+1);if(o!=null)return o}n+=i.nodeSize}}function lP(t,e,n,r){for(let i=t.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:n,b:r};let o=t.child(--i),a=e.child(--s),l=o.nodeSize;if(o==a){n-=l,r-=l;continue}if(!o.sameMarkup(a))return{a:n,b:r};if(o.isText&&o.text!=a.text){let c=0,u=Math.min(o.text.length,a.text.length);for(;ce&&r(l,i+a,s||null,o)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,e-u),Math.min(l.content.size,n-u),r,i+u)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let s="",o=!0;return this.nodesBetween(e,n,(a,l)=>{let c=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&r&&(o?o=!1:s+=r),s+=c},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),s=1);se)for(let s=0,o=0;oe&&((on)&&(a.isText?a=a.cut(Math.max(0,e-o),Math.min(a.text.length,n-o)):a=a.cut(Math.max(0,e-o-1),Math.min(a.content.size,n-o-1))),r.push(a),i+=a.nodeSize),o=l}return new X(r,i)}cutByIndex(e,n){return e==n?X.empty:e==0&&n==this.content.length?this:new X(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),s=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new X(i,s)}addToStart(e){return new X([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new X(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;nthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),s=r+i.nodeSize;if(s>=e)return s==e?wh(n+1,s):wh(n,r);r=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return X.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new X(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return X.empty;let n,r=0;for(let i=0;ithis.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(s)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;nr.type.rank-i.type.rank),n}};tt.none=[];class np extends Error{}class te{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=uP(this.content,e+this.openStart,n);return r&&new te(r,this.openStart,this.openEnd)}removeBetween(e,n){return new te(cP(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return te.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new te(X.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=e.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)i++;return new te(e,r,i)}}te.empty=new te(X.empty,0,0);function cP(t,e,n){let{index:r,offset:i}=t.findIndex(e),s=t.maybeChild(r),{index:o,offset:a}=t.findIndex(n);if(i==e||s.isText){if(a!=n&&!t.child(o).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=o)throw new RangeError("Removing non-flat range");return t.replaceChild(r,s.copy(cP(s.content,e-i-1,n-i-1)))}function uP(t,e,n,r){let{index:i,offset:s}=t.findIndex(e),o=t.maybeChild(i);if(s==e||o.isText)return r&&!r.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let a=uP(o.content,e-s-1,n,o);return a&&t.replaceChild(i,o.copy(a))}function hj(t,e,n){if(n.openStart>t.depth)throw new np("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new np("Inconsistent open depths");return hP(t,e,n,0)}function hP(t,e,n,r){let i=t.index(r),s=t.node(r);if(i==e.index(r)&&r=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function mc(t,e,n,r){let i=(e||t).node(n),s=0,o=e?e.index(n):i.childCount;t&&(s=t.index(n),t.depth>n?s++:t.textOffset&&(xo(t.nodeAfter,r),s++));for(let a=s;ai&&sy(t,e,i+1),o=r.depth>i&&sy(n,r,i+1),a=[];return mc(null,t,i,a),s&&o&&e.index(i)==n.index(i)?(dP(s,o),xo(Co(s,pP(t,e,n,r,i+1)),a)):(s&&xo(Co(s,rp(t,e,i+1)),a),mc(e,n,i,a),o&&xo(Co(o,rp(n,r,i+1)),a)),mc(r,null,i,a),new X(a)}function rp(t,e,n){let r=[];if(mc(null,t,n,r),t.depth>n){let i=sy(t,e,n+1);xo(Co(i,rp(t,e,n+1)),r)}return mc(e,null,n,r),new X(r)}function dj(t,e){let n=e.depth-t.openStart,r=e.node(n).copy(t.content);for(let i=n-1;i>=0;i--)r=e.node(i).copy(X.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}class Hc{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let s=0;s0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new ip(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,s=n;for(let o=e;;){let{index:a,offset:l}=o.content.findIndex(s),c=s-l;if(r.push(o,a,i+l),!c||(o=o.child(a),o.isText))break;s=c-1,i+=l+1}return new Hc(n,r,s)}static resolveCached(e,n){let r=sw.get(e);if(r)for(let s=0;se&&this.nodesBetween(e,n,s=>(r.isInSet(s.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),fP(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=X.empty,i=0,s=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,i,s),a=o&&o.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=i;ln.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=X.fromJSON(e,n.content),s=e.nodeType(n.type).create(n.attrs,i,r);return s.type.checkAttrs(s.attrs),s}};Ls.prototype.text=void 0;let gj=class ay extends Ls{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):fP(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new ay(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new ay(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function fP(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Mo{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new Oj(e,n);if(r.next==null)return Mo.empty;let i=mP(r);r.next&&r.err("Unexpected trailing text");let s=wj(Sj(i));return kj(s,r),s}matchType(e){for(let n=0;nc.createAndFill()));for(let c=0;c=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i{let s=i+(r.validEnd?"*":" ")+" ";for(let o=0;o"+e.indexOf(r.next[o].next);return s}).join(` `)}}Mo.empty=new Mo(!0);class Oj{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function mP(t){let e=[];do e.push(yj(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function yj(t){let e=[];do e.push(bj(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function bj(t){let e=Tj(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=Ej(t,e);else break;return e}function ow(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function Ej(t,e){let n=ow(t),r=n;return t.eat(",")&&(t.next!="}"?r=ow(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function vj(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let s in n){let o=n[s];o.isInGroup(e)&&i.push(o)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function Tj(t){if(t.eat("(")){let e=mP(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=vj(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function Sj(t){let e=[[]];return i(s(t,0),n()),e;function n(){return e.push([])-1}function r(o,a,l){let c={term:l,to:a};return e[o].push(c),c}function i(o,a){o.forEach(l=>l.to=a)}function s(o,a){if(o.type=="choice")return o.exprs.reduce((l,c)=>l.concat(s(c,a)),[]);if(o.type=="seq")for(let l=0;;l++){let c=s(o.exprs[l],a);if(l==o.exprs.length-1)return c;i(c,a=n())}else if(o.type=="star"){let l=n();return r(a,l),i(s(o.expr,l),l),[r(l)]}else if(o.type=="plus"){let l=n();return i(s(o.expr,a),l),i(s(o.expr,l),l),[r(l)]}else{if(o.type=="opt")return[r(a)].concat(s(o.expr,a));if(o.type=="range"){let l=a;for(let c=0;c{t[o].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let u=0;u{c||i.push([a,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let s=e[r.join(",")]=new Mo(r.indexOf(t.length-1)>-1);for(let o=0;o-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:yP(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Ls(this,this.computeAttrs(e),X.from(n),tt.setFrom(r))}createChecked(e=null,n,r){return n=X.from(n),this.checkContent(n),new Ls(this,this.computeAttrs(e),n,tt.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=X.from(n),n.size){let o=this.contentMatch.fillBefore(n);if(!o)return null;n=o.append(n)}let i=this.contentMatch.matchFragment(n),s=i&&i.fillBefore(X.empty,!0);return s?new Ls(this,e,n.append(s),tt.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;nr[s]=new vP(s,n,o));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let s in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function _j(t,e,n){let r=n.split("|");return i=>{let s=i===null?"null":typeof i;if(r.indexOf(s)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${s}`)}}let xj=class{constructor(t,e,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate=typeof n.validate=="string"?_j(t,e,n.validate):n.validate}get isRequired(){return!this.hasDefault}};class Ff{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=EP(e,i.attrs),this.excluded=null;let s=OP(this.attrs);this.instance=s?new tt(this,s):null}create(e=null){return!e&&this.instance?this.instance:new tt(this,yP(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((s,o)=>r[s]=new Ff(s,i++,n,o)),r}removeFromSet(e){for(var n=0;n-1}}let TP=class{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let e=this.spec={};for(let r in t)e[r]=t[r];e.nodes=Kt.from(t.nodes),e.marks=Kt.from(t.marks||{}),this.nodes=lw.compile(this.spec.nodes,this),this.marks=Ff.compile(this.spec.marks,this);let n=Object.create(null);for(let r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");let i=this.nodes[r],s=i.spec.content||"",o=i.spec.marks;if(i.contentMatch=n[s]||(n[s]=Mo.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=o=="_"?null:o?cw(this,o.split(" ")):o==""||!i.inlineContent?[]:null}for(let r in this.marks){let i=this.marks[r],s=i.spec.excludes;i.excluded=s==null?[i]:s==""?[]:cw(this,s.split(" "))}this.nodeFromJSON=r=>Ls.fromJSON(this,r),this.markFromJSON=r=>tt.fromJSON(this,r),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,e=null,n,r){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof lw){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(e,n,r)}text(t,e){let n=this.nodes.text;return new gj(n,n.defaultAttrs,t,tt.setFrom(e))}mark(t,e){return typeof t=="string"&&(t=this.marks[t]),t.create(e)}nodeType(t){let e=this.nodes[t];if(!e)throw new RangeError("Unknown node type: "+t);return e}};function cw(t,e){let n=[];for(let r=0;r-1)&&n.push(o=l)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function Cj(t){return t.tag!=null}function Dj(t){return t.style!=null}class Qs{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(Cj(i))this.tags.push(i);else if(Dj(i)){let s=/[^=]*/.exec(i.style)[0];r.indexOf(s)<0&&r.push(s),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let s=e.nodes[i.node];return s.contentMatch.matchType(s)})}parse(e,n={}){let r=new hw(this,n,!1);return r.addAll(e,tt.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new hw(this,n,!0);return r.addAll(e,tt.none,n.from,n.to),te.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;ie.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(o.getAttrs){let l=o.getAttrs(n);if(l===!1)continue;o.attrs=l||void 0}return o}}}static schemaRules(e){let n=[];function r(i){let s=i.priority==null?50:i.priority,o=0;for(;o{r(o=dw(o)),o.mark||o.ignore||o.clearMark||(o.mark=i)})}for(let i in e.nodes){let s=e.nodes[i].spec.parseDOM;s&&s.forEach(o=>{r(o=dw(o)),o.node||o.ignore||o.mark||(o.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Qs(e,Qs.schemaRules(e)))}}const SP={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Aj={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},wP={ol:!0,ul:!0},Xc=1,ly=2,gc=4;function uw(t,e,n){return e!=null?(e?Xc:0)|(e==="full"?ly:0):t&&t.whitespace=="pre"?Xc|ly:n&~gc}class kh{constructor(e,n,r,i,s,o){this.type=e,this.attrs=n,this.marks=r,this.solid=i,this.options=o,this.content=[],this.activeMarks=tt.none,this.match=s||(o&gc?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(X.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Xc)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let s=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-i[0].length))}}let n=X.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(X.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!SP.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}let hw=class{constructor(t,e,n){this.parser=t,this.options=e,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=e.topNode,i,s=uw(null,e.preserveWhitespace,0)|(n?gc:0);r?i=new kh(r.type,r.attrs,tt.none,!0,e.topMatch||r.type.contentMatch,s):n?i=new kh(null,null,tt.none,!0,null,s):i=new kh(t.schema.topNodeType,null,tt.none,!0,null,s),this.nodes=[i],this.find=e.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,e){t.nodeType==3?this.addTextNode(t,e):t.nodeType==1&&this.addElement(t,e)}addTextNode(t,e){let n=t.nodeValue,r=this.top,i=r.options&ly?"full":this.localPreserveWS||(r.options&Xc)>0,{schema:s}=this.parser;if(i==="full"||r.inlineContext(t)||/[^ \t\r\n\u000c]/.test(n)){if(i)if(i==="full")n=n.replace(/\r\n?/g,` `);else if(s.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(s.linebreakReplacement.create())){let o=n.split(/\r?\n|\r/);for(let a=0;a!a.clearMark(l)):e=e.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)o=a;else break}}return e}addElementByRule(t,e,n,r){let i,s;if(e.node)if(s=this.parser.schema.nodes[e.node],s.isLeaf)this.insertNode(s.create(e.attrs),n,t.nodeName=="BR")||this.leafFallback(t,n);else{let a=this.enter(s,e.attrs||null,n,e.preserveWhitespace);a&&(i=!0,n=a)}else{let a=this.parser.schema.marks[e.mark];n=n.concat(a.create(e.attrs))}let o=this.top;if(s&&s.isLeaf)this.findInside(t);else if(r)this.addElement(t,n,r);else if(e.getContent)this.findInside(t),e.getContent(t,this.parser.schema).forEach(a=>this.insertNode(a,n,!1));else{let a=t;typeof e.contentElement=="string"?a=t.querySelector(e.contentElement):typeof e.contentElement=="function"?a=e.contentElement(t):e.contentElement&&(a=e.contentElement),this.findAround(t,a,!0),this.addAll(a,n),this.findAround(t,a,!1)}i&&this.sync(o)&&this.open--}addAll(t,e,n,r){let i=n||0;for(let s=n?t.childNodes[n]:t.firstChild,o=r==null?null:t.childNodes[r];s!=o;s=s.nextSibling,++i)this.findAtPoint(t,i),this.addDOM(s,e);this.findAtPoint(t,i)}findPlace(t,e,n){let r,i;for(let s=this.open,o=0;s>=0;s--){let a=this.nodes[s],l=a.findWrapping(t);if(l&&(!r||r.length>l.length+o)&&(r=l,i=a,!l.length))break;if(a.solid){if(n)break;o+=2}}if(!r)return null;this.sync(i);for(let s=0;s(s.type?s.type.allowsMarkType(l.type):pw(l.type,t))?(a=l.addToSet(a),!1):!0),this.nodes.push(new kh(t,e,a,r,null,o)),this.open++,n}closeExtra(t=!1){let e=this.nodes.length-1;if(e>this.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(t){for(let e=this.open;e>=0;e--){if(this.nodes[e]==t)return this.open=e,!0;this.localPreserveWS&&(this.nodes[e].options|=Xc)}return!1}get currentPos(){this.closeExtra();let t=0;for(let e=this.open;e>=0;e--){let n=this.nodes[e].content;for(let r=n.length-1;r>=0;r--)t+=n[r].nodeSize;e&&t++}return t}findAtPoint(t,e){if(this.find)for(let n=0;n-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let e=t.split("/"),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+(r?0:1),s=(o,a)=>{for(;o>=0;o--){let l=e[o];if(l==""){if(o==e.length-1||o==0)continue;for(;a>=i;a--)if(s(o-1,a))return!0;return!1}else{let c=a>0||a==0&&r?this.nodes[a].type:n&&a>=i?n.node(a-i).type:null;if(!c||c.name!=l&&!c.isInGroup(l))return!1;a--}}return!0};return s(e.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let e=t.depth;e>=0;e--){let n=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let n=this.parser.schema.nodes[e];if(n.isTextblock&&n.defaultAttrs)return n}}};function Pj(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&wP.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function Nj(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function dw(t){let e={};for(let n in t)e[n]=t[n];return e}function pw(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let s=[],o=a=>{s.push(a);for(let l=0;l{if(s.length||o.marks.length){let a=0,l=0;for(;a=0;i--){let s=this.serializeMark(e.marks[i],e.isInline,n);s&&((s.contentDOM||s.dom).appendChild(r),r=s.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&Td(pg(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return Td(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Ks(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=fw(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return fw(e.marks)}}function fw(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function pg(t){return t.document||window.document}const mw=new WeakMap;function Rj(t){let e=mw.get(t);return e===void 0&&mw.set(t,e=Mj(t)),e}function Mj(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=i.indexOf(" ");o>0&&(n=i.slice(0,o),i=i.slice(o+1));let a,l=n?t.createElementNS(n,i):t.createElement(i),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let h in c)if(c[h]!=null){let d=h.indexOf(" ");d>0?l.setAttributeNS(h.slice(0,d),h.slice(d+1),c[h]):h=="style"&&l.style?l.style.cssText=c[h]:l.setAttribute(h,c[h])}}for(let h=u;hu)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:p,contentDOM:f}=Td(t,d,n,r);if(l.appendChild(p),f){if(a)throw new RangeError("Multiple content holes");a=f}}}return{dom:l,contentDOM:a}}const kP=65535,_P=Math.pow(2,16);function Ij(t,e){return t+e*_P}function gw(t){return t&kP}function Lj(t){return(t-(t&kP))/_P}const xP=1,CP=2,Sd=4,DP=8;class cy{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&DP)>0}get deletedBefore(){return(this.delInfo&(xP|Sd))>0}get deletedAfter(){return(this.delInfo&(CP|Sd))>0}get deletedAcross(){return(this.delInfo&Sd)>0}}class Xn{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&Xn.empty)return Xn.empty}recover(e){let n=0,r=gw(e);if(!this.inverted)for(let i=0;ie)break;let c=this.ranges[a+s],u=this.ranges[a+o],h=l+c;if(e<=h){let d=c?e==l?-1:e==h?1:n:n,p=l+i+(d<0?0:u);if(r)return p;let f=e==(n<0?l:h)?null:Ij(a/3,e-l),m=e==l?CP:e==h?xP:Sd;return(n<0?e!=l:e!=h)&&(m|=DP),new cy(p,m,f)}i+=u-c}return r?e+i:new cy(e+i,0,null)}touches(e,n){let r=0,i=gw(n),s=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;ae)break;let c=this.ranges[a+s],u=l+c;if(e<=u&&a==i*3)return!0;r+=this.ranges[a+o]-c}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,s=0;i=0;n--){let i=e.getMirror(n);this.appendMap(e._maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new qc;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;rs&&l!o.isAtom||!a.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),n.openStart,n.openEnd);return Nt.fromReplace(e,this.from,this.to,s)}invert(){return new Tr(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new xs(n.pos,r.pos,this.mark)}merge(e){return e instanceof xs&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new xs(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new xs(n.from,n.to,e.markFromJSON(n.mark))}}En.jsonID("addMark",xs);class Tr extends En{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new te(RE(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return Nt.fromReplace(e,this.from,this.to,r)}invert(){return new xs(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Tr(n.pos,r.pos,this.mark)}merge(e){return e instanceof Tr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Tr(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Tr(n.from,n.to,e.markFromJSON(n.mark))}}En.jsonID("removeMark",Tr);class Cs extends En{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Nt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Nt.fromReplace(e,this.pos,this.pos+1,new te(X.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;ir.pos?null:new Wt(n.pos,r.pos,i,s,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Wt(n.from,n.to,n.gapFrom,n.gapTo,te.fromJSON(e,n.slice),n.insert,!!n.structure)}}En.jsonID("replaceAround",Wt);function uy(t,e,n){let r=t.resolve(e),i=n-e,s=r.depth;for(;i>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,i--;if(i>0){let o=r.node(s).maybeChild(r.indexAfter(s));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}function Qj(t,e,n,r){let i=[],s=[],o,a;t.doc.nodesBetween(e,n,(l,c,u)=>{if(!l.isInline)return;let h=l.marks;if(!r.isInSet(h)&&u.type.allowsMarkType(r.type)){let d=Math.max(c,e),p=Math.min(c+l.nodeSize,n),f=r.addToSet(h);for(let m=0;mt.step(l)),s.forEach(l=>t.step(l))}function $j(t,e,n,r){let i=[],s=0;t.doc.nodesBetween(e,n,(o,a)=>{if(!o.isInline)return;s++;let l=null;if(r instanceof Ff){let c=o.marks,u;for(;u=r.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(o.marks)&&(l=[r]):l=o.marks;if(l&&l.length){let c=Math.min(a+o.nodeSize,n);for(let u=0;ut.step(new Tr(o.from,o.to,o.style)))}function ME(t,e,n,r=n.contentMatch,i=!0){let s=t.doc.nodeAt(e),o=[],a=e+1;for(let l=0;l=0;l--)t.step(o[l])}function Fj(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function gl(t){let e=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth,r=0,i=0;;--n){let s=t.$from.node(n),o=t.$from.index(n)+r,a=t.$to.indexAfter(n)-i;if(nn;f--)m||r.index(f)>0?(m=!0,u=X.from(r.node(f).copy(u)),h++):l--;let d=X.empty,p=0;for(let f=s,m=!1;f>n;f--)m||i.after(f+1)=0;o--){if(r.size){let a=n[o].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=X.from(n[o].type.create(n[o].attrs,r))}let i=e.start,s=e.end;t.step(new Wt(i,s,i,s,new te(r,0,0),n.length,!0))}function Uj(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=t.steps.length;t.doc.nodesBetween(e,n,(o,a)=>{let l=typeof i=="function"?i(o):i;if(o.isTextblock&&!o.hasMarkup(r,l)&&Hj(t.doc,t.mapping.slice(s).map(a),r)){let c=null;if(r.schema.linebreakReplacement){let p=r.whitespace=="pre",f=!!r.contentMatch.matchType(r.schema.linebreakReplacement);p&&!f?c=!1:!p&&f&&(c=!0)}c===!1&&PP(t,o,a,s),ME(t,t.mapping.slice(s).map(a,1),r,void 0,c===null);let u=t.mapping.slice(s),h=u.map(a,1),d=u.map(a+o.nodeSize,1);return t.step(new Wt(h,d,h+1,d-1,new te(X.from(r.create(l,null,o.marks)),0,0),1,!0)),c===!0&&AP(t,o,a,s),!1}})}function AP(t,e,n,r){e.forEach((i,s)=>{if(i.isText){let o,a=/\r?\n|\r/g;for(;o=a.exec(i.text);){let l=t.mapping.slice(r).map(n+1+s+o.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function PP(t,e,n,r){e.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let o=t.mapping.slice(r).map(n+1+s);t.replaceWith(o,o+1,e.type.schema.text(` `))}})}function Hj(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function Xj(t,e,n,r,i){let s=t.doc.nodeAt(e);if(!s)throw new RangeError("No node at given position");n||(n=s.type);let o=n.create(r,null,i||s.marks);if(s.isLeaf)return t.replaceWith(e,e+s.nodeSize,o);if(!n.validContent(s.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new Wt(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new te(X.from(o),0,0),1,!0))}function ji(t,e,n=1,r){let i=t.resolve(e),s=i.depth-n,o=r&&r[r.length-1]||i.parent;if(s<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,u=n-2;c>s;c--,u--){let h=i.node(c),d=i.index(c);if(h.type.spec.isolating)return!1;let p=h.content.cutByIndex(d,h.childCount),f=r&&r[u+1];f&&(p=p.replaceChild(0,f.type.create(f.attrs)));let m=r&&r[u]||h;if(!h.canReplace(d+1,h.childCount)||!m.type.validContent(p))return!1}let a=i.indexAfter(s),l=r&&r[0];return i.node(s).canReplaceWith(a,a,l?l.type:i.node(s+1).type)}function qj(t,e,n=1,r){let i=t.doc.resolve(e),s=X.empty,o=X.empty;for(let a=i.depth,l=i.depth-n,c=n-1;a>l;a--,c--){s=X.from(i.node(a).copy(s));let u=r&&r[c];o=X.from(u?u.type.create(u.attrs,o):i.node(a).copy(o))}t.step(new Xt(e,e,new te(s.append(o),n,n),!0))}function Js(t,e){let n=t.resolve(e),r=n.index();return NP(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function Zj(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let i=0;i0?(s=r.node(i+1),a++,o=r.node(i).maybeChild(a)):(s=r.node(i).maybeChild(a-1),o=r.node(i+1)),s&&!s.isTextblock&&NP(s,o)&&r.node(i).canReplace(a,a+1))return e;if(i==0)break;e=n<0?r.before(i):r.after(i)}}function Wj(t,e,n){let r=null,{linebreakReplacement:i}=t.doc.type.schema,s=t.doc.resolve(e-n),o=s.node().type;if(i&&o.inlineContent){let u=o.whitespace=="pre",h=!!o.contentMatch.matchType(i);u&&!h?r=!1:!u&&h&&(r=!0)}let a=t.steps.length;if(r===!1){let u=t.doc.resolve(e+n);PP(t,u.node(),u.before(),a)}o.inlineContent&&ME(t,e+n-1,o,s.node().contentMatchAt(s.index()),r==null);let l=t.mapping.slice(a),c=l.map(e-n);if(t.step(new Xt(c,l.map(e+n,-1),te.empty,!0)),r===!0){let u=t.doc.resolve(c);AP(t,u.node(),u.before(),t.steps.length)}return t}function Gj(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let s=r.index(i);if(r.node(i).canReplaceWith(s,s,n))return r.before(i+1);if(s>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let s=r.indexAfter(i);if(r.node(i).canReplaceWith(s,s,n))return r.after(i+1);if(s=0;o--){let a=o==r.depth?0:r.pos<=(r.start(o+1)+r.end(o+1))/2?-1:1,l=r.index(o)+(a>0?1:0),c=r.node(o),u=!1;if(s==1)u=c.canReplace(l,l,i);else{let h=c.contentMatchAt(l).findWrapping(i.firstChild.type);u=h&&c.canReplaceWith(l,l,h[0])}if(u)return a==0?r.pos:a<0?r.before(o+1):r.after(o+1)}return null}function jf(t,e,n=e,r=te.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),s=t.resolve(n);return MP(i,s,r)?new Xt(e,n,r):new Yj(i,s,r).fit()}function MP(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class Yj{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=X.empty;for(let i=0;i<=e.depth;i++){let s=e.node(i);this.frontier.push({type:s.type,match:s.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=X.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let s=this.placed,o=r.depth,a=i.depth;for(;o&&a&&s.childCount==1;)s=s.firstChild.content,o--,a--;let l=new te(s,o,a);return e>-1?new Wt(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new Xt(r.pos,i.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r1&&(i=0),s.type.spec.isolating&&i<=r){e=r;break}n=s.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let i,s=null;r?(s=mg(this.unplaced.content,r-1).firstChild,i=s.content):i=this.unplaced.content;let o=i.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:c}=this.frontier[a],u,h=null;if(n==1&&(o?c.matchType(o.type)||(h=c.fillBefore(X.from(o),!1)):s&&l.compatibleContent(s.type)))return{sliceDepth:r,frontierDepth:a,parent:s,inject:h};if(n==2&&o&&(u=c.findWrapping(o.type)))return{sliceDepth:r,frontierDepth:a,parent:s,wrap:u};if(s&&c.matchType(s.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=mg(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new te(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=mg(e,n);if(i.childCount<=1&&n>0){let s=e.size-n<=n+i.size;this.unplaced=new te(Kl(e,n-1,1),n-1,s?n-1:r)}else this.unplaced=new te(Kl(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:s}){for(;this.depth>n;)this.closeFrontierNode();if(s)for(let m=0;m1||l==0||m.content.size)&&(h=g,u.push(IP(m.mark(d.allowedMarks(m.marks)),c==1?l:0,c==a.childCount?p:-1)))}let f=c==a.childCount;f||(p=-1),this.placed=Jl(this.placed,n,X.from(u)),this.frontier[n].match=h,f&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,g=a;m1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],s=n=0;a--){let{match:l,type:c}=this.frontier[a],u=gg(e,a,c,l,!0);if(!u||u.childCount)continue e}return{depth:n,fit:o,move:s?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Jl(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let i=e.node(r),s=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,s)}return e}openFrontierNode(e,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=Jl(this.placed,this.depth,X.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(X.empty,!0);e.childCount&&(this.placed=Jl(this.placed,this.frontier.length,e))}}function Kl(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Kl(t.firstChild.content,e-1,n)))}function Jl(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Jl(t.lastChild.content,e-1,n)))}function mg(t,e){for(let n=0;n1&&(r=r.replaceChild(0,IP(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(X.empty,!0)))),t.copy(r)}function gg(t,e,n,r,i){let s=t.node(e),o=i?t.indexAfter(e):t.index(e);if(o==s.childCount&&!n.compatibleContent(s.type))return null;let a=r.fillBefore(s.content,!0,o);return a&&!Kj(n,s.content,o)?a:null}function Kj(t,e,n){for(let r=n;r0;d--,p--){let f=i.node(d).type.spec;if(f.defining||f.definingAsContext||f.isolating)break;o.indexOf(d)>-1?a=d:i.before(d)==p&&o.splice(1,0,-d)}let l=o.indexOf(a),c=[],u=r.openStart;for(let d=r.content,p=0;;p++){let f=d.firstChild;if(c.push(f),p==r.openStart)break;d=f.content}for(let d=u-1;d>=0;d--){let p=c[d],f=Jj(p.type);if(f&&!p.sameMarkup(i.node(Math.abs(a)-1)))u=d;else if(f||!p.type.isTextblock)break}for(let d=r.openStart;d>=0;d--){let p=(d+u+1)%(r.openStart+1),f=c[p];if(f)for(let m=0;m=0&&(t.replace(e,n,r),!(t.steps.length>h));d--){let p=o[d];p<0||(e=i.before(p),n=s.after(p))}}function LP(t,e,n,r,i){if(er){let s=i.contentMatchAt(0),o=s.fillBefore(t).append(t);t=o.append(s.matchFragment(o).fillBefore(X.empty,!0))}return t}function tz(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=Gj(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new te(X.from(r),0,0))}function nz(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),s=QP(r,i);for(let o=0;o0&&(l||r.node(a-1).canReplace(r.index(a-1),i.indexAfter(a-1))))return t.delete(r.before(a),i.after(a))}for(let o=1;o<=r.depth&&o<=i.depth;o++)if(e-r.start(o)==r.depth-o&&n>r.end(o)&&i.end(o)-n!=i.depth-o&&r.start(o-1)==i.start(o-1)&&r.node(o-1).canReplace(r.index(o-1),i.index(o-1)))return t.delete(r.before(o),n);t.delete(e,n)}function QP(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let s=t.start(i);if(se.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(s==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==s-1)&&n.push(i)}return n}class Pa extends En{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return Nt.fail("No node at attribute step's position");let r=Object.create(null);for(let s in n.attrs)r[s]=n.attrs[s];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return Nt.fromReplace(e,this.pos,this.pos+1,new te(X.from(i),0,n.isLeaf?0:1))}getMap(){return Xn.empty}invert(e){return new Pa(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Pa(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Pa(n.pos,n.attr,n.value)}}En.jsonID("attr",Pa);class Zc extends En{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let i in e.attrs)n[i]=e.attrs[i];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return Nt.ok(r)}getMap(){return Xn.empty}invert(e){return new Zc(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Zc(n.attr,n.value)}}En.jsonID("docAttr",Zc);let Ha=class extends Error{};Ha=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};Ha.prototype=Object.create(Error.prototype);Ha.prototype.constructor=Ha;Ha.prototype.name="TransformError";class LE{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new qc}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new Ha(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=te.empty){let i=jf(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new te(X.from(r),0,0))}delete(e,n){return this.replace(e,n,te.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return ez(this,e,n,r),this}replaceRangeWith(e,n,r){return tz(this,e,n,r),this}deleteRange(e,n){return nz(this,e,n),this}lift(e,n){return Bj(this,e,n),this}join(e,n=1){return Wj(this,e,n),this}wrap(e,n){return Vj(this,e,n),this}setBlockType(e,n=e,r,i=null){return Uj(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return Xj(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new Pa(e,n,r)),this}setDocAttribute(e,n){return this.step(new Zc(e,n)),this}addNodeMark(e,n){return this.step(new Cs(e,n)),this}removeNodeMark(e,n){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n instanceof tt)n.isInSet(r.marks)&&this.step(new Io(e,n));else{let i=r.marks,s,o=[];for(;s=n.isInSet(i);)o.push(new Io(e,s)),i=s.removeFromSet(i);for(let a=o.length-1;a>=0;a--)this.step(o[a])}return this}split(e,n=1,r){return qj(this,e,n,r),this}addMark(e,n,r){return Qj(this,e,n,r),this}removeMark(e,n,r){return $j(this,e,n,r),this}clearIncompatible(e,n,r){return ME(this,e,n,r),this}}const Og=Object.create(null);let Te=class{constructor(t,e,n){this.$anchor=t,this.$head=e,this.ranges=n||[new $P(t.min(e),t.max(e))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let e=0;e=0;i--){let s=e<0?Oa(t.node(0),t.node(i),t.before(i+1),t.index(i),e,n):Oa(t.node(0),t.node(i),t.after(i+1),t.index(i)+1,e,n);if(s)return s}return null}static near(t,e=1){return this.findFrom(t,e)||this.findFrom(t,-e)||new Wn(t.node(0))}static atStart(t){return Oa(t,t,0,0,1)||new Wn(t)}static atEnd(t){return Oa(t,t,t.content.size,t.childCount,-1)||new Wn(t)}static fromJSON(t,e){if(!e||!e.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=Og[e.type];if(!n)throw new RangeError(`No selection type ${e.type} defined`);return n.fromJSON(t,e)}static jsonID(t,e){if(t in Og)throw new RangeError("Duplicate use of selection JSON ID "+t);return Og[t]=e,e.prototype.jsonID=t,e}getBookmark(){return de.between(this.$anchor,this.$head).getBookmark()}};Te.prototype.visible=!0;let $P=class{constructor(t,e){this.$from=t,this.$to=e}},yw=!1;function bw(t){!yw&&!t.parent.inlineContent&&(yw=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class de extends Te{constructor(e,n=e){bw(e),bw(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return Te.near(r);let i=e.resolve(n.map(this.anchor));return new de(i.parent.inlineContent?i:r,r)}replace(e,n=te.empty){if(super.replace(e,n),n==te.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof de&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new zf(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new de(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let i=e.resolve(n);return new this(i,r==n?i:e.resolve(r))}static between(e,n,r){let i=e.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let s=Te.findFrom(n,r,!0)||Te.findFrom(n,-r,!0);if(s)n=s.$head;else return Te.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(Te.findFrom(e,-r,!0)||Te.findFrom(e,r,!0)).$anchor,e.pos0?0:1);i>0?o=0;o+=i){let a=e.child(o);if(a.isAtom){if(!s&&pe.isSelectable(a))return pe.create(t,n-(i<0?a.nodeSize:0))}else{let l=Oa(t,a,n+i,i<0?a.childCount:0,i,s);if(l)return l}n+=a.nodeSize*i}return null}function Ew(t,e,n){let r=t.steps.length-1;if(r{o==null&&(o=u)}),t.setSelection(Te.near(t.doc.resolve(o),n))}const vw=1,_h=2,Tw=4;let iz=class extends LE{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(t){return this.storedMarks=t,this.updated|=_h,this}ensureMarks(t){return tt.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&_h)>0}addStep(t,e){super.addStep(t,e),this.updated=this.updated&~_h,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,e=!0){let n=this.selection;return e&&(t=t.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||tt.none))),n.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,e,n){let r=this.doc.type.schema;if(e==null)return t?this.replaceSelectionWith(r.text(t),!0):this.deleteSelection();{if(n==null&&(n=e),!t)return this.deleteRange(e,n);let i=this.storedMarks;if(!i){let s=this.doc.resolve(e);i=n==e?s.marks():s.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(e,n,r.text(t,i)),!this.selection.empty&&this.selection.to==e+t.length&&this.setSelection(Te.near(this.selection.$to)),this}}setMeta(t,e){return this.meta[typeof t=="string"?t:t.key]=e,this}getMeta(t){return this.meta[typeof t=="string"?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=Tw,this}get scrolledIntoView(){return(this.updated&Tw)>0}};function Sw(t,e){return!e||!t?t:t.bind(e)}class ec{constructor(e,n,r){this.name=e,this.init=Sw(n.init,r),this.apply=Sw(n.apply,r)}}const sz=[new ec("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new ec("selection",{init(t,e){return t.selection||Te.atStart(e.doc)},apply(t){return t.selection}}),new ec("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new ec("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];let yg=class{constructor(t,e){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=sz.slice(),e&&e.forEach(n=>{if(this.pluginsByKey[n.key])throw new RangeError("Adding different instances of a keyed plugin ("+n.key+")");this.plugins.push(n),this.pluginsByKey[n.key]=n,n.spec.state&&this.fields.push(new ec(n.key,n.spec.state,n))})}},oz=class tc{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;rr.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],s=i.spec.state;s&&s.toJSON&&(n[r]=s.toJSON.call(i,this[i.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new yg(e.schema,e.plugins),s=new tc(i);return i.fields.forEach(o=>{if(o.name=="doc")s.doc=Ls.fromJSON(e.schema,n.doc);else if(o.name=="selection")s.selection=Te.fromJSON(s.doc,n.selection);else if(o.name=="storedMarks")n.storedMarks&&(s.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],c=l.spec.state;if(l.key==o.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){s[o.name]=c.fromJSON.call(l,e,n[a],s);return}}s[o.name]=o.init(e,s)}}),s}};function FP(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=FP(i,e,{})),n[r]=i}return n}class ze{constructor(e){this.spec=e,this.props={},e.props&&FP(e.props,this,this.props),this.key=e.key?e.key.key:BP("plugin")}getState(e){return e[this.key]}}const bg=Object.create(null);function BP(t){return t in bg?t+"$"+ ++bg[t]:(bg[t]=0,t+"$")}class rt{constructor(e="key"){this.key=BP(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const $E=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function jP(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const zP=(t,e,n)=>{let r=jP(t,n);if(!r)return!1;let i=FE(r);if(!i){let o=r.blockRange(),a=o&&gl(o);return a==null?!1:(e&&e(t.tr.lift(o,a).scrollIntoView()),!0)}let s=i.nodeBefore;if(YP(t,i,e,-1))return!0;if(r.parent.content.size==0&&(Xa(s,"end")||pe.isSelectable(s)))for(let o=r.depth;;o--){let a=jf(t.doc,r.before(o),r.after(o),te.empty);if(a&&a.slice.size1)break}return s.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos-s.nodeSize,i.pos).scrollIntoView()),!0):!1},az=(t,e,n)=>{let r=jP(t,n);if(!r)return!1;let i=FE(r);return i?VP(t,i,e):!1},lz=(t,e,n)=>{let r=HP(t,n);if(!r)return!1;let i=BE(r);return i?VP(t,i,e):!1};function VP(t,e,n){let r=e.nodeBefore,i=r,s=e.pos-1;for(;!i.isTextblock;s--){if(i.type.spec.isolating)return!1;let u=i.lastChild;if(!u)return!1;i=u}let o=e.nodeAfter,a=o,l=e.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let u=a.firstChild;if(!u)return!1;a=u}let c=jf(t.doc,s,l,te.empty);if(!c||c.from!=s||c instanceof Xt&&c.slice.size>=l-s)return!1;if(n){let u=t.tr.step(c);u.setSelection(de.create(u.doc,s)),n(u.scrollIntoView())}return!0}function Xa(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const UP=(t,e,n)=>{let{$head:r,empty:i}=t.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;s=FE(r)}let o=s&&s.nodeBefore;return!o||!pe.isSelectable(o)?!1:(e&&e(t.tr.setSelection(pe.create(t.doc,s.pos-o.nodeSize)).scrollIntoView()),!0)};function FE(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function HP(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset{let r=HP(t,n);if(!r)return!1;let i=BE(r);if(!i)return!1;let s=i.nodeAfter;if(YP(t,i,e,1))return!0;if(r.parent.content.size==0&&(Xa(s,"start")||pe.isSelectable(s))){let o=jf(t.doc,r.before(),r.after(),te.empty);if(o&&o.slice.size{let{$head:r,empty:i}=t.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset=0;e--){let n=t.node(e);if(t.index(e)+1{let n=t.selection,r=n instanceof pe,i;if(r){if(n.node.isTextblock||!Js(t.doc,n.from))return!1;i=n.from}else if(i=Bf(t.doc,n.from,-1),i==null)return!1;if(e){let s=t.tr.join(i);r&&s.setSelection(pe.create(s.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(s.scrollIntoView())}return!0},uz=(t,e)=>{let n=t.selection,r;if(n instanceof pe){if(n.node.isTextblock||!Js(t.doc,n.to))return!1;r=n.to}else if(r=Bf(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},hz=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),s=i&&gl(i);return s==null?!1:(e&&e(t.tr.lift(i,s).scrollIntoView()),!0)},ZP=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(` `).scrollIntoView()),!0)};function jE(t){for(let e=0;e{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),s=n.indexAfter(-1),o=jE(i.contentMatchAt(s));if(!o||!i.canReplaceWith(s,s,o))return!1;if(e){let a=n.after(),l=t.tr.replaceWith(a,a,o.createAndFill());l.setSelection(Te.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},WP=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof Wn||r.parent.inlineContent||i.parent.inlineContent)return!1;let s=jE(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let o=(!r.parentOffset&&i.index(){let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let s=n.before();if(ji(t.doc,s))return e&&e(t.tr.split(s).scrollIntoView()),!0}let r=n.blockRange(),i=r&&gl(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)};function pz(t){return(e,n)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof pe&&e.selection.node.isBlock)return!r.parentOffset||!ji(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let s=[],o,a,l=!1,c=!1;for(let p=r.depth;;p--)if(r.node(p).isBlock){l=r.end(p)==r.pos+(r.depth-p),c=r.start(p)==r.pos-(r.depth-p),a=jE(r.node(p-1).contentMatchAt(r.indexAfter(p-1))),s.unshift(l&&a?{type:a}:null),o=p;break}else{if(p==1)return!1;s.unshift(null)}let u=e.tr;(e.selection instanceof de||e.selection instanceof Wn)&&u.deleteSelection();let h=u.mapping.map(r.pos),d=ji(u.doc,h,s.length,s);if(d||(s[0]=a?{type:a}:null,d=ji(u.doc,h,s.length,s)),!d)return!1;if(u.split(h,s.length,s),!l&&c&&r.node(o).type!=a){let p=u.mapping.map(r.before(o)),f=u.doc.resolve(p);a&&r.node(o-1).canReplaceWith(f.index(),f.index()+1,a)&&u.setNodeMarkup(u.mapping.map(r.before(o)),a)}return n&&n(u.scrollIntoView()),!0}}const fz=pz(),mz=(t,e)=>{let{$from:n,to:r}=t.selection,i,s=n.sharedDepth(r);return s==0?!1:(i=n.before(s),e&&e(t.tr.setSelection(pe.create(t.doc,i))),!0)};function gz(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,s=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(s-1,s)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(s,s+1)||!(i.isTextblock||Js(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function YP(t,e,n,r){let i=e.nodeBefore,s=e.nodeAfter,o,a,l=i.type.spec.isolating||s.type.spec.isolating;if(!l&&gz(t,e,n))return!0;let c=!l&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(o=(a=i.contentMatchAt(i.childCount)).findWrapping(s.type))&&a.matchType(o[0]||s.type).validEnd){if(n){let p=e.pos+s.nodeSize,f=X.empty;for(let y=o.length-1;y>=0;y--)f=X.from(o[y].create(null,f));f=X.from(i.copy(f));let m=t.tr.step(new Wt(e.pos-1,p,e.pos,p,new te(f,1,0),o.length,!0)),g=m.doc.resolve(p+2*o.length);g.nodeAfter&&g.nodeAfter.type==i.type&&Js(m.doc,g.pos)&&m.join(g.pos),n(m.scrollIntoView())}return!0}let u=s.type.spec.isolating||r>0&&l?null:Te.findFrom(e,1),h=u&&u.$from.blockRange(u.$to),d=h&&gl(h);if(d!=null&&d>=e.depth)return n&&n(t.tr.lift(h,d).scrollIntoView()),!0;if(c&&Xa(s,"start",!0)&&Xa(i,"end")){let p=i,f=[];for(;f.push(p),!p.isTextblock;)p=p.lastChild;let m=s,g=1;for(;!m.isTextblock;m=m.firstChild)g++;if(p.canReplace(p.childCount,p.childCount,m.content)){if(n){let y=X.empty;for(let T=f.length-1;T>=0;T--)y=X.from(f[T].copy(y));let b=t.tr.step(new Wt(e.pos-f.length,e.pos+s.nodeSize,e.pos+g,e.pos+s.nodeSize-g,new te(y,f.length,0),0,!0));n(b.scrollIntoView())}return!0}}return!1}function KP(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return i.node(s).isTextblock?(n&&n(e.tr.setSelection(de.create(e.doc,t<0?i.start(s):i.end(s)))),!0):!1}}const Oz=KP(-1),yz=KP(1);function bz(t,e=null){return function(n,r){let{$from:i,$to:s}=n.selection,o=i.blockRange(s),a=o&&IE(o,t,e);return a?(r&&r(n.tr.wrap(o,a).scrollIntoView()),!0):!1}}function ww(t,e=null){return function(n,r){let i=!1;for(let s=0;s{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)i=!0;else{let u=n.doc.resolve(c),h=u.index();i=u.parent.canReplaceWith(h,h+1,t)}})}if(!i)return!1;if(r){let s=n.tr;for(let o=0;o=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let l=o.resolve(e.start-2);s=new ip(l,l,e.depth),e.endIndex=0;u--)s=X.from(n[u].type.create(n[u].attrs,s));t.step(new Wt(e.start-(r?2:0),e.end,e.start,e.end,new te(s,0,0),n.length,!0));let o=0;for(let u=0;uo.childCount>0&&o.firstChild.type==t);return s?n?r.node(s.depth-1).type==t?wz(e,n,t,s):kz(e,n,s):!0:!1}}function wz(t,e,n,r){let i=t.tr,s=r.end,o=r.$to.end(r.depth);sm;f--)p-=i.child(f).nodeSize,r.delete(p-1,p+1);let s=r.doc.resolve(n.start),o=s.nodeAfter;if(r.mapping.map(n.end)!=n.start+s.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==i.childCount,c=s.node(-1),u=s.index(-1);if(!c.canReplace(u+(a?0:1),u+1,o.content.append(l?X.empty:X.from(i))))return!1;let h=s.pos,d=h+o.nodeSize;return r.step(new Wt(h-(a?1:0),d+(l?1:0),h+1,d-1,new te((a?X.empty:X.from(i.copy(X.empty))).append(l?X.empty:X.from(i.copy(X.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}function _z(t){return function(e,n){let{$from:r,$to:i}=e.selection,s=r.blockRange(i,c=>c.childCount>0&&c.firstChild.type==t);if(!s)return!1;let o=s.startIndex;if(o==0)return!1;let a=s.parent,l=a.child(o-1);if(l.type!=t)return!1;if(n){let c=l.lastChild&&l.lastChild.type==a.type,u=X.from(c?t.create():null),h=new te(X.from(t.create(null,X.from(a.type.create(null,u)))),c?3:1,0),d=s.start,p=s.end;n(e.tr.step(new Wt(d-(c?3:1),p,d,p,h,1,!0)).scrollIntoView())}return!0}}const en=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},qa=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let hy=null;const Ai=function(t,e,n){let r=hy||(hy=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},xz=function(){hy=null},Lo=function(t,e,n,r){return n&&(kw(t,e,n,r,-1)||kw(t,e,n,r,1))},Cz=/^(img|br|input|textarea|hr)$/i;function kw(t,e,n,r,i){for(var s;;){if(t==n&&e==r)return!0;if(e==(i<0?0:lr(t))){let o=t.parentNode;if(!o||o.nodeType!=1||Qu(t)||Cz.test(t.nodeName)||t.contentEditable=="false")return!1;e=en(t)+(i<0?0:1),t=o}else if(t.nodeType==1){let o=t.childNodes[e+(i<0?-1:0)];if(o.nodeType==1&&o.contentEditable=="false")if(!((s=o.pmViewDesc)===null||s===void 0)&&s.ignoreForSelection)e+=i;else return!1;else t=o,e=i<0?lr(t):0}else return!1}}function lr(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Dz(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=lr(t)}else if(t.parentNode&&!Qu(t))e=en(t),t=t.parentNode;else return null}}function Az(t,e){for(;;){if(t.nodeType==3&&e2),ir=Za||(ui?/Mac/.test(ui.platform):!1),Mz=ui?/Win/.test(ui.platform):!1,Qi=/Android \d/.test(eo),$u=!!_w&&"webkitFontSmoothing"in _w.documentElement.style,Iz=$u?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Lz(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Ti(t,e){return typeof t=="number"?t:t[e]}function Qz(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function xw(t,e,n){let r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,s=t.dom.ownerDocument;for(let o=n||t.dom;o;){if(o.nodeType!=1){o=qa(o);continue}let a=o,l=a==s.body,c=l?Lz(s):Qz(a),u=0,h=0;if(e.topc.bottom-Ti(r,"bottom")&&(h=e.bottom-e.top>c.bottom-c.top?e.top+Ti(i,"top")-c.top:e.bottom-c.bottom+Ti(i,"bottom")),e.leftc.right-Ti(r,"right")&&(u=e.right-c.right+Ti(i,"right")),u||h)if(l)s.defaultView.scrollBy(u,h);else{let p=a.scrollLeft,f=a.scrollTop;h&&(a.scrollTop+=h),u&&(a.scrollLeft+=u);let m=a.scrollLeft-p,g=a.scrollTop-f;e={left:e.left-m,top:e.top-g,right:e.right-m,bottom:e.bottom-g}}let d=l?"fixed":getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(d))break;o=d=="absolute"?o.offsetParent:qa(o)}}function $z(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,i;for(let s=(e.left+e.right)/2,o=n+1;o=n-20){r=a,i=l.top;break}}return{refDOM:r,refTop:i,stack:tN(t.dom)}}function tN(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=qa(r));return e}function Fz({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;nN(n,r==0?0:r-e)}function nN(t,e){for(let n=0;n=a){o=Math.max(f.bottom,o),a=Math.min(f.top,a);let m=f.left>e.left?f.left-e.left:f.right=(f.left+f.right)/2?1:0));continue}}else f.top>e.top&&!l&&f.left<=e.left&&f.right>=e.left&&(l=u,c={left:Math.max(f.left,Math.min(f.right,e.left)),top:f.top});!n&&(e.left>=f.right&&e.top>=f.top||e.left>=f.left&&e.top>=f.bottom)&&(s=h+1)}}return!n&&l&&(n=l,i=c,r=0),n&&n.nodeType==3?jz(n,i):!n||r&&n.nodeType==1?{node:t,offset:s}:rN(n,i)}function jz(t,e){let n=t.nodeValue.length,r=document.createRange();for(let i=0;i=(s.left+s.right)/2?1:0)}}return{node:t,offset:0}}function VE(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function zz(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left(o.left+o.right)/2?1:-1}return t.docView.posFromDOM(r,i,s)}function Uz(t,e,n,r){let i=-1;for(let s=e,o=!1;s!=t.dom;){let a=t.docView.nearestDesc(s,!0),l;if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((l=a.dom.getBoundingClientRect()).width||l.height)&&(a.node.isBlock&&a.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(a.dom.nodeName)&&(!o&&l.left>r.left||l.top>r.top?i=a.posBefore:(!o&&l.right-1?i:t.docView.posFromDOM(e,n,-1)}function iN(t,e,n){let r=t.childNodes.length;if(r&&n.tope.top&&i++}let c;$u&&i&&r.nodeType==1&&(c=r.childNodes[i-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&i--,r==t.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(a=Uz(t,r,i,e))}a==null&&(a=Vz(t,o,e));let l=t.docView.nearestDesc(o,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function Cw(t){return t.top=0&&i==r.nodeValue.length?(a--,c=1):n<0?a--:l++,Rl(ms(Ai(r,a,l),c),c<0)}if(!t.state.doc.resolve(e-(s||0)).parent.inlineContent){if(s==null&&i&&(n<0||i==lr(r))){let a=r.childNodes[i-1];if(a.nodeType==1)return Eg(a.getBoundingClientRect(),!1)}if(s==null&&i=0)}if(s==null&&i&&(n<0||i==lr(r))){let a=r.childNodes[i-1],l=a.nodeType==3?Ai(a,lr(a)-(o?0:1)):a.nodeType==1&&(a.nodeName!="BR"||!a.nextSibling)?a:null;if(l)return Rl(ms(l,1),!1)}if(s==null&&i=0)}function Rl(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function Eg(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function oN(t,e,n){let r=t.state,i=t.root.activeElement;r!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),i!=t.dom&&i&&i.focus()}}function qz(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return oN(t,e,()=>{let{node:s}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(s,!0);if(!a)break;if(a.node.isBlock){s=a.contentDOM||a.dom;break}s=a.dom.parentNode}let o=sN(t,i.pos,1);for(let a=s.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=Ai(a,0,a.nodeValue.length).getClientRects();else continue;for(let c=0;cu.top+1&&(n=="up"?o.top-u.top>(u.bottom-o.top)*2:u.bottom-o.bottom>(o.bottom-u.top)*2))return!1}}return!0})}const Zz=/[\u0590-\u08ac]/;function Wz(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,s=!i,o=i==r.parent.content.size,a=t.domSelection();return a?!Zz.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?s:o:oN(t,e,()=>{let{focusNode:l,focusOffset:c,anchorNode:u,anchorOffset:h}=t.domSelectionRange(),d=a.caretBidiLevel;a.modify("move",n,"character");let p=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:f,focusOffset:m}=t.domSelectionRange(),g=f&&!p.contains(f.nodeType==1?f:f.parentNode)||l==f&&c==m;try{a.collapse(u,h),l&&(l!=u||c!=h)&&a.extend&&a.extend(l,c)}catch{}return d!=null&&(a.caretBidiLevel=d),g}):r.pos==r.start()||r.pos==r.end()}let Dw=null,Aw=null,Pw=!1;function Gz(t,e,n){return Dw==e&&Aw==n?Pw:(Dw=e,Aw=n,Pw=n=="up"||n=="down"?qz(t,e,n):Wz(t,e,n))}const dr=0,Nw=1,vo=2,hi=3;class Fu{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=dr,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;nen(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!1;break}if(s.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!0;break}if(s.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,i=e;i;i=i.parentNode){let s=this.getDesc(i),o;if(s&&(!n||s.node))if(r&&(o=s.nodeDOM)&&!(o.nodeType==1?o.contains(e.nodeType==1?e:e.parentNode):o==e))r=!1;else return s}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let i=e;i;i=i.parentNode){let s=this.getDesc(i);if(s)return s.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;ne||o instanceof lN){i=e-s;break}s=a}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let s;r&&!(s=this.children[r-1]).size&&s instanceof aN&&s.side>=0;r--);if(n<=0){let s,o=!0;for(;s=r?this.children[r-1]:null,!(!s||s.dom.parentNode==this.contentDOM);r--,o=!1);return s&&n&&o&&!s.border&&!s.domAtom?s.domFromPos(s.size,n):{node:this.contentDOM,offset:s?en(s.dom)+1:0}}else{let s,o=!0;for(;s=r=u&&n<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,n,u);e=o;for(let h=a;h>0;h--){let d=this.children[h-1];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(1)){i=en(d.dom)+1;break}e-=d.size}i==-1&&(i=0)}if(i>-1&&(c>n||a==this.children.length-1)){n=c;for(let u=a+1;uf&&on){let f=a;a=l,l=f}let p=document.createRange();p.setEnd(l.node,l.offset),p.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(p)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,i=0;i=r:er){let a=r+s.border,l=o-s.border;if(e>=a&&n<=l){this.dirty=e==r||n==o?vo:Nw,e==a&&n==l&&(s.contentLost||s.dom.parentNode!=this.contentDOM)?s.dirty=hi:s.markDirty(e-a,n-a);return}else s.dirty=s.dom==s.contentDOM&&s.dom.parentNode==this.contentDOM&&!s.children.length?vo:hi}r=o}this.dirty=vo}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?vo:Nw;n.dirty{if(!s)return i;if(s.parent)return s.parent.posBeforeChild(s)})),!n.type.spec.raw){if(o.nodeType!=1){let a=document.createElement("span");a.appendChild(o),o=a}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=n,this.widget=n,s=this}matchesWidget(e){return this.dirty==dr&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class Yz extends Fu{constructor(e,n,r,i){super(e,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class Qo extends Fu{constructor(e,n,r,i,s){super(e,[],r,i),this.mark=n,this.spec=s}static create(e,n,r,i){let s=i.nodeViews[n.type.name],o=s&&s(n,i,r);return(!o||!o.dom)&&(o=Ks.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new Qo(e,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&hi||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=hi&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=dr){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty0&&(s=gy(s,0,e,r));for(let a=0;a{if(!l)return o;if(l.parent)return l.parent.posBeforeChild(l)},r,i),u=c&&c.dom,h=c&&c.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:h}=Ks.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!h&&!n.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),n.type.spec.draggable&&(u.draggable=!0));let d=u;return u=hN(u,r,n),c?l=new Kz(e,n,r,i,u,h||null,d,c,s,o+1):n.isText?new Uf(e,n,r,i,u,d,s):new Fs(e,n,r,i,u,h||null,d,s,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>X.empty)}return e}matchesNode(e,n,r){return this.dirty==dr&&e.eq(this.node)&&sp(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,i=n,s=e.composing?this.localCompositionInfo(e,n):null,o=s&&s.pos>-1?s:null,a=s&&s.pos<0,l=new eV(this,o&&o.node,e);rV(this.node,this.innerDeco,(c,u,h)=>{c.spec.marks?l.syncToMarks(c.spec.marks,r,e):c.type.side>=0&&!h&&l.syncToMarks(u==this.node.childCount?tt.none:this.node.child(u).marks,r,e),l.placeWidget(c,e,i)},(c,u,h,d)=>{l.syncToMarks(c.marks,r,e);let p;l.findNodeMatch(c,u,h,d)||a&&e.state.selection.from>i&&e.state.selection.to-1&&l.updateNodeAt(c,u,h,p,e)||l.updateNextNode(c,u,h,e,d,i)||l.addNode(c,u,h,e,i),i+=c.nodeSize}),l.syncToMarks([],r,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==vo)&&(o&&this.protectLocalComposition(e,o),cN(this.contentDOM,this.children,e),Za&&iV(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof de)||rn+this.node.content.size)return null;let s=e.input.compositionNode;if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let o=s.nodeValue,a=sV(this.node.content,o,r-n,i-n);return a<0?null:{node:s,pos:a,text:o}}else return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let s=n;for(;s.parentNode!=this.contentDOM;s=s.parentNode){for(;s.previousSibling;)s.parentNode.removeChild(s.previousSibling);for(;s.nextSibling;)s.parentNode.removeChild(s.nextSibling);s.pmViewDesc&&(s.pmViewDesc=void 0)}let o=new Yz(this,s,n,i);e.input.compositionNodes.push(o),this.children=gy(this.children,r,r+i.length,e,o)}update(e,n,r,i){return this.dirty==hi||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,i),!0)}updateInner(e,n,r,i){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=dr}updateOuterDeco(e){if(sp(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=uN(this.dom,this.nodeDOM,my(this.outerDeco,this.node,n),my(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function Rw(t,e,n,r,i){hN(r,e,t);let s=new Fs(void 0,t,e,n,r,r,r,i,0);return s.contentDOM&&s.updateChildren(i,0),s}class Uf extends Fs{constructor(e,n,r,i,s,o,a){super(e,n,r,i,s,null,o,a,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,i){return this.dirty==hi||this.dirty!=dr&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=dr||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=dr,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let i=this.node.cut(e,n),s=document.createTextNode(i.text);return new Uf(this.parent,i,this.outerDeco,this.innerDeco,s,s,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=hi)}get domAtom(){return!1}isText(e){return this.node.text==e}}class lN extends Fu{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==dr&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class Kz extends Fs{constructor(e,n,r,i,s,o,a,l,c,u){super(e,n,r,i,s,o,a,c,u),this.spec=l}update(e,n,r,i){if(this.dirty==hi)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let s=this.spec.update(e,n,r);return s&&this.updateInner(e,n,r,i),s}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,i){this.spec.setSelection?this.spec.setSelection(e,n,r.root):super.setSelection(e,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function cN(t,e,n){let r=t.firstChild,i=!1;for(let s=0;s>1,o=Math.min(s,e.length);for(;i-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=Qo.create(this.top,e[s],n,r);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,s++}}findNodeMatch(e,n,r,i){let s=-1,o;if(i>=this.preMatch.index&&(o=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&o.matchesNode(e,n,r))s=this.top.children.indexOf(o,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a0;){let a;for(;;)if(r){let c=n.children[r-1];if(c instanceof Qo)n=c,r=c.children.length;else{a=c,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=t.child(i-1))break;--i,s.set(a,i),o.push(a)}}return{index:i,matched:s,matches:o.reverse()}}function nV(t,e){return t.type.side-e.type.side}function rV(t,e,n,r){let i=e.locals(t),s=0;if(i.length==0){for(let c=0;cs;)a.push(i[o++]);let f=s+d.nodeSize;if(d.isText){let g=f;o!g.inline):a.slice();r(d,m,e.forChild(s,d),p),s=f}}function iV(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function sV(t,e,n,r){for(let i=0,s=0;i=n){if(s>=r&&l.slice(r-e.length-a,r-a)==e)return r-e.length;let c=a=0&&c+e.length+a>=n)return a+c;if(n==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}function gy(t,e,n,r,i){let s=[];for(let o=0,a=0;o=n||u<=e?s.push(l):(cn&&s.push(l.slice(n-c,l.size,r)))}return s}function UE(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),s=i&&i.size==0,o=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let a=r.resolve(o),l,c;if(Vf(n)){for(l=o;i&&!i.node;)i=i.parent;let h=i.node;if(i&&h.isAtom&&pe.isSelectable(h)&&i.parent&&!(h.isInline&&Pz(n.focusNode,n.focusOffset,i.dom))){let d=i.posBefore;c=new pe(o==d?a:r.resolve(d))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let h=o,d=o;for(let p=0;p{(n.anchorNode!=r||n.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!dN(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function aV(t){let e=t.domSelection();if(!e)return;let n=t.cursorWrapper.dom,r=n.nodeName=="IMG";r?e.collapse(n.parentNode,en(n)+1):e.collapse(n,0),!r&&!t.state.selection.visible&&Ln&&$s<=11&&(n.disabled=!0,n.disabled=!1)}function pN(t,e){if(e instanceof pe){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&($w(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else $w(t)}function $w(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function HE(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||de.between(e,n,r)}function Fw(t){return t.editable&&!t.hasFocus()?!1:fN(t)}function fN(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function lV(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return Lo(e.node,e.offset,n.anchorNode,n.anchorOffset)}function Oy(t,e){let{$anchor:n,$head:r}=t.selection,i=e>0?n.max(r):n.min(r),s=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return s&&Te.findFrom(s,e)}function ys(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function Bw(t,e,n){let r=t.state.selection;if(r instanceof de)if(n.indexOf("s")>-1){let{$head:i}=r,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;let o=t.state.doc.resolve(i.pos+s.nodeSize*(e<0?-1:1));return ys(t,new de(r.$anchor,o))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=Oy(t.state,e);return i&&i instanceof pe?ys(t,i):!1}else if(!(ir&&n.indexOf("m")>-1)){let i=r.$head,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,o;if(!s||s.isText)return!1;let a=e<0?i.pos-s.nodeSize:i.pos;return s.isAtom||(o=t.docView.descAt(a))&&!o.contentDOM?pe.isSelectable(s)?ys(t,new pe(e<0?t.state.doc.resolve(i.pos-s.nodeSize):i)):$u?ys(t,new de(t.state.doc.resolve(e<0?a:a+s.nodeSize))):!1:!1}}else return!1;else{if(r instanceof pe&&r.node.isInline)return ys(t,new de(e>0?r.$to:r.$from));{let i=Oy(t.state,e);return i?ys(t,i):!1}}}function op(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function yc(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function ha(t,e){return e<0?cV(t):uV(t)}function cV(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,s,o=!1;for(hr&&n.nodeType==1&&r0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(yc(a,-1))i=n,s=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(mN(n))break;{let a=n.previousSibling;for(;a&&yc(a,-1);)i=n.parentNode,s=en(a),a=a.previousSibling;if(a)n=a,r=op(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}o?yy(t,n,r):i&&yy(t,i,s)}function uV(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=op(n),s,o;for(;;)if(r{t.state==i&&zi(t)},50)}function jw(t,e){let n=t.state.doc.resolve(e);if(!(gn||Mz)&&n.parent.inlineContent){let r=t.coordsAtPos(e);if(e>n.start()){let i=t.coordsAtPos(e-1),s=(i.top+i.bottom)/2;if(s>r.top&&s1)return i.leftr.top&&s1)return i.left>r.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function zw(t,e,n){let r=t.state.selection;if(r instanceof de&&!r.empty||n.indexOf("s")>-1||ir&&n.indexOf("m")>-1)return!1;let{$from:i,$to:s}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let o=Oy(t.state,e);if(o&&o instanceof pe)return ys(t,o)}if(!i.parent.inlineContent){let o=e<0?i:s,a=r instanceof Wn?Te.near(o,e):Te.findFrom(o,e);return a?ys(t,a):!1}return!1}function Vw(t,e){if(!(t.state.selection instanceof de))return!0;let{$head:n,$anchor:r,empty:i}=t.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let s=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(s&&!s.isText){let o=t.state.tr;return e<0?o.delete(n.pos-s.nodeSize,n.pos):o.delete(n.pos,n.pos+s.nodeSize),t.dispatch(o),!0}return!1}function Uw(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function pV(t){if(!_n||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;Uw(t,r,"true"),setTimeout(()=>Uw(t,r,"false"),20)}return!1}function fV(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function mV(t,e){let n=e.keyCode,r=fV(e);if(n==8||ir&&n==72&&r=="c")return Vw(t,-1)||ha(t,-1);if(n==46&&!e.shiftKey||ir&&n==68&&r=="c")return Vw(t,1)||ha(t,1);if(n==13||n==27)return!0;if(n==37||ir&&n==66&&r=="c"){let i=n==37?jw(t,t.state.selection.from)=="ltr"?-1:1:-1;return Bw(t,i,r)||ha(t,i)}else if(n==39||ir&&n==70&&r=="c"){let i=n==39?jw(t,t.state.selection.from)=="ltr"?1:-1:1;return Bw(t,i,r)||ha(t,i)}else{if(n==38||ir&&n==80&&r=="c")return zw(t,-1,r)||ha(t,-1);if(n==40||ir&&n==78&&r=="c")return pV(t)||zw(t,1,r)||ha(t,1);if(r==(ir?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function XE(t,e){t.someProp("transformCopied",p=>{e=p(e,t)});let n=[],{content:r,openStart:i,openEnd:s}=e;for(;i>1&&s>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,s--;let p=r.firstChild;n.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let o=t.someProp("clipboardSerializer")||Ks.fromSchema(t.state.schema),a=vN(),l=a.createElement("div");l.appendChild(o.serializeFragment(r,{document:a}));let c=l.firstChild,u,h=0;for(;c&&c.nodeType==1&&(u=EN[c.nodeName.toLowerCase()]);){for(let p=u.length-1;p>=0;p--){let f=a.createElement(u[p]);for(;l.firstChild;)f.appendChild(l.firstChild);l.appendChild(f),h++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${i} ${s}${h?` -${h}`:""} ${JSON.stringify(n)}`);let d=t.someProp("clipboardTextSerializer",p=>p(e,t))||e.content.textBetween(0,e.content.size,` `);return{dom:l,text:d,slice:e}}function gN(t,e,n,r,i){let s=i.parent.type.spec.code,o,a;if(!n&&!e)return null;let l=!!e&&(r||s||!n);if(l){if(t.someProp("transformPastedText",d=>{e=d(e,s||r,t)}),s)return a=new te(X.from(t.state.schema.text(e.replace(/\r\n?/g,` `))),0,0),t.someProp("transformPasted",d=>{a=d(a,t,!0)}),a;let h=t.someProp("clipboardTextParser",d=>d(e,i,r,t));if(h)a=h;else{let d=i.marks(),{schema:p}=t.state,f=Ks.fromSchema(p);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(m=>{let g=o.appendChild(document.createElement("p"));m&&g.appendChild(f.serializeNode(p.text(m,d)))})}}else t.someProp("transformPastedHTML",h=>{n=h(n,t)}),o=bV(n),$u&&EV(o);let c=o&&o.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let h=+u[3];h>0;h--){let d=o.firstChild;for(;d&&d.nodeType!=1;)d=d.nextSibling;if(!d)break;o=d}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||Qs.fromSchema(t.state.schema)).parseSlice(o,{preserveWhitespace:!!(l||u),context:i,ruleFromNode(h){return h.nodeName=="BR"&&!h.nextSibling&&h.parentNode&&!gV.test(h.parentNode.nodeName)?{ignore:!0}:null}})),u)a=vV(Hw(a,+u[1],+u[2]),u[4]);else if(a=te.maxOpen(OV(a.content,i),!0),a.openStart||a.openEnd){let h=0,d=0;for(let p=a.content.firstChild;h{a=h(a,t,l)}),a}const gV=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function OV(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.index(n)),i,s=[];if(t.forEach(o=>{if(!s)return;let a=r.findWrapping(o.type),l;if(!a)return s=null;if(l=s.length&&i.length&&yN(a,i,o,s[s.length-1],0))s[s.length-1]=l;else{s.length&&(s[s.length-1]=bN(s[s.length-1],i.length));let c=ON(o,a);s.push(c),r=r.matchType(c.type),i=a}}),s)return X.from(s)}return t}function ON(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,X.from(t));return t}function yN(t,e,n,r,i){if(i1&&(s=0),i=n&&(a=e<0?o.contentMatchAt(0).fillBefore(a,s<=i).append(a):a.append(o.contentMatchAt(o.childCount).fillBefore(X.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,o.copy(a))}function Hw(t,e,n){return en})),Tg.createHTML(t)):t}function bV(t){let e=/^(\s*]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=vN().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&EN[r[1].toLowerCase()])&&(t=i.map(s=>"<"+s+">").join("")+t+i.map(s=>"").reverse().join("")),n.innerHTML=yV(t),i)for(let s=0;s=0;a-=2){let l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;i=X.from(l.create(r[a+1],i)),s++,o++}return new te(i,s,o)}const xn={},Cn={},TV={touchstart:!0,touchmove:!0};let SV=class{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}};function wV(t){for(let e in xn){let n=xn[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{_V(t,r)&&!qE(t,r)&&(t.editable||!(r.type in Cn))&&n(t,r)},TV[e]?{passive:!0}:void 0)}_n&&t.dom.addEventListener("input",()=>null),Ey(t)}function Ds(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function kV(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function Ey(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>qE(t,r))})}function qE(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function _V(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function xV(t,e){!qE(t,e)&&xn[e.type]&&(t.editable||!(e.type in Cn))&&xn[e.type](t,e)}Cn.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!SN(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Qi&&gn&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),Za&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",i=>i(t,yo(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||mV(t,n)?n.preventDefault():Ds(t,"key")};Cn.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};Cn.keypress=(t,e)=>{let n=e;if(SN(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||ir&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof de)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode),s=()=>t.state.tr.insertText(i).scrollIntoView();!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",o=>o(t,r.$from.pos,r.$to.pos,i,s))&&t.dispatch(s()),n.preventDefault()}};function Hf(t){return{left:t.clientX,top:t.clientY}}function CV(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function ZE(t,e,n,r,i){if(r==-1)return!1;let s=t.state.doc.resolve(r);for(let o=s.depth+1;o>0;o--)if(t.someProp(e,a=>o>s.depth?a(t,n,s.nodeAfter,s.before(o),i,!0):a(t,n,s.node(o),s.before(o),i,!1)))return!0;return!1}function Na(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function DV(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&pe.isSelectable(r)?(Na(t,new pe(n)),!0):!1}function AV(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof pe&&(r=n.node);let s=t.state.doc.resolve(e);for(let o=s.depth+1;o>0;o--){let a=o>s.depth?s.nodeAfter:s.node(o);if(pe.isSelectable(a)){r&&n.$from.depth>0&&o>=n.$from.depth&&s.before(n.$from.depth+1)==n.$from.pos?i=s.before(n.$from.depth):i=s.before(o);break}}return i!=null?(Na(t,pe.create(t.state.doc,i)),!0):!1}function PV(t,e,n,r,i){return ZE(t,"handleClickOn",e,n,r)||t.someProp("handleClick",s=>s(t,e,r))||(i?AV(t,n):DV(t,n))}function NV(t,e,n,r){return ZE(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function RV(t,e,n,r){return ZE(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||MV(t,n,r)}function MV(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(Na(t,de.create(r,0,r.content.size)),!0):!1;let i=r.resolve(e);for(let s=i.depth+1;s>0;s--){let o=s>i.depth?i.nodeAfter:i.node(s),a=i.before(s);if(o.inlineContent)Na(t,de.create(r,a+1,a+1+o.content.size));else if(pe.isSelectable(o))Na(t,pe.create(r,a));else continue;return!0}}function WE(t){return ap(t)}const TN=ir?"metaKey":"ctrlKey";xn.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=WE(t),i=Date.now(),s="singleClick";i-t.input.lastClick.time<500&&CV(n,t.input.lastClick)&&!n[TN]&&t.input.lastClick.button==n.button&&(t.input.lastClick.type=="singleClick"?s="doubleClick":t.input.lastClick.type=="doubleClick"&&(s="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:s,button:n.button};let o=t.posAtCoords(Hf(n));o&&(s=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new IV(t,o,n,!!r)):(s=="doubleClick"?NV:RV)(t,o.pos,o.inside,n)?n.preventDefault():Ds(t,"pointer"))};class IV{constructor(e,n,r,i){this.view=e,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[TN],this.allowDefault=r.shiftKey;let s,o;if(n.inside>-1)s=e.state.doc.nodeAt(n.inside),o=n.inside;else{let u=e.state.doc.resolve(n.pos);s=u.parent,o=u.depth?u.before():0}const a=i?null:r.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l&&l.nodeDOM.nodeType==1?l.nodeDOM:null;let{selection:c}=e.state;(r.button==0&&s.type.spec.draggable&&s.type.spec.selectable!==!1||c instanceof pe&&c.from<=o&&c.to>o)&&(this.mightDrag={node:s,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&hr&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Ds(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>zi(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Hf(e))),this.updateAllowDefault(e),this.allowDefault||!n?Ds(this.view,"pointer"):PV(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||_n&&this.mightDrag&&!this.mightDrag.node.isAtom||gn&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(Na(this.view,Te.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):Ds(this.view,"pointer")}move(e){this.updateAllowDefault(e),Ds(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}xn.touchstart=t=>{t.input.lastTouch=Date.now(),WE(t),Ds(t,"pointer")};xn.touchmove=t=>{t.input.lastTouch=Date.now(),Ds(t,"pointer")};xn.contextmenu=t=>WE(t);function SN(t,e){return t.composing?!0:_n&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const LV=Qi?5e3:-1;Cn.compositionstart=Cn.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof de&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),ap(t,!0),t.markCursor=null;else if(ap(t,!e.selection.empty),hr&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let i=r.focusNode,s=r.focusOffset;i&&i.nodeType==1&&s!=0;){let o=s<0?i.lastChild:i.childNodes[s-1];if(!o)break;if(o.nodeType==3){let a=t.domSelection();a&&a.collapse(o,o.nodeValue.length);break}else i=o,s=-1}}t.input.composing=!0}wN(t,LV)};Cn.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,wN(t,20))};function wN(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>ap(t),e))}function kN(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=$V());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function QV(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=Dz(e.focusNode,e.focusOffset),r=Az(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let i=r.pmViewDesc,s=t.domObserver.lastChangedTextNode;if(n==s||r==s)return s;if(!i||!i.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let o=n.pmViewDesc;if(!(!o||!o.isText(n.nodeValue)))return r}}return n||r}function $V(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function ap(t,e=!1){if(!(Qi&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),kN(t),e||t.docView&&t.docView.dirty){let n=UE(t),r=t.state.selection;return n&&!n.eq(r)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function FV(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const Wc=Ln&&$s<15||Za&&Iz<604;xn.copy=Cn.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let s=Wc?null:n.clipboardData,o=r.content(),{dom:a,text:l}=XE(t,o);s?(n.preventDefault(),s.clearData(),s.setData("text/html",a.innerHTML),s.setData("text/plain",l)):FV(t,a),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function BV(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function jV(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Gc(t,r.value,null,i,e):Gc(t,r.textContent,r.innerHTML,i,e)},50)}function Gc(t,e,n,r,i){let s=gN(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,i,s||te.empty)))return!0;if(!s)return!1;let o=BV(s),a=o?t.state.tr.replaceSelectionWith(o,r):t.state.tr.replaceSelection(s);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function _N(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}Cn.paste=(t,e)=>{let n=e;if(t.composing&&!Qi)return;let r=Wc?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&Gc(t,_N(r),r.getData("text/html"),i,n)?n.preventDefault():jV(t,n)};class xN{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const zV=ir?"altKey":"ctrlKey";function CN(t,e){return t.someProp("dragCopies",r=>!r(e))??!e[zV]}xn.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=t.state.selection,s=i.empty?null:t.posAtCoords(Hf(n)),o;if(!(s&&s.pos>=i.from&&s.pos<=(i instanceof pe?i.to-1:i.to))){if(r&&r.mightDrag)o=pe.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let h=t.docView.nearestDesc(n.target,!0);h&&h.node.type.spec.draggable&&h!=t.docView&&(o=pe.create(t.state.doc,h.posBefore))}}let a=(o||t.state.selection).content(),{dom:l,text:c,slice:u}=XE(t,a);(!n.dataTransfer.files.length||!gn||eN>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Wc?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",Wc||n.dataTransfer.setData("text/plain",c),t.dragging=new xN(u,CN(t,n),o)};xn.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};Cn.dragover=Cn.dragenter=(t,e)=>e.preventDefault();Cn.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(Hf(n));if(!i)return;let s=t.state.doc.resolve(i.pos),o=r&&r.slice;o?t.someProp("transformPasted",f=>{o=f(o,t,!1)}):o=gN(t,_N(n.dataTransfer),Wc?null:n.dataTransfer.getData("text/html"),!1,s);let a=!!(r&&CN(t,n));if(t.someProp("handleDrop",f=>f(t,n,o||te.empty,a))){n.preventDefault();return}if(!o)return;n.preventDefault();let l=o?RP(t.state.doc,s.pos,o):s.pos;l==null&&(l=s.pos);let c=t.state.tr;if(a){let{node:f}=r;f?f.replace(c):c.deleteSelection()}let u=c.mapping.map(l),h=o.openStart==0&&o.openEnd==0&&o.content.childCount==1,d=c.doc;if(h?c.replaceRangeWith(u,u,o.content.firstChild):c.replaceRange(u,u,o),c.doc.eq(d))return;let p=c.doc.resolve(u);if(h&&pe.isSelectable(o.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(o.content.firstChild))c.setSelection(new pe(p));else{let f=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((m,g,y,b)=>f=b),c.setSelection(HE(t,p,c.doc.resolve(f)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))};xn.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&zi(t)},20))};xn.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};xn.beforeinput=(t,e)=>{if(gn&&Qi&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:n}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=n||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",i=>i(t,yo(8,"Backspace")))))return;let{$cursor:r}=t.state.selection;r&&r.pos>0&&t.dispatch(t.state.tr.delete(r.pos-1,r.pos).scrollIntoView())},50)}};for(let t in Cn)xn[t]=Cn[t];function Yc(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}let qw=class DN{constructor(e,n){this.toDOM=e,this.spec=n||Do,this.side=this.spec.side||0}map(e,n,r,i){let{pos:s,deleted:o}=e.mapResult(n.from+i,this.side<0?-1:1);return o?null:new sn(s-r,s-r,this)}valid(){return!0}eq(e){return this==e||e instanceof DN&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Yc(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}};class Bs{constructor(e,n){this.attrs=e,this.spec=n||Do}map(e,n,r,i){let s=e.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,o=e.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return s>=o?null:new sn(s,o,this)}valid(e,n){return n.from=e&&(!s||s(a.spec))&&r.push(a.copy(a.from+i,a.to+i))}for(let o=0;oe){let a=this.children[o]+1;this.children[o+2].findInner(e-a,n-a,r,i+a,s)}}map(e,n,r){return this==un||e.maps.length==0?this:this.mapInner(e,n,0,0,r||Do)}mapInner(e,n,r,i,s){let o;for(let a=0;a{let c=l+r,u;if(u=NN(n,a,c)){for(i||(i=this.children.slice());sa&&h.to=e){this.children[a]==e&&(r=this.children[a+2]);break}let s=e+1,o=s+n.content.size;for(let a=0;as&&l.type instanceof Bs){let c=Math.max(s,l.from)-s,u=Math.min(o,l.to)-s;ci.map(e,n,Do));return Ss.from(r)}forChild(e,n){if(n.isLeaf)return je.empty;let r=[];for(let i=0;in instanceof je)?e:e.reduce((n,r)=>n.concat(r instanceof je?r:r.members),[]))}}forEachSet(e){for(let n=0;n{let g=m-f-(p-d);for(let y=0;yb+u-h)continue;let T=a[y]+u-h;p>=T?a[y+1]=d<=T?-2:-1:d>=u&&g&&(a[y]+=g,a[y+1]+=g)}h+=g}),u=n.maps[c].map(u,-1)}let l=!1;for(let c=0;c=r.content.size){l=!0;continue}let d=n.map(t[c+1]+s,-1),p=d-i,{index:f,offset:m}=r.content.findIndex(h),g=r.maybeChild(f);if(g&&m==h&&m+g.nodeSize==p){let y=a[c+2].mapInner(n,g,u+1,t[c]+s+1,o);y!=un?(a[c]=h,a[c+1]=p,a[c+2]=y):(a[c+1]=-2,l=!0)}else l=!0}if(l){let c=HV(a,t,e,n,i,s,o),u=lp(c,r,0,o);e=u.local;for(let h=0;hn&&o.to{let c=NN(t,a,l+n);if(c){s=!0;let u=lp(c,a,n+l+1,r);u!=un&&i.push(l,l+a.nodeSize,u)}});let o=PN(s?RN(t):t,-n).sort(Ao);for(let a=0;a0;)e++;t.splice(e,0,n)}function Sg(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=un&&e.push(r)}),t.cursorWrapper&&e.push(je.create(t.state.doc,[t.cursorWrapper.deco])),Ss.from(e)}const XV={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},qV=Ln&&$s<=11;class ZV{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}let WV=class{constructor(t,e){this.view=t,this.handleDOMChange=e,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new ZV,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(n=>{for(let r=0;rr.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),qV&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,XV)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let e=0;ethis.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(Fw(this.view)){if(this.suppressingSelectionUpdates)return zi(this.view);if(Ln&&$s<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&Lo(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let e=new Set,n;for(let i=t.focusNode;i;i=qa(i))e.add(i);for(let i=t.anchorNode;i;i=qa(i))if(e.has(i)){n=i;break}let r=n&&this.view.docView.nearestDesc(n);if(r&&r.ignoreMutation({type:"selection",target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let e=this.pendingRecords();e.length&&(this.queue=[]);let n=t.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&Fw(t)&&!this.ignoreSelectionChange(n),i=-1,s=-1,o=!1,a=[];if(t.editable)for(let c=0;cu.nodeName=="BR");if(c.length==2){let[u,h]=c;u.parentNode&&u.parentNode.parentNode==h.parentNode?h.remove():u.remove()}else{let{focusNode:u}=this.currentSelection;for(let h of c){let d=h.parentNode;d&&d.nodeName=="LI"&&(!u||KV(t,u)!=d)&&h.remove()}}}let l=null;i<0&&r&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)-1||r)&&(i>-1&&(t.docView.markDirty(i,s),GV(t)),this.handleDOMChange(i,s,o,a),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(n)||zi(t),this.currentSelection.set(n))}registerMutation(t,e){if(e.indexOf(t.target)>-1)return null;let n=this.view.docView.nearestDesc(t.target);if(t.type=="attributes"&&(n==this.view.docView||t.attributeName=="contenteditable"||t.attributeName=="style"&&!t.oldValue&&!t.target.getAttribute("style"))||!n||n.ignoreMutation(t))return null;if(t.type=="childList"){for(let c=0;ci;g--){let y=r.childNodes[g-1],b=y.pmViewDesc;if(y.nodeName=="BR"&&!b){s=g;break}if(!b||b.size)break}let h=t.state.doc,d=t.someProp("domParser")||Qs.fromSchema(t.state.schema),p=h.resolve(o),f=null,m=d.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:s,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:eU,context:p});if(c&&c[0].pos!=null){let g=c[0].pos,y=c[1]&&c[1].pos;y==null&&(y=g),f={anchor:g+o,head:y+o}}return{doc:m,sel:f,from:o,to:a}}function eU(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(_n&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||_n&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const tU=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function nU(t,e,n,r,i){let s=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let C=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,N=UE(t,C);if(N&&!t.state.selection.eq(N)){if(gn&&Qi&&t.input.lastKeyCode===13&&Date.now()-100I(t,yo(13,"Enter"))))return;let $=t.state.tr.setSelection(N);C=="pointer"?$.setMeta("pointer",!0):C=="key"&&$.scrollIntoView(),s&&$.setMeta("composition",s),t.dispatch($)}return}let o=t.state.doc.resolve(e),a=o.sharedDepth(n);e=o.before(a+1),n=t.state.doc.resolve(n).after(a+1);let l=t.state.selection,c=JV(t,e,n),u=t.state.doc,h=u.slice(c.from,c.to),d,p;t.input.lastKeyCode===8&&Date.now()-100Date.now()-225||Qi)&&i.some(C=>C.nodeType==1&&!tU.test(C.nodeName))&&(!f||f.endA>=f.endB)&&t.someProp("handleKeyDown",C=>C(t,yo(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!f)if(r&&l instanceof de&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))f={start:l.from,endA:l.to,endB:l.to};else{if(c.sel){let C=Kw(t,t.state.doc,c.sel);if(C&&!C.eq(t.state.selection)){let N=t.state.tr.setSelection(C);s&&N.setMeta("composition",s),t.dispatch(N)}}return}t.state.selection.fromt.state.selection.from&&f.start<=t.state.selection.from+2&&t.state.selection.from>=c.from?f.start=t.state.selection.from:f.endA=t.state.selection.to-2&&t.state.selection.to<=c.to&&(f.endB+=t.state.selection.to-f.endA,f.endA=t.state.selection.to)),Ln&&$s<=11&&f.endB==f.start+1&&f.endA==f.start&&f.start>c.from&&c.doc.textBetween(f.start-c.from-1,f.start-c.from+1)=="  "&&(f.start--,f.endA--,f.endB--);let m=c.doc.resolveNoCache(f.start-c.from),g=c.doc.resolveNoCache(f.endB-c.from),y=u.resolve(f.start),b=m.sameParent(g)&&m.parent.inlineContent&&y.end()>=f.endA;if((Za&&t.input.lastIOSEnter>Date.now()-225&&(!b||i.some(C=>C.nodeName=="DIV"||C.nodeName=="P"))||!b&&m.posC(t,yo(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>f.start&&iU(u,f.start,f.endA,m,g)&&t.someProp("handleKeyDown",C=>C(t,yo(8,"Backspace")))){Qi&&gn&&t.domObserver.suppressSelectionUpdates();return}gn&&f.endB==f.start&&(t.input.lastChromeDelete=Date.now()),Qi&&!b&&m.start()!=g.start()&&g.parentOffset==0&&m.depth==g.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==f.endA&&(f.endB-=2,g=c.doc.resolveNoCache(f.endB-c.from),setTimeout(()=>{t.someProp("handleKeyDown",function(C){return C(t,yo(13,"Enter"))})},20));let T=f.start,S=f.endA,w=C=>{let N=C||t.state.tr.replace(T,S,c.doc.slice(f.start-c.from,f.endB-c.from));if(c.sel){let $=Kw(t,N.doc,c.sel);$&&!(gn&&t.composing&&$.empty&&(f.start!=f.endB||t.input.lastChromeDeletezi(t),20));let C=w(t.state.tr.delete(T,S)),N=u.resolve(f.start).marksAcross(u.resolve(f.endA));N&&C.ensureMarks(N),t.dispatch(C)}else if(f.endA==f.endB&&(A=rU(m.parent.content.cut(m.parentOffset,g.parentOffset),y.parent.content.cut(y.parentOffset,f.endA-y.start())))){let C=w(t.state.tr);A.type=="add"?C.addMark(T,S,A.mark):C.removeMark(T,S,A.mark),t.dispatch(C)}else if(m.parent.child(m.index()).isText&&m.index()==g.index()-(g.textOffset?0:1)){let C=m.parent.textBetween(m.parentOffset,g.parentOffset),N=()=>w(t.state.tr.insertText(C,T,S));t.someProp("handleTextInput",$=>$(t,T,S,C,N))||t.dispatch(N())}else t.dispatch(w());else t.dispatch(w())}function Kw(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:HE(t,e.resolve(n.anchor),e.resolve(n.head))}function rU(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,i=n,s=r,o,a,l;for(let u=0;uu.mark(a.addToSet(u.marks));else if(i.length==0&&s.length==1)a=s[0],o="remove",l=u=>u.mark(a.removeFromSet(u.marks));else return null;let c=[];for(let u=0;un||wg(o,!0,!1)0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n){let s=t.node(r).maybeChild(t.indexAfter(r));for(;s&&!s.isLeaf;)s=s.firstChild,i++}return i}function sU(t,e,n,r,i){let s=t.findDiffStart(e,n);if(s==null)return null;let{a:o,b:a}=t.findDiffEnd(e,n+t.size,n+e.size);if(i=="end"){let l=Math.max(0,s-Math.min(o,a));r-=o+l-s}if(o=o?s-r:0;s-=l,s&&s=a?s-r:0;s-=l,s&&s=56320&&e<=57343&&n>=55296&&n<=56319}let MN=class{constructor(t,e){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new SV,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=e,this.state=e.state,this.directPlugins=e.plugins||[],this.directPlugins.forEach(ik),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):typeof t=="function"?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=nk(this),tk(this),this.nodeViews=rk(this),this.docView=Rw(this.state.doc,ek(this),Sg(this),this.dom,this),this.domObserver=new WV(this,(n,r,i,s)=>nU(this,n,r,i,s)),this.domObserver.start(),wV(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let e in t)this._props[e]=t[e];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&Ey(this);let e=this._props;this._props=t,t.plugins&&(t.plugins.forEach(ik),this.directPlugins=t.plugins),this.updateStateInner(t.state,e)}setProps(t){let e={};for(let n in this._props)e[n]=this._props[n];e.state=this.state;for(let n in t)e[n]=t[n];this.update(e)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,e){var n;let r=this.state,i=!1,s=!1;t.storedMarks&&this.composing&&(kN(this),s=!0),this.state=t;let o=r.plugins!=t.plugins||this._props.plugins!=e.plugins;if(o||this._props.plugins!=e.plugins||this._props.nodeViews!=e.nodeViews){let d=rk(this);aU(d,this.nodeViews)&&(this.nodeViews=d,i=!0)}(o||e.handleDOMEvents!=this._props.handleDOMEvents)&&Ey(this),this.editable=nk(this),tk(this);let a=Sg(this),l=ek(this),c=r.plugins!=t.plugins&&!r.doc.eq(t.doc)?"reset":t.scrollToSelection>r.scrollToSelection?"to selection":"preserve",u=i||!this.docView.matchesNode(t.doc,l,a);(u||!t.selection.eq(r.selection))&&(s=!0);let h=c=="preserve"&&s&&this.dom.style.overflowAnchor==null&&$z(this);if(s){this.domObserver.stop();let d=u&&(Ln||gn)&&!this.composing&&!r.selection.empty&&!t.selection.empty&&oU(r.selection,t.selection);if(u){let p=gn?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=QV(this)),(i||!this.docView.update(t.doc,l,a,this))&&(this.docView.updateOuterDeco(l),this.docView.destroy(),this.docView=Rw(t.doc,l,a,this.dom,this)),p&&!this.trackWrites&&(d=!0)}d||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&lV(this))?zi(this,d):(pN(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),!((n=this.dragging)===null||n===void 0)&&n.node&&!r.doc.eq(t.doc)&&this.updateDraggedNode(this.dragging,r),c=="reset"?this.dom.scrollTop=0:c=="to selection"?this.scrollToSelection():h&&Fz(h)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(!(!t||!this.dom.contains(t.nodeType==1?t:t.parentNode))&&!this.someProp("handleScrollToSelection",e=>e(this)))if(this.state.selection instanceof pe){let e=this.docView.domAfterPos(this.state.selection.from);e.nodeType==1&&xw(this,e.getBoundingClientRect(),t)}else xw(this,this.coordsAtPos(this.state.selection.head,1),t)}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(!t||t.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e0&&this.state.doc.nodeAt(i))==n.node&&(r=i)}this.dragging=new xN(t.slice,t.move,r<0?void 0:pe.create(this.state.doc,r))}someProp(t,e){let n=this._props&&this._props[t],r;if(n!=null&&(r=e?e(n):n))return r;for(let s=0;se.ownerDocument.getSelection()),this._root=e}return t||document}updateRoot(){this._root=null}posAtCoords(t){return Hz(this,t)}coordsAtPos(t,e=1){return sN(this,t,e)}domAtPos(t,e=0){return this.docView.domFromPos(t,e)}nodeDOM(t){let e=this.docView.descAt(t);return e?e.nodeDOM:null}posAtDOM(t,e,n=-1){let r=this.docView.posFromDOM(t,e,n);if(r==null)throw new RangeError("DOM position not inside the editor");return r}endOfTextblock(t,e){return Gz(this,e||this.state,t)}pasteHTML(t,e){return Gc(this,"",t,!1,e||new ClipboardEvent("paste"))}pasteText(t,e){return Gc(this,t,null,!0,e||new ClipboardEvent("paste"))}serializeForClipboard(t){return XE(this,t)}destroy(){this.docView&&(kV(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Sg(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,xz())}get isDestroyed(){return this.docView==null}dispatchEvent(t){return xV(this,t)}domSelectionRange(){let t=this.domSelection();return t?_n&&this.root.nodeType===11&&Nz(this.dom.ownerDocument)==this.dom&&YV(this,t)||t:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};MN.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function ek(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[sn.node(0,t.state.doc.content.size,e)]}function tk(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:sn.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function nk(t){return!t.someProp("editable",e=>e(t.state)===!1)}function oU(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function rk(t){let e=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function aU(t,e){let n=0,r=0;for(let i in t){if(t[i]!=e[i])return!0;n++}for(let i in e)r++;return n!=r}function ik(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Gi={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Kc={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},lU=typeof navigator<"u"&&/Mac/.test(navigator.platform),cU=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var tn=0;tn<10;tn++)Gi[48+tn]=Gi[96+tn]=String(tn);for(var tn=1;tn<=24;tn++)Gi[tn+111]="F"+tn;for(var tn=65;tn<=90;tn++)Gi[tn]=String.fromCharCode(tn+32),Kc[tn]=String.fromCharCode(tn);for(var kg in Gi)Kc.hasOwnProperty(kg)||(Kc[kg]=Gi[kg]);function IN(t){var e=lU&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||cU&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Kc:Gi)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const uU=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),hU=typeof navigator<"u"&&/Win/.test(navigator.platform);function dU(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,i,s,o;for(let a=0;a{for(var n in e)mU(t,n,{get:e[n],enumerable:!0})};function Xf(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:i}=n,{storedMarks:s}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return s},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,s=n.storedMarks,n}}}var qf=class{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:e,state:n}=this,{view:r}=e,{tr:i}=n,s=this.buildProps(i);return Object.fromEntries(Object.entries(t).map(([o,a])=>[o,(...l)=>{const c=a(...l)(s);return!i.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(i),c}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,e=!0){const{rawCommands:n,editor:r,state:i}=this,{view:s}=r,o=[],a=!!t,l=t||i.tr,c=()=>(!a&&e&&!l.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(l),o.every(h=>h===!0)),u={...Object.fromEntries(Object.entries(n).map(([h,d])=>[h,(...p)=>{const f=this.buildProps(l,e),m=d(...p)(f);return o.push(m),u}])),run:c};return u}createCan(t){const{rawCommands:e,state:n}=this,r=!1,i=t||n.tr,s=this.buildProps(i,r);return{...Object.fromEntries(Object.entries(e).map(([o,a])=>[o,(...l)=>a(...l)({...s,dispatch:void 0})])),chain:()=>this.createChain(i,r)}}buildProps(t,e=!0){const{rawCommands:n,editor:r,state:i}=this,{view:s}=r,o={tr:t,editor:r,view:s,state:Xf({state:i,transaction:t}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t,e),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(n).map(([a,l])=>[a,(...c)=>l(...c)(o)]))}};return o}},LN={};KE(LN,{blur:()=>gU,clearContent:()=>OU,clearNodes:()=>yU,command:()=>bU,createParagraphNear:()=>EU,cut:()=>vU,deleteCurrentNode:()=>TU,deleteNode:()=>SU,deleteRange:()=>wU,deleteSelection:()=>kU,enter:()=>_U,exitCode:()=>xU,extendMarkRange:()=>CU,first:()=>DU,focus:()=>PU,forEach:()=>NU,insertContent:()=>RU,insertContentAt:()=>LU,joinBackward:()=>FU,joinDown:()=>$U,joinForward:()=>BU,joinItemBackward:()=>jU,joinItemForward:()=>zU,joinTextblockBackward:()=>VU,joinTextblockForward:()=>UU,joinUp:()=>QU,keyboardShortcut:()=>XU,lift:()=>qU,liftEmptyBlock:()=>ZU,liftListItem:()=>WU,newlineInCode:()=>GU,resetAttributes:()=>YU,scrollIntoView:()=>KU,selectAll:()=>JU,selectNodeBackward:()=>eH,selectNodeForward:()=>tH,selectParentNode:()=>nH,selectTextblockEnd:()=>rH,selectTextblockStart:()=>iH,setContent:()=>sH,setMark:()=>SH,setMeta:()=>wH,setNode:()=>kH,setNodeSelection:()=>_H,setTextDirection:()=>xH,setTextSelection:()=>CH,sinkListItem:()=>DH,splitBlock:()=>AH,splitListItem:()=>PH,toggleList:()=>NH,toggleMark:()=>RH,toggleNode:()=>MH,toggleWrap:()=>IH,undoInputRule:()=>LH,unsetAllMarks:()=>QH,unsetMark:()=>$H,unsetTextDirection:()=>FH,updateAttributes:()=>BH,wrapIn:()=>jH,wrapInList:()=>zH});var gU=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),OU=(t=!0)=>({commands:e})=>e.setContent("",{emitUpdate:t}),yU=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:i}=r;return n&&i.forEach(({$from:s,$to:o})=>{t.doc.nodesBetween(s.pos,o.pos,(a,l)=>{if(a.type.isText)return;const{doc:c,mapping:u}=e,h=c.resolve(u.map(l)),d=c.resolve(u.map(l+a.nodeSize)),p=h.blockRange(d);if(!p)return;const f=gl(p);if(a.type.isTextblock){const{defaultType:m}=h.parent.contentMatchAt(h.index());e.setNodeMarkup(p.start,m)}(f||f===0)&&e.lift(p,f)})}),!0},bU=t=>e=>t(e),EU=()=>({state:t,dispatch:e})=>WP(t,e),vU=(t,e)=>({editor:n,tr:r})=>{const{state:i}=n,s=i.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const o=r.mapping.map(e);return r.insert(o,s.content),r.setSelection(new de(r.doc.resolve(Math.max(o-1,0)))),!0},TU=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const i=t.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===r.type){if(e){const o=i.before(s),a=i.after(s);t.delete(o,a).scrollIntoView()}return!0}return!1};function Rt(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}var SU=t=>({tr:e,state:n,dispatch:r})=>{const i=Rt(t,n.schema),s=e.selection.$anchor;for(let o=s.depth;o>0;o-=1)if(s.node(o).type===i){if(r){const a=s.before(o),l=s.after(o);e.delete(a,l).scrollIntoView()}return!0}return!1},wU=t=>({tr:e,dispatch:n})=>{const{from:r,to:i}=t;return n&&e.delete(r,i),!0},kU=()=>({state:t,dispatch:e})=>$E(t,e),_U=()=>({commands:t})=>t.keyboardShortcut("Enter"),xU=()=>({state:t,dispatch:e})=>dz(t,e);function JE(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function cp(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:JE(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function QN(t,e,n={}){return t.find(r=>r.type===e&&cp(Object.fromEntries(Object.keys(n).map(i=>[i,r.attrs[i]])),n))}function sk(t,e,n={}){return!!QN(t,e,n)}function Jc(t,e,n){var r;if(!t||!e)return;let i=t.parent.childAfter(t.parentOffset);if((!i.node||!i.node.marks.some(c=>c.type===e))&&(i=t.parent.childBefore(t.parentOffset)),!i.node||!i.node.marks.some(c=>c.type===e)||(n=n||((r=i.node.marks[0])==null?void 0:r.attrs),!QN([...i.node.marks],e,n)))return;let s=i.index,o=t.start()+i.offset,a=s+1,l=o+i.node.nodeSize;for(;s>0&&sk([...t.parent.child(s-1).marks],e,n);)s-=1,o-=t.parent.child(s).nodeSize;for(;a({tr:n,state:r,dispatch:i})=>{const s=es(t,r.schema),{doc:o,selection:a}=n,{$from:l,from:c,to:u}=a;if(i){const h=Jc(l,s,e);if(h&&h.from<=c&&h.to>=u){const d=de.create(o,h.from,h.to);n.setSelection(d)}}return!0},DU=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r({editor:n,view:r,tr:i,dispatch:s})=>{e={scrollIntoView:!0,...e};const o=()=>{(tv()||AU())&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&t===null||t===!1)return!0;if(s&&t===null&&!ev(n.state.selection))return o(),!0;const a=$N(i.doc,t)||n.state.selection,l=n.state.selection.eq(a);return s&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},NU=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),RU=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),FN=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&FN(r)}return t};function xh(t){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const e=`${t}`,n=new window.DOMParser().parseFromString(e,"text/html").body;return FN(n)}function eu(t,e,n){if(t instanceof Ls||t instanceof X)return t;n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,i=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return X.fromArray(t.map(o=>e.nodeFromJSON(o)));const s=e.nodeFromJSON(t);return n.errorOnInvalidContent&&s.check(),s}catch(s){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:s});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",s),eu("",e,n)}if(i){if(n.errorOnInvalidContent){let o=!1,a="";const l=new TP({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(o=!0,a=typeof c=="string"?c:c.outerHTML,null)}]}})});if(n.slice?Qs.fromSchema(l).parseSlice(xh(t),n.parseOptions):Qs.fromSchema(l).parse(xh(t),n.parseOptions),n.errorOnInvalidContent&&o)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const s=Qs.fromSchema(e);return n.slice?s.parseSlice(xh(t),n.parseOptions).content:s.parse(xh(t),n.parseOptions)}return eu("",e,n)}function MU(t,e,n){const r=t.steps.length-1;if(r{o===0&&(o=u)}),t.setSelection(Te.near(t.doc.resolve(o),n))}var IU=t=>!("type"in t),LU=(t,e,n)=>({tr:r,dispatch:i,editor:s})=>{var o;if(i){n={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let a;const l=m=>{s.emit("contentError",{editor:s,error:m,disableCollaboration:()=>{"collaboration"in s.storage&&typeof s.storage.collaboration=="object"&&s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}})},c={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!s.options.enableContentCheck&&s.options.emitContentError)try{eu(e,s.schema,{parseOptions:c,errorOnInvalidContent:!0})}catch(m){l(m)}try{a=eu(e,s.schema,{parseOptions:c,errorOnInvalidContent:(o=n.errorOnInvalidContent)!=null?o:s.options.enableContentCheck})}catch(m){return l(m),!1}let{from:u,to:h}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},d=!0,p=!0;if((IU(a)?a:[a]).forEach(m=>{m.check(),d=d?m.isText&&m.marks.length===0:!1,p=p?m.isBlock:!1}),u===h&&p){const{parent:m}=r.doc.resolve(u);m.isTextblock&&!m.type.spec.code&&!m.childCount&&(u-=1,h+=1)}let f;if(d){if(Array.isArray(e))f=e.map(m=>m.text||"").join("");else if(e instanceof X){let m="";e.forEach(g=>{g.text&&(m+=g.text)}),f=m}else typeof e=="object"&&e&&e.text?f=e.text:f=e;r.insertText(f,u,h)}else{f=a;const m=r.doc.resolve(u),g=m.node(),y=m.parentOffset===0,b=g.isText||g.isTextblock,T=g.content.size>0;y&&b&&T&&(u=Math.max(0,u-1)),r.replaceWith(u,h,f)}n.updateSelection&&MU(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:u,text:f}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:u,text:f})}return!0},QU=()=>({state:t,dispatch:e})=>cz(t,e),$U=()=>({state:t,dispatch:e})=>uz(t,e),FU=()=>({state:t,dispatch:e})=>zP(t,e),BU=()=>({state:t,dispatch:e})=>XP(t,e),jU=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Bf(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},zU=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Bf(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},VU=()=>({state:t,dispatch:e})=>az(t,e),UU=()=>({state:t,dispatch:e})=>lz(t,e);function BN(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function HU(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,i,s,o;for(let a=0;a({editor:e,view:n,tr:r,dispatch:i})=>{const s=HU(t).split(/-(?!$)/),o=s.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),a=new KeyboardEvent("keydown",{key:o==="Space"?" ":o,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{n.someProp("handleKeyDown",c=>c(n,a))});return l==null||l.steps.forEach(c=>{const u=c.map(r.mapping);u&&i&&r.maybeStep(u)}),!0};function Dr(t,e,n={}){const{from:r,to:i,empty:s}=t.selection,o=e?Rt(e,t.schema):null,a=[];t.doc.nodesBetween(r,i,(u,h)=>{if(u.isText)return;const d=Math.max(r,h),p=Math.min(i,h+u.nodeSize);a.push({node:u,from:d,to:p})});const l=i-r,c=a.filter(u=>o?o.name===u.node.type.name:!0).filter(u=>cp(u.node.attrs,n,{strict:!1}));return s?!!c.length:c.reduce((u,h)=>u+h.to-h.from,0)>=l}var qU=(t,e={})=>({state:n,dispatch:r})=>{const i=Rt(t,n.schema);return Dr(n,i,e)?hz(n,r):!1},ZU=()=>({state:t,dispatch:e})=>GP(t,e),WU=t=>({state:e,dispatch:n})=>{const r=Rt(t,e.schema);return Sz(r)(e,n)},GU=()=>({state:t,dispatch:e})=>ZP(t,e);function Zf(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function ok(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,i)=>(n.includes(i)||(r[i]=t[i]),r),{})}var YU=(t,e)=>({tr:n,state:r,dispatch:i})=>{let s=null,o=null;const a=Zf(typeof t=="string"?t:t.name,r.schema);if(!a)return!1;a==="node"&&(s=Rt(t,r.schema)),a==="mark"&&(o=es(t,r.schema));let l=!1;return n.selection.ranges.forEach(c=>{r.doc.nodesBetween(c.$from.pos,c.$to.pos,(u,h)=>{s&&s===u.type&&(l=!0,i&&n.setNodeMarkup(h,void 0,ok(u.attrs,e))),o&&u.marks.length&&u.marks.forEach(d=>{o===d.type&&(l=!0,i&&n.addMark(h,h+u.nodeSize,o.create(ok(d.attrs,e))))})})}),l},KU=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),JU=()=>({tr:t,dispatch:e})=>{if(e){const n=new Wn(t.doc);t.setSelection(n)}return!0},eH=()=>({state:t,dispatch:e})=>UP(t,e),tH=()=>({state:t,dispatch:e})=>qP(t,e),nH=()=>({state:t,dispatch:e})=>mz(t,e),rH=()=>({state:t,dispatch:e})=>yz(t,e),iH=()=>({state:t,dispatch:e})=>Oz(t,e);function vy(t,e,n={},r={}){return eu(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var sH=(t,{errorOnInvalidContent:e,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:s,dispatch:o,commands:a})=>{const{doc:l}=s;if(r.preserveWhitespace!=="full"){const c=vy(t,i.schema,r,{errorOnInvalidContent:e??i.options.enableContentCheck});return o&&s.replaceWith(0,l.content.size,c).setMeta("preventUpdate",!n),!0}return o&&s.setMeta("preventUpdate",!n),a.insertContentAt({from:0,to:l.content.size},t,{parseOptions:r,errorOnInvalidContent:e??i.options.enableContentCheck})};function jN(t,e){const n=es(e,t.schema),{from:r,to:i,empty:s}=t.selection,o=[];s?(t.storedMarks&&o.push(...t.storedMarks),o.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,i,l=>{o.push(...l.marks)});const a=o.find(l=>l.type.name===n.name);return a?{...a.attrs}:{}}function zN(t,e){const n=new LE(t);return e.forEach(r=>{r.steps.forEach(i=>{n.step(i)})}),n}function oH(t){for(let e=0;e{e(r)&&n.push({node:r,pos:i})}),n}function aH(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,(i,s)=>{n(i)&&r.push({node:i,pos:s})}),r}function VN(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function Wf(t){return e=>VN(e.$from,t)}function ge(t,e,n){return t.config[e]===void 0&&t.parent?ge(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?ge(t.parent,e,n):null}):t.config[e]}function nv(t){return t.map(e=>{const n={name:e.name,options:e.options,storage:e.storage},r=ge(e,"addExtensions",n);return r?[e,...nv(r())]:e}).flat(10)}function rv(t,e){const n=Ks.fromSchema(e).serializeFragment(t),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function UN(t){return typeof t=="function"}function qe(t,e=void 0,...n){return UN(t)?e?t.bind(e)(...n):t(...n):t}function lH(t={}){return Object.keys(t).length===0&&t.constructor===Object}function Wa(t){const e=t.filter(i=>i.type==="extension"),n=t.filter(i=>i.type==="node"),r=t.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function HN(t){const e=[],{nodeExtensions:n,markExtensions:r}=Wa(t),i=[...n,...r],s={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(o=>{const a={name:o.name,options:o.options,storage:o.storage,extensions:i},l=ge(o,"addGlobalAttributes",a);l&&l().forEach(c=>{c.types.forEach(u=>{Object.entries(c.attributes).forEach(([h,d])=>{e.push({type:u,name:h,attribute:{...s,...d}})})})})}),i.forEach(o=>{const a={name:o.name,options:o.options,storage:o.storage},l=ge(o,"addAttributes",a);if(!l)return;const c=l();Object.entries(c).forEach(([u,h])=>{const d={...s,...h};typeof(d==null?void 0:d.default)=="function"&&(d.default=d.default()),d!=null&&d.isRequired&&(d==null?void 0:d.default)===void 0&&delete d.default,e.push({type:o.name,name:u,attribute:d})})}),e}function Be(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([i,s])=>{if(!r[i]){r[i]=s;return}if(i==="class"){const o=s?String(s).split(" "):[],a=r[i]?r[i].split(" "):[],l=o.filter(c=>!a.includes(c));r[i]=[...a,...l].join(" ")}else if(i==="style"){const o=s?s.split(";").map(c=>c.trim()).filter(Boolean):[],a=r[i]?r[i].split(";").map(c=>c.trim()).filter(Boolean):[],l=new Map;a.forEach(c=>{const[u,h]=c.split(":").map(d=>d.trim());l.set(u,h)}),o.forEach(c=>{const[u,h]=c.split(":").map(d=>d.trim());l.set(u,h)}),r[i]=Array.from(l.entries()).map(([c,u])=>`${c}: ${u}`).join("; ")}else r[i]=s}),r},{})}function up(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>Be(n,r),{})}function cH(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function ak(t,e){return"style"in t?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const i=e.reduce((s,o)=>{const a=o.attribute.parseHTML?o.attribute.parseHTML(n):cH(n.getAttribute(o.name));return a==null?s:{...s,[o.name]:a}},{});return{...r,...i}}}}function lk(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&lH(n)?!1:n!=null))}function ck(t){var e,n;const r={};return!((e=t==null?void 0:t.attribute)!=null&&e.isRequired)&&"default"in((t==null?void 0:t.attribute)||{})&&(r.default=t.attribute.default),((n=t==null?void 0:t.attribute)==null?void 0:n.validate)!==void 0&&(r.validate=t.attribute.validate),[t.name,r]}function uH(t,e){var n;const r=HN(t),{nodeExtensions:i,markExtensions:s}=Wa(t),o=(n=i.find(c=>ge(c,"topNode")))==null?void 0:n.name,a=Object.fromEntries(i.map(c=>{const u=r.filter(y=>y.type===c.name),h={name:c.name,options:c.options,storage:c.storage,editor:e},d=t.reduce((y,b)=>{const T=ge(b,"extendNodeSchema",h);return{...y,...T?T(c):{}}},{}),p=lk({...d,content:qe(ge(c,"content",h)),marks:qe(ge(c,"marks",h)),group:qe(ge(c,"group",h)),inline:qe(ge(c,"inline",h)),atom:qe(ge(c,"atom",h)),selectable:qe(ge(c,"selectable",h)),draggable:qe(ge(c,"draggable",h)),code:qe(ge(c,"code",h)),whitespace:qe(ge(c,"whitespace",h)),linebreakReplacement:qe(ge(c,"linebreakReplacement",h)),defining:qe(ge(c,"defining",h)),isolating:qe(ge(c,"isolating",h)),attrs:Object.fromEntries(u.map(ck))}),f=qe(ge(c,"parseHTML",h));f&&(p.parseDOM=f.map(y=>ak(y,u)));const m=ge(c,"renderHTML",h);m&&(p.toDOM=y=>m({node:y,HTMLAttributes:up(y,u)}));const g=ge(c,"renderText",h);return g&&(p.toText=g),[c.name,p]})),l=Object.fromEntries(s.map(c=>{const u=r.filter(g=>g.type===c.name),h={name:c.name,options:c.options,storage:c.storage,editor:e},d=t.reduce((g,y)=>{const b=ge(y,"extendMarkSchema",h);return{...g,...b?b(c):{}}},{}),p=lk({...d,inclusive:qe(ge(c,"inclusive",h)),excludes:qe(ge(c,"excludes",h)),group:qe(ge(c,"group",h)),spanning:qe(ge(c,"spanning",h)),code:qe(ge(c,"code",h)),attrs:Object.fromEntries(u.map(ck))}),f=qe(ge(c,"parseHTML",h));f&&(p.parseDOM=f.map(g=>ak(g,u)));const m=ge(c,"renderHTML",h);return m&&(p.toDOM=g=>m({mark:g,HTMLAttributes:up(g,u)})),[c.name,p]}));return new TP({topNode:o,nodes:a,marks:l})}function hH(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}function iv(t){return t.sort((e,n)=>{const r=ge(e,"priority")||100,i=ge(n,"priority")||100;return r>i?-1:rr.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(r=>`'${r}'`).join(", ")}]. This can lead to issues.`),e}function qN(t,e,n){const{from:r,to:i}=e,{blockSeparator:s=` `,textSerializers:o={}}=n||{};let a="";return t.nodesBetween(r,i,(l,c,u,h)=>{var d;l.isBlock&&c>r&&(a+=s);const p=o==null?void 0:o[l.type.name];if(p)return u&&(a+=p({node:l,pos:c,parent:u,index:h,range:e})),!1;l.isText&&(a+=(d=l==null?void 0:l.text)==null?void 0:d.slice(Math.max(r,c)-c,i-c))}),a}function dH(t,e){const n={from:0,to:t.content.size};return qN(t,n,e)}function ZN(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}function pH(t,e){const n=Rt(e,t.schema),{from:r,to:i}=t.selection,s=[];t.doc.nodesBetween(r,i,a=>{s.push(a)});const o=s.reverse().find(a=>a.type.name===n.name);return o?{...o.attrs}:{}}function WN(t,e){const n=Zf(typeof e=="string"?e:e.name,t.schema);return n==="node"?pH(t,e):n==="mark"?jN(t,e):{}}function fH(t,e=JSON.stringify){const n={};return t.filter(r=>{const i=e(r);return Object.prototype.hasOwnProperty.call(n,i)?!1:n[i]=!0})}function mH(t){const e=fH(t);return e.length===1?e:e.filter((n,r)=>!e.filter((i,s)=>s!==r).some(i=>n.oldRange.from>=i.oldRange.from&&n.oldRange.to<=i.oldRange.to&&n.newRange.from>=i.newRange.from&&n.newRange.to<=i.newRange.to))}function GN(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach((i,s)=>{const o=[];if(i.ranges.length)i.forEach((a,l)=>{o.push({from:a,to:l})});else{const{from:a,to:l}=n[s];if(a===void 0||l===void 0)return;o.push({from:a,to:l})}o.forEach(({from:a,to:l})=>{const c=e.slice(s).map(a,-1),u=e.slice(s).map(l),h=e.invert().map(c,-1),d=e.invert().map(u);r.push({oldRange:{from:h,to:d},newRange:{from:c,to:u}})})}),mH(r)}function sv(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(i=>{const s=n.resolve(t),o=Jc(s,i.type);o&&r.push({mark:i,...o})}):n.nodesBetween(t,e,(i,s)=>{!i||(i==null?void 0:i.nodeSize)===void 0||r.push(...i.marks.map(o=>({from:s,to:s+i.nodeSize,mark:o})))}),r}var gH=(t,e,n,r=20)=>{const i=t.doc.resolve(n);let s=r,o=null;for(;s>0&&o===null;){const a=i.node(s);(a==null?void 0:a.type.name)===e?o=a:s-=1}return[o,s]};function xg(t,e){return e.nodes[t]||e.marks[t]||null}function wd(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=t.find(s=>s.type===e&&s.name===r);return i?i.attribute.keepOnSplit:!1}))}var OH=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(i,s,o,a)=>{var l,c;const u=((c=(l=i.type.spec).toText)==null?void 0:c.call(l,{node:i,pos:s,parent:o,index:a}))||i.textContent||"%leaf%";n+=i.isAtom&&!i.isText?u:u.slice(0,Math.max(0,r-s))}),n};function Ty(t,e,n={}){const{empty:r,ranges:i}=t.selection,s=e?es(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(u=>s?s.name===u.type.name:!0).find(u=>cp(u.attrs,n,{strict:!1}));let o=0;const a=[];if(i.forEach(({$from:u,$to:h})=>{const d=u.pos,p=h.pos;t.doc.nodesBetween(d,p,(f,m)=>{if(!f.isText&&!f.marks.length)return;const g=Math.max(d,m),y=Math.min(p,m+f.nodeSize),b=y-g;o+=b,a.push(...f.marks.map(T=>({mark:T,from:g,to:y})))})}),o===0)return!1;const l=a.filter(u=>s?s.name===u.mark.type.name:!0).filter(u=>cp(u.mark.attrs,n,{strict:!1})).reduce((u,h)=>u+h.to-h.from,0),c=a.filter(u=>s?u.mark.type!==s&&u.mark.type.excludes(s):!0).reduce((u,h)=>u+h.to-h.from,0);return(l>0?l+c:l)>=o}function yH(t,e,n={}){if(!e)return Dr(t,null,n)||Ty(t,null,n);const r=Zf(e,t.schema);return r==="node"?Dr(t,e,n):r==="mark"?Ty(t,e,n):!1}var bH=(t,e)=>{const{$from:n,$to:r,$anchor:i}=t.selection;if(e){const s=Wf(a=>a.type.name===e)(t.selection);if(!s)return!1;const o=t.doc.resolve(s.pos+1);return i.pos+1===o.end()}return!(r.parentOffset{const{$from:e,$to:n}=t.selection;return!(e.parentOffset>0||e.pos!==n.pos)};function uk(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function hk(t,e){const{nodeExtensions:n}=Wa(e),r=n.find(o=>o.name===t);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},s=qe(ge(r,"group",i));return typeof s!="string"?!1:s.split(" ").includes("list")}function Gf(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((r=t.text)!=null?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let i=!0;return t.content.forEach(s=>{i!==!1&&(Gf(s,{ignoreWhitespace:n,checkChildren:e})||(i=!1))}),i}return!1}function YN(t){return t instanceof pe}function vH(t,e,n){const r=t.state.doc.content.size,i=$i(e,0,r),s=$i(n,0,r),o=t.coordsAtPos(i),a=t.coordsAtPos(s,-1),l=Math.min(o.top,a.top),c=Math.max(o.bottom,a.bottom),u=Math.min(o.left,a.left),h=Math.max(o.right,a.right),d=h-u,p=c-l,f={top:l,bottom:c,left:u,right:h,width:d,height:p,x:u,y:l};return{...f,toJSON:()=>f}}function TH(t,e,n){var r;const{selection:i}=e;let s=null;if(ev(i)&&(s=i.$cursor),s){const a=(r=t.storedMarks)!=null?r:s.marks();return s.parent.type.allowsMarkType(n)&&(!!n.isInSet(a)||!a.some(l=>l.type.excludes(n)))}const{ranges:o}=i;return o.some(({$from:a,$to:l})=>{let c=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(a.pos,l.pos,(u,h,d)=>{if(c)return!1;if(u.isInline){const p=!d||d.type.allowsMarkType(n),f=!!n.isInSet(u.marks)||!u.marks.some(m=>m.type.excludes(n));c=p&&f}return!c}),c})}var SH=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const{selection:s}=n,{empty:o,ranges:a}=s,l=es(t,r.schema);if(i)if(o){const c=jN(r,l);n.addStoredMark(l.create({...c,...e}))}else a.forEach(c=>{const u=c.$from.pos,h=c.$to.pos;r.doc.nodesBetween(u,h,(d,p)=>{const f=Math.max(p,u),m=Math.min(p+d.nodeSize,h);d.marks.find(g=>g.type===l)?d.marks.forEach(g=>{l===g.type&&n.addMark(f,m,l.create({...g.attrs,...e}))}):n.addMark(f,m,l.create(e))})});return TH(r,n,l)},wH=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),kH=(t,e={})=>({state:n,dispatch:r,chain:i})=>{const s=Rt(t,n.schema);let o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),s.isTextblock?i().command(({commands:a})=>ww(s,{...o,...e})(n)?!0:a.clearNodes()).command(({state:a})=>ww(s,{...o,...e})(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},_H=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,i=$i(t,0,r.content.size),s=pe.create(r,i);e.setSelection(s)}return!0},xH=(t,e)=>({tr:n,state:r,dispatch:i})=>{const{selection:s}=r;let o,a;return typeof e=="number"?(o=e,a=e):e&&"from"in e&&"to"in e?(o=e.from,a=e.to):(o=s.from,a=s.to),i&&n.doc.nodesBetween(o,a,(l,c)=>{l.isText||n.setNodeMarkup(c,void 0,{...l.attrs,dir:t})}),!0},CH=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:i,to:s}=typeof t=="number"?{from:t,to:t}:t,o=de.atStart(r).from,a=de.atEnd(r).to,l=$i(i,o,a),c=$i(s,o,a),u=de.create(r,l,c);e.setSelection(u)}return!0},DH=t=>({state:e,dispatch:n})=>{const r=Rt(t,e.schema);return _z(r)(e,n)};function dk(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(i=>e==null?void 0:e.includes(i.type.name));t.tr.ensureMarks(r)}}var AH=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{const{selection:s,doc:o}=e,{$from:a,$to:l}=s,c=i.extensionManager.attributes,u=wd(c,a.node().type.name,a.node().attrs);if(s instanceof pe&&s.node.isBlock)return!a.parentOffset||!ji(o,a.pos)?!1:(r&&(t&&dk(n,i.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const h=l.parentOffset===l.parent.content.size,d=a.depth===0?void 0:oH(a.node(-1).contentMatchAt(a.indexAfter(-1)));let p=h&&d?[{type:d,attrs:u}]:void 0,f=ji(e.doc,e.mapping.map(a.pos),1,p);if(!p&&!f&&ji(e.doc,e.mapping.map(a.pos),1,d?[{type:d}]:void 0)&&(f=!0,p=d?[{type:d,attrs:u}]:void 0),r){if(f&&(s instanceof de&&e.deleteSelection(),e.split(e.mapping.map(a.pos),1,p),d&&!h&&!a.parentOffset&&a.parent.type!==d)){const m=e.mapping.map(a.before()),g=e.doc.resolve(m);a.node(-1).canReplaceWith(g.index(),g.index()+1,d)&&e.setNodeMarkup(e.mapping.map(a.before()),d)}t&&dk(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return f},PH=(t,e={})=>({tr:n,state:r,dispatch:i,editor:s})=>{var o;const a=Rt(t,r.schema),{$from:l,$to:c}=r.selection,u=r.selection.node;if(u&&u.isBlock||l.depth<2||!l.sameParent(c))return!1;const h=l.node(-1);if(h.type!==a)return!1;const d=s.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(i){let y=X.empty;const b=l.index(-1)?1:l.index(-2)?2:3;for(let N=l.depth-b;N>=l.depth-3;N-=1)y=X.from(l.node(N).copy(y));const T=l.indexAfter(-1){if(C>-1)return!1;N.isTextblock&&N.content.size===0&&(C=$+1)}),C>-1&&n.setSelection(de.near(n.doc.resolve(C))),n.scrollIntoView()}return!0}const p=c.pos===l.end()?h.contentMatchAt(0).defaultType:null,f={...wd(d,h.type.name,h.attrs),...e},m={...wd(d,l.node().type.name,l.node().attrs),...e};n.delete(l.pos,c.pos);const g=p?[{type:a,attrs:f},{type:p,attrs:m}]:[{type:a,attrs:f}];if(!ji(n.doc,l.pos,2))return!1;if(i){const{selection:y,storedMarks:b}=r,{splittableMarks:T}=s.extensionManager,S=b||y.$to.parentOffset&&y.$from.marks();if(n.split(l.pos,2,g).scrollIntoView(),!S||!i)return!0;const w=S.filter(A=>T.includes(A.type.name));n.ensureMarks(w)}return!0},Cg=(t,e)=>{const n=Wf(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&Js(t.doc,n.pos)&&t.join(n.pos),!0},Dg=(t,e)=>{const n=Wf(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&Js(t.doc,r)&&t.join(r),!0},NH=(t,e,n,r={})=>({editor:i,tr:s,state:o,dispatch:a,chain:l,commands:c,can:u})=>{const{extensions:h,splittableMarks:d}=i.extensionManager,p=Rt(t,o.schema),f=Rt(e,o.schema),{selection:m,storedMarks:g}=o,{$from:y,$to:b}=m,T=y.blockRange(b),S=g||m.$to.parentOffset&&m.$from.marks();if(!T)return!1;const w=Wf(A=>hk(A.type.name,h))(m);if(T.depth>=1&&w&&T.depth-w.depth<=1){if(w.node.type===p)return c.liftListItem(f);if(hk(w.node.type.name,h)&&p.validContent(w.node.content)&&a)return l().command(()=>(s.setNodeMarkup(w.pos,p),!0)).command(()=>Cg(s,p)).command(()=>Dg(s,p)).run()}return!n||!S||!a?l().command(()=>u().wrapInList(p,r)?!0:c.clearNodes()).wrapInList(p,r).command(()=>Cg(s,p)).command(()=>Dg(s,p)).run():l().command(()=>{const A=u().wrapInList(p,r),C=S.filter(N=>d.includes(N.type.name));return s.ensureMarks(C),A?!0:c.clearNodes()}).wrapInList(p,r).command(()=>Cg(s,p)).command(()=>Dg(s,p)).run()},RH=(t,e={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:s=!1}=n,o=es(t,r.schema);return Ty(r,o,e)?i.unsetMark(o,{extendEmptyMarkRange:s}):i.setMark(o,e)},MH=(t,e,n={})=>({state:r,commands:i})=>{const s=Rt(t,r.schema),o=Rt(e,r.schema),a=Dr(r,s,n);let l;return r.selection.$anchor.sameParent(r.selection.$head)&&(l=r.selection.$anchor.parent.attrs),a?i.setNode(o,l):i.setNode(s,{...l,...n})},IH=(t,e={})=>({state:n,commands:r})=>{const i=Rt(t,n.schema);return Dr(n,i,e)?r.lift(i):r.wrapIn(i,e)},LH=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r=0;l-=1)o.step(a.steps[l].invert(a.docs[l]));if(s.text){const l=o.doc.resolve(s.from).marks();o.replaceWith(s.from,s.to,t.schema.text(s.text,l))}else o.delete(s.from,s.to)}return!0}}return!1},QH=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:i}=n;return r||e&&i.forEach(s=>{t.removeMark(s.$from.pos,s.$to.pos)}),!0},$H=(t,e={})=>({tr:n,state:r,dispatch:i})=>{var s;const{extendEmptyMarkRange:o=!1}=e,{selection:a}=n,l=es(t,r.schema),{$from:c,empty:u,ranges:h}=a;if(!i)return!0;if(u&&o){let{from:d,to:p}=a;const f=(s=c.marks().find(g=>g.type===l))==null?void 0:s.attrs,m=Jc(c,l,f);m&&(d=m.from,p=m.to),n.removeMark(d,p,l)}else h.forEach(d=>{n.removeMark(d.$from.pos,d.$to.pos,l)});return n.removeStoredMark(l),!0},FH=t=>({tr:e,state:n,dispatch:r})=>{const{selection:i}=n;let s,o;return typeof t=="number"?(s=t,o=t):t&&"from"in t&&"to"in t?(s=t.from,o=t.to):(s=i.from,o=i.to),r&&e.doc.nodesBetween(s,o,(a,l)=>{if(a.isText)return;const c={...a.attrs};delete c.dir,e.setNodeMarkup(l,void 0,c)}),!0},BH=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let s=null,o=null;const a=Zf(typeof t=="string"?t:t.name,r.schema);if(!a)return!1;a==="node"&&(s=Rt(t,r.schema)),a==="mark"&&(o=es(t,r.schema));let l=!1;return n.selection.ranges.forEach(c=>{const u=c.$from.pos,h=c.$to.pos;let d,p,f,m;n.selection.empty?r.doc.nodesBetween(u,h,(g,y)=>{s&&s===g.type&&(l=!0,f=Math.max(y,u),m=Math.min(y+g.nodeSize,h),d=y,p=g)}):r.doc.nodesBetween(u,h,(g,y)=>{y=u&&y<=h&&(s&&s===g.type&&(l=!0,i&&n.setNodeMarkup(y,void 0,{...g.attrs,...e})),o&&g.marks.length&&g.marks.forEach(b=>{if(o===b.type&&(l=!0,i)){const T=Math.max(y,u),S=Math.min(y+g.nodeSize,h);n.addMark(T,S,o.create({...b.attrs,...e}))}}))}),p&&(d!==void 0&&i&&n.setNodeMarkup(d,void 0,{...p.attrs,...e}),o&&p.marks.length&&p.marks.forEach(g=>{o===g.type&&i&&n.addMark(f,m,o.create({...g.attrs,...e}))}))}),l},jH=(t,e={})=>({state:n,dispatch:r})=>{const i=Rt(t,n.schema);return bz(i,e)(n,r)},zH=(t,e={})=>({state:n,dispatch:r})=>{const i=Rt(t,n.schema);return Ez(i,e)(n,r)},VH=class{constructor(){this.callbacks={}}on(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}emit(t,...e){const n=this.callbacks[t];return n&&n.forEach(r=>r.apply(this,e)),this}off(t,e){const n=this.callbacks[t];return n&&(e?this.callbacks[t]=n.filter(r=>r!==e):delete this.callbacks[t]),this}once(t,e){const n=(...r)=>{this.off(t,n),e.apply(this,r)};return this.on(t,n)}removeAllListeners(){this.callbacks={}}},Yf=class{constructor(t){var e;this.find=t.find,this.handler=t.handler,this.undoable=(e=t.undoable)!=null?e:!0}},UH=(t,e)=>{if(JE(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function Ch(t){var e;const{editor:n,from:r,to:i,text:s,rules:o,plugin:a}=t,{view:l}=n;if(l.composing)return!1;const c=l.state.doc.resolve(r);if(c.parent.type.spec.code||(e=c.nodeBefore||c.nodeAfter)!=null&&e.marks.find(d=>d.type.spec.code))return!1;let u=!1;const h=OH(c)+s;return o.forEach(d=>{if(u)return;const p=UH(h,d.find);if(!p)return;const f=l.state.tr,m=Xf({state:l.state,transaction:f}),g={from:r-(p[0].length-s.length),to:i},{commands:y,chain:b,can:T}=new qf({editor:n,state:m});d.handler({state:m,range:g,match:p,commands:y,chain:b,can:T})===null||!f.steps.length||(d.undoable&&f.setMeta(a,{transform:f,from:r,to:i,text:s}),l.dispatch(f),u=!0)}),u}function HH(t){const{editor:e,rules:n}=t,r=new ze({state:{init(){return null},apply(i,s,o){const a=i.getMeta(r);if(a)return a;const l=i.getMeta("applyInputRules");return l&&setTimeout(()=>{let{text:c}=l;typeof c=="string"?c=c:c=rv(X.from(c),o.schema);const{from:u}=l,h=u+c.length;Ch({editor:e,from:u,to:h,text:c,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:s}},props:{handleTextInput(i,s,o,a){return Ch({editor:e,from:s,to:o,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:s}=i.state.selection;s&&Ch({editor:e,from:s.pos,to:s.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,s){if(s.key!=="Enter")return!1;const{$cursor:o}=i.state.selection;return o?Ch({editor:e,from:o.pos,to:o.pos,text:` `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function XH(t){return Object.prototype.toString.call(t).slice(8,-1)}function Dh(t){return XH(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function KN(t,e){const n={...t};return Dh(t)&&Dh(e)&&Object.keys(e).forEach(r=>{Dh(e[r])&&Dh(t[r])?n[r]=KN(t[r],e[r]):n[r]=e[r]}),n}var ov=class{constructor(t={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...t},this.name=this.config.name}get options(){return{...qe(ge(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...qe(ge(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(t={}){const e=this.extend({...this.config,addOptions:()=>KN(this.options,t)});return e.name=this.name,e.parent=this.parent,e}extend(t={}){const e=new this.constructor({...this.config,...t});return e.parent=this,this.child=e,e.name="name"in t?t.name:e.parent.name,e}},Rr=class JN extends ov{constructor(){super(...arguments),this.type="mark"}static create(e={}){const n=typeof e=="function"?e():e;return new JN(n)}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const s=i.marks();if(!s.find(a=>(a==null?void 0:a.type.name)===n.name))return!1;const o=s.find(a=>(a==null?void 0:a.type.name)===n.name);return o&&r.removeStoredMark(o),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}};function qH(t){return typeof t=="number"}var ZH=class{constructor(t){this.find=t.find,this.handler=t.handler}},WH=(t,e,n)=>{if(JE(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(i=>{const s=[i.text];return s.index=i.index,s.input=t,s.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),s.push(i.replaceWith)),s}):[]};function GH(t){const{editor:e,state:n,from:r,to:i,rule:s,pasteEvent:o,dropEvent:a}=t,{commands:l,chain:c,can:u}=new qf({editor:e,state:n}),h=[];return n.doc.nodesBetween(r,i,(d,p)=>{var f,m,g,y,b;if((m=(f=d.type)==null?void 0:f.spec)!=null&&m.code||!(d.isText||d.isTextblock||d.isInline))return;const T=(b=(y=(g=d.content)==null?void 0:g.size)!=null?y:d.nodeSize)!=null?b:0,S=Math.max(r,p),w=Math.min(i,p+T);if(S>=w)return;const A=d.isText?d.text||"":d.textBetween(S-p,w-p,void 0,"");WH(A,s.find,o).forEach(C=>{if(C.index===void 0)return;const N=S+C.index+1,$=N+C[0].length,I={from:n.tr.mapping.map(N),to:n.tr.mapping.map($)},L=s.handler({state:n,range:I,match:C,commands:l,chain:c,can:u,pasteEvent:o,dropEvent:a});h.push(L)})}),h.every(d=>d!==null)}var Ah=null,YH=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)==null||e.setData("text/html",t),n};function KH(t){const{editor:e,rules:n}=t;let r=null,i=!1,s=!1,o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a;try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}const l=({state:c,from:u,to:h,rule:d,pasteEvt:p})=>{const f=c.tr,m=Xf({state:c,transaction:f});if(!(!GH({editor:e,state:m,from:Math.max(u-1,0),to:h.b-1,rule:d,pasteEvent:p,dropEvent:a})||!f.steps.length)){try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}return o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,f}};return n.map(c=>new ze({view(u){const h=p=>{var f;r=(f=u.dom.parentElement)!=null&&f.contains(p.target)?u.dom.parentElement:null,r&&(Ah=e)},d=()=>{Ah&&(Ah=null)};return window.addEventListener("dragstart",h),window.addEventListener("dragend",d),{destroy(){window.removeEventListener("dragstart",h),window.removeEventListener("dragend",d)}}},props:{handleDOMEvents:{drop:(u,h)=>{if(s=r===u.dom.parentElement,a=h,!s){const d=Ah;d!=null&&d.isEditable&&setTimeout(()=>{const p=d.state.selection;p&&d.commands.deleteRange({from:p.from,to:p.to})},10)}return!1},paste:(u,h)=>{var d;const p=(d=h.clipboardData)==null?void 0:d.getData("text/html");return o=h,i=!!(p!=null&&p.includes("data-pm-slice")),!1}}},appendTransaction:(u,h,d)=>{const p=u[0],f=p.getMeta("uiEvent")==="paste"&&!i,m=p.getMeta("uiEvent")==="drop"&&!s,g=p.getMeta("applyPasteRules"),y=!!g;if(!f&&!m&&!y)return;if(y){let{text:S}=g;typeof S=="string"?S=S:S=rv(X.from(S),d.schema);const{from:w}=g,A=w+S.length,C=YH(S);return l({rule:c,state:d,from:w,to:{b:A},pasteEvt:C})}const b=h.doc.content.findDiffStart(d.doc.content),T=h.doc.content.findDiffEnd(d.doc.content);if(!(!qH(b)||!T||b===T.b))return l({rule:c,state:d,from:b,to:T,pasteEvt:o})}}))}var Kf=class{constructor(t,e){this.splittableMarks=[],this.editor=e,this.baseExtensions=t,this.extensions=XN(t),this.schema=uH(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((t,e)=>{const n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:xg(e.name,this.schema)},r=ge(e,"addCommands",n);return r?{...t,...r()}:t},{})}get plugins(){const{editor:t}=this;return iv([...this.extensions].reverse()).flatMap(e=>{const n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:t,type:xg(e.name,this.schema)},r=[],i=ge(e,"addKeyboardShortcuts",n);let s={};if(e.type==="mark"&&ge(e,"exitable",n)&&(s.ArrowRight=()=>Rr.handleExit({editor:t,mark:e})),i){const u=Object.fromEntries(Object.entries(i()).map(([h,d])=>[h,()=>d({editor:t})]));s={...s,...u}}const o=fU(s);r.push(o);const a=ge(e,"addInputRules",n);if(uk(e,t.options.enableInputRules)&&a){const u=a();if(u&&u.length){const h=HH({editor:t,rules:u}),d=Array.isArray(h)?h:[h];r.push(...d)}}const l=ge(e,"addPasteRules",n);if(uk(e,t.options.enablePasteRules)&&l){const u=l();if(u&&u.length){const h=KH({editor:t,rules:u});r.push(...h)}}const c=ge(e,"addProseMirrorPlugins",n);if(c){const u=c();r.push(...u)}return r})}get attributes(){return HN(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=Wa(this.extensions);return Object.fromEntries(e.filter(n=>!!ge(n,"addNodeView")).map(n=>{const r=this.attributes.filter(l=>l.type===n.name),i={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:Rt(n.name,this.schema)},s=ge(n,"addNodeView",i);if(!s)return[];const o=s();if(!o)return[];const a=(l,c,u,h,d)=>{const p=up(l,r);return o({node:l,view:c,getPos:u,decorations:h,innerDecorations:d,editor:t,extension:n,HTMLAttributes:p})};return[n.name,a]}))}get markViews(){const{editor:t}=this,{markExtensions:e}=Wa(this.extensions);return Object.fromEntries(e.filter(n=>!!ge(n,"addMarkView")).map(n=>{const r=this.attributes.filter(a=>a.type===n.name),i={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:es(n.name,this.schema)},s=ge(n,"addMarkView",i);if(!s)return[];const o=(a,l,c)=>{const u=up(a,r);return s()({mark:a,view:l,inline:c,editor:t,extension:n,HTMLAttributes:u,updateAttributes:h=>{pX(a,t,h)}})};return[n.name,o]}))}setupExtensions(){const t=this.extensions;this.editor.extensionStorage=Object.fromEntries(t.map(e=>[e.name,e.storage])),t.forEach(e=>{var n;const r={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:xg(e.name,this.schema)};e.type==="mark"&&((n=qe(ge(e,"keepOnSplit",r)))==null||n)&&this.splittableMarks.push(e.name);const i=ge(e,"onBeforeCreate",r),s=ge(e,"onCreate",r),o=ge(e,"onUpdate",r),a=ge(e,"onSelectionUpdate",r),l=ge(e,"onTransaction",r),c=ge(e,"onFocus",r),u=ge(e,"onBlur",r),h=ge(e,"onDestroy",r);i&&this.editor.on("beforeCreate",i),s&&this.editor.on("create",s),o&&this.editor.on("update",o),a&&this.editor.on("selectionUpdate",a),l&&this.editor.on("transaction",l),c&&this.editor.on("focus",c),u&&this.editor.on("blur",u),h&&this.editor.on("destroy",h)})}};Kf.resolve=XN;Kf.sort=iv;Kf.flatten=nv;var JH={};KE(JH,{ClipboardTextSerializer:()=>tR,Commands:()=>nR,Delete:()=>rR,Drop:()=>iR,Editable:()=>sR,FocusEvents:()=>aR,Keymap:()=>lR,Paste:()=>cR,Tabindex:()=>uR,TextDirection:()=>hR,focusEventsPluginKey:()=>oR});var Ve=class eR extends ov{constructor(){super(...arguments),this.type="extension"}static create(e={}){const n=typeof e=="function"?e():e;return new eR(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},tR=Ve.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new ze({key:new rt("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:i}=e,{ranges:s}=i,o=Math.min(...s.map(c=>c.$from.pos)),a=Math.max(...s.map(c=>c.$to.pos)),l=ZN(n);return qN(r,{from:o,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),nR=Ve.create({name:"commands",addCommands(){return{...LN}}}),rR=Ve.create({name:"delete",onUpdate({transaction:t,appendedTransactions:e}){var n,r,i;const s=()=>{var o,a,l,c;if((c=(l=(a=(o=this.editor.options.coreExtensionOptions)==null?void 0:o.delete)==null?void 0:a.filterTransaction)==null?void 0:l.call(a,t))!=null?c:t.getMeta("y-sync$"))return;const u=zN(t.before,[t,...e]);GN(u).forEach(d=>{u.mapping.mapResult(d.oldRange.from).deletedAfter&&u.mapping.mapResult(d.oldRange.to).deletedBefore&&u.before.nodesBetween(d.oldRange.from,d.oldRange.to,(p,f)=>{const m=f+p.nodeSize-2,g=d.oldRange.from<=f&&m<=d.oldRange.to;this.editor.emit("delete",{type:"node",node:p,from:f,to:m,newFrom:u.mapping.map(f),newTo:u.mapping.map(m),deletedRange:d.oldRange,newRange:d.newRange,partial:!g,editor:this.editor,transaction:t,combinedTransform:u})})});const h=u.mapping;u.steps.forEach((d,p)=>{var f,m;if(d instanceof Tr){const g=h.slice(p).map(d.from,-1),y=h.slice(p).map(d.to),b=h.invert().map(g,-1),T=h.invert().map(y),S=(f=u.doc.nodeAt(g-1))==null?void 0:f.marks.some(A=>A.eq(d.mark)),w=(m=u.doc.nodeAt(y))==null?void 0:m.marks.some(A=>A.eq(d.mark));this.editor.emit("delete",{type:"mark",mark:d.mark,from:d.from,to:d.to,deletedRange:{from:b,to:T},newRange:{from:g,to:y},partial:!!(w||S),editor:this.editor,transaction:t,combinedTransform:u})}})};(i=(r=(n=this.editor.options.coreExtensionOptions)==null?void 0:n.delete)==null?void 0:r.async)==null||i?setTimeout(s,0):s()}}),iR=Ve.create({name:"drop",addProseMirrorPlugins(){return[new ze({key:new rt("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),sR=Ve.create({name:"editable",addProseMirrorPlugins(){return[new ze({key:new rt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),oR=new rt("focusEvents"),aR=Ve.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new ze({key:oR,props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),lR=Ve.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:o})=>{const{selection:a,doc:l}=o,{empty:c,$anchor:u}=a,{pos:h,parent:d}=u,p=u.parent.isTextblock&&h>0?o.doc.resolve(h-1):u,f=p.parent.type.spec.isolating,m=u.pos-u.parentOffset,g=f&&p.parent.childCount===1?m===u.pos:Te.atStart(l).from===h;return!c||!d.type.isTextblock||d.textContent.length||!g||g&&u.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},i={...n,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return tv()||BN()?i:r},addProseMirrorPlugins(){return[new ze({key:new rt("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(p=>p.getMeta("composition")))return;const r=t.some(p=>p.docChanged)&&!e.doc.eq(n.doc),i=t.some(p=>p.getMeta("preventClearDocument"));if(!r||i)return;const{empty:s,from:o,to:a}=e.selection,l=Te.atStart(e.doc).from,c=Te.atEnd(e.doc).to;if(s||!(o===l&&a===c)||!Gf(n.doc))return;const u=n.tr,h=Xf({state:n,transaction:u}),{commands:d}=new qf({editor:this.editor,state:h});if(d.clearNodes(),!!u.steps.length)return u}})]}}),cR=Ve.create({name:"paste",addProseMirrorPlugins(){return[new ze({key:new rt("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),uR=Ve.create({name:"tabindex",addProseMirrorPlugins(){return[new ze({key:new rt("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),hR=Ve.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:t}=Wa(this.extensions);return[{types:t.filter(e=>e.name!=="text").map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{const n=e.getAttribute("dir");return n&&(n==="ltr"||n==="rtl"||n==="auto")?n:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new ze({key:new rt("textDirection"),props:{attributes:()=>{const t=this.options.direction;return t?{dir:t}:{}}}})]}}),eX=class ba{constructor(e,n,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=i}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!=null?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new ba(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new ba(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new ba(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const i=n.isBlock&&!n.isTextblock,s=n.isAtom&&!n.isText,o=this.pos+r+(s?0:1);if(o<0||o>this.resolvedPos.doc.nodeSize-2)return;const a=this.resolvedPos.doc.resolve(o);if(!i&&a.depth<=this.depth)return;const l=new ba(a,this.editor,i,i?n:null);i&&(l.actualDepth=this.depth+1),e.push(new ba(a,this.editor,i,i?n:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===e)if(Object.keys(n).length>0){const s=i.node.attrs,o=Object.keys(n);for(let a=0;a{r&&i.length>0||(o.node.type.name===e&&s.every(a=>n[a]===o.node.attrs[a])&&i.push(o),!(r&&i.length>0)&&(i=i.concat(o.querySelectorAll(e,n,r))))}),i}setAttribute(e){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}},tX=`.ProseMirror { position: relative; } .ProseMirror { word-wrap: break-word; white-space: pre-wrap; white-space: break-spaces; -webkit-font-variant-ligatures: none; font-variant-ligatures: none; font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */ } .ProseMirror [contenteditable="false"] { white-space: normal; } .ProseMirror [contenteditable="false"] [contenteditable="true"] { white-space: pre-wrap; } .ProseMirror pre { white-space: pre-wrap; } img.ProseMirror-separator { display: inline !important; border: none !important; margin: 0 !important; width: 0 !important; height: 0 !important; } .ProseMirror-gapcursor { display: none; pointer-events: none; position: absolute; margin: 0; } .ProseMirror-gapcursor:after { content: ""; display: block; position: absolute; top: -2px; width: 20px; border-top: 1px solid black; animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite; } @keyframes ProseMirror-cursor-blink { to { visibility: hidden; } } .ProseMirror-hideselection *::selection { background: transparent; } .ProseMirror-hideselection *::-moz-selection { background: transparent; } .ProseMirror-hideselection * { caret-color: transparent; } .ProseMirror-focused .ProseMirror-gapcursor { display: block; }`;function nX(t,e,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute("data-tiptap-style",""),i.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(i),i}var rX=class extends VH{constructor(t={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:r})=>{throw r},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:r,slice:i,moved:s})=>this.options.onDrop(r,i,s)),this.on("paste",({event:r,slice:i})=>this.options.onPaste(r,i)),this.on("delete",this.options.onDelete);const e=this.createDoc(),n=$N(e,this.options.autofocus);this.editorState=oz.create({doc:e,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(t){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(t),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const t=this.editorView.dom;t!=null&&t.editor&&delete t.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(t){console.warn("Failed to remove CSS element:",t)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=nX(tX,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,e=!0){this.setOptions({editable:t}),e&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:t=>{this.editorState=t},dispatch:t=>{this.dispatchTransaction(t)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(t,e)=>{if(this.editorView)return this.editorView[e];if(e==="state")return this.editorState;if(e in t)return Reflect.get(t,e);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${e}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(t,e){const n=UN(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(t){if(this.isDestroyed)return;const e=this.state.plugins;let n=e;if([].concat(t).forEach(i=>{const s=typeof i=="string"?`${i}$`:i.key;n=n.filter(o=>!o.key.startsWith(s))}),e.length===n.length)return;const r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var t,e;const n=[...this.options.enableCoreExtensions?[sR,tR.configure({blockSeparator:(e=(t=this.options.coreExtensionOptions)==null?void 0:t.clipboardTextSerializer)==null?void 0:e.blockSeparator}),nR,aR,lR,uR,iR,cR,rR,hR.configure({direction:this.options.textDirection})].filter(r=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[r.name]!==!1:!0):[],...this.options.extensions].filter(r=>["extension","node","mark"].includes(r==null?void 0:r.type));this.extensionManager=new Kf(n,this)}createCommandManager(){this.commandManager=new qf({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let t;try{t=vy(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(e.message))throw e;this.emit("contentError",{editor:this,error:e,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(n=>n.name!=="collaboration"),this.createExtensionManager()}}),t=vy(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return t}createView(t){var e;this.editorView=new MN(t,{...this.options.editorProps,attributes:{role:"textbox",...(e=this.options.editorProps)==null?void 0:e.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const n=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(n),this.prependClass(),this.injectCSS();const r=this.view.dom;r.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(c=>{var u;return(u=this.capturedTransaction)==null?void 0:u.step(c)});return}const{state:e,transactions:n}=this.state.applyTransaction(t),r=!this.state.selection.eq(e.selection),i=n.includes(t),s=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:t,nextState:e}),!i)return;this.view.updateState(e),this.emit("transaction",{editor:this,transaction:t,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:t});const o=n.findLast(c=>c.getMeta("focus")||c.getMeta("blur")),a=o==null?void 0:o.getMeta("focus"),l=o==null?void 0:o.getMeta("blur");a&&this.emit("focus",{editor:this,event:a.event,transaction:o}),l&&this.emit("blur",{editor:this,event:l.event,transaction:o}),!(t.getMeta("preventUpdate")||!n.some(c=>c.docChanged)||s.doc.eq(e.doc))&&this.emit("update",{editor:this,transaction:t,appendedTransactions:n.slice(1)})}getAttributes(t){return WN(this.state,t)}isActive(t,e){const n=typeof t=="string"?t:null,r=typeof t=="string"?e:t;return yH(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return rv(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e=` `,textSerializers:n={}}=t||{};return dH(this.state.doc,{blockSeparator:e,textSerializers:{...ZN(this.schema),...n}})}get isEmpty(){return Gf(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var t,e;return(e=(t=this.editorView)==null?void 0:t.isDestroyed)!=null?e:!0}$node(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelector(t,e))||null}$nodes(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelectorAll(t,e))||null}$pos(t){const e=this.state.doc.resolve(t);return new eX(e,this)}get $doc(){return this.$pos(0)}};function $o(t){return new Yf({find:t.find,handler:({state:e,range:n,match:r})=>{const i=qe(t.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:s}=e,o=r[r.length-1],a=r[0];if(o){const l=a.search(/\S/),c=n.from+a.indexOf(o),u=c+o.length;if(sv(n.from,n.to,e.doc).filter(d=>d.mark.type.excluded.find(p=>p===t.type&&p!==d.mark.type)).filter(d=>d.to>c).length)return null;un.from&&s.delete(n.from+l,c);const h=n.from+l+o.length;s.addMark(n.from+l,h,t.type.create(i||{})),s.removeStoredMark(t.type)}},undoable:t.undoable})}function dR(t){return new Yf({find:t.find,handler:({state:e,range:n,match:r})=>{const i=qe(t.getAttributes,void 0,r)||{},{tr:s}=e,o=n.from;let a=n.to;const l=t.type.create(i);if(r[1]){const c=r[0].lastIndexOf(r[1]);let u=o+c;u>a?u=a:a=u+r[1].length;const h=r[0][r[0].length-1];s.insertText(h,o+r[0].length-1),s.replaceWith(u,a,l)}else if(r[0]){const c=t.type.isInline?o:o-1;s.insert(c,t.type.create(i)).delete(s.mapping.map(o),s.mapping.map(a))}s.scrollIntoView()},undoable:t.undoable})}function tu(t){return new Yf({find:t.find,handler:({state:e,range:n,match:r})=>{const i=e.doc.resolve(n.from),s=qe(t.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,s)},undoable:t.undoable})}function Ga(t){return new Yf({find:t.find,handler:({state:e,range:n,match:r,chain:i})=>{const s=qe(t.getAttributes,void 0,r)||{},o=e.tr.delete(n.from,n.to),a=o.doc.resolve(n.from).blockRange(),l=a&&IE(a,t.type,s);if(!l)return null;if(o.wrap(a,l),t.keepMarks&&t.editor){const{selection:u,storedMarks:h}=e,{splittableMarks:d}=t.editor.extensionManager,p=h||u.$to.parentOffset&&u.$from.marks();if(p){const f=p.filter(m=>d.includes(m.type.name));o.ensureMarks(f)}}if(t.keepAttributes){const u=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(u,s).run()}const c=o.doc.resolve(n.from-1).nodeBefore;c&&c.type===t.type&&Js(o.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,c))&&o.join(n.from-1)},undoable:t.undoable})}var iX=t=>"touches"in t,sX=class{constructor(t){this.directions=["bottom-left","bottom-right","top-left","top-right"],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:"",wrapper:"",handle:"",resizing:""},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.handleMouseMove=o=>{if(!this.isResizing||!this.activeHandle)return;const a=o.clientX-this.startX,l=o.clientY-this.startY;this.handleResize(a,l)},this.handleTouchMove=o=>{if(!this.isResizing||!this.activeHandle)return;const a=o.touches[0];if(!a)return;const l=a.clientX-this.startX,c=a.clientY-this.startY;this.handleResize(l,c)},this.handleMouseUp=()=>{if(!this.isResizing)return;const o=this.element.offsetWidth,a=this.element.offsetHeight;this.onCommit(o,a),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)},this.handleKeyDown=o=>{o.key==="Shift"&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=o=>{o.key==="Shift"&&(this.isShiftKeyPressed=!1)};var e,n,r,i,s;this.node=t.node,this.element=t.element,this.contentElement=t.contentElement,this.getPos=t.getPos,this.onResize=t.onResize,this.onCommit=t.onCommit,this.onUpdate=t.onUpdate,(e=t.options)!=null&&e.min&&(this.minSize={...this.minSize,...t.options.min}),(n=t.options)!=null&&n.max&&(this.maxSize=t.options.max),(r=t==null?void 0:t.options)!=null&&r.directions&&(this.directions=t.options.directions),(i=t.options)!=null&&i.preserveAspectRatio&&(this.preserveAspectRatio=t.options.preserveAspectRatio),(s=t.options)!=null&&s.className&&(this.classNames={container:t.options.className.container||"",wrapper:t.options.className.wrapper||"",handle:t.options.className.handle||"",resizing:t.options.className.resizing||""}),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles()}get dom(){return this.container}get contentDOM(){return this.contentElement}update(t,e,n){return t.type!==this.node.type?!1:(this.node=t,this.onUpdate?this.onUpdate(t,e,n):!0)}destroy(){this.isResizing&&(this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.container.remove()}createContainer(){const t=document.createElement("div");return t.dataset.resizeContainer="",t.dataset.node=this.node.type.name,t.style.display="flex",t.style.justifyContent="flex-start",t.style.alignItems="flex-start",this.classNames.container&&(t.className=this.classNames.container),t.appendChild(this.wrapper),t}createWrapper(){const t=document.createElement("div");return t.style.position="relative",t.style.display="block",t.dataset.resizeWrapper="",this.classNames.wrapper&&(t.className=this.classNames.wrapper),t.appendChild(this.element),t}createHandle(t){const e=document.createElement("div");return e.dataset.resizeHandle=t,e.style.position="absolute",this.classNames.handle&&(e.className=this.classNames.handle),e}positionHandle(t,e){const n=e.includes("top"),r=e.includes("bottom"),i=e.includes("left"),s=e.includes("right");n&&(t.style.top="0"),r&&(t.style.bottom="0"),i&&(t.style.left="0"),s&&(t.style.right="0"),(e==="top"||e==="bottom")&&(t.style.left="0",t.style.right="0"),(e==="left"||e==="right")&&(t.style.top="0",t.style.bottom="0")}attachHandles(){this.directions.forEach(t=>{const e=this.createHandle(t);this.positionHandle(e,t),e.addEventListener("mousedown",n=>this.handleResizeStart(n,t)),e.addEventListener("touchstart",n=>this.handleResizeStart(n,t)),this.wrapper.appendChild(e)})}applyInitialSize(){const t=this.node.attrs.width,e=this.node.attrs.height;t?(this.element.style.width=`${t}px`,this.initialWidth=t):this.initialWidth=this.element.offsetWidth,e?(this.element.style.height=`${e}px`,this.initialHeight=e):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(t,e){t.preventDefault(),t.stopPropagation(),this.isResizing=!0,this.activeHandle=e,iX(t)?(this.startX=t.touches[0].clientX,this.startY=t.touches[0].clientY):(this.startX=t.clientX,this.startY=t.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight),this.getPos(),this.container.dataset.resizeState="true",this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("touchmove",this.handleTouchMove),document.addEventListener("mouseup",this.handleMouseUp),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}handleResize(t,e){if(!this.activeHandle)return;const n=this.preserveAspectRatio||this.isShiftKeyPressed,{width:r,height:i}=this.calculateNewDimensions(this.activeHandle,t,e),s=this.applyConstraints(r,i,n);this.element.style.width=`${s.width}px`,this.element.style.height=`${s.height}px`,this.onResize&&this.onResize(s.width,s.height)}calculateNewDimensions(t,e,n){let r=this.startWidth,i=this.startHeight;const s=t.includes("right"),o=t.includes("left"),a=t.includes("bottom"),l=t.includes("top");return s?r=this.startWidth+e:o&&(r=this.startWidth-e),a?i=this.startHeight+n:l&&(i=this.startHeight-n),(t==="right"||t==="left")&&(r=this.startWidth+(s?e:-e)),(t==="top"||t==="bottom")&&(i=this.startHeight+(a?n:-n)),this.preserveAspectRatio||this.isShiftKeyPressed?this.applyAspectRatio(r,i,t):{width:r,height:i}}applyConstraints(t,e,n){var r,i,s,o;if(!n){let c=Math.max(this.minSize.width,t),u=Math.max(this.minSize.height,e);return(r=this.maxSize)!=null&&r.width&&(c=Math.min(this.maxSize.width,c)),(i=this.maxSize)!=null&&i.height&&(u=Math.min(this.maxSize.height,u)),{width:c,height:u}}let a=t,l=e;return athis.maxSize.width&&(a=this.maxSize.width,l=a/this.aspectRatio),(o=this.maxSize)!=null&&o.height&&l>this.maxSize.height&&(l=this.maxSize.height,a=l*this.aspectRatio),{width:a,height:l}}applyAspectRatio(t,e,n){return n==="left"||n==="right"?{width:t,height:t/this.aspectRatio}:n==="top"||n==="bottom"?{width:e*this.aspectRatio,height:e}:{width:t,height:t/this.aspectRatio}}};function oX(t,e){const{selection:n}=t,{$from:r}=n;if(n instanceof pe){const s=r.index();return r.parent.canReplaceWith(s,s+1,e)}let i=r.depth;for(;i>=0;){const s=r.index(i);if(r.node(i).contentMatchAt(s).matchType(e))return!0;i-=1}return!1}var aX={};KE(aX,{createAtomBlockMarkdownSpec:()=>lX,createBlockMarkdownSpec:()=>cX,createInlineMarkdownSpec:()=>dX,parseAttributes:()=>av,parseIndentedBlocks:()=>Sy,renderNestedMarkdownContent:()=>cv,serializeAttributes:()=>lv});function av(t){if(!(t!=null&&t.trim()))return{};const e={},n=[],r=t.replace(/["']([^"']*)["']/g,l=>(n.push(l),`__QUOTED_${n.length-1}__`)),i=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(i){const l=i.map(c=>c.trim().slice(1));e.class=l.join(" ")}const s=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);s&&(e.id=s[1]);const o=/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g;Array.from(r.matchAll(o)).forEach(([,l,c])=>{var u;const h=parseInt(((u=c.match(/__QUOTED_(\d+)__/))==null?void 0:u[1])||"0",10),d=n[h];d&&(e[l]=d.slice(1,-1))});const a=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return a&&a.split(/\s+/).filter(Boolean).forEach(l=>{l.match(/^[a-zA-Z][\w-]*$/)&&(e[l]=!0)}),e}function lv(t){if(!t||Object.keys(t).length===0)return"";const e=[];return t.class&&String(t.class).split(/\s+/).filter(Boolean).forEach(n=>e.push(`.${n}`)),t.id&&e.push(`#${t.id}`),Object.entries(t).forEach(([n,r])=>{n==="class"||n==="id"||(r===!0?e.push(n):r!==!1&&r!=null&&e.push(`${n}="${String(r)}"`))}),e.join(" ")}function lX(t){const{nodeName:e,name:n,parseAttributes:r=av,serializeAttributes:i=lv,defaultAttributes:s={},requiredAttributes:o=[],allowedAttributes:a}=t,l=n||e,c=u=>{if(!a)return u;const h={};return a.forEach(d=>{d in u&&(h[d]=u[d])}),h};return{parseMarkdown:(u,h)=>{const d={...s,...u.attributes};return h.createNode(e,d,[])},markdownTokenizer:{name:e,level:"block",start(u){var h;const d=new RegExp(`^:::${l}(?:\\s|$)`,"m"),p=(h=u.match(d))==null?void 0:h.index;return p!==void 0?p:-1},tokenize(u,h,d){const p=new RegExp(`^:::${l}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),f=u.match(p);if(!f)return;const m=f[1]||"",g=r(m);if(!o.find(y=>!(y in g)))return{type:e,raw:f[0],attributes:g}}},renderMarkdown:u=>{const h=c(u.attrs||{}),d=i(h),p=d?` {${d}}`:"";return`:::${l}${p} :::`}}}function cX(t){const{nodeName:e,name:n,getContent:r,parseAttributes:i=av,serializeAttributes:s=lv,defaultAttributes:o={},content:a="block",allowedAttributes:l}=t,c=n||e,u=h=>{if(!l)return h;const d={};return l.forEach(p=>{p in h&&(d[p]=h[p])}),d};return{parseMarkdown:(h,d)=>{let p;if(r){const m=r(h);p=typeof m=="string"?[{type:"text",text:m}]:m}else a==="block"?p=d.parseChildren(h.tokens||[]):p=d.parseInline(h.tokens||[]);const f={...o,...h.attributes};return d.createNode(e,f,p)},markdownTokenizer:{name:e,level:"block",start(h){var d;const p=new RegExp(`^:::${c}`,"m"),f=(d=h.match(p))==null?void 0:d.index;return f!==void 0?f:-1},tokenize(h,d,p){var f;const m=new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),g=h.match(m);if(!g)return;const[y,b=""]=g,T=i(b);let S=1;const w=y.length;let A="";const C=/^:::([\w-]*)(\s.*)?/gm,N=h.slice(w);for(C.lastIndex=0;;){const $=C.exec(N);if($===null)break;const I=$.index,L=$[1];if(!((f=$[2])!=null&&f.endsWith(":::"))){if(L)S+=1;else if(S-=1,S===0){const Z=N.slice(0,I);A=Z.trim();const B=h.slice(0,w+I+$[0].length);let j=[];if(A)if(a==="block")for(j=p.blockTokens(Z),j.forEach(U=>{U.text&&(!U.tokens||U.tokens.length===0)&&(U.tokens=p.inlineTokens(U.text))});j.length>0;){const U=j[j.length-1];if(U.type==="paragraph"&&(!U.text||U.text.trim()===""))j.pop();else break}else j=p.inlineTokens(A);return{type:e,raw:B,attributes:T,content:A,tokens:j}}}}}},renderMarkdown:(h,d)=>{const p=u(h.attrs||{}),f=s(p),m=f?` {${f}}`:"",g=d.renderChildren(h.content||[],` `);return`:::${c}${m} ${g} :::`}}}function uX(t){if(!t.trim())return{};const e={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=n.exec(t);for(;r!==null;){const[,i,s,o]=r;e[i]=s||o,r=n.exec(t)}return e}function hX(t){return Object.entries(t).filter(([,e])=>e!=null).map(([e,n])=>`${e}="${n}"`).join(" ")}function dX(t){const{nodeName:e,name:n,getContent:r,parseAttributes:i=uX,serializeAttributes:s=hX,defaultAttributes:o={},selfClosing:a=!1,allowedAttributes:l}=t,c=n||e,u=d=>{if(!l)return d;const p={};return l.forEach(f=>{f in d&&(p[f]=d[f])}),p},h=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(d,p)=>{const f={...o,...d.attributes};if(a)return p.createNode(e,f);const m=r?r(d):d.content||"";return m?p.createNode(e,f,[p.createTextNode(m)]):p.createNode(e,f,[])},markdownTokenizer:{name:e,level:"inline",start(d){const p=a?new RegExp(`\\[${h}\\s*[^\\]]*\\]`):new RegExp(`\\[${h}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${h}\\]`),f=d.match(p),m=f==null?void 0:f.index;return m!==void 0?m:-1},tokenize(d,p,f){const m=a?new RegExp(`^\\[${h}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${h}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${h}\\]`),g=d.match(m);if(!g)return;let y="",b="";if(a){const[,S]=g;b=S}else{const[,S,w]=g;b=S,y=w||""}const T=i(b.trim());return{type:e,raw:g[0],content:y.trim(),attributes:T}}},renderMarkdown:d=>{let p="";r?p=r(d):d.content&&d.content.length>0&&(p=d.content.filter(y=>y.type==="text").map(y=>y.text).join(""));const f=u(d.attrs||{}),m=s(f),g=m?` ${m}`:"";return a?`[${c}${g}]`:`[${c}${g}]${p}[/${c}]`}}}function Sy(t,e,n){var r,i,s,o;const a=t.split(` `),l=[];let c="",u=0;const h=e.baseIndentSize||2;for(;u0)break;if(d.trim()===""){u+=1,c=`${c}${d} `;continue}else return}const f=e.extractItemData(p),{indentLevel:m,mainContent:g}=f;c=`${c}${d} `;const y=[g];for(u+=1;uC.trim()!=="");if(A===-1)break;if((((i=(r=a[u+1+A].match(/^(\s*)/))==null?void 0:r[1])==null?void 0:i.length)||0)>m){y.push(w),c=`${c}${w} `,u+=1;continue}else break}if((((o=(s=w.match(/^(\s*)/))==null?void 0:s[1])==null?void 0:o.length)||0)>m)y.push(w),c=`${c}${w} `,u+=1;else break}let b;const T=y.slice(1);if(T.length>0){const w=T.map(A=>A.slice(m+h)).join(` `);w.trim()&&(e.customNestedParser?b=e.customNestedParser(w):b=n.blockTokens(w))}const S=e.createToken(f,b);l.push(S)}if(l.length!==0)return{items:l,raw:c}}function cv(t,e,n,r){if(!t||!Array.isArray(t.content))return"";const i=typeof n=="function"?n(r):n,[s,...o]=t.content,a=e.renderChildren([s]),l=[`${i}${a}`];return o&&o.length>0&&o.forEach(c=>{const u=e.renderChildren([c]);if(u){const h=u.split(` `).map(d=>d?e.indent(d):"").join(` `);l.push(h)}}),l.join(` `)}function pX(t,e,n={}){const{state:r}=e,{doc:i,tr:s}=r,o=t;i.descendants((a,l)=>{const c=s.mapping.map(l),u=s.mapping.map(l)+a.nodeSize;let h=null;if(a.marks.forEach(p=>{if(p!==o)return!1;h=p}),!h)return;let d=!1;if(Object.keys(n).forEach(p=>{n[p]!==h.attrs[p]&&(d=!0)}),d){const p=t.type.create({...t.attrs,...n});s.removeMark(c,u,t.type),s.addMark(c,u,p)}}),s.docChanged&&e.view.dispatch(s)}var xt=class pR extends ov{constructor(){super(...arguments),this.type="node"}static create(e={}){const n=typeof e=="function"?e():e;return new pR(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}};function Hs(t){return new ZH({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:i})=>{const s=qe(t.getAttributes,void 0,r,i);if(s===!1||s===null)return null;const{tr:o}=e,a=r[r.length-1],l=r[0];let c=n.to;if(a){const u=l.search(/\S/),h=n.from+l.indexOf(a),d=h+a.length;if(sv(n.from,n.to,e.doc).filter(p=>p.mark.type.excluded.find(f=>f===t.type&&f!==p.mark.type)).filter(p=>p.to>h).length)return null;dn.from&&o.delete(n.from+u,h),c=n.from+u+a.length,o.addMark(n.from+u,c,t.type.create(s||{})),o.removeStoredMark(t.type)}}})}var pk,fk;function fX(){return fk||(fk=1,pk=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,i,s;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!t(e[i],n[i]))return!1;return!0}if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(i of e.entries())if(!n.has(i[0]))return!1;for(i of e.entries())if(!t(i[1],n.get(i[0])))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(i of e.entries())if(!n.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(n)){if(r=e.length,r!=n.length)return!1;for(i=r;i--!==0;)if(e[i]!==n[i])return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(s=Object.keys(e),r=s.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[i]))return!1;for(i=r;i--!==0;){var o=s[i];if(!(o==="_owner"&&e.$$typeof)&&!t(e[o],n[o]))return!1}return!0}return e!==e&&n!==n}),pk}var mX=fX();const gX=$f(mX);var mk={exports:{}},Ag={},gk;function OX(){if(gk)return Ag;gk=1;var t=Ne,e=sP();function n(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var r=typeof Object.is=="function"?Object.is:n,i=e.useSyncExternalStore,s=t.useRef,o=t.useEffect,a=t.useMemo,l=t.useDebugValue;return Ag.useSyncExternalStoreWithSelector=function(c,u,h,d,p){var f=s(null);if(f.current===null){var m={hasValue:!1,value:null};f.current=m}else m=f.current;f=a(function(){function y(A){if(!b){if(b=!0,T=A,A=d(A),p!==void 0&&m.hasValue){var C=m.value;if(p(C,A))return S=C}return S=A}if(C=S,r(T,A))return C;var N=d(A);return p!==void 0&&p(C,N)?(T=A,C):(T=A,S=N)}var b=!1,T,S,w=h===void 0?null:h;return[function(){return y(u())},w===null?void 0:function(){return y(w())}]},[u,h,d,p]);var g=i(c,f[0],f[1]);return o(function(){m.hasValue=!0,m.value=g},[g]),l(g),g},Ag}var Ok;function yX(){return Ok||(Ok=1,mk.exports=OX()),mk.exports}var bX=yX(),EX=(...t)=>e=>{t.forEach(n=>{typeof n=="function"?n(e):n&&(n.current=e)})},vX=({contentComponent:t})=>{const e=oP.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return E.jsx(E.Fragment,{children:Object.values(e)})};function TX(){const t=new Set;let e={};return{subscribe(n){return t.add(n),()=>{t.delete(n)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(n,r){e={...e,[n]:iA.createPortal(r.reactElement,r.element,n)},t.forEach(i=>i())},removeRenderer(n){const r={...e};delete r[n],e=r,t.forEach(i=>i())}}}var SX=class extends Ne.Component{constructor(t){var e;super(t),this.editorContentRef=Ne.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!((e=t.editor)!=null&&e.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const t=this.props.editor;if(t&&!t.isDestroyed&&t.options.element){if(t.contentComponent)return;const e=this.editorContentRef.current;e.append(t.view.dom),t.setOptions({element:e}),t.contentComponent=TX(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=t.contentComponent.subscribe(()=>{this.setState(n=>n.hasContentComponentInitialized?n:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),t.createNodeViews(),this.initialized=!0}}componentWillUnmount(){var t;const e=this.props.editor;if(e){this.initialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),e.contentComponent=null;try{if(!((t=e.view.dom)!=null&&t.firstChild))return;const n=document.createElement("div");n.append(e.view.dom),e.setOptions({element:n})}catch{}}}render(){const{editor:t,innerRef:e,...n}=this.props;return E.jsxs(E.Fragment,{children:[E.jsx("div",{ref:EX(e,this.editorContentRef),...n}),(t==null?void 0:t.contentComponent)&&E.jsx(vX,{contentComponent:t.contentComponent})]})}},wX=v.forwardRef((t,e)=>{const n=Ne.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return Ne.createElement(SX,{key:n,innerRef:e,...t})}),kX=Ne.memo(wX),_X=typeof window<"u"?v.useLayoutEffect:v.useEffect,xX=class{constructor(t){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=t,this.lastSnapshot={editor:t,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(t){return this.subscribers.add(t),()=>{this.subscribers.delete(t)}}watch(t){if(this.editor=t,this.editor){const e=()=>{this.transactionNumber+=1,this.subscribers.forEach(r=>r())},n=this.editor;return n.on("transaction",e),()=>{n.off("transaction",e)}}}};function Ue(t){var e;const[n]=v.useState(()=>new xX(t.editor)),r=bX.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,t.selector,(e=t.equalityFn)!=null?e:gX);return _X(()=>n.watch(t.editor),[t.editor,n]),v.useDebugValue(r),r}var CX=!1,wy=typeof window>"u",DX=wy||!!(typeof window<"u"&&window.next),AX=class fR{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){return this.options.current.immediatelyRender===void 0?wy||DX?null:this.createEditor():(this.options.current.immediatelyRender,this.options.current.immediatelyRender?this.createEditor():null)}createEditor(){const e={...this.options.current,onBeforeCreate:(...n)=>{var r,i;return(i=(r=this.options.current).onBeforeCreate)==null?void 0:i.call(r,...n)},onBlur:(...n)=>{var r,i;return(i=(r=this.options.current).onBlur)==null?void 0:i.call(r,...n)},onCreate:(...n)=>{var r,i;return(i=(r=this.options.current).onCreate)==null?void 0:i.call(r,...n)},onDestroy:(...n)=>{var r,i;return(i=(r=this.options.current).onDestroy)==null?void 0:i.call(r,...n)},onFocus:(...n)=>{var r,i;return(i=(r=this.options.current).onFocus)==null?void 0:i.call(r,...n)},onSelectionUpdate:(...n)=>{var r,i;return(i=(r=this.options.current).onSelectionUpdate)==null?void 0:i.call(r,...n)},onTransaction:(...n)=>{var r,i;return(i=(r=this.options.current).onTransaction)==null?void 0:i.call(r,...n)},onUpdate:(...n)=>{var r,i;return(i=(r=this.options.current).onUpdate)==null?void 0:i.call(r,...n)},onContentError:(...n)=>{var r,i;return(i=(r=this.options.current).onContentError)==null?void 0:i.call(r,...n)},onDrop:(...n)=>{var r,i;return(i=(r=this.options.current).onDrop)==null?void 0:i.call(r,...n)},onPaste:(...n)=>{var r,i;return(i=(r=this.options.current).onPaste)==null?void 0:i.call(r,...n)},onDelete:(...n)=>{var r,i;return(i=(r=this.options.current).onDelete)==null?void 0:i.call(r,...n)}};return new rX(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,n){return Object.keys(e).every(r=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(r)?!0:r==="extensions"&&e.extensions&&n.extensions?e.extensions.length!==n.extensions.length?!1:e.extensions.every((i,s)=>{var o;return i===((o=n.extensions)==null?void 0:o[s])}):e[r]===n[r])}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?fR.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((n,r)=>n===e[r]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function PX(t={},e=[]){const n=v.useRef(t);n.current=t;const[r]=v.useState(()=>new AX(n)),i=oP.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return v.useDebugValue(i),v.useEffect(r.onRender(e)),Ue({editor:i,selector:({transactionNumber:s})=>t.shouldRerenderOnTransaction===!1||t.shouldRerenderOnTransaction===void 0?null:t.immediatelyRender&&s===0?0:s+1}),i}var NX=v.createContext({editor:null});NX.Consumer;var RX=v.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),MX=()=>v.useContext(RX);Ne.forwardRef((t,e)=>{const{onDragStart:n}=MX(),r=t.as||"div";return E.jsx(r,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})});Ne.createContext({markViewContentRef:()=>{}});const Vi=Ne.forwardRef(({className:t,children:e,type:n="button",variant:r="primary",iconOnly:i,slotBefore:s,slotAfter:o,...a},l)=>{const c=bn("rte-button",`rte-button--${r}`,i&&"rte-button--icon-only",t);return E.jsxs("button",{ref:l,type:n,className:c,...a,children:[!i&&s,e&&(i||!o&&!s?e:E.jsx("span",{className:"rte-button__text",children:e})),!i&&o]})});Vi.displayName="Button";function mR(t){const e=t+"CollectionProvider",[n,r]=Ys(e),[i,s]=n(e,{collectionRef:{current:null},itemMap:new Map}),o=m=>{const{scope:g,children:y}=m,b=Ne.useRef(null),T=Ne.useRef(new Map).current;return E.jsx(i,{scope:g,itemMap:T,collectionRef:b,children:y})};o.displayName=e;const a=t+"CollectionSlot",l=Ba(a),c=Ne.forwardRef((m,g)=>{const{scope:y,children:b}=m,T=s(a,y),S=_t(g,T.collectionRef);return E.jsx(l,{ref:S,children:b})});c.displayName=a;const u=t+"CollectionItemSlot",h="data-radix-collection-item",d=Ba(u),p=Ne.forwardRef((m,g)=>{const{scope:y,children:b,...T}=m,S=Ne.useRef(null),w=_t(g,S),A=s(u,y);return Ne.useEffect(()=>(A.itemMap.set(S,{ref:S,...T}),()=>void A.itemMap.delete(S))),E.jsx(d,{[h]:"",ref:w,children:b})});p.displayName=u;function f(m){const g=s(t+"CollectionConsumer",m);return Ne.useCallback(()=>{const y=g.collectionRef.current;if(!y)return[];const b=Array.from(y.querySelectorAll(`[${h}]`));return Array.from(g.itemMap.values()).sort((T,S)=>b.indexOf(T.ref.current)-b.indexOf(S.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:o,Slot:c,ItemSlot:p},f,r]}var IX=v.createContext(void 0);function gR(t){const e=v.useContext(IX);return t||e||"ltr"}var Pg="rovingFocusGroup.onEntryFocus",LX={bubbles:!1,cancelable:!0},Bu="RovingFocusGroup",[ky,OR,QX]=mR(Bu),[$X,yR]=Ys(Bu,[QX]),[FX,BX]=$X(Bu),bR=v.forwardRef((t,e)=>E.jsx(ky.Provider,{scope:t.__scopeRovingFocusGroup,children:E.jsx(ky.Slot,{scope:t.__scopeRovingFocusGroup,children:E.jsx(jX,{...t,ref:e})})}));bR.displayName=Bu;var jX=v.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:s,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...h}=t,d=v.useRef(null),p=_t(e,d),f=gR(s),[m,g]=Iu({prop:o,defaultProp:a??null,onChange:l,caller:Bu}),[y,b]=v.useState(!1),T=Wi(c),S=OR(n),w=v.useRef(!1),[A,C]=v.useState(0);return v.useEffect(()=>{const N=d.current;if(N)return N.addEventListener(Pg,T),()=>N.removeEventListener(Pg,T)},[T]),E.jsx(FX,{scope:n,orientation:r,dir:f,loop:i,currentTabStopId:m,onItemFocus:v.useCallback(N=>g(N),[g]),onItemShiftTab:v.useCallback(()=>b(!0),[]),onFocusableItemAdd:v.useCallback(()=>C(N=>N+1),[]),onFocusableItemRemove:v.useCallback(()=>C(N=>N-1),[]),children:E.jsx(pt.div,{tabIndex:y||A===0?-1:0,"data-orientation":r,...h,ref:p,style:{outline:"none",...t.style},onMouseDown:ve(t.onMouseDown,()=>{w.current=!0}),onFocus:ve(t.onFocus,N=>{const $=!w.current;if(N.target===N.currentTarget&&$&&!y){const I=new CustomEvent(Pg,LX);if(N.currentTarget.dispatchEvent(I),!I.defaultPrevented){const L=S().filter(U=>U.focusable),Z=L.find(U=>U.active),B=L.find(U=>U.id===m),j=[Z,B,...L].filter(Boolean).map(U=>U.ref.current);TR(j,u)}}w.current=!1}),onBlur:ve(t.onBlur,()=>b(!1))})})}),ER="RovingFocusGroupItem",vR=v.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:s,children:o,...a}=t,l=Is(),c=s||l,u=BX(ER,n),h=u.currentTabStopId===c,d=OR(n),{onFocusableItemAdd:p,onFocusableItemRemove:f,currentTabStopId:m}=u;return v.useEffect(()=>{if(r)return p(),()=>f()},[r,p,f]),E.jsx(ky.ItemSlot,{scope:n,id:c,focusable:r,active:i,children:E.jsx(pt.span,{tabIndex:h?0:-1,"data-orientation":u.orientation,...a,ref:e,onMouseDown:ve(t.onMouseDown,g=>{r?u.onItemFocus(c):g.preventDefault()}),onFocus:ve(t.onFocus,()=>u.onItemFocus(c)),onKeyDown:ve(t.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){u.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const y=UX(g,u.orientation,u.dir);if(y!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let b=d().filter(T=>T.focusable).map(T=>T.ref.current);if(y==="last")b.reverse();else if(y==="prev"||y==="next"){y==="prev"&&b.reverse();const T=b.indexOf(g.currentTarget);b=u.loop?HX(b,T+1):b.slice(T+1)}setTimeout(()=>TR(b))}}),children:typeof o=="function"?o({isCurrentTabStop:h,hasTabStop:m!=null}):o})})});vR.displayName=ER;var zX={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function VX(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function UX(t,e,n){const r=VX(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return zX[r]}function TR(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function HX(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var XX=bR,qX=vR,_y=["Enter"," "],ZX=["ArrowDown","PageUp","Home"],SR=["ArrowUp","PageDown","End"],WX=[...ZX,...SR],GX={ltr:[..._y,"ArrowRight"],rtl:[..._y,"ArrowLeft"]},YX={ltr:["ArrowLeft"],rtl:["ArrowRight"]},ju="Menu",[nu,KX,JX]=mR(ju),[Ko,wR]=Ys(ju,[JX,ml,yR]),Jf=ml(),kR=yR(),[e4,Ol]=Ko(ju),[t4,zu]=Ko(ju),_R=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:i,onOpenChange:s,modal:o=!0}=t,a=Jf(e),[l,c]=v.useState(null),u=v.useRef(!1),h=Wi(s),d=gR(i);return v.useEffect(()=>{const p=()=>{u.current=!0,document.addEventListener("pointerdown",f,{capture:!0,once:!0}),document.addEventListener("pointermove",f,{capture:!0,once:!0})},f=()=>u.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",f,{capture:!0}),document.removeEventListener("pointermove",f,{capture:!0})}},[]),E.jsx(CE,{...a,children:E.jsx(e4,{scope:e,open:n,onOpenChange:h,content:l,onContentChange:c,children:E.jsx(t4,{scope:e,onClose:v.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:u,dir:d,modal:o,children:r})})})};_R.displayName=ju;var n4="MenuAnchor",uv=v.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,i=Jf(n);return E.jsx(Rf,{...i,...r,ref:e})});uv.displayName=n4;var r4="MenuPortal",[iye,xR]=Ko(r4,{forceMount:void 0}),pr="MenuContent",[i4,hv]=Ko(pr),CR=v.forwardRef((t,e)=>{const n=xR(pr,t.__scopeMenu),{forceMount:r=n.forceMount,...i}=t,s=Ol(pr,t.__scopeMenu),o=zu(pr,t.__scopeMenu);return E.jsx(nu.Provider,{scope:t.__scopeMenu,children:E.jsx(fi,{present:r||s.open,children:E.jsx(nu.Slot,{scope:t.__scopeMenu,children:o.modal?E.jsx(s4,{...i,ref:e}):E.jsx(o4,{...i,ref:e})})})})}),s4=v.forwardRef((t,e)=>{const n=Ol(pr,t.__scopeMenu),r=v.useRef(null),i=_t(e,r);return v.useEffect(()=>{const s=r.current;if(s)return NE(s)},[]),E.jsx(dv,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ve(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),o4=v.forwardRef((t,e)=>{const n=Ol(pr,t.__scopeMenu);return E.jsx(dv,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),a4=Ba("MenuContent.ScrollLock"),dv=v.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:h,onInteractOutside:d,onDismiss:p,disableOutsideScroll:f,...m}=t,g=Ol(pr,n),y=zu(pr,n),b=Jf(n),T=kR(n),S=KX(n),[w,A]=v.useState(null),C=v.useRef(null),N=_t(e,C,g.onContentChange),$=v.useRef(0),I=v.useRef(""),L=v.useRef(0),Z=v.useRef(null),B=v.useRef("right"),j=v.useRef(0),U=f?If:v.Fragment,J=f?{as:a4,allowPinchZoom:!0}:void 0,fe=ne=>{var Ge,Qr;const Oe=I.current+ne,He=S().filter(mt=>!mt.disabled),it=document.activeElement,Le=(Ge=He.find(mt=>mt.ref.current===it))==null?void 0:Ge.textValue,Xe=He.map(mt=>mt.textValue),vt=b4(Xe,Oe,Le),An=(Qr=He.find(mt=>mt.textValue===vt))==null?void 0:Qr.ref.current;(function mt(Jn){I.current=Jn,window.clearTimeout($.current),Jn!==""&&($.current=window.setTimeout(()=>mt(""),1e3))})(Oe),An&&setTimeout(()=>An.focus())};v.useEffect(()=>()=>window.clearTimeout($.current),[]),yE();const z=v.useCallback(ne=>{var Oe,He;return B.current===((Oe=Z.current)==null?void 0:Oe.side)&&v4(ne,(He=Z.current)==null?void 0:He.area)},[]);return E.jsx(i4,{scope:n,searchRef:I,onItemEnter:v.useCallback(ne=>{z(ne)&&ne.preventDefault()},[z]),onItemLeave:v.useCallback(ne=>{var Oe;z(ne)||((Oe=C.current)==null||Oe.focus(),A(null))},[z]),onTriggerLeave:v.useCallback(ne=>{z(ne)&&ne.preventDefault()},[z]),pointerGraceTimerRef:L,onPointerGraceIntentChange:v.useCallback(ne=>{Z.current=ne},[]),children:E.jsx(U,{...J,children:E.jsx(Cf,{asChild:!0,trapped:i,onMountAutoFocus:ve(s,ne=>{var Oe;ne.preventDefault(),(Oe=C.current)==null||Oe.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:E.jsx(Ru,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:h,onInteractOutside:d,onDismiss:p,children:E.jsx(XX,{asChild:!0,...T,dir:y.dir,orientation:"vertical",loop:r,currentTabStopId:w,onCurrentTabStopIdChange:A,onEntryFocus:ve(l,ne=>{y.isUsingKeyboardRef.current||ne.preventDefault()}),preventScrollOnEntryFocus:!0,children:E.jsx(DE,{role:"menu","aria-orientation":"vertical","data-state":UR(g.open),"data-radix-menu-content":"",dir:y.dir,...b,...m,ref:N,style:{outline:"none",...m.style},onKeyDown:ve(m.onKeyDown,ne=>{const Oe=ne.target.closest("[data-radix-menu-content]")===ne.currentTarget,He=ne.ctrlKey||ne.altKey||ne.metaKey,it=ne.key.length===1;Oe&&(ne.key==="Tab"&&ne.preventDefault(),!He&&it&&fe(ne.key));const Le=C.current;if(ne.target!==Le||!WX.includes(ne.key))return;ne.preventDefault();const Xe=S().filter(vt=>!vt.disabled).map(vt=>vt.ref.current);SR.includes(ne.key)&&Xe.reverse(),O4(Xe)}),onBlur:ve(t.onBlur,ne=>{ne.currentTarget.contains(ne.target)||(window.clearTimeout($.current),I.current="")}),onPointerMove:ve(t.onPointerMove,ru(ne=>{const Oe=ne.target,He=j.current!==ne.clientX;if(ne.currentTarget.contains(Oe)&&He){const it=ne.clientX>j.current?"right":"left";B.current=it,j.current=ne.clientX}}))})})})})})})});CR.displayName=pr;var l4="MenuGroup",pv=v.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return E.jsx(pt.div,{role:"group",...r,ref:e})});pv.displayName=l4;var c4="MenuLabel",DR=v.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return E.jsx(pt.div,{...r,ref:e})});DR.displayName=c4;var hp="MenuItem",yk="menu.itemSelect",em=v.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...i}=t,s=v.useRef(null),o=zu(hp,t.__scopeMenu),a=hv(hp,t.__scopeMenu),l=_t(e,s),c=v.useRef(!1),u=()=>{const h=s.current;if(!n&&h){const d=new CustomEvent(yk,{bubbles:!0,cancelable:!0});h.addEventListener(yk,p=>r==null?void 0:r(p),{once:!0}),lA(h,d),d.defaultPrevented?c.current=!1:o.onClose()}};return E.jsx(AR,{...i,ref:l,disabled:n,onClick:ve(t.onClick,u),onPointerDown:h=>{var d;(d=t.onPointerDown)==null||d.call(t,h),c.current=!0},onPointerUp:ve(t.onPointerUp,h=>{var d;c.current||((d=h.currentTarget)==null||d.click())}),onKeyDown:ve(t.onKeyDown,h=>{const d=a.searchRef.current!=="";n||d&&h.key===" "||_y.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})});em.displayName=hp;var AR=v.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...s}=t,o=hv(hp,n),a=kR(n),l=v.useRef(null),c=_t(e,l),[u,h]=v.useState(!1),[d,p]=v.useState("");return v.useEffect(()=>{const f=l.current;f&&p((f.textContent??"").trim())},[s.children]),E.jsx(nu.ItemSlot,{scope:n,disabled:r,textValue:i??d,children:E.jsx(qX,{asChild:!0,...a,focusable:!r,children:E.jsx(pt.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:c,onPointerMove:ve(t.onPointerMove,ru(f=>{r?o.onItemLeave(f):(o.onItemEnter(f),f.defaultPrevented||f.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ve(t.onPointerLeave,ru(f=>o.onItemLeave(f))),onFocus:ve(t.onFocus,()=>h(!0)),onBlur:ve(t.onBlur,()=>h(!1))})})})}),u4="MenuCheckboxItem",PR=v.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...i}=t;return E.jsx(LR,{scope:t.__scopeMenu,checked:n,children:E.jsx(em,{role:"menuitemcheckbox","aria-checked":dp(n)?"mixed":n,...i,ref:e,"data-state":mv(n),onSelect:ve(i.onSelect,()=>r==null?void 0:r(dp(n)?!0:!n),{checkForDefaultPrevented:!1})})})});PR.displayName=u4;var NR="MenuRadioGroup",[h4,d4]=Ko(NR,{value:void 0,onValueChange:()=>{}}),RR=v.forwardRef((t,e)=>{const{value:n,onValueChange:r,...i}=t,s=Wi(r);return E.jsx(h4,{scope:t.__scopeMenu,value:n,onValueChange:s,children:E.jsx(pv,{...i,ref:e})})});RR.displayName=NR;var MR="MenuRadioItem",IR=v.forwardRef((t,e)=>{const{value:n,...r}=t,i=d4(MR,t.__scopeMenu),s=n===i.value;return E.jsx(LR,{scope:t.__scopeMenu,checked:s,children:E.jsx(em,{role:"menuitemradio","aria-checked":s,...r,ref:e,"data-state":mv(s),onSelect:ve(r.onSelect,()=>{var o;return(o=i.onValueChange)==null?void 0:o.call(i,n)},{checkForDefaultPrevented:!1})})})});IR.displayName=MR;var fv="MenuItemIndicator",[LR,p4]=Ko(fv,{checked:!1}),QR=v.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...i}=t,s=p4(fv,n);return E.jsx(fi,{present:r||dp(s.checked)||s.checked===!0,children:E.jsx(pt.span,{...i,ref:e,"data-state":mv(s.checked)})})});QR.displayName=fv;var f4="MenuSeparator",$R=v.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return E.jsx(pt.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});$R.displayName=f4;var m4="MenuArrow",FR=v.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,i=Jf(n);return E.jsx(AE,{...i,...r,ref:e})});FR.displayName=m4;var g4="MenuSub",[sye,BR]=Ko(g4),rc="MenuSubTrigger",jR=v.forwardRef((t,e)=>{const n=Ol(rc,t.__scopeMenu),r=zu(rc,t.__scopeMenu),i=BR(rc,t.__scopeMenu),s=hv(rc,t.__scopeMenu),o=v.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=s,c={__scopeMenu:t.__scopeMenu},u=v.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return v.useEffect(()=>u,[u]),v.useEffect(()=>{const h=a.current;return()=>{window.clearTimeout(h),l(null)}},[a,l]),E.jsx(uv,{asChild:!0,...c,children:E.jsx(AR,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":UR(n.open),...t,ref:xf(e,i.onTriggerChange),onClick:h=>{var d;(d=t.onClick)==null||d.call(t,h),!(t.disabled||h.defaultPrevented)&&(h.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:ve(t.onPointerMove,ru(h=>{s.onItemEnter(h),!h.defaultPrevented&&!t.disabled&&!n.open&&!o.current&&(s.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:ve(t.onPointerLeave,ru(h=>{var p,f;u();const d=(p=n.content)==null?void 0:p.getBoundingClientRect();if(d){const m=(f=n.content)==null?void 0:f.dataset.side,g=m==="right",y=g?-5:5,b=d[g?"left":"right"],T=d[g?"right":"left"];s.onPointerGraceIntentChange({area:[{x:h.clientX+y,y:h.clientY},{x:b,y:d.top},{x:T,y:d.top},{x:T,y:d.bottom},{x:b,y:d.bottom}],side:m}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(h),h.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:ve(t.onKeyDown,h=>{var p;const d=s.searchRef.current!=="";t.disabled||d&&h.key===" "||GX[r.dir].includes(h.key)&&(n.onOpenChange(!0),(p=n.content)==null||p.focus(),h.preventDefault())})})})});jR.displayName=rc;var zR="MenuSubContent",VR=v.forwardRef((t,e)=>{const n=xR(pr,t.__scopeMenu),{forceMount:r=n.forceMount,...i}=t,s=Ol(pr,t.__scopeMenu),o=zu(pr,t.__scopeMenu),a=BR(zR,t.__scopeMenu),l=v.useRef(null),c=_t(e,l);return E.jsx(nu.Provider,{scope:t.__scopeMenu,children:E.jsx(fi,{present:r||s.open,children:E.jsx(nu.Slot,{scope:t.__scopeMenu,children:E.jsx(dv,{id:a.contentId,"aria-labelledby":a.triggerId,...i,ref:c,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var h;o.isUsingKeyboardRef.current&&((h=l.current)==null||h.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:ve(t.onFocusOutside,u=>{u.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:ve(t.onEscapeKeyDown,u=>{o.onClose(),u.preventDefault()}),onKeyDown:ve(t.onKeyDown,u=>{var p;const h=u.currentTarget.contains(u.target),d=YX[o.dir].includes(u.key);h&&d&&(s.onOpenChange(!1),(p=a.trigger)==null||p.focus(),u.preventDefault())})})})})})});VR.displayName=zR;function UR(t){return t?"open":"closed"}function dp(t){return t==="indeterminate"}function mv(t){return dp(t)?"indeterminate":t?"checked":"unchecked"}function O4(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function y4(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function b4(t,e,n){const r=e.length>1&&Array.from(e).every(a=>a===e[0])?e[0]:e,i=n?t.indexOf(n):-1;let s=y4(t,Math.max(i,0));r.length===1&&(s=s.filter(a=>a!==n));const o=s.find(a=>a.toLowerCase().startsWith(r.toLowerCase()));return o!==n?o:void 0}function E4(t,e){const{x:n,y:r}=t;let i=!1;for(let s=0,o=e.length-1;sr!=d>r&&n<(h-c)*(r-u)/(d-u)+c&&(i=!i)}return i}function v4(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return E4(n,e)}function ru(t){return e=>e.pointerType==="mouse"?t(e):void 0}var T4=_R,S4=uv,w4=CR,k4=pv,_4=DR,x4=em,C4=PR,D4=RR,A4=IR,P4=QR,N4=$R,R4=FR,M4=jR,I4=VR,tm="DropdownMenu",[L4]=Ys(tm,[wR]),$n=wR(),[Q4,HR]=L4(tm),XR=t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:i,defaultOpen:s,onOpenChange:o,modal:a=!0}=t,l=$n(e),c=v.useRef(null),[u,h]=Iu({prop:i,defaultProp:s??!1,onChange:o,caller:tm});return E.jsx(Q4,{scope:e,triggerId:Is(),triggerRef:c,contentId:Is(),open:u,onOpenChange:h,onOpenToggle:v.useCallback(()=>h(d=>!d),[h]),modal:a,children:E.jsx(T4,{...l,open:u,onOpenChange:h,dir:r,modal:a,children:n})})};XR.displayName=tm;var qR="DropdownMenuTrigger",ZR=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=t,s=HR(qR,n),o=$n(n);return E.jsx(S4,{asChild:!0,...o,children:E.jsx(pt.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:xf(e,s.triggerRef),onPointerDown:ve(t.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:ve(t.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});ZR.displayName=qR;var WR="DropdownMenuContent",GR=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=HR(WR,n),s=$n(n),o=v.useRef(!1);return E.jsx(w4,{id:i.contentId,"aria-labelledby":i.triggerId,...s,...r,ref:e,onCloseAutoFocus:ve(t.onCloseAutoFocus,a=>{var l;o.current||((l=i.triggerRef.current)==null||l.focus()),o.current=!1,a.preventDefault()}),onInteractOutside:ve(t.onInteractOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;(!i.modal||u)&&(o.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});GR.displayName=WR;var $4="DropdownMenuGroup",F4=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=$n(n);return E.jsx(k4,{...i,...r,ref:e})});F4.displayName=$4;var B4="DropdownMenuLabel",j4=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=$n(n);return E.jsx(_4,{...i,...r,ref:e})});j4.displayName=B4;var z4="DropdownMenuItem",YR=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=$n(n);return E.jsx(x4,{...i,...r,ref:e})});YR.displayName=z4;var V4="DropdownMenuCheckboxItem",KR=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=$n(n);return E.jsx(C4,{...i,...r,ref:e})});KR.displayName=V4;var U4="DropdownMenuRadioGroup",H4=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=$n(n);return E.jsx(D4,{...i,...r,ref:e})});H4.displayName=U4;var X4="DropdownMenuRadioItem",q4=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=$n(n);return E.jsx(A4,{...i,...r,ref:e})});q4.displayName=X4;var Z4="DropdownMenuItemIndicator",JR=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=$n(n);return E.jsx(P4,{...i,...r,ref:e})});JR.displayName=Z4;var W4="DropdownMenuSeparator",eM=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=$n(n);return E.jsx(N4,{...i,...r,ref:e})});eM.displayName=W4;var G4="DropdownMenuArrow",Y4=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=$n(n);return E.jsx(R4,{...i,...r,ref:e})});Y4.displayName=G4;var K4="DropdownMenuSubTrigger",J4=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=$n(n);return E.jsx(M4,{...i,...r,ref:e})});J4.displayName=K4;var e8="DropdownMenuSubContent",t8=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=$n(n);return E.jsx(I4,{...i,...r,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});t8.displayName=e8;var n8=XR,r8=ZR,tM=GR,nM=YR,rM=KR,i8=JR,iM=eM;const s8=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),o8=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase()),bk=t=>{const e=o8(t);return e.charAt(0).toUpperCase()+e.slice(1)},sM=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim(),a8=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};var l8={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const c8=v.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:o,...a},l)=>v.createElement("svg",{ref:l,...l8,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:sM("lucide",i),...!s&&!a8(a)&&{"aria-hidden":"true"},...a},[...o.map(([c,u])=>v.createElement(c,u)),...Array.isArray(s)?s:[s]])),Se=(t,e)=>{const n=v.forwardRef(({className:r,...i},s)=>v.createElement(c8,{ref:s,iconNode:e,className:sM(`lucide-${s8(bk(t))}`,`lucide-${t}`,r),...i}));return n.displayName=bk(t),n},u8=[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],h8=Se("ban",u8),d8=[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]],p8=Se("bold",d8),f8=[["rect",{width:"18",height:"14",x:"3",y:"5",rx:"2",ry:"2",key:"12ruh7"}],["path",{d:"M7 15h4M15 15h2M7 11h2M13 11h4",key:"1ueiar"}]],m8=Se("captions",f8),g8=[["path",{d:"m2 16 4.039-9.69a.5.5 0 0 1 .923 0L11 16",key:"d5nyq2"}],["path",{d:"M22 9v7",key:"pvm9v3"}],["path",{d:"M3.304 13h6.392",key:"1q3zxz"}],["circle",{cx:"18.5",cy:"12.5",r:"3.5",key:"z97x68"}]],O8=Se("case-sensitive",g8),y8=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],oM=Se("check",y8),b8=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],E8=Se("chevron-down",b8),v8=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]],aM=Se("clipboard",v8),T8=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],Ek=Se("code",T8),S8=[["path",{d:"M14 3a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1",key:"1l7d7l"}],["path",{d:"M19 3a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1",key:"9955pe"}],["path",{d:"m7 15 3 3",key:"4hkfgk"}],["path",{d:"m7 21 3-3H5a2 2 0 0 1-2-2v-2",key:"1xljwe"}],["rect",{x:"14",y:"14",width:"7",height:"7",rx:"1",key:"1cdgtw"}],["rect",{x:"3",y:"3",width:"7",height:"7",rx:"1",key:"zi3rio"}]],w8=Se("combine",S8),k8=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],_8=Se("download",k8),x8=[["path",{d:"M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21",key:"g5wo59"}],["path",{d:"m5.082 11.09 8.828 8.828",key:"1wx5vj"}]],C8=Se("eraser",x8),D8=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],A8=Se("external-link",D8),P8=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],N8=Se("file-code",P8),R8=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],M8=Se("file-text",R8),I8=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],L8=Se("image",I8),Q8=[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]],$8=Se("italic",Q8),F8=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],B8=Se("link",F8),j8=[["path",{d:"M21 5H11",key:"us1j55"}],["path",{d:"M21 12H11",key:"wd7e0v"}],["path",{d:"M21 19H11",key:"saa85w"}],["path",{d:"m7 8-4 4 4 4",key:"o5hrat"}]],z8=Se("list-indent-decrease",j8),V8=[["path",{d:"M21 5H11",key:"us1j55"}],["path",{d:"M21 12H11",key:"wd7e0v"}],["path",{d:"M21 19H11",key:"saa85w"}],["path",{d:"m3 8 4 4-4 4",key:"1a3j6y"}]],U8=Se("list-indent-increase",V8),H8=[["path",{d:"M11 5h10",key:"1cz7ny"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 19h10",key:"11t30w"}],["path",{d:"M4 4h1v5",key:"10yrso"}],["path",{d:"M4 9h2",key:"r1h2o0"}],["path",{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02",key:"xtkcd5"}]],X8=Se("list-ordered",H8),q8=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]],Z8=Se("list-todo",q8),W8=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],G8=Se("list",W8),Y8=[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]],K8=Se("maximize",Y8),J8=[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3",key:"hohbtr"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3",key:"5jw1f3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3",key:"198tvr"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3",key:"ph8mxp"}]],eq=Se("minimize",J8),tq=[["path",{d:"M5 12h14",key:"1ays0h"}]],nq=Se("minus",tq),rq=[["path",{d:"m18 8 4 4-4 4",key:"1ak13k"}],["path",{d:"M2 12h20",key:"9i4pu4"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}]],iq=Se("move-horizontal",rq),sq=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],vk=Se("palette",sq),oq=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],aq=Se("plus",oq),lq=[["path",{d:"M21 7v6h-6",key:"3ptur4"}],["path",{d:"M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7",key:"1kgawr"}]],cq=Se("redo",lq),uq=[["path",{d:"M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z",key:"icamh8"}],["path",{d:"m14.5 12.5 2-2",key:"inckbg"}],["path",{d:"m11.5 9.5 2-2",key:"fmmyf7"}],["path",{d:"m8.5 6.5 2-2",key:"vc6u1g"}],["path",{d:"m17.5 15.5 2-2",key:"wo5hmg"}]],hq=Se("ruler",uq),dq=[["path",{d:"m16 16-4 4-4-4",key:"3dv8je"}],["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"m8 8 4-4 4 4",key:"2bscm2"}]],pq=Se("separator-horizontal",dq),fq=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],mq=Se("square-pen",fq),gq=[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]],Oq=Se("strikethrough",gq),yq=[["path",{d:"m4 5 8 8",key:"1eunvl"}],["path",{d:"m12 5-8 8",key:"1ah0jp"}],["path",{d:"M20 19h-4c0-1.5.44-2 1.5-2.5S20 15.33 20 14c0-.47-.17-.93-.48-1.29a2.11 2.11 0 0 0-2.62-.44c-.42.24-.74.62-.9 1.07",key:"e8ta8j"}]],bq=Se("subscript",yq),Eq=[["path",{d:"m4 19 8-8",key:"hr47gm"}],["path",{d:"m12 19-8-8",key:"1dhhmo"}],["path",{d:"M20 12h-4c0-1.5.442-2 1.5-2.5S20 8.334 20 7.002c0-.472-.17-.93-.484-1.29a2.105 2.105 0 0 0-2.617-.436c-.42.239-.738.614-.899 1.06",key:"1dfcux"}]],vq=Se("superscript",Eq),Tq=[["path",{d:"M14 14v2",key:"w2a1xv"}],["path",{d:"M14 20v2",key:"1lq872"}],["path",{d:"M14 2v2",key:"6buw04"}],["path",{d:"M14 8v2",key:"i67w9a"}],["path",{d:"M2 15h8",key:"82wtch"}],["path",{d:"M2 3h6a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H2",key:"up0l64"}],["path",{d:"M2 9h8",key:"yelfik"}],["path",{d:"M22 15h-4",key:"1es58f"}],["path",{d:"M22 3h-2a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h2",key:"pdjoqf"}],["path",{d:"M22 9h-4",key:"1luja7"}],["path",{d:"M5 3v18",key:"14hmio"}]],Tk=Se("table-columns-split",Tq),Sq=[["path",{d:"M15 3v18",key:"14nvp0"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 9H3",key:"1338ky"}],["path",{d:"M21 15H3",key:"9uk58r"}]],da=Se("table-properties",Sq),wq=[["path",{d:"M14 10h2",key:"1lstlu"}],["path",{d:"M15 22v-8",key:"1fwwgm"}],["path",{d:"M15 2v4",key:"1044rn"}],["path",{d:"M2 10h2",key:"1r8dkt"}],["path",{d:"M20 10h2",key:"1ug425"}],["path",{d:"M3 19h18",key:"awlh7x"}],["path",{d:"M3 22v-6a2 2 135 0 1 2-2h14a2 2 45 0 1 2 2v6",key:"ibqhof"}],["path",{d:"M3 2v2a2 2 45 0 0 2 2h14a2 2 135 0 0 2-2V2",key:"1uenja"}],["path",{d:"M8 10h2",key:"66od0"}],["path",{d:"M9 22v-8",key:"fmnu31"}],["path",{d:"M9 2v4",key:"j1yeou"}]],Sk=Se("table-rows-split",wq),kq=[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]],_q=Se("table",kq),xq=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M17 12H7",key:"16if0g"}],["path",{d:"M19 19H5",key:"vjpgq2"}]],Cq=Se("text-align-center",xq),Dq=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M21 19H7",key:"4cu937"}]],Aq=Se("text-align-end",Dq),Pq=[["path",{d:"M3 5h18",key:"1u36vt"}],["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M3 19h18",key:"awlh7x"}]],Nq=Se("text-align-justify",Pq),Rq=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 19H3",key:"z6ezky"}]],Mq=Se("text-align-start",Rq),Iq=[["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Lq=Se("trash",Iq),Qq=[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]],$q=Se("underline",Qq),Fq=[["path",{d:"M3 7v6h6",key:"1v2h90"}],["path",{d:"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13",key:"1r6uu6"}]],Bq=Se("undo",Fq),jq=[["path",{d:"m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71",key:"yqzxt4"}],["path",{d:"m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71",key:"4qinb0"}],["line",{x1:"8",x2:"8",y1:"2",y2:"5",key:"1041cp"}],["line",{x1:"2",x2:"5",y1:"8",y2:"8",key:"14m1p5"}],["line",{x1:"16",x2:"16",y1:"19",y2:"22",key:"rzdirn"}],["line",{x1:"19",x2:"22",y1:"16",y2:"16",key:"ox905f"}]],zq=Se("unlink",jq),Vq=[["path",{d:"M2.5 17a24.12 24.12 0 0 1 0-10 2 2 0 0 1 1.4-1.4 49.56 49.56 0 0 1 16.2 0A2 2 0 0 1 21.5 7a24.12 24.12 0 0 1 0 10 2 2 0 0 1-1.4 1.4 49.55 49.55 0 0 1-16.2 0A2 2 0 0 1 2.5 17",key:"1q2vi4"}],["path",{d:"m10 15 5-3-5-3z",key:"1jp15x"}]],Uq=Se("youtube",Vq),Hq=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],lM=Se("x",Hq),cM=v.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,...r},i)=>E.jsx("svg",{ref:i,viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",width:e,height:e,fill:t,stroke:"none",...r,children:E.jsx("path",{d:"M15 .5A2.5 2.5 0 0 0 12.5 3v9.5H3a2.5 2.5 0 0 0 0 5h12a2.5 2.5 0 0 0 2.5-2.5V3A2.5 2.5 0 0 0 15 .5z"})}));cM.displayName="IconCorner";const uM=v.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,...r},i)=>E.jsxs("svg",{ref:i,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:e,height:e,fill:"none",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:n,...r,children:[E.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),E.jsx("path",{d:"M8 6.5l-5.5 5.5l5.5 5.5"}),E.jsx("path",{d:"M16 6.5l5.5 5.5l-5.5 5.5"})]}));uM.displayName="IconInlineCode";const hM=v.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,...r},i)=>E.jsxs("svg",{ref:i,viewBox:"0 0 24 24",fill:t,xmlns:"http://www.w3.org/2000/svg",width:e,height:e,...r,children:[E.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),E.jsx("path",{d:"M9 5a2 2 0 0 1 2 2v6c0 3.13 -1.65 5.193 -4.757 5.97a1 1 0 1 1 -.486 -1.94c2.227 -.557 3.243 -1.827 3.243 -4.03v-1h-3a2 2 0 0 1 -1.995 -1.85l-.005 -.15v-3a2 2 0 0 1 2 -2z"}),E.jsx("path",{d:"M18 5a2 2 0 0 1 2 2v6c0 3.13 -1.65 5.193 -4.757 5.97a1 1 0 1 1 -.486 -1.94c2.227 -.557 3.243 -1.827 3.243 -4.03v-1h-3a2 2 0 0 1 -1.995 -1.85l-.005 -.15v-3a2 2 0 0 1 2 -2z"})]}));hM.displayName="IconQuote";const dM=v.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,...r},i)=>E.jsx("svg",{ref:i,viewBox:"0 0 24 24",fill:t,xmlns:"http://www.w3.org/2000/svg",width:e,height:e,...r,children:E.jsx("path",{d:"M11.1 1.65 4.17 19.25H7.03L8.68 14.96H15.72L17.37 19.25H20.23L13.3 1.65H11.1ZM9.56 12.32 12.2 5.28 14.84 12.32H9.56Z",transform:"scale(0.9) translate(0.5,0)"})}));dM.displayName="IconTextColor";const pM=v.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,...r},i)=>E.jsxs("svg",{ref:i,viewBox:"0 0 24 24",fill:t,xmlns:"http://www.w3.org/2000/svg",width:e,height:e,...r,children:[E.jsx("path",{d:"M20.9278 11.1274 10.8774 1.0203l-.1521.1504C9.9678.4215 8.9665 0 7.9017 0H7.9008C6.8259 0 5.8155.4189 4.9563 1.1782c-.7618.76-1.1807 1.7703-1.1807 2.8452 0 1.0649.4147 2.0667 1.164 2.8244L2.4378 9.3496c-.3433.3432-.5328.7998-.5328 1.2836 0 .4855.1878.9404.5293 1.2803l5.4518 5.4972c.3424.3424.7983.5302 1.2807.5302.4858 0 .9416-.1895 1.2849-.5336l6.2994-6.2807 4.1767-.0009v.0017ZM5.0038 4.0285c0-.7724.3012-1.499.85-2.0477.547-.5462 1.273-.8279 2.047-.8279h.0009c.7643 0 1.4792.297 2.0246.8313L5.847 6.0651c-.5369-.5443-.8432-1.2684-.8432-2.0366Zm10.0343 7.3047H3.5344l-.208-.2108c-.1291-.128-.1997-.298-.1997-.479 0-.1827.0715-.3527.2014-.4826l7.5323-7.5323 7.3304 7.3864-1.8442.0008-1.3085 1.3175Z",strokeWidth:"0.3",transform:"translate(0,0)",stroke:t}),E.jsx("path",{d:"M20.2574 13.4086c.3793.5669 1.6379 2.5006 1.6379 3.475 0 1.2034-.979 2.1843-2.1824 2.1843-1.2034 0-2.1824-.979-2.1824-2.1824 0-.9781 1.3012-2.9155 1.6984-3.4844l.5207-.7454.5078.7528Z",transform:"translate(1,1)"})]}));pM.displayName="IconTextHighlight";const Xq={Bold:p8,Italic:$8,Underline:$q,Strike:Oq,Code:Ek,SourceCode:N8,Subscript:bq,Superscript:vq,BulletList:G8,OrderedList:X8,TaskList:Z8,CodeBlock:Ek,CodeInline:uM,Link:B8,Unlink:zq,Edit:mq,ExternalLink:A8,Redo:cq,Undo:Bq,AlignLeft:Mq,AlignRight:Aq,AlignJustify:Nq,AlignCenter:Cq,Eraser:C8,ChevronDown:E8,Maximize:K8,Minimize:eq,HorizontalRule:nq,Indent:U8,Outdent:z8,Clipboard:aM,Check:oM,Quote:hM,Corner:cM,LetterCase:O8,Trash:Lq,Image:L8,ImageCaption:m8,ImageAltText:M8,Download:_8,Youtube:Uq,Close:lM,Ruler:hq,TextHighlight:pM,TextColor:dM,Palette:vk,PaletteOff:vk,Ban:h8,Plus:aq,Table:_q,Stretch:iq,HeaderRow:Sk,HeaderCol:Tk,ColInsertLeft:da,ColInsertRight:da,ColRemove:da,ColHeader:Tk,RowInsertTop:da,RowInsertBottom:da,RowRemove:da,RowHeader:Sk,MergeCell:w8,SplitCell:pq},iu=({name:t,className:e,size:n=20,...r})=>{const i=Xq[t];return E.jsx(i,{size:n,className:bn("rte-icon",e),...r})},qq=n8,Zq=r8,fM=Ne.forwardRef(({className:t,align:e="start",sideOffset:n=4,...r},i)=>E.jsx(tM,{ref:i,align:e,sideOffset:n,className:bn("rte-dropdown",t),...r}));fM.displayName=tM.displayName;const gv=Ne.forwardRef(({className:t,inset:e,...n},r)=>E.jsx(nM,{ref:r,className:bn("rte-dropdown__item",e&&"rte-dropdown-item-inset",t),...n}));gv.displayName=nM.displayName;const Wq=Ne.forwardRef(({className:t,children:e,checked:n,...r},i)=>E.jsxs(rM,{ref:i,className:bn("rte-dropdown__item",t),checked:n,...r,children:[e,E.jsx(i8,{className:"rte-dropdown__icon",children:E.jsx(iu,{name:"Check",size:16})})]}));Wq.displayName=rM.displayName;const Gq=Ne.forwardRef(({className:t,...e},n)=>E.jsx(iM,{ref:n,className:bn("rte-dropdown__separator",t),...e}));Gq.displayName=iM.displayName;const Yq=ij,Kq=sj,Ov=oj,mM=v.forwardRef(({className:t,align:e="start",sideOffset:n=4,...r},i)=>E.jsx(iP,{ref:i,align:e,sideOffset:n,className:bn("rte-popover",t),...r}));mM.displayName=iP.displayName;var Jq=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"}),eZ="VisuallyHidden",gM=v.forwardRef((t,e)=>E.jsx(pt.span,{...t,ref:e,style:{...Jq,...t.style}}));gM.displayName=eZ;var tZ=gM,[nm]=Ys("Tooltip",[ml]),rm=ml(),OM="TooltipProvider",nZ=700,xy="tooltip.open",[rZ,yv]=nm(OM),yM=t=>{const{__scopeTooltip:e,delayDuration:n=nZ,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:s}=t,o=v.useRef(!0),a=v.useRef(!1),l=v.useRef(0);return v.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),E.jsx(rZ,{scope:e,isOpenDelayedRef:o,delayDuration:n,onOpen:v.useCallback(()=>{window.clearTimeout(l.current),o.current=!1},[]),onClose:v.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:v.useCallback(c=>{a.current=c},[]),disableHoverableContent:i,children:s})};yM.displayName=OM;var su="Tooltip",[iZ,Vu]=nm(su),bM=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:i,onOpenChange:s,disableHoverableContent:o,delayDuration:a}=t,l=yv(su,t.__scopeTooltip),c=rm(e),[u,h]=v.useState(null),d=Is(),p=v.useRef(0),f=o??l.disableHoverableContent,m=a??l.delayDuration,g=v.useRef(!1),[y,b]=Iu({prop:r,defaultProp:i??!1,onChange:C=>{C?(l.onOpen(),document.dispatchEvent(new CustomEvent(xy))):l.onClose(),s==null||s(C)},caller:su}),T=v.useMemo(()=>y?g.current?"delayed-open":"instant-open":"closed",[y]),S=v.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g.current=!1,b(!0)},[b]),w=v.useCallback(()=>{window.clearTimeout(p.current),p.current=0,b(!1)},[b]),A=v.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{g.current=!0,b(!0),p.current=0},m)},[m,b]);return v.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),E.jsx(CE,{...c,children:E.jsx(iZ,{scope:e,contentId:d,open:y,stateAttribute:T,trigger:u,onTriggerChange:h,onTriggerEnter:v.useCallback(()=>{l.isOpenDelayedRef.current?A():S()},[l.isOpenDelayedRef,A,S]),onTriggerLeave:v.useCallback(()=>{f?w():(window.clearTimeout(p.current),p.current=0)},[w,f]),onOpen:S,onClose:w,disableHoverableContent:f,children:n})})};bM.displayName=su;var Cy="TooltipTrigger",EM=v.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,i=Vu(Cy,n),s=yv(Cy,n),o=rm(n),a=v.useRef(null),l=_t(e,a,i.onTriggerChange),c=v.useRef(!1),u=v.useRef(!1),h=v.useCallback(()=>c.current=!1,[]);return v.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),E.jsx(Rf,{asChild:!0,...o,children:E.jsx(pt.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:l,onPointerMove:ve(t.onPointerMove,d=>{d.pointerType!=="touch"&&!u.current&&!s.isPointerInTransitRef.current&&(i.onTriggerEnter(),u.current=!0)}),onPointerLeave:ve(t.onPointerLeave,()=>{i.onTriggerLeave(),u.current=!1}),onPointerDown:ve(t.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:ve(t.onFocus,()=>{c.current||i.onOpen()}),onBlur:ve(t.onBlur,i.onClose),onClick:ve(t.onClick,i.onClose)})})});EM.displayName=Cy;var bv="TooltipPortal",[sZ,oZ]=nm(bv,{forceMount:void 0}),vM=t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:i}=t,s=Vu(bv,e);return E.jsx(sZ,{scope:e,forceMount:n,children:E.jsx(fi,{present:n||s.open,children:E.jsx(PE,{asChild:!0,container:i,children:r})})})};vM.displayName=bv;var Ya="TooltipContent",TM=v.forwardRef((t,e)=>{const n=oZ(Ya,t.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...s}=t,o=Vu(Ya,t.__scopeTooltip);return E.jsx(fi,{present:r||o.open,children:o.disableHoverableContent?E.jsx(SM,{side:i,...s,ref:e}):E.jsx(aZ,{side:i,...s,ref:e})})}),aZ=v.forwardRef((t,e)=>{const n=Vu(Ya,t.__scopeTooltip),r=yv(Ya,t.__scopeTooltip),i=v.useRef(null),s=_t(e,i),[o,a]=v.useState(null),{trigger:l,onClose:c}=n,u=i.current,{onPointerInTransitChange:h}=r,d=v.useCallback(()=>{a(null),h(!1)},[h]),p=v.useCallback((f,m)=>{const g=f.currentTarget,y={x:f.clientX,y:f.clientY},b=dZ(y,g.getBoundingClientRect()),T=pZ(y,b),S=fZ(m.getBoundingClientRect()),w=gZ([...T,...S]);a(w),h(!0)},[h]);return v.useEffect(()=>()=>d(),[d]),v.useEffect(()=>{if(l&&u){const f=g=>p(g,u),m=g=>p(g,l);return l.addEventListener("pointerleave",f),u.addEventListener("pointerleave",m),()=>{l.removeEventListener("pointerleave",f),u.removeEventListener("pointerleave",m)}}},[l,u,p,d]),v.useEffect(()=>{if(o){const f=m=>{const g=m.target,y={x:m.clientX,y:m.clientY},b=(l==null?void 0:l.contains(g))||(u==null?void 0:u.contains(g)),T=!mZ(y,o);b?d():T&&(d(),c())};return document.addEventListener("pointermove",f),()=>document.removeEventListener("pointermove",f)}},[l,u,o,c,d]),E.jsx(SM,{...t,ref:s})}),[lZ,cZ]=nm(su,{isInside:!1}),uZ=y3("TooltipContent"),SM=v.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:o,...a}=t,l=Vu(Ya,n),c=rm(n),{onClose:u}=l;return v.useEffect(()=>(document.addEventListener(xy,u),()=>document.removeEventListener(xy,u)),[u]),v.useEffect(()=>{if(l.trigger){const h=d=>{var p;(p=d.target)!=null&&p.contains(l.trigger)&&u()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[l.trigger,u]),E.jsx(Ru,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:h=>h.preventDefault(),onDismiss:u,children:E.jsxs(DE,{"data-state":l.stateAttribute,...c,...a,ref:e,style:{...a.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:[E.jsx(uZ,{children:r}),E.jsx(lZ,{scope:n,isInside:!0,children:E.jsx(tZ,{id:l.contentId,role:"tooltip",children:i||r})})]})})});TM.displayName=Ya;var wM="TooltipArrow",hZ=v.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,i=rm(n);return cZ(wM,n).isInside?null:E.jsx(AE,{...i,...r,ref:e})});hZ.displayName=wM;function dZ(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),i=Math.abs(e.right-t.x),s=Math.abs(e.left-t.x);switch(Math.min(n,r,i,s)){case s:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function pZ(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function fZ(t){const{top:e,right:n,bottom:r,left:i}=t;return[{x:i,y:e},{x:n,y:e},{x:n,y:r},{x:i,y:r}]}function mZ(t,e){const{x:n,y:r}=t;let i=!1;for(let s=0,o=e.length-1;sr!=d>r&&n<(h-c)*(r-u)/(d-u)+c&&(i=!i)}return i}function gZ(t){const e=t.slice();return e.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),OZ(e)}function OZ(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r=2;){const s=e[e.length-1],o=e[e.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))e.pop();else break}e.push(i)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const i=t[r];for(;n.length>=2;){const s=n[n.length-1],o=n[n.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))n.pop();else break}n.push(i)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}const Ev=Ne.forwardRef(({children:t,content:e,portal:n=!1,options:r,...i},s)=>{const o=n?vM:Ne.Fragment;return E.jsx(yM,{delayDuration:500,skipDelayDuration:0,disableHoverableContent:!1,children:E.jsxs(bM,{children:[E.jsx(EM,{ref:s,asChild:!0,...i,children:t}),E.jsx(o,{children:E.jsx(TM,{className:"rte-tooltip",side:"top",align:"center",...r,children:e})})]})})});Ev.displayName="Tooltip";const yZ=t=>{const e=/macintosh|mac os x/gi.test(navigator.userAgent);return t==="Mod"?e?"⌘":"Ctrl":t==="Shift"?e?"⇧":t:t==="Alt"&&e?"⌥":t},kM=1024;let bZ=0,ur=class{constructor(t,e){this.from=t,this.to=e}};class Qe{constructor(e={}){this.id=bZ++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Dn.match(e)),n=>{let r=e(n);return r===void 0?null:[this,r]}}}Qe.closedBy=new Qe({deserialize:t=>t.split(" ")});Qe.openedBy=new Qe({deserialize:t=>t.split(" ")});Qe.group=new Qe({deserialize:t=>t.split(" ")});Qe.isolate=new Qe({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});Qe.contextHash=new Qe({perNode:!0});Qe.lookAhead=new Qe({perNode:!0});Qe.mounted=new Qe({perNode:!0});class ou{constructor(e,n,r){this.tree=e,this.overlay=n,this.parser=r}static get(e){return e&&e.props&&e.props[Qe.mounted.id]}}const EZ=Object.create(null);class Dn{constructor(e,n,r,i=0){this.name=e,this.props=n,this.id=r,this.flags=i}static define(e){let n=e.props&&e.props.length?Object.create(null):EZ,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new Dn(e.name||"",n,e.id,r);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(i)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[s[0].id]=s[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let n=this.prop(Qe.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let r in e)for(let i of r.split(" "))n[i]=e[r];return r=>{for(let i=r.prop(Qe.group),s=-1;s<(i?i.length:0);s++){let o=n[s<0?r.name:i[s]];if(o)return o}}}}Dn.none=new Dn("",Object.create(null),0,8);class vv{constructor(e){this.types=e;for(let n=0;n0;for(let l=this.cursor(o|ct.IncludeAnonymous);;){let c=!1;if(l.from<=s&&l.to>=i&&(!a&&l.type.isAnonymous||n(l)!==!1)){if(l.firstChild())continue;c=!0}for(;c&&r&&(a||!l.type.isAnonymous)&&r(l),!l.nextSibling();){if(!l.parent())return;c=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let n in this.props)e.push([+n,this.props[n]]);return e}balance(e={}){return this.children.length<=8?this:wv(Dn.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,i)=>new ft(this.type,n,r,i,this.propValues),e.makeTree||((n,r,i)=>new ft(Dn.none,n,r,i)))}static build(e){return wZ(e)}}ft.empty=new ft(Dn.none,[],[],0);class Tv{constructor(e,n){this.buffer=e,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Tv(this.buffer,this.index)}}class Xs{constructor(e,n,r){this.buffer=e,this.length=n,this.set=r}get type(){return Dn.none}toString(){let e=[];for(let n=0;n0));l=o[l+3]);return a}slice(e,n,r){let i=this.buffer,s=new Uint16Array(n-e),o=0;for(let a=e,l=0;a=e&&ne;case 1:return n<=e&&r>e;case 2:return r>e;case 4:return!0}}function au(t,e,n,r){for(var i;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to0?a.length:-1;e!=c;e+=n){let u=a[e],h=l[e]+o.from;if(_M(i,r,h,h+u.length)){if(u instanceof Xs){if(s&ct.ExcludeBuffers)continue;let d=u.findChild(0,u.buffer.length,n,r-h,i);if(d>-1)return new ni(new vZ(o,u,e,h),null,d)}else if(s&ct.IncludeAnonymous||!u.type.isAnonymous||Sv(u)){let d;if(!(s&ct.IgnoreMounts)&&(d=ou.get(u))&&!d.overlay)return new On(d.tree,h,e,o);let p=new On(u,h,e,o);return s&ct.IncludeAnonymous||!p.type.isAnonymous?p:p.nextChild(n<0?u.children.length-1:0,n,r,i)}}}if(s&ct.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+n:e=n<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,n,r=0){let i;if(!(r&ct.IgnoreOverlays)&&(i=ou.get(this._tree))&&i.overlay){let s=e-this.from;for(let{from:o,to:a}of i.overlay)if((n>0?o<=s:o=s:a>s))return new On(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function kk(t,e,n,r){let i=t.cursor(),s=[];if(!i.firstChild())return s;if(n!=null){for(let o=!1;!o;)if(o=i.type.is(n),!i.nextSibling())return s}for(;;){if(r!=null&&i.type.is(r))return s;if(i.type.is(e)&&s.push(i.node),!i.nextSibling())return r==null?s:[]}}function Dy(t,e,n=e.length-1){for(let r=t;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[n]&&e[n]!=r.name)return!1;n--}}return!0}class vZ{constructor(e,n,r,i){this.parent=e,this.buffer=n,this.index=r,this.start=i}}class ni extends xM{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,n,r){super(),this.context=e,this._parent=n,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,n,r){let{buffer:i}=this.context,s=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.context.start,r);return s<0?null:new ni(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,n,r=0){if(r&ct.ExcludeBuffers)return null;let{buffer:i}=this.context,s=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return s<0?null:new ni(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new ni(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new ni(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:r}=this.context,i=this.index+4,s=r.buffer[this.index+3];if(s>i){let o=r.buffer[this.index+1];e.push(r.slice(i,s,o)),n.push(0)}return new ft(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function CM(t){if(!t.length)return null;let e=0,n=t[0];for(let s=1;sn.from||o.to=e){let a=new On(o.tree,o.overlay[0].from+s.from,-1,s);(i||(i=[r])).push(au(a,e,n,!1))}}return i?CM(i):r}class pp{get name(){return this.type.name}constructor(e,n=0){if(this.mode=n,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof On)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,n){this.index=e;let{start:r,buffer:i}=this.buffer;return this.type=n||i.set.types[i.buffer[e]],this.from=r+i.buffer[e+1],this.to=r+i.buffer[e+2],!0}yield(e){return e?e instanceof On?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,n,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,r,this.mode));let{buffer:i}=this.buffer,s=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.buffer.start,r);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,n,r=this.mode){return this.buffer?r&ct.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&ct.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&ct.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:n}=this.buffer,r=this.stack.length-1;if(e<0){let i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(n.findChild(i,this.index,-1,0,4))}else{let i=n.buffer[this.index+3];if(i<(r<0?n.buffer.length:n.buffer[this.stack[r]+3]))return this.yieldBuf(i)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,r,{buffer:i}=this;if(i){if(e>0){if(this.index-1)for(let s=n+e,o=e<0?-1:r._tree.children.length;s!=o;s+=e){let a=r._tree.children[s];if(this.mode&ct.IncludeAnonymous||a instanceof Xs||!a.type.isAnonymous||Sv(a))return!1}return!0}move(e,n){if(n&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,n=0){for(;(this.from==this.to||(n<1?this.from>=e:this.from>e)||(n>-1?this.to<=e:this.to=0;){for(let o=e;o;o=o._parent)if(o.index==i){if(i==this.index)return o;n=o,r=s+1;break e}i=this.stack[--s]}for(let i=r;i=0;s--){if(s<0)return Dy(this._tree,e,i);let o=r[n.buffer[this.stack[s]]];if(!o.isAnonymous){if(e[i]&&e[i]!=o.name)return!1;i--}}return!0}}function Sv(t){return t.children.some(e=>e instanceof Xs||!e.type.isAnonymous||Sv(e))}function wZ(t){var e;let{buffer:n,nodeSet:r,maxBufferLength:i=kM,reused:s=[],minRepeatType:o=r.types.length}=t,a=Array.isArray(n)?new Tv(n,n.length):n,l=r.types,c=0,u=0;function h(w,A,C,N,$,I){let{id:L,start:Z,end:B,size:j}=a,U=u,J=c;if(j<0)if(a.next(),j==-1){let He=s[L];C.push(He),N.push(Z-w);return}else if(j==-3){c=L;return}else if(j==-4){u=L;return}else throw new RangeError(`Unrecognized record size: ${j}`);let fe=l[L],z,ne,Oe=Z-w;if(B-Z<=i&&(ne=g(a.pos-A,$))){let He=new Uint16Array(ne.size-ne.skip),it=a.pos-ne.size,Le=He.length;for(;a.pos>it;)Le=y(ne.start,He,Le);z=new Xs(He,B-ne.start,r),Oe=ne.start-w}else{let He=a.pos-j;a.next();let it=[],Le=[],Xe=L>=o?L:-1,vt=0,An=B;for(;a.pos>He;)Xe>=0&&a.id==Xe&&a.size>=0?(a.end<=An-i&&(f(it,Le,Z,vt,a.end,An,Xe,U,J),vt=it.length,An=a.end),a.next()):I>2500?d(Z,He,it,Le):h(Z,He,it,Le,Xe,I+1);if(Xe>=0&&vt>0&&vt-1&&vt>0){let Ge=p(fe,J);z=wv(fe,it,Le,0,it.length,0,B-Z,Ge,Ge)}else z=m(fe,it,Le,B-Z,U-B,J)}C.push(z),N.push(Oe)}function d(w,A,C,N){let $=[],I=0,L=-1;for(;a.pos>A;){let{id:Z,start:B,end:j,size:U}=a;if(U>4)a.next();else{if(L>-1&&B=0;j-=3)Z[U++]=$[j],Z[U++]=$[j+1]-B,Z[U++]=$[j+2]-B,Z[U++]=U;C.push(new Xs(Z,$[2]-B,r)),N.push(B-w)}}function p(w,A){return(C,N,$)=>{let I=0,L=C.length-1,Z,B;if(L>=0&&(Z=C[L])instanceof ft){if(!L&&Z.type==w&&Z.length==$)return Z;(B=Z.prop(Qe.lookAhead))&&(I=N[L]+Z.length+B)}return m(w,C,N,$,I,A)}}function f(w,A,C,N,$,I,L,Z,B){let j=[],U=[];for(;w.length>N;)j.push(w.pop()),U.push(A.pop()+C-$);w.push(m(r.types[L],j,U,I-$,Z-I,B)),A.push($-C)}function m(w,A,C,N,$,I,L){if(I){let Z=[Qe.contextHash,I];L=L?[Z].concat(L):[Z]}if($>25){let Z=[Qe.lookAhead,$];L=L?[Z].concat(L):[Z]}return new ft(w,A,C,N,L)}function g(w,A){let C=a.fork(),N=0,$=0,I=0,L=C.end-i,Z={size:0,start:0,skip:0};e:for(let B=C.pos-w;C.pos>B;){let j=C.size;if(C.id==A&&j>=0){Z.size=N,Z.start=$,Z.skip=I,I+=4,N+=4,C.next();continue}let U=C.pos-j;if(j<0||U=o?4:0,fe=C.start;for(C.next();C.pos>U;){if(C.size<0)if(C.size==-3)J+=4;else break e;else C.id>=o&&(J+=4);C.next()}$=fe,N+=j,I+=J}return(A<0||N==w)&&(Z.size=N,Z.start=$,Z.skip=I),Z.size>4?Z:void 0}function y(w,A,C){let{id:N,start:$,end:I,size:L}=a;if(a.next(),L>=0&&N4){let B=a.pos-(L-4);for(;a.pos>B;)C=y(w,A,C)}A[--C]=Z,A[--C]=I-w,A[--C]=$-w,A[--C]=N}else L==-3?c=N:L==-4&&(u=N);return C}let b=[],T=[];for(;a.pos>0;)h(t.start||0,t.bufferStart||0,b,T,-1,0);let S=(e=t.length)!==null&&e!==void 0?e:b.length?T[0]+b[0].length:0;return new ft(l[t.topID],b.reverse(),T.reverse(),S)}const _k=new WeakMap;function kd(t,e){if(!t.isAnonymous||e instanceof Xs||e.type!=t)return 1;let n=_k.get(e);if(n==null){n=1;for(let r of e.children){if(r.type!=t||!(r instanceof ft)){n=1;break}n+=kd(t,r)}_k.set(e,n)}return n}function wv(t,e,n,r,i,s,o,a,l){let c=0;for(let f=r;f=u)break;A+=C}if(T==S+1){if(A>u){let C=f[S];p(C.children,C.positions,0,C.children.length,m[S]+b);continue}h.push(f[S])}else{let C=m[T-1]+f[T-1].length-w;h.push(wv(t,f,m,S,T,w,C,null,l))}d.push(w+b-s)}}return p(e,n,r,i,0),(a||l)(h,d,o)}class DM{constructor(){this.map=new WeakMap}setBuffer(e,n,r){let i=this.map.get(e);i||this.map.set(e,i=new Map),i.set(n,r)}getBuffer(e,n){let r=this.map.get(e);return r&&r.get(n)}set(e,n){e instanceof ni?this.setBuffer(e.context.buffer,e.index,n):e instanceof On&&this.map.set(e.tree,n)}get(e){return e instanceof ni?this.getBuffer(e.context.buffer,e.index):e instanceof On?this.map.get(e.tree):void 0}cursorSet(e,n){e.buffer?this.setBuffer(e.buffer.buffer,e.index,n):this.map.set(e.tree,n)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Ui{constructor(e,n,r,i,s=!1,o=!1){this.from=e,this.to=n,this.tree=r,this.offset=i,this.open=(s?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],r=!1){let i=[new Ui(0,e.length,e,0,!1,r)];for(let s of n)s.to>e.length&&i.push(s);return i}static applyChanges(e,n,r=128){if(!n.length)return e;let i=[],s=1,o=e.length?e[0]:null;for(let a=0,l=0,c=0;;a++){let u=a=r)for(;o&&o.from=d.from||h<=d.to||c){let p=Math.max(d.from,l)-c,f=Math.min(d.to,h)-c;d=p>=f?null:new Ui(p,f,d.tree,d.offset+c,a>0,!!u)}if(d&&i.push(d),o.to>h)break;o=snew ur(r.from,r.to)):[new ur(0,0)]:[new ur(0,t.length)],this.createParse(t,e||[],n)}parse(t,e,n){let r=this.startParse(t,e,n);for(;;){let i=r.advance();if(i)return i}}};class kZ{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,n){return this.string.slice(e,n)}}function _Z(t){return(e,n,r,i)=>new CZ(e,t,n,r,i)}class xk{constructor(e,n,r,i,s){this.parser=e,this.parse=n,this.overlay=r,this.target=i,this.from=s}}function Ck(t){if(!t.length||t.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(t))}class xZ{constructor(e,n,r,i,s,o,a){this.parser=e,this.predicate=n,this.mounts=r,this.index=i,this.start=s,this.target=o,this.prev=a,this.depth=0,this.ranges=[]}}const Ay=new Qe({perNode:!0});class CZ{constructor(e,n,r,i,s){this.nest=n,this.input=r,this.fragments=i,this.ranges=s,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let r=this.baseParse.advance();if(!r)return null;if(this.baseParse=null,this.baseTree=r,this.startInner(),this.stoppedAt!=null)for(let i of this.inner)i.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let r=this.baseTree;return this.stoppedAt!=null&&(r=new ft(r.type,r.children,r.positions,r.length,r.propValues.concat([[Ay,this.stoppedAt]]))),r}let e=this.inner[this.innerDone],n=e.parse.advance();if(n){this.innerDone++;let r=Object.assign(Object.create(null),e.target.props);r[Qe.mounted.id]=new ou(n,e.overlay,e.parser),e.target.props=r}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let n=this.innerDone;n=this.stoppedAt)a=!1;else if(e.hasNode(i)){if(n){let c=n.mounts.find(u=>u.frag.from<=i.from&&u.frag.to>=i.to&&u.mount.overlay);if(c)for(let u of c.mount.overlay){let h=u.from+c.pos,d=u.to+c.pos;h>=i.from&&d<=i.to&&!n.ranges.some(p=>p.fromh)&&n.ranges.push({from:h,to:d})}}a=!1}else if(r&&(o=DZ(r.ranges,i.from,i.to)))a=o!=2;else if(!i.type.isAnonymous&&(s=this.nest(i,this.input))&&(i.fromnew ur(h.from-i.from,h.to-i.from)):null,i.tree,u.length?u[0].from:i.from)),s.overlay?u.length&&(r={ranges:u,depth:0,prev:r}):a=!1}}else if(n&&(l=n.predicate(i))&&(l===!0&&(l=new ur(i.from,i.to)),l.from=0&&n.ranges[c].to==l.from?n.ranges[c]={from:n.ranges[c].from,to:l.to}:n.ranges.push(l)}if(a&&i.firstChild())n&&n.depth++,r&&r.depth++;else for(;!i.nextSibling();){if(!i.parent())break e;if(n&&!--n.depth){let c=Pk(this.ranges,n.ranges);c.length&&(Ck(c),this.inner.splice(n.index,0,new xk(n.parser,n.parser.startParse(this.input,Nk(n.mounts,c),c),n.ranges.map(u=>new ur(u.from-n.start,u.to-n.start)),n.target,c[0].from))),n=n.prev}r&&!--r.depth&&(r=r.prev)}}}}function DZ(t,e,n){for(let r of t){if(r.from>=n)break;if(r.to>e)return r.from<=e&&r.to>=n?2:1}return 0}function Dk(t,e,n,r,i,s){if(e=e&&n.enter(r,1,ct.IgnoreOverlays|ct.ExcludeBuffers)||n.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let n=this.cursor.tree;;){if(n==e.tree)return!0;if(n.children.length&&n.positions[0]==0&&n.children[0]instanceof ft)n=n.children[0];else break}return!1}}let PZ=class{constructor(t){var e;if(this.fragments=t,this.curTo=0,this.fragI=0,t.length){let n=this.curFrag=t[0];this.curTo=(e=n.tree.prop(Ay))!==null&&e!==void 0?e:n.to,this.inner=new Ak(n.tree,-n.offset)}else this.curFrag=this.inner=null}hasNode(t){for(;this.curFrag&&t.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=t.from&&this.curTo>=t.to&&this.inner.hasNode(t)}nextFrag(){var t;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let e=this.curFrag=this.fragments[this.fragI];this.curTo=(t=e.tree.prop(Ay))!==null&&t!==void 0?t:e.to,this.inner=new Ak(e.tree,-e.offset)}}findMounts(t,e){var n;let r=[];if(this.inner){this.inner.cursor.moveTo(t,1);for(let i=this.inner.cursor.node;i;i=i.parent){let s=(n=i.tree)===null||n===void 0?void 0:n.prop(Qe.mounted);if(s&&s.parser==e)for(let o=this.fragI;o=i.to)break;a.tree==this.curFrag.tree&&r.push({frag:a,pos:i.from-a.offset,mount:s})}}}return r}};function Pk(t,e){let n=null,r=e;for(let i=1,s=0;i=a)break;l.to<=o||(n||(r=n=e.slice()),l.froma&&n.splice(s+1,0,new ur(a,l.to))):l.to>a?n[s--]=new ur(a,l.to):n.splice(s--,1))}}return r}function NZ(t,e,n,r){let i=0,s=0,o=!1,a=!1,l=-1e9,c=[];for(;;){let u=i==t.length?1e9:o?t[i].to:t[i].from,h=s==e.length?1e9:a?e[s].to:e[s].from;if(o!=a){let d=Math.max(l,n),p=Math.min(u,h,r);dnew ur(d.from+r,d.to+r)),h=NZ(e,u,l,c);for(let d=0,p=l;;d++){let f=d==h.length,m=f?c:h[d].from;if(m>p&&n.push(new Ui(p,m,i.tree,-o,s.from>=p||s.openStart,s.to<=m||s.openEnd)),f)break;p=h[d].to}}else n.push(new Ui(l,c,i.tree,-o,s.from>=o||s.openStart,s.to<=a||s.openEnd))}return n}class fp{constructor(e,n,r,i,s,o,a,l,c,u=0,h){this.p=e,this.stack=n,this.state=r,this.reducePos=i,this.pos=s,this.score=o,this.buffer=a,this.bufferBase=l,this.curContext=c,this.lookAhead=u,this.parent=h}toString(){return`[${this.stack.filter((e,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,n,r=0){let i=e.parser.context;return new fp(e,[],n,r,r,0,[],0,i?new Rk(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var n;let r=e>>19,i=e&65535,{parser:s}=this.p,o=this.reducePos=2e3&&!(!((n=this.p.parser.nodeSet.types[i])===null||n===void 0)&&n.isAnonymous)&&(c==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSizel;)this.stack.pop();this.reduceContext(i,c)}storeNode(e,n,r,i=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&o.buffer[a-4]==0&&o.buffer[a-1]>-1){if(n==r)return;if(o.buffer[a-2]>=n){o.buffer[a-2]=r;return}}}if(!s||this.pos==r)this.buffer.push(e,n,r,i);else{let o=this.buffer.length;if(o>0&&(this.buffer[o-4]!=0||this.buffer[o-1]<0)){let a=!1;for(let l=o;l>0&&this.buffer[l-2]>r;l-=4)if(this.buffer[l-1]>=0){a=!0;break}if(a)for(;o>0&&this.buffer[o-2]>r;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,i>4&&(i-=4)}this.buffer[o]=e,this.buffer[o+1]=n,this.buffer[o+2]=r,this.buffer[o+3]=i}}shift(e,n,r,i){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let s=e,{parser:o}=this.p;(i>this.pos||n<=o.maxNode)&&(this.pos=i,o.stateFlag(s,1)||(this.reducePos=i)),this.pushState(s,r),this.shiftContext(n,r),n<=o.maxNode&&this.buffer.push(n,r,i,4)}else this.pos=i,this.shiftContext(n,r),n<=this.p.parser.maxNode&&this.buffer.push(n,r,i,4)}apply(e,n,r,i){e&65536?this.reduce(e):this.shift(e,n,r,i)}useNode(e,n){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=e)&&(this.p.reused.push(e),r++);let i=this.pos;this.reducePos=this.pos=i+e.length,this.pushState(n,i),this.buffer.push(r,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,n=e.buffer.length;for(;n>0&&e.buffer[n-2]>e.reducePos;)n-=4;let r=e.buffer.slice(n),i=e.bufferBase+n;for(;e&&i==e.bufferBase;)e=e.parent;return new fp(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,e)}recoverByDelete(e,n){let r=e<=this.p.parser.maxNode;r&&this.storeNode(e,this.pos,n,4),this.storeNode(0,this.pos,n,r?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(e){for(let n=new RZ(this);;){let r=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,e);if(r==0)return!1;if((r&65536)==0)return!0;n.reduce(r)}}recoverByInsert(e){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let i=[];for(let s=0,o;sl&1&&a==o)||i.push(n[s],o)}n=i}let r=[];for(let i=0;i>19,i=n&65535,s=this.stack.length-r*3;if(s<0||e.getGoto(this.stack[s],i,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;n=o}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:e}=this.p,n=[],r=(i,s)=>{if(!n.includes(i))return n.push(i),e.allActions(i,o=>{if(!(o&393216))if(o&65536){let a=(o>>19)-s;if(a>1){let l=o&65535,c=this.stack.length-a*3;if(c>=0&&e.getGoto(this.stack[c],l,!1)>=0)return a<<19|65536|l}}else{let a=r(o,s+1);if(a!=null)return a}})};return r(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let n=0;nthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class Rk{constructor(e,n){this.tracker=e,this.context=n,this.hash=e.strict?e.hash(n):0}}class RZ{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let n=e&65535,r=e>>19;r==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(r-1)*3;let i=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=i}}class mp{constructor(e,n,r){this.stack=e,this.pos=n,this.index=r,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,n=e.bufferBase+e.buffer.length){return new mp(e,n,n-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new mp(this.stack,this.pos,this.index)}}function ic(t,e=Uint16Array){if(typeof t!="string")return t;let n=null;for(let r=0,i=0;r=92&&o--,o>=34&&o--;let l=o-32;if(l>=46&&(l-=46,a=!0),s+=l,a)break;s*=46}n?n[i++]=s:n=new e(s)}return n}class _d{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const Mk=new _d;class MZ{constructor(e,n){this.input=e,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=Mk,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(e,n){let r=this.range,i=this.rangeIndex,s=this.pos+e;for(;sr.to:s>=r.to;){if(i==this.ranges.length-1)return null;let o=this.ranges[++i];s+=o.from-r.to,r=o}return s}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,n.from);return this.end}peek(e){let n=this.chunkOff+e,r,i;if(n>=0&&n=this.chunk2Pos&&ra.to&&(this.chunk2=this.chunk2.slice(0,a.to-r)),i=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),i}acceptToken(e,n=0){let r=n?this.resolveOffset(n,-1):this.pos;if(r==null||r=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,n){if(n?(this.token=n,n.start=e,n.lookAhead=e+1,n.value=n.extended=-1):this.token=Mk,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,n-this.chunkPos);if(e>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,n-this.chunk2Pos);if(e>=this.range.from&&n<=this.range.to)return this.input.read(e,n);let r="";for(let i of this.ranges){if(i.from>=n)break;i.to>e&&(r+=this.input.read(Math.max(i.from,e),Math.min(i.to,n)))}return r}}class Ra{constructor(e,n){this.data=e,this.id=n}token(e,n){let{parser:r}=n.p;PM(this.data,e,n,this.id,r.data,r.tokenPrecTable)}}Ra.prototype.contextual=Ra.prototype.fallback=Ra.prototype.extend=!1;class gp{constructor(e,n,r){this.precTable=n,this.elseToken=r,this.data=typeof e=="string"?ic(e):e}token(e,n){let r=e.pos,i=0;for(;;){let s=e.next<0,o=e.resolveOffset(1,1);if(PM(this.data,e,n,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||i++,o==null)break;e.reset(o,e.token)}i&&(e.reset(r,e.token),e.acceptToken(this.elseToken,i))}}gp.prototype.contextual=Ra.prototype.fallback=Ra.prototype.extend=!1;class Kn{constructor(e,n={}){this.token=e,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}}function PM(t,e,n,r,i,s){let o=0,a=1<0){let f=t[p];if(l.allows(f)&&(e.token.value==-1||e.token.value==f||IZ(f,e.token.value,i,s))){e.acceptToken(f);break}}let u=e.next,h=0,d=t[o+2];if(e.next<0&&d>h&&t[c+d*3-3]==65535){o=t[c+d*3-1];continue e}for(;h>1,f=c+p+(p<<1),m=t[f],g=t[f+1]||65536;if(u=g)h=p+1;else{o=t[f+2],e.advance();continue e}}break}}function Ik(t,e,n){for(let r=e,i;(i=t[r])!=65535;r++)if(i==n)return r-e;return-1}function IZ(t,e,n,r){let i=Ik(n,r,e);return i<0||Ik(n,r,t)e)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,e-25)):Math.min(t.length,Math.max(r.from+1,e+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:t.length}}class LZ{constructor(e,n){this.fragments=e,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?Lk(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?Lk(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=o,null;if(s instanceof ft){if(o==e){if(o=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(o),this.index.push(0))}else this.index[n]++,this.nextStart=o+s.length}}}class QZ{constructor(e,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(r=>new _d)}getActions(e){let n=0,r=null,{parser:i}=e.p,{tokenizers:s}=i,o=i.stateSlot(e.state,3),a=e.curContext?e.curContext.hash:0,l=0;for(let c=0;ch.end+25&&(l=Math.max(h.lookAhead,l)),h.value!=0)){let d=n;if(h.extended>-1&&(n=this.addActions(e,h.extended,h.end,n)),n=this.addActions(e,h.value,h.end,n),!u.extend&&(r=h,n>d))break}}for(;this.actions.length>n;)this.actions.pop();return l&&e.setLookAhead(l),!r&&e.pos==this.stream.end&&(r=new _d,r.value=e.p.parser.eofTerm,r.start=r.end=e.pos,n=this.addActions(e,r.value,r.end,n)),this.mainToken=r,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let n=new _d,{pos:r,p:i}=e;return n.start=r,n.end=Math.min(r+1,i.stream.end),n.value=r==i.stream.end?i.parser.eofTerm:0,n}updateCachedToken(e,n,r){let i=this.stream.clipPos(r.pos);if(n.token(this.stream.reset(i,e),r),e.value>-1){let{parser:s}=r.p;for(let o=0;o=0&&r.p.parser.dialect.allows(a>>1)){(a&1)==0?e.value=a>>1:e.extended=a>>1;break}}}else e.value=0,e.end=this.stream.clipPos(i+1)}putAction(e,n,r,i){for(let s=0;se.bufferLength*4?new LZ(r,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,n=this.minStackPos,r=this.stacks=[],i,s;if(this.bigReductionCount>300&&e.length==1){let[o]=e;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;on)r.push(a);else{if(this.advanceStack(a,r,e))continue;{i||(i=[],s=[]),i.push(a);let l=this.tokens.getMainToken(a);s.push(l.value,l.end)}}break}}if(!r.length){let o=i&&BZ(i);if(o)return zn&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw zn&&i&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&i){let o=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,s,r);if(o)return zn&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(r.length>o)for(r.sort((a,l)=>l.score-a.score);r.length>o;)r.pop();r.some(a=>a.reducePos>n)&&this.recovering--}else if(r.length>1){e:for(let o=0;o500&&c.buffer.length>500)if((a.score-c.score||a.buffer.length-c.buffer.length)>0)r.splice(l--,1);else{r.splice(o--,1);continue e}}}r.length>12&&r.splice(12,r.length-12)}this.minStackPos=r[0].pos;for(let o=1;o ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let c=e.curContext&&e.curContext.tracker.strict,u=c?e.curContext.hash:0;for(let h=this.fragments.nodeAt(i);h;){let d=this.parser.nodeSet.types[h.type.id]==h.type?s.getGoto(e.state,h.type.id):-1;if(d>-1&&h.length&&(!c||(h.prop(Qe.contextHash)||0)==u))return e.useNode(h,d),zn&&console.log(o+this.stackID(e)+` (via reuse of ${s.getName(h.type.id)})`),!0;if(!(h instanceof ft)||h.children.length==0||h.positions[0]>0)break;let p=h.children[0];if(p instanceof ft&&h.positions[0]==0)h=p;else break}}let a=s.stateSlot(e.state,4);if(a>0)return e.reduce(a),zn&&console.log(o+this.stackID(e)+` (via always-reduce ${s.getName(a&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let l=this.tokens.getActions(e);for(let c=0;ci?n.push(f):r.push(f)}return!1}advanceFully(e,n){let r=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>r)return Qk(e,n),!0}}runRecovery(e,n,r){let i=null,s=!1;for(let o=0;o ":"";if(a.deadEnd&&(s||(s=!0,a.restart(),zn&&console.log(u+this.stackID(a)+" (restarted)"),this.advanceFully(a,r))))continue;let h=a.split(),d=u;for(let p=0;p<10&&h.forceReduce()&&(zn&&console.log(d+this.stackID(h)+" (via force-reduce)"),!this.advanceFully(h,r));p++)zn&&(d=this.stackID(h)+" -> ");for(let p of a.recoverByInsert(l))zn&&console.log(u+this.stackID(p)+" (via recover-insert)"),this.advanceFully(p,r);this.stream.end>a.pos?(c==a.pos&&(c++,l=0),a.recoverByDelete(l,c),zn&&console.log(u+this.stackID(a)+` (via recover-delete ${this.parser.getName(l)})`),Qk(a,r)):(!i||i.scoret;class NM{constructor(e){this.start=e.start,this.shift=e.shift||Rg,this.reduce=e.reduce||Rg,this.reuse=e.reuse||Rg,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class Ka extends AM{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let n=e.nodeNames.split(" ");this.minRepeatTerm=n.length;for(let a=0;ae.topRules[a][1]),i=[];for(let a=0;a=0)s(u,l,a[c++]);else{let h=a[c+-u];for(let d=-u;d>0;d--)s(a[c++],l,h);c++}}}this.nodeSet=new vv(n.map((a,l)=>Dn.define({name:l>=this.minRepeatTerm?void 0:a,id:l,props:i[l],top:r.indexOf(l)>-1,error:l==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(l)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=kM;let o=ic(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let a=0;atypeof a=="number"?new Ra(o,a):a),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,n,r){let i=new $Z(this,e,n,r);for(let s of this.wrappers)i=s(i,e,n,r);return i}getGoto(e,n,r=!1){let i=this.goto;if(n>=i[0])return-1;for(let s=i[n+1];;){let o=i[s++],a=o&1,l=i[s++];if(a&&r)return l;for(let c=s+(o>>1);s0}validAction(e,n){return!!this.allActions(e,r=>r==n?!0:null)}allActions(e,n){let r=this.stateSlot(e,4),i=r?n(r):void 0;for(let s=this.stateSlot(e,1);i==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=Pi(this.data,s+2);else break;i=n(Pi(this.data,s+1))}return i}nextStates(e){let n=[];for(let r=this.stateSlot(e,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=Pi(this.data,r+2);else break;if((this.data[r+2]&1)==0){let i=this.data[r+1];n.some((s,o)=>o&1&&s==i)||n.push(this.data[r],i)}}return n}configure(e){let n=Object.assign(Object.create(Ka.prototype),this);if(e.props&&(n.nodeSet=this.nodeSet.extend(...e.props)),e.top){let r=this.topRules[e.top];if(!r)throw new RangeError(`Invalid top rule name ${e.top}`);n.top=r}return e.tokenizers&&(n.tokenizers=this.tokenizers.map(r=>{let i=e.tokenizers.find(s=>s.from==r);return i?i.to:r})),e.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((r,i)=>{let s=e.specializers.find(a=>a.from==r.external);if(!s)return r;let o=Object.assign(Object.assign({},r),{external:s.to});return n.specializers[i]=$k(o),o})),e.contextTracker&&(n.context=e.contextTracker),e.dialect&&(n.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(n.strict=e.strict),e.wrap&&(n.wrappers=n.wrappers.concat(e.wrap)),e.bufferLength!=null&&(n.bufferLength=e.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let n=this.dynamicPrecedences;return n==null?0:n[e]||0}parseDialect(e){let n=Object.keys(this.dialects),r=n.map(()=>!1);if(e)for(let s of e.split(" ")){let o=n.indexOf(s);o>=0&&(r[o]=!0)}let i=null;for(let s=0;sr)&&n.p.parser.stateFlag(n.state,2)&&(!e||e.scoret.external(n,r)<<1|e}return t.get}let jZ=0;class sr{constructor(e,n,r,i){this.name=e,this.set=n,this.base=r,this.modified=i,this.id=jZ++}toString(){let{name:e}=this;for(let n of this.modified)n.name&&(e=`${n.name}(${e})`);return e}static define(e,n){let r=typeof e=="string"?e:"?";if(e instanceof sr&&(n=e),n==null?void 0:n.base)throw new Error("Can not derive from a modified tag");let i=new sr(r,[],null,[]);if(i.set.push(i),n)for(let s of n.set)i.set.push(s);return i}static defineModifier(e){let n=new Op(e);return r=>r.modified.indexOf(n)>-1?r:Op.get(r.base||r,r.modified.concat(n).sort((i,s)=>i.id-s.id))}}let zZ=0;class Op{constructor(e){this.name=e,this.instances=[],this.id=zZ++}static get(e,n){if(!n.length)return e;let r=n[0].instances.find(a=>a.base==e&&VZ(n,a.modified));if(r)return r;let i=[],s=new sr(e.name,i,e,n);for(let a of n)a.instances.push(s);let o=UZ(n);for(let a of e.set)if(!a.modified.length)for(let l of o)i.push(Op.get(a,l));return s}}function VZ(t,e){return t.length==e.length&&t.every((n,r)=>n==e[r])}function UZ(t){let e=[[]];for(let n=0;nr.length-n.length)}function im(t){let e=Object.create(null);for(let n in t){let r=t[n];Array.isArray(r)||(r=[r]);for(let i of n.split(" "))if(i){let s=[],o=2,a=i;for(let h=0;;){if(a=="..."&&h>0&&h+3==i.length){o=1;break}let d=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!d)throw new RangeError("Invalid path: "+i);if(s.push(d[0]=="*"?"":d[0][0]=='"'?JSON.parse(d[0]):d[0]),h+=d[0].length,h==i.length)break;let p=i[h++];if(h==i.length&&p=="!"){o=0;break}if(p!="/")throw new RangeError("Invalid path: "+i);a=i.slice(h)}let l=s.length-1,c=s[l];if(!c)throw new RangeError("Invalid path: "+i);let u=new lu(r,o,l>0?s.slice(0,l):null);e[c]=u.sort(e[c])}}return RM.add(e)}const RM=new Qe({combine(t,e){let n,r,i;for(;t||e;){if(!t||e&&t.depth>=e.depth?(i=e,e=e.next):(i=t,t=t.next),n&&n.mode==i.mode&&!i.context&&!n.context)continue;let s=new lu(i.tags,i.mode,i.context);n?n.next=s:r=s,n=s}return r}});let lu=class{constructor(t,e,n,r){this.tags=t,this.mode=e,this.context=n,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(t){return!t||t.depth{let o=i;for(let a of s)for(let l of a.set){let c=n[l.id];if(c){o=o?o+" "+c:c;break}}return o},scope:r}}function HZ(t,e){let n=null;for(let r of t){let i=r.style(e);i&&(n=n?n+" "+i:i)}return n}function XZ(t,e,n,r=0,i=t.length){let s=new qZ(r,Array.isArray(e)?e:[e],n);s.highlightRange(t.cursor(),r,i,"",s.highlighters),s.flush(i)}class qZ{constructor(e,n,r){this.at=e,this.highlighters=n,this.span=r,this.class=""}startSpan(e,n){n!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=n)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,n,r,i,s){let{type:o,from:a,to:l}=e;if(a>=r||l<=n)return;o.isTop&&(s=this.highlighters.filter(p=>!p.scope||p.scope(o)));let c=i,u=ZZ(e)||lu.empty,h=HZ(s,u.tags);if(h&&(c&&(c+=" "),c+=h,u.mode==1&&(i+=(i?" ":"")+h)),this.startSpan(Math.max(n,a),c),u.opaque)return;let d=e.tree&&e.tree.prop(Qe.mounted);if(d&&d.overlay){let p=e.node.enter(d.overlay[0].from+a,1),f=this.highlighters.filter(g=>!g.scope||g.scope(d.tree.type)),m=e.firstChild();for(let g=0,y=a;;g++){let b=g=T||!e.nextSibling())););if(!b||T>r)break;y=b.to+a,y>n&&(this.highlightRange(p.cursor(),Math.max(n,b.from+a),Math.min(r,y),"",f),this.startSpan(Math.min(r,y),c))}m&&e.parent()}else if(e.firstChild()){d&&(i="");do if(!(e.to<=n)){if(e.from>=r)break;this.highlightRange(e,n,r,i,s),this.startSpan(Math.min(r,e.to),c)}while(e.nextSibling());e.parent()}}}function ZZ(t){let e=t.type.prop(RM);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const ee=sr.define,Nh=ee(),bs=ee(),Fk=ee(bs),Bk=ee(bs),Es=ee(),Rh=ee(Es),Mg=ee(Es),Ur=ee(),uo=ee(Ur),jr=ee(),zr=ee(),Py=ee(),Ml=ee(Py),Mh=ee(),R={comment:Nh,lineComment:ee(Nh),blockComment:ee(Nh),docComment:ee(Nh),name:bs,variableName:ee(bs),typeName:Fk,tagName:ee(Fk),propertyName:Bk,attributeName:ee(Bk),className:ee(bs),labelName:ee(bs),namespace:ee(bs),macroName:ee(bs),literal:Es,string:Rh,docString:ee(Rh),character:ee(Rh),attributeValue:ee(Rh),number:Mg,integer:ee(Mg),float:ee(Mg),bool:ee(Es),regexp:ee(Es),escape:ee(Es),color:ee(Es),url:ee(Es),keyword:jr,self:ee(jr),null:ee(jr),atom:ee(jr),unit:ee(jr),modifier:ee(jr),operatorKeyword:ee(jr),controlKeyword:ee(jr),definitionKeyword:ee(jr),moduleKeyword:ee(jr),operator:zr,derefOperator:ee(zr),arithmeticOperator:ee(zr),logicOperator:ee(zr),bitwiseOperator:ee(zr),compareOperator:ee(zr),updateOperator:ee(zr),definitionOperator:ee(zr),typeOperator:ee(zr),controlOperator:ee(zr),punctuation:Py,separator:ee(Py),bracket:Ml,angleBracket:ee(Ml),squareBracket:ee(Ml),paren:ee(Ml),brace:ee(Ml),content:Ur,heading:uo,heading1:ee(uo),heading2:ee(uo),heading3:ee(uo),heading4:ee(uo),heading5:ee(uo),heading6:ee(uo),contentSeparator:ee(Ur),list:ee(Ur),quote:ee(Ur),emphasis:ee(Ur),strong:ee(Ur),link:ee(Ur),monospace:ee(Ur),strikethrough:ee(Ur),inserted:ee(),deleted:ee(),changed:ee(),invalid:ee(),meta:Mh,documentMeta:ee(Mh),annotation:ee(Mh),processingInstruction:ee(Mh),definition:sr.defineModifier("definition"),constant:sr.defineModifier("constant"),function:sr.defineModifier("function"),standard:sr.defineModifier("standard"),local:sr.defineModifier("local"),special:sr.defineModifier("special")};for(let t in R){let e=R[t];e instanceof sr&&(e.name=t)}MM([{tag:R.link,class:"tok-link"},{tag:R.heading,class:"tok-heading"},{tag:R.emphasis,class:"tok-emphasis"},{tag:R.strong,class:"tok-strong"},{tag:R.keyword,class:"tok-keyword"},{tag:R.atom,class:"tok-atom"},{tag:R.bool,class:"tok-bool"},{tag:R.url,class:"tok-url"},{tag:R.labelName,class:"tok-labelName"},{tag:R.inserted,class:"tok-inserted"},{tag:R.deleted,class:"tok-deleted"},{tag:R.literal,class:"tok-literal"},{tag:R.string,class:"tok-string"},{tag:R.number,class:"tok-number"},{tag:[R.regexp,R.escape,R.special(R.string)],class:"tok-string2"},{tag:R.variableName,class:"tok-variableName"},{tag:R.local(R.variableName),class:"tok-variableName tok-local"},{tag:R.definition(R.variableName),class:"tok-variableName tok-definition"},{tag:R.special(R.variableName),class:"tok-variableName2"},{tag:R.definition(R.propertyName),class:"tok-propertyName tok-definition"},{tag:R.typeName,class:"tok-typeName"},{tag:R.namespace,class:"tok-namespace"},{tag:R.className,class:"tok-className"},{tag:R.macroName,class:"tok-macroName"},{tag:R.propertyName,class:"tok-propertyName"},{tag:R.operator,class:"tok-operator"},{tag:R.comment,class:"tok-comment"},{tag:R.meta,class:"tok-meta"},{tag:R.invalid,class:"tok-invalid"},{tag:R.punctuation,class:"tok-punctuation"}]);const WZ=55,GZ=1,YZ=56,KZ=2,JZ=57,eW=3,jk=4,tW=5,kv=6,IM=7,LM=8,QM=9,$M=10,nW=11,rW=12,iW=13,Ig=58,sW=14,oW=15,zk=59,FM=21,aW=23,BM=24,lW=25,Ny=27,jM=28,cW=29,uW=32,hW=35,dW=37,pW=38,fW=0,mW=1,gW={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},OW={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},Vk={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function yW(t){return t==45||t==46||t==58||t>=65&&t<=90||t==95||t>=97&&t<=122||t>=161}let Uk=null,Hk=null,Xk=0;function Ry(t,e){let n=t.pos+e;if(Xk==n&&Hk==t)return Uk;let r=t.peek(e),i="";for(;yW(r);)i+=String.fromCharCode(r),r=t.peek(++e);return Hk=t,Xk=n,Uk=i?i.toLowerCase():r==bW||r==EW?void 0:null}const zM=60,yp=62,_v=47,bW=63,EW=33,vW=45;function qk(t,e){this.name=t,this.parent=e}const TW=[kv,$M,IM,LM,QM],SW=new NM({start:null,shift(t,e,n,r){return TW.indexOf(e)>-1?new qk(Ry(r,1)||"",t):t},reduce(t,e){return e==FM&&t?t.parent:t},reuse(t,e,n,r){let i=e.type.id;return i==kv||i==dW?new qk(Ry(r,1)||"",t):t},strict:!1}),wW=new Kn((t,e)=>{if(t.next!=zM){t.next<0&&e.context&&t.acceptToken(Ig);return}t.advance();let n=t.next==_v;n&&t.advance();let r=Ry(t,0);if(r===void 0)return;if(!r)return t.acceptToken(n?oW:sW);let i=e.context?e.context.name:null;if(n){if(r==i)return t.acceptToken(nW);if(i&&OW[i])return t.acceptToken(Ig,-2);if(e.dialectEnabled(fW))return t.acceptToken(rW);for(let s=e.context;s;s=s.parent)if(s.name==r)return;t.acceptToken(iW)}else{if(r=="script")return t.acceptToken(IM);if(r=="style")return t.acceptToken(LM);if(r=="textarea")return t.acceptToken(QM);if(gW.hasOwnProperty(r))return t.acceptToken($M);i&&Vk[i]&&Vk[i][r]?t.acceptToken(Ig,-1):t.acceptToken(kv)}},{contextual:!0}),kW=new Kn(t=>{for(let e=0,n=0;;n++){if(t.next<0){n&&t.acceptToken(zk);break}if(t.next==vW)e++;else if(t.next==yp&&e>=2){n>=3&&t.acceptToken(zk,-2);break}else e=0;t.advance()}});function _W(t){for(;t;t=t.parent)if(t.name=="svg"||t.name=="math")return!0;return!1}const xW=new Kn((t,e)=>{if(t.next==_v&&t.peek(1)==yp){let n=e.dialectEnabled(mW)||_W(e.context);t.acceptToken(n?tW:jk,2)}else t.next==yp&&t.acceptToken(jk,1)});function xv(t,e,n){let r=2+t.length;return new Kn(i=>{for(let s=0,o=0,a=0;;a++){if(i.next<0){a&&i.acceptToken(e);break}if(s==0&&i.next==zM||s==1&&i.next==_v||s>=2&&so?i.acceptToken(e,-o):i.acceptToken(n,-(o-2));break}else if((i.next==10||i.next==13)&&a){i.acceptToken(e,1);break}else s=o=0;i.advance()}})}const CW=xv("script",WZ,GZ),DW=xv("style",YZ,KZ),AW=xv("textarea",JZ,eW),PW=im({"Text RawText IncompleteTag IncompleteCloseTag":R.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":R.angleBracket,TagName:R.tagName,"MismatchedCloseTag/TagName":[R.tagName,R.invalid],AttributeName:R.attributeName,"AttributeValue UnquotedAttributeValue":R.attributeValue,Is:R.definitionOperator,"EntityReference CharacterReference":R.character,Comment:R.blockComment,ProcessingInst:R.processingInstruction,DoctypeDecl:R.documentMeta}),NW=Ka.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/ZOOOa-E7]-E7]O)qQ#tO'#CzOOO`1G.w1G.wOOOb-E7^-E7^O)vQ#tO'#C}OOOd-E7_-E7_O){Q#tO'#DQOOO`-E7`-E7`O*QQ#|O,59nOOOp-E7a-E7aOOO`1G/[1G/[OOO`1G/^1G/^OOO`1G/_1G/_O*VQ,UO,59`OOQW-E7Y-E7YOOOa7+$d7+$dOOO`7+$u7+$uOOOb7+$m7+$mOOOd7+$p7+$pOOO`7+$s7+$sO*bQ#|O,59fO*gQ#|O,59iO*lQ#|O,59lOOO`1G/Y1G/YO*qO7[O'#CwO+SOMhO'#CwOOQW1G.z1G.zOOO`1G/Q1G/QOOO`1G/T1G/TOOO`1G/W1G/WOOOO'#D]'#D]O+eO7[O,59cOOQW,59c,59cOOOO'#D^'#D^O+vOMhO,59cOOOO-E7Z-E7ZOOQW1G.}1G.}OOOO-E7[-E7[",stateData:",c~O!_OS~OUSOVPOWQOXROYTO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O|_O!eZO~OgaO~OgbO~OgcO~OgdO~OgeO~O!XfOPmP![mP~O!YiOQpP![pP~O!ZlORsP![sP~OUSOVPOWQOXROYTOZqO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O!eZO~O![rO~P#gO!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~",goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:SW,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity TextContent",-3,29,32,35,"TextContent Entity"],["isolate",-11,22,30,31,33,34,36,37,38,39,42,43,"ltr",-3,27,28,40,""]],propSources:[PW],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zblWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOb!R!R7tP;=`<%l7S!Z8OYlWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{iiSlWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbiSlWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VP<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXiSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TalWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOc!R!RAwP;=`<%lAY!ZBRYlWc!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbiSlWc!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbiSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXiSc!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!cxaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYliSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_kiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_XaP!b`!dp!fQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZiSgQaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!b`!dpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!b`!dp!ePOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!b`!dpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!b`!dpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!b`!dpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!b`!dpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!b`!dpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!b`!dpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!b`!dpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!dpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO|PP!-nP;=`<%l!-Sq!-xS!dp|POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!b`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!b`|POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!b`!dp|POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!b`!dpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!b`!dpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!b`!dpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!b`!dpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!b`!dpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!b`!dpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!dpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let c=a.type.id;if(c==cW)return Lg(a,l,n);if(c==uW)return Lg(a,l,r);if(c==hW)return Lg(a,l,i);if(c==FM&&s.length){let u=a.node,h=u.firstChild,d=h&&Zk(h,l),p;if(d){for(let f of s)if(f.tag==d&&(!f.attrs||f.attrs(p||(p=VM(h,l))))){let m=u.lastChild,g=m.type.id==pW?m.from:u.to;if(g>h.to)return{parser:f.parser,overlay:[{from:h.to,to:g}]}}}}if(o&&c==BM){let u=a.node,h;if(h=u.firstChild){let d=o[l.read(h.from,h.to)];if(d)for(let p of d){if(p.tagName&&p.tagName!=Zk(u.parent,l))continue;let f=u.lastChild;if(f.type.id==Ny){let m=f.from+1,g=f.lastChild,y=f.to-(g&&g.isError?0:1);if(y>m)return{parser:p.parser,overlay:[{from:m,to:y}]}}else if(f.type.id==jM)return{parser:p.parser,overlay:[{from:f.from,to:f.to}]}}}}return null})}const RW=122,Wk=1,MW=123,IW=124,HM=2,LW=125,QW=3,$W=4,XM=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],FW=58,BW=40,qM=95,jW=91,xd=45,zW=46,VW=35,UW=37,HW=38,XW=92,qW=10,ZW=42;function cu(t){return t>=65&&t<=90||t>=97&&t<=122||t>=161}function Cv(t){return t>=48&&t<=57}function Gk(t){return Cv(t)||t>=97&&t<=102||t>=65&&t<=70}const ZM=(t,e,n)=>(r,i)=>{for(let s=!1,o=0,a=0;;a++){let{next:l}=r;if(cu(l)||l==xd||l==qM||s&&Cv(l))!s&&(l!=xd||a>0)&&(s=!0),o===a&&l==xd&&o++,r.advance();else if(l==XW&&r.peek(1)!=qW){if(r.advance(),Gk(r.next)){do r.advance();while(Gk(r.next));r.next==32&&r.advance()}else r.next>-1&&r.advance();s=!0}else{s&&r.acceptToken(o==2&&i.canShift(HM)?e:l==BW?n:t);break}}},WW=new Kn(ZM(MW,HM,IW)),GW=new Kn(ZM(LW,QW,$W)),YW=new Kn(t=>{if(XM.includes(t.peek(-1))){let{next:e}=t;(cu(e)||e==qM||e==VW||e==zW||e==ZW||e==jW||e==FW&&cu(t.peek(1))||e==xd||e==HW)&&t.acceptToken(RW)}}),KW=new Kn(t=>{if(!XM.includes(t.peek(-1))){let{next:e}=t;if(e==UW&&(t.advance(),t.acceptToken(Wk)),cu(e)){do t.advance();while(cu(t.next)||Cv(t.next));t.acceptToken(Wk)}}}),JW=im({"AtKeyword import charset namespace keyframes media supports":R.definitionKeyword,"from to selector":R.keyword,NamespaceName:R.namespace,KeyframeName:R.labelName,KeyframeRangeName:R.operatorKeyword,TagName:R.tagName,ClassName:R.className,PseudoClassName:R.constant(R.className),IdName:R.labelName,"FeatureName PropertyName":R.propertyName,AttributeName:R.attributeName,NumberLiteral:R.number,KeywordQuery:R.keyword,UnaryQueryOp:R.operatorKeyword,"CallTag ValueName":R.atom,VariableName:R.variableName,Callee:R.operatorKeyword,Unit:R.unit,"UniversalSelector NestingSelector":R.definitionOperator,"MatchOp CompareOp":R.compareOperator,"ChildOp SiblingOp, LogicOp":R.logicOperator,BinOp:R.arithmeticOperator,Important:R.modifier,Comment:R.blockComment,ColorLiteral:R.color,"ParenthesizedContent StringLiteral":R.string,":":R.punctuation,"PseudoOp #":R.derefOperator,"; ,":R.separator,"( )":R.paren,"[ ]":R.squareBracket,"{ }":R.brace}),e6={__proto__:null,lang:38,"nth-child":38,"nth-last-child":38,"nth-of-type":38,"nth-last-of-type":38,dir:38,"host-context":38,if:84,url:124,"url-prefix":124,domain:124,regexp:124},t6={__proto__:null,or:98,and:98,not:106,only:106,layer:170},n6={__proto__:null,selector:112,layer:166},r6={__proto__:null,"@import":162,"@media":174,"@charset":178,"@namespace":182,"@keyframes":188,"@supports":200,"@scope":204},i6={__proto__:null,to:207},s6=Ka.deserialize({version:14,states:"EbQYQdOOO#qQdOOP#xO`OOOOQP'#Cf'#CfOOQP'#Ce'#CeO#}QdO'#ChO$nQaO'#CcO$xQdO'#CkO%TQdO'#DpO%YQdO'#DrO%_QdO'#DuO%_QdO'#DxOOQP'#FV'#FVO&eQhO'#EhOOQS'#FU'#FUOOQS'#Ek'#EkQYQdOOO&lQdO'#EOO&PQhO'#EUO&lQdO'#EWO'aQdO'#EYO'lQdO'#E]O'tQhO'#EcO(VQdO'#EeO(bQaO'#CfO)VQ`O'#D{O)[Q`O'#F`O)gQdO'#F`QOQ`OOP)qO&jO'#CaPOOO)C@t)C@tOOQP'#Cj'#CjOOQP,59S,59SO#}QdO,59SO)|QdO,59VO%TQdO,5:[O%YQdO,5:^O%_QdO,5:aO%_QdO,5:cO%_QdO,5:dO%_QdO'#ErO*XQ`O,58}O*aQdO'#DzOOQS,58},58}OOQP'#Cn'#CnOOQO'#Dn'#DnOOQP,59V,59VO*hQ`O,59VO*mQ`O,59VOOQP'#Dq'#DqOOQP,5:[,5:[OOQO'#Ds'#DsO*rQpO,5:^O+]QaO,5:aO+sQaO,5:dOOQW'#DZ'#DZO,ZQhO'#DdO,xQhO'#FaO'tQhO'#DbO-WQ`O'#DhOOQW'#F['#F[O-]Q`O,5;SO-eQ`O'#DeOOQS-E8i-E8iOOQ['#Cs'#CsO-jQdO'#CtO.QQdO'#CzO.hQdO'#C}O/OQ!pO'#DPO1RQ!jO,5:jOOQO'#DU'#DUO*mQ`O'#DTO1cQ!nO'#FXO3`Q`O'#DVO3eQ`O'#DkOOQ['#FX'#FXO-`Q`O,5:pO3jQ!bO,5:rOOQS'#E['#E[O3rQ`O,5:tO3wQdO,5:tOOQO'#E_'#E_O4PQ`O,5:wO4UQhO,5:}O%_QdO'#DgOOQS,5;P,5;PO-eQ`O,5;PO4^QdO,5;PO4fQdO,5:gO4vQdO'#EtO5TQ`O,5;zO5TQ`O,5;zPOOO'#Ej'#EjP5`O&jO,58{POOO,58{,58{OOQP1G.n1G.nOOQP1G.q1G.qO*hQ`O1G.qO*mQ`O1G.qOOQP1G/v1G/vO5kQpO1G/xO5sQaO1G/{O6ZQaO1G/}O6qQaO1G0OO7XQaO,5;^OOQO-E8p-E8pOOQS1G.i1G.iO7cQ`O,5:fO7hQdO'#DoO7oQdO'#CrOOQP1G/x1G/xO&lQdO1G/xO7vQ!jO'#DZO8UQ!bO,59vO8^QhO,5:OOOQO'#F]'#F]O8XQ!bO,59zO'tQhO,59xO8fQhO'#EvO8sQ`O,5;{O9OQhO,59|O9uQhO'#DiOOQW,5:S,5:SOOQS1G0n1G0nOOQW,5:P,5:PO9|Q!fO'#FYOOQS'#FY'#FYOOQS'#Em'#EmO;^QdO,59`OOQ[,59`,59`O;tQdO,59fOOQ[,59f,59fO<[QdO,59iOOQ[,59i,59iOOQ[,59k,59kO&lQdO,59mOPQ!fO1G0ROOQO1G0R1G0ROOQO,5;`,5;`O>gQdO,5;`OOQO-E8r-E8rO>tQ`O1G1fPOOO-E8h-E8hPOOO1G.g1G.gOOQP7+$]7+$]OOQP7+%d7+%dO&lQdO7+%dOOQS1G0Q1G0QO?PQaO'#F_O?ZQ`O,5:ZO?`Q!fO'#ElO@^QdO'#FWO@hQ`O,59^O@mQ!bO7+%dO&lQdO1G/bO@uQhO1G/fOOQW1G/j1G/jOOQW1G/d1G/dOAWQhO,5;bOOQO-E8t-E8tOAfQhO'#DZOAtQhO'#F^OBPQ`O'#F^OBUQ`O,5:TOOQS-E8k-E8kOOQ[1G.z1G.zOOQ[1G/Q1G/QOOQ[1G/T1G/TOOQ[1G/X1G/XOBZQdO,5:lOOQS7+%p7+%pOB`Q`O7+%pOBeQhO'#DYOBmQ`O,59sO'tQhO,59sOOQ[1G/q1G/qOBuQ`O1G/qOOQS7+%z7+%zOBzQbO'#DPOOQO'#Eb'#EbOCYQ`O'#EaOOQO'#Ea'#EaOCeQ`O'#EwOCmQdO,5:zOOQS,5:z,5:zOOQ[1G/m1G/mOOQS7+&V7+&VO-`Q`O7+&VOCxQ!fO'#EsO&lQdO'#EsOEPQdO7+%mOOQO7+%m7+%mOOQO1G0z1G0zOEdQ!bO<jAN>jOIUQaO,5;]OOQO-E8o-E8oOI`QdO,5;[OOQO-E8n-E8nOOQW<WO&lQdO1G0uOK]Q`O7+'OOOQO,5;a,5;aOOQO-E8s-E8sOOQW<t}!O?V!O!P?t!P!Q@]!Q![AU![!]BP!]!^B{!^!_C^!_!`DY!`!aDm!a!b$q!b!cEn!c!}$q!}#OG{#O#P$q#P#QH^#Q#R6W#R#o$q#o#pHo#p#q6W#q#rIQ#r#sIc#s#y$q#y#z%i#z$f$q$f$g%i$g#BY$q#BY#BZ%i#BZ$IS$q$IS$I_%i$I_$I|$q$I|$JO%i$JO$JT$q$JT$JU%i$JU$KV$q$KV$KW%i$KW&FU$q&FU&FV%i&FV;'S$q;'S;=`Iz<%lO$q`$tSOy%Qz;'S%Q;'S;=`%c<%lO%Q`%VS!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Q`%fP;=`<%l%Q~%nh#s~OX%QX^'Y^p%Qpq'Yqy%Qz#y%Q#y#z'Y#z$f%Q$f$g'Y$g#BY%Q#BY#BZ'Y#BZ$IS%Q$IS$I_'Y$I_$I|%Q$I|$JO'Y$JO$JT%Q$JT$JU'Y$JU$KV%Q$KV$KW'Y$KW&FU%Q&FU&FV'Y&FV;'S%Q;'S;=`%c<%lO%Q~'ah#s~!a`OX%QX^'Y^p%Qpq'Yqy%Qz#y%Q#y#z'Y#z$f%Q$f$g'Y$g#BY%Q#BY#BZ'Y#BZ$IS%Q$IS$I_'Y$I_$I|%Q$I|$JO'Y$JO$JT%Q$JT$JU'Y$JU$KV%Q$KV$KW'Y$KW&FU%Q&FU&FV'Y&FV;'S%Q;'S;=`%c<%lO%Qj)OUOy%Qz#]%Q#]#^)b#^;'S%Q;'S;=`%c<%lO%Qj)gU!a`Oy%Qz#a%Q#a#b)y#b;'S%Q;'S;=`%c<%lO%Qj*OU!a`Oy%Qz#d%Q#d#e*b#e;'S%Q;'S;=`%c<%lO%Qj*gU!a`Oy%Qz#c%Q#c#d*y#d;'S%Q;'S;=`%c<%lO%Qj+OU!a`Oy%Qz#f%Q#f#g+b#g;'S%Q;'S;=`%c<%lO%Qj+gU!a`Oy%Qz#h%Q#h#i+y#i;'S%Q;'S;=`%c<%lO%Qj,OU!a`Oy%Qz#T%Q#T#U,b#U;'S%Q;'S;=`%c<%lO%Qj,gU!a`Oy%Qz#b%Q#b#c,y#c;'S%Q;'S;=`%c<%lO%Qj-OU!a`Oy%Qz#h%Q#h#i-b#i;'S%Q;'S;=`%c<%lO%Qj-iS!qY!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Q~-xWOY-uZr-urs.bs#O-u#O#P.g#P;'S-u;'S;=`/c<%lO-u~.gOt~~.jRO;'S-u;'S;=`.s;=`O-u~.vXOY-uZr-urs.bs#O-u#O#P.g#P;'S-u;'S;=`/c;=`<%l-u<%lO-u~/fP;=`<%l-uj/nYjYOy%Qz!Q%Q!Q![0^![!c%Q!c!i0^!i#T%Q#T#Z0^#Z;'S%Q;'S;=`%c<%lO%Qj0cY!a`Oy%Qz!Q%Q!Q![1R![!c%Q!c!i1R!i#T%Q#T#Z1R#Z;'S%Q;'S;=`%c<%lO%Qj1WY!a`Oy%Qz!Q%Q!Q![1v![!c%Q!c!i1v!i#T%Q#T#Z1v#Z;'S%Q;'S;=`%c<%lO%Qj1}YrY!a`Oy%Qz!Q%Q!Q![2m![!c%Q!c!i2m!i#T%Q#T#Z2m#Z;'S%Q;'S;=`%c<%lO%Qj2tYrY!a`Oy%Qz!Q%Q!Q![3d![!c%Q!c!i3d!i#T%Q#T#Z3d#Z;'S%Q;'S;=`%c<%lO%Qj3iY!a`Oy%Qz!Q%Q!Q![4X![!c%Q!c!i4X!i#T%Q#T#Z4X#Z;'S%Q;'S;=`%c<%lO%Qj4`YrY!a`Oy%Qz!Q%Q!Q![5O![!c%Q!c!i5O!i#T%Q#T#Z5O#Z;'S%Q;'S;=`%c<%lO%Qj5TY!a`Oy%Qz!Q%Q!Q![5s![!c%Q!c!i5s!i#T%Q#T#Z5s#Z;'S%Q;'S;=`%c<%lO%Qj5zSrY!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Qd6ZUOy%Qz!_%Q!_!`6m!`;'S%Q;'S;=`%c<%lO%Qd6tS!hS!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Qb7VSZQOy%Qz;'S%Q;'S;=`%c<%lO%Q~7fWOY7cZw7cwx.bx#O7c#O#P8O#P;'S7c;'S;=`8z<%lO7c~8RRO;'S7c;'S;=`8[;=`O7c~8_XOY7cZw7cwx.bx#O7c#O#P8O#P;'S7c;'S;=`8z;=`<%l7c<%lO7c~8}P;=`<%l7cj9VSeYOy%Qz;'S%Q;'S;=`%c<%lO%Q~9hOd~n9oUWQvWOy%Qz!_%Q!_!`6m!`;'S%Q;'S;=`%c<%lO%Qj:YWvW!mQOy%Qz!O%Q!O!P:r!P!Q%Q!Q![=w![;'S%Q;'S;=`%c<%lO%Qj:wU!a`Oy%Qz!Q%Q!Q![;Z![;'S%Q;'S;=`%c<%lO%Qj;bY!a`#}YOy%Qz!Q%Q!Q![;Z![!g%Q!g!hO[!a`#}YOy%Qz!O%Q!O!P;Z!P!Q%Q!Q![=w![!g%Q!g!hyS!^YOy%Qz;'S%Q;'S;=`%c<%lO%Qj?[WvWOy%Qz!O%Q!O!P:r!P!Q%Q!Q![=w![;'S%Q;'S;=`%c<%lO%Qj?yU]YOy%Qz!Q%Q!Q![;Z![;'S%Q;'S;=`%c<%lO%Q~@bTvWOy%Qz{@q{;'S%Q;'S;=`%c<%lO%Q~@xS!a`#t~Oy%Qz;'S%Q;'S;=`%c<%lO%QjAZ[#}YOy%Qz!O%Q!O!P;Z!P!Q%Q!Q![=w![!g%Q!g!he6[t]||-1},{term:125,get:t=>t6[t]||-1},{term:4,get:t=>n6[t]||-1},{term:25,get:t=>r6[t]||-1},{term:123,get:t=>i6[t]||-1}],tokenPrec:1963});let My=[],WM=[];(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,n=0;e>1;if(t=WM[r])e=r+1;else return!0;if(e==n)return!1}}function Yk(t){return t>=127462&&t<=127487}const Kk=8205;function a6(t,e,n=!0,r=!0){return(n?GM:l6)(t,e,r)}function GM(t,e,n){if(e==t.length)return e;e&&YM(t.charCodeAt(e))&&KM(t.charCodeAt(e-1))&&e--;let r=Qg(t,e);for(e+=Jk(r);e=0&&Yk(Qg(t,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function l6(t,e,n){for(;e>0;){let r=GM(t,e-2,n);if(r=56320&&t<57344}function KM(t){return t>=55296&&t<56320}function Jk(t){return t<65536?1:2}let We=class JM{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,n,r){[e,n]=Ja(this,e,n);let i=[];return this.decompose(0,e,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(n,this.length,i,1),ei.from(i,this.length-(n-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=Ja(this,e,n);let r=[];return this.decompose(e,n,r,0),ei.from(r,n-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let n=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),i=new bc(this),s=new bc(e);for(let o=n,a=n;;){if(i.next(o),s.next(o),o=0,i.lineBreak!=s.lineBreak||i.done!=s.done||i.value!=s.value)return!1;if(a+=i.value.length,i.done||a>=r)return!0}}iter(e=1){return new bc(this,e)}iterRange(e,n=this.length){return new eI(this,e,n)}iterLines(e,n){let r;if(e==null)r=this.iter();else{n==null&&(n=this.lines+1);let i=this.line(e).from;r=this.iterRange(i,Math.max(i,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new tI(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?JM.empty:e.length<=32?new wt(e):ei.from(wt.split(e,[]))}};class wt extends We{constructor(e,n=c6(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,r,i){for(let s=0;;s++){let o=this.text[s],a=i+o.length;if((n?r:a)>=e)return new u6(i,a,r,o);i=a+1,r++}}decompose(e,n,r,i){let s=e<=0&&n>=this.length?this:new wt(e_(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(i&1){let o=r.pop(),a=Cd(s.text,o.text.slice(),0,s.length);if(a.length<=32)r.push(new wt(a,o.length+s.length));else{let l=a.length>>1;r.push(new wt(a.slice(0,l)),new wt(a.slice(l)))}}else r.push(s)}replace(e,n,r){if(!(r instanceof wt))return super.replace(e,n,r);[e,n]=Ja(this,e,n);let i=Cd(this.text,Cd(r.text,e_(this.text,0,e)),n),s=this.length+r.length-(n-e);return i.length<=32?new wt(i,s):ei.from(wt.split(i,[]),s)}sliceString(e,n=this.length,r=` `){[e,n]=Ja(this,e,n);let i="";for(let s=0,o=0;s<=n&&oe&&o&&(i+=r),es&&(i+=a.slice(Math.max(0,e-s),n-s)),s=l+1}return i}flatten(e){for(let n of this.text)e.push(n)}scanIdentical(){return 0}static split(e,n){let r=[],i=-1;for(let s of e)r.push(s),i+=s.length+1,r.length==32&&(n.push(new wt(r,i)),r=[],i=-1);return i>-1&&n.push(new wt(r,i)),n}}class ei extends We{constructor(e,n){super(),this.children=e,this.length=n,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,n,r,i){for(let s=0;;s++){let o=this.children[s],a=i+o.length,l=r+o.lines-1;if((n?l:a)>=e)return o.lineInner(e,n,r,i);i=a+1,r=l+1}}decompose(e,n,r,i){for(let s=0,o=0;o<=n&&s=o){let c=i&((o<=e?1:0)|(l>=n?2:0));o>=e&&l<=n&&!c?r.push(a):a.decompose(e-o,n-o,r,c)}o=l+1}}replace(e,n,r){if([e,n]=Ja(this,e,n),r.lines=s&&n<=a){let l=o.replace(e-s,n-s,r),c=this.lines-o.lines+l.lines;if(l.lines>4&&l.lines>c>>6){let u=this.children.slice();return u[i]=l,new ei(u,this.length-(n-e)+r.length)}return super.replace(s,a,l)}s=a+1}return super.replace(e,n,r)}sliceString(e,n=this.length,r=` `){[e,n]=Ja(this,e,n);let i="";for(let s=0,o=0;se&&s&&(i+=r),eo&&(i+=a.sliceString(e-o,n-o,r)),o=l+1}return i}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof ei))return 0;let r=0,[i,s,o,a]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=n,s+=n){if(i==o||s==a)return r;let l=this.children[i],c=e.children[s];if(l!=c)return r+l.scanIdentical(c,n);r+=l.length+1}}static from(e,n=e.reduce((r,i)=>r+i.length+1,-1)){let r=0;for(let p of e)r+=p.lines;if(r<32){let p=[];for(let f of e)f.flatten(p);return new wt(p,n)}let i=Math.max(32,r>>5),s=i<<1,o=i>>1,a=[],l=0,c=-1,u=[];function h(p){let f;if(p.lines>s&&p instanceof ei)for(let m of p.children)h(m);else p.lines>o&&(l>o||!l)?(d(),a.push(p)):p instanceof wt&&l&&(f=u[u.length-1])instanceof wt&&p.lines+f.lines<=32?(l+=p.lines,c+=p.length+1,u[u.length-1]=new wt(f.text.concat(p.text),f.length+1+p.length)):(l+p.lines>i&&d(),l+=p.lines,c+=p.length+1,u.push(p))}function d(){l!=0&&(a.push(u.length==1?u[0]:ei.from(u,c)),c=-1,l=u.length=0)}for(let p of e)h(p);return d(),a.length==1?a[0]:new ei(a,n)}}We.empty=new wt([""],0);function c6(t){let e=-1;for(let n of t)e+=n.length+1;return e}function Cd(t,e,n=0,r=1e9){for(let i=0,s=0,o=!0;s=n&&(l>r&&(a=a.slice(0,r-i)),i0?1:(e instanceof wt?e.text.length:e.children.length)<<1]}nextInner(e,n){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,i=this.nodes[r],s=this.offsets[r],o=s>>1,a=i instanceof wt?i.text.length:i.children.length;if(o==(n>0?a:0)){if(r==0)return this.done=!0,this.value="",this;n>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(n>0?0:1)){if(this.offsets[r]+=n,e==0)return this.lineBreak=!0,this.value=` `,this;e--}else if(i instanceof wt){let l=i.text[o+(n<0?-1:0)];if(this.offsets[r]+=n,l.length>Math.max(0,e))return this.value=e==0?l:n>0?l.slice(e):l.slice(0,l.length-e),this;e-=l.length}else{let l=i.children[o+(n<0?-1:0)];e>l.length?(e-=l.length,this.offsets[r]+=n):(n<0&&this.offsets[r]--,this.nodes.push(l),this.offsets.push(n>0?1:(l instanceof wt?l.text.length:l.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class eI{constructor(e,n,r){this.value="",this.done=!1,this.cursor=new bc(e,n>r?-1:1),this.pos=n>r?e.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}nextInner(e,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let r=n<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*n,this.value=i.length<=r?i:n<0?i.slice(i.length-r):i.slice(0,r),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class tI{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:r,value:i}=this.inner.next(e);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(We.prototype[Symbol.iterator]=function(){return this.iter()},bc.prototype[Symbol.iterator]=eI.prototype[Symbol.iterator]=tI.prototype[Symbol.iterator]=function(){return this});class u6{constructor(e,n,r,i){this.from=e,this.to=n,this.number=r,this.text=i}get length(){return this.to-this.from}}function Ja(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}function Fi(t,e,n=!0,r=!0){return a6(t,e,n,r)}function h6(t){return t>=56320&&t<57344}function d6(t){return t>=55296&&t<56320}function p6(t,e){let n=t.charCodeAt(e);if(!d6(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return h6(r)?(n-55296<<10)+(r-56320)+65536:n}function f6(t){return t<65536?1:2}const Iy=/\r\n?|\n/;var Sn=(function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t})(Sn||(Sn={}));class Hi{constructor(e){this.sections=e}get length(){let e=0;for(let n=0;ne)return s+(e-i);s+=a}else{if(r!=Sn.Simple&&c>=e&&(r==Sn.TrackDel&&ie||r==Sn.TrackBefore&&ie))return null;if(c>e||c==e&&n<0&&!a)return e==i||n<0?s:s+l;s+=l}i=c}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return s}touchesRange(e,n=e){for(let r=0,i=0;r=0&&i<=n&&a>=e)return in?"cover":!0;i=a}return!1}toString(){let e="";for(let n=0;n=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Hi(e)}static create(e){return new Hi(e)}}class Ht extends Hi{constructor(e,n){super(e),this.inserted=n}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return Ly(this,(n,r,i,s,o)=>e=e.replace(i,i+(r-n),o),!1),e}mapDesc(e,n=!1){return Qy(this,e,n,!0)}invert(e){let n=this.sections.slice(),r=[];for(let i=0,s=0;i=0){n[i]=a,n[i+1]=o;let l=i>>1;for(;r.length0&&Ps(r,n,s.text),s.forward(u),a+=u}let c=e[o++];for(;a>1].toJSON()))}return e}static of(e,n,r){let i=[],s=[],o=0,a=null;function l(u=!1){if(!u&&!i.length)return;od||h<0||d>n)throw new RangeError(`Invalid change range ${h} to ${d} (in doc of length ${n})`);let f=p?typeof p=="string"?We.of(p.split(r||Iy)):p:We.empty,m=f.length;if(h==d&&m==0)return;ho&&hn(i,h-o,-1),hn(i,d-h,m),Ps(s,i,f),o=d}}return c(e),l(!a),a}static empty(e){return new Ht(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],r=[];for(let i=0;ia&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)n.push(s[0],0);else{for(;r.length=0&&n<=0&&n==t[i+1]?t[i]+=e:i>=0&&e==0&&t[i]==0?t[i+1]+=n:r?(t[i]+=e,t[i+1]+=n):t.push(e,n)}function Ps(t,e,n){if(n.length==0)return;let r=e.length-2>>1;if(r>1])),!(n||o==t.sections.length||t.sections[o+1]<0);)a=t.sections[o++],l=t.sections[o++];e(i,c,s,u,h),i=c,s=u}}}function Qy(t,e,n,r=!1){let i=[],s=r?[]:null,o=new uu(t),a=new uu(e);for(let l=-1;;){if(o.done&&a.len||a.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&a.ins==-1){let c=Math.min(o.len,a.len);hn(i,c,-1),o.forward(c),a.forward(c)}else if(a.ins>=0&&(o.ins<0||l==o.i||o.off==0&&(a.len=0&&l=0){let c=0,u=o.len;for(;u;)if(a.ins==-1){let h=Math.min(u,a.len);c+=h,u-=h,a.forward(h)}else if(a.ins==0&&a.lenl||o.ins>=0&&o.len>l)&&(a||r.length>c),s.forward2(l),o.forward(l)}}}}class uu{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return n>=e.length?We.empty:e[n]}textBit(e){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!e?We.empty:n[r].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class So{constructor(e,n,r){this.from=e,this.to=n,this.flags=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,n=-1){let r,i;return this.empty?r=i=e.mapPos(this.from,n):(r=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new So(r,i,this.flags)}extend(e,n=e){if(e<=this.anchor&&n>=this.anchor)return ae.range(e,n);let r=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return ae.range(this.anchor,r)}eq(e,n=!1){return this.anchor==e.anchor&&this.head==e.head&&(!n||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return ae.range(e.anchor,e.head)}static create(e,n,r){return new So(e,n,r)}}class ae{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:ae.create(this.ranges.map(r=>r.map(e,n)),this.mainIndex)}eq(e,n=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let r=0;re.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new ae(e.ranges.map(n=>So.fromJSON(n)),e.main)}static single(e,n=e){return new ae([ae.range(e,n)],0)}static create(e,n=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,i=0;ie?8:0)|s)}static normalized(e,n=0){let r=e[n];e.sort((i,s)=>i.from-s.from),n=e.indexOf(r);for(let i=1;is.head?ae.range(l,a):ae.range(a,l))}}return new ae(e,n)}}function rI(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let Dv=0;class Ee{constructor(e,n,r,i,s){this.combine=e,this.compareInput=n,this.compare=r,this.isStatic=i,this.id=Dv++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new Ee(e.combine||(n=>n),e.compareInput||((n,r)=>n===r),e.compare||(e.combine?(n,r)=>n===r:Av),!!e.static,e.enables)}of(e){return new Dd([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Dd(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Dd(e,this,2,n)}from(e,n){return n||(n=r=>r),this.compute([e],r=>n(r.field(e)))}}function Av(t,e){return t==e||t.length==e.length&&t.every((n,r)=>n===e[r])}class Dd{constructor(e,n,r,i){this.dependencies=e,this.facet=n,this.type=r,this.value=i,this.id=Dv++}dynamicSlot(e){var n;let r=this.value,i=this.facet.compareInput,s=this.id,o=e[s]>>1,a=this.type==2,l=!1,c=!1,u=[];for(let h of this.dependencies)h=="doc"?l=!0:h=="selection"?c=!0:(((n=e[h.id])!==null&&n!==void 0?n:1)&1)==0&&u.push(e[h.id]);return{create(h){return h.values[o]=r(h),1},update(h,d){if(l&&d.docChanged||c&&(d.docChanged||d.selection)||$y(h,u)){let p=r(h);if(a?!t_(p,h.values[o],i):!i(p,h.values[o]))return h.values[o]=p,1}return 0},reconfigure:(h,d)=>{let p,f=d.config.address[s];if(f!=null){let m=Ep(d,f);if(this.dependencies.every(g=>g instanceof Ee?d.facet(g)===h.facet(g):g instanceof to?d.field(g,!1)==h.field(g,!1):!0)||(a?t_(p=r(h),m,i):i(p=r(h),m)))return h.values[o]=m,0}else p=r(h);return h.values[o]=p,1}}}}function t_(t,e,n){if(t.length!=e.length)return!1;for(let r=0;rt[l.id]),i=n.map(l=>l.type),s=r.filter(l=>!(l&1)),o=t[e.id]>>1;function a(l){let c=[];for(let u=0;ur===i),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet(Ih).find(r=>r.field==this);return((n==null?void 0:n.create)||this.createF)(e)}slot(e){let n=e[this.id]>>1;return{create:r=>(r.values[n]=this.create(r),1),update:(r,i)=>{let s=r.values[n],o=this.updateF(s,i);return this.compareF(s,o)?0:(r.values[n]=o,1)},reconfigure:(r,i)=>{let s=r.facet(Ih),o=i.facet(Ih),a;return(a=s.find(l=>l.field==this))&&a!=o.find(l=>l.field==this)?(r.values[n]=a.create(r),1):i.config.address[this.id]!=null?(r.values[n]=i.field(this),0):(r.values[n]=this.create(r),1)}}}init(e){return[this,Ih.of({field:this,create:e})]}get extension(){return this}}const bo={lowest:4,low:3,default:2,high:1,highest:0};function Il(t){return e=>new iI(e,t)}const sm={highest:Il(bo.highest),high:Il(bo.high),default:Il(bo.default),low:Il(bo.low),lowest:Il(bo.lowest)};class iI{constructor(e,n){this.inner=e,this.prec=n}}class om{of(e){return new Fy(this,e)}reconfigure(e){return om.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Fy{constructor(e,n){this.compartment=e,this.inner=n}}class bp{constructor(e,n,r,i,s,o){for(this.base=e,this.compartments=n,this.dynamicSlots=r,this.address=i,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,n,r){let i=[],s=Object.create(null),o=new Map;for(let d of g6(e,n,o))d instanceof to?i.push(d):(s[d.facet.id]||(s[d.facet.id]=[])).push(d);let a=Object.create(null),l=[],c=[];for(let d of i)a[d.id]=c.length<<1,c.push(p=>d.slot(p));let u=r==null?void 0:r.config.facets;for(let d in s){let p=s[d],f=p[0].facet,m=u&&u[d]||[];if(p.every(g=>g.type==0))if(a[f.id]=l.length<<1|1,Av(m,p))l.push(r.facet(f));else{let g=f.combine(p.map(y=>y.value));l.push(r&&f.compare(g,r.facet(f))?r.facet(f):g)}else{for(let g of p)g.type==0?(a[g.id]=l.length<<1|1,l.push(g.value)):(a[g.id]=c.length<<1,c.push(y=>g.dynamicSlot(y)));a[f.id]=c.length<<1,c.push(g=>m6(g,f,p))}}let h=c.map(d=>d(a));return new bp(e,o,h,a,l,s)}}function g6(t,e,n){let r=[[],[],[],[],[]],i=new Map;function s(o,a){let l=i.get(o);if(l!=null){if(l<=a)return;let c=r[l].indexOf(o);c>-1&&r[l].splice(c,1),o instanceof Fy&&n.delete(o.compartment)}if(i.set(o,a),Array.isArray(o))for(let c of o)s(c,a);else if(o instanceof Fy){if(n.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=e.get(o.compartment)||o.inner;n.set(o.compartment,c),s(c,a)}else if(o instanceof iI)s(o.inner,o.prec);else if(o instanceof to)r[a].push(o),o.provides&&s(o.provides,a);else if(o instanceof Dd)r[a].push(o),o.facet.extensions&&s(o.facet.extensions,bo.default);else{let c=o.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(c,a)}}return s(t,bo.default),r.reduce((o,a)=>o.concat(a))}function Ec(t,e){if(e&1)return 2;let n=e>>1,r=t.status[n];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;t.status[n]=4;let i=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|i}function Ep(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const sI=Ee.define(),By=Ee.define({combine:t=>t.some(e=>e),static:!0}),oI=Ee.define({combine:t=>t.length?t[0]:void 0,static:!0}),aI=Ee.define(),lI=Ee.define(),cI=Ee.define(),uI=Ee.define({combine:t=>t.length?t[0]:!1});class Jo{constructor(e,n){this.type=e,this.value=n}static define(){return new O6}}class O6{of(e){return new Jo(this,e)}}class y6{constructor(e){this.map=e}of(e){return new Et(this,e)}}class Et{constructor(e,n){this.type=e,this.value=n}map(e){let n=this.type.map(this.value,e);return n===void 0?void 0:n==this.value?this:new Et(this.type,n)}is(e){return this.type==e}static define(e={}){return new y6(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let r=[];for(let i of e){let s=i.map(n);s&&r.push(s)}return r}}Et.reconfigure=Et.define();Et.appendConfig=Et.define();class nn{constructor(e,n,r,i,s,o){this.startState=e,this.changes=n,this.selection=r,this.effects=i,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,r&&rI(r,n.newLength),s.some(a=>a.type==nn.time)||(this.annotations=s.concat(nn.time.of(Date.now())))}static create(e,n,r,i,s,o){return new nn(e,n,r,i,s,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let n of this.annotations)if(n.type==e)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let n=this.annotation(nn.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}}nn.time=Jo.define();nn.userEvent=Jo.define();nn.addToHistory=Jo.define();nn.remote=Jo.define();function b6(t,e){let n=[];for(let r=0,i=0;;){let s,o;if(r=t[r]))s=t[r++],o=t[r++];else if(i=0;i--){let s=r[i](t);s instanceof nn?t=s:Array.isArray(s)&&s.length==1&&s[0]instanceof nn?t=s[0]:t=dI(e,Ma(s),!1)}return t}function v6(t){let e=t.startState,n=e.facet(cI),r=t;for(let i=n.length-1;i>=0;i--){let s=n[i](t);s&&Object.keys(s).length&&(r=hI(r,jy(e,s,t.changes.newLength),!0))}return r==t?t:nn.create(e,t.changes,t.selection,r.effects,r.annotations,r.scrollIntoView)}const T6=[];function Ma(t){return t==null?T6:Array.isArray(t)?t:[t]}var Bi=(function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t})(Bi||(Bi={}));const S6=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let zy;try{zy=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function w6(t){if(zy)return zy.test(t);for(let e=0;e"€"&&(n.toUpperCase()!=n.toLowerCase()||S6.test(n)))return!0}return!1}function k6(t){return e=>{if(!/\S/.test(e))return Bi.Space;if(w6(e))return Bi.Word;for(let n=0;n-1)return Bi.Word;return Bi.Other}}class Ze{constructor(e,n,r,i,s,o){this.config=e,this.doc=n,this.selection=r,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let a=0;ai.set(c,l)),n=null),i.set(a.value.compartment,a.value.extension)):a.is(Et.reconfigure)?(n=null,r=a.value):a.is(Et.appendConfig)&&(n=null,r=Ma(r).concat(a.value));let s;n?s=e.startState.values.slice():(n=bp.resolve(r,i,this),s=new Ze(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(a,l)=>l.reconfigure(a,this),null).values);let o=e.startState.facet(By)?e.newSelection:e.newSelection.asSingle();new Ze(n,e.newDoc,o,s,(a,l)=>l.update(a,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:e},range:ae.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,r=e(n.ranges[0]),i=this.changes(r.changes),s=[r.range],o=Ma(r.effects);for(let a=1;ao.spec.fromJSON(a,l)))}}return Ze.create({doc:e.doc,selection:ae.fromJSON(e.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(e={}){let n=bp.resolve(e.extensions||[],new Map),r=e.doc instanceof We?e.doc:We.of((e.doc||"").split(n.staticFacet(Ze.lineSeparator)||Iy)),i=e.selection?e.selection instanceof ae?e.selection:ae.single(e.selection.anchor,e.selection.head):ae.single(0);return rI(i,r.length),n.staticFacet(By)||(i=i.asSingle()),new Ze(n,r,i,n.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(Ze.tabSize)}get lineBreak(){return this.facet(Ze.lineSeparator)||` `}get readOnly(){return this.facet(uI)}phrase(e,...n){for(let r of this.facet(Ze.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return n.length&&(e=e.replace(/\$(\$|\d*)/g,(r,i)=>{if(i=="$")return"$";let s=+(i||1);return!s||s>n.length?r:n[s-1]})),e}languageDataAt(e,n,r=-1){let i=[];for(let s of this.facet(sI))for(let o of s(this,n,r))Object.prototype.hasOwnProperty.call(o,e)&&i.push(o[e]);return i}charCategorizer(e){return k6(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:n,from:r,length:i}=this.doc.lineAt(e),s=this.charCategorizer(e),o=e-r,a=e-r;for(;o>0;){let l=Fi(n,o,!1);if(s(n.slice(l,o))!=Bi.Word)break;o=l}for(;at.length?t[0]:4});Ze.lineSeparator=oI;Ze.readOnly=uI;Ze.phrases=Ee.define({compare(t,e){let n=Object.keys(t),r=Object.keys(e);return n.length==r.length&&n.every(i=>t[i]==e[i])}});Ze.languageData=sI;Ze.changeFilter=aI;Ze.transactionFilter=lI;Ze.transactionExtender=cI;om.reconfigure=Et.define();function _6(t,e,n={}){let r={};for(let i of t)for(let s of Object.keys(i)){let o=i[s],a=r[s];if(a===void 0)r[s]=o;else if(!(a===o||o===void 0))if(Object.hasOwnProperty.call(n,s))r[s]=n[s](a,o);else throw new Error("Config merge conflict for field "+s)}for(let i in e)r[i]===void 0&&(r[i]=e[i]);return r}class Fo{eq(e){return this==e}range(e,n=e){return hu.create(e,n,this)}}Fo.prototype.startSide=Fo.prototype.endSide=0;Fo.prototype.point=!1;Fo.prototype.mapMode=Sn.TrackDel;class hu{constructor(e,n,r){this.from=e,this.to=n,this.value=r}static create(e,n,r){return new hu(e,n,r)}}function Vy(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class Pv{constructor(e,n,r,i){this.from=e,this.to=n,this.value=r,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,n,r,i=0){let s=r?this.to:this.from;for(let o=i,a=s.length;;){if(o==a)return o;let l=o+a>>1,c=s[l]-e||(r?this.value[l].endSide:this.value[l].startSide)-n;if(l==o)return c>=0?o:a;c>=0?a=l:o=l+1}}between(e,n,r,i){for(let s=this.findIndex(n,-1e9,!0),o=this.findIndex(r,1e9,!1,s);sp||d==p&&c.startSide>0&&c.endSide<=0)continue;(p-d||c.endSide-c.startSide)<0||(o<0&&(o=d),c.point&&(a=Math.max(a,p-d)),r.push(c),i.push(d-o),s.push(p-o))}return{mapped:r.length?new Pv(i,s,r,a):null,pos:o}}}class Ye{constructor(e,n,r,i){this.chunkPos=e,this.chunk=n,this.nextLayer=r,this.maxPoint=i}static create(e,n,r,i){return new Ye(e,n,r,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let n of this.chunk)e+=n.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:n=[],sort:r=!1,filterFrom:i=0,filterTo:s=this.length}=e,o=e.filter;if(n.length==0&&!o)return this;if(r&&(n=n.slice().sort(Vy)),this.isEmpty)return n.length?Ye.of(n):this;let a=new pI(this,null,-1).goto(0),l=0,c=[],u=new du;for(;a.value||l=0){let h=n[l++];u.addInner(h.from,h.to,h.value)||c.push(h)}else a.rangeIndex==1&&a.chunkIndexthis.chunkEnd(a.chunkIndex)||sa.to||s=s&&e<=s+o.length&&o.between(s,e-s,n-s,r)===!1)return}this.nextLayer.between(e,n,r)}}iter(e=0){return pu.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return pu.from(e).goto(n)}static compare(e,n,r,i,s=-1){let o=e.filter(h=>h.maxPoint>0||!h.isEmpty&&h.maxPoint>=s),a=n.filter(h=>h.maxPoint>0||!h.isEmpty&&h.maxPoint>=s),l=n_(o,a,r),c=new Ll(o,l,s),u=new Ll(a,l,s);r.iterGaps((h,d,p)=>r_(c,h,u,d,p,i)),r.empty&&r.length==0&&r_(c,0,u,0,0,i)}static eq(e,n,r=0,i){i==null&&(i=999999999);let s=e.filter(u=>!u.isEmpty&&n.indexOf(u)<0),o=n.filter(u=>!u.isEmpty&&e.indexOf(u)<0);if(s.length!=o.length)return!1;if(!s.length)return!0;let a=n_(s,o),l=new Ll(s,a,0).goto(r),c=new Ll(o,a,0).goto(r);for(;;){if(l.to!=c.to||!Uy(l.active,c.active)||l.point&&(!c.point||!l.point.eq(c.point)))return!1;if(l.to>i)return!0;l.next(),c.next()}}static spans(e,n,r,i,s=-1){let o=new Ll(e,null,s).goto(n),a=n,l=o.openStart;for(;;){let c=Math.min(o.to,r);if(o.point){let u=o.activeForPoint(o.to),h=o.pointFroma&&(i.span(a,c,o.active,l),l=o.openEnd(c));if(o.to>r)return l+(o.point&&o.to>r?1:0);a=o.to,o.next()}}static of(e,n=!1){let r=new du;for(let i of e instanceof hu?[e]:n?x6(e):e)r.add(i.from,i.to,i.value);return r.finish()}static join(e){if(!e.length)return Ye.empty;let n=e[e.length-1];for(let r=e.length-2;r>=0;r--)for(let i=e[r];i!=Ye.empty;i=i.nextLayer)n=new Ye(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}}Ye.empty=new Ye([],[],null,-1);function x6(t){if(t.length>1)for(let e=t[0],n=1;n0)return t.slice().sort(Vy);e=r}return t}Ye.empty.nextLayer=Ye.empty;class du{finishChunk(e){this.chunks.push(new Pv(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,n,r){this.addInner(e,n,r)||(this.nextLayer||(this.nextLayer=new du)).add(e,n,r)}addInner(e,n,r){let i=e-this.lastTo||r.startSide-this.last.endSide;if(i<=0&&(e-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return i<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(n-this.chunkStart),this.last=r,this.lastFrom=e,this.lastTo=n,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,n-e)),!0)}addChunk(e,n){if((e-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(e);let r=n.value.length-1;return this.last=n.value[r],this.lastFrom=n.from[r]+e,this.lastTo=n.to[r]+e,!0}finish(){return this.finishInner(Ye.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=Ye.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}}function n_(t,e,n){let r=new Map;for(let s of t)for(let o=0;o=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=r&&i.push(new pI(o,n,r,s));return i.length==1?i[0]:new pu(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,n=-1e9){for(let r of this.heap)r.goto(e,n);for(let r=this.heap.length>>1;r>=0;r--)$g(this.heap,r);return this.next(),this}forward(e,n){for(let r of this.heap)r.forward(e,n);for(let r=this.heap.length>>1;r>=0;r--)$g(this.heap,r);(this.to-e||this.value.endSide-n)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),$g(this.heap,0)}}}function $g(t,e){for(let n=t[e];;){let r=(e<<1)+1;if(r>=t.length)break;let i=t[r];if(r+1=0&&(i=t[r+1],r++),n.compare(i)<0)break;t[r]=n,t[e]=i,e=r}}class Ll{constructor(e,n,r){this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=pu.from(e,n,r)}goto(e,n=-1e9){return this.cursor.goto(e,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=n,this.openStart=-1,this.next(),this}forward(e,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(e,n)}removeActive(e){Lh(this.active,e),Lh(this.activeTo,e),Lh(this.activeRank,e),this.minActive=i_(this.active,this.activeTo)}addActive(e){let n=0,{value:r,to:i,rank:s}=this.cursor;for(;n0;)n++;Qh(this.active,n,r),Qh(this.activeTo,n,i),Qh(this.activeRank,n,s),e&&Qh(e,n,this.cursor.from),this.minActive=i_(this.active,this.activeTo)}next(){let e=this.to,n=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),r&&Lh(r,i)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(r),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from=0&&r[i]=0&&!(this.activeRank[r]e||this.activeTo[r]==e&&this.active[r].endSide>=this.point.endSide)&&n.push(this.active[r]);return n.reverse()}openEnd(e){let n=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>e;r--)n++;return n}}function r_(t,e,n,r,i,s){t.goto(e),n.goto(r);let o=r+i,a=r,l=r-e;for(;;){let c=t.to+l-n.to,u=c||t.endSide-n.endSide,h=u<0?t.to+l:n.to,d=Math.min(h,o);if(t.point||n.point?t.point&&n.point&&(t.point==n.point||t.point.eq(n.point))&&Uy(t.activeForPoint(t.to),n.activeForPoint(n.to))||s.comparePoint(a,d,t.point,n.point):d>a&&!Uy(t.active,n.active)&&s.compareRange(a,d,t.active,n.active),h>o)break;(c||t.openEnd!=n.openEnd)&&s.boundChange&&s.boundChange(h),a=h,u<=0&&t.next(),u>=0&&n.next()}}function Uy(t,e){if(t.length!=e.length)return!1;for(let n=0;n=e;r--)t[r+1]=t[r];t[e]=n}function i_(t,e){let n=-1,r=1e9;for(let i=0;i=e)return i;if(i==t.length)break;s+=t.charCodeAt(i)==9?n-s%n:1,i=Fi(t,i)}return t.length}const Hy="ͼ",s_=typeof Symbol>"u"?"__"+Hy:Symbol.for(Hy),Xy=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),o_=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class qs{constructor(e,n){this.rules=[];let{finish:r}=n||{};function i(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function s(o,a,l,c){let u=[],h=/^@(\w+)\b/.exec(o[0]),d=h&&h[1]=="keyframes";if(h&&a==null)return l.push(o[0]+";");for(let p in a){let f=a[p];if(/&/.test(p))s(p.split(/,\s*/).map(m=>o.map(g=>m.replace(/&/,g))).reduce((m,g)=>m.concat(g)),f,l);else if(f&&typeof f=="object"){if(!h)throw new RangeError("The value of a property ("+p+") should be a primitive value.");s(i(p),f,u,d)}else f!=null&&u.push(p.replace(/_.*/,"").replace(/[A-Z]/g,m=>"-"+m.toLowerCase())+": "+f+";")}(u.length||d)&&l.push((r&&!h&&!c?o.map(r):o).join(", ")+" {"+u.join(" ")+"}")}for(let o in e)s(i(o),e[o],this.rules)}getRules(){return this.rules.join(` `)}static newName(){let e=o_[s_]||1;return o_[s_]=e+1,Hy+e.toString(36)}static mount(e,n,r){let i=e[Xy],s=r&&r.nonce;i?s&&i.setNonce(s):i=new D6(e,s),i.mount(Array.isArray(n)?n:[n],e)}}let a_=new Map;class D6{constructor(e,n){let r=e.ownerDocument||e,i=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let s=a_.get(r);if(s)return e[Xy]=s;this.sheet=new i.CSSStyleSheet,a_.set(r,this)}else this.styleTag=r.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],e[Xy]=this}mount(e,n){let r=this.sheet,i=0,s=0;for(let o=0;o-1&&(this.modules.splice(l,1),s--,l=-1),l==-1){if(this.modules.splice(s++,0,a),r)for(let c=0;c2);var se={mac:c_||/Mac/.test(Tn.platform),windows:/Win/.test(Tn.platform),linux:/Linux|X11/.test(Tn.platform),ie:am,ie_version:fI?qy.documentMode||6:Wy?+Wy[1]:Zy?+Zy[1]:0,gecko:l_,gecko_version:l_?+(/Firefox\/(\d+)/.exec(Tn.userAgent)||[0,0])[1]:0,chrome:!!Fg,chrome_version:Fg?+Fg[1]:0,ios:c_,android:/Android\b/.test(Tn.userAgent),webkit_version:A6?+(/\bAppleWebKit\/(\d+)/.exec(Tn.userAgent)||[0,0])[1]:0,safari:Gy,safari_version:Gy?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Tn.userAgent)||[0,0])[1]:0,tabSize:qy.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function fu(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function Yy(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function Ad(t,e){if(!e.anchorNode)return!1;try{return Yy(t,e.anchorNode)}catch{return!1}}function mu(t){return t.nodeType==3?jo(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function vc(t,e,n,r){return n?u_(t,e,n,r,-1)||u_(t,e,n,r,1):!1}function Bo(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function vp(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function u_(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:di(t))){if(t.nodeName=="DIV")return!1;let s=t.parentNode;if(!s||s.nodeType!=1)return!1;e=Bo(t)+(i<0?0:1),t=s}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=i<0?di(t):0}else return!1}}function di(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function lm(t,e){let n=e?t.left:t.right;return{left:n,right:n,top:t.top,bottom:t.bottom}}function P6(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function mI(t,e){let n=e.width/t.offsetWidth,r=e.height/t.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.width-t.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(e.height-t.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function N6(t,e,n,r,i,s,o,a){let l=t.ownerDocument,c=l.defaultView||window;for(let u=t,h=!1;u&&!h;)if(u.nodeType==1){let d,p=u==l.body,f=1,m=1;if(p)d=P6(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(h=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let b=u.getBoundingClientRect();({scaleX:f,scaleY:m}=mI(u,b)),d={left:b.left,right:b.left+u.clientWidth*f,top:b.top,bottom:b.top+u.clientHeight*m}}let g=0,y=0;if(i=="nearest")e.top0&&e.bottom>d.bottom+y&&(y=e.bottom-d.bottom+o)):e.bottom>d.bottom&&(y=e.bottom-d.bottom+o,n<0&&e.top-y0&&e.right>d.right+g&&(g=e.right-d.right+s)):e.right>d.right&&(g=e.right-d.right+s,n<0&&e.leftd.bottom||e.leftd.right)&&(e={left:Math.max(e.left,d.left),right:Math.min(e.right,d.right),top:Math.max(e.top,d.top),bottom:Math.min(e.bottom,d.bottom)}),u=u.assignedSlot||u.parentNode}else if(u.nodeType==11)u=u.host;else break}function R6(t){let e=t.ownerDocument,n,r;for(let i=t.parentNode;i&&!(i==e.body||n&&r);)if(i.nodeType==1)!r&&i.scrollHeight>i.clientHeight&&(r=i),!n&&i.scrollWidth>i.clientWidth&&(n=i),i=i.assignedSlot||i.parentNode;else if(i.nodeType==11)i=i.host;else break;return{x:n,y:r}}class M6{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:n,focusNode:r}=e;this.set(n,Math.min(e.anchorOffset,n?di(n):0),r,Math.min(e.focusOffset,r?di(r):0))}set(e,n,r,i){this.anchorNode=e,this.anchorOffset=n,this.focusNode=r,this.focusOffset=i}}let Oo=null;se.safari&&se.safari_version>=26&&(Oo=!1);function gI(t){if(t.setActive)return t.setActive();if(Oo)return t.focus(Oo);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(Oo==null?{get preventScroll(){return Oo={preventScroll:!0},!0}}:void 0),!Oo){Oo=!1;for(let n=0;nMath.max(1,t.scrollHeight-t.clientHeight-4)}function bI(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&r>0)return{node:n,offset:r};if(n.nodeType==1&&r>0){if(n.contentEditable=="false")return null;n=n.childNodes[r-1],r=di(n)}else if(n.parentNode&&!vp(n))r=Bo(n),n=n.parentNode;else return null}}function EI(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&rn)return h.domBoundsAround(e,n,c);if(d>=e&&i==-1&&(i=l,s=c),c>n&&h.dom.parentNode==this.dom){o=l,a=u;break}u=d,c=d+h.breakAfter}return{from:s,to:a<0?r+this.length:a,startDOM:(i?this.children[i-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o=0?this.children[o].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let n=this.parent;n;n=n.parent){if(e&&(n.flags|=2),n.flags&1)return;n.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let n=e.parent;if(!n)return e;e=n}}replaceChildren(e,n,r=Nv){this.markDirty();for(let i=e;ithis.pos||e==this.pos&&(n>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let r=this.children[--this.i];this.pos-=r.length+r.breakAfter}}}function TI(t,e,n,r,i,s,o,a,l){let{children:c}=t,u=c.length?c[e]:null,h=s.length?s[s.length-1]:null,d=h?h.breakAfter:o;if(!(e==r&&u&&!o&&!d&&s.length<2&&u.merge(n,i,s.length?h:null,n==0,a,l))){if(r0&&(!o&&s.length&&u.merge(n,u.length,s[0],!1,a,0)?u.breakAfter=s.shift().breakAfter:(nQ6||r.flags&8)?!1:(this.text=this.text.slice(0,e)+(r?r.text:"")+this.text.slice(n),this.markDirty(),!0)}split(e){let n=new Ar(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),n.flags|=this.flags&8,n}localPosFromDOM(e,n){return e==this.dom?n:n?this.text.length:0}domAtPos(e){return new pn(this.dom,e)}domBoundsAround(e,n,r){return{from:r,to:r+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,n){return $6(this.dom,e,n)}}class Yi extends Je{constructor(e,n=[],r=0){super(),this.mark=e,this.children=n,this.length=r;for(let i of n)i.setParent(this)}setAttrs(e){if(OI(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let n in this.mark.attrs)e.setAttribute(n,this.mark.attrs[n]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,n){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,n)}merge(e,n,r,i,s,o){return r&&(!(r instanceof Yi&&r.mark.eq(this.mark))||e&&s<=0||ne&&n.push(r=e&&(i=s),r=l,s++}let o=this.length-e;return this.length=e,i>-1&&(this.children.length=i,this.markDirty()),new Yi(this.mark,n,o)}domAtPos(e){return wI(this,e)}coordsAt(e,n){return _I(this,e,n)}}function $6(t,e,n){let r=t.nodeValue.length;e>r&&(e=r);let i=e,s=e,o=0;e==0&&n<0||e==r&&n>=0?se.chrome||se.gecko||(e?(i--,o=1):s=0)?0:a.length-1];return se.safari&&!o&&l.width==0&&(l=Array.prototype.find.call(a,c=>c.width)||l),o?lm(l,o<0):l||null}class Ns extends Je{static create(e,n,r){return new Ns(e,n,r)}constructor(e,n,r){super(),this.widget=e,this.length=n,this.side=r,this.prevWidget=null}split(e){let n=Ns.create(this.widget,this.length-e,this.side);return this.length-=e,n}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,n,r,i,s,o){return r&&(!(r instanceof Ns)||!this.widget.compare(r.widget)||e>0&&s<=0||n0)?pn.before(this.dom):pn.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,n){let r=this.widget.coordsAt(this.dom,e,n);if(r)return r;let i=this.dom.getClientRects(),s=null;if(!i.length)return null;let o=this.side?this.side<0:e>0;for(let a=o?i.length-1:0;s=i[a],!(e>0?a==0:a==i.length-1||s.top0?pn.before(this.dom):pn.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return We.empty}get isHidden(){return!0}}Ar.prototype.children=Ns.prototype.children=el.prototype.children=Nv;function wI(t,e){let n=t.dom,{children:r}=t,i=0;for(let s=0;is&&e0;s--){let o=r[s-1];if(o.dom.parentNode==n)return o.domAtPos(o.length)}for(let s=i;s0&&e instanceof Yi&&i.length&&(r=i[i.length-1])instanceof Yi&&r.mark.eq(e.mark)?kI(r,e.children[0],n-1):(i.push(e),e.setParent(t)),t.length+=e.length}function _I(t,e,n){let r=null,i=-1,s=null,o=-1;function a(c,u){for(let h=0,d=0;h=u&&(p.children.length?a(p,u-d):(!s||s.isHidden&&(n>0||B6(s,p)))&&(f>u||d==f&&p.getSide()>0)?(s=p,o=u-d):(d-1?1:0)!=i.length-(n&&i.indexOf(n)>-1?1:0))return!1;for(let s of r)if(s!=n&&(i.indexOf(s)==-1||t[s]!==e[s]))return!1;return!0}function Jy(t,e,n){let r=!1;if(e)for(let i in e)n&&i in n||(r=!0,i=="style"?t.style.cssText="":t.removeAttribute(i));if(n)for(let i in n)e&&e[i]==n[i]||(r=!0,i=="style"?t.style.cssText=n[i]:t.setAttribute(i,n[i]));return r}function j6(t){let e=Object.create(null);for(let n=0;n0?3e8:-4e8:n>0?1e8:-1e8,new Zs(e,n,n,r,e.widget||null,!1)}static replace(e){let n=!!e.block,r,i;if(e.isBlockGap)r=-5e8,i=4e8;else{let{start:s,end:o}=xI(e,n);r=(s?n?-3e8:-1:5e8)-1,i=(o?n?2e8:1:-6e8)+1}return new Zs(e,r,i,n,e.widget||null,!0)}static line(e){return new Hu(e)}static set(e,n=!1){return Ye.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Ft.none=Ye.empty;class Uu extends Ft{constructor(e){let{start:n,end:r}=xI(e);super(n?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var n,r;return this==e||e instanceof Uu&&this.tagName==e.tagName&&(this.class||((n=this.attrs)===null||n===void 0?void 0:n.class))==(e.class||((r=e.attrs)===null||r===void 0?void 0:r.class))&&Tp(this.attrs,e.attrs,"class")}range(e,n=e){if(e>=n)throw new RangeError("Mark decorations may not be empty");return super.range(e,n)}}Uu.prototype.point=!1;class Hu extends Ft{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof Hu&&this.spec.class==e.spec.class&&Tp(this.spec.attributes,e.spec.attributes)}range(e,n=e){if(n!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,n)}}Hu.prototype.mapMode=Sn.TrackBefore;Hu.prototype.point=!0;class Zs extends Ft{constructor(e,n,r,i,s,o){super(n,r,s,e),this.block=i,this.isReplace=o,this.mapMode=i?n<=0?Sn.TrackBefore:Sn.TrackAfter:Sn.TrackDel}get type(){return this.startSide!=this.endSide?fr.WidgetRange:this.startSide<=0?fr.WidgetBefore:fr.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof Zs&&z6(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,n=e){if(this.isReplace&&(e>n||e==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,n)}}Zs.prototype.point=!0;function xI(t,e=!1){let{inclusiveStart:n,inclusiveEnd:r}=t;return n==null&&(n=t.inclusive),r==null&&(r=t.inclusive),{start:n??e,end:r??e}}function z6(t,e){return t==e||!!(t&&e&&t.compare(e))}function Pd(t,e,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=t?n[i]=Math.max(n[i],e):n.push(t,e)}class At extends Je{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,n,r,i,s,o){if(r){if(!(r instanceof At))return!1;this.dom||r.transferDOM(this)}return i&&this.setDeco(r?r.attrs:null),SI(this,e,n,r?r.children.slice():[],s,o),!0}split(e){let n=new At;if(n.breakAfter=this.breakAfter,this.length==0)return n;let{i:r,off:i}=this.childPos(e);i&&(n.append(this.children[r].split(i),0),this.children[r].merge(i,this.children[r].length,null,!1,0,0),r++);for(let s=r;s0&&this.children[r-1].length==0;)this.children[--r].destroy();return this.children.length=r,this.markDirty(),this.length=e,n}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){Tp(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,n){kI(this,e,n)}addLineDeco(e){let n=e.spec.attributes,r=e.spec.class;n&&(this.attrs=Ky(n,this.attrs||{})),r&&(this.attrs=Ky({class:r},this.attrs||{}))}domAtPos(e){return wI(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,n){var r;this.dom?this.flags&4&&(OI(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(Jy(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,n);let i=this.dom.lastChild;for(;i&&Je.get(i)instanceof Yi;)i=i.lastChild;if(!i||!this.length||i.nodeName!="BR"&&((r=Je.get(i))===null||r===void 0?void 0:r.isEditable)==!1&&(!se.ios||!this.children.some(s=>s instanceof Ar))){let s=document.createElement("BR");s.cmIgnore=!0,this.dom.appendChild(s)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,n;for(let r of this.children){if(!(r instanceof Ar)||/[^ -~]/.test(r.text))return null;let i=mu(r.dom);if(i.length!=1)return null;e+=i[0].width,n=i[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:n}:null}coordsAt(e,n){let r=_I(this,e,n);if(!this.children.length&&r&&this.parent){let{heightOracle:i}=this.parent.view.viewState,s=r.bottom-r.top;if(Math.abs(s-i.lineHeight)<2&&i.textHeight=n){if(s instanceof At)return s;if(o>n)break}i=o+s.breakAfter}return null}}class Xi extends Je{constructor(e,n,r){super(),this.widget=e,this.length=n,this.deco=r,this.breakAfter=0,this.prevWidget=null}merge(e,n,r,i,s,o){return r&&(!(r instanceof Xi)||!this.widget.compare(r.widget)||e>0&&s<=0||n0}}class eb extends cm{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class Tc{constructor(e,n,r,i){this.doc=e,this.pos=n,this.end=r,this.disallowBlockEffectsFor=i,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=n}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof Xi&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new At),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append($h(new el(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(e&&this.content.length&&this.content[this.content.length-1]instanceof Xi)&&this.getLine()}buildText(e,n,r){for(;e>0;){if(this.textOff==this.text.length){let{value:o,lineBreak:a,done:l}=this.cursor.next(this.skip);if(this.skip=0,l)throw new Error("Ran out of text content when drawing inline views");if(a){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=o,this.textOff=0}let i=Math.min(this.text.length-this.textOff,e),s=Math.min(i,512);this.flushBuffer(n.slice(n.length-r)),this.getLine().append($h(new Ar(this.text.slice(this.textOff,this.textOff+s)),n),r),this.atCursorPos=!0,this.textOff+=s,e-=s,r=i<=s?0:n.length}}span(e,n,r,i){this.buildText(n-e,r,i),this.pos=n,this.openStart<0&&(this.openStart=i)}point(e,n,r,i,s,o){if(this.disallowBlockEffectsFor[o]&&r instanceof Zs){if(r.block)throw new RangeError("Block decorations may not be specified via plugins");if(n>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let a=n-e;if(r instanceof Zs)if(r.block)r.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new Xi(r.widget||tl.block,a,r));else{let l=Ns.create(r.widget||tl.inline,a,a?0:r.startSide),c=this.atCursorPos&&!l.isEditable&&s<=i.length&&(e0),u=!l.isEditable&&(ei.length||r.startSide<=0),h=this.getLine();this.pendingBuffer==2&&!c&&!l.isEditable&&(this.pendingBuffer=0),this.flushBuffer(i),c&&(h.append($h(new el(1),i),s),s=i.length+Math.max(0,s-i.length)),h.append($h(l,i),s),this.atCursorPos=u,this.pendingBuffer=u?ei.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=i.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(r);a&&(this.textOff+a<=this.text.length?this.textOff+=a:(this.skip+=a-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=n),this.openStart<0&&(this.openStart=s)}static build(e,n,r,i,s){let o=new Tc(e,n,r,s);return o.openEnd=Ye.spans(i,n,r,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}}function $h(t,e){for(let n of e)t=new Yi(n,[t],t.length);return t}class tl extends cm{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}tl.inline=new tl("span");tl.block=new tl("div");var Zt=(function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t})(Zt||(Zt={}));const zo=Zt.LTR,Rv=Zt.RTL;function CI(t){let e=[];for(let n=0;n=n){if(a.level==r)return o;(s<0||(i!=0?i<0?a.fromn:e[s].level>a.level))&&(s=o)}}if(s<0)throw new RangeError("Index out of range");return s}}function AI(t,e){if(t.length!=e.length)return!1;for(let n=0;n=0;m-=3)if(Vr[m+1]==-p){let g=Vr[m+2],y=g&2?i:g&4?g&1?s:i:0;y&&(et[h]=et[Vr[m]]=y),a=m;break}}else{if(Vr.length==189)break;Vr[a++]=h,Vr[a++]=d,Vr[a++]=l}else if((f=et[h])==2||f==1){let m=f==i;l=m?0:1;for(let g=a-3;g>=0;g-=3){let y=Vr[g+2];if(y&2)break;if(m)Vr[g+2]|=2;else{if(y&4)break;Vr[g+2]|=4}}}}}function Z6(t,e,n,r){for(let i=0,s=r;i<=n.length;i++){let o=i?n[i-1].to:t,a=il;)f==g&&(f=n[--m].from,g=m?n[m-1].to:t),et[--f]=p;l=u}else s=c,l++}}}function nb(t,e,n,r,i,s,o){let a=r%2?2:1;if(r%2==i%2)for(let l=e,c=0;ll&&o.push(new Rs(l,m.from,p));let g=m.direction==zo!=!(p%2);rb(t,g?r+1:r,i,m.inner,m.from,m.to,o),l=m.to}f=m.to}else{if(f==n||(u?et[f]!=a:et[f]==a))break;f++}d?nb(t,l,f,r+1,i,d,o):le;){let u=!0,h=!1;if(!c||l>s[c-1].to){let m=et[l-1];m!=a&&(u=!1,h=m==16)}let d=!u&&a==1?[]:null,p=u?r:r+1,f=l;e:for(;;)if(c&&f==s[c-1].to){if(h)break e;let m=s[--c];if(!u)for(let g=m.from,y=c;;){if(g==e)break e;if(y&&s[y-1].to==g)g=s[--y].from;else{if(et[g-1]==a)break e;break}}if(d)d.push(m);else{m.toet.length;)et[et.length]=256;let r=[],i=e==zo?0:1;return rb(t,i,i,n,0,t.length,r),r}function PI(t){return[new Rs(0,t,0)]}let NI="";function G6(t,e,n,r,i){var s;let o=r.head-t.from,a=Rs.find(e,o,(s=r.bidiLevel)!==null&&s!==void 0?s:-1,r.assoc),l=e[a],c=l.side(i,n);if(o==c){let d=a+=i?1:-1;if(d<0||d>=e.length)return null;l=e[a=d],o=l.side(!i,n),c=l.side(i,n)}let u=Fi(t.text,o,l.forward(i,n));(ul.to)&&(u=c),NI=t.text.slice(Math.min(o,u),Math.max(o,u));let h=a==(i?e.length-1:0)?null:e[a+(i?1:-1)];return h&&u==c&&h.level+(i?0:1)t.some(e=>e)}),K6=Ee.define({combine:t=>t.some(e=>e)}),BI=Ee.define();class La{constructor(e,n="nearest",r="nearest",i=5,s=5,o=!1){this.range=e,this.y=n,this.x=r,this.yMargin=i,this.xMargin=s,this.isSnapshot=o}map(e){return e.empty?this:new La(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new La(ae.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const Fh=Et.define({map:(t,e)=>t.map(e)}),jI=Et.define();function ri(t,e,n){let r=t.facet(LI);r.length?r[0](e):window.onerror&&window.onerror(String(e),n,void 0,void 0,e)||(n?console.error(n+":",e):console.error(e))}const Ri=Ee.define({combine:t=>t.length?t[0]:!0});let J6=0;const Sa=Ee.define({combine(t){return t.filter((e,n)=>{for(let r=0;r{let l=[];return o&&l.push(gu.of(c=>{let u=c.plugin(a);return u?o(u):Ft.none})),s&&l.push(s(a)),l})}static fromClass(e,n){return Ws.define((r,i)=>new e(r,i),n)}}class Bg{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(r){if(ri(n.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(n){ri(e.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(r){ri(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const zI=Ee.define(),Lv=Ee.define(),gu=Ee.define(),VI=Ee.define(),Xu=Ee.define(),UI=Ee.define();function f_(t,e){let n=t.state.facet(UI);if(!n.length)return n;let r=n.map(s=>s instanceof Function?s(t):s),i=[];return Ye.spans(r,e.from,e.to,{point(){},span(s,o,a,l){let c=s-e.from,u=o-e.from,h=i;for(let d=a.length-1;d>=0;d--,l--){let p=a[d].spec.bidiIsolate,f;if(p==null&&(p=Y6(e.text,c,u)),l>0&&h.length&&(f=h[h.length-1]).to==c&&f.direction==p)f.to=u,h=f.inner;else{let m={from:c,to:u,direction:p,inner:[]};h.push(m),h=m.inner}}}}),i}const HI=Ee.define();function XI(t){let e=0,n=0,r=0,i=0;for(let s of t.state.facet(HI)){let o=s(t);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(n=Math.max(n,o.right)),o.top!=null&&(r=Math.max(r,o.top)),o.bottom!=null&&(i=Math.max(i,o.bottom)))}return{left:e,right:n,top:r,bottom:i}}const sc=Ee.define();class mr{constructor(e,n,r,i){this.fromA=e,this.toA=n,this.fromB=r,this.toB=i}join(e){return new mr(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let n=e.length,r=this;for(;n>0;n--){let i=e[n-1];if(!(i.fromA>r.toA)){if(i.toAu)break;s+=2}if(!l)return r;new mr(l.fromA,l.toA,l.fromB,l.toB).addToSet(r),o=l.toA,a=l.toB}}}class Sp{constructor(e,n,r){this.view=e,this.state=n,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=Ht.empty(this.startState.doc.length);for(let s of r)this.changes=this.changes.compose(s.changes);let i=[];this.changes.iterChangedRanges((s,o,a,l)=>i.push(new mr(s,o,a,l))),this.changedRanges=i}static create(e,n,r){return new Sp(e,n,r)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}class m_ extends Je{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=Ft.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new At],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new mr(0,0,0,e.state.doc.length)],0,null)}update(e){var n;let r=e.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:c,toA:u})=>uthis.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let i=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?i=this.domChanged.newSel.head:!oG(e.changes,this.hasComposition)&&!e.selectionSet&&(i=e.state.selection.main.head));let s=i>-1?tG(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:c,to:u}=this.hasComposition;r=new mr(c,u,e.changes.mapPos(c,-1),e.changes.mapPos(u,1)).addToSet(r.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(se.ie||se.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,a=this.updateDeco(),l=iG(o,a,e.changes);return r=mr.extendWithRanges(r,l),!(this.flags&7)&&r.length==0?!1:(this.updateInner(r,e.startState.doc.length,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,n,r){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,n,r);let{observer:i}=this.view;i.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let o=se.chrome||se.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,o),this.flags&=-8,o&&(o.written||i.selectionRange.focusNode!=o.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(o=>o.flags&=-9);let s=[];if(this.view.viewport.from||this.view.viewport.to=0?i[o]:null;if(!a)break;let{fromA:l,toA:c,fromB:u,toB:h}=a,d,p,f,m;if(r&&r.range.fromBu){let S=Tc.build(this.view.state.doc,u,r.range.fromB,this.decorations,this.dynamicDecorationMap),w=Tc.build(this.view.state.doc,r.range.toB,h,this.decorations,this.dynamicDecorationMap);p=S.breakAtStart,f=S.openStart,m=w.openEnd;let A=this.compositionView(r);w.breakAtStart?A.breakAfter=1:w.content.length&&A.merge(A.length,A.length,w.content[0],!1,w.openStart,0)&&(A.breakAfter=w.content[0].breakAfter,w.content.shift()),S.content.length&&A.merge(0,0,S.content[S.content.length-1],!0,0,S.openEnd)&&S.content.pop(),d=S.content.concat(A).concat(w.content)}else({content:d,breakAtStart:p,openStart:f,openEnd:m}=Tc.build(this.view.state.doc,u,h,this.decorations,this.dynamicDecorationMap));let{i:g,off:y}=s.findPos(c,1),{i:b,off:T}=s.findPos(l,-1);TI(this,b,T,g,y,d,p,f,m)}r&&this.fixCompositionDOM(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let n of e.transactions)for(let r of n.effects)r.is(jI)&&(this.editContextFormatting=r.value)}compositionView(e){let n=new Ar(e.text.nodeValue);n.flags|=8;for(let{deco:i}of e.marks)n=new Yi(i,[n],n.length);let r=new At;return r.append(n,0),r}fixCompositionDOM(e){let n=(s,o)=>{o.flags|=8|(o.children.some(l=>l.flags&7)?1:0),this.markedForComposition.add(o);let a=Je.get(s);a&&a!=o&&(a.dom=null),o.setDOM(s)},r=this.childPos(e.range.fromB,1),i=this.children[r.i];n(e.line,i);for(let s=e.marks.length-1;s>=-1;s--)r=i.childPos(r.off,1),i=i.children[r.i],n(s>=0?e.marks[s].node:e.text,i)}updateSelection(e=!1,n=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let r=this.view.root.activeElement,i=r==this.dom,s=!i&&!(this.view.state.facet(Ri)||this.dom.tabIndex>-1)&&Ad(this.dom,this.view.observer.selectionRange)&&!(r&&this.dom.contains(r));if(!(i||n||s))return;let o=this.forceSelection;this.forceSelection=!1;let a=this.view.state.selection.main,l=this.moveToLine(this.domAtPos(a.anchor)),c=a.empty?l:this.moveToLine(this.domAtPos(a.head));if(se.gecko&&a.empty&&!this.hasComposition&&eG(l)){let h=document.createTextNode("");this.view.observer.ignore(()=>l.node.insertBefore(h,l.node.childNodes[l.offset]||null)),l=c=new pn(h,0),o=!0}let u=this.view.observer.selectionRange;(o||!u.focusNode||(!vc(l.node,l.offset,u.anchorNode,u.anchorOffset)||!vc(c.node,c.offset,u.focusNode,u.focusOffset))&&!this.suppressWidgetCursorChange(u,a))&&(this.view.observer.ignore(()=>{se.android&&se.chrome&&this.dom.contains(u.focusNode)&&sG(u.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let h=fu(this.view.root);if(h)if(a.empty){if(se.gecko){let d=nG(l.node,l.offset);if(d&&d!=3){let p=(d==1?bI:EI)(l.node,l.offset);p&&(l=new pn(p.node,p.offset))}}h.collapse(l.node,l.offset),a.bidiLevel!=null&&h.caretBidiLevel!==void 0&&(h.caretBidiLevel=a.bidiLevel)}else if(h.extend){h.collapse(l.node,l.offset);try{h.extend(c.node,c.offset)}catch{}}else{let d=document.createRange();a.anchor>a.head&&([l,c]=[c,l]),d.setEnd(c.node,c.offset),d.setStart(l.node,l.offset),h.removeAllRanges(),h.addRange(d)}s&&this.view.root.activeElement==this.dom&&(this.dom.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(l,c)),this.impreciseAnchor=l.precise?null:new pn(u.anchorNode,u.anchorOffset),this.impreciseHead=c.precise?null:new pn(u.focusNode,u.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&vc(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,n=e.state.selection.main,r=fu(e.root),{anchorNode:i,anchorOffset:s}=e.observer.selectionRange;if(!r||!n.empty||!n.assoc||!r.modify)return;let o=At.find(this,n.head);if(!o)return;let a=o.posAtStart;if(n.head==a||n.head==a+o.length)return;let l=this.coordsAt(n.head,-1),c=this.coordsAt(n.head,1);if(!l||!c||l.bottom>c.top)return;let u=this.domAtPos(n.head+n.assoc);r.collapse(u.node,u.offset),r.modify("move",n.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let h=e.observer.selectionRange;e.docView.posFromDOM(h.anchorNode,h.anchorOffset)!=n.from&&r.collapse(i,s)}moveToLine(e){let n=this.dom,r;if(e.node!=n)return e;for(let i=e.offset;!r&&i=0;i--){let s=Je.get(n.childNodes[i]);s instanceof At&&(r=s.domAtPos(s.length))}return r?new pn(r.node,r.offset,!0):e}nearest(e){for(let n=e;n;){let r=Je.get(n);if(r&&r.rootView==this)return r;n=n.parentNode}return null}posFromDOM(e,n){let r=this.nearest(e);if(!r)throw new RangeError("Trying to find position for a DOM position outside of the document");return r.localPosFromDOM(e,n)+r.posAtStart}domAtPos(e){let{i:n,off:r}=this.childCursor().findPos(e,-1);for(;n=0;o--){let a=this.children[o],l=s-a.breakAfter,c=l-a.length;if(le||a.covers(1))&&(!r||a instanceof At&&!(r instanceof At&&n>=0)))r=a,i=c;else if(r&&c==e&&l==e&&a instanceof Xi&&Math.abs(n)<2){if(a.deco.startSide<0)break;o&&(r=null)}s=c}return r?r.coordsAt(e-i,n):null}coordsForChar(e){let{i:n,off:r}=this.childPos(e,1),i=this.children[n];if(!(i instanceof At))return null;for(;i.children.length;){let{i:a,off:l}=i.childPos(r,1);for(;;a++){if(a==i.children.length)return null;if((i=i.children[a]).length)break}r=l}if(!(i instanceof Ar))return null;let s=Fi(i.text,r);if(s==r)return null;let o=jo(i.dom,r,s).getClientRects();for(let a=0;aMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,l=this.view.textDirection==Zt.LTR;for(let c=0,u=0;ui)break;if(c>=r){let p=h.dom.getBoundingClientRect();if(n.push(p.height),o){let f=h.dom.lastChild,m=f?mu(f):[];if(m.length){let g=m[m.length-1],y=l?g.right-p.left:p.right-g.left;y>a&&(a=y,this.minWidth=s,this.minWidthFrom=c,this.minWidthTo=d)}}}c=d+h.breakAfter}return n}textDirectionAt(e){let{i:n}=this.childPos(e,1);return getComputedStyle(this.children[n].dom).direction=="rtl"?Zt.RTL:Zt.LTR}measureTextSize(){for(let s of this.children)if(s instanceof At){let o=s.measureTextSize();if(o)return o}let e=document.createElement("div"),n,r,i;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let s=mu(e.firstChild)[0];n=e.getBoundingClientRect().height,r=s?s.width/27:7,i=s?s.height:n,e.remove()}),{lineHeight:n,charWidth:r,textHeight:i}}childCursor(e=this.length){let n=this.children.length;return n&&(e-=this.children[--n].length),new vI(this.children,e,n)}computeBlockGapDeco(){let e=[],n=this.view.viewState;for(let r=0,i=0;;i++){let s=i==n.viewports.length?null:n.viewports[i],o=s?s.from-1:this.length;if(o>r){let a=(n.lineBlockAt(o).bottom-n.lineBlockAt(r).top)/this.view.scaleY;e.push(Ft.replace({widget:new eb(a),block:!0,inclusive:!0,isBlockGap:!0}).range(r,o))}if(!s)break;r=s.to+1}return Ft.set(e)}updateDeco(){let e=1,n=this.view.state.facet(gu).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),r=!1,i=this.view.state.facet(VI).map((s,o)=>{let a=typeof s=="function";return a&&(r=!0),a?s(this.view):s});for(i.length&&(this.dynamicDecorationMap[e++]=r,n.push(Ye.join(i))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];en.anchor?-1:1),i;if(!r)return;!n.empty&&(i=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(r={left:Math.min(r.left,i.left),top:Math.min(r.top,i.top),right:Math.max(r.right,i.right),bottom:Math.max(r.bottom,i.bottom)});let s=XI(this.view),o={left:r.left-s.left,top:r.top-s.top,right:r.right+s.right,bottom:r.bottom+s.bottom},{offsetWidth:a,offsetHeight:l}=this.view.scrollDOM;N6(this.view.scrollDOM,o,n.headi instanceof Ns||i.children.some(r);return r(this.children[n])}}function eG(t){return t.node.nodeType==1&&t.node.firstChild&&(t.offset==0||t.node.childNodes[t.offset-1].contentEditable=="false")&&(t.offset==t.node.childNodes.length||t.node.childNodes[t.offset].contentEditable=="false")}function qI(t,e){let n=t.observer.selectionRange;if(!n.focusNode)return null;let r=bI(n.focusNode,n.focusOffset),i=EI(n.focusNode,n.focusOffset),s=r||i;if(i&&r&&i.node!=r.node){let a=Je.get(i.node);if(!a||a instanceof Ar&&a.text!=i.node.nodeValue)s=i;else if(t.docView.lastCompositionAfterCursor){let l=Je.get(r.node);!l||l instanceof Ar&&l.text!=r.node.nodeValue||(s=i)}}if(t.docView.lastCompositionAfterCursor=s!=r,!s)return null;let o=e-s.offset;return{from:o,to:o+s.node.nodeValue.length,node:s.node}}function tG(t,e,n){let r=qI(t,n);if(!r)return null;let{node:i,from:s,to:o}=r,a=i.nodeValue;if(/[\n\r]/.test(a)||t.state.doc.sliceString(r.from,r.to)!=a)return null;let l=e.invertedDesc,c=new mr(l.mapPos(s),l.mapPos(o),s,o),u=[];for(let h=i.parentNode;;h=h.parentNode){let d=Je.get(h);if(d instanceof Yi)u.push({node:h,deco:d.mark});else{if(d instanceof At||h.nodeName=="DIV"&&h.parentNode==t.contentDOM)return{range:c,text:i,marks:u,line:h};if(h!=t.contentDOM)u.push({node:h,deco:new Uu({inclusive:!0,attributes:j6(h),tagName:h.tagName.toLowerCase()})});else return null}}}function nG(t,e){return t.nodeType!=1?0:(e&&t.childNodes[e-1].contentEditable=="false"?1:0)|(e{re.from&&(n=!0)}),n}function aG(t,e,n=1){let r=t.charCategorizer(e),i=t.doc.lineAt(e),s=e-i.from;if(i.length==0)return ae.cursor(e);s==0?n=1:s==i.length&&(n=-1);let o=s,a=s;n<0?o=Fi(i.text,s,!1):a=Fi(i.text,s);let l=r(i.text.slice(o,a));for(;o>0;){let c=Fi(i.text,o,!1);if(r(i.text.slice(c,o))!=l)break;o=c}for(;at?e.left-t:Math.max(0,t-e.right)}function cG(t,e){return e.top>t?e.top-t:Math.max(0,t-e.bottom)}function jg(t,e){return t.tope.top+1}function g_(t,e){return et.bottom?{top:t.top,left:t.left,right:t.right,bottom:e}:t}function sb(t,e,n){let r,i,s,o,a=!1,l,c,u,h;for(let f=t.firstChild;f;f=f.nextSibling){let m=mu(f);for(let g=0;gT||o==T&&s>b)&&(r=f,i=y,s=b,o=T,a=b?e0:gy.bottom&&(!u||u.bottomy.top)&&(c=f,h=y):u&&jg(u,y)?u=O_(u,y.bottom):h&&jg(h,y)&&(h=g_(h,y.top))}}if(u&&u.bottom>=n?(r=l,i=u):h&&h.top<=n&&(r=c,i=h),!r)return{node:t,offset:0};let d=Math.max(i.left,Math.min(i.right,e));if(r.nodeType==3)return y_(r,d,n);if(a&&r.contentEditable!="false")return sb(r,d,n);let p=Array.prototype.indexOf.call(t.childNodes,r)+(e>=(i.left+i.right)/2?1:0);return{node:t,offset:p}}function y_(t,e,n){let r=t.nodeValue.length,i=-1,s=1e9,o=0;for(let a=0;an?u.top-n:n-u.bottom)-1;if(u.left-1<=e&&u.right+1>=e&&h=(u.left+u.right)/2,p=d;if(se.chrome||se.gecko){let f=jo(t,a).getBoundingClientRect();Math.abs(f.left-u.right)<.1&&(p=!d)}if(h<=0)return{node:t,offset:a+(p?1:0)};i=a+(p?1:0),s=h}}}return{node:t,offset:i>-1?i:o>0?t.nodeValue.length:0}}function ZI(t,e,n,r=-1){var i,s;let o=t.contentDOM.getBoundingClientRect(),a=o.top+t.viewState.paddingTop,l,{docHeight:c}=t.viewState,{x:u,y:h}=e,d=h-a;if(d<0)return 0;if(d>c)return t.state.doc.length;for(let S=t.viewState.heightOracle.textHeight/2,w=!1;l=t.elementAtHeight(d),l.type!=fr.Text;)for(;d=r>0?l.bottom+S:l.top-S,!(d>=0&&d<=c);){if(w)return n?null:0;w=!0,r=-r}h=a+d;let p=l.from;if(pt.viewport.to)return t.viewport.to==t.state.doc.length?t.state.doc.length:n?null:b_(t,o,l,u,h);let f=t.dom.ownerDocument,m=t.root.elementFromPoint?t.root:f,g=m.elementFromPoint(u,h);g&&!t.contentDOM.contains(g)&&(g=null),g||(u=Math.max(o.left+1,Math.min(o.right-1,u)),g=m.elementFromPoint(u,h),g&&!t.contentDOM.contains(g)&&(g=null));let y,b=-1;if(g&&((i=t.docView.nearest(g))===null||i===void 0?void 0:i.isEditable)!=!1){if(f.caretPositionFromPoint){let S=f.caretPositionFromPoint(u,h);S&&({offsetNode:y,offset:b}=S)}else if(f.caretRangeFromPoint){let S=f.caretRangeFromPoint(u,h);S&&({startContainer:y,startOffset:b}=S)}y&&(!t.contentDOM.contains(y)||se.safari&&uG(y,b,u)||se.chrome&&hG(y,b,u))&&(y=void 0),y&&(b=Math.min(di(y),b))}if(!y||!t.docView.dom.contains(y)){let S=At.find(t.docView,p);if(!S)return d>l.top+l.height/2?l.to:l.from;({node:y,offset:b}=sb(S.dom,u,h))}let T=t.docView.nearest(y);if(!T)return null;if(T.isWidget&&((s=T.dom)===null||s===void 0?void 0:s.nodeType)==1){let S=T.dom.getBoundingClientRect();return e.yt.defaultLineHeight*1.5){let a=t.viewState.heightOracle.textHeight,l=Math.floor((i-n.top-(t.defaultLineHeight-a)*.5)/a);s+=l*t.viewState.heightOracle.lineLength}let o=t.state.sliceDoc(n.from,n.to);return n.from+C6(o,s,t.state.tabSize)}function WI(t,e,n){let r,i=t;if(t.nodeType!=3||e!=(r=t.nodeValue.length))return!1;for(;;){let s=i.nextSibling;if(s){if(s.nodeName=="BR")break;return!1}else{let o=i.parentNode;if(!o||o.nodeName=="DIV")break;i=o}}return jo(t,r-1,r).getBoundingClientRect().right>n}function uG(t,e,n){return WI(t,e,n)}function hG(t,e,n){if(e!=0)return WI(t,e,n);for(let i=t;;){let s=i.parentNode;if(!s||s.nodeType!=1||s.firstChild!=i)return!1;if(s.classList.contains("cm-line"))break;i=s}let r=t.nodeType==1?t.getBoundingClientRect():jo(t,0,Math.max(t.nodeValue.length,1)).getBoundingClientRect();return n-r.left>5}function dG(t,e,n){let r=t.lineBlockAt(e);if(Array.isArray(r.type)){let i;for(let s of r.type){if(s.from>e)break;if(!(s.toe)return s;(!i||s.type==fr.Text&&(i.type!=s.type||(n<0?s.frome)))&&(i=s)}}return i||r}return r}function pG(t,e,n,r){let i=dG(t,e.head,e.assoc||-1),s=!r||i.type!=fr.Text||!(t.lineWrapping||i.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>i.from?e.head-1:e.head);if(s){let o=t.dom.getBoundingClientRect(),a=t.textDirectionAt(i.from),l=t.posAtCoords({x:n==(a==Zt.LTR)?o.right-1:o.left+1,y:(s.top+s.bottom)/2});if(l!=null)return ae.cursor(l,n?-1:1)}return ae.cursor(n?i.to:i.from,n?-1:1)}function E_(t,e,n,r){let i=t.state.doc.lineAt(e.head),s=t.bidiSpans(i),o=t.textDirectionAt(i.from);for(let a=e,l=null;;){let c=G6(i,s,o,a,n),u=NI;if(!c){if(i.number==(n?t.state.doc.lines:1))return a;u=` `,i=t.state.doc.line(i.number+(n?1:-1)),s=t.bidiSpans(i),c=t.visualLineSide(i,!n)}if(l){if(!l(u))return a}else{if(!r)return c;l=r(u)}a=c}}function fG(t,e,n){let r=t.state.charCategorizer(e),i=r(n);return s=>{let o=r(s);return i==Bi.Space&&(i=o),i==o}}function mG(t,e,n,r){let i=e.head,s=n?1:-1;if(i==(n?t.state.doc.length:0))return ae.cursor(i,e.assoc);let o=e.goalColumn,a,l=t.contentDOM.getBoundingClientRect(),c=t.coordsAtPos(i,e.assoc||-1),u=t.documentTop;if(c)o==null&&(o=c.left-l.left),a=s<0?c.top:c.bottom;else{let p=t.viewState.lineBlockAt(i);o==null&&(o=Math.min(l.right-l.left,t.defaultCharacterWidth*(i-p.from))),a=(s<0?p.top:p.bottom)+u}let h=l.left+o,d=r??t.viewState.heightOracle.textHeight>>1;for(let p=0;;p+=10){let f=a+(d+p)*s,m=ZI(t,{x:h,y:f},!1,s);if(fl.bottom||(s<0?mi)){let g=t.docView.coordsForChar(m),y=!g||f{if(e>s&&ei(t)),n.from,e.head>n.from?-1:1);return r==n.from?n:ae.cursor(r,rs)&&!yG(o,n)&&this.lineBreak(),i=o}return this.findPointBefore(r,n),this}readTextNode(e){let n=e.nodeValue;for(let r of this.points)r.node==e&&(r.pos=this.text.length+Math.min(r.offset,n.length));for(let r=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,o=1,a;if(this.lineSeparator?(s=n.indexOf(this.lineSeparator,r),o=this.lineSeparator.length):(a=i.exec(n))&&(s=a.index,o=a[0].length),this.append(n.slice(r,s<0?n.length:s)),s<0)break;if(this.lineBreak(),o>1)for(let l of this.points)l.node==e&&l.pos>this.text.length&&(l.pos-=o-1);r=s+o}}readNode(e){if(e.cmIgnore)return;let n=Je.get(e),r=n&&n.overrideDOMText;if(r!=null){this.findPointInside(e,r.length);for(let i=r.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,n){for(let r of this.points)r.node==e&&e.childNodes[r.offset]==n&&(r.pos=this.text.length)}findPointInside(e,n){for(let r of this.points)(e.nodeType==3?r.node==e:e.contains(r.node))&&(r.pos=this.text.length+(OG(e,r.node,r.offset)?n:0))}}function OG(t,e,n){for(;;){if(!e||n-1;let{impreciseHead:s,impreciseAnchor:o}=e.docView;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=e.docView.domBoundsAround(n,r,0))){let a=s||o?[]:vG(e),l=new gG(a,e.state);l.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=l.text,this.newSel=TG(a,this.bounds.from)}else{let a=e.observer.selectionRange,l=s&&s.node==a.focusNode&&s.offset==a.focusOffset||!Yy(e.contentDOM,a.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(a.focusNode,a.focusOffset),c=o&&o.node==a.anchorNode&&o.offset==a.anchorOffset||!Yy(e.contentDOM,a.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(a.anchorNode,a.anchorOffset),u=e.viewport;if((se.ios||se.chrome)&&e.state.selection.main.empty&&l!=c&&(u.from>0||u.to-1&&e.state.selection.ranges.length>1?this.newSel=e.state.selection.replaceRange(ae.range(c,l)):this.newSel=ae.single(c,l)}}}function YI(t,e){let n,{newSel:r}=e,i=t.state.selection.main,s=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:a}=e.bounds,l=i.from,c=null;(s===8||se.android&&e.text.length=i.from&&n.to<=i.to&&(n.from!=i.from||n.to!=i.to)&&i.to-i.from-(n.to-n.from)<=4?n={from:i.from,to:i.to,insert:t.state.doc.slice(i.from,n.from).append(n.insert).append(t.state.doc.slice(n.to,i.to))}:t.state.doc.lineAt(i.from).toDate.now()-50?n={from:i.from,to:i.to,insert:t.state.toText(t.inputState.insertingText)}:se.chrome&&n&&n.from==n.to&&n.from==i.head&&n.insert.toString()==` `&&t.lineWrapping&&(r&&(r=ae.single(r.main.anchor-1,r.main.head-1)),n={from:i.from,to:i.to,insert:We.of([" "])}),n)return Qv(t,n,r,s);if(r&&!r.main.eq(i)){let o=!1,a="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(o=!0),a=t.inputState.lastSelectionOrigin,a=="select.pointer"&&(r=GI(t.state.facet(Xu).map(l=>l(t)),r))),t.dispatch({selection:r,scrollIntoView:o,userEvent:a}),!0}else return!1}function Qv(t,e,n,r=-1){if(se.ios&&t.inputState.flushIOSKey(e))return!0;let i=t.state.selection.main;if(se.android&&(e.to==i.to&&(e.from==i.from||e.from==i.from-1&&t.state.sliceDoc(e.from,i.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&Ia(t.contentDOM,"Enter",13)||(e.from==i.from-1&&e.to==i.to&&e.insert.length==0||r==8&&e.insert.lengthi.head)&&Ia(t.contentDOM,"Backspace",8)||e.from==i.from&&e.to==i.to+1&&e.insert.length==0&&Ia(t.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let o,a=()=>o||(o=EG(t,e,n));return t.state.facet(QI).some(l=>l(t,e.from,e.to,s,a))||t.dispatch(a()),!0}function EG(t,e,n){let r,i=t.state,s=i.selection.main,o=-1;if(e.from==e.to&&e.froms.to){let l=e.fromh(t)),c,l);e.from==u&&(o=u)}if(o>-1)r={changes:e,selection:ae.cursor(e.from+e.insert.length,-1)};else if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!n||n.main.empty&&n.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let l=s.frome.to?i.sliceDoc(e.to,s.to):"";r=i.replaceSelection(t.state.toText(l+e.insert.sliceString(0,void 0,t.state.lineBreak)+c))}else{let l=i.changes(e),c=n&&n.main.to<=l.newLength?n.main:void 0;if(i.selection.ranges.length>1&&(t.inputState.composing>=0||t.inputState.compositionPendingChange)&&e.to<=s.to+10&&e.to>=s.to-10){let u=t.state.sliceDoc(e.from,e.to),h,d=n&&qI(t,n.main.head);if(d){let f=e.insert.length-(e.to-e.from);h={from:d.from,to:d.to-f}}else h=t.state.doc.lineAt(s.head);let p=s.to-e.to;r=i.changeByRange(f=>{if(f.from==s.from&&f.to==s.to)return{changes:l,range:c||f.map(l)};let m=f.to-p,g=m-u.length;if(t.state.sliceDoc(g,m)!=u||m>=h.from&&g<=h.to)return{range:f};let y=i.changes({from:g,to:m,insert:e.insert}),b=f.to-s.to;return{changes:y,range:c?ae.range(Math.max(0,c.anchor+b),Math.max(0,c.head+b)):f.map(y)}})}else r={changes:l,selection:c&&i.selection.replaceRange(c)}}let a="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,a+=".compose",t.inputState.compositionFirstChange&&(a+=".start",t.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:a,scrollIntoView:!0})}function KI(t,e,n,r){let i=Math.min(t.length,e.length),s=0;for(;s0&&a>0&&t.charCodeAt(o-1)==e.charCodeAt(a-1);)o--,a--;if(r=="end"){let l=Math.max(0,s-Math.min(o,a));n-=o+l-s}if(o=o?s-n:0;s-=l,a=s+(a-o),o=s}else if(a=a?s-n:0;s-=l,o=s+(o-a),a=s}return{from:s,toA:o,toB:a}}function vG(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}=t.observer.selectionRange;return n&&(e.push(new v_(n,r)),(i!=n||s!=r)&&e.push(new v_(i,s))),e}function TG(t,e){if(t.length==0)return null;let n=t[0].pos,r=t.length==2?t[1].pos:n;return n>-1&&r>-1?ae.single(n+e,r+e):null}class SG{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,se.safari&&e.contentDOM.addEventListener("input",()=>null),se.gecko&&FG(e.contentDOM.ownerDocument)}handleEvent(e){!PG(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,n){let r=this.handlers[e];if(r){for(let i of r.observers)i(this.view,n);for(let i of r.handlers){if(n.defaultPrevented)break;if(i(this.view,n)){n.preventDefault();break}}}}ensureHandlers(e){let n=wG(e),r=this.handlers,i=this.view.contentDOM;for(let s in n)if(s!="scroll"){let o=!n[s].handlers.length,a=r[s];a&&o!=!a.handlers.length&&(i.removeEventListener(s,this.handleEvent),a=null),a||i.addEventListener(s,this.handleEvent,{passive:o})}for(let s in r)s!="scroll"&&!n[s]&&i.removeEventListener(s,this.handleEvent);this.handlers=n}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&eL.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),se.android&&se.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let n;return se.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((n=JI.find(r=>r.keyCode==e.keyCode))&&!e.ctrlKey||kG.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=n||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&e&&e.from0?!0:se.safari&&!se.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function T_(t,e){return(n,r)=>{try{return e.call(t,r,n)}catch(i){ri(n.state,i)}}}function wG(t){let e=Object.create(null);function n(r){return e[r]||(e[r]={observers:[],handlers:[]})}for(let r of t){let i=r.spec,s=i&&i.plugin.domEventHandlers,o=i&&i.plugin.domEventObservers;if(s)for(let a in s){let l=s[a];l&&n(a).handlers.push(T_(r.value,l))}if(o)for(let a in o){let l=o[a];l&&n(a).observers.push(T_(r.value,l))}}for(let r in Pr)n(r).handlers.push(Pr[r]);for(let r in gr)n(r).observers.push(gr[r]);return e}const JI=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],kG="dthko",eL=[16,17,18,20,91,92,224,225],Bh=6;function jh(t){return Math.max(0,t)*.7+8}function _G(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class xG{constructor(e,n,r,i){this.view=e,this.startEvent=n,this.style=r,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=R6(e.contentDOM),this.atoms=e.state.facet(Xu).map(o=>o(e));let s=e.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=e.state.facet(Ze.allowMultipleSelections)&&CG(e,n),this.dragging=AG(e,n)&&rL(n)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&_G(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,r=0,i=0,s=0,o=this.view.win.innerWidth,a=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:a}=this.scrollParents.y.getBoundingClientRect());let l=XI(this.view);e.clientX-l.left<=i+Bh?n=-jh(i-e.clientX):e.clientX+l.right>=o-Bh&&(n=jh(e.clientX-o)),e.clientY-l.top<=s+Bh?r=-jh(s-e.clientY):e.clientY+l.bottom>=a-Bh&&(r=jh(e.clientY-a)),this.setScrollSpeed(n,r)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,n){this.scrollSpeed={x:e,y:n},e||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:n}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(e||n)&&this.view.win.scrollBy(e,n),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:n}=this,r=GI(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!r.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:r,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function CG(t,e){let n=t.state.facet(RI);return n.length?n[0](e):se.mac?e.metaKey:e.ctrlKey}function DG(t,e){let n=t.state.facet(MI);return n.length?n[0](e):se.mac?!e.altKey:!e.ctrlKey}function AG(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let r=fu(t.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let s=0;s=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function PG(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target,r;n!=t.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=Je.get(n))&&r.ignoreEvent(e))return!1;return!0}const Pr=Object.create(null),gr=Object.create(null),tL=se.ie&&se.ie_version<15||se.ios&&se.webkit_version<604;function NG(t){let e=t.dom.parentNode;if(!e)return;let n=e.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{t.focus(),n.remove(),nL(t,n.value)},50)}function um(t,e,n){for(let r of t.facet(e))n=r(n,t);return n}function nL(t,e){e=um(t.state,Mv,e);let{state:n}=t,r,i=1,s=n.toText(e),o=s.lines==n.selection.ranges.length;if(ob!=null&&n.selection.ranges.every(a=>a.empty)&&ob==s.toString()){let a=-1;r=n.changeByRange(l=>{let c=n.doc.lineAt(l.from);if(c.from==a)return{range:l};a=c.from;let u=n.toText((o?s.line(i++).text:e)+n.lineBreak);return{changes:{from:c.from,insert:u},range:ae.cursor(l.from+u.length)}})}else o?r=n.changeByRange(a=>{let l=s.line(i++);return{changes:{from:a.from,to:a.to,insert:l.text},range:ae.cursor(a.from+l.length)}}):r=n.replaceSelection(s);t.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}gr.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft};Pr.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);gr.touchstart=(t,e)=>{t.inputState.lastTouchTime=Date.now(),t.inputState.setSelectionOrigin("select.pointer")};gr.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};Pr.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of t.state.facet(II))if(n=r(t,e),n)break;if(!n&&e.button==0&&(n=IG(t,e)),n){let r=!t.hasFocus;t.inputState.startMouseSelection(new xG(t,e,n,r)),r&&t.observer.ignore(()=>{gI(t.contentDOM);let s=t.root.activeElement;s&&!s.contains(t.contentDOM)&&s.blur()});let i=t.inputState.mouseSelection;if(i)return i.start(e),i.dragging===!1}else t.inputState.setSelectionOrigin("select.pointer");return!1};function S_(t,e,n,r){if(r==1)return ae.cursor(e,n);if(r==2)return aG(t.state,e,n);{let i=At.find(t.docView,e),s=t.state.doc.lineAt(i?i.posAtEnd:e),o=i?i.posAtStart:s.from,a=i?i.posAtEnd:s.to;return ae>=n.top&&e<=n.bottom&&t>=n.left&&t<=n.right;function RG(t,e,n,r){let i=At.find(t.docView,e);if(!i)return 1;let s=e-i.posAtStart;if(s==0)return 1;if(s==i.length)return-1;let o=i.coordsAt(s,-1);if(o&&w_(n,r,o))return-1;let a=i.coordsAt(s,1);return a&&w_(n,r,a)?1:o&&o.bottom>=r?-1:1}function k_(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:n,bias:RG(t,n,e.clientX,e.clientY)}}const MG=se.ie&&se.ie_version<=11;let __=null,x_=0,C_=0;function rL(t){if(!MG)return t.detail;let e=__,n=C_;return __=t,C_=Date.now(),x_=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(x_+1)%3:1}function IG(t,e){let n=k_(t,e),r=rL(e),i=t.state.selection;return{update(s){s.docChanged&&(n.pos=s.changes.mapPos(n.pos),i=i.map(s.changes))},get(s,o,a){let l=k_(t,s),c,u=S_(t,l.pos,l.bias,r);if(n.pos!=l.pos&&!o){let h=S_(t,n.pos,n.bias,r),d=Math.min(h.from,u.from),p=Math.max(h.to,u.to);u=d1&&(c=LG(i,l.pos))?c:a?i.addRange(u):ae.create([u])}}}function LG(t,e){for(let n=0;n=e)return ae.create(t.ranges.slice(0,n).concat(t.ranges.slice(n+1)),t.mainIndex==n?0:t.mainIndex-(t.mainIndex>n?1:0))}return null}Pr.dragstart=(t,e)=>{let{selection:{main:n}}=t.state;if(e.target.draggable){let i=t.docView.nearest(e.target);if(i&&i.isWidget){let s=i.posAtStart,o=s+i.length;(s>=n.to||o<=n.from)&&(n=ae.range(s,o))}}let{inputState:r}=t;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",um(t.state,Iv,t.state.sliceDoc(n.from,n.to))),e.dataTransfer.effectAllowed="copyMove"),!1};Pr.dragend=t=>(t.inputState.draggedContent=null,!1);function D_(t,e,n,r){if(n=um(t.state,Mv,n),!n)return;let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=t.inputState,o=r&&s&&DG(t,e)?{from:s.from,to:s.to}:null,a={from:i,insert:n},l=t.state.changes(o?[o,a]:a);t.focus(),t.dispatch({changes:l,selection:{anchor:l.mapPos(i,-1),head:l.mapPos(i,1)},userEvent:o?"move.drop":"input.drop"}),t.inputState.draggedContent=null}Pr.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let n=e.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,s=()=>{++i==n.length&&D_(t,e,r.filter(o=>o!=null).join(t.state.lineBreak),!1)};for(let o=0;o{/[\x00-\x08\x0e-\x1f]{2}/.test(a.result)||(r[o]=a.result),s()},a.readAsText(n[o])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return D_(t,e,r,!0),!0}return!1};Pr.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=tL?null:e.clipboardData;return n?(nL(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(NG(t),!1)};function QG(t,e){let n=t.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=e,r.focus(),r.selectionEnd=e.length,r.selectionStart=0,setTimeout(()=>{r.remove(),t.focus()},50)}function $G(t){let e=[],n=[],r=!1;for(let i of t.selection.ranges)i.empty||(e.push(t.sliceDoc(i.from,i.to)),n.push(i));if(!e.length){let i=-1;for(let{from:s}of t.selection.ranges){let o=t.doc.lineAt(s);o.number>i&&(e.push(o.text),n.push({from:o.from,to:Math.min(t.doc.length,o.to+1)})),i=o.number}r=!0}return{text:um(t,Iv,e.join(t.lineBreak)),ranges:n,linewise:r}}let ob=null;Pr.copy=Pr.cut=(t,e)=>{let{text:n,ranges:r,linewise:i}=$G(t.state);if(!n&&!i)return!1;ob=i?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let s=tL?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",n),!0):(QG(t,n),!1)};const iL=Jo.define();function sL(t,e){let n=[];for(let r of t.facet($I)){let i=r(t,e);i&&n.push(i)}return n.length?t.update({effects:n,annotations:iL.of(!0)}):null}function oL(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=sL(t.state,e);n?t.dispatch(n):t.update([])}},10)}gr.focus=t=>{t.inputState.lastFocusTime=Date.now(),!t.scrollDOM.scrollTop&&(t.inputState.lastScrollTop||t.inputState.lastScrollLeft)&&(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),oL(t)};gr.blur=t=>{t.observer.clearSelectionRange(),oL(t)};gr.compositionstart=gr.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};gr.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,se.chrome&&se.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};gr.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};Pr.beforeinput=(t,e)=>{var n,r;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(t.inputState.insertingText=e.data,t.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&t.observer.editContext){let s=(n=e.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),o=e.getTargetRanges();if(s&&o.length){let a=o[0],l=t.posAtDOM(a.startContainer,a.startOffset),c=t.posAtDOM(a.endContainer,a.endOffset);return Qv(t,{from:l,to:c,insert:t.state.toText(s)},null),!0}}let i;if(se.chrome&&se.android&&(i=JI.find(s=>s.inputType==e.inputType))&&(t.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let s=((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>s+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return se.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),se.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>gr.compositionend(t,e),20),!1};const A_=new Set;function FG(t){A_.has(t)||(A_.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const P_=["pre-wrap","normal","pre-line","break-spaces"];let nl=!1;function N_(){nl=!1}class BG{constructor(e){this.lineWrapping=e,this.doc=We.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,n){let r=this.doc.lineAt(n).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((n-e-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return P_.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let n=!1;for(let r=0;r-1,l=Math.round(n)!=Math.round(this.lineHeight)||this.lineWrapping!=a;if(this.lineWrapping=a,this.lineHeight=n,this.charWidth=r,this.textHeight=i,this.lineLength=s,l){this.heightSamples={};for(let c=0;c0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>Nd&&(nl=!0),this.height=e)}replace(e,n,r){return wn.of(r)}decomposeLeft(e,n){n.push(this)}decomposeRight(e,n){n.push(this)}applyChanges(e,n,r,i){let s=this,o=r.doc;for(let a=i.length-1;a>=0;a--){let{fromA:l,toA:c,fromB:u,toB:h}=i[a],d=s.lineAt(l,ht.ByPosNoHeight,r.setDoc(n),0,0),p=d.to>=c?d:s.lineAt(c,ht.ByPosNoHeight,r,0,0);for(h+=p.to-c,c=p.to;a>0&&d.from<=i[a-1].toA;)l=i[a-1].fromA,u=i[a-1].fromB,a--,ls*2){let a=e[n-1];a.break?e.splice(--n,1,a.left,null,a.right):e.splice(--n,1,a.left,a.right),r+=1+a.break,i-=a.size}else if(s>i*2){let a=e[r];a.break?e.splice(r,1,a.left,null,a.right):e.splice(r,1,a.left,a.right),r+=2+a.break,s-=a.size}else break;else if(i=s&&o(this.blockAt(0,r,i,s))}updateHeight(e,n=0,r=!1,i){return i&&i.from<=n&&i.more&&this.setHeight(i.heights[i.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Hn extends aL{constructor(e,n){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,n,r,i){return new ti(i,this.length,r,this.height,this.breaks)}replace(e,n,r){let i=r[0];return r.length==1&&(i instanceof Hn||i instanceof Jt&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof Jt?i=new Hn(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):wn.of(r)}updateHeight(e,n=0,r=!1,i){return i&&i.from<=n&&i.more?this.setHeight(i.heights[i.index++]):(r||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class Jt extends wn{constructor(e){super(e,0)}heightMetrics(e,n){let r=e.doc.lineAt(n).number,i=e.doc.lineAt(n+this.length).number,s=i-r+1,o,a=0;if(e.lineWrapping){let l=Math.min(this.height,e.lineHeight*s);o=l/s,this.length>s+1&&(a=(this.height-l)/(this.length-s-1))}else o=this.height/s;return{firstLine:r,lastLine:i,perLine:o,perChar:a}}blockAt(e,n,r,i){let{firstLine:s,lastLine:o,perLine:a,perChar:l}=this.heightMetrics(n,i);if(n.lineWrapping){let c=i+(e0){let s=r[r.length-1];s instanceof Jt?r[r.length-1]=new Jt(s.length+i):r.push(null,new Jt(i-1))}if(e>0){let s=r[0];s instanceof Jt?r[0]=new Jt(e+s.length):r.unshift(new Jt(e-1),null)}return wn.of(r)}decomposeLeft(e,n){n.push(new Jt(e-1),null)}decomposeRight(e,n){n.push(null,new Jt(this.length-e-1))}updateHeight(e,n=0,r=!1,i){let s=n+this.length;if(i&&i.from<=n+this.length&&i.more){let o=[],a=Math.max(n,i.from),l=-1;for(i.from>n&&o.push(new Jt(i.from-n-1).updateHeight(e,n));a<=s&&i.more;){let u=e.doc.lineAt(a).length;o.length&&o.push(null);let h=i.heights[i.index++];l==-1?l=h:Math.abs(h-l)>=Nd&&(l=-2);let d=new Hn(u,h);d.outdated=!1,o.push(d),a+=u+1}a<=s&&o.push(null,new Jt(s-a).updateHeight(e,a));let c=wn.of(o);return(l<0||Math.abs(c.height-this.height)>=Nd||Math.abs(l-this.heightMetrics(e,n).perLine)>=Nd)&&(nl=!0),wp(this,c)}else(r||this.outdated)&&(this.setHeight(e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class zG extends wn{constructor(e,n,r){super(e.length+n+r.length,e.height+r.height,n|(e.outdated||r.outdated?2:0)),this.left=e,this.right=r,this.size=e.size+r.size}get break(){return this.flags&1}blockAt(e,n,r,i){let s=r+this.left.height;return ea))return c;let u=n==ht.ByPosNoHeight?ht.ByPosNoHeight:ht.ByPos;return l?c.join(this.right.lineAt(a,u,r,o,a)):this.left.lineAt(a,u,r,i,s).join(c)}forEachLine(e,n,r,i,s,o){let a=i+this.left.height,l=s+this.left.length+this.break;if(this.break)e=l&&this.right.forEachLine(e,n,r,a,l,o);else{let c=this.lineAt(l,ht.ByPos,r,i,s);e=e&&c.from<=n&&o(c),n>c.to&&this.right.forEachLine(c.to+1,n,r,a,l,o)}}replace(e,n,r){let i=this.left.length+this.break;if(nthis.left.length)return this.balanced(this.left,this.right.replace(e-i,n-i,r));let s=[];e>0&&this.decomposeLeft(e,s);let o=s.length;for(let a of r)s.push(a);if(e>0&&R_(s,o-1),n=r&&n.push(null)),e>r&&this.right.decomposeLeft(e-r,n)}decomposeRight(e,n){let r=this.left.length,i=r+this.break;if(e>=i)return this.right.decomposeRight(e-i,n);e2*n.size||n.size>2*e.size?wn.of(this.break?[e,null,n]:[e,n]):(this.left=wp(this.left,e),this.right=wp(this.right,n),this.setHeight(e.height+n.height),this.outdated=e.outdated||n.outdated,this.size=e.size+n.size,this.length=e.length+this.break+n.length,this)}updateHeight(e,n=0,r=!1,i){let{left:s,right:o}=this,a=n+s.length+this.break,l=null;return i&&i.from<=n+s.length&&i.more?l=s=s.updateHeight(e,n,r,i):s.updateHeight(e,n,r),i&&i.from<=a+o.length&&i.more?l=o=o.updateHeight(e,a,r,i):o.updateHeight(e,a,r),l?this.balanced(s,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function R_(t,e){let n,r;t[e]==null&&(n=t[e-1])instanceof Jt&&(r=t[e+1])instanceof Jt&&t.splice(e-1,3,new Jt(n.length+1+r.length))}const VG=5;class $v{constructor(e,n){this.pos=e,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,n){if(this.lineStart>-1){let r=Math.min(n,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof Hn?i.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new Hn(r-this.pos,-1)),this.writtenTo=r,n>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(e,n,r){if(e=VG)&&this.addLineDeco(i,s,o)}else n>e&&this.span(e,n);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=n,this.writtenToe&&this.nodes.push(new Hn(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,n){let r=new Jt(n-e);return this.oracle.doc.lineAt(e).to==n&&(r.flags|=4),r}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Hn)return e;let n=new Hn(0,-1);return this.nodes.push(n),n}addBlock(e){this.enterLine();let n=e.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,n&&n.endSide>0&&(this.covering=e)}addLineDeco(e,n,r){let i=this.ensureLine();i.length+=r,i.collapsed+=r,i.widgetHeight=Math.max(i.widgetHeight,e),i.breaks+=n,this.writtenTo=this.pos=this.pos+r}finish(e){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof Hn)&&!this.isCovered?this.nodes.push(new Hn(0,-1)):(this.writtenTou.clientHeight||u.scrollWidth>u.clientWidth)&&h.overflow!="visible"){let d=u.getBoundingClientRect();s=Math.max(s,d.left),o=Math.min(o,d.right),a=Math.max(a,d.top),l=Math.min(c==t.parentNode?i.innerHeight:l,d.bottom)}c=h.position=="absolute"||h.position=="fixed"?u.offsetParent:u.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:s-n.left,right:Math.max(s,o)-n.left,top:a-(n.top+e),bottom:Math.max(a,l)-(n.top+e)}}function qG(t){let e=t.getBoundingClientRect(),n=t.ownerDocument.defaultView||window;return e.left0&&e.top0}function ZG(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}class Vg{constructor(e,n,r,i){this.from=e,this.to=n,this.size=r,this.displaySize=i}static same(e,n){if(e.length!=n.length)return!1;for(let r=0;rtypeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new BG(n),this.stateDeco=e.facet(gu).filter(r=>typeof r!="function"),this.heightMap=wn.empty().applyChanges(this.stateDeco,We.empty,this.heightOracle.setDoc(e.doc),[new mr(0,0,0,e.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Ft.set(this.lineGaps.map(r=>r.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:n}=this.state.selection;for(let r=0;r<=1;r++){let i=r?n.head:n.anchor;if(!e.some(({from:s,to:o})=>i>=s&&i<=o)){let{from:s,to:o}=this.lineBlockAt(i);e.push(new zh(s,o))}}return this.viewports=e.sort((r,i)=>r.from-i.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?I_:new Fv(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(ac(e,this.scaler))})}update(e,n=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=this.state.facet(gu).filter(u=>typeof u!="function");let i=e.changedRanges,s=mr.extendWithRanges(i,UG(r,this.stateDeco,e?e.changes:Ht.empty(this.state.doc.length))),o=this.heightMap.height,a=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);N_(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=o||nl)&&(e.flags|=2),a?(this.scrollAnchorPos=e.changes.mapPos(a.from,-1),this.scrollAnchorHeight=a.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let l=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(n&&(n.range.headl.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,n));let c=l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,e.flags|=this.updateForViewport(),(c||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(K6)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let n=e.contentDOM,r=window.getComputedStyle(n),i=this.heightOracle,s=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?Zt.RTL:Zt.LTR;let o=this.heightOracle.mustRefreshForWrapping(s),a=n.getBoundingClientRect(),l=o||this.mustMeasureContent||this.contentDOMHeight!=a.height;this.contentDOMHeight=a.height,this.mustMeasureContent=!1;let c=0,u=0;if(a.width&&a.height){let{scaleX:S,scaleY:w}=mI(n,a);(S>.005&&Math.abs(this.scaleX-S)>.005||w>.005&&Math.abs(this.scaleY-w)>.005)&&(this.scaleX=S,this.scaleY=w,c|=16,o=l=!0)}let h=(parseInt(r.paddingTop)||0)*this.scaleY,d=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=h||this.paddingBottom!=d)&&(this.paddingTop=h,this.paddingBottom=d,c|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(i.lineWrapping&&(l=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=16);let p=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=p&&(this.scrollAnchorHeight=-1,this.scrollTop=p),this.scrolledToBottom=yI(e.scrollDOM);let f=(this.printing?ZG:XG)(n,this.paddingTop),m=f.top-this.pixelViewport.top,g=f.bottom-this.pixelViewport.bottom;this.pixelViewport=f;let y=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(y!=this.inView&&(this.inView=y,y&&(l=!0)),!this.inView&&!this.scrollTarget&&!qG(e.dom))return 0;let b=a.width;if((this.contentDOMWidth!=b||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=a.width,this.editorHeight=e.scrollDOM.clientHeight,c|=16),l){let S=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(S)&&(o=!0),o||i.lineWrapping&&Math.abs(b-this.contentDOMWidth)>i.charWidth){let{lineHeight:w,charWidth:A,textHeight:C}=e.docView.measureTextSize();o=w>0&&i.refresh(s,w,A,C,Math.max(5,b/A),S),o&&(e.docView.minWidth=0,c|=16)}m>0&&g>0?u=Math.max(m,g):m<0&&g<0&&(u=Math.min(m,g)),N_();for(let w of this.viewports){let A=w.from==this.viewport.from?S:e.docView.measureVisibleLineHeights(w);this.heightMap=(o?wn.empty().applyChanges(this.stateDeco,We.empty,this.heightOracle,[new mr(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,o,new jG(w.from,A))}nl&&(c|=2)}let T=!this.viewportIsAppropriate(this.viewport,u)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return T&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(u,this.scrollTarget),c|=this.updateForViewport()),(c&2||T)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,n){let r=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),i=this.heightMap,s=this.heightOracle,{visibleTop:o,visibleBottom:a}=this,l=new zh(i.lineAt(o-r*1e3,ht.ByHeight,s,0,0).from,i.lineAt(a+(1-r)*1e3,ht.ByHeight,s,0,0).to);if(n){let{head:c}=n.range;if(cl.to){let u=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),h=i.lineAt(c,ht.ByPos,s,0,0),d;n.y=="center"?d=(h.top+h.bottom)/2-u/2:n.y=="start"||n.y=="nearest"&&c=a+Math.max(10,Math.min(r,250)))&&i>o-2*1e3&&s>1,o=i<<1;if(this.defaultTextDirection!=Zt.LTR&&!r)return[];let a=[],l=(u,h,d,p)=>{if(h-uu&&yy.from>=d.from&&y.to<=d.to&&Math.abs(y.from-u)y.fromb));if(!g){if(hT.from<=h&&T.to>=h)){let T=n.moveToLineBoundary(ae.cursor(h),!1,!0).head;T>u&&(h=T)}let y=this.gapSize(d,u,h,p),b=r||y<2e6?y:2e6;g=new Vg(u,h,y,b)}a.push(g)},c=u=>{if(u.length2e6)for(let A of e)A.from>=u.from&&A.fromu.from&&l(u.from,p,u,h),fn.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let r=[];Ye.spans(n,this.viewport.from,this.viewport.to,{span(s,o){r.push({from:s,to:o})},point(){}},20);let i=0;if(r.length!=this.visibleRanges.length)i=12;else for(let s=0;s=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(n=>n.from<=e&&n.to>=e)||ac(this.heightMap.lineAt(e,ht.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=e&&n.bottom>=e)||ac(this.heightMap.lineAt(this.scaler.fromDOM(e),ht.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let n=this.lineBlockAtHeight(e+8);return n.from>=this.viewport.from||this.viewportLines[0].top-e>200?n:this.viewportLines[0]}elementAtHeight(e){return ac(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class zh{constructor(e,n){this.from=e,this.to=n}}function GG(t,e,n){let r=[],i=t,s=0;return Ye.spans(n,t,e,{span(){},point(o,a){o>i&&(r.push({from:i,to:o}),s+=o-i),i=a}},20),i=1)return e[e.length-1].to;let r=Math.floor(t*n);for(let i=0;;i++){let{from:s,to:o}=e[i],a=o-s;if(r<=a)return s+r;r-=a}}function Uh(t,e){let n=0;for(let{from:r,to:i}of t.ranges){if(e<=i){n+=e-r;break}n+=i-r}return n/t.total}function YG(t,e){for(let n of t)if(e(n))return n}const I_={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};class Fv{constructor(e,n,r){let i=0,s=0,o=0;this.viewports=r.map(({from:a,to:l})=>{let c=n.lineAt(a,ht.ByPos,e,0,0).top,u=n.lineAt(l,ht.ByPos,e,0,0).bottom;return i+=u-c,{from:a,to:l,top:c,bottom:u,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(n.height-i);for(let a of this.viewports)a.domTop=o+(a.top-s)*this.scale,o=a.domBottom=a.domTop+(a.bottom-a.top),s=a.bottom}toDOM(e){for(let n=0,r=0,i=0;;n++){let s=nn.from==e.viewports[r].from&&n.to==e.viewports[r].to):!1}}function ac(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),r=e.toDOM(t.bottom);return new ti(t.from,t.length,n,r-n,Array.isArray(t._content)?t._content.map(i=>ac(i,e)):t._content)}const Hh=Ee.define({combine:t=>t.join(" ")}),ab=Ee.define({combine:t=>t.indexOf(!0)>-1}),lb=qs.newName(),lL=qs.newName(),cL=qs.newName(),uL={"&light":"."+lL,"&dark":"."+cL};function cb(t,e,n){return new qs(e,{finish(r){return/&/.test(r)?r.replace(/&\w*/,i=>{if(i=="&")return t;if(!n||!n[i])throw new RangeError(`Unsupported selector: ${i}`);return n[i]}):t+" "+r}})}const KG=cb("."+lb,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},uL),JG={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Ug=se.ie&&se.ie_version<=11;class e7{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new M6,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(n=>{for(let r of n)this.queue.push(r);(se.ie&&se.ie_version<=11||se.ios&&e.composing)&&n.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&se.android&&e.constructor.EDIT_CONTEXT!==!1&&!(se.chrome&&se.chrome_version<126)&&(this.editContext=new n7(e),e.state.facet(Ri)&&(e.contentDOM.editContext=this.editContext.editContext)),Ug&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((n,r)=>n!=e[r]))){this.gapIntersection.disconnect();for(let n of e)this.gapIntersection.observe(n);this.gaps=e}}onSelectionChange(e){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,i=this.selectionRange;if(r.state.facet(Ri)?r.root.activeElement!=this.dom:!Ad(this.dom,i))return;let s=i.anchorNode&&r.docView.nearest(i.anchorNode);if(s&&s.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(se.ie&&se.ie_version<=11||se.android&&se.chrome)&&!r.state.selection.main.empty&&i.focusNode&&vc(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=fu(e.root);if(!n)return!1;let r=se.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&t7(this.view,n)||n;if(!r||this.selectionRange.eq(r))return!1;let i=Ad(this.dom,r);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&Ia(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(i)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:n,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let n=-1,r=-1,i=!1;for(let s of e){let o=this.readMutation(s);o&&(o.typeOver&&(i=!0),n==-1?{from:n,to:r}=o:(n=Math.min(o.from,n),r=Math.max(o.to,r)))}return{from:n,to:r,typeOver:i}}readChange(){let{from:e,to:n,typeOver:r}=this.processRecords(),i=this.selectionChanged&&Ad(this.dom,this.selectionRange);if(e<0&&!i)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new bG(this.view,e,n,r);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let r=this.view.state,i=YI(this.view,n);return this.view.state==r&&(n.domChanged||n.newSel&&!n.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),i}readMutation(e){let n=this.view.docView.nearest(e.target);if(!n||n.ignoreMutation(e))return null;if(n.markDirty(e.type=="attributes"),e.type=="attributes"&&(n.flags|=4),e.type=="childList"){let r=L_(n,e.previousSibling||e.target.previousSibling,-1),i=L_(n,e.nextSibling||e.target.nextSibling,1);return{from:r?n.posAfter(r):n.posAtStart,to:i?n.posBefore(i):n.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(Ri)!=e.state.facet(Ri)&&(e.view.contentDOM.editContext=e.state.facet(Ri)?this.editContext.editContext:null))}destroy(){var e,n,r;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function L_(t,e,n){for(;e;){let r=Je.get(e);if(r&&r.parent==t)return r;let i=e.parentNode;e=i!=t.dom?i:n>0?e.nextSibling:e.previousSibling}return null}function Q_(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,s=e.endOffset,o=t.docView.domAtPos(t.state.selection.main.anchor);return vc(o.node,o.offset,i,s)&&([n,r,i,s]=[i,s,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}}function t7(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return Q_(t,i)}let n=null;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",r,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",r,!0),n?Q_(t,n):null}class n7{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let n=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=r=>{let i=e.state.selection.main,{anchor:s,head:o}=i,a=this.toEditorPos(r.updateRangeStart),l=this.toEditorPos(r.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:r.updateRangeStart,editorBase:a,drifted:!1});let c=l-a>r.text.length;a==this.from&&sthis.to&&(l=s);let u=KI(e.state.sliceDoc(a,l),r.text,(c?i.from:i.to)-a,c?"end":null);if(!u){let d=ae.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd));d.main.eq(i)||e.dispatch({selection:d,userEvent:"select"});return}let h={from:u.from+a,to:u.toA+a,insert:We.of(r.text.slice(u.from,u.toB).split(` `))};if((se.mac||se.android)&&h.from==o-1&&/^\. ?$/.test(r.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(h={from:a,to:l,insert:We.of([r.text.replace("."," ")])}),this.pendingContextChange=h,!e.state.readOnly){let d=this.to-this.from+(h.to-h.from+h.insert.length);Qv(e,h,ae.single(this.toEditorPos(r.selectionStart,d),this.toEditorPos(r.selectionEnd,d)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),h.from=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,r.updateRangeStart-1),Math.min(n.text.length,r.updateRangeStart+1)))&&this.handlers.compositionend(r)},this.handlers.characterboundsupdate=r=>{let i=[],s=null;for(let o=this.toEditorPos(r.rangeStart),a=this.toEditorPos(r.rangeEnd);o{let i=[];for(let s of r.getTextFormats()){let o=s.underlineStyle,a=s.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(a)){let l=this.toEditorPos(s.rangeStart),c=this.toEditorPos(s.rangeEnd);if(l{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:r}=this.composing;this.composing=null,r&&this.reset(e.state)}};for(let r in this.handlers)n.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{this.editContext.updateControlBounds(r.contentDOM.getBoundingClientRect());let i=fu(r.root);i&&i.rangeCount&&this.editContext.updateSelectionBounds(i.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let n=0,r=!1,i=this.pendingContextChange;return e.changes.iterChanges((s,o,a,l,c)=>{if(r)return;let u=c.length-(o-s);if(i&&o>=i.to)if(i.from==s&&i.to==o&&i.insert.eq(c)){i=this.pendingContextChange=null,n+=u,this.to+=u;return}else i=null,this.revertPending(e.state);if(s+=n,o+=n,o<=this.from)this.from+=u,this.to+=u;else if(sthis.to||this.to-this.from+c.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),c.toString()),this.to+=u}n+=u}),i&&!r&&this.revertPending(e.state),!r}update(e){let n=this.pendingContextChange,r=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(r.from,r.to)&&e.transactions.some(i=>!i.isUserEvent("input.type")&&i.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||n)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:n}=e.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(e.doc.length,n+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),e.doc.sliceString(n.from,n.to))}setSelection(e){let{main:n}=e.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),i=this.toContextPos(n.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=i)&&this.editContext.updateSelection(r,i)}rangeIsValid(e){let{head:n}=e.selection.main;return!(this.from>0&&n-this.from<500||this.to1e4*3)}toEditorPos(e,n=this.to-this.from){e=Math.min(e,n);let r=this.composing;return r&&r.drifted?r.editorBase+(e-r.contextBase):e+this.from}toContextPos(e){let n=this.composing;return n&&n.drifted?n.contextBase+(e-n.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class Ce{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:r}=e;this.dispatchTransactions=e.dispatchTransactions||r&&(i=>i.forEach(s=>r(s,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=e.root||I6(e.parent)||document,this.viewState=new M_(e.state||Ze.create(e)),e.scrollTo&&e.scrollTo.is(Fh)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Sa).map(i=>new Bg(i));for(let i of this.plugins)i.update(this);this.observer=new e7(this),this.inputState=new SG(this),this.inputState.ensureHandlers(this.plugins),this.docView=new m_(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...e){let n=e.length==1&&e[0]instanceof nn?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(n,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,r=!1,i,s=this.state;for(let d of e){if(d.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=d.state}if(this.destroyed){this.viewState.state=s;return}let o=this.hasFocus,a=0,l=null;e.some(d=>d.annotation(iL))?(this.inputState.notifiedFocused=o,a=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,l=sL(s,o),l||(a=1));let c=this.observer.delayedAndroidKey,u=null;if(c?(this.observer.clearDelayedAndroidKey(),u=this.observer.readChange(),(u&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(u=null)):this.observer.clear(),s.facet(Ze.phrases)!=this.state.facet(Ze.phrases))return this.setState(s);i=Sp.create(this,s,e),i.flags|=a;let h=this.viewState.scrollTarget;try{this.updateState=2;for(let d of e){if(h&&(h=h.map(d.changes)),d.scrollIntoView){let{main:p}=d.state.selection;h=new La(p.empty?p:ae.cursor(p.head,p.head>p.anchor?-1:1))}for(let p of d.effects)p.is(Fh)&&(h=p.value.clip(this.state))}this.viewState.update(i,h),this.bidiCache=kp.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),n=this.docView.update(i),this.state.facet(sc)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(d=>d.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(Hh)!=i.state.facet(Hh)&&(this.viewState.mustMeasureContent=!0),(n||r||h||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!i.empty)for(let d of this.state.facet(ib))try{d(i)}catch(p){ri(this.state,p,"update listener")}(l||u)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),u&&!YI(this,u)&&c.force&&Ia(this.contentDOM,c.key,c.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let n=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new M_(e),this.plugins=e.facet(Sa).map(r=>new Bg(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new m_(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(e){let n=e.startState.facet(Sa),r=e.state.facet(Sa);if(n!=r){let i=[];for(let s of r){let o=n.indexOf(s);if(o<0)i.push(new Bg(s));else{let a=this.plugins[o];a.mustUpdate=e,i.push(a)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let i of this.plugins)i.mustUpdate=e;for(let i=0;i-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let n=null,r=this.scrollDOM,i=r.scrollTop*this.scaleY,{scrollAnchorPos:s,scrollAnchorHeight:o}=this.viewState;Math.abs(i-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let a=0;;a++){if(o<0)if(yI(r))s=-1,o=this.viewState.heightMap.height;else{let p=this.viewState.scrollAnchorAt(i);s=p.from,o=p.top}this.updateState=1;let l=this.viewState.measure(this);if(!l&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(a>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];l&4||([this.measureRequests,c]=[c,this.measureRequests]);let u=c.map(p=>{try{return p.read(this)}catch(f){return ri(this.state,f),$_}}),h=Sp.create(this,this.state,[]),d=!1;h.flags|=l,n?n.flags|=l:n=h,this.updateState=2,h.empty||(this.updatePlugins(h),this.inputState.update(h),this.updateAttrs(),d=this.docView.update(h),d&&this.docViewUpdate());for(let p=0;p1||p<-1){i=i+p,r.scrollTop=i/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let a of this.state.facet(ib))a(n)}get themeClasses(){return lb+" "+(this.state.facet(ab)?cL:lL)+" "+this.state.facet(Hh)}updateAttrs(){let e=F_(this,zI,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Ri)?"true":"false",class:"cm-content",style:`${se.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),F_(this,Lv,n);let r=this.observer.ignore(()=>{let i=Jy(this.contentDOM,this.contentAttrs,n),s=Jy(this.dom,this.editorAttrs,e);return i||s});return this.editorAttrs=e,this.contentAttrs=n,r}showAnnouncements(e){let n=!0;for(let r of e)for(let i of r.effects)if(i.is(Ce.announce)){n&&(this.announceDOM.textContent=""),n=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=i.value}}mountStyles(){this.styleModules=this.state.facet(sc);let e=this.state.facet(Ce.cspNonce);qs.mount(this.root,this.styleModules.concat(KG).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let n=0;nr.plugin==e)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,n,r){return zg(this,e,E_(this,e,n,r))}moveByGroup(e,n){return zg(this,e,E_(this,e,n,r=>fG(this,e.head,r)))}visualLineSide(e,n){let r=this.bidiSpans(e),i=this.textDirectionAt(e.from),s=r[n?r.length-1:0];return ae.cursor(s.side(n,i)+e.from,s.forward(!n,i)?1:-1)}moveToLineBoundary(e,n,r=!0){return pG(this,e,n,r)}moveVertically(e,n,r){return zg(this,e,mG(this,e,n,r))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,n=0){return this.docView.posFromDOM(e,n)}posAtCoords(e,n=!0){return this.readMeasured(),ZI(this,e,n)}coordsAtPos(e,n=1){this.readMeasured();let r=this.docView.coordsAt(e,n);if(!r||r.left==r.right)return r;let i=this.state.doc.lineAt(e),s=this.bidiSpans(i),o=s[Rs.find(s,e-i.from,-1,n)];return lm(r,o.dir==Zt.LTR==n>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(FI)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>r7)return PI(e.length);let n=this.textDirectionAt(e.from),r;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==n&&(s.fresh||AI(s.isolates,r=f_(this,e))))return s.order;r||(r=f_(this,e));let i=W6(e.text,n,r);return this.bidiCache.push(new kp(e.from,e.to,n,r,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||se.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{gI(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,n={}){return Fh.of(new La(typeof e=="number"?ae.cursor(e):e,n.y,n.x,n.yMargin,n.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:n}=this.scrollDOM,r=this.viewState.scrollAnchorAt(e);return Fh.of(new La(ae.cursor(r.from),"start","start",r.top-e,n,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return Ws.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Ws.define(()=>({}),{eventObservers:e})}static theme(e,n){let r=qs.newName(),i=[Hh.of(r),sc.of(cb(`.${r}`,e))];return n&&n.dark&&i.push(ab.of(!0)),i}static baseTheme(e){return sm.lowest(sc.of(cb("."+lb,e,uL)))}static findFromDOM(e){var n;let r=e.querySelector(".cm-content"),i=r&&Je.get(r)||Je.get(e);return((n=i==null?void 0:i.rootView)===null||n===void 0?void 0:n.view)||null}}Ce.styleModule=sc;Ce.inputHandler=QI;Ce.clipboardInputFilter=Mv;Ce.clipboardOutputFilter=Iv;Ce.scrollHandler=BI;Ce.focusChangeEffect=$I;Ce.perLineTextDirection=FI;Ce.exceptionSink=LI;Ce.updateListener=ib;Ce.editable=Ri;Ce.mouseSelectionStyle=II;Ce.dragMovesSelection=MI;Ce.clickAddsSelectionRange=RI;Ce.decorations=gu;Ce.outerDecorations=VI;Ce.atomicRanges=Xu;Ce.bidiIsolatedRanges=UI;Ce.scrollMargins=HI;Ce.darkTheme=ab;Ce.cspNonce=Ee.define({combine:t=>t.length?t[0]:""});Ce.contentAttributes=Lv;Ce.editorAttributes=zI;Ce.lineWrapping=Ce.contentAttributes.of({class:"cm-lineWrapping"});Ce.announce=Et.define();const r7=4096,$_={};class kp{constructor(e,n,r,i,s,o){this.from=e,this.to=n,this.dir=r,this.isolates=i,this.fresh=s,this.order=o}static update(e,n){if(n.empty&&!e.some(s=>s.fresh))return e;let r=[],i=e.length?e[e.length-1].dir:Zt.LTR;for(let s=Math.max(0,e.length-10);s=0;i--){let s=r[i],o=typeof s=="function"?s(t):s;o&&Ky(o,n)}return n}const i7=se.mac?"mac":se.windows?"win":se.linux?"linux":"key";function s7(t,e){const n=t.split(/-(?!$)/);let r=n[n.length-1];r=="Space"&&(r=" ");let i,s,o,a;for(let l=0;lr.concat(i),[]))),n}let ws=null;const l7=4e3;function c7(t,e=i7){let n=Object.create(null),r=Object.create(null),i=(o,a)=>{let l=r[o];if(l==null)r[o]=a;else if(l!=a)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},s=(o,a,l,c,u)=>{var h,d;let p=n[o]||(n[o]=Object.create(null)),f=a.split(/ (?!$)/).map(y=>s7(y,e));for(let y=1;y{let S=ws={view:T,prefix:b,scope:o};return setTimeout(()=>{ws==S&&(ws=null)},l7),!0}]})}let m=f.join(" ");i(m,!1);let g=p[m]||(p[m]={preventDefault:!1,stopPropagation:!1,run:((d=(h=p._any)===null||h===void 0?void 0:h.run)===null||d===void 0?void 0:d.slice())||[]});l&&g.run.push(l),c&&(g.preventDefault=!0),u&&(g.stopPropagation=!0)};for(let o of t){let a=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let c of a){let u=n[c]||(n[c]=Object.create(null));u._any||(u._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:h}=o;for(let d in u)u[d].run.push(p=>h(p,ub))}let l=o[e]||o.key;if(l)for(let c of a)s(c,l,o.run,o.preventDefault,o.stopPropagation),o.shift&&s(c,"Shift-"+l,o.shift,o.preventDefault,o.stopPropagation)}return n}let ub=null;function u7(t,e,n,r){ub=e;let i=IN(e),s=p6(i,0),o=f6(s)==i.length&&i!=" ",a="",l=!1,c=!1,u=!1;ws&&ws.view==n&&ws.scope==r&&(a=ws.prefix+" ",eL.indexOf(e.keyCode)<0&&(c=!0,ws=null));let h=new Set,d=g=>{if(g){for(let y of g.run)if(!h.has(y)&&(h.add(y),y(n)))return g.stopPropagation&&(u=!0),!0;g.preventDefault&&(g.stopPropagation&&(u=!0),c=!0)}return!1},p=t[r],f,m;return p&&(d(p[a+Xh(i,e,!o)])?l=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(se.windows&&e.ctrlKey&&e.altKey)&&!(se.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(f=Gi[e.keyCode])&&f!=i?(d(p[a+Xh(f,e,!0)])||e.shiftKey&&(m=Kc[e.keyCode])!=i&&m!=f&&d(p[a+Xh(m,e,!1)]))&&(l=!0):o&&e.shiftKey&&d(p[a+Xh(i,e,!0)])&&(l=!0),!l&&d(p._any)&&(l=!0)),c&&(l=!0),l&&u&&e.stopPropagation(),ub=null,l}class Vo extends Fo{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Vo.prototype.elementClass="";Vo.prototype.toDOM=void 0;Vo.prototype.mapMode=Sn.TrackBefore;Vo.prototype.startSide=Vo.prototype.endSide=-1;Vo.prototype.point=!0;const Hg=Ee.define(),h7=Ee.define(),Rd=Ee.define(),j_=Ee.define({combine:t=>t.some(e=>e)});function d7(t){return[p7]}const p7=Ws.fromClass(class{constructor(t){this.view=t,this.domAfter=null,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(Rd).map(e=>new V_(t,e)),this.fixed=!t.state.facet(j_);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(t){if(this.updateGutters(t)){let e=this.prevViewport,n=t.view.viewport,r=Math.min(e.to,n.to)-Math.max(e.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}if(t.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(j_)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=Ye.iter(this.view.state.facet(Hg),this.view.viewport.from),r=[],i=this.gutters.map(s=>new f7(s,this.view.viewport,-this.view.documentPadding.top));for(let s of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(s.type)){let o=!0;for(let a of s.type)if(a.type==fr.Text&&o){hb(n,r,a.from);for(let l of i)l.line(this.view,a,r);o=!1}else if(a.widget)for(let l of i)l.widget(this.view,a)}else if(s.type==fr.Text){hb(n,r,s.from);for(let o of i)o.line(this.view,s,r)}else if(s.widget)for(let o of i)o.widget(this.view,s);for(let s of i)s.finish();t&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(t){let e=t.startState.facet(Rd),n=t.state.facet(Rd),r=t.docChanged||t.heightChanged||t.viewportChanged||!Ye.eq(t.startState.facet(Hg),t.state.facet(Hg),t.view.viewport.from,t.view.viewport.to);if(e==n)for(let i of this.gutters)i.update(t)&&(r=!0);else{r=!0;let i=[];for(let s of n){let o=e.indexOf(s);o<0?i.push(new V_(this.view,s)):(this.gutters[o].update(t),i.push(this.gutters[o]))}for(let s of this.gutters)s.dom.remove(),i.indexOf(s)<0&&s.destroy();for(let s of i)s.config.side=="after"?this.getDOMAfter().appendChild(s.dom):this.dom.appendChild(s.dom);this.gutters=i}return r}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:t=>Ce.scrollMargins.of(e=>{let n=e.plugin(t);if(!n||n.gutters.length==0||!n.fixed)return null;let r=n.dom.offsetWidth*e.scaleX,i=n.domAfter?n.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==Zt.LTR?{left:r,right:i}:{right:r,left:i}})});function z_(t){return Array.isArray(t)?t:[t]}function hb(t,e,n){for(;t.value&&t.from<=n;)t.from==n&&e.push(t.value),t.next()}class f7{constructor(e,n,r){this.gutter=e,this.height=r,this.i=0,this.cursor=Ye.iter(e.markers,n.from)}addElement(e,n,r){let{gutter:i}=this,s=(n.top-this.height)/e.scaleY,o=n.height/e.scaleY;if(this.i==i.elements.length){let a=new dL(e,o,s,r);i.elements.push(a),i.dom.appendChild(a.dom)}else i.elements[this.i].update(e,o,s,r);this.height=n.bottom,this.i++}line(e,n,r){let i=[];hb(this.cursor,i,n.from),r.length&&(i=i.concat(r));let s=this.gutter.config.lineMarker(e,n,i);s&&i.unshift(s);let o=this.gutter;i.length==0&&!o.config.renderEmptyElements||this.addElement(e,n,i)}widget(e,n){let r=this.gutter.config.widgetMarker(e,n.widget,n),i=r?[r]:null;for(let s of e.state.facet(h7)){let o=s(e,n.widget,n);o&&(i||(i=[])).push(o)}i&&this.addElement(e,n,i)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let n=e.elements.pop();e.dom.removeChild(n.dom),n.destroy()}}}class V_{constructor(e,n){this.view=e,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let r in n.domEventHandlers)this.dom.addEventListener(r,i=>{let s=i.target,o;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let l=s.getBoundingClientRect();o=(l.top+l.bottom)/2}else o=i.clientY;let a=e.lineBlockAtHeight(o-e.documentTop);n.domEventHandlers[r](e,a,i)&&i.preventDefault()});this.markers=z_(n.markers(e)),n.initialSpacer&&(this.spacer=new dL(e,0,0,[n.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let n=this.markers;if(this.markers=z_(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let i=this.config.updateSpacer(this.spacer.markers[0],e);i!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[i])}let r=e.view.viewport;return!Ye.eq(this.markers,n,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class dL{constructor(e,n,r,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,n,r,i)}update(e,n,r,i){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),m7(this.markers,i)||this.setMarkers(e,i)}setMarkers(e,n){let r="cm-gutterElement",i=this.dom.firstChild;for(let s=0,o=0;;){let a=o,l=ss(a,l,c)||o(a,l,c):o}return r}})}});class Xg extends Vo{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function qg(t,e){return t.state.facet(wa).formatNumber(e,t.state)}const y7=Rd.compute([wa],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(g7)},lineMarker(e,n,r){return r.some(i=>i.toDOM)?null:new Xg(qg(e,e.state.doc.lineAt(n.from).number))},widgetMarker:(e,n,r)=>{for(let i of e.state.facet(O7)){let s=i(e,n,r);if(s)return s}return null},lineMarkerChange:e=>e.startState.facet(wa)!=e.state.facet(wa),initialSpacer(e){return new Xg(qg(e,U_(e.state.doc.lines)))},updateSpacer(e,n){let r=qg(n.view,U_(n.view.state.doc.lines));return r==e.number?e:new Xg(r)},domEventHandlers:t.facet(wa).domEventHandlers,side:"before"}));function b7(t={}){return[wa.of(t),d7(),y7]}function U_(t){let e=9;for(;ee.concat(t):void 0})}const Bv=new Qe;class Sr{constructor(e,n,r=[],i=""){this.data=e,this.name=i,Ze.prototype.hasOwnProperty("tree")||Object.defineProperty(Ze.prototype,"tree",{get(){return Nr(this)}}),this.parser=n,this.extension=[sl.of(this),Ze.languageData.of((s,o,a)=>{let l=H_(s,o,a),c=l.type.prop(ka);if(!c)return[];let u=s.facet(c),h=l.type.prop(Bv);if(h){let d=l.resolve(o-l.from,a);for(let p of h)if(p.test(d,s)){let f=s.facet(p.facet);return p.type=="replace"?f:f.concat(u)}}return u})].concat(r)}isActiveAt(e,n,r=-1){return H_(e,n,r).type.prop(ka)==this.data}findRegions(e){let n=e.facet(sl);if((n==null?void 0:n.data)==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let r=[],i=(s,o)=>{if(s.prop(ka)==this.data){r.push({from:o,to:o+s.length});return}let a=s.prop(Qe.mounted);if(a){if(a.tree.prop(ka)==this.data){if(a.overlay)for(let l of a.overlay)r.push({from:l.from+o,to:l.to+o});else r.push({from:o,to:o+s.length});return}else if(a.overlay){let l=r.length;if(i(a.tree,a.overlay[0].from+o),r.length>l)return}}for(let l=0;lr.isTop?n:void 0)]}),e.name)}configure(e,n){return new rl(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Nr(t){let e=t.field(Sr.state,!1);return e?e.tree:ft.empty}class E7{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,n){let r=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-r,n-r)}}let Ql=null;class _p{constructor(e,n,r=[],i,s,o,a,l){this.parser=e,this.state=n,this.fragments=r,this.tree=i,this.treeLen=s,this.viewport=o,this.skipped=a,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(e,n,r){return new _p(e,n,[],ft.empty,0,r,[],null)}startParse(){return this.parser.startParse(new E7(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=ft.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let i=Date.now()+e;e=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=e,this.tree=n,this.fragments=this.withoutTempSkipped(Ui.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=Ql;Ql=this;try{return e()}finally{Ql=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=X_(e,n.from,n.to);return e}changes(e,n){let{fragments:r,tree:i,treeLen:s,viewport:o,skipped:a}=this;if(this.takeTree(),!e.empty){let l=[];if(e.iterChangedRanges((c,u,h,d)=>l.push({fromA:c,toA:u,fromB:h,toB:d})),r=Ui.applyChanges(r,l),i=ft.empty,s=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){a=[];for(let c of this.skipped){let u=e.mapPos(c.from,1),h=e.mapPos(c.to,-1);ue.from&&(this.fragments=X_(this.fragments,i,s),this.skipped.splice(r--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,n){this.skipped.push({from:e,to:n})}static getSkippingParser(e){return new class extends AM{createParse(n,r,i){let s=i[0].from,o=i[i.length-1].to;return{parsedPos:s,advance(){let a=Ql;if(a){for(let l of i)a.tempSkipped.push(l);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=o,new ft(Dn.none,[],[],o-s)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let n=this.fragments;return this.treeLen>=e&&n.length&&n[0].from==0&&n[0].to>=e}static get(){return Ql}}function X_(t,e,n){return Ui.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class il{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new il(n)}static init(e){let n=Math.min(3e3,e.doc.length),r=_p.create(e.facet(sl).parser,e,{from:0,to:n});return r.work(20,n)||r.takeTree(),new il(r)}}Sr.state=to.define({create:il.init,update(t,e){for(let n of e.effects)if(n.is(Sr.setState))return n.value;return e.startState.facet(sl)!=e.state.facet(sl)?il.init(e.state):t.apply(e)}});let fL=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(fL=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const Wg=typeof navigator<"u"&&!((Zg=navigator.scheduling)===null||Zg===void 0)&&Zg.isInputPending?()=>navigator.scheduling.isInputPending():null,v7=Ws.fromClass(class{constructor(t){this.view=t,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(t){let e=this.view.state.field(Sr.state).context;(e.updateViewport(t.view.viewport)||this.view.viewport.to>e.treeLen)&&this.scheduleWork(),(t.docChanged||t.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(e)}scheduleWork(){if(this.working)return;let{state:t}=this.view,e=t.field(Sr.state);(e.tree!=e.context.tree||!e.context.isDone(t.doc.length))&&(this.working=fL(this.work))}work(t){this.working=null;let e=Date.now();if(this.chunkEndr+1e3,a=i.context.work(()=>Wg&&Wg()||Date.now()>s,r+(o?0:1e5));this.chunkBudget-=Date.now()-e,(a||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:Sr.setState.of(new il(i.context))})),this.chunkBudget>0&&!(a&&!o)&&this.scheduleWork(),this.checkAsyncSchedule(i.context)}checkAsyncSchedule(t){t.scheduleOn&&(this.workScheduled++,t.scheduleOn.then(()=>this.scheduleWork()).catch(e=>ri(this.view.state,e)).then(()=>this.workScheduled--),t.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),sl=Ee.define({combine(t){return t.length?t[0]:null},enables:t=>[Sr.state,v7,Ce.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]});class jv{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}}const T7=Ee.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(n=>n!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}}),zv=new Qe;function S7(t){let e=t.node,n=e.childAfter(e.from),r=e.lastChild;if(!n)return null;let i=t.options.simulateBreak,s=t.state.doc.lineAt(n.from),o=i==null||i<=s.from?s.to:Math.min(s.to,i);for(let a=n.to;;){let l=e.childAfter(a);if(!l||l==r)return null;if(!l.type.isSkipped){if(l.from>=o)return null;let c=/^ */.exec(s.text.slice(n.to-s.from))[0].length;return{from:n.from,to:n.to+c}}a=l.to}}function w7({closing:t,align:e=!0,units:n=1}){return r=>k7(r,e,n,t)}function k7(t,e,n,r,i){let s=t.textAfter,o=s.match(/^\s*/)[0].length,a=r&&s.slice(o,o+r.length)==r||i==t.pos+o,l=e?S7(t):null;return l?a?t.column(l.from):t.column(l.to):t.baseIndent+(a?0:t.unit*n)}const _7=t=>t.baseIndent;function Md({except:t,units:e=1}={}){return n=>{let r=t&&t.test(n.textAfter);return n.baseIndent+(r?0:e*n.unit)}}const Vv=new Qe;function mL(t){let e=t.firstChild,n=t.lastChild;return e&&e.toa.prop(ka)==o.data:o?a=>a==o:void 0,this.style=MM(e.map(a=>({tag:a.tag,class:a.class||i(Object.assign({},a,{tag:null}))})),{all:s}).style,this.module=r?new qs(r):null,this.themeType=n.themeType}static define(e,n){return new hm(e,n||{})}}const db=Ee.define(),x7=Ee.define({combine(t){return t.length?[t[0]]:null}});function Gg(t){let e=t.facet(db);return e.length?e:t.facet(x7)}function C7(t,e){let n=[A7],r;return t instanceof hm&&(t.module&&n.push(Ce.styleModule.of(t.module)),r=t.themeType),r?n.push(db.computeN([Ce.darkTheme],i=>i.facet(Ce.darkTheme)==(r=="dark")?[t]:[])):n.push(db.of(t)),n}class D7{constructor(e){this.markCache=Object.create(null),this.tree=Nr(e.state),this.decorations=this.buildDeco(e,Gg(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=Nr(e.state),r=Gg(e.state),i=r!=Gg(e.startState),{viewport:s}=e.view,o=e.changes.mapPos(this.decoratedTo,1);n.length=s.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(n!=this.tree||e.viewportChanged||i)&&(this.tree=n,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=s.to)}buildDeco(e,n){if(!n||!this.tree.length)return Ft.none;let r=new du;for(let{from:i,to:s}of e.visibleRanges)XZ(this.tree,n,(o,a,l)=>{r.add(o,a,this.markCache[l]||(this.markCache[l]=Ft.mark({class:l})))},i,s);return r.finish()}}const A7=sm.high(Ws.fromClass(D7,{decorations:t=>t.decorations})),P7=new Qe,N7=Object.create(null),q_=[Dn.none],Z_=[],W_=Object.create(null),R7=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])R7[t]=M7(N7,e);function Yg(t,e){Z_.indexOf(t)>-1||(Z_.push(t),console.warn(e))}function M7(t,e){let n=[];for(let a of e.split(" ")){let l=[];for(let c of a.split(".")){let u=t[c]||R[c];u?typeof u=="function"?l.length?l=l.map(u):Yg(c,`Modifier ${c} used at start of tag`):l.length?Yg(c,`Tag ${c} used as modifier`):l=Array.isArray(u)?u:[u]:Yg(c,`Unknown highlighting tag ${c}`)}for(let c of l)n.push(c)}if(!n.length)return 0;let r=e.replace(/ /g,"_"),i=r+" "+n.map(a=>a.id),s=W_[i];if(s)return s.id;let o=W_[i]=Dn.define({id:q_.length,name:r,props:[im({[r]:n})]});return q_.push(o),o.id}Zt.RTL,Zt.LTR;let Kg=null;function Jg(){if(!Kg&&typeof document=="object"&&document.body){let{style:t}=document.body,e=[],n=new Set;for(let r in t)r!="cssText"&&r!="cssFloat"&&typeof t[r]=="string"&&(/[A-Z]/.test(r)&&(r=r.replace(/[A-Z]/g,i=>"-"+i.toLowerCase())),n.has(r)||(e.push(r),n.add(r)));Kg=e.sort().map(r=>({type:"property",label:r,apply:r+": "}))}return Kg||[]}const G_=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(t=>({type:"class",label:t})),Y_=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(t=>({type:"keyword",label:t})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(t=>({type:"constant",label:t}))),I7=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(t=>({type:"type",label:t})),L7=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(t=>({type:"keyword",label:t})),Si=/^(\w[\w-]*|-\w[\w-]*|)$/,Q7=/^-(-[\w-]*)?$/;function $7(t,e){var n;if((t.name=="("||t.type.isError)&&(t=t.parent||t),t.name!="ArgList")return!1;let r=(n=t.parent)===null||n===void 0?void 0:n.firstChild;return(r==null?void 0:r.name)!="Callee"?!1:e.sliceString(r.from,r.to)=="var"}const K_=new DM,F7=["Declaration"];function B7(t){for(let e=t;;){if(e.type.isTop)return e;if(!(e=e.parent))return t}}function gL(t,e,n){if(e.to-e.from>4096){let r=K_.get(e);if(r)return r;let i=[],s=new Set,o=e.cursor(ct.IncludeAnonymous);if(o.firstChild())do for(let a of gL(t,o.node,n))s.has(a.label)||(s.add(a.label),i.push(a));while(o.nextSibling());return K_.set(e,i),i}else{let r=[],i=new Set;return e.cursor().iterate(s=>{var o;if(n(s)&&s.matchContext(F7)&&((o=s.node.nextSibling)===null||o===void 0?void 0:o.name)==":"){let a=t.sliceString(s.from,s.to);i.has(a)||(i.add(a),r.push({label:a,type:"variable"}))}}),r}}const j7=t=>e=>{let{state:n,pos:r}=e,i=Nr(n).resolveInner(r,-1),s=i.type.isError&&i.from==i.to-1&&n.doc.sliceString(i.from,i.to)=="-";if(i.name=="PropertyName"||(s||i.name=="TagName")&&/^(Block|Styles)$/.test(i.resolve(i.to).name))return{from:i.from,options:Jg(),validFor:Si};if(i.name=="ValueName")return{from:i.from,options:Y_,validFor:Si};if(i.name=="PseudoClassName")return{from:i.from,options:G_,validFor:Si};if(t(i)||(e.explicit||s)&&$7(i,n.doc))return{from:t(i)||s?i.from:r,options:gL(n.doc,B7(i),t),validFor:Q7};if(i.name=="TagName"){for(let{parent:l}=i;l;l=l.parent)if(l.name=="Block")return{from:i.from,options:Jg(),validFor:Si};return{from:i.from,options:I7,validFor:Si}}if(i.name=="AtKeyword")return{from:i.from,options:L7,validFor:Si};if(!e.explicit)return null;let o=i.resolve(r),a=o.childBefore(r);return a&&a.name==":"&&o.name=="PseudoClassSelector"?{from:r,options:G_,validFor:Si}:a&&a.name==":"&&o.name=="Declaration"||o.name=="ArgList"?{from:r,options:Y_,validFor:Si}:o.name=="Block"||o.name=="Styles"?{from:r,options:Jg(),validFor:Si}:null},z7=j7(t=>t.name=="VariableName"),xp=rl.define({name:"css",parser:s6.configure({props:[zv.add({Declaration:Md()}),Vv.add({"Block KeyframeList":mL})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function V7(){return new jv(xp,xp.data.of({autocomplete:z7}))}const U7=316,H7=317,J_=1,X7=2,q7=3,Z7=4,W7=318,G7=320,Y7=321,K7=5,J7=6,eY=0,pb=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],OL=125,tY=59,fb=47,nY=42,rY=43,iY=45,sY=60,oY=44,aY=63,lY=46,cY=91,uY=new NM({start:!1,shift(t,e){return e==K7||e==J7||e==G7?t:e==Y7},strict:!1}),hY=new Kn((t,e)=>{let{next:n}=t;(n==OL||n==-1||e.context)&&t.acceptToken(W7)},{contextual:!0,fallback:!0}),dY=new Kn((t,e)=>{let{next:n}=t,r;pb.indexOf(n)>-1||n==fb&&((r=t.peek(1))==fb||r==nY)||n!=OL&&n!=tY&&n!=-1&&!e.context&&t.acceptToken(U7)},{contextual:!0}),pY=new Kn((t,e)=>{t.next==cY&&!e.context&&t.acceptToken(H7)},{contextual:!0}),fY=new Kn((t,e)=>{let{next:n}=t;if(n==rY||n==iY){if(t.advance(),n==t.next){t.advance();let r=!e.context&&e.canShift(J_);t.acceptToken(r?J_:X7)}}else n==aY&&t.peek(1)==lY&&(t.advance(),t.advance(),(t.next<48||t.next>57)&&t.acceptToken(q7))},{contextual:!0});function eO(t,e){return t>=65&&t<=90||t>=97&&t<=122||t==95||t>=192||!e&&t>=48&&t<=57}const mY=new Kn((t,e)=>{if(t.next!=sY||!e.dialectEnabled(eY)||(t.advance(),t.next==fb))return;let n=0;for(;pb.indexOf(t.next)>-1;)t.advance(),n++;if(eO(t.next,!0)){for(t.advance(),n++;eO(t.next,!1);)t.advance(),n++;for(;pb.indexOf(t.next)>-1;)t.advance(),n++;if(t.next==oY)return;for(let r=0;;r++){if(r==7){if(!eO(t.next,!0))return;break}if(t.next!="extends".charCodeAt(r))break;t.advance(),n++}}t.acceptToken(Z7,-n)}),gY=im({"get set async static":R.modifier,"for while do if else switch try catch finally return throw break continue default case defer":R.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":R.operatorKeyword,"let var const using function class extends":R.definitionKeyword,"import export from":R.moduleKeyword,"with debugger new":R.keyword,TemplateString:R.special(R.string),super:R.atom,BooleanLiteral:R.bool,this:R.self,null:R.null,Star:R.modifier,VariableName:R.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":R.function(R.variableName),VariableDefinition:R.definition(R.variableName),Label:R.labelName,PropertyName:R.propertyName,PrivatePropertyName:R.special(R.propertyName),"CallExpression/MemberExpression/PropertyName":R.function(R.propertyName),"FunctionDeclaration/VariableDefinition":R.function(R.definition(R.variableName)),"ClassDeclaration/VariableDefinition":R.definition(R.className),"NewExpression/VariableName":R.className,PropertyDefinition:R.definition(R.propertyName),PrivatePropertyDefinition:R.definition(R.special(R.propertyName)),UpdateOp:R.updateOperator,"LineComment Hashbang":R.lineComment,BlockComment:R.blockComment,Number:R.number,String:R.string,Escape:R.escape,ArithOp:R.arithmeticOperator,LogicOp:R.logicOperator,BitOp:R.bitwiseOperator,CompareOp:R.compareOperator,RegExp:R.regexp,Equals:R.definitionOperator,Arrow:R.function(R.punctuation),": Spread":R.punctuation,"( )":R.paren,"[ ]":R.squareBracket,"{ }":R.brace,"InterpolationStart InterpolationEnd":R.special(R.brace),".":R.derefOperator,", ;":R.separator,"@":R.meta,TypeName:R.typeName,TypeDefinition:R.definition(R.typeName),"type enum interface implements namespace module declare":R.definitionKeyword,"abstract global Privacy readonly override":R.modifier,"is keyof unique infer asserts":R.operatorKeyword,JSXAttributeValue:R.attributeValue,JSXText:R.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":R.angleBracket,"JSXIdentifier JSXNameSpacedName":R.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":R.attributeName,"JSXBuiltin/JSXIdentifier":R.standard(R.tagName)}),OY={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},yY={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},bY={__proto__:null,"<":193},EY=Ka.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JrO6[Q!0MxO'#JsO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO9XQMhO'#F|O9`Q`O'#F{OOQ!0Lf'#Js'#JsOOQ!0Lb'#Jr'#JrO9eQ`O'#GwOOQ['#K_'#K_O9pQ`O'#IYO9uQ!0LrO'#IZOOQ['#J`'#J`OOQ['#I_'#I_Q`QlOOQ`QlOOO9}Q!L^O'#DvO:UQlO'#EOO:]QlO'#EQO9kQ`O'#GsO:dQMhO'#CoO:rQ`O'#EnO:}Q`O'#EyO;hQMhO'#FeO;xQ`O'#GsOOQO'#K`'#K`O;}Q`O'#K`O<]Q`O'#G{O<]Q`O'#G|O<]Q`O'#HOO9kQ`O'#HRO=SQ`O'#HUO>kQ`O'#CeO>{Q`O'#HcO?TQ`O'#HiO?TQ`O'#HkO`QlO'#HmO?TQ`O'#HoO?TQ`O'#HrO?YQ`O'#HxO?_Q!0LsO'#IOO%[QlO'#IQO?jQ!0LsO'#ISO?uQ!0LsO'#IUO9uQ!0LrO'#IWO@QQ!0MxO'#CiOASQpO'#DlQOQ`OOO%[QlO'#EQOAjQ`O'#ETO:dQMhO'#EnOAuQ`O'#EnOBQQ!bO'#FeOOQ['#Cg'#CgOOQ!0Lb'#Dq'#DqOOQ!0Lb'#Jv'#JvO%[QlO'#JvOOQO'#Jy'#JyOOQO'#Ih'#IhOCQQpO'#EgOOQ!0Lb'#Ef'#EfOOQ!0Lb'#J}'#J}OC|Q!0MSO'#EgODWQpO'#EWOOQO'#Jx'#JxODlQpO'#JyOEyQpO'#EWODWQpO'#EgPFWO&2DjO'#CbPOOO)CD})CD}OOOO'#I`'#I`OFcO#tO,59UOOQ!0Lh,59U,59UOOOO'#Ia'#IaOFqO&jO,59UOGPQ!L^O'#DcOOOO'#Ic'#IcOGWO#@ItO,59{OOQ!0Lf,59{,59{OGfQlO'#IdOGyQ`O'#JtOIxQ!fO'#JtO+}QlO'#JtOJPQ`O,5:ROJgQ`O'#EpOJtQ`O'#KTOKPQ`O'#KSOKPQ`O'#KSOKXQ`O,5;^OK^Q`O'#KROOQ!0Ln,5:^,5:^OKeQlO,5:^OMcQ!0MxO,5:fONSQ`O,5:nONmQ!0LrO'#KQONtQ`O'#KPO9eQ`O'#KPO! YQ`O'#KPO! bQ`O,5;]O! gQ`O'#KPO!#lQ!fO'#JsOOQ!0Lh'#Ci'#CiO%[QlO'#ESO!$[Q!fO,5:sOOQS'#Jz'#JzOOQO-EtOOQ['#Jh'#JhOOQ[,5>u,5>uOOQ[-E<]-E<]O!TO`QlO,5>VO!LOQ`O,5>XO`QlO,5>ZO!LTQ`O,5>^O!LYQlO,5>dOOQ[,5>j,5>jO%[QlO,5>jO9uQ!0LrO,5>lOOQ[,5>n,5>nO#!dQ`O,5>nOOQ[,5>p,5>pO#!dQ`O,5>pOOQ[,5>r,5>rO##QQpO'#D_O%[QlO'#JvO##sQpO'#JvO##}QpO'#DmO#$`QpO'#DmO#&qQlO'#DmO#&xQ`O'#JuO#'QQ`O,5:WO#'VQ`O'#EtO#'eQ`O'#KUO#'mQ`O,5;_O#'rQpO'#DmO#(PQpO'#EVOOQ!0Lf,5:o,5:oO%[QlO,5:oO#(WQ`O,5:oO?YQ`O,5;YO!CUQpO,5;YO!C^QMhO,5;YO:dQMhO,5;YO#(`Q`O,5@bO#(eQ07dO,5:sOOQO-EPO$6^Q`O,5>POOQ[1G3i1G3iO`QlO1G3iOOQ[1G3o1G3oOOQ[1G3q1G3qO?TQ`O1G3sO$6cQlO1G3uO$:gQlO'#HtOOQ[1G3x1G3xO$:tQ`O'#HzO?YQ`O'#H|OOQ[1G4O1G4OO$:|QlO1G4OO9uQ!0LrO1G4UOOQ[1G4W1G4WOOQ!0Lb'#G_'#G_O9uQ!0LrO1G4YO9uQ!0LrO1G4[O$?TQ`O,5@bO!)[QlO,5;`O9eQ`O,5;`O?YQ`O,5:XO!)[QlO,5:XO!CUQpO,5:XO$?YQ?MtO,5:XOOQO,5;`,5;`O$?dQpO'#IeO$?zQ`O,5@aOOQ!0Lf1G/r1G/rO$@SQpO'#IkO$@^Q`O,5@pOOQ!0Lb1G0y1G0yO#$`QpO,5:XOOQO'#Ig'#IgO$@fQpO,5:qOOQ!0Ln,5:q,5:qO#(ZQ`O1G0ZOOQ!0Lf1G0Z1G0ZO%[QlO1G0ZOOQ!0Lf1G0t1G0tO?YQ`O1G0tO!CUQpO1G0tO!C^QMhO1G0tOOQ!0Lb1G5|1G5|O!ByQ!0LrO1G0^OOQO1G0m1G0mO%[QlO1G0mO$@mQ!0LrO1G0mO$@xQ!0LrO1G0mO!CUQpO1G0^ODWQpO1G0^O$AWQ!0LrO1G0mOOQO1G0^1G0^O$AlQ!0MxO1G0mPOOO-E<[-E<[POOO1G.h1G.hOOOO1G/i1G/iO$AvQ!bO,5QQpO,5@}OOQ!0Lb1G3c1G3cOOQ[7+$V7+$VO@zQ`O7+$VO9uQ!0LrO7+$VO%>]Q`O7+$VO%[QlO1G6lO%[QlO1G6mO%>bQ!0LrO1G6lO%>lQlO1G3kO%>sQ`O1G3kO%>xQlO1G3kOOQ[7+)T7+)TO9uQ!0LrO7+)_O`QlO7+)aOOQ['#Kh'#KhOOQ['#JS'#JSO%?PQlO,5>`OOQ[,5>`,5>`O%[QlO'#HuO%?^Q`O'#HwOOQ[,5>f,5>fO9eQ`O,5>fOOQ[,5>h,5>hOOQ[7+)j7+)jOOQ[7+)p7+)pOOQ[7+)t7+)tOOQ[7+)v7+)vO%?cQpO1G5|O%?}Q?MtO1G0zO%@XQ`O1G0zOOQO1G/s1G/sO%@dQ?MtO1G/sO?YQ`O1G/sO!)[QlO'#DmOOQO,5?P,5?POOQO-ERQ`O7+,WO&>WQ`O7+,XO%[QlO7+,WO%[QlO7+,XOOQ[7+)V7+)VO&>]Q`O7+)VO&>bQlO7+)VO&>iQ`O7+)VOOQ[<nQ`O,5>aOOQ[,5>c,5>cO&>sQ`O1G4QO9eQ`O7+&fO!)[QlO7+&fOOQO7+%_7+%_O&>xQ?MtO1G6ZO?YQ`O7+%_OOQ!0Lf<yQ?MvO,5?aO'@|Q?MvO,5?cO'CPQ?MvO7+'|O'DuQMjOG27TOOQO<VO!l$xO#jROe!iOpkOrPO(T)]O(VTO(YUO(aVO(o[O~O!]$_Oa$qa'z$qa'w$qa!k$qa!Y$qa!_$qa%i$qa!g$qa~Ol)dO~P!&zOh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O%]O!S${O!_$|O!i%bO!l$xO#j%cO$W%`O$t%^O$v%_O$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~Og(pP~P!,TO!Q)iO!g)hO!_$^X$Z$^X$]$^X$_$^X$f$^X~O!g)hO!_({X$Z({X$]({X$_({X$f({X~O!Q)iO~P!.^O!Q)iO!_({X$Z({X$]({X$_({X$f({X~O!_)kO$Z)oO$])jO$_)jO$f)pO~O![)sO~P!)[O$]$hO$_$gO$f)wO~On$zX!Q$zX#S$zX'y$zX(y$zX(z$zX~OgmXg$zXnmX!]mX#`mX~P!0SOx)yO(b)zO(c)|O~On*VO!Q*OO'y*PO(y$}O(z%PO~Og)}O~P!1WOg*WO~Oh%VOr%XOs$tOt$tOz%YO|%ZO!OVO!l$xO#jVO!l$xO#jROe!iOpkOrPO(VTO(YUO(aVO(o[O~O(T=QO~P#$qO!]-]O!^(iX~O!^-_O~O!g-VO#`-UO!]#hX!^#hX~O!]-`O!^(xX~O!^-bO~O!c-cO!d-cO(U!lO~P#$`O!^-fO~P'_On-iO!_'`O~O!Y-nO~Os!{a!b!{a!c!{a!d!{a#T!{a#U!{a#V!{a#W!{a#X!{a#[!{a#]!{a(U!{a(V!{a(Y!{a(e!{a(o!{a~P!#vO!p-sO#`-qO~PChO!c-uO!d-uO(U!lO~PDWOa%nO#`-qO'z%nO~Oa%nO!g#vO#`-qO'z%nO~Oa%nO!g#vO!p-sO#`-qO'z%nO(r'pO~O(P'xO(Q'xO(R-zO~Ov-{O~O!Y'Wa!]'Wa~P!:tO![.PO!Y'WX!]'WX~P%[O!](VO!Y(ha~O!Y(ha~PHRO!](^O!Y(va~O!S%hO![.TO!_%iO(T%gO!Y'^X!]'^X~O#`.VO!](ta!k(taa(ta'z(ta~O!g#vO~P#,wO!](jO!k(sa~O!S%hO!_%iO#j.ZO(T%gO~Op.`O!S%hO![.]O!_%iO!|]O#i._O#j.]O(T%gO!]'aX!k'aX~OR.dO!l#xO~Oh%VOn.gO!_'`O%i.fO~Oa#ci!]#ci'z#ci'w#ci!Y#ci!k#civ#ci!_#ci%i#ci!g#ci~P!:tOn>]O!Q*OO'y*PO(y$}O(z%PO~O#k#_aa#_a#`#_a'z#_a!]#_a!k#_a!_#_a!Y#_a~P#/sO#k(`XP(`XR(`X[(`Xa(`Xj(`Xr(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X'z(`X(a(`X(r(`X!k(`X!Y(`X'w(`Xv(`X!_(`X%i(`X!g(`X~P!6kO!].tO!k(kX~P!:tO!k.wO~O!Y.yO~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O(aVO[#mia#mij#mir#mi!]#mi#R#mi#o#mi#p#mi#q#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#n#mi~P#3cO#n$OO~P#3cOP$[OR#zOr$aO!Q#yO!S#{O!l#xO!p$[O#n$OO#o$PO#p$PO#q$PO(aVO[#mia#mij#mi!]#mi#R#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#r#mi~P#6QO#r$QO~P#6QOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO(aVOa#mi!]#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#v#mi~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO(aVO(z#}Oa#mi!]#mi#z#mi#{#mi'z#mi(r#mi(y#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#x$UO~P#;VO#x#mi~P#;VO#v$SO~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO(aVO(y#|O(z#}Oa#mi!]#mi#{#mi'z#mi(r#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#z#mi~P#={O#z$WO~P#={OP]XR]X[]Xj]Xr]X!Q]X!S]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X!]]X!^]X~O$O]X~P#@jOP$[OR#zO[]O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P#EyO!]/POg(pX~P!1WOg/RO~Oa$Pi!]$Pi'z$Pi'w$Pi!Y$Pi!k$Piv$Pi!_$Pi%i$Pi!g$Pi~P!:tO$]/SO$_/SO~O$]/TO$_/TO~O!g)hO#`/UO!_$cX$Z$cX$]$cX$_$cX$f$cX~O![/VO~O!_)kO$Z/XO$])jO$_)jO$f/YO~O!]VO!l$xO#j^O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P&,QO#S$dOP(`XR(`X[(`Xj(`Xn(`Xr(`X!Q(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X$O(`X'y(`X(a(`X(r(`X(y(`X(z(`X!](`X!^(`X~O$O$Pi!]$Pi!^$Pi~P#BwO$O!ri!^!ri~P$+oOg']a!]']a~P!1WO!^7nO~O!]'da!^'da~P#BwO!Y7oO~P#/sO!g#vO(r'pO!]'ea!k'ea~O!]/pO!k)Oi~O!]/pO!g#vO!k)Oi~Og$|q!]$|q#`$|q$O$|q~P!1WO!Y'ga!]'ga~P#/sO!g7vO~O!]/yO!Y)Pi~P#/sO!]/yO!Y)Pi~O!Y7yO~Oh%VOr8OO!l%eO(r'pO~Oj8QO!g#vO~Or8TO!g#vO(r'pO~O!Q*OO'y*PO(z%POn'ja(y'ja!]'ja#`'ja~Og'ja$O'ja~P&5RO!Q*OO'y*POn'la(y'la(z'la!]'la#`'la~Og'la$O'la~P&5tOg(_q!](_q~P!1WO#`8VOg(_q!](_q~P!1WO!Y8WO~Og%Oq!]%Oq#`%Oq$O%Oq~P!1WOa$oy!]$oy'z$oy'w$oy!Y$oy!k$oyv$oy!_$oy%i$oy!g$oy~P!:tO!g6rO~O!]5[O!_)Qa~O!_'`OP$TaR$Ta[$Taj$Tar$Ta!Q$Ta!S$Ta!]$Ta!l$Ta!p$Ta#R$Ta#n$Ta#o$Ta#p$Ta#q$Ta#r$Ta#s$Ta#t$Ta#u$Ta#v$Ta#x$Ta#z$Ta#{$Ta(a$Ta(r$Ta(y$Ta(z$Ta~O%i7WO~P&8fO%^8[Oa%[i!_%[i'z%[i!]%[i~Oa#cy!]#cy'z#cy'w#cy!Y#cy!k#cyv#cy!_#cy%i#cy!g#cy~P!:tO[8^O~Ob8`O(T+qO(VTO(YUO~O!]1TO!^)Xi~O`8dO~O(e(|O!]'pX!^'pX~O!]5uO!^)Ua~O!^8nO~P%;eO(o!sO~P$&YO#[8oO~O!_1oO~O!_1oO%i8qO~On8tO!_1oO%i8qO~O[8yO!]'sa!^'sa~O!]1zO!^)Vi~O!k8}O~O!k9OO~O!k9RO~O!k9RO~P%[Oa9TO~O!g9UO~O!k9VO~O!](wi!^(wi~P#BwOa%nO#`9_O'z%nO~O!](ty!k(tya(ty'z(ty~P!:tO!](jO!k(sy~O%i9bO~P&8fO!_'`O%i9bO~O#k$|qP$|qR$|q[$|qa$|qj$|qr$|q!S$|q!]$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q'z$|q(a$|q(r$|q!k$|q!Y$|q'w$|q#`$|qv$|q!_$|q%i$|q!g$|q~P#/sO#k'jaP'jaR'ja['jaa'jaj'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja'z'ja(a'ja(r'ja!k'ja!Y'ja'w'jav'ja!_'ja%i'ja!g'ja~P&5RO#k'laP'laR'la['laa'laj'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la'z'la(a'la(r'la!k'la!Y'la'w'lav'la!_'la%i'la!g'la~P&5tO#k%OqP%OqR%Oq[%Oqa%Oqj%Oqr%Oq!S%Oq!]%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq'z%Oq(a%Oq(r%Oq!k%Oq!Y%Oq'w%Oq#`%Oqv%Oq!_%Oq%i%Oq!g%Oq~P#/sO!]'Yi!k'Yi~P!:tO$O#cq!]#cq!^#cq~P#BwO(y$}OP%aaR%aa[%aaj%aar%aa!S%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa$O%aa(a%aa(r%aa!]%aa!^%aa~On%aa!Q%aa'y%aa(z%aa~P&IyO(z%POP%caR%ca[%caj%car%ca!S%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca$O%ca(a%ca(r%ca!]%ca!^%ca~On%ca!Q%ca'y%ca(y%ca~P&LQOn>^O!Q*OO'y*PO(z%PO~P&IyOn>^O!Q*OO'y*PO(y$}O~P&LQOR0kO!Q0kO!S0lO#S$dOP}a[}aj}an}ar}a!l}a!p}a#R}a#n}a#o}a#p}a#q}a#r}a#s}a#t}a#u}a#v}a#x}a#z}a#{}a$O}a'y}a(a}a(r}a(y}a(z}a!]}a!^}a~O!Q*OO'y*POP$saR$sa[$saj$san$sar$sa!S$sa!l$sa!p$sa#R$sa#n$sa#o$sa#p$sa#q$sa#r$sa#s$sa#t$sa#u$sa#v$sa#x$sa#z$sa#{$sa$O$sa(a$sa(r$sa(y$sa(z$sa!]$sa!^$sa~O!Q*OO'y*POP$uaR$ua[$uaj$uan$uar$ua!S$ua!l$ua!p$ua#R$ua#n$ua#o$ua#p$ua#q$ua#r$ua#s$ua#t$ua#u$ua#v$ua#x$ua#z$ua#{$ua$O$ua(a$ua(r$ua(y$ua(z$ua!]$ua!^$ua~On>^O!Q*OO'y*PO(y$}O(z%PO~OP%TaR%Ta[%Taj%Tar%Ta!S%Ta!l%Ta!p%Ta#R%Ta#n%Ta#o%Ta#p%Ta#q%Ta#r%Ta#s%Ta#t%Ta#u%Ta#v%Ta#x%Ta#z%Ta#{%Ta$O%Ta(a%Ta(r%Ta!]%Ta!^%Ta~P''VO$O$mq!]$mq!^$mq~P#BwO$O$oq!]$oq!^$oq~P#BwO!^9oO~O$O9pO~P!1WO!g#vO!]'ei!k'ei~O!g#vO(r'pO!]'ei!k'ei~O!]/pO!k)Oq~O!Y'gi!]'gi~P#/sO!]/yO!Y)Pq~Or9wO!g#vO(r'pO~O[9yO!Y9xO~P#/sO!Y9xO~Oj:PO!g#vO~Og(_y!](_y~P!1WO!]'na!_'na~P#/sOa%[q!_%[q'z%[q!]%[q~P#/sO[:UO~O!]1TO!^)Xq~O`:YO~O#`:ZO!]'pa!^'pa~O!]5uO!^)Ui~P#BwO!S:]O~O!_1oO%i:`O~O(VTO(YUO(e:eO~O!]1zO!^)Vq~O!k:hO~O!k:iO~O!k:jO~O!k:jO~P%[O#`:mO!]#hy!^#hy~O!]#hy!^#hy~P#BwO%i:rO~P&8fO!_'`O%i:rO~O$O#|y!]#|y!^#|y~P#BwOP$|iR$|i[$|ij$|ir$|i!S$|i!l$|i!p$|i#R$|i#n$|i#o$|i#p$|i#q$|i#r$|i#s$|i#t$|i#u$|i#v$|i#x$|i#z$|i#{$|i$O$|i(a$|i(r$|i!]$|i!^$|i~P''VO!Q*OO'y*PO(z%POP'iaR'ia['iaj'ian'iar'ia!S'ia!l'ia!p'ia#R'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#v'ia#x'ia#z'ia#{'ia$O'ia(a'ia(r'ia(y'ia!]'ia!^'ia~O!Q*OO'y*POP'kaR'ka['kaj'kan'kar'ka!S'ka!l'ka!p'ka#R'ka#n'ka#o'ka#p'ka#q'ka#r'ka#s'ka#t'ka#u'ka#v'ka#x'ka#z'ka#{'ka$O'ka(a'ka(r'ka(y'ka(z'ka!]'ka!^'ka~O(y$}OP%aiR%ai[%aij%ain%air%ai!Q%ai!S%ai!l%ai!p%ai#R%ai#n%ai#o%ai#p%ai#q%ai#r%ai#s%ai#t%ai#u%ai#v%ai#x%ai#z%ai#{%ai$O%ai'y%ai(a%ai(r%ai(z%ai!]%ai!^%ai~O(z%POP%ciR%ci[%cij%cin%cir%ci!Q%ci!S%ci!l%ci!p%ci#R%ci#n%ci#o%ci#p%ci#q%ci#r%ci#s%ci#t%ci#u%ci#v%ci#x%ci#z%ci#{%ci$O%ci'y%ci(a%ci(r%ci(y%ci!]%ci!^%ci~O$O$oy!]$oy!^$oy~P#BwO$O#cy!]#cy!^#cy~P#BwO!g#vO!]'eq!k'eq~O!]/pO!k)Oy~O!Y'gq!]'gq~P#/sOr:|O!g#vO(r'pO~O[;QO!Y;PO~P#/sO!Y;PO~Og(_!R!](_!R~P!1WOa%[y!_%[y'z%[y!]%[y~P#/sO!]1TO!^)Xy~O!]5uO!^)Uq~O(T;XO~O!_1oO%i;[O~O!k;_O~O%i;dO~P&8fOP$|qR$|q[$|qj$|qr$|q!S$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q$O$|q(a$|q(r$|q!]$|q!^$|q~P''VO!Q*OO'y*PO(z%POP'jaR'ja['jaj'jan'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja$O'ja(a'ja(r'ja(y'ja!]'ja!^'ja~O!Q*OO'y*POP'laR'la['laj'lan'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la$O'la(a'la(r'la(y'la(z'la!]'la!^'la~OP%OqR%Oq[%Oqj%Oqr%Oq!S%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq$O%Oq(a%Oq(r%Oq!]%Oq!^%Oq~P''VOg%e!Z!]%e!Z#`%e!Z$O%e!Z~P!1WO!Y;hO~P#/sOr;iO!g#vO(r'pO~O[;kO!Y;hO~P#/sO!]'pq!^'pq~P#BwO!]#h!Z!^#h!Z~P#BwO#k%e!ZP%e!ZR%e!Z[%e!Za%e!Zj%e!Zr%e!Z!S%e!Z!]%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z'z%e!Z(a%e!Z(r%e!Z!k%e!Z!Y%e!Z'w%e!Z#`%e!Zv%e!Z!_%e!Z%i%e!Z!g%e!Z~P#/sOr;tO!g#vO(r'pO~O!Y;uO~P#/sOr;|O!g#vO(r'pO~O!Y;}O~P#/sOP%e!ZR%e!Z[%e!Zj%e!Zr%e!Z!S%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z$O%e!Z(a%e!Z(r%e!Z!]%e!Z!^%e!Z~P''VOrROe!iOpkOrPO(T)]O(VTO(YUO(aVO(o[O~O!]WO!l$xO#jgPPP!>oI[PPPPPPPPP!BOP!C]PPI[!DnPI[PI[I[I[I[I[PI[!FQP!I[P!LbP!Lf!Lp!Lt!LtP!IXP!Lx!LxP#!OP#!SI[PI[#!Y#%_CjA^PA^PA^A^P#&lA^A^#)OA^#+vA^#.SA^A^#.r#1W#1W#1]#1f#1W#1qPP#1WPA^#2ZA^#6YA^A^6mPPP#:_PPP#:x#:xP#:xP#;`#:xPP#;fP#;]P#;]#;y#;]#P#>V#>]#>k#>q#>{#?R#?]#?c#?s#?y#@k#@}#AT#AZ#Ai#BO#Cs#DR#DY#Et#FS#Gt#HS#HY#H`#Hf#Hp#Hv#H|#IW#Ij#IpPPPPPPPPPPP#IvPPPPPPP#Jk#Mx$ b$ i$ qPPP$']P$'f$*_$0x$0{$1O$1}$2Q$2X$2aP$2g$2jP$3W$3[$4S$5b$5g$5}PP$6S$6Y$6^$6a$6e$6i$7e$7|$8e$8i$8l$8o$8y$8|$9Q$9UR!|RoqOXst!Z#d%m&r&t&u&w,s,x2[2_Y!vQ'`-e1o5{Q%tvQ%|yQ&T|Q&j!VS'W!e-]Q'f!iS'l!r!yU*k$|*Z*oQ+o%}S+|&V&WQ,d&dQ-c'_Q-m'gQ-u'mQ0[*qQ1b,OQ1y,eR<{SU+P%]S!S!nQ!r!v!y!z$|'W'_'`'l'm'n*k*o*q*r-]-c-e-u0[0_1o5{5}%[$ti#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;kP>X>Y>]>^Q&X|Q'U!eS'[%i-`Q+t&PQ,P&WQ,f&gQ0n+SQ1Y+uQ1_+{Q2Q,jQ2R,kQ5f1TQ5o1aQ6[1zQ6_1|Q6`2PQ8`5gQ8c5lQ8|6bQ:X8dQ:f8yQ;V:YR<}*ZrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R,h&k&z^OPXYstuvwz!Z!`!g!j!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'b'r(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mR>S[#]WZ#W#Z'X(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ%wxQ%{yW&Q|&V&W,OQ&_!TQ'c!hQ'e!iQ(q#sS+n%|%}Q+r&PQ,_&bQ,c&dS-l'f'gQ.i(rQ1R+oQ1X+uQ1Z+vQ1^+zQ1t,`S1x,d,eQ2|-mQ5e1TQ5i1WQ5n1`Q6Z1yQ8_5gQ8b5kQ8f5pQ:T8^R;T:U!U$zi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y!^%yy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{Q+h%wQ,T&[Q,W&]Q,b&dQ.h(qQ1s,_U1w,c,d,eQ3e.iQ6U1tS6Y1x1yQ8x6Z#f>T#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^o>UPS&[!Q&iQ&]!RQ&^!SU*}%[%d=sR,R&Y%]%Si#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;kP>X>Y>]>^T)z$u){V+P%]S$i$^c#Y#e%q%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.|.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`SQ'Y!eR2q-]!W!nQ!e!r!v!y!z$|'W'_'`'l'm'n*Z*k*o*q*r-]-c-e-u0[0_1o5{5}R1l,ZnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&y!^Q'v!xS(s#u<^Q+l%zQ,]&_Q,^&aQ-j'dQ-w'oS.r(x=PS0q+X=ZQ1P+mQ1n,[Q2c,zQ2e,{Q2m-WQ2z-kQ2}-oS5Y0r=eQ5a1QS5d1S=fQ6t2oQ6x2{Q6}3SQ8]5bQ9Y6vQ9Z6yQ9^7OR:l9V$d$]c#Y#e%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`SS#q]SU$fd)_,mS(p#p'iU*v%R(w4OU0m+O.n7gQ5^0xQ7V3`Q9d7YR:s9em!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}Q't!uS(f#g2US-s'k'wQ/s*]Q0R*jQ3U-vQ4f/tQ4r0TQ4s0UQ4x0^Q7r4`S7}4t4vS8R4y4{Q9r7sQ9v7yQ9{8OQ:Q8TS:{9w9xS;g:|;PS;s;h;iS;{;t;uSSR=o>R%^bOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Q%fj!^%xy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{S&Oz!jQ+k%yQ,a&dW1v,b,c,d,eU6X1w1x1yS8w6Y6ZQ:d8x!r=j$Z$n'X)s-U-X/V2p4T5w6s:Z:mSQ=t>QR=u>R%QeOPXYstuvw!Z!`!g!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Y#bWZ#W#Z(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ,n&o!p=k$Z$n)s-U-X/V2p4T5w6s:Z:mSR=n'XU']!e%i*ZR2s-`%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+],p,s,x-i-q.P.V.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3l4z6T6e6f6i6|8t9T9_!r)_$Z$n'X)s-U-X/V2p4T5w6s:Z:mSQ,m&oQ0x+gQ3`.gQ7Y3dR9e7[!b$Tc#Y%q(S(Y(t(y)Z)[)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:oS)^)q-Z.|2k2n3p4P4X6u7b7k7l8k9X9g9m9n;W;`=vQ>X>ZR>Y>['QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mSS$oh$pR4U/U'XgOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mST$kf$qQ$ifS)j$l)nR)v$qT$jf$qT)l$l)n'XhOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mST$oh$pQ$rhR)u$p%^jOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_!s>Q$Z$n'X)s-U-X/V2p4T5w6s:Z:mS#glOPXZst!Z!`!o#S#d#o#{$n%m&k&n&o&r&t&u&w&{'T'b)O)s*i+]+g,p,s,x-i.g/V/n0]0l1r2S2T2V2X2[2_2a3d4T4z6T6e6f6i7[8t9T!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^Q+T%aQ/c*Oo4OP>X>YQ*c$zU*l$|*Z*oQ+U%bQ0W*m#f=q#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^n=rTQ=x>UQ=y>VR=z>W!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^o4OP>X>Y>]>^Q,U&]Q1h,WQ5s1gR8h5tV*n$|*Z*oU*n$|*Z*oT5z1o5{S0P*i/nQ4w0]T8S4z:]Q+j%xQ0V*lQ1O+kQ1u,aQ6W1vQ8v6XQ:c8wR;^:d!U%Oi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Yx*R$v)e*S*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>OS0`*t0a#f]>^nZ>[`=T3}7c7f7j9h:t:w;yS=_.l3iT=`7e9k!U%Qi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y|*T$v)e*U*t+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>OS0b*u0c#f]>^nZ>[d=V3}7d7e7j9h9i:t:u:w;yS=a.m3jT=b7f9lrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q&f!UR,p&ornOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R&f!UQ,Y&^R1d,RsnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q1p,_S6R1s1tU8p6P6Q6US:_8r8sS;Y:^:aQ;m;ZR;w;nQ&m!VR,i&iR6_1|R:f8yW&Q|&V&W,OR1Z+vQ&r!WR,s&sR,y&xT2],x2_R,}&yQ,|&yR2f,}Q'y!{R-y'ySsOtQ#dXT%ps#dQ#OTR'{#OQ#RUR'}#RQ){$uR/`){Q#UVR(Q#UQ#XWU(W#X(X.QQ(X#YR.Q(YQ-^'YR2r-^Q.u(yS3m.u3nR3n.vQ-e'`R2v-eY!rQ'`-e1o5{R'j!rQ/Q)eR4S/QU#_W%h*YU(_#_(`.RQ(`#`R.R(ZQ-a']R2t-at`OXst!V!Z#d%m&i&k&r&t&u&w,s,x2[2_S#hZ%eU#r`#h.[R.[(jQ(k#jQ.X(gW.a(k.X3X7RQ3X.YR7R3YQ)n$lR/W)nQ$phR)t$pQ$`cU)a$`-|O>Z>[Q/z*eU4k/z4m7xQ4m/|R7x4lS*o$|*ZR0Y*ox*S$v)e*t*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>O!d.j(u)c*[*e.l.m.q/_/k/|0v1e3h4[4h4l5r7]7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/h*S.j7ca7c3}7e7f7j9h:t:w;yQ0a*tQ3i.lU4}0a3i9kR9k7e|*U$v)e*t*u+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>O!h.k(u)c*[*e.l.m.q/_/k/|0v1e3f3h4[4h4l5r7]7^7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/j*U.k7de7d3}7e7f7j9h9i:t:u:w;yQ0c*uQ3j.mU5P0c3j9lR9l7fQ*z%UR0g*zQ5]0vR8Y5]Q+_%kR0u+_Q5v1jS8j5v:[R:[8kQ,[&_R1m,[Q5{1oR8m5{Q1{,fS6]1{8zR8z6_Q1U+rW5h1U5j8a:VQ5j1XQ8a5iR:V8bQ+w&QR1[+wQ2_,xR6m2_YrOXst#dQ&v!ZQ+a%mQ,r&rQ,t&tQ,u&uQ,w&wQ2Y,sS2],x2_R6l2[Q%opQ&z!_Q&}!aQ'P!bQ'R!cQ'q!uQ+`%lQ+l%zQ,Q&XQ,h&mQ-P&|W-p'k's't'wQ-w'oQ0X*nQ1P+mQ1c,PS2O,i,lQ2g-OQ2h-RQ2i-SQ2}-oW3P-r-s-v-xQ5a1QQ5m1_Q5q1eQ6V1uQ6a2QQ6k2ZU6z3O3R3UQ6}3SQ8]5bQ8e5oQ8g5rQ8l5zQ8u6WQ8{6`S9[6{7PQ9^7OQ:W8cQ:b8vQ:g8|Q:n9]Q;U:XQ;]:cQ;a:oQ;l;VR;o;^Q%zyQ'd!iQ'o!uU+m%{%|%}Q-W'VU-k'e'f'gS-o'k'uQ0Q*jS1Q+n+oQ2o-YS2{-l-mQ3S-tS4p0R0UQ5b1RQ6v2uQ6y2|Q7O3TU7{4r4s4vQ9z7}R;O9{S$wi>PR*{%VU%Ui%V>PR0f*yQ$viS(u#v+iS)c$b$cQ)e$dQ*[$xS*e${*YQ*t%OQ*u%QQ+Q%^Q+R%_Q+V%cQ.lPQ=}>XQ>O>YQ>Z>]R>[>^Q+O%]Q.nSR#[WR'Z!el!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}S'V!e-]U*j$|*Z*oS-Y'W'_S0U*k*qQ0^*rQ2u-cQ4v0[R4{0_R({#xQ!fQT-d'`-e]!qQ!r'`-e1o5{Q#p]R'i < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:380,context:uY,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,"Expression",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,"Type",-3,88,103,109,"ClassItem"],["openedBy",23,"<",38,"InterpolationStart",56,"[",60,"{",73,"(",160,"JSXStartCloseTag"],["closedBy",-2,24,168,">",40,"InterpolationEnd",50,"]",61,"}",74,")",165,"JSXEndTag"]],propSources:[gY],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$i&j(WpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(WpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$i&j(Wp(Z!b'|0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(X#S$i&j'}0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$i&j(Wp(Z!b'}0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$i&j!p),Q(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(V':f$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$i&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$d`$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$d``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$d`$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(Z!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$d`(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$i&j(Wp(Z!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$i&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(Z!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$i&j(WpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(WpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Wp(Z!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l^!Q^$i&j!X7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!X7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!X7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c^!Ezl$i&j(Z!b!X7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(Z!b!X7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(Z!b!X7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(Z!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$i&j(Z!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!^!LYP;=`<%l!KS>^!L`P;=`<%l!_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!g$b$i&j$O)Lv(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#R-v$?V_!^(CdvBr$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z?O$@a_!q7`$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$Aq|$i&j(Wp(Z!b'|0/l$]#t(T,2j(e$I[OX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$i&j(Wp(Z!b'}0/l$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[dY,pY,fY,mY,2,3,4,5,6,7,8,9,10,11,12,13,14,hY,new gp("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~",141,340),new gp("j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~",25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:t=>OY[t]||-1},{term:343,get:t=>yY[t]||-1},{term:95,get:t=>bY[t]||-1}],tokenPrec:15201});function ex(t){let e=Object.keys(t).join(""),n=/\w/.test(e);return n&&(e=e.replace(/\w/g,"")),`[${n?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function vY(t){let e=Object.create(null),n=Object.create(null);for(let{label:i}of t){e[i[0]]=!0;for(let s=1;stypeof i=="string"?{label:i}:i),[n,r]=e.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:vY(e);return i=>{let s=i.matchBefore(r);return s||i.explicit?{from:s?s.from:i.pos,options:e,validFor:n}:null}}function SY(t,e){return n=>{for(let r=Nr(n.state).resolveInner(n.pos,-1);r;r=r.parent){if(t.indexOf(r.name)>-1)return null;if(r.type.isTop)break}return e(n)}}const wY=Jo.define(),kY=Ce.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class _Y{constructor(e,n,r,i){this.field=e,this.line=n,this.from=r,this.to=i}}class Uv{constructor(e,n,r){this.field=e,this.from=n,this.to=r}map(e){let n=e.mapPos(this.from,-1,Sn.TrackDel),r=e.mapPos(this.to,1,Sn.TrackDel);return n==null||r==null?null:new Uv(this.field,n,r)}}class Hv{constructor(e,n){this.lines=e,this.fieldPositions=n}instantiate(e,n){let r=[],i=[n],s=e.doc.lineAt(n),o=/^\s*/.exec(s.text)[0];for(let l of this.lines){if(r.length){let c=o,u=/^\t*/.exec(l)[0].length;for(let h=0;hnew Uv(l.field,i[l.line]+l.from,i[l.line]+l.to));return{text:r,ranges:a}}static parse(e){let n=[],r=[],i=[],s;for(let o of e.split(/\r\n?|\n/)){for(;s=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(o);){let a=s[1]?+s[1]:null,l=s[2]||s[3]||"",c=-1,u=l.replace(/\\[{}]/g,h=>h[1]);for(let h=0;h=c&&d.field++}for(let h of i)if(h.line==r.length&&h.from>s.index){let d=s[2]?3+(s[1]||"").length:2;h.from-=d,h.to-=d}i.push(new _Y(c,r.length,s.index,s.index+u.length)),o=o.slice(0,s.index)+l+o.slice(s.index+s[0].length)}o=o.replace(/\\([{}])/g,(a,l,c)=>{for(let u of i)u.line==r.length&&u.from>c&&(u.from--,u.to--);return l}),r.push(o)}return new Hv(r,i)}}let xY=Ft.widget({widget:new class extends cm{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),CY=Ft.mark({class:"cm-snippetField"});class yl{constructor(e,n){this.ranges=e,this.active=n,this.deco=Ft.set(e.map(r=>(r.from==r.to?xY:CY).range(r.from,r.to)),!0)}map(e){let n=[];for(let r of this.ranges){let i=r.map(e);if(!i)return null;n.push(i)}return new yl(n,this.active)}selectionInsideField(e){return e.ranges.every(n=>this.ranges.some(r=>r.field==this.active&&r.from<=n.from&&r.to>=n.to))}}const qu=Et.define({map(t,e){return t&&t.map(e)}}),DY=Et.define(),Ou=to.define({create(){return null},update(t,e){for(let n of e.effects){if(n.is(qu))return n.value;if(n.is(DY)&&t)return new yl(t.ranges,n.value)}return t&&e.docChanged&&(t=t.map(e.changes)),t&&e.selection&&!t.selectionInsideField(e.selection)&&(t=null),t},provide:t=>Ce.decorations.from(t,e=>e?e.deco:Ft.none)});function Xv(t,e){return ae.create(t.filter(n=>n.field==e).map(n=>ae.range(n.from,n.to)))}function AY(t){let e=Hv.parse(t);return(n,r,i,s)=>{let{text:o,ranges:a}=e.instantiate(n.state,i),{main:l}=n.state.selection,c={changes:{from:i,to:s==l.from?l.to:s,insert:We.of(o)},scrollIntoView:!0,annotations:r?[wY.of(r),nn.userEvent.of("input.complete")]:void 0};if(a.length&&(c.selection=Xv(a,0)),a.some(u=>u.field>0)){let u=new yl(a,0),h=c.effects=[qu.of(u)];n.state.field(Ou,!1)===void 0&&h.push(Et.appendConfig.of([Ou,IY,LY,kY]))}n.dispatch(n.state.update(c))}}function yL(t){return({state:e,dispatch:n})=>{let r=e.field(Ou,!1);if(!r||t<0&&r.active==0)return!1;let i=r.active+t,s=t>0&&!r.ranges.some(o=>o.field==i+t);return n(e.update({selection:Xv(r.ranges,i),effects:qu.of(s?null:new yl(r.ranges,i)),scrollIntoView:!0})),!0}}const PY=({state:t,dispatch:e})=>t.field(Ou,!1)?(e(t.update({effects:qu.of(null)})),!0):!1,NY=yL(1),RY=yL(-1),MY=[{key:"Tab",run:NY,shift:RY},{key:"Escape",run:PY}],tx=Ee.define({combine(t){return t.length?t[0]:MY}}),IY=sm.highest(hL.compute([tx],t=>t.facet(tx)));function Nn(t,e){return{...e,apply:AY(t)}}const LY=Ce.domEventHandlers({mousedown(t,e){let n=e.state.field(Ou,!1),r;if(!n||(r=e.posAtCoords({x:t.clientX,y:t.clientY}))==null)return!1;let i=n.ranges.find(s=>s.from<=r&&s.to>=r);return!i||i.field==n.active?!1:(e.dispatch({selection:Xv(n.ranges,i.field),effects:qu.of(n.ranges.some(s=>s.field>i.field)?new yl(n.ranges,i.field):null),scrollIntoView:!0}),!0)}}),bL=new class extends Fo{};bL.startSide=1;bL.endSide=-1;const EL=[Nn("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),Nn("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),Nn("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),Nn("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),Nn("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),Nn(`try { \${} } catch (\${error}) { \${} }`,{label:"try",detail:"/ catch block",type:"keyword"}),Nn("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),Nn(`if (\${}) { \${} } else { \${} }`,{label:"if",detail:"/ else block",type:"keyword"}),Nn(`class \${name} { constructor(\${params}) { \${} } }`,{label:"class",detail:"definition",type:"keyword"}),Nn('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Nn('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],QY=EL.concat([Nn("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Nn("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Nn("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),nx=new DM,vL=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function $l(t){return(e,n)=>{let r=e.node.getChild("VariableDefinition");return r&&n(r,t),!0}}const $Y=["FunctionDeclaration"],FY={FunctionDeclaration:$l("function"),ClassDeclaration:$l("class"),ClassExpression:()=>!0,EnumDeclaration:$l("constant"),TypeAliasDeclaration:$l("type"),NamespaceDeclaration:$l("namespace"),VariableDefinition(t,e){t.matchContext($Y)||e(t,"variable")},TypeDefinition(t,e){e(t,"type")},__proto__:null};function TL(t,e){let n=nx.get(e);if(n)return n;let r=[],i=!0;function s(o,a){let l=t.sliceString(o.from,o.to);r.push({label:l,type:a})}return e.cursor(ct.IncludeAnonymous).iterate(o=>{if(i)i=!1;else if(o.name){let a=FY[o.name];if(a&&a(o,s)||vL.has(o.name))return!1}else if(o.to-o.from>8192){for(let a of TL(t,o.node))r.push(a);return!1}}),nx.set(e,r),r}const rx=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,SL=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function BY(t){let e=Nr(t.state).resolveInner(t.pos,-1);if(SL.indexOf(e.name)>-1)return null;let n=e.name=="VariableName"||e.to-e.from<20&&rx.test(t.state.sliceDoc(e.from,e.to));if(!n&&!t.explicit)return null;let r=[];for(let i=e;i;i=i.parent)vL.has(i.name)&&(r=r.concat(TL(t.state.doc,i)));return{options:r,from:n?e.from:t.pos,validFor:rx}}const oi=rl.define({name:"javascript",parser:EY.configure({props:[zv.add({IfStatement:Md({except:/^\s*({|else\b)/}),TryStatement:Md({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:_7,SwitchBody:t=>{let e=t.textAfter,n=/^\s*\}/.test(e),r=/^\s*(case|default)\b/.test(e);return t.baseIndent+(n?0:r?1:2)*t.unit},Block:w7({closing:"}"}),ArrowFunction:t=>t.baseIndent+t.unit,"TemplateString BlockComment":()=>null,"Statement Property":Md({except:/^\s*{/}),JSXElement(t){let e=/^\s*<\//.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},JSXEscape(t){let e=/\s*\}/.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},"JSXOpenTag JSXSelfClosingTag"(t){return t.column(t.node.from)+t.unit}}),Vv.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":mL,BlockComment(t){return{from:t.from+2,to:t.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),wL={test:t=>/^JSX/.test(t.name),facet:pL({commentTokens:{block:{open:"{/*",close:"*/}"}}})},kL=oi.configure({dialect:"ts"},"typescript"),_L=oi.configure({dialect:"jsx",props:[Bv.add(t=>t.isTop?[wL]:void 0)]}),xL=oi.configure({dialect:"jsx ts",props:[Bv.add(t=>t.isTop?[wL]:void 0)]},"typescript");let CL=t=>({label:t,type:"keyword"});const DL="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(CL),jY=DL.concat(["declare","implements","private","protected","public"].map(CL));function zY(t={}){let e=t.jsx?t.typescript?xL:_L:t.typescript?kL:oi,n=t.typescript?QY.concat(jY):EL.concat(DL);return new jv(e,[oi.data.of({autocomplete:SY(SL,TY(n))}),oi.data.of({autocomplete:BY}),t.jsx?HY:[]])}function VY(t){for(;;){if(t.name=="JSXOpenTag"||t.name=="JSXSelfClosingTag"||t.name=="JSXFragmentTag")return t;if(t.name=="JSXEscape"||!t.parent)return null;t=t.parent}}function ix(t,e,n=t.length){for(let r=e==null?void 0:e.firstChild;r;r=r.nextSibling)if(r.name=="JSXIdentifier"||r.name=="JSXBuiltin"||r.name=="JSXNamespacedName"||r.name=="JSXMemberExpression")return t.sliceString(r.from,Math.min(r.to,n));return""}const UY=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),HY=Ce.inputHandler.of((t,e,n,r,i)=>{if((UY?t.composing:t.compositionStarted)||t.state.readOnly||e!=n||r!=">"&&r!="/"||!oi.isActiveAt(t.state,e,-1))return!1;let s=i(),{state:o}=s,a=o.changeByRange(l=>{var c;let{head:u}=l,h=Nr(o).resolveInner(u-1,-1),d;if(h.name=="JSXStartTag"&&(h=h.parent),!(o.doc.sliceString(u-1,u)!=r||h.name=="JSXAttributeValue"&&h.to>u)){if(r==">"&&h.name=="JSXFragmentTag")return{range:l,changes:{from:u,insert:""}};if(r=="/"&&h.name=="JSXStartCloseTag"){let p=h.parent,f=p.parent;if(f&&p.from==u-2&&((d=ix(o.doc,f.firstChild,u))||((c=f.firstChild)===null||c===void 0?void 0:c.name)=="JSXFragmentTag")){let m=`${d}>`;return{range:ae.cursor(u+m.length,-1),changes:{from:u,insert:m}}}}else if(r==">"){let p=VY(h);if(p&&p.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(o.doc.sliceString(u,u+2))&&(d=ix(o.doc,p,u)))return{range:l,changes:{from:u,insert:``}}}}return{range:l}});return a.changes.empty?!1:(t.dispatch([s,o.update(a,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),Fl=["_blank","_self","_top","_parent"],tO=["ascii","utf-8","utf-16","latin1","latin1"],nO=["get","post","put","delete"],rO=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],Vn=["true","false"],he={},XY={a:{attrs:{href:null,ping:null,type:null,media:null,target:Fl,hreflang:null}},abbr:he,address:he,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:he,aside:he,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:he,base:{attrs:{href:null,target:Fl}},bdi:he,bdo:he,blockquote:{attrs:{cite:null}},body:he,br:he,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:rO,formmethod:nO,formnovalidate:["novalidate"],formtarget:Fl,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:he,center:he,cite:he,code:he,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:he,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:he,div:he,dl:he,dt:he,em:he,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:he,figure:he,footer:he,form:{attrs:{action:null,name:null,"accept-charset":tO,autocomplete:["on","off"],enctype:rO,method:nO,novalidate:["novalidate"],target:Fl}},h1:he,h2:he,h3:he,h4:he,h5:he,h6:he,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:he,hgroup:he,hr:he,html:{attrs:{manifest:null}},i:he,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:rO,formmethod:nO,formnovalidate:["novalidate"],formtarget:Fl,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:he,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:he,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:he,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:tO,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:he,noscript:he,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:he,param:{attrs:{name:null,value:null}},pre:he,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:he,rt:he,ruby:he,samp:he,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:tO}},section:he,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:he,source:{attrs:{src:null,type:null,media:null}},span:he,strong:he,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:he,summary:he,sup:he,table:he,tbody:he,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:he,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:he,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:he,time:{attrs:{datetime:null}},title:he,tr:he,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:he,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:he},AL={accesskey:null,class:null,contenteditable:Vn,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:Vn,autocorrect:Vn,autocapitalize:Vn,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":Vn,"aria-autocomplete":["inline","list","both","none"],"aria-busy":Vn,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":Vn,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":Vn,"aria-hidden":Vn,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":Vn,"aria-multiselectable":Vn,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":Vn,"aria-relevant":null,"aria-required":Vn,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},PL="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(t=>"on"+t);for(let t of PL)AL[t]=null;let Cp=class{constructor(t,e){this.tags={...XY,...t},this.globalAttrs={...AL,...e},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};Cp.default=new Cp;function ol(t,e,n=t.length){if(!e)return"";let r=e.firstChild,i=r&&r.getChild("TagName");return i?t.sliceString(i.from,Math.min(i.to,n)):""}function al(t,e=!1){for(;t;t=t.parent)if(t.name=="Element")if(e)e=!1;else return t;return null}function NL(t,e,n){let r=n.tags[ol(t,al(e))];return(r==null?void 0:r.children)||n.allTags}function qv(t,e){let n=[];for(let r=al(e);r&&!r.type.isTop;r=al(r.parent)){let i=ol(t,r);if(i&&r.lastChild.name=="CloseTag")break;i&&n.indexOf(i)<0&&(e.name=="EndTag"||e.from>=r.firstChild.to)&&n.push(i)}return n}const RL=/^[:\-\.\w\u00b7-\uffff]*$/;function sx(t,e,n,r,i){let s=/\s*>/.test(t.sliceDoc(i,i+5))?"":">",o=al(n,n.name=="StartTag"||n.name=="TagName");return{from:r,to:i,options:NL(t.doc,o,e).map(a=>({label:a,type:"type"})).concat(qv(t.doc,n).map((a,l)=>({label:"/"+a,apply:"/"+a+s,type:"type",boost:99-l}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function ox(t,e,n,r){let i=/\s*>/.test(t.sliceDoc(r,r+5))?"":">";return{from:n,to:r,options:qv(t.doc,e).map((s,o)=>({label:s,apply:s+i,type:"type",boost:99-o})),validFor:RL}}function qY(t,e,n,r){let i=[],s=0;for(let o of NL(t.doc,n,e))i.push({label:"<"+o,type:"type"});for(let o of qv(t.doc,n))i.push({label:"",type:"type",boost:99-s++});return{from:r,to:r,options:i,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function ZY(t,e,n,r,i){let s=al(n),o=s?e.tags[ol(t.doc,s)]:null,a=o&&o.attrs?Object.keys(o.attrs):[],l=o&&o.globalAttrs===!1?a:a.length?a.concat(e.globalAttrNames):e.globalAttrNames;return{from:r,to:i,options:l.map(c=>({label:c,type:"property"})),validFor:RL}}function WY(t,e,n,r,i){var s;let o=(s=n.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),a=[],l;if(o){let c=t.sliceDoc(o.from,o.to),u=e.globalAttrs[c];if(!u){let h=al(n),d=h?e.tags[ol(t.doc,h)]:null;u=(d==null?void 0:d.attrs)&&d.attrs[c]}if(u){let h=t.sliceDoc(r,i).toLowerCase(),d='"',p='"';/^['"]/.test(h)?(l=h[0]=='"'?/^[^"]*$/:/^[^']*$/,d="",p=t.sliceDoc(i,i+1)==h[0]?"":h[0],h=h.slice(1),r++):l=/^[^\s<>='"]*$/;for(let f of u)a.push({label:f,apply:d+f+p,type:"constant"})}}return{from:r,to:i,options:a,validFor:l}}function GY(t,e){let{state:n,pos:r}=e,i=Nr(n).resolveInner(r,-1),s=i.resolve(r);for(let o=r,a;s==i&&(a=i.childBefore(o));){let l=a.lastChild;if(!l||!l.type.isError||l.fromGY(r,i)}const KY=oi.parser.configure({top:"SingleExpression"}),ML=[{tag:"script",attrs:t=>t.type=="text/typescript"||t.lang=="ts",parser:kL.parser},{tag:"script",attrs:t=>t.type=="text/babel"||t.type=="text/jsx",parser:_L.parser},{tag:"script",attrs:t=>t.type=="text/typescript-jsx",parser:xL.parser},{tag:"script",attrs(t){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(t.type)},parser:KY},{tag:"script",attrs(t){return!t.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(t.type)},parser:oi.parser},{tag:"style",attrs(t){return(!t.lang||t.lang=="css")&&(!t.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(t.type))},parser:xp.parser}],IL=[{name:"style",parser:xp.parser.configure({top:"Styles"})}].concat(PL.map(t=>({name:t,parser:oi.parser}))),LL=rl.define({name:"html",parser:NW.configure({props:[zv.add({Element(t){let e=/^(\s*)(<\/)?/.exec(t.textAfter);return t.node.to<=t.pos+e[0].length?t.continue():t.lineIndent(t.node.from)+(e[2]?0:t.unit)},"OpenTag CloseTag SelfClosingTag"(t){return t.column(t.node.from)+t.unit},Document(t){if(t.pos+/\s*/.exec(t.textAfter)[0].lengtht.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),Id=LL.configure({wrap:UM(ML,IL)});function JY(t={}){let e="",n;t.matchClosingTags===!1&&(e="noMatch"),t.selfClosingTags===!0&&(e=(e?e+" ":"")+"selfClosing"),(t.nestedLanguages&&t.nestedLanguages.length||t.nestedAttributes&&t.nestedAttributes.length)&&(n=UM((t.nestedLanguages||[]).concat(ML),(t.nestedAttributes||[]).concat(IL)));let r=n?LL.configure({wrap:n,dialect:e}):e?Id.configure({dialect:e}):Id;return new jv(r,[Id.data.of({autocomplete:YY(t)}),t.autoCloseTags!==!1?e9:[],zY().support,V7().support])}const ax=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),e9=Ce.inputHandler.of((t,e,n,r,i)=>{if(t.composing||t.state.readOnly||e!=n||r!=">"&&r!="/"||!Id.isActiveAt(t.state,e,-1))return!1;let s=i(),{state:o}=s,a=o.changeByRange(l=>{var c,u,h;let d=o.doc.sliceString(l.from-1,l.to)==r,{head:p}=l,f=Nr(o).resolveInner(p,-1),m;if(d&&r==">"&&f.name=="EndTag"){let g=f.parent;if(((u=(c=g.parent)===null||c===void 0?void 0:c.lastChild)===null||u===void 0?void 0:u.name)!="CloseTag"&&(m=ol(o.doc,g.parent,p))&&!ax.has(m)){let y=p+(o.doc.sliceString(p,p+1)===">"?1:0),b=``;return{range:l,changes:{from:p,to:y,insert:b}}}}else if(d&&r=="/"&&f.name=="IncompleteCloseTag"){let g=f.parent;if(f.from==p-2&&((h=g.lastChild)===null||h===void 0?void 0:h.name)!="CloseTag"&&(m=ol(o.doc,g,p))&&!ax.has(m)){let y=p+(o.doc.sliceString(p,p+1)===">"?1:0),b=`${m}>`;return{range:ae.cursor(p+b.length,-1),changes:{from:p,to:y,insert:b}}}}return{range:l}});return a.changes.empty?!1:(t.dispatch([s,o.update(a,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),t9=Ce.theme({"&":{color:"inherit",fontSize:"90%",backgroundColor:"inherit",outline:"none !important",display:"block !important",width:"100%",minHeight:"inherit",cursor:"text",height:"100%"},".cm-content":{lineHeight:1.75,fontFamily:"var(--font-mono)",caretColor:"hsl(var(--foreground, 0 0% 100%))",padding:"10px 0"},".cm-scroller":{minHeight:"inherit",height:"100%"},".cm-cursor":{borderLeftColor:"inherit"},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, ::selection":{backgroundColor:"rgba(59, 130, 246, 0.25)"},".cm-gutters":{color:"inherit",backgroundColor:"inherit",borderRight:"unset"},".cm-lineNumbers .cm-gutterElement":{paddingRight:"24px",opacity:"75%"},".cm-lineWrapping ":{wordBreak:"break-all !important"},".cm-tooltip":{backgroundColor:"hsl(var(--popover, 0 0% 10%))",color:"hsl(var(--popover-foreground, 0 0% 98%))",border:"1px solid hsl(var(--border, 0 0% 25%))",boxShadow:"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",zIndex:60},".cm-tooltip-autocomplete":{"& > ul":{maxHeight:"240px",overflow:"auto"}},".cm-tooltip-autocomplete ul li":{padding:"6px 8px"},".cm-tooltip-autocomplete ul li[aria-selected]":{backgroundColor:"hsl(var(--accent, 0 0% 20%))",color:"hsl(var(--accent-foreground, 0 0% 98%))"},".cm-completionMatchedText":{color:"#60a5fa",fontWeight:600,textDecoration:"none"}}),n9=hm.define([{tag:[R.comment],color:"#64748b"},{tag:[R.keyword,R.typeName,R.typeOperator],color:"#7c3aed",fontWeight:"500"},{tag:[R.string,R.meta,R.regexp],color:"#16a34a"},{tag:[R.number,R.bool],color:"#ea580c"},{tag:[R.operator,R.name],color:"#0ea5e9"},{tag:[R.variableName,R.attributeName,R.propertyName],color:"#0ea5e9"},{tag:[R.className],color:"#22d3ee"},{tag:[R.tagName],color:"#e11d48"},{tag:[R.heading,R.strong],color:"#111827",fontWeight:"bold"},{tag:[R.emphasis],color:"#111827",fontStyle:"italic"},{tag:[R.link],textDecoration:"underline"},{tag:[R.strikethrough],textDecoration:"line-through"},{tag:[R.invalid],color:"#ef4444"}]),r9=[t9,C7(n9)];function i9({initialContent:t}){const e=v.useRef(null);return v.useEffect(()=>{if(!e.current)return;const n=Ze.create({doc:t,extensions:[b7(),JY(),r9,Ze.readOnly.of(!0),Ce.lineWrapping]}),r=new Ce({state:n,parent:e.current});return()=>r.destroy()},[t]),e}var QL=Object.defineProperty,$L=t=>{throw TypeError(t)},s9=(t,e,n)=>e in t?QL(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,FL=(t,e)=>{for(var n in e)QL(t,n,{get:e[n],enumerable:!0})},lx=(t,e,n)=>s9(t,typeof e!="symbol"?e+"":e,n),o9=(t,e,n)=>e.has(t)||$L("Cannot "+n),qh=(t,e,n)=>(o9(t,e,"read from private field"),n?n.call(t):e.get(t)),a9=(t,e,n)=>e.has(t)?$L("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),BL={};FL(BL,{languages:()=>G1,options:()=>K1,parsers:()=>D2,printers:()=>Dee});var Zv=(t,e)=>(n,r,...i)=>n|1&&r==null?void 0:(e.call(r)??r[t]).apply(r,i),l9=String.prototype.replaceAll??function(t,e){return t.global?this.replace(t,e):this.split(t).join(e)},c9=Zv("replaceAll",function(){if(typeof this=="string")return l9}),kn=c9;function u9(t){return this[t<0?this.length+t:t]}var h9=Zv("at",function(){if(Array.isArray(this)||typeof this=="string")return u9}),bl=h9,d9=()=>{},p9=d9,jL="string",zL="array",VL="cursor",Wv="indent",Gv="align",UL="trim",Yv="group",Kv="fill",Jv="if-break",eT="indent-if-break",HL="line-suffix",XL="line-suffix-boundary",El="line",qL="label",tT="break-parent",ZL=new Set([VL,Wv,Gv,UL,Yv,Kv,Jv,eT,HL,XL,El,qL,tT]);function f9(t){if(typeof t=="string")return jL;if(Array.isArray(t))return zL;if(!t)return;let{type:e}=t;if(ZL.has(e))return e}var WL=f9,m9=t=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(t);function g9(t){let e=t===null?"null":typeof t;if(e!=="string"&&e!=="object")return`Unexpected doc '${e}', Expected it to be 'string' or 'object'.`;if(WL(t))throw new Error("doc is valid.");let n=Object.prototype.toString.call(t);if(n!=="[object Object]")return`Unexpected doc '${n}'.`;let r=m9([...ZL].map(i=>`'${i}'`));return`Unexpected doc.type '${t.type}'. Expected it to be ${r}.`}var O9=class extends Error{constructor(e){super(g9(e));V(this,"name","InvalidDocError");this.doc=e}},y9=O9;function GL(t,e){if(typeof t=="string")return e(t);let n=new Map;return r(t);function r(s){if(n.has(s))return n.get(s);let o=i(s);return n.set(s,o),o}function i(s){switch(WL(s)){case zL:return e(s.map(r));case Kv:return e({...s,parts:s.parts.map(r)});case Jv:return e({...s,breakContents:r(s.breakContents),flatContents:r(s.flatContents)});case Yv:{let{expandedStates:o,contents:a}=s;return o?(o=o.map(r),a=o[0]):a=r(a),e({...s,contents:a,expandedStates:o})}case Gv:case Wv:case eT:case qL:case HL:return e({...s,contents:r(s.contents)});case jL:case VL:case UL:case XL:case El:case tT:return e(s);default:throw new y9(s)}}}function ai(t,e=k9){return GL(t,n=>typeof n=="string"?vl(e,n.split(` `)):n)}var b9=p9;function mi(t){return{type:Wv,contents:t}}function E9(t,e){return{type:Gv,contents:e,n:t}}function v9(t){return E9(Number.NEGATIVE_INFINITY,t)}var Zu={type:tT};function YL(t){return{type:Kv,parts:t}}function $t(t,e={}){return b9(e.expandedStates),{type:Yv,id:e.id,contents:t,break:!!e.shouldBreak,expandedStates:e.expandedStates}}function yu(t,e="",n={}){return{type:Jv,breakContents:t,flatContents:e,groupId:n.groupId}}function T9(t,e){return{type:eT,contents:t,groupId:e.groupId,negate:e.negate}}function vl(t,e){let n=[];for(let r=0;rs?r:n}var x9=_9;function C9(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var rr,_f,KL,nA,D9=(nA=class{constructor(t){Oh(this,_f);Oh(this,rr);DS(this,rr,new Set(t))}getLeadingWhitespaceCount(t){let e=vi(this,rr),n=0;for(let r=0;r=0&&e.has(t.charAt(r));r--)n++;return n}getLeadingWhitespace(t){let e=this.getLeadingWhitespaceCount(t);return t.slice(0,e)}getTrailingWhitespace(t){let e=this.getTrailingWhitespaceCount(t);return t.slice(t.length-e)}hasLeadingWhitespace(t){return vi(this,rr).has(t.charAt(0))}hasTrailingWhitespace(t){return vi(this,rr).has(bl(0,t,-1))}trimStart(t){let e=this.getLeadingWhitespaceCount(t);return t.slice(e)}trimEnd(t){let e=this.getTrailingWhitespaceCount(t);return t.slice(0,t.length-e)}trim(t){return this.trimEnd(this.trimStart(t))}split(t,e=!1){let n=`[${C9([...vi(this,rr)].join(""))}]+`,r=new RegExp(e?`(${n})`:n,"u");return t.split(r)}hasWhitespaceCharacter(t){let e=vi(this,rr);return Array.prototype.some.call(t,n=>e.has(n))}hasNonWhitespaceCharacter(t){let e=vi(this,rr);return Array.prototype.some.call(t,n=>!e.has(n))}isWhitespaceOnly(t){let e=vi(this,rr);return Array.prototype.every.call(t,n=>e.has(n))}dedentString(t){let e=co(this,_f,KL).call(this,t);return e===0?t:t.split(` `).map(n=>n.slice(e)).join(` `)}},rr=new WeakMap,_f=new WeakSet,KL=function(t){let e=Number.POSITIVE_INFINITY;for(let n of t.split(` `)){if(n.length===0)continue;let r=this.getLeadingWhitespaceCount(n);if(r===0)return 0;n.length!==r&&r{i=r(o,a)});let s=await e(t,n,e);return i?$t(s):Wu(s)}function $9(t,e,n,r){let{node:i}=n,s=r.originalText.slice(i.sourceSpan.start.offset,i.sourceSpan.end.offset);return/^\s*$/u.test(s)?"":yr(s,t,{parser:"__ng_directive",__isInHtmlAttribute:!1},Tl)}var F9=$9,B9=Array.prototype.toReversed??function(){return[...this].reverse()},j9=Zv("toReversed",function(){if(Array.isArray(this))return B9}),z9=j9;function V9(){var n,r,i,s,o,a;let t=globalThis,e=(r=(n=t.Deno)==null?void 0:n.build)==null?void 0:r.os;return typeof e=="string"?e==="windows":((s=(i=t.navigator)==null?void 0:i.platform)==null?void 0:s.startsWith("Win"))??((a=(o=t.process)==null?void 0:o.platform)==null?void 0:a.startsWith("win"))??!1}var U9=V9();function e2(t){if(t=t instanceof URL?t:new URL(t),t.protocol!=="file:")throw new TypeError(`URL must be a file URL: received "${t.protocol}"`);return t}function H9(t){return t=e2(t),decodeURIComponent(t.pathname.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"))}function X9(t){t=e2(t);let e=decodeURIComponent(t.pathname.replace(/\//g,"\\").replace(/%(?![0-9A-Fa-f]{2})/g,"%25")).replace(/^\\*([A-Za-z]:)(\\|$)/,"$1\\");return t.hostname!==""&&(e=`\\\\${t.hostname}${e}`),e}function q9(t){return U9?X9(t):H9(t)}var Z9=t=>String(t).split(/[/\\]/u).pop(),W9=t=>String(t).startsWith("file:");function G9(t){return Array.isArray(t)&&t.length>0}var nT=G9;function cx(t,e){if(!e)return;let n=Z9(e).toLowerCase();return t.find(({filenames:r})=>r==null?void 0:r.some(i=>i.toLowerCase()===n))??t.find(({extensions:r})=>r==null?void 0:r.some(i=>n.endsWith(i)))}function Y9(t,e){if(e)return t.find(({name:n})=>n.toLowerCase()===e)??t.find(({aliases:n})=>n==null?void 0:n.includes(e))??t.find(({extensions:n})=>n==null?void 0:n.includes(`.${e}`))}var iO=void 0;function ux(t,e){if(e){if(W9(e))try{e=q9(e)}catch{return}if(typeof e=="string")return t.find(({isSupported:n})=>n==null?void 0:n({filepath:e}))}}function K9(t,e){var r;let n=z9(0,t.plugins).flatMap(i=>i.languages??[]);return(r=Y9(n,e.language)??cx(n,e.physicalFile)??cx(n,e.file)??ux(n,e.physicalFile)??ux(n,e.file)??(iO==null?void 0:iO(n,e.physicalFile)))==null?void 0:r.parsers[0]}var rT=K9,t2=Symbol.for("PRETTIER_IS_FRONT_MATTER");function J9(t){return!!(t!=null&&t[t2])}var dm=J9,Bl=3;function eK(t){let e=t.slice(0,Bl);if(e!=="---"&&e!=="+++")return;let n=t.indexOf(` `,Bl);if(n===-1)return;let r=t.slice(Bl,n).trim(),i=t.indexOf(` ${e}`,n),s=r;if(s||(s=e==="+++"?"toml":"yaml"),i===-1&&e==="---"&&s==="yaml"&&(i=t.indexOf(` ...`,n)),i===-1)return;let o=i+1+Bl,a=t.charAt(o+1);if(!/\s?/u.test(a))return;let l=t.slice(0,o),c;return{language:s,explicitLanguage:r||null,value:t.slice(n+1,i),startDelimiter:e,endDelimiter:l.slice(-Bl),raw:l,start:{line:1,column:0,index:0},end:{index:l.length,get line(){return c??(c=l.split(` `)),c.length},get column(){return c??(c=l.split(` `)),bl(0,c,-1).length}},[t2]:!0}}function tK(t){let e=eK(t);return e?{frontMatter:e,get content(){let{raw:n}=e;return kn(0,n,/[^\n]/gu," ")+t.slice(n.length)}}:{content:t}}var nK=tK,rK="inline",hx={area:"none",base:"none",basefont:"none",datalist:"none",head:"none",link:"none",meta:"none",noembed:"none",noframes:"none",param:"block",rp:"none",script:"block",style:"none",template:"inline",title:"none",html:"block",body:"block",address:"block",blockquote:"block",center:"block",dialog:"block",div:"block",figure:"block",figcaption:"block",footer:"block",form:"block",header:"block",hr:"block",legend:"block",listing:"block",main:"block",p:"block",plaintext:"block",pre:"block",search:"block",xmp:"block",slot:"contents",ruby:"ruby",rt:"ruby-text",article:"block",aside:"block",h1:"block",h2:"block",h3:"block",h4:"block",h5:"block",h6:"block",hgroup:"block",nav:"block",section:"block",dir:"block",dd:"block",dl:"block",dt:"block",menu:"block",ol:"block",ul:"block",li:"list-item",table:"table",caption:"table-caption",colgroup:"table-column-group",col:"table-column",thead:"table-header-group",tbody:"table-row-group",tfoot:"table-footer-group",tr:"table-row",td:"table-cell",th:"table-cell",input:"inline-block",button:"inline-block",fieldset:"block",details:"block",summary:"block",marquee:"inline-block",select:"inline-block",source:"block",track:"block",meter:"inline-block",progress:"inline-block",object:"inline-block",video:"inline-block",audio:"inline-block",option:"block",optgroup:"block"},iK="normal",dx={listing:"pre",plaintext:"pre",pre:"pre",xmp:"pre",nobr:"nowrap",table:"initial",textarea:"pre-wrap"};function sK(t){return t.kind==="element"&&!t.hasExplicitNamespace&&!["html","svg"].includes(t.namespace)}var Gu=sK,oK=t=>kn(0,t,/^[\t\f\r ]*\n/gu,""),n2=t=>oK(Or.trimEnd(t)),aK=t=>{let e=t,n=Or.getLeadingWhitespace(e);n&&(e=e.slice(n.length));let r=Or.getTrailingWhitespace(e);return r&&(e=e.slice(0,-r.length)),{leadingWhitespace:n,trailingWhitespace:r,text:e}};function r2(t,e){return!!(t.kind==="ieConditionalComment"&&t.lastChild&&!t.lastChild.isSelfClosing&&!t.lastChild.endSourceSpan||t.kind==="ieConditionalComment"&&!t.complete||ll(t)&&t.children.some(n=>n.kind!=="text"&&n.kind!=="interpolation")||sT(t,e)&&!Ki(t,e)&&t.kind!=="interpolation")}function pm(t){return t.kind==="attribute"||!t.parent||!t.prev?!1:lK(t.prev)}function lK(t){return t.kind==="comment"&&t.value.trim()==="prettier-ignore"}function cr(t){return t.kind==="text"||t.kind==="comment"}function Ki(t,e){return t.kind==="element"&&(t.fullName==="script"||t.fullName==="style"||t.fullName==="svg:style"||t.fullName==="svg:script"||t.fullName==="mj-style"&&e.parser==="mjml"||Gu(t)&&(t.name==="script"||t.name==="style"))}function cK(t,e){return t.children&&!Ki(t,e)}function uK(t,e){return Ki(t,e)||t.kind==="interpolation"||i2(t)}function i2(t){return h2(t).startsWith("pre")}function hK(t,e){var i,s;let n=r();if(n&&!t.prev&&((s=(i=t.parent)==null?void 0:i.tagDefinition)!=null&&s.ignoreFirstLf))return t.kind==="interpolation";return n;function r(){return dm(t)||t.kind==="angularControlFlowBlock"?!1:(t.kind==="text"||t.kind==="interpolation")&&t.prev&&(t.prev.kind==="text"||t.prev.kind==="interpolation")?!0:!t.parent||t.parent.cssDisplay==="none"?!1:ll(t.parent)?!0:!(!t.prev&&(t.parent.kind==="root"||ll(t)&&t.parent||Ki(t.parent,e)||fm(t.parent,e)||!EK(t.parent.cssDisplay))||t.prev&&!SK(t.prev.cssDisplay))}}function dK(t,e){return dm(t)||t.kind==="angularControlFlowBlock"?!1:(t.kind==="text"||t.kind==="interpolation")&&t.next&&(t.next.kind==="text"||t.next.kind==="interpolation")?!0:!t.parent||t.parent.cssDisplay==="none"?!1:ll(t.parent)?!0:!(!t.next&&(t.parent.kind==="root"||ll(t)&&t.parent||Ki(t.parent,e)||fm(t.parent,e)||!vK(t.parent.cssDisplay))||t.next&&!TK(t.next.cssDisplay))}function pK(t,e){return wK(t.cssDisplay)&&!Ki(t,e)}function Zh(t){return dm(t)||t.next&&t.sourceSpan.end&&t.sourceSpan.end.line+10&&(["body","script","style"].includes(t.name)||t.children.some(e=>gK(e)))||t.firstChild&&t.firstChild===t.lastChild&&t.firstChild.kind!=="text"&&a2(t.firstChild)&&(!t.lastChild.isTrailingSpaceSensitive||l2(t.lastChild))}function s2(t){return t.kind==="element"&&t.children.length>0&&(["html","head","ul","ol","select"].includes(t.name)||t.cssDisplay.startsWith("table")&&t.cssDisplay!=="table-cell")}function sO(t){return c2(t)||t.prev&&mK(t.prev)||o2(t)}function mK(t){return c2(t)||t.kind==="element"&&t.fullName==="br"||o2(t)}function o2(t){return a2(t)&&l2(t)}function a2(t){return t.hasLeadingSpaces&&(t.prev?t.prev.sourceSpan.end.linet.sourceSpan.end.line:t.parent.kind==="root"||t.parent.endSourceSpan&&t.parent.endSourceSpan.start.line>t.sourceSpan.end.line)}function c2(t){switch(t.kind){case"ieConditionalComment":case"comment":case"directive":return!0;case"element":return["script","select"].includes(t.name)}return!1}function iT(t){return t.lastChild?iT(t.lastChild):t}function gK(t){var e;return(e=t.children)==null?void 0:e.some(n=>n.kind!=="text")}function u2(t){if(t)switch(t){case"module":case"text/javascript":case"text/babel":case"text/jsx":case"application/javascript":return"babel";case"application/x-typescript":return"typescript";case"text/markdown":return"markdown";case"text/html":return"html";case"text/x-handlebars-template":return"glimmer";default:if(t.endsWith("json")||t.endsWith("importmap")||t==="speculationrules")return"json"}}function OK(t,e){let{name:n,attrMap:r}=t;if(n!=="script"||Object.prototype.hasOwnProperty.call(r,"src"))return;let{type:i,lang:s}=t.attrMap;return!s&&!i?"babel":rT(e,{language:s})??u2(i)}function yK(t,e){if(!sT(t,e))return;let{attrMap:n}=t;if(Object.prototype.hasOwnProperty.call(n,"src"))return;let{type:r,lang:i}=n;return rT(e,{language:i})??u2(r)}function bK(t,e){if(t.name==="style"){let{lang:n}=t.attrMap;return n?rT(e,{language:n}):"css"}if(t.name==="mj-style"&&e.parser==="mjml")return"css"}function px(t,e){return OK(t,e)??bK(t,e)??yK(t,e)}function Yu(t){return t==="block"||t==="list-item"||t.startsWith("table")}function EK(t){return!Yu(t)&&t!=="inline-block"}function vK(t){return!Yu(t)&&t!=="inline-block"}function TK(t){return!Yu(t)}function SK(t){return!Yu(t)}function wK(t){return!Yu(t)&&t!=="inline-block"}function ll(t){return h2(t).startsWith("pre")}function kK(t,e){let n=t;for(;n;){if(e(n))return!0;n=n.parent}return!1}function _K(t,e){var r;if(Sl(t,e))return"block";if(((r=t.prev)==null?void 0:r.kind)==="comment"){let i=t.prev.value.match(/^\s*display:\s*([a-z]+)\s*$/u);if(i)return i[1]}let n=!1;if(t.kind==="element"&&t.namespace==="svg")if(kK(t,i=>i.fullName==="svg:foreignObject"))n=!0;else return t.name==="svg"?"inline-block":"block";switch(e.htmlWhitespaceSensitivity){case"strict":return"inline";case"ignore":return"block";default:if(t.kind==="element"&&(!t.namespace||n||Gu(t))&&Object.prototype.hasOwnProperty.call(hx,t.name))return hx[t.name]}return rK}function h2(t){return t.kind==="element"&&(!t.namespace||Gu(t))&&Object.prototype.hasOwnProperty.call(dx,t.name)?dx[t.name]:iK}function d2(t){return kn(0,kn(0,t,"'","'"),""",'"')}function Fn(t){return d2(t.value)}var xK=new Set(["template","style","script"]);function fm(t,e){return Sl(t,e)&&!xK.has(t.fullName)}function Sl(t,e){return e.parser==="vue"&&t.kind==="element"&&t.parent.kind==="root"&&t.fullName.toLowerCase()!=="html"}function sT(t,e){return Sl(t,e)&&(fm(t,e)||t.attrMap.lang&&t.attrMap.lang!=="html")}function CK(t){let e=t.fullName;return e.charAt(0)==="#"||e==="slot-scope"||e==="v-slot"||e.startsWith("v-slot:")}function DK(t,e){let n=t.parent;if(!Sl(n,e))return!1;let r=n.fullName,i=t.fullName;return r==="script"&&i==="setup"||r==="style"&&i==="vars"}function p2(t,e=t.value){return t.parent.isWhitespaceSensitive?t.parent.isIndentationSensitive?ai(e):ai(Or.dedentString(n2(e)),Ot):vl(kt,Or.split(e))}function f2(t,e){return Sl(t,e)&&t.name==="script"}var m2=/\{\{(.+?)\}\}/su,AK=({node:{value:t}})=>m2.test(t);async function PK(t,e,n){let r=Fn(n.node),i=[];for(let[s,o]of r.split(m2).entries())if(s%2===0)i.push(ai(o));else try{i.push($t(["{{",mi([kt,await yr(o,t,{parser:"__ng_interpolation",__isInHtmlInterpolation:!0})]),kt,"}}"]))}catch{i.push("{{",ai(o),"}}")}return i}var oO=t=>(e,n,r)=>yr(Fn(r.node),e,{parser:t},Tl),NK=[{test(t){let e=t.node.fullName;return e.startsWith("(")&&e.endsWith(")")||e.startsWith("on-")},print:oO("__ng_action")},{test(t){let e=t.node.fullName;return e.startsWith("[")&&e.endsWith("]")||/^bind(?:on)?-/u.test(e)||/^ng-(?:if|show|hide|class|style)$/u.test(e)},print:oO("__ng_binding")},{test:t=>t.node.fullName.startsWith("*"),print:oO("__ng_directive")},{test:t=>/^i18n(?:-.+)?$/u.test(t.node.fullName),print:RK},{test:AK,print:PK}].map(({test:t,print:e})=>({test:(n,r)=>r.parser==="angular"&&t(n),print:e}));function RK(t,e,{node:n}){let r=Fn(n);return Wu(YL(p2(n,r.trim())),!r.includes("@@"))}var MK=NK,IK=({node:t},e)=>!e.parentParser&&t.fullName==="class"&&!t.value.includes("{{"),LK=(t,e,n)=>Fn(n.node).trim().split(/\s+/u).join(" "),QK=["onabort","onafterprint","onauxclick","onbeforeinput","onbeforematch","onbeforeprint","onbeforetoggle","onbeforeunload","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncommand","oncontextlost","oncontextmenu","oncontextrestored","oncopy","oncuechange","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onformdata","onhashchange","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onlanguagechange","onload","onloadeddata","onloadedmetadata","onloadstart","onmessage","onmessageerror","onmousedown","onmouseenter","onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onoffline","ononline","onpagehide","onpagereveal","onpageshow","onpageswap","onpaste","onpause","onplay","onplaying","onpopstate","onprogress","onratechange","onrejectionhandled","onreset","onresize","onscroll","onscrollend","onsecuritypolicyviolation","onseeked","onseeking","onselect","onslotchange","onstalled","onstorage","onsubmit","onsuspend","ontimeupdate","ontoggle","onunhandledrejection","onunload","onvolumechange","onwaiting","onwheel"],$K=new Set(QK),FK=({node:t},e)=>$K.has(t.fullName)&&!e.parentParser&&!t.value.includes("{{"),BK=(t,e,n)=>yr(Fn(n.node),t,{parser:"babel",__isHtmlInlineEventHandler:!0},()=>!1);function jK(t){let e=[];for(let n of t.split(";")){if(n=Or.trim(n),!n)continue;let[r,...i]=Or.split(n);e.push({name:r,value:i})}return e}var zK=jK,VK=({node:t},e)=>t.fullName==="allow"&&!e.parentParser&&t.parent.fullName==="iframe"&&!t.value.includes("{{");function UK(t,e,n){let{node:r}=n,i=zK(Fn(r));return i.length===0?[""]:Wu(i.map(({name:s,value:o},a)=>[[s,...o].join(" "),a===i.length-1?yu(";"):[";",kt]]))}function fx(t){return t===" "||t===` `||t==="\f"||t==="\r"||t===" "}var HK=/^[ \t\n\r\u000c]+/,XK=/^[, \t\n\r\u000c]+/,qK=/^[^ \t\n\r\u000c]+/,ZK=/[,]+$/,mx=/^\d+$/,WK=/^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/;function GK(t){let e=t.length,n,r,i,s,o,a=0,l;function c(p){let f,m=p.exec(t.substring(a));if(m)return[f]=m,a+=f.length,f}let u=[];for(;;){if(c(XK),a>=e){if(u.length===0)throw new Error("Must contain one or more image candidate strings.");return u}l=a,n=c(qK),r=[],n.slice(-1)===","?(n=n.replace(ZK,""),d()):h()}function h(){for(c(HK),i="",s="in descriptor";;){if(o=t.charAt(a),s==="in descriptor")if(fx(o))i&&(r.push(i),i="",s="after descriptor");else if(o===","){a+=1,i&&r.push(i),d();return}else if(o==="(")i+=o,s="in parens";else if(o===""){i&&r.push(i),d();return}else i+=o;else if(s==="in parens")if(o===")")i+=o,s="in descriptor";else if(o===""){r.push(i),d();return}else i+=o;else if(s==="after descriptor"&&!fx(o))if(o===""){d();return}else s="in descriptor",a-=1;a+=1}}function d(){let p=!1,f,m,g,y,b={},T,S,w,A,C;for(y=0;yt.node.fullName==="srcset"&&(t.parent.fullName==="img"||t.parent.fullName==="source"),g2={width:"w",height:"h",density:"x"},JK=Object.keys(g2);function eJ(t,e,n){let r=Fn(n.node),i=YK(r),s=JK.filter(p=>i.some(f=>Object.prototype.hasOwnProperty.call(f,p)));if(s.length>1)throw new Error("Mixed descriptor in srcset is not supported");let[o]=s,a=g2[o],l=i.map(p=>p.source.value),c=Math.max(...l.map(p=>p.length)),u=i.map(p=>p[o]?String(p[o].value):""),h=u.map(p=>{let f=p.indexOf(".");return f===-1?p.length:f}),d=Math.max(...h);return Wu(vl([",",kt],l.map((p,f)=>{let m=[p],g=u[f];if(g){let y=c-p.length+1,b=d-h[f],T=" ".repeat(y+b);m.push(yu(T," "),g+a)}return m})))}var tJ=({node:t},e)=>t.fullName==="style"&&!e.parentParser&&!t.value.includes("{{"),nJ=async(t,e,n)=>Wu(await t(Fn(n.node),{parser:"css",__isHTMLStyleAttribute:!0})),aO=new WeakMap;function rJ(t,e){let{root:n}=t;return aO.has(n)||aO.set(n,n.children.some(r=>f2(r,e)&&["ts","typescript"].includes(r.attrMap.lang))),aO.get(n)}var wl=rJ;function iJ(t,e,n){let r=Fn(n.node);return yr(`type T<${r}> = any`,t,{parser:"babel-ts",__isEmbeddedTypescriptGenericParameters:!0},Tl)}function sJ(t,e,n,r){let i=Fn(n.node),s=wl(n,r)?"babel-ts":"babel";return yr(`function _(${i}) {}`,t,{parser:s,__isVueBindings:!0})}async function oJ(t,e,n,r){let i=Fn(n.node),{left:s,operator:o,right:a}=aJ(i),l=wl(n,r);return[$t(await yr(`function _(${s}) {}`,t,{parser:l?"babel-ts":"babel",__isVueForBindingLeft:!0}))," ",o," ",await yr(a,t,{parser:l?"__ts_expression":"__js_expression"})]}function aJ(t){let e=/(.*?)\s+(in|of)\s+(.*)/su,n=/,([^,\]}]*)(?:,([^,\]}]*))?$/u,r=/^\(|\)$/gu,i=t.match(e);if(!i)return;let s={for:i[3].trim()};if(!s.for)return;let o=kn(0,i[1].trim(),r,""),a=o.match(n);a?(s.alias=o.replace(n,""),s.iterator1=a[1].trim(),a[2]&&(s.iterator2=a[2].trim())):s.alias=o;let l=[s.alias,s.iterator1,s.iterator2];if(!l.some((c,u)=>!c&&(u===0||l.slice(u+1).some(Boolean))))return{left:l.filter(Boolean).join(","),operator:i[2],right:s.for}}var lJ=[{test:t=>t.node.fullName==="v-for",print:oJ},{test:(t,e)=>t.node.fullName==="generic"&&f2(t.parent,e),print:iJ},{test:({node:t},e)=>CK(t)||DK(t,e),print:sJ},{test(t){let e=t.node.fullName;return e.startsWith("@")||e.startsWith("v-on:")},print:cJ},{test(t){let e=t.node.fullName;return e.startsWith(":")||e.startsWith(".")||e.startsWith("v-bind:")},print:uJ},{test:t=>t.node.fullName.startsWith("v-"),print:O2}].map(({test:t,print:e})=>({test:(n,r)=>r.parser==="vue"&&t(n,r),print:e}));async function cJ(t,e,n,r){var o;try{return await O2(t,e,n,r)}catch(a){if(((o=a.cause)==null?void 0:o.code)!=="BABEL_PARSER_SYNTAX_ERROR")throw a}let i=Fn(n.node),s=wl(n,r)?"__vue_ts_event_binding":"__vue_event_binding";return yr(i,t,{parser:s},Tl)}function uJ(t,e,n,r){let i=Fn(n.node),s=wl(n,r)?"__vue_ts_expression":"__vue_expression";return yr(i,t,{parser:s},Tl)}function O2(t,e,n,r){let i=Fn(n.node),s=wl(n,r)?"__ts_expression":"__js_expression";return yr(i,t,{parser:s},Tl)}var hJ=lJ,dJ=[{test:KK,print:eJ},{test:tJ,print:nJ},{test:FK,print:BK},{test:IK,print:LK},{test:VK,print:UK},...hJ,...MK].map(({test:t,print:e})=>({test:t,print:fJ(e)}));function pJ(t,e){var i;let{node:n}=t,{value:r}=n;if(r)return/^PRETTIER_HTML_PLACEHOLDER_\d+_\d+_IN_JS$/u.test(r)||e.parser==="lwc"&&r.startsWith("{")&&r.endsWith("}")?[n.rawName,"=",r]:(i=dJ.find(({test:s})=>s(t,e)))==null?void 0:i.print}function fJ(t){return async(e,n,r,i)=>{let s=await t(e,n,r,i);if(s)return s=GL(s,o=>typeof o=="string"?kn(0,o,'"',"""):o),[r.node.rawName,'="',$t(s),'"']}}var mJ=pJ,Ku=t=>t.sourceSpan.start.offset,mm=t=>t.sourceSpan.end.offset;function mb(t,e){return[t.isSelfClosing?"":gJ(t,e),wc(t,e)]}function gJ(t,e){return t.lastChild&&bu(t.lastChild)?"":[OJ(t,e),oT(t,e)]}function wc(t,e){return(t.next?Ho(t.next):eh(t.parent))?"":[Ju(t,e),Uo(t,e)]}function OJ(t,e){return eh(t)?Ju(t.lastChild,e):""}function Uo(t,e){return bu(t)?oT(t.parent,e):gm(t)?aT(t.next,e):""}function oT(t,e){if(y2(t,e))return"";switch(t.kind){case"ieConditionalComment":return"";case"ieConditionalStartComment":return"]>";case"interpolation":return"}}";case"angularIcuExpression":return"}";case"element":if(t.isSelfClosing)return"/>";default:return">"}}function y2(t,e){return!t.isSelfClosing&&!t.endSourceSpan&&(pm(t)||r2(t.parent,e))}function Ho(t){return t.prev&&t.prev.kind!=="docType"&&t.kind!=="angularControlFlowBlock"&&!cr(t.prev)&&t.isLeadingSpaceSensitive&&!t.hasLeadingSpaces}function eh(t){var e;return((e=t.lastChild)==null?void 0:e.isTrailingSpaceSensitive)&&!t.lastChild.hasTrailingSpaces&&!cr(iT(t.lastChild))&&!ll(t)}function bu(t){return!t.next&&!t.hasTrailingSpaces&&t.isTrailingSpaceSensitive&&cr(iT(t))}function gm(t){return t.next&&!cr(t.next)&&cr(t)&&t.isTrailingSpaceSensitive&&!t.hasTrailingSpaces}function yJ(t){let e=t.trim().match(/^prettier-ignore-attribute(?:\s+(.+))?$/su);return e?e[1]?e[1].split(/\s+/u):!0:!1}function Om(t){return!t.prev&&t.isLeadingSpaceSensitive&&!t.hasLeadingSpaces}function bJ(t,e,n){var u;let{node:r}=t;if(!nT(r.attrs))return r.isSelfClosing?" ":"";let i=((u=r.prev)==null?void 0:u.kind)==="comment"&&yJ(r.prev.value),s=typeof i=="boolean"?()=>i:Array.isArray(i)?h=>i.includes(h.rawName):()=>!1,o=t.map(({node:h})=>s(h)?ai(e.originalText.slice(Ku(h),mm(h))):n(),"attrs"),a=r.kind==="element"&&r.fullName==="script"&&r.attrs.length===1&&r.attrs[0].fullName==="src"&&r.children.length===0,l=e.singleAttributePerLine&&r.attrs.length>1&&!Sl(r,e)?Ot:kt,c=[mi([a?" ":kt,vl(l,o)])];return r.firstChild&&Om(r.firstChild)||r.isSelfClosing&&eh(r.parent)||a?c.push(r.isSelfClosing?" ":""):c.push(e.bracketSameLine?r.isSelfClosing?" ":"":r.isSelfClosing?kt:fn),c}function EJ(t){return t.firstChild&&Om(t.firstChild)?"":lT(t)}function gb(t,e,n){let{node:r}=t;return[kc(r,e),bJ(t,e,n),r.isSelfClosing?"":EJ(r)]}function kc(t,e){return t.prev&&gm(t.prev)?"":[Xo(t,e),aT(t,e)]}function Xo(t,e){return Om(t)?lT(t.parent):Ho(t)?Ju(t.prev,e):""}var gx="<${t.rawName}`;default:return`<${t.rawName}`}}function lT(t){switch(t.kind){case"ieConditionalComment":return"]>";case"element":if(t.condition)return">";default:return">"}}function vJ(t,e){if(!t.endSourceSpan)return"";let n=t.startSourceSpan.end.offset;t.firstChild&&Om(t.firstChild)&&(n-=lT(t).length);let r=t.endSourceSpan.start.offset;return t.lastChild&&bu(t.lastChild)?r+=oT(t,e).length:eh(t)&&(r-=Ju(t.lastChild,e).length),e.originalText.slice(n,r)}var b2=vJ,TJ=new Set(["if","else if","for","switch","case"]);function SJ(t,e){let{node:n}=t;switch(n.kind){case"element":if(Ki(n,e)||n.kind==="interpolation")return;if(!n.isSelfClosing&&sT(n,e)){let r=px(n,e);return r?async(i,s)=>{let o=b2(n,e),a=/^\s*$/u.test(o),l="";return a||(l=await i(n2(o),{parser:r,__embeddedInHtml:!0}),a=l===""),[Xo(n,e),$t(gb(t,e,s)),a?"":Ot,l,a?"":Ot,mb(n,e),Uo(n,e)]}:void 0}break;case"text":if(Ki(n.parent,e)){let r=px(n.parent,e);if(r)return async i=>{let s=r==="markdown"?Or.dedentString(n.value.replace(/^[^\S\n]*\n/u,"")):n.value,o={parser:r,__embeddedInHtml:!0};if(e.parser==="html"&&r==="babel"){let a="script",{attrMap:l}=n.parent;l&&(l.type==="module"||(l.type==="text/babel"||l.type==="text/jsx")&&l["data-type"]==="module")&&(a="module"),o.__babelSourceType=a}return[Zu,Xo(n,e),await i(s,o),Uo(n,e)]}}else if(n.parent.kind==="interpolation")return async r=>{let i={__isInHtmlInterpolation:!0,__embeddedInHtml:!0};return e.parser==="angular"?i.parser="__ng_interpolation":e.parser==="vue"?i.parser=wl(t,e)?"__vue_ts_expression":"__vue_expression":i.parser="__js_expression",[mi([kt,await r(n.value,i)]),n.parent.next&&Ho(n.parent.next)?" ":kt]};break;case"attribute":return mJ(t,e);case"angularControlFlowBlockParameters":return TJ.has(t.parent.name)?F9:void 0;case"angularLetDeclarationInitializer":return r=>yr(n.value,r,{parser:"__ng_binding",__isInHtmlAttribute:!1})}}var wJ=SJ,jl=null;function _c(t){if(jl!==null&&typeof jl.property){let e=jl;return jl=_c.prototype=null,e}return jl=_c.prototype=t??Object.create(null),new _c}var kJ=10;for(let t=0;t<=kJ;t++)_c();function _J(t){return _c(t)}function xJ(t,e="type"){_J(t);function n(r){let i=r[e],s=t[i];if(!Array.isArray(s))throw Object.assign(new Error(`Missing visitor keys for '${i}'.`),{node:r});return s}return n}var CJ=xJ,DJ={root:["children"],element:["attrs","children"],ieConditionalComment:["children"],ieConditionalStartComment:[],ieConditionalEndComment:[],interpolation:["children"],text:["children"],docType:[],comment:[],attribute:[],cdata:[],angularControlFlowBlock:["children","parameters"],angularControlFlowBlockParameters:["children"],angularControlFlowBlockParameter:[],angularLetDeclaration:["init"],angularLetDeclarationInitializer:[],angularIcuExpression:["cases"],angularIcuCase:["expression"]},AJ=DJ,PJ=CJ(AJ,"kind"),NJ=PJ,RJ="format",MJ=/^\s*/u,IJ=/^\s*/u,LJ=t=>IJ.test(t),QJ=t=>MJ.test(t),$J=t=>` ${t}`,FJ=new Map([["if",new Set(["else if","else"])],["else if",new Set(["else if","else"])],["for",new Set(["empty"])],["defer",new Set(["placeholder","error","loading"])],["placeholder",new Set(["placeholder","error","loading"])],["error",new Set(["placeholder","error","loading"])],["loading",new Set(["placeholder","error","loading"])]]);function E2(t){let e=mm(t);return t.kind==="element"&&!t.endSourceSpan&&nT(t.children)?Math.max(e,E2(bl(0,t.children,-1))):e}function zl(t,e,n){let r=t.node;if(pm(r)){let i=E2(r);return[Xo(r,e),ai(Or.trimEnd(e.originalText.slice(Ku(r)+(r.prev&&gm(r.prev)?aT(r).length:0),i-(r.next&&Ho(r.next)?Ju(r,e).length:0)))),Uo(r,e)]}return n()}function Wh(t,e){return cr(t)&&cr(e)?t.isTrailingSpaceSensitive?t.hasTrailingSpaces?sO(e)?Ot:kt:"":sO(e)?Ot:fn:gm(t)&&(pm(e)||e.firstChild||e.isSelfClosing||e.kind==="element"&&e.attrs.length>0)||t.kind==="element"&&t.isSelfClosing&&Ho(e)?"":!e.isLeadingSpaceSensitive||sO(e)||Ho(e)&&t.lastChild&&bu(t.lastChild)&&t.lastChild.lastChild&&bu(t.lastChild.lastChild)?Ot:e.hasLeadingSpaces?kt:fn}function cT(t,e,n){let{node:r}=t;if(s2(r))return[Zu,...t.map(()=>{let s=t.node,o=s.prev?Wh(s.prev,s):"";return[o?[o,Zh(s.prev)?Ot:""]:"",zl(t,e,n)]},"children")];let i=r.children.map(()=>Symbol(""));return t.map(({node:s,index:o})=>{if(cr(s)){if(s.prev&&cr(s.prev)){let p=Wh(s.prev,s);if(p)return Zh(s.prev)?[Ot,Ot,zl(t,e,n)]:[p,zl(t,e,n)]}return zl(t,e,n)}let a=[],l=[],c=[],u=[],h=s.prev?Wh(s.prev,s):"",d=s.next?Wh(s,s.next):"";return h&&(Zh(s.prev)?a.push(Ot,Ot):h===Ot?a.push(Ot):cr(s.prev)?l.push(h):l.push(yu("",fn,{groupId:i[o-1]}))),d&&(Zh(s)?cr(s.next)&&u.push(Ot,Ot):d===Ot?cr(s.next)&&u.push(Ot):c.push(d)),[...a,$t([...l,$t([zl(t,e,n),...c],{id:i[o]})]),...u]},"children")}function BJ(t,e,n){let{node:r}=t,i=[];jJ(t)&&i.push("} "),i.push("@",r.name),r.parameters&&i.push(" (",$t(n("parameters")),")"),i.push(" {");let s=v2(r);return r.children.length>0?(r.firstChild.hasLeadingSpaces=!0,r.lastChild.hasTrailingSpaces=!0,i.push(mi([Ot,cT(t,e,n)])),s&&i.push(Ot,"}")):s&&i.push("}"),$t(i,{shouldBreak:!0})}function v2(t){var e,n;return!(((e=t.next)==null?void 0:e.kind)==="angularControlFlowBlock"&&((n=FJ.get(t.name))!=null&&n.has(t.next.name)))}function jJ(t){let{previous:e}=t;return(e==null?void 0:e.kind)==="angularControlFlowBlock"&&!pm(e)&&!v2(e)}function zJ(t,e,n){return[mi([fn,vl([";",kt],t.map(n,"children"))]),fn]}function VJ(t,e,n){let{node:r}=t;return[kc(r,e),$t([r.switchValue.trim(),", ",r.type,r.cases.length>0?[",",mi([kt,vl(kt,t.map(n,"cases"))])]:"",fn]),wc(r,e)]}function UJ(t,e,n){let{node:r}=t;return[r.value," {",$t([mi([fn,t.map(({node:i,isLast:s})=>{let o=[n()];return i.kind==="text"&&(i.hasLeadingSpaces&&o.unshift(kt),i.hasTrailingSpaces&&!s&&o.push(kt)),o},"expression")]),fn]),"}"]}function HJ(t,e,n){let{node:r}=t;if(r2(r,e))return[Xo(r,e),$t(gb(t,e,n)),ai(b2(r,e)),...mb(r,e),Uo(r,e)];let i=r.children.length===1&&(r.firstChild.kind==="interpolation"||r.firstChild.kind==="angularIcuExpression")&&r.firstChild.isLeadingSpaceSensitive&&!r.firstChild.hasLeadingSpaces&&r.lastChild.isTrailingSpaceSensitive&&!r.lastChild.hasTrailingSpaces,s=Symbol("element-attr-group-id"),o=u=>$t([$t(gb(t,e,n),{id:s}),u,mb(r,e)]),a=u=>i?T9(u,{groupId:s}):(Ki(r,e)||fm(r,e))&&r.parent.kind==="root"&&e.parser==="vue"&&!e.vueIndentScriptAndStyle?u:mi(u),l=()=>i?yu(fn,"",{groupId:s}):r.firstChild.hasLeadingSpaces&&r.firstChild.isLeadingSpaceSensitive?kt:r.firstChild.kind==="text"&&r.isWhitespaceSensitive&&r.isIndentationSensitive?v9(fn):fn,c=()=>(r.next?Ho(r.next):eh(r.parent))?r.lastChild.hasTrailingSpaces&&r.lastChild.isTrailingSpaceSensitive?" ":"":i?yu(fn,"",{groupId:s}):r.lastChild.hasTrailingSpaces&&r.lastChild.isTrailingSpaceSensitive?kt:(r.lastChild.kind==="comment"||r.lastChild.kind==="text"&&r.isWhitespaceSensitive&&r.isIndentationSensitive)&&new RegExp(`\\n[\\t ]{${e.tabWidth*(t.ancestors.length-1)}}$`,"u").test(r.lastChild.value)?"":fn;return r.children.length===0?o(r.hasDanglingSpaces&&r.isDanglingSpaceSensitive?kt:""):o([fK(r)?Zu:"",a([l(),cT(t,e,n)]),c()])}var Mi=(function(t){return t[t.RAW_TEXT=0]="RAW_TEXT",t[t.ESCAPABLE_RAW_TEXT=1]="ESCAPABLE_RAW_TEXT",t[t.PARSABLE_DATA=2]="PARSABLE_DATA",t})({});function ym(t,e=!0){if(t[0]!=":")return[null,t];let n=t.indexOf(":",1);if(n===-1){if(e)throw new Error(`Unsupported format "${t}" expecting ":namespace:name"`);return[null,t]}return[t.slice(1,n),t.slice(n+1)]}function Ox(t){return ym(t)[1]==="ng-container"}function yx(t){return ym(t)[1]==="ng-content"}function Ld(t){return t===null?null:ym(t)[0]}function xc(t,e){return t?`:${t}:${e}`:e}var bx={name:"custom-elements"},Ex={name:"no-errors-schema"},lc=(function(t){return t[t.NONE=0]="NONE",t[t.HTML=1]="HTML",t[t.STYLE=2]="STYLE",t[t.SCRIPT=3]="SCRIPT",t[t.URL=4]="URL",t[t.RESOURCE_URL=5]="RESOURCE_URL",t})({}),XJ=/-+([a-z0-9])/g;function qJ(t){return t.replace(XJ,(...e)=>e[1].toUpperCase())}var Qd;function vx(){return Qd||(Qd={},Gh(lc.HTML,["iframe|srcdoc","*|innerHTML","*|outerHTML"]),Gh(lc.STYLE,["*|style"]),Gh(lc.URL,["*|formAction","area|href","area|ping","audio|src","a|href","a|ping","blockquote|cite","body|background","del|cite","form|action","img|src","input|src","ins|cite","q|cite","source|src","track|src","video|poster","video|src"]),Gh(lc.RESOURCE_URL,["applet|code","applet|codebase","base|href","embed|src","frame|src","head|profile","html|manifest","iframe|src","link|href","media|src","object|codebase","object|data","script|src"])),Qd}function Gh(t,e){for(let n of e)Qd[n.toLowerCase()]=t}var ZJ=class{},WJ="boolean",GJ="number",YJ="string",KJ="object",JJ=["[Element]|textContent,%ariaActiveDescendantElement,%ariaAtomic,%ariaAutoComplete,%ariaBusy,%ariaChecked,%ariaColCount,%ariaColIndex,%ariaColIndexText,%ariaColSpan,%ariaControlsElements,%ariaCurrent,%ariaDescribedByElements,%ariaDescription,%ariaDetailsElements,%ariaDisabled,%ariaErrorMessageElements,%ariaExpanded,%ariaFlowToElements,%ariaHasPopup,%ariaHidden,%ariaInvalid,%ariaKeyShortcuts,%ariaLabel,%ariaLabelledByElements,%ariaLevel,%ariaLive,%ariaModal,%ariaMultiLine,%ariaMultiSelectable,%ariaOrientation,%ariaOwnsElements,%ariaPlaceholder,%ariaPosInSet,%ariaPressed,%ariaReadOnly,%ariaRelevant,%ariaRequired,%ariaRoleDescription,%ariaRowCount,%ariaRowIndex,%ariaRowIndexText,%ariaRowSpan,%ariaSelected,%ariaSetSize,%ariaSort,%ariaValueMax,%ariaValueMin,%ariaValueNow,%ariaValueText,%classList,className,elementTiming,id,innerHTML,*beforecopy,*beforecut,*beforepaste,*fullscreenchange,*fullscreenerror,*search,*webkitfullscreenchange,*webkitfullscreenerror,outerHTML,%part,#scrollLeft,#scrollTop,slot,*message,*mozfullscreenchange,*mozfullscreenerror,*mozpointerlockchange,*mozpointerlockerror,*webglcontextcreationerror,*webglcontextlost,*webglcontextrestored","[HTMLElement]^[Element]|accessKey,autocapitalize,!autofocus,contentEditable,dir,!draggable,enterKeyHint,!hidden,!inert,innerText,inputMode,lang,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,outerText,!spellcheck,%style,#tabIndex,title,!translate,virtualKeyboardPolicy","abbr,address,article,aside,b,bdi,bdo,cite,content,code,dd,dfn,dt,em,figcaption,figure,footer,header,hgroup,i,kbd,main,mark,nav,noscript,rb,rp,rt,rtc,ruby,s,samp,search,section,small,strong,sub,sup,u,var,wbr^[HTMLElement]|accessKey,autocapitalize,!autofocus,contentEditable,dir,!draggable,enterKeyHint,!hidden,innerText,inputMode,lang,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,outerText,!spellcheck,%style,#tabIndex,title,!translate,virtualKeyboardPolicy","media^[HTMLElement]|!autoplay,!controls,%controlsList,%crossOrigin,#currentTime,!defaultMuted,#defaultPlaybackRate,!disableRemotePlayback,!loop,!muted,*encrypted,*waitingforkey,#playbackRate,preload,!preservesPitch,src,%srcObject,#volume",":svg:^[HTMLElement]|!autofocus,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,%style,#tabIndex",":svg:graphics^:svg:|",":svg:animation^:svg:|*begin,*end,*repeat",":svg:geometry^:svg:|",":svg:componentTransferFunction^:svg:|",":svg:gradient^:svg:|",":svg:textContent^:svg:graphics|",":svg:textPositioning^:svg:textContent|","a^[HTMLElement]|charset,coords,download,hash,host,hostname,href,hreflang,name,password,pathname,ping,port,protocol,referrerPolicy,rel,%relList,rev,search,shape,target,text,type,username","area^[HTMLElement]|alt,coords,download,hash,host,hostname,href,!noHref,password,pathname,ping,port,protocol,referrerPolicy,rel,%relList,search,shape,target,username","audio^media|","br^[HTMLElement]|clear","base^[HTMLElement]|href,target","body^[HTMLElement]|aLink,background,bgColor,link,*afterprint,*beforeprint,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*messageerror,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,text,vLink","button^[HTMLElement]|!disabled,formAction,formEnctype,formMethod,!formNoValidate,formTarget,name,type,value","canvas^[HTMLElement]|#height,#width","content^[HTMLElement]|select","dl^[HTMLElement]|!compact","data^[HTMLElement]|value","datalist^[HTMLElement]|","details^[HTMLElement]|!open","dialog^[HTMLElement]|!open,returnValue","dir^[HTMLElement]|!compact","div^[HTMLElement]|align","embed^[HTMLElement]|align,height,name,src,type,width","fieldset^[HTMLElement]|!disabled,name","font^[HTMLElement]|color,face,size","form^[HTMLElement]|acceptCharset,action,autocomplete,encoding,enctype,method,name,!noValidate,target","frame^[HTMLElement]|frameBorder,longDesc,marginHeight,marginWidth,name,!noResize,scrolling,src","frameset^[HTMLElement]|cols,*afterprint,*beforeprint,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*messageerror,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,rows","hr^[HTMLElement]|align,color,!noShade,size,width","head^[HTMLElement]|","h1,h2,h3,h4,h5,h6^[HTMLElement]|align","html^[HTMLElement]|version","iframe^[HTMLElement]|align,allow,!allowFullscreen,!allowPaymentRequest,csp,frameBorder,height,loading,longDesc,marginHeight,marginWidth,name,referrerPolicy,%sandbox,scrolling,src,srcdoc,width","img^[HTMLElement]|align,alt,border,%crossOrigin,decoding,#height,#hspace,!isMap,loading,longDesc,lowsrc,name,referrerPolicy,sizes,src,srcset,useMap,#vspace,#width","input^[HTMLElement]|accept,align,alt,autocomplete,!checked,!defaultChecked,defaultValue,dirName,!disabled,%files,formAction,formEnctype,formMethod,!formNoValidate,formTarget,#height,!incremental,!indeterminate,max,#maxLength,min,#minLength,!multiple,name,pattern,placeholder,!readOnly,!required,selectionDirection,#selectionEnd,#selectionStart,#size,src,step,type,useMap,value,%valueAsDate,#valueAsNumber,#width","li^[HTMLElement]|type,#value","label^[HTMLElement]|htmlFor","legend^[HTMLElement]|align","link^[HTMLElement]|as,charset,%crossOrigin,!disabled,href,hreflang,imageSizes,imageSrcset,integrity,media,referrerPolicy,rel,%relList,rev,%sizes,target,type","map^[HTMLElement]|name","marquee^[HTMLElement]|behavior,bgColor,direction,height,#hspace,#loop,#scrollAmount,#scrollDelay,!trueSpeed,#vspace,width","menu^[HTMLElement]|!compact","meta^[HTMLElement]|content,httpEquiv,media,name,scheme","meter^[HTMLElement]|#high,#low,#max,#min,#optimum,#value","ins,del^[HTMLElement]|cite,dateTime","ol^[HTMLElement]|!compact,!reversed,#start,type","object^[HTMLElement]|align,archive,border,code,codeBase,codeType,data,!declare,height,#hspace,name,standby,type,useMap,#vspace,width","optgroup^[HTMLElement]|!disabled,label","option^[HTMLElement]|!defaultSelected,!disabled,label,!selected,text,value","output^[HTMLElement]|defaultValue,%htmlFor,name,value","p^[HTMLElement]|align","param^[HTMLElement]|name,type,value,valueType","picture^[HTMLElement]|","pre^[HTMLElement]|#width","progress^[HTMLElement]|#max,#value","q,blockquote,cite^[HTMLElement]|","script^[HTMLElement]|!async,charset,%crossOrigin,!defer,event,htmlFor,integrity,!noModule,%referrerPolicy,src,text,type","select^[HTMLElement]|autocomplete,!disabled,#length,!multiple,name,!required,#selectedIndex,#size,value","selectedcontent^[HTMLElement]|","slot^[HTMLElement]|name","source^[HTMLElement]|#height,media,sizes,src,srcset,type,#width","span^[HTMLElement]|","style^[HTMLElement]|!disabled,media,type","search^[HTMLELement]|","caption^[HTMLElement]|align","th,td^[HTMLElement]|abbr,align,axis,bgColor,ch,chOff,#colSpan,headers,height,!noWrap,#rowSpan,scope,vAlign,width","col,colgroup^[HTMLElement]|align,ch,chOff,#span,vAlign,width","table^[HTMLElement]|align,bgColor,border,%caption,cellPadding,cellSpacing,frame,rules,summary,%tFoot,%tHead,width","tr^[HTMLElement]|align,bgColor,ch,chOff,vAlign","tfoot,thead,tbody^[HTMLElement]|align,ch,chOff,vAlign","template^[HTMLElement]|","textarea^[HTMLElement]|autocomplete,#cols,defaultValue,dirName,!disabled,#maxLength,#minLength,name,placeholder,!readOnly,!required,#rows,selectionDirection,#selectionEnd,#selectionStart,value,wrap","time^[HTMLElement]|dateTime","title^[HTMLElement]|text","track^[HTMLElement]|!default,kind,label,src,srclang","ul^[HTMLElement]|!compact,type","unknown^[HTMLElement]|","video^media|!disablePictureInPicture,#height,*enterpictureinpicture,*leavepictureinpicture,!playsInline,poster,#width",":svg:a^:svg:graphics|",":svg:animate^:svg:animation|",":svg:animateMotion^:svg:animation|",":svg:animateTransform^:svg:animation|",":svg:circle^:svg:geometry|",":svg:clipPath^:svg:graphics|",":svg:defs^:svg:graphics|",":svg:desc^:svg:|",":svg:discard^:svg:|",":svg:ellipse^:svg:geometry|",":svg:feBlend^:svg:|",":svg:feColorMatrix^:svg:|",":svg:feComponentTransfer^:svg:|",":svg:feComposite^:svg:|",":svg:feConvolveMatrix^:svg:|",":svg:feDiffuseLighting^:svg:|",":svg:feDisplacementMap^:svg:|",":svg:feDistantLight^:svg:|",":svg:feDropShadow^:svg:|",":svg:feFlood^:svg:|",":svg:feFuncA^:svg:componentTransferFunction|",":svg:feFuncB^:svg:componentTransferFunction|",":svg:feFuncG^:svg:componentTransferFunction|",":svg:feFuncR^:svg:componentTransferFunction|",":svg:feGaussianBlur^:svg:|",":svg:feImage^:svg:|",":svg:feMerge^:svg:|",":svg:feMergeNode^:svg:|",":svg:feMorphology^:svg:|",":svg:feOffset^:svg:|",":svg:fePointLight^:svg:|",":svg:feSpecularLighting^:svg:|",":svg:feSpotLight^:svg:|",":svg:feTile^:svg:|",":svg:feTurbulence^:svg:|",":svg:filter^:svg:|",":svg:foreignObject^:svg:graphics|",":svg:g^:svg:graphics|",":svg:image^:svg:graphics|decoding",":svg:line^:svg:geometry|",":svg:linearGradient^:svg:gradient|",":svg:mpath^:svg:|",":svg:marker^:svg:|",":svg:mask^:svg:|",":svg:metadata^:svg:|",":svg:path^:svg:geometry|",":svg:pattern^:svg:|",":svg:polygon^:svg:geometry|",":svg:polyline^:svg:geometry|",":svg:radialGradient^:svg:gradient|",":svg:rect^:svg:geometry|",":svg:svg^:svg:graphics|#currentScale,#zoomAndPan",":svg:script^:svg:|type",":svg:set^:svg:animation|",":svg:stop^:svg:|",":svg:style^:svg:|!disabled,media,title,type",":svg:switch^:svg:graphics|",":svg:symbol^:svg:|",":svg:tspan^:svg:textPositioning|",":svg:text^:svg:textPositioning|",":svg:textPath^:svg:textContent|",":svg:title^:svg:|",":svg:use^:svg:graphics|",":svg:view^:svg:|#zoomAndPan","data^[HTMLElement]|value","keygen^[HTMLElement]|!autofocus,challenge,!disabled,form,keytype,name","menuitem^[HTMLElement]|type,label,icon,!disabled,!checked,radiogroup,!default","summary^[HTMLElement]|","time^[HTMLElement]|dateTime",":svg:cursor^:svg:|",":math:^[HTMLElement]|!autofocus,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforeinput,*beforematch,*beforetoggle,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contentvisibilityautostatechange,*contextlost,*contextmenu,*contextrestored,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*scrollend,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,%style,#tabIndex",":math:math^:math:|",":math:maction^:math:|",":math:menclose^:math:|",":math:merror^:math:|",":math:mfenced^:math:|",":math:mfrac^:math:|",":math:mi^:math:|",":math:mmultiscripts^:math:|",":math:mn^:math:|",":math:mo^:math:|",":math:mover^:math:|",":math:mpadded^:math:|",":math:mphantom^:math:|",":math:mroot^:math:|",":math:mrow^:math:|",":math:ms^:math:|",":math:mspace^:math:|",":math:msqrt^:math:|",":math:mstyle^:math:|",":math:msub^:math:|",":math:msubsup^:math:|",":math:msup^:math:|",":math:mtable^:math:|",":math:mtd^:math:|",":math:mtext^:math:|",":math:mtr^:math:|",":math:munder^:math:|",":math:munderover^:math:|",":math:semantics^:math:|"],T2=new Map(Object.entries({class:"className",for:"htmlFor",formaction:"formAction",innerHtml:"innerHTML",readonly:"readOnly",tabindex:"tabIndex","aria-activedescendant":"ariaActiveDescendantElement","aria-atomic":"ariaAtomic","aria-autocomplete":"ariaAutoComplete","aria-busy":"ariaBusy","aria-checked":"ariaChecked","aria-colcount":"ariaColCount","aria-colindex":"ariaColIndex","aria-colindextext":"ariaColIndexText","aria-colspan":"ariaColSpan","aria-controls":"ariaControlsElements","aria-current":"ariaCurrent","aria-describedby":"ariaDescribedByElements","aria-description":"ariaDescription","aria-details":"ariaDetailsElements","aria-disabled":"ariaDisabled","aria-errormessage":"ariaErrorMessageElements","aria-expanded":"ariaExpanded","aria-flowto":"ariaFlowToElements","aria-haspopup":"ariaHasPopup","aria-hidden":"ariaHidden","aria-invalid":"ariaInvalid","aria-keyshortcuts":"ariaKeyShortcuts","aria-label":"ariaLabel","aria-labelledby":"ariaLabelledByElements","aria-level":"ariaLevel","aria-live":"ariaLive","aria-modal":"ariaModal","aria-multiline":"ariaMultiLine","aria-multiselectable":"ariaMultiSelectable","aria-orientation":"ariaOrientation","aria-owns":"ariaOwnsElements","aria-placeholder":"ariaPlaceholder","aria-posinset":"ariaPosInSet","aria-pressed":"ariaPressed","aria-readonly":"ariaReadOnly","aria-required":"ariaRequired","aria-roledescription":"ariaRoleDescription","aria-rowcount":"ariaRowCount","aria-rowindex":"ariaRowIndex","aria-rowindextext":"ariaRowIndexText","aria-rowspan":"ariaRowSpan","aria-selected":"ariaSelected","aria-setsize":"ariaSetSize","aria-sort":"ariaSort","aria-valuemax":"ariaValueMax","aria-valuemin":"ariaValueMin","aria-valuenow":"ariaValueNow","aria-valuetext":"ariaValueText"})),e1=Array.from(T2).reduce((t,[e,n])=>(t.set(e,n),t),new Map),t1=class extends ZJ{constructor(){super(),this._schema=new Map,this._eventSchema=new Map,JJ.forEach(t=>{let e=new Map,n=new Set,[r,i]=t.split("|"),s=i.split(","),[o,a]=r.split("^");o.split(",").forEach(c=>{this._schema.set(c.toLowerCase(),e),this._eventSchema.set(c.toLowerCase(),n)});let l=a&&this._schema.get(a.toLowerCase());if(l){for(let[c,u]of l)e.set(c,u);for(let c of this._eventSchema.get(a.toLowerCase()))n.add(c)}s.forEach(c=>{if(c.length>0)switch(c[0]){case"*":n.add(c.substring(1));break;case"!":e.set(c.substring(1),WJ);break;case"#":e.set(c.substring(1),GJ);break;case"%":e.set(c.substring(1),KJ);break;default:e.set(c,YJ)}})})}hasProperty(t,e,n){if(n.some(r=>r.name===Ex.name))return!0;if(t.indexOf("-")>-1){if(Ox(t)||yx(t))return!1;if(n.some(r=>r.name===bx.name))return!0}return(this._schema.get(t.toLowerCase())||this._schema.get("unknown")).has(e)}hasElement(t,e){return e.some(n=>n.name===Ex.name)||t.indexOf("-")>-1&&(Ox(t)||yx(t)||e.some(n=>n.name===bx.name))?!0:this._schema.has(t.toLowerCase())}securityContext(t,e,n){n&&(e=this.getMappedPropName(e)),t=t.toLowerCase(),e=e.toLowerCase();let r=vx()[t+"|"+e];return r||(r=vx()["*|"+e],r||lc.NONE)}getMappedPropName(t){return T2.get(t)??t}getDefaultComponentElementName(){return"ng-component"}validateProperty(t){return t.toLowerCase().startsWith("on")?{error:!0,msg:`Binding to event property '${t}' is disallowed for security reasons, please use (${t.slice(2)})=... If '${t}' is a directive input, make sure the directive is imported by the current module.`}:{error:!1}}validateAttribute(t){return t.toLowerCase().startsWith("on")?{error:!0,msg:`Binding to event attribute '${t}' is disallowed for security reasons, please use (${t.slice(2)})=...`}:{error:!1}}allKnownElementNames(){return Array.from(this._schema.keys())}allKnownAttributesOfElement(t){let e=this._schema.get(t.toLowerCase())||this._schema.get("unknown");return Array.from(e.keys()).map(n=>e1.get(n)??n)}allKnownEventsOfElement(t){return Array.from(this._eventSchema.get(t.toLowerCase())??[])}normalizeAnimationStyleProperty(t){return qJ(t)}normalizeAnimationStyleValue(t,e,n){let r="",i=n.toString().trim(),s=null;if(n1(t)&&n!==0&&n!=="0")if(typeof n=="number")r="px";else{let o=n.match(/^[+-]?[\d\.]+([a-z]*)$/);o&&o[1].length==0&&(s=`Please provide a CSS unit value for ${e}:${n}`)}return{error:s,value:i+r}}};function n1(t){switch(t){case"width":case"height":case"minWidth":case"minHeight":case"maxWidth":case"maxHeight":case"left":case"top":case"bottom":case"right":case"fontSize":case"outlineWidth":case"outlineOffset":case"paddingTop":case"paddingLeft":case"paddingBottom":case"paddingRight":case"marginTop":case"marginLeft":case"marginBottom":case"marginRight":case"borderRadius":case"borderWidth":case"borderTopWidth":case"borderLeftWidth":case"borderRightWidth":case"borderBottomWidth":case"textIndent":return!0;default:return!1}}var De=class{constructor({closedByChildren:t,implicitNamespacePrefix:e,contentType:n=Mi.PARSABLE_DATA,closedByParent:r=!1,isVoid:i=!1,ignoreFirstLf:s=!1,preventNamespaceInheritance:o=!1,canSelfClose:a=!1}={}){this.closedByChildren={},this.closedByParent=!1,t&&t.length>0&&t.forEach(l=>this.closedByChildren[l]=!0),this.isVoid=i,this.closedByParent=r||i,this.implicitNamespacePrefix=e||null,this.contentType=n,this.ignoreFirstLf=s,this.preventNamespaceInheritance=o,this.canSelfClose=a??i}isClosedByChild(t){return this.isVoid||t.toLowerCase()in this.closedByChildren}getContentType(t){return typeof this.contentType=="object"?(t===void 0?void 0:this.contentType[t])??this.contentType.default:this.contentType}},Tx,Vl;function Ob(t){return Vl||(Tx=new De({canSelfClose:!0}),Vl=Object.assign(Object.create(null),{base:new De({isVoid:!0}),meta:new De({isVoid:!0}),area:new De({isVoid:!0}),embed:new De({isVoid:!0}),link:new De({isVoid:!0}),img:new De({isVoid:!0}),input:new De({isVoid:!0}),param:new De({isVoid:!0}),hr:new De({isVoid:!0}),br:new De({isVoid:!0}),source:new De({isVoid:!0}),track:new De({isVoid:!0}),wbr:new De({isVoid:!0}),p:new De({closedByChildren:["address","article","aside","blockquote","div","dl","fieldset","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","main","nav","ol","p","pre","section","table","ul"],closedByParent:!0}),thead:new De({closedByChildren:["tbody","tfoot"]}),tbody:new De({closedByChildren:["tbody","tfoot"],closedByParent:!0}),tfoot:new De({closedByChildren:["tbody"],closedByParent:!0}),tr:new De({closedByChildren:["tr"],closedByParent:!0}),td:new De({closedByChildren:["td","th"],closedByParent:!0}),th:new De({closedByChildren:["td","th"],closedByParent:!0}),col:new De({isVoid:!0}),svg:new De({implicitNamespacePrefix:"svg"}),foreignObject:new De({implicitNamespacePrefix:"svg",preventNamespaceInheritance:!0}),math:new De({implicitNamespacePrefix:"math"}),li:new De({closedByChildren:["li"],closedByParent:!0}),dt:new De({closedByChildren:["dt","dd"]}),dd:new De({closedByChildren:["dt","dd"],closedByParent:!0}),rb:new De({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),rt:new De({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),rtc:new De({closedByChildren:["rb","rtc","rp"],closedByParent:!0}),rp:new De({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),optgroup:new De({closedByChildren:["optgroup"],closedByParent:!0}),option:new De({closedByChildren:["option","optgroup"],closedByParent:!0}),pre:new De({ignoreFirstLf:!0}),listing:new De({ignoreFirstLf:!0}),style:new De({contentType:Mi.RAW_TEXT}),script:new De({contentType:Mi.RAW_TEXT}),title:new De({contentType:{default:Mi.ESCAPABLE_RAW_TEXT,svg:Mi.PARSABLE_DATA}}),textarea:new De({contentType:Mi.ESCAPABLE_RAW_TEXT,ignoreFirstLf:!0})}),new t1().allKnownElementNames().forEach(e=>{!Vl[e]&&Ld(e)===null&&(Vl[e]=new De({canSelfClose:!1}))})),Vl[t]??Tx}function Dp(t){return t>=9&&t<=32||t==160}function bm(t){return 48<=t&&t<=57}function Eu(t){return t>=97&&t<=122||t>=65&&t<=90}function r1(t){return t>=97&&t<=102||t>=65&&t<=70||bm(t)}function Ap(t){return t===10||t===13}function Sx(t){return 48<=t&&t<=55}function lO(t){return t===39||t===34||t===96}var yb=class S2{constructor(e,n,r,i){this.file=e,this.offset=n,this.line=r,this.col=i}toString(){return this.offset!=null?`${this.file.url}@${this.line}:${this.col}`:this.file.url}moveBy(e){let n=this.file.content,r=n.length,i=this.offset,s=this.line,o=this.col;for(;i>0&&e<0;)if(i--,e++,n.charCodeAt(i)==10){s--;let a=n.substring(0,i-1).lastIndexOf(` `);o=a>0?i-a:i}else o--;for(;i0;){let a=n.charCodeAt(i);i++,e--,a==10?(s++,o=0):o++}return new S2(this.file,i,s,o)}getContext(e,n){let r=this.file.content,i=this.offset;if(i!=null){i>r.length-1&&(i=r.length-1);let s=i,o=0,a=0;for(;o0&&(i--,o++,!(r[i]==` `&&++a==n)););for(o=0,a=0;o]${t.after}")`:this.msg}toString(){let t=this.span.details?`, ${this.span.details}`:"";return`${this.contextualMessage()}: ${this.span.start}${t}`}},ea=class{constructor(t,e){this.sourceSpan=t,this.i18n=e}},i1=class extends ea{constructor(t,e,n,r){super(e,r),this.value=t,this.tokens=n,this.kind="text"}visit(t,e){return t.visitText(this,e)}},s1=class extends ea{constructor(t,e,n,r){super(e,r),this.value=t,this.tokens=n,this.kind="cdata"}visit(t,e){return t.visitCdata(this,e)}},o1=class extends ea{constructor(t,e,n,r,i,s){super(r,s),this.switchValue=t,this.type=e,this.cases=n,this.switchValueSourceSpan=i,this.kind="expansion"}visit(t,e){return t.visitExpansion(this,e)}},a1=class{constructor(t,e,n,r,i){this.value=t,this.expression=e,this.sourceSpan=n,this.valueSourceSpan=r,this.expSourceSpan=i,this.kind="expansionCase"}visit(t,e){return t.visitExpansionCase(this,e)}},l1=class extends ea{constructor(t,e,n,r,i,s,o){super(n,o),this.name=t,this.value=e,this.keySpan=r,this.valueSpan=i,this.valueTokens=s,this.kind="attribute"}visit(t,e){return t.visitAttribute(this,e)}get nameSpan(){return this.keySpan}},ho=class extends ea{constructor(t,e,n,r,i,s,o,a=null,l=null,c,u){super(s,u),this.name=t,this.attrs=e,this.directives=n,this.children=r,this.isSelfClosing=i,this.startSourceSpan=o,this.endSourceSpan=a,this.nameSpan=l,this.isVoid=c,this.kind="element"}visit(t,e){return t.visitElement(this,e)}},c1=class{constructor(t,e){this.value=t,this.sourceSpan=e,this.kind="comment"}visit(t,e){return t.visitComment(this,e)}},u1=class{constructor(t,e){this.value=t,this.sourceSpan=e,this.kind="docType"}visit(t,e){return t.visitDocType(this,e)}},pa=class extends ea{constructor(t,e,n,r,i,s,o=null,a){super(r,a),this.name=t,this.parameters=e,this.children=n,this.nameSpan=i,this.startSourceSpan=s,this.endSourceSpan=o,this.kind="block"}visit(t,e){return t.visitBlock(this,e)}},hs=class extends ea{constructor(t,e,n,r,i,s,o,a,l,c=null,u){super(a,u),this.componentName=t,this.tagName=e,this.fullName=n,this.attrs=r,this.directives=i,this.children=s,this.isSelfClosing=o,this.startSourceSpan=l,this.endSourceSpan=c,this.kind="component"}visit(t,e){return t.visitComponent(this,e)}},h1=class{constructor(t,e,n,r,i=null){this.name=t,this.attrs=e,this.sourceSpan=n,this.startSourceSpan=r,this.endSourceSpan=i,this.kind="directive"}visit(t,e){return t.visitDirective(this,e)}},kx=class{constructor(t,e){this.expression=t,this.sourceSpan=e,this.kind="blockParameter",this.startSourceSpan=null,this.endSourceSpan=null}visit(t,e){return t.visitBlockParameter(this,e)}},_x=class{constructor(t,e,n,r,i){this.name=t,this.value=e,this.sourceSpan=n,this.nameSpan=r,this.valueSpan=i,this.kind="letDeclaration",this.startSourceSpan=null,this.endSourceSpan=null}visit(t,e){return t.visitLetDeclaration(this,e)}};function k2(t,e,n=null){let r=[],i=t.visit?s=>t.visit(s,n)||s.visit(t,n):s=>s.visit(t,n);return e.forEach(s=>{let o=i(s);o&&r.push(o)}),r}var d1=class{constructor(){}visitElement(t,e){this.visitChildren(e,n=>{n(t.attrs),n(t.directives),n(t.children)})}visitAttribute(t,e){}visitText(t,e){}visitCdata(t,e){}visitComment(t,e){}visitDocType(t,e){}visitExpansion(t,e){return this.visitChildren(e,n=>{n(t.cases)})}visitExpansionCase(t,e){}visitBlock(t,e){this.visitChildren(e,n=>{n(t.parameters),n(t.children)})}visitBlockParameter(t,e){}visitLetDeclaration(t,e){}visitComponent(t,e){this.visitChildren(e,n=>{n(t.attrs),n(t.children)})}visitDirective(t,e){this.visitChildren(e,n=>{n(t.attrs)})}visitChildren(t,e){let n=[],r=this;function i(s){s&&n.push(k2(r,s,t))}return e(i),Array.prototype.concat.apply([],n)}},vu={AElig:"Æ",AMP:"&",amp:"&",Aacute:"Á",Abreve:"Ă",Acirc:"Â",Acy:"А",Afr:"𝔄",Agrave:"À",Alpha:"Α",Amacr:"Ā",And:"⩓",Aogon:"Ą",Aopf:"𝔸",ApplyFunction:"⁡",af:"⁡",Aring:"Å",angst:"Å",Ascr:"𝒜",Assign:"≔",colone:"≔",coloneq:"≔",Atilde:"Ã",Auml:"Ä",Backslash:"∖",setminus:"∖",setmn:"∖",smallsetminus:"∖",ssetmn:"∖",Barv:"⫧",Barwed:"⌆",doublebarwedge:"⌆",Bcy:"Б",Because:"∵",becaus:"∵",because:"∵",Bernoullis:"ℬ",Bscr:"ℬ",bernou:"ℬ",Beta:"Β",Bfr:"𝔅",Bopf:"𝔹",Breve:"˘",breve:"˘",Bumpeq:"≎",HumpDownHump:"≎",bump:"≎",CHcy:"Ч",COPY:"©",copy:"©",Cacute:"Ć",Cap:"⋒",CapitalDifferentialD:"ⅅ",DD:"ⅅ",Cayleys:"ℭ",Cfr:"ℭ",Ccaron:"Č",Ccedil:"Ç",Ccirc:"Ĉ",Cconint:"∰",Cdot:"Ċ",Cedilla:"¸",cedil:"¸",CenterDot:"·",centerdot:"·",middot:"·",Chi:"Χ",CircleDot:"⊙",odot:"⊙",CircleMinus:"⊖",ominus:"⊖",CirclePlus:"⊕",oplus:"⊕",CircleTimes:"⊗",otimes:"⊗",ClockwiseContourIntegral:"∲",cwconint:"∲",CloseCurlyDoubleQuote:"”",rdquo:"”",rdquor:"”",CloseCurlyQuote:"’",rsquo:"’",rsquor:"’",Colon:"∷",Proportion:"∷",Colone:"⩴",Congruent:"≡",equiv:"≡",Conint:"∯",DoubleContourIntegral:"∯",ContourIntegral:"∮",conint:"∮",oint:"∮",Copf:"ℂ",complexes:"ℂ",Coproduct:"∐",coprod:"∐",CounterClockwiseContourIntegral:"∳",awconint:"∳",Cross:"⨯",Cscr:"𝒞",Cup:"⋓",CupCap:"≍",asympeq:"≍",DDotrahd:"⤑",DJcy:"Ђ",DScy:"Ѕ",DZcy:"Џ",Dagger:"‡",ddagger:"‡",Darr:"↡",Dashv:"⫤",DoubleLeftTee:"⫤",Dcaron:"Ď",Dcy:"Д",Del:"∇",nabla:"∇",Delta:"Δ",Dfr:"𝔇",DiacriticalAcute:"´",acute:"´",DiacriticalDot:"˙",dot:"˙",DiacriticalDoubleAcute:"˝",dblac:"˝",DiacriticalGrave:"`",grave:"`",DiacriticalTilde:"˜",tilde:"˜",Diamond:"⋄",diam:"⋄",diamond:"⋄",DifferentialD:"ⅆ",dd:"ⅆ",Dopf:"𝔻",Dot:"¨",DoubleDot:"¨",die:"¨",uml:"¨",DotDot:"⃜",DotEqual:"≐",doteq:"≐",esdot:"≐",DoubleDownArrow:"⇓",Downarrow:"⇓",dArr:"⇓",DoubleLeftArrow:"⇐",Leftarrow:"⇐",lArr:"⇐",DoubleLeftRightArrow:"⇔",Leftrightarrow:"⇔",hArr:"⇔",iff:"⇔",DoubleLongLeftArrow:"⟸",Longleftarrow:"⟸",xlArr:"⟸",DoubleLongLeftRightArrow:"⟺",Longleftrightarrow:"⟺",xhArr:"⟺",DoubleLongRightArrow:"⟹",Longrightarrow:"⟹",xrArr:"⟹",DoubleRightArrow:"⇒",Implies:"⇒",Rightarrow:"⇒",rArr:"⇒",DoubleRightTee:"⊨",vDash:"⊨",DoubleUpArrow:"⇑",Uparrow:"⇑",uArr:"⇑",DoubleUpDownArrow:"⇕",Updownarrow:"⇕",vArr:"⇕",DoubleVerticalBar:"∥",par:"∥",parallel:"∥",shortparallel:"∥",spar:"∥",DownArrow:"↓",ShortDownArrow:"↓",darr:"↓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",duarr:"⇵",DownBreve:"̑",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",leftharpoondown:"↽",lhard:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",rhard:"⇁",rightharpoondown:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",top:"⊤",DownTeeArrow:"↧",mapstodown:"↧",Dscr:"𝒟",Dstrok:"Đ",ENG:"Ŋ",ETH:"Ð",Eacute:"É",Ecaron:"Ě",Ecirc:"Ê",Ecy:"Э",Edot:"Ė",Efr:"𝔈",Egrave:"È",Element:"∈",in:"∈",isin:"∈",isinv:"∈",Emacr:"Ē",EmptySmallSquare:"◻",EmptyVerySmallSquare:"▫",Eogon:"Ę",Eopf:"𝔼",Epsilon:"Ε",Equal:"⩵",EqualTilde:"≂",eqsim:"≂",esim:"≂",Equilibrium:"⇌",rightleftharpoons:"⇌",rlhar:"⇌",Escr:"ℰ",expectation:"ℰ",Esim:"⩳",Eta:"Η",Euml:"Ë",Exists:"∃",exist:"∃",ExponentialE:"ⅇ",ee:"ⅇ",exponentiale:"ⅇ",Fcy:"Ф",Ffr:"𝔉",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",blacksquare:"▪",squarf:"▪",squf:"▪",Fopf:"𝔽",ForAll:"∀",forall:"∀",Fouriertrf:"ℱ",Fscr:"ℱ",GJcy:"Ѓ",GT:">",gt:">",Gamma:"Γ",Gammad:"Ϝ",Gbreve:"Ğ",Gcedil:"Ģ",Gcirc:"Ĝ",Gcy:"Г",Gdot:"Ġ",Gfr:"𝔊",Gg:"⋙",ggg:"⋙",Gopf:"𝔾",GreaterEqual:"≥",ge:"≥",geq:"≥",GreaterEqualLess:"⋛",gel:"⋛",gtreqless:"⋛",GreaterFullEqual:"≧",gE:"≧",geqq:"≧",GreaterGreater:"⪢",GreaterLess:"≷",gl:"≷",gtrless:"≷",GreaterSlantEqual:"⩾",geqslant:"⩾",ges:"⩾",GreaterTilde:"≳",gsim:"≳",gtrsim:"≳",Gscr:"𝒢",Gt:"≫",NestedGreaterGreater:"≫",gg:"≫",HARDcy:"Ъ",Hacek:"ˇ",caron:"ˇ",Hat:"^",Hcirc:"Ĥ",Hfr:"ℌ",Poincareplane:"ℌ",HilbertSpace:"ℋ",Hscr:"ℋ",hamilt:"ℋ",Hopf:"ℍ",quaternions:"ℍ",HorizontalLine:"─",boxh:"─",Hstrok:"Ħ",HumpEqual:"≏",bumpe:"≏",bumpeq:"≏",IEcy:"Е",IJlig:"IJ",IOcy:"Ё",Iacute:"Í",Icirc:"Î",Icy:"И",Idot:"İ",Ifr:"ℑ",Im:"ℑ",image:"ℑ",imagpart:"ℑ",Igrave:"Ì",Imacr:"Ī",ImaginaryI:"ⅈ",ii:"ⅈ",Int:"∬",Integral:"∫",int:"∫",Intersection:"⋂",bigcap:"⋂",xcap:"⋂",InvisibleComma:"⁣",ic:"⁣",InvisibleTimes:"⁢",it:"⁢",Iogon:"Į",Iopf:"𝕀",Iota:"Ι",Iscr:"ℐ",imagline:"ℐ",Itilde:"Ĩ",Iukcy:"І",Iuml:"Ï",Jcirc:"Ĵ",Jcy:"Й",Jfr:"𝔍",Jopf:"𝕁",Jscr:"𝒥",Jsercy:"Ј",Jukcy:"Є",KHcy:"Х",KJcy:"Ќ",Kappa:"Κ",Kcedil:"Ķ",Kcy:"К",Kfr:"𝔎",Kopf:"𝕂",Kscr:"𝒦",LJcy:"Љ",LT:"<",lt:"<",Lacute:"Ĺ",Lambda:"Λ",Lang:"⟪",Laplacetrf:"ℒ",Lscr:"ℒ",lagran:"ℒ",Larr:"↞",twoheadleftarrow:"↞",Lcaron:"Ľ",Lcedil:"Ļ",Lcy:"Л",LeftAngleBracket:"⟨",lang:"⟨",langle:"⟨",LeftArrow:"←",ShortLeftArrow:"←",larr:"←",leftarrow:"←",slarr:"←",LeftArrowBar:"⇤",larrb:"⇤",LeftArrowRightArrow:"⇆",leftrightarrows:"⇆",lrarr:"⇆",LeftCeiling:"⌈",lceil:"⌈",LeftDoubleBracket:"⟦",lobrk:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",dharl:"⇃",downharpoonleft:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",lfloor:"⌊",LeftRightArrow:"↔",harr:"↔",leftrightarrow:"↔",LeftRightVector:"⥎",LeftTee:"⊣",dashv:"⊣",LeftTeeArrow:"↤",mapstoleft:"↤",LeftTeeVector:"⥚",LeftTriangle:"⊲",vartriangleleft:"⊲",vltri:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",ltrie:"⊴",trianglelefteq:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",uharl:"↿",upharpoonleft:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",leftharpoonup:"↼",lharu:"↼",LeftVectorBar:"⥒",LessEqualGreater:"⋚",leg:"⋚",lesseqgtr:"⋚",LessFullEqual:"≦",lE:"≦",leqq:"≦",LessGreater:"≶",lessgtr:"≶",lg:"≶",LessLess:"⪡",LessSlantEqual:"⩽",leqslant:"⩽",les:"⩽",LessTilde:"≲",lesssim:"≲",lsim:"≲",Lfr:"𝔏",Ll:"⋘",Lleftarrow:"⇚",lAarr:"⇚",Lmidot:"Ŀ",LongLeftArrow:"⟵",longleftarrow:"⟵",xlarr:"⟵",LongLeftRightArrow:"⟷",longleftrightarrow:"⟷",xharr:"⟷",LongRightArrow:"⟶",longrightarrow:"⟶",xrarr:"⟶",Lopf:"𝕃",LowerLeftArrow:"↙",swarr:"↙",swarrow:"↙",LowerRightArrow:"↘",searr:"↘",searrow:"↘",Lsh:"↰",lsh:"↰",Lstrok:"Ł",Lt:"≪",NestedLessLess:"≪",ll:"≪",Map:"⤅",Mcy:"М",MediumSpace:" ",Mellintrf:"ℳ",Mscr:"ℳ",phmmat:"ℳ",Mfr:"𝔐",MinusPlus:"∓",mnplus:"∓",mp:"∓",Mopf:"𝕄",Mu:"Μ",NJcy:"Њ",Nacute:"Ń",Ncaron:"Ň",Ncedil:"Ņ",Ncy:"Н",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",ZeroWidthSpace:"​",NewLine:` `,Nfr:"𝔑",NoBreak:"⁠",NonBreakingSpace:" ",nbsp:" ",Nopf:"ℕ",naturals:"ℕ",Not:"⫬",NotCongruent:"≢",nequiv:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",npar:"∦",nparallel:"∦",nshortparallel:"∦",nspar:"∦",NotElement:"∉",notin:"∉",notinva:"∉",NotEqual:"≠",ne:"≠",NotEqualTilde:"≂̸",nesim:"≂̸",NotExists:"∄",nexist:"∄",nexists:"∄",NotGreater:"≯",ngt:"≯",ngtr:"≯",NotGreaterEqual:"≱",nge:"≱",ngeq:"≱",NotGreaterFullEqual:"≧̸",ngE:"≧̸",ngeqq:"≧̸",NotGreaterGreater:"≫̸",nGtv:"≫̸",NotGreaterLess:"≹",ntgl:"≹",NotGreaterSlantEqual:"⩾̸",ngeqslant:"⩾̸",nges:"⩾̸",NotGreaterTilde:"≵",ngsim:"≵",NotHumpDownHump:"≎̸",nbump:"≎̸",NotHumpEqual:"≏̸",nbumpe:"≏̸",NotLeftTriangle:"⋪",nltri:"⋪",ntriangleleft:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",nltrie:"⋬",ntrianglelefteq:"⋬",NotLess:"≮",nless:"≮",nlt:"≮",NotLessEqual:"≰",nle:"≰",nleq:"≰",NotLessGreater:"≸",ntlg:"≸",NotLessLess:"≪̸",nLtv:"≪̸",NotLessSlantEqual:"⩽̸",nleqslant:"⩽̸",nles:"⩽̸",NotLessTilde:"≴",nlsim:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",NotPrecedes:"⊀",npr:"⊀",nprec:"⊀",NotPrecedesEqual:"⪯̸",npre:"⪯̸",npreceq:"⪯̸",NotPrecedesSlantEqual:"⋠",nprcue:"⋠",NotReverseElement:"∌",notni:"∌",notniva:"∌",NotRightTriangle:"⋫",nrtri:"⋫",ntriangleright:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",nrtrie:"⋭",ntrianglerighteq:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",nsqsube:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",nsqsupe:"⋣",NotSubset:"⊂⃒",nsubset:"⊂⃒",vnsub:"⊂⃒",NotSubsetEqual:"⊈",nsube:"⊈",nsubseteq:"⊈",NotSucceeds:"⊁",nsc:"⊁",nsucc:"⊁",NotSucceedsEqual:"⪰̸",nsce:"⪰̸",nsucceq:"⪰̸",NotSucceedsSlantEqual:"⋡",nsccue:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",nsupset:"⊃⃒",vnsup:"⊃⃒",NotSupersetEqual:"⊉",nsupe:"⊉",nsupseteq:"⊉",NotTilde:"≁",nsim:"≁",NotTildeEqual:"≄",nsime:"≄",nsimeq:"≄",NotTildeFullEqual:"≇",ncong:"≇",NotTildeTilde:"≉",nap:"≉",napprox:"≉",NotVerticalBar:"∤",nmid:"∤",nshortmid:"∤",nsmid:"∤",Nscr:"𝒩",Ntilde:"Ñ",Nu:"Ν",OElig:"Œ",Oacute:"Ó",Ocirc:"Ô",Ocy:"О",Odblac:"Ő",Ofr:"𝔒",Ograve:"Ò",Omacr:"Ō",Omega:"Ω",ohm:"Ω",Omicron:"Ο",Oopf:"𝕆",OpenCurlyDoubleQuote:"“",ldquo:"“",OpenCurlyQuote:"‘",lsquo:"‘",Or:"⩔",Oscr:"𝒪",Oslash:"Ø",Otilde:"Õ",Otimes:"⨷",Ouml:"Ö",OverBar:"‾",oline:"‾",OverBrace:"⏞",OverBracket:"⎴",tbrk:"⎴",OverParenthesis:"⏜",PartialD:"∂",part:"∂",Pcy:"П",Pfr:"𝔓",Phi:"Φ",Pi:"Π",PlusMinus:"±",plusmn:"±",pm:"±",Popf:"ℙ",primes:"ℙ",Pr:"⪻",Precedes:"≺",pr:"≺",prec:"≺",PrecedesEqual:"⪯",pre:"⪯",preceq:"⪯",PrecedesSlantEqual:"≼",prcue:"≼",preccurlyeq:"≼",PrecedesTilde:"≾",precsim:"≾",prsim:"≾",Prime:"″",Product:"∏",prod:"∏",Proportional:"∝",prop:"∝",propto:"∝",varpropto:"∝",vprop:"∝",Pscr:"𝒫",Psi:"Ψ",QUOT:'"',quot:'"',Qfr:"𝔔",Qopf:"ℚ",rationals:"ℚ",Qscr:"𝒬",RBarr:"⤐",drbkarow:"⤐",REG:"®",circledR:"®",reg:"®",Racute:"Ŕ",Rang:"⟫",Rarr:"↠",twoheadrightarrow:"↠",Rarrtl:"⤖",Rcaron:"Ř",Rcedil:"Ŗ",Rcy:"Р",Re:"ℜ",Rfr:"ℜ",real:"ℜ",realpart:"ℜ",ReverseElement:"∋",SuchThat:"∋",ni:"∋",niv:"∋",ReverseEquilibrium:"⇋",leftrightharpoons:"⇋",lrhar:"⇋",ReverseUpEquilibrium:"⥯",duhar:"⥯",Rho:"Ρ",RightAngleBracket:"⟩",rang:"⟩",rangle:"⟩",RightArrow:"→",ShortRightArrow:"→",rarr:"→",rightarrow:"→",srarr:"→",RightArrowBar:"⇥",rarrb:"⇥",RightArrowLeftArrow:"⇄",rightleftarrows:"⇄",rlarr:"⇄",RightCeiling:"⌉",rceil:"⌉",RightDoubleBracket:"⟧",robrk:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",dharr:"⇂",downharpoonright:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rfloor:"⌋",RightTee:"⊢",vdash:"⊢",RightTeeArrow:"↦",map:"↦",mapsto:"↦",RightTeeVector:"⥛",RightTriangle:"⊳",vartriangleright:"⊳",vrtri:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",rtrie:"⊵",trianglerighteq:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",uharr:"↾",upharpoonright:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",rharu:"⇀",rightharpoonup:"⇀",RightVectorBar:"⥓",Ropf:"ℝ",reals:"ℝ",RoundImplies:"⥰",Rrightarrow:"⇛",rAarr:"⇛",Rscr:"ℛ",realine:"ℛ",Rsh:"↱",rsh:"↱",RuleDelayed:"⧴",SHCHcy:"Щ",SHcy:"Ш",SOFTcy:"Ь",Sacute:"Ś",Sc:"⪼",Scaron:"Š",Scedil:"Ş",Scirc:"Ŝ",Scy:"С",Sfr:"𝔖",ShortUpArrow:"↑",UpArrow:"↑",uarr:"↑",uparrow:"↑",Sigma:"Σ",SmallCircle:"∘",compfn:"∘",Sopf:"𝕊",Sqrt:"√",radic:"√",Square:"□",squ:"□",square:"□",SquareIntersection:"⊓",sqcap:"⊓",SquareSubset:"⊏",sqsub:"⊏",sqsubset:"⊏",SquareSubsetEqual:"⊑",sqsube:"⊑",sqsubseteq:"⊑",SquareSuperset:"⊐",sqsup:"⊐",sqsupset:"⊐",SquareSupersetEqual:"⊒",sqsupe:"⊒",sqsupseteq:"⊒",SquareUnion:"⊔",sqcup:"⊔",Sscr:"𝒮",Star:"⋆",sstarf:"⋆",Sub:"⋐",Subset:"⋐",SubsetEqual:"⊆",sube:"⊆",subseteq:"⊆",Succeeds:"≻",sc:"≻",succ:"≻",SucceedsEqual:"⪰",sce:"⪰",succeq:"⪰",SucceedsSlantEqual:"≽",sccue:"≽",succcurlyeq:"≽",SucceedsTilde:"≿",scsim:"≿",succsim:"≿",Sum:"∑",sum:"∑",Sup:"⋑",Supset:"⋑",Superset:"⊃",sup:"⊃",supset:"⊃",SupersetEqual:"⊇",supe:"⊇",supseteq:"⊇",THORN:"Þ",TRADE:"™",trade:"™",TSHcy:"Ћ",TScy:"Ц",Tab:" ",Tau:"Τ",Tcaron:"Ť",Tcedil:"Ţ",Tcy:"Т",Tfr:"𝔗",Therefore:"∴",there4:"∴",therefore:"∴",Theta:"Θ",ThickSpace:"  ",ThinSpace:" ",thinsp:" ",Tilde:"∼",sim:"∼",thicksim:"∼",thksim:"∼",TildeEqual:"≃",sime:"≃",simeq:"≃",TildeFullEqual:"≅",cong:"≅",TildeTilde:"≈",ap:"≈",approx:"≈",asymp:"≈",thickapprox:"≈",thkap:"≈",Topf:"𝕋",TripleDot:"⃛",tdot:"⃛",Tscr:"𝒯",Tstrok:"Ŧ",Uacute:"Ú",Uarr:"↟",Uarrocir:"⥉",Ubrcy:"Ў",Ubreve:"Ŭ",Ucirc:"Û",Ucy:"У",Udblac:"Ű",Ufr:"𝔘",Ugrave:"Ù",Umacr:"Ū",UnderBar:"_",lowbar:"_",UnderBrace:"⏟",UnderBracket:"⎵",bbrk:"⎵",UnderParenthesis:"⏝",Union:"⋃",bigcup:"⋃",xcup:"⋃",UnionPlus:"⊎",uplus:"⊎",Uogon:"Ų",Uopf:"𝕌",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",udarr:"⇅",UpDownArrow:"↕",updownarrow:"↕",varr:"↕",UpEquilibrium:"⥮",udhar:"⥮",UpTee:"⊥",bot:"⊥",bottom:"⊥",perp:"⊥",UpTeeArrow:"↥",mapstoup:"↥",UpperLeftArrow:"↖",nwarr:"↖",nwarrow:"↖",UpperRightArrow:"↗",nearr:"↗",nearrow:"↗",Upsi:"ϒ",upsih:"ϒ",Upsilon:"Υ",Uring:"Ů",Uscr:"𝒰",Utilde:"Ũ",Uuml:"Ü",VDash:"⊫",Vbar:"⫫",Vcy:"В",Vdash:"⊩",Vdashl:"⫦",Vee:"⋁",bigvee:"⋁",xvee:"⋁",Verbar:"‖",Vert:"‖",VerticalBar:"∣",mid:"∣",shortmid:"∣",smid:"∣",VerticalLine:"|",verbar:"|",vert:"|",VerticalSeparator:"❘",VerticalTilde:"≀",wr:"≀",wreath:"≀",VeryThinSpace:" ",hairsp:" ",Vfr:"𝔙",Vopf:"𝕍",Vscr:"𝒱",Vvdash:"⊪",Wcirc:"Ŵ",Wedge:"⋀",bigwedge:"⋀",xwedge:"⋀",Wfr:"𝔚",Wopf:"𝕎",Wscr:"𝒲",Xfr:"𝔛",Xi:"Ξ",Xopf:"𝕏",Xscr:"𝒳",YAcy:"Я",YIcy:"Ї",YUcy:"Ю",Yacute:"Ý",Ycirc:"Ŷ",Ycy:"Ы",Yfr:"𝔜",Yopf:"𝕐",Yscr:"𝒴",Yuml:"Ÿ",ZHcy:"Ж",Zacute:"Ź",Zcaron:"Ž",Zcy:"З",Zdot:"Ż",Zeta:"Ζ",Zfr:"ℨ",zeetrf:"ℨ",Zopf:"ℤ",integers:"ℤ",Zscr:"𝒵",aacute:"á",abreve:"ă",ac:"∾",mstpos:"∾",acE:"∾̳",acd:"∿",acirc:"â",acy:"а",aelig:"æ",afr:"𝔞",agrave:"à",alefsym:"ℵ",aleph:"ℵ",alpha:"α",amacr:"ā",amalg:"⨿",and:"∧",wedge:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",angle:"∠",ange:"⦤",angmsd:"∡",measuredangle:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angzarr:"⍼",aogon:"ą",aopf:"𝕒",apE:"⩰",apacir:"⩯",ape:"≊",approxeq:"≊",apid:"≋",apos:"'",aring:"å",ascr:"𝒶",ast:"*",midast:"*",atilde:"ã",auml:"ä",awint:"⨑",bNot:"⫭",backcong:"≌",bcong:"≌",backepsilon:"϶",bepsi:"϶",backprime:"‵",bprime:"‵",backsim:"∽",bsim:"∽",backsimeq:"⋍",bsime:"⋍",barvee:"⊽",barwed:"⌅",barwedge:"⌅",bbrktbrk:"⎶",bcy:"б",bdquo:"„",ldquor:"„",bemptyv:"⦰",beta:"β",beth:"ℶ",between:"≬",twixt:"≬",bfr:"𝔟",bigcirc:"◯",xcirc:"◯",bigodot:"⨀",xodot:"⨀",bigoplus:"⨁",xoplus:"⨁",bigotimes:"⨂",xotime:"⨂",bigsqcup:"⨆",xsqcup:"⨆",bigstar:"★",starf:"★",bigtriangledown:"▽",xdtri:"▽",bigtriangleup:"△",xutri:"△",biguplus:"⨄",xuplus:"⨄",bkarow:"⤍",rbarr:"⤍",blacklozenge:"⧫",lozf:"⧫",blacktriangle:"▴",utrif:"▴",blacktriangledown:"▾",dtrif:"▾",blacktriangleleft:"◂",ltrif:"◂",blacktriangleright:"▸",rtrif:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bnot:"⌐",bopf:"𝕓",bowtie:"⋈",boxDL:"╗",boxDR:"╔",boxDl:"╖",boxDr:"╓",boxH:"═",boxHD:"╦",boxHU:"╩",boxHd:"╤",boxHu:"╧",boxUL:"╝",boxUR:"╚",boxUl:"╜",boxUr:"╙",boxV:"║",boxVH:"╬",boxVL:"╣",boxVR:"╠",boxVh:"╫",boxVl:"╢",boxVr:"╟",boxbox:"⧉",boxdL:"╕",boxdR:"╒",boxdl:"┐",boxdr:"┌",boxhD:"╥",boxhU:"╨",boxhd:"┬",boxhu:"┴",boxminus:"⊟",minusb:"⊟",boxplus:"⊞",plusb:"⊞",boxtimes:"⊠",timesb:"⊠",boxuL:"╛",boxuR:"╘",boxul:"┘",boxur:"└",boxv:"│",boxvH:"╪",boxvL:"╡",boxvR:"╞",boxvh:"┼",boxvl:"┤",boxvr:"├",brvbar:"¦",bscr:"𝒷",bsemi:"⁏",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bumpE:"⪮",cacute:"ć",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",caps:"∩︀",caret:"⁁",ccaps:"⩍",ccaron:"č",ccedil:"ç",ccirc:"ĉ",ccups:"⩌",ccupssm:"⩐",cdot:"ċ",cemptyv:"⦲",cent:"¢",cfr:"𝔠",chcy:"ч",check:"✓",checkmark:"✓",chi:"χ",cir:"○",cirE:"⧃",circ:"ˆ",circeq:"≗",cire:"≗",circlearrowleft:"↺",olarr:"↺",circlearrowright:"↻",orarr:"↻",circledS:"Ⓢ",oS:"Ⓢ",circledast:"⊛",oast:"⊛",circledcirc:"⊚",ocir:"⊚",circleddash:"⊝",odash:"⊝",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",clubs:"♣",clubsuit:"♣",colon:":",comma:",",commat:"@",comp:"∁",complement:"∁",congdot:"⩭",copf:"𝕔",copysr:"℗",crarr:"↵",cross:"✗",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",curlyeqprec:"⋞",cuesc:"⋟",curlyeqsucc:"⋟",cularr:"↶",curvearrowleft:"↶",cularrp:"⤽",cup:"∪",cupbrcap:"⩈",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curvearrowright:"↷",curarrm:"⤼",curlyvee:"⋎",cuvee:"⋎",curlywedge:"⋏",cuwed:"⋏",curren:"¤",cwint:"∱",cylcty:"⌭",dHar:"⥥",dagger:"†",daleth:"ℸ",dash:"‐",hyphen:"‐",dbkarow:"⤏",rBarr:"⤏",dcaron:"ď",dcy:"д",ddarr:"⇊",downdownarrows:"⇊",ddotseq:"⩷",eDDot:"⩷",deg:"°",delta:"δ",demptyv:"⦱",dfisht:"⥿",dfr:"𝔡",diamondsuit:"♦",diams:"♦",digamma:"ϝ",gammad:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",djcy:"ђ",dlcorn:"⌞",llcorner:"⌞",dlcrop:"⌍",dollar:"$",dopf:"𝕕",doteqdot:"≑",eDot:"≑",dotminus:"∸",minusd:"∸",dotplus:"∔",plusdo:"∔",dotsquare:"⊡",sdotb:"⊡",drcorn:"⌟",lrcorner:"⌟",drcrop:"⌌",dscr:"𝒹",dscy:"ѕ",dsol:"⧶",dstrok:"đ",dtdot:"⋱",dtri:"▿",triangledown:"▿",dwangle:"⦦",dzcy:"џ",dzigrarr:"⟿",eacute:"é",easter:"⩮",ecaron:"ě",ecir:"≖",eqcirc:"≖",ecirc:"ê",ecolon:"≕",eqcolon:"≕",ecy:"э",edot:"ė",efDot:"≒",fallingdotseq:"≒",efr:"𝔢",eg:"⪚",egrave:"è",egs:"⪖",eqslantgtr:"⪖",egsdot:"⪘",el:"⪙",elinters:"⏧",ell:"ℓ",els:"⪕",eqslantless:"⪕",elsdot:"⪗",emacr:"ē",empty:"∅",emptyset:"∅",emptyv:"∅",varnothing:"∅",emsp13:" ",emsp14:" ",emsp:" ",eng:"ŋ",ensp:" ",eogon:"ę",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",epsilon:"ε",epsiv:"ϵ",straightepsilon:"ϵ",varepsilon:"ϵ",equals:"=",equest:"≟",questeq:"≟",equivDD:"⩸",eqvparsl:"⧥",erDot:"≓",risingdotseq:"≓",erarr:"⥱",escr:"ℯ",eta:"η",eth:"ð",euml:"ë",euro:"€",excl:"!",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",ffr:"𝔣",filig:"fi",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",fopf:"𝕗",fork:"⋔",pitchfork:"⋔",forkv:"⫙",fpartint:"⨍",frac12:"½",half:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",sfrown:"⌢",fscr:"𝒻",gEl:"⪌",gtreqqless:"⪌",gacute:"ǵ",gamma:"γ",gap:"⪆",gtrapprox:"⪆",gbreve:"ğ",gcirc:"ĝ",gcy:"г",gdot:"ġ",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",gfr:"𝔤",gimel:"ℷ",gjcy:"ѓ",glE:"⪒",gla:"⪥",glj:"⪤",gnE:"≩",gneqq:"≩",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gneq:"⪈",gnsim:"⋧",gopf:"𝕘",gscr:"ℊ",gsime:"⪎",gsiml:"⪐",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtrdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrarr:"⥸",gvertneqq:"≩︀",gvnE:"≩︀",hardcy:"ъ",harrcir:"⥈",harrw:"↭",leftrightsquigarrow:"↭",hbar:"ℏ",hslash:"ℏ",planck:"ℏ",plankv:"ℏ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",mldr:"…",hercon:"⊹",hfr:"𝔥",hksearow:"⤥",searhk:"⤥",hkswarow:"⤦",swarhk:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",larrhk:"↩",hookrightarrow:"↪",rarrhk:"↪",hopf:"𝕙",horbar:"―",hscr:"𝒽",hstrok:"ħ",hybull:"⁃",iacute:"í",icirc:"î",icy:"и",iecy:"е",iexcl:"¡",ifr:"𝔦",igrave:"ì",iiiint:"⨌",qint:"⨌",iiint:"∭",tint:"∭",iinfin:"⧜",iiota:"℩",ijlig:"ij",imacr:"ī",imath:"ı",inodot:"ı",imof:"⊷",imped:"Ƶ",incare:"℅",infin:"∞",infintie:"⧝",intcal:"⊺",intercal:"⊺",intlarhk:"⨗",intprod:"⨼",iprod:"⨼",iocy:"ё",iogon:"į",iopf:"𝕚",iota:"ι",iquest:"¿",iscr:"𝒾",isinE:"⋹",isindot:"⋵",isins:"⋴",isinsv:"⋳",itilde:"ĩ",iukcy:"і",iuml:"ï",jcirc:"ĵ",jcy:"й",jfr:"𝔧",jmath:"ȷ",jopf:"𝕛",jscr:"𝒿",jsercy:"ј",jukcy:"є",kappa:"κ",kappav:"ϰ",varkappa:"ϰ",kcedil:"ķ",kcy:"к",kfr:"𝔨",kgreen:"ĸ",khcy:"х",kjcy:"ќ",kopf:"𝕜",kscr:"𝓀",lAtail:"⤛",lBarr:"⤎",lEg:"⪋",lesseqqgtr:"⪋",lHar:"⥢",lacute:"ĺ",laemptyv:"⦴",lambda:"λ",langd:"⦑",lap:"⪅",lessapprox:"⪅",laquo:"«",larrbfs:"⤟",larrfs:"⤝",larrlp:"↫",looparrowleft:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",leftarrowtail:"↢",lat:"⪫",latail:"⤙",late:"⪭",lates:"⪭︀",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lcub:"{",lbrack:"[",lsqb:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",lcaron:"ľ",lcedil:"ļ",lcy:"л",ldca:"⤶",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",leq:"≤",leftleftarrows:"⇇",llarr:"⇇",leftthreetimes:"⋋",lthree:"⋋",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessdot:"⋖",ltdot:"⋖",lfisht:"⥼",lfr:"𝔩",lgE:"⪑",lharul:"⥪",lhblk:"▄",ljcy:"љ",llhard:"⥫",lltri:"◺",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnE:"≨",lneqq:"≨",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lneq:"⪇",lnsim:"⋦",loang:"⟬",loarr:"⇽",longmapsto:"⟼",xmap:"⟼",looparrowright:"↬",rarrlp:"↬",lopar:"⦅",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",loz:"◊",lozenge:"◊",lpar:"(",lparlt:"⦓",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",lsime:"⪍",lsimg:"⪏",lsquor:"‚",sbquo:"‚",lstrok:"ł",ltcc:"⪦",ltcir:"⩹",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltrPar:"⦖",ltri:"◃",triangleleft:"◃",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",mDDot:"∺",macr:"¯",strns:"¯",male:"♂",malt:"✠",maltese:"✠",marker:"▮",mcomma:"⨩",mcy:"м",mdash:"—",mfr:"𝔪",mho:"℧",micro:"µ",midcir:"⫰",minus:"−",minusdu:"⨪",mlcp:"⫛",models:"⊧",mopf:"𝕞",mscr:"𝓂",mu:"μ",multimap:"⊸",mumap:"⊸",nGg:"⋙̸",nGt:"≫⃒",nLeftarrow:"⇍",nlArr:"⇍",nLeftrightarrow:"⇎",nhArr:"⇎",nLl:"⋘̸",nLt:"≪⃒",nRightarrow:"⇏",nrArr:"⇏",nVDash:"⊯",nVdash:"⊮",nacute:"ń",nang:"∠⃒",napE:"⩰̸",napid:"≋̸",napos:"ʼn",natur:"♮",natural:"♮",ncap:"⩃",ncaron:"ň",ncedil:"ņ",ncongdot:"⩭̸",ncup:"⩂",ncy:"н",ndash:"–",neArr:"⇗",nearhk:"⤤",nedot:"≐̸",nesear:"⤨",toea:"⤨",nfr:"𝔫",nharr:"↮",nleftrightarrow:"↮",nhpar:"⫲",nis:"⋼",nisd:"⋺",njcy:"њ",nlE:"≦̸",nleqq:"≦̸",nlarr:"↚",nleftarrow:"↚",nldr:"‥",nopf:"𝕟",not:"¬",notinE:"⋹̸",notindot:"⋵̸",notinvb:"⋷",notinvc:"⋶",notnivb:"⋾",notnivc:"⋽",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",nrarr:"↛",nrightarrow:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nscr:"𝓃",nsub:"⊄",nsubE:"⫅̸",nsubseteqq:"⫅̸",nsup:"⊅",nsupE:"⫆̸",nsupseteqq:"⫆̸",ntilde:"ñ",nu:"ν",num:"#",numero:"№",numsp:" ",nvDash:"⊭",nvHarr:"⤄",nvap:"≍⃒",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwArr:"⇖",nwarhk:"⤣",nwnear:"⤧",oacute:"ó",ocirc:"ô",ocy:"о",odblac:"ő",odiv:"⨸",odsold:"⦼",oelig:"œ",ofcir:"⦿",ofr:"𝔬",ogon:"˛",ograve:"ò",ogt:"⧁",ohbar:"⦵",olcir:"⦾",olcross:"⦻",olt:"⧀",omacr:"ō",omega:"ω",omicron:"ο",omid:"⦶",oopf:"𝕠",opar:"⦷",operp:"⦹",or:"∨",vee:"∨",ord:"⩝",order:"ℴ",orderof:"ℴ",oscr:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oslash:"ø",osol:"⊘",otilde:"õ",otimesas:"⨶",ouml:"ö",ovbar:"⌽",para:"¶",parsim:"⫳",parsl:"⫽",pcy:"п",percnt:"%",period:".",permil:"‰",pertenk:"‱",pfr:"𝔭",phi:"φ",phiv:"ϕ",straightphi:"ϕ",varphi:"ϕ",phone:"☎",pi:"π",piv:"ϖ",varpi:"ϖ",planckh:"ℎ",plus:"+",plusacir:"⨣",pluscir:"⨢",plusdu:"⨥",pluse:"⩲",plussim:"⨦",plustwo:"⨧",pointint:"⨕",popf:"𝕡",pound:"£",prE:"⪳",prap:"⪷",precapprox:"⪷",precnapprox:"⪹",prnap:"⪹",precneqq:"⪵",prnE:"⪵",precnsim:"⋨",prnsim:"⋨",prime:"′",profalar:"⌮",profline:"⌒",profsurf:"⌓",prurel:"⊰",pscr:"𝓅",psi:"ψ",puncsp:" ",qfr:"𝔮",qopf:"𝕢",qprime:"⁗",qscr:"𝓆",quatint:"⨖",quest:"?",rAtail:"⤜",rHar:"⥤",race:"∽̱",racute:"ŕ",raemptyv:"⦳",rangd:"⦒",range:"⦥",raquo:"»",rarrap:"⥵",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrpl:"⥅",rarrsim:"⥴",rarrtl:"↣",rightarrowtail:"↣",rarrw:"↝",rightsquigarrow:"↝",ratail:"⤚",ratio:"∶",rbbrk:"❳",rbrace:"}",rcub:"}",rbrack:"]",rsqb:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",rcaron:"ř",rcedil:"ŗ",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdsh:"↳",rect:"▭",rfisht:"⥽",rfr:"𝔯",rharul:"⥬",rho:"ρ",rhov:"ϱ",varrho:"ϱ",rightrightarrows:"⇉",rrarr:"⇉",rightthreetimes:"⋌",rthree:"⋌",ring:"˚",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",ropar:"⦆",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",rpar:")",rpargt:"⦔",rppolint:"⨒",rsaquo:"›",rscr:"𝓇",rtimes:"⋊",rtri:"▹",triangleright:"▹",rtriltri:"⧎",ruluhar:"⥨",rx:"℞",sacute:"ś",scE:"⪴",scap:"⪸",succapprox:"⪸",scaron:"š",scedil:"ş",scirc:"ŝ",scnE:"⪶",succneqq:"⪶",scnap:"⪺",succnapprox:"⪺",scnsim:"⋩",succnsim:"⋩",scpolint:"⨓",scy:"с",sdot:"⋅",sdote:"⩦",seArr:"⇘",sect:"§",semi:";",seswar:"⤩",tosa:"⤩",sext:"✶",sfr:"𝔰",sharp:"♯",shchcy:"щ",shcy:"ш",shy:"­",sigma:"σ",sigmaf:"ς",sigmav:"ς",varsigma:"ς",simdot:"⩪",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",smashp:"⨳",smeparsl:"⧤",smile:"⌣",ssmile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",sopf:"𝕤",spades:"♠",spadesuit:"♠",sqcaps:"⊓︀",sqcups:"⊔︀",sscr:"𝓈",star:"☆",sub:"⊂",subset:"⊂",subE:"⫅",subseteqq:"⫅",subdot:"⪽",subedot:"⫃",submult:"⫁",subnE:"⫋",subsetneqq:"⫋",subne:"⊊",subsetneq:"⊊",subplus:"⪿",subrarr:"⥹",subsim:"⫇",subsub:"⫕",subsup:"⫓",sung:"♪",sup1:"¹",sup2:"²",sup3:"³",supE:"⫆",supseteqq:"⫆",supdot:"⪾",supdsub:"⫘",supedot:"⫄",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supsetneqq:"⫌",supne:"⊋",supsetneq:"⊋",supplus:"⫀",supsim:"⫈",supsub:"⫔",supsup:"⫖",swArr:"⇙",swnwar:"⤪",szlig:"ß",target:"⌖",tau:"τ",tcaron:"ť",tcedil:"ţ",tcy:"т",telrec:"⌕",tfr:"𝔱",theta:"θ",thetasym:"ϑ",thetav:"ϑ",vartheta:"ϑ",thorn:"þ",times:"×",timesbar:"⨱",timesd:"⨰",topbot:"⌶",topcir:"⫱",topf:"𝕥",topfork:"⫚",tprime:"‴",triangle:"▵",utri:"▵",triangleq:"≜",trie:"≜",tridot:"◬",triminus:"⨺",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",tscr:"𝓉",tscy:"ц",tshcy:"ћ",tstrok:"ŧ",uHar:"⥣",uacute:"ú",ubrcy:"ў",ubreve:"ŭ",ucirc:"û",ucy:"у",udblac:"ű",ufisht:"⥾",ufr:"𝔲",ugrave:"ù",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",umacr:"ū",uogon:"ų",uopf:"𝕦",upsi:"υ",upsilon:"υ",upuparrows:"⇈",uuarr:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",uring:"ů",urtri:"◹",uscr:"𝓊",utdot:"⋰",utilde:"ũ",uuml:"ü",uwangle:"⦧",vBar:"⫨",vBarv:"⫩",vangrt:"⦜",varsubsetneq:"⊊︀",vsubne:"⊊︀",varsubsetneqq:"⫋︀",vsubnE:"⫋︀",varsupsetneq:"⊋︀",vsupne:"⊋︀",varsupsetneqq:"⫌︀",vsupnE:"⫌︀",vcy:"в",veebar:"⊻",veeeq:"≚",vellip:"⋮",vfr:"𝔳",vopf:"𝕧",vscr:"𝓋",vzigzag:"⦚",wcirc:"ŵ",wedbar:"⩟",wedgeq:"≙",weierp:"℘",wp:"℘",wfr:"𝔴",wopf:"𝕨",wscr:"𝓌",xfr:"𝔵",xi:"ξ",xnis:"⋻",xopf:"𝕩",xscr:"𝓍",yacute:"ý",yacy:"я",ycirc:"ŷ",ycy:"ы",yen:"¥",yfr:"𝔶",yicy:"ї",yopf:"𝕪",yscr:"𝓎",yucy:"ю",yuml:"ÿ",zacute:"ź",zcaron:"ž",zcy:"з",zdot:"ż",zeta:"ζ",zfr:"𝔷",zhcy:"ж",zigrarr:"⇝",zopf:"𝕫",zscr:"𝓏",zwj:"‍",zwnj:"‌"},p1="";vu.ngsp=p1;var Q=(function(t){return t[t.TAG_OPEN_START=0]="TAG_OPEN_START",t[t.TAG_OPEN_END=1]="TAG_OPEN_END",t[t.TAG_OPEN_END_VOID=2]="TAG_OPEN_END_VOID",t[t.TAG_CLOSE=3]="TAG_CLOSE",t[t.INCOMPLETE_TAG_OPEN=4]="INCOMPLETE_TAG_OPEN",t[t.TEXT=5]="TEXT",t[t.ESCAPABLE_RAW_TEXT=6]="ESCAPABLE_RAW_TEXT",t[t.RAW_TEXT=7]="RAW_TEXT",t[t.INTERPOLATION=8]="INTERPOLATION",t[t.ENCODED_ENTITY=9]="ENCODED_ENTITY",t[t.COMMENT_START=10]="COMMENT_START",t[t.COMMENT_END=11]="COMMENT_END",t[t.CDATA_START=12]="CDATA_START",t[t.CDATA_END=13]="CDATA_END",t[t.ATTR_NAME=14]="ATTR_NAME",t[t.ATTR_QUOTE=15]="ATTR_QUOTE",t[t.ATTR_VALUE_TEXT=16]="ATTR_VALUE_TEXT",t[t.ATTR_VALUE_INTERPOLATION=17]="ATTR_VALUE_INTERPOLATION",t[t.DOC_TYPE_START=18]="DOC_TYPE_START",t[t.DOC_TYPE_END=19]="DOC_TYPE_END",t[t.EXPANSION_FORM_START=20]="EXPANSION_FORM_START",t[t.EXPANSION_CASE_VALUE=21]="EXPANSION_CASE_VALUE",t[t.EXPANSION_CASE_EXP_START=22]="EXPANSION_CASE_EXP_START",t[t.EXPANSION_CASE_EXP_END=23]="EXPANSION_CASE_EXP_END",t[t.EXPANSION_FORM_END=24]="EXPANSION_FORM_END",t[t.BLOCK_OPEN_START=25]="BLOCK_OPEN_START",t[t.BLOCK_OPEN_END=26]="BLOCK_OPEN_END",t[t.BLOCK_CLOSE=27]="BLOCK_CLOSE",t[t.BLOCK_PARAMETER=28]="BLOCK_PARAMETER",t[t.INCOMPLETE_BLOCK_OPEN=29]="INCOMPLETE_BLOCK_OPEN",t[t.LET_START=30]="LET_START",t[t.LET_VALUE=31]="LET_VALUE",t[t.LET_END=32]="LET_END",t[t.INCOMPLETE_LET=33]="INCOMPLETE_LET",t[t.COMPONENT_OPEN_START=34]="COMPONENT_OPEN_START",t[t.COMPONENT_OPEN_END=35]="COMPONENT_OPEN_END",t[t.COMPONENT_OPEN_END_VOID=36]="COMPONENT_OPEN_END_VOID",t[t.COMPONENT_CLOSE=37]="COMPONENT_CLOSE",t[t.INCOMPLETE_COMPONENT_OPEN=38]="INCOMPLETE_COMPONENT_OPEN",t[t.DIRECTIVE_NAME=39]="DIRECTIVE_NAME",t[t.DIRECTIVE_OPEN=40]="DIRECTIVE_OPEN",t[t.DIRECTIVE_CLOSE=41]="DIRECTIVE_CLOSE",t[t.EOF=42]="EOF",t})({}),f1=class{constructor(t,e,n){this.tokens=t,this.errors=e,this.nonNormalizedIcuExpressions=n}};function m1(t,e,n,r={}){let i=new b1(new w2(t,e),n,r);return i.tokenize(),new f1(_1(i.tokens),i.errors,i.nonNormalizedIcuExpressions)}var g1=/\r\n?/g;function po(t){return`Unexpected character "${t===0?"EOF":String.fromCharCode(t)}"`}function xx(t){return`Unknown entity "${t}" - use the "&#;" or "&#x;" syntax`}function O1(t,e){return`Unable to parse entity "${e}" - ${t} character reference entities must end with ";"`}var bb=(function(t){return t.HEX="hexadecimal",t.DEC="decimal",t})(bb||{}),y1=["@if","@else","@for","@switch","@case","@default","@empty","@defer","@placeholder","@loading","@error"],Ul={start:"{{",end:"}}"},b1=class{constructor(t,e,n){this._getTagContentType=e,this._currentTokenStart=null,this._currentTokenType=null,this._expansionCaseStack=[],this._openDirectiveCount=0,this._inInterpolation=!1,this._fullNameStack=[],this.tokens=[],this.errors=[],this.nonNormalizedIcuExpressions=[],this._tokenizeIcu=n.tokenizeExpansionForms||!1,this._leadingTriviaCodePoints=n.leadingTriviaChars&&n.leadingTriviaChars.map(i=>i.codePointAt(0)||0),this._canSelfClose=n.canSelfClose||!1,this._allowHtmComponentClosingTags=n.allowHtmComponentClosingTags||!1;let r=n.range||{endPos:t.content.length,startPos:0,startLine:0,startCol:0};this._cursor=n.escapedString?new x1(t,r):new _2(t,r),this._preserveLineEndings=n.preserveLineEndings||!1,this._i18nNormalizeLineEndingsInICUs=n.i18nNormalizeLineEndingsInICUs||!1,this._tokenizeBlocks=n.tokenizeBlocks??!0,this._tokenizeLet=n.tokenizeLet??!0,this._selectorlessEnabled=n.selectorlessEnabled??!1;try{this._cursor.init()}catch(i){this.handleError(i)}}_processCarriageReturns(t){return this._preserveLineEndings?t:t.replace(g1,` `)}tokenize(){for(;this._cursor.peek()!==0;){let t=this._cursor.clone();try{if(this._attemptCharCode(60))if(this._attemptCharCode(33))this._attemptStr("[CDATA[")?this._consumeCdata(t):this._attemptStr("--")?this._consumeComment(t):this._attemptStrCaseInsensitive("doctype")?this._consumeDocType(t):this._consumeBogusComment(t);else if(this._attemptCharCode(47))this._consumeTagClose(t);else{let e=this._cursor.clone();this._attemptCharCode(63)?(this._cursor=e,this._consumeBogusComment(t)):this._consumeTagOpen(t)}else this._tokenizeLet&&this._cursor.peek()===64&&!this._inInterpolation&&this._isLetStart()?this._consumeLetDeclaration(t):this._tokenizeBlocks&&this._isBlockStart()?this._consumeBlockStart(t):this._tokenizeBlocks&&!this._inInterpolation&&!this._isInExpansionCase()&&!this._isInExpansionForm()&&this._attemptCharCode(125)?this._consumeBlockEnd(t):this._tokenizeIcu&&this._tokenizeExpansionForm()||this._consumeWithInterpolation(Q.TEXT,Q.INTERPOLATION,()=>this._isTextEnd(),()=>this._isTagStart())}catch(e){this.handleError(e)}}this._beginToken(Q.EOF),this._endToken([])}_getBlockName(){let t=!1,e=this._cursor.clone();return this._attemptCharCodeUntilFn(n=>Dp(n)?!t:k1(n)?(t=!0,!1):!0),this._cursor.getChars(e).trim()}_consumeBlockStart(t){this._requireCharCode(64),this._beginToken(Q.BLOCK_OPEN_START,t);let e=this._endToken([this._getBlockName()]);if(this._cursor.peek()===40)if(this._cursor.advance(),this._consumeBlockParameters(),this._attemptCharCodeUntilFn(at),this._attemptCharCode(41))this._attemptCharCodeUntilFn(at);else{e.type=Q.INCOMPLETE_BLOCK_OPEN;return}this._attemptCharCode(123)?(this._beginToken(Q.BLOCK_OPEN_END),this._endToken([])):e.type=Q.INCOMPLETE_BLOCK_OPEN}_consumeBlockEnd(t){this._beginToken(Q.BLOCK_CLOSE,t),this._endToken([])}_consumeBlockParameters(){for(this._attemptCharCodeUntilFn(Dx);this._cursor.peek()!==41&&this._cursor.peek()!==0;){this._beginToken(Q.BLOCK_PARAMETER);let t=this._cursor.clone(),e=null,n=0;for(;this._cursor.peek()!==59&&this._cursor.peek()!==0||e!==null;){let r=this._cursor.peek();if(r===92)this._cursor.advance();else if(r===e)e=null;else if(e===null&&lO(r))e=r;else if(r===40&&e===null)n++;else if(r===41&&e===null){if(n===0)break;n>0&&n--}this._cursor.advance()}this._endToken([this._cursor.getChars(t)]),this._attemptCharCodeUntilFn(Dx)}}_consumeLetDeclaration(t){if(this._requireStr("@let"),this._beginToken(Q.LET_START,t),Dp(this._cursor.peek()))this._attemptCharCodeUntilFn(at);else{let n=this._endToken([this._cursor.getChars(t)]);n.type=Q.INCOMPLETE_LET;return}let e=this._endToken([this._getLetDeclarationName()]);if(this._attemptCharCodeUntilFn(at),!this._attemptCharCode(61)){e.type=Q.INCOMPLETE_LET;return}this._attemptCharCodeUntilFn(n=>at(n)&&!Ap(n)),this._consumeLetDeclarationValue(),this._cursor.peek()===59?(this._beginToken(Q.LET_END),this._endToken([]),this._cursor.advance()):(e.type=Q.INCOMPLETE_LET,e.sourceSpan=this._cursor.getSpan(t))}_getLetDeclarationName(){let t=this._cursor.clone(),e=!1;return this._attemptCharCodeUntilFn(n=>Eu(n)||n===36||n===95||e&&bm(n)?(e=!0,!1):!0),this._cursor.getChars(t).trim()}_consumeLetDeclarationValue(){let t=this._cursor.clone();for(this._beginToken(Q.LET_VALUE,t);this._cursor.peek()!==0;){let e=this._cursor.peek();if(e===59)break;lO(e)&&(this._cursor.advance(),this._attemptCharCodeUntilFn(n=>n===92?(this._cursor.advance(),!1):n===e)),this._cursor.advance()}this._endToken([this._cursor.getChars(t)])}_tokenizeExpansionForm(){if(this.isExpansionFormStart())return this._consumeExpansionFormStart(),!0;if(S1(this._cursor.peek())&&this._isInExpansionForm())return this._consumeExpansionCaseStart(),!0;if(this._cursor.peek()===125){if(this._isInExpansionCase())return this._consumeExpansionCaseEnd(),!0;if(this._isInExpansionForm())return this._consumeExpansionFormEnd(),!0}return!1}_beginToken(t,e=this._cursor.clone()){this._currentTokenStart=e,this._currentTokenType=t}_endToken(t,e){if(this._currentTokenStart===null)throw new Ea(this._cursor.getSpan(e),"Programming error - attempted to end a token when there was no start to the token");if(this._currentTokenType===null)throw new Ea(this._cursor.getSpan(this._currentTokenStart),"Programming error - attempted to end a token which has no token type");let n={type:this._currentTokenType,parts:t,sourceSpan:(e??this._cursor).getSpan(this._currentTokenStart,this._leadingTriviaCodePoints)};return this.tokens.push(n),this._currentTokenStart=null,this._currentTokenType=null,n}_createError(t,e){this._isInExpansionForm()&&(t+=` (Do you have an unescaped "{" in your template? Use "{{ '{' }}") to escape it.)`);let n=new Ea(e,t);return this._currentTokenStart=null,this._currentTokenType=null,n}handleError(t){if(t instanceof uT&&(t=this._createError(t.msg,this._cursor.getSpan(t.cursor))),t instanceof Ea)this.errors.push(t);else throw t}_attemptCharCode(t){return this._cursor.peek()===t?(this._cursor.advance(),!0):!1}_attemptCharCodeCaseInsensitive(t){return w1(this._cursor.peek(),t)?(this._cursor.advance(),!0):!1}_requireCharCode(t){let e=this._cursor.clone();if(!this._attemptCharCode(t))throw this._createError(po(this._cursor.peek()),this._cursor.getSpan(e))}_attemptStr(t){let e=t.length;if(this._cursor.charsLeft()this._peekStr(t))}_isLetStart(){return this._cursor.peek()===64&&this._peekStr("@let")}_consumeEntity(t){this._beginToken(Q.ENCODED_ENTITY);let e=this._cursor.clone();if(this._cursor.advance(),this._attemptCharCode(35)){let n=this._attemptCharCode(120)||this._attemptCharCode(88),r=this._cursor.clone();if(this._attemptCharCodeUntilFn(v1),this._cursor.peek()!=59){this._cursor.advance();let s=n?bb.HEX:bb.DEC;throw this._createError(O1(s,this._cursor.getChars(e)),this._cursor.getSpan())}let i=this._cursor.getChars(r);this._cursor.advance();try{let s=parseInt(i,n?16:10);this._endToken([String.fromCodePoint(s),this._cursor.getChars(e)])}catch{throw this._createError(xx(this._cursor.getChars(e)),this._cursor.getSpan())}}else{let n=this._cursor.clone();if(this._attemptCharCodeUntilFn(T1),this._cursor.peek()!=59)this._beginToken(t,e),this._cursor=n,this._endToken(["&"]);else{let r=this._cursor.getChars(n);this._cursor.advance();let i=vu.hasOwnProperty(r)&&vu[r];if(!i)throw this._createError(xx(r),this._cursor.getSpan(e));this._endToken([i,`&${r};`])}}}_consumeRawText(t,e){this._beginToken(t?Q.ESCAPABLE_RAW_TEXT:Q.RAW_TEXT);let n=[];for(;;){let r=this._cursor.clone(),i=e();if(this._cursor=r,i)break;t&&this._cursor.peek()===38?(this._endToken([this._processCarriageReturns(n.join(""))]),n.length=0,this._consumeEntity(Q.ESCAPABLE_RAW_TEXT),this._beginToken(Q.ESCAPABLE_RAW_TEXT)):n.push(this._readChar())}this._endToken([this._processCarriageReturns(n.join(""))])}_consumeComment(t){this._beginToken(Q.COMMENT_START,t),this._endToken([]),this._consumeRawText(!1,()=>this._attemptStr("-->")),this._beginToken(Q.COMMENT_END),this._requireStr("-->"),this._endToken([])}_consumeBogusComment(t){this._beginToken(Q.COMMENT_START,t),this._endToken([]),this._consumeRawText(!1,()=>this._cursor.peek()===62),this._beginToken(Q.COMMENT_END),this._cursor.advance(),this._endToken([])}_consumeCdata(t){this._beginToken(Q.CDATA_START,t),this._endToken([]),this._consumeRawText(!1,()=>this._attemptStr("]]>")),this._beginToken(Q.CDATA_END),this._requireStr("]]>"),this._endToken([])}_consumeDocType(t){this._beginToken(Q.DOC_TYPE_START,t),this._endToken([]),this._consumeRawText(!1,()=>this._cursor.peek()===62),this._beginToken(Q.DOC_TYPE_END),this._cursor.advance(),this._endToken([])}_consumePrefixAndName(t){let e=this._cursor.clone(),n="";for(;this._cursor.peek()!==58&&!E1(this._cursor.peek());)this._cursor.advance();let r;this._cursor.peek()===58?(n=this._cursor.getChars(e),this._cursor.advance(),r=this._cursor.clone()):r=e,this._requireCharCodeUntilFn(t,n===""?0:1);let i=this._cursor.getChars(r);return[n,i]}_consumeTagOpen(t){let e,n,r,i,s=[];try{if(this._selectorlessEnabled&&Yh(this._cursor.peek()))i=this._consumeComponentOpenStart(t),[r,n,e]=i.parts,n&&(r+=`:${n}`),e&&(r+=`:${e}`),this._attemptCharCodeUntilFn(at);else{if(!Eu(this._cursor.peek()))throw this._createError(po(this._cursor.peek()),this._cursor.getSpan(t));i=this._consumeTagOpenStart(t),n=i.parts[0],e=r=i.parts[1],this._attemptCharCodeUntilFn(at)}for(;!Px(this._cursor.peek());)if(this._selectorlessEnabled&&this._cursor.peek()===64){let a=this._cursor.clone(),l=a.clone();l.advance(),Yh(l.peek())&&this._consumeDirective(a,l)}else{let a=this._consumeAttribute();s.push(a)}i.type===Q.COMPONENT_OPEN_START?this._consumeComponentOpenEnd():this._consumeTagOpenEnd()}catch(a){if(a instanceof Ea){i?i.type=i.type===Q.COMPONENT_OPEN_START?Q.INCOMPLETE_COMPONENT_OPEN:Q.INCOMPLETE_TAG_OPEN:(this._beginToken(Q.TEXT,t),this._endToken(["<"]));return}throw a}if(this._canSelfClose&&this.tokens[this.tokens.length-1].type===Q.TAG_OPEN_END_VOID)return;let o=this._getTagContentType(e,n,this._fullNameStack.length>0,s);this._handleFullNameStackForTagOpen(n,e),o===Mi.RAW_TEXT?this._consumeRawTextWithTagClose(n,i,r,!1):o===Mi.ESCAPABLE_RAW_TEXT&&this._consumeRawTextWithTagClose(n,i,r,!0)}_consumeRawTextWithTagClose(t,e,n,r){this._consumeRawText(r,()=>!this._attemptCharCode(60)||!this._attemptCharCode(47)||(this._attemptCharCodeUntilFn(at),!this._attemptStrCaseInsensitive(t&&e.type!==Q.COMPONENT_OPEN_START?`${t}:${n}`:n))?!1:(this._attemptCharCodeUntilFn(at),this._attemptCharCode(62))),this._beginToken(e.type===Q.COMPONENT_OPEN_START?Q.COMPONENT_CLOSE:Q.TAG_CLOSE),this._requireCharCodeUntilFn(i=>i===62,3),this._cursor.advance(),this._endToken(e.parts),this._handleFullNameStackForTagClose(t,n)}_consumeTagOpenStart(t){this._beginToken(Q.TAG_OPEN_START,t);let e=this._consumePrefixAndName(fo);return this._endToken(e)}_consumeComponentOpenStart(t){this._beginToken(Q.COMPONENT_OPEN_START,t);let e=this._consumeComponentName();return this._endToken(e)}_consumeComponentName(){let t=this._cursor.clone();for(;Ax(this._cursor.peek());)this._cursor.advance();let e=this._cursor.getChars(t),n="",r="";return this._cursor.peek()===58&&(this._cursor.advance(),[n,r]=this._consumePrefixAndName(fo)),[e,n,r]}_consumeAttribute(){let[t,e]=this._consumeAttributeName(),n;return this._attemptCharCodeUntilFn(at),this._attemptCharCode(61)&&(this._attemptCharCodeUntilFn(at),n=this._consumeAttributeValue()),this._attemptCharCodeUntilFn(at),{prefix:t,name:e,value:n}}_consumeAttributeName(){let t=this._cursor.peek();if(t===39||t===34)throw this._createError(po(t),this._cursor.getSpan());this._beginToken(Q.ATTR_NAME);let e;if(this._openDirectiveCount>0){let r=0;e=i=>{if(this._openDirectiveCount>0){if(i===40)r++;else if(i===41){if(r===0)return!0;r--}}return fo(i)}}else if(t===91){let r=0;e=i=>(i===91?r++:i===93&&r--,r<=0?fo(i):Ap(i))}else e=fo;let n=this._consumePrefixAndName(e);return this._endToken(n),n}_consumeAttributeValue(){let t;if(this._cursor.peek()===39||this._cursor.peek()===34){let e=this._cursor.peek();this._consumeQuote(e);let n=()=>this._cursor.peek()===e;t=this._consumeWithInterpolation(Q.ATTR_VALUE_TEXT,Q.ATTR_VALUE_INTERPOLATION,n,n),this._consumeQuote(e)}else{let e=()=>fo(this._cursor.peek());t=this._consumeWithInterpolation(Q.ATTR_VALUE_TEXT,Q.ATTR_VALUE_INTERPOLATION,e,e)}return t}_consumeQuote(t){this._beginToken(Q.ATTR_QUOTE),this._requireCharCode(t),this._endToken([String.fromCodePoint(t)])}_consumeTagOpenEnd(){let t=this._attemptCharCode(47)?Q.TAG_OPEN_END_VOID:Q.TAG_OPEN_END;this._beginToken(t),this._requireCharCode(62),this._endToken([])}_consumeComponentOpenEnd(){let t=this._attemptCharCode(47)?Q.COMPONENT_OPEN_END_VOID:Q.COMPONENT_OPEN_END;this._beginToken(t),this._requireCharCode(62),this._endToken([])}_consumeTagClose(t){if(this._selectorlessEnabled){let e=t.clone();for(;e.peek()!==62&&!Yh(e.peek());)e.advance();if(Yh(e.peek())){this._beginToken(Q.COMPONENT_CLOSE,t);let n=this._consumeComponentName();this._attemptCharCodeUntilFn(at),this._requireCharCode(62),this._endToken(n);return}}if(this._beginToken(Q.TAG_CLOSE,t),this._attemptCharCodeUntilFn(at),this._allowHtmComponentClosingTags&&this._attemptCharCode(47))this._attemptCharCodeUntilFn(at),this._requireCharCode(62),this._endToken([]);else{let[e,n]=this._consumePrefixAndName(fo);this._attemptCharCodeUntilFn(at),this._requireCharCode(62),this._endToken([e,n]),this._handleFullNameStackForTagClose(e,n)}}_consumeExpansionFormStart(){this._beginToken(Q.EXPANSION_FORM_START),this._requireCharCode(123),this._endToken([]),this._expansionCaseStack.push(Q.EXPANSION_FORM_START),this._beginToken(Q.RAW_TEXT);let t=this._readUntil(44),e=this._processCarriageReturns(t);if(this._i18nNormalizeLineEndingsInICUs)this._endToken([e]);else{let r=this._endToken([t]);e!==t&&this.nonNormalizedIcuExpressions.push(r)}this._requireCharCode(44),this._attemptCharCodeUntilFn(at),this._beginToken(Q.RAW_TEXT);let n=this._readUntil(44);this._endToken([n]),this._requireCharCode(44),this._attemptCharCodeUntilFn(at)}_consumeExpansionCaseStart(){this._beginToken(Q.EXPANSION_CASE_VALUE);let t=this._readUntil(123).trim();this._endToken([t]),this._attemptCharCodeUntilFn(at),this._beginToken(Q.EXPANSION_CASE_EXP_START),this._requireCharCode(123),this._endToken([]),this._attemptCharCodeUntilFn(at),this._expansionCaseStack.push(Q.EXPANSION_CASE_EXP_START)}_consumeExpansionCaseEnd(){this._beginToken(Q.EXPANSION_CASE_EXP_END),this._requireCharCode(125),this._endToken([]),this._attemptCharCodeUntilFn(at),this._expansionCaseStack.pop()}_consumeExpansionFormEnd(){this._beginToken(Q.EXPANSION_FORM_END),this._requireCharCode(125),this._endToken([]),this._expansionCaseStack.pop()}_consumeWithInterpolation(t,e,n,r){this._beginToken(t);let i=[];for(;!n();){let o=this._cursor.clone();this._attemptStr(Ul.start)?(this._endToken([this._processCarriageReturns(i.join(""))],o),i.length=0,this._consumeInterpolation(e,o,r),this._beginToken(t)):this._cursor.peek()===38?(this._endToken([this._processCarriageReturns(i.join(""))]),i.length=0,this._consumeEntity(t),this._beginToken(t)):i.push(this._readChar())}this._inInterpolation=!1;let s=this._processCarriageReturns(i.join(""));return this._endToken([s]),s}_consumeInterpolation(t,e,n){let r=[];this._beginToken(t,e),r.push(Ul.start);let i=this._cursor.clone(),s=null,o=!1;for(;this._cursor.peek()!==0&&(n===null||!n());){let a=this._cursor.clone();if(this._isTagStart()){this._cursor=a,r.push(this._getProcessedChars(i,a)),this._endToken(r);return}if(s===null)if(this._attemptStr(Ul.end)){r.push(this._getProcessedChars(i,a)),r.push(Ul.end),this._endToken(r);return}else this._attemptStr("//")&&(o=!0);let l=this._cursor.peek();this._cursor.advance(),l===92?this._cursor.advance():l===s?s=null:!o&&s===null&&lO(l)&&(s=l)}r.push(this._getProcessedChars(i,this._cursor)),this._endToken(r)}_consumeDirective(t,e){for(this._requireCharCode(64),this._cursor.advance();Ax(this._cursor.peek());)this._cursor.advance();this._beginToken(Q.DIRECTIVE_NAME,t);let n=this._cursor.getChars(e);if(this._endToken([n]),this._attemptCharCodeUntilFn(at),this._cursor.peek()===40){for(this._openDirectiveCount++,this._beginToken(Q.DIRECTIVE_OPEN),this._cursor.advance(),this._endToken([]),this._attemptCharCodeUntilFn(at);!Px(this._cursor.peek())&&this._cursor.peek()!==41;)this._consumeAttribute();if(this._attemptCharCodeUntilFn(at),this._openDirectiveCount--,this._cursor.peek()!==41){if(this._cursor.peek()===62||this._cursor.peek()===47)return;throw this._createError(po(this._cursor.peek()),this._cursor.getSpan(t))}this._beginToken(Q.DIRECTIVE_CLOSE),this._cursor.advance(),this._endToken([]),this._attemptCharCodeUntilFn(at)}}_getProcessedChars(t,e){return this._processCarriageReturns(e.getChars(t))}_isTextEnd(){return!!(this._isTagStart()||this._cursor.peek()===0||this._tokenizeIcu&&!this._inInterpolation&&(this.isExpansionFormStart()||this._cursor.peek()===125&&this._isInExpansionCase())||this._tokenizeBlocks&&!this._inInterpolation&&!this._isInExpansion()&&(this._isBlockStart()||this._isLetStart()||this._cursor.peek()===125))}_isTagStart(){if(this._cursor.peek()===60){let t=this._cursor.clone();t.advance();let e=t.peek();if(97<=e&&e<=122||65<=e&&e<=90||e===47||e===33)return!0}return!1}_readUntil(t){let e=this._cursor.clone();return this._attemptUntilChar(t),this._cursor.getChars(e)}_isInExpansion(){return this._isInExpansionCase()||this._isInExpansionForm()}_isInExpansionCase(){return this._expansionCaseStack.length>0&&this._expansionCaseStack[this._expansionCaseStack.length-1]===Q.EXPANSION_CASE_EXP_START}_isInExpansionForm(){return this._expansionCaseStack.length>0&&this._expansionCaseStack[this._expansionCaseStack.length-1]===Q.EXPANSION_FORM_START}isExpansionFormStart(){if(this._cursor.peek()!==123)return!1;let t=this._cursor.clone(),e=this._attemptStr(Ul.start);return this._cursor=t,!e}_handleFullNameStackForTagOpen(t,e){let n=xc(t,e);(this._fullNameStack.length===0||this._fullNameStack[this._fullNameStack.length-1]===n)&&this._fullNameStack.push(n)}_handleFullNameStackForTagClose(t,e){let n=xc(t,e);this._fullNameStack.length!==0&&this._fullNameStack[this._fullNameStack.length-1]===n&&this._fullNameStack.pop()}};function at(t){return!Dp(t)||t===0}function fo(t){return Dp(t)||t===62||t===60||t===47||t===39||t===34||t===61||t===0}function E1(t){return(t<97||12257)}function v1(t){return t===59||t===0||!r1(t)}function T1(t){return t===59||t===0||!Eu(t)}function S1(t){return t!==125}function w1(t,e){return Cx(t)===Cx(e)}function Cx(t){return t>=97&&t<=122?t-97+65:t}function k1(t){return Eu(t)||bm(t)||t===95}function Dx(t){return t!==59&&at(t)}function Yh(t){return t===95||t>=65&&t<=90}function Ax(t){return Eu(t)||bm(t)||t===95}function Px(t){return t===47||t===62||t===60||t===0}function _1(t){let e=[],n;for(let r=0;r0&&n.indexOf(e.peek())!==-1;)r===e&&(e=e.clone()),e.advance();let i=this.locationFromCursor(e);return new _e(i,this.locationFromCursor(this),r!==e?this.locationFromCursor(r):i)}getChars(e){return this.input.substring(e.state.offset,this.state.offset)}charAt(e){return this.input.charCodeAt(e)}advanceState(e){if(e.offset>=this.end)throw this.state=e,new uT('Unexpected character "EOF"',this);let n=this.charAt(e.offset);n===10?(e.line++,e.column=0):Ap(n)||e.column++,e.offset++,this.updatePeek(e)}updatePeek(e){e.peek=e.offset>=this.end?0:this.charAt(e.offset)}locationFromCursor(e){return new yb(e.file,e.state.offset,e.state.line,e.state.column)}},x1=class vb extends _2{constructor(e,n){e instanceof vb?(super(e),this.internalState={...e.internalState}):(super(e,n),this.internalState=this.state)}advance(){this.state=this.internalState,super.advance(),this.processEscapeSequence()}init(){super.init(),this.processEscapeSequence()}clone(){return new vb(this)}getChars(e){let n=e.clone(),r="";for(;n.internalState.offsetthis.internalState.peek;if(e()===92)if(this.internalState={...this.state},this.advanceState(this.internalState),e()===110)this.state.peek=10;else if(e()===114)this.state.peek=13;else if(e()===118)this.state.peek=11;else if(e()===116)this.state.peek=9;else if(e()===98)this.state.peek=8;else if(e()===102)this.state.peek=12;else if(e()===117)if(this.advanceState(this.internalState),e()===123){this.advanceState(this.internalState);let n=this.clone(),r=0;for(;e()!==125;)this.advanceState(this.internalState),r++;this.state.peek=this.decodeHexDigits(n,r)}else{let n=this.clone();this.advanceState(this.internalState),this.advanceState(this.internalState),this.advanceState(this.internalState),this.state.peek=this.decodeHexDigits(n,4)}else if(e()===120){this.advanceState(this.internalState);let n=this.clone();this.advanceState(this.internalState),this.state.peek=this.decodeHexDigits(n,2)}else if(Sx(e())){let n="",r=0,i=this.clone();for(;Sx(e())&&r<3;)i=this.clone(),n+=String.fromCodePoint(e()),this.advanceState(this.internalState),r++;this.state.peek=parseInt(n,8),this.internalState=i.internalState}else Ap(this.internalState.peek)?(this.advanceState(this.internalState),this.state=this.internalState):this.state.peek=this.internalState.peek}decodeHexDigits(e,n){let r=this.input.slice(e.internalState.offset,e.internalState.offset+n),i=parseInt(r,16);if(isNaN(i))throw e.state=e.internalState,new uT("Invalid hexadecimal escape sequence",e);return i}},uT=class extends Error{constructor(t,e){super(t),this.msg=t,this.cursor=e,Object.setPrototypeOf(this,new.target.prototype)}},zt=class x2 extends Ea{static create(e,n,r){return new x2(e,n,r)}constructor(e,n,r){super(n,r),this.elementName=e}},C1=class{constructor(t,e){this.rootNodes=t,this.errors=e}},D1=class{constructor(t){this.getTagDefinition=t}parse(t,e,n,r=!1,i){let s=p=>(f,...m)=>p(f.toLowerCase(),...m),o=r?this.getTagDefinition:s(this.getTagDefinition),a=p=>o(p).getContentType(),l=r?i:s(i),c=m1(t,e,i?(p,f,m,g)=>{let y=l(p,f,m,g);return y!==void 0?y:a(p)}:a,n),u=n&&n.canSelfClose||!1,h=n&&n.allowHtmComponentClosingTags||!1,d=new A1(c.tokens,o,u,h,r);return d.build(),new C1(d.rootNodes,[...c.errors,...d.errors])}},A1=class C2{constructor(e,n,r,i,s){this.tokens=e,this.tagDefinitionResolver=n,this.canSelfClose=r,this.allowHtmComponentClosingTags=i,this.isTagNameCaseSensitive=s,this._index=-1,this._containerStack=[],this.rootNodes=[],this.errors=[],this._advance()}build(){for(;this._peek.type!==Q.EOF;)this._peek.type===Q.TAG_OPEN_START||this._peek.type===Q.INCOMPLETE_TAG_OPEN?this._consumeElementStartTag(this._advance()):this._peek.type===Q.TAG_CLOSE?(this._closeVoidElement(),this._consumeElementEndTag(this._advance())):this._peek.type===Q.CDATA_START?(this._closeVoidElement(),this._consumeCdata(this._advance())):this._peek.type===Q.COMMENT_START?(this._closeVoidElement(),this._consumeComment(this._advance())):this._peek.type===Q.TEXT||this._peek.type===Q.RAW_TEXT||this._peek.type===Q.ESCAPABLE_RAW_TEXT?(this._closeVoidElement(),this._consumeText(this._advance())):this._peek.type===Q.EXPANSION_FORM_START?this._consumeExpansion(this._advance()):this._peek.type===Q.BLOCK_OPEN_START?(this._closeVoidElement(),this._consumeBlockOpen(this._advance())):this._peek.type===Q.BLOCK_CLOSE?(this._closeVoidElement(),this._consumeBlockClose(this._advance())):this._peek.type===Q.INCOMPLETE_BLOCK_OPEN?(this._closeVoidElement(),this._consumeIncompleteBlock(this._advance())):this._peek.type===Q.LET_START?(this._closeVoidElement(),this._consumeLet(this._advance())):this._peek.type===Q.DOC_TYPE_START?this._consumeDocType(this._advance()):this._peek.type===Q.INCOMPLETE_LET?(this._closeVoidElement(),this._consumeIncompleteLet(this._advance())):this._peek.type===Q.COMPONENT_OPEN_START||this._peek.type===Q.INCOMPLETE_COMPONENT_OPEN?this._consumeComponentStartTag(this._advance()):this._peek.type===Q.COMPONENT_CLOSE?this._consumeComponentEndTag(this._advance()):this._advance();for(let e of this._containerStack)e instanceof pa&&this.errors.push(zt.create(e.name,e.sourceSpan,`Unclosed block "${e.name}"`))}_advance(){let e=this._peek;return this._index0)return this.errors=this.errors.concat(s.errors),null;let o=new _e(e.sourceSpan.start,i.sourceSpan.end,e.sourceSpan.fullStart),a=new _e(n.sourceSpan.start,i.sourceSpan.end,n.sourceSpan.fullStart);return new a1(e.parts[0],s.rootNodes,o,e.sourceSpan,a)}_collectExpansionExpTokens(e){let n=[],r=[Q.EXPANSION_CASE_EXP_START];for(;;){if((this._peek.type===Q.EXPANSION_FORM_START||this._peek.type===Q.EXPANSION_CASE_EXP_START)&&r.push(this._peek.type),this._peek.type===Q.EXPANSION_CASE_EXP_END)if(Nx(r,Q.EXPANSION_CASE_EXP_START)){if(r.pop(),r.length===0)return n}else return this.errors.push(zt.create(null,e.sourceSpan,"Invalid ICU message. Missing '}'.")),null;if(this._peek.type===Q.EXPANSION_FORM_END)if(Nx(r,Q.EXPANSION_FORM_START))r.pop();else return this.errors.push(zt.create(null,e.sourceSpan,"Invalid ICU message. Missing '}'.")),null;if(this._peek.type===Q.EOF)return this.errors.push(zt.create(null,e.sourceSpan,"Invalid ICU message. Missing '}'.")),null;n.push(this._advance())}}_getText(e){let n=e.parts[0];if(n.length>0&&n[0]==` `){var r;let i=this._getClosestElementLikeParent();i!=null&&i.children.length==0&&!((r=this._getTagDefinition(i))===null||r===void 0)&&r.ignoreFirstLf&&(n=n.substring(1))}return n}_consumeText(e){let n=[e],r=e.sourceSpan,i=e.parts[0];if(i.length>0&&i[0]===` `){var s;let o=this._getContainer();o!=null&&o.children.length===0&&!((s=this._getTagDefinition(o))===null||s===void 0)&&s.ignoreFirstLf&&(i=i.substring(1),n[0]={type:e.type,sourceSpan:e.sourceSpan,parts:[i]})}for(;this._peek.type===Q.INTERPOLATION||this._peek.type===Q.TEXT||this._peek.type===Q.ENCODED_ENTITY;)e=this._advance(),n.push(e),e.type===Q.INTERPOLATION?i+=e.parts.join("").replace(/&([^;]+);/g,Rx):e.type===Q.ENCODED_ENTITY?i+=e.parts[0]:i+=e.parts.join("");if(i.length>0){let o=e.sourceSpan;this._addToParent(new i1(i,new _e(r.start,o.end,r.fullStart,r.details),n))}}_closeVoidElement(){var e;let n=this._getContainer();n!==null&&!((e=this._getTagDefinition(n))===null||e===void 0)&&e.isVoid&&this._containerStack.pop()}_consumeElementStartTag(e){var n;let r=[],i=[];this._consumeAttributesAndDirectives(r,i);let s=this._getElementFullName(e,this._getClosestElementLikeParent()),o=this._getTagDefinition(s),a=!1;if(this._peek.type===Q.TAG_OPEN_END_VOID){this._advance(),a=!0;let m=this._getTagDefinition(s);this.canSelfClose||m!=null&&m.canSelfClose||Ld(s)!==null||m!=null&&m.isVoid||this.errors.push(zt.create(s,e.sourceSpan,`Only void, custom and foreign elements can be self closed "${e.parts[1]}"`))}else this._peek.type===Q.TAG_OPEN_END&&(this._advance(),a=!1);let l=this._peek.sourceSpan.fullStart,c=new _e(e.sourceSpan.start,l,e.sourceSpan.fullStart),u=new _e(e.sourceSpan.start,l,e.sourceSpan.fullStart),h=new _e(e.sourceSpan.start.moveBy(1),e.sourceSpan.end),d=new ho(s,r,i,[],a,c,u,void 0,h,(o==null?void 0:o.isVoid)??!1),p=this._getContainer(),f=p!==null&&!!(!((n=this._getTagDefinition(p))===null||n===void 0)&&n.isClosedByChild(d.name));this._pushContainer(d,f),a?this._popContainer(s,ho,c):e.type===Q.INCOMPLETE_TAG_OPEN&&(this._popContainer(s,ho,null),this.errors.push(zt.create(s,c,`Opening tag "${s}" not terminated.`)))}_consumeComponentStartTag(e){var n;let r=e.parts[0],i=[],s=[];this._consumeAttributesAndDirectives(i,s);let o=this._getClosestElementLikeParent(),a=this._getComponentTagName(e,o),l=this._getComponentFullName(e,o),c=this._peek.type===Q.COMPONENT_OPEN_END_VOID;this._advance();let u=this._peek.sourceSpan.fullStart,h=new _e(e.sourceSpan.start,u,e.sourceSpan.fullStart),d=new _e(e.sourceSpan.start,u,e.sourceSpan.fullStart),p=new hs(r,a,l,i,s,[],c,h,d,void 0),f=this._getContainer(),m=f!==null&&p.tagName!==null&&!!(!((n=this._getTagDefinition(f))===null||n===void 0)&&n.isClosedByChild(p.tagName));this._pushContainer(p,m),c?this._popContainer(l,hs,h):e.type===Q.INCOMPLETE_COMPONENT_OPEN&&(this._popContainer(l,hs,null),this.errors.push(zt.create(l,h,`Opening tag "${l}" not terminated.`)))}_consumeAttributesAndDirectives(e,n){for(;this._peek.type===Q.ATTR_NAME||this._peek.type===Q.DIRECTIVE_NAME;)this._peek.type===Q.DIRECTIVE_NAME?n.push(this._consumeDirective(this._peek)):e.push(this._consumeAttr(this._advance()))}_consumeComponentEndTag(e){let n=this._getComponentFullName(e,this._getClosestElementLikeParent());if(!this._popContainer(n,hs,e.sourceSpan)){let r=this._containerStack[this._containerStack.length-1],i;r instanceof hs&&r.componentName===e.parts[0]?i=`, did you mean "${r.fullName}"?`:i=". It may happen when the tag has already been closed by another tag.";let s=`Unexpected closing tag "${n}"${i}`;this.errors.push(zt.create(n,e.sourceSpan,s))}}_getTagDefinition(e){return typeof e=="string"?this.tagDefinitionResolver(e):e instanceof ho?this.tagDefinitionResolver(e.name):e instanceof hs&&e.tagName!==null?this.tagDefinitionResolver(e.tagName):null}_pushContainer(e,n){n&&this._containerStack.pop(),this._addToParent(e),this._containerStack.push(e)}_consumeElementEndTag(e){var n;let r=this.allowHtmComponentClosingTags&&e.parts.length===0?null:this._getElementFullName(e,this._getClosestElementLikeParent());if(r&&!((n=this._getTagDefinition(r))===null||n===void 0)&&n.isVoid)this.errors.push(zt.create(r,e.sourceSpan,`Void elements do not have end tags "${e.parts[1]}"`));else if(!this._popContainer(r,ho,e.sourceSpan)){let i=`Unexpected closing tag "${r}". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags`;this.errors.push(zt.create(r,e.sourceSpan,i))}}_popContainer(e,n,r){let i=!1;for(let o=this._containerStack.length-1;o>=0;o--){var s;let a=this._containerStack[o],l=a instanceof hs?a.fullName:a.name;if(Ld(l)?l===e:(l===e||e===null)&&a instanceof n)return a.endSourceSpan=r,a.sourceSpan.end=r!==null?r.end:a.sourceSpan.end,this._containerStack.splice(o,this._containerStack.length-o),!i;(a instanceof pa||!(!((s=this._getTagDefinition(a))===null||s===void 0)&&s.closedByParent))&&(i=!0)}return!1}_consumeAttr(e){let n=xc(e.parts[0],e.parts[1]),r=e.sourceSpan.end,i;this._peek.type===Q.ATTR_QUOTE&&(i=this._advance());let s="",o=[],a,l;if(this._peek.type===Q.ATTR_VALUE_TEXT)for(a=this._peek.sourceSpan,l=this._peek.sourceSpan.end;this._peek.type===Q.ATTR_VALUE_TEXT||this._peek.type===Q.ATTR_VALUE_INTERPOLATION||this._peek.type===Q.ENCODED_ENTITY;){let u=this._advance();o.push(u),u.type===Q.ATTR_VALUE_INTERPOLATION?s+=u.parts.join("").replace(/&([^;]+);/g,Rx):u.type===Q.ENCODED_ENTITY?s+=u.parts[0]:s+=u.parts.join(""),l=r=u.sourceSpan.end}this._peek.type===Q.ATTR_QUOTE&&(l=r=this._advance().sourceSpan.end);let c=a&&l&&new _e((i==null?void 0:i.sourceSpan.start)??a.start,l,(i==null?void 0:i.sourceSpan.fullStart)??a.fullStart);return new l1(n,s,new _e(e.sourceSpan.start,r,e.sourceSpan.fullStart),e.sourceSpan,c,o.length>0?o:void 0,void 0)}_consumeDirective(e){let n=[],r=e.sourceSpan.end,i=null;if(this._advance(),this._peek.type===Q.DIRECTIVE_OPEN){for(r=this._peek.sourceSpan.end,this._advance();this._peek.type===Q.ATTR_NAME;)n.push(this._consumeAttr(this._advance()));this._peek.type===Q.DIRECTIVE_CLOSE?(i=this._peek.sourceSpan,this._advance()):this.errors.push(zt.create(null,e.sourceSpan,"Unterminated directive definition"))}let s=new _e(e.sourceSpan.start,r,e.sourceSpan.fullStart),o=new _e(s.start,i===null?e.sourceSpan.end:i.end,s.fullStart);return new h1(e.parts[0],n,o,s,i)}_consumeBlockOpen(e){let n=[];for(;this._peek.type===Q.BLOCK_PARAMETER;){let a=this._advance();n.push(new kx(a.parts[0],a.sourceSpan))}this._peek.type===Q.BLOCK_OPEN_END&&this._advance();let r=this._peek.sourceSpan.fullStart,i=new _e(e.sourceSpan.start,r,e.sourceSpan.fullStart),s=new _e(e.sourceSpan.start,r,e.sourceSpan.fullStart),o=new pa(e.parts[0],n,[],i,e.sourceSpan,s);this._pushContainer(o,!1)}_consumeBlockClose(e){this._popContainer(null,pa,e.sourceSpan)||this.errors.push(zt.create(null,e.sourceSpan,'Unexpected closing block. The block may have been closed earlier. If you meant to write the } character, you should use the "}" HTML entity instead.'))}_consumeIncompleteBlock(e){let n=[];for(;this._peek.type===Q.BLOCK_PARAMETER;){let a=this._advance();n.push(new kx(a.parts[0],a.sourceSpan))}let r=this._peek.sourceSpan.fullStart,i=new _e(e.sourceSpan.start,r,e.sourceSpan.fullStart),s=new _e(e.sourceSpan.start,r,e.sourceSpan.fullStart),o=new pa(e.parts[0],n,[],i,e.sourceSpan,s);this._pushContainer(o,!1),this._popContainer(null,pa,null),this.errors.push(zt.create(e.parts[0],i,`Incomplete block "${e.parts[0]}". If you meant to write the @ character, you should use the "@" HTML entity instead.`))}_consumeLet(e){let n=e.parts[0],r,i;if(this._peek.type!==Q.LET_VALUE){this.errors.push(zt.create(e.parts[0],e.sourceSpan,`Invalid @let declaration "${n}". Declaration must have a value.`));return}else r=this._advance();if(this._peek.type!==Q.LET_END){this.errors.push(zt.create(e.parts[0],e.sourceSpan,`Unterminated @let declaration "${n}". Declaration must be terminated with a semicolon.`));return}else i=this._advance();let s=i.sourceSpan.fullStart,o=new _e(e.sourceSpan.start,s,e.sourceSpan.fullStart),a=e.sourceSpan.toString().lastIndexOf(n),l=new _e(e.sourceSpan.start.moveBy(a),e.sourceSpan.end),c=new _x(n,r.parts[0],o,l,r.sourceSpan);this._addToParent(c)}_consumeIncompleteLet(e){let n=e.parts[0]??"",r=n?` "${n}"`:"";if(n.length>0){let i=e.sourceSpan.toString().lastIndexOf(n),s=new _e(e.sourceSpan.start.moveBy(i),e.sourceSpan.end),o=new _e(e.sourceSpan.start,e.sourceSpan.start.moveBy(0)),a=new _x(n,"",e.sourceSpan,s,o);this._addToParent(a)}this.errors.push(zt.create(e.parts[0],e.sourceSpan,`Incomplete @let declaration${r}. @let declarations must be written as \`@let = ;\``))}_getContainer(){return this._containerStack.length>0?this._containerStack[this._containerStack.length-1]:null}_getClosestElementLikeParent(){for(let e=this._containerStack.length-1;e>-1;e--){let n=this._containerStack[e];if(n instanceof ho||n instanceof hs)return n}return null}_addToParent(e){let n=this._getContainer();n===null?this.rootNodes.push(e):n.children.push(e)}_getElementFullName(e,n){return xc(this._getPrefix(e,n),e.parts[1])}_getComponentFullName(e,n){let r=e.parts[0],i=this._getComponentTagName(e,n);return i===null?r:i.startsWith(":")?r+i:`${r}:${i}`}_getComponentTagName(e,n){let r=this._getPrefix(e,n),i=e.parts[2];return!r&&!i?null:!r&&i?i:xc(r,i||"ng-component")}_getPrefix(e,n){var r;let i,s;if(e.type===Q.COMPONENT_OPEN_START||e.type===Q.INCOMPLETE_COMPONENT_OPEN||e.type===Q.COMPONENT_CLOSE?(i=e.parts[1],s=e.parts[2]):(i=e.parts[0],s=e.parts[1]),i=i||((r=this._getTagDefinition(s))===null||r===void 0?void 0:r.implicitNamespacePrefix)||"",!i&&n){let o=n instanceof ho?n.name:n.tagName;if(o!==null){let a=ym(o)[1],l=this._getTagDefinition(a);l!==null&&!l.preventNamespaceInheritance&&(i=Ld(o))}}return i}};function Nx(t,e){return t.length>0&&t[t.length-1]===e}function Rx(t,e){return vu[e]!==void 0?vu[e]||t:/^#x[a-f0-9]+$/i.test(e)?String.fromCodePoint(parseInt(e.slice(2),16)):/^#\d+$/.test(e)?String.fromCodePoint(parseInt(e.slice(1),10)):t}var P1=class extends D1{constructor(){super(Ob)}parse(t,e,n,r=!1,i){return super.parse(t,e,n,r,i)}},cO=null,N1=()=>(cO||(cO=new P1),cO);function Tb(t,e={}){let{canSelfClose:n=!1,allowHtmComponentClosingTags:r=!1,isTagNameCaseSensitive:i=!1,getTagContentType:s,tokenizeAngularBlocks:o=!1,tokenizeAngularLetDeclaration:a=!1,enableAngularSelectorlessSyntax:l=!1}=e;return N1().parse(t,"angular-html-parser",{tokenizeExpansionForms:o,canSelfClose:n,allowHtmComponentClosingTags:r,tokenizeBlocks:o,tokenizeLet:a,selectorlessEnabled:l},i,s)}var R1=[I1,L1,$1,B1,j1,U1,z1,V1,H1,F1];function M1(t,e){for(let n of R1)n(t,e);return t}function I1(t){t.walk(e=>{if(e.kind==="element"&&e.tagDefinition.ignoreFirstLf&&e.children.length>0&&e.children[0].kind==="text"&&e.children[0].value[0]===` `){let n=e.children[0];n.value.length===1?e.removeChild(n):n.value=n.value.slice(1)}})}function L1(t){let e=n=>{var r,i;return n.kind==="element"&&((r=n.prev)==null?void 0:r.kind)==="ieConditionalStartComment"&&n.prev.sourceSpan.end.offset===n.startSourceSpan.start.offset&&((i=n.firstChild)==null?void 0:i.kind)==="ieConditionalEndComment"&&n.firstChild.sourceSpan.start.offset===n.startSourceSpan.end.offset};t.walk(n=>{if(n.children)for(let r=0;r{if(r.children)for(let i=0;ie.kind==="cdata",e=>``)}function F1(t){let e=n=>{var r,i;return n.kind==="element"&&n.attrs.length===0&&n.children.length===1&&n.firstChild.kind==="text"&&!Or.hasWhitespaceCharacter(n.children[0].value)&&!n.firstChild.hasLeadingSpaces&&!n.firstChild.hasTrailingSpaces&&n.isLeadingSpaceSensitive&&!n.hasLeadingSpaces&&n.isTrailingSpaceSensitive&&!n.hasTrailingSpaces&&((r=n.prev)==null?void 0:r.kind)==="text"&&((i=n.next)==null?void 0:i.kind)==="text"};t.walk(n=>{if(n.children)for(let r=0;r`+i.firstChild.value+``+o.value,s.sourceSpan=new _e(s.sourceSpan.start,o.sourceSpan.end),s.isTrailingSpaceSensitive=o.isTrailingSpaceSensitive,s.hasTrailingSpaces=o.hasTrailingSpaces,n.removeChild(i),r--,n.removeChild(o)}})}function B1(t,e){if(e.parser==="html")return;let n=/\{\{(.+?)\}\}/su;t.walk(r=>{if(cK(r,e))for(let i of r.children){if(i.kind!=="text")continue;let s=i.sourceSpan.start,o=null,a=i.value.split(n);for(let l=0;l0&&r.insertChildBefore(i,{kind:"text",value:c,sourceSpan:new _e(s,o)});continue}o=s.moveBy(c.length+4),r.insertChildBefore(i,{kind:"interpolation",sourceSpan:new _e(s,o),children:c.length===0?[]:[{kind:"text",value:c,sourceSpan:new _e(s.moveBy(2),o.moveBy(-2))}]})}r.removeChild(i)}})}function j1(t,e){t.walk(n=>{let r=n.$children;if(!r)return;if(r.length===0||r.length===1&&r[0].kind==="text"&&Or.trim(r[0].value).length===0){n.hasDanglingSpaces=r.length>0,n.$children=[];return}let i=uK(n,e),s=i2(n);if(!i)for(let o=0;o{e.isSelfClosing=!e.children||e.kind==="element"&&(e.tagDefinition.isVoid||e.endSourceSpan&&e.startSourceSpan.start===e.endSourceSpan.start&&e.startSourceSpan.end===e.endSourceSpan.end)})}function V1(t,e){t.walk(n=>{n.kind==="element"&&(n.hasHtmComponentClosingTag=n.endSourceSpan&&/^<\s*\/\s*\/\s*>$/u.test(e.originalText.slice(n.endSourceSpan.start.offset,n.endSourceSpan.end.offset)))})}function U1(t,e){t.walk(n=>{n.cssDisplay=_K(n,e)})}function H1(t,e){t.walk(n=>{let{children:r}=n;if(r){if(r.length===0){n.isDanglingSpaceSensitive=pK(n,e);return}for(let i of r)i.isLeadingSpaceSensitive=hK(i,e),i.isTrailingSpaceSensitive=dK(i,e);for(let i=0;i of opening tags on the last line instead of on a new line."},singleAttributePerLine:{category:"Common",type:"boolean",default:!1,description:"Enforce single attribute per line in HTML, Vue and JSX."}},Ix="HTML",Y1={bracketSameLine:Mx.bracketSameLine,htmlWhitespaceSensitivity:{category:Ix,type:"choice",default:"css",description:"How to handle whitespaces in HTML.",choices:[{value:"css",description:"Respect the default value of CSS display property."},{value:"strict",description:"Whitespaces are considered sensitive."},{value:"ignore",description:"Whitespaces are considered insensitive."}]},singleAttributePerLine:Mx.singleAttributePerLine,vueIndentScriptAndStyle:{category:Ix,type:"boolean",default:!1,description:"Indent script and style tags in Vue files."}},K1=Y1,D2={};FL(D2,{angular:()=>_ee,html:()=>See,lwc:()=>Cee,mjml:()=>kee,vue:()=>xee});function J1(t,e){let n=new SyntaxError(t+" ("+e.loc.start.line+":"+e.loc.start.column+")");return Object.assign(n,e)}var eee=J1,tee={canSelfClose:!0,normalizeTagName:!1,normalizeAttributeName:!1,allowHtmComponentClosingTags:!1,isTagNameCaseSensitive:!1,shouldParseFrontMatter:!0};function A2(t){return{...tee,...t}}function P2(t){let{canSelfClose:e,allowHtmComponentClosingTags:n,isTagNameCaseSensitive:r,shouldParseAsRawText:i,tokenizeAngularBlocks:s,tokenizeAngularLetDeclaration:o}=t;return{canSelfClose:e,allowHtmComponentClosingTags:n,isTagNameCaseSensitive:r,getTagContentType:i?(...a)=>i(...a)?Mi.RAW_TEXT:void 0:void 0,tokenizeAngularBlocks:s,tokenizeAngularLetDeclaration:o}}var uO=new Map([["*",new Set(["accesskey","autocapitalize","autocorrect","autofocus","class","contenteditable","dir","draggable","enterkeyhint","exportparts","hidden","id","inert","inputmode","is","itemid","itemprop","itemref","itemscope","itemtype","lang","nonce","part","popover","slot","spellcheck","style","tabindex","title","translate","writingsuggestions"])],["a",new Set(["charset","coords","download","href","hreflang","name","ping","referrerpolicy","rel","rev","shape","target","type"])],["applet",new Set(["align","alt","archive","code","codebase","height","hspace","name","object","vspace","width"])],["area",new Set(["alt","coords","download","href","hreflang","nohref","ping","referrerpolicy","rel","shape","target","type"])],["audio",new Set(["autoplay","controls","crossorigin","loop","muted","preload","src"])],["base",new Set(["href","target"])],["basefont",new Set(["color","face","size"])],["blockquote",new Set(["cite"])],["body",new Set(["alink","background","bgcolor","link","text","vlink"])],["br",new Set(["clear"])],["button",new Set(["command","commandfor","disabled","form","formaction","formenctype","formmethod","formnovalidate","formtarget","name","popovertarget","popovertargetaction","type","value"])],["canvas",new Set(["height","width"])],["caption",new Set(["align"])],["col",new Set(["align","char","charoff","span","valign","width"])],["colgroup",new Set(["align","char","charoff","span","valign","width"])],["data",new Set(["value"])],["del",new Set(["cite","datetime"])],["details",new Set(["name","open"])],["dialog",new Set(["closedby","open"])],["dir",new Set(["compact"])],["div",new Set(["align"])],["dl",new Set(["compact"])],["embed",new Set(["height","src","type","width"])],["fieldset",new Set(["disabled","form","name"])],["font",new Set(["color","face","size"])],["form",new Set(["accept","accept-charset","action","autocomplete","enctype","method","name","novalidate","target"])],["frame",new Set(["frameborder","longdesc","marginheight","marginwidth","name","noresize","scrolling","src"])],["frameset",new Set(["cols","rows"])],["h1",new Set(["align"])],["h2",new Set(["align"])],["h3",new Set(["align"])],["h4",new Set(["align"])],["h5",new Set(["align"])],["h6",new Set(["align"])],["head",new Set(["profile"])],["hr",new Set(["align","noshade","size","width"])],["html",new Set(["manifest","version"])],["iframe",new Set(["align","allow","allowfullscreen","allowpaymentrequest","allowusermedia","frameborder","height","loading","longdesc","marginheight","marginwidth","name","referrerpolicy","sandbox","scrolling","src","srcdoc","width"])],["img",new Set(["align","alt","border","crossorigin","decoding","fetchpriority","height","hspace","ismap","loading","longdesc","name","referrerpolicy","sizes","src","srcset","usemap","vspace","width"])],["input",new Set(["accept","align","alpha","alt","autocomplete","checked","colorspace","dirname","disabled","form","formaction","formenctype","formmethod","formnovalidate","formtarget","height","ismap","list","max","maxlength","min","minlength","multiple","name","pattern","placeholder","popovertarget","popovertargetaction","readonly","required","size","src","step","type","usemap","value","width"])],["ins",new Set(["cite","datetime"])],["isindex",new Set(["prompt"])],["label",new Set(["for","form"])],["legend",new Set(["align"])],["li",new Set(["type","value"])],["link",new Set(["as","blocking","charset","color","crossorigin","disabled","fetchpriority","href","hreflang","imagesizes","imagesrcset","integrity","media","referrerpolicy","rel","rev","sizes","target","type"])],["map",new Set(["name"])],["menu",new Set(["compact"])],["meta",new Set(["charset","content","http-equiv","media","name","scheme"])],["meter",new Set(["high","low","max","min","optimum","value"])],["object",new Set(["align","archive","border","classid","codebase","codetype","data","declare","form","height","hspace","name","standby","type","typemustmatch","usemap","vspace","width"])],["ol",new Set(["compact","reversed","start","type"])],["optgroup",new Set(["disabled","label"])],["option",new Set(["disabled","label","selected","value"])],["output",new Set(["for","form","name"])],["p",new Set(["align"])],["param",new Set(["name","type","value","valuetype"])],["pre",new Set(["width"])],["progress",new Set(["max","value"])],["q",new Set(["cite"])],["script",new Set(["async","blocking","charset","crossorigin","defer","fetchpriority","integrity","language","nomodule","referrerpolicy","src","type"])],["select",new Set(["autocomplete","disabled","form","multiple","name","required","size"])],["slot",new Set(["name"])],["source",new Set(["height","media","sizes","src","srcset","type","width"])],["style",new Set(["blocking","media","type"])],["table",new Set(["align","bgcolor","border","cellpadding","cellspacing","frame","rules","summary","width"])],["tbody",new Set(["align","char","charoff","valign"])],["td",new Set(["abbr","align","axis","bgcolor","char","charoff","colspan","headers","height","nowrap","rowspan","scope","valign","width"])],["template",new Set(["shadowrootclonable","shadowrootcustomelementregistry","shadowrootdelegatesfocus","shadowrootmode","shadowrootserializable"])],["textarea",new Set(["autocomplete","cols","dirname","disabled","form","maxlength","minlength","name","placeholder","readonly","required","rows","wrap"])],["tfoot",new Set(["align","char","charoff","valign"])],["th",new Set(["abbr","align","axis","bgcolor","char","charoff","colspan","headers","height","nowrap","rowspan","scope","valign","width"])],["thead",new Set(["align","char","charoff","valign"])],["time",new Set(["datetime"])],["tr",new Set(["align","bgcolor","char","charoff","valign"])],["track",new Set(["default","kind","label","src","srclang"])],["ul",new Set(["compact","type"])],["video",new Set(["autoplay","controls","crossorigin","height","loop","muted","playsinline","poster","preload","src","width"])]]),nee=new Set(["a","abbr","acronym","address","applet","area","article","aside","audio","b","base","basefont","bdi","bdo","bgsound","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","command","content","data","datalist","dd","del","details","dfn","dialog","dir","div","dl","dt","em","embed","fencedframe","fieldset","figcaption","figure","font","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","image","img","input","ins","isindex","kbd","keygen","label","legend","li","link","listing","main","map","mark","marquee","math","menu","menuitem","meta","meter","multicol","nav","nextid","nobr","noembed","noframes","noscript","object","ol","optgroup","option","output","p","param","picture","plaintext","pre","progress","q","rb","rbc","rp","rt","rtc","ruby","s","samp","script","search","section","select","selectedcontent","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","tt","u","ul","var","video","wbr","xmp"]),Kh={attrs:!0,children:!0,cases:!0,expression:!0},Lx=new Set(["parent"]),va,Sb,wb,ree=class cc{constructor(e={}){a9(this,va),lx(this,"kind"),lx(this,"parent");for(let n of new Set([...Lx,...Object.keys(e)]))this.setProperty(n,e[n]);if(dm(e))for(let n of Object.getOwnPropertySymbols(e))this.setProperty(n,e[n])}setProperty(e,n){if(this[e]!==n){if(e in Kh&&(n=n.map(r=>this.createChild(r))),!Lx.has(e)){this[e]=n;return}Object.defineProperty(this,e,{value:n,enumerable:!1,configurable:!0})}}map(e){let n;for(let r in Kh){let i=this[r];if(i){let s=see(i,o=>o.map(e));n!==i&&(n||(n=new cc({parent:this.parent})),n.setProperty(r,s))}}if(n)for(let r in this)r in Kh||(n[r]=this[r]);return e(n||this)}walk(e){for(let n in Kh){let r=this[n];if(r)for(let i=0;i[e.fullName,e.value]))}};va=new WeakSet,Sb=function(){return this.kind==="angularIcuCase"?"expression":this.kind==="angularIcuExpression"?"cases":"children"},wb=function(){var t;return((t=this.parent)==null?void 0:t.$children)??[]};var iee=ree;function see(t,e){let n=t.map(e);return n.some((r,i)=>r!==t[i])?n:t}var oee=[{regex:/^(?\[if(?[^\]]*)\]>)(?.*?)[^\]]*)\]>{try{return[!0,n(s,a).children]}catch{return[!1,[{kind:"text",value:s,sourceSpan:new _e(a,l)}]]}})();return{kind:"ieConditionalComment",complete:c,children:u,condition:kn(0,i.trim(),/\s+/gu," "),sourceSpan:t.sourceSpan,startSourceSpan:new _e(t.sourceSpan.start,a),endSourceSpan:new _e(l,t.sourceSpan.end)}}function cee(t,e){let{condition:n}=e.groups;return{kind:"ieConditionalStartComment",condition:kn(0,n.trim(),/\s+/gu," "),sourceSpan:t.sourceSpan}}function uee(t){return{kind:"ieConditionalEndComment",sourceSpan:t.sourceSpan}}var hee=class extends d1{visitExpansionCase(t,e){e.parseOptions.name==="angular"&&this.visitChildren(e,n=>{n(t.expression)})}visit(t,{parseOptions:e}){gee(t),Oee(t,e),bee(t,e),yee(t)}};function dee(t,e,n,r){k2(new hee,t.children,{parseOptions:n}),e&&t.children.unshift(e);let i=new iee(t);return i.walk(s=>{if(s.kind==="comment"){let o=aee(s,r);o&&s.parent.replaceChild(s,o)}pee(s),fee(s),mee(s)}),i}function pee(t){if(t.kind==="block"){if(t.name=kn(0,t.name.toLowerCase(),/\s+/gu," ").trim(),t.kind="angularControlFlowBlock",!nT(t.parameters)){delete t.parameters;return}for(let e of t.parameters)e.kind="angularControlFlowBlockParameter";t.parameters={kind:"angularControlFlowBlockParameters",children:t.parameters,sourceSpan:new _e(t.parameters[0].sourceSpan.start,bl(0,t.parameters,-1).sourceSpan.end)}}}function fee(t){t.kind==="letDeclaration"&&(t.kind="angularLetDeclaration",t.id=t.name,t.init={kind:"angularLetDeclarationInitializer",sourceSpan:new _e(t.valueSpan.start,t.valueSpan.end),value:t.value},delete t.name,delete t.value)}function mee(t){t.kind==="expansion"&&(t.kind="angularIcuExpression"),t.kind==="expansionCase"&&(t.kind="angularIcuCase")}function Qx(t,e){let n=t.toLowerCase();return e(n)?n:t}function $x(t){let e=t.name.startsWith(":")?t.name.slice(1).split(":")[0]:null,n=t.nameSpan.toString(),r=e!==null&&n.startsWith(`${e}:`),i=r?n.slice(e.length+1):n;t.name=i,t.namespace=e,t.hasExplicitNamespace=r}function gee(t){switch(t.kind){case"element":$x(t);for(let e of t.attrs)$x(e),e.valueSpan?(e.value=e.valueSpan.toString(),/["']/u.test(e.value[0])&&(e.value=e.value.slice(1,-1))):e.value=null;break;case"comment":t.value=t.sourceSpan.toString().slice(4,-3);break;case"text":t.value=t.sourceSpan.toString();break}}function Oee(t,e){if(t.kind==="element"){let n=Ob(e.isTagNameCaseSensitive?t.name:t.name.toLowerCase());!t.namespace||t.namespace===n.implicitNamespacePrefix||Gu(t)?t.tagDefinition=n:t.tagDefinition=Ob("")}}function yee(t){t.sourceSpan&&t.endSourceSpan&&(t.sourceSpan=new _e(t.sourceSpan.start,t.endSourceSpan.end))}function bee(t,e){if(t.kind==="element"&&(e.normalizeTagName&&(!t.namespace||t.namespace===t.tagDefinition.implicitNamespacePrefix||Gu(t))&&(t.name=Qx(t.name,n=>nee.has(n))),e.normalizeAttributeName))for(let n of t.attrs)n.namespace||(n.name=Qx(n.name,r=>uO.has(t.name)&&(uO.get("*").has(r)||uO.get(t.name).has(r))))}function N2(t,e){let{rootNodes:n,errors:r}=Tb(t,P2(e));return r.length>0&&kb(r[0]),{parseOptions:e,rootNodes:n}}function Eee(t,e){let n=P2(e),{rootNodes:r,errors:i}=Tb(t,n);if(r.some(l=>l.kind==="docType"&&l.value==="html"||l.kind==="element"&&l.name.toLowerCase()==="html"))return N2(t,hT);let s,o=()=>s??(s=Tb(t,{...n,getTagContentType:void 0})),a=l=>{let{offset:c}=l.startSourceSpan.start;return o().rootNodes.find(u=>u.kind==="element"&&u.startSourceSpan.start.offset===c)??l};for(let[l,c]of r.entries())if(c.kind==="element"){if(c.isVoid)i=o().errors,r[l]=a(c);else if(vee(c)){let{endSourceSpan:u,startSourceSpan:h}=c,d=o().errors.find(p=>p.span.start.offset>h.start.offset&&p.span.start.offset0&&kb(i[0]),{parseOptions:e,rootNodes:r}}function vee(t){var n;if(t.kind!=="element"||t.name!=="template")return!1;let e=(n=t.attrs.find(r=>r.name==="lang"))==null?void 0:n.value;return!e||e==="html"}function kb(t){let{msg:e,span:{start:n,end:r}}=t;throw eee(e,{loc:{start:{line:n.line+1,column:n.col+1},end:{line:r.line+1,column:r.col+1}},cause:t})}function Tee(t,e,n,r,i,s){let{offset:o}=r,a=kn(0,e.slice(0,o),/[^\n]/gu," ")+n,l=R2(a,t,{...i,shouldParseFrontMatter:!1},s);l.sourceSpan=new _e(r,bl(0,l.children,-1).sourceSpan.end);let c=l.children[0];return c.length===o?l.children.shift():(c.sourceSpan=new _e(c.sourceSpan.start.moveBy(o),c.sourceSpan.end),c.value=c.value.slice(o)),l}function R2(t,e,n,r={}){let{frontMatter:i,content:s}=n.shouldParseFrontMatter?nK(t):{content:t},o=new w2(t,r.filepath),a=new yb(o,0,0,0),l=a.moveBy(t.length),{parseOptions:c,rootNodes:u}=e(s,n),h={kind:"root",sourceSpan:new _e(a,l),children:u},d;if(i){let[p,f]=[i.start,i.end].map(m=>new yb(o,m.index,m.line-1,m.column));d={...i,kind:"frontMatter",sourceSpan:new _e(p,f)}}return dee(h,d,c,(p,f)=>Tee(e,t,p,f,c,r))}var hT=A2({name:"html",normalizeTagName:!0,normalizeAttributeName:!0,allowHtmComponentClosingTags:!0});function th(t){let e=A2(t),n=e.name==="vue"?Eee:N2;return{parse:(r,i)=>R2(r,n,e,i),hasPragma:LJ,hasIgnorePragma:QJ,astFormat:"html",locStart:Ku,locEnd:mm}}var See=th(hT),wee=new Set(["mj-style","mj-raw"]),kee=th({...hT,name:"mjml",shouldParseAsRawText:t=>wee.has(t)}),_ee=th({name:"angular",tokenizeAngularBlocks:!0,tokenizeAngularLetDeclaration:!0}),xee=th({name:"vue",isTagNameCaseSensitive:!0,shouldParseAsRawText(t,e,n,r){return t.toLowerCase()!=="html"&&!n&&(t!=="template"||r.some(({name:i,value:s})=>i==="lang"&&s!=="html"&&s!==""&&s!==void 0))}}),Cee=th({name:"lwc",canSelfClose:!1}),Dee={html:W1},Aee=Object.create,dT=Object.defineProperty,Pee=Object.getOwnPropertyDescriptor,Nee=Object.getOwnPropertyNames,Ree=Object.getPrototypeOf,Mee=Object.prototype.hasOwnProperty,Iee=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),pT=(t,e)=>{for(var n in e)dT(t,n,{get:e[n],enumerable:!0})},Lee=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Nee(e))!Mee.call(t,i)&&i!==n&&dT(t,i,{get:()=>e[i],enumerable:!(r=Pee(e,i))||r.enumerable});return t},Qee=(t,e,n)=>(n=t!=null?Aee(Ree(t)):{},Lee(dT(n,"default",{value:t,enumerable:!0}),t)),$ee=Iee((t,e)=>{var n,r,i,s,o,a,l,c,u,h,d,p,f,m,g,y,b,T,S;f=/\/(?![*\/])(?:\[(?:[^\]\\\n\r\u2028\u2029]+|\\.)*\]|[^\/\\\n\r\u2028\u2029]+|\\.)*(\/[$_\u200C\u200D\p{ID_Continue}]*|\\)?/yu,p=/--|\+\+|=>|\.{3}|\??\.(?!\d)|(?:&&|\|\||\?\?|[+\-%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2}|\/(?![\/*]))=?|[?~,:;[\](){}]/y,n=/(\x23?)(?=[$_\p{ID_Start}\\])(?:[$_\u200C\u200D\p{ID_Continue}]+|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+/yu,g=/(['"])(?:[^'"\\\n\r]+|(?!\1)['"]|\\(?:\r\n|[^]))*(\1)?/y,d=/(?:0[xX][\da-fA-F](?:_?[\da-fA-F])*|0[oO][0-7](?:_?[0-7])*|0[bB][01](?:_?[01])*)n?|0n|[1-9](?:_?\d)*n|(?:(?:0(?!\d)|0\d*[89]\d*|[1-9](?:_?\d)*)(?:\.(?:\d(?:_?\d)*)?)?|\.\d(?:_?\d)*)(?:[eE][+-]?\d(?:_?\d)*)?|0[0-7]+/y,y=/[`}](?:[^`\\$]+|\\[^]|\$(?!\{))*(`|\$\{)?/y,S=/[\t\v\f\ufeff\p{Zs}]+/yu,c=/\r?\n|[\r\u2028\u2029]/y,u=/\/\*(?:[^*]+|\*(?!\/))*(\*\/)?/y,m=/\/\/.*/y,i=/[<>.:={}]|\/(?![\/*])/y,r=/[$_\p{ID_Start}][$_\u200C\u200D\p{ID_Continue}-]*/yu,s=/(['"])(?:[^'"]+|(?!\1)['"])*(\1)?/y,o=/[^<>{}]+/y,T=/^(?:[\/+-]|\.{3}|\?(?:InterpolationIn(?:JSX|Template)|NoLineTerminatorHere|NonExpressionParenEnd|UnaryIncDec))?$|[{}([,;<>=*%&|^!~?:]$/,b=/^(?:=>|[;\]){}]|else|\?(?:NoLineTerminatorHere|NonExpressionParenEnd))?$/,a=/^(?:await|case|default|delete|do|else|instanceof|new|return|throw|typeof|void|yield)$/,l=/^(?:return|throw|yield)$/,h=RegExp(c.source),e.exports=function*(w,{jsx:A=!1}={}){var C,N,$,I,L,Z,B,j,U,J,fe,z,ne,Oe;for({length:Z}=w,I=0,L="",Oe=[{tag:"JS"}],C=[],fe=0,z=!1;I":Oe.pop(),L==="/"||j.tag==="JSXTagEnd"?(J="?JSX",z=!0):Oe.push({tag:"JSXChildren"});break;case"{":Oe.push({tag:"InterpolationInJSX",nesting:C.length}),J="?InterpolationInJSX",z=!1;break;case"/":L==="<"&&(Oe.pop(),Oe[Oe.length-1].tag==="JSXChildren"&&Oe.pop(),Oe.push({tag:"JSXTagEnd"}))}L=J,yield{type:"JSXPunctuator",value:B[0]};continue}if(r.lastIndex=I,B=r.exec(w)){I=r.lastIndex,L=B[0],yield{type:"JSXIdentifier",value:B[0]};continue}if(s.lastIndex=I,B=s.exec(w)){I=s.lastIndex,L=B[0],yield{type:"JSXString",value:B[0],closed:B[2]!==void 0};continue}break;case"JSXChildren":if(o.lastIndex=I,B=o.exec(w)){I=o.lastIndex,L=B[0],yield{type:"JSXText",value:B[0]};continue}switch(w[I]){case"<":Oe.push({tag:"JSXTag"}),I++,L="<",yield{type:"JSXPunctuator",value:"<"};continue;case"{":Oe.push({tag:"InterpolationInJSX",nesting:C.length}),I++,L="?InterpolationInJSX",z=!1,yield{type:"JSXPunctuator",value:"{"};continue}}if(S.lastIndex=I,B=S.exec(w)){I=S.lastIndex,yield{type:"WhiteSpace",value:B[0]};continue}if(c.lastIndex=I,B=c.exec(w)){I=c.lastIndex,z=!1,l.test(L)&&(L="?NoLineTerminatorHere"),yield{type:"LineTerminatorSequence",value:B[0]};continue}if(u.lastIndex=I,B=u.exec(w)){I=u.lastIndex,h.test(B[0])&&(z=!1,l.test(L)&&(L="?NoLineTerminatorHere")),yield{type:"MultiLineComment",value:B[0],closed:B[1]!==void 0};continue}if(m.lastIndex=I,B=m.exec(w)){I=m.lastIndex,z=!1,yield{type:"SingleLineComment",value:B[0]};continue}N=String.fromCodePoint(w.codePointAt(I)),I+=N.length,L=N,z=!1,yield{type:j.tag.startsWith("JSX")?"JSXInvalid":"Invalid",value:N}}}}),M2={};pT(M2,{__debug:()=>bie,check:()=>Oie,doc:()=>xQ,format:()=>AQ,formatWithCursor:()=>DQ,getSupportInfo:()=>yie,util:()=>CQ,version:()=>Xre});var nh=(t,e)=>(n,r,...i)=>n|1&&r==null?void 0:(e.call(r)??r[t]).apply(r,i),Fee=String.prototype.replaceAll??function(t,e){return t.global?this.replace(t,e):this.split(t).join(e)},Bee=nh("replaceAll",function(){if(typeof this=="string")return Fee}),Em=Bee,jee=class{diff(t,e,n={}){let r;typeof n=="function"?(r=n,n={}):"callback"in n&&(r=n.callback);let i=this.castInput(t,n),s=this.castInput(e,n),o=this.removeEmpty(this.tokenize(i,n)),a=this.removeEmpty(this.tokenize(s,n));return this.diffWithOptionsObj(o,a,n,r)}diffWithOptionsObj(t,e,n,r){var i;let s=y=>{if(y=this.postProcess(y,n),r){setTimeout(function(){r(y)},0);return}else return y},o=e.length,a=t.length,l=1,c=o+a;n.maxEditLength!=null&&(c=Math.min(c,n.maxEditLength));let u=(i=n.timeout)!==null&&i!==void 0?i:1/0,h=Date.now()+u,d=[{oldPos:-1,lastComponent:void 0}],p=this.extractCommon(d[0],e,t,0,n);if(d[0].oldPos+1>=a&&p+1>=o)return s(this.buildValues(d[0].lastComponent,e,t));let f=-1/0,m=1/0,g=()=>{for(let y=Math.max(f,-l);y<=Math.min(m,l);y+=2){let b,T=d[y-1],S=d[y+1];T&&(d[y-1]=void 0);let w=!1;if(S){let C=S.oldPos-y;w=S&&0<=C&&C=a&&p+1>=o)return s(this.buildValues(b.lastComponent,e,t))||!0;d[y]=b,b.oldPos+1>=a&&(m=Math.min(m,y-1)),p+1>=o&&(f=Math.max(f,y+1))}l++};if(r)(function y(){setTimeout(function(){if(l>c||Date.now()>h)return r(void 0);g()||y()},0)})();else for(;l<=c&&Date.now()<=h;){let y=g();if(y)return y}}addToPath(t,e,n,r,i){let s=t.lastComponent;return s&&!i.oneChangePerToken&&s.added===e&&s.removed===n?{oldPos:t.oldPos+r,lastComponent:{count:s.count+1,added:e,removed:n,previousComponent:s.previousComponent}}:{oldPos:t.oldPos+r,lastComponent:{count:1,added:e,removed:n,previousComponent:s}}}extractCommon(t,e,n,r,i){let s=e.length,o=n.length,a=t.oldPos,l=a-r,c=0;for(;l+1h.length?p:h}),c.value=this.join(u)}else c.value=this.join(e.slice(a,a+c.count));a+=c.count,c.added||(l+=c.count)}}return r}},zee=class extends jee{tokenize(t){return t.slice()}join(t){return t}removeEmpty(t){return t}},Vee=new zee;function Uee(t,e,n){return Vee.diff(t,e,n)}function Hee(t){let e=t.indexOf("\r");return e!==-1?t.charAt(e+1)===` `?"crlf":"cr":"lf"}function fT(t){switch(t){case"cr":return"\r";case"crlf":return`\r `;default:return` `}}function I2(t,e){let n;switch(e){case` `:n=/\n/gu;break;case"\r":n=/\r/gu;break;case`\r `:n=/\r\n/gu;break;default:throw new Error(`Unexpected "eol" ${JSON.stringify(e)}.`)}let r=t.match(n);return r?r.length:0}function Xee(t){return Em(0,t,/\r\n?/gu,` `)}function qee(t){return this[t<0?this.length+t:t]}var Zee=nh("at",function(){if(Array.isArray(this)||typeof this=="string")return qee}),Lt=Zee,Wee=()=>{},Gee=Wee,ta="string",Ji="array",no="cursor",ts="indent",ns="align",rs="trim",Qn="group",gi="fill",Gn="if-break",is="indent-if-break",ss="line-suffix",as="line-suffix-boundary",on="line",Oi="label",br="break-parent",L2=new Set([no,ts,ns,rs,Qn,gi,Gn,is,ss,as,on,Oi,br]);function Yee(t){let e=t.length;for(;e>0&&(t[e-1]==="\r"||t[e-1]===` `);)e--;return enew Intl.ListFormat("en-US",{type:"disjunction"}).format(t);function ete(t){let e=t===null?"null":typeof t;if(e!=="string"&&e!=="object")return`Unexpected doc '${e}', Expected it to be 'string' or 'object'.`;if(na(t))throw new Error("doc is valid.");let n=Object.prototype.toString.call(t);if(n!=="[object Object]")return`Unexpected doc '${n}'.`;let r=Jee([...L2].map(i=>`'${i}'`));return`Unexpected doc.type '${t.type}'. Expected it to be ${r}.`}var tte=class extends Error{constructor(e){super(ete(e));V(this,"name","InvalidDocError");this.doc=e}},cl=tte,Fx={};function nte(t,e,n,r){let i=[t];for(;i.length>0;){let s=i.pop();if(s===Fx){n(i.pop());continue}n&&i.push(s,Fx);let o=na(s);if(!o)throw new cl(s);if((e==null?void 0:e(s))!==!1)switch(o){case Ji:case gi:{let a=o===Ji?s:s.parts;for(let l=a.length,c=l-1;c>=0;--c)i.push(a[c]);break}case Gn:i.push(s.flatContents,s.breakContents);break;case Qn:if(r&&s.expandedStates)for(let a=s.expandedStates.length,l=a-1;l>=0;--l)i.push(s.expandedStates[l]);else i.push(s.contents);break;case ns:case ts:case is:case Oi:case ss:i.push(s.contents);break;case ta:case no:case rs:case as:case on:case br:break;default:throw new cl(s)}}}var mT=nte;function vm(t,e){if(typeof t=="string")return e(t);let n=new Map;return r(t);function r(s){if(n.has(s))return n.get(s);let o=i(s);return n.set(s,o),o}function i(s){switch(na(s)){case Ji:return e(s.map(r));case gi:return e({...s,parts:s.parts.map(r)});case Gn:return e({...s,breakContents:r(s.breakContents),flatContents:r(s.flatContents)});case Qn:{let{expandedStates:o,contents:a}=s;return o?(o=o.map(r),a=o[0]):a=r(a),e({...s,contents:a,expandedStates:o})}case ns:case ts:case is:case Oi:case ss:return e({...s,contents:r(s.contents)});case ta:case no:case rs:case as:case on:case br:return e(s);default:throw new cl(s)}}}function gT(t,e,n){let r=n,i=!1;function s(o){if(i)return!1;let a=e(o);a!==void 0&&(i=!0,r=a)}return mT(t,s),r}function rte(t){if(t.type===Qn&&t.break||t.type===on&&t.hard||t.type===br)return!0}function ite(t){return gT(t,rte,!1)}function Bx(t){if(t.length>0){let e=Lt(0,t,-1);!e.expandedStates&&!e.break&&(e.break="propagated")}return null}function ste(t){let e=new Set,n=[];function r(s){if(s.type===br&&Bx(n),s.type===Qn){if(n.push(s),e.has(s))return!1;e.add(s)}}function i(s){s.type===Qn&&n.pop().break&&Bx(n)}mT(t,r,i,!0)}function ote(t){return t.type===on&&!t.hard?t.soft?"":" ":t.type===Gn?t.flatContents:t}function ate(t){return vm(t,ote)}function jx(t){for(t=[...t];t.length>=2&&Lt(0,t,-2).type===on&&Lt(0,t,-1).type===br;)t.length-=2;if(t.length>0){let e=Cc(Lt(0,t,-1));t[t.length-1]=e}return t}function Cc(t){switch(na(t)){case ts:case is:case Qn:case ss:case Oi:{let e=Cc(t.contents);return{...t,contents:e}}case Gn:return{...t,breakContents:Cc(t.breakContents),flatContents:Cc(t.flatContents)};case gi:return{...t,parts:jx(t.parts)};case Ji:return jx(t);case ta:return Yee(t);case ns:case no:case rs:case as:case on:case br:break;default:throw new cl(t)}return t}function Q2(t){return Cc(cte(t))}function lte(t){switch(na(t)){case gi:if(t.parts.every(e=>e===""))return"";break;case Qn:if(!t.contents&&!t.id&&!t.break&&!t.expandedStates)return"";if(t.contents.type===Qn&&t.contents.id===t.id&&t.contents.break===t.break&&t.contents.expandedStates===t.expandedStates)return t.contents;break;case ns:case ts:case is:case ss:if(!t.contents)return"";break;case Gn:if(!t.flatContents&&!t.breakContents)return"";break;case Ji:{let e=[];for(let n of t){if(!n)continue;let[r,...i]=Array.isArray(n)?n:[n];typeof r=="string"&&typeof Lt(0,e,-1)=="string"?e[e.length-1]+=r:e.push(r),e.push(...i)}return e.length===0?"":e.length===1?e[0]:e}case ta:case no:case rs:case as:case on:case Oi:case br:break;default:throw new cl(t)}return t}function cte(t){return vm(t,e=>lte(e))}function ute(t,e=U2){return vm(t,n=>typeof n=="string"?j2(e,n.split(` `)):n)}function hte(t){if(t.type===on)return!0}function dte(t){return gT(t,hte,!1)}function $d(t,e){return t.type===Oi?{...t,contents:e(t.contents)}:e(t)}var pte=Gee;function Pp(t){return{type:ts,contents:t}}function ul(t,e){return{type:ns,contents:e,n:t}}function fte(t){return ul(Number.NEGATIVE_INFINITY,t)}function $2(t){return ul({type:"root"},t)}function mte(t){return ul(-1,t)}function F2(t,e,n){let r=t;if(e>0){for(let i=0;i0?`, { ${u.join(", ")} }`:"";return`indentIfBreak(${r(s.contents)}${h})`}if(s.type===Qn){let u=[];s.break&&s.break!=="propagated"&&u.push("shouldBreak: true"),s.id&&u.push(`id: ${i(s.id)}`);let h=u.length>0?`, { ${u.join(", ")} }`:"";return s.expandedStates?`conditionalGroup([${s.expandedStates.map(d=>r(d)).join(",")}]${h})`:`group(${r(s.contents)}${h})`}if(s.type===gi)return`fill([${s.parts.map(u=>r(u)).join(", ")}])`;if(s.type===ss)return"lineSuffix("+r(s.contents)+")";if(s.type===as)return"lineSuffixBoundary";if(s.type===Oi)return`label(${JSON.stringify(s.label)}, ${r(s.contents)})`;if(s.type===no)return"cursor";throw new Error("Unknown doc type "+s.type)}function i(s){if(typeof s!="symbol")return JSON.stringify(String(s));if(s in e)return e[s];let o=s.description||"symbol";for(let a=0;;a++){let l=o+(a>0?` #${a}`:"");if(!n.has(l))return n.add(l),e[s]=`Symbol.for(${JSON.stringify(l)})`}}}var kte=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;function _te(t){return t===12288||t>=65281&&t<=65376||t>=65504&&t<=65510}function xte(t){return t>=4352&&t<=4447||t===8986||t===8987||t===9001||t===9002||t>=9193&&t<=9196||t===9200||t===9203||t===9725||t===9726||t===9748||t===9749||t>=9776&&t<=9783||t>=9800&&t<=9811||t===9855||t>=9866&&t<=9871||t===9875||t===9889||t===9898||t===9899||t===9917||t===9918||t===9924||t===9925||t===9934||t===9940||t===9962||t===9970||t===9971||t===9973||t===9978||t===9981||t===9989||t===9994||t===9995||t===10024||t===10060||t===10062||t>=10067&&t<=10069||t===10071||t>=10133&&t<=10135||t===10160||t===10175||t===11035||t===11036||t===11088||t===11093||t>=11904&&t<=11929||t>=11931&&t<=12019||t>=12032&&t<=12245||t>=12272&&t<=12287||t>=12289&&t<=12350||t>=12353&&t<=12438||t>=12441&&t<=12543||t>=12549&&t<=12591||t>=12593&&t<=12686||t>=12688&&t<=12773||t>=12783&&t<=12830||t>=12832&&t<=12871||t>=12880&&t<=42124||t>=42128&&t<=42182||t>=43360&&t<=43388||t>=44032&&t<=55203||t>=63744&&t<=64255||t>=65040&&t<=65049||t>=65072&&t<=65106||t>=65108&&t<=65126||t>=65128&&t<=65131||t>=94176&&t<=94180||t>=94192&&t<=94198||t>=94208&&t<=101589||t>=101631&&t<=101662||t>=101760&&t<=101874||t>=110576&&t<=110579||t>=110581&&t<=110587||t===110589||t===110590||t>=110592&&t<=110882||t===110898||t>=110928&&t<=110930||t===110933||t>=110948&&t<=110951||t>=110960&&t<=111355||t>=119552&&t<=119638||t>=119648&&t<=119670||t===126980||t===127183||t===127374||t>=127377&&t<=127386||t>=127488&&t<=127490||t>=127504&&t<=127547||t>=127552&&t<=127560||t===127568||t===127569||t>=127584&&t<=127589||t>=127744&&t<=127776||t>=127789&&t<=127797||t>=127799&&t<=127868||t>=127870&&t<=127891||t>=127904&&t<=127946||t>=127951&&t<=127955||t>=127968&&t<=127984||t===127988||t>=127992&&t<=128062||t===128064||t>=128066&&t<=128252||t>=128255&&t<=128317||t>=128331&&t<=128334||t>=128336&&t<=128359||t===128378||t===128405||t===128406||t===128420||t>=128507&&t<=128591||t>=128640&&t<=128709||t===128716||t>=128720&&t<=128722||t>=128725&&t<=128728||t>=128732&&t<=128735||t===128747||t===128748||t>=128756&&t<=128764||t>=128992&&t<=129003||t===129008||t>=129292&&t<=129338||t>=129340&&t<=129349||t>=129351&&t<=129535||t>=129648&&t<=129660||t>=129664&&t<=129674||t>=129678&&t<=129734||t===129736||t>=129741&&t<=129756||t>=129759&&t<=129770||t>=129775&&t<=129784||t>=131072&&t<=196605||t>=196608&&t<=262141}var Cte="©®‼⁉™ℹ↔↕↖↗↘↙↩↪⌨⏏⏱⏲⏸⏹⏺▪▫▶◀◻◼☀☁☂☃☄☎☑☘☝☠☢☣☦☪☮☯☸☹☺♀♂♟♠♣♥♦♨♻♾⚒⚔⚕⚖⚗⚙⚛⚜⚠⚧⚰⚱⛈⛏⛑⛓⛩⛱⛷⛸⛹✂✈✉✌✍✏✒✔✖✝✡✳✴❄❇❣❤➡⤴⤵⬅⬆⬇",Dte=/[^\x20-\x7F]/u,Ate=new Set(Cte);function Pte(t){if(!t)return 0;if(!Dte.test(t))return t.length;t=t.replace(kte(),n=>Ate.has(n)?" ":" ");let e=0;for(let n of t){let r=n.codePointAt(0);r<=31||r>=127&&r<=159||r>=768&&r<=879||r>=65024&&r<=65039||(e+=_te(r)||xte(r)?2:1)}return e}var yT=Pte,Nte={type:0},Rte={type:1},H2={value:"",length:0,queue:[],get root(){return H2}};function X2(t,e,n){let r=e.type===1?t.queue.slice(0,-1):[...t.queue,e],i="",s=0,o=0,a=0;for(let f of r)switch(f.type){case 0:u(),n.useTabs?l(1):c(n.tabWidth);break;case 3:{let{string:m}=f;u(),i+=m,s+=m.length;break}case 2:{let{width:m}=f;o+=1,a+=m;break}default:throw new Error(`Unexpected indent comment '${f.type}'.`)}return d(),{...t,value:i,length:s,queue:r};function l(f){i+=" ".repeat(f),s+=n.tabWidth*f}function c(f){i+=" ".repeat(f),s+=f}function u(){n.useTabs?h():d()}function h(){o>0&&l(o),p()}function d(){a>0&&c(a),p()}function p(){o=0,a=0}}function Mte(t,e,n){if(!e)return t;if(e.type==="root")return{...t,root:t};if(e===Number.NEGATIVE_INFINITY)return t.root;let r;return typeof e=="number"?e<0?r=Rte:r={type:2,width:e}:r={type:3,string:e},X2(t,r,n)}function Ite(t,e){return X2(t,Nte,e)}function Lte(t){let e=0;for(let n=t.length-1;n>=0;n--){let r=t[n];if(r===" "||r===" ")e++;else break}return e}function q2(t){let e=Lte(t);return{text:e===0?t:t.slice(0,t.length-e),count:e}}var Rn=Symbol("MODE_BREAK"),Hr=Symbol("MODE_FLAT"),xb=Symbol("DOC_FILL_PRINTED_LENGTH");function Jh(t,e,n,r,i,s){if(n===Number.POSITIVE_INFINITY)return!0;let o=e.length,a=!1,l=[t],c="";for(;n>=0;){if(l.length===0){if(o===0)return!0;l.push(e[--o]);continue}let{mode:u,doc:h}=l.pop(),d=na(h);switch(d){case ta:h&&(a&&(c+=" ",n-=1,a=!1),c+=h,n-=yT(h));break;case Ji:case gi:{let p=d===Ji?h:h.parts,f=h[xb]??0;for(let m=p.length-1;m>=f;m--)l.push({mode:u,doc:p[m]});break}case ts:case ns:case is:case Oi:l.push({mode:u,doc:h.contents});break;case rs:{let{text:p,count:f}=q2(c);c=p,n+=f;break}case Qn:{if(s&&h.break)return!1;let p=h.break?Rn:u,f=h.expandedStates&&p===Rn?Lt(0,h.expandedStates,-1):h.contents;l.push({mode:p,doc:f});break}case Gn:{let p=(h.groupId?i[h.groupId]||Hr:u)===Rn?h.breakContents:h.flatContents;p&&l.push({mode:u,doc:p});break}case on:if(u===Rn||h.hard)return!0;h.soft||(a=!0);break;case ss:r=!0;break;case as:if(r)return!1;break}}return!1}function Sm(t,e){let n=Object.create(null),r=e.printWidth,i=fT(e.endOfLine),s=0,o=[{indent:H2,mode:Rn,doc:t}],a="",l=!1,c=[],u=[],h=[],d=[],p=0;for(ste(t);o.length>0;){let{indent:b,mode:T,doc:S}=o.pop();switch(na(S)){case ta:{let w=i!==` `?Em(0,S,` `,i):S;w&&(a+=w,o.length>0&&(s+=yT(w)));break}case Ji:for(let w=S.length-1;w>=0;w--)o.push({indent:b,mode:T,doc:S[w]});break;case no:if(u.length>=2)throw new Error("There are too many 'cursor' in doc.");u.push(p+a.length);break;case ts:o.push({indent:Ite(b,e),mode:T,doc:S.contents});break;case ns:o.push({indent:Mte(b,S.n,e),mode:T,doc:S.contents});break;case rs:y();break;case Qn:switch(T){case Hr:if(!l){o.push({indent:b,mode:S.break?Rn:Hr,doc:S.contents});break}case Rn:{l=!1;let w={indent:b,mode:Hr,doc:S.contents},A=r-s,C=c.length>0;if(!S.break&&Jh(w,o,A,C,n))o.push(w);else if(S.expandedStates){let N=Lt(0,S.expandedStates,-1);if(S.break){o.push({indent:b,mode:Rn,doc:N});break}else for(let $=1;$=S.expandedStates.length){o.push({indent:b,mode:Rn,doc:N});break}else{let I=S.expandedStates[$],L={indent:b,mode:Hr,doc:I};if(Jh(L,o,A,C,n)){o.push(L);break}}}else o.push({indent:b,mode:Rn,doc:S.contents});break}}S.id&&(n[S.id]=Lt(0,o,-1).mode);break;case gi:{let w=r-s,A=S[xb]??0,{parts:C}=S,N=C.length-A;if(N===0)break;let $=C[A+0],I=C[A+1],L={indent:b,mode:Hr,doc:$},Z={indent:b,mode:Rn,doc:$},B=Jh(L,[],w,c.length>0,n,!0);if(N===1){B?o.push(L):o.push(Z);break}let j={indent:b,mode:Hr,doc:I},U={indent:b,mode:Rn,doc:I};if(N===2){B?o.push(j,L):o.push(U,Z);break}let J=C[A+2],fe={indent:b,mode:T,doc:{...S,[xb]:A+2}},z=Jh({indent:b,mode:Hr,doc:[$,I,J]},[],w,c.length>0,n,!0);o.push(fe),z?o.push(j,L):B?o.push(U,L):o.push(U,Z);break}case Gn:case is:{let w=S.groupId?n[S.groupId]:T;if(w===Rn){let A=S.type===Gn?S.breakContents:S.negate?S.contents:Pp(S.contents);A&&o.push({indent:b,mode:T,doc:A})}if(w===Hr){let A=S.type===Gn?S.flatContents:S.negate?Pp(S.contents):S.contents;A&&o.push({indent:b,mode:T,doc:A})}break}case ss:c.push({indent:b,mode:T,doc:S.contents});break;case as:c.length>0&&o.push({indent:b,mode:T,doc:OT});break;case on:switch(T){case Hr:if(S.hard)l=!0;else{S.soft||(a+=" ",s+=1);break}case Rn:if(c.length>0){o.push({indent:b,mode:T,doc:S},...c.reverse()),c.length=0;break}S.literal?(a+=i,s=0,b.root&&(b.root.value&&(a+=b.root.value),s=b.root.length)):(y(),a+=i+b.value,s=b.length);break}break;case Oi:o.push({indent:b,mode:T,doc:S.contents});break;case br:break;default:throw new cl(S)}o.length===0&&c.length>0&&(o.push(...c.reverse()),c.length=0)}let f=h.join("")+a,m=[...d,...u];if(m.length!==2)return{formatted:f};let g=m[0];return{formatted:f,cursorNodeStart:g,cursorNodeText:f.slice(g,Lt(0,m,-1))};function y(){let{text:b,count:T}=q2(a);b&&(h.push(b),p+=b.length),a="",s-=T,u.length>0&&(d.push(...u.map(S=>Math.min(S,p))),u.length=0)}}function Qte(t,e,n=0){let r=0;for(let i=n;i1?Lt(0,t,-2):null}getValue(){return Lt(0,this.stack,-1)}getNode(t=0){let e=co(this,Zi,Cb).call(this,t);return e===-1?null:this.stack[e]}getParentNode(t=0){return this.getNode(t+1)}call(t,...e){let{stack:n}=this,{length:r}=n,i=Lt(0,n,-1);for(let s of e)i=i==null?void 0:i[s],n.push(s,i);try{return t(this)}finally{n.length=r}}callParent(t,e=0){let n=co(this,Zi,Cb).call(this,e+1),r=this.stack.splice(n+1);try{return t(this)}finally{this.stack.push(...r)}}each(t,...e){let{stack:n}=this,{length:r}=n,i=Lt(0,n,-1);for(let s of e)i=i[s],n.push(s,i);try{for(let s=0;s{n[i]=t(r,i,s)},...e),n}match(...t){let e=this.stack.length-1,n=null,r=this.stack[e--];for(let i of t){if(r===void 0)return!1;let s=null;if(typeof n=="number"&&(s=n,n=this.stack[e--],r=this.stack[e--]),i&&!i(r,n,s))return!1;n=this.stack[e--],r=this.stack[e--]}return!0}findAncestor(t){for(let e of co(this,Zi,Fd).call(this))if(t(e))return e}hasAncestor(t){for(let e of co(this,Zi,Fd).call(this))if(t(e))return!0;return!1}},Zi=new WeakSet,Cb=function(t){let{stack:e}=this;for(let n=e.length-1;n>=0;n-=2)if(!Array.isArray(e[n])&&--t<0)return n;return-1},Fd=function*(){let{stack:t}=this;for(let e=t.length-3;e>=0;e-=2){let n=t[e];Array.isArray(n)||(yield n)}},rA),Fte=$te;function rh(t){return(e,n,r)=>{let i=!!(r!=null&&r.backwards);if(n===!1)return!1;let{length:s}=e,o=n;for(;o>=0&&ot===` `||t==="\r"||t==="\u2028"||t==="\u2029";function jte(t,e,n){let r=!!(n!=null&&n.backwards);if(e===!1)return!1;let i=t.charAt(e);if(r){if(t.charAt(e-1)==="\r"&&i===` `)return e-2;if(zx(i))return e-1}else{if(i==="\r"&&t.charAt(e+1)===` `)return e+2;if(zx(i))return e+1}return e}var qo=jte;function zte(t,e,n={}){let r=Gs(t,n.backwards?e-1:e,n),i=qo(t,r,n);return r!==i}var js=zte;function Vte(t){return Array.isArray(t)&&t.length>0}var Ute=Vte;function Hte(t){return t!==null&&typeof t=="object"}var G2=Hte;function*wm(t,e){let{getVisitorKeys:n,filter:r=()=>!0}=e,i=s=>G2(s)&&r(s);for(let s of n(t)){let o=t[s];if(Array.isArray(o))for(let a of o)i(a)&&(yield a);else i(o)&&(yield o)}}function*Xte(t,e){let n=[t];for(let r=0;r(s??(s=[t,...e]),i(u,s)?[u]:Y2(u,s,n))),{locStart:a,locEnd:l}=n;return o.sort((u,h)=>a(u)-a(h)||l(u)-l(h)),r.set(t,o),o}var K2=Y2;function Zte(t){let e=t.type||t.kind||"(unknown type)",n=String(t.name||t.id&&(typeof t.id=="object"?t.id.name:t.id)||t.key&&(typeof t.key=="object"?t.key.name:t.key)||t.value&&(typeof t.value=="object"?"":String(t.value))||t.operator||"");return n.length>20&&(n=n.slice(0,19)+"…"),e+(n?" "+n:"")}function ET(t,e){(t.comments??(t.comments=[])).push(e),e.printed=!1,e.nodeDescription=Zte(t)}function Dc(t,e){e.leading=!0,e.trailing=!1,ET(t,e)}function Bd(t,e,n){e.leading=!1,e.trailing=!1,n&&(e.marker=n),ET(t,e)}function Ac(t,e){e.leading=!1,e.trailing=!0,ET(t,e)}var J2=new WeakMap;function eQ(t,e,n,r,i=[]){let{locStart:s,locEnd:o}=n,a=s(e),l=o(e),c=K2(t,i,{cache:J2,locStart:s,locEnd:o,getVisitorKeys:n.getVisitorKeys,filter:n.printer.canAttachComment,getChildren:n.printer.getCommentChildNodes}),u,h,d=0,p=c.length;for(;d>1,m=c[f],g=s(m),y=o(m);if(g<=a&&l<=y)return eQ(m,e,n,m,[m,...i]);if(y<=a){u=m,d=f+1;continue}if(l<=g){h=m,p=f;continue}throw new Error("Comment location overlaps with node location")}if((r==null?void 0:r.type)==="TemplateLiteral"){let{quasis:f}=r,m=dO(f,e,n);u&&dO(f,u,n)!==m&&(u=null),h&&dO(f,h,n)!==m&&(h=null)}return{enclosingNode:r,precedingNode:u,followingNode:h}}var hO=()=>!1;function Wte(t,e){let{comments:n}=t;if(delete t.comments,!Ute(n)||!e.printer.canAttachComment)return;let r=[],{printer:{features:{experimental_avoidAstMutation:i},handleComments:s={}},originalText:o}=e,{ownLine:a=hO,endOfLine:l=hO,remaining:c=hO}=s,u=n.map((h,d)=>({...eQ(t,h,e),comment:h,text:o,options:e,ast:t,isLastComment:n.length-1===d}));for(let[h,d]of u.entries()){let{comment:p,precedingNode:f,enclosingNode:m,followingNode:g,text:y,options:b,ast:T,isLastComment:S}=d,w;if(i?w=[d]:(p.enclosingNode=m,p.precedingNode=f,p.followingNode=g,w=[p,y,b,T,S]),Gte(y,b,u,h))p.placement="ownLine",a(...w)||(g?Dc(g,p):f?Ac(f,p):Bd(m||T,p));else if(Yte(y,b,u,h))p.placement="endOfLine",l(...w)||(f?Ac(f,p):g?Dc(g,p):Bd(m||T,p));else if(p.placement="remaining",!c(...w))if(f&&g){let A=r.length;A>0&&r[A-1].followingNode!==g&&Vx(r,b),r.push(d)}else f?Ac(f,p):g?Dc(g,p):Bd(m||T,p)}if(Vx(r,e),!i)for(let h of n)delete h.precedingNode,delete h.enclosingNode,delete h.followingNode}var tQ=t=>!/[\S\n\u2028\u2029]/u.test(t);function Gte(t,e,n,r){let{comment:i,precedingNode:s}=n[r],{locStart:o,locEnd:a}=e,l=o(i);if(s)for(let c=r-1;c>=0;c--){let{comment:u,precedingNode:h}=n[c];if(h!==s||!tQ(t.slice(a(u),l)))break;l=o(u)}return js(t,l,{backwards:!0})}function Yte(t,e,n,r){let{comment:i,followingNode:s}=n[r],{locStart:o,locEnd:a}=e,l=a(i);if(s)for(let c=r+1;c0;--o){let{comment:c,precedingNode:u,followingNode:h}=t[o-1],d=e.originalText.slice(e.locEnd(c),s);if(((l=(a=e.printer).isGap)==null?void 0:l.call(a,d,e))??/^[\s(]*$/u.test(d))s=e.locStart(c);else break}for(let[c,{comment:u}]of t.entries())c1&&c.comments.sort((u,h)=>e.locStart(u)-e.locStart(h));t.length=0}function dO(t,e,n){let r=n.locStart(e)-1;for(let i=1;i!r.has(a)).length===0)return{leading:"",trailing:""};let i=[],s=[],o;return t.each(()=>{let a=t.node;if(r!=null&&r.has(a))return;let{leading:l,trailing:c}=a;l?i.push(Jte(t,e)):c&&(o=ene(t,e,o),s.push(o.doc))},"comments"),{leading:i,trailing:s}}function nne(t,e,n){let{leading:r,trailing:i}=tne(t,n);return!r&&!i?e:$d(e,s=>[r,s,i])}function rne(t){let{[Symbol.for("comments")]:e,[Symbol.for("printedComments")]:n}=t;for(let r of e){if(!r.printed&&!n.has(r))throw new Error('Comment "'+r.value.trim()+'" was not printed. Please report this error!');delete r.printed}}var rQ=class extends Error{constructor(){super(...arguments);V(this,"name","ConfigError")}},Ux=class extends Error{constructor(){super(...arguments);V(this,"name","UndefinedParserError")}},ine={checkIgnorePragma:{category:"Special",type:"boolean",default:!1,description:"Check whether the file's first docblock comment contains '@noprettier' or '@noformat' to determine if it should be formatted.",cliCategory:"Other"},cursorOffset:{category:"Special",type:"int",default:-1,range:{start:-1,end:1/0,step:1},description:"Print (to stderr) where a cursor at the given position would move to after formatting.",cliCategory:"Editor"},endOfLine:{category:"Global",type:"choice",default:"lf",description:"Which end of line characters to apply.",choices:[{value:"lf",description:"Line Feed only (\\n), common on Linux and macOS as well as inside git repos"},{value:"crlf",description:"Carriage Return + Line Feed characters (\\r\\n), common on Windows"},{value:"cr",description:"Carriage Return character only (\\r), used very rarely"},{value:"auto",description:`Maintain existing (mixed values within one file are normalised by looking at what's used after the first line)`}]},filepath:{category:"Special",type:"path",description:"Specify the input filepath. This will be used to do parser inference.",cliName:"stdin-filepath",cliCategory:"Other",cliDescription:"Path to the file to pretend that stdin comes from."},insertPragma:{category:"Special",type:"boolean",default:!1,description:"Insert @format pragma into file's first docblock comment.",cliCategory:"Other"},parser:{category:"Global",type:"choice",default:void 0,description:"Which parser to use.",exception:t=>typeof t=="string"||typeof t=="function",choices:[{value:"flow",description:"Flow"},{value:"babel",description:"JavaScript"},{value:"babel-flow",description:"Flow"},{value:"babel-ts",description:"TypeScript"},{value:"typescript",description:"TypeScript"},{value:"acorn",description:"JavaScript"},{value:"espree",description:"JavaScript"},{value:"meriyah",description:"JavaScript"},{value:"css",description:"CSS"},{value:"less",description:"Less"},{value:"scss",description:"SCSS"},{value:"json",description:"JSON"},{value:"json5",description:"JSON5"},{value:"jsonc",description:"JSON with Comments"},{value:"json-stringify",description:"JSON.stringify"},{value:"graphql",description:"GraphQL"},{value:"markdown",description:"Markdown"},{value:"mdx",description:"MDX"},{value:"vue",description:"Vue"},{value:"yaml",description:"YAML"},{value:"glimmer",description:"Ember / Handlebars"},{value:"html",description:"HTML"},{value:"angular",description:"Angular"},{value:"lwc",description:"Lightning Web Components"},{value:"mjml",description:"MJML"}]},plugins:{type:"path",array:!0,default:[{value:[]}],category:"Global",description:"Add a plugin. Multiple plugins can be passed as separate `--plugin`s.",exception:t=>typeof t=="string"||typeof t=="object",cliName:"plugin",cliCategory:"Config"},printWidth:{category:"Global",type:"int",default:80,description:"The line length where Prettier will try wrap.",range:{start:0,end:1/0,step:1}},rangeEnd:{category:"Special",type:"int",default:1/0,range:{start:0,end:1/0,step:1},description:`Format code ending at a given character offset (exclusive). The range will extend forwards to the end of the selected statement.`,cliCategory:"Editor"},rangeStart:{category:"Special",type:"int",default:0,range:{start:0,end:1/0,step:1},description:`Format code starting at a given character offset. The range will extend backwards to the start of the first line containing the selected statement.`,cliCategory:"Editor"},requirePragma:{category:"Special",type:"boolean",default:!1,description:"Require either '@prettier' or '@format' to be present in the file's first docblock comment in order for it to be formatted.",cliCategory:"Other"},tabWidth:{type:"int",category:"Global",default:2,description:"Number of spaces per indentation level.",range:{start:0,end:1/0,step:1}},useTabs:{category:"Global",type:"boolean",default:!1,description:"Indent with tabs instead of spaces."},embeddedLanguageFormatting:{category:"Global",type:"choice",default:"auto",description:"Control how Prettier formats quoted code embedded in the file.",choices:[{value:"auto",description:"Format embedded code if Prettier can automatically identify it."},{value:"off",description:"Never automatically format embedded code."}]}};function iQ({plugins:t=[],showDeprecated:e=!1}={}){let n=t.flatMap(i=>i.languages??[]),r=[];for(let i of one(Object.assign({},...t.map(({options:s})=>s),ine)))!e&&i.deprecated||(Array.isArray(i.choices)&&(e||(i.choices=i.choices.filter(s=>!s.deprecated)),i.name==="parser"&&(i.choices=[...i.choices,...sne(i.choices,n,t)])),i.pluginDefaults=Object.fromEntries(t.filter(s=>{var o;return((o=s.defaultOptions)==null?void 0:o[i.name])!==void 0}).map(s=>[s.name,s.defaultOptions[i.name]])),r.push(i));return{languages:n,options:r}}function*sne(t,e,n){let r=new Set(t.map(i=>i.value));for(let i of e)if(i.parsers){for(let s of i.parsers)if(!r.has(s)){r.add(s);let o=n.find(l=>l.parsers&&Object.prototype.hasOwnProperty.call(l.parsers,s)),a=i.name;o!=null&&o.name&&(a+=` (plugin: ${o.name})`),yield{value:s,description:a}}}}function one(t){let e=[];for(let[n,r]of Object.entries(t)){let i={name:n,...r};Array.isArray(i.default)&&(i.default=Lt(0,i.default,-1).value),e.push(i)}return e}var ane=Array.prototype.toReversed??function(){return[...this].reverse()},lne=nh("toReversed",function(){if(Array.isArray(this))return ane}),cne=lne;function une(){var n,r,i,s,o,a;let t=globalThis,e=(r=(n=t.Deno)==null?void 0:n.build)==null?void 0:r.os;return typeof e=="string"?e==="windows":((s=(i=t.navigator)==null?void 0:i.platform)==null?void 0:s.startsWith("Win"))??((a=(o=t.process)==null?void 0:o.platform)==null?void 0:a.startsWith("win"))??!1}var hne=une();function sQ(t){if(t=t instanceof URL?t:new URL(t),t.protocol!=="file:")throw new TypeError(`URL must be a file URL: received "${t.protocol}"`);return t}function dne(t){return t=sQ(t),decodeURIComponent(t.pathname.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"))}function pne(t){t=sQ(t);let e=decodeURIComponent(t.pathname.replace(/\//g,"\\").replace(/%(?![0-9A-Fa-f]{2})/g,"%25")).replace(/^\\*([A-Za-z]:)(\\|$)/,"$1\\");return t.hostname!==""&&(e=`\\\\${t.hostname}${e}`),e}function fne(t){return hne?pne(t):dne(t)}var mne=t=>String(t).split(/[/\\]/u).pop(),gne=t=>String(t).startsWith("file:");function Hx(t,e){if(!e)return;let n=mne(e).toLowerCase();return t.find(({filenames:r})=>r==null?void 0:r.some(i=>i.toLowerCase()===n))??t.find(({extensions:r})=>r==null?void 0:r.some(i=>n.endsWith(i)))}function One(t,e){if(e)return t.find(({name:n})=>n.toLowerCase()===e)??t.find(({aliases:n})=>n==null?void 0:n.includes(e))??t.find(({extensions:n})=>n==null?void 0:n.includes(`.${e}`))}var pO=void 0;function Xx(t,e){if(e){if(gne(e))try{e=fne(e)}catch{return}if(typeof e=="string")return t.find(({isSupported:n})=>n==null?void 0:n({filepath:e}))}}function yne(t,e){var r;let n=cne(0,t.plugins).flatMap(i=>i.languages??[]);return(r=One(n,e.language)??Hx(n,e.physicalFile)??Hx(n,e.file)??Xx(n,e.physicalFile)??Xx(n,e.file)??(pO==null?void 0:pO(n,e.physicalFile)))==null?void 0:r.parsers[0]}var oQ=yne,_a={key:t=>/^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(t)?t:JSON.stringify(t),value(t){if(t===null||typeof t!="object")return JSON.stringify(t);if(Array.isArray(t))return`[${t.map(n=>_a.value(n)).join(", ")}]`;let e=Object.keys(t);return e.length===0?"{}":`{ ${e.map(n=>`${_a.key(n)}: ${_a.value(t[n])}`).join(", ")} }`},pair:({key:t,value:e})=>_a.value({[t]:e})},TT=new Proxy(String,{get:()=>TT}),ii=TT,aQ=()=>TT,bne=(t,e,{descriptor:n})=>{let r=[`${ii.yellow(typeof t=="string"?n.key(t):n.pair(t))} is deprecated`];return e&&r.push(`we now treat it as ${ii.blue(typeof e=="string"?n.key(e):n.pair(e))}`),r.join("; ")+"."},lQ=Symbol.for("vnopts.VALUE_NOT_EXIST"),jd=Symbol.for("vnopts.VALUE_UNCHANGED"),qx=" ".repeat(2),Ene=(t,e,n)=>{let{text:r,list:i}=n.normalizeExpectedResult(n.schemas[t].expected(n)),s=[];return r&&s.push(Zx(t,e,r,n.descriptor)),i&&s.push([Zx(t,e,i.title,n.descriptor)].concat(i.values.map(o=>cQ(o,n.loggerPrintWidth))).join(` `)),uQ(s,n.loggerPrintWidth)};function Zx(t,e,n,r){return[`Invalid ${ii.red(r.key(t))} value.`,`Expected ${ii.blue(n)},`,`but received ${e===lQ?ii.gray("nothing"):ii.red(r.value(e))}.`].join(" ")}function cQ({text:t,list:e},n){let r=[];return t&&r.push(`- ${ii.blue(t)}`),e&&r.push([`- ${ii.blue(e.title)}:`].concat(e.values.map(i=>cQ(i,n-qx.length).replace(/^|\n/g,`$&${qx}`))).join(` `)),uQ(r,n)}function uQ(t,e){if(t.length===1)return t[0];let[n,r]=t,[i,s]=t.map(o=>o.split(` `,1)[0].length);return i>e&&i>s?r:n}var fa=[],fO=[];function mO(t,e,n){if(t===e)return 0;let r=n==null?void 0:n.maxDistance,i=t;t.length>e.length&&(t=e,e=i);let s=t.length,o=e.length;for(;s>0&&t.charCodeAt(~-s)===e.charCodeAt(~-o);)s--,o--;let a=0;for(;ar)return r;if(s===0)return r!==void 0&&o>r?r:o;let l,c,u,h,d=0,p=0;for(;dc?h>c?c+1:h:h>u?u+1:h;if(r!==void 0){let f=c;for(d=0;dr)return r}}return fa.length=s,fO.length=s,r!==void 0&&c>r?r:c}function vne(t,e,n){if(!Array.isArray(e)||e.length===0)return;let r=n==null?void 0:n.maxDistance,i=t.length;for(let l of e)if(l===t)return l;let s,o=Number.POSITIVE_INFINITY,a=new Set;for(let l of e){if(a.has(l))continue;a.add(l);let c=Math.abs(l.length-i);if(c>=o||c>r)continue;let u=Number.isFinite(o)?Math.min(o,r):r,h=u===void 0?mO(t,l):mO(t,l,{maxDistance:u});if(h>r)continue;let d=h;if(u!==void 0&&h===u&&u===r&&(d=mO(t,l)),dr))return s}var hQ=(t,e,{descriptor:n,logger:r,schemas:i})=>{let s=[`Ignored unknown option ${ii.yellow(n.pair({key:t,value:e}))}.`],o=vne(t,Object.keys(i),{maxDistance:3});o&&s.push(`Did you mean ${ii.blue(n.key(o))}?`),r.warn(s.join(" "))},Tne=["default","expected","validate","deprecated","forward","redirect","overlap","preprocess","postprocess"];function Sne(t,e){let n=new t(e),r=Object.create(n);for(let i of Tne)i in e&&(r[i]=wne(e[i],n,ro.prototype[i].length));return r}var ro=class{static create(t){return Sne(this,t)}constructor(t){this.name=t.name}default(t){}expected(t){return"nothing"}validate(t,e){return!1}deprecated(t,e){return!1}forward(t,e){}redirect(t,e){}overlap(t,e,n){return t}preprocess(t,e){return t}postprocess(t,e){return jd}};function wne(t,e,n){return typeof t=="function"?(...r)=>t(...r.slice(0,n-1),e,...r.slice(n-1)):()=>t}var kne=class extends ro{constructor(t){super(t),this._sourceName=t.sourceName}expected(t){return t.schemas[this._sourceName].expected(t)}validate(t,e){return e.schemas[this._sourceName].validate(t,e)}redirect(t,e){return this._sourceName}},_ne=class extends ro{expected(){return"anything"}validate(){return!0}},xne=class extends ro{constructor({valueSchema:t,name:e=t.name,...n}){super({...n,name:e}),this._valueSchema=t}expected(t){let{text:e,list:n}=t.normalizeExpectedResult(this._valueSchema.expected(t));return{text:e&&`an array of ${e}`,list:n&&{title:"an array of the following values",values:[{list:n}]}}}validate(t,e){if(!Array.isArray(t))return!1;let n=[];for(let r of t){let i=e.normalizeValidateResult(this._valueSchema.validate(r,e),r);i!==!0&&n.push(i.value)}return n.length===0?!0:{value:n}}deprecated(t,e){let n=[];for(let r of t){let i=e.normalizeDeprecatedResult(this._valueSchema.deprecated(r,e),r);i!==!1&&n.push(...i.map(({value:s})=>({value:[s]})))}return n}forward(t,e){let n=[];for(let r of t){let i=e.normalizeForwardResult(this._valueSchema.forward(r,e),r);n.push(...i.map(Wx))}return n}redirect(t,e){let n=[],r=[];for(let i of t){let s=e.normalizeRedirectResult(this._valueSchema.redirect(i,e),i);"remain"in s&&n.push(s.remain),r.push(...s.redirect.map(Wx))}return n.length===0?{redirect:r}:{redirect:r,remain:n}}overlap(t,e){return t.concat(e)}};function Wx({from:t,to:e}){return{from:[t],to:e}}var Cne=class extends ro{expected(){return"true or false"}validate(t){return typeof t=="boolean"}};function Dne(t,e){let n=Object.create(null);for(let r of t){let i=r[e];if(n[i])throw new Error(`Duplicate ${e} ${JSON.stringify(i)}`);n[i]=r}return n}function Ane(t,e){let n=new Map;for(let r of t){let i=r[e];if(n.has(i))throw new Error(`Duplicate ${e} ${JSON.stringify(i)}`);n.set(i,r)}return n}function Pne(){let t=Object.create(null);return e=>{let n=JSON.stringify(e);return t[n]?!0:(t[n]=!0,!1)}}function Nne(t,e){let n=[],r=[];for(let i of t)e(i)?n.push(i):r.push(i);return[n,r]}function Rne(t){return t===Math.floor(t)}function Mne(t,e){if(t===e)return 0;let n=typeof t,r=typeof e,i=["undefined","object","boolean","number","string"];return n!==r?i.indexOf(n)-i.indexOf(r):n!=="string"?Number(t)-Number(e):t.localeCompare(e)}function Ine(t){return(...e)=>{let n=t(...e);return typeof n=="string"?new Error(n):n}}function Gx(t){return t===void 0?{}:t}function dQ(t){if(typeof t=="string")return{text:t};let{text:e,list:n}=t;return Lne((e||n)!==void 0,"Unexpected `expected` result, there should be at least one field."),n?{text:e,list:{title:n.title,values:n.values.map(dQ)}}:{text:e}}function Yx(t,e){return t===!0?!0:t===!1?{value:e}:t}function Kx(t,e,n=!1){return t===!1?!1:t===!0?n?!0:[{value:e}]:"value"in t?[t]:t.length===0?!1:t}function Jx(t,e){return typeof t=="string"||"key"in t?{from:e,to:t}:"from"in t?{from:t.from,to:t.to}:{from:e,to:t.to}}function Db(t,e){return t===void 0?[]:Array.isArray(t)?t.map(n=>Jx(n,e)):[Jx(t,e)]}function eC(t,e){let n=Db(typeof t=="object"&&"redirect"in t?t.redirect:t,e);return n.length===0?{remain:e,redirect:n}:typeof t=="object"&&"remain"in t?{remain:t.remain,redirect:n}:{redirect:n}}function Lne(t,e){if(!t)throw new Error(e)}var Qne=class extends ro{constructor(t){super(t),this._choices=Ane(t.choices.map(e=>e&&typeof e=="object"?e:{value:e}),"value")}expected({descriptor:t}){let e=Array.from(this._choices.keys()).map(i=>this._choices.get(i)).filter(({hidden:i})=>!i).map(i=>i.value).sort(Mne).map(t.value),n=e.slice(0,-2),r=e.slice(-2);return{text:n.concat(r.join(" or ")).join(", "),list:{title:"one of the following values",values:e}}}validate(t){return this._choices.has(t)}deprecated(t){let e=this._choices.get(t);return e&&e.deprecated?{value:t}:!1}forward(t){let e=this._choices.get(t);return e?e.forward:void 0}redirect(t){let e=this._choices.get(t);return e?e.redirect:void 0}},$ne=class extends ro{expected(){return"a number"}validate(t,e){return typeof t=="number"}},Fne=class extends $ne{expected(){return"an integer"}validate(t,e){return e.normalizeValidateResult(super.validate(t,e),t)===!0&&Rne(t)}},tC=class extends ro{expected(){return"a string"}validate(t){return typeof t=="string"}},Bne=_a,jne=hQ,zne=Ene,Vne=bne,Une=class{constructor(t,e){let{logger:n=console,loggerPrintWidth:r=80,descriptor:i=Bne,unknown:s=jne,invalid:o=zne,deprecated:a=Vne,missing:l=()=>!1,required:c=()=>!1,preprocess:u=d=>d,postprocess:h=()=>jd}=e||{};this._utils={descriptor:i,logger:n||{warn:()=>{}},loggerPrintWidth:r,schemas:Dne(t,"name"),normalizeDefaultResult:Gx,normalizeExpectedResult:dQ,normalizeDeprecatedResult:Kx,normalizeForwardResult:Db,normalizeRedirectResult:eC,normalizeValidateResult:Yx},this._unknownHandler=s,this._invalidHandler=Ine(o),this._deprecatedHandler=a,this._identifyMissing=(d,p)=>!(d in p)||l(d,p),this._identifyRequired=c,this._preprocess=u,this._postprocess=h,this.cleanHistory()}cleanHistory(){this._hasDeprecationWarned=Pne()}normalize(t){let e={},n=[this._preprocess(t,this._utils)],r=()=>{for(;n.length!==0;){let i=n.shift(),s=this._applyNormalization(i,e);n.push(...s)}};r();for(let i of Object.keys(this._utils.schemas)){let s=this._utils.schemas[i];if(!(i in e)){let o=Gx(s.default(this._utils));"value"in o&&n.push({[i]:o.value})}}r();for(let i of Object.keys(this._utils.schemas)){if(!(i in e))continue;let s=this._utils.schemas[i],o=e[i],a=s.postprocess(o,this._utils);a!==jd&&(this._applyValidation(a,i,s),e[i]=a)}return this._applyPostprocess(e),this._applyRequiredCheck(e),e}_applyNormalization(t,e){let n=[],{knownKeys:r,unknownKeys:i}=this._partitionOptionKeys(t);for(let s of r){let o=this._utils.schemas[s],a=o.preprocess(t[s],this._utils);this._applyValidation(a,s,o);let l=({from:h,to:d})=>{n.push(typeof d=="string"?{[d]:h}:{[d.key]:d.value})},c=({value:h,redirectTo:d})=>{let p=Kx(o.deprecated(h,this._utils),a,!0);if(p!==!1)if(p===!0)this._hasDeprecationWarned(s)||this._utils.logger.warn(this._deprecatedHandler(s,d,this._utils));else for(let{value:f}of p){let m={key:s,value:f};if(!this._hasDeprecationWarned(m)){let g=typeof d=="string"?{key:d,value:f}:d;this._utils.logger.warn(this._deprecatedHandler(m,g,this._utils))}}};Db(o.forward(a,this._utils),a).forEach(l);let u=eC(o.redirect(a,this._utils),a);if(u.redirect.forEach(l),"remain"in u){let h=u.remain;e[s]=s in e?o.overlap(e[s],h,this._utils):h,c({value:h})}for(let{from:h,to:d}of u.redirect)c({value:h,redirectTo:d})}for(let s of i){let o=t[s];this._applyUnknownHandler(s,o,e,(a,l)=>{n.push({[a]:l})})}return n}_applyRequiredCheck(t){for(let e of Object.keys(this._utils.schemas))if(this._identifyMissing(e,t)&&this._identifyRequired(e))throw this._invalidHandler(e,lQ,this._utils)}_partitionOptionKeys(t){let[e,n]=Nne(Object.keys(t).filter(r=>!this._identifyMissing(r,t)),r=>r in this._utils.schemas);return{knownKeys:e,unknownKeys:n}}_applyValidation(t,e,n){let r=Yx(n.validate(t,this._utils),t);if(r!==!0)throw this._invalidHandler(e,r.value,this._utils)}_applyUnknownHandler(t,e,n,r){let i=this._unknownHandler(t,e,this._utils);if(i)for(let s of Object.keys(i)){if(this._identifyMissing(s,i))continue;let o=i[s];s in this._utils.schemas?r(s,o):n[s]=o}}_applyPostprocess(t){let e=this._postprocess(t,this._utils);if(e!==jd){if(e.delete)for(let n of e.delete)delete t[n];if(e.override){let{knownKeys:n,unknownKeys:r}=this._partitionOptionKeys(e.override);for(let i of n){let s=e.override[i];this._applyValidation(s,i,this._utils.schemas[i]),t[i]=s}for(let i of r){let s=e.override[i];this._applyUnknownHandler(i,s,t,(o,a)=>{let l=this._utils.schemas[o];this._applyValidation(a,o,l),t[o]=a})}}}}},gO;function Hne(t,e,{logger:n=!1,isCLI:r=!1,passThrough:i=!1,FlagSchema:s,descriptor:o}={}){if(r){if(!s)throw new Error("'FlagSchema' option is required.");if(!o)throw new Error("'descriptor' option is required.")}else o=_a;let a=i?Array.isArray(i)?(d,p)=>i.includes(d)?{[d]:p}:void 0:(d,p)=>({[d]:p}):(d,p,f)=>{let{_:m,...g}=f.schemas;return hQ(d,p,{...f,schemas:g})},l=Xne(e,{isCLI:r,FlagSchema:s}),c=new Une(l,{logger:n,unknown:a,descriptor:o}),u=n!==!1;u&&gO&&(c._hasDeprecationWarned=gO);let h=c.normalize(t);return u&&(gO=c._hasDeprecationWarned),h}function Xne(t,{isCLI:e,FlagSchema:n}){let r=[];e&&r.push(_ne.create({name:"_"}));for(let i of t)r.push(qne(i,{isCLI:e,optionInfos:t,FlagSchema:n})),i.alias&&e&&r.push(kne.create({name:i.alias,sourceName:i.name}));return r}function qne(t,{isCLI:e,optionInfos:n,FlagSchema:r}){let{name:i}=t,s={name:i},o,a={};switch(t.type){case"int":o=Fne,e&&(s.preprocess=Number);break;case"string":o=tC;break;case"choice":o=Qne,s.choices=t.choices.map(l=>l!=null&&l.redirect?{...l,redirect:{to:{key:t.name,value:l.redirect}}}:l);break;case"boolean":o=Cne;break;case"flag":o=r,s.flags=n.flatMap(l=>[l.alias,l.description&&l.name,l.oppositeDescription&&`no-${l.name}`].filter(Boolean));break;case"path":o=tC;break;default:throw new Error(`Unexpected type ${t.type}`)}if(t.exception?s.validate=(l,c,u)=>t.exception(l)||c.validate(l,u):s.validate=(l,c,u)=>l===void 0||c.validate(l,u),t.redirect&&(a.redirect=l=>l?{to:typeof t.redirect=="string"?t.redirect:{key:t.redirect.option,value:t.redirect.value}}:void 0),t.deprecated&&(a.deprecated=!0),e&&!t.array){let l=s.preprocess||(c=>c);s.preprocess=(c,u,h)=>u.preprocess(l(Array.isArray(c)?Lt(0,c,-1):c),h)}return t.array?xne.create({...e?{preprocess:l=>Array.isArray(l)?l:[l]}:{},...a,valueSchema:o.create(s)}):o.create({...s,...a})}var Zne=Hne,Wne=Array.prototype.findLast??function(t){for(let e=this.length-1;e>=0;e--){let n=this[e];if(t(n,e,this))return n}},Gne=nh("findLast",function(){if(Array.isArray(this))return Wne}),pQ=Gne,Yne=Symbol.for("PRETTIER_IS_FRONT_MATTER"),Kne=[];function Jne(t){return!!(t!=null&&t[Yne])}var ST=Jne,fQ=new Set(["yaml","toml"]),mQ=({node:t})=>ST(t)&&fQ.has(t.language);async function ere(t,e,n,r){let{node:i}=n,{language:s}=i;if(!fQ.has(s))return;let o=i.value.trim(),a;if(o){let l=s==="yaml"?s:oQ(r,{language:s});if(!l)return;a=o?await t(o,{parser:l}):""}else a=o;return $2([i.startDelimiter,i.explicitLanguage??"",qi,a,a?qi:"",i.endDelimiter])}function tre(t,e){return mQ({node:t})&&(delete e.end,delete e.raw,delete e.value),e}var nre=tre;function rre({node:t}){return t.raw}var ire=rre,gQ=new Set(["tokens","comments","parent","enclosingNode","precedingNode","followingNode"]),sre=t=>Object.keys(t).filter(e=>!gQ.has(e));function ore(t,e){let n=t?r=>t(r,gQ):sre;return e?new Proxy(n,{apply:(r,i,s)=>ST(s[0])?Kne:Reflect.apply(r,i,s)}):n}var nC=ore;function OQ(t,e){if(!e)throw new Error("parserName is required.");let n=pQ(0,t,i=>i.parsers&&Object.prototype.hasOwnProperty.call(i.parsers,e));if(n)return n;let r=`Couldn't resolve parser "${e}".`;throw r+=" Plugins must be explicitly added to the standalone bundle.",new rQ(r)}function are(t,e){if(!e)throw new Error("astFormat is required.");let n=pQ(0,t,i=>i.printers&&Object.prototype.hasOwnProperty.call(i.printers,e));if(n)return n;let r=`Couldn't find plugin for AST format "${e}".`;throw r+=" Plugins must be explicitly added to the standalone bundle.",new rQ(r)}function wT({plugins:t,parser:e}){let n=OQ(t,e);return yQ(n,e)}function yQ(t,e){let n=t.parsers[e];return typeof n=="function"?n():n}async function lre(t,e){let n=t.printers[e],r=typeof n=="function"?await n():n;return cre(r)}var OO=new WeakMap;function cre(t){if(OO.has(t))return OO.get(t);let{features:e,getVisitorKeys:n,embed:r,massageAstNode:i,print:s,...o}=t;e=pre(e);let a=e.experimental_frontMatterSupport;n=nC(n,a.massageAstNode||a.embed||a.print);let l=i;i&&a.massageAstNode&&(l=new Proxy(i,{apply(d,p,f){return nre(...f),Reflect.apply(d,p,f)}}));let c=r;if(r){let d;c=new Proxy(r,{get(p,f,m){return f==="getVisitorKeys"?(d??(d=r.getVisitorKeys?nC(r.getVisitorKeys,a.massageAstNode||a.embed):n),d):Reflect.get(p,f,m)},apply:(p,f,m)=>a.embed&&mQ(...m)?ere:Reflect.apply(p,f,m)})}let u=s;a.print&&(u=new Proxy(s,{apply(d,p,f){let[m]=f;return ST(m.node)?ire(m):Reflect.apply(d,p,f)}}));let h={features:e,getVisitorKeys:n,embed:c,massageAstNode:l,print:u,...o};return OO.set(t,h),h}var ure=["clean","embed","print"],hre=Object.fromEntries(ure.map(t=>[t,!1]));function dre(t){return{...hre,...t}}function pre(t){return{experimental_avoidAstMutation:!1,...t,experimental_frontMatterSupport:dre(t==null?void 0:t.experimental_frontMatterSupport)}}var rC={astFormat:"estree",printer:{},originalText:void 0,locStart:null,locEnd:null,getVisitorKeys:null};async function fre(t,e={}){var h;let n={...t};if(!n.parser)if(n.filepath){if(n.parser=oQ(n,{physicalFile:n.filepath}),!n.parser)throw new Ux(`No parser could be inferred for file "${n.filepath}".`)}else throw new Ux("No parser and no file path given, couldn't infer a parser.");let r=iQ({plugins:t.plugins,showDeprecated:!0}).options,i={...rC,...Object.fromEntries(r.filter(d=>d.default!==void 0).map(d=>[d.name,d.default]))},s=OQ(n.plugins,n.parser),o=await yQ(s,n.parser);n.astFormat=o.astFormat,n.locEnd=o.locEnd,n.locStart=o.locStart;let a=(h=s.printers)!=null&&h[o.astFormat]?s:are(n.plugins,o.astFormat),l=await lre(a,o.astFormat);n.printer=l,n.getVisitorKeys=l.getVisitorKeys;let c=a.defaultOptions?Object.fromEntries(Object.entries(a.defaultOptions).filter(([,d])=>d!==void 0)):{},u={...i,...c};for(let[d,p]of Object.entries(u))(n[d]===null||n[d]===void 0)&&(n[d]=p);return n.parser==="json"&&(n.trailingComma="none"),Zne(n,r,{passThrough:Object.keys(rC),...e})}var kl=fre;Qee($ee());var kT={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"],strictBind:["eval","arguments"]};new Set(kT.keyword);new Set(kT.strict);new Set(kT.strictBind);var ed=(t,e)=>n=>t(e(n));function bQ(t){return{keyword:t.cyan,capitalized:t.yellow,jsxIdentifier:t.yellow,punctuator:t.yellow,number:t.magenta,string:t.green,regex:t.magenta,comment:t.gray,invalid:ed(ed(t.white,t.bgRed),t.bold),gutter:t.gray,marker:ed(t.red,t.bold),message:ed(t.red,t.bold),reset:t.reset}}bQ(aQ());bQ(aQ());function mre(){return new Proxy({},{get:()=>t=>t})}var iC=/\r\n|[\n\r\u2028\u2029]/;function gre(t,e,n){let r=Object.assign({column:0,line:-1},t.start),i=Object.assign({},r,t.end),{linesAbove:s=2,linesBelow:o=3}=n||{},a=r.line,l=r.column,c=i.line,u=i.column,h=Math.max(a-(s+1),0),d=Math.min(e.length,c+o);a===-1&&(h=0),c===-1&&(d=e.length);let p=c-a,f={};if(p)for(let m=0;m<=p;m++){let g=m+a;if(!l)f[g]=!0;else if(m===0){let y=e[g-1].length;f[g]=[l,y-l+1]}else if(m===p)f[g]=[0,u];else{let y=e[g-m].length;f[g]=[0,y]}}else l===u?l?f[a]=[l,0]:f[a]=!0:f[a]=[l,u-l];return{start:h,end:d,markerLines:f}}function Ore(t,e,n={}){let r=mre(),i=t.split(iC),{start:s,end:o,markerLines:a}=gre(e,i,n),l=e.start&&typeof e.start.column=="number",c=String(o).length,u=t.split(iC,o).slice(s,o).map((h,d)=>{let p=s+1+d,f=` ${` ${p}`.slice(-c)} |`,m=a[p],g=!a[p+1];if(m){let y="";if(Array.isArray(m)){let b=h.slice(0,Math.max(m[0]-1,0)).replace(/[^\t]/g," "),T=m[1]||1;y=[` `,r.gutter(f.replace(/\d/g," "))," ",b,r.marker("^").repeat(T)].join(""),g&&n.message&&(y+=" "+r.message(n.message))}return[r.marker(">"),r.gutter(f),h.length>0?` ${h}`:"",y].join("")}else return` ${r.gutter(f)}${h.length>0?` ${h}`:""}`}).join(` `);return n.message&&!l&&(u=`${" ".repeat(c+1)}${n.message} ${u}`),u}async function yre(t,e){let n=await wT(e),r=n.preprocess?await n.preprocess(t,e):t;e.originalText=r;let i;try{i=await n.parse(r,e,e)}catch(s){bre(s,t)}return{text:r,ast:i}}function bre(t,e){let{loc:n}=t;if(n){let r=Ore(e,n,{});throw t.message+=` `+r,t.codeFrame=r,t}throw t}var ih=yre;async function Ere(t,e,n,r,i){if(n.embeddedLanguageFormatting!=="auto")return;let{printer:s}=n,{embed:o}=s;if(!o)return;if(o.length>2)throw new Error("printer.embed has too many parameters. The API changed in Prettier v3. Please update your plugin. See https://prettier.io/docs/plugins#optional-embed");let{hasPrettierIgnore:a}=s,{getVisitorKeys:l}=o,c=[];d();let u=t.stack;for(let{print:p,node:f,pathStack:m}of c)try{t.stack=m;let g=await p(h,e,t,n);g&&i.set(f,g)}catch(g){if(globalThis.PRETTIER_DEBUG)throw g}t.stack=u;function h(p,f){return vre(p,f,n,r)}function d(){let{node:p}=t;if(p===null||typeof p!="object"||a!=null&&a(t))return;for(let m of l(p))Array.isArray(p[m])?t.each(d,m):t.call(d,m);let f=o(t,n);if(f){if(typeof f=="function"){c.push({print:f,node:p,pathStack:[...t.stack]});return}i.set(p,f)}}}async function vre(t,e,n,r){let i=await kl({...n,...e,parentParser:n.parser,originalText:t,cursorOffset:void 0,rangeStart:void 0,rangeEnd:void 0},{passThrough:!0}),{ast:s}=await ih(t,i),o=await r(s,i);return Q2(o)}function Tre(t,e,n,r){let{originalText:i,[Symbol.for("comments")]:s,locStart:o,locEnd:a,[Symbol.for("printedComments")]:l}=e,{node:c}=t,u=o(c),h=a(c);for(let p of s)o(p)>=u&&a(p)<=h&&l.add(p);let{printPrettierIgnored:d}=e.printer;return d?d(t,e,n,r):i.slice(u,h)}var Sre=Tre;async function km(t,e){({ast:t}=await EQ(t,e));let n=new Map,r=new Fte(t),i=new Map;await Ere(r,o,e,km,i);let s=await sC(r,e,o,void 0,i);if(rne(e),e.cursorOffset>=0){if(e.nodeAfterCursor&&!e.nodeBeforeCursor)return[wo,s];if(e.nodeBeforeCursor&&!e.nodeAfterCursor)return[s,wo]}return s;function o(l,c){return l===void 0||l===r?a(c):Array.isArray(l)?r.call(()=>a(c),...l):r.call(()=>a(c),l)}function a(l){let c=r.node;if(c==null)return"";let u=c&&typeof c=="object"&&l===void 0;if(u&&n.has(c))return n.get(c);let h=sC(r,e,o,l,i);return u&&n.set(c,h),h}}function sC(t,e,n,r,i){var l,c;let{node:s}=t,{printer:o}=e,a;switch((l=o.hasPrettierIgnore)!=null&&l.call(o,t)?a=Sre(t,e,n,r):i.has(s)?a=i.get(s):a=o.print(t,e,n,r),s){case e.cursorNode:a=$d(a,u=>[wo,u,wo]);break;case e.nodeBeforeCursor:a=$d(a,u=>[u,wo]);break;case e.nodeAfterCursor:a=$d(a,u=>[wo,u]);break}return o.printComment&&!((c=o.willPrintOwnComments)!=null&&c.call(o,t,e))&&(a=nne(t,a,e)),a}async function EQ(t,e){let n=t.comments??[];e[Symbol.for("comments")]=n,e[Symbol.for("printedComments")]=new Set,Wte(t,e);let{printer:{preprocess:r}}=e;return t=r?await r(t,e):t,{ast:t,comments:n}}function wre(t,e){let{cursorOffset:n,locStart:r,locEnd:i,getVisitorKeys:s}=e,o=p=>r(p)<=n&&i(p)>=n,a=t,l=[t];for(let p of Xte(t,{getVisitorKeys:s,filter:o}))l.push(p),a=p;if(qte(a,{getVisitorKeys:s}))return{cursorNode:a};let c,u,h=-1,d=Number.POSITIVE_INFINITY;for(;l.length>0&&(c===void 0||u===void 0);){a=l.pop();let p=c!==void 0,f=u!==void 0;for(let m of wm(a,{getVisitorKeys:s})){if(!p){let g=i(m);g<=n&&g>h&&(c=m,h=g)}if(!f){let g=r(m);g>=n&&go(d,l)).filter(Boolean);let c={},u=new Set(i(a));for(let d in a)!Object.prototype.hasOwnProperty.call(a,d)||s!=null&&s.has(d)||(u.has(d)?c[d]=o(a[d],a):c[d]=a[d]);let h=r(a,c,l);if(h!==null)return h??c}}var _re=kre,xre=Array.prototype.findLastIndex??function(t){for(let e=this.length-1;e>=0;e--){let n=this[e];if(t(n,e,this))return e}return-1},Cre=nh("findLastIndex",function(){if(Array.isArray(this))return xre}),Dre=Cre,Are=({parser:t})=>t==="json"||t==="json5"||t==="jsonc"||t==="json-stringify";function Pre(t,e){return e=new Set(e),t.find(n=>TQ.has(n.type)&&e.has(n))}function oC(t){let e=Dre(0,t,n=>n.type!=="Program"&&n.type!=="File");return e===-1?t:t.slice(0,e+1)}function Nre(t,e,{locStart:n,locEnd:r}){let[i,...s]=t,[o,...a]=e;if(i===o)return[i,o];let l=n(i);for(let u of oC(a))if(n(u)>=l)o=u;else break;let c=r(o);for(let u of oC(s)){if(r(u)<=c)i=u;else break;if(i===o)break}return[i,o]}function Ab(t,e,n,r,i=[],s){let{locStart:o,locEnd:a}=n,l=o(t),c=a(t);if(e>c||er&&!/\S/u.test(t[i-1]);--i);let c=Ab(n,r,e,(p,f)=>aC(e,p,f),[],"rangeStart");if(!c)return;let u=l?c:Ab(n,i,e,p=>aC(e,p),[],"rangeEnd");if(!u)return;let h,d;if(Are(e)){let p=Pre(c,u);h=p,d=p}else[h,d]=Nre(c,u,e);return[Math.min(s(h),s(d)),Math.max(o(h),o(d))]}var SQ="\uFEFF",lC=Symbol("cursor");async function wQ(t,e,n=0){if(!t||t.trim().length===0)return{formatted:"",cursorOffset:-1,comments:[]};let{ast:r,text:i}=await ih(t,e);e.cursorOffset>=0&&(e={...e,...vQ(r,e)});let s=await km(r,e);n>0&&(s=F2([qi,s],n,e.tabWidth));let o=Sm(s,e);if(n>0){let l=o.formatted.trim();o.cursorNodeStart!==void 0&&(o.cursorNodeStart-=o.formatted.indexOf(l),o.cursorNodeStart<0&&(o.cursorNodeStart=0,o.cursorNodeText=o.cursorNodeText.trimStart()),o.cursorNodeStart+o.cursorNodeText.length>l.length&&(o.cursorNodeText=o.cursorNodeText.trimEnd())),o.formatted=l+fT(e.endOfLine)}let a=e[Symbol.for("comments")];if(e.cursorOffset>=0){let l,c,u,h;if((e.cursorNode||e.nodeBeforeCursor||e.nodeAfterCursor)&&o.cursorNodeText)if(u=o.cursorNodeStart,h=o.cursorNodeText,e.cursorNode)l=e.locStart(e.cursorNode),c=i.slice(l,e.locEnd(e.cursorNode));else{if(!e.nodeBeforeCursor&&!e.nodeAfterCursor)throw new Error("Cursor location must contain at least one of cursorNode, nodeBeforeCursor, nodeAfterCursor");l=e.nodeBeforeCursor?e.locEnd(e.nodeBeforeCursor):0;let y=e.nodeAfterCursor?e.locStart(e.nodeAfterCursor):i.length;c=i.slice(l,y)}else l=0,c=i,u=0,h=o.formatted;let d=e.cursorOffset-l;if(c===h)return{formatted:o.formatted,cursorOffset:u+d,comments:a};let p=c.split("");p.splice(d,0,lC);let f=h.split(""),m=Uee(p,f),g=u;for(let y of m)if(y.removed){if(y.value.includes(lC))break}else g+=y.count;return{formatted:o.formatted,cursorOffset:g,comments:a}}return{formatted:o.formatted,cursorOffset:-1,comments:a}}async function Lre(t,e){let{ast:n,text:r}=await ih(t,e),[i,s]=Ire(r,e,n)??[0,0],o=r.slice(i,s),a=Math.min(i,r.lastIndexOf(` `,i)+1),l=r.slice(a,i).match(/^\s*/u)[0],c=bT(l,e.tabWidth),u=await wQ(o,{...e,rangeStart:0,rangeEnd:Number.POSITIVE_INFINITY,cursorOffset:e.cursorOffset>i&&e.cursorOffset<=s?e.cursorOffset-i:-1,endOfLine:"lf"},c),h=u.formatted.trimEnd(),{cursorOffset:d}=e;d>s?d+=h.length-o.length:u.cursorOffset>=0&&(d=u.cursorOffset+i);let p=r.slice(0,i)+h+r.slice(s);if(e.endOfLine!=="lf"){let f=fT(e.endOfLine);d>=0&&f===`\r `&&(d+=I2(p.slice(0,d),` `)),p=Em(0,p,` `,f)}return{formatted:p,cursorOffset:d,comments:u.comments}}function yO(t,e,n){return typeof e!="number"||Number.isNaN(e)||e<0||e>t.length?n:e}function cC(t,e){let{cursorOffset:n,rangeStart:r,rangeEnd:i}=e;return n=yO(t,n,-1),r=yO(t,r,0),i=yO(t,i,t.length),{...e,cursorOffset:n,rangeStart:r,rangeEnd:i}}function kQ(t,e){let{cursorOffset:n,rangeStart:r,rangeEnd:i,endOfLine:s}=cC(t,e),o=t.charAt(0)===SQ;if(o&&(t=t.slice(1),n--,r--,i--),s==="auto"&&(s=Hee(t)),t.includes("\r")){let a=l=>I2(t.slice(0,Math.max(l,0)),`\r `);n-=a(n),r-=a(r),i-=a(i),t=Xee(t)}return{hasBOM:o,text:t,options:cC(t,{...e,cursorOffset:n,rangeStart:r,rangeEnd:i,endOfLine:s})}}async function uC(t,e){let n=await wT(e);return!n.hasPragma||n.hasPragma(t)}async function Qre(t,e){var n,r;return(r=(n=await wT(e)).hasIgnorePragma)==null?void 0:r.call(n,t)}async function _Q(t,e){let{hasBOM:n,text:r,options:i}=kQ(t,await kl(e));if(i.rangeStart>=i.rangeEnd&&r!==""||i.requirePragma&&!await uC(r,i)||i.checkIgnorePragma&&await Qre(r,i))return{formatted:t,cursorOffset:e.cursorOffset,comments:[]};let s;return i.rangeStart>0||i.rangeEnd=0&&s.cursorOffset++),s}async function $re(t,e,n){let{text:r,options:i}=kQ(t,await kl(e)),s=await ih(r,i);return n&&(n.preprocessForPrint&&(s.ast=await EQ(s.ast,i)),n.massage&&(s.ast=_re(s.ast,i))),s}async function Fre(t,e){e=await kl(e);let n=await km(t,e);return Sm(n,e)}async function Bre(t,e){let n=wte(t),{formatted:r}=await _Q(n,{...e,parser:"__js_expression"});return r}async function jre(t,e){e=await kl(e);let{ast:n}=await ih(t,e);return e.cursorOffset>=0&&(e={...e,...vQ(n,e)}),km(n,e)}async function zre(t,e){return Sm(t,await kl(e))}var xQ={};pT(xQ,{builders:()=>Vre,printer:()=>Ure,utils:()=>Hre});var Vre={join:j2,line:z2,softline:vte,hardline:qi,literalline:U2,group:B2,conditionalGroup:Ote,fill:gte,lineSuffix:_b,lineSuffixBoundary:Tte,cursor:wo,breakParent:Tm,ifBreak:yte,trim:Ste,indent:Pp,indentIfBreak:bte,align:ul,addAlignmentToDoc:F2,markAsRoot:$2,dedentToRoot:fte,dedent:mte,hardlineWithoutBreakParent:OT,literallineWithoutBreakParent:V2,label:Ete,concat:t=>t},Ure={printDocToString:Sm},Hre={willBreak:ite,traverseDoc:mT,findInDoc:gT,mapDoc:vm,removeLines:ate,stripTrailingHardline:Q2,replaceEndOfLine:ute,canBreak:dte},Xre="3.7.1",CQ={};pT(CQ,{addDanglingComment:()=>Bd,addLeadingComment:()=>Dc,addTrailingComment:()=>Ac,getAlignmentSize:()=>bT,getIndentSize:()=>Kre,getMaxContinuousCount:()=>tie,getNextNonSpaceNonCommentCharacter:()=>rie,getNextNonSpaceNonCommentCharacterIndex:()=>hie,getPreferredQuote:()=>sie,getStringWidth:()=>yT,hasNewline:()=>js,hasNewlineInRange:()=>aie,hasSpaces:()=>cie,isNextLineEmpty:()=>gie,isNextLineEmptyAfterIndex:()=>DT,isPreviousLineEmpty:()=>pie,makeString:()=>mie,skip:()=>rh,skipEverythingButNewLine:()=>W2,skipInlineComment:()=>_T,skipNewline:()=>qo,skipSpaces:()=>Gs,skipToLineEnd:()=>Z2,skipTrailingComment:()=>xT,skipWhitespace:()=>Bte});function qre(t,e){if(e===!1)return!1;if(t.charAt(e)==="/"&&t.charAt(e+1)==="*"){for(let n=e+2;nMath.max(r,i.length),0)/e.length}var tie=eie;function nie(t,e){let n=CT(t,e);return n===!1?"":t.charAt(n)}var rie=nie;function iie(t,e){let n=e===!0||e==="'"?"'":'"',r=n==="'"?'"':"'",i=0,s=0;for(let o of t)o===n?i++:o===r&&s++;return i>s?r:n}var sie=iie;function oie(t,e,n){for(let r=e;ro===r?o:a===e?"\\"+a:a||(n&&/^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(o)?o:"\\"+o));return e+i+e}function gie(t,e){return arguments.length===2||typeof e=="number"?DT(t,e):fie(...arguments)}function Eo(t,e=1){return async(...n)=>{let r=n[e]??{},i=r.plugins??[];return n[e]={...r,plugins:Array.isArray(i)?i:Object.values(i)},t(...n)}}var DQ=Eo(_Q);async function AQ(t,e){let{formatted:n}=await DQ(t,{...e,cursorOffset:-1});return n}async function Oie(t,e){return await AQ(t,e)===t}var yie=Eo(iQ,0),bie={parse:Eo($re),formatAST:Eo(Fre),formatDoc:Eo(Bre),printToDoc:Eo(jre),printDocToString:Eo(zre)};function Eie(t){const e=document.createElement("textarea");return e.innerHTML=t,e.value}const vie=async t=>{try{const e=Eie(t).trim();return await M2.format(e,{parser:"html",plugins:[BL],printWidth:80,htmlWhitespaceSensitivity:"ignore",bracketSameLine:!0,singleAttributePerLine:!0,useTabs:!1,tabWidth:2})}catch{return t}},PQ=v.forwardRef(({initialContent:t,onChange:e},n)=>{const[r,i]=v.useState(""),s=i9({initialContent:r});return v.useEffect(()=>{vie(t).then(i)},[t]),v.useImperativeHandle(n,()=>s.current,[s]),E.jsx("div",{ref:s})});PQ.displayName="SourceEditor";function Tie(){const[,t]=v.useState({});return v.useCallback(()=>t({}),[])}function Sie({ref:t,placeholder:e,...n}){const r=Tie(),i=PX(n,[]);return v.useImperativeHandle(t,()=>({getInstance:()=>i}),[i]),v.useEffect(()=>{const s=n.editable;!i||i.isEditable===s||(i.setOptions({editable:!!s}),r())},[i,n.editable]),v.useEffect(()=>{i&&(i.setOptions({editorProps:{placeholder:e}}),r())},[i,e]),v.useEffect(()=>()=>{i==null||i.destroy()},[]),i}const NQ=v.createContext({}),$e=()=>v.useContext(NQ),wie=({children:t,editorOptions:e,slotBefore:n,slotAfter:r})=>{const i=v.useRef(null),s=Sie(e),[o,a]=v.useState(!1),[l,c]=v.useState(!1),[u,h]=v.useState(!1);if(!s)return null;const d=f=>{const m=f.target,g=i.current;g&&m.contains(g)&&(g.style.display="flex",setTimeout(()=>{g.style.display=""},0))},p=E.jsxs("div",{className:bn("rte-editor",o&&"rte-editor--fullscreen"),children:[n,E.jsx("div",{className:"rte-editor__container",onMouseDown:d,children:l?E.jsx(PQ,{initialContent:s.getHTML()||""}):E.jsx(kX,{ref:i,editor:s,className:"rte-editor__content"})}),t,r]});return E.jsx(NQ.Provider,{value:{editor:s,contentElement:i,isFullScreen:o,isResizing:u,isSourceMode:l,setIsResizing:h,toggleFullScreen:()=>a(f=>!f),toggleSourceMode:()=>c(f=>!f)},children:p})},RQ=Ne.forwardRef(({active:t,icon:e,text:n,shortcuts:r,className:i,children:s,type:o,buttonType:a,hideText:l=!0,hideArrow:c=!1,tooltip:u=!0,buttonClass:h,buttonStyle:d,dropdownClass:p,dropdownStyle:f,disabled:m,...g},y)=>{var I;const{editor:b,contentElement:T}=$e(),S=o==="dropdown"||o==="popover"&&!c,w=l&&!S,A=v.useMemo(()=>{if(u===!1)return null;const L={title:typeof u=="string"?u:n,shortcuts:r?`(${r.map(yZ).join(" + ")})`:""};return`${L.title} ${L.shortcuts}`},[u,n,r]),C=v.useMemo(()=>e?E.jsx(iu,{name:e,className:"rte-button-icon"}):null,[e]),N=E.jsx(Vi,{ref:y,type:a,variant:"ghost",className:bn("rte-menu__button",h),style:d,iconOnly:w,slotBefore:!w&&C,slotAfter:S&&E.jsx("span",{className:"rte-icon-arrow",children:E.jsx(iu,{name:"ChevronDown",size:16})}),onFocusCapture:L=>L.stopPropagation(),"data-active":b.isEditable&&t||void 0,"aria-label":typeof u=="string"?u:n,disabled:!b.isEditable||m,...g,children:w?C:!l&&n}),$=A?E.jsx(Ev,{content:A,options:{collisionBoundary:(I=T.current)==null?void 0:I.parentElement},children:N}):N;return o==="dropdown"?E.jsxs(qq,{modal:!1,children:[E.jsx(Zq,{asChild:!0,children:$}),E.jsx(fM,{className:p,style:f,onCloseAutoFocus:L=>L.preventDefault(),children:s})]}):o==="popover"?E.jsxs(Yq,{modal:!1,children:[E.jsx(Kq,{asChild:!0,children:$}),E.jsx(mM,{className:p,style:f,onCloseAutoFocus:L=>L.preventDefault(),children:s})]}):$});RQ.displayName="MenuButton";const be=v.memo(RQ),kie=()=>{const{editor:t}=$e(),e=Ue({editor:t,selector:()=>({})});return E.jsx(be,{icon:"Table",tooltip:"Table",type:"popover",hideArrow:!0,...e,children:E.jsx(cj,{onCreate:({rows:n,cols:r})=>t.chain().insertTable({rows:n,cols:r,withHeaderRow:!1}).focus().run()})})},_ie=()=>{const{editor:t}=$e(),e=Ue({editor:t,selector:n=>({active:n.editor.isActive({textAlign:"center"}),disabled:!n.editor.can().setTextAlign("center")})});return E.jsx(be,{icon:"AlignCenter",tooltip:"Center",shortcuts:["Mod","Shift","E"],onClick:()=>t.chain().focus().setTextAlign("center").run(),...e})},xie=()=>{const{editor:t}=$e(),e=Ue({editor:t,selector:n=>({active:n.editor.isActive({textAlign:"justify"}),disabled:!n.editor.can().setTextAlign("justify")})});return E.jsx(be,{icon:"AlignJustify",tooltip:"Justify",shortcuts:["Mod","Shift","F"],onClick:()=>t.chain().focus().setTextAlign("justify").run(),...e})},Cie=()=>{const{editor:t}=$e(),e=Ue({editor:t,selector:n=>({active:n.editor.isActive({textAlign:"left"}),disabled:!n.editor.can().setTextAlign("left")})});return E.jsx(be,{icon:"AlignLeft",tooltip:"Left",shortcuts:["Mod","Shift","L"],onClick:()=>t.chain().focus().setTextAlign("left").run(),...e})},Die=()=>{const{editor:t}=$e(),e=Ue({editor:t,selector:n=>({active:n.editor.isActive({textAlign:"right"}),disabled:!n.editor.can().setTextAlign("right")})});return E.jsx(be,{icon:"AlignRight",tooltip:"Right",shortcuts:["Mod","Shift","R"],onClick:()=>t.chain().focus().setTextAlign("right").run(),...e})},Aie=()=>{const{editor:t}=$e(),e=Ue({editor:t,selector:r=>r.editor.isActive({textAlign:"right"})?"AlignRight":r.editor.isActive({textAlign:"center"})?"AlignCenter":r.editor.isActive({textAlign:"justify"})?"AlignJustify":"AlignLeft"}),n=!t.isEditable||!t.can().setTextAlign("left");return E.jsx(be,{type:"popover",icon:e,tooltip:"Alignment",disabled:n,children:E.jsx(Ov,{asChild:!0,children:E.jsxs(li,{dense:!0,children:[E.jsx(Cie,{}),E.jsx(_ie,{}),E.jsx(Die,{}),E.jsx(xie,{})]})})})},Pie=()=>{const{editor:t}=$e(),e=Ue({editor:t,selector:n=>({active:n.editor.isActive("bold"),disabled:!n.editor.can().toggleBold()})});return E.jsx(be,{icon:"Bold",tooltip:"Bold",shortcuts:["Mod","B"],onClick:()=>t.chain().focus().toggleBold().run(),...e})},Nie=()=>{const{editor:t}=$e(),e=Ue({editor:t,selector:n=>({active:n.editor.isActive("bulletList"),disabled:!n.editor.isEditable})});return E.jsx(be,{icon:"BulletList",tooltip:"Bullet List",shortcuts:["Mod","Shift","8"],onClick:()=>t.chain().focus().toggleBulletList().run(),...e})},Rie=[1,2,3,4,5,6],Mie=()=>{var s;const{editor:t}=$e(),e=Ue({editor:t,selector:o=>{const{editor:a}=o;if(a.isActive("paragraph"))return"p";const l=Rie.find(c=>a.isActive("heading",{level:c}));return l?`h${l}`:null}}),n=v.useMemo(()=>[{value:"p",label:"Paragraph"},{value:"h1",label:"Heading 1"},{value:"h2",label:"Heading 2"},{value:"h3",label:"Heading 3"},{value:"h4",label:"Heading 4"}],[]),r=v.useCallback(o=>{o.startsWith("h")?t.chain().focus().setHeading({level:+o[1]}).run():t.chain().focus().setParagraph().run()},[t]),i=((s=n.find(o=>o.value===e))==null?void 0:s.label)||"Headings";return E.jsx(be,{type:"dropdown",text:i,tooltip:"Headings",hideText:!1,disabled:!t.isEditable||!e,buttonStyle:{minWidth:"6.5rem"},dropdownClass:"rte-heading-dropdown",children:n.map(o=>E.jsx(gv,{"data-active":o.value===e||void 0,"data-heading":o.value,onSelect:()=>r(o.value),children:o.label},o.value))})},Iie=()=>{const{editor:t}=$e(),e=Ue({editor:t,selector:n=>({active:n.editor.isActive("italic"),disabled:!n.editor.can().toggleItalic()})});return E.jsx(be,{icon:"Italic",tooltip:"Italic",shortcuts:["Mod","I"],onClick:()=>t.chain().focus().toggleItalic().run(),...e})},Lie=()=>{const{editor:t}=$e(),e=Ue({editor:t,selector:n=>({active:n.editor.isActive("link"),disabled:!n.editor.can().setLink({href:""})})});return E.jsx(be,{icon:"Link",tooltip:"Link",shortcuts:["Mod","K"],onClick:()=>t.commands.startEditLink(),...e})},Qie=()=>{const{editor:t}=$e(),e=Ue({editor:t,selector:n=>({active:n.editor.isActive("code"),disabled:!n.editor.can().toggleCode()})});return E.jsx(be,{icon:"CodeInline",tooltip:"Inline code",shortcuts:["Mod","E"],onClick:()=>t.chain().focus().toggleCode().run(),...e})},$ie=()=>{const{editor:t}=$e(),e=Ue({editor:t,selector:n=>({active:n.editor.isActive("strike"),disabled:!n.editor.can().toggleStrike()})});return E.jsx(be,{icon:"Strike",tooltip:"Strikethrough",shortcuts:["Mod","Shift","S"],onClick:()=>t.chain().focus().toggleStrike().run(),...e})},Fie=()=>{const{editor:t}=$e(),e=Ue({editor:t,selector:n=>({active:n.editor.isActive("subscript"),disabled:!n.editor.can().toggleSubscript()})});return E.jsx(be,{icon:"Subscript",tooltip:"Subscript",shortcuts:["Mod",","],onClick:()=>t.chain().focus().toggleSubscript().run(),...e})},Bie=()=>{const{editor:t}=$e(),e=Ue({editor:t,selector:n=>({active:n.editor.isActive("superscript"),disabled:!n.editor.can().toggleSuperscript()})});return E.jsx(be,{icon:"Superscript",tooltip:"Superscript",shortcuts:["Mod","."],onClick:()=>t.chain().focus().toggleSuperscript().run(),...e})},jie=()=>{const{editor:t}=$e(),e=Ue({editor:t,selector:n=>!n.editor.can().setStrike()&&!n.editor.can().setSuperscript()&&!n.editor.can().setSubscript()&&!n.editor.can().setCode()});return E.jsx(be,{type:"popover",icon:"LetterCase",tooltip:"More format",disabled:e,children:E.jsx(Ov,{asChild:!0,children:E.jsxs(li,{dense:!0,children:[E.jsx($ie,{}),E.jsx(Bie,{}),E.jsx(Fie,{}),E.jsx(Qie,{})]})})})},zie=()=>{const{editor:t}=$e(),e=Ue({editor:t,selector:n=>({active:n.editor.isActive("orderedList"),disabled:!n.editor.isEditable})});return E.jsx(be,{icon:"OrderedList",tooltip:"Numbered List",shortcuts:["Mod","Shift","7"],onClick:()=>t.chain().focus().toggleOrderedList().run(),...e})},Vie=()=>{const{editor:t}=$e(),e=Ue({editor:t,selector:n=>({disabled:!n.editor.can().redo()})});return E.jsx(be,{icon:"Redo",tooltip:"Redo",shortcuts:["Mod","Y"],onClick:()=>t.chain().focus().redo().run(),...e})};function MQ(){const[t,e]=v.useState(!1);return v.useEffect(()=>e(!0),[]),t}const Uie=["#B12318","#EB3323","#F6C143","#FFFE55","#A0CD63","#4FAD5B","#4CAFEA","#2D70BA","#68389B"],Hie=["#FFFFFF","#000000","#3B74EC","#45A2EF","#529867","#CD4A3F","#EA8D40","#EEC543","#8E45D0","#F2F2F2","#7F7F7F","#CBDCFC","#E8F6FE","#EDFAF2","#FCEAE9","#FDF3EC","#FEF9E5","#FAECFE","#EEEEEE","#595959","#CEEBFD","#DDE9FE","#CBE9D7","#F7CBC9","#FADDC7","#FDEEB5","#EBCAFC","#BFBFBF","#3F3F3F","#A0BEFA","#A7DCFC","#A6D5B8","#F2A19C","#F5BC8C","#FBE281","#CB94F9","#A5A5A5","#262626","#2452B2","#3473A1","#417A53","#922B22","#AD642A","#9E8329","#57297D","#939393","#0D0D0D","#15316A","#1C415A","#284D34","#511712","#573213","#635217","#36194E"];function _m(){return(_m=Object.assign||function(t){for(var e=1;e=0||(i[n]=t[n]);return i}function Pb(t){var e=v.useRef(t),n=v.useRef(function(r){e.current&&e.current(r)});return e.current=t,n.current}var Tu=function(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=1),t>n?n:t0:g.buttons>0)&&i.current?s(hC(i.current,g,a.current)):m(!1)},f=function(){return m(!1)};function m(g){var y=l.current,b=Nb(i.current),T=g?b.addEventListener:b.removeEventListener;T(y?"touchmove":"mousemove",p),T(y?"touchend":"mouseup",f)}return[function(g){var y=g.nativeEvent,b=i.current;if(b&&(dC(y),!(function(S,w){return w&&!Pc(S)})(y,l.current)&&b)){if(Pc(y)){l.current=!0;var T=y.changedTouches||[];T.length&&(a.current=T[0].identifier)}b.focus(),s(hC(b,y,a.current)),m(!0)}},function(g){var y=g.which||g.keyCode;y<37||y>40||(g.preventDefault(),o({left:y===39?.05:y===37?-.05:0,top:y===40?.05:y===38?-.05:0}))},m]},[o,s]),u=c[0],h=c[1],d=c[2];return v.useEffect(function(){return d},[d]),Ne.createElement("div",_m({},r,{onTouchStart:u,onMouseDown:u,className:"react-colorful__interactive",ref:i,onKeyDown:h,tabIndex:0,role:"slider"}))}),AT=function(t){return t.filter(Boolean).join(" ")},QQ=function(t){var e=t.color,n=t.left,r=t.top,i=r===void 0?.5:r,s=AT(["react-colorful__pointer",t.className]);return Ne.createElement("div",{className:s,style:{top:100*i+"%",left:100*n+"%"}},Ne.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:e}}))},rn=function(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=Math.pow(10,e)),Math.round(n*t)/n},Xie=function(t){return Yie(Rb(t))},Rb=function(t){return t[0]==="#"&&(t=t.substring(1)),t.length<6?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:t.length===4?rn(parseInt(t[3]+t[3],16)/255,2):1}:{r:parseInt(t.substring(0,2),16),g:parseInt(t.substring(2,4),16),b:parseInt(t.substring(4,6),16),a:t.length===8?rn(parseInt(t.substring(6,8),16)/255,2):1}},qie=function(t){return Gie(Wie(t))},Zie=function(t){var e=t.s,n=t.v,r=t.a,i=(200-e)*n/100;return{h:rn(t.h),s:rn(i>0&&i<200?e*n/100/(i<=100?i:200-i)*100:0),l:rn(i/2),a:rn(r,2)}},Mb=function(t){var e=Zie(t);return"hsl("+e.h+", "+e.s+"%, "+e.l+"%)"},Wie=function(t){var e=t.h,n=t.s,r=t.v,i=t.a;e=e/360*6,n/=100,r/=100;var s=Math.floor(e),o=r*(1-n),a=r*(1-(e-s)*n),l=r*(1-(1-e+s)*n),c=s%6;return{r:rn(255*[r,a,o,o,l,r][c]),g:rn(255*[l,r,r,a,o,o][c]),b:rn(255*[o,o,l,r,r,a][c]),a:rn(i,2)}},td=function(t){var e=t.toString(16);return e.length<2?"0"+e:e},Gie=function(t){var e=t.r,n=t.g,r=t.b,i=t.a,s=i<1?td(rn(255*i)):"";return"#"+td(e)+td(n)+td(r)+s},Yie=function(t){var e=t.r,n=t.g,r=t.b,i=t.a,s=Math.max(e,n,r),o=s-Math.min(e,n,r),a=o?s===e?(n-r)/o:s===n?2+(r-e)/o:4+(e-n)/o:0;return{h:rn(60*(a<0?a+6:a)),s:rn(s?o/s*100:0),v:rn(s/255*100),a:i}},Kie=Ne.memo(function(t){var e=t.hue,n=t.onChange,r=AT(["react-colorful__hue",t.className]);return Ne.createElement("div",{className:r},Ne.createElement(LQ,{onMove:function(i){n({h:360*i.left})},onKey:function(i){n({h:Tu(e+360*i.left,0,360)})},"aria-label":"Hue","aria-valuenow":rn(e),"aria-valuemax":"360","aria-valuemin":"0"},Ne.createElement(QQ,{className:"react-colorful__hue-pointer",left:e/360,color:Mb({h:e,s:100,v:100,a:1})})))}),Jie=Ne.memo(function(t){var e=t.hsva,n=t.onChange,r={backgroundColor:Mb({h:e.h,s:100,v:100,a:1})};return Ne.createElement("div",{className:"react-colorful__saturation",style:r},Ne.createElement(LQ,{onMove:function(i){n({s:100*i.left,v:100-100*i.top})},onKey:function(i){n({s:Tu(e.s+100*i.left,0,100),v:Tu(e.v-100*i.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+rn(e.s)+"%, Brightness "+rn(e.v)+"%"},Ne.createElement(QQ,{className:"react-colorful__saturation-pointer",top:1-e.v/100,left:e.s/100,color:Mb(e)})))}),$Q=function(t,e){if(t===e)return!0;for(var n in t)if(t[n]!==e[n])return!1;return!0},ese=function(t,e){return t.toLowerCase()===e.toLowerCase()||$Q(Rb(t),Rb(e))};function tse(t,e,n){var r=Pb(n),i=v.useState(function(){return t.toHsva(e)}),s=i[0],o=i[1],a=v.useRef({color:e,hsva:s});v.useEffect(function(){if(!t.equal(e,a.current.color)){var c=t.toHsva(e);a.current={hsva:c,color:e},o(c)}},[e,t]),v.useEffect(function(){var c;$Q(s,a.current.hsva)||t.equal(c=t.fromHsva(s),a.current.color)||(a.current={hsva:s,color:c},r(c))},[s,t,r]);var l=v.useCallback(function(c){o(function(u){return Object.assign({},u,c)})},[]);return[s,l]}var nse=typeof window<"u"?v.useLayoutEffect:v.useEffect,rse=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},pC=new Map,ise=function(t){nse(function(){var e=t.current?t.current.ownerDocument:document;if(e!==void 0&&!pC.has(e)){var n=e.createElement("style");n.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,pC.set(e,n);var r=rse();r&&n.setAttribute("nonce",r),e.head.appendChild(n)}},[])},sse=function(t){var e=t.className,n=t.colorModel,r=t.color,i=r===void 0?n.defaultColor:r,s=t.onChange,o=IQ(t,["className","colorModel","color","onChange"]),a=v.useRef(null);ise(a);var l=tse(n,i,s),c=l[0],u=l[1],h=AT(["react-colorful",e]);return Ne.createElement("div",_m({},o,{ref:a,className:h}),Ne.createElement(Jie,{hsva:c,onChange:u}),Ne.createElement(Kie,{hue:c.h,onChange:u,className:"react-colorful__last-control"}))},ose={defaultColor:"000",toHsva:Xie,fromHsva:function(t){return qie({h:t.h,s:t.s,v:t.v,a:1})},equal:ese},ase=function(t){return Ne.createElement(sse,_m({},t,{colorModel:ose}))};const Zo=v.forwardRef(({className:t,type:e="text",...n},r)=>E.jsx("input",{type:e,className:bn("rte-input",t),ref:r,...n}));Zo.displayName="Input";const Np=({as:t="label",children:e,className:n=""})=>E.jsx(t,{className:bn("rte-label",n),children:e}),fC=({color:t,tooltip:e=!0,active:n,onClick:r})=>{const i=E.jsx("button",{type:"button",tabIndex:-1,"data-active":n?"true":void 0,className:"rte-color__btn",style:{background:t},onClick:()=>r==null?void 0:r(t)});return e?E.jsx(Ev,{content:t,children:i}):i},FQ=t=>{const[e,n]=v.useState("swatches"),[r,i]=v.useState(t.color),s=u=>{const h=u.startsWith("#")?u:`#${u}`;return h.length===4?`${h}${h.slice(1)}`:h},o=(u,h)=>s(u).toUpperCase()===s(h).toUpperCase(),a=u=>{i(u)},l=()=>{var u;r&&/^#?[0-9A-F]{3,6}$/i.test(r)&&((u=t.onChange)==null||u.call(t,s(r)))},c=(u,h)=>E.jsxs("div",{children:[E.jsx(Np,{as:"span",children:h}),E.jsx("div",{className:"rte-color__list",children:u.map(d=>E.jsx(fC,{active:o(d,r),color:d,onClick:()=>a(d)},d))})]});return E.jsxs("div",{className:"rte-cp",children:[E.jsx("div",{className:"rte-cp__tabs",children:["swatches","custom"].map(u=>E.jsx(Vi,{type:"button",variant:"ghost","data-active":e===u||void 0,onClick:()=>n(u),className:"rte-cp__tab",children:u.charAt(0).toUpperCase()+u.slice(1)},u))}),E.jsxs("div",{className:"rte-cp__main",children:[e==="swatches"&&E.jsxs("div",{className:"rte-cp-swatches",children:[c(Uie,"Default Colors"),c(Hie,"More Colors")]}),e==="custom"&&E.jsxs("div",{className:"rte-cp-custom",children:[E.jsx(ase,{className:"rte-cp-custom__picker",style:{width:"100%"},color:r,onChange:a}),E.jsxs("div",{className:"rte-cp-custom__preview",children:[E.jsx(fC,{color:r,tooltip:!1}),E.jsx(Zo,{value:r,style:{textTransform:"uppercase"},onChange:u=>a(u.target.value),autoFocus:!0})]})]})]}),E.jsx(Qf,{asChild:!0,children:E.jsxs("div",{className:"rte-cp__actions",children:[E.jsx(Vi,{variant:"secondary",iconOnly:!0,type:"button",onClick:t.onReset,children:E.jsx(iu,{name:"PaletteOff"})}),E.jsx(Vi,{style:{width:"100%"},type:"button",onClick:l,children:"Apply"})]})})]})},lse=()=>{const t=v.useRef(null),e=MQ(),{editor:n}=$e(),r=Ue({editor:n,selector:o=>({color:o.editor.getAttributes("textStyle").color||"DEFAULT",disabled:!o.editor.can().setColor("")})}),i={position:"absolute",bottom:1.5,insetInline:4,height:4,borderRadius:4,pointerEvents:"none",background:r.color==="DEFAULT"?"var(--rte-fg, black)":r.color},s=e&&t.current?pl.createPortal(E.jsx("div",{style:i}),t.current):null;return E.jsxs(E.Fragment,{children:[E.jsx(be,{ref:t,type:"popover",icon:"TextColor",hideArrow:!0,tooltip:"Color",disabled:r.disabled,children:E.jsx(FQ,{color:r.color,onChange:o=>n.chain().focus().setColor(o).run(),onReset:()=>n.chain().focus().unsetColor().run()})}),s]})},cse=()=>{const t=v.useRef(null),e=MQ(),{editor:n}=$e(),r=Ue({editor:n,selector:o=>({color:o.editor.getAttributes("highlight").color||"DEFAULT",disabled:!o.editor.can().setHighlight()})}),i={position:"absolute",bottom:1.5,insetInline:4,height:4,borderRadius:4,pointerEvents:"none",background:r.color==="DEFAULT"?"var(--rte-bg, white)":r.color},s=e&&t.current?pl.createPortal(E.jsx("div",{style:i}),t.current):null;return E.jsxs(E.Fragment,{children:[E.jsx(be,{ref:t,type:"popover",icon:"TextHighlight",hideArrow:!0,tooltip:"Highlight",disabled:r.disabled,children:E.jsx(FQ,{color:r.color,onChange:o=>n.chain().focus().setHighlight({color:o}).run(),onReset:()=>n.chain().focus().unsetHighlight().run()})}),s]})},use=()=>{const{editor:t}=$e(),e=Ue({editor:t,selector:n=>({active:n.editor.isActive("underline"),disabled:!n.editor.can().toggleUnderline()})});return E.jsx(be,{icon:"Underline",tooltip:"Underline",shortcuts:["Mod","U"],onClick:()=>t.chain().focus().toggleUnderline().run(),...e})},hse=()=>{const{editor:t}=$e(),e=Ue({editor:t,selector:n=>({disabled:!n.editor.can().undo()})});return E.jsx(be,{icon:"Undo",tooltip:"Undo",shortcuts:["Mod","Z"],onClick:()=>t.chain().focus().undo().run(),...e})},dse=()=>{const{editor:t}=$e(),e=Ue({editor:t,selector:s=>({active:s.editor.isActive("image"),disabled:!s.editor.isEditable})}),n=v.useRef(null),r=v.useCallback(()=>{var s;(s=n.current)==null||s.click()},[]),i=v.useCallback(s=>{var a;const o=(a=s.target.files)==null?void 0:a[0];if(o!=null&&o.type.startsWith("image/")){const l=URL.createObjectURL(o);t.chain().setImage({src:l}).focus().run()}},[t]);return E.jsxs(v.Fragment,{children:[E.jsx(be,{icon:"Image",tooltip:"Image",...e,onClick:r}),E.jsx("input",{style:{display:"none"},type:"file",accept:"image/*",ref:n,onChange:i})]})};var xm="Dialog",[BQ]=Ys(xm),[pse,Mr]=BQ(xm),jQ=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:o=!0}=t,a=v.useRef(null),l=v.useRef(null),[c,u]=Iu({prop:r,defaultProp:i??!1,onChange:s,caller:xm});return E.jsx(pse,{scope:e,triggerRef:a,contentRef:l,contentId:Is(),titleId:Is(),descriptionId:Is(),open:c,onOpenChange:u,onOpenToggle:v.useCallback(()=>u(h=>!h),[u]),modal:o,children:n})};jQ.displayName=xm;var zQ="DialogTrigger",fse=v.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Mr(zQ,n),s=_t(e,i.triggerRef);return E.jsx(pt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":RT(i.open),...r,ref:s,onClick:ve(t.onClick,i.onOpenToggle)})});fse.displayName=zQ;var PT="DialogPortal",[mse,VQ]=BQ(PT,{forceMount:void 0}),UQ=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:i}=t,s=Mr(PT,e);return E.jsx(mse,{scope:e,forceMount:n,children:v.Children.map(r,o=>E.jsx(fi,{present:n||s.open,children:E.jsx(PE,{asChild:!0,container:i,children:o})}))})};UQ.displayName=PT;var Rp="DialogOverlay",HQ=v.forwardRef((t,e)=>{const n=VQ(Rp,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,s=Mr(Rp,t.__scopeDialog);return s.modal?E.jsx(fi,{present:r||s.open,children:E.jsx(Ose,{...i,ref:e})}):null});HQ.displayName=Rp;var gse=Ba("DialogOverlay.RemoveScroll"),Ose=v.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Mr(Rp,n);return E.jsx(If,{as:gse,allowPinchZoom:!0,shards:[i.contentRef],children:E.jsx(pt.div,{"data-state":RT(i.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),Wo="DialogContent",XQ=v.forwardRef((t,e)=>{const n=VQ(Wo,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,s=Mr(Wo,t.__scopeDialog);return E.jsx(fi,{present:r||s.open,children:s.modal?E.jsx(yse,{...i,ref:e}):E.jsx(bse,{...i,ref:e})})});XQ.displayName=Wo;var yse=v.forwardRef((t,e)=>{const n=Mr(Wo,t.__scopeDialog),r=v.useRef(null),i=_t(e,n.contentRef,r);return v.useEffect(()=>{const s=r.current;if(s)return NE(s)},[]),E.jsx(qQ,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ve(t.onCloseAutoFocus,s=>{var o;s.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:ve(t.onPointerDownOutside,s=>{const o=s.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&s.preventDefault()}),onFocusOutside:ve(t.onFocusOutside,s=>s.preventDefault())})}),bse=v.forwardRef((t,e)=>{const n=Mr(Wo,t.__scopeDialog),r=v.useRef(!1),i=v.useRef(!1);return E.jsx(qQ,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o,a;(o=t.onCloseAutoFocus)==null||o.call(t,s),s.defaultPrevented||(r.current||((a=n.triggerRef.current)==null||a.focus()),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{var a,l;(a=t.onInteractOutside)==null||a.call(t,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=s.target;(l=n.triggerRef.current)!=null&&l.contains(o)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),qQ=v.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,...o}=t,a=Mr(Wo,n),l=v.useRef(null),c=_t(e,l);return yE(),E.jsxs(E.Fragment,{children:[E.jsx(Cf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:E.jsx(Ru,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":RT(a.open),...o,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),E.jsxs(E.Fragment,{children:[E.jsx(Ese,{titleId:a.titleId}),E.jsx(Tse,{contentRef:l,descriptionId:a.descriptionId})]})]})}),NT="DialogTitle",ZQ=v.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Mr(NT,n);return E.jsx(pt.h2,{id:i.titleId,...r,ref:e})});ZQ.displayName=NT;var WQ="DialogDescription",GQ=v.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Mr(WQ,n);return E.jsx(pt.p,{id:i.descriptionId,...r,ref:e})});GQ.displayName=WQ;var YQ="DialogClose",KQ=v.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Mr(YQ,n);return E.jsx(pt.button,{type:"button",...r,ref:e,onClick:ve(t.onClick,()=>i.onOpenChange(!1))})});KQ.displayName=YQ;function RT(t){return t?"open":"closed"}var JQ="DialogTitleWarning",[oye,e$]=m3(JQ,{contentName:Wo,titleName:NT,docsSlug:"dialog"}),Ese=({titleId:t})=>{const e=e$(JQ),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users. If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component. For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return v.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},vse="DialogDescriptionWarning",Tse=({contentRef:t,descriptionId:e})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${e$(vse).contentName}}.`;return v.useEffect(()=>{var i;const r=(i=t.current)==null?void 0:i.getAttribute("aria-describedby");e&&r&&(document.getElementById(e)||console.warn(n))},[n,t,e]),null},Sse=jQ,wse=UQ,kse=HQ,_se=XQ,xse=ZQ,Cse=GQ,t$=KQ;const Dse=(t,e)=>{const n=new Array(t.length+e.length);for(let r=0;r({classGroupId:t,validator:e}),n$=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),Mp="-",mC=[],Pse="arbitrary..",Nse=t=>{const e=Mse(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return Rse(i);const s=i.split(Mp),o=s[0]===""&&s.length>1?1:0;return r$(s,o,e)},getConflictingClassGroupIds:(i,s)=>{if(s){const o=r[i],a=n[i];return o?a?Dse(a,o):o:a||mC}return n[i]||mC}}},r$=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const r=t[e],i=n.nextPart.get(r);if(i){const l=r$(t,e+1,i);if(l)return l}const s=n.validators;if(s===null)return;const o=e===0?t.join(Mp):t.slice(e).join(Mp),a=s.length;for(let l=0;lt.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),r=e.slice(0,n);return r?Pse+r:void 0})(),Mse=t=>{const{theme:e,classGroups:n}=t;return Ise(n,e)},Ise=(t,e)=>{const n=n$();for(const r in t){const i=t[r];MT(i,n,r,e)}return n},MT=(t,e,n,r)=>{const i=t.length;for(let s=0;s{if(typeof t=="string"){Qse(t,e,n);return}if(typeof t=="function"){$se(t,e,n,r);return}Fse(t,e,n,r)},Qse=(t,e,n)=>{const r=t===""?e:i$(e,t);r.classGroupId=n},$se=(t,e,n,r)=>{if(Bse(t)){MT(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(Ase(n,t))},Fse=(t,e,n,r)=>{const i=Object.entries(t),s=i.length;for(let o=0;o{let n=t;const r=e.split(Mp),i=r.length;for(let s=0;s"isThemeGetter"in t&&t.isThemeGetter===!0,jse=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),r=Object.create(null);const i=(s,o)=>{n[s]=o,e++,e>t&&(e=0,r=n,n=Object.create(null))};return{get(s){let o=n[s];if(o!==void 0)return o;if((o=r[s])!==void 0)return i(s,o),o},set(s,o){s in n?n[s]=o:i(s,o)}}},Ib="!",gC=":",zse=[],OC=(t,e,n,r,i)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Vse=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=i=>{const s=[];let o=0,a=0,l=0,c;const u=i.length;for(let m=0;ml?c-l:void 0;return OC(s,p,d,f)};if(e){const i=e+gC,s=r;r=o=>o.startsWith(i)?s(o.slice(i.length)):OC(zse,!1,o,void 0,!0)}if(n){const i=r;r=s=>n({className:s,parseClassName:i})}return r},Use=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,r)=>{e.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let s=0;s0&&(i.sort(),r.push(...i),i=[]),r.push(o)):i.push(o)}return i.length>0&&(i.sort(),r.push(...i)),r}},Hse=t=>({cache:jse(t.cacheSize),parseClassName:Vse(t),sortModifiers:Use(t),...Nse(t)}),Xse=/\s+/,qse=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:s}=e,o=[],a=t.trim().split(Xse);let l="";for(let c=a.length-1;c>=0;c-=1){const u=a[c],{isExternal:h,modifiers:d,hasImportantModifier:p,baseClassName:f,maybePostfixModifierPosition:m}=n(u);if(h){l=u+(l.length>0?" "+l:l);continue}let g=!!m,y=r(g?f.substring(0,m):f);if(!y){if(!g){l=u+(l.length>0?" "+l:l);continue}if(y=r(f),!y){l=u+(l.length>0?" "+l:l);continue}g=!1}const b=d.length===0?"":d.length===1?d[0]:s(d).join(":"),T=p?b+Ib:b,S=T+y;if(o.indexOf(S)>-1)continue;o.push(S);const w=i(y,g);for(let A=0;A0?" "+l:l)}return l},Zse=(...t)=>{let e=0,n,r,i="";for(;e{if(typeof t=="string")return t;let e,n="";for(let r=0;r{let n,r,i,s;const o=l=>{const c=e.reduce((u,h)=>h(u),t());return n=Hse(c),r=n.cache.get,i=n.cache.set,s=a,a(l)},a=l=>{const c=r(l);if(c)return c;const u=qse(l,n);return i(l,u),u};return s=o,(...l)=>s(Zse(...l))},Gse=[],It=t=>{const e=n=>n[t]||Gse;return e.isThemeGetter=!0,e},o$=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,a$=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Yse=/^\d+\/\d+$/,Kse=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Jse=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,eoe=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,toe=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,noe=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ma=t=>Yse.test(t),Me=t=>!!t&&!Number.isNaN(Number(t)),ds=t=>!!t&&Number.isInteger(Number(t)),bO=t=>t.endsWith("%")&&Me(t.slice(0,-1)),wi=t=>Kse.test(t),roe=()=>!0,ioe=t=>Jse.test(t)&&!eoe.test(t),l$=()=>!1,soe=t=>toe.test(t),ooe=t=>noe.test(t),aoe=t=>!le(t)&&!ce(t),loe=t=>_l(t,h$,l$),le=t=>o$.test(t),mo=t=>_l(t,d$,ioe),EO=t=>_l(t,poe,Me),yC=t=>_l(t,c$,l$),coe=t=>_l(t,u$,ooe),nd=t=>_l(t,p$,soe),ce=t=>a$.test(t),Hl=t=>xl(t,d$),uoe=t=>xl(t,foe),bC=t=>xl(t,c$),hoe=t=>xl(t,h$),doe=t=>xl(t,u$),rd=t=>xl(t,p$,!0),_l=(t,e,n)=>{const r=o$.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},xl=(t,e,n=!1)=>{const r=a$.exec(t);return r?r[1]?e(r[1]):n:!1},c$=t=>t==="position"||t==="percentage",u$=t=>t==="image"||t==="url",h$=t=>t==="length"||t==="size"||t==="bg-size",d$=t=>t==="length",poe=t=>t==="number",foe=t=>t==="family-name",p$=t=>t==="shadow",moe=()=>{const t=It("color"),e=It("font"),n=It("text"),r=It("font-weight"),i=It("tracking"),s=It("leading"),o=It("breakpoint"),a=It("container"),l=It("spacing"),c=It("radius"),u=It("shadow"),h=It("inset-shadow"),d=It("text-shadow"),p=It("drop-shadow"),f=It("blur"),m=It("perspective"),g=It("aspect"),y=It("ease"),b=It("animate"),T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],S=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],w=()=>[...S(),ce,le],A=()=>["auto","hidden","clip","visible","scroll"],C=()=>["auto","contain","none"],N=()=>[ce,le,l],$=()=>[ma,"full","auto",...N()],I=()=>[ds,"none","subgrid",ce,le],L=()=>["auto",{span:["full",ds,ce,le]},ds,ce,le],Z=()=>[ds,"auto",ce,le],B=()=>["auto","min","max","fr",ce,le],j=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],U=()=>["start","end","center","stretch","center-safe","end-safe"],J=()=>["auto",...N()],fe=()=>[ma,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...N()],z=()=>[t,ce,le],ne=()=>[...S(),bC,yC,{position:[ce,le]}],Oe=()=>["no-repeat",{repeat:["","x","y","space","round"]}],He=()=>["auto","cover","contain",hoe,loe,{size:[ce,le]}],it=()=>[bO,Hl,mo],Le=()=>["","none","full",c,ce,le],Xe=()=>["",Me,Hl,mo],vt=()=>["solid","dashed","dotted","double"],An=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ge=()=>[Me,bO,bC,yC],Qr=()=>["","none",f,ce,le],mt=()=>["none",Me,ce,le],Jn=()=>["none",Me,ce,le],ls=()=>[Me,ce,le],bi=()=>[ma,"full",...N()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[wi],breakpoint:[wi],color:[roe],container:[wi],"drop-shadow":[wi],ease:["in","out","in-out"],font:[aoe],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[wi],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[wi],shadow:[wi],spacing:["px",Me],text:[wi],"text-shadow":[wi],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ma,le,ce,g]}],container:["container"],columns:[{columns:[Me,le,ce,a]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:w()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:$()}],"inset-x":[{"inset-x":$()}],"inset-y":[{"inset-y":$()}],start:[{start:$()}],end:[{end:$()}],top:[{top:$()}],right:[{right:$()}],bottom:[{bottom:$()}],left:[{left:$()}],visibility:["visible","invisible","collapse"],z:[{z:[ds,"auto",ce,le]}],basis:[{basis:[ma,"full","auto",a,...N()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Me,ma,"auto","initial","none",le]}],grow:[{grow:["",Me,ce,le]}],shrink:[{shrink:["",Me,ce,le]}],order:[{order:[ds,"first","last","none",ce,le]}],"grid-cols":[{"grid-cols":I()}],"col-start-end":[{col:L()}],"col-start":[{"col-start":Z()}],"col-end":[{"col-end":Z()}],"grid-rows":[{"grid-rows":I()}],"row-start-end":[{row:L()}],"row-start":[{"row-start":Z()}],"row-end":[{"row-end":Z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":B()}],"auto-rows":[{"auto-rows":B()}],gap:[{gap:N()}],"gap-x":[{"gap-x":N()}],"gap-y":[{"gap-y":N()}],"justify-content":[{justify:[...j(),"normal"]}],"justify-items":[{"justify-items":[...U(),"normal"]}],"justify-self":[{"justify-self":["auto",...U()]}],"align-content":[{content:["normal",...j()]}],"align-items":[{items:[...U(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...U(),{baseline:["","last"]}]}],"place-content":[{"place-content":j()}],"place-items":[{"place-items":[...U(),"baseline"]}],"place-self":[{"place-self":["auto",...U()]}],p:[{p:N()}],px:[{px:N()}],py:[{py:N()}],ps:[{ps:N()}],pe:[{pe:N()}],pt:[{pt:N()}],pr:[{pr:N()}],pb:[{pb:N()}],pl:[{pl:N()}],m:[{m:J()}],mx:[{mx:J()}],my:[{my:J()}],ms:[{ms:J()}],me:[{me:J()}],mt:[{mt:J()}],mr:[{mr:J()}],mb:[{mb:J()}],ml:[{ml:J()}],"space-x":[{"space-x":N()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":N()}],"space-y-reverse":["space-y-reverse"],size:[{size:fe()}],w:[{w:[a,"screen",...fe()]}],"min-w":[{"min-w":[a,"screen","none",...fe()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[o]},...fe()]}],h:[{h:["screen","lh",...fe()]}],"min-h":[{"min-h":["screen","lh","none",...fe()]}],"max-h":[{"max-h":["screen","lh",...fe()]}],"font-size":[{text:["base",n,Hl,mo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ce,EO]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",bO,le]}],"font-family":[{font:[uoe,le,e]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,ce,le]}],"line-clamp":[{"line-clamp":[Me,"none",ce,EO]}],leading:[{leading:[s,...N()]}],"list-image":[{"list-image":["none",ce,le]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ce,le]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:z()}],"text-color":[{text:z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...vt(),"wavy"]}],"text-decoration-thickness":[{decoration:[Me,"from-font","auto",ce,mo]}],"text-decoration-color":[{decoration:z()}],"underline-offset":[{"underline-offset":[Me,"auto",ce,le]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:N()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ce,le]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ce,le]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ne()}],"bg-repeat":[{bg:Oe()}],"bg-size":[{bg:He()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ds,ce,le],radial:["",ce,le],conic:[ds,ce,le]},doe,coe]}],"bg-color":[{bg:z()}],"gradient-from-pos":[{from:it()}],"gradient-via-pos":[{via:it()}],"gradient-to-pos":[{to:it()}],"gradient-from":[{from:z()}],"gradient-via":[{via:z()}],"gradient-to":[{to:z()}],rounded:[{rounded:Le()}],"rounded-s":[{"rounded-s":Le()}],"rounded-e":[{"rounded-e":Le()}],"rounded-t":[{"rounded-t":Le()}],"rounded-r":[{"rounded-r":Le()}],"rounded-b":[{"rounded-b":Le()}],"rounded-l":[{"rounded-l":Le()}],"rounded-ss":[{"rounded-ss":Le()}],"rounded-se":[{"rounded-se":Le()}],"rounded-ee":[{"rounded-ee":Le()}],"rounded-es":[{"rounded-es":Le()}],"rounded-tl":[{"rounded-tl":Le()}],"rounded-tr":[{"rounded-tr":Le()}],"rounded-br":[{"rounded-br":Le()}],"rounded-bl":[{"rounded-bl":Le()}],"border-w":[{border:Xe()}],"border-w-x":[{"border-x":Xe()}],"border-w-y":[{"border-y":Xe()}],"border-w-s":[{"border-s":Xe()}],"border-w-e":[{"border-e":Xe()}],"border-w-t":[{"border-t":Xe()}],"border-w-r":[{"border-r":Xe()}],"border-w-b":[{"border-b":Xe()}],"border-w-l":[{"border-l":Xe()}],"divide-x":[{"divide-x":Xe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Xe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...vt(),"hidden","none"]}],"divide-style":[{divide:[...vt(),"hidden","none"]}],"border-color":[{border:z()}],"border-color-x":[{"border-x":z()}],"border-color-y":[{"border-y":z()}],"border-color-s":[{"border-s":z()}],"border-color-e":[{"border-e":z()}],"border-color-t":[{"border-t":z()}],"border-color-r":[{"border-r":z()}],"border-color-b":[{"border-b":z()}],"border-color-l":[{"border-l":z()}],"divide-color":[{divide:z()}],"outline-style":[{outline:[...vt(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Me,ce,le]}],"outline-w":[{outline:["",Me,Hl,mo]}],"outline-color":[{outline:z()}],shadow:[{shadow:["","none",u,rd,nd]}],"shadow-color":[{shadow:z()}],"inset-shadow":[{"inset-shadow":["none",h,rd,nd]}],"inset-shadow-color":[{"inset-shadow":z()}],"ring-w":[{ring:Xe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:z()}],"ring-offset-w":[{"ring-offset":[Me,mo]}],"ring-offset-color":[{"ring-offset":z()}],"inset-ring-w":[{"inset-ring":Xe()}],"inset-ring-color":[{"inset-ring":z()}],"text-shadow":[{"text-shadow":["none",d,rd,nd]}],"text-shadow-color":[{"text-shadow":z()}],opacity:[{opacity:[Me,ce,le]}],"mix-blend":[{"mix-blend":[...An(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":An()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Me]}],"mask-image-linear-from-pos":[{"mask-linear-from":Ge()}],"mask-image-linear-to-pos":[{"mask-linear-to":Ge()}],"mask-image-linear-from-color":[{"mask-linear-from":z()}],"mask-image-linear-to-color":[{"mask-linear-to":z()}],"mask-image-t-from-pos":[{"mask-t-from":Ge()}],"mask-image-t-to-pos":[{"mask-t-to":Ge()}],"mask-image-t-from-color":[{"mask-t-from":z()}],"mask-image-t-to-color":[{"mask-t-to":z()}],"mask-image-r-from-pos":[{"mask-r-from":Ge()}],"mask-image-r-to-pos":[{"mask-r-to":Ge()}],"mask-image-r-from-color":[{"mask-r-from":z()}],"mask-image-r-to-color":[{"mask-r-to":z()}],"mask-image-b-from-pos":[{"mask-b-from":Ge()}],"mask-image-b-to-pos":[{"mask-b-to":Ge()}],"mask-image-b-from-color":[{"mask-b-from":z()}],"mask-image-b-to-color":[{"mask-b-to":z()}],"mask-image-l-from-pos":[{"mask-l-from":Ge()}],"mask-image-l-to-pos":[{"mask-l-to":Ge()}],"mask-image-l-from-color":[{"mask-l-from":z()}],"mask-image-l-to-color":[{"mask-l-to":z()}],"mask-image-x-from-pos":[{"mask-x-from":Ge()}],"mask-image-x-to-pos":[{"mask-x-to":Ge()}],"mask-image-x-from-color":[{"mask-x-from":z()}],"mask-image-x-to-color":[{"mask-x-to":z()}],"mask-image-y-from-pos":[{"mask-y-from":Ge()}],"mask-image-y-to-pos":[{"mask-y-to":Ge()}],"mask-image-y-from-color":[{"mask-y-from":z()}],"mask-image-y-to-color":[{"mask-y-to":z()}],"mask-image-radial":[{"mask-radial":[ce,le]}],"mask-image-radial-from-pos":[{"mask-radial-from":Ge()}],"mask-image-radial-to-pos":[{"mask-radial-to":Ge()}],"mask-image-radial-from-color":[{"mask-radial-from":z()}],"mask-image-radial-to-color":[{"mask-radial-to":z()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":S()}],"mask-image-conic-pos":[{"mask-conic":[Me]}],"mask-image-conic-from-pos":[{"mask-conic-from":Ge()}],"mask-image-conic-to-pos":[{"mask-conic-to":Ge()}],"mask-image-conic-from-color":[{"mask-conic-from":z()}],"mask-image-conic-to-color":[{"mask-conic-to":z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ne()}],"mask-repeat":[{mask:Oe()}],"mask-size":[{mask:He()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ce,le]}],filter:[{filter:["","none",ce,le]}],blur:[{blur:Qr()}],brightness:[{brightness:[Me,ce,le]}],contrast:[{contrast:[Me,ce,le]}],"drop-shadow":[{"drop-shadow":["","none",p,rd,nd]}],"drop-shadow-color":[{"drop-shadow":z()}],grayscale:[{grayscale:["",Me,ce,le]}],"hue-rotate":[{"hue-rotate":[Me,ce,le]}],invert:[{invert:["",Me,ce,le]}],saturate:[{saturate:[Me,ce,le]}],sepia:[{sepia:["",Me,ce,le]}],"backdrop-filter":[{"backdrop-filter":["","none",ce,le]}],"backdrop-blur":[{"backdrop-blur":Qr()}],"backdrop-brightness":[{"backdrop-brightness":[Me,ce,le]}],"backdrop-contrast":[{"backdrop-contrast":[Me,ce,le]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Me,ce,le]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Me,ce,le]}],"backdrop-invert":[{"backdrop-invert":["",Me,ce,le]}],"backdrop-opacity":[{"backdrop-opacity":[Me,ce,le]}],"backdrop-saturate":[{"backdrop-saturate":[Me,ce,le]}],"backdrop-sepia":[{"backdrop-sepia":["",Me,ce,le]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":N()}],"border-spacing-x":[{"border-spacing-x":N()}],"border-spacing-y":[{"border-spacing-y":N()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ce,le]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Me,"initial",ce,le]}],ease:[{ease:["linear","initial",y,ce,le]}],delay:[{delay:[Me,ce,le]}],animate:[{animate:["none",b,ce,le]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,ce,le]}],"perspective-origin":[{"perspective-origin":w()}],rotate:[{rotate:mt()}],"rotate-x":[{"rotate-x":mt()}],"rotate-y":[{"rotate-y":mt()}],"rotate-z":[{"rotate-z":mt()}],scale:[{scale:Jn()}],"scale-x":[{"scale-x":Jn()}],"scale-y":[{"scale-y":Jn()}],"scale-z":[{"scale-z":Jn()}],"scale-3d":["scale-3d"],skew:[{skew:ls()}],"skew-x":[{"skew-x":ls()}],"skew-y":[{"skew-y":ls()}],transform:[{transform:[ce,le,"","none","gpu","cpu"]}],"transform-origin":[{origin:w()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:bi()}],"translate-x":[{"translate-x":bi()}],"translate-y":[{"translate-y":bi()}],"translate-z":[{"translate-z":bi()}],"translate-none":["translate-none"],accent:[{accent:z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:z()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ce,le]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":N()}],"scroll-mx":[{"scroll-mx":N()}],"scroll-my":[{"scroll-my":N()}],"scroll-ms":[{"scroll-ms":N()}],"scroll-me":[{"scroll-me":N()}],"scroll-mt":[{"scroll-mt":N()}],"scroll-mr":[{"scroll-mr":N()}],"scroll-mb":[{"scroll-mb":N()}],"scroll-ml":[{"scroll-ml":N()}],"scroll-p":[{"scroll-p":N()}],"scroll-px":[{"scroll-px":N()}],"scroll-py":[{"scroll-py":N()}],"scroll-ps":[{"scroll-ps":N()}],"scroll-pe":[{"scroll-pe":N()}],"scroll-pt":[{"scroll-pt":N()}],"scroll-pr":[{"scroll-pr":N()}],"scroll-pb":[{"scroll-pb":N()}],"scroll-pl":[{"scroll-pl":N()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ce,le]}],fill:[{fill:["none",...z()]}],"stroke-w":[{stroke:[Me,Hl,mo,EO]}],stroke:[{stroke:["none",...z()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},goe=Wse(moe);function Cl(...t){return goe(bn(t))}function Ooe({...t}){return E.jsx(Sse,{"data-slot":"dialog",...t})}function yoe({...t}){return E.jsx(wse,{"data-slot":"dialog-portal",...t})}function boe({...t}){return E.jsx(t$,{"data-slot":"dialog-close",...t})}function Eoe({className:t,...e}){return E.jsx(kse,{"data-slot":"dialog-overlay",className:Cl("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...e})}function voe({className:t,children:e,showCloseButton:n=!0,...r}){return E.jsxs(yoe,{"data-slot":"dialog-portal",children:[E.jsx(Eoe,{}),E.jsxs(_se,{"data-slot":"dialog-content",className:Cl("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t),...r,children:[e,n&&E.jsxs(t$,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[E.jsx(lM,{}),E.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Toe({className:t,...e}){return E.jsx("div",{"data-slot":"dialog-header",className:Cl("flex flex-col gap-2 text-center sm:text-left",t),...e})}function Soe({className:t,...e}){return E.jsx("div",{"data-slot":"dialog-footer",className:Cl("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...e})}function woe({className:t,...e}){return E.jsx(xse,{"data-slot":"dialog-title",className:Cl("text-lg leading-none font-semibold",t),...e})}function koe({className:t,...e}){return E.jsx(Cse,{"data-slot":"dialog-description",className:Cl("text-muted-foreground text-sm",t),...e})}const _oe=()=>{const{editor:t}=$e(),[e,n]=v.useState(!1),[r,i]=v.useState("https://www.youtube.com/watch?v=DupfnOCH-JI"),s=Ue({editor:t,selector:a=>({active:a.editor.isActive("youtube"),disabled:!a.editor.isEditable})}),o=()=>{r.trim()&&(t.chain().focus().embedYoutube({src:r}).run(),i("https://www.youtube.com/watch?v=DupfnOCH-JI"),n(!1))};return E.jsxs(Ooe,{open:e,onOpenChange:n,children:[E.jsx(be,{icon:"Youtube",tooltip:"Youtube",onClick:()=>n(!0),...s}),E.jsxs(voe,{className:"sm:max-w-[425px]",children:[E.jsxs(Toe,{children:[E.jsx(woe,{children:"Embed YouTube Video"}),E.jsx(koe,{children:"Enter the YouTube video URL to embed it in your content."})]}),E.jsx("div",{className:"grid gap-4 py-4",children:E.jsxs("div",{className:"grid gap-3",children:[E.jsx(Np,{children:"YouTube URL"}),E.jsx(Zo,{id:"youtube-url",placeholder:"https://www.youtube.com/watch?v=...",value:r,onChange:a=>i(a.target.value),autoFocus:!0})]})}),E.jsxs(Soe,{children:[E.jsx(boe,{asChild:!0,children:E.jsx(Vi,{type:"button",variant:"outline",children:"Cancel"})}),E.jsx(Vi,{onClick:o,type:"button",variant:"primary",children:"Embed Video"})]})]})]})},xoe=()=>{const{editor:t}=$e(),e=Ue({editor:t,selector:n=>({active:n.editor.isActive("codeBlock"),disabled:!n.editor.can().toggleCodeBlock()})});return E.jsx(be,{icon:"Code",tooltip:"Code block",onClick:()=>t.chain().focus().setCodeBlock().run(),...e})},Coe=()=>{const{editor:t}=$e(),e=Ue({editor:t,selector:n=>({active:n.editor.isActive("blockquote"),disabled:!n.editor.can().toggleBlockquote()})});return E.jsx(be,{icon:"Quote",tooltip:"Quote",shortcuts:["Mod","Shift","B"],onClick:()=>t.chain().focus().toggleBlockquote().run(),...e})},Doe=()=>E.jsx("div",{className:"rte-menu-bar",children:E.jsxs(li,{dense:!0,children:[E.jsx(hse,{}),E.jsx(Vie,{}),E.jsx(Ni,{}),E.jsx(Mie,{}),E.jsx(Ni,{}),E.jsx(Pie,{}),E.jsx(Iie,{}),E.jsx(use,{}),E.jsx(jie,{}),E.jsx(Ni,{}),E.jsx(lse,{}),E.jsx(cse,{}),E.jsx(Ni,{}),E.jsx(Aie,{}),E.jsx(Nie,{}),E.jsx(zie,{}),E.jsx(Ni,{}),E.jsx(Coe,{}),E.jsx(Lie,{}),E.jsx(dse,{}),E.jsx(_oe,{}),E.jsx(xoe,{}),E.jsx(kie,{})]})}),Aoe=v.memo(Doe),Poe=(t,e,n)=>Math.min(n,Math.max(e,t)),Noe=()=>{const{editor:t,contentElement:e,setIsResizing:n}=$e(),r=v.useRef(null),i=v.useRef({currentHeight:0,currentWidth:0,direction:0,isResizing:!1,ratio:0,startHeight:0,startWidth:0,startX:0,startY:0}),s=Ue({editor:t,selector:p=>{if(!p.editor.isFocused||!p.editor.isEditable)return null;const f=p.editor.isActive("image")?"image":p.editor.isActive("youtube")?"youtube":null;if(!f)return null;const{selection:m}=p.editor.state;return{node:p.editor.view.nodeDOM(m.anchor),nodeType:f,nodePos:m.anchor}}}),{maxWidth:o,minWidth:a}=v.useMemo(()=>{var f;const p=((f=e.current)==null?void 0:f.getBoundingClientRect().width)||0;return{maxWidth:p,minWidth:p*.25}},[e.current]),l=(p,f)=>{p.preventDefault();const m=i.current;m.startX=p.clientX,m.startY=p.clientY,m.isResizing=!0,m.direction=f,document.addEventListener("pointermove",c),document.addEventListener("pointerup",u),n(!0)},c=p=>{const f=s==null?void 0:s.node,m=i.current;if(!f||!m.isResizing)return;let g=m.startX-p.clientX;g=m.direction?-g:g;const y=Poe(m.startWidth+g,a,o),b=y/m.ratio;m.currentWidth=y,m.currentHeight=b,f.style.width=`${y}px`,f.style.height=`${b}px`,h()},u=()=>{const p=i.current;p.isResizing&&(p.isResizing=!1,document.removeEventListener("pointermove",c),document.removeEventListener("pointerup",u),n(!1),requestAnimationFrame(()=>t==null?void 0:t.commands.updateAttributes(s.nodeType,{width:Math.round(p.currentWidth/o*100)})))},h=v.useCallback(()=>{const p=s.node,f=r.current,{offsetTop:m,offsetLeft:g,offsetWidth:y,offsetHeight:b}=p;requestAnimationFrame(()=>{f.style.width=`${y}px`,f.style.height=`${b}px`,f.style.transform=`translate(${g}px, ${m}px)`})},[s]);if(v.useEffect(()=>{const p=s==null?void 0:s.node;if(!p)return;const{width:f,height:m}=p.getBoundingClientRect(),g=i.current;g.startWidth=f,g.startHeight=m,g.currentWidth=f,g.currentHeight=m,g.ratio=f/m,h()},[s]),!s||!e.current)return;const d=(p,f,m)=>E.jsx("div",{className:"rte-resizer__control",style:{cursor:p,...m},onPointerDown:g=>l(g,f)});return pl.createPortal(E.jsxs("div",{ref:r,className:"rte-resizer",children:[d("nw-resize",0,{width:12,left:-10,top:-10}),d("sw-resize",0,{width:12,left:-10,bottom:-10}),d("sw-resize",1,{width:12,right:-10,top:-10}),d("nw-resize",1,{width:12,right:-10,bottom:-10})]}),e.current)},Roe=v.memo(Noe),Moe=()=>{const{editor:t,isFullScreen:e,toggleFullScreen:n}=$e(),r=Ue({editor:t,selector:i=>({words:i.editor.storage.characterCount.words(),characters:i.editor.storage.characterCount.characters()})});return E.jsxs("div",{className:"rte-status-bar",children:[E.jsx(li,{dense:!0,children:E.jsx(be,{icon:e?"Minimize":"Maximize",text:"Fullscreen",active:e,onClick:n})}),E.jsxs("div",{className:"rte-counter",children:[E.jsxs("span",{className:"rte-word-count",children:["Words: ",r.words]}),E.jsxs("span",{className:"rte-charater",children:["Characters: ",r.characters]})]})]})},Ioe=v.memo(Moe);function f$(){const[t,e]=v.useState(!1),n=v.useRef(null),r=async i=>{if(!t)try{await navigator.clipboard.writeText(i),e(!0),n.current=setTimeout(()=>e(!1),2500)}catch{e(!1),n.current&&clearTimeout(n.current)}};return v.useEffect(()=>()=>{n.current&&clearTimeout(n.current)},[]),{isCopied:t,copy:r}}const Ip=(t,e)=>{const{view:n,state:{selection:{from:r}}}=t;let i=n.nodeDOM(r)||n.domAtPos(r).node;for(;i&&(i==null?void 0:i.nodeName.toLocaleLowerCase())!==e.toLocaleLowerCase();)i=i.parentElement;return i};var Lb,Qb;if(typeof WeakMap<"u"){let t=new WeakMap;Lb=e=>t.get(e),Qb=(e,n)=>(t.set(e,n),n)}else{const t=[];let e=0;Lb=n=>{for(let r=0;r(e==10&&(e=0),t[e++]=n,t[e++]=r)}var bt=class{constructor(t,e,n,r){this.width=t,this.height=e,this.map=n,this.problems=r}findCell(t){for(let e=0;e=n){(s||(s=[])).push({type:"overlong_rowspan",pos:u,n:y-T});break}const S=i+T*e;for(let w=0;wr&&(s+=c.attrs.colspan)}}for(let o=0;o1&&(n=!0)}e==-1?e=s:e!=s&&(e=Math.max(e,s))}return e}function $oe(t,e,n){t.problems||(t.problems=[]);const r={};for(let i=0;i0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}function Boe(t){for(let e=t.depth;e>0;e--){const n=t.node(e).type.spec.tableRole;if(n==="cell"||n==="header_cell")return t.node(e)}return null}function Ir(t){const e=t.selection.$head;for(let n=e.depth;n>0;n--)if(e.node(n).type.spec.tableRole=="row")return!0;return!1}function Cm(t){const e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;const n=Dl(e.$head)||joe(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function joe(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n-e.nodeSize)}}function $b(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function zoe(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function IT(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function m$(t,e,n){const r=t.node(-1),i=bt.get(r),s=t.start(-1),o=i.nextCell(t.pos-s,e,n);return o==null?null:t.node(0).resolve(s+o)}function Go(t,e,n=1){const r={...t,colspan:t.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,n),r.colwidth.some(i=>i>0)||(r.colwidth=null)),r}function g$(t,e,n=1){const r={...t,colspan:t.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let i=0;iu!=n.pos-s);l.unshift(n.pos-s);const c=l.map(u=>{const h=r.nodeAt(u);if(!h)throw RangeError(`No cell with offset ${u} found`);const d=s+u+1;return new $P(a.resolve(d),a.resolve(d+h.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=n}map(e,n){const r=e.resolve(n.map(this.$anchorCell.pos)),i=e.resolve(n.map(this.$headCell.pos));if($b(r)&&$b(i)&&IT(r,i)){const s=this.$anchorCell.node(-1)!=r.node(-1);return s&&this.isRowSelection()?Ci.rowSelection(r,i):s&&this.isColSelection()?Ci.colSelection(r,i):new Ci(r,i)}return de.between(r,i)}content(){const e=this.$anchorCell.node(-1),n=bt.get(e),r=this.$anchorCell.start(-1),i=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),s={},o=[];for(let l=i.top;l0||g>0){let y=f.attrs;if(m>0&&(y=Go(y,0,m)),g>0&&(y=Go(y,y.colspan-g,g)),p.lefti.bottom){const y={...f.attrs,rowspan:Math.min(p.bottom,i.bottom)-Math.max(p.top,i.top)};p.top0)return!1;const r=e+this.$anchorCell.nodeAfter.attrs.rowspan,i=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,i)==this.$headCell.node(-1).childCount}static colSelection(e,n=e){const r=e.node(-1),i=bt.get(r),s=e.start(-1),o=i.findCell(e.pos-s),a=i.findCell(n.pos-s),l=e.node(0);return o.top<=a.top?(o.top>0&&(e=l.resolve(s+i.map[o.left])),a.bottom0&&(n=l.resolve(s+i.map[a.left])),o.bottom0)return!1;const o=i+this.$anchorCell.nodeAfter.attrs.colspan,a=s+this.$headCell.nodeAfter.attrs.colspan;return Math.max(o,a)==n.width}eq(e){return e instanceof Ci&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){const r=e.node(-1),i=bt.get(r),s=e.start(-1),o=i.findCell(e.pos-s),a=i.findCell(n.pos-s),l=e.node(0);return o.left<=a.left?(o.left>0&&(e=l.resolve(s+i.map[o.top*i.width])),a.right0&&(n=l.resolve(s+i.map[a.top*i.width])),o.right{e.push(sn.node(r,r+n.nodeSize,{class:"selectedCell"}))}),je.create(t.doc,e)}function Xoe({$from:t,$to:e}){if(t.pos==e.pos||t.pos=0&&!(t.after(i+1)=0&&!(e.before(s+1)>e.start(s));s--,r--);return n==r&&/row|table/.test(t.node(i).type.spec.tableRole)}function qoe({$from:t,$to:e}){let n,r;for(let i=t.depth;i>0;i--){const s=t.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){n=s;break}}for(let i=e.depth;i>0;i--){const s=e.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){r=s;break}}return n!==r&&e.parentOffset===0}function Zoe(t,e,n){const r=(e||t).selection,i=(e||t).doc;let s,o;if(r instanceof pe&&(o=r.node.type.spec.tableRole)){if(o=="cell"||o=="header_cell")s=nt.create(i,r.from);else if(o=="row"){const a=i.resolve(r.from+1);s=nt.rowSelection(a,a)}else if(!n){const a=bt.get(r.node),l=r.from+1,c=l+a.map[a.width*a.height-1];s=nt.create(i,l+1,c)}}else r instanceof de&&Xoe(r)?s=de.create(i,r.from):r instanceof de&&qoe(r)&&(s=de.create(i,r.$from.start(),r.$from.end()));return s&&(e||(e=t.tr)).setSelection(s),e}var Woe=new rt("fix-tables");function y$(t,e,n,r){const i=t.childCount,s=e.childCount;e:for(let o=0,a=0;o{i.type.spec.tableRole=="table"&&(n=Goe(t,i,s,n))};return e?e.doc!=t.doc&&y$(e.doc,t.doc,0,r):t.doc.descendants(r),n}function Goe(t,e,n,r){const i=bt.get(e);if(!i.problems)return r;r||(r=t.tr);const s=[];for(let l=0;l0){let p="cell";u.firstChild&&(p=u.firstChild.type.spec.tableRole);const f=[];for(let g=0;g0?-1:0;Voe(e,r,i+s)&&(s=i==0||i==e.width?null:0);for(let o=0;o0&&i0&&e.map[a-1]==l||i0?-1:0;tae(e,r,i+l)&&(l=i==0||i==e.height?null:0);for(let c=0,u=e.width*i;c0&&i0&&h==e.map[u-e.width]){const d=n.nodeAt(h).attrs;t.setNodeMarkup(t.mapping.slice(a).map(h+r),null,{...d,rowspan:d.rowspan-1}),c+=d.colspan-1}else if(i0&&n[s]==n[s-1]||r.right0&&n[i]==n[i-t]||r.bottomn[r.type.spec.tableRole])(t,e)}function aae(t){return(e,n)=>{var r;const i=e.selection;let s,o;if(i instanceof nt){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;s=i.$anchorCell.nodeAfter,o=i.$anchorCell.pos}else{if(s=Boe(i.$from),!s)return!1;o=(r=Dl(i.$from))==null?void 0:r.pos}if(s==null||o==null||s.attrs.colspan==1&&s.attrs.rowspan==1)return!1;if(n){let a=s.attrs;const l=[],c=a.colwidth;a.rowspan>1&&(a={...a,rowspan:1}),a.colspan>1&&(a={...a,colspan:1});const u=yi(e),h=e.tr;for(let p=0;p{o.attrs[t]!==e&&s.setNodeMarkup(a,null,{...o.attrs,[t]:e})}):s.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[t]:e}),r(s)}return!0}}function cae(t){return function(e,n){if(!Ir(e))return!1;if(n){const r=yn(e.schema),i=yi(e),s=e.tr,o=i.map.cellsInRect(t=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:t=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),a=o.map(l=>i.table.nodeAt(l));for(let l=0;l{const p=d+s.tableStart,f=o.doc.nodeAt(p);f&&o.setNodeMarkup(p,h,f.attrs)}),r(o)}return!0}}Su("row",{useDeprecatedLogic:!0});Su("column",{useDeprecatedLogic:!0});var uae=Su("cell",{useDeprecatedLogic:!0});function hae(t,e){if(e<0){const n=t.nodeBefore;if(n)return t.pos-n.nodeSize;for(let r=t.index(-1)-1,i=t.before();r>=0;r--){const s=t.node(-1).child(r),o=s.lastChild;if(o)return i-1-o.nodeSize;i-=s.nodeSize}}else{if(t.index()0;r--)if(n.node(r).type.spec.tableRole=="table")return e&&e(t.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function id(t,e){const n=t.selection;if(!(n instanceof nt))return!1;if(e){const r=t.tr,i=yn(t.schema).cell.createAndFill().content;n.forEachCell((s,o)=>{s.content.eq(i)||r.replace(r.mapping.map(o+1),r.mapping.map(o+s.nodeSize-1),new te(i,0,0))}),r.docChanged&&e(r)}return!0}function pae(t){if(!t.size)return null;let{content:e,openStart:n,openEnd:r}=t;for(;e.childCount==1&&(n>0&&r>0||e.child(0).type.spec.tableRole=="table");)n--,r--,e=e.child(0).content;const i=e.child(0),s=i.type.spec.tableRole,o=i.type.schema,a=[];if(s=="row")for(let l=0;l=0;o--){const{rowspan:a,colspan:l}=s.child(o).attrs;for(let c=i;c=e.length&&e.push(X.empty),n[i]r&&(d=d.type.createChecked(Go(d.attrs,d.attrs.colspan,u+d.attrs.colspan-r),d.content)),c.push(d),u+=d.attrs.colspan;for(let p=1;pi&&(h=h.type.create({...h.attrs,rowspan:Math.max(1,i-h.attrs.rowspan)},h.content)),l.push(h)}s.push(X.from(l))}n=s,e=i}return{width:t,height:e,rows:n}}function gae(t,e,n,r,i,s,o){const a=t.doc.type.schema,l=yn(a);let c,u;if(i>e.width)for(let h=0,d=0;he.height){const h=[];for(let f=0,m=(e.height-1)*e.width;f=e.width?!1:n.nodeAt(e.map[m+f]).type==l.header_cell;h.push(g?u||(u=l.header_cell.createAndFill()):c||(c=l.cell.createAndFill()))}const d=l.row.create(null,X.from(h)),p=[];for(let f=e.height;f{if(!i)return!1;const s=n.selection;if(s instanceof nt)return zd(n,r,Te.near(s.$headCell,e));if(t!="horiz"&&!s.empty)return!1;const o=T$(i,t,e);if(o==null)return!1;if(t=="horiz")return zd(n,r,Te.near(n.doc.resolve(s.head+e),e));{const a=n.doc.resolve(o),l=m$(a,t,e);let c;return l?c=Te.near(l,1):e<0?c=Te.near(n.doc.resolve(a.before(-1)),-1):c=Te.near(n.doc.resolve(a.after(-1)),1),zd(n,r,c)}}}function od(t,e){return(n,r,i)=>{if(!i)return!1;const s=n.selection;let o;if(s instanceof nt)o=s;else{const l=T$(i,t,e);if(l==null)return!1;o=new nt(n.doc.resolve(l))}const a=m$(o.$headCell,t,e);return a?zd(n,r,new nt(o.$anchorCell,a)):!1}}function yae(t,e){const n=t.state.doc,r=Dl(n.resolve(e));return r?(t.dispatch(t.state.tr.setSelection(new nt(r))),!0):!1}function bae(t,e,n){if(!Ir(t.state))return!1;let r=pae(n);const i=t.state.selection;if(i instanceof nt){r||(r={width:1,height:1,rows:[X.from(Fb(yn(t.state.schema).cell,n))]});const s=i.$anchorCell.node(-1),o=i.$anchorCell.start(-1),a=bt.get(s).rectBetween(i.$anchorCell.pos-o,i.$headCell.pos-o);return r=mae(r,a.right-a.left,a.bottom-a.top),xC(t.state,t.dispatch,o,a,r),!0}else if(r){const s=Cm(t.state),o=s.start(-1);return xC(t.state,t.dispatch,o,bt.get(s.node(-1)).findCell(s.pos-o),r),!0}else return!1}function Eae(t,e){var n;if(e.ctrlKey||e.metaKey)return;const r=CC(t,e.target);let i;if(e.shiftKey&&t.state.selection instanceof nt)s(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&r&&(i=Dl(t.state.selection.$anchor))!=null&&((n=vO(t,e))==null?void 0:n.pos)!=i.pos)s(i,e),e.preventDefault();else if(!r)return;function s(l,c){let u=vO(t,c);const h=ks.getState(t.state)==null;if(!u||!IT(l,u))if(h)u=l;else return;const d=new nt(l,u);if(h||!t.state.selection.eq(d)){const p=t.state.tr.setSelection(d);h&&p.setMeta(ks,l.pos),t.dispatch(p)}}function o(){t.root.removeEventListener("mouseup",o),t.root.removeEventListener("dragstart",o),t.root.removeEventListener("mousemove",a),ks.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(ks,-1))}function a(l){const c=l,u=ks.getState(t.state);let h;if(u!=null)h=t.state.doc.resolve(u);else if(CC(t,c.target)!=r&&(h=vO(t,e),!h))return o();h&&s(h,c)}t.root.addEventListener("mouseup",o),t.root.addEventListener("dragstart",o),t.root.addEventListener("mousemove",a)}function T$(t,e,n){if(!(t.state.selection instanceof de))return null;const{$head:r}=t.state.selection;for(let i=r.depth-1;i>=0;i--){const s=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:s.childCount))return null;if(s.type.spec.tableRole=="cell"||s.type.spec.tableRole=="header_cell"){const o=r.before(i),a=e=="vert"?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(a)?o:null}}return null}function CC(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function vO(t,e){const n=t.posAtCoords({left:e.clientX,top:e.clientY});return n&&n?Dl(t.state.doc.resolve(n.pos)):null}var vae=class{constructor(t,e){this.node=t,this.defaultCellMinWidth=e,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${e}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),Bb(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!=this.node.type?!1:(this.node=t,Bb(t,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(t){return t.type=="attributes"&&(t.target==this.table||this.colgroup.contains(t.target))}};function Bb(t,e,n,r,i,s){var o;let a=0,l=!0,c=e.firstChild;const u=t.firstChild;if(u){for(let h=0,d=0;hnew r(d,n,p)),new Sae(-1,!1)},apply(o,a){return a.apply(o)}},props:{attributes:o=>{const a=qn.getState(o);return a&&a.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(o,a)=>{wae(o,a,t,i)},mouseleave:o=>{kae(o)},mousedown:(o,a)=>{_ae(o,a,e,n)}},decorations:o=>{const a=qn.getState(o);if(a&&a.activeHandle>-1)return Pae(o,a.activeHandle)},nodeViews:{}}});return s}var Sae=class Vd{constructor(e,n){this.activeHandle=e,this.dragging=n}apply(e){const n=this,r=e.getMeta(qn);if(r&&r.setHandle!=null)return new Vd(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new Vd(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&e.docChanged){let i=e.mapping.map(n.activeHandle,-1);return $b(e.doc.resolve(i))||(i=-1),new Vd(i,n.dragging)}return n}};function wae(t,e,n,r){if(!t.editable)return;const i=qn.getState(t.state);if(i&&!i.dragging){const s=Cae(e.target);let o=-1;if(s){const{left:a,right:l}=s.getBoundingClientRect();e.clientX-a<=n?o=DC(t,e,"left",n):l-e.clientX<=n&&(o=DC(t,e,"right",n))}if(o!=i.activeHandle){if(!r&&o!==-1){const a=t.state.doc.resolve(o),l=a.node(-1),c=bt.get(l),u=a.start(-1);if(c.colCount(a.pos-u)+a.nodeAfter.attrs.colspan-1==c.width-1)return}S$(t,o)}}}function kae(t){if(!t.editable)return;const e=qn.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&S$(t,-1)}function _ae(t,e,n,r){var i;if(!t.editable)return!1;const s=(i=t.dom.ownerDocument.defaultView)!=null?i:window,o=qn.getState(t.state);if(!o||o.activeHandle==-1||o.dragging)return!1;const a=t.state.doc.nodeAt(o.activeHandle),l=xae(t,o.activeHandle,a.attrs);t.dispatch(t.state.tr.setMeta(qn,{setDragging:{startX:e.clientX,startWidth:l}}));function c(h){s.removeEventListener("mouseup",c),s.removeEventListener("mousemove",u);const d=qn.getState(t.state);d!=null&&d.dragging&&(Dae(t,d.activeHandle,AC(d.dragging,h,n)),t.dispatch(t.state.tr.setMeta(qn,{setDragging:null})))}function u(h){if(!h.which)return c(h);const d=qn.getState(t.state);if(d&&d.dragging){const p=AC(d.dragging,h,n);PC(t,d.activeHandle,p,r)}}return PC(t,o.activeHandle,l,r),s.addEventListener("mouseup",c),s.addEventListener("mousemove",u),e.preventDefault(),!0}function xae(t,e,{colspan:n,colwidth:r}){const i=r&&r[r.length-1];if(i)return i;const s=t.domAtPos(e);let o=s.node.childNodes[s.offset].offsetWidth,a=n;if(r)for(let l=0;l{const{doc:f,selection:m}=h,{empty:g}=m,y=!f.textBetween(d,p).length&&ev(h.selection),b=this.element.contains(document.activeElement);return!(!(u.hasFocus()||b)||g||y||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:u})=>{var h;if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}u!=null&&u.relatedTarget&&(h=this.element.parentNode)!=null&&h.contains(u.relatedTarget)||(u==null?void 0:u.relatedTarget)!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(u,h)=>{const d=!(h!=null&&h.selection.eq(u.state.selection)),p=!(h!=null&&h.doc.eq(u.state.doc));!d&&!p||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(u,d,p,h)},this.updateDelay))},this.updateHandler=(u,h,d,p)=>{const{composing:f}=u;if(!(f||!h&&!d)){if(!this.getShouldShow(p)){this.hide();return}this.updatePosition(),this.show()}},this.transactionHandler=({transaction:u})=>{u.getMeta("bubbleMenu")==="updatePosition"&&this.updatePosition()};var c;this.editor=t,this.element=e,this.view=n,this.updateDelay=r,this.resizeDelay=i,this.appendTo=o,this.scrollTarget=(c=l==null?void 0:l.scrollTarget)!=null?c:window,this.getReferencedVirtualElement=a,this.floatingUIOptions={...this.floatingUIOptions,...l},this.element.tabIndex=0,s&&(this.shouldShow=s),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}get middlewares(){const t=[];return this.floatingUIOptions.flip&&t.push(_A(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&t.push(kA(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&t.push(wA(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&t.push(ny(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&t.push(xA(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&t.push(M5(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&t.push(CA(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&t.push(I5(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),t}get virtualElement(){var t;const{selection:e}=this.editor.state,n=(t=this.getReferencedVirtualElement)==null?void 0:t.call(this);if(n)return n;const r=vH(this.view,e.from,e.to);let i={getBoundingClientRect:()=>r,getClientRects:()=>[r]};if(e instanceof pe){let s=this.view.nodeDOM(e.from);const o=s.dataset.nodeViewWrapper?s:s.querySelector("[data-node-view-wrapper]");o&&(s=o),s&&(i={getBoundingClientRect:()=>s.getBoundingClientRect(),getClientRects:()=>[s.getBoundingClientRect()]})}if(e instanceof nt){const{$anchorCell:s,$headCell:o}=e,a=s?s.pos:o.pos,l=o?o.pos:s.pos,c=this.view.nodeDOM(a),u=this.view.nodeDOM(l);if(!c||!u)return;const h=c===u?c.getBoundingClientRect():Rae(c.getBoundingClientRect(),u.getBoundingClientRect());i={getBoundingClientRect:()=>h,getClientRects:()=>[h]}}return i}updatePosition(){const t=this.virtualElement;t&&DA(t,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:n,strategy:r})=>{this.element.style.width="max-content",this.element.style.position=r,this.element.style.left=`${e}px`,this.element.style.top=`${n}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(t,e){const{state:n}=t,r=n.selection.from!==n.selection.to;if(this.updateDelay>0&&r){this.handleDebouncedUpdate(t,e);return}const i=!(e!=null&&e.selection.eq(t.state.selection)),s=!(e!=null&&e.doc.eq(t.state.doc));this.updateHandler(t,i,s,e)}getShouldShow(t){var e;const{state:n}=this.view,{selection:r}=n,{ranges:i}=r,s=Math.min(...i.map(a=>a.$from.pos)),o=Math.max(...i.map(a=>a.$to.pos));return((e=this.shouldShow)==null?void 0:e.call(this,{editor:this.editor,element:this.element,view:this.view,state:n,oldState:t,from:s,to:o}))||!1}show(){var t;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1",(t=(typeof this.appendTo=="function"?this.appendTo():this.appendTo)??this.view.dom.parentElement)==null||t.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},w$=t=>new ze({key:typeof t.pluginKey=="string"?new rt(t.pluginKey):t.pluginKey,view:e=>new Mae({view:e,...t})});Ve.create({name:"bubbleMenu",addOptions(){return{element:null,pluginKey:"bubbleMenu",updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[w$({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,options:this.options.options,appendTo:this.options.appendTo,getReferencedVirtualElement:this.options.getReferencedVirtualElement,shouldShow:this.options.shouldShow})]:[]}});const Dm=({editor:t,className:e,children:n,...r})=>{const i=v.useRef(document.createElement("div"));return v.useEffect(()=>{if(t!=null&&t.isDestroyed)return;const{pluginKey:s="bubbleMenu",options:o={},updateDelay:a,resizeDelay:l,shouldShow:c=null,appendTo:u,getReferencedVirtualElement:h}=r,d=t;if(!d){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}const p=w$({updateDelay:a,resizeDelay:l,editor:d||t,element:i.current,pluginKey:s,shouldShow:c,appendTo:u,getReferencedVirtualElement:h,options:o});return d.registerPlugin(p),()=>{d.unregisterPlugin(s),window.requestAnimationFrame(()=>{i.current.parentNode&&i.current.parentNode.removeChild(i.current)})}},[t]),pl.createPortal(E.jsx("div",{className:bn("rte-bubble-menu",e),children:n}),i.current)},Qa="plaintext",k$=[{syntax:"bash",alias:"sh",label:"Bash"},{syntax:"c",alias:"h",label:"C"},{syntax:"csharp",alias:"cs, c#, dotnet",label:"C#"},{syntax:"css",label:"CSS"},{syntax:"go",alias:"golang",label:"Go"},{syntax:"graphql",alias:"gql",label:"GraphQL"},{syntax:"java",alias:"jsp",label:"Java"},{syntax:"javascript",alias:"js, jsx, mjs, cjs",label:"Javascript"},{syntax:"json",label:"JSON"},{syntax:"kotlin",alias:"kt, kts",label:"Kotlin"},{syntax:"less",label:"Less"},{syntax:"makefile",alias:"mk, mak, make",label:"Makefile"},{syntax:"markdown",alias:"md, mkdown, mkd",label:"Markdown"},{syntax:"objectivec",alias:"mm, objc, obj-c, obj-c++, objective-c++",label:"Objective-C"},{syntax:"php",label:"PHP"},{syntax:"plaintext",alias:"text, txt",label:"Text"},{syntax:"python",alias:"py, gyp, ipython",label:"Python"},{syntax:"scss",label:"SCSS"},{syntax:"shell",alias:"console, shellsession",label:"Shell"},{syntax:"sql",label:"SQL"},{syntax:"typescript",alias:"ts, tsx",label:"TypeScript"},{syntax:"vbnet",alias:"vb",label:"VB .NET"},{syntax:"xml",alias:"html, xhtml, rss, atom, xjb, xsd, xsl, plist, wsf, svg",label:"HTML, XML"}],Iae=({value:t,onSelect:e})=>{var a,l;const{contentElement:n}=$e(),[r,i]=v.useState(""),s=k$.map(c=>({label:c.label,value:c.syntax})),o=v.useMemo(()=>r?s.filter(c=>c.label.includes(r)):s,[s,r]);return E.jsxs(be,{type:"popover",text:(a=s.find(c=>c.value===t))==null?void 0:a.label,hideText:!1,tooltip:!1,buttonStyle:{minWidth:"6rem"},dropdownClass:"rte-code-dropdown",dropdownStyle:{minWidth:"10rem"},children:[E.jsx(Zo,{className:"code-search",placeholder:"Seach language...",style:{width:"10rem"},value:r,onChange:c=>i(c.target.value.trim())}),E.jsx("div",{className:"code-list",style:{maxHeight:`${(((l=n.current)==null?void 0:l.clientHeight)||0)*.375}px`},children:o.map(c=>E.jsx(Ov,{asChild:!0,children:E.jsxs("div",{className:"code-item",onClick:()=>{e(c.value),i("")},children:[c.label,c.value===t&&E.jsx(iu,{name:"Check",className:"code-item__indicator",size:14,strokeWidth:2.5})]})},c.value))})]})},_$=()=>{const{editor:t,contentElement:e}=$e(),{isCopied:n,copy:r}=f$(),i=Ue({editor:t,selector:u=>u.editor.isActive("codeBlock")?u.editor.getAttributes("codeBlock").language:null}),s=v.useCallback(({editor:u})=>u.isActive("codeBlock"),[]),o=v.useCallback(u=>t.commands.updateAttributes("codeBlock",{language:u}),[t]),a=v.useCallback(()=>{const u=Ip(t,"pre");u!=null&&u.textContent&&r(u.textContent)},[t]),l=v.useCallback(()=>{t.chain().focus().deleteNode("codeBlock").run()},[t]),c=v.useCallback(()=>{const u=Ip(t,"pre");return u?{getBoundingClientRect:()=>u.getBoundingClientRect()}:null},[t]);return E.jsx(Dm,{editor:t,pluginKey:"code-block-bubble",shouldShow:s,updateDelay:100,appendTo:()=>e.current,getReferencedVirtualElement:c,options:{placement:"top"},children:E.jsxs(li,{children:[E.jsx(Iae,{value:i,onSelect:o}),E.jsx(Ni,{}),E.jsx(be,{icon:n?"Check":"Clipboard",tooltip:"Copy code",onClick:a}),E.jsx(be,{icon:"Trash",tooltip:"Delete code",onClick:l})]})})};v.memo(_$);const Lae=({initialText:t,onApply:e,onCancel:n})=>{const[r,i]=v.useState(t||"");return E.jsxs("form",{className:"rte-text-alternative__form",onSubmit:s=>{s.preventDefault(),e(r)},children:[E.jsx(Zo,{value:r,onChange:s=>i(s.target.value),placeholder:"Text alternative",autoFocus:!0}),E.jsx(be,{buttonType:"submit",icon:"Check",tooltip:!1}),E.jsx(be,{icon:"Close",tooltip:!1,onClick:n})]})},Qae=({value:t,onChange:e})=>{const n=[null,25,50,75,100];return E.jsx(be,{type:"dropdown",buttonStyle:{width:"6.5rem"},dropdownStyle:{width:"7rem"},icon:"Ruler",text:t?`${t}%`:"Default",hideText:!1,tooltip:!1,children:n.map((r,i)=>E.jsx(gv,{"data-active":r==t||void 0,onSelect:()=>e(r),children:r?`${r}% width`:"Default"},i))})},$ae=()=>{const t=v.useRef(null),{editor:e,isResizing:n,contentElement:r}=$e(),[i,s]=v.useState(!1),o=Ue({editor:e,selector:m=>{if(!m.editor.isActive("image")&&!m.editor.isActive("imageFigure"))return null;const{node:g,pos:y}=Fae(m.editor.state.selection);return g?{pos:y,src:g.attrs.src,alt:g.attrs.alt,width:g.attrs.width,hasCaption:m.editor.isActive("imageFigure")}:null}}),a=v.useCallback(()=>{const m=e.isActive("imageFigure")?"figure":"img",g=Ip(e,m);return g?{getBoundingClientRect:()=>g.getBoundingClientRect()}:null},[e]),l=(m,g)=>{const{state:{selection:y}}=e;return e.chain().command(({commands:b})=>o!=null&&o.pos&&y.from!==o.pos?b.setNodeSelection(o.pos):!0).updateAttributes("image",{[m]:g}).focus().run()},c=()=>e.chain().focus()[o!=null&&o.hasCaption?"figureToImage":"imageToFigure"]().run(),u=()=>{s(m=>!m),requestAnimationFrame(()=>{var m,g;return(g=(m=t.current)==null?void 0:m.updatePosition)==null?void 0:g.call(m)})},h=m=>{l("alt",m),u()},d=m=>l("width",m),p=()=>e.chain().focus().removeImage().run(),f=v.useCallback(async()=>{if(o!=null&&o.src)try{const m=await fetch(o.src);if(!m.ok)throw new Error("Failed to fetch the image.");const g=await m.blob(),y=g.type.split(/\/|\+/)[1],b=URL.createObjectURL(g),T=document.createElement("a");T.href=b,T.download=`image.${y}`,document.body.appendChild(T),T.click(),document.body.removeChild(T),URL.revokeObjectURL(b)}catch{}},[o]);return n?null:E.jsx(Dm,{editor:e,pluginKey:"image-bubble",shouldShow:({editor:m})=>m.isActive("imageFigure")||m.isActive("image"),updateDelay:100,appendTo:()=>r.current,getReferencedVirtualElement:a,options:{offset:15,onShow:()=>{t.current={updatePosition:()=>{}}},onDestroy:()=>t.current=null,onHide:()=>s(!1)},children:i?E.jsx(Lae,{initialText:o==null?void 0:o.alt,onApply:h,onCancel:()=>{e.commands.focus(),u()}}):E.jsxs(li,{children:[E.jsx(be,{text:"Alt text",hideText:!1,tooltip:"Alternative text",onClick:u}),E.jsx(be,{icon:"ImageCaption",tooltip:`Caption: ${o!=null&&o.hasCaption?"ON":"OFF"}`,active:o==null?void 0:o.hasCaption,onClick:c}),E.jsx(Ni,{}),E.jsx(Qae,{value:o==null?void 0:o.width,onChange:d}),E.jsx(Ni,{}),E.jsx(be,{icon:"Download",tooltip:"Download",onClick:f}),E.jsx(be,{icon:"Trash",tooltip:"Delete",onClick:p})]})})},Fae=t=>{let e=null,n=null;if(t instanceof de){const r=t.$anchor;e=r.node(-1).firstChild,n=r.before(-1)+1}else t instanceof pe&&(e=t.node,n=t.from,e.type.name==="imageFigure"&&(e=e.firstChild,n+=1));return{node:e,pos:n}},Bae=({initialUrl:t,initialText:e,isCreate:n,onApply:r,onCancel:i})=>{const[s,o]=v.useState(t||""),[a,l]=v.useState(e||""),[c,u]=v.useState(n),h=()=>{c&&r(s,a)};return v.useEffect(()=>{n||u(s&&s!==t||a!==e)},[a,s]),E.jsxs("div",{className:"rte-link__form",onSubmit:h,children:[E.jsx(Np,{className:"rte-link__label",children:"URL"}),E.jsx(Zo,{value:s,onChange:d=>o(d.target.value),className:"rte-link__input",placeholder:"Paste link",type:"url",required:!0,autoFocus:!0}),E.jsx(Np,{className:"rte-link__label",children:"Display Text"}),E.jsx(Zo,{value:a,onChange:d=>l(d.target.value),className:"rte-link__input",placeholder:"Enter link text"}),E.jsxs("div",{className:"rte-link__actions",children:[E.jsx(Vi,{type:"button",variant:"secondary",onClick:i,children:"Cancel"}),E.jsx(Vi,{type:"button",disabled:!c,onClick:h,children:"Apply"})]})]})},jae=({url:t,onEdit:e,onRemove:n})=>{const{copy:r,isCopied:i}=f$();return E.jsxs(li,{children:[E.jsx(be,{text:"Edit link",hideText:!1,onClick:e}),E.jsx(be,{icon:"ExternalLink",text:"Open in new tab",onClick:()=>window.open(t,"_blank")}),E.jsx(be,{icon:i?"Check":"Clipboard",text:i?"Copied":"Copy link",onClick:()=>r(t)}),E.jsx(be,{icon:"Unlink",text:"Remove link",onClick:n})]})},x$=()=>{const{editor:t,contentElement:e}=$e(),[n,r]=v.useState(!1),i=v.useRef(0),s=Ue({editor:t,selector:h=>{var g;if(i.current=((g=h.editor.storage.link)==null?void 0:g.mode)||0,!h.editor.isActive("link"))return null;const{state:{selection:d,doc:p}}=h.editor,f=h.editor.getAttributes("link").href,m=p.textBetween(d.from,d.to);return{url:f,text:m}}}),o=v.useCallback(({editor:h,from:d,to:p})=>(r(i.current==-1),h.isActive("link")&&(i.current==-1||d!==p)),[]),a=v.useCallback((h,d)=>{t.chain().confirmEditLink({href:h,text:d||h}).run(),r(!1)},[]),l=v.useCallback(()=>{t.chain().focus().unsetLink().run()},[t]),c=v.useCallback(()=>{r(!0)},[]),u=v.useCallback(()=>{i.current==-1?t.commands.confirmEditLink():r(!1)},[t]);return E.jsx(Dm,{editor:t,pluginKey:"link-menu",updateDelay:100,shouldShow:o,appendTo:()=>e.current,options:{placement:"bottom-start",onHide:()=>r(!1)},children:n?E.jsx(Bae,{initialUrl:s==null?void 0:s.url,initialText:s==null?void 0:s.text,isCreate:i.current===-1,onApply:a,onCancel:u}):E.jsx(jae,{url:s==null?void 0:s.url,onEdit:c,onRemove:l})})};v.memo(x$);var zae=Object.defineProperty,Vae=(t,e)=>{for(var n in e)zae(t,n,{get:e[n],enumerable:!0})},Uae="listItem",NC="textStyle",RC=/^\s*([-+*])\s$/,C$=xt.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",Be(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>t.type!=="list"||t.ordered?[]:{type:"bulletList",content:t.items?e.parseChildren(t.items):[]},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,` `):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Uae,this.editor.getAttributes(NC)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=Ga({find:RC,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Ga({find:RC,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(NC),editor:this.editor})),[t]}}),D$=xt.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",Be(this.options.HTMLAttributes,t),0]},markdownTokenName:"list_item",parseMarkdown:(t,e)=>{if(t.type!=="list_item")return[];let n=[];if(t.tokens&&t.tokens.length>0)if(t.tokens.some(r=>r.type==="paragraph"))n=e.parseChildren(t.tokens);else{const r=t.tokens[0];if(r&&r.type==="text"&&r.tokens&&r.tokens.length>0){if(n=[{type:"paragraph",content:e.parseInline(r.tokens)}],t.tokens.length>1){const i=t.tokens.slice(1),s=e.parseChildren(i);n.push(...s)}}else n=e.parseChildren(t.tokens)}return n.length===0&&(n=[{type:"paragraph",content:[]}]),{type:"listItem",content:n}},renderMarkdown:(t,e,n)=>cv(t,e,r=>r.parentType==="bulletList"?"- ":r.parentType==="orderedList"?`${r.index+1}. `:"- ",n),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Hae={};Vae(Hae,{findListItemPos:()=>sh,getNextListDepth:()=>LT,handleBackspace:()=>jb,handleDelete:()=>zb,hasListBefore:()=>A$,hasListItemAfter:()=>Xae,hasListItemBefore:()=>P$,listItemHasSubList:()=>N$,nextListIsDeeper:()=>R$,nextListIsHigher:()=>M$});var sh=(t,e)=>{const{$from:n}=e.selection,r=Rt(t,e.schema);let i=null,s=n.depth,o=n.pos,a=null;for(;s>0&&a===null;)i=n.node(s),i.type===r?a=s:(s-=1,o-=1);return a===null?null:{$pos:e.doc.resolve(o),depth:a}},LT=(t,e)=>{const n=sh(t,e);if(!n)return!1;const[,r]=gH(e,t,n.$pos.pos+4);return r},A$=(t,e,n)=>{const{$anchor:r}=t.selection,i=Math.max(0,r.pos-2),s=t.doc.resolve(i).node();return!(!s||!n.includes(s.type.name))},P$=(t,e)=>{var n;const{$anchor:r}=e.selection,i=e.doc.resolve(r.pos-2);return!(i.index()===0||((n=i.nodeBefore)==null?void 0:n.type.name)!==t)},N$=(t,e,n)=>{if(!n)return!1;const r=Rt(t,e.schema);let i=!1;return n.descendants(s=>{s.type===r&&(i=!0)}),i},jb=(t,e,n)=>{if(t.commands.undoInputRule())return!0;if(t.state.selection.from!==t.state.selection.to)return!1;if(!Dr(t.state,e)&&A$(t.state,e,n)){const{$anchor:o}=t.state.selection,a=t.state.doc.resolve(o.before()-1),l=[];a.node().descendants((h,d)=>{h.type.name===e&&l.push({node:h,pos:d})});const c=l.at(-1);if(!c)return!1;const u=t.state.doc.resolve(a.start()+c.pos+1);return t.chain().cut({from:o.start()-1,to:o.end()+1},u.end()).joinForward().run()}if(!Dr(t.state,e)||!EH(t.state))return!1;const r=sh(e,t.state);if(!r)return!1;const i=t.state.doc.resolve(r.$pos.pos-2).node(r.depth),s=N$(e,t.state,i);return P$(e,t.state)&&!s?t.commands.joinItemBackward():t.chain().liftListItem(e).run()},R$=(t,e)=>{const n=LT(t,e),r=sh(t,e);return!r||!n?!1:n>r.depth},M$=(t,e)=>{const n=LT(t,e),r=sh(t,e);return!r||!n?!1:n{if(!Dr(t.state,e)||!bH(t.state,e))return!1;const{selection:n}=t.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:R$(e,t.state)?t.chain().focus(t.state.selection.from+4).lift(e).joinBackward().run():M$(e,t.state)?t.chain().joinForward().joinBackward().run():t.commands.joinItemForward()},Xae=(t,e)=>{var n;const{$anchor:r}=e.selection,i=e.doc.resolve(r.pos-r.parentOffset-2);return!(i.index()===i.parent.childCount-1||((n=i.nodeAfter)==null?void 0:n.type.name)!==t)},QT=Ve.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&zb(t,n)&&(e=!0)}),e},"Mod-Delete":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&zb(t,n)&&(e=!0)}),e},Backspace:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{t.state.schema.nodes[n]!==void 0&&jb(t,n,r)&&(e=!0)}),e},"Mod-Backspace":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{t.state.schema.nodes[n]!==void 0&&jb(t,n,r)&&(e=!0)}),e}}}}),MC=/^(\s*)(\d+)\.\s+(.*)$/,qae=/^\s/;function Zae(t){const e=[];let n=0,r=0;for(;ne;)d.push(t[h]),h+=1;if(d.length>0){const p=Math.min(...d.map(m=>m.indent)),f=I$(d,p,n);c.push({type:"list",ordered:!0,start:d[0].number,items:f,raw:d.map(m=>m.raw).join(` `)})}i.push({type:"list_item",raw:o.raw,tokens:c}),s=h}else s+=1}return i}function Wae(t,e){return t.map(n=>{if(n.type!=="list_item")return e.parseChildren([n])[0];const r=[];return n.tokens&&n.tokens.length>0&&n.tokens.forEach(i=>{if(i.type==="paragraph"||i.type==="list"||i.type==="blockquote"||i.type==="code")r.push(...e.parseChildren([i]));else if(i.type==="text"&&i.tokens){const s=e.parseChildren([i]);r.push({type:"paragraph",content:s})}else{const s=e.parseChildren([i]);s.length>0&&r.push(...s)}}),{type:"listItem",content:r}})}var Gae="listItem",IC="textStyle",LC=/^(\d+)\.\s$/,L$=xt.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",Be(this.options.HTMLAttributes,n),0]:["ol",Be(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>{if(t.type!=="list"||!t.ordered)return[];const n=t.start||1,r=t.items?Wae(t.items,e):[];return n!==1?{type:"orderedList",attrs:{start:n},content:r}:{type:"orderedList",content:r}},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,` `):"",markdownTokenizer:{name:"orderedList",level:"block",start:t=>{const e=t.match(/^(\s*)(\d+)\.\s+/),n=e==null?void 0:e.index;return n!==void 0?n:-1},tokenize:(t,e,n)=>{var r;const i=t.split(` `),[s,o]=Zae(i);if(s.length===0)return;const a=I$(s,0,n);return a.length===0?void 0:{type:"list",ordered:!0,start:((r=s[0])==null?void 0:r.number)||1,items:a,raw:i.slice(0,o).join(` `)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Gae,this.editor.getAttributes(IC)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=Ga({find:LC,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Ga({find:LC,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(IC)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),Yae=/^\s*(\[([( |x])?\])\s$/,Kae=xt.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{const e=t.getAttribute("data-checked");return e===""||e==="true"},renderHTML:t=>({"data-checked":t.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:t,HTMLAttributes:e}){return["li",Be(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(t,e)=>{const n=[];if(t.tokens&&t.tokens.length>0?n.push(e.createNode("paragraph",{},e.parseInline(t.tokens))):t.text?n.push(e.createNode("paragraph",{},[e.createNode("text",{text:t.text})])):n.push(e.createNode("paragraph",{},[])),t.nestedTokens&&t.nestedTokens.length>0){const r=e.parseChildren(t.nestedTokens);n.push(...r)}return e.createNode("taskItem",{checked:t.checked||!1},n)},renderMarkdown:(t,e)=>{var n;const r=`- [${(n=t.attrs)!=null&&n.checked?"x":" "}] `;return cv(t,e,r)},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:n,editor:r})=>{const i=document.createElement("li"),s=document.createElement("label"),o=document.createElement("span"),a=document.createElement("input"),l=document.createElement("div"),c=u=>{var h,d;a.ariaLabel=((d=(h=this.options.a11y)==null?void 0:h.checkboxLabel)==null?void 0:d.call(h,u,a.checked))||`Task item checkbox for ${u.textContent||"empty task item"}`};return c(t),s.contentEditable="false",a.type="checkbox",a.addEventListener("mousedown",u=>u.preventDefault()),a.addEventListener("change",u=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){a.checked=!a.checked;return}const{checked:h}=u.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:d})=>{const p=n();if(typeof p!="number")return!1;const f=d.doc.nodeAt(p);return d.setNodeMarkup(p,void 0,{...f==null?void 0:f.attrs,checked:h}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,h)||(a.checked=!a.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([u,h])=>{i.setAttribute(u,h)}),i.dataset.checked=t.attrs.checked,a.checked=t.attrs.checked,s.append(a,o),i.append(s,l),Object.entries(e).forEach(([u,h])=>{i.setAttribute(u,h)}),{dom:i,contentDOM:l,update:u=>u.type!==this.type?!1:(i.dataset.checked=u.attrs.checked,a.checked=u.attrs.checked,c(u),!0)}}},addInputRules(){return[Ga({find:Yae,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),Jae=xt.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:t}){return["ul",Be(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},parseMarkdown:(t,e)=>e.createNode("taskList",{},e.parseChildren(t.items||[])),renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,` `):"",markdownTokenizer:{name:"taskList",level:"block",start(t){var e;const n=(e=t.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:e.index;return n!==void 0?n:-1},tokenize(t,e,n){const r=s=>{const o=Sy(s,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:a=>({indentLevel:a[1].length,mainContent:a[4],checked:a[3].toLowerCase()==="x"}),createToken:(a,l)=>({type:"taskItem",raw:"",mainContent:a.mainContent,indentLevel:a.indentLevel,checked:a.checked,text:a.mainContent,tokens:n.inlineTokens(a.mainContent),nestedTokens:l}),customNestedParser:r},n);return o?[{type:"taskList",raw:o.raw,items:o.items}]:n.blockTokens(s)},i=Sy(t,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:s=>({indentLevel:s[1].length,mainContent:s[4],checked:s[3].toLowerCase()==="x"}),createToken:(s,o)=>({type:"taskItem",raw:"",mainContent:s.mainContent,indentLevel:s.indentLevel,checked:s.checked,text:s.mainContent,tokens:n.inlineTokens(s.mainContent),nestedTokens:o}),customNestedParser:r},n);if(i)return{type:"taskList",raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});Ve.create({name:"listKit",addExtensions(){const t=[];return this.options.bulletList!==!1&&t.push(C$.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(D$.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(QT.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(L$.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(Kae.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(Jae.configure(this.options.taskList)),t}});function ele(t={}){return new ze({view(e){return new tle(e,t)}})}class tle{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let s=o=>{this[i](o)};return e.dom.addEventListener(i,s),{name:i,handler:s}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r,i=this.editorView.dom,s=i.getBoundingClientRect(),o=s.width/i.offsetWidth,a=s.height/i.offsetHeight;if(n){let h=e.nodeBefore,d=e.nodeAfter;if(h||d){let p=this.editorView.nodeDOM(this.cursorPos-(h?h.nodeSize:0));if(p){let f=p.getBoundingClientRect(),m=h?f.bottom:f.top;h&&d&&(m=(m+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let g=this.width/2*a;r={left:f.left,right:f.right,top:m-g,bottom:m+g}}}}if(!r){let h=this.editorView.coordsAtPos(this.cursorPos),d=this.width/2*o;r={left:h.left-d,right:h.left+d,top:h.top,bottom:h.bottom}}let l=this.editorView.dom.offsetParent;this.element||(this.element=l.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let c,u;if(!l||l==document.body&&getComputedStyle(l).position=="static")c=-pageXOffset,u=-pageYOffset;else{let h=l.getBoundingClientRect(),d=h.width/l.offsetWidth,p=h.height/l.offsetHeight;c=h.left-l.scrollLeft*d,u=h.top-l.scrollTop*p}this.element.style.left=(r.left-c)/o+"px",this.element.style.top=(r.top-u)/a+"px",this.element.style.width=(r.right-r.left)/o+"px",this.element.style.height=(r.bottom-r.top)/a+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,s=typeof i=="function"?i(this.editorView,n,e):i;if(n&&!s){let o=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=RP(this.editorView.state.doc,o,this.editorView.dragging.slice);a!=null&&(o=a)}this.setCursor(o),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class yt extends Te{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return yt.valid(r)?new yt(r):Te.near(r)}content(){return te.empty}eq(e){return e instanceof yt&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new yt(e.resolve(n.pos))}getBookmark(){return new $T(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!nle(e)||!rle(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&yt.valid(e))return e;let i=e.pos,s=null;for(let o=e.depth;;o--){let a=e.node(o);if(n>0?e.indexAfter(o)0){s=a.child(n>0?e.indexAfter(o):e.index(o)-1);break}else if(o==0)return null;i+=n;let l=e.doc.resolve(i);if(yt.valid(l))return l}for(;;){let o=n>0?s.firstChild:s.lastChild;if(!o){if(s.isAtom&&!s.isText&&!pe.isSelectable(s)){e=e.doc.resolve(i+s.nodeSize*n),r=!1;continue e}break}s=o,i+=n;let a=e.doc.resolve(i);if(yt.valid(a))return a}return null}}}yt.prototype.visible=!1;yt.findFrom=yt.findGapCursorFrom;Te.jsonID("gapcursor",yt);class $T{constructor(e){this.pos=e}map(e){return new $T(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return yt.valid(n)?new yt(n):Te.near(n)}}function Q$(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}function nle(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||Q$(i.type))return!0;if(i.inlineContent)return!1}}return!0}function rle(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||Q$(i.type))return!0;if(i.inlineContent)return!1}}return!0}function ile(){return new ze({props:{decorations:lle,createSelectionBetween(t,e,n){return e.pos==n.pos&&yt.valid(n)?new yt(n):null},handleClick:ole,handleKeyDown:sle,handleDOMEvents:{beforeinput:ale}}})}const sle=YE({ArrowLeft:ad("horiz",-1),ArrowRight:ad("horiz",1),ArrowUp:ad("vert",-1),ArrowDown:ad("vert",1)});function ad(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,s){let o=r.selection,a=e>0?o.$to:o.$from,l=o.empty;if(o instanceof de){if(!s.endOfTextblock(n)||a.depth==0)return!1;l=!1,a=r.doc.resolve(e>0?a.after():a.before())}let c=yt.findGapCursorFrom(a,e,l);return c?(i&&i(r.tr.setSelection(new yt(c))),!0):!1}}function ole(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!yt.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&pe.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new yt(r))),!0)}function ale(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof yt))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let i=X.empty;for(let o=r.length-1;o>=0;o--)i=X.from(r[o].createAndFill(null,i));let s=t.state.tr.replace(n.pos,n.pos,new te(i,0,0));return s.setSelection(de.near(s.doc.resolve(n.pos+1))),t.dispatch(s),!1}function lle(t){if(!(t.selection instanceof yt))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",je.create(t.doc,[sn.widget(t.selection.head,e,{key:"gapcursor"})])}var Lp=200,Gt=function(){};Gt.prototype.append=function(t){return t.length?(t=Gt.from(t),!this.length&&t||t.length=e?Gt.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))};Gt.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};Gt.prototype.forEach=function(t,e,n){e===void 0&&(e=0),n===void 0&&(n=this.length),e<=n?this.forEachInner(t,e,n,0):this.forEachInvertedInner(t,e,n,0)};Gt.prototype.map=function(t,e,n){e===void 0&&(e=0),n===void 0&&(n=this.length);var r=[];return this.forEach(function(i,s){return r.push(t(i,s))},e,n),r};Gt.from=function(t){return t instanceof Gt?t:t&&t.length?new $$(t):Gt.empty};var $$=(function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(r,i){return r==0&&i==this.length?this:new e(this.values.slice(r,i))},e.prototype.getInner=function(r){return this.values[r]},e.prototype.forEachInner=function(r,i,s,o){for(var a=i;a=s;a--)if(r(this.values[a],o+a)===!1)return!1},e.prototype.leafAppend=function(r){if(this.length+r.length<=Lp)return new e(this.values.concat(r.flatten()))},e.prototype.leafPrepend=function(r){if(this.length+r.length<=Lp)return new e(r.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e})(Gt);Gt.empty=new $$([]);var cle=(function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(n){return no&&this.right.forEachInner(n,Math.max(r-o,0),Math.min(this.length,i)-o,s+o)===!1)return!1},e.prototype.forEachInvertedInner=function(n,r,i,s){var o=this.left.length;if(r>o&&this.right.forEachInvertedInner(n,r-o,Math.max(i,o)-o,s+o)===!1||i=i?this.right.slice(n-i,r-i):this.left.slice(n,i).append(this.right.slice(0,r-i))},e.prototype.leafAppend=function(n){var r=this.right.leafAppend(n);if(r)return new e(this.left,r)},e.prototype.leafPrepend=function(n){var r=this.left.leafPrepend(n);if(r)return new e(r,this.right)},e.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new e(this.left,new e(this.right,n)):new e(this,n)},e})(Gt);const ule=500;class Er{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,s;n&&(i=this.remapping(r,this.items.length),s=i.maps.length);let o=e.tr,a,l,c=[],u=[];return this.items.forEach((h,d)=>{if(!h.step){i||(i=this.remapping(r,d+1),s=i.maps.length),s--,u.push(h);return}if(i){u.push(new Zr(h.map));let p=h.step.map(i.slice(s)),f;p&&o.maybeStep(p).doc&&(f=o.mapping.maps[o.mapping.maps.length-1],c.push(new Zr(f,void 0,void 0,c.length+u.length))),s--,f&&i.appendMap(f,s)}else o.maybeStep(h.step);if(h.selection)return a=i?h.selection.map(i.slice(s)):h.selection,l=new Er(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:o,selection:a}}addTransform(e,n,r,i){let s=[],o=this.eventCount,a=this.items,l=!i&&a.length?a.get(a.length-1):null;for(let u=0;udle&&(a=hle(a,c),o-=c),new Er(a.append(s),o)}remapping(e,n){let r=new qc;return this.items.forEach((i,s)=>{let o=i.mirrorOffset!=null&&s-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,o)},e,n),r}addMaps(e){return this.eventCount==0?this:new Er(this.items.append(e.map(n=>new Zr(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),s=e.mapping,o=e.steps.length,a=this.eventCount;this.items.forEach(d=>{d.selection&&a--},i);let l=n;this.items.forEach(d=>{let p=s.getMirror(--l);if(p==null)return;o=Math.min(o,p);let f=s.maps[p];if(d.step){let m=e.steps[p].invert(e.docs[p]),g=d.selection&&d.selection.map(s.slice(l+1,p));g&&a++,r.push(new Zr(f,m,g))}else r.push(new Zr(f))},i);let c=[];for(let d=n;dule&&(h=h.compress(this.items.length-r.length)),h}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],s=0;return this.items.forEach((o,a)=>{if(a>=e)i.push(o),o.selection&&s++;else if(o.step){let l=o.step.map(n.slice(r)),c=l&&l.getMap();if(r--,c&&n.appendMap(c,r),l){let u=o.selection&&o.selection.map(n.slice(r));u&&s++;let h=new Zr(c.invert(),l,u),d,p=i.length-1;(d=i.length&&i[p].merge(h))?i[p]=d:i.push(h)}}else o.map&&r--},this.items.length,0),new Er(Gt.from(i.reverse()),s)}}Er.empty=new Er(Gt.empty,0);function hle(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}class Zr{constructor(e,n,r,i){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new Zr(n.getMap().invert(),n,this.selection)}}}class vs{constructor(e,n,r,i,s){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=s}}const dle=20;function ple(t,e,n,r){let i=n.getMeta(Po),s;if(i)return i.historyState;n.getMeta(gle)&&(t=new vs(t.done,t.undone,null,0,-1));let o=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(o&&o.getMeta(Po))return o.getMeta(Po).redo?new vs(t.done.addTransform(n,void 0,r,Ud(e)),t.undone,QC(n.mapping.maps),t.prevTime,t.prevComposition):new vs(t.done,t.undone.addTransform(n,void 0,r,Ud(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=t.prevTime==0||!o&&t.prevComposition!=a&&(t.prevTime<(n.time||0)-r.newGroupDelay||!fle(n,t.prevRanges)),c=o?TO(t.prevRanges,n.mapping):QC(n.mapping.maps);return new vs(t.done.addTransform(n,l?e.selection.getBookmark():void 0,r,Ud(e)),Er.empty,c,n.time,a??t.prevComposition)}else return(s=n.getMeta("rebased"))?new vs(t.done.rebased(n,s),t.undone.rebased(n,s),TO(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new vs(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),TO(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function fle(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,i)=>{for(let s=0;s=e[s]&&(n=!0)}),n}function QC(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,i,s,o)=>e.push(s,o));return e}function TO(t,e){if(!t)return null;let n=[];for(let r=0;r{let i=Po.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(r){let s=mle(i,n,t);s&&r(s.scrollIntoView())}return!0}}const B$=F$(!1),j$=F$(!0);var yle=Ve.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc;if(((t==null?void 0:t.mode)||this.options.mode)==="textSize"){const n=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(n)}return e.nodeSize},this.storage.words=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc,n=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let t=!1;return[new ze({key:new rt("characterCount"),appendTransaction:(e,n,r)=>{if(t)return;const i=this.options.limit;if(i==null||i===0){t=!0;return}const s=this.storage.characters({node:r.doc});if(s>i){const o=s-i,a=0,l=o;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);const c=r.tr.deleteRange(a,l);return t=!0,c}t=!0},filterTransaction:(e,n)=>{const r=this.options.limit;if(!e.docChanged||r===0||r===null||r===void 0)return!0;const i=this.storage.characters({node:n.doc}),s=this.storage.characters({node:e.doc});if(s<=r||i>r&&s>r&&s<=i)return!0;if(i>r&&s>r&&s>i||!e.getMeta("paste"))return!1;const o=e.selection.$head.pos,a=s-r,l=o-a,c=o;return e.deleteRange(l,c),!(this.storage.characters({node:e.doc})>r)}})]}}),ble=Ve.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[ele(this.options)]}});Ve.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new ze({key:new rt("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:i}=e,s=[];if(!n||!r)return je.create(t,[]);let o=0;this.options.mode==="deepest"&&t.descendants((l,c)=>{if(!l.isText){if(!(i>=c&&i<=c+l.nodeSize-1))return!1;o+=1}});let a=0;return t.descendants((l,c)=>{if(l.isText||!(i>=c&&i<=c+l.nodeSize-1))return!1;if(a+=1,this.options.mode==="deepest"&&o-a>0||this.options.mode==="shallowest"&&a>1)return this.options.mode==="deepest";s.push(sn.node(c,c+l.nodeSize,{class:this.options.className}))}),je.create(t,s)}}})]}});var Ele=Ve.create({name:"gapCursor",addProseMirrorPlugins(){return[ile()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=qe(ge(t,"allowGapCursor",n)))!=null?e:null}}}),vle=Ve.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new ze({key:new rt("placeholder"),props:{decorations:({doc:t,selection:e})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=e,i=[];if(!n)return null;const s=this.editor.isEmpty;return t.descendants((o,a)=>{const l=r>=a&&r<=a+o.nodeSize,c=!o.isLeaf&&Gf(o);if((l||!this.options.showOnlyCurrent)&&c){const u=[this.options.emptyNodeClass];s&&u.push(this.options.emptyEditorClass);const h=sn.node(a,a+o.nodeSize,{class:u.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:o,pos:a,hasAnchor:l}):this.options.placeholder});i.push(h)}return this.options.includeChildren}),je.create(t,i)}}})]}});Ve.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:t,options:e}=this;return[new ze({key:new rt("selection"),props:{decorations(n){return n.selection.empty||t.isFocused||!t.isEditable||YN(n.selection)||t.view.dragging?null:je.create(n.doc,[sn.inline(n.selection.from,n.selection.to,{class:e.className})])}}})]}});function FC({types:t,node:e}){return e&&Array.isArray(t)&&t.includes(e.type)||(e==null?void 0:e.type)===t}var Tle=Ve.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var t;const e=new rt(this.name),n=this.options.node||((t=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:t.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,i])=>i).filter(i=>(this.options.notAfter||[]).concat(n).includes(i.name));return[new ze({key:e,appendTransaction:(i,s,o)=>{const{doc:a,tr:l,schema:c}=o,u=e.getState(o),h=a.content.size,d=c.nodes[n];if(u)return l.insert(h,d.create())},state:{init:(i,s)=>{const o=s.tr.doc.lastChild;return!FC({node:o,types:r})},apply:(i,s)=>{if(!i.docChanged||i.getMeta("__uniqueIDTransaction"))return s;const o=i.doc.lastChild;return!FC({node:o,types:r})}}})]}}),Sle=Ve.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>B$(t,e),redo:()=>({state:t,dispatch:e})=>j$(t,e)}},addProseMirrorPlugins(){return[Ole(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),wle=20,z$=(t,e=0)=>{const n=[];return!t.children.length||e>wle||Array.from(t.children).forEach(r=>{r.tagName==="SPAN"?n.push(r):r.children.length&&n.push(...z$(r,e+1))}),n},kle=t=>{if(!t.children.length)return;const e=z$(t);e&&e.forEach(n=>{var r,i;const s=n.getAttribute("style"),o=(i=(r=n.parentElement)==null?void 0:r.closest("span"))==null?void 0:i.getAttribute("style");n.setAttribute("style",`${o};${s}`)})},V$=Rr.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!0}},parseHTML(){return[{tag:"span",consuming:!1,getAttrs:t=>t.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&kle(t),{}):!1}]},renderHTML({HTMLAttributes:t}){return["span",Be(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleTextStyle:t=>({commands:e})=>e.toggleMark(this.name,t),removeEmptyTextStyle:()=>({tr:t})=>{const{selection:e}=t;return t.doc.nodesBetween(e.from,e.to,(n,r)=>{if(n.isTextblock)return!0;n.marks.filter(i=>i.type===this.type).some(i=>Object.values(i.attrs).some(s=>!!s))||t.removeMark(r,r+n.nodeSize,this.type)}),!0}}}}),_le=Ve.create({name:"backgroundColor",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{backgroundColor:{default:null,parseHTML:t=>{var e;const n=t.getAttribute("style");if(n){const r=n.split(";").map(i=>i.trim()).filter(Boolean);for(let i=r.length-1;i>=0;i-=1){const s=r[i].split(":");if(s.length>=2){const o=s[0].trim().toLowerCase(),a=s.slice(1).join(":").trim();if(o==="background-color")return a.replace(/['"]+/g,"")}}}return(e=t.style.backgroundColor)==null?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.backgroundColor?{style:`background-color: ${t.backgroundColor}`}:{}}}}]},addCommands(){return{setBackgroundColor:t=>({chain:e})=>e().setMark("textStyle",{backgroundColor:t}).run(),unsetBackgroundColor:()=>({chain:t})=>t().setMark("textStyle",{backgroundColor:null}).removeEmptyTextStyle().run()}}}),U$=Ve.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:t=>{var e;const n=t.getAttribute("style");if(n){const r=n.split(";").map(i=>i.trim()).filter(Boolean);for(let i=r.length-1;i>=0;i-=1){const s=r[i].split(":");if(s.length>=2){const o=s[0].trim().toLowerCase(),a=s.slice(1).join(":").trim();if(o==="color")return a.replace(/['"]+/g,"")}}}return(e=t.style.color)==null?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.color?{style:`color: ${t.color}`}:{}}}}]},addCommands(){return{setColor:t=>({chain:e})=>e().setMark("textStyle",{color:t}).run(),unsetColor:()=>({chain:t})=>t().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}),xle=Ve.create({name:"fontFamily",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:t=>t.style.fontFamily,renderHTML:t=>t.fontFamily?{style:`font-family: ${t.fontFamily}`}:{}}}}]},addCommands(){return{setFontFamily:t=>({chain:e})=>e().setMark("textStyle",{fontFamily:t}).run(),unsetFontFamily:()=>({chain:t})=>t().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}}}),Cle=Ve.create({name:"fontSize",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:t=>t.style.fontSize,renderHTML:t=>t.fontSize?{style:`font-size: ${t.fontSize}`}:{}}}}]},addCommands(){return{setFontSize:t=>({chain:e})=>e().setMark("textStyle",{fontSize:t}).run(),unsetFontSize:()=>({chain:t})=>t().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}}),Dle=Ve.create({name:"lineHeight",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:t=>t.style.lineHeight,renderHTML:t=>t.lineHeight?{style:`line-height: ${t.lineHeight}`}:{}}}}]},addCommands(){return{setLineHeight:t=>({chain:e})=>e().setMark("textStyle",{lineHeight:t}).run(),unsetLineHeight:()=>({chain:t})=>t().setMark("textStyle",{lineHeight:null}).removeEmptyTextStyle().run()}}});Ve.create({name:"textStyleKit",addExtensions(){const t=[];return this.options.backgroundColor!==!1&&t.push(_le.configure(this.options.backgroundColor)),this.options.color!==!1&&t.push(U$.configure(this.options.color)),this.options.fontFamily!==!1&&t.push(xle.configure(this.options.fontFamily)),this.options.fontSize!==!1&&t.push(Cle.configure(this.options.fontSize)),this.options.lineHeight!==!1&&t.push(Dle.configure(this.options.lineHeight)),this.options.textStyle!==!1&&t.push(V$.configure(this.options.textStyle)),t}});var Ale=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,Ple=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,Nle=Rr.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:t=>t.getAttribute("data-color")||t.style.backgroundColor,renderHTML:t=>t.color?{"data-color":t.color,style:`background-color: ${t.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:t}){return["mark",Be(this.options.HTMLAttributes,t),0]},renderMarkdown:(t,e)=>`==${e.renderChildren(t)}==`,parseMarkdown:(t,e)=>e.applyMark("highlight",e.parseInline(t.tokens||[])),markdownTokenizer:{name:"highlight",level:"inline",start:t=>t.indexOf("=="),tokenize(t,e,n){const r=/^(==)([^=]+)(==)/.exec(t);if(r){const i=r[2].trim(),s=n.inlineTokens(i);return{type:"highlight",raw:r[0],text:i,tokens:s}}}},addCommands(){return{setHighlight:t=>({commands:e})=>e.setMark(this.name,t),toggleHighlight:t=>({commands:e})=>e.toggleMark(this.name,t),unsetHighlight:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[$o({find:Ale,type:this.type})]},addPasteRules(){return[Hs({find:Ple,type:this.type})]}}),Rle=Rr.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(t){return t!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sub",Be(this.options.HTMLAttributes,t),0]},addCommands(){return{setSubscript:()=>({commands:t})=>t.setMark(this.name),toggleSubscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSubscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),Mle=Rr.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(t){return t!=="super"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sup",Be(this.options.HTMLAttributes,t),0]},addCommands(){return{setSuperscript:()=>({commands:t})=>t.setMark(this.name),toggleSuperscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSuperscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),Ile=Ve.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>{const e=t.style.textAlign;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:t=>t.textAlign?{style:`text-align: ${t.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.map(n=>e.updateAttributes(n,{textAlign:t})).some(n=>n):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.map(e=>t.resetAttributes(e,"textAlign")).some(e=>e),toggleTextAlign:t=>({editor:e,commands:n})=>this.options.alignments.includes(t)?e.isActive({textAlign:t})?n.unsetTextAlign():n.setTextAlign(t):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),H$=Rr.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",Be(this.options.HTMLAttributes,t),0]},parseMarkdown(t,e){return e.applyMark(this.name||"underline",e.parseInline(t.tokens||[]))},renderMarkdown(t,e){return`++${e.renderChildren(t)}++`},markdownTokenizer:{name:"underline",level:"inline",start(t){return t.indexOf("++")},tokenize(t,e,n){const r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(t);if(!r)return;const i=r[2].trim();return{type:"underline",raw:r[0],text:i,tokens:n.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),Qp=(t,e)=>{if(t==="slot")return 0;if(t instanceof Function)return t(e);const{children:n,...r}=e??{};if(t==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[t,r,n]},Lle=/^\s*>\s$/,Qle=xt.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return Qp("blockquote",{...Be(this.options.HTMLAttributes,t),children:Qp("slot",{})})},parseMarkdown:(t,e)=>e.createNode("blockquote",void 0,e.parseChildren(t.tokens||[])),renderMarkdown:(t,e)=>{if(!t.content)return"";const n=">",r=[];return t.content.forEach(i=>{const s=e.renderChildren([i]).split(` `).map(o=>o.trim()===""?n:`${n} ${o}`);r.push(s.join(` `))}),r.join(` ${n} `)},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Ga({find:Lle,type:this.type})]}}),$le=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,Fle=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,Ble=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,jle=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,zle=Rr.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return Qp("strong",{...Be(this.options.HTMLAttributes,t),children:Qp("slot",{})})},markdownTokenName:"strong",parseMarkdown:(t,e)=>e.applyMark("bold",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`**${e.renderChildren(t)}**`,addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[$o({find:$le,type:this.type}),$o({find:Ble,type:this.type})]},addPasteRules(){return[Hs({find:Fle,type:this.type}),Hs({find:jle,type:this.type})]}}),Vle=/(^|[^`])`([^`]+)`(?!`)$/,Ule=/(^|[^`])`([^`]+)`(?!`)/g,Hle=Rr.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",Be(this.options.HTMLAttributes,t),0]},markdownTokenName:"codespan",parseMarkdown:(t,e)=>e.applyMark("code",[{type:"text",text:t.text||""}]),renderMarkdown:(t,e)=>t.content?`\`${e.renderChildren(t.content)}\``:"",addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[$o({find:Vle,type:this.type})]},addPasteRules(){return[Hs({find:Ule,type:this.type})]}}),wO=4,Xle=/^```([a-z]+)?[\s\n]$/,qle=/^~~~([a-z]+)?[\s\n]$/,X$=xt.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:wO,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options;return n&&[...((e=t.firstElementChild)==null?void 0:e.classList)||[]].filter(i=>i.startsWith(n)).map(i=>i.replace(n,""))[0]||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",Be(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(t,e)=>{var n;return((n=t.raw)==null?void 0:n.startsWith("```"))===!1&&t.codeBlockStyle!=="indented"?[]:e.createNode("codeBlock",{language:t.lang||null},t.text?[e.createTextNode(t.text)]:[])},renderMarkdown:(t,e)=>{var n;let r="";const i=((n=t.attrs)==null?void 0:n.language)||"";return t.content?r=[`\`\`\`${i}`,e.renderChildren(t.content),"```"].join(` `):r=`\`\`\`${i} \`\`\``,r},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;const n=(e=this.options.tabSize)!=null?e:wO,{state:r}=t,{selection:i}=r,{$from:s,empty:o}=i;if(s.parent.type!==this.type)return!1;const a=" ".repeat(n);return o?t.commands.insertContent(a):t.commands.command(({tr:l})=>{const{from:c,to:u}=i,h=r.doc.textBetween(c,u,` `,` `).split(` `).map(d=>a+d).join(` `);return l.replaceWith(c,u,r.schema.text(h)),!0})},"Shift-Tab":({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;const n=(e=this.options.tabSize)!=null?e:wO,{state:r}=t,{selection:i}=r,{$from:s,empty:o}=i;return s.parent.type!==this.type?!1:o?t.commands.command(({tr:a})=>{var l;const{pos:c}=s,u=s.start(),h=s.end(),d=r.doc.textBetween(u,h,` `,` `).split(` `);let p=0,f=0;const m=c-u;for(let T=0;T=m){p=T;break}f+=d[T].length+1}const g=((l=d[p].match(/^ */))==null?void 0:l[0])||"",y=Math.min(g.length,n);if(y===0)return!0;let b=u;for(let T=0;T{const{from:l,to:c}=i,u=r.doc.textBetween(l,c,` `,` `).split(` `).map(h=>{var d;const p=((d=h.match(/^ */))==null?void 0:d[0])||"",f=Math.min(p.length,n);return h.slice(f)}).join(` `);return a.replaceWith(l,c,r.schema.text(u)),!0})},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const s=r.parentOffset===r.parent.nodeSize-2,o=r.parent.textContent.endsWith(` `);return!s||!o?!1:t.chain().command(({tr:a})=>(a.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:r}=e,{$from:i,empty:s}=n;if(!s||i.parent.type!==this.type||i.parentOffset!==i.parent.nodeSize-2)return!1;const o=i.after();return o===void 0?!1:r.nodeAt(o)?t.commands.command(({tr:a})=>(a.setSelection(Te.near(r.resolve(o))),!0)):t.commands.exitCode()}}},addInputRules(){return[tu({find:Xle,type:this.type,getAttributes:t=>({language:t[1]})}),tu({find:qle,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new ze({key:new rt("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,s=i==null?void 0:i.mode;if(!n||!s)return!1;const{tr:o,schema:a}=t.state,l=a.text(n.replace(/\r\n?/g,` `));return o.replaceSelectionWith(this.type.create({language:s},l)),o.selection.$from.parent.type!==this.type&&o.setSelection(de.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.setMeta("paste",!0),t.dispatch(o),!0}}})]}}),Zle=X$,Wle=xt.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,` `):""}),Gle=xt.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",Be(this.options.HTMLAttributes,t)]},renderText(){return` `},renderMarkdown:()=>` `,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:i,storedMarks:s}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:a}=r.extensionManager,l=s||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:u})=>{if(u&&l&&o){const h=l.filter(d=>a.includes(d.type.name));c.ensureMarks(h)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Yle=xt.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,Be(this.options.HTMLAttributes,e),0]},parseMarkdown:(t,e)=>e.createNode("heading",{level:t.depth||1},e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>{var n;const r=(n=t.attrs)!=null&&n.level?parseInt(t.attrs.level,10):1,i="#".repeat(r);return t.content?`${i} ${e.renderChildren(t.content)}`:""},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>tu({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),Kle=xt.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",Be(this.options.HTMLAttributes,t)]},markdownTokenName:"hr",parseMarkdown:(t,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!oX(e,e.schema.nodes[this.name]))return!1;const{selection:n}=e,{$to:r}=n,i=t();return YN(n)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:s,tr:o,dispatch:a})=>{if(a){const{$to:l}=o.selection,c=l.end();if(l.nodeAfter)l.nodeAfter.isTextblock?o.setSelection(de.create(o.doc,l.pos+1)):l.nodeAfter.isBlock?o.setSelection(pe.create(o.doc,l.pos)):o.setSelection(de.create(o.doc,l.pos));else{const u=s.schema.nodes[this.options.nextNodeType]||l.parent.type.contentMatch.defaultType,h=u==null?void 0:u.create();h&&(o.insert(c,h),o.setSelection(de.create(o.doc,c+1)))}o.scrollIntoView()}return!0}).run()}}},addInputRules(){return[dR({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),Jle=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,ece=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,tce=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,nce=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,rce=Rr.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",Be(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(t,e)=>e.applyMark("italic",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`*${e.renderChildren(t)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[$o({find:Jle,type:this.type}),$o({find:tce,type:this.type})]},addPasteRules(){return[Hs({find:ece,type:this.type}),Hs({find:nce,type:this.type})]}});const ice="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",sce="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",Vb="numeric",Ub="ascii",Hb="alpha",Nc="asciinumeric",uc="alphanumeric",Xb="domain",q$="emoji",oce="scheme",ace="slashscheme",kO="whitespace";function lce(t,e){return t in e||(e[t]=[]),e[t]}function ko(t,e,n){e[Vb]&&(e[Nc]=!0,e[uc]=!0),e[Ub]&&(e[Nc]=!0,e[Hb]=!0),e[Nc]&&(e[uc]=!0),e[Hb]&&(e[uc]=!0),e[uc]&&(e[Xb]=!0),e[q$]&&(e[Xb]=!0);for(const r in e){const i=lce(r,n);i.indexOf(t)<0&&i.push(t)}}function cce(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function Mn(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}Mn.groups={};Mn.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let r=0;rt.ta(e,n,r,i),gt=(t,e,n,r,i)=>t.tr(e,n,r,i),BC=(t,e,n,r,i)=>t.ts(e,n,r,i),G=(t,e,n,r,i)=>t.tt(e,n,r,i),Di="WORD",qb="UWORD",Z$="ASCIINUMERICAL",W$="ALPHANUMERICAL",wu="LOCALHOST",Zb="TLD",Wb="UTLD",Hd="SCHEME",Ta="SLASH_SCHEME",FT="NUM",Gb="WS",BT="NL",Rc="OPENBRACE",Mc="CLOSEBRACE",$p="OPENBRACKET",Fp="CLOSEBRACKET",Bp="OPENPAREN",jp="CLOSEPAREN",zp="OPENANGLEBRACKET",Vp="CLOSEANGLEBRACKET",Up="FULLWIDTHLEFTPAREN",Hp="FULLWIDTHRIGHTPAREN",Xp="LEFTCORNERBRACKET",qp="RIGHTCORNERBRACKET",Zp="LEFTWHITECORNERBRACKET",Wp="RIGHTWHITECORNERBRACKET",Gp="FULLWIDTHLESSTHAN",Yp="FULLWIDTHGREATERTHAN",Kp="AMPERSAND",Jp="APOSTROPHE",ef="ASTERISK",Ts="AT",tf="BACKSLASH",nf="BACKTICK",rf="CARET",_s="COLON",jT="COMMA",sf="DOLLAR",Wr="DOT",of="EQUALS",zT="EXCLAMATION",nr="HYPHEN",Ic="PERCENT",af="PIPE",lf="PLUS",cf="POUND",Lc="QUERY",VT="QUOTE",G$="FULLWIDTHMIDDLEDOT",UT="SEMI",Gr="SLASH",Qc="TILDE",uf="UNDERSCORE",Y$="EMOJI",hf="SYM";var K$=Object.freeze({__proto__:null,ALPHANUMERICAL:W$,AMPERSAND:Kp,APOSTROPHE:Jp,ASCIINUMERICAL:Z$,ASTERISK:ef,AT:Ts,BACKSLASH:tf,BACKTICK:nf,CARET:rf,CLOSEANGLEBRACKET:Vp,CLOSEBRACE:Mc,CLOSEBRACKET:Fp,CLOSEPAREN:jp,COLON:_s,COMMA:jT,DOLLAR:sf,DOT:Wr,EMOJI:Y$,EQUALS:of,EXCLAMATION:zT,FULLWIDTHGREATERTHAN:Yp,FULLWIDTHLEFTPAREN:Up,FULLWIDTHLESSTHAN:Gp,FULLWIDTHMIDDLEDOT:G$,FULLWIDTHRIGHTPAREN:Hp,HYPHEN:nr,LEFTCORNERBRACKET:Xp,LEFTWHITECORNERBRACKET:Zp,LOCALHOST:wu,NL:BT,NUM:FT,OPENANGLEBRACKET:zp,OPENBRACE:Rc,OPENBRACKET:$p,OPENPAREN:Bp,PERCENT:Ic,PIPE:af,PLUS:lf,POUND:cf,QUERY:Lc,QUOTE:VT,RIGHTCORNERBRACKET:qp,RIGHTWHITECORNERBRACKET:Wp,SCHEME:Hd,SEMI:UT,SLASH:Gr,SLASH_SCHEME:Ta,SYM:hf,TILDE:Qc,TLD:Zb,UNDERSCORE:uf,UTLD:Wb,UWORD:qb,WORD:Di,WS:Gb});const ki=/[a-z]/,Xl=new RegExp("\\p{L}","u"),_O=new RegExp("\\p{Emoji}","u"),_i=/\d/,xO=/\s/,jC="\r",CO=` `,uce="️",hce="‍",DO="";let ld=null,cd=null;function dce(t=[]){const e={};Mn.groups=e;const n=new Mn;ld==null&&(ld=zC(ice)),cd==null&&(cd=zC(sce)),G(n,"'",Jp),G(n,"{",Rc),G(n,"}",Mc),G(n,"[",$p),G(n,"]",Fp),G(n,"(",Bp),G(n,")",jp),G(n,"<",zp),G(n,">",Vp),G(n,"(",Up),G(n,")",Hp),G(n,"「",Xp),G(n,"」",qp),G(n,"『",Zp),G(n,"』",Wp),G(n,"<",Gp),G(n,">",Yp),G(n,"&",Kp),G(n,"*",ef),G(n,"@",Ts),G(n,"`",nf),G(n,"^",rf),G(n,":",_s),G(n,",",jT),G(n,"$",sf),G(n,".",Wr),G(n,"=",of),G(n,"!",zT),G(n,"-",nr),G(n,"%",Ic),G(n,"|",af),G(n,"+",lf),G(n,"#",cf),G(n,"?",Lc),G(n,'"',VT),G(n,"/",Gr),G(n,";",UT),G(n,"~",Qc),G(n,"_",uf),G(n,"\\",tf),G(n,"・",G$);const r=gt(n,_i,FT,{[Vb]:!0});gt(r,_i,r);const i=gt(r,ki,Z$,{[Nc]:!0}),s=gt(r,Xl,W$,{[uc]:!0}),o=gt(n,ki,Di,{[Ub]:!0});gt(o,_i,i),gt(o,ki,o),gt(i,_i,i),gt(i,ki,i);const a=gt(n,Xl,qb,{[Hb]:!0});gt(a,ki),gt(a,_i,s),gt(a,Xl,a),gt(s,_i,s),gt(s,ki),gt(s,Xl,s);const l=G(n,CO,BT,{[kO]:!0}),c=G(n,jC,Gb,{[kO]:!0}),u=gt(n,xO,Gb,{[kO]:!0});G(n,DO,u),G(c,CO,l),G(c,DO,u),gt(c,xO,u),G(u,jC),G(u,CO),gt(u,xO,u),G(u,DO,u);const h=gt(n,_O,Y$,{[q$]:!0});G(h,"#"),gt(h,_O,h),G(h,uce,h);const d=G(h,hce);G(d,"#"),gt(d,_O,h);const p=[[ki,o],[_i,i]],f=[[ki,null],[Xl,a],[_i,s]];for(let m=0;mm[0]>g[0]?1:-1);for(let m=0;m=0?y[Xb]=!0:ki.test(g)?_i.test(g)?y[Nc]=!0:y[Ub]=!0:y[Vb]=!0,BC(n,g,g,y)}return BC(n,"localhost",wu,{ascii:!0}),n.jd=new Mn(hf),{start:n,tokens:Object.assign({groups:e},K$)}}function J$(t,e){const n=pce(e.replace(/[A-Z]/g,a=>a.toLowerCase())),r=n.length,i=[];let s=0,o=0;for(;o=0&&(h+=n[o].length,d++),c+=n[o].length,s+=n[o].length,o++;s-=h,o-=d,c-=h,i.push({t:u.t,v:e.slice(s-c,s),s:s-c,e:s})}return i}function pce(t){const e=[],n=t.length;let r=0;for(;r56319||r+1===n||(s=t.charCodeAt(r+1))<56320||s>57343?t[r]:t.slice(r,r+2);e.push(o),r+=o.length}return e}function ps(t,e,n,r,i){let s;const o=e.length;for(let a=0;a=0;)s++;if(s>0){e.push(n.join(""));for(let o=parseInt(t.substring(r,r+s),10);o>0;o--)n.pop();r+=s}else n.push(t[r]),r++}return e}const ku={defaultProtocol:"http",events:null,format:VC,formatHref:VC,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function HT(t,e=null){let n=Object.assign({},ku);t&&(n=Object.assign(n,t instanceof HT?t.o:t));const r=n.ignoreTags,i=[];for(let s=0;sn?r.substring(0,n)+"…":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=ku.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),i=t.get("tagName",n,e),s=this.toFormattedString(t),o={},a=t.get("className",n,e),l=t.get("target",n,e),c=t.get("rel",n,e),u=t.getObj("attributes",n,e),h=t.getObj("events",n,e);return o.href=r,a&&(o.class=a),l&&(o.target=l),c&&(o.rel=c),u&&Object.assign(o,u),{tagName:i,attributes:o,content:s,eventListeners:h}}};function Am(t,e){class n extends eF{constructor(i,s){super(i,s),this.t=t}}for(const r in e)n.prototype[r]=e[r];return n.t=t,n}const UC=Am("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),HC=Am("text"),fce=Am("nl"),ud=Am("url",{isLink:!0,toHref(t=ku.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==wu&&t[1].t===_s}}),er=t=>new Mn(t);function mce({groups:t}){const e=t.domain.concat([Kp,ef,Ts,tf,nf,rf,sf,of,nr,FT,Ic,af,lf,cf,Gr,hf,Qc,uf]),n=[Jp,_s,jT,Wr,zT,Ic,Lc,VT,UT,zp,Vp,Rc,Mc,Fp,$p,Bp,jp,Up,Hp,Xp,qp,Zp,Wp,Gp,Yp],r=[Kp,Jp,ef,tf,nf,rf,sf,of,nr,Rc,Mc,Ic,af,lf,cf,Lc,Gr,hf,Qc,uf],i=er(),s=G(i,Qc);Pe(s,r,s),Pe(s,t.domain,s);const o=er(),a=er(),l=er();Pe(i,t.domain,o),Pe(i,t.scheme,a),Pe(i,t.slashscheme,l),Pe(o,r,s),Pe(o,t.domain,o);const c=G(o,Ts);G(s,Ts,c),G(a,Ts,c),G(l,Ts,c);const u=G(s,Wr);Pe(u,r,s),Pe(u,t.domain,s);const h=er();Pe(c,t.domain,h),Pe(h,t.domain,h);const d=G(h,Wr);Pe(d,t.domain,h);const p=er(UC);Pe(d,t.tld,p),Pe(d,t.utld,p),G(c,wu,p);const f=G(h,nr);G(f,nr,f),Pe(f,t.domain,h),Pe(p,t.domain,h),G(p,Wr,d),G(p,nr,f);const m=G(p,_s);Pe(m,t.numeric,UC);const g=G(o,nr),y=G(o,Wr);G(g,nr,g),Pe(g,t.domain,o),Pe(y,r,s),Pe(y,t.domain,o);const b=er(ud);Pe(y,t.tld,b),Pe(y,t.utld,b),Pe(b,t.domain,o),Pe(b,r,s),G(b,Wr,y),G(b,nr,g),G(b,Ts,c);const T=G(b,_s),S=er(ud);Pe(T,t.numeric,S);const w=er(ud),A=er();Pe(w,e,w),Pe(w,n,A),Pe(A,e,w),Pe(A,n,A),G(b,Gr,w),G(S,Gr,w);const C=G(a,_s),N=G(l,_s),$=G(N,Gr),I=G($,Gr);Pe(a,t.domain,o),G(a,Wr,y),G(a,nr,g),Pe(l,t.domain,o),G(l,Wr,y),G(l,nr,g),Pe(C,t.domain,w),G(C,Gr,w),G(C,Lc,w),Pe(I,t.domain,w),Pe(I,e,w),G(I,Gr,w);const L=[[Rc,Mc],[$p,Fp],[Bp,jp],[zp,Vp],[Up,Hp],[Xp,qp],[Zp,Wp],[Gp,Yp]];for(let Z=0;Z=0&&d++,i++,u++;if(d<0)i-=u,i0&&(s.push(AO(HC,e,o)),o=[]),i-=d,u-=d;const p=h.t,f=n.slice(i-u,i);s.push(AO(p,e,f))}}return o.length>0&&s.push(AO(HC,e,o)),s}function AO(t,e,n){const r=n[0].s,i=n[n.length-1].e,s=e.slice(r,i);return new t(s,n)}const Oce=typeof console<"u"&&console&&console.warn||(()=>{}),yce="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",ut={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function bce(){return Mn.groups={},ut.scanner=null,ut.parser=null,ut.tokenQueue=[],ut.pluginQueue=[],ut.customSchemes=[],ut.initialized=!1,ut}function XC(t,e=!1){if(ut.initialized&&Oce(`linkifyjs: already initialized - will not register custom scheme "${t}" ${yce}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format. 1. Must only contain digits, lowercase ASCII letters or "-" 2. Cannot start or end with "-" 3. "-" cannot repeat`);ut.customSchemes.push([t,e])}function Ece(){ut.scanner=dce(ut.customSchemes);for(let t=0;t{const i=e.some(l=>l.docChanged)&&!n.doc.eq(r.doc),s=e.some(l=>l.getMeta("preventAutolink"));if(!i||s)return;const{tr:o}=r,a=zN(n.doc,[...e]);if(GN(a).forEach(({newRange:l})=>{const c=aH(r.doc,l,d=>d.isTextblock);let u,h;if(c.length>1)u=c[0],h=r.doc.textBetween(u.pos,u.pos+u.node.nodeSize,void 0," ");else if(c.length){const d=r.doc.textBetween(l.from,l.to," "," ");if(!Tce.test(d))return;u=c[0],h=r.doc.textBetween(u.pos,l.to,void 0," ")}if(u&&h){const d=h.split(vce).filter(Boolean);if(d.length<=0)return!1;const p=d[d.length-1],f=u.pos+h.lastIndexOf(p);if(!p)return!1;const m=XT(p).map(g=>g.toObject(t.defaultProtocol));if(!wce(m))return!1;m.filter(g=>g.isLink).map(g=>({...g,from:f+g.start+1,to:f+g.end+1})).filter(g=>r.schema.marks.code?!r.doc.rangeHasMark(g.from,g.to,r.schema.marks.code):!0).filter(g=>t.validate(g.value)).filter(g=>t.shouldAutoLink(g.value)).forEach(g=>{sv(g.from,g.to,r.doc).some(y=>y.mark.type===t.type)||o.addMark(g.from,g.to,t.type.create({href:g.href}))})}}),!!o.steps.length)return o}})}function _ce(t){return new ze({key:new rt("handleClickLink"),props:{handleClick:(e,n,r)=>{var i,s;if(r.button!==0||!e.editable)return!1;let o=null;if(r.target instanceof HTMLAnchorElement)o=r.target;else{let u=r.target;const h=[];for(;u.nodeName!=="DIV";)h.push(u),u=u.parentNode;o=h.find(d=>d.nodeName==="A")}if(!o)return!1;const a=WN(e.state,t.type.name),l=(i=o==null?void 0:o.href)!=null?i:a.href,c=(s=o==null?void 0:o.target)!=null?s:a.target;return t.enableClickSelection&&t.editor.commands.extendMarkRange(t.type.name),o&&l?(window.open(l,c),!0):!1}}})}function xce(t){return new ze({key:new rt("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{shouldAutoLink:i}=t,{state:s}=e,{selection:o}=s,{empty:a}=o;if(a)return!1;let l="";r.content.forEach(u=>{l+=u.textContent});const c=tF(l,{defaultProtocol:t.defaultProtocol}).find(u=>u.isLink&&u.value===l);return!l||!c||i!==void 0&&!i(c.href)?!1:t.editor.commands.setMark(t.type,{href:c.href})}}})}function go(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const i=typeof r=="string"?r:r.scheme;i&&n.push(i)}),!t||t.replace(Sce,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var nF=Rr.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){XC(t);return}XC(t.scheme,t.optionalSlashes)})},onDestroy(){bce()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!go(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>!!t}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:n=>!!go(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!go(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",Be(this.options.HTMLAttributes,t),0]:["a",Be(this.options.HTMLAttributes,{...t,href:""}),0]},markdownTokenName:"link",parseMarkdown:(t,e)=>e.applyMark("link",e.parseInline(t.tokens||[]),{href:t.href,title:t.title||null}),renderMarkdown:(t,e)=>{var n;const r=((n=t.attrs)==null?void 0:n.href)||"";return`[${e.renderChildren(t)}](${r})`},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!go(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{const{href:n}=t||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:r=>!!go(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[Hs({find:t=>{const e=[];if(t){const{protocols:n,defaultProtocol:r}=this.options,i=tF(t).filter(s=>s.isLink&&this.options.isAllowedUri(s.value,{defaultValidate:o=>!!go(o,n),protocols:n,defaultProtocol:r}));i.length&&i.forEach(s=>{this.options.shouldAutoLink(s.value)&&e.push({text:s.value,data:{href:s.href},index:s.start})})}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)==null?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push(kce({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:i=>!!go(i,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&t.push(_ce({type:this.type,editor:this.editor,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push(xce({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),t}}),Cce=xt.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",Be(this.options.HTMLAttributes,t),0]},parseMarkdown:(t,e)=>{const n=t.tokens||[];return n.length===1&&n[0].type==="image"?e.parseChildren([n[0]]):e.createNode("paragraph",void 0,e.parseInline(n))},renderMarkdown:(t,e)=>!t||!Array.isArray(t.content)?"":e.renderChildren(t.content),addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Dce=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,Ace=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,Pce=Rr.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",Be(this.options.HTMLAttributes,t),0]},markdownTokenName:"del",parseMarkdown:(t,e)=>e.applyMark("strike",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`~~${e.renderChildren(t)}~~`,addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[$o({find:Dce,type:this.type})]},addPasteRules(){return[Hs({find:Ace,type:this.type})]}}),Nce=xt.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),Rce=Ve.create({name:"starterKit",addExtensions(){var t,e,n,r;const i=[];return this.options.bold!==!1&&i.push(zle.configure(this.options.bold)),this.options.blockquote!==!1&&i.push(Qle.configure(this.options.blockquote)),this.options.bulletList!==!1&&i.push(C$.configure(this.options.bulletList)),this.options.code!==!1&&i.push(Hle.configure(this.options.code)),this.options.codeBlock!==!1&&i.push(X$.configure(this.options.codeBlock)),this.options.document!==!1&&i.push(Wle.configure(this.options.document)),this.options.dropcursor!==!1&&i.push(ble.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&i.push(Ele.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&i.push(Gle.configure(this.options.hardBreak)),this.options.heading!==!1&&i.push(Yle.configure(this.options.heading)),this.options.undoRedo!==!1&&i.push(Sle.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&i.push(Kle.configure(this.options.horizontalRule)),this.options.italic!==!1&&i.push(rce.configure(this.options.italic)),this.options.listItem!==!1&&i.push(D$.configure(this.options.listItem)),this.options.listKeymap!==!1&&i.push(QT.configure((t=this.options)==null?void 0:t.listKeymap)),this.options.link!==!1&&i.push(nF.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&i.push(L$.configure(this.options.orderedList)),this.options.paragraph!==!1&&i.push(Cce.configure(this.options.paragraph)),this.options.strike!==!1&&i.push(Pce.configure(this.options.strike)),this.options.text!==!1&&i.push(Nce.configure(this.options.text)),this.options.underline!==!1&&i.push(H$.configure((n=this.options)==null?void 0:n.underline)),this.options.trailingNode!==!1&&i.push(Tle.configure((r=this.options)==null?void 0:r.trailingNode)),i}}),PO,qC;function Mce(){if(qC)return PO;qC=1;function t(P){return P instanceof Map?P.clear=P.delete=P.set=function(){throw new Error("map is read-only")}:P instanceof Set&&(P.add=P.clear=P.delete=function(){throw new Error("set is read-only")}),Object.freeze(P),Object.getOwnPropertyNames(P).forEach(H=>{const ie=P[H],xe=typeof ie;(xe==="object"||xe==="function")&&!Object.isFrozen(ie)&&t(ie)}),P}class e{constructor(H){H.data===void 0&&(H.data={}),this.data=H.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function n(P){return P.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function r(P,...H){const ie=Object.create(null);for(const xe in P)ie[xe]=P[xe];return H.forEach(function(xe){for(const Tt in xe)ie[Tt]=xe[Tt]}),ie}const i="",s=P=>!!P.scope,o=(P,{prefix:H})=>{if(P.startsWith("language:"))return P.replace("language:","language-");if(P.includes(".")){const ie=P.split(".");return[`${H}${ie.shift()}`,...ie.map((xe,Tt)=>`${xe}${"_".repeat(Tt+1)}`)].join(" ")}return`${H}${P}`};class a{constructor(H,ie){this.buffer="",this.classPrefix=ie.classPrefix,H.walk(this)}addText(H){this.buffer+=n(H)}openNode(H){if(!s(H))return;const ie=o(H.scope,{prefix:this.classPrefix});this.span(ie)}closeNode(H){s(H)&&(this.buffer+=i)}value(){return this.buffer}span(H){this.buffer+=``}}const l=(P={})=>{const H={children:[]};return Object.assign(H,P),H};class c{constructor(){this.rootNode=l(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(H){this.top.children.push(H)}openNode(H){const ie=l({scope:H});this.add(ie),this.stack.push(ie)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(H){return this.constructor._walk(H,this.rootNode)}static _walk(H,ie){return typeof ie=="string"?H.addText(ie):ie.children&&(H.openNode(ie),ie.children.forEach(xe=>this._walk(H,xe)),H.closeNode(ie)),H}static _collapse(H){typeof H!="string"&&H.children&&(H.children.every(ie=>typeof ie=="string")?H.children=[H.children.join("")]:H.children.forEach(ie=>{c._collapse(ie)}))}}class u extends c{constructor(H){super(),this.options=H}addText(H){H!==""&&this.add(H)}startScope(H){this.openNode(H)}endScope(){this.closeNode()}__addSublanguage(H,ie){const xe=H.root;ie&&(xe.scope=`language:${ie}`),this.add(xe)}toHTML(){return new a(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function h(P){return P?typeof P=="string"?P:P.source:null}function d(P){return m("(?=",P,")")}function p(P){return m("(?:",P,")*")}function f(P){return m("(?:",P,")?")}function m(...P){return P.map(H=>h(H)).join("")}function g(P){const H=P[P.length-1];return typeof H=="object"&&H.constructor===Object?(P.splice(P.length-1,1),H):{}}function y(...P){return"("+(g(P).capture?"":"?:")+P.map(H=>h(H)).join("|")+")"}function b(P){return new RegExp(P.toString()+"|").exec("").length-1}function T(P,H){const ie=P&&P.exec(H);return ie&&ie.index===0}const S=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function w(P,{joinWith:H}){let ie=0;return P.map(xe=>{ie+=1;const Tt=ie;let St=h(xe),ue="";for(;St.length>0;){const oe=S.exec(St);if(!oe){ue+=St;break}ue+=St.substring(0,oe.index),St=St.substring(oe.index+oe[0].length),oe[0][0]==="\\"&&oe[1]?ue+="\\"+String(Number(oe[1])+Tt):(ue+=oe[0],oe[0]==="("&&ie++)}return ue}).map(xe=>`(${xe})`).join(H)}const A=/\b\B/,C="[a-zA-Z]\\w*",N="[a-zA-Z_]\\w*",$="\\b\\d+(\\.\\d+)?",I="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",L="\\b(0b[01]+)",Z="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",B=(P={})=>{const H=/^#![ ]*\//;return P.binary&&(P.begin=m(H,/.*\b/,P.binary,/\b.*/)),r({scope:"meta",begin:H,end:/$/,relevance:0,"on:begin":(ie,xe)=>{ie.index!==0&&xe.ignoreMatch()}},P)},j={begin:"\\\\[\\s\\S]",relevance:0},U={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[j]},J={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[j]},fe={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},z=function(P,H,ie={}){const xe=r({scope:"comment",begin:P,end:H,contains:[]},ie);xe.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const Tt=y("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return xe.contains.push({begin:m(/[ ]+/,"(",Tt,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),xe},ne=z("//","$"),Oe=z("/\\*","\\*/"),He=z("#","$"),it={scope:"number",begin:$,relevance:0},Le={scope:"number",begin:I,relevance:0},Xe={scope:"number",begin:L,relevance:0},vt={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[j,{begin:/\[/,end:/\]/,relevance:0,contains:[j]}]},An={scope:"title",begin:C,relevance:0},Ge={scope:"title",begin:N,relevance:0},Qr={begin:"\\.\\s*"+N,relevance:0};var mt=Object.freeze({__proto__:null,APOS_STRING_MODE:U,BACKSLASH_ESCAPE:j,BINARY_NUMBER_MODE:Xe,BINARY_NUMBER_RE:L,COMMENT:z,C_BLOCK_COMMENT_MODE:Oe,C_LINE_COMMENT_MODE:ne,C_NUMBER_MODE:Le,C_NUMBER_RE:I,END_SAME_AS_BEGIN:function(P){return Object.assign(P,{"on:begin":(H,ie)=>{ie.data._beginMatch=H[1]},"on:end":(H,ie)=>{ie.data._beginMatch!==H[1]&&ie.ignoreMatch()}})},HASH_COMMENT_MODE:He,IDENT_RE:C,MATCH_NOTHING_RE:A,METHOD_GUARD:Qr,NUMBER_MODE:it,NUMBER_RE:$,PHRASAL_WORDS_MODE:fe,QUOTE_STRING_MODE:J,REGEXP_MODE:vt,RE_STARTERS_RE:Z,SHEBANG:B,TITLE_MODE:An,UNDERSCORE_IDENT_RE:N,UNDERSCORE_TITLE_MODE:Ge});function Jn(P,H){P.input[P.index-1]==="."&&H.ignoreMatch()}function ls(P,H){P.className!==void 0&&(P.scope=P.className,delete P.className)}function bi(P,H){H&&P.beginKeywords&&(P.begin="\\b("+P.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",P.__beforeBegin=Jn,P.keywords=P.keywords||P.beginKeywords,delete P.beginKeywords,P.relevance===void 0&&(P.relevance=0))}function so(P,H){Array.isArray(P.illegal)&&(P.illegal=y(...P.illegal))}function Vm(P,H){if(P.match){if(P.begin||P.end)throw new Error("begin & end are not supported with match");P.begin=P.match,delete P.match}}function Um(P,H){P.relevance===void 0&&(P.relevance=1)}const Hm=(P,H)=>{if(!P.beforeMatch)return;if(P.starts)throw new Error("beforeMatch cannot be used with starts");const ie=Object.assign({},P);Object.keys(P).forEach(xe=>{delete P[xe]}),P.keywords=ie.keywords,P.begin=m(ie.beforeMatch,d(ie.begin)),P.starts={relevance:0,contains:[Object.assign(ie,{endsParent:!0})]},P.relevance=0,delete ie.beforeMatch},Xm=["of","and","for","in","not","or","if","then","parent","list","value"],qm="keyword";function oo(P,H,ie=qm){const xe=Object.create(null);return typeof P=="string"?Tt(ie,P.split(" ")):Array.isArray(P)?Tt(ie,P):Object.keys(P).forEach(function(St){Object.assign(xe,oo(P[St],H,St))}),xe;function Tt(St,ue){H&&(ue=ue.map(oe=>oe.toLowerCase())),ue.forEach(function(oe){const we=oe.split("|");xe[we[0]]=[St,$B(we[0],we[1])]})}}function $B(P,H){return H?Number(H):FB(P)?0:1}function FB(P){return Xm.includes(P.toLowerCase())}const pS={},ao=P=>{console.error(P)},fS=(P,...H)=>{console.log(`WARN: ${P}`,...H)},sa=(P,H)=>{pS[`${P}/${H}`]||(console.log(`Deprecated as of ${P}. ${H}`),pS[`${P}/${H}`]=!0)},hh=new Error;function mS(P,H,{key:ie}){let xe=0;const Tt=P[ie],St={},ue={};for(let oe=1;oe<=H.length;oe++)ue[oe+xe]=Tt[oe],St[oe+xe]=!0,xe+=b(H[oe-1]);P[ie]=ue,P[ie]._emit=St,P[ie]._multi=!0}function BB(P){if(Array.isArray(P.begin)){if(P.skip||P.excludeBegin||P.returnBegin)throw ao("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),hh;if(typeof P.beginScope!="object"||P.beginScope===null)throw ao("beginScope must be object"),hh;mS(P,P.begin,{key:"beginScope"}),P.begin=w(P.begin,{joinWith:""})}}function jB(P){if(Array.isArray(P.end)){if(P.skip||P.excludeEnd||P.returnEnd)throw ao("skip, excludeEnd, returnEnd not compatible with endScope: {}"),hh;if(typeof P.endScope!="object"||P.endScope===null)throw ao("endScope must be object"),hh;mS(P,P.end,{key:"endScope"}),P.end=w(P.end,{joinWith:""})}}function zB(P){P.scope&&typeof P.scope=="object"&&P.scope!==null&&(P.beginScope=P.scope,delete P.scope)}function VB(P){zB(P),typeof P.beginScope=="string"&&(P.beginScope={_wrap:P.beginScope}),typeof P.endScope=="string"&&(P.endScope={_wrap:P.endScope}),BB(P),jB(P)}function UB(P){function H(ue,oe){return new RegExp(h(ue),"m"+(P.case_insensitive?"i":"")+(P.unicodeRegex?"u":"")+(oe?"g":""))}class ie{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(oe,we){we.position=this.position++,this.matchIndexes[this.matchAt]=we,this.regexes.push([we,oe]),this.matchAt+=b(oe)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const oe=this.regexes.map(we=>we[1]);this.matcherRe=H(w(oe,{joinWith:"|"}),!0),this.lastIndex=0}exec(oe){this.matcherRe.lastIndex=this.lastIndex;const we=this.matcherRe.exec(oe);if(!we)return null;const jt=we.findIndex((Nl,Wm)=>Wm>0&&Nl!==void 0),Ct=this.matchIndexes[jt];return we.splice(0,jt),Object.assign(we,Ct)}}class xe{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(oe){if(this.multiRegexes[oe])return this.multiRegexes[oe];const we=new ie;return this.rules.slice(oe).forEach(([jt,Ct])=>we.addRule(jt,Ct)),we.compile(),this.multiRegexes[oe]=we,we}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(oe,we){this.rules.push([oe,we]),we.type==="begin"&&this.count++}exec(oe){const we=this.getMatcher(this.regexIndex);we.lastIndex=this.lastIndex;let jt=we.exec(oe);if(this.resumingScanAtSamePosition()&&!(jt&&jt.index===this.lastIndex)){const Ct=this.getMatcher(0);Ct.lastIndex=this.lastIndex+1,jt=Ct.exec(oe)}return jt&&(this.regexIndex+=jt.position+1,this.regexIndex===this.count&&this.considerAll()),jt}}function Tt(ue){const oe=new xe;return ue.contains.forEach(we=>oe.addRule(we.begin,{rule:we,type:"begin"})),ue.terminatorEnd&&oe.addRule(ue.terminatorEnd,{type:"end"}),ue.illegal&&oe.addRule(ue.illegal,{type:"illegal"}),oe}function St(ue,oe){const we=ue;if(ue.isCompiled)return we;[ls,Vm,VB,Hm].forEach(Ct=>Ct(ue,oe)),P.compilerExtensions.forEach(Ct=>Ct(ue,oe)),ue.__beforeBegin=null,[bi,so,Um].forEach(Ct=>Ct(ue,oe)),ue.isCompiled=!0;let jt=null;return typeof ue.keywords=="object"&&ue.keywords.$pattern&&(ue.keywords=Object.assign({},ue.keywords),jt=ue.keywords.$pattern,delete ue.keywords.$pattern),jt=jt||/\w+/,ue.keywords&&(ue.keywords=oo(ue.keywords,P.case_insensitive)),we.keywordPatternRe=H(jt,!0),oe&&(ue.begin||(ue.begin=/\B|\b/),we.beginRe=H(we.begin),!ue.end&&!ue.endsWithParent&&(ue.end=/\B|\b/),ue.end&&(we.endRe=H(we.end)),we.terminatorEnd=h(we.end)||"",ue.endsWithParent&&oe.terminatorEnd&&(we.terminatorEnd+=(ue.end?"|":"")+oe.terminatorEnd)),ue.illegal&&(we.illegalRe=H(ue.illegal)),ue.contains||(ue.contains=[]),ue.contains=[].concat(...ue.contains.map(function(Ct){return HB(Ct==="self"?ue:Ct)})),ue.contains.forEach(function(Ct){St(Ct,we)}),ue.starts&&St(ue.starts,oe),we.matcher=Tt(we),we}if(P.compilerExtensions||(P.compilerExtensions=[]),P.contains&&P.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return P.classNameAliases=r(P.classNameAliases||{}),St(P)}function gS(P){return P?P.endsWithParent||gS(P.starts):!1}function HB(P){return P.variants&&!P.cachedVariants&&(P.cachedVariants=P.variants.map(function(H){return r(P,{variants:null},H)})),P.cachedVariants?P.cachedVariants:gS(P)?r(P,{starts:P.starts?r(P.starts):null}):Object.isFrozen(P)?r(P):P}var XB="11.11.1";class qB extends Error{constructor(H,ie){super(H),this.name="HTMLInjectionError",this.html=ie}}const Zm=n,OS=r,yS=Symbol("nomatch"),ZB=7,bS=function(P){const H=Object.create(null),ie=Object.create(null),xe=[];let Tt=!0;const St="Could not find the language '{}', did you forget to load/include a language module?",ue={disableAutodetect:!0,name:"Plain text",contains:[]};let oe={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:u};function we(K){return oe.noHighlightRe.test(K)}function jt(K){let ye=K.className+" ";ye+=K.parentNode?K.parentNode.className:"";const Ie=oe.languageDetectRe.exec(ye);if(Ie){const st=cs(Ie[1]);return st||(fS(St.replace("{}",Ie[1])),fS("Falling back to no-highlight mode for this block.",K)),st?Ie[1]:"no-highlight"}return ye.split(/\s+/).find(st=>we(st)||cs(st))}function Ct(K,ye,Ie){let st="",Mt="";typeof ye=="object"?(st=K,Ie=ye.ignoreIllegals,Mt=ye.language):(sa("10.7.0","highlight(lang, code, ...args) has been deprecated."),sa("10.7.0",`Please use highlight(code, options) instead. https://github.com/highlightjs/highlight.js/issues/2277`),Mt=K,st=ye),Ie===void 0&&(Ie=!0);const $r={code:st,language:Mt};ph("before:highlight",$r);const us=$r.result?$r.result:Nl($r.language,$r.code,Ie);return us.code=$r.code,ph("after:highlight",us),us}function Nl(K,ye,Ie,st){const Mt=Object.create(null);function $r(re,me){return re.keywords[me]}function us(){if(!ke.keywords){Yt.addText(ot);return}let re=0;ke.keywordPatternRe.lastIndex=0;let me=ke.keywordPatternRe.exec(ot),Re="";for(;me;){Re+=ot.substring(re,me.index);const Ke=Br.case_insensitive?me[0].toLowerCase():me[0],ln=$r(ke,Ke);if(ln){const[Ei,h3]=ln;if(Yt.addText(Re),Re="",Mt[Ke]=(Mt[Ke]||0)+1,Mt[Ke]<=ZB&&(gh+=h3),Ei.startsWith("_"))Re+=me[0];else{const d3=Br.classNameAliases[Ei]||Ei;Fr(me[0],d3)}}else Re+=me[0];re=ke.keywordPatternRe.lastIndex,me=ke.keywordPatternRe.exec(ot)}Re+=ot.substring(re),Yt.addText(Re)}function fh(){if(ot==="")return;let re=null;if(typeof ke.subLanguage=="string"){if(!H[ke.subLanguage]){Yt.addText(ot);return}re=Nl(ke.subLanguage,ot,!0,xS[ke.subLanguage]),xS[ke.subLanguage]=re._top}else re=Gm(ot,ke.subLanguage.length?ke.subLanguage:null);ke.relevance>0&&(gh+=re.relevance),Yt.__addSublanguage(re._emitter,re.language)}function jn(){ke.subLanguage!=null?fh():us(),ot=""}function Fr(re,me){re!==""&&(Yt.startScope(me),Yt.addText(re),Yt.endScope())}function SS(re,me){let Re=1;const Ke=me.length-1;for(;Re<=Ke;){if(!re._emit[Re]){Re++;continue}const ln=Br.classNameAliases[re[Re]]||re[Re],Ei=me[Re];ln?Fr(Ei,ln):(ot=Ei,us(),ot=""),Re++}}function wS(re,me){return re.scope&&typeof re.scope=="string"&&Yt.openNode(Br.classNameAliases[re.scope]||re.scope),re.beginScope&&(re.beginScope._wrap?(Fr(ot,Br.classNameAliases[re.beginScope._wrap]||re.beginScope._wrap),ot=""):re.beginScope._multi&&(SS(re.beginScope,me),ot="")),ke=Object.create(re,{parent:{value:ke}}),ke}function kS(re,me,Re){let Ke=T(re.endRe,Re);if(Ke){if(re["on:end"]){const ln=new e(re);re["on:end"](me,ln),ln.isMatchIgnored&&(Ke=!1)}if(Ke){for(;re.endsParent&&re.parent;)re=re.parent;return re}}if(re.endsWithParent)return kS(re.parent,me,Re)}function o3(re){return ke.matcher.regexIndex===0?(ot+=re[0],1):(eg=!0,0)}function a3(re){const me=re[0],Re=re.rule,Ke=new e(Re),ln=[Re.__beforeBegin,Re["on:begin"]];for(const Ei of ln)if(Ei&&(Ei(re,Ke),Ke.isMatchIgnored))return o3(me);return Re.skip?ot+=me:(Re.excludeBegin&&(ot+=me),jn(),!Re.returnBegin&&!Re.excludeBegin&&(ot=me)),wS(Re,re),Re.returnBegin?0:me.length}function l3(re){const me=re[0],Re=ye.substring(re.index),Ke=kS(ke,re,Re);if(!Ke)return yS;const ln=ke;ke.endScope&&ke.endScope._wrap?(jn(),Fr(me,ke.endScope._wrap)):ke.endScope&&ke.endScope._multi?(jn(),SS(ke.endScope,re)):ln.skip?ot+=me:(ln.returnEnd||ln.excludeEnd||(ot+=me),jn(),ln.excludeEnd&&(ot=me));do ke.scope&&Yt.closeNode(),!ke.skip&&!ke.subLanguage&&(gh+=ke.relevance),ke=ke.parent;while(ke!==Ke.parent);return Ke.starts&&wS(Ke.starts,re),ln.returnEnd?0:me.length}function c3(){const re=[];for(let me=ke;me!==Br;me=me.parent)me.scope&&re.unshift(me.scope);re.forEach(me=>Yt.openNode(me))}let mh={};function _S(re,me){const Re=me&&me[0];if(ot+=re,Re==null)return jn(),0;if(mh.type==="begin"&&me.type==="end"&&mh.index===me.index&&Re===""){if(ot+=ye.slice(me.index,me.index+1),!Tt){const Ke=new Error(`0 width match regex (${K})`);throw Ke.languageName=K,Ke.badRule=mh.rule,Ke}return 1}if(mh=me,me.type==="begin")return a3(me);if(me.type==="illegal"&&!Ie){const Ke=new Error('Illegal lexeme "'+Re+'" for mode "'+(ke.scope||"")+'"');throw Ke.mode=ke,Ke}else if(me.type==="end"){const Ke=l3(me);if(Ke!==yS)return Ke}if(me.type==="illegal"&&Re==="")return ot+=` `,1;if(Jm>1e5&&Jm>me.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ot+=Re,Re.length}const Br=cs(K);if(!Br)throw ao(St.replace("{}",K)),new Error('Unknown language: "'+K+'"');const u3=UB(Br);let Km="",ke=st||u3;const xS={},Yt=new oe.__emitter(oe);c3();let ot="",gh=0,lo=0,Jm=0,eg=!1;try{if(Br.__emitTokens)Br.__emitTokens(ye,Yt);else{for(ke.matcher.considerAll();;){Jm++,eg?eg=!1:ke.matcher.considerAll(),ke.matcher.lastIndex=lo;const re=ke.matcher.exec(ye);if(!re)break;const me=ye.substring(lo,re.index),Re=_S(me,re);lo=re.index+Re}_S(ye.substring(lo))}return Yt.finalize(),Km=Yt.toHTML(),{language:K,value:Km,relevance:gh,illegal:!1,_emitter:Yt,_top:ke}}catch(re){if(re.message&&re.message.includes("Illegal"))return{language:K,value:Zm(ye),illegal:!0,relevance:0,_illegalBy:{message:re.message,index:lo,context:ye.slice(lo-100,lo+100),mode:re.mode,resultSoFar:Km},_emitter:Yt};if(Tt)return{language:K,value:Zm(ye),illegal:!1,relevance:0,errorRaised:re,_emitter:Yt,_top:ke};throw re}}function Wm(K){const ye={value:Zm(K),illegal:!1,relevance:0,_top:ue,_emitter:new oe.__emitter(oe)};return ye._emitter.addText(K),ye}function Gm(K,ye){ye=ye||oe.languages||Object.keys(H);const Ie=Wm(K),st=ye.filter(cs).filter(TS).map(jn=>Nl(jn,K,!1));st.unshift(Ie);const Mt=st.sort((jn,Fr)=>{if(jn.relevance!==Fr.relevance)return Fr.relevance-jn.relevance;if(jn.language&&Fr.language){if(cs(jn.language).supersetOf===Fr.language)return 1;if(cs(Fr.language).supersetOf===jn.language)return-1}return 0}),[$r,us]=Mt,fh=$r;return fh.secondBest=us,fh}function WB(K,ye,Ie){const st=ye&&ie[ye]||Ie;K.classList.add("hljs"),K.classList.add(`language-${st}`)}function Ym(K){let ye=null;const Ie=jt(K);if(we(Ie))return;if(ph("before:highlightElement",{el:K,language:Ie}),K.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",K);return}if(K.children.length>0&&(oe.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(K)),oe.throwUnescapedHTML))throw new qB("One of your code blocks includes unescaped HTML.",K.innerHTML);ye=K;const st=ye.textContent,Mt=Ie?Ct(st,{language:Ie,ignoreIllegals:!0}):Gm(st);K.innerHTML=Mt.value,K.dataset.highlighted="yes",WB(K,Ie,Mt.language),K.result={language:Mt.language,re:Mt.relevance,relevance:Mt.relevance},Mt.secondBest&&(K.secondBest={language:Mt.secondBest.language,relevance:Mt.secondBest.relevance}),ph("after:highlightElement",{el:K,result:Mt,text:st})}function GB(K){oe=OS(oe,K)}const YB=()=>{dh(),sa("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function KB(){dh(),sa("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let ES=!1;function dh(){function K(){dh()}if(document.readyState==="loading"){ES||window.addEventListener("DOMContentLoaded",K,!1),ES=!0;return}document.querySelectorAll(oe.cssSelector).forEach(Ym)}function JB(K,ye){let Ie=null;try{Ie=ye(P)}catch(st){if(ao("Language definition for '{}' could not be registered.".replace("{}",K)),Tt)ao(st);else throw st;Ie=ue}Ie.name||(Ie.name=K),H[K]=Ie,Ie.rawDefinition=ye.bind(null,P),Ie.aliases&&vS(Ie.aliases,{languageName:K})}function e3(K){delete H[K];for(const ye of Object.keys(ie))ie[ye]===K&&delete ie[ye]}function t3(){return Object.keys(H)}function cs(K){return K=(K||"").toLowerCase(),H[K]||H[ie[K]]}function vS(K,{languageName:ye}){typeof K=="string"&&(K=[K]),K.forEach(Ie=>{ie[Ie.toLowerCase()]=ye})}function TS(K){const ye=cs(K);return ye&&!ye.disableAutodetect}function n3(K){K["before:highlightBlock"]&&!K["before:highlightElement"]&&(K["before:highlightElement"]=ye=>{K["before:highlightBlock"](Object.assign({block:ye.el},ye))}),K["after:highlightBlock"]&&!K["after:highlightElement"]&&(K["after:highlightElement"]=ye=>{K["after:highlightBlock"](Object.assign({block:ye.el},ye))})}function r3(K){n3(K),xe.push(K)}function i3(K){const ye=xe.indexOf(K);ye!==-1&&xe.splice(ye,1)}function ph(K,ye){const Ie=K;xe.forEach(function(st){st[Ie]&&st[Ie](ye)})}function s3(K){return sa("10.7.0","highlightBlock will be removed entirely in v12.0"),sa("10.7.0","Please use highlightElement now."),Ym(K)}Object.assign(P,{highlight:Ct,highlightAuto:Gm,highlightAll:dh,highlightElement:Ym,highlightBlock:s3,configure:GB,initHighlighting:YB,initHighlightingOnLoad:KB,registerLanguage:JB,unregisterLanguage:e3,listLanguages:t3,getLanguage:cs,registerAliases:vS,autoDetection:TS,inherit:OS,addPlugin:r3,removePlugin:i3}),P.debugMode=function(){Tt=!1},P.safeMode=function(){Tt=!0},P.versionString=XB,P.regex={concat:m,lookahead:d,either:y,optional:f,anyNumberOfTimes:p};for(const K in mt)typeof mt[K]=="object"&&t(mt[K]);return Object.assign(P,mt),P},oa=bS({});return oa.newInstance=()=>bS({}),PO=oa,oa.HighlightJS=oa,oa.default=oa,PO}var Ice=Mce();const ZT=$f(Ice);function rF(t,e=[]){return t.flatMap(n=>{const r=[...e,...n.properties?n.properties.className:[]];return n.children?rF(n.children,r):{text:n.value,classes:r}})}function ZC(t){return t.value||t.children||[]}function Lce(t){return!!ZT.getLanguage(t)}function WC({doc:t,name:e,lowlight:n,defaultLanguage:r}){const i=[];return As(t,s=>s.type.name===e).forEach(s=>{var o;let a=s.pos+1;const l=s.node.attrs.language||r,c=n.listLanguages(),u=l&&(c.includes(l)||Lce(l)||(o=n.registered)!=null&&o.call(n,l))?ZC(n.highlight(l,s.node.textContent)):ZC(n.highlightAuto(s.node.textContent));rF(u).forEach(h=>{const d=a+h.text.length;if(h.classes.length){const p=sn.inline(a,d,{class:h.classes.join(" ")});i.push(p)}a=d})}),je.create(t,i)}function Qce(t){return typeof t=="function"}function $ce({name:t,lowlight:e,defaultLanguage:n}){if(!["highlight","highlightAuto","listLanguages"].every(i=>Qce(e[i])))throw Error("You should provide an instance of lowlight to use the code-block-lowlight extension");const r=new ze({key:new rt("lowlight"),state:{init:(i,{doc:s})=>WC({doc:s,name:t,lowlight:e,defaultLanguage:n}),apply:(i,s,o,a)=>{const l=o.selection.$head.parent.type.name,c=a.selection.$head.parent.type.name,u=As(o.doc,d=>d.type.name===t),h=As(a.doc,d=>d.type.name===t);return i.docChanged&&([l,c].includes(t)||h.length!==u.length||i.steps.some(d=>d.from!==void 0&&d.to!==void 0&&u.some(p=>p.pos>=d.from&&p.pos+p.node.nodeSize<=d.to)))?WC({doc:i.doc,name:t,lowlight:e,defaultLanguage:n}):s.map(i.mapping,i.doc)}},props:{decorations(i){return r.getState(i)}}});return r}var Fce=Zle.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),lowlight:{},languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:4,HTMLAttributes:{}}},addProseMirrorPlugins(){var t;return[...((t=this.parent)==null?void 0:t.call(this))||[],$ce({name:this.name,lowlight:this.options.lowlight,defaultLanguage:this.options.defaultLanguage})]}});const NO={bash:()=>k(()=>import("./bash-CPB87Egg-CNRaZOoC.js"),[]),c:()=>k(()=>import("./c-Bz1-FJiA-Dq9oV4GL.js"),[]),csharp:()=>k(()=>import("./csharp-AnFv7wyC-DNqFovD5.js"),[]),css:()=>k(()=>import("./css-BCTOmdxR-Dpuu0f0D.js"),[]),go:()=>k(()=>import("./go-CkZ9_bn0-DXtVqsAL.js"),[]),graphql:()=>k(()=>import("./graphql-CHx1gYw6-DPQANhhf.js"),[]),java:()=>k(()=>import("./java-BicX26Pg-UnUiHiX5.js"),[]),javascript:()=>k(()=>import("./javascript-DII1YQGr-YJsj2bTD.js"),[]),json:()=>k(()=>import("./json-C_6Prymp-CUUUyAin.js"),[]),kotlin:()=>k(()=>import("./kotlin-BwB8b-YX-B6aZBE1U.js"),[]),less:()=>k(()=>import("./less-DeNOeXmL-DuFT_IpY.js"),[]),makefile:()=>k(()=>import("./makefile-D-gl0qMV-DycfiXgX.js"),[]),markdown:()=>k(()=>import("./markdown-ga2-2-T7-DSyCmCK6.js"),[]),objectivec:()=>k(()=>import("./objectivec-CnyrJ13Z-BxPo7QIL.js"),[]),php:()=>k(()=>import("./php-BL35ZHWM-BDcG8-sQ.js"),[]),plaintext:()=>Promise.resolve().then(()=>Vce),python:()=>k(()=>import("./python-CymlFLB0-CoghfyFO.js"),[]),scss:()=>k(()=>import("./scss-CknrYxoA-3If383Hj.js"),[]),shell:()=>k(()=>import("./shell-DYrX6oL5-k1ee8ZNu.js"),[]),sql:()=>k(()=>import("./sql-IeKX8fQ8-D2McoYQw.js"),[]),typescript:()=>k(()=>import("./typescript-SNUkGeOU-BN-27m8j.js"),[]),vbnet:()=>k(()=>import("./vbnet-D7PCGZRn-ixdmBJh7.js"),[]),xml:()=>k(()=>import("./xml-B7THKYqr-rU06iLML.js"),[])};async function Yb(t,e){var n;if(e.registered(t))return!1;try{const{default:r}=await((n=NO[t])==null?void 0:n.call(NO));return e.register(t,r),!0}catch{return!1}}function Bce(t){const e=(t==null?void 0:t.toLowerCase())||Qa;return k$.find(n=>{var r;return n.syntax===e||((r=n.alias)==null?void 0:r.split(", ").includes(e))})}const hd=new rt("lowlight");function jce({name:t,lowlight:e,defaultLanguage:n}){return new ze({key:hd,state:{init(r,{doc:i}){return YC({doc:i,name:t,lowlight:e,defaultLanguage:n})},apply(r,i,s,o){const a=s.selection.$head.parent.type.name,l=o.selection.$head.parent.type.name,c=As(s.doc,d=>d.type.name===t),u=As(o.doc,d=>d.type.name===t),h=r.docChanged&&([a,l].includes(t)||u.length!==c.length||r.steps.some(d=>d.from!==void 0&&d.to!==void 0&&c.some(p=>p.pos>=d.from&&p.pos+p.node.nodeSize<=d.to)));return r.getMeta(hd)||h?YC({doc:r.doc,name:t,lowlight:e,defaultLanguage:n}):i.map(r.mapping,r.doc)}},view(r){class i{constructor(){this.initDecorations()}update(){this.checkUndecoratedBlocks()}async initDecorations(){const o=r.state.doc,a=[...As(o,c=>c.type.name===t).map(c=>c.node.attrs.language||Qa),n];await Promise.all(a.map(c=>Yb(c,e)));const l=r.state.tr.setMeta(hd,!0);r.dispatch(l)}async checkUndecoratedBlocks(){const o=As(r.state.doc,a=>a.type.name===t);if((await Promise.all(o.flatMap(a=>[Yb(a.node.attrs.language||Qa,e)]))).includes(!0)){const a=r.state.tr.setMeta(hd,!0);r.dispatch(a)}}}return new i},props:{decorations(r){return this.getState(r)}}})}function iF(t,e=[]){return t.map(n=>{const r=[...e,...n.properties?n.properties.className:[]];return n.children?iF(n.children,r):{text:n.value,classes:r}}).flat()}function GC(t){return t.value||t.children||[]}function zce(t){return!!ZT.getLanguage(t)}function YC({doc:t,name:e,lowlight:n,defaultLanguage:r}){const i=[];return As(t,s=>s.type.name===e).forEach(s=>{let o=s.pos+1;const a=s.node.attrs.language||r,l=n.listLanguages().includes(a)||zce(a)?GC(n.highlight(a,s.node.textContent)):GC(n.highlightAuto(s.node.textContent));iF(l).forEach(c=>{const u=o+c.text.length;if(c.classes.length){const h=sn.inline(o,u,{class:c.classes.join(" ")});i.push(h)}o=u})}),je.create(t,i)}function sF(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}const Vce=Object.freeze(Object.defineProperty({__proto__:null,default:sF},Symbol.toStringTag,{value:"Module"})),KC={},Uce="hljs-";function Hce(t){const e=ZT.newInstance();return{highlight:n,highlightAuto:r,listLanguages:i,register:s,registerAlias:o,registered:a};function n(l,c,u){const h=u||KC,d=typeof h.prefix=="string"?h.prefix:Uce;if(!e.getLanguage(l))throw new Error("Unknown language: `"+l+"` is not registered");e.configure({__emitter:Xce,classPrefix:d});const p=e.highlight(c,{ignoreIllegals:!0,language:l});if(p.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:p.errorRaised});const f=p._emitter.root,m=f.data;return m.language=p.language,m.relevance=p.relevance,f}function r(l,c){const u=(c||KC).subset||i();let h=-1,d=0,p;for(;++hd&&(d=m.data.relevance,p=m)}return p||{type:"root",children:[],data:{language:void 0,relevance:d}}}function i(){return e.listLanguages()}function s(l,c){if(typeof l=="string")e.registerLanguage(l,c);else{let u;for(u in l)Object.hasOwn(l,u)&&e.registerLanguage(u,l[u])}}function o(l,c){if(typeof l=="string")e.registerAliases(typeof c=="string"?c:[...c],{languageName:l});else{let u;for(u in l)if(Object.hasOwn(l,u)){const h=l[u];e.registerAliases(typeof h=="string"?h:[...h],{languageName:u})}}}function a(l){return!!e.getLanguage(l)}}class Xce{constructor(e){this.options=e,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(e){if(e==="")return;const n=this.stack[this.stack.length-1],r=n.children[n.children.length-1];r&&r.type==="text"?r.value+=e:n.children.push({type:"text",value:e})}startScope(e){this.openNode(String(e))}endScope(){this.closeNode()}__addSublanguage(e,n){const r=this.stack[this.stack.length-1],i=e.root.children;n?r.children.push({type:"element",tagName:"span",properties:{className:[n]},children:i}):r.children.push(...i)}openNode(e){const n=this,r=e.split(".").map(function(o,a){return a?o+"_".repeat(a):n.options.classPrefix+o}),i=this.stack[this.stack.length-1],s={type:"element",tagName:"span",properties:{className:r},children:[]};i.children.push(s),this.stack.push(s)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const qce=/^```([a-z]+)?[\s\n]$/,Zce=/^~~~([a-z]+)?[\s\n]$/,hc=Hce();hc.register("plaintext",sF);const Wce=Fce.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),lowlight:hc,languageClassPrefix:"language-",defaultLanguage:Qa}},addInputRules(){const t=e=>{var r;const n=((r=Bce(e[1]))==null?void 0:r.syntax)||Qa;return Yb(n,hc),{language:n}};return[tu({find:qce,type:this.type,getAttributes:t}),tu({find:Zce,type:this.type,getAttributes:t})]},addProseMirrorPlugins(){return[jce({lowlight:hc,name:this.name,defaultLanguage:Qa})]},addKeyboardShortcuts(){var t;return{...(t=this.parent)==null?void 0:t.call(this),Tab:({editor:e})=>{const{state:n,view:r}=e;return Dr(e.state,this.type)?(r.dispatch(n.tr.insertText(" ")),!0):!1}}}}).configure({lowlight:hc}),Gce=xt.create({name:"figcaption",group:"block",inline:!1,content:"inline*",marks:"",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"figcaption"}]},renderHTML({HTMLAttributes:t}){return["figcaption",Be(t),0]},addKeyboardShortcuts(){return{"Mod-a":({editor:t})=>Yce(t,this.type),Backspace:({editor:t})=>JC(t,"Backspace",this.type),Delete:({editor:t})=>JC(t,"Delete",this.type)}}});function Yce(t,e){const{state:n,view:r}=t,{selection:i}=n,{$anchor:s}=i;if(s.parent.type!==e)return!1;const o=n.tr,a=s.start(),l=s.end();return r.dispatch(o.setSelection(de.create(o.doc,a,l))),!0}function JC(t,e,n){const{selection:r}=t.state,{$from:i,empty:s}=r;return i.parent.type!==n?!1:e==="Delete"?s&&i.parentOffset===i.parent.nodeSize-2:e==="Backspace"?s&&i.parentOffset===0:!1}const Kce=xt.create({name:"figure",group:"block",content:"block figcaption",selectable:!0,draggable:!0,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"figure"}]},renderHTML({HTMLAttributes:t}){return["figure",Be(t),0]},addKeyboardShortcuts(){return{Backspace:({editor:t})=>tue(t,this.type),Delete:({editor:t})=>eue(t,this.type),Enter:({editor:t})=>Jce(t,this.type)}}}),Jce=(t,e)=>{const{selection:n}=t.state,{$from:r}=n;if(r.parent.type===e){const i=r.end();return t.chain().focus(i).insertContentAt(i,{type:"paragraph"}).run()}return!1},eue=(t,e)=>{var s;const{selection:n,doc:r}=t.state,{$from:i}=n;if(i.pos===1)return!1;if(i.parent.type===e)return t.commands.deleteNode(e);if(n.empty&&i.parentOffset===i.parent.nodeSize-2){const o=r.resolve(i.pos+1);return((s=o.nodeAfter)==null?void 0:s.type)!==e?!1:t.chain().setNodeSelection(o.pos).run()}return!1},tue=(t,e)=>{const{selection:n,doc:r}=t.state,{$from:i}=n;if(i.parent.type===e)return t.commands.deleteNode(e);if(n.empty&&i.parentOffset===0){const s=r.resolve(i.pos-1),o=s.nodeBefore;return(o==null?void 0:o.type)!==e?!1:t.chain().command(({chain:a})=>i.parent.textContent.length>0||a().deleteCurrentNode().run()).setNodeSelection(s.pos-o.nodeSize).run()}return!1};var nue=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,rue=xt.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",Be(this.options.HTMLAttributes,t)]},parseMarkdown:(t,e)=>e.createNode("image",{src:t.href,title:t.title,alt:t.text}),renderMarkdown:t=>{var e,n,r,i,s,o;const a=(n=(e=t.attrs)==null?void 0:e.src)!=null?n:"",l=(i=(r=t.attrs)==null?void 0:r.alt)!=null?i:"",c=(o=(s=t.attrs)==null?void 0:s.title)!=null?o:"";return c?`![${l}](${a} "${c}")`:`![${l}](${a})`},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>"u"||!this.editor.isEditable)return null;const{directions:t,minWidth:e,minHeight:n,alwaysPreserveAspectRatio:r}=this.options.resize;return({node:i,getPos:s,HTMLAttributes:o})=>{const a=document.createElement("img");Object.entries(o).forEach(([u,h])=>{if(h!=null)switch(u){case"width":case"height":break;default:a.setAttribute(u,h);break}}),a.src=o.src;const l=new sX({element:a,node:i,getPos:s,onResize:(u,h)=>{a.style.width=`${u}px`,a.style.height=`${h}px`},onCommit:(u,h)=>{const d=s();d!==void 0&&this.editor.chain().setNodeSelection(d).updateAttributes(this.name,{width:u,height:h}).run()},onUpdate:(u,h,d)=>u.type===i.type,options:{directions:t,min:{width:e,height:n},preserveAspectRatio:r===!0}}),c=l.dom;return c.style.visibility="hidden",c.style.pointerEvents="none",a.onload=()=>{c.style.visibility="",c.style.pointerEvents=""},l}},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[dR({find:nue,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}});const dc=rue.extend({addAttributes(){return{src:{default:"",parseHTML:t=>t.getAttribute("src"),renderHTML:t=>({src:t.src})},alt:{default:void 0,parseHTML:t=>t.getAttribute("alt"),renderHTML:t=>t.alt?{alt:t.alt}:{}},width:{default:null,parseHTML:t=>Number.parseInt(t.style.width)||null,renderHTML:t=>t.width?{style:`width: ${t.width}%`}:{}},naturalWidth:{default:null,parseHTML:t=>t.getAttribute("data-width"),renderHTML:t=>({"data-width":t.naturalWidth})},naturalHeight:{default:null,parseHTML:t=>t.getAttribute("data-height"),renderHTML:t=>({"data-height":t.naturalHeight})}}},parseHTML(){return[{tag:"img"}]},renderHTML({HTMLAttributes:t}){return["img",Be(this.options.HTMLAttributes,t)]},addCommands(){var t;return{...(t=this.parent)==null?void 0:t.call(this),insertImage:({width:e,height:n,...r})=>({commands:i})=>i.setImage({...r,naturalWidth:e,naturalHeight:n})}}}),oF=Kce.extend({name:"imageFigure",content:"image imageCaption?",addExtensions(){return[Xd]},addCommands(){return{setImageFigure:({src:t,caption:e})=>({chain:n})=>{const r=[{type:dc.name,attrs:{src:t}},e==null?{}:{type:Xd.name,content:e===""?void 0:[{type:"text",text:e}]}];return n().insertContent({type:this.name,content:r}).run()},imageToFigure:()=>({state:t,chain:e})=>{const{selection:n}=t,{$anchor:r}=n,i=r.pos,s=t.doc.nodeAt(i);if(!s||s.type.name!==dc.name)return!1;const o={from:i,to:i+s.nodeSize},a=[{type:dc.name,attrs:s.attrs},{type:Xd.name,content:void 0}];return e().insertContentAt(o,{type:this.name,content:a}).setTextSelection(o.to+a.length).run()},figureToImage:()=>({state:t,commands:e})=>{const{selection:n}=t,{$anchor:r}=n;let i=r.depth,s=r.pos;for(;i>0;)s=r.before(i),i--;const o=t.doc.nodeAt(s);if(!o||o.type.name!==this.name)return!1;const a={from:s,to:s+o.nodeSize},l=o.firstChild;return e.insertContentAt(a,l)},removeImage:()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=t,{$anchor:i}=r;let s=i.depth,o=i.pos;for(;s>0;)o=i.before(s),s--;const a=t.doc.nodeAt(o);return!a||a.type.name!==this.name&&a.type.name!==dc.name?!1:(n&&(e.deleteRange(o,o+a.nodeSize),n(e)),!0)}}},addProseMirrorPlugins(){let t;return[new ze({props:{handleDOMEvents:{dragstart:(e,n)=>{if(!n.dataTransfer||!n.target||!(n.target instanceof HTMLImageElement))return!1;const r=e.posAtDOM(n.target,0),i=e.state.doc.resolve(r);if(i.parent.type!==this.type)return!1;t=pe.create(e.state.doc,i.before(i.depth));const s=t.content(),o=Ks.fromSchema(e.state.schema),a=document.createElement("div"),l=o.serializeFragment(s.content);a.appendChild(l);const c=a.textContent||"",u=s;return n.dataTransfer.clearData(),n.dataTransfer.setData("text/html",a.innerHTML),n.dataTransfer.setData("text/plain",c),n.dataTransfer.effectAllowed="copyMove",e.dragging={slice:u,move:n.ctrlKey},!0},drop:e=>{t&&(e.dispatch(e.state.tr.setSelection(t)),t=null)},dragend:()=>{t=null}}}})]}}),Xd=Gce.extend({name:"imageCaption",addProseMirrorPlugins(){return[new ze({key:new rt("imageCaptionFocus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:n,isFocused:r}=this.editor,{$anchor:i}=e;if(!n||!r||i.parent.type.name!==this.name)return je.create(t,[]);if(i.node(i.depth-1).type.name!==oF.name)return je.create(t,[]);const s=i.before(i.depth),o=i.after(i.depth);return je.create(t,[sn.node(s,o,{class:"ProseMirror-selectednode"})])}}})]}});Ve.create({name:"indent",addOptions(){return{types:["heading","paragraph"],minLevel:0,maxLevel:4}},addGlobalAttributes(){return[{types:this.options.types,attributes:{indent:{default:null,renderHTML:t=>!t.indent||t.indent==this.options.minLevel?{}:{"data-indent":t.indent},parseHTML:t=>{const e=Number.parseInt(t.getAttribute("data-indent")||"",10);return e&&e>this.options.minLevel?e:null}}}}]},addCommands(){const t=(r,i,s)=>{const o=r.doc.nodeAt(i)??null;if(o){const a=(o.attrs.indent||0)+s,{minLevel:l,maxLevel:c}=this.options;let u=a;if(ac&&(u=c),u!==o.attrs.indent){const h={...o.attrs};delete h.indent;const d=u>l?{...h,indent:u}:h;return r.setNodeMarkup(i,o.type,d,o.marks)}}return r},e=(r,i)=>{const{doc:s,selection:o}=r;if(s&&o&&o instanceof de){const{from:a,to:l}=o;s.nodesBetween(a,l,(c,u)=>this.options.types.includes(c.type.name)?(r=t(r,u,i),!1):!0)}return r},n=r=>()=>({tr:i,state:s,dispatch:o})=>{const{selection:a}=s;return i.setSelection(a),i=e(i,r),i.docChanged&&o&&o(i),!0};return{indent:n(1),outdent:n(-1)}},addKeyboardShortcuts(){return{Tab:()=>!Dr(this.editor.state,"listItem")&&this.editor.commands.indent(),"Shift-Tab":()=>!Dr(this.editor.state,"listItem")&&this.editor.commands.outdent(),Backspace:({editor:t})=>{const{selection:e}=t.state,{$anchor:n}=e;if(n.parentOffset!==0)return!1;const r=n.parent,i=this.options.types.includes(r.type.name),s=r.attrs.indent||0;return i&&s>this.options.minLevel?this.editor.commands.outdent():!1}}}});const iue=nF.extend({inclusive:!1,addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),openOnClick:!1,autolink:!0}},addStorage(){return{mode:0,tempPos:null}},onSelectionUpdate(){this.storage.mode==-1&&!this.editor.isActive("link")&&this.editor.commands.confirmEditLink()},addCommands(){var t;return{...(t=this.parent)==null?void 0:t.call(this),startEditLink:()=>({editor:e,chain:n})=>{const r=e.isActive("link")?1:-1;return r===-1&&n().command(({chain:i,tr:s})=>(this.storage.tempPos=s.selection,s.selection.empty?i().blur().focus(s.selection.anchor).insertLink({text:"​"}).run():i().setLink({href:""}).run())).setMeta("addToHistory",!1).setMeta("preventUpdate",!0).setMeta("preventClearTempLink",!0).run(),this.storage.mode=r,!0},insertLink:e=>({chain:n})=>{const{text:r,href:i}=e;return n().insertContent({type:"text",text:r,marks:[{type:"link",attrs:{href:i,target:"_blank"}}]},{updateSelection:!1}).setLink({href:i}).run()},confirmEditLink:e=>({chain:n,state:r})=>{const{doc:i}=r,s=!!e;return n().command(({tr:o,commands:a})=>s?a.insertLink(e):(eD(o,i,this.storage.tempPos),!0)).setMeta("addToHistory",s).setMeta("preventUpdate",!s).run(),this.storage.mode=0,this.storage.tempPos=null,!0}}},addProseMirrorPlugins(){var t;return[...((t=this.parent)==null?void 0:t.call(this))||[],new ze({props:{handleClick:(e,n,r)=>{var h;if(!e.editable)return!1;const{schema:i,doc:s,tr:o}=e.state,a=Jc(s.resolve(n),i.marks.link);if(!((h=r.target.closest("a"))!=null&&h.href)||!a)return!1;const l=s.resolve(a.from),c=s.resolve(a.to),u=o.setSelection(new de(l,c));e.dispatch(u),this.storage.mode=1}},appendTransaction:(e,n,r)=>{const i=e.some(a=>a.docChanged)&&!n.doc.eq(r.doc),s=e.some(a=>a.getMeta("preventClearTempLink"));if(!i||s)return;const o=r.tr;if(Jc(r.selection.$anchor,r.schema.marks.link)&&(eD(o,r.doc,r.selection),!!o.steps.length))return o}})]},addKeyboardShortcuts(){return{"Mod-k":()=>this.editor.commands.startEditLink()}}});function eD(t,e,n){const{from:r,to:i,empty:s}=n;s?(t.removeMark(r,r+1),t.insertText("",r,r+1)):e.nodesBetween(r,i,(o,a)=>{const l=o.marks.find(c=>c.type.name==="link"&&!c.attrs.href);l&&t.removeMark(a,a+o.nodeSize,l)})}const sue=Ve.create({name:"selection",addProseMirrorPlugins(){const{editor:t}=this;return[new ze({key:new rt("selection"),props:{decorations(e){return e.selection.empty||t.isFocused===!0?null:je.create(e.doc,[sn.inline(e.selection.from,e.selection.to,{class:"selection"})])}}})]}});var aF=xt.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{var e,n;const r=t.getAttribute("colwidth"),i=r?r.split(",").map(s=>parseInt(s,10)):null;if(!i){const s=(e=t.closest("table"))==null?void 0:e.querySelectorAll("colgroup > col"),o=Array.from(((n=t.parentElement)==null?void 0:n.children)||[]).indexOf(t);if(o&&o>-1&&s&&s[o]){const a=s[o].getAttribute("width");return a?[parseInt(a,10)]:null}}return i}}}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:t}){return["td",Be(this.options.HTMLAttributes,t),0]}}),lF=xt.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?e.split(",").map(n=>parseInt(n,10)):null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:t}){return["th",Be(this.options.HTMLAttributes,t),0]}}),cF=xt.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",Be(this.options.HTMLAttributes,t),0]}});function Kb(t,e){return e?["width",`${Math.max(e,t)}px`]:["min-width",`${t}px`]}function tD(t,e,n,r,i,s){var o;let a=0,l=!0,c=e.firstChild;const u=t.firstChild;if(u!==null)for(let d=0,p=0;d{const r=t.nodes[n];r.spec.tableRole&&(e[r.spec.tableRole]=r)}),t.cached.tableNodeTypes=e,e}function cue(t,e,n,r,i){const s=lue(t),o=[],a=[];for(let c=0;c{const{selection:e}=t.state;if(!uue(e))return!1;let n=0;const r=VN(e.ranges[0].$from,i=>i.type.name==="table");return r==null||r.node.descendants(i=>{if(i.type.name==="table")return!1;["tableCell","tableHeader"].includes(i.type.name)&&(n+=1)}),n===e.ranges.length?(t.commands.deleteTable(),!0):!1},hue="";function due(t){return(t||"").replace(/\s+/g," ").trim()}function pue(t,e,n={}){var r;const i=(r=n.cellLineSeparator)!=null?r:hue;if(!t||!t.content||t.content.length===0)return"";const s=[];t.content.forEach(p=>{const f=[];p.content&&p.content.forEach(m=>{let g="";m.content&&Array.isArray(m.content)&&m.content.length>1?g=m.content.map(T=>e.renderChildren(T)).join(i):g=m.content?e.renderChildren(m.content):"";const y=due(g),b=m.type==="tableHeader";f.push({text:y,isHeader:b})}),s.push(f)});const o=s.reduce((p,f)=>Math.max(p,f.length),0);if(o===0)return"";const a=new Array(o).fill(0);s.forEach(p=>{var f;for(let m=0;ma[m]&&(a[m]=g),a[m]<3&&(a[m]=3)}});const l=(p,f)=>p+" ".repeat(Math.max(0,f-p.length)),c=s[0],u=c.some(p=>p.isHeader);let h=` `;const d=new Array(o).fill(0).map((p,f)=>u&&c[f]&&c[f].text||"");return h+=`| ${d.map((p,f)=>l(p,a[f])).join(" | ")} | `,h+=`| ${a.map(p=>"-".repeat(Math.max(3,p))).join(" | ")} | `,(u?s.slice(1):s).forEach(p=>{h+=`| ${new Array(o).fill(0).map((f,m)=>l(p[m]&&p[m].text||"",a[m])).join(" | ")} | `}),h}var fue=pue,uF=xt.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:oue,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:t,HTMLAttributes:e}){const{colgroup:n,tableWidth:r,tableMinWidth:i}=aue(t,this.options.cellMinWidth),s=e.style;function o(){return s||(r?`width: ${r}`:`min-width: ${i}`)}const a=["table",Be(this.options.HTMLAttributes,e,{style:o()}),n,["tbody",0]];return this.options.renderWrapper?["div",{class:"tableWrapper"},a]:a},parseMarkdown:(t,e)=>{const n=[];if(t.header){const r=[];t.header.forEach(i=>{r.push(e.createNode("tableHeader",{},[{type:"paragraph",content:e.parseInline(i.tokens)}]))}),n.push(e.createNode("tableRow",{},r))}return t.rows&&t.rows.forEach(r=>{const i=[];r.forEach(s=>{i.push(e.createNode("tableCell",{},[{type:"paragraph",content:e.parseInline(s.tokens)}]))}),n.push(e.createNode("tableRow",{},i))}),e.createNode("table",void 0,n)},renderMarkdown:(t,e)=>fue(t,e),addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:s})=>{const o=cue(s.schema,t,e,n);if(i){const a=r.selection.from+1;r.replaceSelectionWith(o).scrollIntoView().setSelection(de.near(r.doc.resolve(a)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>Yoe(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>Koe(t,e),deleteColumn:()=>({state:t,dispatch:e})=>eae(t,e),addRowBefore:()=>({state:t,dispatch:e})=>nae(t,e),addRowAfter:()=>({state:t,dispatch:e})=>rae(t,e),deleteRow:()=>({state:t,dispatch:e})=>sae(t,e),deleteTable:()=>({state:t,dispatch:e})=>dae(t,e),mergeCells:()=>({state:t,dispatch:e})=>vC(t,e),splitCell:()=>({state:t,dispatch:e})=>TC(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>Su("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>Su("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>uae(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>vC(t,e)?!0:TC(t,e),setCellAttribute:(t,e)=>({state:n,dispatch:r})=>lae(t,e)(n,r),goToNextCell:()=>({state:t,dispatch:e})=>wC(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>wC(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&b$(t),!0),setCellSelection:t=>({tr:e,dispatch:n})=>{if(n){const r=nt.create(e.doc,t.anchorCell,t.headCell);e.setSelection(r)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:dd,"Mod-Backspace":dd,Delete:dd,"Mod-Delete":dd}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[Tae({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],Nae({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(t){const e={name:t.name,options:t.options,storage:t.storage};return{tableRole:qe(ge(t,"tableRole",e))}}});Ve.create({name:"tableKit",addExtensions(){const t=[];return this.options.table!==!1&&t.push(uF.configure(this.options.table)),this.options.tableCell!==!1&&t.push(aF.configure(this.options.tableCell)),this.options.tableHeader!==!1&&t.push(lF.configure(this.options.tableHeader)),this.options.tableRow!==!1&&t.push(cF.configure(this.options.tableRow)),t}});const mue=uF.extend({addExtensions(){return[cF,lF,aF]}}).configure({cellMinWidth:35,resizable:!0}),gue=/^(https?:\/\/)?(www\.|music\.)?(youtube\.com|youtu\.be|youtube-nocookie\.com)\/(?!channel\/)(?!@)(.+)?$/;function hF(t){return t.match(gue)}function Oue({url:t,nocookie:e,allowFullscreen:n,autoplay:r,controls:i}){if(!hF(t))return null;if(t.includes("/embed/"))return t;const s=/(?:v=|shorts\/)([-\w]+)/gm.exec(t);return!s||!s[1]?null:(e?"https://www.youtube-nocookie.com/embed/":"https://www.youtube.com/embed/")+s[1]}const yue=xt.create({name:"youtube",group:"block",draggable:!0,atom:!0,addOptions(){return{allowFullscreen:!0,autoplay:!1,nocookie:!1,controls:!0,HTMLAttributes:{}}},addAttributes(){return{src:{default:null},width:{default:null,parseHTML:t=>Number.parseInt(t.style.width)||null,renderHTML:t=>t.width?{style:`width: ${t.width}%`}:{}}}},parseHTML(){return[{tag:"iframe[src]"}]},renderHTML({HTMLAttributes:t}){return["iframe",Be(this.options.HTMLAttributes,{with:200,height:120,allowfullscreen:this.options.allowFullscreen?"true":void 0,autoplay:this.options.autoplay?"true":void 0},t)]},addCommands(){return{embedYoutube:t=>({commands:e})=>{if(!hF(t.src))return!1;const n=Oue({url:t.src,allowFullscreen:this.options.allowFullscreen,autoplay:this.options.autoplay,controls:this.options.controls,nocookie:this.options.nocookie});return n?e.insertContent({type:this.name,attrs:{...t,src:n}}):!1}}},addNodeView(){return({node:t})=>{const e=document.createElement("iframe");e.src=t.attrs.src;const n=document.createElement("div");return n.style.cursor="default",n.style.marginInline="auto",n.style.width=`${t.attrs.width}%`,n.appendChild(e),{dom:n}}}}),rD=(t,e)=>{document.documentElement.style.setProperty(t,e)};function bue(t,e){let n=null,r=null;return(...i)=>{n?r=i:(t(...i),n=setTimeout(()=>{n=null,r&&(t(...r),r=null)},e))}}const Eue=[Rce.configure({horizontalRule:!1,hardBreak:!1,codeBlock:!1}),vle.configure({includeChildren:!0,showOnlyCurrent:!0,placeholder:({editor:t,node:e})=>{const n=t.options.editorProps.placeholder;switch(e.type.name){case Xd.name:return n==null?void 0:n.imageCaption;default:return n==null?void 0:n.paragraph}}}),sue,yle,H$,Mle,Rle,Ile.configure({types:["heading","paragraph"]}),V$,U$,Nle.configure({multicolor:!0}),QT,iue,dc,oF,Wce,yue,mue],vue=()=>{const{editor:t,contentElement:e}=$e(),n=v.useCallback(({editor:u})=>u.isActive("table"),[]),r=v.useCallback(()=>{const u=Ip(t,"table");return u?{getBoundingClientRect:()=>u.getBoundingClientRect()}:null},[t]),i=v.useCallback((u,h)=>{const d=`add${u}${h}`;return()=>t.chain().focus()[d]().run()},[t]),s=v.useCallback(u=>{const h=`delete${u}`;return()=>t.chain().focus()[h]().run()},[t]),o=v.useCallback(u=>{const h=`toggleHeader${u}`;return()=>t.chain().focus()[h]().run()},[t]),a=v.useCallback(()=>t.chain().focus().mergeCells().run(),[t]),l=v.useCallback(()=>t.chain().focus().splitCell().run(),[t]),c=v.useCallback(()=>t.chain().focus().deleteTable().run(),[t]);return E.jsxs(Dm,{editor:t,pluginKey:"table-bubble",shouldShow:n,updateDelay:100,appendTo:()=>e.current,getReferencedVirtualElement:r,options:{placement:"top"},children:[E.jsxs(li,{children:[E.jsx(be,{icon:"RowInsertTop",tooltip:"Add row above",onClick:i("Row","Before")}),E.jsx(be,{icon:"RowInsertBottom",tooltip:"Add row below",onClick:i("Row","After")}),E.jsx(be,{icon:"ColInsertLeft",tooltip:"Add column before",onClick:i("Column","Before")}),E.jsx(be,{icon:"ColInsertRight",tooltip:"Add column after",onClick:i("Column","After")}),E.jsx(be,{icon:"SplitCell",tooltip:"Split cell",onClick:l}),E.jsx(be,{icon:"MergeCell",tooltip:"Merge cells",onClick:a})]}),E.jsxs(li,{style:{justifyContent:"center"},children:[E.jsx(be,{icon:"RowHeader",tooltip:"Toggle row header",onClick:o("Row")}),E.jsx(be,{icon:"ColHeader",tooltip:"Toggle column header",onClick:o("Column")}),E.jsx(be,{icon:"RowRemove",tooltip:"Delete row",onClick:s("Row")}),E.jsx(be,{icon:"ColRemove",tooltip:"Delete column",onClick:s("Column")}),E.jsx(be,{icon:"Trash",tooltip:"Delete table",onClick:c})]})]})},Tue=v.forwardRef(({ssr:t=!1,output:e="html",readonly:n=!1,disabled:r=!1,initialContent:i,placeholder:s,hideMenuBar:o=!1,hideStatusBar:a=!1,hideBubbleMenu:l=!0,contentMinHeight:c=200,contentMaxHeight:u,onContentChange:h},d)=>{const p=!n&&!r,f=p&&l,m=v.useCallback(bue(b=>h==null?void 0:h(b),1500),[]),g=v.useCallback(b=>{const T=e==="html"?b.isEmpty?"":b.getHTML():b.getJSON();m(T)},[m,e]),y={ref:d,placeholder:s,extensions:Eue,content:i,editable:p,immediatelyRender:!t,shouldRerenderOnTransaction:!1,autofocus:!1,onUpdate:({editor:b})=>g(b)};return v.useEffect(()=>{rD("--rte-editor-min-height",`${c}px`),rD("--rte-editor-max-height",`${u}px`)},[u,c]),E.jsxs(wie,{editorOptions:y,slotBefore:!o&&E.jsx(Aoe,{}),slotAfter:!a&&E.jsx(Ioe,{}),children:[f&&E.jsxs(E.Fragment,{children:[E.jsx(x$,{}),E.jsx($ae,{}),E.jsx(_$,{}),E.jsx(vue,{})]}),E.jsx(Roe,{})]})});Tue.displayName="TiptapEditor";class oh{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}}oh.prototype.normal={};oh.prototype.property={};oh.prototype.space=void 0;function dF(t,e){const n={},r={};for(const i of t)Object.assign(n,i.property),Object.assign(r,i.normal);return new oh(n,r,e)}function _u(t){return t.toLowerCase()}class Bn{constructor(e,n){this.attribute=n,this.property=e}}Bn.prototype.attribute="";Bn.prototype.booleanish=!1;Bn.prototype.boolean=!1;Bn.prototype.commaOrSpaceSeparated=!1;Bn.prototype.commaSeparated=!1;Bn.prototype.defined=!1;Bn.prototype.mustUseProperty=!1;Bn.prototype.number=!1;Bn.prototype.overloadedBoolean=!1;Bn.prototype.property="";Bn.prototype.spaceSeparated=!1;Bn.prototype.space=void 0;let Sue=0;const Ae=ra(),Dt=ra(),Jb=ra(),Y=ra(),lt=ra(),$a=ra(),Un=ra();function ra(){return 2**++Sue}const eE=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ae,booleanish:Dt,commaOrSpaceSeparated:Un,commaSeparated:$a,number:Y,overloadedBoolean:Jb,spaceSeparated:lt},Symbol.toStringTag,{value:"Module"})),RO=Object.keys(eE);class WT extends Bn{constructor(e,n,r,i){let s=-1;if(super(e,n),iD(this,"space",i),typeof r=="number")for(;++s4&&n.slice(0,4)==="data"&&Cue.test(e)){if(e.charAt(4)==="-"){const s=e.slice(5).replace(sD,Aue);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=e.slice(4);if(!sD.test(s)){let o=s.replace(xue,Due);o.charAt(0)!=="-"&&(o="-"+o),e="data"+o}}i=WT}return new i(r,e)}function Due(t){return"-"+t.toLowerCase()}function Aue(t){return t.charAt(1).toUpperCase()}const ah=dF([pF,wue,gF,OF,yF],"html"),io=dF([pF,kue,gF,OF,yF],"svg");function oD(t){const e=[],n=String(t||"");let r=n.indexOf(","),i=0,s=!1;for(;!s;){r===-1&&(r=n.length,s=!0);const o=n.slice(i,r).trim();(o||!s)&&e.push(o),i=r+1,r=n.indexOf(",",i)}return e}function bF(t,e){const n=e||{};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const aD=/[#.]/g;function Pue(t,e){const n=t||"",r={};let i=0,s,o;for(;i-1&&s<=e.length){let o=0;for(;;){let a=n[o];if(a===void 0){const l=uD(e,n[o-1]);a=l===-1?e.length+1:l+1,n[o]=a}if(a>s)return{line:o+1,column:s-(o>0?n[o-1]:0)+1,offset:s};o++}}}function i(s){if(s&&typeof s.line=="number"&&typeof s.column=="number"&&!Number.isNaN(s.line)&&!Number.isNaN(s.column)){for(;n.length1?n[s.line-2]:0)+s.column-1;if(o=55296&&t<=57343}function Xue(t){return t>=56320&&t<=57343}function que(t,e){return(t-55296)*1024+9216+e}function kF(t){return t!==32&&t!==10&&t!==13&&t!==9&&t!==12&&t>=1&&t<=31||t>=127&&t<=159}function _F(t){return t>=64976&&t<=65007||Hue.has(t)}var F;(function(t){t.controlCharacterInInputStream="control-character-in-input-stream",t.noncharacterInInputStream="noncharacter-in-input-stream",t.surrogateInInputStream="surrogate-in-input-stream",t.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",t.endTagWithAttributes="end-tag-with-attributes",t.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",t.unexpectedSolidusInTag="unexpected-solidus-in-tag",t.unexpectedNullCharacter="unexpected-null-character",t.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",t.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",t.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",t.missingEndTagName="missing-end-tag-name",t.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",t.unknownNamedCharacterReference="unknown-named-character-reference",t.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",t.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",t.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",t.eofBeforeTagName="eof-before-tag-name",t.eofInTag="eof-in-tag",t.missingAttributeValue="missing-attribute-value",t.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",t.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",t.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",t.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",t.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",t.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",t.missingDoctypePublicIdentifier="missing-doctype-public-identifier",t.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",t.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",t.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",t.cdataInHtmlContent="cdata-in-html-content",t.incorrectlyOpenedComment="incorrectly-opened-comment",t.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",t.eofInDoctype="eof-in-doctype",t.nestedComment="nested-comment",t.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",t.eofInComment="eof-in-comment",t.incorrectlyClosedComment="incorrectly-closed-comment",t.eofInCdata="eof-in-cdata",t.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",t.nullCharacterReference="null-character-reference",t.surrogateCharacterReference="surrogate-character-reference",t.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",t.controlCharacterReference="control-character-reference",t.noncharacterCharacterReference="noncharacter-character-reference",t.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",t.missingDoctypeName="missing-doctype-name",t.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",t.duplicateAttribute="duplicate-attribute",t.nonConformingDoctype="non-conforming-doctype",t.missingDoctype="missing-doctype",t.misplacedDoctype="misplaced-doctype",t.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",t.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",t.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",t.openElementsLeftAfterEof="open-elements-left-after-eof",t.abandonedHeadElementChild="abandoned-head-element-child",t.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",t.nestedNoscriptInHead="nested-noscript-in-head",t.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(F||(F={}));const Zue=65536;class Wue{constructor(e){this.handler=e,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=Zue,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e,n){const{line:r,col:i,offset:s}=this,o=i+n,a=s+n;return{code:e,startLine:r,endLine:r,startCol:o,endCol:o,startOffset:a,endOffset:a}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(Xue(n))return this.pos++,this._addGap(),que(e,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,_.EOF;return this._err(F.surrogateInInputStream),e}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(e,n){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,n){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(e,this.pos);for(let r=0;r=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,_.EOF;const r=this.html.charCodeAt(n);return r===_.CARRIAGE_RETURN?_.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,_.EOF;let e=this.html.charCodeAt(this.pos);return e===_.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,_.LINE_FEED):e===_.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,wF(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===_.LINE_FEED||e===_.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){kF(e)?this._err(F.controlCharacterInInputStream):_F(e)&&this._err(F.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos=0;n--)if(t.attrs[n].name===e)return t.attrs[n].value;return null}const Gue=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(t=>t.charCodeAt(0))),Yue=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function Kue(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=Yue.get(t))!==null&&e!==void 0?e:t}var qt;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(qt||(qt={}));const Jue=32;var Ms;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(Ms||(Ms={}));function nE(t){return t>=qt.ZERO&&t<=qt.NINE}function ehe(t){return t>=qt.UPPER_A&&t<=qt.UPPER_F||t>=qt.LOWER_A&&t<=qt.LOWER_F}function the(t){return t>=qt.UPPER_A&&t<=qt.UPPER_Z||t>=qt.LOWER_A&&t<=qt.LOWER_Z||nE(t)}function nhe(t){return t===qt.EQUALS||the(t)}var Vt;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(Vt||(Vt={}));var Ii;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(Ii||(Ii={}));class rhe{constructor(e,n,r){this.decodeTree=e,this.emitCodePoint=n,this.errors=r,this.state=Vt.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Ii.Strict}startEntity(e){this.decodeMode=e,this.state=Vt.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,n){switch(this.state){case Vt.EntityStart:return e.charCodeAt(n)===qt.NUM?(this.state=Vt.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=Vt.NamedEntity,this.stateNamedEntity(e,n));case Vt.NumericStart:return this.stateNumericStart(e,n);case Vt.NumericDecimal:return this.stateNumericDecimal(e,n);case Vt.NumericHex:return this.stateNumericHex(e,n);case Vt.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|Jue)===qt.LOWER_X?(this.state=Vt.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=Vt.NumericDecimal,this.stateNumericDecimal(e,n))}addToNumericResult(e,n,r,i){if(n!==r){const s=r-n;this.result=this.result*Math.pow(i,s)+Number.parseInt(e.substr(n,s),i),this.consumed+=s}}stateNumericHex(e,n){const r=n;for(;n>14;for(;n>14,s!==0){if(o===qt.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==Ii.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:n,decodeTree:r}=this,i=(r[n]&Ms.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,n,r){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[e]&~Ms.VALUE_LENGTH:i[e+1],r),n===3&&this.emitCodePoint(i[e+2],r),r}end(){var e;switch(this.state){case Vt.NamedEntity:return this.result!==0&&(this.decodeMode!==Ii.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Vt.NumericDecimal:return this.emitNumericEntity(0,2);case Vt.NumericHex:return this.emitNumericEntity(0,3);case Vt.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Vt.EntityStart:return 0}}}function ihe(t,e,n,r){const i=(e&Ms.BRANCH_LENGTH)>>7,s=e&Ms.JUMP_TABLE;if(i===0)return s!==0&&r===s?n:-1;if(s){const l=r-s;return l<0||l>=i?-1:t[n+l]-1}let o=n,a=o+i-1;for(;o<=a;){const l=o+a>>>1,c=t[l];if(cr)a=l-1;else return t[l+i]}return-1}var q;(function(t){t.HTML="http://www.w3.org/1999/xhtml",t.MATHML="http://www.w3.org/1998/Math/MathML",t.SVG="http://www.w3.org/2000/svg",t.XLINK="http://www.w3.org/1999/xlink",t.XML="http://www.w3.org/XML/1998/namespace",t.XMLNS="http://www.w3.org/2000/xmlns/"})(q||(q={}));var No;(function(t){t.TYPE="type",t.ACTION="action",t.ENCODING="encoding",t.PROMPT="prompt",t.NAME="name",t.COLOR="color",t.FACE="face",t.SIZE="size"})(No||(No={}));var or;(function(t){t.NO_QUIRKS="no-quirks",t.QUIRKS="quirks",t.LIMITED_QUIRKS="limited-quirks"})(or||(or={}));var M;(function(t){t.A="a",t.ADDRESS="address",t.ANNOTATION_XML="annotation-xml",t.APPLET="applet",t.AREA="area",t.ARTICLE="article",t.ASIDE="aside",t.B="b",t.BASE="base",t.BASEFONT="basefont",t.BGSOUND="bgsound",t.BIG="big",t.BLOCKQUOTE="blockquote",t.BODY="body",t.BR="br",t.BUTTON="button",t.CAPTION="caption",t.CENTER="center",t.CODE="code",t.COL="col",t.COLGROUP="colgroup",t.DD="dd",t.DESC="desc",t.DETAILS="details",t.DIALOG="dialog",t.DIR="dir",t.DIV="div",t.DL="dl",t.DT="dt",t.EM="em",t.EMBED="embed",t.FIELDSET="fieldset",t.FIGCAPTION="figcaption",t.FIGURE="figure",t.FONT="font",t.FOOTER="footer",t.FOREIGN_OBJECT="foreignObject",t.FORM="form",t.FRAME="frame",t.FRAMESET="frameset",t.H1="h1",t.H2="h2",t.H3="h3",t.H4="h4",t.H5="h5",t.H6="h6",t.HEAD="head",t.HEADER="header",t.HGROUP="hgroup",t.HR="hr",t.HTML="html",t.I="i",t.IMG="img",t.IMAGE="image",t.INPUT="input",t.IFRAME="iframe",t.KEYGEN="keygen",t.LABEL="label",t.LI="li",t.LINK="link",t.LISTING="listing",t.MAIN="main",t.MALIGNMARK="malignmark",t.MARQUEE="marquee",t.MATH="math",t.MENU="menu",t.META="meta",t.MGLYPH="mglyph",t.MI="mi",t.MO="mo",t.MN="mn",t.MS="ms",t.MTEXT="mtext",t.NAV="nav",t.NOBR="nobr",t.NOFRAMES="noframes",t.NOEMBED="noembed",t.NOSCRIPT="noscript",t.OBJECT="object",t.OL="ol",t.OPTGROUP="optgroup",t.OPTION="option",t.P="p",t.PARAM="param",t.PLAINTEXT="plaintext",t.PRE="pre",t.RB="rb",t.RP="rp",t.RT="rt",t.RTC="rtc",t.RUBY="ruby",t.S="s",t.SCRIPT="script",t.SEARCH="search",t.SECTION="section",t.SELECT="select",t.SOURCE="source",t.SMALL="small",t.SPAN="span",t.STRIKE="strike",t.STRONG="strong",t.STYLE="style",t.SUB="sub",t.SUMMARY="summary",t.SUP="sup",t.TABLE="table",t.TBODY="tbody",t.TEMPLATE="template",t.TEXTAREA="textarea",t.TFOOT="tfoot",t.TD="td",t.TH="th",t.THEAD="thead",t.TITLE="title",t.TR="tr",t.TRACK="track",t.TT="tt",t.U="u",t.UL="ul",t.SVG="svg",t.VAR="var",t.WBR="wbr",t.XMP="xmp"})(M||(M={}));var O;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.A=1]="A",t[t.ADDRESS=2]="ADDRESS",t[t.ANNOTATION_XML=3]="ANNOTATION_XML",t[t.APPLET=4]="APPLET",t[t.AREA=5]="AREA",t[t.ARTICLE=6]="ARTICLE",t[t.ASIDE=7]="ASIDE",t[t.B=8]="B",t[t.BASE=9]="BASE",t[t.BASEFONT=10]="BASEFONT",t[t.BGSOUND=11]="BGSOUND",t[t.BIG=12]="BIG",t[t.BLOCKQUOTE=13]="BLOCKQUOTE",t[t.BODY=14]="BODY",t[t.BR=15]="BR",t[t.BUTTON=16]="BUTTON",t[t.CAPTION=17]="CAPTION",t[t.CENTER=18]="CENTER",t[t.CODE=19]="CODE",t[t.COL=20]="COL",t[t.COLGROUP=21]="COLGROUP",t[t.DD=22]="DD",t[t.DESC=23]="DESC",t[t.DETAILS=24]="DETAILS",t[t.DIALOG=25]="DIALOG",t[t.DIR=26]="DIR",t[t.DIV=27]="DIV",t[t.DL=28]="DL",t[t.DT=29]="DT",t[t.EM=30]="EM",t[t.EMBED=31]="EMBED",t[t.FIELDSET=32]="FIELDSET",t[t.FIGCAPTION=33]="FIGCAPTION",t[t.FIGURE=34]="FIGURE",t[t.FONT=35]="FONT",t[t.FOOTER=36]="FOOTER",t[t.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",t[t.FORM=38]="FORM",t[t.FRAME=39]="FRAME",t[t.FRAMESET=40]="FRAMESET",t[t.H1=41]="H1",t[t.H2=42]="H2",t[t.H3=43]="H3",t[t.H4=44]="H4",t[t.H5=45]="H5",t[t.H6=46]="H6",t[t.HEAD=47]="HEAD",t[t.HEADER=48]="HEADER",t[t.HGROUP=49]="HGROUP",t[t.HR=50]="HR",t[t.HTML=51]="HTML",t[t.I=52]="I",t[t.IMG=53]="IMG",t[t.IMAGE=54]="IMAGE",t[t.INPUT=55]="INPUT",t[t.IFRAME=56]="IFRAME",t[t.KEYGEN=57]="KEYGEN",t[t.LABEL=58]="LABEL",t[t.LI=59]="LI",t[t.LINK=60]="LINK",t[t.LISTING=61]="LISTING",t[t.MAIN=62]="MAIN",t[t.MALIGNMARK=63]="MALIGNMARK",t[t.MARQUEE=64]="MARQUEE",t[t.MATH=65]="MATH",t[t.MENU=66]="MENU",t[t.META=67]="META",t[t.MGLYPH=68]="MGLYPH",t[t.MI=69]="MI",t[t.MO=70]="MO",t[t.MN=71]="MN",t[t.MS=72]="MS",t[t.MTEXT=73]="MTEXT",t[t.NAV=74]="NAV",t[t.NOBR=75]="NOBR",t[t.NOFRAMES=76]="NOFRAMES",t[t.NOEMBED=77]="NOEMBED",t[t.NOSCRIPT=78]="NOSCRIPT",t[t.OBJECT=79]="OBJECT",t[t.OL=80]="OL",t[t.OPTGROUP=81]="OPTGROUP",t[t.OPTION=82]="OPTION",t[t.P=83]="P",t[t.PARAM=84]="PARAM",t[t.PLAINTEXT=85]="PLAINTEXT",t[t.PRE=86]="PRE",t[t.RB=87]="RB",t[t.RP=88]="RP",t[t.RT=89]="RT",t[t.RTC=90]="RTC",t[t.RUBY=91]="RUBY",t[t.S=92]="S",t[t.SCRIPT=93]="SCRIPT",t[t.SEARCH=94]="SEARCH",t[t.SECTION=95]="SECTION",t[t.SELECT=96]="SELECT",t[t.SOURCE=97]="SOURCE",t[t.SMALL=98]="SMALL",t[t.SPAN=99]="SPAN",t[t.STRIKE=100]="STRIKE",t[t.STRONG=101]="STRONG",t[t.STYLE=102]="STYLE",t[t.SUB=103]="SUB",t[t.SUMMARY=104]="SUMMARY",t[t.SUP=105]="SUP",t[t.TABLE=106]="TABLE",t[t.TBODY=107]="TBODY",t[t.TEMPLATE=108]="TEMPLATE",t[t.TEXTAREA=109]="TEXTAREA",t[t.TFOOT=110]="TFOOT",t[t.TD=111]="TD",t[t.TH=112]="TH",t[t.THEAD=113]="THEAD",t[t.TITLE=114]="TITLE",t[t.TR=115]="TR",t[t.TRACK=116]="TRACK",t[t.TT=117]="TT",t[t.U=118]="U",t[t.UL=119]="UL",t[t.SVG=120]="SVG",t[t.VAR=121]="VAR",t[t.WBR=122]="WBR",t[t.XMP=123]="XMP"})(O||(O={}));const she=new Map([[M.A,O.A],[M.ADDRESS,O.ADDRESS],[M.ANNOTATION_XML,O.ANNOTATION_XML],[M.APPLET,O.APPLET],[M.AREA,O.AREA],[M.ARTICLE,O.ARTICLE],[M.ASIDE,O.ASIDE],[M.B,O.B],[M.BASE,O.BASE],[M.BASEFONT,O.BASEFONT],[M.BGSOUND,O.BGSOUND],[M.BIG,O.BIG],[M.BLOCKQUOTE,O.BLOCKQUOTE],[M.BODY,O.BODY],[M.BR,O.BR],[M.BUTTON,O.BUTTON],[M.CAPTION,O.CAPTION],[M.CENTER,O.CENTER],[M.CODE,O.CODE],[M.COL,O.COL],[M.COLGROUP,O.COLGROUP],[M.DD,O.DD],[M.DESC,O.DESC],[M.DETAILS,O.DETAILS],[M.DIALOG,O.DIALOG],[M.DIR,O.DIR],[M.DIV,O.DIV],[M.DL,O.DL],[M.DT,O.DT],[M.EM,O.EM],[M.EMBED,O.EMBED],[M.FIELDSET,O.FIELDSET],[M.FIGCAPTION,O.FIGCAPTION],[M.FIGURE,O.FIGURE],[M.FONT,O.FONT],[M.FOOTER,O.FOOTER],[M.FOREIGN_OBJECT,O.FOREIGN_OBJECT],[M.FORM,O.FORM],[M.FRAME,O.FRAME],[M.FRAMESET,O.FRAMESET],[M.H1,O.H1],[M.H2,O.H2],[M.H3,O.H3],[M.H4,O.H4],[M.H5,O.H5],[M.H6,O.H6],[M.HEAD,O.HEAD],[M.HEADER,O.HEADER],[M.HGROUP,O.HGROUP],[M.HR,O.HR],[M.HTML,O.HTML],[M.I,O.I],[M.IMG,O.IMG],[M.IMAGE,O.IMAGE],[M.INPUT,O.INPUT],[M.IFRAME,O.IFRAME],[M.KEYGEN,O.KEYGEN],[M.LABEL,O.LABEL],[M.LI,O.LI],[M.LINK,O.LINK],[M.LISTING,O.LISTING],[M.MAIN,O.MAIN],[M.MALIGNMARK,O.MALIGNMARK],[M.MARQUEE,O.MARQUEE],[M.MATH,O.MATH],[M.MENU,O.MENU],[M.META,O.META],[M.MGLYPH,O.MGLYPH],[M.MI,O.MI],[M.MO,O.MO],[M.MN,O.MN],[M.MS,O.MS],[M.MTEXT,O.MTEXT],[M.NAV,O.NAV],[M.NOBR,O.NOBR],[M.NOFRAMES,O.NOFRAMES],[M.NOEMBED,O.NOEMBED],[M.NOSCRIPT,O.NOSCRIPT],[M.OBJECT,O.OBJECT],[M.OL,O.OL],[M.OPTGROUP,O.OPTGROUP],[M.OPTION,O.OPTION],[M.P,O.P],[M.PARAM,O.PARAM],[M.PLAINTEXT,O.PLAINTEXT],[M.PRE,O.PRE],[M.RB,O.RB],[M.RP,O.RP],[M.RT,O.RT],[M.RTC,O.RTC],[M.RUBY,O.RUBY],[M.S,O.S],[M.SCRIPT,O.SCRIPT],[M.SEARCH,O.SEARCH],[M.SECTION,O.SECTION],[M.SELECT,O.SELECT],[M.SOURCE,O.SOURCE],[M.SMALL,O.SMALL],[M.SPAN,O.SPAN],[M.STRIKE,O.STRIKE],[M.STRONG,O.STRONG],[M.STYLE,O.STYLE],[M.SUB,O.SUB],[M.SUMMARY,O.SUMMARY],[M.SUP,O.SUP],[M.TABLE,O.TABLE],[M.TBODY,O.TBODY],[M.TEMPLATE,O.TEMPLATE],[M.TEXTAREA,O.TEXTAREA],[M.TFOOT,O.TFOOT],[M.TD,O.TD],[M.TH,O.TH],[M.THEAD,O.THEAD],[M.TITLE,O.TITLE],[M.TR,O.TR],[M.TRACK,O.TRACK],[M.TT,O.TT],[M.U,O.U],[M.UL,O.UL],[M.SVG,O.SVG],[M.VAR,O.VAR],[M.WBR,O.WBR],[M.XMP,O.XMP]]);function Nm(t){var e;return(e=she.get(t))!==null&&e!==void 0?e:O.UNKNOWN}const W=O,ohe={[q.HTML]:new Set([W.ADDRESS,W.APPLET,W.AREA,W.ARTICLE,W.ASIDE,W.BASE,W.BASEFONT,W.BGSOUND,W.BLOCKQUOTE,W.BODY,W.BR,W.BUTTON,W.CAPTION,W.CENTER,W.COL,W.COLGROUP,W.DD,W.DETAILS,W.DIR,W.DIV,W.DL,W.DT,W.EMBED,W.FIELDSET,W.FIGCAPTION,W.FIGURE,W.FOOTER,W.FORM,W.FRAME,W.FRAMESET,W.H1,W.H2,W.H3,W.H4,W.H5,W.H6,W.HEAD,W.HEADER,W.HGROUP,W.HR,W.HTML,W.IFRAME,W.IMG,W.INPUT,W.LI,W.LINK,W.LISTING,W.MAIN,W.MARQUEE,W.MENU,W.META,W.NAV,W.NOEMBED,W.NOFRAMES,W.NOSCRIPT,W.OBJECT,W.OL,W.P,W.PARAM,W.PLAINTEXT,W.PRE,W.SCRIPT,W.SECTION,W.SELECT,W.SOURCE,W.STYLE,W.SUMMARY,W.TABLE,W.TBODY,W.TD,W.TEMPLATE,W.TEXTAREA,W.TFOOT,W.TH,W.THEAD,W.TITLE,W.TR,W.TRACK,W.UL,W.WBR,W.XMP]),[q.MATHML]:new Set([W.MI,W.MO,W.MN,W.MS,W.MTEXT,W.ANNOTATION_XML]),[q.SVG]:new Set([W.TITLE,W.FOREIGN_OBJECT,W.DESC]),[q.XLINK]:new Set,[q.XML]:new Set,[q.XMLNS]:new Set},rE=new Set([W.H1,W.H2,W.H3,W.H4,W.H5,W.H6]);M.STYLE,M.SCRIPT,M.XMP,M.IFRAME,M.NOEMBED,M.NOFRAMES,M.PLAINTEXT;var x;(function(t){t[t.DATA=0]="DATA",t[t.RCDATA=1]="RCDATA",t[t.RAWTEXT=2]="RAWTEXT",t[t.SCRIPT_DATA=3]="SCRIPT_DATA",t[t.PLAINTEXT=4]="PLAINTEXT",t[t.TAG_OPEN=5]="TAG_OPEN",t[t.END_TAG_OPEN=6]="END_TAG_OPEN",t[t.TAG_NAME=7]="TAG_NAME",t[t.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",t[t.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",t[t.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",t[t.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",t[t.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",t[t.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",t[t.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",t[t.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",t[t.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",t[t.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",t[t.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",t[t.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",t[t.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",t[t.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",t[t.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",t[t.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",t[t.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",t[t.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",t[t.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",t[t.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",t[t.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",t[t.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",t[t.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",t[t.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",t[t.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",t[t.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",t[t.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",t[t.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",t[t.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",t[t.BOGUS_COMMENT=40]="BOGUS_COMMENT",t[t.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",t[t.COMMENT_START=42]="COMMENT_START",t[t.COMMENT_START_DASH=43]="COMMENT_START_DASH",t[t.COMMENT=44]="COMMENT",t[t.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",t[t.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",t[t.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",t[t.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",t[t.COMMENT_END_DASH=49]="COMMENT_END_DASH",t[t.COMMENT_END=50]="COMMENT_END",t[t.COMMENT_END_BANG=51]="COMMENT_END_BANG",t[t.DOCTYPE=52]="DOCTYPE",t[t.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",t[t.DOCTYPE_NAME=54]="DOCTYPE_NAME",t[t.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",t[t.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",t[t.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",t[t.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",t[t.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",t[t.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",t[t.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",t[t.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",t[t.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",t[t.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",t[t.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",t[t.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",t[t.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",t[t.CDATA_SECTION=68]="CDATA_SECTION",t[t.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",t[t.CDATA_SECTION_END=70]="CDATA_SECTION_END",t[t.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",t[t.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(x||(x={}));const In={DATA:x.DATA,RCDATA:x.RCDATA,RAWTEXT:x.RAWTEXT,SCRIPT_DATA:x.SCRIPT_DATA,PLAINTEXT:x.PLAINTEXT,CDATA_SECTION:x.CDATA_SECTION};function ahe(t){return t>=_.DIGIT_0&&t<=_.DIGIT_9}function pc(t){return t>=_.LATIN_CAPITAL_A&&t<=_.LATIN_CAPITAL_Z}function lhe(t){return t>=_.LATIN_SMALL_A&&t<=_.LATIN_SMALL_Z}function gs(t){return lhe(t)||pc(t)}function dD(t){return gs(t)||ahe(t)}function pd(t){return t+32}function CF(t){return t===_.SPACE||t===_.LINE_FEED||t===_.TABULATION||t===_.FORM_FEED}function pD(t){return CF(t)||t===_.SOLIDUS||t===_.GREATER_THAN_SIGN}function che(t){return t===_.NULL?F.nullCharacterReference:t>1114111?F.characterReferenceOutsideUnicodeRange:wF(t)?F.surrogateCharacterReference:_F(t)?F.noncharacterCharacterReference:kF(t)||t===_.CARRIAGE_RETURN?F.controlCharacterReference:null}class uhe{constructor(e,n){this.options=e,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=x.DATA,this.returnState=x.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new Wue(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new rhe(Gue,(r,i)=>{this.preprocessor.pos=this.entityStartPos+i-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(F.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(F.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const i=che(r);i&&this._err(i,1)}}:void 0)}_err(e,n=0){var r,i;(i=(r=this.handler).onParseError)===null||i===void 0||i.call(r,this.preprocessor.getError(e,n))}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||(e==null||e()))}write(e,n,r){this.active=!0,this.preprocessor.write(e,n),this._runParsingLoop(),this.paused||(r==null||r())}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(e){this.consumedAfterSnapshot+=e;for(let n=0;n0&&this._err(F.endTagWithAttributes),e.selfClosing&&this._err(F.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case Fe.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case Fe.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case Fe.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:Fe.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===e){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(e,n)}_emitCodePoint(e){const n=CF(e)?Fe.WHITESPACE_CHARACTER:e===_.NULL?Fe.NULL_CHARACTER:Fe.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(Fe.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=x.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?Ii.Attribute:Ii.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===x.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===x.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===x.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case x.DATA:{this._stateData(e);break}case x.RCDATA:{this._stateRcdata(e);break}case x.RAWTEXT:{this._stateRawtext(e);break}case x.SCRIPT_DATA:{this._stateScriptData(e);break}case x.PLAINTEXT:{this._statePlaintext(e);break}case x.TAG_OPEN:{this._stateTagOpen(e);break}case x.END_TAG_OPEN:{this._stateEndTagOpen(e);break}case x.TAG_NAME:{this._stateTagName(e);break}case x.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(e);break}case x.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(e);break}case x.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(e);break}case x.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(e);break}case x.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(e);break}case x.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(e);break}case x.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(e);break}case x.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(e);break}case x.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(e);break}case x.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(e);break}case x.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(e);break}case x.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(e);break}case x.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(e);break}case x.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(e);break}case x.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(e);break}case x.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(e);break}case x.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(e);break}case x.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(e);break}case x.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(e);break}case x.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(e);break}case x.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(e);break}case x.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(e);break}case x.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(e);break}case x.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(e);break}case x.ATTRIBUTE_NAME:{this._stateAttributeName(e);break}case x.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(e);break}case x.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(e);break}case x.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(e);break}case x.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(e);break}case x.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(e);break}case x.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(e);break}case x.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(e);break}case x.BOGUS_COMMENT:{this._stateBogusComment(e);break}case x.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(e);break}case x.COMMENT_START:{this._stateCommentStart(e);break}case x.COMMENT_START_DASH:{this._stateCommentStartDash(e);break}case x.COMMENT:{this._stateComment(e);break}case x.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(e);break}case x.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(e);break}case x.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(e);break}case x.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(e);break}case x.COMMENT_END_DASH:{this._stateCommentEndDash(e);break}case x.COMMENT_END:{this._stateCommentEnd(e);break}case x.COMMENT_END_BANG:{this._stateCommentEndBang(e);break}case x.DOCTYPE:{this._stateDoctype(e);break}case x.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(e);break}case x.DOCTYPE_NAME:{this._stateDoctypeName(e);break}case x.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(e);break}case x.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(e);break}case x.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(e);break}case x.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(e);break}case x.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(e);break}case x.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(e);break}case x.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break}case x.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(e);break}case x.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(e);break}case x.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(e);break}case x.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(e);break}case x.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(e);break}case x.BOGUS_DOCTYPE:{this._stateBogusDoctype(e);break}case x.CDATA_SECTION:{this._stateCdataSection(e);break}case x.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(e);break}case x.CDATA_SECTION_END:{this._stateCdataSectionEnd(e);break}case x.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case x.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(e);break}default:throw new Error("Unknown state")}}_stateData(e){switch(e){case _.LESS_THAN_SIGN:{this.state=x.TAG_OPEN;break}case _.AMPERSAND:{this._startCharacterReference();break}case _.NULL:{this._err(F.unexpectedNullCharacter),this._emitCodePoint(e);break}case _.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case _.AMPERSAND:{this._startCharacterReference();break}case _.LESS_THAN_SIGN:{this.state=x.RCDATA_LESS_THAN_SIGN;break}case _.NULL:{this._err(F.unexpectedNullCharacter),this._emitChars(dt);break}case _.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case _.LESS_THAN_SIGN:{this.state=x.RAWTEXT_LESS_THAN_SIGN;break}case _.NULL:{this._err(F.unexpectedNullCharacter),this._emitChars(dt);break}case _.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case _.LESS_THAN_SIGN:{this.state=x.SCRIPT_DATA_LESS_THAN_SIGN;break}case _.NULL:{this._err(F.unexpectedNullCharacter),this._emitChars(dt);break}case _.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case _.NULL:{this._err(F.unexpectedNullCharacter),this._emitChars(dt);break}case _.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateTagOpen(e){if(gs(e))this._createStartTagToken(),this.state=x.TAG_NAME,this._stateTagName(e);else switch(e){case _.EXCLAMATION_MARK:{this.state=x.MARKUP_DECLARATION_OPEN;break}case _.SOLIDUS:{this.state=x.END_TAG_OPEN;break}case _.QUESTION_MARK:{this._err(F.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=x.BOGUS_COMMENT,this._stateBogusComment(e);break}case _.EOF:{this._err(F.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(F.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=x.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(gs(e))this._createEndTagToken(),this.state=x.TAG_NAME,this._stateTagName(e);else switch(e){case _.GREATER_THAN_SIGN:{this._err(F.missingEndTagName),this.state=x.DATA;break}case _.EOF:{this._err(F.eofBeforeTagName),this._emitChars("");break}case _.NULL:{this._err(F.unexpectedNullCharacter),this.state=x.SCRIPT_DATA_ESCAPED,this._emitChars(dt);break}case _.EOF:{this._err(F.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=x.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===_.SOLIDUS?this.state=x.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:gs(e)?(this._emitChars("<"),this.state=x.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars("<"),this.state=x.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){gs(e)?(this.state=x.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars("");break}case _.NULL:{this._err(F.unexpectedNullCharacter),this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(dt);break}case _.EOF:{this._err(F.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===_.SOLIDUS?(this.state=x.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(Pn.SCRIPT,!1)&&pD(this.preprocessor.peek(Pn.SCRIPT.length))){this._emitCodePoint(e);for(let n=0;n0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,n){const r=this._indexOf(e);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(e,n,r){const i=this._indexOf(e)+1;this.items.splice(i,0,n),this.tagIDs.splice(i,0,r),this.stackTop++,i===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,i===this.stackTop)}popUntilTagNamePopped(e){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(e,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==q.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(e){for(;this.stackTop>=e;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop=0;r--)if(e.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(e,n){const r=this._indexOfTagNames(e,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(mhe,q.HTML)}clearBackToTableBodyContext(){this.clearBackTo(fhe,q.HTML)}clearBackToTableRowContext(){this.clearBackTo(phe,q.HTML)}remove(e){const n=this._indexOf(e);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===O.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){const n=this._indexOf(e)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===O.HTML}hasInDynamicScope(e,n){for(let r=this.stackTop;r>=0;r--){const i=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case q.HTML:{if(i===e)return!0;if(n.has(i))return!1;break}case q.SVG:{if(gD.has(i))return!1;break}case q.MATHML:{if(mD.has(i))return!1;break}}}return!0}hasInScope(e){return this.hasInDynamicScope(e,df)}hasInListItemScope(e){return this.hasInDynamicScope(e,hhe)}hasInButtonScope(e){return this.hasInDynamicScope(e,dhe)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){const n=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case q.HTML:{if(rE.has(n))return!0;if(df.has(n))return!1;break}case q.SVG:{if(gD.has(n))return!1;break}case q.MATHML:{if(mD.has(n))return!1;break}}}return!0}hasInTableScope(e){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===q.HTML)switch(this.tagIDs[n]){case e:return!0;case O.TABLE:case O.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===q.HTML)switch(this.tagIDs[e]){case O.TBODY:case O.THEAD:case O.TFOOT:return!0;case O.TABLE:case O.HTML:return!1}return!0}hasInSelectScope(e){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===q.HTML)switch(this.tagIDs[n]){case e:return!0;case O.OPTION:case O.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&DF.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&fD.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&fD.has(this.currentTagId);)this.pop()}}const MO=3;var Kr;(function(t){t[t.Marker=0]="Marker",t[t.Element=1]="Element"})(Kr||(Kr={}));const OD={type:Kr.Marker};class yhe{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,n){const r=[],i=n.length,s=this.treeAdapter.getTagName(e),o=this.treeAdapter.getNamespaceURI(e);for(let a=0;a[o.name,o.value]));let s=0;for(let o=0;oi.get(l.name)===l.value)&&(s+=1,s>=MO&&this.entries.splice(a.idx,1))}}insertMarker(){this.entries.unshift(OD)}pushElement(e,n){this._ensureNoahArkCondition(e),this.entries.unshift({type:Kr.Element,element:e,token:n})}insertElementAfterBookmark(e,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:Kr.Element,element:e,token:n})}removeEntry(e){const n=this.entries.indexOf(e);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const e=this.entries.indexOf(OD);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){const n=this.entries.find(r=>r.type===Kr.Marker||this.treeAdapter.getTagName(r.element)===e);return n&&n.type===Kr.Element?n:null}getElementEntry(e){return this.entries.find(n=>n.type===Kr.Element&&n.element===e)}}const Os={createDocument(){return{nodeName:"#document",mode:or.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(t,e,n){return{nodeName:t,tagName:t,attrs:n,namespaceURI:e,childNodes:[],parentNode:null}},createCommentNode(t){return{nodeName:"#comment",data:t,parentNode:null}},createTextNode(t){return{nodeName:"#text",value:t,parentNode:null}},appendChild(t,e){t.childNodes.push(e),e.parentNode=t},insertBefore(t,e,n){const r=t.childNodes.indexOf(n);t.childNodes.splice(r,0,e),e.parentNode=t},setTemplateContent(t,e){t.content=e},getTemplateContent(t){return t.content},setDocumentType(t,e,n,r){const i=t.childNodes.find(s=>s.nodeName==="#documentType");if(i)i.name=e,i.publicId=n,i.systemId=r;else{const s={nodeName:"#documentType",name:e,publicId:n,systemId:r,parentNode:null};Os.appendChild(t,s)}},setDocumentMode(t,e){t.mode=e},getDocumentMode(t){return t.mode},detachNode(t){if(t.parentNode){const e=t.parentNode.childNodes.indexOf(t);t.parentNode.childNodes.splice(e,1),t.parentNode=null}},insertText(t,e){if(t.childNodes.length>0){const n=t.childNodes[t.childNodes.length-1];if(Os.isTextNode(n)){n.value+=e;return}}Os.appendChild(t,Os.createTextNode(e))},insertTextBefore(t,e,n){const r=t.childNodes[t.childNodes.indexOf(n)-1];r&&Os.isTextNode(r)?r.value+=e:Os.insertBefore(t,Os.createTextNode(e),n)},adoptAttributes(t,e){const n=new Set(t.attrs.map(r=>r.name));for(let r=0;rt.startsWith(n))}function whe(t){return t.name===AF&&t.publicId===null&&(t.systemId===null||t.systemId===bhe)}function khe(t){if(t.name!==AF)return or.QUIRKS;const{systemId:e}=t;if(e&&e.toLowerCase()===Ehe)return or.QUIRKS;let{publicId:n}=t;if(n!==null){if(n=n.toLowerCase(),The.has(n))return or.QUIRKS;let r=e===null?vhe:PF;if(yD(n,r))return or.QUIRKS;if(r=e===null?NF:She,yD(n,r))return or.LIMITED_QUIRKS}return or.NO_QUIRKS}const bD={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},_he="definitionurl",xhe="definitionURL",Che=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(t=>[t.toLowerCase(),t])),Dhe=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:q.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:q.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:q.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:q.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:q.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:q.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:q.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:q.XML}],["xml:space",{prefix:"xml",name:"space",namespace:q.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:q.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:q.XMLNS}]]),Ahe=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(t=>[t.toLowerCase(),t])),Phe=new Set([O.B,O.BIG,O.BLOCKQUOTE,O.BODY,O.BR,O.CENTER,O.CODE,O.DD,O.DIV,O.DL,O.DT,O.EM,O.EMBED,O.H1,O.H2,O.H3,O.H4,O.H5,O.H6,O.HEAD,O.HR,O.I,O.IMG,O.LI,O.LISTING,O.MENU,O.META,O.NOBR,O.OL,O.P,O.PRE,O.RUBY,O.S,O.SMALL,O.SPAN,O.STRONG,O.STRIKE,O.SUB,O.SUP,O.TABLE,O.TT,O.U,O.UL,O.VAR]);function Nhe(t){const e=t.tagID;return e===O.FONT&&t.attrs.some(({name:n})=>n===No.COLOR||n===No.SIZE||n===No.FACE)||Phe.has(e)}function RF(t){for(let e=0;e0&&this._setContextModes(e,n)}onItemPop(e,n){var r,i;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),(i=(r=this.treeAdapter).onItemPop)===null||i===void 0||i.call(r,e,this.openElements.current),n){let s,o;this.openElements.stackTop===0&&this.fragmentContext?(s=this.fragmentContext,o=this.fragmentContextID):{current:s,currentTagId:o}=this.openElements,this._setContextModes(s,o)}}_setContextModes(e,n){const r=e===this.document||e&&this.treeAdapter.getNamespaceURI(e)===q.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&e!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,e)}_switchToTextParsing(e,n){this._insertElement(e,q.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=D.TEXT}switchToPlaintextParsing(){this.insertionMode=D.TEXT,this.originalInsertionMode=D.IN_BODY,this.tokenizer.state=In.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;for(;e;){if(this.treeAdapter.getTagName(e)===M.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==q.HTML))switch(this.fragmentContextID){case O.TITLE:case O.TEXTAREA:{this.tokenizer.state=In.RCDATA;break}case O.STYLE:case O.XMP:case O.IFRAME:case O.NOEMBED:case O.NOFRAMES:case O.NOSCRIPT:{this.tokenizer.state=In.RAWTEXT;break}case O.SCRIPT:{this.tokenizer.state=In.SCRIPT_DATA;break}case O.PLAINTEXT:{this.tokenizer.state=In.PLAINTEXT;break}}}_setDocumentType(e){const n=e.name||"",r=e.publicId||"",i=e.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,i),e.location){const s=this.treeAdapter.getChildNodes(this.document).find(o=>this.treeAdapter.isDocumentTypeNode(o));s&&this.treeAdapter.setNodeSourceCodeLocation(s,e.location)}}_attachElementToTree(e,n){if(this.options.sourceCodeLocationInfo){const r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(e,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r??this.document,e)}}_appendElement(e,n){const r=this.treeAdapter.createElement(e.tagName,n,e.attrs);this._attachElementToTree(r,e.location)}_insertElement(e,n){const r=this.treeAdapter.createElement(e.tagName,n,e.attrs);this._attachElementToTree(r,e.location),this.openElements.push(r,e.tagID)}_insertFakeElement(e,n){const r=this.treeAdapter.createElement(e,q.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(e){const n=this.treeAdapter.createElement(e.tagName,q.HTML,e.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,e.location),this.openElements.push(n,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const e=this.treeAdapter.createElement(M.HTML,q.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,O.HTML)}_appendCommentNode(e,n){const r=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,e.location)}_insertCharacters(e){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,e.chars,r):this.treeAdapter.insertText(n,e.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,e.chars)),!e.location)return;const i=this.treeAdapter.getChildNodes(n),s=r?i.lastIndexOf(r):i.length,o=i[s-1];if(this.treeAdapter.getNodeSourceCodeLocation(o)){const{endLine:a,endCol:l,endOffset:c}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(o,{endLine:a,endCol:l,endOffset:c})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(o,e.location)}_adoptNodes(e,n){for(let r=this.treeAdapter.getFirstChild(e);r;r=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(e,n){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&n.location){const r=n.location,i=this.treeAdapter.getTagName(e),s=n.type===Fe.END_TAG&&i===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,s)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,e.tagID===O.SVG&&this.treeAdapter.getTagName(n)===M.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===q.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===O.MGLYPH||e.tagID===O.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,q.HTML)}_processToken(e){switch(e.type){case Fe.CHARACTER:{this.onCharacter(e);break}case Fe.NULL_CHARACTER:{this.onNullCharacter(e);break}case Fe.COMMENT:{this.onComment(e);break}case Fe.DOCTYPE:{this.onDoctype(e);break}case Fe.START_TAG:{this._processStartTag(e);break}case Fe.END_TAG:{this.onEndTag(e);break}case Fe.EOF:{this.onEof(e);break}case Fe.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(e);break}}}_isIntegrationPoint(e,n,r){const i=this.treeAdapter.getNamespaceURI(n),s=this.treeAdapter.getAttrList(n);return Lhe(e,i,s,r)}_reconstructActiveFormattingElements(){const e=this.activeFormattingElements.entries.length;if(e){const n=this.activeFormattingElements.entries.findIndex(i=>i.type===Kr.Marker||this.openElements.contains(i.element)),r=n===-1?e-1:n-1;for(let i=r;i>=0;i--){const s=this.activeFormattingElements.entries[i];this._insertElement(s.token,this.treeAdapter.getNamespaceURI(s.element)),s.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=D.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(O.P),this.openElements.popUntilTagNamePopped(O.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case O.TR:{this.insertionMode=D.IN_ROW;return}case O.TBODY:case O.THEAD:case O.TFOOT:{this.insertionMode=D.IN_TABLE_BODY;return}case O.CAPTION:{this.insertionMode=D.IN_CAPTION;return}case O.COLGROUP:{this.insertionMode=D.IN_COLUMN_GROUP;return}case O.TABLE:{this.insertionMode=D.IN_TABLE;return}case O.BODY:{this.insertionMode=D.IN_BODY;return}case O.FRAMESET:{this.insertionMode=D.IN_FRAMESET;return}case O.SELECT:{this._resetInsertionModeForSelect(e);return}case O.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case O.HTML:{this.insertionMode=this.headElement?D.AFTER_HEAD:D.BEFORE_HEAD;return}case O.TD:case O.TH:{if(e>0){this.insertionMode=D.IN_CELL;return}break}case O.HEAD:{if(e>0){this.insertionMode=D.IN_HEAD;return}break}}this.insertionMode=D.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let n=e-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===O.TEMPLATE)break;if(r===O.TABLE){this.insertionMode=D.IN_SELECT_IN_TABLE;return}}this.insertionMode=D.IN_SELECT}_isElementCausesFosterParenting(e){return IF.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){const n=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case O.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===q.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case O.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[e-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,e,n.beforeElement):this.treeAdapter.appendChild(n.parent,e)}_isSpecialElement(e,n){const r=this.treeAdapter.getNamespaceURI(e);return ohe[r].has(n)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){gpe(this,e);return}switch(this.insertionMode){case D.INITIAL:{ql(this,e);break}case D.BEFORE_HTML:{$c(this,e);break}case D.BEFORE_HEAD:{Fc(this,e);break}case D.IN_HEAD:{Bc(this,e);break}case D.IN_HEAD_NO_SCRIPT:{jc(this,e);break}case D.AFTER_HEAD:{zc(this,e);break}case D.IN_BODY:case D.IN_CAPTION:case D.IN_CELL:case D.IN_TEMPLATE:{$F(this,e);break}case D.TEXT:case D.IN_SELECT:case D.IN_SELECT_IN_TABLE:{this._insertCharacters(e);break}case D.IN_TABLE:case D.IN_TABLE_BODY:case D.IN_ROW:{IO(this,e);break}case D.IN_TABLE_TEXT:{UF(this,e);break}case D.IN_COLUMN_GROUP:{pf(this,e);break}case D.AFTER_BODY:{ff(this,e);break}case D.AFTER_AFTER_BODY:{Zd(this,e);break}}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){mpe(this,e);return}switch(this.insertionMode){case D.INITIAL:{ql(this,e);break}case D.BEFORE_HTML:{$c(this,e);break}case D.BEFORE_HEAD:{Fc(this,e);break}case D.IN_HEAD:{Bc(this,e);break}case D.IN_HEAD_NO_SCRIPT:{jc(this,e);break}case D.AFTER_HEAD:{zc(this,e);break}case D.TEXT:{this._insertCharacters(e);break}case D.IN_TABLE:case D.IN_TABLE_BODY:case D.IN_ROW:{IO(this,e);break}case D.IN_COLUMN_GROUP:{pf(this,e);break}case D.AFTER_BODY:{ff(this,e);break}case D.AFTER_AFTER_BODY:{Zd(this,e);break}}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){iE(this,e);return}switch(this.insertionMode){case D.INITIAL:case D.BEFORE_HTML:case D.BEFORE_HEAD:case D.IN_HEAD:case D.IN_HEAD_NO_SCRIPT:case D.AFTER_HEAD:case D.IN_BODY:case D.IN_TABLE:case D.IN_CAPTION:case D.IN_COLUMN_GROUP:case D.IN_TABLE_BODY:case D.IN_ROW:case D.IN_CELL:case D.IN_SELECT:case D.IN_SELECT_IN_TABLE:case D.IN_TEMPLATE:case D.IN_FRAMESET:case D.AFTER_FRAMESET:{iE(this,e);break}case D.IN_TABLE_TEXT:{Zl(this,e);break}case D.AFTER_BODY:{qhe(this,e);break}case D.AFTER_AFTER_BODY:case D.AFTER_AFTER_FRAMESET:{Zhe(this,e);break}}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case D.INITIAL:{Whe(this,e);break}case D.BEFORE_HEAD:case D.IN_HEAD:case D.IN_HEAD_NO_SCRIPT:case D.AFTER_HEAD:{this._err(e,F.misplacedDoctype);break}case D.IN_TABLE_TEXT:{Zl(this,e);break}}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,F.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?Ope(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case D.INITIAL:{ql(this,e);break}case D.BEFORE_HTML:{Ghe(this,e);break}case D.BEFORE_HEAD:{Khe(this,e);break}case D.IN_HEAD:{Lr(this,e);break}case D.IN_HEAD_NO_SCRIPT:{tde(this,e);break}case D.AFTER_HEAD:{rde(this,e);break}case D.IN_BODY:{vn(this,e);break}case D.IN_TABLE:{hl(this,e);break}case D.IN_TABLE_TEXT:{Zl(this,e);break}case D.IN_CAPTION:{Jde(this,e);break}case D.IN_COLUMN_GROUP:{eS(this,e);break}case D.IN_TABLE_BODY:{Im(this,e);break}case D.IN_ROW:{Lm(this,e);break}case D.IN_CELL:{npe(this,e);break}case D.IN_SELECT:{qF(this,e);break}case D.IN_SELECT_IN_TABLE:{ipe(this,e);break}case D.IN_TEMPLATE:{ope(this,e);break}case D.AFTER_BODY:{lpe(this,e);break}case D.IN_FRAMESET:{cpe(this,e);break}case D.AFTER_FRAMESET:{hpe(this,e);break}case D.AFTER_AFTER_BODY:{ppe(this,e);break}case D.AFTER_AFTER_FRAMESET:{fpe(this,e);break}}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?ype(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case D.INITIAL:{ql(this,e);break}case D.BEFORE_HTML:{Yhe(this,e);break}case D.BEFORE_HEAD:{Jhe(this,e);break}case D.IN_HEAD:{ede(this,e);break}case D.IN_HEAD_NO_SCRIPT:{nde(this,e);break}case D.AFTER_HEAD:{ide(this,e);break}case D.IN_BODY:{Mm(this,e);break}case D.TEXT:{Vde(this,e);break}case D.IN_TABLE:{xu(this,e);break}case D.IN_TABLE_TEXT:{Zl(this,e);break}case D.IN_CAPTION:{epe(this,e);break}case D.IN_COLUMN_GROUP:{tpe(this,e);break}case D.IN_TABLE_BODY:{sE(this,e);break}case D.IN_ROW:{XF(this,e);break}case D.IN_CELL:{rpe(this,e);break}case D.IN_SELECT:{ZF(this,e);break}case D.IN_SELECT_IN_TABLE:{spe(this,e);break}case D.IN_TEMPLATE:{ape(this,e);break}case D.AFTER_BODY:{GF(this,e);break}case D.IN_FRAMESET:{upe(this,e);break}case D.AFTER_FRAMESET:{dpe(this,e);break}case D.AFTER_AFTER_BODY:{Zd(this,e);break}}}onEof(e){switch(this.insertionMode){case D.INITIAL:{ql(this,e);break}case D.BEFORE_HTML:{$c(this,e);break}case D.BEFORE_HEAD:{Fc(this,e);break}case D.IN_HEAD:{Bc(this,e);break}case D.IN_HEAD_NO_SCRIPT:{jc(this,e);break}case D.AFTER_HEAD:{zc(this,e);break}case D.IN_BODY:case D.IN_TABLE:case D.IN_CAPTION:case D.IN_COLUMN_GROUP:case D.IN_TABLE_BODY:case D.IN_ROW:case D.IN_CELL:case D.IN_SELECT:case D.IN_SELECT_IN_TABLE:{zF(this,e);break}case D.TEXT:{Ude(this,e);break}case D.IN_TABLE_TEXT:{Zl(this,e);break}case D.IN_TEMPLATE:{WF(this,e);break}case D.AFTER_BODY:case D.IN_FRAMESET:case D.AFTER_FRAMESET:case D.AFTER_AFTER_BODY:case D.AFTER_AFTER_FRAMESET:{JT(this,e);break}}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===_.LINE_FEED)){if(e.chars.length===1)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(e);return}switch(this.insertionMode){case D.IN_HEAD:case D.IN_HEAD_NO_SCRIPT:case D.AFTER_HEAD:case D.TEXT:case D.IN_COLUMN_GROUP:case D.IN_SELECT:case D.IN_SELECT_IN_TABLE:case D.IN_FRAMESET:case D.AFTER_FRAMESET:{this._insertCharacters(e);break}case D.IN_BODY:case D.IN_CAPTION:case D.IN_CELL:case D.IN_TEMPLATE:case D.AFTER_BODY:case D.AFTER_AFTER_BODY:case D.AFTER_AFTER_FRAMESET:{QF(this,e);break}case D.IN_TABLE:case D.IN_TABLE_BODY:case D.IN_ROW:{IO(this,e);break}case D.IN_TABLE_TEXT:{VF(this,e);break}}}}function jhe(t,e){let n=t.activeFormattingElements.getElementEntryInScopeWithTagName(e.tagName);return n?t.openElements.contains(n.element)?t.openElements.hasInScope(e.tagID)||(n=null):(t.activeFormattingElements.removeEntry(n),n=null):jF(t,e),n}function zhe(t,e){let n=null,r=t.openElements.stackTop;for(;r>=0;r--){const i=t.openElements.items[r];if(i===e.element)break;t._isSpecialElement(i,t.openElements.tagIDs[r])&&(n=i)}return n||(t.openElements.shortenToLength(Math.max(r,0)),t.activeFormattingElements.removeEntry(e)),n}function Vhe(t,e,n){let r=e,i=t.openElements.getCommonAncestor(e);for(let s=0,o=i;o!==n;s++,o=i){i=t.openElements.getCommonAncestor(o);const a=t.activeFormattingElements.getElementEntry(o),l=a&&s>=Fhe;!a||l?(l&&t.activeFormattingElements.removeEntry(a),t.openElements.remove(o)):(o=Uhe(t,a),r===e&&(t.activeFormattingElements.bookmark=a),t.treeAdapter.detachNode(r),t.treeAdapter.appendChild(o,r),r=o)}return r}function Uhe(t,e){const n=t.treeAdapter.getNamespaceURI(e.element),r=t.treeAdapter.createElement(e.token.tagName,n,e.token.attrs);return t.openElements.replace(e.element,r),e.element=r,r}function Hhe(t,e,n){const r=t.treeAdapter.getTagName(e),i=Nm(r);if(t._isElementCausesFosterParenting(i))t._fosterParentElement(n);else{const s=t.treeAdapter.getNamespaceURI(e);i===O.TEMPLATE&&s===q.HTML&&(e=t.treeAdapter.getTemplateContent(e)),t.treeAdapter.appendChild(e,n)}}function Xhe(t,e,n){const r=t.treeAdapter.getNamespaceURI(n.element),{token:i}=n,s=t.treeAdapter.createElement(i.tagName,r,i.attrs);t._adoptNodes(e,s),t.treeAdapter.appendChild(e,s),t.activeFormattingElements.insertElementAfterBookmark(s,i),t.activeFormattingElements.removeEntry(n),t.openElements.remove(n.element),t.openElements.insertAfter(e,s,i.tagID)}function KT(t,e){for(let n=0;n<$he;n++){const r=jhe(t,e);if(!r)break;const i=zhe(t,r);if(!i)break;t.activeFormattingElements.bookmark=r;const s=Vhe(t,i,r.element),o=t.openElements.getCommonAncestor(r.element);t.treeAdapter.detachNode(s),o&&Hhe(t,o,s),Xhe(t,i,r)}}function iE(t,e){t._appendCommentNode(e,t.openElements.currentTmplContentOrNode)}function qhe(t,e){t._appendCommentNode(e,t.openElements.items[0])}function Zhe(t,e){t._appendCommentNode(e,t.document)}function JT(t,e){if(t.stopped=!0,e.location){const n=t.fragmentContext?0:2;for(let r=t.openElements.stackTop;r>=n;r--)t._setEndLocation(t.openElements.items[r],e);if(!t.fragmentContext&&t.openElements.stackTop>=0){const r=t.openElements.items[0],i=t.treeAdapter.getNodeSourceCodeLocation(r);if(i&&!i.endTag&&(t._setEndLocation(r,e),t.openElements.stackTop>=1)){const s=t.openElements.items[1],o=t.treeAdapter.getNodeSourceCodeLocation(s);o&&!o.endTag&&t._setEndLocation(s,e)}}}}function Whe(t,e){t._setDocumentType(e);const n=e.forceQuirks?or.QUIRKS:khe(e);whe(e)||t._err(e,F.nonConformingDoctype),t.treeAdapter.setDocumentMode(t.document,n),t.insertionMode=D.BEFORE_HTML}function ql(t,e){t._err(e,F.missingDoctype,!0),t.treeAdapter.setDocumentMode(t.document,or.QUIRKS),t.insertionMode=D.BEFORE_HTML,t._processToken(e)}function Ghe(t,e){e.tagID===O.HTML?(t._insertElement(e,q.HTML),t.insertionMode=D.BEFORE_HEAD):$c(t,e)}function Yhe(t,e){const n=e.tagID;(n===O.HTML||n===O.HEAD||n===O.BODY||n===O.BR)&&$c(t,e)}function $c(t,e){t._insertFakeRootElement(),t.insertionMode=D.BEFORE_HEAD,t._processToken(e)}function Khe(t,e){switch(e.tagID){case O.HTML:{vn(t,e);break}case O.HEAD:{t._insertElement(e,q.HTML),t.headElement=t.openElements.current,t.insertionMode=D.IN_HEAD;break}default:Fc(t,e)}}function Jhe(t,e){const n=e.tagID;n===O.HEAD||n===O.BODY||n===O.HTML||n===O.BR?Fc(t,e):t._err(e,F.endTagWithoutMatchingOpenElement)}function Fc(t,e){t._insertFakeElement(M.HEAD,O.HEAD),t.headElement=t.openElements.current,t.insertionMode=D.IN_HEAD,t._processToken(e)}function Lr(t,e){switch(e.tagID){case O.HTML:{vn(t,e);break}case O.BASE:case O.BASEFONT:case O.BGSOUND:case O.LINK:case O.META:{t._appendElement(e,q.HTML),e.ackSelfClosing=!0;break}case O.TITLE:{t._switchToTextParsing(e,In.RCDATA);break}case O.NOSCRIPT:{t.options.scriptingEnabled?t._switchToTextParsing(e,In.RAWTEXT):(t._insertElement(e,q.HTML),t.insertionMode=D.IN_HEAD_NO_SCRIPT);break}case O.NOFRAMES:case O.STYLE:{t._switchToTextParsing(e,In.RAWTEXT);break}case O.SCRIPT:{t._switchToTextParsing(e,In.SCRIPT_DATA);break}case O.TEMPLATE:{t._insertTemplate(e),t.activeFormattingElements.insertMarker(),t.framesetOk=!1,t.insertionMode=D.IN_TEMPLATE,t.tmplInsertionModeStack.unshift(D.IN_TEMPLATE);break}case O.HEAD:{t._err(e,F.misplacedStartTagForHeadElement);break}default:Bc(t,e)}}function ede(t,e){switch(e.tagID){case O.HEAD:{t.openElements.pop(),t.insertionMode=D.AFTER_HEAD;break}case O.BODY:case O.BR:case O.HTML:{Bc(t,e);break}case O.TEMPLATE:{ia(t,e);break}default:t._err(e,F.endTagWithoutMatchingOpenElement)}}function ia(t,e){t.openElements.tmplCount>0?(t.openElements.generateImpliedEndTagsThoroughly(),t.openElements.currentTagId!==O.TEMPLATE&&t._err(e,F.closingOfElementWithOpenChildElements),t.openElements.popUntilTagNamePopped(O.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode()):t._err(e,F.endTagWithoutMatchingOpenElement)}function Bc(t,e){t.openElements.pop(),t.insertionMode=D.AFTER_HEAD,t._processToken(e)}function tde(t,e){switch(e.tagID){case O.HTML:{vn(t,e);break}case O.BASEFONT:case O.BGSOUND:case O.HEAD:case O.LINK:case O.META:case O.NOFRAMES:case O.STYLE:{Lr(t,e);break}case O.NOSCRIPT:{t._err(e,F.nestedNoscriptInHead);break}default:jc(t,e)}}function nde(t,e){switch(e.tagID){case O.NOSCRIPT:{t.openElements.pop(),t.insertionMode=D.IN_HEAD;break}case O.BR:{jc(t,e);break}default:t._err(e,F.endTagWithoutMatchingOpenElement)}}function jc(t,e){const n=e.type===Fe.EOF?F.openElementsLeftAfterEof:F.disallowedContentInNoscriptInHead;t._err(e,n),t.openElements.pop(),t.insertionMode=D.IN_HEAD,t._processToken(e)}function rde(t,e){switch(e.tagID){case O.HTML:{vn(t,e);break}case O.BODY:{t._insertElement(e,q.HTML),t.framesetOk=!1,t.insertionMode=D.IN_BODY;break}case O.FRAMESET:{t._insertElement(e,q.HTML),t.insertionMode=D.IN_FRAMESET;break}case O.BASE:case O.BASEFONT:case O.BGSOUND:case O.LINK:case O.META:case O.NOFRAMES:case O.SCRIPT:case O.STYLE:case O.TEMPLATE:case O.TITLE:{t._err(e,F.abandonedHeadElementChild),t.openElements.push(t.headElement,O.HEAD),Lr(t,e),t.openElements.remove(t.headElement);break}case O.HEAD:{t._err(e,F.misplacedStartTagForHeadElement);break}default:zc(t,e)}}function ide(t,e){switch(e.tagID){case O.BODY:case O.HTML:case O.BR:{zc(t,e);break}case O.TEMPLATE:{ia(t,e);break}default:t._err(e,F.endTagWithoutMatchingOpenElement)}}function zc(t,e){t._insertFakeElement(M.BODY,O.BODY),t.insertionMode=D.IN_BODY,Rm(t,e)}function Rm(t,e){switch(e.type){case Fe.CHARACTER:{$F(t,e);break}case Fe.WHITESPACE_CHARACTER:{QF(t,e);break}case Fe.COMMENT:{iE(t,e);break}case Fe.START_TAG:{vn(t,e);break}case Fe.END_TAG:{Mm(t,e);break}case Fe.EOF:{zF(t,e);break}}}function QF(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e)}function $F(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e),t.framesetOk=!1}function sde(t,e){t.openElements.tmplCount===0&&t.treeAdapter.adoptAttributes(t.openElements.items[0],e.attrs)}function ode(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t.openElements.tmplCount===0&&(t.framesetOk=!1,t.treeAdapter.adoptAttributes(n,e.attrs))}function ade(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();t.framesetOk&&n&&(t.treeAdapter.detachNode(n),t.openElements.popAllUpToHtmlElement(),t._insertElement(e,q.HTML),t.insertionMode=D.IN_FRAMESET)}function lde(t,e){t.openElements.hasInButtonScope(O.P)&&t._closePElement(),t._insertElement(e,q.HTML)}function cde(t,e){t.openElements.hasInButtonScope(O.P)&&t._closePElement(),t.openElements.currentTagId!==void 0&&rE.has(t.openElements.currentTagId)&&t.openElements.pop(),t._insertElement(e,q.HTML)}function ude(t,e){t.openElements.hasInButtonScope(O.P)&&t._closePElement(),t._insertElement(e,q.HTML),t.skipNextNewLine=!0,t.framesetOk=!1}function hde(t,e){const n=t.openElements.tmplCount>0;(!t.formElement||n)&&(t.openElements.hasInButtonScope(O.P)&&t._closePElement(),t._insertElement(e,q.HTML),n||(t.formElement=t.openElements.current))}function dde(t,e){t.framesetOk=!1;const n=e.tagID;for(let r=t.openElements.stackTop;r>=0;r--){const i=t.openElements.tagIDs[r];if(n===O.LI&&i===O.LI||(n===O.DD||n===O.DT)&&(i===O.DD||i===O.DT)){t.openElements.generateImpliedEndTagsWithExclusion(i),t.openElements.popUntilTagNamePopped(i);break}if(i!==O.ADDRESS&&i!==O.DIV&&i!==O.P&&t._isSpecialElement(t.openElements.items[r],i))break}t.openElements.hasInButtonScope(O.P)&&t._closePElement(),t._insertElement(e,q.HTML)}function pde(t,e){t.openElements.hasInButtonScope(O.P)&&t._closePElement(),t._insertElement(e,q.HTML),t.tokenizer.state=In.PLAINTEXT}function fde(t,e){t.openElements.hasInScope(O.BUTTON)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(O.BUTTON)),t._reconstructActiveFormattingElements(),t._insertElement(e,q.HTML),t.framesetOk=!1}function mde(t,e){const n=t.activeFormattingElements.getElementEntryInScopeWithTagName(M.A);n&&(KT(t,e),t.openElements.remove(n.element),t.activeFormattingElements.removeEntry(n)),t._reconstructActiveFormattingElements(),t._insertElement(e,q.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function gde(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,q.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function Ode(t,e){t._reconstructActiveFormattingElements(),t.openElements.hasInScope(O.NOBR)&&(KT(t,e),t._reconstructActiveFormattingElements()),t._insertElement(e,q.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function yde(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,q.HTML),t.activeFormattingElements.insertMarker(),t.framesetOk=!1}function bde(t,e){t.treeAdapter.getDocumentMode(t.document)!==or.QUIRKS&&t.openElements.hasInButtonScope(O.P)&&t._closePElement(),t._insertElement(e,q.HTML),t.framesetOk=!1,t.insertionMode=D.IN_TABLE}function FF(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,q.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function BF(t){const e=xF(t,No.TYPE);return e!=null&&e.toLowerCase()===Qhe}function Ede(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,q.HTML),BF(e)||(t.framesetOk=!1),e.ackSelfClosing=!0}function vde(t,e){t._appendElement(e,q.HTML),e.ackSelfClosing=!0}function Tde(t,e){t.openElements.hasInButtonScope(O.P)&&t._closePElement(),t._appendElement(e,q.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function Sde(t,e){e.tagName=M.IMG,e.tagID=O.IMG,FF(t,e)}function wde(t,e){t._insertElement(e,q.HTML),t.skipNextNewLine=!0,t.tokenizer.state=In.RCDATA,t.originalInsertionMode=t.insertionMode,t.framesetOk=!1,t.insertionMode=D.TEXT}function kde(t,e){t.openElements.hasInButtonScope(O.P)&&t._closePElement(),t._reconstructActiveFormattingElements(),t.framesetOk=!1,t._switchToTextParsing(e,In.RAWTEXT)}function _de(t,e){t.framesetOk=!1,t._switchToTextParsing(e,In.RAWTEXT)}function vD(t,e){t._switchToTextParsing(e,In.RAWTEXT)}function xde(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,q.HTML),t.framesetOk=!1,t.insertionMode=t.insertionMode===D.IN_TABLE||t.insertionMode===D.IN_CAPTION||t.insertionMode===D.IN_TABLE_BODY||t.insertionMode===D.IN_ROW||t.insertionMode===D.IN_CELL?D.IN_SELECT_IN_TABLE:D.IN_SELECT}function Cde(t,e){t.openElements.currentTagId===O.OPTION&&t.openElements.pop(),t._reconstructActiveFormattingElements(),t._insertElement(e,q.HTML)}function Dde(t,e){t.openElements.hasInScope(O.RUBY)&&t.openElements.generateImpliedEndTags(),t._insertElement(e,q.HTML)}function Ade(t,e){t.openElements.hasInScope(O.RUBY)&&t.openElements.generateImpliedEndTagsWithExclusion(O.RTC),t._insertElement(e,q.HTML)}function Pde(t,e){t._reconstructActiveFormattingElements(),RF(e),YT(e),e.selfClosing?t._appendElement(e,q.MATHML):t._insertElement(e,q.MATHML),e.ackSelfClosing=!0}function Nde(t,e){t._reconstructActiveFormattingElements(),MF(e),YT(e),e.selfClosing?t._appendElement(e,q.SVG):t._insertElement(e,q.SVG),e.ackSelfClosing=!0}function TD(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,q.HTML)}function vn(t,e){switch(e.tagID){case O.I:case O.S:case O.B:case O.U:case O.EM:case O.TT:case O.BIG:case O.CODE:case O.FONT:case O.SMALL:case O.STRIKE:case O.STRONG:{gde(t,e);break}case O.A:{mde(t,e);break}case O.H1:case O.H2:case O.H3:case O.H4:case O.H5:case O.H6:{cde(t,e);break}case O.P:case O.DL:case O.OL:case O.UL:case O.DIV:case O.DIR:case O.NAV:case O.MAIN:case O.MENU:case O.ASIDE:case O.CENTER:case O.FIGURE:case O.FOOTER:case O.HEADER:case O.HGROUP:case O.DIALOG:case O.DETAILS:case O.ADDRESS:case O.ARTICLE:case O.SEARCH:case O.SECTION:case O.SUMMARY:case O.FIELDSET:case O.BLOCKQUOTE:case O.FIGCAPTION:{lde(t,e);break}case O.LI:case O.DD:case O.DT:{dde(t,e);break}case O.BR:case O.IMG:case O.WBR:case O.AREA:case O.EMBED:case O.KEYGEN:{FF(t,e);break}case O.HR:{Tde(t,e);break}case O.RB:case O.RTC:{Dde(t,e);break}case O.RT:case O.RP:{Ade(t,e);break}case O.PRE:case O.LISTING:{ude(t,e);break}case O.XMP:{kde(t,e);break}case O.SVG:{Nde(t,e);break}case O.HTML:{sde(t,e);break}case O.BASE:case O.LINK:case O.META:case O.STYLE:case O.TITLE:case O.SCRIPT:case O.BGSOUND:case O.BASEFONT:case O.TEMPLATE:{Lr(t,e);break}case O.BODY:{ode(t,e);break}case O.FORM:{hde(t,e);break}case O.NOBR:{Ode(t,e);break}case O.MATH:{Pde(t,e);break}case O.TABLE:{bde(t,e);break}case O.INPUT:{Ede(t,e);break}case O.PARAM:case O.TRACK:case O.SOURCE:{vde(t,e);break}case O.IMAGE:{Sde(t,e);break}case O.BUTTON:{fde(t,e);break}case O.APPLET:case O.OBJECT:case O.MARQUEE:{yde(t,e);break}case O.IFRAME:{_de(t,e);break}case O.SELECT:{xde(t,e);break}case O.OPTION:case O.OPTGROUP:{Cde(t,e);break}case O.NOEMBED:case O.NOFRAMES:{vD(t,e);break}case O.FRAMESET:{ade(t,e);break}case O.TEXTAREA:{wde(t,e);break}case O.NOSCRIPT:{t.options.scriptingEnabled?vD(t,e):TD(t,e);break}case O.PLAINTEXT:{pde(t,e);break}case O.COL:case O.TH:case O.TD:case O.TR:case O.HEAD:case O.FRAME:case O.TBODY:case O.TFOOT:case O.THEAD:case O.CAPTION:case O.COLGROUP:break;default:TD(t,e)}}function Rde(t,e){if(t.openElements.hasInScope(O.BODY)&&(t.insertionMode=D.AFTER_BODY,t.options.sourceCodeLocationInfo)){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t._setEndLocation(n,e)}}function Mde(t,e){t.openElements.hasInScope(O.BODY)&&(t.insertionMode=D.AFTER_BODY,GF(t,e))}function Ide(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n))}function Lde(t){const e=t.openElements.tmplCount>0,{formElement:n}=t;e||(t.formElement=null),(n||e)&&t.openElements.hasInScope(O.FORM)&&(t.openElements.generateImpliedEndTags(),e?t.openElements.popUntilTagNamePopped(O.FORM):n&&t.openElements.remove(n))}function Qde(t){t.openElements.hasInButtonScope(O.P)||t._insertFakeElement(M.P,O.P),t._closePElement()}function $de(t){t.openElements.hasInListItemScope(O.LI)&&(t.openElements.generateImpliedEndTagsWithExclusion(O.LI),t.openElements.popUntilTagNamePopped(O.LI))}function Fde(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTagsWithExclusion(n),t.openElements.popUntilTagNamePopped(n))}function Bde(t){t.openElements.hasNumberedHeaderInScope()&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilNumberedHeaderPopped())}function jde(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker())}function zde(t){t._reconstructActiveFormattingElements(),t._insertFakeElement(M.BR,O.BR),t.openElements.pop(),t.framesetOk=!1}function jF(t,e){const n=e.tagName,r=e.tagID;for(let i=t.openElements.stackTop;i>0;i--){const s=t.openElements.items[i],o=t.openElements.tagIDs[i];if(r===o&&(r!==O.UNKNOWN||t.treeAdapter.getTagName(s)===n)){t.openElements.generateImpliedEndTagsWithExclusion(r),t.openElements.stackTop>=i&&t.openElements.shortenToLength(i);break}if(t._isSpecialElement(s,o))break}}function Mm(t,e){switch(e.tagID){case O.A:case O.B:case O.I:case O.S:case O.U:case O.EM:case O.TT:case O.BIG:case O.CODE:case O.FONT:case O.NOBR:case O.SMALL:case O.STRIKE:case O.STRONG:{KT(t,e);break}case O.P:{Qde(t);break}case O.DL:case O.UL:case O.OL:case O.DIR:case O.DIV:case O.NAV:case O.PRE:case O.MAIN:case O.MENU:case O.ASIDE:case O.BUTTON:case O.CENTER:case O.FIGURE:case O.FOOTER:case O.HEADER:case O.HGROUP:case O.DIALOG:case O.ADDRESS:case O.ARTICLE:case O.DETAILS:case O.SEARCH:case O.SECTION:case O.SUMMARY:case O.LISTING:case O.FIELDSET:case O.BLOCKQUOTE:case O.FIGCAPTION:{Ide(t,e);break}case O.LI:{$de(t);break}case O.DD:case O.DT:{Fde(t,e);break}case O.H1:case O.H2:case O.H3:case O.H4:case O.H5:case O.H6:{Bde(t);break}case O.BR:{zde(t);break}case O.BODY:{Rde(t,e);break}case O.HTML:{Mde(t,e);break}case O.FORM:{Lde(t);break}case O.APPLET:case O.OBJECT:case O.MARQUEE:{jde(t,e);break}case O.TEMPLATE:{ia(t,e);break}default:jF(t,e)}}function zF(t,e){t.tmplInsertionModeStack.length>0?WF(t,e):JT(t,e)}function Vde(t,e){var n;e.tagID===O.SCRIPT&&((n=t.scriptHandler)===null||n===void 0||n.call(t,t.openElements.current)),t.openElements.pop(),t.insertionMode=t.originalInsertionMode}function Ude(t,e){t._err(e,F.eofInElementThatCanContainOnlyText),t.openElements.pop(),t.insertionMode=t.originalInsertionMode,t.onEof(e)}function IO(t,e){if(t.openElements.currentTagId!==void 0&&IF.has(t.openElements.currentTagId))switch(t.pendingCharacterTokens.length=0,t.hasNonWhitespacePendingCharacterToken=!1,t.originalInsertionMode=t.insertionMode,t.insertionMode=D.IN_TABLE_TEXT,e.type){case Fe.CHARACTER:{UF(t,e);break}case Fe.WHITESPACE_CHARACTER:{VF(t,e);break}}else lh(t,e)}function Hde(t,e){t.openElements.clearBackToTableContext(),t.activeFormattingElements.insertMarker(),t._insertElement(e,q.HTML),t.insertionMode=D.IN_CAPTION}function Xde(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,q.HTML),t.insertionMode=D.IN_COLUMN_GROUP}function qde(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(M.COLGROUP,O.COLGROUP),t.insertionMode=D.IN_COLUMN_GROUP,eS(t,e)}function Zde(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,q.HTML),t.insertionMode=D.IN_TABLE_BODY}function Wde(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(M.TBODY,O.TBODY),t.insertionMode=D.IN_TABLE_BODY,Im(t,e)}function Gde(t,e){t.openElements.hasInTableScope(O.TABLE)&&(t.openElements.popUntilTagNamePopped(O.TABLE),t._resetInsertionMode(),t._processStartTag(e))}function Yde(t,e){BF(e)?t._appendElement(e,q.HTML):lh(t,e),e.ackSelfClosing=!0}function Kde(t,e){!t.formElement&&t.openElements.tmplCount===0&&(t._insertElement(e,q.HTML),t.formElement=t.openElements.current,t.openElements.pop())}function hl(t,e){switch(e.tagID){case O.TD:case O.TH:case O.TR:{Wde(t,e);break}case O.STYLE:case O.SCRIPT:case O.TEMPLATE:{Lr(t,e);break}case O.COL:{qde(t,e);break}case O.FORM:{Kde(t,e);break}case O.TABLE:{Gde(t,e);break}case O.TBODY:case O.TFOOT:case O.THEAD:{Zde(t,e);break}case O.INPUT:{Yde(t,e);break}case O.CAPTION:{Hde(t,e);break}case O.COLGROUP:{Xde(t,e);break}default:lh(t,e)}}function xu(t,e){switch(e.tagID){case O.TABLE:{t.openElements.hasInTableScope(O.TABLE)&&(t.openElements.popUntilTagNamePopped(O.TABLE),t._resetInsertionMode());break}case O.TEMPLATE:{ia(t,e);break}case O.BODY:case O.CAPTION:case O.COL:case O.COLGROUP:case O.HTML:case O.TBODY:case O.TD:case O.TFOOT:case O.TH:case O.THEAD:case O.TR:break;default:lh(t,e)}}function lh(t,e){const n=t.fosterParentingEnabled;t.fosterParentingEnabled=!0,Rm(t,e),t.fosterParentingEnabled=n}function VF(t,e){t.pendingCharacterTokens.push(e)}function UF(t,e){t.pendingCharacterTokens.push(e),t.hasNonWhitespacePendingCharacterToken=!0}function Zl(t,e){let n=0;if(t.hasNonWhitespacePendingCharacterToken)for(;n0&&t.openElements.currentTagId===O.OPTION&&t.openElements.tagIDs[t.openElements.stackTop-1]===O.OPTGROUP&&t.openElements.pop(),t.openElements.currentTagId===O.OPTGROUP&&t.openElements.pop();break}case O.OPTION:{t.openElements.currentTagId===O.OPTION&&t.openElements.pop();break}case O.SELECT:{t.openElements.hasInSelectScope(O.SELECT)&&(t.openElements.popUntilTagNamePopped(O.SELECT),t._resetInsertionMode());break}case O.TEMPLATE:{ia(t,e);break}}}function ipe(t,e){const n=e.tagID;n===O.CAPTION||n===O.TABLE||n===O.TBODY||n===O.TFOOT||n===O.THEAD||n===O.TR||n===O.TD||n===O.TH?(t.openElements.popUntilTagNamePopped(O.SELECT),t._resetInsertionMode(),t._processStartTag(e)):qF(t,e)}function spe(t,e){const n=e.tagID;n===O.CAPTION||n===O.TABLE||n===O.TBODY||n===O.TFOOT||n===O.THEAD||n===O.TR||n===O.TD||n===O.TH?t.openElements.hasInTableScope(n)&&(t.openElements.popUntilTagNamePopped(O.SELECT),t._resetInsertionMode(),t.onEndTag(e)):ZF(t,e)}function ope(t,e){switch(e.tagID){case O.BASE:case O.BASEFONT:case O.BGSOUND:case O.LINK:case O.META:case O.NOFRAMES:case O.SCRIPT:case O.STYLE:case O.TEMPLATE:case O.TITLE:{Lr(t,e);break}case O.CAPTION:case O.COLGROUP:case O.TBODY:case O.TFOOT:case O.THEAD:{t.tmplInsertionModeStack[0]=D.IN_TABLE,t.insertionMode=D.IN_TABLE,hl(t,e);break}case O.COL:{t.tmplInsertionModeStack[0]=D.IN_COLUMN_GROUP,t.insertionMode=D.IN_COLUMN_GROUP,eS(t,e);break}case O.TR:{t.tmplInsertionModeStack[0]=D.IN_TABLE_BODY,t.insertionMode=D.IN_TABLE_BODY,Im(t,e);break}case O.TD:case O.TH:{t.tmplInsertionModeStack[0]=D.IN_ROW,t.insertionMode=D.IN_ROW,Lm(t,e);break}default:t.tmplInsertionModeStack[0]=D.IN_BODY,t.insertionMode=D.IN_BODY,vn(t,e)}}function ape(t,e){e.tagID===O.TEMPLATE&&ia(t,e)}function WF(t,e){t.openElements.tmplCount>0?(t.openElements.popUntilTagNamePopped(O.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode(),t.onEof(e)):JT(t,e)}function lpe(t,e){e.tagID===O.HTML?vn(t,e):ff(t,e)}function GF(t,e){var n;if(e.tagID===O.HTML){if(t.fragmentContext||(t.insertionMode=D.AFTER_AFTER_BODY),t.options.sourceCodeLocationInfo&&t.openElements.tagIDs[0]===O.HTML){t._setEndLocation(t.openElements.items[0],e);const r=t.openElements.items[1];r&&!(!((n=t.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&t._setEndLocation(r,e)}}else ff(t,e)}function ff(t,e){t.insertionMode=D.IN_BODY,Rm(t,e)}function cpe(t,e){switch(e.tagID){case O.HTML:{vn(t,e);break}case O.FRAMESET:{t._insertElement(e,q.HTML);break}case O.FRAME:{t._appendElement(e,q.HTML),e.ackSelfClosing=!0;break}case O.NOFRAMES:{Lr(t,e);break}}}function upe(t,e){e.tagID===O.FRAMESET&&!t.openElements.isRootHtmlElementCurrent()&&(t.openElements.pop(),!t.fragmentContext&&t.openElements.currentTagId!==O.FRAMESET&&(t.insertionMode=D.AFTER_FRAMESET))}function hpe(t,e){switch(e.tagID){case O.HTML:{vn(t,e);break}case O.NOFRAMES:{Lr(t,e);break}}}function dpe(t,e){e.tagID===O.HTML&&(t.insertionMode=D.AFTER_AFTER_FRAMESET)}function ppe(t,e){e.tagID===O.HTML?vn(t,e):Zd(t,e)}function Zd(t,e){t.insertionMode=D.IN_BODY,Rm(t,e)}function fpe(t,e){switch(e.tagID){case O.HTML:{vn(t,e);break}case O.NOFRAMES:{Lr(t,e);break}}}function mpe(t,e){e.chars=dt,t._insertCharacters(e)}function gpe(t,e){t._insertCharacters(e),t.framesetOk=!1}function YF(t){for(;t.treeAdapter.getNamespaceURI(t.openElements.current)!==q.HTML&&t.openElements.currentTagId!==void 0&&!t._isIntegrationPoint(t.openElements.currentTagId,t.openElements.current);)t.openElements.pop()}function Ope(t,e){if(Nhe(e))YF(t),t._startTagOutsideForeignContent(e);else{const n=t._getAdjustedCurrentElement(),r=t.treeAdapter.getNamespaceURI(n);r===q.MATHML?RF(e):r===q.SVG&&(Rhe(e),MF(e)),YT(e),e.selfClosing?t._appendElement(e,r):t._insertElement(e,r),e.ackSelfClosing=!0}}function ype(t,e){if(e.tagID===O.P||e.tagID===O.BR){YF(t),t._endTagOutsideForeignContent(e);return}for(let n=t.openElements.stackTop;n>0;n--){const r=t.openElements.items[n];if(t.treeAdapter.getNamespaceURI(r)===q.HTML){t._endTagOutsideForeignContent(e);break}const i=t.treeAdapter.getTagName(r);if(i.toLowerCase()===e.tagName){e.tagName=i,t.openElements.shortenToLength(n);break}}}M.AREA,M.BASE,M.BASEFONT,M.BGSOUND,M.BR,M.COL,M.EMBED,M.FRAME,M.HR,M.IMG,M.INPUT,M.KEYGEN,M.LINK,M.META,M.PARAM,M.SOURCE,M.TRACK,M.WBR;function bpe(t,e){return LF.parse(t,e)}function Epe(t,e,n){typeof t=="string"&&(n=e,e=t,t=null);const r=LF.getFragmentParser(t,n);return r.tokenizer.write(e,!0),r.getFragment()}function vpe(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?SD(t.position):"start"in t||"end"in t?SD(t):"line"in t||"column"in t?oE(t):""}function oE(t){return wD(t&&t.line)+":"+wD(t&&t.column)}function SD(t){return oE(t&&t.start)+"-"+oE(t&&t.end)}function wD(t){return t&&typeof t=="number"?t:1}class an extends Error{constructor(e,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},o=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof e=="string"?i=e:!s.cause&&e&&(o=!0,i=e.message,s.cause=e),!s.ruleId&&!s.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?s.ruleId=r:(s.source=r.slice(0,l),s.ruleId=r.slice(l+1))}if(!s.place&&s.ancestors&&s.ancestors){const l=s.ancestors[s.ancestors.length-1];l&&(s.place=l.position)}const a=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=vpe(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}an.prototype.file="";an.prototype.name="";an.prototype.reason="";an.prototype.message="";an.prototype.stack="";an.prototype.column=void 0;an.prototype.line=void 0;an.prototype.ancestors=void 0;an.prototype.cause=void 0;an.prototype.fatal=void 0;an.prototype.place=void 0;an.prototype.ruleId=void 0;an.prototype.source=void 0;const Yr={basename:Tpe,dirname:Spe,extname:wpe,join:kpe,sep:"/"};function Tpe(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');ch(t);let n=0,r=-1,i=t.length,s;if(e===void 0||e.length===0||e.length>t.length){for(;i--;)if(t.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":t.slice(n,r)}if(e===t)return"";let o=-1,a=e.length-1;for(;i--;)if(t.codePointAt(i)===47){if(s){n=i+1;break}}else o<0&&(s=!0,o=i+1),a>-1&&(t.codePointAt(i)===e.codePointAt(a--)?a<0&&(r=i):(a=-1,r=o));return n===r?r=o:r<0&&(r=t.length),t.slice(n,r)}function Spe(t){if(ch(t),t.length===0)return".";let e=-1,n=t.length,r;for(;--n;)if(t.codePointAt(n)===47){if(r){e=n;break}}else r||(r=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function wpe(t){ch(t);let e=t.length,n=-1,r=0,i=-1,s=0,o;for(;e--;){const a=t.codePointAt(e);if(a===47){if(o){r=e+1;break}continue}n<0&&(o=!0,n=e+1),a===46?i<0?i=e:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":t.slice(i,n)}function kpe(...t){let e=-1,n;for(;++e0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function xpe(t,e){let n="",r=0,i=-1,s=0,o=-1,a,l;for(;++o<=t.length;){if(o2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=o,s=0;continue}}else if(n.length>0){n="",r=0,i=o,s=0;continue}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(i+1,o):n=t.slice(i+1,o),r=o-i-1;i=o,s=0}else a===46&&s>-1?s++:s=-1}return n}function ch(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const Cpe={cwd:Dpe};function Dpe(){return"/"}function aE(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function Ape(t){if(typeof t=="string")t=new URL(t);else if(!aE(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return Ppe(t)}function Ppe(t){if(t.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const e=t.pathname;let n=-1;for(;++n`",url:!1},abruptClosingOfEmptyComment:{reason:"Unexpected abruptly closed empty comment",description:"Unexpected `>` or `->`. Expected `-->` to close comments"},abruptDoctypePublicIdentifier:{reason:"Unexpected abruptly closed public identifier",description:"Unexpected `>`. Expected a closing `\"` or `'` after the public identifier"},abruptDoctypeSystemIdentifier:{reason:"Unexpected abruptly closed system identifier",description:"Unexpected `>`. Expected a closing `\"` or `'` after the identifier identifier"},absenceOfDigitsInNumericCharacterReference:{reason:"Unexpected non-digit at start of numeric character reference",description:"Unexpected `%c`. Expected `[0-9]` for decimal references or `[0-9a-fA-F]` for hexadecimal references"},cdataInHtmlContent:{reason:"Unexpected CDATA section in HTML",description:"Unexpected `` in ``",description:"Unexpected text character `%c`. Only use text in `