@dss-kit/ui-kit 0.2.23 → 0.2.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -21
- package/dist/components/controls/Button/Button.d.ts.map +1 -1
- package/dist/styles/utils/breakpoints/base.scss +11 -11
- package/dist/styles/utils/breakpoints/index.scss +3 -3
- package/dist/styles/utils/breakpoints/screen.scss +61 -61
- package/dist/styles/utils/breakpoints/semantic.scss +31 -31
- package/dist/styles/utils/fonts/font-family.scss +3 -3
- package/dist/styles/utils/fonts/index.scss +1 -1
- package/dist/styles/utils/index.scss +5 -5
- package/dist/styles/utils/size/index.scss +1 -1
- package/dist/styles/utils/size/modifiers.scss +40 -40
- package/dist/styles/utils/style/index.scss +1 -1
- package/dist/styles/utils/style/variants.scss +34 -34
- package/dist/styles/utils/typography/_font-weight.scss +33 -33
- package/dist/styles/utils/typography/_variants.scss +85 -85
- package/dist/styles/utils/typography/index.scss +2 -2
- package/dist/ui-kit.cjs.js +33 -33
- package/dist/ui-kit.cjs.js.map +1 -1
- package/dist/ui-kit.css +1 -1
- package/dist/ui-kit.es.js +1464 -1464
- package/dist/ui-kit.es.js.map +1 -1
- package/package.json +92 -92
package/dist/ui-kit.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("react/jsx-runtime"),C=require("react"),z=require("@emotion/css"),zi=require("react-dom"),da=require("@highcharts/react");function Qy(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const N=Qy(C),PC=Qy(zi);function FC(e){const{h:t,w:n,m:r,mx:o,my:i,mt:s,mr:a,mb:l,ml:c,p:u,px:f,py:d,pt:h,pr:g,pb:p,pl:m,gap:_,xGap:y,yGap:v,row:x,flex:b,relative:w,absolute:T,display:E,overflow:R,absoluteFill:M,center:O,justifyContent:D,alignItems:I,alignSelf:L,borderWidth:B,borderBottomWidth:K,borderColor:P,borderRadius:A,borderStyle:$,border:H,zIndex:Q,minWidth:J,minHeight:X,maxWidth:se,maxHeight:re,flexWrap:he,flexGrow:we,flexShrink:te,flexBasis:ye,backgroundColor:Se,position:$e,top:ee,right:pe,bottom:Ne,left:Ze,...Le}=e;return{spacers:{h:t,w:n,m:r,mx:o,my:i,mt:s,mr:a,mb:l,ml:c,p:u,px:f,py:d,pt:h,pr:g,pb:p,pl:m,gap:_,xGap:y,yGap:v,row:x,flex:b,relative:w,absolute:T,display:E,overflow:R,absoluteFill:M,center:O,justifyContent:D,alignItems:I,alignSelf:L,borderWidth:B,borderBottomWidth:K,borderColor:P,borderRadius:A,borderStyle:$,border:H,zIndex:Q,minWidth:J,minHeight:X,maxWidth:se,maxHeight:re,flexWrap:he,flexGrow:we,flexShrink:te,flexBasis:ye,backgroundColor:Se,position:$e,top:ee,right:pe,bottom:Ne,left:Ze},rest:Le}}const LC=e=>z.css({display:e.display??"flex",flexDirection:e.row?"row":"column",height:e.h==="screen"?"100vh":e.h==="full"?"100%":e.h,width:e.w==="screen"?"100vw":e.w==="full"?"100%":e.w,margin:e.m,marginTop:e.mt??e.my,marginBottom:e.mb??e.my,marginLeft:e.ml??e.mx,marginRight:e.mr??e.mx,padding:e.p,paddingTop:e.pt??e.py,paddingBottom:e.pb??e.py,paddingLeft:e.pl??e.px,paddingRight:e.pr??e.px,gap:e.gap,columnGap:e.xGap,rowGap:e.yGap,justifyContent:e.center?"center":e.justifyContent,alignItems:e.center?"center":e.alignItems,alignSelf:e.alignSelf,borderWidth:e.borderWidth,borderBottomWidth:e.borderBottomWidth,borderColor:e.borderColor,borderRadius:e.borderRadius,borderStyle:e.borderStyle,border:e.border,zIndex:e.zIndex,overflow:e.overflow,minWidth:e.minWidth,minHeight:e.minHeight,maxWidth:e.maxWidth,maxHeight:e.maxHeight,flex:e.flex===!0?1:e.flex,flexWrap:e.flexWrap,flexGrow:e.flexGrow,flexShrink:e.flexShrink,flexBasis:e.flexBasis,backgroundColor:e.backgroundColor,position:e?.position?e?.position:e?.absolute?"absolute":e?.relative?"relative":void 0,...e.absoluteFill&&{position:"absolute",top:0,right:0,bottom:0,left:0},top:e?.top,right:e?.right,bottom:e?.bottom,left:e?.left}),q=C.forwardRef(({className:e,children:t,...n},r)=>{const{spacers:o,rest:i}=FC(n),s=C.useMemo(()=>LC(o),[o]);return S.jsx("div",{ref:r,className:z.cx(s,e),...i,children:t})});q.displayName="Box";const OC="_loader_1qleq_8",IC={loader:OC},ev=({color:e="var(--text-accent)"})=>S.jsx("span",{className:z.cx(IC.loader,z.css({"--loader-color":e}))}),tv=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}));var _n=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function _d(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ll={exports:{}};var Fh;function $C(){return Fh||(Fh=1,(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var i="",s=0;s<arguments.length;s++){var a=arguments[s];a&&(i=o(i,r(a)))}return i}function r(i){if(typeof i=="string"||typeof i=="number")return i;if(typeof i!="object")return"";if(Array.isArray(i))return n.apply(null,i);if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]"))return i.toString();var s="";for(var a in i)t.call(i,a)&&i[a]&&(s=o(s,a));return s}function o(i,s){return s?i?i+" "+s:i+s:i}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(Ll)),Ll.exports}var DC=$C();const Pi=_d(DC),VC="_rippleOverlay_s2kim_8",jC="_ripple_s2kim_8",Lh={rippleOverlay:VC,ripple:jC},Ol="button, a, input, label, [role='button'], [data-ripple]";function BC(e){if(typeof e.composedPath=="function")return e.composedPath();const t=[];let n=e.target;for(;n;)t.push(n),n=n.parentNode||n.host;return t.push(window),t}const io=C.forwardRef(({color:e="rgba(0,0,0,0.18)",duration:t=1e3,radius:n="auto",className:r},o)=>{const i=C.useRef(null),[s,a]=C.useState([]),l=C.useRef([]),c=C.useRef(1),u=C.useRef(null),f=()=>{l.current.map(p=>clearTimeout(p)),l.current=[]},d=C.useCallback((p,m,_,y)=>{if(typeof window>"u")return;const v=_.getBoundingClientRect(),x=n==="auto"?Math.max(v.width,v.height)*2:n,b=p-y.left,w=m-y.top,T=Math.max(0,v.top-y.top),E=Math.max(0,v.left-y.left),R=Math.max(0,y.right-v.right),M=Math.max(0,y.bottom-v.bottom),D=window.getComputedStyle(_).borderRadius||"0px",I=c.current++,L={id:I,left:b-x/2,top:w-x/2,size:Math.ceil(x),clip:{top:Math.round(T),right:Math.round(R),bottom:Math.round(M),left:Math.round(E)},borderRadius:D};a(K=>[...K,L]);const B=window.setTimeout(()=>{a(K=>K.filter(P=>P.id!==I))},t+80);l.current.push(B)},[t,n]),h=C.useCallback(p=>{try{if(!i.current)return;const m=i.current,_=m.parentElement;if(!_)return;const y=BC(p);let v=null;for(const E of y)if(E instanceof Element){if(E===_)break;if(E.matches&&E.matches(Ol)){v=E;break}}if(v||(v=_),v.closest&&(v.closest("[disabled]")||v.getAttribute("aria-disabled")==="true"||v.classList.contains("ripple-disabled")))return;const x=p.target;if(x?.closest&&(x.closest("[disabled]")||x.getAttribute?.("aria-disabled")==="true"))return;const b=m.getBoundingClientRect(),{clientX:w}=p,{clientY:T}=p;d(w,T,v,b)}catch{}},[d]),g=C.useCallback(p=>{if(!i.current||!(p.key==="Enter"||p.key===" "))return;const m=i.current,_=m.parentElement;if(!_)return;const y=document.activeElement;let v=null;if(y instanceof Element&&y.matches(Ol)&&(v=y),v||(v=_),v.closest&&(v.closest("[disabled]")||v.getAttribute("aria-disabled")==="true"))return;const x=m.getBoundingClientRect(),b=v.getBoundingClientRect().left+v.getBoundingClientRect().width/2,w=v.getBoundingClientRect().top+v.getBoundingClientRect().height/2;d(b,w,v,x)},[d]);return C.useImperativeHandle(o,()=>({trigger:({center:p=!0,x:m,y:_}={})=>{const y=i.current;if(!y)return;const v=y.parentElement;if(!v)return;const x=y.getBoundingClientRect(),b=document.activeElement instanceof Element&&document.activeElement.matches(Ol)?document.activeElement:v,w=p?b.getBoundingClientRect().left+b.getBoundingClientRect().width/2:m??x.left+x.width/2,T=p?b.getBoundingClientRect().top+b.getBoundingClientRect().height/2:_??x.top+x.height/2;d(w,T,b,x)}}),[d]),C.useEffect(()=>{const p=i.current;if(!p)return;const m=p.parentElement;if(!m||typeof window>"u")return;const _=window.getComputedStyle(m);let y=!1;return _.position==="static"&&(m.style.position="relative",y=!0,u.current=m),m.addEventListener("pointerdown",h,!0),m.addEventListener("keydown",g),()=>{m.removeEventListener("pointerdown",h,!0),m.removeEventListener("keydown",g),y&&u.current&&(u.current.style.position="",u.current=null),f()}},[h,g]),C.useEffect(()=>()=>f(),[]),S.jsx("div",{ref:i,className:`${Lh.rippleOverlay} ${r??""}`,"aria-hidden":!0,children:s.map(p=>S.jsx("span",{className:Lh.ripple,style:{left:`${p.left}px`,top:`${p.top}px`,width:`${p.size}px`,height:`${p.size}px`,backgroundColor:e,animationDuration:`${t}ms`,clipPath:`inset(${p.clip.top}px ${p.clip.right}px ${p.clip.bottom}px ${p.clip.left}px round ${p.borderRadius})`}},p.id))})});function so(e,t){const{current:n}=C.useRef(e!==void 0),[r,o]=C.useState(t),i=n?e:r,s=C.useCallback(a=>{n||o(a)},[]);return[i,s]}function xd(e,t,n,r=""){if(n)return e[`${t}_${n}${r}`]}function fa(e,t,n){return xd(e,t,n,"Size")}const zC="_button_l3j6j_8",WC="_button_primary_l3j6j_19",HC="_button_secondary_l3j6j_22",KC="_button_negative_l3j6j_25",UC="_button_positive_l3j6j_28",GC="_button_warning_l3j6j_31",qC="_button_neutral_l3j6j_34",YC="_button_mdSize_l3j6j_118",XC="_button_smSize_l3j6j_127",JC="_button_xsSize_l3j6j_136",Il={button:zC,button_primary:WC,button_secondary:HC,button_negative:KC,button_positive:UC,button_warning:GC,button_neutral:qC,"button_neutral-white":"_button_neutral-white_l3j6j_37","button_no-bg":"_button_no-bg_l3j6j_40",button_mdSize:YC,button_smSize:XC,button_xsSize:JC};function Kn({attr:e,children:t,className:n,type:r="button",color:o="primary",size:i="md",...s}){const a="button";return S.jsxs("button",{...e,...s,type:r,className:Pi(Il[a],n,fa(Il,a,i),xd(Il,a,o)),children:[S.jsx(io,{}),t]})}const nv=C.createContext({isOpen:!1,onClose:()=>{}}),ZC=()=>C.useContext(nv),QC="_overlay_1gnp0_8",ew="_modal_1gnp0_12",tw="_closeButton_1gnp0_28",nw="_size_lg_1gnp0_35",rw="_size_md_1gnp0_38",ow="_size_sm_1gnp0_41",Ts={overlay:QC,modal:ew,"modal-animation":"_modal-animation_1gnp0_1",closeButton:tw,size_lg:nw,size_md:rw,size_sm:ow},rv=C.forwardRef(({isOpen:e,onClose:t,overlayClassName:n,modalClassName:r,size:o="md",closeOnBackdropClick:i=!0,closeOnEsc:s=!0,disableBodyScroll:a=!0,showAbsoluteCloseButton:l,children:c},u)=>{C.useEffect(()=>{if(a&&e&&typeof window<"u"&&typeof document<"u"){const h=window.getComputedStyle(document.body).overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=h}}},[e,a]);const f=C.useCallback(h=>{h.key==="Escape"&&t()},[t]);C.useEffect(()=>{if(typeof window<"u"&&typeof document<"u"&&s&&e)return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[e,s,f]);const d=C.useCallback(h=>{i&&h.target===h.currentTarget&&t()},[i,t]);return e?S.jsx(_s,{children:S.jsx(nv.Provider,{value:{isOpen:e,onClose:t},children:S.jsx(q,{position:"fixed",top:0,right:0,bottom:0,left:0,row:!0,center:!0,flex:1,onClick:d,backgroundColor:"var(--fill-bg-overlay-primary)",className:z.cx(Ts.overlay,n),zIndex:1,children:S.jsxs(q,{ref:u,className:z.cx(Ts.modal,Ts[`size_${o}`],r),relative:!0,children:[l&&S.jsx(Kn,{className:Ts.closeButton,onClick:t,color:"neutral",children:S.jsx(tv,{})}),c]})})})}):null});rv.displayName="Modal";const iw="_footer_1bo08_8",sw={footer:iw},ov=C.forwardRef(({children:e,row:t=!0,flex:n=!0,gap:r="var(--spacing-lg)",p:o="var(--spacing-2xl)",className:i,...s},a)=>S.jsx(q,{flex:n,row:t,gap:r,p:o,className:z.cx(sw.footer,i),ref:a,...s,children:e}));ov.displayName="ModalFooter";const bd=C.createContext({});function Cd(e){const t=C.useRef(null);return t.current===null&&(t.current=e()),t.current}const wd=typeof window<"u",iv=wd?C.useLayoutEffect:C.useEffect,Ka=C.createContext(null);function Sd(e,t){e.indexOf(t)===-1&&e.push(t)}function Ed(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Gn=(e,t,n)=>n>t?t:n<e?e:n;function Jc(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let ei=()=>{},qn=()=>{};process.env.NODE_ENV!=="production"&&(ei=(e,t,n)=>{!e&&typeof console<"u"&&console.warn(Jc(t,n))},qn=(e,t,n)=>{if(!e)throw new Error(Jc(t,n))});const Yn={},sv=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function av(e){return typeof e=="object"&&e!==null}const lv=e=>/^0[^.\s]+$/u.test(e);function Td(e){let t;return()=>(t===void 0&&(t=e()),t)}const Ht=e=>e,aw=(e,t)=>n=>t(e(n)),ns=(...e)=>e.reduce(aw),Wi=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class Rd{constructor(){this.subscriptions=[]}add(t){return Sd(this.subscriptions,t),()=>Ed(this.subscriptions,t)}notify(t,n,r){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,n,r);else for(let i=0;i<o;i++){const s=this.subscriptions[i];s&&s(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const rn=e=>e*1e3,Wt=e=>e/1e3;function cv(e,t){return t?e*(1e3/t):0}const Oh=new Set;function kd(e,t,n){e||Oh.has(t)||(console.warn(Jc(t,n)),Oh.add(t))}const uv=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,lw=1e-7,cw=12;function uw(e,t,n,r,o){let i,s,a=0;do s=t+(n-t)/2,i=uv(s,r,o)-e,i>0?n=s:t=s;while(Math.abs(i)>lw&&++a<cw);return s}function rs(e,t,n,r){if(e===t&&n===r)return Ht;const o=i=>uw(i,0,1,e,n);return i=>i===0||i===1?i:uv(o(i),t,r)}const dv=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,fv=e=>t=>1-e(1-t),hv=rs(.33,1.53,.69,.99),Ad=fv(hv),gv=dv(Ad),pv=e=>(e*=2)<1?.5*Ad(e):.5*(2-Math.pow(2,-10*(e-1))),Md=e=>1-Math.sin(Math.acos(e)),mv=fv(Md),yv=dv(Md),dw=rs(.42,0,1,1),fw=rs(0,0,.58,1),vv=rs(.42,0,.58,1),hw=e=>Array.isArray(e)&&typeof e[0]!="number",_v=e=>Array.isArray(e)&&typeof e[0]=="number",Ih={linear:Ht,easeIn:dw,easeInOut:vv,easeOut:fw,circIn:Md,circInOut:yv,circOut:mv,backIn:Ad,backInOut:gv,backOut:hv,anticipate:pv},gw=e=>typeof e=="string",$h=e=>{if(_v(e)){qn(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,r,o]=e;return rs(t,n,r,o)}else if(gw(e))return qn(Ih[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),Ih[e];return e},Rs=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function pw(e,t){let n=new Set,r=new Set,o=!1,i=!1;const s=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(u){s.has(u)&&(c.schedule(u),e()),u(a)}const c={schedule:(u,f=!1,d=!1)=>{const g=d&&o?n:r;return f&&s.add(u),g.has(u)||g.add(u),u},cancel:u=>{r.delete(u),s.delete(u)},process:u=>{if(a=u,o){i=!0;return}o=!0,[n,r]=[r,n],n.forEach(l),n.clear(),o=!1,i&&(i=!1,c.process(u))}};return c}const mw=40;function xv(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,s=Rs.reduce((v,x)=>(v[x]=pw(i),v),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:u,update:f,preRender:d,render:h,postRender:g}=s,p=()=>{const v=Yn.useManualTiming?o.timestamp:performance.now();n=!1,Yn.useManualTiming||(o.delta=r?1e3/60:Math.max(Math.min(v-o.timestamp,mw),1)),o.timestamp=v,o.isProcessing=!0,a.process(o),l.process(o),c.process(o),u.process(o),f.process(o),d.process(o),h.process(o),g.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(p))},m=()=>{n=!0,r=!0,o.isProcessing||e(p)};return{schedule:Rs.reduce((v,x)=>{const b=s[x];return v[x]=(w,T=!1,E=!1)=>(n||m(),b.schedule(w,T,E)),v},{}),cancel:v=>{for(let x=0;x<Rs.length;x++)s[Rs[x]].cancel(v)},state:o,steps:s}}const{schedule:We,cancel:dr,state:ct,steps:$l}=xv(typeof requestAnimationFrame<"u"?requestAnimationFrame:Ht,!0);let Zs;function yw(){Zs=void 0}const Tt={now:()=>(Zs===void 0&&Tt.set(ct.isProcessing||Yn.useManualTiming?ct.timestamp:performance.now()),Zs),set:e=>{Zs=e,queueMicrotask(yw)}},bv=e=>t=>typeof t=="string"&&t.startsWith(e),Cv=bv("--"),vw=bv("var(--"),Nd=e=>vw(e)?_w.test(e.split("/*")[0].trim()):!1,_w=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,ti={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Hi={...ti,transform:e=>Gn(0,1,e)},ks={...ti,default:1},Fi=e=>Math.round(e*1e5)/1e5,Pd=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function xw(e){return e==null}const bw=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Fd=(e,t)=>n=>!!(typeof n=="string"&&bw.test(n)&&n.startsWith(e)||t&&!xw(n)&&Object.prototype.hasOwnProperty.call(n,t)),wv=(e,t,n)=>r=>{if(typeof r!="string")return r;const[o,i,s,a]=r.match(Pd);return{[e]:parseFloat(o),[t]:parseFloat(i),[n]:parseFloat(s),alpha:a!==void 0?parseFloat(a):1}},Cw=e=>Gn(0,255,e),Dl={...ti,transform:e=>Math.round(Cw(e))},$r={test:Fd("rgb","red"),parse:wv("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Dl.transform(e)+", "+Dl.transform(t)+", "+Dl.transform(n)+", "+Fi(Hi.transform(r))+")"};function ww(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}const Zc={test:Fd("#"),parse:ww,transform:$r.transform},os=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),tr=os("deg"),bn=os("%"),de=os("px"),Sw=os("vh"),Ew=os("vw"),Dh={...bn,parse:e=>bn.parse(e)/100,transform:e=>bn.transform(e*100)},ko={test:Fd("hsl","hue"),parse:wv("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+bn.transform(Fi(t))+", "+bn.transform(Fi(n))+", "+Fi(Hi.transform(r))+")"},Qe={test:e=>$r.test(e)||Zc.test(e)||ko.test(e),parse:e=>$r.test(e)?$r.parse(e):ko.test(e)?ko.parse(e):Zc.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?$r.transform(e):ko.transform(e),getAnimatableNone:e=>{const t=Qe.parse(e);return t.alpha=0,Qe.transform(t)}},Tw=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Rw(e){return isNaN(e)&&typeof e=="string"&&(e.match(Pd)?.length||0)+(e.match(Tw)?.length||0)>0}const Sv="number",Ev="color",kw="var",Aw="var(",Vh="${}",Mw=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Ki(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let i=0;const a=t.replace(Mw,l=>(Qe.test(l)?(r.color.push(i),o.push(Ev),n.push(Qe.parse(l))):l.startsWith(Aw)?(r.var.push(i),o.push(kw),n.push(l)):(r.number.push(i),o.push(Sv),n.push(parseFloat(l))),++i,Vh)).split(Vh);return{values:n,split:a,indexes:r,types:o}}function Tv(e){return Ki(e).values}function Rv(e){const{split:t,types:n}=Ki(e),r=t.length;return o=>{let i="";for(let s=0;s<r;s++)if(i+=t[s],o[s]!==void 0){const a=n[s];a===Sv?i+=Fi(o[s]):a===Ev?i+=Qe.transform(o[s]):i+=o[s]}return i}}const Nw=e=>typeof e=="number"?0:Qe.test(e)?Qe.getAnimatableNone(e):e;function Pw(e){const t=Tv(e);return Rv(e)(t.map(Nw))}const fr={test:Rw,parse:Tv,createTransformer:Rv,getAnimatableNone:Pw};function Vl(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Fw({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let o=0,i=0,s=0;if(!t)o=i=s=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;o=Vl(l,a,e+1/3),i=Vl(l,a,e),s=Vl(l,a,e-1/3)}return{red:Math.round(o*255),green:Math.round(i*255),blue:Math.round(s*255),alpha:r}}function ha(e,t){return n=>n>0?t:e}const qe=(e,t,n)=>e+(t-e)*n,jl=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},Lw=[Zc,$r,ko],Ow=e=>Lw.find(t=>t.test(e));function jh(e){const t=Ow(e);if(ei(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let n=t.parse(e);return t===ko&&(n=Fw(n)),n}const Bh=(e,t)=>{const n=jh(e),r=jh(t);if(!n||!r)return ha(e,t);const o={...n};return i=>(o.red=jl(n.red,r.red,i),o.green=jl(n.green,r.green,i),o.blue=jl(n.blue,r.blue,i),o.alpha=qe(n.alpha,r.alpha,i),$r.transform(o))},Qc=new Set(["none","hidden"]);function Iw(e,t){return Qc.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function $w(e,t){return n=>qe(e,t,n)}function Ld(e){return typeof e=="number"?$w:typeof e=="string"?Nd(e)?ha:Qe.test(e)?Bh:jw:Array.isArray(e)?kv:typeof e=="object"?Qe.test(e)?Bh:Dw:ha}function kv(e,t){const n=[...e],r=n.length,o=e.map((i,s)=>Ld(i)(i,t[s]));return i=>{for(let s=0;s<r;s++)n[s]=o[s](i);return n}}function Dw(e,t){const n={...e,...t},r={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(r[o]=Ld(e[o])(e[o],t[o]));return o=>{for(const i in r)n[i]=r[i](o);return n}}function Vw(e,t){const n=[],r={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const i=t.types[o],s=e.indexes[i][r[i]],a=e.values[s]??0;n[o]=a,r[i]++}return n}const jw=(e,t)=>{const n=fr.createTransformer(t),r=Ki(e),o=Ki(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?Qc.has(e)&&!o.values.length||Qc.has(t)&&!r.values.length?Iw(e,t):ns(kv(Vw(r,o),o.values),n):(ei(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),ha(e,t))};function Av(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?qe(e,t,n):Ld(e)(e,t)}const Bw=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>We.update(t,n),stop:()=>dr(t),now:()=>ct.isProcessing?ct.timestamp:Tt.now()}},Mv=(e,t,n=10)=>{let r="";const o=Math.max(Math.round(t/n),2);for(let i=0;i<o;i++)r+=Math.round(e(i/(o-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},ga=2e4;function Od(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<ga;)t+=n,r=e.next(t);return t>=ga?1/0:t}function zw(e,t=100,n){const r=n({...e,keyframes:[0,t]}),o=Math.min(Od(r),ga);return{type:"keyframes",ease:i=>r.next(o*i).value/t,duration:Wt(o)}}const Ww=5;function Nv(e,t,n){const r=Math.max(t-Ww,0);return cv(n-e(r),t-r)}const Ue={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Bl=.001;function Hw({duration:e=Ue.duration,bounce:t=Ue.bounce,velocity:n=Ue.velocity,mass:r=Ue.mass}){let o,i;ei(e<=rn(Ue.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let s=1-t;s=Gn(Ue.minDamping,Ue.maxDamping,s),e=Gn(Ue.minDuration,Ue.maxDuration,Wt(e)),s<1?(o=c=>{const u=c*s,f=u*e,d=u-n,h=eu(c,s),g=Math.exp(-f);return Bl-d/h*g},i=c=>{const f=c*s*e,d=f*n+n,h=Math.pow(s,2)*Math.pow(c,2)*e,g=Math.exp(-f),p=eu(Math.pow(c,2),s);return(-o(c)+Bl>0?-1:1)*((d-h)*g)/p}):(o=c=>{const u=Math.exp(-c*e),f=(c-n)*e+1;return-Bl+u*f},i=c=>{const u=Math.exp(-c*e),f=(n-c)*(e*e);return u*f});const a=5/e,l=Uw(o,i,a);if(e=rn(e),isNaN(l))return{stiffness:Ue.stiffness,damping:Ue.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:s*2*Math.sqrt(r*c),duration:e}}}const Kw=12;function Uw(e,t,n){let r=n;for(let o=1;o<Kw;o++)r=r-e(r)/t(r);return r}function eu(e,t){return e*Math.sqrt(1-t*t)}const Gw=["duration","bounce"],qw=["stiffness","damping","mass"];function zh(e,t){return t.some(n=>e[n]!==void 0)}function Yw(e){let t={velocity:Ue.velocity,stiffness:Ue.stiffness,damping:Ue.damping,mass:Ue.mass,isResolvedFromDuration:!1,...e};if(!zh(e,qw)&&zh(e,Gw))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),o=r*r,i=2*Gn(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:Ue.mass,stiffness:o,damping:i}}else{const n=Hw(e);t={...t,...n,mass:Ue.mass},t.isResolvedFromDuration=!0}return t}function pa(e=Ue.visualDuration,t=Ue.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:o}=n;const i=n.keyframes[0],s=n.keyframes[n.keyframes.length-1],a={done:!1,value:i},{stiffness:l,damping:c,mass:u,duration:f,velocity:d,isResolvedFromDuration:h}=Yw({...n,velocity:-Wt(n.velocity||0)}),g=d||0,p=c/(2*Math.sqrt(l*u)),m=s-i,_=Wt(Math.sqrt(l/u)),y=Math.abs(m)<5;r||(r=y?Ue.restSpeed.granular:Ue.restSpeed.default),o||(o=y?Ue.restDelta.granular:Ue.restDelta.default);let v;if(p<1){const b=eu(_,p);v=w=>{const T=Math.exp(-p*_*w);return s-T*((g+p*_*m)/b*Math.sin(b*w)+m*Math.cos(b*w))}}else if(p===1)v=b=>s-Math.exp(-_*b)*(m+(g+_*m)*b);else{const b=_*Math.sqrt(p*p-1);v=w=>{const T=Math.exp(-p*_*w),E=Math.min(b*w,300);return s-T*((g+p*_*m)*Math.sinh(E)+b*m*Math.cosh(E))/b}}const x={calculatedDuration:h&&f||null,next:b=>{const w=v(b);if(h)a.done=b>=f;else{let T=b===0?g:0;p<1&&(T=b===0?rn(g):Nv(v,b,w));const E=Math.abs(T)<=r,R=Math.abs(s-w)<=o;a.done=E&&R}return a.value=a.done?s:w,a},toString:()=>{const b=Math.min(Od(x),ga),w=Mv(T=>x.next(b*T).value,b,30);return b+"ms "+w},toTransition:()=>{}};return x}pa.applyToOptions=e=>{const t=zw(e,100,pa);return e.ease=t.ease,e.duration=rn(t.duration),e.type="keyframes",e};function tu({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:i=500,modifyTarget:s,min:a,max:l,restDelta:c=.5,restSpeed:u}){const f=e[0],d={done:!1,value:f},h=E=>a!==void 0&&E<a||l!==void 0&&E>l,g=E=>a===void 0?l:l===void 0||Math.abs(a-E)<Math.abs(l-E)?a:l;let p=n*t;const m=f+p,_=s===void 0?m:s(m);_!==m&&(p=_-f);const y=E=>-p*Math.exp(-E/r),v=E=>_+y(E),x=E=>{const R=y(E),M=v(E);d.done=Math.abs(R)<=c,d.value=d.done?_:M};let b,w;const T=E=>{h(d.value)&&(b=E,w=pa({keyframes:[d.value,g(d.value)],velocity:Nv(v,E,d.value),damping:o,stiffness:i,restDelta:c,restSpeed:u}))};return T(0),{calculatedDuration:null,next:E=>{let R=!1;return!w&&b===void 0&&(R=!0,x(E),T(E)),b!==void 0&&E>=b?w.next(E-b):(!R&&x(E),d)}}}function Xw(e,t,n){const r=[],o=n||Yn.mix||Av,i=e.length-1;for(let s=0;s<i;s++){let a=o(e[s],e[s+1]);if(t){const l=Array.isArray(t)?t[s]||Ht:t;a=ns(l,a)}r.push(a)}return r}function Jw(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const i=e.length;if(qn(i===t.length,"Both input and output ranges must be the same length","range-length"),i===1)return()=>t[0];if(i===2&&t[0]===t[1])return()=>t[1];const s=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=Xw(t,r,o),l=a.length,c=u=>{if(s&&u<e[0])return t[0];let f=0;if(l>1)for(;f<e.length-2&&!(u<e[f+1]);f++);const d=Wi(e[f],e[f+1],u);return a[f](d)};return n?u=>c(Gn(e[0],e[i-1],u)):c}function Zw(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=Wi(0,t,r);e.push(qe(n,1,o))}}function Qw(e){const t=[0];return Zw(t,e.length-1),t}function eS(e,t){return e.map(n=>n*t)}function tS(e,t){return e.map(()=>t||vv).splice(0,e.length-1)}function Ao({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=hw(r)?r.map($h):$h(r),i={done:!1,value:t[0]},s=eS(n&&n.length===t.length?n:Qw(t),e),a=Jw(s,t,{ease:Array.isArray(o)?o:tS(t,o)});return{calculatedDuration:e,next:l=>(i.value=a(l),i.done=l>=e,i)}}const nS=e=>e!==null;function Id(e,{repeat:t,repeatType:n="loop"},r,o=1){const i=e.filter(nS),a=o<0||t&&n!=="loop"&&t%2===1?0:i.length-1;return!a||r===void 0?i[a]:r}const rS={decay:tu,inertia:tu,tween:Ao,keyframes:Ao,spring:pa};function Pv(e){typeof e.type=="string"&&(e.type=rS[e.type])}class $d{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const oS=e=>e/100;class Dd extends $d{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==Tt.now()&&this.tick(Tt.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;Pv(t);const{type:n=Ao,repeat:r=0,repeatDelay:o=0,repeatType:i,velocity:s=0}=t;let{keyframes:a}=t;const l=n||Ao;process.env.NODE_ENV!=="production"&&l!==Ao&&qn(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),l!==Ao&&typeof a[0]!="number"&&(this.mixKeyframes=ns(oS,Av(a[0],a[1])),a=[0,100]);const c=l({...t,keyframes:a});i==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...a].reverse(),velocity:-s})),c.calculatedDuration===null&&(c.calculatedDuration=Od(c));const{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+o,this.totalDuration=this.resolvedDuration*(r+1)-o,this.generator=c}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:o,mixKeyframes:i,mirroredGenerator:s,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return r.next(0);const{delay:c=0,keyframes:u,repeat:f,repeatType:d,repeatDelay:h,type:g,onUpdate:p,finalKeyframe:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-o/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const _=this.currentTime-c*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?_<0:_>o;this.currentTime=Math.max(_,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let v=this.currentTime,x=r;if(f){const E=Math.min(this.currentTime,o)/a;let R=Math.floor(E),M=E%1;!M&&E>=1&&(M=1),M===1&&R--,R=Math.min(R,f+1),R%2&&(d==="reverse"?(M=1-M,h&&(M-=h/a)):d==="mirror"&&(x=s)),v=Gn(0,1,M)*a}const b=y?{done:!1,value:u[0]}:x.next(v);i&&(b.value=i(b.value));let{done:w}=b;!y&&l!==null&&(w=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);const T=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&w);return T&&g!==tu&&(b.value=Id(u,this.options,m,this.speed)),p&&p(b.value),T&&this.finish(),b}then(t,n){return this.finished.then(t,n)}get duration(){return Wt(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Wt(t)}get time(){return Wt(this.currentTime)}set time(t){t=rn(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(Tt.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=Wt(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=Bw,startTime:n}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),this.options.onPlay?.();const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Tt.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function iS(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Dr=e=>e*180/Math.PI,nu=e=>{const t=Dr(Math.atan2(e[1],e[0]));return ru(t)},sS={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:nu,rotateZ:nu,skewX:e=>Dr(Math.atan(e[1])),skewY:e=>Dr(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},ru=e=>(e=e%360,e<0&&(e+=360),e),Wh=nu,Hh=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Kh=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),aS={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Hh,scaleY:Kh,scale:e=>(Hh(e)+Kh(e))/2,rotateX:e=>ru(Dr(Math.atan2(e[6],e[5]))),rotateY:e=>ru(Dr(Math.atan2(-e[2],e[0]))),rotateZ:Wh,rotate:Wh,skewX:e=>Dr(Math.atan(e[4])),skewY:e=>Dr(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function ou(e){return e.includes("scale")?1:0}function iu(e,t){if(!e||e==="none")return ou(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,o;if(n)r=aS,o=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=sS,o=a}if(!o)return ou(t);const i=r[t],s=o[1].split(",").map(cS);return typeof i=="function"?i(s):s[i]}const lS=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return iu(n,t)};function cS(e){return parseFloat(e.trim())}const ni=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ri=new Set(ni),Uh=e=>e===ti||e===de,uS=new Set(["x","y","z"]),dS=ni.filter(e=>!uS.has(e));function fS(e){const t=[];return dS.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Br={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>iu(t,"x"),y:(e,{transform:t})=>iu(t,"y")};Br.translateX=Br.x;Br.translateY=Br.y;const zr=new Set;let su=!1,au=!1,lu=!1;function Fv(){if(au){const e=Array.from(zr).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const o=fS(r);o.length&&(n.set(r,o),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const o=n.get(r);o&&o.forEach(([i,s])=>{r.getValue(i)?.set(s)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}au=!1,su=!1,zr.forEach(e=>e.complete(lu)),zr.clear()}function Lv(){zr.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(au=!0)})}function hS(){lu=!0,Lv(),Fv(),lu=!1}class Vd{constructor(t,n,r,o,i,s=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=o,this.element=i,this.isAsync=s}scheduleResolve(){this.state="scheduled",this.isAsync?(zr.add(this),su||(su=!0,We.read(Lv),We.resolveKeyframes(Fv))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:o}=this;if(t[0]===null){const i=o?.get(),s=t[t.length-1];if(i!==void 0)t[0]=i;else if(r&&n){const a=r.readValue(n,s);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=s),o&&i===void 0&&o.set(t[0])}iS(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),zr.delete(this)}cancel(){this.state==="scheduled"&&(zr.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const gS=e=>e.startsWith("--");function pS(e,t,n){gS(t)?e.style.setProperty(t,n):e.style[t]=n}const mS=Td(()=>window.ScrollTimeline!==void 0),yS={};function vS(e,t){const n=Td(e);return()=>yS[t]??n()}const Ov=vS(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Ti=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Gh={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ti([0,.65,.55,1]),circOut:Ti([.55,0,1,.45]),backIn:Ti([.31,.01,.66,-.59]),backOut:Ti([.33,1.53,.69,.99])};function Iv(e,t){if(e)return typeof e=="function"?Ov()?Mv(e,t):"ease-out":_v(e)?Ti(e):Array.isArray(e)?e.map(n=>Iv(n,t)||Gh.easeOut):Gh[e]}function _S(e,t,n,{delay:r=0,duration:o=300,repeat:i=0,repeatType:s="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[t]:n};l&&(u.offset=l);const f=Iv(a,o);Array.isArray(f)&&(u.easing=f);const d={delay:r,duration:o,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:i+1,direction:s==="reverse"?"alternate":"normal"};return c&&(d.pseudoElement=c),e.animate(u,d)}function $v(e){return typeof e=="function"&&"applyToOptions"in e}function xS({type:e,...t}){return $v(e)&&Ov()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class bS extends $d{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:n,name:r,keyframes:o,pseudoElement:i,allowFlatten:s=!1,finalKeyframe:a,onComplete:l}=t;this.isPseudoElement=!!i,this.allowFlatten=s,this.options=t,qn(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const c=xS(t);this.animation=_S(n,r,o,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const u=Id(o,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(u):pS(n,r,u),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return Wt(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Wt(t)}get time(){return Wt(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=rn(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&mS()?(this.animation.timeline=t,Ht):n(this)}}const Dv={anticipate:pv,backInOut:gv,circInOut:yv};function CS(e){return e in Dv}function wS(e){typeof e.ease=="string"&&CS(e.ease)&&(e.ease=Dv[e.ease])}const qh=10;class SS extends bS{constructor(t){wS(t),Pv(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:o,element:i,...s}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const a=new Dd({...s,autoplay:!1}),l=rn(this.finishedTime??this.time);n.setWithVelocity(a.sample(l-qh).value,a.sample(l).value,qh),a.stop()}}const Yh=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(fr.test(e)||e==="0")&&!e.startsWith("url("));function ES(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function TS(e,t,n,r){const o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;const i=e[e.length-1],s=Yh(o,t),a=Yh(i,t);return ei(s===a,`You are trying to animate ${t} from "${o}" to "${i}". "${s?i:o}" is not an animatable value.`,"value-not-animatable"),!s||!a?!1:ES(e)||(n==="spring"||$v(n))&&r}function cu(e){e.duration=0,e.type="keyframes"}const RS=new Set(["opacity","clipPath","filter","transform"]),kS=Td(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function AS(e){const{motionValue:t,name:n,repeatDelay:r,repeatType:o,damping:i,type:s}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=t.owner.getProps();return kS()&&n&&RS.has(n)&&(n!=="transform"||!c)&&!l&&!r&&o!=="mirror"&&i!==0&&s!=="inertia"}const MS=40;class NS extends $d{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:o=0,repeatDelay:i=0,repeatType:s="loop",keyframes:a,name:l,motionValue:c,element:u,...f}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Tt.now();const d={autoplay:t,delay:n,type:r,repeat:o,repeatDelay:i,repeatType:s,name:l,motionValue:c,element:u,...f},h=u?.KeyframeResolver||Vd;this.keyframeResolver=new h(a,(g,p,m)=>this.onKeyframesResolved(g,p,d,!m),l,c,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,r,o){this.keyframeResolver=void 0;const{name:i,type:s,velocity:a,delay:l,isHandoff:c,onUpdate:u}=r;this.resolvedAt=Tt.now(),TS(t,i,s,a)||((Yn.instantAnimations||!l)&&u?.(Id(t,r,n)),t[0]=t[t.length-1],cu(r),r.repeat=0);const d={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>MS?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},h=!c&&AS(d)?new SS({...d,element:d.motionValue.owner.current}):new Dd(d);h.finished.then(()=>this.notifyFinished()).catch(Ht),this.pendingTimeline&&(this.stopTimeline=h.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=h}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),hS()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const PS=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function FS(e){const t=PS.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${n??r}`,o]}const LS=4;function Vv(e,t,n=1){qn(n<=LS,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,o]=FS(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const s=i.trim();return sv(s)?parseFloat(s):s}return Nd(o)?Vv(o,t,n+1):o}function jd(e,t){return e?.[t]??e?.default??e}const jv=new Set(["width","height","top","left","right","bottom",...ni]),OS={test:e=>e==="auto",parse:e=>e},Bv=e=>t=>t.test(e),zv=[ti,de,bn,tr,Ew,Sw,OS],Xh=e=>zv.find(Bv(e));function IS(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||lv(e):!0}const $S=new Set(["brightness","contrast","saturate","opacity"]);function DS(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Pd)||[];if(!r)return e;const o=n.replace(r,"");let i=$S.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+o+")"}const VS=/\b([a-z-]*)\(.*?\)/gu,uu={...fr,getAnimatableNone:e=>{const t=e.match(VS);return t?t.map(DS).join(" "):e}},Jh={...ti,transform:Math.round},jS={rotate:tr,rotateX:tr,rotateY:tr,rotateZ:tr,scale:ks,scaleX:ks,scaleY:ks,scaleZ:ks,skew:tr,skewX:tr,skewY:tr,distance:de,translateX:de,translateY:de,translateZ:de,x:de,y:de,z:de,perspective:de,transformPerspective:de,opacity:Hi,originX:Dh,originY:Dh,originZ:de},Bd={borderWidth:de,borderTopWidth:de,borderRightWidth:de,borderBottomWidth:de,borderLeftWidth:de,borderRadius:de,radius:de,borderTopLeftRadius:de,borderTopRightRadius:de,borderBottomRightRadius:de,borderBottomLeftRadius:de,width:de,maxWidth:de,height:de,maxHeight:de,top:de,right:de,bottom:de,left:de,padding:de,paddingTop:de,paddingRight:de,paddingBottom:de,paddingLeft:de,margin:de,marginTop:de,marginRight:de,marginBottom:de,marginLeft:de,backgroundPositionX:de,backgroundPositionY:de,...jS,zIndex:Jh,fillOpacity:Hi,strokeOpacity:Hi,numOctaves:Jh},BS={...Bd,color:Qe,backgroundColor:Qe,outlineColor:Qe,fill:Qe,stroke:Qe,borderColor:Qe,borderTopColor:Qe,borderRightColor:Qe,borderBottomColor:Qe,borderLeftColor:Qe,filter:uu,WebkitFilter:uu},Wv=e=>BS[e];function Hv(e,t){let n=Wv(e);return n!==uu&&(n=fr),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const zS=new Set(["auto","none","0"]);function WS(e,t,n){let r=0,o;for(;r<e.length&&!o;){const i=e[r];typeof i=="string"&&!zS.has(i)&&Ki(i).values.length&&(o=e[r]),r++}if(o&&n)for(const i of t)e[i]=Hv(n,o)}class HS extends Vd{constructor(t,n,r,o,i){super(t,n,r,o,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let c=t[l];if(typeof c=="string"&&(c=c.trim(),Nd(c))){const u=Vv(c,n.current);u!==void 0&&(t[l]=u),l===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!jv.has(r)||t.length!==2)return;const[o,i]=t,s=Xh(o),a=Xh(i);if(s!==a)if(Uh(s)&&Uh(a))for(let l=0;l<t.length;l++){const c=t[l];typeof c=="string"&&(t[l]=parseFloat(c))}else Br[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let o=0;o<t.length;o++)(t[o]===null||IS(t[o]))&&r.push(o);r.length&&WS(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Br[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const o=n[n.length-1];o!==void 0&&t.getValue(r,o).jump(o,!1)}measureEndState(){const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const o=t.getValue(n);o&&o.jump(this.measuredOrigin,!1);const i=r.length-1,s=r[i];r[i]=Br[n](t.measureViewportBox(),window.getComputedStyle(t.current)),s!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=s),this.removedTransforms?.length&&this.removedTransforms.forEach(([a,l])=>{t.getValue(a).set(l)}),this.resolveNoneKeyframes()}}function KS(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const o=n?.[e]??r.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e)}const Kv=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Uv(e){return av(e)&&"offsetHeight"in e}const Zh=30,US=e=>!isNaN(parseFloat(e));class GS{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{const o=Tt.now();if(this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const i of this.dependents)i.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Tt.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=US(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&kd(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Rd);const r=this.events[t].add(n);return t==="change"?()=>{r(),We.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Tt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Zh)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Zh);return cv(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ko(e,t){return new GS(e,t)}const{schedule:zd}=xv(queueMicrotask,!1),Qt={x:!1,y:!1};function Gv(){return Qt.x||Qt.y}function qS(e){return e==="x"||e==="y"?Qt[e]?null:(Qt[e]=!0,()=>{Qt[e]=!1}):Qt.x||Qt.y?null:(Qt.x=Qt.y=!0,()=>{Qt.x=Qt.y=!1})}function qv(e,t){const n=KS(e),r=new AbortController,o={passive:!0,...t,signal:r.signal};return[n,o,()=>r.abort()]}function Qh(e){return!(e.pointerType==="touch"||Gv())}function YS(e,t,n={}){const[r,o,i]=qv(e,n),s=a=>{if(!Qh(a))return;const{target:l}=a,c=t(l,a);if(typeof c!="function"||!l)return;const u=f=>{Qh(f)&&(c(f),l.removeEventListener("pointerleave",u))};l.addEventListener("pointerleave",u,o)};return r.forEach(a=>{a.addEventListener("pointerenter",s,o)}),i}const Yv=(e,t)=>t?e===t?!0:Yv(e,t.parentElement):!1,Wd=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,XS=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function JS(e){return XS.has(e.tagName)||e.tabIndex!==-1}const Qs=new WeakSet;function eg(e){return t=>{t.key==="Enter"&&e(t)}}function zl(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const ZS=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=eg(()=>{if(Qs.has(n))return;zl(n,"down");const o=eg(()=>{zl(n,"up")}),i=()=>zl(n,"cancel");n.addEventListener("keyup",o,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function tg(e){return Wd(e)&&!Gv()}function QS(e,t,n={}){const[r,o,i]=qv(e,n),s=a=>{const l=a.currentTarget;if(!tg(a))return;Qs.add(l);const c=t(l,a),u=(h,g)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",d),Qs.has(l)&&Qs.delete(l),tg(h)&&typeof c=="function"&&c(h,{success:g})},f=h=>{u(h,l===window||l===document||n.useGlobalTarget||Yv(l,h.target))},d=h=>{u(h,!1)};window.addEventListener("pointerup",f,o),window.addEventListener("pointercancel",d,o)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",s,o),Uv(a)&&(a.addEventListener("focus",c=>ZS(c,o)),!JS(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),i}function Xv(e){return av(e)&&"ownerSVGElement"in e}function eE(e){return Xv(e)&&e.tagName==="svg"}const pt=e=>!!(e&&e.getVelocity),tE=[...zv,Qe,fr],nE=e=>tE.find(Bv(e)),Hd=C.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function ng(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function rE(...e){return t=>{let n=!1;const r=e.map(o=>{const i=ng(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():ng(e[o],null)}}}}function oE(...e){return N.useCallback(rE(...e),e)}class iE extends N.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=n.offsetParent,o=Uv(r)&&r.offsetWidth||0,i=this.props.sizeRef.current;i.height=n.offsetHeight||0,i.width=n.offsetWidth||0,i.top=n.offsetTop,i.left=n.offsetLeft,i.right=o-i.width-i.left}return null}componentDidUpdate(){}render(){return this.props.children}}function sE({children:e,isPresent:t,anchorX:n,root:r}){const o=C.useId(),i=C.useRef(null),s=C.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:a}=C.useContext(Hd),l=oE(i,e?.ref);return C.useInsertionEffect(()=>{const{width:c,height:u,top:f,left:d,right:h}=s.current;if(t||!i.current||!c||!u)return;const g=n==="left"?`left: ${d}`:`right: ${h}`;i.current.dataset.motionPopId=o;const p=document.createElement("style");a&&(p.nonce=a);const m=r??document.head;return m.appendChild(p),p.sheet&&p.sheet.insertRule(`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("react/jsx-runtime"),C=require("react"),z=require("@emotion/css"),zi=require("react-dom"),da=require("@highcharts/react");function Qy(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const N=Qy(C),PC=Qy(zi);function FC(e){const{h:t,w:n,m:r,mx:o,my:i,mt:s,mr:a,mb:l,ml:c,p:u,px:f,py:d,pt:h,pr:g,pb:p,pl:m,gap:_,xGap:y,yGap:v,row:x,flex:b,relative:w,absolute:T,display:E,overflow:R,absoluteFill:M,center:O,justifyContent:D,alignItems:I,alignSelf:L,borderWidth:B,borderBottomWidth:K,borderColor:P,borderRadius:A,borderStyle:$,border:H,zIndex:Q,minWidth:J,minHeight:X,maxWidth:se,maxHeight:re,flexWrap:he,flexGrow:we,flexShrink:te,flexBasis:ye,backgroundColor:Se,position:$e,top:ee,right:pe,bottom:Ne,left:Ze,...Le}=e;return{spacers:{h:t,w:n,m:r,mx:o,my:i,mt:s,mr:a,mb:l,ml:c,p:u,px:f,py:d,pt:h,pr:g,pb:p,pl:m,gap:_,xGap:y,yGap:v,row:x,flex:b,relative:w,absolute:T,display:E,overflow:R,absoluteFill:M,center:O,justifyContent:D,alignItems:I,alignSelf:L,borderWidth:B,borderBottomWidth:K,borderColor:P,borderRadius:A,borderStyle:$,border:H,zIndex:Q,minWidth:J,minHeight:X,maxWidth:se,maxHeight:re,flexWrap:he,flexGrow:we,flexShrink:te,flexBasis:ye,backgroundColor:Se,position:$e,top:ee,right:pe,bottom:Ne,left:Ze},rest:Le}}const LC=e=>z.css({display:e.display??"flex",flexDirection:e.row?"row":"column",height:e.h==="screen"?"100vh":e.h==="full"?"100%":e.h,width:e.w==="screen"?"100vw":e.w==="full"?"100%":e.w,margin:e.m,marginTop:e.mt??e.my,marginBottom:e.mb??e.my,marginLeft:e.ml??e.mx,marginRight:e.mr??e.mx,padding:e.p,paddingTop:e.pt??e.py,paddingBottom:e.pb??e.py,paddingLeft:e.pl??e.px,paddingRight:e.pr??e.px,gap:e.gap,columnGap:e.xGap,rowGap:e.yGap,justifyContent:e.center?"center":e.justifyContent,alignItems:e.center?"center":e.alignItems,alignSelf:e.alignSelf,borderWidth:e.borderWidth,borderBottomWidth:e.borderBottomWidth,borderColor:e.borderColor,borderRadius:e.borderRadius,borderStyle:e.borderStyle,border:e.border,zIndex:e.zIndex,overflow:e.overflow,minWidth:e.minWidth,minHeight:e.minHeight,maxWidth:e.maxWidth,maxHeight:e.maxHeight,flex:e.flex===!0?1:e.flex,flexWrap:e.flexWrap,flexGrow:e.flexGrow,flexShrink:e.flexShrink,flexBasis:e.flexBasis,backgroundColor:e.backgroundColor,position:e?.position?e?.position:e?.absolute?"absolute":e?.relative?"relative":void 0,...e.absoluteFill&&{position:"absolute",top:0,right:0,bottom:0,left:0},top:e?.top,right:e?.right,bottom:e?.bottom,left:e?.left}),q=C.forwardRef(({className:e,children:t,...n},r)=>{const{spacers:o,rest:i}=FC(n),s=C.useMemo(()=>LC(o),[o]);return S.jsx("div",{ref:r,className:z.cx(s,e),...i,children:t})});q.displayName="Box";const OC="_loader_1qleq_8",IC={loader:OC},ev=({color:e="var(--text-accent)"})=>S.jsx("span",{className:z.cx(IC.loader,z.css({"--loader-color":e}))}),tv=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}));var _n=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function _d(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ll={exports:{}};var Fh;function $C(){return Fh||(Fh=1,(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var i="",s=0;s<arguments.length;s++){var a=arguments[s];a&&(i=o(i,r(a)))}return i}function r(i){if(typeof i=="string"||typeof i=="number")return i;if(typeof i!="object")return"";if(Array.isArray(i))return n.apply(null,i);if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]"))return i.toString();var s="";for(var a in i)t.call(i,a)&&i[a]&&(s=o(s,a));return s}function o(i,s){return s?i?i+" "+s:i+s:i}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(Ll)),Ll.exports}var DC=$C();const Pi=_d(DC),VC="_rippleOverlay_s2kim_8",jC="_ripple_s2kim_8",Lh={rippleOverlay:VC,ripple:jC},Ol="button, a, input, label, [role='button'], [data-ripple]";function BC(e){if(typeof e.composedPath=="function")return e.composedPath();const t=[];let n=e.target;for(;n;)t.push(n),n=n.parentNode||n.host;return t.push(window),t}const io=C.forwardRef(({color:e="rgba(0,0,0,0.18)",duration:t=1e3,radius:n="auto",className:r},o)=>{const i=C.useRef(null),[s,a]=C.useState([]),l=C.useRef([]),c=C.useRef(1),u=C.useRef(null),f=()=>{l.current.map(p=>clearTimeout(p)),l.current=[]},d=C.useCallback((p,m,_,y)=>{if(typeof window>"u")return;const v=_.getBoundingClientRect(),x=n==="auto"?Math.max(v.width,v.height)*2:n,b=p-y.left,w=m-y.top,T=Math.max(0,v.top-y.top),E=Math.max(0,v.left-y.left),R=Math.max(0,y.right-v.right),M=Math.max(0,y.bottom-v.bottom),D=window.getComputedStyle(_).borderRadius||"0px",I=c.current++,L={id:I,left:b-x/2,top:w-x/2,size:Math.ceil(x),clip:{top:Math.round(T),right:Math.round(R),bottom:Math.round(M),left:Math.round(E)},borderRadius:D};a(K=>[...K,L]);const B=window.setTimeout(()=>{a(K=>K.filter(P=>P.id!==I))},t+80);l.current.push(B)},[t,n]),h=C.useCallback(p=>{try{if(!i.current)return;const m=i.current,_=m.parentElement;if(!_)return;const y=BC(p);let v=null;for(const E of y)if(E instanceof Element){if(E===_)break;if(E.matches&&E.matches(Ol)){v=E;break}}if(v||(v=_),v.closest&&(v.closest("[disabled]")||v.getAttribute("aria-disabled")==="true"||v.classList.contains("ripple-disabled")))return;const x=p.target;if(x?.closest&&(x.closest("[disabled]")||x.getAttribute?.("aria-disabled")==="true"))return;const b=m.getBoundingClientRect(),{clientX:w}=p,{clientY:T}=p;d(w,T,v,b)}catch{}},[d]),g=C.useCallback(p=>{if(!i.current||!(p.key==="Enter"||p.key===" "))return;const m=i.current,_=m.parentElement;if(!_)return;const y=document.activeElement;let v=null;if(y instanceof Element&&y.matches(Ol)&&(v=y),v||(v=_),v.closest&&(v.closest("[disabled]")||v.getAttribute("aria-disabled")==="true"))return;const x=m.getBoundingClientRect(),b=v.getBoundingClientRect().left+v.getBoundingClientRect().width/2,w=v.getBoundingClientRect().top+v.getBoundingClientRect().height/2;d(b,w,v,x)},[d]);return C.useImperativeHandle(o,()=>({trigger:({center:p=!0,x:m,y:_}={})=>{const y=i.current;if(!y)return;const v=y.parentElement;if(!v)return;const x=y.getBoundingClientRect(),b=document.activeElement instanceof Element&&document.activeElement.matches(Ol)?document.activeElement:v,w=p?b.getBoundingClientRect().left+b.getBoundingClientRect().width/2:m??x.left+x.width/2,T=p?b.getBoundingClientRect().top+b.getBoundingClientRect().height/2:_??x.top+x.height/2;d(w,T,b,x)}}),[d]),C.useEffect(()=>{const p=i.current;if(!p)return;const m=p.parentElement;if(!m||typeof window>"u")return;const _=window.getComputedStyle(m);let y=!1;return _.position==="static"&&(m.style.position="relative",y=!0,u.current=m),m.addEventListener("pointerdown",h,!0),m.addEventListener("keydown",g),()=>{m.removeEventListener("pointerdown",h,!0),m.removeEventListener("keydown",g),y&&u.current&&(u.current.style.position="",u.current=null),f()}},[h,g]),C.useEffect(()=>()=>f(),[]),S.jsx("div",{ref:i,className:`${Lh.rippleOverlay} ${r??""}`,"aria-hidden":!0,children:s.map(p=>S.jsx("span",{className:Lh.ripple,style:{left:`${p.left}px`,top:`${p.top}px`,width:`${p.size}px`,height:`${p.size}px`,backgroundColor:e,animationDuration:`${t}ms`,clipPath:`inset(${p.clip.top}px ${p.clip.right}px ${p.clip.bottom}px ${p.clip.left}px round ${p.borderRadius})`}},p.id))})});function so(e,t){const{current:n}=C.useRef(e!==void 0),[r,o]=C.useState(t),i=n?e:r,s=C.useCallback(a=>{n||o(a)},[]);return[i,s]}function xd(e,t,n,r=""){if(n)return e[`${t}_${n}${r}`]}function fa(e,t,n){return xd(e,t,n,"Size")}const zC="_button_l3j6j_8",WC="_button_primary_l3j6j_19",HC="_button_secondary_l3j6j_22",KC="_button_negative_l3j6j_25",UC="_button_positive_l3j6j_28",GC="_button_warning_l3j6j_31",qC="_button_neutral_l3j6j_34",YC="_button_mdSize_l3j6j_118",XC="_button_smSize_l3j6j_127",JC="_button_xsSize_l3j6j_136",Il={button:zC,button_primary:WC,button_secondary:HC,button_negative:KC,button_positive:UC,button_warning:GC,button_neutral:qC,"button_neutral-white":"_button_neutral-white_l3j6j_37","button_no-bg":"_button_no-bg_l3j6j_40",button_mdSize:YC,button_smSize:XC,button_xsSize:JC};function Kn({attr:e,children:t,className:n,type:r="button",color:o="primary",size:i="md",...s}){const a="button";return S.jsxs("button",{...e,...s,type:r,className:Pi(Il[a],n,fa(Il,a,i),xd(Il,a,o)),children:[S.jsx(io,{}),t]})}const nv=C.createContext({isOpen:!1,onClose:()=>{}}),ZC=()=>C.useContext(nv),QC="_overlay_1gnp0_8",ew="_modal_1gnp0_12",tw="_closeButton_1gnp0_28",nw="_size_lg_1gnp0_35",rw="_size_md_1gnp0_38",ow="_size_sm_1gnp0_41",Ts={overlay:QC,modal:ew,"modal-animation":"_modal-animation_1gnp0_1",closeButton:tw,size_lg:nw,size_md:rw,size_sm:ow},rv=C.forwardRef(({isOpen:e,onClose:t,overlayClassName:n,modalClassName:r,size:o="md",closeOnBackdropClick:i=!0,closeOnEsc:s=!0,disableBodyScroll:a=!0,showAbsoluteCloseButton:l,children:c},u)=>{C.useEffect(()=>{if(a&&e&&typeof window<"u"&&typeof document<"u"){const h=window.getComputedStyle(document.body).overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=h}}},[e,a]);const f=C.useCallback(h=>{h.key==="Escape"&&t()},[t]);C.useEffect(()=>{if(typeof window<"u"&&typeof document<"u"&&s&&e)return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[e,s,f]);const d=C.useCallback(h=>{i&&h.target===h.currentTarget&&t()},[i,t]);return e?S.jsx(_s,{children:S.jsx(nv.Provider,{value:{isOpen:e,onClose:t},children:S.jsx(q,{position:"fixed",top:0,right:0,bottom:0,left:0,row:!0,center:!0,flex:1,onClick:d,backgroundColor:"var(--fill-bg-overlay-primary)",className:z.cx(Ts.overlay,n),zIndex:1,children:S.jsxs(q,{ref:u,className:z.cx(Ts.modal,Ts[`size_${o}`],r),relative:!0,children:[l&&S.jsx(Kn,{className:Ts.closeButton,onClick:t,color:"neutral",children:S.jsx(tv,{})}),c]})})})}):null});rv.displayName="Modal";const iw="_footer_1bo08_8",sw={footer:iw},ov=C.forwardRef(({children:e,row:t=!0,flex:n=!0,gap:r="var(--spacing-lg)",p:o="var(--spacing-2xl)",className:i,...s},a)=>S.jsx(q,{flex:n,row:t,gap:r,p:o,className:z.cx(sw.footer,i),ref:a,...s,children:e}));ov.displayName="ModalFooter";const bd=C.createContext({});function Cd(e){const t=C.useRef(null);return t.current===null&&(t.current=e()),t.current}const wd=typeof window<"u",iv=wd?C.useLayoutEffect:C.useEffect,Ka=C.createContext(null);function Sd(e,t){e.indexOf(t)===-1&&e.push(t)}function Ed(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Gn=(e,t,n)=>n>t?t:n<e?e:n;function Jc(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let ei=()=>{},qn=()=>{};process.env.NODE_ENV!=="production"&&(ei=(e,t,n)=>{!e&&typeof console<"u"&&console.warn(Jc(t,n))},qn=(e,t,n)=>{if(!e)throw new Error(Jc(t,n))});const Yn={},sv=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function av(e){return typeof e=="object"&&e!==null}const lv=e=>/^0[^.\s]+$/u.test(e);function Td(e){let t;return()=>(t===void 0&&(t=e()),t)}const Ht=e=>e,aw=(e,t)=>n=>t(e(n)),ns=(...e)=>e.reduce(aw),Wi=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class Rd{constructor(){this.subscriptions=[]}add(t){return Sd(this.subscriptions,t),()=>Ed(this.subscriptions,t)}notify(t,n,r){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,n,r);else for(let i=0;i<o;i++){const s=this.subscriptions[i];s&&s(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const nn=e=>e*1e3,Wt=e=>e/1e3;function cv(e,t){return t?e*(1e3/t):0}const Oh=new Set;function kd(e,t,n){e||Oh.has(t)||(console.warn(Jc(t,n)),Oh.add(t))}const uv=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,lw=1e-7,cw=12;function uw(e,t,n,r,o){let i,s,a=0;do s=t+(n-t)/2,i=uv(s,r,o)-e,i>0?n=s:t=s;while(Math.abs(i)>lw&&++a<cw);return s}function rs(e,t,n,r){if(e===t&&n===r)return Ht;const o=i=>uw(i,0,1,e,n);return i=>i===0||i===1?i:uv(o(i),t,r)}const dv=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,fv=e=>t=>1-e(1-t),hv=rs(.33,1.53,.69,.99),Ad=fv(hv),gv=dv(Ad),pv=e=>(e*=2)<1?.5*Ad(e):.5*(2-Math.pow(2,-10*(e-1))),Md=e=>1-Math.sin(Math.acos(e)),mv=fv(Md),yv=dv(Md),dw=rs(.42,0,1,1),fw=rs(0,0,.58,1),vv=rs(.42,0,.58,1),hw=e=>Array.isArray(e)&&typeof e[0]!="number",_v=e=>Array.isArray(e)&&typeof e[0]=="number",Ih={linear:Ht,easeIn:dw,easeInOut:vv,easeOut:fw,circIn:Md,circInOut:yv,circOut:mv,backIn:Ad,backInOut:gv,backOut:hv,anticipate:pv},gw=e=>typeof e=="string",$h=e=>{if(_v(e)){qn(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,r,o]=e;return rs(t,n,r,o)}else if(gw(e))return qn(Ih[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),Ih[e];return e},Rs=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function pw(e,t){let n=new Set,r=new Set,o=!1,i=!1;const s=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(u){s.has(u)&&(c.schedule(u),e()),u(a)}const c={schedule:(u,f=!1,d=!1)=>{const g=d&&o?n:r;return f&&s.add(u),g.has(u)||g.add(u),u},cancel:u=>{r.delete(u),s.delete(u)},process:u=>{if(a=u,o){i=!0;return}o=!0,[n,r]=[r,n],n.forEach(l),n.clear(),o=!1,i&&(i=!1,c.process(u))}};return c}const mw=40;function xv(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,s=Rs.reduce((v,x)=>(v[x]=pw(i),v),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:u,update:f,preRender:d,render:h,postRender:g}=s,p=()=>{const v=Yn.useManualTiming?o.timestamp:performance.now();n=!1,Yn.useManualTiming||(o.delta=r?1e3/60:Math.max(Math.min(v-o.timestamp,mw),1)),o.timestamp=v,o.isProcessing=!0,a.process(o),l.process(o),c.process(o),u.process(o),f.process(o),d.process(o),h.process(o),g.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(p))},m=()=>{n=!0,r=!0,o.isProcessing||e(p)};return{schedule:Rs.reduce((v,x)=>{const b=s[x];return v[x]=(w,T=!1,E=!1)=>(n||m(),b.schedule(w,T,E)),v},{}),cancel:v=>{for(let x=0;x<Rs.length;x++)s[Rs[x]].cancel(v)},state:o,steps:s}}const{schedule:We,cancel:dr,state:ct,steps:$l}=xv(typeof requestAnimationFrame<"u"?requestAnimationFrame:Ht,!0);let Zs;function yw(){Zs=void 0}const Tt={now:()=>(Zs===void 0&&Tt.set(ct.isProcessing||Yn.useManualTiming?ct.timestamp:performance.now()),Zs),set:e=>{Zs=e,queueMicrotask(yw)}},bv=e=>t=>typeof t=="string"&&t.startsWith(e),Cv=bv("--"),vw=bv("var(--"),Nd=e=>vw(e)?_w.test(e.split("/*")[0].trim()):!1,_w=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,ti={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Hi={...ti,transform:e=>Gn(0,1,e)},ks={...ti,default:1},Fi=e=>Math.round(e*1e5)/1e5,Pd=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function xw(e){return e==null}const bw=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Fd=(e,t)=>n=>!!(typeof n=="string"&&bw.test(n)&&n.startsWith(e)||t&&!xw(n)&&Object.prototype.hasOwnProperty.call(n,t)),wv=(e,t,n)=>r=>{if(typeof r!="string")return r;const[o,i,s,a]=r.match(Pd);return{[e]:parseFloat(o),[t]:parseFloat(i),[n]:parseFloat(s),alpha:a!==void 0?parseFloat(a):1}},Cw=e=>Gn(0,255,e),Dl={...ti,transform:e=>Math.round(Cw(e))},$r={test:Fd("rgb","red"),parse:wv("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Dl.transform(e)+", "+Dl.transform(t)+", "+Dl.transform(n)+", "+Fi(Hi.transform(r))+")"};function ww(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}const Zc={test:Fd("#"),parse:ww,transform:$r.transform},os=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),tr=os("deg"),bn=os("%"),de=os("px"),Sw=os("vh"),Ew=os("vw"),Dh={...bn,parse:e=>bn.parse(e)/100,transform:e=>bn.transform(e*100)},ko={test:Fd("hsl","hue"),parse:wv("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+bn.transform(Fi(t))+", "+bn.transform(Fi(n))+", "+Fi(Hi.transform(r))+")"},Qe={test:e=>$r.test(e)||Zc.test(e)||ko.test(e),parse:e=>$r.test(e)?$r.parse(e):ko.test(e)?ko.parse(e):Zc.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?$r.transform(e):ko.transform(e),getAnimatableNone:e=>{const t=Qe.parse(e);return t.alpha=0,Qe.transform(t)}},Tw=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Rw(e){return isNaN(e)&&typeof e=="string"&&(e.match(Pd)?.length||0)+(e.match(Tw)?.length||0)>0}const Sv="number",Ev="color",kw="var",Aw="var(",Vh="${}",Mw=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Ki(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let i=0;const a=t.replace(Mw,l=>(Qe.test(l)?(r.color.push(i),o.push(Ev),n.push(Qe.parse(l))):l.startsWith(Aw)?(r.var.push(i),o.push(kw),n.push(l)):(r.number.push(i),o.push(Sv),n.push(parseFloat(l))),++i,Vh)).split(Vh);return{values:n,split:a,indexes:r,types:o}}function Tv(e){return Ki(e).values}function Rv(e){const{split:t,types:n}=Ki(e),r=t.length;return o=>{let i="";for(let s=0;s<r;s++)if(i+=t[s],o[s]!==void 0){const a=n[s];a===Sv?i+=Fi(o[s]):a===Ev?i+=Qe.transform(o[s]):i+=o[s]}return i}}const Nw=e=>typeof e=="number"?0:Qe.test(e)?Qe.getAnimatableNone(e):e;function Pw(e){const t=Tv(e);return Rv(e)(t.map(Nw))}const fr={test:Rw,parse:Tv,createTransformer:Rv,getAnimatableNone:Pw};function Vl(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Fw({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let o=0,i=0,s=0;if(!t)o=i=s=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;o=Vl(l,a,e+1/3),i=Vl(l,a,e),s=Vl(l,a,e-1/3)}return{red:Math.round(o*255),green:Math.round(i*255),blue:Math.round(s*255),alpha:r}}function ha(e,t){return n=>n>0?t:e}const qe=(e,t,n)=>e+(t-e)*n,jl=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},Lw=[Zc,$r,ko],Ow=e=>Lw.find(t=>t.test(e));function jh(e){const t=Ow(e);if(ei(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let n=t.parse(e);return t===ko&&(n=Fw(n)),n}const Bh=(e,t)=>{const n=jh(e),r=jh(t);if(!n||!r)return ha(e,t);const o={...n};return i=>(o.red=jl(n.red,r.red,i),o.green=jl(n.green,r.green,i),o.blue=jl(n.blue,r.blue,i),o.alpha=qe(n.alpha,r.alpha,i),$r.transform(o))},Qc=new Set(["none","hidden"]);function Iw(e,t){return Qc.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function $w(e,t){return n=>qe(e,t,n)}function Ld(e){return typeof e=="number"?$w:typeof e=="string"?Nd(e)?ha:Qe.test(e)?Bh:jw:Array.isArray(e)?kv:typeof e=="object"?Qe.test(e)?Bh:Dw:ha}function kv(e,t){const n=[...e],r=n.length,o=e.map((i,s)=>Ld(i)(i,t[s]));return i=>{for(let s=0;s<r;s++)n[s]=o[s](i);return n}}function Dw(e,t){const n={...e,...t},r={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(r[o]=Ld(e[o])(e[o],t[o]));return o=>{for(const i in r)n[i]=r[i](o);return n}}function Vw(e,t){const n=[],r={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const i=t.types[o],s=e.indexes[i][r[i]],a=e.values[s]??0;n[o]=a,r[i]++}return n}const jw=(e,t)=>{const n=fr.createTransformer(t),r=Ki(e),o=Ki(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?Qc.has(e)&&!o.values.length||Qc.has(t)&&!r.values.length?Iw(e,t):ns(kv(Vw(r,o),o.values),n):(ei(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),ha(e,t))};function Av(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?qe(e,t,n):Ld(e)(e,t)}const Bw=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>We.update(t,n),stop:()=>dr(t),now:()=>ct.isProcessing?ct.timestamp:Tt.now()}},Mv=(e,t,n=10)=>{let r="";const o=Math.max(Math.round(t/n),2);for(let i=0;i<o;i++)r+=Math.round(e(i/(o-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},ga=2e4;function Od(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<ga;)t+=n,r=e.next(t);return t>=ga?1/0:t}function zw(e,t=100,n){const r=n({...e,keyframes:[0,t]}),o=Math.min(Od(r),ga);return{type:"keyframes",ease:i=>r.next(o*i).value/t,duration:Wt(o)}}const Ww=5;function Nv(e,t,n){const r=Math.max(t-Ww,0);return cv(n-e(r),t-r)}const Ue={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Bl=.001;function Hw({duration:e=Ue.duration,bounce:t=Ue.bounce,velocity:n=Ue.velocity,mass:r=Ue.mass}){let o,i;ei(e<=nn(Ue.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let s=1-t;s=Gn(Ue.minDamping,Ue.maxDamping,s),e=Gn(Ue.minDuration,Ue.maxDuration,Wt(e)),s<1?(o=c=>{const u=c*s,f=u*e,d=u-n,h=eu(c,s),g=Math.exp(-f);return Bl-d/h*g},i=c=>{const f=c*s*e,d=f*n+n,h=Math.pow(s,2)*Math.pow(c,2)*e,g=Math.exp(-f),p=eu(Math.pow(c,2),s);return(-o(c)+Bl>0?-1:1)*((d-h)*g)/p}):(o=c=>{const u=Math.exp(-c*e),f=(c-n)*e+1;return-Bl+u*f},i=c=>{const u=Math.exp(-c*e),f=(n-c)*(e*e);return u*f});const a=5/e,l=Uw(o,i,a);if(e=nn(e),isNaN(l))return{stiffness:Ue.stiffness,damping:Ue.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:s*2*Math.sqrt(r*c),duration:e}}}const Kw=12;function Uw(e,t,n){let r=n;for(let o=1;o<Kw;o++)r=r-e(r)/t(r);return r}function eu(e,t){return e*Math.sqrt(1-t*t)}const Gw=["duration","bounce"],qw=["stiffness","damping","mass"];function zh(e,t){return t.some(n=>e[n]!==void 0)}function Yw(e){let t={velocity:Ue.velocity,stiffness:Ue.stiffness,damping:Ue.damping,mass:Ue.mass,isResolvedFromDuration:!1,...e};if(!zh(e,qw)&&zh(e,Gw))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),o=r*r,i=2*Gn(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:Ue.mass,stiffness:o,damping:i}}else{const n=Hw(e);t={...t,...n,mass:Ue.mass},t.isResolvedFromDuration=!0}return t}function pa(e=Ue.visualDuration,t=Ue.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:o}=n;const i=n.keyframes[0],s=n.keyframes[n.keyframes.length-1],a={done:!1,value:i},{stiffness:l,damping:c,mass:u,duration:f,velocity:d,isResolvedFromDuration:h}=Yw({...n,velocity:-Wt(n.velocity||0)}),g=d||0,p=c/(2*Math.sqrt(l*u)),m=s-i,_=Wt(Math.sqrt(l/u)),y=Math.abs(m)<5;r||(r=y?Ue.restSpeed.granular:Ue.restSpeed.default),o||(o=y?Ue.restDelta.granular:Ue.restDelta.default);let v;if(p<1){const b=eu(_,p);v=w=>{const T=Math.exp(-p*_*w);return s-T*((g+p*_*m)/b*Math.sin(b*w)+m*Math.cos(b*w))}}else if(p===1)v=b=>s-Math.exp(-_*b)*(m+(g+_*m)*b);else{const b=_*Math.sqrt(p*p-1);v=w=>{const T=Math.exp(-p*_*w),E=Math.min(b*w,300);return s-T*((g+p*_*m)*Math.sinh(E)+b*m*Math.cosh(E))/b}}const x={calculatedDuration:h&&f||null,next:b=>{const w=v(b);if(h)a.done=b>=f;else{let T=b===0?g:0;p<1&&(T=b===0?nn(g):Nv(v,b,w));const E=Math.abs(T)<=r,R=Math.abs(s-w)<=o;a.done=E&&R}return a.value=a.done?s:w,a},toString:()=>{const b=Math.min(Od(x),ga),w=Mv(T=>x.next(b*T).value,b,30);return b+"ms "+w},toTransition:()=>{}};return x}pa.applyToOptions=e=>{const t=zw(e,100,pa);return e.ease=t.ease,e.duration=nn(t.duration),e.type="keyframes",e};function tu({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:i=500,modifyTarget:s,min:a,max:l,restDelta:c=.5,restSpeed:u}){const f=e[0],d={done:!1,value:f},h=E=>a!==void 0&&E<a||l!==void 0&&E>l,g=E=>a===void 0?l:l===void 0||Math.abs(a-E)<Math.abs(l-E)?a:l;let p=n*t;const m=f+p,_=s===void 0?m:s(m);_!==m&&(p=_-f);const y=E=>-p*Math.exp(-E/r),v=E=>_+y(E),x=E=>{const R=y(E),M=v(E);d.done=Math.abs(R)<=c,d.value=d.done?_:M};let b,w;const T=E=>{h(d.value)&&(b=E,w=pa({keyframes:[d.value,g(d.value)],velocity:Nv(v,E,d.value),damping:o,stiffness:i,restDelta:c,restSpeed:u}))};return T(0),{calculatedDuration:null,next:E=>{let R=!1;return!w&&b===void 0&&(R=!0,x(E),T(E)),b!==void 0&&E>=b?w.next(E-b):(!R&&x(E),d)}}}function Xw(e,t,n){const r=[],o=n||Yn.mix||Av,i=e.length-1;for(let s=0;s<i;s++){let a=o(e[s],e[s+1]);if(t){const l=Array.isArray(t)?t[s]||Ht:t;a=ns(l,a)}r.push(a)}return r}function Jw(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const i=e.length;if(qn(i===t.length,"Both input and output ranges must be the same length","range-length"),i===1)return()=>t[0];if(i===2&&t[0]===t[1])return()=>t[1];const s=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=Xw(t,r,o),l=a.length,c=u=>{if(s&&u<e[0])return t[0];let f=0;if(l>1)for(;f<e.length-2&&!(u<e[f+1]);f++);const d=Wi(e[f],e[f+1],u);return a[f](d)};return n?u=>c(Gn(e[0],e[i-1],u)):c}function Zw(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=Wi(0,t,r);e.push(qe(n,1,o))}}function Qw(e){const t=[0];return Zw(t,e.length-1),t}function eS(e,t){return e.map(n=>n*t)}function tS(e,t){return e.map(()=>t||vv).splice(0,e.length-1)}function Ao({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=hw(r)?r.map($h):$h(r),i={done:!1,value:t[0]},s=eS(n&&n.length===t.length?n:Qw(t),e),a=Jw(s,t,{ease:Array.isArray(o)?o:tS(t,o)});return{calculatedDuration:e,next:l=>(i.value=a(l),i.done=l>=e,i)}}const nS=e=>e!==null;function Id(e,{repeat:t,repeatType:n="loop"},r,o=1){const i=e.filter(nS),a=o<0||t&&n!=="loop"&&t%2===1?0:i.length-1;return!a||r===void 0?i[a]:r}const rS={decay:tu,inertia:tu,tween:Ao,keyframes:Ao,spring:pa};function Pv(e){typeof e.type=="string"&&(e.type=rS[e.type])}class $d{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const oS=e=>e/100;class Dd extends $d{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==Tt.now()&&this.tick(Tt.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;Pv(t);const{type:n=Ao,repeat:r=0,repeatDelay:o=0,repeatType:i,velocity:s=0}=t;let{keyframes:a}=t;const l=n||Ao;process.env.NODE_ENV!=="production"&&l!==Ao&&qn(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),l!==Ao&&typeof a[0]!="number"&&(this.mixKeyframes=ns(oS,Av(a[0],a[1])),a=[0,100]);const c=l({...t,keyframes:a});i==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...a].reverse(),velocity:-s})),c.calculatedDuration===null&&(c.calculatedDuration=Od(c));const{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+o,this.totalDuration=this.resolvedDuration*(r+1)-o,this.generator=c}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:o,mixKeyframes:i,mirroredGenerator:s,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return r.next(0);const{delay:c=0,keyframes:u,repeat:f,repeatType:d,repeatDelay:h,type:g,onUpdate:p,finalKeyframe:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-o/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const _=this.currentTime-c*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?_<0:_>o;this.currentTime=Math.max(_,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let v=this.currentTime,x=r;if(f){const E=Math.min(this.currentTime,o)/a;let R=Math.floor(E),M=E%1;!M&&E>=1&&(M=1),M===1&&R--,R=Math.min(R,f+1),R%2&&(d==="reverse"?(M=1-M,h&&(M-=h/a)):d==="mirror"&&(x=s)),v=Gn(0,1,M)*a}const b=y?{done:!1,value:u[0]}:x.next(v);i&&(b.value=i(b.value));let{done:w}=b;!y&&l!==null&&(w=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);const T=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&w);return T&&g!==tu&&(b.value=Id(u,this.options,m,this.speed)),p&&p(b.value),T&&this.finish(),b}then(t,n){return this.finished.then(t,n)}get duration(){return Wt(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Wt(t)}get time(){return Wt(this.currentTime)}set time(t){t=nn(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(Tt.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=Wt(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=Bw,startTime:n}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),this.options.onPlay?.();const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Tt.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function iS(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Dr=e=>e*180/Math.PI,nu=e=>{const t=Dr(Math.atan2(e[1],e[0]));return ru(t)},sS={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:nu,rotateZ:nu,skewX:e=>Dr(Math.atan(e[1])),skewY:e=>Dr(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},ru=e=>(e=e%360,e<0&&(e+=360),e),Wh=nu,Hh=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Kh=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),aS={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Hh,scaleY:Kh,scale:e=>(Hh(e)+Kh(e))/2,rotateX:e=>ru(Dr(Math.atan2(e[6],e[5]))),rotateY:e=>ru(Dr(Math.atan2(-e[2],e[0]))),rotateZ:Wh,rotate:Wh,skewX:e=>Dr(Math.atan(e[4])),skewY:e=>Dr(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function ou(e){return e.includes("scale")?1:0}function iu(e,t){if(!e||e==="none")return ou(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,o;if(n)r=aS,o=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=sS,o=a}if(!o)return ou(t);const i=r[t],s=o[1].split(",").map(cS);return typeof i=="function"?i(s):s[i]}const lS=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return iu(n,t)};function cS(e){return parseFloat(e.trim())}const ni=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ri=new Set(ni),Uh=e=>e===ti||e===de,uS=new Set(["x","y","z"]),dS=ni.filter(e=>!uS.has(e));function fS(e){const t=[];return dS.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Br={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>iu(t,"x"),y:(e,{transform:t})=>iu(t,"y")};Br.translateX=Br.x;Br.translateY=Br.y;const zr=new Set;let su=!1,au=!1,lu=!1;function Fv(){if(au){const e=Array.from(zr).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const o=fS(r);o.length&&(n.set(r,o),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const o=n.get(r);o&&o.forEach(([i,s])=>{r.getValue(i)?.set(s)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}au=!1,su=!1,zr.forEach(e=>e.complete(lu)),zr.clear()}function Lv(){zr.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(au=!0)})}function hS(){lu=!0,Lv(),Fv(),lu=!1}class Vd{constructor(t,n,r,o,i,s=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=o,this.element=i,this.isAsync=s}scheduleResolve(){this.state="scheduled",this.isAsync?(zr.add(this),su||(su=!0,We.read(Lv),We.resolveKeyframes(Fv))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:o}=this;if(t[0]===null){const i=o?.get(),s=t[t.length-1];if(i!==void 0)t[0]=i;else if(r&&n){const a=r.readValue(n,s);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=s),o&&i===void 0&&o.set(t[0])}iS(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),zr.delete(this)}cancel(){this.state==="scheduled"&&(zr.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const gS=e=>e.startsWith("--");function pS(e,t,n){gS(t)?e.style.setProperty(t,n):e.style[t]=n}const mS=Td(()=>window.ScrollTimeline!==void 0),yS={};function vS(e,t){const n=Td(e);return()=>yS[t]??n()}const Ov=vS(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Ti=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Gh={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ti([0,.65,.55,1]),circOut:Ti([.55,0,1,.45]),backIn:Ti([.31,.01,.66,-.59]),backOut:Ti([.33,1.53,.69,.99])};function Iv(e,t){if(e)return typeof e=="function"?Ov()?Mv(e,t):"ease-out":_v(e)?Ti(e):Array.isArray(e)?e.map(n=>Iv(n,t)||Gh.easeOut):Gh[e]}function _S(e,t,n,{delay:r=0,duration:o=300,repeat:i=0,repeatType:s="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[t]:n};l&&(u.offset=l);const f=Iv(a,o);Array.isArray(f)&&(u.easing=f);const d={delay:r,duration:o,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:i+1,direction:s==="reverse"?"alternate":"normal"};return c&&(d.pseudoElement=c),e.animate(u,d)}function $v(e){return typeof e=="function"&&"applyToOptions"in e}function xS({type:e,...t}){return $v(e)&&Ov()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class bS extends $d{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:n,name:r,keyframes:o,pseudoElement:i,allowFlatten:s=!1,finalKeyframe:a,onComplete:l}=t;this.isPseudoElement=!!i,this.allowFlatten=s,this.options=t,qn(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const c=xS(t);this.animation=_S(n,r,o,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const u=Id(o,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(u):pS(n,r,u),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return Wt(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Wt(t)}get time(){return Wt(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=nn(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&mS()?(this.animation.timeline=t,Ht):n(this)}}const Dv={anticipate:pv,backInOut:gv,circInOut:yv};function CS(e){return e in Dv}function wS(e){typeof e.ease=="string"&&CS(e.ease)&&(e.ease=Dv[e.ease])}const qh=10;class SS extends bS{constructor(t){wS(t),Pv(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:o,element:i,...s}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const a=new Dd({...s,autoplay:!1}),l=nn(this.finishedTime??this.time);n.setWithVelocity(a.sample(l-qh).value,a.sample(l).value,qh),a.stop()}}const Yh=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(fr.test(e)||e==="0")&&!e.startsWith("url("));function ES(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function TS(e,t,n,r){const o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;const i=e[e.length-1],s=Yh(o,t),a=Yh(i,t);return ei(s===a,`You are trying to animate ${t} from "${o}" to "${i}". "${s?i:o}" is not an animatable value.`,"value-not-animatable"),!s||!a?!1:ES(e)||(n==="spring"||$v(n))&&r}function cu(e){e.duration=0,e.type="keyframes"}const RS=new Set(["opacity","clipPath","filter","transform"]),kS=Td(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function AS(e){const{motionValue:t,name:n,repeatDelay:r,repeatType:o,damping:i,type:s}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=t.owner.getProps();return kS()&&n&&RS.has(n)&&(n!=="transform"||!c)&&!l&&!r&&o!=="mirror"&&i!==0&&s!=="inertia"}const MS=40;class NS extends $d{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:o=0,repeatDelay:i=0,repeatType:s="loop",keyframes:a,name:l,motionValue:c,element:u,...f}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Tt.now();const d={autoplay:t,delay:n,type:r,repeat:o,repeatDelay:i,repeatType:s,name:l,motionValue:c,element:u,...f},h=u?.KeyframeResolver||Vd;this.keyframeResolver=new h(a,(g,p,m)=>this.onKeyframesResolved(g,p,d,!m),l,c,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,r,o){this.keyframeResolver=void 0;const{name:i,type:s,velocity:a,delay:l,isHandoff:c,onUpdate:u}=r;this.resolvedAt=Tt.now(),TS(t,i,s,a)||((Yn.instantAnimations||!l)&&u?.(Id(t,r,n)),t[0]=t[t.length-1],cu(r),r.repeat=0);const d={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>MS?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},h=!c&&AS(d)?new SS({...d,element:d.motionValue.owner.current}):new Dd(d);h.finished.then(()=>this.notifyFinished()).catch(Ht),this.pendingTimeline&&(this.stopTimeline=h.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=h}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),hS()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const PS=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function FS(e){const t=PS.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${n??r}`,o]}const LS=4;function Vv(e,t,n=1){qn(n<=LS,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,o]=FS(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const s=i.trim();return sv(s)?parseFloat(s):s}return Nd(o)?Vv(o,t,n+1):o}function jd(e,t){return e?.[t]??e?.default??e}const jv=new Set(["width","height","top","left","right","bottom",...ni]),OS={test:e=>e==="auto",parse:e=>e},Bv=e=>t=>t.test(e),zv=[ti,de,bn,tr,Ew,Sw,OS],Xh=e=>zv.find(Bv(e));function IS(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||lv(e):!0}const $S=new Set(["brightness","contrast","saturate","opacity"]);function DS(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Pd)||[];if(!r)return e;const o=n.replace(r,"");let i=$S.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+o+")"}const VS=/\b([a-z-]*)\(.*?\)/gu,uu={...fr,getAnimatableNone:e=>{const t=e.match(VS);return t?t.map(DS).join(" "):e}},Jh={...ti,transform:Math.round},jS={rotate:tr,rotateX:tr,rotateY:tr,rotateZ:tr,scale:ks,scaleX:ks,scaleY:ks,scaleZ:ks,skew:tr,skewX:tr,skewY:tr,distance:de,translateX:de,translateY:de,translateZ:de,x:de,y:de,z:de,perspective:de,transformPerspective:de,opacity:Hi,originX:Dh,originY:Dh,originZ:de},Bd={borderWidth:de,borderTopWidth:de,borderRightWidth:de,borderBottomWidth:de,borderLeftWidth:de,borderRadius:de,radius:de,borderTopLeftRadius:de,borderTopRightRadius:de,borderBottomRightRadius:de,borderBottomLeftRadius:de,width:de,maxWidth:de,height:de,maxHeight:de,top:de,right:de,bottom:de,left:de,padding:de,paddingTop:de,paddingRight:de,paddingBottom:de,paddingLeft:de,margin:de,marginTop:de,marginRight:de,marginBottom:de,marginLeft:de,backgroundPositionX:de,backgroundPositionY:de,...jS,zIndex:Jh,fillOpacity:Hi,strokeOpacity:Hi,numOctaves:Jh},BS={...Bd,color:Qe,backgroundColor:Qe,outlineColor:Qe,fill:Qe,stroke:Qe,borderColor:Qe,borderTopColor:Qe,borderRightColor:Qe,borderBottomColor:Qe,borderLeftColor:Qe,filter:uu,WebkitFilter:uu},Wv=e=>BS[e];function Hv(e,t){let n=Wv(e);return n!==uu&&(n=fr),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const zS=new Set(["auto","none","0"]);function WS(e,t,n){let r=0,o;for(;r<e.length&&!o;){const i=e[r];typeof i=="string"&&!zS.has(i)&&Ki(i).values.length&&(o=e[r]),r++}if(o&&n)for(const i of t)e[i]=Hv(n,o)}class HS extends Vd{constructor(t,n,r,o,i){super(t,n,r,o,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let c=t[l];if(typeof c=="string"&&(c=c.trim(),Nd(c))){const u=Vv(c,n.current);u!==void 0&&(t[l]=u),l===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!jv.has(r)||t.length!==2)return;const[o,i]=t,s=Xh(o),a=Xh(i);if(s!==a)if(Uh(s)&&Uh(a))for(let l=0;l<t.length;l++){const c=t[l];typeof c=="string"&&(t[l]=parseFloat(c))}else Br[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let o=0;o<t.length;o++)(t[o]===null||IS(t[o]))&&r.push(o);r.length&&WS(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Br[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const o=n[n.length-1];o!==void 0&&t.getValue(r,o).jump(o,!1)}measureEndState(){const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const o=t.getValue(n);o&&o.jump(this.measuredOrigin,!1);const i=r.length-1,s=r[i];r[i]=Br[n](t.measureViewportBox(),window.getComputedStyle(t.current)),s!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=s),this.removedTransforms?.length&&this.removedTransforms.forEach(([a,l])=>{t.getValue(a).set(l)}),this.resolveNoneKeyframes()}}function KS(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const o=n?.[e]??r.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e)}const Kv=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Uv(e){return av(e)&&"offsetHeight"in e}const Zh=30,US=e=>!isNaN(parseFloat(e));class GS{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{const o=Tt.now();if(this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const i of this.dependents)i.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Tt.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=US(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&kd(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Rd);const r=this.events[t].add(n);return t==="change"?()=>{r(),We.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Tt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Zh)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Zh);return cv(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ko(e,t){return new GS(e,t)}const{schedule:zd}=xv(queueMicrotask,!1),Zt={x:!1,y:!1};function Gv(){return Zt.x||Zt.y}function qS(e){return e==="x"||e==="y"?Zt[e]?null:(Zt[e]=!0,()=>{Zt[e]=!1}):Zt.x||Zt.y?null:(Zt.x=Zt.y=!0,()=>{Zt.x=Zt.y=!1})}function qv(e,t){const n=KS(e),r=new AbortController,o={passive:!0,...t,signal:r.signal};return[n,o,()=>r.abort()]}function Qh(e){return!(e.pointerType==="touch"||Gv())}function YS(e,t,n={}){const[r,o,i]=qv(e,n),s=a=>{if(!Qh(a))return;const{target:l}=a,c=t(l,a);if(typeof c!="function"||!l)return;const u=f=>{Qh(f)&&(c(f),l.removeEventListener("pointerleave",u))};l.addEventListener("pointerleave",u,o)};return r.forEach(a=>{a.addEventListener("pointerenter",s,o)}),i}const Yv=(e,t)=>t?e===t?!0:Yv(e,t.parentElement):!1,Wd=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,XS=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function JS(e){return XS.has(e.tagName)||e.tabIndex!==-1}const Qs=new WeakSet;function eg(e){return t=>{t.key==="Enter"&&e(t)}}function zl(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const ZS=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=eg(()=>{if(Qs.has(n))return;zl(n,"down");const o=eg(()=>{zl(n,"up")}),i=()=>zl(n,"cancel");n.addEventListener("keyup",o,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function tg(e){return Wd(e)&&!Gv()}function QS(e,t,n={}){const[r,o,i]=qv(e,n),s=a=>{const l=a.currentTarget;if(!tg(a))return;Qs.add(l);const c=t(l,a),u=(h,g)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",d),Qs.has(l)&&Qs.delete(l),tg(h)&&typeof c=="function"&&c(h,{success:g})},f=h=>{u(h,l===window||l===document||n.useGlobalTarget||Yv(l,h.target))},d=h=>{u(h,!1)};window.addEventListener("pointerup",f,o),window.addEventListener("pointercancel",d,o)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",s,o),Uv(a)&&(a.addEventListener("focus",c=>ZS(c,o)),!JS(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),i}function Xv(e){return av(e)&&"ownerSVGElement"in e}function eE(e){return Xv(e)&&e.tagName==="svg"}const pt=e=>!!(e&&e.getVelocity),tE=[...zv,Qe,fr],nE=e=>tE.find(Bv(e)),Hd=C.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function ng(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function rE(...e){return t=>{let n=!1;const r=e.map(o=>{const i=ng(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():ng(e[o],null)}}}}function oE(...e){return N.useCallback(rE(...e),e)}class iE extends N.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=n.offsetParent,o=Uv(r)&&r.offsetWidth||0,i=this.props.sizeRef.current;i.height=n.offsetHeight||0,i.width=n.offsetWidth||0,i.top=n.offsetTop,i.left=n.offsetLeft,i.right=o-i.width-i.left}return null}componentDidUpdate(){}render(){return this.props.children}}function sE({children:e,isPresent:t,anchorX:n,root:r}){const o=C.useId(),i=C.useRef(null),s=C.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:a}=C.useContext(Hd),l=oE(i,e?.ref);return C.useInsertionEffect(()=>{const{width:c,height:u,top:f,left:d,right:h}=s.current;if(t||!i.current||!c||!u)return;const g=n==="left"?`left: ${d}`:`right: ${h}`;i.current.dataset.motionPopId=o;const p=document.createElement("style");a&&(p.nonce=a);const m=r??document.head;return m.appendChild(p),p.sheet&&p.sheet.insertRule(`
|
|
2
2
|
[data-motion-pop-id="${o}"] {
|
|
3
3
|
position: absolute !important;
|
|
4
4
|
width: ${c}px !important;
|
|
@@ -6,66 +6,66 @@
|
|
|
6
6
|
${g}px !important;
|
|
7
7
|
top: ${f}px !important;
|
|
8
8
|
}
|
|
9
|
-
`),()=>{m.contains(p)&&m.removeChild(p)}},[t]),S.jsx(iE,{isPresent:t,childRef:i,sizeRef:s,children:N.cloneElement(e,{ref:l})})}const aE=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:i,mode:s,anchorX:a,root:l})=>{const c=Cd(lE),u=C.useId();let f=!0,d=C.useMemo(()=>(f=!1,{id:u,initial:t,isPresent:n,custom:o,onExitComplete:h=>{c.set(h,!0);for(const g of c.values())if(!g)return;r&&r()},register:h=>(c.set(h,!1),()=>c.delete(h))}),[n,c,r]);return i&&f&&(d={...d}),C.useMemo(()=>{c.forEach((h,g)=>c.set(g,!1))},[n]),N.useEffect(()=>{!n&&!c.size&&r&&r()},[n]),s==="popLayout"&&(e=S.jsx(sE,{isPresent:n,anchorX:a,root:l,children:e})),S.jsx(Ka.Provider,{value:d,children:e})};function lE(){return new Map}function Jv(e=!0){const t=C.useContext(Ka);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=t,i=C.useId();C.useEffect(()=>{if(e)return o(i)},[e]);const s=C.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,s]:[!0]}const As=e=>e.key||"";function rg(e){const t=[];return C.Children.forEach(e,n=>{C.isValidElement(n)&&t.push(n)}),t}const cE=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:i="sync",propagate:s=!1,anchorX:a="left",root:l})=>{const[c,u]=Jv(s),f=C.useMemo(()=>rg(e),[e]),d=s&&!c?[]:f.map(As),h=C.useRef(!0),g=C.useRef(f),p=Cd(()=>new Map),[m,_]=C.useState(f),[y,v]=C.useState(f);iv(()=>{h.current=!1,g.current=f;for(let w=0;w<y.length;w++){const T=As(y[w]);d.includes(T)?p.delete(T):p.get(T)!==!0&&p.set(T,!1)}},[y,d.length,d.join("-")]);const x=[];if(f!==m){let w=[...f];for(let T=0;T<y.length;T++){const E=y[T],R=As(E);d.includes(R)||(w.splice(T,0,E),x.push(E))}return i==="wait"&&x.length&&(w=x),v(rg(w)),_(f),null}process.env.NODE_ENV!=="production"&&i==="wait"&&y.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:b}=C.useContext(bd);return S.jsx(S.Fragment,{children:y.map(w=>{const T=As(w),E=s&&!c?!1:f===y||d.includes(T),R=()=>{if(p.has(T))p.set(T,!0);else return;let M=!0;p.forEach(O=>{O||(M=!1)}),M&&(b?.(),v(g.current),s&&u?.(),r&&r())};return S.jsx(aE,{isPresent:E,initial:!h.current||n?void 0:!1,custom:t,presenceAffectsLayout:o,mode:i,root:l,onExitComplete:E?void 0:R,anchorX:a,children:w},T)})})},Zv=C.createContext({strict:!1}),og={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Uo={};for(const e in og)Uo[e]={isEnabled:t=>og[e].some(n=>!!t[n])};function uE(e){for(const t in e)Uo[t]={...Uo[t],...e[t]}}const dE=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function ma(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||dE.has(e)}let Qv=e=>!ma(e);function fE(e){typeof e=="function"&&(Qv=t=>t.startsWith("on")?!ma(t):e(t))}try{fE(require("@emotion/is-prop-valid").default)}catch{}function hE(e,t,n){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||(Qv(o)||n===!0&&ma(o)||!t&&!ma(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}const Ua=C.createContext({});function Ga(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Ui(e){return typeof e=="string"||Array.isArray(e)}const Kd=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ud=["initial",...Kd];function qa(e){return Ga(e.animate)||Ud.some(t=>Ui(e[t]))}function e0(e){return!!(qa(e)||e.variants)}function gE(e,t){if(qa(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Ui(n)?n:void 0,animate:Ui(r)?r:void 0}}return e.inherit!==!1?t:{}}function pE(e){const{initial:t,animate:n}=gE(e,C.useContext(Ua));return C.useMemo(()=>({initial:t,animate:n}),[ig(t),ig(n)])}function ig(e){return Array.isArray(e)?e.join(" "):e}function sg(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const vi={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(de.test(e))e=parseFloat(e);else return e;const n=sg(e,t.target.x),r=sg(e,t.target.y);return`${n}% ${r}%`}},mE={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=fr.parse(e);if(o.length>5)return r;const i=fr.createTransformer(e),s=typeof o[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;o[0+s]/=a,o[1+s]/=l;const c=qe(a,l,.5);return typeof o[2+s]=="number"&&(o[2+s]/=c),typeof o[3+s]=="number"&&(o[3+s]/=c),i(o)}},du={borderRadius:{...vi,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:vi,borderTopRightRadius:vi,borderBottomLeftRadius:vi,borderBottomRightRadius:vi,boxShadow:mE};function t0(e,{layout:t,layoutId:n}){return ri.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!du[e]||e==="opacity")}const yE={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},vE=ni.length;function _E(e,t,n){let r="",o=!0;for(let i=0;i<vE;i++){const s=ni[i],a=e[s];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(s.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const c=Kv(a,Bd[s]);if(!l){o=!1;const u=yE[s]||s;r+=`${u}(${c}) `}n&&(t[s]=c)}}return r=r.trim(),n?r=n(t,o?"":r):o&&(r="none"),r}function Gd(e,t,n){const{style:r,vars:o,transformOrigin:i}=e;let s=!1,a=!1;for(const l in t){const c=t[l];if(ri.has(l)){s=!0;continue}else if(Cv(l)){o[l]=c;continue}else{const u=Kv(c,Bd[l]);l.startsWith("origin")?(a=!0,i[l]=u):r[l]=u}}if(t.transform||(s||n?r.transform=_E(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=i;r.transformOrigin=`${l} ${c} ${u}`}}const qd=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function n0(e,t,n){for(const r in t)!pt(t[r])&&!t0(r,n)&&(e[r]=t[r])}function xE({transformTemplate:e},t){return C.useMemo(()=>{const n=qd();return Gd(n,t,e),Object.assign({},n.vars,n.style)},[t])}function bE(e,t){const n=e.style||{},r={};return n0(r,n,e),Object.assign(r,xE(e,t)),r}function CE(e,t){const n={},r=bE(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const wE={offset:"stroke-dashoffset",array:"stroke-dasharray"},SE={offset:"strokeDashoffset",array:"strokeDasharray"};function EE(e,t,n=1,r=0,o=!0){e.pathLength=1;const i=o?wE:SE;e[i.offset]=de.transform(-r);const s=de.transform(t),a=de.transform(n);e[i.array]=`${s} ${a}`}function r0(e,{attrX:t,attrY:n,attrScale:r,pathLength:o,pathSpacing:i=1,pathOffset:s=0,...a},l,c,u){if(Gd(e,a,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:d}=e;f.transform&&(d.transform=f.transform,delete f.transform),(d.transform||f.transformOrigin)&&(d.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete f.transformBox),t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),o!==void 0&&EE(f,o,i,s,!1)}const o0=()=>({...qd(),attrs:{}}),i0=e=>typeof e=="string"&&e.toLowerCase()==="svg";function TE(e,t,n,r){const o=C.useMemo(()=>{const i=o0();return r0(i,t,i0(r),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};n0(i,e.style,e),o.style={...i,...o.style}}return o}const RE=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Yd(e){return typeof e!="string"||e.includes("-")?!1:!!(RE.indexOf(e)>-1||/[A-Z]/u.test(e))}function kE(e,t,n,{latestValues:r},o,i=!1){const a=(Yd(e)?TE:CE)(t,r,o,e),l=hE(t,typeof e=="string",i),c=e!==C.Fragment?{...l,...a,ref:n}:{},{children:u}=t,f=C.useMemo(()=>pt(u)?u.get():u,[u]);return C.createElement(e,{...c,children:f})}function ag(e){const t=[{},{}];return e?.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Xd(e,t,n,r){if(typeof t=="function"){const[o,i]=ag(r);t=t(n!==void 0?n:e.custom,o,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[o,i]=ag(r);t=t(n!==void 0?n:e.custom,o,i)}return t}function ea(e){return pt(e)?e.get():e}function AE({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,o){return{latestValues:ME(n,r,o,e),renderState:t()}}function ME(e,t,n,r){const o={},i=r(e,{});for(const d in i)o[d]=ea(i[d]);let{initial:s,animate:a}=e;const l=qa(e),c=e0(e);t&&c&&!l&&e.inherit!==!1&&(s===void 0&&(s=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||s===!1;const f=u?a:s;if(f&&typeof f!="boolean"&&!Ga(f)){const d=Array.isArray(f)?f:[f];for(let h=0;h<d.length;h++){const g=Xd(e,d[h]);if(g){const{transitionEnd:p,transition:m,..._}=g;for(const y in _){let v=_[y];if(Array.isArray(v)){const x=u?v.length-1:0;v=v[x]}v!==null&&(o[y]=v)}for(const y in p)o[y]=p[y]}}}return o}const s0=e=>(t,n)=>{const r=C.useContext(Ua),o=C.useContext(Ka),i=()=>AE(e,t,r,o);return n?i():Cd(i)};function Jd(e,t,n){const{style:r}=e,o={};for(const i in r)(pt(r[i])||t.style&&pt(t.style[i])||t0(i,e)||n?.getValue(i)?.liveStyle!==void 0)&&(o[i]=r[i]);return o}const NE=s0({scrapeMotionValuesFromProps:Jd,createRenderState:qd});function a0(e,t,n){const r=Jd(e,t,n);for(const o in e)if(pt(e[o])||pt(t[o])){const i=ni.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[i]=e[o]}return r}const PE=s0({scrapeMotionValuesFromProps:a0,createRenderState:o0}),FE=Symbol.for("motionComponentSymbol");function Mo(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function LE(e,t,n){return C.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Mo(n)&&(n.current=r))},[t])}const Zd=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),OE="framerAppearId",l0="data-"+Zd(OE),c0=C.createContext({});function IE(e,t,n,r,o){const{visualElement:i}=C.useContext(Ua),s=C.useContext(Zv),a=C.useContext(Ka),l=C.useContext(Hd).reducedMotion,c=C.useRef(null);r=r||s.renderer,!c.current&&r&&(c.current=r(e,{visualState:t,parent:i,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const u=c.current,f=C.useContext(c0);u&&!u.projection&&o&&(u.type==="html"||u.type==="svg")&&$E(c.current,n,o,f);const d=C.useRef(!1);C.useInsertionEffect(()=>{u&&d.current&&u.update(n,a)});const h=n[l0],g=C.useRef(!!h&&!window.MotionHandoffIsComplete?.(h)&&window.MotionHasOptimisedAnimation?.(h));return iv(()=>{u&&(d.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),u.scheduleRenderMicrotask(),g.current&&u.animationState&&u.animationState.animateChanges())}),C.useEffect(()=>{u&&(!g.current&&u.animationState&&u.animationState.animateChanges(),g.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(h)}),g.current=!1),u.enteringChildren=void 0)}),u}function $E(e,t,n,r){const{layoutId:o,layout:i,drag:s,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:u0(e.parent)),e.projection.setOptions({layoutId:o,layout:i,alwaysMeasureLayout:!!s||a&&Mo(a),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:u,layoutScroll:l,layoutRoot:c})}function u0(e){if(e)return e.options.allowProjection!==!1?e.projection:u0(e.parent)}function Wl(e,{forwardMotionProps:t=!1}={},n,r){n&&uE(n);const o=Yd(e)?PE:NE;function i(a,l){let c;const u={...C.useContext(Hd),...a,layoutId:DE(a)},{isStatic:f}=u,d=pE(a),h=o(a,f);if(!f&&wd){VE(u,n);const g=jE(u);c=g.MeasureLayout,d.visualElement=IE(e,h,u,r,g.ProjectionNode)}return S.jsxs(Ua.Provider,{value:d,children:[c&&d.visualElement?S.jsx(c,{visualElement:d.visualElement,...u}):null,kE(e,a,LE(h,d.visualElement,l),h,f,t)]})}i.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const s=C.forwardRef(i);return s[FE]=e,s}function DE({layoutId:e}){const t=C.useContext(bd).id;return t&&e!==void 0?t+"-"+e:e}function VE(e,t){const n=C.useContext(Zv).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?ei(!1,r,"lazy-strict-mode"):qn(!1,r,"lazy-strict-mode")}}function jE(e){const{drag:t,layout:n}=Uo;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function BE(e,t){if(typeof Proxy>"u")return Wl;const n=new Map,r=(i,s)=>Wl(i,s,e,t),o=(i,s)=>(process.env.NODE_ENV!=="production"&&kd(!1,"motion() is deprecated. Use motion.create() instead."),r(i,s));return new Proxy(o,{get:(i,s)=>s==="create"?r:(n.has(s)||n.set(s,Wl(s,void 0,e,t)),n.get(s))})}function d0({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function zE({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function WE(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Hl(e){return e===void 0||e===1}function fu({scale:e,scaleX:t,scaleY:n}){return!Hl(e)||!Hl(t)||!Hl(n)}function Nr(e){return fu(e)||f0(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function f0(e){return lg(e.x)||lg(e.y)}function lg(e){return e&&e!=="0%"}function ya(e,t,n){const r=e-n,o=t*r;return n+o}function cg(e,t,n,r,o){return o!==void 0&&(e=ya(e,o,r)),ya(e,n,r)+t}function hu(e,t=0,n=1,r,o){e.min=cg(e.min,t,n,r,o),e.max=cg(e.max,t,n,r,o)}function h0(e,{x:t,y:n}){hu(e.x,t.translate,t.scale,t.originPoint),hu(e.y,n.translate,n.scale,n.originPoint)}const ug=.999999999999,dg=1.0000000000001;function HE(e,t,n,r=!1){const o=n.length;if(!o)return;t.x=t.y=1;let i,s;for(let a=0;a<o;a++){i=n[a],s=i.projectionDelta;const{visualElement:l}=i.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&Po(e,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,h0(e,s)),r&&Nr(i.latestValues)&&Po(e,i.latestValues))}t.x<dg&&t.x>ug&&(t.x=1),t.y<dg&&t.y>ug&&(t.y=1)}function No(e,t){e.min=e.min+t,e.max=e.max+t}function fg(e,t,n,r,o=.5){const i=qe(e.min,e.max,o);hu(e,t,n,i,r)}function Po(e,t){fg(e.x,t.x,t.scaleX,t.scale,t.originX),fg(e.y,t.y,t.scaleY,t.scale,t.originY)}function g0(e,t){return d0(WE(e.getBoundingClientRect(),t))}function KE(e,t,n){const r=g0(e,n),{scroll:o}=t;return o&&(No(r.x,o.offset.x),No(r.y,o.offset.y)),r}const hg=()=>({translate:0,scale:1,origin:0,originPoint:0}),Fo=()=>({x:hg(),y:hg()}),gg=()=>({min:0,max:0}),ot=()=>({x:gg(),y:gg()}),gu={current:null},p0={current:!1};function UE(){if(p0.current=!0,!!wd)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>gu.current=e.matches;e.addEventListener("change",t),t()}else gu.current=!1}const GE=new WeakMap;function qE(e,t,n){for(const r in t){const o=t[r],i=n[r];if(pt(o))e.addValue(r,o);else if(pt(i))e.addValue(r,Ko(o,{owner:e}));else if(i!==o)if(e.hasValue(r)){const s=e.getValue(r);s.liveStyle===!0?s.jump(o):s.hasAnimated||s.set(o)}else{const s=e.getStaticValue(r);e.addValue(r,Ko(s!==void 0?s:o,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const pg=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class YE{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:o,blockInitialAnimation:i,visualState:s},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Vd,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const d=Tt.now();this.renderScheduledAt<d&&(this.renderScheduledAt=d,We.render(this.render,!1,!0))};const{latestValues:l,renderState:c}=s;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.options=a,this.blockInitialAnimation=!!i,this.isControllingVariants=qa(n),this.isVariantNode=e0(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const d in f){const h=f[d];l[d]!==void 0&&pt(h)&&h.set(l[d])}}mount(t){this.current=t,GE.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),p0.current||UE(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:gu.current,process.env.NODE_ENV!=="production"&&kd(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),dr(this.notifyUpdate),dr(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=ri.has(t);r&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",s=>{this.latestValues[t]=s,this.props.onUpdate&&We.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{o(),i&&i(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Uo){const n=Uo[t];if(!n)continue;const{isEnabled:r,Feature:o}=n;if(!this.features[t]&&o&&r(this.props)&&(this.features[t]=new o(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ot()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<pg.length;r++){const o=pg[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const i="on"+o,s=t[i];s&&(this.propEventSubscriptions[o]=this.on(o,s))}this.prevMotionValues=qE(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Ko(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(sv(r)||lv(r))?r=parseFloat(r):!nE(r)&&fr.test(n)&&(r=Hv(t,n)),this.setBaseTarget(t,pt(r)?r.get():r)),pt(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const i=Xd(this.props,n,this.presenceContext?.custom);i&&(r=i[t])}if(n&&r!==void 0)return r;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!pt(o)?o:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Rd),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){zd.render(this.render)}}class m0 extends YE{constructor(){super(...arguments),this.KeyframeResolver=HS}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;pt(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function y0(e,{style:t,vars:n},r,o){const i=e.style;let s;for(s in t)i[s]=t[s];o?.applyProjectionStyles(i,r);for(s in n)i.setProperty(s,n[s])}function XE(e){return window.getComputedStyle(e)}class JE extends m0{constructor(){super(...arguments),this.type="html",this.renderInstance=y0}readValueFromInstance(t,n){if(ri.has(n))return this.projection?.isProjecting?ou(n):lS(t,n);{const r=XE(t),o=(Cv(n)?r.getPropertyValue(n):r[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return g0(t,n)}build(t,n,r){Gd(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Jd(t,n,r)}}const v0=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function ZE(e,t,n,r){y0(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(v0.has(o)?o:Zd(o),t.attrs[o])}class QE extends m0{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ot}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(ri.has(n)){const r=Wv(n);return r&&r.default||0}return n=v0.has(n)?n:Zd(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return a0(t,n,r)}build(t,n,r){r0(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,o){ZE(t,n,r,o)}mount(t){this.isSVGTag=i0(t.tagName),super.mount(t)}}const eT=(e,t)=>Yd(e)?new QE(t):new JE(t,{allowProjection:e!==C.Fragment});function Oo(e,t,n){const r=e.getProps();return Xd(r,t,n!==void 0?n:r.custom,e)}const pu=e=>Array.isArray(e);function tT(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Ko(n))}function nT(e){return pu(e)?e[e.length-1]||0:e}function rT(e,t){const n=Oo(e,t);let{transitionEnd:r={},transition:o={},...i}=n||{};i={...i,...r};for(const s in i){const a=nT(i[s]);tT(e,s,a)}}function oT(e){return!!(pt(e)&&e.add)}function mu(e,t){const n=e.getValue("willChange");if(oT(n))return n.add(t);if(!n&&Yn.WillChange){const r=new Yn.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function _0(e){return e.props[l0]}const iT=e=>e!==null;function sT(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(iT),i=t&&n!=="loop"&&t%2===1?0:o.length-1;return o[i]}const aT={type:"spring",stiffness:500,damping:25,restSpeed:10},lT=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),cT={type:"keyframes",duration:.8},uT={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},dT=(e,{keyframes:t})=>t.length>2?cT:ri.has(e)?e.startsWith("scale")?lT(t[1]):aT:uT;function fT({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:i,repeatType:s,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const Qd=(e,t,n,r={},o,i)=>s=>{const a=jd(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-rn(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:d=>{t.set(d),a.onUpdate&&a.onUpdate(d)},onComplete:()=>{s(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:i?void 0:o};fT(a)||Object.assign(u,dT(e,u)),u.duration&&(u.duration=rn(u.duration)),u.repeatDelay&&(u.repeatDelay=rn(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let f=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(cu(u),u.delay===0&&(f=!0)),(Yn.instantAnimations||Yn.skipAnimations)&&(f=!0,cu(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,f&&!i&&t.get()!==void 0){const d=sT(u.keyframes,a);if(d!==void 0){We.update(()=>{u.onUpdate(d),u.onComplete()});return}}return a.isSync?new Dd(u):new NS(u)};function hT({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function x0(e,t,{delay:n=0,transitionOverride:r,type:o}={}){let{transition:i=e.getDefaultTransition(),transitionEnd:s,...a}=t;r&&(i=r);const l=[],c=o&&e.animationState&&e.animationState.getState()[o];for(const u in a){const f=e.getValue(u,e.latestValues[u]??null),d=a[u];if(d===void 0||c&&hT(c,u))continue;const h={delay:n,...jd(i||{},u)},g=f.get();if(g!==void 0&&!f.isAnimating&&!Array.isArray(d)&&d===g&&!h.velocity)continue;let p=!1;if(window.MotionHandoffAnimation){const _=_0(e);if(_){const y=window.MotionHandoffAnimation(_,u,We);y!==null&&(h.startTime=y,p=!0)}}mu(e,u),f.start(Qd(u,f,d,e.shouldReduceMotion&&jv.has(u)?{type:!1}:h,e,p));const m=f.animation;m&&l.push(m)}return s&&Promise.all(l).then(()=>{We.update(()=>{s&&rT(e,s)})}),l}function b0(e,t,n,r=0,o=1){const i=Array.from(e).sort((c,u)=>c.sortNodePosition(u)).indexOf(t),s=e.size,a=(s-1)*r;return typeof n=="function"?n(i,s):o===1?i*r:a-i*r}function yu(e,t,n={}){const r=Oo(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(o=n.transitionOverride);const i=r?()=>Promise.all(x0(e,r,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:c=0,staggerChildren:u,staggerDirection:f}=o;return gT(e,t,l,c,u,f,n)}:()=>Promise.resolve(),{when:a}=o;if(a){const[l,c]=a==="beforeChildren"?[i,s]:[s,i];return l().then(()=>c())}else return Promise.all([i(),s(n.delay)])}function gT(e,t,n=0,r=0,o=0,i=1,s){const a=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),a.push(yu(l,t,{...s,delay:n+(typeof r=="function"?0:r)+b0(e.variantChildren,l,r,o,i)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(a)}function pT(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(i=>yu(e,i,n));r=Promise.all(o)}else if(typeof t=="string")r=yu(e,t,n);else{const o=typeof t=="function"?Oo(e,t,n.custom):t;r=Promise.all(x0(e,o,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function C0(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const mT=Ud.length;function w0(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?w0(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<mT;n++){const r=Ud[n],o=e.props[r];(Ui(o)||o===!1)&&(t[r]=o)}return t}const yT=[...Kd].reverse(),vT=Kd.length;function _T(e){return t=>Promise.all(t.map(({animation:n,options:r})=>pT(e,n,r)))}function xT(e){let t=_T(e),n=mg(),r=!0;const o=l=>(c,u)=>{const f=Oo(e,u,l==="exit"?e.presenceContext?.custom:void 0);if(f){const{transition:d,transitionEnd:h,...g}=f;c={...c,...g,...h}}return c};function i(l){t=l(e)}function s(l){const{props:c}=e,u=w0(e.parent)||{},f=[],d=new Set;let h={},g=1/0;for(let m=0;m<vT;m++){const _=yT[m],y=n[_],v=c[_]!==void 0?c[_]:u[_],x=Ui(v),b=_===l?y.isActive:null;b===!1&&(g=m);let w=v===u[_]&&v!==c[_]&&x;if(w&&r&&e.manuallyAnimateOnMount&&(w=!1),y.protectedKeys={...h},!y.isActive&&b===null||!v&&!y.prevProp||Ga(v)||typeof v=="boolean")continue;const T=bT(y.prevProp,v);let E=T||_===l&&y.isActive&&!w&&x||m>g&&x,R=!1;const M=Array.isArray(v)?v:[v];let O=M.reduce(o(_),{});b===!1&&(O={});const{prevResolvedValues:D={}}=y,I={...D,...O},L=P=>{E=!0,d.has(P)&&(R=!0,d.delete(P)),y.needsAnimating[P]=!0;const A=e.getValue(P);A&&(A.liveStyle=!1)};for(const P in I){const A=O[P],$=D[P];if(h.hasOwnProperty(P))continue;let H=!1;pu(A)&&pu($)?H=!C0(A,$):H=A!==$,H?A!=null?L(P):d.add(P):A!==void 0&&d.has(P)?L(P):y.protectedKeys[P]=!0}y.prevProp=v,y.prevResolvedValues=O,y.isActive&&(h={...h,...O}),r&&e.blockInitialAnimation&&(E=!1);const B=w&&T;E&&(!B||R)&&f.push(...M.map(P=>{const A={type:_};if(typeof P=="string"&&r&&!B&&e.manuallyAnimateOnMount&&e.parent){const{parent:$}=e,H=Oo($,P);if($.enteringChildren&&H){const{delayChildren:Q}=H.transition||{};A.delay=b0($.enteringChildren,e,Q)}}return{animation:P,options:A}}))}if(d.size){const m={};if(typeof c.initial!="boolean"){const _=Oo(e,Array.isArray(c.initial)?c.initial[0]:c.initial);_&&_.transition&&(m.transition=_.transition)}d.forEach(_=>{const y=e.getBaseTarget(_),v=e.getValue(_);v&&(v.liveStyle=!0),m[_]=y??null}),f.push({animation:m})}let p=!!f.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,p?t(f):Promise.resolve()}function a(l,c){if(n[l].isActive===c)return Promise.resolve();e.variantChildren?.forEach(f=>f.animationState?.setActive(l,c)),n[l].isActive=c;const u=s(l);for(const f in n)n[f].protectedKeys={};return u}return{animateChanges:s,setActive:a,setAnimateFunction:i,getState:()=>n,reset:()=>{n=mg()}}}function bT(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!C0(t,e):!1}function Ar(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function mg(){return{animate:Ar(!0),whileInView:Ar(),whileHover:Ar(),whileTap:Ar(),whileDrag:Ar(),whileFocus:Ar(),exit:Ar()}}class Cr{constructor(t){this.isMounted=!1,this.node=t}update(){}}class CT extends Cr{constructor(t){super(t),t.animationState||(t.animationState=xT(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Ga(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let wT=0;class ST extends Cr{constructor(){super(...arguments),this.id=wT++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const o=this.node.animationState.setActive("exit",!t);n&&!t&&o.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const ET={animation:{Feature:CT},exit:{Feature:ST}};function Gi(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function is(e){return{point:{x:e.pageX,y:e.pageY}}}const TT=e=>t=>Wd(t)&&e(t,is(t));function Li(e,t,n,r){return Gi(e,t,TT(n),r)}const S0=1e-4,RT=1-S0,kT=1+S0,E0=.01,AT=0-E0,MT=0+E0;function xt(e){return e.max-e.min}function NT(e,t,n){return Math.abs(e-t)<=n}function yg(e,t,n,r=.5){e.origin=r,e.originPoint=qe(t.min,t.max,e.origin),e.scale=xt(n)/xt(t),e.translate=qe(n.min,n.max,e.origin)-e.originPoint,(e.scale>=RT&&e.scale<=kT||isNaN(e.scale))&&(e.scale=1),(e.translate>=AT&&e.translate<=MT||isNaN(e.translate))&&(e.translate=0)}function Oi(e,t,n,r){yg(e.x,t.x,n.x,r?r.originX:void 0),yg(e.y,t.y,n.y,r?r.originY:void 0)}function vg(e,t,n){e.min=n.min+t.min,e.max=e.min+xt(t)}function PT(e,t,n){vg(e.x,t.x,n.x),vg(e.y,t.y,n.y)}function _g(e,t,n){e.min=t.min-n.min,e.max=e.min+xt(t)}function va(e,t,n){_g(e.x,t.x,n.x),_g(e.y,t.y,n.y)}function Bt(e){return[e("x"),e("y")]}const T0=({current:e})=>e?e.ownerDocument.defaultView:null,xg=(e,t)=>Math.abs(e-t);function FT(e,t){const n=xg(e.x,t.x),r=xg(e.y,t.y);return Math.sqrt(n**2+r**2)}class R0{constructor(t,n,{transformPagePoint:r,contextWindow:o=window,dragSnapToOrigin:i=!1,distanceThreshold:s=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=Ul(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,g=FT(d.offset,{x:0,y:0})>=this.distanceThreshold;if(!h&&!g)return;const{point:p}=d,{timestamp:m}=ct;this.history.push({...p,timestamp:m});const{onStart:_,onMove:y}=this.handlers;h||(_&&_(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,d)},this.handlePointerMove=(d,h)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=Kl(h,this.transformPagePoint),We.update(this.updatePoint,!0)},this.handlePointerUp=(d,h)=>{this.end();const{onEnd:g,onSessionEnd:p,resumeAnimation:m}=this.handlers;if(this.dragSnapToOrigin&&m&&m(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const _=Ul(d.type==="pointercancel"?this.lastMoveEventInfo:Kl(h,this.transformPagePoint),this.history);this.startEvent&&g&&g(d,_),p&&p(d,_)},!Wd(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=s,this.contextWindow=o||window;const a=is(t),l=Kl(a,this.transformPagePoint),{point:c}=l,{timestamp:u}=ct;this.history=[{...c,timestamp:u}];const{onSessionStart:f}=n;f&&f(t,Ul(l,this.history)),this.removeListeners=ns(Li(this.contextWindow,"pointermove",this.handlePointerMove),Li(this.contextWindow,"pointerup",this.handlePointerUp),Li(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),dr(this.updatePoint)}}function Kl(e,t){return t?{point:t(e.point)}:e}function bg(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Ul({point:e},t){return{point:e,delta:bg(e,k0(t)),offset:bg(e,LT(t)),velocity:OT(t,.1)}}function LT(e){return e[0]}function k0(e){return e[e.length-1]}function OT(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=k0(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>rn(t)));)n--;if(!r)return{x:0,y:0};const i=Wt(o.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const s={x:(o.x-r.x)/i,y:(o.y-r.y)/i};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function IT(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?qe(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?qe(n,e,r.max):Math.min(e,n)),e}function Cg(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function $T(e,{top:t,left:n,bottom:r,right:o}){return{x:Cg(e.x,n,o),y:Cg(e.y,t,r)}}function wg(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function DT(e,t){return{x:wg(e.x,t.x),y:wg(e.y,t.y)}}function VT(e,t){let n=.5;const r=xt(e),o=xt(t);return o>r?n=Wi(t.min,t.max-r,e.min):r>o&&(n=Wi(e.min,e.max-o,t.min)),Gn(0,1,n)}function jT(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const vu=.35;function BT(e=vu){return e===!1?e=0:e===!0&&(e=vu),{x:Sg(e,"left","right"),y:Sg(e,"top","bottom")}}function Sg(e,t,n){return{min:Eg(e,t),max:Eg(e,n)}}function Eg(e,t){return typeof e=="number"?e:e[t]||0}const zT=new WeakMap;class WT{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ot(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const i=f=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(is(f).point)},s=(f,d)=>{const{drag:h,dragPropagation:g,onDragStart:p}=this.getProps();if(h&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=qS(h),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=d,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Bt(_=>{let y=this.getAxisMotionValue(_).get()||0;if(bn.test(y)){const{projection:v}=this.visualElement;if(v&&v.layout){const x=v.layout.layoutBox[_];x&&(y=xt(x)*(parseFloat(y)/100))}}this.originPoint[_]=y}),p&&We.postRender(()=>p(f,d)),mu(this.visualElement,"transform");const{animationState:m}=this.visualElement;m&&m.setActive("whileDrag",!0)},a=(f,d)=>{this.latestPointerEvent=f,this.latestPanInfo=d;const{dragPropagation:h,dragDirectionLock:g,onDirectionLock:p,onDrag:m}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:_}=d;if(g&&this.currentDirection===null){this.currentDirection=HT(_),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",d.point,_),this.updateAxis("y",d.point,_),this.visualElement.render(),m&&m(f,d)},l=(f,d)=>{this.latestPointerEvent=f,this.latestPanInfo=d,this.stop(f,d),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>Bt(f=>this.getAnimationState(f)==="paused"&&this.getAxisMotionValue(f).animation?.play()),{dragSnapToOrigin:u}=this.getProps();this.panSession=new R0(t,{onSessionStart:i,onStart:s,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:r,contextWindow:T0(this.visualElement)})}stop(t,n){const r=t||this.latestPointerEvent,o=n||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!o||!r)return;const{velocity:s}=o;this.startAnimation(s);const{onDragEnd:a}=this.getProps();a&&We.postRender(()=>a(r,o))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:o}=this.getProps();if(!r||!Ms(t,o,this.currentDirection))return;const i=this.getAxisMotionValue(t);let s=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(s=IT(s,this.constraints[t],this.elastic[t])),i.set(s)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,o=this.constraints;t&&Mo(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=$T(r.layoutBox,t):this.constraints=!1,this.elastic=BT(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Bt(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=jT(r.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Mo(t))return!1;const r=t.current;qn(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const i=KE(r,o.root,this.visualElement.getTransformPagePoint());let s=DT(o.layout.layoutBox,i);if(n){const a=n(zE(s));this.hasMutatedConstraints=!!a,a&&(s=d0(a))}return s}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:i,dragSnapToOrigin:s,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=Bt(u=>{if(!Ms(u,n,this.currentDirection))return;let f=l&&l[u]||{};s&&(f={min:0,max:0});const d=o?200:1e6,h=o?40:1e7,g={type:"inertia",velocity:r?t[u]:0,bounceStiffness:d,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(u,g)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return mu(this.visualElement,t),r.start(Qd(t,r,0,n,this.visualElement,!1))}stopAnimation(){Bt(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Bt(t=>this.getAxisMotionValue(t).animation?.pause())}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),o=r[n];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Bt(n=>{const{drag:r}=this.getProps();if(!Ms(n,r,this.currentDirection))return;const{projection:o}=this.visualElement,i=this.getAxisMotionValue(n);if(o&&o.layout){const{min:s,max:a}=o.layout.layoutBox[n];i.set(t[n]-qe(s,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Mo(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Bt(s=>{const a=this.getAxisMotionValue(s);if(a&&this.constraints!==!1){const l=a.get();o[s]=VT({min:l,max:l},this.constraints[s])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Bt(s=>{if(!Ms(s,t,null))return;const a=this.getAxisMotionValue(s),{min:l,max:c}=this.constraints[s];a.set(qe(l,c,o[s]))})}addListeners(){if(!this.visualElement.current)return;zT.set(this.visualElement,this);const t=this.visualElement.current,n=Li(t,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();Mo(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,i=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),We.read(r);const s=Gi(window,"resize",()=>this.scalePositionWithinConstraints()),a=o.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(Bt(u=>{const f=this.getAxisMotionValue(u);f&&(this.originPoint[u]+=l[u].translate,f.set(f.get()+l[u].translate))}),this.visualElement.render())}));return()=>{s(),n(),i(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:i=!1,dragElastic:s=vu,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:i,dragElastic:s,dragMomentum:a}}}function Ms(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function HT(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class KT extends Cr{constructor(t){super(t),this.removeGroupControls=Ht,this.removeListeners=Ht,this.controls=new WT(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Ht}unmount(){this.removeGroupControls(),this.removeListeners()}}const Tg=e=>(t,n)=>{e&&We.postRender(()=>e(t,n))};class UT extends Cr{constructor(){super(...arguments),this.removePointerDownListener=Ht}onPointerDown(t){this.session=new R0(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:T0(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:Tg(t),onStart:Tg(n),onMove:r,onEnd:(i,s)=>{delete this.session,o&&We.postRender(()=>o(i,s))}}}mount(){this.removePointerDownListener=Li(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const ta={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let Gl=!1;class GT extends C.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:i}=t;i&&(n.group&&n.group.add(i),r&&r.register&&o&&r.register(i),Gl&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),ta.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:o,isPresent:i}=this.props,{projection:s}=r;return s&&(s.isPresent=i,Gl=!0,o||t.layoutDependency!==n||n===void 0||t.isPresent!==i?s.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?s.promote():s.relegate()||We.postRender(()=>{const a=s.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),zd.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=t;Gl=!0,o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function A0(e){const[t,n]=Jv(),r=C.useContext(bd);return S.jsx(GT,{...e,layoutGroup:r,switchLayoutGroup:C.useContext(c0),isPresent:t,safeToRemove:n})}function qT(e,t,n){const r=pt(e)?e:Ko(e);return r.start(Qd("",r,t,n)),r.animation}const YT=(e,t)=>e.depth-t.depth;class XT{constructor(){this.children=[],this.isDirty=!1}add(t){Sd(this.children,t),this.isDirty=!0}remove(t){Ed(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(YT),this.isDirty=!1,this.children.forEach(t)}}function JT(e,t){const n=Tt.now(),r=({timestamp:o})=>{const i=o-n;i>=t&&(dr(r),e(i-t))};return We.setup(r,!0),()=>dr(r)}const M0=["TopLeft","TopRight","BottomLeft","BottomRight"],ZT=M0.length,Rg=e=>typeof e=="string"?parseFloat(e):e,kg=e=>typeof e=="number"||de.test(e);function QT(e,t,n,r,o,i){o?(e.opacity=qe(0,n.opacity??1,e2(r)),e.opacityExit=qe(t.opacity??1,0,t2(r))):i&&(e.opacity=qe(t.opacity??1,n.opacity??1,r));for(let s=0;s<ZT;s++){const a=`border${M0[s]}Radius`;let l=Ag(t,a),c=Ag(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||kg(l)===kg(c)?(e[a]=Math.max(qe(Rg(l),Rg(c),r),0),(bn.test(c)||bn.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=qe(t.rotate||0,n.rotate||0,r))}function Ag(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const e2=N0(0,.5,mv),t2=N0(.5,.95,Ht);function N0(e,t,n){return r=>r<e?0:r>t?1:n(Wi(e,t,r))}function Mg(e,t){e.min=t.min,e.max=t.max}function Xt(e,t){Mg(e.x,t.x),Mg(e.y,t.y)}function Ng(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Pg(e,t,n,r,o){return e-=t,e=ya(e,1/n,r),o!==void 0&&(e=ya(e,1/o,r)),e}function n2(e,t=0,n=1,r=.5,o,i=e,s=e){if(bn.test(t)&&(t=parseFloat(t),t=qe(s.min,s.max,t/100)-s.min),typeof t!="number")return;let a=qe(i.min,i.max,r);e===i&&(a-=t),e.min=Pg(e.min,t,n,a,o),e.max=Pg(e.max,t,n,a,o)}function Fg(e,t,[n,r,o],i,s){n2(e,t[n],t[r],t[o],t.scale,i,s)}const r2=["x","scaleX","originX"],o2=["y","scaleY","originY"];function Lg(e,t,n,r){Fg(e.x,t,r2,n?n.x:void 0,r?r.x:void 0),Fg(e.y,t,o2,n?n.y:void 0,r?r.y:void 0)}function Og(e){return e.translate===0&&e.scale===1}function P0(e){return Og(e.x)&&Og(e.y)}function Ig(e,t){return e.min===t.min&&e.max===t.max}function i2(e,t){return Ig(e.x,t.x)&&Ig(e.y,t.y)}function $g(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function F0(e,t){return $g(e.x,t.x)&&$g(e.y,t.y)}function Dg(e){return xt(e.x)/xt(e.y)}function Vg(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class s2{constructor(){this.members=[]}add(t){Sd(this.members,t),t.scheduleRender()}remove(t){if(Ed(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(o=>t===o);if(n===0)return!1;let r;for(let o=n;o>=0;o--){const i=this.members[o];if(i.isPresent!==!1){r=i;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;o===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function a2(e,t,n){let r="";const o=e.x.translate/t.x,i=e.y.translate/t.y,s=n?.z||0;if((o||i||s)&&(r=`translate3d(${o}px, ${i}px, ${s}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:f,rotateY:d,skewX:h,skewY:g}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),f&&(r+=`rotateX(${f}deg) `),d&&(r+=`rotateY(${d}deg) `),h&&(r+=`skewX(${h}deg) `),g&&(r+=`skewY(${g}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const ql=["","X","Y","Z"],l2=1e3;let c2=0;function Yl(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function L0(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=_0(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",We,!(o||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&L0(r)}function O0({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(s={},a=t?.()){this.id=c2++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(f2),this.nodes.forEach(m2),this.nodes.forEach(y2),this.nodes.forEach(h2)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new XT)}addEventListener(s,a){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new Rd),this.eventHandlers.get(s).add(a)}notifyListeners(s,...a){const l=this.eventHandlers.get(s);l&&l.notify(...a)}hasListeners(s){return this.eventHandlers.has(s)}mount(s){if(this.instance)return;this.isSVG=Xv(s)&&!eE(s),this.instance=s;const{layoutId:a,layout:l,visualElement:c}=this.options;if(c&&!c.current&&c.mount(s),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),e){let u,f=0;const d=()=>this.root.updateBlockedByResize=!1;We.read(()=>{f=window.innerWidth}),e(s,()=>{const h=window.innerWidth;h!==f&&(f=h,this.root.updateBlockedByResize=!0,u&&u(),u=JT(d,250),ta.hasAnimatedSinceResize&&(ta.hasAnimatedSinceResize=!1,this.nodes.forEach(zg)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:f,hasRelativeLayoutChanged:d,layout:h})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||c.getDefaultTransition()||C2,{onLayoutAnimationStart:p,onLayoutAnimationComplete:m}=c.getProps(),_=!this.targetLayout||!F0(this.targetLayout,h),y=!f&&d;if(this.options.layoutRoot||this.resumeFrom||y||f&&(_||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const v={...jd(g,"layout"),onPlay:p,onComplete:m};(c.shouldReduceMotion||this.options.layoutRoot)&&(v.delay=0,v.type=!1),this.startAnimation(v),this.setAnimationOrigin(u,y)}else f||zg(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=h})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),dr(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(v2),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&L0(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const f=this.path[u];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(jg);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Bg);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(p2),this.nodes.forEach(u2),this.nodes.forEach(d2)):this.nodes.forEach(Bg),this.clearAllSnapshots();const a=Tt.now();ct.delta=Gn(0,1e3/60,a-ct.timestamp),ct.timestamp=a,ct.isProcessing=!0,$l.update.process(ct),$l.preRender.process(ct),$l.render.process(ct),ct.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,zd.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(g2),this.sharedNodes.forEach(_2)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,We.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){We.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!xt(this.snapshot.measuredBox.x)&&!xt(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const s=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=ot(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,s?s.layoutBox:void 0)}updateScroll(s="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(a=!1),a&&this.instance){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:s,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!o)return;const s=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!P0(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;s&&this.instance&&(a||Nr(this.latestValues)||u)&&(o(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return s&&(l=this.removeTransform(l)),w2(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:s}=this.options;if(!s)return ot();const a=s.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(S2))){const{scroll:c}=this.root;c&&(No(a.x,c.offset.x),No(a.y,c.offset.y))}return a}removeElementScroll(s){const a=ot();if(Xt(a,s),this.scroll?.wasRoot)return a;for(let l=0;l<this.path.length;l++){const c=this.path[l],{scroll:u,options:f}=c;c!==this.root&&u&&f.layoutScroll&&(u.wasRoot&&Xt(a,s),No(a.x,u.offset.x),No(a.y,u.offset.y))}return a}applyTransform(s,a=!1){const l=ot();Xt(l,s);for(let c=0;c<this.path.length;c++){const u=this.path[c];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&Po(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),Nr(u.latestValues)&&Po(l,u.latestValues)}return Nr(this.latestValues)&&Po(l,this.latestValues),l}removeTransform(s){const a=ot();Xt(a,s);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!Nr(c.latestValues))continue;fu(c.latestValues)&&c.updateSnapshot();const u=ot(),f=c.measurePageBox();Xt(u,f),Lg(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return Nr(this.latestValues)&&Lg(a,this.latestValues),a}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==ct.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!1){const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(s||l&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:f}=this.options;if(!this.layout||!(u||f))return;this.resolvedRelativeTargetAt=ct.timestamp;const d=this.getClosestProjectingParent();d&&this.linkedParentVersion!==d.layoutVersion&&!d.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(d&&d.layout?this.createRelativeTarget(d,this.layout.layoutBox,d.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=ot(),this.targetWithTransforms=ot()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),PT(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Xt(this.target,this.layout.layoutBox),h0(this.target,this.targetDelta)):Xt(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,d&&!!d.resumingFrom==!!this.resumingFrom&&!d.options.layoutScroll&&d.target&&this.animationProgress!==1?this.createRelativeTarget(d,this.target,d.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||fu(this.parent.latestValues)||f0(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(s,a,l){this.relativeParent=s,this.linkedParentVersion=s.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ot(),this.relativeTargetOrigin=ot(),va(this.relativeTargetOrigin,a,l),Xt(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const s=this.getLead(),a=!!this.resumingFrom||this!==s;let l=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===ct.timestamp&&(l=!1),l)return;const{layout:c,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||u))return;Xt(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,d=this.treeScale.y;HE(this.layoutCorrected,this.treeScale,this.path,a),s.layout&&!s.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(s.target=s.layout.layoutBox,s.targetWithTransforms=ot());const{target:h}=s;if(!h){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Ng(this.prevProjectionDelta.x,this.projectionDelta.x),Ng(this.prevProjectionDelta.y,this.projectionDelta.y)),Oi(this.projectionDelta,this.layoutCorrected,h,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==d||!Vg(this.projectionDelta.x,this.prevProjectionDelta.x)||!Vg(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",h))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){if(this.options.visualElement?.scheduleRender(),s){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Fo(),this.projectionDelta=Fo(),this.projectionDeltaWithTransform=Fo()}setAnimationOrigin(s,a=!1){const l=this.snapshot,c=l?l.latestValues:{},u={...this.latestValues},f=Fo();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const d=ot(),h=l?l.source:void 0,g=this.layout?this.layout.source:void 0,p=h!==g,m=this.getStack(),_=!m||m.members.length<=1,y=!!(p&&!_&&this.options.crossfade===!0&&!this.path.some(b2));this.animationProgress=0;let v;this.mixTargetDelta=x=>{const b=x/1e3;Wg(f.x,s.x,b),Wg(f.y,s.y,b),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(va(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox),x2(this.relativeTarget,this.relativeTargetOrigin,d,b),v&&i2(this.relativeTarget,v)&&(this.isProjectionDirty=!1),v||(v=ot()),Xt(v,this.relativeTarget)),p&&(this.animationValues=u,QT(u,c,this.latestValues,b,y,_)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=b},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(dr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=We.update(()=>{ta.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Ko(0)),this.currentAnimation=qT(this.motionValue,[0,1e3],{...s,velocity:0,isSync:!0,onUpdate:a=>{this.mixTargetDelta(a),s.onUpdate&&s.onUpdate(a)},onStop:()=>{},onComplete:()=>{s.onComplete&&s.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(l2),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=s;if(!(!a||!l||!c)){if(this!==s&&this.layout&&c&&I0(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||ot();const f=xt(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+f;const d=xt(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+d}Xt(a,l),Po(a,u),Oi(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(s,a){this.sharedNodes.has(s)||this.sharedNodes.set(s,new s2),this.sharedNodes.get(s).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){const{layoutId:s}=this.options;return s?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:s}=this.options;return s?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),s&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){const{visualElement:s}=this.options;if(!s)return;let a=!1;const{latestValues:l}=s;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&Yl("z",s,c,this.animationValues);for(let u=0;u<ql.length;u++)Yl(`rotate${ql[u]}`,s,c,this.animationValues),Yl(`skew${ql[u]}`,s,c,this.animationValues);s.render();for(const u in c)s.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);s.scheduleRender()}applyProjectionStyles(s,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){s.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,s.visibility="",s.opacity="",s.pointerEvents=ea(a?.pointerEvents)||"",s.transform=l?l(this.latestValues,""):"none";return}const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(s.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,s.pointerEvents=ea(a?.pointerEvents)||""),this.hasProjected&&!Nr(this.latestValues)&&(s.transform=l?l({},""):"none",this.hasProjected=!1);return}s.visibility="";const u=c.animationValues||c.latestValues;this.applyTransformsToTarget();let f=a2(this.projectionDeltaWithTransform,this.treeScale,u);l&&(f=l(u,f)),s.transform=f;const{x:d,y:h}=this.projectionDelta;s.transformOrigin=`${d.origin*100}% ${h.origin*100}% 0`,c.animationValues?s.opacity=c===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:s.opacity=c===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const g in du){if(u[g]===void 0)continue;const{correct:p,applyTo:m,isCSSVariable:_}=du[g],y=f==="none"?u[g]:p(u[g],c);if(m){const v=m.length;for(let x=0;x<v;x++)s[m[x]]=y}else _?this.options.visualElement.renderState.vars[g]=y:s[g]=y}this.options.layoutId&&(s.pointerEvents=c===this?ea(a?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>s.currentAnimation?.stop()),this.root.nodes.forEach(jg),this.root.sharedNodes.clear()}}}function u2(e){e.updateLayout()}function d2(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:r}=e.layout,{animationType:o}=e.options,i=t.source!==e.layout.source;o==="size"?Bt(u=>{const f=i?t.measuredBox[u]:t.layoutBox[u],d=xt(f);f.min=n[u].min,f.max=f.min+d}):I0(o,t.layoutBox,n)&&Bt(u=>{const f=i?t.measuredBox[u]:t.layoutBox[u],d=xt(n[u]);f.max=f.min+d,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[u].max=e.relativeTarget[u].min+d)});const s=Fo();Oi(s,n,t.layoutBox);const a=Fo();i?Oi(a,e.applyTransform(r,!0),t.measuredBox):Oi(a,n,t.layoutBox);const l=!P0(s);let c=!1;if(!e.resumeFrom){const u=e.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:f,layout:d}=u;if(f&&d){const h=ot();va(h,t.layoutBox,f.layoutBox);const g=ot();va(g,n,d.layoutBox),F0(h,g)||(c=!0),u.options.layoutRoot&&(e.relativeTarget=g,e.relativeTargetOrigin=h,e.relativeParent=u)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:a,layoutDelta:s,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function f2(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function h2(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function g2(e){e.clearSnapshot()}function jg(e){e.clearMeasurements()}function Bg(e){e.isLayoutDirty=!1}function p2(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function zg(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function m2(e){e.resolveTargetDelta()}function y2(e){e.calcProjection()}function v2(e){e.resetSkewAndRotation()}function _2(e){e.removeLeadSnapshot()}function Wg(e,t,n){e.translate=qe(t.translate,0,n),e.scale=qe(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Hg(e,t,n,r){e.min=qe(t.min,n.min,r),e.max=qe(t.max,n.max,r)}function x2(e,t,n,r){Hg(e.x,t.x,n.x,r),Hg(e.y,t.y,n.y,r)}function b2(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const C2={duration:.45,ease:[.4,0,.1,1]},Kg=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Ug=Kg("applewebkit/")&&!Kg("chrome/")?Math.round:Ht;function Gg(e){e.min=Ug(e.min),e.max=Ug(e.max)}function w2(e){Gg(e.x),Gg(e.y)}function I0(e,t,n){return e==="position"||e==="preserve-aspect"&&!NT(Dg(t),Dg(n),.2)}function S2(e){return e!==e.root&&e.scroll?.wasRoot}const E2=O0({attachResizeListener:(e,t)=>Gi(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Xl={current:void 0},$0=O0({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Xl.current){const e=new E2({});e.mount(window),e.setOptions({layoutScroll:!0}),Xl.current=e}return Xl.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),T2={pan:{Feature:UT},drag:{Feature:KT,ProjectionNode:$0,MeasureLayout:A0}};function qg(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,i=r[o];i&&We.postRender(()=>i(t,is(t)))}class R2 extends Cr{mount(){const{current:t}=this.node;t&&(this.unmount=YS(t,(n,r)=>(qg(this.node,r,"Start"),o=>qg(this.node,o,"End"))))}unmount(){}}class k2 extends Cr{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=ns(Gi(this.node.current,"focus",()=>this.onFocus()),Gi(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Yg(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),i=r[o];i&&We.postRender(()=>i(t,is(t)))}class A2 extends Cr{mount(){const{current:t}=this.node;t&&(this.unmount=QS(t,(n,r)=>(Yg(this.node,r,"Start"),(o,{success:i})=>Yg(this.node,o,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const _u=new WeakMap,Jl=new WeakMap,M2=e=>{const t=_u.get(e.target);t&&t(e)},N2=e=>{e.forEach(M2)};function P2({root:e,...t}){const n=e||document;Jl.has(n)||Jl.set(n,{});const r=Jl.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(N2,{root:e,...t})),r[o]}function F2(e,t,n){const r=P2(t);return _u.set(e,n),r.observe(e),()=>{_u.delete(e),r.unobserve(e)}}const L2={some:0,all:1};class O2 extends Cr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:o="some",once:i}=t,s={root:n?n.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:L2[o]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,i&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:f}=this.node.getProps(),d=c?u:f;d&&d(l)};return F2(this.node.current,s,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(I2(t,n))&&this.startObserver()}unmount(){}}function I2({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const $2={inView:{Feature:O2},tap:{Feature:A2},focus:{Feature:k2},hover:{Feature:R2}},D2={layout:{ProjectionNode:$0,MeasureLayout:A0}},V2={...ET,...$2,...T2,...D2},Ya=BE(V2,eT),j2="_primary_13825_8",B2="_secondary_13825_12",z2="_tertiary_13825_16",W2="_positive_13825_20",H2="_negative_13825_24",K2="_warning_13825_28",U2="_accent_13825_32",G2="_inverse_13825_36",q2="_text_13825_111",Y2="_regular_13825_117",X2="_medium_13825_121",J2="_semibold_13825_125",Z2="_bold_13825_129",Ns={primary:j2,secondary:B2,tertiary:z2,positive:W2,negative:H2,warning:K2,accent:U2,inverse:G2,"title-1":"_title-1_13825_41","title-2":"_title-2_13825_51","title-3":"_title-3_13825_61","headline-1":"_headline-1_13825_76","headline-2":"_headline-2_13825_81","headline-3":"_headline-3_13825_86","body-1":"_body-1_13825_91","body-2":"_body-2_13825_96","caption-1":"_caption-1_13825_101","caption-2":"_caption-2_13825_106",text:q2,regular:Y2,medium:X2,semibold:J2,bold:Z2},Q2=e=>{let t;e.center?t="center":e.left?t="left":e.right&&(t="right");let n;return e.uppercase?n="uppercase":e.lowercase?n="lowercase":e.capitalize&&(n="capitalize"),z.css({marginTop:e.mt,marginBottom:e.mb,marginRight:e.mr,marginLeft:e.ml,flex:e.flex,cursor:e.cursor,wordBreak:e.wordBreak,whiteSpace:e.whiteSpace,textOverflow:e.textOverflow,textDecoration:e.decoration,textAlign:t,textTransform:n,color:e.color,opacity:e.disabled?.5:void 0,overflow:e.overflow})},ce=C.forwardRef(({children:e,className:t,variant:n="body-1",fontWeight:r="medium",tag:o="p",colorName:i="primary",style:s,clickOpacity:a=.5,opacityDuration:l=200,onClick:c,disabled:u,mt:f,mb:d,ml:h,mr:g,flex:p,cursor:m,wordBreak:_,whiteSpace:y,textOverflow:v,decoration:x,color:b,center:w,left:T,right:E,uppercase:R,lowercase:M,capitalize:O,overflow:D,...I},L)=>{const[B,K]=C.useState(!1),P=!!c,A=()=>P&&K(!0),$=()=>P&&K(!1),H=Q2({mt:f,mb:d,ml:h,mr:g,flex:p,cursor:m,wordBreak:_,whiteSpace:y,textOverflow:v,decoration:x,color:b,center:w,left:T,right:E,uppercase:R,lowercase:M,capitalize:O,overflow:D}),Q=o,J=P?z.css({opacity:B?a:1,transition:`opacity ${l}ms ease`}):"";return S.jsx(Q,{ref:L,...I,className:z.cx(Ns.text,Ns[n],Ns[i],Ns[r],J,t,H),style:s,onClick:c,onMouseDown:A,onMouseUp:$,onMouseLeave:$,onTouchStart:A,onTouchEnd:$,role:P?"button":void 0,tabIndex:P?0:void 0,children:e})});ce.displayName="Text";const D0=Ya(ce),eR=z.css({display:"flex",alignItems:"center",justifyContent:"center",position:"relative",borderRadius:16,height:48,padding:"0 16px",cursor:"pointer",fontSize:16,fontWeight:600,overflow:"hidden",transition:"all 0.2s ease",gap:8}),_i={zero:"var(--corner-zero)",xs:"var(--corner-xs)",sm:"var(--corner-sm)",md:"var(--corner-md)",lg:"var(--corner-lg)",xl:"var(--corner-xl)","2xl":"var(--corner-2xl)","3xl":"var(--corner-3xl)","4xl":"var(--corner-4xl)","5xl":"var(--corner-5xl)","6xl":"var(--corner-6xl)","full-round":"var(--corner-full-round)"},tR={xs:"var(--height-button-xs)",sm:"var(--height-button-sm)",md:"var(--height-button-md)",lg:"var(--height-button-lg)"},nR={clear:z.css({backgroundColor:"transparent",border:"none"}),filled:z.css({backgroundColor:"var(--fill-accent-primary)",color:"white",border:"none"}),outline:z.css({backgroundColor:"transparent",border:"1px solid var(--border-accent-primary)"})},rR=(e,t,n,r)=>{if(r)return z.css({cursor:"not-allowed",opacity:.7});const o={transition:"all 0.2s ease",borderRadius:"var(--corner-lg)",border:"none",color:e==="filled"?"var(--text-inverse)":`var(--text-${t})`};switch(e){case"filled":return z.css({...o,backgroundColor:`var(--fill-${t}-${n})`,":hover":{backgroundColor:`var(--fill-${t}-${n}-hover)`},":active":{backgroundColor:`var(--fill-${t}-${n}-hover)`}});case"outline":return z.css({...o,backgroundColor:"transparent",border:`1px solid var(--border-${t}-${n})`,":hover":{backgroundColor:`var(--fill-${t}-secondary-hover)`},":active":{backgroundColor:`var(--fill-${t}-secondary-hover)`}});case"clear":return z.css({...o,backgroundColor:"transparent",":hover":{backgroundColor:`var(--fill-${t}-secondary-hover)`},":active":{backgroundColor:`var(--fill-${t}-secondary-hover)`}});default:return z.css(o)}},Go=({disabled:e,loading:t,wrapperClassName:n,buttonClassName:r,buttonDisabledClassName:o,textClassName:i,children:s,variant:a="filled",backgroundColor:l,textColor:c,textFontWeight:u,borderColor:f,color:d="accent",opacity:h,borderRadius:g,width:p="full",size:m="md",iconLeft:_,iconRight:y,intensity:v="primary",flex:x,type:b="button",...w})=>{const T=C.useMemo(()=>{switch(p){case"full":return"100%";case"auto":return"auto";default:return p}},[p]),E=C.useMemo(()=>l||(a==="filled"?d==="neutral"?"var(--fill-neutral-secondary)":`var(--fill-${d}-${v})`:"transparent"),[a,l,d,v]),R=C.useMemo(()=>{if(v==="primary"){if(d==="neutral")return"var(--text-secondary)";if(a==="filled")return"var(--text-inverse)"}else if(d==="neutral")return"var(--text-secondary)";return`var(--text-${d})`},[v,d,a]),M=C.useMemo(()=>{if(v==="primary"){if(d==="neutral")return"secondary";if(a==="filled")return"inverse"}else if(d==="neutral")return"secondary";return d},[a,d,v]),O=C.useMemo(()=>f||(a==="outline"?`var(--border-${d}-${v})`:"transparent"),[a,f,d,v]),D=C.useMemo(()=>{switch(m){case"lg":return _i.lg;case"md":case"sm":return _i.md;case"xs":return _i.sm;default:return _i.md}},[m]),I=z.cx(eR,rR(a,d,v,e),nR[a],e?o:void 0,z.css({borderRadius:g?_i[g]:D,backgroundColor:E,borderColor:O,color:c,width:"100%",height:tR[m],opacity:h||(e?.7:1)}),r),L=C.useMemo(()=>{switch(m){case"lg":case"md":return"body-1";case"sm":case"xs":return"body-2";default:return"body-1"}},[m]);return S.jsx(q,{className:z.cx(n),w:T,flex:x,relative:!0,overflow:"hidden",children:S.jsxs(Ya.button,{...w,whileTap:!e&&!t?{scale:.99,boxShadow:"inset 0 0 0 10000px rgba(0,0,0,0.1)",transition:{duration:0}}:{},disabled:e||t,className:I,children:[t?S.jsx(ev,{color:R}):S.jsxs(S.Fragment,{children:[_,S.jsx(D0,{style:{color:c},colorName:M,variant:L,className:i,textOverflow:"ellipsis",overflow:"hidden",children:s}),y]}),S.jsx(io,{})]})})},oR=e=>N.createElement("svg",{width:16,height:16,viewBox:"0 0 24 24",fill:"none",...e},N.createElement("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z",fill:"currentColor"})),iR=e=>N.createElement("svg",{viewBox:"0 0 24 24",fill:"none",...e},N.createElement("path",{d:"M19 13H5v-2h14v2z",fill:"currentColor"})),sR="_checkbox_22ifd_8",aR="_disabled_22ifd_14",lR="_checkbox__ripple_22ifd_14",cR="_checkbox__input_22ifd_26",uR="_checkbox__box_22ifd_33",dR="_secondary_22ifd_46",fR="_checked_22ifd_52",hR="_error_22ifd_61",Pn={checkbox:sR,disabled:aR,checkbox__ripple:lR,checkbox__input:cR,checkbox__box:uR,secondary:dR,checked:fR,error:hR},gR={sm:20,md:24},ef=C.forwardRef(({checked:e,onChange:t,disabled:n,error:r,indeterminate:o,size:i="md",title:s,titleColor:a,subtitle:l,subtitleColor:c="secondary",name:u,required:f,variant:d="primary",flex:h,readOnly:g},p)=>{const[m,_]=C.useState(!1),y=e!==void 0,v=y?e:m,x=R=>{y||_(R.target.checked),t?.(R)},b=gR[i],w=v||o,T=!!g&&!n,E=n?"not-allowed":T?"auto":"pointer";return S.jsxs("label",{className:z.cx(Pn.checkbox,z.css({flex:h,cursor:E}),{[Pn.disabled]:n}),children:[S.jsxs(q,{relative:!0,display:"inline-flex",style:{"--checkbox-size":`${b}px`,"--checkbox-size-double":`${b*2}px`},children:[S.jsx("input",{ref:p,type:"checkbox",checked:v,onChange:T?void 0:x,onClick:R=>R.stopPropagation(),disabled:n,readOnly:T,name:u,required:f,className:z.cx(Pn.checkbox__input,{[Pn.disabled]:n},z.css({cursor:E}))}),S.jsx("div",{className:z.cx(Pn.checkbox__box,Pn[d],{[Pn.disabled]:n,[Pn.error]:r,[Pn.checked]:w}),children:w&&(o?S.jsx(iR,{width:b*.75,height:b*.75}):S.jsx(oR,{width:b*.75,height:b*.75}))})]}),(s||l)&&S.jsxs(q,{gap:4,children:[s&&S.jsx(ce,{colorName:a,variant:i==="sm"?"body-2":"body-1",children:s}),l&&S.jsx(ce,{variant:"body-2",colorName:c,children:l})]})]})});ef.displayName="Checkbox";const pR=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("g",{opacity:.5},N.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.0002 17.9999C14.4185 17.9999 18.0002 14.4182 18.0002 9.99991C18.0002 5.58163 14.4185 1.99991 10.0002 1.99991C5.58197 1.99991 2.00024 5.58163 2.00024 9.99991C2.00024 14.4182 5.58197 17.9999 10.0002 17.9999ZM6.46514 6.46446C6.85566 6.07393 7.48883 6.07393 7.87935 6.46446L9.64712 8.23222C9.84238 8.42749 10.159 8.42749 10.3542 8.23222L12.122 6.46446C12.5125 6.07393 13.1457 6.07393 13.5362 6.46446C13.9267 6.85498 13.9267 7.48814 13.5362 7.87867L11.7684 9.64644C11.5732 9.8417 11.5732 10.1583 11.7684 10.3535L13.5362 12.1213C13.9267 12.5118 13.9267 13.145 13.5362 13.5355C13.1457 13.926 12.5125 13.926 12.122 13.5355L10.3542 11.7678C10.159 11.5725 9.84238 11.5725 9.64712 11.7678L7.87935 13.5355C7.48883 13.926 6.85566 13.926 6.46514 13.5355C6.07462 13.145 6.07462 12.5118 6.46514 12.1213L8.23291 10.3535C8.42817 10.1583 8.42817 9.8417 8.23291 9.64644L6.46514 7.87867C6.07462 7.48815 6.07462 6.85498 6.46514 6.46446Z",fill:"currentColor"}))),mR="_disabled_1kvy1_20",yR="_multiline_1kvy1_24",vR="_input_1kvy1_8",_R="_sm_1kvy1_74",xR="_md_1kvy1_79",bR="_error_1kvy1_84",CR="_primary_1kvy1_88",wR="_secondary_1kvy1_92",ft={"input-container":"_input-container_1kvy1_8",disabled:mR,multiline:yR,input:vR,"input-text-size_sm":"_input-text-size_sm_1kvy1_55","input-text-size_md":"_input-text-size_md_1kvy1_59","input-text-align_left":"_input-text-align_left_1kvy1_64","input-text-align_center":"_input-text-align_center_1kvy1_67","input-text-align_right":"_input-text-align_right_1kvy1_70",sm:_R,md:xR,error:bR,primary:CR,secondary:wR,"clear-button":"_clear-button_1kvy1_96"};function Xg(e){return{...new Event("input",{bubbles:!0}),target:e,currentTarget:e}}const qo=C.forwardRef((e,t)=>{const{label:n,prompt:r,error:o,errorText:i,size:s="md",prefix:a,suffix:l,background:c="primary",showClearButton:u,disabled:f,value:d,defaultValue:h,inputClassName:g,textAlign:p="left",...m}=e,_=e.multiline===!0,y=C.useRef(null),v=C.useRef(null),[x,b]=so(typeof d=="string"||typeof d=="number"?String(d):void 0,typeof h=="string"||typeof h=="number"?String(h):"");C.useImperativeHandle(t,()=>({focus:()=>{y.current?.focus(),v.current?.focus()},blur:()=>{y.current?.blur(),v.current?.blur()},get value(){return y.current?.value||v.current?.value},set value(M){b(M),y.current&&(y.current.value=M),v.current&&(v.current.value=M)}}));const w=M=>{if(b(M.target.value),_){const O=e.onChange;O?.(M)}else{const O=e.onChange;O?.(M)}};C.useEffect(()=>{_&&e.autoResize&&v.current&&(v.current.style.height="auto",v.current.style.height=`${v.current.scrollHeight}px`)},[x,_,e.autoResize]);const T=()=>{if(b(""),!_){const O=y.current;if(O){O.value="";const D=Xg(O),I=e.onChange;I?.(D)}return}const M=v.current;if(M){M.value="";const O=Xg(M),D=e.onChange;D?.(O)}},E=()=>{if(_){const{rows:I,autoResize:L,onChange:B,multiline:K,...P}=m;return S.jsx("textarea",{ref:v,rows:e.rows??3,className:z.cx(ft.input,g,{[ft.disabled]:f,[ft[`input-text-align_${p}`]]:!!p}),disabled:f,maxLength:e.maxLength,...P,value:x,onChange:w})}const{onChange:M,multiline:O,...D}=m;return S.jsx("input",{...D,ref:y,className:z.cx(ft.input,ft[`input-text-size_${s}`],g,{[ft.disabled]:f,[ft[`input-text-align_${p}`]]:!!p}),disabled:f,type:e.type??"text",value:x,onChange:w})},R=C.useMemo(()=>c==="white"?ft.primary:c==="gray"?ft.secondary:ft[c],[c]);return S.jsxs(q,{w:"full",gap:"var(--spacing-sm)",children:[typeof n=="string"?S.jsx(ce,{variant:"body-2",fontWeight:"regular",colorName:"tertiary",children:n}):n,S.jsxs(q,{row:!0,alignItems:_?"flex-start":"center",w:"full",gap:"var(--spacing-md)",className:z.cx(ft["input-container"],R,ft[s],{[ft.error]:o,[ft.disabled]:f,[ft.multiline]:_}),children:[a&&S.jsx(q,{flex:"none",children:a}),S.jsx(q,{flex:"1",children:E()}),u&&x&&!f&&S.jsx(q,{flex:"none",children:S.jsx("span",{className:ft["clear-button"],onClick:T,children:S.jsx(pR,{})})}),l&&S.jsx(q,{flex:"none",children:l})]}),(r||_)&&S.jsxs(q,{row:!0,gap:10,w:"full",children:[typeof r=="string"?S.jsx(ce,{variant:"caption-1",colorName:"tertiary",children:r}):r,_&&e.maxLength&&S.jsx(ce,{right:!0,ml:"auto",flex:"none",variant:"caption-1",colorName:"tertiary",children:`${x.length}/${e.maxLength}`})]}),i&&o&&S.jsx(ce,{variant:"body-2",colorName:"negative",fontWeight:"regular",children:i})]})});qo.displayName="Input";const SR=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M15 8.33333H5M17.5 5H2.5M17.5 11.6667H2.5M15 15H5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),ER=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M13.3333 8.33333H2.5M16.6667 5H2.5M16.6667 11.6667H2.5M13.3333 15H2.5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),TR=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M17.5 8.33333H6.66665M17.5 5H3.33331M17.5 11.6667H3.33331M17.5 15H6.66665",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),RR=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M5 10H11.6667C13.5076 10 15 8.50766 15 6.66671C15 4.82576 13.5076 3.33337 11.6667 3.33337H5V10ZM5 10H12.5C14.3409 10 15.8333 11.4924 15.8333 13.3334C15.8333 15.1743 14.3409 16.6667 12.5 16.6667H5V10Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),kR=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M13.5 17.5H5.77614C5.2713 17.5 5.01887 17.5 4.90199 17.4002C4.80056 17.3135 4.74674 17.1836 4.75721 17.0506C4.76927 16.8974 4.94776 16.7189 5.30474 16.3619L12.3905 9.27614C12.7205 8.94613 12.8855 8.78112 13.0758 8.7193C13.2432 8.66492 13.4235 8.66492 13.5908 8.7193C13.7811 8.78112 13.9461 8.94613 14.2761 9.27614L17.5 12.5V13.5M13.5 17.5C14.9001 17.5 15.6002 17.5 16.135 17.2275C16.6054 16.9878 16.9878 16.6054 17.2275 16.135C17.5 15.6002 17.5 14.9001 17.5 13.5M13.5 17.5H6.5C5.09987 17.5 4.3998 17.5 3.86502 17.2275C3.39462 16.9878 3.01217 16.6054 2.77248 16.135C2.5 15.6002 2.5 14.9001 2.5 13.5V6.5C2.5 5.09987 2.5 4.3998 2.77248 3.86502C3.01217 3.39462 3.39462 3.01217 3.86502 2.77248C4.3998 2.5 5.09987 2.5 6.5 2.5H13.5C14.9001 2.5 15.6002 2.5 16.135 2.77248C16.6054 3.01217 16.9878 3.39462 17.2275 3.86502C17.5 4.3998 17.5 5.09987 17.5 6.5V13.5M8.75 7.08333C8.75 8.00381 8.00381 8.75 7.08333 8.75C6.16286 8.75 5.41667 8.00381 5.41667 7.08333C5.41667 6.16286 6.16286 5.41667 7.08333 5.41667C8.00381 5.41667 8.75 6.16286 8.75 7.08333Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),AR=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M15.8334 3.33337H8.33335M11.6667 16.6667H4.16669M12.5 3.33337L7.50002 16.6667",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),MR=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("g",{clipPath:"url(#clip0_1571_1710)"},N.createElement("path",{d:"M8.33332 10.8333C8.69119 11.3118 9.14778 11.7077 9.67211 11.9941C10.1964 12.2806 10.7762 12.4509 11.3722 12.4936C11.9681 12.5363 12.5663 12.4503 13.1261 12.2415C13.6859 12.0327 14.1942 11.7059 14.6167 11.2833L17.1167 8.78335C17.8756 7.9975 18.2956 6.94499 18.2861 5.85251C18.2766 4.76002 17.8384 3.71497 17.0659 2.94243C16.2934 2.1699 15.2483 1.7317 14.1558 1.7222C13.0633 1.71271 12.0108 2.13269 11.225 2.89168L9.79165 4.31668M11.6666 9.16668C11.3088 8.68824 10.8522 8.29236 10.3279 8.0059C9.80353 7.71943 9.22373 7.54908 8.62777 7.5064C8.03182 7.46372 7.43366 7.54971 6.87386 7.75853C6.31406 7.96735 5.80572 8.29412 5.38332 8.71668L2.88332 11.2167C2.12432 12.0025 1.70435 13.055 1.71384 14.1475C1.72334 15.24 2.16154 16.2851 2.93407 17.0576C3.70661 17.8301 4.75166 18.2683 5.84414 18.2778C6.93663 18.2873 7.98914 17.8673 8.77498 17.1083L10.2 15.6833",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),N.createElement("defs",null,N.createElement("clipPath",{id:"clip0_1571_1710"},N.createElement("rect",{width:20,height:20,fill:"white"})))),NR=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M17.5 9.99996L7.5 9.99996M17.5 4.99996L7.5 4.99996M17.5 15L7.5 15M4.16667 9.99996C4.16667 10.4602 3.79357 10.8333 3.33333 10.8333C2.8731 10.8333 2.5 10.4602 2.5 9.99996C2.5 9.53972 2.8731 9.16663 3.33333 9.16663C3.79357 9.16663 4.16667 9.53972 4.16667 9.99996ZM4.16667 4.99996C4.16667 5.4602 3.79357 5.83329 3.33333 5.83329C2.8731 5.83329 2.5 5.4602 2.5 4.99996C2.5 4.53972 2.8731 4.16663 3.33333 4.16663C3.79357 4.16663 4.16667 4.53972 4.16667 4.99996ZM4.16667 15C4.16667 15.4602 3.79357 15.8333 3.33333 15.8333C2.8731 15.8333 2.5 15.4602 2.5 15C2.5 14.5397 2.8731 14.1666 3.33333 14.1666C3.79357 14.1666 4.16667 14.5397 4.16667 15Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),PR=e=>N.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M14 8.74967C14.4142 8.74967 14.75 8.41389 14.75 7.99967C14.75 7.58546 14.4142 7.24967 14 7.24967V7.99967V8.74967ZM6 7.24967C5.58579 7.24967 5.25 7.58546 5.25 7.99967C5.25 8.41389 5.58579 8.74967 6 8.74967V7.99967V7.24967ZM14 4.74967C14.4142 4.74967 14.75 4.41389 14.75 3.99967C14.75 3.58546 14.4142 3.24967 14 3.24967V3.99967V4.74967ZM6 3.24967C5.58579 3.24967 5.25 3.58546 5.25 3.99967C5.25 4.41389 5.58579 4.74967 6 4.74967V3.99967V3.24967ZM14 12.7497C14.4142 12.7497 14.75 12.4139 14.75 11.9997C14.75 11.5855 14.4142 11.2497 14 11.2497V11.9997V12.7497ZM6 11.2497C5.58579 11.2497 5.25 11.5855 5.25 11.9997C5.25 12.4139 5.58579 12.7497 6 12.7497V11.9997V11.2497ZM1.58967 3.48952C1.24295 3.71614 1.14558 4.18092 1.3722 4.52765C1.59882 4.87437 2.0636 4.97174 2.41033 4.74512L2 4.11732L1.58967 3.48952ZM3.2 3.33301H3.95C3.95 3.05764 3.79909 2.80441 3.5569 2.67337C3.31471 2.54233 3.02018 2.55455 2.78967 2.70521L3.2 3.33301ZM2.4 5.91634C1.98579 5.91634 1.65 6.25213 1.65 6.66634C1.65 7.08055 1.98579 7.41634 2.4 7.41634V6.66634V5.91634ZM4 7.41634C4.41421 7.41634 4.75 7.08055 4.75 6.66634C4.75 6.25213 4.41421 5.91634 4 5.91634V6.66634V7.41634ZM3.73743 10.8967L4.2726 11.4222L4.2726 11.4222L3.73743 10.8967ZM2 12.6663L1.46483 12.1409C1.25318 12.3565 1.19153 12.678 1.30841 12.9565C1.4253 13.2351 1.69791 13.4163 2 13.4163V12.6663ZM4 13.4163C4.41421 13.4163 4.75 13.0806 4.75 12.6663C4.75 12.2521 4.41421 11.9163 4 11.9163V12.6663V13.4163ZM1.25 10.2589C1.25 10.6731 1.58579 11.0089 2 11.0089C2.41421 11.0089 2.75 10.6731 2.75 10.2589H2H1.25ZM14 7.99967V7.24967L6 7.24967V7.99967V8.74967L14 8.74967V7.99967ZM14 3.99967V3.24967H6V3.99967V4.74967H14V3.99967ZM14 11.9997V11.2497L6 11.2497V11.9997V12.7497L14 12.7497V11.9997ZM2 4.11732L2.41033 4.74512L3.61033 3.96081L3.2 3.33301L2.78967 2.70521L1.58967 3.48952L2 4.11732ZM3.2 3.33301H2.45V6.66634H3.2H3.95V3.33301H3.2ZM3.2 6.66634V5.91634H2.4V6.66634V7.41634H3.2V6.66634ZM3.2 6.66634V7.41634H4V6.66634V5.91634H3.2V6.66634ZM3.73743 10.8967L3.20226 10.3713L1.46483 12.1409L2 12.6663L2.53517 13.1918L4.2726 11.4222L3.73743 10.8967ZM2 12.6663V13.4163H4V12.6663V11.9163H2V12.6663ZM4 10.2654H3.25C3.25 10.2957 3.23759 10.3353 3.20225 10.3713L3.73743 10.8967L4.2726 11.4222C4.57518 11.114 4.75 10.7002 4.75 10.2654H4ZM3 9.33301V10.083C3.08406 10.083 3.1515 10.1147 3.19493 10.1553C3.23791 10.1955 3.25 10.2354 3.25 10.2654H4H4.75C4.75 9.29296 3.91808 8.58301 3 8.58301V9.33301ZM2 10.2589H2.75C2.75 10.2299 2.76126 10.1927 2.80245 10.1545C2.84462 10.1155 2.91258 10.083 3 10.083V9.33301V8.58301C2.0889 8.58301 1.25 9.28004 1.25 10.2589H2Z",fill:"currentColor"})),FR=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M5 13.3334C5 15.1743 6.49238 16.6667 8.33333 16.6667H11.6667C13.5076 16.6667 15 15.1743 15 13.3334C15 11.4924 13.5076 10 11.6667 10M15 6.66671C15 4.82576 13.5076 3.33337 11.6667 3.33337H8.33333C6.49238 3.33337 5 4.82576 5 6.66671M2.5 10H17.5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),LR=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M2.5 7.5L17.5 7.5M7.5 2.5L7.5 17.5M6.5 2.5H13.5C14.9001 2.5 15.6002 2.5 16.135 2.77248C16.6054 3.01217 16.9878 3.39462 17.2275 3.86502C17.5 4.3998 17.5 5.09987 17.5 6.5V13.5C17.5 14.9001 17.5 15.6002 17.2275 16.135C16.9878 16.6054 16.6054 16.9878 16.135 17.2275C15.6002 17.5 14.9001 17.5 13.5 17.5H6.5C5.09987 17.5 4.3998 17.5 3.86502 17.2275C3.39462 16.9878 3.01217 16.6054 2.77248 16.135C2.5 15.6002 2.5 14.9001 2.5 13.5V6.5C2.5 5.09987 2.5 4.3998 2.77248 3.86502C3.01217 3.39462 3.39462 3.01217 3.86502 2.77248C4.3998 2.5 5.09987 2.5 6.5 2.5Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),OR=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M15 3.33337V9.16671C15 11.9281 12.7614 14.1667 9.99998 14.1667C7.23856 14.1667 4.99998 11.9281 4.99998 9.16671V3.33337M3.33331 17.5H16.6666",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),V0=C.createContext(null);function tf(){const e=C.useContext(V0);if(!e)throw new Error("useEditorStates must be used within EditorState Provider");return e}const j0=C.createContext(null);function IR(){const e=C.useContext(j0);if(!e)throw new Error("useToolbarContext must be used within ToolbarContext provider");return e}var Ri={exports:{}};Ri.exports;var Jg;function $R(){return Jg||(Jg=1,(function(e,t){var n=200,r="__lodash_hash_undefined__",o=800,i=16,s=9007199254740991,a="[object Arguments]",l="[object Array]",c="[object AsyncFunction]",u="[object Boolean]",f="[object Date]",d="[object Error]",h="[object Function]",g="[object GeneratorFunction]",p="[object Map]",m="[object Number]",_="[object Null]",y="[object Object]",v="[object Proxy]",x="[object RegExp]",b="[object Set]",w="[object String]",T="[object Undefined]",E="[object WeakMap]",R="[object ArrayBuffer]",M="[object DataView]",O="[object Float32Array]",D="[object Float64Array]",I="[object Int8Array]",L="[object Int16Array]",B="[object Int32Array]",K="[object Uint8Array]",P="[object Uint8ClampedArray]",A="[object Uint16Array]",$="[object Uint32Array]",H=/[\\^$.*+?()[\]{}|]/g,Q=/^\[object .+?Constructor\]$/,J=/^(?:0|[1-9]\d*)$/,X={};X[O]=X[D]=X[I]=X[L]=X[B]=X[K]=X[P]=X[A]=X[$]=!0,X[a]=X[l]=X[R]=X[u]=X[M]=X[f]=X[d]=X[h]=X[p]=X[m]=X[y]=X[x]=X[b]=X[w]=X[E]=!1;var se=typeof _n=="object"&&_n&&_n.Object===Object&&_n,re=typeof self=="object"&&self&&self.Object===Object&&self,he=se||re||Function("return this")(),we=t&&!t.nodeType&&t,te=we&&!0&&e&&!e.nodeType&&e,ye=te&&te.exports===we,Se=ye&&se.process,$e=(function(){try{var k=te&&te.require&&te.require("util").types;return k||Se&&Se.binding&&Se.binding("util")}catch{}})(),ee=$e&&$e.isTypedArray;function pe(k,F,j){switch(j.length){case 0:return k.call(F);case 1:return k.call(F,j[0]);case 2:return k.call(F,j[0],j[1]);case 3:return k.call(F,j[0],j[1],j[2])}return k.apply(F,j)}function Ne(k,F){for(var j=-1,ne=Array(k);++j<k;)ne[j]=F(j);return ne}function Ze(k){return function(F){return k(F)}}function Le(k,F){return k?.[F]}function Qn(k,F){return function(j){return k(F(j))}}var hn=Array.prototype,gn=Function.prototype,Dt=Object.prototype,ve=he["__core-js_shared__"],Re=gn.toString,Vt=Dt.hasOwnProperty,ph=(function(){var k=/[^.]+$/.exec(ve&&ve.keys&&ve.keys.IE_PROTO||"");return k?"Symbol(src)_1."+k:""})(),mh=Dt.toString,Tb=Re.call(Object),Rb=RegExp("^"+Re.call(Vt).replace(H,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),xs=ye?he.Buffer:void 0,yh=he.Symbol,vh=he.Uint8Array;xs&&xs.allocUnsafe;var _h=Qn(Object.getPrototypeOf,Object),xh=Object.create,kb=Dt.propertyIsEnumerable,Ab=hn.splice,Tr=yh?yh.toStringTag:void 0,bs=(function(){try{var k=Tl(Object,"defineProperty");return k({},"",{}),k}catch{}})(),Mb=xs?xs.isBuffer:void 0,bh=Math.max,Nb=Date.now,Ch=Tl(he,"Map"),pi=Tl(Object,"create"),Pb=(function(){function k(){}return function(F){if(!kr(F))return{};if(xh)return xh(F);k.prototype=F;var j=new k;return k.prototype=void 0,j}})();function Rr(k){var F=-1,j=k==null?0:k.length;for(this.clear();++F<j;){var ne=k[F];this.set(ne[0],ne[1])}}function Fb(){this.__data__=pi?pi(null):{},this.size=0}function Lb(k){var F=this.has(k)&&delete this.__data__[k];return this.size-=F?1:0,F}function Ob(k){var F=this.__data__;if(pi){var j=F[k];return j===r?void 0:j}return Vt.call(F,k)?F[k]:void 0}function Ib(k){var F=this.__data__;return pi?F[k]!==void 0:Vt.call(F,k)}function $b(k,F){var j=this.__data__;return this.size+=this.has(k)?0:1,j[k]=pi&&F===void 0?r:F,this}Rr.prototype.clear=Fb,Rr.prototype.delete=Lb,Rr.prototype.get=Ob,Rr.prototype.has=Ib,Rr.prototype.set=$b;function Nn(k){var F=-1,j=k==null?0:k.length;for(this.clear();++F<j;){var ne=k[F];this.set(ne[0],ne[1])}}function Db(){this.__data__=[],this.size=0}function Vb(k){var F=this.__data__,j=Cs(F,k);if(j<0)return!1;var ne=F.length-1;return j==ne?F.pop():Ab.call(F,j,1),--this.size,!0}function jb(k){var F=this.__data__,j=Cs(F,k);return j<0?void 0:F[j][1]}function Bb(k){return Cs(this.__data__,k)>-1}function zb(k,F){var j=this.__data__,ne=Cs(j,k);return ne<0?(++this.size,j.push([k,F])):j[ne][1]=F,this}Nn.prototype.clear=Db,Nn.prototype.delete=Vb,Nn.prototype.get=jb,Nn.prototype.has=Bb,Nn.prototype.set=zb;function ho(k){var F=-1,j=k==null?0:k.length;for(this.clear();++F<j;){var ne=k[F];this.set(ne[0],ne[1])}}function Wb(){this.size=0,this.__data__={hash:new Rr,map:new(Ch||Nn),string:new Rr}}function Hb(k){var F=Ss(this,k).delete(k);return this.size-=F?1:0,F}function Kb(k){return Ss(this,k).get(k)}function Ub(k){return Ss(this,k).has(k)}function Gb(k,F){var j=Ss(this,k),ne=j.size;return j.set(k,F),this.size+=j.size==ne?0:1,this}ho.prototype.clear=Wb,ho.prototype.delete=Hb,ho.prototype.get=Kb,ho.prototype.has=Ub,ho.prototype.set=Gb;function go(k){var F=this.__data__=new Nn(k);this.size=F.size}function qb(){this.__data__=new Nn,this.size=0}function Yb(k){var F=this.__data__,j=F.delete(k);return this.size=F.size,j}function Xb(k){return this.__data__.get(k)}function Jb(k){return this.__data__.has(k)}function Zb(k,F){var j=this.__data__;if(j instanceof Nn){var ne=j.__data__;if(!Ch||ne.length<n-1)return ne.push([k,F]),this.size=++j.size,this;j=this.__data__=new ho(ne)}return j.set(k,F),this.size=j.size,this}go.prototype.clear=qb,go.prototype.delete=Yb,go.prototype.get=Xb,go.prototype.has=Jb,go.prototype.set=Zb;function Qb(k,F){var j=Al(k),ne=!j&&kl(k),be=!j&&!ne&&Rh(k),Oe=!j&&!ne&&!be&&Ah(k),Be=j||ne||be||Oe,Te=Be?Ne(k.length,String):[],ze=Te.length;for(var Yt in k)Be&&(Yt=="length"||be&&(Yt=="offset"||Yt=="parent")||Oe&&(Yt=="buffer"||Yt=="byteLength"||Yt=="byteOffset")||Eh(Yt,ze))||Te.push(Yt);return Te}function Sl(k,F,j){(j!==void 0&&!Es(k[F],j)||j===void 0&&!(F in k))&&El(k,F,j)}function eC(k,F,j){var ne=k[F];(!(Vt.call(k,F)&&Es(ne,j))||j===void 0&&!(F in k))&&El(k,F,j)}function Cs(k,F){for(var j=k.length;j--;)if(Es(k[j][0],F))return j;return-1}function El(k,F,j){F=="__proto__"&&bs?bs(k,F,{configurable:!0,enumerable:!0,value:j,writable:!0}):k[F]=j}var tC=gC();function ws(k){return k==null?k===void 0?T:_:Tr&&Tr in Object(k)?pC(k):bC(k)}function wh(k){return mi(k)&&ws(k)==a}function nC(k){if(!kr(k)||_C(k))return!1;var F=Nl(k)?Rb:Q;return F.test(EC(k))}function rC(k){return mi(k)&&kh(k.length)&&!!X[ws(k)]}function oC(k){if(!kr(k))return xC(k);var F=Th(k),j=[];for(var ne in k)ne=="constructor"&&(F||!Vt.call(k,ne))||j.push(ne);return j}function Sh(k,F,j,ne,be){k!==F&&tC(F,function(Oe,Be){if(be||(be=new go),kr(Oe))iC(k,F,Be,j,Sh,ne,be);else{var Te=ne?ne(Rl(k,Be),Oe,Be+"",k,F,be):void 0;Te===void 0&&(Te=Oe),Sl(k,Be,Te)}},Mh)}function iC(k,F,j,ne,be,Oe,Be){var Te=Rl(k,j),ze=Rl(F,j),Yt=Be.get(ze);if(Yt){Sl(k,j,Yt);return}var Lt=Oe?Oe(Te,ze,j+"",k,F,Be):void 0,yi=Lt===void 0;if(yi){var Pl=Al(ze),Fl=!Pl&&Rh(ze),Ph=!Pl&&!Fl&&Ah(ze);Lt=ze,Pl||Fl||Ph?Al(Te)?Lt=Te:TC(Te)?Lt=dC(Te):Fl?(yi=!1,Lt=lC(ze)):Ph?(yi=!1,Lt=uC(ze)):Lt=[]:RC(ze)||kl(ze)?(Lt=Te,kl(Te)?Lt=kC(Te):(!kr(Te)||Nl(Te))&&(Lt=mC(ze))):yi=!1}yi&&(Be.set(ze,Lt),be(Lt,ze,ne,Oe,Be),Be.delete(ze)),Sl(k,j,Lt)}function sC(k,F){return wC(CC(k,F,Nh),k+"")}var aC=bs?function(k,F){return bs(k,"toString",{configurable:!0,enumerable:!1,value:MC(F),writable:!0})}:Nh;function lC(k,F){return k.slice()}function cC(k){var F=new k.constructor(k.byteLength);return new vh(F).set(new vh(k)),F}function uC(k,F){var j=cC(k.buffer);return new k.constructor(j,k.byteOffset,k.length)}function dC(k,F){var j=-1,ne=k.length;for(F||(F=Array(ne));++j<ne;)F[j]=k[j];return F}function fC(k,F,j,ne){var be=!j;j||(j={});for(var Oe=-1,Be=F.length;++Oe<Be;){var Te=F[Oe],ze=void 0;ze===void 0&&(ze=k[Te]),be?El(j,Te,ze):eC(j,Te,ze)}return j}function hC(k){return sC(function(F,j){var ne=-1,be=j.length,Oe=be>1?j[be-1]:void 0,Be=be>2?j[2]:void 0;for(Oe=k.length>3&&typeof Oe=="function"?(be--,Oe):void 0,Be&&yC(j[0],j[1],Be)&&(Oe=be<3?void 0:Oe,be=1),F=Object(F);++ne<be;){var Te=j[ne];Te&&k(F,Te,ne,Oe)}return F})}function gC(k){return function(F,j,ne){for(var be=-1,Oe=Object(F),Be=ne(F),Te=Be.length;Te--;){var ze=Be[++be];if(j(Oe[ze],ze,Oe)===!1)break}return F}}function Ss(k,F){var j=k.__data__;return vC(F)?j[typeof F=="string"?"string":"hash"]:j.map}function Tl(k,F){var j=Le(k,F);return nC(j)?j:void 0}function pC(k){var F=Vt.call(k,Tr),j=k[Tr];try{k[Tr]=void 0;var ne=!0}catch{}var be=mh.call(k);return ne&&(F?k[Tr]=j:delete k[Tr]),be}function mC(k){return typeof k.constructor=="function"&&!Th(k)?Pb(_h(k)):{}}function Eh(k,F){var j=typeof k;return F=F??s,!!F&&(j=="number"||j!="symbol"&&J.test(k))&&k>-1&&k%1==0&&k<F}function yC(k,F,j){if(!kr(j))return!1;var ne=typeof F;return(ne=="number"?Ml(j)&&Eh(F,j.length):ne=="string"&&F in j)?Es(j[F],k):!1}function vC(k){var F=typeof k;return F=="string"||F=="number"||F=="symbol"||F=="boolean"?k!=="__proto__":k===null}function _C(k){return!!ph&&ph in k}function Th(k){var F=k&&k.constructor,j=typeof F=="function"&&F.prototype||Dt;return k===j}function xC(k){var F=[];if(k!=null)for(var j in Object(k))F.push(j);return F}function bC(k){return mh.call(k)}function CC(k,F,j){return F=bh(F===void 0?k.length-1:F,0),function(){for(var ne=arguments,be=-1,Oe=bh(ne.length-F,0),Be=Array(Oe);++be<Oe;)Be[be]=ne[F+be];be=-1;for(var Te=Array(F+1);++be<F;)Te[be]=ne[be];return Te[F]=j(Be),pe(k,this,Te)}}function Rl(k,F){if(!(F==="constructor"&&typeof k[F]=="function")&&F!="__proto__")return k[F]}var wC=SC(aC);function SC(k){var F=0,j=0;return function(){var ne=Nb(),be=i-(ne-j);if(j=ne,be>0){if(++F>=o)return arguments[0]}else F=0;return k.apply(void 0,arguments)}}function EC(k){if(k!=null){try{return Re.call(k)}catch{}try{return k+""}catch{}}return""}function Es(k,F){return k===F||k!==k&&F!==F}var kl=wh((function(){return arguments})())?wh:function(k){return mi(k)&&Vt.call(k,"callee")&&!kb.call(k,"callee")},Al=Array.isArray;function Ml(k){return k!=null&&kh(k.length)&&!Nl(k)}function TC(k){return mi(k)&&Ml(k)}var Rh=Mb||NC;function Nl(k){if(!kr(k))return!1;var F=ws(k);return F==h||F==g||F==c||F==v}function kh(k){return typeof k=="number"&&k>-1&&k%1==0&&k<=s}function kr(k){var F=typeof k;return k!=null&&(F=="object"||F=="function")}function mi(k){return k!=null&&typeof k=="object"}function RC(k){if(!mi(k)||ws(k)!=y)return!1;var F=_h(k);if(F===null)return!0;var j=Vt.call(F,"constructor")&&F.constructor;return typeof j=="function"&&j instanceof j&&Re.call(j)==Tb}var Ah=ee?Ze(ee):rC;function kC(k){return fC(k,Mh(k))}function Mh(k){return Ml(k)?Qb(k):oC(k)}var AC=hC(function(k,F,j){Sh(k,F,j)});function MC(k){return function(){return k}}function Nh(k){return k}function NC(){return!1}e.exports=AC})(Ri,Ri.exports)),Ri.exports}var DR=$R();const VR=_d(DR),B0=C.createContext(null);function jR(){return C.useContext(B0)}function BR({children:e,locale:t}){return S.jsx(B0.Provider,{value:t||null,children:e})}function zR({localeKey:e,defaultLocale:t}){const n=C.createContext(t);function r(s){const{extraLocale:a}=s||{},l=jR();return{value:C.useMemo(()=>{const u=l?l[e]:null,f=[{},t];return u&&f.push(u),a&&f.push(a),VR(...f)},[t,a,e,l])}}function o(){return C.useContext(n)}function i({children:s,locale:a}){const{value:l}=r({extraLocale:a});return S.jsx(n.Provider,{value:l,children:s})}return{Context:n,useComposeLocaleProviderValue:r,useLocale:o,Provider:i}}const z0="MarkdownTextEditor",WR={toolbar:{link:{textPlaceholder:"Enter the text to display",linkPlaceholder:"Paste a link",linkErrorText:"Please enter a valid link",buttonText:"Save"},table:{maxRowsErrorText:e=>`Maximum number of rows is ${e.limit}`,maxColumnsErrorText:e=>`Maximum number of columns is ${e.limit}`,minRowsErrorText:e=>`Minimum number of rows is ${e.limit}`,minColumnsErrorText:e=>`Minimum number of columns is ${e.limit}`,rowsPlaceholder:"Rows count",columnsPlaceholder:"Columns count",buttonText:"Create table"},textSize:{paragraph:"Normal text",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3"},preview:{show:"Preview",hide:"Preview"},actions:{bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",link:"Link",image:"Image",alignLeft:"Align left",alignCenter:"Align center",alignRight:"Align right",table:"Table",bulletList:"Bullet list",numberedList:"Numbered list"}}},{Provider:HR,useLocale:ss}=zR({localeKey:z0,defaultLocale:WR}),W0=C.createContext(null);function KR(e,t){return{getTheme:function(){return t??null}}}function nt(){const e=C.useContext(W0);return e==null&&(function(t,...n){const r=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",t);for(const i of n)o.append("v",i);throw r.search=o.toString(),Error(`Minified Lexical error #${t}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(8),e}function U(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function H0(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);n.search=r.toString(),console.warn(`Minified Lexical warning #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const fn=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,UR=fn&&"documentMode"in document?document.documentMode:null,en=fn&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Ur=fn&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),_a=!(!fn||!("InputEvent"in window)||UR)&&"getTargetRanges"in new window.InputEvent("input"),as=fn&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),oi=fn&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,GR=fn&&/Android/.test(navigator.userAgent),K0=fn&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Zg=fn&&GR&&K0,ls=fn&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&en&&!K0;function U0(...e){const t=[];for(const n of e)if(n&&typeof n=="string")for(const[r]of n.matchAll(/\S+/g))t.push(r);return t}const qR=0,YR=1,XR=2,G0=128,JR=1,ZR=2,QR=3,ek=4,tk=5,nk=6,Xa=as||oi||ls?" ":"",hr=`
|
|
9
|
+
`),()=>{m.contains(p)&&m.removeChild(p)}},[t]),S.jsx(iE,{isPresent:t,childRef:i,sizeRef:s,children:N.cloneElement(e,{ref:l})})}const aE=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:i,mode:s,anchorX:a,root:l})=>{const c=Cd(lE),u=C.useId();let f=!0,d=C.useMemo(()=>(f=!1,{id:u,initial:t,isPresent:n,custom:o,onExitComplete:h=>{c.set(h,!0);for(const g of c.values())if(!g)return;r&&r()},register:h=>(c.set(h,!1),()=>c.delete(h))}),[n,c,r]);return i&&f&&(d={...d}),C.useMemo(()=>{c.forEach((h,g)=>c.set(g,!1))},[n]),N.useEffect(()=>{!n&&!c.size&&r&&r()},[n]),s==="popLayout"&&(e=S.jsx(sE,{isPresent:n,anchorX:a,root:l,children:e})),S.jsx(Ka.Provider,{value:d,children:e})};function lE(){return new Map}function Jv(e=!0){const t=C.useContext(Ka);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=t,i=C.useId();C.useEffect(()=>{if(e)return o(i)},[e]);const s=C.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,s]:[!0]}const As=e=>e.key||"";function rg(e){const t=[];return C.Children.forEach(e,n=>{C.isValidElement(n)&&t.push(n)}),t}const cE=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:i="sync",propagate:s=!1,anchorX:a="left",root:l})=>{const[c,u]=Jv(s),f=C.useMemo(()=>rg(e),[e]),d=s&&!c?[]:f.map(As),h=C.useRef(!0),g=C.useRef(f),p=Cd(()=>new Map),[m,_]=C.useState(f),[y,v]=C.useState(f);iv(()=>{h.current=!1,g.current=f;for(let w=0;w<y.length;w++){const T=As(y[w]);d.includes(T)?p.delete(T):p.get(T)!==!0&&p.set(T,!1)}},[y,d.length,d.join("-")]);const x=[];if(f!==m){let w=[...f];for(let T=0;T<y.length;T++){const E=y[T],R=As(E);d.includes(R)||(w.splice(T,0,E),x.push(E))}return i==="wait"&&x.length&&(w=x),v(rg(w)),_(f),null}process.env.NODE_ENV!=="production"&&i==="wait"&&y.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:b}=C.useContext(bd);return S.jsx(S.Fragment,{children:y.map(w=>{const T=As(w),E=s&&!c?!1:f===y||d.includes(T),R=()=>{if(p.has(T))p.set(T,!0);else return;let M=!0;p.forEach(O=>{O||(M=!1)}),M&&(b?.(),v(g.current),s&&u?.(),r&&r())};return S.jsx(aE,{isPresent:E,initial:!h.current||n?void 0:!1,custom:t,presenceAffectsLayout:o,mode:i,root:l,onExitComplete:E?void 0:R,anchorX:a,children:w},T)})})},Zv=C.createContext({strict:!1}),og={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Uo={};for(const e in og)Uo[e]={isEnabled:t=>og[e].some(n=>!!t[n])};function uE(e){for(const t in e)Uo[t]={...Uo[t],...e[t]}}const dE=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function ma(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||dE.has(e)}let Qv=e=>!ma(e);function fE(e){typeof e=="function"&&(Qv=t=>t.startsWith("on")?!ma(t):e(t))}try{fE(require("@emotion/is-prop-valid").default)}catch{}function hE(e,t,n){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||(Qv(o)||n===!0&&ma(o)||!t&&!ma(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}const Ua=C.createContext({});function Ga(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Ui(e){return typeof e=="string"||Array.isArray(e)}const Kd=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ud=["initial",...Kd];function qa(e){return Ga(e.animate)||Ud.some(t=>Ui(e[t]))}function e0(e){return!!(qa(e)||e.variants)}function gE(e,t){if(qa(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Ui(n)?n:void 0,animate:Ui(r)?r:void 0}}return e.inherit!==!1?t:{}}function pE(e){const{initial:t,animate:n}=gE(e,C.useContext(Ua));return C.useMemo(()=>({initial:t,animate:n}),[ig(t),ig(n)])}function ig(e){return Array.isArray(e)?e.join(" "):e}function sg(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const vi={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(de.test(e))e=parseFloat(e);else return e;const n=sg(e,t.target.x),r=sg(e,t.target.y);return`${n}% ${r}%`}},mE={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=fr.parse(e);if(o.length>5)return r;const i=fr.createTransformer(e),s=typeof o[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;o[0+s]/=a,o[1+s]/=l;const c=qe(a,l,.5);return typeof o[2+s]=="number"&&(o[2+s]/=c),typeof o[3+s]=="number"&&(o[3+s]/=c),i(o)}},du={borderRadius:{...vi,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:vi,borderTopRightRadius:vi,borderBottomLeftRadius:vi,borderBottomRightRadius:vi,boxShadow:mE};function t0(e,{layout:t,layoutId:n}){return ri.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!du[e]||e==="opacity")}const yE={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},vE=ni.length;function _E(e,t,n){let r="",o=!0;for(let i=0;i<vE;i++){const s=ni[i],a=e[s];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(s.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const c=Kv(a,Bd[s]);if(!l){o=!1;const u=yE[s]||s;r+=`${u}(${c}) `}n&&(t[s]=c)}}return r=r.trim(),n?r=n(t,o?"":r):o&&(r="none"),r}function Gd(e,t,n){const{style:r,vars:o,transformOrigin:i}=e;let s=!1,a=!1;for(const l in t){const c=t[l];if(ri.has(l)){s=!0;continue}else if(Cv(l)){o[l]=c;continue}else{const u=Kv(c,Bd[l]);l.startsWith("origin")?(a=!0,i[l]=u):r[l]=u}}if(t.transform||(s||n?r.transform=_E(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=i;r.transformOrigin=`${l} ${c} ${u}`}}const qd=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function n0(e,t,n){for(const r in t)!pt(t[r])&&!t0(r,n)&&(e[r]=t[r])}function xE({transformTemplate:e},t){return C.useMemo(()=>{const n=qd();return Gd(n,t,e),Object.assign({},n.vars,n.style)},[t])}function bE(e,t){const n=e.style||{},r={};return n0(r,n,e),Object.assign(r,xE(e,t)),r}function CE(e,t){const n={},r=bE(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const wE={offset:"stroke-dashoffset",array:"stroke-dasharray"},SE={offset:"strokeDashoffset",array:"strokeDasharray"};function EE(e,t,n=1,r=0,o=!0){e.pathLength=1;const i=o?wE:SE;e[i.offset]=de.transform(-r);const s=de.transform(t),a=de.transform(n);e[i.array]=`${s} ${a}`}function r0(e,{attrX:t,attrY:n,attrScale:r,pathLength:o,pathSpacing:i=1,pathOffset:s=0,...a},l,c,u){if(Gd(e,a,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:d}=e;f.transform&&(d.transform=f.transform,delete f.transform),(d.transform||f.transformOrigin)&&(d.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete f.transformBox),t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),o!==void 0&&EE(f,o,i,s,!1)}const o0=()=>({...qd(),attrs:{}}),i0=e=>typeof e=="string"&&e.toLowerCase()==="svg";function TE(e,t,n,r){const o=C.useMemo(()=>{const i=o0();return r0(i,t,i0(r),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};n0(i,e.style,e),o.style={...i,...o.style}}return o}const RE=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Yd(e){return typeof e!="string"||e.includes("-")?!1:!!(RE.indexOf(e)>-1||/[A-Z]/u.test(e))}function kE(e,t,n,{latestValues:r},o,i=!1){const a=(Yd(e)?TE:CE)(t,r,o,e),l=hE(t,typeof e=="string",i),c=e!==C.Fragment?{...l,...a,ref:n}:{},{children:u}=t,f=C.useMemo(()=>pt(u)?u.get():u,[u]);return C.createElement(e,{...c,children:f})}function ag(e){const t=[{},{}];return e?.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Xd(e,t,n,r){if(typeof t=="function"){const[o,i]=ag(r);t=t(n!==void 0?n:e.custom,o,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[o,i]=ag(r);t=t(n!==void 0?n:e.custom,o,i)}return t}function ea(e){return pt(e)?e.get():e}function AE({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,o){return{latestValues:ME(n,r,o,e),renderState:t()}}function ME(e,t,n,r){const o={},i=r(e,{});for(const d in i)o[d]=ea(i[d]);let{initial:s,animate:a}=e;const l=qa(e),c=e0(e);t&&c&&!l&&e.inherit!==!1&&(s===void 0&&(s=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||s===!1;const f=u?a:s;if(f&&typeof f!="boolean"&&!Ga(f)){const d=Array.isArray(f)?f:[f];for(let h=0;h<d.length;h++){const g=Xd(e,d[h]);if(g){const{transitionEnd:p,transition:m,..._}=g;for(const y in _){let v=_[y];if(Array.isArray(v)){const x=u?v.length-1:0;v=v[x]}v!==null&&(o[y]=v)}for(const y in p)o[y]=p[y]}}}return o}const s0=e=>(t,n)=>{const r=C.useContext(Ua),o=C.useContext(Ka),i=()=>AE(e,t,r,o);return n?i():Cd(i)};function Jd(e,t,n){const{style:r}=e,o={};for(const i in r)(pt(r[i])||t.style&&pt(t.style[i])||t0(i,e)||n?.getValue(i)?.liveStyle!==void 0)&&(o[i]=r[i]);return o}const NE=s0({scrapeMotionValuesFromProps:Jd,createRenderState:qd});function a0(e,t,n){const r=Jd(e,t,n);for(const o in e)if(pt(e[o])||pt(t[o])){const i=ni.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[i]=e[o]}return r}const PE=s0({scrapeMotionValuesFromProps:a0,createRenderState:o0}),FE=Symbol.for("motionComponentSymbol");function Mo(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function LE(e,t,n){return C.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Mo(n)&&(n.current=r))},[t])}const Zd=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),OE="framerAppearId",l0="data-"+Zd(OE),c0=C.createContext({});function IE(e,t,n,r,o){const{visualElement:i}=C.useContext(Ua),s=C.useContext(Zv),a=C.useContext(Ka),l=C.useContext(Hd).reducedMotion,c=C.useRef(null);r=r||s.renderer,!c.current&&r&&(c.current=r(e,{visualState:t,parent:i,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const u=c.current,f=C.useContext(c0);u&&!u.projection&&o&&(u.type==="html"||u.type==="svg")&&$E(c.current,n,o,f);const d=C.useRef(!1);C.useInsertionEffect(()=>{u&&d.current&&u.update(n,a)});const h=n[l0],g=C.useRef(!!h&&!window.MotionHandoffIsComplete?.(h)&&window.MotionHasOptimisedAnimation?.(h));return iv(()=>{u&&(d.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),u.scheduleRenderMicrotask(),g.current&&u.animationState&&u.animationState.animateChanges())}),C.useEffect(()=>{u&&(!g.current&&u.animationState&&u.animationState.animateChanges(),g.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(h)}),g.current=!1),u.enteringChildren=void 0)}),u}function $E(e,t,n,r){const{layoutId:o,layout:i,drag:s,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:u0(e.parent)),e.projection.setOptions({layoutId:o,layout:i,alwaysMeasureLayout:!!s||a&&Mo(a),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:u,layoutScroll:l,layoutRoot:c})}function u0(e){if(e)return e.options.allowProjection!==!1?e.projection:u0(e.parent)}function Wl(e,{forwardMotionProps:t=!1}={},n,r){n&&uE(n);const o=Yd(e)?PE:NE;function i(a,l){let c;const u={...C.useContext(Hd),...a,layoutId:DE(a)},{isStatic:f}=u,d=pE(a),h=o(a,f);if(!f&&wd){VE(u,n);const g=jE(u);c=g.MeasureLayout,d.visualElement=IE(e,h,u,r,g.ProjectionNode)}return S.jsxs(Ua.Provider,{value:d,children:[c&&d.visualElement?S.jsx(c,{visualElement:d.visualElement,...u}):null,kE(e,a,LE(h,d.visualElement,l),h,f,t)]})}i.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const s=C.forwardRef(i);return s[FE]=e,s}function DE({layoutId:e}){const t=C.useContext(bd).id;return t&&e!==void 0?t+"-"+e:e}function VE(e,t){const n=C.useContext(Zv).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?ei(!1,r,"lazy-strict-mode"):qn(!1,r,"lazy-strict-mode")}}function jE(e){const{drag:t,layout:n}=Uo;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function BE(e,t){if(typeof Proxy>"u")return Wl;const n=new Map,r=(i,s)=>Wl(i,s,e,t),o=(i,s)=>(process.env.NODE_ENV!=="production"&&kd(!1,"motion() is deprecated. Use motion.create() instead."),r(i,s));return new Proxy(o,{get:(i,s)=>s==="create"?r:(n.has(s)||n.set(s,Wl(s,void 0,e,t)),n.get(s))})}function d0({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function zE({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function WE(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Hl(e){return e===void 0||e===1}function fu({scale:e,scaleX:t,scaleY:n}){return!Hl(e)||!Hl(t)||!Hl(n)}function Nr(e){return fu(e)||f0(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function f0(e){return lg(e.x)||lg(e.y)}function lg(e){return e&&e!=="0%"}function ya(e,t,n){const r=e-n,o=t*r;return n+o}function cg(e,t,n,r,o){return o!==void 0&&(e=ya(e,o,r)),ya(e,n,r)+t}function hu(e,t=0,n=1,r,o){e.min=cg(e.min,t,n,r,o),e.max=cg(e.max,t,n,r,o)}function h0(e,{x:t,y:n}){hu(e.x,t.translate,t.scale,t.originPoint),hu(e.y,n.translate,n.scale,n.originPoint)}const ug=.999999999999,dg=1.0000000000001;function HE(e,t,n,r=!1){const o=n.length;if(!o)return;t.x=t.y=1;let i,s;for(let a=0;a<o;a++){i=n[a],s=i.projectionDelta;const{visualElement:l}=i.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&Po(e,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,h0(e,s)),r&&Nr(i.latestValues)&&Po(e,i.latestValues))}t.x<dg&&t.x>ug&&(t.x=1),t.y<dg&&t.y>ug&&(t.y=1)}function No(e,t){e.min=e.min+t,e.max=e.max+t}function fg(e,t,n,r,o=.5){const i=qe(e.min,e.max,o);hu(e,t,n,i,r)}function Po(e,t){fg(e.x,t.x,t.scaleX,t.scale,t.originX),fg(e.y,t.y,t.scaleY,t.scale,t.originY)}function g0(e,t){return d0(WE(e.getBoundingClientRect(),t))}function KE(e,t,n){const r=g0(e,n),{scroll:o}=t;return o&&(No(r.x,o.offset.x),No(r.y,o.offset.y)),r}const hg=()=>({translate:0,scale:1,origin:0,originPoint:0}),Fo=()=>({x:hg(),y:hg()}),gg=()=>({min:0,max:0}),ot=()=>({x:gg(),y:gg()}),gu={current:null},p0={current:!1};function UE(){if(p0.current=!0,!!wd)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>gu.current=e.matches;e.addEventListener("change",t),t()}else gu.current=!1}const GE=new WeakMap;function qE(e,t,n){for(const r in t){const o=t[r],i=n[r];if(pt(o))e.addValue(r,o);else if(pt(i))e.addValue(r,Ko(o,{owner:e}));else if(i!==o)if(e.hasValue(r)){const s=e.getValue(r);s.liveStyle===!0?s.jump(o):s.hasAnimated||s.set(o)}else{const s=e.getStaticValue(r);e.addValue(r,Ko(s!==void 0?s:o,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const pg=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class YE{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:o,blockInitialAnimation:i,visualState:s},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Vd,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const d=Tt.now();this.renderScheduledAt<d&&(this.renderScheduledAt=d,We.render(this.render,!1,!0))};const{latestValues:l,renderState:c}=s;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.options=a,this.blockInitialAnimation=!!i,this.isControllingVariants=qa(n),this.isVariantNode=e0(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const d in f){const h=f[d];l[d]!==void 0&&pt(h)&&h.set(l[d])}}mount(t){this.current=t,GE.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),p0.current||UE(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:gu.current,process.env.NODE_ENV!=="production"&&kd(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),dr(this.notifyUpdate),dr(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=ri.has(t);r&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",s=>{this.latestValues[t]=s,this.props.onUpdate&&We.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{o(),i&&i(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Uo){const n=Uo[t];if(!n)continue;const{isEnabled:r,Feature:o}=n;if(!this.features[t]&&o&&r(this.props)&&(this.features[t]=new o(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ot()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<pg.length;r++){const o=pg[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const i="on"+o,s=t[i];s&&(this.propEventSubscriptions[o]=this.on(o,s))}this.prevMotionValues=qE(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Ko(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(sv(r)||lv(r))?r=parseFloat(r):!nE(r)&&fr.test(n)&&(r=Hv(t,n)),this.setBaseTarget(t,pt(r)?r.get():r)),pt(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const i=Xd(this.props,n,this.presenceContext?.custom);i&&(r=i[t])}if(n&&r!==void 0)return r;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!pt(o)?o:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Rd),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){zd.render(this.render)}}class m0 extends YE{constructor(){super(...arguments),this.KeyframeResolver=HS}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;pt(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function y0(e,{style:t,vars:n},r,o){const i=e.style;let s;for(s in t)i[s]=t[s];o?.applyProjectionStyles(i,r);for(s in n)i.setProperty(s,n[s])}function XE(e){return window.getComputedStyle(e)}class JE extends m0{constructor(){super(...arguments),this.type="html",this.renderInstance=y0}readValueFromInstance(t,n){if(ri.has(n))return this.projection?.isProjecting?ou(n):lS(t,n);{const r=XE(t),o=(Cv(n)?r.getPropertyValue(n):r[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return g0(t,n)}build(t,n,r){Gd(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Jd(t,n,r)}}const v0=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function ZE(e,t,n,r){y0(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(v0.has(o)?o:Zd(o),t.attrs[o])}class QE extends m0{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ot}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(ri.has(n)){const r=Wv(n);return r&&r.default||0}return n=v0.has(n)?n:Zd(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return a0(t,n,r)}build(t,n,r){r0(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,o){ZE(t,n,r,o)}mount(t){this.isSVGTag=i0(t.tagName),super.mount(t)}}const eT=(e,t)=>Yd(e)?new QE(t):new JE(t,{allowProjection:e!==C.Fragment});function Oo(e,t,n){const r=e.getProps();return Xd(r,t,n!==void 0?n:r.custom,e)}const pu=e=>Array.isArray(e);function tT(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Ko(n))}function nT(e){return pu(e)?e[e.length-1]||0:e}function rT(e,t){const n=Oo(e,t);let{transitionEnd:r={},transition:o={},...i}=n||{};i={...i,...r};for(const s in i){const a=nT(i[s]);tT(e,s,a)}}function oT(e){return!!(pt(e)&&e.add)}function mu(e,t){const n=e.getValue("willChange");if(oT(n))return n.add(t);if(!n&&Yn.WillChange){const r=new Yn.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function _0(e){return e.props[l0]}const iT=e=>e!==null;function sT(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(iT),i=t&&n!=="loop"&&t%2===1?0:o.length-1;return o[i]}const aT={type:"spring",stiffness:500,damping:25,restSpeed:10},lT=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),cT={type:"keyframes",duration:.8},uT={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},dT=(e,{keyframes:t})=>t.length>2?cT:ri.has(e)?e.startsWith("scale")?lT(t[1]):aT:uT;function fT({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:i,repeatType:s,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const Qd=(e,t,n,r={},o,i)=>s=>{const a=jd(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-nn(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:d=>{t.set(d),a.onUpdate&&a.onUpdate(d)},onComplete:()=>{s(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:i?void 0:o};fT(a)||Object.assign(u,dT(e,u)),u.duration&&(u.duration=nn(u.duration)),u.repeatDelay&&(u.repeatDelay=nn(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let f=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(cu(u),u.delay===0&&(f=!0)),(Yn.instantAnimations||Yn.skipAnimations)&&(f=!0,cu(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,f&&!i&&t.get()!==void 0){const d=sT(u.keyframes,a);if(d!==void 0){We.update(()=>{u.onUpdate(d),u.onComplete()});return}}return a.isSync?new Dd(u):new NS(u)};function hT({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function x0(e,t,{delay:n=0,transitionOverride:r,type:o}={}){let{transition:i=e.getDefaultTransition(),transitionEnd:s,...a}=t;r&&(i=r);const l=[],c=o&&e.animationState&&e.animationState.getState()[o];for(const u in a){const f=e.getValue(u,e.latestValues[u]??null),d=a[u];if(d===void 0||c&&hT(c,u))continue;const h={delay:n,...jd(i||{},u)},g=f.get();if(g!==void 0&&!f.isAnimating&&!Array.isArray(d)&&d===g&&!h.velocity)continue;let p=!1;if(window.MotionHandoffAnimation){const _=_0(e);if(_){const y=window.MotionHandoffAnimation(_,u,We);y!==null&&(h.startTime=y,p=!0)}}mu(e,u),f.start(Qd(u,f,d,e.shouldReduceMotion&&jv.has(u)?{type:!1}:h,e,p));const m=f.animation;m&&l.push(m)}return s&&Promise.all(l).then(()=>{We.update(()=>{s&&rT(e,s)})}),l}function b0(e,t,n,r=0,o=1){const i=Array.from(e).sort((c,u)=>c.sortNodePosition(u)).indexOf(t),s=e.size,a=(s-1)*r;return typeof n=="function"?n(i,s):o===1?i*r:a-i*r}function yu(e,t,n={}){const r=Oo(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(o=n.transitionOverride);const i=r?()=>Promise.all(x0(e,r,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:c=0,staggerChildren:u,staggerDirection:f}=o;return gT(e,t,l,c,u,f,n)}:()=>Promise.resolve(),{when:a}=o;if(a){const[l,c]=a==="beforeChildren"?[i,s]:[s,i];return l().then(()=>c())}else return Promise.all([i(),s(n.delay)])}function gT(e,t,n=0,r=0,o=0,i=1,s){const a=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),a.push(yu(l,t,{...s,delay:n+(typeof r=="function"?0:r)+b0(e.variantChildren,l,r,o,i)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(a)}function pT(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(i=>yu(e,i,n));r=Promise.all(o)}else if(typeof t=="string")r=yu(e,t,n);else{const o=typeof t=="function"?Oo(e,t,n.custom):t;r=Promise.all(x0(e,o,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function C0(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const mT=Ud.length;function w0(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?w0(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<mT;n++){const r=Ud[n],o=e.props[r];(Ui(o)||o===!1)&&(t[r]=o)}return t}const yT=[...Kd].reverse(),vT=Kd.length;function _T(e){return t=>Promise.all(t.map(({animation:n,options:r})=>pT(e,n,r)))}function xT(e){let t=_T(e),n=mg(),r=!0;const o=l=>(c,u)=>{const f=Oo(e,u,l==="exit"?e.presenceContext?.custom:void 0);if(f){const{transition:d,transitionEnd:h,...g}=f;c={...c,...g,...h}}return c};function i(l){t=l(e)}function s(l){const{props:c}=e,u=w0(e.parent)||{},f=[],d=new Set;let h={},g=1/0;for(let m=0;m<vT;m++){const _=yT[m],y=n[_],v=c[_]!==void 0?c[_]:u[_],x=Ui(v),b=_===l?y.isActive:null;b===!1&&(g=m);let w=v===u[_]&&v!==c[_]&&x;if(w&&r&&e.manuallyAnimateOnMount&&(w=!1),y.protectedKeys={...h},!y.isActive&&b===null||!v&&!y.prevProp||Ga(v)||typeof v=="boolean")continue;const T=bT(y.prevProp,v);let E=T||_===l&&y.isActive&&!w&&x||m>g&&x,R=!1;const M=Array.isArray(v)?v:[v];let O=M.reduce(o(_),{});b===!1&&(O={});const{prevResolvedValues:D={}}=y,I={...D,...O},L=P=>{E=!0,d.has(P)&&(R=!0,d.delete(P)),y.needsAnimating[P]=!0;const A=e.getValue(P);A&&(A.liveStyle=!1)};for(const P in I){const A=O[P],$=D[P];if(h.hasOwnProperty(P))continue;let H=!1;pu(A)&&pu($)?H=!C0(A,$):H=A!==$,H?A!=null?L(P):d.add(P):A!==void 0&&d.has(P)?L(P):y.protectedKeys[P]=!0}y.prevProp=v,y.prevResolvedValues=O,y.isActive&&(h={...h,...O}),r&&e.blockInitialAnimation&&(E=!1);const B=w&&T;E&&(!B||R)&&f.push(...M.map(P=>{const A={type:_};if(typeof P=="string"&&r&&!B&&e.manuallyAnimateOnMount&&e.parent){const{parent:$}=e,H=Oo($,P);if($.enteringChildren&&H){const{delayChildren:Q}=H.transition||{};A.delay=b0($.enteringChildren,e,Q)}}return{animation:P,options:A}}))}if(d.size){const m={};if(typeof c.initial!="boolean"){const _=Oo(e,Array.isArray(c.initial)?c.initial[0]:c.initial);_&&_.transition&&(m.transition=_.transition)}d.forEach(_=>{const y=e.getBaseTarget(_),v=e.getValue(_);v&&(v.liveStyle=!0),m[_]=y??null}),f.push({animation:m})}let p=!!f.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,p?t(f):Promise.resolve()}function a(l,c){if(n[l].isActive===c)return Promise.resolve();e.variantChildren?.forEach(f=>f.animationState?.setActive(l,c)),n[l].isActive=c;const u=s(l);for(const f in n)n[f].protectedKeys={};return u}return{animateChanges:s,setActive:a,setAnimateFunction:i,getState:()=>n,reset:()=>{n=mg()}}}function bT(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!C0(t,e):!1}function Ar(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function mg(){return{animate:Ar(!0),whileInView:Ar(),whileHover:Ar(),whileTap:Ar(),whileDrag:Ar(),whileFocus:Ar(),exit:Ar()}}class Cr{constructor(t){this.isMounted=!1,this.node=t}update(){}}class CT extends Cr{constructor(t){super(t),t.animationState||(t.animationState=xT(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Ga(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let wT=0;class ST extends Cr{constructor(){super(...arguments),this.id=wT++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const o=this.node.animationState.setActive("exit",!t);n&&!t&&o.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const ET={animation:{Feature:CT},exit:{Feature:ST}};function Gi(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function is(e){return{point:{x:e.pageX,y:e.pageY}}}const TT=e=>t=>Wd(t)&&e(t,is(t));function Li(e,t,n,r){return Gi(e,t,TT(n),r)}const S0=1e-4,RT=1-S0,kT=1+S0,E0=.01,AT=0-E0,MT=0+E0;function xt(e){return e.max-e.min}function NT(e,t,n){return Math.abs(e-t)<=n}function yg(e,t,n,r=.5){e.origin=r,e.originPoint=qe(t.min,t.max,e.origin),e.scale=xt(n)/xt(t),e.translate=qe(n.min,n.max,e.origin)-e.originPoint,(e.scale>=RT&&e.scale<=kT||isNaN(e.scale))&&(e.scale=1),(e.translate>=AT&&e.translate<=MT||isNaN(e.translate))&&(e.translate=0)}function Oi(e,t,n,r){yg(e.x,t.x,n.x,r?r.originX:void 0),yg(e.y,t.y,n.y,r?r.originY:void 0)}function vg(e,t,n){e.min=n.min+t.min,e.max=e.min+xt(t)}function PT(e,t,n){vg(e.x,t.x,n.x),vg(e.y,t.y,n.y)}function _g(e,t,n){e.min=t.min-n.min,e.max=e.min+xt(t)}function va(e,t,n){_g(e.x,t.x,n.x),_g(e.y,t.y,n.y)}function Bt(e){return[e("x"),e("y")]}const T0=({current:e})=>e?e.ownerDocument.defaultView:null,xg=(e,t)=>Math.abs(e-t);function FT(e,t){const n=xg(e.x,t.x),r=xg(e.y,t.y);return Math.sqrt(n**2+r**2)}class R0{constructor(t,n,{transformPagePoint:r,contextWindow:o=window,dragSnapToOrigin:i=!1,distanceThreshold:s=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=Ul(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,g=FT(d.offset,{x:0,y:0})>=this.distanceThreshold;if(!h&&!g)return;const{point:p}=d,{timestamp:m}=ct;this.history.push({...p,timestamp:m});const{onStart:_,onMove:y}=this.handlers;h||(_&&_(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,d)},this.handlePointerMove=(d,h)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=Kl(h,this.transformPagePoint),We.update(this.updatePoint,!0)},this.handlePointerUp=(d,h)=>{this.end();const{onEnd:g,onSessionEnd:p,resumeAnimation:m}=this.handlers;if(this.dragSnapToOrigin&&m&&m(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const _=Ul(d.type==="pointercancel"?this.lastMoveEventInfo:Kl(h,this.transformPagePoint),this.history);this.startEvent&&g&&g(d,_),p&&p(d,_)},!Wd(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=s,this.contextWindow=o||window;const a=is(t),l=Kl(a,this.transformPagePoint),{point:c}=l,{timestamp:u}=ct;this.history=[{...c,timestamp:u}];const{onSessionStart:f}=n;f&&f(t,Ul(l,this.history)),this.removeListeners=ns(Li(this.contextWindow,"pointermove",this.handlePointerMove),Li(this.contextWindow,"pointerup",this.handlePointerUp),Li(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),dr(this.updatePoint)}}function Kl(e,t){return t?{point:t(e.point)}:e}function bg(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Ul({point:e},t){return{point:e,delta:bg(e,k0(t)),offset:bg(e,LT(t)),velocity:OT(t,.1)}}function LT(e){return e[0]}function k0(e){return e[e.length-1]}function OT(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=k0(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>nn(t)));)n--;if(!r)return{x:0,y:0};const i=Wt(o.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const s={x:(o.x-r.x)/i,y:(o.y-r.y)/i};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function IT(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?qe(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?qe(n,e,r.max):Math.min(e,n)),e}function Cg(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function $T(e,{top:t,left:n,bottom:r,right:o}){return{x:Cg(e.x,n,o),y:Cg(e.y,t,r)}}function wg(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function DT(e,t){return{x:wg(e.x,t.x),y:wg(e.y,t.y)}}function VT(e,t){let n=.5;const r=xt(e),o=xt(t);return o>r?n=Wi(t.min,t.max-r,e.min):r>o&&(n=Wi(e.min,e.max-o,t.min)),Gn(0,1,n)}function jT(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const vu=.35;function BT(e=vu){return e===!1?e=0:e===!0&&(e=vu),{x:Sg(e,"left","right"),y:Sg(e,"top","bottom")}}function Sg(e,t,n){return{min:Eg(e,t),max:Eg(e,n)}}function Eg(e,t){return typeof e=="number"?e:e[t]||0}const zT=new WeakMap;class WT{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ot(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const i=f=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(is(f).point)},s=(f,d)=>{const{drag:h,dragPropagation:g,onDragStart:p}=this.getProps();if(h&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=qS(h),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=d,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Bt(_=>{let y=this.getAxisMotionValue(_).get()||0;if(bn.test(y)){const{projection:v}=this.visualElement;if(v&&v.layout){const x=v.layout.layoutBox[_];x&&(y=xt(x)*(parseFloat(y)/100))}}this.originPoint[_]=y}),p&&We.postRender(()=>p(f,d)),mu(this.visualElement,"transform");const{animationState:m}=this.visualElement;m&&m.setActive("whileDrag",!0)},a=(f,d)=>{this.latestPointerEvent=f,this.latestPanInfo=d;const{dragPropagation:h,dragDirectionLock:g,onDirectionLock:p,onDrag:m}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:_}=d;if(g&&this.currentDirection===null){this.currentDirection=HT(_),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",d.point,_),this.updateAxis("y",d.point,_),this.visualElement.render(),m&&m(f,d)},l=(f,d)=>{this.latestPointerEvent=f,this.latestPanInfo=d,this.stop(f,d),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>Bt(f=>this.getAnimationState(f)==="paused"&&this.getAxisMotionValue(f).animation?.play()),{dragSnapToOrigin:u}=this.getProps();this.panSession=new R0(t,{onSessionStart:i,onStart:s,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:r,contextWindow:T0(this.visualElement)})}stop(t,n){const r=t||this.latestPointerEvent,o=n||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!o||!r)return;const{velocity:s}=o;this.startAnimation(s);const{onDragEnd:a}=this.getProps();a&&We.postRender(()=>a(r,o))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:o}=this.getProps();if(!r||!Ms(t,o,this.currentDirection))return;const i=this.getAxisMotionValue(t);let s=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(s=IT(s,this.constraints[t],this.elastic[t])),i.set(s)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,o=this.constraints;t&&Mo(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=$T(r.layoutBox,t):this.constraints=!1,this.elastic=BT(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Bt(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=jT(r.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Mo(t))return!1;const r=t.current;qn(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const i=KE(r,o.root,this.visualElement.getTransformPagePoint());let s=DT(o.layout.layoutBox,i);if(n){const a=n(zE(s));this.hasMutatedConstraints=!!a,a&&(s=d0(a))}return s}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:i,dragSnapToOrigin:s,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=Bt(u=>{if(!Ms(u,n,this.currentDirection))return;let f=l&&l[u]||{};s&&(f={min:0,max:0});const d=o?200:1e6,h=o?40:1e7,g={type:"inertia",velocity:r?t[u]:0,bounceStiffness:d,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(u,g)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return mu(this.visualElement,t),r.start(Qd(t,r,0,n,this.visualElement,!1))}stopAnimation(){Bt(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Bt(t=>this.getAxisMotionValue(t).animation?.pause())}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),o=r[n];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Bt(n=>{const{drag:r}=this.getProps();if(!Ms(n,r,this.currentDirection))return;const{projection:o}=this.visualElement,i=this.getAxisMotionValue(n);if(o&&o.layout){const{min:s,max:a}=o.layout.layoutBox[n];i.set(t[n]-qe(s,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Mo(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Bt(s=>{const a=this.getAxisMotionValue(s);if(a&&this.constraints!==!1){const l=a.get();o[s]=VT({min:l,max:l},this.constraints[s])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Bt(s=>{if(!Ms(s,t,null))return;const a=this.getAxisMotionValue(s),{min:l,max:c}=this.constraints[s];a.set(qe(l,c,o[s]))})}addListeners(){if(!this.visualElement.current)return;zT.set(this.visualElement,this);const t=this.visualElement.current,n=Li(t,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();Mo(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,i=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),We.read(r);const s=Gi(window,"resize",()=>this.scalePositionWithinConstraints()),a=o.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(Bt(u=>{const f=this.getAxisMotionValue(u);f&&(this.originPoint[u]+=l[u].translate,f.set(f.get()+l[u].translate))}),this.visualElement.render())}));return()=>{s(),n(),i(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:i=!1,dragElastic:s=vu,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:i,dragElastic:s,dragMomentum:a}}}function Ms(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function HT(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class KT extends Cr{constructor(t){super(t),this.removeGroupControls=Ht,this.removeListeners=Ht,this.controls=new WT(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Ht}unmount(){this.removeGroupControls(),this.removeListeners()}}const Tg=e=>(t,n)=>{e&&We.postRender(()=>e(t,n))};class UT extends Cr{constructor(){super(...arguments),this.removePointerDownListener=Ht}onPointerDown(t){this.session=new R0(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:T0(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:Tg(t),onStart:Tg(n),onMove:r,onEnd:(i,s)=>{delete this.session,o&&We.postRender(()=>o(i,s))}}}mount(){this.removePointerDownListener=Li(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const ta={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let Gl=!1;class GT extends C.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:i}=t;i&&(n.group&&n.group.add(i),r&&r.register&&o&&r.register(i),Gl&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),ta.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:o,isPresent:i}=this.props,{projection:s}=r;return s&&(s.isPresent=i,Gl=!0,o||t.layoutDependency!==n||n===void 0||t.isPresent!==i?s.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?s.promote():s.relegate()||We.postRender(()=>{const a=s.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),zd.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=t;Gl=!0,o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function A0(e){const[t,n]=Jv(),r=C.useContext(bd);return S.jsx(GT,{...e,layoutGroup:r,switchLayoutGroup:C.useContext(c0),isPresent:t,safeToRemove:n})}function qT(e,t,n){const r=pt(e)?e:Ko(e);return r.start(Qd("",r,t,n)),r.animation}const YT=(e,t)=>e.depth-t.depth;class XT{constructor(){this.children=[],this.isDirty=!1}add(t){Sd(this.children,t),this.isDirty=!0}remove(t){Ed(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(YT),this.isDirty=!1,this.children.forEach(t)}}function JT(e,t){const n=Tt.now(),r=({timestamp:o})=>{const i=o-n;i>=t&&(dr(r),e(i-t))};return We.setup(r,!0),()=>dr(r)}const M0=["TopLeft","TopRight","BottomLeft","BottomRight"],ZT=M0.length,Rg=e=>typeof e=="string"?parseFloat(e):e,kg=e=>typeof e=="number"||de.test(e);function QT(e,t,n,r,o,i){o?(e.opacity=qe(0,n.opacity??1,e2(r)),e.opacityExit=qe(t.opacity??1,0,t2(r))):i&&(e.opacity=qe(t.opacity??1,n.opacity??1,r));for(let s=0;s<ZT;s++){const a=`border${M0[s]}Radius`;let l=Ag(t,a),c=Ag(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||kg(l)===kg(c)?(e[a]=Math.max(qe(Rg(l),Rg(c),r),0),(bn.test(c)||bn.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=qe(t.rotate||0,n.rotate||0,r))}function Ag(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const e2=N0(0,.5,mv),t2=N0(.5,.95,Ht);function N0(e,t,n){return r=>r<e?0:r>t?1:n(Wi(e,t,r))}function Mg(e,t){e.min=t.min,e.max=t.max}function Xt(e,t){Mg(e.x,t.x),Mg(e.y,t.y)}function Ng(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Pg(e,t,n,r,o){return e-=t,e=ya(e,1/n,r),o!==void 0&&(e=ya(e,1/o,r)),e}function n2(e,t=0,n=1,r=.5,o,i=e,s=e){if(bn.test(t)&&(t=parseFloat(t),t=qe(s.min,s.max,t/100)-s.min),typeof t!="number")return;let a=qe(i.min,i.max,r);e===i&&(a-=t),e.min=Pg(e.min,t,n,a,o),e.max=Pg(e.max,t,n,a,o)}function Fg(e,t,[n,r,o],i,s){n2(e,t[n],t[r],t[o],t.scale,i,s)}const r2=["x","scaleX","originX"],o2=["y","scaleY","originY"];function Lg(e,t,n,r){Fg(e.x,t,r2,n?n.x:void 0,r?r.x:void 0),Fg(e.y,t,o2,n?n.y:void 0,r?r.y:void 0)}function Og(e){return e.translate===0&&e.scale===1}function P0(e){return Og(e.x)&&Og(e.y)}function Ig(e,t){return e.min===t.min&&e.max===t.max}function i2(e,t){return Ig(e.x,t.x)&&Ig(e.y,t.y)}function $g(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function F0(e,t){return $g(e.x,t.x)&&$g(e.y,t.y)}function Dg(e){return xt(e.x)/xt(e.y)}function Vg(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class s2{constructor(){this.members=[]}add(t){Sd(this.members,t),t.scheduleRender()}remove(t){if(Ed(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(o=>t===o);if(n===0)return!1;let r;for(let o=n;o>=0;o--){const i=this.members[o];if(i.isPresent!==!1){r=i;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;o===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function a2(e,t,n){let r="";const o=e.x.translate/t.x,i=e.y.translate/t.y,s=n?.z||0;if((o||i||s)&&(r=`translate3d(${o}px, ${i}px, ${s}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:f,rotateY:d,skewX:h,skewY:g}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),f&&(r+=`rotateX(${f}deg) `),d&&(r+=`rotateY(${d}deg) `),h&&(r+=`skewX(${h}deg) `),g&&(r+=`skewY(${g}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const ql=["","X","Y","Z"],l2=1e3;let c2=0;function Yl(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function L0(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=_0(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",We,!(o||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&L0(r)}function O0({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(s={},a=t?.()){this.id=c2++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(f2),this.nodes.forEach(m2),this.nodes.forEach(y2),this.nodes.forEach(h2)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new XT)}addEventListener(s,a){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new Rd),this.eventHandlers.get(s).add(a)}notifyListeners(s,...a){const l=this.eventHandlers.get(s);l&&l.notify(...a)}hasListeners(s){return this.eventHandlers.has(s)}mount(s){if(this.instance)return;this.isSVG=Xv(s)&&!eE(s),this.instance=s;const{layoutId:a,layout:l,visualElement:c}=this.options;if(c&&!c.current&&c.mount(s),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),e){let u,f=0;const d=()=>this.root.updateBlockedByResize=!1;We.read(()=>{f=window.innerWidth}),e(s,()=>{const h=window.innerWidth;h!==f&&(f=h,this.root.updateBlockedByResize=!0,u&&u(),u=JT(d,250),ta.hasAnimatedSinceResize&&(ta.hasAnimatedSinceResize=!1,this.nodes.forEach(zg)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:f,hasRelativeLayoutChanged:d,layout:h})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||c.getDefaultTransition()||C2,{onLayoutAnimationStart:p,onLayoutAnimationComplete:m}=c.getProps(),_=!this.targetLayout||!F0(this.targetLayout,h),y=!f&&d;if(this.options.layoutRoot||this.resumeFrom||y||f&&(_||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const v={...jd(g,"layout"),onPlay:p,onComplete:m};(c.shouldReduceMotion||this.options.layoutRoot)&&(v.delay=0,v.type=!1),this.startAnimation(v),this.setAnimationOrigin(u,y)}else f||zg(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=h})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),dr(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(v2),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&L0(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const f=this.path[u];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(jg);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Bg);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(p2),this.nodes.forEach(u2),this.nodes.forEach(d2)):this.nodes.forEach(Bg),this.clearAllSnapshots();const a=Tt.now();ct.delta=Gn(0,1e3/60,a-ct.timestamp),ct.timestamp=a,ct.isProcessing=!0,$l.update.process(ct),$l.preRender.process(ct),$l.render.process(ct),ct.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,zd.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(g2),this.sharedNodes.forEach(_2)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,We.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){We.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!xt(this.snapshot.measuredBox.x)&&!xt(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const s=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=ot(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,s?s.layoutBox:void 0)}updateScroll(s="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(a=!1),a&&this.instance){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:s,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!o)return;const s=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!P0(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;s&&this.instance&&(a||Nr(this.latestValues)||u)&&(o(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return s&&(l=this.removeTransform(l)),w2(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:s}=this.options;if(!s)return ot();const a=s.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(S2))){const{scroll:c}=this.root;c&&(No(a.x,c.offset.x),No(a.y,c.offset.y))}return a}removeElementScroll(s){const a=ot();if(Xt(a,s),this.scroll?.wasRoot)return a;for(let l=0;l<this.path.length;l++){const c=this.path[l],{scroll:u,options:f}=c;c!==this.root&&u&&f.layoutScroll&&(u.wasRoot&&Xt(a,s),No(a.x,u.offset.x),No(a.y,u.offset.y))}return a}applyTransform(s,a=!1){const l=ot();Xt(l,s);for(let c=0;c<this.path.length;c++){const u=this.path[c];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&Po(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),Nr(u.latestValues)&&Po(l,u.latestValues)}return Nr(this.latestValues)&&Po(l,this.latestValues),l}removeTransform(s){const a=ot();Xt(a,s);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!Nr(c.latestValues))continue;fu(c.latestValues)&&c.updateSnapshot();const u=ot(),f=c.measurePageBox();Xt(u,f),Lg(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return Nr(this.latestValues)&&Lg(a,this.latestValues),a}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==ct.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!1){const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(s||l&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:f}=this.options;if(!this.layout||!(u||f))return;this.resolvedRelativeTargetAt=ct.timestamp;const d=this.getClosestProjectingParent();d&&this.linkedParentVersion!==d.layoutVersion&&!d.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(d&&d.layout?this.createRelativeTarget(d,this.layout.layoutBox,d.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=ot(),this.targetWithTransforms=ot()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),PT(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Xt(this.target,this.layout.layoutBox),h0(this.target,this.targetDelta)):Xt(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,d&&!!d.resumingFrom==!!this.resumingFrom&&!d.options.layoutScroll&&d.target&&this.animationProgress!==1?this.createRelativeTarget(d,this.target,d.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||fu(this.parent.latestValues)||f0(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(s,a,l){this.relativeParent=s,this.linkedParentVersion=s.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ot(),this.relativeTargetOrigin=ot(),va(this.relativeTargetOrigin,a,l),Xt(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const s=this.getLead(),a=!!this.resumingFrom||this!==s;let l=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===ct.timestamp&&(l=!1),l)return;const{layout:c,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||u))return;Xt(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,d=this.treeScale.y;HE(this.layoutCorrected,this.treeScale,this.path,a),s.layout&&!s.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(s.target=s.layout.layoutBox,s.targetWithTransforms=ot());const{target:h}=s;if(!h){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Ng(this.prevProjectionDelta.x,this.projectionDelta.x),Ng(this.prevProjectionDelta.y,this.projectionDelta.y)),Oi(this.projectionDelta,this.layoutCorrected,h,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==d||!Vg(this.projectionDelta.x,this.prevProjectionDelta.x)||!Vg(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",h))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){if(this.options.visualElement?.scheduleRender(),s){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Fo(),this.projectionDelta=Fo(),this.projectionDeltaWithTransform=Fo()}setAnimationOrigin(s,a=!1){const l=this.snapshot,c=l?l.latestValues:{},u={...this.latestValues},f=Fo();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const d=ot(),h=l?l.source:void 0,g=this.layout?this.layout.source:void 0,p=h!==g,m=this.getStack(),_=!m||m.members.length<=1,y=!!(p&&!_&&this.options.crossfade===!0&&!this.path.some(b2));this.animationProgress=0;let v;this.mixTargetDelta=x=>{const b=x/1e3;Wg(f.x,s.x,b),Wg(f.y,s.y,b),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(va(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox),x2(this.relativeTarget,this.relativeTargetOrigin,d,b),v&&i2(this.relativeTarget,v)&&(this.isProjectionDirty=!1),v||(v=ot()),Xt(v,this.relativeTarget)),p&&(this.animationValues=u,QT(u,c,this.latestValues,b,y,_)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=b},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(dr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=We.update(()=>{ta.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Ko(0)),this.currentAnimation=qT(this.motionValue,[0,1e3],{...s,velocity:0,isSync:!0,onUpdate:a=>{this.mixTargetDelta(a),s.onUpdate&&s.onUpdate(a)},onStop:()=>{},onComplete:()=>{s.onComplete&&s.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(l2),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=s;if(!(!a||!l||!c)){if(this!==s&&this.layout&&c&&I0(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||ot();const f=xt(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+f;const d=xt(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+d}Xt(a,l),Po(a,u),Oi(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(s,a){this.sharedNodes.has(s)||this.sharedNodes.set(s,new s2),this.sharedNodes.get(s).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){const{layoutId:s}=this.options;return s?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:s}=this.options;return s?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),s&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){const{visualElement:s}=this.options;if(!s)return;let a=!1;const{latestValues:l}=s;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&Yl("z",s,c,this.animationValues);for(let u=0;u<ql.length;u++)Yl(`rotate${ql[u]}`,s,c,this.animationValues),Yl(`skew${ql[u]}`,s,c,this.animationValues);s.render();for(const u in c)s.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);s.scheduleRender()}applyProjectionStyles(s,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){s.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,s.visibility="",s.opacity="",s.pointerEvents=ea(a?.pointerEvents)||"",s.transform=l?l(this.latestValues,""):"none";return}const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(s.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,s.pointerEvents=ea(a?.pointerEvents)||""),this.hasProjected&&!Nr(this.latestValues)&&(s.transform=l?l({},""):"none",this.hasProjected=!1);return}s.visibility="";const u=c.animationValues||c.latestValues;this.applyTransformsToTarget();let f=a2(this.projectionDeltaWithTransform,this.treeScale,u);l&&(f=l(u,f)),s.transform=f;const{x:d,y:h}=this.projectionDelta;s.transformOrigin=`${d.origin*100}% ${h.origin*100}% 0`,c.animationValues?s.opacity=c===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:s.opacity=c===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const g in du){if(u[g]===void 0)continue;const{correct:p,applyTo:m,isCSSVariable:_}=du[g],y=f==="none"?u[g]:p(u[g],c);if(m){const v=m.length;for(let x=0;x<v;x++)s[m[x]]=y}else _?this.options.visualElement.renderState.vars[g]=y:s[g]=y}this.options.layoutId&&(s.pointerEvents=c===this?ea(a?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>s.currentAnimation?.stop()),this.root.nodes.forEach(jg),this.root.sharedNodes.clear()}}}function u2(e){e.updateLayout()}function d2(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:r}=e.layout,{animationType:o}=e.options,i=t.source!==e.layout.source;o==="size"?Bt(u=>{const f=i?t.measuredBox[u]:t.layoutBox[u],d=xt(f);f.min=n[u].min,f.max=f.min+d}):I0(o,t.layoutBox,n)&&Bt(u=>{const f=i?t.measuredBox[u]:t.layoutBox[u],d=xt(n[u]);f.max=f.min+d,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[u].max=e.relativeTarget[u].min+d)});const s=Fo();Oi(s,n,t.layoutBox);const a=Fo();i?Oi(a,e.applyTransform(r,!0),t.measuredBox):Oi(a,n,t.layoutBox);const l=!P0(s);let c=!1;if(!e.resumeFrom){const u=e.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:f,layout:d}=u;if(f&&d){const h=ot();va(h,t.layoutBox,f.layoutBox);const g=ot();va(g,n,d.layoutBox),F0(h,g)||(c=!0),u.options.layoutRoot&&(e.relativeTarget=g,e.relativeTargetOrigin=h,e.relativeParent=u)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:a,layoutDelta:s,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function f2(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function h2(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function g2(e){e.clearSnapshot()}function jg(e){e.clearMeasurements()}function Bg(e){e.isLayoutDirty=!1}function p2(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function zg(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function m2(e){e.resolveTargetDelta()}function y2(e){e.calcProjection()}function v2(e){e.resetSkewAndRotation()}function _2(e){e.removeLeadSnapshot()}function Wg(e,t,n){e.translate=qe(t.translate,0,n),e.scale=qe(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Hg(e,t,n,r){e.min=qe(t.min,n.min,r),e.max=qe(t.max,n.max,r)}function x2(e,t,n,r){Hg(e.x,t.x,n.x,r),Hg(e.y,t.y,n.y,r)}function b2(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const C2={duration:.45,ease:[.4,0,.1,1]},Kg=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Ug=Kg("applewebkit/")&&!Kg("chrome/")?Math.round:Ht;function Gg(e){e.min=Ug(e.min),e.max=Ug(e.max)}function w2(e){Gg(e.x),Gg(e.y)}function I0(e,t,n){return e==="position"||e==="preserve-aspect"&&!NT(Dg(t),Dg(n),.2)}function S2(e){return e!==e.root&&e.scroll?.wasRoot}const E2=O0({attachResizeListener:(e,t)=>Gi(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Xl={current:void 0},$0=O0({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Xl.current){const e=new E2({});e.mount(window),e.setOptions({layoutScroll:!0}),Xl.current=e}return Xl.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),T2={pan:{Feature:UT},drag:{Feature:KT,ProjectionNode:$0,MeasureLayout:A0}};function qg(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,i=r[o];i&&We.postRender(()=>i(t,is(t)))}class R2 extends Cr{mount(){const{current:t}=this.node;t&&(this.unmount=YS(t,(n,r)=>(qg(this.node,r,"Start"),o=>qg(this.node,o,"End"))))}unmount(){}}class k2 extends Cr{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=ns(Gi(this.node.current,"focus",()=>this.onFocus()),Gi(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Yg(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),i=r[o];i&&We.postRender(()=>i(t,is(t)))}class A2 extends Cr{mount(){const{current:t}=this.node;t&&(this.unmount=QS(t,(n,r)=>(Yg(this.node,r,"Start"),(o,{success:i})=>Yg(this.node,o,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const _u=new WeakMap,Jl=new WeakMap,M2=e=>{const t=_u.get(e.target);t&&t(e)},N2=e=>{e.forEach(M2)};function P2({root:e,...t}){const n=e||document;Jl.has(n)||Jl.set(n,{});const r=Jl.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(N2,{root:e,...t})),r[o]}function F2(e,t,n){const r=P2(t);return _u.set(e,n),r.observe(e),()=>{_u.delete(e),r.unobserve(e)}}const L2={some:0,all:1};class O2 extends Cr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:o="some",once:i}=t,s={root:n?n.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:L2[o]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,i&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:f}=this.node.getProps(),d=c?u:f;d&&d(l)};return F2(this.node.current,s,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(I2(t,n))&&this.startObserver()}unmount(){}}function I2({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const $2={inView:{Feature:O2},tap:{Feature:A2},focus:{Feature:k2},hover:{Feature:R2}},D2={layout:{ProjectionNode:$0,MeasureLayout:A0}},V2={...ET,...$2,...T2,...D2},Ya=BE(V2,eT),j2="_primary_13825_8",B2="_secondary_13825_12",z2="_tertiary_13825_16",W2="_positive_13825_20",H2="_negative_13825_24",K2="_warning_13825_28",U2="_accent_13825_32",G2="_inverse_13825_36",q2="_text_13825_111",Y2="_regular_13825_117",X2="_medium_13825_121",J2="_semibold_13825_125",Z2="_bold_13825_129",Ns={primary:j2,secondary:B2,tertiary:z2,positive:W2,negative:H2,warning:K2,accent:U2,inverse:G2,"title-1":"_title-1_13825_41","title-2":"_title-2_13825_51","title-3":"_title-3_13825_61","headline-1":"_headline-1_13825_76","headline-2":"_headline-2_13825_81","headline-3":"_headline-3_13825_86","body-1":"_body-1_13825_91","body-2":"_body-2_13825_96","caption-1":"_caption-1_13825_101","caption-2":"_caption-2_13825_106",text:q2,regular:Y2,medium:X2,semibold:J2,bold:Z2},Q2=e=>{let t;e.center?t="center":e.left?t="left":e.right&&(t="right");let n;return e.uppercase?n="uppercase":e.lowercase?n="lowercase":e.capitalize&&(n="capitalize"),z.css({marginTop:e.mt,marginBottom:e.mb,marginRight:e.mr,marginLeft:e.ml,flex:e.flex,cursor:e.cursor,wordBreak:e.wordBreak,whiteSpace:e.whiteSpace,textOverflow:e.textOverflow,textDecoration:e.decoration,textAlign:t,textTransform:n,color:e.color,opacity:e.disabled?.5:void 0,overflow:e.overflow})},ce=C.forwardRef(({children:e,className:t,variant:n="body-1",fontWeight:r="medium",tag:o="p",colorName:i="primary",style:s,clickOpacity:a=.5,opacityDuration:l=200,onClick:c,disabled:u,mt:f,mb:d,ml:h,mr:g,flex:p,cursor:m,wordBreak:_,whiteSpace:y,textOverflow:v,decoration:x,color:b,center:w,left:T,right:E,uppercase:R,lowercase:M,capitalize:O,overflow:D,...I},L)=>{const[B,K]=C.useState(!1),P=!!c,A=()=>P&&K(!0),$=()=>P&&K(!1),H=Q2({mt:f,mb:d,ml:h,mr:g,flex:p,cursor:m,wordBreak:_,whiteSpace:y,textOverflow:v,decoration:x,color:b,center:w,left:T,right:E,uppercase:R,lowercase:M,capitalize:O,overflow:D}),Q=o,J=P?z.css({opacity:B?a:1,transition:`opacity ${l}ms ease`}):"";return S.jsx(Q,{ref:L,...I,className:z.cx(Ns.text,Ns[n],Ns[i],Ns[r],J,t,H),style:s,onClick:c,onMouseDown:A,onMouseUp:$,onMouseLeave:$,onTouchStart:A,onTouchEnd:$,role:P?"button":void 0,tabIndex:P?0:void 0,children:e})});ce.displayName="Text";const D0=Ya(ce),eR=z.css({display:"flex",alignItems:"center",justifyContent:"center",position:"relative",borderRadius:16,height:48,padding:"0 16px",cursor:"pointer",fontSize:16,fontWeight:600,overflow:"hidden",transition:"all 0.2s ease",gap:8}),_i={zero:"var(--corner-zero)",xs:"var(--corner-xs)",sm:"var(--corner-sm)",md:"var(--corner-md)",lg:"var(--corner-lg)",xl:"var(--corner-xl)","2xl":"var(--corner-2xl)","3xl":"var(--corner-3xl)","4xl":"var(--corner-4xl)","5xl":"var(--corner-5xl)","6xl":"var(--corner-6xl)","full-round":"var(--corner-full-round)"},tR={xs:"var(--height-button-xs)",sm:"var(--height-button-sm)",md:"var(--height-button-md)",lg:"var(--height-button-lg)"},nR={clear:z.css({backgroundColor:"transparent",border:"none"}),filled:z.css({backgroundColor:"var(--fill-accent-primary)",color:"white",border:"none"}),outline:z.css({backgroundColor:"transparent",border:"1px solid var(--border-accent-primary)"})},rR=(e,t,n,r)=>{if(r)return z.css({cursor:"not-allowed",opacity:.7});const o={transition:"all 0.2s ease",borderRadius:"var(--corner-lg)",border:"none",color:e==="filled"?"var(--text-inverse)":`var(--text-${t})`};switch(e){case"filled":return z.css({...o,backgroundColor:`var(--fill-${t}-${n})`,":hover":{backgroundColor:`var(--fill-${t}-${n}-hover)`},":active":{backgroundColor:`var(--fill-${t}-${n}-hover)`}});case"outline":return z.css({...o,backgroundColor:"transparent",border:`1px solid var(--border-${t}-${n})`,":hover":{backgroundColor:`var(--fill-${t}-secondary-hover)`},":active":{backgroundColor:`var(--fill-${t}-secondary-hover)`}});case"clear":return z.css({...o,backgroundColor:"transparent",":hover":{backgroundColor:`var(--fill-${t}-secondary-hover)`},":active":{backgroundColor:`var(--fill-${t}-secondary-hover)`}});default:return z.css(o)}},Go=({disabled:e,loading:t,wrapperClassName:n,buttonClassName:r,buttonDisabledClassName:o,textClassName:i,children:s,variant:a="filled",backgroundColor:l,textColor:c,textFontWeight:u,borderColor:f,color:d="accent",opacity:h,borderRadius:g,width:p="full",size:m="md",iconLeft:_,iconRight:y,intensity:v="primary",flex:x,type:b="button",...w})=>{const T=C.useMemo(()=>{switch(p){case"full":return"100%";case"auto":return"auto";default:return p}},[p]),E=C.useMemo(()=>l||(a==="filled"?d==="neutral"?"var(--fill-neutral-secondary)":`var(--fill-${d}-${v})`:"transparent"),[a,l,d,v]),R=C.useMemo(()=>{if(v==="primary"){if(d==="neutral")return"var(--text-secondary)";if(a==="filled")return"var(--text-inverse)"}else if(d==="neutral")return"var(--text-secondary)";return`var(--text-${d})`},[v,d,a]),M=C.useMemo(()=>{if(v==="primary"){if(d==="neutral")return"secondary";if(a==="filled")return"inverse"}else if(d==="neutral")return"secondary";return d},[a,d,v]),O=C.useMemo(()=>f||(a==="outline"?`var(--border-${d}-${v})`:"transparent"),[a,f,d,v]),D=C.useMemo(()=>{switch(m){case"lg":return _i.lg;case"md":case"sm":return _i.md;case"xs":return _i.sm;default:return _i.md}},[m]),I=z.cx(eR,rR(a,d,v,e),nR[a],e?o:void 0,z.css({borderRadius:g?_i[g]:D,backgroundColor:E,borderColor:O,color:c,width:"100%",height:tR[m],opacity:h||(e?.7:1)}),r),L=C.useMemo(()=>{switch(m){case"lg":case"md":return"body-1";case"sm":case"xs":return"body-2";default:return"body-1"}},[m]);return S.jsx(q,{className:z.cx(n),w:T,flex:x,relative:!0,overflow:"hidden",children:S.jsxs(Ya.button,{...w,whileTap:!e&&!t?{scale:.99,boxShadow:"inset 0 0 0 10000px rgba(0,0,0,0.1)",transition:{duration:0}}:{},disabled:e||t,className:I,type:b,children:[t?S.jsx(ev,{color:R}):S.jsxs(S.Fragment,{children:[_,S.jsx(D0,{style:{color:c},colorName:M,variant:L,className:i,textOverflow:"ellipsis",overflow:"hidden",children:s}),y]}),S.jsx(io,{})]})})},oR=e=>N.createElement("svg",{width:16,height:16,viewBox:"0 0 24 24",fill:"none",...e},N.createElement("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z",fill:"currentColor"})),iR=e=>N.createElement("svg",{viewBox:"0 0 24 24",fill:"none",...e},N.createElement("path",{d:"M19 13H5v-2h14v2z",fill:"currentColor"})),sR="_checkbox_22ifd_8",aR="_disabled_22ifd_14",lR="_checkbox__ripple_22ifd_14",cR="_checkbox__input_22ifd_26",uR="_checkbox__box_22ifd_33",dR="_secondary_22ifd_46",fR="_checked_22ifd_52",hR="_error_22ifd_61",Pn={checkbox:sR,disabled:aR,checkbox__ripple:lR,checkbox__input:cR,checkbox__box:uR,secondary:dR,checked:fR,error:hR},gR={sm:20,md:24},ef=C.forwardRef(({checked:e,onChange:t,disabled:n,error:r,indeterminate:o,size:i="md",title:s,titleColor:a,subtitle:l,subtitleColor:c="secondary",name:u,required:f,variant:d="primary",flex:h,readOnly:g},p)=>{const[m,_]=C.useState(!1),y=e!==void 0,v=y?e:m,x=R=>{y||_(R.target.checked),t?.(R)},b=gR[i],w=v||o,T=!!g&&!n,E=n?"not-allowed":T?"auto":"pointer";return S.jsxs("label",{className:z.cx(Pn.checkbox,z.css({flex:h,cursor:E}),{[Pn.disabled]:n}),children:[S.jsxs(q,{relative:!0,display:"inline-flex",style:{"--checkbox-size":`${b}px`,"--checkbox-size-double":`${b*2}px`},children:[S.jsx("input",{ref:p,type:"checkbox",checked:v,onChange:T?void 0:x,onClick:R=>R.stopPropagation(),disabled:n,readOnly:T,name:u,required:f,className:z.cx(Pn.checkbox__input,{[Pn.disabled]:n},z.css({cursor:E}))}),S.jsx("div",{className:z.cx(Pn.checkbox__box,Pn[d],{[Pn.disabled]:n,[Pn.error]:r,[Pn.checked]:w}),children:w&&(o?S.jsx(iR,{width:b*.75,height:b*.75}):S.jsx(oR,{width:b*.75,height:b*.75}))})]}),(s||l)&&S.jsxs(q,{gap:4,children:[s&&S.jsx(ce,{colorName:a,variant:i==="sm"?"body-2":"body-1",children:s}),l&&S.jsx(ce,{variant:"body-2",colorName:c,children:l})]})]})});ef.displayName="Checkbox";const pR=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("g",{opacity:.5},N.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.0002 17.9999C14.4185 17.9999 18.0002 14.4182 18.0002 9.99991C18.0002 5.58163 14.4185 1.99991 10.0002 1.99991C5.58197 1.99991 2.00024 5.58163 2.00024 9.99991C2.00024 14.4182 5.58197 17.9999 10.0002 17.9999ZM6.46514 6.46446C6.85566 6.07393 7.48883 6.07393 7.87935 6.46446L9.64712 8.23222C9.84238 8.42749 10.159 8.42749 10.3542 8.23222L12.122 6.46446C12.5125 6.07393 13.1457 6.07393 13.5362 6.46446C13.9267 6.85498 13.9267 7.48814 13.5362 7.87867L11.7684 9.64644C11.5732 9.8417 11.5732 10.1583 11.7684 10.3535L13.5362 12.1213C13.9267 12.5118 13.9267 13.145 13.5362 13.5355C13.1457 13.926 12.5125 13.926 12.122 13.5355L10.3542 11.7678C10.159 11.5725 9.84238 11.5725 9.64712 11.7678L7.87935 13.5355C7.48883 13.926 6.85566 13.926 6.46514 13.5355C6.07462 13.145 6.07462 12.5118 6.46514 12.1213L8.23291 10.3535C8.42817 10.1583 8.42817 9.8417 8.23291 9.64644L6.46514 7.87867C6.07462 7.48815 6.07462 6.85498 6.46514 6.46446Z",fill:"currentColor"}))),mR="_disabled_1kvy1_20",yR="_multiline_1kvy1_24",vR="_input_1kvy1_8",_R="_sm_1kvy1_74",xR="_md_1kvy1_79",bR="_error_1kvy1_84",CR="_primary_1kvy1_88",wR="_secondary_1kvy1_92",ft={"input-container":"_input-container_1kvy1_8",disabled:mR,multiline:yR,input:vR,"input-text-size_sm":"_input-text-size_sm_1kvy1_55","input-text-size_md":"_input-text-size_md_1kvy1_59","input-text-align_left":"_input-text-align_left_1kvy1_64","input-text-align_center":"_input-text-align_center_1kvy1_67","input-text-align_right":"_input-text-align_right_1kvy1_70",sm:_R,md:xR,error:bR,primary:CR,secondary:wR,"clear-button":"_clear-button_1kvy1_96"};function Xg(e){return{...new Event("input",{bubbles:!0}),target:e,currentTarget:e}}const qo=C.forwardRef((e,t)=>{const{label:n,prompt:r,error:o,errorText:i,size:s="md",prefix:a,suffix:l,background:c="primary",showClearButton:u,disabled:f,value:d,defaultValue:h,inputClassName:g,textAlign:p="left",...m}=e,_=e.multiline===!0,y=C.useRef(null),v=C.useRef(null),[x,b]=so(typeof d=="string"||typeof d=="number"?String(d):void 0,typeof h=="string"||typeof h=="number"?String(h):"");C.useImperativeHandle(t,()=>({focus:()=>{y.current?.focus(),v.current?.focus()},blur:()=>{y.current?.blur(),v.current?.blur()},get value(){return y.current?.value||v.current?.value},set value(M){b(M),y.current&&(y.current.value=M),v.current&&(v.current.value=M)}}));const w=M=>{if(b(M.target.value),_){const O=e.onChange;O?.(M)}else{const O=e.onChange;O?.(M)}};C.useEffect(()=>{_&&e.autoResize&&v.current&&(v.current.style.height="auto",v.current.style.height=`${v.current.scrollHeight}px`)},[x,_,e.autoResize]);const T=()=>{if(b(""),!_){const O=y.current;if(O){O.value="";const D=Xg(O),I=e.onChange;I?.(D)}return}const M=v.current;if(M){M.value="";const O=Xg(M),D=e.onChange;D?.(O)}},E=()=>{if(_){const{rows:I,autoResize:L,onChange:B,multiline:K,...P}=m;return S.jsx("textarea",{ref:v,rows:e.rows??3,className:z.cx(ft.input,g,{[ft.disabled]:f,[ft[`input-text-align_${p}`]]:!!p}),disabled:f,maxLength:e.maxLength,...P,value:x,onChange:w})}const{onChange:M,multiline:O,...D}=m;return S.jsx("input",{...D,ref:y,className:z.cx(ft.input,ft[`input-text-size_${s}`],g,{[ft.disabled]:f,[ft[`input-text-align_${p}`]]:!!p}),disabled:f,type:e.type??"text",value:x,onChange:w})},R=C.useMemo(()=>c==="white"?ft.primary:c==="gray"?ft.secondary:ft[c],[c]);return S.jsxs(q,{w:"full",gap:"var(--spacing-sm)",children:[typeof n=="string"?S.jsx(ce,{variant:"body-2",fontWeight:"regular",colorName:"tertiary",children:n}):n,S.jsxs(q,{row:!0,alignItems:_?"flex-start":"center",w:"full",gap:"var(--spacing-md)",className:z.cx(ft["input-container"],R,ft[s],{[ft.error]:o,[ft.disabled]:f,[ft.multiline]:_}),children:[a&&S.jsx(q,{flex:"none",children:a}),S.jsx(q,{flex:"1",children:E()}),u&&x&&!f&&S.jsx(q,{flex:"none",children:S.jsx("span",{className:ft["clear-button"],onClick:T,children:S.jsx(pR,{})})}),l&&S.jsx(q,{flex:"none",children:l})]}),(r||_)&&S.jsxs(q,{row:!0,gap:10,w:"full",children:[typeof r=="string"?S.jsx(ce,{variant:"caption-1",colorName:"tertiary",children:r}):r,_&&e.maxLength&&S.jsx(ce,{right:!0,ml:"auto",flex:"none",variant:"caption-1",colorName:"tertiary",children:`${x.length}/${e.maxLength}`})]}),i&&o&&S.jsx(ce,{variant:"body-2",colorName:"negative",fontWeight:"regular",children:i})]})});qo.displayName="Input";const SR=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M15 8.33333H5M17.5 5H2.5M17.5 11.6667H2.5M15 15H5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),ER=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M13.3333 8.33333H2.5M16.6667 5H2.5M16.6667 11.6667H2.5M13.3333 15H2.5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),TR=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M17.5 8.33333H6.66665M17.5 5H3.33331M17.5 11.6667H3.33331M17.5 15H6.66665",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),RR=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M5 10H11.6667C13.5076 10 15 8.50766 15 6.66671C15 4.82576 13.5076 3.33337 11.6667 3.33337H5V10ZM5 10H12.5C14.3409 10 15.8333 11.4924 15.8333 13.3334C15.8333 15.1743 14.3409 16.6667 12.5 16.6667H5V10Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),kR=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M13.5 17.5H5.77614C5.2713 17.5 5.01887 17.5 4.90199 17.4002C4.80056 17.3135 4.74674 17.1836 4.75721 17.0506C4.76927 16.8974 4.94776 16.7189 5.30474 16.3619L12.3905 9.27614C12.7205 8.94613 12.8855 8.78112 13.0758 8.7193C13.2432 8.66492 13.4235 8.66492 13.5908 8.7193C13.7811 8.78112 13.9461 8.94613 14.2761 9.27614L17.5 12.5V13.5M13.5 17.5C14.9001 17.5 15.6002 17.5 16.135 17.2275C16.6054 16.9878 16.9878 16.6054 17.2275 16.135C17.5 15.6002 17.5 14.9001 17.5 13.5M13.5 17.5H6.5C5.09987 17.5 4.3998 17.5 3.86502 17.2275C3.39462 16.9878 3.01217 16.6054 2.77248 16.135C2.5 15.6002 2.5 14.9001 2.5 13.5V6.5C2.5 5.09987 2.5 4.3998 2.77248 3.86502C3.01217 3.39462 3.39462 3.01217 3.86502 2.77248C4.3998 2.5 5.09987 2.5 6.5 2.5H13.5C14.9001 2.5 15.6002 2.5 16.135 2.77248C16.6054 3.01217 16.9878 3.39462 17.2275 3.86502C17.5 4.3998 17.5 5.09987 17.5 6.5V13.5M8.75 7.08333C8.75 8.00381 8.00381 8.75 7.08333 8.75C6.16286 8.75 5.41667 8.00381 5.41667 7.08333C5.41667 6.16286 6.16286 5.41667 7.08333 5.41667C8.00381 5.41667 8.75 6.16286 8.75 7.08333Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),AR=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M15.8334 3.33337H8.33335M11.6667 16.6667H4.16669M12.5 3.33337L7.50002 16.6667",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),MR=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("g",{clipPath:"url(#clip0_1571_1710)"},N.createElement("path",{d:"M8.33332 10.8333C8.69119 11.3118 9.14778 11.7077 9.67211 11.9941C10.1964 12.2806 10.7762 12.4509 11.3722 12.4936C11.9681 12.5363 12.5663 12.4503 13.1261 12.2415C13.6859 12.0327 14.1942 11.7059 14.6167 11.2833L17.1167 8.78335C17.8756 7.9975 18.2956 6.94499 18.2861 5.85251C18.2766 4.76002 17.8384 3.71497 17.0659 2.94243C16.2934 2.1699 15.2483 1.7317 14.1558 1.7222C13.0633 1.71271 12.0108 2.13269 11.225 2.89168L9.79165 4.31668M11.6666 9.16668C11.3088 8.68824 10.8522 8.29236 10.3279 8.0059C9.80353 7.71943 9.22373 7.54908 8.62777 7.5064C8.03182 7.46372 7.43366 7.54971 6.87386 7.75853C6.31406 7.96735 5.80572 8.29412 5.38332 8.71668L2.88332 11.2167C2.12432 12.0025 1.70435 13.055 1.71384 14.1475C1.72334 15.24 2.16154 16.2851 2.93407 17.0576C3.70661 17.8301 4.75166 18.2683 5.84414 18.2778C6.93663 18.2873 7.98914 17.8673 8.77498 17.1083L10.2 15.6833",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),N.createElement("defs",null,N.createElement("clipPath",{id:"clip0_1571_1710"},N.createElement("rect",{width:20,height:20,fill:"white"})))),NR=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M17.5 9.99996L7.5 9.99996M17.5 4.99996L7.5 4.99996M17.5 15L7.5 15M4.16667 9.99996C4.16667 10.4602 3.79357 10.8333 3.33333 10.8333C2.8731 10.8333 2.5 10.4602 2.5 9.99996C2.5 9.53972 2.8731 9.16663 3.33333 9.16663C3.79357 9.16663 4.16667 9.53972 4.16667 9.99996ZM4.16667 4.99996C4.16667 5.4602 3.79357 5.83329 3.33333 5.83329C2.8731 5.83329 2.5 5.4602 2.5 4.99996C2.5 4.53972 2.8731 4.16663 3.33333 4.16663C3.79357 4.16663 4.16667 4.53972 4.16667 4.99996ZM4.16667 15C4.16667 15.4602 3.79357 15.8333 3.33333 15.8333C2.8731 15.8333 2.5 15.4602 2.5 15C2.5 14.5397 2.8731 14.1666 3.33333 14.1666C3.79357 14.1666 4.16667 14.5397 4.16667 15Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),PR=e=>N.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M14 8.74967C14.4142 8.74967 14.75 8.41389 14.75 7.99967C14.75 7.58546 14.4142 7.24967 14 7.24967V7.99967V8.74967ZM6 7.24967C5.58579 7.24967 5.25 7.58546 5.25 7.99967C5.25 8.41389 5.58579 8.74967 6 8.74967V7.99967V7.24967ZM14 4.74967C14.4142 4.74967 14.75 4.41389 14.75 3.99967C14.75 3.58546 14.4142 3.24967 14 3.24967V3.99967V4.74967ZM6 3.24967C5.58579 3.24967 5.25 3.58546 5.25 3.99967C5.25 4.41389 5.58579 4.74967 6 4.74967V3.99967V3.24967ZM14 12.7497C14.4142 12.7497 14.75 12.4139 14.75 11.9997C14.75 11.5855 14.4142 11.2497 14 11.2497V11.9997V12.7497ZM6 11.2497C5.58579 11.2497 5.25 11.5855 5.25 11.9997C5.25 12.4139 5.58579 12.7497 6 12.7497V11.9997V11.2497ZM1.58967 3.48952C1.24295 3.71614 1.14558 4.18092 1.3722 4.52765C1.59882 4.87437 2.0636 4.97174 2.41033 4.74512L2 4.11732L1.58967 3.48952ZM3.2 3.33301H3.95C3.95 3.05764 3.79909 2.80441 3.5569 2.67337C3.31471 2.54233 3.02018 2.55455 2.78967 2.70521L3.2 3.33301ZM2.4 5.91634C1.98579 5.91634 1.65 6.25213 1.65 6.66634C1.65 7.08055 1.98579 7.41634 2.4 7.41634V6.66634V5.91634ZM4 7.41634C4.41421 7.41634 4.75 7.08055 4.75 6.66634C4.75 6.25213 4.41421 5.91634 4 5.91634V6.66634V7.41634ZM3.73743 10.8967L4.2726 11.4222L4.2726 11.4222L3.73743 10.8967ZM2 12.6663L1.46483 12.1409C1.25318 12.3565 1.19153 12.678 1.30841 12.9565C1.4253 13.2351 1.69791 13.4163 2 13.4163V12.6663ZM4 13.4163C4.41421 13.4163 4.75 13.0806 4.75 12.6663C4.75 12.2521 4.41421 11.9163 4 11.9163V12.6663V13.4163ZM1.25 10.2589C1.25 10.6731 1.58579 11.0089 2 11.0089C2.41421 11.0089 2.75 10.6731 2.75 10.2589H2H1.25ZM14 7.99967V7.24967L6 7.24967V7.99967V8.74967L14 8.74967V7.99967ZM14 3.99967V3.24967H6V3.99967V4.74967H14V3.99967ZM14 11.9997V11.2497L6 11.2497V11.9997V12.7497L14 12.7497V11.9997ZM2 4.11732L2.41033 4.74512L3.61033 3.96081L3.2 3.33301L2.78967 2.70521L1.58967 3.48952L2 4.11732ZM3.2 3.33301H2.45V6.66634H3.2H3.95V3.33301H3.2ZM3.2 6.66634V5.91634H2.4V6.66634V7.41634H3.2V6.66634ZM3.2 6.66634V7.41634H4V6.66634V5.91634H3.2V6.66634ZM3.73743 10.8967L3.20226 10.3713L1.46483 12.1409L2 12.6663L2.53517 13.1918L4.2726 11.4222L3.73743 10.8967ZM2 12.6663V13.4163H4V12.6663V11.9163H2V12.6663ZM4 10.2654H3.25C3.25 10.2957 3.23759 10.3353 3.20225 10.3713L3.73743 10.8967L4.2726 11.4222C4.57518 11.114 4.75 10.7002 4.75 10.2654H4ZM3 9.33301V10.083C3.08406 10.083 3.1515 10.1147 3.19493 10.1553C3.23791 10.1955 3.25 10.2354 3.25 10.2654H4H4.75C4.75 9.29296 3.91808 8.58301 3 8.58301V9.33301ZM2 10.2589H2.75C2.75 10.2299 2.76126 10.1927 2.80245 10.1545C2.84462 10.1155 2.91258 10.083 3 10.083V9.33301V8.58301C2.0889 8.58301 1.25 9.28004 1.25 10.2589H2Z",fill:"currentColor"})),FR=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M5 13.3334C5 15.1743 6.49238 16.6667 8.33333 16.6667H11.6667C13.5076 16.6667 15 15.1743 15 13.3334C15 11.4924 13.5076 10 11.6667 10M15 6.66671C15 4.82576 13.5076 3.33337 11.6667 3.33337H8.33333C6.49238 3.33337 5 4.82576 5 6.66671M2.5 10H17.5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),LR=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M2.5 7.5L17.5 7.5M7.5 2.5L7.5 17.5M6.5 2.5H13.5C14.9001 2.5 15.6002 2.5 16.135 2.77248C16.6054 3.01217 16.9878 3.39462 17.2275 3.86502C17.5 4.3998 17.5 5.09987 17.5 6.5V13.5C17.5 14.9001 17.5 15.6002 17.2275 16.135C16.9878 16.6054 16.6054 16.9878 16.135 17.2275C15.6002 17.5 14.9001 17.5 13.5 17.5H6.5C5.09987 17.5 4.3998 17.5 3.86502 17.2275C3.39462 16.9878 3.01217 16.6054 2.77248 16.135C2.5 15.6002 2.5 14.9001 2.5 13.5V6.5C2.5 5.09987 2.5 4.3998 2.77248 3.86502C3.01217 3.39462 3.39462 3.01217 3.86502 2.77248C4.3998 2.5 5.09987 2.5 6.5 2.5Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),OR=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M15 3.33337V9.16671C15 11.9281 12.7614 14.1667 9.99998 14.1667C7.23856 14.1667 4.99998 11.9281 4.99998 9.16671V3.33337M3.33331 17.5H16.6666",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),V0=C.createContext(null);function tf(){const e=C.useContext(V0);if(!e)throw new Error("useEditorStates must be used within EditorState Provider");return e}const j0=C.createContext(null);function IR(){const e=C.useContext(j0);if(!e)throw new Error("useToolbarContext must be used within ToolbarContext provider");return e}var Ri={exports:{}};Ri.exports;var Jg;function $R(){return Jg||(Jg=1,(function(e,t){var n=200,r="__lodash_hash_undefined__",o=800,i=16,s=9007199254740991,a="[object Arguments]",l="[object Array]",c="[object AsyncFunction]",u="[object Boolean]",f="[object Date]",d="[object Error]",h="[object Function]",g="[object GeneratorFunction]",p="[object Map]",m="[object Number]",_="[object Null]",y="[object Object]",v="[object Proxy]",x="[object RegExp]",b="[object Set]",w="[object String]",T="[object Undefined]",E="[object WeakMap]",R="[object ArrayBuffer]",M="[object DataView]",O="[object Float32Array]",D="[object Float64Array]",I="[object Int8Array]",L="[object Int16Array]",B="[object Int32Array]",K="[object Uint8Array]",P="[object Uint8ClampedArray]",A="[object Uint16Array]",$="[object Uint32Array]",H=/[\\^$.*+?()[\]{}|]/g,Q=/^\[object .+?Constructor\]$/,J=/^(?:0|[1-9]\d*)$/,X={};X[O]=X[D]=X[I]=X[L]=X[B]=X[K]=X[P]=X[A]=X[$]=!0,X[a]=X[l]=X[R]=X[u]=X[M]=X[f]=X[d]=X[h]=X[p]=X[m]=X[y]=X[x]=X[b]=X[w]=X[E]=!1;var se=typeof _n=="object"&&_n&&_n.Object===Object&&_n,re=typeof self=="object"&&self&&self.Object===Object&&self,he=se||re||Function("return this")(),we=t&&!t.nodeType&&t,te=we&&!0&&e&&!e.nodeType&&e,ye=te&&te.exports===we,Se=ye&&se.process,$e=(function(){try{var k=te&&te.require&&te.require("util").types;return k||Se&&Se.binding&&Se.binding("util")}catch{}})(),ee=$e&&$e.isTypedArray;function pe(k,F,j){switch(j.length){case 0:return k.call(F);case 1:return k.call(F,j[0]);case 2:return k.call(F,j[0],j[1]);case 3:return k.call(F,j[0],j[1],j[2])}return k.apply(F,j)}function Ne(k,F){for(var j=-1,ne=Array(k);++j<k;)ne[j]=F(j);return ne}function Ze(k){return function(F){return k(F)}}function Le(k,F){return k?.[F]}function Qn(k,F){return function(j){return k(F(j))}}var fn=Array.prototype,hn=Function.prototype,Dt=Object.prototype,ve=he["__core-js_shared__"],Re=hn.toString,Vt=Dt.hasOwnProperty,ph=(function(){var k=/[^.]+$/.exec(ve&&ve.keys&&ve.keys.IE_PROTO||"");return k?"Symbol(src)_1."+k:""})(),mh=Dt.toString,Tb=Re.call(Object),Rb=RegExp("^"+Re.call(Vt).replace(H,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),xs=ye?he.Buffer:void 0,yh=he.Symbol,vh=he.Uint8Array;xs&&xs.allocUnsafe;var _h=Qn(Object.getPrototypeOf,Object),xh=Object.create,kb=Dt.propertyIsEnumerable,Ab=fn.splice,Tr=yh?yh.toStringTag:void 0,bs=(function(){try{var k=Tl(Object,"defineProperty");return k({},"",{}),k}catch{}})(),Mb=xs?xs.isBuffer:void 0,bh=Math.max,Nb=Date.now,Ch=Tl(he,"Map"),pi=Tl(Object,"create"),Pb=(function(){function k(){}return function(F){if(!kr(F))return{};if(xh)return xh(F);k.prototype=F;var j=new k;return k.prototype=void 0,j}})();function Rr(k){var F=-1,j=k==null?0:k.length;for(this.clear();++F<j;){var ne=k[F];this.set(ne[0],ne[1])}}function Fb(){this.__data__=pi?pi(null):{},this.size=0}function Lb(k){var F=this.has(k)&&delete this.__data__[k];return this.size-=F?1:0,F}function Ob(k){var F=this.__data__;if(pi){var j=F[k];return j===r?void 0:j}return Vt.call(F,k)?F[k]:void 0}function Ib(k){var F=this.__data__;return pi?F[k]!==void 0:Vt.call(F,k)}function $b(k,F){var j=this.__data__;return this.size+=this.has(k)?0:1,j[k]=pi&&F===void 0?r:F,this}Rr.prototype.clear=Fb,Rr.prototype.delete=Lb,Rr.prototype.get=Ob,Rr.prototype.has=Ib,Rr.prototype.set=$b;function Nn(k){var F=-1,j=k==null?0:k.length;for(this.clear();++F<j;){var ne=k[F];this.set(ne[0],ne[1])}}function Db(){this.__data__=[],this.size=0}function Vb(k){var F=this.__data__,j=Cs(F,k);if(j<0)return!1;var ne=F.length-1;return j==ne?F.pop():Ab.call(F,j,1),--this.size,!0}function jb(k){var F=this.__data__,j=Cs(F,k);return j<0?void 0:F[j][1]}function Bb(k){return Cs(this.__data__,k)>-1}function zb(k,F){var j=this.__data__,ne=Cs(j,k);return ne<0?(++this.size,j.push([k,F])):j[ne][1]=F,this}Nn.prototype.clear=Db,Nn.prototype.delete=Vb,Nn.prototype.get=jb,Nn.prototype.has=Bb,Nn.prototype.set=zb;function ho(k){var F=-1,j=k==null?0:k.length;for(this.clear();++F<j;){var ne=k[F];this.set(ne[0],ne[1])}}function Wb(){this.size=0,this.__data__={hash:new Rr,map:new(Ch||Nn),string:new Rr}}function Hb(k){var F=Ss(this,k).delete(k);return this.size-=F?1:0,F}function Kb(k){return Ss(this,k).get(k)}function Ub(k){return Ss(this,k).has(k)}function Gb(k,F){var j=Ss(this,k),ne=j.size;return j.set(k,F),this.size+=j.size==ne?0:1,this}ho.prototype.clear=Wb,ho.prototype.delete=Hb,ho.prototype.get=Kb,ho.prototype.has=Ub,ho.prototype.set=Gb;function go(k){var F=this.__data__=new Nn(k);this.size=F.size}function qb(){this.__data__=new Nn,this.size=0}function Yb(k){var F=this.__data__,j=F.delete(k);return this.size=F.size,j}function Xb(k){return this.__data__.get(k)}function Jb(k){return this.__data__.has(k)}function Zb(k,F){var j=this.__data__;if(j instanceof Nn){var ne=j.__data__;if(!Ch||ne.length<n-1)return ne.push([k,F]),this.size=++j.size,this;j=this.__data__=new ho(ne)}return j.set(k,F),this.size=j.size,this}go.prototype.clear=qb,go.prototype.delete=Yb,go.prototype.get=Xb,go.prototype.has=Jb,go.prototype.set=Zb;function Qb(k,F){var j=Al(k),ne=!j&&kl(k),be=!j&&!ne&&Rh(k),Oe=!j&&!ne&&!be&&Ah(k),Be=j||ne||be||Oe,Te=Be?Ne(k.length,String):[],ze=Te.length;for(var Yt in k)Be&&(Yt=="length"||be&&(Yt=="offset"||Yt=="parent")||Oe&&(Yt=="buffer"||Yt=="byteLength"||Yt=="byteOffset")||Eh(Yt,ze))||Te.push(Yt);return Te}function Sl(k,F,j){(j!==void 0&&!Es(k[F],j)||j===void 0&&!(F in k))&&El(k,F,j)}function eC(k,F,j){var ne=k[F];(!(Vt.call(k,F)&&Es(ne,j))||j===void 0&&!(F in k))&&El(k,F,j)}function Cs(k,F){for(var j=k.length;j--;)if(Es(k[j][0],F))return j;return-1}function El(k,F,j){F=="__proto__"&&bs?bs(k,F,{configurable:!0,enumerable:!0,value:j,writable:!0}):k[F]=j}var tC=gC();function ws(k){return k==null?k===void 0?T:_:Tr&&Tr in Object(k)?pC(k):bC(k)}function wh(k){return mi(k)&&ws(k)==a}function nC(k){if(!kr(k)||_C(k))return!1;var F=Nl(k)?Rb:Q;return F.test(EC(k))}function rC(k){return mi(k)&&kh(k.length)&&!!X[ws(k)]}function oC(k){if(!kr(k))return xC(k);var F=Th(k),j=[];for(var ne in k)ne=="constructor"&&(F||!Vt.call(k,ne))||j.push(ne);return j}function Sh(k,F,j,ne,be){k!==F&&tC(F,function(Oe,Be){if(be||(be=new go),kr(Oe))iC(k,F,Be,j,Sh,ne,be);else{var Te=ne?ne(Rl(k,Be),Oe,Be+"",k,F,be):void 0;Te===void 0&&(Te=Oe),Sl(k,Be,Te)}},Mh)}function iC(k,F,j,ne,be,Oe,Be){var Te=Rl(k,j),ze=Rl(F,j),Yt=Be.get(ze);if(Yt){Sl(k,j,Yt);return}var Lt=Oe?Oe(Te,ze,j+"",k,F,Be):void 0,yi=Lt===void 0;if(yi){var Pl=Al(ze),Fl=!Pl&&Rh(ze),Ph=!Pl&&!Fl&&Ah(ze);Lt=ze,Pl||Fl||Ph?Al(Te)?Lt=Te:TC(Te)?Lt=dC(Te):Fl?(yi=!1,Lt=lC(ze)):Ph?(yi=!1,Lt=uC(ze)):Lt=[]:RC(ze)||kl(ze)?(Lt=Te,kl(Te)?Lt=kC(Te):(!kr(Te)||Nl(Te))&&(Lt=mC(ze))):yi=!1}yi&&(Be.set(ze,Lt),be(Lt,ze,ne,Oe,Be),Be.delete(ze)),Sl(k,j,Lt)}function sC(k,F){return wC(CC(k,F,Nh),k+"")}var aC=bs?function(k,F){return bs(k,"toString",{configurable:!0,enumerable:!1,value:MC(F),writable:!0})}:Nh;function lC(k,F){return k.slice()}function cC(k){var F=new k.constructor(k.byteLength);return new vh(F).set(new vh(k)),F}function uC(k,F){var j=cC(k.buffer);return new k.constructor(j,k.byteOffset,k.length)}function dC(k,F){var j=-1,ne=k.length;for(F||(F=Array(ne));++j<ne;)F[j]=k[j];return F}function fC(k,F,j,ne){var be=!j;j||(j={});for(var Oe=-1,Be=F.length;++Oe<Be;){var Te=F[Oe],ze=void 0;ze===void 0&&(ze=k[Te]),be?El(j,Te,ze):eC(j,Te,ze)}return j}function hC(k){return sC(function(F,j){var ne=-1,be=j.length,Oe=be>1?j[be-1]:void 0,Be=be>2?j[2]:void 0;for(Oe=k.length>3&&typeof Oe=="function"?(be--,Oe):void 0,Be&&yC(j[0],j[1],Be)&&(Oe=be<3?void 0:Oe,be=1),F=Object(F);++ne<be;){var Te=j[ne];Te&&k(F,Te,ne,Oe)}return F})}function gC(k){return function(F,j,ne){for(var be=-1,Oe=Object(F),Be=ne(F),Te=Be.length;Te--;){var ze=Be[++be];if(j(Oe[ze],ze,Oe)===!1)break}return F}}function Ss(k,F){var j=k.__data__;return vC(F)?j[typeof F=="string"?"string":"hash"]:j.map}function Tl(k,F){var j=Le(k,F);return nC(j)?j:void 0}function pC(k){var F=Vt.call(k,Tr),j=k[Tr];try{k[Tr]=void 0;var ne=!0}catch{}var be=mh.call(k);return ne&&(F?k[Tr]=j:delete k[Tr]),be}function mC(k){return typeof k.constructor=="function"&&!Th(k)?Pb(_h(k)):{}}function Eh(k,F){var j=typeof k;return F=F??s,!!F&&(j=="number"||j!="symbol"&&J.test(k))&&k>-1&&k%1==0&&k<F}function yC(k,F,j){if(!kr(j))return!1;var ne=typeof F;return(ne=="number"?Ml(j)&&Eh(F,j.length):ne=="string"&&F in j)?Es(j[F],k):!1}function vC(k){var F=typeof k;return F=="string"||F=="number"||F=="symbol"||F=="boolean"?k!=="__proto__":k===null}function _C(k){return!!ph&&ph in k}function Th(k){var F=k&&k.constructor,j=typeof F=="function"&&F.prototype||Dt;return k===j}function xC(k){var F=[];if(k!=null)for(var j in Object(k))F.push(j);return F}function bC(k){return mh.call(k)}function CC(k,F,j){return F=bh(F===void 0?k.length-1:F,0),function(){for(var ne=arguments,be=-1,Oe=bh(ne.length-F,0),Be=Array(Oe);++be<Oe;)Be[be]=ne[F+be];be=-1;for(var Te=Array(F+1);++be<F;)Te[be]=ne[be];return Te[F]=j(Be),pe(k,this,Te)}}function Rl(k,F){if(!(F==="constructor"&&typeof k[F]=="function")&&F!="__proto__")return k[F]}var wC=SC(aC);function SC(k){var F=0,j=0;return function(){var ne=Nb(),be=i-(ne-j);if(j=ne,be>0){if(++F>=o)return arguments[0]}else F=0;return k.apply(void 0,arguments)}}function EC(k){if(k!=null){try{return Re.call(k)}catch{}try{return k+""}catch{}}return""}function Es(k,F){return k===F||k!==k&&F!==F}var kl=wh((function(){return arguments})())?wh:function(k){return mi(k)&&Vt.call(k,"callee")&&!kb.call(k,"callee")},Al=Array.isArray;function Ml(k){return k!=null&&kh(k.length)&&!Nl(k)}function TC(k){return mi(k)&&Ml(k)}var Rh=Mb||NC;function Nl(k){if(!kr(k))return!1;var F=ws(k);return F==h||F==g||F==c||F==v}function kh(k){return typeof k=="number"&&k>-1&&k%1==0&&k<=s}function kr(k){var F=typeof k;return k!=null&&(F=="object"||F=="function")}function mi(k){return k!=null&&typeof k=="object"}function RC(k){if(!mi(k)||ws(k)!=y)return!1;var F=_h(k);if(F===null)return!0;var j=Vt.call(F,"constructor")&&F.constructor;return typeof j=="function"&&j instanceof j&&Re.call(j)==Tb}var Ah=ee?Ze(ee):rC;function kC(k){return fC(k,Mh(k))}function Mh(k){return Ml(k)?Qb(k):oC(k)}var AC=hC(function(k,F,j){Sh(k,F,j)});function MC(k){return function(){return k}}function Nh(k){return k}function NC(){return!1}e.exports=AC})(Ri,Ri.exports)),Ri.exports}var DR=$R();const VR=_d(DR),B0=C.createContext(null);function jR(){return C.useContext(B0)}function BR({children:e,locale:t}){return S.jsx(B0.Provider,{value:t||null,children:e})}function zR({localeKey:e,defaultLocale:t}){const n=C.createContext(t);function r(s){const{extraLocale:a}=s||{},l=jR();return{value:C.useMemo(()=>{const u=l?l[e]:null,f=[{},t];return u&&f.push(u),a&&f.push(a),VR(...f)},[t,a,e,l])}}function o(){return C.useContext(n)}function i({children:s,locale:a}){const{value:l}=r({extraLocale:a});return S.jsx(n.Provider,{value:l,children:s})}return{Context:n,useComposeLocaleProviderValue:r,useLocale:o,Provider:i}}const z0="MarkdownTextEditor",WR={toolbar:{link:{textPlaceholder:"Enter the text to display",linkPlaceholder:"Paste a link",linkErrorText:"Please enter a valid link",buttonText:"Save"},table:{maxRowsErrorText:e=>`Maximum number of rows is ${e.limit}`,maxColumnsErrorText:e=>`Maximum number of columns is ${e.limit}`,minRowsErrorText:e=>`Minimum number of rows is ${e.limit}`,minColumnsErrorText:e=>`Minimum number of columns is ${e.limit}`,rowsPlaceholder:"Rows count",columnsPlaceholder:"Columns count",buttonText:"Create table"},textSize:{paragraph:"Normal text",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3"},preview:{show:"Preview",hide:"Preview"},actions:{bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",link:"Link",image:"Image",alignLeft:"Align left",alignCenter:"Align center",alignRight:"Align right",table:"Table",bulletList:"Bullet list",numberedList:"Numbered list"}}},{Provider:HR,useLocale:ss}=zR({localeKey:z0,defaultLocale:WR}),W0=C.createContext(null);function KR(e,t){return{getTheme:function(){return t??null}}}function nt(){const e=C.useContext(W0);return e==null&&(function(t,...n){const r=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",t);for(const i of n)o.append("v",i);throw r.search=o.toString(),Error(`Minified Lexical error #${t}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(8),e}function U(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function H0(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);n.search=r.toString(),console.warn(`Minified Lexical warning #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const dn=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,UR=dn&&"documentMode"in document?document.documentMode:null,Qt=dn&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Ur=dn&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),_a=!(!dn||!("InputEvent"in window)||UR)&&"getTargetRanges"in new window.InputEvent("input"),as=dn&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),oi=dn&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,GR=dn&&/Android/.test(navigator.userAgent),K0=dn&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Zg=dn&&GR&&K0,ls=dn&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Qt&&!K0;function U0(...e){const t=[];for(const n of e)if(n&&typeof n=="string")for(const[r]of n.matchAll(/\S+/g))t.push(r);return t}const qR=0,YR=1,XR=2,G0=128,JR=1,ZR=2,QR=3,ek=4,tk=5,nk=6,Xa=as||oi||ls?" ":"",hr=`
|
|
10
10
|
|
|
11
|
-
`,rk=Ur?" ":Xa,gr={bold:1,capitalize:1024,code:16,highlight:G0,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},ok={directionless:1,unmergeable:2},Qg={center:2,end:6,justify:4,left:1,right:3,start:5},ik={[ZR]:"center",[nk]:"end",[ek]:"justify",[JR]:"left",[QR]:"right",[tk]:"start"},sk={normal:0,segmented:2,token:1},ak={[qR]:"normal",[XR]:"segmented",[YR]:"token"},ep="$config";function q0(e,t,n,r,o,i){let s=e.getFirstChild();for(;s!==null;){const a=s.__key;s.__parent===t&&(V(s)&&q0(s,a,n,r,o,i),n.has(a)||i.delete(a),o.push(a)),s=s.getNextSibling()}}let xu=!1,nf=0;function lk(e){nf=e.timeStamp}function Zl(e,t,n){const r=e.nodeName==="BR",o=t.__lexicalLineBreak;return o&&(e===o||r&&e.previousSibling===o)||r&&ll(e,n)!==void 0}function ck(e,t,n){const r=St(qt(n));let o=null,i=null;r!==null&&r.anchorNode===e&&(o=r.anchorOffset,i=r.focusOffset);const s=e.nodeValue;s!==null&&Ef(t,s,o,i,!1)}function uk(e,t,n){if(W(e)){const r=e.anchor.getNode();if(r.is(n)&&e.format!==r.getFormat())return!1}return Zn(t)&&n.isAttached()}function dk(e,t,n,r){for(let o=e;o&&!p3(o);o=fs(o)){const i=ll(o,t);if(i!==void 0){const s=Me(i,n);if(s)return Ce(s)||!je(o)?void 0:[o,s]}else if(o===r)return[r,Y_(n)]}}function Y0(e,t,n){xu=!0;const r=performance.now()-nf>100;try{Sn(e,()=>{const o=G()||(function(d){return d.getEditorState().read(()=>{const h=G();return h!==null?h.clone():null})})(e),i=new Map,s=e.getRootElement(),a=e._editorState,l=e._blockCursorElement;let c=!1,u="";for(let d=0;d<t.length;d++){const h=t[d],g=h.type,p=h.target,m=dk(p,e,a,s);if(!m)continue;const[_,y]=m;if(g==="characterData")r&&Y(y)&&Zn(p)&&uk(o,p,y)&&ck(p,y,e);else if(g==="childList"){c=!0;const v=h.addedNodes;for(let w=0;w<v.length;w++){const T=v[w],E=G_(T),R=T.parentNode;if(R!=null&&T!==l&&E===null&&!Zl(T,R,e)){if(Ur){const M=(je(T)?T.innerText:null)||T.nodeValue;M&&(u+=M)}R.removeChild(T)}}const x=h.removedNodes,b=x.length;if(b>0){let w=0;for(let T=0;T<b;T++){const E=x[T];(Zl(E,p,e)||l===E)&&(p.appendChild(E),w++)}b!==w&&i.set(_,y)}}}if(i.size>0)for(const[d,h]of i)h.reconcileObservedMutation(d,e);const f=n.takeRecords();if(f.length>0){for(let d=0;d<f.length;d++){const h=f[d],g=h.addedNodes,p=h.target;for(let m=0;m<g.length;m++){const _=g[m],y=_.parentNode;y==null||_.nodeName!=="BR"||Zl(_,p,e)||y.removeChild(_)}}n.takeRecords()}o!==null&&(c&&He(o),Ur&&Q_(e)&&o.insertRawText(u))})}finally{xu=!1}}function X0(e){const t=e._observer;t!==null&&Y0(e,t.takeRecords(),t)}function J0(e){(function(t){nf===0&&qt(t).addEventListener("textInput",lk,!0)})(e),e._observer=new MutationObserver((t,n)=>{Y0(e,t,n)})}let fk=class{key;parse;unparse;isEqual;defaultValue;constructor(t,n){this.key=t,this.parse=n.parse.bind(n),this.unparse=(n.unparse||mk).bind(n),this.isEqual=(n.isEqual||Object.is).bind(n),this.defaultValue=this.parse(void 0)}};function hk(e,t){return new fk(e,t)}function Z0(e,t,n="latest"){const r=(n==="latest"?e.getLatest():e).__state;return r?r.getValue(t):t.defaultValue}function Ql(e,t,n){let r;if(st(),typeof n=="function"){const i=e.getLatest(),s=Z0(i,t);if(r=n(s),t.isEqual(s,r))return i}else r=n;const o=e.getWritable();return e_(o).updateFromKnown(t,r),o}function gk(e){const t=new Map,n=new Set;for(let r=typeof e=="function"?e:e.replace;r.prototype&&r.prototype.getType!==void 0;r=Object.getPrototypeOf(r)){const{ownNodeConfig:o}=ul(r);if(o&&o.stateConfigs)for(const i of o.stateConfigs){let s;"stateConfig"in i?(s=i.stateConfig,i.flat&&n.add(s.key)):s=i,t.set(s.key,s)}}return{flatKeys:n,sharedConfigMap:t}}let pk=class Q0{node;knownState;unknownState;sharedNodeState;size;constructor(t,n,r=void 0,o=new Map,i=void 0){this.node=t,this.sharedNodeState=n,this.unknownState=r,this.knownState=o;const{sharedConfigMap:s}=this.sharedNodeState,a=i!==void 0?i:(function(l,c,u){let f=u.size;if(c)for(const d in c){const h=l.get(d);h&&u.has(h)||f++}return f})(s,r,o);this.size=a}getValue(t){const n=this.knownState.get(t);if(n!==void 0)return n;this.sharedNodeState.sharedConfigMap.set(t.key,t);let r=t.defaultValue;if(this.unknownState&&t.key in this.unknownState){const o=this.unknownState[t.key];o!==void 0&&(r=t.parse(o)),this.updateFromKnown(t,r)}return r}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){const t={...this.unknownState},n={};for(const[r,o]of this.knownState)r.isEqual(o,r.defaultValue)?delete t[r.key]:t[r.key]=r.unparse(o);for(const r of this.sharedNodeState.flatKeys)r in t&&(n[r]=t[r],delete t[r]);return tp(t)&&(n.$=t),n}getWritable(t){if(this.node===t)return this;const{sharedNodeState:n,unknownState:r}=this,o=new Map(this.knownState);return new Q0(t,n,(function(i,s,a){let l;if(a)for(const[c,u]of Object.entries(a)){const f=i.get(c);f?s.has(f)||s.set(f,f.parse(u)):(l=l||{},l[c]=u)}return l})(n.sharedConfigMap,o,r),o,this.size)}updateFromKnown(t,n){const r=t.key;this.sharedNodeState.sharedConfigMap.set(r,t);const{knownState:o,unknownState:i}=this;o.has(t)||i&&r in i||(i&&(delete i[r],this.unknownState=tp(i)),this.size++),o.set(t,n)}updateFromUnknown(t,n){const r=this.sharedNodeState.sharedConfigMap.get(t);r?this.updateFromKnown(r,r.parse(n)):(this.unknownState=this.unknownState||{},t in this.unknownState||this.size++,this.unknownState[t]=n)}updateFromJSON(t){const{knownState:n}=this;for(const r of n.keys())n.set(r,r.defaultValue);if(this.size=n.size,this.unknownState=void 0,t)for(const[r,o]of Object.entries(t))this.updateFromUnknown(r,o)}};function e_(e){const t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new pk(t,t_(t));return t.__state=n,n}function t_(e){return e.__state?e.__state.sharedNodeState:B_(ui(),e.getType()).sharedNodeState}function tp(e){if(e)for(const t in e)return e}function mk(e){return e}function np(e,t,n){for(const[r,o]of t.knownState){if(e.has(r.key))continue;e.add(r.key);const i=n?n.getValue(r):r.defaultValue;if(i!==o&&!r.isEqual(i,o))return!0}return!1}function rp(e,t,n){const{unknownState:r}=t,o=n?n.unknownState:void 0;if(r){for(const[i,s]of Object.entries(r))if(!e.has(i)&&(e.add(i),s!==(o?o[i]:void 0)))return!0}return!1}function op(e,t){const n=e.__state;return n&&n.node===e?n.getWritable(t):n}function ip(e,t){const n=e.__mode,r=e.__format,o=e.__style,i=t.__mode,s=t.__format,a=t.__style,l=e.__state,c=t.__state;return(n===null||n===i)&&(r===null||r===s)&&(o===null||o===a)&&(e.__state===null||l===c||(function(u,f){if(u===f)return!0;if(u&&f&&u.size!==f.size)return!1;const d=new Set;return!(u&&np(d,u,f)||f&&np(d,f,u)||u&&rp(d,u,f)||f&&rp(d,f,u))})(l,c))}function sp(e,t){const n=e.mergeWithSibling(t),r=Fe()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function ap(e){let t,n,r=e;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(t=r.getPreviousSibling())!==null&&Y(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(ip(t,r)){r=sp(t,r);break}break}t.remove()}for(;(n=r.getNextSibling())!==null&&Y(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(n.__text!==""){if(ip(r,n)){r=sp(r,n);break}break}n.remove()}}else r.remove()}function qi(e){return lp(e.anchor),lp(e.focus),e}function lp(e){for(;e.type==="element";){const t=e.getNode(),n=e.offset;let r,o;if(n===t.getChildrenSize()?(r=t.getChildAtIndex(n-1),o=!0):(r=t.getChildAtIndex(n),o=!1),Y(r)){e.set(r.__key,o?r.getTextContentSize():0,"text",!0);break}if(!V(r))break;e.set(r.__key,o?r.getChildrenSize():0,"element",!0)}}let Gr,mt,Yi,Ja,bu,Cu,qr,on,wu,Xi,it="",mn=null,Pr=null,Dn="",wo=!1,xa=!1;function ba(e,t){const n=qr.get(e);if(t!==null){const r=Ru(e);r.parentNode===t&&t.removeChild(r)}if(on.has(e)||mt._keyToDOMMap.delete(e),V(n)){const r=wa(n,qr);Su(r,0,r.length-1,null)}n!==void 0&&Tf(Xi,Yi,Ja,n,"destroyed")}function Su(e,t,n,r){let o=t;for(;o<=n;++o){const i=e[o];i!==void 0&&ba(i,r)}}function Mr(e,t){e.setProperty("text-align",t)}const yk="40px";function n_(e,t){const n=Gr.theme.indent;if(typeof n=="string"){const o=e.classList.contains(n);t>0&&!o?e.classList.add(n):t<1&&o&&e.classList.remove(n)}const r=getComputedStyle(e).getPropertyValue("--lexical-indent-base-value")||yk;e.style.setProperty("padding-inline-start",t===0?"":`calc(${t} * ${r})`)}function r_(e,t){const n=e.style;t===0?Mr(n,""):t===1?Mr(n,"left"):t===2?Mr(n,"center"):t===3?Mr(n,"right"):t===4?Mr(n,"justify"):t===5?Mr(n,"start"):t===6&&Mr(n,"end")}function Eu(e,t){const n=(function(r){const o=r.__dir;if(o!==null)return o;if(tt(r))return null;const i=r.getParentOrThrow();return tt(i)&&i.__dir===null?"auto":null})(t);n!==null?e.dir=n:e.removeAttribute("dir")}function Ca(e,t){const n=on.get(e);n===void 0&&U(60);const r=n.createDOM(Gr,mt);if((function(o,i,s){const a=s._keyToDOMMap;(function(l,c,u){const f=`__lexicalKey_${c._key}`;l[f]=u})(i,s,o),a.set(o,i)})(e,r,mt),Y(n)?r.setAttribute("data-lexical-text","true"):Ce(n)&&r.setAttribute("data-lexical-decorator","true"),V(n)){const o=n.__indent,i=n.__size;if(Eu(r,n),o!==0&&n_(r,o),i!==0){const a=i-1;Tu(wa(n,on),n,0,a,n.getDOMSlot(r))}const s=n.__format;s!==0&&r_(r,s),n.isInline()||o_(null,n,r),cl(n)&&(it+=hr,Dn+=hr)}else{const o=n.getTextContent();if(Ce(n)){const i=n.decorate(mt,Gr);i!==null&&i_(e,i),r.contentEditable="false"}it+=o,Dn+=o}return t!==null&&t.insertChild(r),Tf(Xi,Yi,Ja,n,"created"),r}function Tu(e,t,n,r,o){const i=it;it="";let s=n;for(;s<=r;++s){Ca(e[s],o);const a=on.get(e[s]);a!==null&&Y(a)&&mn===null&&(mn=a.getFormat(),Pr=a.getStyle())}cl(t)&&(it+=hr),o.element.__lexicalTextContent=it,it=i+it}function cp(e,t){if(e){const n=e.__last;if(n){const r=t.get(n);if(r)return wn(r)?"line-break":Ce(r)&&r.isInline()?"decorator":null}return"empty"}return null}function o_(e,t,n){const r=cp(e,qr),o=cp(t,on);r!==o&&t.getDOMSlot(n).setManagedLineBreak(o)}function vk(e,t,n){var r;mn=null,Pr=null,(function(o,i,s){const a=it,l=o.__size,c=i.__size;it="";const u=s.element;if(l===1&&c===1){const f=o.__first,d=i.__first;if(f===d)ki(f,u);else{const g=Ru(f),p=Ca(d,null);try{u.replaceChild(p,g)}catch(m){if(typeof m=="object"&&m!=null){const _=`${m.toString()} Parent: ${u.tagName}, new child: {tag: ${p.tagName} key: ${d}}, old child: {tag: ${g.tagName}, key: ${f}}.`;throw new Error(_)}throw m}ba(f,null)}const h=on.get(d);Y(h)&&mn===null&&(mn=h.getFormat(),Pr=h.getStyle())}else{const f=wa(o,qr),d=wa(i,on);if(f.length!==l&&U(227),d.length!==c&&U(228),l===0)c!==0&&Tu(d,i,0,c-1,s);else if(c===0){if(l!==0){const h=s.after==null&&s.before==null&&s.element.__lexicalLineBreak==null;Su(f,0,l-1,h?null:u),h&&(u.textContent="")}}else(function(h,g,p,m,_,y){const v=m-1,x=_-1;let b,w,T=y.getFirstChild(),E=0,R=0;for(;E<=v&&R<=x;){const D=g[E],I=p[R];if(D===I)T=ec(ki(I,y.element)),E++,R++;else{b===void 0&&(b=new Set(g)),w===void 0&&(w=new Set(p));const B=w.has(D),K=b.has(I);if(B)if(K){const P=Jr(mt,I);P===T?T=ec(ki(I,y.element)):(y.withBefore(T).insertChild(P),ki(I,y.element)),E++,R++}else Ca(I,y.withBefore(T)),R++;else T=ec(Ru(D)),ba(D,y.element),E++}const L=on.get(I);L!==null&&Y(L)&&mn===null&&(mn=L.getFormat(),Pr=L.getStyle())}const M=E>v,O=R>x;if(M&&!O){const D=p[x+1],I=D===void 0?null:mt.getElementByKey(D);Tu(p,h,R,x,y.withBefore(I))}else O&&!M&&Su(g,E,v,y.element)})(i,f,d,l,c,s)}cl(i)&&(it+=hr),u.__lexicalTextContent=it,it=a+it})(e,t,t.getDOMSlot(n)),r=t,mn==null||mn===r.__textFormat||xa||r.setTextFormat(mn),(function(o){Pr==null||Pr===o.__textStyle||xa||o.setTextStyle(Pr)})(t)}function wa(e,t){const n=[];let r=e.__first;for(;r!==null;){const o=t.get(r);o===void 0&&U(101),n.push(r),r=o.__next}return n}function ki(e,t){const n=qr.get(e);let r=on.get(e);n!==void 0&&r!==void 0||U(61);const o=wo||Cu.has(e)||bu.has(e),i=Jr(mt,e);if(n===r&&!o){if(V(n)){const s=i.__lexicalTextContent;s!==void 0&&(it+=s,Dn+=s)}else{const s=n.getTextContent();Dn+=s,it+=s}return i}if(n!==r&&o&&Tf(Xi,Yi,Ja,r,"updated"),r.updateDOM(n,i,Gr)){const s=Ca(e,null);return t===null&&U(62),t.replaceChild(s,i),ba(e,null),s}if(V(n)&&V(r)){const s=r.__indent;(wo||s!==n.__indent)&&n_(i,s);const a=r.__format;if((wo||a!==n.__format)&&r_(i,a),o&&(vk(n,r,i),tt(r)||r.isInline()||o_(n,r,i)),cl(r)&&(it+=hr,Dn+=hr),(wo||r.__dir!==n.__dir)&&(Eu(i,r),tt(r)&&!wo))for(const l of r.getChildren())V(l)&&Eu(Jr(mt,l.getKey()),l)}else{const s=r.getTextContent();if(Ce(r)){const a=r.decorate(mt,Gr);a!==null&&i_(e,a)}it+=s,Dn+=s}if(!xa&&tt(r)&&r.__cachedText!==Dn){const s=r.getWritable();s.__cachedText=Dn,r=s}return i}function i_(e,t){let n=mt._pendingDecorators;const r=mt._decorators;if(n===null){if(r[e]===t)return;n=q_(mt)}n[e]=t}function ec(e){let t=e.nextSibling;return t!==null&&t===mt._blockCursorElement&&(t=t.nextSibling),t}function _k(e,t,n,r,o,i){it="",Dn="",wo=r===2,mt=n,Gr=n._config,Yi=n._nodes,Ja=mt._listeners.mutation,bu=o,Cu=i,qr=e._nodeMap,on=t._nodeMap,xa=t._readOnly,wu=new Map(n._keyToDOMMap);const s=new Map;return Xi=s,ki("root",null),mt=void 0,Yi=void 0,bu=void 0,Cu=void 0,qr=void 0,on=void 0,Gr=void 0,wu=void 0,Xi=void 0,s}function Ru(e){const t=wu.get(e);return t===void 0&&U(75,e),t}function ie(e){return{type:e}}const zn=ie("SELECTION_CHANGE_COMMAND"),rf=ie("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),Za=ie("CLICK_COMMAND"),s_=ie("BEFORE_INPUT_COMMAND"),a_=ie("INPUT_COMMAND"),l_=ie("COMPOSITION_START_COMMAND"),c_=ie("COMPOSITION_END_COMMAND"),cr=ie("DELETE_CHARACTER_COMMAND"),Io=ie("INSERT_LINE_BREAK_COMMAND"),Yr=ie("INSERT_PARAGRAPH_COMMAND"),Wr=ie("CONTROLLED_TEXT_INSERTION_COMMAND"),of=ie("PASTE_COMMAND"),ku=ie("REMOVE_TEXT_COMMAND"),Yo=ie("DELETE_WORD_COMMAND"),Xr=ie("DELETE_LINE_COMMAND"),Rt=ie("FORMAT_TEXT_COMMAND"),u_=ie("UNDO_COMMAND"),d_=ie("REDO_COMMAND"),f_=ie("KEYDOWN_COMMAND"),sf=ie("KEY_ARROW_RIGHT_COMMAND"),xk=ie("MOVE_TO_END"),af=ie("KEY_ARROW_LEFT_COMMAND"),bk=ie("MOVE_TO_START"),lf=ie("KEY_ARROW_UP_COMMAND"),cf=ie("KEY_ARROW_DOWN_COMMAND"),Sa=ie("KEY_ENTER_COMMAND"),h_=ie("KEY_SPACE_COMMAND"),Qa=ie("KEY_BACKSPACE_COMMAND"),uf=ie("KEY_ESCAPE_COMMAND"),df=ie("KEY_DELETE_COMMAND"),ff=ie("KEY_TAB_COMMAND"),Ck=ie("INSERT_TAB_COMMAND"),wk=ie("INDENT_CONTENT_COMMAND"),up=ie("OUTDENT_CONTENT_COMMAND"),g_=ie("DROP_COMMAND"),$o=ie("FORMAT_ELEMENT_COMMAND"),p_=ie("DRAGSTART_COMMAND"),m_=ie("DRAGOVER_COMMAND"),Sk=ie("DRAGEND_COMMAND"),el=ie("COPY_COMMAND"),tl=ie("CUT_COMMAND"),Au=ie("SELECT_ALL_COMMAND"),y_=ie("FOCUS_COMMAND"),Ek=ie("BLUR_COMMAND"),Tk=ie("KEY_MODIFIER_COMMAND"),Fn=Object.freeze({}),Mu=[["keydown",function(e,t){Ji=e.timeStamp,v_=e.key,!t.isComposing()&&Z(t,f_,e)}],["pointerdown",function(e,t){const n=e.target,r=e.pointerType;tn(n)&&r!=="touch"&&r!=="pen"&&e.button===0&&Sn(t,()=>{z_(n)||(Fu=!0)})}],["compositionstart",function(e,t){Z(t,l_,e)}],["compositionend",function(e,t){Ur?Ai=!0:oi||!as&&!ls?Z(t,c_,e):(Lu=!0,Ou=e.data)}],["input",function(e,t){e.stopPropagation(),Sn(t,()=>{t.dispatchCommand(a_,e)},{event:e}),So=null}],["click",function(e,t){Sn(t,()=>{const n=G(),r=St(qt(t)),o=An();if(r){if(W(n)){const i=n.anchor,s=i.getNode();if(i.type==="element"&&i.offset===0&&n.isCollapsed()&&!tt(s)&&Ke().getChildrenSize()===1&&s.getTopLevelElementOrThrow().isEmpty()&&o!==null&&n.is(o))r.removeAllRanges(),n.dirty=!0;else if(e.detail===3&&!n.isCollapsed()&&s!==n.focus.getNode()){const a=xe(s,l=>V(l)&&!l.isInline());V(a)&&a.select(0)}}else if(e.pointerType==="touch"||e.pointerType==="pen"){const i=r.anchorNode;(je(i)||Zn(i))&&He(il(o,r,t,e))}}Z(t,Za,e)})}],["cut",Fn],["copy",Fn],["dragstart",Fn],["dragover",Fn],["dragend",Fn],["paste",Fn],["focus",Fn],["blur",Fn],["drop",Fn]];_a&&Mu.push(["beforeinput",(e,t)=>(function(n,r){const o=n.inputType;o==="deleteCompositionText"||Ur&&Q_(r)||o!=="insertCompositionText"&&Z(r,s_,n)})(e,t)]);let Ji=0,v_=null,__=0,So=null;const Nu=new WeakMap,Ea=new WeakMap;let Pu=!1,Fu=!1,Ii=!1,Ai=!1,Lu=!1,Ou="",Or=null,x_=[0,"",0,"root",0];function b_(e,t,n,r,o){const i=e.anchor,s=e.focus,a=i.getNode(),l=Fe(),c=St(qt(l)),u=c!==null?c.anchorNode:null,f=i.key,d=l.getElementByKey(f),h=n.length;return f!==s.key||!Y(a)||(!o&&(!_a||__<r+50)||a.isDirty()&&h<2||X_(n))&&i.offset!==s.offset&&!a.isComposing()||In(a)||a.isDirty()&&h>1||(o||!_a)&&d!==null&&!a.isComposing()&&u!==Jo(d)||c!==null&&t!==null&&(!t.collapsed||t.startContainer!==c.anchorNode||t.startOffset!==c.anchorOffset)||a.getFormat()!==e.format||a.getStyle()!==e.style||(function(g,p){if(p.isSegmented())return!0;if(!g.isCollapsed())return!1;const m=g.anchor.offset,_=p.getParentOrThrow(),y=Hr(p);return m===0?!p.canInsertTextBefore()||!_.canInsertTextBefore()&&!p.isComposing()||y||(function(v){const x=v.getPreviousSibling();return(Y(x)||V(x)&&x.isInline())&&!x.canInsertTextAfter()})(p):m===p.getTextContentSize()&&(!p.canInsertTextAfter()||!_.canInsertTextAfter()&&!p.isComposing()||y)})(e,a)}function dp(e,t){return Zn(e)&&e.nodeValue!==null&&t!==0&&t!==e.nodeValue.length}function fp(e,t,n){const{anchorNode:r,anchorOffset:o,focusNode:i,focusOffset:s}=e;Pu&&(Pu=!1,dp(r,o)&&dp(i,s)&&!Or)||Sn(t,()=>{if(!n)return void He(null);if(!ds(t,r,i))return;let a=G();if(Or&&W(a)&&a.isCollapsed()){const l=a.anchor,c=Or.anchor;(l.key===c.key&&l.offset===c.offset+1||l.offset===1&&c.getNode().is(l.getNode().getPreviousSibling()))&&(a=Or.clone(),He(a))}if(Or=null,W(a)){const l=a.anchor,c=l.getNode();if(a.isCollapsed()){e.type==="Range"&&e.anchorNode===e.focusNode&&(a.dirty=!0);const u=qt(t).event,f=u?u.timeStamp:performance.now(),[d,h,g,p,m]=x_,_=Ke(),y=t.isComposing()===!1&&_.getTextContent()==="";if(f<m+200&&l.offset===g&&l.key===p)na(a,d,h);else if(l.type==="text")Y(c)||U(141),C_(a,c);else if(l.type==="element"&&!y){V(c)||U(259);const v=l.getNode();v.isEmpty()?(function(x,b){const w=b.getTextFormat(),T=b.getTextStyle();na(x,w,T)})(a,v):na(a,0,"")}}else{const u=l.key,f=a.focus.key,d=a.getNodes(),h=d.length,g=a.isBackward(),p=g?s:o,m=g?o:s,_=g?f:u,y=g?u:f;let v=2047,x=!1;for(let b=0;b<h;b++){const w=d[b],T=w.getTextContentSize();if(Y(w)&&T!==0&&!(b===0&&w.__key===_&&p===T||b===h-1&&w.__key===y&&m===0)&&(x=!0,v&=w.getFormat(),v===0))break}a.format=x?v:0}}Z(t,zn,void 0)})}function na(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}function C_(e,t){na(e,t.getFormat(),t.getStyle())}function w_(e){if(!e.getTargetRanges)return null;const t=e.getTargetRanges();return t.length===0?null:t[0]}function Rk(e){const t=e.inputType,n=w_(e),r=Fe(),o=G();if(t==="deleteContentBackward"){if(o===null){const f=An();if(!W(f))return!0;He(f.clone())}if(W(o)){const f=o.anchor.key===o.focus.key;if(i=e.timeStamp,v_==="MediaLast"&&i<Ji+30&&r.isComposing()&&f){if(ut(null),Ji=0,setTimeout(()=>{Sn(r,()=>{ut(null)})},30),W(o)){const d=o.anchor.getNode();d.markDirty(),Y(d)||U(142),C_(o,d)}}else{ut(null),e.preventDefault();const d=o.anchor.getNode(),h=d.getTextContent(),g=d.canInsertTextAfter(),p=o.anchor.offset===0&&o.focus.offset===h.length;let m=Zg&&f&&!p&&g;if(m&&o.isCollapsed()&&(m=!Ce(ju(o.anchor,!0))),!m){Z(r,cr,!0);const _=G();Zg&&W(_)&&_.isCollapsed()&&(Or=_,setTimeout(()=>Or=null))}}return!0}}var i;if(!W(o))return!0;const s=e.data;So!==null&&Sf(!1,r,So),o.dirty&&So===null||!o.isCollapsed()||tt(o.anchor.getNode())||n===null||o.applyDOMRange(n),So=null;const a=o.anchor,l=o.focus,c=a.getNode(),u=l.getNode();if(t==="insertText"||t==="insertTranspose"){if(s===`
|
|
11
|
+
`,rk=Ur?" ":Xa,gr={bold:1,capitalize:1024,code:16,highlight:G0,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},ok={directionless:1,unmergeable:2},Qg={center:2,end:6,justify:4,left:1,right:3,start:5},ik={[ZR]:"center",[nk]:"end",[ek]:"justify",[JR]:"left",[QR]:"right",[tk]:"start"},sk={normal:0,segmented:2,token:1},ak={[qR]:"normal",[XR]:"segmented",[YR]:"token"},ep="$config";function q0(e,t,n,r,o,i){let s=e.getFirstChild();for(;s!==null;){const a=s.__key;s.__parent===t&&(V(s)&&q0(s,a,n,r,o,i),n.has(a)||i.delete(a),o.push(a)),s=s.getNextSibling()}}let xu=!1,nf=0;function lk(e){nf=e.timeStamp}function Zl(e,t,n){const r=e.nodeName==="BR",o=t.__lexicalLineBreak;return o&&(e===o||r&&e.previousSibling===o)||r&&ll(e,n)!==void 0}function ck(e,t,n){const r=St(qt(n));let o=null,i=null;r!==null&&r.anchorNode===e&&(o=r.anchorOffset,i=r.focusOffset);const s=e.nodeValue;s!==null&&Ef(t,s,o,i,!1)}function uk(e,t,n){if(W(e)){const r=e.anchor.getNode();if(r.is(n)&&e.format!==r.getFormat())return!1}return Zn(t)&&n.isAttached()}function dk(e,t,n,r){for(let o=e;o&&!p3(o);o=fs(o)){const i=ll(o,t);if(i!==void 0){const s=Me(i,n);if(s)return Ce(s)||!je(o)?void 0:[o,s]}else if(o===r)return[r,Y_(n)]}}function Y0(e,t,n){xu=!0;const r=performance.now()-nf>100;try{Sn(e,()=>{const o=G()||(function(d){return d.getEditorState().read(()=>{const h=G();return h!==null?h.clone():null})})(e),i=new Map,s=e.getRootElement(),a=e._editorState,l=e._blockCursorElement;let c=!1,u="";for(let d=0;d<t.length;d++){const h=t[d],g=h.type,p=h.target,m=dk(p,e,a,s);if(!m)continue;const[_,y]=m;if(g==="characterData")r&&Y(y)&&Zn(p)&&uk(o,p,y)&&ck(p,y,e);else if(g==="childList"){c=!0;const v=h.addedNodes;for(let w=0;w<v.length;w++){const T=v[w],E=G_(T),R=T.parentNode;if(R!=null&&T!==l&&E===null&&!Zl(T,R,e)){if(Ur){const M=(je(T)?T.innerText:null)||T.nodeValue;M&&(u+=M)}R.removeChild(T)}}const x=h.removedNodes,b=x.length;if(b>0){let w=0;for(let T=0;T<b;T++){const E=x[T];(Zl(E,p,e)||l===E)&&(p.appendChild(E),w++)}b!==w&&i.set(_,y)}}}if(i.size>0)for(const[d,h]of i)h.reconcileObservedMutation(d,e);const f=n.takeRecords();if(f.length>0){for(let d=0;d<f.length;d++){const h=f[d],g=h.addedNodes,p=h.target;for(let m=0;m<g.length;m++){const _=g[m],y=_.parentNode;y==null||_.nodeName!=="BR"||Zl(_,p,e)||y.removeChild(_)}}n.takeRecords()}o!==null&&(c&&He(o),Ur&&Q_(e)&&o.insertRawText(u))})}finally{xu=!1}}function X0(e){const t=e._observer;t!==null&&Y0(e,t.takeRecords(),t)}function J0(e){(function(t){nf===0&&qt(t).addEventListener("textInput",lk,!0)})(e),e._observer=new MutationObserver((t,n)=>{Y0(e,t,n)})}let fk=class{key;parse;unparse;isEqual;defaultValue;constructor(t,n){this.key=t,this.parse=n.parse.bind(n),this.unparse=(n.unparse||mk).bind(n),this.isEqual=(n.isEqual||Object.is).bind(n),this.defaultValue=this.parse(void 0)}};function hk(e,t){return new fk(e,t)}function Z0(e,t,n="latest"){const r=(n==="latest"?e.getLatest():e).__state;return r?r.getValue(t):t.defaultValue}function Ql(e,t,n){let r;if(st(),typeof n=="function"){const i=e.getLatest(),s=Z0(i,t);if(r=n(s),t.isEqual(s,r))return i}else r=n;const o=e.getWritable();return e_(o).updateFromKnown(t,r),o}function gk(e){const t=new Map,n=new Set;for(let r=typeof e=="function"?e:e.replace;r.prototype&&r.prototype.getType!==void 0;r=Object.getPrototypeOf(r)){const{ownNodeConfig:o}=ul(r);if(o&&o.stateConfigs)for(const i of o.stateConfigs){let s;"stateConfig"in i?(s=i.stateConfig,i.flat&&n.add(s.key)):s=i,t.set(s.key,s)}}return{flatKeys:n,sharedConfigMap:t}}let pk=class Q0{node;knownState;unknownState;sharedNodeState;size;constructor(t,n,r=void 0,o=new Map,i=void 0){this.node=t,this.sharedNodeState=n,this.unknownState=r,this.knownState=o;const{sharedConfigMap:s}=this.sharedNodeState,a=i!==void 0?i:(function(l,c,u){let f=u.size;if(c)for(const d in c){const h=l.get(d);h&&u.has(h)||f++}return f})(s,r,o);this.size=a}getValue(t){const n=this.knownState.get(t);if(n!==void 0)return n;this.sharedNodeState.sharedConfigMap.set(t.key,t);let r=t.defaultValue;if(this.unknownState&&t.key in this.unknownState){const o=this.unknownState[t.key];o!==void 0&&(r=t.parse(o)),this.updateFromKnown(t,r)}return r}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){const t={...this.unknownState},n={};for(const[r,o]of this.knownState)r.isEqual(o,r.defaultValue)?delete t[r.key]:t[r.key]=r.unparse(o);for(const r of this.sharedNodeState.flatKeys)r in t&&(n[r]=t[r],delete t[r]);return tp(t)&&(n.$=t),n}getWritable(t){if(this.node===t)return this;const{sharedNodeState:n,unknownState:r}=this,o=new Map(this.knownState);return new Q0(t,n,(function(i,s,a){let l;if(a)for(const[c,u]of Object.entries(a)){const f=i.get(c);f?s.has(f)||s.set(f,f.parse(u)):(l=l||{},l[c]=u)}return l})(n.sharedConfigMap,o,r),o,this.size)}updateFromKnown(t,n){const r=t.key;this.sharedNodeState.sharedConfigMap.set(r,t);const{knownState:o,unknownState:i}=this;o.has(t)||i&&r in i||(i&&(delete i[r],this.unknownState=tp(i)),this.size++),o.set(t,n)}updateFromUnknown(t,n){const r=this.sharedNodeState.sharedConfigMap.get(t);r?this.updateFromKnown(r,r.parse(n)):(this.unknownState=this.unknownState||{},t in this.unknownState||this.size++,this.unknownState[t]=n)}updateFromJSON(t){const{knownState:n}=this;for(const r of n.keys())n.set(r,r.defaultValue);if(this.size=n.size,this.unknownState=void 0,t)for(const[r,o]of Object.entries(t))this.updateFromUnknown(r,o)}};function e_(e){const t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new pk(t,t_(t));return t.__state=n,n}function t_(e){return e.__state?e.__state.sharedNodeState:B_(ui(),e.getType()).sharedNodeState}function tp(e){if(e)for(const t in e)return e}function mk(e){return e}function np(e,t,n){for(const[r,o]of t.knownState){if(e.has(r.key))continue;e.add(r.key);const i=n?n.getValue(r):r.defaultValue;if(i!==o&&!r.isEqual(i,o))return!0}return!1}function rp(e,t,n){const{unknownState:r}=t,o=n?n.unknownState:void 0;if(r){for(const[i,s]of Object.entries(r))if(!e.has(i)&&(e.add(i),s!==(o?o[i]:void 0)))return!0}return!1}function op(e,t){const n=e.__state;return n&&n.node===e?n.getWritable(t):n}function ip(e,t){const n=e.__mode,r=e.__format,o=e.__style,i=t.__mode,s=t.__format,a=t.__style,l=e.__state,c=t.__state;return(n===null||n===i)&&(r===null||r===s)&&(o===null||o===a)&&(e.__state===null||l===c||(function(u,f){if(u===f)return!0;if(u&&f&&u.size!==f.size)return!1;const d=new Set;return!(u&&np(d,u,f)||f&&np(d,f,u)||u&&rp(d,u,f)||f&&rp(d,f,u))})(l,c))}function sp(e,t){const n=e.mergeWithSibling(t),r=Fe()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function ap(e){let t,n,r=e;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(t=r.getPreviousSibling())!==null&&Y(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(ip(t,r)){r=sp(t,r);break}break}t.remove()}for(;(n=r.getNextSibling())!==null&&Y(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(n.__text!==""){if(ip(r,n)){r=sp(r,n);break}break}n.remove()}}else r.remove()}function qi(e){return lp(e.anchor),lp(e.focus),e}function lp(e){for(;e.type==="element";){const t=e.getNode(),n=e.offset;let r,o;if(n===t.getChildrenSize()?(r=t.getChildAtIndex(n-1),o=!0):(r=t.getChildAtIndex(n),o=!1),Y(r)){e.set(r.__key,o?r.getTextContentSize():0,"text",!0);break}if(!V(r))break;e.set(r.__key,o?r.getChildrenSize():0,"element",!0)}}let Gr,mt,Yi,Ja,bu,Cu,qr,rn,wu,Xi,it="",mn=null,Pr=null,Dn="",wo=!1,xa=!1;function ba(e,t){const n=qr.get(e);if(t!==null){const r=Ru(e);r.parentNode===t&&t.removeChild(r)}if(rn.has(e)||mt._keyToDOMMap.delete(e),V(n)){const r=wa(n,qr);Su(r,0,r.length-1,null)}n!==void 0&&Tf(Xi,Yi,Ja,n,"destroyed")}function Su(e,t,n,r){let o=t;for(;o<=n;++o){const i=e[o];i!==void 0&&ba(i,r)}}function Mr(e,t){e.setProperty("text-align",t)}const yk="40px";function n_(e,t){const n=Gr.theme.indent;if(typeof n=="string"){const o=e.classList.contains(n);t>0&&!o?e.classList.add(n):t<1&&o&&e.classList.remove(n)}const r=getComputedStyle(e).getPropertyValue("--lexical-indent-base-value")||yk;e.style.setProperty("padding-inline-start",t===0?"":`calc(${t} * ${r})`)}function r_(e,t){const n=e.style;t===0?Mr(n,""):t===1?Mr(n,"left"):t===2?Mr(n,"center"):t===3?Mr(n,"right"):t===4?Mr(n,"justify"):t===5?Mr(n,"start"):t===6&&Mr(n,"end")}function Eu(e,t){const n=(function(r){const o=r.__dir;if(o!==null)return o;if(tt(r))return null;const i=r.getParentOrThrow();return tt(i)&&i.__dir===null?"auto":null})(t);n!==null?e.dir=n:e.removeAttribute("dir")}function Ca(e,t){const n=rn.get(e);n===void 0&&U(60);const r=n.createDOM(Gr,mt);if((function(o,i,s){const a=s._keyToDOMMap;(function(l,c,u){const f=`__lexicalKey_${c._key}`;l[f]=u})(i,s,o),a.set(o,i)})(e,r,mt),Y(n)?r.setAttribute("data-lexical-text","true"):Ce(n)&&r.setAttribute("data-lexical-decorator","true"),V(n)){const o=n.__indent,i=n.__size;if(Eu(r,n),o!==0&&n_(r,o),i!==0){const a=i-1;Tu(wa(n,rn),n,0,a,n.getDOMSlot(r))}const s=n.__format;s!==0&&r_(r,s),n.isInline()||o_(null,n,r),cl(n)&&(it+=hr,Dn+=hr)}else{const o=n.getTextContent();if(Ce(n)){const i=n.decorate(mt,Gr);i!==null&&i_(e,i),r.contentEditable="false"}it+=o,Dn+=o}return t!==null&&t.insertChild(r),Tf(Xi,Yi,Ja,n,"created"),r}function Tu(e,t,n,r,o){const i=it;it="";let s=n;for(;s<=r;++s){Ca(e[s],o);const a=rn.get(e[s]);a!==null&&Y(a)&&mn===null&&(mn=a.getFormat(),Pr=a.getStyle())}cl(t)&&(it+=hr),o.element.__lexicalTextContent=it,it=i+it}function cp(e,t){if(e){const n=e.__last;if(n){const r=t.get(n);if(r)return wn(r)?"line-break":Ce(r)&&r.isInline()?"decorator":null}return"empty"}return null}function o_(e,t,n){const r=cp(e,qr),o=cp(t,rn);r!==o&&t.getDOMSlot(n).setManagedLineBreak(o)}function vk(e,t,n){var r;mn=null,Pr=null,(function(o,i,s){const a=it,l=o.__size,c=i.__size;it="";const u=s.element;if(l===1&&c===1){const f=o.__first,d=i.__first;if(f===d)ki(f,u);else{const g=Ru(f),p=Ca(d,null);try{u.replaceChild(p,g)}catch(m){if(typeof m=="object"&&m!=null){const _=`${m.toString()} Parent: ${u.tagName}, new child: {tag: ${p.tagName} key: ${d}}, old child: {tag: ${g.tagName}, key: ${f}}.`;throw new Error(_)}throw m}ba(f,null)}const h=rn.get(d);Y(h)&&mn===null&&(mn=h.getFormat(),Pr=h.getStyle())}else{const f=wa(o,qr),d=wa(i,rn);if(f.length!==l&&U(227),d.length!==c&&U(228),l===0)c!==0&&Tu(d,i,0,c-1,s);else if(c===0){if(l!==0){const h=s.after==null&&s.before==null&&s.element.__lexicalLineBreak==null;Su(f,0,l-1,h?null:u),h&&(u.textContent="")}}else(function(h,g,p,m,_,y){const v=m-1,x=_-1;let b,w,T=y.getFirstChild(),E=0,R=0;for(;E<=v&&R<=x;){const D=g[E],I=p[R];if(D===I)T=ec(ki(I,y.element)),E++,R++;else{b===void 0&&(b=new Set(g)),w===void 0&&(w=new Set(p));const B=w.has(D),K=b.has(I);if(B)if(K){const P=Jr(mt,I);P===T?T=ec(ki(I,y.element)):(y.withBefore(T).insertChild(P),ki(I,y.element)),E++,R++}else Ca(I,y.withBefore(T)),R++;else T=ec(Ru(D)),ba(D,y.element),E++}const L=rn.get(I);L!==null&&Y(L)&&mn===null&&(mn=L.getFormat(),Pr=L.getStyle())}const M=E>v,O=R>x;if(M&&!O){const D=p[x+1],I=D===void 0?null:mt.getElementByKey(D);Tu(p,h,R,x,y.withBefore(I))}else O&&!M&&Su(g,E,v,y.element)})(i,f,d,l,c,s)}cl(i)&&(it+=hr),u.__lexicalTextContent=it,it=a+it})(e,t,t.getDOMSlot(n)),r=t,mn==null||mn===r.__textFormat||xa||r.setTextFormat(mn),(function(o){Pr==null||Pr===o.__textStyle||xa||o.setTextStyle(Pr)})(t)}function wa(e,t){const n=[];let r=e.__first;for(;r!==null;){const o=t.get(r);o===void 0&&U(101),n.push(r),r=o.__next}return n}function ki(e,t){const n=qr.get(e);let r=rn.get(e);n!==void 0&&r!==void 0||U(61);const o=wo||Cu.has(e)||bu.has(e),i=Jr(mt,e);if(n===r&&!o){if(V(n)){const s=i.__lexicalTextContent;s!==void 0&&(it+=s,Dn+=s)}else{const s=n.getTextContent();Dn+=s,it+=s}return i}if(n!==r&&o&&Tf(Xi,Yi,Ja,r,"updated"),r.updateDOM(n,i,Gr)){const s=Ca(e,null);return t===null&&U(62),t.replaceChild(s,i),ba(e,null),s}if(V(n)&&V(r)){const s=r.__indent;(wo||s!==n.__indent)&&n_(i,s);const a=r.__format;if((wo||a!==n.__format)&&r_(i,a),o&&(vk(n,r,i),tt(r)||r.isInline()||o_(n,r,i)),cl(r)&&(it+=hr,Dn+=hr),(wo||r.__dir!==n.__dir)&&(Eu(i,r),tt(r)&&!wo))for(const l of r.getChildren())V(l)&&Eu(Jr(mt,l.getKey()),l)}else{const s=r.getTextContent();if(Ce(r)){const a=r.decorate(mt,Gr);a!==null&&i_(e,a)}it+=s,Dn+=s}if(!xa&&tt(r)&&r.__cachedText!==Dn){const s=r.getWritable();s.__cachedText=Dn,r=s}return i}function i_(e,t){let n=mt._pendingDecorators;const r=mt._decorators;if(n===null){if(r[e]===t)return;n=q_(mt)}n[e]=t}function ec(e){let t=e.nextSibling;return t!==null&&t===mt._blockCursorElement&&(t=t.nextSibling),t}function _k(e,t,n,r,o,i){it="",Dn="",wo=r===2,mt=n,Gr=n._config,Yi=n._nodes,Ja=mt._listeners.mutation,bu=o,Cu=i,qr=e._nodeMap,rn=t._nodeMap,xa=t._readOnly,wu=new Map(n._keyToDOMMap);const s=new Map;return Xi=s,ki("root",null),mt=void 0,Yi=void 0,bu=void 0,Cu=void 0,qr=void 0,rn=void 0,Gr=void 0,wu=void 0,Xi=void 0,s}function Ru(e){const t=wu.get(e);return t===void 0&&U(75,e),t}function ie(e){return{type:e}}const zn=ie("SELECTION_CHANGE_COMMAND"),rf=ie("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),Za=ie("CLICK_COMMAND"),s_=ie("BEFORE_INPUT_COMMAND"),a_=ie("INPUT_COMMAND"),l_=ie("COMPOSITION_START_COMMAND"),c_=ie("COMPOSITION_END_COMMAND"),cr=ie("DELETE_CHARACTER_COMMAND"),Io=ie("INSERT_LINE_BREAK_COMMAND"),Yr=ie("INSERT_PARAGRAPH_COMMAND"),Wr=ie("CONTROLLED_TEXT_INSERTION_COMMAND"),of=ie("PASTE_COMMAND"),ku=ie("REMOVE_TEXT_COMMAND"),Yo=ie("DELETE_WORD_COMMAND"),Xr=ie("DELETE_LINE_COMMAND"),Rt=ie("FORMAT_TEXT_COMMAND"),u_=ie("UNDO_COMMAND"),d_=ie("REDO_COMMAND"),f_=ie("KEYDOWN_COMMAND"),sf=ie("KEY_ARROW_RIGHT_COMMAND"),xk=ie("MOVE_TO_END"),af=ie("KEY_ARROW_LEFT_COMMAND"),bk=ie("MOVE_TO_START"),lf=ie("KEY_ARROW_UP_COMMAND"),cf=ie("KEY_ARROW_DOWN_COMMAND"),Sa=ie("KEY_ENTER_COMMAND"),h_=ie("KEY_SPACE_COMMAND"),Qa=ie("KEY_BACKSPACE_COMMAND"),uf=ie("KEY_ESCAPE_COMMAND"),df=ie("KEY_DELETE_COMMAND"),ff=ie("KEY_TAB_COMMAND"),Ck=ie("INSERT_TAB_COMMAND"),wk=ie("INDENT_CONTENT_COMMAND"),up=ie("OUTDENT_CONTENT_COMMAND"),g_=ie("DROP_COMMAND"),$o=ie("FORMAT_ELEMENT_COMMAND"),p_=ie("DRAGSTART_COMMAND"),m_=ie("DRAGOVER_COMMAND"),Sk=ie("DRAGEND_COMMAND"),el=ie("COPY_COMMAND"),tl=ie("CUT_COMMAND"),Au=ie("SELECT_ALL_COMMAND"),y_=ie("FOCUS_COMMAND"),Ek=ie("BLUR_COMMAND"),Tk=ie("KEY_MODIFIER_COMMAND"),Fn=Object.freeze({}),Mu=[["keydown",function(e,t){Ji=e.timeStamp,v_=e.key,!t.isComposing()&&Z(t,f_,e)}],["pointerdown",function(e,t){const n=e.target,r=e.pointerType;en(n)&&r!=="touch"&&r!=="pen"&&e.button===0&&Sn(t,()=>{z_(n)||(Fu=!0)})}],["compositionstart",function(e,t){Z(t,l_,e)}],["compositionend",function(e,t){Ur?Ai=!0:oi||!as&&!ls?Z(t,c_,e):(Lu=!0,Ou=e.data)}],["input",function(e,t){e.stopPropagation(),Sn(t,()=>{t.dispatchCommand(a_,e)},{event:e}),So=null}],["click",function(e,t){Sn(t,()=>{const n=G(),r=St(qt(t)),o=An();if(r){if(W(n)){const i=n.anchor,s=i.getNode();if(i.type==="element"&&i.offset===0&&n.isCollapsed()&&!tt(s)&&Ke().getChildrenSize()===1&&s.getTopLevelElementOrThrow().isEmpty()&&o!==null&&n.is(o))r.removeAllRanges(),n.dirty=!0;else if(e.detail===3&&!n.isCollapsed()&&s!==n.focus.getNode()){const a=xe(s,l=>V(l)&&!l.isInline());V(a)&&a.select(0)}}else if(e.pointerType==="touch"||e.pointerType==="pen"){const i=r.anchorNode;(je(i)||Zn(i))&&He(il(o,r,t,e))}}Z(t,Za,e)})}],["cut",Fn],["copy",Fn],["dragstart",Fn],["dragover",Fn],["dragend",Fn],["paste",Fn],["focus",Fn],["blur",Fn],["drop",Fn]];_a&&Mu.push(["beforeinput",(e,t)=>(function(n,r){const o=n.inputType;o==="deleteCompositionText"||Ur&&Q_(r)||o!=="insertCompositionText"&&Z(r,s_,n)})(e,t)]);let Ji=0,v_=null,__=0,So=null;const Nu=new WeakMap,Ea=new WeakMap;let Pu=!1,Fu=!1,Ii=!1,Ai=!1,Lu=!1,Ou="",Or=null,x_=[0,"",0,"root",0];function b_(e,t,n,r,o){const i=e.anchor,s=e.focus,a=i.getNode(),l=Fe(),c=St(qt(l)),u=c!==null?c.anchorNode:null,f=i.key,d=l.getElementByKey(f),h=n.length;return f!==s.key||!Y(a)||(!o&&(!_a||__<r+50)||a.isDirty()&&h<2||X_(n))&&i.offset!==s.offset&&!a.isComposing()||In(a)||a.isDirty()&&h>1||(o||!_a)&&d!==null&&!a.isComposing()&&u!==Jo(d)||c!==null&&t!==null&&(!t.collapsed||t.startContainer!==c.anchorNode||t.startOffset!==c.anchorOffset)||a.getFormat()!==e.format||a.getStyle()!==e.style||(function(g,p){if(p.isSegmented())return!0;if(!g.isCollapsed())return!1;const m=g.anchor.offset,_=p.getParentOrThrow(),y=Hr(p);return m===0?!p.canInsertTextBefore()||!_.canInsertTextBefore()&&!p.isComposing()||y||(function(v){const x=v.getPreviousSibling();return(Y(x)||V(x)&&x.isInline())&&!x.canInsertTextAfter()})(p):m===p.getTextContentSize()&&(!p.canInsertTextAfter()||!_.canInsertTextAfter()&&!p.isComposing()||y)})(e,a)}function dp(e,t){return Zn(e)&&e.nodeValue!==null&&t!==0&&t!==e.nodeValue.length}function fp(e,t,n){const{anchorNode:r,anchorOffset:o,focusNode:i,focusOffset:s}=e;Pu&&(Pu=!1,dp(r,o)&&dp(i,s)&&!Or)||Sn(t,()=>{if(!n)return void He(null);if(!ds(t,r,i))return;let a=G();if(Or&&W(a)&&a.isCollapsed()){const l=a.anchor,c=Or.anchor;(l.key===c.key&&l.offset===c.offset+1||l.offset===1&&c.getNode().is(l.getNode().getPreviousSibling()))&&(a=Or.clone(),He(a))}if(Or=null,W(a)){const l=a.anchor,c=l.getNode();if(a.isCollapsed()){e.type==="Range"&&e.anchorNode===e.focusNode&&(a.dirty=!0);const u=qt(t).event,f=u?u.timeStamp:performance.now(),[d,h,g,p,m]=x_,_=Ke(),y=t.isComposing()===!1&&_.getTextContent()==="";if(f<m+200&&l.offset===g&&l.key===p)na(a,d,h);else if(l.type==="text")Y(c)||U(141),C_(a,c);else if(l.type==="element"&&!y){V(c)||U(259);const v=l.getNode();v.isEmpty()?(function(x,b){const w=b.getTextFormat(),T=b.getTextStyle();na(x,w,T)})(a,v):na(a,0,"")}}else{const u=l.key,f=a.focus.key,d=a.getNodes(),h=d.length,g=a.isBackward(),p=g?s:o,m=g?o:s,_=g?f:u,y=g?u:f;let v=2047,x=!1;for(let b=0;b<h;b++){const w=d[b],T=w.getTextContentSize();if(Y(w)&&T!==0&&!(b===0&&w.__key===_&&p===T||b===h-1&&w.__key===y&&m===0)&&(x=!0,v&=w.getFormat(),v===0))break}a.format=x?v:0}}Z(t,zn,void 0)})}function na(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}function C_(e,t){na(e,t.getFormat(),t.getStyle())}function w_(e){if(!e.getTargetRanges)return null;const t=e.getTargetRanges();return t.length===0?null:t[0]}function Rk(e){const t=e.inputType,n=w_(e),r=Fe(),o=G();if(t==="deleteContentBackward"){if(o===null){const f=An();if(!W(f))return!0;He(f.clone())}if(W(o)){const f=o.anchor.key===o.focus.key;if(i=e.timeStamp,v_==="MediaLast"&&i<Ji+30&&r.isComposing()&&f){if(ut(null),Ji=0,setTimeout(()=>{Sn(r,()=>{ut(null)})},30),W(o)){const d=o.anchor.getNode();d.markDirty(),Y(d)||U(142),C_(o,d)}}else{ut(null),e.preventDefault();const d=o.anchor.getNode(),h=d.getTextContent(),g=d.canInsertTextAfter(),p=o.anchor.offset===0&&o.focus.offset===h.length;let m=Zg&&f&&!p&&g;if(m&&o.isCollapsed()&&(m=!Ce(ju(o.anchor,!0))),!m){Z(r,cr,!0);const _=G();Zg&&W(_)&&_.isCollapsed()&&(Or=_,setTimeout(()=>Or=null))}}return!0}}var i;if(!W(o))return!0;const s=e.data;So!==null&&Sf(!1,r,So),o.dirty&&So===null||!o.isCollapsed()||tt(o.anchor.getNode())||n===null||o.applyDOMRange(n),So=null;const a=o.anchor,l=o.focus,c=a.getNode(),u=l.getNode();if(t==="insertText"||t==="insertTranspose"){if(s===`
|
|
12
12
|
`)e.preventDefault(),Z(r,Io,!1);else if(s===hr)e.preventDefault(),Z(r,Yr,void 0);else if(s==null&&e.dataTransfer){const f=e.dataTransfer.getData("text/plain");e.preventDefault(),o.insertRawText(f)}else s!=null&&b_(o,n,s,e.timeStamp,!0)?(e.preventDefault(),Z(r,Wr,s)):So=s;return __=e.timeStamp,!0}switch(e.preventDefault(),t){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":Z(r,Wr,e);break;case"insertFromComposition":ut(null),Z(r,Wr,e);break;case"insertLineBreak":ut(null),Z(r,Io,!1);break;case"insertParagraph":ut(null),Ii&&!oi?(Ii=!1,Z(r,Io,!1)):Z(r,Yr,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":Z(r,of,e);break;case"deleteByComposition":(function(f,d){return f!==d||V(f)||V(d)||!Hr(f)||!Hr(d)})(c,u)&&Z(r,ku,e);break;case"deleteByDrag":case"deleteByCut":Z(r,ku,e);break;case"deleteContent":Z(r,cr,!1);break;case"deleteWordBackward":Z(r,Yo,!0);break;case"deleteWordForward":Z(r,Yo,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":Z(r,Xr,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":Z(r,Xr,!1);break;case"formatStrikeThrough":Z(r,Rt,"strikethrough");break;case"formatBold":Z(r,Rt,"bold");break;case"formatItalic":Z(r,Rt,"italic");break;case"formatUnderline":Z(r,Rt,"underline");break;case"historyUndo":Z(r,u_,void 0);break;case"historyRedo":Z(r,d_,void 0)}return!0}function kk(e){if(je(e.target)&&z_(e.target))return!0;const t=Fe(),n=G(),r=e.data,o=w_(e);if(r!=null&&W(n)&&b_(n,o,r,e.timeStamp,!1)){Ai&&(Ta(t,r),Ai=!1);const i=n.anchor.getNode(),s=St(qt(t));if(s===null)return!0;const a=n.isBackward(),l=a?n.anchor.offset:n.focus.offset,c=a?n.focus.offset:n.anchor.offset;_a&&!n.isCollapsed()&&Y(i)&&s.anchorNode!==null&&i.getTextContent().slice(0,l)+r+i.getTextContent().slice(l+c)===Z_(s.anchorNode)||Z(t,Wr,r);const u=r.length;Ur&&u>1&&e.inputType==="insertCompositionText"&&!t.isComposing()&&(n.anchor.offset-=u),as||oi||ls||!t.isComposing()||(Ji=0,ut(null))}else Sf(!1,t,r!==null?r:void 0),Ai&&(Ta(t,r||void 0),Ai=!1);return(function(){st();const i=Fe();X0(i)})(),!0}function Ak(e){const t=Fe(),n=G();if(W(n)&&!t.isComposing()){const r=n.anchor,o=n.anchor.getNode();ut(r.key),(e.timeStamp<Ji+30||r.type==="element"||!n.isCollapsed()||o.getFormat()!==n.format||Y(o)&&o.getStyle()!==n.style)&&Z(t,Wr,rk)}return!0}function Mk(e){return Ta(Fe(),e.data),!0}function Ta(e,t){const n=e._compositionKey;if(ut(null),n!==null&&t!=null){if(t===""){const r=Me(n),o=Jo(e.getElementByKey(n));return void(o!==null&&o.nodeValue!==null&&Y(r)&&Ef(r,o.nodeValue,null,null,!0))}if(t[t.length-1]===`
|
|
13
|
-
`){const r=G();if(W(r)){const o=r.focus;return r.anchor.set(o.key,o.offset,o.type),void Z(e,Sa,null)}}}Sf(!0,e,t)}function Nk(e){const t=Fe();if(e.key==null)return!0;if(Lu&&$p(e))return Sn(t,()=>{Ta(t,Ou)}),Lu=!1,Ou="",!0;if((function(n){return Ae(n,"ArrowRight",{shiftKey:"any"})})(e))Z(t,sf,e);else if((function(n){return Ae(n,"ArrowRight",On)})(e))Z(t,xk,e);else if((function(n){return Ae(n,"ArrowLeft",{shiftKey:"any"})})(e))Z(t,af,e);else if((function(n){return Ae(n,"ArrowLeft",On)})(e))Z(t,bk,e);else if((function(n){return Ae(n,"ArrowUp",{altKey:"any",shiftKey:"any"})})(e))Z(t,lf,e);else if((function(n){return Ae(n,"ArrowDown",{altKey:"any",shiftKey:"any"})})(e))Z(t,cf,e);else if((function(n){return Ae(n,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:!0})})(e))Ii=!0,Z(t,Sa,e);else if((function(n){return n.key===" "})(e))Z(t,h_,e);else if((function(n){return en&&Ae(n,"o",{ctrlKey:!0})})(e))e.preventDefault(),Ii=!0,Z(t,Io,!0);else if((function(n){return Ae(n,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any"})})(e))Ii=!1,Z(t,Sa,e);else if((function(n){return Ae(n,"Backspace",{shiftKey:"any"})||en&&Ae(n,"h",{ctrlKey:!0})})(e))$p(e)?Z(t,Qa,e):(e.preventDefault(),Z(t,cr,!0));else if((function(n){return n.key==="Escape"})(e))Z(t,uf,e);else if((function(n){return Ae(n,"Delete",{})||en&&Ae(n,"d",{ctrlKey:!0})})(e))(function(n){return n.key==="Delete"})(e)?Z(t,df,e):(e.preventDefault(),Z(t,cr,!1));else if((function(n){return Ae(n,"Backspace",Ip)})(e))e.preventDefault(),Z(t,Yo,!0);else if((function(n){return Ae(n,"Delete",Ip)})(e))e.preventDefault(),Z(t,Yo,!1);else if((function(n){return en&&Ae(n,"Backspace",{metaKey:!0})})(e))e.preventDefault(),Z(t,Xr,!0);else if((function(n){return en&&(Ae(n,"Delete",{metaKey:!0})||Ae(n,"k",{ctrlKey:!0}))})(e))e.preventDefault(),Z(t,Xr,!1);else if((function(n){return Ae(n,"b",On)})(e))e.preventDefault(),Z(t,Rt,"bold");else if((function(n){return Ae(n,"u",On)})(e))e.preventDefault(),Z(t,Rt,"underline");else if((function(n){return Ae(n,"i",On)})(e))e.preventDefault(),Z(t,Rt,"italic");else if((function(n){return Ae(n,"Tab",{shiftKey:"any"})})(e))Z(t,ff,e);else if((function(n){return Ae(n,"z",On)})(e))e.preventDefault(),Z(t,u_,void 0);else if((function(n){return en?Ae(n,"z",{metaKey:!0,shiftKey:!0}):Ae(n,"y",{ctrlKey:!0})||Ae(n,"z",{ctrlKey:!0,shiftKey:!0})})(e))e.preventDefault(),Z(t,d_,void 0);else{const n=t._editorState._selection;n===null||W(n)?Dp(e)&&(e.preventDefault(),Z(t,Au,e)):(function(r){return Ae(r,"c",On)})(e)?(e.preventDefault(),Z(t,el,e)):(function(r){return Ae(r,"x",On)})(e)?(e.preventDefault(),Z(t,tl,e)):Dp(e)&&(e.preventDefault(),Z(t,Au,e))}return(function(n){return n.ctrlKey||n.shiftKey||n.altKey||n.metaKey})(e)&&t.dispatchCommand(Tk,e),!0}function S_(e){let t=e.__lexicalEventHandles;return t===void 0&&(t=[],e.__lexicalEventHandles=t),t}const Do=new Map;function E_(e){const t=d3(e.target);if(t===null)return;const n=W_(t.anchorNode);if(n===null)return;Fu&&(Fu=!1,Sn(n,()=>{const l=An(),c=t.anchorNode;(je(c)||Zn(c))&&He(il(l,t,n,e))}));const r=wf(n),o=r[r.length-1],i=o._key,s=Do.get(i),a=s||o;a!==n&&fp(t,a,!1),fp(t,n,!0),n!==o?Do.set(i,n):s&&Do.delete(i)}function hp(e){e._lexicalHandled=!0}function gp(e){return e._lexicalHandled===!0}function Pk(e){const t=Nu.get(e);if(t===void 0)return;const n=Ea.get(t);if(n===void 0)return;const r=n-1;r>=0||U(164),Nu.delete(e),Ea.set(t,r),r===0&&t.removeEventListener("selectionchange",E_);const o=al(e);Cf(o)?((function(s){if(s._parentEditor!==null){const a=wf(s),l=a[a.length-1]._key;Do.get(l)===s&&Do.delete(l)}else Do.delete(s._key)})(o),e.__lexicalEditor=null):o&&U(198);const i=S_(e);for(let s=0;s<i.length;s++)i[s]();e.__lexicalEventHandles=[]}function Iu(e,t,n){st();const r=e.__key,o=e.getParent();if(o===null)return;const i=(function(a){const l=G();if(!W(l)||!V(a))return l;const{anchor:c,focus:u}=l,f=c.getNode(),d=u.getNode();return Bu(f,a)&&c.set(a.__key,0,"element"),Bu(d,a)&&u.set(a.__key,0,"element"),l})(e);let s=!1;if(W(i)&&t){const a=i.anchor,l=i.focus;a.key===r&&(Aa(a,e,o,e.getPreviousSibling(),e.getNextSibling()),s=!0),l.key===r&&(Aa(l,e,o,e.getPreviousSibling(),e.getNextSibling()),s=!0)}else gt(i)&&t&&e.isSelected()&&e.selectPrevious();if(W(i)&&t&&!s){const a=e.getIndexWithinParent();Kr(e),ka(i,o,a,-1)}else Kr(e);n||dt(o)||o.canBeEmpty()||!o.isEmpty()||Iu(o,t),t&&i&&tt(o)&&o.isEmpty()&&o.selectEnd()}const T_=Symbol.for("ephemeral");function Ra(e){return e[T_]||!1}class Cn{__type;__key;__parent;__prev;__next;__state;static getType(){const{ownNodeType:t}=ul(this);return t===void 0&&U(64,this.name),t}static clone(t){U(65,this.name)}$config(){return{}}config(t,n){const r=n.extends||Object.getPrototypeOf(this.constructor);return Object.assign(n,{extends:r,type:t}),{[t]:n}}afterCloneFrom(t){this.__key===t.__key?(this.__parent=t.__parent,this.__next=t.__next,this.__prev=t.__prev,this.__state=t.__state):t.__state&&(this.__state=t.__state.getWritable(this))}static importDOM;constructor(t){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",{configurable:!0,enumerable:!1,value:void 0,writable:!0}),U_(this,t)}getType(){return this.__type}isInline(){U(137,this.constructor.name)}isAttached(){let t=this.__key;for(;t!==null;){if(t==="root")return!0;const n=Me(t);if(n===null)break;t=n.__parent}return!1}isSelected(t){const n=t||G();if(n==null)return!1;const r=n.getNodes().some(o=>o.__key===this.__key);if(Y(this))return r;if(W(n)&&n.anchor.type==="element"&&n.focus.type==="element"){if(n.isCollapsed())return!1;const o=this.getParent();if(Ce(this)&&this.isInline()&&o){const i=n.isBackward()?n.focus:n.anchor;if(o.is(i.getNode())&&i.offset===o.getChildrenSize()&&this.is(o.getLastChild()))return!1}}return r}getKey(){return this.__key}getIndexWithinParent(){const t=this.getParent();if(t===null)return-1;let n=t.getFirstChild(),r=0;for(;n!==null;){if(this.is(n))return r;r++,n=n.getNextSibling()}return-1}getParent(){const t=this.getLatest().__parent;return t===null?null:Me(t)}getParentOrThrow(){const t=this.getParent();return t===null&&U(66,this.__key),t}getTopLevelElement(){let t=this;for(;t!==null;){const n=t.getParent();if(dt(n))return V(t)||t===this&&Ce(t)||U(194),t;t=n}return null}getTopLevelElementOrThrow(){const t=this.getTopLevelElement();return t===null&&U(67,this.__key),t}getParents(){const t=[];let n=this.getParent();for(;n!==null;)t.push(n),n=n.getParent();return t}getParentKeys(){const t=[];let n=this.getParent();for(;n!==null;)t.push(n.__key),n=n.getParent();return t}getPreviousSibling(){const t=this.getLatest().__prev;return t===null?null:Me(t)}getPreviousSiblings(){const t=[],n=this.getParent();if(n===null)return t;let r=n.getFirstChild();for(;r!==null&&!r.is(this);)t.push(r),r=r.getNextSibling();return t}getNextSibling(){const t=this.getLatest().__next;return t===null?null:Me(t)}getNextSiblings(){const t=[];let n=this.getNextSibling();for(;n!==null;)t.push(n),n=n.getNextSibling();return t}getCommonAncestor(t){const n=V(this)?this:this.getParent(),r=V(t)?t:t.getParent(),o=n&&r?oa(n,r):null;return o?o.commonAncestor:null}is(t){return t!=null&&this.__key===t.__key}isBefore(t){const n=oa(this,t);return n!==null&&(n.type==="descendant"||(n.type==="branch"?sx(n)===-1:(n.type!=="same"&&n.type!=="ancestor"&&U(279),!1)))}isParentOf(t){const n=oa(this,t);return n!==null&&n.type==="ancestor"}getNodesBetween(t){const n=this.isBefore(t),r=[],o=new Set;let i=this;for(;i!==null;){const s=i.__key;if(o.has(s)||(o.add(s),r.push(i)),i===t)break;const a=V(i)?n?i.getFirstChild():i.getLastChild():null;if(a!==null){i=a;continue}const l=n?i.getNextSibling():i.getPreviousSibling();if(l!==null){i=l;continue}const c=i.getParentOrThrow();if(o.has(c.__key)||r.push(c),c===t)break;let u=null,f=c;do{if(f===null&&U(68),u=n?f.getNextSibling():f.getPreviousSibling(),f=f.getParent(),f===null)break;u!==null||o.has(f.__key)||r.push(f)}while(u===null);i=u}return n||r.reverse(),r}isDirty(){const t=Fe()._dirtyLeaves;return t!==null&&t.has(this.__key)}getLatest(){if(Ra(this))return this;const t=Me(this.__key);return t===null&&U(113),t}getWritable(){if(Ra(this))return this;st();const t=wr(),n=Fe(),r=t._nodeMap,o=this.__key,i=this.getLatest(),s=n._cloneNotNeeded,a=G();if(a!==null&&a.setCachedNodes(null),s.has(o))return Na(i),i;const l=nx(i);return s.add(o),Na(l),r.set(o,l),l}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(t,n){U(70)}updateDOM(t,n,r){U(71)}exportDOM(t){return{element:this.createDOM(t._config,t)}}exportJSON(){const t=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...t}}static importJSON(t){U(18,this.name)}updateFromJSON(t){return(function(n,r){const o=n.getWritable(),i=r.$;let s=i;for(const a of t_(o).flatKeys)a in r&&(s!==void 0&&s!==i||(s={...i}),s[a]=r[a]);return(o.__state||s)&&e_(n).updateFromJSON(s),o})(this,t)}static transform(){return null}remove(t){Iu(this,!0,t)}replace(t,n){st();let r=G();r!==null&&(r=r.clone()),sc(this,t);const o=this.getLatest(),i=this.__key,s=t.__key,a=t.getWritable(),l=this.getParentOrThrow().getWritable(),c=l.__size;Kr(a);const u=o.getPreviousSibling(),f=o.getNextSibling(),d=o.__prev,h=o.__next,g=o.__parent;if(Iu(o,!1,!0),u===null?l.__first=s:u.getWritable().__next=s,a.__prev=d,f===null?l.__last=s:f.getWritable().__prev=s,a.__next=h,a.__parent=g,l.__size=c,n&&(V(this)&&V(a)||U(139),this.getChildren().forEach(p=>{a.append(p)})),W(r)){He(r);const p=r.anchor,m=r.focus;p.key===i&&vp(p,a),m.key===i&&vp(m,a)}return rr()===i&&ut(s),a}insertAfter(t,n=!0){st(),sc(this,t);const r=this.getWritable(),o=t.getWritable(),i=o.getParent(),s=G();let a=!1,l=!1;if(i!==null){const h=t.getIndexWithinParent();if(Kr(o),W(s)){const g=i.__key,p=s.anchor,m=s.focus;a=p.type==="element"&&p.key===g&&p.offset===h+1,l=m.type==="element"&&m.key===g&&m.offset===h+1}}const c=this.getNextSibling(),u=this.getParentOrThrow().getWritable(),f=o.__key,d=r.__next;if(c===null?u.__last=f:c.getWritable().__prev=f,u.__size++,r.__next=f,o.__next=d,o.__prev=r.__key,o.__parent=r.__parent,n&&W(s)){const h=this.getIndexWithinParent();ka(s,u,h+1);const g=u.__key;a&&s.anchor.set(g,h+2,"element"),l&&s.focus.set(g,h+2,"element")}return t}insertBefore(t,n=!0){st(),sc(this,t);const r=this.getWritable(),o=t.getWritable(),i=o.__key;Kr(o);const s=this.getPreviousSibling(),a=this.getParentOrThrow().getWritable(),l=r.__prev,c=this.getIndexWithinParent();s===null?a.__first=i:s.getWritable().__next=i,a.__size++,r.__prev=i,o.__prev=l,o.__next=r.__key,o.__parent=r.__parent;const u=G();return n&&W(u)&&ka(u,this.getParentOrThrow(),c),t}isParentRequired(){return!1}createParentElementNode(){return me()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(t,n){st();const r=this.getPreviousSibling(),o=this.getParentOrThrow();if(r===null)return o.select(0,0);if(V(r))return r.select();if(!Y(r)){const i=r.getIndexWithinParent()+1;return o.select(i,i)}return r.select(t,n)}selectNext(t,n){st();const r=this.getNextSibling(),o=this.getParentOrThrow();if(r===null)return o.select();if(V(r))return r.select(0,0);if(!Y(r)){const i=r.getIndexWithinParent();return o.select(i,i)}return r.select(t,n)}markDirty(){this.getWritable()}reconcileObservedMutation(t,n){this.markDirty()}}const Fk="historic",Vo="history-merge",Lk="paste",R_="collaboration",Ok="skip-scroll-into-view",Ik="skip-dom-selection",$k="skip-selection-focus";class ii extends Cn{static getType(){return"linebreak"}static clone(t){return new ii(t.__key)}constructor(t){super(t)}getTextContent(){return`
|
|
14
|
-
`}createDOM(){return document.createElement("br")}updateDOM(){return!1}isInline(){return!0}static importDOM(){return{br:t=>(function(n){const r=n.parentElement;if(r!==null&&Pa(r)){const o=r.firstChild;if(o===n||o.nextSibling===n&&Ps(o)){const i=r.lastChild;if(i===n||i.previousSibling===n&&Ps(i))return!0}}return!1})(t)||(function(n){const r=n.parentElement;if(r!==null&&Pa(r)){const o=r.firstChild;if(o===n||o.nextSibling===n&&Ps(o))return!1;const i=r.lastChild;if(i===n||i.previousSibling===n&&Ps(i))return!0}return!1})(t)?null:{conversion:Dk,priority:0}}}static importJSON(t){return
|
|
13
|
+
`){const r=G();if(W(r)){const o=r.focus;return r.anchor.set(o.key,o.offset,o.type),void Z(e,Sa,null)}}}Sf(!0,e,t)}function Nk(e){const t=Fe();if(e.key==null)return!0;if(Lu&&$p(e))return Sn(t,()=>{Ta(t,Ou)}),Lu=!1,Ou="",!0;if((function(n){return Ae(n,"ArrowRight",{shiftKey:"any"})})(e))Z(t,sf,e);else if((function(n){return Ae(n,"ArrowRight",On)})(e))Z(t,xk,e);else if((function(n){return Ae(n,"ArrowLeft",{shiftKey:"any"})})(e))Z(t,af,e);else if((function(n){return Ae(n,"ArrowLeft",On)})(e))Z(t,bk,e);else if((function(n){return Ae(n,"ArrowUp",{altKey:"any",shiftKey:"any"})})(e))Z(t,lf,e);else if((function(n){return Ae(n,"ArrowDown",{altKey:"any",shiftKey:"any"})})(e))Z(t,cf,e);else if((function(n){return Ae(n,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:!0})})(e))Ii=!0,Z(t,Sa,e);else if((function(n){return n.key===" "})(e))Z(t,h_,e);else if((function(n){return Qt&&Ae(n,"o",{ctrlKey:!0})})(e))e.preventDefault(),Ii=!0,Z(t,Io,!0);else if((function(n){return Ae(n,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any"})})(e))Ii=!1,Z(t,Sa,e);else if((function(n){return Ae(n,"Backspace",{shiftKey:"any"})||Qt&&Ae(n,"h",{ctrlKey:!0})})(e))$p(e)?Z(t,Qa,e):(e.preventDefault(),Z(t,cr,!0));else if((function(n){return n.key==="Escape"})(e))Z(t,uf,e);else if((function(n){return Ae(n,"Delete",{})||Qt&&Ae(n,"d",{ctrlKey:!0})})(e))(function(n){return n.key==="Delete"})(e)?Z(t,df,e):(e.preventDefault(),Z(t,cr,!1));else if((function(n){return Ae(n,"Backspace",Ip)})(e))e.preventDefault(),Z(t,Yo,!0);else if((function(n){return Ae(n,"Delete",Ip)})(e))e.preventDefault(),Z(t,Yo,!1);else if((function(n){return Qt&&Ae(n,"Backspace",{metaKey:!0})})(e))e.preventDefault(),Z(t,Xr,!0);else if((function(n){return Qt&&(Ae(n,"Delete",{metaKey:!0})||Ae(n,"k",{ctrlKey:!0}))})(e))e.preventDefault(),Z(t,Xr,!1);else if((function(n){return Ae(n,"b",On)})(e))e.preventDefault(),Z(t,Rt,"bold");else if((function(n){return Ae(n,"u",On)})(e))e.preventDefault(),Z(t,Rt,"underline");else if((function(n){return Ae(n,"i",On)})(e))e.preventDefault(),Z(t,Rt,"italic");else if((function(n){return Ae(n,"Tab",{shiftKey:"any"})})(e))Z(t,ff,e);else if((function(n){return Ae(n,"z",On)})(e))e.preventDefault(),Z(t,u_,void 0);else if((function(n){return Qt?Ae(n,"z",{metaKey:!0,shiftKey:!0}):Ae(n,"y",{ctrlKey:!0})||Ae(n,"z",{ctrlKey:!0,shiftKey:!0})})(e))e.preventDefault(),Z(t,d_,void 0);else{const n=t._editorState._selection;n===null||W(n)?Dp(e)&&(e.preventDefault(),Z(t,Au,e)):(function(r){return Ae(r,"c",On)})(e)?(e.preventDefault(),Z(t,el,e)):(function(r){return Ae(r,"x",On)})(e)?(e.preventDefault(),Z(t,tl,e)):Dp(e)&&(e.preventDefault(),Z(t,Au,e))}return(function(n){return n.ctrlKey||n.shiftKey||n.altKey||n.metaKey})(e)&&t.dispatchCommand(Tk,e),!0}function S_(e){let t=e.__lexicalEventHandles;return t===void 0&&(t=[],e.__lexicalEventHandles=t),t}const Do=new Map;function E_(e){const t=d3(e.target);if(t===null)return;const n=W_(t.anchorNode);if(n===null)return;Fu&&(Fu=!1,Sn(n,()=>{const l=An(),c=t.anchorNode;(je(c)||Zn(c))&&He(il(l,t,n,e))}));const r=wf(n),o=r[r.length-1],i=o._key,s=Do.get(i),a=s||o;a!==n&&fp(t,a,!1),fp(t,n,!0),n!==o?Do.set(i,n):s&&Do.delete(i)}function hp(e){e._lexicalHandled=!0}function gp(e){return e._lexicalHandled===!0}function Pk(e){const t=Nu.get(e);if(t===void 0)return;const n=Ea.get(t);if(n===void 0)return;const r=n-1;r>=0||U(164),Nu.delete(e),Ea.set(t,r),r===0&&t.removeEventListener("selectionchange",E_);const o=al(e);Cf(o)?((function(s){if(s._parentEditor!==null){const a=wf(s),l=a[a.length-1]._key;Do.get(l)===s&&Do.delete(l)}else Do.delete(s._key)})(o),e.__lexicalEditor=null):o&&U(198);const i=S_(e);for(let s=0;s<i.length;s++)i[s]();e.__lexicalEventHandles=[]}function Iu(e,t,n){st();const r=e.__key,o=e.getParent();if(o===null)return;const i=(function(a){const l=G();if(!W(l)||!V(a))return l;const{anchor:c,focus:u}=l,f=c.getNode(),d=u.getNode();return Bu(f,a)&&c.set(a.__key,0,"element"),Bu(d,a)&&u.set(a.__key,0,"element"),l})(e);let s=!1;if(W(i)&&t){const a=i.anchor,l=i.focus;a.key===r&&(Aa(a,e,o,e.getPreviousSibling(),e.getNextSibling()),s=!0),l.key===r&&(Aa(l,e,o,e.getPreviousSibling(),e.getNextSibling()),s=!0)}else gt(i)&&t&&e.isSelected()&&e.selectPrevious();if(W(i)&&t&&!s){const a=e.getIndexWithinParent();Kr(e),ka(i,o,a,-1)}else Kr(e);n||dt(o)||o.canBeEmpty()||!o.isEmpty()||Iu(o,t),t&&i&&tt(o)&&o.isEmpty()&&o.selectEnd()}const T_=Symbol.for("ephemeral");function Ra(e){return e[T_]||!1}class Cn{__type;__key;__parent;__prev;__next;__state;static getType(){const{ownNodeType:t}=ul(this);return t===void 0&&U(64,this.name),t}static clone(t){U(65,this.name)}$config(){return{}}config(t,n){const r=n.extends||Object.getPrototypeOf(this.constructor);return Object.assign(n,{extends:r,type:t}),{[t]:n}}afterCloneFrom(t){this.__key===t.__key?(this.__parent=t.__parent,this.__next=t.__next,this.__prev=t.__prev,this.__state=t.__state):t.__state&&(this.__state=t.__state.getWritable(this))}static importDOM;constructor(t){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",{configurable:!0,enumerable:!1,value:void 0,writable:!0}),U_(this,t)}getType(){return this.__type}isInline(){U(137,this.constructor.name)}isAttached(){let t=this.__key;for(;t!==null;){if(t==="root")return!0;const n=Me(t);if(n===null)break;t=n.__parent}return!1}isSelected(t){const n=t||G();if(n==null)return!1;const r=n.getNodes().some(o=>o.__key===this.__key);if(Y(this))return r;if(W(n)&&n.anchor.type==="element"&&n.focus.type==="element"){if(n.isCollapsed())return!1;const o=this.getParent();if(Ce(this)&&this.isInline()&&o){const i=n.isBackward()?n.focus:n.anchor;if(o.is(i.getNode())&&i.offset===o.getChildrenSize()&&this.is(o.getLastChild()))return!1}}return r}getKey(){return this.__key}getIndexWithinParent(){const t=this.getParent();if(t===null)return-1;let n=t.getFirstChild(),r=0;for(;n!==null;){if(this.is(n))return r;r++,n=n.getNextSibling()}return-1}getParent(){const t=this.getLatest().__parent;return t===null?null:Me(t)}getParentOrThrow(){const t=this.getParent();return t===null&&U(66,this.__key),t}getTopLevelElement(){let t=this;for(;t!==null;){const n=t.getParent();if(dt(n))return V(t)||t===this&&Ce(t)||U(194),t;t=n}return null}getTopLevelElementOrThrow(){const t=this.getTopLevelElement();return t===null&&U(67,this.__key),t}getParents(){const t=[];let n=this.getParent();for(;n!==null;)t.push(n),n=n.getParent();return t}getParentKeys(){const t=[];let n=this.getParent();for(;n!==null;)t.push(n.__key),n=n.getParent();return t}getPreviousSibling(){const t=this.getLatest().__prev;return t===null?null:Me(t)}getPreviousSiblings(){const t=[],n=this.getParent();if(n===null)return t;let r=n.getFirstChild();for(;r!==null&&!r.is(this);)t.push(r),r=r.getNextSibling();return t}getNextSibling(){const t=this.getLatest().__next;return t===null?null:Me(t)}getNextSiblings(){const t=[];let n=this.getNextSibling();for(;n!==null;)t.push(n),n=n.getNextSibling();return t}getCommonAncestor(t){const n=V(this)?this:this.getParent(),r=V(t)?t:t.getParent(),o=n&&r?oa(n,r):null;return o?o.commonAncestor:null}is(t){return t!=null&&this.__key===t.__key}isBefore(t){const n=oa(this,t);return n!==null&&(n.type==="descendant"||(n.type==="branch"?sx(n)===-1:(n.type!=="same"&&n.type!=="ancestor"&&U(279),!1)))}isParentOf(t){const n=oa(this,t);return n!==null&&n.type==="ancestor"}getNodesBetween(t){const n=this.isBefore(t),r=[],o=new Set;let i=this;for(;i!==null;){const s=i.__key;if(o.has(s)||(o.add(s),r.push(i)),i===t)break;const a=V(i)?n?i.getFirstChild():i.getLastChild():null;if(a!==null){i=a;continue}const l=n?i.getNextSibling():i.getPreviousSibling();if(l!==null){i=l;continue}const c=i.getParentOrThrow();if(o.has(c.__key)||r.push(c),c===t)break;let u=null,f=c;do{if(f===null&&U(68),u=n?f.getNextSibling():f.getPreviousSibling(),f=f.getParent(),f===null)break;u!==null||o.has(f.__key)||r.push(f)}while(u===null);i=u}return n||r.reverse(),r}isDirty(){const t=Fe()._dirtyLeaves;return t!==null&&t.has(this.__key)}getLatest(){if(Ra(this))return this;const t=Me(this.__key);return t===null&&U(113),t}getWritable(){if(Ra(this))return this;st();const t=wr(),n=Fe(),r=t._nodeMap,o=this.__key,i=this.getLatest(),s=n._cloneNotNeeded,a=G();if(a!==null&&a.setCachedNodes(null),s.has(o))return Na(i),i;const l=nx(i);return s.add(o),Na(l),r.set(o,l),l}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(t,n){U(70)}updateDOM(t,n,r){U(71)}exportDOM(t){return{element:this.createDOM(t._config,t)}}exportJSON(){const t=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...t}}static importJSON(t){U(18,this.name)}updateFromJSON(t){return(function(n,r){const o=n.getWritable(),i=r.$;let s=i;for(const a of t_(o).flatKeys)a in r&&(s!==void 0&&s!==i||(s={...i}),s[a]=r[a]);return(o.__state||s)&&e_(n).updateFromJSON(s),o})(this,t)}static transform(){return null}remove(t){Iu(this,!0,t)}replace(t,n){st();let r=G();r!==null&&(r=r.clone()),sc(this,t);const o=this.getLatest(),i=this.__key,s=t.__key,a=t.getWritable(),l=this.getParentOrThrow().getWritable(),c=l.__size;Kr(a);const u=o.getPreviousSibling(),f=o.getNextSibling(),d=o.__prev,h=o.__next,g=o.__parent;if(Iu(o,!1,!0),u===null?l.__first=s:u.getWritable().__next=s,a.__prev=d,f===null?l.__last=s:f.getWritable().__prev=s,a.__next=h,a.__parent=g,l.__size=c,n&&(V(this)&&V(a)||U(139),this.getChildren().forEach(p=>{a.append(p)})),W(r)){He(r);const p=r.anchor,m=r.focus;p.key===i&&vp(p,a),m.key===i&&vp(m,a)}return rr()===i&&ut(s),a}insertAfter(t,n=!0){st(),sc(this,t);const r=this.getWritable(),o=t.getWritable(),i=o.getParent(),s=G();let a=!1,l=!1;if(i!==null){const h=t.getIndexWithinParent();if(Kr(o),W(s)){const g=i.__key,p=s.anchor,m=s.focus;a=p.type==="element"&&p.key===g&&p.offset===h+1,l=m.type==="element"&&m.key===g&&m.offset===h+1}}const c=this.getNextSibling(),u=this.getParentOrThrow().getWritable(),f=o.__key,d=r.__next;if(c===null?u.__last=f:c.getWritable().__prev=f,u.__size++,r.__next=f,o.__next=d,o.__prev=r.__key,o.__parent=r.__parent,n&&W(s)){const h=this.getIndexWithinParent();ka(s,u,h+1);const g=u.__key;a&&s.anchor.set(g,h+2,"element"),l&&s.focus.set(g,h+2,"element")}return t}insertBefore(t,n=!0){st(),sc(this,t);const r=this.getWritable(),o=t.getWritable(),i=o.__key;Kr(o);const s=this.getPreviousSibling(),a=this.getParentOrThrow().getWritable(),l=r.__prev,c=this.getIndexWithinParent();s===null?a.__first=i:s.getWritable().__next=i,a.__size++,r.__prev=i,o.__prev=l,o.__next=r.__key,o.__parent=r.__parent;const u=G();return n&&W(u)&&ka(u,this.getParentOrThrow(),c),t}isParentRequired(){return!1}createParentElementNode(){return me()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(t,n){st();const r=this.getPreviousSibling(),o=this.getParentOrThrow();if(r===null)return o.select(0,0);if(V(r))return r.select();if(!Y(r)){const i=r.getIndexWithinParent()+1;return o.select(i,i)}return r.select(t,n)}selectNext(t,n){st();const r=this.getNextSibling(),o=this.getParentOrThrow();if(r===null)return o.select();if(V(r))return r.select(0,0);if(!Y(r)){const i=r.getIndexWithinParent();return o.select(i,i)}return r.select(t,n)}markDirty(){this.getWritable()}reconcileObservedMutation(t,n){this.markDirty()}}const Fk="historic",Vo="history-merge",Lk="paste",R_="collaboration",Ok="skip-scroll-into-view",Ik="skip-dom-selection",$k="skip-selection-focus";class ii extends Cn{static getType(){return"linebreak"}static clone(t){return new ii(t.__key)}constructor(t){super(t)}getTextContent(){return`
|
|
14
|
+
`}createDOM(){return document.createElement("br")}updateDOM(){return!1}isInline(){return!0}static importDOM(){return{br:t=>(function(n){const r=n.parentElement;if(r!==null&&Pa(r)){const o=r.firstChild;if(o===n||o.nextSibling===n&&Ps(o)){const i=r.lastChild;if(i===n||i.previousSibling===n&&Ps(i))return!0}}return!1})(t)||(function(n){const r=n.parentElement;if(r!==null&&Pa(r)){const o=r.firstChild;if(o===n||o.nextSibling===n&&Ps(o))return!1;const i=r.lastChild;if(i===n||i.previousSibling===n&&Ps(i))return!0}return!1})(t)?null:{conversion:Dk,priority:0}}}static importJSON(t){return sn().updateFromJSON(t)}}function Dk(e){return{node:sn()}}function sn(){return vt(new ii)}function wn(e){return e instanceof ii}function Ps(e){return Zn(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||"")}function tc(e,t){return 16&t?"code":t&G0?"mark":32&t?"sub":64&t?"sup":null}function nc(e,t){return 1&t?"strong":2&t?"em":"span"}function k_(e,t,n,r,o){const i=r.classList;let s=jo(o,"base");s!==void 0&&i.add(...s),s=jo(o,"underlineStrikethrough");let a=!1;const l=8&t&&4&t;s!==void 0&&(8&n&&4&n?(a=!0,l||i.add(...s)):l&&i.remove(...s));for(const c in gr){const u=gr[c];if(s=jo(o,c),s!==void 0)if(n&u){if(a&&(c==="underline"||c==="strikethrough")){t&u&&i.remove(...s);continue}((t&u)===0||l&&c==="underline"||c==="strikethrough")&&i.add(...s)}else t&u&&i.remove(...s)}}function A_(e,t,n){const r=t.firstChild,o=n.isComposing(),i=e+(o?Xa:"");if(r==null)t.textContent=i;else{const s=r.nodeValue;if(s!==i)if(o||Ur){const[a,l,c]=(function(u,f){const d=u.length,h=f.length;let g=0,p=0;for(;g<d&&g<h&&u[g]===f[g];)g++;for(;p+g<d&&p+g<h&&u[d-p-1]===f[h-p-1];)p++;return[g,d-g-p,f.slice(g,h-p)]})(s,i);l!==0&&r.deleteData(a,l),r.insertData(a,c)}else r.nodeValue=i}}function pp(e,t,n,r,o,i){A_(o,e,t);const s=i.theme.text;s!==void 0&&k_(0,0,r,e,s)}function Fs(e,t){const n=document.createElement(t);return n.appendChild(e),n}class Gt extends Cn{__text;__format;__style;__mode;__detail;static getType(){return"text"}static clone(t){return new Gt(t.__text,t.__key)}afterCloneFrom(t){super.afterCloneFrom(t),this.__text=t.__text,this.__format=t.__format,this.__style=t.__style,this.__mode=t.__mode,this.__detail=t.__detail}constructor(t="",n){super(n),this.__text=t,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){const t=this.getLatest();return ak[t.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===rr()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(t){const n=gr[t];return(this.getFormat()&n)!==0}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(t,n){return Ma(this.getLatest().__format,t,n)}canHaveFormat(){return!0}isInline(){return!0}createDOM(t,n){const r=this.__format,o=tc(0,r),i=nc(0,r),s=o===null?i:o,a=document.createElement(s);let l=a;this.hasFormat("code")&&a.setAttribute("spellcheck","false"),o!==null&&(l=document.createElement(i),a.appendChild(l)),pp(l,this,0,r,this.__text,t);const c=this.__style;return c!==""&&(a.style.cssText=c),a}updateDOM(t,n,r){const o=this.__text,i=t.__format,s=this.__format,a=tc(0,i),l=tc(0,s),c=nc(0,i),u=nc(0,s);if((a===null?c:a)!==(l===null?u:l))return!0;if(a===l&&c!==u){const p=n.firstChild;p==null&&U(48);const m=document.createElement(u);return pp(m,this,0,s,o,r),n.replaceChild(m,p),!1}let f=n;l!==null&&a!==null&&(f=n.firstChild,f==null&&U(49)),A_(o,f,this);const d=r.theme.text;d!==void 0&&i!==s&&k_(0,i,s,f,d);const h=t.__style,g=this.__style;return h!==g&&(n.style.cssText=g),!1}static importDOM(){return{"#text":()=>({conversion:zk,priority:0}),b:()=>({conversion:jk,priority:0}),code:()=>({conversion:Ln,priority:0}),em:()=>({conversion:Ln,priority:0}),i:()=>({conversion:Ln,priority:0}),mark:()=>({conversion:Ln,priority:0}),s:()=>({conversion:Ln,priority:0}),span:()=>({conversion:Vk,priority:0}),strong:()=>({conversion:Ln,priority:0}),sub:()=>({conversion:Ln,priority:0}),sup:()=>({conversion:Ln,priority:0}),u:()=>({conversion:Ln,priority:0})}}static importJSON(t){return Pe().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setTextContent(t.text).setFormat(t.format).setDetail(t.detail).setMode(t.mode).setStyle(t.style)}exportDOM(t){let{element:n}=super.exportDOM(t);return je(n)||U(132),n.style.whiteSpace="pre-wrap",this.hasFormat("lowercase")?n.style.textTransform="lowercase":this.hasFormat("uppercase")?n.style.textTransform="uppercase":this.hasFormat("capitalize")&&(n.style.textTransform="capitalize"),this.hasFormat("bold")&&(n=Fs(n,"b")),this.hasFormat("italic")&&(n=Fs(n,"i")),this.hasFormat("strikethrough")&&(n=Fs(n,"s")),this.hasFormat("underline")&&(n=Fs(n,"u")),{element:n}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(t,n){}setFormat(t){const n=this.getWritable();return n.__format=typeof t=="string"?gr[t]:t,n}setDetail(t){const n=this.getWritable();return n.__detail=typeof t=="string"?ok[t]:t,n}setStyle(t){const n=this.getWritable();return n.__style=t,n}toggleFormat(t){const n=Ma(this.getFormat(),t,null);return this.setFormat(n)}toggleDirectionless(){const t=this.getWritable();return t.__detail^=1,t}toggleUnmergeable(){const t=this.getWritable();return t.__detail^=2,t}setMode(t){const n=sk[t];if(this.__mode===n)return this;const r=this.getWritable();return r.__mode=n,r}setTextContent(t){if(this.__text===t)return this;const n=this.getWritable();return n.__text=t,n}select(t,n){st();let r=t,o=n;const i=G(),s=this.getTextContent(),a=this.__key;if(typeof s=="string"){const l=s.length;r===void 0&&(r=l),o===void 0&&(o=l)}else r=0,o=0;if(!W(i))return P_(a,r,a,o,"text","text");{const l=rr();l!==i.anchor.key&&l!==i.focus.key||ut(a),i.setTextNodeRange(this,r,this,o)}return i}selectStart(){return this.select(0,0)}selectEnd(){const t=this.getTextContentSize();return this.select(t,t)}spliceText(t,n,r,o){const i=this.getWritable(),s=i.__text,a=r.length;let l=t;l<0&&(l=a+l,l<0&&(l=0));const c=G();if(o&&W(c)){const f=t+a;c.setTextNodeRange(i,f,i,f)}const u=s.slice(0,l)+r+s.slice(l+n);return i.__text=u,i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...t){st();const n=this.getLatest(),r=n.getTextContent();if(r==="")return[];const o=n.__key,i=rr(),s=r.length;t.sort((E,R)=>E-R),t.push(s);const a=[],l=t.length;for(let E=0,R=0;E<s&&R<=l;R++){const M=t[R];M>E&&(a.push(r.slice(E,M)),E=M)}const c=a.length;if(c===1)return[n];const u=a[0],f=n.getParent();let d;const h=n.getFormat(),g=n.getStyle(),p=n.__detail;let m=!1,_=null,y=null;const v=G();if(W(v)){const[E,R]=v.isBackward()?[v.focus,v.anchor]:[v.anchor,v.focus];E.type==="text"&&E.key===o&&(_=E),R.type==="text"&&R.key===o&&(y=R)}n.isSegmented()?(d=Pe(u),d.__format=h,d.__style=g,d.__detail=p,d.__state=op(n,d),m=!0):d=n.setTextContent(u);const x=[d];for(let E=1;E<c;E++){const R=Pe(a[E]);R.__format=h,R.__style=g,R.__detail=p,R.__state=op(n,R);const M=R.__key;i===o&&ut(M),x.push(R)}const b=_?_.offset:null,w=y?y.offset:null;let T=0;for(const E of x){if(!_&&!y)break;const R=T+E.getTextContentSize();if(_!==null&&b!==null&&b<=R&&b>=T&&(_.set(E.getKey(),b-T,"text"),b<R&&(_=null)),y!==null&&w!==null&&w<=R&&w>=T){y.set(E.getKey(),w-T,"text");break}T=R}if(f!==null){(function(M){const O=M.getPreviousSibling(),D=M.getNextSibling();O!==null&&Na(O),D!==null&&Na(D)})(this);const E=f.getWritable(),R=this.getIndexWithinParent();m?(E.splice(R,0,x),this.remove()):E.splice(R,1,x),W(v)&&ka(v,f,R,c-1)}return x}mergeWithSibling(t){const n=t===this.getPreviousSibling();n||t===this.getNextSibling()||U(50);const r=this.__key,o=t.__key,i=this.__text,s=i.length;rr()===o&&ut(r);const a=G();if(W(a)){const f=a.anchor,d=a.focus;f!==null&&f.key===o&&Ep(f,n,r,t,s),d!==null&&d.key===o&&Ep(d,n,r,t,s)}const l=t.__text,c=n?l+i:i+l;this.setTextContent(c);const u=this.getWritable();return t.remove(),u}isTextEntity(){return!1}}function Vk(e){return{forChild:hf(e.style),node:null}}function jk(e){const t=e,n=t.style.fontWeight==="normal";return{forChild:hf(t.style,n?void 0:"bold"),node:null}}const mp=new WeakMap;function Bk(e){if(!je(e))return!1;if(e.nodeName==="PRE")return!0;const t=e.style.whiteSpace;return typeof t=="string"&&t.startsWith("pre")}function zk(e){const t=e;e.parentElement===null&&U(129);let n=t.textContent||"";if((function(r){let o,i=r.parentNode;const s=[r];for(;i!==null&&(o=mp.get(i))===void 0&&!Bk(i);)s.push(i),i=i.parentNode;const a=o===void 0?i:o;for(let l=0;l<s.length;l++)mp.set(s[l],a);return a})(t)!==null){const r=n.split(/(\r?\n|\t)/),o=[],i=r.length;for(let s=0;s<i;s++){const a=r[s];a===`
|
|
15
15
|
`||a===`\r
|
|
16
|
-
`?o.push(
|
|
16
|
+
`?o.push(sn()):a===" "?o.push(ai()):a!==""&&o.push(Pe(a))}return{node:o}}if(n=n.replace(/\r/g,"").replace(/[ \t\n]+/g," "),n==="")return{node:null};if(n[0]===" "){let r=t,o=!0;for(;r!==null&&(r=yp(r,!1))!==null;){const i=r.textContent||"";if(i.length>0){/[ \t\n]$/.test(i)&&(n=n.slice(1)),o=!1;break}}o&&(n=n.slice(1))}if(n[n.length-1]===" "){let r=t,o=!0;for(;r!==null&&(r=yp(r,!0))!==null;)if((r.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){o=!1;break}o&&(n=n.slice(0,n.length-1))}return n===""?{node:null}:{node:Pe(n)}}function yp(e,t){let n=e;for(;;){let r;for(;(r=t?n.nextSibling:n.previousSibling)===null;){const i=n.parentElement;if(i===null)return null;n=i}if(n=r,je(n)){const i=n.style.display;if(i===""&&!Hu(n)||i!==""&&!i.startsWith("inline"))return null}let o=n;for(;(o=t?n.firstChild:n.lastChild)!==null;)n=o;if(Zn(n))return n;if(n.nodeName==="BR")return null}}const Wk={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function Ln(e){const t=Wk[e.nodeName.toLowerCase()];return t===void 0?{node:null}:{forChild:hf(e.style,t),node:null}}function Pe(e=""){return vt(new Gt(e))}function Y(e){return e instanceof Gt}function hf(e,t){const n=e.fontWeight,r=e.textDecoration.split(" "),o=n==="700"||n==="bold",i=r.includes("line-through"),s=e.fontStyle==="italic",a=r.includes("underline"),l=e.verticalAlign;return c=>(Y(c)&&(o&&!c.hasFormat("bold")&&c.toggleFormat("bold"),i&&!c.hasFormat("strikethrough")&&c.toggleFormat("strikethrough"),s&&!c.hasFormat("italic")&&c.toggleFormat("italic"),a&&!c.hasFormat("underline")&&c.toggleFormat("underline"),l!=="sub"||c.hasFormat("subscript")||c.toggleFormat("subscript"),l!=="super"||c.hasFormat("superscript")||c.toggleFormat("superscript"),t&&!c.hasFormat(t)&&c.toggleFormat(t)),c)}class si extends Gt{static getType(){return"tab"}static clone(t){return new si(t.__key)}constructor(t){super(" ",t),this.__detail=2}static importDOM(){return null}createDOM(t){const n=super.createDOM(t),r=jo(t.theme,"tab");return r!==void 0&&n.classList.add(...r),n}static importJSON(t){return ai().updateFromJSON(t)}setTextContent(t){return t!==" "&&t!==""&&H0(126),super.setTextContent(" ")}spliceText(t,n,r,o){return r===""&&n===0||r===" "&&n===1||U(286),this}setDetail(t){return t!==2&&U(127),this}setMode(t){return t!=="normal"&&U(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function ai(){return vt(new si)}function nl(e){return e instanceof si}class Hk{key;offset;type;_selection;constructor(t,n,r){this._selection=null,this.key=t,this.offset=n,this.type=r}is(t){return this.key===t.key&&this.offset===t.offset&&this.type===t.type}isBefore(t){return this.key===t.key?this.offset<t.offset:ix(bt(an(this,"next")),bt(an(t,"next")))<0}getNode(){const t=Me(this.key);return t===null&&U(20),t}set(t,n,r,o){const i=this._selection,s=this.key;o&&this.key===t&&this.offset===n&&this.type===r||(this.key=t,this.offset=n,this.type=r,li()||(rr()===s&&ut(t),i!==null&&(i.setCachedNodes(null),i.dirty=!0)))}}function Pt(e,t,n){return new Hk(e,t,n)}function rc(e,t){let n=t.__key,r=e.offset,o="element";if(Y(t)){o="text";const i=t.getTextContentSize();r>i&&(r=i)}else if(!V(t)){const i=t.getNextSibling();if(Y(i))n=i.__key,r=0,o="text";else{const s=t.getParent();s&&(n=s.__key,r=t.getIndexWithinParent()+1)}}e.set(n,r,o)}function vp(e,t){if(V(t)){const n=t.getLastDescendant();V(n)||Y(n)?rc(e,n):rc(e,t)}else rc(e,t)}class rl{_nodes;_cachedNodes;dirty;constructor(t){this._cachedNodes=null,this._nodes=t,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){if(!gt(t))return!1;const n=this._nodes,r=t._nodes;return n.size===r.size&&Array.from(n).every(o=>r.has(o))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(t){this.dirty=!0,this._nodes.add(t),this._cachedNodes=null}delete(t){this.dirty=!0,this._nodes.delete(t),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(t){return this._nodes.has(t)}clone(){return new rl(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(t){}insertText(){}insertNodes(t){const n=this.getNodes(),r=n.length,o=n[r-1];let i;if(Y(o))i=o.select();else{const s=o.getIndexWithinParent()+1;i=o.getParentOrThrow().select(s,s)}i.insertNodes(t);for(let s=0;s<r;s++)n[s].remove()}getNodes(){const t=this._cachedNodes;if(t!==null)return t;const n=this._nodes,r=[];for(const o of n){const i=Me(o);i!==null&&r.push(i)}return li()||(this._cachedNodes=r),r}getTextContent(){const t=this.getNodes();let n="";for(let r=0;r<t.length;r++)n+=t[r].getTextContent();return n}deleteNodes(){const t=this.getNodes();if((G()||An())===this&&t[0]){const n=Je(t[0],"next");ax(mr(n,n))}for(const n of t)n.remove()}}function W(e){return e instanceof ao}class ao{format;style;anchor;focus;_cachedNodes;dirty;constructor(t,n,r,o){this.anchor=t,this.focus=n,t._selection=this,n._selection=this,this._cachedNodes=null,this.format=r,this.style=o,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){return!!W(t)&&this.anchor.is(t.anchor)&&this.focus.is(t.focus)&&this.format===t.format&&this.style===t.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const t=this._cachedNodes;if(t!==null)return t;const n=(function(r){const o=[],[i,s]=r.getTextSlices();i&&o.push(i.caret.origin);const a=new Set,l=new Set;for(const c of r)if(At(c)){const{origin:u}=c;o.length===0?a.add(u):(l.add(u),o.push(u))}else{const{origin:u}=c;V(u)&&l.has(u)||o.push(u)}if(s&&o.push(s.caret.origin),pr(r.focus)&&V(r.focus.origin)&&r.focus.getNodeAtCaret()===null)for(let c=Ct(r.focus.origin,"previous");At(c)&&a.has(c.origin)&&!c.origin.isEmpty()&&c.origin.is(o[o.length-1]);c=hs(c))a.delete(c.origin),o.pop();for(;o.length>1;){const c=o[o.length-1];if(!V(c)||l.has(c)||c.isEmpty()||a.has(c))break;o.pop()}if(o.length===0&&r.isCollapsed()){const c=bt(r.anchor),u=bt(r.anchor.getFlipped()),f=h=>En(h)?h.origin:h.getNodeAtCaret(),d=f(c)||f(u)||(r.anchor.getNodeAtCaret()?c.origin:u.origin);o.push(d)}return o})(lx(Hp(this),"next"));return li()||(this._cachedNodes=n),n}setTextNodeRange(t,n,r,o){this.anchor.set(t.__key,n,"text"),this.focus.set(r.__key,o,"text")}getTextContent(){const t=this.getNodes();if(t.length===0)return"";const n=t[0],r=t[t.length-1],o=this.anchor,i=this.focus,s=o.isBefore(i),[a,l]=$u(this);let c="",u=!0;for(let f=0;f<t.length;f++){const d=t[f];if(V(d)&&!d.isInline())u||(c+=`
|
|
17
17
|
`),u=!d.isEmpty();else if(u=!1,Y(d)){let h=d.getTextContent();d===n?d===r?o.type==="element"&&i.type==="element"&&i.offset!==o.offset||(h=a<l?h.slice(a,l):h.slice(l,a)):h=s?h.slice(a):h.slice(l):d===r&&(h=s?h.slice(0,l):h.slice(0,a)),c+=h}else!Ce(d)&&!wn(d)||d===r&&this.isCollapsed()||(c+=d.getTextContent())}return c}applyDOMRange(t){const n=Fe(),r=n.getEditorState()._selection,o=N_(t.startContainer,t.startOffset,t.endContainer,t.endOffset,n,r);if(o===null)return;const[i,s]=o;this.anchor.set(i.key,i.offset,i.type,!0),this.focus.set(s.key,s.offset,s.type,!0),qi(this)}clone(){const t=this.anchor,n=this.focus;return new ao(Pt(t.key,t.offset,t.type),Pt(n.key,n.offset,n.type),this.format,this.style)}toggleFormat(t){this.format=Ma(this.format,t,null),this.dirty=!0}setFormat(t){this.format=t,this.dirty=!0}setStyle(t){this.style=t,this.dirty=!0}hasFormat(t){const n=gr[t];return(this.format&n)!==0}insertRawText(t){const n=t.split(/(\r?\n|\t)/),r=[],o=n.length;for(let i=0;i<o;i++){const s=n[i];s===`
|
|
18
18
|
`||s===`\r
|
|
19
|
-
`?r.push(an()):s===" "?r.push(ai()):r.push(Pe(s))}this.insertNodes(r)}insertText(t){const n=this.anchor,r=this.focus,o=this.format,i=this.style;let s=n,a=r;!this.isCollapsed()&&r.isBefore(n)&&(s=r,a=n),s.type==="element"&&(function(m,_,y,v){const x=m.getNode(),b=x.getChildAtIndex(m.offset),w=Pe();if(w.setFormat(y),w.setStyle(v),Sr(b))b.splice(0,0,[w]);else{const T=tt(x)?me().append(w):w;b===null?x.append(T):b.insertBefore(T)}m.is(_)&&_.set(w.__key,0,"text"),m.set(w.__key,0,"text")})(s,a,o,i),a.type==="element"&&nn(a,bt(ln(a,"next")));const l=s.offset;let c=a.offset;const u=this.getNodes(),f=u.length;let d=u[0];Y(d)||U(26);const h=d.getTextContent().length,g=d.getParentOrThrow();let p=u[f-1];if(f===1&&a.type==="element"&&(c=h,a.set(s.key,c,"text")),this.isCollapsed()&&l===h&&(In(d)||!d.canInsertTextAfter()||!g.canInsertTextAfter()&&d.getNextSibling()===null)){let m=d.getNextSibling();if(Y(m)&&m.canInsertTextBefore()&&!In(m)||(m=Pe(),m.setFormat(o),m.setStyle(i),g.canInsertTextAfter()?d.insertAfter(m):g.insertAfter(m)),m.select(0,0),d=m,t!=="")return void this.insertText(t)}else if(this.isCollapsed()&&l===0&&(In(d)||!d.canInsertTextBefore()||!g.canInsertTextBefore()&&d.getPreviousSibling()===null)){let m=d.getPreviousSibling();if(Y(m)&&!In(m)||(m=Pe(),m.setFormat(o),g.canInsertTextBefore()?d.insertBefore(m):g.insertBefore(m)),m.select(),d=m,t!=="")return void this.insertText(t)}else if(d.isSegmented()&&l!==h){const m=Pe(d.getTextContent());m.setFormat(o),d.replace(m),d=m}else if(!this.isCollapsed()&&t!==""){const m=p.getParent();if(!g.canInsertTextBefore()||!g.canInsertTextAfter()||V(m)&&(!m.canInsertTextBefore()||!m.canInsertTextAfter()))return this.insertText(""),M_(this.anchor,this.focus,null),void this.insertText(t)}if(f===1){if(Hr(d)){const v=Pe(t);return v.select(),void d.replace(v)}const m=d.getFormat(),_=d.getStyle();if(l!==c||m===o&&_===i){if(nl(d)){const v=Pe(t);return v.setFormat(o),v.setStyle(i),v.select(),void d.replace(v)}}else{if(d.getTextContent()!==""){const v=Pe(t);if(v.setFormat(o),v.setStyle(i),v.select(),l===0)d.insertBefore(v,!1);else{const[x]=d.splitText(l);x.insertAfter(v,!1)}return void(v.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=t.length))}d.setFormat(o),d.setStyle(i)}const y=c-l;d=d.spliceText(l,y,t,!0),d.getTextContent()===""?d.remove():this.anchor.type==="text"&&(d.isComposing()?this.anchor.offset-=t.length:(this.format=m,this.style=_))}else{const m=new Set([...d.getParentKeys(),...p.getParentKeys()]),_=V(d)?d:d.getParentOrThrow();let y=V(p)?p:p.getParentOrThrow(),v=p;if(!_.is(y)&&y.isInline())do v=y,y=y.getParentOrThrow();while(y.isInline());if(a.type==="text"&&(c!==0||p.getTextContent()==="")||a.type==="element"&&p.getIndexWithinParent()<c)if(Y(p)&&!Hr(p)&&c!==p.getTextContentSize()){if(p.isSegmented()){const E=Pe(p.getTextContent());p.replace(E),p=E}tt(a.getNode())||a.type!=="text"||(p=p.spliceText(0,c,"")),m.add(p.__key)}else{const E=p.getParentOrThrow();E.canBeEmpty()||E.getChildrenSize()!==1?p.remove():E.remove()}else m.add(p.__key);const x=y.getChildren(),b=new Set(u),w=_.is(y),T=_.isInline()&&d.getNextSibling()===null?_:d;for(let E=x.length-1;E>=0;E--){const R=x[E];if(R.is(d)||V(R)&&R.isParentOf(d))break;R.isAttached()&&(!b.has(R)||R.is(v)?w||T.insertAfter(R,!1):R.remove())}if(!w){let E=y,R=null;for(;E!==null;){const M=E.getChildren(),O=M.length;(O===0||M[O-1].is(R))&&(m.delete(E.__key),R=E),E=E.getParent()}}if(Hr(d))if(l===h)d.select();else{const E=Pe(t);E.select(),d.replace(E)}else d=d.spliceText(l,h-l,t,!0),d.getTextContent()===""?d.remove():d.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=t.length);for(let E=1;E<f;E++){const R=u[E],M=R.__key;m.has(M)||R.remove()}}}removeText(){const t=G()===this;ia(this,w3(Hp(this))),t&&G()!==this&&He(this)}formatText(t,n=null){if(this.isCollapsed())return this.toggleFormat(t),void ut(null);const r=this.getNodes(),o=[];for(const x of r)Y(x)&&o.push(x);const i=x=>{r.forEach(b=>{if(V(b)){const w=b.getFormatFlags(t,x);b.setTextFormat(w)}})},s=o.length;if(s===0)return this.toggleFormat(t),ut(null),void i(n);const a=this.anchor,l=this.focus,c=this.isBackward(),u=c?l:a,f=c?a:l;let d=0,h=o[0],g=u.type==="element"?0:u.offset;if(u.type==="text"&&g===h.getTextContentSize()&&(d=1,h=o[1],g=0),h==null)return;const p=h.getFormatFlags(t,n);i(p);const m=s-1;let _=o[m];const y=f.type==="text"?f.offset:_.getTextContentSize();if(h.is(_)){if(g===y)return;if(In(h)||g===0&&y===h.getTextContentSize())h.setFormat(p);else{const x=h.splitText(g,y),b=g===0?x[0]:x[1];b.setFormat(p),u.type==="text"&&u.set(b.__key,0,"text"),f.type==="text"&&f.set(b.__key,y-g,"text")}return void(this.format=p)}g===0||In(h)||([,h]=h.splitText(g),g=0),h.setFormat(p);const v=_.getFormatFlags(t,p);y>0&&(y===_.getTextContentSize()||In(_)||([_]=_.splitText(y)),_.setFormat(v));for(let x=d+1;x<m;x++){const b=o[x],w=b.getFormatFlags(t,v);b.setFormat(w)}u.type==="text"&&u.set(h.__key,g,"text"),f.type==="text"&&f.set(_.__key,y,"text"),this.format=p|v}insertNodes(t){if(t.length===0)return;if(this.isCollapsed()||this.removeText(),this.anchor.key==="root"){this.insertParagraph();const g=G();return W(g)||U(134),g.insertNodes(t)}const n=(this.isBackward()?this.focus:this.anchor).getNode(),r=xe(n,nr),o=t[t.length-1];if(V(r)&&"__language"in r){if("__language"in t[0])this.insertText(t[0].getTextContent());else{const g=oc(this);r.splice(g,0,t),o.selectEnd()}return}if(!t.some(g=>(V(g)||Ce(g))&&!g.isInline())){V(r)||U(211,n.constructor.name,n.getType());const g=oc(this);return r.splice(g,0,t),void o.selectEnd()}const i=(function(g){const p=me();let m=null;for(let _=0;_<g.length;_++){const y=g[_],v=wn(y);if(v||Ce(y)&&y.isInline()||V(y)&&y.isInline()||Y(y)||y.isParentRequired()){if(m===null&&(m=y.createParentElementNode(),p.append(m),v))continue;m!==null&&m.append(y)}else p.append(y),m=null}return p})(t),s=i.getLastDescendant(),a=i.getChildren(),l=!V(r)||!r.isEmpty()?this.insertParagraph():null,c=a[a.length-1];let u=a[0];var f;V(f=u)&&nr(f)&&!f.isEmpty()&&V(r)&&(!r.isEmpty()||r.canMergeWhenEmpty())&&(V(r)||U(211,n.constructor.name,n.getType()),r.append(...u.getChildren()),u=a[1]),u&&(r===null&&U(212,n.constructor.name,n.getType()),(function(g,p){const m=p.getParentOrThrow().getLastChild();let _=p;const y=[p];for(;_!==m;)_.getNextSibling()||U(140),_=_.getNextSibling(),y.push(_);let v=g;for(const x of y)v=v.insertAfter(x)})(r,u));const d=xe(s,nr);l&&V(d)&&(l.canMergeWhenEmpty()||nr(c))&&(d.append(...l.getChildren()),l.remove()),V(r)&&r.isEmpty()&&r.remove(),s.selectEnd();const h=V(r)?r.getLastChild():null;wn(h)&&d!==r&&h.remove()}insertParagraph(){if(this.anchor.key==="root"){const s=me();return Ke().splice(this.anchor.offset,0,[s]),s.select(),s}const t=oc(this),n=xe(this.anchor.getNode(),nr);V(n)||U(213);const r=n.getChildAtIndex(t),o=r?[r,...r.getNextSiblings()]:[],i=n.insertNewAfter(this,!1);return i?(i.append(...o),i.selectStart(),i):null}insertLineBreak(t){const n=an();if(this.insertNodes([n]),t){const r=n.getParentOrThrow(),o=n.getIndexWithinParent();r.select(o,o)}}extract(){const t=[...this.getNodes()],n=t.length;let r=t[0],o=t[n-1];const[i,s]=$u(this),a=this.isBackward(),[l,c]=a?[this.focus,this.anchor]:[this.anchor,this.focus],[u,f]=a?[s,i]:[i,s];if(n===0)return[];if(n===1){if(Y(r)&&!this.isCollapsed()){const d=r.splitText(u,f),h=u===0?d[0]:d[1];return h?(l.set(h.getKey(),0,"text"),c.set(h.getKey(),h.getTextContentSize(),"text"),[h]):[]}return[r]}if(Y(r)&&(u===r.getTextContentSize()?t.shift():u!==0&&([,r]=r.splitText(u),t[0]=r,l.set(r.getKey(),0,"text"))),Y(o)){const d=o.getTextContent().length;f===0?t.pop():f!==d&&([o]=o.splitText(f),t[t.length-1]=o,c.set(o.getKey(),o.getTextContentSize(),"text"))}return t}modify(t,n,r){if(Tp(this,t,n,r))return;const o=t==="move",i=Fe(),s=St(qt(i));if(!s)return;const a=i._blockCursorElement,l=i._rootElement,c=this.focus.getNode();if(l===null||a===null||!V(c)||c.isInline()||c.canBeEmpty()||zu(a,i,l),this.dirty){let u=Jr(i,this.anchor.key),f=Jr(i,this.focus.key);this.anchor.type==="text"&&(u=Jo(u)),this.focus.type==="text"&&(f=Jo(f)),u&&f&&F_(s,u,this.anchor.offset,f,this.focus.offset)}if((function(u,f,d,h){u.modify(f,d,h)})(s,t,n?"backward":"forward",r),s.rangeCount>0){const u=s.getRangeAt(0),f=this.anchor.getNode(),d=tt(f)?f:l3(f);if(this.applyDOMRange(u),this.dirty=!0,!o){const h=this.getNodes(),g=[];let p=!1;for(let m=0;m<h.length;m++){const _=h[m];Bu(_,d)?g.push(_):p=!0}if(p&&g.length>0)if(n){const m=g[0];V(m)?m.selectStart():m.getParentOrThrow().selectStart()}else{const m=g[g.length-1];V(m)?m.selectEnd():m.getParentOrThrow().selectEnd()}s.anchorNode===u.startContainer&&s.anchorOffset===u.startOffset||(function(m){const _=m.focus,y=m.anchor,v=y.key,x=y.offset,b=y.type;y.set(_.key,_.offset,_.type,!0),_.set(v,x,b,!0)})(this)}}r==="lineboundary"&&Tp(this,t,n,r,"decorators")}forwardDeletion(t,n,r){if(!r&&(t.type==="element"&&V(n)&&t.offset===n.getChildrenSize()||t.type==="text"&&t.offset===n.getTextContentSize())){const o=n.getParent(),i=n.getNextSibling()||(o===null?null:o.getNextSibling());if(V(i)&&i.isShadowRoot())return!0}return!1}deleteCharacter(t){const n=this.isCollapsed();if(this.isCollapsed()){const r=this.anchor;let o=r.getNode();if(this.forwardDeletion(r,o,t))return;const i=Qi(ln(r,t?"previous":"next"));if(i.getTextSlices().every(a=>a===null||a.distance===0)){let a={type:"initial"};for(const l of i.iterNodeCarets("shadowRoot"))if(At(l)){if(!l.origin.isInline()){if(l.origin.isShadowRoot()){if(a.type==="merge-block")break;if(V(i.anchor.origin)&&i.anchor.origin.isEmpty()){const c=bt(l);ia(this,mr(c,c)),i.anchor.origin.remove()}return}a.type!=="merge-next-block"&&a.type!=="merge-block"||(a={block:a.block,caret:l,type:"merge-block"})}}else{if(a.type==="merge-block")break;if(pr(l)){if(V(l.origin)){if(l.origin.isInline()){if(!l.origin.isParentOf(i.anchor.origin))break}else a={block:l.origin,type:"merge-next-block"};continue}if(Ce(l.origin)){if(!l.origin.isIsolated())if(a.type==="merge-next-block"&&(l.origin.isKeyboardSelectable()||!l.origin.isInline())&&V(i.anchor.origin)&&i.anchor.origin.isEmpty()){i.anchor.origin.remove();const c=gf();c.add(l.origin.getKey()),He(c)}else l.origin.remove();return}break}}if(a.type==="merge-block"){const{caret:l,block:c}=a;return ia(this,mr(!l.origin.isEmpty()&&c.isEmpty()?gs(Je(c,l.direction)):i.anchor,l)),this.removeText()}}const s=this.focus;if(this.modify("extend",t,"character"),this.isCollapsed()){if(t&&r.offset===0&&xp(this,r.getNode()))return}else{const a=s.type==="text"?s.getNode():null;if(o=r.type==="text"?r.getNode():null,a!==null&&a.isSegmented()){const l=s.offset,c=a.getTextContentSize();if(a.is(o)||t&&l!==c||!t&&l!==0)return void bp(a,t,l)}else if(o!==null&&o.isSegmented()){const l=r.offset,c=o.getTextContentSize();if(o.is(a)||t&&l!==0||!t&&l!==c)return void bp(o,t,l)}(function(l,c){const u=l.anchor,f=l.focus,d=u.getNode(),h=f.getNode();if(d===h&&u.type==="text"&&f.type==="text"){const g=u.offset,p=f.offset,m=g<p,_=m?g:p,y=m?p:g,v=y-1;_!==v&&(function(x){return!(X_(x)||Kk(x))})(d.getTextContent().slice(_,y))&&(c?f.set(f.key,v,f.type):u.set(u.key,v,u.type))}})(this,t)}}if(this.removeText(),t&&!n&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const r=this.anchor.getNode();r.isEmpty()&&tt(r.getParent())&&r.getPreviousSibling()===null&&xp(this,r)}}deleteLine(t){this.isCollapsed()&&this.modify("extend",t,"lineboundary"),this.isCollapsed()?this.deleteCharacter(t):this.removeText()}deleteWord(t){if(this.isCollapsed()){const n=this.anchor,r=n.getNode();if(this.forwardDeletion(n,r,t))return;this.modify("extend",t,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function gt(e){return e instanceof rl}function _p(e){const t=e.offset;if(e.type==="text")return t;const n=e.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function $u(e){const t=e.getStartEndPoints();if(t===null)return[0,0];const[n,r]=t;return n.type==="element"&&r.type==="element"&&n.key===r.key&&n.offset===r.offset?[0,0]:[_p(n),_p(r)]}function xp(e,t){for(let n=t;n;n=n.getParent()){if(V(n)){if(n.collapseAtStart(e))return!0;if(dt(n))break}if(n.getPreviousSibling())break}return!1}const Kk=(()=>{try{const e=new RegExp("\\p{Emoji}","u"),t=e.test.bind(e);if(t("❤️")&&t("#️⃣")&&t("👍"))return t}catch{}return()=>!1})();function bp(e,t,n){const r=e,o=r.getTextContent().split(/(?=\s)/g),i=o.length;let s=0,a=0;for(let c=0;c<i;c++){const u=c===i-1;if(a=s,s+=o[c].length,t&&s===n||s>n||u){o.splice(c,1),u&&(a=void 0);break}}const l=o.join("").trim();l===""?r.remove():(r.setTextContent(l),r.select(a,a))}function Cp(e,t,n,r){let o,i=t;if(je(e)){let s=!1;const a=e.childNodes,l=a.length,c=r._blockCursorElement;i===l&&(s=!0,i=l-1);let u=a[i],f=!1;if(u===c)u=a[i+1],f=!0;else if(c!==null){const d=c.parentNode;e===d&&t>Array.prototype.indexOf.call(d.children,c)&&i--}if(o=Lo(u),Y(o))i=Tn(o,s?"next":"previous");else{let d=Lo(e);if(d===null)return null;if(V(d)){const h=r.getElementByKey(d.getKey());h===null&&U(214),[d,i]=d.getDOMSlot(h).resolveChildIndex(d,h,e,t),V(d)||U(215),s&&i>=d.getChildrenSize()&&(i=Math.max(0,d.getChildrenSize()-1));let p=d.getChildAtIndex(i);if(V(p)&&(function(m,_,y){const v=m.getParent();return y===null||v===null||!v.canBeEmpty()||v!==y.getNode()})(p,0,n)){const m=s?p.getLastDescendant():p.getFirstDescendant();m===null?d=p:(p=m,d=V(p)?p:p.getParentOrThrow()),i=0}Y(p)?(o=p,d=null,i=Tn(p,s?"next":"previous")):p!==d&&s&&!f&&(V(d)||U(216),i=Math.min(d.getChildrenSize(),i+1))}else{const h=d.getIndexWithinParent();i=t===0&&Ce(d)&&Lo(e)===d?h:h+1,d=d.getParentOrThrow()}if(V(d))return Pt(d.__key,i,"element")}}else o=Lo(e);return Y(o)?Pt(o.__key,Tn(o,i,"clamp"),"text"):null}function wp(e,t,n){const r=e.offset,o=e.getNode();if(r===0){const i=o.getPreviousSibling(),s=o.getParent();if(t){if((n||!t)&&i===null&&V(s)&&s.isInline()){const a=s.getPreviousSibling();Y(a)&&e.set(a.__key,a.getTextContent().length,"text")}}else V(i)&&!n&&i.isInline()?e.set(i.__key,i.getChildrenSize(),"element"):Y(i)&&e.set(i.__key,i.getTextContent().length,"text")}else if(r===o.getTextContent().length){const i=o.getNextSibling(),s=o.getParent();if(t&&V(i)&&i.isInline())e.set(i.__key,0,"element");else if((n||t)&&i===null&&V(s)&&s.isInline()&&!s.canInsertTextAfter()){const a=s.getNextSibling();Y(a)&&e.set(a.__key,0,"text")}}}function M_(e,t,n){if(e.type==="text"&&t.type==="text"){const r=e.isBefore(t),o=e.is(t);wp(e,r,o),wp(t,!r,o),o&&t.set(e.key,e.offset,e.type);const i=Fe();if(i.isComposing()&&i._compositionKey!==e.key&&W(n)){const s=n.anchor,a=n.focus;e.set(s.key,s.offset,s.type,!0),t.set(a.key,a.offset,a.type,!0)}}}function N_(e,t,n,r,o,i){if(e===null||n===null||!ds(o,e,n))return null;const s=Cp(e,t,W(i)?i.anchor:null,o);if(s===null)return null;const a=Cp(n,r,W(i)?i.focus:null,o);if(a===null)return null;if(s.type==="element"&&a.type==="element"){const l=Lo(e),c=Lo(n);if(Ce(l)&&Ce(c))return null}return M_(s,a,i),[s,a]}function Du(e){return V(e)&&!e.isInline()}function P_(e,t,n,r,o,i){const s=wr(),a=new ao(Pt(e,t,o),Pt(n,r,i),0,"");return a.dirty=!0,s._selection=a,a}function ol(){const e=Pt("root",0,"element"),t=Pt("root",0,"element");return new ao(e,t,0,"")}function gf(){return new rl(new Set)}function Uk(e,t){return il(null,e,t,null)}function il(e,t,n,r){const o=n._window;if(o===null)return null;const i=r||o.event,s=i?i.type:void 0,a=s==="selectionchange",l=!xu&&(a||s==="beforeinput"||s==="compositionstart"||s==="compositionend"||s==="click"&&i&&i.detail===3||s==="drop"||s===void 0);let c,u,f,d;if(W(e)&&!l)return e.clone();if(t===null)return null;if(c=t.anchorNode,u=t.focusNode,f=t.anchorOffset,d=t.focusOffset,(a||s===void 0)&&W(e)&&!ds(n,c,u))return e.clone();const h=N_(c,f,u,d,n,e);if(h===null)return null;const[g,p]=h;return new ao(g,p,W(e)?e.format:0,W(e)?e.style:"")}function G(){return wr()._selection}function An(){return Fe()._editorState._selection}function ka(e,t,n,r=1){const o=e.anchor,i=e.focus,s=o.getNode(),a=i.getNode();if(!t.is(s)&&!t.is(a))return;const l=t.__key;if(e.isCollapsed()){const c=o.offset;if(n<=c&&r>0||n<c&&r<0){const u=Math.max(0,c+r);o.set(l,u,"element"),i.set(l,u,"element"),Sp(e)}}else{const c=e.isBackward(),u=c?i:o,f=u.getNode(),d=c?o:i,h=d.getNode();if(t.is(f)){const g=u.offset;(n<=g&&r>0||n<g&&r<0)&&u.set(l,Math.max(0,g+r),"element")}if(t.is(h)){const g=d.offset;(n<=g&&r>0||n<g&&r<0)&&d.set(l,Math.max(0,g+r),"element")}}Sp(e)}function Sp(e){const t=e.anchor,n=t.offset,r=e.focus,o=r.offset,i=t.getNode(),s=r.getNode();if(e.isCollapsed()){if(!V(i))return;const a=i.getChildrenSize(),l=n>=a,c=l?i.getChildAtIndex(a-1):i.getChildAtIndex(n);if(Y(c)){let u=0;l&&(u=c.getTextContentSize()),t.set(c.__key,u,"text"),r.set(c.__key,u,"text")}return}if(V(i)){const a=i.getChildrenSize(),l=n>=a,c=l?i.getChildAtIndex(a-1):i.getChildAtIndex(n);if(Y(c)){let u=0;l&&(u=c.getTextContentSize()),t.set(c.__key,u,"text")}}if(V(s)){const a=s.getChildrenSize(),l=o>=a,c=l?s.getChildAtIndex(a-1):s.getChildAtIndex(o);if(Y(c)){let u=0;l&&(u=c.getTextContentSize()),r.set(c.__key,u,"text")}}}function Aa(e,t,n,r,o){let i=null,s=0,a=null;r!==null?(i=r.__key,Y(r)?(s=r.getTextContentSize(),a="text"):V(r)&&(s=r.getChildrenSize(),a="element")):o!==null&&(i=o.__key,Y(o)?a="text":V(o)&&(a="element")),i!==null&&a!==null?e.set(i,s,a):(s=t.getIndexWithinParent(),s===-1&&(s=n.getChildrenSize()),e.set(n.__key,s,"element"))}function Ep(e,t,n,r,o){e.type==="text"?e.set(n,e.offset+(t?0:o),"text"):e.offset>r.getIndexWithinParent()&&e.set(e.key,e.offset-1,"element")}function F_(e,t,n,r,o){try{e.setBaseAndExtent(t,n,r,o)}catch{}}function Gk(e,t,n,r,o,i,s){const a=r.anchorNode,l=r.focusNode,c=r.anchorOffset,u=r.focusOffset,f=document.activeElement;if(o.has(R_)&&f!==i||f!==null&&bf(f))return;if(!W(t))return void(e!==null&&ds(n,a,l)&&r.removeAllRanges());const d=t.anchor,h=t.focus,g=d.key,p=h.key,m=Jr(n,g),_=Jr(n,p),y=d.offset,v=h.offset,x=t.format,b=t.style,w=t.isCollapsed();let T=m,E=_,R=!1;if(d.type==="text"){T=Jo(m);const B=d.getNode();R=B.getFormat()!==x||B.getStyle()!==b}else W(e)&&e.anchor.type==="text"&&(R=!0);var M,O,D,I,L;if(h.type==="text"&&(E=Jo(_)),T!==null&&E!==null&&(w&&(e===null||R||W(e)&&(e.format!==x||e.style!==b))&&(M=x,O=b,D=y,I=g,L=performance.now(),x_=[M,O,D,I,L]),c!==y||u!==v||a!==T||l!==E||r.type==="Range"&&w||(f!==null&&i.contains(f)||o.has($k)||i.focus({preventScroll:!0}),d.type==="element"))){if(F_(r,T,y,E,v),!o.has(Ok)&&t.isCollapsed()&&i!==null&&i===document.activeElement){const B=W(t)&&t.anchor.type==="element"?T.childNodes[y]||null:r.rangeCount>0?r.getRangeAt(0):null;if(B!==null){let K;if(B instanceof Text){const P=document.createRange();P.selectNode(B),K=P.getBoundingClientRect()}else K=B.getBoundingClientRect();(function(P,A,$){const H=ex($),Q=Rf(H);if(H===null||Q===null)return;let{top:J,bottom:X}=A,se=0,re=0,he=$;for(;he!==null;){const we=he===H.body;if(we)se=0,re=qt(P).innerHeight;else{const ye=he.getBoundingClientRect();se=ye.top,re=ye.bottom}let te=0;if(J<se?te=-(se-J):X>re&&(te=X-re),te!==0)if(we)Q.scrollBy(0,te);else{const ye=he.scrollTop;he.scrollTop+=te;const Se=he.scrollTop-ye;J-=Se,X-=Se}if(we)break;he=fs(he)}})(n,K,i)}}Pu=!0}}function pf(e){let t=G()||An();t===null&&(t=Ke().selectEnd()),t.insertNodes(e)}function oc(e){let t=e;e.isCollapsed()||t.removeText();const n=G();W(n)&&(t=n),W(t)||U(161);const r=t.anchor;let o=r.getNode(),i=r.offset;for(;!nr(o);){const s=o;if([o,i]=qk(o,i),s.is(o))break}return i}function qk(e,t){const n=e.getParent();if(!n){const o=me();return Ke().append(o),o.select(),[Ke(),0]}if(Y(e)){const o=e.splitText(t);if(o.length===0)return[n,e.getIndexWithinParent()];const i=t===0?0:1;return[n,o[0].getIndexWithinParent()+i]}if(!V(e)||t===0)return[n,e.getIndexWithinParent()];const r=e.getChildAtIndex(t);if(r){const o=new ao(Pt(e.__key,t,"element"),Pt(e.__key,t,"element"),0,""),i=e.insertNewAfter(o);i&&i.append(r,...r.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}function Tp(e,t,n,r,o="decorators-and-blocks"){if(t==="move"&&r==="character"&&!e.isCollapsed()){const[u,f]=n===e.isBackward()?[e.focus,e.anchor]:[e.anchor,e.focus];return f.set(u.key,u.offset,u.type),!0}const i=ln(e.focus,n?"previous":"next"),s=r==="lineboundary",a=t==="move";let l=i,c=o==="decorators-and-blocks";if(!Ff(l)){for(const u of l){c=!1;const{origin:f}=u;if(!Ce(f)||f.isIsolated()||(l=u,!s||!f.isInline()))break}if(c)for(const u of Qi(i).iterNodeCarets(t==="extend"?"shadowRoot":"root")){if(At(u))u.origin.isInline()||(l=u);else{if(V(u.origin))continue;Ce(u.origin)&&!u.origin.isInline()&&(l=u)}break}}if(l===i)return!1;if(a&&!s&&Ce(l.origin)&&l.origin.isKeyboardSelectable()){const u=gf();return u.add(l.origin.getKey()),He(u),!0}return l=bt(l),a&&nn(e.anchor,l),nn(e.focus,l),c||!s}let at=null,lt=null,kt=!1,ic=!1,ra=0;const Rp={characterData:!0,childList:!0,subtree:!0};function li(){return kt||at!==null&&at._readOnly}function st(){kt&&U(13)}function L_(){ra>99&&U(14)}function wr(){return at===null&&U(195,O_()),at}function Fe(){return lt===null&&U(196,O_()),lt}function O_(){let e=0;const t=new Set,n=Xo.version;if(typeof window<"u")for(const o of document.querySelectorAll("[contenteditable]")){const i=al(o);if(Cf(i))e++;else if(i){let s=String(i.constructor.version||"<0.17.1");s===n&&(s+=" (separately built, likely a bundler configuration issue)"),t.add(s)}}let r=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(r+=` and incompatible editors with versions ${Array.from(t).join(", ")}`),r}function Yk(){return lt}function kp(e,t,n){const r=t.__type,o=B_(e,r);let i=n.get(r);i===void 0&&(i=Array.from(o.transforms),n.set(r,i));const s=i.length;for(let a=0;a<s&&(i[a](t),t.isAttached());a++);}function Ap(e,t){return e!==void 0&&e.__key!==t&&e.isAttached()}function I_(e,t){if(!t)return;const n=e._updateTags;let r=t;Array.isArray(t)||(r=[t]);for(const o of r)n.add(o)}function Xk(e){return mf(e,Fe()._nodes)}function mf(e,t){const n=e.type,r=t.get(n);r===void 0&&U(17,n);const o=r.klass;e.type!==o.getType()&&U(18,o.name);const i=o.importJSON(e),s=e.children;if(V(i)&&Array.isArray(s))for(let a=0;a<s.length;a++){const l=mf(s[a],t);i.append(l)}return i}function Mp(e,t,n){const r=at,o=kt,i=lt;at=t,kt=!0,lt=e;try{return n()}finally{at=r,kt=o,lt=i}}function Vn(e,t){const n=e._pendingEditorState,r=e._rootElement,o=e._headless||r===null;if(n===null)return;const i=e._editorState,s=i._selection,a=n._selection,l=e._dirtyType!==0,c=at,u=kt,f=lt,d=e._updating,h=e._observer;let g=null;if(e._pendingEditorState=null,e._editorState=n,!o&&l&&h!==null){lt=e,at=n,kt=!1,e._updating=!0;try{const w=e._dirtyType,T=e._dirtyElements,E=e._dirtyLeaves;h.disconnect(),g=_k(i,n,e,w,T,E)}catch(w){if(w instanceof Error&&e._onError(w),ic)throw w;return V_(e,null,r,n),J0(e),e._dirtyType=2,ic=!0,Vn(e,i),void(ic=!1)}finally{h.observe(r,Rp),e._updating=d,at=c,kt=u,lt=f}}n._readOnly||(n._readOnly=!0);const p=e._dirtyLeaves,m=e._dirtyElements,_=e._normalizedNodes,y=e._updateTags,v=e._deferred;l&&(e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements=new Map,e._normalizedNodes=new Set,e._updateTags=new Set),(function(w,T){const E=w._decorators;let R=w._pendingDecorators||E;const M=T._nodeMap;let O;for(O in R)M.has(O)||(R===E&&(R=q_(w)),delete R[O])})(e,n);const x=o?null:St(qt(e));if(e._editable&&x!==null&&(l||a===null||a.dirty||!a.is(s))&&r!==null&&!y.has(Ik)){lt=e,at=n;try{if(h!==null&&h.disconnect(),l||a===null||a.dirty){const w=e._blockCursorElement;w!==null&&zu(w,e,r),Gk(s,a,e,x,y,r)}(function(w,T,E){let R=w._blockCursorElement;if(W(E)&&E.isCollapsed()&&E.anchor.type==="element"&&T.contains(document.activeElement)){const M=E.anchor,O=M.getNode(),D=M.offset;let I=!1,L=null;if(D===O.getChildrenSize())ac(O.getChildAtIndex(D-1))&&(I=!0);else{const B=O.getChildAtIndex(D);if(B!==null&&ac(B)){const K=B.getPreviousSibling();(K===null||ac(K))&&(I=!0,L=w.getElementByKey(B.__key))}}if(I){const B=w.getElementByKey(O.__key);return R===null&&(w._blockCursorElement=R=(function(K){const P=K.theme,A=document.createElement("div");A.contentEditable="false",A.setAttribute("data-lexical-cursor","true");let $=P.blockCursor;if($!==void 0){if(typeof $=="string"){const H=U0($);$=P.blockCursor=H}$!==void 0&&A.classList.add(...$)}return A})(w._config)),T.style.caretColor="transparent",void(L===null?B.appendChild(R):B.insertBefore(R,L))}}R!==null&&zu(R,w,T)})(e,r,a)}finally{h!==null&&h.observe(r,Rp),lt=f,at=c}}g!==null&&(function(w,T,E,R,M){const O=Array.from(w._listeners.mutation),D=O.length;for(let I=0;I<D;I++){const[L,B]=O[I];for(const K of B){const P=T.get(K);P!==void 0&&L(P,{dirtyLeaves:R,prevEditorState:M,updateTags:E})}}})(e,g,y,p,i),W(a)||a===null||s!==null&&s.is(a)||e.dispatchCommand(zn,void 0);const b=e._pendingDecorators;b!==null&&(e._decorators=b,e._pendingDecorators=null,$i("decorator",e,!0,b)),(function(w,T,E){const R=Lp(T),M=Lp(E);R!==M&&$i("textcontent",w,!0,M)})(e,t||i,n),$i("update",e,!0,{dirtyElements:m,dirtyLeaves:p,editorState:n,mutatedNodes:g,normalizedNodes:_,prevEditorState:t||i,tags:y}),(function(w,T){if(w._deferred=[],T.length!==0){const E=w._updating;w._updating=!0;try{for(let R=0;R<T.length;R++)T[R]()}finally{w._updating=E}}})(e,v),(function(w){const T=w._updates;if(T.length!==0){const E=T.shift();if(E){const[R,M]=E;sl(w,R,M)}}})(e)}function $i(e,t,n,...r){const o=t._updating;t._updating=n;try{const i=Array.from(t._listeners[e]);for(let s=0;s<i.length;s++)i[s].apply(null,r)}finally{t._updating=o}}function Np(e,t){const n=e._updates;let r=t||!1;for(;n.length!==0;){const o=n.shift();if(o){const[i,s]=o,a=e._pendingEditorState;let l;s!==void 0&&(l=s.onUpdate,s.skipTransforms&&(r=!0),s.discrete&&(a===null&&U(191),a._flushSync=!0),l&&e._deferred.push(l),I_(e,s.tag)),a==null?sl(e,i,s):i()}}return r}function sl(e,t,n){const r=e._updateTags;let o,i=!1,s=!1;n!==void 0&&(o=n.onUpdate,I_(e,n.tag),i=n.skipTransforms||!1,s=n.discrete||!1),o&&e._deferred.push(o);const a=e._editorState;let l=e._pendingEditorState,c=!1;(l===null||l._readOnly)&&(l=e._pendingEditorState=$_(l||a),c=!0),l._flushSync=s;const u=at,f=kt,d=lt,h=e._updating;at=l,kt=!1,e._updating=!0,lt=e;const g=e._headless||e.getRootElement()===null;_f(null);try{c&&(g?a._selection!==null&&(l._selection=a._selection.clone()):l._selection=(function(y,v){const x=y.getEditorState()._selection,b=St(qt(y));return W(x)||x==null?il(x,b,y,v):x.clone()})(e,n&&n.event||null));const m=e._compositionKey;t(),i=Np(e,i),(function(y,v){const x=v.getEditorState()._selection,b=y._selection;if(W(b)){const w=b.anchor,T=b.focus;let E;if(w.type==="text"&&(E=w.getNode(),E.selectionTransform(x,b)),T.type==="text"){const R=T.getNode();E!==R&&R.selectionTransform(x,b)}}})(l,e),e._dirtyType!==0&&(i?(function(y,v){const x=v._dirtyLeaves,b=y._nodeMap;for(const w of x){const T=b.get(w);Y(T)&&T.isAttached()&&T.isSimpleText()&&!T.isUnmergeable()&&ap(T)}})(l,e):(function(y,v){const x=v._dirtyLeaves,b=v._dirtyElements,w=y._nodeMap,T=rr(),E=new Map;let R=x,M=R.size,O=b,D=O.size;for(;M>0||D>0;){if(M>0){v._dirtyLeaves=new Set;for(const I of R){const L=w.get(I);Y(L)&&L.isAttached()&&L.isSimpleText()&&!L.isUnmergeable()&&ap(L),L!==void 0&&Ap(L,T)&&kp(v,L,E),x.add(I)}if(R=v._dirtyLeaves,M=R.size,M>0){ra++;continue}}v._dirtyLeaves=new Set,v._dirtyElements=new Map,O.delete("root")&&O.set("root",!0);for(const I of O){const L=I[0],B=I[1];if(b.set(L,B),!B)continue;const K=w.get(L);K!==void 0&&Ap(K,T)&&kp(v,K,E)}R=v._dirtyLeaves,M=R.size,O=v._dirtyElements,D=O.size,ra++}v._dirtyLeaves=x,v._dirtyElements=b})(l,e),Np(e),(function(y,v,x,b){const w=y._nodeMap,T=v._nodeMap,E=[];for(const[R]of b){const M=T.get(R);M!==void 0&&(M.isAttached()||(V(M)&&q0(M,R,w,T,E,b),w.has(R)||b.delete(R),E.push(R)))}for(const R of E)T.delete(R);for(const R of x){const M=T.get(R);M===void 0||M.isAttached()||(w.has(R)||x.delete(R),T.delete(R))}})(a,l,e._dirtyLeaves,e._dirtyElements)),m!==e._compositionKey&&(l._flushSync=!0);const _=l._selection;if(W(_)){const y=l._nodeMap,v=_.anchor.key,x=_.focus.key;y.get(v)!==void 0&&y.get(x)!==void 0||U(19)}else gt(_)&&_._nodes.size===0&&(l._selection=null)}catch(m){return m instanceof Error&&e._onError(m),e._pendingEditorState=a,e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),void Vn(e)}finally{at=u,kt=f,lt=d,e._updating=h,ra=0}e._dirtyType!==0||e._deferred.length>0||(function(m,_){const y=_.getEditorState()._selection,v=m._selection;if(v!==null){if(v.dirty||!v.is(y))return!0}else if(y!==null)return!0;return!1})(l,e)?l._flushSync?(l._flushSync=!1,Vn(e)):c&&n3(()=>{Vn(e)}):(l._flushSync=!1,c&&(r.clear(),e._deferred=[],e._pendingEditorState=null))}function Sn(e,t,n){lt===e&&n===void 0?t():sl(e,t,n)}class Di{element;before;after;constructor(t,n,r){this.element=t,this.before=n||null,this.after=r||null}withBefore(t){return new Di(this.element,t,this.after)}withAfter(t){return new Di(this.element,this.before,t)}withElement(t){return this.element===t?this:new Di(t,this.before,this.after)}insertChild(t){const n=this.before||this.getManagedLineBreak();return n!==null&&n.parentElement!==this.element&&U(222),this.element.insertBefore(t,n),this}removeChild(t){return t.parentElement!==this.element&&U(223),this.element.removeChild(t),this}replaceChild(t,n){return n.parentElement!==this.element&&U(224),this.element.replaceChild(t,n),this}getFirstChild(){const t=this.after?this.after.nextSibling:this.element.firstChild;return t===this.before||t===this.getManagedLineBreak()?null:t}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(t){if(t===null)this.removeManagedLineBreak();else{const n=t==="decorator"&&(ls||oi||as);this.insertManagedLineBreak(n)}}removeManagedLineBreak(){const t=this.getManagedLineBreak();if(t){const n=this.element,r=t.nodeName==="IMG"?t.nextSibling:null;r&&n.removeChild(r),n.removeChild(t),n.__lexicalLineBreak=void 0}}insertManagedLineBreak(t){const n=this.getManagedLineBreak();if(n){if(t===(n.nodeName==="IMG"))return;this.removeManagedLineBreak()}const r=this.element,o=this.before,i=document.createElement("br");if(r.insertBefore(i,o),t){const s=document.createElement("img");s.setAttribute("data-lexical-linebreak","true"),s.style.cssText="display: inline !important; border: 0px !important; margin: 0px !important;",s.alt="",r.insertBefore(s,i),r.__lexicalLineBreak=s}else r.__lexicalLineBreak=i}getFirstChildOffset(){let t=0;for(let n=this.after;n!==null;n=n.previousSibling)t++;return t}resolveChildIndex(t,n,r,o){if(r===this.element){const l=this.getFirstChildOffset();return[t,Math.min(l+t.getChildrenSize(),Math.max(l,o))]}const i=Pp(n,r);i.push(o);const s=Pp(n,this.element);let a=t.getIndexWithinParent();for(let l=0;l<s.length;l++){const c=i[l],u=s[l];if(c===void 0||c<u)break;if(c>u){a+=1;break}}return[t.getParentOrThrow(),a]}}function Pp(e,t){const n=[];let r=t;for(;r!==e&&r!==null;r=r.parentNode){let o=0;for(let i=r.previousSibling;i!==null;i=i.previousSibling)o++;n.push(o)}return r!==e&&U(225),n.reverse()}class yt extends Cn{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;constructor(t){super(t),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle=""}afterCloneFrom(t){super.afterCloneFrom(t),this.__key===t.__key&&(this.__first=t.__first,this.__last=t.__last,this.__size=t.__size),this.__indent=t.__indent,this.__format=t.__format,this.__style=t.__style,this.__dir=t.__dir,this.__textFormat=t.__textFormat,this.__textStyle=t.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){const t=this.getFormat();return ik[t]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){const t=[];let n=this.getFirstChild();for(;n!==null;)t.push(n),n=n.getNextSibling();return t}getChildrenKeys(){const t=[];let n=this.getFirstChild();for(;n!==null;)t.push(n.__key),n=n.getNextSibling();return t}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){const t=Fe()._dirtyElements;return t!==null&&t.has(this.__key)}isLastChild(){const t=this.getLatest(),n=this.getParentOrThrow().getLastChild();return n!==null&&n.is(t)}getAllTextNodes(){const t=[];let n=this.getFirstChild();for(;n!==null;){if(Y(n)&&t.push(n),V(n)){const r=n.getAllTextNodes();t.push(...r)}n=n.getNextSibling()}return t}getFirstDescendant(){let t=this.getFirstChild();for(;V(t);){const n=t.getFirstChild();if(n===null)break;t=n}return t}getLastDescendant(){let t=this.getLastChild();for(;V(t);){const n=t.getLastChild();if(n===null)break;t=n}return t}getDescendantByIndex(t){const n=this.getChildren(),r=n.length;if(t>=r){const i=n[r-1];return V(i)&&i.getLastDescendant()||i||null}const o=n[t];return V(o)&&o.getFirstDescendant()||o||null}getFirstChild(){const t=this.getLatest().__first;return t===null?null:Me(t)}getFirstChildOrThrow(){const t=this.getFirstChild();return t===null&&U(45,this.__key),t}getLastChild(){const t=this.getLatest().__last;return t===null?null:Me(t)}getLastChildOrThrow(){const t=this.getLastChild();return t===null&&U(96,this.__key),t}getChildAtIndex(t){const n=this.getChildrenSize();let r,o;if(t<n/2){for(r=this.getFirstChild(),o=0;r!==null&&o<=t;){if(o===t)return r;r=r.getNextSibling(),o++}return null}for(r=this.getLastChild(),o=n-1;r!==null&&o>=t;){if(o===t)return r;r=r.getPreviousSibling(),o--}return null}getTextContent(){let t="";const n=this.getChildren(),r=n.length;for(let o=0;o<r;o++){const i=n[o];t+=i.getTextContent(),V(i)&&o!==r-1&&!i.isInline()&&(t+=hr)}return t}getTextContentSize(){let t=0;const n=this.getChildren(),r=n.length;for(let o=0;o<r;o++){const i=n[o];t+=i.getTextContentSize(),V(i)&&o!==r-1&&!i.isInline()&&(t+=2)}return t}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(t){if(t!==""){const n=Qg[t];return(this.getFormat()&n)!==0}return!1}hasTextFormat(t){const n=gr[t];return(this.getTextFormat()&n)!==0}getFormatFlags(t,n){return Ma(this.getLatest().__textFormat,t,n)}getTextStyle(){return this.getLatest().__textStyle}select(t,n){st();const r=G();let o=t,i=n;const s=this.getChildrenSize();if(!this.canBeEmpty()){if(t===0&&n===0){const l=this.getFirstChild();if(Y(l)||V(l))return l.select(0,0)}else if(!(t!==void 0&&t!==s||n!==void 0&&n!==s)){const l=this.getLastChild();if(Y(l)||V(l))return l.select()}}o===void 0&&(o=s),i===void 0&&(i=s);const a=this.__key;return W(r)?(r.anchor.set(a,o,"element"),r.focus.set(a,i,"element"),r.dirty=!0,r):P_(a,o,a,i,"element","element")}selectStart(){const t=this.getFirstDescendant();return t?t.selectStart():this.select()}selectEnd(){const t=this.getLastDescendant();return t?t.selectEnd():this.select()}clear(){const t=this.getWritable();return this.getChildren().forEach(n=>n.remove()),t}append(...t){return this.splice(this.getChildrenSize(),0,t)}setDirection(t){const n=this.getWritable();return n.__dir=t,n}setFormat(t){return this.getWritable().__format=t!==""?Qg[t]:0,this}setStyle(t){return this.getWritable().__style=t||"",this}setTextFormat(t){const n=this.getWritable();return n.__textFormat=t,n}setTextStyle(t){const n=this.getWritable();return n.__textStyle=t,n}setIndent(t){return this.getWritable().__indent=t,this}splice(t,n,r){Ra(this)&&U(324,this.__key,this.__type);const o=this.getChildrenSize(),i=this.getWritable();t+n<=o||U(226,String(t),String(n),String(o));const s=i.__key,a=[],l=[],c=this.getChildAtIndex(t+n);let u=null,f=o-n+r.length;if(t!==0)if(t===o)u=this.getLastChild();else{const h=this.getChildAtIndex(t);h!==null&&(u=h.getPreviousSibling())}if(n>0){let h=u===null?this.getFirstChild():u.getNextSibling();for(let g=0;g<n;g++){h===null&&U(100);const p=h.getNextSibling(),m=h.__key;Kr(h.getWritable()),l.push(m),h=p}}let d=u;for(const h of r){d!==null&&h.is(d)&&(u=d=d.getPreviousSibling());const g=h.getWritable();g.__parent===s&&f--,Kr(g);const p=h.__key;if(d===null)i.__first=p,g.__prev=null;else{const m=d.getWritable();m.__next=p,g.__prev=m.__key}h.__key===s&&U(76),g.__parent=s,a.push(p),d=h}if(t+n===o)d!==null&&(d.getWritable().__next=null,i.__last=d.__key);else if(c!==null){const h=c.getWritable();if(d!==null){const g=d.getWritable();h.__prev=d.__key,g.__next=c.__key}else h.__prev=null}if(i.__size=f,l.length){const h=G();if(W(h)){const g=new Set(l),p=new Set(a),{anchor:m,focus:_}=h;Fp(m,g,p)&&Aa(m,m.getNode(),this,u,c),Fp(_,g,p)&&Aa(_,_.getNode(),this,u,c),f!==0||this.canBeEmpty()||dt(this)||this.remove()}}return i}getDOMSlot(t){return new Di(t)}exportDOM(t){const{element:n}=super.exportDOM(t);if(je(n)){const r=this.getIndent();r>0&&(n.style.paddingInlineStart=40*r+"px");const o=this.getDirection();o&&(n.dir=o)}return{element:n}}exportJSON(){const t={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},n=this.getTextFormat(),r=this.getTextStyle();return n===0&&r===""||dt(this)||this.getChildren().some(Y)||(n!==0&&(t.textFormat=n),r!==""&&(t.textStyle=r)),t}updateFromJSON(t){return super.updateFromJSON(t).setFormat(t.format).setIndent(t.indent).setDirection(t.direction).setTextFormat(t.textFormat||0).setTextStyle(t.textStyle||"")}insertNewAfter(t,n){return null}canIndent(){return!0}collapseAtStart(t){return!1}excludeFromCopy(t){return!1}canReplaceWith(t){return!0}canInsertAfter(t){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(t){return!1}extractWithChild(t,n,r){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(t,n){const r=this.getDOMSlot(t);let o=r.getFirstChild();for(let i=this.getFirstChild();i;i=i.getNextSibling()){const s=n.getElementByKey(i.getKey());s!==null&&(o==null?(r.insertChild(s),o=s):o!==s&&r.replaceChild(s,o),o=o.nextSibling)}}}function V(e){return e instanceof yt}function Fp(e,t,n){let r=e.getNode();for(;r;){const o=r.__key;if(t.has(o)&&!n.has(o))return!0;r=r.getParent()}return!1}class cs extends Cn{decorate(t,n){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function Ce(e){return e instanceof cs}class ci extends yt{__cachedText;static getType(){return"root"}static clone(){return new ci}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){U(51)}getTextContent(){const t=this.__cachedText;return!li()&&Fe()._dirtyType!==0||t===null?super.getTextContent():t}remove(){U(52)}replace(t){U(53)}insertBefore(t){U(54)}insertAfter(t){U(55)}updateDOM(t,n){return!1}splice(t,n,r){for(const o of r)V(o)||Ce(o)||U(282);return super.splice(t,n,r)}static importJSON(t){return Ke().updateFromJSON(t)}collapseAtStart(){return!0}}function tt(e){return e instanceof ci}function $_(e){return new us(new Map(e._nodeMap))}function yf(){return new us(new Map([["root",new ci]]))}function D_(e){const t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&U(130,n.name),V(e)){const r=t.children;Array.isArray(r)||U(59,n.name);const o=e.getChildren();for(let i=0;i<o.length;i++){const s=D_(o[i]);r.push(s)}}return t}function Jk(e){return e instanceof us}class us{_nodeMap;_selection;_flushSync;_readOnly;constructor(t,n){this._nodeMap=t,this._selection=n||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(t,n){return Mp(n&&n.editor||null,this,t)}clone(t){const n=new us(this._nodeMap,t===void 0?this._selection:t);return n._readOnly=!0,n}toJSON(){return Mp(null,this,()=>({root:D_(Ke())}))}}class vf extends yt{static getType(){return"artificial"}createDOM(t){return document.createElement("div")}}class lo extends yt{static getType(){return"paragraph"}static clone(t){return new lo(t.__key)}createDOM(t){const n=document.createElement("p"),r=jo(t.theme,"paragraph");return r!==void 0&&n.classList.add(...r),n}updateDOM(t,n,r){return!1}static importDOM(){return{p:t=>({conversion:Zk,priority:0})}}exportDOM(t){const{element:n}=super.exportDOM(t);if(je(n)){this.isEmpty()&&n.append(document.createElement("br"));const r=this.getFormatType();r&&(n.style.textAlign=r)}return{element:n}}static importJSON(t){return me().updateFromJSON(t)}exportJSON(){const t=super.exportJSON();if(t.textFormat===void 0||t.textStyle===void 0){const n=this.getChildren().find(Y);n?(t.textFormat=n.getFormat(),t.textStyle=n.getStyle()):(t.textFormat=this.getTextFormat(),t.textStyle=this.getTextStyle())}return t}insertNewAfter(t,n){const r=me();r.setTextFormat(t.format),r.setTextStyle(t.style);const o=this.getDirection();return r.setDirection(o),r.setFormat(this.getFormatType()),r.setStyle(this.getStyle()),this.insertAfter(r,n),r}collapseAtStart(){const t=this.getChildren();if(t.length===0||Y(t[0])&&t[0].getTextContent().trim()===""){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}}function Zk(e){const t=me();return e.style&&(t.setFormat(e.style.textAlign),kf(e,t)),{node:t}}function me(){return vt(new lo)}function Sr(e){return e instanceof lo}const _e=0,jn=1,Et=3,Qk=4;function V_(e,t,n,r){const o=e._keyToDOMMap;o.clear(),e._editorState=yf(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,e._updateTags=new Set,e._updates=[],e._blockCursorElement=null;const i=e._observer;i!==null&&(i.disconnect(),e._observer=null),t!==null&&(t.textContent=""),n!==null&&(n.textContent="",o.set("root",n))}function e3(e){const t=new Set,n=new Set;let r=e;for(;r;){const{ownNodeConfig:o}=ul(r),i=r.transform;if(!n.has(i)){n.add(i);const s=r.transform();s&&t.add(s)}if(o){const s=o.$transform;s&&t.add(s),r=o.extends}else{const s=Object.getPrototypeOf(r);r=s.prototype instanceof Cn&&s!==Cn?s:void 0}}return t}function j_(e){const t=e||{},n=Yk(),r=t.theme||{},o=e===void 0?n:t.parentEditor||null,i=t.disableEvents||!1,s=yf(),a=t.namespace||(o!==null?o._config.namespace:J_()),l=t.editorState,c=[ci,Gt,ii,si,lo,vf,...t.nodes||[]],{onError:u,html:f}=t,d=t.editable===void 0||t.editable;let h;if(e===void 0&&n!==null)h=n._nodes;else{h=new Map;for(let p=0;p<c.length;p++){let m=c[p],_=null,y=null;if(typeof m!="function"){const b=m;m=b.replace,_=b.with,y=b.withKlass||null}ul(m);const v=m.getType(),x=e3(m);h.set(v,{exportDOM:f&&f.export?f.export.get(m):void 0,klass:m,replace:_,replaceWithKlass:y,sharedNodeState:gk(c[p]),transforms:x})}}const g=new Xo(s,o,h,{disableEvents:i,namespace:a,theme:r},u||console.error,(function(p,m){const _=new Map,y=new Set,v=x=>{Object.keys(x).forEach(b=>{let w=_.get(b);w===void 0&&(w=[],_.set(b,w)),w.push(x[b])})};return p.forEach(x=>{const b=x.klass.importDOM;if(b==null||y.has(b))return;y.add(b);const w=b.call(x.klass);w!==null&&v(w)}),m&&v(m),_})(h,f?f.import:void 0),d,e);return l!==void 0&&(g._pendingEditorState=l,g._dirtyType=2),(function(p){p.registerCommand(s_,Rk,_e),p.registerCommand(a_,kk,_e),p.registerCommand(l_,Ak,_e),p.registerCommand(c_,Mk,_e),p.registerCommand(f_,Nk,_e)})(g),g}class Xo{static version;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_htmlConversions;_window;_editable;_blockCursorElement;_createEditorArgs;constructor(t,n,r,o,i,s,a,l){this._createEditorArgs=l,this._parentEditor=n,this._rootElement=null,this._editorState=t,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=o,this._nodes=r,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=J_(),this._onError=i,this._htmlConversions=s,this._editable=a,this._headless=n!==null&&n._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(t){const n=this._listeners.update;return n.add(t),()=>{n.delete(t)}}registerEditableListener(t){const n=this._listeners.editable;return n.add(t),()=>{n.delete(t)}}registerDecoratorListener(t){const n=this._listeners.decorator;return n.add(t),()=>{n.delete(t)}}registerTextContentListener(t){const n=this._listeners.textcontent;return n.add(t),()=>{n.delete(t)}}registerRootListener(t){const n=this._listeners.root;return t(this._rootElement,null),n.add(t),()=>{t(null,this._rootElement),n.delete(t)}}registerCommand(t,n,r){r===void 0&&U(35);const o=this._commands;o.has(t)||o.set(t,[new Set,new Set,new Set,new Set,new Set]);const i=o.get(t);i===void 0&&U(36,String(t));const s=i[r];return s.add(n),()=>{s.delete(n),i.every(a=>a.size===0)&&o.delete(t)}}registerMutationListener(t,n,r){const o=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(t)).klass,i=this._listeners.mutation;let s=i.get(n);s===void 0&&(s=new Set,i.set(n,s)),s.add(o);const a=r&&r.skipInitialization;return a!==void 0&&a||this.initializeMutationListener(n,o),()=>{s.delete(o),s.size===0&&i.delete(n)}}getRegisteredNode(t){const n=this._nodes.get(t.getType());return n===void 0&&U(37,t.name),n}resolveRegisteredNodeAfterReplacements(t){for(;t.replaceWithKlass;)t=this.getRegisteredNode(t.replaceWithKlass);return t}initializeMutationListener(t,n){const r=this._editorState,o=Bp(r).get(n.getType());if(!o)return;const i=new Map;for(const s of o.keys())i.set(s,"created");i.size>0&&t(i,{dirtyLeaves:new Set,prevEditorState:r,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(t,n){const r=this.getRegisteredNode(t);return r.transforms.add(n),r}registerNodeTransform(t,n){const r=this.registerNodeTransformToKlass(t,n),o=[r],i=r.replaceWithKlass;if(i!=null){const s=this.registerNodeTransformToKlass(i,n);o.push(s)}return(function(s,a){const l=Bp(s.getEditorState()),c=[];for(const u of a){const f=l.get(u);f&&c.push(f)}c.length!==0&&s.update(()=>{for(const u of c)for(const f of u.keys()){const d=Me(f);d&&d.markDirty()}},s._pendingEditorState===null?{tag:Vo}:void 0)})(this,o.map(s=>s.klass.getType())),()=>{o.forEach(s=>s.transforms.delete(n))}}hasNode(t){return this._nodes.has(t.getType())}hasNodes(t){return t.every(this.hasNode.bind(this))}dispatchCommand(t,n){return Z(this,t,n)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(t){const n=this._rootElement;if(t!==n){const r=jo(this._config.theme,"root"),o=this._pendingEditorState||this._editorState;if(this._rootElement=t,V_(this,n,t,o),n!==null&&(this._config.disableEvents||Pk(n),r!=null&&n.classList.remove(...r)),t!==null){const i=Rf(t),s=t.style;s.userSelect="text",s.whiteSpace="pre-wrap",s.wordBreak="break-word",t.setAttribute("data-lexical-editor","true"),this._window=i,this._dirtyType=2,J0(this),this._updateTags.add(Vo),Vn(this),this._config.disableEvents||(function(a,l){const c=a.ownerDocument;Nu.set(a,c);const u=Ea.get(c)??0;u<1&&c.addEventListener("selectionchange",E_),Ea.set(c,u+1),a.__lexicalEditor=l;const f=S_(a);for(let d=0;d<Mu.length;d++){const[h,g]=Mu[d],p=typeof g=="function"?m=>{gp(m)||(hp(m),(l.isEditable()||h==="click")&&g(m,l))}:m=>{if(gp(m))return;hp(m);const _=l.isEditable();switch(h){case"cut":return _&&Z(l,tl,m);case"copy":return Z(l,el,m);case"paste":return _&&Z(l,of,m);case"dragstart":return _&&Z(l,p_,m);case"dragover":return _&&Z(l,m_,m);case"dragend":return _&&Z(l,Sk,m);case"focus":return _&&Z(l,y_,m);case"blur":return _&&Z(l,Ek,m);case"drop":return _&&Z(l,g_,m)}};a.addEventListener(h,p),f.push(()=>{a.removeEventListener(h,p)})}})(t,this),r!=null&&t.classList.add(...r)}else this._window=null,this._updateTags.add(Vo),Vn(this);$i("root",this,!1,t,n)}}getElementByKey(t){return this._keyToDOMMap.get(t)||null}getEditorState(){return this._editorState}setEditorState(t,n){t.isEmpty()&&U(38);let r=t;r._readOnly&&(r=$_(t),r._selection=t._selection?t._selection.clone():null),X0(this);const o=this._pendingEditorState,i=this._updateTags,s=n!==void 0?n.tag:null;o===null||o.isEmpty()||(s!=null&&i.add(s),Vn(this)),this._pendingEditorState=r,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,s!=null&&i.add(s),this._updating||Vn(this)}parseEditorState(t,n){return(function(r,o,i){const s=yf(),a=at,l=kt,c=lt,u=o._dirtyElements,f=o._dirtyLeaves,d=o._cloneNotNeeded,h=o._dirtyType;o._dirtyElements=new Map,o._dirtyLeaves=new Set,o._cloneNotNeeded=new Set,o._dirtyType=0,at=s,kt=!1,lt=o,_f(null);try{const g=o._nodes;mf(r.root,g),i&&i(),s._readOnly=!0}catch(g){g instanceof Error&&o._onError(g)}finally{o._dirtyElements=u,o._dirtyLeaves=f,o._cloneNotNeeded=d,o._dirtyType=h,at=a,kt=l,lt=c}return s})(typeof t=="string"?JSON.parse(t):t,this,n)}read(t){return Vn(this),this.getEditorState().read(t,{editor:this})}update(t,n){(function(r,o,i){r._updating?r._updates.push([o,i]):sl(r,o,i)})(this,t,n)}focus(t,n={}){const r=this._rootElement;r!==null&&(r.setAttribute("autocapitalize","off"),Sn(this,()=>{const o=G(),i=Ke();o!==null?o.dirty||He(o.clone()):i.getChildrenSize()!==0&&(n.defaultSelection==="rootStart"?i.selectStart():i.selectEnd()),i3("focus"),s3(()=>{r.removeAttribute("autocapitalize"),t&&t()})}),this._pendingEditorState===null&&r.removeAttribute("autocapitalize"))}blur(){const t=this._rootElement;t!==null&&t.blur();const n=St(this._window);n!==null&&n.removeAllRanges()}isEditable(){return this._editable}setEditable(t){this._editable!==t&&(this._editable=t,$i("editable",this,!0,t))}toJSON(){return{editorState:this._editorState.toJSON()}}}Xo.version="0.39.0+prod.esm";let Vu=null;function _f(e){Vu=e}let t3=1;function B_(e,t){const n=xf(e,t);return n===void 0&&U(30,t),n}function xf(e,t){return e._nodes.get(t)}const n3=typeof queueMicrotask=="function"?queueMicrotask:e=>{Promise.resolve().then(e)};function z_(e){return Ce(Ft(e))}function bf(e){const t=document.activeElement;if(!je(t))return!1;const n=t.nodeName;return Ce(Ft(e))&&(n==="INPUT"||n==="TEXTAREA"||t.contentEditable==="true"&&al(t)==null)}function ds(e,t,n){const r=e.getRootElement();try{return r!==null&&r.contains(t)&&r.contains(n)&&t!==null&&!bf(t)&&W_(t)===e}catch{return!1}}function Cf(e){return e instanceof Xo}function W_(e){let t=e;for(;t!=null;){const n=al(t);if(Cf(n))return n;t=fs(t)}return null}function al(e){return e?e.__lexicalEditor:null}function Hr(e){return nl(e)||e.isToken()}function In(e){return Hr(e)||e.isSegmented()}function Zn(e){return tn(e)&&e.nodeType===3}function H_(e){return tn(e)&&e.nodeType===9}function Jo(e){let t=e;for(;t!=null;){if(Zn(t))return t;t=t.firstChild}return null}function Ma(e,t,n){const r=gr[t];if(n!==null&&(e&r)===(n&r))return e;let o=e^r;return t==="subscript"?o&=-65:t==="superscript"?o&=-33:t==="lowercase"?(o&=-513,o&=-1025):t==="uppercase"?(o&=-257,o&=-1025):t==="capitalize"&&(o&=-257,o&=-513),o}function K_(e){return Y(e)||wn(e)||Ce(e)}function U_(e,t){const n=(function(){const s=Vu;return Vu=null,s})();if((t=t||n&&n.__key)!=null)return void(e.__key=t);st(),L_();const r=Fe(),o=wr(),i=""+t3++;o._nodeMap.set(i,e),V(e)?r._dirtyElements.set(i,!0):r._dirtyLeaves.add(i),r._cloneNotNeeded.add(i),r._dirtyType=1,e.__key=i}function Kr(e){const t=e.getParent();if(t!==null){const n=e.getWritable(),r=t.getWritable(),o=e.getPreviousSibling(),i=e.getNextSibling(),s=i!==null?i.__key:null,a=o!==null?o.__key:null,l=o!==null?o.getWritable():null,c=i!==null?i.getWritable():null;o===null&&(r.__first=s),i===null&&(r.__last=a),l!==null&&(l.__next=s),c!==null&&(c.__prev=a),n.__prev=null,n.__next=null,n.__parent=null,r.__size--}}function Na(e){L_(),Ra(e)&&U(323,e.__key,e.__type);const t=e.getLatest(),n=t.__parent,r=wr(),o=Fe(),i=r._nodeMap,s=o._dirtyElements;n!==null&&(function(l,c,u){let f=l;for(;f!==null;){if(u.has(f))return;const d=c.get(f);if(d===void 0)break;u.set(f,!1),f=d.__parent}})(n,i,s);const a=t.__key;o._dirtyType=1,V(e)?s.set(a,!0):o._dirtyLeaves.add(a)}function ut(e){st();const t=Fe(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,n!==null){const r=Me(n);r!==null&&r.getWritable()}if(e!==null){const r=Me(e);r!==null&&r.getWritable()}}}function rr(){return li()?null:Fe()._compositionKey}function Me(e,t){const n=(t||wr())._nodeMap.get(e);return n===void 0?null:n}function G_(e,t){const n=ll(e,Fe());return n!==void 0?Me(n,t):null}function ll(e,t){return e[`__lexicalKey_${t._key}`]}function Ft(e,t){let n=e;for(;n!=null;){const r=G_(n,t);if(r!==null)return r;n=fs(n)}return null}function q_(e){const t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function Lp(e){return e.read(()=>Ke().getTextContent())}function Ke(){return Y_(wr())}function Y_(e){return e._nodeMap.get("root")}function He(e){st();const t=wr();e!==null&&(e.dirty=!0,e.setCachedNodes(null)),t._selection=e}function Lo(e){const t=Fe(),n=(function(r,o){let i=r;for(;i!=null;){const s=ll(i,o);if(s!==void 0)return s;i=fs(i)}return null})(e,t);return n===null?e===t.getRootElement()?Me("root"):null:Me(n)}function X_(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function wf(e){const t=[];let n=e;for(;n!==null;)t.push(n),n=n._parentEditor;return t}function J_(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function Z_(e){return Zn(e)?e.nodeValue:null}function Sf(e,t,n){const r=St(qt(t));if(r===null)return;const o=r.anchorNode;let{anchorOffset:i,focusOffset:s}=r;if(o!==null){let a=Z_(o);const l=Ft(o);if(a!==null&&Y(l)){if(a===Xa&&n){const c=n.length;a=n,i=c,s=c}a!==null&&Ef(l,a,i,s,e)}}}function Ef(e,t,n,r,o){let i=e;if(i.isAttached()&&(o||!i.isDirty())){const s=i.isComposing();let a=t;(s||o)&&t[t.length-1]===Xa&&(a=t.slice(0,-1));const l=i.getTextContent();if(o||a!==l){if(a===""){if(ut(null),as||oi||ls)i.remove();else{const p=Fe();setTimeout(()=>{p.update(()=>{i.isAttached()&&i.remove()})},20)}return}const c=i.getParent(),u=An(),f=i.getTextContentSize(),d=rr(),h=i.getKey();if(i.isToken()||d!==null&&h===d&&!s||W(u)&&(c!==null&&!c.canInsertTextBefore()&&u.anchor.offset===0||u.anchor.key===e.__key&&u.anchor.offset===0&&!i.canInsertTextBefore()&&!s||u.focus.key===e.__key&&u.focus.offset===f&&!i.canInsertTextAfter()&&!s))return void i.markDirty();const g=G();if(!W(g)||n===null||r===null)return void Op(i,a,g);if(g.setTextNodeRange(i,n,i,r),i.isSegmented()){const p=Pe(i.getTextContent());i.replace(p),i=p}Op(i,a,g)}}}function Op(e,t,n){if(e.setTextContent(t),W(n)){const r=e.getKey();for(const o of["anchor","focus"]){const i=n[o];i.type==="text"&&i.key===r&&(i.offset=Tn(e,i.offset,"clamp"))}}}function Ls(e,t,n){const r=t[n]||!1;return r==="any"||r===e[n]}function r3(e,t){return Ls(e,t,"altKey")&&Ls(e,t,"ctrlKey")&&Ls(e,t,"shiftKey")&&Ls(e,t,"metaKey")}function Ae(e,t,n){return r3(e,n)&&e.key.toLowerCase()===t.toLowerCase()}const On={ctrlKey:!en,metaKey:en},Ip={altKey:en,ctrlKey:!en};function $p(e){return e.key==="Backspace"}function Dp(e){return Ae(e,"a",On)}function o3(e){const t=Ke();if(W(e)){const n=e.anchor,r=e.focus,o=n.getNode().getTopLevelElementOrThrow().getParentOrThrow();return n.set(o.getKey(),0,"element"),r.set(o.getKey(),o.getChildrenSize(),"element"),qi(e),e}{const n=t.select(0,t.getChildrenSize());return He(qi(n)),n}}function jo(e,t){e.__lexicalClassNameCache===void 0&&(e.__lexicalClassNameCache={});const n=e.__lexicalClassNameCache,r=n[t];if(r!==void 0)return r;const o=e[t];if(typeof o=="string"){const i=U0(o);return n[t]=i,i}return o}function Tf(e,t,n,r,o){if(n.size===0)return;const i=r.__type,s=r.__key,a=t.get(i);a===void 0&&U(33,i);const l=a.klass;let c=e.get(l);c===void 0&&(c=new Map,e.set(l,c));const u=c.get(s),f=u==="destroyed"&&o==="created";(u===void 0||f)&&c.set(s,f?"updated":o)}function Vp(e,t,n){const r=e.getParent();let o=n,i=e;return r!==null&&(t&&n===0?(o=i.getIndexWithinParent(),i=r):t||n!==i.getChildrenSize()||(o=i.getIndexWithinParent()+1,i=r)),i.getChildAtIndex(t?o-1:o)}function ju(e,t){const n=e.offset;if(e.type==="element")return Vp(e.getNode(),t,n);{const r=e.getNode();if(t&&n===0||!t&&n===r.getTextContentSize()){const o=t?r.getPreviousSibling():r.getNextSibling();return o===null?Vp(r.getParentOrThrow(),t,r.getIndexWithinParent()+(t?0:1)):o}}return null}function Q_(e){const t=qt(e).event,n=t&&t.inputType;return n==="insertFromPaste"||n==="insertFromPasteAsQuotation"}function Z(e,t,n){return(function(r,o,i){const s=wf(r);for(let a=4;a>=0;a--)for(let l=0;l<s.length;l++){const c=s[l],u=c._commands.get(o);if(u!==void 0){const f=u[a];if(f!==void 0){const d=Array.from(f),h=d.length;let g=!1;if(Sn(c,()=>{for(let p=0;p<h;p++)if(d[p](i,r))return void(g=!0)}),g)return g}}}return!1})(e,t,n)}function cl(e){return!tt(e)&&!e.isLastChild()&&!e.isInline()}function Jr(e,t){const n=e._keyToDOMMap.get(t);return n===void 0&&U(75,t),n}function fs(e){const t=e.assignedSlot||e.parentElement;return Wu(t)?t.host:t}function ex(e){return H_(e)?e:je(e)?e.ownerDocument:null}function i3(e){st(),Fe()._updateTags.add(e)}function s3(e){st(),Fe()._deferred.push(e)}function Bu(e,t){let n=e.getParent();for(;n!==null;){if(n.is(t))return!0;n=n.getParent()}return!1}function Rf(e){const t=ex(e);return t?t.defaultView:null}function qt(e){const t=e._window;return t===null&&U(78),t}function a3(e){return V(e)&&e.isInline()||Ce(e)&&e.isInline()}function l3(e){let t=e.getParentOrThrow();for(;t!==null;){if(dt(t))return t;t=t.getParentOrThrow()}return t}function dt(e){return tt(e)||V(e)&&e.isShadowRoot()}function c3(e){const t=e.constructor.clone(e);return U_(t,null),t.afterCloneFrom(e),t}function vt(e){const t=Fe(),n=e.getType(),r=xf(t,n);r===void 0&&U(200,e.constructor.name,n);const{replace:o,replaceWithKlass:i}=r;if(o!==null){const s=o(e),a=s.constructor;return i!==null?s instanceof i||U(201,i.name,i.getType(),a.name,a.getType(),e.constructor.name,n):s instanceof e.constructor&&a!==e.constructor||U(202,a.name,a.getType(),e.constructor.name,n),s.__key===e.__key&&U(203,e.constructor.name,n,a.name,a.getType()),s}return e}function sc(e,t){!tt(e.getParent())||V(t)||Ce(t)||U(99)}function u3(e){const t=Me(e);return t===null&&U(63,e),t}function ac(e){return(Ce(e)||V(e)&&!e.canBeEmpty())&&!e.isInline()}function zu(e,t,n){n.style.removeProperty("caret-color"),t._blockCursorElement=null;const r=e.parentElement;r!==null&&r.removeChild(e)}function St(e){return fn?(e||window).getSelection():null}function d3(e){const t=Rf(e);return t?t.getSelection():null}function tx(e){return je(e)&&e.tagName==="A"}function je(e){return tn(e)&&e.nodeType===1}function tn(e){return typeof e=="object"&&e!==null&&"nodeType"in e&&typeof e.nodeType=="number"}function Wu(e){return tn(e)&&e.nodeType===11}function Hu(e){const t=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return e.nodeName.match(t)!==null}function Pa(e){const t=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return e.nodeName.match(t)!==null}function nr(e){if(Ce(e)&&!e.isInline())return!0;if(!V(e)||dt(e))return!1;const t=e.getFirstChild(),n=t===null||wn(t)||Y(t)||t.isInline();return!e.isInline()&&e.canBeEmpty()!==!1&&n}function ui(){return Fe()}const jp=new WeakMap,f3=new Map;function Bp(e){if(!e._readOnly&&e.isEmpty())return f3;e._readOnly||U(192);let t=jp.get(e);return t||(t=(function(n){const r=new Map;for(const[o,i]of n._nodeMap){const s=i.__type;let a=r.get(s);a||(a=new Map,r.set(s,a)),a.set(o,i)}return r})(e),jp.set(e,t)),t}function nx(e){const t=e.constructor.clone(e);return t.afterCloneFrom(e),t}function h3(e){return(t=nx(e))[T_]=!0,t;var t}function kf(e,t){const n=parseInt(e.style.paddingInlineStart,10)||0,r=Math.round(n/40);t.setIndent(r)}function g3(e){e.__lexicalUnmanaged=!0}function p3(e){return e.__lexicalUnmanaged===!0}function xi(e,t){return(function(n,r){return Object.prototype.hasOwnProperty.call(n,r)})(e,t)&&e[t]!==Cn[t]}function ul(e){const t=ep in e.prototype?e.prototype[ep]():void 0,n=(function(s){if(!(s===Cn||s.prototype instanceof Cn)){let a="<unknown>",l="<unknown>";try{a=s.getType()}catch{}try{Xo.version&&(l=JSON.parse(Xo.version))}catch{}U(290,s.name,a,l)}return s===cs||s===yt||s===Cn})(e),r=!n&&xi(e,"getType")?e.getType():void 0;let o,i=r;if(t)if(r)o=t[r];else for(const[s,a]of Object.entries(t))i=s,o=a;if(!n&&i&&(xi(e,"getType")||(e.getType=()=>i),xi(e,"clone")||(e.clone=s=>(_f(s),new e)),xi(e,"importJSON")||(e.importJSON=o&&o.$importJSON||(s=>new e().updateFromJSON(s))),!xi(e,"importDOM")&&o)){const{importDOM:s}=o;s&&(e.importDOM=()=>s)}return{ownNodeConfig:o,ownNodeType:i}}function rx(e){const t=ui();return st(),new(t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e))).klass}const xe=(e,t)=>{let n=e;for(;n!=null&&!tt(n);){if(t(n))return n;n=n.getParent()}return null},m3={next:"previous",previous:"next"};class Af{origin;constructor(t){this.origin=t}[Symbol.iterator](){return Pf({hasNext:pr,initial:this.getAdjacentCaret(),map:t=>t,step:t=>t.getAdjacentCaret()})}getAdjacentCaret(){return Je(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return Je(this.origin,this.direction)}remove(){const t=this.getNodeAtCaret();return t&&t.remove(),this}replaceOrInsert(t,n){const r=this.getNodeAtCaret();return t.is(this.origin)||t.is(r)||(r===null?this.insert(t):r.replace(t,n)),this}splice(t,n,r="next"){const o=r===this.direction?n:Array.from(n).reverse();let i=this;const s=this.getParentAtCaret(),a=new Map;for(let l=i.getAdjacentCaret();l!==null&&a.size<t;l=l.getAdjacentCaret()){const c=l.origin.getWritable();a.set(c.getKey(),c)}for(const l of o){if(a.size>0){const c=i.getNodeAtCaret();if(c){if(a.delete(c.getKey()),a.delete(l.getKey()),!(c.is(l)||i.origin.is(l))){const u=l.getParent();u&&u.is(s)&&l.remove(),c.replace(l)}}else c===null&&U(263,Array.from(a).join(" "))}else i.insert(l);i=Je(l,this.direction)}for(const l of a.values())l.remove();return this}}class Zi extends Af{type="child";getLatest(){const t=this.origin.getLatest();return t===this.origin?this:Ct(t,this.direction)}getParentCaret(t="root"){return Je(Mf(this.getParentAtCaret(),t),this.direction)}getFlipped(){const t=co(this.direction);return Je(this.getNodeAtCaret(),t)||Ct(this.origin,t)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(t){return t instanceof Zi&&this.direction===t.direction&&this.origin.is(t.origin)}isSamePointCaret(t){return this.isSameNodeCaret(t)}}const y3={root:tt,shadowRoot:dt};function co(e){return m3[e]}function Mf(e,t="root"){return y3[t](e)?null:e}class Zr extends Af{type="sibling";getLatest(){const t=this.origin.getLatest();return t===this.origin?this:Je(t,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return V(this.origin)?Ct(this.origin,this.direction):null}getParentCaret(t="root"){return Je(Mf(this.getParentAtCaret(),t),this.direction)}getFlipped(){const t=co(this.direction);return Je(this.getNodeAtCaret(),t)||Ct(this.origin.getParentOrThrow(),t)}isSamePointCaret(t){return t instanceof Zr&&this.direction===t.direction&&this.origin.is(t.origin)}isSameNodeCaret(t){return(t instanceof Zr||t instanceof Qr)&&this.direction===t.direction&&this.origin.is(t.origin)}}class Qr extends Af{type="text";offset;constructor(t,n){super(t),this.offset=n}getLatest(){const t=this.origin.getLatest();return t===this.origin?this:eo(t,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(t="root"){return Je(Mf(this.getParentAtCaret(),t),this.direction)}getFlipped(){return eo(this.origin,co(this.direction),this.offset)}isSamePointCaret(t){return t instanceof Qr&&this.direction===t.direction&&this.origin.is(t.origin)&&this.offset===t.offset}isSameNodeCaret(t){return(t instanceof Zr||t instanceof Qr)&&this.direction===t.direction&&this.origin.is(t.origin)}getSiblingCaret(){return Je(this.origin,this.direction)}}function En(e){return e instanceof Qr}function pr(e){return e instanceof Zr}function At(e){return e instanceof Zi}const v3={next:class extends Qr{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends Qr{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},_3={next:class extends Zr{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends Zr{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},x3={next:class extends Zi{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends Zi{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function Je(e,t){return e?new _3[t](e):null}function eo(e,t,n){return e?new v3[t](e,Tn(e,n)):null}function Tn(e,t,n="error"){const r=e.getTextContentSize();let o=t==="next"?r:t==="previous"?0:t;return(o<0||o>r)&&(n!=="clamp"&&H0(284,String(t),String(r),e.getKey()),o=o<0?0:r),o}function zp(e,t){return new C3(e,t)}function Ct(e,t){return V(e)?new x3[t](e):null}function b3(e){return e&&e.getChildCaret()||e}function hs(e){return e&&b3(e.getAdjacentCaret())}class Nf{type="node-caret-range";direction;anchor;focus;constructor(t,n,r){this.anchor=t,this.focus=n,this.direction=r}getLatest(){const t=this.anchor.getLatest(),n=this.focus.getLatest();return t===this.anchor&&n===this.focus?this:new Nf(t,n,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){const t=o=>{const i=this[o].getLatest();return En(i)?(function(s,a){const{direction:l,origin:c}=s,u=Tn(c,a==="focus"?co(l):l);return zp(s,u-s.offset)})(i,o):null},n=t("anchor"),r=t("focus");if(n&&r){const{caret:o}=n,{caret:i}=r;if(o.isSameNodeCaret(i))return[zp(o,i.offset-o.offset),null]}return[n,r]}iterNodeCarets(t="root"){const n=En(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),r=this.focus.getLatest(),o=En(r),i=s=>s.isSameNodeCaret(r)?null:hs(s)||s.getParentCaret(t);return Pf({hasNext:s=>s!==null&&!(o&&r.isSameNodeCaret(s)),initial:n.isSameNodeCaret(r)?null:i(n),map:s=>s,step:i})}[Symbol.iterator](){return this.iterNodeCarets("root")}}class C3{type="slice";caret;distance;constructor(t,n){this.caret=t,this.distance=n}getSliceIndices(){const{distance:t,caret:{offset:n}}=this,r=n+t;return r<n?[r,n]:[n,r]}getTextContent(){const[t,n]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(t,n)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){const{caret:{origin:t,direction:n}}=this,[r,o]=this.getSliceIndices(),i=t.getTextContent();return eo(t.setTextContent(i.slice(0,r)+i.slice(o)),n,r)}}function Qi(e){return mr(e,Je(Ke(),e.direction))}function ox(e){return mr(e,e)}function mr(e,t){return e.direction!==t.direction&&U(265),new Nf(e,t,e.direction)}function Pf(e){const{initial:t,hasNext:n,step:r,map:o}=e;let i=t;return{[Symbol.iterator](){return this},next(){if(!n(i))return{done:!0,value:void 0};const s={done:!1,value:o(i)};return i=r(i),s}}}function ix(e,t){const n=oa(e.origin,t.origin);switch(n===null&&U(275,e.origin.getKey(),t.origin.getKey()),n.type){case"same":{const r=e.type==="text",o=t.type==="text";return r&&o?(function(i,s){return Math.sign(i-s)})(e.offset,t.offset):e.type===t.type?0:r?-1:o?1:e.type==="child"?-1:1}case"ancestor":return e.type==="child"?-1:1;case"descendant":return t.type==="child"?1:-1;case"branch":return sx(n)}}function sx(e){const{a:t,b:n}=e,r=t.__key,o=n.__key;let i=t,s=n;for(;i&&s;i=i.getNextSibling(),s=s.getNextSibling()){if(i.__key===o)return-1;if(s.__key===r)return 1}return i===null?1:-1}function Os(e,t){return t.is(e)}function Wp(e){return V(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function oa(e,t){if(e.is(t))return{commonAncestor:e,type:"same"};const n=new Map;for(let[r,o]=Wp(e);r;o=r,r=r.getParent())n.set(r,o);for(let[r,o]=Wp(t);r;o=r,r=r.getParent()){const i=n.get(r);if(i!==void 0)return i===null?(Os(e,r)||U(276),{commonAncestor:r,type:"ancestor"}):o===null?(Os(t,r)||U(277),{commonAncestor:r,type:"descendant"}):((V(i)||Os(e,i))&&(V(o)||Os(t,o))&&r.is(i.getParent())&&r.is(o.getParent())||U(278),{a:i,b:o,commonAncestor:r,type:"branch"})}return null}function ln(e,t){const{type:n,key:r,offset:o}=e,i=u3(e.key);return n==="text"?(Y(i)||U(266,i.getType(),r),eo(i,t,o)):(V(i)||U(267,i.getType(),r),S3(i,e.offset,t))}function nn(e,t){const{origin:n,direction:r}=t,o=r==="next";En(t)?e.set(n.getKey(),t.offset,"text"):pr(t)?Y(n)?e.set(n.getKey(),Tn(n,r),"text"):e.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+(o?1:0),"element"):(At(t)&&V(n)||U(268),e.set(n.getKey(),o?0:n.getChildrenSize(),"element"))}function ax(e){const t=G(),n=W(t)?t:ol();return ia(n,e),He(n),n}function ia(e,t){nn(e.anchor,t.anchor),nn(e.focus,t.focus)}function Hp(e){const{anchor:t,focus:n}=e,r=ln(t,"next"),o=ln(n,"next"),i=ix(r,o)<=0?"next":"previous";return mr(Xn(r,i),Xn(o,i))}function gs(e){const{direction:t,origin:n}=e,r=Je(n,co(t)).getNodeAtCaret();return r?Je(r,t):Ct(n.getParentOrThrow(),t)}function Kp(e,t="root"){const n=[e];for(let r=At(e)?e.getParentCaret(t):e.getSiblingCaret();r!==null;r=r.getParentCaret(t))n.push(gs(r));return n}function lc(e){return!!e&&e.origin.isAttached()}function w3(e,t="removeEmptySlices"){if(e.isCollapsed())return e;const n="root",r="next";let o=t;const i=lx(e,r),s=Kp(i.anchor,n),a=Kp(i.focus.getFlipped(),n),l=new Set,c=[];for(const g of i.iterNodeCarets(n))if(At(g))l.add(g.origin.getKey());else if(pr(g)){const{origin:p}=g;V(p)&&!l.has(p.getKey())||c.push(p)}for(const g of c)g.remove();for(const g of i.getTextSlices()){if(!g)continue;const{origin:p}=g.caret,m=p.getTextContentSize(),_=gs(Je(p,r)),y=p.getMode();if(Math.abs(g.distance)===m&&o==="removeEmptySlices"||y==="token"&&g.distance!==0)_.remove();else if(g.distance!==0){o="removeEmptySlices";let v=g.removeTextSlice();const x=g.caret.origin;if(y==="segmented"){const b=v.origin,w=Pe(b.getTextContent()).setStyle(b.getStyle()).setFormat(b.getFormat());_.replaceOrInsert(w),v=eo(w,r,v.offset)}x.is(s[0].origin)&&(s[0]=v),x.is(a[0].origin)&&(a[0]=v.getFlipped())}}let u,f;for(const g of s)if(lc(g)){u=bt(g);break}for(const g of a)if(lc(g)){f=bt(g);break}const d=(function(g,p,m){if(!g||!p)return null;const _=g.getParentAtCaret(),y=p.getParentAtCaret();if(!_||!y)return null;const v=_.getParents().reverse();v.push(_);const x=y.getParents().reverse();x.push(y);const b=Math.min(v.length,x.length);let w;for(w=0;w<b&&v[w]===x[w];w++);const T=(M,O)=>{let D;for(let I=w;I<M.length;I++){const L=M[I];if(dt(L))return;!D&&O(L)&&(D=L)}return D},E=T(v,nr),R=E&&T(x,M=>m.has(M.getKey())&&nr(M));return E&&R?[E,R]:null})(u,f,l);if(d){const[g,p]=d;Ct(g,"previous").splice(0,p.getChildren()),p.remove()}const h=[u,f,...s,...a].find(lc);if(h)return ox(Xn(bt(h),e.direction));U(269,JSON.stringify(s.map(g=>g.origin.__key)))}function bt(e){const t=(function(o){let i=o;for(;At(i);){const s=hs(i);if(!At(s))break;i=s}return i})(e.getLatest()),{direction:n}=t;if(Y(t.origin))return En(t)?t:eo(t.origin,n,n);const r=t.getAdjacentCaret();return pr(r)&&Y(r.origin)?eo(r.origin,n,co(n)):t}function Ff(e){return En(e)&&e.offset!==Tn(e.origin,e.direction)}function Xn(e,t){return e.direction===t?e:e.getFlipped()}function lx(e,t){return e.direction===t?e:mr(Xn(e.focus,t),Xn(e.anchor,t))}function S3(e,t,n){let r=Ct(e,"next");for(let o=0;o<t;o++){const i=r.getAdjacentCaret();if(i===null)break;r=i}return Xn(r,n)}function E3(e){const{origin:t,offset:n,direction:r}=e;if(n===Tn(t,r))return e.getSiblingCaret();if(n===Tn(t,co(r)))return gs(e.getSiblingCaret());const[o]=t.splitText(n);return Y(o)||U(281),Xn(Je(o,"next"),r)}function T3(e,t){return!0}function R3(e,{$copyElementNode:t=c3,$splitTextPointCaretNext:n=E3,rootMode:r="shadowRoot",$shouldSplit:o=T3}={}){if(En(e))return n(e);const i=e.getParentCaret(r);if(i){const{origin:s}=i;if(At(e)&&(!s.canBeEmpty()||!o(s,"first")))return gs(i);const a=(function(l){const c=[];for(let u=l.getAdjacentCaret();u;u=u.getAdjacentCaret())c.push(u.origin);return c})(e);(a.length>0||s.canBeEmpty()&&o(s,"last"))&&i.insert(t(s).splice(0,0,a))}return i}function k3(e,t){if(!t||e===t)return e;for(const n in t)if(e[n]!==t[n])return{...e,...t};return e}const Ku=new Map;function cx(e){const t={};if(!e)return t;const n=e.split(";");for(const r of n)if(r!==""){const[o,i]=r.split(/:([^]+)/);o&&i&&(t[o.trim()]=i.trim())}return t}function Up(e){let t=Ku.get(e);return t===void 0&&(t=cx(e),Ku.set(e,t)),t}function ux(e){const t=ui().getElementByKey(e.getKey());if(t===null)return null;const n=t.ownerDocument.defaultView;return n===null?null:n.getComputedStyle(t)}function dx(e){return ux(tt(e)?e:e.getParentOrThrow())}function Gp(e){const t=dx(e);return t!==null&&t.direction==="rtl"}function fx(e,t,n="self"){const r=e.getStartEndPoints();if(t.isSelected(e)&&!In(t)&&r!==null){const[o,i]=r,s=e.isBackward(),a=o.getNode(),l=i.getNode(),c=t.is(a),u=t.is(l);if(c||u){const[f,d]=$u(e),h=a.is(l),g=t.is(s?l:a),p=t.is(s?a:l);let m,_=0;h?(_=f>d?d:f,m=f>d?f:d):g?(_=s?d:f,m=void 0):p&&(_=0,m=s?f:d);const y=t.__text.slice(_,m);y!==t.__text&&(n==="clone"&&(t=h3(t)),t.__text=y)}}return t}function A3(e){const t=e.getStyle(),n=cx(t);Ku.set(t,n)}function hx(e){const t=gx(e);return t!==null&&t.writingMode==="vertical-rl"}function gx(e){const t=e.anchor.getNode();return V(t)?ux(t):dx(t)}function qp(e,t){let n=hx(e)?!t:t;px(e)&&(n=!n);const r=ln(e.focus,n?"previous":"next");if(Ff(r))return!1;for(const o of Qi(r)){if(At(o))return!o.origin.isInline();if(!V(o.origin)){if(Ce(o.origin))return!0;break}}return!1}function M3(e,t,n,r){e.modify(t?"extend":"move",n,r)}function px(e){const t=gx(e);return t!==null&&t.direction==="rtl"}function Yp(e,t,n){const r=px(e);let o;o=hx(e)||r?!n:n,M3(e,t,o,"character")}function mx(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const yx=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,N3=yx&&"documentMode"in document?document.documentMode:null;!(!yx||!("InputEvent"in window)||N3)&&"getTargetRanges"in new window.InputEvent("input");function vx(...e){const t=[];for(const n of e)if(n&&typeof n=="string")for(const[r]of n.matchAll(/\S+/g))t.push(r);return t}function cn(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function Ye(e,...t){const n=vx(...t);n.length>0&&e.classList.add(...n)}function Rn(e,...t){const n=vx(...t);n.length>0&&e.classList.remove(...n)}function P3(e){return e?e.getAdjacentCaret():null}function F3(e,t){let n=e;for(;n!=null;){if(n instanceof t)return n;n=n.getParent()}return null}function L3(e){const t=xe(e,n=>V(n)&&!n.isInline());return V(t)||mx(4,e.__key),t}function O3(e){const t=G()||An();let n;if(W(t))n=ln(t.focus,"next");else{if(t!=null){const s=t.getNodes(),a=s[s.length-1];a&&(n=Je(a,"next"))}n=n||Ct(Ke(),"previous").getFlipped().insert(me())}const r=I3(e,n),o=hs(r),i=At(o)?bt(o):r;return ax(ox(i)),e.getLatest()}function I3(e,t,n){let r=Xn(t,"next");for(let o=r;o;o=R3(o,n))r=o;return En(r)&&mx(283),r.insert(e.isInline()?me().append(e):e),Xn(Je(e.getLatest(),"next"),t.direction)}function or(e,t){return e!==null&&Object.getPrototypeOf(e).constructor.name===t.name}function $3(e,t){Ct(e,"next").insert(t)}function _x(e,t){return xx(e,t,null)}function xx(e,t,n){let r=!1;for(const o of Cx(e))t(o)?n!==null&&n(o):(r=!0,V(o)&&xx(o,t,n||(i=>o.insertAfter(i))),o.remove());return r}function bx(e,t){const n=[],r=Array.from(e).reverse();for(let o=r.pop();o!==void 0;o=r.pop())if(t(o))n.push(o);else if(V(o))for(const i of Cx(o))r.push(i);return n}function Cx(e){return D3(Ct(e,"previous"))}function D3(e){return Pf({hasNext:pr,initial:e.getAdjacentCaret(),map:t=>t.origin.getLatest(),step:t=>t.getAdjacentCaret()})}function wx(){const[e]=nt(),[t,n]=C.useState(!1),[r,o]=C.useState(!1),[i,s]=C.useState(!1),[a,l]=C.useState(!1),[c,u]=C.useState("left"),f=c==="left",d=c==="center",h=c==="right",g=C.useCallback(()=>{const _=G();W(_)&&(n(_.hasFormat("bold")),o(_.hasFormat("italic")),s(_.hasFormat("underline")),l(_.hasFormat("strikethrough")))},[]),p=C.useCallback(_=>{u(_)},[]),m=C.useCallback(()=>{const _=G();if(!W(_))return;const y=_.anchor.getNode(),v=y.getKey()==="root"?y:y.getTopLevelElementOrThrow();if(V(v)){const x=v.getFormatType();p(x)}},[p]);return C.useEffect(()=>{const _=cn(e.registerCommand(Rt,(y,v)=>(e.read(()=>{g()}),!1),jn),e.registerCommand($o,(y,v)=>(e.read(()=>{p(y)}),!1),jn),e.registerCommand(zn,(y,v)=>(e.read(()=>{g(),m()}),!1),jn));return()=>{_()}},[e,g,p,m]),{isBold:t,isItalic:r,isUnderline:i,isStrikethrough:a,alignment:c,isAlignLeft:f,isAlignCenter:d,isAlignRight:h}}var oe=(e=>(e.BOLD="font-bold",e.ITALIC="font-italic",e.UNDERLINE="font-underline",e.STRIKETHROUGH="font-strikethrough",e.ALIGN_LEFT="align-left",e.ALIGN_CENTER="align-center",e.ALIGN_RIGHT="align-right",e.LINK="insert-link",e.IMAGE="insert-image",e.TABLE="insert-table",e.BULLET_LIST="insert-bullet-list",e.NUMBERED_LIST="insert-numbered-list",e))(oe||{});function V3(){const{isBold:e,isItalic:t,isUnderline:n,isStrikethrough:r,isAlignLeft:o,isAlignCenter:i,isAlignRight:s}=wx(),l=ss().toolbar.actions,{availableActions:c}=IR(),u=C.useMemo(()=>({id:oe.BOLD,IconComponent:RR,label:l.bold,isActive:e}),[l.bold,e]),f=C.useMemo(()=>({id:oe.ITALIC,IconComponent:AR,label:l.italic,isActive:t}),[l.italic,t]),d=C.useMemo(()=>({id:oe.UNDERLINE,IconComponent:OR,label:l.underline,isActive:n}),[l.underline,n]),h=C.useMemo(()=>({id:oe.STRIKETHROUGH,IconComponent:FR,label:l.strikethrough,isActive:r}),[l.strikethrough,r]),g=C.useMemo(()=>({id:oe.ALIGN_LEFT,IconComponent:ER,label:l.alignLeft,isActive:o}),[l.alignLeft,o]),p=C.useMemo(()=>({id:oe.ALIGN_CENTER,IconComponent:SR,label:l.alignCenter,isActive:i}),[l.alignCenter,i]),m=C.useMemo(()=>({id:oe.ALIGN_RIGHT,IconComponent:TR,label:l.alignRight,isActive:s}),[l.alignRight,s]),_=C.useMemo(()=>({id:oe.BULLET_LIST,IconComponent:NR,label:l.bulletList}),[l.bulletList]),y=C.useMemo(()=>({id:oe.NUMBERED_LIST,IconComponent:PR,label:l.numberedList}),[l.numberedList]),v=C.useMemo(()=>({id:oe.LINK,IconComponent:MR,label:l.link}),[l.link]),x=C.useMemo(()=>({id:oe.IMAGE,IconComponent:kR,label:l.image}),[l.image]),b=C.useMemo(()=>({id:oe.TABLE,IconComponent:LR,label:l.table}),[l.table]),w=C.useMemo(()=>({[oe.BOLD]:u,[oe.ITALIC]:f,[oe.UNDERLINE]:d,[oe.STRIKETHROUGH]:h,[oe.ALIGN_LEFT]:g,[oe.ALIGN_CENTER]:p,[oe.ALIGN_RIGHT]:m,[oe.BULLET_LIST]:_,[oe.NUMBERED_LIST]:y,[oe.LINK]:v,[oe.IMAGE]:x,[oe.TABLE]:b}),[u,f,d,h,g,p,m,_,y,v,x,b]),T=C.useMemo(()=>c.map(R=>R.map(M=>w[M])),[c,w]);return{availableActions:C.useMemo(()=>T.flat(),[T]),availableActionGroups:T}}const j3=Symbol.for("preact-signals");function Lf(){if(Bo>1)return void Bo--;let e,t=!1;for(;Vi!==void 0;){let n=Vi;for(Vi=void 0,Uu++;n!==void 0;){const r=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&Ex(n))try{n.c()}catch(o){t||(e=o,t=!0)}n=r}}if(Uu=0,Bo--,t)throw e}let ke,Vi;function Xp(e){const t=ke;ke=void 0;try{return e()}finally{ke=t}}let Bo=0,Uu=0,sa=0;function Jp(e){if(ke===void 0)return;let t=e.n;return t===void 0||t.t!==ke?(t={i:0,S:e,p:ke.s,n:void 0,t:ke,e:void 0,x:void 0,r:t},ke.s!==void 0&&(ke.s.n=t),ke.s=t,e.n=t,32&ke.f&&e.S(t),t):t.i===-1?(t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=ke.s,t.n=void 0,ke.s.n=t,ke.s=t),t):void 0}function _t(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function Sx(e,t){return new _t(e,t)}function Ex(e){for(let t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function Zp(e){for(let t=e.s;t!==void 0;t=t.n){const n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function Tx(e){let t,n=e.s;for(;n!==void 0;){const r=n.p;n.i===-1?(n.S.U(n),r!==void 0&&(r.n=n.n),n.n!==void 0&&(n.n.p=r)):t=n,n.S.n=n.r,n.r!==void 0&&(n.r=void 0),n=r}e.s=t}function po(e,t){_t.call(this,void 0),this.x=e,this.s=void 0,this.g=sa-1,this.f=4,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function Rx(e){const t=e.u;if(e.u=void 0,typeof t=="function"){Bo++;const n=ke;ke=void 0;try{t()}catch(r){throw e.f&=-2,e.f|=8,Of(e),r}finally{ke=n,Lf()}}}function Of(e){for(let t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Rx(e)}function B3(e){if(ke!==this)throw new Error("Out-of-order effect");Tx(this),ke=e,this.f&=-2,8&this.f&&Of(this),Lf()}function Eo(e,t){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32,this.name=t?.name}function z3(e,t){const n=new Eo(e,t);try{n.c()}catch(o){throw n.d(),o}const r=n.d.bind(n);return r[Symbol.dispose]=r,r}_t.prototype.brand=j3,_t.prototype.h=function(){return!0},_t.prototype.S=function(e){const t=this.t;t!==e&&e.e===void 0&&(e.x=t,this.t=e,t!==void 0?t.e=e:Xp(()=>{var n;(n=this.W)==null||n.call(this)}))},_t.prototype.U=function(e){if(this.t!==void 0){const t=e.e,n=e.x;t!==void 0&&(t.x=n,e.e=void 0),n!==void 0&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n,n===void 0&&Xp(()=>{var r;(r=this.Z)==null||r.call(this)}))}},_t.prototype.subscribe=function(e){return z3(()=>{const t=this.value,n=ke;ke=void 0;try{e(t)}finally{ke=n}},{name:"sub"})},_t.prototype.valueOf=function(){return this.value},_t.prototype.toString=function(){return this.value+""},_t.prototype.toJSON=function(){return this.value},_t.prototype.peek=function(){const e=ke;ke=void 0;try{return this.value}finally{ke=e}},Object.defineProperty(_t.prototype,"value",{get(){const e=Jp(this);return e!==void 0&&(e.i=this.i),this.v},set(e){if(e!==this.v){if(Uu>100)throw new Error("Cycle detected");this.v=e,this.i++,sa++,Bo++;try{for(let t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Lf()}}}}),po.prototype=new _t,po.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===sa))return!0;if(this.g=sa,this.f|=1,this.i>0&&!Ex(this))return this.f&=-2,!0;const e=ke;try{Zp(this),ke=this;const t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(t){this.v=t,this.f|=16,this.i++}return ke=e,Tx(this),this.f&=-2,!0},po.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(let t=this.s;t!==void 0;t=t.n)t.S.S(t)}_t.prototype.S.call(this,e)},po.prototype.U=function(e){if(this.t!==void 0&&(_t.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(let t=this.s;t!==void 0;t=t.n)t.S.U(t)}},po.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(po.prototype,"value",{get(){if(1&this.f)throw new Error("Cycle detected");const e=Jp(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),Eo.prototype.c=function(){const e=this.S();try{if(8&this.f||this.x===void 0)return;const t=this.x();typeof t=="function"&&(this.u=t)}finally{e()}},Eo.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Rx(this),Zp(this),Bo++;const e=ke;return ke=this,B3.bind(this,e)},Eo.prototype.N=function(){2&this.f||(this.f|=2,this.o=Vi,Vi=this)},Eo.prototype.d=function(){this.f|=8,1&this.f||Of(this)},Eo.prototype.dispose=function(){this.d()};function W3(e){return(typeof e.nodes=="function"?e.nodes():e.nodes)||[]}function Ie(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function kx(e,t){if(e&&t&&!Array.isArray(t)&&typeof e=="object"&&typeof t=="object"){const n=e,r=t;for(const o in r)n[o]=kx(n[o],r[o]);return e}return t}const If=0,Gu=1,Ax=2,cc=3,Is=4,mo=5,uc=6,bi=7;function dc(e){return e.id===If}function Mx(e){return e.id===Ax}function H3(e){return(function(t){return t.id===Gu})(e)||Ie(305,String(e.id),String(Gu)),Object.assign(e,{id:Ax})}const K3=new Set;let U3=class{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(t,n){this.builder=t,this.extension=n,this.configs=new Set,this.state={id:If}}mergeConfigs(){let t=this.extension.config||{};const n=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):k3;for(const r of this.configs)t=n(t,r);return t}init(t){const n=this.state;Mx(n)||Ie(306,String(n.id));const r={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},o={...r,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},i=(function(a,l,c){return Object.assign(a,{config:l,id:cc,registerState:c})})(n,this.mergeConfigs(),r);let s;this.state=i,this.extension.init&&(s=this.extension.init(t,i.config,r)),this.state=(function(a,l,c){return Object.assign(a,{id:Is,initResult:l,registerState:c})})(i,s,o)}build(t){const n=this.state;let r;n.id!==Is&&Ie(307,String(n.id),String(mo)),this.extension.build&&(r=this.extension.build(t,n.config,n.registerState));const o={...n.registerState,getOutput:()=>r,getSignal:this.getSignal.bind(this)};this.state=(function(i,s,a){return Object.assign(i,{id:mo,output:s,registerState:a})})(n,r,o)}register(t,n){this._signal=n;const r=this.state;r.id!==mo&&Ie(308,String(r.id),String(mo));const o=this.extension.register&&this.extension.register(t,r.config,r.registerState);return this.state=(function(i){return Object.assign(i,{id:uc})})(r),()=>{const i=this.state;i.id!==bi&&Ie(309,String(r.id),String(bi)),this.state=(function(s){return Object.assign(s,{id:mo})})(i),o&&o()}}afterRegistration(t){const n=this.state;let r;return n.id!==uc&&Ie(310,String(n.id),String(uc)),this.extension.afterRegistration&&(r=this.extension.afterRegistration(t,n.config,n.registerState)),this.state=(function(o){return Object.assign(o,{id:bi})})(n),r}getSignal(){return this._signal===void 0&&Ie(311),this._signal}getInitResult(){this.extension.init===void 0&&Ie(312,this.extension.name);const t=this.state;return(function(n){return n.id>=Is})(t)||Ie(313,String(t.id),String(Is)),t.initResult}getInitPeer(t){const n=this.builder.extensionNameMap.get(t);return n?n.getExtensionInitDependency():void 0}getExtensionInitDependency(){const t=this.state;return(function(n){return n.id>=cc})(t)||Ie(314,String(t.id),String(cc)),{config:t.config}}getPeer(t){const n=this.builder.extensionNameMap.get(t);return n?n.getExtensionDependency():void 0}getInitDependency(t){const n=this.builder.getExtensionRep(t);return n===void 0&&Ie(315,this.extension.name,t.name),n.getExtensionInitDependency()}getDependency(t){const n=this.builder.getExtensionRep(t);return n===void 0&&Ie(315,this.extension.name,t.name),n.getExtensionDependency()}getState(){const t=this.state;return(function(n){return n.id>=bi})(t)||Ie(316,String(t.id),String(bi)),t}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||K3}getPeerNameSet(){let t=this._peerNameSet;return t||(t=new Set((this.extension.peerDependencies||[]).map(([n])=>n)),this._peerNameSet=t),t}getExtensionDependency(){if(!this._dependency){const t=this.state;(function(n){return n.id>=mo})(t)||Ie(317,this.extension.name),this._dependency={config:t.config,init:t.initResult,output:t.output}}return this._dependency}};const Qp={tag:Vo};function G3(){const e=Ke();e.isEmpty()&&e.append(me())}const q3={config:{setOptions:Qp,updateOptions:Qp},init:({$initialEditorState:e=G3})=>({$initialEditorState:e,initialized:!1}),afterRegistration(e,{updateOptions:t,setOptions:n},r){const o=r.getInitResult();if(!o.initialized){o.initialized=!0;const{$initialEditorState:i}=o;if(Jk(i))e.setEditorState(i,n);else if(typeof i=="function")e.update(()=>{i(e)},t);else if(i&&(typeof i=="string"||typeof i=="object")){const s=e.parseEditorState(i);e.setEditorState(s,n)}}return()=>{}},name:"@lexical/extension/InitialState",nodes:[ci,Gt,ii,si,lo]},em=Symbol.for("@lexical/extension/LexicalBuilder");function tm(){}function Y3(e){throw e}function $s(e){return Array.isArray(e)?e:[e]}const fc="0.39.0+prod.esm";let X3=class aa{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(t){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=fc,this.roots=t;for(const n of t)this.addExtension(n)}static fromExtensions(t){const n=[$s(q3)];for(const r of t)n.push($s(r));return new aa(n)}static maybeFromEditor(t){const n=t[em];return n&&(n.PACKAGE_VERSION!==fc&&Ie(292,n.PACKAGE_VERSION,fc),n instanceof aa||Ie(293)),n}static fromEditor(t){const n=aa.maybeFromEditor(t);return n===void 0&&Ie(294),n}constructEditor(){const{$initialEditorState:t,onError:n,...r}=this.buildCreateEditorArgs(),o=Object.assign(j_({...r,...n?{onError:i=>{n(i,o)}}:{}}),{[em]:this});for(const i of this.sortedExtensionReps())i.build(o);return o}buildEditor(){let t=tm;function n(){try{t()}finally{t=tm}}const r=Object.assign(this.constructEditor(),{dispose:n,[Symbol.dispose]:n});return t=cn(this.registerEditor(r),()=>r.setRootElement(null)),r}hasExtensionByName(t){return this.extensionNameMap.has(t)}getExtensionRep(t){const n=this.extensionNameMap.get(t.name);if(n)return n.extension!==t&&Ie(295,t.name),n}addEdge(t,n,r){const o=this.outgoingConfigEdges.get(t);o?o.set(n,r):this.outgoingConfigEdges.set(t,new Map([[n,r]]));const i=this.incomingEdges.get(n);i?i.add(t):this.incomingEdges.set(n,new Set([t]))}addExtension(t){this._sortedExtensionReps!==void 0&&Ie(296);const n=$s(t),[r]=n;typeof r.name!="string"&&Ie(297,typeof r.name);let o=this.extensionNameMap.get(r.name);if(o!==void 0&&o.extension!==r&&Ie(298,r.name),!o){o=new U3(this,r),this.extensionNameMap.set(r.name,o);const i=this.conflicts.get(r.name);typeof i=="string"&&Ie(299,r.name,i);for(const s of r.conflictsWith||[])this.extensionNameMap.has(s)&&Ie(299,r.name,s),this.conflicts.set(s,r.name);for(const s of r.dependencies||[]){const a=$s(s);this.addEdge(r.name,a[0].name,a.slice(1)),this.addExtension(a)}for(const[s,a]of r.peerDependencies||[])this.addEdge(r.name,s,a?[a]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;const t=[],n=(r,o)=>{let i=r.state;if(Mx(i))return;const s=r.extension.name;var a;dc(i)||Ie(300,s,o||"[unknown]"),dc(a=i)||Ie(304,String(a.id),String(If)),i=Object.assign(a,{id:Gu}),r.state=i;const l=this.outgoingConfigEdges.get(s);if(l)for(const c of l.keys()){const u=this.extensionNameMap.get(c);u&&n(u,s)}i=H3(i),r.state=i,t.push(r)};for(const r of this.extensionNameMap.values())dc(r.state)&&n(r);for(const r of t)for(const[o,i]of this.outgoingConfigEdges.get(r.extension.name)||[])if(i.length>0){const s=this.extensionNameMap.get(o);if(s)for(const a of i)s.configs.add(a)}for(const[r,...o]of this.roots)if(o.length>0){const i=this.extensionNameMap.get(r.name);i===void 0&&Ie(301,r.name);for(const s of o)i.configs.add(s)}return this._sortedExtensionReps=t,this._sortedExtensionReps}registerEditor(t){const n=this.sortedExtensionReps(),r=new AbortController,o=[()=>r.abort()],i=r.signal;for(const s of n){const a=s.register(t,i);a&&o.push(a)}for(const s of n){const a=s.afterRegistration(t);a&&o.push(a)}return cn(...o)}buildCreateEditorArgs(){const t={},n=new Set,r=new Map,o=new Map,i={},s={},a=this.sortedExtensionReps();for(const u of a){const{extension:f}=u;if(f.onError!==void 0&&(t.onError=f.onError),f.disableEvents!==void 0&&(t.disableEvents=f.disableEvents),f.parentEditor!==void 0&&(t.parentEditor=f.parentEditor),f.editable!==void 0&&(t.editable=f.editable),f.namespace!==void 0&&(t.namespace=f.namespace),f.$initialEditorState!==void 0&&(t.$initialEditorState=f.$initialEditorState),f.nodes)for(const d of W3(f)){if(typeof d!="function"){const h=r.get(d.replace);h&&Ie(302,f.name,d.replace.name,h.extension.name),r.set(d.replace,u)}n.add(d)}if(f.html){if(f.html.export)for(const[d,h]of f.html.export.entries())o.set(d,h);f.html.import&&Object.assign(i,f.html.import)}f.theme&&kx(s,f.theme)}Object.keys(s).length>0&&(t.theme=s),n.size&&(t.nodes=[...n]);const l=Object.keys(i).length>0,c=o.size>0;(l||c)&&(t.html={},l&&(t.html.import=i),c&&(t.html.export=o));for(const u of a)u.init(t);return t.onError||(t.onError=Y3),t}},$f=class Nx extends cs{static getType(){return"horizontalrule"}static clone(t){return new Nx(t.__key)}static importJSON(t){return Px().updateFromJSON(t)}static importDOM(){return{hr:()=>({conversion:J3,priority:0})}}exportDOM(){return{element:document.createElement("hr")}}createDOM(t){const n=document.createElement("hr");return Ye(n,t.theme.hr),n}getTextContent(){return`
|
|
20
|
-
`}isInline(){return!1}updateDOM(){return!1}};function J3(){return{node:Px()}}function Px(){return rx($f)}function Z3(e){return e instanceof $f}function ir(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function qu(e){let t=1,n=e.getParent();for(;n!=null;){if(Ee(n)){const r=n.getParent();if(ge(r)){t++,n=r.getParent();continue}ir(40)}return t}return t}function Yu(e){let t=e.getParent();ge(t)||ir(40);let n=t;for(;n!==null;)n=n.getParent(),ge(n)&&(t=n);return t}function Fx(e){let t=[];const n=e.getChildren().filter(Ee);for(let r=0;r<n.length;r++){const o=n[r],i=o.getFirstChild();ge(i)?t=t.concat(Fx(i)):t.push(o)}return t}function yn(e){return Ee(e)&&ge(e.getFirstChild())}function nm(e){return It().append(e)}function Lx(e,t){return Ee(e)&&(t.length===0||t.length===1&&e.is(t[0])&&e.getChildrenSize()===0)}function rm(e){const t=G();if(t!==null){let n=t.getNodes();if(W(t)){const o=t.getStartEndPoints();o===null&&ir(143);const[i]=o,s=i.getNode(),a=s.getParent();if(dt(s)){const l=s.getFirstChild();if(l)n=l.selectStart().getNodes();else{const c=me();s.append(c),n=c.select().getNodes()}}else if(Lx(s,n)){const l=Mt(e);if(dt(a)){s.replace(l);const c=It();V(s)&&(c.setFormat(s.getFormatType()),c.setIndent(s.getIndent())),l.append(c)}else if(Ee(s)){const c=s.getParentOrThrow();to(l,c.getChildren()),c.replace(l)}return}}const r=new Set;for(let o=0;o<n.length;o++){const i=n[o];if(V(i)&&i.isEmpty()&&!Ee(i)&&!r.has(i.getKey())){om(i,e);continue}let s=K_(i)?i.getParent():Ee(i)&&i.isEmpty()?i:null;for(;s!=null;){const a=s.getKey();if(ge(s)){if(!r.has(a)){const l=Mt(e);to(l,s.getChildren()),s.replace(l),r.add(a)}break}{const l=s.getParent();if(dt(l)&&!r.has(a)){r.add(a),om(s,e);break}s=l}}}}}function to(e,t){e.splice(e.getChildrenSize(),0,t)}function om(e,t){if(ge(e))return e;const n=e.getPreviousSibling(),r=e.getNextSibling(),o=It();let i;if(to(o,e.getChildren()),ge(n)&&t===n.getListType())n.append(o),ge(r)&&t===r.getListType()&&(to(n,r.getChildren()),r.remove()),i=n;else if(ge(r)&&t===r.getListType())r.getFirstChildOrThrow().insertBefore(o),i=r;else{const s=Mt(t);s.append(o),e.replace(s),i=s}return o.setFormat(e.getFormatType()),o.setIndent(e.getIndent()),e.remove(),i}function Df(e,t){const n=e.getLastChild(),r=t.getFirstChild();n&&r&&yn(n)&&yn(r)&&(Df(n.getFirstChild(),r.getFirstChild()),r.remove());const o=t.getChildren();o.length>0&&e.append(...o),t.remove()}function Q3(){const e=G();if(W(e)){const t=new Set,n=e.getNodes(),r=e.anchor.getNode();if(Lx(r,n))t.add(Yu(r));else for(let o=0;o<n.length;o++){const i=n[o];if(K_(i)){const s=F3(i,Er);s!=null&&t.add(Yu(s))}}for(const o of t){let i=o;const s=Fx(o);for(const a of s){const l=me().setTextStyle(e.style).setTextFormat(e.format);to(l,a.getChildren()),i.insertAfter(l),i=l,a.__key===e.anchor.key&&nn(e.anchor,bt(Ct(l,"next"))),a.__key===e.focus.key&&nn(e.focus,bt(Ct(l,"next"))),a.remove()}o.remove()}}}function Ox(e){const t=e.getListType()!=="check";let n=e.getStart();for(const r of e.getChildren())Ee(r)&&(r.getValue()!==n&&r.setValue(n),t&&r.getLatest().__checked!=null&&r.setChecked(void 0),ge(r.getFirstChild())||n++)}function eA(e){const t=new Set;if(yn(e)||t.has(e.getKey()))return;const n=e.getParent(),r=e.getNextSibling(),o=e.getPreviousSibling();if(yn(r)&&yn(o)){const i=o.getFirstChild();if(ge(i)){i.append(e);const s=r.getFirstChild();ge(s)&&(to(i,s.getChildren()),r.remove(),t.add(r.getKey()))}}else if(yn(r)){const i=r.getFirstChild();if(ge(i)){const s=i.getFirstChild();s!==null&&s.insertBefore(e)}}else if(yn(o)){const i=o.getFirstChild();ge(i)&&i.append(e)}else if(ge(n)){const i=It().setTextFormat(e.getTextFormat()).setTextStyle(e.getTextStyle()),s=Mt(n.getListType()).setTextFormat(n.getTextFormat()).setTextStyle(n.getTextStyle());i.append(s),s.append(e),o?o.insertAfter(i):r?r.insertBefore(i):n.append(i)}}function tA(e){if(yn(e))return;const t=e.getParent(),n=t?t.getParent():void 0;if(ge(n?n.getParent():void 0)&&Ee(n)&&ge(t)){const r=t?t.getFirstChild():void 0,o=t?t.getLastChild():void 0;if(e.is(r))n.insertBefore(e),t.isEmpty()&&n.remove();else if(e.is(o))n.insertAfter(e),t.isEmpty()&&n.remove();else{const i=t.getListType(),s=It(),a=Mt(i);s.append(a),e.getPreviousSiblings().forEach(u=>a.append(u));const l=It(),c=Mt(i);l.append(c),to(c,e.getNextSiblings()),n.insertBefore(s),n.insertAfter(l),n.replace(e)}}}function nA(){const e=G();if(!W(e)||!e.isCollapsed())return!1;const t=e.anchor.getNode();if(!Ee(t)||t.getChildrenSize()!==0)return!1;const n=Yu(t),r=t.getParent();ge(r)||ir(40);const o=r.getParent();let i;if(dt(o))i=me(),n.insertAfter(i);else{if(!Ee(o))return!1;i=It(),o.insertAfter(i)}i.setTextStyle(e.style).setTextFormat(e.format).select();const s=t.getNextSiblings();if(s.length>0){const a=Mt(r.getListType());if(Ee(i)){const l=It();l.append(a),i.insertAfter(l)}else i.insertAfter(a);a.append(...s)}return(function(a){let l=a;for(;l.getNextSibling()==null&&l.getPreviousSibling()==null;){const c=l.getParent();if(c==null||!Ee(c)&&!ge(c))break;l=c}l.remove()})(t),!0}function Fa(...e){const t=[];for(const n of e)if(n&&typeof n=="string")for(const[r]of n.matchAll(/\S+/g))t.push(r);return t}let Er=class extends yt{__value;__checked;$config(){return this.config("listitem",{$transform:t=>{if(t.__checked==null)return;const n=t.getParent();ge(n)&&n.getListType()!=="check"&&t.getChecked()!=null&&t.setChecked(void 0)},extends:yt,importDOM:{li:()=>({conversion:rA,priority:0})}})}constructor(t=1,n=void 0,r){super(r),this.__value=t===void 0?1:t,this.__checked=n}afterCloneFrom(t){super.afterCloneFrom(t),this.__value=t.__value,this.__checked=t.__checked}createDOM(t){const n=document.createElement("li");return this.updateListItemDOM(null,n,t),n}updateListItemDOM(t,n,r){(function(s,a,l){const c=a.getParent();!ge(c)||c.getListType()!=="check"||ge(a.getFirstChild())?(s.removeAttribute("role"),s.removeAttribute("tabIndex"),s.removeAttribute("aria-checked")):(s.setAttribute("role","checkbox"),s.setAttribute("tabIndex","-1"),l&&a.__checked===l.__checked||s.setAttribute("aria-checked",a.getChecked()?"true":"false"))})(n,this,t),n.value=this.__value,(function(s,a,l){const c=[],u=[],f=a.list,d=f?f.listitem:void 0;let h;if(f&&f.nested&&(h=f.nested.listitem),d!==void 0&&c.push(...Fa(d)),f){const g=l.getParent(),p=ge(g)&&g.getListType()==="check",m=l.getChecked();p&&!m||u.push(f.listitemUnchecked),p&&m||u.push(f.listitemChecked),p&&c.push(m?f.listitemChecked:f.listitemUnchecked)}if(h!==void 0){const g=Fa(h);l.getChildren().some(p=>ge(p))?c.push(...g):u.push(...g)}u.length>0&&Rn(s,...u),c.length>0&&Ye(s,...c)})(n,r.theme,this);const o=t?t.__style:"",i=this.__style;o!==i&&(i===""?n.removeAttribute("style"):n.style.cssText=i),(function(s,a,l){const c=Up(a.__textStyle);for(const u in c)s.style.setProperty(`--listitem-marker-${u}`,c[u]);if(l)for(const u in Up(l.__textStyle))u in c||s.style.removeProperty(`--listitem-marker-${u}`)})(n,this,t)}updateDOM(t,n,r){const o=n;return this.updateListItemDOM(t,o,r),!1}updateFromJSON(t){return super.updateFromJSON(t).setValue(t.value).setChecked(t.checked)}exportDOM(t){const n=this.createDOM(t._config),r=this.getFormatType();r&&(n.style.textAlign=r);const o=this.getDirection();return o&&(n.dir=o),{element:n}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...t){for(let n=0;n<t.length;n++){const r=t[n];if(V(r)&&this.canMergeWith(r)){const o=r.getChildren();this.append(...o),r.remove()}else super.append(r)}return this}replace(t,n){if(Ee(t))return super.replace(t);this.setIndent(0);const r=this.getParentOrThrow();if(!ge(r))return t;if(r.__first===this.getKey())r.insertBefore(t);else if(r.__last===this.getKey())r.insertAfter(t);else{const o=Mt(r.getListType());let i=this.getNextSibling();for(;i;){const s=i;i=i.getNextSibling(),o.append(s)}r.insertAfter(t),t.insertAfter(o)}return n&&(V(t)||ir(139),this.getChildren().forEach(o=>{t.append(o)})),this.remove(),r.getChildrenSize()===0&&r.remove(),t}insertAfter(t,n=!0){const r=this.getParentOrThrow();if(ge(r)||ir(39),Ee(t))return super.insertAfter(t,n);const o=this.getNextSiblings();if(r.insertAfter(t,n),o.length!==0){const i=Mt(r.getListType());o.forEach(s=>i.append(s)),t.insertAfter(i,n)}return t}remove(t){const n=this.getPreviousSibling(),r=this.getNextSibling();super.remove(t),n&&r&&yn(n)&&yn(r)&&(Df(n.getFirstChild(),r.getFirstChild()),r.remove())}insertNewAfter(t,n=!0){const r=It().updateFromJSON(this.exportJSON()).setChecked(!this.getChecked()&&void 0);return this.insertAfter(r,n),r}collapseAtStart(t){const n=me();this.getChildren().forEach(s=>n.append(s));const r=this.getParentOrThrow(),o=r.getParentOrThrow(),i=Ee(o);if(r.getChildrenSize()===1)if(i)r.remove(),o.select();else{r.insertBefore(n),r.remove();const s=t.anchor,a=t.focus,l=n.getKey();s.type==="element"&&s.getNode().is(this)&&s.set(l,s.offset,"element"),a.type==="element"&&a.getNode().is(this)&&a.set(l,a.offset,"element")}else r.insertBefore(n),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(t){const n=this.getWritable();return n.__value=t,n}getChecked(){const t=this.getLatest();let n;const r=this.getParent();return ge(r)&&(n=r.getListType()),n==="check"?!!t.__checked:void 0}setChecked(t){const n=this.getWritable();return n.__checked=t,n}toggleChecked(){const t=this.getWritable();return t.setChecked(!t.__checked)}getIndent(){const t=this.getParent();if(t===null||!this.isAttached())return this.getLatest().__indent;let n=t.getParentOrThrow(),r=0;for(;Ee(n);)n=n.getParentOrThrow().getParentOrThrow(),r++;return r}setIndent(t){typeof t!="number"&&ir(117),(t=Math.floor(t))>=0||ir(199);let n=this.getIndent();for(;n!==t;)n<t?(eA(this),n++):(tA(this),n--);return this}canInsertAfter(t){return Ee(t)}canReplaceWith(t){return Ee(t)}canMergeWith(t){return Ee(t)||Sr(t)}extractWithChild(t,n){if(!W(n))return!1;const r=n.anchor.getNode(),o=n.focus.getNode();return this.isParentOf(r)&&this.isParentOf(o)&&this.getTextContent().length===n.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return Mt("bullet")}canMergeWhenEmpty(){return!0}};function rA(e){if(e.classList.contains("task-list-item")){for(const n of e.children)if(n.tagName==="INPUT")return im(n)}if(e.classList.contains("joplin-checkbox")){for(const n of e.children)if(n.classList.contains("checkbox-wrapper")&&n.children.length>0&&n.children[0].tagName==="INPUT")return im(n.children[0])}const t=e.getAttribute("aria-checked");return{node:It(t==="true"||t!=="false"&&void 0)}}function im(e){return e.getAttribute("type")!=="checkbox"?{node:null}:{node:It(e.hasAttribute("checked"))}}function It(e){return vt(new Er(void 0,e))}function Ee(e){return e instanceof Er}let uo=class extends yt{__tag;__start;__listType;$config(){return this.config("list",{$transform:t=>{(function(n){const r=n.getNextSibling();ge(r)&&n.getListType()===r.getListType()&&Df(n,r)})(t),Ox(t)},extends:yt,importDOM:{ol:()=>({conversion:am,priority:0}),ul:()=>({conversion:am,priority:0})}})}constructor(t="number",n=1,r){super(r);const o=iA[t]||t;this.__listType=o,this.__tag=o==="number"?"ol":"ul",this.__start=n}afterCloneFrom(t){super.afterCloneFrom(t),this.__listType=t.__listType,this.__tag=t.__tag,this.__start=t.__start}getTag(){return this.getLatest().__tag}setListType(t){const n=this.getWritable();return n.__listType=t,n.__tag=t==="number"?"ol":"ul",n}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(t){const n=this.getWritable();return n.__start=t,n}createDOM(t,n){const r=this.__tag,o=document.createElement(r);return this.__start!==1&&o.setAttribute("start",String(this.__start)),o.__lexicalListType=this.__listType,sm(o,t.theme,this),o}updateDOM(t,n,r){return t.__tag!==this.__tag||t.__listType!==this.__listType||(sm(n,r.theme,this),!1)}updateFromJSON(t){return super.updateFromJSON(t).setListType(t.listType).setStart(t.start)}exportDOM(t){const n=this.createDOM(t._config,t);return je(n)&&(this.__start!==1&&n.setAttribute("start",String(this.__start)),this.__listType==="check"&&n.setAttribute("__lexicalListType","check")),{element:n}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}splice(t,n,r){let o=r;for(let i=0;i<r.length;i++){const s=r[i];Ee(s)||(o===r&&(o=[...r]),o[i]=It().append(!V(s)||ge(s)||s.isInline()?s:Pe(s.getTextContent())))}return super.splice(t,n,o)}extractWithChild(t){return Ee(t)}};function sm(e,t,n){const r=[],o=[],i=t.list;if(i!==void 0){const s=i[`${n.__tag}Depth`]||[],a=qu(n)-1,l=a%s.length,c=s[l],u=i[n.__tag];let f;const d=i.nested,h=i.checklist;if(d!==void 0&&d.list&&(f=d.list),u!==void 0&&r.push(u),h!==void 0&&n.__listType==="check"&&r.push(h),c!==void 0){r.push(...Fa(c));for(let g=0;g<s.length;g++)g!==l&&o.push(n.__tag+g)}if(f!==void 0){const g=Fa(f);a>1?r.push(...g):o.push(...g)}}o.length>0&&Rn(e,...o),r.length>0&&Ye(e,...r)}function oA(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n];if(Ee(r)){t.push(r);const o=r.getChildren();o.length>1&&o.forEach(i=>{ge(i)&&t.push(nm(i))})}else t.push(nm(r))}return t}function am(e){const t=e.nodeName.toLowerCase();let n=null;return t==="ol"?n=Mt("number",e.start):t==="ul"&&(n=(function(r){if(r.getAttribute("__lexicallisttype")==="check"||r.classList.contains("contains-task-list")||r.getAttribute("data-is-checklist")==="1")return!0;for(const o of r.childNodes)if(je(o)&&o.hasAttribute("aria-checked"))return!0;return!1})(e)?Mt("check"):Mt("bullet")),{after:oA,node:n}}const iA={ol:"number",ul:"bullet"};function Mt(e="number",t=1){return vt(new uo(e,t))}function ge(e){return e instanceof uo}const sA=ie("UPDATE_LIST_START_COMMAND"),Ix=ie("INSERT_UNORDERED_LIST_COMMAND"),$x=ie("INSERT_ORDERED_LIST_COMMAND"),aA=ie("REMOVE_LIST_COMMAND");function lA(e){return cn(e.registerCommand($x,()=>(rm("number"),!0),jn),e.registerCommand(sA,t=>{const{listNodeKey:n,newStart:r}=t,o=Me(n);return!!ge(o)&&(o.getListType()==="number"&&(o.setStart(r),Ox(o)),!0)},jn),e.registerCommand(Ix,()=>(rm("bullet"),!0),jn),e.registerCommand(aA,()=>(Q3(),!0),jn),e.registerCommand(Yr,()=>nA(),jn),e.registerNodeTransform(Er,t=>{const n=t.getFirstChild();if(n){if(Y(n)){const r=n.getStyle(),o=n.getFormat();t.getTextStyle()!==r&&t.setTextStyle(r),t.getTextFormat()!==o&&t.setTextFormat(o)}}else{const r=G();W(r)&&(r.style!==t.getTextStyle()||r.format!==t.getTextFormat())&&r.isCollapsed()&&t.is(r.anchor.getNode())&&t.setTextStyle(r.style).setTextFormat(r.format)}}),e.registerNodeTransform(Gt,t=>{const n=t.getParent();if(Ee(n)&&t.is(n.getFirstChild())){const r=t.getStyle(),o=t.getFormat();r===n.getTextStyle()&&o===n.getTextFormat()||n.setTextStyle(r).setTextFormat(o)}}))}function cA(e){const t=n=>{const r=n.getParent();if(ge(n.getFirstChild())||!ge(r))return;const o=xe(n,i=>Ee(i)&&ge(i.getParent())&&Ee(i.getPreviousSibling()));if(o===null&&n.getIndent()>0)n.setIndent(0);else if(Ee(o)){const i=o.getPreviousSibling();if(Ee(i)){const s=(function(l){let c=l,u=c.getFirstChild();for(;ge(u);){const f=u.getLastChild();if(!Ee(f))break;c=f,u=c.getFirstChild()}return c})(i),a=s.getParent();if(ge(a)){const l=qu(a);l+1<qu(r)&&n.setIndent(l)}}}};return e.registerNodeTransform(uo,n=>{const r=[n];for(;r.length>0;){const o=r.shift();if(ge(o)){for(const i of o.getChildren())if(Ee(i)){t(i);const s=i.getFirstChild();ge(s)&&r.push(s)}}}})}function uA(e,t){const n=H_(t)?t.body.childNodes:t.childNodes;let r=[];const o=[];for(const i of n)if(!Vx.has(i.nodeName)){const s=jx(i,e,o,!1);s!==null&&(r=r.concat(s))}return(function(i){for(const s of i)s.getNextSibling()instanceof vf&&s.insertAfter(an());for(const s of i){const a=s.getChildren();for(const l of a)s.insertBefore(l);s.remove()}})(o),r}function dA(e,t){if(typeof document>"u"||typeof window>"u"&&global.window===void 0)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const n=document.createElement("div"),r=Ke().getChildren();for(let o=0;o<r.length;o++)Dx(e,r[o],n,t);return n.innerHTML}function Dx(e,t,n,r=null){let o=r===null||t.isSelected(r);const i=V(t)&&t.excludeFromCopy("html");let s=t;r!==null&&Y(t)&&(s=fx(r,t,"clone"));const a=V(s)?s.getChildren():[],l=xf(e,s.getType());let c;c=l&&l.exportDOM!==void 0?l.exportDOM(e,s):s.exportDOM(e);const{element:u,after:f}=c;if(!u)return!1;const d=document.createDocumentFragment();for(let h=0;h<a.length;h++){const g=a[h],p=Dx(e,g,d,r);!o&&V(t)&&p&&t.extractWithChild(g,r,"html")&&(o=!0)}if(o&&!i){if((je(u)||Wu(u))&&u.append(d),n.append(u),f){const h=f.call(s,u);h&&(Wu(u)?u.replaceChildren(h):u.replaceWith(h))}}else n.append(d);return o}const Vx=new Set(["STYLE","SCRIPT"]);function jx(e,t,n,r,o=new Map,i){let s=[];if(Vx.has(e.nodeName))return s;let a=null;const l=(function(g,p){const{nodeName:m}=g,_=p._htmlConversions.get(m.toLowerCase());let y=null;if(_!==void 0)for(const v of _){const x=v(g);x!==null&&(y===null||(y.priority||0)<=(x.priority||0))&&(y=x)}return y!==null?y.conversion:null})(e,t),c=l?l(e):null;let u=null;if(c!==null){u=c.after;const g=c.node;if(a=Array.isArray(g)?g[g.length-1]:g,a!==null){for(const[,p]of o)if(a=p(a,i),!a)break;a&&s.push(...Array.isArray(g)?g:[a])}c.forChild!=null&&o.set(e.nodeName,c.forChild)}const f=e.childNodes;let d=[];const h=(a==null||!dt(a))&&(a!=null&&Du(a)||r);for(let g=0;g<f.length;g++)d.push(...jx(f[g],t,n,h,new Map(o),a));return u!=null&&(d=u(d)),Pa(e)&&(d=fA(e,d,h?()=>{const g=new vf;return n.push(g),g}:me)),a==null?d.length>0?s=s.concat(d):Pa(e)&&(function(g){return g.nextSibling==null||g.previousSibling==null?!1:Hu(g.nextSibling)&&Hu(g.previousSibling)})(e)&&(s=s.concat(an())):V(a)&&a.append(...d),s}function fA(e,t,n){const r=e.style.textAlign,o=[];let i=[];for(let s=0;s<t.length;s++){const a=t[s];if(Du(a))r&&!a.getFormat()&&a.setFormat(r),o.push(a);else if(i.push(a),s===t.length-1||s<t.length-1&&Du(t[s+1])){const l=n();l.setFormat(r),l.append(...i),o.push(l),i=[]}}return o}function La(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function hA(e,t=G()){return t==null&&La(166),W(t)&&t.isCollapsed()||t.getNodes().length===0?"":dA(e,t)}function gA(e,t=G()){return t==null&&La(166),W(t)&&t.isCollapsed()||t.getNodes().length===0?null:JSON.stringify(pA(e,t))}function lm(e,t,n){const r=e.getData("application/x-lexical-editor");if(r)try{const a=JSON.parse(r);if(a.namespace===n._config.namespace&&Array.isArray(a.nodes))return cm(n,mA(a.nodes),t)}catch(a){console.error(a)}const o=e.getData("text/html"),i=e.getData("text/plain");if(o&&i!==o)try{const a=new DOMParser().parseFromString((function(l){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:c=>c}).createHTML(l):l})(o),"text/html");return cm(n,uA(n,a),t)}catch(a){console.error(a)}const s=i||e.getData("text/uri-list");if(s!=null)if(W(t)){const a=s.split(/(\r?\n|\t)/);a[a.length-1]===""&&a.pop();for(let l=0;l<a.length;l++){const c=G();if(W(c)){const u=a[l];u===`
|
|
19
|
+
`?r.push(sn()):s===" "?r.push(ai()):r.push(Pe(s))}this.insertNodes(r)}insertText(t){const n=this.anchor,r=this.focus,o=this.format,i=this.style;let s=n,a=r;!this.isCollapsed()&&r.isBefore(n)&&(s=r,a=n),s.type==="element"&&(function(m,_,y,v){const x=m.getNode(),b=x.getChildAtIndex(m.offset),w=Pe();if(w.setFormat(y),w.setStyle(v),Sr(b))b.splice(0,0,[w]);else{const T=tt(x)?me().append(w):w;b===null?x.append(T):b.insertBefore(T)}m.is(_)&&_.set(w.__key,0,"text"),m.set(w.__key,0,"text")})(s,a,o,i),a.type==="element"&&tn(a,bt(an(a,"next")));const l=s.offset;let c=a.offset;const u=this.getNodes(),f=u.length;let d=u[0];Y(d)||U(26);const h=d.getTextContent().length,g=d.getParentOrThrow();let p=u[f-1];if(f===1&&a.type==="element"&&(c=h,a.set(s.key,c,"text")),this.isCollapsed()&&l===h&&(In(d)||!d.canInsertTextAfter()||!g.canInsertTextAfter()&&d.getNextSibling()===null)){let m=d.getNextSibling();if(Y(m)&&m.canInsertTextBefore()&&!In(m)||(m=Pe(),m.setFormat(o),m.setStyle(i),g.canInsertTextAfter()?d.insertAfter(m):g.insertAfter(m)),m.select(0,0),d=m,t!=="")return void this.insertText(t)}else if(this.isCollapsed()&&l===0&&(In(d)||!d.canInsertTextBefore()||!g.canInsertTextBefore()&&d.getPreviousSibling()===null)){let m=d.getPreviousSibling();if(Y(m)&&!In(m)||(m=Pe(),m.setFormat(o),g.canInsertTextBefore()?d.insertBefore(m):g.insertBefore(m)),m.select(),d=m,t!=="")return void this.insertText(t)}else if(d.isSegmented()&&l!==h){const m=Pe(d.getTextContent());m.setFormat(o),d.replace(m),d=m}else if(!this.isCollapsed()&&t!==""){const m=p.getParent();if(!g.canInsertTextBefore()||!g.canInsertTextAfter()||V(m)&&(!m.canInsertTextBefore()||!m.canInsertTextAfter()))return this.insertText(""),M_(this.anchor,this.focus,null),void this.insertText(t)}if(f===1){if(Hr(d)){const v=Pe(t);return v.select(),void d.replace(v)}const m=d.getFormat(),_=d.getStyle();if(l!==c||m===o&&_===i){if(nl(d)){const v=Pe(t);return v.setFormat(o),v.setStyle(i),v.select(),void d.replace(v)}}else{if(d.getTextContent()!==""){const v=Pe(t);if(v.setFormat(o),v.setStyle(i),v.select(),l===0)d.insertBefore(v,!1);else{const[x]=d.splitText(l);x.insertAfter(v,!1)}return void(v.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=t.length))}d.setFormat(o),d.setStyle(i)}const y=c-l;d=d.spliceText(l,y,t,!0),d.getTextContent()===""?d.remove():this.anchor.type==="text"&&(d.isComposing()?this.anchor.offset-=t.length:(this.format=m,this.style=_))}else{const m=new Set([...d.getParentKeys(),...p.getParentKeys()]),_=V(d)?d:d.getParentOrThrow();let y=V(p)?p:p.getParentOrThrow(),v=p;if(!_.is(y)&&y.isInline())do v=y,y=y.getParentOrThrow();while(y.isInline());if(a.type==="text"&&(c!==0||p.getTextContent()==="")||a.type==="element"&&p.getIndexWithinParent()<c)if(Y(p)&&!Hr(p)&&c!==p.getTextContentSize()){if(p.isSegmented()){const E=Pe(p.getTextContent());p.replace(E),p=E}tt(a.getNode())||a.type!=="text"||(p=p.spliceText(0,c,"")),m.add(p.__key)}else{const E=p.getParentOrThrow();E.canBeEmpty()||E.getChildrenSize()!==1?p.remove():E.remove()}else m.add(p.__key);const x=y.getChildren(),b=new Set(u),w=_.is(y),T=_.isInline()&&d.getNextSibling()===null?_:d;for(let E=x.length-1;E>=0;E--){const R=x[E];if(R.is(d)||V(R)&&R.isParentOf(d))break;R.isAttached()&&(!b.has(R)||R.is(v)?w||T.insertAfter(R,!1):R.remove())}if(!w){let E=y,R=null;for(;E!==null;){const M=E.getChildren(),O=M.length;(O===0||M[O-1].is(R))&&(m.delete(E.__key),R=E),E=E.getParent()}}if(Hr(d))if(l===h)d.select();else{const E=Pe(t);E.select(),d.replace(E)}else d=d.spliceText(l,h-l,t,!0),d.getTextContent()===""?d.remove():d.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=t.length);for(let E=1;E<f;E++){const R=u[E],M=R.__key;m.has(M)||R.remove()}}}removeText(){const t=G()===this;ia(this,w3(Hp(this))),t&&G()!==this&&He(this)}formatText(t,n=null){if(this.isCollapsed())return this.toggleFormat(t),void ut(null);const r=this.getNodes(),o=[];for(const x of r)Y(x)&&o.push(x);const i=x=>{r.forEach(b=>{if(V(b)){const w=b.getFormatFlags(t,x);b.setTextFormat(w)}})},s=o.length;if(s===0)return this.toggleFormat(t),ut(null),void i(n);const a=this.anchor,l=this.focus,c=this.isBackward(),u=c?l:a,f=c?a:l;let d=0,h=o[0],g=u.type==="element"?0:u.offset;if(u.type==="text"&&g===h.getTextContentSize()&&(d=1,h=o[1],g=0),h==null)return;const p=h.getFormatFlags(t,n);i(p);const m=s-1;let _=o[m];const y=f.type==="text"?f.offset:_.getTextContentSize();if(h.is(_)){if(g===y)return;if(In(h)||g===0&&y===h.getTextContentSize())h.setFormat(p);else{const x=h.splitText(g,y),b=g===0?x[0]:x[1];b.setFormat(p),u.type==="text"&&u.set(b.__key,0,"text"),f.type==="text"&&f.set(b.__key,y-g,"text")}return void(this.format=p)}g===0||In(h)||([,h]=h.splitText(g),g=0),h.setFormat(p);const v=_.getFormatFlags(t,p);y>0&&(y===_.getTextContentSize()||In(_)||([_]=_.splitText(y)),_.setFormat(v));for(let x=d+1;x<m;x++){const b=o[x],w=b.getFormatFlags(t,v);b.setFormat(w)}u.type==="text"&&u.set(h.__key,g,"text"),f.type==="text"&&f.set(_.__key,y,"text"),this.format=p|v}insertNodes(t){if(t.length===0)return;if(this.isCollapsed()||this.removeText(),this.anchor.key==="root"){this.insertParagraph();const g=G();return W(g)||U(134),g.insertNodes(t)}const n=(this.isBackward()?this.focus:this.anchor).getNode(),r=xe(n,nr),o=t[t.length-1];if(V(r)&&"__language"in r){if("__language"in t[0])this.insertText(t[0].getTextContent());else{const g=oc(this);r.splice(g,0,t),o.selectEnd()}return}if(!t.some(g=>(V(g)||Ce(g))&&!g.isInline())){V(r)||U(211,n.constructor.name,n.getType());const g=oc(this);return r.splice(g,0,t),void o.selectEnd()}const i=(function(g){const p=me();let m=null;for(let _=0;_<g.length;_++){const y=g[_],v=wn(y);if(v||Ce(y)&&y.isInline()||V(y)&&y.isInline()||Y(y)||y.isParentRequired()){if(m===null&&(m=y.createParentElementNode(),p.append(m),v))continue;m!==null&&m.append(y)}else p.append(y),m=null}return p})(t),s=i.getLastDescendant(),a=i.getChildren(),l=!V(r)||!r.isEmpty()?this.insertParagraph():null,c=a[a.length-1];let u=a[0];var f;V(f=u)&&nr(f)&&!f.isEmpty()&&V(r)&&(!r.isEmpty()||r.canMergeWhenEmpty())&&(V(r)||U(211,n.constructor.name,n.getType()),r.append(...u.getChildren()),u=a[1]),u&&(r===null&&U(212,n.constructor.name,n.getType()),(function(g,p){const m=p.getParentOrThrow().getLastChild();let _=p;const y=[p];for(;_!==m;)_.getNextSibling()||U(140),_=_.getNextSibling(),y.push(_);let v=g;for(const x of y)v=v.insertAfter(x)})(r,u));const d=xe(s,nr);l&&V(d)&&(l.canMergeWhenEmpty()||nr(c))&&(d.append(...l.getChildren()),l.remove()),V(r)&&r.isEmpty()&&r.remove(),s.selectEnd();const h=V(r)?r.getLastChild():null;wn(h)&&d!==r&&h.remove()}insertParagraph(){if(this.anchor.key==="root"){const s=me();return Ke().splice(this.anchor.offset,0,[s]),s.select(),s}const t=oc(this),n=xe(this.anchor.getNode(),nr);V(n)||U(213);const r=n.getChildAtIndex(t),o=r?[r,...r.getNextSiblings()]:[],i=n.insertNewAfter(this,!1);return i?(i.append(...o),i.selectStart(),i):null}insertLineBreak(t){const n=sn();if(this.insertNodes([n]),t){const r=n.getParentOrThrow(),o=n.getIndexWithinParent();r.select(o,o)}}extract(){const t=[...this.getNodes()],n=t.length;let r=t[0],o=t[n-1];const[i,s]=$u(this),a=this.isBackward(),[l,c]=a?[this.focus,this.anchor]:[this.anchor,this.focus],[u,f]=a?[s,i]:[i,s];if(n===0)return[];if(n===1){if(Y(r)&&!this.isCollapsed()){const d=r.splitText(u,f),h=u===0?d[0]:d[1];return h?(l.set(h.getKey(),0,"text"),c.set(h.getKey(),h.getTextContentSize(),"text"),[h]):[]}return[r]}if(Y(r)&&(u===r.getTextContentSize()?t.shift():u!==0&&([,r]=r.splitText(u),t[0]=r,l.set(r.getKey(),0,"text"))),Y(o)){const d=o.getTextContent().length;f===0?t.pop():f!==d&&([o]=o.splitText(f),t[t.length-1]=o,c.set(o.getKey(),o.getTextContentSize(),"text"))}return t}modify(t,n,r){if(Tp(this,t,n,r))return;const o=t==="move",i=Fe(),s=St(qt(i));if(!s)return;const a=i._blockCursorElement,l=i._rootElement,c=this.focus.getNode();if(l===null||a===null||!V(c)||c.isInline()||c.canBeEmpty()||zu(a,i,l),this.dirty){let u=Jr(i,this.anchor.key),f=Jr(i,this.focus.key);this.anchor.type==="text"&&(u=Jo(u)),this.focus.type==="text"&&(f=Jo(f)),u&&f&&F_(s,u,this.anchor.offset,f,this.focus.offset)}if((function(u,f,d,h){u.modify(f,d,h)})(s,t,n?"backward":"forward",r),s.rangeCount>0){const u=s.getRangeAt(0),f=this.anchor.getNode(),d=tt(f)?f:l3(f);if(this.applyDOMRange(u),this.dirty=!0,!o){const h=this.getNodes(),g=[];let p=!1;for(let m=0;m<h.length;m++){const _=h[m];Bu(_,d)?g.push(_):p=!0}if(p&&g.length>0)if(n){const m=g[0];V(m)?m.selectStart():m.getParentOrThrow().selectStart()}else{const m=g[g.length-1];V(m)?m.selectEnd():m.getParentOrThrow().selectEnd()}s.anchorNode===u.startContainer&&s.anchorOffset===u.startOffset||(function(m){const _=m.focus,y=m.anchor,v=y.key,x=y.offset,b=y.type;y.set(_.key,_.offset,_.type,!0),_.set(v,x,b,!0)})(this)}}r==="lineboundary"&&Tp(this,t,n,r,"decorators")}forwardDeletion(t,n,r){if(!r&&(t.type==="element"&&V(n)&&t.offset===n.getChildrenSize()||t.type==="text"&&t.offset===n.getTextContentSize())){const o=n.getParent(),i=n.getNextSibling()||(o===null?null:o.getNextSibling());if(V(i)&&i.isShadowRoot())return!0}return!1}deleteCharacter(t){const n=this.isCollapsed();if(this.isCollapsed()){const r=this.anchor;let o=r.getNode();if(this.forwardDeletion(r,o,t))return;const i=Qi(an(r,t?"previous":"next"));if(i.getTextSlices().every(a=>a===null||a.distance===0)){let a={type:"initial"};for(const l of i.iterNodeCarets("shadowRoot"))if(At(l)){if(!l.origin.isInline()){if(l.origin.isShadowRoot()){if(a.type==="merge-block")break;if(V(i.anchor.origin)&&i.anchor.origin.isEmpty()){const c=bt(l);ia(this,mr(c,c)),i.anchor.origin.remove()}return}a.type!=="merge-next-block"&&a.type!=="merge-block"||(a={block:a.block,caret:l,type:"merge-block"})}}else{if(a.type==="merge-block")break;if(pr(l)){if(V(l.origin)){if(l.origin.isInline()){if(!l.origin.isParentOf(i.anchor.origin))break}else a={block:l.origin,type:"merge-next-block"};continue}if(Ce(l.origin)){if(!l.origin.isIsolated())if(a.type==="merge-next-block"&&(l.origin.isKeyboardSelectable()||!l.origin.isInline())&&V(i.anchor.origin)&&i.anchor.origin.isEmpty()){i.anchor.origin.remove();const c=gf();c.add(l.origin.getKey()),He(c)}else l.origin.remove();return}break}}if(a.type==="merge-block"){const{caret:l,block:c}=a;return ia(this,mr(!l.origin.isEmpty()&&c.isEmpty()?gs(Je(c,l.direction)):i.anchor,l)),this.removeText()}}const s=this.focus;if(this.modify("extend",t,"character"),this.isCollapsed()){if(t&&r.offset===0&&xp(this,r.getNode()))return}else{const a=s.type==="text"?s.getNode():null;if(o=r.type==="text"?r.getNode():null,a!==null&&a.isSegmented()){const l=s.offset,c=a.getTextContentSize();if(a.is(o)||t&&l!==c||!t&&l!==0)return void bp(a,t,l)}else if(o!==null&&o.isSegmented()){const l=r.offset,c=o.getTextContentSize();if(o.is(a)||t&&l!==0||!t&&l!==c)return void bp(o,t,l)}(function(l,c){const u=l.anchor,f=l.focus,d=u.getNode(),h=f.getNode();if(d===h&&u.type==="text"&&f.type==="text"){const g=u.offset,p=f.offset,m=g<p,_=m?g:p,y=m?p:g,v=y-1;_!==v&&(function(x){return!(X_(x)||Kk(x))})(d.getTextContent().slice(_,y))&&(c?f.set(f.key,v,f.type):u.set(u.key,v,u.type))}})(this,t)}}if(this.removeText(),t&&!n&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const r=this.anchor.getNode();r.isEmpty()&&tt(r.getParent())&&r.getPreviousSibling()===null&&xp(this,r)}}deleteLine(t){this.isCollapsed()&&this.modify("extend",t,"lineboundary"),this.isCollapsed()?this.deleteCharacter(t):this.removeText()}deleteWord(t){if(this.isCollapsed()){const n=this.anchor,r=n.getNode();if(this.forwardDeletion(n,r,t))return;this.modify("extend",t,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function gt(e){return e instanceof rl}function _p(e){const t=e.offset;if(e.type==="text")return t;const n=e.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function $u(e){const t=e.getStartEndPoints();if(t===null)return[0,0];const[n,r]=t;return n.type==="element"&&r.type==="element"&&n.key===r.key&&n.offset===r.offset?[0,0]:[_p(n),_p(r)]}function xp(e,t){for(let n=t;n;n=n.getParent()){if(V(n)){if(n.collapseAtStart(e))return!0;if(dt(n))break}if(n.getPreviousSibling())break}return!1}const Kk=(()=>{try{const e=new RegExp("\\p{Emoji}","u"),t=e.test.bind(e);if(t("❤️")&&t("#️⃣")&&t("👍"))return t}catch{}return()=>!1})();function bp(e,t,n){const r=e,o=r.getTextContent().split(/(?=\s)/g),i=o.length;let s=0,a=0;for(let c=0;c<i;c++){const u=c===i-1;if(a=s,s+=o[c].length,t&&s===n||s>n||u){o.splice(c,1),u&&(a=void 0);break}}const l=o.join("").trim();l===""?r.remove():(r.setTextContent(l),r.select(a,a))}function Cp(e,t,n,r){let o,i=t;if(je(e)){let s=!1;const a=e.childNodes,l=a.length,c=r._blockCursorElement;i===l&&(s=!0,i=l-1);let u=a[i],f=!1;if(u===c)u=a[i+1],f=!0;else if(c!==null){const d=c.parentNode;e===d&&t>Array.prototype.indexOf.call(d.children,c)&&i--}if(o=Lo(u),Y(o))i=Tn(o,s?"next":"previous");else{let d=Lo(e);if(d===null)return null;if(V(d)){const h=r.getElementByKey(d.getKey());h===null&&U(214),[d,i]=d.getDOMSlot(h).resolveChildIndex(d,h,e,t),V(d)||U(215),s&&i>=d.getChildrenSize()&&(i=Math.max(0,d.getChildrenSize()-1));let p=d.getChildAtIndex(i);if(V(p)&&(function(m,_,y){const v=m.getParent();return y===null||v===null||!v.canBeEmpty()||v!==y.getNode()})(p,0,n)){const m=s?p.getLastDescendant():p.getFirstDescendant();m===null?d=p:(p=m,d=V(p)?p:p.getParentOrThrow()),i=0}Y(p)?(o=p,d=null,i=Tn(p,s?"next":"previous")):p!==d&&s&&!f&&(V(d)||U(216),i=Math.min(d.getChildrenSize(),i+1))}else{const h=d.getIndexWithinParent();i=t===0&&Ce(d)&&Lo(e)===d?h:h+1,d=d.getParentOrThrow()}if(V(d))return Pt(d.__key,i,"element")}}else o=Lo(e);return Y(o)?Pt(o.__key,Tn(o,i,"clamp"),"text"):null}function wp(e,t,n){const r=e.offset,o=e.getNode();if(r===0){const i=o.getPreviousSibling(),s=o.getParent();if(t){if((n||!t)&&i===null&&V(s)&&s.isInline()){const a=s.getPreviousSibling();Y(a)&&e.set(a.__key,a.getTextContent().length,"text")}}else V(i)&&!n&&i.isInline()?e.set(i.__key,i.getChildrenSize(),"element"):Y(i)&&e.set(i.__key,i.getTextContent().length,"text")}else if(r===o.getTextContent().length){const i=o.getNextSibling(),s=o.getParent();if(t&&V(i)&&i.isInline())e.set(i.__key,0,"element");else if((n||t)&&i===null&&V(s)&&s.isInline()&&!s.canInsertTextAfter()){const a=s.getNextSibling();Y(a)&&e.set(a.__key,0,"text")}}}function M_(e,t,n){if(e.type==="text"&&t.type==="text"){const r=e.isBefore(t),o=e.is(t);wp(e,r,o),wp(t,!r,o),o&&t.set(e.key,e.offset,e.type);const i=Fe();if(i.isComposing()&&i._compositionKey!==e.key&&W(n)){const s=n.anchor,a=n.focus;e.set(s.key,s.offset,s.type,!0),t.set(a.key,a.offset,a.type,!0)}}}function N_(e,t,n,r,o,i){if(e===null||n===null||!ds(o,e,n))return null;const s=Cp(e,t,W(i)?i.anchor:null,o);if(s===null)return null;const a=Cp(n,r,W(i)?i.focus:null,o);if(a===null)return null;if(s.type==="element"&&a.type==="element"){const l=Lo(e),c=Lo(n);if(Ce(l)&&Ce(c))return null}return M_(s,a,i),[s,a]}function Du(e){return V(e)&&!e.isInline()}function P_(e,t,n,r,o,i){const s=wr(),a=new ao(Pt(e,t,o),Pt(n,r,i),0,"");return a.dirty=!0,s._selection=a,a}function ol(){const e=Pt("root",0,"element"),t=Pt("root",0,"element");return new ao(e,t,0,"")}function gf(){return new rl(new Set)}function Uk(e,t){return il(null,e,t,null)}function il(e,t,n,r){const o=n._window;if(o===null)return null;const i=r||o.event,s=i?i.type:void 0,a=s==="selectionchange",l=!xu&&(a||s==="beforeinput"||s==="compositionstart"||s==="compositionend"||s==="click"&&i&&i.detail===3||s==="drop"||s===void 0);let c,u,f,d;if(W(e)&&!l)return e.clone();if(t===null)return null;if(c=t.anchorNode,u=t.focusNode,f=t.anchorOffset,d=t.focusOffset,(a||s===void 0)&&W(e)&&!ds(n,c,u))return e.clone();const h=N_(c,f,u,d,n,e);if(h===null)return null;const[g,p]=h;return new ao(g,p,W(e)?e.format:0,W(e)?e.style:"")}function G(){return wr()._selection}function An(){return Fe()._editorState._selection}function ka(e,t,n,r=1){const o=e.anchor,i=e.focus,s=o.getNode(),a=i.getNode();if(!t.is(s)&&!t.is(a))return;const l=t.__key;if(e.isCollapsed()){const c=o.offset;if(n<=c&&r>0||n<c&&r<0){const u=Math.max(0,c+r);o.set(l,u,"element"),i.set(l,u,"element"),Sp(e)}}else{const c=e.isBackward(),u=c?i:o,f=u.getNode(),d=c?o:i,h=d.getNode();if(t.is(f)){const g=u.offset;(n<=g&&r>0||n<g&&r<0)&&u.set(l,Math.max(0,g+r),"element")}if(t.is(h)){const g=d.offset;(n<=g&&r>0||n<g&&r<0)&&d.set(l,Math.max(0,g+r),"element")}}Sp(e)}function Sp(e){const t=e.anchor,n=t.offset,r=e.focus,o=r.offset,i=t.getNode(),s=r.getNode();if(e.isCollapsed()){if(!V(i))return;const a=i.getChildrenSize(),l=n>=a,c=l?i.getChildAtIndex(a-1):i.getChildAtIndex(n);if(Y(c)){let u=0;l&&(u=c.getTextContentSize()),t.set(c.__key,u,"text"),r.set(c.__key,u,"text")}return}if(V(i)){const a=i.getChildrenSize(),l=n>=a,c=l?i.getChildAtIndex(a-1):i.getChildAtIndex(n);if(Y(c)){let u=0;l&&(u=c.getTextContentSize()),t.set(c.__key,u,"text")}}if(V(s)){const a=s.getChildrenSize(),l=o>=a,c=l?s.getChildAtIndex(a-1):s.getChildAtIndex(o);if(Y(c)){let u=0;l&&(u=c.getTextContentSize()),r.set(c.__key,u,"text")}}}function Aa(e,t,n,r,o){let i=null,s=0,a=null;r!==null?(i=r.__key,Y(r)?(s=r.getTextContentSize(),a="text"):V(r)&&(s=r.getChildrenSize(),a="element")):o!==null&&(i=o.__key,Y(o)?a="text":V(o)&&(a="element")),i!==null&&a!==null?e.set(i,s,a):(s=t.getIndexWithinParent(),s===-1&&(s=n.getChildrenSize()),e.set(n.__key,s,"element"))}function Ep(e,t,n,r,o){e.type==="text"?e.set(n,e.offset+(t?0:o),"text"):e.offset>r.getIndexWithinParent()&&e.set(e.key,e.offset-1,"element")}function F_(e,t,n,r,o){try{e.setBaseAndExtent(t,n,r,o)}catch{}}function Gk(e,t,n,r,o,i,s){const a=r.anchorNode,l=r.focusNode,c=r.anchorOffset,u=r.focusOffset,f=document.activeElement;if(o.has(R_)&&f!==i||f!==null&&bf(f))return;if(!W(t))return void(e!==null&&ds(n,a,l)&&r.removeAllRanges());const d=t.anchor,h=t.focus,g=d.key,p=h.key,m=Jr(n,g),_=Jr(n,p),y=d.offset,v=h.offset,x=t.format,b=t.style,w=t.isCollapsed();let T=m,E=_,R=!1;if(d.type==="text"){T=Jo(m);const B=d.getNode();R=B.getFormat()!==x||B.getStyle()!==b}else W(e)&&e.anchor.type==="text"&&(R=!0);var M,O,D,I,L;if(h.type==="text"&&(E=Jo(_)),T!==null&&E!==null&&(w&&(e===null||R||W(e)&&(e.format!==x||e.style!==b))&&(M=x,O=b,D=y,I=g,L=performance.now(),x_=[M,O,D,I,L]),c!==y||u!==v||a!==T||l!==E||r.type==="Range"&&w||(f!==null&&i.contains(f)||o.has($k)||i.focus({preventScroll:!0}),d.type==="element"))){if(F_(r,T,y,E,v),!o.has(Ok)&&t.isCollapsed()&&i!==null&&i===document.activeElement){const B=W(t)&&t.anchor.type==="element"?T.childNodes[y]||null:r.rangeCount>0?r.getRangeAt(0):null;if(B!==null){let K;if(B instanceof Text){const P=document.createRange();P.selectNode(B),K=P.getBoundingClientRect()}else K=B.getBoundingClientRect();(function(P,A,$){const H=ex($),Q=Rf(H);if(H===null||Q===null)return;let{top:J,bottom:X}=A,se=0,re=0,he=$;for(;he!==null;){const we=he===H.body;if(we)se=0,re=qt(P).innerHeight;else{const ye=he.getBoundingClientRect();se=ye.top,re=ye.bottom}let te=0;if(J<se?te=-(se-J):X>re&&(te=X-re),te!==0)if(we)Q.scrollBy(0,te);else{const ye=he.scrollTop;he.scrollTop+=te;const Se=he.scrollTop-ye;J-=Se,X-=Se}if(we)break;he=fs(he)}})(n,K,i)}}Pu=!0}}function pf(e){let t=G()||An();t===null&&(t=Ke().selectEnd()),t.insertNodes(e)}function oc(e){let t=e;e.isCollapsed()||t.removeText();const n=G();W(n)&&(t=n),W(t)||U(161);const r=t.anchor;let o=r.getNode(),i=r.offset;for(;!nr(o);){const s=o;if([o,i]=qk(o,i),s.is(o))break}return i}function qk(e,t){const n=e.getParent();if(!n){const o=me();return Ke().append(o),o.select(),[Ke(),0]}if(Y(e)){const o=e.splitText(t);if(o.length===0)return[n,e.getIndexWithinParent()];const i=t===0?0:1;return[n,o[0].getIndexWithinParent()+i]}if(!V(e)||t===0)return[n,e.getIndexWithinParent()];const r=e.getChildAtIndex(t);if(r){const o=new ao(Pt(e.__key,t,"element"),Pt(e.__key,t,"element"),0,""),i=e.insertNewAfter(o);i&&i.append(r,...r.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}function Tp(e,t,n,r,o="decorators-and-blocks"){if(t==="move"&&r==="character"&&!e.isCollapsed()){const[u,f]=n===e.isBackward()?[e.focus,e.anchor]:[e.anchor,e.focus];return f.set(u.key,u.offset,u.type),!0}const i=an(e.focus,n?"previous":"next"),s=r==="lineboundary",a=t==="move";let l=i,c=o==="decorators-and-blocks";if(!Ff(l)){for(const u of l){c=!1;const{origin:f}=u;if(!Ce(f)||f.isIsolated()||(l=u,!s||!f.isInline()))break}if(c)for(const u of Qi(i).iterNodeCarets(t==="extend"?"shadowRoot":"root")){if(At(u))u.origin.isInline()||(l=u);else{if(V(u.origin))continue;Ce(u.origin)&&!u.origin.isInline()&&(l=u)}break}}if(l===i)return!1;if(a&&!s&&Ce(l.origin)&&l.origin.isKeyboardSelectable()){const u=gf();return u.add(l.origin.getKey()),He(u),!0}return l=bt(l),a&&tn(e.anchor,l),tn(e.focus,l),c||!s}let at=null,lt=null,kt=!1,ic=!1,ra=0;const Rp={characterData:!0,childList:!0,subtree:!0};function li(){return kt||at!==null&&at._readOnly}function st(){kt&&U(13)}function L_(){ra>99&&U(14)}function wr(){return at===null&&U(195,O_()),at}function Fe(){return lt===null&&U(196,O_()),lt}function O_(){let e=0;const t=new Set,n=Xo.version;if(typeof window<"u")for(const o of document.querySelectorAll("[contenteditable]")){const i=al(o);if(Cf(i))e++;else if(i){let s=String(i.constructor.version||"<0.17.1");s===n&&(s+=" (separately built, likely a bundler configuration issue)"),t.add(s)}}let r=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(r+=` and incompatible editors with versions ${Array.from(t).join(", ")}`),r}function Yk(){return lt}function kp(e,t,n){const r=t.__type,o=B_(e,r);let i=n.get(r);i===void 0&&(i=Array.from(o.transforms),n.set(r,i));const s=i.length;for(let a=0;a<s&&(i[a](t),t.isAttached());a++);}function Ap(e,t){return e!==void 0&&e.__key!==t&&e.isAttached()}function I_(e,t){if(!t)return;const n=e._updateTags;let r=t;Array.isArray(t)||(r=[t]);for(const o of r)n.add(o)}function Xk(e){return mf(e,Fe()._nodes)}function mf(e,t){const n=e.type,r=t.get(n);r===void 0&&U(17,n);const o=r.klass;e.type!==o.getType()&&U(18,o.name);const i=o.importJSON(e),s=e.children;if(V(i)&&Array.isArray(s))for(let a=0;a<s.length;a++){const l=mf(s[a],t);i.append(l)}return i}function Mp(e,t,n){const r=at,o=kt,i=lt;at=t,kt=!0,lt=e;try{return n()}finally{at=r,kt=o,lt=i}}function Vn(e,t){const n=e._pendingEditorState,r=e._rootElement,o=e._headless||r===null;if(n===null)return;const i=e._editorState,s=i._selection,a=n._selection,l=e._dirtyType!==0,c=at,u=kt,f=lt,d=e._updating,h=e._observer;let g=null;if(e._pendingEditorState=null,e._editorState=n,!o&&l&&h!==null){lt=e,at=n,kt=!1,e._updating=!0;try{const w=e._dirtyType,T=e._dirtyElements,E=e._dirtyLeaves;h.disconnect(),g=_k(i,n,e,w,T,E)}catch(w){if(w instanceof Error&&e._onError(w),ic)throw w;return V_(e,null,r,n),J0(e),e._dirtyType=2,ic=!0,Vn(e,i),void(ic=!1)}finally{h.observe(r,Rp),e._updating=d,at=c,kt=u,lt=f}}n._readOnly||(n._readOnly=!0);const p=e._dirtyLeaves,m=e._dirtyElements,_=e._normalizedNodes,y=e._updateTags,v=e._deferred;l&&(e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements=new Map,e._normalizedNodes=new Set,e._updateTags=new Set),(function(w,T){const E=w._decorators;let R=w._pendingDecorators||E;const M=T._nodeMap;let O;for(O in R)M.has(O)||(R===E&&(R=q_(w)),delete R[O])})(e,n);const x=o?null:St(qt(e));if(e._editable&&x!==null&&(l||a===null||a.dirty||!a.is(s))&&r!==null&&!y.has(Ik)){lt=e,at=n;try{if(h!==null&&h.disconnect(),l||a===null||a.dirty){const w=e._blockCursorElement;w!==null&&zu(w,e,r),Gk(s,a,e,x,y,r)}(function(w,T,E){let R=w._blockCursorElement;if(W(E)&&E.isCollapsed()&&E.anchor.type==="element"&&T.contains(document.activeElement)){const M=E.anchor,O=M.getNode(),D=M.offset;let I=!1,L=null;if(D===O.getChildrenSize())ac(O.getChildAtIndex(D-1))&&(I=!0);else{const B=O.getChildAtIndex(D);if(B!==null&&ac(B)){const K=B.getPreviousSibling();(K===null||ac(K))&&(I=!0,L=w.getElementByKey(B.__key))}}if(I){const B=w.getElementByKey(O.__key);return R===null&&(w._blockCursorElement=R=(function(K){const P=K.theme,A=document.createElement("div");A.contentEditable="false",A.setAttribute("data-lexical-cursor","true");let $=P.blockCursor;if($!==void 0){if(typeof $=="string"){const H=U0($);$=P.blockCursor=H}$!==void 0&&A.classList.add(...$)}return A})(w._config)),T.style.caretColor="transparent",void(L===null?B.appendChild(R):B.insertBefore(R,L))}}R!==null&&zu(R,w,T)})(e,r,a)}finally{h!==null&&h.observe(r,Rp),lt=f,at=c}}g!==null&&(function(w,T,E,R,M){const O=Array.from(w._listeners.mutation),D=O.length;for(let I=0;I<D;I++){const[L,B]=O[I];for(const K of B){const P=T.get(K);P!==void 0&&L(P,{dirtyLeaves:R,prevEditorState:M,updateTags:E})}}})(e,g,y,p,i),W(a)||a===null||s!==null&&s.is(a)||e.dispatchCommand(zn,void 0);const b=e._pendingDecorators;b!==null&&(e._decorators=b,e._pendingDecorators=null,$i("decorator",e,!0,b)),(function(w,T,E){const R=Lp(T),M=Lp(E);R!==M&&$i("textcontent",w,!0,M)})(e,t||i,n),$i("update",e,!0,{dirtyElements:m,dirtyLeaves:p,editorState:n,mutatedNodes:g,normalizedNodes:_,prevEditorState:t||i,tags:y}),(function(w,T){if(w._deferred=[],T.length!==0){const E=w._updating;w._updating=!0;try{for(let R=0;R<T.length;R++)T[R]()}finally{w._updating=E}}})(e,v),(function(w){const T=w._updates;if(T.length!==0){const E=T.shift();if(E){const[R,M]=E;sl(w,R,M)}}})(e)}function $i(e,t,n,...r){const o=t._updating;t._updating=n;try{const i=Array.from(t._listeners[e]);for(let s=0;s<i.length;s++)i[s].apply(null,r)}finally{t._updating=o}}function Np(e,t){const n=e._updates;let r=t||!1;for(;n.length!==0;){const o=n.shift();if(o){const[i,s]=o,a=e._pendingEditorState;let l;s!==void 0&&(l=s.onUpdate,s.skipTransforms&&(r=!0),s.discrete&&(a===null&&U(191),a._flushSync=!0),l&&e._deferred.push(l),I_(e,s.tag)),a==null?sl(e,i,s):i()}}return r}function sl(e,t,n){const r=e._updateTags;let o,i=!1,s=!1;n!==void 0&&(o=n.onUpdate,I_(e,n.tag),i=n.skipTransforms||!1,s=n.discrete||!1),o&&e._deferred.push(o);const a=e._editorState;let l=e._pendingEditorState,c=!1;(l===null||l._readOnly)&&(l=e._pendingEditorState=$_(l||a),c=!0),l._flushSync=s;const u=at,f=kt,d=lt,h=e._updating;at=l,kt=!1,e._updating=!0,lt=e;const g=e._headless||e.getRootElement()===null;_f(null);try{c&&(g?a._selection!==null&&(l._selection=a._selection.clone()):l._selection=(function(y,v){const x=y.getEditorState()._selection,b=St(qt(y));return W(x)||x==null?il(x,b,y,v):x.clone()})(e,n&&n.event||null));const m=e._compositionKey;t(),i=Np(e,i),(function(y,v){const x=v.getEditorState()._selection,b=y._selection;if(W(b)){const w=b.anchor,T=b.focus;let E;if(w.type==="text"&&(E=w.getNode(),E.selectionTransform(x,b)),T.type==="text"){const R=T.getNode();E!==R&&R.selectionTransform(x,b)}}})(l,e),e._dirtyType!==0&&(i?(function(y,v){const x=v._dirtyLeaves,b=y._nodeMap;for(const w of x){const T=b.get(w);Y(T)&&T.isAttached()&&T.isSimpleText()&&!T.isUnmergeable()&&ap(T)}})(l,e):(function(y,v){const x=v._dirtyLeaves,b=v._dirtyElements,w=y._nodeMap,T=rr(),E=new Map;let R=x,M=R.size,O=b,D=O.size;for(;M>0||D>0;){if(M>0){v._dirtyLeaves=new Set;for(const I of R){const L=w.get(I);Y(L)&&L.isAttached()&&L.isSimpleText()&&!L.isUnmergeable()&&ap(L),L!==void 0&&Ap(L,T)&&kp(v,L,E),x.add(I)}if(R=v._dirtyLeaves,M=R.size,M>0){ra++;continue}}v._dirtyLeaves=new Set,v._dirtyElements=new Map,O.delete("root")&&O.set("root",!0);for(const I of O){const L=I[0],B=I[1];if(b.set(L,B),!B)continue;const K=w.get(L);K!==void 0&&Ap(K,T)&&kp(v,K,E)}R=v._dirtyLeaves,M=R.size,O=v._dirtyElements,D=O.size,ra++}v._dirtyLeaves=x,v._dirtyElements=b})(l,e),Np(e),(function(y,v,x,b){const w=y._nodeMap,T=v._nodeMap,E=[];for(const[R]of b){const M=T.get(R);M!==void 0&&(M.isAttached()||(V(M)&&q0(M,R,w,T,E,b),w.has(R)||b.delete(R),E.push(R)))}for(const R of E)T.delete(R);for(const R of x){const M=T.get(R);M===void 0||M.isAttached()||(w.has(R)||x.delete(R),T.delete(R))}})(a,l,e._dirtyLeaves,e._dirtyElements)),m!==e._compositionKey&&(l._flushSync=!0);const _=l._selection;if(W(_)){const y=l._nodeMap,v=_.anchor.key,x=_.focus.key;y.get(v)!==void 0&&y.get(x)!==void 0||U(19)}else gt(_)&&_._nodes.size===0&&(l._selection=null)}catch(m){return m instanceof Error&&e._onError(m),e._pendingEditorState=a,e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),void Vn(e)}finally{at=u,kt=f,lt=d,e._updating=h,ra=0}e._dirtyType!==0||e._deferred.length>0||(function(m,_){const y=_.getEditorState()._selection,v=m._selection;if(v!==null){if(v.dirty||!v.is(y))return!0}else if(y!==null)return!0;return!1})(l,e)?l._flushSync?(l._flushSync=!1,Vn(e)):c&&n3(()=>{Vn(e)}):(l._flushSync=!1,c&&(r.clear(),e._deferred=[],e._pendingEditorState=null))}function Sn(e,t,n){lt===e&&n===void 0?t():sl(e,t,n)}class Di{element;before;after;constructor(t,n,r){this.element=t,this.before=n||null,this.after=r||null}withBefore(t){return new Di(this.element,t,this.after)}withAfter(t){return new Di(this.element,this.before,t)}withElement(t){return this.element===t?this:new Di(t,this.before,this.after)}insertChild(t){const n=this.before||this.getManagedLineBreak();return n!==null&&n.parentElement!==this.element&&U(222),this.element.insertBefore(t,n),this}removeChild(t){return t.parentElement!==this.element&&U(223),this.element.removeChild(t),this}replaceChild(t,n){return n.parentElement!==this.element&&U(224),this.element.replaceChild(t,n),this}getFirstChild(){const t=this.after?this.after.nextSibling:this.element.firstChild;return t===this.before||t===this.getManagedLineBreak()?null:t}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(t){if(t===null)this.removeManagedLineBreak();else{const n=t==="decorator"&&(ls||oi||as);this.insertManagedLineBreak(n)}}removeManagedLineBreak(){const t=this.getManagedLineBreak();if(t){const n=this.element,r=t.nodeName==="IMG"?t.nextSibling:null;r&&n.removeChild(r),n.removeChild(t),n.__lexicalLineBreak=void 0}}insertManagedLineBreak(t){const n=this.getManagedLineBreak();if(n){if(t===(n.nodeName==="IMG"))return;this.removeManagedLineBreak()}const r=this.element,o=this.before,i=document.createElement("br");if(r.insertBefore(i,o),t){const s=document.createElement("img");s.setAttribute("data-lexical-linebreak","true"),s.style.cssText="display: inline !important; border: 0px !important; margin: 0px !important;",s.alt="",r.insertBefore(s,i),r.__lexicalLineBreak=s}else r.__lexicalLineBreak=i}getFirstChildOffset(){let t=0;for(let n=this.after;n!==null;n=n.previousSibling)t++;return t}resolveChildIndex(t,n,r,o){if(r===this.element){const l=this.getFirstChildOffset();return[t,Math.min(l+t.getChildrenSize(),Math.max(l,o))]}const i=Pp(n,r);i.push(o);const s=Pp(n,this.element);let a=t.getIndexWithinParent();for(let l=0;l<s.length;l++){const c=i[l],u=s[l];if(c===void 0||c<u)break;if(c>u){a+=1;break}}return[t.getParentOrThrow(),a]}}function Pp(e,t){const n=[];let r=t;for(;r!==e&&r!==null;r=r.parentNode){let o=0;for(let i=r.previousSibling;i!==null;i=i.previousSibling)o++;n.push(o)}return r!==e&&U(225),n.reverse()}class yt extends Cn{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;constructor(t){super(t),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle=""}afterCloneFrom(t){super.afterCloneFrom(t),this.__key===t.__key&&(this.__first=t.__first,this.__last=t.__last,this.__size=t.__size),this.__indent=t.__indent,this.__format=t.__format,this.__style=t.__style,this.__dir=t.__dir,this.__textFormat=t.__textFormat,this.__textStyle=t.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){const t=this.getFormat();return ik[t]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){const t=[];let n=this.getFirstChild();for(;n!==null;)t.push(n),n=n.getNextSibling();return t}getChildrenKeys(){const t=[];let n=this.getFirstChild();for(;n!==null;)t.push(n.__key),n=n.getNextSibling();return t}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){const t=Fe()._dirtyElements;return t!==null&&t.has(this.__key)}isLastChild(){const t=this.getLatest(),n=this.getParentOrThrow().getLastChild();return n!==null&&n.is(t)}getAllTextNodes(){const t=[];let n=this.getFirstChild();for(;n!==null;){if(Y(n)&&t.push(n),V(n)){const r=n.getAllTextNodes();t.push(...r)}n=n.getNextSibling()}return t}getFirstDescendant(){let t=this.getFirstChild();for(;V(t);){const n=t.getFirstChild();if(n===null)break;t=n}return t}getLastDescendant(){let t=this.getLastChild();for(;V(t);){const n=t.getLastChild();if(n===null)break;t=n}return t}getDescendantByIndex(t){const n=this.getChildren(),r=n.length;if(t>=r){const i=n[r-1];return V(i)&&i.getLastDescendant()||i||null}const o=n[t];return V(o)&&o.getFirstDescendant()||o||null}getFirstChild(){const t=this.getLatest().__first;return t===null?null:Me(t)}getFirstChildOrThrow(){const t=this.getFirstChild();return t===null&&U(45,this.__key),t}getLastChild(){const t=this.getLatest().__last;return t===null?null:Me(t)}getLastChildOrThrow(){const t=this.getLastChild();return t===null&&U(96,this.__key),t}getChildAtIndex(t){const n=this.getChildrenSize();let r,o;if(t<n/2){for(r=this.getFirstChild(),o=0;r!==null&&o<=t;){if(o===t)return r;r=r.getNextSibling(),o++}return null}for(r=this.getLastChild(),o=n-1;r!==null&&o>=t;){if(o===t)return r;r=r.getPreviousSibling(),o--}return null}getTextContent(){let t="";const n=this.getChildren(),r=n.length;for(let o=0;o<r;o++){const i=n[o];t+=i.getTextContent(),V(i)&&o!==r-1&&!i.isInline()&&(t+=hr)}return t}getTextContentSize(){let t=0;const n=this.getChildren(),r=n.length;for(let o=0;o<r;o++){const i=n[o];t+=i.getTextContentSize(),V(i)&&o!==r-1&&!i.isInline()&&(t+=2)}return t}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(t){if(t!==""){const n=Qg[t];return(this.getFormat()&n)!==0}return!1}hasTextFormat(t){const n=gr[t];return(this.getTextFormat()&n)!==0}getFormatFlags(t,n){return Ma(this.getLatest().__textFormat,t,n)}getTextStyle(){return this.getLatest().__textStyle}select(t,n){st();const r=G();let o=t,i=n;const s=this.getChildrenSize();if(!this.canBeEmpty()){if(t===0&&n===0){const l=this.getFirstChild();if(Y(l)||V(l))return l.select(0,0)}else if(!(t!==void 0&&t!==s||n!==void 0&&n!==s)){const l=this.getLastChild();if(Y(l)||V(l))return l.select()}}o===void 0&&(o=s),i===void 0&&(i=s);const a=this.__key;return W(r)?(r.anchor.set(a,o,"element"),r.focus.set(a,i,"element"),r.dirty=!0,r):P_(a,o,a,i,"element","element")}selectStart(){const t=this.getFirstDescendant();return t?t.selectStart():this.select()}selectEnd(){const t=this.getLastDescendant();return t?t.selectEnd():this.select()}clear(){const t=this.getWritable();return this.getChildren().forEach(n=>n.remove()),t}append(...t){return this.splice(this.getChildrenSize(),0,t)}setDirection(t){const n=this.getWritable();return n.__dir=t,n}setFormat(t){return this.getWritable().__format=t!==""?Qg[t]:0,this}setStyle(t){return this.getWritable().__style=t||"",this}setTextFormat(t){const n=this.getWritable();return n.__textFormat=t,n}setTextStyle(t){const n=this.getWritable();return n.__textStyle=t,n}setIndent(t){return this.getWritable().__indent=t,this}splice(t,n,r){Ra(this)&&U(324,this.__key,this.__type);const o=this.getChildrenSize(),i=this.getWritable();t+n<=o||U(226,String(t),String(n),String(o));const s=i.__key,a=[],l=[],c=this.getChildAtIndex(t+n);let u=null,f=o-n+r.length;if(t!==0)if(t===o)u=this.getLastChild();else{const h=this.getChildAtIndex(t);h!==null&&(u=h.getPreviousSibling())}if(n>0){let h=u===null?this.getFirstChild():u.getNextSibling();for(let g=0;g<n;g++){h===null&&U(100);const p=h.getNextSibling(),m=h.__key;Kr(h.getWritable()),l.push(m),h=p}}let d=u;for(const h of r){d!==null&&h.is(d)&&(u=d=d.getPreviousSibling());const g=h.getWritable();g.__parent===s&&f--,Kr(g);const p=h.__key;if(d===null)i.__first=p,g.__prev=null;else{const m=d.getWritable();m.__next=p,g.__prev=m.__key}h.__key===s&&U(76),g.__parent=s,a.push(p),d=h}if(t+n===o)d!==null&&(d.getWritable().__next=null,i.__last=d.__key);else if(c!==null){const h=c.getWritable();if(d!==null){const g=d.getWritable();h.__prev=d.__key,g.__next=c.__key}else h.__prev=null}if(i.__size=f,l.length){const h=G();if(W(h)){const g=new Set(l),p=new Set(a),{anchor:m,focus:_}=h;Fp(m,g,p)&&Aa(m,m.getNode(),this,u,c),Fp(_,g,p)&&Aa(_,_.getNode(),this,u,c),f!==0||this.canBeEmpty()||dt(this)||this.remove()}}return i}getDOMSlot(t){return new Di(t)}exportDOM(t){const{element:n}=super.exportDOM(t);if(je(n)){const r=this.getIndent();r>0&&(n.style.paddingInlineStart=40*r+"px");const o=this.getDirection();o&&(n.dir=o)}return{element:n}}exportJSON(){const t={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},n=this.getTextFormat(),r=this.getTextStyle();return n===0&&r===""||dt(this)||this.getChildren().some(Y)||(n!==0&&(t.textFormat=n),r!==""&&(t.textStyle=r)),t}updateFromJSON(t){return super.updateFromJSON(t).setFormat(t.format).setIndent(t.indent).setDirection(t.direction).setTextFormat(t.textFormat||0).setTextStyle(t.textStyle||"")}insertNewAfter(t,n){return null}canIndent(){return!0}collapseAtStart(t){return!1}excludeFromCopy(t){return!1}canReplaceWith(t){return!0}canInsertAfter(t){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(t){return!1}extractWithChild(t,n,r){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(t,n){const r=this.getDOMSlot(t);let o=r.getFirstChild();for(let i=this.getFirstChild();i;i=i.getNextSibling()){const s=n.getElementByKey(i.getKey());s!==null&&(o==null?(r.insertChild(s),o=s):o!==s&&r.replaceChild(s,o),o=o.nextSibling)}}}function V(e){return e instanceof yt}function Fp(e,t,n){let r=e.getNode();for(;r;){const o=r.__key;if(t.has(o)&&!n.has(o))return!0;r=r.getParent()}return!1}class cs extends Cn{decorate(t,n){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function Ce(e){return e instanceof cs}class ci extends yt{__cachedText;static getType(){return"root"}static clone(){return new ci}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){U(51)}getTextContent(){const t=this.__cachedText;return!li()&&Fe()._dirtyType!==0||t===null?super.getTextContent():t}remove(){U(52)}replace(t){U(53)}insertBefore(t){U(54)}insertAfter(t){U(55)}updateDOM(t,n){return!1}splice(t,n,r){for(const o of r)V(o)||Ce(o)||U(282);return super.splice(t,n,r)}static importJSON(t){return Ke().updateFromJSON(t)}collapseAtStart(){return!0}}function tt(e){return e instanceof ci}function $_(e){return new us(new Map(e._nodeMap))}function yf(){return new us(new Map([["root",new ci]]))}function D_(e){const t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&U(130,n.name),V(e)){const r=t.children;Array.isArray(r)||U(59,n.name);const o=e.getChildren();for(let i=0;i<o.length;i++){const s=D_(o[i]);r.push(s)}}return t}function Jk(e){return e instanceof us}class us{_nodeMap;_selection;_flushSync;_readOnly;constructor(t,n){this._nodeMap=t,this._selection=n||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(t,n){return Mp(n&&n.editor||null,this,t)}clone(t){const n=new us(this._nodeMap,t===void 0?this._selection:t);return n._readOnly=!0,n}toJSON(){return Mp(null,this,()=>({root:D_(Ke())}))}}class vf extends yt{static getType(){return"artificial"}createDOM(t){return document.createElement("div")}}class lo extends yt{static getType(){return"paragraph"}static clone(t){return new lo(t.__key)}createDOM(t){const n=document.createElement("p"),r=jo(t.theme,"paragraph");return r!==void 0&&n.classList.add(...r),n}updateDOM(t,n,r){return!1}static importDOM(){return{p:t=>({conversion:Zk,priority:0})}}exportDOM(t){const{element:n}=super.exportDOM(t);if(je(n)){this.isEmpty()&&n.append(document.createElement("br"));const r=this.getFormatType();r&&(n.style.textAlign=r)}return{element:n}}static importJSON(t){return me().updateFromJSON(t)}exportJSON(){const t=super.exportJSON();if(t.textFormat===void 0||t.textStyle===void 0){const n=this.getChildren().find(Y);n?(t.textFormat=n.getFormat(),t.textStyle=n.getStyle()):(t.textFormat=this.getTextFormat(),t.textStyle=this.getTextStyle())}return t}insertNewAfter(t,n){const r=me();r.setTextFormat(t.format),r.setTextStyle(t.style);const o=this.getDirection();return r.setDirection(o),r.setFormat(this.getFormatType()),r.setStyle(this.getStyle()),this.insertAfter(r,n),r}collapseAtStart(){const t=this.getChildren();if(t.length===0||Y(t[0])&&t[0].getTextContent().trim()===""){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}}function Zk(e){const t=me();return e.style&&(t.setFormat(e.style.textAlign),kf(e,t)),{node:t}}function me(){return vt(new lo)}function Sr(e){return e instanceof lo}const _e=0,jn=1,Et=3,Qk=4;function V_(e,t,n,r){const o=e._keyToDOMMap;o.clear(),e._editorState=yf(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,e._updateTags=new Set,e._updates=[],e._blockCursorElement=null;const i=e._observer;i!==null&&(i.disconnect(),e._observer=null),t!==null&&(t.textContent=""),n!==null&&(n.textContent="",o.set("root",n))}function e3(e){const t=new Set,n=new Set;let r=e;for(;r;){const{ownNodeConfig:o}=ul(r),i=r.transform;if(!n.has(i)){n.add(i);const s=r.transform();s&&t.add(s)}if(o){const s=o.$transform;s&&t.add(s),r=o.extends}else{const s=Object.getPrototypeOf(r);r=s.prototype instanceof Cn&&s!==Cn?s:void 0}}return t}function j_(e){const t=e||{},n=Yk(),r=t.theme||{},o=e===void 0?n:t.parentEditor||null,i=t.disableEvents||!1,s=yf(),a=t.namespace||(o!==null?o._config.namespace:J_()),l=t.editorState,c=[ci,Gt,ii,si,lo,vf,...t.nodes||[]],{onError:u,html:f}=t,d=t.editable===void 0||t.editable;let h;if(e===void 0&&n!==null)h=n._nodes;else{h=new Map;for(let p=0;p<c.length;p++){let m=c[p],_=null,y=null;if(typeof m!="function"){const b=m;m=b.replace,_=b.with,y=b.withKlass||null}ul(m);const v=m.getType(),x=e3(m);h.set(v,{exportDOM:f&&f.export?f.export.get(m):void 0,klass:m,replace:_,replaceWithKlass:y,sharedNodeState:gk(c[p]),transforms:x})}}const g=new Xo(s,o,h,{disableEvents:i,namespace:a,theme:r},u||console.error,(function(p,m){const _=new Map,y=new Set,v=x=>{Object.keys(x).forEach(b=>{let w=_.get(b);w===void 0&&(w=[],_.set(b,w)),w.push(x[b])})};return p.forEach(x=>{const b=x.klass.importDOM;if(b==null||y.has(b))return;y.add(b);const w=b.call(x.klass);w!==null&&v(w)}),m&&v(m),_})(h,f?f.import:void 0),d,e);return l!==void 0&&(g._pendingEditorState=l,g._dirtyType=2),(function(p){p.registerCommand(s_,Rk,_e),p.registerCommand(a_,kk,_e),p.registerCommand(l_,Ak,_e),p.registerCommand(c_,Mk,_e),p.registerCommand(f_,Nk,_e)})(g),g}class Xo{static version;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_htmlConversions;_window;_editable;_blockCursorElement;_createEditorArgs;constructor(t,n,r,o,i,s,a,l){this._createEditorArgs=l,this._parentEditor=n,this._rootElement=null,this._editorState=t,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=o,this._nodes=r,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=J_(),this._onError=i,this._htmlConversions=s,this._editable=a,this._headless=n!==null&&n._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(t){const n=this._listeners.update;return n.add(t),()=>{n.delete(t)}}registerEditableListener(t){const n=this._listeners.editable;return n.add(t),()=>{n.delete(t)}}registerDecoratorListener(t){const n=this._listeners.decorator;return n.add(t),()=>{n.delete(t)}}registerTextContentListener(t){const n=this._listeners.textcontent;return n.add(t),()=>{n.delete(t)}}registerRootListener(t){const n=this._listeners.root;return t(this._rootElement,null),n.add(t),()=>{t(null,this._rootElement),n.delete(t)}}registerCommand(t,n,r){r===void 0&&U(35);const o=this._commands;o.has(t)||o.set(t,[new Set,new Set,new Set,new Set,new Set]);const i=o.get(t);i===void 0&&U(36,String(t));const s=i[r];return s.add(n),()=>{s.delete(n),i.every(a=>a.size===0)&&o.delete(t)}}registerMutationListener(t,n,r){const o=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(t)).klass,i=this._listeners.mutation;let s=i.get(n);s===void 0&&(s=new Set,i.set(n,s)),s.add(o);const a=r&&r.skipInitialization;return a!==void 0&&a||this.initializeMutationListener(n,o),()=>{s.delete(o),s.size===0&&i.delete(n)}}getRegisteredNode(t){const n=this._nodes.get(t.getType());return n===void 0&&U(37,t.name),n}resolveRegisteredNodeAfterReplacements(t){for(;t.replaceWithKlass;)t=this.getRegisteredNode(t.replaceWithKlass);return t}initializeMutationListener(t,n){const r=this._editorState,o=Bp(r).get(n.getType());if(!o)return;const i=new Map;for(const s of o.keys())i.set(s,"created");i.size>0&&t(i,{dirtyLeaves:new Set,prevEditorState:r,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(t,n){const r=this.getRegisteredNode(t);return r.transforms.add(n),r}registerNodeTransform(t,n){const r=this.registerNodeTransformToKlass(t,n),o=[r],i=r.replaceWithKlass;if(i!=null){const s=this.registerNodeTransformToKlass(i,n);o.push(s)}return(function(s,a){const l=Bp(s.getEditorState()),c=[];for(const u of a){const f=l.get(u);f&&c.push(f)}c.length!==0&&s.update(()=>{for(const u of c)for(const f of u.keys()){const d=Me(f);d&&d.markDirty()}},s._pendingEditorState===null?{tag:Vo}:void 0)})(this,o.map(s=>s.klass.getType())),()=>{o.forEach(s=>s.transforms.delete(n))}}hasNode(t){return this._nodes.has(t.getType())}hasNodes(t){return t.every(this.hasNode.bind(this))}dispatchCommand(t,n){return Z(this,t,n)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(t){const n=this._rootElement;if(t!==n){const r=jo(this._config.theme,"root"),o=this._pendingEditorState||this._editorState;if(this._rootElement=t,V_(this,n,t,o),n!==null&&(this._config.disableEvents||Pk(n),r!=null&&n.classList.remove(...r)),t!==null){const i=Rf(t),s=t.style;s.userSelect="text",s.whiteSpace="pre-wrap",s.wordBreak="break-word",t.setAttribute("data-lexical-editor","true"),this._window=i,this._dirtyType=2,J0(this),this._updateTags.add(Vo),Vn(this),this._config.disableEvents||(function(a,l){const c=a.ownerDocument;Nu.set(a,c);const u=Ea.get(c)??0;u<1&&c.addEventListener("selectionchange",E_),Ea.set(c,u+1),a.__lexicalEditor=l;const f=S_(a);for(let d=0;d<Mu.length;d++){const[h,g]=Mu[d],p=typeof g=="function"?m=>{gp(m)||(hp(m),(l.isEditable()||h==="click")&&g(m,l))}:m=>{if(gp(m))return;hp(m);const _=l.isEditable();switch(h){case"cut":return _&&Z(l,tl,m);case"copy":return Z(l,el,m);case"paste":return _&&Z(l,of,m);case"dragstart":return _&&Z(l,p_,m);case"dragover":return _&&Z(l,m_,m);case"dragend":return _&&Z(l,Sk,m);case"focus":return _&&Z(l,y_,m);case"blur":return _&&Z(l,Ek,m);case"drop":return _&&Z(l,g_,m)}};a.addEventListener(h,p),f.push(()=>{a.removeEventListener(h,p)})}})(t,this),r!=null&&t.classList.add(...r)}else this._window=null,this._updateTags.add(Vo),Vn(this);$i("root",this,!1,t,n)}}getElementByKey(t){return this._keyToDOMMap.get(t)||null}getEditorState(){return this._editorState}setEditorState(t,n){t.isEmpty()&&U(38);let r=t;r._readOnly&&(r=$_(t),r._selection=t._selection?t._selection.clone():null),X0(this);const o=this._pendingEditorState,i=this._updateTags,s=n!==void 0?n.tag:null;o===null||o.isEmpty()||(s!=null&&i.add(s),Vn(this)),this._pendingEditorState=r,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,s!=null&&i.add(s),this._updating||Vn(this)}parseEditorState(t,n){return(function(r,o,i){const s=yf(),a=at,l=kt,c=lt,u=o._dirtyElements,f=o._dirtyLeaves,d=o._cloneNotNeeded,h=o._dirtyType;o._dirtyElements=new Map,o._dirtyLeaves=new Set,o._cloneNotNeeded=new Set,o._dirtyType=0,at=s,kt=!1,lt=o,_f(null);try{const g=o._nodes;mf(r.root,g),i&&i(),s._readOnly=!0}catch(g){g instanceof Error&&o._onError(g)}finally{o._dirtyElements=u,o._dirtyLeaves=f,o._cloneNotNeeded=d,o._dirtyType=h,at=a,kt=l,lt=c}return s})(typeof t=="string"?JSON.parse(t):t,this,n)}read(t){return Vn(this),this.getEditorState().read(t,{editor:this})}update(t,n){(function(r,o,i){r._updating?r._updates.push([o,i]):sl(r,o,i)})(this,t,n)}focus(t,n={}){const r=this._rootElement;r!==null&&(r.setAttribute("autocapitalize","off"),Sn(this,()=>{const o=G(),i=Ke();o!==null?o.dirty||He(o.clone()):i.getChildrenSize()!==0&&(n.defaultSelection==="rootStart"?i.selectStart():i.selectEnd()),i3("focus"),s3(()=>{r.removeAttribute("autocapitalize"),t&&t()})}),this._pendingEditorState===null&&r.removeAttribute("autocapitalize"))}blur(){const t=this._rootElement;t!==null&&t.blur();const n=St(this._window);n!==null&&n.removeAllRanges()}isEditable(){return this._editable}setEditable(t){this._editable!==t&&(this._editable=t,$i("editable",this,!0,t))}toJSON(){return{editorState:this._editorState.toJSON()}}}Xo.version="0.39.0+prod.esm";let Vu=null;function _f(e){Vu=e}let t3=1;function B_(e,t){const n=xf(e,t);return n===void 0&&U(30,t),n}function xf(e,t){return e._nodes.get(t)}const n3=typeof queueMicrotask=="function"?queueMicrotask:e=>{Promise.resolve().then(e)};function z_(e){return Ce(Ft(e))}function bf(e){const t=document.activeElement;if(!je(t))return!1;const n=t.nodeName;return Ce(Ft(e))&&(n==="INPUT"||n==="TEXTAREA"||t.contentEditable==="true"&&al(t)==null)}function ds(e,t,n){const r=e.getRootElement();try{return r!==null&&r.contains(t)&&r.contains(n)&&t!==null&&!bf(t)&&W_(t)===e}catch{return!1}}function Cf(e){return e instanceof Xo}function W_(e){let t=e;for(;t!=null;){const n=al(t);if(Cf(n))return n;t=fs(t)}return null}function al(e){return e?e.__lexicalEditor:null}function Hr(e){return nl(e)||e.isToken()}function In(e){return Hr(e)||e.isSegmented()}function Zn(e){return en(e)&&e.nodeType===3}function H_(e){return en(e)&&e.nodeType===9}function Jo(e){let t=e;for(;t!=null;){if(Zn(t))return t;t=t.firstChild}return null}function Ma(e,t,n){const r=gr[t];if(n!==null&&(e&r)===(n&r))return e;let o=e^r;return t==="subscript"?o&=-65:t==="superscript"?o&=-33:t==="lowercase"?(o&=-513,o&=-1025):t==="uppercase"?(o&=-257,o&=-1025):t==="capitalize"&&(o&=-257,o&=-513),o}function K_(e){return Y(e)||wn(e)||Ce(e)}function U_(e,t){const n=(function(){const s=Vu;return Vu=null,s})();if((t=t||n&&n.__key)!=null)return void(e.__key=t);st(),L_();const r=Fe(),o=wr(),i=""+t3++;o._nodeMap.set(i,e),V(e)?r._dirtyElements.set(i,!0):r._dirtyLeaves.add(i),r._cloneNotNeeded.add(i),r._dirtyType=1,e.__key=i}function Kr(e){const t=e.getParent();if(t!==null){const n=e.getWritable(),r=t.getWritable(),o=e.getPreviousSibling(),i=e.getNextSibling(),s=i!==null?i.__key:null,a=o!==null?o.__key:null,l=o!==null?o.getWritable():null,c=i!==null?i.getWritable():null;o===null&&(r.__first=s),i===null&&(r.__last=a),l!==null&&(l.__next=s),c!==null&&(c.__prev=a),n.__prev=null,n.__next=null,n.__parent=null,r.__size--}}function Na(e){L_(),Ra(e)&&U(323,e.__key,e.__type);const t=e.getLatest(),n=t.__parent,r=wr(),o=Fe(),i=r._nodeMap,s=o._dirtyElements;n!==null&&(function(l,c,u){let f=l;for(;f!==null;){if(u.has(f))return;const d=c.get(f);if(d===void 0)break;u.set(f,!1),f=d.__parent}})(n,i,s);const a=t.__key;o._dirtyType=1,V(e)?s.set(a,!0):o._dirtyLeaves.add(a)}function ut(e){st();const t=Fe(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,n!==null){const r=Me(n);r!==null&&r.getWritable()}if(e!==null){const r=Me(e);r!==null&&r.getWritable()}}}function rr(){return li()?null:Fe()._compositionKey}function Me(e,t){const n=(t||wr())._nodeMap.get(e);return n===void 0?null:n}function G_(e,t){const n=ll(e,Fe());return n!==void 0?Me(n,t):null}function ll(e,t){return e[`__lexicalKey_${t._key}`]}function Ft(e,t){let n=e;for(;n!=null;){const r=G_(n,t);if(r!==null)return r;n=fs(n)}return null}function q_(e){const t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function Lp(e){return e.read(()=>Ke().getTextContent())}function Ke(){return Y_(wr())}function Y_(e){return e._nodeMap.get("root")}function He(e){st();const t=wr();e!==null&&(e.dirty=!0,e.setCachedNodes(null)),t._selection=e}function Lo(e){const t=Fe(),n=(function(r,o){let i=r;for(;i!=null;){const s=ll(i,o);if(s!==void 0)return s;i=fs(i)}return null})(e,t);return n===null?e===t.getRootElement()?Me("root"):null:Me(n)}function X_(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function wf(e){const t=[];let n=e;for(;n!==null;)t.push(n),n=n._parentEditor;return t}function J_(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function Z_(e){return Zn(e)?e.nodeValue:null}function Sf(e,t,n){const r=St(qt(t));if(r===null)return;const o=r.anchorNode;let{anchorOffset:i,focusOffset:s}=r;if(o!==null){let a=Z_(o);const l=Ft(o);if(a!==null&&Y(l)){if(a===Xa&&n){const c=n.length;a=n,i=c,s=c}a!==null&&Ef(l,a,i,s,e)}}}function Ef(e,t,n,r,o){let i=e;if(i.isAttached()&&(o||!i.isDirty())){const s=i.isComposing();let a=t;(s||o)&&t[t.length-1]===Xa&&(a=t.slice(0,-1));const l=i.getTextContent();if(o||a!==l){if(a===""){if(ut(null),as||oi||ls)i.remove();else{const p=Fe();setTimeout(()=>{p.update(()=>{i.isAttached()&&i.remove()})},20)}return}const c=i.getParent(),u=An(),f=i.getTextContentSize(),d=rr(),h=i.getKey();if(i.isToken()||d!==null&&h===d&&!s||W(u)&&(c!==null&&!c.canInsertTextBefore()&&u.anchor.offset===0||u.anchor.key===e.__key&&u.anchor.offset===0&&!i.canInsertTextBefore()&&!s||u.focus.key===e.__key&&u.focus.offset===f&&!i.canInsertTextAfter()&&!s))return void i.markDirty();const g=G();if(!W(g)||n===null||r===null)return void Op(i,a,g);if(g.setTextNodeRange(i,n,i,r),i.isSegmented()){const p=Pe(i.getTextContent());i.replace(p),i=p}Op(i,a,g)}}}function Op(e,t,n){if(e.setTextContent(t),W(n)){const r=e.getKey();for(const o of["anchor","focus"]){const i=n[o];i.type==="text"&&i.key===r&&(i.offset=Tn(e,i.offset,"clamp"))}}}function Ls(e,t,n){const r=t[n]||!1;return r==="any"||r===e[n]}function r3(e,t){return Ls(e,t,"altKey")&&Ls(e,t,"ctrlKey")&&Ls(e,t,"shiftKey")&&Ls(e,t,"metaKey")}function Ae(e,t,n){return r3(e,n)&&e.key.toLowerCase()===t.toLowerCase()}const On={ctrlKey:!Qt,metaKey:Qt},Ip={altKey:Qt,ctrlKey:!Qt};function $p(e){return e.key==="Backspace"}function Dp(e){return Ae(e,"a",On)}function o3(e){const t=Ke();if(W(e)){const n=e.anchor,r=e.focus,o=n.getNode().getTopLevelElementOrThrow().getParentOrThrow();return n.set(o.getKey(),0,"element"),r.set(o.getKey(),o.getChildrenSize(),"element"),qi(e),e}{const n=t.select(0,t.getChildrenSize());return He(qi(n)),n}}function jo(e,t){e.__lexicalClassNameCache===void 0&&(e.__lexicalClassNameCache={});const n=e.__lexicalClassNameCache,r=n[t];if(r!==void 0)return r;const o=e[t];if(typeof o=="string"){const i=U0(o);return n[t]=i,i}return o}function Tf(e,t,n,r,o){if(n.size===0)return;const i=r.__type,s=r.__key,a=t.get(i);a===void 0&&U(33,i);const l=a.klass;let c=e.get(l);c===void 0&&(c=new Map,e.set(l,c));const u=c.get(s),f=u==="destroyed"&&o==="created";(u===void 0||f)&&c.set(s,f?"updated":o)}function Vp(e,t,n){const r=e.getParent();let o=n,i=e;return r!==null&&(t&&n===0?(o=i.getIndexWithinParent(),i=r):t||n!==i.getChildrenSize()||(o=i.getIndexWithinParent()+1,i=r)),i.getChildAtIndex(t?o-1:o)}function ju(e,t){const n=e.offset;if(e.type==="element")return Vp(e.getNode(),t,n);{const r=e.getNode();if(t&&n===0||!t&&n===r.getTextContentSize()){const o=t?r.getPreviousSibling():r.getNextSibling();return o===null?Vp(r.getParentOrThrow(),t,r.getIndexWithinParent()+(t?0:1)):o}}return null}function Q_(e){const t=qt(e).event,n=t&&t.inputType;return n==="insertFromPaste"||n==="insertFromPasteAsQuotation"}function Z(e,t,n){return(function(r,o,i){const s=wf(r);for(let a=4;a>=0;a--)for(let l=0;l<s.length;l++){const c=s[l],u=c._commands.get(o);if(u!==void 0){const f=u[a];if(f!==void 0){const d=Array.from(f),h=d.length;let g=!1;if(Sn(c,()=>{for(let p=0;p<h;p++)if(d[p](i,r))return void(g=!0)}),g)return g}}}return!1})(e,t,n)}function cl(e){return!tt(e)&&!e.isLastChild()&&!e.isInline()}function Jr(e,t){const n=e._keyToDOMMap.get(t);return n===void 0&&U(75,t),n}function fs(e){const t=e.assignedSlot||e.parentElement;return Wu(t)?t.host:t}function ex(e){return H_(e)?e:je(e)?e.ownerDocument:null}function i3(e){st(),Fe()._updateTags.add(e)}function s3(e){st(),Fe()._deferred.push(e)}function Bu(e,t){let n=e.getParent();for(;n!==null;){if(n.is(t))return!0;n=n.getParent()}return!1}function Rf(e){const t=ex(e);return t?t.defaultView:null}function qt(e){const t=e._window;return t===null&&U(78),t}function a3(e){return V(e)&&e.isInline()||Ce(e)&&e.isInline()}function l3(e){let t=e.getParentOrThrow();for(;t!==null;){if(dt(t))return t;t=t.getParentOrThrow()}return t}function dt(e){return tt(e)||V(e)&&e.isShadowRoot()}function c3(e){const t=e.constructor.clone(e);return U_(t,null),t.afterCloneFrom(e),t}function vt(e){const t=Fe(),n=e.getType(),r=xf(t,n);r===void 0&&U(200,e.constructor.name,n);const{replace:o,replaceWithKlass:i}=r;if(o!==null){const s=o(e),a=s.constructor;return i!==null?s instanceof i||U(201,i.name,i.getType(),a.name,a.getType(),e.constructor.name,n):s instanceof e.constructor&&a!==e.constructor||U(202,a.name,a.getType(),e.constructor.name,n),s.__key===e.__key&&U(203,e.constructor.name,n,a.name,a.getType()),s}return e}function sc(e,t){!tt(e.getParent())||V(t)||Ce(t)||U(99)}function u3(e){const t=Me(e);return t===null&&U(63,e),t}function ac(e){return(Ce(e)||V(e)&&!e.canBeEmpty())&&!e.isInline()}function zu(e,t,n){n.style.removeProperty("caret-color"),t._blockCursorElement=null;const r=e.parentElement;r!==null&&r.removeChild(e)}function St(e){return dn?(e||window).getSelection():null}function d3(e){const t=Rf(e);return t?t.getSelection():null}function tx(e){return je(e)&&e.tagName==="A"}function je(e){return en(e)&&e.nodeType===1}function en(e){return typeof e=="object"&&e!==null&&"nodeType"in e&&typeof e.nodeType=="number"}function Wu(e){return en(e)&&e.nodeType===11}function Hu(e){const t=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return e.nodeName.match(t)!==null}function Pa(e){const t=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return e.nodeName.match(t)!==null}function nr(e){if(Ce(e)&&!e.isInline())return!0;if(!V(e)||dt(e))return!1;const t=e.getFirstChild(),n=t===null||wn(t)||Y(t)||t.isInline();return!e.isInline()&&e.canBeEmpty()!==!1&&n}function ui(){return Fe()}const jp=new WeakMap,f3=new Map;function Bp(e){if(!e._readOnly&&e.isEmpty())return f3;e._readOnly||U(192);let t=jp.get(e);return t||(t=(function(n){const r=new Map;for(const[o,i]of n._nodeMap){const s=i.__type;let a=r.get(s);a||(a=new Map,r.set(s,a)),a.set(o,i)}return r})(e),jp.set(e,t)),t}function nx(e){const t=e.constructor.clone(e);return t.afterCloneFrom(e),t}function h3(e){return(t=nx(e))[T_]=!0,t;var t}function kf(e,t){const n=parseInt(e.style.paddingInlineStart,10)||0,r=Math.round(n/40);t.setIndent(r)}function g3(e){e.__lexicalUnmanaged=!0}function p3(e){return e.__lexicalUnmanaged===!0}function xi(e,t){return(function(n,r){return Object.prototype.hasOwnProperty.call(n,r)})(e,t)&&e[t]!==Cn[t]}function ul(e){const t=ep in e.prototype?e.prototype[ep]():void 0,n=(function(s){if(!(s===Cn||s.prototype instanceof Cn)){let a="<unknown>",l="<unknown>";try{a=s.getType()}catch{}try{Xo.version&&(l=JSON.parse(Xo.version))}catch{}U(290,s.name,a,l)}return s===cs||s===yt||s===Cn})(e),r=!n&&xi(e,"getType")?e.getType():void 0;let o,i=r;if(t)if(r)o=t[r];else for(const[s,a]of Object.entries(t))i=s,o=a;if(!n&&i&&(xi(e,"getType")||(e.getType=()=>i),xi(e,"clone")||(e.clone=s=>(_f(s),new e)),xi(e,"importJSON")||(e.importJSON=o&&o.$importJSON||(s=>new e().updateFromJSON(s))),!xi(e,"importDOM")&&o)){const{importDOM:s}=o;s&&(e.importDOM=()=>s)}return{ownNodeConfig:o,ownNodeType:i}}function rx(e){const t=ui();return st(),new(t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e))).klass}const xe=(e,t)=>{let n=e;for(;n!=null&&!tt(n);){if(t(n))return n;n=n.getParent()}return null},m3={next:"previous",previous:"next"};class Af{origin;constructor(t){this.origin=t}[Symbol.iterator](){return Pf({hasNext:pr,initial:this.getAdjacentCaret(),map:t=>t,step:t=>t.getAdjacentCaret()})}getAdjacentCaret(){return Je(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return Je(this.origin,this.direction)}remove(){const t=this.getNodeAtCaret();return t&&t.remove(),this}replaceOrInsert(t,n){const r=this.getNodeAtCaret();return t.is(this.origin)||t.is(r)||(r===null?this.insert(t):r.replace(t,n)),this}splice(t,n,r="next"){const o=r===this.direction?n:Array.from(n).reverse();let i=this;const s=this.getParentAtCaret(),a=new Map;for(let l=i.getAdjacentCaret();l!==null&&a.size<t;l=l.getAdjacentCaret()){const c=l.origin.getWritable();a.set(c.getKey(),c)}for(const l of o){if(a.size>0){const c=i.getNodeAtCaret();if(c){if(a.delete(c.getKey()),a.delete(l.getKey()),!(c.is(l)||i.origin.is(l))){const u=l.getParent();u&&u.is(s)&&l.remove(),c.replace(l)}}else c===null&&U(263,Array.from(a).join(" "))}else i.insert(l);i=Je(l,this.direction)}for(const l of a.values())l.remove();return this}}class Zi extends Af{type="child";getLatest(){const t=this.origin.getLatest();return t===this.origin?this:Ct(t,this.direction)}getParentCaret(t="root"){return Je(Mf(this.getParentAtCaret(),t),this.direction)}getFlipped(){const t=co(this.direction);return Je(this.getNodeAtCaret(),t)||Ct(this.origin,t)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(t){return t instanceof Zi&&this.direction===t.direction&&this.origin.is(t.origin)}isSamePointCaret(t){return this.isSameNodeCaret(t)}}const y3={root:tt,shadowRoot:dt};function co(e){return m3[e]}function Mf(e,t="root"){return y3[t](e)?null:e}class Zr extends Af{type="sibling";getLatest(){const t=this.origin.getLatest();return t===this.origin?this:Je(t,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return V(this.origin)?Ct(this.origin,this.direction):null}getParentCaret(t="root"){return Je(Mf(this.getParentAtCaret(),t),this.direction)}getFlipped(){const t=co(this.direction);return Je(this.getNodeAtCaret(),t)||Ct(this.origin.getParentOrThrow(),t)}isSamePointCaret(t){return t instanceof Zr&&this.direction===t.direction&&this.origin.is(t.origin)}isSameNodeCaret(t){return(t instanceof Zr||t instanceof Qr)&&this.direction===t.direction&&this.origin.is(t.origin)}}class Qr extends Af{type="text";offset;constructor(t,n){super(t),this.offset=n}getLatest(){const t=this.origin.getLatest();return t===this.origin?this:eo(t,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(t="root"){return Je(Mf(this.getParentAtCaret(),t),this.direction)}getFlipped(){return eo(this.origin,co(this.direction),this.offset)}isSamePointCaret(t){return t instanceof Qr&&this.direction===t.direction&&this.origin.is(t.origin)&&this.offset===t.offset}isSameNodeCaret(t){return(t instanceof Zr||t instanceof Qr)&&this.direction===t.direction&&this.origin.is(t.origin)}getSiblingCaret(){return Je(this.origin,this.direction)}}function En(e){return e instanceof Qr}function pr(e){return e instanceof Zr}function At(e){return e instanceof Zi}const v3={next:class extends Qr{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends Qr{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},_3={next:class extends Zr{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends Zr{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},x3={next:class extends Zi{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends Zi{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function Je(e,t){return e?new _3[t](e):null}function eo(e,t,n){return e?new v3[t](e,Tn(e,n)):null}function Tn(e,t,n="error"){const r=e.getTextContentSize();let o=t==="next"?r:t==="previous"?0:t;return(o<0||o>r)&&(n!=="clamp"&&H0(284,String(t),String(r),e.getKey()),o=o<0?0:r),o}function zp(e,t){return new C3(e,t)}function Ct(e,t){return V(e)?new x3[t](e):null}function b3(e){return e&&e.getChildCaret()||e}function hs(e){return e&&b3(e.getAdjacentCaret())}class Nf{type="node-caret-range";direction;anchor;focus;constructor(t,n,r){this.anchor=t,this.focus=n,this.direction=r}getLatest(){const t=this.anchor.getLatest(),n=this.focus.getLatest();return t===this.anchor&&n===this.focus?this:new Nf(t,n,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){const t=o=>{const i=this[o].getLatest();return En(i)?(function(s,a){const{direction:l,origin:c}=s,u=Tn(c,a==="focus"?co(l):l);return zp(s,u-s.offset)})(i,o):null},n=t("anchor"),r=t("focus");if(n&&r){const{caret:o}=n,{caret:i}=r;if(o.isSameNodeCaret(i))return[zp(o,i.offset-o.offset),null]}return[n,r]}iterNodeCarets(t="root"){const n=En(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),r=this.focus.getLatest(),o=En(r),i=s=>s.isSameNodeCaret(r)?null:hs(s)||s.getParentCaret(t);return Pf({hasNext:s=>s!==null&&!(o&&r.isSameNodeCaret(s)),initial:n.isSameNodeCaret(r)?null:i(n),map:s=>s,step:i})}[Symbol.iterator](){return this.iterNodeCarets("root")}}class C3{type="slice";caret;distance;constructor(t,n){this.caret=t,this.distance=n}getSliceIndices(){const{distance:t,caret:{offset:n}}=this,r=n+t;return r<n?[r,n]:[n,r]}getTextContent(){const[t,n]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(t,n)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){const{caret:{origin:t,direction:n}}=this,[r,o]=this.getSliceIndices(),i=t.getTextContent();return eo(t.setTextContent(i.slice(0,r)+i.slice(o)),n,r)}}function Qi(e){return mr(e,Je(Ke(),e.direction))}function ox(e){return mr(e,e)}function mr(e,t){return e.direction!==t.direction&&U(265),new Nf(e,t,e.direction)}function Pf(e){const{initial:t,hasNext:n,step:r,map:o}=e;let i=t;return{[Symbol.iterator](){return this},next(){if(!n(i))return{done:!0,value:void 0};const s={done:!1,value:o(i)};return i=r(i),s}}}function ix(e,t){const n=oa(e.origin,t.origin);switch(n===null&&U(275,e.origin.getKey(),t.origin.getKey()),n.type){case"same":{const r=e.type==="text",o=t.type==="text";return r&&o?(function(i,s){return Math.sign(i-s)})(e.offset,t.offset):e.type===t.type?0:r?-1:o?1:e.type==="child"?-1:1}case"ancestor":return e.type==="child"?-1:1;case"descendant":return t.type==="child"?1:-1;case"branch":return sx(n)}}function sx(e){const{a:t,b:n}=e,r=t.__key,o=n.__key;let i=t,s=n;for(;i&&s;i=i.getNextSibling(),s=s.getNextSibling()){if(i.__key===o)return-1;if(s.__key===r)return 1}return i===null?1:-1}function Os(e,t){return t.is(e)}function Wp(e){return V(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function oa(e,t){if(e.is(t))return{commonAncestor:e,type:"same"};const n=new Map;for(let[r,o]=Wp(e);r;o=r,r=r.getParent())n.set(r,o);for(let[r,o]=Wp(t);r;o=r,r=r.getParent()){const i=n.get(r);if(i!==void 0)return i===null?(Os(e,r)||U(276),{commonAncestor:r,type:"ancestor"}):o===null?(Os(t,r)||U(277),{commonAncestor:r,type:"descendant"}):((V(i)||Os(e,i))&&(V(o)||Os(t,o))&&r.is(i.getParent())&&r.is(o.getParent())||U(278),{a:i,b:o,commonAncestor:r,type:"branch"})}return null}function an(e,t){const{type:n,key:r,offset:o}=e,i=u3(e.key);return n==="text"?(Y(i)||U(266,i.getType(),r),eo(i,t,o)):(V(i)||U(267,i.getType(),r),S3(i,e.offset,t))}function tn(e,t){const{origin:n,direction:r}=t,o=r==="next";En(t)?e.set(n.getKey(),t.offset,"text"):pr(t)?Y(n)?e.set(n.getKey(),Tn(n,r),"text"):e.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+(o?1:0),"element"):(At(t)&&V(n)||U(268),e.set(n.getKey(),o?0:n.getChildrenSize(),"element"))}function ax(e){const t=G(),n=W(t)?t:ol();return ia(n,e),He(n),n}function ia(e,t){tn(e.anchor,t.anchor),tn(e.focus,t.focus)}function Hp(e){const{anchor:t,focus:n}=e,r=an(t,"next"),o=an(n,"next"),i=ix(r,o)<=0?"next":"previous";return mr(Xn(r,i),Xn(o,i))}function gs(e){const{direction:t,origin:n}=e,r=Je(n,co(t)).getNodeAtCaret();return r?Je(r,t):Ct(n.getParentOrThrow(),t)}function Kp(e,t="root"){const n=[e];for(let r=At(e)?e.getParentCaret(t):e.getSiblingCaret();r!==null;r=r.getParentCaret(t))n.push(gs(r));return n}function lc(e){return!!e&&e.origin.isAttached()}function w3(e,t="removeEmptySlices"){if(e.isCollapsed())return e;const n="root",r="next";let o=t;const i=lx(e,r),s=Kp(i.anchor,n),a=Kp(i.focus.getFlipped(),n),l=new Set,c=[];for(const g of i.iterNodeCarets(n))if(At(g))l.add(g.origin.getKey());else if(pr(g)){const{origin:p}=g;V(p)&&!l.has(p.getKey())||c.push(p)}for(const g of c)g.remove();for(const g of i.getTextSlices()){if(!g)continue;const{origin:p}=g.caret,m=p.getTextContentSize(),_=gs(Je(p,r)),y=p.getMode();if(Math.abs(g.distance)===m&&o==="removeEmptySlices"||y==="token"&&g.distance!==0)_.remove();else if(g.distance!==0){o="removeEmptySlices";let v=g.removeTextSlice();const x=g.caret.origin;if(y==="segmented"){const b=v.origin,w=Pe(b.getTextContent()).setStyle(b.getStyle()).setFormat(b.getFormat());_.replaceOrInsert(w),v=eo(w,r,v.offset)}x.is(s[0].origin)&&(s[0]=v),x.is(a[0].origin)&&(a[0]=v.getFlipped())}}let u,f;for(const g of s)if(lc(g)){u=bt(g);break}for(const g of a)if(lc(g)){f=bt(g);break}const d=(function(g,p,m){if(!g||!p)return null;const _=g.getParentAtCaret(),y=p.getParentAtCaret();if(!_||!y)return null;const v=_.getParents().reverse();v.push(_);const x=y.getParents().reverse();x.push(y);const b=Math.min(v.length,x.length);let w;for(w=0;w<b&&v[w]===x[w];w++);const T=(M,O)=>{let D;for(let I=w;I<M.length;I++){const L=M[I];if(dt(L))return;!D&&O(L)&&(D=L)}return D},E=T(v,nr),R=E&&T(x,M=>m.has(M.getKey())&&nr(M));return E&&R?[E,R]:null})(u,f,l);if(d){const[g,p]=d;Ct(g,"previous").splice(0,p.getChildren()),p.remove()}const h=[u,f,...s,...a].find(lc);if(h)return ox(Xn(bt(h),e.direction));U(269,JSON.stringify(s.map(g=>g.origin.__key)))}function bt(e){const t=(function(o){let i=o;for(;At(i);){const s=hs(i);if(!At(s))break;i=s}return i})(e.getLatest()),{direction:n}=t;if(Y(t.origin))return En(t)?t:eo(t.origin,n,n);const r=t.getAdjacentCaret();return pr(r)&&Y(r.origin)?eo(r.origin,n,co(n)):t}function Ff(e){return En(e)&&e.offset!==Tn(e.origin,e.direction)}function Xn(e,t){return e.direction===t?e:e.getFlipped()}function lx(e,t){return e.direction===t?e:mr(Xn(e.focus,t),Xn(e.anchor,t))}function S3(e,t,n){let r=Ct(e,"next");for(let o=0;o<t;o++){const i=r.getAdjacentCaret();if(i===null)break;r=i}return Xn(r,n)}function E3(e){const{origin:t,offset:n,direction:r}=e;if(n===Tn(t,r))return e.getSiblingCaret();if(n===Tn(t,co(r)))return gs(e.getSiblingCaret());const[o]=t.splitText(n);return Y(o)||U(281),Xn(Je(o,"next"),r)}function T3(e,t){return!0}function R3(e,{$copyElementNode:t=c3,$splitTextPointCaretNext:n=E3,rootMode:r="shadowRoot",$shouldSplit:o=T3}={}){if(En(e))return n(e);const i=e.getParentCaret(r);if(i){const{origin:s}=i;if(At(e)&&(!s.canBeEmpty()||!o(s,"first")))return gs(i);const a=(function(l){const c=[];for(let u=l.getAdjacentCaret();u;u=u.getAdjacentCaret())c.push(u.origin);return c})(e);(a.length>0||s.canBeEmpty()&&o(s,"last"))&&i.insert(t(s).splice(0,0,a))}return i}function k3(e,t){if(!t||e===t)return e;for(const n in t)if(e[n]!==t[n])return{...e,...t};return e}const Ku=new Map;function cx(e){const t={};if(!e)return t;const n=e.split(";");for(const r of n)if(r!==""){const[o,i]=r.split(/:([^]+)/);o&&i&&(t[o.trim()]=i.trim())}return t}function Up(e){let t=Ku.get(e);return t===void 0&&(t=cx(e),Ku.set(e,t)),t}function ux(e){const t=ui().getElementByKey(e.getKey());if(t===null)return null;const n=t.ownerDocument.defaultView;return n===null?null:n.getComputedStyle(t)}function dx(e){return ux(tt(e)?e:e.getParentOrThrow())}function Gp(e){const t=dx(e);return t!==null&&t.direction==="rtl"}function fx(e,t,n="self"){const r=e.getStartEndPoints();if(t.isSelected(e)&&!In(t)&&r!==null){const[o,i]=r,s=e.isBackward(),a=o.getNode(),l=i.getNode(),c=t.is(a),u=t.is(l);if(c||u){const[f,d]=$u(e),h=a.is(l),g=t.is(s?l:a),p=t.is(s?a:l);let m,_=0;h?(_=f>d?d:f,m=f>d?f:d):g?(_=s?d:f,m=void 0):p&&(_=0,m=s?f:d);const y=t.__text.slice(_,m);y!==t.__text&&(n==="clone"&&(t=h3(t)),t.__text=y)}}return t}function A3(e){const t=e.getStyle(),n=cx(t);Ku.set(t,n)}function hx(e){const t=gx(e);return t!==null&&t.writingMode==="vertical-rl"}function gx(e){const t=e.anchor.getNode();return V(t)?ux(t):dx(t)}function qp(e,t){let n=hx(e)?!t:t;px(e)&&(n=!n);const r=an(e.focus,n?"previous":"next");if(Ff(r))return!1;for(const o of Qi(r)){if(At(o))return!o.origin.isInline();if(!V(o.origin)){if(Ce(o.origin))return!0;break}}return!1}function M3(e,t,n,r){e.modify(t?"extend":"move",n,r)}function px(e){const t=gx(e);return t!==null&&t.direction==="rtl"}function Yp(e,t,n){const r=px(e);let o;o=hx(e)||r?!n:n,M3(e,t,o,"character")}function mx(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const yx=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,N3=yx&&"documentMode"in document?document.documentMode:null;!(!yx||!("InputEvent"in window)||N3)&&"getTargetRanges"in new window.InputEvent("input");function vx(...e){const t=[];for(const n of e)if(n&&typeof n=="string")for(const[r]of n.matchAll(/\S+/g))t.push(r);return t}function ln(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function Ye(e,...t){const n=vx(...t);n.length>0&&e.classList.add(...n)}function Rn(e,...t){const n=vx(...t);n.length>0&&e.classList.remove(...n)}function P3(e){return e?e.getAdjacentCaret():null}function F3(e,t){let n=e;for(;n!=null;){if(n instanceof t)return n;n=n.getParent()}return null}function L3(e){const t=xe(e,n=>V(n)&&!n.isInline());return V(t)||mx(4,e.__key),t}function O3(e){const t=G()||An();let n;if(W(t))n=an(t.focus,"next");else{if(t!=null){const s=t.getNodes(),a=s[s.length-1];a&&(n=Je(a,"next"))}n=n||Ct(Ke(),"previous").getFlipped().insert(me())}const r=I3(e,n),o=hs(r),i=At(o)?bt(o):r;return ax(ox(i)),e.getLatest()}function I3(e,t,n){let r=Xn(t,"next");for(let o=r;o;o=R3(o,n))r=o;return En(r)&&mx(283),r.insert(e.isInline()?me().append(e):e),Xn(Je(e.getLatest(),"next"),t.direction)}function or(e,t){return e!==null&&Object.getPrototypeOf(e).constructor.name===t.name}function $3(e,t){Ct(e,"next").insert(t)}function _x(e,t){return xx(e,t,null)}function xx(e,t,n){let r=!1;for(const o of Cx(e))t(o)?n!==null&&n(o):(r=!0,V(o)&&xx(o,t,n||(i=>o.insertAfter(i))),o.remove());return r}function bx(e,t){const n=[],r=Array.from(e).reverse();for(let o=r.pop();o!==void 0;o=r.pop())if(t(o))n.push(o);else if(V(o))for(const i of Cx(o))r.push(i);return n}function Cx(e){return D3(Ct(e,"previous"))}function D3(e){return Pf({hasNext:pr,initial:e.getAdjacentCaret(),map:t=>t.origin.getLatest(),step:t=>t.getAdjacentCaret()})}function wx(){const[e]=nt(),[t,n]=C.useState(!1),[r,o]=C.useState(!1),[i,s]=C.useState(!1),[a,l]=C.useState(!1),[c,u]=C.useState("left"),f=c==="left",d=c==="center",h=c==="right",g=C.useCallback(()=>{const _=G();W(_)&&(n(_.hasFormat("bold")),o(_.hasFormat("italic")),s(_.hasFormat("underline")),l(_.hasFormat("strikethrough")))},[]),p=C.useCallback(_=>{u(_)},[]),m=C.useCallback(()=>{const _=G();if(!W(_))return;const y=_.anchor.getNode(),v=y.getKey()==="root"?y:y.getTopLevelElementOrThrow();if(V(v)){const x=v.getFormatType();p(x)}},[p]);return C.useEffect(()=>{const _=ln(e.registerCommand(Rt,(y,v)=>(e.read(()=>{g()}),!1),jn),e.registerCommand($o,(y,v)=>(e.read(()=>{p(y)}),!1),jn),e.registerCommand(zn,(y,v)=>(e.read(()=>{g(),m()}),!1),jn));return()=>{_()}},[e,g,p,m]),{isBold:t,isItalic:r,isUnderline:i,isStrikethrough:a,alignment:c,isAlignLeft:f,isAlignCenter:d,isAlignRight:h}}var oe=(e=>(e.BOLD="font-bold",e.ITALIC="font-italic",e.UNDERLINE="font-underline",e.STRIKETHROUGH="font-strikethrough",e.ALIGN_LEFT="align-left",e.ALIGN_CENTER="align-center",e.ALIGN_RIGHT="align-right",e.LINK="insert-link",e.IMAGE="insert-image",e.TABLE="insert-table",e.BULLET_LIST="insert-bullet-list",e.NUMBERED_LIST="insert-numbered-list",e))(oe||{});function V3(){const{isBold:e,isItalic:t,isUnderline:n,isStrikethrough:r,isAlignLeft:o,isAlignCenter:i,isAlignRight:s}=wx(),l=ss().toolbar.actions,{availableActions:c}=IR(),u=C.useMemo(()=>({id:oe.BOLD,IconComponent:RR,label:l.bold,isActive:e}),[l.bold,e]),f=C.useMemo(()=>({id:oe.ITALIC,IconComponent:AR,label:l.italic,isActive:t}),[l.italic,t]),d=C.useMemo(()=>({id:oe.UNDERLINE,IconComponent:OR,label:l.underline,isActive:n}),[l.underline,n]),h=C.useMemo(()=>({id:oe.STRIKETHROUGH,IconComponent:FR,label:l.strikethrough,isActive:r}),[l.strikethrough,r]),g=C.useMemo(()=>({id:oe.ALIGN_LEFT,IconComponent:ER,label:l.alignLeft,isActive:o}),[l.alignLeft,o]),p=C.useMemo(()=>({id:oe.ALIGN_CENTER,IconComponent:SR,label:l.alignCenter,isActive:i}),[l.alignCenter,i]),m=C.useMemo(()=>({id:oe.ALIGN_RIGHT,IconComponent:TR,label:l.alignRight,isActive:s}),[l.alignRight,s]),_=C.useMemo(()=>({id:oe.BULLET_LIST,IconComponent:NR,label:l.bulletList}),[l.bulletList]),y=C.useMemo(()=>({id:oe.NUMBERED_LIST,IconComponent:PR,label:l.numberedList}),[l.numberedList]),v=C.useMemo(()=>({id:oe.LINK,IconComponent:MR,label:l.link}),[l.link]),x=C.useMemo(()=>({id:oe.IMAGE,IconComponent:kR,label:l.image}),[l.image]),b=C.useMemo(()=>({id:oe.TABLE,IconComponent:LR,label:l.table}),[l.table]),w=C.useMemo(()=>({[oe.BOLD]:u,[oe.ITALIC]:f,[oe.UNDERLINE]:d,[oe.STRIKETHROUGH]:h,[oe.ALIGN_LEFT]:g,[oe.ALIGN_CENTER]:p,[oe.ALIGN_RIGHT]:m,[oe.BULLET_LIST]:_,[oe.NUMBERED_LIST]:y,[oe.LINK]:v,[oe.IMAGE]:x,[oe.TABLE]:b}),[u,f,d,h,g,p,m,_,y,v,x,b]),T=C.useMemo(()=>c.map(R=>R.map(M=>w[M])),[c,w]);return{availableActions:C.useMemo(()=>T.flat(),[T]),availableActionGroups:T}}const j3=Symbol.for("preact-signals");function Lf(){if(Bo>1)return void Bo--;let e,t=!1;for(;Vi!==void 0;){let n=Vi;for(Vi=void 0,Uu++;n!==void 0;){const r=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&Ex(n))try{n.c()}catch(o){t||(e=o,t=!0)}n=r}}if(Uu=0,Bo--,t)throw e}let ke,Vi;function Xp(e){const t=ke;ke=void 0;try{return e()}finally{ke=t}}let Bo=0,Uu=0,sa=0;function Jp(e){if(ke===void 0)return;let t=e.n;return t===void 0||t.t!==ke?(t={i:0,S:e,p:ke.s,n:void 0,t:ke,e:void 0,x:void 0,r:t},ke.s!==void 0&&(ke.s.n=t),ke.s=t,e.n=t,32&ke.f&&e.S(t),t):t.i===-1?(t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=ke.s,t.n=void 0,ke.s.n=t,ke.s=t),t):void 0}function _t(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function Sx(e,t){return new _t(e,t)}function Ex(e){for(let t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function Zp(e){for(let t=e.s;t!==void 0;t=t.n){const n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function Tx(e){let t,n=e.s;for(;n!==void 0;){const r=n.p;n.i===-1?(n.S.U(n),r!==void 0&&(r.n=n.n),n.n!==void 0&&(n.n.p=r)):t=n,n.S.n=n.r,n.r!==void 0&&(n.r=void 0),n=r}e.s=t}function po(e,t){_t.call(this,void 0),this.x=e,this.s=void 0,this.g=sa-1,this.f=4,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function Rx(e){const t=e.u;if(e.u=void 0,typeof t=="function"){Bo++;const n=ke;ke=void 0;try{t()}catch(r){throw e.f&=-2,e.f|=8,Of(e),r}finally{ke=n,Lf()}}}function Of(e){for(let t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Rx(e)}function B3(e){if(ke!==this)throw new Error("Out-of-order effect");Tx(this),ke=e,this.f&=-2,8&this.f&&Of(this),Lf()}function Eo(e,t){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32,this.name=t?.name}function z3(e,t){const n=new Eo(e,t);try{n.c()}catch(o){throw n.d(),o}const r=n.d.bind(n);return r[Symbol.dispose]=r,r}_t.prototype.brand=j3,_t.prototype.h=function(){return!0},_t.prototype.S=function(e){const t=this.t;t!==e&&e.e===void 0&&(e.x=t,this.t=e,t!==void 0?t.e=e:Xp(()=>{var n;(n=this.W)==null||n.call(this)}))},_t.prototype.U=function(e){if(this.t!==void 0){const t=e.e,n=e.x;t!==void 0&&(t.x=n,e.e=void 0),n!==void 0&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n,n===void 0&&Xp(()=>{var r;(r=this.Z)==null||r.call(this)}))}},_t.prototype.subscribe=function(e){return z3(()=>{const t=this.value,n=ke;ke=void 0;try{e(t)}finally{ke=n}},{name:"sub"})},_t.prototype.valueOf=function(){return this.value},_t.prototype.toString=function(){return this.value+""},_t.prototype.toJSON=function(){return this.value},_t.prototype.peek=function(){const e=ke;ke=void 0;try{return this.value}finally{ke=e}},Object.defineProperty(_t.prototype,"value",{get(){const e=Jp(this);return e!==void 0&&(e.i=this.i),this.v},set(e){if(e!==this.v){if(Uu>100)throw new Error("Cycle detected");this.v=e,this.i++,sa++,Bo++;try{for(let t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Lf()}}}}),po.prototype=new _t,po.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===sa))return!0;if(this.g=sa,this.f|=1,this.i>0&&!Ex(this))return this.f&=-2,!0;const e=ke;try{Zp(this),ke=this;const t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(t){this.v=t,this.f|=16,this.i++}return ke=e,Tx(this),this.f&=-2,!0},po.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(let t=this.s;t!==void 0;t=t.n)t.S.S(t)}_t.prototype.S.call(this,e)},po.prototype.U=function(e){if(this.t!==void 0&&(_t.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(let t=this.s;t!==void 0;t=t.n)t.S.U(t)}},po.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(po.prototype,"value",{get(){if(1&this.f)throw new Error("Cycle detected");const e=Jp(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),Eo.prototype.c=function(){const e=this.S();try{if(8&this.f||this.x===void 0)return;const t=this.x();typeof t=="function"&&(this.u=t)}finally{e()}},Eo.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Rx(this),Zp(this),Bo++;const e=ke;return ke=this,B3.bind(this,e)},Eo.prototype.N=function(){2&this.f||(this.f|=2,this.o=Vi,Vi=this)},Eo.prototype.d=function(){this.f|=8,1&this.f||Of(this)},Eo.prototype.dispose=function(){this.d()};function W3(e){return(typeof e.nodes=="function"?e.nodes():e.nodes)||[]}function Ie(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function kx(e,t){if(e&&t&&!Array.isArray(t)&&typeof e=="object"&&typeof t=="object"){const n=e,r=t;for(const o in r)n[o]=kx(n[o],r[o]);return e}return t}const If=0,Gu=1,Ax=2,cc=3,Is=4,mo=5,uc=6,bi=7;function dc(e){return e.id===If}function Mx(e){return e.id===Ax}function H3(e){return(function(t){return t.id===Gu})(e)||Ie(305,String(e.id),String(Gu)),Object.assign(e,{id:Ax})}const K3=new Set;let U3=class{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(t,n){this.builder=t,this.extension=n,this.configs=new Set,this.state={id:If}}mergeConfigs(){let t=this.extension.config||{};const n=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):k3;for(const r of this.configs)t=n(t,r);return t}init(t){const n=this.state;Mx(n)||Ie(306,String(n.id));const r={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},o={...r,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},i=(function(a,l,c){return Object.assign(a,{config:l,id:cc,registerState:c})})(n,this.mergeConfigs(),r);let s;this.state=i,this.extension.init&&(s=this.extension.init(t,i.config,r)),this.state=(function(a,l,c){return Object.assign(a,{id:Is,initResult:l,registerState:c})})(i,s,o)}build(t){const n=this.state;let r;n.id!==Is&&Ie(307,String(n.id),String(mo)),this.extension.build&&(r=this.extension.build(t,n.config,n.registerState));const o={...n.registerState,getOutput:()=>r,getSignal:this.getSignal.bind(this)};this.state=(function(i,s,a){return Object.assign(i,{id:mo,output:s,registerState:a})})(n,r,o)}register(t,n){this._signal=n;const r=this.state;r.id!==mo&&Ie(308,String(r.id),String(mo));const o=this.extension.register&&this.extension.register(t,r.config,r.registerState);return this.state=(function(i){return Object.assign(i,{id:uc})})(r),()=>{const i=this.state;i.id!==bi&&Ie(309,String(r.id),String(bi)),this.state=(function(s){return Object.assign(s,{id:mo})})(i),o&&o()}}afterRegistration(t){const n=this.state;let r;return n.id!==uc&&Ie(310,String(n.id),String(uc)),this.extension.afterRegistration&&(r=this.extension.afterRegistration(t,n.config,n.registerState)),this.state=(function(o){return Object.assign(o,{id:bi})})(n),r}getSignal(){return this._signal===void 0&&Ie(311),this._signal}getInitResult(){this.extension.init===void 0&&Ie(312,this.extension.name);const t=this.state;return(function(n){return n.id>=Is})(t)||Ie(313,String(t.id),String(Is)),t.initResult}getInitPeer(t){const n=this.builder.extensionNameMap.get(t);return n?n.getExtensionInitDependency():void 0}getExtensionInitDependency(){const t=this.state;return(function(n){return n.id>=cc})(t)||Ie(314,String(t.id),String(cc)),{config:t.config}}getPeer(t){const n=this.builder.extensionNameMap.get(t);return n?n.getExtensionDependency():void 0}getInitDependency(t){const n=this.builder.getExtensionRep(t);return n===void 0&&Ie(315,this.extension.name,t.name),n.getExtensionInitDependency()}getDependency(t){const n=this.builder.getExtensionRep(t);return n===void 0&&Ie(315,this.extension.name,t.name),n.getExtensionDependency()}getState(){const t=this.state;return(function(n){return n.id>=bi})(t)||Ie(316,String(t.id),String(bi)),t}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||K3}getPeerNameSet(){let t=this._peerNameSet;return t||(t=new Set((this.extension.peerDependencies||[]).map(([n])=>n)),this._peerNameSet=t),t}getExtensionDependency(){if(!this._dependency){const t=this.state;(function(n){return n.id>=mo})(t)||Ie(317,this.extension.name),this._dependency={config:t.config,init:t.initResult,output:t.output}}return this._dependency}};const Qp={tag:Vo};function G3(){const e=Ke();e.isEmpty()&&e.append(me())}const q3={config:{setOptions:Qp,updateOptions:Qp},init:({$initialEditorState:e=G3})=>({$initialEditorState:e,initialized:!1}),afterRegistration(e,{updateOptions:t,setOptions:n},r){const o=r.getInitResult();if(!o.initialized){o.initialized=!0;const{$initialEditorState:i}=o;if(Jk(i))e.setEditorState(i,n);else if(typeof i=="function")e.update(()=>{i(e)},t);else if(i&&(typeof i=="string"||typeof i=="object")){const s=e.parseEditorState(i);e.setEditorState(s,n)}}return()=>{}},name:"@lexical/extension/InitialState",nodes:[ci,Gt,ii,si,lo]},em=Symbol.for("@lexical/extension/LexicalBuilder");function tm(){}function Y3(e){throw e}function $s(e){return Array.isArray(e)?e:[e]}const fc="0.39.0+prod.esm";let X3=class aa{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(t){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=fc,this.roots=t;for(const n of t)this.addExtension(n)}static fromExtensions(t){const n=[$s(q3)];for(const r of t)n.push($s(r));return new aa(n)}static maybeFromEditor(t){const n=t[em];return n&&(n.PACKAGE_VERSION!==fc&&Ie(292,n.PACKAGE_VERSION,fc),n instanceof aa||Ie(293)),n}static fromEditor(t){const n=aa.maybeFromEditor(t);return n===void 0&&Ie(294),n}constructEditor(){const{$initialEditorState:t,onError:n,...r}=this.buildCreateEditorArgs(),o=Object.assign(j_({...r,...n?{onError:i=>{n(i,o)}}:{}}),{[em]:this});for(const i of this.sortedExtensionReps())i.build(o);return o}buildEditor(){let t=tm;function n(){try{t()}finally{t=tm}}const r=Object.assign(this.constructEditor(),{dispose:n,[Symbol.dispose]:n});return t=ln(this.registerEditor(r),()=>r.setRootElement(null)),r}hasExtensionByName(t){return this.extensionNameMap.has(t)}getExtensionRep(t){const n=this.extensionNameMap.get(t.name);if(n)return n.extension!==t&&Ie(295,t.name),n}addEdge(t,n,r){const o=this.outgoingConfigEdges.get(t);o?o.set(n,r):this.outgoingConfigEdges.set(t,new Map([[n,r]]));const i=this.incomingEdges.get(n);i?i.add(t):this.incomingEdges.set(n,new Set([t]))}addExtension(t){this._sortedExtensionReps!==void 0&&Ie(296);const n=$s(t),[r]=n;typeof r.name!="string"&&Ie(297,typeof r.name);let o=this.extensionNameMap.get(r.name);if(o!==void 0&&o.extension!==r&&Ie(298,r.name),!o){o=new U3(this,r),this.extensionNameMap.set(r.name,o);const i=this.conflicts.get(r.name);typeof i=="string"&&Ie(299,r.name,i);for(const s of r.conflictsWith||[])this.extensionNameMap.has(s)&&Ie(299,r.name,s),this.conflicts.set(s,r.name);for(const s of r.dependencies||[]){const a=$s(s);this.addEdge(r.name,a[0].name,a.slice(1)),this.addExtension(a)}for(const[s,a]of r.peerDependencies||[])this.addEdge(r.name,s,a?[a]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;const t=[],n=(r,o)=>{let i=r.state;if(Mx(i))return;const s=r.extension.name;var a;dc(i)||Ie(300,s,o||"[unknown]"),dc(a=i)||Ie(304,String(a.id),String(If)),i=Object.assign(a,{id:Gu}),r.state=i;const l=this.outgoingConfigEdges.get(s);if(l)for(const c of l.keys()){const u=this.extensionNameMap.get(c);u&&n(u,s)}i=H3(i),r.state=i,t.push(r)};for(const r of this.extensionNameMap.values())dc(r.state)&&n(r);for(const r of t)for(const[o,i]of this.outgoingConfigEdges.get(r.extension.name)||[])if(i.length>0){const s=this.extensionNameMap.get(o);if(s)for(const a of i)s.configs.add(a)}for(const[r,...o]of this.roots)if(o.length>0){const i=this.extensionNameMap.get(r.name);i===void 0&&Ie(301,r.name);for(const s of o)i.configs.add(s)}return this._sortedExtensionReps=t,this._sortedExtensionReps}registerEditor(t){const n=this.sortedExtensionReps(),r=new AbortController,o=[()=>r.abort()],i=r.signal;for(const s of n){const a=s.register(t,i);a&&o.push(a)}for(const s of n){const a=s.afterRegistration(t);a&&o.push(a)}return ln(...o)}buildCreateEditorArgs(){const t={},n=new Set,r=new Map,o=new Map,i={},s={},a=this.sortedExtensionReps();for(const u of a){const{extension:f}=u;if(f.onError!==void 0&&(t.onError=f.onError),f.disableEvents!==void 0&&(t.disableEvents=f.disableEvents),f.parentEditor!==void 0&&(t.parentEditor=f.parentEditor),f.editable!==void 0&&(t.editable=f.editable),f.namespace!==void 0&&(t.namespace=f.namespace),f.$initialEditorState!==void 0&&(t.$initialEditorState=f.$initialEditorState),f.nodes)for(const d of W3(f)){if(typeof d!="function"){const h=r.get(d.replace);h&&Ie(302,f.name,d.replace.name,h.extension.name),r.set(d.replace,u)}n.add(d)}if(f.html){if(f.html.export)for(const[d,h]of f.html.export.entries())o.set(d,h);f.html.import&&Object.assign(i,f.html.import)}f.theme&&kx(s,f.theme)}Object.keys(s).length>0&&(t.theme=s),n.size&&(t.nodes=[...n]);const l=Object.keys(i).length>0,c=o.size>0;(l||c)&&(t.html={},l&&(t.html.import=i),c&&(t.html.export=o));for(const u of a)u.init(t);return t.onError||(t.onError=Y3),t}},$f=class Nx extends cs{static getType(){return"horizontalrule"}static clone(t){return new Nx(t.__key)}static importJSON(t){return Px().updateFromJSON(t)}static importDOM(){return{hr:()=>({conversion:J3,priority:0})}}exportDOM(){return{element:document.createElement("hr")}}createDOM(t){const n=document.createElement("hr");return Ye(n,t.theme.hr),n}getTextContent(){return`
|
|
20
|
+
`}isInline(){return!1}updateDOM(){return!1}};function J3(){return{node:Px()}}function Px(){return rx($f)}function Z3(e){return e instanceof $f}function ir(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function qu(e){let t=1,n=e.getParent();for(;n!=null;){if(Ee(n)){const r=n.getParent();if(ge(r)){t++,n=r.getParent();continue}ir(40)}return t}return t}function Yu(e){let t=e.getParent();ge(t)||ir(40);let n=t;for(;n!==null;)n=n.getParent(),ge(n)&&(t=n);return t}function Fx(e){let t=[];const n=e.getChildren().filter(Ee);for(let r=0;r<n.length;r++){const o=n[r],i=o.getFirstChild();ge(i)?t=t.concat(Fx(i)):t.push(o)}return t}function yn(e){return Ee(e)&&ge(e.getFirstChild())}function nm(e){return It().append(e)}function Lx(e,t){return Ee(e)&&(t.length===0||t.length===1&&e.is(t[0])&&e.getChildrenSize()===0)}function rm(e){const t=G();if(t!==null){let n=t.getNodes();if(W(t)){const o=t.getStartEndPoints();o===null&&ir(143);const[i]=o,s=i.getNode(),a=s.getParent();if(dt(s)){const l=s.getFirstChild();if(l)n=l.selectStart().getNodes();else{const c=me();s.append(c),n=c.select().getNodes()}}else if(Lx(s,n)){const l=Mt(e);if(dt(a)){s.replace(l);const c=It();V(s)&&(c.setFormat(s.getFormatType()),c.setIndent(s.getIndent())),l.append(c)}else if(Ee(s)){const c=s.getParentOrThrow();to(l,c.getChildren()),c.replace(l)}return}}const r=new Set;for(let o=0;o<n.length;o++){const i=n[o];if(V(i)&&i.isEmpty()&&!Ee(i)&&!r.has(i.getKey())){om(i,e);continue}let s=K_(i)?i.getParent():Ee(i)&&i.isEmpty()?i:null;for(;s!=null;){const a=s.getKey();if(ge(s)){if(!r.has(a)){const l=Mt(e);to(l,s.getChildren()),s.replace(l),r.add(a)}break}{const l=s.getParent();if(dt(l)&&!r.has(a)){r.add(a),om(s,e);break}s=l}}}}}function to(e,t){e.splice(e.getChildrenSize(),0,t)}function om(e,t){if(ge(e))return e;const n=e.getPreviousSibling(),r=e.getNextSibling(),o=It();let i;if(to(o,e.getChildren()),ge(n)&&t===n.getListType())n.append(o),ge(r)&&t===r.getListType()&&(to(n,r.getChildren()),r.remove()),i=n;else if(ge(r)&&t===r.getListType())r.getFirstChildOrThrow().insertBefore(o),i=r;else{const s=Mt(t);s.append(o),e.replace(s),i=s}return o.setFormat(e.getFormatType()),o.setIndent(e.getIndent()),e.remove(),i}function Df(e,t){const n=e.getLastChild(),r=t.getFirstChild();n&&r&&yn(n)&&yn(r)&&(Df(n.getFirstChild(),r.getFirstChild()),r.remove());const o=t.getChildren();o.length>0&&e.append(...o),t.remove()}function Q3(){const e=G();if(W(e)){const t=new Set,n=e.getNodes(),r=e.anchor.getNode();if(Lx(r,n))t.add(Yu(r));else for(let o=0;o<n.length;o++){const i=n[o];if(K_(i)){const s=F3(i,Er);s!=null&&t.add(Yu(s))}}for(const o of t){let i=o;const s=Fx(o);for(const a of s){const l=me().setTextStyle(e.style).setTextFormat(e.format);to(l,a.getChildren()),i.insertAfter(l),i=l,a.__key===e.anchor.key&&tn(e.anchor,bt(Ct(l,"next"))),a.__key===e.focus.key&&tn(e.focus,bt(Ct(l,"next"))),a.remove()}o.remove()}}}function Ox(e){const t=e.getListType()!=="check";let n=e.getStart();for(const r of e.getChildren())Ee(r)&&(r.getValue()!==n&&r.setValue(n),t&&r.getLatest().__checked!=null&&r.setChecked(void 0),ge(r.getFirstChild())||n++)}function eA(e){const t=new Set;if(yn(e)||t.has(e.getKey()))return;const n=e.getParent(),r=e.getNextSibling(),o=e.getPreviousSibling();if(yn(r)&&yn(o)){const i=o.getFirstChild();if(ge(i)){i.append(e);const s=r.getFirstChild();ge(s)&&(to(i,s.getChildren()),r.remove(),t.add(r.getKey()))}}else if(yn(r)){const i=r.getFirstChild();if(ge(i)){const s=i.getFirstChild();s!==null&&s.insertBefore(e)}}else if(yn(o)){const i=o.getFirstChild();ge(i)&&i.append(e)}else if(ge(n)){const i=It().setTextFormat(e.getTextFormat()).setTextStyle(e.getTextStyle()),s=Mt(n.getListType()).setTextFormat(n.getTextFormat()).setTextStyle(n.getTextStyle());i.append(s),s.append(e),o?o.insertAfter(i):r?r.insertBefore(i):n.append(i)}}function tA(e){if(yn(e))return;const t=e.getParent(),n=t?t.getParent():void 0;if(ge(n?n.getParent():void 0)&&Ee(n)&&ge(t)){const r=t?t.getFirstChild():void 0,o=t?t.getLastChild():void 0;if(e.is(r))n.insertBefore(e),t.isEmpty()&&n.remove();else if(e.is(o))n.insertAfter(e),t.isEmpty()&&n.remove();else{const i=t.getListType(),s=It(),a=Mt(i);s.append(a),e.getPreviousSiblings().forEach(u=>a.append(u));const l=It(),c=Mt(i);l.append(c),to(c,e.getNextSiblings()),n.insertBefore(s),n.insertAfter(l),n.replace(e)}}}function nA(){const e=G();if(!W(e)||!e.isCollapsed())return!1;const t=e.anchor.getNode();if(!Ee(t)||t.getChildrenSize()!==0)return!1;const n=Yu(t),r=t.getParent();ge(r)||ir(40);const o=r.getParent();let i;if(dt(o))i=me(),n.insertAfter(i);else{if(!Ee(o))return!1;i=It(),o.insertAfter(i)}i.setTextStyle(e.style).setTextFormat(e.format).select();const s=t.getNextSiblings();if(s.length>0){const a=Mt(r.getListType());if(Ee(i)){const l=It();l.append(a),i.insertAfter(l)}else i.insertAfter(a);a.append(...s)}return(function(a){let l=a;for(;l.getNextSibling()==null&&l.getPreviousSibling()==null;){const c=l.getParent();if(c==null||!Ee(c)&&!ge(c))break;l=c}l.remove()})(t),!0}function Fa(...e){const t=[];for(const n of e)if(n&&typeof n=="string")for(const[r]of n.matchAll(/\S+/g))t.push(r);return t}let Er=class extends yt{__value;__checked;$config(){return this.config("listitem",{$transform:t=>{if(t.__checked==null)return;const n=t.getParent();ge(n)&&n.getListType()!=="check"&&t.getChecked()!=null&&t.setChecked(void 0)},extends:yt,importDOM:{li:()=>({conversion:rA,priority:0})}})}constructor(t=1,n=void 0,r){super(r),this.__value=t===void 0?1:t,this.__checked=n}afterCloneFrom(t){super.afterCloneFrom(t),this.__value=t.__value,this.__checked=t.__checked}createDOM(t){const n=document.createElement("li");return this.updateListItemDOM(null,n,t),n}updateListItemDOM(t,n,r){(function(s,a,l){const c=a.getParent();!ge(c)||c.getListType()!=="check"||ge(a.getFirstChild())?(s.removeAttribute("role"),s.removeAttribute("tabIndex"),s.removeAttribute("aria-checked")):(s.setAttribute("role","checkbox"),s.setAttribute("tabIndex","-1"),l&&a.__checked===l.__checked||s.setAttribute("aria-checked",a.getChecked()?"true":"false"))})(n,this,t),n.value=this.__value,(function(s,a,l){const c=[],u=[],f=a.list,d=f?f.listitem:void 0;let h;if(f&&f.nested&&(h=f.nested.listitem),d!==void 0&&c.push(...Fa(d)),f){const g=l.getParent(),p=ge(g)&&g.getListType()==="check",m=l.getChecked();p&&!m||u.push(f.listitemUnchecked),p&&m||u.push(f.listitemChecked),p&&c.push(m?f.listitemChecked:f.listitemUnchecked)}if(h!==void 0){const g=Fa(h);l.getChildren().some(p=>ge(p))?c.push(...g):u.push(...g)}u.length>0&&Rn(s,...u),c.length>0&&Ye(s,...c)})(n,r.theme,this);const o=t?t.__style:"",i=this.__style;o!==i&&(i===""?n.removeAttribute("style"):n.style.cssText=i),(function(s,a,l){const c=Up(a.__textStyle);for(const u in c)s.style.setProperty(`--listitem-marker-${u}`,c[u]);if(l)for(const u in Up(l.__textStyle))u in c||s.style.removeProperty(`--listitem-marker-${u}`)})(n,this,t)}updateDOM(t,n,r){const o=n;return this.updateListItemDOM(t,o,r),!1}updateFromJSON(t){return super.updateFromJSON(t).setValue(t.value).setChecked(t.checked)}exportDOM(t){const n=this.createDOM(t._config),r=this.getFormatType();r&&(n.style.textAlign=r);const o=this.getDirection();return o&&(n.dir=o),{element:n}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...t){for(let n=0;n<t.length;n++){const r=t[n];if(V(r)&&this.canMergeWith(r)){const o=r.getChildren();this.append(...o),r.remove()}else super.append(r)}return this}replace(t,n){if(Ee(t))return super.replace(t);this.setIndent(0);const r=this.getParentOrThrow();if(!ge(r))return t;if(r.__first===this.getKey())r.insertBefore(t);else if(r.__last===this.getKey())r.insertAfter(t);else{const o=Mt(r.getListType());let i=this.getNextSibling();for(;i;){const s=i;i=i.getNextSibling(),o.append(s)}r.insertAfter(t),t.insertAfter(o)}return n&&(V(t)||ir(139),this.getChildren().forEach(o=>{t.append(o)})),this.remove(),r.getChildrenSize()===0&&r.remove(),t}insertAfter(t,n=!0){const r=this.getParentOrThrow();if(ge(r)||ir(39),Ee(t))return super.insertAfter(t,n);const o=this.getNextSiblings();if(r.insertAfter(t,n),o.length!==0){const i=Mt(r.getListType());o.forEach(s=>i.append(s)),t.insertAfter(i,n)}return t}remove(t){const n=this.getPreviousSibling(),r=this.getNextSibling();super.remove(t),n&&r&&yn(n)&&yn(r)&&(Df(n.getFirstChild(),r.getFirstChild()),r.remove())}insertNewAfter(t,n=!0){const r=It().updateFromJSON(this.exportJSON()).setChecked(!this.getChecked()&&void 0);return this.insertAfter(r,n),r}collapseAtStart(t){const n=me();this.getChildren().forEach(s=>n.append(s));const r=this.getParentOrThrow(),o=r.getParentOrThrow(),i=Ee(o);if(r.getChildrenSize()===1)if(i)r.remove(),o.select();else{r.insertBefore(n),r.remove();const s=t.anchor,a=t.focus,l=n.getKey();s.type==="element"&&s.getNode().is(this)&&s.set(l,s.offset,"element"),a.type==="element"&&a.getNode().is(this)&&a.set(l,a.offset,"element")}else r.insertBefore(n),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(t){const n=this.getWritable();return n.__value=t,n}getChecked(){const t=this.getLatest();let n;const r=this.getParent();return ge(r)&&(n=r.getListType()),n==="check"?!!t.__checked:void 0}setChecked(t){const n=this.getWritable();return n.__checked=t,n}toggleChecked(){const t=this.getWritable();return t.setChecked(!t.__checked)}getIndent(){const t=this.getParent();if(t===null||!this.isAttached())return this.getLatest().__indent;let n=t.getParentOrThrow(),r=0;for(;Ee(n);)n=n.getParentOrThrow().getParentOrThrow(),r++;return r}setIndent(t){typeof t!="number"&&ir(117),(t=Math.floor(t))>=0||ir(199);let n=this.getIndent();for(;n!==t;)n<t?(eA(this),n++):(tA(this),n--);return this}canInsertAfter(t){return Ee(t)}canReplaceWith(t){return Ee(t)}canMergeWith(t){return Ee(t)||Sr(t)}extractWithChild(t,n){if(!W(n))return!1;const r=n.anchor.getNode(),o=n.focus.getNode();return this.isParentOf(r)&&this.isParentOf(o)&&this.getTextContent().length===n.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return Mt("bullet")}canMergeWhenEmpty(){return!0}};function rA(e){if(e.classList.contains("task-list-item")){for(const n of e.children)if(n.tagName==="INPUT")return im(n)}if(e.classList.contains("joplin-checkbox")){for(const n of e.children)if(n.classList.contains("checkbox-wrapper")&&n.children.length>0&&n.children[0].tagName==="INPUT")return im(n.children[0])}const t=e.getAttribute("aria-checked");return{node:It(t==="true"||t!=="false"&&void 0)}}function im(e){return e.getAttribute("type")!=="checkbox"?{node:null}:{node:It(e.hasAttribute("checked"))}}function It(e){return vt(new Er(void 0,e))}function Ee(e){return e instanceof Er}let uo=class extends yt{__tag;__start;__listType;$config(){return this.config("list",{$transform:t=>{(function(n){const r=n.getNextSibling();ge(r)&&n.getListType()===r.getListType()&&Df(n,r)})(t),Ox(t)},extends:yt,importDOM:{ol:()=>({conversion:am,priority:0}),ul:()=>({conversion:am,priority:0})}})}constructor(t="number",n=1,r){super(r);const o=iA[t]||t;this.__listType=o,this.__tag=o==="number"?"ol":"ul",this.__start=n}afterCloneFrom(t){super.afterCloneFrom(t),this.__listType=t.__listType,this.__tag=t.__tag,this.__start=t.__start}getTag(){return this.getLatest().__tag}setListType(t){const n=this.getWritable();return n.__listType=t,n.__tag=t==="number"?"ol":"ul",n}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(t){const n=this.getWritable();return n.__start=t,n}createDOM(t,n){const r=this.__tag,o=document.createElement(r);return this.__start!==1&&o.setAttribute("start",String(this.__start)),o.__lexicalListType=this.__listType,sm(o,t.theme,this),o}updateDOM(t,n,r){return t.__tag!==this.__tag||t.__listType!==this.__listType||(sm(n,r.theme,this),!1)}updateFromJSON(t){return super.updateFromJSON(t).setListType(t.listType).setStart(t.start)}exportDOM(t){const n=this.createDOM(t._config,t);return je(n)&&(this.__start!==1&&n.setAttribute("start",String(this.__start)),this.__listType==="check"&&n.setAttribute("__lexicalListType","check")),{element:n}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}splice(t,n,r){let o=r;for(let i=0;i<r.length;i++){const s=r[i];Ee(s)||(o===r&&(o=[...r]),o[i]=It().append(!V(s)||ge(s)||s.isInline()?s:Pe(s.getTextContent())))}return super.splice(t,n,o)}extractWithChild(t){return Ee(t)}};function sm(e,t,n){const r=[],o=[],i=t.list;if(i!==void 0){const s=i[`${n.__tag}Depth`]||[],a=qu(n)-1,l=a%s.length,c=s[l],u=i[n.__tag];let f;const d=i.nested,h=i.checklist;if(d!==void 0&&d.list&&(f=d.list),u!==void 0&&r.push(u),h!==void 0&&n.__listType==="check"&&r.push(h),c!==void 0){r.push(...Fa(c));for(let g=0;g<s.length;g++)g!==l&&o.push(n.__tag+g)}if(f!==void 0){const g=Fa(f);a>1?r.push(...g):o.push(...g)}}o.length>0&&Rn(e,...o),r.length>0&&Ye(e,...r)}function oA(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n];if(Ee(r)){t.push(r);const o=r.getChildren();o.length>1&&o.forEach(i=>{ge(i)&&t.push(nm(i))})}else t.push(nm(r))}return t}function am(e){const t=e.nodeName.toLowerCase();let n=null;return t==="ol"?n=Mt("number",e.start):t==="ul"&&(n=(function(r){if(r.getAttribute("__lexicallisttype")==="check"||r.classList.contains("contains-task-list")||r.getAttribute("data-is-checklist")==="1")return!0;for(const o of r.childNodes)if(je(o)&&o.hasAttribute("aria-checked"))return!0;return!1})(e)?Mt("check"):Mt("bullet")),{after:oA,node:n}}const iA={ol:"number",ul:"bullet"};function Mt(e="number",t=1){return vt(new uo(e,t))}function ge(e){return e instanceof uo}const sA=ie("UPDATE_LIST_START_COMMAND"),Ix=ie("INSERT_UNORDERED_LIST_COMMAND"),$x=ie("INSERT_ORDERED_LIST_COMMAND"),aA=ie("REMOVE_LIST_COMMAND");function lA(e){return ln(e.registerCommand($x,()=>(rm("number"),!0),jn),e.registerCommand(sA,t=>{const{listNodeKey:n,newStart:r}=t,o=Me(n);return!!ge(o)&&(o.getListType()==="number"&&(o.setStart(r),Ox(o)),!0)},jn),e.registerCommand(Ix,()=>(rm("bullet"),!0),jn),e.registerCommand(aA,()=>(Q3(),!0),jn),e.registerCommand(Yr,()=>nA(),jn),e.registerNodeTransform(Er,t=>{const n=t.getFirstChild();if(n){if(Y(n)){const r=n.getStyle(),o=n.getFormat();t.getTextStyle()!==r&&t.setTextStyle(r),t.getTextFormat()!==o&&t.setTextFormat(o)}}else{const r=G();W(r)&&(r.style!==t.getTextStyle()||r.format!==t.getTextFormat())&&r.isCollapsed()&&t.is(r.anchor.getNode())&&t.setTextStyle(r.style).setTextFormat(r.format)}}),e.registerNodeTransform(Gt,t=>{const n=t.getParent();if(Ee(n)&&t.is(n.getFirstChild())){const r=t.getStyle(),o=t.getFormat();r===n.getTextStyle()&&o===n.getTextFormat()||n.setTextStyle(r).setTextFormat(o)}}))}function cA(e){const t=n=>{const r=n.getParent();if(ge(n.getFirstChild())||!ge(r))return;const o=xe(n,i=>Ee(i)&&ge(i.getParent())&&Ee(i.getPreviousSibling()));if(o===null&&n.getIndent()>0)n.setIndent(0);else if(Ee(o)){const i=o.getPreviousSibling();if(Ee(i)){const s=(function(l){let c=l,u=c.getFirstChild();for(;ge(u);){const f=u.getLastChild();if(!Ee(f))break;c=f,u=c.getFirstChild()}return c})(i),a=s.getParent();if(ge(a)){const l=qu(a);l+1<qu(r)&&n.setIndent(l)}}}};return e.registerNodeTransform(uo,n=>{const r=[n];for(;r.length>0;){const o=r.shift();if(ge(o)){for(const i of o.getChildren())if(Ee(i)){t(i);const s=i.getFirstChild();ge(s)&&r.push(s)}}}})}function uA(e,t){const n=H_(t)?t.body.childNodes:t.childNodes;let r=[];const o=[];for(const i of n)if(!Vx.has(i.nodeName)){const s=jx(i,e,o,!1);s!==null&&(r=r.concat(s))}return(function(i){for(const s of i)s.getNextSibling()instanceof vf&&s.insertAfter(sn());for(const s of i){const a=s.getChildren();for(const l of a)s.insertBefore(l);s.remove()}})(o),r}function dA(e,t){if(typeof document>"u"||typeof window>"u"&&global.window===void 0)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const n=document.createElement("div"),r=Ke().getChildren();for(let o=0;o<r.length;o++)Dx(e,r[o],n,t);return n.innerHTML}function Dx(e,t,n,r=null){let o=r===null||t.isSelected(r);const i=V(t)&&t.excludeFromCopy("html");let s=t;r!==null&&Y(t)&&(s=fx(r,t,"clone"));const a=V(s)?s.getChildren():[],l=xf(e,s.getType());let c;c=l&&l.exportDOM!==void 0?l.exportDOM(e,s):s.exportDOM(e);const{element:u,after:f}=c;if(!u)return!1;const d=document.createDocumentFragment();for(let h=0;h<a.length;h++){const g=a[h],p=Dx(e,g,d,r);!o&&V(t)&&p&&t.extractWithChild(g,r,"html")&&(o=!0)}if(o&&!i){if((je(u)||Wu(u))&&u.append(d),n.append(u),f){const h=f.call(s,u);h&&(Wu(u)?u.replaceChildren(h):u.replaceWith(h))}}else n.append(d);return o}const Vx=new Set(["STYLE","SCRIPT"]);function jx(e,t,n,r,o=new Map,i){let s=[];if(Vx.has(e.nodeName))return s;let a=null;const l=(function(g,p){const{nodeName:m}=g,_=p._htmlConversions.get(m.toLowerCase());let y=null;if(_!==void 0)for(const v of _){const x=v(g);x!==null&&(y===null||(y.priority||0)<=(x.priority||0))&&(y=x)}return y!==null?y.conversion:null})(e,t),c=l?l(e):null;let u=null;if(c!==null){u=c.after;const g=c.node;if(a=Array.isArray(g)?g[g.length-1]:g,a!==null){for(const[,p]of o)if(a=p(a,i),!a)break;a&&s.push(...Array.isArray(g)?g:[a])}c.forChild!=null&&o.set(e.nodeName,c.forChild)}const f=e.childNodes;let d=[];const h=(a==null||!dt(a))&&(a!=null&&Du(a)||r);for(let g=0;g<f.length;g++)d.push(...jx(f[g],t,n,h,new Map(o),a));return u!=null&&(d=u(d)),Pa(e)&&(d=fA(e,d,h?()=>{const g=new vf;return n.push(g),g}:me)),a==null?d.length>0?s=s.concat(d):Pa(e)&&(function(g){return g.nextSibling==null||g.previousSibling==null?!1:Hu(g.nextSibling)&&Hu(g.previousSibling)})(e)&&(s=s.concat(sn())):V(a)&&a.append(...d),s}function fA(e,t,n){const r=e.style.textAlign,o=[];let i=[];for(let s=0;s<t.length;s++){const a=t[s];if(Du(a))r&&!a.getFormat()&&a.setFormat(r),o.push(a);else if(i.push(a),s===t.length-1||s<t.length-1&&Du(t[s+1])){const l=n();l.setFormat(r),l.append(...i),o.push(l),i=[]}}return o}function La(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function hA(e,t=G()){return t==null&&La(166),W(t)&&t.isCollapsed()||t.getNodes().length===0?"":dA(e,t)}function gA(e,t=G()){return t==null&&La(166),W(t)&&t.isCollapsed()||t.getNodes().length===0?null:JSON.stringify(pA(e,t))}function lm(e,t,n){const r=e.getData("application/x-lexical-editor");if(r)try{const a=JSON.parse(r);if(a.namespace===n._config.namespace&&Array.isArray(a.nodes))return cm(n,mA(a.nodes),t)}catch(a){console.error(a)}const o=e.getData("text/html"),i=e.getData("text/plain");if(o&&i!==o)try{const a=new DOMParser().parseFromString((function(l){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:c=>c}).createHTML(l):l})(o),"text/html");return cm(n,uA(n,a),t)}catch(a){console.error(a)}const s=i||e.getData("text/uri-list");if(s!=null)if(W(t)){const a=s.split(/(\r?\n|\t)/);a[a.length-1]===""&&a.pop();for(let l=0;l<a.length;l++){const c=G();if(W(c)){const u=a[l];u===`
|
|
21
21
|
`||u===`\r
|
|
22
|
-
`?c.insertParagraph():u===" "?c.insertNodes([ai()]):c.insertText(u)}}}else t.insertRawText(s)}function cm(e,t,n){e.dispatchCommand(rf,{nodes:t,selection:n})||(n.insertNodes(t),(function(r){if(W(r)&&r.isCollapsed()){const o=r.anchor;let i=null;const s=ln(o,"previous");if(s)if(En(s))i=s.origin;else{const a=mr(s,Ct(Ke(),"next").getFlipped());for(const l of a){if(Y(l.origin)){i=l.origin;break}if(V(l.origin)&&!l.origin.isInline())break}}if(i&&Y(i)){const a=i.getFormat(),l=i.getStyle();r.format===a&&r.style===l||(r.format=a,r.style=l,r.dirty=!0)}}})(n))}function Bx(e,t,n,r=[]){let o=t===null||n.isSelected(t);const i=V(n)&&n.excludeFromCopy("html");let s=n;t!==null&&Y(s)&&(s=fx(t,s,"clone"));const a=V(s)?s.getChildren():[],l=(function(c){const u=c.exportJSON(),f=c.constructor;if(u.type!==f.getType()&&La(58,f.name),V(c)){const d=u.children;Array.isArray(d)||La(59,f.name)}return u})(s);Y(s)&&s.getTextContentSize()===0&&(o=!1);for(let c=0;c<a.length;c++){const u=a[c],f=Bx(e,t,u,l.children);!o&&V(n)&&f&&n.extractWithChild(u,t,"clone")&&(o=!0)}if(o&&!i)r.push(l);else if(Array.isArray(l.children))for(let c=0;c<l.children.length;c++){const u=l.children[c];r.push(u)}return o}function pA(e,t){const n=[],r=Ke().getChildren();for(let o=0;o<r.length;o++)Bx(e,t,r[o],n);return{namespace:e._config.namespace,nodes:n}}function mA(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n],o=Xk(r);Y(o)&&A3(o),t.push(o)}return t}let yo=null;async function Xu(e,t,n){if(yo!==null)return!1;if(t!==null)return new Promise((c,u)=>{e.update(()=>{c(um(e,t,n))})});const r=e.getRootElement(),o=e._window||window,i=o.document,s=St(o);if(r===null||s===null)return!1;const a=i.createElement("span");a.style.cssText="position: fixed; top: -1000px;",a.append(i.createTextNode("#")),r.append(a);const l=new Range;return l.setStart(a,0),l.setEnd(a,1),s.removeAllRanges(),s.addRange(l),new Promise((c,u)=>{const f=e.registerCommand(el,d=>(or(d,ClipboardEvent)&&(f(),yo!==null&&(o.clearTimeout(yo),yo=null),c(um(e,d,n))),!0),Qk);yo=o.setTimeout(()=>{f(),yo=null,c(!1)},50),i.execCommand("copy"),a.remove()})}function um(e,t,n){if(n===void 0){const o=St(e._window),i=G();if(!i||i.isCollapsed()||!o)return!1;const s=o.anchorNode,a=o.focusNode;if(s!==null&&a!==null&&!ds(e,s,a))return!1;n=Wx(i)}t.preventDefault();const r=t.clipboardData;return r!==null&&(yA(r,n),!0)}const zx=[["text/html",hA],["application/x-lexical-editor",gA]];function Wx(e=G()){const t={"text/plain":e?e.getTextContent():""};if(e){const n=ui();for(const[r,o]of zx){const i=o(n,e);i!==null&&(t[r]=i)}}return t}function yA(e,t){for(const[n]of zx)t[n]===void 0&&e.setData(n,"");for(const n in t){const r=t[n];r!==void 0&&e.setData(n,r)}}function vA(e){const t=window.location.origin,n=r=>{if(r.origin!==t)return;const o=e.getRootElement();if(document.activeElement!==o)return;const i=r.data;if(typeof i=="string"){let s;try{s=JSON.parse(i)}catch{return}if(s&&s.protocol==="nuanria_messaging"&&s.type==="request"){const a=s.payload;if(a&&a.functionId==="makeChanges"){const l=a.args;if(l){const[c,u,f,d,h]=l;e.update(()=>{const g=G();if(W(g)){const p=g.anchor;let m=p.getNode(),_=0,y=0;if(Y(m)&&c>=0&&u>=0&&(_=c,y=c+u,g.setTextNodeRange(m,_,m,y)),_===y&&f===""||(g.insertRawText(f),m=p.getNode()),Y(m)){_=d,y=d+h;const v=m.getTextContentSize();_=_>v?v:_,y=y>v?v:y,g.setTextNodeRange(m,_,m,y)}r.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",n,!0),()=>{window.removeEventListener("message",n,!0)}}function dm(e,t){if(document.caretRangeFromPoint!==void 0){const n=document.caretRangeFromPoint(e,t);return n===null?null:{node:n.startContainer,offset:n.startOffset}}if(document.caretPositionFromPoint!=="undefined"){const n=document.caretPositionFromPoint(e,t);return n===null?null:{node:n.offsetNode,offset:n.offset}}return null}const fo=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,_A=fo&&"documentMode"in document?document.documentMode:null,xA=fo&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),bA=!(!fo||!("InputEvent"in window)||_A)&&"getTargetRanges"in new window.InputEvent("input"),CA=fo&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),fm=fo&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,wA=fo&&/^(?=.*Chrome).*/i.test(navigator.userAgent),SA=fo&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&xA&&!wA,hm=ie("DRAG_DROP_PASTE_FILE");let dl=class Hx extends yt{static getType(){return"quote"}static clone(t){return new Hx(t.__key)}createDOM(t){const n=document.createElement("blockquote");return Ye(n,t.theme.quote),n}updateDOM(t,n){return!1}static importDOM(){return{blockquote:t=>({conversion:EA,priority:0})}}exportDOM(t){const{element:n}=super.exportDOM(t);if(je(n)){this.isEmpty()&&n.append(document.createElement("br"));const r=this.getFormatType();r&&(n.style.textAlign=r);const o=this.getDirection();o&&(n.dir=o)}return{element:n}}static importJSON(t){return Vf().updateFromJSON(t)}insertNewAfter(t,n){const r=me(),o=this.getDirection();return r.setDirection(o),this.insertAfter(r,n),r}collapseAtStart(){const t=me();return this.getChildren().forEach(n=>t.append(n)),this.replace(t),!0}canMergeWhenEmpty(){return!0}};function Vf(){return vt(new dl)}function Ju(e){return e instanceof dl}let fl=class Kx extends yt{__tag;static getType(){return"heading"}static clone(t){return new Kx(t.__tag,t.__key)}constructor(t,n){super(n),this.__tag=t}getTag(){return this.__tag}setTag(t){const n=this.getWritable();return this.__tag=t,n}createDOM(t){const n=this.__tag,r=document.createElement(n),o=t.theme.heading;if(o!==void 0){const i=o[n];Ye(r,i)}return r}updateDOM(t,n,r){return t.__tag!==this.__tag}static importDOM(){return{h1:t=>({conversion:vo,priority:0}),h2:t=>({conversion:vo,priority:0}),h3:t=>({conversion:vo,priority:0}),h4:t=>({conversion:vo,priority:0}),h5:t=>({conversion:vo,priority:0}),h6:t=>({conversion:vo,priority:0}),p:t=>{const n=t.firstChild;return n!==null&&gm(n)?{conversion:()=>({node:null}),priority:3}:null},span:t=>gm(t)?{conversion:n=>({node:Vr("h1")}),priority:3}:null}}exportDOM(t){const{element:n}=super.exportDOM(t);if(je(n)){this.isEmpty()&&n.append(document.createElement("br"));const r=this.getFormatType();r&&(n.style.textAlign=r);const o=this.getDirection();o&&(n.dir=o)}return{element:n}}static importJSON(t){return Vr(t.tag).updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setTag(t.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(t,n=!0){const r=t?t.anchor.offset:0,o=this.getLastDescendant(),i=!o||t&&t.anchor.key===o.getKey()&&r===o.getTextContentSize()||!t?me():Vr(this.getTag()),s=this.getDirection();if(i.setDirection(s),this.insertAfter(i,n),r===0&&!this.isEmpty()&&t){const a=me();a.select(),this.replace(a,!0)}return i}collapseAtStart(){const t=this.isEmpty()?me():Vr(this.getTag());return this.getChildren().forEach(n=>t.append(n)),this.replace(t),!0}extractWithChild(){return!0}};function gm(e){return e.nodeName.toLowerCase()==="span"&&e.style.fontSize==="26pt"}function vo(e){const t=e.nodeName.toLowerCase();let n=null;return t!=="h1"&&t!=="h2"&&t!=="h3"&&t!=="h4"&&t!=="h5"&&t!=="h6"||(n=Vr(t),e.style!==null&&(kf(e,n),n.setFormat(e.style.textAlign))),{node:n}}function EA(e){const t=Vf();return e.style!==null&&(t.setFormat(e.style.textAlign),kf(e,t)),{node:t}}function Vr(e="h1"){return vt(new fl(e))}function Ux(e){return e instanceof fl}function Ds(e){let t=null;if(or(e,DragEvent)?t=e.dataTransfer:or(e,ClipboardEvent)&&(t=e.clipboardData),t===null)return[!1,[],!1];const n=t.types,r=n.includes("Files"),o=n.includes("text/html")||n.includes("text/plain");return[r,Array.from(t.files),o]}function pm(e){const t=G();if(!W(t))return!1;const n=new Set,r=t.getNodes();for(let o=0;o<r.length;o++){const i=r[o],s=i.getKey();if(n.has(s))continue;const a=xe(i,c=>V(c)&&!c.isInline());if(a===null)continue;const l=a.getKey();a.canIndent()&&!n.has(l)&&(n.add(l),e(a))}return n.size>0}function mm(e){const t=Ft(e);return Ce(t)}function hc(e){for(const t of["lowercase","uppercase","capitalize"])e.hasFormat(t)&&e.toggleFormat(t)}function TA(e){return cn(e.registerCommand(Za,t=>{const n=G();return!!gt(n)&&(n.clear(),!0)},_e),e.registerCommand(cr,t=>{const n=G();return W(n)?(n.deleteCharacter(t),!0):!!gt(n)&&(n.deleteNodes(),!0)},_e),e.registerCommand(Yo,t=>{const n=G();return!!W(n)&&(n.deleteWord(t),!0)},_e),e.registerCommand(Xr,t=>{const n=G();return!!W(n)&&(n.deleteLine(t),!0)},_e),e.registerCommand(Wr,t=>{const n=G();if(typeof t=="string")n!==null&&n.insertText(t);else{if(n===null)return!1;const r=t.dataTransfer;if(r!=null)lm(r,n,e);else if(W(n)){const o=t.data;return o&&n.insertText(o),!0}}return!0},_e),e.registerCommand(ku,()=>{const t=G();return!!W(t)&&(t.removeText(),!0)},_e),e.registerCommand(Rt,t=>{const n=G();return!!W(n)&&(n.formatText(t),!0)},_e),e.registerCommand($o,t=>{const n=G();if(!W(n)&&!gt(n))return!1;const r=n.getNodes();for(const o of r){const i=xe(o,s=>V(s)&&!s.isInline());i!==null&&i.setFormat(t)}return!0},_e),e.registerCommand(Io,t=>{const n=G();return!!W(n)&&(n.insertLineBreak(t),!0)},_e),e.registerCommand(Yr,()=>{const t=G();return!!W(t)&&(t.insertParagraph(),!0)},_e),e.registerCommand(Ck,()=>(pf([ai()]),!0),_e),e.registerCommand(wk,()=>pm(t=>{const n=t.getIndent();t.setIndent(n+1)}),_e),e.registerCommand(up,()=>pm(t=>{const n=t.getIndent();n>0&&t.setIndent(Math.max(0,n-1))}),_e),e.registerCommand(lf,t=>{const n=G();if(gt(n)){const r=n.getNodes();if(r.length>0)return t.preventDefault(),r[0].selectPrevious(),!0}else if(W(n)){const r=ju(n.focus,!0);if(!t.shiftKey&&Ce(r)&&!r.isIsolated()&&!r.isInline())return r.selectPrevious(),t.preventDefault(),!0}return!1},_e),e.registerCommand(cf,t=>{const n=G();if(gt(n)){const r=n.getNodes();if(r.length>0)return t.preventDefault(),r[0].selectNext(0,0),!0}else if(W(n)){if((function(o){const i=o.focus;return i.key==="root"&&i.offset===Ke().getChildrenSize()})(n))return t.preventDefault(),!0;const r=ju(n.focus,!1);if(!t.shiftKey&&Ce(r)&&!r.isIsolated()&&!r.isInline())return r.selectNext(),t.preventDefault(),!0}return!1},_e),e.registerCommand(af,t=>{const n=G();if(gt(n)){const r=n.getNodes();if(r.length>0)return t.preventDefault(),Gp(r[0])?r[0].selectNext(0,0):r[0].selectPrevious(),!0}if(!W(n))return!1;if(qp(n,!0)){const r=t.shiftKey;return t.preventDefault(),Yp(n,r,!0),!0}return!1},_e),e.registerCommand(sf,t=>{const n=G();if(gt(n)){const o=n.getNodes();if(o.length>0)return t.preventDefault(),Gp(o[0])?o[0].selectPrevious():o[0].selectNext(0,0),!0}if(!W(n))return!1;const r=t.shiftKey;return!!qp(n,!1)&&(t.preventDefault(),Yp(n,r,!1),!0)},_e),e.registerCommand(Qa,t=>{if(mm(t.target))return!1;const n=G();if(W(n)){if((function(r){if(!r.isCollapsed())return!1;const{anchor:o}=r;if(o.offset!==0)return!1;const i=o.getNode();if(tt(i))return!1;const s=L3(i);return s.getIndent()>0&&(s.is(i)||i.is(s.getFirstDescendant()))})(n))return t.preventDefault(),e.dispatchCommand(up,void 0);if(fm&&navigator.language==="ko-KR")return!1}else if(!gt(n))return!1;return t.preventDefault(),e.dispatchCommand(cr,!0)},_e),e.registerCommand(df,t=>{if(mm(t.target))return!1;const n=G();return!(!W(n)&&!gt(n))&&(t.preventDefault(),e.dispatchCommand(cr,!1))},_e),e.registerCommand(Sa,t=>{const n=G();if(!W(n))return!1;if(hc(n),t!==null){if((fm||CA||SA)&&bA)return!1;if(t.preventDefault(),t.shiftKey)return e.dispatchCommand(Io,!1)}return e.dispatchCommand(Yr,void 0)},_e),e.registerCommand(uf,()=>{const t=G();return!!W(t)&&(e.blur(),!0)},_e),e.registerCommand(g_,t=>{const[,n]=Ds(t);if(n.length>0){const o=dm(t.clientX,t.clientY);if(o!==null){const{offset:i,node:s}=o,a=Ft(s);if(a!==null){const l=ol();if(Y(a))l.anchor.set(a.getKey(),i,"text"),l.focus.set(a.getKey(),i,"text");else{const u=a.getParentOrThrow().getKey(),f=a.getIndexWithinParent()+1;l.anchor.set(u,f,"element"),l.focus.set(u,f,"element")}const c=qi(l);He(c)}e.dispatchCommand(hm,n)}return t.preventDefault(),!0}const r=G();return!!W(r)},_e),e.registerCommand(p_,t=>{const[n]=Ds(t),r=G();return!(n&&!W(r))},_e),e.registerCommand(m_,t=>{const[n]=Ds(t),r=G();if(n&&!W(r))return!1;const o=dm(t.clientX,t.clientY);if(o!==null){const i=Ft(o.node);Ce(i)&&t.preventDefault()}return!0},_e),e.registerCommand(Au,()=>(o3(),!0),_e),e.registerCommand(el,t=>(Xu(e,or(t,ClipboardEvent)?t:null),!0),_e),e.registerCommand(tl,t=>((async function(n,r){await Xu(r,or(n,ClipboardEvent)?n:null),r.update(()=>{const o=G();W(o)?o.removeText():gt(o)&&o.getNodes().forEach(i=>i.remove())})})(t,e),!0),_e),e.registerCommand(of,t=>{const[,n,r]=Ds(t);return n.length>0&&!r?(e.dispatchCommand(hm,n),!0):tn(t.target)&&bf(t.target)?!1:G()!==null&&((function(o,i){o.preventDefault(),i.update(()=>{const s=G(),a=or(o,InputEvent)||or(o,KeyboardEvent)?null:o.clipboardData;a!=null&&s!==null&&lm(a,s,i)},{tag:Lk})})(t,e),!0)},_e),e.registerCommand(h_,t=>{const n=G();return W(n)&&hc(n),!1},_e),e.registerCommand(ff,t=>{const n=G();return W(n)&&hc(n),!1},_e))}var gc={exports:{}},ym;function RA(){return ym||(ym=1,(function(e){var t=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};var n=(function(r){var o=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,i=0,s={},a={manual:r.Prism&&r.Prism.manual,disableWorkerMessageHandler:r.Prism&&r.Prism.disableWorkerMessageHandler,util:{encode:function y(v){return v instanceof l?new l(v.type,y(v.content),v.alias):Array.isArray(v)?v.map(y):v.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(y){return Object.prototype.toString.call(y).slice(8,-1)},objId:function(y){return y.__id||Object.defineProperty(y,"__id",{value:++i}),y.__id},clone:function y(v,x){x=x||{};var b,w;switch(a.util.type(v)){case"Object":if(w=a.util.objId(v),x[w])return x[w];b={},x[w]=b;for(var T in v)v.hasOwnProperty(T)&&(b[T]=y(v[T],x));return b;case"Array":return w=a.util.objId(v),x[w]?x[w]:(b=[],x[w]=b,v.forEach(function(E,R){b[R]=y(E,x)}),b);default:return v}},getLanguage:function(y){for(;y;){var v=o.exec(y.className);if(v)return v[1].toLowerCase();y=y.parentElement}return"none"},setLanguage:function(y,v){y.className=y.className.replace(RegExp(o,"gi"),""),y.classList.add("language-"+v)},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw new Error}catch(b){var y=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(b.stack)||[])[1];if(y){var v=document.getElementsByTagName("script");for(var x in v)if(v[x].src==y)return v[x]}return null}},isActive:function(y,v,x){for(var b="no-"+v;y;){var w=y.classList;if(w.contains(v))return!0;if(w.contains(b))return!1;y=y.parentElement}return!!x}},languages:{plain:s,plaintext:s,text:s,txt:s,extend:function(y,v){var x=a.util.clone(a.languages[y]);for(var b in v)x[b]=v[b];return x},insertBefore:function(y,v,x,b){b=b||a.languages;var w=b[y],T={};for(var E in w)if(w.hasOwnProperty(E)){if(E==v)for(var R in x)x.hasOwnProperty(R)&&(T[R]=x[R]);x.hasOwnProperty(E)||(T[E]=w[E])}var M=b[y];return b[y]=T,a.languages.DFS(a.languages,function(O,D){D===M&&O!=y&&(this[O]=T)}),T},DFS:function y(v,x,b,w){w=w||{};var T=a.util.objId;for(var E in v)if(v.hasOwnProperty(E)){x.call(v,E,v[E],b||E);var R=v[E],M=a.util.type(R);M==="Object"&&!w[T(R)]?(w[T(R)]=!0,y(R,x,null,w)):M==="Array"&&!w[T(R)]&&(w[T(R)]=!0,y(R,x,E,w))}}},plugins:{},highlightAll:function(y,v){a.highlightAllUnder(document,y,v)},highlightAllUnder:function(y,v,x){var b={callback:x,container:y,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};a.hooks.run("before-highlightall",b),b.elements=Array.prototype.slice.apply(b.container.querySelectorAll(b.selector)),a.hooks.run("before-all-elements-highlight",b);for(var w=0,T;T=b.elements[w++];)a.highlightElement(T,v===!0,b.callback)},highlightElement:function(y,v,x){var b=a.util.getLanguage(y),w=a.languages[b];a.util.setLanguage(y,b);var T=y.parentElement;T&&T.nodeName.toLowerCase()==="pre"&&a.util.setLanguage(T,b);var E=y.textContent,R={element:y,language:b,grammar:w,code:E};function M(D){R.highlightedCode=D,a.hooks.run("before-insert",R),R.element.innerHTML=R.highlightedCode,a.hooks.run("after-highlight",R),a.hooks.run("complete",R),x&&x.call(R.element)}if(a.hooks.run("before-sanity-check",R),T=R.element.parentElement,T&&T.nodeName.toLowerCase()==="pre"&&!T.hasAttribute("tabindex")&&T.setAttribute("tabindex","0"),!R.code){a.hooks.run("complete",R),x&&x.call(R.element);return}if(a.hooks.run("before-highlight",R),!R.grammar){M(a.util.encode(R.code));return}if(v&&r.Worker){var O=new Worker(a.filename);O.onmessage=function(D){M(D.data)},O.postMessage(JSON.stringify({language:R.language,code:R.code,immediateClose:!0}))}else M(a.highlight(R.code,R.grammar,R.language))},highlight:function(y,v,x){var b={code:y,grammar:v,language:x};if(a.hooks.run("before-tokenize",b),!b.grammar)throw new Error('The language "'+b.language+'" has no grammar.');return b.tokens=a.tokenize(b.code,b.grammar),a.hooks.run("after-tokenize",b),l.stringify(a.util.encode(b.tokens),b.language)},tokenize:function(y,v){var x=v.rest;if(x){for(var b in x)v[b]=x[b];delete v.rest}var w=new f;return d(w,w.head,y),u(y,w,v,w.head,0),g(w)},hooks:{all:{},add:function(y,v){var x=a.hooks.all;x[y]=x[y]||[],x[y].push(v)},run:function(y,v){var x=a.hooks.all[y];if(!(!x||!x.length))for(var b=0,w;w=x[b++];)w(v)}},Token:l};r.Prism=a;function l(y,v,x,b){this.type=y,this.content=v,this.alias=x,this.length=(b||"").length|0}l.stringify=function y(v,x){if(typeof v=="string")return v;if(Array.isArray(v)){var b="";return v.forEach(function(M){b+=y(M,x)}),b}var w={type:v.type,content:y(v.content,x),tag:"span",classes:["token",v.type],attributes:{},language:x},T=v.alias;T&&(Array.isArray(T)?Array.prototype.push.apply(w.classes,T):w.classes.push(T)),a.hooks.run("wrap",w);var E="";for(var R in w.attributes)E+=" "+R+'="'+(w.attributes[R]||"").replace(/"/g,""")+'"';return"<"+w.tag+' class="'+w.classes.join(" ")+'"'+E+">"+w.content+"</"+w.tag+">"};function c(y,v,x,b){y.lastIndex=v;var w=y.exec(x);if(w&&b&&w[1]){var T=w[1].length;w.index+=T,w[0]=w[0].slice(T)}return w}function u(y,v,x,b,w,T){for(var E in x)if(!(!x.hasOwnProperty(E)||!x[E])){var R=x[E];R=Array.isArray(R)?R:[R];for(var M=0;M<R.length;++M){if(T&&T.cause==E+","+M)return;var O=R[M],D=O.inside,I=!!O.lookbehind,L=!!O.greedy,B=O.alias;if(L&&!O.pattern.global){var K=O.pattern.toString().match(/[imsuy]*$/)[0];O.pattern=RegExp(O.pattern.source,K+"g")}for(var P=O.pattern||O,A=b.next,$=w;A!==v.tail&&!(T&&$>=T.reach);$+=A.value.length,A=A.next){var H=A.value;if(v.length>y.length)return;if(!(H instanceof l)){var Q=1,J;if(L){if(J=c(P,$,y,I),!J||J.index>=y.length)break;var he=J.index,X=J.index+J[0].length,se=$;for(se+=A.value.length;he>=se;)A=A.next,se+=A.value.length;if(se-=A.value.length,$=se,A.value instanceof l)continue;for(var re=A;re!==v.tail&&(se<X||typeof re.value=="string");re=re.next)Q++,se+=re.value.length;Q--,H=y.slice($,se),J.index-=$}else if(J=c(P,0,H,I),!J)continue;var he=J.index,we=J[0],te=H.slice(0,he),ye=H.slice(he+we.length),Se=$+H.length;T&&Se>T.reach&&(T.reach=Se);var $e=A.prev;te&&($e=d(v,$e,te),$+=te.length),h(v,$e,Q);var ee=new l(E,D?a.tokenize(we,D):we,B,we);if(A=d(v,$e,ee),ye&&d(v,A,ye),Q>1){var pe={cause:E+","+M,reach:Se};u(y,v,x,A.prev,$,pe),T&&pe.reach>T.reach&&(T.reach=pe.reach)}}}}}}function f(){var y={value:null,prev:null,next:null},v={value:null,prev:y,next:null};y.next=v,this.head=y,this.tail=v,this.length=0}function d(y,v,x){var b=v.next,w={value:x,prev:v,next:b};return v.next=w,b.prev=w,y.length++,w}function h(y,v,x){for(var b=v.next,w=0;w<x&&b!==y.tail;w++)b=b.next;v.next=b,b.prev=v,y.length-=w}function g(y){for(var v=[],x=y.head.next;x!==y.tail;)v.push(x.value),x=x.next;return v}if(!r.document)return r.addEventListener&&(a.disableWorkerMessageHandler||r.addEventListener("message",function(y){var v=JSON.parse(y.data),x=v.language,b=v.code,w=v.immediateClose;r.postMessage(a.highlight(b,a.languages[x],x)),w&&r.close()},!1)),a;var p=a.util.currentScript();p&&(a.filename=p.src,p.hasAttribute("data-manual")&&(a.manual=!0));function m(){a.manual||a.highlightAll()}if(!a.manual){var _=document.readyState;_==="loading"||_==="interactive"&&p&&p.defer?document.addEventListener("DOMContentLoaded",m):window.requestAnimationFrame?window.requestAnimationFrame(m):window.setTimeout(m,16)}return a})(t);e.exports&&(e.exports=n),typeof _n<"u"&&(_n.Prism=n),n.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},n.languages.markup.tag.inside["attr-value"].inside.entity=n.languages.markup.entity,n.languages.markup.doctype.inside["internal-subset"].inside=n.languages.markup,n.hooks.add("wrap",function(r){r.type==="entity"&&(r.attributes.title=r.content.replace(/&/,"&"))}),Object.defineProperty(n.languages.markup.tag,"addInlined",{value:function(o,i){var s={};s["language-"+i]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:n.languages[i]},s.cdata=/^<!\[CDATA\[|\]\]>$/i;var a={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:s}};a["language-"+i]={pattern:/[\s\S]+/,inside:n.languages[i]};var l={};l[o]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return o}),"i"),lookbehind:!0,greedy:!0,inside:a},n.languages.insertBefore("markup","cdata",l)}}),Object.defineProperty(n.languages.markup.tag,"addAttribute",{value:function(r,o){n.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+r+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[o,"language-"+o],inside:n.languages[o]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),n.languages.html=n.languages.markup,n.languages.mathml=n.languages.markup,n.languages.svg=n.languages.markup,n.languages.xml=n.languages.extend("markup",{}),n.languages.ssml=n.languages.xml,n.languages.atom=n.languages.xml,n.languages.rss=n.languages.xml,(function(r){var o=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;r.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+o.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+o.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+o.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+o.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:o,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},r.languages.css.atrule.inside.rest=r.languages.css;var i=r.languages.markup;i&&(i.tag.addInlined("style","css"),i.tag.addAttribute("style","css"))})(n),n.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},n.languages.javascript=n.languages.extend("clike",{"class-name":[n.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),n.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,n.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:n.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:n.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:n.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:n.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:n.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),n.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:n.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),n.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),n.languages.markup&&(n.languages.markup.tag.addInlined("script","javascript"),n.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),n.languages.js=n.languages.javascript,(function(){if(typeof n>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var r="Loading…",o=function(p,m){return"✖ Error "+p+" while fetching file: "+m},i="✖ Error: File does not exist or is empty",s={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},a="data-src-status",l="loading",c="loaded",u="failed",f="pre[data-src]:not(["+a+'="'+c+'"]):not(['+a+'="'+l+'"])';function d(p,m,_){var y=new XMLHttpRequest;y.open("GET",p,!0),y.onreadystatechange=function(){y.readyState==4&&(y.status<400&&y.responseText?m(y.responseText):y.status>=400?_(o(y.status,y.statusText)):_(i))},y.send(null)}function h(p){var m=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(p||"");if(m){var _=Number(m[1]),y=m[2],v=m[3];return y?v?[_,Number(v)]:[_,void 0]:[_,_]}}n.hooks.add("before-highlightall",function(p){p.selector+=", "+f}),n.hooks.add("before-sanity-check",function(p){var m=p.element;if(m.matches(f)){p.code="",m.setAttribute(a,l);var _=m.appendChild(document.createElement("CODE"));_.textContent=r;var y=m.getAttribute("data-src"),v=p.language;if(v==="none"){var x=(/\.(\w+)$/.exec(y)||[,"none"])[1];v=s[x]||x}n.util.setLanguage(_,v),n.util.setLanguage(m,v);var b=n.plugins.autoloader;b&&b.loadLanguages(v),d(y,function(w){m.setAttribute(a,c);var T=h(m.getAttribute("data-range"));if(T){var E=w.split(/\r\n?|\n/g),R=T[0],M=T[1]==null?E.length:T[1];R<0&&(R+=E.length),R=Math.max(0,Math.min(R-1,E.length)),M<0&&(M+=E.length),M=Math.max(0,Math.min(M,E.length)),w=E.slice(R,M).join(`
|
|
22
|
+
`?c.insertParagraph():u===" "?c.insertNodes([ai()]):c.insertText(u)}}}else t.insertRawText(s)}function cm(e,t,n){e.dispatchCommand(rf,{nodes:t,selection:n})||(n.insertNodes(t),(function(r){if(W(r)&&r.isCollapsed()){const o=r.anchor;let i=null;const s=an(o,"previous");if(s)if(En(s))i=s.origin;else{const a=mr(s,Ct(Ke(),"next").getFlipped());for(const l of a){if(Y(l.origin)){i=l.origin;break}if(V(l.origin)&&!l.origin.isInline())break}}if(i&&Y(i)){const a=i.getFormat(),l=i.getStyle();r.format===a&&r.style===l||(r.format=a,r.style=l,r.dirty=!0)}}})(n))}function Bx(e,t,n,r=[]){let o=t===null||n.isSelected(t);const i=V(n)&&n.excludeFromCopy("html");let s=n;t!==null&&Y(s)&&(s=fx(t,s,"clone"));const a=V(s)?s.getChildren():[],l=(function(c){const u=c.exportJSON(),f=c.constructor;if(u.type!==f.getType()&&La(58,f.name),V(c)){const d=u.children;Array.isArray(d)||La(59,f.name)}return u})(s);Y(s)&&s.getTextContentSize()===0&&(o=!1);for(let c=0;c<a.length;c++){const u=a[c],f=Bx(e,t,u,l.children);!o&&V(n)&&f&&n.extractWithChild(u,t,"clone")&&(o=!0)}if(o&&!i)r.push(l);else if(Array.isArray(l.children))for(let c=0;c<l.children.length;c++){const u=l.children[c];r.push(u)}return o}function pA(e,t){const n=[],r=Ke().getChildren();for(let o=0;o<r.length;o++)Bx(e,t,r[o],n);return{namespace:e._config.namespace,nodes:n}}function mA(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n],o=Xk(r);Y(o)&&A3(o),t.push(o)}return t}let yo=null;async function Xu(e,t,n){if(yo!==null)return!1;if(t!==null)return new Promise((c,u)=>{e.update(()=>{c(um(e,t,n))})});const r=e.getRootElement(),o=e._window||window,i=o.document,s=St(o);if(r===null||s===null)return!1;const a=i.createElement("span");a.style.cssText="position: fixed; top: -1000px;",a.append(i.createTextNode("#")),r.append(a);const l=new Range;return l.setStart(a,0),l.setEnd(a,1),s.removeAllRanges(),s.addRange(l),new Promise((c,u)=>{const f=e.registerCommand(el,d=>(or(d,ClipboardEvent)&&(f(),yo!==null&&(o.clearTimeout(yo),yo=null),c(um(e,d,n))),!0),Qk);yo=o.setTimeout(()=>{f(),yo=null,c(!1)},50),i.execCommand("copy"),a.remove()})}function um(e,t,n){if(n===void 0){const o=St(e._window),i=G();if(!i||i.isCollapsed()||!o)return!1;const s=o.anchorNode,a=o.focusNode;if(s!==null&&a!==null&&!ds(e,s,a))return!1;n=Wx(i)}t.preventDefault();const r=t.clipboardData;return r!==null&&(yA(r,n),!0)}const zx=[["text/html",hA],["application/x-lexical-editor",gA]];function Wx(e=G()){const t={"text/plain":e?e.getTextContent():""};if(e){const n=ui();for(const[r,o]of zx){const i=o(n,e);i!==null&&(t[r]=i)}}return t}function yA(e,t){for(const[n]of zx)t[n]===void 0&&e.setData(n,"");for(const n in t){const r=t[n];r!==void 0&&e.setData(n,r)}}function vA(e){const t=window.location.origin,n=r=>{if(r.origin!==t)return;const o=e.getRootElement();if(document.activeElement!==o)return;const i=r.data;if(typeof i=="string"){let s;try{s=JSON.parse(i)}catch{return}if(s&&s.protocol==="nuanria_messaging"&&s.type==="request"){const a=s.payload;if(a&&a.functionId==="makeChanges"){const l=a.args;if(l){const[c,u,f,d,h]=l;e.update(()=>{const g=G();if(W(g)){const p=g.anchor;let m=p.getNode(),_=0,y=0;if(Y(m)&&c>=0&&u>=0&&(_=c,y=c+u,g.setTextNodeRange(m,_,m,y)),_===y&&f===""||(g.insertRawText(f),m=p.getNode()),Y(m)){_=d,y=d+h;const v=m.getTextContentSize();_=_>v?v:_,y=y>v?v:y,g.setTextNodeRange(m,_,m,y)}r.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",n,!0),()=>{window.removeEventListener("message",n,!0)}}function dm(e,t){if(document.caretRangeFromPoint!==void 0){const n=document.caretRangeFromPoint(e,t);return n===null?null:{node:n.startContainer,offset:n.startOffset}}if(document.caretPositionFromPoint!=="undefined"){const n=document.caretPositionFromPoint(e,t);return n===null?null:{node:n.offsetNode,offset:n.offset}}return null}const fo=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,_A=fo&&"documentMode"in document?document.documentMode:null,xA=fo&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),bA=!(!fo||!("InputEvent"in window)||_A)&&"getTargetRanges"in new window.InputEvent("input"),CA=fo&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),fm=fo&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,wA=fo&&/^(?=.*Chrome).*/i.test(navigator.userAgent),SA=fo&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&xA&&!wA,hm=ie("DRAG_DROP_PASTE_FILE");let dl=class Hx extends yt{static getType(){return"quote"}static clone(t){return new Hx(t.__key)}createDOM(t){const n=document.createElement("blockquote");return Ye(n,t.theme.quote),n}updateDOM(t,n){return!1}static importDOM(){return{blockquote:t=>({conversion:EA,priority:0})}}exportDOM(t){const{element:n}=super.exportDOM(t);if(je(n)){this.isEmpty()&&n.append(document.createElement("br"));const r=this.getFormatType();r&&(n.style.textAlign=r);const o=this.getDirection();o&&(n.dir=o)}return{element:n}}static importJSON(t){return Vf().updateFromJSON(t)}insertNewAfter(t,n){const r=me(),o=this.getDirection();return r.setDirection(o),this.insertAfter(r,n),r}collapseAtStart(){const t=me();return this.getChildren().forEach(n=>t.append(n)),this.replace(t),!0}canMergeWhenEmpty(){return!0}};function Vf(){return vt(new dl)}function Ju(e){return e instanceof dl}let fl=class Kx extends yt{__tag;static getType(){return"heading"}static clone(t){return new Kx(t.__tag,t.__key)}constructor(t,n){super(n),this.__tag=t}getTag(){return this.__tag}setTag(t){const n=this.getWritable();return this.__tag=t,n}createDOM(t){const n=this.__tag,r=document.createElement(n),o=t.theme.heading;if(o!==void 0){const i=o[n];Ye(r,i)}return r}updateDOM(t,n,r){return t.__tag!==this.__tag}static importDOM(){return{h1:t=>({conversion:vo,priority:0}),h2:t=>({conversion:vo,priority:0}),h3:t=>({conversion:vo,priority:0}),h4:t=>({conversion:vo,priority:0}),h5:t=>({conversion:vo,priority:0}),h6:t=>({conversion:vo,priority:0}),p:t=>{const n=t.firstChild;return n!==null&&gm(n)?{conversion:()=>({node:null}),priority:3}:null},span:t=>gm(t)?{conversion:n=>({node:Vr("h1")}),priority:3}:null}}exportDOM(t){const{element:n}=super.exportDOM(t);if(je(n)){this.isEmpty()&&n.append(document.createElement("br"));const r=this.getFormatType();r&&(n.style.textAlign=r);const o=this.getDirection();o&&(n.dir=o)}return{element:n}}static importJSON(t){return Vr(t.tag).updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setTag(t.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(t,n=!0){const r=t?t.anchor.offset:0,o=this.getLastDescendant(),i=!o||t&&t.anchor.key===o.getKey()&&r===o.getTextContentSize()||!t?me():Vr(this.getTag()),s=this.getDirection();if(i.setDirection(s),this.insertAfter(i,n),r===0&&!this.isEmpty()&&t){const a=me();a.select(),this.replace(a,!0)}return i}collapseAtStart(){const t=this.isEmpty()?me():Vr(this.getTag());return this.getChildren().forEach(n=>t.append(n)),this.replace(t),!0}extractWithChild(){return!0}};function gm(e){return e.nodeName.toLowerCase()==="span"&&e.style.fontSize==="26pt"}function vo(e){const t=e.nodeName.toLowerCase();let n=null;return t!=="h1"&&t!=="h2"&&t!=="h3"&&t!=="h4"&&t!=="h5"&&t!=="h6"||(n=Vr(t),e.style!==null&&(kf(e,n),n.setFormat(e.style.textAlign))),{node:n}}function EA(e){const t=Vf();return e.style!==null&&(t.setFormat(e.style.textAlign),kf(e,t)),{node:t}}function Vr(e="h1"){return vt(new fl(e))}function Ux(e){return e instanceof fl}function Ds(e){let t=null;if(or(e,DragEvent)?t=e.dataTransfer:or(e,ClipboardEvent)&&(t=e.clipboardData),t===null)return[!1,[],!1];const n=t.types,r=n.includes("Files"),o=n.includes("text/html")||n.includes("text/plain");return[r,Array.from(t.files),o]}function pm(e){const t=G();if(!W(t))return!1;const n=new Set,r=t.getNodes();for(let o=0;o<r.length;o++){const i=r[o],s=i.getKey();if(n.has(s))continue;const a=xe(i,c=>V(c)&&!c.isInline());if(a===null)continue;const l=a.getKey();a.canIndent()&&!n.has(l)&&(n.add(l),e(a))}return n.size>0}function mm(e){const t=Ft(e);return Ce(t)}function hc(e){for(const t of["lowercase","uppercase","capitalize"])e.hasFormat(t)&&e.toggleFormat(t)}function TA(e){return ln(e.registerCommand(Za,t=>{const n=G();return!!gt(n)&&(n.clear(),!0)},_e),e.registerCommand(cr,t=>{const n=G();return W(n)?(n.deleteCharacter(t),!0):!!gt(n)&&(n.deleteNodes(),!0)},_e),e.registerCommand(Yo,t=>{const n=G();return!!W(n)&&(n.deleteWord(t),!0)},_e),e.registerCommand(Xr,t=>{const n=G();return!!W(n)&&(n.deleteLine(t),!0)},_e),e.registerCommand(Wr,t=>{const n=G();if(typeof t=="string")n!==null&&n.insertText(t);else{if(n===null)return!1;const r=t.dataTransfer;if(r!=null)lm(r,n,e);else if(W(n)){const o=t.data;return o&&n.insertText(o),!0}}return!0},_e),e.registerCommand(ku,()=>{const t=G();return!!W(t)&&(t.removeText(),!0)},_e),e.registerCommand(Rt,t=>{const n=G();return!!W(n)&&(n.formatText(t),!0)},_e),e.registerCommand($o,t=>{const n=G();if(!W(n)&&!gt(n))return!1;const r=n.getNodes();for(const o of r){const i=xe(o,s=>V(s)&&!s.isInline());i!==null&&i.setFormat(t)}return!0},_e),e.registerCommand(Io,t=>{const n=G();return!!W(n)&&(n.insertLineBreak(t),!0)},_e),e.registerCommand(Yr,()=>{const t=G();return!!W(t)&&(t.insertParagraph(),!0)},_e),e.registerCommand(Ck,()=>(pf([ai()]),!0),_e),e.registerCommand(wk,()=>pm(t=>{const n=t.getIndent();t.setIndent(n+1)}),_e),e.registerCommand(up,()=>pm(t=>{const n=t.getIndent();n>0&&t.setIndent(Math.max(0,n-1))}),_e),e.registerCommand(lf,t=>{const n=G();if(gt(n)){const r=n.getNodes();if(r.length>0)return t.preventDefault(),r[0].selectPrevious(),!0}else if(W(n)){const r=ju(n.focus,!0);if(!t.shiftKey&&Ce(r)&&!r.isIsolated()&&!r.isInline())return r.selectPrevious(),t.preventDefault(),!0}return!1},_e),e.registerCommand(cf,t=>{const n=G();if(gt(n)){const r=n.getNodes();if(r.length>0)return t.preventDefault(),r[0].selectNext(0,0),!0}else if(W(n)){if((function(o){const i=o.focus;return i.key==="root"&&i.offset===Ke().getChildrenSize()})(n))return t.preventDefault(),!0;const r=ju(n.focus,!1);if(!t.shiftKey&&Ce(r)&&!r.isIsolated()&&!r.isInline())return r.selectNext(),t.preventDefault(),!0}return!1},_e),e.registerCommand(af,t=>{const n=G();if(gt(n)){const r=n.getNodes();if(r.length>0)return t.preventDefault(),Gp(r[0])?r[0].selectNext(0,0):r[0].selectPrevious(),!0}if(!W(n))return!1;if(qp(n,!0)){const r=t.shiftKey;return t.preventDefault(),Yp(n,r,!0),!0}return!1},_e),e.registerCommand(sf,t=>{const n=G();if(gt(n)){const o=n.getNodes();if(o.length>0)return t.preventDefault(),Gp(o[0])?o[0].selectPrevious():o[0].selectNext(0,0),!0}if(!W(n))return!1;const r=t.shiftKey;return!!qp(n,!1)&&(t.preventDefault(),Yp(n,r,!1),!0)},_e),e.registerCommand(Qa,t=>{if(mm(t.target))return!1;const n=G();if(W(n)){if((function(r){if(!r.isCollapsed())return!1;const{anchor:o}=r;if(o.offset!==0)return!1;const i=o.getNode();if(tt(i))return!1;const s=L3(i);return s.getIndent()>0&&(s.is(i)||i.is(s.getFirstDescendant()))})(n))return t.preventDefault(),e.dispatchCommand(up,void 0);if(fm&&navigator.language==="ko-KR")return!1}else if(!gt(n))return!1;return t.preventDefault(),e.dispatchCommand(cr,!0)},_e),e.registerCommand(df,t=>{if(mm(t.target))return!1;const n=G();return!(!W(n)&&!gt(n))&&(t.preventDefault(),e.dispatchCommand(cr,!1))},_e),e.registerCommand(Sa,t=>{const n=G();if(!W(n))return!1;if(hc(n),t!==null){if((fm||CA||SA)&&bA)return!1;if(t.preventDefault(),t.shiftKey)return e.dispatchCommand(Io,!1)}return e.dispatchCommand(Yr,void 0)},_e),e.registerCommand(uf,()=>{const t=G();return!!W(t)&&(e.blur(),!0)},_e),e.registerCommand(g_,t=>{const[,n]=Ds(t);if(n.length>0){const o=dm(t.clientX,t.clientY);if(o!==null){const{offset:i,node:s}=o,a=Ft(s);if(a!==null){const l=ol();if(Y(a))l.anchor.set(a.getKey(),i,"text"),l.focus.set(a.getKey(),i,"text");else{const u=a.getParentOrThrow().getKey(),f=a.getIndexWithinParent()+1;l.anchor.set(u,f,"element"),l.focus.set(u,f,"element")}const c=qi(l);He(c)}e.dispatchCommand(hm,n)}return t.preventDefault(),!0}const r=G();return!!W(r)},_e),e.registerCommand(p_,t=>{const[n]=Ds(t),r=G();return!(n&&!W(r))},_e),e.registerCommand(m_,t=>{const[n]=Ds(t),r=G();if(n&&!W(r))return!1;const o=dm(t.clientX,t.clientY);if(o!==null){const i=Ft(o.node);Ce(i)&&t.preventDefault()}return!0},_e),e.registerCommand(Au,()=>(o3(),!0),_e),e.registerCommand(el,t=>(Xu(e,or(t,ClipboardEvent)?t:null),!0),_e),e.registerCommand(tl,t=>((async function(n,r){await Xu(r,or(n,ClipboardEvent)?n:null),r.update(()=>{const o=G();W(o)?o.removeText():gt(o)&&o.getNodes().forEach(i=>i.remove())})})(t,e),!0),_e),e.registerCommand(of,t=>{const[,n,r]=Ds(t);return n.length>0&&!r?(e.dispatchCommand(hm,n),!0):en(t.target)&&bf(t.target)?!1:G()!==null&&((function(o,i){o.preventDefault(),i.update(()=>{const s=G(),a=or(o,InputEvent)||or(o,KeyboardEvent)?null:o.clipboardData;a!=null&&s!==null&&lm(a,s,i)},{tag:Lk})})(t,e),!0)},_e),e.registerCommand(h_,t=>{const n=G();return W(n)&&hc(n),!1},_e),e.registerCommand(ff,t=>{const n=G();return W(n)&&hc(n),!1},_e))}var gc={exports:{}},ym;function RA(){return ym||(ym=1,(function(e){var t=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};var n=(function(r){var o=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,i=0,s={},a={manual:r.Prism&&r.Prism.manual,disableWorkerMessageHandler:r.Prism&&r.Prism.disableWorkerMessageHandler,util:{encode:function y(v){return v instanceof l?new l(v.type,y(v.content),v.alias):Array.isArray(v)?v.map(y):v.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(y){return Object.prototype.toString.call(y).slice(8,-1)},objId:function(y){return y.__id||Object.defineProperty(y,"__id",{value:++i}),y.__id},clone:function y(v,x){x=x||{};var b,w;switch(a.util.type(v)){case"Object":if(w=a.util.objId(v),x[w])return x[w];b={},x[w]=b;for(var T in v)v.hasOwnProperty(T)&&(b[T]=y(v[T],x));return b;case"Array":return w=a.util.objId(v),x[w]?x[w]:(b=[],x[w]=b,v.forEach(function(E,R){b[R]=y(E,x)}),b);default:return v}},getLanguage:function(y){for(;y;){var v=o.exec(y.className);if(v)return v[1].toLowerCase();y=y.parentElement}return"none"},setLanguage:function(y,v){y.className=y.className.replace(RegExp(o,"gi"),""),y.classList.add("language-"+v)},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw new Error}catch(b){var y=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(b.stack)||[])[1];if(y){var v=document.getElementsByTagName("script");for(var x in v)if(v[x].src==y)return v[x]}return null}},isActive:function(y,v,x){for(var b="no-"+v;y;){var w=y.classList;if(w.contains(v))return!0;if(w.contains(b))return!1;y=y.parentElement}return!!x}},languages:{plain:s,plaintext:s,text:s,txt:s,extend:function(y,v){var x=a.util.clone(a.languages[y]);for(var b in v)x[b]=v[b];return x},insertBefore:function(y,v,x,b){b=b||a.languages;var w=b[y],T={};for(var E in w)if(w.hasOwnProperty(E)){if(E==v)for(var R in x)x.hasOwnProperty(R)&&(T[R]=x[R]);x.hasOwnProperty(E)||(T[E]=w[E])}var M=b[y];return b[y]=T,a.languages.DFS(a.languages,function(O,D){D===M&&O!=y&&(this[O]=T)}),T},DFS:function y(v,x,b,w){w=w||{};var T=a.util.objId;for(var E in v)if(v.hasOwnProperty(E)){x.call(v,E,v[E],b||E);var R=v[E],M=a.util.type(R);M==="Object"&&!w[T(R)]?(w[T(R)]=!0,y(R,x,null,w)):M==="Array"&&!w[T(R)]&&(w[T(R)]=!0,y(R,x,E,w))}}},plugins:{},highlightAll:function(y,v){a.highlightAllUnder(document,y,v)},highlightAllUnder:function(y,v,x){var b={callback:x,container:y,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};a.hooks.run("before-highlightall",b),b.elements=Array.prototype.slice.apply(b.container.querySelectorAll(b.selector)),a.hooks.run("before-all-elements-highlight",b);for(var w=0,T;T=b.elements[w++];)a.highlightElement(T,v===!0,b.callback)},highlightElement:function(y,v,x){var b=a.util.getLanguage(y),w=a.languages[b];a.util.setLanguage(y,b);var T=y.parentElement;T&&T.nodeName.toLowerCase()==="pre"&&a.util.setLanguage(T,b);var E=y.textContent,R={element:y,language:b,grammar:w,code:E};function M(D){R.highlightedCode=D,a.hooks.run("before-insert",R),R.element.innerHTML=R.highlightedCode,a.hooks.run("after-highlight",R),a.hooks.run("complete",R),x&&x.call(R.element)}if(a.hooks.run("before-sanity-check",R),T=R.element.parentElement,T&&T.nodeName.toLowerCase()==="pre"&&!T.hasAttribute("tabindex")&&T.setAttribute("tabindex","0"),!R.code){a.hooks.run("complete",R),x&&x.call(R.element);return}if(a.hooks.run("before-highlight",R),!R.grammar){M(a.util.encode(R.code));return}if(v&&r.Worker){var O=new Worker(a.filename);O.onmessage=function(D){M(D.data)},O.postMessage(JSON.stringify({language:R.language,code:R.code,immediateClose:!0}))}else M(a.highlight(R.code,R.grammar,R.language))},highlight:function(y,v,x){var b={code:y,grammar:v,language:x};if(a.hooks.run("before-tokenize",b),!b.grammar)throw new Error('The language "'+b.language+'" has no grammar.');return b.tokens=a.tokenize(b.code,b.grammar),a.hooks.run("after-tokenize",b),l.stringify(a.util.encode(b.tokens),b.language)},tokenize:function(y,v){var x=v.rest;if(x){for(var b in x)v[b]=x[b];delete v.rest}var w=new f;return d(w,w.head,y),u(y,w,v,w.head,0),g(w)},hooks:{all:{},add:function(y,v){var x=a.hooks.all;x[y]=x[y]||[],x[y].push(v)},run:function(y,v){var x=a.hooks.all[y];if(!(!x||!x.length))for(var b=0,w;w=x[b++];)w(v)}},Token:l};r.Prism=a;function l(y,v,x,b){this.type=y,this.content=v,this.alias=x,this.length=(b||"").length|0}l.stringify=function y(v,x){if(typeof v=="string")return v;if(Array.isArray(v)){var b="";return v.forEach(function(M){b+=y(M,x)}),b}var w={type:v.type,content:y(v.content,x),tag:"span",classes:["token",v.type],attributes:{},language:x},T=v.alias;T&&(Array.isArray(T)?Array.prototype.push.apply(w.classes,T):w.classes.push(T)),a.hooks.run("wrap",w);var E="";for(var R in w.attributes)E+=" "+R+'="'+(w.attributes[R]||"").replace(/"/g,""")+'"';return"<"+w.tag+' class="'+w.classes.join(" ")+'"'+E+">"+w.content+"</"+w.tag+">"};function c(y,v,x,b){y.lastIndex=v;var w=y.exec(x);if(w&&b&&w[1]){var T=w[1].length;w.index+=T,w[0]=w[0].slice(T)}return w}function u(y,v,x,b,w,T){for(var E in x)if(!(!x.hasOwnProperty(E)||!x[E])){var R=x[E];R=Array.isArray(R)?R:[R];for(var M=0;M<R.length;++M){if(T&&T.cause==E+","+M)return;var O=R[M],D=O.inside,I=!!O.lookbehind,L=!!O.greedy,B=O.alias;if(L&&!O.pattern.global){var K=O.pattern.toString().match(/[imsuy]*$/)[0];O.pattern=RegExp(O.pattern.source,K+"g")}for(var P=O.pattern||O,A=b.next,$=w;A!==v.tail&&!(T&&$>=T.reach);$+=A.value.length,A=A.next){var H=A.value;if(v.length>y.length)return;if(!(H instanceof l)){var Q=1,J;if(L){if(J=c(P,$,y,I),!J||J.index>=y.length)break;var he=J.index,X=J.index+J[0].length,se=$;for(se+=A.value.length;he>=se;)A=A.next,se+=A.value.length;if(se-=A.value.length,$=se,A.value instanceof l)continue;for(var re=A;re!==v.tail&&(se<X||typeof re.value=="string");re=re.next)Q++,se+=re.value.length;Q--,H=y.slice($,se),J.index-=$}else if(J=c(P,0,H,I),!J)continue;var he=J.index,we=J[0],te=H.slice(0,he),ye=H.slice(he+we.length),Se=$+H.length;T&&Se>T.reach&&(T.reach=Se);var $e=A.prev;te&&($e=d(v,$e,te),$+=te.length),h(v,$e,Q);var ee=new l(E,D?a.tokenize(we,D):we,B,we);if(A=d(v,$e,ee),ye&&d(v,A,ye),Q>1){var pe={cause:E+","+M,reach:Se};u(y,v,x,A.prev,$,pe),T&&pe.reach>T.reach&&(T.reach=pe.reach)}}}}}}function f(){var y={value:null,prev:null,next:null},v={value:null,prev:y,next:null};y.next=v,this.head=y,this.tail=v,this.length=0}function d(y,v,x){var b=v.next,w={value:x,prev:v,next:b};return v.next=w,b.prev=w,y.length++,w}function h(y,v,x){for(var b=v.next,w=0;w<x&&b!==y.tail;w++)b=b.next;v.next=b,b.prev=v,y.length-=w}function g(y){for(var v=[],x=y.head.next;x!==y.tail;)v.push(x.value),x=x.next;return v}if(!r.document)return r.addEventListener&&(a.disableWorkerMessageHandler||r.addEventListener("message",function(y){var v=JSON.parse(y.data),x=v.language,b=v.code,w=v.immediateClose;r.postMessage(a.highlight(b,a.languages[x],x)),w&&r.close()},!1)),a;var p=a.util.currentScript();p&&(a.filename=p.src,p.hasAttribute("data-manual")&&(a.manual=!0));function m(){a.manual||a.highlightAll()}if(!a.manual){var _=document.readyState;_==="loading"||_==="interactive"&&p&&p.defer?document.addEventListener("DOMContentLoaded",m):window.requestAnimationFrame?window.requestAnimationFrame(m):window.setTimeout(m,16)}return a})(t);e.exports&&(e.exports=n),typeof _n<"u"&&(_n.Prism=n),n.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},n.languages.markup.tag.inside["attr-value"].inside.entity=n.languages.markup.entity,n.languages.markup.doctype.inside["internal-subset"].inside=n.languages.markup,n.hooks.add("wrap",function(r){r.type==="entity"&&(r.attributes.title=r.content.replace(/&/,"&"))}),Object.defineProperty(n.languages.markup.tag,"addInlined",{value:function(o,i){var s={};s["language-"+i]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:n.languages[i]},s.cdata=/^<!\[CDATA\[|\]\]>$/i;var a={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:s}};a["language-"+i]={pattern:/[\s\S]+/,inside:n.languages[i]};var l={};l[o]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return o}),"i"),lookbehind:!0,greedy:!0,inside:a},n.languages.insertBefore("markup","cdata",l)}}),Object.defineProperty(n.languages.markup.tag,"addAttribute",{value:function(r,o){n.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+r+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[o,"language-"+o],inside:n.languages[o]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),n.languages.html=n.languages.markup,n.languages.mathml=n.languages.markup,n.languages.svg=n.languages.markup,n.languages.xml=n.languages.extend("markup",{}),n.languages.ssml=n.languages.xml,n.languages.atom=n.languages.xml,n.languages.rss=n.languages.xml,(function(r){var o=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;r.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+o.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+o.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+o.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+o.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:o,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},r.languages.css.atrule.inside.rest=r.languages.css;var i=r.languages.markup;i&&(i.tag.addInlined("style","css"),i.tag.addAttribute("style","css"))})(n),n.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},n.languages.javascript=n.languages.extend("clike",{"class-name":[n.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),n.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,n.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:n.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:n.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:n.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:n.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:n.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),n.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:n.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),n.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),n.languages.markup&&(n.languages.markup.tag.addInlined("script","javascript"),n.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),n.languages.js=n.languages.javascript,(function(){if(typeof n>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var r="Loading…",o=function(p,m){return"✖ Error "+p+" while fetching file: "+m},i="✖ Error: File does not exist or is empty",s={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},a="data-src-status",l="loading",c="loaded",u="failed",f="pre[data-src]:not(["+a+'="'+c+'"]):not(['+a+'="'+l+'"])';function d(p,m,_){var y=new XMLHttpRequest;y.open("GET",p,!0),y.onreadystatechange=function(){y.readyState==4&&(y.status<400&&y.responseText?m(y.responseText):y.status>=400?_(o(y.status,y.statusText)):_(i))},y.send(null)}function h(p){var m=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(p||"");if(m){var _=Number(m[1]),y=m[2],v=m[3];return y?v?[_,Number(v)]:[_,void 0]:[_,_]}}n.hooks.add("before-highlightall",function(p){p.selector+=", "+f}),n.hooks.add("before-sanity-check",function(p){var m=p.element;if(m.matches(f)){p.code="",m.setAttribute(a,l);var _=m.appendChild(document.createElement("CODE"));_.textContent=r;var y=m.getAttribute("data-src"),v=p.language;if(v==="none"){var x=(/\.(\w+)$/.exec(y)||[,"none"])[1];v=s[x]||x}n.util.setLanguage(_,v),n.util.setLanguage(m,v);var b=n.plugins.autoloader;b&&b.loadLanguages(v),d(y,function(w){m.setAttribute(a,c);var T=h(m.getAttribute("data-range"));if(T){var E=w.split(/\r\n?|\n/g),R=T[0],M=T[1]==null?E.length:T[1];R<0&&(R+=E.length),R=Math.max(0,Math.min(R-1,E.length)),M<0&&(M+=E.length),M=Math.max(0,Math.min(M,E.length)),w=E.slice(R,M).join(`
|
|
23
23
|
`),m.hasAttribute("data-start")||m.setAttribute("data-start",String(R+1))}_.textContent=w,n.highlightElement(_)},function(w){m.setAttribute(a,u),_.textContent=w})}}),n.plugins.fileHighlight={highlight:function(m){for(var _=(m||document).querySelectorAll(f),y=0,v;v=_[y++];)n.highlightElement(v)}};var g=!1;n.fileHighlight=function(){g||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),g=!0),n.plugins.fileHighlight.highlight.apply(this,arguments)}})()})(gc)),gc.exports}RA();Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/};Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/});Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}});Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}});Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript"));Prism.languages.js=Prism.languages.javascript;Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]};Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity;Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup;Prism.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&/,"&"))});Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(t,n){var r={};r["language-"+n]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[n]},r.cdata=/^<!\[CDATA\[|\]\]>$/i;var o={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};o["language-"+n]={pattern:/[\s\S]+/,inside:Prism.languages[n]};var i={};i[t]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return t}),"i"),lookbehind:!0,greedy:!0,inside:o},Prism.languages.insertBefore("markup","cdata",i)}});Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(e,t){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:Prism.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}});Prism.languages.html=Prism.languages.markup;Prism.languages.mathml=Prism.languages.markup;Prism.languages.svg=Prism.languages.markup;Prism.languages.xml=Prism.languages.extend("markup",{});Prism.languages.ssml=Prism.languages.xml;Prism.languages.atom=Prism.languages.xml;Prism.languages.rss=Prism.languages.xml;(function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(u){return u=u.replace(/<inner>/g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+u+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,o=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return r}),i=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+o+i+"(?:"+o+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+o+i+")(?:"+o+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+o+")"+i+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+o+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(u){["url","bold","italic","strike","code-snippet"].forEach(function(f){u!==f&&(e.languages.markdown[u].inside.content.inside[f]=e.languages.markdown[f])})}),e.hooks.add("after-tokenize",function(u){if(u.language!=="markdown"&&u.language!=="md")return;function f(d){if(!(!d||typeof d=="string"))for(var h=0,g=d.length;h<g;h++){var p=d[h];if(p.type!=="code"){f(p.content);continue}var m=p.content[1],_=p.content[3];if(m&&_&&m.type==="code-language"&&_.type==="code-block"&&typeof m.content=="string"){var y=m.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");y=(/[a-z][\w-]*/i.exec(y)||[""])[0].toLowerCase();var v="language-"+y;_.alias?typeof _.alias=="string"?_.alias=[_.alias,v]:_.alias.push(v):_.alias=[v]}}}f(u.tokens)}),e.hooks.add("wrap",function(u){if(u.type==="code-block"){for(var f="",d=0,h=u.classes.length;d<h;d++){var g=u.classes[d],p=/language-(.+)/.exec(g);if(p){f=p[1];break}}var m=e.languages[f];if(m)u.content=e.highlight(c(u.content),m,f);else if(f&&f!=="none"&&e.plugins.autoloader){var _="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*1e16);u.attributes.id=_,e.plugins.autoloader.loadLanguages(f,function(){var y=document.getElementById(_);y&&(y.innerHTML=e.highlight(y.textContent,e.languages[f],f))})}}});var s=RegExp(e.languages.markup.tag.pattern.source,"gi"),a={amp:"&",lt:"<",gt:">",quot:'"'},l=String.fromCodePoint||String.fromCharCode;function c(u){var f=u.replace(s,"");return f=f.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(d,h){if(h=h.toLowerCase(),h[0]==="#"){var g;return h[1]==="x"?g=parseInt(h.slice(2),16):g=Number(h.slice(1)),l(g)}else{var p=a[h];return p||d}}),f}e.languages.md=e.languages.markdown})(Prism);Prism.languages.c=Prism.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/});Prism.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}});Prism.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}});Prism.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/});delete Prism.languages.c.boolean;(function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))})(Prism);Prism.languages.objectivec=Prism.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/});delete Prism.languages.objectivec["class-name"];Prism.languages.objc=Prism.languages.objectivec;Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/};(function(e){var t=e.languages.powershell={comment:[{pattern:/(^|[^`])<#[\s\S]*?#>/,lookbehind:!0},{pattern:/(^|[^`])#.*/,lookbehind:!0}],string:[{pattern:/"(?:`[\s\S]|[^`"])*"/,greedy:!0,inside:null},{pattern:/'(?:[^']|'')*'/,greedy:!0}],namespace:/\[[a-z](?:\[(?:\[[^\]]*\]|[^\[\]])*\]|[^\[\]])*\]/i,boolean:/\$(?:false|true)\b/i,variable:/\$\w+\b/,function:[/\b(?:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|ForEach|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Sort|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Tee|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Where|Write)-[a-z]+\b/i,/\b(?:ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i],keyword:/\b(?:Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i,operator:{pattern:/(^|\W)(?:!|-(?:b?(?:and|x?or)|as|(?:Not)?(?:Contains|In|Like|Match)|eq|ge|gt|is(?:Not)?|Join|le|lt|ne|not|Replace|sh[lr])\b|-[-=]?|\+[+=]?|[*\/%]=?)/i,lookbehind:!0},punctuation:/[|{}[\];(),.]/};t.string[0].inside={function:{pattern:/(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,lookbehind:!0,inside:t},boolean:t.boolean,variable:t.variable}})(Prism);var vm={},_m;function kA(){return _m||(_m=1,Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python),vm}kA();var xm={},bm;function AA(){return bm||(bm=1,(function(e){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)t=t.replace(/<self>/g,function(){return t});t=t.replace(/<self>/g,function(){return/[^\s\S]/.source}),e.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust["closure-params"].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string})(Prism)),xm}AA();Prism.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+(/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+")+"|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/};Prism.languages.swift["string-literal"].forEach(function(e){e.inside.interpolation.inside=Prism.languages.swift});var Cm={},wm;function MA(){return wm||(wm=1,(function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript})(Prism)),Cm}MA();var Sm={},Em;function NA(){return Em||(Em=1,(function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,r={pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:r.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+n+/[A-Z]\w*\b/.source),lookbehind:!0,inside:r.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),e.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+n+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+n+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(Prism)),Sm}NA();var Tm={},Rm;function PA(){return Rm||(Rm=1,(function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return t.source});e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return n})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])})(Prism)),Tm}PA();function Gx(e,t){for(const n of e.childNodes){if(je(n)&&n.tagName===t)return!0;Gx(n,t)}return!1}const Mi="data-language",Ci="data-highlight-language",Vs="data-theme";let hl=class qx extends yt{__language;__theme;__isSyntaxHighlightSupported;static getType(){return"code"}static clone(t){return new qx(t.__language,t.__key)}constructor(t,n){super(n),this.__language=t||void 0,this.__isSyntaxHighlightSupported=!1,this.__theme=void 0}afterCloneFrom(t){super.afterCloneFrom(t),this.__language=t.__language,this.__theme=t.__theme,this.__isSyntaxHighlightSupported=t.__isSyntaxHighlightSupported}createDOM(t){const n=document.createElement("code");Ye(n,t.theme.code),n.setAttribute("spellcheck","false");const r=this.getLanguage();r&&(n.setAttribute(Mi,r),this.getIsSyntaxHighlightSupported()&&n.setAttribute(Ci,r));const o=this.getTheme();o&&n.setAttribute(Vs,o);const i=this.getStyle();return i&&n.setAttribute("style",i),n}updateDOM(t,n,r){const o=this.__language,i=t.__language;o?o!==i&&n.setAttribute(Mi,o):i&&n.removeAttribute(Mi);const s=this.__isSyntaxHighlightSupported;t.__isSyntaxHighlightSupported&&i?s&&o?o!==i&&n.setAttribute(Ci,o):n.removeAttribute(Ci):s&&o&&n.setAttribute(Ci,o);const a=this.__theme,l=t.__theme;a?a!==l&&n.setAttribute(Vs,a):l&&n.removeAttribute(Vs);const c=this.__style,u=t.__style;return c?c!==u&&n.setAttribute("style",c):u&&n.removeAttribute("style"),!1}exportDOM(t){const n=document.createElement("pre");Ye(n,t._config.theme.code),n.setAttribute("spellcheck","false");const r=this.getLanguage();r&&(n.setAttribute(Mi,r),this.getIsSyntaxHighlightSupported()&&n.setAttribute(Ci,r));const o=this.getTheme();o&&n.setAttribute(Vs,o);const i=this.getStyle();return i&&n.setAttribute("style",i),{element:n}}static importDOM(){return{code:t=>t.textContent!=null&&(/\r?\n/.test(t.textContent)||Gx(t,"BR"))?{conversion:km,priority:1}:null,div:()=>({conversion:FA,priority:1}),pre:()=>({conversion:km,priority:0}),table:t=>pc(t)?{conversion:LA,priority:3}:null,td:t=>{const n=t,r=n.closest("table");return n.classList.contains("js-file-line")||r&&pc(r)?{conversion:Am,priority:3}:null},tr:t=>{const n=t.closest("table");return n&&pc(n)?{conversion:Am,priority:3}:null}}}static importJSON(t){return Wn().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setLanguage(t.language).setTheme(t.theme)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),theme:this.getTheme()}}insertNewAfter(t,n=!0){const r=this.getChildren(),o=r.length;if(o>=2&&r[o-1].getTextContent()===`
|
|
24
24
|
`&&r[o-2].getTextContent()===`
|
|
25
|
-
`&&t.isCollapsed()&&t.anchor.key===this.__key&&t.anchor.offset===o){r[o-1].remove(),r[o-2].remove();const l=me();return this.insertAfter(l,n),l}const{anchor:i,focus:s}=t,a=(i.isBefore(s)?i:s).getNode();if(Y(a)){let l=IA(a);const c=[];for(;;)if(nl(l))c.push(ai()),l=l.getNextSibling();else{if(!Zx(l))break;{let m=0;const _=l.getTextContent(),y=l.getTextContentSize();for(;m<y&&_[m]===" ";)m++;if(m!==0&&c.push(Jx(" ".repeat(m))),m!==y)break;l=l.getNextSibling()}}const u=a.splitText(i.offset)[0],f=i.offset===0?0:1,d=u.getIndexWithinParent()+f,h=a.getParentOrThrow(),g=[
|
|
25
|
+
`&&t.isCollapsed()&&t.anchor.key===this.__key&&t.anchor.offset===o){r[o-1].remove(),r[o-2].remove();const l=me();return this.insertAfter(l,n),l}const{anchor:i,focus:s}=t,a=(i.isBefore(s)?i:s).getNode();if(Y(a)){let l=IA(a);const c=[];for(;;)if(nl(l))c.push(ai()),l=l.getNextSibling();else{if(!Zx(l))break;{let m=0;const _=l.getTextContent(),y=l.getTextContentSize();for(;m<y&&_[m]===" ";)m++;if(m!==0&&c.push(Jx(" ".repeat(m))),m!==y)break;l=l.getNextSibling()}}const u=a.splitText(i.offset)[0],f=i.offset===0?0:1,d=u.getIndexWithinParent()+f,h=a.getParentOrThrow(),g=[sn(),...c];h.splice(d,0,g);const p=c[c.length-1];p?p.select():i.offset===0?u.selectPrevious():u.getNextSibling().selectNext(0,0)}if(jf(a)){const{offset:l}=t.anchor;a.splice(l,0,[sn()]),a.select(l+1,l+1)}return null}canIndent(){return!1}collapseAtStart(){const t=me();return this.getChildren().forEach(n=>t.append(n)),this.replace(t),!0}setLanguage(t){const n=this.getWritable();return n.__language=t||void 0,n}getLanguage(){return this.getLatest().__language}setIsSyntaxHighlightSupported(t){const n=this.getWritable();return n.__isSyntaxHighlightSupported=t,n}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}setTheme(t){const n=this.getWritable();return n.__theme=t||void 0,n}getTheme(){return this.getLatest().__theme}};function Wn(e,t){return rx(hl).setLanguage(e).setTheme(t)}function jf(e){return e instanceof hl}function km(e){return{node:Wn(e.getAttribute(Mi))}}function FA(e){const t=e,n=Mm(t);return n||(function(r){let o=r.parentElement;for(;o!==null;){if(Mm(o))return!0;o=o.parentElement}return!1})(t)?{node:n?Wn():null}:{node:null}}function LA(){return{node:Wn()}}function Am(){return{node:null}}function Mm(e){return e.style.fontFamily.match("monospace")!==null}function pc(e){return e.classList.contains("js-file-line-container")}let Yx=class Xx extends Gt{__highlightType;constructor(t="",n,r){super(t,r),this.__highlightType=n}static getType(){return"code-highlight"}static clone(t){return new Xx(t.__text,t.__highlightType||void 0,t.__key)}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(t){const n=this.getWritable();return n.__highlightType=t||void 0,n}canHaveFormat(){return!1}createDOM(t){const n=super.createDOM(t),r=mc(t.theme,this.__highlightType);return Ye(n,r),n}updateDOM(t,n,r){const o=super.updateDOM(t,n,r),i=mc(r.theme,t.__highlightType),s=mc(r.theme,this.__highlightType);return i!==s&&(i&&Rn(n,i),s&&Ye(n,s)),o}static importJSON(t){return Jx().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setHighlightType(t.highlightType)}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType()}}setFormat(t){return this}isParentRequired(){return!0}createParentElementNode(){return Wn()}};function mc(e,t){return t&&e&&e.codeHighlight&&e.codeHighlight[t]}function Jx(e="",t){return vt(new Yx(e,t))}function Zx(e){return e instanceof Yx}function OA(e,t){let n=e;for(let r=Je(e,t);r&&(Zx(r.origin)||nl(r.origin));r=P3(r))n=r.origin;return n}function IA(e){return OA(e,"previous")}(function(e){e.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(t).forEach(function(n){var r=t[n],o=[];/^\w+$/.test(n)||o.push(/\w+/.exec(n)[0]),n==="diff"&&o.push("bold"),e.languages.diff[n]={pattern:RegExp("^(?:["+r+`].*(?:\r
|
|
26
26
|
?|
|
|
27
27
|
|(?![\\s\\S])))+`,"m"),alias:o,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(n)[0]}}}}),Object.defineProperty(e.languages.diff,"PREFIXES",{value:t})})(Prism);const $A=new Set(["http:","https:","mailto:","sms:","tel:"]);let ps=class Qx extends yt{__url;__target;__rel;__title;static getType(){return"link"}static clone(t){return new Qx(t.__url,{rel:t.__rel,target:t.__target,title:t.__title},t.__key)}constructor(t="",n={},r){super(r);const{target:o=null,rel:i=null,title:s=null}=n;this.__url=t,this.__target=o,this.__rel=i,this.__title=s}createDOM(t){const n=document.createElement("a");return this.updateLinkDOM(null,n,t),Ye(n,t.theme.link),n}updateLinkDOM(t,n,r){if(tx(n)){t&&t.__url===this.__url||(n.href=this.sanitizeUrl(this.__url));for(const o of["target","rel","title"]){const i=`__${o}`,s=this[i];t&&t[i]===s||(s?n[o]=s:n.removeAttribute(o))}}}updateDOM(t,n,r){return this.updateLinkDOM(t,n,r),!1}static importDOM(){return{a:t=>({conversion:DA,priority:1})}}static importJSON(t){return Oa().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setURL(t.url).setRel(t.rel||null).setTarget(t.target||null).setTitle(t.title||null)}sanitizeUrl(t){t=Pm(t);try{const n=new URL(Pm(t));if(!$A.has(n.protocol))return"about:blank"}catch{return t}return t}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(t){const n=this.getWritable();return n.__url=t,n}getTarget(){return this.getLatest().__target}setTarget(t){const n=this.getWritable();return n.__target=t,n}getRel(){return this.getLatest().__rel}setRel(t){const n=this.getWritable();return n.__rel=t,n}getTitle(){return this.getLatest().__title}setTitle(t){const n=this.getWritable();return n.__title=t,n}insertNewAfter(t,n=!0){const r=Oa(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(r,n),r}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(t,n,r){if(!W(n))return!1;const o=n.anchor.getNode(),i=n.focus.getNode();return this.isParentOf(o)&&this.isParentOf(i)&&n.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}};function DA(e){let t=null;if(tx(e)){const n=e.textContent;(n!==null&&n!==""||e.children.length>0)&&(t=Oa(e.getAttribute("href")||"",{rel:e.getAttribute("rel"),target:e.getAttribute("target"),title:e.getAttribute("title")}))}return{node:t}}function Oa(e="",t){return vt(new ps(e,t))}function VA(e){return e instanceof ps}class ms extends ps{__isUnlinked;constructor(t="",n={},r){super(t,n,r),this.__isUnlinked=n.isUnlinked!==void 0&&n.isUnlinked!==null&&n.isUnlinked}static getType(){return"autolink"}static clone(t){return new ms(t.__url,{isUnlinked:t.__isUnlinked,rel:t.__rel,target:t.__target,title:t.__title},t.__key)}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(t){const n=this.getWritable();return n.__isUnlinked=t,n}createDOM(t){return this.__isUnlinked?document.createElement("span"):super.createDOM(t)}updateDOM(t,n,r){return super.updateDOM(t,n,r)||t.__isUnlinked!==this.__isUnlinked}static importJSON(t){return Nm().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setIsUnlinked(t.isUnlinked||!1)}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}insertNewAfter(t,n=!0){const r=this.getParentOrThrow().insertNewAfter(t,n);if(V(r)){const o=Nm(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return r.append(o),o}return null}}function Nm(e="",t){return vt(new ms(e,t))}function jA(e){return e instanceof ms}const BA=/^\+?[0-9\s()-]{5,}$/;function Pm(e){return e.match(/^[a-z][a-z0-9+.-]*:/i)||e.match(/^[/#.]/)?e:e.includes("@")?`mailto:${e}`:BA.test(e)?`tel:${e}`:`https://${e}`}function Zu(e,t){const n={};for(const r of e){const o=t(r);o&&(n[o]?n[o].push(r):n[o]=[r])}return n}function Bf(e){const t=Zu(e,n=>n.type);return{element:t.element||[],multilineElement:t["multiline-element"]||[],textFormat:t["text-format"]||[],textMatch:t["text-match"]||[]}}const Ia=/[!-/:-@[-`{-~\s]/,zA=/^\s{0,3}$/;function Qu(e){if(!Sr(e))return!1;const t=e.getFirstChild();return t==null||e.getChildrenSize()===1&&Y(t)&&zA.test(t.getTextContent())}function WA(e,t,n,r){for(const o of t){if(!o.export)continue;const i=o.export(e,s=>$a(s,n,r));if(i!=null)return i}return V(e)?$a(e,n,r):Ce(e)?e.getTextContent():null}function $a(e,t,n,r,o){const i=[],s=e.getChildren();r||(r=[]),o||(o=[]);e:for(const a of s){for(const l of n){if(!l.export)continue;const c=l.export(a,u=>$a(u,t,n,r,[...o,...r]),(u,f)=>Fm(u,f,t,r,o));if(c!=null){i.push(c);continue e}}wn(a)?i.push(`
|
|
28
28
|
`):Y(a)?i.push(Fm(a,a.getTextContent(),t,r,o)):V(a)?i.push($a(a,t,n,r,o)):Ce(a)&&i.push(a.getTextContent())}return i.join("")}function Fm(e,t,n,r,o){let i=e.getFormat()===0?t:(function(d){return d.replace(/^\s+|\s+$/g,h=>[...h].map(g=>"&#"+g.codePointAt(0)+";").join(""))})(t);e.hasFormat("code")||(i=i.replace(/([*_`~\\])/g,"\\$1"));let s="",a="",l="";const c=Lm(e,!0),u=Lm(e,!1),f=new Set;for(const d of n){const h=d.format[0],g=d.tag;js(e,h)&&!f.has(h)&&(f.add(h),js(c,h)&&r.find(p=>p.tag===g)||(r.push({format:h,tag:g}),s+=g))}for(let d=0;d<r.length;d++){const h=js(e,r[d].format),g=js(u,r[d].format);if(h&&g)continue;const p=[...r];for(;p.length>d;){const m=p.pop();o&&m&&o.find(_=>_.tag===m.tag)||(m&&typeof m.tag=="string"&&(h?g||(l+=m.tag):a+=m.tag),r.pop())}break}return i=s+i+l,a+i}function Lm(e,t){let n=t?e.getPreviousSibling():e.getNextSibling();if(!n){const r=e.getParentOrThrow();r.isInline()&&(n=t?r.getPreviousSibling():r.getNextSibling())}for(;n;){if(V(n)){if(!n.isInline())break;const r=t?n.getLastDescendant():n.getFirstDescendant();if(Y(r))return r;n=t?n.getPreviousSibling():n.getNextSibling()}if(Y(n))return n;if(!V(n))return null}return null}function js(e,t){return Y(e)&&e.hasFormat(t)}function HA(e,t){const n=(function(o,i){const s=o.match(i.openTagsRegExp);if(s==null)return null;for(const a of s){const l=a.replace(/^\s/,""),c=i.fullMatchRegExpByTag[l];if(c==null)continue;const u=o.match(c),f=i.transformersByTag[l];if(u!=null&&f!=null){if(f.intraword!==!1)return u;const{index:d=0}=u,h=o[d-1],g=o[d+u[0].length];if((!h||Ia.test(h))&&(!g||Ia.test(g)))return u}}return null})(e.getTextContent(),t);if(!n)return null;const r=n.index||0;return{endIndex:r+n[0].length,match:n,startIndex:r,transformer:t.transformersByTag[n[1]]}}function Fr(e){return Y(e)&&!e.hasFormat("code")}function Lr(e,t,n){let r=HA(e,t),o=(function(s,a){const l=s;let c,u,f,d;for(const h of a){if(!h.replace||!h.importRegExp)continue;const g=l.getTextContent().match(h.importRegExp);if(!g)continue;const p=g.index||0,m=h.getEndIndex?h.getEndIndex(l,g):p+g[0].length;m!==!1&&(c===void 0||u===void 0||p<c&&(m>u||m<=c))&&(c=p,u=m,f=h,d=g)}return c===void 0||u===void 0||f===void 0||d===void 0?null:{endIndex:u,match:d,startIndex:c,transformer:f}})(e,n);if(r&&o&&(r.startIndex<=o.startIndex&&r.endIndex>=o.endIndex||o.startIndex>r.endIndex?o=null:r=null),r){const s=(function(a,l,c,u,f){const d=a.getTextContent();let h,g,p;if(f[0]===d?h=a:l===0?[h,g]=a.splitText(c):[p,h,g]=a.splitText(l,c),h.setTextContent(f[2]),u)for(const m of u.format)h.hasFormat(m)||h.toggleFormat(m);return{nodeAfter:g,nodeBefore:p,transformedNode:h}})(e,r.startIndex,r.endIndex,r.transformer,r.match);Fr(s.nodeAfter)&&Lr(s.nodeAfter,t,n),Fr(s.nodeBefore)&&Lr(s.nodeBefore,t,n),Fr(s.transformedNode)&&Lr(s.transformedNode,t,n)}else if(o){const s=(function(a,l,c,u,f){let d,h,g;return l===0?[d,h]=a.splitText(c):[g,d,h]=a.splitText(l,c),u.replace?{nodeAfter:h,nodeBefore:g,transformedNode:u.replace(d,f)||void 0}:null})(e,o.startIndex,o.endIndex,o.transformer,o.match);if(!s)return;Fr(s.nodeAfter)&&Lr(s.nodeAfter,t,n),Fr(s.nodeBefore)&&Lr(s.nodeBefore,t,n),Fr(s.transformedNode)&&Lr(s.transformedNode,t,n)}const i=e.getTextContent().replace(/\\([*_`~\\])/g,"$1").replace(/&#(\d+);/g,(s,a)=>String.fromCodePoint(a));e.setTextContent(i)}function KA(e,t=!1){const n=Bf(e),r=(function(o){const i={},s={},a=[],l="(?<![\\\\])";for(const c of o){const{tag:u}=c;i[u]=c;const f=u.replace(/(\*|\^|\+)/g,"\\$1");a.push(f),u.length===1?s[u]=u==="`"?new RegExp("(?<![\\\\`])(`)((?:\\\\`|[^`])+?)(`)(?!`)"):new RegExp(`(?<![\\\\${f}])(${f})((\\\\${f})?.*?[^${f}\\s](\\\\${f})?)((?<!\\\\)|(?<=\\\\\\\\))(${f})(?![\\\\${f}])`):s[u]=new RegExp(`(?<!\\\\)(${f})((\\\\${f})?.*?[^\\s](\\\\${f})?)((?<!\\\\)|(?<=\\\\\\\\))(${f})(?!\\\\)`)}return{fullMatchRegExpByTag:s,openTagsRegExp:new RegExp(`${l}(${a.join("|")})`,"g"),transformersByTag:i}})(n.textFormat);return(o,i)=>{const s=o.split(`
|
|
29
|
-
`),a=s.length,l=i||Ke();l.clear();for(let u=0;u<a;u++){const f=s[u],[d,h]=UA(s,u,n.multilineElement,l);d?u=h:GA(f,l,n.element,r,n.textMatch,t)}const c=l.getChildren();for(const u of c)!t&&Qu(u)&&l.getChildrenSize()>1&&u.remove();G()!==null&&l.selectStart()}}function UA(e,t,n,r){for(const o of n){const{handleImportAfterStartMatch:i,regExpEnd:s,regExpStart:a,replace:l}=o,c=e[t].match(a);if(!c)continue;if(i){const g=i({lines:e,rootNode:r,startLineIndex:t,startMatch:c,transformer:o});if(g===null)continue;if(g)return g}const u=typeof s=="object"&&"regExp"in s?s.regExp:s,f=s&&typeof s=="object"&&"optional"in s?s.optional:!s;let d=t;const h=e.length;for(;d<h;){const g=u?e[d].match(u):null;if(!g&&(!f||f&&d<h-1)){d++;continue}if(g&&t===d&&g.index===c.index){d++;continue}const p=[];if(g&&t===d)p.push(e[t].slice(c[0].length,-g[0].length));else for(let m=t;m<=d;m++)if(m===t){const _=e[m].slice(c[0].length);p.push(_)}else if(m===d&&g){const _=e[m].slice(0,-g[0].length);p.push(_)}else p.push(e[m]);if(l(r,null,c,g,p,!0)!==!1)return[!0,d];break}}return[!1,t]}function GA(e,t,n,r,o,i){const s=Pe(e),a=me();a.append(s),t.append(a);for(const{regExp:l,replace:c}of n){const u=e.match(l);if(u&&(s.setTextContent(e.slice(u[0].length)),c(a,[s],u,!0)!==!1))break}if(Lr(s,r,o),a.isAttached()&&e.length>0){const l=a.getPreviousSibling();if(!i&&(Sr(l)||Ju(l)||ge(l))){let c=l;if(ge(l)){const u=l.getLastDescendant();c=u==null?null:xe(u,Ee)}c!=null&&c.getTextContentSize()>0&&(c.splice(c.getChildrenSize(),0,[
|
|
29
|
+
`),a=s.length,l=i||Ke();l.clear();for(let u=0;u<a;u++){const f=s[u],[d,h]=UA(s,u,n.multilineElement,l);d?u=h:GA(f,l,n.element,r,n.textMatch,t)}const c=l.getChildren();for(const u of c)!t&&Qu(u)&&l.getChildrenSize()>1&&u.remove();G()!==null&&l.selectStart()}}function UA(e,t,n,r){for(const o of n){const{handleImportAfterStartMatch:i,regExpEnd:s,regExpStart:a,replace:l}=o,c=e[t].match(a);if(!c)continue;if(i){const g=i({lines:e,rootNode:r,startLineIndex:t,startMatch:c,transformer:o});if(g===null)continue;if(g)return g}const u=typeof s=="object"&&"regExp"in s?s.regExp:s,f=s&&typeof s=="object"&&"optional"in s?s.optional:!s;let d=t;const h=e.length;for(;d<h;){const g=u?e[d].match(u):null;if(!g&&(!f||f&&d<h-1)){d++;continue}if(g&&t===d&&g.index===c.index){d++;continue}const p=[];if(g&&t===d)p.push(e[t].slice(c[0].length,-g[0].length));else for(let m=t;m<=d;m++)if(m===t){const _=e[m].slice(c[0].length);p.push(_)}else if(m===d&&g){const _=e[m].slice(0,-g[0].length);p.push(_)}else p.push(e[m]);if(l(r,null,c,g,p,!0)!==!1)return[!0,d];break}}return[!1,t]}function GA(e,t,n,r,o,i){const s=Pe(e),a=me();a.append(s),t.append(a);for(const{regExp:l,replace:c}of n){const u=e.match(l);if(u&&(s.setTextContent(e.slice(u[0].length)),c(a,[s],u,!0)!==!1))break}if(Lr(s,r,o),a.isAttached()&&e.length>0){const l=a.getPreviousSibling();if(!i&&(Sr(l)||Ju(l)||ge(l))){let c=l;if(ge(l)){const u=l.getLastDescendant();c=u==null?null:xe(u,Ee)}c!=null&&c.getTextContentSize()>0&&(c.splice(c.getChildrenSize(),0,[sn(),...a.getChildren()]),a.remove())}}}function qA(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const e1=/^(\s*)(\d{1,})\.\s/,t1=/^(\s*)[-*+]\s/,YA=/^(\s*)(?:[-*+]\s)?\s?(\[(\s|x)?\])\s/i,ed=/^(#{1,6})\s/,n1=/^>\s/,r1=/^[ \t]*```([\w-]+)?/,td=/[ \t]*```$/,XA=/^[ \t]*```[^`]+(?:(?:`{1,2}|`{4,})[^`]+)*```(?:[^`]|$)/,JA=/^(?:\|)(.+)(?:\|)\s?$/,ZA=/^(\| ?:?-*:? ?)+\|\s?$/,Om=/^<[a-z_][\w-]*(?:\s[^<>]*)?\/?>/i,Im=/^<\/[a-z_][\w-]*\s*>/i,$m=e=>new RegExp(`(?:${e.source})$`,e.flags),Ni=hk("mdListMarker",{parse:e=>typeof e=="string"&&/^[-*+]$/.test(e)?e:"-"}),o1=e=>(t,n,r,o)=>{const i=e(r);i.append(...n),t.replace(i),o||i.select(0,0)},i1=e=>(t,n,r,o)=>{const i=t.getPreviousSibling(),s=t.getNextSibling(),a=It(e==="check"?r[3]==="x":void 0),l=r[0].trim()[0],c=e!=="bullet"&&e!=="check"||l!==Ni.parse(l)?void 0:l;if(ge(s)&&s.getListType()===e){c&&Ql(s,Ni,c);const f=s.getFirstChild();f!==null?f.insertBefore(a):s.append(a),t.remove()}else if(ge(i)&&i.getListType()===e)c&&Ql(i,Ni,c),i.append(a),t.remove();else{const f=Mt(e,e==="number"?Number(r[2]):void 0);c&&Ql(f,Ni,c),f.append(a),t.replace(f)}a.append(...n),o||a.select(0,0);const u=(function(f){const d=f.match(/\t/g),h=f.match(/ /g);let g=0;return d&&(g+=d.length),h&&(g+=Math.floor(h.length/4)),g})(r[1]);u&&a.setIndent(u)},zf=(e,t,n)=>{const r=[],o=e.getChildren();let i=0;for(const s of o)if(Ee(s)){if(s.getChildrenSize()===1){const f=s.getFirstChild();if(ge(f)){r.push(zf(f,t,n+1));continue}}const a=" ".repeat(4*n),l=e.getListType(),c=Z0(e,Ni),u=l==="number"?`${e.getStart()+i}. `:l==="check"?`${c} [${s.getChecked()?"x":" "}] `:c+" ";r.push(a+u+t(s)),i++}return r.join(`
|
|
30
30
|
`)},QA={dependencies:[fl],export:(e,t)=>{if(!Ux(e))return null;const n=Number(e.getTag().slice(1));return"#".repeat(n)+" "+t(e)},regExp:ed,replace:o1(e=>{const t="h"+e[1].length;return Vr(t)}),type:"element"},eM={dependencies:[dl],export:(e,t)=>{if(!Ju(e))return null;const n=t(e).split(`
|
|
31
31
|
`),r=[];for(const o of n)r.push("> "+o);return r.join(`
|
|
32
|
-
`)},regExp:n1,replace:(e,t,n,r)=>{if(r){const i=e.getPreviousSibling();if(Ju(i))return i.splice(i.getChildrenSize(),0,[
|
|
32
|
+
`)},regExp:n1,replace:(e,t,n,r)=>{if(r){const i=e.getPreviousSibling();if(Ju(i))return i.splice(i.getChildrenSize(),0,[sn(),...t]),void e.remove()}const o=Vf();o.append(...t),e.replace(o),r||o.select(0,0)},type:"element"},tM={dependencies:[hl],export:e=>{if(!jf(e))return null;const t=e.getTextContent();return"```"+(e.getLanguage()||"")+(t?`
|
|
33
33
|
`+t:"")+"\n```"},regExpEnd:{optional:!0,regExp:td},regExpStart:r1,replace:(e,t,n,r,o,i)=>{let s,a;if(!t&&o){if(o.length===1)r?(s=Wn(),a=n[1]+o[0]):(s=Wn(n[1]),a=o[0].startsWith(" ")?o[0].slice(1):o[0]);else{if(s=Wn(n[1]),o[0].trim().length===0)for(;o.length>0&&!o[0].length;)o.shift();else o[0]=o[0].startsWith(" ")?o[0].slice(1):o[0];for(;o.length>0&&!o[o.length-1].length;)o.pop();a=o.join(`
|
|
34
34
|
`)}const l=Pe(a);s.append(l),e.append(s)}else t&&o1(l=>Wn(l?l[1]:void 0))(e,t,n,i)},type:"multiline-element"},nM={dependencies:[uo,Er],export:(e,t)=>ge(e)?zf(e,t,0):null,regExp:t1,replace:i1("bullet"),type:"element"},rM={dependencies:[uo,Er],export:(e,t)=>ge(e)?zf(e,t,0):null,regExp:e1,replace:i1("number"),type:"element"},oM={format:["code"],tag:"`",type:"text-format"},iM={format:["highlight"],tag:"==",type:"text-format"},sM={format:["bold","italic"],tag:"***",type:"text-format"},aM={format:["bold","italic"],intraword:!1,tag:"___",type:"text-format"},lM={format:["bold"],tag:"**",type:"text-format"},cM={format:["bold"],intraword:!1,tag:"__",type:"text-format"},uM={format:["strikethrough"],tag:"~~",type:"text-format"},dM={format:["italic"],tag:"*",type:"text-format"},fM={format:["italic"],intraword:!1,tag:"_",type:"text-format"},hM={dependencies:[ps],export:(e,t,n)=>{if(!VA(e)||jA(e))return null;const r=e.getTitle(),o=t(e);return r?`[${o}](${e.getURL()} "${r}")`:`[${o}](${e.getURL()})`},importRegExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(e,t)=>{const[,n,r,o]=t,i=Oa(r,{title:o}),s=n.split("[").length-1,a=n.split("]").length-1;let l=n,c="";if(s<a)return;if(s>a){const f=n.split("[");c="["+f[0],l=f.slice(1).join("[")}const u=Pe(l);return u.setFormat(e.getFormat()),i.append(u),e.replace(i),c&&i.insertBefore(Pe(c)),u},trigger:")",type:"text-match"},gM=[QA,eM,nM,rM],pM=[tM],mM=[oM,sM,aM,lM,cM,iM,dM,fM,uM],yM=[hM],ys=[...gM,...pM,...mM,...yM];function Dm(e,t,n){const r=n.length;for(let o=t;o>=r;o--){const i=o-r;if(s1(e,i,n,0,r)&&e[i+r]!==" ")return i}return-1}function s1(e,t,n,r,o){for(let i=0;i<o;i++)if(e[t+i]!==n[r+i])return!1;return!0}function vM(e,t=ys){const n=Bf(t),r=Zu(n.textFormat,({tag:s})=>s[s.length-1]),o=Zu(n.textMatch,({trigger:s})=>s);for(const s of t){const a=s.type;if(a==="element"||a==="text-match"||a==="multiline-element"){const l=s.dependencies;for(const c of l)e.hasNode(c)||qA(173,c.getType())}}const i=(s,a,l)=>{(function(c,u,f,d){const h=c.getParent();if(!dt(h)||c.getFirstChild()!==u)return!1;const g=u.getTextContent();if(g[f-1]!==" ")return!1;for(const{regExp:p,replace:m}of d){const _=g.match(p);if(_&&_[0].length===(_[0].endsWith(" ")?f:f-1)){const y=u.getNextSiblings(),[v,x]=u.splitText(f);if(m(c,x?[x,...y]:y,_,!1)!==!1)return v.remove(),!0}}return!1})(s,a,l,n.element)||(function(c,u,f,d){const h=c.getParent();if(!dt(h)||c.getFirstChild()!==u)return!1;const g=u.getTextContent();if(g[f-1]!==" ")return!1;for(const{regExpStart:p,replace:m,regExpEnd:_}of d){if(_&&!("optional"in _)||_&&"optional"in _&&!_.optional)continue;const y=g.match(p);if(y&&y[0].length===(y[0].endsWith(" ")?f:f-1)){const v=u.getNextSiblings(),[x,b]=u.splitText(f);if(m(c,b?[b,...v]:v,y,null,null,!1)!==!1)return x.remove(),!0}}return!1})(s,a,l,n.multilineElement)||(function(c,u,f){let d=c.getTextContent();const h=f[d[u-1]];if(h==null)return!1;u<d.length&&(d=d.slice(0,u));for(const g of h){if(!g.replace||!g.regExp)continue;const p=d.match(g.regExp);if(p===null)continue;const m=p.index||0,_=m+p[0].length;let y;return m===0?[y]=c.splitText(_):[,y]=c.splitText(m,_),y.selectNext(0,0),g.replace(y,p),!0}return!1})(a,l,o)||(function(c,u,f){const d=c.getTextContent(),h=u-1,g=d[h],p=f[g];if(!p)return!1;for(const m of p){const{tag:_}=m,y=_.length,v=h-y+1;if(y>1&&!s1(d,v,_,0,y)||d[v-1]===" ")continue;const x=d[h+1];if(m.intraword===!1&&x&&!Ia.test(x))continue;const b=c;let w=b,T=Dm(d,v,_),E=w;for(;T<0&&(E=E.getPreviousSibling())&&!wn(E);)if(Y(E)){if(E.hasFormat("code"))continue;const P=E.getTextContent();w=E,T=Dm(P,P.length,_)}if(T<0||w===b&&T+y===v)continue;const R=w.getTextContent();if(T>0&&R[T-1]===g)continue;const M=R[T-1];if(m.intraword===!1&&M&&!Ia.test(M))continue;const O=b.getTextContent(),D=O.slice(0,v)+O.slice(h+1);b.setTextContent(D);const I=w===b?D:R;w.setTextContent(I.slice(0,T)+I.slice(T+y));const L=G(),B=ol();He(B);const K=h-y*(w===b?2:1)+1;B.anchor.set(w.__key,T,"text"),B.focus.set(b.__key,K,"text");for(const P of m.format)B.hasFormat(P)||B.formatText(P);B.anchor.set(B.focus.key,B.focus.offset,B.focus.type);for(const P of m.format)B.hasFormat(P)&&B.toggleFormat(P);return W(L)&&(B.format=L.format),!0}})(a,l,r)};return e.registerUpdateListener(({tags:s,dirtyLeaves:a,editorState:l,prevEditorState:c})=>{if(s.has(R_)||s.has(Fk)||e.isComposing())return;const u=l.read(G),f=c.read(G);if(!W(f)||!W(u)||!u.isCollapsed()||u.is(f))return;const d=u.anchor.key,h=u.anchor.offset,g=l._nodeMap.get(d);!Y(g)||!a.has(d)||h!==1&&h>f.anchor.offset+1||e.update(()=>{if(!Fr(g))return;const p=g.getParent();p===null||jf(p)||i(p,g,u.anchor.offset)})})}function _M(e,t=ys,n,r=!1,o=!1){const i=r?e:(function(s,a=!1){const l=s.split(`
|
|
35
35
|
`);let c=!1;const u=[];for(let f=0;f<l.length;f++){const d=l[f].trimEnd(),h=u[u.length-1];XA.test(d)?u.push(d):r1.test(d)||td.test(d)?(c=!c,u.push(d)):c||d===""||h===""||!h||ed.test(h)||ed.test(d)||n1.test(d)||e1.test(d)||t1.test(d)||YA.test(d)||JA.test(d)||ZA.test(d)||!a||Om.test(d)||Im.test(d)||$m(Im).test(h)||$m(Om).test(h)||td.test(h)?u.push(d):u[u.length-1]=h+" "+d.trimStart()}return u.join(`
|
|
36
36
|
`)})(e,o);return KA(t,r)(i,n)}function xM(e=ys,t,n=!1){return(function(o,i=!1){const s=Bf(o),a=[...s.multilineElement,...s.element],l=!i,c=s.textFormat.filter(u=>u.format.length===1).sort((u,f)=>Number(u.format.includes("code"))-Number(f.format.includes("code")));return u=>{const f=[],d=(u||Ke()).getChildren();for(let h=0;h<d.length;h++){const g=d[h],p=WA(g,a,c,s.textMatch);p!=null&&f.push(l&&h>0&&!Qu(g)&&!Qu(d[h-1])?`
|
|
37
37
|
`.concat(p):p)}return f.join(`
|
|
38
|
-
`)}})(e,n)(t)}function bM({defaultSelection:e}){const[t]=nt();return C.useEffect(()=>{t.focus(()=>{const n=document.activeElement,r=t.getRootElement();r===null||n!==null&&r.contains(n)||r.focus({preventScroll:!0})},{defaultSelection:e})},[e,t]),null}const a1=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,CM=a1?C.useLayoutEffect:C.useEffect,Bs={tag:Vo};function wM({initialConfig:e,children:t}){const n=C.useMemo(()=>{const{theme:r,namespace:o,nodes:i,onError:s,editorState:a,html:l}=e,c=KR(null,r),u=j_({editable:e.editable,html:l,namespace:o,nodes:i,onError:f=>s(f,u),theme:r});return(function(f,d){if(d!==null){if(d===void 0)f.update(()=>{const h=Ke();if(h.isEmpty()){const g=me();h.append(g);const p=a1?document.activeElement:null;(G()!==null||p!==null&&p===f.getRootElement())&&g.select()}},Bs);else if(d!==null)switch(typeof d){case"string":{const h=f.parseEditorState(d);f.setEditorState(h,Bs);break}case"object":f.setEditorState(d,Bs);break;case"function":f.update(()=>{Ke().isEmpty()&&d(f)},Bs)}}})(u,a),[u,c]},[]);return CM(()=>{const r=e.editable,[o]=n;o.setEditable(r===void 0||r)},[]),S.jsx(W0.Provider,{value:n,children:t})}function SM(){return Ke().getTextContent()}function EM(e,t=!0){if(e)return!1;let n=SM();return t&&(n=n.trim()),n===""}function TM(e){if(!EM(e,!1))return!1;const t=Ke().getChildren(),n=t.length;if(n>1)return!1;for(let r=0;r<n;r++){const o=t[r];if(Ce(o))return!1;if(V(o)){if(!Sr(o)||o.__indent!==0)return!1;const i=o.getChildren(),s=i.length;for(let a=0;a<s;a++){const l=i[r];if(!Y(l))return!1}}}return!0}function l1(e){return()=>TM(e)}function RM(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function kM(e,t,n,r){const o=s=>s instanceof n,i=s=>{const a=Pe(s.getTextContent());a.setFormat(s.getFormat()),s.replace(a)};return[e.registerNodeTransform(Gt,s=>{if(!s.isSimpleText())return;let a,l=s.getPreviousSibling(),c=s.getTextContent(),u=s;if(Y(l)){const d=l.getTextContent(),h=t(d+c);if(o(l)){if(h===null||(g=>g.getLatest().__mode)(l)!==0)return void i(l);{const g=h.end-d.length;if(g>0){const p=d+c.slice(0,g);if(l.select(),l.setTextContent(p),g===c.length)s.remove();else{const m=c.slice(g);s.setTextContent(m)}return}}}else if(h===null||h.start<d.length)return}let f=0;for(;;){a=t(c);let d,h=a===null?"":c.slice(a.end);if(c=h,h===""){const p=u.getNextSibling();if(Y(p)){h=u.getTextContent()+p.getTextContent();const m=t(h);if(m===null)return void(o(p)?i(p):p.markDirty());if(m.start!==0)return}}if(a===null)return;if(a.start===0&&Y(l)&&l.isTextEntity()){f+=a.end;continue}a.start===0?[d,u]=u.splitText(a.end):[,d,u]=u.splitText(a.start+f,a.end+f),d===void 0&&RM(165,"nodeToReplace");const g=r(d);if(g.setFormat(d.getFormat()),d.replace(g),u==null)return;f=0,l=g}}),e.registerNodeTransform(n,s=>{const a=s.getTextContent(),l=t(a);if(l===null||l.start!==0)return void i(s);if(a.length>l.end)return void s.splitText(l.end);const c=s.getPreviousSibling();Y(c)&&c.isTextEntity()&&(i(c),i(s));const u=s.getNextSibling();Y(u)&&u.isTextEntity()&&(i(u),o(s)&&i(s))})]}let gl=class c1 extends Gt{static getType(){return"hashtag"}static clone(t){return new c1(t.__text,t.__key)}createDOM(t){const n=super.createDOM(t);return Ye(n,t.theme.hashtag),n}static importJSON(t){return u1().updateFromJSON(t)}canInsertTextBefore(){return!1}isTextEntity(){return!0}};function u1(e=""){return vt(new gl(e))}const AM=new RegExp((function(){const{alpha:e,alphanumeric:t,hashChars:n}=(function(){const o=String.fromCharCode,i="A-Za-zªµºÀ-ÖØ-öø-Ɂɐ-ˁˆ-ˑˠ-ˤˮͺΆΈ-ΊΌΎ-ΡΣ-ώϐ-ϵϷ-ҁҊ-ӎӐ-ӹԀ-ԏԱ-Ֆՙա-ևא-תװ-ײء-غـ-يٮ-ٯٱ-ۓەۥ-ۦۮ-ۯۺ-ۼۿܐܒ-ܯݍ-ݭހ-ޥޱऄ-हऽॐक़-ॡॽঅ-ঌএ-ঐও-নপ-রলশ-হঽৎড়-ঢ়য়-ৡৰ-ৱਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલ-ળવ-હઽૐૠ-ૡଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହଽଡ଼-ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கங-சஜஞ-டண-தந-பம-ஹఅ-ఌఎ-ఐఒ-నప-ళవ-హౠ-ౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠ-ೡഅ-ഌഎ-ഐഒ-നപ-ഹൠ-ൡඅ-ඖක-නඳ-රලව-ෆก-ะา-ำเ-ๆກ-ຂຄງ-ຈຊຍດ-ທນ-ຟມ-ຣລວສ-ຫອ-ະາ-ຳຽເ-ໄໆໜ-ໝༀཀ-ཇཉ-ཪྈ-ྋက-အဣ-ဧဩ-ဪၐ-ၕႠ-Ⴥა-ჺჼᄀ-ᅙᅟ-ᆢᆨ-ᇹሀ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙶᚁ-ᚚᚠ-ᛪᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦩᧁ-ᧇᨀ-ᨖᴀ-ᶿḀ-ẛẠ-ỹἀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₔℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℱℳ-ℹℼ-ℿⅅ-ⅉⰀ-Ⱞⰰ-ⱞⲀ-ⳤⴀ-ⴥⴰ-ⵥⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〆〱-〵〻-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄬㄱ-ㆎㆠ-ㆷㇰ-ㇿ㐀-䶵一-龻ꀀ-ꒌꠀ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢ가-힣豈-鶴侮-頻並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵÀ-ÖØ-öø-ÿĀ-ɏɓ-ɔɖ-ɗəɛɣɨɯɲʉʋʻ̀-ͯḀ-ỿЀ-ӿԀ-ԧⷠ-ⷿꙀ-֑ꚟ-ֿׁ-ׂׄ-ׇׅא-תװ-״-ﬨשׁ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﭏؐ-ؚؠ-ٟٮ-ۓە-ۜ۞-۪ۨ-ۯۺ-ۼۿݐ-ݿࢠࢢ-ࢬࣤ-ࣾﭐ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼ-ก-ฺเ-๎ᄀ-ᇿ-ㆅꥠ-가-ힰ-ᄀ-ᅵァ-ヺー-ヾヲ-゚0-9A-Za-zぁ-ゖ゙-ゞ㐀-䶿一-鿿"+o(173824)+"-"+o(177983)+o(177984)+"-"+o(178207)+o(194560)+"-"+o(195103)+"〃々〻";return{alpha:i,alphanumeric:i+"̀-ͯ҃-֑҆-ֹֻ-ֽֿׁ-ׂׄ-ׇׅؐ-ًؕ-ٰٞۖ-ۜ۟-ۤۧ-۪ۨ-ܑۭܰ-݊ަ-ްँ-ः़ा-्॑-॔ॢ-ॣঁ-ঃ়া-ৄে-ৈো-্ৗৢ-ৣਁ-ਃ਼ਾ-ੂੇ-ੈੋ-੍ੰ-ੱઁ-ઃ઼ા-ૅે-ૉો-્ૢ-ૣଁ-ଃ଼ା-ୃେ-ୈୋ-୍ୖ-ୗஂா-ூெ-ைொ-்ௗఁ-ఃా-ౄె-ైొ-్ౕ-ౖಂ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕ-ೖം-ഃാ-ൃെ-ൈൊ-്ൗං-ඃ්ා-ුූෘ-ෟෲ-ෳัิ-ฺ็-๎ັິ-ູົ-ຼ່-ໍ༘-༹༙༵༷༾-༿ཱ-྄྆-྇ྐ-ྗྙ-ྼ࿆ာ-ဲံ-္ၖ-ၙ፟ᜒ-᜔ᜲ-᜴ᝒ-ᝓᝲ-ᝳា-៓៝᠋-᠍ᢩᤠ-ᤫᤰ-᤻ᦰ-ᧀᧈ-ᧉᨗ-ᨛ᷀-᷃⃐-⃥⃜⃡-⃫〪-゙〯-゚ꠂ꠆ꠋꠣ-ꠧﬞ︀-️︠-︣0-9٠-٩۰-۹०-९০-৯੦-੯૦-૯୦-୯௦-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩၀-၉០-៩᠐-᠙᥆-᥏᧐-᧙0-9_",hashChars:"#\\uFF03"}})(),r="["+t+"]";return"("+("^|$|[^&/"+t+"]")+")("+("["+n+"]")+")("+r+"*"+("["+e+"]")+r+"*)"})(),"i"),MM={getHashtagMatch:function(e){const t=AM.exec(e);if(t===null)return null;const n=t[3].length+1,r=t.index+t[1].length;return{end:r+n,start:r}}};function NM(e,t=MM){return cn(...kM(e,t.getHashtagMatch,gl,n=>u1(n.getTextContent())))}function PM(){const[e]=nt();return C.useEffect(()=>{if(!e.hasNodes([gl]))throw new Error("HashtagPlugin: HashtagNode not registered on editor");return NM(e)},[e]),null}function FM({hasStrictIndent:e=!1}){const[t]=nt();return C.useEffect(()=>{if(!t.hasNodes([uo,Er]))throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[t]),C.useEffect(()=>{if(e)return cA(t)},[t,e]),(function(n){C.useEffect(()=>lA(n),[n])})(t),null}function Vm(e,t){return e.getEditorState().read(()=>{const n=Me(t);return n!==null&&n.isSelected()})}function LM(e){const[t]=nt(),[n,r]=C.useState(()=>Vm(t,e));return C.useEffect(()=>{let o=!0;const i=t.registerUpdateListener(()=>{o&&r(Vm(t,e))});return()=>{o=!1,i()}},[t,e]),[n,C.useCallback(o=>{t.update(()=>{let i=G();gt(i)||(i=gf(),He(i)),gt(i)&&(o?i.add(e):i.delete(e))})},[t,e]),C.useCallback(()=>{t.update(()=>{const o=G();gt(o)&&o.clear()})},[t])]}function OM({nodeKey:e}){const[t]=nt(),[n,r,o]=LM(e);return C.useEffect(()=>cn(t.registerCommand(Za,i=>{const s=t.getElementByKey(e);return i.target===s&&(i.shiftKey||o(),r(!n),!0)},jn)),[o,t,n,e,r]),C.useEffect(()=>{const i=t.getElementByKey(e),s=t._config.theme.hrSelected??"selected";i!==null&&(n?Ye(i,s):Rn(i,s))},[t,n,e]),null}let d1=class f1 extends $f{static getType(){return"horizontalrule"}static clone(t){return new f1(t.__key)}static importJSON(t){return Wf().updateFromJSON(t)}static importDOM(){return{hr:()=>({conversion:IM,priority:0})}}decorate(){return S.jsx(OM,{nodeKey:this.__key})}};function IM(){return{node:Wf()}}function Wf(){return vt(new d1)}const $M=[{dependencies:[d1],export:e=>Z3(e)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(e,t,n,r)=>{const o=Wf();r||e.getNextSibling()!=null?e.replace(o):e.insertBefore(o),o.selectNext()},type:"element"},...ys];function DM({transformers:e=$M}){const[t]=nt();return C.useEffect(()=>vM(t,e),[t,e]),null}const VM=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?C.useLayoutEffect:C.useEffect;function jM({ignoreHistoryMergeTagChange:e=!0,ignoreSelectionChange:t=!1,onChange:n}){const[r]=nt();return VM(()=>{if(n)return r.registerUpdateListener(({editorState:o,dirtyElements:i,dirtyLeaves:s,prevEditorState:a,tags:l})=>{t&&i.size===0&&s.size===0||e&&l.has(Vo)||a.isEmpty()||n(o,r,l)})},[r,e,t,n]),null}const Hf=/^(\d+(?:\.\d+)?)px$/,et={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class un extends yt{__colSpan;__rowSpan;__headerState;__width;__backgroundColor;__verticalAlign;static getType(){return"tablecell"}static clone(t){return new un(t.__headerState,t.__colSpan,t.__width,t.__key)}afterCloneFrom(t){super.afterCloneFrom(t),this.__rowSpan=t.__rowSpan,this.__backgroundColor=t.__backgroundColor,this.__verticalAlign=t.__verticalAlign}static importDOM(){return{td:t=>({conversion:jm,priority:0}),th:t=>({conversion:jm,priority:0})}}static importJSON(t){return Kt().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setHeaderStyles(t.headerState).setColSpan(t.colSpan||1).setRowSpan(t.rowSpan||1).setWidth(t.width||void 0).setBackgroundColor(t.backgroundColor||null).setVerticalAlign(t.verticalAlign||void 0)}constructor(t=et.NO_STATUS,n=1,r,o){super(o),this.__colSpan=n,this.__rowSpan=1,this.__headerState=t,this.__width=r,this.__backgroundColor=null,this.__verticalAlign=void 0}createDOM(t){const n=document.createElement(this.getTag());return this.__width&&(n.style.width=`${this.__width}px`),this.__colSpan>1&&(n.colSpan=this.__colSpan),this.__rowSpan>1&&(n.rowSpan=this.__rowSpan),this.__backgroundColor!==null&&(n.style.backgroundColor=this.__backgroundColor),nd(this.__verticalAlign)&&(n.style.verticalAlign=this.__verticalAlign),Ye(n,t.theme.tableCell,this.hasHeader()&&t.theme.tableCellHeader),n}exportDOM(t){const n=super.exportDOM(t);if(je(n.element)){const r=n.element;r.setAttribute("data-temporary-table-cell-lexical-key",this.getKey()),r.style.border="1px solid black",this.__colSpan>1&&(r.colSpan=this.__colSpan),this.__rowSpan>1&&(r.rowSpan=this.__rowSpan),r.style.width=`${this.getWidth()||75}px`,r.style.verticalAlign=this.getVerticalAlign()||"top",r.style.textAlign="start",this.__backgroundColor===null&&this.hasHeader()&&(r.style.backgroundColor="#f2f3f5")}return n}exportJSON(){return{...super.exportJSON(),...nd(this.__verticalAlign)&&{verticalAlign:this.__verticalAlign},backgroundColor:this.getBackgroundColor(),colSpan:this.__colSpan,headerState:this.__headerState,rowSpan:this.__rowSpan,width:this.getWidth()}}getColSpan(){return this.getLatest().__colSpan}setColSpan(t){const n=this.getWritable();return n.__colSpan=t,n}getRowSpan(){return this.getLatest().__rowSpan}setRowSpan(t){const n=this.getWritable();return n.__rowSpan=t,n}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(t,n=et.BOTH){const r=this.getWritable();return r.__headerState=t&n|r.__headerState&~n,r}getHeaderStyles(){return this.getLatest().__headerState}setWidth(t){const n=this.getWritable();return n.__width=t,n}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(t){const n=this.getWritable();return n.__backgroundColor=t,n}getVerticalAlign(){return this.getLatest().__verticalAlign}setVerticalAlign(t){const n=this.getWritable();return n.__verticalAlign=t||void 0,n}toggleHeaderStyle(t){const n=this.getWritable();return(n.__headerState&t)===t?n.__headerState-=t:n.__headerState+=t,n}hasHeaderState(t){return(this.getHeaderStyles()&t)===t}hasHeader(){return this.getLatest().__headerState!==et.NO_STATUS}updateDOM(t){return t.__headerState!==this.__headerState||t.__width!==this.__width||t.__colSpan!==this.__colSpan||t.__rowSpan!==this.__rowSpan||t.__backgroundColor!==this.__backgroundColor||t.__verticalAlign!==this.__verticalAlign}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}}function nd(e){return e==="middle"||e==="bottom"}function jm(e){const t=e,n=e.nodeName.toLowerCase();let r;Hf.test(t.style.width)&&(r=parseFloat(t.style.width));const o=Kt(n==="th"?et.ROW:et.NO_STATUS,t.colSpan,r);o.__rowSpan=t.rowSpan;const i=t.style.backgroundColor;i!==""&&(o.__backgroundColor=i);const s=t.style.verticalAlign;nd(s)&&(o.__verticalAlign=s);const a=t.style,l=(a&&a.textDecoration||"").split(" "),c=a.fontWeight==="700"||a.fontWeight==="bold",u=l.includes("line-through"),f=a.fontStyle==="italic",d=l.includes("underline");return{after:h=>{const g=[];let p=null;const m=()=>{if(p){const _=p.getFirstChild();wn(_)&&p.getChildrenSize()===1&&_.remove()}};for(const _ of h)a3(_)||Y(_)||wn(_)?(Y(_)&&(c&&_.toggleFormat("bold"),u&&_.toggleFormat("strikethrough"),f&&_.toggleFormat("italic"),d&&_.toggleFormat("underline")),p?p.append(_):(p=me().append(_),g.push(p))):(g.push(_),m(),p=null);return m(),g.length===0&&g.push(me()),g},node:o}}function Kt(e=et.NO_STATUS,t=1,n){return vt(new un(e,t,n))}function fe(e){return e instanceof un}const h1=ie("INSERT_TABLE_COMMAND");function ue(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}class yr extends yt{__height;static getType(){return"tablerow"}static clone(t){return new yr(t.__height,t.__key)}static importDOM(){return{tr:t=>({conversion:BM,priority:0})}}static importJSON(t){return Zo().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setHeight(t.height)}constructor(t,n){super(n),this.__height=t}exportJSON(){const t=this.getHeight();return{...super.exportJSON(),...t===void 0?void 0:{height:t}}}createDOM(t){const n=document.createElement("tr");return this.__height&&(n.style.height=`${this.__height}px`),Ye(n,t.theme.tableRow),n}extractWithChild(t,n,r){return r==="html"}isShadowRoot(){return!0}setHeight(t){const n=this.getWritable();return n.__height=t,n}getHeight(){return this.getLatest().__height}updateDOM(t){return t.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function BM(e){const t=e;let n;return Hf.test(t.style.height)&&(n=parseFloat(t.style.height)),{after:r=>bx(r,fe),node:Zo(n)}}function Zo(e){return vt(new yr(e))}function Xe(e){return e instanceof yr}const Kf=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,zM=Kf&&"documentMode"in document?document.documentMode:null,Bm=Kf&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);function WM(e,t,n=!0){const r=ml();for(let o=0;o<e;o++){const i=Zo();for(let s=0;s<t;s++){let a=et.NO_STATUS;typeof n=="object"?(o===0&&n.rows&&(a|=et.ROW),s===0&&n.columns&&(a|=et.COLUMN)):n&&(o===0&&(a|=et.ROW),s===0&&(a|=et.COLUMN));const l=Kt(a),c=me();c.append(Pe()),l.append(c),i.append(l)}r.append(i)}return r}function HM(e){const t=xe(e,n=>Ge(n));if(Ge(t))return t;throw new Error("Expected table cell to be inside of table.")}Kf&&"InputEvent"in window&&!zM&&new window.InputEvent("input");const rd=(e,t)=>e===et.BOTH||e===t?t:et.NO_STATUS;function KM(e,t=!0){const[,,n]=xn(e),[r,o]=zt(n,e,e),i=r[0].length,{startRow:s}=o;let a=null;if(t){const l=s+e.__rowSpan-1,c=r[l],u=Zo();for(let d=0;d<i;d++){const{cell:h,startRow:g}=c[d];if(g+h.__rowSpan-1<=l){const p=c[d].cell.__headerState,m=rd(p,et.COLUMN);u.append(Kt(m).append(me()))}else h.setRowSpan(h.__rowSpan+1)}const f=n.getChildAtIndex(l);Xe(f)||ue(256),f.insertAfter(u),a=u}else{const l=s,c=r[l],u=Zo();for(let d=0;d<i;d++){const{cell:h,startRow:g}=c[d];if(g===l){const p=c[d].cell.__headerState,m=rd(p,et.COLUMN);u.append(Kt(m).append(me()))}else h.setRowSpan(h.__rowSpan+1)}const f=n.getChildAtIndex(l);Xe(f)||ue(257),f.insertBefore(u),a=u}return a}function UM(e,t=!0,n=!0){const[,,r]=xn(e),[o,i]=zt(r,e,e),s=o.length,{startColumn:a}=i,l=t?a+e.__colSpan-1:a-1,c=r.getFirstChild();Xe(c)||ue(120);let u=null;function f(g=et.NO_STATUS){const p=Kt(g).append(me());return u===null&&(u=p),p}let d=c;e:for(let g=0;g<s;g++){if(g!==0){const b=d.getNextSibling();Xe(b)||ue(121),d=b}const p=o[g],m=p[l<0?0:l].cell.__headerState,_=rd(m,et.ROW);if(l<0){g1(d,f(_));continue}const{cell:y,startColumn:v,startRow:x}=p[l];if(v+y.__colSpan-1<=l){let b=y,w=x,T=l;for(;w!==g&&b.__rowSpan>1;){if(T-=y.__colSpan,!(T>=0)){d.append(f(_));continue e}{const{cell:E,startRow:R}=p[T];b=E,w=R}}b.insertAfter(f(_))}else y.setColSpan(y.__colSpan+1)}u!==null&&n&&GM(u);const h=r.getColWidths();if(h){const g=[...h],p=l<0?0:l,m=g[p];g.splice(p,0,m),r.setColWidths(g)}return u}function GM(e){const t=e.getFirstDescendant();t==null?e.selectStart():t.getParentOrThrow().selectStart()}function g1(e,t){const n=e.getFirstChild();n!==null?n.insertBefore(t):e.append(t)}function qM(e){if(e.length===0)return null;const t=HM(e[0]),[n]=sr(t,null,null);let r=1/0,o=-1/0,i=1/0,s=-1/0;const a=new Set;for(const h of n)for(const g of h){if(!g||!g.cell)continue;const p=g.cell.getKey();if(!a.has(p)&&e.some(m=>m.is(g.cell))){a.add(p);const m=g.startRow,_=g.startColumn,y=g.cell.__rowSpan||1,v=g.cell.__colSpan||1;r=Math.min(r,m),o=Math.max(o,m+y-1),i=Math.min(i,_),s=Math.max(s,_+v-1)}}if(r===1/0||i===1/0)return null;const l=o-r+1,c=s-i+1,u=n[r][i];if(!u.cell)return null;const f=u.cell;f.setColSpan(c),f.setRowSpan(l);const d=new Set([f.getKey()]);for(let h=r;h<=o;h++)for(let g=i;g<=s;g++){const p=n[h][g];if(!p.cell)continue;const m=p.cell,_=m.getKey();d.has(_)||(d.add(_),YM(m)||f.append(...m.getChildren()),m.remove())}return f.getChildrenSize()===0&&f.append(me()),f}function YM(e){if(e.getChildrenSize()!==1)return!1;const t=e.getFirstChildOrThrow();return!(!Sr(t)||!t.isEmpty())}function XM(e){const[t,n,r]=xn(e),o=t.__colSpan,i=t.__rowSpan;if(o===1&&i===1)return;const[s,a]=zt(r,t,t),{startColumn:l,startRow:c}=a,u=t.__headerState&et.COLUMN,f=Array.from({length:o},(g,p)=>{let m=u;for(let _=0;m!==0&&_<s.length;_++)m&=s[_][p+l].cell.__headerState;return m}),d=t.__headerState&et.ROW,h=Array.from({length:i},(g,p)=>{let m=d;for(let _=0;m!==0&&_<s[0].length;_++)m&=s[p+c][_].cell.__headerState;return m});if(o>1){for(let g=1;g<o;g++)t.insertAfter(Kt(f[g]|h[0]).append(me()));t.setColSpan(1)}if(i>1){let g;for(let p=1;p<i;p++){const m=c+p,_=s[m];g=(g||n).getNextSibling(),Xe(g)||ue(125);let y=null;for(let v=0;v<l;v++){const x=_[v],b=x.cell;x.startRow===m&&(y=b),b.__colSpan>1&&(v+=b.__colSpan-1)}if(y===null)for(let v=o-1;v>=0;v--)g1(g,Kt(f[v]|h[p]).append(me()));else for(let v=o-1;v>=0;v--)y.insertAfter(Kt(f[v]|h[p]).append(me()))}t.setRowSpan(1)}}function zt(e,t,n){const[r,o,i]=sr(e,t,n);return o===null&&ue(207),i===null&&ue(208),[r,o,i]}function sr(e,t,n){const r=[];let o=null,i=null;function s(l){let c=r[l];return c===void 0&&(r[l]=c=[]),c}const a=e.getChildren();for(let l=0;l<a.length;l++){const c=a[l];Xe(c)||ue(209);const u=s(l);for(let f=c.getFirstChild(),d=0;f!=null;f=f.getNextSibling()){for(fe(f)||ue(147);u[d]!==void 0;)d++;const h={cell:f,startColumn:d,startRow:l},{__rowSpan:g,__colSpan:p}=f;for(let m=0;m<g&&!(l+m>=a.length);m++){const _=s(l+m);for(let y=0;y<p;y++)_[d+y]=h}t!==null&&o===null&&t.is(f)&&(o=h),n!==null&&i===null&&n.is(f)&&(i=h)}}return[r,o,i]}function xn(e){let t;if(e instanceof un)t=e;else if("__type"in e){const o=xe(e,fe);fe(o)||ue(148),t=o}else{const o=xe(e.getNode(),fe);fe(o)||ue(148),t=o}const n=t.getParent();Xe(n)||ue(149);const r=n.getParent();return Ge(r)||ue(210),[t,n,r]}function Da(e,t,n){let r,o=Math.min(t.startColumn,n.startColumn),i=Math.min(t.startRow,n.startRow),s=Math.max(t.startColumn+t.cell.__colSpan-1,n.startColumn+n.cell.__colSpan-1),a=Math.max(t.startRow+t.cell.__rowSpan-1,n.startRow+n.cell.__rowSpan-1);do{r=!1;for(let l=0;l<e.length;l++)for(let c=0;c<e[0].length;c++){const u=e[l][c];if(!u)continue;const f=u.startColumn+u.cell.__colSpan-1,d=u.startRow+u.cell.__rowSpan-1,h=u.startColumn<=s&&f>=o,g=u.startRow<=a&&d>=i;if(h&&g){const p=Math.min(o,u.startColumn),m=Math.max(s,f),_=Math.min(i,u.startRow),y=Math.max(a,d);p===o&&m===s&&_===i&&y===a||(o=p,s=m,i=_,a=y,r=!0)}}}while(r);return{maxColumn:s,maxRow:a,minColumn:o,minRow:i}}function zm(e){const[t,,n]=xn(e),r=n.getChildren(),o=r.length,i=r[0].getChildren().length,s=new Array(o);for(let a=0;a<o;a++)s[a]=new Array(i);for(let a=0;a<o;a++){const l=r[a].getChildren();let c=0;for(let u=0;u<l.length;u++){for(;s[a][c];)c++;const f=l[u],d=f.__rowSpan||1,h=f.__colSpan||1;for(let g=0;g<d;g++)for(let p=0;p<h;p++)s[a+g][c+p]=f;if(t===f)return{colSpan:h,columnIndex:c,rowIndex:a,rowSpan:d};c+=h}}return null}function Wm(e){const[[t,n,r,o],[i,s,a,l]]=["anchor","focus"].map(c=>{const u=e[c].getNode(),f=xe(u,fe);fe(f)||ue(238,c,u.getKey(),u.getType());const d=f.getParent();Xe(d)||ue(239,c);const h=d.getParent();return Ge(h)||ue(240,c),[u,f,d,h]});return o.is(l)||ue(241),{anchorCell:n,anchorNode:t,anchorRow:r,anchorTable:o,focusCell:s,focusNode:i,focusRow:a,focusTable:l}}class pl{tableKey;anchor;focus;_cachedNodes;dirty;constructor(t,n,r){this.anchor=n,this.focus=r,n._selection=this,r._selection=this,this._cachedNodes=null,this.dirty=!1,this.tableKey=t}getStartEndPoints(){return[this.anchor,this.focus]}isValid(){if(this.tableKey==="root"||this.anchor.key==="root"||this.anchor.type!=="element"||this.focus.key==="root"||this.focus.type!=="element")return!1;const t=Me(this.tableKey),n=Me(this.anchor.key),r=Me(this.focus.key);return t!==null&&n!==null&&r!==null}isBackward(){return this.focus.isBefore(this.anchor)}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){return Ve(t)&&this.tableKey===t.tableKey&&this.anchor.is(t.anchor)&&this.focus.is(t.focus)}set(t,n,r){this.dirty=this.dirty||t!==this.tableKey||n!==this.anchor.key||r!==this.focus.key,this.tableKey=t,this.anchor.key=n,this.focus.key=r,this._cachedNodes=null}clone(){return new pl(this.tableKey,Pt(this.anchor.key,this.anchor.offset,this.anchor.type),Pt(this.focus.key,this.focus.offset,this.focus.type))}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(t){}insertText(){}hasFormat(t){let n=0;this.getNodes().filter(fe).forEach(o=>{const i=o.getFirstChild();Sr(i)&&(n|=i.getTextFormat())});const r=gr[t];return(n&r)!==0}insertNodes(t){const n=this.focus.getNode();V(n)||ue(151),qi(n.select(0,n.getChildrenSize())).insertNodes(t)}getShape(){const{anchorCell:t,focusCell:n}=Wm(this),r=zm(t);r===null&&ue(153);const o=zm(n);o===null&&ue(155);const i=Math.min(r.columnIndex,o.columnIndex),s=Math.max(r.columnIndex+r.colSpan-1,o.columnIndex+o.colSpan-1),a=Math.min(r.rowIndex,o.rowIndex),l=Math.max(r.rowIndex+r.rowSpan-1,o.rowIndex+o.rowSpan-1);return{fromX:Math.min(i,s),fromY:Math.min(a,l),toX:Math.max(i,s),toY:Math.max(a,l)}}getNodes(){if(!this.isValid())return[];const t=this._cachedNodes;if(t!==null)return t;const{anchorTable:n,anchorCell:r,focusCell:o}=Wm(this),i=o.getParents()[1];if(i!==n){if(n.isParentOf(o)){const m=i.getParent();m==null&&ue(159),this.set(this.tableKey,o.getKey(),m.getKey())}else{const m=n.getParent();m==null&&ue(158),this.set(this.tableKey,m.getKey(),o.getKey())}return this.getNodes()}const[s,a,l]=zt(n,r,o),{minColumn:c,maxColumn:u,minRow:f,maxRow:d}=Da(s,a,l),h=new Map([[n.getKey(),n]]);let g=null;for(let m=f;m<=d;m++)for(let _=c;_<=u;_++){const{cell:y}=s[m][_],v=y.getParent();Xe(v)||ue(160),v!==g&&(h.set(v.getKey(),v),g=v),h.has(y.getKey())||ZM(y,x=>{h.set(x.getKey(),x)})}const p=Array.from(h.values());return li()||(this._cachedNodes=p),p}getTextContent(){const t=this.getNodes().filter(r=>fe(r));let n="";for(let r=0;r<t.length;r++){const o=t[r],i=o.__parent,s=(t[r+1]||{}).__parent;n+=o.getTextContent()+(s!==i?`
|
|
39
|
-
`:" ")}return n}}function Ve(e){return e instanceof pl}function p1(){const e=Pt("root",0,"element"),t=Pt("root",0,"element");return new pl("root",e,t)}function JM(e,t,n){e.getKey(),t.getKey(),n.getKey();const r=G(),o=Ve(r)?r.clone():p1();return o.set(e.getKey(),t.getKey(),n.getKey()),o}function ZM(e,t){const n=[[e]];for(let r=n.at(-1);r!==void 0&&n.length>0;r=n.at(-1)){const o=r.pop();o===void 0?n.pop():t(o)!==!1&&V(o)&&n.push(o.getChildren())}}function m1(e,t=ui()){const n=Me(e);Ge(n)||ue(231,e);const r=no(n,t.getElementByKey(e));return r===null&&ue(232,e),{tableElement:r,tableNode:n}}class QM{focusX;focusY;listenersToRemove;table;isHighlightingCells;anchorX;anchorY;tableNodeKey;anchorCell;focusCell;anchorCellNodeKey;focusCellNodeKey;editor;tableSelection;hasHijackedSelectionStyles;isSelecting;pointerType;shouldCheckSelection;abortController;listenerOptions;nextFocus;constructor(t,n){this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.listenersToRemove=new Set,this.tableNodeKey=n,this.editor=t,this.table={columns:0,domRows:[],rows:0},this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.isSelecting=!1,this.pointerType=null,this.shouldCheckSelection=!1,this.abortController=new AbortController,this.listenerOptions={signal:this.abortController.signal},this.nextFocus=null,this.trackTable()}getTable(){return this.table}removeListeners(){this.abortController.abort("removeListeners"),Array.from(this.listenersToRemove).forEach(t=>t()),this.listenersToRemove.clear()}$lookup(){return m1(this.tableNodeKey,this.editor)}trackTable(){const t=new MutationObserver(n=>{this.editor.getEditorState().read(()=>{let r=!1;for(let s=0;s<n.length;s++){const a=n[s].target.nodeName;if(a==="TABLE"||a==="TBODY"||a==="THEAD"||a==="TR"){r=!0;break}}if(!r)return;const{tableNode:o,tableElement:i}=this.$lookup();this.table=zo(o,i)},{editor:this.editor})});this.editor.getEditorState().read(()=>{const{tableNode:n,tableElement:r}=this.$lookup();this.table=zo(n,r),t.observe(r,{attributes:!0,childList:!0,subtree:!0})},{editor:this.editor})}$clearHighlight(){const t=this.editor;this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.$enableHighlightStyle();const{tableNode:n,tableElement:r}=this.$lookup();zs(t,zo(n,r),null),G()!==null&&(He(null),t.dispatchCommand(zn,void 0))}$enableHighlightStyle(){const t=this.editor,{tableElement:n}=this.$lookup();Rn(n,t._config.theme.tableSelection),n.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1}$disableHighlightStyle(){const{tableElement:t}=this.$lookup();Ye(t,this.editor._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0}$updateTableTableSelection(t){if(t!==null){t.tableKey!==this.tableNodeKey&&ue(233,t.tableKey,this.tableNodeKey);const n=this.editor;this.tableSelection=t,this.isHighlightingCells=!0,this.$disableHighlightStyle(),this.updateDOMSelection(),zs(n,this.table,this.tableSelection)}else this.$clearHighlight()}setShouldCheckSelection(){this.shouldCheckSelection=!0}getAndClearShouldCheckSelection(){return!!this.shouldCheckSelection&&(this.shouldCheckSelection=!1,!0)}setNextFocus(t){this.nextFocus=t}getAndClearNextFocus(){const{nextFocus:t}=this;return t!==null&&(this.nextFocus=null),t}updateDOMSelection(){if(this.anchorCell!==null&&this.focusCell!==null){const t=St(this.editor._window);t&&t.rangeCount>0&&t.removeAllRanges()}}$setFocusCellForSelection(t,n=!1){const r=this.editor,{tableNode:o}=this.$lookup(),i=t.x,s=t.y;if(this.focusCell=t,this.isHighlightingCells||this.anchorX===i&&this.anchorY===s&&!n){if(i===this.focusX&&s===this.focusY)return!1}else this.isHighlightingCells=!0,this.$disableHighlightStyle();if(this.focusX=i,this.focusY=s,this.isHighlightingCells){const a=id(o,t.elem);if(this.tableSelection!=null&&this.anchorCellNodeKey!=null&&a!==null)return this.focusCellNodeKey=a.getKey(),this.tableSelection=JM(o,this.$getAnchorTableCellOrThrow(),a),He(this.tableSelection),r.dispatchCommand(zn,void 0),zs(r,this.table,this.tableSelection),!0}return!1}$getAnchorTableCell(){return this.anchorCellNodeKey?Me(this.anchorCellNodeKey):null}$getAnchorTableCellOrThrow(){const t=this.$getAnchorTableCell();return t===null&&ue(234),t}$getFocusTableCell(){return this.focusCellNodeKey?Me(this.focusCellNodeKey):null}$getFocusTableCellOrThrow(){const t=this.$getFocusTableCell();return t===null&&ue(235),t}$setAnchorCellForSelection(t){this.isHighlightingCells=!1,this.anchorCell=t,this.anchorX=t.x,this.anchorY=t.y;const{tableNode:n}=this.$lookup(),r=id(n,t.elem);if(r!==null){const o=r.getKey();this.tableSelection=this.tableSelection!=null?this.tableSelection.clone():p1(),this.anchorCellNodeKey=o}}$formatCells(t){const n=G();Ve(n)||ue(236);const r=ol(),o=r.anchor,i=r.focus,s=n.getNodes().filter(fe);s.length>0||ue(237);const a=s[0].getFirstChild(),l=Sr(a)?a.getFormatFlags(t,null):null;s.forEach(c=>{o.set(c.getKey(),0,"element"),i.set(c.getKey(),c.getChildrenSize(),"element"),r.formatText(t,l)}),He(n),this.editor.dispatchCommand(zn,void 0)}$clearText(){const{editor:t}=this,n=Me(this.tableNodeKey);if(!Ge(n))throw new Error("Expected TableNode.");const r=G();Ve(r)||ue(253);const o=r.getNodes().filter(fe),i=n.getFirstChild(),s=n.getLastChild();if(o.length>0&&i!==null&&s!==null&&Xe(i)&&Xe(s)&&o[0]===i.getFirstChild()&&o[o.length-1]===s.getLastChild()){n.selectPrevious();const a=n.getParent();return n.remove(),void(tt(a)&&a.isEmpty()&&t.dispatchCommand(Yr,void 0))}o.forEach(a=>{if(V(a)){const l=me(),c=Pe();l.append(c),a.append(l),a.getChildren().forEach(u=>{u!==l&&u.remove()})}}),zs(t,this.table,null),He(null),t.dispatchCommand(zn,void 0)}}const od="__lexicalTableSelection";function To(e){return je(e)&&e.nodeName==="TABLE"}function no(e,t){if(!t)return t;const n=To(t)?t:e.getDOMSlot(t).element;return n.nodeName!=="TABLE"&&ue(245,t.nodeName),n}function Uf(e){return e._window}function ji(e,t){for(let n=t,r=null;n!==null;n=n.getParent()){if(e.is(n))return r;fe(n)&&(r=n)}return null}const eN=[[cf,"down"],[lf,"up"],[af,"backward"],[sf,"forward"]],tN=[Yo,Xr,cr],nN=[Qa,df];function rN(e,t,n,r){const o=n.getRootElement(),i=Uf(n);o!==null&&i!==null||ue(246);const s=new QM(n,e.getKey()),a=no(e,t);(function(h,g){Hm(h)!==null&&ue(205),h[od]=g})(a,s),s.listenersToRemove.add(()=>(function(h,g){Hm(h)===g&&delete h[od]})(a,s));const l=h=>{if(s.pointerType=h.pointerType,h.button!==0||!tn(h.target)||!i)return;const g=Va(h.target);g!==null&&n.update(()=>{const p=An();if(Bm&&h.shiftKey&&pn(p,e)&&(W(p)||Ve(p))){const m=p.anchor.getNode(),_=ji(e,p.anchor.getNode());_?(s.$setAnchorCellForSelection(Ir(s,_)),s.$setFocusCellForSelection(g),Bn(h)):(e.isBefore(m)?e.selectStart():e.selectEnd()).anchor.set(p.anchor.key,p.anchor.offset,p.anchor.type)}else h.pointerType!=="touch"&&s.$setAnchorCellForSelection(g)}),(()=>{if(s.isSelecting)return;const p=()=>{s.isSelecting=!1,i.removeEventListener("pointerup",p),i.removeEventListener("pointermove",m)},m=_=>{if(1&~_.buttons&&s.isSelecting)return s.isSelecting=!1,i.removeEventListener("pointerup",p),void i.removeEventListener("pointermove",m);if(!tn(_.target))return;let y=null;const v=!(Bm||a.contains(_.target));if(v)y=Km(a,_.target);else for(const x of document.elementsFromPoint(_.clientX,_.clientY))if(y=Km(a,x),y)break;!y||s.focusCell!==null&&y.elem===s.focusCell.elem||(s.setNextFocus({focusCell:y,override:v}),n.dispatchCommand(zn,void 0))};s.isSelecting=!0,i.addEventListener("pointerup",p,s.listenerOptions),i.addEventListener("pointermove",m,s.listenerOptions)})()};a.addEventListener("pointerdown",l,s.listenerOptions),s.listenersToRemove.add(()=>{a.removeEventListener("pointerdown",l)});const c=h=>{h.detail>=3&&tn(h.target)&&Va(h.target)!==null&&h.preventDefault()};a.addEventListener("mousedown",c,s.listenerOptions),s.listenersToRemove.add(()=>{a.removeEventListener("mousedown",c)});const u=h=>{const g=h.target;h.button===0&&tn(g)&&n.update(()=>{const p=G();Ve(p)&&p.tableKey===s.tableNodeKey&&o.contains(g)&&s.$clearHighlight()})};i.addEventListener("pointerdown",u,s.listenerOptions),s.listenersToRemove.add(()=>{i.removeEventListener("pointerdown",u)});for(const[h,g]of eN)s.listenersToRemove.add(n.registerCommand(h,p=>_1(n,p,g,e,s),Et));s.listenersToRemove.add(n.registerCommand(uf,h=>{const g=G();if(Ve(g)){const p=ji(e,g.focus.getNode());if(p!==null)return Bn(h),p.selectEnd(),!0}return!1},Et));const f=h=>()=>{const g=G();if(!pn(g,e))return!1;if(Ve(g))return s.$clearText(),!0;if(W(g)){if(!fe(ji(e,g.anchor.getNode())))return!1;const p=g.anchor.getNode(),m=g.focus.getNode(),_=e.isParentOf(p),y=e.isParentOf(m);if(_&&!y||y&&!_)return s.$clearText(),!0;const v=xe(g.anchor.getNode(),b=>V(b)),x=v&&xe(v,b=>V(b)&&fe(b.getParent()));if(!V(x)||!V(v))return!1;if(h===Xr&&x.getPreviousSibling()===null)return!0}return!1};for(const h of tN)s.listenersToRemove.add(n.registerCommand(h,f(h),Et));const d=h=>{const g=G();if(!Ve(g)&&!W(g))return!1;const p=e.isParentOf(g.anchor.getNode());if(p!==e.isParentOf(g.focus.getNode())){const m=p?"anchor":"focus",_=p?"focus":"anchor",{key:y,offset:v,type:x}=g[_];return e[g[m].isBefore(g[_])?"selectPrevious":"selectNext"]()[_].set(y,v,x),!1}return!!pn(g,e)&&!!Ve(g)&&(h&&(h.preventDefault(),h.stopPropagation()),s.$clearText(),!0)};for(const h of nN)s.listenersToRemove.add(n.registerCommand(h,d,Et));return s.listenersToRemove.add(n.registerCommand(tl,h=>{const g=G();if(g){if(!Ve(g)&&!W(g))return!1;Xu(n,or(h,ClipboardEvent)?h:null,Wx(g));const p=d(h);return W(g)?(g.removeText(),!0):p}return!1},Et)),s.listenersToRemove.add(n.registerCommand(Rt,h=>{const g=G();if(!pn(g,e))return!1;if(Ve(g))return s.$formatCells(h),!0;if(W(g)){const p=xe(g.anchor.getNode(),m=>fe(m));if(!fe(p))return!1}return!1},Et)),s.listenersToRemove.add(n.registerCommand($o,h=>{const g=G();if(!Ve(g)||!pn(g,e))return!1;const p=g.anchor.getNode(),m=g.focus.getNode();if(!fe(p)||!fe(m))return!1;if((function(R,M){if(Ve(R)){const O=R.anchor.getNode(),D=R.focus.getNode();if(M&&O&&D){const[I]=zt(M,O,D);return O.getKey()===I[0][0].cell.getKey()&&D.getKey()===I[I.length-1].at(-1).cell.getKey()}}return!1})(g,e))return e.setFormat(h),!0;const[_,y,v]=zt(e,p,m),x=Math.max(y.startRow+y.cell.__rowSpan-1,v.startRow+v.cell.__rowSpan-1),b=Math.max(y.startColumn+y.cell.__colSpan-1,v.startColumn+v.cell.__colSpan-1),w=Math.min(y.startRow,v.startRow),T=Math.min(y.startColumn,v.startColumn),E=new Set;for(let R=w;R<=x;R++)for(let M=T;M<=b;M++){const O=_[R][M].cell;if(E.has(O))continue;E.add(O),O.setFormat(h);const D=O.getChildren();for(let I=0;I<D.length;I++){const L=D[I];V(L)&&!L.isInline()&&L.setFormat(h)}}return!0},Et)),s.listenersToRemove.add(n.registerCommand(Wr,h=>{const g=G();if(!pn(g,e))return!1;if(Ve(g))return s.$clearHighlight(),!1;if(W(g)){const p=xe(g.anchor.getNode(),m=>fe(m));if(!fe(p))return!1;if(typeof h=="string"){const m=qm(n,g,e);if(m)return Gm(m,e,[Pe(h)]),!0}}return!1},Et)),r&&s.listenersToRemove.add(n.registerCommand(ff,h=>{const g=G();if(!W(g)||!g.isCollapsed()||!pn(g,e))return!1;const p=wi(g.anchor.getNode());return!(p===null||!e.is(Wo(p)))&&(Bn(h),(function(m,_){const y=_==="next"?"getNextSibling":"getPreviousSibling",v=_==="next"?"getFirstChild":"getLastChild",x=m[y]();if(V(x))return x.selectEnd();const b=xe(m,Xe);b===null&&ue(247);for(let T=b[y]();Xe(T);T=T[y]()){const E=T[v]();if(V(E))return E.selectEnd()}const w=xe(b,Ge);w===null&&ue(248),_==="next"?w.selectNext():w.selectPrevious()})(p,h.shiftKey?"previous":"next"),!0)},Et)),s.listenersToRemove.add(n.registerCommand(y_,h=>e.isSelected(),Et)),s.listenersToRemove.add(n.registerCommand(rf,(h,g)=>{if(n!==g)return!1;const{nodes:p,selection:m}=h,_=m.getStartEndPoints(),y=Ve(m),v=W(m)&&xe(m.anchor.getNode(),te=>fe(te))!==null&&xe(m.focus.getNode(),te=>fe(te))!==null||y;if(p.length!==1||!Ge(p[0])||!v||_===null)return!1;const[x,b]=_,[w,T,E]=xn(x),R=xe(b.getNode(),te=>fe(te));if(!(fe(w)&&fe(R)&&Xe(T)&&Ge(E)))return!1;const M=p[0],[O,D,I]=zt(E,w,R),[L]=sr(M,null,null),B=O.length,K=B>0?O[0].length:0;let P=D.startRow,A=D.startColumn,$=L.length,H=$>0?L[0].length:0;if(y){const te=Da(O,D,I),ye=te.maxRow-te.minRow+1,Se=te.maxColumn-te.minColumn+1;P=te.minRow,A=te.minColumn,$=Math.min($,ye),H=Math.min(H,Se)}let Q=!1;const J=Math.min(B,P+$)-1,X=Math.min(K,A+H)-1,se=new Set;for(let te=P;te<=J;te++)for(let ye=A;ye<=X;ye++){const Se=O[te][ye];se.has(Se.cell.getKey())||Se.cell.__rowSpan===1&&Se.cell.__colSpan===1||(XM(Se.cell),se.add(Se.cell.getKey()),Q=!0)}let[re]=sr(E.getWritable(),null,null);const he=$-B+P;for(let te=0;te<he;te++)KM(re[B-1][0].cell);const we=H-K+A;for(let te=0;te<we;te++)UM(re[0][K-1].cell,!0,!1);[re]=sr(E.getWritable(),null,null);for(let te=P;te<P+$;te++)for(let ye=A;ye<A+H;ye++){const Se=te-P,$e=ye-A,ee=L[Se][$e];if(ee.startRow!==Se||ee.startColumn!==$e)continue;const pe=ee.cell;if(pe.__rowSpan!==1||pe.__colSpan!==1){const Le=[],Qn=Math.min(te+pe.__rowSpan,P+$)-1,hn=Math.min(ye+pe.__colSpan,A+H)-1;for(let gn=te;gn<=Qn;gn++)for(let Dt=ye;Dt<=hn;Dt++){const ve=re[gn][Dt];Le.push(ve.cell)}qM(Le),Q=!0}const{cell:Ne}=re[te][ye],Ze=Ne.getChildren();pe.getChildren().forEach(Le=>{Y(Le)&&me().append(Le),Ne.append(Le)}),Ze.forEach(Le=>Le.remove())}if(y&&Q){const[te]=sr(E.getWritable(),null,null);te[D.startRow][D.startColumn].cell.selectEnd()}return!0},Et)),s.listenersToRemove.add(n.registerCommand(zn,()=>{const h=G(),g=An(),p=s.getAndClearNextFocus();if(p!==null){const{focusCell:m}=p;if(Ve(h)&&h.tableKey===s.tableNodeKey)return(m.x!==s.focusX||m.y!==s.focusY)&&(s.$setFocusCellForSelection(m),!0);if(m!==s.anchorCell&&pn(h,e))return s.$setFocusCellForSelection(m),!0}if(s.getAndClearShouldCheckSelection()&&W(g)&&W(h)&&h.isCollapsed()){const m=h.anchor.getNode(),_=e.getFirstChild(),y=wi(m);if(y!==null&&Xe(_)){const v=_.getFirstChild();if(fe(v)&&e.is(xe(y,x=>x.is(e)||x.is(v))))return v.selectStart(),!0}}if(W(h)){const{anchor:m,focus:_}=h,y=m.getNode(),v=_.getNode(),x=wi(y),b=wi(v),w=!(!x||!e.is(Wo(x))),T=!(!b||!e.is(Wo(b))),E=w!==T,R=w&&T,M=h.isBackward();if(E){const O=h.clone();if(T){const[D]=zt(e,b,b),I=D[0][0].cell,L=D[D.length-1].at(-1).cell;O.focus.set(M?I.getKey():L.getKey(),M?0:L.getChildrenSize(),"element")}else if(w){const[D]=zt(e,x,x),I=D[0][0].cell,L=D[D.length-1].at(-1).cell;O.anchor.set(M?L.getKey():I.getKey(),M?L.getChildrenSize():0,"element")}He(O),Um(n,s)}else if(R&&(x.is(b)||(s.$setAnchorCellForSelection(Ir(s,x)),s.$setFocusCellForSelection(Ir(s,b),!0)),s.pointerType==="touch"&&s.isSelecting&&h.isCollapsed()&&W(g)&&g.isCollapsed())){const O=wi(g.anchor.getNode());O&&!O.is(b)&&(s.$setAnchorCellForSelection(Ir(s,O)),s.$setFocusCellForSelection(Ir(s,b),!0),s.pointerType=null)}}else if(h&&Ve(h)&&h.is(g)&&h.tableKey===e.getKey()){const m=St(i);if(m&&m.anchorNode&&m.focusNode){const _=Ft(m.focusNode),y=_&&!e.isParentOf(_),v=Ft(m.anchorNode),x=v&&e.isParentOf(v);if(y&&x&&m.rangeCount>0){const b=Uk(m,n);b&&(b.anchor.set(e.getKey(),h.isBackward()?e.getChildrenSize():0,"element"),m.removeAllRanges(),He(b))}}}return h&&!h.is(g)&&(Ve(h)||Ve(g))&&s.tableSelection&&!s.tableSelection.is(g)?(Ve(h)&&h.tableKey===s.tableNodeKey?s.$updateTableTableSelection(h):!Ve(h)&&Ve(g)&&g.tableKey===s.tableNodeKey&&s.$updateTableTableSelection(null),!1):(s.hasHijackedSelectionStyles&&!e.isSelected()?(function(m,_){_.$enableHighlightStyle(),Gf(_.table,y=>{const v=y.elem;y.highlighted=!1,v1(m,y),v.getAttribute("style")||v.removeAttribute("style")})})(n,s):!s.hasHijackedSelectionStyles&&e.isSelected()&&Um(n,s),!1)},Et)),s.listenersToRemove.add(n.registerCommand(Yr,()=>{const h=G();if(!W(h)||!h.isCollapsed()||!pn(h,e))return!1;const g=qm(n,h,e);return!!g&&(Gm(g,e),!0)},Et)),s}function Hm(e){return e[od]||null}function Va(e){let t=e;for(;t!=null;){const n=t.nodeName;if(n==="TD"||n==="TH"){const r=t._cell;return r===void 0?null:r}t=t.parentNode}return null}function Km(e,t){if(!e.contains(t))return null;let n=null;for(let r=t;r!=null;r=r.parentNode){if(r===e)return n;const o=r.nodeName;o!=="TD"&&o!=="TH"||(n=r._cell||null)}return null}function zo(e,t){const n=[],r={columns:0,domRows:n,rows:0};let o=no(e,t).querySelector("tr"),i=0,s=0;for(n.length=0;o!=null;){const a=o.nodeName;if(a==="TD"||a==="TH"){const u={elem:o,hasBackgroundColor:o.style.backgroundColor!=="",highlighted:!1,x:i,y:s};o._cell=u;let f=n[s];f===void 0&&(f=n[s]=[]),f[i]=u}else{const u=o.firstChild;if(u!=null){o=u;continue}}const l=o.nextSibling;if(l!=null){i++,o=l;continue}const c=o.parentNode;if(c!=null){const u=c.nextSibling;if(u==null)break;s++,i=0,o=u}}return r.columns=i+1,r.rows=s+1,r}function zs(e,t,n){const r=new Set(n?n.getNodes():[]);Gf(t,(o,i)=>{const s=o.elem;r.has(i)?(o.highlighted=!0,y1(e,o)):(o.highlighted=!1,v1(e,o),s.getAttribute("style")||s.removeAttribute("style"))})}function Gf(e,t){const{domRows:n}=e;for(let r=0;r<n.length;r++){const o=n[r];if(o)for(let i=0;i<o.length;i++){const s=o[i];if(!s)continue;const a=Ft(s.elem);a!==null&&t(s,a,{x:i,y:r})}}}function Um(e,t){t.$disableHighlightStyle(),Gf(t.table,n=>{n.highlighted=!0,y1(e,n)})}const oN=(e,t,n,r,o)=>{const i=o==="forward";switch(o){case"backward":case"forward":return n!==(i?e.table.columns-1:0)?Hs(t.getCellNodeFromCordsOrThrow(n+(i?1:-1),r,e.table),i):r!==(i?e.table.rows-1:0)?Hs(t.getCellNodeFromCordsOrThrow(i?0:e.table.columns-1,r+(i?1:-1),e.table),i):i?t.selectNext():t.selectPrevious(),!0;case"up":return r!==0?Hs(t.getCellNodeFromCordsOrThrow(n,r-1,e.table),!1):t.selectPrevious(),!0;case"down":return r!==e.table.rows-1?Hs(t.getCellNodeFromCordsOrThrow(n,r+1,e.table),!0):t.selectNext(),!0;default:return!1}};function yc(e,t){let n,r;if(t.startColumn===e.minColumn)n="minColumn";else{if(t.startColumn+t.cell.__colSpan-1!==e.maxColumn)return null;n="maxColumn"}if(t.startRow===e.minRow)r="minRow";else{if(t.startRow+t.cell.__rowSpan-1!==e.maxRow)return null;r="maxRow"}return[n,r]}function Ws([e,t]){return[e==="minColumn"?"maxColumn":"minColumn",t==="minRow"?"maxRow":"minRow"]}function _o(e,t,[n,r]){const o=t[r],i=e[o];i===void 0&&ue(250,r,String(o));const s=t[n],a=i[s];return a===void 0&&ue(250,n,String(s)),a}function iN(e,t,n,r,o){const i=Da(t,n,r),s=(function(w,T){const{minColumn:E,maxColumn:R,minRow:M,maxRow:O}=T;let D=1,I=1,L=1,B=1;const K=w[M],P=w[O];for(let A=E;A<=R;A++)D=Math.max(D,K[A].cell.__rowSpan),B=Math.max(B,P[A].cell.__rowSpan);for(let A=M;A<=O;A++)I=Math.max(I,w[A][E].cell.__colSpan),L=Math.max(L,w[A][R].cell.__colSpan);return{bottomSpan:B,leftSpan:I,rightSpan:L,topSpan:D}})(t,i),{topSpan:a,leftSpan:l,bottomSpan:c,rightSpan:u}=s,f=(function(w,T){const E=yc(w,T);return E===null&&ue(249,T.cell.getKey()),E})(i,n),[d,h]=Ws(f);let g=i[d],p=i[h];o==="forward"?g+=d==="maxColumn"?1:l:o==="backward"?g-=d==="minColumn"?1:u:o==="down"?p+=h==="maxRow"?1:a:o==="up"&&(p-=h==="minRow"?1:c);const m=t[p];if(m===void 0)return!1;const _=m[g];if(_===void 0)return!1;const[y,v]=(function(w,T,E){const R=Da(w,T,E),M=yc(R,T);if(M)return[_o(w,R,M),_o(w,R,Ws(M))];const O=yc(R,E);if(O)return[_o(w,R,Ws(O)),_o(w,R,O)];const D=["minColumn","minRow"];return[_o(w,R,D),_o(w,R,Ws(D))]})(t,n,_),x=Ir(e,y.cell),b=Ir(e,v.cell);return e.$setAnchorCellForSelection(x),e.$setFocusCellForSelection(b,!0),!0}function pn(e,t){if(W(e)||Ve(e)){const n=t.isParentOf(e.anchor.getNode()),r=t.isParentOf(e.focus.getNode());return n&&r}return!1}function Hs(e,t){t?e.selectStart():e.selectEnd()}function y1(e,t){const n=t.elem,r=e._config.theme;fe(Ft(n))||ue(131),Ye(n,r.tableCellSelected)}function v1(e,t){const n=t.elem;fe(Ft(n))||ue(131);const r=e._config.theme;Rn(n,r.tableCellSelected)}function wi(e){const t=xe(e,fe);return fe(t)?t:null}function Wo(e){const t=xe(e,Ge);return Ge(t)?t:null}function sN(e,t,n,r,o,i,s){const a=ln(n.focus,o?"previous":"next");if(Ff(a))return!1;let l=a;for(const m of Qi(a).iterNodeCarets("shadowRoot")){if(!pr(m)||!V(m.origin))return!1;l=m}const c=l.getParentAtCaret();if(!fe(c))return!1;const u=c,f=(function(m){for(const _ of Qi(m).iterNodeCarets("root")){const{origin:y}=_;if(fe(y)){if(At(_))return Ct(y,m.direction)}else if(!Xe(y))break}return null})(Je(u,l.direction)),d=xe(u,Ge);if(!d||!d.is(i))return!1;const h=e.getElementByKey(u.getKey()),g=Va(h);if(!h||!g)return!1;const p=lN(e,d);if(s.table=p,f)if(r==="extend"){const m=Va(e.getElementByKey(f.origin.getKey()));if(!m)return!1;s.$setAnchorCellForSelection(g),s.$setFocusCellForSelection(m,!0)}else{const m=bt(f);nn(n.anchor,m),nn(n.focus,m)}else if(r==="extend")s.$setAnchorCellForSelection(g),s.$setFocusCellForSelection(g,!0);else{const m=(function(_){const y=hs(_);return At(y)?bt(y):_})(Je(d,a.direction));nn(n.anchor,m),nn(n.focus,m)}return Bn(t),!0}function _1(e,t,n,r,o){if((n==="up"||n==="down")&&(function(s){const a=s.getRootElement();return a?a.hasAttribute("aria-controls")&&a.getAttribute("aria-controls")==="typeahead-menu":!1})(e))return!1;const i=G();if(!pn(i,r)){if(W(i)){if(n==="backward"){if(i.focus.offset>0)return!1;const s=(function(l){for(let c=l,u=l;u!==null;c=u,u=u.getParent())if(V(u)){if(u!==c&&u.getFirstChild()!==c)return null;if(!u.isInline())return u}return null})(i.focus.getNode());if(!s)return!1;const a=s.getPreviousSibling();return!!Ge(a)&&(Bn(t),t.shiftKey?i.focus.set(a.getParentOrThrow().getKey(),a.getIndexWithinParent(),"element"):a.selectEnd(),!0)}if(t.shiftKey&&(n==="up"||n==="down")){const s=i.focus.getNode();if(!i.isCollapsed()&&(n==="up"&&!i.isBackward()||n==="down"&&i.isBackward())){let a=xe(s,d=>Ge(d));if(fe(a)&&(a=xe(a,Ge)),a!==r||!a)return!1;const l=n==="down"?a.getNextSibling():a.getPreviousSibling();if(!l)return!1;let c=0;n==="up"&&V(l)&&(c=l.getChildrenSize());let u=l;n==="up"&&V(l)&&(u=l.getLastChild()||l,c=Y(u)?u.getTextContentSize():0);const f=i.clone();return f.focus.set(u.getKey(),c,Y(u)?"text":"element"),He(f),Bn(t),!0}if(dt(s)){const a=n==="up"?i.getNodes()[i.getNodes().length-1]:i.getNodes()[0];if(a&&ji(r,a)!==null){const l=r.getFirstDescendant(),c=r.getLastDescendant();if(!l||!c)return!1;const[u]=xn(l),[f]=xn(c),d=r.getCordsFromCellNode(u,o.table),h=r.getCordsFromCellNode(f,o.table),g=r.getDOMCellFromCordsOrThrow(d.x,d.y,o.table),p=r.getDOMCellFromCordsOrThrow(h.x,h.y,o.table);return o.$setAnchorCellForSelection(g),o.$setFocusCellForSelection(p,!0),!0}return!1}{let a=xe(s,c=>V(c)&&!c.isInline());if(fe(a)&&(a=xe(a,Ge)),!a)return!1;const l=n==="down"?a.getNextSibling():a.getPreviousSibling();if(Ge(l)&&o.tableNodeKey===l.getKey()){const c=l.getFirstDescendant(),u=l.getLastDescendant();if(!c||!u)return!1;const[f]=xn(c),[d]=xn(u),h=i.clone();return h.focus.set((n==="up"?f:d).getKey(),n==="up"?0:d.getChildrenSize(),"element"),Bn(t),He(h),!0}}}}return n==="down"&&ja(e)&&o.setShouldCheckSelection(),!1}if(W(i)){if(n==="backward"||n==="forward")return sN(e,t,i,t.shiftKey?"extend":"move",n==="backward",r,o);if(i.isCollapsed()){const{anchor:s,focus:a}=i,l=xe(s.getNode(),fe),c=xe(a.getNode(),fe);if(!fe(l)||!l.is(c))return!1;const u=Wo(l);if(u!==r&&u!=null){const _=no(u,e.getElementByKey(u.getKey()));if(_!=null)return o.table=zo(u,_),_1(e,t,n,u,o)}const f=e.getElementByKey(l.__key),d=e.getElementByKey(s.key);if(d==null||f==null)return!1;let h;if(s.type==="element")h=d.getBoundingClientRect();else{const _=St(Uf(e));if(_===null||_.rangeCount===0)return!1;h=_.getRangeAt(0).getBoundingClientRect()}const g=n==="up"?l.getFirstChild():l.getLastChild();if(g==null)return!1;const p=e.getElementByKey(g.__key);if(p==null)return!1;const m=p.getBoundingClientRect();if(n==="up"?m.top>h.top-h.height:h.bottom+h.height>m.bottom){Bn(t);const _=r.getCordsFromCellNode(l,o.table);if(!t.shiftKey)return oN(o,r,_.x,_.y,n);{const y=r.getDOMCellFromCordsOrThrow(_.x,_.y,o.table);o.$setAnchorCellForSelection(y),o.$setFocusCellForSelection(y,!0)}return!0}}}else if(Ve(i)){const{anchor:s,focus:a}=i,l=xe(s.getNode(),fe),c=xe(a.getNode(),fe),[u]=i.getNodes();Ge(u)||ue(251);const f=no(u,e.getElementByKey(u.getKey()));if(!fe(l)||!fe(c)||!Ge(u)||f==null)return!1;o.$updateTableTableSelection(i);const d=zo(u,f),h=r.getCordsFromCellNode(l,d),g=r.getDOMCellFromCordsOrThrow(h.x,h.y,d);if(o.$setAnchorCellForSelection(g),Bn(t),t.shiftKey){const[p,m,_]=zt(r,l,c);return iN(o,p,m,_,n)}return c.selectEnd(),!0}return!1}function Bn(e){e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation()}function Gm(e,t,n){const r=me();e==="first"?t.insertBefore(r):t.insertAfter(r),r.append(...n||[]),r.selectEnd()}function qm(e,t,n){const r=n.getParent();if(!r)return;const o=St(Uf(e));if(!o)return;const i=o.anchorNode,s=e.getElementByKey(r.getKey()),a=no(n,e.getElementByKey(n.getKey()));if(!i||!s||!a||!s.contains(i)||a.contains(i))return;const l=xe(t.anchor.getNode(),y=>fe(y));if(!l)return;const c=xe(l,y=>Ge(y));if(!Ge(c)||!c.is(n))return;const[u,f]=zt(n,l,l),d=u[0][0],h=u[u.length-1][u[0].length-1],{startRow:g,startColumn:p}=f,m=g===d.startRow&&p===d.startColumn,_=g===h.startRow&&p===h.startColumn;return m?"first":_?"last":void 0}function Ir(e,t){const{tableNode:n}=e.$lookup(),r=n.getCordsFromCellNode(t,e.table);return n.getDOMCellFromCordsOrThrow(r.x,r.y,e.table)}function id(e,t,n){return ji(e,Ft(t,n))}function Ym(e,t,n){if(!t.theme.tableAlignment)return;const r=[],o=[];for(const i of["center","right"]){const s=t.theme.tableAlignment[i];s&&(i===n?o:r).push(s)}Rn(e,...r),Ye(e,...o)}const sd=new WeakSet;function ja(e=ui()){return sd.has(e)}function aN(e,t){t?sd.add(e):sd.delete(e)}class dn extends yt{__rowStriping;__frozenColumnCount;__frozenRowCount;__colWidths;static getType(){return"table"}getColWidths(){return this.getLatest().__colWidths}setColWidths(t){const n=this.getWritable();return n.__colWidths=t,n}static clone(t){return new dn(t.__key)}afterCloneFrom(t){super.afterCloneFrom(t),this.__colWidths=t.__colWidths,this.__rowStriping=t.__rowStriping,this.__frozenColumnCount=t.__frozenColumnCount,this.__frozenRowCount=t.__frozenRowCount}static importDOM(){return{table:t=>({conversion:cN,priority:1})}}static importJSON(t){return ml().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setRowStriping(t.rowStriping||!1).setFrozenColumns(t.frozenColumnCount||0).setFrozenRows(t.frozenRowCount||0).setColWidths(t.colWidths)}constructor(t){super(t),this.__rowStriping=!1,this.__frozenColumnCount=0,this.__frozenRowCount=0,this.__colWidths=void 0}exportJSON(){return{...super.exportJSON(),colWidths:this.getColWidths(),frozenColumnCount:this.__frozenColumnCount?this.__frozenColumnCount:void 0,frozenRowCount:this.__frozenRowCount?this.__frozenRowCount:void 0,rowStriping:this.__rowStriping?this.__rowStriping:void 0}}extractWithChild(t,n,r){return r==="html"}getDOMSlot(t){const n=To(t)?t:t.querySelector("table");return To(n)||ue(229),super.getDOMSlot(t).withElement(n).withAfter(n.querySelector("colgroup"))}createDOM(t,n){const r=document.createElement("table");this.__style&&(r.style.cssText=this.__style);const o=document.createElement("colgroup");if(r.appendChild(o),g3(o),Ye(r,t.theme.table),this.updateTableElement(null,r,t),ja(n)){const i=document.createElement("div"),s=t.theme.tableScrollableWrapper;return s?Ye(i,s):i.style.cssText="overflow-x: auto;",i.appendChild(r),this.updateTableWrapper(null,i,r,t),i}return r}updateTableWrapper(t,n,r,o){this.__frozenColumnCount!==(t?t.__frozenColumnCount:0)&&(function(i,s,a,l){l>0?(Ye(i,a.theme.tableFrozenColumn),s.setAttribute("data-lexical-frozen-column","true")):(Rn(i,a.theme.tableFrozenColumn),s.removeAttribute("data-lexical-frozen-column"))})(n,r,o,this.__frozenColumnCount),this.__frozenRowCount!==(t?t.__frozenRowCount:0)&&(function(i,s,a,l){l>0?(Ye(i,a.theme.tableFrozenRow),s.setAttribute("data-lexical-frozen-row","true")):(Rn(i,a.theme.tableFrozenRow),s.removeAttribute("data-lexical-frozen-row"))})(n,r,o,this.__frozenRowCount)}updateTableElement(t,n,r){this.__style!==(t?t.__style:"")&&(n.style.cssText=this.__style),this.__rowStriping!==(!!t&&t.__rowStriping)&&(function(o,i,s){s?(Ye(o,i.theme.tableRowStriping),o.setAttribute("data-lexical-row-striping","true")):(Rn(o,i.theme.tableRowStriping),o.removeAttribute("data-lexical-row-striping"))})(n,r,this.__rowStriping),(function(o,i,s,a){const l=o.querySelector("colgroup");if(!l)return;const c=[];for(let u=0;u<s;u++){const f=document.createElement("col"),d=a&&a[u];d&&(f.style.width=`${d}px`),c.push(f)}l.replaceChildren(...c)})(n,0,this.getColumnCount(),this.getColWidths()),Ym(n,r,this.getFormatType())}updateDOM(t,n,r){const o=this.getDOMSlot(n).element;return n===o===ja()||(je(i=n)&&i.nodeName==="DIV"&&this.updateTableWrapper(t,n,o,r),this.updateTableElement(t,o,r),!1);var i}exportDOM(t){const n=super.exportDOM(t),{element:r}=n;return{after:o=>{if(n.after&&(o=n.after(o)),!To(o)&&je(o)&&(o=o.querySelector("table")),!To(o))return null;Ym(o,t._config,this.getFormatType());const[i]=sr(this,null,null),s=new Map;for(const u of i)for(const f of u){const d=f.cell.getKey();s.has(d)||s.set(d,{colSpan:f.cell.getColSpan(),startColumn:f.startColumn})}const a=new Set;for(const u of o.querySelectorAll(":scope > tr > [data-temporary-table-cell-lexical-key]")){const f=u.getAttribute("data-temporary-table-cell-lexical-key");if(f){const d=s.get(f);if(u.removeAttribute("data-temporary-table-cell-lexical-key"),d){s.delete(f);for(let h=0;h<d.colSpan;h++)a.add(h+d.startColumn)}}}const l=o.querySelector(":scope > colgroup");if(l){const u=Array.from(o.querySelectorAll(":scope > colgroup > col")).filter((f,d)=>a.has(d));l.replaceChildren(...u)}const c=o.querySelectorAll(":scope > tr");if(c.length>0){const u=document.createElement("tbody");for(const f of c)u.appendChild(f);o.append(u)}return o},element:!To(r)&&je(r)?r.querySelector("table"):r}}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(t,n){const{rows:r,domRows:o}=n;for(let i=0;i<r;i++){const s=o[i];if(s!=null)for(let a=0;a<s.length;a++){const l=s[a];if(l==null)continue;const{elem:c}=l,u=id(this,c);if(u!==null&&t.is(u))return{x:a,y:i}}}throw new Error("Cell not found in table.")}getDOMCellFromCords(t,n,r){const{domRows:o}=r,i=o[n];if(i==null)return null;const s=i[t<i.length?t:i.length-1];return s??null}getDOMCellFromCordsOrThrow(t,n,r){const o=this.getDOMCellFromCords(t,n,r);if(!o)throw new Error("Cell not found at cords.");return o}getCellNodeFromCords(t,n,r){const o=this.getDOMCellFromCords(t,n,r);if(o==null)return null;const i=Ft(o.elem);return fe(i)?i:null}getCellNodeFromCordsOrThrow(t,n,r){const o=this.getCellNodeFromCords(t,n,r);if(!o)throw new Error("Node at cords not TableCellNode.");return o}getRowStriping(){return!!this.getLatest().__rowStriping}setRowStriping(t){const n=this.getWritable();return n.__rowStriping=t,n}setFrozenColumns(t){const n=this.getWritable();return n.__frozenColumnCount=t,n}getFrozenColumns(){return this.getLatest().__frozenColumnCount}setFrozenRows(t){const n=this.getWritable();return n.__frozenRowCount=t,n}getFrozenRows(){return this.getLatest().__frozenRowCount}canSelectBefore(){return!0}canIndent(){return!1}getColumnCount(){const t=this.getFirstChild();if(!t)return 0;let n=0;return t.getChildren().forEach(r=>{fe(r)&&(n+=r.getColSpan())}),n}}function lN(e,t){const n=e.getElementByKey(t.getKey());return n===null&&ue(230),zo(t,n)}function cN(e){const t=ml();e.hasAttribute("data-lexical-row-striping")&&t.setRowStriping(!0),e.hasAttribute("data-lexical-frozen-column")&&t.setFrozenColumns(1),e.hasAttribute("data-lexical-frozen-row")&&t.setFrozenRows(1);const n=e.querySelector(":scope > colgroup");if(n){let r=[];for(const o of n.querySelectorAll(":scope > col")){let i=o.style.width||"";if(!Hf.test(i)&&(i=o.getAttribute("width")||"",!/^\d+$/.test(i))){r=void 0;break}r.push(parseFloat(i))}r&&t.setColWidths(r)}return{after:r=>bx(r,Xe),node:t}}function ml(){return vt(new dn)}function Ge(e){return e instanceof dn}function uN(e){Xe(e.getParent())?e.isEmpty()&&e.append(me()):e.remove()}function dN(e){Ge(e.getParent())?_x(e,fe):e.remove()}function fN(e){_x(e,Xe);const[t]=sr(e,null,null),n=t.reduce((s,a)=>Math.max(s,a.length),0),r=e.getChildren();for(let s=0;s<t.length;++s){const a=r[s];if(!a)continue;Xe(a)||ue(254,a.constructor.name,a.getType());const l=t[s].reduce((c,u)=>u?1+c:c,0);if(l!==n)for(let c=l;c<n;++c){const u=Kt();u.append(me()),a.append(u)}}const o=e.getColWidths(),i=e.getColumnCount();if(o&&o.length!==i){let s;if(i<o.length)s=o.slice(0,i);else if(o.length>0){const a=o[o.length-1];s=[...o,...Array(i-o.length).fill(a)]}e.setColWidths(s)}}function hN(e){if(e.detail<3||!tn(e.target))return!1;const t=Ft(e.target);if(t===null)return!1;const n=xe(t,r=>V(r)&&!r.isInline());return n===null?!1:!!fe(n.getParent())&&(n.select(0),!0)}function gN(e){return e.registerNodeTransform(un,t=>{if(t.getColSpan()>1||t.getRowSpan()>1){const[,,n]=xn(t),[r]=zt(n,t,t),o=r.length,i=r[0].length;let s=n.getFirstChild();Xe(s)||ue(175);const a=[];for(let l=0;l<o;l++){l!==0&&(s=s.getNextSibling(),Xe(s)||ue(175));let c=null;for(let u=0;u<i;u++){const f=r[l][u],d=f.cell;if(f.startRow===l&&f.startColumn===u)c=d,a.push(d);else if(d.getColSpan()>1||d.getRowSpan()>1){fe(d)||ue(176);const h=Kt(d.__headerState);c!==null?c.insertAfter(h):$3(s,h)}}}for(const l of a)l.setColSpan(1),l.setRowSpan(1)}})}function pN(e,t=!0){const n=new Map,r=(i,s,a)=>{const l=no(i,a),c=rN(i,l,e,t);n.set(s,[c,l])},o=e.registerMutationListener(dn,i=>{e.getEditorState().read(()=>{for(const[s,a]of i){const l=n.get(s);if(a==="created"||a==="updated"){const{tableNode:c,tableElement:u}=m1(s);l===void 0?r(c,s,u):u!==l[1]&&(l[0].removeListeners(),n.delete(s),r(c,s,u))}else a==="destroyed"&&l!==void 0&&(l[0].removeListeners(),n.delete(s))}},{editor:e})},{skipInitialization:!1});return()=>{o();for(const[,[i]]of n)i.removeListeners()}}function mN(e,t){e.hasNodes([dn])||ue(255);const{hasNestedTables:n=Sx(!1)}=t??{};return cn(e.registerCommand(h1,r=>(function({rows:o,columns:i,includeHeaders:s},a){const l=G()||An();if(!l||!W(l)||!a&&Wo(l.anchor.getNode()))return!1;const c=WM(Number(o),Number(i),s);O3(c);const u=c.getFirstDescendant();return Y(u)&&u.select(),!0})(r,n.peek()),_e),e.registerCommand(rf,({nodes:r,selection:o},i)=>n.peek()||e!==i||!W(o)?!1:Wo(o.anchor.getNode())!==null&&r.some(Ge),_e),e.registerCommand(Za,hN,_e),e.registerNodeTransform(dn,fN),e.registerNodeTransform(yr,dN),e.registerNodeTransform(un,uN))}function yN({hasCellMerge:e=!0,hasCellBackgroundColor:t=!0,hasTabHandler:n=!0,hasHorizontalScroll:r=!1,hasNestedTables:o=!1}){const[i]=nt();C.useEffect(()=>{ja(i)!==r&&(aN(i,r),i.registerNodeTransform(dn,()=>{})())},[i,r]);const s=C.useMemo(()=>Sx(!1),[]);return s.peek()!==o&&(s.value=o),C.useEffect(()=>mN(i,{hasNestedTables:s}),[i,s]),C.useEffect(()=>pN(i,n),[i,n]),C.useEffect(()=>{if(!e)return gN(i)},[i,e]),C.useEffect(()=>{if(!t)return i.registerNodeTransform(un,a=>{a.getBackgroundColor()!==null&&a.setBackgroundColor(null)})},[i,t,e]),null}var vc,Xm;function x1(){if(Xm)return vc;Xm=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return vc=e,vc}var _c,Jm;function vN(){if(Jm)return _c;Jm=1;var e=typeof _n=="object"&&_n&&_n.Object===Object&&_n;return _c=e,_c}var xc,Zm;function b1(){if(Zm)return xc;Zm=1;var e=vN(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return xc=n,xc}var bc,Qm;function _N(){if(Qm)return bc;Qm=1;var e=b1(),t=function(){return e.Date.now()};return bc=t,bc}var Cc,ey;function xN(){if(ey)return Cc;ey=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return Cc=t,Cc}var wc,ty;function bN(){if(ty)return wc;ty=1;var e=xN(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return wc=n,wc}var Sc,ny;function C1(){if(ny)return Sc;ny=1;var e=b1(),t=e.Symbol;return Sc=t,Sc}var Ec,ry;function CN(){if(ry)return Ec;ry=1;var e=C1(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,o=e?e.toStringTag:void 0;function i(s){var a=n.call(s,o),l=s[o];try{s[o]=void 0;var c=!0}catch{}var u=r.call(s);return c&&(a?s[o]=l:delete s[o]),u}return Ec=i,Ec}var Tc,oy;function wN(){if(oy)return Tc;oy=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return Tc=n,Tc}var Rc,iy;function SN(){if(iy)return Rc;iy=1;var e=C1(),t=CN(),n=wN(),r="[object Null]",o="[object Undefined]",i=e?e.toStringTag:void 0;function s(a){return a==null?a===void 0?o:r:i&&i in Object(a)?t(a):n(a)}return Rc=s,Rc}var kc,sy;function EN(){if(sy)return kc;sy=1;function e(t){return t!=null&&typeof t=="object"}return kc=e,kc}var Ac,ay;function TN(){if(ay)return Ac;ay=1;var e=SN(),t=EN(),n="[object Symbol]";function r(o){return typeof o=="symbol"||t(o)&&e(o)==n}return Ac=r,Ac}var Mc,ly;function RN(){if(ly)return Mc;ly=1;var e=bN(),t=x1(),n=TN(),r=NaN,o=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,s=/^0o[0-7]+$/i,a=parseInt;function l(c){if(typeof c=="number")return c;if(n(c))return r;if(t(c)){var u=typeof c.valueOf=="function"?c.valueOf():c;c=t(u)?u+"":u}if(typeof c!="string")return c===0?c:+c;c=e(c);var f=i.test(c);return f||s.test(c)?a(c.slice(2),f?2:8):o.test(c)?r:+c}return Mc=l,Mc}var Nc,cy;function kN(){if(cy)return Nc;cy=1;var e=x1(),t=_N(),n=RN(),r="Expected a function",o=Math.max,i=Math.min;function s(a,l,c){var u,f,d,h,g,p,m=0,_=!1,y=!1,v=!0;if(typeof a!="function")throw new TypeError(r);l=n(l)||0,e(c)&&(_=!!c.leading,y="maxWait"in c,d=y?o(n(c.maxWait)||0,l):d,v="trailing"in c?!!c.trailing:v);function x(I){var L=u,B=f;return u=f=void 0,m=I,h=a.apply(B,L),h}function b(I){return m=I,g=setTimeout(E,l),_?x(I):h}function w(I){var L=I-p,B=I-m,K=l-L;return y?i(K,d-B):K}function T(I){var L=I-p,B=I-m;return p===void 0||L>=l||L<0||y&&B>=d}function E(){var I=t();if(T(I))return R(I);g=setTimeout(E,w(I))}function R(I){return g=void 0,v&&u?x(I):(u=f=void 0,h)}function M(){g!==void 0&&clearTimeout(g),m=0,u=p=f=g=void 0}function O(){return g===void 0?h:R(t())}function D(){var I=t(),L=T(I);if(u=arguments,f=this,p=I,L){if(g===void 0)return b(p);if(y)return clearTimeout(g),g=setTimeout(E,l),x(p)}return g===void 0&&(g=setTimeout(E,l)),h}return D.cancel=M,D.flush=O,D}return Nc=s,Nc}var AN=kN();const MN=_d(AN),NN=e=>N.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M1.61342 8.47549C1.52262 8.33173 1.47723 8.25985 1.45182 8.14898C1.43273 8.06571 1.43273 7.93437 1.45182 7.8511C1.47723 7.74023 1.52262 7.66835 1.61341 7.52459C2.36369 6.3366 4.59693 3.33337 8.00027 3.33337C11.4036 3.33337 13.6369 6.3366 14.3871 7.52459C14.4779 7.66835 14.5233 7.74023 14.5487 7.8511C14.5678 7.93437 14.5678 8.06571 14.5487 8.14898C14.5233 8.25985 14.4779 8.33173 14.3871 8.47549C13.6369 9.66348 11.4036 12.6667 8.00027 12.6667C4.59693 12.6667 2.36369 9.66348 1.61342 8.47549Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),N.createElement("path",{d:"M8.00027 10C9.10484 10 10.0003 9.10461 10.0003 8.00004C10.0003 6.89547 9.10484 6.00004 8.00027 6.00004C6.8957 6.00004 6.00027 6.89547 6.00027 8.00004C6.00027 9.10461 6.8957 10 8.00027 10Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),w1=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M16 6V5.2C16 4.0799 16 3.51984 15.782 3.09202C15.5903 2.71569 15.2843 2.40973 14.908 2.21799C14.4802 2 13.9201 2 12.8 2H11.2C10.0799 2 9.51984 2 9.09202 2.21799C8.71569 2.40973 8.40973 2.71569 8.21799 3.09202C8 3.51984 8 4.0799 8 5.2V6M10 11.5V16.5M14 11.5V16.5M3 6H21M19 6V17.2C19 18.8802 19 19.7202 18.673 20.362C18.3854 20.9265 17.9265 21.3854 17.362 21.673C16.7202 22 15.8802 22 14.2 22H9.8C8.11984 22 7.27976 22 6.63803 21.673C6.07354 21.3854 5.6146 20.9265 5.32698 20.362C5 19.7202 5 18.8802 5 17.2V6",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}));function S1(e){return e instanceof ro}function E1(e){return new ro(e)}const PN=z.css({display:"inline-flex",color:"var(--text-accent)",textDecoration:"underline",cursor:"pointer"}),FN=z.css({color:"var(--text-accent)",":hover":{color:"var(--text-accent-hover)"}}),LN=z.css({width:"16px",height:"16px",color:"var(--icon-negative)",cursor:"pointer",transition:"var(--transition-general)",":hover":{color:"var(--icon-negative-hover)"}}),ON=z.css({boxShadow:"0 2px 10px 4px var(--effect-shadow-l)",borderRadius:"var(--corner-md)",padding:"var(--spacing-sm)"});function IN({url:e,text:t,nodeKey:n}){const[r]=nt(),o=C.useCallback(()=>{r.update(()=>{const i=Me(n);S1(i)&&i.remove()})},[r,n]);return S.jsx(lr,{content:S.jsxs(q,{flex:!0,row:!0,center:!0,gap:"var(--spacing-xs)",children:[S.jsx("a",{className:FN,target:"_blank",href:e,children:e}),S.jsx(w1,{className:LN,onClick:o})]}),placement:"right-start",trigger:"hover",contentClassName:ON,children:S.jsx(ce,{className:PN,children:t})})}const Pc="custom-link-node";class ro extends cs{_url;_text;constructor({url:t,text:n},r){super(r),this._url=t,this._text=n}getType(){return Pc}getData(){return{url:this._url,text:this._text}}isInline(){return!0}isIsolated(){return!1}createDOM(){const t=document.createElement("span");return t.style.display="inline",t}updateDOM(){return!1}decorate(){return S.jsx(IN,{...this.getData(),nodeKey:this.getKey()})}exportJSON(){return{...super.exportJSON(),format:"left",type:Pc,version:1,text:this._text,url:this._url}}static importJSON(t){return new ro({url:t.url,text:t.text})}static getType(){return Pc}static clone(t){return new ro({url:t._url,text:t._text},t.__key)}}const $N={type:"text-match",dependencies:[ro],regExp:/\[([^\]]+)]\(([^)]+)\)/,trigger:")",importRegExp:/\[([^\]]+)]\(([^)]+)\)/,replace:(e,t)=>{const[,n,r]=t,o=E1({url:r,text:n});e.replace(o)},export:e=>{if(!S1(e))return null;const{text:n,url:r}=e.getData();return!r||!n?"":`[${n}](${r})`}},uy="image-row",DN=z.css({width:"fit-content",display:"flex",alignItems:"center"});function T1(e){return e.length?new vr(e):null}function R1(e){return e instanceof vr}const VN=z.css({width:"100px",height:"100px",objectFit:"cover",borderRadius:"var(--corner-md)"}),jN=z.css({width:"20px",height:"20px",color:"var(--icon-negative)",cursor:"pointer",transition:"var(--transition-general)",":hover":{color:"var(--icon-negative-hover)"}}),BN=z.css({boxShadow:"0 2px 10px 4px var(--effect-shadow-l)",borderRadius:"var(--corner-xs)",padding:"var(--spacing-xs)"});function zN({images:e,nodeKey:t}){const[n]=nt(),r=C.useCallback(()=>{n.update(()=>{const o=Me(t);R1(o)&&o.remove()})},[n,t]);return S.jsx(lr,{content:S.jsx(w1,{className:jN,onClick:r}),placement:"right-start",trigger:"hover",contentClassName:BN,children:S.jsx(q,{w:"full",flex:!0,row:!0,gap:"var(--spacing-sm)",alignItems:"center",children:e.map(({src:o,alt:i})=>S.jsx("img",{src:o,alt:i??"",className:VN},o))})})}class vr extends cs{images;constructor(t,n){super(n),this.images=t}createDOM(){const t=document.createElement("div");return t.className=DN,t.contentEditable="false",t}updateDOM(){return!1}decorate(){return S.jsx(zN,{images:this.images,nodeKey:this.getKey()})}exportJSON(){return{...super.exportJSON(),format:"left",type:uy,version:1,images:this.images}}static importJSON(t){return new vr(t.images)}isInline(){return!1}isIsolated(){return!0}isSelectable(){return!0}static getType(){return uy}static clone(t){return new vr(t.images,t.__key)}}const WN={type:"element",dependencies:[vr],regExp:/^!\[[^\]]*]\([^)]+\)(?:\s+!\[[^\]]*]\([^)]+\))*$/,replace:(e,t,n)=>{const[r]=n,i=[...r.matchAll(/!\[([^\]]*)]\(([^)]+)\)/g)].map(([a,l,c])=>({alt:l,src:c})),s=T1(i);s&&pf([s])},export:e=>{if(!(e instanceof vr))return null;const n=e.images;return n.length?n.map(({src:r,alt:o})=>``).join(" "):""}},HN=e=>N.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("g",null,N.createElement("path",{d:"M8.00008 8.66634C8.36827 8.66634 8.66675 8.36786 8.66675 7.99967C8.66675 7.63148 8.36827 7.33301 8.00008 7.33301C7.63189 7.33301 7.33341 7.63148 7.33341 7.99967C7.33341 8.36786 7.63189 8.66634 8.00008 8.66634Z",fill:"currentColor"}),N.createElement("path",{d:"M12.6667 8.66634C13.0349 8.66634 13.3334 8.36786 13.3334 7.99967C13.3334 7.63148 13.0349 7.33301 12.6667 7.33301C12.2986 7.33301 12.0001 7.63148 12.0001 7.99967C12.0001 8.36786 12.2986 8.66634 12.6667 8.66634Z",fill:"currentColor"}),N.createElement("path",{d:"M3.33341 8.66634C3.7016 8.66634 4.00008 8.36786 4.00008 7.99967C4.00008 7.63148 3.7016 7.33301 3.33341 7.33301C2.96522 7.33301 2.66675 7.63148 2.66675 7.99967C2.66675 8.36786 2.96522 8.66634 3.33341 8.66634Z",fill:"currentColor"}),N.createElement("path",{d:"M8.00008 8.66634C8.36827 8.66634 8.66675 8.36786 8.66675 7.99967C8.66675 7.63148 8.36827 7.33301 8.00008 7.33301C7.63189 7.33301 7.33341 7.63148 7.33341 7.99967C7.33341 8.36786 7.63189 8.66634 8.00008 8.66634Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),N.createElement("path",{d:"M12.6667 8.66634C13.0349 8.66634 13.3334 8.36786 13.3334 7.99967C13.3334 7.63148 13.0349 7.33301 12.6667 7.33301C12.2986 7.33301 12.0001 7.63148 12.0001 7.99967C12.0001 8.36786 12.2986 8.66634 12.6667 8.66634Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),N.createElement("path",{d:"M3.33341 8.66634C3.7016 8.66634 4.00008 8.36786 4.00008 7.99967C4.00008 7.63148 3.7016 7.33301 3.33341 7.33301C2.96522 7.33301 2.66675 7.63148 2.66675 7.99967C2.66675 8.36786 2.96522 8.66634 3.33341 8.66634Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),N.createElement("defs",null)),KN=z.css({cursor:"pointer"}),UN=z.css({":hover":{backgroundColor:"var(--fill-bg-secondary)"},":active":{backgroundColor:"var(--fill-bg-secondary)"}});function GN({groups:e,toolbarVisibleActionsCount:t,onAction:n,disabled:r}){const[o,i]=C.useState(!1),s=C.useCallback(c=>()=>{r||(c&&c(),i(!1))},[r]),a=C.useCallback(({IconComponent:c,...u},f)=>S.jsxs(q,{className:z.cx(KN,!r&&UN),p:"var(--spacing-sm)",alignItems:"center",flex:!0,row:!0,gap:"var(--spacing-xs)",onClick:s(()=>n(u.id,f)),children:[S.jsx(c,{width:20,height:20,color:"var(--icon-tertiary)"}),S.jsx(ce,{variant:"body-2",children:u.label})]},u.id),[r,n,s]),l=C.useMemo(()=>e.map((c,u)=>{const f=u===e.length-1;if(!c.length)return null;const d=c.map((h,g)=>{const m=(u?e.slice(0,u).flat().length:0)+g+t;return a(h,m)});return S.jsxs(C.Fragment,{children:[d,f?null:S.jsx(q,{w:"full",h:1,backgroundColor:"var(--border-neutral-alpha-basic)"})]},c.flatMap(h=>h.id).join("-"))}),[e,a,t]);return S.jsx(lr,{content:S.jsx(q,{flex:!0,children:l}),placement:"bottom",open:o,onChange:i,children:S.jsx(Kn,{size:"xs",color:"no-bg",disabled:r,children:S.jsx(HN,{})})})}const qN=z.css({minWidth:"fit-content"}),YN=e=>{throw new Error("defaultOnImagesUpload function must be overridden")};function dy({onSave:e}){const[t,n]=C.useState(""),[r,o]=C.useState(""),[i,s]=C.useState(null),a=ss(),{textPlaceholder:l,linkPlaceholder:c,linkErrorText:u,buttonText:f}=a.toolbar.link,d=C.useMemo(()=>i==="link"?u:null,[i,u]),h=C.useCallback(v=>{try{const x=new URL(v);if(!(x.protocol==="http:"||x.protocol==="https:"))throw new Error("Invalid protocol");return s(null),!0}catch{return s("link"),!1}},[]),g=C.useCallback(v=>{n(v.target.value)},[]),p=C.useCallback(v=>{h(v.target.value),o(v.target.value)},[h]),m=C.useCallback(()=>[()=>h(r)].map(b=>b()).every(Boolean),[r,h]),_=C.useCallback(()=>{n(""),o(""),s(null)},[]),y=C.useCallback(v=>{v.preventDefault(),m()&&(e({text:t||r,url:r}),_())},[r,e,t,m,_]);return C.useEffect(()=>()=>{_()},[]),S.jsx("form",{onSubmit:y,children:S.jsxs(q,{flex:!0,alignItems:"flex-start",p:"var(--spacing-sm)",gap:"var(--spacing-sm)",children:[S.jsx(q,{children:S.jsx(qo,{placeholder:l,size:"sm",value:t,onChange:g})}),S.jsx(q,{children:S.jsx(qo,{placeholder:c,size:"sm",value:r,onChange:p,error:!!d,errorText:d||""})}),S.jsx(Go,{size:"xs",width:"auto",type:"submit",children:f})]})})}const fy=50,hy=20,gy=1,py=1;function my({onSave:e}){const[t,n]=C.useState(""),[r,o]=C.useState(""),[i,s]=C.useState(null),[a,l]=C.useState(null),c=ss(),{maxRowsErrorText:u,maxColumnsErrorText:f,minRowsErrorText:d,minColumnsErrorText:h,rowsPlaceholder:g,columnsPlaceholder:p,buttonText:m}=c.toolbar.table,_=C.useMemo(()=>{switch(i){case"rows-max":return u({current:Number(t),limit:fy});case"rows-min":return d({current:Number(t),limit:gy});default:return null}},[i,t,u,d]),y=C.useMemo(()=>{switch(a){case"columns-max":return f({current:Number(r),limit:hy});case"columns-min":return h({current:Number(r),limit:py});default:return null}},[a,r,f,h]),v=C.useCallback(O=>{try{const D=Number(O);if(D>fy)throw s("rows-max"),new Error("Rows amount exceeds maximum");if(D<gy)throw s("rows-min"),new Error("Rows amount below minimum");return s(null),!0}catch{return!1}},[]),x=C.useCallback(O=>{try{const D=Number(O);if(D>hy)throw l("columns-max"),new Error("Columns amount exceeds maximum");if(D<py)throw l("columns-min"),new Error("Columns amount below minimum");return l(null),!0}catch{return!1}},[]),b=C.useCallback(O=>{const D=Number(O);return!Number.isNaN(D)&&Number.isInteger(D)?D:null},[]),w=C.useCallback(O=>{const D=O.target.value,I=b(D);typeof I=="number"&&(v(D),n(String(I)))},[v,b]),T=C.useCallback(O=>{const D=O.target.value,I=b(D);typeof I=="number"&&(x(D),o(String(I)))},[x,b]),E=C.useCallback(()=>[()=>v(t),()=>x(r)].map(I=>I()).every(Boolean),[r,t,x,v]),R=C.useCallback(()=>{n(""),o(""),s(null),l(null)},[]),M=C.useCallback(O=>{O.preventDefault(),E()&&(e({rows:t,columns:r}),R())},[r,e,t,E,R]);return C.useEffect(()=>()=>{R()},[]),S.jsx("form",{onSubmit:M,children:S.jsxs(q,{flex:!0,alignItems:"flex-start",p:"var(--spacing-sm)",gap:"var(--spacing-sm)",children:[S.jsx(q,{children:S.jsx(qo,{placeholder:g,size:"sm",value:t,onChange:w,error:!!_,errorText:_||""})}),S.jsx(q,{children:S.jsx(qo,{placeholder:p,size:"sm",value:r,onChange:T,error:!!y,errorText:y||""})}),S.jsx(Go,{size:"xs",width:"auto",type:"submit",children:m})]})})}function XN({disabled:e=!1}){const[t,n]=C.useState(null),[r]=nt(),o=ss(),i=C.useMemo(()=>{const l=o.toolbar.textSize;return[{value:"paragraph",label:l.paragraph,textProps:{variant:"body-2"}},{value:"h1",label:l.h1,textProps:{fontWeight:"semibold",variant:"headline-1"}},{value:"h2",label:l.h2,textProps:{fontWeight:"semibold",variant:"headline-2"}},{value:"h3",label:l.h3,textProps:{fontWeight:"semibold",variant:"headline-3"}}]},[o.toolbar.textSize]),s=C.useCallback(l=>{!l||Array.isArray(l)||r.update(()=>{const c=G();if(!W(c))return;const u=c.anchor.getNode().getTopLevelElement();if(!u)return;const f=l==="paragraph"?me():Vr(l);u.getChildren().forEach(d=>{f.append(d)}),u.replace(f),f.selectEnd()})},[r]),a=C.useCallback(()=>{const l=G();if(!W(l))return null;const c=l.anchor.getNode().getTopLevelElement();return Ux(c)?c.getTag():"paragraph"},[]);return C.useEffect(()=>{const l=r.registerUpdateListener(({editorState:c})=>{c.read(()=>{const u=a();u&&n(u)})});return()=>{l()}},[r,a]),S.jsx(ch,{size:"xs",items:i,renderDropdownItem:l=>S.jsx(ce,{whiteSpace:"nowrap",...l.textProps,children:l.label}),returnedValue:l=>l.value,renderSingleInputItem:l=>l.label,onChange:s,disabled:e,value:t,showDefaultItem:!1})}function JN({onImagesUpload:e=YN}){const[t,n]=C.useState(11),[r,o]=C.useState(null),[i,s]=C.useState(null),a=C.useRef(null),{toolbar:l}=ss(),c=l.preview,[u]=nt(),{isEditable:f,isPreviewMode:d,setPreviewMode:h}=tf(),{availableActionGroups:g}=V3(),p=C.useRef(null),m=C.useMemo(()=>!f||d,[f,d]),_=C.useMemo(()=>d?c.hide:c.show,[d,c]),{toolbarGroups:y,menuGroups:v}=C.useMemo(()=>{const L=[],B=[];let K=0;for(const P of g){const A=[],$=[];for(const H of P)K+=1,K<=t?A.push(H):$.push(H);A.length&&L.push(A),$.length&&B.push($)}return{toolbarGroups:L,menuGroups:B}},[g,t]),x=C.useMemo(()=>typeof r=="number"&&r>t-1,[r,t]),b=C.useMemo(()=>typeof i=="number"&&i>t-1,[i,t]),w=C.useCallback(L=>{const{text:B,url:K}=L;u.update(()=>{const P=G();if(W(P)){const A=E1({text:B,url:K});P.insertNodes([A]);const $=Pe(" ");A.insertAfter($),$.select()}}),o(null)},[u]),T=C.useCallback(L=>{const{rows:B,columns:K}=L;u.dispatchCommand(h1,{rows:B,columns:K}),s(null)},[u]),E=C.useCallback(()=>{p.current&&p.current.click()},[]),R=C.useCallback(async L=>{try{const B=Array.from(L.target.files||[]);if(!B.length)return;const K=await e(B);u.update(()=>{const P=T1(K);P&&pf([P])})}catch(B){console.error("Error uploading images:",B)}finally{L.target.value=""}},[u,e]),M=C.useCallback((L,B)=>{({[oe.BOLD]:()=>{u.dispatchCommand(Rt,"bold")},[oe.ITALIC]:()=>{u.dispatchCommand(Rt,"italic")},[oe.UNDERLINE]:()=>{u.dispatchCommand(Rt,"underline")},[oe.STRIKETHROUGH]:()=>{u.dispatchCommand(Rt,"strikethrough")},[oe.ALIGN_LEFT]:()=>{u.dispatchCommand($o,"left")},[oe.ALIGN_CENTER]:()=>{u.dispatchCommand($o,"center")},[oe.ALIGN_RIGHT]:()=>{u.dispatchCommand($o,"right")},[oe.LINK]:()=>{o(B)},[oe.IMAGE]:()=>{E()},[oe.TABLE]:()=>{s(B)},[oe.BULLET_LIST]:()=>{u.dispatchCommand(Ix,void 0)},[oe.NUMBERED_LIST]:()=>{u.dispatchCommand($x,void 0)}})[L]()},[E,u]),O=C.useMemo(()=>y.map((L,B)=>{const K=y.slice(0,B).reduce(($,H)=>$+H.length,0);if(!L.length)return null;const P=L.map(({IconComponent:$,isActive:H,id:Q},J)=>{const X=K+J,se=H?"neutral":"no-bg";return Q===oe.LINK?S.jsx(lr,{content:S.jsx(dy,{onSave:w}),placement:"bottom",open:r===X,onChange:re=>{o(re?X:null)},children:S.jsx(Kn,{size:"xs",color:"no-bg",disabled:m,children:S.jsx($,{})})},Q):Q===oe.TABLE?S.jsx(lr,{content:S.jsx(my,{onSave:T}),placement:"bottom",open:i===X,onChange:re=>{s(re?X:null)},children:S.jsx(Kn,{size:"xs",color:se,disabled:m,children:S.jsx($,{})})},Q):S.jsx(Kn,{size:"xs",color:se,onClick:()=>M(Q,X),disabled:m,children:S.jsx($,{})},Q)});return P.every($=>!$)?null:S.jsxs(C.Fragment,{children:[P,S.jsx(q,{w:1,h:32,backgroundColor:"var(--border-neutral-alpha-basic)"})]},L.flatMap($=>$.id).join("-"))}),[y,M,r,m,i,w,T]),D=C.useCallback(()=>{const L=a.current;if(!L)return;const B=L.clientWidth,K=40,P=4,A=1,$=P+A+P+K+P;let H=B-$,Q=0;for(const J of g)if(J.length){for(const X of J){const se=K+P;if(H-se>=0)H-=se,Q+=1;else break}H-=A+P}n(Q)},[g]),I=C.useMemo(()=>MN(D,20,{}),[D]);return C.useEffect(()=>{if(!a.current)return;const L=new ResizeObserver(()=>{I()});return L.observe(a.current),()=>L.disconnect()},[I]),S.jsxs(q,{backgroundColor:"var(--fill-neutral-primary)",border:"1px solid var(--border-neutral-alpha-basic)",borderRadius:"var(--corner-md)",flex:!0,row:!0,alignItems:"center",justifyContent:"space-between",p:"var(--spacing-sm)",children:[S.jsxs(q,{flex:!0,flexGrow:1,row:!0,alignItems:"center",overflow:"hidden",children:[S.jsx("input",{ref:p,type:"file",accept:"image/*",hidden:!0,multiple:!0,onChange:R,disabled:m}),S.jsx(XN,{disabled:m}),S.jsx(lr,{content:S.jsx(dy,{onSave:w}),placement:"bottom",open:x,onChange:L=>{L||o(null)},children:S.jsx("div",{})}),S.jsx(lr,{content:S.jsx(my,{onSave:T}),placement:"bottom",open:b,onChange:L=>{L||s(null)},children:S.jsx("div",{})}),S.jsxs(q,{flex:!0,row:!0,alignItems:"center",gap:"var(--spacing-xs)",w:"full",ml:"var(--spacing-xs)",overflow:"hidden",ref:a,children:[O,v.length?S.jsx(GN,{disabled:m,onAction:M,groups:v,toolbarVisibleActionsCount:t}):null]})]}),S.jsx(Go,{width:"auto",size:"xs",color:d?"accent":"neutral",intensity:"secondary",wrapperClassName:qN,onClick:()=>{h(L=>!L)},iconLeft:S.jsx(NN,{color:d?"var(--icon-accent)":"var(--icon-secondary)"}),children:_})]})}const k1=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?C.useLayoutEffect:C.useEffect;function ZN({editor:e,ariaActiveDescendant:t,ariaAutoComplete:n,ariaControls:r,ariaDescribedBy:o,ariaErrorMessage:i,ariaExpanded:s,ariaInvalid:a,ariaLabel:l,ariaLabelledBy:c,ariaMultiline:u,ariaOwns:f,ariaRequired:d,autoCapitalize:h,className:g,id:p,role:m="textbox",spellCheck:_=!0,style:y,tabIndex:v,"data-testid":x,...b},w){const[T,E]=C.useState(e.isEditable()),R=C.useCallback(O=>{O&&O.ownerDocument&&O.ownerDocument.defaultView?e.setRootElement(O):e.setRootElement(null)},[e]),M=C.useMemo(()=>(function(...O){return D=>{for(const I of O)typeof I=="function"?I(D):I!=null&&(I.current=D)}})(w,R),[R,w]);return k1(()=>(E(e.isEditable()),e.registerEditableListener(O=>{E(O)})),[e]),S.jsx("div",{"aria-activedescendant":T?t:void 0,"aria-autocomplete":T?n:"none","aria-controls":T?r:void 0,"aria-describedby":o,...i!=null?{"aria-errormessage":i}:{},"aria-expanded":T&&m==="combobox"?!!s:void 0,...a!=null?{"aria-invalid":a}:{},"aria-label":l,"aria-labelledby":c,"aria-multiline":u,"aria-owns":T?f:void 0,"aria-readonly":!T||void 0,"aria-required":d,autoCapitalize:h,className:g,contentEditable:T,"data-testid":x,id:p,ref:M,role:m,spellCheck:_,style:y,tabIndex:v,...b})}const QN=C.forwardRef(ZN);function yy(e){return e.getEditorState().read(l1(e.isComposing()))}const e6=C.forwardRef(t6);function t6(e,t){const{placeholder:n,...r}=e,[o]=nt();return S.jsxs(S.Fragment,{children:[S.jsx(QN,{editor:o,...r,ref:t}),n!=null&&S.jsx(n6,{editor:o,content:n})]})}function n6({content:e,editor:t}){const n=(function(s){const[a,l]=C.useState(()=>yy(s));return k1(()=>{function c(){const u=yy(s);l(u)}return c(),cn(s.registerUpdateListener(()=>{c()}),s.registerEditableListener(()=>{c()}))},[s]),a})(t),[r,o]=C.useState(t.isEditable());if(C.useLayoutEffect(()=>(o(t.isEditable()),t.registerEditableListener(s=>{o(s)})),[t]),!n)return null;let i=null;return typeof e=="function"?i=e(r):e!==null&&(i=e),i===null?null:S.jsx("div",{"aria-hidden":!0,children:i})}const r6=C.createContext(null),Fc={didCatch:!1,error:null};class o6 extends C.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Fc}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(...t){const{error:n}=this.state;n!==null&&(this.props.onReset?.({args:t,reason:"imperative-api"}),this.setState(Fc))}componentDidCatch(t,n){this.props.onError?.(t,n)}componentDidUpdate(t,n){const{didCatch:r}=this.state,{resetKeys:o}=this.props;r&&n.error!==null&&i6(t.resetKeys,o)&&(this.props.onReset?.({next:o,prev:t.resetKeys,reason:"keys"}),this.setState(Fc))}render(){const{children:t,fallbackRender:n,FallbackComponent:r,fallback:o}=this.props,{didCatch:i,error:s}=this.state;let a=t;if(i){const l={error:s,resetErrorBoundary:this.resetErrorBoundary};if(typeof n=="function")a=n(l);else if(r)a=C.createElement(r,l);else if(o!==void 0)a=o;else throw s}return C.createElement(r6.Provider,{value:{didCatch:i,error:s,resetErrorBoundary:this.resetErrorBoundary}},a)}}function i6(e=[],t=[]){return e.length!==t.length||e.some((n,r)=>!Object.is(n,t[r]))}function s6({children:e,onError:t}){return S.jsx(o6,{fallback:S.jsx("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:t,children:e})}const a6=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?C.useLayoutEffect:C.useEffect;function l6(e){return{initialValueFn:()=>e.isEditable(),subscribe:t=>e.registerEditableListener(t)}}function c6(){return(function(e){const[t]=nt(),n=C.useMemo(()=>e(t),[t,e]),[r,o]=C.useState(()=>n.initialValueFn()),i=C.useRef(r);return a6(()=>{const{initialValueFn:s,subscribe:a}=n,l=s();return i.current!==l&&(i.current=l,o(l)),a(c=>{i.current=c,o(c)})},[n,e]),r})(l6)}const u6={name:"@lexical/react/ReactProvider"};function d6(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const qf=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?C.useLayoutEffect:C.useEffect;function f6({editor:e,ErrorBoundary:t}){return(function(n,r){const[o,i]=C.useState(()=>n.getDecorators());return qf(()=>n.registerDecoratorListener(s=>{zi.flushSync(()=>{i(s)})}),[n]),C.useEffect(()=>{i(n.getDecorators())},[n]),C.useMemo(()=>{const s=[],a=Object.keys(o);for(let l=0;l<a.length;l++){const c=a[l],u=S.jsx(r,{onError:d=>n._onError(d),children:S.jsx(C.Suspense,{fallback:null,children:o[c]})}),f=n.getElementByKey(c);f!==null&&s.push(zi.createPortal(u,f,c))}return s},[r,o,n])})(e,t)}function h6({editor:e,ErrorBoundary:t}){return(function(n){const r=X3.maybeFromEditor(n);if(r&&r.hasExtensionByName(u6.name)){for(const o of["@lexical/plain-text","@lexical/rich-text"])r.hasExtensionByName(o)&&d6(320,o);return!0}return!1})(e)?null:S.jsx(f6,{editor:e,ErrorBoundary:t})}function vy(e){return e.getEditorState().read(l1(e.isComposing()))}function g6({contentEditable:e,placeholder:t=null,ErrorBoundary:n}){const[r]=nt();return(function(o){qf(()=>cn(TA(o),vA(o)),[o])})(r),S.jsxs(S.Fragment,{children:[e,S.jsx(p6,{content:t}),S.jsx(h6,{editor:r,ErrorBoundary:n})]})}function p6({content:e}){const[t]=nt(),n=(function(o){const[i,s]=C.useState(()=>vy(o));return qf(()=>{function a(){const l=vy(o);s(l)}return a(),cn(o.registerUpdateListener(()=>{a()}),o.registerEditableListener(()=>{a()}))},[o]),i})(t),r=c6();return n?typeof e=="function"?e(r):e:null}const m6=z.css({width:"100%"}),y6=z.css({pointerEvents:"none"});function v6(e){const{placeholder:t}=e||{},n=C.useRef(null),{alignment:r}=wx(),o=C.useCallback(s=>{if(!t)return null;const a=typeof t=="string"||typeof t=="object"&&t.hasWrapper,l=typeof t=="string"?t:t.renderContent(s);return a?S.jsx(ce,{variant:"body-2",colorName:"tertiary",children:l}):S.jsx(S.Fragment,{children:l})},[t]),i=C.useCallback(s=>{const a=o(s);if(!a)return null;const l={left:"flex-start",center:"center",right:"flex-end"};return S.jsx(q,{absolute:!0,w:"full",top:0,left:0,alignItems:l[r],className:y6,children:a})},[o,r]);return S.jsx(q,{relative:!0,row:!0,w:"full",flexGrow:1,children:S.jsx(g6,{contentEditable:S.jsx(e6,{ref:n,className:m6,"aria-placeholder":"markdown editor",placeholder:i}),ErrorBoundary:s6})})}const _6=z.css({counterReset:"line"}),x6=z.css({display:"grid",gridTemplateColumns:"3ch 1fr",columnGap:"var(--spacing-sm)",whiteSpace:"pre-wrap",":before":{counterIncrement:"line",content:"counter(line)",color:"var(--text-accent)",userSelect:"none",textAlign:"right"}});function b6(){const{markdownText:e}=tf(),t=e.split(`
|
|
40
|
-
`);return S.jsx("pre",{className:_6,children:t.map((n,r)=>S.jsx(ce,{tag:"span",className:x6,children:n||" "},r))})}const C6="_text_1q22k_8",w6="_paragraph_1q22k_12",S6="_h1_1q22k_17",E6="_h2_1q22k_22",T6="_h3_1q22k_27",R6="_h4_1q22k_32",xo={text:C6,paragraph:w6,h1:S6,h2:E6,h3:T6,h4:R6},k6=z.css({borderSpacing:"0",borderCollapse:"separate"}),A6=z.css({border:"1px solid var(--border-neutral-primary)",padding:"var(--spacing-sm) var(--spacing-sm)"}),M6=z.css({color:"var(--text-accent)"}),N6=z.css({fontWeight:"bold"}),P6=z.css({textDecoration:"underline"}),F6=z.css({textDecoration:"line-through"}),L6=z.css({textDecoration:"underline line-through"}),O6=z.css({fontStyle:"italic"}),I6=z.css({color:"var(--text-accent)",textDecoration:"underline"}),$6={table:k6,tableCell:A6,hashtag:M6,link:I6,text:{base:xo.text,bold:N6,underline:P6,strikethrough:F6,underlineStrikethrough:L6,italic:O6},heading:{h1:xo.h1,h2:xo.h2,h3:xo.h3,h4:xo.h4},paragraph:xo.paragraph};function D6(){return{namespace:"ui-kit-markdown-text-editor",nodes:[lo,Gt,uo,Er,
|
|
41
|
-
`)}},ad=[K6,WN,$N,...ys];function U6({defaultValue:e}){const[t]=nt();return C.useEffect(()=>{t.update(()=>{e&&_M(e,ad)})},[t]),null}function G6({label:e,plugins:t,field:n,disabled:r=!1,locale:o,toolbar:i,defaultMarkdown:s,events:a={}}){const[l,c]=C.useState(""),[u,f]=C.useState(!1),{availableActions:d,onImagesUpload:h}=i||{},g=C.useMemo(()=>D6(),[]),p=C.useMemo(()=>({isEditable:!r,isPreviewMode:u,setPreviewMode:f,markdownText:l}),[r,u,l]),m=C.useMemo(()=>({availableActions:d||V6}),[d]),_=C.useCallback(v=>{c(v),a.onMarkdownChange&&a.onMarkdownChange(v)},[a]),y=C.useCallback(v=>{v.read(()=>{const x=xM(ad);_(x),a.onEditorStateChange&&a.onEditorStateChange(v)})},[_,a]);return S.jsx(HR,{locale:o,children:S.jsx(wM,{initialConfig:g,children:S.jsx(V0.Provider,{value:p,children:S.jsxs(j0.Provider,{value:m,children:[S.jsxs(q,{flex:!0,w:"full",borderRadius:"var(--corner-lg)",p:"var(--spacing-lg)",gap:"var(--spacing-sm)",backgroundColor:"var(--fill-neutral-secondary)",children:[e?S.jsx(ce,{variant:"headline-3",fontWeight:"semibold",children:e}):null,S.jsx(JN,{onImagesUpload:h}),S.jsx(q,{backgroundColor:"var(--fill-neutral-primary)",border:"1px solid var(--border-neutral-alpha-basic)",borderRadius:"var(--corner-md)",p:"var(--spacing-md) var(--spacing-lg)",w:"full",h:144,overflow:"auto",children:u?S.jsx(b6,{}):S.jsx(v6,{...n})})]}),S.jsx(bM,{}),S.jsx(FM,{}),S.jsx(yN,{}),S.jsx(PM,{}),S.jsx(DM,{transformers:ad}),S.jsx(jM,{onChange:y}),S.jsx(j6,{}),S.jsx(U6,{defaultValue:s}),S.jsx(B6,{}),t]})})})})}const q6="_input_5xq63_8",Y6="_disabled_5xq63_29",X6="_error_5xq63_37",J6="_success_5xq63_41",Z6="_white_5xq63_50",Q6="_gray_5xq63_54",eP="_glow_5xq63_58",bo={input:q6,disabled:Y6,error:X6,success:J6,white:Z6,gray:Q6,glow:eP};function tP(e){const t=C.useRef(void 0);return C.useEffect(()=>{t.current=e},[e]),t.current}const A1=C.forwardRef(({length:e=6,label:t,prompt:n,error:r,errorText:o,success:i,disabled:s,autoFocus:a,center:l,secure:c,loading:u,background:f="gray",numeric:d=!0,className:h,value:g,defaultValue:p,onChange:m,onComplete:_},y)=>{const v=typeof g=="string",x=v?g:p,b=typeof x=="string"?x.slice(0,e):"",[w,T]=so(v?g:void 0,b),[E,R]=C.useState(()=>{const P=b.slice(0,e);return Array.from({length:e},(A,$)=>P[$]??"")}),M=C.useRef(void 0),O=tP(g),D=C.useRef([]);C.useEffect(()=>{if(!v)return;const P=g??"";if(P===O)return;if(P===M.current){M.current=void 0;return}const A=P.slice(0,e);R(Array.from({length:e},($,H)=>A[H]??""))},[v,g,e,O]);const I=C.useCallback((P,A)=>{const $=P.slice(0,e);A?.fromInternal&&(M.current=$),T($),m?.($),$.length===e&&_?.($)},[e,m,_,T]);C.useImperativeHandle(y,()=>({focus:()=>{D.current[0]?.focus()},blur:()=>{D.current.forEach(P=>P?.blur())},get value(){return w||""},setValue:P=>{const A=P.slice(0,e);R(Array.from({length:e},($,H)=>A[H]??"")),I(A,{fromInternal:!0})},clear:()=>{R(Array.from({length:e},()=>"")),I("",{fromInternal:!0})}}),[e,I,w]);const L=C.useCallback((P,A)=>{if(s)return;let $=A;if(d&&($=$.replace(/\D/g,"")),$.length>1){const X=E.slice(0,P).join("")+$+E.slice(P+1).join(""),se=Array.from({length:e},(we,te)=>X[te]??"");R(se),I(X,{fromInternal:!0});const re=Math.min(P+$.length,e-1),he=D.current[re];he?.focus(),he?.select();return}const H=E[P],Q=[...E];Q[P]=$,R(Q);const J=Q.join("");if(I(J,{fromInternal:!0}),!H&&$&&P<e-1){const X=D.current[P+1];X?.focus(),X?.select()}},[E,s,e,d,I]),B=C.useCallback((P,A)=>{if(!s){if(A.key==="Backspace"){A.preventDefault();const $=D.current[P];if(E[P]){const H=[...E];H[P]="",R(H),I(H.join(""),{fromInternal:!0}),$?.focus();return}if(P>0){const H=D.current[P-1];H?.focus(),H?.select()}return}A.key==="ArrowLeft"&&P>0&&(A.preventDefault(),D.current[P-1]?.focus()),A.key==="ArrowRight"&&P<e-1&&(A.preventDefault(),D.current[P+1]?.focus())}},[E,s,e,I]),K=C.useCallback((P,A)=>{if(s)return;A.preventDefault();let $=A.clipboardData.getData("text");if(d&&($=$.replace(/\D/g,"")),!$)return;const H=e-P,Q=Math.min($.length,H),J=$.slice(0,Q),X=[...E];for(let we=0;we<Q;we++)X[P+we]=J[we]??"";R(X);const se=X.join("");I(se,{fromInternal:!0});const re=Math.min(P+Q-1,e-1),he=D.current[re];he?.focus(),he?.select()},[E,s,e,d,I]);return S.jsxs(q,{w:"full",gap:"var(--spacing-sm)",className:h,center:l,children:[t&&S.jsx(ce,{variant:"body-2",fontWeight:"regular",colorName:"tertiary",children:t}),S.jsx(q,{row:!0,w:"full",gap:"var(--spacing-sm)",center:l,className:z.cx({[bo.disabled]:s}),children:Array.from({length:e}).map((P,A)=>S.jsxs(q,{relative:!0,display:"inline-block",children:[S.jsx("input",{ref:$=>{D.current[A]=$},className:z.cx(bo.input,bo[f],r&&bo.error,i&&bo.success,E[A]&&z.css({caretColor:"transparent"})),inputMode:d?"numeric":"text",type:c?"password":"text",maxLength:1,autoFocus:a&&A===0,disabled:s||u,value:E[A],onChange:$=>L(A,$.target.value),onKeyDown:$=>B(A,$),onPaste:$=>K(A,$)}),S.jsx(Ya.span,{className:bo.glow,variants:nP,custom:A,initial:"idle",animate:u?"wave":"idle"})]},A))}),n&&S.jsx(ce,{variant:"caption-1",colorName:"tertiary",children:n}),o&&r&&S.jsx(ce,{variant:"body-2",colorName:"negative",fontWeight:"regular",children:o})]})}),nP={idle:{opacity:0,scale:1,transition:{duration:.18}},wave:(e=0)=>({opacity:[0,.2,0],scale:[1,1.03,1],transition:{duration:1.5,delay:e*.15,repeat:1/0,ease:[.42,0,.58,1]}})};A1.displayName="OtpInput";const M1=C.createContext(null),rP=()=>C.useContext(M1),oP="_radio_zru2j_8",iP="_disabled_zru2j_16",sP="_side_right_zru2j_21",Si={radio:oP,disabled:iP,side_right:sP,"read-only":"_read-only_zru2j_26"},_y={sm:{inner:12,outer:20},md:{inner:16,outer:24}},N1=C.forwardRef(({value:e,children:t,checked:n,defaultChecked:r,onChange:o,disabled:i,className:s,description:a,size:l,side:c,readOnly:u,error:f},d)=>{const h=rP(),g=!!h,p=n!==void 0,[m,_]=so(n,r),y=g?h.value===e:p?n:m,v=h?.disabled||i,x=l??h?.size??"md",b=c??h?.side??"left",w=u??h?.readOnly??!1,T=f??h?.error??!1,E=_y[x].outer,R=_y[x].inner,M=()=>{v||w||(g?h.setValue?.(e):(p||_(!y),o?.(!y)))},O=y&&T?"var(--fill-negative-tint)":y?"var(--fill-accent-tint)":"var(--fill-bg-secondary)",D=y&&T?"var(--fill-negative-primary)":y?"var(--fill-accent-primary)":void 0,I=y&&T||T&&!y?"var(--border-negative-secondary)":"var(--border-neutral-alpha-low)";return S.jsxs("button",{ref:d,role:"radio",type:"button","data-value":e,"aria-checked":y,"aria-disabled":v||void 0,tabIndex:y?0:-1,className:z.cx([Si.radio,y&&Si.checked,v&&Si.disabled,b==="right"&&Si.side_right,w&&Si["read-only"],s]),onClick:M,children:[S.jsx(q,{w:E,h:E,backgroundColor:O,borderWidth:y?0:1,borderColor:I,borderStyle:"solid",center:!0,borderRadius:"var(--corner-full-round)",children:S.jsx(q,{w:R,h:R,backgroundColor:D,borderRadius:"var(--corner-full-round)","aria-hidden":!0})}),S.jsxs(q,{alignItems:"flex-start",children:[S.jsx(ce,{variant:x==="sm"?"body-2":"body-1",tag:"span",left:!0,children:t}),a&&S.jsx(ce,{tag:"span",variant:"body-2",colorName:"secondary",children:a})]})]})});N1.displayName="Radio";const P1=C.forwardRef(({label:e,value:t,defaultValue:n,onChange:r,children:o,className:i,error:s=!1,disabled:a=!1,readOnly:l=!1,side:c="left",size:u="md"},f)=>{const[d,h]=so(t,n),g=t!==void 0,p=g?t:d,m=C.useCallback(y=>{g||h(y),r?.(y)},[g,r,h]),_=C.useRef(null);return C.useImperativeHandle(f,()=>_.current),S.jsx(M1.Provider,{value:{value:p,readOnly:l,disabled:a,setValue:m,size:u,side:c,error:s},children:S.jsxs(q,{gap:"var(--spacing-sm)",ref:_,role:"radiogroup","aria-invalid":s||void 0,className:i,children:[typeof e=="string"?S.jsx(ce,{colorName:"secondary",children:e}):e,S.jsx(q,{gap:"var(--spacing-lg)",children:o})]})})});P1.displayName="RadioGroup";const aP="_primary_svt6d_8",lP="_secondary_svt6d_13",cP="_button_svt6d_18",er={primary:aP,secondary:lP,button:cP,"button-active":"_button-active_svt6d_32","icon-container":"_icon-container_svt6d_35","button-primary":"_button-primary_svt6d_47","button-secondary":"_button-secondary_svt6d_51","button-disabled":"_button-disabled_svt6d_55","full-width":"_full-width_svt6d_60"};function uP({value:e,onChange:t,options:n,variant:r="primary",fullWidth:o=!1,className:i}){return S.jsx(q,{row:!0,alignItems:"center",borderRadius:"var(--corner-md)",p:"var(--spacing-xs)",gap:"var(--spacing-md)",className:z.cx(er[r],o&&er["full-width"],i),children:n.map(s=>{const a=s.value===e,l=s.disabled,c=s.separatorAfter??!1;return S.jsxs(C.Fragment,{children:[S.jsxs("button",{type:"button",disabled:l,className:z.cx(er.button,o&&er["full-width"],a&&er["button-active"],a&&er[`button-${r}`],l&&er["button-disabled"]),onClick:()=>!l&&t(s.value),children:[s.icon&&S.jsx(q,{alignItems:"center",justifyContent:"center",className:er["icon-container"],children:s.icon}),s.label&&S.jsx(ce,{colorName:a?"primary":"tertiary",children:s.label}),!l&&S.jsx(io,{color:"var(--fill-bg-overlay-primary)"})]}),c&&S.jsx(q,{w:1,h:24,backgroundColor:"var(--fill-bg-tertiary)"})]},s.value)})})}function yl(){return typeof window<"u"}function di(e){return F1(e)?(e.nodeName||"").toLowerCase():"#document"}function Nt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Mn(e){var t;return(t=(F1(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function F1(e){return yl()?e instanceof Node||e instanceof Nt(e).Node:!1}function De(e){return yl()?e instanceof Element||e instanceof Nt(e).Element:!1}function wt(e){return yl()?e instanceof HTMLElement||e instanceof Nt(e).HTMLElement:!1}function ld(e){return!yl()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Nt(e).ShadowRoot}const dP=new Set(["inline","contents"]);function vs(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Ut(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!dP.has(o)}const fP=new Set(["table","td","th"]);function hP(e){return fP.has(di(e))}const gP=[":popover-open",":modal"];function vl(e){return gP.some(t=>{try{return e.matches(t)}catch{return!1}})}const pP=["transform","translate","scale","rotate","perspective"],mP=["transform","translate","scale","rotate","perspective","filter"],yP=["paint","layout","strict","content"];function Yf(e){const t=_l(),n=De(e)?Ut(e):e;return pP.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||mP.some(r=>(n.willChange||"").includes(r))||yP.some(r=>(n.contain||"").includes(r))}function vP(e){let t=Jn(e);for(;wt(t)&&!Un(t);){if(Yf(t))return t;if(vl(t))return null;t=Jn(t)}return null}function _l(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const _P=new Set(["html","body","#document"]);function Un(e){return _P.has(di(e))}function Ut(e){return Nt(e).getComputedStyle(e)}function xl(e){return De(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Jn(e){if(di(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ld(e)&&e.host||Mn(e);return ld(t)?t.host:t}function L1(e){const t=Jn(e);return Un(t)?e.ownerDocument?e.ownerDocument.body:e.body:wt(t)&&vs(t)?t:L1(t)}function ur(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=L1(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=Nt(o);if(i){const a=cd(s);return t.concat(s,s.visualViewport||[],vs(o)?o:[],a&&n?ur(a):[])}return t.concat(o,ur(o,[],n))}function cd(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const _r=Math.min,Ot=Math.max,Ba=Math.round,Ks=Math.floor,kn=e=>({x:e,y:e}),xP={left:"right",right:"left",bottom:"top",top:"bottom"},bP={start:"end",end:"start"};function ud(e,t,n){return Ot(e,_r(t,n))}function fi(e,t){return typeof e=="function"?e(t):e}function xr(e){return e.split("-")[0]}function hi(e){return e.split("-")[1]}function O1(e){return e==="x"?"y":"x"}function Xf(e){return e==="y"?"height":"width"}const CP=new Set(["top","bottom"]);function Hn(e){return CP.has(xr(e))?"y":"x"}function Jf(e){return O1(Hn(e))}function wP(e,t,n){n===void 0&&(n=!1);const r=hi(e),o=Jf(e),i=Xf(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=za(s)),[s,za(s)]}function SP(e){const t=za(e);return[dd(e),t,dd(t)]}function dd(e){return e.replace(/start|end/g,t=>bP[t])}const xy=["left","right"],by=["right","left"],EP=["top","bottom"],TP=["bottom","top"];function RP(e,t,n){switch(e){case"top":case"bottom":return n?t?by:xy:t?xy:by;case"left":case"right":return t?EP:TP;default:return[]}}function kP(e,t,n,r){const o=hi(e);let i=RP(xr(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(dd)))),i}function za(e){return e.replace(/left|right|bottom|top/g,t=>xP[t])}function AP(e){return{top:0,right:0,bottom:0,left:0,...e}}function I1(e){return typeof e!="number"?AP(e):{top:e,right:e,bottom:e,left:e}}function Wa(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function MP(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function NP(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function PP(){return/apple/i.test(navigator.vendor)}function FP(){return MP().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function LP(){return NP().includes("jsdom/")}const Cy="data-floating-ui-focusable",OP="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function wy(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function es(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&ld(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Ro(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Lc(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function IP(e){return e.matches("html,body")}function jr(e){return e?.ownerDocument||document}function $1(e){return wt(e)&&e.matches(OP)}function $P(e){if(!e||LP())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function DP(e){return e?e.hasAttribute(Cy)?e:e.querySelector("["+Cy+"]")||e:null}function la(e,t,n){return n===void 0&&(n=!0),e.filter(o=>{var i;return o.parentId===t&&(!n||((i=o.context)==null?void 0:i.open))}).flatMap(o=>[o,...la(e,o.id,n)])}function VP(e){return"nativeEvent"in e}function ts(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var jP=typeof document<"u",BP=function(){},Qo=jP?C.useLayoutEffect:BP;const zP={...N};function Us(e){const t=N.useRef(e);return Qo(()=>{t.current=e}),t}const WP=zP.useInsertionEffect,HP=WP||(e=>e());function vn(e){const t=N.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return HP(()=>{t.current=e}),N.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function Sy(e,t,n){let{reference:r,floating:o}=e;const i=Hn(t),s=Jf(t),a=Xf(s),l=xr(t),c=i==="y",u=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[a]/2-o[a]/2;let h;switch(l){case"top":h={x:u,y:r.y-o.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-o.width,y:f};break;default:h={x:r.x,y:r.y}}switch(hi(t)){case"start":h[s]-=d*(n&&c?-1:1);break;case"end":h[s]+=d*(n&&c?-1:1);break}return h}const KP=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=Sy(c,r,l),d=r,h={},g=0;for(let p=0;p<a.length;p++){const{name:m,fn:_}=a[p],{x:y,y:v,data:x,reset:b}=await _({x:u,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:h,rects:c,platform:s,elements:{reference:e,floating:t}});u=y??u,f=v??f,h={...h,[m]:{...h[m],...x}},b&&g<=50&&(g++,typeof b=="object"&&(b.placement&&(d=b.placement),b.rects&&(c=b.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):b.rects),{x:u,y:f}=Sy(c,d,l)),p=-1)}return{x:u,y:f,placement:d,strategy:o,middlewareData:h}};async function Zf(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:d=!1,padding:h=0}=fi(t,e),g=I1(h),m=a[d?f==="floating"?"reference":"floating":f],_=Wa(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(m)))==null||n?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),y=f==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,v=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),x=await(i.isElement==null?void 0:i.isElement(v))?await(i.getScale==null?void 0:i.getScale(v))||{x:1,y:1}:{x:1,y:1},b=Wa(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:v,strategy:l}):y);return{top:(_.top-b.top+g.top)/x.y,bottom:(b.bottom-_.bottom+g.bottom)/x.y,left:(_.left-b.left+g.left)/x.x,right:(b.right-_.right+g.right)/x.x}}const UP=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=fi(e,t)||{};if(c==null)return{};const f=I1(u),d={x:n,y:r},h=Jf(o),g=Xf(h),p=await s.getDimensions(c),m=h==="y",_=m?"top":"left",y=m?"bottom":"right",v=m?"clientHeight":"clientWidth",x=i.reference[g]+i.reference[h]-d[h]-i.floating[g],b=d[h]-i.reference[h],w=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let T=w?w[v]:0;(!T||!await(s.isElement==null?void 0:s.isElement(w)))&&(T=a.floating[v]||i.floating[g]);const E=x/2-b/2,R=T/2-p[g]/2-1,M=_r(f[_],R),O=_r(f[y],R),D=M,I=T-p[g]-O,L=T/2-p[g]/2+E,B=ud(D,L,I),K=!l.arrow&&hi(o)!=null&&L!==B&&i.reference[g]/2-(L<D?M:O)-p[g]/2<0,P=K?L<D?L-D:L-I:0;return{[h]:d[h]+P,data:{[h]:B,centerOffset:L-B-P,...K&&{alignmentOffset:P}},reset:K}}}),GP=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:p=!0,...m}=fi(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const _=xr(o),y=Hn(a),v=xr(a)===a,x=await(l.isRTL==null?void 0:l.isRTL(c.floating)),b=d||(v||!p?[za(a)]:SP(a)),w=g!=="none";!d&&w&&b.push(...kP(a,p,g,x));const T=[a,...b],E=await Zf(t,m),R=[];let M=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&R.push(E[_]),f){const L=wP(o,s,x);R.push(E[L[0]],E[L[1]])}if(M=[...M,{placement:o,overflows:R}],!R.every(L=>L<=0)){var O,D;const L=(((O=i.flip)==null?void 0:O.index)||0)+1,B=T[L];if(B&&(!(f==="alignment"?y!==Hn(B):!1)||M.every(A=>Hn(A.placement)===y?A.overflows[0]>0:!0)))return{data:{index:L,overflows:M},reset:{placement:B}};let K=(D=M.filter(P=>P.overflows[0]<=0).sort((P,A)=>P.overflows[1]-A.overflows[1])[0])==null?void 0:D.placement;if(!K)switch(h){case"bestFit":{var I;const P=(I=M.filter(A=>{if(w){const $=Hn(A.placement);return $===y||$==="y"}return!0}).map(A=>[A.placement,A.overflows.filter($=>$>0).reduce(($,H)=>$+H,0)]).sort((A,$)=>A[1]-$[1])[0])==null?void 0:I[0];P&&(K=P);break}case"initialPlacement":K=a;break}if(o!==K)return{reset:{placement:K}}}return{}}}},qP=new Set(["left","top"]);async function YP(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=xr(n),a=hi(n),l=Hn(n)==="y",c=qP.has(s)?-1:1,u=i&&l?-1:1,f=fi(t,e);let{mainAxis:d,crossAxis:h,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof g=="number"&&(h=a==="end"?g*-1:g),l?{x:h*u,y:d*c}:{x:d*c,y:h*u}}const XP=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await YP(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},JP=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:m=>{let{x:_,y}=m;return{x:_,y}}},...l}=fi(e,t),c={x:n,y:r},u=await Zf(t,l),f=Hn(xr(o)),d=O1(f);let h=c[d],g=c[f];if(i){const m=d==="y"?"top":"left",_=d==="y"?"bottom":"right",y=h+u[m],v=h-u[_];h=ud(y,h,v)}if(s){const m=f==="y"?"top":"left",_=f==="y"?"bottom":"right",y=g+u[m],v=g-u[_];g=ud(y,g,v)}const p=a.fn({...t,[d]:h,[f]:g});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[d]:i,[f]:s}}}}}},ZP=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=fi(e,t),u=await Zf(t,c),f=xr(o),d=hi(o),h=Hn(o)==="y",{width:g,height:p}=i.floating;let m,_;f==="top"||f==="bottom"?(m=f,_=d===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(_=f,m=d==="end"?"top":"bottom");const y=p-u.top-u.bottom,v=g-u.left-u.right,x=_r(p-u[m],y),b=_r(g-u[_],v),w=!t.middlewareData.shift;let T=x,E=b;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(E=v),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=y),w&&!d){const M=Ot(u.left,0),O=Ot(u.right,0),D=Ot(u.top,0),I=Ot(u.bottom,0);h?E=g-2*(M!==0||O!==0?M+O:Ot(u.left,u.right)):T=p-2*(D!==0||I!==0?D+I:Ot(u.top,u.bottom))}await l({...t,availableWidth:E,availableHeight:T});const R=await s.getDimensions(a.floating);return g!==R.width||p!==R.height?{reset:{rects:!0}}:{}}}};function D1(e){const t=Ut(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=wt(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Ba(n)!==i||Ba(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function Qf(e){return De(e)?e:e.contextElement}function Ho(e){const t=Qf(e);if(!wt(t))return kn(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=D1(t);let s=(i?Ba(n.width):n.width)/r,a=(i?Ba(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const QP=kn(0);function V1(e){const t=Nt(e);return!_l()||!t.visualViewport?QP:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function eF(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Nt(e)?!1:t}function oo(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Qf(e);let s=kn(1);t&&(r?De(r)&&(s=Ho(r)):s=Ho(e));const a=eF(i,n,r)?V1(i):kn(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,f=o.height/s.y;if(i){const d=Nt(i),h=r&&De(r)?Nt(r):r;let g=d,p=cd(g);for(;p&&r&&h!==g;){const m=Ho(p),_=p.getBoundingClientRect(),y=Ut(p),v=_.left+(p.clientLeft+parseFloat(y.paddingLeft))*m.x,x=_.top+(p.clientTop+parseFloat(y.paddingTop))*m.y;l*=m.x,c*=m.y,u*=m.x,f*=m.y,l+=v,c+=x,g=Nt(p),p=cd(g)}}return Wa({width:u,height:f,x:l,y:c})}function bl(e,t){const n=xl(e).scrollLeft;return t?t.left+n:oo(Mn(e)).left+n}function j1(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-bl(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function tF(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=Mn(r),a=t?vl(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=kn(1);const u=kn(0),f=wt(r);if((f||!f&&!i)&&((di(r)!=="body"||vs(s))&&(l=xl(r)),wt(r))){const h=oo(r);c=Ho(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}const d=s&&!f&&!i?j1(s,l):kn(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 nF(e){return Array.from(e.getClientRects())}function rF(e){const t=Mn(e),n=xl(e),r=e.ownerDocument.body,o=Ot(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Ot(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+bl(e);const a=-n.scrollTop;return Ut(r).direction==="rtl"&&(s+=Ot(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}const Ey=25;function oF(e,t){const n=Nt(e),r=Mn(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const u=_l();(!u||u&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const c=bl(r);if(c<=0){const u=r.ownerDocument,f=u.body,d=getComputedStyle(f),h=u.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,g=Math.abs(r.clientWidth-f.clientWidth-h);g<=Ey&&(i-=g)}else c<=Ey&&(i+=c);return{width:i,height:s,x:a,y:l}}const iF=new Set(["absolute","fixed"]);function sF(e,t){const n=oo(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=wt(e)?Ho(e):kn(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:s,height:a,x:l,y:c}}function Ty(e,t,n){let r;if(t==="viewport")r=oF(e,n);else if(t==="document")r=rF(Mn(e));else if(De(t))r=sF(t,n);else{const o=V1(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Wa(r)}function B1(e,t){const n=Jn(e);return n===t||!De(n)||Un(n)?!1:Ut(n).position==="fixed"||B1(n,t)}function aF(e,t){const n=t.get(e);if(n)return n;let r=ur(e,[],!1).filter(a=>De(a)&&di(a)!=="body"),o=null;const i=Ut(e).position==="fixed";let s=i?Jn(e):e;for(;De(s)&&!Un(s);){const a=Ut(s),l=Yf(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&iF.has(o.position)||vs(s)&&!l&&B1(e,s))?r=r.filter(u=>u!==s):o=a,s=Jn(s)}return t.set(e,r),r}function lF(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?vl(t)?[]:aF(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const f=Ty(t,u,o);return c.top=Ot(f.top,c.top),c.right=_r(f.right,c.right),c.bottom=_r(f.bottom,c.bottom),c.left=Ot(f.left,c.left),c},Ty(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function cF(e){const{width:t,height:n}=D1(e);return{width:t,height:n}}function uF(e,t,n){const r=wt(t),o=Mn(t),i=n==="fixed",s=oo(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=kn(0);function c(){l.x=bl(o)}if(r||!r&&!i)if((di(t)!=="body"||vs(o))&&(a=xl(t)),r){const h=oo(t,!0,i,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else o&&c();i&&!r&&o&&c();const u=o&&!r&&!i?j1(o,a):kn(0),f=s.left+a.scrollLeft-l.x-u.x,d=s.top+a.scrollTop-l.y-u.y;return{x:f,y:d,width:s.width,height:s.height}}function Oc(e){return Ut(e).position==="static"}function Ry(e,t){if(!wt(e)||Ut(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Mn(e)===n&&(n=n.ownerDocument.body),n}function z1(e,t){const n=Nt(e);if(vl(e))return n;if(!wt(e)){let o=Jn(e);for(;o&&!Un(o);){if(De(o)&&!Oc(o))return o;o=Jn(o)}return n}let r=Ry(e,t);for(;r&&hP(r)&&Oc(r);)r=Ry(r,t);return r&&Un(r)&&Oc(r)&&!Yf(r)?n:r||vP(e)||n}const dF=async function(e){const t=this.getOffsetParent||z1,n=this.getDimensions,r=await n(e.floating);return{reference:uF(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function fF(e){return Ut(e).direction==="rtl"}const hF={convertOffsetParentRelativeRectToViewportRelativeRect:tF,getDocumentElement:Mn,getClippingRect:lF,getOffsetParent:z1,getElementRects:dF,getClientRects:nF,getDimensions:cF,getScale:Ho,isElement:De,isRTL:fF};function W1(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function gF(e,t){let n=null,r;const o=Mn(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const c=e.getBoundingClientRect(),{left:u,top:f,width:d,height:h}=c;if(a||t(),!d||!h)return;const g=Ks(f),p=Ks(o.clientWidth-(u+d)),m=Ks(o.clientHeight-(f+h)),_=Ks(u),v={rootMargin:-g+"px "+-p+"px "+-m+"px "+-_+"px",threshold:Ot(0,_r(1,l))||1};let x=!0;function b(w){const T=w[0].intersectionRatio;if(T!==l){if(!x)return s();T?s(!1,T):r=setTimeout(()=>{s(!1,1e-7)},1e3)}T===1&&!W1(c,e.getBoundingClientRect())&&s(),x=!1}try{n=new IntersectionObserver(b,{...v,root:o.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return s(!0),i}function eh(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Qf(e),u=o||i?[...c?ur(c):[],...ur(t)]:[];u.forEach(_=>{o&&_.addEventListener("scroll",n,{passive:!0}),i&&_.addEventListener("resize",n)});const f=c&&a?gF(c,n):null;let d=-1,h=null;s&&(h=new ResizeObserver(_=>{let[y]=_;y&&y.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var v;(v=h)==null||v.observe(t)})),n()}),c&&!l&&h.observe(c),h.observe(t));let g,p=l?oo(e):null;l&&m();function m(){const _=oo(e);p&&!W1(p,_)&&n(),p=_,g=requestAnimationFrame(m)}return n(),()=>{var _;u.forEach(y=>{o&&y.removeEventListener("scroll",n),i&&y.removeEventListener("resize",n)}),f?.(),(_=h)==null||_.disconnect(),h=null,l&&cancelAnimationFrame(g)}}const pF=XP,mF=JP,yF=GP,vF=ZP,ky=UP,_F=(e,t,n)=>{const r=new Map,o={platform:hF,...n},i={...o.platform,_c:r};return KP(e,t,{...o,platform:i})};var xF=typeof document<"u",bF=function(){},ca=xF?C.useLayoutEffect:bF;function Ha(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Ha(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!Ha(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function H1(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ay(e,t){const n=H1(e);return Math.round(t*n)/n}function Ic(e){const t=N.useRef(e);return ca(()=>{t.current=e}),t}function CF(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,f]=N.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,h]=N.useState(r);Ha(d,r)||h(r);const[g,p]=N.useState(null),[m,_]=N.useState(null),y=N.useCallback(A=>{A!==w.current&&(w.current=A,p(A))},[]),v=N.useCallback(A=>{A!==T.current&&(T.current=A,_(A))},[]),x=i||g,b=s||m,w=N.useRef(null),T=N.useRef(null),E=N.useRef(u),R=l!=null,M=Ic(l),O=Ic(o),D=Ic(c),I=N.useCallback(()=>{if(!w.current||!T.current)return;const A={placement:t,strategy:n,middleware:d};O.current&&(A.platform=O.current),_F(w.current,T.current,A).then($=>{const H={...$,isPositioned:D.current!==!1};L.current&&!Ha(E.current,H)&&(E.current=H,PC.flushSync(()=>{f(H)}))})},[d,t,n,O,D]);ca(()=>{c===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,f(A=>({...A,isPositioned:!1})))},[c]);const L=N.useRef(!1);ca(()=>(L.current=!0,()=>{L.current=!1}),[]),ca(()=>{if(x&&(w.current=x),b&&(T.current=b),x&&b){if(M.current)return M.current(x,b,I);I()}},[x,b,I,M,R]);const B=N.useMemo(()=>({reference:w,floating:T,setReference:y,setFloating:v}),[y,v]),K=N.useMemo(()=>({reference:x,floating:b}),[x,b]),P=N.useMemo(()=>{const A={position:n,left:0,top:0};if(!K.floating)return A;const $=Ay(K.floating,u.x),H=Ay(K.floating,u.y);return a?{...A,transform:"translate("+$+"px, "+H+"px)",...H1(K.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:$,top:H}},[n,a,K.floating,u.x,u.y]);return N.useMemo(()=>({...u,update:I,refs:B,elements:K,floatingStyles:P}),[u,I,B,K,P])}const wF=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?ky({element:r.current,padding:o}).fn(n):{}:r?ky({element:r,padding:o}).fn(n):{}}}},th=(e,t)=>({...pF(e),options:[e,t]}),nh=(e,t)=>({...mF(e),options:[e,t]}),rh=(e,t)=>({...yF(e),options:[e,t]}),SF=(e,t)=>({...vF(e),options:[e,t]}),EF=(e,t)=>({...wF(e),options:[e,t]});function K1(e){const t=N.useRef(void 0),n=N.useCallback(r=>{const o=e.map(i=>{if(i!=null){if(typeof i=="function"){const s=i,a=s(r);return typeof a=="function"?a:()=>{s(null)}}return i.current=r,()=>{i.current=null}}});return()=>{o.forEach(i=>i?.())}},e);return N.useMemo(()=>e.every(r=>r==null)?null:r=>{t.current&&(t.current(),t.current=void 0),r!=null&&(t.current=n(r))},e)}const TF="data-floating-ui-focusable",My="active",Ny="selected",RF={...N};let Py=!1,kF=0;const Fy=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+kF++;function AF(){const[e,t]=N.useState(()=>Py?Fy():void 0);return Qo(()=>{e==null&&t(Fy())},[]),N.useEffect(()=>{Py=!0},[]),e}const MF=RF.useId,U1=MF||AF;let fd;process.env.NODE_ENV!=="production"&&(fd=new Set);function NF(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=fd)!=null&&e.has(o))){var i;(i=fd)==null||i.add(o),console.error(o)}}function PF(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}const FF=N.createContext(null),LF=N.createContext(null),oh=()=>{var e;return((e=N.useContext(FF))==null?void 0:e.id)||null},ih=()=>N.useContext(LF);function sh(e){return"data-floating-ui-"+e}function jt(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const Ly=sh("safe-polygon");function $c(e,t,n){if(n&&!ts(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const r=e();return typeof r=="number"?r:r?.[t]}return e?.[t]}function Dc(e){return typeof e=="function"?e():e}function G1(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,elements:s}=e,{enabled:a=!0,delay:l=0,handleClose:c=null,mouseOnly:u=!1,restMs:f=0,move:d=!0}=t,h=ih(),g=oh(),p=Us(c),m=Us(l),_=Us(n),y=Us(f),v=N.useRef(),x=N.useRef(-1),b=N.useRef(),w=N.useRef(-1),T=N.useRef(!0),E=N.useRef(!1),R=N.useRef(()=>{}),M=N.useRef(!1),O=vn(()=>{var P;const A=(P=o.current.openEvent)==null?void 0:P.type;return A?.includes("mouse")&&A!=="mousedown"});N.useEffect(()=>{if(!a)return;function P(A){let{open:$}=A;$||(jt(x),jt(w),T.current=!0,M.current=!1)}return i.on("openchange",P),()=>{i.off("openchange",P)}},[a,i]),N.useEffect(()=>{if(!a||!p.current||!n)return;function P($){O()&&r(!1,$,"hover")}const A=jr(s.floating).documentElement;return A.addEventListener("mouseleave",P),()=>{A.removeEventListener("mouseleave",P)}},[s.floating,n,r,a,p,O]);const D=N.useCallback(function(P,A,$){A===void 0&&(A=!0),$===void 0&&($="hover");const H=$c(m.current,"close",v.current);H&&!b.current?(jt(x),x.current=window.setTimeout(()=>r(!1,P,$),H)):A&&(jt(x),r(!1,P,$))},[m,r]),I=vn(()=>{R.current(),b.current=void 0}),L=vn(()=>{if(E.current){const P=jr(s.floating).body;P.style.pointerEvents="",P.removeAttribute(Ly),E.current=!1}}),B=vn(()=>o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1);N.useEffect(()=>{if(!a)return;function P(J){if(jt(x),T.current=!1,u&&!ts(v.current)||Dc(y.current)>0&&!$c(m.current,"open"))return;const X=$c(m.current,"open",v.current);X?x.current=window.setTimeout(()=>{_.current||r(!0,J,"hover")},X):n||r(!0,J,"hover")}function A(J){if(B()){L();return}R.current();const X=jr(s.floating);if(jt(w),M.current=!1,p.current&&o.current.floatingContext){n||jt(x),b.current=p.current({...o.current.floatingContext,tree:h,x:J.clientX,y:J.clientY,onClose(){L(),I(),B()||D(J,!0,"safe-polygon")}});const re=b.current;X.addEventListener("mousemove",re),R.current=()=>{X.removeEventListener("mousemove",re)};return}(v.current!=="touch"||!es(s.floating,J.relatedTarget))&&D(J)}function $(J){B()||o.current.floatingContext&&(p.current==null||p.current({...o.current.floatingContext,tree:h,x:J.clientX,y:J.clientY,onClose(){L(),I(),B()||D(J)}})(J))}function H(){jt(x)}function Q(J){B()||D(J,!1)}if(De(s.domReference)){const J=s.domReference,X=s.floating;return n&&J.addEventListener("mouseleave",$),d&&J.addEventListener("mousemove",P,{once:!0}),J.addEventListener("mouseenter",P),J.addEventListener("mouseleave",A),X&&(X.addEventListener("mouseleave",$),X.addEventListener("mouseenter",H),X.addEventListener("mouseleave",Q)),()=>{n&&J.removeEventListener("mouseleave",$),d&&J.removeEventListener("mousemove",P),J.removeEventListener("mouseenter",P),J.removeEventListener("mouseleave",A),X&&(X.removeEventListener("mouseleave",$),X.removeEventListener("mouseenter",H),X.removeEventListener("mouseleave",Q))}}},[s,a,e,u,d,D,I,L,r,n,_,h,m,p,o,B,y]),Qo(()=>{var P;if(a&&n&&(P=p.current)!=null&&(P=P.__options)!=null&&P.blockPointerEvents&&O()){E.current=!0;const $=s.floating;if(De(s.domReference)&&$){var A;const H=jr(s.floating).body;H.setAttribute(Ly,"");const Q=s.domReference,J=h==null||(A=h.nodesRef.current.find(X=>X.id===g))==null||(A=A.context)==null?void 0:A.elements.floating;return J&&(J.style.pointerEvents=""),H.style.pointerEvents="none",Q.style.pointerEvents="auto",$.style.pointerEvents="auto",()=>{H.style.pointerEvents="",Q.style.pointerEvents="",$.style.pointerEvents=""}}}},[a,n,g,s,h,p,O]),Qo(()=>{n||(v.current=void 0,M.current=!1,I(),L())},[n,I,L]),N.useEffect(()=>()=>{I(),jt(x),jt(w),L()},[a,s.domReference,I,L]);const K=N.useMemo(()=>{function P(A){v.current=A.pointerType}return{onPointerDown:P,onPointerEnter:P,onMouseMove(A){const{nativeEvent:$}=A;function H(){!T.current&&!_.current&&r(!0,$,"hover")}u&&!ts(v.current)||n||Dc(y.current)===0||M.current&&A.movementX**2+A.movementY**2<2||(jt(w),v.current==="touch"?H():(M.current=!0,w.current=window.setTimeout(H,Dc(y.current))))}}},[u,r,n,_,y]);return N.useMemo(()=>a?{reference:K}:{},[a,K])}function Oy(e){return wt(e.target)&&e.target.tagName==="BUTTON"}function OF(e){return wt(e.target)&&e.target.tagName==="A"}function Iy(e){return $1(e)}function IF(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:i}}=e,{enabled:s=!0,event:a="click",toggle:l=!0,ignoreMouse:c=!1,keyboardHandlers:u=!0,stickIfOpen:f=!0}=t,d=N.useRef(),h=N.useRef(!1),g=N.useMemo(()=>({onPointerDown(p){d.current=p.pointerType},onMouseDown(p){const m=d.current;p.button===0&&a!=="click"&&(ts(m,!0)&&c||(n&&l&&(!(o.current.openEvent&&f)||o.current.openEvent.type==="mousedown")?r(!1,p.nativeEvent,"click"):(p.preventDefault(),r(!0,p.nativeEvent,"click"))))},onClick(p){const m=d.current;if(a==="mousedown"&&d.current){d.current=void 0;return}ts(m,!0)&&c||(n&&l&&(!(o.current.openEvent&&f)||o.current.openEvent.type==="click")?r(!1,p.nativeEvent,"click"):r(!0,p.nativeEvent,"click"))},onKeyDown(p){d.current=void 0,!(p.defaultPrevented||!u||Oy(p))&&(p.key===" "&&!Iy(i)&&(p.preventDefault(),h.current=!0),!OF(p)&&p.key==="Enter"&&r(!(n&&l),p.nativeEvent,"click"))},onKeyUp(p){p.defaultPrevented||!u||Oy(p)||Iy(i)||p.key===" "&&h.current&&(h.current=!1,r(!(n&&l),p.nativeEvent,"click"))}}),[o,i,a,c,u,r,n,f,l]);return N.useMemo(()=>s?{reference:g}:{},[s,g])}const $F={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},DF={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},$y=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e?.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e?.outsidePress)!=null?n:!0}};function q1(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:i}=e,{enabled:s=!0,escapeKey:a=!0,outsidePress:l=!0,outsidePressEvent:c="pointerdown",referencePress:u=!1,referencePressEvent:f="pointerdown",ancestorScroll:d=!1,bubbles:h,capture:g}=t,p=ih(),m=vn(typeof l=="function"?l:()=>!1),_=typeof l=="function"?m:l,y=N.useRef(!1),{escapeKey:v,outsidePress:x}=$y(h),{escapeKey:b,outsidePress:w}=$y(g),T=N.useRef(!1),E=vn(L=>{var B;if(!n||!s||!a||L.key!=="Escape"||T.current)return;const K=(B=i.current.floatingContext)==null?void 0:B.nodeId,P=p?la(p.nodesRef.current,K):[];if(!v&&(L.stopPropagation(),P.length>0)){let A=!0;if(P.forEach($=>{var H;if((H=$.context)!=null&&H.open&&!$.context.dataRef.current.__escapeKeyBubbles){A=!1;return}}),!A)return}r(!1,VP(L)?L.nativeEvent:L,"escape-key")}),R=vn(L=>{var B;const K=()=>{var P;E(L),(P=Ro(L))==null||P.removeEventListener("keydown",K)};(B=Ro(L))==null||B.addEventListener("keydown",K)}),M=vn(L=>{var B;const K=i.current.insideReactTree;i.current.insideReactTree=!1;const P=y.current;if(y.current=!1,c==="click"&&P||K||typeof _=="function"&&!_(L))return;const A=Ro(L),$="["+sh("inert")+"]",H=jr(o.floating).querySelectorAll($);let Q=De(A)?A:null;for(;Q&&!Un(Q);){const re=Jn(Q);if(Un(re)||!De(re))break;Q=re}if(H.length&&De(A)&&!IP(A)&&!es(A,o.floating)&&Array.from(H).every(re=>!es(Q,re)))return;if(wt(A)&&I){const re=Un(A),he=Ut(A),we=/auto|scroll/,te=re||we.test(he.overflowX),ye=re||we.test(he.overflowY),Se=te&&A.clientWidth>0&&A.scrollWidth>A.clientWidth,$e=ye&&A.clientHeight>0&&A.scrollHeight>A.clientHeight,ee=he.direction==="rtl",pe=$e&&(ee?L.offsetX<=A.offsetWidth-A.clientWidth:L.offsetX>A.clientWidth),Ne=Se&&L.offsetY>A.clientHeight;if(pe||Ne)return}const J=(B=i.current.floatingContext)==null?void 0:B.nodeId,X=p&&la(p.nodesRef.current,J).some(re=>{var he;return Lc(L,(he=re.context)==null?void 0:he.elements.floating)});if(Lc(L,o.floating)||Lc(L,o.domReference)||X)return;const se=p?la(p.nodesRef.current,J):[];if(se.length>0){let re=!0;if(se.forEach(he=>{var we;if((we=he.context)!=null&&we.open&&!he.context.dataRef.current.__outsidePressBubbles){re=!1;return}}),!re)return}r(!1,L,"outside-press")}),O=vn(L=>{var B;const K=()=>{var P;M(L),(P=Ro(L))==null||P.removeEventListener(c,K)};(B=Ro(L))==null||B.addEventListener(c,K)});N.useEffect(()=>{if(!n||!s)return;i.current.__escapeKeyBubbles=v,i.current.__outsidePressBubbles=x;let L=-1;function B(H){r(!1,H,"ancestor-scroll")}function K(){window.clearTimeout(L),T.current=!0}function P(){L=window.setTimeout(()=>{T.current=!1},_l()?5:0)}const A=jr(o.floating);a&&(A.addEventListener("keydown",b?R:E,b),A.addEventListener("compositionstart",K),A.addEventListener("compositionend",P)),_&&A.addEventListener(c,w?O:M,w);let $=[];return d&&(De(o.domReference)&&($=ur(o.domReference)),De(o.floating)&&($=$.concat(ur(o.floating))),!De(o.reference)&&o.reference&&o.reference.contextElement&&($=$.concat(ur(o.reference.contextElement)))),$=$.filter(H=>{var Q;return H!==((Q=A.defaultView)==null?void 0:Q.visualViewport)}),$.forEach(H=>{H.addEventListener("scroll",B,{passive:!0})}),()=>{a&&(A.removeEventListener("keydown",b?R:E,b),A.removeEventListener("compositionstart",K),A.removeEventListener("compositionend",P)),_&&A.removeEventListener(c,w?O:M,w),$.forEach(H=>{H.removeEventListener("scroll",B)}),window.clearTimeout(L)}},[i,o,a,_,c,n,r,d,s,v,x,E,b,R,M,w,O]),N.useEffect(()=>{i.current.insideReactTree=!1},[i,_,c]);const D=N.useMemo(()=>({onKeyDown:E,...u&&{[$F[f]]:L=>{r(!1,L.nativeEvent,"reference-press")},...f!=="click"&&{onClick(L){r(!1,L.nativeEvent,"reference-press")}}}}),[E,r,u,f]),I=N.useMemo(()=>({onKeyDown:E,onMouseDown(){y.current=!0},onMouseUp(){y.current=!0},[DF[c]]:()=>{i.current.insideReactTree=!0}}),[E,c,i]);return N.useMemo(()=>s?{reference:D,floating:I}:{},[s,D,I])}function VF(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=U1(),i=N.useRef({}),[s]=N.useState(()=>PF()),a=oh()!=null;if(process.env.NODE_ENV!=="production"){const h=r.reference;h&&!De(h)&&NF("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,c]=N.useState(r.reference),u=vn((h,g,p)=>{i.current.openEvent=h?g:void 0,s.emit("openchange",{open:h,event:g,reason:p,nested:a}),n?.(h,g,p)}),f=N.useMemo(()=>({setPositionReference:c}),[]),d=N.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return N.useMemo(()=>({dataRef:i,open:t,onOpenChange:u,elements:d,events:s,floatingId:o,refs:f}),[t,u,d,s,o,f])}function ah(e){e===void 0&&(e={});const{nodeId:t}=e,n=VF({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,s]=N.useState(null),[a,l]=N.useState(null),u=o?.domReference||i,f=N.useRef(null),d=ih();Qo(()=>{u&&(f.current=u)},[u]);const h=CF({...e,elements:{...o,...a&&{reference:a}}}),g=N.useCallback(v=>{const x=De(v)?{getBoundingClientRect:()=>v.getBoundingClientRect(),getClientRects:()=>v.getClientRects(),contextElement:v}:v;l(x),h.refs.setReference(x)},[h.refs]),p=N.useCallback(v=>{(De(v)||v===null)&&(f.current=v,s(v)),(De(h.refs.reference.current)||h.refs.reference.current===null||v!==null&&!De(v))&&h.refs.setReference(v)},[h.refs]),m=N.useMemo(()=>({...h.refs,setReference:p,setPositionReference:g,domReference:f}),[h.refs,p,g]),_=N.useMemo(()=>({...h.elements,domReference:u}),[h.elements,u]),y=N.useMemo(()=>({...h,...r,refs:m,elements:_,nodeId:t}),[h,m,_,t,r]);return Qo(()=>{r.dataRef.current.floatingContext=y;const v=d?.nodesRef.current.find(x=>x.id===t);v&&(v.context=y)}),N.useMemo(()=>({...h,context:y,refs:m,elements:_}),[h,m,_,y])}function Vc(){return FP()&&PP()}function jF(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:i,elements:s}=e,{enabled:a=!0,visibleOnly:l=!0}=t,c=N.useRef(!1),u=N.useRef(-1),f=N.useRef(!0);N.useEffect(()=>{if(!a)return;const h=Nt(s.domReference);function g(){!n&&wt(s.domReference)&&s.domReference===wy(jr(s.domReference))&&(c.current=!0)}function p(){f.current=!0}function m(){f.current=!1}return h.addEventListener("blur",g),Vc()&&(h.addEventListener("keydown",p,!0),h.addEventListener("pointerdown",m,!0)),()=>{h.removeEventListener("blur",g),Vc()&&(h.removeEventListener("keydown",p,!0),h.removeEventListener("pointerdown",m,!0))}},[s.domReference,n,a]),N.useEffect(()=>{if(!a)return;function h(g){let{reason:p}=g;(p==="reference-press"||p==="escape-key")&&(c.current=!0)}return o.on("openchange",h),()=>{o.off("openchange",h)}},[o,a]),N.useEffect(()=>()=>{jt(u)},[]);const d=N.useMemo(()=>({onMouseLeave(){c.current=!1},onFocus(h){if(c.current)return;const g=Ro(h.nativeEvent);if(l&&De(g)){if(Vc()&&!h.relatedTarget){if(!f.current&&!$1(g))return}else if(!$P(g))return}r(!0,h.nativeEvent,"focus")},onBlur(h){c.current=!1;const g=h.relatedTarget,p=h.nativeEvent,m=De(g)&&g.hasAttribute(sh("focus-guard"))&&g.getAttribute("data-type")==="outside";u.current=window.setTimeout(()=>{var _;const y=wy(s.domReference?s.domReference.ownerDocument:document);!g&&y===s.domReference||es((_=i.current.floatingContext)==null?void 0:_.refs.floating.current,y)||es(s.domReference,y)||m||r(!1,p,"focus")})}}),[i,s.domReference,r,l]);return N.useMemo(()=>a?{reference:d}:{},[a,d])}function jc(e,t,n){const r=new Map,o=n==="item";let i=e;if(o&&e){const{[My]:s,[Ny]:a,...l}=e;i=l}return{...n==="floating"&&{tabIndex:-1,[TF]:""},...i,...t.map(s=>{const a=s?s[n]:null;return typeof a=="function"?e?a(e):null:a}).concat(e).reduce((s,a)=>(a&&Object.entries(a).forEach(l=>{let[c,u]=l;if(!(o&&[My,Ny].includes(c)))if(c.indexOf("on")===0){if(r.has(c)||r.set(c,[]),typeof u=="function"){var f;(f=r.get(c))==null||f.push(u),s[c]=function(){for(var d,h=arguments.length,g=new Array(h),p=0;p<h;p++)g[p]=arguments[p];return(d=r.get(c))==null?void 0:d.map(m=>m(...g)).find(m=>m!==void 0)}}}else s[c]=u}),s),{})}}function Y1(e){e===void 0&&(e=[]);const t=e.map(a=>a?.reference),n=e.map(a=>a?.floating),r=e.map(a=>a?.item),o=N.useCallback(a=>jc(a,e,"reference"),t),i=N.useCallback(a=>jc(a,e,"floating"),n),s=N.useCallback(a=>jc(a,e,"item"),r);return N.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:s}),[o,i,s])}const BF=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function X1(e,t){var n,r;t===void 0&&(t={});const{open:o,elements:i,floatingId:s}=e,{enabled:a=!0,role:l="dialog"}=t,c=U1(),u=((n=i.domReference)==null?void 0:n.id)||c,f=N.useMemo(()=>{var y;return((y=DP(i.floating))==null?void 0:y.id)||s},[i.floating,s]),d=(r=BF.get(l))!=null?r:l,g=oh()!=null,p=N.useMemo(()=>d==="tooltip"||l==="label"?{["aria-"+(l==="label"?"labelledby":"describedby")]:o?f:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":d==="alertdialog"?"dialog":d,"aria-controls":o?f:void 0,...d==="listbox"&&{role:"combobox"},...d==="menu"&&{id:u},...d==="menu"&&g&&{role:"menuitem"},...l==="select"&&{"aria-autocomplete":"none"},...l==="combobox"&&{"aria-autocomplete":"list"}},[d,f,g,o,u,l]),m=N.useMemo(()=>{const y={id:f,...d&&{role:d}};return d==="tooltip"||l==="label"?y:{...y,...d==="menu"&&{"aria-labelledby":u}}},[d,f,u,l]),_=N.useCallback(y=>{let{active:v,selected:x}=y;const b={role:"option",...v&&{id:f+"-fui-option"}};switch(l){case"select":case"combobox":return{...b,"aria-selected":x}}return{}},[f,l]);return N.useMemo(()=>a?{reference:p,floating:m,item:_}:{},[a,p,m,_])}const zF=e=>N.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M6 9L12 15L18 9",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),WF=e=>N.createElement("svg",{fill:"currentColor",id:"Capa_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 462.035 462.035",xmlSpace:"preserve",...e},N.createElement("g",null,N.createElement("path",{d:"M457.83,158.441c-0.021-0.028-0.033-0.058-0.057-0.087l-50.184-62.48c-0.564-0.701-1.201-1.305-1.879-1.845 c-2.16-2.562-5.355-4.225-8.967-4.225H65.292c-3.615,0-6.804,1.661-8.965,4.225c-0.678,0.54-1.316,1.138-1.885,1.845l-50.178,62.48 c-0.023,0.029-0.034,0.059-0.057,0.087C1.655,160.602,0,163.787,0,167.39v193.07c0,6.5,5.27,11.771,11.77,11.771h438.496 c6.5,0,11.77-5.271,11.77-11.771V167.39C462.037,163.787,460.381,160.602,457.83,158.441z M408.516,134.615l16.873,21.005h-16.873 V134.615z M384.975,113.345v42.274H296.84c-2.514,0-4.955,0.805-6.979,2.293l-58.837,43.299l-58.849-43.305 c-2.023-1.482-4.466-2.287-6.978-2.287H77.061v-42.274H384.975z M53.523,155.62H36.65l16.873-21.005V155.62z M438.498,348.69H23.54 V179.16h137.796l62.711,46.148c4.15,3.046,9.805,3.052,13.954-0.005l62.698-46.144h137.799V348.69L438.498,348.69z"}))),J1=e=>N.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("g",{opacity:.6},N.createElement("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}))),Bc={sm:{h:28,p:"var(--spacing-xs) var(--spacing-sm)",text:"body-2"},md:{h:32,p:"6px var(--spacing-md)",text:"body-2"},lg:{h:40,p:"var(--spacing-sm) var(--spacing-lg)",text:"body-1"}},lh=C.forwardRef(({label:e,color:t="primary",size:n="md",onClick:r,onDelete:o,avatar:i,icon:s,disabled:a,className:l},c)=>{const u=C.useRef(null),f=C.useMemo(()=>{switch(t){case"primary":return{bg:"var(--status-neutral-tint-low)",color:"var(--text-primary)"};case"accent":return{bg:"var(--status-accent-tint-low)",color:"var(--text-accent)"};case"warning":return{bg:"var(--status-warning-tint-low)",color:"var(--text-warning)"};case"positive":return{bg:"var(--status-positive-tint-low)",color:"var(--text-positive)"};case"negative":return{bg:"var(--status-negative-tint-low)",color:"var(--text-negative)"};default:return{bg:"var(--status-neutral-tint-low)",color:"var(--text-primary)"}}},[t]),d=z.css({cursor:a?"not-allowed":r?"pointer":"default",opacity:a?.5:1,userSelect:"none",position:"relative",transition:"background-color 0.2s, opacity 0.2s","&:hover":a?void 0:{backgroundColor:f.bg}}),h=z.css({display:"inline-flex",cursor:"pointer",opacity:.6,"&:hover":{opacity:1}});return S.jsxs(q,{ref:g=>{u.current=g,typeof c=="function"?c(g):c&&(c.current=g)},row:!0,alignItems:"center",justifyContent:"center",gap:"var(--spacing-sm)",h:Bc[n].h,p:Bc[n].p,overflow:"hidden",borderRadius:"var(--corner-sm)",backgroundColor:f.bg,color:f.color,onClick:r,className:z.cx(d,l),children:[r&&S.jsx(io,{}),i&&S.jsx(q,{w:20,h:20,borderRadius:"50%",overflow:"hidden",children:i}),s&&S.jsx(q,{children:s}),typeof e=="string"?S.jsx(ce,{variant:Bc[n].text,colorName:t,textOverflow:"ellipsis",overflow:"hidden",children:e}):e,o&&!a&&S.jsx(ce,{className:h,colorName:t,onClick:g=>{g.stopPropagation(),o(g)},children:S.jsx(J1,{})})]})});lh.displayName="Tag";const HF="_disabled_ns6ei_45",KF="_open_ns6ei_53",UF="_error_ns6ei_56",GF="_hidden_ns6ei_92",qF="_visible_ns6ei_95",YF="_selected_ns6ei_168",rt={"select-container":"_select-container_ns6ei_8","full-width":"_full-width_ns6ei_13","select-input":"_select-input_ns6ei_17","size-xs":"_size-xs_ns6ei_24","size-sm":"_size-sm_ns6ei_29","size-md":"_size-md_ns6ei_34","background-primary":"_background-primary_ns6ei_39","background-secondary":"_background-secondary_ns6ei_42",disabled:HF,open:KF,"select-arrow":"_select-arrow_ns6ei_53",error:UF,"select-value":"_select-value_ns6ei_67","select-value_xs":"_select-value_xs_ns6ei_79","select-placeholder":"_select-placeholder_ns6ei_86",hidden:GF,visible:qF,"select-arrow_xs":"_select-arrow_xs_ns6ei_111","select-dropdown":"_select-dropdown_ns6ei_121","select-menu":"_select-menu_ns6ei_131","select-menu-item":"_select-menu-item_ns6ei_150","select-menu-item-first":"_select-menu-item-first_ns6ei_163",selected:YF,"overflow-tooltip-container":"_overflow-tooltip-container_ns6ei_172","overflow-tooltip-text":"_overflow-tooltip-text_ns6ei_177","empty-block":"_empty-block_ns6ei_184"};function ch({value:e,onChange:t,multiple:n=!1,returnedValue:r,renderItem:o,renderInputItem:i,renderSingleInputItem:s,renderMultipleInputItem:a,renderDropdownItem:l,placeholder:c,items:u=[],fullWidth:f,size:d="md",showDefaultItem:h,disabled:g,label:p,firstItem:m,lastItem:_,observer:y,emptyText:v,onBlur:x,prompt:b,error:w,errorText:T,dropdownMaxWidth:E=400,dropdownMinWidth:R=120,minWidth:M=120,width:O,background:D="secondary"}){const[I,L]=so(e,n?[]:null),[B,K]=C.useState(!1),{refs:P,floatingStyles:A}=ah({open:B,strategy:"fixed",middleware:[th(4),rh({crossAxis:!0,fallbackAxisSideDirection:"start"}),nh({crossAxis:!0,padding:8}),SF({apply({availableHeight:ee,availableWidth:pe,elements:Ne}){const Ze=Math.min(typeof pe=="number"?pe-64:E,E);Object.assign(Ne.floating.style,{maxHeight:typeof ee=="number"?`${ee}px`:"auto",maxWidth:`${Ze}px`,minWidth:`${R}px`})}})],whileElementsMounted:eh}),$=C.useMemo(()=>n?I||[]:I!=null?[I]:[],[I,n]),H=C.useCallback(ee=>r?r(ee):ee,[r]),Q=C.useMemo(()=>{const ee=new Map;return u.forEach(pe=>{ee.set(H(pe),pe)}),ee},[u,H]),J=!u.length&&!w,X=C.useMemo(()=>$.map(ee=>Q.get(ee)).filter(ee=>!!ee),[Q,$]);C.useEffect(()=>{process.env.NODE_ENV!=="production"&&o&&!l&&console.warn("[Select] `renderItem` deprecated, use `renderDropdownItem` instead.")},[l,o]);const se=C.useCallback((ee,pe)=>l?l(ee,pe):o?o(ee):String(ee),[l,o]),re=()=>{K(!1),x?.()},he=ee=>{const pe=H(ee);if(n){const Ne=$.includes(pe)?$.filter(Ze=>Ze!==pe):[...$,pe];L(Ne),t?.(Ne)}else L(pe),t?.(pe),re()},we=ee=>{if(!n)return;const pe=$.filter(Ne=>Ne!==ee);L(pe),t?.(pe)},te=()=>{const ee=n?[]:null;L(ee),t?.(ee),n||re()},ye=()=>typeof c=="string"?S.jsx(ce,{variant:d==="xs"?"caption-1":"body-2",textOverflow:"ellipsis",overflow:"hidden",colorName:"tertiary",children:c??"Select..."}):c,Se=()=>{if(!$.length)return ye();if(n)return a?a(X):i?i({mode:"multiple",selectedItems:X}):S.jsx(q,{flexWrap:"wrap",row:!0,gap:10,children:$.map(Ne=>{const Ze=Q.get(Ne);return Ze?S.jsx(lh,{size:"sm",label:o?o(Ze):String(Ne),onDelete:Le=>{Le.stopPropagation(),we(Ne)}},Ne):null})});const ee=Q.get($[0])??null;if(!ee)return ye();if(s)return s(ee);if(i)return i({mode:"single",selectedItem:ee});const pe=o?o(ee):String($[0]);return typeof pe=="string"?S.jsx(ce,{variant:d==="xs"?"caption-1":"body-2",tag:"p",textOverflow:"ellipsis",overflow:"hidden",children:pe}):S.jsx(S.Fragment,{children:pe})},$e=B&&S.jsx(_s,{children:S.jsx(q,{row:!0,top:0,right:0,bottom:0,left:0,position:"fixed",center:!0,flex:1,onClick:re,display:"block",backgroundColor:"transparent",zIndex:1,children:S.jsx(Ya.div,{ref:P.setFloating,className:rt["select-dropdown"],initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.25,ease:"easeInOut"},style:{...A,zIndex:1},onMouseDown:ee=>ee.stopPropagation(),onClick:ee=>ee.stopPropagation(),children:S.jsxs("ul",{className:rt["select-menu"],children:[h&&!n&&S.jsx(q,{className:rt["select-menu-item"],role:"option",onClick:te,children:S.jsx(ce,{variant:"body-2",colorName:"tertiary",children:c})}),m&&S.jsx(q,{className:z.cx(rt["select-menu-item"],rt["select-menu-item-first"]),children:m}),J&&S.jsxs(q,{className:rt["empty-block"],children:[S.jsx(q,{w:20,h:20,children:S.jsx(WF,{})}),S.jsx(ce,{variant:"body-2",children:v??"There is nothing yet"})]}),u.map((ee,pe)=>{const Ne=H(ee),Ze=$.includes(Ne),Le=se(ee,{item:ee,selected:Ze,index:pe}),Qn=typeof Le=="string";return S.jsxs(q,{row:!0,gap:10,alignItems:"center",className:z.cx(rt["select-menu-item"],{[rt.selected]:Ze}),role:"option",relative:!0,onClick:()=>he(ee),children:[n&&S.jsx(ef,{size:"sm",checked:Ze}),Qn?S.jsx(ce,{variant:"body-2",tag:"p",wordBreak:"break-all",whiteSpace:"break-spaces",children:Le}):Le,S.jsx(io,{})]},Ne)}),y,_&&S.jsx(q,{className:z.cx(rt["select-menu-item"],rt["select-menu-item-first"]),children:_})]})},"dropdown")})});return S.jsxs(q,{relative:!0,display:"inline-block",minWidth:M,w:O||(f?"full":"auto"),onMouseDown:ee=>ee.stopPropagation(),onClick:ee=>ee.stopPropagation(),children:[typeof p=="string"?S.jsx(ce,{variant:"body-2",colorName:"tertiary",fontWeight:"regular",mb:d==="sm"?4:8,children:p}):p,S.jsxs(q,{ref:P.setReference,row:!0,gap:10,tabIndex:g?-1:0,role:"button",alignItems:"flex-start","aria-haspopup":"listbox",relative:!0,w:"100%",className:z.cx(rt["select-input"],rt[`size-${d}`],rt[`background-${D}`],{[rt.error]:w,[rt.disabled]:g,[rt.open]:B}),onClick:()=>!g&&K(ee=>!ee),children:[S.jsx(q,{className:z.cx(rt["select-value"]),children:Se()}),S.jsx(q,{className:z.cx(rt["select-arrow"],rt[`select-arrow_${d}`]),children:S.jsx(zF,{})})]}),typeof b=="string"?S.jsx(ce,{variant:"caption-1",colorName:"tertiary",mt:4,children:b}):b,w&&T&&S.jsx(ce,{tag:"p",colorName:"negative",variant:"body-2",mt:5,children:T}),S.jsx(cE,{children:$e})]})}const XF=e=>N.createElement("svg",{width:10,height:10,viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M3.94629 0.220237C3.78013 0.264025 3.64089 0.377624 3.56348 0.53176C3.27371 1.11189 3.05664 1.46395 2.83887 1.74953C2.61807 2.03873 2.38547 2.27579 2.03027 2.63039C1.21079 3.45057 0.799805 4.52619 0.799805 5.60012C0.799838 6.67406 1.21073 7.74968 2.03027 8.56985C3.67062 10.2096 6.32931 10.2095 7.96973 8.56985C8.78929 7.74968 9.20016 6.67408 9.2002 5.60012C9.15131 4.32908 8.43217 3.48543 7.94727 3.05813C7.76902 2.90106 7.40643 3.02424 7.2627 3.2134C7.24031 3.24286 7.21612 3.2739 7.18945 3.30617C6.93211 3.61754 6.56236 3.80807 6.41504 3.83156C6.38264 3.83667 6.36979 3.76513 6.2959 3.58254C5.79455 2.34427 5.78927 2.49365 5.58887 2.01125C5.48847 1.7692 5.05517 1.02727 4.92676 0.828635C4.80206 0.635591 4.64095 0.439873 4.43359 0.301292C4.29028 0.205951 4.1124 0.175957 3.94629 0.220237ZM4.75293 4.17824C5.2689 4.63997 5.60857 5.26651 5.71484 5.95071C6.10631 5.85571 6.46727 5.68318 6.78125 5.45071C6.86578 5.70826 6.89338 5.98123 6.8623 6.25051C6.83115 6.51993 6.74174 6.77966 6.60059 7.01125C6.45944 7.24281 6.27008 7.44117 6.04492 7.59231C5.81977 7.74344 5.56462 7.8443 5.29688 7.88723C5.0292 7.93013 4.75518 7.91446 4.49414 7.84133C4.23299 7.76812 3.99064 7.6383 3.78418 7.46242C3.5778 7.28657 3.41161 7.06792 3.29785 6.8218C3.18419 6.57572 3.12519 6.30771 3.125 6.03664C3.12508 5.58233 3.29054 5.14308 3.58984 4.80129C3.88917 4.4597 4.30271 4.2382 4.75293 4.17824Z",fill:"#FEAD34"})),JF=e=>N.createElement("svg",{width:12,height:12,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M10.1483 8.61509C10.3344 8.26159 9.98299 7.89856 9.58534 7.93723C9.42671 7.95265 9.25857 7.9605 9.07422 7.96035C6.36522 7.9582 4.17129 5.76427 4.16914 3.05527C4.169 2.87115 4.17682 2.70321 4.19221 2.54477C4.23082 2.14712 3.86769 1.79411 3.50976 1.97161C2.03398 2.70343 1.20002 4.02274 1.20002 5.89477C1.20002 8.60377 3.3961 10.7998 6.1051 10.7998C7.97571 10.7998 9.38737 10.06 10.1483 8.61509Z",fill:"white"})),ZF="_container_e7tan_8",QF="_disabled_e7tan_17",eL="_reverse_e7tan_21",tL="_input_e7tan_25",nL="_switchContainer_e7tan_35",rL="_variant_accent_e7tan_43",oL="_variant_secondary_e7tan_47",iL="_thumb_e7tan_51",sL="_variant_theme_e7tan_54",aL="_moon_e7tan_58",lL="_fire_e7tan_61",cL="_size_sm_e7tan_74",uL="_size_md_e7tan_80",dL="_size_lg_e7tan_86",Jt={container:ZF,disabled:QF,reverse:eL,input:tL,switchContainer:nL,variant_accent:rL,variant_secondary:oL,switch:"_switch_e7tan_35",thumb:iL,variant_theme:sL,moon:aL,fire:lL,size_sm:cL,size_md:uL,size_lg:dL},Z1=C.forwardRef(({title:e,text:t,icon:n,disabled:r,onChange:o,checked:i,defaultValue:s,className:a,size:l="md",variant:c="accent",reverse:u=!1,w:f="auto",...d},h)=>{const[g,p]=so(i,s),m=C.useRef(null);C.useImperativeHandle(h,()=>({focus:()=>{m.current?.focus()},blur:()=>{m.current?.blur()},get checked(){return g??!1},setChecked:x=>{p(x),o?.(x)},toggle:()=>{const x=!g;p(x),o?.(x)},isFocused:()=>document.activeElement===m.current,isDisabled:()=>r??!1,getInputElement:()=>m.current,checkValidity:()=>m.current?.checkValidity()??!0,reset:()=>{const x=s??!1;p(x),o?.(x)}}),[g,p,o,r,s]);const _=C.useCallback(x=>{p(x.target.checked),o?.(x.target.checked)},[o]),y=C.useMemo(()=>typeof e=="string"?S.jsx(ce,{variant:"body-1",colorName:"primary",fontWeight:"medium",children:e}):e,[e]),v=C.useMemo(()=>typeof t=="string"?S.jsx(ce,{variant:"body-2",colorName:"secondary",fontWeight:"regular",children:t}):t,[t]);return S.jsxs(q,{row:!0,w:f,gap:"var(--spacing-sm)",children:[S.jsxs("label",{className:z.cx(Jt.container,a,{[Jt.disabled]:r,[Jt.reverse]:u}),children:[S.jsxs(q,{className:z.cx(Jt.switchContainer,Jt[`size_${l}`],Jt[`variant_${c}`]),children:[S.jsx("input",{ref:m,type:"checkbox",checked:g,className:Jt.input,onChange:_,disabled:r,...d}),S.jsx("div",{className:Jt.switch,children:S.jsx("div",{className:Jt.thumb,children:c==="theme"&&S.jsxs(S.Fragment,{children:[S.jsx(JF,{className:Jt.moon}),S.jsx(XF,{className:Jt.fire})]})})})]}),S.jsxs(q,{gap:"var(--spacing-xs)",children:[y,v]})]}),n]})});Z1.displayName="Switch";const fL=z.css({cursor:"pointer",userSelect:"none"}),hL=z.css({cursor:"not-allowed",opacity:.5}),gL=z.css({transition:"color 0.2s ease"}),pL=C.forwardRef(({label:e,selected:t,disabled:n,fullWidth:r,onClick:o},i)=>S.jsx(q,{w:r?"full":void 0,justifyContent:"center",alignItems:"center",ref:i,py:"var(--spacing-md)",px:"var(--spacing-xl)",onClick:o,className:z.cx(fL,{[hL]:n}),children:S.jsx(ce,{className:gL,colorName:t?"primary":"tertiary",fontWeight:"medium",variant:"body-2",children:e})})),mL=z.css({borderBottom:"1px solid var(--border-neutral-alpha-basic)"}),Q1=({value:e,onChange:t,options:n,fullWidth:r=!1,className:o})=>{const[i,s]=C.useState({left:0,width:0}),a=C.useRef([]),l=u=>f=>{a.current[u]=f};C.useEffect(()=>{const u=n.findIndex(d=>d.value===e),f=a.current[u];f&&s({left:f.offsetLeft,width:f.offsetWidth})},[e,n]);const c=(u,f=!1)=>()=>!f&&t(u);return S.jsxs(q,{row:!0,w:r?"full":"auto",relative:!0,className:z.cx(mL,o),children:[n.map((u,f)=>S.jsx(pL,{selected:e===u.value,onClick:c(u.value,u.disabled),ref:l(f),label:u.label,disabled:u.disabled,fullWidth:r},u.value)),S.jsx(q,{h:2,w:i.width,absolute:!0,bottom:-1,left:i.left,backgroundColor:"var(--border-accent-primary)",className:z.css({transition:"left 0.2s ease, width 0.2s ease"})})]})};Q1.displayName="Tabs";const yL="_header_446to_8",vL={header:yL},eb=C.forwardRef(({title:e,subtitle:t,w:n="full",p:r,py:o,px:i="var(--spacing-2xl)",pt:s="var(--spacing-2xl)",pb:a="var(--spacing-lg)",row:l=!0,justifyContent:c="space-between",showCloseButton:u=!1},f)=>{const{onClose:d}=ZC();return S.jsxs(q,{w:n,p:r,py:o,px:i,pt:s,pb:a,row:l,justifyContent:c,ref:f,className:vL.header,children:[S.jsxs(q,{gap:"var(--spacing-sm)",children:[S.jsx(ce,{variant:"title-3",colorName:"primary",fontWeight:"semibold",children:e}),S.jsx(ce,{variant:"body-1",colorName:"tertiary",fontWeight:"medium",children:t})]}),u&&S.jsx(q,{children:S.jsx(Kn,{onClick:d,color:"neutral",children:S.jsx(tv,{})})})]})});eb.displayName="ModalHeader";function Co(e,t,n){let r=n.initialDeps??[],o,i=!0;function s(){var a,l,c;let u;n.key&&((a=n.debug)!=null&&a.call(n))&&(u=Date.now());const f=e();if(!(f.length!==r.length||f.some((g,p)=>r[p]!==g)))return o;r=f;let h;if(n.key&&((l=n.debug)!=null&&l.call(n))&&(h=Date.now()),o=t(...f),n.key&&((c=n.debug)!=null&&c.call(n))){const g=Math.round((Date.now()-u)*100)/100,p=Math.round((Date.now()-h)*100)/100,m=p/16,_=(y,v)=>{for(y=String(y);y.length<v;)y=" "+y;return y};console.info(`%c⏱ ${_(p,5)} /${_(g,5)} ms`,`
|
|
38
|
+
`)}})(e,n)(t)}function bM({defaultSelection:e}){const[t]=nt();return C.useEffect(()=>{t.focus(()=>{const n=document.activeElement,r=t.getRootElement();r===null||n!==null&&r.contains(n)||r.focus({preventScroll:!0})},{defaultSelection:e})},[e,t]),null}const a1=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,CM=a1?C.useLayoutEffect:C.useEffect,Bs={tag:Vo};function wM({initialConfig:e,children:t}){const n=C.useMemo(()=>{const{theme:r,namespace:o,nodes:i,onError:s,editorState:a,html:l}=e,c=KR(null,r),u=j_({editable:e.editable,html:l,namespace:o,nodes:i,onError:f=>s(f,u),theme:r});return(function(f,d){if(d!==null){if(d===void 0)f.update(()=>{const h=Ke();if(h.isEmpty()){const g=me();h.append(g);const p=a1?document.activeElement:null;(G()!==null||p!==null&&p===f.getRootElement())&&g.select()}},Bs);else if(d!==null)switch(typeof d){case"string":{const h=f.parseEditorState(d);f.setEditorState(h,Bs);break}case"object":f.setEditorState(d,Bs);break;case"function":f.update(()=>{Ke().isEmpty()&&d(f)},Bs)}}})(u,a),[u,c]},[]);return CM(()=>{const r=e.editable,[o]=n;o.setEditable(r===void 0||r)},[]),S.jsx(W0.Provider,{value:n,children:t})}function SM(){return Ke().getTextContent()}function EM(e,t=!0){if(e)return!1;let n=SM();return t&&(n=n.trim()),n===""}function TM(e){if(!EM(e,!1))return!1;const t=Ke().getChildren(),n=t.length;if(n>1)return!1;for(let r=0;r<n;r++){const o=t[r];if(Ce(o))return!1;if(V(o)){if(!Sr(o)||o.__indent!==0)return!1;const i=o.getChildren(),s=i.length;for(let a=0;a<s;a++){const l=i[r];if(!Y(l))return!1}}}return!0}function l1(e){return()=>TM(e)}function RM(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function kM(e,t,n,r){const o=s=>s instanceof n,i=s=>{const a=Pe(s.getTextContent());a.setFormat(s.getFormat()),s.replace(a)};return[e.registerNodeTransform(Gt,s=>{if(!s.isSimpleText())return;let a,l=s.getPreviousSibling(),c=s.getTextContent(),u=s;if(Y(l)){const d=l.getTextContent(),h=t(d+c);if(o(l)){if(h===null||(g=>g.getLatest().__mode)(l)!==0)return void i(l);{const g=h.end-d.length;if(g>0){const p=d+c.slice(0,g);if(l.select(),l.setTextContent(p),g===c.length)s.remove();else{const m=c.slice(g);s.setTextContent(m)}return}}}else if(h===null||h.start<d.length)return}let f=0;for(;;){a=t(c);let d,h=a===null?"":c.slice(a.end);if(c=h,h===""){const p=u.getNextSibling();if(Y(p)){h=u.getTextContent()+p.getTextContent();const m=t(h);if(m===null)return void(o(p)?i(p):p.markDirty());if(m.start!==0)return}}if(a===null)return;if(a.start===0&&Y(l)&&l.isTextEntity()){f+=a.end;continue}a.start===0?[d,u]=u.splitText(a.end):[,d,u]=u.splitText(a.start+f,a.end+f),d===void 0&&RM(165,"nodeToReplace");const g=r(d);if(g.setFormat(d.getFormat()),d.replace(g),u==null)return;f=0,l=g}}),e.registerNodeTransform(n,s=>{const a=s.getTextContent(),l=t(a);if(l===null||l.start!==0)return void i(s);if(a.length>l.end)return void s.splitText(l.end);const c=s.getPreviousSibling();Y(c)&&c.isTextEntity()&&(i(c),i(s));const u=s.getNextSibling();Y(u)&&u.isTextEntity()&&(i(u),o(s)&&i(s))})]}let gl=class c1 extends Gt{static getType(){return"hashtag"}static clone(t){return new c1(t.__text,t.__key)}createDOM(t){const n=super.createDOM(t);return Ye(n,t.theme.hashtag),n}static importJSON(t){return u1().updateFromJSON(t)}canInsertTextBefore(){return!1}isTextEntity(){return!0}};function u1(e=""){return vt(new gl(e))}const AM=new RegExp((function(){const{alpha:e,alphanumeric:t,hashChars:n}=(function(){const o=String.fromCharCode,i="A-Za-zªµºÀ-ÖØ-öø-Ɂɐ-ˁˆ-ˑˠ-ˤˮͺΆΈ-ΊΌΎ-ΡΣ-ώϐ-ϵϷ-ҁҊ-ӎӐ-ӹԀ-ԏԱ-Ֆՙա-ևא-תװ-ײء-غـ-يٮ-ٯٱ-ۓەۥ-ۦۮ-ۯۺ-ۼۿܐܒ-ܯݍ-ݭހ-ޥޱऄ-हऽॐक़-ॡॽঅ-ঌএ-ঐও-নপ-রলশ-হঽৎড়-ঢ়য়-ৡৰ-ৱਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલ-ળવ-હઽૐૠ-ૡଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହଽଡ଼-ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கங-சஜஞ-டண-தந-பம-ஹఅ-ఌఎ-ఐఒ-నప-ళవ-హౠ-ౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠ-ೡഅ-ഌഎ-ഐഒ-നപ-ഹൠ-ൡඅ-ඖක-නඳ-රලව-ෆก-ะา-ำเ-ๆກ-ຂຄງ-ຈຊຍດ-ທນ-ຟມ-ຣລວສ-ຫອ-ະາ-ຳຽເ-ໄໆໜ-ໝༀཀ-ཇཉ-ཪྈ-ྋက-အဣ-ဧဩ-ဪၐ-ၕႠ-Ⴥა-ჺჼᄀ-ᅙᅟ-ᆢᆨ-ᇹሀ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙶᚁ-ᚚᚠ-ᛪᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦩᧁ-ᧇᨀ-ᨖᴀ-ᶿḀ-ẛẠ-ỹἀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₔℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℱℳ-ℹℼ-ℿⅅ-ⅉⰀ-Ⱞⰰ-ⱞⲀ-ⳤⴀ-ⴥⴰ-ⵥⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〆〱-〵〻-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄬㄱ-ㆎㆠ-ㆷㇰ-ㇿ㐀-䶵一-龻ꀀ-ꒌꠀ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢ가-힣豈-鶴侮-頻並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵÀ-ÖØ-öø-ÿĀ-ɏɓ-ɔɖ-ɗəɛɣɨɯɲʉʋʻ̀-ͯḀ-ỿЀ-ӿԀ-ԧⷠ-ⷿꙀ-֑ꚟ-ֿׁ-ׂׄ-ׇׅא-תװ-״-ﬨשׁ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﭏؐ-ؚؠ-ٟٮ-ۓە-ۜ۞-۪ۨ-ۯۺ-ۼۿݐ-ݿࢠࢢ-ࢬࣤ-ࣾﭐ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼ-ก-ฺเ-๎ᄀ-ᇿ-ㆅꥠ-가-ힰ-ᄀ-ᅵァ-ヺー-ヾヲ-゚0-9A-Za-zぁ-ゖ゙-ゞ㐀-䶿一-鿿"+o(173824)+"-"+o(177983)+o(177984)+"-"+o(178207)+o(194560)+"-"+o(195103)+"〃々〻";return{alpha:i,alphanumeric:i+"̀-ͯ҃-֑҆-ֹֻ-ֽֿׁ-ׂׄ-ׇׅؐ-ًؕ-ٰٞۖ-ۜ۟-ۤۧ-۪ۨ-ܑۭܰ-݊ަ-ްँ-ः़ा-्॑-॔ॢ-ॣঁ-ঃ়া-ৄে-ৈো-্ৗৢ-ৣਁ-ਃ਼ਾ-ੂੇ-ੈੋ-੍ੰ-ੱઁ-ઃ઼ા-ૅે-ૉો-્ૢ-ૣଁ-ଃ଼ା-ୃେ-ୈୋ-୍ୖ-ୗஂா-ூெ-ைொ-்ௗఁ-ఃా-ౄె-ైొ-్ౕ-ౖಂ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕ-ೖം-ഃാ-ൃെ-ൈൊ-്ൗං-ඃ්ා-ුූෘ-ෟෲ-ෳัิ-ฺ็-๎ັິ-ູົ-ຼ່-ໍ༘-༹༙༵༷༾-༿ཱ-྄྆-྇ྐ-ྗྙ-ྼ࿆ာ-ဲံ-္ၖ-ၙ፟ᜒ-᜔ᜲ-᜴ᝒ-ᝓᝲ-ᝳា-៓៝᠋-᠍ᢩᤠ-ᤫᤰ-᤻ᦰ-ᧀᧈ-ᧉᨗ-ᨛ᷀-᷃⃐-⃥⃜⃡-⃫〪-゙〯-゚ꠂ꠆ꠋꠣ-ꠧﬞ︀-️︠-︣0-9٠-٩۰-۹०-९০-৯੦-੯૦-૯୦-୯௦-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩၀-၉០-៩᠐-᠙᥆-᥏᧐-᧙0-9_",hashChars:"#\\uFF03"}})(),r="["+t+"]";return"("+("^|$|[^&/"+t+"]")+")("+("["+n+"]")+")("+r+"*"+("["+e+"]")+r+"*)"})(),"i"),MM={getHashtagMatch:function(e){const t=AM.exec(e);if(t===null)return null;const n=t[3].length+1,r=t.index+t[1].length;return{end:r+n,start:r}}};function NM(e,t=MM){return ln(...kM(e,t.getHashtagMatch,gl,n=>u1(n.getTextContent())))}function PM(){const[e]=nt();return C.useEffect(()=>{if(!e.hasNodes([gl]))throw new Error("HashtagPlugin: HashtagNode not registered on editor");return NM(e)},[e]),null}function FM({hasStrictIndent:e=!1}){const[t]=nt();return C.useEffect(()=>{if(!t.hasNodes([uo,Er]))throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[t]),C.useEffect(()=>{if(e)return cA(t)},[t,e]),(function(n){C.useEffect(()=>lA(n),[n])})(t),null}function Vm(e,t){return e.getEditorState().read(()=>{const n=Me(t);return n!==null&&n.isSelected()})}function LM(e){const[t]=nt(),[n,r]=C.useState(()=>Vm(t,e));return C.useEffect(()=>{let o=!0;const i=t.registerUpdateListener(()=>{o&&r(Vm(t,e))});return()=>{o=!1,i()}},[t,e]),[n,C.useCallback(o=>{t.update(()=>{let i=G();gt(i)||(i=gf(),He(i)),gt(i)&&(o?i.add(e):i.delete(e))})},[t,e]),C.useCallback(()=>{t.update(()=>{const o=G();gt(o)&&o.clear()})},[t])]}function OM({nodeKey:e}){const[t]=nt(),[n,r,o]=LM(e);return C.useEffect(()=>ln(t.registerCommand(Za,i=>{const s=t.getElementByKey(e);return i.target===s&&(i.shiftKey||o(),r(!n),!0)},jn)),[o,t,n,e,r]),C.useEffect(()=>{const i=t.getElementByKey(e),s=t._config.theme.hrSelected??"selected";i!==null&&(n?Ye(i,s):Rn(i,s))},[t,n,e]),null}let d1=class f1 extends $f{static getType(){return"horizontalrule"}static clone(t){return new f1(t.__key)}static importJSON(t){return Wf().updateFromJSON(t)}static importDOM(){return{hr:()=>({conversion:IM,priority:0})}}decorate(){return S.jsx(OM,{nodeKey:this.__key})}};function IM(){return{node:Wf()}}function Wf(){return vt(new d1)}const $M=[{dependencies:[d1],export:e=>Z3(e)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(e,t,n,r)=>{const o=Wf();r||e.getNextSibling()!=null?e.replace(o):e.insertBefore(o),o.selectNext()},type:"element"},...ys];function DM({transformers:e=$M}){const[t]=nt();return C.useEffect(()=>vM(t,e),[t,e]),null}const VM=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?C.useLayoutEffect:C.useEffect;function jM({ignoreHistoryMergeTagChange:e=!0,ignoreSelectionChange:t=!1,onChange:n}){const[r]=nt();return VM(()=>{if(n)return r.registerUpdateListener(({editorState:o,dirtyElements:i,dirtyLeaves:s,prevEditorState:a,tags:l})=>{t&&i.size===0&&s.size===0||e&&l.has(Vo)||a.isEmpty()||n(o,r,l)})},[r,e,t,n]),null}const Hf=/^(\d+(?:\.\d+)?)px$/,et={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class cn extends yt{__colSpan;__rowSpan;__headerState;__width;__backgroundColor;__verticalAlign;static getType(){return"tablecell"}static clone(t){return new cn(t.__headerState,t.__colSpan,t.__width,t.__key)}afterCloneFrom(t){super.afterCloneFrom(t),this.__rowSpan=t.__rowSpan,this.__backgroundColor=t.__backgroundColor,this.__verticalAlign=t.__verticalAlign}static importDOM(){return{td:t=>({conversion:jm,priority:0}),th:t=>({conversion:jm,priority:0})}}static importJSON(t){return Kt().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setHeaderStyles(t.headerState).setColSpan(t.colSpan||1).setRowSpan(t.rowSpan||1).setWidth(t.width||void 0).setBackgroundColor(t.backgroundColor||null).setVerticalAlign(t.verticalAlign||void 0)}constructor(t=et.NO_STATUS,n=1,r,o){super(o),this.__colSpan=n,this.__rowSpan=1,this.__headerState=t,this.__width=r,this.__backgroundColor=null,this.__verticalAlign=void 0}createDOM(t){const n=document.createElement(this.getTag());return this.__width&&(n.style.width=`${this.__width}px`),this.__colSpan>1&&(n.colSpan=this.__colSpan),this.__rowSpan>1&&(n.rowSpan=this.__rowSpan),this.__backgroundColor!==null&&(n.style.backgroundColor=this.__backgroundColor),nd(this.__verticalAlign)&&(n.style.verticalAlign=this.__verticalAlign),Ye(n,t.theme.tableCell,this.hasHeader()&&t.theme.tableCellHeader),n}exportDOM(t){const n=super.exportDOM(t);if(je(n.element)){const r=n.element;r.setAttribute("data-temporary-table-cell-lexical-key",this.getKey()),r.style.border="1px solid black",this.__colSpan>1&&(r.colSpan=this.__colSpan),this.__rowSpan>1&&(r.rowSpan=this.__rowSpan),r.style.width=`${this.getWidth()||75}px`,r.style.verticalAlign=this.getVerticalAlign()||"top",r.style.textAlign="start",this.__backgroundColor===null&&this.hasHeader()&&(r.style.backgroundColor="#f2f3f5")}return n}exportJSON(){return{...super.exportJSON(),...nd(this.__verticalAlign)&&{verticalAlign:this.__verticalAlign},backgroundColor:this.getBackgroundColor(),colSpan:this.__colSpan,headerState:this.__headerState,rowSpan:this.__rowSpan,width:this.getWidth()}}getColSpan(){return this.getLatest().__colSpan}setColSpan(t){const n=this.getWritable();return n.__colSpan=t,n}getRowSpan(){return this.getLatest().__rowSpan}setRowSpan(t){const n=this.getWritable();return n.__rowSpan=t,n}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(t,n=et.BOTH){const r=this.getWritable();return r.__headerState=t&n|r.__headerState&~n,r}getHeaderStyles(){return this.getLatest().__headerState}setWidth(t){const n=this.getWritable();return n.__width=t,n}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(t){const n=this.getWritable();return n.__backgroundColor=t,n}getVerticalAlign(){return this.getLatest().__verticalAlign}setVerticalAlign(t){const n=this.getWritable();return n.__verticalAlign=t||void 0,n}toggleHeaderStyle(t){const n=this.getWritable();return(n.__headerState&t)===t?n.__headerState-=t:n.__headerState+=t,n}hasHeaderState(t){return(this.getHeaderStyles()&t)===t}hasHeader(){return this.getLatest().__headerState!==et.NO_STATUS}updateDOM(t){return t.__headerState!==this.__headerState||t.__width!==this.__width||t.__colSpan!==this.__colSpan||t.__rowSpan!==this.__rowSpan||t.__backgroundColor!==this.__backgroundColor||t.__verticalAlign!==this.__verticalAlign}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}}function nd(e){return e==="middle"||e==="bottom"}function jm(e){const t=e,n=e.nodeName.toLowerCase();let r;Hf.test(t.style.width)&&(r=parseFloat(t.style.width));const o=Kt(n==="th"?et.ROW:et.NO_STATUS,t.colSpan,r);o.__rowSpan=t.rowSpan;const i=t.style.backgroundColor;i!==""&&(o.__backgroundColor=i);const s=t.style.verticalAlign;nd(s)&&(o.__verticalAlign=s);const a=t.style,l=(a&&a.textDecoration||"").split(" "),c=a.fontWeight==="700"||a.fontWeight==="bold",u=l.includes("line-through"),f=a.fontStyle==="italic",d=l.includes("underline");return{after:h=>{const g=[];let p=null;const m=()=>{if(p){const _=p.getFirstChild();wn(_)&&p.getChildrenSize()===1&&_.remove()}};for(const _ of h)a3(_)||Y(_)||wn(_)?(Y(_)&&(c&&_.toggleFormat("bold"),u&&_.toggleFormat("strikethrough"),f&&_.toggleFormat("italic"),d&&_.toggleFormat("underline")),p?p.append(_):(p=me().append(_),g.push(p))):(g.push(_),m(),p=null);return m(),g.length===0&&g.push(me()),g},node:o}}function Kt(e=et.NO_STATUS,t=1,n){return vt(new cn(e,t,n))}function fe(e){return e instanceof cn}const h1=ie("INSERT_TABLE_COMMAND");function ue(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}class yr extends yt{__height;static getType(){return"tablerow"}static clone(t){return new yr(t.__height,t.__key)}static importDOM(){return{tr:t=>({conversion:BM,priority:0})}}static importJSON(t){return Zo().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setHeight(t.height)}constructor(t,n){super(n),this.__height=t}exportJSON(){const t=this.getHeight();return{...super.exportJSON(),...t===void 0?void 0:{height:t}}}createDOM(t){const n=document.createElement("tr");return this.__height&&(n.style.height=`${this.__height}px`),Ye(n,t.theme.tableRow),n}extractWithChild(t,n,r){return r==="html"}isShadowRoot(){return!0}setHeight(t){const n=this.getWritable();return n.__height=t,n}getHeight(){return this.getLatest().__height}updateDOM(t){return t.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function BM(e){const t=e;let n;return Hf.test(t.style.height)&&(n=parseFloat(t.style.height)),{after:r=>bx(r,fe),node:Zo(n)}}function Zo(e){return vt(new yr(e))}function Xe(e){return e instanceof yr}const Kf=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,zM=Kf&&"documentMode"in document?document.documentMode:null,Bm=Kf&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);function WM(e,t,n=!0){const r=ml();for(let o=0;o<e;o++){const i=Zo();for(let s=0;s<t;s++){let a=et.NO_STATUS;typeof n=="object"?(o===0&&n.rows&&(a|=et.ROW),s===0&&n.columns&&(a|=et.COLUMN)):n&&(o===0&&(a|=et.ROW),s===0&&(a|=et.COLUMN));const l=Kt(a),c=me();c.append(Pe()),l.append(c),i.append(l)}r.append(i)}return r}function HM(e){const t=xe(e,n=>Ge(n));if(Ge(t))return t;throw new Error("Expected table cell to be inside of table.")}Kf&&"InputEvent"in window&&!zM&&new window.InputEvent("input");const rd=(e,t)=>e===et.BOTH||e===t?t:et.NO_STATUS;function KM(e,t=!0){const[,,n]=xn(e),[r,o]=zt(n,e,e),i=r[0].length,{startRow:s}=o;let a=null;if(t){const l=s+e.__rowSpan-1,c=r[l],u=Zo();for(let d=0;d<i;d++){const{cell:h,startRow:g}=c[d];if(g+h.__rowSpan-1<=l){const p=c[d].cell.__headerState,m=rd(p,et.COLUMN);u.append(Kt(m).append(me()))}else h.setRowSpan(h.__rowSpan+1)}const f=n.getChildAtIndex(l);Xe(f)||ue(256),f.insertAfter(u),a=u}else{const l=s,c=r[l],u=Zo();for(let d=0;d<i;d++){const{cell:h,startRow:g}=c[d];if(g===l){const p=c[d].cell.__headerState,m=rd(p,et.COLUMN);u.append(Kt(m).append(me()))}else h.setRowSpan(h.__rowSpan+1)}const f=n.getChildAtIndex(l);Xe(f)||ue(257),f.insertBefore(u),a=u}return a}function UM(e,t=!0,n=!0){const[,,r]=xn(e),[o,i]=zt(r,e,e),s=o.length,{startColumn:a}=i,l=t?a+e.__colSpan-1:a-1,c=r.getFirstChild();Xe(c)||ue(120);let u=null;function f(g=et.NO_STATUS){const p=Kt(g).append(me());return u===null&&(u=p),p}let d=c;e:for(let g=0;g<s;g++){if(g!==0){const b=d.getNextSibling();Xe(b)||ue(121),d=b}const p=o[g],m=p[l<0?0:l].cell.__headerState,_=rd(m,et.ROW);if(l<0){g1(d,f(_));continue}const{cell:y,startColumn:v,startRow:x}=p[l];if(v+y.__colSpan-1<=l){let b=y,w=x,T=l;for(;w!==g&&b.__rowSpan>1;){if(T-=y.__colSpan,!(T>=0)){d.append(f(_));continue e}{const{cell:E,startRow:R}=p[T];b=E,w=R}}b.insertAfter(f(_))}else y.setColSpan(y.__colSpan+1)}u!==null&&n&&GM(u);const h=r.getColWidths();if(h){const g=[...h],p=l<0?0:l,m=g[p];g.splice(p,0,m),r.setColWidths(g)}return u}function GM(e){const t=e.getFirstDescendant();t==null?e.selectStart():t.getParentOrThrow().selectStart()}function g1(e,t){const n=e.getFirstChild();n!==null?n.insertBefore(t):e.append(t)}function qM(e){if(e.length===0)return null;const t=HM(e[0]),[n]=sr(t,null,null);let r=1/0,o=-1/0,i=1/0,s=-1/0;const a=new Set;for(const h of n)for(const g of h){if(!g||!g.cell)continue;const p=g.cell.getKey();if(!a.has(p)&&e.some(m=>m.is(g.cell))){a.add(p);const m=g.startRow,_=g.startColumn,y=g.cell.__rowSpan||1,v=g.cell.__colSpan||1;r=Math.min(r,m),o=Math.max(o,m+y-1),i=Math.min(i,_),s=Math.max(s,_+v-1)}}if(r===1/0||i===1/0)return null;const l=o-r+1,c=s-i+1,u=n[r][i];if(!u.cell)return null;const f=u.cell;f.setColSpan(c),f.setRowSpan(l);const d=new Set([f.getKey()]);for(let h=r;h<=o;h++)for(let g=i;g<=s;g++){const p=n[h][g];if(!p.cell)continue;const m=p.cell,_=m.getKey();d.has(_)||(d.add(_),YM(m)||f.append(...m.getChildren()),m.remove())}return f.getChildrenSize()===0&&f.append(me()),f}function YM(e){if(e.getChildrenSize()!==1)return!1;const t=e.getFirstChildOrThrow();return!(!Sr(t)||!t.isEmpty())}function XM(e){const[t,n,r]=xn(e),o=t.__colSpan,i=t.__rowSpan;if(o===1&&i===1)return;const[s,a]=zt(r,t,t),{startColumn:l,startRow:c}=a,u=t.__headerState&et.COLUMN,f=Array.from({length:o},(g,p)=>{let m=u;for(let _=0;m!==0&&_<s.length;_++)m&=s[_][p+l].cell.__headerState;return m}),d=t.__headerState&et.ROW,h=Array.from({length:i},(g,p)=>{let m=d;for(let _=0;m!==0&&_<s[0].length;_++)m&=s[p+c][_].cell.__headerState;return m});if(o>1){for(let g=1;g<o;g++)t.insertAfter(Kt(f[g]|h[0]).append(me()));t.setColSpan(1)}if(i>1){let g;for(let p=1;p<i;p++){const m=c+p,_=s[m];g=(g||n).getNextSibling(),Xe(g)||ue(125);let y=null;for(let v=0;v<l;v++){const x=_[v],b=x.cell;x.startRow===m&&(y=b),b.__colSpan>1&&(v+=b.__colSpan-1)}if(y===null)for(let v=o-1;v>=0;v--)g1(g,Kt(f[v]|h[p]).append(me()));else for(let v=o-1;v>=0;v--)y.insertAfter(Kt(f[v]|h[p]).append(me()))}t.setRowSpan(1)}}function zt(e,t,n){const[r,o,i]=sr(e,t,n);return o===null&&ue(207),i===null&&ue(208),[r,o,i]}function sr(e,t,n){const r=[];let o=null,i=null;function s(l){let c=r[l];return c===void 0&&(r[l]=c=[]),c}const a=e.getChildren();for(let l=0;l<a.length;l++){const c=a[l];Xe(c)||ue(209);const u=s(l);for(let f=c.getFirstChild(),d=0;f!=null;f=f.getNextSibling()){for(fe(f)||ue(147);u[d]!==void 0;)d++;const h={cell:f,startColumn:d,startRow:l},{__rowSpan:g,__colSpan:p}=f;for(let m=0;m<g&&!(l+m>=a.length);m++){const _=s(l+m);for(let y=0;y<p;y++)_[d+y]=h}t!==null&&o===null&&t.is(f)&&(o=h),n!==null&&i===null&&n.is(f)&&(i=h)}}return[r,o,i]}function xn(e){let t;if(e instanceof cn)t=e;else if("__type"in e){const o=xe(e,fe);fe(o)||ue(148),t=o}else{const o=xe(e.getNode(),fe);fe(o)||ue(148),t=o}const n=t.getParent();Xe(n)||ue(149);const r=n.getParent();return Ge(r)||ue(210),[t,n,r]}function Da(e,t,n){let r,o=Math.min(t.startColumn,n.startColumn),i=Math.min(t.startRow,n.startRow),s=Math.max(t.startColumn+t.cell.__colSpan-1,n.startColumn+n.cell.__colSpan-1),a=Math.max(t.startRow+t.cell.__rowSpan-1,n.startRow+n.cell.__rowSpan-1);do{r=!1;for(let l=0;l<e.length;l++)for(let c=0;c<e[0].length;c++){const u=e[l][c];if(!u)continue;const f=u.startColumn+u.cell.__colSpan-1,d=u.startRow+u.cell.__rowSpan-1,h=u.startColumn<=s&&f>=o,g=u.startRow<=a&&d>=i;if(h&&g){const p=Math.min(o,u.startColumn),m=Math.max(s,f),_=Math.min(i,u.startRow),y=Math.max(a,d);p===o&&m===s&&_===i&&y===a||(o=p,s=m,i=_,a=y,r=!0)}}}while(r);return{maxColumn:s,maxRow:a,minColumn:o,minRow:i}}function zm(e){const[t,,n]=xn(e),r=n.getChildren(),o=r.length,i=r[0].getChildren().length,s=new Array(o);for(let a=0;a<o;a++)s[a]=new Array(i);for(let a=0;a<o;a++){const l=r[a].getChildren();let c=0;for(let u=0;u<l.length;u++){for(;s[a][c];)c++;const f=l[u],d=f.__rowSpan||1,h=f.__colSpan||1;for(let g=0;g<d;g++)for(let p=0;p<h;p++)s[a+g][c+p]=f;if(t===f)return{colSpan:h,columnIndex:c,rowIndex:a,rowSpan:d};c+=h}}return null}function Wm(e){const[[t,n,r,o],[i,s,a,l]]=["anchor","focus"].map(c=>{const u=e[c].getNode(),f=xe(u,fe);fe(f)||ue(238,c,u.getKey(),u.getType());const d=f.getParent();Xe(d)||ue(239,c);const h=d.getParent();return Ge(h)||ue(240,c),[u,f,d,h]});return o.is(l)||ue(241),{anchorCell:n,anchorNode:t,anchorRow:r,anchorTable:o,focusCell:s,focusNode:i,focusRow:a,focusTable:l}}class pl{tableKey;anchor;focus;_cachedNodes;dirty;constructor(t,n,r){this.anchor=n,this.focus=r,n._selection=this,r._selection=this,this._cachedNodes=null,this.dirty=!1,this.tableKey=t}getStartEndPoints(){return[this.anchor,this.focus]}isValid(){if(this.tableKey==="root"||this.anchor.key==="root"||this.anchor.type!=="element"||this.focus.key==="root"||this.focus.type!=="element")return!1;const t=Me(this.tableKey),n=Me(this.anchor.key),r=Me(this.focus.key);return t!==null&&n!==null&&r!==null}isBackward(){return this.focus.isBefore(this.anchor)}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){return Ve(t)&&this.tableKey===t.tableKey&&this.anchor.is(t.anchor)&&this.focus.is(t.focus)}set(t,n,r){this.dirty=this.dirty||t!==this.tableKey||n!==this.anchor.key||r!==this.focus.key,this.tableKey=t,this.anchor.key=n,this.focus.key=r,this._cachedNodes=null}clone(){return new pl(this.tableKey,Pt(this.anchor.key,this.anchor.offset,this.anchor.type),Pt(this.focus.key,this.focus.offset,this.focus.type))}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(t){}insertText(){}hasFormat(t){let n=0;this.getNodes().filter(fe).forEach(o=>{const i=o.getFirstChild();Sr(i)&&(n|=i.getTextFormat())});const r=gr[t];return(n&r)!==0}insertNodes(t){const n=this.focus.getNode();V(n)||ue(151),qi(n.select(0,n.getChildrenSize())).insertNodes(t)}getShape(){const{anchorCell:t,focusCell:n}=Wm(this),r=zm(t);r===null&&ue(153);const o=zm(n);o===null&&ue(155);const i=Math.min(r.columnIndex,o.columnIndex),s=Math.max(r.columnIndex+r.colSpan-1,o.columnIndex+o.colSpan-1),a=Math.min(r.rowIndex,o.rowIndex),l=Math.max(r.rowIndex+r.rowSpan-1,o.rowIndex+o.rowSpan-1);return{fromX:Math.min(i,s),fromY:Math.min(a,l),toX:Math.max(i,s),toY:Math.max(a,l)}}getNodes(){if(!this.isValid())return[];const t=this._cachedNodes;if(t!==null)return t;const{anchorTable:n,anchorCell:r,focusCell:o}=Wm(this),i=o.getParents()[1];if(i!==n){if(n.isParentOf(o)){const m=i.getParent();m==null&&ue(159),this.set(this.tableKey,o.getKey(),m.getKey())}else{const m=n.getParent();m==null&&ue(158),this.set(this.tableKey,m.getKey(),o.getKey())}return this.getNodes()}const[s,a,l]=zt(n,r,o),{minColumn:c,maxColumn:u,minRow:f,maxRow:d}=Da(s,a,l),h=new Map([[n.getKey(),n]]);let g=null;for(let m=f;m<=d;m++)for(let _=c;_<=u;_++){const{cell:y}=s[m][_],v=y.getParent();Xe(v)||ue(160),v!==g&&(h.set(v.getKey(),v),g=v),h.has(y.getKey())||ZM(y,x=>{h.set(x.getKey(),x)})}const p=Array.from(h.values());return li()||(this._cachedNodes=p),p}getTextContent(){const t=this.getNodes().filter(r=>fe(r));let n="";for(let r=0;r<t.length;r++){const o=t[r],i=o.__parent,s=(t[r+1]||{}).__parent;n+=o.getTextContent()+(s!==i?`
|
|
39
|
+
`:" ")}return n}}function Ve(e){return e instanceof pl}function p1(){const e=Pt("root",0,"element"),t=Pt("root",0,"element");return new pl("root",e,t)}function JM(e,t,n){e.getKey(),t.getKey(),n.getKey();const r=G(),o=Ve(r)?r.clone():p1();return o.set(e.getKey(),t.getKey(),n.getKey()),o}function ZM(e,t){const n=[[e]];for(let r=n.at(-1);r!==void 0&&n.length>0;r=n.at(-1)){const o=r.pop();o===void 0?n.pop():t(o)!==!1&&V(o)&&n.push(o.getChildren())}}function m1(e,t=ui()){const n=Me(e);Ge(n)||ue(231,e);const r=no(n,t.getElementByKey(e));return r===null&&ue(232,e),{tableElement:r,tableNode:n}}class QM{focusX;focusY;listenersToRemove;table;isHighlightingCells;anchorX;anchorY;tableNodeKey;anchorCell;focusCell;anchorCellNodeKey;focusCellNodeKey;editor;tableSelection;hasHijackedSelectionStyles;isSelecting;pointerType;shouldCheckSelection;abortController;listenerOptions;nextFocus;constructor(t,n){this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.listenersToRemove=new Set,this.tableNodeKey=n,this.editor=t,this.table={columns:0,domRows:[],rows:0},this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.isSelecting=!1,this.pointerType=null,this.shouldCheckSelection=!1,this.abortController=new AbortController,this.listenerOptions={signal:this.abortController.signal},this.nextFocus=null,this.trackTable()}getTable(){return this.table}removeListeners(){this.abortController.abort("removeListeners"),Array.from(this.listenersToRemove).forEach(t=>t()),this.listenersToRemove.clear()}$lookup(){return m1(this.tableNodeKey,this.editor)}trackTable(){const t=new MutationObserver(n=>{this.editor.getEditorState().read(()=>{let r=!1;for(let s=0;s<n.length;s++){const a=n[s].target.nodeName;if(a==="TABLE"||a==="TBODY"||a==="THEAD"||a==="TR"){r=!0;break}}if(!r)return;const{tableNode:o,tableElement:i}=this.$lookup();this.table=zo(o,i)},{editor:this.editor})});this.editor.getEditorState().read(()=>{const{tableNode:n,tableElement:r}=this.$lookup();this.table=zo(n,r),t.observe(r,{attributes:!0,childList:!0,subtree:!0})},{editor:this.editor})}$clearHighlight(){const t=this.editor;this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.$enableHighlightStyle();const{tableNode:n,tableElement:r}=this.$lookup();zs(t,zo(n,r),null),G()!==null&&(He(null),t.dispatchCommand(zn,void 0))}$enableHighlightStyle(){const t=this.editor,{tableElement:n}=this.$lookup();Rn(n,t._config.theme.tableSelection),n.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1}$disableHighlightStyle(){const{tableElement:t}=this.$lookup();Ye(t,this.editor._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0}$updateTableTableSelection(t){if(t!==null){t.tableKey!==this.tableNodeKey&&ue(233,t.tableKey,this.tableNodeKey);const n=this.editor;this.tableSelection=t,this.isHighlightingCells=!0,this.$disableHighlightStyle(),this.updateDOMSelection(),zs(n,this.table,this.tableSelection)}else this.$clearHighlight()}setShouldCheckSelection(){this.shouldCheckSelection=!0}getAndClearShouldCheckSelection(){return!!this.shouldCheckSelection&&(this.shouldCheckSelection=!1,!0)}setNextFocus(t){this.nextFocus=t}getAndClearNextFocus(){const{nextFocus:t}=this;return t!==null&&(this.nextFocus=null),t}updateDOMSelection(){if(this.anchorCell!==null&&this.focusCell!==null){const t=St(this.editor._window);t&&t.rangeCount>0&&t.removeAllRanges()}}$setFocusCellForSelection(t,n=!1){const r=this.editor,{tableNode:o}=this.$lookup(),i=t.x,s=t.y;if(this.focusCell=t,this.isHighlightingCells||this.anchorX===i&&this.anchorY===s&&!n){if(i===this.focusX&&s===this.focusY)return!1}else this.isHighlightingCells=!0,this.$disableHighlightStyle();if(this.focusX=i,this.focusY=s,this.isHighlightingCells){const a=id(o,t.elem);if(this.tableSelection!=null&&this.anchorCellNodeKey!=null&&a!==null)return this.focusCellNodeKey=a.getKey(),this.tableSelection=JM(o,this.$getAnchorTableCellOrThrow(),a),He(this.tableSelection),r.dispatchCommand(zn,void 0),zs(r,this.table,this.tableSelection),!0}return!1}$getAnchorTableCell(){return this.anchorCellNodeKey?Me(this.anchorCellNodeKey):null}$getAnchorTableCellOrThrow(){const t=this.$getAnchorTableCell();return t===null&&ue(234),t}$getFocusTableCell(){return this.focusCellNodeKey?Me(this.focusCellNodeKey):null}$getFocusTableCellOrThrow(){const t=this.$getFocusTableCell();return t===null&&ue(235),t}$setAnchorCellForSelection(t){this.isHighlightingCells=!1,this.anchorCell=t,this.anchorX=t.x,this.anchorY=t.y;const{tableNode:n}=this.$lookup(),r=id(n,t.elem);if(r!==null){const o=r.getKey();this.tableSelection=this.tableSelection!=null?this.tableSelection.clone():p1(),this.anchorCellNodeKey=o}}$formatCells(t){const n=G();Ve(n)||ue(236);const r=ol(),o=r.anchor,i=r.focus,s=n.getNodes().filter(fe);s.length>0||ue(237);const a=s[0].getFirstChild(),l=Sr(a)?a.getFormatFlags(t,null):null;s.forEach(c=>{o.set(c.getKey(),0,"element"),i.set(c.getKey(),c.getChildrenSize(),"element"),r.formatText(t,l)}),He(n),this.editor.dispatchCommand(zn,void 0)}$clearText(){const{editor:t}=this,n=Me(this.tableNodeKey);if(!Ge(n))throw new Error("Expected TableNode.");const r=G();Ve(r)||ue(253);const o=r.getNodes().filter(fe),i=n.getFirstChild(),s=n.getLastChild();if(o.length>0&&i!==null&&s!==null&&Xe(i)&&Xe(s)&&o[0]===i.getFirstChild()&&o[o.length-1]===s.getLastChild()){n.selectPrevious();const a=n.getParent();return n.remove(),void(tt(a)&&a.isEmpty()&&t.dispatchCommand(Yr,void 0))}o.forEach(a=>{if(V(a)){const l=me(),c=Pe();l.append(c),a.append(l),a.getChildren().forEach(u=>{u!==l&&u.remove()})}}),zs(t,this.table,null),He(null),t.dispatchCommand(zn,void 0)}}const od="__lexicalTableSelection";function To(e){return je(e)&&e.nodeName==="TABLE"}function no(e,t){if(!t)return t;const n=To(t)?t:e.getDOMSlot(t).element;return n.nodeName!=="TABLE"&&ue(245,t.nodeName),n}function Uf(e){return e._window}function ji(e,t){for(let n=t,r=null;n!==null;n=n.getParent()){if(e.is(n))return r;fe(n)&&(r=n)}return null}const eN=[[cf,"down"],[lf,"up"],[af,"backward"],[sf,"forward"]],tN=[Yo,Xr,cr],nN=[Qa,df];function rN(e,t,n,r){const o=n.getRootElement(),i=Uf(n);o!==null&&i!==null||ue(246);const s=new QM(n,e.getKey()),a=no(e,t);(function(h,g){Hm(h)!==null&&ue(205),h[od]=g})(a,s),s.listenersToRemove.add(()=>(function(h,g){Hm(h)===g&&delete h[od]})(a,s));const l=h=>{if(s.pointerType=h.pointerType,h.button!==0||!en(h.target)||!i)return;const g=Va(h.target);g!==null&&n.update(()=>{const p=An();if(Bm&&h.shiftKey&&pn(p,e)&&(W(p)||Ve(p))){const m=p.anchor.getNode(),_=ji(e,p.anchor.getNode());_?(s.$setAnchorCellForSelection(Ir(s,_)),s.$setFocusCellForSelection(g),Bn(h)):(e.isBefore(m)?e.selectStart():e.selectEnd()).anchor.set(p.anchor.key,p.anchor.offset,p.anchor.type)}else h.pointerType!=="touch"&&s.$setAnchorCellForSelection(g)}),(()=>{if(s.isSelecting)return;const p=()=>{s.isSelecting=!1,i.removeEventListener("pointerup",p),i.removeEventListener("pointermove",m)},m=_=>{if(1&~_.buttons&&s.isSelecting)return s.isSelecting=!1,i.removeEventListener("pointerup",p),void i.removeEventListener("pointermove",m);if(!en(_.target))return;let y=null;const v=!(Bm||a.contains(_.target));if(v)y=Km(a,_.target);else for(const x of document.elementsFromPoint(_.clientX,_.clientY))if(y=Km(a,x),y)break;!y||s.focusCell!==null&&y.elem===s.focusCell.elem||(s.setNextFocus({focusCell:y,override:v}),n.dispatchCommand(zn,void 0))};s.isSelecting=!0,i.addEventListener("pointerup",p,s.listenerOptions),i.addEventListener("pointermove",m,s.listenerOptions)})()};a.addEventListener("pointerdown",l,s.listenerOptions),s.listenersToRemove.add(()=>{a.removeEventListener("pointerdown",l)});const c=h=>{h.detail>=3&&en(h.target)&&Va(h.target)!==null&&h.preventDefault()};a.addEventListener("mousedown",c,s.listenerOptions),s.listenersToRemove.add(()=>{a.removeEventListener("mousedown",c)});const u=h=>{const g=h.target;h.button===0&&en(g)&&n.update(()=>{const p=G();Ve(p)&&p.tableKey===s.tableNodeKey&&o.contains(g)&&s.$clearHighlight()})};i.addEventListener("pointerdown",u,s.listenerOptions),s.listenersToRemove.add(()=>{i.removeEventListener("pointerdown",u)});for(const[h,g]of eN)s.listenersToRemove.add(n.registerCommand(h,p=>_1(n,p,g,e,s),Et));s.listenersToRemove.add(n.registerCommand(uf,h=>{const g=G();if(Ve(g)){const p=ji(e,g.focus.getNode());if(p!==null)return Bn(h),p.selectEnd(),!0}return!1},Et));const f=h=>()=>{const g=G();if(!pn(g,e))return!1;if(Ve(g))return s.$clearText(),!0;if(W(g)){if(!fe(ji(e,g.anchor.getNode())))return!1;const p=g.anchor.getNode(),m=g.focus.getNode(),_=e.isParentOf(p),y=e.isParentOf(m);if(_&&!y||y&&!_)return s.$clearText(),!0;const v=xe(g.anchor.getNode(),b=>V(b)),x=v&&xe(v,b=>V(b)&&fe(b.getParent()));if(!V(x)||!V(v))return!1;if(h===Xr&&x.getPreviousSibling()===null)return!0}return!1};for(const h of tN)s.listenersToRemove.add(n.registerCommand(h,f(h),Et));const d=h=>{const g=G();if(!Ve(g)&&!W(g))return!1;const p=e.isParentOf(g.anchor.getNode());if(p!==e.isParentOf(g.focus.getNode())){const m=p?"anchor":"focus",_=p?"focus":"anchor",{key:y,offset:v,type:x}=g[_];return e[g[m].isBefore(g[_])?"selectPrevious":"selectNext"]()[_].set(y,v,x),!1}return!!pn(g,e)&&!!Ve(g)&&(h&&(h.preventDefault(),h.stopPropagation()),s.$clearText(),!0)};for(const h of nN)s.listenersToRemove.add(n.registerCommand(h,d,Et));return s.listenersToRemove.add(n.registerCommand(tl,h=>{const g=G();if(g){if(!Ve(g)&&!W(g))return!1;Xu(n,or(h,ClipboardEvent)?h:null,Wx(g));const p=d(h);return W(g)?(g.removeText(),!0):p}return!1},Et)),s.listenersToRemove.add(n.registerCommand(Rt,h=>{const g=G();if(!pn(g,e))return!1;if(Ve(g))return s.$formatCells(h),!0;if(W(g)){const p=xe(g.anchor.getNode(),m=>fe(m));if(!fe(p))return!1}return!1},Et)),s.listenersToRemove.add(n.registerCommand($o,h=>{const g=G();if(!Ve(g)||!pn(g,e))return!1;const p=g.anchor.getNode(),m=g.focus.getNode();if(!fe(p)||!fe(m))return!1;if((function(R,M){if(Ve(R)){const O=R.anchor.getNode(),D=R.focus.getNode();if(M&&O&&D){const[I]=zt(M,O,D);return O.getKey()===I[0][0].cell.getKey()&&D.getKey()===I[I.length-1].at(-1).cell.getKey()}}return!1})(g,e))return e.setFormat(h),!0;const[_,y,v]=zt(e,p,m),x=Math.max(y.startRow+y.cell.__rowSpan-1,v.startRow+v.cell.__rowSpan-1),b=Math.max(y.startColumn+y.cell.__colSpan-1,v.startColumn+v.cell.__colSpan-1),w=Math.min(y.startRow,v.startRow),T=Math.min(y.startColumn,v.startColumn),E=new Set;for(let R=w;R<=x;R++)for(let M=T;M<=b;M++){const O=_[R][M].cell;if(E.has(O))continue;E.add(O),O.setFormat(h);const D=O.getChildren();for(let I=0;I<D.length;I++){const L=D[I];V(L)&&!L.isInline()&&L.setFormat(h)}}return!0},Et)),s.listenersToRemove.add(n.registerCommand(Wr,h=>{const g=G();if(!pn(g,e))return!1;if(Ve(g))return s.$clearHighlight(),!1;if(W(g)){const p=xe(g.anchor.getNode(),m=>fe(m));if(!fe(p))return!1;if(typeof h=="string"){const m=qm(n,g,e);if(m)return Gm(m,e,[Pe(h)]),!0}}return!1},Et)),r&&s.listenersToRemove.add(n.registerCommand(ff,h=>{const g=G();if(!W(g)||!g.isCollapsed()||!pn(g,e))return!1;const p=wi(g.anchor.getNode());return!(p===null||!e.is(Wo(p)))&&(Bn(h),(function(m,_){const y=_==="next"?"getNextSibling":"getPreviousSibling",v=_==="next"?"getFirstChild":"getLastChild",x=m[y]();if(V(x))return x.selectEnd();const b=xe(m,Xe);b===null&&ue(247);for(let T=b[y]();Xe(T);T=T[y]()){const E=T[v]();if(V(E))return E.selectEnd()}const w=xe(b,Ge);w===null&&ue(248),_==="next"?w.selectNext():w.selectPrevious()})(p,h.shiftKey?"previous":"next"),!0)},Et)),s.listenersToRemove.add(n.registerCommand(y_,h=>e.isSelected(),Et)),s.listenersToRemove.add(n.registerCommand(rf,(h,g)=>{if(n!==g)return!1;const{nodes:p,selection:m}=h,_=m.getStartEndPoints(),y=Ve(m),v=W(m)&&xe(m.anchor.getNode(),te=>fe(te))!==null&&xe(m.focus.getNode(),te=>fe(te))!==null||y;if(p.length!==1||!Ge(p[0])||!v||_===null)return!1;const[x,b]=_,[w,T,E]=xn(x),R=xe(b.getNode(),te=>fe(te));if(!(fe(w)&&fe(R)&&Xe(T)&&Ge(E)))return!1;const M=p[0],[O,D,I]=zt(E,w,R),[L]=sr(M,null,null),B=O.length,K=B>0?O[0].length:0;let P=D.startRow,A=D.startColumn,$=L.length,H=$>0?L[0].length:0;if(y){const te=Da(O,D,I),ye=te.maxRow-te.minRow+1,Se=te.maxColumn-te.minColumn+1;P=te.minRow,A=te.minColumn,$=Math.min($,ye),H=Math.min(H,Se)}let Q=!1;const J=Math.min(B,P+$)-1,X=Math.min(K,A+H)-1,se=new Set;for(let te=P;te<=J;te++)for(let ye=A;ye<=X;ye++){const Se=O[te][ye];se.has(Se.cell.getKey())||Se.cell.__rowSpan===1&&Se.cell.__colSpan===1||(XM(Se.cell),se.add(Se.cell.getKey()),Q=!0)}let[re]=sr(E.getWritable(),null,null);const he=$-B+P;for(let te=0;te<he;te++)KM(re[B-1][0].cell);const we=H-K+A;for(let te=0;te<we;te++)UM(re[0][K-1].cell,!0,!1);[re]=sr(E.getWritable(),null,null);for(let te=P;te<P+$;te++)for(let ye=A;ye<A+H;ye++){const Se=te-P,$e=ye-A,ee=L[Se][$e];if(ee.startRow!==Se||ee.startColumn!==$e)continue;const pe=ee.cell;if(pe.__rowSpan!==1||pe.__colSpan!==1){const Le=[],Qn=Math.min(te+pe.__rowSpan,P+$)-1,fn=Math.min(ye+pe.__colSpan,A+H)-1;for(let hn=te;hn<=Qn;hn++)for(let Dt=ye;Dt<=fn;Dt++){const ve=re[hn][Dt];Le.push(ve.cell)}qM(Le),Q=!0}const{cell:Ne}=re[te][ye],Ze=Ne.getChildren();pe.getChildren().forEach(Le=>{Y(Le)&&me().append(Le),Ne.append(Le)}),Ze.forEach(Le=>Le.remove())}if(y&&Q){const[te]=sr(E.getWritable(),null,null);te[D.startRow][D.startColumn].cell.selectEnd()}return!0},Et)),s.listenersToRemove.add(n.registerCommand(zn,()=>{const h=G(),g=An(),p=s.getAndClearNextFocus();if(p!==null){const{focusCell:m}=p;if(Ve(h)&&h.tableKey===s.tableNodeKey)return(m.x!==s.focusX||m.y!==s.focusY)&&(s.$setFocusCellForSelection(m),!0);if(m!==s.anchorCell&&pn(h,e))return s.$setFocusCellForSelection(m),!0}if(s.getAndClearShouldCheckSelection()&&W(g)&&W(h)&&h.isCollapsed()){const m=h.anchor.getNode(),_=e.getFirstChild(),y=wi(m);if(y!==null&&Xe(_)){const v=_.getFirstChild();if(fe(v)&&e.is(xe(y,x=>x.is(e)||x.is(v))))return v.selectStart(),!0}}if(W(h)){const{anchor:m,focus:_}=h,y=m.getNode(),v=_.getNode(),x=wi(y),b=wi(v),w=!(!x||!e.is(Wo(x))),T=!(!b||!e.is(Wo(b))),E=w!==T,R=w&&T,M=h.isBackward();if(E){const O=h.clone();if(T){const[D]=zt(e,b,b),I=D[0][0].cell,L=D[D.length-1].at(-1).cell;O.focus.set(M?I.getKey():L.getKey(),M?0:L.getChildrenSize(),"element")}else if(w){const[D]=zt(e,x,x),I=D[0][0].cell,L=D[D.length-1].at(-1).cell;O.anchor.set(M?L.getKey():I.getKey(),M?L.getChildrenSize():0,"element")}He(O),Um(n,s)}else if(R&&(x.is(b)||(s.$setAnchorCellForSelection(Ir(s,x)),s.$setFocusCellForSelection(Ir(s,b),!0)),s.pointerType==="touch"&&s.isSelecting&&h.isCollapsed()&&W(g)&&g.isCollapsed())){const O=wi(g.anchor.getNode());O&&!O.is(b)&&(s.$setAnchorCellForSelection(Ir(s,O)),s.$setFocusCellForSelection(Ir(s,b),!0),s.pointerType=null)}}else if(h&&Ve(h)&&h.is(g)&&h.tableKey===e.getKey()){const m=St(i);if(m&&m.anchorNode&&m.focusNode){const _=Ft(m.focusNode),y=_&&!e.isParentOf(_),v=Ft(m.anchorNode),x=v&&e.isParentOf(v);if(y&&x&&m.rangeCount>0){const b=Uk(m,n);b&&(b.anchor.set(e.getKey(),h.isBackward()?e.getChildrenSize():0,"element"),m.removeAllRanges(),He(b))}}}return h&&!h.is(g)&&(Ve(h)||Ve(g))&&s.tableSelection&&!s.tableSelection.is(g)?(Ve(h)&&h.tableKey===s.tableNodeKey?s.$updateTableTableSelection(h):!Ve(h)&&Ve(g)&&g.tableKey===s.tableNodeKey&&s.$updateTableTableSelection(null),!1):(s.hasHijackedSelectionStyles&&!e.isSelected()?(function(m,_){_.$enableHighlightStyle(),Gf(_.table,y=>{const v=y.elem;y.highlighted=!1,v1(m,y),v.getAttribute("style")||v.removeAttribute("style")})})(n,s):!s.hasHijackedSelectionStyles&&e.isSelected()&&Um(n,s),!1)},Et)),s.listenersToRemove.add(n.registerCommand(Yr,()=>{const h=G();if(!W(h)||!h.isCollapsed()||!pn(h,e))return!1;const g=qm(n,h,e);return!!g&&(Gm(g,e),!0)},Et)),s}function Hm(e){return e[od]||null}function Va(e){let t=e;for(;t!=null;){const n=t.nodeName;if(n==="TD"||n==="TH"){const r=t._cell;return r===void 0?null:r}t=t.parentNode}return null}function Km(e,t){if(!e.contains(t))return null;let n=null;for(let r=t;r!=null;r=r.parentNode){if(r===e)return n;const o=r.nodeName;o!=="TD"&&o!=="TH"||(n=r._cell||null)}return null}function zo(e,t){const n=[],r={columns:0,domRows:n,rows:0};let o=no(e,t).querySelector("tr"),i=0,s=0;for(n.length=0;o!=null;){const a=o.nodeName;if(a==="TD"||a==="TH"){const u={elem:o,hasBackgroundColor:o.style.backgroundColor!=="",highlighted:!1,x:i,y:s};o._cell=u;let f=n[s];f===void 0&&(f=n[s]=[]),f[i]=u}else{const u=o.firstChild;if(u!=null){o=u;continue}}const l=o.nextSibling;if(l!=null){i++,o=l;continue}const c=o.parentNode;if(c!=null){const u=c.nextSibling;if(u==null)break;s++,i=0,o=u}}return r.columns=i+1,r.rows=s+1,r}function zs(e,t,n){const r=new Set(n?n.getNodes():[]);Gf(t,(o,i)=>{const s=o.elem;r.has(i)?(o.highlighted=!0,y1(e,o)):(o.highlighted=!1,v1(e,o),s.getAttribute("style")||s.removeAttribute("style"))})}function Gf(e,t){const{domRows:n}=e;for(let r=0;r<n.length;r++){const o=n[r];if(o)for(let i=0;i<o.length;i++){const s=o[i];if(!s)continue;const a=Ft(s.elem);a!==null&&t(s,a,{x:i,y:r})}}}function Um(e,t){t.$disableHighlightStyle(),Gf(t.table,n=>{n.highlighted=!0,y1(e,n)})}const oN=(e,t,n,r,o)=>{const i=o==="forward";switch(o){case"backward":case"forward":return n!==(i?e.table.columns-1:0)?Hs(t.getCellNodeFromCordsOrThrow(n+(i?1:-1),r,e.table),i):r!==(i?e.table.rows-1:0)?Hs(t.getCellNodeFromCordsOrThrow(i?0:e.table.columns-1,r+(i?1:-1),e.table),i):i?t.selectNext():t.selectPrevious(),!0;case"up":return r!==0?Hs(t.getCellNodeFromCordsOrThrow(n,r-1,e.table),!1):t.selectPrevious(),!0;case"down":return r!==e.table.rows-1?Hs(t.getCellNodeFromCordsOrThrow(n,r+1,e.table),!0):t.selectNext(),!0;default:return!1}};function yc(e,t){let n,r;if(t.startColumn===e.minColumn)n="minColumn";else{if(t.startColumn+t.cell.__colSpan-1!==e.maxColumn)return null;n="maxColumn"}if(t.startRow===e.minRow)r="minRow";else{if(t.startRow+t.cell.__rowSpan-1!==e.maxRow)return null;r="maxRow"}return[n,r]}function Ws([e,t]){return[e==="minColumn"?"maxColumn":"minColumn",t==="minRow"?"maxRow":"minRow"]}function _o(e,t,[n,r]){const o=t[r],i=e[o];i===void 0&&ue(250,r,String(o));const s=t[n],a=i[s];return a===void 0&&ue(250,n,String(s)),a}function iN(e,t,n,r,o){const i=Da(t,n,r),s=(function(w,T){const{minColumn:E,maxColumn:R,minRow:M,maxRow:O}=T;let D=1,I=1,L=1,B=1;const K=w[M],P=w[O];for(let A=E;A<=R;A++)D=Math.max(D,K[A].cell.__rowSpan),B=Math.max(B,P[A].cell.__rowSpan);for(let A=M;A<=O;A++)I=Math.max(I,w[A][E].cell.__colSpan),L=Math.max(L,w[A][R].cell.__colSpan);return{bottomSpan:B,leftSpan:I,rightSpan:L,topSpan:D}})(t,i),{topSpan:a,leftSpan:l,bottomSpan:c,rightSpan:u}=s,f=(function(w,T){const E=yc(w,T);return E===null&&ue(249,T.cell.getKey()),E})(i,n),[d,h]=Ws(f);let g=i[d],p=i[h];o==="forward"?g+=d==="maxColumn"?1:l:o==="backward"?g-=d==="minColumn"?1:u:o==="down"?p+=h==="maxRow"?1:a:o==="up"&&(p-=h==="minRow"?1:c);const m=t[p];if(m===void 0)return!1;const _=m[g];if(_===void 0)return!1;const[y,v]=(function(w,T,E){const R=Da(w,T,E),M=yc(R,T);if(M)return[_o(w,R,M),_o(w,R,Ws(M))];const O=yc(R,E);if(O)return[_o(w,R,Ws(O)),_o(w,R,O)];const D=["minColumn","minRow"];return[_o(w,R,D),_o(w,R,Ws(D))]})(t,n,_),x=Ir(e,y.cell),b=Ir(e,v.cell);return e.$setAnchorCellForSelection(x),e.$setFocusCellForSelection(b,!0),!0}function pn(e,t){if(W(e)||Ve(e)){const n=t.isParentOf(e.anchor.getNode()),r=t.isParentOf(e.focus.getNode());return n&&r}return!1}function Hs(e,t){t?e.selectStart():e.selectEnd()}function y1(e,t){const n=t.elem,r=e._config.theme;fe(Ft(n))||ue(131),Ye(n,r.tableCellSelected)}function v1(e,t){const n=t.elem;fe(Ft(n))||ue(131);const r=e._config.theme;Rn(n,r.tableCellSelected)}function wi(e){const t=xe(e,fe);return fe(t)?t:null}function Wo(e){const t=xe(e,Ge);return Ge(t)?t:null}function sN(e,t,n,r,o,i,s){const a=an(n.focus,o?"previous":"next");if(Ff(a))return!1;let l=a;for(const m of Qi(a).iterNodeCarets("shadowRoot")){if(!pr(m)||!V(m.origin))return!1;l=m}const c=l.getParentAtCaret();if(!fe(c))return!1;const u=c,f=(function(m){for(const _ of Qi(m).iterNodeCarets("root")){const{origin:y}=_;if(fe(y)){if(At(_))return Ct(y,m.direction)}else if(!Xe(y))break}return null})(Je(u,l.direction)),d=xe(u,Ge);if(!d||!d.is(i))return!1;const h=e.getElementByKey(u.getKey()),g=Va(h);if(!h||!g)return!1;const p=lN(e,d);if(s.table=p,f)if(r==="extend"){const m=Va(e.getElementByKey(f.origin.getKey()));if(!m)return!1;s.$setAnchorCellForSelection(g),s.$setFocusCellForSelection(m,!0)}else{const m=bt(f);tn(n.anchor,m),tn(n.focus,m)}else if(r==="extend")s.$setAnchorCellForSelection(g),s.$setFocusCellForSelection(g,!0);else{const m=(function(_){const y=hs(_);return At(y)?bt(y):_})(Je(d,a.direction));tn(n.anchor,m),tn(n.focus,m)}return Bn(t),!0}function _1(e,t,n,r,o){if((n==="up"||n==="down")&&(function(s){const a=s.getRootElement();return a?a.hasAttribute("aria-controls")&&a.getAttribute("aria-controls")==="typeahead-menu":!1})(e))return!1;const i=G();if(!pn(i,r)){if(W(i)){if(n==="backward"){if(i.focus.offset>0)return!1;const s=(function(l){for(let c=l,u=l;u!==null;c=u,u=u.getParent())if(V(u)){if(u!==c&&u.getFirstChild()!==c)return null;if(!u.isInline())return u}return null})(i.focus.getNode());if(!s)return!1;const a=s.getPreviousSibling();return!!Ge(a)&&(Bn(t),t.shiftKey?i.focus.set(a.getParentOrThrow().getKey(),a.getIndexWithinParent(),"element"):a.selectEnd(),!0)}if(t.shiftKey&&(n==="up"||n==="down")){const s=i.focus.getNode();if(!i.isCollapsed()&&(n==="up"&&!i.isBackward()||n==="down"&&i.isBackward())){let a=xe(s,d=>Ge(d));if(fe(a)&&(a=xe(a,Ge)),a!==r||!a)return!1;const l=n==="down"?a.getNextSibling():a.getPreviousSibling();if(!l)return!1;let c=0;n==="up"&&V(l)&&(c=l.getChildrenSize());let u=l;n==="up"&&V(l)&&(u=l.getLastChild()||l,c=Y(u)?u.getTextContentSize():0);const f=i.clone();return f.focus.set(u.getKey(),c,Y(u)?"text":"element"),He(f),Bn(t),!0}if(dt(s)){const a=n==="up"?i.getNodes()[i.getNodes().length-1]:i.getNodes()[0];if(a&&ji(r,a)!==null){const l=r.getFirstDescendant(),c=r.getLastDescendant();if(!l||!c)return!1;const[u]=xn(l),[f]=xn(c),d=r.getCordsFromCellNode(u,o.table),h=r.getCordsFromCellNode(f,o.table),g=r.getDOMCellFromCordsOrThrow(d.x,d.y,o.table),p=r.getDOMCellFromCordsOrThrow(h.x,h.y,o.table);return o.$setAnchorCellForSelection(g),o.$setFocusCellForSelection(p,!0),!0}return!1}{let a=xe(s,c=>V(c)&&!c.isInline());if(fe(a)&&(a=xe(a,Ge)),!a)return!1;const l=n==="down"?a.getNextSibling():a.getPreviousSibling();if(Ge(l)&&o.tableNodeKey===l.getKey()){const c=l.getFirstDescendant(),u=l.getLastDescendant();if(!c||!u)return!1;const[f]=xn(c),[d]=xn(u),h=i.clone();return h.focus.set((n==="up"?f:d).getKey(),n==="up"?0:d.getChildrenSize(),"element"),Bn(t),He(h),!0}}}}return n==="down"&&ja(e)&&o.setShouldCheckSelection(),!1}if(W(i)){if(n==="backward"||n==="forward")return sN(e,t,i,t.shiftKey?"extend":"move",n==="backward",r,o);if(i.isCollapsed()){const{anchor:s,focus:a}=i,l=xe(s.getNode(),fe),c=xe(a.getNode(),fe);if(!fe(l)||!l.is(c))return!1;const u=Wo(l);if(u!==r&&u!=null){const _=no(u,e.getElementByKey(u.getKey()));if(_!=null)return o.table=zo(u,_),_1(e,t,n,u,o)}const f=e.getElementByKey(l.__key),d=e.getElementByKey(s.key);if(d==null||f==null)return!1;let h;if(s.type==="element")h=d.getBoundingClientRect();else{const _=St(Uf(e));if(_===null||_.rangeCount===0)return!1;h=_.getRangeAt(0).getBoundingClientRect()}const g=n==="up"?l.getFirstChild():l.getLastChild();if(g==null)return!1;const p=e.getElementByKey(g.__key);if(p==null)return!1;const m=p.getBoundingClientRect();if(n==="up"?m.top>h.top-h.height:h.bottom+h.height>m.bottom){Bn(t);const _=r.getCordsFromCellNode(l,o.table);if(!t.shiftKey)return oN(o,r,_.x,_.y,n);{const y=r.getDOMCellFromCordsOrThrow(_.x,_.y,o.table);o.$setAnchorCellForSelection(y),o.$setFocusCellForSelection(y,!0)}return!0}}}else if(Ve(i)){const{anchor:s,focus:a}=i,l=xe(s.getNode(),fe),c=xe(a.getNode(),fe),[u]=i.getNodes();Ge(u)||ue(251);const f=no(u,e.getElementByKey(u.getKey()));if(!fe(l)||!fe(c)||!Ge(u)||f==null)return!1;o.$updateTableTableSelection(i);const d=zo(u,f),h=r.getCordsFromCellNode(l,d),g=r.getDOMCellFromCordsOrThrow(h.x,h.y,d);if(o.$setAnchorCellForSelection(g),Bn(t),t.shiftKey){const[p,m,_]=zt(r,l,c);return iN(o,p,m,_,n)}return c.selectEnd(),!0}return!1}function Bn(e){e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation()}function Gm(e,t,n){const r=me();e==="first"?t.insertBefore(r):t.insertAfter(r),r.append(...n||[]),r.selectEnd()}function qm(e,t,n){const r=n.getParent();if(!r)return;const o=St(Uf(e));if(!o)return;const i=o.anchorNode,s=e.getElementByKey(r.getKey()),a=no(n,e.getElementByKey(n.getKey()));if(!i||!s||!a||!s.contains(i)||a.contains(i))return;const l=xe(t.anchor.getNode(),y=>fe(y));if(!l)return;const c=xe(l,y=>Ge(y));if(!Ge(c)||!c.is(n))return;const[u,f]=zt(n,l,l),d=u[0][0],h=u[u.length-1][u[0].length-1],{startRow:g,startColumn:p}=f,m=g===d.startRow&&p===d.startColumn,_=g===h.startRow&&p===h.startColumn;return m?"first":_?"last":void 0}function Ir(e,t){const{tableNode:n}=e.$lookup(),r=n.getCordsFromCellNode(t,e.table);return n.getDOMCellFromCordsOrThrow(r.x,r.y,e.table)}function id(e,t,n){return ji(e,Ft(t,n))}function Ym(e,t,n){if(!t.theme.tableAlignment)return;const r=[],o=[];for(const i of["center","right"]){const s=t.theme.tableAlignment[i];s&&(i===n?o:r).push(s)}Rn(e,...r),Ye(e,...o)}const sd=new WeakSet;function ja(e=ui()){return sd.has(e)}function aN(e,t){t?sd.add(e):sd.delete(e)}class un extends yt{__rowStriping;__frozenColumnCount;__frozenRowCount;__colWidths;static getType(){return"table"}getColWidths(){return this.getLatest().__colWidths}setColWidths(t){const n=this.getWritable();return n.__colWidths=t,n}static clone(t){return new un(t.__key)}afterCloneFrom(t){super.afterCloneFrom(t),this.__colWidths=t.__colWidths,this.__rowStriping=t.__rowStriping,this.__frozenColumnCount=t.__frozenColumnCount,this.__frozenRowCount=t.__frozenRowCount}static importDOM(){return{table:t=>({conversion:cN,priority:1})}}static importJSON(t){return ml().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setRowStriping(t.rowStriping||!1).setFrozenColumns(t.frozenColumnCount||0).setFrozenRows(t.frozenRowCount||0).setColWidths(t.colWidths)}constructor(t){super(t),this.__rowStriping=!1,this.__frozenColumnCount=0,this.__frozenRowCount=0,this.__colWidths=void 0}exportJSON(){return{...super.exportJSON(),colWidths:this.getColWidths(),frozenColumnCount:this.__frozenColumnCount?this.__frozenColumnCount:void 0,frozenRowCount:this.__frozenRowCount?this.__frozenRowCount:void 0,rowStriping:this.__rowStriping?this.__rowStriping:void 0}}extractWithChild(t,n,r){return r==="html"}getDOMSlot(t){const n=To(t)?t:t.querySelector("table");return To(n)||ue(229),super.getDOMSlot(t).withElement(n).withAfter(n.querySelector("colgroup"))}createDOM(t,n){const r=document.createElement("table");this.__style&&(r.style.cssText=this.__style);const o=document.createElement("colgroup");if(r.appendChild(o),g3(o),Ye(r,t.theme.table),this.updateTableElement(null,r,t),ja(n)){const i=document.createElement("div"),s=t.theme.tableScrollableWrapper;return s?Ye(i,s):i.style.cssText="overflow-x: auto;",i.appendChild(r),this.updateTableWrapper(null,i,r,t),i}return r}updateTableWrapper(t,n,r,o){this.__frozenColumnCount!==(t?t.__frozenColumnCount:0)&&(function(i,s,a,l){l>0?(Ye(i,a.theme.tableFrozenColumn),s.setAttribute("data-lexical-frozen-column","true")):(Rn(i,a.theme.tableFrozenColumn),s.removeAttribute("data-lexical-frozen-column"))})(n,r,o,this.__frozenColumnCount),this.__frozenRowCount!==(t?t.__frozenRowCount:0)&&(function(i,s,a,l){l>0?(Ye(i,a.theme.tableFrozenRow),s.setAttribute("data-lexical-frozen-row","true")):(Rn(i,a.theme.tableFrozenRow),s.removeAttribute("data-lexical-frozen-row"))})(n,r,o,this.__frozenRowCount)}updateTableElement(t,n,r){this.__style!==(t?t.__style:"")&&(n.style.cssText=this.__style),this.__rowStriping!==(!!t&&t.__rowStriping)&&(function(o,i,s){s?(Ye(o,i.theme.tableRowStriping),o.setAttribute("data-lexical-row-striping","true")):(Rn(o,i.theme.tableRowStriping),o.removeAttribute("data-lexical-row-striping"))})(n,r,this.__rowStriping),(function(o,i,s,a){const l=o.querySelector("colgroup");if(!l)return;const c=[];for(let u=0;u<s;u++){const f=document.createElement("col"),d=a&&a[u];d&&(f.style.width=`${d}px`),c.push(f)}l.replaceChildren(...c)})(n,0,this.getColumnCount(),this.getColWidths()),Ym(n,r,this.getFormatType())}updateDOM(t,n,r){const o=this.getDOMSlot(n).element;return n===o===ja()||(je(i=n)&&i.nodeName==="DIV"&&this.updateTableWrapper(t,n,o,r),this.updateTableElement(t,o,r),!1);var i}exportDOM(t){const n=super.exportDOM(t),{element:r}=n;return{after:o=>{if(n.after&&(o=n.after(o)),!To(o)&&je(o)&&(o=o.querySelector("table")),!To(o))return null;Ym(o,t._config,this.getFormatType());const[i]=sr(this,null,null),s=new Map;for(const u of i)for(const f of u){const d=f.cell.getKey();s.has(d)||s.set(d,{colSpan:f.cell.getColSpan(),startColumn:f.startColumn})}const a=new Set;for(const u of o.querySelectorAll(":scope > tr > [data-temporary-table-cell-lexical-key]")){const f=u.getAttribute("data-temporary-table-cell-lexical-key");if(f){const d=s.get(f);if(u.removeAttribute("data-temporary-table-cell-lexical-key"),d){s.delete(f);for(let h=0;h<d.colSpan;h++)a.add(h+d.startColumn)}}}const l=o.querySelector(":scope > colgroup");if(l){const u=Array.from(o.querySelectorAll(":scope > colgroup > col")).filter((f,d)=>a.has(d));l.replaceChildren(...u)}const c=o.querySelectorAll(":scope > tr");if(c.length>0){const u=document.createElement("tbody");for(const f of c)u.appendChild(f);o.append(u)}return o},element:!To(r)&&je(r)?r.querySelector("table"):r}}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(t,n){const{rows:r,domRows:o}=n;for(let i=0;i<r;i++){const s=o[i];if(s!=null)for(let a=0;a<s.length;a++){const l=s[a];if(l==null)continue;const{elem:c}=l,u=id(this,c);if(u!==null&&t.is(u))return{x:a,y:i}}}throw new Error("Cell not found in table.")}getDOMCellFromCords(t,n,r){const{domRows:o}=r,i=o[n];if(i==null)return null;const s=i[t<i.length?t:i.length-1];return s??null}getDOMCellFromCordsOrThrow(t,n,r){const o=this.getDOMCellFromCords(t,n,r);if(!o)throw new Error("Cell not found at cords.");return o}getCellNodeFromCords(t,n,r){const o=this.getDOMCellFromCords(t,n,r);if(o==null)return null;const i=Ft(o.elem);return fe(i)?i:null}getCellNodeFromCordsOrThrow(t,n,r){const o=this.getCellNodeFromCords(t,n,r);if(!o)throw new Error("Node at cords not TableCellNode.");return o}getRowStriping(){return!!this.getLatest().__rowStriping}setRowStriping(t){const n=this.getWritable();return n.__rowStriping=t,n}setFrozenColumns(t){const n=this.getWritable();return n.__frozenColumnCount=t,n}getFrozenColumns(){return this.getLatest().__frozenColumnCount}setFrozenRows(t){const n=this.getWritable();return n.__frozenRowCount=t,n}getFrozenRows(){return this.getLatest().__frozenRowCount}canSelectBefore(){return!0}canIndent(){return!1}getColumnCount(){const t=this.getFirstChild();if(!t)return 0;let n=0;return t.getChildren().forEach(r=>{fe(r)&&(n+=r.getColSpan())}),n}}function lN(e,t){const n=e.getElementByKey(t.getKey());return n===null&&ue(230),zo(t,n)}function cN(e){const t=ml();e.hasAttribute("data-lexical-row-striping")&&t.setRowStriping(!0),e.hasAttribute("data-lexical-frozen-column")&&t.setFrozenColumns(1),e.hasAttribute("data-lexical-frozen-row")&&t.setFrozenRows(1);const n=e.querySelector(":scope > colgroup");if(n){let r=[];for(const o of n.querySelectorAll(":scope > col")){let i=o.style.width||"";if(!Hf.test(i)&&(i=o.getAttribute("width")||"",!/^\d+$/.test(i))){r=void 0;break}r.push(parseFloat(i))}r&&t.setColWidths(r)}return{after:r=>bx(r,Xe),node:t}}function ml(){return vt(new un)}function Ge(e){return e instanceof un}function uN(e){Xe(e.getParent())?e.isEmpty()&&e.append(me()):e.remove()}function dN(e){Ge(e.getParent())?_x(e,fe):e.remove()}function fN(e){_x(e,Xe);const[t]=sr(e,null,null),n=t.reduce((s,a)=>Math.max(s,a.length),0),r=e.getChildren();for(let s=0;s<t.length;++s){const a=r[s];if(!a)continue;Xe(a)||ue(254,a.constructor.name,a.getType());const l=t[s].reduce((c,u)=>u?1+c:c,0);if(l!==n)for(let c=l;c<n;++c){const u=Kt();u.append(me()),a.append(u)}}const o=e.getColWidths(),i=e.getColumnCount();if(o&&o.length!==i){let s;if(i<o.length)s=o.slice(0,i);else if(o.length>0){const a=o[o.length-1];s=[...o,...Array(i-o.length).fill(a)]}e.setColWidths(s)}}function hN(e){if(e.detail<3||!en(e.target))return!1;const t=Ft(e.target);if(t===null)return!1;const n=xe(t,r=>V(r)&&!r.isInline());return n===null?!1:!!fe(n.getParent())&&(n.select(0),!0)}function gN(e){return e.registerNodeTransform(cn,t=>{if(t.getColSpan()>1||t.getRowSpan()>1){const[,,n]=xn(t),[r]=zt(n,t,t),o=r.length,i=r[0].length;let s=n.getFirstChild();Xe(s)||ue(175);const a=[];for(let l=0;l<o;l++){l!==0&&(s=s.getNextSibling(),Xe(s)||ue(175));let c=null;for(let u=0;u<i;u++){const f=r[l][u],d=f.cell;if(f.startRow===l&&f.startColumn===u)c=d,a.push(d);else if(d.getColSpan()>1||d.getRowSpan()>1){fe(d)||ue(176);const h=Kt(d.__headerState);c!==null?c.insertAfter(h):$3(s,h)}}}for(const l of a)l.setColSpan(1),l.setRowSpan(1)}})}function pN(e,t=!0){const n=new Map,r=(i,s,a)=>{const l=no(i,a),c=rN(i,l,e,t);n.set(s,[c,l])},o=e.registerMutationListener(un,i=>{e.getEditorState().read(()=>{for(const[s,a]of i){const l=n.get(s);if(a==="created"||a==="updated"){const{tableNode:c,tableElement:u}=m1(s);l===void 0?r(c,s,u):u!==l[1]&&(l[0].removeListeners(),n.delete(s),r(c,s,u))}else a==="destroyed"&&l!==void 0&&(l[0].removeListeners(),n.delete(s))}},{editor:e})},{skipInitialization:!1});return()=>{o();for(const[,[i]]of n)i.removeListeners()}}function mN(e,t){e.hasNodes([un])||ue(255);const{hasNestedTables:n=Sx(!1)}=t??{};return ln(e.registerCommand(h1,r=>(function({rows:o,columns:i,includeHeaders:s},a){const l=G()||An();if(!l||!W(l)||!a&&Wo(l.anchor.getNode()))return!1;const c=WM(Number(o),Number(i),s);O3(c);const u=c.getFirstDescendant();return Y(u)&&u.select(),!0})(r,n.peek()),_e),e.registerCommand(rf,({nodes:r,selection:o},i)=>n.peek()||e!==i||!W(o)?!1:Wo(o.anchor.getNode())!==null&&r.some(Ge),_e),e.registerCommand(Za,hN,_e),e.registerNodeTransform(un,fN),e.registerNodeTransform(yr,dN),e.registerNodeTransform(cn,uN))}function yN({hasCellMerge:e=!0,hasCellBackgroundColor:t=!0,hasTabHandler:n=!0,hasHorizontalScroll:r=!1,hasNestedTables:o=!1}){const[i]=nt();C.useEffect(()=>{ja(i)!==r&&(aN(i,r),i.registerNodeTransform(un,()=>{})())},[i,r]);const s=C.useMemo(()=>Sx(!1),[]);return s.peek()!==o&&(s.value=o),C.useEffect(()=>mN(i,{hasNestedTables:s}),[i,s]),C.useEffect(()=>pN(i,n),[i,n]),C.useEffect(()=>{if(!e)return gN(i)},[i,e]),C.useEffect(()=>{if(!t)return i.registerNodeTransform(cn,a=>{a.getBackgroundColor()!==null&&a.setBackgroundColor(null)})},[i,t,e]),null}var vc,Xm;function x1(){if(Xm)return vc;Xm=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return vc=e,vc}var _c,Jm;function vN(){if(Jm)return _c;Jm=1;var e=typeof _n=="object"&&_n&&_n.Object===Object&&_n;return _c=e,_c}var xc,Zm;function b1(){if(Zm)return xc;Zm=1;var e=vN(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return xc=n,xc}var bc,Qm;function _N(){if(Qm)return bc;Qm=1;var e=b1(),t=function(){return e.Date.now()};return bc=t,bc}var Cc,ey;function xN(){if(ey)return Cc;ey=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return Cc=t,Cc}var wc,ty;function bN(){if(ty)return wc;ty=1;var e=xN(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return wc=n,wc}var Sc,ny;function C1(){if(ny)return Sc;ny=1;var e=b1(),t=e.Symbol;return Sc=t,Sc}var Ec,ry;function CN(){if(ry)return Ec;ry=1;var e=C1(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,o=e?e.toStringTag:void 0;function i(s){var a=n.call(s,o),l=s[o];try{s[o]=void 0;var c=!0}catch{}var u=r.call(s);return c&&(a?s[o]=l:delete s[o]),u}return Ec=i,Ec}var Tc,oy;function wN(){if(oy)return Tc;oy=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return Tc=n,Tc}var Rc,iy;function SN(){if(iy)return Rc;iy=1;var e=C1(),t=CN(),n=wN(),r="[object Null]",o="[object Undefined]",i=e?e.toStringTag:void 0;function s(a){return a==null?a===void 0?o:r:i&&i in Object(a)?t(a):n(a)}return Rc=s,Rc}var kc,sy;function EN(){if(sy)return kc;sy=1;function e(t){return t!=null&&typeof t=="object"}return kc=e,kc}var Ac,ay;function TN(){if(ay)return Ac;ay=1;var e=SN(),t=EN(),n="[object Symbol]";function r(o){return typeof o=="symbol"||t(o)&&e(o)==n}return Ac=r,Ac}var Mc,ly;function RN(){if(ly)return Mc;ly=1;var e=bN(),t=x1(),n=TN(),r=NaN,o=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,s=/^0o[0-7]+$/i,a=parseInt;function l(c){if(typeof c=="number")return c;if(n(c))return r;if(t(c)){var u=typeof c.valueOf=="function"?c.valueOf():c;c=t(u)?u+"":u}if(typeof c!="string")return c===0?c:+c;c=e(c);var f=i.test(c);return f||s.test(c)?a(c.slice(2),f?2:8):o.test(c)?r:+c}return Mc=l,Mc}var Nc,cy;function kN(){if(cy)return Nc;cy=1;var e=x1(),t=_N(),n=RN(),r="Expected a function",o=Math.max,i=Math.min;function s(a,l,c){var u,f,d,h,g,p,m=0,_=!1,y=!1,v=!0;if(typeof a!="function")throw new TypeError(r);l=n(l)||0,e(c)&&(_=!!c.leading,y="maxWait"in c,d=y?o(n(c.maxWait)||0,l):d,v="trailing"in c?!!c.trailing:v);function x(I){var L=u,B=f;return u=f=void 0,m=I,h=a.apply(B,L),h}function b(I){return m=I,g=setTimeout(E,l),_?x(I):h}function w(I){var L=I-p,B=I-m,K=l-L;return y?i(K,d-B):K}function T(I){var L=I-p,B=I-m;return p===void 0||L>=l||L<0||y&&B>=d}function E(){var I=t();if(T(I))return R(I);g=setTimeout(E,w(I))}function R(I){return g=void 0,v&&u?x(I):(u=f=void 0,h)}function M(){g!==void 0&&clearTimeout(g),m=0,u=p=f=g=void 0}function O(){return g===void 0?h:R(t())}function D(){var I=t(),L=T(I);if(u=arguments,f=this,p=I,L){if(g===void 0)return b(p);if(y)return clearTimeout(g),g=setTimeout(E,l),x(p)}return g===void 0&&(g=setTimeout(E,l)),h}return D.cancel=M,D.flush=O,D}return Nc=s,Nc}var AN=kN();const MN=_d(AN),NN=e=>N.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M1.61342 8.47549C1.52262 8.33173 1.47723 8.25985 1.45182 8.14898C1.43273 8.06571 1.43273 7.93437 1.45182 7.8511C1.47723 7.74023 1.52262 7.66835 1.61341 7.52459C2.36369 6.3366 4.59693 3.33337 8.00027 3.33337C11.4036 3.33337 13.6369 6.3366 14.3871 7.52459C14.4779 7.66835 14.5233 7.74023 14.5487 7.8511C14.5678 7.93437 14.5678 8.06571 14.5487 8.14898C14.5233 8.25985 14.4779 8.33173 14.3871 8.47549C13.6369 9.66348 11.4036 12.6667 8.00027 12.6667C4.59693 12.6667 2.36369 9.66348 1.61342 8.47549Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),N.createElement("path",{d:"M8.00027 10C9.10484 10 10.0003 9.10461 10.0003 8.00004C10.0003 6.89547 9.10484 6.00004 8.00027 6.00004C6.8957 6.00004 6.00027 6.89547 6.00027 8.00004C6.00027 9.10461 6.8957 10 8.00027 10Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),w1=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M16 6V5.2C16 4.0799 16 3.51984 15.782 3.09202C15.5903 2.71569 15.2843 2.40973 14.908 2.21799C14.4802 2 13.9201 2 12.8 2H11.2C10.0799 2 9.51984 2 9.09202 2.21799C8.71569 2.40973 8.40973 2.71569 8.21799 3.09202C8 3.51984 8 4.0799 8 5.2V6M10 11.5V16.5M14 11.5V16.5M3 6H21M19 6V17.2C19 18.8802 19 19.7202 18.673 20.362C18.3854 20.9265 17.9265 21.3854 17.362 21.673C16.7202 22 15.8802 22 14.2 22H9.8C8.11984 22 7.27976 22 6.63803 21.673C6.07354 21.3854 5.6146 20.9265 5.32698 20.362C5 19.7202 5 18.8802 5 17.2V6",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}));function S1(e){return e instanceof ro}function E1(e){return new ro(e)}const PN=z.css({display:"inline-flex",color:"var(--text-accent)",textDecoration:"underline",cursor:"pointer"}),FN=z.css({color:"var(--text-accent)",":hover":{color:"var(--text-accent-hover)"}}),LN=z.css({width:"16px",height:"16px",color:"var(--icon-negative)",cursor:"pointer",transition:"var(--transition-general)",":hover":{color:"var(--icon-negative-hover)"}}),ON=z.css({boxShadow:"0 2px 10px 4px var(--effect-shadow-l)",borderRadius:"var(--corner-md)",padding:"var(--spacing-sm)"});function IN({url:e,text:t,nodeKey:n}){const[r]=nt(),o=C.useCallback(()=>{r.update(()=>{const i=Me(n);S1(i)&&i.remove()})},[r,n]);return S.jsx(lr,{content:S.jsxs(q,{flex:!0,row:!0,center:!0,gap:"var(--spacing-xs)",children:[S.jsx("a",{className:FN,target:"_blank",href:e,children:e}),S.jsx(w1,{className:LN,onClick:o})]}),placement:"right-start",trigger:"hover",contentClassName:ON,children:S.jsx(ce,{className:PN,children:t})})}const Pc="custom-link-node";class ro extends cs{_url;_text;constructor({url:t,text:n},r){super(r),this._url=t,this._text=n}getType(){return Pc}getData(){return{url:this._url,text:this._text}}isInline(){return!0}isIsolated(){return!1}createDOM(){const t=document.createElement("span");return t.style.display="inline",t}updateDOM(){return!1}decorate(){return S.jsx(IN,{...this.getData(),nodeKey:this.getKey()})}exportJSON(){return{...super.exportJSON(),format:"left",type:Pc,version:1,text:this._text,url:this._url}}static importJSON(t){return new ro({url:t.url,text:t.text})}static getType(){return Pc}static clone(t){return new ro({url:t._url,text:t._text},t.__key)}}const $N={type:"text-match",dependencies:[ro],regExp:/\[([^\]]+)]\(([^)]+)\)/,trigger:")",importRegExp:/\[([^\]]+)]\(([^)]+)\)/,replace:(e,t)=>{const[,n,r]=t,o=E1({url:r,text:n});e.replace(o)},export:e=>{if(!S1(e))return null;const{text:n,url:r}=e.getData();return!r||!n?"":`[${n}](${r})`}},uy="image-row",DN=z.css({width:"fit-content",display:"flex",alignItems:"center"});function T1(e){return e.length?new vr(e):null}function R1(e){return e instanceof vr}const VN=z.css({width:"100px",height:"100px",objectFit:"cover",borderRadius:"var(--corner-md)"}),jN=z.css({width:"20px",height:"20px",color:"var(--icon-negative)",cursor:"pointer",transition:"var(--transition-general)",":hover":{color:"var(--icon-negative-hover)"}}),BN=z.css({boxShadow:"0 2px 10px 4px var(--effect-shadow-l)",borderRadius:"var(--corner-xs)",padding:"var(--spacing-xs)"});function zN({images:e,nodeKey:t}){const[n]=nt(),r=C.useCallback(()=>{n.update(()=>{const o=Me(t);R1(o)&&o.remove()})},[n,t]);return S.jsx(lr,{content:S.jsx(w1,{className:jN,onClick:r}),placement:"right-start",trigger:"hover",contentClassName:BN,children:S.jsx(q,{w:"full",flex:!0,row:!0,gap:"var(--spacing-sm)",alignItems:"center",children:e.map(({src:o,alt:i})=>S.jsx("img",{src:o,alt:i??"",className:VN},o))})})}class vr extends cs{images;constructor(t,n){super(n),this.images=t}createDOM(){const t=document.createElement("div");return t.className=DN,t.contentEditable="false",t}updateDOM(){return!1}decorate(){return S.jsx(zN,{images:this.images,nodeKey:this.getKey()})}exportJSON(){return{...super.exportJSON(),format:"left",type:uy,version:1,images:this.images}}static importJSON(t){return new vr(t.images)}isInline(){return!1}isIsolated(){return!0}isSelectable(){return!0}static getType(){return uy}static clone(t){return new vr(t.images,t.__key)}}const WN={type:"element",dependencies:[vr],regExp:/^!\[[^\]]*]\([^)]+\)(?:\s+!\[[^\]]*]\([^)]+\))*$/,replace:(e,t,n)=>{const[r]=n,i=[...r.matchAll(/!\[([^\]]*)]\(([^)]+)\)/g)].map(([a,l,c])=>({alt:l,src:c})),s=T1(i);s&&pf([s])},export:e=>{if(!(e instanceof vr))return null;const n=e.images;return n.length?n.map(({src:r,alt:o})=>``).join(" "):""}},HN=e=>N.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("g",null,N.createElement("path",{d:"M8.00008 8.66634C8.36827 8.66634 8.66675 8.36786 8.66675 7.99967C8.66675 7.63148 8.36827 7.33301 8.00008 7.33301C7.63189 7.33301 7.33341 7.63148 7.33341 7.99967C7.33341 8.36786 7.63189 8.66634 8.00008 8.66634Z",fill:"currentColor"}),N.createElement("path",{d:"M12.6667 8.66634C13.0349 8.66634 13.3334 8.36786 13.3334 7.99967C13.3334 7.63148 13.0349 7.33301 12.6667 7.33301C12.2986 7.33301 12.0001 7.63148 12.0001 7.99967C12.0001 8.36786 12.2986 8.66634 12.6667 8.66634Z",fill:"currentColor"}),N.createElement("path",{d:"M3.33341 8.66634C3.7016 8.66634 4.00008 8.36786 4.00008 7.99967C4.00008 7.63148 3.7016 7.33301 3.33341 7.33301C2.96522 7.33301 2.66675 7.63148 2.66675 7.99967C2.66675 8.36786 2.96522 8.66634 3.33341 8.66634Z",fill:"currentColor"}),N.createElement("path",{d:"M8.00008 8.66634C8.36827 8.66634 8.66675 8.36786 8.66675 7.99967C8.66675 7.63148 8.36827 7.33301 8.00008 7.33301C7.63189 7.33301 7.33341 7.63148 7.33341 7.99967C7.33341 8.36786 7.63189 8.66634 8.00008 8.66634Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),N.createElement("path",{d:"M12.6667 8.66634C13.0349 8.66634 13.3334 8.36786 13.3334 7.99967C13.3334 7.63148 13.0349 7.33301 12.6667 7.33301C12.2986 7.33301 12.0001 7.63148 12.0001 7.99967C12.0001 8.36786 12.2986 8.66634 12.6667 8.66634Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),N.createElement("path",{d:"M3.33341 8.66634C3.7016 8.66634 4.00008 8.36786 4.00008 7.99967C4.00008 7.63148 3.7016 7.33301 3.33341 7.33301C2.96522 7.33301 2.66675 7.63148 2.66675 7.99967C2.66675 8.36786 2.96522 8.66634 3.33341 8.66634Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),N.createElement("defs",null)),KN=z.css({cursor:"pointer"}),UN=z.css({":hover":{backgroundColor:"var(--fill-bg-secondary)"},":active":{backgroundColor:"var(--fill-bg-secondary)"}});function GN({groups:e,toolbarVisibleActionsCount:t,onAction:n,disabled:r}){const[o,i]=C.useState(!1),s=C.useCallback(c=>()=>{r||(c&&c(),i(!1))},[r]),a=C.useCallback(({IconComponent:c,...u},f)=>S.jsxs(q,{className:z.cx(KN,!r&&UN),p:"var(--spacing-sm)",alignItems:"center",flex:!0,row:!0,gap:"var(--spacing-xs)",onClick:s(()=>n(u.id,f)),children:[S.jsx(c,{width:20,height:20,color:"var(--icon-tertiary)"}),S.jsx(ce,{variant:"body-2",children:u.label})]},u.id),[r,n,s]),l=C.useMemo(()=>e.map((c,u)=>{const f=u===e.length-1;if(!c.length)return null;const d=c.map((h,g)=>{const m=(u?e.slice(0,u).flat().length:0)+g+t;return a(h,m)});return S.jsxs(C.Fragment,{children:[d,f?null:S.jsx(q,{w:"full",h:1,backgroundColor:"var(--border-neutral-alpha-basic)"})]},c.flatMap(h=>h.id).join("-"))}),[e,a,t]);return S.jsx(lr,{content:S.jsx(q,{flex:!0,children:l}),placement:"bottom",open:o,onChange:i,children:S.jsx(Kn,{size:"xs",color:"no-bg",disabled:r,children:S.jsx(HN,{})})})}const qN=z.css({minWidth:"fit-content"}),YN=e=>{throw new Error("defaultOnImagesUpload function must be overridden")};function dy({onSave:e}){const[t,n]=C.useState(""),[r,o]=C.useState(""),[i,s]=C.useState(null),a=ss(),{textPlaceholder:l,linkPlaceholder:c,linkErrorText:u,buttonText:f}=a.toolbar.link,d=C.useMemo(()=>i==="link"?u:null,[i,u]),h=C.useCallback(v=>{try{const x=new URL(v);if(!(x.protocol==="http:"||x.protocol==="https:"))throw new Error("Invalid protocol");return s(null),!0}catch{return s("link"),!1}},[]),g=C.useCallback(v=>{n(v.target.value)},[]),p=C.useCallback(v=>{h(v.target.value),o(v.target.value)},[h]),m=C.useCallback(()=>[()=>h(r)].map(b=>b()).every(Boolean),[r,h]),_=C.useCallback(()=>{n(""),o(""),s(null)},[]),y=C.useCallback(v=>{v.preventDefault(),m()&&(e({text:t||r,url:r}),_())},[r,e,t,m,_]);return C.useEffect(()=>()=>{_()},[]),S.jsx("form",{onSubmit:y,children:S.jsxs(q,{flex:!0,alignItems:"flex-start",p:"var(--spacing-sm)",gap:"var(--spacing-sm)",children:[S.jsx(q,{children:S.jsx(qo,{placeholder:l,size:"sm",value:t,onChange:g})}),S.jsx(q,{children:S.jsx(qo,{placeholder:c,size:"sm",value:r,onChange:p,error:!!d,errorText:d||""})}),S.jsx(Go,{size:"xs",width:"auto",type:"submit",children:f})]})})}const fy=50,hy=20,gy=1,py=1;function my({onSave:e}){const[t,n]=C.useState(""),[r,o]=C.useState(""),[i,s]=C.useState(null),[a,l]=C.useState(null),c=ss(),{maxRowsErrorText:u,maxColumnsErrorText:f,minRowsErrorText:d,minColumnsErrorText:h,rowsPlaceholder:g,columnsPlaceholder:p,buttonText:m}=c.toolbar.table,_=C.useMemo(()=>{switch(i){case"rows-max":return u({current:Number(t),limit:fy});case"rows-min":return d({current:Number(t),limit:gy});default:return null}},[i,t,u,d]),y=C.useMemo(()=>{switch(a){case"columns-max":return f({current:Number(r),limit:hy});case"columns-min":return h({current:Number(r),limit:py});default:return null}},[a,r,f,h]),v=C.useCallback(O=>{try{const D=Number(O);if(D>fy)throw s("rows-max"),new Error("Rows amount exceeds maximum");if(D<gy)throw s("rows-min"),new Error("Rows amount below minimum");return s(null),!0}catch{return!1}},[]),x=C.useCallback(O=>{try{const D=Number(O);if(D>hy)throw l("columns-max"),new Error("Columns amount exceeds maximum");if(D<py)throw l("columns-min"),new Error("Columns amount below minimum");return l(null),!0}catch{return!1}},[]),b=C.useCallback(O=>{const D=Number(O);return!Number.isNaN(D)&&Number.isInteger(D)?D:null},[]),w=C.useCallback(O=>{const D=O.target.value,I=b(D);typeof I=="number"&&(v(D),n(String(I)))},[v,b]),T=C.useCallback(O=>{const D=O.target.value,I=b(D);typeof I=="number"&&(x(D),o(String(I)))},[x,b]),E=C.useCallback(()=>[()=>v(t),()=>x(r)].map(I=>I()).every(Boolean),[r,t,x,v]),R=C.useCallback(()=>{n(""),o(""),s(null),l(null)},[]),M=C.useCallback(O=>{O.preventDefault(),E()&&(e({rows:t,columns:r}),R())},[r,e,t,E,R]);return C.useEffect(()=>()=>{R()},[]),S.jsx("form",{onSubmit:M,children:S.jsxs(q,{flex:!0,alignItems:"flex-start",p:"var(--spacing-sm)",gap:"var(--spacing-sm)",children:[S.jsx(q,{children:S.jsx(qo,{placeholder:g,size:"sm",value:t,onChange:w,error:!!_,errorText:_||""})}),S.jsx(q,{children:S.jsx(qo,{placeholder:p,size:"sm",value:r,onChange:T,error:!!y,errorText:y||""})}),S.jsx(Go,{size:"xs",width:"auto",type:"submit",children:m})]})})}function XN({disabled:e=!1}){const[t,n]=C.useState(null),[r]=nt(),o=ss(),i=C.useMemo(()=>{const l=o.toolbar.textSize;return[{value:"paragraph",label:l.paragraph,textProps:{variant:"body-2"}},{value:"h1",label:l.h1,textProps:{fontWeight:"semibold",variant:"headline-1"}},{value:"h2",label:l.h2,textProps:{fontWeight:"semibold",variant:"headline-2"}},{value:"h3",label:l.h3,textProps:{fontWeight:"semibold",variant:"headline-3"}}]},[o.toolbar.textSize]),s=C.useCallback(l=>{!l||Array.isArray(l)||r.update(()=>{const c=G();if(!W(c))return;const u=c.anchor.getNode().getTopLevelElement();if(!u)return;const f=l==="paragraph"?me():Vr(l);u.getChildren().forEach(d=>{f.append(d)}),u.replace(f),f.selectEnd()})},[r]),a=C.useCallback(()=>{const l=G();if(!W(l))return null;const c=l.anchor.getNode().getTopLevelElement();return Ux(c)?c.getTag():"paragraph"},[]);return C.useEffect(()=>{const l=r.registerUpdateListener(({editorState:c})=>{c.read(()=>{const u=a();u&&n(u)})});return()=>{l()}},[r,a]),S.jsx(ch,{size:"xs",items:i,renderDropdownItem:l=>S.jsx(ce,{whiteSpace:"nowrap",...l.textProps,children:l.label}),returnedValue:l=>l.value,renderSingleInputItem:l=>l.label,onChange:s,disabled:e,value:t,showDefaultItem:!1})}function JN({onImagesUpload:e=YN}){const[t,n]=C.useState(11),[r,o]=C.useState(null),[i,s]=C.useState(null),a=C.useRef(null),{toolbar:l}=ss(),c=l.preview,[u]=nt(),{isEditable:f,isPreviewMode:d,setPreviewMode:h}=tf(),{availableActionGroups:g}=V3(),p=C.useRef(null),m=C.useMemo(()=>!f||d,[f,d]),_=C.useMemo(()=>d?c.hide:c.show,[d,c]),{toolbarGroups:y,menuGroups:v}=C.useMemo(()=>{const L=[],B=[];let K=0;for(const P of g){const A=[],$=[];for(const H of P)K+=1,K<=t?A.push(H):$.push(H);A.length&&L.push(A),$.length&&B.push($)}return{toolbarGroups:L,menuGroups:B}},[g,t]),x=C.useMemo(()=>typeof r=="number"&&r>t-1,[r,t]),b=C.useMemo(()=>typeof i=="number"&&i>t-1,[i,t]),w=C.useCallback(L=>{const{text:B,url:K}=L;u.update(()=>{const P=G();if(W(P)){const A=E1({text:B,url:K});P.insertNodes([A]);const $=Pe(" ");A.insertAfter($),$.select()}}),o(null)},[u]),T=C.useCallback(L=>{const{rows:B,columns:K}=L;u.dispatchCommand(h1,{rows:B,columns:K}),s(null)},[u]),E=C.useCallback(()=>{p.current&&p.current.click()},[]),R=C.useCallback(async L=>{try{const B=Array.from(L.target.files||[]);if(!B.length)return;const K=await e(B);u.update(()=>{const P=T1(K);P&&pf([P])})}catch(B){console.error("Error uploading images:",B)}finally{L.target.value=""}},[u,e]),M=C.useCallback((L,B)=>{({[oe.BOLD]:()=>{u.dispatchCommand(Rt,"bold")},[oe.ITALIC]:()=>{u.dispatchCommand(Rt,"italic")},[oe.UNDERLINE]:()=>{u.dispatchCommand(Rt,"underline")},[oe.STRIKETHROUGH]:()=>{u.dispatchCommand(Rt,"strikethrough")},[oe.ALIGN_LEFT]:()=>{u.dispatchCommand($o,"left")},[oe.ALIGN_CENTER]:()=>{u.dispatchCommand($o,"center")},[oe.ALIGN_RIGHT]:()=>{u.dispatchCommand($o,"right")},[oe.LINK]:()=>{o(B)},[oe.IMAGE]:()=>{E()},[oe.TABLE]:()=>{s(B)},[oe.BULLET_LIST]:()=>{u.dispatchCommand(Ix,void 0)},[oe.NUMBERED_LIST]:()=>{u.dispatchCommand($x,void 0)}})[L]()},[E,u]),O=C.useMemo(()=>y.map((L,B)=>{const K=y.slice(0,B).reduce(($,H)=>$+H.length,0);if(!L.length)return null;const P=L.map(({IconComponent:$,isActive:H,id:Q},J)=>{const X=K+J,se=H?"neutral":"no-bg";return Q===oe.LINK?S.jsx(lr,{content:S.jsx(dy,{onSave:w}),placement:"bottom",open:r===X,onChange:re=>{o(re?X:null)},children:S.jsx(Kn,{size:"xs",color:"no-bg",disabled:m,children:S.jsx($,{})})},Q):Q===oe.TABLE?S.jsx(lr,{content:S.jsx(my,{onSave:T}),placement:"bottom",open:i===X,onChange:re=>{s(re?X:null)},children:S.jsx(Kn,{size:"xs",color:se,disabled:m,children:S.jsx($,{})})},Q):S.jsx(Kn,{size:"xs",color:se,onClick:()=>M(Q,X),disabled:m,children:S.jsx($,{})},Q)});return P.every($=>!$)?null:S.jsxs(C.Fragment,{children:[P,S.jsx(q,{w:1,h:32,backgroundColor:"var(--border-neutral-alpha-basic)"})]},L.flatMap($=>$.id).join("-"))}),[y,M,r,m,i,w,T]),D=C.useCallback(()=>{const L=a.current;if(!L)return;const B=L.clientWidth,K=40,P=4,A=1,$=P+A+P+K+P;let H=B-$,Q=0;for(const J of g)if(J.length){for(const X of J){const se=K+P;if(H-se>=0)H-=se,Q+=1;else break}H-=A+P}n(Q)},[g]),I=C.useMemo(()=>MN(D,20,{}),[D]);return C.useEffect(()=>{if(!a.current)return;const L=new ResizeObserver(()=>{I()});return L.observe(a.current),()=>L.disconnect()},[I]),S.jsxs(q,{backgroundColor:"var(--fill-neutral-primary)",border:"1px solid var(--border-neutral-alpha-basic)",borderRadius:"var(--corner-md)",flex:!0,row:!0,alignItems:"center",justifyContent:"space-between",p:"var(--spacing-sm)",children:[S.jsxs(q,{flex:!0,flexGrow:1,row:!0,alignItems:"center",overflow:"hidden",children:[S.jsx("input",{ref:p,type:"file",accept:"image/*",hidden:!0,multiple:!0,onChange:R,disabled:m}),S.jsx(XN,{disabled:m}),S.jsx(lr,{content:S.jsx(dy,{onSave:w}),placement:"bottom",open:x,onChange:L=>{L||o(null)},children:S.jsx("div",{})}),S.jsx(lr,{content:S.jsx(my,{onSave:T}),placement:"bottom",open:b,onChange:L=>{L||s(null)},children:S.jsx("div",{})}),S.jsxs(q,{flex:!0,row:!0,alignItems:"center",gap:"var(--spacing-xs)",w:"full",ml:"var(--spacing-xs)",overflow:"hidden",ref:a,children:[O,v.length?S.jsx(GN,{disabled:m,onAction:M,groups:v,toolbarVisibleActionsCount:t}):null]})]}),S.jsx(Go,{width:"auto",size:"xs",color:d?"accent":"neutral",intensity:"secondary",wrapperClassName:qN,onClick:()=>{h(L=>!L)},iconLeft:S.jsx(NN,{color:d?"var(--icon-accent)":"var(--icon-secondary)"}),children:_})]})}const k1=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?C.useLayoutEffect:C.useEffect;function ZN({editor:e,ariaActiveDescendant:t,ariaAutoComplete:n,ariaControls:r,ariaDescribedBy:o,ariaErrorMessage:i,ariaExpanded:s,ariaInvalid:a,ariaLabel:l,ariaLabelledBy:c,ariaMultiline:u,ariaOwns:f,ariaRequired:d,autoCapitalize:h,className:g,id:p,role:m="textbox",spellCheck:_=!0,style:y,tabIndex:v,"data-testid":x,...b},w){const[T,E]=C.useState(e.isEditable()),R=C.useCallback(O=>{O&&O.ownerDocument&&O.ownerDocument.defaultView?e.setRootElement(O):e.setRootElement(null)},[e]),M=C.useMemo(()=>(function(...O){return D=>{for(const I of O)typeof I=="function"?I(D):I!=null&&(I.current=D)}})(w,R),[R,w]);return k1(()=>(E(e.isEditable()),e.registerEditableListener(O=>{E(O)})),[e]),S.jsx("div",{"aria-activedescendant":T?t:void 0,"aria-autocomplete":T?n:"none","aria-controls":T?r:void 0,"aria-describedby":o,...i!=null?{"aria-errormessage":i}:{},"aria-expanded":T&&m==="combobox"?!!s:void 0,...a!=null?{"aria-invalid":a}:{},"aria-label":l,"aria-labelledby":c,"aria-multiline":u,"aria-owns":T?f:void 0,"aria-readonly":!T||void 0,"aria-required":d,autoCapitalize:h,className:g,contentEditable:T,"data-testid":x,id:p,ref:M,role:m,spellCheck:_,style:y,tabIndex:v,...b})}const QN=C.forwardRef(ZN);function yy(e){return e.getEditorState().read(l1(e.isComposing()))}const e6=C.forwardRef(t6);function t6(e,t){const{placeholder:n,...r}=e,[o]=nt();return S.jsxs(S.Fragment,{children:[S.jsx(QN,{editor:o,...r,ref:t}),n!=null&&S.jsx(n6,{editor:o,content:n})]})}function n6({content:e,editor:t}){const n=(function(s){const[a,l]=C.useState(()=>yy(s));return k1(()=>{function c(){const u=yy(s);l(u)}return c(),ln(s.registerUpdateListener(()=>{c()}),s.registerEditableListener(()=>{c()}))},[s]),a})(t),[r,o]=C.useState(t.isEditable());if(C.useLayoutEffect(()=>(o(t.isEditable()),t.registerEditableListener(s=>{o(s)})),[t]),!n)return null;let i=null;return typeof e=="function"?i=e(r):e!==null&&(i=e),i===null?null:S.jsx("div",{"aria-hidden":!0,children:i})}const r6=C.createContext(null),Fc={didCatch:!1,error:null};class o6 extends C.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Fc}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(...t){const{error:n}=this.state;n!==null&&(this.props.onReset?.({args:t,reason:"imperative-api"}),this.setState(Fc))}componentDidCatch(t,n){this.props.onError?.(t,n)}componentDidUpdate(t,n){const{didCatch:r}=this.state,{resetKeys:o}=this.props;r&&n.error!==null&&i6(t.resetKeys,o)&&(this.props.onReset?.({next:o,prev:t.resetKeys,reason:"keys"}),this.setState(Fc))}render(){const{children:t,fallbackRender:n,FallbackComponent:r,fallback:o}=this.props,{didCatch:i,error:s}=this.state;let a=t;if(i){const l={error:s,resetErrorBoundary:this.resetErrorBoundary};if(typeof n=="function")a=n(l);else if(r)a=C.createElement(r,l);else if(o!==void 0)a=o;else throw s}return C.createElement(r6.Provider,{value:{didCatch:i,error:s,resetErrorBoundary:this.resetErrorBoundary}},a)}}function i6(e=[],t=[]){return e.length!==t.length||e.some((n,r)=>!Object.is(n,t[r]))}function s6({children:e,onError:t}){return S.jsx(o6,{fallback:S.jsx("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:t,children:e})}const a6=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?C.useLayoutEffect:C.useEffect;function l6(e){return{initialValueFn:()=>e.isEditable(),subscribe:t=>e.registerEditableListener(t)}}function c6(){return(function(e){const[t]=nt(),n=C.useMemo(()=>e(t),[t,e]),[r,o]=C.useState(()=>n.initialValueFn()),i=C.useRef(r);return a6(()=>{const{initialValueFn:s,subscribe:a}=n,l=s();return i.current!==l&&(i.current=l,o(l)),a(c=>{i.current=c,o(c)})},[n,e]),r})(l6)}const u6={name:"@lexical/react/ReactProvider"};function d6(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const qf=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?C.useLayoutEffect:C.useEffect;function f6({editor:e,ErrorBoundary:t}){return(function(n,r){const[o,i]=C.useState(()=>n.getDecorators());return qf(()=>n.registerDecoratorListener(s=>{zi.flushSync(()=>{i(s)})}),[n]),C.useEffect(()=>{i(n.getDecorators())},[n]),C.useMemo(()=>{const s=[],a=Object.keys(o);for(let l=0;l<a.length;l++){const c=a[l],u=S.jsx(r,{onError:d=>n._onError(d),children:S.jsx(C.Suspense,{fallback:null,children:o[c]})}),f=n.getElementByKey(c);f!==null&&s.push(zi.createPortal(u,f,c))}return s},[r,o,n])})(e,t)}function h6({editor:e,ErrorBoundary:t}){return(function(n){const r=X3.maybeFromEditor(n);if(r&&r.hasExtensionByName(u6.name)){for(const o of["@lexical/plain-text","@lexical/rich-text"])r.hasExtensionByName(o)&&d6(320,o);return!0}return!1})(e)?null:S.jsx(f6,{editor:e,ErrorBoundary:t})}function vy(e){return e.getEditorState().read(l1(e.isComposing()))}function g6({contentEditable:e,placeholder:t=null,ErrorBoundary:n}){const[r]=nt();return(function(o){qf(()=>ln(TA(o),vA(o)),[o])})(r),S.jsxs(S.Fragment,{children:[e,S.jsx(p6,{content:t}),S.jsx(h6,{editor:r,ErrorBoundary:n})]})}function p6({content:e}){const[t]=nt(),n=(function(o){const[i,s]=C.useState(()=>vy(o));return qf(()=>{function a(){const l=vy(o);s(l)}return a(),ln(o.registerUpdateListener(()=>{a()}),o.registerEditableListener(()=>{a()}))},[o]),i})(t),r=c6();return n?typeof e=="function"?e(r):e:null}const m6=z.css({width:"100%"}),y6=z.css({pointerEvents:"none"});function v6(e){const{placeholder:t}=e||{},n=C.useRef(null),{alignment:r}=wx(),o=C.useCallback(s=>{if(!t)return null;const a=typeof t=="string"||typeof t=="object"&&t.hasWrapper,l=typeof t=="string"?t:t.renderContent(s);return a?S.jsx(ce,{variant:"body-2",colorName:"tertiary",children:l}):S.jsx(S.Fragment,{children:l})},[t]),i=C.useCallback(s=>{const a=o(s);if(!a)return null;const l={left:"flex-start",center:"center",right:"flex-end"};return S.jsx(q,{absolute:!0,w:"full",top:0,left:0,alignItems:l[r],className:y6,children:a})},[o,r]);return S.jsx(q,{relative:!0,row:!0,w:"full",flexGrow:1,children:S.jsx(g6,{contentEditable:S.jsx(e6,{ref:n,className:m6,"aria-placeholder":"markdown editor",placeholder:i}),ErrorBoundary:s6})})}const _6=z.css({counterReset:"line"}),x6=z.css({display:"grid",gridTemplateColumns:"3ch 1fr",columnGap:"var(--spacing-sm)",whiteSpace:"pre-wrap",":before":{counterIncrement:"line",content:"counter(line)",color:"var(--text-accent)",userSelect:"none",textAlign:"right"}});function b6(){const{markdownText:e}=tf(),t=e.split(`
|
|
40
|
+
`);return S.jsx("pre",{className:_6,children:t.map((n,r)=>S.jsx(ce,{tag:"span",className:x6,children:n||" "},r))})}const C6="_text_1q22k_8",w6="_paragraph_1q22k_12",S6="_h1_1q22k_17",E6="_h2_1q22k_22",T6="_h3_1q22k_27",R6="_h4_1q22k_32",xo={text:C6,paragraph:w6,h1:S6,h2:E6,h3:T6,h4:R6},k6=z.css({borderSpacing:"0",borderCollapse:"separate"}),A6=z.css({border:"1px solid var(--border-neutral-primary)",padding:"var(--spacing-sm) var(--spacing-sm)"}),M6=z.css({color:"var(--text-accent)"}),N6=z.css({fontWeight:"bold"}),P6=z.css({textDecoration:"underline"}),F6=z.css({textDecoration:"line-through"}),L6=z.css({textDecoration:"underline line-through"}),O6=z.css({fontStyle:"italic"}),I6=z.css({color:"var(--text-accent)",textDecoration:"underline"}),$6={table:k6,tableCell:A6,hashtag:M6,link:I6,text:{base:xo.text,bold:N6,underline:P6,strikethrough:F6,underlineStrikethrough:L6,italic:O6},heading:{h1:xo.h1,h2:xo.h2,h3:xo.h3,h4:xo.h4},paragraph:xo.paragraph};function D6(){return{namespace:"ui-kit-markdown-text-editor",nodes:[lo,Gt,uo,Er,un,cn,yr,vr,ro,gl,fl,dl,hl,ps,ms],onError(e){throw e},theme:$6}}const V6=[[oe.BOLD,oe.ITALIC,oe.UNDERLINE,oe.STRIKETHROUGH],[oe.LINK,oe.IMAGE],[oe.ALIGN_LEFT,oe.ALIGN_CENTER,oe.ALIGN_RIGHT],[oe.TABLE],[oe.BULLET_LIST,oe.NUMBERED_LIST]];function j6(){const[e]=nt(),{isEditable:t}=tf();return C.useEffect(()=>{e.setEditable(t)},[e,t]),null}function B6(){const[e]=nt();return C.useEffect(()=>{const t=e.registerCommand(Qa,()=>{const n=G();if(!W(n)||!n.isCollapsed()||n.anchor.offset!==0)return!1;const o=n.anchor.getNode().getTopLevelElement();if(!o||o.getType()!=="paragraph"||o.getTextContent()!=="")return!1;const i=o.getPreviousSibling();return R1(i)?(i.remove(),o.select(),!0):!1},Et);return()=>{t()}},[e]),null}const z6=/^\|(.+)\|$/,W6=/^\|\s*:?-+:?\s*(\|\s*:?-+:?\s*)+\|$/,H6=/^\|(.+)\|$/,K6={type:"multiline-element",dependencies:[un,yr,cn],regExpStart:z6,handleImportAfterStartMatch({lines:e,rootNode:t,startLineIndex:n}){const r=e[n+1];if(!W6.test(r??""))return null;const o=ml();let i=n;for(;i<e.length&&H6.test(e[i]);){if(i===n+1){i++;continue}const s=Zo(),a=e[i].slice(1,-1).split("|").map(c=>c.trim()),l=i===n;a.forEach(c=>{const u=Kt(l?et.ROW:void 0);u.append(Pe(c)),s.append(u)}),o.append(s),i++}return t.append(o),[!0,i-1]},replace(){return!0},export(e){if(!(e instanceof un))return null;const n=e.getChildren();if(!n.length)return"";const r=[];return n.forEach((o,i)=>{if(!(o instanceof yr))return;const a=o.getChildren().map(l=>l instanceof cn?l.getTextContent().replace(/\n/g," ").trim():"");r.push(`| ${a.join(" | ")} |`),i||r.push(`| ${a.map(()=>"---").join(" | ")} |`)}),r.join(`
|
|
41
|
+
`)}},ad=[K6,WN,$N,...ys];function U6({defaultValue:e}){const[t]=nt();return C.useEffect(()=>{t.update(()=>{e&&_M(e,ad)})},[t]),null}function G6({label:e,plugins:t,field:n,disabled:r=!1,locale:o,toolbar:i,defaultMarkdown:s,events:a={}}){const[l,c]=C.useState(""),[u,f]=C.useState(!1),{availableActions:d,onImagesUpload:h}=i||{},g=C.useMemo(()=>D6(),[]),p=C.useMemo(()=>({isEditable:!r,isPreviewMode:u,setPreviewMode:f,markdownText:l}),[r,u,l]),m=C.useMemo(()=>({availableActions:d||V6}),[d]),_=C.useCallback(v=>{c(v),a.onMarkdownChange&&a.onMarkdownChange(v)},[a]),y=C.useCallback(v=>{v.read(()=>{const x=xM(ad);_(x),a.onEditorStateChange&&a.onEditorStateChange(v)})},[_,a]);return S.jsx(HR,{locale:o,children:S.jsx(wM,{initialConfig:g,children:S.jsx(V0.Provider,{value:p,children:S.jsxs(j0.Provider,{value:m,children:[S.jsxs(q,{flex:!0,w:"full",borderRadius:"var(--corner-lg)",p:"var(--spacing-lg)",gap:"var(--spacing-sm)",backgroundColor:"var(--fill-neutral-secondary)",children:[e?S.jsx(ce,{variant:"headline-3",fontWeight:"semibold",children:e}):null,S.jsx(JN,{onImagesUpload:h}),S.jsx(q,{backgroundColor:"var(--fill-neutral-primary)",border:"1px solid var(--border-neutral-alpha-basic)",borderRadius:"var(--corner-md)",p:"var(--spacing-md) var(--spacing-lg)",w:"full",h:144,overflow:"auto",children:u?S.jsx(b6,{}):S.jsx(v6,{...n})})]}),S.jsx(bM,{}),S.jsx(FM,{}),S.jsx(yN,{}),S.jsx(PM,{}),S.jsx(DM,{transformers:ad}),S.jsx(jM,{onChange:y}),S.jsx(j6,{}),S.jsx(U6,{defaultValue:s}),S.jsx(B6,{}),t]})})})})}const q6="_input_5xq63_8",Y6="_disabled_5xq63_29",X6="_error_5xq63_37",J6="_success_5xq63_41",Z6="_white_5xq63_50",Q6="_gray_5xq63_54",eP="_glow_5xq63_58",bo={input:q6,disabled:Y6,error:X6,success:J6,white:Z6,gray:Q6,glow:eP};function tP(e){const t=C.useRef(void 0);return C.useEffect(()=>{t.current=e},[e]),t.current}const A1=C.forwardRef(({length:e=6,label:t,prompt:n,error:r,errorText:o,success:i,disabled:s,autoFocus:a,center:l,secure:c,loading:u,background:f="gray",numeric:d=!0,className:h,value:g,defaultValue:p,onChange:m,onComplete:_},y)=>{const v=typeof g=="string",x=v?g:p,b=typeof x=="string"?x.slice(0,e):"",[w,T]=so(v?g:void 0,b),[E,R]=C.useState(()=>{const P=b.slice(0,e);return Array.from({length:e},(A,$)=>P[$]??"")}),M=C.useRef(void 0),O=tP(g),D=C.useRef([]);C.useEffect(()=>{if(!v)return;const P=g??"";if(P===O)return;if(P===M.current){M.current=void 0;return}const A=P.slice(0,e);R(Array.from({length:e},($,H)=>A[H]??""))},[v,g,e,O]);const I=C.useCallback((P,A)=>{const $=P.slice(0,e);A?.fromInternal&&(M.current=$),T($),m?.($),$.length===e&&_?.($)},[e,m,_,T]);C.useImperativeHandle(y,()=>({focus:()=>{D.current[0]?.focus()},blur:()=>{D.current.forEach(P=>P?.blur())},get value(){return w||""},setValue:P=>{const A=P.slice(0,e);R(Array.from({length:e},($,H)=>A[H]??"")),I(A,{fromInternal:!0})},clear:()=>{R(Array.from({length:e},()=>"")),I("",{fromInternal:!0})}}),[e,I,w]);const L=C.useCallback((P,A)=>{if(s)return;let $=A;if(d&&($=$.replace(/\D/g,"")),$.length>1){const X=E.slice(0,P).join("")+$+E.slice(P+1).join(""),se=Array.from({length:e},(we,te)=>X[te]??"");R(se),I(X,{fromInternal:!0});const re=Math.min(P+$.length,e-1),he=D.current[re];he?.focus(),he?.select();return}const H=E[P],Q=[...E];Q[P]=$,R(Q);const J=Q.join("");if(I(J,{fromInternal:!0}),!H&&$&&P<e-1){const X=D.current[P+1];X?.focus(),X?.select()}},[E,s,e,d,I]),B=C.useCallback((P,A)=>{if(!s){if(A.key==="Backspace"){A.preventDefault();const $=D.current[P];if(E[P]){const H=[...E];H[P]="",R(H),I(H.join(""),{fromInternal:!0}),$?.focus();return}if(P>0){const H=D.current[P-1];H?.focus(),H?.select()}return}A.key==="ArrowLeft"&&P>0&&(A.preventDefault(),D.current[P-1]?.focus()),A.key==="ArrowRight"&&P<e-1&&(A.preventDefault(),D.current[P+1]?.focus())}},[E,s,e,I]),K=C.useCallback((P,A)=>{if(s)return;A.preventDefault();let $=A.clipboardData.getData("text");if(d&&($=$.replace(/\D/g,"")),!$)return;const H=e-P,Q=Math.min($.length,H),J=$.slice(0,Q),X=[...E];for(let we=0;we<Q;we++)X[P+we]=J[we]??"";R(X);const se=X.join("");I(se,{fromInternal:!0});const re=Math.min(P+Q-1,e-1),he=D.current[re];he?.focus(),he?.select()},[E,s,e,d,I]);return S.jsxs(q,{w:"full",gap:"var(--spacing-sm)",className:h,center:l,children:[t&&S.jsx(ce,{variant:"body-2",fontWeight:"regular",colorName:"tertiary",children:t}),S.jsx(q,{row:!0,w:"full",gap:"var(--spacing-sm)",center:l,className:z.cx({[bo.disabled]:s}),children:Array.from({length:e}).map((P,A)=>S.jsxs(q,{relative:!0,display:"inline-block",children:[S.jsx("input",{ref:$=>{D.current[A]=$},className:z.cx(bo.input,bo[f],r&&bo.error,i&&bo.success,E[A]&&z.css({caretColor:"transparent"})),inputMode:d?"numeric":"text",type:c?"password":"text",maxLength:1,autoFocus:a&&A===0,disabled:s||u,value:E[A],onChange:$=>L(A,$.target.value),onKeyDown:$=>B(A,$),onPaste:$=>K(A,$)}),S.jsx(Ya.span,{className:bo.glow,variants:nP,custom:A,initial:"idle",animate:u?"wave":"idle"})]},A))}),n&&S.jsx(ce,{variant:"caption-1",colorName:"tertiary",children:n}),o&&r&&S.jsx(ce,{variant:"body-2",colorName:"negative",fontWeight:"regular",children:o})]})}),nP={idle:{opacity:0,scale:1,transition:{duration:.18}},wave:(e=0)=>({opacity:[0,.2,0],scale:[1,1.03,1],transition:{duration:1.5,delay:e*.15,repeat:1/0,ease:[.42,0,.58,1]}})};A1.displayName="OtpInput";const M1=C.createContext(null),rP=()=>C.useContext(M1),oP="_radio_zru2j_8",iP="_disabled_zru2j_16",sP="_side_right_zru2j_21",Si={radio:oP,disabled:iP,side_right:sP,"read-only":"_read-only_zru2j_26"},_y={sm:{inner:12,outer:20},md:{inner:16,outer:24}},N1=C.forwardRef(({value:e,children:t,checked:n,defaultChecked:r,onChange:o,disabled:i,className:s,description:a,size:l,side:c,readOnly:u,error:f},d)=>{const h=rP(),g=!!h,p=n!==void 0,[m,_]=so(n,r),y=g?h.value===e:p?n:m,v=h?.disabled||i,x=l??h?.size??"md",b=c??h?.side??"left",w=u??h?.readOnly??!1,T=f??h?.error??!1,E=_y[x].outer,R=_y[x].inner,M=()=>{v||w||(g?h.setValue?.(e):(p||_(!y),o?.(!y)))},O=y&&T?"var(--fill-negative-tint)":y?"var(--fill-accent-tint)":"var(--fill-bg-secondary)",D=y&&T?"var(--fill-negative-primary)":y?"var(--fill-accent-primary)":void 0,I=y&&T||T&&!y?"var(--border-negative-secondary)":"var(--border-neutral-alpha-low)";return S.jsxs("button",{ref:d,role:"radio",type:"button","data-value":e,"aria-checked":y,"aria-disabled":v||void 0,tabIndex:y?0:-1,className:z.cx([Si.radio,y&&Si.checked,v&&Si.disabled,b==="right"&&Si.side_right,w&&Si["read-only"],s]),onClick:M,children:[S.jsx(q,{w:E,h:E,backgroundColor:O,borderWidth:y?0:1,borderColor:I,borderStyle:"solid",center:!0,borderRadius:"var(--corner-full-round)",children:S.jsx(q,{w:R,h:R,backgroundColor:D,borderRadius:"var(--corner-full-round)","aria-hidden":!0})}),S.jsxs(q,{alignItems:"flex-start",children:[S.jsx(ce,{variant:x==="sm"?"body-2":"body-1",tag:"span",left:!0,children:t}),a&&S.jsx(ce,{tag:"span",variant:"body-2",colorName:"secondary",children:a})]})]})});N1.displayName="Radio";const P1=C.forwardRef(({label:e,value:t,defaultValue:n,onChange:r,children:o,className:i,error:s=!1,disabled:a=!1,readOnly:l=!1,side:c="left",size:u="md"},f)=>{const[d,h]=so(t,n),g=t!==void 0,p=g?t:d,m=C.useCallback(y=>{g||h(y),r?.(y)},[g,r,h]),_=C.useRef(null);return C.useImperativeHandle(f,()=>_.current),S.jsx(M1.Provider,{value:{value:p,readOnly:l,disabled:a,setValue:m,size:u,side:c,error:s},children:S.jsxs(q,{gap:"var(--spacing-sm)",ref:_,role:"radiogroup","aria-invalid":s||void 0,className:i,children:[typeof e=="string"?S.jsx(ce,{colorName:"secondary",children:e}):e,S.jsx(q,{gap:"var(--spacing-lg)",children:o})]})})});P1.displayName="RadioGroup";const aP="_primary_svt6d_8",lP="_secondary_svt6d_13",cP="_button_svt6d_18",er={primary:aP,secondary:lP,button:cP,"button-active":"_button-active_svt6d_32","icon-container":"_icon-container_svt6d_35","button-primary":"_button-primary_svt6d_47","button-secondary":"_button-secondary_svt6d_51","button-disabled":"_button-disabled_svt6d_55","full-width":"_full-width_svt6d_60"};function uP({value:e,onChange:t,options:n,variant:r="primary",fullWidth:o=!1,className:i}){return S.jsx(q,{row:!0,alignItems:"center",borderRadius:"var(--corner-md)",p:"var(--spacing-xs)",gap:"var(--spacing-md)",className:z.cx(er[r],o&&er["full-width"],i),children:n.map(s=>{const a=s.value===e,l=s.disabled,c=s.separatorAfter??!1;return S.jsxs(C.Fragment,{children:[S.jsxs("button",{type:"button",disabled:l,className:z.cx(er.button,o&&er["full-width"],a&&er["button-active"],a&&er[`button-${r}`],l&&er["button-disabled"]),onClick:()=>!l&&t(s.value),children:[s.icon&&S.jsx(q,{alignItems:"center",justifyContent:"center",className:er["icon-container"],children:s.icon}),s.label&&S.jsx(ce,{colorName:a?"primary":"tertiary",children:s.label}),!l&&S.jsx(io,{color:"var(--fill-bg-overlay-primary)"})]}),c&&S.jsx(q,{w:1,h:24,backgroundColor:"var(--fill-bg-tertiary)"})]},s.value)})})}function yl(){return typeof window<"u"}function di(e){return F1(e)?(e.nodeName||"").toLowerCase():"#document"}function Nt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Mn(e){var t;return(t=(F1(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function F1(e){return yl()?e instanceof Node||e instanceof Nt(e).Node:!1}function De(e){return yl()?e instanceof Element||e instanceof Nt(e).Element:!1}function wt(e){return yl()?e instanceof HTMLElement||e instanceof Nt(e).HTMLElement:!1}function ld(e){return!yl()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Nt(e).ShadowRoot}const dP=new Set(["inline","contents"]);function vs(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Ut(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!dP.has(o)}const fP=new Set(["table","td","th"]);function hP(e){return fP.has(di(e))}const gP=[":popover-open",":modal"];function vl(e){return gP.some(t=>{try{return e.matches(t)}catch{return!1}})}const pP=["transform","translate","scale","rotate","perspective"],mP=["transform","translate","scale","rotate","perspective","filter"],yP=["paint","layout","strict","content"];function Yf(e){const t=_l(),n=De(e)?Ut(e):e;return pP.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||mP.some(r=>(n.willChange||"").includes(r))||yP.some(r=>(n.contain||"").includes(r))}function vP(e){let t=Jn(e);for(;wt(t)&&!Un(t);){if(Yf(t))return t;if(vl(t))return null;t=Jn(t)}return null}function _l(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const _P=new Set(["html","body","#document"]);function Un(e){return _P.has(di(e))}function Ut(e){return Nt(e).getComputedStyle(e)}function xl(e){return De(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Jn(e){if(di(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ld(e)&&e.host||Mn(e);return ld(t)?t.host:t}function L1(e){const t=Jn(e);return Un(t)?e.ownerDocument?e.ownerDocument.body:e.body:wt(t)&&vs(t)?t:L1(t)}function ur(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=L1(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=Nt(o);if(i){const a=cd(s);return t.concat(s,s.visualViewport||[],vs(o)?o:[],a&&n?ur(a):[])}return t.concat(o,ur(o,[],n))}function cd(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const _r=Math.min,Ot=Math.max,Ba=Math.round,Ks=Math.floor,kn=e=>({x:e,y:e}),xP={left:"right",right:"left",bottom:"top",top:"bottom"},bP={start:"end",end:"start"};function ud(e,t,n){return Ot(e,_r(t,n))}function fi(e,t){return typeof e=="function"?e(t):e}function xr(e){return e.split("-")[0]}function hi(e){return e.split("-")[1]}function O1(e){return e==="x"?"y":"x"}function Xf(e){return e==="y"?"height":"width"}const CP=new Set(["top","bottom"]);function Hn(e){return CP.has(xr(e))?"y":"x"}function Jf(e){return O1(Hn(e))}function wP(e,t,n){n===void 0&&(n=!1);const r=hi(e),o=Jf(e),i=Xf(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=za(s)),[s,za(s)]}function SP(e){const t=za(e);return[dd(e),t,dd(t)]}function dd(e){return e.replace(/start|end/g,t=>bP[t])}const xy=["left","right"],by=["right","left"],EP=["top","bottom"],TP=["bottom","top"];function RP(e,t,n){switch(e){case"top":case"bottom":return n?t?by:xy:t?xy:by;case"left":case"right":return t?EP:TP;default:return[]}}function kP(e,t,n,r){const o=hi(e);let i=RP(xr(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(dd)))),i}function za(e){return e.replace(/left|right|bottom|top/g,t=>xP[t])}function AP(e){return{top:0,right:0,bottom:0,left:0,...e}}function I1(e){return typeof e!="number"?AP(e):{top:e,right:e,bottom:e,left:e}}function Wa(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function MP(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function NP(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function PP(){return/apple/i.test(navigator.vendor)}function FP(){return MP().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function LP(){return NP().includes("jsdom/")}const Cy="data-floating-ui-focusable",OP="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function wy(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function es(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&ld(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Ro(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Lc(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function IP(e){return e.matches("html,body")}function jr(e){return e?.ownerDocument||document}function $1(e){return wt(e)&&e.matches(OP)}function $P(e){if(!e||LP())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function DP(e){return e?e.hasAttribute(Cy)?e:e.querySelector("["+Cy+"]")||e:null}function la(e,t,n){return n===void 0&&(n=!0),e.filter(o=>{var i;return o.parentId===t&&(!n||((i=o.context)==null?void 0:i.open))}).flatMap(o=>[o,...la(e,o.id,n)])}function VP(e){return"nativeEvent"in e}function ts(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var jP=typeof document<"u",BP=function(){},Qo=jP?C.useLayoutEffect:BP;const zP={...N};function Us(e){const t=N.useRef(e);return Qo(()=>{t.current=e}),t}const WP=zP.useInsertionEffect,HP=WP||(e=>e());function vn(e){const t=N.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return HP(()=>{t.current=e}),N.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function Sy(e,t,n){let{reference:r,floating:o}=e;const i=Hn(t),s=Jf(t),a=Xf(s),l=xr(t),c=i==="y",u=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[a]/2-o[a]/2;let h;switch(l){case"top":h={x:u,y:r.y-o.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-o.width,y:f};break;default:h={x:r.x,y:r.y}}switch(hi(t)){case"start":h[s]-=d*(n&&c?-1:1);break;case"end":h[s]+=d*(n&&c?-1:1);break}return h}const KP=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=Sy(c,r,l),d=r,h={},g=0;for(let p=0;p<a.length;p++){const{name:m,fn:_}=a[p],{x:y,y:v,data:x,reset:b}=await _({x:u,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:h,rects:c,platform:s,elements:{reference:e,floating:t}});u=y??u,f=v??f,h={...h,[m]:{...h[m],...x}},b&&g<=50&&(g++,typeof b=="object"&&(b.placement&&(d=b.placement),b.rects&&(c=b.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):b.rects),{x:u,y:f}=Sy(c,d,l)),p=-1)}return{x:u,y:f,placement:d,strategy:o,middlewareData:h}};async function Zf(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:d=!1,padding:h=0}=fi(t,e),g=I1(h),m=a[d?f==="floating"?"reference":"floating":f],_=Wa(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(m)))==null||n?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),y=f==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,v=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),x=await(i.isElement==null?void 0:i.isElement(v))?await(i.getScale==null?void 0:i.getScale(v))||{x:1,y:1}:{x:1,y:1},b=Wa(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:v,strategy:l}):y);return{top:(_.top-b.top+g.top)/x.y,bottom:(b.bottom-_.bottom+g.bottom)/x.y,left:(_.left-b.left+g.left)/x.x,right:(b.right-_.right+g.right)/x.x}}const UP=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=fi(e,t)||{};if(c==null)return{};const f=I1(u),d={x:n,y:r},h=Jf(o),g=Xf(h),p=await s.getDimensions(c),m=h==="y",_=m?"top":"left",y=m?"bottom":"right",v=m?"clientHeight":"clientWidth",x=i.reference[g]+i.reference[h]-d[h]-i.floating[g],b=d[h]-i.reference[h],w=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let T=w?w[v]:0;(!T||!await(s.isElement==null?void 0:s.isElement(w)))&&(T=a.floating[v]||i.floating[g]);const E=x/2-b/2,R=T/2-p[g]/2-1,M=_r(f[_],R),O=_r(f[y],R),D=M,I=T-p[g]-O,L=T/2-p[g]/2+E,B=ud(D,L,I),K=!l.arrow&&hi(o)!=null&&L!==B&&i.reference[g]/2-(L<D?M:O)-p[g]/2<0,P=K?L<D?L-D:L-I:0;return{[h]:d[h]+P,data:{[h]:B,centerOffset:L-B-P,...K&&{alignmentOffset:P}},reset:K}}}),GP=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:p=!0,...m}=fi(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const _=xr(o),y=Hn(a),v=xr(a)===a,x=await(l.isRTL==null?void 0:l.isRTL(c.floating)),b=d||(v||!p?[za(a)]:SP(a)),w=g!=="none";!d&&w&&b.push(...kP(a,p,g,x));const T=[a,...b],E=await Zf(t,m),R=[];let M=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&R.push(E[_]),f){const L=wP(o,s,x);R.push(E[L[0]],E[L[1]])}if(M=[...M,{placement:o,overflows:R}],!R.every(L=>L<=0)){var O,D;const L=(((O=i.flip)==null?void 0:O.index)||0)+1,B=T[L];if(B&&(!(f==="alignment"?y!==Hn(B):!1)||M.every(A=>Hn(A.placement)===y?A.overflows[0]>0:!0)))return{data:{index:L,overflows:M},reset:{placement:B}};let K=(D=M.filter(P=>P.overflows[0]<=0).sort((P,A)=>P.overflows[1]-A.overflows[1])[0])==null?void 0:D.placement;if(!K)switch(h){case"bestFit":{var I;const P=(I=M.filter(A=>{if(w){const $=Hn(A.placement);return $===y||$==="y"}return!0}).map(A=>[A.placement,A.overflows.filter($=>$>0).reduce(($,H)=>$+H,0)]).sort((A,$)=>A[1]-$[1])[0])==null?void 0:I[0];P&&(K=P);break}case"initialPlacement":K=a;break}if(o!==K)return{reset:{placement:K}}}return{}}}},qP=new Set(["left","top"]);async function YP(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=xr(n),a=hi(n),l=Hn(n)==="y",c=qP.has(s)?-1:1,u=i&&l?-1:1,f=fi(t,e);let{mainAxis:d,crossAxis:h,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof g=="number"&&(h=a==="end"?g*-1:g),l?{x:h*u,y:d*c}:{x:d*c,y:h*u}}const XP=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await YP(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},JP=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:m=>{let{x:_,y}=m;return{x:_,y}}},...l}=fi(e,t),c={x:n,y:r},u=await Zf(t,l),f=Hn(xr(o)),d=O1(f);let h=c[d],g=c[f];if(i){const m=d==="y"?"top":"left",_=d==="y"?"bottom":"right",y=h+u[m],v=h-u[_];h=ud(y,h,v)}if(s){const m=f==="y"?"top":"left",_=f==="y"?"bottom":"right",y=g+u[m],v=g-u[_];g=ud(y,g,v)}const p=a.fn({...t,[d]:h,[f]:g});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[d]:i,[f]:s}}}}}},ZP=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=fi(e,t),u=await Zf(t,c),f=xr(o),d=hi(o),h=Hn(o)==="y",{width:g,height:p}=i.floating;let m,_;f==="top"||f==="bottom"?(m=f,_=d===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(_=f,m=d==="end"?"top":"bottom");const y=p-u.top-u.bottom,v=g-u.left-u.right,x=_r(p-u[m],y),b=_r(g-u[_],v),w=!t.middlewareData.shift;let T=x,E=b;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(E=v),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=y),w&&!d){const M=Ot(u.left,0),O=Ot(u.right,0),D=Ot(u.top,0),I=Ot(u.bottom,0);h?E=g-2*(M!==0||O!==0?M+O:Ot(u.left,u.right)):T=p-2*(D!==0||I!==0?D+I:Ot(u.top,u.bottom))}await l({...t,availableWidth:E,availableHeight:T});const R=await s.getDimensions(a.floating);return g!==R.width||p!==R.height?{reset:{rects:!0}}:{}}}};function D1(e){const t=Ut(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=wt(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Ba(n)!==i||Ba(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function Qf(e){return De(e)?e:e.contextElement}function Ho(e){const t=Qf(e);if(!wt(t))return kn(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=D1(t);let s=(i?Ba(n.width):n.width)/r,a=(i?Ba(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const QP=kn(0);function V1(e){const t=Nt(e);return!_l()||!t.visualViewport?QP:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function eF(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Nt(e)?!1:t}function oo(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Qf(e);let s=kn(1);t&&(r?De(r)&&(s=Ho(r)):s=Ho(e));const a=eF(i,n,r)?V1(i):kn(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,f=o.height/s.y;if(i){const d=Nt(i),h=r&&De(r)?Nt(r):r;let g=d,p=cd(g);for(;p&&r&&h!==g;){const m=Ho(p),_=p.getBoundingClientRect(),y=Ut(p),v=_.left+(p.clientLeft+parseFloat(y.paddingLeft))*m.x,x=_.top+(p.clientTop+parseFloat(y.paddingTop))*m.y;l*=m.x,c*=m.y,u*=m.x,f*=m.y,l+=v,c+=x,g=Nt(p),p=cd(g)}}return Wa({width:u,height:f,x:l,y:c})}function bl(e,t){const n=xl(e).scrollLeft;return t?t.left+n:oo(Mn(e)).left+n}function j1(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-bl(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function tF(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=Mn(r),a=t?vl(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=kn(1);const u=kn(0),f=wt(r);if((f||!f&&!i)&&((di(r)!=="body"||vs(s))&&(l=xl(r)),wt(r))){const h=oo(r);c=Ho(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}const d=s&&!f&&!i?j1(s,l):kn(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 nF(e){return Array.from(e.getClientRects())}function rF(e){const t=Mn(e),n=xl(e),r=e.ownerDocument.body,o=Ot(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Ot(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+bl(e);const a=-n.scrollTop;return Ut(r).direction==="rtl"&&(s+=Ot(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}const Ey=25;function oF(e,t){const n=Nt(e),r=Mn(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const u=_l();(!u||u&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const c=bl(r);if(c<=0){const u=r.ownerDocument,f=u.body,d=getComputedStyle(f),h=u.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,g=Math.abs(r.clientWidth-f.clientWidth-h);g<=Ey&&(i-=g)}else c<=Ey&&(i+=c);return{width:i,height:s,x:a,y:l}}const iF=new Set(["absolute","fixed"]);function sF(e,t){const n=oo(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=wt(e)?Ho(e):kn(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:s,height:a,x:l,y:c}}function Ty(e,t,n){let r;if(t==="viewport")r=oF(e,n);else if(t==="document")r=rF(Mn(e));else if(De(t))r=sF(t,n);else{const o=V1(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Wa(r)}function B1(e,t){const n=Jn(e);return n===t||!De(n)||Un(n)?!1:Ut(n).position==="fixed"||B1(n,t)}function aF(e,t){const n=t.get(e);if(n)return n;let r=ur(e,[],!1).filter(a=>De(a)&&di(a)!=="body"),o=null;const i=Ut(e).position==="fixed";let s=i?Jn(e):e;for(;De(s)&&!Un(s);){const a=Ut(s),l=Yf(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&iF.has(o.position)||vs(s)&&!l&&B1(e,s))?r=r.filter(u=>u!==s):o=a,s=Jn(s)}return t.set(e,r),r}function lF(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?vl(t)?[]:aF(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const f=Ty(t,u,o);return c.top=Ot(f.top,c.top),c.right=_r(f.right,c.right),c.bottom=_r(f.bottom,c.bottom),c.left=Ot(f.left,c.left),c},Ty(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function cF(e){const{width:t,height:n}=D1(e);return{width:t,height:n}}function uF(e,t,n){const r=wt(t),o=Mn(t),i=n==="fixed",s=oo(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=kn(0);function c(){l.x=bl(o)}if(r||!r&&!i)if((di(t)!=="body"||vs(o))&&(a=xl(t)),r){const h=oo(t,!0,i,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else o&&c();i&&!r&&o&&c();const u=o&&!r&&!i?j1(o,a):kn(0),f=s.left+a.scrollLeft-l.x-u.x,d=s.top+a.scrollTop-l.y-u.y;return{x:f,y:d,width:s.width,height:s.height}}function Oc(e){return Ut(e).position==="static"}function Ry(e,t){if(!wt(e)||Ut(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Mn(e)===n&&(n=n.ownerDocument.body),n}function z1(e,t){const n=Nt(e);if(vl(e))return n;if(!wt(e)){let o=Jn(e);for(;o&&!Un(o);){if(De(o)&&!Oc(o))return o;o=Jn(o)}return n}let r=Ry(e,t);for(;r&&hP(r)&&Oc(r);)r=Ry(r,t);return r&&Un(r)&&Oc(r)&&!Yf(r)?n:r||vP(e)||n}const dF=async function(e){const t=this.getOffsetParent||z1,n=this.getDimensions,r=await n(e.floating);return{reference:uF(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function fF(e){return Ut(e).direction==="rtl"}const hF={convertOffsetParentRelativeRectToViewportRelativeRect:tF,getDocumentElement:Mn,getClippingRect:lF,getOffsetParent:z1,getElementRects:dF,getClientRects:nF,getDimensions:cF,getScale:Ho,isElement:De,isRTL:fF};function W1(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function gF(e,t){let n=null,r;const o=Mn(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const c=e.getBoundingClientRect(),{left:u,top:f,width:d,height:h}=c;if(a||t(),!d||!h)return;const g=Ks(f),p=Ks(o.clientWidth-(u+d)),m=Ks(o.clientHeight-(f+h)),_=Ks(u),v={rootMargin:-g+"px "+-p+"px "+-m+"px "+-_+"px",threshold:Ot(0,_r(1,l))||1};let x=!0;function b(w){const T=w[0].intersectionRatio;if(T!==l){if(!x)return s();T?s(!1,T):r=setTimeout(()=>{s(!1,1e-7)},1e3)}T===1&&!W1(c,e.getBoundingClientRect())&&s(),x=!1}try{n=new IntersectionObserver(b,{...v,root:o.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return s(!0),i}function eh(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Qf(e),u=o||i?[...c?ur(c):[],...ur(t)]:[];u.forEach(_=>{o&&_.addEventListener("scroll",n,{passive:!0}),i&&_.addEventListener("resize",n)});const f=c&&a?gF(c,n):null;let d=-1,h=null;s&&(h=new ResizeObserver(_=>{let[y]=_;y&&y.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var v;(v=h)==null||v.observe(t)})),n()}),c&&!l&&h.observe(c),h.observe(t));let g,p=l?oo(e):null;l&&m();function m(){const _=oo(e);p&&!W1(p,_)&&n(),p=_,g=requestAnimationFrame(m)}return n(),()=>{var _;u.forEach(y=>{o&&y.removeEventListener("scroll",n),i&&y.removeEventListener("resize",n)}),f?.(),(_=h)==null||_.disconnect(),h=null,l&&cancelAnimationFrame(g)}}const pF=XP,mF=JP,yF=GP,vF=ZP,ky=UP,_F=(e,t,n)=>{const r=new Map,o={platform:hF,...n},i={...o.platform,_c:r};return KP(e,t,{...o,platform:i})};var xF=typeof document<"u",bF=function(){},ca=xF?C.useLayoutEffect:bF;function Ha(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Ha(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!Ha(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function H1(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ay(e,t){const n=H1(e);return Math.round(t*n)/n}function Ic(e){const t=N.useRef(e);return ca(()=>{t.current=e}),t}function CF(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,f]=N.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,h]=N.useState(r);Ha(d,r)||h(r);const[g,p]=N.useState(null),[m,_]=N.useState(null),y=N.useCallback(A=>{A!==w.current&&(w.current=A,p(A))},[]),v=N.useCallback(A=>{A!==T.current&&(T.current=A,_(A))},[]),x=i||g,b=s||m,w=N.useRef(null),T=N.useRef(null),E=N.useRef(u),R=l!=null,M=Ic(l),O=Ic(o),D=Ic(c),I=N.useCallback(()=>{if(!w.current||!T.current)return;const A={placement:t,strategy:n,middleware:d};O.current&&(A.platform=O.current),_F(w.current,T.current,A).then($=>{const H={...$,isPositioned:D.current!==!1};L.current&&!Ha(E.current,H)&&(E.current=H,PC.flushSync(()=>{f(H)}))})},[d,t,n,O,D]);ca(()=>{c===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,f(A=>({...A,isPositioned:!1})))},[c]);const L=N.useRef(!1);ca(()=>(L.current=!0,()=>{L.current=!1}),[]),ca(()=>{if(x&&(w.current=x),b&&(T.current=b),x&&b){if(M.current)return M.current(x,b,I);I()}},[x,b,I,M,R]);const B=N.useMemo(()=>({reference:w,floating:T,setReference:y,setFloating:v}),[y,v]),K=N.useMemo(()=>({reference:x,floating:b}),[x,b]),P=N.useMemo(()=>{const A={position:n,left:0,top:0};if(!K.floating)return A;const $=Ay(K.floating,u.x),H=Ay(K.floating,u.y);return a?{...A,transform:"translate("+$+"px, "+H+"px)",...H1(K.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:$,top:H}},[n,a,K.floating,u.x,u.y]);return N.useMemo(()=>({...u,update:I,refs:B,elements:K,floatingStyles:P}),[u,I,B,K,P])}const wF=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?ky({element:r.current,padding:o}).fn(n):{}:r?ky({element:r,padding:o}).fn(n):{}}}},th=(e,t)=>({...pF(e),options:[e,t]}),nh=(e,t)=>({...mF(e),options:[e,t]}),rh=(e,t)=>({...yF(e),options:[e,t]}),SF=(e,t)=>({...vF(e),options:[e,t]}),EF=(e,t)=>({...wF(e),options:[e,t]});function K1(e){const t=N.useRef(void 0),n=N.useCallback(r=>{const o=e.map(i=>{if(i!=null){if(typeof i=="function"){const s=i,a=s(r);return typeof a=="function"?a:()=>{s(null)}}return i.current=r,()=>{i.current=null}}});return()=>{o.forEach(i=>i?.())}},e);return N.useMemo(()=>e.every(r=>r==null)?null:r=>{t.current&&(t.current(),t.current=void 0),r!=null&&(t.current=n(r))},e)}const TF="data-floating-ui-focusable",My="active",Ny="selected",RF={...N};let Py=!1,kF=0;const Fy=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+kF++;function AF(){const[e,t]=N.useState(()=>Py?Fy():void 0);return Qo(()=>{e==null&&t(Fy())},[]),N.useEffect(()=>{Py=!0},[]),e}const MF=RF.useId,U1=MF||AF;let fd;process.env.NODE_ENV!=="production"&&(fd=new Set);function NF(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=fd)!=null&&e.has(o))){var i;(i=fd)==null||i.add(o),console.error(o)}}function PF(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}const FF=N.createContext(null),LF=N.createContext(null),oh=()=>{var e;return((e=N.useContext(FF))==null?void 0:e.id)||null},ih=()=>N.useContext(LF);function sh(e){return"data-floating-ui-"+e}function jt(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const Ly=sh("safe-polygon");function $c(e,t,n){if(n&&!ts(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const r=e();return typeof r=="number"?r:r?.[t]}return e?.[t]}function Dc(e){return typeof e=="function"?e():e}function G1(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,elements:s}=e,{enabled:a=!0,delay:l=0,handleClose:c=null,mouseOnly:u=!1,restMs:f=0,move:d=!0}=t,h=ih(),g=oh(),p=Us(c),m=Us(l),_=Us(n),y=Us(f),v=N.useRef(),x=N.useRef(-1),b=N.useRef(),w=N.useRef(-1),T=N.useRef(!0),E=N.useRef(!1),R=N.useRef(()=>{}),M=N.useRef(!1),O=vn(()=>{var P;const A=(P=o.current.openEvent)==null?void 0:P.type;return A?.includes("mouse")&&A!=="mousedown"});N.useEffect(()=>{if(!a)return;function P(A){let{open:$}=A;$||(jt(x),jt(w),T.current=!0,M.current=!1)}return i.on("openchange",P),()=>{i.off("openchange",P)}},[a,i]),N.useEffect(()=>{if(!a||!p.current||!n)return;function P($){O()&&r(!1,$,"hover")}const A=jr(s.floating).documentElement;return A.addEventListener("mouseleave",P),()=>{A.removeEventListener("mouseleave",P)}},[s.floating,n,r,a,p,O]);const D=N.useCallback(function(P,A,$){A===void 0&&(A=!0),$===void 0&&($="hover");const H=$c(m.current,"close",v.current);H&&!b.current?(jt(x),x.current=window.setTimeout(()=>r(!1,P,$),H)):A&&(jt(x),r(!1,P,$))},[m,r]),I=vn(()=>{R.current(),b.current=void 0}),L=vn(()=>{if(E.current){const P=jr(s.floating).body;P.style.pointerEvents="",P.removeAttribute(Ly),E.current=!1}}),B=vn(()=>o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1);N.useEffect(()=>{if(!a)return;function P(J){if(jt(x),T.current=!1,u&&!ts(v.current)||Dc(y.current)>0&&!$c(m.current,"open"))return;const X=$c(m.current,"open",v.current);X?x.current=window.setTimeout(()=>{_.current||r(!0,J,"hover")},X):n||r(!0,J,"hover")}function A(J){if(B()){L();return}R.current();const X=jr(s.floating);if(jt(w),M.current=!1,p.current&&o.current.floatingContext){n||jt(x),b.current=p.current({...o.current.floatingContext,tree:h,x:J.clientX,y:J.clientY,onClose(){L(),I(),B()||D(J,!0,"safe-polygon")}});const re=b.current;X.addEventListener("mousemove",re),R.current=()=>{X.removeEventListener("mousemove",re)};return}(v.current!=="touch"||!es(s.floating,J.relatedTarget))&&D(J)}function $(J){B()||o.current.floatingContext&&(p.current==null||p.current({...o.current.floatingContext,tree:h,x:J.clientX,y:J.clientY,onClose(){L(),I(),B()||D(J)}})(J))}function H(){jt(x)}function Q(J){B()||D(J,!1)}if(De(s.domReference)){const J=s.domReference,X=s.floating;return n&&J.addEventListener("mouseleave",$),d&&J.addEventListener("mousemove",P,{once:!0}),J.addEventListener("mouseenter",P),J.addEventListener("mouseleave",A),X&&(X.addEventListener("mouseleave",$),X.addEventListener("mouseenter",H),X.addEventListener("mouseleave",Q)),()=>{n&&J.removeEventListener("mouseleave",$),d&&J.removeEventListener("mousemove",P),J.removeEventListener("mouseenter",P),J.removeEventListener("mouseleave",A),X&&(X.removeEventListener("mouseleave",$),X.removeEventListener("mouseenter",H),X.removeEventListener("mouseleave",Q))}}},[s,a,e,u,d,D,I,L,r,n,_,h,m,p,o,B,y]),Qo(()=>{var P;if(a&&n&&(P=p.current)!=null&&(P=P.__options)!=null&&P.blockPointerEvents&&O()){E.current=!0;const $=s.floating;if(De(s.domReference)&&$){var A;const H=jr(s.floating).body;H.setAttribute(Ly,"");const Q=s.domReference,J=h==null||(A=h.nodesRef.current.find(X=>X.id===g))==null||(A=A.context)==null?void 0:A.elements.floating;return J&&(J.style.pointerEvents=""),H.style.pointerEvents="none",Q.style.pointerEvents="auto",$.style.pointerEvents="auto",()=>{H.style.pointerEvents="",Q.style.pointerEvents="",$.style.pointerEvents=""}}}},[a,n,g,s,h,p,O]),Qo(()=>{n||(v.current=void 0,M.current=!1,I(),L())},[n,I,L]),N.useEffect(()=>()=>{I(),jt(x),jt(w),L()},[a,s.domReference,I,L]);const K=N.useMemo(()=>{function P(A){v.current=A.pointerType}return{onPointerDown:P,onPointerEnter:P,onMouseMove(A){const{nativeEvent:$}=A;function H(){!T.current&&!_.current&&r(!0,$,"hover")}u&&!ts(v.current)||n||Dc(y.current)===0||M.current&&A.movementX**2+A.movementY**2<2||(jt(w),v.current==="touch"?H():(M.current=!0,w.current=window.setTimeout(H,Dc(y.current))))}}},[u,r,n,_,y]);return N.useMemo(()=>a?{reference:K}:{},[a,K])}function Oy(e){return wt(e.target)&&e.target.tagName==="BUTTON"}function OF(e){return wt(e.target)&&e.target.tagName==="A"}function Iy(e){return $1(e)}function IF(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:i}}=e,{enabled:s=!0,event:a="click",toggle:l=!0,ignoreMouse:c=!1,keyboardHandlers:u=!0,stickIfOpen:f=!0}=t,d=N.useRef(),h=N.useRef(!1),g=N.useMemo(()=>({onPointerDown(p){d.current=p.pointerType},onMouseDown(p){const m=d.current;p.button===0&&a!=="click"&&(ts(m,!0)&&c||(n&&l&&(!(o.current.openEvent&&f)||o.current.openEvent.type==="mousedown")?r(!1,p.nativeEvent,"click"):(p.preventDefault(),r(!0,p.nativeEvent,"click"))))},onClick(p){const m=d.current;if(a==="mousedown"&&d.current){d.current=void 0;return}ts(m,!0)&&c||(n&&l&&(!(o.current.openEvent&&f)||o.current.openEvent.type==="click")?r(!1,p.nativeEvent,"click"):r(!0,p.nativeEvent,"click"))},onKeyDown(p){d.current=void 0,!(p.defaultPrevented||!u||Oy(p))&&(p.key===" "&&!Iy(i)&&(p.preventDefault(),h.current=!0),!OF(p)&&p.key==="Enter"&&r(!(n&&l),p.nativeEvent,"click"))},onKeyUp(p){p.defaultPrevented||!u||Oy(p)||Iy(i)||p.key===" "&&h.current&&(h.current=!1,r(!(n&&l),p.nativeEvent,"click"))}}),[o,i,a,c,u,r,n,f,l]);return N.useMemo(()=>s?{reference:g}:{},[s,g])}const $F={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},DF={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},$y=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e?.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e?.outsidePress)!=null?n:!0}};function q1(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:i}=e,{enabled:s=!0,escapeKey:a=!0,outsidePress:l=!0,outsidePressEvent:c="pointerdown",referencePress:u=!1,referencePressEvent:f="pointerdown",ancestorScroll:d=!1,bubbles:h,capture:g}=t,p=ih(),m=vn(typeof l=="function"?l:()=>!1),_=typeof l=="function"?m:l,y=N.useRef(!1),{escapeKey:v,outsidePress:x}=$y(h),{escapeKey:b,outsidePress:w}=$y(g),T=N.useRef(!1),E=vn(L=>{var B;if(!n||!s||!a||L.key!=="Escape"||T.current)return;const K=(B=i.current.floatingContext)==null?void 0:B.nodeId,P=p?la(p.nodesRef.current,K):[];if(!v&&(L.stopPropagation(),P.length>0)){let A=!0;if(P.forEach($=>{var H;if((H=$.context)!=null&&H.open&&!$.context.dataRef.current.__escapeKeyBubbles){A=!1;return}}),!A)return}r(!1,VP(L)?L.nativeEvent:L,"escape-key")}),R=vn(L=>{var B;const K=()=>{var P;E(L),(P=Ro(L))==null||P.removeEventListener("keydown",K)};(B=Ro(L))==null||B.addEventListener("keydown",K)}),M=vn(L=>{var B;const K=i.current.insideReactTree;i.current.insideReactTree=!1;const P=y.current;if(y.current=!1,c==="click"&&P||K||typeof _=="function"&&!_(L))return;const A=Ro(L),$="["+sh("inert")+"]",H=jr(o.floating).querySelectorAll($);let Q=De(A)?A:null;for(;Q&&!Un(Q);){const re=Jn(Q);if(Un(re)||!De(re))break;Q=re}if(H.length&&De(A)&&!IP(A)&&!es(A,o.floating)&&Array.from(H).every(re=>!es(Q,re)))return;if(wt(A)&&I){const re=Un(A),he=Ut(A),we=/auto|scroll/,te=re||we.test(he.overflowX),ye=re||we.test(he.overflowY),Se=te&&A.clientWidth>0&&A.scrollWidth>A.clientWidth,$e=ye&&A.clientHeight>0&&A.scrollHeight>A.clientHeight,ee=he.direction==="rtl",pe=$e&&(ee?L.offsetX<=A.offsetWidth-A.clientWidth:L.offsetX>A.clientWidth),Ne=Se&&L.offsetY>A.clientHeight;if(pe||Ne)return}const J=(B=i.current.floatingContext)==null?void 0:B.nodeId,X=p&&la(p.nodesRef.current,J).some(re=>{var he;return Lc(L,(he=re.context)==null?void 0:he.elements.floating)});if(Lc(L,o.floating)||Lc(L,o.domReference)||X)return;const se=p?la(p.nodesRef.current,J):[];if(se.length>0){let re=!0;if(se.forEach(he=>{var we;if((we=he.context)!=null&&we.open&&!he.context.dataRef.current.__outsidePressBubbles){re=!1;return}}),!re)return}r(!1,L,"outside-press")}),O=vn(L=>{var B;const K=()=>{var P;M(L),(P=Ro(L))==null||P.removeEventListener(c,K)};(B=Ro(L))==null||B.addEventListener(c,K)});N.useEffect(()=>{if(!n||!s)return;i.current.__escapeKeyBubbles=v,i.current.__outsidePressBubbles=x;let L=-1;function B(H){r(!1,H,"ancestor-scroll")}function K(){window.clearTimeout(L),T.current=!0}function P(){L=window.setTimeout(()=>{T.current=!1},_l()?5:0)}const A=jr(o.floating);a&&(A.addEventListener("keydown",b?R:E,b),A.addEventListener("compositionstart",K),A.addEventListener("compositionend",P)),_&&A.addEventListener(c,w?O:M,w);let $=[];return d&&(De(o.domReference)&&($=ur(o.domReference)),De(o.floating)&&($=$.concat(ur(o.floating))),!De(o.reference)&&o.reference&&o.reference.contextElement&&($=$.concat(ur(o.reference.contextElement)))),$=$.filter(H=>{var Q;return H!==((Q=A.defaultView)==null?void 0:Q.visualViewport)}),$.forEach(H=>{H.addEventListener("scroll",B,{passive:!0})}),()=>{a&&(A.removeEventListener("keydown",b?R:E,b),A.removeEventListener("compositionstart",K),A.removeEventListener("compositionend",P)),_&&A.removeEventListener(c,w?O:M,w),$.forEach(H=>{H.removeEventListener("scroll",B)}),window.clearTimeout(L)}},[i,o,a,_,c,n,r,d,s,v,x,E,b,R,M,w,O]),N.useEffect(()=>{i.current.insideReactTree=!1},[i,_,c]);const D=N.useMemo(()=>({onKeyDown:E,...u&&{[$F[f]]:L=>{r(!1,L.nativeEvent,"reference-press")},...f!=="click"&&{onClick(L){r(!1,L.nativeEvent,"reference-press")}}}}),[E,r,u,f]),I=N.useMemo(()=>({onKeyDown:E,onMouseDown(){y.current=!0},onMouseUp(){y.current=!0},[DF[c]]:()=>{i.current.insideReactTree=!0}}),[E,c,i]);return N.useMemo(()=>s?{reference:D,floating:I}:{},[s,D,I])}function VF(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=U1(),i=N.useRef({}),[s]=N.useState(()=>PF()),a=oh()!=null;if(process.env.NODE_ENV!=="production"){const h=r.reference;h&&!De(h)&&NF("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,c]=N.useState(r.reference),u=vn((h,g,p)=>{i.current.openEvent=h?g:void 0,s.emit("openchange",{open:h,event:g,reason:p,nested:a}),n?.(h,g,p)}),f=N.useMemo(()=>({setPositionReference:c}),[]),d=N.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return N.useMemo(()=>({dataRef:i,open:t,onOpenChange:u,elements:d,events:s,floatingId:o,refs:f}),[t,u,d,s,o,f])}function ah(e){e===void 0&&(e={});const{nodeId:t}=e,n=VF({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,s]=N.useState(null),[a,l]=N.useState(null),u=o?.domReference||i,f=N.useRef(null),d=ih();Qo(()=>{u&&(f.current=u)},[u]);const h=CF({...e,elements:{...o,...a&&{reference:a}}}),g=N.useCallback(v=>{const x=De(v)?{getBoundingClientRect:()=>v.getBoundingClientRect(),getClientRects:()=>v.getClientRects(),contextElement:v}:v;l(x),h.refs.setReference(x)},[h.refs]),p=N.useCallback(v=>{(De(v)||v===null)&&(f.current=v,s(v)),(De(h.refs.reference.current)||h.refs.reference.current===null||v!==null&&!De(v))&&h.refs.setReference(v)},[h.refs]),m=N.useMemo(()=>({...h.refs,setReference:p,setPositionReference:g,domReference:f}),[h.refs,p,g]),_=N.useMemo(()=>({...h.elements,domReference:u}),[h.elements,u]),y=N.useMemo(()=>({...h,...r,refs:m,elements:_,nodeId:t}),[h,m,_,t,r]);return Qo(()=>{r.dataRef.current.floatingContext=y;const v=d?.nodesRef.current.find(x=>x.id===t);v&&(v.context=y)}),N.useMemo(()=>({...h,context:y,refs:m,elements:_}),[h,m,_,y])}function Vc(){return FP()&&PP()}function jF(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:i,elements:s}=e,{enabled:a=!0,visibleOnly:l=!0}=t,c=N.useRef(!1),u=N.useRef(-1),f=N.useRef(!0);N.useEffect(()=>{if(!a)return;const h=Nt(s.domReference);function g(){!n&&wt(s.domReference)&&s.domReference===wy(jr(s.domReference))&&(c.current=!0)}function p(){f.current=!0}function m(){f.current=!1}return h.addEventListener("blur",g),Vc()&&(h.addEventListener("keydown",p,!0),h.addEventListener("pointerdown",m,!0)),()=>{h.removeEventListener("blur",g),Vc()&&(h.removeEventListener("keydown",p,!0),h.removeEventListener("pointerdown",m,!0))}},[s.domReference,n,a]),N.useEffect(()=>{if(!a)return;function h(g){let{reason:p}=g;(p==="reference-press"||p==="escape-key")&&(c.current=!0)}return o.on("openchange",h),()=>{o.off("openchange",h)}},[o,a]),N.useEffect(()=>()=>{jt(u)},[]);const d=N.useMemo(()=>({onMouseLeave(){c.current=!1},onFocus(h){if(c.current)return;const g=Ro(h.nativeEvent);if(l&&De(g)){if(Vc()&&!h.relatedTarget){if(!f.current&&!$1(g))return}else if(!$P(g))return}r(!0,h.nativeEvent,"focus")},onBlur(h){c.current=!1;const g=h.relatedTarget,p=h.nativeEvent,m=De(g)&&g.hasAttribute(sh("focus-guard"))&&g.getAttribute("data-type")==="outside";u.current=window.setTimeout(()=>{var _;const y=wy(s.domReference?s.domReference.ownerDocument:document);!g&&y===s.domReference||es((_=i.current.floatingContext)==null?void 0:_.refs.floating.current,y)||es(s.domReference,y)||m||r(!1,p,"focus")})}}),[i,s.domReference,r,l]);return N.useMemo(()=>a?{reference:d}:{},[a,d])}function jc(e,t,n){const r=new Map,o=n==="item";let i=e;if(o&&e){const{[My]:s,[Ny]:a,...l}=e;i=l}return{...n==="floating"&&{tabIndex:-1,[TF]:""},...i,...t.map(s=>{const a=s?s[n]:null;return typeof a=="function"?e?a(e):null:a}).concat(e).reduce((s,a)=>(a&&Object.entries(a).forEach(l=>{let[c,u]=l;if(!(o&&[My,Ny].includes(c)))if(c.indexOf("on")===0){if(r.has(c)||r.set(c,[]),typeof u=="function"){var f;(f=r.get(c))==null||f.push(u),s[c]=function(){for(var d,h=arguments.length,g=new Array(h),p=0;p<h;p++)g[p]=arguments[p];return(d=r.get(c))==null?void 0:d.map(m=>m(...g)).find(m=>m!==void 0)}}}else s[c]=u}),s),{})}}function Y1(e){e===void 0&&(e=[]);const t=e.map(a=>a?.reference),n=e.map(a=>a?.floating),r=e.map(a=>a?.item),o=N.useCallback(a=>jc(a,e,"reference"),t),i=N.useCallback(a=>jc(a,e,"floating"),n),s=N.useCallback(a=>jc(a,e,"item"),r);return N.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:s}),[o,i,s])}const BF=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function X1(e,t){var n,r;t===void 0&&(t={});const{open:o,elements:i,floatingId:s}=e,{enabled:a=!0,role:l="dialog"}=t,c=U1(),u=((n=i.domReference)==null?void 0:n.id)||c,f=N.useMemo(()=>{var y;return((y=DP(i.floating))==null?void 0:y.id)||s},[i.floating,s]),d=(r=BF.get(l))!=null?r:l,g=oh()!=null,p=N.useMemo(()=>d==="tooltip"||l==="label"?{["aria-"+(l==="label"?"labelledby":"describedby")]:o?f:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":d==="alertdialog"?"dialog":d,"aria-controls":o?f:void 0,...d==="listbox"&&{role:"combobox"},...d==="menu"&&{id:u},...d==="menu"&&g&&{role:"menuitem"},...l==="select"&&{"aria-autocomplete":"none"},...l==="combobox"&&{"aria-autocomplete":"list"}},[d,f,g,o,u,l]),m=N.useMemo(()=>{const y={id:f,...d&&{role:d}};return d==="tooltip"||l==="label"?y:{...y,...d==="menu"&&{"aria-labelledby":u}}},[d,f,u,l]),_=N.useCallback(y=>{let{active:v,selected:x}=y;const b={role:"option",...v&&{id:f+"-fui-option"}};switch(l){case"select":case"combobox":return{...b,"aria-selected":x}}return{}},[f,l]);return N.useMemo(()=>a?{reference:p,floating:m,item:_}:{},[a,p,m,_])}const zF=e=>N.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M6 9L12 15L18 9",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),WF=e=>N.createElement("svg",{fill:"currentColor",id:"Capa_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 462.035 462.035",xmlSpace:"preserve",...e},N.createElement("g",null,N.createElement("path",{d:"M457.83,158.441c-0.021-0.028-0.033-0.058-0.057-0.087l-50.184-62.48c-0.564-0.701-1.201-1.305-1.879-1.845 c-2.16-2.562-5.355-4.225-8.967-4.225H65.292c-3.615,0-6.804,1.661-8.965,4.225c-0.678,0.54-1.316,1.138-1.885,1.845l-50.178,62.48 c-0.023,0.029-0.034,0.059-0.057,0.087C1.655,160.602,0,163.787,0,167.39v193.07c0,6.5,5.27,11.771,11.77,11.771h438.496 c6.5,0,11.77-5.271,11.77-11.771V167.39C462.037,163.787,460.381,160.602,457.83,158.441z M408.516,134.615l16.873,21.005h-16.873 V134.615z M384.975,113.345v42.274H296.84c-2.514,0-4.955,0.805-6.979,2.293l-58.837,43.299l-58.849-43.305 c-2.023-1.482-4.466-2.287-6.978-2.287H77.061v-42.274H384.975z M53.523,155.62H36.65l16.873-21.005V155.62z M438.498,348.69H23.54 V179.16h137.796l62.711,46.148c4.15,3.046,9.805,3.052,13.954-0.005l62.698-46.144h137.799V348.69L438.498,348.69z"}))),J1=e=>N.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("g",{opacity:.6},N.createElement("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}))),Bc={sm:{h:28,p:"var(--spacing-xs) var(--spacing-sm)",text:"body-2"},md:{h:32,p:"6px var(--spacing-md)",text:"body-2"},lg:{h:40,p:"var(--spacing-sm) var(--spacing-lg)",text:"body-1"}},lh=C.forwardRef(({label:e,color:t="primary",size:n="md",onClick:r,onDelete:o,avatar:i,icon:s,disabled:a,className:l},c)=>{const u=C.useRef(null),f=C.useMemo(()=>{switch(t){case"primary":return{bg:"var(--status-neutral-tint-low)",color:"var(--text-primary)"};case"accent":return{bg:"var(--status-accent-tint-low)",color:"var(--text-accent)"};case"warning":return{bg:"var(--status-warning-tint-low)",color:"var(--text-warning)"};case"positive":return{bg:"var(--status-positive-tint-low)",color:"var(--text-positive)"};case"negative":return{bg:"var(--status-negative-tint-low)",color:"var(--text-negative)"};default:return{bg:"var(--status-neutral-tint-low)",color:"var(--text-primary)"}}},[t]),d=z.css({cursor:a?"not-allowed":r?"pointer":"default",opacity:a?.5:1,userSelect:"none",position:"relative",transition:"background-color 0.2s, opacity 0.2s","&:hover":a?void 0:{backgroundColor:f.bg}}),h=z.css({display:"inline-flex",cursor:"pointer",opacity:.6,"&:hover":{opacity:1}});return S.jsxs(q,{ref:g=>{u.current=g,typeof c=="function"?c(g):c&&(c.current=g)},row:!0,alignItems:"center",justifyContent:"center",gap:"var(--spacing-sm)",h:Bc[n].h,p:Bc[n].p,overflow:"hidden",borderRadius:"var(--corner-sm)",backgroundColor:f.bg,color:f.color,onClick:r,className:z.cx(d,l),children:[r&&S.jsx(io,{}),i&&S.jsx(q,{w:20,h:20,borderRadius:"50%",overflow:"hidden",children:i}),s&&S.jsx(q,{children:s}),typeof e=="string"?S.jsx(ce,{variant:Bc[n].text,colorName:t,textOverflow:"ellipsis",overflow:"hidden",children:e}):e,o&&!a&&S.jsx(ce,{className:h,colorName:t,onClick:g=>{g.stopPropagation(),o(g)},children:S.jsx(J1,{})})]})});lh.displayName="Tag";const HF="_disabled_ns6ei_45",KF="_open_ns6ei_53",UF="_error_ns6ei_56",GF="_hidden_ns6ei_92",qF="_visible_ns6ei_95",YF="_selected_ns6ei_168",rt={"select-container":"_select-container_ns6ei_8","full-width":"_full-width_ns6ei_13","select-input":"_select-input_ns6ei_17","size-xs":"_size-xs_ns6ei_24","size-sm":"_size-sm_ns6ei_29","size-md":"_size-md_ns6ei_34","background-primary":"_background-primary_ns6ei_39","background-secondary":"_background-secondary_ns6ei_42",disabled:HF,open:KF,"select-arrow":"_select-arrow_ns6ei_53",error:UF,"select-value":"_select-value_ns6ei_67","select-value_xs":"_select-value_xs_ns6ei_79","select-placeholder":"_select-placeholder_ns6ei_86",hidden:GF,visible:qF,"select-arrow_xs":"_select-arrow_xs_ns6ei_111","select-dropdown":"_select-dropdown_ns6ei_121","select-menu":"_select-menu_ns6ei_131","select-menu-item":"_select-menu-item_ns6ei_150","select-menu-item-first":"_select-menu-item-first_ns6ei_163",selected:YF,"overflow-tooltip-container":"_overflow-tooltip-container_ns6ei_172","overflow-tooltip-text":"_overflow-tooltip-text_ns6ei_177","empty-block":"_empty-block_ns6ei_184"};function ch({value:e,onChange:t,multiple:n=!1,returnedValue:r,renderItem:o,renderInputItem:i,renderSingleInputItem:s,renderMultipleInputItem:a,renderDropdownItem:l,placeholder:c,items:u=[],fullWidth:f,size:d="md",showDefaultItem:h,disabled:g,label:p,firstItem:m,lastItem:_,observer:y,emptyText:v,onBlur:x,prompt:b,error:w,errorText:T,dropdownMaxWidth:E=400,dropdownMinWidth:R=120,minWidth:M=120,width:O,background:D="secondary"}){const[I,L]=so(e,n?[]:null),[B,K]=C.useState(!1),{refs:P,floatingStyles:A}=ah({open:B,strategy:"fixed",middleware:[th(4),rh({crossAxis:!0,fallbackAxisSideDirection:"start"}),nh({crossAxis:!0,padding:8}),SF({apply({availableHeight:ee,availableWidth:pe,elements:Ne}){const Ze=Math.min(typeof pe=="number"?pe-64:E,E);Object.assign(Ne.floating.style,{maxHeight:typeof ee=="number"?`${ee}px`:"auto",maxWidth:`${Ze}px`,minWidth:`${R}px`})}})],whileElementsMounted:eh}),$=C.useMemo(()=>n?I||[]:I!=null?[I]:[],[I,n]),H=C.useCallback(ee=>r?r(ee):ee,[r]),Q=C.useMemo(()=>{const ee=new Map;return u.forEach(pe=>{ee.set(H(pe),pe)}),ee},[u,H]),J=!u.length&&!w,X=C.useMemo(()=>$.map(ee=>Q.get(ee)).filter(ee=>!!ee),[Q,$]);C.useEffect(()=>{process.env.NODE_ENV!=="production"&&o&&!l&&console.warn("[Select] `renderItem` deprecated, use `renderDropdownItem` instead.")},[l,o]);const se=C.useCallback((ee,pe)=>l?l(ee,pe):o?o(ee):String(ee),[l,o]),re=()=>{K(!1),x?.()},he=ee=>{const pe=H(ee);if(n){const Ne=$.includes(pe)?$.filter(Ze=>Ze!==pe):[...$,pe];L(Ne),t?.(Ne)}else L(pe),t?.(pe),re()},we=ee=>{if(!n)return;const pe=$.filter(Ne=>Ne!==ee);L(pe),t?.(pe)},te=()=>{const ee=n?[]:null;L(ee),t?.(ee),n||re()},ye=()=>typeof c=="string"?S.jsx(ce,{variant:d==="xs"?"caption-1":"body-2",textOverflow:"ellipsis",overflow:"hidden",colorName:"tertiary",children:c??"Select..."}):c,Se=()=>{if(!$.length)return ye();if(n)return a?a(X):i?i({mode:"multiple",selectedItems:X}):S.jsx(q,{flexWrap:"wrap",row:!0,gap:10,children:$.map(Ne=>{const Ze=Q.get(Ne);return Ze?S.jsx(lh,{size:"sm",label:o?o(Ze):String(Ne),onDelete:Le=>{Le.stopPropagation(),we(Ne)}},Ne):null})});const ee=Q.get($[0])??null;if(!ee)return ye();if(s)return s(ee);if(i)return i({mode:"single",selectedItem:ee});const pe=o?o(ee):String($[0]);return typeof pe=="string"?S.jsx(ce,{variant:d==="xs"?"caption-1":"body-2",tag:"p",textOverflow:"ellipsis",overflow:"hidden",children:pe}):S.jsx(S.Fragment,{children:pe})},$e=B&&S.jsx(_s,{children:S.jsx(q,{row:!0,top:0,right:0,bottom:0,left:0,position:"fixed",center:!0,flex:1,onClick:re,display:"block",backgroundColor:"transparent",zIndex:1,children:S.jsx(Ya.div,{ref:P.setFloating,className:rt["select-dropdown"],initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.25,ease:"easeInOut"},style:{...A,zIndex:1},onMouseDown:ee=>ee.stopPropagation(),onClick:ee=>ee.stopPropagation(),children:S.jsxs("ul",{className:rt["select-menu"],children:[h&&!n&&S.jsx(q,{className:rt["select-menu-item"],role:"option",onClick:te,children:S.jsx(ce,{variant:"body-2",colorName:"tertiary",children:c})}),m&&S.jsx(q,{className:z.cx(rt["select-menu-item"],rt["select-menu-item-first"]),children:m}),J&&S.jsxs(q,{className:rt["empty-block"],children:[S.jsx(q,{w:20,h:20,children:S.jsx(WF,{})}),S.jsx(ce,{variant:"body-2",children:v??"There is nothing yet"})]}),u.map((ee,pe)=>{const Ne=H(ee),Ze=$.includes(Ne),Le=se(ee,{item:ee,selected:Ze,index:pe}),Qn=typeof Le=="string";return S.jsxs(q,{row:!0,gap:10,alignItems:"center",className:z.cx(rt["select-menu-item"],{[rt.selected]:Ze}),role:"option",relative:!0,onClick:()=>he(ee),children:[n&&S.jsx(ef,{size:"sm",checked:Ze}),Qn?S.jsx(ce,{variant:"body-2",tag:"p",wordBreak:"break-all",whiteSpace:"break-spaces",children:Le}):Le,S.jsx(io,{})]},Ne)}),y,_&&S.jsx(q,{className:z.cx(rt["select-menu-item"],rt["select-menu-item-first"]),children:_})]})},"dropdown")})});return S.jsxs(q,{relative:!0,display:"inline-block",minWidth:M,w:O||(f?"full":"auto"),onMouseDown:ee=>ee.stopPropagation(),onClick:ee=>ee.stopPropagation(),children:[typeof p=="string"?S.jsx(ce,{variant:"body-2",colorName:"tertiary",fontWeight:"regular",mb:d==="sm"?4:8,children:p}):p,S.jsxs(q,{ref:P.setReference,row:!0,gap:10,tabIndex:g?-1:0,role:"button",alignItems:"flex-start","aria-haspopup":"listbox",relative:!0,w:"100%",className:z.cx(rt["select-input"],rt[`size-${d}`],rt[`background-${D}`],{[rt.error]:w,[rt.disabled]:g,[rt.open]:B}),onClick:()=>!g&&K(ee=>!ee),children:[S.jsx(q,{className:z.cx(rt["select-value"]),children:Se()}),S.jsx(q,{className:z.cx(rt["select-arrow"],rt[`select-arrow_${d}`]),children:S.jsx(zF,{})})]}),typeof b=="string"?S.jsx(ce,{variant:"caption-1",colorName:"tertiary",mt:4,children:b}):b,w&&T&&S.jsx(ce,{tag:"p",colorName:"negative",variant:"body-2",mt:5,children:T}),S.jsx(cE,{children:$e})]})}const XF=e=>N.createElement("svg",{width:10,height:10,viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M3.94629 0.220237C3.78013 0.264025 3.64089 0.377624 3.56348 0.53176C3.27371 1.11189 3.05664 1.46395 2.83887 1.74953C2.61807 2.03873 2.38547 2.27579 2.03027 2.63039C1.21079 3.45057 0.799805 4.52619 0.799805 5.60012C0.799838 6.67406 1.21073 7.74968 2.03027 8.56985C3.67062 10.2096 6.32931 10.2095 7.96973 8.56985C8.78929 7.74968 9.20016 6.67408 9.2002 5.60012C9.15131 4.32908 8.43217 3.48543 7.94727 3.05813C7.76902 2.90106 7.40643 3.02424 7.2627 3.2134C7.24031 3.24286 7.21612 3.2739 7.18945 3.30617C6.93211 3.61754 6.56236 3.80807 6.41504 3.83156C6.38264 3.83667 6.36979 3.76513 6.2959 3.58254C5.79455 2.34427 5.78927 2.49365 5.58887 2.01125C5.48847 1.7692 5.05517 1.02727 4.92676 0.828635C4.80206 0.635591 4.64095 0.439873 4.43359 0.301292C4.29028 0.205951 4.1124 0.175957 3.94629 0.220237ZM4.75293 4.17824C5.2689 4.63997 5.60857 5.26651 5.71484 5.95071C6.10631 5.85571 6.46727 5.68318 6.78125 5.45071C6.86578 5.70826 6.89338 5.98123 6.8623 6.25051C6.83115 6.51993 6.74174 6.77966 6.60059 7.01125C6.45944 7.24281 6.27008 7.44117 6.04492 7.59231C5.81977 7.74344 5.56462 7.8443 5.29688 7.88723C5.0292 7.93013 4.75518 7.91446 4.49414 7.84133C4.23299 7.76812 3.99064 7.6383 3.78418 7.46242C3.5778 7.28657 3.41161 7.06792 3.29785 6.8218C3.18419 6.57572 3.12519 6.30771 3.125 6.03664C3.12508 5.58233 3.29054 5.14308 3.58984 4.80129C3.88917 4.4597 4.30271 4.2382 4.75293 4.17824Z",fill:"#FEAD34"})),JF=e=>N.createElement("svg",{width:12,height:12,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M10.1483 8.61509C10.3344 8.26159 9.98299 7.89856 9.58534 7.93723C9.42671 7.95265 9.25857 7.9605 9.07422 7.96035C6.36522 7.9582 4.17129 5.76427 4.16914 3.05527C4.169 2.87115 4.17682 2.70321 4.19221 2.54477C4.23082 2.14712 3.86769 1.79411 3.50976 1.97161C2.03398 2.70343 1.20002 4.02274 1.20002 5.89477C1.20002 8.60377 3.3961 10.7998 6.1051 10.7998C7.97571 10.7998 9.38737 10.06 10.1483 8.61509Z",fill:"white"})),ZF="_container_6oqmw_8",QF="_disabled_6oqmw_17",eL="_reverse_6oqmw_21",tL="_switchContainer_6oqmw_25",nL="_variant_accent_6oqmw_33",rL="_variant_secondary_6oqmw_37",oL="_thumb_6oqmw_41",iL="_variant_theme_6oqmw_44",sL="_moon_6oqmw_48",aL="_fire_6oqmw_51",lL="_size_sm_6oqmw_64",cL="_size_md_6oqmw_70",uL="_size_lg_6oqmw_76",gn={container:ZF,disabled:QF,reverse:eL,switchContainer:tL,variant_accent:nL,variant_secondary:rL,switch:"_switch_6oqmw_25",thumb:oL,variant_theme:iL,moon:sL,fire:aL,size_sm:lL,size_md:cL,size_lg:uL},Z1=C.forwardRef(({title:e,text:t,icon:n,disabled:r,onChange:o,checked:i,defaultValue:s,className:a,size:l="md",variant:c="accent",reverse:u=!1,w:f="auto",...d},h)=>{const[g,p]=so(i,s),m=C.useRef(null);C.useImperativeHandle(h,()=>({focus:()=>{m.current?.focus()},blur:()=>{m.current?.blur()},get checked(){return g??!1},setChecked:x=>{p(x),o?.(x)},toggle:()=>{const x=!g;p(x),o?.(x)},isFocused:()=>document.activeElement===m.current,isDisabled:()=>r??!1,getInputElement:()=>m.current,checkValidity:()=>m.current?.checkValidity()??!0,reset:()=>{const x=s??!1;p(x),o?.(x)}}),[g,p,o,r,s]);const _=C.useCallback(x=>{p(x.target.checked),o?.(x.target.checked)},[o]),y=C.useMemo(()=>typeof e=="string"?S.jsx(ce,{variant:"body-1",colorName:"primary",fontWeight:"medium",children:e}):e,[e]),v=C.useMemo(()=>typeof t=="string"?S.jsx(ce,{variant:"body-2",colorName:"secondary",fontWeight:"regular",children:t}):t,[t]);return S.jsxs(q,{row:!0,w:f,gap:"var(--spacing-sm)",children:[S.jsxs("label",{className:z.cx(gn.container,a,{[gn.disabled]:r,[gn.reverse]:u}),children:[S.jsxs(q,{className:z.cx(gn.switchContainer,gn[`size_${l}`],gn[`variant_${c}`]),children:[S.jsx("input",{ref:m,type:"checkbox",checked:g,hidden:!0,onChange:_,disabled:r,...d}),S.jsx("div",{className:gn.switch,children:S.jsx("div",{className:gn.thumb,children:c==="theme"&&S.jsxs(S.Fragment,{children:[S.jsx(JF,{className:gn.moon}),S.jsx(XF,{className:gn.fire})]})})})]}),S.jsxs(q,{gap:"var(--spacing-xs)",children:[y,v]})]}),n]})});Z1.displayName="Switch";const dL=z.css({cursor:"pointer",userSelect:"none"}),fL=z.css({cursor:"not-allowed",opacity:.5}),hL=z.css({transition:"color 0.2s ease"}),gL=C.forwardRef(({label:e,selected:t,disabled:n,fullWidth:r,onClick:o},i)=>S.jsx(q,{w:r?"full":void 0,justifyContent:"center",alignItems:"center",ref:i,py:"var(--spacing-md)",px:"var(--spacing-xl)",onClick:o,className:z.cx(dL,{[fL]:n}),children:S.jsx(ce,{className:hL,colorName:t?"primary":"tertiary",fontWeight:"medium",variant:"body-2",children:e})})),pL=z.css({borderBottom:"1px solid var(--border-neutral-alpha-basic)"}),Q1=({value:e,onChange:t,options:n,fullWidth:r=!1,className:o})=>{const[i,s]=C.useState({left:0,width:0}),a=C.useRef([]),l=u=>f=>{a.current[u]=f};C.useEffect(()=>{const u=n.findIndex(d=>d.value===e),f=a.current[u];f&&s({left:f.offsetLeft,width:f.offsetWidth})},[e,n]);const c=(u,f=!1)=>()=>!f&&t(u);return S.jsxs(q,{row:!0,w:r?"full":"auto",relative:!0,className:z.cx(pL,o),children:[n.map((u,f)=>S.jsx(gL,{selected:e===u.value,onClick:c(u.value,u.disabled),ref:l(f),label:u.label,disabled:u.disabled,fullWidth:r},u.value)),S.jsx(q,{h:2,w:i.width,absolute:!0,bottom:-1,left:i.left,backgroundColor:"var(--border-accent-primary)",className:z.css({transition:"left 0.2s ease, width 0.2s ease"})})]})};Q1.displayName="Tabs";const mL="_header_446to_8",yL={header:mL},eb=C.forwardRef(({title:e,subtitle:t,w:n="full",p:r,py:o,px:i="var(--spacing-2xl)",pt:s="var(--spacing-2xl)",pb:a="var(--spacing-lg)",row:l=!0,justifyContent:c="space-between",showCloseButton:u=!1},f)=>{const{onClose:d}=ZC();return S.jsxs(q,{w:n,p:r,py:o,px:i,pt:s,pb:a,row:l,justifyContent:c,ref:f,className:yL.header,children:[S.jsxs(q,{gap:"var(--spacing-sm)",children:[S.jsx(ce,{variant:"title-3",colorName:"primary",fontWeight:"semibold",children:e}),S.jsx(ce,{variant:"body-1",colorName:"tertiary",fontWeight:"medium",children:t})]}),u&&S.jsx(q,{children:S.jsx(Kn,{onClick:d,color:"neutral",children:S.jsx(tv,{})})})]})});eb.displayName="ModalHeader";function Co(e,t,n){let r=n.initialDeps??[],o,i=!0;function s(){var a,l,c;let u;n.key&&((a=n.debug)!=null&&a.call(n))&&(u=Date.now());const f=e();if(!(f.length!==r.length||f.some((g,p)=>r[p]!==g)))return o;r=f;let h;if(n.key&&((l=n.debug)!=null&&l.call(n))&&(h=Date.now()),o=t(...f),n.key&&((c=n.debug)!=null&&c.call(n))){const g=Math.round((Date.now()-u)*100)/100,p=Math.round((Date.now()-h)*100)/100,m=p/16,_=(y,v)=>{for(y=String(y);y.length<v;)y=" "+y;return y};console.info(`%c⏱ ${_(p,5)} /${_(g,5)} ms`,`
|
|
42
42
|
font-size: .6rem;
|
|
43
43
|
font-weight: bold;
|
|
44
|
-
color: hsl(${Math.max(0,Math.min(120-120*m,120))}deg 100% 31%);`,n?.key)}return n?.onChange&&!(i&&n.skipInitialOnChange)&&n.onChange(o),i=!1,o}return s.updateDeps=a=>{r=a},s}function Dy(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const _L=(e,t)=>Math.abs(e-t)<1.01,xL=(e,t,n)=>{let r;return function(...o){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,o),n)}},Vy=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},bL=e=>e,CL=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let o=t;o<=n;o++)r.push(o);return r},wL=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const o=s=>{const{width:a,height:l}=s;t({width:Math.round(a),height:Math.round(l)})};if(o(Vy(n)),!r.ResizeObserver)return()=>{};const i=new r.ResizeObserver(s=>{const a=()=>{const l=s[0];if(l?.borderBoxSize){const c=l.borderBoxSize[0];if(c){o({width:c.inlineSize,height:c.blockSize});return}}o(Vy(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},jy={passive:!0},By=typeof window>"u"?!0:"onscrollend"in window,SL=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let o=0;const i=e.options.useScrollendEvent&&By?()=>{}:xL(r,()=>{t(o,!1)},e.options.isScrollingResetDelay),s=u=>()=>{const{horizontal:f,isRtl:d}=e.options;o=f?n.scrollLeft*(d&&-1||1):n.scrollTop,i(),t(o,u)},a=s(!0),l=s(!1);l(),n.addEventListener("scroll",a,jy);const c=e.options.useScrollendEvent&&By;return c&&n.addEventListener("scrollend",l,jy),()=>{n.removeEventListener("scroll",a),c&&n.removeEventListener("scrollend",l)}},EL=(e,t,n)=>{if(t?.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},TL=(e,{adjustments:t=0,behavior:n},r)=>{var o,i;const s=e+t;(i=(o=r.scrollElement)==null?void 0:o.scrollTo)==null||i.call(o,{[r.options.horizontal?"left":"top"]:s,behavior:n})};class RL{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(o=>{o.forEach(i=>{const s=()=>{this._measureElement(i.target,i)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(s):s()})}));return{disconnect:()=>{var o;(o=r())==null||o.disconnect(),n=null},observe:o=>{var i;return(i=r())==null?void 0:i.observe(o,{box:"border-box"})},unobserve:o=>{var i;return(i=r())==null?void 0:i.unobserve(o)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,o])=>{typeof o>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:bL,rangeExtractor:CL,onChange:()=>{},measureElement:EL,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var r,o;(o=(r=this.options).onChange)==null||o.call(r,this,n)},this.maybeNotify=Co(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(o=>{this.observer.observe(o)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,o=>{this.scrollRect=o,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(o,i)=>{this.scrollAdjustments=0,this.scrollDirection=i?this.getScrollOffset()<o?"forward":"backward":null,this.scrollOffset=o,this.isScrolling=i,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,r)=>{const o=new Map,i=new Map;for(let s=r-1;s>=0;s--){const a=n[s];if(o.has(a.lane))continue;const l=i.get(a.lane);if(l==null||a.end>l.end?i.set(a.lane,a):a.end<l.end&&o.set(a.lane,!0),o.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort((s,a)=>s.end===a.end?s.index-a.index:s.end-a.end)[0]:void 0},this.getMeasurementOptions=Co(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(n,r,o,i,s,a)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:o,getItemKey:i,enabled:s,lanes:a}),{key:!1,skipInitialOnChange:!0,onChange:()=>{this.notify(this.isScrolling)}}),this.getMeasurements=Co(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:o,getItemKey:i,enabled:s,lanes:a},l)=>{if(!s)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const d of this.laneAssignments.keys())d>=n&&this.laneAssignments.delete(d);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(d=>{this.itemSizeCache.set(d.key,d.size)}));const c=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1);const u=this.measurementsCache.slice(0,c),f=new Array(a).fill(void 0);for(let d=0;d<c;d++){const h=u[d];h&&(f[h.lane]=d)}for(let d=c;d<n;d++){const h=i(d),g=this.laneAssignments.get(d);let p,m;if(g!==void 0&&this.options.lanes>1){p=g;const x=f[p],b=x!==void 0?u[x]:void 0;m=b?b.end+this.options.gap:r+o}else{const x=this.options.lanes===1?u[d-1]:this.getFurthestMeasurement(u,d);m=x?x.end+this.options.gap:r+o,p=x?x.lane:d%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(d,p)}const _=l.get(h),y=typeof _=="number"?_:this.options.estimateSize(d),v=m+y;u[d]={index:d,start:m,size:y,end:v,key:h,lane:p},f[p]=d}return this.measurementsCache=u,u},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=Co(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,o,i)=>this.range=n.length>0&&r>0?kL({measurements:n,outerSize:r,scrollOffset:o,lanes:i}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=Co(()=>{let n=null,r=null;const o=this.calculateRange();return o&&(n=o.startIndex,r=o.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,o,i,s)=>i===null||s===null?[]:n({startIndex:i,endIndex:s,overscan:r,count:o}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,o=n.getAttribute(r);return o?parseInt(o,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(n,r)=>{const o=this.indexFromElement(n),i=this.measurementsCache[o];if(!i)return;const s=i.key,a=this.elementsCache.get(s);a!==n&&(a&&this.observer.unobserve(a),this.observer.observe(n),this.elementsCache.set(s,n)),n.isConnected&&this.resizeItem(o,this.options.measureElement(n,r,this))},this.resizeItem=(n,r)=>{const o=this.measurementsCache[n];if(!o)return;const i=this.itemSizeCache.get(o.key)??o.size,s=r-i;s!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(o,s,this):o.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",s),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=s,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(o.index),this.itemSizeCache=new Map(this.itemSizeCache.set(o.key,r)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((r,o)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(o))});return}this._measureElement(n,void 0)},this.getVirtualItems=Co(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const o=[];for(let i=0,s=n.length;i<s;i++){const a=n[i],l=r[a];o.push(l)}return o},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return Dy(r[tb(0,r.length-1,o=>Dy(r[o]).start,n)])},this.getOffsetForAlignment=(n,r,o=0)=>{const i=this.getSize(),s=this.getScrollOffset();r==="auto"&&(r=n>=s+i?"end":"start"),r==="center"?n+=(o-i)/2:r==="end"&&(n-=i);const a=this.getTotalSize()+this.options.scrollMargin-i;return Math.max(Math.min(a,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const o=this.measurementsCache[n];if(!o)return;const i=this.getSize(),s=this.getScrollOffset();if(r==="auto")if(o.end>=s+i-this.options.scrollPaddingEnd)r="end";else if(o.start<=s+this.options.scrollPaddingStart)r="start";else return[s,r];const a=r==="end"?o.end+this.options.scrollPaddingEnd:o.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,r,o.size),r]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(n,{align:r="start",behavior:o}={})=>{o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,r),{adjustments:void 0,behavior:o})},this.scrollToIndex=(n,{align:r="auto",behavior:o}={})=>{o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),n=Math.max(0,Math.min(n,this.options.count-1));let i=0;const s=10,a=c=>{if(!this.targetWindow)return;const u=this.getOffsetForIndex(n,c);if(!u){console.warn("Failed to get offset for index:",n);return}const[f,d]=u;this._scrollToOffset(f,{adjustments:void 0,behavior:o}),this.targetWindow.requestAnimationFrame(()=>{const h=this.getScrollOffset(),g=this.getOffsetForIndex(n,d);if(!g){console.warn("Failed to get offset for index:",n);return}_L(g[0],h)||l(d)})},l=c=>{this.targetWindow&&(i++,i<s?(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("Schedule retry",i,s),this.targetWindow.requestAnimationFrame(()=>a(c))):console.warn(`Failed to scroll to index ${n} after ${s} attempts.`))};a(r)},this.scrollBy=(n,{behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let o;if(r.length===0)o=this.options.paddingStart;else if(this.options.lanes===1)o=((n=r[r.length-1])==null?void 0:n.end)??0;else{const i=Array(this.options.lanes).fill(null);let s=r.length-1;for(;s>=0&&i.some(a=>a===null);){const a=r[s];i[a.lane]===null&&(i[a.lane]=a.end),s--}o=Math.max(...i.filter(a=>a!==null))}return Math.max(o-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:o})=>{this.options.scrollToFn(n,{behavior:o,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(t)}}const tb=(e,t,n,r)=>{for(;e<=t;){const o=(e+t)/2|0,i=n(o);if(i<r)e=o+1;else if(i>r)t=o-1;else return o}return e>0?e-1:0};function kL({measurements:e,outerSize:t,scrollOffset:n,lanes:r}){const o=e.length-1,i=l=>e[l].start;if(e.length<=r)return{startIndex:0,endIndex:o};let s=tb(0,o,i,n),a=s;if(r===1)for(;a<o&&e[a].end<n+t;)a++;else if(r>1){const l=Array(r).fill(0);for(;a<o&&l.some(u=>u<n+t);){const u=e[a];l[u.lane]=u.end,a++}const c=Array(r).fill(n+t);for(;s>=0&&c.some(u=>u>=n);){const u=e[s];c[u.lane]=u.start,s--}s=Math.max(0,s-s%r),a=Math.min(o,a+(r-1-a%r))}return{startIndex:s,endIndex:a}}const zy=typeof document<"u"?N.useLayoutEffect:N.useEffect;function AL(e){const t=N.useReducer(()=>({}),{})[1],n={...e,onChange:(o,i)=>{var s;i?zi.flushSync(t):t(),(s=e.onChange)==null||s.call(e,o,i)}},[r]=N.useState(()=>new RL(n));return r.setOptions(n),zy(()=>r._didMount(),[]),zy(()=>r._willUpdate()),r}function ML(e){return AL({observeElementRect:wL,observeElementOffset:SL,scrollToFn:TL,...e})}const NL="_main_1qx2l_8",Wy={main:NL},nb=C.forwardRef(({children:e,className:t,row:n=!1,estimatedItemHeight:r=100,virtualize:o=!1,maxHeight:i=448},s)=>{const a=C.useRef(null),l=C.useMemo(()=>C.Children.toArray(e),[e]),c=ML({count:l.length,getScrollElement:()=>a.current,estimateSize:()=>r,measureElement:f=>f.getBoundingClientRect().height});return C.useImperativeHandle(s,()=>({scrollToTop:()=>c.scrollToOffset(0,{behavior:"smooth"}),scrollToBottom:()=>c.scrollToOffset(c.getTotalSize(),{behavior:"smooth"}),scrollToIndex:(f,d={})=>c.scrollToIndex(f,{behavior:"smooth",...d}),scrollToOffset:(f,d={})=>c.scrollToOffset(f,{behavior:"smooth",...d}),scrollBy:f=>{const d=c.scrollOffset||0;c.scrollToOffset(d+f,{behavior:"smooth"})},getElement:()=>a.current,getScrollOffset:()=>c.scrollOffset||0,getTotalSize:()=>c.getTotalSize()}),[c]),C.useMemo(()=>o||l.length>50,[o,l])&&l.length>0?S.jsx(q,{ref:a,row:n,maxHeight:i,className:z.cx(Wy.main,t),w:"full",p:"var(--spacing-2xl)",children:S.jsx(q,{relative:!0,h:c.getTotalSize(),children:c.getVirtualItems().map(f=>S.jsx(q,{"data-index":f.index,ref:c.measureElement,w:"full",absolute:!0,style:{top:0,left:0,transform:`translateY(${f.start}px)`},children:l[f.index]},f.key))})}):S.jsx(q,{ref:a,className:z.cx(Wy.main,t),w:"full",row:n,pl:"var(--spacing-2xl)",pr:"var(--spacing-xs)",children:S.jsx(q,{py:"var(--spacing-2xl)",pr:"var(--spacing-xl)",children:e})})});nb.displayName="ModalMain";const Cl=rv;Cl.Header=eb;Cl.Main=nb;Cl.Footer=ov;const rb=C.createContext(null),PL=()=>C.useContext(rb),_s=({children:e})=>{const[t,n]=C.useState(null),r=PL();return C.useEffect(()=>{if(typeof document>"u")return;const o=r?.current??document.body;if(!o)return;let i=o.querySelector("[data-portal-root]")??void 0;i||(i=document.createElement("div"),i.setAttribute("data-portal-root","true"),o.appendChild(i)),n(i)},[r]),t?zi.createPortal(e,t):null};function ob(){return{accessor:(e,t)=>typeof e=="function"?{...t,accessorFn:e}:{...t,accessorKey:e},display:e=>e,group:e=>e}}function ar(e,t){return typeof e=="function"?e(t):e}function $t(e,t){return n=>{t.setState(r=>({...r,[e]:ar(n,r[e])}))}}function wl(e){return e instanceof Function}function FL(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function LL(e,t){const n=[],r=o=>{o.forEach(i=>{n.push(i);const s=t(i);s!=null&&s.length&&r(s)})};return r(e),n}function ae(e,t,n){let r=[],o;return i=>{let s;n.key&&n.debug&&(s=Date.now());const a=e(i);if(!(a.length!==r.length||a.some((u,f)=>r[f]!==u)))return o;r=a;let c;if(n.key&&n.debug&&(c=Date.now()),o=t(...a),n==null||n.onChange==null||n.onChange(o),n.key&&n.debug&&n!=null&&n.debug()){const u=Math.round((Date.now()-s)*100)/100,f=Math.round((Date.now()-c)*100)/100,d=f/16,h=(g,p)=>{for(g=String(g);g.length<p;)g=" "+g;return g};console.info(`%c⏱ ${h(f,5)} /${h(u,5)} ms`,`
|
|
44
|
+
color: hsl(${Math.max(0,Math.min(120-120*m,120))}deg 100% 31%);`,n?.key)}return n?.onChange&&!(i&&n.skipInitialOnChange)&&n.onChange(o),i=!1,o}return s.updateDeps=a=>{r=a},s}function Dy(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const vL=(e,t)=>Math.abs(e-t)<1.01,_L=(e,t,n)=>{let r;return function(...o){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,o),n)}},Vy=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},xL=e=>e,bL=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let o=t;o<=n;o++)r.push(o);return r},CL=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const o=s=>{const{width:a,height:l}=s;t({width:Math.round(a),height:Math.round(l)})};if(o(Vy(n)),!r.ResizeObserver)return()=>{};const i=new r.ResizeObserver(s=>{const a=()=>{const l=s[0];if(l?.borderBoxSize){const c=l.borderBoxSize[0];if(c){o({width:c.inlineSize,height:c.blockSize});return}}o(Vy(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},jy={passive:!0},By=typeof window>"u"?!0:"onscrollend"in window,wL=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let o=0;const i=e.options.useScrollendEvent&&By?()=>{}:_L(r,()=>{t(o,!1)},e.options.isScrollingResetDelay),s=u=>()=>{const{horizontal:f,isRtl:d}=e.options;o=f?n.scrollLeft*(d&&-1||1):n.scrollTop,i(),t(o,u)},a=s(!0),l=s(!1);l(),n.addEventListener("scroll",a,jy);const c=e.options.useScrollendEvent&&By;return c&&n.addEventListener("scrollend",l,jy),()=>{n.removeEventListener("scroll",a),c&&n.removeEventListener("scrollend",l)}},SL=(e,t,n)=>{if(t?.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},EL=(e,{adjustments:t=0,behavior:n},r)=>{var o,i;const s=e+t;(i=(o=r.scrollElement)==null?void 0:o.scrollTo)==null||i.call(o,{[r.options.horizontal?"left":"top"]:s,behavior:n})};class TL{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(o=>{o.forEach(i=>{const s=()=>{this._measureElement(i.target,i)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(s):s()})}));return{disconnect:()=>{var o;(o=r())==null||o.disconnect(),n=null},observe:o=>{var i;return(i=r())==null?void 0:i.observe(o,{box:"border-box"})},unobserve:o=>{var i;return(i=r())==null?void 0:i.unobserve(o)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,o])=>{typeof o>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:xL,rangeExtractor:bL,onChange:()=>{},measureElement:SL,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var r,o;(o=(r=this.options).onChange)==null||o.call(r,this,n)},this.maybeNotify=Co(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(o=>{this.observer.observe(o)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,o=>{this.scrollRect=o,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(o,i)=>{this.scrollAdjustments=0,this.scrollDirection=i?this.getScrollOffset()<o?"forward":"backward":null,this.scrollOffset=o,this.isScrolling=i,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,r)=>{const o=new Map,i=new Map;for(let s=r-1;s>=0;s--){const a=n[s];if(o.has(a.lane))continue;const l=i.get(a.lane);if(l==null||a.end>l.end?i.set(a.lane,a):a.end<l.end&&o.set(a.lane,!0),o.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort((s,a)=>s.end===a.end?s.index-a.index:s.end-a.end)[0]:void 0},this.getMeasurementOptions=Co(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(n,r,o,i,s,a)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:o,getItemKey:i,enabled:s,lanes:a}),{key:!1,skipInitialOnChange:!0,onChange:()=>{this.notify(this.isScrolling)}}),this.getMeasurements=Co(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:o,getItemKey:i,enabled:s,lanes:a},l)=>{if(!s)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const d of this.laneAssignments.keys())d>=n&&this.laneAssignments.delete(d);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(d=>{this.itemSizeCache.set(d.key,d.size)}));const c=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1);const u=this.measurementsCache.slice(0,c),f=new Array(a).fill(void 0);for(let d=0;d<c;d++){const h=u[d];h&&(f[h.lane]=d)}for(let d=c;d<n;d++){const h=i(d),g=this.laneAssignments.get(d);let p,m;if(g!==void 0&&this.options.lanes>1){p=g;const x=f[p],b=x!==void 0?u[x]:void 0;m=b?b.end+this.options.gap:r+o}else{const x=this.options.lanes===1?u[d-1]:this.getFurthestMeasurement(u,d);m=x?x.end+this.options.gap:r+o,p=x?x.lane:d%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(d,p)}const _=l.get(h),y=typeof _=="number"?_:this.options.estimateSize(d),v=m+y;u[d]={index:d,start:m,size:y,end:v,key:h,lane:p},f[p]=d}return this.measurementsCache=u,u},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=Co(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,o,i)=>this.range=n.length>0&&r>0?RL({measurements:n,outerSize:r,scrollOffset:o,lanes:i}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=Co(()=>{let n=null,r=null;const o=this.calculateRange();return o&&(n=o.startIndex,r=o.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,o,i,s)=>i===null||s===null?[]:n({startIndex:i,endIndex:s,overscan:r,count:o}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,o=n.getAttribute(r);return o?parseInt(o,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(n,r)=>{const o=this.indexFromElement(n),i=this.measurementsCache[o];if(!i)return;const s=i.key,a=this.elementsCache.get(s);a!==n&&(a&&this.observer.unobserve(a),this.observer.observe(n),this.elementsCache.set(s,n)),n.isConnected&&this.resizeItem(o,this.options.measureElement(n,r,this))},this.resizeItem=(n,r)=>{const o=this.measurementsCache[n];if(!o)return;const i=this.itemSizeCache.get(o.key)??o.size,s=r-i;s!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(o,s,this):o.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",s),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=s,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(o.index),this.itemSizeCache=new Map(this.itemSizeCache.set(o.key,r)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((r,o)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(o))});return}this._measureElement(n,void 0)},this.getVirtualItems=Co(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const o=[];for(let i=0,s=n.length;i<s;i++){const a=n[i],l=r[a];o.push(l)}return o},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return Dy(r[tb(0,r.length-1,o=>Dy(r[o]).start,n)])},this.getOffsetForAlignment=(n,r,o=0)=>{const i=this.getSize(),s=this.getScrollOffset();r==="auto"&&(r=n>=s+i?"end":"start"),r==="center"?n+=(o-i)/2:r==="end"&&(n-=i);const a=this.getTotalSize()+this.options.scrollMargin-i;return Math.max(Math.min(a,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const o=this.measurementsCache[n];if(!o)return;const i=this.getSize(),s=this.getScrollOffset();if(r==="auto")if(o.end>=s+i-this.options.scrollPaddingEnd)r="end";else if(o.start<=s+this.options.scrollPaddingStart)r="start";else return[s,r];const a=r==="end"?o.end+this.options.scrollPaddingEnd:o.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,r,o.size),r]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(n,{align:r="start",behavior:o}={})=>{o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,r),{adjustments:void 0,behavior:o})},this.scrollToIndex=(n,{align:r="auto",behavior:o}={})=>{o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),n=Math.max(0,Math.min(n,this.options.count-1));let i=0;const s=10,a=c=>{if(!this.targetWindow)return;const u=this.getOffsetForIndex(n,c);if(!u){console.warn("Failed to get offset for index:",n);return}const[f,d]=u;this._scrollToOffset(f,{adjustments:void 0,behavior:o}),this.targetWindow.requestAnimationFrame(()=>{const h=this.getScrollOffset(),g=this.getOffsetForIndex(n,d);if(!g){console.warn("Failed to get offset for index:",n);return}vL(g[0],h)||l(d)})},l=c=>{this.targetWindow&&(i++,i<s?(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("Schedule retry",i,s),this.targetWindow.requestAnimationFrame(()=>a(c))):console.warn(`Failed to scroll to index ${n} after ${s} attempts.`))};a(r)},this.scrollBy=(n,{behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let o;if(r.length===0)o=this.options.paddingStart;else if(this.options.lanes===1)o=((n=r[r.length-1])==null?void 0:n.end)??0;else{const i=Array(this.options.lanes).fill(null);let s=r.length-1;for(;s>=0&&i.some(a=>a===null);){const a=r[s];i[a.lane]===null&&(i[a.lane]=a.end),s--}o=Math.max(...i.filter(a=>a!==null))}return Math.max(o-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:o})=>{this.options.scrollToFn(n,{behavior:o,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(t)}}const tb=(e,t,n,r)=>{for(;e<=t;){const o=(e+t)/2|0,i=n(o);if(i<r)e=o+1;else if(i>r)t=o-1;else return o}return e>0?e-1:0};function RL({measurements:e,outerSize:t,scrollOffset:n,lanes:r}){const o=e.length-1,i=l=>e[l].start;if(e.length<=r)return{startIndex:0,endIndex:o};let s=tb(0,o,i,n),a=s;if(r===1)for(;a<o&&e[a].end<n+t;)a++;else if(r>1){const l=Array(r).fill(0);for(;a<o&&l.some(u=>u<n+t);){const u=e[a];l[u.lane]=u.end,a++}const c=Array(r).fill(n+t);for(;s>=0&&c.some(u=>u>=n);){const u=e[s];c[u.lane]=u.start,s--}s=Math.max(0,s-s%r),a=Math.min(o,a+(r-1-a%r))}return{startIndex:s,endIndex:a}}const zy=typeof document<"u"?N.useLayoutEffect:N.useEffect;function kL(e){const t=N.useReducer(()=>({}),{})[1],n={...e,onChange:(o,i)=>{var s;i?zi.flushSync(t):t(),(s=e.onChange)==null||s.call(e,o,i)}},[r]=N.useState(()=>new TL(n));return r.setOptions(n),zy(()=>r._didMount(),[]),zy(()=>r._willUpdate()),r}function AL(e){return kL({observeElementRect:CL,observeElementOffset:wL,scrollToFn:EL,...e})}const ML="_main_1qx2l_8",Wy={main:ML},nb=C.forwardRef(({children:e,className:t,row:n=!1,estimatedItemHeight:r=100,virtualize:o=!1,maxHeight:i=448},s)=>{const a=C.useRef(null),l=C.useMemo(()=>C.Children.toArray(e),[e]),c=AL({count:l.length,getScrollElement:()=>a.current,estimateSize:()=>r,measureElement:f=>f.getBoundingClientRect().height});return C.useImperativeHandle(s,()=>({scrollToTop:()=>c.scrollToOffset(0,{behavior:"smooth"}),scrollToBottom:()=>c.scrollToOffset(c.getTotalSize(),{behavior:"smooth"}),scrollToIndex:(f,d={})=>c.scrollToIndex(f,{behavior:"smooth",...d}),scrollToOffset:(f,d={})=>c.scrollToOffset(f,{behavior:"smooth",...d}),scrollBy:f=>{const d=c.scrollOffset||0;c.scrollToOffset(d+f,{behavior:"smooth"})},getElement:()=>a.current,getScrollOffset:()=>c.scrollOffset||0,getTotalSize:()=>c.getTotalSize()}),[c]),C.useMemo(()=>o||l.length>50,[o,l])&&l.length>0?S.jsx(q,{ref:a,row:n,maxHeight:i,className:z.cx(Wy.main,t),w:"full",p:"var(--spacing-2xl)",children:S.jsx(q,{relative:!0,h:c.getTotalSize(),children:c.getVirtualItems().map(f=>S.jsx(q,{"data-index":f.index,ref:c.measureElement,w:"full",absolute:!0,style:{top:0,left:0,transform:`translateY(${f.start}px)`},children:l[f.index]},f.key))})}):S.jsx(q,{ref:a,className:z.cx(Wy.main,t),w:"full",row:n,pl:"var(--spacing-2xl)",pr:"var(--spacing-xs)",children:S.jsx(q,{py:"var(--spacing-2xl)",pr:"var(--spacing-xl)",children:e})})});nb.displayName="ModalMain";const Cl=rv;Cl.Header=eb;Cl.Main=nb;Cl.Footer=ov;const rb=C.createContext(null),NL=()=>C.useContext(rb),_s=({children:e})=>{const[t,n]=C.useState(null),r=NL();return C.useEffect(()=>{if(typeof document>"u")return;const o=r?.current??document.body;if(!o)return;let i=o.querySelector("[data-portal-root]")??void 0;i||(i=document.createElement("div"),i.setAttribute("data-portal-root","true"),o.appendChild(i)),n(i)},[r]),t?zi.createPortal(e,t):null};function ob(){return{accessor:(e,t)=>typeof e=="function"?{...t,accessorFn:e}:{...t,accessorKey:e},display:e=>e,group:e=>e}}function ar(e,t){return typeof e=="function"?e(t):e}function $t(e,t){return n=>{t.setState(r=>({...r,[e]:ar(n,r[e])}))}}function wl(e){return e instanceof Function}function PL(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function FL(e,t){const n=[],r=o=>{o.forEach(i=>{n.push(i);const s=t(i);s!=null&&s.length&&r(s)})};return r(e),n}function ae(e,t,n){let r=[],o;return i=>{let s;n.key&&n.debug&&(s=Date.now());const a=e(i);if(!(a.length!==r.length||a.some((u,f)=>r[f]!==u)))return o;r=a;let c;if(n.key&&n.debug&&(c=Date.now()),o=t(...a),n==null||n.onChange==null||n.onChange(o),n.key&&n.debug&&n!=null&&n.debug()){const u=Math.round((Date.now()-s)*100)/100,f=Math.round((Date.now()-c)*100)/100,d=f/16,h=(g,p)=>{for(g=String(g);g.length<p;)g=" "+g;return g};console.info(`%c⏱ ${h(f,5)} /${h(u,5)} ms`,`
|
|
45
45
|
font-size: .6rem;
|
|
46
46
|
font-weight: bold;
|
|
47
|
-
color: hsl(${Math.max(0,Math.min(120-120*d,120))}deg 100% 31%);`,n?.key)}return o}}function le(e,t,n,r){return{debug:()=>{var o;return(o=e?.debugAll)!=null?o:e[t]},key:process.env.NODE_ENV==="development"&&n,onChange:r}}function OL(e,t,n,r){const o=()=>{var s;return(s=i.getValue())!=null?s:e.options.renderFallbackValue},i={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:o,getContext:ae(()=>[e,n,t,i],(s,a,l,c)=>({table:s,column:a,row:l,cell:c,getValue:c.getValue,renderValue:c.renderValue}),le(e.options,"debugCells","cell.getContext"))};return e._features.forEach(s=>{s.createCell==null||s.createCell(i,n,t,e)},{}),i}function IL(e,t,n,r){var o,i;const a={...e._getDefaultColumnDef(),...t},l=a.accessorKey;let c=(o=(i=a.id)!=null?i:l?typeof String.prototype.replaceAll=="function"?l.replaceAll(".","_"):l.replace(/\./g,"_"):void 0)!=null?o:typeof a.header=="string"?a.header:void 0,u;if(a.accessorFn?u=a.accessorFn:l&&(l.includes(".")?u=d=>{let h=d;for(const p of l.split(".")){var g;h=(g=h)==null?void 0:g[p],process.env.NODE_ENV!=="production"&&h===void 0&&console.warn(`"${p}" in deeply nested key "${l}" returned undefined.`)}return h}:u=d=>d[a.accessorKey]),!c)throw process.env.NODE_ENV!=="production"?new Error(a.accessorFn?"Columns require an id when using an accessorFn":"Columns require an id when using a non-string header"):new Error;let f={id:`${String(c)}`,accessorFn:u,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:ae(()=>[!0],()=>{var d;return[f,...(d=f.columns)==null?void 0:d.flatMap(h=>h.getFlatColumns())]},le(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:ae(()=>[e._getOrderColumnsFn()],d=>{var h;if((h=f.columns)!=null&&h.length){let g=f.columns.flatMap(p=>p.getLeafColumns());return d(g)}return[f]},le(e.options,"debugColumns","column.getLeafColumns"))};for(const d of e._features)d.createColumn==null||d.createColumn(f,e);return f}const ht="debugHeaders";function Hy(e,t,n){var r;let i={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const s=[],a=l=>{l.subHeaders&&l.subHeaders.length&&l.subHeaders.map(a),s.push(l)};return a(i),s},getContext:()=>({table:e,header:i,column:t})};return e._features.forEach(s=>{s.createHeader==null||s.createHeader(i,e)}),i}const $L={createTable:e=>{e.getHeaderGroups=ae(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>{var i,s;const a=(i=r?.map(f=>n.find(d=>d.id===f)).filter(Boolean))!=null?i:[],l=(s=o?.map(f=>n.find(d=>d.id===f)).filter(Boolean))!=null?s:[],c=n.filter(f=>!(r!=null&&r.includes(f.id))&&!(o!=null&&o.includes(f.id)));return Gs(t,[...a,...c,...l],e)},le(e.options,ht,"getHeaderGroups")),e.getCenterHeaderGroups=ae(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>(n=n.filter(i=>!(r!=null&&r.includes(i.id))&&!(o!=null&&o.includes(i.id))),Gs(t,n,e,"center")),le(e.options,ht,"getCenterHeaderGroups")),e.getLeftHeaderGroups=ae(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var o;const i=(o=r?.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?o:[];return Gs(t,i,e,"left")},le(e.options,ht,"getLeftHeaderGroups")),e.getRightHeaderGroups=ae(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var o;const i=(o=r?.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?o:[];return Gs(t,i,e,"right")},le(e.options,ht,"getRightHeaderGroups")),e.getFooterGroups=ae(()=>[e.getHeaderGroups()],t=>[...t].reverse(),le(e.options,ht,"getFooterGroups")),e.getLeftFooterGroups=ae(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),le(e.options,ht,"getLeftFooterGroups")),e.getCenterFooterGroups=ae(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),le(e.options,ht,"getCenterFooterGroups")),e.getRightFooterGroups=ae(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),le(e.options,ht,"getRightFooterGroups")),e.getFlatHeaders=ae(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),le(e.options,ht,"getFlatHeaders")),e.getLeftFlatHeaders=ae(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),le(e.options,ht,"getLeftFlatHeaders")),e.getCenterFlatHeaders=ae(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),le(e.options,ht,"getCenterFlatHeaders")),e.getRightFlatHeaders=ae(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),le(e.options,ht,"getRightFlatHeaders")),e.getCenterLeafHeaders=ae(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),le(e.options,ht,"getCenterLeafHeaders")),e.getLeftLeafHeaders=ae(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),le(e.options,ht,"getLeftLeafHeaders")),e.getRightLeafHeaders=ae(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),le(e.options,ht,"getRightLeafHeaders")),e.getLeafHeaders=ae(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var o,i,s,a,l,c;return[...(o=(i=t[0])==null?void 0:i.headers)!=null?o:[],...(s=(a=n[0])==null?void 0:a.headers)!=null?s:[],...(l=(c=r[0])==null?void 0:c.headers)!=null?l:[]].map(u=>u.getLeafHeaders()).flat()},le(e.options,ht,"getLeafHeaders"))}};function Gs(e,t,n,r){var o,i;let s=0;const a=function(d,h){h===void 0&&(h=1),s=Math.max(s,h),d.filter(g=>g.getIsVisible()).forEach(g=>{var p;(p=g.columns)!=null&&p.length&&a(g.columns,h+1)},0)};a(e);let l=[];const c=(d,h)=>{const g={depth:h,id:[r,`${h}`].filter(Boolean).join("_"),headers:[]},p=[];d.forEach(m=>{const _=[...p].reverse()[0],y=m.column.depth===g.depth;let v,x=!1;if(y&&m.column.parent?v=m.column.parent:(v=m.column,x=!0),_&&_?.column===v)_.subHeaders.push(m);else{const b=Hy(n,v,{id:[r,h,v.id,m?.id].filter(Boolean).join("_"),isPlaceholder:x,placeholderId:x?`${p.filter(w=>w.column===v).length}`:void 0,depth:h,index:p.length});b.subHeaders.push(m),p.push(b)}g.headers.push(m),m.headerGroup=g}),l.push(g),h>0&&c(p,h-1)},u=t.map((d,h)=>Hy(n,d,{depth:s,index:h}));c(u,s-1),l.reverse();const f=d=>d.filter(g=>g.column.getIsVisible()).map(g=>{let p=0,m=0,_=[0];g.subHeaders&&g.subHeaders.length?(_=[],f(g.subHeaders).forEach(v=>{let{colSpan:x,rowSpan:b}=v;p+=x,_.push(b)})):p=1;const y=Math.min(..._);return m=m+y,g.colSpan=p,g.rowSpan=m,{colSpan:p,rowSpan:m}});return f((o=(i=l[0])==null?void 0:i.headers)!=null?o:[]),l}const DL=(e,t,n,r,o,i,s)=>{let a={id:t,index:r,original:n,depth:o,parentId:s,_valuesCache:{},_uniqueValuesCache:{},getValue:l=>{if(a._valuesCache.hasOwnProperty(l))return a._valuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return a._valuesCache[l]=c.accessorFn(a.original,r),a._valuesCache[l]},getUniqueValues:l=>{if(a._uniqueValuesCache.hasOwnProperty(l))return a._uniqueValuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return c.columnDef.getUniqueValues?(a._uniqueValuesCache[l]=c.columnDef.getUniqueValues(a.original,r),a._uniqueValuesCache[l]):(a._uniqueValuesCache[l]=[a.getValue(l)],a._uniqueValuesCache[l])},renderValue:l=>{var c;return(c=a.getValue(l))!=null?c:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>LL(a.subRows,l=>l.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let l=[],c=a;for(;;){const u=c.getParentRow();if(!u)break;l.push(u),c=u}return l.reverse()},getAllCells:ae(()=>[e.getAllLeafColumns()],l=>l.map(c=>OL(e,a,c,c.id)),le(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:ae(()=>[a.getAllCells()],l=>l.reduce((c,u)=>(c[u.column.id]=u,c),{}),le(e.options,"debugRows","getAllCellsByColumnId"))};for(let l=0;l<e._features.length;l++){const c=e._features[l];c==null||c.createRow==null||c.createRow(a,e)}return a},VL={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},ib=(e,t,n)=>{var r,o;const i=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((o=e.getValue(t))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(i))};ib.autoRemove=e=>sn(e);const sb=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};sb.autoRemove=e=>sn(e);const ab=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===n?.toLowerCase()};ab.autoRemove=e=>sn(e);const lb=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};lb.autoRemove=e=>sn(e);const cb=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});cb.autoRemove=e=>sn(e)||!(e!=null&&e.length);const ub=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});ub.autoRemove=e=>sn(e)||!(e!=null&&e.length);const db=(e,t,n)=>e.getValue(t)===n;db.autoRemove=e=>sn(e);const fb=(e,t,n)=>e.getValue(t)==n;fb.autoRemove=e=>sn(e);const uh=(e,t,n)=>{let[r,o]=n;const i=e.getValue(t);return i>=r&&i<=o};uh.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,o=typeof n!="number"?parseFloat(n):n,i=t===null||Number.isNaN(r)?-1/0:r,s=n===null||Number.isNaN(o)?1/0:o;if(i>s){const a=i;i=s,s=a}return[i,s]};uh.autoRemove=e=>sn(e)||sn(e[0])&&sn(e[1]);const $n={includesString:ib,includesStringSensitive:sb,equalsString:ab,arrIncludes:lb,arrIncludesAll:cb,arrIncludesSome:ub,equals:db,weakEquals:fb,inNumberRange:uh};function sn(e){return e==null||e===""}const jL={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:$t("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n?.getValue(e.id);return typeof r=="string"?$n.includesString:typeof r=="number"?$n.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?$n.equals:Array.isArray(r)?$n.arrIncludes:$n.weakEquals},e.getFilterFn=()=>{var n,r;return wl(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:$n[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,o;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const o=e.getFilterFn(),i=r?.find(u=>u.id===e.id),s=ar(n,i?i.value:void 0);if(Ky(o,s,e)){var a;return(a=r?.filter(u=>u.id!==e.id))!=null?a:[]}const l={id:e.id,value:s};if(i){var c;return(c=r?.map(u=>u.id===e.id?l:u))!=null?c:[]}return r!=null&&r.length?[...r,l]:[l]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=o=>{var i;return(i=ar(t,o))==null?void 0:i.filter(s=>{const a=n.find(l=>l.id===s.id);if(a){const l=a.getFilterFn();if(Ky(l,s.value,a))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function Ky(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const BL=(e,t,n)=>n.reduce((r,o)=>{const i=o.getValue(e);return r+(typeof i=="number"?i:0)},0),zL=(e,t,n)=>{let r;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}),r},WL=(e,t,n)=>{let r;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r<i||r===void 0&&i>=i)&&(r=i)}),r},HL=(e,t,n)=>{let r,o;return n.forEach(i=>{const s=i.getValue(e);s!=null&&(r===void 0?s>=s&&(r=o=s):(r>s&&(r=s),o<s&&(o=s)))}),[r,o]},KL=(e,t)=>{let n=0,r=0;if(t.forEach(o=>{let i=o.getValue(e);i!=null&&(i=+i)>=i&&(++n,r+=i)}),n)return r/n},UL=(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!FL(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),o=n.sort((i,s)=>i-s);return n.length%2!==0?o[r]:(o[r-1]+o[r])/2},GL=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),qL=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,YL=(e,t)=>t.length,zc={sum:BL,min:zL,max:WL,extent:HL,mean:KL,median:UL,unique:GL,uniqueCount:qL,count:YL},XL={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:$t("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n?.getValue(e.id);if(typeof r=="number")return zc.sum;if(Object.prototype.toString.call(r)==="[object Date]")return zc.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return wl(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:zc[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var o;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((o=n.subRows)!=null&&o.length)}}};function JL(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(i=>!t.includes(i.id));return n==="remove"?r:[...t.map(i=>e.find(s=>s.id===i)).filter(Boolean),...r]}const ZL={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:$t("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=ae(n=>[Bi(t,n)],n=>n.findIndex(r=>r.id===e.id),le(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var r;return((r=Bi(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const o=Bi(t,n);return((r=o[o.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=ae(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>o=>{let i=[];if(!(t!=null&&t.length))i=o;else{const s=[...t],a=[...o];for(;a.length&&s.length;){const l=s.shift(),c=a.findIndex(u=>u.id===l);c>-1&&i.push(a.splice(c,1)[0])}i=[...i,...a]}return JL(i,n,r)},le(e.options,"debugTable","_getOrderColumnsFn"))}},Wc=()=>({left:[],right:[]}),QL={getInitialState:e=>({columnPinning:Wc(),...e}),getDefaultOptions:e=>({onColumnPinningChange:$t("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(o=>o.id).filter(Boolean);t.setColumnPinning(o=>{var i,s;if(n==="right"){var a,l;return{left:((a=o?.left)!=null?a:[]).filter(f=>!(r!=null&&r.includes(f))),right:[...((l=o?.right)!=null?l:[]).filter(f=>!(r!=null&&r.includes(f))),...r]}}if(n==="left"){var c,u;return{left:[...((c=o?.left)!=null?c:[]).filter(f=>!(r!=null&&r.includes(f))),...r],right:((u=o?.right)!=null?u:[]).filter(f=>!(r!=null&&r.includes(f)))}}return{left:((i=o?.left)!=null?i:[]).filter(f=>!(r!=null&&r.includes(f))),right:((s=o?.right)!=null?s:[]).filter(f=>!(r!=null&&r.includes(f)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var o,i,s;return((o=r.columnDef.enablePinning)!=null?o:!0)&&((i=(s=t.options.enableColumnPinning)!=null?s:t.options.enablePinning)!=null?i:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(a=>a.id),{left:r,right:o}=t.getState().columnPinning,i=n.some(a=>r?.includes(a)),s=n.some(a=>o?.includes(a));return i?"left":s?"right":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();return o?(n=(r=t.getState().columnPinning)==null||(r=r[o])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=ae(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,o)=>{const i=[...r??[],...o??[]];return n.filter(s=>!i.includes(s.column.id))},le(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=ae(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(i=>n.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),le(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=ae(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(i=>n.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),le(t.options,"debugRows","getRightVisibleCells"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?Wc():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:Wc())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var o,i;return!!((o=r.left)!=null&&o.length||(i=r.right)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=ae(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),le(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=ae(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),le(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=ae(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const o=[...n??[],...r??[]];return t.filter(i=>!o.includes(i.id))},le(e.options,"debugColumns","getCenterLeafColumns"))}};function eO(e){return e||(typeof document<"u"?document:null)}const qs={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Hc=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),tO={getDefaultColumnDef:()=>qs,getInitialState:e=>({columnSizing:{},columnSizingInfo:Hc(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:$t("columnSizing",e),onColumnSizingInfoChange:$t("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,o;const i=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:qs.minSize,(r=i??e.columnDef.size)!=null?r:qs.size),(o=e.columnDef.maxSize)!=null?o:qs.maxSize)},e.getStart=ae(n=>[n,Bi(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((o,i)=>o+i.getSize(),0),le(t.options,"debugColumns","getStart")),e.getAfter=ae(n=>[n,Bi(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((o,i)=>o+i.getSize(),0),le(t.options,"debugColumns","getAfter")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...o}=n;return o})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=o=>{if(o.subHeaders.length)o.subHeaders.forEach(r);else{var i;n+=(i=o.column.getSize())!=null?i:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),o=r?.getCanResize();return i=>{if(!r||!o||(i.persist==null||i.persist(),Kc(i)&&i.touches&&i.touches.length>1))return;const s=e.getSize(),a=e?e.getLeafHeaders().map(_=>[_.column.id,_.column.getSize()]):[[r.id,r.getSize()]],l=Kc(i)?Math.round(i.touches[0].clientX):i.clientX,c={},u=(_,y)=>{typeof y=="number"&&(t.setColumnSizingInfo(v=>{var x,b;const w=t.options.columnResizeDirection==="rtl"?-1:1,T=(y-((x=v?.startOffset)!=null?x:0))*w,E=Math.max(T/((b=v?.startSize)!=null?b:0),-.999999);return v.columnSizingStart.forEach(R=>{let[M,O]=R;c[M]=Math.round(Math.max(O+O*E,0)*100)/100}),{...v,deltaOffset:T,deltaPercentage:E}}),(t.options.columnResizeMode==="onChange"||_==="end")&&t.setColumnSizing(v=>({...v,...c})))},f=_=>u("move",_),d=_=>{u("end",_),t.setColumnSizingInfo(y=>({...y,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},h=eO(n),g={moveHandler:_=>f(_.clientX),upHandler:_=>{h?.removeEventListener("mousemove",g.moveHandler),h?.removeEventListener("mouseup",g.upHandler),d(_.clientX)}},p={moveHandler:_=>(_.cancelable&&(_.preventDefault(),_.stopPropagation()),f(_.touches[0].clientX),!1),upHandler:_=>{var y;h?.removeEventListener("touchmove",p.moveHandler),h?.removeEventListener("touchend",p.upHandler),_.cancelable&&(_.preventDefault(),_.stopPropagation()),d((y=_.touches[0])==null?void 0:y.clientX)}},m=nO()?{passive:!1}:!1;Kc(i)?(h?.addEventListener("touchmove",p.moveHandler,m),h?.addEventListener("touchend",p.upHandler,m)):(h?.addEventListener("mousemove",g.moveHandler,m),h?.addEventListener("mouseup",g.upHandler,m)),t.setColumnSizingInfo(_=>({..._,startOffset:l,startSize:s,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?Hc():(n=e.initialState.columnSizingInfo)!=null?n:Hc())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0}}};let Ys=null;function nO(){if(typeof Ys=="boolean")return Ys;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return Ys=e,Ys}function Kc(e){return e.type==="touchstart"}const rO={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:$t("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const o=e.columns;return(n=o.length?o.some(i=>i.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=ae(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),le(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=ae(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],le(t.options,"debugRows","getVisibleCells"))},createTable:e=>{const t=(n,r)=>ae(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),le(e.options,"debugColumns",n));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((o,i)=>({...o,[i.id]:n||!(i.getCanHide!=null&&i.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function Bi(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const oO={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},iO={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:$t("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,o,i;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&((i=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>$n.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return wl(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:$n[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},sO={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:$t("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var o,i;e.setExpanded(r?{}:(o=(i=e.initialState)==null?void 0:i.expanded)!=null?o:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(o=>!o.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(i=>{const s=i.split(".");r=Math.max(r,s.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var o;const i=r===!0?!0:!!(r!=null&&r[e.id]);let s={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(a=>{s[a]=!0}):s=r,n=(o=n)!=null?o:!i,!i&&n)return{...s,[e.id]:!0};if(i&&!n){const{[e.id]:a,...l}=s;return l}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r?.[e.id])},e.getCanExpand=()=>{var n,r,o;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((o=e.subRows)!=null&&o.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},hd=0,gd=10,Uc=()=>({pageIndex:hd,pageSize:gd}),aO={getInitialState:e=>({...e,pagination:{...Uc(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:$t("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const o=i=>ar(r,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?Uc():(o=e.initialState.pagination)!=null?o:Uc())},e.setPageIndex=r=>{e.setPagination(o=>{let i=ar(r,o.pageIndex);const s=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return i=Math.max(0,Math.min(i,s)),{...o,pageIndex:i}})},e.resetPageIndex=r=>{var o,i;e.setPageIndex(r?hd:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?o:hd)},e.resetPageSize=r=>{var o,i;e.setPageSize(r?gd:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?o:gd)},e.setPageSize=r=>{e.setPagination(o=>{const i=Math.max(1,ar(r,o.pageSize)),s=o.pageSize*o.pageIndex,a=Math.floor(s/i);return{...o,pageIndex:a,pageSize:i}})},e.setPageCount=r=>e.setPagination(o=>{var i;let s=ar(r,(i=e.options.pageCount)!=null?i:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...o,pageCount:s}}),e.getPageOptions=ae(()=>[e.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((i,s)=>s)),o},le(e.options,"debugTable","getPageOptions")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,o=e.getPageCount();return o===-1?!0:o===0?!1:r<o-1},e.previousPage=()=>e.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},Gc=()=>({top:[],bottom:[]}),lO={getInitialState:e=>({rowPinning:Gc(),...e}),getDefaultOptions:e=>({onRowPinningChange:$t("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,o)=>{const i=r?e.getLeafRows().map(l=>{let{id:c}=l;return c}):[],s=o?e.getParentRows().map(l=>{let{id:c}=l;return c}):[],a=new Set([...s,e.id,...i]);t.setRowPinning(l=>{var c,u;if(n==="bottom"){var f,d;return{top:((f=l?.top)!=null?f:[]).filter(p=>!(a!=null&&a.has(p))),bottom:[...((d=l?.bottom)!=null?d:[]).filter(p=>!(a!=null&&a.has(p))),...Array.from(a)]}}if(n==="top"){var h,g;return{top:[...((h=l?.top)!=null?h:[]).filter(p=>!(a!=null&&a.has(p))),...Array.from(a)],bottom:((g=l?.bottom)!=null?g:[]).filter(p=>!(a!=null&&a.has(p)))}}return{top:((c=l?.top)!=null?c:[]).filter(p=>!(a!=null&&a.has(p))),bottom:((u=l?.bottom)!=null?u:[]).filter(p=>!(a!=null&&a.has(p)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:o}=t.options;return typeof r=="function"?r(e):(n=r??o)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:o}=t.getState().rowPinning,i=n.some(a=>r?.includes(a)),s=n.some(a=>o?.includes(a));return i?"top":s?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();if(!o)return-1;const i=(n=o==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(s=>{let{id:a}=s;return a});return(r=i?.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?Gc():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:Gc())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var o,i;return!!((o=r.top)!=null&&o.length||(i=r.bottom)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var o;return((o=e.options.keepPinnedRows)==null||o?(n??[]).map(s=>{const a=e.getRow(s,!0);return a.getIsAllParentsExpanded()?a:null}):(n??[]).map(s=>t.find(a=>a.id===s))).filter(Boolean).map(s=>({...s,position:r}))},e.getTopRows=ae(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),le(e.options,"debugRows","getTopRows")),e.getBottomRows=ae(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),le(e.options,"debugRows","getBottomRows")),e.getCenterRows=ae(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const o=new Set([...n??[],...r??[]]);return t.filter(i=>!o.has(i.id))},le(e.options,"debugRows","getCenterRows"))}},cO={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:$t("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach(i=>{i.getCanSelect()&&(r[i.id]=!0)}):o.forEach(i=>{delete r[i.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach(i=>{pd(o,i.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=ae(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?qc(e,n):{rows:[],flatRows:[],rowsById:{}},le(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=ae(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?qc(e,n):{rows:[],flatRows:[],rowsById:{}},le(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=ae(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?qc(e,n):{rows:[],flatRows:[],rowsById:{}},le(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(o=>o.getCanSelect()&&!n[o.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(o=>!n[o.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const o=e.getIsSelected();t.setRowSelection(i=>{var s;if(n=typeof n<"u"?n:!o,e.getCanSelect()&&o===n)return i;const a={...i};return pd(a,e.id,n,(s=r?.selectChildren)!=null?s:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return dh(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return md(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return md(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var o;n&&e.toggleSelected((o=r.target)==null?void 0:o.checked)}}}},pd=(e,t,n,r,o)=>{var i;const s=o.getRow(t,!0);n?(s.getCanMultiSelect()||Object.keys(e).forEach(a=>delete e[a]),s.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(i=s.subRows)!=null&&i.length&&s.getCanSelectSubRows()&&s.subRows.forEach(a=>pd(e,a.id,n,r,o))};function qc(e,t){const n=e.getState().rowSelection,r=[],o={},i=function(s,a){return s.map(l=>{var c;const u=dh(l,n);if(u&&(r.push(l),o[l.id]=l),(c=l.subRows)!=null&&c.length&&(l={...l,subRows:i(l.subRows)}),u)return l}).filter(Boolean)};return{rows:i(t.rows),flatRows:r,rowsById:o}}function dh(e,t){var n;return(n=t[e.id])!=null?n:!1}function md(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let o=!0,i=!1;return e.subRows.forEach(s=>{if(!(i&&!o)&&(s.getCanSelect()&&(dh(s,t)?i=!0:o=!1),s.subRows&&s.subRows.length)){const a=md(s,t);a==="all"?i=!0:(a==="some"&&(i=!0),o=!1)}}),o?"all":i?"some":!1}const yd=/([0-9]+)/gm,uO=(e,t,n)=>hb(br(e.getValue(n)).toLowerCase(),br(t.getValue(n)).toLowerCase()),dO=(e,t,n)=>hb(br(e.getValue(n)),br(t.getValue(n))),fO=(e,t,n)=>fh(br(e.getValue(n)).toLowerCase(),br(t.getValue(n)).toLowerCase()),hO=(e,t,n)=>fh(br(e.getValue(n)),br(t.getValue(n))),gO=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},pO=(e,t,n)=>fh(e.getValue(n),t.getValue(n));function fh(e,t){return e===t?0:e>t?1:-1}function br(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function hb(e,t){const n=e.split(yd).filter(Boolean),r=t.split(yd).filter(Boolean);for(;n.length&&r.length;){const o=n.shift(),i=r.shift(),s=parseInt(o,10),a=parseInt(i,10),l=[s,a].sort();if(isNaN(l[0])){if(o>i)return 1;if(i>o)return-1;continue}if(isNaN(l[1]))return isNaN(s)?-1:1;if(s>a)return 1;if(a>s)return-1}return n.length-r.length}const Ei={alphanumeric:uO,alphanumericCaseSensitive:dO,text:fO,textCaseSensitive:hO,datetime:gO,basic:pO},mO={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:$t("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const o of n){const i=o?.getValue(e.id);if(Object.prototype.toString.call(i)==="[object Date]")return Ei.datetime;if(typeof i=="string"&&(r=!0,i.split(yd).length>1))return Ei.alphanumeric}return r?Ei.text:Ei.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof n?.getValue(e.id)=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return wl(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:Ei[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const o=e.getNextSortingOrder(),i=typeof n<"u"&&n!==null;t.setSorting(s=>{const a=s?.find(h=>h.id===e.id),l=s?.findIndex(h=>h.id===e.id);let c=[],u,f=i?n:o==="desc";if(s!=null&&s.length&&e.getCanMultiSort()&&r?a?u="toggle":u="add":s!=null&&s.length&&l!==s.length-1?u="replace":a?u="toggle":u="replace",u==="toggle"&&(i||o||(u="remove")),u==="add"){var d;c=[...s,{id:e.id,desc:f}],c.splice(0,c.length-((d=t.options.maxMultiSortColCount)!=null?d:Number.MAX_SAFE_INTEGER))}else u==="toggle"?c=s.map(h=>h.id===e.id?{...h,desc:f}:h):u==="remove"?c=s.filter(h=>h.id!==e.id):c=[{id:e.id,desc:f}];return c})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,o;const i=e.getFirstSortDir(),s=e.getIsSorted();return s?s!==i&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(o=t.options.enableMultiRemove)!=null)||o)?!1:s==="desc"?"asc":"desc":i},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(o=>o.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},yO=[$L,rO,ZL,QL,VL,jL,oO,iO,mO,XL,sO,aO,lO,cO,tO];function vO(e){var t,n;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const r=[...yO,...(t=e._features)!=null?t:[]];let o={_features:r};const i=o._features.reduce((d,h)=>Object.assign(d,h.getDefaultOptions==null?void 0:h.getDefaultOptions(o)),{}),s=d=>o.options.mergeOptions?o.options.mergeOptions(i,d):{...i,...d};let l={...{},...(n=e.initialState)!=null?n:{}};o._features.forEach(d=>{var h;l=(h=d.getInitialState==null?void 0:d.getInitialState(l))!=null?h:l});const c=[];let u=!1;const f={_features:r,options:{...i,...e},initialState:l,_queue:d=>{c.push(d),u||(u=!0,Promise.resolve().then(()=>{for(;c.length;)c.shift()();u=!1}).catch(h=>setTimeout(()=>{throw h})))},reset:()=>{o.setState(o.initialState)},setOptions:d=>{const h=ar(d,o.options);o.options=s(h)},getState:()=>o.options.state,setState:d=>{o.options.onStateChange==null||o.options.onStateChange(d)},_getRowId:(d,h,g)=>{var p;return(p=o.options.getRowId==null?void 0:o.options.getRowId(d,h,g))!=null?p:`${g?[g.id,h].join("."):h}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(d,h)=>{let g=(h?o.getPrePaginationRowModel():o.getRowModel()).rowsById[d];if(!g&&(g=o.getCoreRowModel().rowsById[d],!g))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${d}`):new Error;return g},_getDefaultColumnDef:ae(()=>[o.options.defaultColumn],d=>{var h;return d=(h=d)!=null?h:{},{header:g=>{const p=g.header.column.columnDef;return p.accessorKey?p.accessorKey:p.accessorFn?p.id:null},cell:g=>{var p,m;return(p=(m=g.renderValue())==null||m.toString==null?void 0:m.toString())!=null?p:null},...o._features.reduce((g,p)=>Object.assign(g,p.getDefaultColumnDef==null?void 0:p.getDefaultColumnDef()),{}),...d}},le(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>o.options.columns,getAllColumns:ae(()=>[o._getColumnDefs()],d=>{const h=function(g,p,m){return m===void 0&&(m=0),g.map(_=>{const y=IL(o,_,m,p),v=_;return y.columns=v.columns?h(v.columns,y,m+1):[],y})};return h(d)},le(e,"debugColumns","getAllColumns")),getAllFlatColumns:ae(()=>[o.getAllColumns()],d=>d.flatMap(h=>h.getFlatColumns()),le(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:ae(()=>[o.getAllFlatColumns()],d=>d.reduce((h,g)=>(h[g.id]=g,h),{}),le(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:ae(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(d,h)=>{let g=d.flatMap(p=>p.getLeafColumns());return h(g)},le(e,"debugColumns","getAllLeafColumns")),getColumn:d=>{const h=o._getAllFlatColumnsById()[d];return process.env.NODE_ENV!=="production"&&!h&&console.error(`[Table] Column with id '${d}' does not exist.`),h}};Object.assign(o,f);for(let d=0;d<o._features.length;d++){const h=o._features[d];h==null||h.createTable==null||h.createTable(o)}return o}function _O(){return e=>ae(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(o,i,s){i===void 0&&(i=0);const a=[];for(let c=0;c<o.length;c++){const u=DL(e,e._getRowId(o[c],c,s),o[c],c,i,void 0,s?.id);if(n.flatRows.push(u),n.rowsById[u.id]=u,a.push(u),e.options.getSubRows){var l;u.originalSubRows=e.options.getSubRows(o[c],c),(l=u.originalSubRows)!=null&&l.length&&(u.subRows=r(u.originalSubRows,i+1,u))}}return a};return n.rows=r(t),n},le(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function xO(e){const t=[],n=r=>{var o;t.push(r),(o=r.subRows)!=null&&o.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function bO(e){return t=>ae(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:o,pageIndex:i}=n;let{rows:s,flatRows:a,rowsById:l}=r;const c=o*i,u=c+o;s=s.slice(c,u);let f;t.options.paginateExpandedRows?f={rows:s,flatRows:a,rowsById:l}:f=xO({rows:s,flatRows:a,rowsById:l}),f.flatRows=[];const d=h=>{f.flatRows.push(h),h.subRows.length&&h.subRows.forEach(d)};return f.rows.forEach(d),f},le(t.options,"debugTable","getPaginationRowModel"))}function CO(){return e=>ae(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,o=[],i=r.filter(l=>{var c;return(c=e.getColumn(l.id))==null?void 0:c.getCanSort()}),s={};i.forEach(l=>{const c=e.getColumn(l.id);c&&(s[l.id]={sortUndefined:c.columnDef.sortUndefined,invertSorting:c.columnDef.invertSorting,sortingFn:c.getSortingFn()})});const a=l=>{const c=l.map(u=>({...u}));return c.sort((u,f)=>{for(let h=0;h<i.length;h+=1){var d;const g=i[h],p=s[g.id],m=p.sortUndefined,_=(d=g?.desc)!=null?d:!1;let y=0;if(m){const v=u.getValue(g.id),x=f.getValue(g.id),b=v===void 0,w=x===void 0;if(b||w){if(m==="first")return b?-1:1;if(m==="last")return b?1:-1;y=b&&w?0:b?m:-m}}if(y===0&&(y=p.sortingFn(u,f,g.id)),y!==0)return _&&(y*=-1),p.invertSorting&&(y*=-1),y}return u.index-f.index}),c.forEach(u=>{var f;o.push(u),(f=u.subRows)!=null&&f.length&&(u.subRows=a(u.subRows))}),c};return{rows:a(n.rows),flatRows:o,rowsById:n.rowsById}},le(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}function Uy(e,t){return e?wO(e)?N.createElement(e,t):e:null}function wO(e){return SO(e)||typeof e=="function"||EO(e)}function SO(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function EO(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function TO(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=N.useState(()=>({current:vO(t)})),[r,o]=N.useState(()=>n.current.initialState);return n.current.setOptions(i=>({...i,...e,state:{...r,...e.state},onStateChange:s=>{o(s),e.onStateChange==null||e.onStateChange(s)}})),n.current}const RO=e=>N.createElement("svg",{width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("style",null,`
|
|
48
|
-
@keyframes spin {
|
|
49
|
-
from {
|
|
50
|
-
transform: rotate(0deg)
|
|
51
|
-
}
|
|
52
|
-
to {
|
|
53
|
-
transform: rotate(360deg)
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
.spinner {
|
|
57
|
-
transform-origin: center
|
|
58
|
-
animation: spin 1s linear infinite
|
|
59
|
-
}
|
|
60
|
-
`),N.createElement("g",{className:"spinner"},N.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.0003 6.83317C13.5692 6.83317 11.2376 7.79894 9.51851 9.51803C7.79943 11.2371 6.83366 13.5687 6.83366 15.9998C6.83366 18.431 7.79943 20.7626 9.51851 22.4817C11.2376 24.2007 13.5692 25.1665 16.0003 25.1665C18.4315 25.1665 20.7631 24.2007 22.4821 22.4817C24.2012 20.7626 25.167 18.431 25.167 15.9998C25.167 13.5687 24.2012 11.2371 22.4821 9.51803C20.7631 7.79894 18.4315 6.83317 16.0003 6.83317ZM3.16699 15.9998C3.16699 8.91217 8.91266 3.1665 16.0003 3.1665C23.088 3.1665 28.8337 8.91217 28.8337 15.9998C28.8337 23.0875 23.088 28.8332 16.0003 28.8332C8.91266 28.8332 3.16699 23.0875 3.16699 15.9998Z",fill:"currentColor",fillOpacity:.12}),N.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.9997 6.83319C13.6363 6.82787 11.3633 7.74068 9.65999 9.37907C9.30711 9.70535 8.84021 9.88001 8.35982 9.86545C7.87943 9.85089 7.42396 9.64827 7.09149 9.30122C6.75902 8.95416 6.57612 8.49043 6.58218 8.00985C6.58823 7.52928 6.78276 7.07031 7.12388 6.73174C9.50956 4.43941 12.6912 3.16143 15.9997 3.16652C16.4859 3.16652 16.9522 3.35967 17.296 3.70349C17.6398 4.04731 17.833 4.51362 17.833 4.99985C17.833 5.48608 17.6398 5.9524 17.296 6.29621C16.9522 6.64003 16.4859 6.83319 15.9997 6.83319Z",fill:"currentColor"}))),kO=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("g",{clipPath:"url(#clip0_2074_3858)"},N.createElement("path",{d:"M21 21L16.65 16.65M19 11C19 15.4183 15.4183 19 11 19C6.58172 19 3 15.4183 3 11C3 6.58172 6.58172 3 11 3C15.4183 3 19 6.58172 19 11Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),N.createElement("defs",null,N.createElement("clipPath",{id:"clip0_2074_3858"},N.createElement("rect",{width:24,height:24,fill:"white"})))),AO="_table_19yhs_8",MO={table:AO},gb=C.forwardRef(({children:e,className:t,style:n,...r},o)=>S.jsx("td",{ref:o,className:z.cx(t),style:n,...r,children:e}));gb.displayName="TableBodyCell";const pb=C.forwardRef(({children:e,row:t=!0,justifyContent:n="flex-start",alignItems:r="center",py:o="var(--spacing-sm)",px:i="var(--spacing-md)",minHeight:s="56px",...a},l)=>S.jsx(q,{row:t,justifyContent:n,alignItems:r,py:o,px:i,minHeight:s,ref:l,...a,children:e}));pb.displayName="TableBodyCellContent";const mb=C.forwardRef(({children:e,className:t,showBorders:n=!1,isSelected:r=!1,...o},i)=>{const s=z.css({borderBottom:n?"1px solid var(--border-neutral-alpha-low)":"none"});return S.jsx("tr",{ref:i,className:z.cx(s,t),...o,children:e})});mb.displayName="TableBodyRow";const NO=C.forwardRef(({children:e,className:t,style:n,justifyContent:r="flex-start",alignItems:o="flex-start",...i},s)=>{const a=z.css({justifyContent:r,alignItems:o,fontWeight:"inherit"});return S.jsx("th",{ref:s,className:z.cx(a,t),style:n,...i,children:e})}),hh=C.forwardRef(({children:e,row:t=!0,justifyContent:n="flex-start",alignItems:r="center",py:o="var(--spacing-sm)",px:i="var(--spacing-md)",minHeight:s="56px",...a},l)=>S.jsx(q,{row:t,justifyContent:n,alignItems:r,py:o,px:i,minHeight:s,ref:l,...a,children:e}));hh.displayName="TableHeadCellContent";const PO=e=>N.createElement("svg",{width:10,height:6,viewBox:"0 0 10 6",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M8.75 0.75L4.75 4.75L0.75 0.75",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),FO=e=>N.createElement("svg",{width:10,height:6,viewBox:"0 0 10 6",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M8.75 4.75L4.75 0.75L0.75 4.75",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),LO=({sortDirection:e,gap:t="5px",...n})=>S.jsxs(q,{gap:t,...n,children:[S.jsx(FO,{style:{color:e==="asc"?"var(--icon-accent)":"var(--icon-tertiary)"}}),S.jsx(PO,{style:{color:e==="desc"?"var(--icon-accent)":"var(--icon-tertiary)"}})]}),yb=({children:e,tableProps:t,gap:n="10px",...r})=>{const o=t.column.getIsSorted();return S.jsxs(hh,{style:{cursor:"pointer",userSelect:"none"},gap:n,...r,children:[e,S.jsx(LO,{sortDirection:o})]})};yb.displayName="TableHeadCellContentSortable";const vb=C.forwardRef(({children:e,className:t,showBorders:n=!1,...r},o)=>{const i=z.css({backgroundColor:"var(--fill-bg-secondary)",borderBottom:n?"1px solid var(--border-neutral-alpha-low)":"none"});return S.jsx("tr",{ref:o,className:z.cx(i,t),...r,children:e})});vb.displayName="TableHeadRow";const OO=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M15 18L9 12L15 6",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),IO=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M9 18L15 12L9 6",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),$O=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M12 13C12.5523 13 13 12.5523 13 12C13 11.4477 12.5523 11 12 11C11.4477 11 11 11.4477 11 12C11 12.5523 11.4477 13 12 13Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),N.createElement("path",{d:"M19 13C19.5523 13 20 12.5523 20 12C20 11.4477 19.5523 11 19 11C18.4477 11 18 11.4477 18 12C18 12.5523 18.4477 13 19 13Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),N.createElement("path",{d:"M5 13C5.55228 13 6 12.5523 6 12C6 11.4477 5.55228 11 5 11C4.44772 11 4 11.4477 4 12C4 12.5523 4.44772 13 5 13Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),Yc=(e,t)=>{const n=t-e+1;return Array.from({length:n},(r,o)=>e+o)};function DO(e){const{count:t=1,page:n,maxVisiblePages:r=10}=e;let o=1,i=1;if(r<=2)return[n];r<=4?(o=0,i=0):r<=6?(o=1,i=0):r<=7?(o=1,i=Math.max(0,Math.floor((r-4)/2))):(o=1,i=Math.max(1,Math.floor((r-5)/2)));const s=Yc(1,Math.min(o,t)),a=Yc(Math.max(t-o+1,o+1),t),l=Math.max(Math.min(n-i,t-o-i*2-1),o+2),c=Math.min(Math.max(n+i,o+i*2+2),t-o-1);return[...s,...l>o+2?["start-dots"]:o+1<t-o?[o+1]:[],...Yc(l,c),...c<t-o-1?["end-dots"]:t-o>o?[t-o]:[],...a]}const VO=({pageIndex:e,pageSize:t,totalCount:n,onPageChange:r,onPageSizeChange:o,pageSizeOptions:i=[10,20,50,100],showPageSizeSelector:s=!0,renderPageSizeSelectorDropdownItem:a=c=>c.label,renderPageSizeSelectorInputItem:l})=>{const c=C.useRef(null),[u,f]=C.useState(0),d=Math.ceil(n/t),h=e>0,g=e<d-1;C.useEffect(()=>{const b=c.current;if(!b)return;const w=new ResizeObserver(T=>{for(const E of T)f(E.contentRect.width)});return w.observe(b),()=>{w.disconnect()}},[]);const m=(b=>{if(b<=0)return 1;const M=b-96;if(M<=40)return 1;const O=Math.floor((M+8)/48);return Math.max(1,Math.min(10,O))})(u),_=DO({page:e+1,count:d,maxVisiblePages:m}),y=()=>{h&&r(e-1)},v=()=>{g&&r(e+1)},x=b=>{o(Number(b))};return n===0?null:S.jsxs(q,{flex:1,row:!0,justifyContent:"space-between",children:[S.jsxs(q,{ref:c,flex:1,row:!0,overflow:"hidden",gap:"var(--spacing-sm)",children:[S.jsx(Kn,{onClick:y,disabled:!h,color:"neutral",size:"sm",children:S.jsx(OO,{})}),S.jsx(q,{row:!0,gap:"var(--spacing-sm)",children:_.map(b=>S.jsx(jO,{isDots:b==="start-dots"||b==="end-dots",isCurrentPage:b===e+1,disabled:b==="start-dots"||b==="end-dots",onClick:()=>r(b-1),children:b},b))}),S.jsx(Kn,{color:"neutral",size:"sm",onClick:v,disabled:!g,children:S.jsx(IO,{})})]}),s&&S.jsx(q,{alignItems:"flex-end",children:S.jsx(ch,{width:"fit-content",value:t.toString(),size:"sm",items:i.map(b=>({value:b.toString(),label:b.toString()})),returnedValue:b=>b.value,renderDropdownItem:a,renderSingleInputItem:l,onChange:b=>x(b)})})]})},jO=({children:e,isCurrentPage:t=!1,onClick:n,isDots:r=!1,disabled:o=!1})=>{const i=z.css({cursor:o?"not-allowed":"pointer",userSelect:"none",width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:t?"var(--fill-accent-secondary)":"var(--fill-bg-secondary)",borderRadius:"var(--corner-sm)",border:t?"1px solid var(--fill-accent-secondary-hover)":"1px solid var(--border-neutral-alpha-basic)"}),s=z.css({width:"24px",height:"24px",color:t?"var(--icon-secondary)":"var(--icon-tertiary)"});return S.jsx(q,{className:i,onClick:o?void 0:n,children:r?S.jsx($O,{className:s}):S.jsx(ce,{center:!0,variant:"body-2",fontWeight:"medium",children:e})})},BO=z.css({position:"relative",borderRadius:"var(--corner-md)",overflow:"hidden","&::before, &::after":{content:'""',position:"absolute",top:0,bottom:14,width:96,pointerEvents:"none",zIndex:1,transition:"opacity 0.2s ease"},"&::before":{left:0,background:"linear-gradient(to left, rgba(255, 255, 255, 0.00) 0%, #FFF 100%)"},"&::after":{right:0,background:"linear-gradient(to right, rgba(255, 255, 255, 0.00) 0%, #FFF 100%)"}}),zO=z.css({overflowX:"auto",scrollbarWidth:"thin",scrollbarColor:"var(--gray-86) var(--gray-96)"}),_b=C.memo(({data:e,children:t,className:n,showBorders:r=!1,...o})=>{const[i,s]=C.useState(!1),[a,l]=C.useState(!1),c=C.useRef(null),u=C.useCallback(()=>{const d=c.current;if(!d)return;const{scrollLeft:h,scrollWidth:g,clientWidth:p}=d,m=g>p;s(m&&h>0),l(m&&h<g-p-1)},[]);C.useEffect(()=>{const d=c.current;if(!d)return;u();const h=new ResizeObserver(u);return h.observe(d),d.addEventListener("scroll",u),()=>{h.disconnect(),d.removeEventListener("scroll",u)}},[u,e]);const f=z.css({border:r?"1px solid var(--border-neutral-alpha-low)":"transparent","&::before":{opacity:i?1:0},"&::after":{opacity:a?1:0}});return S.jsx(q,{className:z.cx(BO,f,n),...o,children:S.jsx(q,{ref:c,className:zO,children:t})})});_b.displayName="TableWrapper";const WO=z.css({width:"100%",maxWidth:"100%",minWidth:"max-content",borderCollapse:"collapse",borderSpacing:0,backgroundColor:"var(--fill-bg-primary)"}),HO=z.css({backgroundColor:"var(--fill-bg-secondary)",color:"var(--text-tertiary)"}),gi=({ref:e,data:t,columns:n,showBorders:r=!0,enableSorting:o=!1,enablePagination:i=!1,enableRowSelection:s=!1,enableMultiRowSelection:a=!1,sorting:l,onSortingChange:c,columnFilters:u,onColumnFiltersChange:f,columnVisibility:d,onColumnVisibilityChange:h,pagination:g,onPaginationChange:p,rowSelection:m,onRowSelectionChange:_,totalCount:y,loading:v=!1,emptyLabels:x={title:"Nothing found",description:"No results found for “result”",action:"Reset"},loadingLabels:b={title:"Loading...",description:"Please wait or reset your promt",action:"Reset"},className:w,containerClassName:T,tableOptions:E={},onRowClick:R,getRowId:M,headCellComponent:O=NO,bodyCellComponent:D=gb,headRowComponent:I=vb,bodyRowComponent:L=mb,onReset:B,renderPageSizeSelectorDropdownItem:K,renderPageSizeSelectorInputItem:P})=>{const[A,$]=C.useState([]),[H,Q]=C.useState([]),[J,X]=C.useState({}),[se,re]=C.useState({pageIndex:0,pageSize:10}),[he,we]=C.useState({}),te=l??A,ye=u??H,Se=d??J,$e=g??se,ee=m??he,pe=ve=>{const Re=typeof ve=="function"?ve(te):ve;c?c(Re):$(Re)},Ne=ve=>{const Re=typeof ve=="function"?ve(ye):ve;f?f(Re):Q(Re)},Ze=ve=>{const Re=typeof ve=="function"?ve(Se):ve;h?h(Re):X(Re)},Le=ve=>{const Re=typeof ve=="function"?ve($e):ve;p?p(Re):re(Re)},hn=TO({data:t,columns:n,state:{sorting:te,columnFilters:ye,columnVisibility:Se,pagination:$e,rowSelection:ee},onSortingChange:pe,onColumnFiltersChange:Ne,onColumnVisibilityChange:Ze,onPaginationChange:Le,onRowSelectionChange:ve=>{const Re=typeof ve=="function"?ve(ee):ve;_?_(Re):we(Re)},getCoreRowModel:_O(),getSortedRowModel:o?CO():void 0,getPaginationRowModel:i?bO():void 0,enableRowSelection:s,enableMultiRowSelection:a,getRowId:M,manualPagination:!!y,pageCount:y?Math.ceil(y/$e.pageSize):void 0,...E});C.useImperativeHandle(e,()=>hn);const{rows:gn}=hn.getRowModel(),Dt=(ve,Re)=>{R&&R(ve.original,Re)};return v?S.jsxs(q,{w:"full",borderRadius:"var(--corner-md)",py:"var(--spacing-5xl)",px:"var(--spacing-10xl)",alignItems:"center",className:z.cx(T),children:[S.jsx(RO,{width:32,height:32,style:{color:"var(--icon-tertiary)",marginBottom:"var(--spacing-sm)"}}),S.jsx(ce,{mb:"var(--spacing-xs)",variant:"title-3",fontWeight:"semibold",children:b.title}),S.jsx(ce,{mb:"var(--spacing-md)",colorName:"tertiary",variant:"body-1",fontWeight:"medium",children:b.description}),typeof b.action=="string"?S.jsx(Go,{width:"auto",onClick:B,intensity:"secondary",color:"accent",children:b.action}):b.action]}):gn.length?S.jsxs(q,{w:"full",gap:"var(--spacing-xl)",className:z.cx(T),children:[S.jsx(_b,{data:t,showBorders:r,children:S.jsxs("table",{className:z.cx(WO,MO.table,w),children:[S.jsx("thead",{className:HO,children:hn.getHeaderGroups().map(ve=>S.jsx(I,{showBorders:r,children:ve.headers.map(Re=>S.jsx(O,{style:{width:Re.getSize()},onClick:Re.column.getToggleSortingHandler(),children:Re.isPlaceholder?null:Uy(Re.column.columnDef.header,Re.getContext())},Re.id))},ve.id))}),S.jsx("tbody",{children:gn.map((ve,Re)=>S.jsx(L,{showBorders:r,isSelected:ve.getIsSelected(),onClick:()=>Dt(ve,Re),children:ve.getVisibleCells().map(Vt=>S.jsx(D,{children:Uy(Vt.column.columnDef.cell,Vt.getContext())},Vt.id))},ve.id))})]})}),i&&!v&&S.jsx(VO,{pageIndex:$e.pageIndex,pageSize:$e.pageSize,totalCount:y||t.length,renderPageSizeSelectorDropdownItem:K,renderPageSizeSelectorInputItem:P,onPageChange:ve=>Le({...$e,pageIndex:ve}),onPageSizeChange:ve=>Le({...$e,pageSize:ve,pageIndex:0})})]}):S.jsxs(q,{w:"full",borderRadius:"var(--corner-md)",py:"var(--spacing-5xl)",px:"var(--spacing-10xl)",alignItems:"center",className:z.cx(T),children:[S.jsx(kO,{width:24,height:24,style:{color:"var(--icon-tertiary)",marginBottom:"var(--spacing-sm)"}}),S.jsx(ce,{mb:"var(--spacing-xs)",variant:"title-3",fontWeight:"semibold",children:x.title}),S.jsx(ce,{mb:"var(--spacing-md)",colorName:"tertiary",variant:"body-1",fontWeight:"medium",children:x.description}),typeof x.action=="string"?S.jsx(Go,{width:"auto",onClick:B,intensity:"secondary",color:"accent",children:x.action}):x.action]})};gi.displayName="Table";gi.HeadCellContent=hh;gi.BodyCellContent=pb;gi.HeadCellContentSortable=yb;gi.createColumnHelper=ob;const Xc={chart:{type:"areaspline",backgroundColor:"transparent",spacing:[0,0,0,0],margin:[0,0,0,0]},xAxis:{gridLineWidth:0,lineWidth:0,tickWidth:0,labels:{enabled:!1},title:{text:""}},yAxis:{gridLineWidth:0,lineWidth:0,tickWidth:0,labels:{enabled:!1},title:{text:""}},legend:{enabled:!1},credits:{enabled:!1}},KO={positive:{color:"var(--fill-positive-primary)",fillColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,"var(--fill-positive-tint-high)"],[1,"var(--fill-positive-transparent)"]]}},negative:{color:"var(--fill-negative-primary)",fillColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,"var(--fill-negative-tint-high)"],[1,"var(--fill-negative-transparent)"]]}},accent:{color:"var(--fill-accent-primary)",fillColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,"var(--fill-accent-tint-high)"],[1,"var(--fill-accent-transparent)"]]}},warning:{color:"var(--fill-warning-primary)",fillColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,"var(--fill-warning-tint-high)"],[1,"var(--fill-warning-transparent)"]]}}},UO=(e,t,n,r,o)=>({...Xc,plotOptions:{areaspline:{marker:{enabled:!1,states:{hover:{enabled:o}}},allowPointSelect:!1}},xAxis:{...Xc.xAxis,...n},yAxis:{...Xc.yAxis,...r},series:[{type:"areaspline",data:t,...KO[e]}]}),GO=e=>({outside:!0,enabled:!!e,padding:0,position:{alignByTranslate:!0},shadow:{color:"var(--effect-shadow-m)",offsetX:0,offsetY:0},borderRadius:8,backgroundColor:"var(--fill-bg-primary)",useHTML:!0,...e}),xb=({color:e="positive",data:t=[],xAxis:n,yAxis:r,containerProps:o,highcharts:i,tooltip:s})=>{const a=C.useRef(null);C.useEffect(()=>()=>{typeof a=="object"&&a?.current?.chart&&a.current.chart.destroy()},[]);const l=C.useMemo(()=>UO(e,t,n,r,!!s),[e,t,n,r,s]),c=C.useMemo(()=>s?GO(s):{enabled:!1},[s]);return S.jsx(da.Chart,{highcharts:i,ref:a,options:l,containerProps:o,children:S.jsx(da.Tooltip,{...c})})};xb.displayName="LineChart";const qO={chart:{type:"pie",backgroundColor:"transparent",spacing:[0,0,0,0],margin:[0,0,0,0],events:{click:void 0}},title:{align:"center",verticalAlign:"middle",floating:!0,style:{fontSize:"24px",fontWeight:"600",color:"var(--text-primary)"}},plotOptions:{pie:{allowPointSelect:!0,cursor:"pointer",dataLabels:{enabled:!1},startAngle:90,endAngle:-90,innerSize:"90%",borderWidth:0,states:{hover:{enabled:!1},select:{enabled:!1},inactive:{enabled:!1}},enableMouseTracking:!1}},tooltip:{enabled:!1},legend:{enabled:!1},credits:{enabled:!1}},YO={positive:{colors:["var(--fill-positive-primary)","var(--fill-positive-tint-high)"]},negative:{colors:["var(--fill-negative-primary)","var(--fill-negative-tint-high)"]},accent:{colors:["var(--fill-accent-primary)","var(--fill-accent-tint-high)"]},warning:{colors:["var(--fill-warning-primary)","var(--fill-warning-tint-high)"]}},XO=(e,t)=>({...qO,series:[{type:"pie",data:[{name:"",y:Math.min(e,100)},{name:"",y:Math.max(100-e,0)}],...YO[t]}]}),bb=C.forwardRef(({highcharts:e,color:t="positive",percentage:n,label:r=s=>`${s}%`,containerProps:o},i)=>{const s=C.useRef(null),a=i||s;C.useEffect(()=>()=>{typeof a=="object"&&a?.current?.chart&&a.current.chart.destroy()},[a]);const l=C.useMemo(()=>XO(n,t),[n,t]);return S.jsx(da.Chart,{highcharts:e,ref:a,options:l,containerProps:o,children:S.jsx(da.Title,{children:r?.(n)})})});bb.displayName="PieProgressChart";const JO=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M9 17L14 12L9 7",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),ZO="_link_aolvt_8",QO="_separator_aolvt_19",e5="_nav_aolvt_23",ua={link:ZO,separator:QO,nav:e5,"nav-item":"_nav-item_aolvt_29"},gh=({children:e,separator:t=S.jsx(JO,{className:ua.separator})})=>{const n=C.Children.toArray(e).filter(r=>C.isValidElement(r));return S.jsx("nav",{"aria-label":"breadcrumb",className:ua.nav,children:n.map((r,o)=>{const i=o===n.length-1;return S.jsxs(ce,{tag:"span",className:ua["nav-item"],children:[C.cloneElement(r,{active:r.props.active??i}),!i&&t]},o)})})},t5=({children:e,href:t,active:n,className:r,activeClassName:o,activeElement:i,onClick:s})=>n?i||S.jsx(ce,{tag:"span",variant:"body-2",fontWeight:"medium",colorName:"primary",className:z.cx(r,o),onClick:s,children:e}):S.jsx("a",{href:t,className:z.cx(ua.link,r),onClick:s,children:e});gh.Item=t5;gh.displayName="Breadcrumbs";const n5=gh,r5={primary:{bg:"var(--fill-accent-tint)",text:"var(--text-accent)",icon:"var(--icon-accent)"},secondary:{bg:"var(--fill-neutral-tint)",text:"var(--text-secondary)",icon:"var(--icon-tertiary)"},negative:{bg:"var(--fill-negative-tint)",text:"var(--text-negative)",icon:"var(--icon-negative)"},positive:{bg:"var(--fill-positive-tint)",text:"var(--text-positive)",icon:"var(--icon-positive)"},warning:{bg:"var(--fill-warning-tint)",text:"var(--text-warning)",icon:"var(--icon-warning)"},neutral:{bg:"var(--fill-neutral-tint)",text:"var(--text-tertiary)",icon:"var(--icon-tertiary)"},custom:{bg:"var(--fill-accent-tint)",text:"var(--text-accent)",icon:"var(--icon-accent)"}},o5={"2xs":{size:"var(--height-avatar-2xs)",borderRadius:"var(--corner-xs)",iconSize:"var(--height-icon-2xs)",fontSize:"var(--font-size-caption-2)",fontWeight:"var(--font-weight-medium)"},xs:{size:"var(--height-avatar-xs)",borderRadius:"var(--corner-sm)",iconSize:"var(--height-icon-xs)",fontSize:"var(--font-size-caption-1)",fontWeight:"var(--font-weight-medium)"},sm:{size:"var(--height-avatar-sm)",borderRadius:"var(--corner-sm)",iconSize:"var(--height-icon-xs)",fontSize:"var(--font-size-body-2)",fontWeight:"var(--font-weight-medium)"},md:{size:"var(--height-avatar-md)",borderRadius:"var(--corner-sm)",iconSize:"var(--height-icon-sm)",fontSize:"var(--font-size-body-2)",fontWeight:"var(--font-weight-medium)"},lg:{size:"var(--height-avatar-lg)",borderRadius:"var(--corner-md)",iconSize:"var(--height-icon-md)",fontSize:"var(--font-size-body-1)",fontWeight:"var(--font-weight-semibold)"},xl:{size:"var(--height-avatar-xl)",borderRadius:"var(--corner-md)",iconSize:"var(--height-icon-md)",fontSize:"var(--font-size-body-1)",fontWeight:"var(--font-weight-semibold)"},"2xl":{size:"var(--height-avatar-2xl)",borderRadius:"var(--corner-md)",iconSize:"var(--height-icon-md)",fontSize:"var(--font-size-headline-2)",fontWeight:"var(--font-weight-medium)"},custom:{size:"var(--height-avatar-md)",borderRadius:"var(--corner-sm)",iconSize:"var(--height-icon-sm)",fontSize:"var(--font-size-body-2)",fontWeight:"var(--font-weight-medium)"}},Cb=C.forwardRef(({children:e,color:t="primary",size:n="md",fullRound:r=!1,className:o},i)=>{const s=C.useMemo(()=>r5[t],[t]),a=C.useMemo(()=>o5[n],[n]),l=C.useMemo(()=>z.css({width:a.size,height:a.size,borderRadius:r?"var(--corner-full-round)":a.borderRadius,backgroundColor:s.bg,color:s.text,fontSize:a.fontSize,fontWeight:a.fontWeight,lineHeight:1,transition:"var(--transition-general)","& svg":{width:a.iconSize,height:a.iconSize,color:s.icon,transition:"var(--transition-general)"},"& img":{width:"100%",height:"100%",objectFit:"cover"},"&:has(img)":{backgroundColor:"transparent",border:"1px solid var(--border-neutral-alpha-low)"}}),[s,a,r]);return S.jsx(q,{ref:i,center:!0,overflow:"hidden",className:z.cx(l,o),children:e})});Cb.displayName="Avatar";const vd={neutral:{border:"var(--border-neutral-alpha-low)",bg:"var(--status-neutral-tint)",color:"var(--text-secondary)",colorName:"secondary"},accent:{border:"var(--border-accent-secondary)",bg:"var(--status-accent-tint-low)",color:"var(--text-accent)",colorName:"accent"},warning:{border:"var(--border-warning-secondary)",bg:"var(--status-warning-tint-low)",color:"var(--text-warning)",colorName:"warning"},positive:{border:"var(--border-positive-secondary)",bg:"var(--status-positive-tint-low)",color:"var(--text-positive)",colorName:"positive"},negative:{border:"var(--border-negative-secondary)",bg:"var(--status-negative-tint-low)",color:"var(--text-negative)",colorName:"negative"}},Xs={sm:{h:24,text:"caption-1",corner:"var(--corner-xs)",p:"6px var(--spacing-sm)"},md:{h:32,text:"body-2",corner:"var(--corner-sm)",p:"6px var(--spacing-md)"},lg:{h:40,text:"body-2",corner:"var(--corner-md)",p:"6px var(--spacing-lg)"}},i5=(e,t,n,r)=>{const o=vd[t];let i=o.bg,s="none";const a=o.color;switch(e){case"outline":i="transparent",s=`1px solid ${o.border}`;break;case"clear":i="transparent";break;default:i=o.bg;break}return z.css({cursor:n?"not-allowed":r?"pointer":"default",opacity:n?.5:1,userSelect:"none",position:"relative",transition:"background-color 0.2s, opacity 0.2s",backgroundColor:i,color:a,border:s})},s5=z.css({display:"inline-flex",cursor:"pointer",opacity:.6,"&:hover":{opacity:1}}),wb=({label:e,color:t="neutral",size:n="md",variant:r="filled",leftElement:o,rightElement:i,disabled:s,onClick:a,onDelete:l,className:c})=>{const u=i5(r,t,s,a);return S.jsxs(q,{row:!0,alignItems:"center",gap:"var(--spacing-sm)",p:Xs[n].p,h:Xs[n].h,overflow:"hidden",borderRadius:Xs[n].corner,onClick:a,className:z.cx(u,c),children:[a&&S.jsx(io,{}),o,S.jsx(ce,{variant:Xs[n].text,colorName:vd[t].colorName,textOverflow:"ellipsis",children:e}),i,l&&!s&&S.jsx(ce,{className:s5,colorName:vd[t].colorName,onClick:f=>{f.stopPropagation(),l(f)},children:S.jsx(J1,{})})]})};wb.displayName="Badge";const a5=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("circle",{cx:12,cy:12,r:10,fill:"currentColor",fillOpacity:.15}),N.createElement("path",{d:"M16 9L10.0337 15L8 12.9548",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),Gy=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z",fill:"currentColor",fillOpacity:.15}),N.createElement("path",{d:"M12 6C11.4477 6 11 6.44772 11 7V13C11 13.5523 11.4477 14 12 14C12.5523 14 13 13.5523 13 13V7C13 6.44772 12.5523 6 12 6Z",fill:"currentColor"}),N.createElement("path",{d:"M12 15C11.4477 15 11 15.4477 11 16V17C11 17.5523 11.4477 18 12 18C12.5523 18 13 17.5523 13 17V16C13 15.4477 12.5523 15 12 15Z",fill:"currentColor"})),l5=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("circle",{cx:12,cy:12,r:10,fill:"currentColor",fillOpacity:.12}),N.createElement("path",{d:"M16 8L8 16M16 16L8 8",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"})),c5=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:"black",...e},N.createElement("path",{d:"M12 2V22M19.0711 4.92893L4.92893 19.0711M22 12H2M19.0711 19.0711L4.92893 4.92893",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),u5="_hint_4a6nb_8",d5="_md_4a6nb_19",f5="_sm_4a6nb_24",h5="_icon_4a6nb_29",g5="_content_4a6nb_40",p5="_title_4a6nb_46",m5="_subtitle_4a6nb_51",y5="_disabled_4a6nb_57",v5="_warning_4a6nb_62",_5="_solid_4a6nb_62",x5="_negative_4a6nb_67",b5="_positive_4a6nb_72",C5="_accent_4a6nb_77",w5="_neutral_4a6nb_82",S5="_soft_4a6nb_87",Zt={hint:u5,md:d5,sm:f5,icon:h5,content:g5,title:p5,subtitle:m5,disabled:y5,warning:v5,solid:_5,negative:x5,positive:b5,accent:C5,neutral:w5,soft:S5},E5={negative:S.jsx(l5,{}),positive:S.jsx(a5,{}),accent:S.jsx(Gy,{}),warning:S.jsx(Gy,{}),neutral:S.jsx(c5,{})},T5=({title:e,subtitle:t,color:n="warning",variant:r="soft",size:o="md",icon:i,disabled:s=!1,className:a,style:l})=>{const c=i||E5[n];return S.jsxs("div",{className:Pi(Zt.hint,Zt[n],Zt[r],Zt[o],s&&Zt.disabled,a),style:l,"aria-disabled":s,children:[c&&S.jsx("span",{className:Zt.icon,children:c}),S.jsxs("div",{className:Zt.content,children:[e&&S.jsx(ce,{className:Pi(Zt.title,fa(Zt,"title",o)),variant:o==="md"?"body-1":"caption-2",children:e}),t&&S.jsx(ce,{className:Pi(Zt.subtitle,fa(Zt,"subtitle",o)),variant:o==="md"?"body-2":"caption-1",children:t})]})]})},R5=z.keyframes`
|
|
47
|
+
color: hsl(${Math.max(0,Math.min(120-120*d,120))}deg 100% 31%);`,n?.key)}return o}}function le(e,t,n,r){return{debug:()=>{var o;return(o=e?.debugAll)!=null?o:e[t]},key:process.env.NODE_ENV==="development"&&n,onChange:r}}function LL(e,t,n,r){const o=()=>{var s;return(s=i.getValue())!=null?s:e.options.renderFallbackValue},i={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:o,getContext:ae(()=>[e,n,t,i],(s,a,l,c)=>({table:s,column:a,row:l,cell:c,getValue:c.getValue,renderValue:c.renderValue}),le(e.options,"debugCells","cell.getContext"))};return e._features.forEach(s=>{s.createCell==null||s.createCell(i,n,t,e)},{}),i}function OL(e,t,n,r){var o,i;const a={...e._getDefaultColumnDef(),...t},l=a.accessorKey;let c=(o=(i=a.id)!=null?i:l?typeof String.prototype.replaceAll=="function"?l.replaceAll(".","_"):l.replace(/\./g,"_"):void 0)!=null?o:typeof a.header=="string"?a.header:void 0,u;if(a.accessorFn?u=a.accessorFn:l&&(l.includes(".")?u=d=>{let h=d;for(const p of l.split(".")){var g;h=(g=h)==null?void 0:g[p],process.env.NODE_ENV!=="production"&&h===void 0&&console.warn(`"${p}" in deeply nested key "${l}" returned undefined.`)}return h}:u=d=>d[a.accessorKey]),!c)throw process.env.NODE_ENV!=="production"?new Error(a.accessorFn?"Columns require an id when using an accessorFn":"Columns require an id when using a non-string header"):new Error;let f={id:`${String(c)}`,accessorFn:u,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:ae(()=>[!0],()=>{var d;return[f,...(d=f.columns)==null?void 0:d.flatMap(h=>h.getFlatColumns())]},le(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:ae(()=>[e._getOrderColumnsFn()],d=>{var h;if((h=f.columns)!=null&&h.length){let g=f.columns.flatMap(p=>p.getLeafColumns());return d(g)}return[f]},le(e.options,"debugColumns","column.getLeafColumns"))};for(const d of e._features)d.createColumn==null||d.createColumn(f,e);return f}const ht="debugHeaders";function Hy(e,t,n){var r;let i={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const s=[],a=l=>{l.subHeaders&&l.subHeaders.length&&l.subHeaders.map(a),s.push(l)};return a(i),s},getContext:()=>({table:e,header:i,column:t})};return e._features.forEach(s=>{s.createHeader==null||s.createHeader(i,e)}),i}const IL={createTable:e=>{e.getHeaderGroups=ae(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>{var i,s;const a=(i=r?.map(f=>n.find(d=>d.id===f)).filter(Boolean))!=null?i:[],l=(s=o?.map(f=>n.find(d=>d.id===f)).filter(Boolean))!=null?s:[],c=n.filter(f=>!(r!=null&&r.includes(f.id))&&!(o!=null&&o.includes(f.id)));return Gs(t,[...a,...c,...l],e)},le(e.options,ht,"getHeaderGroups")),e.getCenterHeaderGroups=ae(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>(n=n.filter(i=>!(r!=null&&r.includes(i.id))&&!(o!=null&&o.includes(i.id))),Gs(t,n,e,"center")),le(e.options,ht,"getCenterHeaderGroups")),e.getLeftHeaderGroups=ae(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var o;const i=(o=r?.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?o:[];return Gs(t,i,e,"left")},le(e.options,ht,"getLeftHeaderGroups")),e.getRightHeaderGroups=ae(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var o;const i=(o=r?.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?o:[];return Gs(t,i,e,"right")},le(e.options,ht,"getRightHeaderGroups")),e.getFooterGroups=ae(()=>[e.getHeaderGroups()],t=>[...t].reverse(),le(e.options,ht,"getFooterGroups")),e.getLeftFooterGroups=ae(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),le(e.options,ht,"getLeftFooterGroups")),e.getCenterFooterGroups=ae(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),le(e.options,ht,"getCenterFooterGroups")),e.getRightFooterGroups=ae(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),le(e.options,ht,"getRightFooterGroups")),e.getFlatHeaders=ae(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),le(e.options,ht,"getFlatHeaders")),e.getLeftFlatHeaders=ae(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),le(e.options,ht,"getLeftFlatHeaders")),e.getCenterFlatHeaders=ae(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),le(e.options,ht,"getCenterFlatHeaders")),e.getRightFlatHeaders=ae(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),le(e.options,ht,"getRightFlatHeaders")),e.getCenterLeafHeaders=ae(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),le(e.options,ht,"getCenterLeafHeaders")),e.getLeftLeafHeaders=ae(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),le(e.options,ht,"getLeftLeafHeaders")),e.getRightLeafHeaders=ae(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),le(e.options,ht,"getRightLeafHeaders")),e.getLeafHeaders=ae(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var o,i,s,a,l,c;return[...(o=(i=t[0])==null?void 0:i.headers)!=null?o:[],...(s=(a=n[0])==null?void 0:a.headers)!=null?s:[],...(l=(c=r[0])==null?void 0:c.headers)!=null?l:[]].map(u=>u.getLeafHeaders()).flat()},le(e.options,ht,"getLeafHeaders"))}};function Gs(e,t,n,r){var o,i;let s=0;const a=function(d,h){h===void 0&&(h=1),s=Math.max(s,h),d.filter(g=>g.getIsVisible()).forEach(g=>{var p;(p=g.columns)!=null&&p.length&&a(g.columns,h+1)},0)};a(e);let l=[];const c=(d,h)=>{const g={depth:h,id:[r,`${h}`].filter(Boolean).join("_"),headers:[]},p=[];d.forEach(m=>{const _=[...p].reverse()[0],y=m.column.depth===g.depth;let v,x=!1;if(y&&m.column.parent?v=m.column.parent:(v=m.column,x=!0),_&&_?.column===v)_.subHeaders.push(m);else{const b=Hy(n,v,{id:[r,h,v.id,m?.id].filter(Boolean).join("_"),isPlaceholder:x,placeholderId:x?`${p.filter(w=>w.column===v).length}`:void 0,depth:h,index:p.length});b.subHeaders.push(m),p.push(b)}g.headers.push(m),m.headerGroup=g}),l.push(g),h>0&&c(p,h-1)},u=t.map((d,h)=>Hy(n,d,{depth:s,index:h}));c(u,s-1),l.reverse();const f=d=>d.filter(g=>g.column.getIsVisible()).map(g=>{let p=0,m=0,_=[0];g.subHeaders&&g.subHeaders.length?(_=[],f(g.subHeaders).forEach(v=>{let{colSpan:x,rowSpan:b}=v;p+=x,_.push(b)})):p=1;const y=Math.min(..._);return m=m+y,g.colSpan=p,g.rowSpan=m,{colSpan:p,rowSpan:m}});return f((o=(i=l[0])==null?void 0:i.headers)!=null?o:[]),l}const $L=(e,t,n,r,o,i,s)=>{let a={id:t,index:r,original:n,depth:o,parentId:s,_valuesCache:{},_uniqueValuesCache:{},getValue:l=>{if(a._valuesCache.hasOwnProperty(l))return a._valuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return a._valuesCache[l]=c.accessorFn(a.original,r),a._valuesCache[l]},getUniqueValues:l=>{if(a._uniqueValuesCache.hasOwnProperty(l))return a._uniqueValuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return c.columnDef.getUniqueValues?(a._uniqueValuesCache[l]=c.columnDef.getUniqueValues(a.original,r),a._uniqueValuesCache[l]):(a._uniqueValuesCache[l]=[a.getValue(l)],a._uniqueValuesCache[l])},renderValue:l=>{var c;return(c=a.getValue(l))!=null?c:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>FL(a.subRows,l=>l.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let l=[],c=a;for(;;){const u=c.getParentRow();if(!u)break;l.push(u),c=u}return l.reverse()},getAllCells:ae(()=>[e.getAllLeafColumns()],l=>l.map(c=>LL(e,a,c,c.id)),le(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:ae(()=>[a.getAllCells()],l=>l.reduce((c,u)=>(c[u.column.id]=u,c),{}),le(e.options,"debugRows","getAllCellsByColumnId"))};for(let l=0;l<e._features.length;l++){const c=e._features[l];c==null||c.createRow==null||c.createRow(a,e)}return a},DL={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},ib=(e,t,n)=>{var r,o;const i=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((o=e.getValue(t))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(i))};ib.autoRemove=e=>on(e);const sb=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};sb.autoRemove=e=>on(e);const ab=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===n?.toLowerCase()};ab.autoRemove=e=>on(e);const lb=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};lb.autoRemove=e=>on(e);const cb=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});cb.autoRemove=e=>on(e)||!(e!=null&&e.length);const ub=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});ub.autoRemove=e=>on(e)||!(e!=null&&e.length);const db=(e,t,n)=>e.getValue(t)===n;db.autoRemove=e=>on(e);const fb=(e,t,n)=>e.getValue(t)==n;fb.autoRemove=e=>on(e);const uh=(e,t,n)=>{let[r,o]=n;const i=e.getValue(t);return i>=r&&i<=o};uh.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,o=typeof n!="number"?parseFloat(n):n,i=t===null||Number.isNaN(r)?-1/0:r,s=n===null||Number.isNaN(o)?1/0:o;if(i>s){const a=i;i=s,s=a}return[i,s]};uh.autoRemove=e=>on(e)||on(e[0])&&on(e[1]);const $n={includesString:ib,includesStringSensitive:sb,equalsString:ab,arrIncludes:lb,arrIncludesAll:cb,arrIncludesSome:ub,equals:db,weakEquals:fb,inNumberRange:uh};function on(e){return e==null||e===""}const VL={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:$t("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n?.getValue(e.id);return typeof r=="string"?$n.includesString:typeof r=="number"?$n.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?$n.equals:Array.isArray(r)?$n.arrIncludes:$n.weakEquals},e.getFilterFn=()=>{var n,r;return wl(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:$n[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,o;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const o=e.getFilterFn(),i=r?.find(u=>u.id===e.id),s=ar(n,i?i.value:void 0);if(Ky(o,s,e)){var a;return(a=r?.filter(u=>u.id!==e.id))!=null?a:[]}const l={id:e.id,value:s};if(i){var c;return(c=r?.map(u=>u.id===e.id?l:u))!=null?c:[]}return r!=null&&r.length?[...r,l]:[l]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=o=>{var i;return(i=ar(t,o))==null?void 0:i.filter(s=>{const a=n.find(l=>l.id===s.id);if(a){const l=a.getFilterFn();if(Ky(l,s.value,a))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function Ky(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const jL=(e,t,n)=>n.reduce((r,o)=>{const i=o.getValue(e);return r+(typeof i=="number"?i:0)},0),BL=(e,t,n)=>{let r;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}),r},zL=(e,t,n)=>{let r;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r<i||r===void 0&&i>=i)&&(r=i)}),r},WL=(e,t,n)=>{let r,o;return n.forEach(i=>{const s=i.getValue(e);s!=null&&(r===void 0?s>=s&&(r=o=s):(r>s&&(r=s),o<s&&(o=s)))}),[r,o]},HL=(e,t)=>{let n=0,r=0;if(t.forEach(o=>{let i=o.getValue(e);i!=null&&(i=+i)>=i&&(++n,r+=i)}),n)return r/n},KL=(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!PL(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),o=n.sort((i,s)=>i-s);return n.length%2!==0?o[r]:(o[r-1]+o[r])/2},UL=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),GL=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,qL=(e,t)=>t.length,zc={sum:jL,min:BL,max:zL,extent:WL,mean:HL,median:KL,unique:UL,uniqueCount:GL,count:qL},YL={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:$t("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n?.getValue(e.id);if(typeof r=="number")return zc.sum;if(Object.prototype.toString.call(r)==="[object Date]")return zc.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return wl(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:zc[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var o;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((o=n.subRows)!=null&&o.length)}}};function XL(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(i=>!t.includes(i.id));return n==="remove"?r:[...t.map(i=>e.find(s=>s.id===i)).filter(Boolean),...r]}const JL={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:$t("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=ae(n=>[Bi(t,n)],n=>n.findIndex(r=>r.id===e.id),le(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var r;return((r=Bi(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const o=Bi(t,n);return((r=o[o.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=ae(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>o=>{let i=[];if(!(t!=null&&t.length))i=o;else{const s=[...t],a=[...o];for(;a.length&&s.length;){const l=s.shift(),c=a.findIndex(u=>u.id===l);c>-1&&i.push(a.splice(c,1)[0])}i=[...i,...a]}return XL(i,n,r)},le(e.options,"debugTable","_getOrderColumnsFn"))}},Wc=()=>({left:[],right:[]}),ZL={getInitialState:e=>({columnPinning:Wc(),...e}),getDefaultOptions:e=>({onColumnPinningChange:$t("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(o=>o.id).filter(Boolean);t.setColumnPinning(o=>{var i,s;if(n==="right"){var a,l;return{left:((a=o?.left)!=null?a:[]).filter(f=>!(r!=null&&r.includes(f))),right:[...((l=o?.right)!=null?l:[]).filter(f=>!(r!=null&&r.includes(f))),...r]}}if(n==="left"){var c,u;return{left:[...((c=o?.left)!=null?c:[]).filter(f=>!(r!=null&&r.includes(f))),...r],right:((u=o?.right)!=null?u:[]).filter(f=>!(r!=null&&r.includes(f)))}}return{left:((i=o?.left)!=null?i:[]).filter(f=>!(r!=null&&r.includes(f))),right:((s=o?.right)!=null?s:[]).filter(f=>!(r!=null&&r.includes(f)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var o,i,s;return((o=r.columnDef.enablePinning)!=null?o:!0)&&((i=(s=t.options.enableColumnPinning)!=null?s:t.options.enablePinning)!=null?i:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(a=>a.id),{left:r,right:o}=t.getState().columnPinning,i=n.some(a=>r?.includes(a)),s=n.some(a=>o?.includes(a));return i?"left":s?"right":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();return o?(n=(r=t.getState().columnPinning)==null||(r=r[o])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=ae(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,o)=>{const i=[...r??[],...o??[]];return n.filter(s=>!i.includes(s.column.id))},le(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=ae(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(i=>n.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),le(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=ae(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(i=>n.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),le(t.options,"debugRows","getRightVisibleCells"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?Wc():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:Wc())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var o,i;return!!((o=r.left)!=null&&o.length||(i=r.right)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=ae(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),le(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=ae(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),le(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=ae(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const o=[...n??[],...r??[]];return t.filter(i=>!o.includes(i.id))},le(e.options,"debugColumns","getCenterLeafColumns"))}};function QL(e){return e||(typeof document<"u"?document:null)}const qs={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Hc=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),eO={getDefaultColumnDef:()=>qs,getInitialState:e=>({columnSizing:{},columnSizingInfo:Hc(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:$t("columnSizing",e),onColumnSizingInfoChange:$t("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,o;const i=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:qs.minSize,(r=i??e.columnDef.size)!=null?r:qs.size),(o=e.columnDef.maxSize)!=null?o:qs.maxSize)},e.getStart=ae(n=>[n,Bi(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((o,i)=>o+i.getSize(),0),le(t.options,"debugColumns","getStart")),e.getAfter=ae(n=>[n,Bi(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((o,i)=>o+i.getSize(),0),le(t.options,"debugColumns","getAfter")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...o}=n;return o})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=o=>{if(o.subHeaders.length)o.subHeaders.forEach(r);else{var i;n+=(i=o.column.getSize())!=null?i:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),o=r?.getCanResize();return i=>{if(!r||!o||(i.persist==null||i.persist(),Kc(i)&&i.touches&&i.touches.length>1))return;const s=e.getSize(),a=e?e.getLeafHeaders().map(_=>[_.column.id,_.column.getSize()]):[[r.id,r.getSize()]],l=Kc(i)?Math.round(i.touches[0].clientX):i.clientX,c={},u=(_,y)=>{typeof y=="number"&&(t.setColumnSizingInfo(v=>{var x,b;const w=t.options.columnResizeDirection==="rtl"?-1:1,T=(y-((x=v?.startOffset)!=null?x:0))*w,E=Math.max(T/((b=v?.startSize)!=null?b:0),-.999999);return v.columnSizingStart.forEach(R=>{let[M,O]=R;c[M]=Math.round(Math.max(O+O*E,0)*100)/100}),{...v,deltaOffset:T,deltaPercentage:E}}),(t.options.columnResizeMode==="onChange"||_==="end")&&t.setColumnSizing(v=>({...v,...c})))},f=_=>u("move",_),d=_=>{u("end",_),t.setColumnSizingInfo(y=>({...y,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},h=QL(n),g={moveHandler:_=>f(_.clientX),upHandler:_=>{h?.removeEventListener("mousemove",g.moveHandler),h?.removeEventListener("mouseup",g.upHandler),d(_.clientX)}},p={moveHandler:_=>(_.cancelable&&(_.preventDefault(),_.stopPropagation()),f(_.touches[0].clientX),!1),upHandler:_=>{var y;h?.removeEventListener("touchmove",p.moveHandler),h?.removeEventListener("touchend",p.upHandler),_.cancelable&&(_.preventDefault(),_.stopPropagation()),d((y=_.touches[0])==null?void 0:y.clientX)}},m=tO()?{passive:!1}:!1;Kc(i)?(h?.addEventListener("touchmove",p.moveHandler,m),h?.addEventListener("touchend",p.upHandler,m)):(h?.addEventListener("mousemove",g.moveHandler,m),h?.addEventListener("mouseup",g.upHandler,m)),t.setColumnSizingInfo(_=>({..._,startOffset:l,startSize:s,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?Hc():(n=e.initialState.columnSizingInfo)!=null?n:Hc())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0}}};let Ys=null;function tO(){if(typeof Ys=="boolean")return Ys;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return Ys=e,Ys}function Kc(e){return e.type==="touchstart"}const nO={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:$t("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const o=e.columns;return(n=o.length?o.some(i=>i.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=ae(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),le(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=ae(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],le(t.options,"debugRows","getVisibleCells"))},createTable:e=>{const t=(n,r)=>ae(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),le(e.options,"debugColumns",n));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((o,i)=>({...o,[i.id]:n||!(i.getCanHide!=null&&i.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function Bi(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const rO={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},oO={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:$t("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,o,i;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&((i=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>$n.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return wl(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:$n[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},iO={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:$t("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var o,i;e.setExpanded(r?{}:(o=(i=e.initialState)==null?void 0:i.expanded)!=null?o:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(o=>!o.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(i=>{const s=i.split(".");r=Math.max(r,s.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var o;const i=r===!0?!0:!!(r!=null&&r[e.id]);let s={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(a=>{s[a]=!0}):s=r,n=(o=n)!=null?o:!i,!i&&n)return{...s,[e.id]:!0};if(i&&!n){const{[e.id]:a,...l}=s;return l}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r?.[e.id])},e.getCanExpand=()=>{var n,r,o;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((o=e.subRows)!=null&&o.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},hd=0,gd=10,Uc=()=>({pageIndex:hd,pageSize:gd}),sO={getInitialState:e=>({...e,pagination:{...Uc(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:$t("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const o=i=>ar(r,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?Uc():(o=e.initialState.pagination)!=null?o:Uc())},e.setPageIndex=r=>{e.setPagination(o=>{let i=ar(r,o.pageIndex);const s=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return i=Math.max(0,Math.min(i,s)),{...o,pageIndex:i}})},e.resetPageIndex=r=>{var o,i;e.setPageIndex(r?hd:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?o:hd)},e.resetPageSize=r=>{var o,i;e.setPageSize(r?gd:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?o:gd)},e.setPageSize=r=>{e.setPagination(o=>{const i=Math.max(1,ar(r,o.pageSize)),s=o.pageSize*o.pageIndex,a=Math.floor(s/i);return{...o,pageIndex:a,pageSize:i}})},e.setPageCount=r=>e.setPagination(o=>{var i;let s=ar(r,(i=e.options.pageCount)!=null?i:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...o,pageCount:s}}),e.getPageOptions=ae(()=>[e.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((i,s)=>s)),o},le(e.options,"debugTable","getPageOptions")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,o=e.getPageCount();return o===-1?!0:o===0?!1:r<o-1},e.previousPage=()=>e.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},Gc=()=>({top:[],bottom:[]}),aO={getInitialState:e=>({rowPinning:Gc(),...e}),getDefaultOptions:e=>({onRowPinningChange:$t("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,o)=>{const i=r?e.getLeafRows().map(l=>{let{id:c}=l;return c}):[],s=o?e.getParentRows().map(l=>{let{id:c}=l;return c}):[],a=new Set([...s,e.id,...i]);t.setRowPinning(l=>{var c,u;if(n==="bottom"){var f,d;return{top:((f=l?.top)!=null?f:[]).filter(p=>!(a!=null&&a.has(p))),bottom:[...((d=l?.bottom)!=null?d:[]).filter(p=>!(a!=null&&a.has(p))),...Array.from(a)]}}if(n==="top"){var h,g;return{top:[...((h=l?.top)!=null?h:[]).filter(p=>!(a!=null&&a.has(p))),...Array.from(a)],bottom:((g=l?.bottom)!=null?g:[]).filter(p=>!(a!=null&&a.has(p)))}}return{top:((c=l?.top)!=null?c:[]).filter(p=>!(a!=null&&a.has(p))),bottom:((u=l?.bottom)!=null?u:[]).filter(p=>!(a!=null&&a.has(p)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:o}=t.options;return typeof r=="function"?r(e):(n=r??o)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:o}=t.getState().rowPinning,i=n.some(a=>r?.includes(a)),s=n.some(a=>o?.includes(a));return i?"top":s?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();if(!o)return-1;const i=(n=o==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(s=>{let{id:a}=s;return a});return(r=i?.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?Gc():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:Gc())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var o,i;return!!((o=r.top)!=null&&o.length||(i=r.bottom)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var o;return((o=e.options.keepPinnedRows)==null||o?(n??[]).map(s=>{const a=e.getRow(s,!0);return a.getIsAllParentsExpanded()?a:null}):(n??[]).map(s=>t.find(a=>a.id===s))).filter(Boolean).map(s=>({...s,position:r}))},e.getTopRows=ae(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),le(e.options,"debugRows","getTopRows")),e.getBottomRows=ae(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),le(e.options,"debugRows","getBottomRows")),e.getCenterRows=ae(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const o=new Set([...n??[],...r??[]]);return t.filter(i=>!o.has(i.id))},le(e.options,"debugRows","getCenterRows"))}},lO={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:$t("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach(i=>{i.getCanSelect()&&(r[i.id]=!0)}):o.forEach(i=>{delete r[i.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach(i=>{pd(o,i.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=ae(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?qc(e,n):{rows:[],flatRows:[],rowsById:{}},le(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=ae(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?qc(e,n):{rows:[],flatRows:[],rowsById:{}},le(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=ae(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?qc(e,n):{rows:[],flatRows:[],rowsById:{}},le(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(o=>o.getCanSelect()&&!n[o.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(o=>!n[o.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const o=e.getIsSelected();t.setRowSelection(i=>{var s;if(n=typeof n<"u"?n:!o,e.getCanSelect()&&o===n)return i;const a={...i};return pd(a,e.id,n,(s=r?.selectChildren)!=null?s:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return dh(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return md(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return md(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var o;n&&e.toggleSelected((o=r.target)==null?void 0:o.checked)}}}},pd=(e,t,n,r,o)=>{var i;const s=o.getRow(t,!0);n?(s.getCanMultiSelect()||Object.keys(e).forEach(a=>delete e[a]),s.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(i=s.subRows)!=null&&i.length&&s.getCanSelectSubRows()&&s.subRows.forEach(a=>pd(e,a.id,n,r,o))};function qc(e,t){const n=e.getState().rowSelection,r=[],o={},i=function(s,a){return s.map(l=>{var c;const u=dh(l,n);if(u&&(r.push(l),o[l.id]=l),(c=l.subRows)!=null&&c.length&&(l={...l,subRows:i(l.subRows)}),u)return l}).filter(Boolean)};return{rows:i(t.rows),flatRows:r,rowsById:o}}function dh(e,t){var n;return(n=t[e.id])!=null?n:!1}function md(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let o=!0,i=!1;return e.subRows.forEach(s=>{if(!(i&&!o)&&(s.getCanSelect()&&(dh(s,t)?i=!0:o=!1),s.subRows&&s.subRows.length)){const a=md(s,t);a==="all"?i=!0:(a==="some"&&(i=!0),o=!1)}}),o?"all":i?"some":!1}const yd=/([0-9]+)/gm,cO=(e,t,n)=>hb(br(e.getValue(n)).toLowerCase(),br(t.getValue(n)).toLowerCase()),uO=(e,t,n)=>hb(br(e.getValue(n)),br(t.getValue(n))),dO=(e,t,n)=>fh(br(e.getValue(n)).toLowerCase(),br(t.getValue(n)).toLowerCase()),fO=(e,t,n)=>fh(br(e.getValue(n)),br(t.getValue(n))),hO=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},gO=(e,t,n)=>fh(e.getValue(n),t.getValue(n));function fh(e,t){return e===t?0:e>t?1:-1}function br(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function hb(e,t){const n=e.split(yd).filter(Boolean),r=t.split(yd).filter(Boolean);for(;n.length&&r.length;){const o=n.shift(),i=r.shift(),s=parseInt(o,10),a=parseInt(i,10),l=[s,a].sort();if(isNaN(l[0])){if(o>i)return 1;if(i>o)return-1;continue}if(isNaN(l[1]))return isNaN(s)?-1:1;if(s>a)return 1;if(a>s)return-1}return n.length-r.length}const Ei={alphanumeric:cO,alphanumericCaseSensitive:uO,text:dO,textCaseSensitive:fO,datetime:hO,basic:gO},pO={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:$t("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const o of n){const i=o?.getValue(e.id);if(Object.prototype.toString.call(i)==="[object Date]")return Ei.datetime;if(typeof i=="string"&&(r=!0,i.split(yd).length>1))return Ei.alphanumeric}return r?Ei.text:Ei.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof n?.getValue(e.id)=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return wl(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:Ei[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const o=e.getNextSortingOrder(),i=typeof n<"u"&&n!==null;t.setSorting(s=>{const a=s?.find(h=>h.id===e.id),l=s?.findIndex(h=>h.id===e.id);let c=[],u,f=i?n:o==="desc";if(s!=null&&s.length&&e.getCanMultiSort()&&r?a?u="toggle":u="add":s!=null&&s.length&&l!==s.length-1?u="replace":a?u="toggle":u="replace",u==="toggle"&&(i||o||(u="remove")),u==="add"){var d;c=[...s,{id:e.id,desc:f}],c.splice(0,c.length-((d=t.options.maxMultiSortColCount)!=null?d:Number.MAX_SAFE_INTEGER))}else u==="toggle"?c=s.map(h=>h.id===e.id?{...h,desc:f}:h):u==="remove"?c=s.filter(h=>h.id!==e.id):c=[{id:e.id,desc:f}];return c})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,o;const i=e.getFirstSortDir(),s=e.getIsSorted();return s?s!==i&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(o=t.options.enableMultiRemove)!=null)||o)?!1:s==="desc"?"asc":"desc":i},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(o=>o.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},mO=[IL,nO,JL,ZL,DL,VL,rO,oO,pO,YL,iO,sO,aO,lO,eO];function yO(e){var t,n;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const r=[...mO,...(t=e._features)!=null?t:[]];let o={_features:r};const i=o._features.reduce((d,h)=>Object.assign(d,h.getDefaultOptions==null?void 0:h.getDefaultOptions(o)),{}),s=d=>o.options.mergeOptions?o.options.mergeOptions(i,d):{...i,...d};let l={...{},...(n=e.initialState)!=null?n:{}};o._features.forEach(d=>{var h;l=(h=d.getInitialState==null?void 0:d.getInitialState(l))!=null?h:l});const c=[];let u=!1;const f={_features:r,options:{...i,...e},initialState:l,_queue:d=>{c.push(d),u||(u=!0,Promise.resolve().then(()=>{for(;c.length;)c.shift()();u=!1}).catch(h=>setTimeout(()=>{throw h})))},reset:()=>{o.setState(o.initialState)},setOptions:d=>{const h=ar(d,o.options);o.options=s(h)},getState:()=>o.options.state,setState:d=>{o.options.onStateChange==null||o.options.onStateChange(d)},_getRowId:(d,h,g)=>{var p;return(p=o.options.getRowId==null?void 0:o.options.getRowId(d,h,g))!=null?p:`${g?[g.id,h].join("."):h}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(d,h)=>{let g=(h?o.getPrePaginationRowModel():o.getRowModel()).rowsById[d];if(!g&&(g=o.getCoreRowModel().rowsById[d],!g))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${d}`):new Error;return g},_getDefaultColumnDef:ae(()=>[o.options.defaultColumn],d=>{var h;return d=(h=d)!=null?h:{},{header:g=>{const p=g.header.column.columnDef;return p.accessorKey?p.accessorKey:p.accessorFn?p.id:null},cell:g=>{var p,m;return(p=(m=g.renderValue())==null||m.toString==null?void 0:m.toString())!=null?p:null},...o._features.reduce((g,p)=>Object.assign(g,p.getDefaultColumnDef==null?void 0:p.getDefaultColumnDef()),{}),...d}},le(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>o.options.columns,getAllColumns:ae(()=>[o._getColumnDefs()],d=>{const h=function(g,p,m){return m===void 0&&(m=0),g.map(_=>{const y=OL(o,_,m,p),v=_;return y.columns=v.columns?h(v.columns,y,m+1):[],y})};return h(d)},le(e,"debugColumns","getAllColumns")),getAllFlatColumns:ae(()=>[o.getAllColumns()],d=>d.flatMap(h=>h.getFlatColumns()),le(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:ae(()=>[o.getAllFlatColumns()],d=>d.reduce((h,g)=>(h[g.id]=g,h),{}),le(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:ae(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(d,h)=>{let g=d.flatMap(p=>p.getLeafColumns());return h(g)},le(e,"debugColumns","getAllLeafColumns")),getColumn:d=>{const h=o._getAllFlatColumnsById()[d];return process.env.NODE_ENV!=="production"&&!h&&console.error(`[Table] Column with id '${d}' does not exist.`),h}};Object.assign(o,f);for(let d=0;d<o._features.length;d++){const h=o._features[d];h==null||h.createTable==null||h.createTable(o)}return o}function vO(){return e=>ae(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(o,i,s){i===void 0&&(i=0);const a=[];for(let c=0;c<o.length;c++){const u=$L(e,e._getRowId(o[c],c,s),o[c],c,i,void 0,s?.id);if(n.flatRows.push(u),n.rowsById[u.id]=u,a.push(u),e.options.getSubRows){var l;u.originalSubRows=e.options.getSubRows(o[c],c),(l=u.originalSubRows)!=null&&l.length&&(u.subRows=r(u.originalSubRows,i+1,u))}}return a};return n.rows=r(t),n},le(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function _O(e){const t=[],n=r=>{var o;t.push(r),(o=r.subRows)!=null&&o.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function xO(e){return t=>ae(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:o,pageIndex:i}=n;let{rows:s,flatRows:a,rowsById:l}=r;const c=o*i,u=c+o;s=s.slice(c,u);let f;t.options.paginateExpandedRows?f={rows:s,flatRows:a,rowsById:l}:f=_O({rows:s,flatRows:a,rowsById:l}),f.flatRows=[];const d=h=>{f.flatRows.push(h),h.subRows.length&&h.subRows.forEach(d)};return f.rows.forEach(d),f},le(t.options,"debugTable","getPaginationRowModel"))}function bO(){return e=>ae(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,o=[],i=r.filter(l=>{var c;return(c=e.getColumn(l.id))==null?void 0:c.getCanSort()}),s={};i.forEach(l=>{const c=e.getColumn(l.id);c&&(s[l.id]={sortUndefined:c.columnDef.sortUndefined,invertSorting:c.columnDef.invertSorting,sortingFn:c.getSortingFn()})});const a=l=>{const c=l.map(u=>({...u}));return c.sort((u,f)=>{for(let h=0;h<i.length;h+=1){var d;const g=i[h],p=s[g.id],m=p.sortUndefined,_=(d=g?.desc)!=null?d:!1;let y=0;if(m){const v=u.getValue(g.id),x=f.getValue(g.id),b=v===void 0,w=x===void 0;if(b||w){if(m==="first")return b?-1:1;if(m==="last")return b?1:-1;y=b&&w?0:b?m:-m}}if(y===0&&(y=p.sortingFn(u,f,g.id)),y!==0)return _&&(y*=-1),p.invertSorting&&(y*=-1),y}return u.index-f.index}),c.forEach(u=>{var f;o.push(u),(f=u.subRows)!=null&&f.length&&(u.subRows=a(u.subRows))}),c};return{rows:a(n.rows),flatRows:o,rowsById:n.rowsById}},le(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}function Uy(e,t){return e?CO(e)?N.createElement(e,t):e:null}function CO(e){return wO(e)||typeof e=="function"||SO(e)}function wO(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function SO(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function EO(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=N.useState(()=>({current:yO(t)})),[r,o]=N.useState(()=>n.current.initialState);return n.current.setOptions(i=>({...i,...e,state:{...r,...e.state},onStateChange:s=>{o(s),e.onStateChange==null||e.onStateChange(s)}})),n.current}const TO=e=>N.createElement("svg",{width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("style",null,`\r
|
|
48
|
+
@keyframes spin {\r
|
|
49
|
+
from {\r
|
|
50
|
+
transform: rotate(0deg);\r
|
|
51
|
+
}\r
|
|
52
|
+
to {\r
|
|
53
|
+
transform: rotate(360deg);\r
|
|
54
|
+
}\r
|
|
55
|
+
}\r
|
|
56
|
+
.spinner {\r
|
|
57
|
+
transform-origin: center;\r
|
|
58
|
+
animation: spin 1s linear infinite;\r
|
|
59
|
+
}\r
|
|
60
|
+
`),N.createElement("g",{className:"spinner"},N.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.0003 6.83317C13.5692 6.83317 11.2376 7.79894 9.51851 9.51803C7.79943 11.2371 6.83366 13.5687 6.83366 15.9998C6.83366 18.431 7.79943 20.7626 9.51851 22.4817C11.2376 24.2007 13.5692 25.1665 16.0003 25.1665C18.4315 25.1665 20.7631 24.2007 22.4821 22.4817C24.2012 20.7626 25.167 18.431 25.167 15.9998C25.167 13.5687 24.2012 11.2371 22.4821 9.51803C20.7631 7.79894 18.4315 6.83317 16.0003 6.83317ZM3.16699 15.9998C3.16699 8.91217 8.91266 3.1665 16.0003 3.1665C23.088 3.1665 28.8337 8.91217 28.8337 15.9998C28.8337 23.0875 23.088 28.8332 16.0003 28.8332C8.91266 28.8332 3.16699 23.0875 3.16699 15.9998Z",fill:"currentColor",fillOpacity:.12}),N.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.9997 6.83319C13.6363 6.82787 11.3633 7.74068 9.65999 9.37907C9.30711 9.70535 8.84021 9.88001 8.35982 9.86545C7.87943 9.85089 7.42396 9.64827 7.09149 9.30122C6.75902 8.95416 6.57612 8.49043 6.58218 8.00985C6.58823 7.52928 6.78276 7.07031 7.12388 6.73174C9.50956 4.43941 12.6912 3.16143 15.9997 3.16652C16.4859 3.16652 16.9522 3.35967 17.296 3.70349C17.6398 4.04731 17.833 4.51362 17.833 4.99985C17.833 5.48608 17.6398 5.9524 17.296 6.29621C16.9522 6.64003 16.4859 6.83319 15.9997 6.83319Z",fill:"currentColor"}))),RO=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("g",{clipPath:"url(#clip0_2074_3858)"},N.createElement("path",{d:"M21 21L16.65 16.65M19 11C19 15.4183 15.4183 19 11 19C6.58172 19 3 15.4183 3 11C3 6.58172 6.58172 3 11 3C15.4183 3 19 6.58172 19 11Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),N.createElement("defs",null,N.createElement("clipPath",{id:"clip0_2074_3858"},N.createElement("rect",{width:24,height:24,fill:"white"})))),kO="_table_19yhs_8",AO={table:kO},gb=C.forwardRef(({children:e,className:t,style:n,...r},o)=>S.jsx("td",{ref:o,className:z.cx(t),style:n,...r,children:e}));gb.displayName="TableBodyCell";const pb=C.forwardRef(({children:e,row:t=!0,justifyContent:n="flex-start",alignItems:r="center",py:o="var(--spacing-sm)",px:i="var(--spacing-md)",minHeight:s="56px",...a},l)=>S.jsx(q,{row:t,justifyContent:n,alignItems:r,py:o,px:i,minHeight:s,ref:l,...a,children:e}));pb.displayName="TableBodyCellContent";const mb=C.forwardRef(({children:e,className:t,showBorders:n=!1,isSelected:r=!1,...o},i)=>{const s=z.css({borderBottom:n?"1px solid var(--border-neutral-alpha-low)":"none"});return S.jsx("tr",{ref:i,className:z.cx(s,t),...o,children:e})});mb.displayName="TableBodyRow";const MO=C.forwardRef(({children:e,className:t,style:n,justifyContent:r="flex-start",alignItems:o="flex-start",...i},s)=>{const a=z.css({justifyContent:r,alignItems:o,fontWeight:"inherit"});return S.jsx("th",{ref:s,className:z.cx(a,t),style:n,...i,children:e})}),hh=C.forwardRef(({children:e,row:t=!0,justifyContent:n="flex-start",alignItems:r="center",py:o="var(--spacing-sm)",px:i="var(--spacing-md)",minHeight:s="56px",...a},l)=>S.jsx(q,{row:t,justifyContent:n,alignItems:r,py:o,px:i,minHeight:s,ref:l,...a,children:e}));hh.displayName="TableHeadCellContent";const NO=e=>N.createElement("svg",{width:10,height:6,viewBox:"0 0 10 6",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M8.75 0.75L4.75 4.75L0.75 0.75",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),PO=e=>N.createElement("svg",{width:10,height:6,viewBox:"0 0 10 6",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M8.75 4.75L4.75 0.75L0.75 4.75",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),FO=({sortDirection:e,gap:t="5px",...n})=>S.jsxs(q,{gap:t,...n,children:[S.jsx(PO,{style:{color:e==="asc"?"var(--icon-accent)":"var(--icon-tertiary)"}}),S.jsx(NO,{style:{color:e==="desc"?"var(--icon-accent)":"var(--icon-tertiary)"}})]}),yb=({children:e,tableProps:t,gap:n="10px",...r})=>{const o=t.column.getIsSorted();return S.jsxs(hh,{style:{cursor:"pointer",userSelect:"none"},gap:n,...r,children:[e,S.jsx(FO,{sortDirection:o})]})};yb.displayName="TableHeadCellContentSortable";const vb=C.forwardRef(({children:e,className:t,showBorders:n=!1,...r},o)=>{const i=z.css({backgroundColor:"var(--fill-bg-secondary)",borderBottom:n?"1px solid var(--border-neutral-alpha-low)":"none"});return S.jsx("tr",{ref:o,className:z.cx(i,t),...r,children:e})});vb.displayName="TableHeadRow";const LO=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M15 18L9 12L15 6",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),OO=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M9 18L15 12L9 6",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),IO=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M12 13C12.5523 13 13 12.5523 13 12C13 11.4477 12.5523 11 12 11C11.4477 11 11 11.4477 11 12C11 12.5523 11.4477 13 12 13Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),N.createElement("path",{d:"M19 13C19.5523 13 20 12.5523 20 12C20 11.4477 19.5523 11 19 11C18.4477 11 18 11.4477 18 12C18 12.5523 18.4477 13 19 13Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),N.createElement("path",{d:"M5 13C5.55228 13 6 12.5523 6 12C6 11.4477 5.55228 11 5 11C4.44772 11 4 11.4477 4 12C4 12.5523 4.44772 13 5 13Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),Yc=(e,t)=>{const n=t-e+1;return Array.from({length:n},(r,o)=>e+o)};function $O(e){const{count:t=1,page:n,maxVisiblePages:r=10}=e;let o=1,i=1;if(r<=2)return[n];r<=4?(o=0,i=0):r<=6?(o=1,i=0):r<=7?(o=1,i=Math.max(0,Math.floor((r-4)/2))):(o=1,i=Math.max(1,Math.floor((r-5)/2)));const s=Yc(1,Math.min(o,t)),a=Yc(Math.max(t-o+1,o+1),t),l=Math.max(Math.min(n-i,t-o-i*2-1),o+2),c=Math.min(Math.max(n+i,o+i*2+2),t-o-1);return[...s,...l>o+2?["start-dots"]:o+1<t-o?[o+1]:[],...Yc(l,c),...c<t-o-1?["end-dots"]:t-o>o?[t-o]:[],...a]}const DO=({pageIndex:e,pageSize:t,totalCount:n,onPageChange:r,onPageSizeChange:o,pageSizeOptions:i=[10,20,50,100],showPageSizeSelector:s=!0,renderPageSizeSelectorDropdownItem:a=c=>c.label,renderPageSizeSelectorInputItem:l})=>{const c=C.useRef(null),[u,f]=C.useState(0),d=Math.ceil(n/t),h=e>0,g=e<d-1;C.useEffect(()=>{const b=c.current;if(!b)return;const w=new ResizeObserver(T=>{for(const E of T)f(E.contentRect.width)});return w.observe(b),()=>{w.disconnect()}},[]);const m=(b=>{if(b<=0)return 1;const M=b-96;if(M<=40)return 1;const O=Math.floor((M+8)/48);return Math.max(1,Math.min(10,O))})(u),_=$O({page:e+1,count:d,maxVisiblePages:m}),y=()=>{h&&r(e-1)},v=()=>{g&&r(e+1)},x=b=>{o(Number(b))};return n===0?null:S.jsxs(q,{flex:1,row:!0,justifyContent:"space-between",children:[S.jsxs(q,{ref:c,flex:1,row:!0,overflow:"hidden",gap:"var(--spacing-sm)",children:[S.jsx(Kn,{onClick:y,disabled:!h,color:"neutral",size:"sm",children:S.jsx(LO,{})}),S.jsx(q,{row:!0,gap:"var(--spacing-sm)",children:_.map(b=>S.jsx(VO,{isDots:b==="start-dots"||b==="end-dots",isCurrentPage:b===e+1,disabled:b==="start-dots"||b==="end-dots",onClick:()=>r(b-1),children:b},b))}),S.jsx(Kn,{color:"neutral",size:"sm",onClick:v,disabled:!g,children:S.jsx(OO,{})})]}),s&&S.jsx(q,{alignItems:"flex-end",children:S.jsx(ch,{width:"fit-content",value:t.toString(),size:"sm",items:i.map(b=>({value:b.toString(),label:b.toString()})),returnedValue:b=>b.value,renderDropdownItem:a,renderSingleInputItem:l,onChange:b=>x(b)})})]})},VO=({children:e,isCurrentPage:t=!1,onClick:n,isDots:r=!1,disabled:o=!1})=>{const i=z.css({cursor:o?"not-allowed":"pointer",userSelect:"none",width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:t?"var(--fill-accent-secondary)":"var(--fill-bg-secondary)",borderRadius:"var(--corner-sm)",border:t?"1px solid var(--fill-accent-secondary-hover)":"1px solid var(--border-neutral-alpha-basic)"}),s=z.css({width:"24px",height:"24px",color:t?"var(--icon-secondary)":"var(--icon-tertiary)"});return S.jsx(q,{className:i,onClick:o?void 0:n,children:r?S.jsx(IO,{className:s}):S.jsx(ce,{center:!0,variant:"body-2",fontWeight:"medium",children:e})})},jO=z.css({position:"relative",borderRadius:"var(--corner-md)",overflow:"hidden","&::before, &::after":{content:'""',position:"absolute",top:0,bottom:14,width:96,pointerEvents:"none",zIndex:1,transition:"opacity 0.2s ease"},"&::before":{left:0,background:"linear-gradient(to left, rgba(255, 255, 255, 0.00) 0%, #FFF 100%)"},"&::after":{right:0,background:"linear-gradient(to right, rgba(255, 255, 255, 0.00) 0%, #FFF 100%)"}}),BO=z.css({overflowX:"auto",scrollbarWidth:"thin",scrollbarColor:"var(--gray-86) var(--gray-96)"}),_b=C.memo(({data:e,children:t,className:n,showBorders:r=!1,...o})=>{const[i,s]=C.useState(!1),[a,l]=C.useState(!1),c=C.useRef(null),u=C.useCallback(()=>{const d=c.current;if(!d)return;const{scrollLeft:h,scrollWidth:g,clientWidth:p}=d,m=g>p;s(m&&h>0),l(m&&h<g-p-1)},[]);C.useEffect(()=>{const d=c.current;if(!d)return;u();const h=new ResizeObserver(u);return h.observe(d),d.addEventListener("scroll",u),()=>{h.disconnect(),d.removeEventListener("scroll",u)}},[u,e]);const f=z.css({border:r?"1px solid var(--border-neutral-alpha-low)":"transparent","&::before":{opacity:i?1:0},"&::after":{opacity:a?1:0}});return S.jsx(q,{className:z.cx(jO,f,n),...o,children:S.jsx(q,{ref:c,className:BO,children:t})})});_b.displayName="TableWrapper";const zO=z.css({width:"100%",maxWidth:"100%",minWidth:"max-content",borderCollapse:"collapse",borderSpacing:0,backgroundColor:"var(--fill-bg-primary)"}),WO=z.css({backgroundColor:"var(--fill-bg-secondary)",color:"var(--text-tertiary)"}),gi=({ref:e,data:t,columns:n,showBorders:r=!0,enableSorting:o=!1,enablePagination:i=!1,enableRowSelection:s=!1,enableMultiRowSelection:a=!1,sorting:l,onSortingChange:c,columnFilters:u,onColumnFiltersChange:f,columnVisibility:d,onColumnVisibilityChange:h,pagination:g,onPaginationChange:p,rowSelection:m,onRowSelectionChange:_,totalCount:y,loading:v=!1,emptyLabels:x={title:"Nothing found",description:"No results found for “result”",action:"Reset"},loadingLabels:b={title:"Loading...",description:"Please wait or reset your promt",action:"Reset"},className:w,containerClassName:T,tableOptions:E={},onRowClick:R,getRowId:M,headCellComponent:O=MO,bodyCellComponent:D=gb,headRowComponent:I=vb,bodyRowComponent:L=mb,onReset:B,renderPageSizeSelectorDropdownItem:K,renderPageSizeSelectorInputItem:P})=>{const[A,$]=C.useState([]),[H,Q]=C.useState([]),[J,X]=C.useState({}),[se,re]=C.useState({pageIndex:0,pageSize:10}),[he,we]=C.useState({}),te=l??A,ye=u??H,Se=d??J,$e=g??se,ee=m??he,pe=ve=>{const Re=typeof ve=="function"?ve(te):ve;c?c(Re):$(Re)},Ne=ve=>{const Re=typeof ve=="function"?ve(ye):ve;f?f(Re):Q(Re)},Ze=ve=>{const Re=typeof ve=="function"?ve(Se):ve;h?h(Re):X(Re)},Le=ve=>{const Re=typeof ve=="function"?ve($e):ve;p?p(Re):re(Re)},fn=EO({data:t,columns:n,state:{sorting:te,columnFilters:ye,columnVisibility:Se,pagination:$e,rowSelection:ee},onSortingChange:pe,onColumnFiltersChange:Ne,onColumnVisibilityChange:Ze,onPaginationChange:Le,onRowSelectionChange:ve=>{const Re=typeof ve=="function"?ve(ee):ve;_?_(Re):we(Re)},getCoreRowModel:vO(),getSortedRowModel:o?bO():void 0,getPaginationRowModel:i?xO():void 0,enableRowSelection:s,enableMultiRowSelection:a,getRowId:M,manualPagination:!!y,pageCount:y?Math.ceil(y/$e.pageSize):void 0,...E});C.useImperativeHandle(e,()=>fn);const{rows:hn}=fn.getRowModel(),Dt=(ve,Re)=>{R&&R(ve.original,Re)};return v?S.jsxs(q,{w:"full",borderRadius:"var(--corner-md)",py:"var(--spacing-5xl)",px:"var(--spacing-10xl)",alignItems:"center",className:z.cx(T),children:[S.jsx(TO,{width:32,height:32,style:{color:"var(--icon-tertiary)",marginBottom:"var(--spacing-sm)"}}),S.jsx(ce,{mb:"var(--spacing-xs)",variant:"title-3",fontWeight:"semibold",children:b.title}),S.jsx(ce,{mb:"var(--spacing-md)",colorName:"tertiary",variant:"body-1",fontWeight:"medium",children:b.description}),typeof b.action=="string"?S.jsx(Go,{width:"auto",onClick:B,intensity:"secondary",color:"accent",children:b.action}):b.action]}):hn.length?S.jsxs(q,{w:"full",gap:"var(--spacing-xl)",className:z.cx(T),children:[S.jsx(_b,{data:t,showBorders:r,children:S.jsxs("table",{className:z.cx(zO,AO.table,w),children:[S.jsx("thead",{className:WO,children:fn.getHeaderGroups().map(ve=>S.jsx(I,{showBorders:r,children:ve.headers.map(Re=>S.jsx(O,{style:{width:Re.getSize()},onClick:Re.column.getToggleSortingHandler(),children:Re.isPlaceholder?null:Uy(Re.column.columnDef.header,Re.getContext())},Re.id))},ve.id))}),S.jsx("tbody",{children:hn.map((ve,Re)=>S.jsx(L,{showBorders:r,isSelected:ve.getIsSelected(),onClick:()=>Dt(ve,Re),children:ve.getVisibleCells().map(Vt=>S.jsx(D,{children:Uy(Vt.column.columnDef.cell,Vt.getContext())},Vt.id))},ve.id))})]})}),i&&!v&&S.jsx(DO,{pageIndex:$e.pageIndex,pageSize:$e.pageSize,totalCount:y||t.length,renderPageSizeSelectorDropdownItem:K,renderPageSizeSelectorInputItem:P,onPageChange:ve=>Le({...$e,pageIndex:ve}),onPageSizeChange:ve=>Le({...$e,pageSize:ve,pageIndex:0})})]}):S.jsxs(q,{w:"full",borderRadius:"var(--corner-md)",py:"var(--spacing-5xl)",px:"var(--spacing-10xl)",alignItems:"center",className:z.cx(T),children:[S.jsx(RO,{width:24,height:24,style:{color:"var(--icon-tertiary)",marginBottom:"var(--spacing-sm)"}}),S.jsx(ce,{mb:"var(--spacing-xs)",variant:"title-3",fontWeight:"semibold",children:x.title}),S.jsx(ce,{mb:"var(--spacing-md)",colorName:"tertiary",variant:"body-1",fontWeight:"medium",children:x.description}),typeof x.action=="string"?S.jsx(Go,{width:"auto",onClick:B,intensity:"secondary",color:"accent",children:x.action}):x.action]})};gi.displayName="Table";gi.HeadCellContent=hh;gi.BodyCellContent=pb;gi.HeadCellContentSortable=yb;gi.createColumnHelper=ob;const Xc={chart:{type:"areaspline",backgroundColor:"transparent",spacing:[0,0,0,0],margin:[0,0,0,0]},xAxis:{gridLineWidth:0,lineWidth:0,tickWidth:0,labels:{enabled:!1},title:{text:""}},yAxis:{gridLineWidth:0,lineWidth:0,tickWidth:0,labels:{enabled:!1},title:{text:""}},legend:{enabled:!1},credits:{enabled:!1}},HO={positive:{color:"var(--fill-positive-primary)",fillColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,"var(--fill-positive-tint-high)"],[1,"var(--fill-positive-transparent)"]]}},negative:{color:"var(--fill-negative-primary)",fillColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,"var(--fill-negative-tint-high)"],[1,"var(--fill-negative-transparent)"]]}},accent:{color:"var(--fill-accent-primary)",fillColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,"var(--fill-accent-tint-high)"],[1,"var(--fill-accent-transparent)"]]}},warning:{color:"var(--fill-warning-primary)",fillColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,"var(--fill-warning-tint-high)"],[1,"var(--fill-warning-transparent)"]]}}},KO=(e,t,n,r,o)=>({...Xc,plotOptions:{areaspline:{marker:{enabled:!1,states:{hover:{enabled:o}}},allowPointSelect:!1}},xAxis:{...Xc.xAxis,...n},yAxis:{...Xc.yAxis,...r},series:[{type:"areaspline",data:t,...HO[e]}]}),UO=e=>({outside:!0,enabled:!!e,padding:0,position:{alignByTranslate:!0},shadow:{color:"var(--effect-shadow-m)",offsetX:0,offsetY:0},borderRadius:8,backgroundColor:"var(--fill-bg-primary)",useHTML:!0,...e}),xb=({color:e="positive",data:t=[],xAxis:n,yAxis:r,containerProps:o,highcharts:i,tooltip:s})=>{const a=C.useRef(null);C.useEffect(()=>()=>{typeof a=="object"&&a?.current?.chart&&a.current.chart.destroy()},[]);const l=C.useMemo(()=>KO(e,t,n,r,!!s),[e,t,n,r,s]),c=C.useMemo(()=>s?UO(s):{enabled:!1},[s]);return S.jsx(da.Chart,{highcharts:i,ref:a,options:l,containerProps:o,children:S.jsx(da.Tooltip,{...c})})};xb.displayName="LineChart";const GO={chart:{type:"pie",backgroundColor:"transparent",spacing:[0,0,0,0],margin:[0,0,0,0],events:{click:void 0}},title:{align:"center",verticalAlign:"middle",floating:!0,style:{fontSize:"24px",fontWeight:"600",color:"var(--text-primary)"}},plotOptions:{pie:{allowPointSelect:!0,cursor:"pointer",dataLabels:{enabled:!1},startAngle:90,endAngle:-90,innerSize:"90%",borderWidth:0,states:{hover:{enabled:!1},select:{enabled:!1},inactive:{enabled:!1}},enableMouseTracking:!1}},tooltip:{enabled:!1},legend:{enabled:!1},credits:{enabled:!1}},qO={positive:{colors:["var(--fill-positive-primary)","var(--fill-positive-tint-high)"]},negative:{colors:["var(--fill-negative-primary)","var(--fill-negative-tint-high)"]},accent:{colors:["var(--fill-accent-primary)","var(--fill-accent-tint-high)"]},warning:{colors:["var(--fill-warning-primary)","var(--fill-warning-tint-high)"]}},YO=(e,t)=>({...GO,series:[{type:"pie",data:[{name:"",y:Math.min(e,100)},{name:"",y:Math.max(100-e,0)}],...qO[t]}]}),bb=C.forwardRef(({highcharts:e,color:t="positive",percentage:n,label:r=s=>`${s}%`,containerProps:o},i)=>{const s=C.useRef(null),a=i||s;C.useEffect(()=>()=>{typeof a=="object"&&a?.current?.chart&&a.current.chart.destroy()},[a]);const l=C.useMemo(()=>YO(n,t),[n,t]);return S.jsx(da.Chart,{highcharts:e,ref:a,options:l,containerProps:o,children:S.jsx(da.Title,{children:r?.(n)})})});bb.displayName="PieProgressChart";const XO=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M9 17L14 12L9 7",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),JO="_link_aolvt_8",ZO="_separator_aolvt_19",QO="_nav_aolvt_23",ua={link:JO,separator:ZO,nav:QO,"nav-item":"_nav-item_aolvt_29"},gh=({children:e,separator:t=S.jsx(XO,{className:ua.separator})})=>{const n=C.Children.toArray(e).filter(r=>C.isValidElement(r));return S.jsx("nav",{"aria-label":"breadcrumb",className:ua.nav,children:n.map((r,o)=>{const i=o===n.length-1;return S.jsxs(ce,{tag:"span",className:ua["nav-item"],children:[C.cloneElement(r,{active:r.props.active??i}),!i&&t]},o)})})},e5=({children:e,href:t,active:n,className:r,activeClassName:o,activeElement:i,onClick:s})=>n?i||S.jsx(ce,{tag:"span",variant:"body-2",fontWeight:"medium",colorName:"primary",className:z.cx(r,o),onClick:s,children:e}):S.jsx("a",{href:t,className:z.cx(ua.link,r),onClick:s,children:e});gh.Item=e5;gh.displayName="Breadcrumbs";const t5=gh,n5={primary:{bg:"var(--fill-accent-tint)",text:"var(--text-accent)",icon:"var(--icon-accent)"},secondary:{bg:"var(--fill-neutral-tint)",text:"var(--text-secondary)",icon:"var(--icon-tertiary)"},negative:{bg:"var(--fill-negative-tint)",text:"var(--text-negative)",icon:"var(--icon-negative)"},positive:{bg:"var(--fill-positive-tint)",text:"var(--text-positive)",icon:"var(--icon-positive)"},warning:{bg:"var(--fill-warning-tint)",text:"var(--text-warning)",icon:"var(--icon-warning)"},neutral:{bg:"var(--fill-neutral-tint)",text:"var(--text-tertiary)",icon:"var(--icon-tertiary)"},custom:{bg:"var(--fill-accent-tint)",text:"var(--text-accent)",icon:"var(--icon-accent)"}},r5={"2xs":{size:"var(--height-avatar-2xs)",borderRadius:"var(--corner-xs)",iconSize:"var(--height-icon-2xs)",fontSize:"var(--font-size-caption-2)",fontWeight:"var(--font-weight-medium)"},xs:{size:"var(--height-avatar-xs)",borderRadius:"var(--corner-sm)",iconSize:"var(--height-icon-xs)",fontSize:"var(--font-size-caption-1)",fontWeight:"var(--font-weight-medium)"},sm:{size:"var(--height-avatar-sm)",borderRadius:"var(--corner-sm)",iconSize:"var(--height-icon-xs)",fontSize:"var(--font-size-body-2)",fontWeight:"var(--font-weight-medium)"},md:{size:"var(--height-avatar-md)",borderRadius:"var(--corner-sm)",iconSize:"var(--height-icon-sm)",fontSize:"var(--font-size-body-2)",fontWeight:"var(--font-weight-medium)"},lg:{size:"var(--height-avatar-lg)",borderRadius:"var(--corner-md)",iconSize:"var(--height-icon-md)",fontSize:"var(--font-size-body-1)",fontWeight:"var(--font-weight-semibold)"},xl:{size:"var(--height-avatar-xl)",borderRadius:"var(--corner-md)",iconSize:"var(--height-icon-md)",fontSize:"var(--font-size-body-1)",fontWeight:"var(--font-weight-semibold)"},"2xl":{size:"var(--height-avatar-2xl)",borderRadius:"var(--corner-md)",iconSize:"var(--height-icon-md)",fontSize:"var(--font-size-headline-2)",fontWeight:"var(--font-weight-medium)"},custom:{size:"var(--height-avatar-md)",borderRadius:"var(--corner-sm)",iconSize:"var(--height-icon-sm)",fontSize:"var(--font-size-body-2)",fontWeight:"var(--font-weight-medium)"}},Cb=C.forwardRef(({children:e,color:t="primary",size:n="md",fullRound:r=!1,className:o},i)=>{const s=C.useMemo(()=>n5[t],[t]),a=C.useMemo(()=>r5[n],[n]),l=C.useMemo(()=>z.css({width:a.size,height:a.size,borderRadius:r?"var(--corner-full-round)":a.borderRadius,backgroundColor:s.bg,color:s.text,fontSize:a.fontSize,fontWeight:a.fontWeight,lineHeight:1,transition:"var(--transition-general)","& svg":{width:a.iconSize,height:a.iconSize,color:s.icon,transition:"var(--transition-general)"},"& img":{width:"100%",height:"100%",objectFit:"cover"},"&:has(img)":{backgroundColor:"transparent",border:"1px solid var(--border-neutral-alpha-low)"}}),[s,a,r]);return S.jsx(q,{ref:i,center:!0,overflow:"hidden",className:z.cx(l,o),children:e})});Cb.displayName="Avatar";const vd={neutral:{border:"var(--border-neutral-alpha-low)",bg:"var(--status-neutral-tint)",color:"var(--text-secondary)",colorName:"secondary"},accent:{border:"var(--border-accent-secondary)",bg:"var(--status-accent-tint-low)",color:"var(--text-accent)",colorName:"accent"},warning:{border:"var(--border-warning-secondary)",bg:"var(--status-warning-tint-low)",color:"var(--text-warning)",colorName:"warning"},positive:{border:"var(--border-positive-secondary)",bg:"var(--status-positive-tint-low)",color:"var(--text-positive)",colorName:"positive"},negative:{border:"var(--border-negative-secondary)",bg:"var(--status-negative-tint-low)",color:"var(--text-negative)",colorName:"negative"}},Xs={sm:{h:24,text:"caption-1",corner:"var(--corner-xs)",p:"6px var(--spacing-sm)"},md:{h:32,text:"body-2",corner:"var(--corner-sm)",p:"6px var(--spacing-md)"},lg:{h:40,text:"body-2",corner:"var(--corner-md)",p:"6px var(--spacing-lg)"}},o5=(e,t,n,r)=>{const o=vd[t];let i=o.bg,s="none";const a=o.color;switch(e){case"outline":i="transparent",s=`1px solid ${o.border}`;break;case"clear":i="transparent";break;default:i=o.bg;break}return z.css({cursor:n?"not-allowed":r?"pointer":"default",opacity:n?.5:1,userSelect:"none",position:"relative",transition:"background-color 0.2s, opacity 0.2s",backgroundColor:i,color:a,border:s})},i5=z.css({display:"inline-flex",cursor:"pointer",opacity:.6,"&:hover":{opacity:1}}),wb=({label:e,color:t="neutral",size:n="md",variant:r="filled",leftElement:o,rightElement:i,disabled:s,onClick:a,onDelete:l,className:c})=>{const u=o5(r,t,s,a);return S.jsxs(q,{row:!0,alignItems:"center",gap:"var(--spacing-sm)",p:Xs[n].p,h:Xs[n].h,overflow:"hidden",borderRadius:Xs[n].corner,onClick:a,className:z.cx(u,c),children:[a&&S.jsx(io,{}),o,S.jsx(ce,{variant:Xs[n].text,colorName:vd[t].colorName,textOverflow:"ellipsis",children:e}),i,l&&!s&&S.jsx(ce,{className:i5,colorName:vd[t].colorName,onClick:f=>{f.stopPropagation(),l(f)},children:S.jsx(J1,{})})]})};wb.displayName="Badge";const s5=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("circle",{cx:12,cy:12,r:10,fill:"currentColor",fillOpacity:.15}),N.createElement("path",{d:"M16 9L10.0337 15L8 12.9548",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),Gy=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z",fill:"currentColor",fillOpacity:.15}),N.createElement("path",{d:"M12 6C11.4477 6 11 6.44772 11 7V13C11 13.5523 11.4477 14 12 14C12.5523 14 13 13.5523 13 13V7C13 6.44772 12.5523 6 12 6Z",fill:"currentColor"}),N.createElement("path",{d:"M12 15C11.4477 15 11 15.4477 11 16V17C11 17.5523 11.4477 18 12 18C12.5523 18 13 17.5523 13 17V16C13 15.4477 12.5523 15 12 15Z",fill:"currentColor"})),a5=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("circle",{cx:12,cy:12,r:10,fill:"currentColor",fillOpacity:.12}),N.createElement("path",{d:"M16 8L8 16M16 16L8 8",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"})),l5=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:"black",...e},N.createElement("path",{d:"M12 2V22M19.0711 4.92893L4.92893 19.0711M22 12H2M19.0711 19.0711L4.92893 4.92893",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),c5="_hint_4a6nb_8",u5="_md_4a6nb_19",d5="_sm_4a6nb_24",f5="_icon_4a6nb_29",h5="_content_4a6nb_40",g5="_title_4a6nb_46",p5="_subtitle_4a6nb_51",m5="_disabled_4a6nb_57",y5="_warning_4a6nb_62",v5="_solid_4a6nb_62",_5="_negative_4a6nb_67",x5="_positive_4a6nb_72",b5="_accent_4a6nb_77",C5="_neutral_4a6nb_82",w5="_soft_4a6nb_87",Jt={hint:c5,md:u5,sm:d5,icon:f5,content:h5,title:g5,subtitle:p5,disabled:m5,warning:y5,solid:v5,negative:_5,positive:x5,accent:b5,neutral:C5,soft:w5},S5={negative:S.jsx(a5,{}),positive:S.jsx(s5,{}),accent:S.jsx(Gy,{}),warning:S.jsx(Gy,{}),neutral:S.jsx(l5,{})},E5=({title:e,subtitle:t,color:n="warning",variant:r="soft",size:o="md",icon:i,disabled:s=!1,className:a,style:l})=>{const c=i||S5[n];return S.jsxs("div",{className:Pi(Jt.hint,Jt[n],Jt[r],Jt[o],s&&Jt.disabled,a),style:l,"aria-disabled":s,children:[c&&S.jsx("span",{className:Jt.icon,children:c}),S.jsxs("div",{className:Jt.content,children:[e&&S.jsx(ce,{className:Pi(Jt.title,fa(Jt,"title",o)),variant:o==="md"?"body-1":"caption-2",children:e}),t&&S.jsx(ce,{className:Pi(Jt.subtitle,fa(Jt,"subtitle",o)),variant:o==="md"?"body-2":"caption-1",children:t})]})]})},T5=z.keyframes`
|
|
61
61
|
from {
|
|
62
62
|
opacity: 0;
|
|
63
63
|
}
|
|
64
64
|
to {
|
|
65
65
|
opacity: 1;
|
|
66
66
|
}
|
|
67
|
-
`,
|
|
67
|
+
`,R5=z.css({animation:`${T5} 0.2s ease-out`,boxShadow:"0 4px 20px 0 var(--effect-shadow-s)"}),k5=({children:e,className:t,...n})=>S.jsx(q,{relative:!0,backgroundColor:"var(--fill-bg-primary)",borderRadius:"var(--corner-md)",className:z.cx(R5,t),...n,children:e}),lr=({children:e,content:t,initialOpen:n=!1,open:r,onChange:o,placement:i="bottom",trigger:s="click",offset:a=12,closeOnBackdropClick:l=!0,closeOnEsc:c=!0,className:u,contentClassName:f,style:d,openDelay:h=200,closeDelay:g=200,zIndex:p=1,popoverContentComponent:m=k5})=>{const[_,y]=C.useState(n),v=r??_,x=o??y,b=C.useCallback(P=>{l&&P.target===P.currentTarget&&x(!1)},[l,x]),{context:w,refs:T,floatingStyles:E}=ah({placement:i,open:v,onOpenChange:x,whileElementsMounted:eh,middleware:[th(a),rh({crossAxis:i.includes("-"),fallbackAxisSideDirection:i.includes("start")?"start":"end",padding:a}),nh({padding:a})]}),R=IF(w,{enabled:s==="click"}),M=G1(w,{enabled:s==="hover",delay:{open:h,close:g}}),O=q1(w,{enabled:c,escapeKey:!0}),D=X1(w),I=Y1([R,M,O,D]),L=e.ref,B=K1([T.setReference,L]),K=C.cloneElement(e,I.getReferenceProps({...e.props,ref:B,"data-state":w.open?"open":"closed"}));return S.jsxs(S.Fragment,{children:[K,v&&S.jsxs(_s,{children:[s!=="hover"&&l&&S.jsx(q,{position:"fixed",top:0,right:0,bottom:0,left:0,display:"block",backgroundColor:"transparent",onClick:b,zIndex:p}),S.jsx(q,{absolute:!0,zIndex:p,className:u,ref:T.setFloating,style:{...E,...d},...I.getFloatingProps(),children:S.jsx(m,{className:f,children:t})})]})]})},qy={xs:{width:16,height:16},sm:{width:24,height:24},md:{width:32,height:32},lg:{width:40,height:40},xl:{width:48,height:48}},A5={zero:"var(--corner-zero)",xs:"var(--corner-xs)",sm:"var(--corner-sm)",md:"var(--corner-md)",lg:"var(--corner-lg)",xl:"var(--corner-xl)","2xl":"var(--corner-2xl)","3xl":"var(--corner-3xl)","4xl":"var(--corner-4xl)","5xl":"var(--corner-5xl)","6xl":"var(--corner-6xl)","full-round":"var(--corner-full-round)",circular:"50%"},Yy=z.css({backgroundColor:"var(--status-neutral-tint)",borderRadius:"var(--corner-sm)",position:"relative",overflow:"hidden","&::before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,background:"linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent)",transform:"translateX(-100%)"}}),M5=z.css({animation:"skeleton-pulse 1.5s ease-in-out infinite","@keyframes skeleton-pulse":{"0%":{opacity:1},"50%":{opacity:.4},"100%":{opacity:1}}}),N5=z.css({"&::before":{animation:"skeleton-wave 1.6s linear infinite"},"@keyframes skeleton-wave":{"0%":{transform:"translateX(-100%)"},"50%":{transform:"translateX(100%)"},"100%":{transform:"translateX(100%)"}}}),Xy=(e,t)=>{if(t!==void 0)return z.css({borderRadius:A5[t]});switch(e){case"circular":return z.css({borderRadius:"50%"});case"text":return z.css({borderRadius:"var(--corner-xs)"});default:return z.css({borderRadius:"var(--corner-sm)"})}},Jy=e=>{switch(e){case"pulse":return M5;case"wave":return N5;default:return""}},Sb=({width:e,height:t,variant:n="rectangular",size:r="md",animation:o="wave",lines:i=1,className:s,children:a,loading:l=!0,borderRadius:c})=>{if(!l&&a)return S.jsx(S.Fragment,{children:a});if(!l)return null;const u=e||qy[r].width,f=t||qy[r].height;return n==="text"&&i>1?S.jsx(q,{gap:"var(--spacing-sm)",className:s,children:Array.from({length:i},(d,h)=>S.jsx(q,{className:z.cx(Yy,Xy(n,c),Jy(o)),w:h===i-1?"70%":u,h:f},h))}):S.jsx(q,{className:z.cx(Yy,Xy(n,c),Jy(o),s),w:u,h:f})};Sb.displayName="Skeleton";const P5={top:"polygon(100% 0%, 50% 100%, 0% 0%)",bottom:"polygon(0% 100%, 50% 0%, 100% 100%)","top-start":"polygon(0% 0%, 0% 100%, 100% 0%)","top-end":"polygon(100% 0%, 100% 100%, 0% 0%)","bottom-start":"polygon(0% 100%, 0% 0%, 100% 100%)","bottom-end":"polygon(100% 100%, 100% 0%, 0% 100%)",left:"polygon(0% 100%, 100% 50%, 0% 0%)",right:"polygon(100% 100%, 0% 50%, 100% 0%)"},F5=10,L5=6,Js=1,Zy={primary:{backgroundColor:"var(--fill-bg-primary)",color:"var(--text-primary)"},inverse:{backgroundColor:"var(--fill-bg-primary-inverse)",color:"var(--text-primary-inverse)"}},O5=(e,t)=>(e==="top"||e==="bottom")&&t?`${e}-${t}`:e,I5=(e,t,n)=>n?(e==="top"||e==="bottom")&&t?{[e==="top"?t==="start"?"borderBottomLeftRadius":"borderBottomRightRadius":t==="start"?"borderTopLeftRadius":"borderTopRightRadius"]:0}:{}:{},$5=(e,t,n)=>e==="left"||e==="right"?{width:6,height:n}:t?{width:8,height:6}:{width:n,height:6},D5=(e,t,n)=>e?(t==="top"||t==="bottom")&&n?{x:n==="start"?0:void 0,y:e.y}:{x:e.x,y:e.y}:{x:void 0,y:void 0},V5=z.keyframes`
|
|
68
68
|
from { opacity: 0; transform: translateY(2px); }
|
|
69
69
|
to { opacity: 1; transform: translateY(0); }
|
|
70
|
-
`,
|
|
70
|
+
`,j5=z.css({boxShadow:"0 4px 20px 0 var(--effect-shadow-m)",animation:`${V5} 0.16s ease-out`,fontSize:"12px",lineHeight:"16px",fontWeight:"500",wordBreak:"break-word"}),B5=z.css({position:"absolute",clipPath:"var(--tooltip-arrow-shape)"}),Eb=({color:e="primary",children:t,content:n,disabled:r=!1,initialOpen:o=!1,open:i,onChange:s,placement:a="top",trigger:l="hover",offset:c=5,showArrow:u=!0,openDelay:f=400,closeDelay:d=0,closeOnEsc:h=!0,zIndex:g=1,maxWidth:p,className:m,contentClassName:_,style:y,id:v,p:x="var(--spacing-md)",borderRadius:b="var(--corner-sm)"})=>{const[w,T]=C.useState(o),[E,R]=C.useState(null),M=i??w,O=s??T,D=C.useId(),I=v??`tooltip-${D}`,L=n==null||n==="",B=!r&&!L,K=C.useCallback(Dt=>{B&&O(Dt)},[B,O]),P=c+(u?L5:0),{context:A,refs:$,floatingStyles:H,middlewareData:Q,placement:J}=ah({placement:a,open:B?M:!1,onOpenChange:K,whileElementsMounted:eh,middleware:[th(P),rh({crossAxis:a.includes("-"),fallbackAxisSideDirection:a.includes("start")?"start":"end",padding:P}),nh({padding:P}),...u&&E?[EF({element:E,padding:0})]:[]]}),X=Q.arrow,se=J.split("-")[0],re=J.includes("-")?J.split("-")[1]:null,he=D5(X,se,re),we=O5(se,re),te=I5(se,re,u),ye=$5(se,re,F5),Se=z.css({...te,...Zy[e]}),$e=z.css({left:he.x??void 0,top:he.y??void 0,width:ye.width,height:ye.height,"--tooltip-arrow-shape":P5[we],...se==="top"&&{bottom:-ye.height+Js},...se==="bottom"&&{top:-ye.height+Js},...se==="left"&&{right:-ye.width+Js},...se==="right"&&{left:-ye.width+Js},...re==="end"&&(se==="top"||se==="bottom")&&{left:"auto",right:0},...Zy[e]}),ee=G1(A,{enabled:l==="hover"&&B,delay:{open:f,close:d},move:!1}),pe=jF(A,{enabled:l==="hover"&&B}),Ne=q1(A,{enabled:h&&B,escapeKey:!0}),Ze=X1(A,{role:"tooltip"}),Le=Y1([ee,pe,Ne,Ze]),Qn=t.ref,fn=K1([$.setReference,Qn]),hn=C.useMemo(()=>C.cloneElement(t,Le.getReferenceProps({...t.props,ref:fn,"data-state":A.open?"open":"closed",...A.open?{"aria-describedby":I}:{}})),[t,Le,A.open,I,fn]);return S.jsxs(S.Fragment,{children:[hn,B&&M&&S.jsx(_s,{children:S.jsx(q,{absolute:!0,zIndex:g,className:m,ref:$.setFloating,style:{...H,...y},...Le.getFloatingProps({id:I}),children:S.jsxs(q,{relative:!0,maxWidth:p,p:x,borderRadius:b,className:z.cx(j5,Se,_),children:[u&&S.jsx(q,{ref:R,className:z.cx(B5,$e)}),typeof n=="string"?S.jsx(ce,{colorName:e,variant:"caption-1",fontWeight:"medium",children:n}):n]})})})]})};Eb.displayName="Tooltip";const z5="_themeProviderScoped_wp43s_9",W5={themeProviderScoped:z5};function H5({className:e,children:t,theme:n}){const r=C.useRef(null);return S.jsx(rb.Provider,{value:r,children:S.jsx("div",{ref:r,className:Pi(W5.themeProviderScoped,e),id:"theme-provider-scoped","data-theme":n,children:t})})}exports.AnimatedText=D0;exports.Avatar=Cb;exports.Badge=wb;exports.Box=q;exports.Breadcrumbs=t5;exports.Button=Go;exports.Checkbox=ef;exports.Hint=E5;exports.IconButton=Kn;exports.Input=qo;exports.LineChart=xb;exports.Loader=ev;exports.MARKDOWN_TEXT_EDITOR_LOCALE_KEY=z0;exports.MarkdownTextEditor=G6;exports.MarkdownToolbarAction=oe;exports.Modal=Cl;exports.OtpInput=A1;exports.PieProgressChart=bb;exports.Popover=lr;exports.Portal=_s;exports.Radio=N1;exports.RadioGroup=P1;exports.Ripple=io;exports.SegmentControl=uP;exports.Select=ch;exports.Skeleton=Sb;exports.Switch=Z1;exports.Table=gi;exports.Tabs=Q1;exports.Tag=lh;exports.Text=ce;exports.ThemeProviderScoped=H5;exports.Tooltip=Eb;exports.UiKitLocaleProvider=BR;exports.createColumnHelper=ob;exports.getSizeClass=fa;exports.getStyleClass=xd;exports.useControlled=so;
|
|
71
71
|
//# sourceMappingURL=ui-kit.cjs.js.map
|