@powerhousedao/connect 1.0.0-dev.194 → 1.0.0-dev.196
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/ArrowFilledRight-blx8xu7X-D3d8PUWh.js.map +1 -1
- package/dist/assets/ArrowLeft-7pYNK4eX-8ZR_YHAJ.js.map +1 -1
- package/dist/assets/ArrowUp-Bbr_dwo_-C5ppCQo4.js.map +1 -1
- package/dist/assets/BarChart-B0G05Nfd-CHDJ7OaJ.js.map +1 -1
- package/dist/assets/BaseArrowLeft-DBzhFHMt-Dkbf2sWs.js.map +1 -1
- package/dist/assets/BaseArrowRight-DYQTBWAs-CkkPllYm.js.map +1 -1
- package/dist/assets/Braces-N-sH2Zyc-3LcexUsR.js.map +1 -1
- package/dist/assets/Branch-CWdBw1_P-CmGdOXsI.js.map +1 -1
- package/dist/assets/BrickGlobe-67zaG6_H-DP0By6z_.js.map +1 -1
- package/dist/assets/Briefcase-CedW3KRR-DO5_k15F.js.map +1 -1
- package/dist/assets/Calendar-C-6HV96D-YetudWvP.js.map +1 -1
- package/dist/assets/Caret-Ep0j0fz2-By3ojfim.js.map +1 -1
- package/dist/assets/CaretDown-3X7LFYBf-C43xdKg8.js.map +1 -1
- package/dist/assets/CaretSort-BkGdLETT-DVOzEEqR.js.map +1 -1
- package/dist/assets/Check-DV-U4AEq-B582NMZp.js.map +1 -1
- package/dist/assets/CheckCircle-DI5fEgGd-CVF4LDhR.js.map +1 -1
- package/dist/assets/CheckCircleFill-C-F0v5mB-BSW1YMqM.js.map +1 -1
- package/dist/assets/Checkmark-BXnfChpo-CyQitGI2.js.map +1 -1
- package/dist/assets/ChevronDown-ouBxrU-k-eUsCPXcB.js.map +1 -1
- package/dist/assets/Circle-n3-Wh4HS-8dOehHQf.js.map +1 -1
- package/dist/assets/CircleInfo-BhZY3C2Q-CZgYK1h2.js.map +1 -1
- package/dist/assets/ClockFill-Bd0t48q7-CcfHiJtH.js.map +1 -1
- package/dist/assets/CloudSlash-B-zJBjaD-CxVyp-Ac.js.map +1 -1
- package/dist/assets/Collapse-DRDB8Czs-CGcuZQgy.js.map +1 -1
- package/dist/assets/Connect-Dme-qfKq-CgniLji8.js.map +1 -1
- package/dist/assets/Discord-CAS0Cj7s-CcsBWpnf.js.map +1 -1
- package/dist/assets/Drive-GMcgBcIY-CzahDx9j.js.map +1 -1
- package/dist/assets/Ellipsis-XK8AwMEC-BuVBeYhB.js.map +1 -1
- package/dist/assets/Error-BmIZ2ZUy-CphzuMLn.js.map +1 -1
- package/dist/assets/Exclamation-CVsNS_QS-DLccamql.js.map +1 -1
- package/dist/assets/FilesEarmark-CyrCQy8E-Bhut4E02.js.map +1 -1
- package/dist/assets/FolderClose-DG_qHisc-CH6NoBuu.js.map +1 -1
- package/dist/assets/FolderOpen-kDoWFkJO-Cciutkdg.js.map +1 -1
- package/dist/assets/FolderPlus-CSBSl9lZ-CifD0ek9.js.map +1 -1
- package/dist/assets/Forum-DZ-CkLFh-BwabccAX.js.map +1 -1
- package/dist/assets/Gear-cUlHJ4q6-B9R2l_9_.js.map +1 -1
- package/dist/assets/Github-0PLiINY0-CjkZIHCO.js.map +1 -1
- package/dist/assets/Globe-CIYqVkpa-CL530H46.js.map +1 -1
- package/dist/assets/GlobeWww-DN4yKujh-Ci7aa5CE.js.map +1 -1
- package/dist/assets/Hdd-Dn_LdJIh-CJ6x9Bve.js.map +1 -1
- package/dist/assets/History-BP4SmaS_-P4WBKyqX.js.map +1 -1
- package/dist/assets/InfoSquare-C98JaLiz-yPcGR71f.js.map +1 -1
- package/dist/assets/Link-BF7aZjVu-CXIVQOz6.js.map +1 -1
- package/dist/assets/Linkedin-DJwIkS6q-Dkb5Tp_Z.js.map +1 -1
- package/dist/assets/Lock-PyaFHdNS-D_qxRTye.js.map +1 -1
- package/dist/assets/M-DozhhPMY-DBQw97P_.js.map +1 -1
- package/dist/assets/Pencil-D7lvxXIP-D830iveq.js.map +1 -1
- package/dist/assets/People-CUB8LYKf-CyJmMqcw.js.map +1 -1
- package/dist/assets/Person-DuL4PQzm-ttQR0nPy.js.map +1 -1
- package/dist/assets/Plus-DPFWGJM4-BztpK8li.js.map +1 -1
- package/dist/assets/PlusCircle-BEnWRjHa-w5zztKGx.js.map +1 -1
- package/dist/assets/PowerhouseLogoSmall-CmO95IAS-CDGLkst3.js.map +1 -1
- package/dist/assets/Project-BlXuclr0-EsBam9d0.js.map +1 -1
- package/dist/assets/RedoArrow-BJeEsiph-BbidqIFP.js.map +1 -1
- package/dist/assets/Renown-6m7hx37h-CItksi2j.js.map +1 -1
- package/dist/assets/RenownHover-CQ0TZHZv-cYQgnwQW.js.map +1 -1
- package/dist/assets/Ring-DKv0gnwT-CDHLz87h.js.map +1 -1
- package/dist/assets/Save-BBxj68pn-BkUvn89C.js.map +1 -1
- package/dist/assets/Search-YUJuRBLe-CecGUkZA.js.map +1 -1
- package/dist/assets/Server-Bfkkjui1-lBan_3Dm.js.map +1 -1
- package/dist/assets/Settings-mbbylBS5-Cca-sV-_.js.map +1 -1
- package/dist/assets/Synced-DKJXzPiw-Cui8pDsS.js.map +1 -1
- package/dist/assets/Syncing-aT9WSMFf-2VhhyCcX.js.map +1 -1
- package/dist/assets/Trash-CgSbHk-P-DIYkVMER.js.map +1 -1
- package/dist/assets/TrashFill-DN50ercb-Oqx67xXN.js.map +1 -1
- package/dist/assets/VariantArrowLeft-CnuX59_e-6Zt_Q3tm.js.map +1 -1
- package/dist/assets/VerticalDots-C8QYf7et-CCxZfvjq.js.map +1 -1
- package/dist/assets/WarningFill-WowAvi5P-D5XCckM6.js.map +1 -1
- package/dist/assets/XTwitter-k3Pt8itk-mvLk8TKx.js.map +1 -1
- package/dist/assets/Xmark-8qnJCs2Y-CZ3t0Fap.js.map +1 -1
- package/dist/assets/XmarkLight-GHzDR5_F-CloMvuzt.js.map +1 -1
- package/dist/assets/Youtube-i8V0IXUU-Bkiwoayp.js.map +1 -1
- package/dist/assets/app-DMbRv48W.js +842 -0
- package/dist/assets/app-DMbRv48W.js.map +1 -0
- package/dist/assets/{app-loader-DTyquthS.js → app-loader-B-7H_0n2.js} +3 -3
- package/dist/assets/app-loader-B-7H_0n2.js.map +1 -0
- package/dist/assets/app-loader-D5wPX62N.css +1 -0
- package/dist/assets/browser-fQq8R1F1.js +43 -0
- package/dist/assets/browser-fQq8R1F1.js.map +1 -0
- package/dist/assets/{ccip-CMd4NU0O.js → ccip-BkRKvmCn.js} +2 -2
- package/dist/assets/ccip-BkRKvmCn.js.map +1 -0
- package/dist/assets/{content-DuUJeNRk.js → content-CY1t5ZPS.js} +4 -4
- package/dist/assets/content-CY1t5ZPS.js.map +1 -0
- package/dist/assets/{editor-60nGXV5G.js → editor-BU_HPUTO.js} +2 -2
- package/dist/assets/editor-BU_HPUTO.js.map +1 -0
- package/dist/assets/{editor-SnTX_0Eh.js → editor-C9za-U8_.js} +2 -2
- package/dist/assets/editor-C9za-U8_.js.map +1 -0
- package/dist/assets/{editor-tXMAhhZ0.js → editor-DO9jbAMx.js} +2 -2
- package/dist/assets/editor-DO9jbAMx.js.map +1 -0
- package/dist/assets/editors-COXpwqHa.js +347 -0
- package/dist/assets/editors-COXpwqHa.js.map +1 -0
- package/dist/assets/index-D1LwEkcT.js +3 -0
- package/dist/assets/{index-rlVa-8hF.js.map → index-D1LwEkcT.js.map} +1 -1
- package/dist/assets/{index-iRdto7dq.js → index-Ds4JuW6y.js} +2 -2
- package/dist/assets/index-Ds4JuW6y.js.map +1 -0
- package/dist/assets/{index-T6Et30Eh-DxlgfU62.js → index-T6Et30Eh-CdVwpIBO.js} +2 -2
- package/dist/assets/index-T6Et30Eh-CdVwpIBO.js.map +1 -0
- package/dist/assets/{main.DLWbv_vx.js → main.DInypdBk.js} +2 -2
- package/dist/assets/{main.DLWbv_vx.js.map → main.DInypdBk.js.map} +1 -1
- package/dist/assets/{root-BghZOZj9.js → root-CiI1Fw1i.js} +2 -2
- package/dist/assets/root-CiI1Fw1i.js.map +1 -0
- package/dist/assets/{router-pGZaooV3.js → router-yYGizFGD.js} +5 -5
- package/dist/assets/router-yYGizFGD.js.map +1 -0
- package/dist/assets/{useUiNodes-DTFyFdCU.js → useUiNodes-CQcKl7SU.js} +2 -2
- package/dist/assets/useUiNodes-CQcKl7SU.js.map +1 -0
- package/dist/index.html +3 -3
- package/dist/service-worker.js +1 -1
- package/dist/studio/cli.js +1 -0
- package/dist/swEnv.js +2 -2
- package/dist/vite-envs.sh +5 -5
- package/package.json +133 -149
- package/dist/assets/app-aIjV4D02.js +0 -1142
- package/dist/assets/app-aIjV4D02.js.map +0 -1
- package/dist/assets/app-loader-DTyquthS.js.map +0 -1
- package/dist/assets/app-loader-DoI5W0wZ.css +0 -1
- package/dist/assets/browser-CBSNeV4c.js +0 -42
- package/dist/assets/browser-CBSNeV4c.js.map +0 -1
- package/dist/assets/ccip-CMd4NU0O.js.map +0 -1
- package/dist/assets/content-DuUJeNRk.js.map +0 -1
- package/dist/assets/editor-60nGXV5G.js.map +0 -1
- package/dist/assets/editor-Dz4kC13f.js +0 -2
- package/dist/assets/editor-Dz4kC13f.js.map +0 -1
- package/dist/assets/editor-SnTX_0Eh.js.map +0 -1
- package/dist/assets/editor-tXMAhhZ0.js.map +0 -1
- package/dist/assets/editors-BKkmhJH6.js +0 -380
- package/dist/assets/editors-BKkmhJH6.js.map +0 -1
- package/dist/assets/index-T6Et30Eh-DxlgfU62.js.map +0 -1
- package/dist/assets/index-iRdto7dq.js.map +0 -1
- package/dist/assets/index-rlVa-8hF.js +0 -3
- package/dist/assets/root-BghZOZj9.js.map +0 -1
- package/dist/assets/router-pGZaooV3.js.map +0 -1
- package/dist/assets/useUiNodes-DTFyFdCU.js.map +0 -1
|
@@ -1,380 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/editor-60nGXV5G.js","assets/main.DLWbv_vx.js","assets/app-aIjV4D02.js","assets/app-loader-DTyquthS.js","assets/app-loader-DoI5W0wZ.css","assets/editor-SnTX_0Eh.js","assets/editor-tXMAhhZ0.js","assets/editor-Dz4kC13f.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{_ as __vitePreload}from"./main.DLWbv_vx.js";import{jsx,jsxs,Fragment}from"react/jsx-runtime";import*as y$2 from"react";import y__default,{forwardRef,createContext,memo,useCallback,useState,useMemo,Suspense,useRef,useReducer,useEffect,useContext,lazy,useLayoutEffect,Fragment as Fragment$1,Component,useImperativeHandle,useId}from"react";import{Y as py$1,Z as JR,_ as Ir$3,$ as sr$2,a0 as $$4,a1 as index,a2 as Hr$3,a3 as K8,a4 as Ci$1,a5 as h$2,a6 as actions,a7 as xo$2}from"./app-aIjV4D02.js";import*as hc from"react-dom";import hc__default,{createPortal}from"react-dom";var yo$1,Ri;function Cf(){if(Ri)return yo$1;Ri=1;var vo="Expected a function",Ai=NaN,bo="[object Symbol]",Ra=/^\s+|\s+$/g,pc=/^[-+]0x[0-9a-f]+$/i,mc=/^0b[01]+$/i,uf=/^0o[0-7]+$/i,df=parseInt,ff=typeof sr$2=="object"&&sr$2&&sr$2.Object===Object&&sr$2,hf=typeof self=="object"&&self&&self.Object===Object&&self,pf=ff||hf||Function("return this")(),mf=Object.prototype,gf=mf.toString,yf=Math.max,vf=Math.min,bf=function(){return pf.Date.now()};function Sf(s1,c1,u1){var T1,_1,R1,P1,E1,M1,m1=0,$1=!1,k1=!1,F1=!0;if(typeof s1!="function")throw new TypeError(vo);c1=l1(c1)||0,xf(u1)&&($1=!!u1.leading,k1="maxWait"in u1,R1=k1?yf(l1(u1.maxWait)||0,c1):R1,F1="trailing"in u1?!!u1.trailing:F1);function U1(z1){var K1=T1,tT=_1;return T1=_1=void 0,m1=z1,P1=s1.apply(tT,K1),P1}function B1(z1){return m1=z1,E1=setTimeout(O1,c1),$1?U1(z1):P1}function W1(z1){var K1=z1-M1,tT=z1-m1,iT=c1-K1;return k1?vf(iT,R1-tT):iT}function Z1(z1){var K1=z1-M1,tT=z1-m1;return M1===void 0||K1>=c1||K1<0||k1&&tT>=R1}function O1(){var z1=bf();if(Z1(z1))return j1(z1);E1=setTimeout(O1,W1(z1))}function j1(z1){return E1=void 0,F1&&T1?U1(z1):(T1=_1=void 0,P1)}function L1(){E1!==void 0&&clearTimeout(E1),m1=0,T1=M1=_1=E1=void 0}function G1(){return E1===void 0?P1:j1(bf())}function Y1(){var z1=bf(),K1=Z1(z1);if(T1=arguments,_1=this,M1=z1,K1){if(E1===void 0)return B1(M1);if(k1)return E1=setTimeout(O1,c1),U1(M1)}return E1===void 0&&(E1=setTimeout(O1,c1)),P1}return Y1.cancel=L1,Y1.flush=G1,Y1}function xf(s1){var c1=typeof s1;return!!s1&&(c1=="object"||c1=="function")}function wf(s1){return!!s1&&typeof s1=="object"}function If(s1){return typeof s1=="symbol"||wf(s1)&&gf.call(s1)==bo}function l1(s1){if(typeof s1=="number")return s1;if(If(s1))return Ai;if(xf(s1)){var c1=typeof s1.valueOf=="function"?s1.valueOf():s1;s1=xf(c1)?c1+"":c1}if(typeof s1!="string")return s1===0?s1:+s1;s1=s1.replace(Ra,"");var u1=mc.test(s1);return u1||uf.test(s1)?df(s1.slice(2),u1?2:8):pc.test(s1)?Ai:+s1}return yo$1=Sf,yo$1}Cf();var qn$1=vo=>vo.type==="checkbox",Gt$2=vo=>vo instanceof Date,Be$2=vo=>vo==null;const gc=vo=>typeof vo=="object";var Te$1=vo=>!Be$2(vo)&&!Array.isArray(vo)&&gc(vo)&&!Gt$2(vo),vc=vo=>Te$1(vo)&&vo.target?qn$1(vo.target)?vo.target.checked:vo.target.value:vo,Ef=vo=>vo.substring(0,vo.search(/\.\d+(\.|$)/))||vo,bc=(vo,Ai)=>vo.has(Ef(Ai)),Pf=vo=>{const Ai=vo.constructor&&vo.constructor.prototype;return Te$1(Ai)&&Ai.hasOwnProperty("isPrototypeOf")},_a$1=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function De$2(vo){let Ai;const bo=Array.isArray(vo),Ra=typeof FileList<"u"?vo instanceof FileList:!1;if(vo instanceof Date)Ai=new Date(vo);else if(vo instanceof Set)Ai=new Set(vo);else if(!(_a$1&&(vo instanceof Blob||Ra))&&(bo||Te$1(vo)))if(Ai=bo?[]:{},!bo&&!Pf(vo))Ai=vo;else for(const pc in vo)vo.hasOwnProperty(pc)&&(Ai[pc]=De$2(vo[pc]));else return vo;return Ai}var Xn$1=vo=>Array.isArray(vo)?vo.filter(Boolean):[],Se$1=vo=>vo===void 0,B$3=(vo,Ai,bo)=>{if(!Ai||!Te$1(vo))return bo;const Ra=Xn$1(Ai.split(/[,[\].]+?/)).reduce((pc,mc)=>Be$2(pc)?pc:pc[mc],vo);return Se$1(Ra)||Ra===vo?Se$1(vo[Ai])?bo:vo[Ai]:Ra},Qe$2=vo=>typeof vo=="boolean",ka=vo=>/^\w*$/.test(vo),yc=vo=>Xn$1(vo.replace(/["|']|\]/g,"").split(/\.|\[/)),ge$2=(vo,Ai,bo)=>{let Ra=-1;const pc=ka(Ai)?[Ai]:yc(Ai),mc=pc.length,uf=mc-1;for(;++Ra<mc;){const df=pc[Ra];let ff=bo;if(Ra!==uf){const hf=vo[df];ff=Te$1(hf)||Array.isArray(hf)?hf:isNaN(+pc[Ra+1])?{}:[]}if(df==="__proto__"||df==="constructor"||df==="prototype")return;vo[df]=ff,vo=vo[df]}return vo};const Er$2={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Je$1={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},wt$2={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},wc=y__default.createContext(null),Yr$2=()=>y__default.useContext(wc),p1=vo=>{const{children:Ai,...bo}=vo;return y__default.createElement(wc.Provider,{value:bo},Ai)};var xc=(vo,Ai,bo,Ra=!0)=>{const pc={defaultValues:Ai._defaultValues};for(const mc in vo)Object.defineProperty(pc,mc,{get:()=>{const uf=mc;return Ai._proxyFormState[uf]!==Je$1.all&&(Ai._proxyFormState[uf]=!Ra||Je$1.all),bo&&(bo[uf]=!0),vo[uf]}});return pc},We$2=vo=>Te$1(vo)&&!Object.keys(vo).length,Sc=(vo,Ai,bo,Ra)=>{bo(vo);const{name:pc,...mc}=vo;return We$2(mc)||Object.keys(mc).length>=Object.keys(Ai).length||Object.keys(mc).find(uf=>Ai[uf]===(!Ra||Je$1.all))},Ge$2=vo=>Array.isArray(vo)?vo:[vo],Cc=(vo,Ai,bo)=>!vo||!Ai||vo===Ai||Ge$2(vo).some(Ra=>Ra&&(bo?Ra===Ai:Ra.startsWith(Ai)||Ai.startsWith(Ra)));function Gr$2(vo){const Ai=y__default.useRef(vo);Ai.current=vo,y__default.useEffect(()=>{const bo=!vo.disabled&&Ai.current.subject&&Ai.current.subject.subscribe({next:Ai.current.next});return()=>{bo&&bo.unsubscribe()}},[vo.disabled])}function Tf(vo){const Ai=Yr$2(),{control:bo=Ai.control,disabled:Ra,name:pc,exact:mc}=vo,[uf,df]=y__default.useState(bo._formState),ff=y__default.useRef(!0),hf=y__default.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),pf=y__default.useRef(pc);return pf.current=pc,Gr$2({disabled:Ra,next:mf=>ff.current&&Cc(pf.current,mf.name,mc)&&Sc(mf,hf.current,bo._updateFormState)&&df({...bo._formState,...mf}),subject:bo._subjects.state}),y__default.useEffect(()=>(ff.current=!0,hf.current.isValid&&bo._updateValid(!0),()=>{ff.current=!1}),[bo]),y__default.useMemo(()=>xc(uf,bo,hf.current,!1),[uf,bo])}var ht$2=vo=>typeof vo=="string",Ic=(vo,Ai,bo,Ra,pc)=>ht$2(vo)?(Ra&&Ai.watch.add(vo),B$3(bo,vo,pc)):Array.isArray(vo)?vo.map(mc=>(Ra&&Ai.watch.add(mc),B$3(bo,mc))):(Ra&&(Ai.watchAll=!0),bo);function kt$2(vo){const Ai=Yr$2(),{control:bo=Ai.control,name:Ra,defaultValue:pc,disabled:mc,exact:uf}=vo||{},df=y__default.useRef(Ra);df.current=Ra,Gr$2({disabled:mc,subject:bo._subjects.values,next:pf=>{Cc(df.current,pf.name,uf)&&hf(De$2(Ic(df.current,bo._names,pf.values||bo._formValues,!1,pc)))}});const[ff,hf]=y__default.useState(bo._getWatch(Ra,pc));return y__default.useEffect(()=>bo._removeUnmounted()),ff}function Of(vo){const Ai=Yr$2(),{name:bo,disabled:Ra,control:pc=Ai.control,shouldUnregister:mc}=vo,uf=bc(pc._names.array,bo),df=kt$2({control:pc,name:bo,defaultValue:B$3(pc._formValues,bo,B$3(pc._defaultValues,bo,vo.defaultValue)),exact:!0}),ff=Tf({control:pc,name:bo,exact:!0}),hf=y__default.useRef(pc.register(bo,{...vo.rules,value:df,...Qe$2(vo.disabled)?{disabled:vo.disabled}:{}})),pf=y__default.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!B$3(ff.errors,bo)},isDirty:{enumerable:!0,get:()=>!!B$3(ff.dirtyFields,bo)},isTouched:{enumerable:!0,get:()=>!!B$3(ff.touchedFields,bo)},isValidating:{enumerable:!0,get:()=>!!B$3(ff.validatingFields,bo)},error:{enumerable:!0,get:()=>B$3(ff.errors,bo)}}),[ff,bo]),mf=y__default.useMemo(()=>({name:bo,value:df,...Qe$2(Ra)||ff.disabled?{disabled:ff.disabled||Ra}:{},onChange:gf=>hf.current.onChange({target:{value:vc(gf),name:bo},type:Er$2.CHANGE}),onBlur:()=>hf.current.onBlur({target:{value:B$3(pc._formValues,bo),name:bo},type:Er$2.BLUR}),ref:gf=>{const yf=B$3(pc._fields,bo);yf&&gf&&(yf._f.ref={focus:()=>gf.focus(),select:()=>gf.select(),setCustomValidity:vf=>gf.setCustomValidity(vf),reportValidity:()=>gf.reportValidity()})}}),[bo,pc._formValues,Ra,ff.disabled,df,pc._fields]);return y__default.useEffect(()=>{const gf=pc._options.shouldUnregister||mc,yf=(vf,bf)=>{const Sf=B$3(pc._fields,vf);Sf&&Sf._f&&(Sf._f.mount=bf)};if(yf(bo,!0),gf){const vf=De$2(B$3(pc._options.defaultValues,bo));ge$2(pc._defaultValues,bo,vf),Se$1(B$3(pc._formValues,bo))&&ge$2(pc._formValues,bo,vf)}return!uf&&pc.register(bo),()=>{(uf?gf&&!pc._state.action:gf)?pc.unregister(bo):yf(bo,!1)}},[bo,pc,uf,mc]),y__default.useEffect(()=>{pc._updateDisabledField({disabled:Ra,fields:pc._fields,name:bo})},[Ra,bo,pc]),y__default.useMemo(()=>({field:mf,formState:ff,fieldState:pf}),[mf,ff,pf])}const Ec=vo=>vo.render(Of(vo));var Mf=(vo,Ai,bo,Ra,pc)=>Ai?{...bo[vo],types:{...bo[vo]&&bo[vo].types?bo[vo].types:{},[Ra]:pc||!0}}:{},Tt$2=()=>{const vo=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,Ai=>{const bo=(Math.random()*16+vo)%16|0;return(Ai=="x"?bo:bo&3|8).toString(16)})},wo=(vo,Ai,bo={})=>bo.shouldFocus||Se$1(bo.shouldFocus)?bo.focusName||`${vo}.${Se$1(bo.focusIndex)?Ai:bo.focusIndex}.`:"",_n$2=vo=>({isOnSubmit:!vo||vo===Je$1.onSubmit,isOnBlur:vo===Je$1.onBlur,isOnChange:vo===Je$1.onChange,isOnAll:vo===Je$1.all,isOnTouch:vo===Je$1.onTouched}),ca$1=(vo,Ai,bo)=>!bo&&(Ai.watchAll||Ai.watch.has(vo)||[...Ai.watch].some(Ra=>vo.startsWith(Ra)&&/^\.\w+/.test(vo.slice(Ra.length))));const sn$1=(vo,Ai,bo,Ra)=>{for(const pc of bo||Object.keys(vo)){const mc=B$3(vo,pc);if(mc){const{_f:uf,...df}=mc;if(uf){if(uf.refs&&uf.refs[0]&&Ai(uf.refs[0],pc)&&!Ra||uf.ref&&Ai(uf.ref,uf.name)&&!Ra)return!0;if(sn$1(df,Ai))break}else if(Te$1(df)&&sn$1(df,Ai))break}}};var Pc=(vo,Ai,bo)=>{const Ra=Ge$2(B$3(vo,bo));return ge$2(Ra,"root",Ai[bo]),ge$2(vo,bo,Ra),vo},Fa=vo=>vo.type==="file",ft$2=vo=>typeof vo=="function",Pr$2=vo=>{if(!_a$1)return!1;const Ai=vo?vo.ownerDocument:0;return vo instanceof(Ai&&Ai.defaultView?Ai.defaultView.HTMLElement:HTMLElement)},vr$2=vo=>ht$2(vo),Va=vo=>vo.type==="radio",Tr$2=vo=>vo instanceof RegExp;const _i={value:!1,isValid:!1},ki$1={value:!0,isValid:!0};var Tc=vo=>{if(Array.isArray(vo)){if(vo.length>1){const Ai=vo.filter(bo=>bo&&bo.checked&&!bo.disabled).map(bo=>bo.value);return{value:Ai,isValid:!!Ai.length}}return vo[0].checked&&!vo[0].disabled?vo[0].attributes&&!Se$1(vo[0].attributes.value)?Se$1(vo[0].value)||vo[0].value===""?ki$1:{value:vo[0].value,isValid:!0}:ki$1:_i}return _i};const Fi$1={isValid:!1,value:null};var Oc=vo=>Array.isArray(vo)?vo.reduce((Ai,bo)=>bo&&bo.checked&&!bo.disabled?{isValid:!0,value:bo.value}:Ai,Fi$1):Fi$1;function Vi(vo,Ai,bo="validate"){if(vr$2(vo)||Array.isArray(vo)&&vo.every(vr$2)||Qe$2(vo)&&!vo)return{type:bo,message:vr$2(vo)?vo:"",ref:Ai}}var Jt$1=vo=>Te$1(vo)&&!Tr$2(vo)?vo:{value:vo,message:""},la$1=async(vo,Ai,bo,Ra,pc,mc)=>{const{ref:uf,refs:df,required:ff,maxLength:hf,minLength:pf,min:mf,max:gf,pattern:yf,validate:vf,name:bf,valueAsNumber:Sf,mount:xf}=vo._f,wf=B$3(bo,bf);if(!xf||Ai.has(bf))return{};const If=df?df[0]:uf,l1=E1=>{pc&&If.reportValidity&&(If.setCustomValidity(Qe$2(E1)?"":E1||""),If.reportValidity())},s1={},c1=Va(uf),u1=qn$1(uf),T1=c1||u1,_1=(Sf||Fa(uf))&&Se$1(uf.value)&&Se$1(wf)||Pr$2(uf)&&uf.value===""||wf===""||Array.isArray(wf)&&!wf.length,R1=Mf.bind(null,bf,Ra,s1),P1=(E1,M1,m1,$1=wt$2.maxLength,k1=wt$2.minLength)=>{const F1=E1?M1:m1;s1[bf]={type:E1?$1:k1,message:F1,ref:uf,...R1(E1?$1:k1,F1)}};if(mc?!Array.isArray(wf)||!wf.length:ff&&(!T1&&(_1||Be$2(wf))||Qe$2(wf)&&!wf||u1&&!Tc(df).isValid||c1&&!Oc(df).isValid)){const{value:E1,message:M1}=vr$2(ff)?{value:!!ff,message:ff}:Jt$1(ff);if(E1&&(s1[bf]={type:wt$2.required,message:M1,ref:If,...R1(wt$2.required,M1)},!Ra))return l1(M1),s1}if(!_1&&(!Be$2(mf)||!Be$2(gf))){let E1,M1;const m1=Jt$1(gf),$1=Jt$1(mf);if(!Be$2(wf)&&!isNaN(wf)){const k1=uf.valueAsNumber||wf&&+wf;Be$2(m1.value)||(E1=k1>m1.value),Be$2($1.value)||(M1=k1<$1.value)}else{const k1=uf.valueAsDate||new Date(wf),F1=W1=>new Date(new Date().toDateString()+" "+W1),U1=uf.type=="time",B1=uf.type=="week";ht$2(m1.value)&&wf&&(E1=U1?F1(wf)>F1(m1.value):B1?wf>m1.value:k1>new Date(m1.value)),ht$2($1.value)&&wf&&(M1=U1?F1(wf)<F1($1.value):B1?wf<$1.value:k1<new Date($1.value))}if((E1||M1)&&(P1(!!E1,m1.message,$1.message,wt$2.max,wt$2.min),!Ra))return l1(s1[bf].message),s1}if((hf||pf)&&!_1&&(ht$2(wf)||mc&&Array.isArray(wf))){const E1=Jt$1(hf),M1=Jt$1(pf),m1=!Be$2(E1.value)&&wf.length>+E1.value,$1=!Be$2(M1.value)&&wf.length<+M1.value;if((m1||$1)&&(P1(m1,E1.message,M1.message),!Ra))return l1(s1[bf].message),s1}if(yf&&!_1&&ht$2(wf)){const{value:E1,message:M1}=Jt$1(yf);if(Tr$2(E1)&&!wf.match(E1)&&(s1[bf]={type:wt$2.pattern,message:M1,ref:uf,...R1(wt$2.pattern,M1)},!Ra))return l1(M1),s1}if(vf){if(ft$2(vf)){const E1=await vf(wf,bo),M1=Vi(E1,If);if(M1&&(s1[bf]={...M1,...R1(wt$2.validate,M1.message)},!Ra))return l1(M1.message),s1}else if(Te$1(vf)){let E1={};for(const M1 in vf){if(!We$2(E1)&&!Ra)break;const m1=Vi(await vf[M1](wf,bo),If,M1);m1&&(E1={...m1,...R1(M1,m1.message)},l1(m1.message),Ra&&(s1[bf]=E1))}if(!We$2(E1)&&(s1[bf]={ref:If,...E1},!Ra))return s1}}return l1(!0),s1},xo$1=(vo,Ai)=>[...vo,...Ge$2(Ai)],So=vo=>Array.isArray(vo)?vo.map(()=>{}):void 0;function Co(vo,Ai,bo){return[...vo.slice(0,Ai),...Ge$2(bo),...vo.slice(Ai)]}var Io=(vo,Ai,bo)=>Array.isArray(vo)?(Se$1(vo[bo])&&(vo[bo]=void 0),vo.splice(bo,0,vo.splice(Ai,1)[0]),vo):[],Eo=(vo,Ai)=>[...Ge$2(Ai),...Ge$2(vo)];function Nf(vo,Ai){let bo=0;const Ra=[...vo];for(const pc of Ai)Ra.splice(pc-bo,1),bo++;return Xn$1(Ra).length?Ra:[]}var Po=(vo,Ai)=>Se$1(Ai)?[]:Nf(vo,Ge$2(Ai).sort((bo,Ra)=>bo-Ra)),To$1=(vo,Ai,bo)=>{[vo[Ai],vo[bo]]=[vo[bo],vo[Ai]]};function Af(vo,Ai){const bo=Ai.slice(0,-1).length;let Ra=0;for(;Ra<bo;)vo=Se$1(vo)?Ra++:vo[Ai[Ra++]];return vo}function Df(vo){for(const Ai in vo)if(vo.hasOwnProperty(Ai)&&!Se$1(vo[Ai]))return!1;return!0}function Oe$2(vo,Ai){const bo=Array.isArray(Ai)?Ai:ka(Ai)?[Ai]:yc(Ai),Ra=bo.length===1?vo:Af(vo,bo),pc=bo.length-1,mc=bo[pc];return Ra&&delete Ra[mc],pc!==0&&(Te$1(Ra)&&We$2(Ra)||Array.isArray(Ra)&&Df(Ra))&&Oe$2(vo,bo.slice(0,-1)),vo}var Li=(vo,Ai,bo)=>(vo[Ai]=bo,vo);function Rf(vo){const Ai=Yr$2(),{control:bo=Ai.control,name:Ra,keyName:pc="id",shouldUnregister:mc,rules:uf}=vo,[df,ff]=y__default.useState(bo._getFieldArray(Ra)),hf=y__default.useRef(bo._getFieldArray(Ra).map(Tt$2)),pf=y__default.useRef(df),mf=y__default.useRef(Ra),gf=y__default.useRef(!1);mf.current=Ra,pf.current=df,bo._names.array.add(Ra),uf&&bo.register(Ra,uf),Gr$2({next:({values:c1,name:u1})=>{if(u1===mf.current||!u1){const T1=B$3(c1,mf.current);Array.isArray(T1)&&(ff(T1),hf.current=T1.map(Tt$2))}},subject:bo._subjects.array});const yf=y__default.useCallback(c1=>{gf.current=!0,bo._updateFieldArray(Ra,c1)},[bo,Ra]),vf=(c1,u1)=>{const T1=Ge$2(De$2(c1)),_1=xo$1(bo._getFieldArray(Ra),T1);bo._names.focus=wo(Ra,_1.length-1,u1),hf.current=xo$1(hf.current,T1.map(Tt$2)),yf(_1),ff(_1),bo._updateFieldArray(Ra,_1,xo$1,{argA:So(c1)})},bf=(c1,u1)=>{const T1=Ge$2(De$2(c1)),_1=Eo(bo._getFieldArray(Ra),T1);bo._names.focus=wo(Ra,0,u1),hf.current=Eo(hf.current,T1.map(Tt$2)),yf(_1),ff(_1),bo._updateFieldArray(Ra,_1,Eo,{argA:So(c1)})},Sf=c1=>{const u1=Po(bo._getFieldArray(Ra),c1);hf.current=Po(hf.current,c1),yf(u1),ff(u1),!Array.isArray(B$3(bo._fields,Ra))&&ge$2(bo._fields,Ra,void 0),bo._updateFieldArray(Ra,u1,Po,{argA:c1})},xf=(c1,u1,T1)=>{const _1=Ge$2(De$2(u1)),R1=Co(bo._getFieldArray(Ra),c1,_1);bo._names.focus=wo(Ra,c1,T1),hf.current=Co(hf.current,c1,_1.map(Tt$2)),yf(R1),ff(R1),bo._updateFieldArray(Ra,R1,Co,{argA:c1,argB:So(u1)})},wf=(c1,u1)=>{const T1=bo._getFieldArray(Ra);To$1(T1,c1,u1),To$1(hf.current,c1,u1),yf(T1),ff(T1),bo._updateFieldArray(Ra,T1,To$1,{argA:c1,argB:u1},!1)},If=(c1,u1)=>{const T1=bo._getFieldArray(Ra);Io(T1,c1,u1),Io(hf.current,c1,u1),yf(T1),ff(T1),bo._updateFieldArray(Ra,T1,Io,{argA:c1,argB:u1},!1)},l1=(c1,u1)=>{const T1=De$2(u1),_1=Li(bo._getFieldArray(Ra),c1,T1);hf.current=[..._1].map((R1,P1)=>!R1||P1===c1?Tt$2():hf.current[P1]),yf(_1),ff([..._1]),bo._updateFieldArray(Ra,_1,Li,{argA:c1,argB:T1},!0,!1)},s1=c1=>{const u1=Ge$2(De$2(c1));hf.current=u1.map(Tt$2),yf([...u1]),ff([...u1]),bo._updateFieldArray(Ra,[...u1],T1=>T1,{},!0,!1)};return y__default.useEffect(()=>{if(bo._state.action=!1,ca$1(Ra,bo._names)&&bo._subjects.state.next({...bo._formState}),gf.current&&(!_n$2(bo._options.mode).isOnSubmit||bo._formState.isSubmitted))if(bo._options.resolver)bo._executeSchema([Ra]).then(c1=>{const u1=B$3(c1.errors,Ra),T1=B$3(bo._formState.errors,Ra);(T1?!u1&&T1.type||u1&&(T1.type!==u1.type||T1.message!==u1.message):u1&&u1.type)&&(u1?ge$2(bo._formState.errors,Ra,u1):Oe$2(bo._formState.errors,Ra),bo._subjects.state.next({errors:bo._formState.errors}))});else{const c1=B$3(bo._fields,Ra);c1&&c1._f&&!(_n$2(bo._options.reValidateMode).isOnSubmit&&_n$2(bo._options.mode).isOnSubmit)&&la$1(c1,bo._names.disabled,bo._formValues,bo._options.criteriaMode===Je$1.all,bo._options.shouldUseNativeValidation,!0).then(u1=>!We$2(u1)&&bo._subjects.state.next({errors:Pc(bo._formState.errors,u1,Ra)}))}bo._subjects.values.next({name:Ra,values:{...bo._formValues}}),bo._names.focus&&sn$1(bo._fields,(c1,u1)=>{if(bo._names.focus&&u1.startsWith(bo._names.focus)&&c1.focus)return c1.focus(),1}),bo._names.focus="",bo._updateValid(),gf.current=!1},[df,Ra,bo]),y__default.useEffect(()=>(!B$3(bo._formValues,Ra)&&bo._updateFieldArray(Ra),()=>{(bo._options.shouldUnregister||mc)&&bo.unregister(Ra)}),[Ra,bo,pc,mc]),{swap:y__default.useCallback(wf,[yf,Ra,bo]),move:y__default.useCallback(If,[yf,Ra,bo]),prepend:y__default.useCallback(bf,[yf,Ra,bo]),append:y__default.useCallback(vf,[yf,Ra,bo]),remove:y__default.useCallback(Sf,[yf,Ra,bo]),insert:y__default.useCallback(xf,[yf,Ra,bo]),update:y__default.useCallback(l1,[yf,Ra,bo]),replace:y__default.useCallback(s1,[yf,Ra,bo]),fields:y__default.useMemo(()=>df.map((c1,u1)=>({...c1,[pc]:hf.current[u1]||Tt$2()})),[df,pc])}}var Oo=()=>{let vo=[];return{get observers(){return vo},next:Ai=>{for(const bo of vo)bo.next&&bo.next(Ai)},subscribe:Ai=>(vo.push(Ai),{unsubscribe:()=>{vo=vo.filter(bo=>bo!==Ai)}}),unsubscribe:()=>{vo=[]}}},ua$1=vo=>Be$2(vo)||!gc(vo);function Rt$2(vo,Ai){if(ua$1(vo)||ua$1(Ai))return vo===Ai;if(Gt$2(vo)&&Gt$2(Ai))return vo.getTime()===Ai.getTime();const bo=Object.keys(vo),Ra=Object.keys(Ai);if(bo.length!==Ra.length)return!1;for(const pc of bo){const mc=vo[pc];if(!Ra.includes(pc))return!1;if(pc!=="ref"){const uf=Ai[pc];if(Gt$2(mc)&&Gt$2(uf)||Te$1(mc)&&Te$1(uf)||Array.isArray(mc)&&Array.isArray(uf)?!Rt$2(mc,uf):mc!==uf)return!1}}return!0}var Mc=vo=>vo.type==="select-multiple",_f=vo=>Va(vo)||qn$1(vo),Mo$1=vo=>Pr$2(vo)&&vo.isConnected,Nc=vo=>{for(const Ai in vo)if(ft$2(vo[Ai]))return!0;return!1};function Or$1(vo,Ai={}){const bo=Array.isArray(vo);if(Te$1(vo)||bo)for(const Ra in vo)Array.isArray(vo[Ra])||Te$1(vo[Ra])&&!Nc(vo[Ra])?(Ai[Ra]=Array.isArray(vo[Ra])?[]:{},Or$1(vo[Ra],Ai[Ra])):Be$2(vo[Ra])||(Ai[Ra]=!0);return Ai}function Ac(vo,Ai,bo){const Ra=Array.isArray(vo);if(Te$1(vo)||Ra)for(const pc in vo)Array.isArray(vo[pc])||Te$1(vo[pc])&&!Nc(vo[pc])?Se$1(Ai)||ua$1(bo[pc])?bo[pc]=Array.isArray(vo[pc])?Or$1(vo[pc],[]):{...Or$1(vo[pc])}:Ac(vo[pc],Be$2(Ai)?{}:Ai[pc],bo[pc]):bo[pc]=!Rt$2(vo[pc],Ai[pc]);return bo}var Cn$2=(vo,Ai)=>Ac(vo,Ai,Or$1(Ai)),Dc=(vo,{valueAsNumber:Ai,valueAsDate:bo,setValueAs:Ra})=>Se$1(vo)?vo:Ai?vo===""?NaN:vo&&+vo:bo&&ht$2(vo)?new Date(vo):Ra?Ra(vo):vo;function No(vo){const Ai=vo.ref;return Fa(Ai)?Ai.files:Va(Ai)?Oc(vo.refs).value:Mc(Ai)?[...Ai.selectedOptions].map(({value:bo})=>bo):qn$1(Ai)?Tc(vo.refs).value:Dc(Se$1(Ai.value)?vo.ref.value:Ai.value,vo)}var kf=(vo,Ai,bo,Ra)=>{const pc={};for(const mc of vo){const uf=B$3(Ai,mc);uf&&ge$2(pc,mc,uf._f)}return{criteriaMode:bo,names:[...vo],fields:pc,shouldUseNativeValidation:Ra}},In$2=vo=>Se$1(vo)?vo:Tr$2(vo)?vo.source:Te$1(vo)?Tr$2(vo.value)?vo.value.source:vo.value:vo;const $i="AsyncFunction";var Ff=vo=>!!vo&&!!vo.validate&&!!(ft$2(vo.validate)&&vo.validate.constructor.name===$i||Te$1(vo.validate)&&Object.values(vo.validate).find(Ai=>Ai.constructor.name===$i)),Vf=vo=>vo.mount&&(vo.required||vo.min||vo.max||vo.maxLength||vo.minLength||vo.pattern||vo.validate);function Ui(vo,Ai,bo){const Ra=B$3(vo,bo);if(Ra||ka(bo))return{error:Ra,name:bo};const pc=bo.split(".");for(;pc.length;){const mc=pc.join("."),uf=B$3(Ai,mc),df=B$3(vo,mc);if(uf&&!Array.isArray(uf)&&bo!==mc)return{name:bo};if(df&&df.type)return{name:mc,error:df};pc.pop()}return{name:bo}}var Lf=(vo,Ai,bo,Ra,pc)=>pc.isOnAll?!1:!bo&&pc.isOnTouch?!(Ai||vo):(bo?Ra.isOnBlur:pc.isOnBlur)?!vo:(bo?Ra.isOnChange:pc.isOnChange)?vo:!0,$f=(vo,Ai)=>!Xn$1(B$3(vo,Ai)).length&&Oe$2(vo,Ai);const Uf={mode:Je$1.onSubmit,reValidateMode:Je$1.onChange,shouldFocusError:!0};function Hf(vo={}){let Ai={...Uf,...vo},bo={submitCount:0,isDirty:!1,isLoading:ft$2(Ai.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:Ai.errors||{},disabled:Ai.disabled||!1},Ra={},pc=Te$1(Ai.defaultValues)||Te$1(Ai.values)?De$2(Ai.defaultValues||Ai.values)||{}:{},mc=Ai.shouldUnregister?{}:De$2(pc),uf={action:!1,mount:!1,watch:!1},df={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},ff,hf=0;const pf={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},mf={values:Oo(),array:Oo(),state:Oo()},gf=_n$2(Ai.mode),yf=_n$2(Ai.reValidateMode),vf=Ai.criteriaMode===Je$1.all,bf=N1=>V1=>{clearTimeout(hf),hf=setTimeout(N1,V1)},Sf=async N1=>{if(!Ai.disabled&&(pf.isValid||N1)){const V1=Ai.resolver?We$2((await T1()).errors):await R1(Ra,!0);V1!==bo.isValid&&mf.state.next({isValid:V1})}},xf=(N1,V1)=>{!Ai.disabled&&(pf.isValidating||pf.validatingFields)&&((N1||Array.from(df.mount)).forEach(D1=>{D1&&(V1?ge$2(bo.validatingFields,D1,V1):Oe$2(bo.validatingFields,D1))}),mf.state.next({validatingFields:bo.validatingFields,isValidating:!We$2(bo.validatingFields)}))},wf=(N1,V1=[],D1,d1,f1=!0,A1=!0)=>{if(d1&&D1&&!Ai.disabled){if(uf.action=!0,A1&&Array.isArray(B$3(Ra,N1))){const Q1=D1(B$3(Ra,N1),d1.argA,d1.argB);f1&&ge$2(Ra,N1,Q1)}if(A1&&Array.isArray(B$3(bo.errors,N1))){const Q1=D1(B$3(bo.errors,N1),d1.argA,d1.argB);f1&&ge$2(bo.errors,N1,Q1),$f(bo.errors,N1)}if(pf.touchedFields&&A1&&Array.isArray(B$3(bo.touchedFields,N1))){const Q1=D1(B$3(bo.touchedFields,N1),d1.argA,d1.argB);f1&&ge$2(bo.touchedFields,N1,Q1)}pf.dirtyFields&&(bo.dirtyFields=Cn$2(pc,mc)),mf.state.next({name:N1,isDirty:E1(N1,V1),dirtyFields:bo.dirtyFields,errors:bo.errors,isValid:bo.isValid})}else ge$2(mc,N1,V1)},If=(N1,V1)=>{ge$2(bo.errors,N1,V1),mf.state.next({errors:bo.errors})},l1=N1=>{bo.errors=N1,mf.state.next({errors:bo.errors,isValid:!1})},s1=(N1,V1,D1,d1)=>{const f1=B$3(Ra,N1);if(f1){const A1=B$3(mc,N1,Se$1(D1)?B$3(pc,N1):D1);Se$1(A1)||d1&&d1.defaultChecked||V1?ge$2(mc,N1,V1?A1:No(f1._f)):$1(N1,A1),uf.mount&&Sf()}},c1=(N1,V1,D1,d1,f1)=>{let A1=!1,Q1=!1;const q1={name:N1};if(!Ai.disabled){const H1=!!(B$3(Ra,N1)&&B$3(Ra,N1)._f&&B$3(Ra,N1)._f.disabled);if(!D1||d1){pf.isDirty&&(Q1=bo.isDirty,bo.isDirty=q1.isDirty=E1(),A1=Q1!==q1.isDirty);const J1=H1||Rt$2(B$3(pc,N1),V1);Q1=!!(!H1&&B$3(bo.dirtyFields,N1)),J1||H1?Oe$2(bo.dirtyFields,N1):ge$2(bo.dirtyFields,N1,!0),q1.dirtyFields=bo.dirtyFields,A1=A1||pf.dirtyFields&&Q1!==!J1}if(D1){const J1=B$3(bo.touchedFields,N1);J1||(ge$2(bo.touchedFields,N1,D1),q1.touchedFields=bo.touchedFields,A1=A1||pf.touchedFields&&J1!==D1)}A1&&f1&&mf.state.next(q1)}return A1?q1:{}},u1=(N1,V1,D1,d1)=>{const f1=B$3(bo.errors,N1),A1=pf.isValid&&Qe$2(V1)&&bo.isValid!==V1;if(Ai.delayError&&D1?(ff=bf(()=>If(N1,D1)),ff(Ai.delayError)):(clearTimeout(hf),ff=null,D1?ge$2(bo.errors,N1,D1):Oe$2(bo.errors,N1)),(D1?!Rt$2(f1,D1):f1)||!We$2(d1)||A1){const Q1={...d1,...A1&&Qe$2(V1)?{isValid:V1}:{},errors:bo.errors,name:N1};bo={...bo,...Q1},mf.state.next(Q1)}},T1=async N1=>{xf(N1,!0);const V1=await Ai.resolver(mc,Ai.context,kf(N1||df.mount,Ra,Ai.criteriaMode,Ai.shouldUseNativeValidation));return xf(N1),V1},_1=async N1=>{const{errors:V1}=await T1(N1);if(N1)for(const D1 of N1){const d1=B$3(V1,D1);d1?ge$2(bo.errors,D1,d1):Oe$2(bo.errors,D1)}else bo.errors=V1;return V1},R1=async(N1,V1,D1={valid:!0})=>{for(const d1 in N1){const f1=N1[d1];if(f1){const{_f:A1,...Q1}=f1;if(A1){const q1=df.array.has(A1.name),H1=f1._f&&Ff(f1._f);H1&&pf.validatingFields&&xf([d1],!0);const J1=await la$1(f1,df.disabled,mc,vf,Ai.shouldUseNativeValidation&&!V1,q1);if(H1&&pf.validatingFields&&xf([d1]),J1[A1.name]&&(D1.valid=!1,V1))break;!V1&&(B$3(J1,A1.name)?q1?Pc(bo.errors,J1,A1.name):ge$2(bo.errors,A1.name,J1[A1.name]):Oe$2(bo.errors,A1.name))}!We$2(Q1)&&await R1(Q1,V1,D1)}}return D1.valid},P1=()=>{for(const N1 of df.unMount){const V1=B$3(Ra,N1);V1&&(V1._f.refs?V1._f.refs.every(D1=>!Mo$1(D1)):!Mo$1(V1._f.ref))&&Y1(N1)}df.unMount=new Set},E1=(N1,V1)=>!Ai.disabled&&(N1&&V1&&ge$2(mc,N1,V1),!Rt$2(Z1(),pc)),M1=(N1,V1,D1)=>Ic(N1,df,{...uf.mount?mc:Se$1(V1)?pc:ht$2(N1)?{[N1]:V1}:V1},D1,V1),m1=N1=>Xn$1(B$3(uf.mount?mc:pc,N1,Ai.shouldUnregister?B$3(pc,N1,[]):[])),$1=(N1,V1,D1={})=>{const d1=B$3(Ra,N1);let f1=V1;if(d1){const A1=d1._f;A1&&(!A1.disabled&&ge$2(mc,N1,Dc(V1,A1)),f1=Pr$2(A1.ref)&&Be$2(V1)?"":V1,Mc(A1.ref)?[...A1.ref.options].forEach(Q1=>Q1.selected=f1.includes(Q1.value)):A1.refs?qn$1(A1.ref)?A1.refs.length>1?A1.refs.forEach(Q1=>(!Q1.defaultChecked||!Q1.disabled)&&(Q1.checked=Array.isArray(f1)?!!f1.find(q1=>q1===Q1.value):f1===Q1.value)):A1.refs[0]&&(A1.refs[0].checked=!!f1):A1.refs.forEach(Q1=>Q1.checked=Q1.value===f1):Fa(A1.ref)?A1.ref.value="":(A1.ref.value=f1,A1.ref.type||mf.values.next({name:N1,values:{...mc}})))}(D1.shouldDirty||D1.shouldTouch)&&c1(N1,f1,D1.shouldTouch,D1.shouldDirty,!0),D1.shouldValidate&&W1(N1)},k1=(N1,V1,D1)=>{for(const d1 in V1){const f1=V1[d1],A1=`${N1}.${d1}`,Q1=B$3(Ra,A1);(df.array.has(N1)||Te$1(f1)||Q1&&!Q1._f)&&!Gt$2(f1)?k1(A1,f1,D1):$1(A1,f1,D1)}},F1=(N1,V1,D1={})=>{const d1=B$3(Ra,N1),f1=df.array.has(N1),A1=De$2(V1);ge$2(mc,N1,A1),f1?(mf.array.next({name:N1,values:{...mc}}),(pf.isDirty||pf.dirtyFields)&&D1.shouldDirty&&mf.state.next({name:N1,dirtyFields:Cn$2(pc,mc),isDirty:E1(N1,A1)})):d1&&!d1._f&&!Be$2(A1)?k1(N1,A1,D1):$1(N1,A1,D1),ca$1(N1,df)&&mf.state.next({...bo}),mf.values.next({name:uf.mount?N1:void 0,values:{...mc}})},U1=async N1=>{uf.mount=!0;const V1=N1.target;let D1=V1.name,d1=!0;const f1=B$3(Ra,D1),A1=()=>V1.type?No(f1._f):vc(N1),Q1=q1=>{d1=Number.isNaN(q1)||Gt$2(q1)&&isNaN(q1.getTime())||Rt$2(q1,B$3(mc,D1,q1))};if(f1){let q1,H1;const J1=A1(),eT=N1.type===Er$2.BLUR||N1.type===Er$2.FOCUS_OUT,rT=!Vf(f1._f)&&!Ai.resolver&&!B$3(bo.errors,D1)&&!f1._f.deps||Lf(eT,B$3(bo.touchedFields,D1),bo.isSubmitted,yf,gf),sT=ca$1(D1,df,eT);ge$2(mc,D1,J1),eT?(f1._f.onBlur&&f1._f.onBlur(N1),ff&&ff(0)):f1._f.onChange&&f1._f.onChange(N1);const dT=c1(D1,J1,eT,!1),fT=!We$2(dT)||sT;if(!eT&&mf.values.next({name:D1,type:N1.type,values:{...mc}}),rT)return pf.isValid&&(Ai.mode==="onBlur"&&eT?Sf():eT||Sf()),fT&&mf.state.next({name:D1,...sT?{}:dT});if(!eT&&sT&&mf.state.next({...bo}),Ai.resolver){const{errors:uT}=await T1([D1]);if(Q1(J1),d1){const mT=Ui(bo.errors,Ra,D1),pT=Ui(uT,Ra,mT.name||D1);q1=pT.error,D1=pT.name,H1=We$2(uT)}}else xf([D1],!0),q1=(await la$1(f1,df.disabled,mc,vf,Ai.shouldUseNativeValidation))[D1],xf([D1]),Q1(J1),d1&&(q1?H1=!1:pf.isValid&&(H1=await R1(Ra,!0)));d1&&(f1._f.deps&&W1(f1._f.deps),u1(D1,H1,q1,dT))}},B1=(N1,V1)=>{if(B$3(bo.errors,V1)&&N1.focus)return N1.focus(),1},W1=async(N1,V1={})=>{let D1,d1;const f1=Ge$2(N1);if(Ai.resolver){const A1=await _1(Se$1(N1)?N1:f1);D1=We$2(A1),d1=N1?!f1.some(Q1=>B$3(A1,Q1)):D1}else N1?(d1=(await Promise.all(f1.map(async A1=>{const Q1=B$3(Ra,A1);return await R1(Q1&&Q1._f?{[A1]:Q1}:Q1)}))).every(Boolean),!(!d1&&!bo.isValid)&&Sf()):d1=D1=await R1(Ra);return mf.state.next({...!ht$2(N1)||pf.isValid&&D1!==bo.isValid?{}:{name:N1},...Ai.resolver||!N1?{isValid:D1}:{},errors:bo.errors}),V1.shouldFocus&&!d1&&sn$1(Ra,B1,N1?f1:df.mount),d1},Z1=N1=>{const V1={...uf.mount?mc:pc};return Se$1(N1)?V1:ht$2(N1)?B$3(V1,N1):N1.map(D1=>B$3(V1,D1))},O1=(N1,V1)=>({invalid:!!B$3((V1||bo).errors,N1),isDirty:!!B$3((V1||bo).dirtyFields,N1),error:B$3((V1||bo).errors,N1),isValidating:!!B$3(bo.validatingFields,N1),isTouched:!!B$3((V1||bo).touchedFields,N1)}),j1=N1=>{N1&&Ge$2(N1).forEach(V1=>Oe$2(bo.errors,V1)),mf.state.next({errors:N1?bo.errors:{}})},L1=(N1,V1,D1)=>{const d1=(B$3(Ra,N1,{_f:{}})._f||{}).ref,f1=B$3(bo.errors,N1)||{},{ref:A1,message:Q1,type:q1,...H1}=f1;ge$2(bo.errors,N1,{...H1,...V1,ref:d1}),mf.state.next({name:N1,errors:bo.errors,isValid:!1}),D1&&D1.shouldFocus&&d1&&d1.focus&&d1.focus()},G1=(N1,V1)=>ft$2(N1)?mf.values.subscribe({next:D1=>N1(M1(void 0,V1),D1)}):M1(N1,V1,!0),Y1=(N1,V1={})=>{for(const D1 of N1?Ge$2(N1):df.mount)df.mount.delete(D1),df.array.delete(D1),V1.keepValue||(Oe$2(Ra,D1),Oe$2(mc,D1)),!V1.keepError&&Oe$2(bo.errors,D1),!V1.keepDirty&&Oe$2(bo.dirtyFields,D1),!V1.keepTouched&&Oe$2(bo.touchedFields,D1),!V1.keepIsValidating&&Oe$2(bo.validatingFields,D1),!Ai.shouldUnregister&&!V1.keepDefaultValue&&Oe$2(pc,D1);mf.values.next({values:{...mc}}),mf.state.next({...bo,...V1.keepDirty?{isDirty:E1()}:{}}),!V1.keepIsValid&&Sf()},z1=({disabled:N1,name:V1,field:D1,fields:d1})=>{(Qe$2(N1)&&uf.mount||N1||df.disabled.has(V1))&&(N1?df.disabled.add(V1):df.disabled.delete(V1),c1(V1,No(D1?D1._f:B$3(d1,V1)._f),!1,!1,!0))},K1=(N1,V1={})=>{let D1=B$3(Ra,N1);const d1=Qe$2(V1.disabled)||Qe$2(Ai.disabled);return ge$2(Ra,N1,{...D1||{},_f:{...D1&&D1._f?D1._f:{ref:{name:N1}},name:N1,mount:!0,...V1}}),df.mount.add(N1),D1?z1({field:D1,disabled:Qe$2(V1.disabled)?V1.disabled:Ai.disabled,name:N1}):s1(N1,!0,V1.value),{...d1?{disabled:V1.disabled||Ai.disabled}:{},...Ai.progressive?{required:!!V1.required,min:In$2(V1.min),max:In$2(V1.max),minLength:In$2(V1.minLength),maxLength:In$2(V1.maxLength),pattern:In$2(V1.pattern)}:{},name:N1,onChange:U1,onBlur:U1,ref:f1=>{if(f1){K1(N1,V1),D1=B$3(Ra,N1);const A1=Se$1(f1.value)&&f1.querySelectorAll&&f1.querySelectorAll("input,select,textarea")[0]||f1,Q1=_f(A1),q1=D1._f.refs||[];if(Q1?q1.find(H1=>H1===A1):A1===D1._f.ref)return;ge$2(Ra,N1,{_f:{...D1._f,...Q1?{refs:[...q1.filter(Mo$1),A1,...Array.isArray(B$3(pc,N1))?[{}]:[]],ref:{type:A1.type,name:N1}}:{ref:A1}}}),s1(N1,!1,void 0,A1)}else D1=B$3(Ra,N1,{}),D1._f&&(D1._f.mount=!1),(Ai.shouldUnregister||V1.shouldUnregister)&&!(bc(df.array,N1)&&uf.action)&&df.unMount.add(N1)}}},tT=()=>Ai.shouldFocusError&&sn$1(Ra,B1,df.mount),iT=N1=>{Qe$2(N1)&&(mf.state.next({disabled:N1}),sn$1(Ra,(V1,D1)=>{const d1=B$3(Ra,D1);d1&&(V1.disabled=d1._f.disabled||N1,Array.isArray(d1._f.refs)&&d1._f.refs.forEach(f1=>{f1.disabled=d1._f.disabled||N1}))},0,!1))},aT=(N1,V1)=>async D1=>{let d1;D1&&(D1.preventDefault&&D1.preventDefault(),D1.persist&&D1.persist());let f1=De$2(mc);if(df.disabled.size)for(const A1 of df.disabled)ge$2(f1,A1,void 0);if(mf.state.next({isSubmitting:!0}),Ai.resolver){const{errors:A1,values:Q1}=await T1();bo.errors=A1,f1=Q1}else await R1(Ra);if(Oe$2(bo.errors,"root"),We$2(bo.errors)){mf.state.next({errors:{}});try{await N1(f1,D1)}catch(A1){d1=A1}}else V1&&await V1({...bo.errors},D1),tT(),setTimeout(tT);if(mf.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:We$2(bo.errors)&&!d1,submitCount:bo.submitCount+1,errors:bo.errors}),d1)throw d1},oT=(N1,V1={})=>{B$3(Ra,N1)&&(Se$1(V1.defaultValue)?F1(N1,De$2(B$3(pc,N1))):(F1(N1,V1.defaultValue),ge$2(pc,N1,De$2(V1.defaultValue))),V1.keepTouched||Oe$2(bo.touchedFields,N1),V1.keepDirty||(Oe$2(bo.dirtyFields,N1),bo.isDirty=V1.defaultValue?E1(N1,De$2(B$3(pc,N1))):E1()),V1.keepError||(Oe$2(bo.errors,N1),pf.isValid&&Sf()),mf.state.next({...bo}))},nT=(N1,V1={})=>{const D1=N1?De$2(N1):pc,d1=De$2(D1),f1=We$2(N1),A1=f1?pc:d1;if(V1.keepDefaultValues||(pc=D1),!V1.keepValues){if(V1.keepDirtyValues){const Q1=new Set([...df.mount,...Object.keys(Cn$2(pc,mc))]);for(const q1 of Array.from(Q1))B$3(bo.dirtyFields,q1)?ge$2(A1,q1,B$3(mc,q1)):F1(q1,B$3(A1,q1))}else{if(_a$1&&Se$1(N1))for(const Q1 of df.mount){const q1=B$3(Ra,Q1);if(q1&&q1._f){const H1=Array.isArray(q1._f.refs)?q1._f.refs[0]:q1._f.ref;if(Pr$2(H1)){const J1=H1.closest("form");if(J1){J1.reset();break}}}}Ra={}}mc=Ai.shouldUnregister?V1.keepDefaultValues?De$2(pc):{}:De$2(A1),mf.array.next({values:{...A1}}),mf.values.next({values:{...A1}})}df={mount:V1.keepDirtyValues?df.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},uf.mount=!pf.isValid||!!V1.keepIsValid||!!V1.keepDirtyValues,uf.watch=!!Ai.shouldUnregister,mf.state.next({submitCount:V1.keepSubmitCount?bo.submitCount:0,isDirty:f1?!1:V1.keepDirty?bo.isDirty:!!(V1.keepDefaultValues&&!Rt$2(N1,pc)),isSubmitted:V1.keepIsSubmitted?bo.isSubmitted:!1,dirtyFields:f1?{}:V1.keepDirtyValues?V1.keepDefaultValues&&mc?Cn$2(pc,mc):bo.dirtyFields:V1.keepDefaultValues&&N1?Cn$2(pc,N1):V1.keepDirty?bo.dirtyFields:{},touchedFields:V1.keepTouched?bo.touchedFields:{},errors:V1.keepErrors?bo.errors:{},isSubmitSuccessful:V1.keepIsSubmitSuccessful?bo.isSubmitSuccessful:!1,isSubmitting:!1})},cT=(N1,V1)=>nT(ft$2(N1)?N1(mc):N1,V1);return{control:{register:K1,unregister:Y1,getFieldState:O1,handleSubmit:aT,setError:L1,_executeSchema:T1,_getWatch:M1,_getDirty:E1,_updateValid:Sf,_removeUnmounted:P1,_updateFieldArray:wf,_updateDisabledField:z1,_getFieldArray:m1,_reset:nT,_resetDefaultValues:()=>ft$2(Ai.defaultValues)&&Ai.defaultValues().then(N1=>{cT(N1,Ai.resetOptions),mf.state.next({isLoading:!1})}),_updateFormState:N1=>{bo={...bo,...N1}},_disableForm:iT,_subjects:mf,_proxyFormState:pf,_setErrors:l1,get _fields(){return Ra},get _formValues(){return mc},get _state(){return uf},set _state(N1){uf=N1},get _defaultValues(){return pc},get _names(){return df},set _names(N1){df=N1},get _formState(){return bo},set _formState(N1){bo=N1},get _options(){return Ai},set _options(N1){Ai={...Ai,...N1}}},trigger:W1,register:K1,handleSubmit:aT,watch:G1,setValue:F1,getValues:Z1,reset:cT,resetField:oT,clearErrors:j1,unregister:Y1,setError:L1,setFocus:(N1,V1={})=>{const D1=B$3(Ra,N1),d1=D1&&D1._f;if(d1){const f1=d1.refs?d1.refs[0]:d1.ref;f1.focus&&(f1.focus(),V1.shouldSelect&&ft$2(f1.select)&&f1.select())}},getFieldState:O1}}function Wf(vo={}){const Ai=y__default.useRef(void 0),bo=y__default.useRef(void 0),[Ra,pc]=y__default.useState({isDirty:!1,isValidating:!1,isLoading:ft$2(vo.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:vo.errors||{},disabled:vo.disabled||!1,defaultValues:ft$2(vo.defaultValues)?void 0:vo.defaultValues});Ai.current||(Ai.current={...Hf(vo),formState:Ra});const mc=Ai.current.control;return mc._options=vo,Gr$2({subject:mc._subjects.state,next:uf=>{Sc(uf,mc._proxyFormState,mc._updateFormState,!0)&&pc({...mc._formState})}}),y__default.useEffect(()=>mc._disableForm(vo.disabled),[mc,vo.disabled]),y__default.useEffect(()=>{if(mc._proxyFormState.isDirty){const uf=mc._getDirty();uf!==Ra.isDirty&&mc._subjects.state.next({isDirty:uf})}},[mc,Ra.isDirty]),y__default.useEffect(()=>{vo.values&&!Rt$2(vo.values,bo.current)?(mc._reset(vo.values,mc._options.resetOptions),bo.current=vo.values,pc(uf=>({...uf}))):mc._resetDefaultValues()},[vo.values,mc]),y__default.useEffect(()=>{vo.errors&&mc._setErrors(vo.errors)},[vo.errors,mc]),y__default.useEffect(()=>{mc._state.mount||(mc._updateValid(),mc._state.mount=!0),mc._state.watch&&(mc._state.watch=!1,mc._subjects.state.next({...mc._formState})),mc._removeUnmounted()}),y__default.useEffect(()=>{vo.shouldUnregister&&mc._subjects.values.next({values:mc._getWatch()})},[vo.shouldUnregister,mc]),Ai.current.formState=xc(Ra,mc),Ai.current}function Hi(vo,Ai){if(typeof vo=="function")return vo(Ai);vo!=null&&(vo.current=Ai)}function qr$2(...vo){return Ai=>{let bo=!1;const Ra=vo.map(pc=>{const mc=Hi(pc,Ai);return!bo&&typeof mc=="function"&&(bo=!0),mc});if(bo)return()=>{for(let pc=0;pc<Ra.length;pc++){const mc=Ra[pc];typeof mc=="function"?mc():Hi(vo[pc],null)}}}}function Fe$2(...vo){return y$2.useCallback(qr$2(...vo),vo)}var mn$1=y$2.forwardRef((vo,Ai)=>{const{children:bo,...Ra}=vo,pc=y$2.Children.toArray(bo),mc=pc.find(Bf);if(mc){const uf=mc.props.children,df=pc.map(ff=>ff===mc?y$2.Children.count(uf)>1?y$2.Children.only(null):y$2.isValidElement(uf)?uf.props.children:null:ff);return jsx(da$1,{...Ra,ref:Ai,children:y$2.isValidElement(uf)?y$2.cloneElement(uf,void 0,df):null})}return jsx(da$1,{...Ra,ref:Ai,children:bo})});mn$1.displayName="Slot";var da$1=y$2.forwardRef((vo,Ai)=>{const{children:bo,...Ra}=vo;if(y$2.isValidElement(bo)){const pc=jf(bo);return y$2.cloneElement(bo,{...zf(Ra,bo.props),ref:Ai?qr$2(Ai,pc):pc})}return y$2.Children.count(bo)>1?y$2.Children.only(null):null});da$1.displayName="SlotClone";var Rc=({children:vo})=>jsx(Fragment,{children:vo});function Bf(vo){return y$2.isValidElement(vo)&&vo.type===Rc}function zf(vo,Ai){const bo={...Ai};for(const Ra in Ai){const pc=vo[Ra],mc=Ai[Ra];/^on[A-Z]/.test(Ra)?pc&&mc?bo[Ra]=(...uf)=>{mc(...uf),pc(...uf)}:pc&&(bo[Ra]=pc):Ra==="style"?bo[Ra]={...pc,...mc}:Ra==="className"&&(bo[Ra]=[pc,mc].filter(Boolean).join(" "))}return{...vo,...bo}}function jf(vo){var Ai,bo;let Ra=(Ai=Object.getOwnPropertyDescriptor(vo.props,"ref"))==null?void 0:Ai.get,pc=Ra&&"isReactWarning"in Ra&&Ra.isReactWarning;return pc?vo.ref:(Ra=(bo=Object.getOwnPropertyDescriptor(vo,"ref"))==null?void 0:bo.get,pc=Ra&&"isReactWarning"in Ra&&Ra.isReactWarning,pc?vo.props.ref:vo.props.ref||vo.ref)}var Yf=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],we$1=Yf.reduce((vo,Ai)=>{const bo=y$2.forwardRef((Ra,pc)=>{const{asChild:mc,...uf}=Ra,df=mc?mn$1:Ai;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),jsx(df,{...uf,ref:pc})});return bo.displayName=`Primitive.${Ai}`,{...vo,[Ai]:bo}},{});function _c(vo,Ai){vo&&hc.flushSync(()=>vo.dispatchEvent(Ai))}function kc(vo){var Ai,bo,Ra="";if(typeof vo=="string"||typeof vo=="number")Ra+=vo;else if(typeof vo=="object")if(Array.isArray(vo)){var pc=vo.length;for(Ai=0;Ai<pc;Ai++)vo[Ai]&&(bo=kc(vo[Ai]))&&(Ra&&(Ra+=" "),Ra+=bo)}else for(bo in vo)vo[bo]&&(Ra&&(Ra+=" "),Ra+=bo);return Ra}function h1(){for(var vo,Ai,bo=0,Ra="",pc=arguments.length;bo<pc;bo++)(vo=arguments[bo])&&(Ai=kc(vo))&&(Ra&&(Ra+=" "),Ra+=Ai);return Ra}const La="-",Gf=vo=>{const Ai=Xf(vo),{conflictingClassGroups:bo,conflictingClassGroupModifiers:Ra}=vo;return{getClassGroupId:pc=>{const mc=pc.split(La);return mc[0]===""&&mc.length!==1&&mc.shift(),Fc(mc,Ai)||qf(pc)},getConflictingClassGroupIds:(pc,mc)=>{const uf=bo[pc]||[];return mc&&Ra[pc]?[...uf,...Ra[pc]]:uf}}},Fc=(vo,Ai)=>{var bo;if(vo.length===0)return Ai.classGroupId;const Ra=vo[0],pc=Ai.nextPart.get(Ra),mc=pc?Fc(vo.slice(1),pc):void 0;if(mc)return mc;if(Ai.validators.length===0)return;const uf=vo.join(La);return(bo=Ai.validators.find(({validator:df})=>df(uf)))==null?void 0:bo.classGroupId},Wi=/^\[(.+)\]$/,qf=vo=>{if(Wi.test(vo)){const Ai=Wi.exec(vo)[1],bo=Ai==null?void 0:Ai.substring(0,Ai.indexOf(":"));if(bo)return"arbitrary.."+bo}},Xf=vo=>{const{theme:Ai,prefix:bo}=vo,Ra={nextPart:new Map,validators:[]};return Zf(Object.entries(vo.classGroups),bo).forEach(([pc,mc])=>{fa(mc,Ra,pc,Ai)}),Ra},fa=(vo,Ai,bo,Ra)=>{vo.forEach(pc=>{if(typeof pc=="string"){const mc=pc===""?Ai:Bi(Ai,pc);mc.classGroupId=bo;return}if(typeof pc=="function"){if(Kf(pc)){fa(pc(Ra),Ai,bo,Ra);return}Ai.validators.push({validator:pc,classGroupId:bo});return}Object.entries(pc).forEach(([mc,uf])=>{fa(uf,Bi(Ai,mc),bo,Ra)})})},Bi=(vo,Ai)=>{let bo=vo;return Ai.split(La).forEach(Ra=>{bo.nextPart.has(Ra)||bo.nextPart.set(Ra,{nextPart:new Map,validators:[]}),bo=bo.nextPart.get(Ra)}),bo},Kf=vo=>vo.isThemeGetter,Zf=(vo,Ai)=>Ai?vo.map(([bo,Ra])=>{const pc=Ra.map(mc=>typeof mc=="string"?Ai+mc:typeof mc=="object"?Object.fromEntries(Object.entries(mc).map(([uf,df])=>[Ai+uf,df])):mc);return[bo,pc]}):vo,Qf=vo=>{if(vo<1)return{get:()=>{},set:()=>{}};let Ai=0,bo=new Map,Ra=new Map;const pc=(mc,uf)=>{bo.set(mc,uf),Ai++,Ai>vo&&(Ai=0,Ra=bo,bo=new Map)};return{get(mc){let uf=bo.get(mc);if(uf!==void 0)return uf;if((uf=Ra.get(mc))!==void 0)return pc(mc,uf),uf},set(mc,uf){bo.has(mc)?bo.set(mc,uf):pc(mc,uf)}}},Vc="!",Jf=vo=>{const{separator:Ai,experimentalParseClassName:bo}=vo,Ra=Ai.length===1,pc=Ai[0],mc=Ai.length,uf=df=>{const ff=[];let hf=0,pf=0,mf;for(let Sf=0;Sf<df.length;Sf++){let xf=df[Sf];if(hf===0){if(xf===pc&&(Ra||df.slice(Sf,Sf+mc)===Ai)){ff.push(df.slice(pf,Sf)),pf=Sf+mc;continue}if(xf==="/"){mf=Sf;continue}}xf==="["?hf++:xf==="]"&&hf--}const gf=ff.length===0?df:df.substring(pf),yf=gf.startsWith(Vc),vf=yf?gf.substring(1):gf,bf=mf&&mf>pf?mf-pf:void 0;return{modifiers:ff,hasImportantModifier:yf,baseClassName:vf,maybePostfixModifierPosition:bf}};return bo?df=>bo({className:df,parseClassName:uf}):uf},em=vo=>{if(vo.length<=1)return vo;const Ai=[];let bo=[];return vo.forEach(Ra=>{Ra[0]==="["?(Ai.push(...bo.sort(),Ra),bo=[]):bo.push(Ra)}),Ai.push(...bo.sort()),Ai},tm=vo=>({cache:Qf(vo.cacheSize),parseClassName:Jf(vo),...Gf(vo)}),nm=/\s+/,rm$2=(vo,Ai)=>{const{parseClassName:bo,getClassGroupId:Ra,getConflictingClassGroupIds:pc}=Ai,mc=[],uf=vo.trim().split(nm);let df="";for(let ff=uf.length-1;ff>=0;ff-=1){const hf=uf[ff],{modifiers:pf,hasImportantModifier:mf,baseClassName:gf,maybePostfixModifierPosition:yf}=bo(hf);let vf=!!yf,bf=Ra(vf?gf.substring(0,yf):gf);if(!bf){if(!vf){df=hf+(df.length>0?" "+df:df);continue}if(bf=Ra(gf),!bf){df=hf+(df.length>0?" "+df:df);continue}vf=!1}const Sf=em(pf).join(":"),xf=mf?Sf+Vc:Sf,wf=xf+bf;if(mc.includes(wf))continue;mc.push(wf);const If=pc(bf,vf);for(let l1=0;l1<If.length;++l1){const s1=If[l1];mc.push(xf+s1)}df=hf+(df.length>0?" "+df:df)}return df};function Xr$1(){let vo=0,Ai,bo,Ra="";for(;vo<arguments.length;)(Ai=arguments[vo++])&&(bo=Lc(Ai))&&(Ra&&(Ra+=" "),Ra+=bo);return Ra}const Lc=vo=>{if(typeof vo=="string")return vo;let Ai,bo="";for(let Ra=0;Ra<vo.length;Ra++)vo[Ra]&&(Ai=Lc(vo[Ra]))&&(bo&&(bo+=" "),bo+=Ai);return bo};function om(vo,...Ai){let bo,Ra,pc,mc=uf;function uf(ff){const hf=Ai.reduce((pf,mf)=>mf(pf),vo());return bo=tm(hf),Ra=bo.cache.get,pc=bo.cache.set,mc=df,df(ff)}function df(ff){const hf=Ra(ff);if(hf)return hf;const pf=rm$2(ff,bo);return pc(ff,pf),pf}return function(){return mc(Xr$1.apply(null,arguments))}}const xe$1=vo=>{const Ai=bo=>bo[vo]||[];return Ai.isThemeGetter=!0,Ai},$c=/^\[(?:([a-z-]+):)?(.+)\]$/i,am=/^\d+\/\d+$/,im=new Set(["px","full","screen"]),sm=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,cm=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,lm=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,um=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,dm=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,xt$2=vo=>cn$2(vo)||im.has(vo)||am.test(vo),Ot$1=vo=>vn$2(vo,"length",ym),cn$2=vo=>!!vo&&!Number.isNaN(Number(vo)),Ao=vo=>vn$2(vo,"number",cn$2),En$2=vo=>!!vo&&Number.isInteger(Number(vo)),fm=vo=>vo.endsWith("%")&&cn$2(vo.slice(0,-1)),ie$3=vo=>$c.test(vo),Mt$2=vo=>sm.test(vo),mm=new Set(["length","size","percentage"]),pm=vo=>vn$2(vo,mm,Uc),hm=vo=>vn$2(vo,"position",Uc),gm=new Set(["image","url"]),vm=vo=>vn$2(vo,gm,xm),bm=vo=>vn$2(vo,"",wm),Pn$2=()=>!0,vn$2=(vo,Ai,bo)=>{const Ra=$c.exec(vo);return Ra?Ra[1]?typeof Ai=="string"?Ra[1]===Ai:Ai.has(Ra[1]):bo(Ra[2]):!1},ym=vo=>cm.test(vo)&&!lm.test(vo),Uc=()=>!1,wm=vo=>um.test(vo),xm=vo=>dm.test(vo),Sm=()=>{const vo=xe$1("colors"),Ai=xe$1("spacing"),bo=xe$1("blur"),Ra=xe$1("brightness"),pc=xe$1("borderColor"),mc=xe$1("borderRadius"),uf=xe$1("borderSpacing"),df=xe$1("borderWidth"),ff=xe$1("contrast"),hf=xe$1("grayscale"),pf=xe$1("hueRotate"),mf=xe$1("invert"),gf=xe$1("gap"),yf=xe$1("gradientColorStops"),vf=xe$1("gradientColorStopPositions"),bf=xe$1("inset"),Sf=xe$1("margin"),xf=xe$1("opacity"),wf=xe$1("padding"),If=xe$1("saturate"),l1=xe$1("scale"),s1=xe$1("sepia"),c1=xe$1("skew"),u1=xe$1("space"),T1=xe$1("translate"),_1=()=>["auto","contain","none"],R1=()=>["auto","hidden","clip","visible","scroll"],P1=()=>["auto",ie$3,Ai],E1=()=>[ie$3,Ai],M1=()=>["",xt$2,Ot$1],m1=()=>["auto",cn$2,ie$3],$1=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],k1=()=>["solid","dashed","dotted","double","none"],F1=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],U1=()=>["start","end","center","between","around","evenly","stretch"],B1=()=>["","0",ie$3],W1=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Z1=()=>[cn$2,ie$3];return{cacheSize:500,separator:":",theme:{colors:[Pn$2],spacing:[xt$2,Ot$1],blur:["none","",Mt$2,ie$3],brightness:Z1(),borderColor:[vo],borderRadius:["none","","full",Mt$2,ie$3],borderSpacing:E1(),borderWidth:M1(),contrast:Z1(),grayscale:B1(),hueRotate:Z1(),invert:B1(),gap:E1(),gradientColorStops:[vo],gradientColorStopPositions:[fm,Ot$1],inset:P1(),margin:P1(),opacity:Z1(),padding:E1(),saturate:Z1(),scale:Z1(),sepia:B1(),skew:Z1(),space:E1(),translate:E1()},classGroups:{aspect:[{aspect:["auto","square","video",ie$3]}],container:["container"],columns:[{columns:[Mt$2]}],"break-after":[{"break-after":W1()}],"break-before":[{"break-before":W1()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...$1(),ie$3]}],overflow:[{overflow:R1()}],"overflow-x":[{"overflow-x":R1()}],"overflow-y":[{"overflow-y":R1()}],overscroll:[{overscroll:_1()}],"overscroll-x":[{"overscroll-x":_1()}],"overscroll-y":[{"overscroll-y":_1()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[bf]}],"inset-x":[{"inset-x":[bf]}],"inset-y":[{"inset-y":[bf]}],start:[{start:[bf]}],end:[{end:[bf]}],top:[{top:[bf]}],right:[{right:[bf]}],bottom:[{bottom:[bf]}],left:[{left:[bf]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",En$2,ie$3]}],basis:[{basis:P1()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ie$3]}],grow:[{grow:B1()}],shrink:[{shrink:B1()}],order:[{order:["first","last","none",En$2,ie$3]}],"grid-cols":[{"grid-cols":[Pn$2]}],"col-start-end":[{col:["auto",{span:["full",En$2,ie$3]},ie$3]}],"col-start":[{"col-start":m1()}],"col-end":[{"col-end":m1()}],"grid-rows":[{"grid-rows":[Pn$2]}],"row-start-end":[{row:["auto",{span:[En$2,ie$3]},ie$3]}],"row-start":[{"row-start":m1()}],"row-end":[{"row-end":m1()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ie$3]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ie$3]}],gap:[{gap:[gf]}],"gap-x":[{"gap-x":[gf]}],"gap-y":[{"gap-y":[gf]}],"justify-content":[{justify:["normal",...U1()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...U1(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...U1(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[wf]}],px:[{px:[wf]}],py:[{py:[wf]}],ps:[{ps:[wf]}],pe:[{pe:[wf]}],pt:[{pt:[wf]}],pr:[{pr:[wf]}],pb:[{pb:[wf]}],pl:[{pl:[wf]}],m:[{m:[Sf]}],mx:[{mx:[Sf]}],my:[{my:[Sf]}],ms:[{ms:[Sf]}],me:[{me:[Sf]}],mt:[{mt:[Sf]}],mr:[{mr:[Sf]}],mb:[{mb:[Sf]}],ml:[{ml:[Sf]}],"space-x":[{"space-x":[u1]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[u1]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ie$3,Ai]}],"min-w":[{"min-w":[ie$3,Ai,"min","max","fit"]}],"max-w":[{"max-w":[ie$3,Ai,"none","full","min","max","fit","prose",{screen:[Mt$2]},Mt$2]}],h:[{h:[ie$3,Ai,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ie$3,Ai,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ie$3,Ai,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ie$3,Ai,"auto","min","max","fit"]}],"font-size":[{text:["base",Mt$2,Ot$1]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ao]}],"font-family":[{font:[Pn$2]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ie$3]}],"line-clamp":[{"line-clamp":["none",cn$2,Ao]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",xt$2,ie$3]}],"list-image":[{"list-image":["none",ie$3]}],"list-style-type":[{list:["none","disc","decimal",ie$3]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[vo]}],"placeholder-opacity":[{"placeholder-opacity":[xf]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[vo]}],"text-opacity":[{"text-opacity":[xf]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...k1(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",xt$2,Ot$1]}],"underline-offset":[{"underline-offset":["auto",xt$2,ie$3]}],"text-decoration-color":[{decoration:[vo]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:E1()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ie$3]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ie$3]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[xf]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...$1(),hm]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",pm]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},vm]}],"bg-color":[{bg:[vo]}],"gradient-from-pos":[{from:[vf]}],"gradient-via-pos":[{via:[vf]}],"gradient-to-pos":[{to:[vf]}],"gradient-from":[{from:[yf]}],"gradient-via":[{via:[yf]}],"gradient-to":[{to:[yf]}],rounded:[{rounded:[mc]}],"rounded-s":[{"rounded-s":[mc]}],"rounded-e":[{"rounded-e":[mc]}],"rounded-t":[{"rounded-t":[mc]}],"rounded-r":[{"rounded-r":[mc]}],"rounded-b":[{"rounded-b":[mc]}],"rounded-l":[{"rounded-l":[mc]}],"rounded-ss":[{"rounded-ss":[mc]}],"rounded-se":[{"rounded-se":[mc]}],"rounded-ee":[{"rounded-ee":[mc]}],"rounded-es":[{"rounded-es":[mc]}],"rounded-tl":[{"rounded-tl":[mc]}],"rounded-tr":[{"rounded-tr":[mc]}],"rounded-br":[{"rounded-br":[mc]}],"rounded-bl":[{"rounded-bl":[mc]}],"border-w":[{border:[df]}],"border-w-x":[{"border-x":[df]}],"border-w-y":[{"border-y":[df]}],"border-w-s":[{"border-s":[df]}],"border-w-e":[{"border-e":[df]}],"border-w-t":[{"border-t":[df]}],"border-w-r":[{"border-r":[df]}],"border-w-b":[{"border-b":[df]}],"border-w-l":[{"border-l":[df]}],"border-opacity":[{"border-opacity":[xf]}],"border-style":[{border:[...k1(),"hidden"]}],"divide-x":[{"divide-x":[df]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[df]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[xf]}],"divide-style":[{divide:k1()}],"border-color":[{border:[pc]}],"border-color-x":[{"border-x":[pc]}],"border-color-y":[{"border-y":[pc]}],"border-color-s":[{"border-s":[pc]}],"border-color-e":[{"border-e":[pc]}],"border-color-t":[{"border-t":[pc]}],"border-color-r":[{"border-r":[pc]}],"border-color-b":[{"border-b":[pc]}],"border-color-l":[{"border-l":[pc]}],"divide-color":[{divide:[pc]}],"outline-style":[{outline:["",...k1()]}],"outline-offset":[{"outline-offset":[xt$2,ie$3]}],"outline-w":[{outline:[xt$2,Ot$1]}],"outline-color":[{outline:[vo]}],"ring-w":[{ring:M1()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[vo]}],"ring-opacity":[{"ring-opacity":[xf]}],"ring-offset-w":[{"ring-offset":[xt$2,Ot$1]}],"ring-offset-color":[{"ring-offset":[vo]}],shadow:[{shadow:["","inner","none",Mt$2,bm]}],"shadow-color":[{shadow:[Pn$2]}],opacity:[{opacity:[xf]}],"mix-blend":[{"mix-blend":[...F1(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":F1()}],filter:[{filter:["","none"]}],blur:[{blur:[bo]}],brightness:[{brightness:[Ra]}],contrast:[{contrast:[ff]}],"drop-shadow":[{"drop-shadow":["","none",Mt$2,ie$3]}],grayscale:[{grayscale:[hf]}],"hue-rotate":[{"hue-rotate":[pf]}],invert:[{invert:[mf]}],saturate:[{saturate:[If]}],sepia:[{sepia:[s1]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[bo]}],"backdrop-brightness":[{"backdrop-brightness":[Ra]}],"backdrop-contrast":[{"backdrop-contrast":[ff]}],"backdrop-grayscale":[{"backdrop-grayscale":[hf]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[pf]}],"backdrop-invert":[{"backdrop-invert":[mf]}],"backdrop-opacity":[{"backdrop-opacity":[xf]}],"backdrop-saturate":[{"backdrop-saturate":[If]}],"backdrop-sepia":[{"backdrop-sepia":[s1]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[uf]}],"border-spacing-x":[{"border-spacing-x":[uf]}],"border-spacing-y":[{"border-spacing-y":[uf]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ie$3]}],duration:[{duration:Z1()}],ease:[{ease:["linear","in","out","in-out",ie$3]}],delay:[{delay:Z1()}],animate:[{animate:["none","spin","ping","pulse","bounce",ie$3]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[l1]}],"scale-x":[{"scale-x":[l1]}],"scale-y":[{"scale-y":[l1]}],rotate:[{rotate:[En$2,ie$3]}],"translate-x":[{"translate-x":[T1]}],"translate-y":[{"translate-y":[T1]}],"skew-x":[{"skew-x":[c1]}],"skew-y":[{"skew-y":[c1]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ie$3]}],accent:[{accent:["auto",vo]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ie$3]}],"caret-color":[{caret:[vo]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":E1()}],"scroll-mx":[{"scroll-mx":E1()}],"scroll-my":[{"scroll-my":E1()}],"scroll-ms":[{"scroll-ms":E1()}],"scroll-me":[{"scroll-me":E1()}],"scroll-mt":[{"scroll-mt":E1()}],"scroll-mr":[{"scroll-mr":E1()}],"scroll-mb":[{"scroll-mb":E1()}],"scroll-ml":[{"scroll-ml":E1()}],"scroll-p":[{"scroll-p":E1()}],"scroll-px":[{"scroll-px":E1()}],"scroll-py":[{"scroll-py":E1()}],"scroll-ps":[{"scroll-ps":E1()}],"scroll-pe":[{"scroll-pe":E1()}],"scroll-pt":[{"scroll-pt":E1()}],"scroll-pr":[{"scroll-pr":E1()}],"scroll-pb":[{"scroll-pb":E1()}],"scroll-pl":[{"scroll-pl":E1()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ie$3]}],fill:[{fill:[vo,"none"]}],"stroke-w":[{stroke:[xt$2,Ot$1,Ao]}],stroke:[{stroke:[vo,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Ne$1=om(Sm),zi=["😀","😂","🤣","😍","😎","😊","🙃","😇","🤔","🥳","🤯","🤗","😱","👻","🎃","🐱","🐶","🐹","🦊","🐻","🐼","🐨","🐯","🦁","🐸","🐵","🐔","🐧","🐦","🐤","🐝","🐞","🐟","🐬","🐳","🦋","🌺","🌸","🌼","🍀"];function Cm(vo){function Ai(Ra){let pc=0;for(let mc=0;mc<Ra.length;mc++){const uf=Ra.charCodeAt(mc);pc=(pc<<5)-pc+uf,pc|=0}return Math.abs(pc)}const bo=Ai(vo);return zi[bo%zi.length]}const Im=vo=>{switch(vo){case"HEART":return"❤️";case"THUMBS_UP":return"👍";case"THUMBS_DOWN":return"👎";case"LAUGH":return"😂";case"CRY":return"😢";default:return"❤️"}},Em=vo=>{switch(vo){case"HEART":return"heart";case"THUMBS_UP":return"thumbsUp";case"THUMBS_DOWN":return"thumbsDown";case"LAUGH":return"laughing";case"CRY":return"cry";default:return"heart"}},Pm=vo=>{switch(vo){case"heart":return"HEART";case"thumbsUp":return"THUMBS_UP";case"thumbsDown":return"THUMBS_DOWN";case"laughing":return"LAUGH";case"cry":return"CRY";default:return"HEART"}},Tm=vo=>(vo||[]).map(Ai=>({emoji:Im(Ai.type),reactedBy:Ai.reactedBy,type:Em(Ai.type)})).filter(Ai=>Ai.reactedBy.length>0),Om=vo=>{const{imgUrl:Ai,userName:bo}=vo;return jsx("div",{style:{width:"40px",height:"40px",borderRadius:"10px",overflow:"hidden",backgroundColor:"#f0f0f0",display:"flex",justifyContent:"center",alignItems:"center"},children:Ai?jsx("img",{alt:"avatar",src:Ai}):jsx("span",{style:{fontSize:"24px"},children:Cm(bo)})})},Mm=vo=>{const{bgColor:Ai,reaction:bo,textColor:Ra,onClick:pc,disabled:mc=!1}=vo;return jsxs("div",{style:{display:"flex",alignItems:"center",userSelect:"none"},children:[jsx("div",{onClick:()=>{!mc&&pc&&pc()},style:{width:"20px",height:"20px",fontSize:"12px",display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:Ai,borderRadius:"50%",marginRight:"4px",textAlign:"center",cursor:mc?"default":"pointer"},children:bo.emoji}),jsx("div",{style:{display:"flex",alignItems:"center",fontSize:"12px",color:Ra,fontWeight:"bold"},children:bo.reactedBy.length})]})},Nm=vo=>{const{message:Ai,userName:bo,timestamp:Ra,reactions:pc,isCurrentUser:mc,onClickReaction:uf,disabled:df=!1}=vo,ff=new Date(Ra).toLocaleTimeString(),hf=mc?"#7678ed":"#eeeef8",pf=mc?"#eeeef8":"#cfcff6",mf=mc?"white":"black";return jsxs("div",{style:{display:"flex"},children:[!mc&&jsx("div",{style:{width:"12px",height:"20px",backgroundColor:"#eeeef8",alignSelf:"flex-end"},children:jsx("div",{style:{width:"12px",height:"20px",backgroundColor:"white",borderBottomRightRadius:"40px"}})}),jsxs("div",{style:{backgroundColor:hf,color:mc?"white":"black",display:"flex",flexDirection:"column",padding:"8px",fontSize:"14px",borderRadius:"8px",maxWidth:"600px",borderBottomRightRadius:mc?"0px":"8px",borderBottomLeftRadius:mc?"8px":"0px"},children:[!mc&&jsxs("div",{style:{color:"#36377c",fontSize:"12px",marginBottom:"4px",fontWeight:"bold"},children:[bo,":"]}),jsx("div",{children:Ai}),jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"10px",marginTop:"8px",alignItems:"flex-end",gap:"30px"},children:[jsx("div",{style:{display:"flex",gap:"10px"},children:(pc||[]).map(gf=>jsx(Mm,{bgColor:pf,disabled:df,onClick:()=>uf&&uf({messageId:vo.id,...gf}),reaction:gf,textColor:mf},gf.type))}),jsx("div",{children:ff})]})]}),mc?jsx("div",{style:{width:"12px",height:"20px",backgroundColor:"#7678ed",alignSelf:"flex-end"},children:jsx("div",{style:{width:"12px",height:"20px",backgroundColor:"white",borderBottomLeftRadius:"40px"}})}):null]})};function Am(vo){return vo?typeof vo=="number"?{width:vo.toString()+"px",height:vo.toString()+"px"}:{width:vo,height:vo}:{}}const Dm=(vo,Ai,bo)=>{const Ra=vo[Ai];return Ra?typeof Ra=="function"?Ra():Promise.resolve(Ra):new Promise((pc,mc)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(mc.bind(null,new Error("Unknown variable dynamic import: "+Ai+(Ai.split("/").length!==bo?". Note that variables only represent file names one level deep.":""))))})};function Rm(vo){return jsx("div",{style:{width:vo.width,height:vo.height}})}function _m(vo){try{return lazy(()=>Dm(Object.assign({"../../../assets/icon-components/ArrowFilledRight.tsx":()=>__vitePreload(()=>import("./ArrowFilledRight-blx8xu7X-D3d8PUWh.js"),[]),"../../../assets/icon-components/ArrowLeft.tsx":()=>__vitePreload(()=>import("./ArrowLeft-7pYNK4eX-8ZR_YHAJ.js"),[]),"../../../assets/icon-components/ArrowUp.tsx":()=>__vitePreload(()=>import("./ArrowUp-Bbr_dwo_-C5ppCQo4.js"),[]),"../../../assets/icon-components/BarChart.tsx":()=>__vitePreload(()=>import("./BarChart-B0G05Nfd-CHDJ7OaJ.js"),[]),"../../../assets/icon-components/BaseArrowLeft.tsx":()=>__vitePreload(()=>import("./BaseArrowLeft-DBzhFHMt-Dkbf2sWs.js"),[]),"../../../assets/icon-components/BaseArrowRight.tsx":()=>__vitePreload(()=>import("./BaseArrowRight-DYQTBWAs-CkkPllYm.js"),[]),"../../../assets/icon-components/Braces.tsx":()=>__vitePreload(()=>import("./Braces-N-sH2Zyc-3LcexUsR.js"),[]),"../../../assets/icon-components/Branch.tsx":()=>__vitePreload(()=>import("./Branch-CWdBw1_P-CmGdOXsI.js"),[]),"../../../assets/icon-components/BrickGlobe.tsx":()=>__vitePreload(()=>import("./BrickGlobe-67zaG6_H-DP0By6z_.js"),[]),"../../../assets/icon-components/Briefcase.tsx":()=>__vitePreload(()=>import("./Briefcase-CedW3KRR-DO5_k15F.js"),[]),"../../../assets/icon-components/Calendar.tsx":()=>__vitePreload(()=>import("./Calendar-C-6HV96D-YetudWvP.js"),[]),"../../../assets/icon-components/Caret.tsx":()=>__vitePreload(()=>import("./Caret-Ep0j0fz2-By3ojfim.js"),[]),"../../../assets/icon-components/CaretDown.tsx":()=>__vitePreload(()=>import("./CaretDown-3X7LFYBf-C43xdKg8.js"),[]),"../../../assets/icon-components/CaretSort.tsx":()=>__vitePreload(()=>import("./CaretSort-BkGdLETT-DVOzEEqR.js"),[]),"../../../assets/icon-components/Check.tsx":()=>__vitePreload(()=>import("./Check-DV-U4AEq-B582NMZp.js"),[]),"../../../assets/icon-components/CheckCircle.tsx":()=>__vitePreload(()=>import("./CheckCircle-DI5fEgGd-CVF4LDhR.js"),[]),"../../../assets/icon-components/CheckCircleFill.tsx":()=>__vitePreload(()=>import("./CheckCircleFill-C-F0v5mB-BSW1YMqM.js"),[]),"../../../assets/icon-components/Checkmark.tsx":()=>__vitePreload(()=>import("./Checkmark-BXnfChpo-CyQitGI2.js"),[]),"../../../assets/icon-components/ChevronDown.tsx":()=>__vitePreload(()=>import("./ChevronDown-ouBxrU-k-eUsCPXcB.js"),[]),"../../../assets/icon-components/Circle.tsx":()=>__vitePreload(()=>import("./Circle-n3-Wh4HS-8dOehHQf.js"),[]),"../../../assets/icon-components/CircleInfo.tsx":()=>__vitePreload(()=>import("./CircleInfo-BhZY3C2Q-CZgYK1h2.js"),[]),"../../../assets/icon-components/ClockFill.tsx":()=>__vitePreload(()=>import("./ClockFill-Bd0t48q7-CcfHiJtH.js"),[]),"../../../assets/icon-components/CloudSlash.tsx":()=>__vitePreload(()=>import("./CloudSlash-B-zJBjaD-CxVyp-Ac.js"),[]),"../../../assets/icon-components/Collapse.tsx":()=>__vitePreload(()=>import("./Collapse-DRDB8Czs-CGcuZQgy.js"),[]),"../../../assets/icon-components/Connect.tsx":()=>__vitePreload(()=>import("./Connect-Dme-qfKq-CgniLji8.js"),[]),"../../../assets/icon-components/Discord.tsx":()=>__vitePreload(()=>import("./Discord-CAS0Cj7s-CcsBWpnf.js"),[]),"../../../assets/icon-components/Drive.tsx":()=>__vitePreload(()=>import("./Drive-GMcgBcIY-CzahDx9j.js"),[]),"../../../assets/icon-components/Ellipsis.tsx":()=>__vitePreload(()=>import("./Ellipsis-XK8AwMEC-BuVBeYhB.js"),[]),"../../../assets/icon-components/Error.tsx":()=>__vitePreload(()=>import("./Error-BmIZ2ZUy-CphzuMLn.js"),[]),"../../../assets/icon-components/Exclamation.tsx":()=>__vitePreload(()=>import("./Exclamation-CVsNS_QS-DLccamql.js"),[]),"../../../assets/icon-components/FilesEarmark.tsx":()=>__vitePreload(()=>import("./FilesEarmark-CyrCQy8E-Bhut4E02.js"),[]),"../../../assets/icon-components/FolderClose.tsx":()=>__vitePreload(()=>import("./FolderClose-DG_qHisc-CH6NoBuu.js"),[]),"../../../assets/icon-components/FolderOpen.tsx":()=>__vitePreload(()=>import("./FolderOpen-kDoWFkJO-Cciutkdg.js"),[]),"../../../assets/icon-components/FolderPlus.tsx":()=>__vitePreload(()=>import("./FolderPlus-CSBSl9lZ-CifD0ek9.js"),[]),"../../../assets/icon-components/Forum.tsx":()=>__vitePreload(()=>import("./Forum-DZ-CkLFh-BwabccAX.js"),[]),"../../../assets/icon-components/Gear.tsx":()=>__vitePreload(()=>import("./Gear-cUlHJ4q6-B9R2l_9_.js"),[]),"../../../assets/icon-components/Github.tsx":()=>__vitePreload(()=>import("./Github-0PLiINY0-CjkZIHCO.js"),[]),"../../../assets/icon-components/Globe.tsx":()=>__vitePreload(()=>import("./Globe-CIYqVkpa-CL530H46.js"),[]),"../../../assets/icon-components/GlobeWww.tsx":()=>__vitePreload(()=>import("./GlobeWww-DN4yKujh-Ci7aa5CE.js"),[]),"../../../assets/icon-components/Hdd.tsx":()=>__vitePreload(()=>import("./Hdd-Dn_LdJIh-CJ6x9Bve.js"),[]),"../../../assets/icon-components/History.tsx":()=>__vitePreload(()=>import("./History-BP4SmaS_-P4WBKyqX.js"),[]),"../../../assets/icon-components/InfoSquare.tsx":()=>__vitePreload(()=>import("./InfoSquare-C98JaLiz-yPcGR71f.js"),[]),"../../../assets/icon-components/Link.tsx":()=>__vitePreload(()=>import("./Link-BF7aZjVu-CXIVQOz6.js"),[]),"../../../assets/icon-components/Linkedin.tsx":()=>__vitePreload(()=>import("./Linkedin-DJwIkS6q-Dkb5Tp_Z.js"),[]),"../../../assets/icon-components/Lock.tsx":()=>__vitePreload(()=>import("./Lock-PyaFHdNS-D_qxRTye.js"),[]),"../../../assets/icon-components/M.tsx":()=>__vitePreload(()=>import("./M-DozhhPMY-DBQw97P_.js"),[]),"../../../assets/icon-components/Pencil.tsx":()=>__vitePreload(()=>import("./Pencil-D7lvxXIP-D830iveq.js"),[]),"../../../assets/icon-components/People.tsx":()=>__vitePreload(()=>import("./People-CUB8LYKf-CyJmMqcw.js"),[]),"../../../assets/icon-components/Person.tsx":()=>__vitePreload(()=>import("./Person-DuL4PQzm-ttQR0nPy.js"),[]),"../../../assets/icon-components/Plus.tsx":()=>__vitePreload(()=>import("./Plus-DPFWGJM4-BztpK8li.js"),[]),"../../../assets/icon-components/PlusCircle.tsx":()=>__vitePreload(()=>import("./PlusCircle-BEnWRjHa-w5zztKGx.js"),[]),"../../../assets/icon-components/PowerhouseLogoSmall.tsx":()=>__vitePreload(()=>import("./PowerhouseLogoSmall-CmO95IAS-CDGLkst3.js"),[]),"../../../assets/icon-components/Project.tsx":()=>__vitePreload(()=>import("./Project-BlXuclr0-EsBam9d0.js"),[]),"../../../assets/icon-components/RedoArrow.tsx":()=>__vitePreload(()=>import("./RedoArrow-BJeEsiph-BbidqIFP.js"),[]),"../../../assets/icon-components/Renown.tsx":()=>__vitePreload(()=>import("./Renown-6m7hx37h-CItksi2j.js"),[]),"../../../assets/icon-components/RenownHover.tsx":()=>__vitePreload(()=>import("./RenownHover-CQ0TZHZv-cYQgnwQW.js"),[]),"../../../assets/icon-components/Ring.tsx":()=>__vitePreload(()=>import("./Ring-DKv0gnwT-CDHLz87h.js"),[]),"../../../assets/icon-components/Save.tsx":()=>__vitePreload(()=>import("./Save-BBxj68pn-BkUvn89C.js"),[]),"../../../assets/icon-components/Search.tsx":()=>__vitePreload(()=>import("./Search-YUJuRBLe-CecGUkZA.js"),[]),"../../../assets/icon-components/Server.tsx":()=>__vitePreload(()=>import("./Server-Bfkkjui1-lBan_3Dm.js"),[]),"../../../assets/icon-components/Settings.tsx":()=>__vitePreload(()=>import("./Settings-mbbylBS5-Cca-sV-_.js"),[]),"../../../assets/icon-components/Synced.tsx":()=>__vitePreload(()=>import("./Synced-DKJXzPiw-Cui8pDsS.js"),[]),"../../../assets/icon-components/Syncing.tsx":()=>__vitePreload(()=>import("./Syncing-aT9WSMFf-2VhhyCcX.js"),[]),"../../../assets/icon-components/Trash.tsx":()=>__vitePreload(()=>import("./Trash-CgSbHk-P-DIYkVMER.js"),[]),"../../../assets/icon-components/TrashFill.tsx":()=>__vitePreload(()=>import("./TrashFill-DN50ercb-Oqx67xXN.js"),[]),"../../../assets/icon-components/VariantArrowLeft.tsx":()=>__vitePreload(()=>import("./VariantArrowLeft-CnuX59_e-6Zt_Q3tm.js"),[]),"../../../assets/icon-components/VerticalDots.tsx":()=>__vitePreload(()=>import("./VerticalDots-C8QYf7et-CCxZfvjq.js"),[]),"../../../assets/icon-components/WarningFill.tsx":()=>__vitePreload(()=>import("./WarningFill-WowAvi5P-D5XCckM6.js"),[]),"../../../assets/icon-components/XTwitter.tsx":()=>__vitePreload(()=>import("./XTwitter-k3Pt8itk-mvLk8TKx.js"),[]),"../../../assets/icon-components/Xmark.tsx":()=>__vitePreload(()=>import("./Xmark-8qnJCs2Y-CZ3t0Fap.js"),[]),"../../../assets/icon-components/XmarkLight.tsx":()=>__vitePreload(()=>import("./XmarkLight-GHzDR5_F-CloMvuzt.js"),[]),"../../../assets/icon-components/Youtube.tsx":()=>__vitePreload(()=>import("./Youtube-i8V0IXUU-Bkiwoayp.js"),[])}),`../../../assets/icon-components/${vo}.tsx`,6))}catch(Ai){return console.error(Ai),Rm}}function _e$1({name:vo,size:Ai=24,color:bo,style:Ra,...pc}){const mc=Am(Ai),uf={color:bo,...mc,style:Ra},df=useMemo(()=>_m(vo),[vo]);return jsx(Suspense,{fallback:jsx("div",{"data-testid":"icon-fallback",style:mc}),name:"icon-component",children:jsx(df,{...pc,style:uf})})}function ji$1(vo,Ai){var bo=Object.keys(vo);if(Object.getOwnPropertySymbols){var Ra=Object.getOwnPropertySymbols(vo);Ai&&(Ra=Ra.filter(function(pc){return Object.getOwnPropertyDescriptor(vo,pc).enumerable})),bo.push.apply(bo,Ra)}return bo}function te$2(vo){for(var Ai=1;Ai<arguments.length;Ai++){var bo=arguments[Ai]!=null?arguments[Ai]:{};Ai%2?ji$1(Object(bo),!0).forEach(function(Ra){Ir$3(vo,Ra,bo[Ra])}):Object.getOwnPropertyDescriptors?Object.defineProperties(vo,Object.getOwnPropertyDescriptors(bo)):ji$1(Object(bo)).forEach(function(Ra){Object.defineProperty(vo,Ra,Object.getOwnPropertyDescriptor(bo,Ra))})}return vo}function km(vo){if(Array.isArray(vo))return vo}function Fm(vo,Ai){var bo=vo==null?null:typeof Symbol<"u"&&vo[Symbol.iterator]||vo["@@iterator"];if(bo!=null){var Ra,pc,mc,uf,df=[],ff=!0,hf=!1;try{if(mc=(bo=bo.call(vo)).next,Ai===0){if(Object(bo)!==bo)return;ff=!1}else for(;!(ff=(Ra=mc.call(bo)).done)&&(df.push(Ra.value),df.length!==Ai);ff=!0);}catch(pf){hf=!0,pc=pf}finally{try{if(!ff&&bo.return!=null&&(uf=bo.return(),Object(uf)!==uf))return}finally{if(hf)throw pc}}return df}}function ma(vo,Ai){(Ai==null||Ai>vo.length)&&(Ai=vo.length);for(var bo=0,Ra=Array(Ai);bo<Ai;bo++)Ra[bo]=vo[bo];return Ra}function Hc(vo,Ai){if(vo){if(typeof vo=="string")return ma(vo,Ai);var bo={}.toString.call(vo).slice(8,-1);return bo==="Object"&&vo.constructor&&(bo=vo.constructor.name),bo==="Map"||bo==="Set"?Array.from(vo):bo==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(bo)?ma(vo,Ai):void 0}}function Vm(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function St$1(vo,Ai){return km(vo)||Fm(vo,Ai)||Hc(vo,Ai)||Vm()}function Lm(vo,Ai){if(vo==null)return{};var bo={};for(var Ra in vo)if({}.hasOwnProperty.call(vo,Ra)){if(Ai.includes(Ra))continue;bo[Ra]=vo[Ra]}return bo}function Et$2(vo,Ai){if(vo==null)return{};var bo,Ra,pc=Lm(vo,Ai);if(Object.getOwnPropertySymbols){var mc=Object.getOwnPropertySymbols(vo);for(Ra=0;Ra<mc.length;Ra++)bo=mc[Ra],Ai.includes(bo)||{}.propertyIsEnumerable.call(vo,bo)&&(pc[bo]=vo[bo])}return pc}var $m=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function Um(vo){var Ai=vo.defaultInputValue,bo=Ai===void 0?"":Ai,Ra=vo.defaultMenuIsOpen,pc=Ra===void 0?!1:Ra,mc=vo.defaultValue,uf=mc===void 0?null:mc,df=vo.inputValue,ff=vo.menuIsOpen,hf=vo.onChange,pf=vo.onInputChange,mf=vo.onMenuClose,gf=vo.onMenuOpen,yf=vo.value,vf=Et$2(vo,$m),bf=useState(df!==void 0?df:bo),Sf=St$1(bf,2),xf=Sf[0],wf=Sf[1],If=useState(ff!==void 0?ff:pc),l1=St$1(If,2),s1=l1[0],c1=l1[1],u1=useState(yf!==void 0?yf:uf),T1=St$1(u1,2),_1=T1[0],R1=T1[1],P1=useCallback(function(U1,B1){typeof hf=="function"&&hf(U1,B1),R1(U1)},[hf]),E1=useCallback(function(U1,B1){var W1;typeof pf=="function"&&(W1=pf(U1,B1)),wf(W1!==void 0?W1:U1)},[pf]),M1=useCallback(function(){typeof gf=="function"&&gf(),c1(!0)},[gf]),m1=useCallback(function(){typeof mf=="function"&&mf(),c1(!1)},[mf]),$1=df!==void 0?df:xf,k1=ff!==void 0?ff:s1,F1=yf!==void 0?yf:_1;return te$2(te$2({},vf),{},{inputValue:$1,menuIsOpen:k1,onChange:P1,onInputChange:E1,onMenuClose:m1,onMenuOpen:M1,value:F1})}function Hm(vo,Ai){if(!(vo instanceof Ai))throw new TypeError("Cannot call a class as a function")}function Yi(vo,Ai){for(var bo=0;bo<Ai.length;bo++){var Ra=Ai[bo];Ra.enumerable=Ra.enumerable||!1,Ra.configurable=!0,"value"in Ra&&(Ra.writable=!0),Object.defineProperty(vo,K8(Ra.key),Ra)}}function Wm(vo,Ai,bo){return Yi(vo.prototype,Ai),Yi(vo,bo),Object.defineProperty(vo,"prototype",{writable:!1}),vo}function pa$1(vo,Ai){return pa$1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(bo,Ra){return bo.__proto__=Ra,bo},pa$1(vo,Ai)}function Bm(vo,Ai){if(typeof Ai!="function"&&Ai!==null)throw new TypeError("Super expression must either be null or a function");vo.prototype=Object.create(Ai&&Ai.prototype,{constructor:{value:vo,writable:!0,configurable:!0}}),Object.defineProperty(vo,"prototype",{writable:!1}),Ai&&pa$1(vo,Ai)}function Mr$2(vo){return Mr$2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Ai){return Ai.__proto__||Object.getPrototypeOf(Ai)},Mr$2(vo)}function Wc(){try{var vo=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Wc=function(){return!!vo})()}function zm(vo){if(vo===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return vo}function jm(vo,Ai){if(Ai&&(Ci$1(Ai)=="object"||typeof Ai=="function"))return Ai;if(Ai!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return zm(vo)}function Ym(vo){var Ai=Wc();return function(){var bo,Ra=Mr$2(vo);if(Ai){var pc=Mr$2(this).constructor;bo=Reflect.construct(Ra,arguments,pc)}else bo=Ra.apply(this,arguments);return jm(this,bo)}}function Gm(vo){if(Array.isArray(vo))return ma(vo)}function qm(vo){if(typeof Symbol<"u"&&vo[Symbol.iterator]!=null||vo["@@iterator"]!=null)return Array.from(vo)}function Xm(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
4
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $a(vo){return Gm(vo)||qm(vo)||Hc(vo)||Xm()}var Km=!1;function Zm(vo){if(vo.sheet)return vo.sheet;for(var Ai=0;Ai<document.styleSheets.length;Ai++)if(document.styleSheets[Ai].ownerNode===vo)return document.styleSheets[Ai]}function Qm(vo){var Ai=document.createElement("style");return Ai.setAttribute("data-emotion",vo.key),vo.nonce!==void 0&&Ai.setAttribute("nonce",vo.nonce),Ai.appendChild(document.createTextNode("")),Ai.setAttribute("data-s",""),Ai}var Jm=function(){function vo(bo){var Ra=this;this._insertTag=function(pc){var mc;Ra.tags.length===0?Ra.insertionPoint?mc=Ra.insertionPoint.nextSibling:Ra.prepend?mc=Ra.container.firstChild:mc=Ra.before:mc=Ra.tags[Ra.tags.length-1].nextSibling,Ra.container.insertBefore(pc,mc),Ra.tags.push(pc)},this.isSpeedy=bo.speedy===void 0?!Km:bo.speedy,this.tags=[],this.ctr=0,this.nonce=bo.nonce,this.key=bo.key,this.container=bo.container,this.prepend=bo.prepend,this.insertionPoint=bo.insertionPoint,this.before=null}var Ai=vo.prototype;return Ai.hydrate=function(bo){bo.forEach(this._insertTag)},Ai.insert=function(bo){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(Qm(this));var Ra=this.tags[this.tags.length-1];if(this.isSpeedy){var pc=Zm(Ra);try{pc.insertRule(bo,pc.cssRules.length)}catch{}}else Ra.appendChild(document.createTextNode(bo));this.ctr++},Ai.flush=function(){this.tags.forEach(function(bo){var Ra;return(Ra=bo.parentNode)==null?void 0:Ra.removeChild(bo)}),this.tags=[],this.ctr=0},vo}(),Ue$2="-ms-",Nr$2="-moz-",me$2="-webkit-",Bc="comm",Ua="rule",Ha="decl",ep="@import",zc="@keyframes",tp="@layer",np=Math.abs,Kr$2=String.fromCharCode,rp=Object.assign;function op(vo,Ai){return $e$2(vo,0)^45?(((Ai<<2^$e$2(vo,0))<<2^$e$2(vo,1))<<2^$e$2(vo,2))<<2^$e$2(vo,3):0}function jc(vo){return vo.trim()}function ap(vo,Ai){return(vo=Ai.exec(vo))?vo[0]:vo}function pe$2(vo,Ai,bo){return vo.replace(Ai,bo)}function ha(vo,Ai){return vo.indexOf(Ai)}function $e$2(vo,Ai){return vo.charCodeAt(Ai)|0}function Vn$2(vo,Ai,bo){return vo.slice(Ai,bo)}function ut$1(vo){return vo.length}function Wa(vo){return vo.length}function ar$1(vo,Ai){return Ai.push(vo),vo}function ip(vo,Ai){return vo.map(Ai).join("")}var Zr$1=1,pn$2=1,Yc=0,qe$2=0,Me$2=0,bn$1="";function Qr$2(vo,Ai,bo,Ra,pc,mc,uf){return{value:vo,root:Ai,parent:bo,type:Ra,props:pc,children:mc,line:Zr$1,column:pn$2,length:uf,return:""}}function Tn$1(vo,Ai){return rp(Qr$2("",null,null,"",null,null,0),vo,{length:-vo.length},Ai)}function sp(){return Me$2}function cp(){return Me$2=qe$2>0?$e$2(bn$1,--qe$2):0,pn$2--,Me$2===10&&(pn$2=1,Zr$1--),Me$2}function Ke$2(){return Me$2=qe$2<Yc?$e$2(bn$1,qe$2++):0,pn$2++,Me$2===10&&(pn$2=1,Zr$1++),Me$2}function gt$2(){return $e$2(bn$1,qe$2)}function br$2(){return qe$2}function Kn$2(vo,Ai){return Vn$2(bn$1,vo,Ai)}function Ln$1(vo){switch(vo){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Gc(vo){return Zr$1=pn$2=1,Yc=ut$1(bn$1=vo),qe$2=0,[]}function qc(vo){return bn$1="",vo}function yr$2(vo){return jc(Kn$2(qe$2-1,ga(vo===91?vo+2:vo===40?vo+1:vo)))}function lp(vo){for(;(Me$2=gt$2())&&Me$2<33;)Ke$2();return Ln$1(vo)>2||Ln$1(Me$2)>3?"":" "}function up(vo,Ai){for(;--Ai&&Ke$2()&&!(Me$2<48||Me$2>102||Me$2>57&&Me$2<65||Me$2>70&&Me$2<97););return Kn$2(vo,br$2()+(Ai<6&>$2()==32&&Ke$2()==32))}function ga(vo){for(;Ke$2();)switch(Me$2){case vo:return qe$2;case 34:case 39:vo!==34&&vo!==39&&ga(Me$2);break;case 40:vo===41&&ga(vo);break;case 92:Ke$2();break}return qe$2}function dp(vo,Ai){for(;Ke$2()&&vo+Me$2!==57&&!(vo+Me$2===84&>$2()===47););return"/*"+Kn$2(Ai,qe$2-1)+"*"+Kr$2(vo===47?vo:Ke$2())}function fp(vo){for(;!Ln$1(gt$2());)Ke$2();return Kn$2(vo,qe$2)}function mp(vo){return qc(wr$2("",null,null,null,[""],vo=Gc(vo),0,[0],vo))}function wr$2(vo,Ai,bo,Ra,pc,mc,uf,df,ff){for(var hf=0,pf=0,mf=uf,gf=0,yf=0,vf=0,bf=1,Sf=1,xf=1,wf=0,If="",l1=pc,s1=mc,c1=Ra,u1=If;Sf;)switch(vf=wf,wf=Ke$2()){case 40:if(vf!=108&&$e$2(u1,mf-1)==58){ha(u1+=pe$2(yr$2(wf),"&","&\f"),"&\f")!=-1&&(xf=-1);break}case 34:case 39:case 91:u1+=yr$2(wf);break;case 9:case 10:case 13:case 32:u1+=lp(vf);break;case 92:u1+=up(br$2()-1,7);continue;case 47:switch(gt$2()){case 42:case 47:ar$1(pp(dp(Ke$2(),br$2()),Ai,bo),ff);break;default:u1+="/"}break;case 123*bf:df[hf++]=ut$1(u1)*xf;case 125*bf:case 59:case 0:switch(wf){case 0:case 125:Sf=0;case 59+pf:xf==-1&&(u1=pe$2(u1,/\f/g,"")),yf>0&&ut$1(u1)-mf&&ar$1(yf>32?qi(u1+";",Ra,bo,mf-1):qi(pe$2(u1," ","")+";",Ra,bo,mf-2),ff);break;case 59:u1+=";";default:if(ar$1(c1=Gi(u1,Ai,bo,hf,pf,pc,df,If,l1=[],s1=[],mf),mc),wf===123)if(pf===0)wr$2(u1,Ai,c1,c1,l1,mc,mf,df,s1);else switch(gf===99&&$e$2(u1,3)===110?100:gf){case 100:case 108:case 109:case 115:wr$2(vo,c1,c1,Ra&&ar$1(Gi(vo,c1,c1,0,0,pc,df,If,pc,l1=[],mf),s1),pc,s1,mf,df,Ra?l1:s1);break;default:wr$2(u1,c1,c1,c1,[""],s1,0,df,s1)}}hf=pf=yf=0,bf=xf=1,If=u1="",mf=uf;break;case 58:mf=1+ut$1(u1),yf=vf;default:if(bf<1){if(wf==123)--bf;else if(wf==125&&bf++==0&&cp()==125)continue}switch(u1+=Kr$2(wf),wf*bf){case 38:xf=pf>0?1:(u1+="\f",-1);break;case 44:df[hf++]=(ut$1(u1)-1)*xf,xf=1;break;case 64:gt$2()===45&&(u1+=yr$2(Ke$2())),gf=gt$2(),pf=mf=ut$1(If=u1+=fp(br$2())),wf++;break;case 45:vf===45&&ut$1(u1)==2&&(bf=0)}}return mc}function Gi(vo,Ai,bo,Ra,pc,mc,uf,df,ff,hf,pf){for(var mf=pc-1,gf=pc===0?mc:[""],yf=Wa(gf),vf=0,bf=0,Sf=0;vf<Ra;++vf)for(var xf=0,wf=Vn$2(vo,mf+1,mf=np(bf=uf[vf])),If=vo;xf<yf;++xf)(If=jc(bf>0?gf[xf]+" "+wf:pe$2(wf,/&\f/g,gf[xf])))&&(ff[Sf++]=If);return Qr$2(vo,Ai,bo,pc===0?Ua:df,ff,hf,pf)}function pp(vo,Ai,bo){return Qr$2(vo,Ai,bo,Bc,Kr$2(sp()),Vn$2(vo,2,-2),0)}function qi(vo,Ai,bo,Ra){return Qr$2(vo,Ai,bo,Ha,Vn$2(vo,0,Ra),Vn$2(vo,Ra+1,-1),Ra)}function ln$1(vo,Ai){for(var bo="",Ra=Wa(vo),pc=0;pc<Ra;pc++)bo+=Ai(vo[pc],pc,vo,Ai)||"";return bo}function hp(vo,Ai,bo,Ra){switch(vo.type){case tp:if(vo.children.length)break;case ep:case Ha:return vo.return=vo.return||vo.value;case Bc:return"";case zc:return vo.return=vo.value+"{"+ln$1(vo.children,Ra)+"}";case Ua:vo.value=vo.props.join(",")}return ut$1(bo=ln$1(vo.children,Ra))?vo.return=vo.value+"{"+bo+"}":""}function gp(vo){var Ai=Wa(vo);return function(bo,Ra,pc,mc){for(var uf="",df=0;df<Ai;df++)uf+=vo[df](bo,Ra,pc,mc)||"";return uf}}function vp(vo){return function(Ai){Ai.root||(Ai=Ai.return)&&vo(Ai)}}function bp(vo){var Ai=Object.create(null);return function(bo){return Ai[bo]===void 0&&(Ai[bo]=vo(bo)),Ai[bo]}}var yp=function(vo,Ai,bo){for(var Ra=0,pc=0;Ra=pc,pc=gt$2(),Ra===38&&pc===12&&(Ai[bo]=1),!Ln$1(pc);)Ke$2();return Kn$2(vo,qe$2)},wp=function(vo,Ai){var bo=-1,Ra=44;do switch(Ln$1(Ra)){case 0:Ra===38&>$2()===12&&(Ai[bo]=1),vo[bo]+=yp(qe$2-1,Ai,bo);break;case 2:vo[bo]+=yr$2(Ra);break;case 4:if(Ra===44){vo[++bo]=gt$2()===58?"&\f":"",Ai[bo]=vo[bo].length;break}default:vo[bo]+=Kr$2(Ra)}while(Ra=Ke$2());return vo},xp=function(vo,Ai){return qc(wp(Gc(vo),Ai))},Xi=new WeakMap,Sp=function(vo){if(!(vo.type!=="rule"||!vo.parent||vo.length<1)){for(var Ai=vo.value,bo=vo.parent,Ra=vo.column===bo.column&&vo.line===bo.line;bo.type!=="rule";)if(bo=bo.parent,!bo)return;if(!(vo.props.length===1&&Ai.charCodeAt(0)!==58&&!Xi.get(bo))&&!Ra){Xi.set(vo,!0);for(var pc=[],mc=xp(Ai,pc),uf=bo.props,df=0,ff=0;df<mc.length;df++)for(var hf=0;hf<uf.length;hf++,ff++)vo.props[ff]=pc[df]?mc[df].replace(/&\f/g,uf[hf]):uf[hf]+" "+mc[df]}}},Cp=function(vo){if(vo.type==="decl"){var Ai=vo.value;Ai.charCodeAt(0)===108&&Ai.charCodeAt(2)===98&&(vo.return="",vo.value="")}};function Xc(vo,Ai){switch(op(vo,Ai)){case 5103:return me$2+"print-"+vo+vo;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return me$2+vo+vo;case 5349:case 4246:case 4810:case 6968:case 2756:return me$2+vo+Nr$2+vo+Ue$2+vo+vo;case 6828:case 4268:return me$2+vo+Ue$2+vo+vo;case 6165:return me$2+vo+Ue$2+"flex-"+vo+vo;case 5187:return me$2+vo+pe$2(vo,/(\w+).+(:[^]+)/,me$2+"box-$1$2"+Ue$2+"flex-$1$2")+vo;case 5443:return me$2+vo+Ue$2+"flex-item-"+pe$2(vo,/flex-|-self/,"")+vo;case 4675:return me$2+vo+Ue$2+"flex-line-pack"+pe$2(vo,/align-content|flex-|-self/,"")+vo;case 5548:return me$2+vo+Ue$2+pe$2(vo,"shrink","negative")+vo;case 5292:return me$2+vo+Ue$2+pe$2(vo,"basis","preferred-size")+vo;case 6060:return me$2+"box-"+pe$2(vo,"-grow","")+me$2+vo+Ue$2+pe$2(vo,"grow","positive")+vo;case 4554:return me$2+pe$2(vo,/([^-])(transform)/g,"$1"+me$2+"$2")+vo;case 6187:return pe$2(pe$2(pe$2(vo,/(zoom-|grab)/,me$2+"$1"),/(image-set)/,me$2+"$1"),vo,"")+vo;case 5495:case 3959:return pe$2(vo,/(image-set\([^]*)/,me$2+"$1$`$1");case 4968:return pe$2(pe$2(vo,/(.+:)(flex-)?(.*)/,me$2+"box-pack:$3"+Ue$2+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+me$2+vo+vo;case 4095:case 3583:case 4068:case 2532:return pe$2(vo,/(.+)-inline(.+)/,me$2+"$1$2")+vo;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(ut$1(vo)-1-Ai>6)switch($e$2(vo,Ai+1)){case 109:if($e$2(vo,Ai+4)!==45)break;case 102:return pe$2(vo,/(.+:)(.+)-([^]+)/,"$1"+me$2+"$2-$3$1"+Nr$2+($e$2(vo,Ai+3)==108?"$3":"$2-$3"))+vo;case 115:return~ha(vo,"stretch")?Xc(pe$2(vo,"stretch","fill-available"),Ai)+vo:vo}break;case 4949:if($e$2(vo,Ai+1)!==115)break;case 6444:switch($e$2(vo,ut$1(vo)-3-(~ha(vo,"!important")&&10))){case 107:return pe$2(vo,":",":"+me$2)+vo;case 101:return pe$2(vo,/(.+:)([^;!]+)(;|!.+)?/,"$1"+me$2+($e$2(vo,14)===45?"inline-":"")+"box$3$1"+me$2+"$2$3$1"+Ue$2+"$2box$3")+vo}break;case 5936:switch($e$2(vo,Ai+11)){case 114:return me$2+vo+Ue$2+pe$2(vo,/[svh]\w+-[tblr]{2}/,"tb")+vo;case 108:return me$2+vo+Ue$2+pe$2(vo,/[svh]\w+-[tblr]{2}/,"tb-rl")+vo;case 45:return me$2+vo+Ue$2+pe$2(vo,/[svh]\w+-[tblr]{2}/,"lr")+vo}return me$2+vo+Ue$2+vo+vo}return vo}var Ip=function(vo,Ai,bo,Ra){if(vo.length>-1&&!vo.return)switch(vo.type){case Ha:vo.return=Xc(vo.value,vo.length);break;case zc:return ln$1([Tn$1(vo,{value:pe$2(vo.value,"@","@"+me$2)})],Ra);case Ua:if(vo.length)return ip(vo.props,function(pc){switch(ap(pc,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return ln$1([Tn$1(vo,{props:[pe$2(pc,/:(read-\w+)/,":"+Nr$2+"$1")]})],Ra);case"::placeholder":return ln$1([Tn$1(vo,{props:[pe$2(pc,/:(plac\w+)/,":"+me$2+"input-$1")]}),Tn$1(vo,{props:[pe$2(pc,/:(plac\w+)/,":"+Nr$2+"$1")]}),Tn$1(vo,{props:[pe$2(pc,/:(plac\w+)/,Ue$2+"input-$1")]})],Ra)}return""})}},Ep=[Ip],Pp=function(vo){var Ai=vo.key;if(Ai==="css"){var bo=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(bo,function(vf){var bf=vf.getAttribute("data-emotion");bf.indexOf(" ")!==-1&&(document.head.appendChild(vf),vf.setAttribute("data-s",""))})}var Ra=vo.stylisPlugins||Ep,pc={},mc,uf=[];mc=vo.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+Ai+' "]'),function(vf){for(var bf=vf.getAttribute("data-emotion").split(" "),Sf=1;Sf<bf.length;Sf++)pc[bf[Sf]]=!0;uf.push(vf)});var df,ff=[Sp,Cp];{var hf,pf=[hp,vp(function(vf){hf.insert(vf)})],mf=gp(ff.concat(Ra,pf)),gf=function(vf){return ln$1(mp(vf),mf)};df=function(vf,bf,Sf,xf){hf=Sf,gf(vf?vf+"{"+bf.styles+"}":bf.styles),xf&&(yf.inserted[bf.name]=!0)}}var yf={key:Ai,sheet:new Jm({key:Ai,container:mc,nonce:vo.nonce,speedy:vo.speedy,prepend:vo.prepend,insertionPoint:vo.insertionPoint}),nonce:vo.nonce,inserted:pc,registered:{},insert:df};return yf.sheet.hydrate(uf),yf},Do={exports:{}},he$2={};/** @license React v16.13.1
|
|
5
|
-
* react-is.production.min.js
|
|
6
|
-
*
|
|
7
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the MIT license found in the
|
|
10
|
-
* LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/var Ki;function Tp(){if(Ki)return he$2;Ki=1;var vo=typeof Symbol=="function"&&Symbol.for,Ai=vo?Symbol.for("react.element"):60103,bo=vo?Symbol.for("react.portal"):60106,Ra=vo?Symbol.for("react.fragment"):60107,pc=vo?Symbol.for("react.strict_mode"):60108,mc=vo?Symbol.for("react.profiler"):60114,uf=vo?Symbol.for("react.provider"):60109,df=vo?Symbol.for("react.context"):60110,ff=vo?Symbol.for("react.async_mode"):60111,hf=vo?Symbol.for("react.concurrent_mode"):60111,pf=vo?Symbol.for("react.forward_ref"):60112,mf=vo?Symbol.for("react.suspense"):60113,gf=vo?Symbol.for("react.suspense_list"):60120,yf=vo?Symbol.for("react.memo"):60115,vf=vo?Symbol.for("react.lazy"):60116,bf=vo?Symbol.for("react.block"):60121,Sf=vo?Symbol.for("react.fundamental"):60117,xf=vo?Symbol.for("react.responder"):60118,wf=vo?Symbol.for("react.scope"):60119;function If(s1){if(typeof s1=="object"&&s1!==null){var c1=s1.$$typeof;switch(c1){case Ai:switch(s1=s1.type,s1){case ff:case hf:case Ra:case mc:case pc:case mf:return s1;default:switch(s1=s1&&s1.$$typeof,s1){case df:case pf:case vf:case yf:case uf:return s1;default:return c1}}case bo:return c1}}}function l1(s1){return If(s1)===hf}return he$2.AsyncMode=ff,he$2.ConcurrentMode=hf,he$2.ContextConsumer=df,he$2.ContextProvider=uf,he$2.Element=Ai,he$2.ForwardRef=pf,he$2.Fragment=Ra,he$2.Lazy=vf,he$2.Memo=yf,he$2.Portal=bo,he$2.Profiler=mc,he$2.StrictMode=pc,he$2.Suspense=mf,he$2.isAsyncMode=function(s1){return l1(s1)||If(s1)===ff},he$2.isConcurrentMode=l1,he$2.isContextConsumer=function(s1){return If(s1)===df},he$2.isContextProvider=function(s1){return If(s1)===uf},he$2.isElement=function(s1){return typeof s1=="object"&&s1!==null&&s1.$$typeof===Ai},he$2.isForwardRef=function(s1){return If(s1)===pf},he$2.isFragment=function(s1){return If(s1)===Ra},he$2.isLazy=function(s1){return If(s1)===vf},he$2.isMemo=function(s1){return If(s1)===yf},he$2.isPortal=function(s1){return If(s1)===bo},he$2.isProfiler=function(s1){return If(s1)===mc},he$2.isStrictMode=function(s1){return If(s1)===pc},he$2.isSuspense=function(s1){return If(s1)===mf},he$2.isValidElementType=function(s1){return typeof s1=="string"||typeof s1=="function"||s1===Ra||s1===hf||s1===mc||s1===pc||s1===mf||s1===gf||typeof s1=="object"&&s1!==null&&(s1.$$typeof===vf||s1.$$typeof===yf||s1.$$typeof===uf||s1.$$typeof===df||s1.$$typeof===pf||s1.$$typeof===Sf||s1.$$typeof===xf||s1.$$typeof===wf||s1.$$typeof===bf)},he$2.typeOf=If,he$2}var Zi;function Op(){return Zi||(Zi=1,Do.exports=Tp()),Do.exports}var Ro,Qi;function Mp(){if(Qi)return Ro;Qi=1;var vo=Op(),Ai={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},bo={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Ra={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},pc={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},mc={};mc[vo.ForwardRef]=Ra,mc[vo.Memo]=pc;function uf(vf){return vo.isMemo(vf)?pc:mc[vf.$$typeof]||Ai}var df=Object.defineProperty,ff=Object.getOwnPropertyNames,hf=Object.getOwnPropertySymbols,pf=Object.getOwnPropertyDescriptor,mf=Object.getPrototypeOf,gf=Object.prototype;function yf(vf,bf,Sf){if(typeof bf!="string"){if(gf){var xf=mf(bf);xf&&xf!==gf&&yf(vf,xf,Sf)}var wf=ff(bf);hf&&(wf=wf.concat(hf(bf)));for(var If=uf(vf),l1=uf(bf),s1=0;s1<wf.length;++s1){var c1=wf[s1];if(!bo[c1]&&!(Sf&&Sf[c1])&&!(l1&&l1[c1])&&!(If&&If[c1])){var u1=pf(bf,c1);try{df(vf,c1,u1)}catch{}}}}return vf}return Ro=yf,Ro}Mp();var Np=!0;function Ap(vo,Ai,bo){var Ra="";return bo.split(" ").forEach(function(pc){vo[pc]!==void 0?Ai.push(vo[pc]+";"):pc&&(Ra+=pc+" ")}),Ra}var Kc=function(vo,Ai,bo){var Ra=vo.key+"-"+Ai.name;(bo===!1||Np===!1)&&vo.registered[Ra]===void 0&&(vo.registered[Ra]=Ai.styles)},Dp=function(vo,Ai,bo){Kc(vo,Ai,bo);var Ra=vo.key+"-"+Ai.name;if(vo.inserted[Ai.name]===void 0){var pc=Ai;do vo.insert(Ai===pc?"."+Ra:"",pc,vo.sheet,!0),pc=pc.next;while(pc!==void 0)}};function Rp(vo){for(var Ai=0,bo,Ra=0,pc=vo.length;pc>=4;++Ra,pc-=4)bo=vo.charCodeAt(Ra)&255|(vo.charCodeAt(++Ra)&255)<<8|(vo.charCodeAt(++Ra)&255)<<16|(vo.charCodeAt(++Ra)&255)<<24,bo=(bo&65535)*1540483477+((bo>>>16)*59797<<16),bo^=bo>>>24,Ai=(bo&65535)*1540483477+((bo>>>16)*59797<<16)^(Ai&65535)*1540483477+((Ai>>>16)*59797<<16);switch(pc){case 3:Ai^=(vo.charCodeAt(Ra+2)&255)<<16;case 2:Ai^=(vo.charCodeAt(Ra+1)&255)<<8;case 1:Ai^=vo.charCodeAt(Ra)&255,Ai=(Ai&65535)*1540483477+((Ai>>>16)*59797<<16)}return Ai^=Ai>>>13,Ai=(Ai&65535)*1540483477+((Ai>>>16)*59797<<16),((Ai^Ai>>>15)>>>0).toString(36)}var _p={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},kp=/[A-Z]|^ms/g,Fp=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Zc=function(vo){return vo.charCodeAt(1)===45},Ji=function(vo){return vo!=null&&typeof vo!="boolean"},_o=bp(function(vo){return Zc(vo)?vo:vo.replace(kp,"-$&").toLowerCase()}),es$1=function(vo,Ai){switch(vo){case"animation":case"animationName":if(typeof Ai=="string")return Ai.replace(Fp,function(bo,Ra,pc){return dt$1={name:Ra,styles:pc,next:dt$1},Ra})}return _p[vo]!==1&&!Zc(vo)&&typeof Ai=="number"&&Ai!==0?Ai+"px":Ai};function $n$2(vo,Ai,bo){if(bo==null)return"";var Ra=bo;if(Ra.__emotion_styles!==void 0)return Ra;switch(typeof bo){case"boolean":return"";case"object":{var pc=bo;if(pc.anim===1)return dt$1={name:pc.name,styles:pc.styles,next:dt$1},pc.name;var mc=bo;if(mc.styles!==void 0){var uf=mc.next;if(uf!==void 0)for(;uf!==void 0;)dt$1={name:uf.name,styles:uf.styles,next:dt$1},uf=uf.next;var df=mc.styles+";";return df}return Vp(vo,Ai,bo)}case"function":{if(vo!==void 0){var ff=dt$1,hf=bo(vo);return dt$1=ff,$n$2(vo,Ai,hf)}break}}var pf=bo;return pf}function Vp(vo,Ai,bo){var Ra="";if(Array.isArray(bo))for(var pc=0;pc<bo.length;pc++)Ra+=$n$2(vo,Ai,bo[pc])+";";else for(var mc in bo){var uf=bo[mc];if(typeof uf!="object"){var df=uf;Ji(df)&&(Ra+=_o(mc)+":"+es$1(mc,df)+";")}else if(Array.isArray(uf)&&typeof uf[0]=="string"&&Ai==null)for(var ff=0;ff<uf.length;ff++)Ji(uf[ff])&&(Ra+=_o(mc)+":"+es$1(mc,uf[ff])+";");else{var hf=$n$2(vo,Ai,uf);switch(mc){case"animation":case"animationName":{Ra+=_o(mc)+":"+hf+";";break}default:Ra+=mc+"{"+hf+"}"}}}return Ra}var ts$1=/label:\s*([^\s;{]+)\s*(;|$)/g,dt$1;function Qc(vo,Ai,bo){if(vo.length===1&&typeof vo[0]=="object"&&vo[0]!==null&&vo[0].styles!==void 0)return vo[0];var Ra=!0,pc="";dt$1=void 0;var mc=vo[0];if(mc==null||mc.raw===void 0)Ra=!1,pc+=$n$2(bo,Ai,mc);else{var uf=mc;pc+=uf[0]}for(var df=1;df<vo.length;df++)if(pc+=$n$2(bo,Ai,vo[df]),Ra){var ff=mc;pc+=ff[df]}ts$1.lastIndex=0;for(var hf="",pf;(pf=ts$1.exec(pc))!==null;)hf+="-"+pf[1];var mf=Rp(pc)+hf;return{name:mf,styles:pc,next:dt$1}}var Lp=function(vo){return vo()},$p=y$2.useInsertionEffect?y$2.useInsertionEffect:!1,Up=$p||Lp,Hp=!1,Jc=y$2.createContext(typeof HTMLElement<"u"?Pp({key:"css"}):null);Jc.Provider;var Wp=function(vo){return forwardRef(function(Ai,bo){var Ra=useContext(Jc);return vo(Ai,Ra,bo)})},Bp=y$2.createContext({}),Ba={}.hasOwnProperty,va="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",zp=function(vo,Ai){var bo={};for(var Ra in Ai)Ba.call(Ai,Ra)&&(bo[Ra]=Ai[Ra]);return bo[va]=vo,bo},jp=function(vo){var Ai=vo.cache,bo=vo.serialized,Ra=vo.isStringTag;return Kc(Ai,bo,Ra),Up(function(){return Dp(Ai,bo,Ra)}),null},Yp=Wp(function(vo,Ai,bo){var Ra=vo.css;typeof Ra=="string"&&Ai.registered[Ra]!==void 0&&(Ra=Ai.registered[Ra]);var pc=vo[va],mc=[Ra],uf="";typeof vo.className=="string"?uf=Ap(Ai.registered,mc,vo.className):vo.className!=null&&(uf=vo.className+" ");var df=Qc(mc,void 0,y$2.useContext(Bp));uf+=Ai.key+"-"+df.name;var ff={};for(var hf in vo)Ba.call(vo,hf)&&hf!=="css"&&hf!==va&&!Hp&&(ff[hf]=vo[hf]);return ff.className=uf,bo&&(ff.ref=bo),y$2.createElement(y$2.Fragment,null,y$2.createElement(jp,{cache:Ai,serialized:df,isStringTag:typeof pc=="string"}),y$2.createElement(pc,ff))}),Gp=Yp,Q$1=function(vo,Ai){var bo=arguments;if(Ai==null||!Ba.call(Ai,"css"))return y$2.createElement.apply(void 0,bo);var Ra=bo.length,pc=new Array(Ra);pc[0]=Gp,pc[1]=zp(vo,Ai);for(var mc=2;mc<Ra;mc++)pc[mc]=bo[mc];return y$2.createElement.apply(null,pc)};(function(vo){var Ai;Ai||(Ai=vo.JSX||(vo.JSX={}))})(Q$1);function za(){for(var vo=arguments.length,Ai=new Array(vo),bo=0;bo<vo;bo++)Ai[bo]=arguments[bo];return Qc(Ai)}function qp(){var vo=za.apply(void 0,arguments),Ai="animation-"+vo.name;return{name:Ai,styles:"@keyframes "+Ai+"{"+vo.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}function Xp(vo,Ai){return Ai||(Ai=vo.slice(0)),Object.freeze(Object.defineProperties(vo,{raw:{value:Object.freeze(Ai)}}))}const Kp=["top","right","bottom","left"],Vt$1=Math.min,Xe$2=Math.max,Ar$2=Math.round,ir$1=Math.floor,vt$2=vo=>({x:vo,y:vo}),Zp={left:"right",right:"left",bottom:"top",top:"bottom"},Qp={start:"end",end:"start"};function ba(vo,Ai,bo){return Xe$2(vo,Vt$1(Ai,bo))}function Ct$2(vo,Ai){return typeof vo=="function"?vo(Ai):vo}function It$2(vo){return vo.split("-")[0]}function yn$1(vo){return vo.split("-")[1]}function ja(vo){return vo==="x"?"y":"x"}function Ya$1(vo){return vo==="y"?"height":"width"}function Lt$2(vo){return["top","bottom"].includes(It$2(vo))?"y":"x"}function Ga(vo){return ja(Lt$2(vo))}function Jp(vo,Ai,bo){bo===void 0&&(bo=!1);const Ra=yn$1(vo),pc=Ga(vo),mc=Ya$1(pc);let uf=pc==="x"?Ra===(bo?"end":"start")?"right":"left":Ra==="start"?"bottom":"top";return Ai.reference[mc]>Ai.floating[mc]&&(uf=Dr$2(uf)),[uf,Dr$2(uf)]}function eh(vo){const Ai=Dr$2(vo);return[ya(vo),Ai,ya(Ai)]}function ya(vo){return vo.replace(/start|end/g,Ai=>Qp[Ai])}function th(vo,Ai,bo){const Ra=["left","right"],pc=["right","left"],mc=["top","bottom"],uf=["bottom","top"];switch(vo){case"top":case"bottom":return bo?Ai?pc:Ra:Ai?Ra:pc;case"left":case"right":return Ai?mc:uf;default:return[]}}function nh(vo,Ai,bo,Ra){const pc=yn$1(vo);let mc=th(It$2(vo),bo==="start",Ra);return pc&&(mc=mc.map(uf=>uf+"-"+pc),Ai&&(mc=mc.concat(mc.map(ya)))),mc}function Dr$2(vo){return vo.replace(/left|right|bottom|top/g,Ai=>Zp[Ai])}function rh(vo){return{top:0,right:0,bottom:0,left:0,...vo}}function el(vo){return typeof vo!="number"?rh(vo):{top:vo,right:vo,bottom:vo,left:vo}}function Rr$2(vo){const{x:Ai,y:bo,width:Ra,height:pc}=vo;return{width:Ra,height:pc,top:bo,left:Ai,right:Ai+Ra,bottom:bo+pc,x:Ai,y:bo}}function ns(vo,Ai,bo){let{reference:Ra,floating:pc}=vo;const mc=Lt$2(Ai),uf=Ga(Ai),df=Ya$1(uf),ff=It$2(Ai),hf=mc==="y",pf=Ra.x+Ra.width/2-pc.width/2,mf=Ra.y+Ra.height/2-pc.height/2,gf=Ra[df]/2-pc[df]/2;let yf;switch(ff){case"top":yf={x:pf,y:Ra.y-pc.height};break;case"bottom":yf={x:pf,y:Ra.y+Ra.height};break;case"right":yf={x:Ra.x+Ra.width,y:mf};break;case"left":yf={x:Ra.x-pc.width,y:mf};break;default:yf={x:Ra.x,y:Ra.y}}switch(yn$1(Ai)){case"start":yf[uf]-=gf*(bo&&hf?-1:1);break;case"end":yf[uf]+=gf*(bo&&hf?-1:1);break}return yf}const oh=async(vo,Ai,bo)=>{const{placement:Ra="bottom",strategy:pc="absolute",middleware:mc=[],platform:uf}=bo,df=mc.filter(Boolean),ff=await(uf.isRTL==null?void 0:uf.isRTL(Ai));let hf=await uf.getElementRects({reference:vo,floating:Ai,strategy:pc}),{x:pf,y:mf}=ns(hf,Ra,ff),gf=Ra,yf={},vf=0;for(let bf=0;bf<df.length;bf++){const{name:Sf,fn:xf}=df[bf],{x:wf,y:If,data:l1,reset:s1}=await xf({x:pf,y:mf,initialPlacement:Ra,placement:gf,strategy:pc,middlewareData:yf,rects:hf,platform:uf,elements:{reference:vo,floating:Ai}});pf=wf??pf,mf=If??mf,yf={...yf,[Sf]:{...yf[Sf],...l1}},s1&&vf<=50&&(vf++,typeof s1=="object"&&(s1.placement&&(gf=s1.placement),s1.rects&&(hf=s1.rects===!0?await uf.getElementRects({reference:vo,floating:Ai,strategy:pc}):s1.rects),{x:pf,y:mf}=ns(hf,gf,ff)),bf=-1)}return{x:pf,y:mf,placement:gf,strategy:pc,middlewareData:yf}};async function Un$2(vo,Ai){var bo;Ai===void 0&&(Ai={});const{x:Ra,y:pc,platform:mc,rects:uf,elements:df,strategy:ff}=vo,{boundary:hf="clippingAncestors",rootBoundary:pf="viewport",elementContext:mf="floating",altBoundary:gf=!1,padding:yf=0}=Ct$2(Ai,vo),vf=el(yf),bf=df[gf?mf==="floating"?"reference":"floating":mf],Sf=Rr$2(await mc.getClippingRect({element:(bo=await(mc.isElement==null?void 0:mc.isElement(bf)))==null||bo?bf:bf.contextElement||await(mc.getDocumentElement==null?void 0:mc.getDocumentElement(df.floating)),boundary:hf,rootBoundary:pf,strategy:ff})),xf=mf==="floating"?{x:Ra,y:pc,width:uf.floating.width,height:uf.floating.height}:uf.reference,wf=await(mc.getOffsetParent==null?void 0:mc.getOffsetParent(df.floating)),If=await(mc.isElement==null?void 0:mc.isElement(wf))?await(mc.getScale==null?void 0:mc.getScale(wf))||{x:1,y:1}:{x:1,y:1},l1=Rr$2(mc.convertOffsetParentRelativeRectToViewportRelativeRect?await mc.convertOffsetParentRelativeRectToViewportRelativeRect({elements:df,rect:xf,offsetParent:wf,strategy:ff}):xf);return{top:(Sf.top-l1.top+vf.top)/If.y,bottom:(l1.bottom-Sf.bottom+vf.bottom)/If.y,left:(Sf.left-l1.left+vf.left)/If.x,right:(l1.right-Sf.right+vf.right)/If.x}}const ah=vo=>({name:"arrow",options:vo,async fn(Ai){const{x:bo,y:Ra,placement:pc,rects:mc,platform:uf,elements:df,middlewareData:ff}=Ai,{element:hf,padding:pf=0}=Ct$2(vo,Ai)||{};if(hf==null)return{};const mf=el(pf),gf={x:bo,y:Ra},yf=Ga(pc),vf=Ya$1(yf),bf=await uf.getDimensions(hf),Sf=yf==="y",xf=Sf?"top":"left",wf=Sf?"bottom":"right",If=Sf?"clientHeight":"clientWidth",l1=mc.reference[vf]+mc.reference[yf]-gf[yf]-mc.floating[vf],s1=gf[yf]-mc.reference[yf],c1=await(uf.getOffsetParent==null?void 0:uf.getOffsetParent(hf));let u1=c1?c1[If]:0;(!u1||!await(uf.isElement==null?void 0:uf.isElement(c1)))&&(u1=df.floating[If]||mc.floating[vf]);const T1=l1/2-s1/2,_1=u1/2-bf[vf]/2-1,R1=Vt$1(mf[xf],_1),P1=Vt$1(mf[wf],_1),E1=R1,M1=u1-bf[vf]-P1,m1=u1/2-bf[vf]/2+T1,$1=ba(E1,m1,M1),k1=!ff.arrow&&yn$1(pc)!=null&&m1!==$1&&mc.reference[vf]/2-(m1<E1?R1:P1)-bf[vf]/2<0,F1=k1?m1<E1?m1-E1:m1-M1:0;return{[yf]:gf[yf]+F1,data:{[yf]:$1,centerOffset:m1-$1-F1,...k1&&{alignmentOffset:F1}},reset:k1}}}),ih=function(vo){return vo===void 0&&(vo={}),{name:"flip",options:vo,async fn(Ai){var bo,Ra;const{placement:pc,middlewareData:mc,rects:uf,initialPlacement:df,platform:ff,elements:hf}=Ai,{mainAxis:pf=!0,crossAxis:mf=!0,fallbackPlacements:gf,fallbackStrategy:yf="bestFit",fallbackAxisSideDirection:vf="none",flipAlignment:bf=!0,...Sf}=Ct$2(vo,Ai);if((bo=mc.arrow)!=null&&bo.alignmentOffset)return{};const xf=It$2(pc),wf=Lt$2(df),If=It$2(df)===df,l1=await(ff.isRTL==null?void 0:ff.isRTL(hf.floating)),s1=gf||(If||!bf?[Dr$2(df)]:eh(df)),c1=vf!=="none";!gf&&c1&&s1.push(...nh(df,bf,vf,l1));const u1=[df,...s1],T1=await Un$2(Ai,Sf),_1=[];let R1=((Ra=mc.flip)==null?void 0:Ra.overflows)||[];if(pf&&_1.push(T1[xf]),mf){const m1=Jp(pc,uf,l1);_1.push(T1[m1[0]],T1[m1[1]])}if(R1=[...R1,{placement:pc,overflows:_1}],!_1.every(m1=>m1<=0)){var P1,E1;const m1=(((P1=mc.flip)==null?void 0:P1.index)||0)+1,$1=u1[m1];if($1)return{data:{index:m1,overflows:R1},reset:{placement:$1}};let k1=(E1=R1.filter(F1=>F1.overflows[0]<=0).sort((F1,U1)=>F1.overflows[1]-U1.overflows[1])[0])==null?void 0:E1.placement;if(!k1)switch(yf){case"bestFit":{var M1;const F1=(M1=R1.filter(U1=>{if(c1){const B1=Lt$2(U1.placement);return B1===wf||B1==="y"}return!0}).map(U1=>[U1.placement,U1.overflows.filter(B1=>B1>0).reduce((B1,W1)=>B1+W1,0)]).sort((U1,B1)=>U1[1]-B1[1])[0])==null?void 0:M1[0];F1&&(k1=F1);break}case"initialPlacement":k1=df;break}if(pc!==k1)return{reset:{placement:k1}}}return{}}}};function rs(vo,Ai){return{top:vo.top-Ai.height,right:vo.right-Ai.width,bottom:vo.bottom-Ai.height,left:vo.left-Ai.width}}function os(vo){return Kp.some(Ai=>vo[Ai]>=0)}const sh=function(vo){return vo===void 0&&(vo={}),{name:"hide",options:vo,async fn(Ai){const{rects:bo}=Ai,{strategy:Ra="referenceHidden",...pc}=Ct$2(vo,Ai);switch(Ra){case"referenceHidden":{const mc=await Un$2(Ai,{...pc,elementContext:"reference"}),uf=rs(mc,bo.reference);return{data:{referenceHiddenOffsets:uf,referenceHidden:os(uf)}}}case"escaped":{const mc=await Un$2(Ai,{...pc,altBoundary:!0}),uf=rs(mc,bo.floating);return{data:{escapedOffsets:uf,escaped:os(uf)}}}default:return{}}}}};async function ch(vo,Ai){const{placement:bo,platform:Ra,elements:pc}=vo,mc=await(Ra.isRTL==null?void 0:Ra.isRTL(pc.floating)),uf=It$2(bo),df=yn$1(bo),ff=Lt$2(bo)==="y",hf=["left","top"].includes(uf)?-1:1,pf=mc&&ff?-1:1,mf=Ct$2(Ai,vo);let{mainAxis:gf,crossAxis:yf,alignmentAxis:vf}=typeof mf=="number"?{mainAxis:mf,crossAxis:0,alignmentAxis:null}:{mainAxis:mf.mainAxis||0,crossAxis:mf.crossAxis||0,alignmentAxis:mf.alignmentAxis};return df&&typeof vf=="number"&&(yf=df==="end"?vf*-1:vf),ff?{x:yf*pf,y:gf*hf}:{x:gf*hf,y:yf*pf}}const lh=function(vo){return vo===void 0&&(vo=0),{name:"offset",options:vo,async fn(Ai){var bo,Ra;const{x:pc,y:mc,placement:uf,middlewareData:df}=Ai,ff=await ch(Ai,vo);return uf===((bo=df.offset)==null?void 0:bo.placement)&&(Ra=df.arrow)!=null&&Ra.alignmentOffset?{}:{x:pc+ff.x,y:mc+ff.y,data:{...ff,placement:uf}}}}},uh=function(vo){return vo===void 0&&(vo={}),{name:"shift",options:vo,async fn(Ai){const{x:bo,y:Ra,placement:pc}=Ai,{mainAxis:mc=!0,crossAxis:uf=!1,limiter:df={fn:Sf=>{let{x:xf,y:wf}=Sf;return{x:xf,y:wf}}},...ff}=Ct$2(vo,Ai),hf={x:bo,y:Ra},pf=await Un$2(Ai,ff),mf=Lt$2(It$2(pc)),gf=ja(mf);let yf=hf[gf],vf=hf[mf];if(mc){const Sf=gf==="y"?"top":"left",xf=gf==="y"?"bottom":"right",wf=yf+pf[Sf],If=yf-pf[xf];yf=ba(wf,yf,If)}if(uf){const Sf=mf==="y"?"top":"left",xf=mf==="y"?"bottom":"right",wf=vf+pf[Sf],If=vf-pf[xf];vf=ba(wf,vf,If)}const bf=df.fn({...Ai,[gf]:yf,[mf]:vf});return{...bf,data:{x:bf.x-bo,y:bf.y-Ra,enabled:{[gf]:mc,[mf]:uf}}}}}},dh=function(vo){return vo===void 0&&(vo={}),{options:vo,fn(Ai){const{x:bo,y:Ra,placement:pc,rects:mc,middlewareData:uf}=Ai,{offset:df=0,mainAxis:ff=!0,crossAxis:hf=!0}=Ct$2(vo,Ai),pf={x:bo,y:Ra},mf=Lt$2(pc),gf=ja(mf);let yf=pf[gf],vf=pf[mf];const bf=Ct$2(df,Ai),Sf=typeof bf=="number"?{mainAxis:bf,crossAxis:0}:{mainAxis:0,crossAxis:0,...bf};if(ff){const If=gf==="y"?"height":"width",l1=mc.reference[gf]-mc.floating[If]+Sf.mainAxis,s1=mc.reference[gf]+mc.reference[If]-Sf.mainAxis;yf<l1?yf=l1:yf>s1&&(yf=s1)}if(hf){var xf,wf;const If=gf==="y"?"width":"height",l1=["top","left"].includes(It$2(pc)),s1=mc.reference[mf]-mc.floating[If]+(l1&&((xf=uf.offset)==null?void 0:xf[mf])||0)+(l1?0:Sf.crossAxis),c1=mc.reference[mf]+mc.reference[If]+(l1?0:((wf=uf.offset)==null?void 0:wf[mf])||0)-(l1?Sf.crossAxis:0);vf<s1?vf=s1:vf>c1&&(vf=c1)}return{[gf]:yf,[mf]:vf}}}},fh=function(vo){return vo===void 0&&(vo={}),{name:"size",options:vo,async fn(Ai){var bo,Ra;const{placement:pc,rects:mc,platform:uf,elements:df}=Ai,{apply:ff=()=>{},...hf}=Ct$2(vo,Ai),pf=await Un$2(Ai,hf),mf=It$2(pc),gf=yn$1(pc),yf=Lt$2(pc)==="y",{width:vf,height:bf}=mc.floating;let Sf,xf;mf==="top"||mf==="bottom"?(Sf=mf,xf=gf===(await(uf.isRTL==null?void 0:uf.isRTL(df.floating))?"start":"end")?"left":"right"):(xf=mf,Sf=gf==="end"?"top":"bottom");const wf=bf-pf.top-pf.bottom,If=vf-pf.left-pf.right,l1=Vt$1(bf-pf[Sf],wf),s1=Vt$1(vf-pf[xf],If),c1=!Ai.middlewareData.shift;let u1=l1,T1=s1;if((bo=Ai.middlewareData.shift)!=null&&bo.enabled.x&&(T1=If),(Ra=Ai.middlewareData.shift)!=null&&Ra.enabled.y&&(u1=wf),c1&&!gf){const R1=Xe$2(pf.left,0),P1=Xe$2(pf.right,0),E1=Xe$2(pf.top,0),M1=Xe$2(pf.bottom,0);yf?T1=vf-2*(R1!==0||P1!==0?R1+P1:Xe$2(pf.left,pf.right)):u1=bf-2*(E1!==0||M1!==0?E1+M1:Xe$2(pf.top,pf.bottom))}await ff({...Ai,availableWidth:T1,availableHeight:u1});const _1=await uf.getDimensions(df.floating);return vf!==_1.width||bf!==_1.height?{reset:{rects:!0}}:{}}}};function Jr$2(){return typeof window<"u"}function wn$2(vo){return tl(vo)?(vo.nodeName||"").toLowerCase():"#document"}function Ze$1(vo){var Ai;return(vo==null||(Ai=vo.ownerDocument)==null?void 0:Ai.defaultView)||window}function yt$2(vo){var Ai;return(Ai=(tl(vo)?vo.ownerDocument:vo.document)||window.document)==null?void 0:Ai.documentElement}function tl(vo){return Jr$2()?vo instanceof Node||vo instanceof Ze$1(vo).Node:!1}function rt$1(vo){return Jr$2()?vo instanceof Element||vo instanceof Ze$1(vo).Element:!1}function bt$1(vo){return Jr$2()?vo instanceof HTMLElement||vo instanceof Ze$1(vo).HTMLElement:!1}function as$1(vo){return!Jr$2()||typeof ShadowRoot>"u"?!1:vo instanceof ShadowRoot||vo instanceof Ze$1(vo).ShadowRoot}function Zn$1(vo){const{overflow:Ai,overflowX:bo,overflowY:Ra,display:pc}=ot$1(vo);return/auto|scroll|overlay|hidden|clip/.test(Ai+Ra+bo)&&!["inline","contents"].includes(pc)}function mh(vo){return["table","td","th"].includes(wn$2(vo))}function eo$2(vo){return[":popover-open",":modal"].some(Ai=>{try{return vo.matches(Ai)}catch{return!1}})}function qa(vo){const Ai=Xa$1(),bo=rt$1(vo)?ot$1(vo):vo;return bo.transform!=="none"||bo.perspective!=="none"||(bo.containerType?bo.containerType!=="normal":!1)||!Ai&&(bo.backdropFilter?bo.backdropFilter!=="none":!1)||!Ai&&(bo.filter?bo.filter!=="none":!1)||["transform","perspective","filter"].some(Ra=>(bo.willChange||"").includes(Ra))||["paint","layout","strict","content"].some(Ra=>(bo.contain||"").includes(Ra))}function ph(vo){let Ai=$t$2(vo);for(;bt$1(Ai)&&!hn$1(Ai);){if(qa(Ai))return Ai;if(eo$2(Ai))return null;Ai=$t$2(Ai)}return null}function Xa$1(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function hn$1(vo){return["html","body","#document"].includes(wn$2(vo))}function ot$1(vo){return Ze$1(vo).getComputedStyle(vo)}function to$2(vo){return rt$1(vo)?{scrollLeft:vo.scrollLeft,scrollTop:vo.scrollTop}:{scrollLeft:vo.scrollX,scrollTop:vo.scrollY}}function $t$2(vo){if(wn$2(vo)==="html")return vo;const Ai=vo.assignedSlot||vo.parentNode||as$1(vo)&&vo.host||yt$2(vo);return as$1(Ai)?Ai.host:Ai}function nl(vo){const Ai=$t$2(vo);return hn$1(Ai)?vo.ownerDocument?vo.ownerDocument.body:vo.body:bt$1(Ai)&&Zn$1(Ai)?Ai:nl(Ai)}function Hn$2(vo,Ai,bo){var Ra;Ai===void 0&&(Ai=[]),bo===void 0&&(bo=!0);const pc=nl(vo),mc=pc===((Ra=vo.ownerDocument)==null?void 0:Ra.body),uf=Ze$1(pc);if(mc){const df=wa(uf);return Ai.concat(uf,uf.visualViewport||[],Zn$1(pc)?pc:[],df&&bo?Hn$2(df):[])}return Ai.concat(pc,Hn$2(pc,[],bo))}function wa(vo){return vo.parent&&Object.getPrototypeOf(vo.parent)?vo.frameElement:null}function rl(vo){const Ai=ot$1(vo);let bo=parseFloat(Ai.width)||0,Ra=parseFloat(Ai.height)||0;const pc=bt$1(vo),mc=pc?vo.offsetWidth:bo,uf=pc?vo.offsetHeight:Ra,df=Ar$2(bo)!==mc||Ar$2(Ra)!==uf;return df&&(bo=mc,Ra=uf),{width:bo,height:Ra,$:df}}function Ka$1(vo){return rt$1(vo)?vo:vo.contextElement}function un$1(vo){const Ai=Ka$1(vo);if(!bt$1(Ai))return vt$2(1);const bo=Ai.getBoundingClientRect(),{width:Ra,height:pc,$:mc}=rl(Ai);let uf=(mc?Ar$2(bo.width):bo.width)/Ra,df=(mc?Ar$2(bo.height):bo.height)/pc;return(!uf||!Number.isFinite(uf))&&(uf=1),(!df||!Number.isFinite(df))&&(df=1),{x:uf,y:df}}const hh=vt$2(0);function ol(vo){const Ai=Ze$1(vo);return!Xa$1()||!Ai.visualViewport?hh:{x:Ai.visualViewport.offsetLeft,y:Ai.visualViewport.offsetTop}}function gh(vo,Ai,bo){return Ai===void 0&&(Ai=!1),!bo||Ai&&bo!==Ze$1(vo)?!1:Ai}function qt$1(vo,Ai,bo,Ra){Ai===void 0&&(Ai=!1),bo===void 0&&(bo=!1);const pc=vo.getBoundingClientRect(),mc=Ka$1(vo);let uf=vt$2(1);Ai&&(Ra?rt$1(Ra)&&(uf=un$1(Ra)):uf=un$1(vo));const df=gh(mc,bo,Ra)?ol(mc):vt$2(0);let ff=(pc.left+df.x)/uf.x,hf=(pc.top+df.y)/uf.y,pf=pc.width/uf.x,mf=pc.height/uf.y;if(mc){const gf=Ze$1(mc),yf=Ra&&rt$1(Ra)?Ze$1(Ra):Ra;let vf=gf,bf=wa(vf);for(;bf&&Ra&&yf!==vf;){const Sf=un$1(bf),xf=bf.getBoundingClientRect(),wf=ot$1(bf),If=xf.left+(bf.clientLeft+parseFloat(wf.paddingLeft))*Sf.x,l1=xf.top+(bf.clientTop+parseFloat(wf.paddingTop))*Sf.y;ff*=Sf.x,hf*=Sf.y,pf*=Sf.x,mf*=Sf.y,ff+=If,hf+=l1,vf=Ze$1(bf),bf=wa(vf)}}return Rr$2({width:pf,height:mf,x:ff,y:hf})}function Za(vo,Ai){const bo=to$2(vo).scrollLeft;return Ai?Ai.left+bo:qt$1(yt$2(vo)).left+bo}function al(vo,Ai,bo){bo===void 0&&(bo=!1);const Ra=vo.getBoundingClientRect(),pc=Ra.left+Ai.scrollLeft-(bo?0:Za(vo,Ra)),mc=Ra.top+Ai.scrollTop;return{x:pc,y:mc}}function vh(vo){let{elements:Ai,rect:bo,offsetParent:Ra,strategy:pc}=vo;const mc=pc==="fixed",uf=yt$2(Ra),df=Ai?eo$2(Ai.floating):!1;if(Ra===uf||df&&mc)return bo;let ff={scrollLeft:0,scrollTop:0},hf=vt$2(1);const pf=vt$2(0),mf=bt$1(Ra);if((mf||!mf&&!mc)&&((wn$2(Ra)!=="body"||Zn$1(uf))&&(ff=to$2(Ra)),bt$1(Ra))){const yf=qt$1(Ra);hf=un$1(Ra),pf.x=yf.x+Ra.clientLeft,pf.y=yf.y+Ra.clientTop}const gf=uf&&!mf&&!mc?al(uf,ff,!0):vt$2(0);return{width:bo.width*hf.x,height:bo.height*hf.y,x:bo.x*hf.x-ff.scrollLeft*hf.x+pf.x+gf.x,y:bo.y*hf.y-ff.scrollTop*hf.y+pf.y+gf.y}}function bh(vo){return Array.from(vo.getClientRects())}function yh(vo){const Ai=yt$2(vo),bo=to$2(vo),Ra=vo.ownerDocument.body,pc=Xe$2(Ai.scrollWidth,Ai.clientWidth,Ra.scrollWidth,Ra.clientWidth),mc=Xe$2(Ai.scrollHeight,Ai.clientHeight,Ra.scrollHeight,Ra.clientHeight);let uf=-bo.scrollLeft+Za(vo);const df=-bo.scrollTop;return ot$1(Ra).direction==="rtl"&&(uf+=Xe$2(Ai.clientWidth,Ra.clientWidth)-pc),{width:pc,height:mc,x:uf,y:df}}function wh(vo,Ai){const bo=Ze$1(vo),Ra=yt$2(vo),pc=bo.visualViewport;let mc=Ra.clientWidth,uf=Ra.clientHeight,df=0,ff=0;if(pc){mc=pc.width,uf=pc.height;const hf=Xa$1();(!hf||hf&&Ai==="fixed")&&(df=pc.offsetLeft,ff=pc.offsetTop)}return{width:mc,height:uf,x:df,y:ff}}function xh(vo,Ai){const bo=qt$1(vo,!0,Ai==="fixed"),Ra=bo.top+vo.clientTop,pc=bo.left+vo.clientLeft,mc=bt$1(vo)?un$1(vo):vt$2(1),uf=vo.clientWidth*mc.x,df=vo.clientHeight*mc.y,ff=pc*mc.x,hf=Ra*mc.y;return{width:uf,height:df,x:ff,y:hf}}function is$1(vo,Ai,bo){let Ra;if(Ai==="viewport")Ra=wh(vo,bo);else if(Ai==="document")Ra=yh(yt$2(vo));else if(rt$1(Ai))Ra=xh(Ai,bo);else{const pc=ol(vo);Ra={x:Ai.x-pc.x,y:Ai.y-pc.y,width:Ai.width,height:Ai.height}}return Rr$2(Ra)}function il(vo,Ai){const bo=$t$2(vo);return bo===Ai||!rt$1(bo)||hn$1(bo)?!1:ot$1(bo).position==="fixed"||il(bo,Ai)}function Sh(vo,Ai){const bo=Ai.get(vo);if(bo)return bo;let Ra=Hn$2(vo,[],!1).filter(df=>rt$1(df)&&wn$2(df)!=="body"),pc=null;const mc=ot$1(vo).position==="fixed";let uf=mc?$t$2(vo):vo;for(;rt$1(uf)&&!hn$1(uf);){const df=ot$1(uf),ff=qa(uf);!ff&&df.position==="fixed"&&(pc=null),(mc?!ff&&!pc:!ff&&df.position==="static"&&pc&&["absolute","fixed"].includes(pc.position)||Zn$1(uf)&&!ff&&il(vo,uf))?Ra=Ra.filter(hf=>hf!==uf):pc=df,uf=$t$2(uf)}return Ai.set(vo,Ra),Ra}function Ch(vo){let{element:Ai,boundary:bo,rootBoundary:Ra,strategy:pc}=vo;const mc=[...bo==="clippingAncestors"?eo$2(Ai)?[]:Sh(Ai,this._c):[].concat(bo),Ra],uf=mc[0],df=mc.reduce((ff,hf)=>{const pf=is$1(Ai,hf,pc);return ff.top=Xe$2(pf.top,ff.top),ff.right=Vt$1(pf.right,ff.right),ff.bottom=Vt$1(pf.bottom,ff.bottom),ff.left=Xe$2(pf.left,ff.left),ff},is$1(Ai,uf,pc));return{width:df.right-df.left,height:df.bottom-df.top,x:df.left,y:df.top}}function Ih(vo){const{width:Ai,height:bo}=rl(vo);return{width:Ai,height:bo}}function Eh(vo,Ai,bo){const Ra=bt$1(Ai),pc=yt$2(Ai),mc=bo==="fixed",uf=qt$1(vo,!0,mc,Ai);let df={scrollLeft:0,scrollTop:0};const ff=vt$2(0);if(Ra||!Ra&&!mc)if((wn$2(Ai)!=="body"||Zn$1(pc))&&(df=to$2(Ai)),Ra){const gf=qt$1(Ai,!0,mc,Ai);ff.x=gf.x+Ai.clientLeft,ff.y=gf.y+Ai.clientTop}else pc&&(ff.x=Za(pc));const hf=pc&&!Ra&&!mc?al(pc,df):vt$2(0),pf=uf.left+df.scrollLeft-ff.x-hf.x,mf=uf.top+df.scrollTop-ff.y-hf.y;return{x:pf,y:mf,width:uf.width,height:uf.height}}function ko(vo){return ot$1(vo).position==="static"}function ss$1(vo,Ai){if(!bt$1(vo)||ot$1(vo).position==="fixed")return null;if(Ai)return Ai(vo);let bo=vo.offsetParent;return yt$2(vo)===bo&&(bo=bo.ownerDocument.body),bo}function sl(vo,Ai){const bo=Ze$1(vo);if(eo$2(vo))return bo;if(!bt$1(vo)){let pc=$t$2(vo);for(;pc&&!hn$1(pc);){if(rt$1(pc)&&!ko(pc))return pc;pc=$t$2(pc)}return bo}let Ra=ss$1(vo,Ai);for(;Ra&&mh(Ra)&&ko(Ra);)Ra=ss$1(Ra,Ai);return Ra&&hn$1(Ra)&&ko(Ra)&&!qa(Ra)?bo:Ra||ph(vo)||bo}const Ph=async function(vo){const Ai=this.getOffsetParent||sl,bo=this.getDimensions,Ra=await bo(vo.floating);return{reference:Eh(vo.reference,await Ai(vo.floating),vo.strategy),floating:{x:0,y:0,width:Ra.width,height:Ra.height}}};function Th(vo){return ot$1(vo).direction==="rtl"}const Oh={convertOffsetParentRelativeRectToViewportRelativeRect:vh,getDocumentElement:yt$2,getClippingRect:Ch,getOffsetParent:sl,getElementRects:Ph,getClientRects:bh,getDimensions:Ih,getScale:un$1,isElement:rt$1,isRTL:Th};function Mh(vo,Ai){let bo=null,Ra;const pc=yt$2(vo);function mc(){var df;clearTimeout(Ra),(df=bo)==null||df.disconnect(),bo=null}function uf(df,ff){df===void 0&&(df=!1),ff===void 0&&(ff=1),mc();const{left:hf,top:pf,width:mf,height:gf}=vo.getBoundingClientRect();if(df||Ai(),!mf||!gf)return;const yf=ir$1(pf),vf=ir$1(pc.clientWidth-(hf+mf)),bf=ir$1(pc.clientHeight-(pf+gf)),Sf=ir$1(hf),xf={rootMargin:-yf+"px "+-vf+"px "+-bf+"px "+-Sf+"px",threshold:Xe$2(0,Vt$1(1,ff))||1};let wf=!0;function If(l1){const s1=l1[0].intersectionRatio;if(s1!==ff){if(!wf)return uf();s1?uf(!1,s1):Ra=setTimeout(()=>{uf(!1,1e-7)},1e3)}wf=!1}try{bo=new IntersectionObserver(If,{...xf,root:pc.ownerDocument})}catch{bo=new IntersectionObserver(If,xf)}bo.observe(vo)}return uf(!0),mc}function cl(vo,Ai,bo,Ra){Ra===void 0&&(Ra={});const{ancestorScroll:pc=!0,ancestorResize:mc=!0,elementResize:uf=typeof ResizeObserver=="function",layoutShift:df=typeof IntersectionObserver=="function",animationFrame:ff=!1}=Ra,hf=Ka$1(vo),pf=pc||mc?[...hf?Hn$2(hf):[],...Hn$2(Ai)]:[];pf.forEach(xf=>{pc&&xf.addEventListener("scroll",bo,{passive:!0}),mc&&xf.addEventListener("resize",bo)});const mf=hf&&df?Mh(hf,bo):null;let gf=-1,yf=null;uf&&(yf=new ResizeObserver(xf=>{let[wf]=xf;wf&&wf.target===hf&&yf&&(yf.unobserve(Ai),cancelAnimationFrame(gf),gf=requestAnimationFrame(()=>{var If;(If=yf)==null||If.observe(Ai)})),bo()}),hf&&!ff&&yf.observe(hf),yf.observe(Ai));let vf,bf=ff?qt$1(vo):null;ff&&Sf();function Sf(){const xf=qt$1(vo);bf&&(xf.x!==bf.x||xf.y!==bf.y||xf.width!==bf.width||xf.height!==bf.height)&&bo(),bf=xf,vf=requestAnimationFrame(Sf)}return bo(),()=>{var xf;pf.forEach(wf=>{pc&&wf.removeEventListener("scroll",bo),mc&&wf.removeEventListener("resize",bo)}),mf==null||mf(),(xf=yf)==null||xf.disconnect(),yf=null,ff&&cancelAnimationFrame(vf)}}const Nh=lh,Ah=uh,Dh=ih,Rh=fh,_h=sh,cs=ah,kh=dh,Fh=(vo,Ai,bo)=>{const Ra=new Map,pc={platform:Oh,...bo},mc={...pc.platform,_c:Ra};return oh(vo,Ai,{...pc,platform:mc})};var xa=useLayoutEffect,Vh=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],_r$2=function(){};function Lh(vo,Ai){return Ai?Ai[0]==="-"?vo+Ai:vo+"__"+Ai:vo}function $h(vo,Ai){for(var bo=arguments.length,Ra=new Array(bo>2?bo-2:0),pc=2;pc<bo;pc++)Ra[pc-2]=arguments[pc];var mc=[].concat(Ra);if(Ai&&vo)for(var uf in Ai)Ai.hasOwnProperty(uf)&&Ai[uf]&&mc.push("".concat(Lh(vo,uf)));return mc.filter(function(df){return df}).map(function(df){return String(df).trim()}).join(" ")}var ls$1=function(vo){return qh(vo)?vo.filter(Boolean):Ci$1(vo)==="object"&&vo!==null?[vo]:[]},ll=function(vo){vo.className,vo.clearValue,vo.cx,vo.getStyles,vo.getClassNames,vo.getValue,vo.hasValue,vo.isMulti,vo.isRtl,vo.options,vo.selectOption,vo.selectProps,vo.setValue,vo.theme;var Ai=Et$2(vo,Vh);return te$2({},Ai)},Ee$2=function(vo,Ai,bo){var Ra=vo.cx,pc=vo.getStyles,mc=vo.getClassNames,uf=vo.className;return{css:pc(Ai,vo),className:Ra(bo??{},mc(Ai,vo),uf)}};function no$1(vo){return[document.documentElement,document.body,window].indexOf(vo)>-1}function Uh(vo){return no$1(vo)?window.innerHeight:vo.clientHeight}function ul(vo){return no$1(vo)?window.pageYOffset:vo.scrollTop}function kr$2(vo,Ai){if(no$1(vo)){window.scrollTo(0,Ai);return}vo.scrollTop=Ai}function Hh(vo){var Ai=getComputedStyle(vo),bo=Ai.position==="absolute",Ra=/(auto|scroll)/;if(Ai.position==="fixed")return document.documentElement;for(var pc=vo;pc=pc.parentElement;)if(Ai=getComputedStyle(pc),!(bo&&Ai.position==="static")&&Ra.test(Ai.overflow+Ai.overflowY+Ai.overflowX))return pc;return document.documentElement}function Wh(vo,Ai,bo,Ra){return bo*((vo=vo/Ra-1)*vo*vo+1)+Ai}function sr$1(vo,Ai){var bo=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,Ra=arguments.length>3&&arguments[3]!==void 0?arguments[3]:_r$2,pc=ul(vo),mc=Ai-pc,uf=10,df=0;function ff(){df+=uf;var hf=Wh(df,pc,mc,bo);kr$2(vo,hf),df<bo?window.requestAnimationFrame(ff):Ra(vo)}ff()}function us(vo,Ai){var bo=vo.getBoundingClientRect(),Ra=Ai.getBoundingClientRect(),pc=Ai.offsetHeight/3;Ra.bottom+pc>bo.bottom?kr$2(vo,Math.min(Ai.offsetTop+Ai.clientHeight-vo.offsetHeight+pc,vo.scrollHeight)):Ra.top-pc<bo.top&&kr$2(vo,Math.max(Ai.offsetTop-pc,0))}function Bh(vo){var Ai=vo.getBoundingClientRect();return{bottom:Ai.bottom,height:Ai.height,left:Ai.left,right:Ai.right,top:Ai.top,width:Ai.width}}function ds(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function zh(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var dl=!1,jh={get passive(){return dl=!0}},cr$1=typeof window<"u"?window:{};cr$1.addEventListener&&cr$1.removeEventListener&&(cr$1.addEventListener("p",_r$2,jh),cr$1.removeEventListener("p",_r$2,!1));var Yh=dl;function Gh(vo){return vo!=null}function qh(vo){return Array.isArray(vo)}function lr$1(vo,Ai,bo){return vo?Ai:bo}var Xh=function(vo){for(var Ai=arguments.length,bo=new Array(Ai>1?Ai-1:0),Ra=1;Ra<Ai;Ra++)bo[Ra-1]=arguments[Ra];var pc=Object.entries(vo).filter(function(mc){var uf=St$1(mc,1),df=uf[0];return!bo.includes(df)});return pc.reduce(function(mc,uf){var df=St$1(uf,2),ff=df[0],hf=df[1];return mc[ff]=hf,mc},{})},Kh=["children","innerProps"],Zh=["children","innerProps"];function Qh(vo){var Ai=vo.maxHeight,bo=vo.menuEl,Ra=vo.minHeight,pc=vo.placement,mc=vo.shouldScroll,uf=vo.isFixedPosition,df=vo.controlHeight,ff=Hh(bo),hf={placement:"bottom",maxHeight:Ai};if(!bo||!bo.offsetParent)return hf;var pf=ff.getBoundingClientRect(),mf=pf.height,gf=bo.getBoundingClientRect(),yf=gf.bottom,vf=gf.height,bf=gf.top,Sf=bo.offsetParent.getBoundingClientRect(),xf=Sf.top,wf=uf?window.innerHeight:Uh(ff),If=ul(ff),l1=parseInt(getComputedStyle(bo).marginBottom,10),s1=parseInt(getComputedStyle(bo).marginTop,10),c1=xf-s1,u1=wf-bf,T1=c1+If,_1=mf-If-bf,R1=yf-wf+If+l1,P1=If+bf-s1,E1=160;switch(pc){case"auto":case"bottom":if(u1>=vf)return{placement:"bottom",maxHeight:Ai};if(_1>=vf&&!uf)return mc&&sr$1(ff,R1,E1),{placement:"bottom",maxHeight:Ai};if(!uf&&_1>=Ra||uf&&u1>=Ra){mc&&sr$1(ff,R1,E1);var M1=uf?u1-l1:_1-l1;return{placement:"bottom",maxHeight:M1}}if(pc==="auto"||uf){var m1=Ai,$1=uf?c1:T1;return $1>=Ra&&(m1=Math.min($1-l1-df,Ai)),{placement:"top",maxHeight:m1}}if(pc==="bottom")return mc&&kr$2(ff,R1),{placement:"bottom",maxHeight:Ai};break;case"top":if(c1>=vf)return{placement:"top",maxHeight:Ai};if(T1>=vf&&!uf)return mc&&sr$1(ff,P1,E1),{placement:"top",maxHeight:Ai};if(!uf&&T1>=Ra||uf&&c1>=Ra){var k1=Ai;return(!uf&&T1>=Ra||uf&&c1>=Ra)&&(k1=uf?c1-s1:T1-s1),mc&&sr$1(ff,P1,E1),{placement:"top",maxHeight:k1}}return{placement:"bottom",maxHeight:Ai};default:throw new Error('Invalid placement provided "'.concat(pc,'".'))}return hf}function Jh(vo){var Ai={bottom:"top",top:"bottom"};return vo?Ai[vo]:"bottom"}var fl=function(vo){return vo==="auto"?"bottom":vo},eg=function(vo,Ai){var bo,Ra=vo.placement,pc=vo.theme,mc=pc.borderRadius,uf=pc.spacing,df=pc.colors;return te$2((bo={label:"menu"},Ir$3(bo,Jh(Ra),"100%"),Ir$3(bo,"position","absolute"),Ir$3(bo,"width","100%"),Ir$3(bo,"zIndex",1),bo),Ai?{}:{backgroundColor:df.neutral0,borderRadius:mc,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:uf.menuGutter,marginTop:uf.menuGutter})},ml=createContext(null),tg=function(vo){var Ai=vo.children,bo=vo.minMenuHeight,Ra=vo.maxMenuHeight,pc=vo.menuPlacement,mc=vo.menuPosition,uf=vo.menuShouldScrollIntoView,df=vo.theme,ff=useContext(ml)||{},hf=ff.setPortalPlacement,pf=useRef(null),mf=useState(Ra),gf=St$1(mf,2),yf=gf[0],vf=gf[1],bf=useState(null),Sf=St$1(bf,2),xf=Sf[0],wf=Sf[1],If=df.spacing.controlHeight;return xa(function(){var l1=pf.current;if(l1){var s1=mc==="fixed",c1=uf&&!s1,u1=Qh({maxHeight:Ra,menuEl:l1,minHeight:bo,placement:pc,shouldScroll:c1,isFixedPosition:s1,controlHeight:If});vf(u1.maxHeight),wf(u1.placement),hf==null||hf(u1.placement)}},[Ra,pc,mc,uf,bo,hf,If]),Ai({ref:pf,placerProps:te$2(te$2({},vo),{},{placement:xf||fl(pc),maxHeight:yf})})},ng=function(vo){var Ai=vo.children,bo=vo.innerRef,Ra=vo.innerProps;return Q$1("div",Hr$3({},Ee$2(vo,"menu",{menu:!0}),{ref:bo},Ra),Ai)},rg=ng,og=function(vo,Ai){var bo=vo.maxHeight,Ra=vo.theme.spacing.baseUnit;return te$2({maxHeight:bo,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},Ai?{}:{paddingBottom:Ra,paddingTop:Ra})},ag=function(vo){var Ai=vo.children,bo=vo.innerProps,Ra=vo.innerRef,pc=vo.isMulti;return Q$1("div",Hr$3({},Ee$2(vo,"menuList",{"menu-list":!0,"menu-list--is-multi":pc}),{ref:Ra},bo),Ai)},pl=function(vo,Ai){var bo=vo.theme,Ra=bo.spacing.baseUnit,pc=bo.colors;return te$2({textAlign:"center"},Ai?{}:{color:pc.neutral40,padding:"".concat(Ra*2,"px ").concat(Ra*3,"px")})},ig=pl,sg=pl,cg=function(vo){var Ai=vo.children,bo=Ai===void 0?"No options":Ai,Ra=vo.innerProps,pc=Et$2(vo,Kh);return Q$1("div",Hr$3({},Ee$2(te$2(te$2({},pc),{},{children:bo,innerProps:Ra}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),Ra),bo)},lg=function(vo){var Ai=vo.children,bo=Ai===void 0?"Loading...":Ai,Ra=vo.innerProps,pc=Et$2(vo,Zh);return Q$1("div",Hr$3({},Ee$2(te$2(te$2({},pc),{},{children:bo,innerProps:Ra}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),Ra),bo)},ug=function(vo){var Ai=vo.rect,bo=vo.offset,Ra=vo.position;return{left:Ai.left,position:Ra,top:bo,width:Ai.width,zIndex:1}},dg=function(vo){var Ai=vo.appendTo,bo=vo.children,Ra=vo.controlElement,pc=vo.innerProps,mc=vo.menuPlacement,uf=vo.menuPosition,df=useRef(null),ff=useRef(null),hf=useState(fl(mc)),pf=St$1(hf,2),mf=pf[0],gf=pf[1],yf=useMemo(function(){return{setPortalPlacement:gf}},[]),vf=useState(null),bf=St$1(vf,2),Sf=bf[0],xf=bf[1],wf=useCallback(function(){if(Ra){var c1=Bh(Ra),u1=uf==="fixed"?0:window.pageYOffset,T1=c1[mf]+u1;(T1!==(Sf==null?void 0:Sf.offset)||c1.left!==(Sf==null?void 0:Sf.rect.left)||c1.width!==(Sf==null?void 0:Sf.rect.width))&&xf({offset:T1,rect:c1})}},[Ra,uf,mf,Sf==null?void 0:Sf.offset,Sf==null?void 0:Sf.rect.left,Sf==null?void 0:Sf.rect.width]);xa(function(){wf()},[wf]);var If=useCallback(function(){typeof ff.current=="function"&&(ff.current(),ff.current=null),Ra&&df.current&&(ff.current=cl(Ra,df.current,wf,{elementResize:"ResizeObserver"in window}))},[Ra,wf]);xa(function(){If()},[If]);var l1=useCallback(function(c1){df.current=c1,If()},[If]);if(!Ai&&uf!=="fixed"||!Sf)return null;var s1=Q$1("div",Hr$3({ref:l1},Ee$2(te$2(te$2({},vo),{},{offset:Sf.offset,position:uf,rect:Sf.rect}),"menuPortal",{"menu-portal":!0}),pc),bo);return Q$1(ml.Provider,{value:yf},Ai?createPortal(s1,Ai):s1)},fg=function(vo){var Ai=vo.isDisabled,bo=vo.isRtl;return{label:"container",direction:bo?"rtl":void 0,pointerEvents:Ai?"none":void 0,position:"relative"}},mg=function(vo){var Ai=vo.children,bo=vo.innerProps,Ra=vo.isDisabled,pc=vo.isRtl;return Q$1("div",Hr$3({},Ee$2(vo,"container",{"--is-disabled":Ra,"--is-rtl":pc}),bo),Ai)},pg=function(vo,Ai){var bo=vo.theme.spacing,Ra=vo.isMulti,pc=vo.hasValue,mc=vo.selectProps.controlShouldRenderValue;return te$2({alignItems:"center",display:Ra&&pc&&mc?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},Ai?{}:{padding:"".concat(bo.baseUnit/2,"px ").concat(bo.baseUnit*2,"px")})},hg=function(vo){var Ai=vo.children,bo=vo.innerProps,Ra=vo.isMulti,pc=vo.hasValue;return Q$1("div",Hr$3({},Ee$2(vo,"valueContainer",{"value-container":!0,"value-container--is-multi":Ra,"value-container--has-value":pc}),bo),Ai)},gg=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},vg=function(vo){var Ai=vo.children,bo=vo.innerProps;return Q$1("div",Hr$3({},Ee$2(vo,"indicatorsContainer",{indicators:!0}),bo),Ai)},fs$1,bg=["size"],yg=["innerProps","isRtl","size"],wg={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},hl=function(vo){var Ai=vo.size,bo=Et$2(vo,bg);return Q$1("svg",Hr$3({height:Ai,width:Ai,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:wg},bo))},Qa=function(vo){return Q$1(hl,Hr$3({size:20},vo),Q$1("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},gl=function(vo){return Q$1(hl,Hr$3({size:20},vo),Q$1("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},vl=function(vo,Ai){var bo=vo.isFocused,Ra=vo.theme,pc=Ra.spacing.baseUnit,mc=Ra.colors;return te$2({label:"indicatorContainer",display:"flex",transition:"color 150ms"},Ai?{}:{color:bo?mc.neutral60:mc.neutral20,padding:pc*2,":hover":{color:bo?mc.neutral80:mc.neutral40}})},xg=vl,Sg=function(vo){var Ai=vo.children,bo=vo.innerProps;return Q$1("div",Hr$3({},Ee$2(vo,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),bo),Ai||Q$1(gl,null))},Cg=vl,Ig=function(vo){var Ai=vo.children,bo=vo.innerProps;return Q$1("div",Hr$3({},Ee$2(vo,"clearIndicator",{indicator:!0,"clear-indicator":!0}),bo),Ai||Q$1(Qa,null))},Eg=function(vo,Ai){var bo=vo.isDisabled,Ra=vo.theme,pc=Ra.spacing.baseUnit,mc=Ra.colors;return te$2({label:"indicatorSeparator",alignSelf:"stretch",width:1},Ai?{}:{backgroundColor:bo?mc.neutral10:mc.neutral20,marginBottom:pc*2,marginTop:pc*2})},Pg=function(vo){var Ai=vo.innerProps;return Q$1("span",Hr$3({},Ai,Ee$2(vo,"indicatorSeparator",{"indicator-separator":!0})))},Tg=qp(fs$1||(fs$1=Xp([`
|
|
12
|
-
0%, 80%, 100% { opacity: 0; }
|
|
13
|
-
40% { opacity: 1; }
|
|
14
|
-
`]))),Og=function(vo,Ai){var bo=vo.isFocused,Ra=vo.size,pc=vo.theme,mc=pc.colors,uf=pc.spacing.baseUnit;return te$2({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:Ra,lineHeight:1,marginRight:Ra,textAlign:"center",verticalAlign:"middle"},Ai?{}:{color:bo?mc.neutral60:mc.neutral20,padding:uf*2})},Fo$1=function(vo){var Ai=vo.delay,bo=vo.offset;return Q$1("span",{css:za({animation:"".concat(Tg," 1s ease-in-out ").concat(Ai,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:bo?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},Mg=function(vo){var Ai=vo.innerProps,bo=vo.isRtl,Ra=vo.size,pc=Ra===void 0?4:Ra,mc=Et$2(vo,yg);return Q$1("div",Hr$3({},Ee$2(te$2(te$2({},mc),{},{innerProps:Ai,isRtl:bo,size:pc}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),Ai),Q$1(Fo$1,{delay:0,offset:bo}),Q$1(Fo$1,{delay:160,offset:!0}),Q$1(Fo$1,{delay:320,offset:!bo}))},Ng=function(vo,Ai){var bo=vo.isDisabled,Ra=vo.isFocused,pc=vo.theme,mc=pc.colors,uf=pc.borderRadius,df=pc.spacing;return te$2({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:df.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},Ai?{}:{backgroundColor:bo?mc.neutral5:mc.neutral0,borderColor:bo?mc.neutral10:Ra?mc.primary:mc.neutral20,borderRadius:uf,borderStyle:"solid",borderWidth:1,boxShadow:Ra?"0 0 0 1px ".concat(mc.primary):void 0,"&:hover":{borderColor:Ra?mc.primary:mc.neutral30}})},Ag=function(vo){var Ai=vo.children,bo=vo.isDisabled,Ra=vo.isFocused,pc=vo.innerRef,mc=vo.innerProps,uf=vo.menuIsOpen;return Q$1("div",Hr$3({ref:pc},Ee$2(vo,"control",{control:!0,"control--is-disabled":bo,"control--is-focused":Ra,"control--menu-is-open":uf}),mc,{"aria-disabled":bo||void 0}),Ai)},Dg=Ag,Rg=["data"],_g=function(vo,Ai){var bo=vo.theme.spacing;return Ai?{}:{paddingBottom:bo.baseUnit*2,paddingTop:bo.baseUnit*2}},kg=function(vo){var Ai=vo.children,bo=vo.cx,Ra=vo.getStyles,pc=vo.getClassNames,mc=vo.Heading,uf=vo.headingProps,df=vo.innerProps,ff=vo.label,hf=vo.theme,pf=vo.selectProps;return Q$1("div",Hr$3({},Ee$2(vo,"group",{group:!0}),df),Q$1(mc,Hr$3({},uf,{selectProps:pf,theme:hf,getStyles:Ra,getClassNames:pc,cx:bo}),ff),Q$1("div",null,Ai))},Fg=function(vo,Ai){var bo=vo.theme,Ra=bo.colors,pc=bo.spacing;return te$2({label:"group",cursor:"default",display:"block"},Ai?{}:{color:Ra.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:pc.baseUnit*3,paddingRight:pc.baseUnit*3,textTransform:"uppercase"})},Vg=function(vo){var Ai=ll(vo);Ai.data;var bo=Et$2(Ai,Rg);return Q$1("div",Hr$3({},Ee$2(vo,"groupHeading",{"group-heading":!0}),bo))},Lg=kg,$g=["innerRef","isDisabled","isHidden","inputClassName"],Ug=function(vo,Ai){var bo=vo.isDisabled,Ra=vo.value,pc=vo.theme,mc=pc.spacing,uf=pc.colors;return te$2(te$2({visibility:bo?"hidden":"visible",transform:Ra?"translateZ(0)":""},Hg),Ai?{}:{margin:mc.baseUnit/2,paddingBottom:mc.baseUnit/2,paddingTop:mc.baseUnit/2,color:uf.neutral80})},bl={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},Hg={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":te$2({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},bl)},Wg=function(vo){return te$2({label:"input",color:"inherit",background:0,opacity:vo?0:1,width:"100%"},bl)},Bg=function(vo){var Ai=vo.cx,bo=vo.value,Ra=ll(vo),pc=Ra.innerRef,mc=Ra.isDisabled,uf=Ra.isHidden,df=Ra.inputClassName,ff=Et$2(Ra,$g);return Q$1("div",Hr$3({},Ee$2(vo,"input",{"input-container":!0}),{"data-value":bo||""}),Q$1("input",Hr$3({className:Ai({input:!0},df),ref:pc,style:Wg(uf),disabled:mc},ff)))},zg=Bg,jg=function(vo,Ai){var bo=vo.theme,Ra=bo.spacing,pc=bo.borderRadius,mc=bo.colors;return te$2({label:"multiValue",display:"flex",minWidth:0},Ai?{}:{backgroundColor:mc.neutral10,borderRadius:pc/2,margin:Ra.baseUnit/2})},Yg=function(vo,Ai){var bo=vo.theme,Ra=bo.borderRadius,pc=bo.colors,mc=vo.cropWithEllipsis;return te$2({overflow:"hidden",textOverflow:mc||mc===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},Ai?{}:{borderRadius:Ra/2,color:pc.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},Gg=function(vo,Ai){var bo=vo.theme,Ra=bo.spacing,pc=bo.borderRadius,mc=bo.colors,uf=vo.isFocused;return te$2({alignItems:"center",display:"flex"},Ai?{}:{borderRadius:pc/2,backgroundColor:uf?mc.dangerLight:void 0,paddingLeft:Ra.baseUnit,paddingRight:Ra.baseUnit,":hover":{backgroundColor:mc.dangerLight,color:mc.danger}})},yl=function(vo){var Ai=vo.children,bo=vo.innerProps;return Q$1("div",bo,Ai)},qg=yl,Xg=yl;function Kg(vo){var Ai=vo.children,bo=vo.innerProps;return Q$1("div",Hr$3({role:"button"},bo),Ai||Q$1(Qa,{size:14}))}var Zg=function(vo){var Ai=vo.children,bo=vo.components,Ra=vo.data,pc=vo.innerProps,mc=vo.isDisabled,uf=vo.removeProps,df=vo.selectProps,ff=bo.Container,hf=bo.Label,pf=bo.Remove;return Q$1(ff,{data:Ra,innerProps:te$2(te$2({},Ee$2(vo,"multiValue",{"multi-value":!0,"multi-value--is-disabled":mc})),pc),selectProps:df},Q$1(hf,{data:Ra,innerProps:te$2({},Ee$2(vo,"multiValueLabel",{"multi-value__label":!0})),selectProps:df},Ai),Q$1(pf,{data:Ra,innerProps:te$2(te$2({},Ee$2(vo,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(Ai||"option")},uf),selectProps:df}))},Qg=Zg,Jg=function(vo,Ai){var bo=vo.isDisabled,Ra=vo.isFocused,pc=vo.isSelected,mc=vo.theme,uf=mc.spacing,df=mc.colors;return te$2({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},Ai?{}:{backgroundColor:pc?df.primary:Ra?df.primary25:"transparent",color:bo?df.neutral20:pc?df.neutral0:"inherit",padding:"".concat(uf.baseUnit*2,"px ").concat(uf.baseUnit*3,"px"),":active":{backgroundColor:bo?void 0:pc?df.primary:df.primary50}})},ev=function(vo){var Ai=vo.children,bo=vo.isDisabled,Ra=vo.isFocused,pc=vo.isSelected,mc=vo.innerRef,uf=vo.innerProps;return Q$1("div",Hr$3({},Ee$2(vo,"option",{option:!0,"option--is-disabled":bo,"option--is-focused":Ra,"option--is-selected":pc}),{ref:mc,"aria-disabled":bo},uf),Ai)},tv=ev,nv=function(vo,Ai){var bo=vo.theme,Ra=bo.spacing,pc=bo.colors;return te$2({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},Ai?{}:{color:pc.neutral50,marginLeft:Ra.baseUnit/2,marginRight:Ra.baseUnit/2})},rv=function(vo){var Ai=vo.children,bo=vo.innerProps;return Q$1("div",Hr$3({},Ee$2(vo,"placeholder",{placeholder:!0}),bo),Ai)},ov=rv,av=function(vo,Ai){var bo=vo.isDisabled,Ra=vo.theme,pc=Ra.spacing,mc=Ra.colors;return te$2({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},Ai?{}:{color:bo?mc.neutral40:mc.neutral80,marginLeft:pc.baseUnit/2,marginRight:pc.baseUnit/2})},iv=function(vo){var Ai=vo.children,bo=vo.isDisabled,Ra=vo.innerProps;return Q$1("div",Hr$3({},Ee$2(vo,"singleValue",{"single-value":!0,"single-value--is-disabled":bo}),Ra),Ai)},sv=iv,ro$1={ClearIndicator:Ig,Control:Dg,DropdownIndicator:Sg,DownChevron:gl,CrossIcon:Qa,Group:Lg,GroupHeading:Vg,IndicatorsContainer:vg,IndicatorSeparator:Pg,Input:zg,LoadingIndicator:Mg,Menu:rg,MenuList:ag,MenuPortal:dg,LoadingMessage:lg,NoOptionsMessage:cg,MultiValue:Qg,MultiValueContainer:qg,MultiValueLabel:Xg,MultiValueRemove:Kg,Option:tv,Placeholder:ov,SelectContainer:mg,SingleValue:sv,ValueContainer:hg},cv=function(vo){return te$2(te$2({},ro$1),vo.components)},ms=Number.isNaN||function(vo){return typeof vo=="number"&&vo!==vo};function lv(vo,Ai){return!!(vo===Ai||ms(vo)&&ms(Ai))}function uv(vo,Ai){if(vo.length!==Ai.length)return!1;for(var bo=0;bo<vo.length;bo++)if(!lv(vo[bo],Ai[bo]))return!1;return!0}function dv(vo,Ai){Ai===void 0&&(Ai=uv);var bo=null;function Ra(){for(var pc=[],mc=0;mc<arguments.length;mc++)pc[mc]=arguments[mc];if(bo&&bo.lastThis===this&&Ai(pc,bo.lastArgs))return bo.lastResult;var uf=vo.apply(this,pc);return bo={lastResult:uf,lastArgs:pc,lastThis:this},uf}return Ra.clear=function(){bo=null},Ra}var fv={name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"},mv=function(vo){return Q$1("span",Hr$3({css:fv},vo))},ps=mv,pv={guidance:function(vo){var Ai=vo.isSearchable,bo=vo.isMulti,Ra=vo.tabSelectsValue,pc=vo.context,mc=vo.isInitialFocus;switch(pc){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(Ra?", press Tab to select the option and exit the menu":"",".");case"input":return mc?"".concat(vo["aria-label"]||"Select"," is focused ").concat(Ai?",type to refine list":"",", press Down to open the menu, ").concat(bo?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(vo){var Ai=vo.action,bo=vo.label,Ra=bo===void 0?"":bo,pc=vo.labels,mc=vo.isDisabled;switch(Ai){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(Ra,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(pc.length>1?"s":""," ").concat(pc.join(","),", selected.");case"select-option":return mc?"option ".concat(Ra," is disabled. Select another option."):"option ".concat(Ra,", selected.");default:return""}},onFocus:function(vo){var Ai=vo.context,bo=vo.focused,Ra=vo.options,pc=vo.label,mc=pc===void 0?"":pc,uf=vo.selectValue,df=vo.isDisabled,ff=vo.isSelected,hf=vo.isAppleDevice,pf=function(yf,vf){return yf&&yf.length?"".concat(yf.indexOf(vf)+1," of ").concat(yf.length):""};if(Ai==="value"&&uf)return"value ".concat(mc," focused, ").concat(pf(uf,bo),".");if(Ai==="menu"&&hf){var mf=df?" disabled":"",gf="".concat(ff?" selected":"").concat(mf);return"".concat(mc).concat(gf,", ").concat(pf(Ra,bo),".")}return""},onFilter:function(vo){var Ai=vo.inputValue,bo=vo.resultsMessage;return"".concat(bo).concat(Ai?" for search term "+Ai:"",".")}},hv=function(vo){var Ai=vo.ariaSelection,bo=vo.focusedOption,Ra=vo.focusedValue,pc=vo.focusableOptions,mc=vo.isFocused,uf=vo.selectValue,df=vo.selectProps,ff=vo.id,hf=vo.isAppleDevice,pf=df.ariaLiveMessages,mf=df.getOptionLabel,gf=df.inputValue,yf=df.isMulti,vf=df.isOptionDisabled,bf=df.isSearchable,Sf=df.menuIsOpen,xf=df.options,wf=df.screenReaderStatus,If=df.tabSelectsValue,l1=df.isLoading,s1=df["aria-label"],c1=df["aria-live"],u1=useMemo(function(){return te$2(te$2({},pv),pf||{})},[pf]),T1=useMemo(function(){var m1="";if(Ai&&u1.onChange){var $1=Ai.option,k1=Ai.options,F1=Ai.removedValue,U1=Ai.removedValues,B1=Ai.value,W1=function(Y1){return Array.isArray(Y1)?null:Y1},Z1=F1||$1||W1(B1),O1=Z1?mf(Z1):"",j1=k1||U1||void 0,L1=j1?j1.map(mf):[],G1=te$2({isDisabled:Z1&&vf(Z1,uf),label:O1,labels:L1},Ai);m1=u1.onChange(G1)}return m1},[Ai,u1,vf,uf,mf]),_1=useMemo(function(){var m1="",$1=bo||Ra,k1=!!(bo&&uf&&uf.includes(bo));if($1&&u1.onFocus){var F1={focused:$1,label:mf($1),isDisabled:vf($1,uf),isSelected:k1,options:pc,context:$1===bo?"menu":"value",selectValue:uf,isAppleDevice:hf};m1=u1.onFocus(F1)}return m1},[bo,Ra,mf,vf,u1,pc,uf,hf]),R1=useMemo(function(){var m1="";if(Sf&&xf.length&&!l1&&u1.onFilter){var $1=wf({count:pc.length});m1=u1.onFilter({inputValue:gf,resultsMessage:$1})}return m1},[pc,gf,Sf,u1,xf,wf,l1]),P1=(Ai==null?void 0:Ai.action)==="initial-input-focus",E1=useMemo(function(){var m1="";if(u1.guidance){var $1=Ra?"value":Sf?"menu":"input";m1=u1.guidance({"aria-label":s1,context:$1,isDisabled:bo&&vf(bo,uf),isMulti:yf,isSearchable:bf,tabSelectsValue:If,isInitialFocus:P1})}return m1},[s1,bo,Ra,yf,vf,bf,Sf,u1,uf,If,P1]),M1=Q$1(Fragment$1,null,Q$1("span",{id:"aria-selection"},T1),Q$1("span",{id:"aria-focused"},_1),Q$1("span",{id:"aria-results"},R1),Q$1("span",{id:"aria-guidance"},E1));return Q$1(Fragment$1,null,Q$1(ps,{id:ff},P1&&M1),Q$1(ps,{"aria-live":c1,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},mc&&!P1&&M1))},gv=hv,Sa=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],vv=new RegExp("["+Sa.map(function(vo){return vo.letters}).join("")+"]","g"),wl={};for(var Vo$1=0;Vo$1<Sa.length;Vo$1++)for(var Lo=Sa[Vo$1],$o$2=0;$o$2<Lo.letters.length;$o$2++)wl[Lo.letters[$o$2]]=Lo.base;var xl=function(vo){return vo.replace(vv,function(Ai){return wl[Ai]})},bv=dv(xl),hs$1=function(vo){return vo.replace(/^\s+|\s+$/g,"")},yv=function(vo){return"".concat(vo.label," ").concat(vo.value)},wv=function(vo){return function(Ai,bo){if(Ai.data.__isNew__)return!0;var Ra=te$2({ignoreCase:!0,ignoreAccents:!0,stringify:yv,trim:!0,matchFrom:"any"},vo),pc=Ra.ignoreCase,mc=Ra.ignoreAccents,uf=Ra.stringify,df=Ra.trim,ff=Ra.matchFrom,hf=df?hs$1(bo):bo,pf=df?hs$1(uf(Ai)):uf(Ai);return pc&&(hf=hf.toLowerCase(),pf=pf.toLowerCase()),mc&&(hf=bv(hf),pf=xl(pf)),ff==="start"?pf.substr(0,hf.length)===hf:pf.indexOf(hf)>-1}},xv=["innerRef"];function Sv(vo){var Ai=vo.innerRef,bo=Et$2(vo,xv),Ra=Xh(bo,"onExited","in","enter","exit","appear");return Q$1("input",Hr$3({ref:Ai},Ra,{css:za({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var Cv=function(vo){vo.cancelable&&vo.preventDefault(),vo.stopPropagation()};function Iv(vo){var Ai=vo.isEnabled,bo=vo.onBottomArrive,Ra=vo.onBottomLeave,pc=vo.onTopArrive,mc=vo.onTopLeave,uf=useRef(!1),df=useRef(!1),ff=useRef(0),hf=useRef(null),pf=useCallback(function(Sf,xf){if(hf.current!==null){var wf=hf.current,If=wf.scrollTop,l1=wf.scrollHeight,s1=wf.clientHeight,c1=hf.current,u1=xf>0,T1=l1-s1-If,_1=!1;T1>xf&&uf.current&&(Ra&&Ra(Sf),uf.current=!1),u1&&df.current&&(mc&&mc(Sf),df.current=!1),u1&&xf>T1?(bo&&!uf.current&&bo(Sf),c1.scrollTop=l1,_1=!0,uf.current=!0):!u1&&-xf>If&&(pc&&!df.current&&pc(Sf),c1.scrollTop=0,_1=!0,df.current=!0),_1&&Cv(Sf)}},[bo,Ra,pc,mc]),mf=useCallback(function(Sf){pf(Sf,Sf.deltaY)},[pf]),gf=useCallback(function(Sf){ff.current=Sf.changedTouches[0].clientY},[]),yf=useCallback(function(Sf){var xf=ff.current-Sf.changedTouches[0].clientY;pf(Sf,xf)},[pf]),vf=useCallback(function(Sf){if(Sf){var xf=Yh?{passive:!1}:!1;Sf.addEventListener("wheel",mf,xf),Sf.addEventListener("touchstart",gf,xf),Sf.addEventListener("touchmove",yf,xf)}},[yf,gf,mf]),bf=useCallback(function(Sf){Sf&&(Sf.removeEventListener("wheel",mf,!1),Sf.removeEventListener("touchstart",gf,!1),Sf.removeEventListener("touchmove",yf,!1))},[yf,gf,mf]);return useEffect(function(){if(Ai){var Sf=hf.current;return vf(Sf),function(){bf(Sf)}}},[Ai,vf,bf]),function(Sf){hf.current=Sf}}var gs$1=["boxSizing","height","overflow","paddingRight","position"],vs={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function bs$1(vo){vo.cancelable&&vo.preventDefault()}function ys(vo){vo.stopPropagation()}function ws(){var vo=this.scrollTop,Ai=this.scrollHeight,bo=vo+this.offsetHeight;vo===0?this.scrollTop=1:bo===Ai&&(this.scrollTop=vo-1)}function xs(){return"ontouchstart"in window||navigator.maxTouchPoints}var Ss=!!(typeof window<"u"&&window.document&&window.document.createElement),On$2=0,en$1={capture:!1,passive:!1};function Ev(vo){var Ai=vo.isEnabled,bo=vo.accountForScrollbars,Ra=bo===void 0?!0:bo,pc=useRef({}),mc=useRef(null),uf=useCallback(function(ff){if(Ss){var hf=document.body,pf=hf&&hf.style;if(Ra&&gs$1.forEach(function(vf){var bf=pf&&pf[vf];pc.current[vf]=bf}),Ra&&On$2<1){var mf=parseInt(pc.current.paddingRight,10)||0,gf=document.body?document.body.clientWidth:0,yf=window.innerWidth-gf+mf||0;Object.keys(vs).forEach(function(vf){var bf=vs[vf];pf&&(pf[vf]=bf)}),pf&&(pf.paddingRight="".concat(yf,"px"))}hf&&xs()&&(hf.addEventListener("touchmove",bs$1,en$1),ff&&(ff.addEventListener("touchstart",ws,en$1),ff.addEventListener("touchmove",ys,en$1))),On$2+=1}},[Ra]),df=useCallback(function(ff){if(Ss){var hf=document.body,pf=hf&&hf.style;On$2=Math.max(On$2-1,0),Ra&&On$2<1&&gs$1.forEach(function(mf){var gf=pc.current[mf];pf&&(pf[mf]=gf)}),hf&&xs()&&(hf.removeEventListener("touchmove",bs$1,en$1),ff&&(ff.removeEventListener("touchstart",ws,en$1),ff.removeEventListener("touchmove",ys,en$1)))}},[Ra]);return useEffect(function(){if(Ai){var ff=mc.current;return uf(ff),function(){df(ff)}}},[Ai,uf,df]),function(ff){mc.current=ff}}var Pv=function(vo){var Ai=vo.target;return Ai.ownerDocument.activeElement&&Ai.ownerDocument.activeElement.blur()},Tv={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function Ov(vo){var Ai=vo.children,bo=vo.lockEnabled,Ra=vo.captureEnabled,pc=Ra===void 0?!0:Ra,mc=vo.onBottomArrive,uf=vo.onBottomLeave,df=vo.onTopArrive,ff=vo.onTopLeave,hf=Iv({isEnabled:pc,onBottomArrive:mc,onBottomLeave:uf,onTopArrive:df,onTopLeave:ff}),pf=Ev({isEnabled:bo}),mf=function(gf){hf(gf),pf(gf)};return Q$1(Fragment$1,null,bo&&Q$1("div",{onClick:Pv,css:Tv}),Ai(mf))}var Mv={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},Nv=function(vo){var Ai=vo.name,bo=vo.onFocus;return Q$1("input",{required:!0,name:Ai,tabIndex:-1,"aria-hidden":"true",onFocus:bo,css:Mv,value:"",onChange:function(){}})},Av=Nv;function Ja(vo){var Ai;return typeof window<"u"&&window.navigator!=null?vo.test(((Ai=window.navigator.userAgentData)===null||Ai===void 0?void 0:Ai.platform)||window.navigator.platform):!1}function Dv(){return Ja(/^iPhone/i)}function Sl(){return Ja(/^Mac/i)}function Rv(){return Ja(/^iPad/i)||Sl()&&navigator.maxTouchPoints>1}function _v(){return Dv()||Rv()}function kv(){return Sl()||_v()}var Fv=function(vo){return vo.label},Vv=function(vo){return vo.label},Lv=function(vo){return vo.value},$v=function(vo){return!!vo.isDisabled},Uv={clearIndicator:Cg,container:fg,control:Ng,dropdownIndicator:xg,group:_g,groupHeading:Fg,indicatorsContainer:gg,indicatorSeparator:Eg,input:Ug,loadingIndicator:Og,loadingMessage:sg,menu:eg,menuList:og,menuPortal:ug,multiValue:jg,multiValueLabel:Yg,multiValueRemove:Gg,noOptionsMessage:ig,option:Jg,placeholder:nv,singleValue:av,valueContainer:pg},Hv={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},Wv=4,Cl=4,Bv=38,zv=Cl*2,jv={baseUnit:Cl,controlHeight:Bv,menuGutter:zv},Uo$1={borderRadius:Wv,colors:Hv,spacing:jv},Yv={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:ds(),captureMenuScroll:!ds(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:wv(),formatGroupLabel:Fv,getOptionLabel:Vv,getOptionValue:Lv,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:$v,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!zh(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(vo){var Ai=vo.count;return"".concat(Ai," result").concat(Ai!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function Cs(vo,Ai,bo,Ra){var pc=Pl(vo,Ai,bo),mc=Tl(vo,Ai,bo),uf=El(vo,Ai),df=Fr$1(vo,Ai);return{type:"option",data:Ai,isDisabled:pc,isSelected:mc,label:uf,value:df,index:Ra}}function xr$2(vo,Ai){return vo.options.map(function(bo,Ra){if("options"in bo){var pc=bo.options.map(function(uf,df){return Cs(vo,uf,Ai,df)}).filter(function(uf){return Es$1(vo,uf)});return pc.length>0?{type:"group",data:bo,options:pc,index:Ra}:void 0}var mc=Cs(vo,bo,Ai,Ra);return Es$1(vo,mc)?mc:void 0}).filter(Gh)}function Il(vo){return vo.reduce(function(Ai,bo){return bo.type==="group"?Ai.push.apply(Ai,$a(bo.options.map(function(Ra){return Ra.data}))):Ai.push(bo.data),Ai},[])}function Is$2(vo,Ai){return vo.reduce(function(bo,Ra){return Ra.type==="group"?bo.push.apply(bo,$a(Ra.options.map(function(pc){return{data:pc.data,id:"".concat(Ai,"-").concat(Ra.index,"-").concat(pc.index)}}))):bo.push({data:Ra.data,id:"".concat(Ai,"-").concat(Ra.index)}),bo},[])}function Gv(vo,Ai){return Il(xr$2(vo,Ai))}function Es$1(vo,Ai){var bo=vo.inputValue,Ra=bo===void 0?"":bo,pc=Ai.data,mc=Ai.isSelected,uf=Ai.label,df=Ai.value;return(!Ml(vo)||!mc)&&Ol(vo,{label:uf,value:df,data:pc},Ra)}function qv(vo,Ai){var bo=vo.focusedValue,Ra=vo.selectValue,pc=Ra.indexOf(bo);if(pc>-1){var mc=Ai.indexOf(bo);if(mc>-1)return bo;if(pc<Ai.length)return Ai[pc]}return null}function Xv(vo,Ai){var bo=vo.focusedOption;return bo&&Ai.indexOf(bo)>-1?bo:Ai[0]}var Ho$1=function(vo,Ai){var bo,Ra=(bo=vo.find(function(pc){return pc.data===Ai}))===null||bo===void 0?void 0:bo.id;return Ra||null},El=function(vo,Ai){return vo.getOptionLabel(Ai)},Fr$1=function(vo,Ai){return vo.getOptionValue(Ai)};function Pl(vo,Ai,bo){return typeof vo.isOptionDisabled=="function"?vo.isOptionDisabled(Ai,bo):!1}function Tl(vo,Ai,bo){if(bo.indexOf(Ai)>-1)return!0;if(typeof vo.isOptionSelected=="function")return vo.isOptionSelected(Ai,bo);var Ra=Fr$1(vo,Ai);return bo.some(function(pc){return Fr$1(vo,pc)===Ra})}function Ol(vo,Ai,bo){return vo.filterOption?vo.filterOption(Ai,bo):!0}var Ml=function(vo){var Ai=vo.hideSelectedOptions,bo=vo.isMulti;return Ai===void 0?bo:Ai},Kv=1,Nl=function(vo){Bm(bo,vo);var Ai=Ym(bo);function bo(Ra){var pc;if(Hm(this,bo),pc=Ai.call(this,Ra),pc.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:""},pc.blockOptionHover=!1,pc.isComposing=!1,pc.commonProps=void 0,pc.initialTouchX=0,pc.initialTouchY=0,pc.openAfterFocus=!1,pc.scrollToFocusedOptionOnUpdate=!1,pc.userIsDragging=void 0,pc.isAppleDevice=kv(),pc.controlRef=null,pc.getControlRef=function(ff){pc.controlRef=ff},pc.focusedOptionRef=null,pc.getFocusedOptionRef=function(ff){pc.focusedOptionRef=ff},pc.menuListRef=null,pc.getMenuListRef=function(ff){pc.menuListRef=ff},pc.inputRef=null,pc.getInputRef=function(ff){pc.inputRef=ff},pc.focus=pc.focusInput,pc.blur=pc.blurInput,pc.onChange=function(ff,hf){var pf=pc.props,mf=pf.onChange,gf=pf.name;hf.name=gf,pc.ariaOnChange(ff,hf),mf(ff,hf)},pc.setValue=function(ff,hf,pf){var mf=pc.props,gf=mf.closeMenuOnSelect,yf=mf.isMulti,vf=mf.inputValue;pc.onInputChange("",{action:"set-value",prevInputValue:vf}),gf&&(pc.setState({inputIsHiddenAfterUpdate:!yf}),pc.onMenuClose()),pc.setState({clearFocusValueOnUpdate:!0}),pc.onChange(ff,{action:hf,option:pf})},pc.selectOption=function(ff){var hf=pc.props,pf=hf.blurInputOnSelect,mf=hf.isMulti,gf=hf.name,yf=pc.state.selectValue,vf=mf&&pc.isOptionSelected(ff,yf),bf=pc.isOptionDisabled(ff,yf);if(vf){var Sf=pc.getOptionValue(ff);pc.setValue(yf.filter(function(xf){return pc.getOptionValue(xf)!==Sf}),"deselect-option",ff)}else if(!bf)mf?pc.setValue([].concat($a(yf),[ff]),"select-option",ff):pc.setValue(ff,"select-option");else{pc.ariaOnChange(ff,{action:"select-option",option:ff,name:gf});return}pf&&pc.blurInput()},pc.removeValue=function(ff){var hf=pc.props.isMulti,pf=pc.state.selectValue,mf=pc.getOptionValue(ff),gf=pf.filter(function(vf){return pc.getOptionValue(vf)!==mf}),yf=lr$1(hf,gf,gf[0]||null);pc.onChange(yf,{action:"remove-value",removedValue:ff}),pc.focusInput()},pc.clearValue=function(){var ff=pc.state.selectValue;pc.onChange(lr$1(pc.props.isMulti,[],null),{action:"clear",removedValues:ff})},pc.popValue=function(){var ff=pc.props.isMulti,hf=pc.state.selectValue,pf=hf[hf.length-1],mf=hf.slice(0,hf.length-1),gf=lr$1(ff,mf,mf[0]||null);pf&&pc.onChange(gf,{action:"pop-value",removedValue:pf})},pc.getFocusedOptionId=function(ff){return Ho$1(pc.state.focusableOptionsWithIds,ff)},pc.getFocusableOptionsWithIds=function(){return Is$2(xr$2(pc.props,pc.state.selectValue),pc.getElementId("option"))},pc.getValue=function(){return pc.state.selectValue},pc.cx=function(){for(var ff=arguments.length,hf=new Array(ff),pf=0;pf<ff;pf++)hf[pf]=arguments[pf];return $h.apply(void 0,[pc.props.classNamePrefix].concat(hf))},pc.getOptionLabel=function(ff){return El(pc.props,ff)},pc.getOptionValue=function(ff){return Fr$1(pc.props,ff)},pc.getStyles=function(ff,hf){var pf=pc.props.unstyled,mf=Uv[ff](hf,pf);mf.boxSizing="border-box";var gf=pc.props.styles[ff];return gf?gf(mf,hf):mf},pc.getClassNames=function(ff,hf){var pf,mf;return(pf=(mf=pc.props.classNames)[ff])===null||pf===void 0?void 0:pf.call(mf,hf)},pc.getElementId=function(ff){return"".concat(pc.state.instancePrefix,"-").concat(ff)},pc.getComponents=function(){return cv(pc.props)},pc.buildCategorizedOptions=function(){return xr$2(pc.props,pc.state.selectValue)},pc.getCategorizedOptions=function(){return pc.props.menuIsOpen?pc.buildCategorizedOptions():[]},pc.buildFocusableOptions=function(){return Il(pc.buildCategorizedOptions())},pc.getFocusableOptions=function(){return pc.props.menuIsOpen?pc.buildFocusableOptions():[]},pc.ariaOnChange=function(ff,hf){pc.setState({ariaSelection:te$2({value:ff},hf)})},pc.onMenuMouseDown=function(ff){ff.button===0&&(ff.stopPropagation(),ff.preventDefault(),pc.focusInput())},pc.onMenuMouseMove=function(ff){pc.blockOptionHover=!1},pc.onControlMouseDown=function(ff){if(!ff.defaultPrevented){var hf=pc.props.openMenuOnClick;pc.state.isFocused?pc.props.menuIsOpen?ff.target.tagName!=="INPUT"&&ff.target.tagName!=="TEXTAREA"&&pc.onMenuClose():hf&&pc.openMenu("first"):(hf&&(pc.openAfterFocus=!0),pc.focusInput()),ff.target.tagName!=="INPUT"&&ff.target.tagName!=="TEXTAREA"&&ff.preventDefault()}},pc.onDropdownIndicatorMouseDown=function(ff){if(!(ff&&ff.type==="mousedown"&&ff.button!==0)&&!pc.props.isDisabled){var hf=pc.props,pf=hf.isMulti,mf=hf.menuIsOpen;pc.focusInput(),mf?(pc.setState({inputIsHiddenAfterUpdate:!pf}),pc.onMenuClose()):pc.openMenu("first"),ff.preventDefault()}},pc.onClearIndicatorMouseDown=function(ff){ff&&ff.type==="mousedown"&&ff.button!==0||(pc.clearValue(),ff.preventDefault(),pc.openAfterFocus=!1,ff.type==="touchend"?pc.focusInput():setTimeout(function(){return pc.focusInput()}))},pc.onScroll=function(ff){typeof pc.props.closeMenuOnScroll=="boolean"?ff.target instanceof HTMLElement&&no$1(ff.target)&&pc.props.onMenuClose():typeof pc.props.closeMenuOnScroll=="function"&&pc.props.closeMenuOnScroll(ff)&&pc.props.onMenuClose()},pc.onCompositionStart=function(){pc.isComposing=!0},pc.onCompositionEnd=function(){pc.isComposing=!1},pc.onTouchStart=function(ff){var hf=ff.touches,pf=hf&&hf.item(0);pf&&(pc.initialTouchX=pf.clientX,pc.initialTouchY=pf.clientY,pc.userIsDragging=!1)},pc.onTouchMove=function(ff){var hf=ff.touches,pf=hf&&hf.item(0);if(pf){var mf=Math.abs(pf.clientX-pc.initialTouchX),gf=Math.abs(pf.clientY-pc.initialTouchY),yf=5;pc.userIsDragging=mf>yf||gf>yf}},pc.onTouchEnd=function(ff){pc.userIsDragging||(pc.controlRef&&!pc.controlRef.contains(ff.target)&&pc.menuListRef&&!pc.menuListRef.contains(ff.target)&&pc.blurInput(),pc.initialTouchX=0,pc.initialTouchY=0)},pc.onControlTouchEnd=function(ff){pc.userIsDragging||pc.onControlMouseDown(ff)},pc.onClearIndicatorTouchEnd=function(ff){pc.userIsDragging||pc.onClearIndicatorMouseDown(ff)},pc.onDropdownIndicatorTouchEnd=function(ff){pc.userIsDragging||pc.onDropdownIndicatorMouseDown(ff)},pc.handleInputChange=function(ff){var hf=pc.props.inputValue,pf=ff.currentTarget.value;pc.setState({inputIsHiddenAfterUpdate:!1}),pc.onInputChange(pf,{action:"input-change",prevInputValue:hf}),pc.props.menuIsOpen||pc.onMenuOpen()},pc.onInputFocus=function(ff){pc.props.onFocus&&pc.props.onFocus(ff),pc.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(pc.openAfterFocus||pc.props.openMenuOnFocus)&&pc.openMenu("first"),pc.openAfterFocus=!1},pc.onInputBlur=function(ff){var hf=pc.props.inputValue;if(pc.menuListRef&&pc.menuListRef.contains(document.activeElement)){pc.inputRef.focus();return}pc.props.onBlur&&pc.props.onBlur(ff),pc.onInputChange("",{action:"input-blur",prevInputValue:hf}),pc.onMenuClose(),pc.setState({focusedValue:null,isFocused:!1})},pc.onOptionHover=function(ff){if(!(pc.blockOptionHover||pc.state.focusedOption===ff)){var hf=pc.getFocusableOptions(),pf=hf.indexOf(ff);pc.setState({focusedOption:ff,focusedOptionId:pf>-1?pc.getFocusedOptionId(ff):null})}},pc.shouldHideSelectedOptions=function(){return Ml(pc.props)},pc.onValueInputFocus=function(ff){ff.preventDefault(),ff.stopPropagation(),pc.focus()},pc.onKeyDown=function(ff){var hf=pc.props,pf=hf.isMulti,mf=hf.backspaceRemovesValue,gf=hf.escapeClearsValue,yf=hf.inputValue,vf=hf.isClearable,bf=hf.isDisabled,Sf=hf.menuIsOpen,xf=hf.onKeyDown,wf=hf.tabSelectsValue,If=hf.openMenuOnFocus,l1=pc.state,s1=l1.focusedOption,c1=l1.focusedValue,u1=l1.selectValue;if(!bf&&!(typeof xf=="function"&&(xf(ff),ff.defaultPrevented))){switch(pc.blockOptionHover=!0,ff.key){case"ArrowLeft":if(!pf||yf)return;pc.focusValue("previous");break;case"ArrowRight":if(!pf||yf)return;pc.focusValue("next");break;case"Delete":case"Backspace":if(yf)return;if(c1)pc.removeValue(c1);else{if(!mf)return;pf?pc.popValue():vf&&pc.clearValue()}break;case"Tab":if(pc.isComposing||ff.shiftKey||!Sf||!wf||!s1||If&&pc.isOptionSelected(s1,u1))return;pc.selectOption(s1);break;case"Enter":if(ff.keyCode===229)break;if(Sf){if(!s1||pc.isComposing)return;pc.selectOption(s1);break}return;case"Escape":Sf?(pc.setState({inputIsHiddenAfterUpdate:!1}),pc.onInputChange("",{action:"menu-close",prevInputValue:yf}),pc.onMenuClose()):vf&&gf&&pc.clearValue();break;case" ":if(yf)return;if(!Sf){pc.openMenu("first");break}if(!s1)return;pc.selectOption(s1);break;case"ArrowUp":Sf?pc.focusOption("up"):pc.openMenu("last");break;case"ArrowDown":Sf?pc.focusOption("down"):pc.openMenu("first");break;case"PageUp":if(!Sf)return;pc.focusOption("pageup");break;case"PageDown":if(!Sf)return;pc.focusOption("pagedown");break;case"Home":if(!Sf)return;pc.focusOption("first");break;case"End":if(!Sf)return;pc.focusOption("last");break;default:return}ff.preventDefault()}},pc.state.instancePrefix="react-select-"+(pc.props.instanceId||++Kv),pc.state.selectValue=ls$1(Ra.value),Ra.menuIsOpen&&pc.state.selectValue.length){var mc=pc.getFocusableOptionsWithIds(),uf=pc.buildFocusableOptions(),df=uf.indexOf(pc.state.selectValue[0]);pc.state.focusableOptionsWithIds=mc,pc.state.focusedOption=uf[df],pc.state.focusedOptionId=Ho$1(mc,uf[df])}return pc}return Wm(bo,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&us(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(Ra){var pc=this.props,mc=pc.isDisabled,uf=pc.menuIsOpen,df=this.state.isFocused;(df&&!mc&&Ra.isDisabled||df&&uf&&!Ra.menuIsOpen)&&this.focusInput(),df&&mc&&!Ra.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!df&&!mc&&Ra.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(us(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(Ra,pc){this.props.onInputChange(Ra,pc)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(Ra){var pc=this,mc=this.state,uf=mc.selectValue,df=mc.isFocused,ff=this.buildFocusableOptions(),hf=Ra==="first"?0:ff.length-1;if(!this.props.isMulti){var pf=ff.indexOf(uf[0]);pf>-1&&(hf=pf)}this.scrollToFocusedOptionOnUpdate=!(df&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:ff[hf],focusedOptionId:this.getFocusedOptionId(ff[hf])},function(){return pc.onMenuOpen()})}},{key:"focusValue",value:function(Ra){var pc=this.state,mc=pc.selectValue,uf=pc.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var df=mc.indexOf(uf);uf||(df=-1);var ff=mc.length-1,hf=-1;if(mc.length){switch(Ra){case"previous":df===0?hf=0:df===-1?hf=ff:hf=df-1;break;case"next":df>-1&&df<ff&&(hf=df+1);break}this.setState({inputIsHidden:hf!==-1,focusedValue:mc[hf]})}}}},{key:"focusOption",value:function(){var Ra=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",pc=this.props.pageSize,mc=this.state.focusedOption,uf=this.getFocusableOptions();if(uf.length){var df=0,ff=uf.indexOf(mc);mc||(ff=-1),Ra==="up"?df=ff>0?ff-1:uf.length-1:Ra==="down"?df=(ff+1)%uf.length:Ra==="pageup"?(df=ff-pc,df<0&&(df=0)):Ra==="pagedown"?(df=ff+pc,df>uf.length-1&&(df=uf.length-1)):Ra==="last"&&(df=uf.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:uf[df],focusedValue:null,focusedOptionId:this.getFocusedOptionId(uf[df])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(Uo$1):te$2(te$2({},Uo$1),this.props.theme):Uo$1}},{key:"getCommonProps",value:function(){var Ra=this.clearValue,pc=this.cx,mc=this.getStyles,uf=this.getClassNames,df=this.getValue,ff=this.selectOption,hf=this.setValue,pf=this.props,mf=pf.isMulti,gf=pf.isRtl,yf=pf.options,vf=this.hasValue();return{clearValue:Ra,cx:pc,getStyles:mc,getClassNames:uf,getValue:df,hasValue:vf,isMulti:mf,isRtl:gf,options:yf,selectOption:ff,selectProps:pf,setValue:hf,theme:this.getTheme()}}},{key:"hasValue",value:function(){var Ra=this.state.selectValue;return Ra.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var Ra=this.props,pc=Ra.isClearable,mc=Ra.isMulti;return pc===void 0?mc:pc}},{key:"isOptionDisabled",value:function(Ra,pc){return Pl(this.props,Ra,pc)}},{key:"isOptionSelected",value:function(Ra,pc){return Tl(this.props,Ra,pc)}},{key:"filterOption",value:function(Ra,pc){return Ol(this.props,Ra,pc)}},{key:"formatOptionLabel",value:function(Ra,pc){if(typeof this.props.formatOptionLabel=="function"){var mc=this.props.inputValue,uf=this.state.selectValue;return this.props.formatOptionLabel(Ra,{context:pc,inputValue:mc,selectValue:uf})}else return this.getOptionLabel(Ra)}},{key:"formatGroupLabel",value:function(Ra){return this.props.formatGroupLabel(Ra)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var Ra=this.props,pc=Ra.isDisabled,mc=Ra.isSearchable,uf=Ra.inputId,df=Ra.inputValue,ff=Ra.tabIndex,hf=Ra.form,pf=Ra.menuIsOpen,mf=Ra.required,gf=this.getComponents(),yf=gf.Input,vf=this.state,bf=vf.inputIsHidden,Sf=vf.ariaSelection,xf=this.commonProps,wf=uf||this.getElementId("input"),If=te$2(te$2(te$2({"aria-autocomplete":"list","aria-expanded":pf,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":mf,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},pf&&{"aria-controls":this.getElementId("listbox")}),!mc&&{"aria-readonly":!0}),this.hasValue()?(Sf==null?void 0:Sf.action)==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return mc?y$2.createElement(yf,Hr$3({},xf,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:wf,innerRef:this.getInputRef,isDisabled:pc,isHidden:bf,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:ff,form:hf,type:"text",value:df},If)):y$2.createElement(Sv,Hr$3({id:wf,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:_r$2,onFocus:this.onInputFocus,disabled:pc,tabIndex:ff,inputMode:"none",form:hf,value:""},If))}},{key:"renderPlaceholderOrValue",value:function(){var Ra=this,pc=this.getComponents(),mc=pc.MultiValue,uf=pc.MultiValueContainer,df=pc.MultiValueLabel,ff=pc.MultiValueRemove,hf=pc.SingleValue,pf=pc.Placeholder,mf=this.commonProps,gf=this.props,yf=gf.controlShouldRenderValue,vf=gf.isDisabled,bf=gf.isMulti,Sf=gf.inputValue,xf=gf.placeholder,wf=this.state,If=wf.selectValue,l1=wf.focusedValue,s1=wf.isFocused;if(!this.hasValue()||!yf)return Sf?null:y$2.createElement(pf,Hr$3({},mf,{key:"placeholder",isDisabled:vf,isFocused:s1,innerProps:{id:this.getElementId("placeholder")}}),xf);if(bf)return If.map(function(u1,T1){var _1=u1===l1,R1="".concat(Ra.getOptionLabel(u1),"-").concat(Ra.getOptionValue(u1));return y$2.createElement(mc,Hr$3({},mf,{components:{Container:uf,Label:df,Remove:ff},isFocused:_1,isDisabled:vf,key:R1,index:T1,removeProps:{onClick:function(){return Ra.removeValue(u1)},onTouchEnd:function(){return Ra.removeValue(u1)},onMouseDown:function(P1){P1.preventDefault()}},data:u1}),Ra.formatOptionLabel(u1,"value"))});if(Sf)return null;var c1=If[0];return y$2.createElement(hf,Hr$3({},mf,{data:c1,isDisabled:vf}),this.formatOptionLabel(c1,"value"))}},{key:"renderClearIndicator",value:function(){var Ra=this.getComponents(),pc=Ra.ClearIndicator,mc=this.commonProps,uf=this.props,df=uf.isDisabled,ff=uf.isLoading,hf=this.state.isFocused;if(!this.isClearable()||!pc||df||!this.hasValue()||ff)return null;var pf={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return y$2.createElement(pc,Hr$3({},mc,{innerProps:pf,isFocused:hf}))}},{key:"renderLoadingIndicator",value:function(){var Ra=this.getComponents(),pc=Ra.LoadingIndicator,mc=this.commonProps,uf=this.props,df=uf.isDisabled,ff=uf.isLoading,hf=this.state.isFocused;if(!pc||!ff)return null;var pf={"aria-hidden":"true"};return y$2.createElement(pc,Hr$3({},mc,{innerProps:pf,isDisabled:df,isFocused:hf}))}},{key:"renderIndicatorSeparator",value:function(){var Ra=this.getComponents(),pc=Ra.DropdownIndicator,mc=Ra.IndicatorSeparator;if(!pc||!mc)return null;var uf=this.commonProps,df=this.props.isDisabled,ff=this.state.isFocused;return y$2.createElement(mc,Hr$3({},uf,{isDisabled:df,isFocused:ff}))}},{key:"renderDropdownIndicator",value:function(){var Ra=this.getComponents(),pc=Ra.DropdownIndicator;if(!pc)return null;var mc=this.commonProps,uf=this.props.isDisabled,df=this.state.isFocused,ff={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return y$2.createElement(pc,Hr$3({},mc,{innerProps:ff,isDisabled:uf,isFocused:df}))}},{key:"renderMenu",value:function(){var Ra=this,pc=this.getComponents(),mc=pc.Group,uf=pc.GroupHeading,df=pc.Menu,ff=pc.MenuList,hf=pc.MenuPortal,pf=pc.LoadingMessage,mf=pc.NoOptionsMessage,gf=pc.Option,yf=this.commonProps,vf=this.state.focusedOption,bf=this.props,Sf=bf.captureMenuScroll,xf=bf.inputValue,wf=bf.isLoading,If=bf.loadingMessage,l1=bf.minMenuHeight,s1=bf.maxMenuHeight,c1=bf.menuIsOpen,u1=bf.menuPlacement,T1=bf.menuPosition,_1=bf.menuPortalTarget,R1=bf.menuShouldBlockScroll,P1=bf.menuShouldScrollIntoView,E1=bf.noOptionsMessage,M1=bf.onMenuScrollToTop,m1=bf.onMenuScrollToBottom;if(!c1)return null;var $1=function(Z1,O1){var j1=Z1.type,L1=Z1.data,G1=Z1.isDisabled,Y1=Z1.isSelected,z1=Z1.label,K1=Z1.value,tT=vf===L1,iT=G1?void 0:function(){return Ra.onOptionHover(L1)},aT=G1?void 0:function(){return Ra.selectOption(L1)},oT="".concat(Ra.getElementId("option"),"-").concat(O1),nT={id:oT,onClick:aT,onMouseMove:iT,onMouseOver:iT,tabIndex:-1,role:"option","aria-selected":Ra.isAppleDevice?void 0:Y1};return y$2.createElement(gf,Hr$3({},yf,{innerProps:nT,data:L1,isDisabled:G1,isSelected:Y1,key:oT,label:z1,type:j1,value:K1,isFocused:tT,innerRef:tT?Ra.getFocusedOptionRef:void 0}),Ra.formatOptionLabel(Z1.data,"menu"))},k1;if(this.hasOptions())k1=this.getCategorizedOptions().map(function(Z1){if(Z1.type==="group"){var O1=Z1.data,j1=Z1.options,L1=Z1.index,G1="".concat(Ra.getElementId("group"),"-").concat(L1),Y1="".concat(G1,"-heading");return y$2.createElement(mc,Hr$3({},yf,{key:G1,data:O1,options:j1,Heading:uf,headingProps:{id:Y1,data:Z1.data},label:Ra.formatGroupLabel(Z1.data)}),Z1.options.map(function(z1){return $1(z1,"".concat(L1,"-").concat(z1.index))}))}else if(Z1.type==="option")return $1(Z1,"".concat(Z1.index))});else if(wf){var F1=If({inputValue:xf});if(F1===null)return null;k1=y$2.createElement(pf,yf,F1)}else{var U1=E1({inputValue:xf});if(U1===null)return null;k1=y$2.createElement(mf,yf,U1)}var B1={minMenuHeight:l1,maxMenuHeight:s1,menuPlacement:u1,menuPosition:T1,menuShouldScrollIntoView:P1},W1=y$2.createElement(tg,Hr$3({},yf,B1),function(Z1){var O1=Z1.ref,j1=Z1.placerProps,L1=j1.placement,G1=j1.maxHeight;return y$2.createElement(df,Hr$3({},yf,B1,{innerRef:O1,innerProps:{onMouseDown:Ra.onMenuMouseDown,onMouseMove:Ra.onMenuMouseMove},isLoading:wf,placement:L1}),y$2.createElement(Ov,{captureEnabled:Sf,onTopArrive:M1,onBottomArrive:m1,lockEnabled:R1},function(Y1){return y$2.createElement(ff,Hr$3({},yf,{innerRef:function(z1){Ra.getMenuListRef(z1),Y1(z1)},innerProps:{role:"listbox","aria-multiselectable":yf.isMulti,id:Ra.getElementId("listbox")},isLoading:wf,maxHeight:G1,focusedOption:vf}),k1)}))});return _1||T1==="fixed"?y$2.createElement(hf,Hr$3({},yf,{appendTo:_1,controlElement:this.controlRef,menuPlacement:u1,menuPosition:T1}),W1):W1}},{key:"renderFormField",value:function(){var Ra=this,pc=this.props,mc=pc.delimiter,uf=pc.isDisabled,df=pc.isMulti,ff=pc.name,hf=pc.required,pf=this.state.selectValue;if(hf&&!this.hasValue()&&!uf)return y$2.createElement(Av,{name:ff,onFocus:this.onValueInputFocus});if(!(!ff||uf))if(df)if(mc){var mf=pf.map(function(vf){return Ra.getOptionValue(vf)}).join(mc);return y$2.createElement("input",{name:ff,type:"hidden",value:mf})}else{var gf=pf.length>0?pf.map(function(vf,bf){return y$2.createElement("input",{key:"i-".concat(bf),name:ff,type:"hidden",value:Ra.getOptionValue(vf)})}):y$2.createElement("input",{name:ff,type:"hidden",value:""});return y$2.createElement("div",null,gf)}else{var yf=pf[0]?this.getOptionValue(pf[0]):"";return y$2.createElement("input",{name:ff,type:"hidden",value:yf})}}},{key:"renderLiveRegion",value:function(){var Ra=this.commonProps,pc=this.state,mc=pc.ariaSelection,uf=pc.focusedOption,df=pc.focusedValue,ff=pc.isFocused,hf=pc.selectValue,pf=this.getFocusableOptions();return y$2.createElement(gv,Hr$3({},Ra,{id:this.getElementId("live-region"),ariaSelection:mc,focusedOption:uf,focusedValue:df,isFocused:ff,selectValue:hf,focusableOptions:pf,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var Ra=this.getComponents(),pc=Ra.Control,mc=Ra.IndicatorsContainer,uf=Ra.SelectContainer,df=Ra.ValueContainer,ff=this.props,hf=ff.className,pf=ff.id,mf=ff.isDisabled,gf=ff.menuIsOpen,yf=this.state.isFocused,vf=this.commonProps=this.getCommonProps();return y$2.createElement(uf,Hr$3({},vf,{className:hf,innerProps:{id:pf,onKeyDown:this.onKeyDown},isDisabled:mf,isFocused:yf}),this.renderLiveRegion(),y$2.createElement(pc,Hr$3({},vf,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:mf,isFocused:yf,menuIsOpen:gf}),y$2.createElement(df,Hr$3({},vf,{isDisabled:mf}),this.renderPlaceholderOrValue(),this.renderInput()),y$2.createElement(mc,Hr$3({},vf,{isDisabled:mf}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(Ra,pc){var mc=pc.prevProps,uf=pc.clearFocusValueOnUpdate,df=pc.inputIsHiddenAfterUpdate,ff=pc.ariaSelection,hf=pc.isFocused,pf=pc.prevWasFocused,mf=pc.instancePrefix,gf=Ra.options,yf=Ra.value,vf=Ra.menuIsOpen,bf=Ra.inputValue,Sf=Ra.isMulti,xf=ls$1(yf),wf={};if(mc&&(yf!==mc.value||gf!==mc.options||vf!==mc.menuIsOpen||bf!==mc.inputValue)){var If=vf?Gv(Ra,xf):[],l1=vf?Is$2(xr$2(Ra,xf),"".concat(mf,"-option")):[],s1=uf?qv(pc,xf):null,c1=Xv(pc,If),u1=Ho$1(l1,c1);wf={selectValue:xf,focusedOption:c1,focusedOptionId:u1,focusableOptionsWithIds:l1,focusedValue:s1,clearFocusValueOnUpdate:!1}}var T1=df!=null&&Ra!==mc?{inputIsHidden:df,inputIsHiddenAfterUpdate:void 0}:{},_1=ff,R1=hf&&pf;return hf&&!R1&&(_1={value:lr$1(Sf,xf,xf[0]||null),options:xf,action:"initial-input-focus"},R1=!pf),(ff==null?void 0:ff.action)==="initial-input-focus"&&(_1=null),te$2(te$2(te$2({},wf),T1),{},{prevProps:Ra,ariaSelection:_1,prevWasFocused:R1})}}]),bo}(Component);Nl.defaultProps=Yv;var Zv=forwardRef(function(vo,Ai){var bo=Um(vo);return y$2.createElement(Nl,Hr$3({ref:Ai},bo))}),Qv=Zv;function Jv(vo){return jsx(ro$1.DropdownIndicator,{...vo,children:jsx(_e$1,{name:"ChevronDown",size:16})})}function eb(vo){return jsx(ro$1.ClearIndicator,{...vo,children:jsx(_e$1,{name:"Xmark",size:16})})}function tb(vo){const{label:Ai,onClick:bo,...Ra}=vo,pc=!!Ai&&!!bo;return jsxs(ro$1.MenuList,{...Ra,children:[vo.children,pc?jsx("button",{className:"w-full px-2 py-3 hover:bg-slate-50",onClick:bo,children:Ai}):null]})}function Ca(vo){const Ai=vo["aria-invalid"]==="true",{addItemButtonProps:bo,...Ra}=vo;return jsx(Qv,{...Ra,components:{DropdownIndicator:Jv,ClearIndicator:eb,MenuList:pc=>tb({...pc,...bo})},styles:{dropdownIndicator:()=>({label:"indicatorContainer",display:"flex",transition:"color 150ms",color:"var(--gray-900)",padding:8,boxSizing:"border-box"}),clearIndicator:pc=>({...pc,color:"var(--gray-900)"}),container:pc=>({...pc,borderColor:"var(--gray-200)",fontSize:12}),placeholder:pc=>({...pc,color:Ai?"var(--red-800)":"var(--gray-500)"}),control:()=>({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:32,outline:"0 !important",position:"relative",transition:"all 100ms",backgroundColor:"var(--white)",borderColor:Ai?"var(--red-900)":"var(--gray-200)",borderStyle:"solid",borderWidth:1,borderRadius:"6px",boxSizing:"border-box"}),option:(pc,mc)=>({...pc,backgroundColor:mc.isSelected?"var(--slate-50)":"var(--white)",color:"var(--gray-800)",":hover":{backgroundColor:"var(--slate-50)"}}),menuList:pc=>({...pc,padding:0,borderRadius:"6px"})},theme:pc=>({...pc,colors:{...pc.colors,primary:"var(--slate-100)",primary25:"var(--slate-50)",primary50:"var(--slate-100)",primary75:"var(--slate-100)",danger:"var(--red-900)",dangerLight:"var(--red-100)",neutral0:"var(--white)",neutral5:"var(--gray-50)",neutral10:"var(--gray-100)",neutral20:"var(--gray-200)",neutral30:"var(--gray-300)",neutral40:"var(--gray-400)",neutral50:"var(--gray-500)",neutral60:"var(--gray-600)",neutral70:"var(--gray-700)",neutral80:"var(--gray-800)",neutral90:"var(--gray-900)"}})})}function Al(vo,Ai){const{className:bo,...Ra}=vo;return{className:Ne$1(Ai,typeof bo=="string"&&bo),...Ra}}const Dl=forwardRef(function(vo,Ai){const{color:bo="dark",size:Ra="medium",className:pc="",children:mc,icon:uf,iconPosition:df="left",...ff}=vo,hf={small:"px-2 py-1.5 text-xs rounded-md font-medium",medium:"px-6 py-3 text-base rounded-xl font-semibold tracking-wide"},pf=Xr$1({light:"bg-gray-200 text-gray-600 hover:text-gray-700 hover:border-gray-300 active:border-slate-100 active:text-gray-600 disabled:text-gray-400",dark:"bg-gray-800 text-slate-50 hover:bg-slate-800 active:border-slate-700 disabled:bg-gray-300 disabled:text-slate-100",red:"bg-red-900 text-slate-50 hover:opacity-80 active:border-red-800 disabled:text-red-400 disabled:opacity-100",blue:"bg-blue-900 text-slate-50 hover:opacity-80 active:border-blue-800 disabled:text-blue-400 disabled:opacity-100"}[bo],hf[Ra]),mf=Ne$1("flex items-center justify-center gap-2 border border-none outline-none transition disabled:cursor-not-allowed",pf,pc);return jsxs("button",{className:mf,ref:Ai,...ff,children:[df==="left"&&uf,mc,df==="right"&&uf]})});function re$2(vo,Ai,{checkForDefaultPrevented:bo=!0}={}){return function(Ra){if(vo==null||vo(Ra),bo===!1||!Ra.defaultPrevented)return Ai==null?void 0:Ai(Ra)}}function nb(vo,Ai){const bo=y$2.createContext(Ai),Ra=mc=>{const{children:uf,...df}=mc,ff=y$2.useMemo(()=>df,Object.values(df));return jsx(bo.Provider,{value:ff,children:uf})};Ra.displayName=vo+"Provider";function pc(mc){const uf=y$2.useContext(bo);if(uf)return uf;if(Ai!==void 0)return Ai;throw new Error(`\`${mc}\` must be used within \`${vo}\``)}return[Ra,pc]}function Wt$2(vo,Ai=[]){let bo=[];function Ra(mc,uf){const df=y$2.createContext(uf),ff=bo.length;bo=[...bo,uf];const hf=mf=>{var gf;const{scope:yf,children:vf,...bf}=mf,Sf=((gf=yf==null?void 0:yf[vo])==null?void 0:gf[ff])||df,xf=y$2.useMemo(()=>bf,Object.values(bf));return jsx(Sf.Provider,{value:xf,children:vf})};hf.displayName=mc+"Provider";function pf(mf,gf){var yf;const vf=((yf=gf==null?void 0:gf[vo])==null?void 0:yf[ff])||df,bf=y$2.useContext(vf);if(bf)return bf;if(uf!==void 0)return uf;throw new Error(`\`${mf}\` must be used within \`${mc}\``)}return[hf,pf]}const pc=()=>{const mc=bo.map(uf=>y$2.createContext(uf));return function(uf){const df=(uf==null?void 0:uf[vo])||mc;return y$2.useMemo(()=>({[`__scope${vo}`]:{...uf,[vo]:df}}),[uf,df])}};return pc.scopeName=vo,[Ra,rb(pc,...Ai)]}function rb(...vo){const Ai=vo[0];if(vo.length===1)return Ai;const bo=()=>{const Ra=vo.map(pc=>({useScope:pc(),scopeName:pc.scopeName}));return function(pc){const mc=Ra.reduce((uf,{useScope:df,scopeName:ff})=>{const hf=df(pc)[`__scope${ff}`];return{...uf,...hf}},{});return y$2.useMemo(()=>({[`__scope${Ai.scopeName}`]:mc}),[mc])}};return bo.scopeName=Ai.scopeName,bo}function at$2(vo){const Ai=y$2.useRef(vo);return y$2.useEffect(()=>{Ai.current=vo}),y$2.useMemo(()=>(...bo)=>{var Ra;return(Ra=Ai.current)==null?void 0:Ra.call(Ai,...bo)},[])}function Qn$2({prop:vo,defaultProp:Ai,onChange:bo=()=>{}}){const[Ra,pc]=ob({defaultProp:Ai,onChange:bo}),mc=vo!==void 0,uf=mc?vo:Ra,df=at$2(bo),ff=y$2.useCallback(hf=>{if(mc){const pf=typeof hf=="function"?hf(vo):hf;pf!==vo&&df(pf)}else pc(hf)},[mc,vo,pc,df]);return[uf,ff]}function ob({defaultProp:vo,onChange:Ai}){const bo=y$2.useState(vo),[Ra]=bo,pc=y$2.useRef(Ra),mc=at$2(Ai);return y$2.useEffect(()=>{pc.current!==Ra&&(mc(Ra),pc.current=Ra)},[Ra,pc,mc]),bo}function Rl(vo){const Ai=vo+"CollectionProvider",[bo,Ra]=Wt$2(Ai),[pc,mc]=bo(Ai,{collectionRef:{current:null},itemMap:new Map}),uf=yf=>{const{scope:vf,children:bf}=yf,Sf=y__default.useRef(null),xf=y__default.useRef(new Map).current;return jsx(pc,{scope:vf,itemMap:xf,collectionRef:Sf,children:bf})};uf.displayName=Ai;const df=vo+"CollectionSlot",ff=y__default.forwardRef((yf,vf)=>{const{scope:bf,children:Sf}=yf,xf=mc(df,bf),wf=Fe$2(vf,xf.collectionRef);return jsx(mn$1,{ref:wf,children:Sf})});ff.displayName=df;const hf=vo+"CollectionItemSlot",pf="data-radix-collection-item",mf=y__default.forwardRef((yf,vf)=>{const{scope:bf,children:Sf,...xf}=yf,wf=y__default.useRef(null),If=Fe$2(vf,wf),l1=mc(hf,bf);return y__default.useEffect(()=>(l1.itemMap.set(wf,{ref:wf,...xf}),()=>void l1.itemMap.delete(wf))),jsx(mn$1,{[pf]:"",ref:If,children:Sf})});mf.displayName=hf;function gf(yf){const vf=mc(vo+"CollectionConsumer",yf);return y__default.useCallback(()=>{const bf=vf.collectionRef.current;if(!bf)return[];const Sf=Array.from(bf.querySelectorAll(`[${pf}]`));return Array.from(vf.itemMap.values()).sort((xf,wf)=>Sf.indexOf(xf.ref.current)-Sf.indexOf(wf.ref.current))},[vf.collectionRef,vf.itemMap])}return[{Provider:uf,Slot:ff,ItemSlot:mf},gf,Ra]}var ab=y$2.createContext(void 0);function ei(vo){const Ai=y$2.useContext(ab);return vo||Ai||"ltr"}function ib(vo,Ai=globalThis==null?void 0:globalThis.document){const bo=at$2(vo);y$2.useEffect(()=>{const Ra=pc=>{pc.key==="Escape"&&bo(pc)};return Ai.addEventListener("keydown",Ra,{capture:!0}),()=>Ai.removeEventListener("keydown",Ra,{capture:!0})},[bo,Ai])}var sb="DismissableLayer",Ia="dismissableLayer.update",cb="dismissableLayer.pointerDownOutside",lb="dismissableLayer.focusOutside",Ps$1,_l=y$2.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),oo$1=y$2.forwardRef((vo,Ai)=>{const{disableOutsidePointerEvents:bo=!1,onEscapeKeyDown:Ra,onPointerDownOutside:pc,onFocusOutside:mc,onInteractOutside:uf,onDismiss:df,...ff}=vo,hf=y$2.useContext(_l),[pf,mf]=y$2.useState(null),gf=(pf==null?void 0:pf.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,yf]=y$2.useState({}),vf=Fe$2(Ai,u1=>mf(u1)),bf=Array.from(hf.layers),[Sf]=[...hf.layersWithOutsidePointerEventsDisabled].slice(-1),xf=bf.indexOf(Sf),wf=pf?bf.indexOf(pf):-1,If=hf.layersWithOutsidePointerEventsDisabled.size>0,l1=wf>=xf,s1=fb(u1=>{const T1=u1.target,_1=[...hf.branches].some(R1=>R1.contains(T1));!l1||_1||(pc==null||pc(u1),uf==null||uf(u1),u1.defaultPrevented||df==null||df())},gf),c1=mb(u1=>{const T1=u1.target;[...hf.branches].some(_1=>_1.contains(T1))||(mc==null||mc(u1),uf==null||uf(u1),u1.defaultPrevented||df==null||df())},gf);return ib(u1=>{wf===hf.layers.size-1&&(Ra==null||Ra(u1),!u1.defaultPrevented&&df&&(u1.preventDefault(),df()))},gf),y$2.useEffect(()=>{if(pf)return bo&&(hf.layersWithOutsidePointerEventsDisabled.size===0&&(Ps$1=gf.body.style.pointerEvents,gf.body.style.pointerEvents="none"),hf.layersWithOutsidePointerEventsDisabled.add(pf)),hf.layers.add(pf),Ts(),()=>{bo&&hf.layersWithOutsidePointerEventsDisabled.size===1&&(gf.body.style.pointerEvents=Ps$1)}},[pf,gf,bo,hf]),y$2.useEffect(()=>()=>{pf&&(hf.layers.delete(pf),hf.layersWithOutsidePointerEventsDisabled.delete(pf),Ts())},[pf,hf]),y$2.useEffect(()=>{const u1=()=>yf({});return document.addEventListener(Ia,u1),()=>document.removeEventListener(Ia,u1)},[]),jsx(we$1.div,{...ff,ref:vf,style:{pointerEvents:If?l1?"auto":"none":void 0,...vo.style},onFocusCapture:re$2(vo.onFocusCapture,c1.onFocusCapture),onBlurCapture:re$2(vo.onBlurCapture,c1.onBlurCapture),onPointerDownCapture:re$2(vo.onPointerDownCapture,s1.onPointerDownCapture)})});oo$1.displayName=sb;var ub="DismissableLayerBranch",db=y$2.forwardRef((vo,Ai)=>{const bo=y$2.useContext(_l),Ra=y$2.useRef(null),pc=Fe$2(Ai,Ra);return y$2.useEffect(()=>{const mc=Ra.current;if(mc)return bo.branches.add(mc),()=>{bo.branches.delete(mc)}},[bo.branches]),jsx(we$1.div,{...vo,ref:pc})});db.displayName=ub;function fb(vo,Ai=globalThis==null?void 0:globalThis.document){const bo=at$2(vo),Ra=y$2.useRef(!1),pc=y$2.useRef(()=>{});return y$2.useEffect(()=>{const mc=df=>{if(df.target&&!Ra.current){let ff=function(){kl(cb,bo,hf,{discrete:!0})};const hf={originalEvent:df};df.pointerType==="touch"?(Ai.removeEventListener("click",pc.current),pc.current=ff,Ai.addEventListener("click",pc.current,{once:!0})):ff()}else Ai.removeEventListener("click",pc.current);Ra.current=!1},uf=window.setTimeout(()=>{Ai.addEventListener("pointerdown",mc)},0);return()=>{window.clearTimeout(uf),Ai.removeEventListener("pointerdown",mc),Ai.removeEventListener("click",pc.current)}},[Ai,bo]),{onPointerDownCapture:()=>Ra.current=!0}}function mb(vo,Ai=globalThis==null?void 0:globalThis.document){const bo=at$2(vo),Ra=y$2.useRef(!1);return y$2.useEffect(()=>{const pc=mc=>{mc.target&&!Ra.current&&kl(lb,bo,{originalEvent:mc},{discrete:!1})};return Ai.addEventListener("focusin",pc),()=>Ai.removeEventListener("focusin",pc)},[Ai,bo]),{onFocusCapture:()=>Ra.current=!0,onBlurCapture:()=>Ra.current=!1}}function Ts(){const vo=new CustomEvent(Ia);document.dispatchEvent(vo)}function kl(vo,Ai,bo,{discrete:Ra}){const pc=bo.originalEvent.target,mc=new CustomEvent(vo,{bubbles:!1,cancelable:!0,detail:bo});Ai&&pc.addEventListener(vo,Ai,{once:!0}),Ra?_c(pc,mc):pc.dispatchEvent(mc)}var Wo$1=0;function Fl(){y$2.useEffect(()=>{const vo=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",vo[0]??Os$1()),document.body.insertAdjacentElement("beforeend",vo[1]??Os$1()),Wo$1++,()=>{Wo$1===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(Ai=>Ai.remove()),Wo$1--}},[])}function Os$1(){const vo=document.createElement("span");return vo.setAttribute("data-radix-focus-guard",""),vo.tabIndex=0,vo.style.outline="none",vo.style.opacity="0",vo.style.position="fixed",vo.style.pointerEvents="none",vo}var Bo$1="focusScope.autoFocusOnMount",zo$1="focusScope.autoFocusOnUnmount",Ms$1={bubbles:!1,cancelable:!0},pb="FocusScope",ti=y$2.forwardRef((vo,Ai)=>{const{loop:bo=!1,trapped:Ra=!1,onMountAutoFocus:pc,onUnmountAutoFocus:mc,...uf}=vo,[df,ff]=y$2.useState(null),hf=at$2(pc),pf=at$2(mc),mf=y$2.useRef(null),gf=Fe$2(Ai,bf=>ff(bf)),yf=y$2.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y$2.useEffect(()=>{if(Ra){let bf=function(If){if(yf.paused||!df)return;const l1=If.target;df.contains(l1)?mf.current=l1:At$2(mf.current,{select:!0})},Sf=function(If){if(yf.paused||!df)return;const l1=If.relatedTarget;l1!==null&&(df.contains(l1)||At$2(mf.current,{select:!0}))},xf=function(If){if(document.activeElement===document.body)for(const l1 of If)l1.removedNodes.length>0&&At$2(df)};document.addEventListener("focusin",bf),document.addEventListener("focusout",Sf);const wf=new MutationObserver(xf);return df&&wf.observe(df,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",bf),document.removeEventListener("focusout",Sf),wf.disconnect()}}},[Ra,df,yf.paused]),y$2.useEffect(()=>{if(df){As.add(yf);const bf=document.activeElement;if(!df.contains(bf)){const Sf=new CustomEvent(Bo$1,Ms$1);df.addEventListener(Bo$1,hf),df.dispatchEvent(Sf),Sf.defaultPrevented||(hb(wb(Vl(df)),{select:!0}),document.activeElement===bf&&At$2(df))}return()=>{df.removeEventListener(Bo$1,hf),setTimeout(()=>{const Sf=new CustomEvent(zo$1,Ms$1);df.addEventListener(zo$1,pf),df.dispatchEvent(Sf),Sf.defaultPrevented||At$2(bf??document.body,{select:!0}),df.removeEventListener(zo$1,pf),As.remove(yf)},0)}}},[df,hf,pf,yf]);const vf=y$2.useCallback(bf=>{if(!bo&&!Ra||yf.paused)return;const Sf=bf.key==="Tab"&&!bf.altKey&&!bf.ctrlKey&&!bf.metaKey,xf=document.activeElement;if(Sf&&xf){const wf=bf.currentTarget,[If,l1]=gb(wf);If&&l1?!bf.shiftKey&&xf===l1?(bf.preventDefault(),bo&&At$2(If,{select:!0})):bf.shiftKey&&xf===If&&(bf.preventDefault(),bo&&At$2(l1,{select:!0})):xf===wf&&bf.preventDefault()}},[bo,Ra,yf.paused]);return jsx(we$1.div,{tabIndex:-1,...uf,ref:gf,onKeyDown:vf})});ti.displayName=pb;function hb(vo,{select:Ai=!1}={}){const bo=document.activeElement;for(const Ra of vo)if(At$2(Ra,{select:Ai}),document.activeElement!==bo)return}function gb(vo){const Ai=Vl(vo),bo=Ns(Ai,vo),Ra=Ns(Ai.reverse(),vo);return[bo,Ra]}function Vl(vo){const Ai=[],bo=document.createTreeWalker(vo,NodeFilter.SHOW_ELEMENT,{acceptNode:Ra=>{const pc=Ra.tagName==="INPUT"&&Ra.type==="hidden";return Ra.disabled||Ra.hidden||pc?NodeFilter.FILTER_SKIP:Ra.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;bo.nextNode();)Ai.push(bo.currentNode);return Ai}function Ns(vo,Ai){for(const bo of vo)if(!vb(bo,{upTo:Ai}))return bo}function vb(vo,{upTo:Ai}){if(getComputedStyle(vo).visibility==="hidden")return!0;for(;vo;){if(Ai!==void 0&&vo===Ai)return!1;if(getComputedStyle(vo).display==="none")return!0;vo=vo.parentElement}return!1}function bb(vo){return vo instanceof HTMLInputElement&&"select"in vo}function At$2(vo,{select:Ai=!1}={}){if(vo&&vo.focus){const bo=document.activeElement;vo.focus({preventScroll:!0}),vo!==bo&&bb(vo)&&Ai&&vo.select()}}var As=yb();function yb(){let vo=[];return{add(Ai){const bo=vo[0];Ai!==bo&&(bo==null||bo.pause()),vo=Ds$1(vo,Ai),vo.unshift(Ai)},remove(Ai){var bo;vo=Ds$1(vo,Ai),(bo=vo[0])==null||bo.resume()}}}function Ds$1(vo,Ai){const bo=[...vo],Ra=bo.indexOf(Ai);return Ra!==-1&&bo.splice(Ra,1),bo}function wb(vo){return vo.filter(Ai=>Ai.tagName!=="A")}var Xt$1=globalThis!=null&&globalThis.document?y$2.useLayoutEffect:()=>{},xb=y$2.useId||(()=>{}),Sb=0;function Ft$2(vo){const[Ai,bo]=y$2.useState(xb());return Xt$1(()=>{bo(Ra=>Ra??String(Sb++))},[vo]),Ai?`radix-${Ai}`:""}var Sr$2=typeof document<"u"?useLayoutEffect:useEffect;function Vr$2(vo,Ai){if(vo===Ai)return!0;if(typeof vo!=typeof Ai)return!1;if(typeof vo=="function"&&vo.toString()===Ai.toString())return!0;let bo,Ra,pc;if(vo&&Ai&&typeof vo=="object"){if(Array.isArray(vo)){if(bo=vo.length,bo!==Ai.length)return!1;for(Ra=bo;Ra--!==0;)if(!Vr$2(vo[Ra],Ai[Ra]))return!1;return!0}if(pc=Object.keys(vo),bo=pc.length,bo!==Object.keys(Ai).length)return!1;for(Ra=bo;Ra--!==0;)if(!{}.hasOwnProperty.call(Ai,pc[Ra]))return!1;for(Ra=bo;Ra--!==0;){const mc=pc[Ra];if(!(mc==="_owner"&&vo.$$typeof)&&!Vr$2(vo[mc],Ai[mc]))return!1}return!0}return vo!==vo&&Ai!==Ai}function Ll(vo){return typeof window>"u"?1:(vo.ownerDocument.defaultView||window).devicePixelRatio||1}function Rs(vo,Ai){const bo=Ll(vo);return Math.round(Ai*bo)/bo}function jo(vo){const Ai=y$2.useRef(vo);return Sr$2(()=>{Ai.current=vo}),Ai}function Cb(vo){vo===void 0&&(vo={});const{placement:Ai="bottom",strategy:bo="absolute",middleware:Ra=[],platform:pc,elements:{reference:mc,floating:uf}={},transform:df=!0,whileElementsMounted:ff,open:hf}=vo,[pf,mf]=y$2.useState({x:0,y:0,strategy:bo,placement:Ai,middlewareData:{},isPositioned:!1}),[gf,yf]=y$2.useState(Ra);Vr$2(gf,Ra)||yf(Ra);const[vf,bf]=y$2.useState(null),[Sf,xf]=y$2.useState(null),wf=y$2.useCallback(U1=>{U1!==c1.current&&(c1.current=U1,bf(U1))},[]),If=y$2.useCallback(U1=>{U1!==u1.current&&(u1.current=U1,xf(U1))},[]),l1=mc||vf,s1=uf||Sf,c1=y$2.useRef(null),u1=y$2.useRef(null),T1=y$2.useRef(pf),_1=ff!=null,R1=jo(ff),P1=jo(pc),E1=jo(hf),M1=y$2.useCallback(()=>{if(!c1.current||!u1.current)return;const U1={placement:Ai,strategy:bo,middleware:gf};P1.current&&(U1.platform=P1.current),Fh(c1.current,u1.current,U1).then(B1=>{const W1={...B1,isPositioned:E1.current!==!1};m1.current&&!Vr$2(T1.current,W1)&&(T1.current=W1,hc.flushSync(()=>{mf(W1)}))})},[gf,Ai,bo,P1,E1]);Sr$2(()=>{hf===!1&&T1.current.isPositioned&&(T1.current.isPositioned=!1,mf(U1=>({...U1,isPositioned:!1})))},[hf]);const m1=y$2.useRef(!1);Sr$2(()=>(m1.current=!0,()=>{m1.current=!1}),[]),Sr$2(()=>{if(l1&&(c1.current=l1),s1&&(u1.current=s1),l1&&s1){if(R1.current)return R1.current(l1,s1,M1);M1()}},[l1,s1,M1,R1,_1]);const $1=y$2.useMemo(()=>({reference:c1,floating:u1,setReference:wf,setFloating:If}),[wf,If]),k1=y$2.useMemo(()=>({reference:l1,floating:s1}),[l1,s1]),F1=y$2.useMemo(()=>{const U1={position:bo,left:0,top:0};if(!k1.floating)return U1;const B1=Rs(k1.floating,pf.x),W1=Rs(k1.floating,pf.y);return df?{...U1,transform:"translate("+B1+"px, "+W1+"px)",...Ll(k1.floating)>=1.5&&{willChange:"transform"}}:{position:bo,left:B1,top:W1}},[bo,df,k1.floating,pf.x,pf.y]);return y$2.useMemo(()=>({...pf,update:M1,refs:$1,elements:k1,floatingStyles:F1}),[pf,M1,$1,k1,F1])}const Ib=vo=>{function Ai(bo){return{}.hasOwnProperty.call(bo,"current")}return{name:"arrow",options:vo,fn(bo){const{element:Ra,padding:pc}=typeof vo=="function"?vo(bo):vo;return Ra&&Ai(Ra)?Ra.current!=null?cs({element:Ra.current,padding:pc}).fn(bo):{}:Ra?cs({element:Ra,padding:pc}).fn(bo):{}}}},Eb=(vo,Ai)=>({...Nh(vo),options:[vo,Ai]}),Pb=(vo,Ai)=>({...Ah(vo),options:[vo,Ai]}),Tb=(vo,Ai)=>({...kh(vo),options:[vo,Ai]}),Ob=(vo,Ai)=>({...Dh(vo),options:[vo,Ai]}),Mb=(vo,Ai)=>({...Rh(vo),options:[vo,Ai]}),Nb=(vo,Ai)=>({..._h(vo),options:[vo,Ai]}),Ab=(vo,Ai)=>({...Ib(vo),options:[vo,Ai]});var Db="Arrow",$l=y$2.forwardRef((vo,Ai)=>{const{children:bo,width:Ra=10,height:pc=5,...mc}=vo;return jsx(we$1.svg,{...mc,ref:Ai,width:Ra,height:pc,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:vo.asChild?bo:jsx("polygon",{points:"0,0 30,0 15,10"})})});$l.displayName=Db;var Rb=$l;function _b(vo){const[Ai,bo]=y$2.useState(void 0);return Xt$1(()=>{if(vo){bo({width:vo.offsetWidth,height:vo.offsetHeight});const Ra=new ResizeObserver(pc=>{if(!Array.isArray(pc)||!pc.length)return;const mc=pc[0];let uf,df;if("borderBoxSize"in mc){const ff=mc.borderBoxSize,hf=Array.isArray(ff)?ff[0]:ff;uf=hf.inlineSize,df=hf.blockSize}else uf=vo.offsetWidth,df=vo.offsetHeight;bo({width:uf,height:df})});return Ra.observe(vo,{box:"border-box"}),()=>Ra.unobserve(vo)}else bo(void 0)},[vo]),Ai}var ni="Popper",[Ul,ao$1]=Wt$2(ni),[kb,Hl]=Ul(ni),Wl=vo=>{const{__scopePopper:Ai,children:bo}=vo,[Ra,pc]=y$2.useState(null);return jsx(kb,{scope:Ai,anchor:Ra,onAnchorChange:pc,children:bo})};Wl.displayName=ni;var Bl="PopperAnchor",zl=y$2.forwardRef((vo,Ai)=>{const{__scopePopper:bo,virtualRef:Ra,...pc}=vo,mc=Hl(Bl,bo),uf=y$2.useRef(null),df=Fe$2(Ai,uf);return y$2.useEffect(()=>{mc.onAnchorChange((Ra==null?void 0:Ra.current)||uf.current)}),Ra?null:jsx(we$1.div,{...pc,ref:df})});zl.displayName=Bl;var ri="PopperContent",[Fb,Vb]=Ul(ri),jl=y$2.forwardRef((vo,Ai)=>{var bo,Ra,pc,mc,uf,df;const{__scopePopper:ff,side:hf="bottom",sideOffset:pf=0,align:mf="center",alignOffset:gf=0,arrowPadding:yf=0,avoidCollisions:vf=!0,collisionBoundary:bf=[],collisionPadding:Sf=0,sticky:xf="partial",hideWhenDetached:wf=!1,updatePositionStrategy:If="optimized",onPlaced:l1,...s1}=vo,c1=Hl(ri,ff),[u1,T1]=y$2.useState(null),_1=Fe$2(Ai,nT=>T1(nT)),[R1,P1]=y$2.useState(null),E1=_b(R1),M1=(E1==null?void 0:E1.width)??0,m1=(E1==null?void 0:E1.height)??0,$1=hf+(mf!=="center"?"-"+mf:""),k1=typeof Sf=="number"?Sf:{top:0,right:0,bottom:0,left:0,...Sf},F1=Array.isArray(bf)?bf:[bf],U1=F1.length>0,B1={padding:k1,boundary:F1.filter($b),altBoundary:U1},{refs:W1,floatingStyles:Z1,placement:O1,isPositioned:j1,middlewareData:L1}=Cb({strategy:"fixed",placement:$1,whileElementsMounted:(...nT)=>cl(...nT,{animationFrame:If==="always"}),elements:{reference:c1.anchor},middleware:[Eb({mainAxis:pf+m1,alignmentAxis:gf}),vf&&Pb({mainAxis:!0,crossAxis:!1,limiter:xf==="partial"?Tb():void 0,...B1}),vf&&Ob({...B1}),Mb({...B1,apply:({elements:nT,rects:cT,availableWidth:N1,availableHeight:V1})=>{const{width:D1,height:d1}=cT.reference,f1=nT.floating.style;f1.setProperty("--radix-popper-available-width",`${N1}px`),f1.setProperty("--radix-popper-available-height",`${V1}px`),f1.setProperty("--radix-popper-anchor-width",`${D1}px`),f1.setProperty("--radix-popper-anchor-height",`${d1}px`)}}),R1&&Ab({element:R1,padding:yf}),Ub({arrowWidth:M1,arrowHeight:m1}),wf&&Nb({strategy:"referenceHidden",...B1})]}),[G1,Y1]=ql(O1),z1=at$2(l1);Xt$1(()=>{j1&&(z1==null||z1())},[j1,z1]);const K1=(bo=L1.arrow)==null?void 0:bo.x,tT=(Ra=L1.arrow)==null?void 0:Ra.y,iT=((pc=L1.arrow)==null?void 0:pc.centerOffset)!==0,[aT,oT]=y$2.useState();return Xt$1(()=>{u1&&oT(window.getComputedStyle(u1).zIndex)},[u1]),jsx("div",{ref:W1.setFloating,"data-radix-popper-content-wrapper":"",style:{...Z1,transform:j1?Z1.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:aT,"--radix-popper-transform-origin":[(mc=L1.transformOrigin)==null?void 0:mc.x,(uf=L1.transformOrigin)==null?void 0:uf.y].join(" "),...((df=L1.hide)==null?void 0:df.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:vo.dir,children:jsx(Fb,{scope:ff,placedSide:G1,onArrowChange:P1,arrowX:K1,arrowY:tT,shouldHideArrow:iT,children:jsx(we$1.div,{"data-side":G1,"data-align":Y1,...s1,ref:_1,style:{...s1.style,animation:j1?void 0:"none"}})})})});jl.displayName=ri;var Yl="PopperArrow",Lb={top:"bottom",right:"left",bottom:"top",left:"right"},Gl=y$2.forwardRef(function(vo,Ai){const{__scopePopper:bo,...Ra}=vo,pc=Vb(Yl,bo),mc=Lb[pc.placedSide];return jsx("span",{ref:pc.onArrowChange,style:{position:"absolute",left:pc.arrowX,top:pc.arrowY,[mc]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[pc.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[pc.placedSide],visibility:pc.shouldHideArrow?"hidden":void 0},children:jsx(Rb,{...Ra,ref:Ai,style:{...Ra.style,display:"block"}})})});Gl.displayName=Yl;function $b(vo){return vo!==null}var Ub=vo=>({name:"transformOrigin",options:vo,fn(Ai){var bo,Ra,pc;const{placement:mc,rects:uf,middlewareData:df}=Ai,ff=((bo=df.arrow)==null?void 0:bo.centerOffset)!==0,hf=ff?0:vo.arrowWidth,pf=ff?0:vo.arrowHeight,[mf,gf]=ql(mc),yf={start:"0%",center:"50%",end:"100%"}[gf],vf=(((Ra=df.arrow)==null?void 0:Ra.x)??0)+hf/2,bf=(((pc=df.arrow)==null?void 0:pc.y)??0)+pf/2;let Sf="",xf="";return mf==="bottom"?(Sf=ff?yf:`${vf}px`,xf=`${-pf}px`):mf==="top"?(Sf=ff?yf:`${vf}px`,xf=`${uf.floating.height+pf}px`):mf==="right"?(Sf=`${-pf}px`,xf=ff?yf:`${bf}px`):mf==="left"&&(Sf=`${uf.floating.width+pf}px`,xf=ff?yf:`${bf}px`),{data:{x:Sf,y:xf}}}});function ql(vo){const[Ai,bo="center"]=vo.split("-");return[Ai,bo]}var Xl=Wl,Kl=zl,Zl=jl,Ql=Gl,Hb="Portal",io$1=y$2.forwardRef((vo,Ai)=>{var bo;const{container:Ra,...pc}=vo,[mc,uf]=y$2.useState(!1);Xt$1(()=>uf(!0),[]);const df=Ra||mc&&((bo=globalThis==null?void 0:globalThis.document)==null?void 0:bo.body);return df?hc__default.createPortal(jsx(we$1.div,{...pc,ref:Ai}),df):null});io$1.displayName=Hb;function Wb(vo,Ai){return y$2.useReducer((bo,Ra)=>Ai[bo][Ra]??bo,vo)}var it$1=vo=>{const{present:Ai,children:bo}=vo,Ra=Bb(Ai),pc=typeof bo=="function"?bo({present:Ra.isPresent}):y$2.Children.only(bo),mc=Fe$2(Ra.ref,zb(pc));return typeof bo=="function"||Ra.isPresent?y$2.cloneElement(pc,{ref:mc}):null};it$1.displayName="Presence";function Bb(vo){const[Ai,bo]=y$2.useState(),Ra=y$2.useRef({}),pc=y$2.useRef(vo),mc=y$2.useRef("none"),uf=vo?"mounted":"unmounted",[df,ff]=Wb(uf,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y$2.useEffect(()=>{const hf=ur$2(Ra.current);mc.current=df==="mounted"?hf:"none"},[df]),Xt$1(()=>{const hf=Ra.current,pf=pc.current;if(pf!==vo){const mf=mc.current,gf=ur$2(hf);vo?ff("MOUNT"):gf==="none"||(hf==null?void 0:hf.display)==="none"?ff("UNMOUNT"):ff(pf&&mf!==gf?"ANIMATION_OUT":"UNMOUNT"),pc.current=vo}},[vo,ff]),Xt$1(()=>{if(Ai){let hf;const pf=Ai.ownerDocument.defaultView??window,mf=yf=>{const vf=ur$2(Ra.current).includes(yf.animationName);if(yf.target===Ai&&vf&&(ff("ANIMATION_END"),!pc.current)){const bf=Ai.style.animationFillMode;Ai.style.animationFillMode="forwards",hf=pf.setTimeout(()=>{Ai.style.animationFillMode==="forwards"&&(Ai.style.animationFillMode=bf)})}},gf=yf=>{yf.target===Ai&&(mc.current=ur$2(Ra.current))};return Ai.addEventListener("animationstart",gf),Ai.addEventListener("animationcancel",mf),Ai.addEventListener("animationend",mf),()=>{pf.clearTimeout(hf),Ai.removeEventListener("animationstart",gf),Ai.removeEventListener("animationcancel",mf),Ai.removeEventListener("animationend",mf)}}else ff("ANIMATION_END")},[Ai,ff]),{isPresent:["mounted","unmountSuspended"].includes(df),ref:y$2.useCallback(hf=>{hf&&(Ra.current=getComputedStyle(hf)),bo(hf)},[])}}function ur$2(vo){return(vo==null?void 0:vo.animationName)||"none"}function zb(vo){var Ai,bo;let Ra=(Ai=Object.getOwnPropertyDescriptor(vo.props,"ref"))==null?void 0:Ai.get,pc=Ra&&"isReactWarning"in Ra&&Ra.isReactWarning;return pc?vo.ref:(Ra=(bo=Object.getOwnPropertyDescriptor(vo,"ref"))==null?void 0:bo.get,pc=Ra&&"isReactWarning"in Ra&&Ra.isReactWarning,pc?vo.props.ref:vo.props.ref||vo.ref)}var Yo$1="rovingFocusGroup.onEntryFocus",jb={bubbles:!1,cancelable:!0},so$1="RovingFocusGroup",[Ea,Jl,Yb]=Rl(so$1),[Gb,co$1]=Wt$2(so$1,[Yb]),[qb,Xb]=Gb(so$1),eu=y$2.forwardRef((vo,Ai)=>jsx(Ea.Provider,{scope:vo.__scopeRovingFocusGroup,children:jsx(Ea.Slot,{scope:vo.__scopeRovingFocusGroup,children:jsx(Kb,{...vo,ref:Ai})})}));eu.displayName=so$1;var Kb=y$2.forwardRef((vo,Ai)=>{const{__scopeRovingFocusGroup:bo,orientation:Ra,loop:pc=!1,dir:mc,currentTabStopId:uf,defaultCurrentTabStopId:df,onCurrentTabStopIdChange:ff,onEntryFocus:hf,preventScrollOnEntryFocus:pf=!1,...mf}=vo,gf=y$2.useRef(null),yf=Fe$2(Ai,gf),vf=ei(mc),[bf=null,Sf]=Qn$2({prop:uf,defaultProp:df,onChange:ff}),[xf,wf]=y$2.useState(!1),If=at$2(hf),l1=Jl(bo),s1=y$2.useRef(!1),[c1,u1]=y$2.useState(0);return y$2.useEffect(()=>{const T1=gf.current;if(T1)return T1.addEventListener(Yo$1,If),()=>T1.removeEventListener(Yo$1,If)},[If]),jsx(qb,{scope:bo,orientation:Ra,dir:vf,loop:pc,currentTabStopId:bf,onItemFocus:y$2.useCallback(T1=>Sf(T1),[Sf]),onItemShiftTab:y$2.useCallback(()=>wf(!0),[]),onFocusableItemAdd:y$2.useCallback(()=>u1(T1=>T1+1),[]),onFocusableItemRemove:y$2.useCallback(()=>u1(T1=>T1-1),[]),children:jsx(we$1.div,{tabIndex:xf||c1===0?-1:0,"data-orientation":Ra,...mf,ref:yf,style:{outline:"none",...vo.style},onMouseDown:re$2(vo.onMouseDown,()=>{s1.current=!0}),onFocus:re$2(vo.onFocus,T1=>{const _1=!s1.current;if(T1.target===T1.currentTarget&&_1&&!xf){const R1=new CustomEvent(Yo$1,jb);if(T1.currentTarget.dispatchEvent(R1),!R1.defaultPrevented){const P1=l1().filter($1=>$1.focusable),E1=P1.find($1=>$1.active),M1=P1.find($1=>$1.id===bf),m1=[E1,M1,...P1].filter(Boolean).map($1=>$1.ref.current);ru(m1,pf)}}s1.current=!1}),onBlur:re$2(vo.onBlur,()=>wf(!1))})})}),tu="RovingFocusGroupItem",nu=y$2.forwardRef((vo,Ai)=>{const{__scopeRovingFocusGroup:bo,focusable:Ra=!0,active:pc=!1,tabStopId:mc,...uf}=vo,df=Ft$2(),ff=mc||df,hf=Xb(tu,bo),pf=hf.currentTabStopId===ff,mf=Jl(bo),{onFocusableItemAdd:gf,onFocusableItemRemove:yf}=hf;return y$2.useEffect(()=>{if(Ra)return gf(),()=>yf()},[Ra,gf,yf]),jsx(Ea.ItemSlot,{scope:bo,id:ff,focusable:Ra,active:pc,children:jsx(we$1.span,{tabIndex:pf?0:-1,"data-orientation":hf.orientation,...uf,ref:Ai,onMouseDown:re$2(vo.onMouseDown,vf=>{Ra?hf.onItemFocus(ff):vf.preventDefault()}),onFocus:re$2(vo.onFocus,()=>hf.onItemFocus(ff)),onKeyDown:re$2(vo.onKeyDown,vf=>{if(vf.key==="Tab"&&vf.shiftKey){hf.onItemShiftTab();return}if(vf.target!==vf.currentTarget)return;const bf=Jb(vf,hf.orientation,hf.dir);if(bf!==void 0){if(vf.metaKey||vf.ctrlKey||vf.altKey||vf.shiftKey)return;vf.preventDefault();let Sf=mf().filter(xf=>xf.focusable).map(xf=>xf.ref.current);if(bf==="last")Sf.reverse();else if(bf==="prev"||bf==="next"){bf==="prev"&&Sf.reverse();const xf=Sf.indexOf(vf.currentTarget);Sf=hf.loop?ey(Sf,xf+1):Sf.slice(xf+1)}setTimeout(()=>ru(Sf))}})})})});nu.displayName=tu;var Zb={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Qb(vo,Ai){return Ai!=="rtl"?vo:vo==="ArrowLeft"?"ArrowRight":vo==="ArrowRight"?"ArrowLeft":vo}function Jb(vo,Ai,bo){const Ra=Qb(vo.key,bo);if(!(Ai==="vertical"&&["ArrowLeft","ArrowRight"].includes(Ra))&&!(Ai==="horizontal"&&["ArrowUp","ArrowDown"].includes(Ra)))return Zb[Ra]}function ru(vo,Ai=!1){const bo=document.activeElement;for(const Ra of vo)if(Ra===bo||(Ra.focus({preventScroll:Ai}),document.activeElement!==bo))return}function ey(vo,Ai){return vo.map((bo,Ra)=>vo[(Ai+Ra)%vo.length])}var ou=eu,au=nu,ty=function(vo){if(typeof document>"u")return null;var Ai=Array.isArray(vo)?vo[0]:vo;return Ai.ownerDocument.body},tn$1=new WeakMap,dr$1=new WeakMap,fr$2={},Go$1=0,iu=function(vo){return vo&&(vo.host||iu(vo.parentNode))},ny=function(vo,Ai){return Ai.map(function(bo){if(vo.contains(bo))return bo;var Ra=iu(bo);return Ra&&vo.contains(Ra)?Ra:(console.error("aria-hidden",bo,"in not contained inside",vo,". Doing nothing"),null)}).filter(function(bo){return!!bo})},ry=function(vo,Ai,bo,Ra){var pc=ny(Ai,Array.isArray(vo)?vo:[vo]);fr$2[bo]||(fr$2[bo]=new WeakMap);var mc=fr$2[bo],uf=[],df=new Set,ff=new Set(pc),hf=function(mf){!mf||df.has(mf)||(df.add(mf),hf(mf.parentNode))};pc.forEach(hf);var pf=function(mf){!mf||ff.has(mf)||Array.prototype.forEach.call(mf.children,function(gf){if(df.has(gf))pf(gf);else try{var yf=gf.getAttribute(Ra),vf=yf!==null&&yf!=="false",bf=(tn$1.get(gf)||0)+1,Sf=(mc.get(gf)||0)+1;tn$1.set(gf,bf),mc.set(gf,Sf),uf.push(gf),bf===1&&vf&&dr$1.set(gf,!0),Sf===1&&gf.setAttribute(bo,"true"),vf||gf.setAttribute(Ra,"true")}catch(xf){console.error("aria-hidden: cannot operate on ",gf,xf)}})};return pf(Ai),df.clear(),Go$1++,function(){uf.forEach(function(mf){var gf=tn$1.get(mf)-1,yf=mc.get(mf)-1;tn$1.set(mf,gf),mc.set(mf,yf),gf||(dr$1.has(mf)||mf.removeAttribute(Ra),dr$1.delete(mf)),yf||mf.removeAttribute(bo)}),Go$1--,Go$1||(tn$1=new WeakMap,tn$1=new WeakMap,dr$1=new WeakMap,fr$2={})}},su=function(vo,Ai,bo){bo===void 0&&(bo="data-aria-hidden");var Ra=Array.from(Array.isArray(vo)?vo:[vo]),pc=ty(vo);return pc?(Ra.push.apply(Ra,Array.from(pc.querySelectorAll("[aria-live]"))),ry(Ra,pc,bo,"aria-hidden")):function(){return null}},mt$2=function(){return mt$2=Object.assign||function(vo){for(var Ai,bo=1,Ra=arguments.length;bo<Ra;bo++){Ai=arguments[bo];for(var pc in Ai)Object.prototype.hasOwnProperty.call(Ai,pc)&&(vo[pc]=Ai[pc])}return vo},mt$2.apply(this,arguments)};function cu(vo,Ai){var bo={};for(var Ra in vo)Object.prototype.hasOwnProperty.call(vo,Ra)&&Ai.indexOf(Ra)<0&&(bo[Ra]=vo[Ra]);if(vo!=null&&typeof Object.getOwnPropertySymbols=="function")for(var pc=0,Ra=Object.getOwnPropertySymbols(vo);pc<Ra.length;pc++)Ai.indexOf(Ra[pc])<0&&Object.prototype.propertyIsEnumerable.call(vo,Ra[pc])&&(bo[Ra[pc]]=vo[Ra[pc]]);return bo}function oy(vo,Ai,bo){for(var Ra=0,pc=Ai.length,mc;Ra<pc;Ra++)(mc||!(Ra in Ai))&&(mc||(mc=Array.prototype.slice.call(Ai,0,Ra)),mc[Ra]=Ai[Ra]);return vo.concat(mc||Array.prototype.slice.call(Ai))}var Cr$2="right-scroll-bar-position",Ir$2="width-before-scroll-bar",ay="with-scroll-bars-hidden",iy="--removed-body-scroll-bar-size";function qo$1(vo,Ai){return typeof vo=="function"?vo(Ai):vo&&(vo.current=Ai),vo}function sy(vo,Ai){var bo=useState(function(){return{value:vo,callback:Ai,facade:{get current(){return bo.value},set current(Ra){var pc=bo.value;pc!==Ra&&(bo.value=Ra,bo.callback(Ra,pc))}}}})[0];return bo.callback=Ai,bo.facade}var cy=typeof window<"u"?y$2.useLayoutEffect:y$2.useEffect,_s$1=new WeakMap;function ly(vo,Ai){var bo=sy(null,function(Ra){return vo.forEach(function(pc){return qo$1(pc,Ra)})});return cy(function(){var Ra=_s$1.get(bo);if(Ra){var pc=new Set(Ra),mc=new Set(vo),uf=bo.current;pc.forEach(function(df){mc.has(df)||qo$1(df,null)}),mc.forEach(function(df){pc.has(df)||qo$1(df,uf)})}_s$1.set(bo,vo)},[vo]),bo}function uy(vo){return vo}function dy(vo,Ai){Ai===void 0&&(Ai=uy);var bo=[],Ra=!1,pc={read:function(){if(Ra)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return bo.length?bo[bo.length-1]:vo},useMedium:function(mc){var uf=Ai(mc,Ra);return bo.push(uf),function(){bo=bo.filter(function(df){return df!==uf})}},assignSyncMedium:function(mc){for(Ra=!0;bo.length;){var uf=bo;bo=[],uf.forEach(mc)}bo={push:function(df){return mc(df)},filter:function(){return bo}}},assignMedium:function(mc){Ra=!0;var uf=[];if(bo.length){var df=bo;bo=[],df.forEach(mc),uf=bo}var ff=function(){var pf=uf;uf=[],pf.forEach(mc)},hf=function(){return Promise.resolve().then(ff)};hf(),bo={push:function(pf){uf.push(pf),hf()},filter:function(pf){return uf=uf.filter(pf),bo}}}};return pc}function fy(vo){vo===void 0&&(vo={});var Ai=dy(null);return Ai.options=mt$2({async:!0,ssr:!1},vo),Ai}var lu=function(vo){var Ai=vo.sideCar,bo=cu(vo,["sideCar"]);if(!Ai)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var Ra=Ai.read();if(!Ra)throw new Error("Sidecar medium not found");return y$2.createElement(Ra,mt$2({},bo))};lu.isSideCarExport=!0;function my(vo,Ai){return vo.useMedium(Ai),lu}var uu=fy(),Xo$1=function(){},lo$1=y$2.forwardRef(function(vo,Ai){var bo=y$2.useRef(null),Ra=y$2.useState({onScrollCapture:Xo$1,onWheelCapture:Xo$1,onTouchMoveCapture:Xo$1}),pc=Ra[0],mc=Ra[1],uf=vo.forwardProps,df=vo.children,ff=vo.className,hf=vo.removeScrollBar,pf=vo.enabled,mf=vo.shards,gf=vo.sideCar,yf=vo.noIsolation,vf=vo.inert,bf=vo.allowPinchZoom,Sf=vo.as,xf=Sf===void 0?"div":Sf,wf=vo.gapMode,If=cu(vo,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),l1=gf,s1=ly([bo,Ai]),c1=mt$2(mt$2({},If),pc);return y$2.createElement(y$2.Fragment,null,pf&&y$2.createElement(l1,{sideCar:uu,removeScrollBar:hf,shards:mf,noIsolation:yf,inert:vf,setCallbacks:mc,allowPinchZoom:!!bf,lockRef:bo,gapMode:wf}),uf?y$2.cloneElement(y$2.Children.only(df),mt$2(mt$2({},c1),{ref:s1})):y$2.createElement(xf,mt$2({},c1,{className:ff,ref:s1}),df))});lo$1.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};lo$1.classNames={fullWidth:Ir$2,zeroRight:Cr$2};var py=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function hy(){if(!document)return null;var vo=document.createElement("style");vo.type="text/css";var Ai=py();return Ai&&vo.setAttribute("nonce",Ai),vo}function gy(vo,Ai){vo.styleSheet?vo.styleSheet.cssText=Ai:vo.appendChild(document.createTextNode(Ai))}function vy(vo){var Ai=document.head||document.getElementsByTagName("head")[0];Ai.appendChild(vo)}var by=function(){var vo=0,Ai=null;return{add:function(bo){vo==0&&(Ai=hy())&&(gy(Ai,bo),vy(Ai)),vo++},remove:function(){vo--,!vo&&Ai&&(Ai.parentNode&&Ai.parentNode.removeChild(Ai),Ai=null)}}},yy=function(){var vo=by();return function(Ai,bo){y$2.useEffect(function(){return vo.add(Ai),function(){vo.remove()}},[Ai&&bo])}},du=function(){var vo=yy(),Ai=function(bo){var Ra=bo.styles,pc=bo.dynamic;return vo(Ra,pc),null};return Ai},wy={left:0,top:0,right:0,gap:0},Ko=function(vo){return parseInt(vo||"",10)||0},xy=function(vo){var Ai=window.getComputedStyle(document.body),bo=Ai[vo==="padding"?"paddingLeft":"marginLeft"],Ra=Ai[vo==="padding"?"paddingTop":"marginTop"],pc=Ai[vo==="padding"?"paddingRight":"marginRight"];return[Ko(bo),Ko(Ra),Ko(pc)]},Sy=function(vo){if(vo===void 0&&(vo="margin"),typeof window>"u")return wy;var Ai=xy(vo),bo=document.documentElement.clientWidth,Ra=window.innerWidth;return{left:Ai[0],top:Ai[1],right:Ai[2],gap:Math.max(0,Ra-bo+Ai[2]-Ai[0])}},Cy=du(),dn$1="data-scroll-locked",Iy=function(vo,Ai,bo,Ra){var pc=vo.left,mc=vo.top,uf=vo.right,df=vo.gap;return bo===void 0&&(bo="margin"),`
|
|
15
|
-
.`.concat(ay,` {
|
|
16
|
-
overflow: hidden `).concat(Ra,`;
|
|
17
|
-
padding-right: `).concat(df,"px ").concat(Ra,`;
|
|
18
|
-
}
|
|
19
|
-
body[`).concat(dn$1,`] {
|
|
20
|
-
overflow: hidden `).concat(Ra,`;
|
|
21
|
-
overscroll-behavior: contain;
|
|
22
|
-
`).concat([Ai&&"position: relative ".concat(Ra,";"),bo==="margin"&&`
|
|
23
|
-
padding-left: `.concat(pc,`px;
|
|
24
|
-
padding-top: `).concat(mc,`px;
|
|
25
|
-
padding-right: `).concat(uf,`px;
|
|
26
|
-
margin-left:0;
|
|
27
|
-
margin-top:0;
|
|
28
|
-
margin-right: `).concat(df,"px ").concat(Ra,`;
|
|
29
|
-
`),bo==="padding"&&"padding-right: ".concat(df,"px ").concat(Ra,";")].filter(Boolean).join(""),`
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.`).concat(Cr$2,` {
|
|
33
|
-
right: `).concat(df,"px ").concat(Ra,`;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.`).concat(Ir$2,` {
|
|
37
|
-
margin-right: `).concat(df,"px ").concat(Ra,`;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.`).concat(Cr$2," .").concat(Cr$2,` {
|
|
41
|
-
right: 0 `).concat(Ra,`;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.`).concat(Ir$2," .").concat(Ir$2,` {
|
|
45
|
-
margin-right: 0 `).concat(Ra,`;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
body[`).concat(dn$1,`] {
|
|
49
|
-
`).concat(iy,": ").concat(df,`px;
|
|
50
|
-
}
|
|
51
|
-
`)},ks$1=function(){var vo=parseInt(document.body.getAttribute(dn$1)||"0",10);return isFinite(vo)?vo:0},Ey=function(){y$2.useEffect(function(){return document.body.setAttribute(dn$1,(ks$1()+1).toString()),function(){var vo=ks$1()-1;vo<=0?document.body.removeAttribute(dn$1):document.body.setAttribute(dn$1,vo.toString())}},[])},Py=function(vo){var Ai=vo.noRelative,bo=vo.noImportant,Ra=vo.gapMode,pc=Ra===void 0?"margin":Ra;Ey();var mc=y$2.useMemo(function(){return Sy(pc)},[pc]);return y$2.createElement(Cy,{styles:Iy(mc,!Ai,pc,bo?"":"!important")})},Pa=!1;if(typeof window<"u")try{var mr$2=Object.defineProperty({},"passive",{get:function(){return Pa=!0,!0}});window.addEventListener("test",mr$2,mr$2),window.removeEventListener("test",mr$2,mr$2)}catch{Pa=!1}var nn$1=Pa?{passive:!1}:!1,Ty=function(vo){return vo.tagName==="TEXTAREA"},fu=function(vo,Ai){if(!(vo instanceof Element))return!1;var bo=window.getComputedStyle(vo);return bo[Ai]!=="hidden"&&!(bo.overflowY===bo.overflowX&&!Ty(vo)&&bo[Ai]==="visible")},Oy=function(vo){return fu(vo,"overflowY")},My=function(vo){return fu(vo,"overflowX")},Fs$1=function(vo,Ai){var bo=Ai.ownerDocument,Ra=Ai;do{typeof ShadowRoot<"u"&&Ra instanceof ShadowRoot&&(Ra=Ra.host);var pc=mu(vo,Ra);if(pc){var mc=pu(vo,Ra),uf=mc[1],df=mc[2];if(uf>df)return!0}Ra=Ra.parentNode}while(Ra&&Ra!==bo.body);return!1},Ny=function(vo){var Ai=vo.scrollTop,bo=vo.scrollHeight,Ra=vo.clientHeight;return[Ai,bo,Ra]},Ay=function(vo){var Ai=vo.scrollLeft,bo=vo.scrollWidth,Ra=vo.clientWidth;return[Ai,bo,Ra]},mu=function(vo,Ai){return vo==="v"?Oy(Ai):My(Ai)},pu=function(vo,Ai){return vo==="v"?Ny(Ai):Ay(Ai)},Dy=function(vo,Ai){return vo==="h"&&Ai==="rtl"?-1:1},Ry=function(vo,Ai,bo,Ra,pc){var mc=Dy(vo,window.getComputedStyle(Ai).direction),uf=mc*Ra,df=bo.target,ff=Ai.contains(df),hf=!1,pf=uf>0,mf=0,gf=0;do{var yf=pu(vo,df),vf=yf[0],bf=yf[1],Sf=yf[2],xf=bf-Sf-mc*vf;(vf||xf)&&mu(vo,df)&&(mf+=xf,gf+=vf),df instanceof ShadowRoot?df=df.host:df=df.parentNode}while(!ff&&df!==document.body||ff&&(Ai.contains(df)||Ai===df));return(pf&&(Math.abs(mf)<1||!pc)||!pf&&(Math.abs(gf)<1||!pc))&&(hf=!0),hf},pr$2=function(vo){return"changedTouches"in vo?[vo.changedTouches[0].clientX,vo.changedTouches[0].clientY]:[0,0]},Vs=function(vo){return[vo.deltaX,vo.deltaY]},Ls=function(vo){return vo&&"current"in vo?vo.current:vo},_y=function(vo,Ai){return vo[0]===Ai[0]&&vo[1]===Ai[1]},ky=function(vo){return`
|
|
52
|
-
.block-interactivity-`.concat(vo,` {pointer-events: none;}
|
|
53
|
-
.allow-interactivity-`).concat(vo,` {pointer-events: all;}
|
|
54
|
-
`)},Fy=0,rn$1=[];function Vy(vo){var Ai=y$2.useRef([]),bo=y$2.useRef([0,0]),Ra=y$2.useRef(),pc=y$2.useState(Fy++)[0],mc=y$2.useState(du)[0],uf=y$2.useRef(vo);y$2.useEffect(function(){uf.current=vo},[vo]),y$2.useEffect(function(){if(vo.inert){document.body.classList.add("block-interactivity-".concat(pc));var bf=oy([vo.lockRef.current],(vo.shards||[]).map(Ls)).filter(Boolean);return bf.forEach(function(Sf){return Sf.classList.add("allow-interactivity-".concat(pc))}),function(){document.body.classList.remove("block-interactivity-".concat(pc)),bf.forEach(function(Sf){return Sf.classList.remove("allow-interactivity-".concat(pc))})}}},[vo.inert,vo.lockRef.current,vo.shards]);var df=y$2.useCallback(function(bf,Sf){if("touches"in bf&&bf.touches.length===2||bf.type==="wheel"&&bf.ctrlKey)return!uf.current.allowPinchZoom;var xf=pr$2(bf),wf=bo.current,If="deltaX"in bf?bf.deltaX:wf[0]-xf[0],l1="deltaY"in bf?bf.deltaY:wf[1]-xf[1],s1,c1=bf.target,u1=Math.abs(If)>Math.abs(l1)?"h":"v";if("touches"in bf&&u1==="h"&&c1.type==="range")return!1;var T1=Fs$1(u1,c1);if(!T1)return!0;if(T1?s1=u1:(s1=u1==="v"?"h":"v",T1=Fs$1(u1,c1)),!T1)return!1;if(!Ra.current&&"changedTouches"in bf&&(If||l1)&&(Ra.current=s1),!s1)return!0;var _1=Ra.current||s1;return Ry(_1,Sf,bf,_1==="h"?If:l1,!0)},[]),ff=y$2.useCallback(function(bf){var Sf=bf;if(!(!rn$1.length||rn$1[rn$1.length-1]!==mc)){var xf="deltaY"in Sf?Vs(Sf):pr$2(Sf),wf=Ai.current.filter(function(s1){return s1.name===Sf.type&&(s1.target===Sf.target||Sf.target===s1.shadowParent)&&_y(s1.delta,xf)})[0];if(wf&&wf.should){Sf.cancelable&&Sf.preventDefault();return}if(!wf){var If=(uf.current.shards||[]).map(Ls).filter(Boolean).filter(function(s1){return s1.contains(Sf.target)}),l1=If.length>0?df(Sf,If[0]):!uf.current.noIsolation;l1&&Sf.cancelable&&Sf.preventDefault()}}},[]),hf=y$2.useCallback(function(bf,Sf,xf,wf){var If={name:bf,delta:Sf,target:xf,should:wf,shadowParent:Ly(xf)};Ai.current.push(If),setTimeout(function(){Ai.current=Ai.current.filter(function(l1){return l1!==If})},1)},[]),pf=y$2.useCallback(function(bf){bo.current=pr$2(bf),Ra.current=void 0},[]),mf=y$2.useCallback(function(bf){hf(bf.type,Vs(bf),bf.target,df(bf,vo.lockRef.current))},[]),gf=y$2.useCallback(function(bf){hf(bf.type,pr$2(bf),bf.target,df(bf,vo.lockRef.current))},[]);y$2.useEffect(function(){return rn$1.push(mc),vo.setCallbacks({onScrollCapture:mf,onWheelCapture:mf,onTouchMoveCapture:gf}),document.addEventListener("wheel",ff,nn$1),document.addEventListener("touchmove",ff,nn$1),document.addEventListener("touchstart",pf,nn$1),function(){rn$1=rn$1.filter(function(bf){return bf!==mc}),document.removeEventListener("wheel",ff,nn$1),document.removeEventListener("touchmove",ff,nn$1),document.removeEventListener("touchstart",pf,nn$1)}},[]);var yf=vo.removeScrollBar,vf=vo.inert;return y$2.createElement(y$2.Fragment,null,vf?y$2.createElement(mc,{styles:ky(pc)}):null,yf?y$2.createElement(Py,{gapMode:vo.gapMode}):null)}function Ly(vo){for(var Ai=null;vo!==null;)vo instanceof ShadowRoot&&(Ai=vo.host,vo=vo.host),vo=vo.parentNode;return Ai}const $y=my(uu,Vy);var oi=y$2.forwardRef(function(vo,Ai){return y$2.createElement(lo$1,mt$2({},vo,{ref:Ai,sideCar:$y}))});oi.classNames=lo$1.classNames;var Ta=["Enter"," "],Uy=["ArrowDown","PageUp","Home"],hu=["ArrowUp","PageDown","End"],Hy=[...Uy,...hu],Wy={ltr:[...Ta,"ArrowRight"],rtl:[...Ta,"ArrowLeft"]},By={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Jn$2="Menu",[Wn$2,zy,jy]=Rl(Jn$2),[Zt$1,gu]=Wt$2(Jn$2,[jy,ao$1,co$1]),uo=ao$1(),vu=co$1(),[Yy,Qt$2]=Zt$1(Jn$2),[Gy,er$1]=Zt$1(Jn$2),bu=vo=>{const{__scopeMenu:Ai,open:bo=!1,children:Ra,dir:pc,onOpenChange:mc,modal:uf=!0}=vo,df=uo(Ai),[ff,hf]=y$2.useState(null),pf=y$2.useRef(!1),mf=at$2(mc),gf=ei(pc);return y$2.useEffect(()=>{const yf=()=>{pf.current=!0,document.addEventListener("pointerdown",vf,{capture:!0,once:!0}),document.addEventListener("pointermove",vf,{capture:!0,once:!0})},vf=()=>pf.current=!1;return document.addEventListener("keydown",yf,{capture:!0}),()=>{document.removeEventListener("keydown",yf,{capture:!0}),document.removeEventListener("pointerdown",vf,{capture:!0}),document.removeEventListener("pointermove",vf,{capture:!0})}},[]),jsx(Xl,{...df,children:jsx(Yy,{scope:Ai,open:bo,onOpenChange:mf,content:ff,onContentChange:hf,children:jsx(Gy,{scope:Ai,onClose:y$2.useCallback(()=>mf(!1),[mf]),isUsingKeyboardRef:pf,dir:gf,modal:uf,children:Ra})})})};bu.displayName=Jn$2;var qy="MenuAnchor",ai=y$2.forwardRef((vo,Ai)=>{const{__scopeMenu:bo,...Ra}=vo,pc=uo(bo);return jsx(Kl,{...pc,...Ra,ref:Ai})});ai.displayName=qy;var ii="MenuPortal",[Xy,yu]=Zt$1(ii,{forceMount:void 0}),wu=vo=>{const{__scopeMenu:Ai,forceMount:bo,children:Ra,container:pc}=vo,mc=Qt$2(ii,Ai);return jsx(Xy,{scope:Ai,forceMount:bo,children:jsx(it$1,{present:bo||mc.open,children:jsx(io$1,{asChild:!0,container:pc,children:Ra})})})};wu.displayName=ii;var et$2="MenuContent",[Ky,si]=Zt$1(et$2),xu=y$2.forwardRef((vo,Ai)=>{const bo=yu(et$2,vo.__scopeMenu),{forceMount:Ra=bo.forceMount,...pc}=vo,mc=Qt$2(et$2,vo.__scopeMenu),uf=er$1(et$2,vo.__scopeMenu);return jsx(Wn$2.Provider,{scope:vo.__scopeMenu,children:jsx(it$1,{present:Ra||mc.open,children:jsx(Wn$2.Slot,{scope:vo.__scopeMenu,children:uf.modal?jsx(Zy,{...pc,ref:Ai}):jsx(Qy,{...pc,ref:Ai})})})})}),Zy=y$2.forwardRef((vo,Ai)=>{const bo=Qt$2(et$2,vo.__scopeMenu),Ra=y$2.useRef(null),pc=Fe$2(Ai,Ra);return y$2.useEffect(()=>{const mc=Ra.current;if(mc)return su(mc)},[]),jsx(ci,{...vo,ref:pc,trapFocus:bo.open,disableOutsidePointerEvents:bo.open,disableOutsideScroll:!0,onFocusOutside:re$2(vo.onFocusOutside,mc=>mc.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>bo.onOpenChange(!1)})}),Qy=y$2.forwardRef((vo,Ai)=>{const bo=Qt$2(et$2,vo.__scopeMenu);return jsx(ci,{...vo,ref:Ai,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>bo.onOpenChange(!1)})}),ci=y$2.forwardRef((vo,Ai)=>{const{__scopeMenu:bo,loop:Ra=!1,trapFocus:pc,onOpenAutoFocus:mc,onCloseAutoFocus:uf,disableOutsidePointerEvents:df,onEntryFocus:ff,onEscapeKeyDown:hf,onPointerDownOutside:pf,onFocusOutside:mf,onInteractOutside:gf,onDismiss:yf,disableOutsideScroll:vf,...bf}=vo,Sf=Qt$2(et$2,bo),xf=er$1(et$2,bo),wf=uo(bo),If=vu(bo),l1=zy(bo),[s1,c1]=y$2.useState(null),u1=y$2.useRef(null),T1=Fe$2(Ai,u1,Sf.onContentChange),_1=y$2.useRef(0),R1=y$2.useRef(""),P1=y$2.useRef(0),E1=y$2.useRef(null),M1=y$2.useRef("right"),m1=y$2.useRef(0),$1=vf?oi:y$2.Fragment,k1=vf?{as:mn$1,allowPinchZoom:!0}:void 0,F1=B1=>{var W1,Z1;const O1=R1.current+B1,j1=l1().filter(tT=>!tT.disabled),L1=document.activeElement,G1=(W1=j1.find(tT=>tT.ref.current===L1))==null?void 0:W1.textValue,Y1=j1.map(tT=>tT.textValue),z1=u0(Y1,O1,G1),K1=(Z1=j1.find(tT=>tT.textValue===z1))==null?void 0:Z1.ref.current;(function tT(iT){R1.current=iT,window.clearTimeout(_1.current),iT!==""&&(_1.current=window.setTimeout(()=>tT(""),1e3))})(O1),K1&&setTimeout(()=>K1.focus())};y$2.useEffect(()=>()=>window.clearTimeout(_1.current),[]),Fl();const U1=y$2.useCallback(B1=>{var W1,Z1;return M1.current===((W1=E1.current)==null?void 0:W1.side)&&f0(B1,(Z1=E1.current)==null?void 0:Z1.area)},[]);return jsx(Ky,{scope:bo,searchRef:R1,onItemEnter:y$2.useCallback(B1=>{U1(B1)&&B1.preventDefault()},[U1]),onItemLeave:y$2.useCallback(B1=>{var W1;U1(B1)||((W1=u1.current)==null||W1.focus(),c1(null))},[U1]),onTriggerLeave:y$2.useCallback(B1=>{U1(B1)&&B1.preventDefault()},[U1]),pointerGraceTimerRef:P1,onPointerGraceIntentChange:y$2.useCallback(B1=>{E1.current=B1},[]),children:jsx($1,{...k1,children:jsx(ti,{asChild:!0,trapped:pc,onMountAutoFocus:re$2(mc,B1=>{var W1;B1.preventDefault(),(W1=u1.current)==null||W1.focus({preventScroll:!0})}),onUnmountAutoFocus:uf,children:jsx(oo$1,{asChild:!0,disableOutsidePointerEvents:df,onEscapeKeyDown:hf,onPointerDownOutside:pf,onFocusOutside:mf,onInteractOutside:gf,onDismiss:yf,children:jsx(ou,{asChild:!0,...If,dir:xf.dir,orientation:"vertical",loop:Ra,currentTabStopId:s1,onCurrentTabStopIdChange:c1,onEntryFocus:re$2(ff,B1=>{xf.isUsingKeyboardRef.current||B1.preventDefault()}),preventScrollOnEntryFocus:!0,children:jsx(Zl,{role:"menu","aria-orientation":"vertical","data-state":Vu(Sf.open),"data-radix-menu-content":"",dir:xf.dir,...wf,...bf,ref:T1,style:{outline:"none",...bf.style},onKeyDown:re$2(bf.onKeyDown,B1=>{const W1=B1.target.closest("[data-radix-menu-content]")===B1.currentTarget,Z1=B1.ctrlKey||B1.altKey||B1.metaKey,O1=B1.key.length===1;W1&&(B1.key==="Tab"&&B1.preventDefault(),!Z1&&O1&&F1(B1.key));const j1=u1.current;if(B1.target!==j1||!Hy.includes(B1.key))return;B1.preventDefault();const L1=l1().filter(G1=>!G1.disabled).map(G1=>G1.ref.current);hu.includes(B1.key)&&L1.reverse(),c0(L1)}),onBlur:re$2(vo.onBlur,B1=>{B1.currentTarget.contains(B1.target)||(window.clearTimeout(_1.current),R1.current="")}),onPointerMove:re$2(vo.onPointerMove,Bn$1(B1=>{const W1=B1.target,Z1=m1.current!==B1.clientX;if(B1.currentTarget.contains(W1)&&Z1){const O1=B1.clientX>m1.current?"right":"left";M1.current=O1,m1.current=B1.clientX}}))})})})})})})});xu.displayName=et$2;var Jy="MenuGroup",li=y$2.forwardRef((vo,Ai)=>{const{__scopeMenu:bo,...Ra}=vo;return jsx(we$1.div,{role:"group",...Ra,ref:Ai})});li.displayName=Jy;var e0="MenuLabel",Su=y$2.forwardRef((vo,Ai)=>{const{__scopeMenu:bo,...Ra}=vo;return jsx(we$1.div,{...Ra,ref:Ai})});Su.displayName=e0;var Lr$2="MenuItem",$s="menu.itemSelect",fo$1=y$2.forwardRef((vo,Ai)=>{const{disabled:bo=!1,onSelect:Ra,...pc}=vo,mc=y$2.useRef(null),uf=er$1(Lr$2,vo.__scopeMenu),df=si(Lr$2,vo.__scopeMenu),ff=Fe$2(Ai,mc),hf=y$2.useRef(!1),pf=()=>{const mf=mc.current;if(!bo&&mf){const gf=new CustomEvent($s,{bubbles:!0,cancelable:!0});mf.addEventListener($s,yf=>Ra==null?void 0:Ra(yf),{once:!0}),_c(mf,gf),gf.defaultPrevented?hf.current=!1:uf.onClose()}};return jsx(Cu,{...pc,ref:ff,disabled:bo,onClick:re$2(vo.onClick,pf),onPointerDown:mf=>{var gf;(gf=vo.onPointerDown)==null||gf.call(vo,mf),hf.current=!0},onPointerUp:re$2(vo.onPointerUp,mf=>{var gf;hf.current||(gf=mf.currentTarget)==null||gf.click()}),onKeyDown:re$2(vo.onKeyDown,mf=>{const gf=df.searchRef.current!=="";bo||gf&&mf.key===" "||Ta.includes(mf.key)&&(mf.currentTarget.click(),mf.preventDefault())})})});fo$1.displayName=Lr$2;var Cu=y$2.forwardRef((vo,Ai)=>{const{__scopeMenu:bo,disabled:Ra=!1,textValue:pc,...mc}=vo,uf=si(Lr$2,bo),df=vu(bo),ff=y$2.useRef(null),hf=Fe$2(Ai,ff),[pf,mf]=y$2.useState(!1),[gf,yf]=y$2.useState("");return y$2.useEffect(()=>{const vf=ff.current;vf&&yf((vf.textContent??"").trim())},[mc.children]),jsx(Wn$2.ItemSlot,{scope:bo,disabled:Ra,textValue:pc??gf,children:jsx(au,{asChild:!0,...df,focusable:!Ra,children:jsx(we$1.div,{role:"menuitem","data-highlighted":pf?"":void 0,"aria-disabled":Ra||void 0,"data-disabled":Ra?"":void 0,...mc,ref:hf,onPointerMove:re$2(vo.onPointerMove,Bn$1(vf=>{Ra?uf.onItemLeave(vf):(uf.onItemEnter(vf),vf.defaultPrevented||vf.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:re$2(vo.onPointerLeave,Bn$1(vf=>uf.onItemLeave(vf))),onFocus:re$2(vo.onFocus,()=>mf(!0)),onBlur:re$2(vo.onBlur,()=>mf(!1))})})})}),t0="MenuCheckboxItem",Iu=y$2.forwardRef((vo,Ai)=>{const{checked:bo=!1,onCheckedChange:Ra,...pc}=vo;return jsx(Mu,{scope:vo.__scopeMenu,checked:bo,children:jsx(fo$1,{role:"menuitemcheckbox","aria-checked":$r$2(bo)?"mixed":bo,...pc,ref:Ai,"data-state":di$1(bo),onSelect:re$2(pc.onSelect,()=>Ra==null?void 0:Ra($r$2(bo)?!0:!bo),{checkForDefaultPrevented:!1})})})});Iu.displayName=t0;var Eu="MenuRadioGroup",[n0,r0]=Zt$1(Eu,{value:void 0,onValueChange:()=>{}}),Pu=y$2.forwardRef((vo,Ai)=>{const{value:bo,onValueChange:Ra,...pc}=vo,mc=at$2(Ra);return jsx(n0,{scope:vo.__scopeMenu,value:bo,onValueChange:mc,children:jsx(li,{...pc,ref:Ai})})});Pu.displayName=Eu;var Tu="MenuRadioItem",Ou=y$2.forwardRef((vo,Ai)=>{const{value:bo,...Ra}=vo,pc=r0(Tu,vo.__scopeMenu),mc=bo===pc.value;return jsx(Mu,{scope:vo.__scopeMenu,checked:mc,children:jsx(fo$1,{role:"menuitemradio","aria-checked":mc,...Ra,ref:Ai,"data-state":di$1(mc),onSelect:re$2(Ra.onSelect,()=>{var uf;return(uf=pc.onValueChange)==null?void 0:uf.call(pc,bo)},{checkForDefaultPrevented:!1})})})});Ou.displayName=Tu;var ui="MenuItemIndicator",[Mu,o0]=Zt$1(ui,{checked:!1}),Nu=y$2.forwardRef((vo,Ai)=>{const{__scopeMenu:bo,forceMount:Ra,...pc}=vo,mc=o0(ui,bo);return jsx(it$1,{present:Ra||$r$2(mc.checked)||mc.checked===!0,children:jsx(we$1.span,{...pc,ref:Ai,"data-state":di$1(mc.checked)})})});Nu.displayName=ui;var a0="MenuSeparator",Au=y$2.forwardRef((vo,Ai)=>{const{__scopeMenu:bo,...Ra}=vo;return jsx(we$1.div,{role:"separator","aria-orientation":"horizontal",...Ra,ref:Ai})});Au.displayName=a0;var i0="MenuArrow",Du=y$2.forwardRef((vo,Ai)=>{const{__scopeMenu:bo,...Ra}=vo,pc=uo(bo);return jsx(Ql,{...pc,...Ra,ref:Ai})});Du.displayName=i0;var s0="MenuSub",[g1,Ru]=Zt$1(s0),Rn$2="MenuSubTrigger",_u=y$2.forwardRef((vo,Ai)=>{const bo=Qt$2(Rn$2,vo.__scopeMenu),Ra=er$1(Rn$2,vo.__scopeMenu),pc=Ru(Rn$2,vo.__scopeMenu),mc=si(Rn$2,vo.__scopeMenu),uf=y$2.useRef(null),{pointerGraceTimerRef:df,onPointerGraceIntentChange:ff}=mc,hf={__scopeMenu:vo.__scopeMenu},pf=y$2.useCallback(()=>{uf.current&&window.clearTimeout(uf.current),uf.current=null},[]);return y$2.useEffect(()=>pf,[pf]),y$2.useEffect(()=>{const mf=df.current;return()=>{window.clearTimeout(mf),ff(null)}},[df,ff]),jsx(ai,{asChild:!0,...hf,children:jsx(Cu,{id:pc.triggerId,"aria-haspopup":"menu","aria-expanded":bo.open,"aria-controls":pc.contentId,"data-state":Vu(bo.open),...vo,ref:qr$2(Ai,pc.onTriggerChange),onClick:mf=>{var gf;(gf=vo.onClick)==null||gf.call(vo,mf),!(vo.disabled||mf.defaultPrevented)&&(mf.currentTarget.focus(),bo.open||bo.onOpenChange(!0))},onPointerMove:re$2(vo.onPointerMove,Bn$1(mf=>{mc.onItemEnter(mf),!mf.defaultPrevented&&!vo.disabled&&!bo.open&&!uf.current&&(mc.onPointerGraceIntentChange(null),uf.current=window.setTimeout(()=>{bo.onOpenChange(!0),pf()},100))})),onPointerLeave:re$2(vo.onPointerLeave,Bn$1(mf=>{var gf,yf;pf();const vf=(gf=bo.content)==null?void 0:gf.getBoundingClientRect();if(vf){const bf=(yf=bo.content)==null?void 0:yf.dataset.side,Sf=bf==="right",xf=Sf?-5:5,wf=vf[Sf?"left":"right"],If=vf[Sf?"right":"left"];mc.onPointerGraceIntentChange({area:[{x:mf.clientX+xf,y:mf.clientY},{x:wf,y:vf.top},{x:If,y:vf.top},{x:If,y:vf.bottom},{x:wf,y:vf.bottom}],side:bf}),window.clearTimeout(df.current),df.current=window.setTimeout(()=>mc.onPointerGraceIntentChange(null),300)}else{if(mc.onTriggerLeave(mf),mf.defaultPrevented)return;mc.onPointerGraceIntentChange(null)}})),onKeyDown:re$2(vo.onKeyDown,mf=>{var gf;const yf=mc.searchRef.current!=="";vo.disabled||yf&&mf.key===" "||Wy[Ra.dir].includes(mf.key)&&(bo.onOpenChange(!0),(gf=bo.content)==null||gf.focus(),mf.preventDefault())})})})});_u.displayName=Rn$2;var ku="MenuSubContent",Fu=y$2.forwardRef((vo,Ai)=>{const bo=yu(et$2,vo.__scopeMenu),{forceMount:Ra=bo.forceMount,...pc}=vo,mc=Qt$2(et$2,vo.__scopeMenu),uf=er$1(et$2,vo.__scopeMenu),df=Ru(ku,vo.__scopeMenu),ff=y$2.useRef(null),hf=Fe$2(Ai,ff);return jsx(Wn$2.Provider,{scope:vo.__scopeMenu,children:jsx(it$1,{present:Ra||mc.open,children:jsx(Wn$2.Slot,{scope:vo.__scopeMenu,children:jsx(ci,{id:df.contentId,"aria-labelledby":df.triggerId,...pc,ref:hf,align:"start",side:uf.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:pf=>{var mf;uf.isUsingKeyboardRef.current&&((mf=ff.current)==null||mf.focus()),pf.preventDefault()},onCloseAutoFocus:pf=>pf.preventDefault(),onFocusOutside:re$2(vo.onFocusOutside,pf=>{pf.target!==df.trigger&&mc.onOpenChange(!1)}),onEscapeKeyDown:re$2(vo.onEscapeKeyDown,pf=>{uf.onClose(),pf.preventDefault()}),onKeyDown:re$2(vo.onKeyDown,pf=>{var mf;const gf=pf.currentTarget.contains(pf.target),yf=By[uf.dir].includes(pf.key);gf&&yf&&(mc.onOpenChange(!1),(mf=df.trigger)==null||mf.focus(),pf.preventDefault())})})})})})});Fu.displayName=ku;function Vu(vo){return vo?"open":"closed"}function $r$2(vo){return vo==="indeterminate"}function di$1(vo){return $r$2(vo)?"indeterminate":vo?"checked":"unchecked"}function c0(vo){const Ai=document.activeElement;for(const bo of vo)if(bo===Ai||(bo.focus(),document.activeElement!==Ai))return}function l0(vo,Ai){return vo.map((bo,Ra)=>vo[(Ai+Ra)%vo.length])}function u0(vo,Ai,bo){const Ra=Ai.length>1&&Array.from(Ai).every(df=>df===Ai[0])?Ai[0]:Ai,pc=bo?vo.indexOf(bo):-1;let mc=l0(vo,Math.max(pc,0));Ra.length===1&&(mc=mc.filter(df=>df!==bo));const uf=mc.find(df=>df.toLowerCase().startsWith(Ra.toLowerCase()));return uf!==bo?uf:void 0}function d0(vo,Ai){const{x:bo,y:Ra}=vo;let pc=!1;for(let mc=0,uf=Ai.length-1;mc<Ai.length;uf=mc++){const df=Ai[mc].x,ff=Ai[mc].y,hf=Ai[uf].x,pf=Ai[uf].y;ff>Ra!=pf>Ra&&bo<(hf-df)*(Ra-ff)/(pf-ff)+df&&(pc=!pc)}return pc}function f0(vo,Ai){if(!Ai)return!1;const bo={x:vo.clientX,y:vo.clientY};return d0(bo,Ai)}function Bn$1(vo){return Ai=>Ai.pointerType==="mouse"?vo(Ai):void 0}var m0=bu,p0=ai,h0=wu,g0=xu,v0=li,b0=Su,y0=fo$1,w0=Iu,x0=Pu,S0=Ou,C0=Nu,I0=Au,E0=Du,P0=_u,T0=Fu,fi="DropdownMenu",[O0,v1]=Wt$2(fi,[gu]),je$2=gu(),[M0,Lu]=O0(fi),$u=vo=>{const{__scopeDropdownMenu:Ai,children:bo,dir:Ra,open:pc,defaultOpen:mc,onOpenChange:uf,modal:df=!0}=vo,ff=je$2(Ai),hf=y$2.useRef(null),[pf=!1,mf]=Qn$2({prop:pc,defaultProp:mc,onChange:uf});return jsx(M0,{scope:Ai,triggerId:Ft$2(),triggerRef:hf,contentId:Ft$2(),open:pf,onOpenChange:mf,onOpenToggle:y$2.useCallback(()=>mf(gf=>!gf),[mf]),modal:df,children:jsx(m0,{...ff,open:pf,onOpenChange:mf,dir:Ra,modal:df,children:bo})})};$u.displayName=fi;var Uu="DropdownMenuTrigger",Hu=y$2.forwardRef((vo,Ai)=>{const{__scopeDropdownMenu:bo,disabled:Ra=!1,...pc}=vo,mc=Lu(Uu,bo),uf=je$2(bo);return jsx(p0,{asChild:!0,...uf,children:jsx(we$1.button,{type:"button",id:mc.triggerId,"aria-haspopup":"menu","aria-expanded":mc.open,"aria-controls":mc.open?mc.contentId:void 0,"data-state":mc.open?"open":"closed","data-disabled":Ra?"":void 0,disabled:Ra,...pc,ref:qr$2(Ai,mc.triggerRef),onPointerDown:re$2(vo.onPointerDown,df=>{!Ra&&df.button===0&&df.ctrlKey===!1&&(mc.onOpenToggle(),mc.open||df.preventDefault())}),onKeyDown:re$2(vo.onKeyDown,df=>{Ra||(["Enter"," "].includes(df.key)&&mc.onOpenToggle(),df.key==="ArrowDown"&&mc.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(df.key)&&df.preventDefault())})})})});Hu.displayName=Uu;var N0="DropdownMenuPortal",Wu=vo=>{const{__scopeDropdownMenu:Ai,...bo}=vo,Ra=je$2(Ai);return jsx(h0,{...Ra,...bo})};Wu.displayName=N0;var Bu="DropdownMenuContent",zu=y$2.forwardRef((vo,Ai)=>{const{__scopeDropdownMenu:bo,...Ra}=vo,pc=Lu(Bu,bo),mc=je$2(bo),uf=y$2.useRef(!1);return jsx(g0,{id:pc.contentId,"aria-labelledby":pc.triggerId,...mc,...Ra,ref:Ai,onCloseAutoFocus:re$2(vo.onCloseAutoFocus,df=>{var ff;uf.current||(ff=pc.triggerRef.current)==null||ff.focus(),uf.current=!1,df.preventDefault()}),onInteractOutside:re$2(vo.onInteractOutside,df=>{const ff=df.detail.originalEvent,hf=ff.button===0&&ff.ctrlKey===!0,pf=ff.button===2||hf;(!pc.modal||pf)&&(uf.current=!0)}),style:{...vo.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});zu.displayName=Bu;var A0="DropdownMenuGroup",D0=y$2.forwardRef((vo,Ai)=>{const{__scopeDropdownMenu:bo,...Ra}=vo,pc=je$2(bo);return jsx(v0,{...pc,...Ra,ref:Ai})});D0.displayName=A0;var R0="DropdownMenuLabel",_0=y$2.forwardRef((vo,Ai)=>{const{__scopeDropdownMenu:bo,...Ra}=vo,pc=je$2(bo);return jsx(b0,{...pc,...Ra,ref:Ai})});_0.displayName=R0;var k0="DropdownMenuItem",ju=y$2.forwardRef((vo,Ai)=>{const{__scopeDropdownMenu:bo,...Ra}=vo,pc=je$2(bo);return jsx(y0,{...pc,...Ra,ref:Ai})});ju.displayName=k0;var F0="DropdownMenuCheckboxItem",V0=y$2.forwardRef((vo,Ai)=>{const{__scopeDropdownMenu:bo,...Ra}=vo,pc=je$2(bo);return jsx(w0,{...pc,...Ra,ref:Ai})});V0.displayName=F0;var L0="DropdownMenuRadioGroup",$0=y$2.forwardRef((vo,Ai)=>{const{__scopeDropdownMenu:bo,...Ra}=vo,pc=je$2(bo);return jsx(x0,{...pc,...Ra,ref:Ai})});$0.displayName=L0;var U0="DropdownMenuRadioItem",H0=y$2.forwardRef((vo,Ai)=>{const{__scopeDropdownMenu:bo,...Ra}=vo,pc=je$2(bo);return jsx(S0,{...pc,...Ra,ref:Ai})});H0.displayName=U0;var W0="DropdownMenuItemIndicator",B0=y$2.forwardRef((vo,Ai)=>{const{__scopeDropdownMenu:bo,...Ra}=vo,pc=je$2(bo);return jsx(C0,{...pc,...Ra,ref:Ai})});B0.displayName=W0;var z0="DropdownMenuSeparator",j0=y$2.forwardRef((vo,Ai)=>{const{__scopeDropdownMenu:bo,...Ra}=vo,pc=je$2(bo);return jsx(I0,{...pc,...Ra,ref:Ai})});j0.displayName=z0;var Y0="DropdownMenuArrow",G0=y$2.forwardRef((vo,Ai)=>{const{__scopeDropdownMenu:bo,...Ra}=vo,pc=je$2(bo);return jsx(E0,{...pc,...Ra,ref:Ai})});G0.displayName=Y0;var q0="DropdownMenuSubTrigger",X0=y$2.forwardRef((vo,Ai)=>{const{__scopeDropdownMenu:bo,...Ra}=vo,pc=je$2(bo);return jsx(P0,{...pc,...Ra,ref:Ai})});X0.displayName=q0;var K0="DropdownMenuSubContent",Z0=y$2.forwardRef((vo,Ai)=>{const{__scopeDropdownMenu:bo,...Ra}=vo,pc=je$2(bo);return jsx(T0,{...pc,...Ra,ref:Ai,style:{...vo.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Z0.displayName=K0;var Q0=$u,J0=Hu,ew=Wu,tw=zu,nw=ju;const rw=Q0,ow=J0,aw=forwardRef(function({children:vo,...Ai},bo){return jsx(ew,{children:jsx(tw,{...Ai,ref:bo,children:vo})})}),iw=nw;function sw(vo){const{onSwitchboardLinkClick:Ai,onExport:bo,onClose:Ra,onShowRevisionHistory:pc}=vo;return jsxs("div",{className:"flex gap-x-2",children:[Ai?jsx("button",{className:"flex h-8 items-center gap-x-2 rounded border border-gray-200 px-3 text-sm font-semibold text-gray-900 active:opacity-50",onClick:Ai,children:jsx(_e$1,{name:"Drive",size:16})}):null,jsxs("button",{className:"flex h-8 items-center gap-x-2 rounded border border-gray-200 px-3 text-sm font-semibold text-gray-900 active:opacity-50",onClick:bo,children:["Export ",jsx(_e$1,{name:"Save",size:16})]}),jsxs("button",{className:"flex h-8 items-center gap-x-2 whitespace-nowrap rounded border border-gray-200 px-3 text-sm font-semibold text-gray-900 active:opacity-50",onClick:pc,children:["Revision history ",jsx(_e$1,{name:"History",size:16})]}),jsx("button",{className:"grid size-8 place-items-center rounded border border-gray-200 active:opacity-50",onClick:Ra,children:jsx(_e$1,{name:"Xmark"})})]})}var mi="Dialog",[Yu,b1]=Wt$2(mi),[cw,st$2]=Yu(mi),Gu=vo=>{const{__scopeDialog:Ai,children:bo,open:Ra,defaultOpen:pc,onOpenChange:mc,modal:uf=!0}=vo,df=y$2.useRef(null),ff=y$2.useRef(null),[hf=!1,pf]=Qn$2({prop:Ra,defaultProp:pc,onChange:mc});return jsx(cw,{scope:Ai,triggerRef:df,contentRef:ff,contentId:Ft$2(),titleId:Ft$2(),descriptionId:Ft$2(),open:hf,onOpenChange:pf,onOpenToggle:y$2.useCallback(()=>pf(mf=>!mf),[pf]),modal:uf,children:bo})};Gu.displayName=mi;var qu="DialogTrigger",lw=y$2.forwardRef((vo,Ai)=>{const{__scopeDialog:bo,...Ra}=vo,pc=st$2(qu,bo),mc=Fe$2(Ai,pc.triggerRef);return jsx(we$1.button,{type:"button","aria-haspopup":"dialog","aria-expanded":pc.open,"aria-controls":pc.contentId,"data-state":gi(pc.open),...Ra,ref:mc,onClick:re$2(vo.onClick,pc.onOpenToggle)})});lw.displayName=qu;var pi$1="DialogPortal",[uw,Xu]=Yu(pi$1,{forceMount:void 0}),Ku=vo=>{const{__scopeDialog:Ai,forceMount:bo,children:Ra,container:pc}=vo,mc=st$2(pi$1,Ai);return jsx(uw,{scope:Ai,forceMount:bo,children:y$2.Children.map(Ra,uf=>jsx(it$1,{present:bo||mc.open,children:jsx(io$1,{asChild:!0,container:pc,children:uf})}))})};Ku.displayName=pi$1;var Ur$2="DialogOverlay",Zu=y$2.forwardRef((vo,Ai)=>{const bo=Xu(Ur$2,vo.__scopeDialog),{forceMount:Ra=bo.forceMount,...pc}=vo,mc=st$2(Ur$2,vo.__scopeDialog);return mc.modal?jsx(it$1,{present:Ra||mc.open,children:jsx(dw,{...pc,ref:Ai})}):null});Zu.displayName=Ur$2;var dw=y$2.forwardRef((vo,Ai)=>{const{__scopeDialog:bo,...Ra}=vo,pc=st$2(Ur$2,bo);return jsx(oi,{as:mn$1,allowPinchZoom:!0,shards:[pc.contentRef],children:jsx(we$1.div,{"data-state":gi(pc.open),...Ra,ref:Ai,style:{pointerEvents:"auto",...Ra.style}})})}),Kt="DialogContent",Qu=y$2.forwardRef((vo,Ai)=>{const bo=Xu(Kt,vo.__scopeDialog),{forceMount:Ra=bo.forceMount,...pc}=vo,mc=st$2(Kt,vo.__scopeDialog);return jsx(it$1,{present:Ra||mc.open,children:mc.modal?jsx(fw,{...pc,ref:Ai}):jsx(mw,{...pc,ref:Ai})})});Qu.displayName=Kt;var fw=y$2.forwardRef((vo,Ai)=>{const bo=st$2(Kt,vo.__scopeDialog),Ra=y$2.useRef(null),pc=Fe$2(Ai,bo.contentRef,Ra);return y$2.useEffect(()=>{const mc=Ra.current;if(mc)return su(mc)},[]),jsx(Ju,{...vo,ref:pc,trapFocus:bo.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:re$2(vo.onCloseAutoFocus,mc=>{var uf;mc.preventDefault(),(uf=bo.triggerRef.current)==null||uf.focus()}),onPointerDownOutside:re$2(vo.onPointerDownOutside,mc=>{const uf=mc.detail.originalEvent,df=uf.button===0&&uf.ctrlKey===!0;(uf.button===2||df)&&mc.preventDefault()}),onFocusOutside:re$2(vo.onFocusOutside,mc=>mc.preventDefault())})}),mw=y$2.forwardRef((vo,Ai)=>{const bo=st$2(Kt,vo.__scopeDialog),Ra=y$2.useRef(!1),pc=y$2.useRef(!1);return jsx(Ju,{...vo,ref:Ai,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:mc=>{var uf,df;(uf=vo.onCloseAutoFocus)==null||uf.call(vo,mc),mc.defaultPrevented||(Ra.current||(df=bo.triggerRef.current)==null||df.focus(),mc.preventDefault()),Ra.current=!1,pc.current=!1},onInteractOutside:mc=>{var uf,df;(uf=vo.onInteractOutside)==null||uf.call(vo,mc),mc.defaultPrevented||(Ra.current=!0,mc.detail.originalEvent.type==="pointerdown"&&(pc.current=!0));const ff=mc.target;(df=bo.triggerRef.current)!=null&&df.contains(ff)&&mc.preventDefault(),mc.detail.originalEvent.type==="focusin"&&pc.current&&mc.preventDefault()}})}),Ju=y$2.forwardRef((vo,Ai)=>{const{__scopeDialog:bo,trapFocus:Ra,onOpenAutoFocus:pc,onCloseAutoFocus:mc,...uf}=vo,df=st$2(Kt,bo),ff=y$2.useRef(null),hf=Fe$2(Ai,ff);return Fl(),jsxs(Fragment,{children:[jsx(ti,{asChild:!0,loop:!0,trapped:Ra,onMountAutoFocus:pc,onUnmountAutoFocus:mc,children:jsx(oo$1,{role:"dialog",id:df.contentId,"aria-describedby":df.descriptionId,"aria-labelledby":df.titleId,"data-state":gi(df.open),...uf,ref:hf,onDismiss:()=>df.onOpenChange(!1)})}),jsxs(Fragment,{children:[jsx(hw,{titleId:df.titleId}),jsx(vw,{contentRef:ff,descriptionId:df.descriptionId})]})]})}),hi="DialogTitle",ed=y$2.forwardRef((vo,Ai)=>{const{__scopeDialog:bo,...Ra}=vo,pc=st$2(hi,bo);return jsx(we$1.h2,{id:pc.titleId,...Ra,ref:Ai})});ed.displayName=hi;var td="DialogDescription",nd=y$2.forwardRef((vo,Ai)=>{const{__scopeDialog:bo,...Ra}=vo,pc=st$2(td,bo);return jsx(we$1.p,{id:pc.descriptionId,...Ra,ref:Ai})});nd.displayName=td;var rd="DialogClose",pw=y$2.forwardRef((vo,Ai)=>{const{__scopeDialog:bo,...Ra}=vo,pc=st$2(rd,bo);return jsx(we$1.button,{type:"button",...Ra,ref:Ai,onClick:re$2(vo.onClick,()=>pc.onOpenChange(!1))})});pw.displayName=rd;function gi(vo){return vo?"open":"closed"}var od="DialogTitleWarning",[y1,ad]=nb(od,{contentName:Kt,titleName:hi,docsSlug:"dialog"}),hw=({titleId:vo})=>{const Ai=ad(od),bo=`\`${Ai.contentName}\` requires a \`${Ai.titleName}\` for the component to be accessible for screen reader users.
|
|
55
|
-
|
|
56
|
-
If you want to hide the \`${Ai.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
57
|
-
|
|
58
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${Ai.docsSlug}`;return y$2.useEffect(()=>{vo&&(document.getElementById(vo)||console.error(bo))},[bo,vo]),null},gw="DialogDescriptionWarning",vw=({contentRef:vo,descriptionId:Ai})=>{const bo=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ad(gw).contentName}}.`;return y$2.useEffect(()=>{var Ra;const pc=(Ra=vo.current)==null?void 0:Ra.getAttribute("aria-describedby");Ai&&pc&&(document.getElementById(Ai)||console.warn(bo))},[bo,vo,Ai]),null},bw=Gu,yw=Ku,ww=Zu,xw=Qu,Sw=ed,Cw=nd,Iw="VisuallyHidden",id=y$2.forwardRef((vo,Ai)=>jsx(we$1.span,{...vo,ref:Ai,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...vo.style}}));id.displayName=Iw;var sd=id;function cd(vo){const{title:Ai,open:bo,onOpenChange:Ra,contentProps:pc,overlayProps:mc,children:uf,...df}=vo;return jsx(bw,{defaultOpen:bo,onOpenChange:Ra,open:bo,children:jsx(yw,{children:jsx(ww,{...mc,className:Ne$1("fixed inset-0 grid place-items-center overflow-y-auto bg-slate-900/50 data-[state=closed]:animate-fade-out data-[state=open]:animate-fade-in",mc==null?void 0:mc.className),children:jsxs(xw,{...df,...pc,className:Ne$1("bg-white data-[state=closed]:animate-zoom-out data-[state=open]:animate-zoom-in",pc==null?void 0:pc.className),children:[jsxs(sd,{children:[jsx(Sw,{children:Ai||"Modal"}),jsx(Cw,{children:Ai||"Modal"})]}),uf]})})})})}function ld(vo,Ai){const{itemsPerPage:bo=20,initialPage:Ra=0,pageRange:pc=3}={},[mc,uf]=useState(Ra),df=Math.ceil(vo.length/bo),ff=mc<df-1,hf=mc>0,pf=useCallback(()=>{ff&&uf(c1=>c1+1)},[ff,uf]),mf=useCallback(()=>{hf&&uf(c1=>c1-1)},[hf,uf]),gf=useCallback(()=>{uf(df-1)},[df]),yf=useCallback(()=>{uf(0)},[]),vf=useCallback(c1=>{c1>=0&&c1<df&&uf(c1)},[df]),bf=Math.floor((pc-1)/2),Sf=Math.min(pc,df),xf=Math.max(df-Sf),wf=Math.min(xf,Math.max(mc-bf,0)),If=useMemo(()=>{const c1=[];for(let u1=wf;u1<Sf+wf;u1++)c1.push({index:u1,active:u1===mc,number:u1+1});return c1},[Sf,wf,mc]),l1=vo.slice(mc*bo,(mc+1)*bo),s1=If.length>0&&If.slice(-1)[0].index<df-1;return{pages:If,goToPage:vf,pageItems:l1,pageCount:df,currentPage:mc,goToLastPage:gf,goToFirstPage:yf,goToNextPage:pf,hiddenNextPages:s1,goToPreviousPage:mf,isNextPageAvailable:ff,isPreviousPageAvailable:hf}}var[mo$1,w1]=Wt$2("Tooltip",[ao$1]),po$1=ao$1(),ud="TooltipProvider",Ew=700,Oa="tooltip.open",[Pw,vi]=mo$1(ud),dd=vo=>{const{__scopeTooltip:Ai,delayDuration:bo=Ew,skipDelayDuration:Ra=300,disableHoverableContent:pc=!1,children:mc}=vo,[uf,df]=y$2.useState(!0),ff=y$2.useRef(!1),hf=y$2.useRef(0);return y$2.useEffect(()=>{const pf=hf.current;return()=>window.clearTimeout(pf)},[]),jsx(Pw,{scope:Ai,isOpenDelayed:uf,delayDuration:bo,onOpen:y$2.useCallback(()=>{window.clearTimeout(hf.current),df(!1)},[]),onClose:y$2.useCallback(()=>{window.clearTimeout(hf.current),hf.current=window.setTimeout(()=>df(!0),Ra)},[Ra]),isPointerInTransitRef:ff,onPointerInTransitChange:y$2.useCallback(pf=>{ff.current=pf},[]),disableHoverableContent:pc,children:mc})};dd.displayName=ud;var ho="Tooltip",[Tw,tr$2]=mo$1(ho),fd=vo=>{const{__scopeTooltip:Ai,children:bo,open:Ra,defaultOpen:pc=!1,onOpenChange:mc,disableHoverableContent:uf,delayDuration:df}=vo,ff=vi(ho,vo.__scopeTooltip),hf=po$1(Ai),[pf,mf]=y$2.useState(null),gf=Ft$2(),yf=y$2.useRef(0),vf=uf??ff.disableHoverableContent,bf=df??ff.delayDuration,Sf=y$2.useRef(!1),[xf=!1,wf]=Qn$2({prop:Ra,defaultProp:pc,onChange:u1=>{u1?(ff.onOpen(),document.dispatchEvent(new CustomEvent(Oa))):ff.onClose(),mc==null||mc(u1)}}),If=y$2.useMemo(()=>xf?Sf.current?"delayed-open":"instant-open":"closed",[xf]),l1=y$2.useCallback(()=>{window.clearTimeout(yf.current),yf.current=0,Sf.current=!1,wf(!0)},[wf]),s1=y$2.useCallback(()=>{window.clearTimeout(yf.current),yf.current=0,wf(!1)},[wf]),c1=y$2.useCallback(()=>{window.clearTimeout(yf.current),yf.current=window.setTimeout(()=>{Sf.current=!0,wf(!0),yf.current=0},bf)},[bf,wf]);return y$2.useEffect(()=>()=>{yf.current&&(window.clearTimeout(yf.current),yf.current=0)},[]),jsx(Xl,{...hf,children:jsx(Tw,{scope:Ai,contentId:gf,open:xf,stateAttribute:If,trigger:pf,onTriggerChange:mf,onTriggerEnter:y$2.useCallback(()=>{ff.isOpenDelayed?c1():l1()},[ff.isOpenDelayed,c1,l1]),onTriggerLeave:y$2.useCallback(()=>{vf?s1():(window.clearTimeout(yf.current),yf.current=0)},[s1,vf]),onOpen:l1,onClose:s1,disableHoverableContent:vf,children:bo})})};fd.displayName=ho;var Ma="TooltipTrigger",md=y$2.forwardRef((vo,Ai)=>{const{__scopeTooltip:bo,...Ra}=vo,pc=tr$2(Ma,bo),mc=vi(Ma,bo),uf=po$1(bo),df=y$2.useRef(null),ff=Fe$2(Ai,df,pc.onTriggerChange),hf=y$2.useRef(!1),pf=y$2.useRef(!1),mf=y$2.useCallback(()=>hf.current=!1,[]);return y$2.useEffect(()=>()=>document.removeEventListener("pointerup",mf),[mf]),jsx(Kl,{asChild:!0,...uf,children:jsx(we$1.button,{"aria-describedby":pc.open?pc.contentId:void 0,"data-state":pc.stateAttribute,...Ra,ref:ff,onPointerMove:re$2(vo.onPointerMove,gf=>{gf.pointerType!=="touch"&&!pf.current&&!mc.isPointerInTransitRef.current&&(pc.onTriggerEnter(),pf.current=!0)}),onPointerLeave:re$2(vo.onPointerLeave,()=>{pc.onTriggerLeave(),pf.current=!1}),onPointerDown:re$2(vo.onPointerDown,()=>{hf.current=!0,document.addEventListener("pointerup",mf,{once:!0})}),onFocus:re$2(vo.onFocus,()=>{hf.current||pc.onOpen()}),onBlur:re$2(vo.onBlur,pc.onClose),onClick:re$2(vo.onClick,pc.onClose)})})});md.displayName=Ma;var bi="TooltipPortal",[Ow,Mw]=mo$1(bi,{forceMount:void 0}),pd=vo=>{const{__scopeTooltip:Ai,forceMount:bo,children:Ra,container:pc}=vo,mc=tr$2(bi,Ai);return jsx(Ow,{scope:Ai,forceMount:bo,children:jsx(it$1,{present:bo||mc.open,children:jsx(io$1,{asChild:!0,container:pc,children:Ra})})})};pd.displayName=bi;var gn$1="TooltipContent",hd=y$2.forwardRef((vo,Ai)=>{const bo=Mw(gn$1,vo.__scopeTooltip),{forceMount:Ra=bo.forceMount,side:pc="top",...mc}=vo,uf=tr$2(gn$1,vo.__scopeTooltip);return jsx(it$1,{present:Ra||uf.open,children:uf.disableHoverableContent?jsx(gd,{side:pc,...mc,ref:Ai}):jsx(Nw,{side:pc,...mc,ref:Ai})})}),Nw=y$2.forwardRef((vo,Ai)=>{const bo=tr$2(gn$1,vo.__scopeTooltip),Ra=vi(gn$1,vo.__scopeTooltip),pc=y$2.useRef(null),mc=Fe$2(Ai,pc),[uf,df]=y$2.useState(null),{trigger:ff,onClose:hf}=bo,pf=pc.current,{onPointerInTransitChange:mf}=Ra,gf=y$2.useCallback(()=>{df(null),mf(!1)},[mf]),yf=y$2.useCallback((vf,bf)=>{const Sf=vf.currentTarget,xf={x:vf.clientX,y:vf.clientY},wf=_w(xf,Sf.getBoundingClientRect()),If=kw(xf,wf),l1=Fw(bf.getBoundingClientRect()),s1=Lw([...If,...l1]);df(s1),mf(!0)},[mf]);return y$2.useEffect(()=>()=>gf(),[gf]),y$2.useEffect(()=>{if(ff&&pf){const vf=Sf=>yf(Sf,pf),bf=Sf=>yf(Sf,ff);return ff.addEventListener("pointerleave",vf),pf.addEventListener("pointerleave",bf),()=>{ff.removeEventListener("pointerleave",vf),pf.removeEventListener("pointerleave",bf)}}},[ff,pf,yf,gf]),y$2.useEffect(()=>{if(uf){const vf=bf=>{const Sf=bf.target,xf={x:bf.clientX,y:bf.clientY},wf=(ff==null?void 0:ff.contains(Sf))||(pf==null?void 0:pf.contains(Sf)),If=!Vw(xf,uf);wf?gf():If&&(gf(),hf())};return document.addEventListener("pointermove",vf),()=>document.removeEventListener("pointermove",vf)}},[ff,pf,uf,hf,gf]),jsx(gd,{...vo,ref:mc})}),[Aw,Dw]=mo$1(ho,{isInside:!1}),gd=y$2.forwardRef((vo,Ai)=>{const{__scopeTooltip:bo,children:Ra,"aria-label":pc,onEscapeKeyDown:mc,onPointerDownOutside:uf,...df}=vo,ff=tr$2(gn$1,bo),hf=po$1(bo),{onClose:pf}=ff;return y$2.useEffect(()=>(document.addEventListener(Oa,pf),()=>document.removeEventListener(Oa,pf)),[pf]),y$2.useEffect(()=>{if(ff.trigger){const mf=gf=>{const yf=gf.target;yf!=null&&yf.contains(ff.trigger)&&pf()};return window.addEventListener("scroll",mf,{capture:!0}),()=>window.removeEventListener("scroll",mf,{capture:!0})}},[ff.trigger,pf]),jsx(oo$1,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:mc,onPointerDownOutside:uf,onFocusOutside:mf=>mf.preventDefault(),onDismiss:pf,children:jsxs(Zl,{"data-state":ff.stateAttribute,...hf,...df,ref:Ai,style:{...df.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[jsx(Rc,{children:Ra}),jsx(Aw,{scope:bo,isInside:!0,children:jsx(sd,{id:ff.contentId,role:"tooltip",children:pc||Ra})})]})})});hd.displayName=gn$1;var vd="TooltipArrow",Rw=y$2.forwardRef((vo,Ai)=>{const{__scopeTooltip:bo,...Ra}=vo,pc=po$1(bo);return Dw(vd,bo).isInside?null:jsx(Ql,{...pc,...Ra,ref:Ai})});Rw.displayName=vd;function _w(vo,Ai){const bo=Math.abs(Ai.top-vo.y),Ra=Math.abs(Ai.bottom-vo.y),pc=Math.abs(Ai.right-vo.x),mc=Math.abs(Ai.left-vo.x);switch(Math.min(bo,Ra,pc,mc)){case mc:return"left";case pc:return"right";case bo:return"top";case Ra:return"bottom";default:throw new Error("unreachable")}}function kw(vo,Ai,bo=5){const Ra=[];switch(Ai){case"top":Ra.push({x:vo.x-bo,y:vo.y+bo},{x:vo.x+bo,y:vo.y+bo});break;case"bottom":Ra.push({x:vo.x-bo,y:vo.y-bo},{x:vo.x+bo,y:vo.y-bo});break;case"left":Ra.push({x:vo.x+bo,y:vo.y-bo},{x:vo.x+bo,y:vo.y+bo});break;case"right":Ra.push({x:vo.x-bo,y:vo.y-bo},{x:vo.x-bo,y:vo.y+bo});break}return Ra}function Fw(vo){const{top:Ai,right:bo,bottom:Ra,left:pc}=vo;return[{x:pc,y:Ai},{x:bo,y:Ai},{x:bo,y:Ra},{x:pc,y:Ra}]}function Vw(vo,Ai){const{x:bo,y:Ra}=vo;let pc=!1;for(let mc=0,uf=Ai.length-1;mc<Ai.length;uf=mc++){const df=Ai[mc].x,ff=Ai[mc].y,hf=Ai[uf].x,pf=Ai[uf].y;ff>Ra!=pf>Ra&&bo<(hf-df)*(Ra-ff)/(pf-ff)+df&&(pc=!pc)}return pc}function Lw(vo){const Ai=vo.slice();return Ai.sort((bo,Ra)=>bo.x<Ra.x?-1:bo.x>Ra.x?1:bo.y<Ra.y?-1:bo.y>Ra.y?1:0),$w(Ai)}function $w(vo){if(vo.length<=1)return vo.slice();const Ai=[];for(let Ra=0;Ra<vo.length;Ra++){const pc=vo[Ra];for(;Ai.length>=2;){const mc=Ai[Ai.length-1],uf=Ai[Ai.length-2];if((mc.x-uf.x)*(pc.y-uf.y)>=(mc.y-uf.y)*(pc.x-uf.x))Ai.pop();else break}Ai.push(pc)}Ai.pop();const bo=[];for(let Ra=vo.length-1;Ra>=0;Ra--){const pc=vo[Ra];for(;bo.length>=2;){const mc=bo[bo.length-1],uf=bo[bo.length-2];if((mc.x-uf.x)*(pc.y-uf.y)>=(mc.y-uf.y)*(pc.x-uf.x))bo.pop();else break}bo.push(pc)}return bo.pop(),Ai.length===1&&bo.length===1&&Ai[0].x===bo[0].x&&Ai[0].y===bo[0].y?Ai:Ai.concat(bo)}var Uw=dd,Hw=fd,Ww=md,Bw=pd,zw=hd;function jw(vo){const{children:Ai,content:bo,open:Ra,defaultOpen:pc,onOpenChange:mc,className:uf,...df}=vo;return jsxs(Hw,{defaultOpen:pc,delayDuration:0,onOpenChange:mc,open:Ra,children:[jsx(Ww,{asChild:!0,children:Ai}),jsx(Bw,{children:jsx(zw,{...df,className:Ne$1("rounded-lg border border-gray-200 bg-white p-2 text-xs shadow-tooltip",uf),children:bo})})]})}const Yw=Uw,bd=6048e5,Gw=864e5,Us=Symbol.for("constructDateFrom");function Ut$2(vo,Ai){return typeof vo=="function"?vo(Ai):vo&&typeof vo=="object"&&Us in vo?vo[Us](Ai):vo instanceof Date?new vo.constructor(Ai):new Date(Ai)}function ct$1(vo,Ai){return Ut$2(Ai||vo,vo)}let qw={};function nr$1(){return qw}function zn$1(vo,Ai){var bo,Ra,pc,mc;const uf=nr$1(),df=(Ai==null?void 0:Ai.weekStartsOn)??((Ra=(bo=Ai==null?void 0:Ai.locale)==null?void 0:bo.options)==null?void 0:Ra.weekStartsOn)??uf.weekStartsOn??((mc=(pc=uf.locale)==null?void 0:pc.options)==null?void 0:mc.weekStartsOn)??0,ff=ct$1(vo,Ai==null?void 0:Ai.in),hf=ff.getDay(),pf=(hf<df?7:0)+hf-df;return ff.setDate(ff.getDate()-pf),ff.setHours(0,0,0,0),ff}function Hr$2(vo,Ai){return zn$1(vo,{...Ai,weekStartsOn:1})}function yd(vo,Ai){const bo=ct$1(vo,void 0),Ra=bo.getFullYear(),pc=Ut$2(bo,0);pc.setFullYear(Ra+1,0,4),pc.setHours(0,0,0,0);const mc=Hr$2(pc),uf=Ut$2(bo,0);uf.setFullYear(Ra,0,4),uf.setHours(0,0,0,0);const df=Hr$2(uf);return bo.getTime()>=mc.getTime()?Ra+1:bo.getTime()>=df.getTime()?Ra:Ra-1}function Hs(vo){const Ai=ct$1(vo),bo=new Date(Date.UTC(Ai.getFullYear(),Ai.getMonth(),Ai.getDate(),Ai.getHours(),Ai.getMinutes(),Ai.getSeconds(),Ai.getMilliseconds()));return bo.setUTCFullYear(Ai.getFullYear()),+vo-+bo}function Xw(vo,...Ai){const bo=Ut$2.bind(null,Ai.find(Ra=>typeof Ra=="object"));return Ai.map(bo)}function Ws(vo,Ai){const bo=ct$1(vo,void 0);return bo.setHours(0,0,0,0),bo}function Kw(vo,Ai,bo){const[Ra,pc]=Xw(void 0,vo,Ai),mc=Ws(Ra),uf=Ws(pc),df=+mc-Hs(mc),ff=+uf-Hs(uf);return Math.round((df-ff)/Gw)}function Zw(vo,Ai){const bo=yd(vo),Ra=Ut$2(vo,0);return Ra.setFullYear(bo,0,4),Ra.setHours(0,0,0,0),Hr$2(Ra)}function Qw(vo){return vo instanceof Date||typeof vo=="object"&&Object.prototype.toString.call(vo)==="[object Date]"}function Jw(vo){return!(!Qw(vo)&&typeof vo!="number"||isNaN(+ct$1(vo)))}function ex(vo,Ai){const bo=ct$1(vo,void 0);return bo.setFullYear(bo.getFullYear(),0,1),bo.setHours(0,0,0,0),bo}const tx={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},nx=(vo,Ai,bo)=>{let Ra;const pc=tx[vo];return typeof pc=="string"?Ra=pc:Ai===1?Ra=pc.one:Ra=pc.other.replace("{{count}}",Ai.toString()),bo!=null&&bo.addSuffix?bo.comparison&&bo.comparison>0?"in "+Ra:Ra+" ago":Ra};function Zo(vo){return(Ai={})=>{const bo=Ai.width?String(Ai.width):vo.defaultWidth;return vo.formats[bo]||vo.formats[vo.defaultWidth]}}const rx={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ox={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ax={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ix={date:Zo({formats:rx,defaultWidth:"full"}),time:Zo({formats:ox,defaultWidth:"full"}),dateTime:Zo({formats:ax,defaultWidth:"full"})},sx={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},cx$1=(vo,Ai,bo,Ra)=>sx[vo];function Mn$2(vo){return(Ai,bo)=>{const Ra=bo!=null&&bo.context?String(bo.context):"standalone";let pc;if(Ra==="formatting"&&vo.formattingValues){const uf=vo.defaultFormattingWidth||vo.defaultWidth,df=bo!=null&&bo.width?String(bo.width):uf;pc=vo.formattingValues[df]||vo.formattingValues[uf]}else{const uf=vo.defaultWidth,df=bo!=null&&bo.width?String(bo.width):vo.defaultWidth;pc=vo.values[df]||vo.values[uf]}const mc=vo.argumentCallback?vo.argumentCallback(Ai):Ai;return pc[mc]}}const lx={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},ux={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},dx={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},fx={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},mx={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},px={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},hx=(vo,Ai)=>{const bo=Number(vo),Ra=bo%100;if(Ra>20||Ra<10)switch(Ra%10){case 1:return bo+"st";case 2:return bo+"nd";case 3:return bo+"rd"}return bo+"th"},gx={ordinalNumber:hx,era:Mn$2({values:lx,defaultWidth:"wide"}),quarter:Mn$2({values:ux,defaultWidth:"wide",argumentCallback:vo=>vo-1}),month:Mn$2({values:dx,defaultWidth:"wide"}),day:Mn$2({values:fx,defaultWidth:"wide"}),dayPeriod:Mn$2({values:mx,defaultWidth:"wide",formattingValues:px,defaultFormattingWidth:"wide"})};function Nn$2(vo){return(Ai,bo={})=>{const Ra=bo.width,pc=Ra&&vo.matchPatterns[Ra]||vo.matchPatterns[vo.defaultMatchWidth],mc=Ai.match(pc);if(!mc)return null;const uf=mc[0],df=Ra&&vo.parsePatterns[Ra]||vo.parsePatterns[vo.defaultParseWidth],ff=Array.isArray(df)?bx(df,mf=>mf.test(uf)):vx(df,mf=>mf.test(uf));let hf;hf=vo.valueCallback?vo.valueCallback(ff):ff,hf=bo.valueCallback?bo.valueCallback(hf):hf;const pf=Ai.slice(uf.length);return{value:hf,rest:pf}}}function vx(vo,Ai){for(const bo in vo)if(Object.prototype.hasOwnProperty.call(vo,bo)&&Ai(vo[bo]))return bo}function bx(vo,Ai){for(let bo=0;bo<vo.length;bo++)if(Ai(vo[bo]))return bo}function yx(vo){return(Ai,bo={})=>{const Ra=Ai.match(vo.matchPattern);if(!Ra)return null;const pc=Ra[0],mc=Ai.match(vo.parsePattern);if(!mc)return null;let uf=vo.valueCallback?vo.valueCallback(mc[0]):mc[0];uf=bo.valueCallback?bo.valueCallback(uf):uf;const df=Ai.slice(pc.length);return{value:uf,rest:df}}}const wx=/^(\d+)(th|st|nd|rd)?/i,xx=/\d+/i,Sx={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Cx={any:[/^b/i,/^(a|c)/i]},Ix={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ex={any:[/1/i,/2/i,/3/i,/4/i]},Px={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Tx={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Ox={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Mx={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Nx={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Ax={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Dx={ordinalNumber:yx({matchPattern:wx,parsePattern:xx,valueCallback:vo=>parseInt(vo,10)}),era:Nn$2({matchPatterns:Sx,defaultMatchWidth:"wide",parsePatterns:Cx,defaultParseWidth:"any"}),quarter:Nn$2({matchPatterns:Ix,defaultMatchWidth:"wide",parsePatterns:Ex,defaultParseWidth:"any",valueCallback:vo=>vo+1}),month:Nn$2({matchPatterns:Px,defaultMatchWidth:"wide",parsePatterns:Tx,defaultParseWidth:"any"}),day:Nn$2({matchPatterns:Ox,defaultMatchWidth:"wide",parsePatterns:Mx,defaultParseWidth:"any"}),dayPeriod:Nn$2({matchPatterns:Nx,defaultMatchWidth:"any",parsePatterns:Ax,defaultParseWidth:"any"})},Rx={code:"en-US",formatDistance:nx,formatLong:ix,formatRelative:cx$1,localize:gx,match:Dx,options:{weekStartsOn:0,firstWeekContainsDate:1}};function _x(vo,Ai){const bo=ct$1(vo,void 0);return Kw(bo,ex(bo))+1}function kx(vo,Ai){const bo=ct$1(vo,void 0),Ra=+Hr$2(bo)-+Zw(bo);return Math.round(Ra/bd)+1}function wd(vo,Ai){var bo,Ra,pc,mc;const uf=ct$1(vo,Ai==null?void 0:Ai.in),df=uf.getFullYear(),ff=nr$1(),hf=(Ai==null?void 0:Ai.firstWeekContainsDate)??((Ra=(bo=Ai==null?void 0:Ai.locale)==null?void 0:bo.options)==null?void 0:Ra.firstWeekContainsDate)??ff.firstWeekContainsDate??((mc=(pc=ff.locale)==null?void 0:pc.options)==null?void 0:mc.firstWeekContainsDate)??1,pf=Ut$2((Ai==null?void 0:Ai.in)||vo,0);pf.setFullYear(df+1,0,hf),pf.setHours(0,0,0,0);const mf=zn$1(pf,Ai),gf=Ut$2((Ai==null?void 0:Ai.in)||vo,0);gf.setFullYear(df,0,hf),gf.setHours(0,0,0,0);const yf=zn$1(gf,Ai);return+uf>=+mf?df+1:+uf>=+yf?df:df-1}function Fx(vo,Ai){var bo,Ra,pc,mc;const uf=nr$1(),df=(Ai==null?void 0:Ai.firstWeekContainsDate)??((Ra=(bo=Ai==null?void 0:Ai.locale)==null?void 0:bo.options)==null?void 0:Ra.firstWeekContainsDate)??uf.firstWeekContainsDate??((mc=(pc=uf.locale)==null?void 0:pc.options)==null?void 0:mc.firstWeekContainsDate)??1,ff=wd(vo,Ai),hf=Ut$2((Ai==null?void 0:Ai.in)||vo,0);return hf.setFullYear(ff,0,df),hf.setHours(0,0,0,0),zn$1(hf,Ai)}function Vx(vo,Ai){const bo=ct$1(vo,Ai==null?void 0:Ai.in),Ra=+zn$1(bo,Ai)-+Fx(bo,Ai);return Math.round(Ra/bd)+1}function ve$2(vo,Ai){const bo=vo<0?"-":"",Ra=Math.abs(vo).toString().padStart(Ai,"0");return bo+Ra}const Nt$2={y(vo,Ai){const bo=vo.getFullYear(),Ra=bo>0?bo:1-bo;return ve$2(Ai==="yy"?Ra%100:Ra,Ai.length)},M(vo,Ai){const bo=vo.getMonth();return Ai==="M"?String(bo+1):ve$2(bo+1,2)},d(vo,Ai){return ve$2(vo.getDate(),Ai.length)},a(vo,Ai){const bo=vo.getHours()/12>=1?"pm":"am";switch(Ai){case"a":case"aa":return bo.toUpperCase();case"aaa":return bo;case"aaaaa":return bo[0];case"aaaa":default:return bo==="am"?"a.m.":"p.m."}},h(vo,Ai){return ve$2(vo.getHours()%12||12,Ai.length)},H(vo,Ai){return ve$2(vo.getHours(),Ai.length)},m(vo,Ai){return ve$2(vo.getMinutes(),Ai.length)},s(vo,Ai){return ve$2(vo.getSeconds(),Ai.length)},S(vo,Ai){const bo=Ai.length,Ra=vo.getMilliseconds(),pc=Math.trunc(Ra*Math.pow(10,bo-3));return ve$2(pc,Ai.length)}},on$1={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Bs={G:function(vo,Ai,bo){const Ra=vo.getFullYear()>0?1:0;switch(Ai){case"G":case"GG":case"GGG":return bo.era(Ra,{width:"abbreviated"});case"GGGGG":return bo.era(Ra,{width:"narrow"});case"GGGG":default:return bo.era(Ra,{width:"wide"})}},y:function(vo,Ai,bo){if(Ai==="yo"){const Ra=vo.getFullYear(),pc=Ra>0?Ra:1-Ra;return bo.ordinalNumber(pc,{unit:"year"})}return Nt$2.y(vo,Ai)},Y:function(vo,Ai,bo,Ra){const pc=wd(vo,Ra),mc=pc>0?pc:1-pc;if(Ai==="YY"){const uf=mc%100;return ve$2(uf,2)}return Ai==="Yo"?bo.ordinalNumber(mc,{unit:"year"}):ve$2(mc,Ai.length)},R:function(vo,Ai){const bo=yd(vo);return ve$2(bo,Ai.length)},u:function(vo,Ai){const bo=vo.getFullYear();return ve$2(bo,Ai.length)},Q:function(vo,Ai,bo){const Ra=Math.ceil((vo.getMonth()+1)/3);switch(Ai){case"Q":return String(Ra);case"QQ":return ve$2(Ra,2);case"Qo":return bo.ordinalNumber(Ra,{unit:"quarter"});case"QQQ":return bo.quarter(Ra,{width:"abbreviated",context:"formatting"});case"QQQQQ":return bo.quarter(Ra,{width:"narrow",context:"formatting"});case"QQQQ":default:return bo.quarter(Ra,{width:"wide",context:"formatting"})}},q:function(vo,Ai,bo){const Ra=Math.ceil((vo.getMonth()+1)/3);switch(Ai){case"q":return String(Ra);case"qq":return ve$2(Ra,2);case"qo":return bo.ordinalNumber(Ra,{unit:"quarter"});case"qqq":return bo.quarter(Ra,{width:"abbreviated",context:"standalone"});case"qqqqq":return bo.quarter(Ra,{width:"narrow",context:"standalone"});case"qqqq":default:return bo.quarter(Ra,{width:"wide",context:"standalone"})}},M:function(vo,Ai,bo){const Ra=vo.getMonth();switch(Ai){case"M":case"MM":return Nt$2.M(vo,Ai);case"Mo":return bo.ordinalNumber(Ra+1,{unit:"month"});case"MMM":return bo.month(Ra,{width:"abbreviated",context:"formatting"});case"MMMMM":return bo.month(Ra,{width:"narrow",context:"formatting"});case"MMMM":default:return bo.month(Ra,{width:"wide",context:"formatting"})}},L:function(vo,Ai,bo){const Ra=vo.getMonth();switch(Ai){case"L":return String(Ra+1);case"LL":return ve$2(Ra+1,2);case"Lo":return bo.ordinalNumber(Ra+1,{unit:"month"});case"LLL":return bo.month(Ra,{width:"abbreviated",context:"standalone"});case"LLLLL":return bo.month(Ra,{width:"narrow",context:"standalone"});case"LLLL":default:return bo.month(Ra,{width:"wide",context:"standalone"})}},w:function(vo,Ai,bo,Ra){const pc=Vx(vo,Ra);return Ai==="wo"?bo.ordinalNumber(pc,{unit:"week"}):ve$2(pc,Ai.length)},I:function(vo,Ai,bo){const Ra=kx(vo);return Ai==="Io"?bo.ordinalNumber(Ra,{unit:"week"}):ve$2(Ra,Ai.length)},d:function(vo,Ai,bo){return Ai==="do"?bo.ordinalNumber(vo.getDate(),{unit:"date"}):Nt$2.d(vo,Ai)},D:function(vo,Ai,bo){const Ra=_x(vo);return Ai==="Do"?bo.ordinalNumber(Ra,{unit:"dayOfYear"}):ve$2(Ra,Ai.length)},E:function(vo,Ai,bo){const Ra=vo.getDay();switch(Ai){case"E":case"EE":case"EEE":return bo.day(Ra,{width:"abbreviated",context:"formatting"});case"EEEEE":return bo.day(Ra,{width:"narrow",context:"formatting"});case"EEEEEE":return bo.day(Ra,{width:"short",context:"formatting"});case"EEEE":default:return bo.day(Ra,{width:"wide",context:"formatting"})}},e:function(vo,Ai,bo,Ra){const pc=vo.getDay(),mc=(pc-Ra.weekStartsOn+8)%7||7;switch(Ai){case"e":return String(mc);case"ee":return ve$2(mc,2);case"eo":return bo.ordinalNumber(mc,{unit:"day"});case"eee":return bo.day(pc,{width:"abbreviated",context:"formatting"});case"eeeee":return bo.day(pc,{width:"narrow",context:"formatting"});case"eeeeee":return bo.day(pc,{width:"short",context:"formatting"});case"eeee":default:return bo.day(pc,{width:"wide",context:"formatting"})}},c:function(vo,Ai,bo,Ra){const pc=vo.getDay(),mc=(pc-Ra.weekStartsOn+8)%7||7;switch(Ai){case"c":return String(mc);case"cc":return ve$2(mc,Ai.length);case"co":return bo.ordinalNumber(mc,{unit:"day"});case"ccc":return bo.day(pc,{width:"abbreviated",context:"standalone"});case"ccccc":return bo.day(pc,{width:"narrow",context:"standalone"});case"cccccc":return bo.day(pc,{width:"short",context:"standalone"});case"cccc":default:return bo.day(pc,{width:"wide",context:"standalone"})}},i:function(vo,Ai,bo){const Ra=vo.getDay(),pc=Ra===0?7:Ra;switch(Ai){case"i":return String(pc);case"ii":return ve$2(pc,Ai.length);case"io":return bo.ordinalNumber(pc,{unit:"day"});case"iii":return bo.day(Ra,{width:"abbreviated",context:"formatting"});case"iiiii":return bo.day(Ra,{width:"narrow",context:"formatting"});case"iiiiii":return bo.day(Ra,{width:"short",context:"formatting"});case"iiii":default:return bo.day(Ra,{width:"wide",context:"formatting"})}},a:function(vo,Ai,bo){const Ra=vo.getHours()/12>=1?"pm":"am";switch(Ai){case"a":case"aa":return bo.dayPeriod(Ra,{width:"abbreviated",context:"formatting"});case"aaa":return bo.dayPeriod(Ra,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return bo.dayPeriod(Ra,{width:"narrow",context:"formatting"});case"aaaa":default:return bo.dayPeriod(Ra,{width:"wide",context:"formatting"})}},b:function(vo,Ai,bo){const Ra=vo.getHours();let pc;switch(Ra===12?pc=on$1.noon:Ra===0?pc=on$1.midnight:pc=Ra/12>=1?"pm":"am",Ai){case"b":case"bb":return bo.dayPeriod(pc,{width:"abbreviated",context:"formatting"});case"bbb":return bo.dayPeriod(pc,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return bo.dayPeriod(pc,{width:"narrow",context:"formatting"});case"bbbb":default:return bo.dayPeriod(pc,{width:"wide",context:"formatting"})}},B:function(vo,Ai,bo){const Ra=vo.getHours();let pc;switch(Ra>=17?pc=on$1.evening:Ra>=12?pc=on$1.afternoon:Ra>=4?pc=on$1.morning:pc=on$1.night,Ai){case"B":case"BB":case"BBB":return bo.dayPeriod(pc,{width:"abbreviated",context:"formatting"});case"BBBBB":return bo.dayPeriod(pc,{width:"narrow",context:"formatting"});case"BBBB":default:return bo.dayPeriod(pc,{width:"wide",context:"formatting"})}},h:function(vo,Ai,bo){if(Ai==="ho"){let Ra=vo.getHours()%12;return Ra===0&&(Ra=12),bo.ordinalNumber(Ra,{unit:"hour"})}return Nt$2.h(vo,Ai)},H:function(vo,Ai,bo){return Ai==="Ho"?bo.ordinalNumber(vo.getHours(),{unit:"hour"}):Nt$2.H(vo,Ai)},K:function(vo,Ai,bo){const Ra=vo.getHours()%12;return Ai==="Ko"?bo.ordinalNumber(Ra,{unit:"hour"}):ve$2(Ra,Ai.length)},k:function(vo,Ai,bo){let Ra=vo.getHours();return Ra===0&&(Ra=24),Ai==="ko"?bo.ordinalNumber(Ra,{unit:"hour"}):ve$2(Ra,Ai.length)},m:function(vo,Ai,bo){return Ai==="mo"?bo.ordinalNumber(vo.getMinutes(),{unit:"minute"}):Nt$2.m(vo,Ai)},s:function(vo,Ai,bo){return Ai==="so"?bo.ordinalNumber(vo.getSeconds(),{unit:"second"}):Nt$2.s(vo,Ai)},S:function(vo,Ai){return Nt$2.S(vo,Ai)},X:function(vo,Ai,bo){const Ra=vo.getTimezoneOffset();if(Ra===0)return"Z";switch(Ai){case"X":return js$1(Ra);case"XXXX":case"XX":return zt$2(Ra);case"XXXXX":case"XXX":default:return zt$2(Ra,":")}},x:function(vo,Ai,bo){const Ra=vo.getTimezoneOffset();switch(Ai){case"x":return js$1(Ra);case"xxxx":case"xx":return zt$2(Ra);case"xxxxx":case"xxx":default:return zt$2(Ra,":")}},O:function(vo,Ai,bo){const Ra=vo.getTimezoneOffset();switch(Ai){case"O":case"OO":case"OOO":return"GMT"+zs(Ra,":");case"OOOO":default:return"GMT"+zt$2(Ra,":")}},z:function(vo,Ai,bo){const Ra=vo.getTimezoneOffset();switch(Ai){case"z":case"zz":case"zzz":return"GMT"+zs(Ra,":");case"zzzz":default:return"GMT"+zt$2(Ra,":")}},t:function(vo,Ai,bo){const Ra=Math.trunc(+vo/1e3);return ve$2(Ra,Ai.length)},T:function(vo,Ai,bo){return ve$2(+vo,Ai.length)}};function zs(vo,Ai=""){const bo=vo>0?"-":"+",Ra=Math.abs(vo),pc=Math.trunc(Ra/60),mc=Ra%60;return mc===0?bo+String(pc):bo+String(pc)+Ai+ve$2(mc,2)}function js$1(vo,Ai){return vo%60===0?(vo>0?"-":"+")+ve$2(Math.abs(vo)/60,2):zt$2(vo,Ai)}function zt$2(vo,Ai=""){const bo=vo>0?"-":"+",Ra=Math.abs(vo),pc=ve$2(Math.trunc(Ra/60),2),mc=ve$2(Ra%60,2);return bo+pc+Ai+mc}const Ys=(vo,Ai)=>{switch(vo){case"P":return Ai.date({width:"short"});case"PP":return Ai.date({width:"medium"});case"PPP":return Ai.date({width:"long"});case"PPPP":default:return Ai.date({width:"full"})}},xd=(vo,Ai)=>{switch(vo){case"p":return Ai.time({width:"short"});case"pp":return Ai.time({width:"medium"});case"ppp":return Ai.time({width:"long"});case"pppp":default:return Ai.time({width:"full"})}},Lx=(vo,Ai)=>{const bo=vo.match(/(P+)(p+)?/)||[],Ra=bo[1],pc=bo[2];if(!pc)return Ys(vo,Ai);let mc;switch(Ra){case"P":mc=Ai.dateTime({width:"short"});break;case"PP":mc=Ai.dateTime({width:"medium"});break;case"PPP":mc=Ai.dateTime({width:"long"});break;case"PPPP":default:mc=Ai.dateTime({width:"full"});break}return mc.replace("{{date}}",Ys(Ra,Ai)).replace("{{time}}",xd(pc,Ai))},$x={p:xd,P:Lx},Ux=/^D+$/,Hx=/^Y+$/,Wx=["D","DD","YY","YYYY"];function Bx(vo){return Ux.test(vo)}function zx(vo){return Hx.test(vo)}function jx(vo,Ai,bo){const Ra=Yx(vo,Ai,bo);if(console.warn(Ra),Wx.includes(vo))throw new RangeError(Ra)}function Yx(vo,Ai,bo){const Ra=vo[0]==="Y"?"years":"days of the month";return`Use \`${vo.toLowerCase()}\` instead of \`${vo}\` (in \`${Ai}\`) for formatting ${Ra} to the input \`${bo}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Gx=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,qx=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Xx=/^'([^]*?)'?$/,Kx=/''/g,Zx=/[a-zA-Z]/;function Qx(vo,Ai,bo){var Ra,pc,mc,uf,df,ff,hf,pf;const mf=nr$1(),gf=(bo==null?void 0:bo.locale)??mf.locale??Rx,yf=(bo==null?void 0:bo.firstWeekContainsDate)??((pc=(Ra=bo==null?void 0:bo.locale)==null?void 0:Ra.options)==null?void 0:pc.firstWeekContainsDate)??mf.firstWeekContainsDate??((uf=(mc=mf.locale)==null?void 0:mc.options)==null?void 0:uf.firstWeekContainsDate)??1,vf=(bo==null?void 0:bo.weekStartsOn)??((ff=(df=bo==null?void 0:bo.locale)==null?void 0:df.options)==null?void 0:ff.weekStartsOn)??mf.weekStartsOn??((pf=(hf=mf.locale)==null?void 0:hf.options)==null?void 0:pf.weekStartsOn)??0,bf=ct$1(vo,bo==null?void 0:bo.in);if(!Jw(bf))throw new RangeError("Invalid time value");let Sf=Ai.match(qx).map(wf=>{const If=wf[0];if(If==="p"||If==="P"){const l1=$x[If];return l1(wf,gf.formatLong)}return wf}).join("").match(Gx).map(wf=>{if(wf==="''")return{isToken:!1,value:"'"};const If=wf[0];if(If==="'")return{isToken:!1,value:Jx(wf)};if(Bs[If])return{isToken:!0,value:wf};if(If.match(Zx))throw new RangeError("Format string contains an unescaped latin alphabet character `"+If+"`");return{isToken:!1,value:wf}});gf.localize.preprocessor&&(Sf=gf.localize.preprocessor(bf,Sf));const xf={firstWeekContainsDate:yf,weekStartsOn:vf,locale:gf};return Sf.map(wf=>{if(!wf.isToken)return wf.value;const If=wf.value;(!(bo!=null&&bo.useAdditionalWeekYearTokens)&&zx(If)||!(bo!=null&&bo.useAdditionalDayOfYearTokens)&&Bx(If))&&jx(If,Ai,String(vo));const l1=Bs[If[0]];return l1(bf,If,gf.localize,xf)}).join("")}function Jx(vo){const Ai=vo.match(Xx);return Ai?Ai[1].replace(Kx,"'"):vo}function eS(){return Object.assign({},nr$1())}const An$2=({active:vo=!1,...Ai})=>{const bo=Ne$1("h-8 min-w-8 border border-solid border-gray-300 bg-white px-3 py-1 text-xs text-gray-900 hover:bg-gray-100",!vo&&"border-0");return jsx(Dl,{color:"light",size:"small",...Al(Ai,bo),children:Ai.children})},Sd=vo=>{const{pages:Ai=[],goToFirstPage:bo,goToLastPage:Ra,goToNextPage:pc,goToPreviousPage:mc,goToPage:uf,isNextPageAvailable:df,isPreviousPageAvailable:ff,hiddenNextPages:hf,firstPageLabel:pf="First",lastPageLabel:mf="Last",nextPageLabel:gf="Next",previousPageLabel:yf="Previous"}=vo;return jsxs("div",{className:"flex gap-x-1",children:[pf?jsx(An$2,{disabled:!ff,onClick:()=>bo(),children:pf}):null,yf?jsxs(An$2,{disabled:!ff,onClick:()=>mc(),children:[jsx(_e$1,{className:"rotate-90",name:"ChevronDown",size:16}),yf]}):null,Ai.map(vf=>jsx(An$2,{active:vf.active,onClick:()=>uf(vf.index),children:vf.number},vf.index)),hf?jsx("span",{className:"flex items-center justify-center px-2",children:"..."}):null,gf?jsxs(An$2,{disabled:!df,onClick:()=>pc(),children:[gf,jsx(_e$1,{className:"-rotate-90",name:"ChevronDown",size:16})]}):null,mf?jsx(An$2,{disabled:!df,onClick:()=>Ra(),children:mf}):null]})},hr$2=vo=>jsx(Dl,{color:"light",size:"small",...Al(vo,"border border-solid border-gray-300 bg-white px-3 py-1 text-sm text-gray-900"),children:vo.children});function Gs(vo,Ai,bo){const Ra=eS(),pc=rS(vo,bo.timeZone,bo.locale??Ra.locale);return"formatToParts"in pc?tS(pc,Ai):nS(pc,Ai)}function tS(vo,Ai){const bo=vo.formatToParts(Ai);for(let Ra=bo.length-1;Ra>=0;--Ra)if(bo[Ra].type==="timeZoneName")return bo[Ra].value}function nS(vo,Ai){const bo=vo.format(Ai).replace(/\u200E/g,""),Ra=/ [\w-+ ]+$/.exec(bo);return Ra?Ra[0].substr(1):""}function rS(vo,Ai,bo){return new Intl.DateTimeFormat(bo?[bo.code,"en-US"]:void 0,{timeZone:Ai,timeZoneName:vo})}function oS(vo,Ai){const bo=lS(Ai);return"formatToParts"in bo?iS(bo,vo):sS(bo,vo)}const aS={year:0,month:1,day:2,hour:3,minute:4,second:5};function iS(vo,Ai){try{const bo=vo.formatToParts(Ai),Ra=[];for(let pc=0;pc<bo.length;pc++){const mc=aS[bo[pc].type];mc!==void 0&&(Ra[mc]=parseInt(bo[pc].value,10))}return Ra}catch(bo){if(bo instanceof RangeError)return[NaN];throw bo}}function sS(vo,Ai){const bo=vo.format(Ai),Ra=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(bo);return[parseInt(Ra[3],10),parseInt(Ra[1],10),parseInt(Ra[2],10),parseInt(Ra[4],10),parseInt(Ra[5],10),parseInt(Ra[6],10)]}const Qo={},qs$1=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),cS=qs$1==="06/25/2014, 00:00:00"||qs$1==="06/25/2014 00:00:00";function lS(vo){return Qo[vo]||(Qo[vo]=cS?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:vo,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:vo,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),Qo[vo]}function Cd(vo,Ai,bo,Ra,pc,mc,uf){const df=new Date(0);return df.setUTCFullYear(vo,Ai,bo),df.setUTCHours(Ra,pc,mc,uf),df}const Xs=36e5,uS=6e4,Jo={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function yi(vo,Ai,bo){if(!vo)return 0;let Ra=Jo.timezoneZ.exec(vo);if(Ra)return 0;let pc,mc;if(Ra=Jo.timezoneHH.exec(vo),Ra)return pc=parseInt(Ra[1],10),Ks(pc)?-(pc*Xs):NaN;if(Ra=Jo.timezoneHHMM.exec(vo),Ra){pc=parseInt(Ra[2],10);const uf=parseInt(Ra[3],10);return Ks(pc,uf)?(mc=Math.abs(pc)*Xs+uf*uS,Ra[1]==="+"?-mc:mc):NaN}if(mS(vo)){Ai=new Date(Ai||Date.now());const uf=bo?Ai:dS(Ai),df=Na(uf,vo);return-(bo?df:fS(Ai,df,vo))}return NaN}function dS(vo){return Cd(vo.getFullYear(),vo.getMonth(),vo.getDate(),vo.getHours(),vo.getMinutes(),vo.getSeconds(),vo.getMilliseconds())}function Na(vo,Ai){const bo=oS(vo,Ai),Ra=Cd(bo[0],bo[1]-1,bo[2],bo[3]%24,bo[4],bo[5],0).getTime();let pc=vo.getTime();const mc=pc%1e3;return pc-=mc>=0?mc:1e3+mc,Ra-pc}function fS(vo,Ai,bo){let Ra=vo.getTime()-Ai;const pc=Na(new Date(Ra),bo);if(Ai===pc)return Ai;Ra-=pc-Ai;const mc=Na(new Date(Ra),bo);return pc===mc?pc:Math.max(pc,mc)}function Ks(vo,Ai){return-23<=vo&&vo<=23&&(Ai==null||0<=Ai&&Ai<=59)}const Zs={};function mS(vo){if(Zs[vo])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:vo}),Zs[vo]=!0,!0}catch{return!1}}const pS=60*1e3,hS={X:function(vo,Ai,bo){const Ra=ea(bo.timeZone,vo);if(Ra===0)return"Z";switch(Ai){case"X":return Qs(Ra);case"XXXX":case"XX":return an$1(Ra);case"XXXXX":case"XXX":default:return an$1(Ra,":")}},x:function(vo,Ai,bo){const Ra=ea(bo.timeZone,vo);switch(Ai){case"x":return Qs(Ra);case"xxxx":case"xx":return an$1(Ra);case"xxxxx":case"xxx":default:return an$1(Ra,":")}},O:function(vo,Ai,bo){const Ra=ea(bo.timeZone,vo);switch(Ai){case"O":case"OO":case"OOO":return"GMT"+gS(Ra,":");case"OOOO":default:return"GMT"+an$1(Ra,":")}},z:function(vo,Ai,bo){switch(Ai){case"z":case"zz":case"zzz":return Gs("short",vo,bo);case"zzzz":default:return Gs("long",vo,bo)}}};function ea(vo,Ai){const bo=vo?yi(vo,Ai,!0)/pS:(Ai==null?void 0:Ai.getTimezoneOffset())??0;if(Number.isNaN(bo))throw new RangeError("Invalid time zone specified: "+vo);return bo}function Wr$2(vo,Ai){const bo=vo<0?"-":"";let Ra=Math.abs(vo).toString();for(;Ra.length<Ai;)Ra="0"+Ra;return bo+Ra}function an$1(vo,Ai=""){const bo=vo>0?"-":"+",Ra=Math.abs(vo),pc=Wr$2(Math.floor(Ra/60),2),mc=Wr$2(Math.floor(Ra%60),2);return bo+pc+Ai+mc}function Qs(vo,Ai){return vo%60===0?(vo>0?"-":"+")+Wr$2(Math.abs(vo)/60,2):an$1(vo,Ai)}function gS(vo,Ai=""){const bo=vo>0?"-":"+",Ra=Math.abs(vo),pc=Math.floor(Ra/60),mc=Ra%60;return mc===0?bo+String(pc):bo+String(pc)+Ai+Wr$2(mc,2)}function Js(vo){const Ai=new Date(Date.UTC(vo.getFullYear(),vo.getMonth(),vo.getDate(),vo.getHours(),vo.getMinutes(),vo.getSeconds(),vo.getMilliseconds()));return Ai.setUTCFullYear(vo.getFullYear()),+vo-+Ai}const vS=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,ta=36e5,ec=6e4,bS=2,ze$2={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:vS};function Id(vo,Ai={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(vo===null)return new Date(NaN);const bo=Ai.additionalDigits==null?bS:Number(Ai.additionalDigits);if(bo!==2&&bo!==1&&bo!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(vo instanceof Date||typeof vo=="object"&&Object.prototype.toString.call(vo)==="[object Date]")return new Date(vo.getTime());if(typeof vo=="number"||Object.prototype.toString.call(vo)==="[object Number]")return new Date(vo);if(Object.prototype.toString.call(vo)!=="[object String]")return new Date(NaN);const Ra=yS(vo),{year:pc,restDateString:mc}=wS(Ra.date,bo),uf=xS(mc,pc);if(uf===null||isNaN(uf.getTime()))return new Date(NaN);if(uf){const df=uf.getTime();let ff=0,hf;if(Ra.time&&(ff=SS(Ra.time),ff===null||isNaN(ff)))return new Date(NaN);if(Ra.timeZone||Ai.timeZone){if(hf=yi(Ra.timeZone||Ai.timeZone,new Date(df+ff)),isNaN(hf))return new Date(NaN)}else hf=Js(new Date(df+ff)),hf=Js(new Date(df+ff+hf));return new Date(df+ff+hf)}else return new Date(NaN)}function yS(vo){const Ai={};let bo=ze$2.dateTimePattern.exec(vo),Ra;if(bo?(Ai.date=bo[1],Ra=bo[3]):(bo=ze$2.datePattern.exec(vo),bo?(Ai.date=bo[1],Ra=bo[2]):(Ai.date=null,Ra=vo)),Ra){const pc=ze$2.timeZone.exec(Ra);pc?(Ai.time=Ra.replace(pc[1],""),Ai.timeZone=pc[1].trim()):Ai.time=Ra}return Ai}function wS(vo,Ai){if(vo){const bo=ze$2.YYY[Ai],Ra=ze$2.YYYYY[Ai];let pc=ze$2.YYYY.exec(vo)||Ra.exec(vo);if(pc){const mc=pc[1];return{year:parseInt(mc,10),restDateString:vo.slice(mc.length)}}if(pc=ze$2.YY.exec(vo)||bo.exec(vo),pc){const mc=pc[1];return{year:parseInt(mc,10)*100,restDateString:vo.slice(mc.length)}}}return{year:null}}function xS(vo,Ai){if(Ai===null)return null;let bo,Ra,pc;if(!vo||!vo.length)return bo=new Date(0),bo.setUTCFullYear(Ai),bo;let mc=ze$2.MM.exec(vo);if(mc)return bo=new Date(0),Ra=parseInt(mc[1],10)-1,nc(Ai,Ra)?(bo.setUTCFullYear(Ai,Ra),bo):new Date(NaN);if(mc=ze$2.DDD.exec(vo),mc){bo=new Date(0);const uf=parseInt(mc[1],10);return ES(Ai,uf)?(bo.setUTCFullYear(Ai,0,uf),bo):new Date(NaN)}if(mc=ze$2.MMDD.exec(vo),mc){bo=new Date(0),Ra=parseInt(mc[1],10)-1;const uf=parseInt(mc[2],10);return nc(Ai,Ra,uf)?(bo.setUTCFullYear(Ai,Ra,uf),bo):new Date(NaN)}if(mc=ze$2.Www.exec(vo),mc)return pc=parseInt(mc[1],10)-1,rc(pc)?tc(Ai,pc):new Date(NaN);if(mc=ze$2.WwwD.exec(vo),mc){pc=parseInt(mc[1],10)-1;const uf=parseInt(mc[2],10)-1;return rc(pc,uf)?tc(Ai,pc,uf):new Date(NaN)}return null}function SS(vo){let Ai,bo,Ra=ze$2.HH.exec(vo);if(Ra)return Ai=parseFloat(Ra[1].replace(",",".")),na(Ai)?Ai%24*ta:NaN;if(Ra=ze$2.HHMM.exec(vo),Ra)return Ai=parseInt(Ra[1],10),bo=parseFloat(Ra[2].replace(",",".")),na(Ai,bo)?Ai%24*ta+bo*ec:NaN;if(Ra=ze$2.HHMMSS.exec(vo),Ra){Ai=parseInt(Ra[1],10),bo=parseInt(Ra[2],10);const pc=parseFloat(Ra[3].replace(",","."));return na(Ai,bo,pc)?Ai%24*ta+bo*ec+pc*1e3:NaN}return null}function tc(vo,Ai,bo){Ai=Ai||0,bo=bo||0;const Ra=new Date(0);Ra.setUTCFullYear(vo,0,4);const pc=Ra.getUTCDay()||7,mc=Ai*7+bo+1-pc;return Ra.setUTCDate(Ra.getUTCDate()+mc),Ra}const CS=[31,28,31,30,31,30,31,31,30,31,30,31],IS=[31,29,31,30,31,30,31,31,30,31,30,31];function Ed(vo){return vo%400===0||vo%4===0&&vo%100!==0}function nc(vo,Ai,bo){if(Ai<0||Ai>11)return!1;if(bo!=null){if(bo<1)return!1;const Ra=Ed(vo);if(Ra&&bo>IS[Ai]||!Ra&&bo>CS[Ai])return!1}return!0}function ES(vo,Ai){if(Ai<1)return!1;const bo=Ed(vo);return!(bo&&Ai>366||!bo&&Ai>365)}function rc(vo,Ai){return!(vo<0||vo>52||Ai!=null&&(Ai<0||Ai>6))}function na(vo,Ai,bo){return!(vo<0||vo>=25||Ai!=null&&(Ai<0||Ai>=60)||bo!=null&&(bo<0||bo>=60))}const PS=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function TS(vo,Ai,bo={}){Ai=String(Ai);const Ra=Ai.match(PS);if(Ra){const pc=Id(bo.originalDate||vo,bo);Ai=Ra.reduce(function(mc,uf){if(uf[0]==="'")return mc;const df=mc.indexOf(uf),ff=mc[df-1]==="'",hf=mc.replace(uf,"'"+hS[uf[0]](pc,uf,bo)+"'");return ff?hf.substring(0,df-1)+hf.substring(df+1):hf},Ai)}return Qx(vo,Ai,bo)}function OS(vo,Ai,bo){vo=Id(vo,bo);const Ra=yi(Ai,vo,!0),pc=new Date(vo.getTime()-Ra),mc=new Date(0);return mc.setFullYear(pc.getUTCFullYear(),pc.getUTCMonth(),pc.getUTCDate()),mc.setHours(pc.getUTCHours(),pc.getUTCMinutes(),pc.getUTCSeconds(),pc.getUTCMilliseconds()),mc}function Pd(vo,Ai,bo,Ra){return Ra={...Ra,timeZone:Ai,originalDate:vo},TS(OS(vo,Ai,{timeZone:Ra.timeZone}),bo,Ra)}function wi(vo,Ai=!0,bo=!1){const Ra=Ai?"yyyy/MM/dd, HH:mm:ss zzz":"yyyy/MM/dd",pc=bo?"UTC":Td();return Pd(vo,pc,Ra)}function MS(vo){if(!/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/.test(vo))return!1;const Ai=new Date(vo);return Ai instanceof Date&&!isNaN(Ai.getTime())&&Ai.toISOString()===vo}function Td(){return Intl.DateTimeFormat().resolvedOptions().timeZone}function ra(vo,Ai=!1){const bo=Ai?"yyyy-MM-dd'T'HH:mm:ss":"yyyy-MM-dd",Ra=Td();return Pd(vo,Ra,bo)}const NS="SERVICE_PROVIDER_FEE_TYPE",AS="FIXED_INCOME_TYPE",DS="ACCOUNT",RS="TRANSACTION",_S="ASSET",kS="SPV",Ce$2={SERVICE_PROVIDER_FEE_TYPE:NS,FIXED_INCOME_TYPE:AS,ACCOUNT:DS,TRANSACTION:RS,ASSET:_S,SPV:kS},jn$2={SERVICE_PROVIDER_FEE_TYPE:"Service Provider Fee Type",FIXED_INCOME_TYPE:"Fixed Income Asset Type",ACCOUNT:"Account",TRANSACTION:"Transaction",ASSET:"Asset",SPV:"SPV"},Od="AssetPurchase",Md="AssetSale",FS="PrincipalDraw",VS="PrincipalReturn",LS="InterestIncome",$S="InterestPayment",Nd="FeesIncome",US="FeesPayment",HS=[FS,VS],xi=[Od,Md],Si=[Nd,US],WS=[LS,$S],Ci=[...HS,...xi,...Si,...WS],Ii$1={AssetPurchase:"Asset purchase",AssetSale:"Asset sale",PrincipalDraw:"Principal draw",PrincipalReturn:"Principal return",InterestIncome:"Interest income",InterestPayment:"Interest payment",FeesIncome:"Fees income",FeesPayment:"Fees payment"};function BS(vo){const{tableName:Ai,tableItem:bo,fixedIncomeTypes:Ra,spvs:pc,accounts:mc}=vo;return useMemo(()=>{var uf,df,ff,hf,pf;if(!bo)switch(Ai){case Ce$2.ASSET:return{fixedIncomeTypeId:((uf=Ra[0])==null?void 0:uf.id)??null,spvId:((df=pc[0])==null?void 0:df.id)??null,name:null,maturity:null,ISIN:null,CUSIP:null,coupon:null};case Ce$2.TRANSACTION:return{type:Ci[0],entryTime:ra(new Date().toISOString(),!0),cashAmount:null,fixedIncomeId:null,fixedIncomeAmount:null,serviceProviderFeeTypeId:null,fees:null,txRef:null};case Ce$2.SPV:return{name:null};case Ce$2.SERVICE_PROVIDER_FEE_TYPE:return{name:null,feeType:null,accountId:((ff=mc[0])==null?void 0:ff.id)??null};case Ce$2.FIXED_INCOME_TYPE:return{name:null};case Ce$2.ACCOUNT:return{label:null,reference:null}}switch(Ai){case Ce$2.ASSET:{const mf=bo;return{id:mf.id,fixedIncomeTypeId:mf.fixedIncomeTypeId,spvId:mf.spvId,name:mf.name,maturity:mf.maturity?ra(mf.maturity):null,ISIN:mf.ISIN,CUSIP:mf.CUSIP,coupon:mf.coupon}}case Ce$2.TRANSACTION:{const mf=bo;return{id:mf.id,type:mf.type,entryTime:mf.entryTime?ra(mf.entryTime,!0):null,cashAmount:mf.cashTransaction.amount??null,fixedIncomeId:((hf=mf.fixedIncomeTransaction)==null?void 0:hf.assetId)??null,fixedIncomeAmount:((pf=mf.fixedIncomeTransaction)==null?void 0:pf.amount)??null,serviceProviderFeeTypeId:mf.serviceProviderFeeTypeId??null,fees:mf.fees??null,txRef:mf.txRef??null}}case Ce$2.SPV:{const mf=bo;return{id:mf.id,name:mf.name}}case Ce$2.SERVICE_PROVIDER_FEE_TYPE:{const mf=bo;return{id:mf.id,name:mf.name,feeType:mf.feeType,accountId:mf.accountId}}case Ce$2.FIXED_INCOME_TYPE:{const mf=bo;return{id:mf.id,name:mf.name}}case Ce$2.ACCOUNT:{const mf=bo;return{id:mf.id,label:mf.label,reference:mf.reference}}}},[mc,Ra,pc,bo,Ai])}function zS(vo){return xi.includes(vo)}function jS(vo){return vo?vo.type==="FixedIncome"||"fixedIncomeId"in vo:!1}function YS(vo){return vo?vo.type==="Cash"||"currency"in vo:!1}function Ei(vo){return vo.filter(Ai=>jS(Ai))}function GS(vo){const Ai=vo.find(bo=>YS(bo));if(!Ai)throw new Error("Cash asset not found");return Ai}const qS={1520:10,1394:9,1239:8,1112:7,984:6},Ad={AssetSale:1,PrincipalDraw:1,AssetPurchase:-1,PrincipalReturn:-1,FeesIncome:1,FeesPayment:-1,InterestIncome:1,InterestPayment:-1},XS={AssetSale:-1,AssetPurchase:1};function KS(vo){return{ASSET:"portfolio",TRANSACTION:"transactions",ACCOUNT:"accounts",FIXED_INCOME_TYPE:"fixedIncomeTypes",SERVICE_PROVIDER_FEE_TYPE:"serviceProviderFeeTypes",SPV:"spvs"}[vo]}function ZS(vo){return vo.type.split("_").slice(1).join("_")}function QS(vo){return vo.type.split("_")[0]}function gr$2(vo,Ai){return vo.reduce((bo,Ra)=>bo+Number(Ra[Ai]),0)}const Dt$2=py$1(JR,{number:"BigNumber"});function JS(vo){const{asset:Ai,transactions:bo,fixedIncomeTypes:Ra,currentDate:pc=new Date}=vo;if(!(Ai!=null&&Ai.maturity))return null;const mc=Ra.find(({id:Sf})=>Sf===Ai.fixedIncomeTypeId);if(!mc||mc.name!=="Treasury Bill")return null;const uf=bo.filter(({type:Sf,fixedIncomeTransaction:xf})=>Sf===Od&&(xf==null?void 0:xf.assetId)===Ai.id),df=bo.filter(({type:Sf,fixedIncomeTransaction:xf})=>Sf===Md&&(xf==null?void 0:xf.assetId)===Ai.id);if(!uf.length&&!df.length)return null;const ff=Dt$2.bignumber(pc.getTime()),hf=Dt$2.bignumber(new Date(Ai.maturity).getTime());if(hf.lessThan(ff))return null;const pf=Dt$2.bignumber(new Date(Ai.purchaseDate).getTime()),mf=oc(uf).sub(oc(df)),gf=Dt$2.bignumber(Ai.salesProceeds),yf=Dt$2.bignumber(Ai.realizedSurplus),vf=Dt$2.bignumber(Ai.purchaseProceeds).sub(gf).add(yf),bf=mf.sub(vf);return ff.sub(pf).div(hf.sub(pf)).mul(bf).add(vf).toNumber()}function oc(vo){return vo.reduce((Ai,{fixedIncomeTransaction:bo})=>bo?Ai.add(Dt$2.bignumber(bo.amount)):Ai,Dt$2.bignumber(0))}function Dd(vo,Ai){var bo={};for(var Ra in vo)Object.prototype.hasOwnProperty.call(vo,Ra)&&Ai.indexOf(Ra)<0&&(bo[Ra]=vo[Ra]);if(vo!=null&&typeof Object.getOwnPropertySymbols=="function")for(var pc=0,Ra=Object.getOwnPropertySymbols(vo);pc<Ra.length;pc++)Ai.indexOf(Ra[pc])<0&&Object.prototype.propertyIsEnumerable.call(vo,Ra[pc])&&(bo[Ra[pc]]=vo[Ra[pc]]);return bo}var Yn$2;(function(vo){vo.event="event",vo.props="prop"})(Yn$2||(Yn$2={}));function _t$2(){}function eC(vo){var Ai,bo=void 0;return function(){for(var Ra=[],pc=arguments.length;pc--;)Ra[pc]=arguments[pc];return Ai&&Ra.length===Ai.length&&Ra.every(function(mc,uf){return mc===Ai[uf]})||(Ai=Ra,bo=vo.apply(void 0,Ra)),bo}}function Gn$1(vo){return!!(vo||"").match(/\d/)}function fn$1(vo){return vo==null}function tC(vo){return typeof vo=="number"&&isNaN(vo)}function Rd(vo){return fn$1(vo)||tC(vo)||typeof vo=="number"&&!isFinite(vo)}function _d(vo){return vo.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function nC(vo){switch(vo){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;case"thousand":default:return/(\d)(?=(\d{3})+(?!\d))/g}}function rC(vo,Ai,bo){var Ra=nC(bo),pc=vo.search(/[1-9]/);return pc=pc===-1?vo.length:pc,vo.substring(0,pc)+vo.substring(pc,vo.length).replace(Ra,"$1"+Ai)}function oC(vo){var Ai=useRef(vo);Ai.current=vo;var bo=useRef(function(){for(var Ra=[],pc=arguments.length;pc--;)Ra[pc]=arguments[pc];return Ai.current.apply(Ai,Ra)});return bo.current}function Pi(vo,Ai){Ai===void 0&&(Ai=!0);var bo=vo[0]==="-",Ra=bo&&Ai;vo=vo.replace("-","");var pc=vo.split("."),mc=pc[0],uf=pc[1]||"";return{beforeDecimal:mc,afterDecimal:uf,hasNegation:bo,addNegation:Ra}}function aC(vo){if(!vo)return vo;var Ai=vo[0]==="-";Ai&&(vo=vo.substring(1,vo.length));var bo=vo.split("."),Ra=bo[0].replace(/^0+/,"")||"0",pc=bo[1]||"";return(Ai?"-":"")+Ra+(pc?"."+pc:"")}function kd(vo,Ai,bo){for(var Ra="",pc=bo?"0":"",mc=0;mc<=Ai-1;mc++)Ra+=vo[mc]||pc;return Ra}function ac(vo,Ai){return Array(Ai+1).join(vo)}function Fd(vo){var Ai=vo+"",bo=Ai[0]==="-"?"-":"";bo&&(Ai=Ai.substring(1));var Ra=Ai.split(/[eE]/g),pc=Ra[0],mc=Ra[1];if(mc=Number(mc),!mc)return bo+pc;pc=pc.replace(".","");var uf=1+mc,df=pc.length;return uf<0?pc="0."+ac("0",Math.abs(uf))+pc:uf>=df?pc=pc+ac("0",uf-df):pc=(pc.substring(0,uf)||"0")+"."+pc.substring(uf),bo+pc}function ic(vo,Ai,bo){if(["","-"].indexOf(vo)!==-1)return vo;var Ra=(vo.indexOf(".")!==-1||bo)&&Ai,pc=Pi(vo),mc=pc.beforeDecimal,uf=pc.afterDecimal,df=pc.hasNegation,ff=parseFloat("0."+(uf||"0")),hf=uf.length<=Ai?"0."+uf:ff.toFixed(Ai),pf=hf.split("."),mf=mc;mc&&Number(pf[0])&&(mf=mc.split("").reverse().reduce(function(bf,Sf,xf){return bf.length>xf?(Number(bf[0])+Number(Sf)).toString()+bf.substring(1,bf.length):Sf+bf},pf[0]));var gf=kd(pf[1]||"",Ai,bo),yf=df?"-":"",vf=Ra?".":"";return""+yf+mf+vf+gf}function Yt$1(vo,Ai){if(vo.value=vo.value,vo!==null){if(vo.createTextRange){var bo=vo.createTextRange();return bo.move("character",Ai),bo.select(),!0}return vo.selectionStart||vo.selectionStart===0?(vo.focus(),vo.setSelectionRange(Ai,Ai),!0):(vo.focus(),!1)}}var Vd=eC(function(vo,Ai){for(var bo=0,Ra=0,pc=vo.length,mc=Ai.length;vo[bo]===Ai[bo]&&bo<pc;)bo++;for(;vo[pc-1-Ra]===Ai[mc-1-Ra]&&mc-Ra>bo&&pc-Ra>bo;)Ra++;return{from:{start:bo,end:pc-Ra},to:{start:bo,end:mc-Ra}}}),iC=function(vo,Ai){var bo=Math.min(vo.selectionStart,Ai);return{from:{start:bo,end:vo.selectionEnd},to:{start:bo,end:Ai}}};function sC(vo,Ai,bo){return Math.min(Math.max(vo,Ai),bo)}function oa(vo){return Math.max(vo.selectionStart,vo.selectionEnd)}function cC(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function lC(vo){return{from:{start:0,end:0},to:{start:0,end:vo.length},lastValue:""}}function uC(vo){var Ai=vo.currentValue,bo=vo.formattedValue,Ra=vo.currentValueIndex,pc=vo.formattedValueIndex;return Ai[Ra]===bo[pc]}function dC(vo,Ai,bo,Ra,pc,mc,uf){uf===void 0&&(uf=uC);var df=pc.findIndex(function(l1){return l1}),ff=vo.slice(0,df);!Ai&&!bo.startsWith(ff)&&(Ai=ff,bo=ff+bo,Ra=Ra+ff.length);for(var hf=bo.length,pf=vo.length,mf={},gf=new Array(hf),yf=0;yf<hf;yf++){gf[yf]=-1;for(var vf=0,bf=pf;vf<bf;vf++){var Sf=uf({currentValue:bo,lastValue:Ai,formattedValue:vo,currentValueIndex:yf,formattedValueIndex:vf});if(Sf&&mf[vf]!==!0){gf[yf]=vf,mf[vf]=!0;break}}}for(var xf=Ra;xf<hf&&(gf[xf]===-1||!mc(bo[xf]));)xf++;var wf=xf===hf||gf[xf]===-1?pf:gf[xf];for(xf=Ra-1;xf>0&&gf[xf]===-1;)xf--;var If=xf===-1||gf[xf]===-1?0:gf[xf]+1;return If>wf?wf:Ra-If<wf-Ra?If:wf}function sc(vo,Ai,bo,Ra){var pc=vo.length;if(Ai=sC(Ai,0,pc),Ra==="left"){for(;Ai>=0&&!bo[Ai];)Ai--;Ai===-1&&(Ai=bo.indexOf(!0))}else{for(;Ai<=pc&&!bo[Ai];)Ai++;Ai>pc&&(Ai=bo.lastIndexOf(!0))}return Ai===-1&&(Ai=pc),Ai}function fC(vo){for(var Ai=Array.from({length:vo.length+1}).map(function(){return!0}),bo=0,Ra=Ai.length;bo<Ra;bo++)Ai[bo]=!!(Gn$1(vo[bo])||Gn$1(vo[bo-1]));return Ai}function Ld(vo,Ai,bo,Ra,pc,mc){mc===void 0&&(mc=_t$2);var uf=oC(function(vf,bf){var Sf,xf;return Rd(vf)?(xf="",Sf=""):typeof vf=="number"||bf?(xf=typeof vf=="number"?Fd(vf):vf,Sf=Ra(xf)):(xf=pc(vf,void 0),Sf=Ra(xf)),{formattedValue:Sf,numAsString:xf}}),df=useState(function(){return uf(fn$1(vo)?Ai:vo,bo)}),ff=df[0],hf=df[1],pf=function(vf,bf){vf.formattedValue!==ff.formattedValue&&hf({formattedValue:vf.formattedValue,numAsString:vf.value}),mc(vf,bf)},mf=vo,gf=bo;fn$1(vo)&&(mf=ff.numAsString,gf=!0);var yf=uf(mf,gf);return useMemo(function(){hf(yf)},[yf.formattedValue]),[ff,pf]}function mC(vo){return vo.replace(/[^0-9]/g,"")}function pC(vo){return vo}function hC(vo){var Ai=vo.type;Ai===void 0&&(Ai="text");var bo=vo.displayType;bo===void 0&&(bo="input");var Ra=vo.customInput,pc=vo.renderText,mc=vo.getInputRef,uf=vo.format;uf===void 0&&(uf=pC);var df=vo.removeFormatting;df===void 0&&(df=mC);var ff=vo.defaultValue,hf=vo.valueIsNumericString,pf=vo.onValueChange,mf=vo.isAllowed,gf=vo.onChange;gf===void 0&&(gf=_t$2);var yf=vo.onKeyDown;yf===void 0&&(yf=_t$2);var vf=vo.onMouseUp;vf===void 0&&(vf=_t$2);var bf=vo.onFocus;bf===void 0&&(bf=_t$2);var Sf=vo.onBlur;Sf===void 0&&(Sf=_t$2);var xf=vo.value,wf=vo.getCaretBoundary;wf===void 0&&(wf=fC);var If=vo.isValidInputCharacter;If===void 0&&(If=Gn$1);var l1=vo.isCharacterSame,s1=Dd(vo,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),c1=Ld(xf,ff,!!hf,uf,df,pf),u1=c1[0],T1=u1.formattedValue,_1=u1.numAsString,R1=c1[1],P1=useRef(),E1=useRef({formattedValue:T1,numAsString:_1}),M1=function(D1,d1){E1.current={formattedValue:D1.formattedValue,numAsString:D1.value},R1(D1,d1)},m1=useState(!1),$1=m1[0],k1=m1[1],F1=useRef(null),U1=useRef({setCaretTimeout:null,focusTimeout:null});useEffect(function(){return k1(!0),function(){clearTimeout(U1.current.setCaretTimeout),clearTimeout(U1.current.focusTimeout)}},[]);var B1=uf,W1=function(D1,d1){var f1=parseFloat(d1);return{formattedValue:D1,value:d1,floatValue:isNaN(f1)?void 0:f1}},Z1=function(D1,d1,f1){D1.selectionStart===0&&D1.selectionEnd===D1.value.length||(Yt$1(D1,d1),U1.current.setCaretTimeout=setTimeout(function(){D1.value===f1&&D1.selectionStart!==d1&&Yt$1(D1,d1)},0))},O1=function(D1,d1,f1){return sc(D1,d1,wf(D1),f1)},j1=function(D1,d1,f1){var A1=wf(d1),Q1=dC(d1,T1,D1,f1,A1,If,l1);return Q1=sc(d1,Q1,A1),Q1},L1=function(D1){var d1=D1.formattedValue;d1===void 0&&(d1="");var f1=D1.input,A1=D1.source,Q1=D1.event,q1=D1.numAsString,H1;if(f1){var J1=D1.inputValue||f1.value,eT=oa(f1);f1.value=d1,H1=j1(J1,d1,eT),H1!==void 0&&Z1(f1,H1,d1)}d1!==T1&&M1(W1(d1,q1),{event:Q1,source:A1})};useEffect(function(){var D1=E1.current,d1=D1.formattedValue,f1=D1.numAsString;(T1!==d1||_1!==f1)&&M1(W1(T1,_1),{event:void 0,source:Yn$2.props})},[T1,_1]);var G1=F1.current?oa(F1.current):void 0,Y1=typeof window<"u"?useLayoutEffect:useEffect;Y1(function(){var D1=F1.current;if(T1!==E1.current.formattedValue&&D1){var d1=j1(E1.current.formattedValue,T1,G1);D1.value=T1,Z1(D1,d1,T1)}},[T1]);var z1=function(D1,d1,f1){var A1=d1.target,Q1=P1.current?iC(P1.current,A1.selectionEnd):Vd(T1,D1),q1=Object.assign(Object.assign({},Q1),{lastValue:T1}),H1=df(D1,q1),J1=B1(H1);if(H1=df(J1,void 0),mf&&!mf(W1(J1,H1))){var eT=d1.target,rT=oa(eT),sT=j1(D1,T1,rT);return eT.value=T1,Z1(eT,sT,T1),!1}return L1({formattedValue:J1,numAsString:H1,inputValue:D1,event:d1,source:f1,input:d1.target}),!0},K1=function(D1,d1){d1===void 0&&(d1=0);var f1=D1.selectionStart,A1=D1.selectionEnd;P1.current={selectionStart:f1,selectionEnd:A1+d1}},tT=function(D1){var d1=D1.target,f1=d1.value,A1=z1(f1,D1,Yn$2.event);A1&&gf(D1),P1.current=void 0},iT=function(D1){var d1=D1.target,f1=D1.key,A1=d1.selectionStart,Q1=d1.selectionEnd,q1=d1.value;q1===void 0&&(q1="");var H1;f1==="ArrowLeft"||f1==="Backspace"?H1=Math.max(A1-1,0):f1==="ArrowRight"?H1=Math.min(A1+1,q1.length):f1==="Delete"&&(H1=A1);var J1=0;f1==="Delete"&&A1===Q1&&(J1=1);var eT=f1==="ArrowLeft"||f1==="ArrowRight";if(H1===void 0||A1!==Q1&&!eT){yf(D1),K1(d1,J1);return}var rT=H1;if(eT){var sT=f1==="ArrowLeft"?"left":"right";rT=O1(q1,H1,sT),rT!==H1&&D1.preventDefault()}else f1==="Delete"&&!If(q1[H1])?rT=O1(q1,H1,"right"):f1==="Backspace"&&!If(q1[H1])&&(rT=O1(q1,H1,"left"));rT!==H1&&Z1(d1,rT,q1),yf(D1),K1(d1,J1)},aT=function(D1){var d1=D1.target,f1=function(){var A1=d1.selectionStart,Q1=d1.selectionEnd,q1=d1.value;if(q1===void 0&&(q1=""),A1===Q1){var H1=O1(q1,A1);H1!==A1&&Z1(d1,H1,q1)}};f1(),requestAnimationFrame(function(){f1()}),vf(D1),K1(d1)},oT=function(D1){D1.persist&&D1.persist();var d1=D1.target,f1=D1.currentTarget;F1.current=d1,U1.current.focusTimeout=setTimeout(function(){var A1=d1.selectionStart,Q1=d1.selectionEnd,q1=d1.value;q1===void 0&&(q1="");var H1=O1(q1,A1);H1!==A1&&!(A1===0&&Q1===q1.length)&&Z1(d1,H1,q1),bf(Object.assign(Object.assign({},D1),{currentTarget:f1}))},0)},nT=function(D1){F1.current=null,clearTimeout(U1.current.focusTimeout),clearTimeout(U1.current.setCaretTimeout),Sf(D1)},cT=$1&&cC()?"numeric":void 0,N1=Object.assign({inputMode:cT},s1,{type:Ai,value:T1,onChange:tT,onKeyDown:iT,onMouseUp:aT,onFocus:oT,onBlur:nT});if(bo==="text")return pc?y__default.createElement(y__default.Fragment,null,pc(T1,s1)||null):y__default.createElement("span",Object.assign({},s1,{ref:mc}),T1);if(Ra){var V1=Ra;return y__default.createElement(V1,Object.assign({},N1,{ref:mc}))}return y__default.createElement("input",Object.assign({},N1,{ref:mc}))}function cc(vo,Ai){var bo=Ai.decimalScale,Ra=Ai.fixedDecimalScale,pc=Ai.prefix;pc===void 0&&(pc="");var mc=Ai.suffix;mc===void 0&&(mc="");var uf=Ai.allowNegative,df=Ai.thousandsGroupStyle;if(df===void 0&&(df="thousand"),vo===""||vo==="-")return vo;var ff=go(Ai),hf=ff.thousandSeparator,pf=ff.decimalSeparator,mf=bo!==0&&vo.indexOf(".")!==-1||bo&&Ra,gf=Pi(vo,uf),yf=gf.beforeDecimal,vf=gf.afterDecimal,bf=gf.addNegation;return bo!==void 0&&(vf=kd(vf,bo,!!Ra)),hf&&(yf=rC(yf,hf,df)),pc&&(yf=pc+yf),mc&&(vf=vf+mc),bf&&(yf="-"+yf),vo=yf+(mf&&pf||"")+vf,vo}function go(vo){var Ai=vo.decimalSeparator;Ai===void 0&&(Ai=".");var bo=vo.thousandSeparator,Ra=vo.allowedDecimalSeparators;return bo===!0&&(bo=","),Ra||(Ra=[Ai,"."]),{decimalSeparator:Ai,thousandSeparator:bo,allowedDecimalSeparators:Ra}}function gC(vo,Ai){vo===void 0&&(vo="");var bo=new RegExp("(-)"),Ra=new RegExp("(-)(.)*(-)"),pc=bo.test(vo),mc=Ra.test(vo);return vo=vo.replace(/-/g,""),pc&&!mc&&Ai&&(vo="-"+vo),vo}function vC(vo,Ai){return new RegExp("(^-)|[0-9]|"+_d(vo),"g")}function bC(vo,Ai,bo){return vo===""?!0:!(Ai!=null&&Ai.match(/\d/))&&!(bo!=null&&bo.match(/\d/))&&typeof vo=="string"&&!isNaN(Number(vo))}function yC(vo,Ai,bo){var Ra;Ai===void 0&&(Ai=lC(vo));var pc=bo.allowNegative,mc=bo.prefix;mc===void 0&&(mc="");var uf=bo.suffix;uf===void 0&&(uf="");var df=bo.decimalScale,ff=Ai.from,hf=Ai.to,pf=hf.start,mf=hf.end,gf=go(bo),yf=gf.allowedDecimalSeparators,vf=gf.decimalSeparator,bf=vo[mf]===vf;if(Gn$1(vo)&&(vo===mc||vo===uf)&&Ai.lastValue==="")return vo;if(mf-pf===1&&yf.indexOf(vo[pf])!==-1){var Sf=df===0?"":vf;vo=vo.substring(0,pf)+Sf+vo.substring(pf+1,vo.length)}var xf=function(F1,U1,B1){var W1=!1,Z1=!1;mc.startsWith("-")?W1=!1:F1.startsWith("--")?(W1=!1,Z1=!0):uf.startsWith("-")&&F1.length===uf.length?W1=!1:F1[0]==="-"&&(W1=!0);var O1=W1?1:0;return Z1&&(O1=2),O1&&(F1=F1.substring(O1),U1-=O1,B1-=O1),{value:F1,start:U1,end:B1,hasNegation:W1}},wf=xf(vo,pf,mf),If=wf.hasNegation;Ra=wf,vo=Ra.value,pf=Ra.start,mf=Ra.end;var l1=xf(Ai.lastValue,ff.start,ff.end),s1=l1.start,c1=l1.end,u1=l1.value,T1=vo.substring(pf,mf);vo.length&&u1.length&&(s1>u1.length-uf.length||c1<mc.length)&&!(T1&&uf.startsWith(T1))&&(vo=u1);var _1=0;vo.startsWith(mc)?_1+=mc.length:pf<mc.length&&(_1=pf),vo=vo.substring(_1),mf-=_1;var R1=vo.length,P1=vo.length-uf.length;vo.endsWith(uf)?R1=P1:(mf>P1||mf>vo.length-uf.length)&&(R1=mf),vo=vo.substring(0,R1),vo=gC(If?"-"+vo:vo,pc),vo=(vo.match(vC(vf))||[]).join("");var E1=vo.indexOf(vf);vo=vo.replace(new RegExp(_d(vf),"g"),function(F1,U1){return U1===E1?".":""});var M1=Pi(vo,pc),m1=M1.beforeDecimal,$1=M1.afterDecimal,k1=M1.addNegation;return hf.end-hf.start<ff.end-ff.start&&m1===""&&bf&&!parseFloat($1)&&(vo=k1?"-":""),vo}function wC(vo,Ai){var bo=Ai.prefix;bo===void 0&&(bo="");var Ra=Ai.suffix;Ra===void 0&&(Ra="");var pc=Array.from({length:vo.length+1}).map(function(){return!0}),mc=vo[0]==="-";pc.fill(!1,0,bo.length+(mc?1:0));var uf=vo.length;return pc.fill(!1,uf-Ra.length+1,uf+1),pc}function xC(vo){var Ai=go(vo),bo=Ai.thousandSeparator,Ra=Ai.decimalSeparator,pc=vo.prefix;pc===void 0&&(pc="");var mc=vo.allowNegative;if(mc===void 0&&(mc=!0),bo===Ra)throw new Error(`
|
|
59
|
-
Decimal separator can't be same as thousand separator.
|
|
60
|
-
thousandSeparator: `+bo+` (thousandSeparator = {true} is same as thousandSeparator = ",")
|
|
61
|
-
decimalSeparator: `+Ra+` (default value for decimalSeparator is .)
|
|
62
|
-
`);return pc.startsWith("-")&&mc&&(console.error(`
|
|
63
|
-
Prefix can't start with '-' when allowNegative is true.
|
|
64
|
-
prefix: `+pc+`
|
|
65
|
-
allowNegative: `+mc+`
|
|
66
|
-
`),mc=!1),Object.assign(Object.assign({},vo),{allowNegative:mc})}function SC(vo){vo=xC(vo),vo.decimalSeparator,vo.allowedDecimalSeparators,vo.thousandsGroupStyle;var Ai=vo.suffix,bo=vo.allowNegative,Ra=vo.allowLeadingZeros,pc=vo.onKeyDown;pc===void 0&&(pc=_t$2);var mc=vo.onBlur;mc===void 0&&(mc=_t$2);var uf=vo.thousandSeparator,df=vo.decimalScale,ff=vo.fixedDecimalScale,hf=vo.prefix;hf===void 0&&(hf="");var pf=vo.defaultValue,mf=vo.value,gf=vo.valueIsNumericString,yf=vo.onValueChange,vf=Dd(vo,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),bf=go(vo),Sf=bf.decimalSeparator,xf=bf.allowedDecimalSeparators,wf=function(k1){return cc(k1,vo)},If=function(k1,F1){return yC(k1,F1,vo)},l1=fn$1(mf)?pf:mf,s1=gf??bC(l1,hf,Ai);fn$1(mf)?fn$1(pf)||(s1=s1||typeof pf=="number"):s1=s1||typeof mf=="number";var c1=function(k1){return Rd(k1)?k1:(typeof k1=="number"&&(k1=Fd(k1)),s1&&typeof df=="number"?ic(k1,df,!!ff):k1)},u1=Ld(c1(mf),c1(pf),!!s1,wf,If,yf),T1=u1[0],_1=T1.numAsString,R1=T1.formattedValue,P1=u1[1],E1=function(k1){var F1=k1.target,U1=k1.key,B1=F1.selectionStart,W1=F1.selectionEnd,Z1=F1.value;if(Z1===void 0&&(Z1=""),(U1==="Backspace"||U1==="Delete")&&W1<hf.length){k1.preventDefault();return}if(B1!==W1){pc(k1);return}U1==="Backspace"&&Z1[0]==="-"&&B1===hf.length+1&&bo&&Yt$1(F1,1),df&&ff&&(U1==="Backspace"&&Z1[B1-1]===Sf?(Yt$1(F1,B1-1),k1.preventDefault()):U1==="Delete"&&Z1[B1]===Sf&&k1.preventDefault()),xf!=null&&xf.includes(U1)&&Z1[B1]===Sf&&Yt$1(F1,B1+1);var O1=uf===!0?",":uf;U1==="Backspace"&&Z1[B1-1]===O1&&Yt$1(F1,B1-1),U1==="Delete"&&Z1[B1]===O1&&Yt$1(F1,B1+1),pc(k1)},M1=function(k1){var F1=_1;if(F1.match(/\d/g)||(F1=""),Ra||(F1=aC(F1)),ff&&df&&(F1=ic(F1,df,ff)),F1!==_1){var U1=cc(F1,vo);P1({formattedValue:U1,value:F1,floatValue:parseFloat(F1)},{event:k1,source:Yn$2.event})}mc(k1)},m1=function(k1){return k1===Sf?!0:Gn$1(k1)},$1=function(k1){var F1=k1.currentValue,U1=k1.lastValue,B1=k1.formattedValue,W1=k1.currentValueIndex,Z1=k1.formattedValueIndex,O1=F1[W1],j1=B1[Z1],L1=Vd(U1,F1),G1=L1.to,Y1=function(z1){return If(z1).indexOf(".")+hf.length};return mf===0&&ff&&df&&F1[G1.start]===Sf&&Y1(F1)<W1&&Y1(B1)>Z1?!1:W1>=G1.start&&W1<G1.end&&xf&&xf.includes(O1)&&j1===Sf?!0:O1===j1};return Object.assign(Object.assign({},vf),{value:R1,valueIsNumericString:!1,isValidInputCharacter:m1,isCharacterSame:$1,onValueChange:P1,format:wf,removeFormatting:If,getCaretBoundary:function(k1){return wC(k1,vo)},onKeyDown:E1,onBlur:M1})}function $d(vo){var Ai=SC(vo);return y__default.createElement(hC,Object.assign({},Ai))}function Ti(vo){const{value:Ai,currency:bo,decimalScale:Ra=2,thousandSeparator:pc=",",fixedDecimalScale:mc=!0}=vo;return jsx($d,{decimalScale:Ra,displayType:"text",fixedDecimalScale:mc,prefix:bo==="USD"?"$":void 0,thousandSeparator:pc,value:Ai})}function CC(vo,Ai=!0){if(vo instanceof Date||MS(vo)){const bo=vo instanceof Date?vo.toISOString():vo;return wi(bo,Ai)}return vo}function pt$2(vo,Ai=2,bo=!0){return vo==null?"--":typeof vo=="number"?jsx(Ti,{decimalScale:Ai,value:vo}):CC(vo,bo)}function IC(vo,Ai){return!vo||!Ai?0:vo/Ai}function EC(vo,Ai,bo){if(!Ai||!vo)return 0;const Ra=Ad[vo],pc=((bo==null?void 0:bo.map(mc=>mc.amount).filter(Boolean))??[]).reduce((mc,uf)=>mc+uf,0);return Ai*Ra-pc}function PC(vo){const{fixedIncomeTypes:Ai}=vo;return xn$1(Ai)}function TC(vo){const{spvs:Ai}=vo;return xn$1(Ai)}function OC(vo){const{portfolio:Ai,transactions:bo,fixedIncomeTypes:Ra}=vo,pc=new Date,mc=Ei(Ai).map(uf=>{const df=JS({asset:uf,currentDate:pc,transactions:bo,fixedIncomeTypes:Ra});return{...uf,currentValue:df}});return xn$1(mc)}function aa$1(vo,Ai){return vo&&vo*Ai}function MC(vo){const{transactions:Ai,portfolio:bo}=vo,Ra=Ei(bo),pc=Ai.map(mc=>{var uf,df,ff;const hf=mc.id,pf=mc.entryTime,mf=(uf=Ra.find(l1=>{var s1;return l1.id===((s1=mc.fixedIncomeTransaction)==null?void 0:s1.assetId)}))==null?void 0:uf.name,gf=mc.type,yf=Ii$1[gf],vf=Ad[gf],bf=zS(gf)?XS[gf]:1,Sf=aa$1((df=mc.fixedIncomeTransaction)==null?void 0:df.amount,bf),xf=aa$1(mc.cashTransaction.amount,vf),wf=Si.includes(mc.type)?aa$1(mc.cashTransaction.amount,mc.type===Nd?-1:1)??0:((ff=mc.fees)==null?void 0:ff.reduce((l1,s1)=>l1+s1.amount,0))??0,If=mc.cashBalanceChange;return{...mc,id:hf,type:gf,typeLabel:yf,entryTime:pf,asset:mf,quantity:Sf,cashAmount:xf,totalFees:wf,cashBalanceChange:If}});return xn$1(pc)}function NC(vo){const{accounts:Ai,principalLenderAccountId:bo}=vo,Ra=Ai.filter(pc=>pc.id!==bo);return xn$1(Ra)}function AC(vo){const{serviceProviderFeeTypes:Ai,accounts:bo}=vo,Ra=Ai.map(pc=>{const mc=bo.find(uf=>uf.id===pc.accountId);return{...pc,accountName:mc==null?void 0:mc.label,accountReference:mc==null?void 0:mc.reference}});return xn$1(Ra)}function xn$1(vo){return vo.map((Ai,bo)=>({...Ai,itemNumber:bo+1}))}function Aa(vo,Ai){return DC[vo](Ai)}const DC={ASSET:OC,TRANSACTION:MC,ACCOUNT:NC,FIXED_INCOME_TYPE:PC,SERVICE_PROVIDER_FEE_TYPE:AC,SPV:TC},RC={accounts:[],fixedIncomeTypes:[],portfolio:[],principalLenderAccountId:"",serviceProviderFeeTypes:[],spvs:[],transactions:[],fixedIncomes:[],cashAsset:{id:"",type:"Cash",currency:"USD",balance:0,spvId:""},isAllowedToCreateDocuments:!1,isAllowedToEditDocuments:!1,canUndo:!1,canRedo:!1,operation:null,onSwitchboardLinkClick:void 0,selectedTableItem:null,selectedTableName:null,getIsFormOpen:()=>!1,clearSelected:()=>{},viewItem:()=>{},createItem:()=>{},editItem:()=>{},onExport:()=>{},onClose:()=>{},handleUndo:()=>{},handleRedo:()=>{},onShowRevisionHistory:()=>{},handleAction:()=>{}},Oi$1=createContext(RC);Oi$1.displayName="EditorContext";function _C(vo,Ai){switch(Ai.type){case"VIEW_ITEM":return{selectedTableItem:Ai.item,selectedTableName:Ai.tableName,operation:"view"};case"CREATE_ITEM":return{selectedTableItem:null,selectedTableName:Ai.tableName,operation:"create"};case"EDIT_ITEM":return{selectedTableItem:Ai.item,selectedTableName:Ai.tableName,operation:"edit"};case"CLEAR_SELECTED":return{selectedTableItem:null,selectedTableName:null,operation:null};default:return vo}}function x1(vo){const{children:Ai,state:bo,isAllowedToCreateDocuments:Ra,isAllowedToEditDocuments:pc,canUndo:mc,canRedo:uf,undo:df,redo:ff,editorDispatcher:hf,onExport:pf,onClose:mf,onSwitchboardLinkClick:gf,onShowRevisionHistory:yf}=vo,[vf,bf]=useState(bo),Sf=useRef(bo),[xf,wf]=useReducer(_C,{selectedTableItem:null,selectedTableName:null,operation:null}),{selectedTableItem:If,selectedTableName:l1,operation:s1}=xf;useEffect(()=>{(s1===null||s1==="view")&&bf(Sf.current)},[s1,bo]),useEffect(()=>{Sf.current=bo},[bo]);const{accounts:c1,fixedIncomeTypes:u1,portfolio:T1,principalLenderAccountId:_1,serviceProviderFeeTypes:R1,spvs:P1,transactions:E1}=vf,M1=useMemo(()=>GS(T1),[T1]),m1=useMemo(()=>Ei(T1),[T1]),$1=useCallback(()=>{mc&&df()},[mc,df]),k1=useCallback(()=>{uf&&ff()},[uf,ff]),F1=useCallback(L1=>l1===L1,[l1]),U1=useCallback((L1,G1)=>{wf({type:"VIEW_ITEM",item:L1,tableName:G1})},[]),B1=useCallback(L1=>{wf({type:"CREATE_ITEM",tableName:L1})},[]),W1=useCallback((L1,G1)=>{wf({type:"EDIT_ITEM",item:L1,tableName:G1})},[]),Z1=useCallback(()=>{wf({type:"CLEAR_SELECTED"}),bf(Sf.current)},[]),O1=useCallback(L1=>{try{const G1=hf(L1),Y1=QS(L1);if(Y1==="DELETE"||!G1){Z1();return}const z1=ZS(L1),K1=KS(z1),tT=Sf.current[K1];if(typeof tT=="string")return;if(Y1==="CREATE"){const iT=[...tT,G1],aT={...Sf.current,[K1]:iT};if(Sf.current=aT,bf(aT),z1===l1){const oT=Aa(z1,aT).find(nT=>nT.id===G1.id);oT&&U1(oT,z1)}}if(Y1==="EDIT"){const iT=tT.map(nT=>nT.id===G1.id?G1:nT),aT={...Sf.current,[K1]:iT};Sf.current=aT,bf(aT);const oT=Aa(z1,aT).find(nT=>nT.id===G1.id);oT&&W1(oT,z1)}}catch(G1){console.error(`Failed to dispatch action ${L1.type}`,G1)}},[Z1,hf,W1,l1,U1]),j1=useMemo(()=>({accounts:c1,fixedIncomeTypes:u1,portfolio:T1,principalLenderAccountId:_1,serviceProviderFeeTypes:R1,spvs:P1,transactions:E1,cashAsset:M1,fixedIncomes:m1,canUndo:mc,canRedo:uf,isAllowedToCreateDocuments:Ra,isAllowedToEditDocuments:pc,selectedTableItem:If,selectedTableName:l1,operation:s1,handleAction:O1,handleUndo:$1,handleRedo:k1,viewItem:U1,createItem:B1,editItem:W1,clearSelected:Z1,getIsFormOpen:F1,onExport:pf,onClose:mf,onSwitchboardLinkClick:gf,onShowRevisionHistory:yf}),[c1,uf,mc,M1,Z1,B1,W1,u1,m1,F1,O1,k1,$1,Ra,pc,mf,pf,yf,gf,s1,T1,_1,If,l1,R1,P1,E1,U1]);return jsx(Oi$1.Provider,{value:j1,children:Ai})}function tt$2(){return useContext(Oi$1)}function kC(vo){return Wf({defaultValues:vo})}function FC(vo){const{operation:Ai,tableName:bo,tableItem:Ra}=vo,{handleAction:pc,fixedIncomeTypes:mc,spvs:uf,accounts:df}=tt$2(),ff=BS({tableName:bo,tableItem:Ra,fixedIncomeTypes:mc,spvs:uf,accounts:df}),hf=Ai==="create"?"CREATE":"EDIT",pf=ff,{register:mf,handleSubmit:gf,reset:yf,watch:vf,control:bf,formState:Sf}=kC(pf);useEffect(()=>{yf(pf)},[pf,yf]);const xf=useCallback(If=>{const l1=`${hf}_${bo}`;pc({type:l1,payload:If})},[hf,pc,bo]),wf=gf(xf);return useMemo(()=>({register:mf,reset:yf,watch:vf,control:bf,formState:Sf,submit:wf}),[bf,Sf,mf,yf,wf,vf])}function VC(vo){const{control:Ai}=vo,bo=kt$2({control:Ai,name:"cashAmount"}),Ra=kt$2({control:Ai,name:"type"}),pc=kt$2({control:Ai,name:"fees"}),mc=EC(Ra,bo,pc);return jsxs("div",{className:"flex items-center justify-between border-t border-gray-300 bg-gray-100 p-3 font-semibold text-gray-800",children:[jsx("div",{className:"mr-6 text-sm text-gray-600",children:"Cash Balance Change $USD"}),jsx("div",{className:"h-px flex-1 border-b border-dashed border-gray-400"}),jsx("div",{className:"pl-8 text-sm text-gray-900",children:jsx(Ti,{value:mc})})]})}function LC({control:vo}){const Ai=kt$2({control:vo,name:"entryTime"});return Ai?wi(new Date(Ai),!0,!0):null}function jt$2(vo){const{options:Ai,name:bo,control:Ra,rules:pc,errorMessage:mc,errorMessageClassName:uf,disabled:df=!1,...ff}=vo,hf=vo["aria-invalid"]==="true";return jsx(Ec,{control:Ra,name:bo,render:({field:{onChange:pf,onBlur:mf,value:gf}})=>{var yf;return df?jsx(Fragment,{children:(yf=Ai.find(vf=>vf.value===gf))==null?void 0:yf.label}):jsxs(Fragment,{children:[jsx(Ca,{isDisabled:df,onBlur:mf,onChange:vf=>!!vf&&typeof vf=="object"&&"value"in vf&&pf(vf.value),options:Ai,value:Ai.find(vf=>vf.value===gf)??null,...ff}),hf&&mc?jsx("p",{className:Ne$1("text-sm text-red-900",uf),role:"alert",children:mc}):null]})},rules:pc})}const nt$1=forwardRef(function(vo,Ai){const bo=vo["aria-invalid"]==="true",{errorMessage:Ra,labelClassName:pc,inputClassName:mc,errorMessageClassName:uf,...df}=vo;return jsxs("label",{className:pc,children:[jsx("input",{...df,className:Ne$1("h-8 w-full rounded-md border border-transparent bg-gray-100 p-3 text-right placeholder:text-gray-500 disabled:bg-transparent disabled:p-0 disabled:text-left",bo&&"border-red-900 outline-red-900 placeholder:text-red-800",mc),ref:Ai,type:"text"}),bo&&Ra?jsx("p",{className:Ne$1("text-sm text-red-900",uf),role:"alert",children:Ra}):null]})});function Da(vo){const{name:Ai,control:bo,currency:Ra,rules:pc,errorMessage:mc,errorMessageClassName:uf,numericFormatProps:df,value:ff,onChange:hf,...pf}=vo,{allowNegative:mf=!1,decimalScale:gf=2,thousandSeparator:yf=",",fixedDecimalScale:vf=!0}=df??{},bf=Ra==="USD"?"$":void 0,Sf=vo["aria-invalid"]==="true";return jsx(Ec,{control:bo,name:Ai,render:({field:{onChange:xf,value:wf,ref:If}})=>jsxs(Fragment,{children:[jsx($d,{...pf,allowNegative:mf,customInput:nt$1,decimalScale:gf,fixedDecimalScale:vf,getInputRef:If,onValueChange:({floatValue:l1})=>xf(l1),prefix:bf,thousandSeparator:yf,value:wf}),Sf&&mc?jsx("p",{className:Ne$1("text-sm text-red-900",uf),role:"alert",children:mc}):null]}),rules:pc})}function $C(vo){const Ai=["Fees","Service Provider","Amount",""],{canHaveTransactionFees:bo,serviceProviderFeeTypes:Ra,serviceProviderFeeTypeOptions:pc,control:mc,errors:uf,isViewOnly:df,showCreateServiceProviderFeeTypeModal:ff}=vo,{fields:hf,append:pf,remove:mf}=Rf({control:mc,name:"fees"});return bo?jsxs(Fragment,{children:[hf.length>0&&jsx("div",{className:"bg-gray-50 pl-5 pt-3",children:jsxs("table",{className:"w-full border-separate text-xs font-medium",children:[jsx("thead",{className:"mb-2",children:jsx("tr",{children:Ai.map(gf=>jsx("th",{className:Ne$1("py-2 text-left font-medium text-gray-600",gf==="Amount"&&!df&&"text-right"),children:gf},gf))})}),jsx("tbody",{children:hf.map((gf,yf)=>{var vf,bf,Sf,xf;return jsxs("tr",{children:[jsx("td",{className:"w-52"}),jsx("td",{className:"w-96",children:jsx(jt$2,{addItemButtonProps:{onClick:ff,label:"Add Service Provider"},"aria-invalid":(bf=(vf=uf.fees)==null?void 0:vf[yf])!=null&&bf.serviceProviderFeeTypeId?"true":"false",control:mc,disabled:df,name:`fees.${yf}.serviceProviderFeeTypeId`,options:pc,rules:{required:"Service provider is required"}})}),jsx("td",{className:"w-52",children:jsx(Da,{"aria-invalid":(xf=(Sf=uf.fees)==null?void 0:Sf[yf])!=null&&xf.amount?"true":"false",control:mc,currency:"USD",disabled:df,name:`fees.${yf}.amount`,placeholder:"E.g. $1,000.00",rules:{required:"Amount is required",validate:{positive:wf=>!!wf&&Number(wf)>0||"Fee amount must be greater than zero"}}})}),jsx("td",{className:"",children:!df&&jsx("button",{className:"flex items-center",onClick:()=>mf(yf),type:"button",children:jsx(_e$1,{className:"text-gray-900",name:"Xmark"})})})]},gf.id)})})]})}),!df&&jsxs("button",{className:"ml-[234px] mt-1 flex w-fit items-center justify-center gap-x-2 rounded-lg bg-white pb-6 text-sm font-semibold text-gray-900",onClick:()=>{var gf;return pf({amount:null,serviceProviderFeeTypeId:(gf=Ra[0])==null?void 0:gf.id})},children:[jsx("span",{children:"Add Fee"}),jsx(_e$1,{name:"Plus",size:16})]})]}):null}function UC(vo){const{control:Ai}=vo,bo=kt$2({control:Ai,name:"cashAmount"}),Ra=kt$2({control:Ai,name:"fixedIncomeAmount"}),pc=IC(bo,Ra);return jsxs("div",{className:Ne$1("mt-1 w-fit",!vo.isViewOnly&&"ml-auto"),children:[jsx("span",{className:"text-gray-600",children:"Unit Price"})," ",jsx("span",{className:"text-gray-900",children:jsx(Ti,{decimalScale:6,value:pc})})]})}function HC(vo){return WC(vo)?vo.length===66:!1}function WC(vo){return typeof vo=="string"&&vo.startsWith("0x")}const BC=forwardRef(function(vo,Ai){const{control:bo,disabled:Ra}=vo,pc=kt$2({control:bo,name:"txRef"}),mc=46,uf=typeof pc=="string"&&pc.length>=mc?`${pc.slice(0,mc)}...`:pc,df=HC(pc),ff=jsxs("div",{children:[jsx("p",{children:pc}),df?jsx("p",{className:"mt-2 text-center",children:jsx("a",{className:"text-blue-900 underline",href:`https://etherscan.io/tx/${pc}`,children:"View on Etherscan"})}):null]});return Ra?jsx(Yw,{children:jsx(jw,{content:ff,children:jsx("span",{children:uf})})}):jsx(nt$1,{...vo,ref:Ai})});function Ud(vo){let Ai=vo.name;return vo.ISIN&&(Ai+=` - ${vo.ISIN}`),vo.CUSIP&&(Ai+=` - ${vo.CUSIP}`),Ai}function zC(vo){const{tableName:Ai,operation:bo,formState:Ra,tableItem:pc,register:mc,watch:uf,control:df}=vo,{fixedIncomeTypes:ff,spvs:hf,serviceProviderFeeTypes:pf,accounts:mf,fixedIncomes:gf}=tt$2(),{showModal:yf}=Bd(),vf=useCallback(bf=>()=>{yf("createItem",{tableName:bf})},[yf]);return useMemo(()=>{switch(Ai){case Ce$2.ASSET:{const bf=pc,Sf=mc,xf=Ra,{errors:wf}=xf,If=df,l1=bo!=="create"&&bf?[{label:"Notional",Input:()=>jsx(Fragment,{children:pt$2(bf.notional)})},{label:"Purchase Date",Input:()=>jsx(Fragment,{children:pt$2(bf.purchaseDate)})},{label:"Purchase Price",Input:()=>jsx(Fragment,{children:pt$2(bf.purchasePrice,6)})},{label:"Purchase Proceeds",Input:()=>jsx(Fragment,{children:pt$2(bf.purchaseProceeds)})}]:[];return{inputs:[{label:"Asset Name",Input:()=>{var s1;return jsx(nt$1,{...Sf("name",{disabled:bo==="view",required:"Asset name is required"}),"aria-invalid":wf.name?"true":"false",errorMessage:(s1=wf.name)==null?void 0:s1.message,inputClassName:"text-left",placeholder:"E.g. My Asset"})}},{label:"CUSIP",Input:()=>{var s1;return bo==="view"?(bf==null?void 0:bf.CUSIP)??"Not available":jsx(nt$1,{...Sf("CUSIP",{maxLength:{value:9,message:"CUSIP cannot be longer than 9 characters"},minLength:{value:9,message:"CUSIP cannot be shorter than 9 characters"},pattern:{value:/^[a-zA-Z0-9]*$/,message:"CUSIP must be alphanumeric"}}),"aria-invalid":wf.CUSIP?"true":"false",errorMessage:(s1=wf.CUSIP)==null?void 0:s1.message,placeholder:"E.g. A2345B789"})}},{label:"ISIN",Input:()=>{var s1;return bo==="view"?(bf==null?void 0:bf.ISIN)??"Not available":jsx(nt$1,{...Sf("ISIN",{maxLength:{value:12,message:"ISIN cannot be longer than 12 characters"},minLength:{value:12,message:"ISIN cannot be shorter than 12 characters"},pattern:{value:/^[a-zA-Z0-9]*$/,message:"ISIN must be alphanumeric"}}),"aria-invalid":wf.ISIN?"true":"false",errorMessage:(s1=wf.ISIN)==null?void 0:s1.message,placeholder:"E.g. 123456789ABC"})}},{label:"Maturity",Input:()=>jsx("input",{className:"h-8 w-full rounded-md bg-gray-100 px-3 disabled:bg-transparent disabled:p-0",step:1,type:"date",...Sf("maturity",{disabled:bo==="view"})}),inputLabel:bf!=null&&bf.maturity?wi(bf.maturity,!0):null},{label:"Asset Type",Input:()=>{var s1;return jsx(jt$2,{addItemButtonProps:{onClick:vf("ASSET"),label:"Create Fixed Income Type"},"aria-invalid":wf.fixedIncomeTypeId?"true":"false",control:If,disabled:bo==="view",errorMessage:(s1=wf.fixedIncomeTypeId)==null?void 0:s1.message,name:"fixedIncomeTypeId",options:ff.map(c1=>({...c1,value:c1.id,label:c1.name})),rules:{required:"Asset type is required"}})}},{label:"SPV",Input:()=>{var s1;return jsx(jt$2,{addItemButtonProps:{onClick:vf("SPV"),label:"Create SPV"},"aria-invalid":wf.spvId?"true":"false",control:If,disabled:bo==="view",errorMessage:(s1=wf.spvId)==null?void 0:s1.message,name:"spvId",options:hf.map(c1=>({...c1,value:c1.id,label:c1.name})),rules:{required:"SPV is required"}})}},...l1]}}case Ce$2.TRANSACTION:{const bf=mc,Sf=uf,{errors:xf}=Ra,wf=df,If=Sf("type"),l1=!!If&&Si.includes(If),s1=!!If&&xi.includes(If),c1=!l1,u1=Ci.map(E1=>({label:Ii$1[E1],value:E1})),T1=gf.map(E1=>({label:Ud(E1),value:E1.id})),_1=pf.map(E1=>{var M1;return{label:`${E1.name} — ${E1.feeType} — ${(M1=mf.find(m1=>m1.id===E1.accountId))==null?void 0:M1.reference}`,value:E1.id}}),R1=[{label:"Transaction Type",Input:()=>{var E1;return jsx(jt$2,{"aria-invalid":xf.type?"true":"false",control:wf,disabled:bo==="view",errorMessage:(E1=xf.type)==null?void 0:E1.message,name:"type",options:u1,rules:{required:"Transaction type is required"}})}},{label:"Entry Time",Input:()=>jsx("input",{className:"h-8 w-full rounded-md bg-gray-100 px-3 disabled:bg-transparent disabled:p-0",step:1,type:"datetime-local",...bf("entryTime",{disabled:bo==="view",required:"Entry time is required"})}),inputLabel:jsx(LC,{control:wf})},l1?{label:"Service Provider",Input:()=>jsx(jt$2,{addItemButtonProps:{onClick:vf("SERVICE_PROVIDER_FEE_TYPE"),label:"Add Service Provider"},control:wf,disabled:bo==="view",name:"serviceProviderFeeTypeId",options:_1})}:null,s1?{label:"Asset name",Input:()=>{var E1;return jsx(jt$2,{addItemButtonProps:{onClick:vf("ASSET"),label:"Create Asset"},"aria-invalid":xf.type?"true":"false",control:wf,disabled:bo==="view",errorMessage:(E1=xf.type)==null?void 0:E1.message,name:"fixedIncomeId",options:T1,rules:{required:"Asset name is required"}})}}:void 0,s1?{label:"Quantity",Input:()=>{var E1;return jsx(Da,{"aria-invalid":xf.fixedIncomeAmount?"true":"false",control:wf,disabled:bo==="view",errorMessage:(E1=xf.fixedIncomeAmount)==null?void 0:E1.message,name:"fixedIncomeAmount",placeholder:"E.g. 1,000.00",rules:{required:"Quantity is required",validate:{positive:M1=>!!M1&&Number(M1)>0||"Asset proceeds must be greater than zero"}}})}}:void 0,{label:s1?"Asset Proceeds":"Cash Amount",Input:()=>{var E1;return jsxs(Fragment,{children:[jsx(Da,{"aria-invalid":xf.cashAmount?"true":"false",control:wf,currency:"USD",disabled:bo==="view",errorMessage:(E1=xf.cashAmount)==null?void 0:E1.message,name:"cashAmount",placeholder:"E.g. $1,000.00",rules:{required:"Asset proceeds is required",validate:{positive:M1=>!!M1&&Number(M1)>0||"Asset proceeds must be greater than zero"}}}),s1?jsx(UC,{control:wf,isViewOnly:bo==="view"}):null]})}},{label:"Transaction reference",Input:()=>{var E1;return jsx(BC,{...bf("txRef",{disabled:bo==="view"}),"aria-invalid":xf.txRef?"true":"false",control:wf,errorMessage:(E1=xf.txRef)==null?void 0:E1.message,placeholder:"E.g. 0x123..."})}}].filter(Boolean),P1=jsxs(Fragment,{children:[jsx($C,{canHaveTransactionFees:c1,control:wf,errors:xf,isViewOnly:bo==="view",serviceProviderFeeTypeOptions:_1,serviceProviderFeeTypes:pf,showCreateServiceProviderFeeTypeModal:vf("SERVICE_PROVIDER_FEE_TYPE")}),jsx(VC,{control:wf})]});return{inputs:R1,additionalInputs:P1}}case Ce$2.ACCOUNT:{const bf=mc,Sf=Ra,{errors:xf}=Sf;return{inputs:[{label:"Account Label",Input:()=>{var wf,If;return jsx(nt$1,{...bf("label",{disabled:bo==="view",required:"Account label is required"}),"aria-invalid":((wf=xf.label)==null?void 0:wf.type)==="required"?"true":"false",errorMessage:(If=xf.label)==null?void 0:If.message,placeholder:"E.g. My Label"})}},{label:"Account Reference",Input:()=>{var wf,If;return jsx(nt$1,{...bf("reference",{disabled:bo==="view",required:"Account reference is required"}),"aria-invalid":((wf=xf.reference)==null?void 0:wf.type)==="required"?"true":"false",errorMessage:(If=xf.reference)==null?void 0:If.message,placeholder:"E.g. bank account number or ETH address"})}}]}}case Ce$2.SPV:{const bf=mc,Sf=Ra,{errors:xf}=Sf;return{inputs:[{label:"SPV name",Input:()=>{var wf,If;return jsx(nt$1,{...bf("name",{disabled:bo==="view",required:"SPV name is required"}),"aria-invalid":((wf=xf.name)==null?void 0:wf.type)==="required"?"true":"false",errorMessage:(If=xf.name)==null?void 0:If.message,placeholder:"E.g. My SPV name"})}}]}}case Ce$2.FIXED_INCOME_TYPE:{const bf=mc,Sf=Ra,{errors:xf}=Sf;return{inputs:[{label:"Fixed Income Type Name",Input:()=>{var wf,If;return jsx(nt$1,{...bf("name",{disabled:bo==="view",required:"Fixed Income Type name is required"}),"aria-invalid":((wf=xf.name)==null?void 0:wf.type)==="required"?"true":"false",errorMessage:(If=xf.name)==null?void 0:If.message,placeholder:"E.g. My Fixed Income Type name"})}}]}}case Ce$2.SERVICE_PROVIDER_FEE_TYPE:{const bf=mc,Sf=Ra,{errors:xf}=Sf,wf=df,If=s1=>`${s1.label} (${s1.reference})`,l1=s1=>s1.map(c1=>({...c1,value:c1.id,label:If(c1)}));return{inputs:[{label:"Service Provider Name",Input:()=>{var s1,c1;return jsx(nt$1,{...bf("name",{disabled:bo==="view",required:"Service provider name is required"}),"aria-invalid":((s1=xf.name)==null?void 0:s1.type)==="required"?"true":"false",errorMessage:(c1=xf.name)==null?void 0:c1.message,placeholder:"E.g. My Service Provider"})}},{label:"Fee Type",Input:()=>{var s1,c1;return jsx(nt$1,{...bf("feeType",{disabled:bo==="view",required:"Fee type is required"}),"aria-invalid":((s1=xf.name)==null?void 0:s1.type)==="required"?"true":"false",errorMessage:(c1=xf.name)==null?void 0:c1.message,placeholder:"E.g. My Fee Type"})}},{label:"Account",Input:()=>{var s1;return jsx(jt$2,{addItemButtonProps:{onClick:vf("ACCOUNT"),label:"Create Account"},"aria-invalid":xf.accountId?"true":"false",control:wf,disabled:bo==="view",errorMessage:(s1=xf.accountId)==null?void 0:s1.message,name:"accountId",options:l1(mf),rules:{required:"Account is required"}})}}]}}}},[Ra,df,mc,pc,uf,mf,ff,gf,bo,pf,vf,hf,Ai])}function Hd(vo){const{operation:Ai,tableName:bo,tableItem:Ra}=vo,{submit:pc,reset:mc,register:uf,control:df,formState:ff,watch:hf}=FC({operation:Ai,tableName:bo,tableItem:Ra}),pf=zC({formState:ff,operation:Ai,control:df,watch:hf,tableItem:Ra,tableName:bo,register:uf});return useMemo(()=>({submit:pc,reset:mc,register:uf,control:df,formInputs:pf,formState:ff}),[pc,mc,uf,df,pf,ff])}function jC(vo){const{inputs:Ai}=vo;return jsx("div",{className:"bg-white text-xs font-medium",children:Ai.map(({label:bo,Input:Ra},pc)=>jsxs("div",{className:"mb-4 mt-2 grid gap-1",children:[jsx("label",{className:"text-base",children:bo}),jsx("div",{children:jsx(Ra,{})},pc)]},bo))})}const YC=memo(function(vo){const{tableName:Ai,open:bo,onOpenChange:Ra}=vo,{reset:pc,submit:mc,formInputs:{inputs:uf,additionalInputs:df}}=Hd({operation:"create",tableName:Ai}),ff=jn$2[Ai],hf=useCallback(()=>{pc(),Ra(!1)},[Ra,pc]),pf=useCallback(async()=>{try{await mc(),Ra(!1)}catch(gf){console.error(gf)}},[Ra,mc]),mf="min-h-[48px] min-w-[142px] text-base font-semibold py-3 px-6 rounded-xl outline-none active:opacity-75 hover:scale-105 transform transition-all";return jsx(cd,{contentProps:{className:"rounded-3xl"},onOpenChange:Ra,open:bo,overlayProps:{className:"top-10"},children:jsxs("div",{className:"w-[400px] p-6 text-slate-300",children:[jsxs("div",{className:"mb-6 flex justify-between",children:[jsxs("h1",{className:"text-xl font-bold",children:["Create ",ff]}),jsx("button",{className:"flex size-8 items-center justify-center rounded-md bg-gray-100 text-gray-500 outline-none hover:text-gray-900",onClick:hf,tabIndex:-1,children:jsx(_e$1,{name:"XmarkLight",size:24})})]}),jsx(jC,{inputs:uf}),df,jsxs("div",{className:"mt-8 flex justify-between gap-3",children:[jsx("button",{className:Ne$1(mf,"flex-1 bg-slate-50 text-slate-800"),onClick:hf,children:"Cancel"}),jsx("button",{className:Ne$1(mf,"flex-1 bg-gray-800 text-gray-50"),onClick:pf,children:"Save"})]})]})})}),GC=memo(function(vo){const{tableName:Ai,dependentItemProps:bo,onOpenChange:Ra,open:pc}=vo,mc=jn$2[Ai].toLowerCase(),uf=useCallback(()=>{Ra==null||Ra(!1)},[Ra]);return jsx(cd,{contentProps:{className:"rounded-3xl"},onOpenChange:Ra,open:pc,overlayProps:{className:"top-10"},children:jsxs("div",{className:"w-[400px] p-6 text-slate-300",children:[jsxs("div",{className:"border-b border-slate-50 pb-2 text-2xl font-bold text-gray-800",children:["Cannot delete ",Ai]}),jsxs("div",{className:"my-6 flex gap-2 rounded-md bg-orange-100 p-4 text-orange-800",children:[jsx("div",{children:jsx(_e$1,{className:"mt-1 text-orange-800",name:"Error"})}),jsxs("div",{children:["Warning! Cannot delete this ",mc," because there are items that depend on it. Please change or delete those first."]})]}),jsx("div",{className:"my-6 rounded-md bg-slate-50 p-4 text-slate-200",children:bo.map(({dependentTableName:df,dependentItems:ff})=>jsxs("div",{children:[jsx("div",{className:"mb-0.5 font-semibold",children:`${jn$2[df]}s: `},1),ff.map(({id:hf,label:pf})=>jsx("div",{children:pf},hf))]},df))}),jsx("div",{className:"mt-8 flex justify-between gap-3",children:jsx("button",{className:"min-h-12 min-w-36 flex-1 rounded-xl bg-gray-800 px-6 py-3 text-base font-semibold text-gray-50 outline-none transition-all hover:scale-105 active:opacity-75",onClick:uf,children:"Back"})})]})})}),qC={createItem:YC,deleteItem:GC},Wd=y__default.createContext({showModal:()=>{},closeModal:()=>{}}),Bd=()=>useContext(Wd),XC=vo=>{const{children:Ai}=vo,[bo,Ra]=useState(),[pc,mc]=useState(),[uf,df]=useState(!1),ff=useCallback((gf,yf)=>{df(!0),Ra(yf),mc(gf)},[]),hf=useCallback(()=>{df(!1)},[]),pf=pc?qC[pc]:null,mf=useMemo(()=>({showModal:ff,closeModal:hf}),[hf,ff]);return jsxs(Wd.Provider,{value:mf,children:[Ai,pf?jsx(pf,{...bo,onOpenChange:df,open:uf}):null]})};var Mi="Tabs",[KC,S1]=Wt$2(Mi,[co$1]),zd=co$1(),[ZC,Ni]=KC(Mi),jd=y$2.forwardRef((vo,Ai)=>{const{__scopeTabs:bo,value:Ra,onValueChange:pc,defaultValue:mc,orientation:uf="horizontal",dir:df,activationMode:ff="automatic",...hf}=vo,pf=ei(df),[mf,gf]=Qn$2({prop:Ra,onChange:pc,defaultProp:mc});return jsx(ZC,{scope:bo,baseId:Ft$2(),value:mf,onValueChange:gf,orientation:uf,dir:pf,activationMode:ff,children:jsx(we$1.div,{dir:pf,"data-orientation":uf,...hf,ref:Ai})})});jd.displayName=Mi;var Yd="TabsList",Gd=y$2.forwardRef((vo,Ai)=>{const{__scopeTabs:bo,loop:Ra=!0,...pc}=vo,mc=Ni(Yd,bo),uf=zd(bo);return jsx(ou,{asChild:!0,...uf,orientation:mc.orientation,dir:mc.dir,loop:Ra,children:jsx(we$1.div,{role:"tablist","aria-orientation":mc.orientation,...pc,ref:Ai})})});Gd.displayName=Yd;var qd="TabsTrigger",Xd=y$2.forwardRef((vo,Ai)=>{const{__scopeTabs:bo,value:Ra,disabled:pc=!1,...mc}=vo,uf=Ni(qd,bo),df=zd(bo),ff=Qd(uf.baseId,Ra),hf=Jd(uf.baseId,Ra),pf=Ra===uf.value;return jsx(au,{asChild:!0,...df,focusable:!pc,active:pf,children:jsx(we$1.button,{type:"button",role:"tab","aria-selected":pf,"aria-controls":hf,"data-state":pf?"active":"inactive","data-disabled":pc?"":void 0,disabled:pc,id:ff,...mc,ref:Ai,onMouseDown:re$2(vo.onMouseDown,mf=>{!pc&&mf.button===0&&mf.ctrlKey===!1?uf.onValueChange(Ra):mf.preventDefault()}),onKeyDown:re$2(vo.onKeyDown,mf=>{[" ","Enter"].includes(mf.key)&&uf.onValueChange(Ra)}),onFocus:re$2(vo.onFocus,()=>{const mf=uf.activationMode!=="manual";!pf&&!pc&&mf&&uf.onValueChange(Ra)})})})});Xd.displayName=qd;var Kd="TabsContent",Zd=y$2.forwardRef((vo,Ai)=>{const{__scopeTabs:bo,value:Ra,forceMount:pc,children:mc,...uf}=vo,df=Ni(Kd,bo),ff=Qd(df.baseId,Ra),hf=Jd(df.baseId,Ra),pf=Ra===df.value,mf=y$2.useRef(pf);return y$2.useEffect(()=>{const gf=requestAnimationFrame(()=>mf.current=!1);return()=>cancelAnimationFrame(gf)},[]),jsx(it$1,{present:pc||pf,children:({present:gf})=>jsx(we$1.div,{"data-state":pf?"active":"inactive","data-orientation":df.orientation,role:"tabpanel","aria-labelledby":ff,hidden:!gf,id:hf,tabIndex:0,...uf,ref:Ai,style:{...vo.style,animationDuration:mf.current?"0s":void 0},children:gf&&mc})})});Zd.displayName=Kd;function Qd(vo,Ai){return`${vo}-trigger-${Ai}`}function Jd(vo,Ai){return`${vo}-content-${Ai}`}var QC=jd,JC=Gd,eI=Xd,ia=Zd;function ef(vo){const{label:Ai,description:bo,children:Ra}=vo;return jsxs("div",{children:[jsx("h1",{className:"mb-2 text-lg font-bold",children:Ai}),jsx("p",{className:"mb-4 text-xs text-gray-600",children:bo}),Ra]})}const Br$2=forwardRef(function(vo,Ai){const{children:bo,className:Ra,...pc}=vo;return jsx("tr",{...pc,className:Ne$1("odd:bg-white even:bg-gray-50",Ra),ref:Ai,children:bo})}),Ye$2=vo=>jsx("td",{...vo,className:Ne$1("truncate border-l border-gray-300 px-3 py-2 text-xs font-medium text-gray-900 first:border-l-0",vo.className)});function tI(vo){return jsx(Ye$2,{className:"w-4",children:vo.itemNumber})}function nI(vo){const{isSelected:Ai,tableName:bo,tableItem:Ra}=vo,{viewItem:pc,clearSelected:mc}=tt$2(),uf=useCallback(()=>{if(Ai){mc();return}pc(Ra,bo)},[mc,Ai,Ra,bo,pc]);return jsx(Ye$2,{className:"w-4",children:jsx("button",{className:"flex size-full items-center justify-center",onClick:uf,children:jsx(_e$1,{className:Ne$1("text-gray-600",Ai&&"rotate-180"),name:"CaretDown",size:16})})})}/**
|
|
67
|
-
* natural-orderby v4.0.0
|
|
68
|
-
*
|
|
69
|
-
* Copyright (c) Olaf Ennen
|
|
70
|
-
*
|
|
71
|
-
* This source code is licensed under the MIT license found in the
|
|
72
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
73
|
-
*
|
|
74
|
-
* @license MIT
|
|
75
|
-
*/var tf=function(vo,Ai){return vo<Ai?-1:vo>Ai?1:0},rI=function(vo,Ai){var bo=vo.localeCompare(Ai);return bo?bo/Math.abs(bo):0},oI=/(^0x[\da-fA-F]+$|^([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?(?!\.\d+)(?=\D|\s|$))|\d+)/g,nf=/^\s+|\s+$/g,aI=/\s+/g,iI=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/,sI=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[/-]\d{1,4}[/-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,cI=/^0+[1-9]{1}[0-9]*$/,lI=/[^\x00-\x80]/,lc=function(vo,Ai){return vo<Ai?-1:vo>Ai?1:0},uI=function(vo,Ai){for(var bo=vo.length,Ra=Ai.length,pc=Math.min(bo,Ra),mc=0;mc<pc;mc++){var uf=vo[mc],df=Ai[mc];if(uf.normalizedString!==df.normalizedString){if(uf.normalizedString===""!=(df.normalizedString===""))return uf.normalizedString===""?-1:1;if(uf.parsedNumber!==void 0&&df.parsedNumber!==void 0){var ff=tf(uf.parsedNumber,df.parsedNumber);return ff===0?lc(uf.normalizedString,df.normalizedString):ff}else return uf.parsedNumber!==void 0||df.parsedNumber!==void 0?uf.parsedNumber!==void 0?-1:1:lI.test(uf.normalizedString+df.normalizedString)?rI(uf.normalizedString,df.normalizedString):lc(uf.normalizedString,df.normalizedString)}}return bo>pc||Ra>pc?bo<=pc?-1:1:0},dI=function(vo,Ai){return(vo.chunks?!Ai.chunks:Ai.chunks)?vo.chunks?-1:1:(vo.isNaN?!Ai.isNaN:Ai.isNaN)?vo.isNaN?-1:1:(vo.isSymbol?!Ai.isSymbol:Ai.isSymbol)?vo.isSymbol?-1:1:(vo.isObject?!Ai.isObject:Ai.isObject)?vo.isObject?-1:1:(vo.isArray?!Ai.isArray:Ai.isArray)?vo.isArray?-1:1:(vo.isFunction?!Ai.isFunction:Ai.isFunction)?vo.isFunction?-1:1:(vo.isNull?!Ai.isNull:Ai.isNull)?vo.isNull?-1:1:0},fI=function(vo,Ai){return vo.value===Ai.value?0:vo.parsedNumber!==void 0&&Ai.parsedNumber!==void 0?tf(vo.parsedNumber,Ai.parsedNumber):vo.chunks&&Ai.chunks?uI(vo.chunks,Ai.chunks):dI(vo,Ai)},mI=function(vo){return vo.replace(aI," ").replace(nf,"")},rf=function(vo){if(vo.length!==0){var Ai=Number(vo);if(!Number.isNaN(Ai))return Ai}},pI=function(vo,Ai,bo){if(iI.test(vo)&&(!cI.test(vo)||Ai===0||bo[Ai-1]!=="."))return rf(vo)||0},hI=function(vo,Ai,bo){return{parsedNumber:pI(vo,Ai,bo),normalizedString:mI(vo)}},gI=function(vo){return vo.replace(oI,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0")},vI=function(vo){var Ai=gI(vo).map(hI);return Ai},bI=function(vo){return typeof vo=="function"},uc=function(vo){return Number.isNaN(vo)||vo instanceof Number&&Number.isNaN(vo.valueOf())},yI=function(vo){return vo===null},wI=function(vo){return vo!==null&&typeof vo=="object"&&!Array.isArray(vo)&&!(vo instanceof Number)&&!(vo instanceof String)&&!(vo instanceof Boolean)&&!(vo instanceof Date)},xI=function(vo){return typeof vo=="symbol"},SI=function(vo){return vo===void 0},CI=function(vo){try{var Ai=Date.parse(vo);return!Number.isNaN(Ai)&&sI.test(vo)?Ai:void 0}catch{return}},II=function(vo){var Ai=rf(vo);return Ai!==void 0?Ai:CI(vo)},EI=function(vo){return typeof vo=="boolean"||vo instanceof Boolean?Number(vo).toString():typeof vo=="number"||vo instanceof Number?vo.toString():vo instanceof Date?vo.getTime().toString():typeof vo=="string"||vo instanceof String?vo.toLowerCase().replace(nf,""):""},PI=function(vo){if(typeof vo=="string"||vo instanceof String||(typeof vo=="number"||vo instanceof Number)&&!uc(vo)||typeof vo=="boolean"||vo instanceof Boolean||vo instanceof Date){var Ai=EI(vo),bo=II(Ai),Ra=vI(bo?""+bo:Ai);return{parsedNumber:bo,chunks:Ra,value:vo}}return{isArray:Array.isArray(vo),isFunction:bI(vo),isNaN:uc(vo),isNull:yI(vo),isObject:wI(vo),isSymbol:xI(vo),isUndefined:SI(vo),value:vo}},TI=function(vo,Ai,bo){for(var Ra=vo.index,pc=vo.values,mc=Ai.index,uf=Ai.values,df=pc.length,ff=bo.length,hf=0;hf<df;hf++){var pf=hf<ff?bo[hf]:null;if(pf&&typeof pf=="function"){var mf=pf(pc[hf].value,uf[hf].value);if(mf)return mf}else{var gf=fI(pc[hf],uf[hf]);if(gf)return gf*(pf==="desc"?-1:1)}}return Ra-mc},OI=function(vo){return typeof vo=="function"?vo:function(Ai){if(Array.isArray(Ai)){var bo=Number(vo);if(Number.isInteger(bo))return Ai[bo]}else if(Ai&&typeof Ai=="object"){var Ra=Object.getOwnPropertyDescriptor(Ai,vo);return Ra==null?void 0:Ra.value}return Ai}},MI=function(vo,Ai){return vo[Ai]},NI=function(vo,Ai){return Ai(vo)},AI=function(vo,Ai,bo){var Ra=Ai.length?Ai.map(OI):[function(mc){return mc}],pc=vo.map(function(mc,uf){var df=Ra.map(function(ff){return NI(mc,ff)}).map(PI);return{index:uf,values:df}});return pc.sort(function(mc,uf){return TI(mc,uf,bo)}),pc.map(function(mc){return MI(vo,mc.index)})},DI=function(vo){if(!vo)return[];var Ai=Array.isArray(vo)?[].concat(vo):[vo];return Ai.some(function(bo){return typeof bo!="string"&&typeof bo!="number"&&typeof bo!="function"})?[]:Ai},RI=function(vo){if(!vo)return[];var Ai=Array.isArray(vo)?[].concat(vo):[vo];return Ai.some(function(bo){return bo!=="asc"&&bo!=="desc"&&typeof bo!="function"})?[]:Ai};function _I(vo,Ai,bo){if(!vo||!Array.isArray(vo))return[];var Ra=DI(Ai),pc=RI(bo);return AI(vo,Ra,pc)}function kI(vo){const[Ai,bo]=useState(vo),[Ra,pc]=useState(),[mc,uf]=useState("asc"),df=useCallback((ff,hf)=>{pc(ff),uf(hf)},[]);return useEffect(()=>{if(vo){if(!Ra){bo(vo);return}bo(_I(vo,[Ra],[mc]))}},[Ra,mc,vo,df]),useMemo(()=>({sortedItems:Ai,sortHandler:df}),[Ai,df])}function of(vo){const Ai=tt$2(),bo=useMemo(()=>Aa(vo,Ai),[Ai,vo]),{sortedItems:Ra,sortHandler:pc}=kI(bo);return useMemo(()=>({tableData:Ra??[],sortHandler:pc}),[Ra,pc])}const FI={ASSET:[{key:"name",label:"Name",allowSorting:!0},{key:"purchaseDate",label:"Purchase Date",allowSorting:!0},{key:"maturity",label:"Maturity",allowSorting:!0,displayTime:!1},{key:"notional",label:"Notional",allowSorting:!0,isNumberColumn:!0},{key:"currentValue",label:"Current Value",allowSorting:!0,isNumberColumn:!0},{key:"purchasePrice",label:"Purchase Price",allowSorting:!0,isNumberColumn:!0,decimalScale:6},{key:"purchaseProceeds",label:"Purchase Proceeds",allowSorting:!0,isNumberColumn:!0},{key:"salesProceeds",label:"Sales Proceeds",allowSorting:!0,isNumberColumn:!0},{key:"totalDiscount",label:"Total Discount",allowSorting:!0,isNumberColumn:!0},{key:"realizedSurplus",label:"Realized Surplus",allowSorting:!0,isNumberColumn:!0}],TRANSACTION:[{key:"typeLabel",label:"Type",allowSorting:!0},{key:"entryTime",label:"Entry Time",allowSorting:!0},{key:"asset",label:"Asset",allowSorting:!0},{key:"quantity",label:"Quantity",allowSorting:!0,isNumberColumn:!0},{key:"cashAmount",label:"Cash Amount ($)",allowSorting:!0,isNumberColumn:!0},{key:"totalFees",label:"Total Fees ($)",allowSorting:!0,isNumberColumn:!0},{key:"cashBalanceChange",label:"Cash Balance Change ($)",allowSorting:!0,isNumberColumn:!0}],FIXED_INCOME_TYPE:[{key:"name",label:"Name",allowSorting:!0}],SPV:[{key:"name",label:"Name",allowSorting:!0}],SERVICE_PROVIDER_FEE_TYPE:[{key:"name",label:"Name",allowSorting:!0},{key:"feeType",label:"Fee Type",allowSorting:!0},{key:"accountName",label:"Account Name",allowSorting:!0},{key:"accountReference",label:"Account Reference",allowSorting:!0}],ACCOUNT:[{key:"label",label:"Label",allowSorting:!0},{key:"reference",label:"Reference",allowSorting:!0}]};function VI(vo){const{columnCountByTableWidth:Ai,tableContainerRef:bo,columns:Ra,hasItemNumberColumn:pc=!0,hasMoreDetailsColumn:mc=!0}=vo,[uf,df]=useState(0),ff=useMemo(()=>pc?{key:"itemNumber",label:"#",allowSorting:!0,isSpecialColumn:!0}:void 0,[pc]),hf=useMemo(()=>mc?{key:"moreDetails",label:"",isSpecialColumn:!0}:void 0,[mc]),[pf,mf]=useState([]),gf=useCallback(()=>{var vf;(vf=bo.current)!=null&&vf.parentElement&&df(bo.current.parentElement.offsetWidth)},[bo]),yf=useCallback(()=>{const vf=LI(uf,Ai),bf=(Ra==null?void 0:Ra.slice(0,vf))??[];mf([ff,...bf,hf].filter(Boolean))},[uf,Ra,Ai,ff,hf]);return useEffect(()=>(gf(),window.addEventListener("resize",gf),()=>window.removeEventListener("resize",gf)),[gf]),useEffect(()=>{yf()},[yf,uf]),useMemo(()=>pf,[pf])}function LI(vo,Ai){let bo=1520,Ra=1/0;return Object.keys(Ai).forEach(pc=>{const mc=parseInt(pc),uf=Math.abs(vo-mc);uf<Ra&&(Ra=uf,bo=parseInt(pc))}),Ai[bo]}const af=34,sf=42,$I=20,UI=af*$I+sf;function HI(vo){var Ai,bo;const{selectedItemNumber:Ra,tableContainerRef:pc,rowRefs:mc,headerRef:uf,hasSpecialLastRow:df=!1}=vo,[ff,hf]=useState(`${UI}px`),pf=Ra?Ra-1+(df?1:0):void 0,mf=((Ai=mc.current[1])==null?void 0:Ai.offsetHeight)??af,gf=((bo=uf.current)==null?void 0:bo.offsetHeight)??sf,yf=useCallback(()=>{var vf,bf;if(pf===void 0){const wf=mf*20+gf;hf(`${wf}px`);return}const Sf=(vf=pc.current)==null?void 0:vf.getBoundingClientRect(),xf=(bf=mc.current[pf])==null?void 0:bf.getBoundingClientRect();if(xf&&Sf){const wf=xf.bottom,If=Sf.top,l1=wf-If;hf(`${l1}px`)}},[gf,mf,mc,pf,pc]);return useEffect(()=>{yf()},[yf]),useEffect(()=>{const vf=()=>{yf()},bf=pc.current;return bf&&bf.addEventListener("scroll",vf),()=>{bf&&bf.removeEventListener("scroll",vf)}},[pc,yf]),ff}const WI=forwardRef(function(vo,Ai){const{children:bo,tableData:Ra,columns:pc,footer:mc,renderRow:uf,onClickSort:df,specialFirstRow:ff,specialLastRow:hf,maxHeight:pf,headerRef:mf,hasSelectedItem:gf}=vo,[yf,vf]=useState(null),[bf,Sf]=useState(null);return jsxs(Fragment,{children:[jsx("div",{className:Xr$1("relative rounded-lg border border-gray-300 bg-white",gf?"overflow-hidden":"overflow-scroll"),ref:Ai,style:{maxHeight:pf},children:jsxs("table",{className:"w-full",children:[jsx("thead",{className:"sticky top-0 isolate select-none text-nowrap border-b border-gray-300 bg-gray-100",ref:mf,children:jsx("tr",{children:pc.map(xf=>jsx("th",{className:Ne$1("group border-l border-gray-300 py-3 pl-3 text-start text-xs font-medium text-gray-600 first:border-l-0",xf.allowSorting&&"cursor-pointer hover:text-gray-900"),onClick:()=>{if(!xf.allowSorting)return;let wf="asc";bf===xf.key&&yf==="asc"&&(wf="desc"),vf(wf),Sf(xf.key),df(xf.key,wf)},children:jsxs("div",{className:Ne$1("group flex items-center",xf.isNumberColumn&&"justify-end"),children:[xf.label,xf.allowSorting?jsx(_e$1,{className:Ne$1("invisible ml-1 rotate-90",bf===xf.key&&"group-hover:visible",yf==="asc"&&"rotate-[270deg]"),name:"ArrowFilledRight",size:6}):null]})},xf.key))})}),jsxs("tbody",{children:[bo,ff==null?void 0:ff(pc),Ra==null?void 0:Ra.map((xf,wf)=>uf(xf,pc,wf)),hf==null?void 0:hf(pc)]})]})}),mc]})});function cf(vo){const{tableName:Ai,tableData:bo,columnCountByTableWidth:Ra=qS,sortHandler:pc,specialFirstRow:mc,specialLastRow:uf}=vo,df=FI[Ai],{operation:ff,selectedTableItem:hf,isAllowedToCreateDocuments:pf,createItem:mf}=tt$2(),gf=useRef(null),yf=useRef([]),vf=useRef(null),bf=VI({columns:df,columnCountByTableWidth:Ra,tableContainerRef:gf}),Sf=HI({tableContainerRef:gf,rowRefs:yf,headerRef:vf,selectedItemNumber:hf==null?void 0:hf.itemNumber,hasSpecialLastRow:!!uf}),xf=jn$2[Ai],wf=useCallback(()=>{mf(Ai)},[mf,Ai]),If=useCallback((l1,s1,c1)=>{const u1=(hf==null?void 0:hf.id)===l1.id;return jsx(Br$2,{ref:T1=>yf.current[c1]=T1,children:s1.map(T1=>jsxs(Fragment,{children:[T1.key==="itemNumber"&&jsx(tI,{itemNumber:l1.itemNumber}),T1.key!=="itemNumber"&&T1.key!=="moreDetails"&&jsx(Ye$2,{className:T1.isNumberColumn?"text-right":"",children:pt$2(l1[T1.key],T1.decimalScale,T1.displayTime)},T1.key),T1.key==="moreDetails"&&jsx(nI,{isSelected:u1,tableItem:l1,tableName:Ai})]},T1.key))},l1.id)},[hf==null?void 0:hf.id,Ai]);return jsxs(Fragment,{children:[jsx(WI,{columns:bf,hasSelectedItem:!!hf,headerRef:vf,maxHeight:Sf,onClickSort:pc,ref:gf,renderRow:If,specialFirstRow:mc,specialLastRow:uf,tableData:bo}),pf&&!ff?jsxs("button",{className:"mt-4 flex h-11 w-full items-center justify-center gap-x-2 rounded-lg border border-gray-300 bg-white text-sm font-semibold text-gray-900",onClick:wf,children:[jsxs("span",{children:["Create ",xf]}),jsx(_e$1,{name:"Plus",size:14})]}):null]})}function BI(vo,Ai){const{fixedIncomes:bo,serviceProviderFeeTypes:Ra,transactions:pc}=tt$2();return useMemo(()=>{if(!Ai)return[];switch(vo){case"TRANSACTION":return[];case"SPV":return[{dependentTableName:"ASSET",dependentItems:dc(vo,Ai,bo)}];case"FIXED_INCOME_TYPE":return[{dependentTableName:"ASSET",dependentItems:dc(vo,Ai,bo)}];case"ASSET":return[{dependentTableName:"TRANSACTION",dependentItems:sa(vo,Ai,pc)}];case"SERVICE_PROVIDER_FEE_TYPE":return[{dependentTableName:"TRANSACTION",dependentItems:sa(vo,Ai,pc)}];case"ACCOUNT":return[{dependentTableName:"TRANSACTION",dependentItems:sa(vo,Ai,pc)},{dependentTableName:"SERVICE_PROVIDER_FEE_TYPE",dependentItems:zI(Ai,Ra)}]}},[bo,Ai,Ra,vo,pc])}function zI(vo,Ai){const bo=Ra=>({id:Ra.id,label:Ra.name});return Ai.filter(Ra=>Ra.accountId===vo).map(bo)}function dc(vo,Ai,bo){const Ra=pc=>({id:pc.id,label:pc.name});switch(vo){case"FIXED_INCOME_TYPE":return bo.filter(pc=>pc.fixedIncomeTypeId===Ai).map(Ra);case"SPV":return bo.filter(pc=>pc.spvId===Ai).map(Ra)}}function sa(vo,Ai,bo){const Ra=(pc,mc)=>({id:pc.id,label:`Transaction #${mc+1}`});switch(vo){case"ASSET":return bo.filter(pc=>{var mc;return((mc=pc.fixedIncomeTransaction)==null?void 0:mc.assetId)===Ai}).map(Ra);case"ACCOUNT":return bo.filter(pc=>{var mc;return pc.cashTransaction.accountId===Ai||((mc=pc.fixedIncomeTransaction)==null?void 0:mc.accountId)===Ai}).map(Ra);case"SERVICE_PROVIDER_FEE_TYPE":return bo.filter(pc=>{var mc;return(mc=pc.fees)==null?void 0:mc.some(uf=>uf.serviceProviderFeeTypeId===Ai)}).map(Ra)}}function jI(vo){const{inputs:Ai}=vo;return jsx("div",{className:"rounded-md bg-white text-xs font-medium",children:Ai.map(({label:bo,Input:Ra,inputLabel:pc},mc)=>jsxs("div",{className:Xr$1("grid min-h-11 grid-cols-[208px,380px] items-center px-6 text-gray-600 last:rounded-b-md",mc%2!==0&&"bg-gray-50"),children:[jsx("div",{children:bo}),jsxs("div",{className:"h-max py-2 text-gray-900",children:[jsx(Ra,{}),pc?jsx("div",{className:"text-left text-gray-500",children:pc}):null]},mc)]},bo))})}const lf=memo(function(vo){const{tableName:Ai}=vo,{showModal:bo,closeModal:Ra}=Bd(),{selectedTableItem:pc,operation:mc,viewItem:uf,editItem:df,clearSelected:ff,handleAction:hf,isAllowedToCreateDocuments:pf,isAllowedToEditDocuments:mf,principalLenderAccountId:gf}=tt$2(),yf=BI(Ai,pc==null?void 0:pc.id),vf=yf.some(L1=>L1.dependentItems.length>0),bf=mc==="edit",Sf=mc==="create",xf=mc==="view",wf=pf||mf,If=!(Ai==="ACCOUNT"&&(pc==null?void 0:pc.id)===gf),l1=!xf&&wf,s1=!xf&&wf,c1=bf&&mf&&If,u1=xf&&mf,T1=xf,_1=jn$2[Ai],{submit:R1,reset:P1,formInputs:{inputs:E1,additionalInputs:M1}}=Hd({tableName:Ai,tableItem:pc,operation:mc}),m1=useCallback(()=>{P1(),ff()},[ff,P1]),$1=useCallback(()=>{if(mc==="edit"&&pc){uf(pc,Ai);return}m1()},[m1,mc,pc,Ai,uf]),k1=useCallback(()=>{!If||!vf||bo("deleteItem",{tableName:Ai,dependentItemProps:yf})},[If,vf,bo,Ai,yf]),F1=useCallback(()=>{if(!pc)return;if(vf){k1();return}const L1=`DELETE_${Ai}`;hf({type:L1,payload:pc}),ff(),Ra()},[pc,vf,Ai,hf,ff,Ra,k1]),U1=useCallback(()=>{pc&&df(pc,Ai)},[pc,df,Ai]),B1=jsx(hr$2,{className:"text-gray-600",onClick:m1,children:"Close"}),W1=jsx(hr$2,{className:"text-gray-600",onClick:$1,children:"Cancel"}),Z1=jsx(hr$2,{icon:jsx(_e$1,{name:"Save",size:16}),iconPosition:"right",onClick:R1,children:Sf?"Save":"Save Edits"}),O1=jsx("button",{onClick:F1,children:jsx(_e$1,{className:"ml-3 text-red-800",name:"Trash",size:22})}),j1=jsxs(hr$2,{icon:jsx(_e$1,{name:"Pencil",size:16}),iconPosition:"right",onClick:U1,children:["Edit ",_1]});return jsxs("div",{className:"flex flex-col rounded-md border border-gray-300 bg-white",children:[jsxs("div",{className:"flex justify-between rounded-t-md border-b border-gray-300 bg-gray-100 p-3 font-semibold text-gray-800",children:[jsx("div",{className:"flex items-center",children:pc!=null&&pc.itemNumber?`${_1} #${pc.itemNumber}`:`New ${_1}`}),jsxs("div",{className:"flex gap-x-2",children:[l1?W1:null,T1?B1:null,s1?Z1:null,c1?O1:null,u1?j1:null]})]}),jsx(jI,{inputs:E1}),M1]})});function kn$2(vo){const{tableName:Ai,specialFirstRow:bo,specialLastRow:Ra}=vo,{getIsFormOpen:pc}=tt$2(),mc=pc(Ai),{tableData:uf,sortHandler:df}=of(Ai),ff=uf.length>20,{pageItems:hf,pages:pf,goToPage:mf,goToNextPage:gf,goToPreviousPage:yf,goToFirstPage:vf,goToLastPage:bf,hiddenNextPages:Sf,isNextPageAvailable:xf,isPreviousPageAvailable:wf}=ld(uf);return jsxs(Fragment,{children:[jsx("div",{className:"mb-2 flex w-full justify-end",children:ff?jsx(Sd,{goToFirstPage:vf,goToLastPage:bf,goToNextPage:gf,goToPage:mf,goToPreviousPage:yf,hiddenNextPages:Sf,isNextPageAvailable:xf,isPreviousPageAvailable:wf,nextPageLabel:"Next",pages:pf,previousPageLabel:"Previous"}):null}),jsx(cf,{sortHandler:df,specialFirstRow:bo,specialLastRow:Ra,tableData:hf,tableName:Ai}),mc?jsx("div",{className:"mt-4 rounded-md bg-white",children:jsx(lf,{tableName:Ai})}):null]})}function YI(){const vo=Ce$2.ASSET,{selectedTableItem:Ai,fixedIncomes:bo,cashAsset:Ra}=tt$2(),pc=useMemo(()=>({id:"special-first-row",name:"Cash $USD",fixedIncomeTypeId:"--",spvId:"--",maturity:"--",ISIN:"--",CUSIP:"--",coupon:null,notional:Ra.balance??0,purchaseDate:"--",purchasePrice:"--",purchaseProceeds:"--",salesProceeds:"--",totalDiscount:"--",realizedSurplus:"--",currentValue:"--"}),[Ra.balance]),mc=gr$2(bo,"purchaseProceeds"),uf=gr$2(bo,"salesProceeds"),df=gr$2(bo,"totalDiscount"),ff=gr$2(bo,"realizedSurplus"),hf=useCallback(mf=>jsx(Br$2,{children:mf.map(gf=>jsxs(Fragment$1,{children:[gf.key==="name"&&jsx(Ye$2,{children:"Cash $USD"}),gf.key==="notional"&&jsx(Ye$2,{className:"text-right",children:pt$2(pc[gf.key])},gf.key),gf.key!=="name"&&gf.key!=="notional"&&jsx(Ye$2,{})]},gf.key))}),[pc]),pf=useCallback(mf=>jsx(Br$2,{className:"sticky bottom-0",children:mf.map(gf=>jsxs(Fragment$1,{children:[gf.key==="name"&&jsx(Ye$2,{children:"Totals"}),gf.key==="purchaseProceeds"&&jsx(Ye$2,{className:"text-right",children:pt$2(mc)},gf.key),gf.key==="salesProceeds"&&jsx(Ye$2,{className:"text-right",children:pt$2(uf)},gf.key),gf.key==="totalDiscount"&&jsx(Ye$2,{className:"text-right",children:pt$2(df)},gf.key),gf.key==="realizedSurplus"&&jsx(Ye$2,{className:"text-right",children:pt$2(ff)},gf.key),gf.key!=="name"&&gf.key!=="purchaseProceeds"&&gf.key!=="salesProceeds"&&gf.key!=="totalDiscount"&&gf.key!=="realizedSurplus"&&jsx(Ye$2,{})]},gf.key))}),[Ai,mc,ff,uf,df]);return jsx(kn$2,{specialFirstRow:hf,specialLastRow:pf,tableName:vo})}function GI(){return jsx(ef,{description:"Details on the distribution of assets among different financial institutions or investment vehicles.",label:"Portfolio",children:jsx(YI,{})})}function qI(){const vo=Ce$2.TRANSACTION,{getIsFormOpen:Ai,fixedIncomes:bo}=tt$2(),Ra=Ai(vo),{tableData:pc,sortHandler:mc}=of(vo),[uf,df]=useState(pc),[ff,hf]=useState(),[pf,mf]=useState([]),gf=uf.length>20;useEffect(()=>{if(!ff&&!pf.length){df(pc);return}df(pc.filter(P1=>{var E1,M1;if(ff&&pf.length)return((E1=P1.fixedIncomeTransaction)==null?void 0:E1.assetId)===ff&&pf.includes(P1.type);if(ff)return((M1=P1.fixedIncomeTransaction)==null?void 0:M1.assetId)===ff;if(pf.length)return pf.includes(P1.type)}))},[ff,pf,pc]);const yf=useMemo(()=>bo.map(P1=>({label:Ud(P1),value:P1.id})),[bo]),vf=useMemo(()=>Ci.map(P1=>({label:Ii$1[P1],value:P1})),[]),{pageItems:bf,pages:Sf,goToPage:xf,goToNextPage:wf,goToPreviousPage:If,goToFirstPage:l1,goToLastPage:s1,hiddenNextPages:c1,isNextPageAvailable:u1,isPreviousPageAvailable:T1}=ld(uf),_1=useCallback(P1=>{if(!P1||typeof P1!="object"||!("value"in P1)){hf(void 0);return}const{value:E1}=P1;hf(E1)},[]),R1=useCallback(P1=>{if(!P1||!Array.isArray(P1)){mf([]);return}mf(P1.map(({value:E1})=>E1))},[]);return jsxs(Fragment,{children:[jsxs("div",{className:"mb-2 flex gap-2",children:[jsx("div",{className:"min-w-72 max-w-96",children:jsx(Ca,{isClearable:!0,onChange:_1,options:yf,placeholder:"Filter by Asset"})}),jsx("div",{className:"min-w-72 max-w-96",children:jsx(Ca,{isClearable:!0,isMulti:!0,onChange:R1,options:vf,placeholder:"Filter by Type"})}),jsx("div",{className:"flex w-full justify-end",children:gf?jsx(Sd,{goToFirstPage:l1,goToLastPage:s1,goToNextPage:wf,goToPage:xf,goToPreviousPage:If,hiddenNextPages:c1,isNextPageAvailable:u1,isPreviousPageAvailable:T1,nextPageLabel:"Next",pages:Sf,previousPageLabel:"Previous"}):null})]}),jsx(cf,{sortHandler:mc,tableData:bf,tableName:vo}),Ra?jsx("div",{className:"mt-4 rounded-md bg-white",children:jsx(lf,{tableName:vo})}):null]})}function XI(){return jsx(ef,{description:"Details on the distribution of assets among different financial institutions or investment vehicles.",label:"Transactions",children:jsx(qI,{})})}function KI(){const{accounts:vo,principalLenderAccountId:Ai}=tt$2(),bo=vo.find(mc=>mc.id===Ai),Ra=useCallback(mc=>jsx(Br$2,{children:mc.map(uf=>jsx(Fragment,{children:uf.key==="label"?jsxs(Ye$2,{children:[bo==null?void 0:bo.label,jsxs("span",{className:"ml-2 inline-flex items-center gap-1 rounded bg-green-100 px-1 font-extralight",children:["Lender ",jsx(_e$1,{name:"CheckCircle",size:14})]})]}):jsx(Ye$2,{})},uf.key))}),[bo==null?void 0:bo.label]),pc=bo!=null&&bo.label?Ra:void 0;return jsx(kn$2,{specialFirstRow:pc,tableName:Ce$2.ACCOUNT})}function ZI(){return jsxs("div",{className:"grid grid-rows-4 gap-4",children:[jsxs("div",{children:[jsx("h2",{className:"mb-2 text-lg font-bold",children:"Accounts"}),jsx("p",{className:"mb-4 text-xs text-gray-600",children:"Add and manage accounts that can be associated with transactions and fees."}),jsx(KI,{})]}),jsxs("div",{children:[jsx("h2",{className:"mb-2 text-lg font-bold",children:"Fixed Income Types"}),jsx("p",{className:"mb-4 text-xs text-gray-600",children:"Add and manage fixed income asset types."}),jsx(kn$2,{tableName:Ce$2.FIXED_INCOME_TYPE})]}),jsxs("div",{children:[jsx("h2",{className:"mb-2 text-lg font-bold",children:"SPVs"}),jsx("p",{className:"mb-4 text-xs text-gray-600",children:"Add and manage special purpose vehicles (SPVs)."}),jsx(kn$2,{tableName:Ce$2.SPV})]}),jsxs("div",{children:[jsx("h2",{className:"mb-2 text-lg font-bold",children:"Service Provider Fee Types"}),jsx("p",{className:"mb-4 text-xs text-gray-600",children:"Add and manage service providers and their associated fee types."}),jsx(kn$2,{tableName:Ce$2.SERVICE_PROVIDER_FEE_TYPE})]})]})}function QI(){const vo=["Portfolio","Transactions","Other"],{onSwitchboardLinkClick:Ai,onExport:bo,onClose:Ra,onShowRevisionHistory:pc,clearSelected:mc}=tt$2(),uf=useCallback(()=>{mc()},[mc]);return jsxs(QC,{defaultValue:"Portfolio",onValueChange:uf,children:[jsxs("div",{className:"flex justify-between",children:[jsx(JC,{className:"flex gap-x-2 rounded-xl bg-slate-50 p-1 text-sm font-semibold text-gray-600 outline-none",children:vo.map(df=>jsx(eI,{className:"data-[state='active']:tab-shadow data-disabled:cursor-not-allowed data-disabled:text-gray-400 h-7 w-32 rounded-lg transition duration-300 data-[state='active']:bg-gray-50 data-[state='active']:text-gray-900",value:df,children:df},df))}),jsx(sw,{onClose:Ra,onExport:bo,onShowRevisionHistory:pc,onSwitchboardLinkClick:Ai})]}),jsxs("div",{className:"mt-3 rounded-md bg-slate-50 p-8",children:[jsx(ia,{value:"Portfolio",children:jsx(GI,{})}),jsx(ia,{value:"Transactions",children:jsx(XI,{})}),jsx(ia,{value:"Other",children:jsx(ZI,{})})]})]})}function C1(){return jsx(XC,{children:jsx(QI,{})})}const JI={cry:"😢",laughing:"😂",heart:"❤️",thumbsDown:"👎",thumbsUp:"👍"},e1=vo=>{const{imgUrl:Ai,userName:bo,isCurrentUser:Ra,...pc}=vo,{disabled:mc=!1}=pc,[uf,df]=useState(!1),[ff,hf]=useState(!1);return jsxs("div",{onMouseEnter:()=>df(!0),onMouseLeave:()=>!ff&&df(!1),style:{display:"flex",gap:"2px",alignItems:"flex-end",flexDirection:Ra?"row-reverse":"row",marginLeft:Ra?"80px":"0px",marginRight:Ra?"0px":"80px"},children:[jsx(Om,{imgUrl:Ai,userName:bo}),jsxs(rw,{dir:"rtl",onOpenChange:pf=>{hf(pf),pf||df(!1)},open:ff,children:[jsx(Nm,{isCurrentUser:Ra,userName:bo,...pc}),jsx(ow,{asChild:!0,onClick:()=>hf(!0),children:jsx("div",{style:{fontSize:"26px",cursor:"pointer",visibility:!mc&&uf?"visible":"hidden"},children:"🫥"})}),jsx(aw,{side:"top",style:{fontSize:"26px",display:"flex",gap:"8px",backgroundColor:"white",padding:"8px",borderRadius:"8px",paddingTop:"2px",paddingBottom:"2px",boxShadow:"0px 4px 8px rgba(0, 0, 0, 0.1)"},children:Object.entries(JI).map(([pf,mf])=>jsx(iw,{onClick:()=>pc.onClickReaction?pc.onClickReaction({emoji:mf,type:pf,messageId:pc.id,reactedBy:[]}):null,style:{outline:"none",cursor:"pointer"},children:mf},pf))})]})]})},t1=()=>jsxs("svg",{className:"lucide lucide-send",fill:"none",height:"20",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[jsx("path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z"}),jsx("path",{d:"m21.854 2.147-10.94 10.939"})]}),n1=({onSendMessage:vo,disabled:Ai=!1})=>{const[bo,Ra]=useState(""),pc=()=>{vo(bo),Ra("")};return jsxs("div",{style:{backgroundColor:"#eeeef8",borderRadius:"8px",display:"flex",padding:"8px",paddingLeft:"16px",paddingRight:"16px",fontSize:"14px",gap:"8px"},children:[jsx("input",{disabled:Ai,onChange:mc=>Ra(mc.target.value),onKeyDown:mc=>{mc.key==="Enter"&&(mc.stopPropagation(),mc.preventDefault(),pc())},placeholder:"Type a message...",style:{backgroundColor:"transparent",display:"flex",flex:1,outline:"none"},type:"text",value:bo}),jsx("button",{disabled:Ai,onClick:pc,style:{color:"#434385",padding:"4px"},type:"button",children:jsx(t1,{})})]})},r1=()=>jsxs("svg",{fill:"none",height:"18",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",width:"18",xmlns:"http://www.w3.org/2000/svg",children:[jsx("path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"}),jsx("path",{d:"m15 5 4 4"})]}),o1=()=>jsxs("svg",{fill:"none",height:"18",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",width:"18",xmlns:"http://www.w3.org/2000/svg",children:[jsx("path",{d:"M18 6 6 18"}),jsx("path",{d:"m6 6 12 12"})]}),fc=({label:vo,onSubmit:Ai,style:bo})=>{const[Ra,pc]=useState(!1),[mc,uf]=useState(!1),[df,ff]=useState(vo);return useEffect(()=>{ff(vo)},[vo]),jsxs("div",{onMouseEnter:()=>pc(!0),onMouseLeave:()=>pc(!1),style:{display:"flex",alignItems:"center",gap:"8px"},children:[mc?jsx("input",{onChange:hf=>ff(hf.target.value),onKeyDown:hf=>{hf.key==="Escape"&&(uf(!1),ff(vo)),hf.key==="Enter"&&(hf.preventDefault(),hf.stopPropagation(),uf(!1),Ai==null||Ai(df))},style:bo,type:"text",value:df}):jsx("h1",{style:bo,children:df}),Ra||mc?mc?jsx("div",{onClick:()=>{uf(!1),ff(vo)},style:{cursor:"pointer"},children:jsx(o1,{})}):jsx("div",{onClick:()=>uf(!0),style:{cursor:"pointer"},children:jsx(r1,{})}):null]})},a1=({title:vo,description:Ai,onTitleSubmit:bo,onDescriptionSubmit:Ra})=>jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[jsx(fc,{label:vo,onSubmit:bo,style:{fontSize:"18px",fontWeight:"bold",margin:0}}),Ai?jsx(fc,{label:Ai,onSubmit:Ra,style:{minWidth:"200px",fontSize:"14px",color:"#666",margin:0}}):null]}),i1=vo=>{const{onSendMessage:Ai,title:bo,description:Ra,disabled:pc=!1,messages:mc=[],onSubmitTitle:uf,onSubmitDescription:df,onClickReaction:ff=()=>{}}=vo,hf=useRef(null);return useEffect(()=>{var pf,mf,gf,yf;const vf=((pf=hf.current)==null?void 0:pf.scrollHeight)||0,bf=((mf=hf.current)==null?void 0:mf.clientHeight)||0,Sf=((gf=hf.current)==null?void 0:gf.scrollTop)||0;vf-(bf+100)<=Sf&&((yf=hf.current)==null||yf.scrollTo({top:hf.current.scrollHeight,behavior:"smooth"}))},[mc,hf]),jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",flex:1},children:[jsx("div",{children:jsx(a1,{description:Ra,onDescriptionSubmit:df,onTitleSubmit:uf,title:bo})}),jsx("div",{ref:hf,style:{display:"flex",flex:1,flexDirection:"column",gap:"8px",overflowY:"auto",marginTop:"20px",marginBottom:"20px"},children:mc.map(pf=>jsx(e1,{...pf,disabled:pc,onClickReaction:ff},pf.id))}),pc?jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center"},children:jsx("span",{style:{padding:"8px",paddingTop:"4px",paddingBottom:"4px",minWidth:"200px",backgroundColor:"#f0f0f0",borderRadius:"8px"},children:"You need to login to start chatting ⚠️"})}):jsx("div",{children:jsx(n1,{onSendMessage:Ai})})]})};function I1(vo){const Ai=!vo.context.user,bo=vo.document.state.global.messages.map(hf=>{var pf;return{id:hf.id,message:hf.content||"",timestamp:hf.sentAt,userName:hf.sender.name||hf.sender.id,imgUrl:hf.sender.avatarUrl||void 0,isCurrentUser:hf.sender.id===((pf=vo.context.user)==null?void 0:pf.address),reactions:Tm(hf.reactions)}}),Ra=hf=>{var pf,mf,gf,yf,vf;vo.dispatch($$4.addMessage({messageId:index.hashKey(),content:hf,sender:{id:((pf=vo.context.user)==null?void 0:pf.address)||"anon-user",name:((gf=(mf=vo.context.user)==null?void 0:mf.ens)==null?void 0:gf.name)||null,avatarUrl:((vf=(yf=vo.context.user)==null?void 0:yf.ens)==null?void 0:vf.avatarUrl)||null},sentAt:new Date().toISOString()}))},pc=(hf,pf,mf)=>{vo.dispatch($$4.addEmojiReaction({messageId:hf,reactedBy:pf,type:mf}))},mc=(hf,pf,mf)=>{vo.dispatch($$4.removeEmojiReaction({messageId:hf,senderId:pf,type:mf}))},uf=hf=>{var pf,mf;const gf=bo.find(xf=>xf.id===hf.messageId);if(!gf)return;const yf=hf.messageId,vf=Pm(hf.type),bf=((pf=vo.context.user)==null?void 0:pf.address)||"anon-user",Sf=(mf=gf.reactions)==null?void 0:mf.find(xf=>xf.type===hf.type);Sf?(Sf.reactedBy.includes(bf)?mc:pc)(yf,bf,vf):pc(yf,bf,vf)},df=hf=>{vo.dispatch($$4.editChatName({name:hf}))},ff=hf=>{vo.dispatch($$4.editChatDescription({description:hf}))};return jsx("div",{style:{height:"calc(100vh - 140px)"},children:jsx(i1,{description:vo.document.state.global.description||"This is a chat room demo",messages:bo,disabled:Ai,onClickReaction:uf,onSendMessage:Ra,onSubmitDescription:ff,onSubmitTitle:df,title:vo.document.state.global.name||"Chat Room Demo"})})}var e$2={},d$1;function s$4(){if(d$1)return e$2;d$1=1,Object.defineProperty(e$2,"__esModule",{value:!0}),e$2.lazyWithPreload=void 0;var vo=y__default;function Ai(bo){var Ra=(0,vo.lazy)(bo),pc,mc,uf=(0,vo.forwardRef)(function(ff,hf){var pf=(0,vo.useRef)(pc??Ra);return(0,vo.createElement)(pf.current,Object.assign(hf?{ref:hf}:{},ff))}),df=uf;return df.preload=function(){return mc||(mc=bo().then(function(ff){return pc=ff.default,pc})),mc},df}return e$2.lazyWithPreload=Ai,e$2.default=Ai,e$2}var P$4=s$4();function devAssert$1(vo,Ai){if(!!!vo)throw new Error(Ai)}function isObjectLike$1(vo){return typeof vo=="object"&&vo!==null}function invariant$2(vo,Ai){if(!!!vo)throw new Error("Unexpected invariant triggered.")}const LineRegExp$1=/\r\n|[\n\r]/g;function getLocation$2(vo,Ai){let bo=0,Ra=1;for(const pc of vo.body.matchAll(LineRegExp$1)){if(typeof pc.index=="number"||invariant$2(!1),pc.index>=Ai)break;bo=pc.index+pc[0].length,Ra+=1}return{line:Ra,column:Ai+1-bo}}function printLocation$1(vo){return printSourceLocation$1(vo.source,getLocation$2(vo.source,vo.start))}function printSourceLocation$1(vo,Ai){const bo=vo.locationOffset.column-1,Ra="".padStart(bo)+vo.body,pc=Ai.line-1,mc=vo.locationOffset.line-1,uf=Ai.line+mc,df=Ai.line===1?bo:0,ff=Ai.column+df,hf=`${vo.name}:${uf}:${ff}
|
|
76
|
-
`,pf=Ra.split(/\r\n|[\n\r]/g),mf=pf[pc];if(mf.length>120){const gf=Math.floor(ff/80),yf=ff%80,vf=[];for(let bf=0;bf<mf.length;bf+=80)vf.push(mf.slice(bf,bf+80));return hf+printPrefixedLines$1([[`${uf} |`,vf[0]],...vf.slice(1,gf+1).map(bf=>["|",bf]),["|","^".padStart(yf)],["|",vf[gf+1]]])}return hf+printPrefixedLines$1([[`${uf-1} |`,pf[pc-1]],[`${uf} |`,mf],["|","^".padStart(ff)],[`${uf+1} |`,pf[pc+1]]])}function printPrefixedLines$1(vo){const Ai=vo.filter(([Ra,pc])=>pc!==void 0),bo=Math.max(...Ai.map(([Ra])=>Ra.length));return Ai.map(([Ra,pc])=>Ra.padStart(bo)+(pc?" "+pc:"")).join(`
|
|
77
|
-
`)}function toNormalizedOptions$1(vo){const Ai=vo[0];return Ai==null||"kind"in Ai||"length"in Ai?{nodes:Ai,source:vo[1],positions:vo[2],path:vo[3],originalError:vo[4],extensions:vo[5]}:Ai}let GraphQLError$1=class CT extends Error{constructor(Ai,...bo){var Ra,pc,mc;const{nodes:uf,source:df,positions:ff,path:hf,originalError:pf,extensions:mf}=toNormalizedOptions$1(bo);super(Ai),this.name="GraphQLError",this.path=hf??void 0,this.originalError=pf??void 0,this.nodes=undefinedIfEmpty$1(Array.isArray(uf)?uf:uf?[uf]:void 0);const gf=undefinedIfEmpty$1((Ra=this.nodes)===null||Ra===void 0?void 0:Ra.map(vf=>vf.loc).filter(vf=>vf!=null));this.source=df??(gf==null||(pc=gf[0])===null||pc===void 0?void 0:pc.source),this.positions=ff??(gf==null?void 0:gf.map(vf=>vf.start)),this.locations=ff&&df?ff.map(vf=>getLocation$2(df,vf)):gf==null?void 0:gf.map(vf=>getLocation$2(vf.source,vf.start));const yf=isObjectLike$1(pf==null?void 0:pf.extensions)?pf==null?void 0:pf.extensions:void 0;this.extensions=(mc=mf??yf)!==null&&mc!==void 0?mc:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),pf!=null&&pf.stack?Object.defineProperty(this,"stack",{value:pf.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,CT):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let Ai=this.message;if(this.nodes)for(const bo of this.nodes)bo.loc&&(Ai+=`
|
|
78
|
-
|
|
79
|
-
`+printLocation$1(bo.loc));else if(this.source&&this.locations)for(const bo of this.locations)Ai+=`
|
|
80
|
-
|
|
81
|
-
`+printSourceLocation$1(this.source,bo);return Ai}toJSON(){const Ai={message:this.message};return this.locations!=null&&(Ai.locations=this.locations),this.path!=null&&(Ai.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(Ai.extensions=this.extensions),Ai}};function undefinedIfEmpty$1(vo){return vo===void 0||vo.length===0?void 0:vo}var Kind$1;(function(vo){vo.NAME="Name",vo.DOCUMENT="Document",vo.OPERATION_DEFINITION="OperationDefinition",vo.VARIABLE_DEFINITION="VariableDefinition",vo.SELECTION_SET="SelectionSet",vo.FIELD="Field",vo.ARGUMENT="Argument",vo.FRAGMENT_SPREAD="FragmentSpread",vo.INLINE_FRAGMENT="InlineFragment",vo.FRAGMENT_DEFINITION="FragmentDefinition",vo.VARIABLE="Variable",vo.INT="IntValue",vo.FLOAT="FloatValue",vo.STRING="StringValue",vo.BOOLEAN="BooleanValue",vo.NULL="NullValue",vo.ENUM="EnumValue",vo.LIST="ListValue",vo.OBJECT="ObjectValue",vo.OBJECT_FIELD="ObjectField",vo.DIRECTIVE="Directive",vo.NAMED_TYPE="NamedType",vo.LIST_TYPE="ListType",vo.NON_NULL_TYPE="NonNullType",vo.SCHEMA_DEFINITION="SchemaDefinition",vo.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",vo.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",vo.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",vo.FIELD_DEFINITION="FieldDefinition",vo.INPUT_VALUE_DEFINITION="InputValueDefinition",vo.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",vo.UNION_TYPE_DEFINITION="UnionTypeDefinition",vo.ENUM_TYPE_DEFINITION="EnumTypeDefinition",vo.ENUM_VALUE_DEFINITION="EnumValueDefinition",vo.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",vo.DIRECTIVE_DEFINITION="DirectiveDefinition",vo.SCHEMA_EXTENSION="SchemaExtension",vo.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",vo.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",vo.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",vo.UNION_TYPE_EXTENSION="UnionTypeExtension",vo.ENUM_TYPE_EXTENSION="EnumTypeExtension",vo.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"})(Kind$1||(Kind$1={}));function isDigit$2(vo){return vo>=48&&vo<=57}function isLetter$1(vo){return vo>=97&&vo<=122||vo>=65&&vo<=90}function isNameStart$1(vo){return isLetter$1(vo)||vo===95}function isNameContinue$1(vo){return isLetter$1(vo)||isDigit$2(vo)||vo===95}const MAX_ARRAY_LENGTH$1=10,MAX_RECURSIVE_DEPTH$1=2;function inspect$1(vo){return formatValue$1(vo,[])}function formatValue$1(vo,Ai){switch(typeof vo){case"string":return JSON.stringify(vo);case"function":return vo.name?`[function ${vo.name}]`:"[function]";case"object":return formatObjectValue$1(vo,Ai);default:return String(vo)}}function formatObjectValue$1(vo,Ai){if(vo===null)return"null";if(Ai.includes(vo))return"[Circular]";const bo=[...Ai,vo];if(isJSONable$1(vo)){const Ra=vo.toJSON();if(Ra!==vo)return typeof Ra=="string"?Ra:formatValue$1(Ra,bo)}else if(Array.isArray(vo))return formatArray$1(vo,bo);return formatObject$1(vo,bo)}function isJSONable$1(vo){return typeof vo.toJSON=="function"}function formatObject$1(vo,Ai){const bo=Object.entries(vo);return bo.length===0?"{}":Ai.length>MAX_RECURSIVE_DEPTH$1?"["+getObjectTag$1(vo)+"]":"{ "+bo.map(([pc,mc])=>pc+": "+formatValue$1(mc,Ai)).join(", ")+" }"}function formatArray$1(vo,Ai){if(vo.length===0)return"[]";if(Ai.length>MAX_RECURSIVE_DEPTH$1)return"[Array]";const bo=Math.min(MAX_ARRAY_LENGTH$1,vo.length),Ra=vo.length-bo,pc=[];for(let mc=0;mc<bo;++mc)pc.push(formatValue$1(vo[mc],Ai));return Ra===1?pc.push("... 1 more item"):Ra>1&&pc.push(`... ${Ra} more items`),"["+pc.join(", ")+"]"}function getObjectTag$1(vo){const Ai=Object.prototype.toString.call(vo).replace(/^\[object /,"").replace(/]$/,"");if(Ai==="Object"&&typeof vo.constructor=="function"){const bo=vo.constructor.name;if(typeof bo=="string"&&bo!=="")return bo}return Ai}function identityFunc$1(vo){return vo}function keyValMap$1(vo,Ai,bo){const Ra=Object.create(null);for(const pc of vo)Ra[Ai(pc)]=bo(pc);return Ra}function toObjMap$1(vo){if(vo==null)return Object.create(null);if(Object.getPrototypeOf(vo)===null)return vo;const Ai=Object.create(null);for(const[bo,Ra]of Object.entries(vo))Ai[bo]=Ra;return Ai}function valueFromASTUntyped$1(vo,Ai){switch(vo.kind){case Kind$1.NULL:return null;case Kind$1.INT:return parseInt(vo.value,10);case Kind$1.FLOAT:return parseFloat(vo.value);case Kind$1.STRING:case Kind$1.ENUM:case Kind$1.BOOLEAN:return vo.value;case Kind$1.LIST:return vo.values.map(bo=>valueFromASTUntyped$1(bo,Ai));case Kind$1.OBJECT:return keyValMap$1(vo.fields,bo=>bo.name.value,bo=>valueFromASTUntyped$1(bo.value,Ai));case Kind$1.VARIABLE:return Ai==null?void 0:Ai[vo.name.value]}}function assertName$1(vo){if(vo!=null||devAssert$1(!1,"Must provide name."),typeof vo=="string"||devAssert$1(!1,"Expected name to be a string."),vo.length===0)throw new GraphQLError$1("Expected name to be a non-empty string.");for(let Ai=1;Ai<vo.length;++Ai)if(!isNameContinue$1(vo.charCodeAt(Ai)))throw new GraphQLError$1(`Names must only contain [_a-zA-Z0-9] but "${vo}" does not.`);if(!isNameStart$1(vo.charCodeAt(0)))throw new GraphQLError$1(`Names must start with [_a-zA-Z] but "${vo}" does not.`);return vo}let GraphQLScalarType$1=class{constructor(Ai){var bo,Ra,pc,mc;const uf=(bo=Ai.parseValue)!==null&&bo!==void 0?bo:identityFunc$1;this.name=assertName$1(Ai.name),this.description=Ai.description,this.specifiedByURL=Ai.specifiedByURL,this.serialize=(Ra=Ai.serialize)!==null&&Ra!==void 0?Ra:identityFunc$1,this.parseValue=uf,this.parseLiteral=(pc=Ai.parseLiteral)!==null&&pc!==void 0?pc:(df,ff)=>uf(valueFromASTUntyped$1(df,ff)),this.extensions=toObjMap$1(Ai.extensions),this.astNode=Ai.astNode,this.extensionASTNodes=(mc=Ai.extensionASTNodes)!==null&&mc!==void 0?mc:[],Ai.specifiedByURL==null||typeof Ai.specifiedByURL=="string"||devAssert$1(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${inspect$1(Ai.specifiedByURL)}.`),Ai.serialize==null||typeof Ai.serialize=="function"||devAssert$1(!1,`${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`),Ai.parseLiteral&&(typeof Ai.parseValue=="function"&&typeof Ai.parseLiteral=="function"||devAssert$1(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};var util;(function(vo){vo.assertEqual=pc=>pc;function Ai(pc){}vo.assertIs=Ai;function bo(pc){throw new Error}vo.assertNever=bo,vo.arrayToEnum=pc=>{const mc={};for(const uf of pc)mc[uf]=uf;return mc},vo.getValidEnumValues=pc=>{const mc=vo.objectKeys(pc).filter(df=>typeof pc[pc[df]]!="number"),uf={};for(const df of mc)uf[df]=pc[df];return vo.objectValues(uf)},vo.objectValues=pc=>vo.objectKeys(pc).map(function(mc){return pc[mc]}),vo.objectKeys=typeof Object.keys=="function"?pc=>Object.keys(pc):pc=>{const mc=[];for(const uf in pc)Object.prototype.hasOwnProperty.call(pc,uf)&&mc.push(uf);return mc},vo.find=(pc,mc)=>{for(const uf of pc)if(mc(uf))return uf},vo.isInteger=typeof Number.isInteger=="function"?pc=>Number.isInteger(pc):pc=>typeof pc=="number"&&isFinite(pc)&&Math.floor(pc)===pc;function Ra(pc,mc=" | "){return pc.map(uf=>typeof uf=="string"?`'${uf}'`:uf).join(mc)}vo.joinValues=Ra,vo.jsonStringifyReplacer=(pc,mc)=>typeof mc=="bigint"?mc.toString():mc})(util||(util={}));var objectUtil;(function(vo){vo.mergeShapes=(Ai,bo)=>({...Ai,...bo})})(objectUtil||(objectUtil={}));const ZodParsedType=util.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),getParsedType=vo=>{switch(typeof vo){case"undefined":return ZodParsedType.undefined;case"string":return ZodParsedType.string;case"number":return isNaN(vo)?ZodParsedType.nan:ZodParsedType.number;case"boolean":return ZodParsedType.boolean;case"function":return ZodParsedType.function;case"bigint":return ZodParsedType.bigint;case"symbol":return ZodParsedType.symbol;case"object":return Array.isArray(vo)?ZodParsedType.array:vo===null?ZodParsedType.null:vo.then&&typeof vo.then=="function"&&vo.catch&&typeof vo.catch=="function"?ZodParsedType.promise:typeof Map<"u"&&vo instanceof Map?ZodParsedType.map:typeof Set<"u"&&vo instanceof Set?ZodParsedType.set:typeof Date<"u"&&vo instanceof Date?ZodParsedType.date:ZodParsedType.object;default:return ZodParsedType.unknown}},ZodIssueCode=util.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),quotelessJson=vo=>JSON.stringify(vo,null,2).replace(/"([^"]+)":/g,"$1:");class ZodError extends Error{get errors(){return this.issues}constructor(Ai){super(),this.issues=[],this.addIssue=Ra=>{this.issues=[...this.issues,Ra]},this.addIssues=(Ra=[])=>{this.issues=[...this.issues,...Ra]};const bo=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,bo):this.__proto__=bo,this.name="ZodError",this.issues=Ai}format(Ai){const bo=Ai||function(mc){return mc.message},Ra={_errors:[]},pc=mc=>{for(const uf of mc.issues)if(uf.code==="invalid_union")uf.unionErrors.map(pc);else if(uf.code==="invalid_return_type")pc(uf.returnTypeError);else if(uf.code==="invalid_arguments")pc(uf.argumentsError);else if(uf.path.length===0)Ra._errors.push(bo(uf));else{let df=Ra,ff=0;for(;ff<uf.path.length;){const hf=uf.path[ff];ff===uf.path.length-1?(df[hf]=df[hf]||{_errors:[]},df[hf]._errors.push(bo(uf))):df[hf]=df[hf]||{_errors:[]},df=df[hf],ff++}}};return pc(this),Ra}static assert(Ai){if(!(Ai instanceof ZodError))throw new Error(`Not a ZodError: ${Ai}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,util.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(Ai=bo=>bo.message){const bo={},Ra=[];for(const pc of this.issues)pc.path.length>0?(bo[pc.path[0]]=bo[pc.path[0]]||[],bo[pc.path[0]].push(Ai(pc))):Ra.push(Ai(pc));return{formErrors:Ra,fieldErrors:bo}}get formErrors(){return this.flatten()}}ZodError.create=vo=>new ZodError(vo);const errorMap=(vo,Ai)=>{let bo;switch(vo.code){case ZodIssueCode.invalid_type:vo.received===ZodParsedType.undefined?bo="Required":bo=`Expected ${vo.expected}, received ${vo.received}`;break;case ZodIssueCode.invalid_literal:bo=`Invalid literal value, expected ${JSON.stringify(vo.expected,util.jsonStringifyReplacer)}`;break;case ZodIssueCode.unrecognized_keys:bo=`Unrecognized key(s) in object: ${util.joinValues(vo.keys,", ")}`;break;case ZodIssueCode.invalid_union:bo="Invalid input";break;case ZodIssueCode.invalid_union_discriminator:bo=`Invalid discriminator value. Expected ${util.joinValues(vo.options)}`;break;case ZodIssueCode.invalid_enum_value:bo=`Invalid enum value. Expected ${util.joinValues(vo.options)}, received '${vo.received}'`;break;case ZodIssueCode.invalid_arguments:bo="Invalid function arguments";break;case ZodIssueCode.invalid_return_type:bo="Invalid function return type";break;case ZodIssueCode.invalid_date:bo="Invalid date";break;case ZodIssueCode.invalid_string:typeof vo.validation=="object"?"includes"in vo.validation?(bo=`Invalid input: must include "${vo.validation.includes}"`,typeof vo.validation.position=="number"&&(bo=`${bo} at one or more positions greater than or equal to ${vo.validation.position}`)):"startsWith"in vo.validation?bo=`Invalid input: must start with "${vo.validation.startsWith}"`:"endsWith"in vo.validation?bo=`Invalid input: must end with "${vo.validation.endsWith}"`:util.assertNever(vo.validation):vo.validation!=="regex"?bo=`Invalid ${vo.validation}`:bo="Invalid";break;case ZodIssueCode.too_small:vo.type==="array"?bo=`Array must contain ${vo.exact?"exactly":vo.inclusive?"at least":"more than"} ${vo.minimum} element(s)`:vo.type==="string"?bo=`String must contain ${vo.exact?"exactly":vo.inclusive?"at least":"over"} ${vo.minimum} character(s)`:vo.type==="number"?bo=`Number must be ${vo.exact?"exactly equal to ":vo.inclusive?"greater than or equal to ":"greater than "}${vo.minimum}`:vo.type==="date"?bo=`Date must be ${vo.exact?"exactly equal to ":vo.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(vo.minimum))}`:bo="Invalid input";break;case ZodIssueCode.too_big:vo.type==="array"?bo=`Array must contain ${vo.exact?"exactly":vo.inclusive?"at most":"less than"} ${vo.maximum} element(s)`:vo.type==="string"?bo=`String must contain ${vo.exact?"exactly":vo.inclusive?"at most":"under"} ${vo.maximum} character(s)`:vo.type==="number"?bo=`Number must be ${vo.exact?"exactly":vo.inclusive?"less than or equal to":"less than"} ${vo.maximum}`:vo.type==="bigint"?bo=`BigInt must be ${vo.exact?"exactly":vo.inclusive?"less than or equal to":"less than"} ${vo.maximum}`:vo.type==="date"?bo=`Date must be ${vo.exact?"exactly":vo.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(vo.maximum))}`:bo="Invalid input";break;case ZodIssueCode.custom:bo="Invalid input";break;case ZodIssueCode.invalid_intersection_types:bo="Intersection results could not be merged";break;case ZodIssueCode.not_multiple_of:bo=`Number must be a multiple of ${vo.multipleOf}`;break;case ZodIssueCode.not_finite:bo="Number must be finite";break;default:bo=Ai.defaultError,util.assertNever(vo)}return{message:bo}};let overrideErrorMap=errorMap;function setErrorMap(vo){overrideErrorMap=vo}function getErrorMap(){return overrideErrorMap}const makeIssue=vo=>{const{data:Ai,path:bo,errorMaps:Ra,issueData:pc}=vo,mc=[...bo,...pc.path||[]],uf={...pc,path:mc};if(pc.message!==void 0)return{...pc,path:mc,message:pc.message};let df="";const ff=Ra.filter(hf=>!!hf).slice().reverse();for(const hf of ff)df=hf(uf,{data:Ai,defaultError:df}).message;return{...pc,path:mc,message:df}},EMPTY_PATH=[];function addIssueToContext(vo,Ai){const bo=getErrorMap(),Ra=makeIssue({issueData:Ai,data:vo.data,path:vo.path,errorMaps:[vo.common.contextualErrorMap,vo.schemaErrorMap,bo,bo===errorMap?void 0:errorMap].filter(pc=>!!pc)});vo.common.issues.push(Ra)}class ParseStatus{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(Ai,bo){const Ra=[];for(const pc of bo){if(pc.status==="aborted")return INVALID;pc.status==="dirty"&&Ai.dirty(),Ra.push(pc.value)}return{status:Ai.value,value:Ra}}static async mergeObjectAsync(Ai,bo){const Ra=[];for(const pc of bo){const mc=await pc.key,uf=await pc.value;Ra.push({key:mc,value:uf})}return ParseStatus.mergeObjectSync(Ai,Ra)}static mergeObjectSync(Ai,bo){const Ra={};for(const pc of bo){const{key:mc,value:uf}=pc;if(mc.status==="aborted"||uf.status==="aborted")return INVALID;mc.status==="dirty"&&Ai.dirty(),uf.status==="dirty"&&Ai.dirty(),mc.value!=="__proto__"&&(typeof uf.value<"u"||pc.alwaysSet)&&(Ra[mc.value]=uf.value)}return{status:Ai.value,value:Ra}}}const INVALID=Object.freeze({status:"aborted"}),DIRTY=vo=>({status:"dirty",value:vo}),OK=vo=>({status:"valid",value:vo}),isAborted=vo=>vo.status==="aborted",isDirty=vo=>vo.status==="dirty",isValid=vo=>vo.status==="valid",isAsync=vo=>typeof Promise<"u"&&vo instanceof Promise;function __classPrivateFieldGet(vo,Ai,bo,Ra){if(typeof Ai=="function"?vo!==Ai||!Ra:!Ai.has(vo))throw new TypeError("Cannot read private member from an object whose class did not declare it");return Ai.get(vo)}function __classPrivateFieldSet(vo,Ai,bo,Ra,pc){if(typeof Ai=="function"?vo!==Ai||!pc:!Ai.has(vo))throw new TypeError("Cannot write private member to an object whose class did not declare it");return Ai.set(vo,bo),bo}typeof SuppressedError=="function"&&SuppressedError;var errorUtil;(function(vo){vo.errToObj=Ai=>typeof Ai=="string"?{message:Ai}:Ai||{},vo.toString=Ai=>typeof Ai=="string"?Ai:Ai==null?void 0:Ai.message})(errorUtil||(errorUtil={}));var _ZodEnum_cache,_ZodNativeEnum_cache;class ParseInputLazyPath{constructor(Ai,bo,Ra,pc){this._cachedPath=[],this.parent=Ai,this.data=bo,this._path=Ra,this._key=pc}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const handleResult=(vo,Ai)=>{if(isValid(Ai))return{success:!0,data:Ai.value};if(!vo.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const bo=new ZodError(vo.common.issues);return this._error=bo,this._error}}};function processCreateParams(vo){if(!vo)return{};const{errorMap:Ai,invalid_type_error:bo,required_error:Ra,description:pc}=vo;if(Ai&&(bo||Ra))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return Ai?{errorMap:Ai,description:pc}:{errorMap:(uf,df)=>{var ff,hf;const{message:pf}=vo;return uf.code==="invalid_enum_value"?{message:pf??df.defaultError}:typeof df.data>"u"?{message:(ff=pf??Ra)!==null&&ff!==void 0?ff:df.defaultError}:uf.code!=="invalid_type"?{message:df.defaultError}:{message:(hf=pf??bo)!==null&&hf!==void 0?hf:df.defaultError}},description:pc}}class ZodType{get description(){return this._def.description}_getType(Ai){return getParsedType(Ai.data)}_getOrReturnCtx(Ai,bo){return bo||{common:Ai.parent.common,data:Ai.data,parsedType:getParsedType(Ai.data),schemaErrorMap:this._def.errorMap,path:Ai.path,parent:Ai.parent}}_processInputParams(Ai){return{status:new ParseStatus,ctx:{common:Ai.parent.common,data:Ai.data,parsedType:getParsedType(Ai.data),schemaErrorMap:this._def.errorMap,path:Ai.path,parent:Ai.parent}}}_parseSync(Ai){const bo=this._parse(Ai);if(isAsync(bo))throw new Error("Synchronous parse encountered promise.");return bo}_parseAsync(Ai){const bo=this._parse(Ai);return Promise.resolve(bo)}parse(Ai,bo){const Ra=this.safeParse(Ai,bo);if(Ra.success)return Ra.data;throw Ra.error}safeParse(Ai,bo){var Ra;const pc={common:{issues:[],async:(Ra=bo==null?void 0:bo.async)!==null&&Ra!==void 0?Ra:!1,contextualErrorMap:bo==null?void 0:bo.errorMap},path:(bo==null?void 0:bo.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:Ai,parsedType:getParsedType(Ai)},mc=this._parseSync({data:Ai,path:pc.path,parent:pc});return handleResult(pc,mc)}"~validate"(Ai){var bo,Ra;const pc={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:Ai,parsedType:getParsedType(Ai)};if(!this["~standard"].async)try{const mc=this._parseSync({data:Ai,path:[],parent:pc});return isValid(mc)?{value:mc.value}:{issues:pc.common.issues}}catch(mc){!((Ra=(bo=mc==null?void 0:mc.message)===null||bo===void 0?void 0:bo.toLowerCase())===null||Ra===void 0)&&Ra.includes("encountered")&&(this["~standard"].async=!0),pc.common={issues:[],async:!0}}return this._parseAsync({data:Ai,path:[],parent:pc}).then(mc=>isValid(mc)?{value:mc.value}:{issues:pc.common.issues})}async parseAsync(Ai,bo){const Ra=await this.safeParseAsync(Ai,bo);if(Ra.success)return Ra.data;throw Ra.error}async safeParseAsync(Ai,bo){const Ra={common:{issues:[],contextualErrorMap:bo==null?void 0:bo.errorMap,async:!0},path:(bo==null?void 0:bo.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:Ai,parsedType:getParsedType(Ai)},pc=this._parse({data:Ai,path:Ra.path,parent:Ra}),mc=await(isAsync(pc)?pc:Promise.resolve(pc));return handleResult(Ra,mc)}refine(Ai,bo){const Ra=pc=>typeof bo=="string"||typeof bo>"u"?{message:bo}:typeof bo=="function"?bo(pc):bo;return this._refinement((pc,mc)=>{const uf=Ai(pc),df=()=>mc.addIssue({code:ZodIssueCode.custom,...Ra(pc)});return typeof Promise<"u"&&uf instanceof Promise?uf.then(ff=>ff?!0:(df(),!1)):uf?!0:(df(),!1)})}refinement(Ai,bo){return this._refinement((Ra,pc)=>Ai(Ra)?!0:(pc.addIssue(typeof bo=="function"?bo(Ra,pc):bo),!1))}_refinement(Ai){return new ZodEffects({schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"refinement",refinement:Ai}})}superRefine(Ai){return this._refinement(Ai)}constructor(Ai){this.spa=this.safeParseAsync,this._def=Ai,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:bo=>this["~validate"](bo)}}optional(){return ZodOptional.create(this,this._def)}nullable(){return ZodNullable.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ZodArray.create(this)}promise(){return ZodPromise.create(this,this._def)}or(Ai){return ZodUnion.create([this,Ai],this._def)}and(Ai){return ZodIntersection.create(this,Ai,this._def)}transform(Ai){return new ZodEffects({...processCreateParams(this._def),schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"transform",transform:Ai}})}default(Ai){const bo=typeof Ai=="function"?Ai:()=>Ai;return new ZodDefault({...processCreateParams(this._def),innerType:this,defaultValue:bo,typeName:ZodFirstPartyTypeKind.ZodDefault})}brand(){return new ZodBranded({typeName:ZodFirstPartyTypeKind.ZodBranded,type:this,...processCreateParams(this._def)})}catch(Ai){const bo=typeof Ai=="function"?Ai:()=>Ai;return new ZodCatch({...processCreateParams(this._def),innerType:this,catchValue:bo,typeName:ZodFirstPartyTypeKind.ZodCatch})}describe(Ai){const bo=this.constructor;return new bo({...this._def,description:Ai})}pipe(Ai){return ZodPipeline.create(this,Ai)}readonly(){return ZodReadonly.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const cuidRegex=/^c[^\s-]{8,}$/i,cuid2Regex=/^[0-9a-z]+$/,ulidRegex=/^[0-9A-HJKMNP-TV-Z]{26}$/i,uuidRegex=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,nanoidRegex=/^[a-z0-9_-]{21}$/i,jwtRegex=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,durationRegex=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,emailRegex=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,_emojiRegex="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let emojiRegex;const ipv4Regex=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4CidrRegex=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6Regex=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ipv6CidrRegex=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64Regex=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64urlRegex=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,dateRegexSource="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",dateRegex=new RegExp(`^${dateRegexSource}$`);function timeRegexSource(vo){let Ai="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return vo.precision?Ai=`${Ai}\\.\\d{${vo.precision}}`:vo.precision==null&&(Ai=`${Ai}(\\.\\d+)?`),Ai}function timeRegex(vo){return new RegExp(`^${timeRegexSource(vo)}$`)}function datetimeRegex(vo){let Ai=`${dateRegexSource}T${timeRegexSource(vo)}`;const bo=[];return bo.push(vo.local?"Z?":"Z"),vo.offset&&bo.push("([+-]\\d{2}:?\\d{2})"),Ai=`${Ai}(${bo.join("|")})`,new RegExp(`^${Ai}$`)}function isValidIP(vo,Ai){return!!((Ai==="v4"||!Ai)&&ipv4Regex.test(vo)||(Ai==="v6"||!Ai)&&ipv6Regex.test(vo))}function isValidJWT(vo,Ai){if(!jwtRegex.test(vo))return!1;try{const[bo]=vo.split("."),Ra=bo.replace(/-/g,"+").replace(/_/g,"/").padEnd(bo.length+(4-bo.length%4)%4,"="),pc=JSON.parse(atob(Ra));return!(typeof pc!="object"||pc===null||!pc.typ||!pc.alg||Ai&&pc.alg!==Ai)}catch{return!1}}function isValidCidr(vo,Ai){return!!((Ai==="v4"||!Ai)&&ipv4CidrRegex.test(vo)||(Ai==="v6"||!Ai)&&ipv6CidrRegex.test(vo))}class ZodString extends ZodType{_parse(Ai){if(this._def.coerce&&(Ai.data=String(Ai.data)),this._getType(Ai)!==ZodParsedType.string){const mc=this._getOrReturnCtx(Ai);return addIssueToContext(mc,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.string,received:mc.parsedType}),INVALID}const Ra=new ParseStatus;let pc;for(const mc of this._def.checks)if(mc.kind==="min")Ai.data.length<mc.value&&(pc=this._getOrReturnCtx(Ai,pc),addIssueToContext(pc,{code:ZodIssueCode.too_small,minimum:mc.value,type:"string",inclusive:!0,exact:!1,message:mc.message}),Ra.dirty());else if(mc.kind==="max")Ai.data.length>mc.value&&(pc=this._getOrReturnCtx(Ai,pc),addIssueToContext(pc,{code:ZodIssueCode.too_big,maximum:mc.value,type:"string",inclusive:!0,exact:!1,message:mc.message}),Ra.dirty());else if(mc.kind==="length"){const uf=Ai.data.length>mc.value,df=Ai.data.length<mc.value;(uf||df)&&(pc=this._getOrReturnCtx(Ai,pc),uf?addIssueToContext(pc,{code:ZodIssueCode.too_big,maximum:mc.value,type:"string",inclusive:!0,exact:!0,message:mc.message}):df&&addIssueToContext(pc,{code:ZodIssueCode.too_small,minimum:mc.value,type:"string",inclusive:!0,exact:!0,message:mc.message}),Ra.dirty())}else if(mc.kind==="email")emailRegex.test(Ai.data)||(pc=this._getOrReturnCtx(Ai,pc),addIssueToContext(pc,{validation:"email",code:ZodIssueCode.invalid_string,message:mc.message}),Ra.dirty());else if(mc.kind==="emoji")emojiRegex||(emojiRegex=new RegExp(_emojiRegex,"u")),emojiRegex.test(Ai.data)||(pc=this._getOrReturnCtx(Ai,pc),addIssueToContext(pc,{validation:"emoji",code:ZodIssueCode.invalid_string,message:mc.message}),Ra.dirty());else if(mc.kind==="uuid")uuidRegex.test(Ai.data)||(pc=this._getOrReturnCtx(Ai,pc),addIssueToContext(pc,{validation:"uuid",code:ZodIssueCode.invalid_string,message:mc.message}),Ra.dirty());else if(mc.kind==="nanoid")nanoidRegex.test(Ai.data)||(pc=this._getOrReturnCtx(Ai,pc),addIssueToContext(pc,{validation:"nanoid",code:ZodIssueCode.invalid_string,message:mc.message}),Ra.dirty());else if(mc.kind==="cuid")cuidRegex.test(Ai.data)||(pc=this._getOrReturnCtx(Ai,pc),addIssueToContext(pc,{validation:"cuid",code:ZodIssueCode.invalid_string,message:mc.message}),Ra.dirty());else if(mc.kind==="cuid2")cuid2Regex.test(Ai.data)||(pc=this._getOrReturnCtx(Ai,pc),addIssueToContext(pc,{validation:"cuid2",code:ZodIssueCode.invalid_string,message:mc.message}),Ra.dirty());else if(mc.kind==="ulid")ulidRegex.test(Ai.data)||(pc=this._getOrReturnCtx(Ai,pc),addIssueToContext(pc,{validation:"ulid",code:ZodIssueCode.invalid_string,message:mc.message}),Ra.dirty());else if(mc.kind==="url")try{new URL(Ai.data)}catch{pc=this._getOrReturnCtx(Ai,pc),addIssueToContext(pc,{validation:"url",code:ZodIssueCode.invalid_string,message:mc.message}),Ra.dirty()}else mc.kind==="regex"?(mc.regex.lastIndex=0,mc.regex.test(Ai.data)||(pc=this._getOrReturnCtx(Ai,pc),addIssueToContext(pc,{validation:"regex",code:ZodIssueCode.invalid_string,message:mc.message}),Ra.dirty())):mc.kind==="trim"?Ai.data=Ai.data.trim():mc.kind==="includes"?Ai.data.includes(mc.value,mc.position)||(pc=this._getOrReturnCtx(Ai,pc),addIssueToContext(pc,{code:ZodIssueCode.invalid_string,validation:{includes:mc.value,position:mc.position},message:mc.message}),Ra.dirty()):mc.kind==="toLowerCase"?Ai.data=Ai.data.toLowerCase():mc.kind==="toUpperCase"?Ai.data=Ai.data.toUpperCase():mc.kind==="startsWith"?Ai.data.startsWith(mc.value)||(pc=this._getOrReturnCtx(Ai,pc),addIssueToContext(pc,{code:ZodIssueCode.invalid_string,validation:{startsWith:mc.value},message:mc.message}),Ra.dirty()):mc.kind==="endsWith"?Ai.data.endsWith(mc.value)||(pc=this._getOrReturnCtx(Ai,pc),addIssueToContext(pc,{code:ZodIssueCode.invalid_string,validation:{endsWith:mc.value},message:mc.message}),Ra.dirty()):mc.kind==="datetime"?datetimeRegex(mc).test(Ai.data)||(pc=this._getOrReturnCtx(Ai,pc),addIssueToContext(pc,{code:ZodIssueCode.invalid_string,validation:"datetime",message:mc.message}),Ra.dirty()):mc.kind==="date"?dateRegex.test(Ai.data)||(pc=this._getOrReturnCtx(Ai,pc),addIssueToContext(pc,{code:ZodIssueCode.invalid_string,validation:"date",message:mc.message}),Ra.dirty()):mc.kind==="time"?timeRegex(mc).test(Ai.data)||(pc=this._getOrReturnCtx(Ai,pc),addIssueToContext(pc,{code:ZodIssueCode.invalid_string,validation:"time",message:mc.message}),Ra.dirty()):mc.kind==="duration"?durationRegex.test(Ai.data)||(pc=this._getOrReturnCtx(Ai,pc),addIssueToContext(pc,{validation:"duration",code:ZodIssueCode.invalid_string,message:mc.message}),Ra.dirty()):mc.kind==="ip"?isValidIP(Ai.data,mc.version)||(pc=this._getOrReturnCtx(Ai,pc),addIssueToContext(pc,{validation:"ip",code:ZodIssueCode.invalid_string,message:mc.message}),Ra.dirty()):mc.kind==="jwt"?isValidJWT(Ai.data,mc.alg)||(pc=this._getOrReturnCtx(Ai,pc),addIssueToContext(pc,{validation:"jwt",code:ZodIssueCode.invalid_string,message:mc.message}),Ra.dirty()):mc.kind==="cidr"?isValidCidr(Ai.data,mc.version)||(pc=this._getOrReturnCtx(Ai,pc),addIssueToContext(pc,{validation:"cidr",code:ZodIssueCode.invalid_string,message:mc.message}),Ra.dirty()):mc.kind==="base64"?base64Regex.test(Ai.data)||(pc=this._getOrReturnCtx(Ai,pc),addIssueToContext(pc,{validation:"base64",code:ZodIssueCode.invalid_string,message:mc.message}),Ra.dirty()):mc.kind==="base64url"?base64urlRegex.test(Ai.data)||(pc=this._getOrReturnCtx(Ai,pc),addIssueToContext(pc,{validation:"base64url",code:ZodIssueCode.invalid_string,message:mc.message}),Ra.dirty()):util.assertNever(mc);return{status:Ra.value,value:Ai.data}}_regex(Ai,bo,Ra){return this.refinement(pc=>Ai.test(pc),{validation:bo,code:ZodIssueCode.invalid_string,...errorUtil.errToObj(Ra)})}_addCheck(Ai){return new ZodString({...this._def,checks:[...this._def.checks,Ai]})}email(Ai){return this._addCheck({kind:"email",...errorUtil.errToObj(Ai)})}url(Ai){return this._addCheck({kind:"url",...errorUtil.errToObj(Ai)})}emoji(Ai){return this._addCheck({kind:"emoji",...errorUtil.errToObj(Ai)})}uuid(Ai){return this._addCheck({kind:"uuid",...errorUtil.errToObj(Ai)})}nanoid(Ai){return this._addCheck({kind:"nanoid",...errorUtil.errToObj(Ai)})}cuid(Ai){return this._addCheck({kind:"cuid",...errorUtil.errToObj(Ai)})}cuid2(Ai){return this._addCheck({kind:"cuid2",...errorUtil.errToObj(Ai)})}ulid(Ai){return this._addCheck({kind:"ulid",...errorUtil.errToObj(Ai)})}base64(Ai){return this._addCheck({kind:"base64",...errorUtil.errToObj(Ai)})}base64url(Ai){return this._addCheck({kind:"base64url",...errorUtil.errToObj(Ai)})}jwt(Ai){return this._addCheck({kind:"jwt",...errorUtil.errToObj(Ai)})}ip(Ai){return this._addCheck({kind:"ip",...errorUtil.errToObj(Ai)})}cidr(Ai){return this._addCheck({kind:"cidr",...errorUtil.errToObj(Ai)})}datetime(Ai){var bo,Ra;return typeof Ai=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:Ai}):this._addCheck({kind:"datetime",precision:typeof(Ai==null?void 0:Ai.precision)>"u"?null:Ai==null?void 0:Ai.precision,offset:(bo=Ai==null?void 0:Ai.offset)!==null&&bo!==void 0?bo:!1,local:(Ra=Ai==null?void 0:Ai.local)!==null&&Ra!==void 0?Ra:!1,...errorUtil.errToObj(Ai==null?void 0:Ai.message)})}date(Ai){return this._addCheck({kind:"date",message:Ai})}time(Ai){return typeof Ai=="string"?this._addCheck({kind:"time",precision:null,message:Ai}):this._addCheck({kind:"time",precision:typeof(Ai==null?void 0:Ai.precision)>"u"?null:Ai==null?void 0:Ai.precision,...errorUtil.errToObj(Ai==null?void 0:Ai.message)})}duration(Ai){return this._addCheck({kind:"duration",...errorUtil.errToObj(Ai)})}regex(Ai,bo){return this._addCheck({kind:"regex",regex:Ai,...errorUtil.errToObj(bo)})}includes(Ai,bo){return this._addCheck({kind:"includes",value:Ai,position:bo==null?void 0:bo.position,...errorUtil.errToObj(bo==null?void 0:bo.message)})}startsWith(Ai,bo){return this._addCheck({kind:"startsWith",value:Ai,...errorUtil.errToObj(bo)})}endsWith(Ai,bo){return this._addCheck({kind:"endsWith",value:Ai,...errorUtil.errToObj(bo)})}min(Ai,bo){return this._addCheck({kind:"min",value:Ai,...errorUtil.errToObj(bo)})}max(Ai,bo){return this._addCheck({kind:"max",value:Ai,...errorUtil.errToObj(bo)})}length(Ai,bo){return this._addCheck({kind:"length",value:Ai,...errorUtil.errToObj(bo)})}nonempty(Ai){return this.min(1,errorUtil.errToObj(Ai))}trim(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(Ai=>Ai.kind==="datetime")}get isDate(){return!!this._def.checks.find(Ai=>Ai.kind==="date")}get isTime(){return!!this._def.checks.find(Ai=>Ai.kind==="time")}get isDuration(){return!!this._def.checks.find(Ai=>Ai.kind==="duration")}get isEmail(){return!!this._def.checks.find(Ai=>Ai.kind==="email")}get isURL(){return!!this._def.checks.find(Ai=>Ai.kind==="url")}get isEmoji(){return!!this._def.checks.find(Ai=>Ai.kind==="emoji")}get isUUID(){return!!this._def.checks.find(Ai=>Ai.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(Ai=>Ai.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(Ai=>Ai.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(Ai=>Ai.kind==="cuid2")}get isULID(){return!!this._def.checks.find(Ai=>Ai.kind==="ulid")}get isIP(){return!!this._def.checks.find(Ai=>Ai.kind==="ip")}get isCIDR(){return!!this._def.checks.find(Ai=>Ai.kind==="cidr")}get isBase64(){return!!this._def.checks.find(Ai=>Ai.kind==="base64")}get isBase64url(){return!!this._def.checks.find(Ai=>Ai.kind==="base64url")}get minLength(){let Ai=null;for(const bo of this._def.checks)bo.kind==="min"&&(Ai===null||bo.value>Ai)&&(Ai=bo.value);return Ai}get maxLength(){let Ai=null;for(const bo of this._def.checks)bo.kind==="max"&&(Ai===null||bo.value<Ai)&&(Ai=bo.value);return Ai}}ZodString.create=vo=>{var Ai;return new ZodString({checks:[],typeName:ZodFirstPartyTypeKind.ZodString,coerce:(Ai=vo==null?void 0:vo.coerce)!==null&&Ai!==void 0?Ai:!1,...processCreateParams(vo)})};function floatSafeRemainder(vo,Ai){const bo=(vo.toString().split(".")[1]||"").length,Ra=(Ai.toString().split(".")[1]||"").length,pc=bo>Ra?bo:Ra,mc=parseInt(vo.toFixed(pc).replace(".","")),uf=parseInt(Ai.toFixed(pc).replace(".",""));return mc%uf/Math.pow(10,pc)}class ZodNumber extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(Ai){if(this._def.coerce&&(Ai.data=Number(Ai.data)),this._getType(Ai)!==ZodParsedType.number){const mc=this._getOrReturnCtx(Ai);return addIssueToContext(mc,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.number,received:mc.parsedType}),INVALID}let Ra;const pc=new ParseStatus;for(const mc of this._def.checks)mc.kind==="int"?util.isInteger(Ai.data)||(Ra=this._getOrReturnCtx(Ai,Ra),addIssueToContext(Ra,{code:ZodIssueCode.invalid_type,expected:"integer",received:"float",message:mc.message}),pc.dirty()):mc.kind==="min"?(mc.inclusive?Ai.data<mc.value:Ai.data<=mc.value)&&(Ra=this._getOrReturnCtx(Ai,Ra),addIssueToContext(Ra,{code:ZodIssueCode.too_small,minimum:mc.value,type:"number",inclusive:mc.inclusive,exact:!1,message:mc.message}),pc.dirty()):mc.kind==="max"?(mc.inclusive?Ai.data>mc.value:Ai.data>=mc.value)&&(Ra=this._getOrReturnCtx(Ai,Ra),addIssueToContext(Ra,{code:ZodIssueCode.too_big,maximum:mc.value,type:"number",inclusive:mc.inclusive,exact:!1,message:mc.message}),pc.dirty()):mc.kind==="multipleOf"?floatSafeRemainder(Ai.data,mc.value)!==0&&(Ra=this._getOrReturnCtx(Ai,Ra),addIssueToContext(Ra,{code:ZodIssueCode.not_multiple_of,multipleOf:mc.value,message:mc.message}),pc.dirty()):mc.kind==="finite"?Number.isFinite(Ai.data)||(Ra=this._getOrReturnCtx(Ai,Ra),addIssueToContext(Ra,{code:ZodIssueCode.not_finite,message:mc.message}),pc.dirty()):util.assertNever(mc);return{status:pc.value,value:Ai.data}}gte(Ai,bo){return this.setLimit("min",Ai,!0,errorUtil.toString(bo))}gt(Ai,bo){return this.setLimit("min",Ai,!1,errorUtil.toString(bo))}lte(Ai,bo){return this.setLimit("max",Ai,!0,errorUtil.toString(bo))}lt(Ai,bo){return this.setLimit("max",Ai,!1,errorUtil.toString(bo))}setLimit(Ai,bo,Ra,pc){return new ZodNumber({...this._def,checks:[...this._def.checks,{kind:Ai,value:bo,inclusive:Ra,message:errorUtil.toString(pc)}]})}_addCheck(Ai){return new ZodNumber({...this._def,checks:[...this._def.checks,Ai]})}int(Ai){return this._addCheck({kind:"int",message:errorUtil.toString(Ai)})}positive(Ai){return this._addCheck({kind:"min",value:0,inclusive:!1,message:errorUtil.toString(Ai)})}negative(Ai){return this._addCheck({kind:"max",value:0,inclusive:!1,message:errorUtil.toString(Ai)})}nonpositive(Ai){return this._addCheck({kind:"max",value:0,inclusive:!0,message:errorUtil.toString(Ai)})}nonnegative(Ai){return this._addCheck({kind:"min",value:0,inclusive:!0,message:errorUtil.toString(Ai)})}multipleOf(Ai,bo){return this._addCheck({kind:"multipleOf",value:Ai,message:errorUtil.toString(bo)})}finite(Ai){return this._addCheck({kind:"finite",message:errorUtil.toString(Ai)})}safe(Ai){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:errorUtil.toString(Ai)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:errorUtil.toString(Ai)})}get minValue(){let Ai=null;for(const bo of this._def.checks)bo.kind==="min"&&(Ai===null||bo.value>Ai)&&(Ai=bo.value);return Ai}get maxValue(){let Ai=null;for(const bo of this._def.checks)bo.kind==="max"&&(Ai===null||bo.value<Ai)&&(Ai=bo.value);return Ai}get isInt(){return!!this._def.checks.find(Ai=>Ai.kind==="int"||Ai.kind==="multipleOf"&&util.isInteger(Ai.value))}get isFinite(){let Ai=null,bo=null;for(const Ra of this._def.checks){if(Ra.kind==="finite"||Ra.kind==="int"||Ra.kind==="multipleOf")return!0;Ra.kind==="min"?(bo===null||Ra.value>bo)&&(bo=Ra.value):Ra.kind==="max"&&(Ai===null||Ra.value<Ai)&&(Ai=Ra.value)}return Number.isFinite(bo)&&Number.isFinite(Ai)}}ZodNumber.create=vo=>new ZodNumber({checks:[],typeName:ZodFirstPartyTypeKind.ZodNumber,coerce:(vo==null?void 0:vo.coerce)||!1,...processCreateParams(vo)});class ZodBigInt extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(Ai){if(this._def.coerce)try{Ai.data=BigInt(Ai.data)}catch{return this._getInvalidInput(Ai)}if(this._getType(Ai)!==ZodParsedType.bigint)return this._getInvalidInput(Ai);let Ra;const pc=new ParseStatus;for(const mc of this._def.checks)mc.kind==="min"?(mc.inclusive?Ai.data<mc.value:Ai.data<=mc.value)&&(Ra=this._getOrReturnCtx(Ai,Ra),addIssueToContext(Ra,{code:ZodIssueCode.too_small,type:"bigint",minimum:mc.value,inclusive:mc.inclusive,message:mc.message}),pc.dirty()):mc.kind==="max"?(mc.inclusive?Ai.data>mc.value:Ai.data>=mc.value)&&(Ra=this._getOrReturnCtx(Ai,Ra),addIssueToContext(Ra,{code:ZodIssueCode.too_big,type:"bigint",maximum:mc.value,inclusive:mc.inclusive,message:mc.message}),pc.dirty()):mc.kind==="multipleOf"?Ai.data%mc.value!==BigInt(0)&&(Ra=this._getOrReturnCtx(Ai,Ra),addIssueToContext(Ra,{code:ZodIssueCode.not_multiple_of,multipleOf:mc.value,message:mc.message}),pc.dirty()):util.assertNever(mc);return{status:pc.value,value:Ai.data}}_getInvalidInput(Ai){const bo=this._getOrReturnCtx(Ai);return addIssueToContext(bo,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.bigint,received:bo.parsedType}),INVALID}gte(Ai,bo){return this.setLimit("min",Ai,!0,errorUtil.toString(bo))}gt(Ai,bo){return this.setLimit("min",Ai,!1,errorUtil.toString(bo))}lte(Ai,bo){return this.setLimit("max",Ai,!0,errorUtil.toString(bo))}lt(Ai,bo){return this.setLimit("max",Ai,!1,errorUtil.toString(bo))}setLimit(Ai,bo,Ra,pc){return new ZodBigInt({...this._def,checks:[...this._def.checks,{kind:Ai,value:bo,inclusive:Ra,message:errorUtil.toString(pc)}]})}_addCheck(Ai){return new ZodBigInt({...this._def,checks:[...this._def.checks,Ai]})}positive(Ai){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:errorUtil.toString(Ai)})}negative(Ai){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:errorUtil.toString(Ai)})}nonpositive(Ai){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:errorUtil.toString(Ai)})}nonnegative(Ai){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:errorUtil.toString(Ai)})}multipleOf(Ai,bo){return this._addCheck({kind:"multipleOf",value:Ai,message:errorUtil.toString(bo)})}get minValue(){let Ai=null;for(const bo of this._def.checks)bo.kind==="min"&&(Ai===null||bo.value>Ai)&&(Ai=bo.value);return Ai}get maxValue(){let Ai=null;for(const bo of this._def.checks)bo.kind==="max"&&(Ai===null||bo.value<Ai)&&(Ai=bo.value);return Ai}}ZodBigInt.create=vo=>{var Ai;return new ZodBigInt({checks:[],typeName:ZodFirstPartyTypeKind.ZodBigInt,coerce:(Ai=vo==null?void 0:vo.coerce)!==null&&Ai!==void 0?Ai:!1,...processCreateParams(vo)})};class ZodBoolean extends ZodType{_parse(Ai){if(this._def.coerce&&(Ai.data=!!Ai.data),this._getType(Ai)!==ZodParsedType.boolean){const Ra=this._getOrReturnCtx(Ai);return addIssueToContext(Ra,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.boolean,received:Ra.parsedType}),INVALID}return OK(Ai.data)}}ZodBoolean.create=vo=>new ZodBoolean({typeName:ZodFirstPartyTypeKind.ZodBoolean,coerce:(vo==null?void 0:vo.coerce)||!1,...processCreateParams(vo)});class ZodDate extends ZodType{_parse(Ai){if(this._def.coerce&&(Ai.data=new Date(Ai.data)),this._getType(Ai)!==ZodParsedType.date){const mc=this._getOrReturnCtx(Ai);return addIssueToContext(mc,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.date,received:mc.parsedType}),INVALID}if(isNaN(Ai.data.getTime())){const mc=this._getOrReturnCtx(Ai);return addIssueToContext(mc,{code:ZodIssueCode.invalid_date}),INVALID}const Ra=new ParseStatus;let pc;for(const mc of this._def.checks)mc.kind==="min"?Ai.data.getTime()<mc.value&&(pc=this._getOrReturnCtx(Ai,pc),addIssueToContext(pc,{code:ZodIssueCode.too_small,message:mc.message,inclusive:!0,exact:!1,minimum:mc.value,type:"date"}),Ra.dirty()):mc.kind==="max"?Ai.data.getTime()>mc.value&&(pc=this._getOrReturnCtx(Ai,pc),addIssueToContext(pc,{code:ZodIssueCode.too_big,message:mc.message,inclusive:!0,exact:!1,maximum:mc.value,type:"date"}),Ra.dirty()):util.assertNever(mc);return{status:Ra.value,value:new Date(Ai.data.getTime())}}_addCheck(Ai){return new ZodDate({...this._def,checks:[...this._def.checks,Ai]})}min(Ai,bo){return this._addCheck({kind:"min",value:Ai.getTime(),message:errorUtil.toString(bo)})}max(Ai,bo){return this._addCheck({kind:"max",value:Ai.getTime(),message:errorUtil.toString(bo)})}get minDate(){let Ai=null;for(const bo of this._def.checks)bo.kind==="min"&&(Ai===null||bo.value>Ai)&&(Ai=bo.value);return Ai!=null?new Date(Ai):null}get maxDate(){let Ai=null;for(const bo of this._def.checks)bo.kind==="max"&&(Ai===null||bo.value<Ai)&&(Ai=bo.value);return Ai!=null?new Date(Ai):null}}ZodDate.create=vo=>new ZodDate({checks:[],coerce:(vo==null?void 0:vo.coerce)||!1,typeName:ZodFirstPartyTypeKind.ZodDate,...processCreateParams(vo)});class ZodSymbol extends ZodType{_parse(Ai){if(this._getType(Ai)!==ZodParsedType.symbol){const Ra=this._getOrReturnCtx(Ai);return addIssueToContext(Ra,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.symbol,received:Ra.parsedType}),INVALID}return OK(Ai.data)}}ZodSymbol.create=vo=>new ZodSymbol({typeName:ZodFirstPartyTypeKind.ZodSymbol,...processCreateParams(vo)});class ZodUndefined extends ZodType{_parse(Ai){if(this._getType(Ai)!==ZodParsedType.undefined){const Ra=this._getOrReturnCtx(Ai);return addIssueToContext(Ra,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.undefined,received:Ra.parsedType}),INVALID}return OK(Ai.data)}}ZodUndefined.create=vo=>new ZodUndefined({typeName:ZodFirstPartyTypeKind.ZodUndefined,...processCreateParams(vo)});class ZodNull extends ZodType{_parse(Ai){if(this._getType(Ai)!==ZodParsedType.null){const Ra=this._getOrReturnCtx(Ai);return addIssueToContext(Ra,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.null,received:Ra.parsedType}),INVALID}return OK(Ai.data)}}ZodNull.create=vo=>new ZodNull({typeName:ZodFirstPartyTypeKind.ZodNull,...processCreateParams(vo)});class ZodAny extends ZodType{constructor(){super(...arguments),this._any=!0}_parse(Ai){return OK(Ai.data)}}ZodAny.create=vo=>new ZodAny({typeName:ZodFirstPartyTypeKind.ZodAny,...processCreateParams(vo)});class ZodUnknown extends ZodType{constructor(){super(...arguments),this._unknown=!0}_parse(Ai){return OK(Ai.data)}}ZodUnknown.create=vo=>new ZodUnknown({typeName:ZodFirstPartyTypeKind.ZodUnknown,...processCreateParams(vo)});class ZodNever extends ZodType{_parse(Ai){const bo=this._getOrReturnCtx(Ai);return addIssueToContext(bo,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.never,received:bo.parsedType}),INVALID}}ZodNever.create=vo=>new ZodNever({typeName:ZodFirstPartyTypeKind.ZodNever,...processCreateParams(vo)});class ZodVoid extends ZodType{_parse(Ai){if(this._getType(Ai)!==ZodParsedType.undefined){const Ra=this._getOrReturnCtx(Ai);return addIssueToContext(Ra,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.void,received:Ra.parsedType}),INVALID}return OK(Ai.data)}}ZodVoid.create=vo=>new ZodVoid({typeName:ZodFirstPartyTypeKind.ZodVoid,...processCreateParams(vo)});class ZodArray extends ZodType{_parse(Ai){const{ctx:bo,status:Ra}=this._processInputParams(Ai),pc=this._def;if(bo.parsedType!==ZodParsedType.array)return addIssueToContext(bo,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:bo.parsedType}),INVALID;if(pc.exactLength!==null){const uf=bo.data.length>pc.exactLength.value,df=bo.data.length<pc.exactLength.value;(uf||df)&&(addIssueToContext(bo,{code:uf?ZodIssueCode.too_big:ZodIssueCode.too_small,minimum:df?pc.exactLength.value:void 0,maximum:uf?pc.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:pc.exactLength.message}),Ra.dirty())}if(pc.minLength!==null&&bo.data.length<pc.minLength.value&&(addIssueToContext(bo,{code:ZodIssueCode.too_small,minimum:pc.minLength.value,type:"array",inclusive:!0,exact:!1,message:pc.minLength.message}),Ra.dirty()),pc.maxLength!==null&&bo.data.length>pc.maxLength.value&&(addIssueToContext(bo,{code:ZodIssueCode.too_big,maximum:pc.maxLength.value,type:"array",inclusive:!0,exact:!1,message:pc.maxLength.message}),Ra.dirty()),bo.common.async)return Promise.all([...bo.data].map((uf,df)=>pc.type._parseAsync(new ParseInputLazyPath(bo,uf,bo.path,df)))).then(uf=>ParseStatus.mergeArray(Ra,uf));const mc=[...bo.data].map((uf,df)=>pc.type._parseSync(new ParseInputLazyPath(bo,uf,bo.path,df)));return ParseStatus.mergeArray(Ra,mc)}get element(){return this._def.type}min(Ai,bo){return new ZodArray({...this._def,minLength:{value:Ai,message:errorUtil.toString(bo)}})}max(Ai,bo){return new ZodArray({...this._def,maxLength:{value:Ai,message:errorUtil.toString(bo)}})}length(Ai,bo){return new ZodArray({...this._def,exactLength:{value:Ai,message:errorUtil.toString(bo)}})}nonempty(Ai){return this.min(1,Ai)}}ZodArray.create=(vo,Ai)=>new ZodArray({type:vo,minLength:null,maxLength:null,exactLength:null,typeName:ZodFirstPartyTypeKind.ZodArray,...processCreateParams(Ai)});function deepPartialify(vo){if(vo instanceof ZodObject){const Ai={};for(const bo in vo.shape){const Ra=vo.shape[bo];Ai[bo]=ZodOptional.create(deepPartialify(Ra))}return new ZodObject({...vo._def,shape:()=>Ai})}else return vo instanceof ZodArray?new ZodArray({...vo._def,type:deepPartialify(vo.element)}):vo instanceof ZodOptional?ZodOptional.create(deepPartialify(vo.unwrap())):vo instanceof ZodNullable?ZodNullable.create(deepPartialify(vo.unwrap())):vo instanceof ZodTuple?ZodTuple.create(vo.items.map(Ai=>deepPartialify(Ai))):vo}class ZodObject extends ZodType{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const Ai=this._def.shape(),bo=util.objectKeys(Ai);return this._cached={shape:Ai,keys:bo}}_parse(Ai){if(this._getType(Ai)!==ZodParsedType.object){const hf=this._getOrReturnCtx(Ai);return addIssueToContext(hf,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:hf.parsedType}),INVALID}const{status:Ra,ctx:pc}=this._processInputParams(Ai),{shape:mc,keys:uf}=this._getCached(),df=[];if(!(this._def.catchall instanceof ZodNever&&this._def.unknownKeys==="strip"))for(const hf in pc.data)uf.includes(hf)||df.push(hf);const ff=[];for(const hf of uf){const pf=mc[hf],mf=pc.data[hf];ff.push({key:{status:"valid",value:hf},value:pf._parse(new ParseInputLazyPath(pc,mf,pc.path,hf)),alwaysSet:hf in pc.data})}if(this._def.catchall instanceof ZodNever){const hf=this._def.unknownKeys;if(hf==="passthrough")for(const pf of df)ff.push({key:{status:"valid",value:pf},value:{status:"valid",value:pc.data[pf]}});else if(hf==="strict")df.length>0&&(addIssueToContext(pc,{code:ZodIssueCode.unrecognized_keys,keys:df}),Ra.dirty());else if(hf!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const hf=this._def.catchall;for(const pf of df){const mf=pc.data[pf];ff.push({key:{status:"valid",value:pf},value:hf._parse(new ParseInputLazyPath(pc,mf,pc.path,pf)),alwaysSet:pf in pc.data})}}return pc.common.async?Promise.resolve().then(async()=>{const hf=[];for(const pf of ff){const mf=await pf.key,gf=await pf.value;hf.push({key:mf,value:gf,alwaysSet:pf.alwaysSet})}return hf}).then(hf=>ParseStatus.mergeObjectSync(Ra,hf)):ParseStatus.mergeObjectSync(Ra,ff)}get shape(){return this._def.shape()}strict(Ai){return errorUtil.errToObj,new ZodObject({...this._def,unknownKeys:"strict",...Ai!==void 0?{errorMap:(bo,Ra)=>{var pc,mc,uf,df;const ff=(uf=(mc=(pc=this._def).errorMap)===null||mc===void 0?void 0:mc.call(pc,bo,Ra).message)!==null&&uf!==void 0?uf:Ra.defaultError;return bo.code==="unrecognized_keys"?{message:(df=errorUtil.errToObj(Ai).message)!==null&&df!==void 0?df:ff}:{message:ff}}}:{}})}strip(){return new ZodObject({...this._def,unknownKeys:"strip"})}passthrough(){return new ZodObject({...this._def,unknownKeys:"passthrough"})}extend(Ai){return new ZodObject({...this._def,shape:()=>({...this._def.shape(),...Ai})})}merge(Ai){return new ZodObject({unknownKeys:Ai._def.unknownKeys,catchall:Ai._def.catchall,shape:()=>({...this._def.shape(),...Ai._def.shape()}),typeName:ZodFirstPartyTypeKind.ZodObject})}setKey(Ai,bo){return this.augment({[Ai]:bo})}catchall(Ai){return new ZodObject({...this._def,catchall:Ai})}pick(Ai){const bo={};return util.objectKeys(Ai).forEach(Ra=>{Ai[Ra]&&this.shape[Ra]&&(bo[Ra]=this.shape[Ra])}),new ZodObject({...this._def,shape:()=>bo})}omit(Ai){const bo={};return util.objectKeys(this.shape).forEach(Ra=>{Ai[Ra]||(bo[Ra]=this.shape[Ra])}),new ZodObject({...this._def,shape:()=>bo})}deepPartial(){return deepPartialify(this)}partial(Ai){const bo={};return util.objectKeys(this.shape).forEach(Ra=>{const pc=this.shape[Ra];Ai&&!Ai[Ra]?bo[Ra]=pc:bo[Ra]=pc.optional()}),new ZodObject({...this._def,shape:()=>bo})}required(Ai){const bo={};return util.objectKeys(this.shape).forEach(Ra=>{if(Ai&&!Ai[Ra])bo[Ra]=this.shape[Ra];else{let mc=this.shape[Ra];for(;mc instanceof ZodOptional;)mc=mc._def.innerType;bo[Ra]=mc}}),new ZodObject({...this._def,shape:()=>bo})}keyof(){return createZodEnum(util.objectKeys(this.shape))}}ZodObject.create=(vo,Ai)=>new ZodObject({shape:()=>vo,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(Ai)});ZodObject.strictCreate=(vo,Ai)=>new ZodObject({shape:()=>vo,unknownKeys:"strict",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(Ai)});ZodObject.lazycreate=(vo,Ai)=>new ZodObject({shape:vo,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(Ai)});class ZodUnion extends ZodType{_parse(Ai){const{ctx:bo}=this._processInputParams(Ai),Ra=this._def.options;function pc(mc){for(const df of mc)if(df.result.status==="valid")return df.result;for(const df of mc)if(df.result.status==="dirty")return bo.common.issues.push(...df.ctx.common.issues),df.result;const uf=mc.map(df=>new ZodError(df.ctx.common.issues));return addIssueToContext(bo,{code:ZodIssueCode.invalid_union,unionErrors:uf}),INVALID}if(bo.common.async)return Promise.all(Ra.map(async mc=>{const uf={...bo,common:{...bo.common,issues:[]},parent:null};return{result:await mc._parseAsync({data:bo.data,path:bo.path,parent:uf}),ctx:uf}})).then(pc);{let mc;const uf=[];for(const ff of Ra){const hf={...bo,common:{...bo.common,issues:[]},parent:null},pf=ff._parseSync({data:bo.data,path:bo.path,parent:hf});if(pf.status==="valid")return pf;pf.status==="dirty"&&!mc&&(mc={result:pf,ctx:hf}),hf.common.issues.length&&uf.push(hf.common.issues)}if(mc)return bo.common.issues.push(...mc.ctx.common.issues),mc.result;const df=uf.map(ff=>new ZodError(ff));return addIssueToContext(bo,{code:ZodIssueCode.invalid_union,unionErrors:df}),INVALID}}get options(){return this._def.options}}ZodUnion.create=(vo,Ai)=>new ZodUnion({options:vo,typeName:ZodFirstPartyTypeKind.ZodUnion,...processCreateParams(Ai)});const getDiscriminator=vo=>vo instanceof ZodLazy?getDiscriminator(vo.schema):vo instanceof ZodEffects?getDiscriminator(vo.innerType()):vo instanceof ZodLiteral?[vo.value]:vo instanceof ZodEnum?vo.options:vo instanceof ZodNativeEnum?util.objectValues(vo.enum):vo instanceof ZodDefault?getDiscriminator(vo._def.innerType):vo instanceof ZodUndefined?[void 0]:vo instanceof ZodNull?[null]:vo instanceof ZodOptional?[void 0,...getDiscriminator(vo.unwrap())]:vo instanceof ZodNullable?[null,...getDiscriminator(vo.unwrap())]:vo instanceof ZodBranded||vo instanceof ZodReadonly?getDiscriminator(vo.unwrap()):vo instanceof ZodCatch?getDiscriminator(vo._def.innerType):[];class ZodDiscriminatedUnion extends ZodType{_parse(Ai){const{ctx:bo}=this._processInputParams(Ai);if(bo.parsedType!==ZodParsedType.object)return addIssueToContext(bo,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:bo.parsedType}),INVALID;const Ra=this.discriminator,pc=bo.data[Ra],mc=this.optionsMap.get(pc);return mc?bo.common.async?mc._parseAsync({data:bo.data,path:bo.path,parent:bo}):mc._parseSync({data:bo.data,path:bo.path,parent:bo}):(addIssueToContext(bo,{code:ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[Ra]}),INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(Ai,bo,Ra){const pc=new Map;for(const mc of bo){const uf=getDiscriminator(mc.shape[Ai]);if(!uf.length)throw new Error(`A discriminator value for key \`${Ai}\` could not be extracted from all schema options`);for(const df of uf){if(pc.has(df))throw new Error(`Discriminator property ${String(Ai)} has duplicate value ${String(df)}`);pc.set(df,mc)}}return new ZodDiscriminatedUnion({typeName:ZodFirstPartyTypeKind.ZodDiscriminatedUnion,discriminator:Ai,options:bo,optionsMap:pc,...processCreateParams(Ra)})}}function mergeValues(vo,Ai){const bo=getParsedType(vo),Ra=getParsedType(Ai);if(vo===Ai)return{valid:!0,data:vo};if(bo===ZodParsedType.object&&Ra===ZodParsedType.object){const pc=util.objectKeys(Ai),mc=util.objectKeys(vo).filter(df=>pc.indexOf(df)!==-1),uf={...vo,...Ai};for(const df of mc){const ff=mergeValues(vo[df],Ai[df]);if(!ff.valid)return{valid:!1};uf[df]=ff.data}return{valid:!0,data:uf}}else if(bo===ZodParsedType.array&&Ra===ZodParsedType.array){if(vo.length!==Ai.length)return{valid:!1};const pc=[];for(let mc=0;mc<vo.length;mc++){const uf=vo[mc],df=Ai[mc],ff=mergeValues(uf,df);if(!ff.valid)return{valid:!1};pc.push(ff.data)}return{valid:!0,data:pc}}else return bo===ZodParsedType.date&&Ra===ZodParsedType.date&&+vo==+Ai?{valid:!0,data:vo}:{valid:!1}}class ZodIntersection extends ZodType{_parse(Ai){const{status:bo,ctx:Ra}=this._processInputParams(Ai),pc=(mc,uf)=>{if(isAborted(mc)||isAborted(uf))return INVALID;const df=mergeValues(mc.value,uf.value);return df.valid?((isDirty(mc)||isDirty(uf))&&bo.dirty(),{status:bo.value,value:df.data}):(addIssueToContext(Ra,{code:ZodIssueCode.invalid_intersection_types}),INVALID)};return Ra.common.async?Promise.all([this._def.left._parseAsync({data:Ra.data,path:Ra.path,parent:Ra}),this._def.right._parseAsync({data:Ra.data,path:Ra.path,parent:Ra})]).then(([mc,uf])=>pc(mc,uf)):pc(this._def.left._parseSync({data:Ra.data,path:Ra.path,parent:Ra}),this._def.right._parseSync({data:Ra.data,path:Ra.path,parent:Ra}))}}ZodIntersection.create=(vo,Ai,bo)=>new ZodIntersection({left:vo,right:Ai,typeName:ZodFirstPartyTypeKind.ZodIntersection,...processCreateParams(bo)});class ZodTuple extends ZodType{_parse(Ai){const{status:bo,ctx:Ra}=this._processInputParams(Ai);if(Ra.parsedType!==ZodParsedType.array)return addIssueToContext(Ra,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:Ra.parsedType}),INVALID;if(Ra.data.length<this._def.items.length)return addIssueToContext(Ra,{code:ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),INVALID;!this._def.rest&&Ra.data.length>this._def.items.length&&(addIssueToContext(Ra,{code:ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),bo.dirty());const mc=[...Ra.data].map((uf,df)=>{const ff=this._def.items[df]||this._def.rest;return ff?ff._parse(new ParseInputLazyPath(Ra,uf,Ra.path,df)):null}).filter(uf=>!!uf);return Ra.common.async?Promise.all(mc).then(uf=>ParseStatus.mergeArray(bo,uf)):ParseStatus.mergeArray(bo,mc)}get items(){return this._def.items}rest(Ai){return new ZodTuple({...this._def,rest:Ai})}}ZodTuple.create=(vo,Ai)=>{if(!Array.isArray(vo))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ZodTuple({items:vo,typeName:ZodFirstPartyTypeKind.ZodTuple,rest:null,...processCreateParams(Ai)})};class ZodRecord extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(Ai){const{status:bo,ctx:Ra}=this._processInputParams(Ai);if(Ra.parsedType!==ZodParsedType.object)return addIssueToContext(Ra,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:Ra.parsedType}),INVALID;const pc=[],mc=this._def.keyType,uf=this._def.valueType;for(const df in Ra.data)pc.push({key:mc._parse(new ParseInputLazyPath(Ra,df,Ra.path,df)),value:uf._parse(new ParseInputLazyPath(Ra,Ra.data[df],Ra.path,df)),alwaysSet:df in Ra.data});return Ra.common.async?ParseStatus.mergeObjectAsync(bo,pc):ParseStatus.mergeObjectSync(bo,pc)}get element(){return this._def.valueType}static create(Ai,bo,Ra){return bo instanceof ZodType?new ZodRecord({keyType:Ai,valueType:bo,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(Ra)}):new ZodRecord({keyType:ZodString.create(),valueType:Ai,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(bo)})}}class ZodMap extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(Ai){const{status:bo,ctx:Ra}=this._processInputParams(Ai);if(Ra.parsedType!==ZodParsedType.map)return addIssueToContext(Ra,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.map,received:Ra.parsedType}),INVALID;const pc=this._def.keyType,mc=this._def.valueType,uf=[...Ra.data.entries()].map(([df,ff],hf)=>({key:pc._parse(new ParseInputLazyPath(Ra,df,Ra.path,[hf,"key"])),value:mc._parse(new ParseInputLazyPath(Ra,ff,Ra.path,[hf,"value"]))}));if(Ra.common.async){const df=new Map;return Promise.resolve().then(async()=>{for(const ff of uf){const hf=await ff.key,pf=await ff.value;if(hf.status==="aborted"||pf.status==="aborted")return INVALID;(hf.status==="dirty"||pf.status==="dirty")&&bo.dirty(),df.set(hf.value,pf.value)}return{status:bo.value,value:df}})}else{const df=new Map;for(const ff of uf){const hf=ff.key,pf=ff.value;if(hf.status==="aborted"||pf.status==="aborted")return INVALID;(hf.status==="dirty"||pf.status==="dirty")&&bo.dirty(),df.set(hf.value,pf.value)}return{status:bo.value,value:df}}}}ZodMap.create=(vo,Ai,bo)=>new ZodMap({valueType:Ai,keyType:vo,typeName:ZodFirstPartyTypeKind.ZodMap,...processCreateParams(bo)});class ZodSet extends ZodType{_parse(Ai){const{status:bo,ctx:Ra}=this._processInputParams(Ai);if(Ra.parsedType!==ZodParsedType.set)return addIssueToContext(Ra,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.set,received:Ra.parsedType}),INVALID;const pc=this._def;pc.minSize!==null&&Ra.data.size<pc.minSize.value&&(addIssueToContext(Ra,{code:ZodIssueCode.too_small,minimum:pc.minSize.value,type:"set",inclusive:!0,exact:!1,message:pc.minSize.message}),bo.dirty()),pc.maxSize!==null&&Ra.data.size>pc.maxSize.value&&(addIssueToContext(Ra,{code:ZodIssueCode.too_big,maximum:pc.maxSize.value,type:"set",inclusive:!0,exact:!1,message:pc.maxSize.message}),bo.dirty());const mc=this._def.valueType;function uf(ff){const hf=new Set;for(const pf of ff){if(pf.status==="aborted")return INVALID;pf.status==="dirty"&&bo.dirty(),hf.add(pf.value)}return{status:bo.value,value:hf}}const df=[...Ra.data.values()].map((ff,hf)=>mc._parse(new ParseInputLazyPath(Ra,ff,Ra.path,hf)));return Ra.common.async?Promise.all(df).then(ff=>uf(ff)):uf(df)}min(Ai,bo){return new ZodSet({...this._def,minSize:{value:Ai,message:errorUtil.toString(bo)}})}max(Ai,bo){return new ZodSet({...this._def,maxSize:{value:Ai,message:errorUtil.toString(bo)}})}size(Ai,bo){return this.min(Ai,bo).max(Ai,bo)}nonempty(Ai){return this.min(1,Ai)}}ZodSet.create=(vo,Ai)=>new ZodSet({valueType:vo,minSize:null,maxSize:null,typeName:ZodFirstPartyTypeKind.ZodSet,...processCreateParams(Ai)});class ZodFunction extends ZodType{constructor(){super(...arguments),this.validate=this.implement}_parse(Ai){const{ctx:bo}=this._processInputParams(Ai);if(bo.parsedType!==ZodParsedType.function)return addIssueToContext(bo,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.function,received:bo.parsedType}),INVALID;function Ra(df,ff){return makeIssue({data:df,path:bo.path,errorMaps:[bo.common.contextualErrorMap,bo.schemaErrorMap,getErrorMap(),errorMap].filter(hf=>!!hf),issueData:{code:ZodIssueCode.invalid_arguments,argumentsError:ff}})}function pc(df,ff){return makeIssue({data:df,path:bo.path,errorMaps:[bo.common.contextualErrorMap,bo.schemaErrorMap,getErrorMap(),errorMap].filter(hf=>!!hf),issueData:{code:ZodIssueCode.invalid_return_type,returnTypeError:ff}})}const mc={errorMap:bo.common.contextualErrorMap},uf=bo.data;if(this._def.returns instanceof ZodPromise){const df=this;return OK(async function(...ff){const hf=new ZodError([]),pf=await df._def.args.parseAsync(ff,mc).catch(yf=>{throw hf.addIssue(Ra(ff,yf)),hf}),mf=await Reflect.apply(uf,this,pf);return await df._def.returns._def.type.parseAsync(mf,mc).catch(yf=>{throw hf.addIssue(pc(mf,yf)),hf})})}else{const df=this;return OK(function(...ff){const hf=df._def.args.safeParse(ff,mc);if(!hf.success)throw new ZodError([Ra(ff,hf.error)]);const pf=Reflect.apply(uf,this,hf.data),mf=df._def.returns.safeParse(pf,mc);if(!mf.success)throw new ZodError([pc(pf,mf.error)]);return mf.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...Ai){return new ZodFunction({...this._def,args:ZodTuple.create(Ai).rest(ZodUnknown.create())})}returns(Ai){return new ZodFunction({...this._def,returns:Ai})}implement(Ai){return this.parse(Ai)}strictImplement(Ai){return this.parse(Ai)}static create(Ai,bo,Ra){return new ZodFunction({args:Ai||ZodTuple.create([]).rest(ZodUnknown.create()),returns:bo||ZodUnknown.create(),typeName:ZodFirstPartyTypeKind.ZodFunction,...processCreateParams(Ra)})}}class ZodLazy extends ZodType{get schema(){return this._def.getter()}_parse(Ai){const{ctx:bo}=this._processInputParams(Ai);return this._def.getter()._parse({data:bo.data,path:bo.path,parent:bo})}}ZodLazy.create=(vo,Ai)=>new ZodLazy({getter:vo,typeName:ZodFirstPartyTypeKind.ZodLazy,...processCreateParams(Ai)});class ZodLiteral extends ZodType{_parse(Ai){if(Ai.data!==this._def.value){const bo=this._getOrReturnCtx(Ai);return addIssueToContext(bo,{received:bo.data,code:ZodIssueCode.invalid_literal,expected:this._def.value}),INVALID}return{status:"valid",value:Ai.data}}get value(){return this._def.value}}ZodLiteral.create=(vo,Ai)=>new ZodLiteral({value:vo,typeName:ZodFirstPartyTypeKind.ZodLiteral,...processCreateParams(Ai)});function createZodEnum(vo,Ai){return new ZodEnum({values:vo,typeName:ZodFirstPartyTypeKind.ZodEnum,...processCreateParams(Ai)})}class ZodEnum extends ZodType{constructor(){super(...arguments),_ZodEnum_cache.set(this,void 0)}_parse(Ai){if(typeof Ai.data!="string"){const bo=this._getOrReturnCtx(Ai),Ra=this._def.values;return addIssueToContext(bo,{expected:util.joinValues(Ra),received:bo.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(__classPrivateFieldGet(this,_ZodEnum_cache)||__classPrivateFieldSet(this,_ZodEnum_cache,new Set(this._def.values)),!__classPrivateFieldGet(this,_ZodEnum_cache).has(Ai.data)){const bo=this._getOrReturnCtx(Ai),Ra=this._def.values;return addIssueToContext(bo,{received:bo.data,code:ZodIssueCode.invalid_enum_value,options:Ra}),INVALID}return OK(Ai.data)}get options(){return this._def.values}get enum(){const Ai={};for(const bo of this._def.values)Ai[bo]=bo;return Ai}get Values(){const Ai={};for(const bo of this._def.values)Ai[bo]=bo;return Ai}get Enum(){const Ai={};for(const bo of this._def.values)Ai[bo]=bo;return Ai}extract(Ai,bo=this._def){return ZodEnum.create(Ai,{...this._def,...bo})}exclude(Ai,bo=this._def){return ZodEnum.create(this.options.filter(Ra=>!Ai.includes(Ra)),{...this._def,...bo})}}_ZodEnum_cache=new WeakMap;ZodEnum.create=createZodEnum;class ZodNativeEnum extends ZodType{constructor(){super(...arguments),_ZodNativeEnum_cache.set(this,void 0)}_parse(Ai){const bo=util.getValidEnumValues(this._def.values),Ra=this._getOrReturnCtx(Ai);if(Ra.parsedType!==ZodParsedType.string&&Ra.parsedType!==ZodParsedType.number){const pc=util.objectValues(bo);return addIssueToContext(Ra,{expected:util.joinValues(pc),received:Ra.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(__classPrivateFieldGet(this,_ZodNativeEnum_cache)||__classPrivateFieldSet(this,_ZodNativeEnum_cache,new Set(util.getValidEnumValues(this._def.values))),!__classPrivateFieldGet(this,_ZodNativeEnum_cache).has(Ai.data)){const pc=util.objectValues(bo);return addIssueToContext(Ra,{received:Ra.data,code:ZodIssueCode.invalid_enum_value,options:pc}),INVALID}return OK(Ai.data)}get enum(){return this._def.values}}_ZodNativeEnum_cache=new WeakMap;ZodNativeEnum.create=(vo,Ai)=>new ZodNativeEnum({values:vo,typeName:ZodFirstPartyTypeKind.ZodNativeEnum,...processCreateParams(Ai)});class ZodPromise extends ZodType{unwrap(){return this._def.type}_parse(Ai){const{ctx:bo}=this._processInputParams(Ai);if(bo.parsedType!==ZodParsedType.promise&&bo.common.async===!1)return addIssueToContext(bo,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.promise,received:bo.parsedType}),INVALID;const Ra=bo.parsedType===ZodParsedType.promise?bo.data:Promise.resolve(bo.data);return OK(Ra.then(pc=>this._def.type.parseAsync(pc,{path:bo.path,errorMap:bo.common.contextualErrorMap})))}}ZodPromise.create=(vo,Ai)=>new ZodPromise({type:vo,typeName:ZodFirstPartyTypeKind.ZodPromise,...processCreateParams(Ai)});class ZodEffects extends ZodType{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ZodFirstPartyTypeKind.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(Ai){const{status:bo,ctx:Ra}=this._processInputParams(Ai),pc=this._def.effect||null,mc={addIssue:uf=>{addIssueToContext(Ra,uf),uf.fatal?bo.abort():bo.dirty()},get path(){return Ra.path}};if(mc.addIssue=mc.addIssue.bind(mc),pc.type==="preprocess"){const uf=pc.transform(Ra.data,mc);if(Ra.common.async)return Promise.resolve(uf).then(async df=>{if(bo.value==="aborted")return INVALID;const ff=await this._def.schema._parseAsync({data:df,path:Ra.path,parent:Ra});return ff.status==="aborted"?INVALID:ff.status==="dirty"||bo.value==="dirty"?DIRTY(ff.value):ff});{if(bo.value==="aborted")return INVALID;const df=this._def.schema._parseSync({data:uf,path:Ra.path,parent:Ra});return df.status==="aborted"?INVALID:df.status==="dirty"||bo.value==="dirty"?DIRTY(df.value):df}}if(pc.type==="refinement"){const uf=df=>{const ff=pc.refinement(df,mc);if(Ra.common.async)return Promise.resolve(ff);if(ff instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return df};if(Ra.common.async===!1){const df=this._def.schema._parseSync({data:Ra.data,path:Ra.path,parent:Ra});return df.status==="aborted"?INVALID:(df.status==="dirty"&&bo.dirty(),uf(df.value),{status:bo.value,value:df.value})}else return this._def.schema._parseAsync({data:Ra.data,path:Ra.path,parent:Ra}).then(df=>df.status==="aborted"?INVALID:(df.status==="dirty"&&bo.dirty(),uf(df.value).then(()=>({status:bo.value,value:df.value}))))}if(pc.type==="transform")if(Ra.common.async===!1){const uf=this._def.schema._parseSync({data:Ra.data,path:Ra.path,parent:Ra});if(!isValid(uf))return uf;const df=pc.transform(uf.value,mc);if(df instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:bo.value,value:df}}else return this._def.schema._parseAsync({data:Ra.data,path:Ra.path,parent:Ra}).then(uf=>isValid(uf)?Promise.resolve(pc.transform(uf.value,mc)).then(df=>({status:bo.value,value:df})):uf);util.assertNever(pc)}}ZodEffects.create=(vo,Ai,bo)=>new ZodEffects({schema:vo,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:Ai,...processCreateParams(bo)});ZodEffects.createWithPreprocess=(vo,Ai,bo)=>new ZodEffects({schema:Ai,effect:{type:"preprocess",transform:vo},typeName:ZodFirstPartyTypeKind.ZodEffects,...processCreateParams(bo)});class ZodOptional extends ZodType{_parse(Ai){return this._getType(Ai)===ZodParsedType.undefined?OK(void 0):this._def.innerType._parse(Ai)}unwrap(){return this._def.innerType}}ZodOptional.create=(vo,Ai)=>new ZodOptional({innerType:vo,typeName:ZodFirstPartyTypeKind.ZodOptional,...processCreateParams(Ai)});class ZodNullable extends ZodType{_parse(Ai){return this._getType(Ai)===ZodParsedType.null?OK(null):this._def.innerType._parse(Ai)}unwrap(){return this._def.innerType}}ZodNullable.create=(vo,Ai)=>new ZodNullable({innerType:vo,typeName:ZodFirstPartyTypeKind.ZodNullable,...processCreateParams(Ai)});class ZodDefault extends ZodType{_parse(Ai){const{ctx:bo}=this._processInputParams(Ai);let Ra=bo.data;return bo.parsedType===ZodParsedType.undefined&&(Ra=this._def.defaultValue()),this._def.innerType._parse({data:Ra,path:bo.path,parent:bo})}removeDefault(){return this._def.innerType}}ZodDefault.create=(vo,Ai)=>new ZodDefault({innerType:vo,typeName:ZodFirstPartyTypeKind.ZodDefault,defaultValue:typeof Ai.default=="function"?Ai.default:()=>Ai.default,...processCreateParams(Ai)});class ZodCatch extends ZodType{_parse(Ai){const{ctx:bo}=this._processInputParams(Ai),Ra={...bo,common:{...bo.common,issues:[]}},pc=this._def.innerType._parse({data:Ra.data,path:Ra.path,parent:{...Ra}});return isAsync(pc)?pc.then(mc=>({status:"valid",value:mc.status==="valid"?mc.value:this._def.catchValue({get error(){return new ZodError(Ra.common.issues)},input:Ra.data})})):{status:"valid",value:pc.status==="valid"?pc.value:this._def.catchValue({get error(){return new ZodError(Ra.common.issues)},input:Ra.data})}}removeCatch(){return this._def.innerType}}ZodCatch.create=(vo,Ai)=>new ZodCatch({innerType:vo,typeName:ZodFirstPartyTypeKind.ZodCatch,catchValue:typeof Ai.catch=="function"?Ai.catch:()=>Ai.catch,...processCreateParams(Ai)});class ZodNaN extends ZodType{_parse(Ai){if(this._getType(Ai)!==ZodParsedType.nan){const Ra=this._getOrReturnCtx(Ai);return addIssueToContext(Ra,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.nan,received:Ra.parsedType}),INVALID}return{status:"valid",value:Ai.data}}}ZodNaN.create=vo=>new ZodNaN({typeName:ZodFirstPartyTypeKind.ZodNaN,...processCreateParams(vo)});const BRAND=Symbol("zod_brand");class ZodBranded extends ZodType{_parse(Ai){const{ctx:bo}=this._processInputParams(Ai),Ra=bo.data;return this._def.type._parse({data:Ra,path:bo.path,parent:bo})}unwrap(){return this._def.type}}class ZodPipeline extends ZodType{_parse(Ai){const{status:bo,ctx:Ra}=this._processInputParams(Ai);if(Ra.common.async)return(async()=>{const mc=await this._def.in._parseAsync({data:Ra.data,path:Ra.path,parent:Ra});return mc.status==="aborted"?INVALID:mc.status==="dirty"?(bo.dirty(),DIRTY(mc.value)):this._def.out._parseAsync({data:mc.value,path:Ra.path,parent:Ra})})();{const pc=this._def.in._parseSync({data:Ra.data,path:Ra.path,parent:Ra});return pc.status==="aborted"?INVALID:pc.status==="dirty"?(bo.dirty(),{status:"dirty",value:pc.value}):this._def.out._parseSync({data:pc.value,path:Ra.path,parent:Ra})}}static create(Ai,bo){return new ZodPipeline({in:Ai,out:bo,typeName:ZodFirstPartyTypeKind.ZodPipeline})}}class ZodReadonly extends ZodType{_parse(Ai){const bo=this._def.innerType._parse(Ai),Ra=pc=>(isValid(pc)&&(pc.value=Object.freeze(pc.value)),pc);return isAsync(bo)?bo.then(pc=>Ra(pc)):Ra(bo)}unwrap(){return this._def.innerType}}ZodReadonly.create=(vo,Ai)=>new ZodReadonly({innerType:vo,typeName:ZodFirstPartyTypeKind.ZodReadonly,...processCreateParams(Ai)});function custom(vo,Ai={},bo){return vo?ZodAny.create().superRefine((Ra,pc)=>{var mc,uf;if(!vo(Ra)){const df=typeof Ai=="function"?Ai(Ra):typeof Ai=="string"?{message:Ai}:Ai,ff=(uf=(mc=df.fatal)!==null&&mc!==void 0?mc:bo)!==null&&uf!==void 0?uf:!0,hf=typeof df=="string"?{message:df}:df;pc.addIssue({code:"custom",...hf,fatal:ff})}}):ZodAny.create()}const late={object:ZodObject.lazycreate};var ZodFirstPartyTypeKind;(function(vo){vo.ZodString="ZodString",vo.ZodNumber="ZodNumber",vo.ZodNaN="ZodNaN",vo.ZodBigInt="ZodBigInt",vo.ZodBoolean="ZodBoolean",vo.ZodDate="ZodDate",vo.ZodSymbol="ZodSymbol",vo.ZodUndefined="ZodUndefined",vo.ZodNull="ZodNull",vo.ZodAny="ZodAny",vo.ZodUnknown="ZodUnknown",vo.ZodNever="ZodNever",vo.ZodVoid="ZodVoid",vo.ZodArray="ZodArray",vo.ZodObject="ZodObject",vo.ZodUnion="ZodUnion",vo.ZodDiscriminatedUnion="ZodDiscriminatedUnion",vo.ZodIntersection="ZodIntersection",vo.ZodTuple="ZodTuple",vo.ZodRecord="ZodRecord",vo.ZodMap="ZodMap",vo.ZodSet="ZodSet",vo.ZodFunction="ZodFunction",vo.ZodLazy="ZodLazy",vo.ZodLiteral="ZodLiteral",vo.ZodEnum="ZodEnum",vo.ZodEffects="ZodEffects",vo.ZodNativeEnum="ZodNativeEnum",vo.ZodOptional="ZodOptional",vo.ZodNullable="ZodNullable",vo.ZodDefault="ZodDefault",vo.ZodCatch="ZodCatch",vo.ZodPromise="ZodPromise",vo.ZodBranded="ZodBranded",vo.ZodPipeline="ZodPipeline",vo.ZodReadonly="ZodReadonly"})(ZodFirstPartyTypeKind||(ZodFirstPartyTypeKind={}));const instanceOfType=(vo,Ai={message:`Input not instance of ${vo.name}`})=>custom(bo=>bo instanceof vo,Ai),stringType=ZodString.create,numberType=ZodNumber.create,nanType=ZodNaN.create,bigIntType=ZodBigInt.create,booleanType=ZodBoolean.create,dateType=ZodDate.create,symbolType=ZodSymbol.create,undefinedType=ZodUndefined.create,nullType=ZodNull.create,anyType=ZodAny.create,unknownType=ZodUnknown.create,neverType=ZodNever.create,voidType=ZodVoid.create,arrayType=ZodArray.create,objectType=ZodObject.create,strictObjectType=ZodObject.strictCreate,unionType=ZodUnion.create,discriminatedUnionType=ZodDiscriminatedUnion.create,intersectionType=ZodIntersection.create,tupleType=ZodTuple.create,recordType=ZodRecord.create,mapType=ZodMap.create,setType=ZodSet.create,functionType=ZodFunction.create,lazyType=ZodLazy.create,literalType=ZodLiteral.create,enumType=ZodEnum.create,nativeEnumType=ZodNativeEnum.create,promiseType=ZodPromise.create,effectsType=ZodEffects.create,optionalType=ZodOptional.create,nullableType=ZodNullable.create,preprocessType=ZodEffects.createWithPreprocess,pipelineType=ZodPipeline.create,ostring=()=>stringType().optional(),onumber=()=>numberType().optional(),oboolean=()=>booleanType().optional(),coerce={string:vo=>ZodString.create({...vo,coerce:!0}),number:vo=>ZodNumber.create({...vo,coerce:!0}),boolean:vo=>ZodBoolean.create({...vo,coerce:!0}),bigint:vo=>ZodBigInt.create({...vo,coerce:!0}),date:vo=>ZodDate.create({...vo,coerce:!0})},NEVER=INVALID;var z$4=Object.freeze({__proto__:null,defaultErrorMap:errorMap,setErrorMap,getErrorMap,makeIssue,EMPTY_PATH,addIssueToContext,ParseStatus,INVALID,DIRTY,OK,isAborted,isDirty,isValid,isAsync,get util(){return util},get objectUtil(){return objectUtil},ZodParsedType,getParsedType,ZodType,datetimeRegex,ZodString,ZodNumber,ZodBigInt,ZodBoolean,ZodDate,ZodSymbol,ZodUndefined,ZodNull,ZodAny,ZodUnknown,ZodNever,ZodVoid,ZodArray,ZodObject,ZodUnion,ZodDiscriminatedUnion,ZodIntersection,ZodTuple,ZodRecord,ZodMap,ZodSet,ZodFunction,ZodLazy,ZodLiteral,ZodEnum,ZodNativeEnum,ZodPromise,ZodEffects,ZodTransformer:ZodEffects,ZodOptional,ZodNullable,ZodDefault,ZodCatch,ZodNaN,BRAND,ZodBranded,ZodPipeline,ZodReadonly,custom,Schema:ZodType,ZodSchema:ZodType,late,get ZodFirstPartyTypeKind(){return ZodFirstPartyTypeKind},coerce,any:anyType,array:arrayType,bigint:bigIntType,boolean:booleanType,date:dateType,discriminatedUnion:discriminatedUnionType,effect:effectsType,enum:enumType,function:functionType,instanceof:instanceOfType,intersection:intersectionType,lazy:lazyType,literal:literalType,map:mapType,nan:nanType,nativeEnum:nativeEnumType,never:neverType,null:nullType,nullable:nullableType,number:numberType,object:objectType,oboolean,onumber,optional:optionalType,ostring,pipeline:pipelineType,preprocess:preprocessType,promise:promiseType,record:recordType,set:setType,strictObject:strictObjectType,string:stringType,symbol:symbolType,transformer:effectsType,tuple:tupleType,undefined:undefinedType,union:unionType,unknown:unknownType,void:voidType,NEVER,ZodIssueCode,quotelessJson,ZodError});const type$c="number",typedef$b="scalar Amount_Tokens",schema$b=z$4.number(),stringSchema$b="z.number()",amountTokensValidation=vo=>{if(typeof vo!="number")throw new GraphQLError$1(`Value is not number: ${JSON.stringify(vo)}`);if(!Number.isFinite(vo))throw new GraphQLError$1(`Value is not a finite number: ${vo}`);const Ai=schema$b.safeParse(vo);if(Ai.success)return Ai.data;throw new GraphQLError$1(Ai.error.message)},config$c={name:"Amount_Tokens",description:"A custom scalar that represents an amount of tokens",serialize:amountTokensValidation,parseValue:amountTokensValidation,parseLiteral:vo=>{if(vo.kind!==Kind$1.FLOAT)throw new GraphQLError$1("some error message",{nodes:vo});const Ai=parseFloat(vo.value);return amountTokensValidation(Ai)}},scalar$b=new GraphQLScalarType$1(config$c),AmountTokens=Object.freeze(Object.defineProperty({__proto__:null,config:config$c,scalar:scalar$b,schema:schema$b,stringSchema:stringSchema$b,type:type$c,typedef:typedef$b},Symbol.toStringTag,{value:"Module"})),type$b="string",typedef$a="scalar EthereumAddress",schema$a=z$4.string().regex(/^0x[a-fA-F0-9]{40}$/,{message:"Invalid Ethereum address format"}),stringSchema$a="z.string().regex(/^0x[a-fA-F0-9]{40}$/, { message: 'Invalid Ethereum address format' })",addressValidation=vo=>{if(typeof vo!="string")throw new GraphQLError$1(`Value is not string: ${JSON.stringify(vo)}`);const Ai=schema$a.safeParse(vo);if(Ai.success)return Ai.data;throw new GraphQLError$1(Ai.error.message)},config$b={name:"EthereumAddress",description:'A custom scalar representing an Ethereum address, validated as a 42-character hexadecimal string prefixed with "0x"',serialize:addressValidation,parseValue:addressValidation,parseLiteral:vo=>{if(vo.kind!==Kind$1.STRING)throw new GraphQLError$1("some error message",{nodes:vo});return addressValidation(vo.value)}},scalar$a=new GraphQLScalarType$1(config$b),EthereumAddress=Object.freeze(Object.defineProperty({__proto__:null,config:config$b,scalar:scalar$a,schema:schema$a,stringSchema:stringSchema$a,type:type$b,typedef:typedef$a},Symbol.toStringTag,{value:"Module"})),type$a="number",typedef$9="scalar Amount_Percentage",schema$9=z$4.number(),stringSchema$9="z.number()",amountPercentageValidation=vo=>{if(typeof vo!="number")throw new GraphQLError$1(`Value is not number: ${JSON.stringify(vo)}`);if(!Number.isFinite(vo))throw new GraphQLError$1(`Value is not a finite number: ${vo}`);const Ai=schema$9.safeParse(vo);if(Ai.success)return Ai.data;throw new GraphQLError$1(Ai.error.message)},config$a={name:"Amount_Percentage",description:"",serialize:amountPercentageValidation,parseValue:amountPercentageValidation,parseLiteral:vo=>{if(vo.kind!==Kind$1.FLOAT)throw new GraphQLError$1("some error message",{nodes:vo});const Ai=parseFloat(vo.value);return amountPercentageValidation(Ai)}},scalar$9=new GraphQLScalarType$1(config$a),AmountPercentage=Object.freeze(Object.defineProperty({__proto__:null,config:config$a,scalar:scalar$9,schema:schema$9,stringSchema:stringSchema$9,type:type$a,typedef:typedef$9},Symbol.toStringTag,{value:"Module"})),type$9="string",typedef$8="scalar EmailAddress",schema$8=z$4.string().email(),stringSchema$8="z.string().email()",emailValidation=vo=>{if(typeof vo!="string")throw new GraphQLError$1(`Value is not string: ${JSON.stringify(vo)}`);const Ai=schema$8.safeParse(vo);if(Ai.success)return Ai.data;throw new GraphQLError$1(Ai.error.message)},config$9={name:"EmailAddress",description:"A field whose value conforms to the standard internet email address format as specified in RFC822: https://www.w3.org/Protocols/rfc822/.",serialize:emailValidation,parseValue:emailValidation,parseLiteral:vo=>{if(vo.kind!==Kind$1.STRING)throw new GraphQLError$1(`Can only validate strings as email addresses but got a: ${vo.kind}`,{nodes:vo});return emailValidation(vo.value)}},scalar$8=new GraphQLScalarType$1(config$9),EmailAddress=Object.freeze(Object.defineProperty({__proto__:null,config:config$9,scalar:scalar$8,schema:schema$8,stringSchema:stringSchema$8,type:type$9,typedef:typedef$8},Symbol.toStringTag,{value:"Module"})),type$8="string",typedef$7="scalar Date",schema$7=z$4.string().datetime(),stringSchema$7="z.string().datetime()",datetimeValidation$1=vo=>{if(typeof vo!="string")throw new GraphQLError$1(`Value is not iso string: ${JSON.stringify(vo)}`);const Ai=schema$7.safeParse(vo);if(Ai.success)return Ai.data;throw new GraphQLError$1(Ai.error.message)},config$8={name:"Date",description:"A custom scalar that represents a datetime in ISO 8601 format (Time: 00:00:00)",serialize:datetimeValidation$1,parseValue:datetimeValidation$1,parseLiteral:vo=>{if(vo.kind!==Kind$1.STRING)throw new GraphQLError$1("Value is not an string",{nodes:vo});return datetimeValidation$1(vo.value)}},scalar$7=new GraphQLScalarType$1(config$8),Date$1=Object.freeze(Object.defineProperty({__proto__:null,config:config$8,scalar:scalar$7,schema:schema$7,stringSchema:stringSchema$7,type:type$8,typedef:typedef$7},Symbol.toStringTag,{value:"Module"})),type$7="string",typedef$6="scalar DateTime",schema$6=z$4.string().datetime(),stringSchema$6="z.string().datetime()",datetimeValidation=vo=>{if(typeof vo!="string")throw new GraphQLError$1(`Value is not iso string: ${JSON.stringify(vo)}`);const Ai=schema$6.safeParse(vo);if(Ai.success)return Ai.data;throw new GraphQLError$1(Ai.error.message)},config$7={name:"DateTime",description:"A custom scalar that represents a datetime in ISO 8601 format",serialize:datetimeValidation,parseValue:datetimeValidation,parseLiteral:vo=>{if(vo.kind!==Kind$1.STRING)throw new GraphQLError$1("Value is not an string",{nodes:vo});return datetimeValidation(vo.value)}},scalar$6=new GraphQLScalarType$1(config$7),DateTime=Object.freeze(Object.defineProperty({__proto__:null,config:config$7,scalar:scalar$6,schema:schema$6,stringSchema:stringSchema$6,type:type$7,typedef:typedef$6},Symbol.toStringTag,{value:"Module"})),type$6="string",typedef$5="scalar URL",schema$5=z$4.string().url(),stringSchema$5="z.string().url()",urlValidation=vo=>{if(typeof vo!="string")throw new GraphQLError$1(`Value is not iso string: ${JSON.stringify(vo)}`);const Ai=schema$5.safeParse(vo);if(Ai.success)return Ai.data;throw new GraphQLError$1(Ai.error.message)},config$6={name:"URL",description:"A custom scalar that represents a URL string",serialize:urlValidation,parseValue:urlValidation,parseLiteral:vo=>{if(vo.kind!==Kind$1.STRING)throw new GraphQLError$1("Value is not an string",{nodes:vo});return urlValidation(vo.value)}},scalar$5=new GraphQLScalarType$1(config$6),URL$1=Object.freeze(Object.defineProperty({__proto__:null,config:config$6,scalar:scalar$5,schema:schema$5,stringSchema:stringSchema$5,type:type$6,typedef:typedef$5},Symbol.toStringTag,{value:"Module"})),type$5="number",typedef$4="scalar Amount_Money",schema$4=z$4.number(),stringSchema$4="z.number()",amountMoneyValidation=vo=>{if(typeof vo!="number")throw new GraphQLError$1(`Value is not number: ${JSON.stringify(vo)}`);if(!Number.isFinite(vo))throw new GraphQLError$1(`Value is not a finite number: ${vo}`);const Ai=schema$4.safeParse(vo);if(Ai.success)return Ai.data;throw new GraphQLError$1(Ai.error.message)},config$5={name:"Amount_Money",description:"A custom scalar that represents a monetary amount in a currency",serialize:amountMoneyValidation,parseValue:amountMoneyValidation,parseLiteral:vo=>{if(vo.kind!==Kind$1.FLOAT)throw new GraphQLError$1("Value is not a float type",{nodes:vo});const Ai=parseFloat(vo.value);return amountMoneyValidation(Ai)}},scalar$4=new GraphQLScalarType$1(config$5),AmountMoney=Object.freeze(Object.defineProperty({__proto__:null,config:config$5,scalar:scalar$4,schema:schema$4,stringSchema:stringSchema$4,type:type$5,typedef:typedef$4},Symbol.toStringTag,{value:"Module"})),type$4="string",typedef$3="scalar OLabel",schema$3=z$4.string(),stringSchema$3="z.string()",oLabelValidation=vo=>{if(typeof vo!="string")throw new GraphQLError$1(`Value is not string: ${JSON.stringify(vo)}`);const Ai=schema$3.safeParse(vo);if(Ai.success)return Ai.data;throw new GraphQLError$1(Ai.error.message)},config$4={name:"OLabel",description:"A custom scalar that represents a OLabel string",serialize:oLabelValidation,parseValue:oLabelValidation,parseLiteral:vo=>{if(vo.kind!==Kind$1.STRING)throw new GraphQLError$1(`Value is not a valid string: ${vo.kind}`,{nodes:vo});return oLabelValidation(vo.value)}},scalar$3=new GraphQLScalarType$1(config$4),OLabel=Object.freeze(Object.defineProperty({__proto__:null,config:config$4,scalar:scalar$3,schema:schema$3,stringSchema:stringSchema$3,type:type$4,typedef:typedef$3},Symbol.toStringTag,{value:"Module"})),type$3="string",typedef$2="scalar Currency",schema$2=z$4.string(),stringSchema$2="z.string()",currencyValidation=vo=>{if(typeof vo!="string")throw new GraphQLError$1(`Value is not string: ${JSON.stringify(vo)}`);const Ai=schema$2.safeParse(vo);if(Ai.success)return Ai.data;throw new GraphQLError$1(Ai.error.message)},config$3={name:"Currency",description:"A custom scalar that represents a Currency Code string",serialize:currencyValidation,parseValue:currencyValidation,parseLiteral:vo=>{if(vo.kind!==Kind$1.STRING)throw new GraphQLError$1(`Value is not a valid string: ${vo.kind}`,{nodes:vo});return currencyValidation(vo.value)}},scalar$2=new GraphQLScalarType$1(config$3),Currency=Object.freeze(Object.defineProperty({__proto__:null,config:config$3,scalar:scalar$2,schema:schema$2,stringSchema:stringSchema$2,type:type$3,typedef:typedef$2},Symbol.toStringTag,{value:"Module"})),type$2="string",typedef$1="scalar PHID",schema$1=z$4.string(),stringSchema$1="z.string()",phidlValidation=vo=>{if(typeof vo!="string")throw new GraphQLError$1(`Value is not string: ${JSON.stringify(vo)}`);const Ai=schema$1.safeParse(vo);if(Ai.success)return Ai.data;throw new GraphQLError$1(Ai.error.message)},config$2={name:"PHID",description:"A custom scalar that represents a PowerhouseID string",serialize:phidlValidation,parseValue:phidlValidation,parseLiteral:vo=>{if(vo.kind!==Kind$1.STRING)throw new GraphQLError$1(`Value is not a valid string: ${vo.kind}`,{nodes:vo});return phidlValidation(vo.value)}},scalar$1=new GraphQLScalarType$1(config$2),PHID=Object.freeze(Object.defineProperty({__proto__:null,config:config$2,scalar:scalar$1,schema:schema$1,stringSchema:stringSchema$1,type:type$2,typedef:typedef$1},Symbol.toStringTag,{value:"Module"})),type$1="string",typedef="scalar OID",schema=z$4.string(),stringSchema="z.string()",oIdValidation=vo=>{if(typeof vo!="string")throw new GraphQLError$1(`Value is not string: ${JSON.stringify(vo)}`);const Ai=schema.safeParse(vo);if(Ai.success)return Ai.data;throw new GraphQLError$1(Ai.error.message)},config$1={name:"OID",description:"A custom scalar that represents a OID string",serialize:oIdValidation,parseValue:oIdValidation,parseLiteral:vo=>{if(vo.kind!==Kind$1.STRING)throw new GraphQLError$1(`Value is not a valid string: ${vo.kind}`,{nodes:vo});return oIdValidation(vo.value)}},scalar=new GraphQLScalarType$1(config$1),OID=Object.freeze(Object.defineProperty({__proto__:null,config:config$1,scalar,schema,stringSchema,type:type$1,typedef},Symbol.toStringTag,{value:"Module"})),resolvers={AmountTokens:scalar$b,EthereumAddress:scalar$a,AmountPercentage:scalar$9,EmailAddress:scalar$8,Date:scalar$7,DateTime:scalar$6,URL:scalar$5,AmountMoney:scalar$4,OLabel:scalar$3,Currency:scalar$2,PHID:scalar$1,OID:scalar},typeDefs=[typedef$b,typedef$a,typedef$9,typedef$8,typedef$7,typedef$6,typedef$5,typedef$4,typedef$3,typedef$2,typedef$1,typedef],generatorTypeDefs={[config$c.name]:type$c,[config$b.name]:type$b,[config$9.name]:type$9,[config$a.name]:type$a,[config$8.name]:type$8,[config$7.name]:type$7,[config$6.name]:type$6,[config$5.name]:type$5,[config$4.name]:type$4,[config$3.name]:type$3,[config$2.name]:type$2,[config$1.name]:type$1},validationSchema={[config$c.name]:stringSchema$b,[config$b.name]:stringSchema$a,[config$9.name]:stringSchema$8,[config$a.name]:stringSchema$9,[config$8.name]:stringSchema$7,[config$7.name]:stringSchema$6,[config$6.name]:stringSchema$5,[config$5.name]:stringSchema$4,[config$4.name]:stringSchema$3,[config$3.name]:stringSchema$2,[config$2.name]:stringSchema$1,[config$1.name]:stringSchema},customScalars=Object.freeze(Object.defineProperty({__proto__:null,AmountMoney,AmountPercentage,AmountTokens,Currency,DateScalar:Date$1,DateTime,EmailAddress,EthereumAddress,OID,OLabel,PHID,URLScalar:URL$1,generatorTypeDefs,resolvers,typeDefs,validationSchema},Symbol.toStringTag,{value:"Module"}));var define_process_env_default={};function DocumentEditor(vo){const Ai=["document-editor",`${vo.mode}-mode`];return jsx("div",{className:Ai.join(" "),children:vo.children})}function EditorToolbar(vo){const Ai=vo.left||[],bo=vo.center||[],Ra=vo.right||[];return jsxs("div",{className:"editor-toolbar",children:[jsx("div",{className:"editor-toolbar--column editor-toolbar--left",children:Ai}),jsx("div",{className:"editor-toolbar--column editor-toolbar--center",children:bo}),jsx("div",{className:"editor-toolbar--column editor-toolbar--right",children:Ra})]})}function EditorWorksheet(vo){return jsx("div",{className:"editor-worksheet",children:jsx("div",{className:"editor-worksheet--page",children:vo.children})})}const colorScheme$1={light:{color:"#222222",bgColor:"#FFFFFF",border:"#EEEEEE",shadow:"rgba(128,128,128,0.65)",inputColor:"#222222",inputBg:"#F6F6F6"},dark:{color:"#E6E6E6",bgColor:"#181818",border:"#181818",shadow:"rgba(0, 0, 0, 0.25)",inputColor:"#E6E6E6",inputBg:"#222222"}},typographySizes$1={huge:{fontSize:"36pt",fontWeight:"bold",padding:"6pt",margin:"30pt 0 0 0"},larger:{fontSize:"24pt",fontWeight:"bold",padding:"6pt",margin:"18pt 0 0 0"},large:{fontSize:"18pt",fontWeight:"bold",padding:"6pt",margin:"12pt 0 0 0"},medium:{fontSize:"11pt",fontWeight:"bold",padding:"6pt",margin:"5pt 0 0 0"},small:{fontSize:"10pt",fontWeight:"normal",padding:"6pt",margin:"0"},smaller:{fontSize:"9pt",fontWeight:"normal",padding:"6pt",margin:"0"},tiny:{fontSize:"8pt",fontWeight:"normal",padding:"6pt",margin:"0"}},inputStyle$1=(vo="light",Ai=!1)=>{const bo=colorScheme$1[vo];return{width:"100%",border:"none",boxSizing:"border-box",backgroundColor:Ai?bo.inputBg:bo.bgColor,outline:"none",color:bo.inputColor,resize:"none",fontFamily:"Roboto, sans-serif",overflow:"hidden",lineHeight:"1.5"}},colorScheme={light:{color:"#222222",bgColor:"#FFFFFF",border:"#EEEEEE",shadow:"rgba(128,128,128,0.65)",inputColor:"#222222",inputBg:"#F6F6F6"},dark:{color:"#CCCCCC",bgColor:"#0A0A0A",border:"#181818",shadow:"rgba(255, 255, 255, 0.25)",inputColor:"#CCCCCC",inputBg:"#1A1D1F"}},typographySizes={chapter:{fontSize:"64pt",fontWeight:"bold",padding:"6pt 24pt",margin:"0",lineHeight:1,textAlign:"right",borderLeft:"4px solid"},huge:{fontSize:"32pt",fontWeight:"normal",padding:"6pt",margin:"0 0 0 -6pt",lineHeight:1},larger:{fontSize:"24pt",fontWeight:"bold",padding:"6pt",margin:"-12pt 0 0 0"},large:{fontSize:"18pt",fontWeight:"bold",padding:"6pt",margin:"-10.5pt 0 0 0"},medium:{fontSize:"11pt",fontWeight:"bold",padding:"6pt",margin:"-8pt 0 0 0"},small:{fontSize:"10pt",fontWeight:"normal",padding:"6pt",margin:"-6pt 0 0 0"},smaller:{fontSize:"9pt",fontWeight:"normal",padding:"6pt",margin:"-5pt 0 0 0"},tiny:{fontSize:"8pt",fontWeight:"normal",padding:"6pt",margin:"-8pt 0 0 0"}},inputStyle=(vo="light",Ai=!1)=>{const bo=colorScheme[vo];return{width:"100%",border:"none",boxSizing:"border-box",backgroundColor:Ai?bo.inputBg:bo.bgColor,outline:"none",color:bo.inputColor,resize:"none",fontFamily:"Roboto, sans-serif",overflow:"hidden",lineHeight:"1.5"}};function TextInput(vo){const[Ai,bo]=useState({value:vo.value||"",hasFocus:!1,pressingEnter:!1});useEffect(()=>{bo(hf=>hf.value!==vo.value?{...hf,value:vo.value||""}:hf)},[vo.value]);const Ra=hf=>{hf.key==="Enter"&&(bo({...Ai,pressingEnter:!0}),hf.preventDefault())},pc=hf=>{hf.key==="Enter"&&(hf.target&&vo.onSubmit&&vo.onSubmit(hf.target.value),vo.clearOnSubmit?bo({...Ai,value:"",pressingEnter:!1}):bo({...Ai,pressingEnter:!1}),hf.preventDefault()),(hf.key==="Backspace"||hf.key==="Delete")&&(vo.onEmpty&&hf.target.value.length<1&&vo.onEmpty(vo.id||""),hf.preventDefault())},mc=hf=>{if(!Ai.pressingEnter){const pf=hf.target;bo({...Ai,value:pf.value}),pf.style.height="1px",pf.style.height=pf.scrollHeight+"px"}},uf=hf=>{var pf;if(bo(mf=>({...mf,hasFocus:hf})),!hf){const mf=((pf=df.current)==null?void 0:pf.value)||"",gf=vo.value||"";mf!=gf&&vo.onSubmit&&(vo.onSubmit(mf),vo.clearOnSubmit&&bo(yf=>({...yf,value:""})))}},df=useRef(null);useEffect(()=>{const hf=()=>{df.current&&(df.current.style.height="1px",df.current.style.height=df.current.scrollHeight+"px")};return window.addEventListener("resize",hf),hf(),()=>{window.removeEventListener("resize",hf)}});const ff={...inputStyle$1(vo.theme,Ai.hasFocus),...typographySizes$1[vo.size||"small"]};return jsxs("div",{children:[vo.horizontalLine?jsx("hr",{style:{borderColor:inputStyle$1(vo.theme,!1).backgroundColor}},"line"):"",jsx("textarea",{autoFocus:vo.autoFocus||!1,onBlur:hf=>uf(!1),onFocus:hf=>uf(!0),onInput:mc,onKeyDown:Ra,onKeyUp:pc,placeholder:vo.placeholder||"",ref:df,style:ff,value:Ai.value},"text")]})}function TextInputVariant(vo){const[Ai,bo]=useState({value:vo.value||"",hasFocus:!1,pressingEnter:!1});useEffect(()=>{bo({...Ai,value:vo.value||""})},[vo.value]);const Ra=hf=>{hf.key==="Enter"&&(bo({...Ai,pressingEnter:!0}),hf.preventDefault())},pc=hf=>{hf.key==="Enter"&&(hf.target&&vo.onSubmit&&vo.onSubmit(hf.target.value),vo.clearOnSubmit?bo({...Ai,value:"",pressingEnter:!1}):bo({...Ai,pressingEnter:!1}),hf.preventDefault()),(hf.key==="Backspace"||hf.key==="Delete")&&(vo.onEmpty&&hf.target.value.length<1&&vo.onEmpty(vo.id||""),hf.preventDefault())},mc=hf=>{if(!Ai.pressingEnter){const pf=hf.target;bo({...Ai,value:pf.value}),pf.style.height="1px",pf.style.height=pf.scrollHeight+"px"}},uf=hf=>{var pf;if(bo({...Ai,hasFocus:hf}),!hf){const mf=((pf=df.current)==null?void 0:pf.value)||"",gf=vo.value||"";mf!=gf&&vo.onSubmit&&vo.onSubmit(mf)}},df=useRef(null);useEffect(()=>{const hf=()=>{df.current&&(df.current.style.height="1px",df.current.style.height=df.current.scrollHeight+"px")};return window.addEventListener("resize",hf),hf(),()=>{window.removeEventListener("resize",hf)}});const ff={...inputStyle(vo.theme,Ai.hasFocus),...typographySizes[vo.size||"small"]};return vo.labelStyle&&(ff.textAlign="center",ff.textTransform="uppercase",ff.backgroundColor="rgba(0, 0, 255, 0.05)",ff.borderRadius="8px",ff.padding="1px 0 4px 0",ff.margin="0",ff.fontWeight="bold",ff.fontSize="8pt",ff.color="#518EBE",ff.border="2px solid #518EBE",ff.cursor="pointer",ff.lineHeight="1.5"),jsxs("div",{children:[vo.horizontalLine?jsx("hr",{style:{borderColor:inputStyle(vo.theme,!1).backgroundColor}},"line"):"",jsx("textarea",{autoFocus:vo.autoFocus||!1,onBlur:hf=>uf(!1),onFocus:hf=>uf(!0),onInput:mc,onKeyDown:Ra,onKeyUp:pc,placeholder:vo.placeholder||"",ref:df,spellCheck:Ai.hasFocus,style:ff,tabIndex:vo.labelStyle?-1:1,value:Ai.value},"text")]})}function ToolbarButton(vo){const Ai=vo.onClick||(()=>{console.log("No onClick handler attached to button.")});return jsx("div",{className:"toolbar-button",onClick:Ai,style:{userSelect:"none"},children:vo.children})}var u$2=Object.defineProperty,a$1=(vo,Ai)=>u$2(vo,"name",{value:Ai,configurable:!0}),y$1=(()=>{let vo;return typeof window<"u"?vo=window:typeof globalThis<"u"?vo=globalThis:typeof global<"u"?vo=global:typeof self<"u"?vo=self:vo={},vo})(),{LOGLEVEL:b$3}=y$1,t$5={trace:1,debug:2,info:3,warn:4,error:5,silent:10},L$3=b$3,i$4=t$5[L$3]||t$5.info,s$3={trace:a$1((vo,...Ai)=>{i$4<=t$5.trace&&console.trace(vo,...Ai)},"trace"),debug:a$1((vo,...Ai)=>{i$4<=t$5.debug&&console.debug(vo,...Ai)},"debug"),info:a$1((vo,...Ai)=>{i$4<=t$5.info&&console.info(vo,...Ai)},"info"),warn:a$1((vo,...Ai)=>{i$4<=t$5.warn&&console.warn(vo,...Ai)},"warn"),error:a$1((vo,...Ai)=>{i$4<=t$5.error&&console.error(vo,...Ai)},"error"),log:a$1((vo,...Ai)=>{i$4<t$5.silent&&console.log(vo,...Ai)},"log")},c$1=new Set,n$2=a$1(vo=>(Ai,...bo)=>{if(!c$1.has(Ai))return c$1.add(Ai),s$3[vo](Ai,...bo)},"once");n$2.clear=()=>c$1.clear();n$2.trace=n$2("trace");n$2.debug=n$2("debug");n$2.info=n$2("info");n$2.warn=n$2("warn");n$2.error=n$2("error");n$2.log=n$2("log");var m$2=n$2("warn"),r$3=a$1(vo=>(...Ai)=>{let bo=[];if(Ai.length){let Ra=/<span\s+style=(['"])([^'"]*)\1\s*>/gi,pc=/<\/span>/gi,mc;for(bo.push(Ai[0].replace(Ra,"%c").replace(pc,"%c"));mc=Ra.exec(Ai[0]);)bo.push(mc[2]),bo.push("");for(let uf=1;uf<Ai.length;uf++)bo.push(Ai[uf])}s$3[vo].apply(s$3,bo)},"pretty");r$3.trace=r$3("trace");r$3.debug=r$3("debug");r$3.info=r$3("info");r$3.warn=r$3("warn");r$3.error=r$3("error");var _$1=(vo=>(vo.CHANNEL_WS_DISCONNECT="channelWSDisconnect",vo.CHANNEL_CREATED="channelCreated",vo.CONFIG_ERROR="configError",vo.STORY_INDEX_INVALIDATED="storyIndexInvalidated",vo.STORY_SPECIFIED="storySpecified",vo.SET_CONFIG="setConfig",vo.SET_STORIES="setStories",vo.SET_INDEX="setIndex",vo.SET_CURRENT_STORY="setCurrentStory",vo.CURRENT_STORY_WAS_SET="currentStoryWasSet",vo.FORCE_RE_RENDER="forceReRender",vo.FORCE_REMOUNT="forceRemount",vo.PRELOAD_ENTRIES="preloadStories",vo.STORY_PREPARED="storyPrepared",vo.DOCS_PREPARED="docsPrepared",vo.STORY_CHANGED="storyChanged",vo.STORY_UNCHANGED="storyUnchanged",vo.STORY_RENDERED="storyRendered",vo.STORY_MISSING="storyMissing",vo.STORY_ERRORED="storyErrored",vo.STORY_THREW_EXCEPTION="storyThrewException",vo.STORY_RENDER_PHASE_CHANGED="storyRenderPhaseChanged",vo.PLAY_FUNCTION_THREW_EXCEPTION="playFunctionThrewException",vo.UNHANDLED_ERRORS_WHILE_PLAYING="unhandledErrorsWhilePlaying",vo.UPDATE_STORY_ARGS="updateStoryArgs",vo.STORY_ARGS_UPDATED="storyArgsUpdated",vo.RESET_STORY_ARGS="resetStoryArgs",vo.SET_FILTER="setFilter",vo.SET_GLOBALS="setGlobals",vo.UPDATE_GLOBALS="updateGlobals",vo.GLOBALS_UPDATED="globalsUpdated",vo.REGISTER_SUBSCRIPTION="registerSubscription",vo.PREVIEW_KEYDOWN="previewKeydown",vo.PREVIEW_BUILDER_PROGRESS="preview_builder_progress",vo.SELECT_STORY="selectStory",vo.STORIES_COLLAPSE_ALL="storiesCollapseAll",vo.STORIES_EXPAND_ALL="storiesExpandAll",vo.DOCS_RENDERED="docsRendered",vo.SHARED_STATE_CHANGED="sharedStateChanged",vo.SHARED_STATE_SET="sharedStateSet",vo.NAVIGATE_URL="navigateUrl",vo.UPDATE_QUERY_PARAMS="updateQueryParams",vo.REQUEST_WHATS_NEW_DATA="requestWhatsNewData",vo.RESULT_WHATS_NEW_DATA="resultWhatsNewData",vo.SET_WHATS_NEW_CACHE="setWhatsNewCache",vo.TOGGLE_WHATS_NEW_NOTIFICATIONS="toggleWhatsNewNotifications",vo.TELEMETRY_ERROR="telemetryError",vo.FILE_COMPONENT_SEARCH_REQUEST="fileComponentSearchRequest",vo.FILE_COMPONENT_SEARCH_RESPONSE="fileComponentSearchResponse",vo.SAVE_STORY_REQUEST="saveStoryRequest",vo.SAVE_STORY_RESPONSE="saveStoryResponse",vo.ARGTYPES_INFO_REQUEST="argtypesInfoRequest",vo.ARGTYPES_INFO_RESPONSE="argtypesInfoResponse",vo.CREATE_NEW_STORYFILE_REQUEST="createNewStoryfileRequest",vo.CREATE_NEW_STORYFILE_RESPONSE="createNewStoryfileResponse",vo.TESTING_MODULE_CRASH_REPORT="testingModuleCrashReport",vo.TESTING_MODULE_PROGRESS_REPORT="testingModuleProgressReport",vo.TESTING_MODULE_RUN_REQUEST="testingModuleRunRequest",vo.TESTING_MODULE_RUN_ALL_REQUEST="testingModuleRunAllRequest",vo.TESTING_MODULE_CANCEL_TEST_RUN_REQUEST="testingModuleCancelTestRunRequest",vo.TESTING_MODULE_CANCEL_TEST_RUN_RESPONSE="testingModuleCancelTestRunResponse",vo.TESTING_MODULE_WATCH_MODE_REQUEST="testingModuleWatchModeRequest",vo))(_$1||{}),R$2=_$1,{CHANNEL_WS_DISCONNECT:S$2,CHANNEL_CREATED:T$1,CONFIG_ERROR:N$2,CREATE_NEW_STORYFILE_REQUEST:O$3,CREATE_NEW_STORYFILE_RESPONSE:A$1,CURRENT_STORY_WAS_SET:r$2,DOCS_PREPARED:D$3,DOCS_RENDERED:I$2,FILE_COMPONENT_SEARCH_REQUEST:C$3,FILE_COMPONENT_SEARCH_RESPONSE:o$2,FORCE_RE_RENDER:L$2,FORCE_REMOUNT:P$3,GLOBALS_UPDATED:U$3,NAVIGATE_URL:G$3,PLAY_FUNCTION_THREW_EXCEPTION:a,UNHANDLED_ERRORS_WHILE_PLAYING:Y$2,PRELOAD_ENTRIES:t$4,PREVIEW_BUILDER_PROGRESS:e$1,PREVIEW_KEYDOWN:W$2,REGISTER_SUBSCRIPTION:d,RESET_STORY_ARGS:H$2,SELECT_STORY:l$1,SET_CONFIG:i$3,SET_CURRENT_STORY:p$2,SET_FILTER:M$4,SET_GLOBALS:u$1,SET_INDEX:F$3,SET_STORIES:s$2,SHARED_STATE_CHANGED:c,SHARED_STATE_SET:g,STORIES_COLLAPSE_ALL:y,STORIES_EXPAND_ALL:h$1,STORY_ARGS_UPDATED:Q,STORY_CHANGED:f$2,STORY_ERRORED:x$3,STORY_INDEX_INVALIDATED:m$1$1,STORY_MISSING:V$1,STORY_PREPARED:w$2,STORY_RENDER_PHASE_CHANGED:B$2,STORY_RENDERED:X$2,STORY_SPECIFIED:q$3,STORY_THREW_EXCEPTION:b$2,STORY_UNCHANGED:K$2,UPDATE_GLOBALS:j,UPDATE_QUERY_PARAMS:k$4,UPDATE_STORY_ARGS:n$1,REQUEST_WHATS_NEW_DATA:z$3,RESULT_WHATS_NEW_DATA:J$2,SET_WHATS_NEW_CACHE:Z,TOGGLE_WHATS_NEW_NOTIFICATIONS:$$3,TELEMETRY_ERROR:v$3,SAVE_STORY_REQUEST:EE,SAVE_STORY_RESPONSE:_E,ARGTYPES_INFO_REQUEST:RE,ARGTYPES_INFO_RESPONSE:SE,TESTING_MODULE_CRASH_REPORT:TE,TESTING_MODULE_PROGRESS_REPORT:NE,TESTING_MODULE_RUN_REQUEST:OE,TESTING_MODULE_RUN_ALL_REQUEST:AE,TESTING_MODULE_CANCEL_TEST_RUN_REQUEST:rE,TESTING_MODULE_CANCEL_TEST_RUN_RESPONSE:DE,TESTING_MODULE_WATCH_MODE_REQUEST:IE}=_$1;const Qn$1=Object.freeze(Object.defineProperty({__proto__:null,ARGTYPES_INFO_REQUEST:RE,ARGTYPES_INFO_RESPONSE:SE,CHANNEL_CREATED:T$1,CHANNEL_WS_DISCONNECT:S$2,CONFIG_ERROR:N$2,CREATE_NEW_STORYFILE_REQUEST:O$3,CREATE_NEW_STORYFILE_RESPONSE:A$1,CURRENT_STORY_WAS_SET:r$2,DOCS_PREPARED:D$3,DOCS_RENDERED:I$2,FILE_COMPONENT_SEARCH_REQUEST:C$3,FILE_COMPONENT_SEARCH_RESPONSE:o$2,FORCE_REMOUNT:P$3,FORCE_RE_RENDER:L$2,GLOBALS_UPDATED:U$3,NAVIGATE_URL:G$3,PLAY_FUNCTION_THREW_EXCEPTION:a,PRELOAD_ENTRIES:t$4,PREVIEW_BUILDER_PROGRESS:e$1,PREVIEW_KEYDOWN:W$2,REGISTER_SUBSCRIPTION:d,REQUEST_WHATS_NEW_DATA:z$3,RESET_STORY_ARGS:H$2,RESULT_WHATS_NEW_DATA:J$2,SAVE_STORY_REQUEST:EE,SAVE_STORY_RESPONSE:_E,SELECT_STORY:l$1,SET_CONFIG:i$3,SET_CURRENT_STORY:p$2,SET_FILTER:M$4,SET_GLOBALS:u$1,SET_INDEX:F$3,SET_STORIES:s$2,SET_WHATS_NEW_CACHE:Z,SHARED_STATE_CHANGED:c,SHARED_STATE_SET:g,STORIES_COLLAPSE_ALL:y,STORIES_EXPAND_ALL:h$1,STORY_ARGS_UPDATED:Q,STORY_CHANGED:f$2,STORY_ERRORED:x$3,STORY_INDEX_INVALIDATED:m$1$1,STORY_MISSING:V$1,STORY_PREPARED:w$2,STORY_RENDERED:X$2,STORY_RENDER_PHASE_CHANGED:B$2,STORY_SPECIFIED:q$3,STORY_THREW_EXCEPTION:b$2,STORY_UNCHANGED:K$2,TELEMETRY_ERROR:v$3,TESTING_MODULE_CANCEL_TEST_RUN_REQUEST:rE,TESTING_MODULE_CANCEL_TEST_RUN_RESPONSE:DE,TESTING_MODULE_CRASH_REPORT:TE,TESTING_MODULE_PROGRESS_REPORT:NE,TESTING_MODULE_RUN_ALL_REQUEST:AE,TESTING_MODULE_RUN_REQUEST:OE,TESTING_MODULE_WATCH_MODE_REQUEST:IE,TOGGLE_WHATS_NEW_NOTIFICATIONS:$$3,UNHANDLED_ERRORS_WHILE_PLAYING:Y$2,UPDATE_GLOBALS:j,UPDATE_QUERY_PARAMS:k$4,UPDATE_STORY_ARGS:n$1,default:R$2},Symbol.toStringTag,{value:"Module"}));var Qt$1=Object.create,st$1=Object.defineProperty,te$1=Object.getOwnPropertyDescriptor,ee$1=Object.getOwnPropertyNames,re$1=Object.getPrototypeOf,ne$1=Object.prototype.hasOwnProperty,i$2=(vo,Ai)=>st$1(vo,"name",{value:Ai,configurable:!0}),U$2=(vo=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(vo,{get:(Ai,bo)=>(typeof require<"u"?require:Ai)[bo]}):vo)(function(vo){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+vo+'" is not supported')}),oe$2=(vo,Ai)=>()=>(Ai||vo((Ai={exports:{}}).exports,Ai),Ai.exports),ae=(vo,Ai,bo,Ra)=>{if(Ai&&typeof Ai=="object"||typeof Ai=="function")for(let pc of ee$1(Ai))!ne$1.call(vo,pc)&&pc!==bo&&st$1(vo,pc,{get:()=>Ai[pc],enumerable:!(Ra=te$1(Ai,pc))||Ra.enumerable});return vo},ie$2=(vo,Ai,bo)=>(bo=vo!=null?Qt$1(re$1(vo)):{},ae(st$1(bo,"default",{value:vo,enumerable:!0}),vo)),At$1=oe$2((vo,Ai)=>{(function(bo){if(typeof vo=="object"&&typeof Ai<"u")Ai.exports=bo();else if(typeof define=="function"&&define.amd)define([],bo);else{var Ra;typeof window<"u"?Ra=window:typeof global<"u"?Ra=global:typeof self<"u"?Ra=self:Ra=this,Ra.memoizerific=bo()}})(function(){return i$2(function bo(Ra,pc,mc){function uf(hf,pf){if(!pc[hf]){if(!Ra[hf]){var mf=typeof U$2=="function"&&U$2;if(!pf&&mf)return mf(hf,!0);if(df)return df(hf,!0);var gf=new Error("Cannot find module '"+hf+"'");throw gf.code="MODULE_NOT_FOUND",gf}var yf=pc[hf]={exports:{}};Ra[hf][0].call(yf.exports,function(vf){var bf=Ra[hf][1][vf];return uf(bf||vf)},yf,yf.exports,bo,Ra,pc,mc)}return pc[hf].exports}i$2(uf,"s");for(var df=typeof U$2=="function"&&U$2,ff=0;ff<mc.length;ff++)uf(mc[ff]);return uf},"e")({1:[function(bo,Ra,pc){Ra.exports=function(mc){if(typeof Map!="function"||mc){var uf=bo("./similar");return new uf}else return new Map}},{"./similar":2}],2:[function(bo,Ra,pc){function mc(){return this.list=[],this.lastItem=void 0,this.size=0,this}i$2(mc,"Similar"),mc.prototype.get=function(uf){var df;if(this.lastItem&&this.isEqual(this.lastItem.key,uf))return this.lastItem.val;if(df=this.indexOf(uf),df>=0)return this.lastItem=this.list[df],this.list[df].val},mc.prototype.set=function(uf,df){var ff;return this.lastItem&&this.isEqual(this.lastItem.key,uf)?(this.lastItem.val=df,this):(ff=this.indexOf(uf),ff>=0?(this.lastItem=this.list[ff],this.list[ff].val=df,this):(this.lastItem={key:uf,val:df},this.list.push(this.lastItem),this.size++,this))},mc.prototype.delete=function(uf){var df;if(this.lastItem&&this.isEqual(this.lastItem.key,uf)&&(this.lastItem=void 0),df=this.indexOf(uf),df>=0)return this.size--,this.list.splice(df,1)[0]},mc.prototype.has=function(uf){var df;return this.lastItem&&this.isEqual(this.lastItem.key,uf)?!0:(df=this.indexOf(uf),df>=0?(this.lastItem=this.list[df],!0):!1)},mc.prototype.forEach=function(uf,df){var ff;for(ff=0;ff<this.size;ff++)uf.call(df||this,this.list[ff].val,this.list[ff].key,this)},mc.prototype.indexOf=function(uf){var df;for(df=0;df<this.size;df++)if(this.isEqual(this.list[df].key,uf))return df;return-1},mc.prototype.isEqual=function(uf,df){return uf===df||uf!==uf&&df!==df},Ra.exports=mc},{}],3:[function(bo,Ra,pc){var mc=bo("map-or-similar");Ra.exports=function(hf){var pf=new mc(!1),mf=[];return function(gf){var yf=i$2(function(){var vf=pf,bf,Sf,xf=arguments.length-1,wf=Array(xf+1),If=!0,l1;if((yf.numArgs||yf.numArgs===0)&&yf.numArgs!==xf+1)throw new Error("Memoizerific functions should always be called with the same number of arguments");for(l1=0;l1<xf;l1++){if(wf[l1]={cacheItem:vf,arg:arguments[l1]},vf.has(arguments[l1])){vf=vf.get(arguments[l1]);continue}If=!1,bf=new mc(!1),vf.set(arguments[l1],bf),vf=bf}return If&&(vf.has(arguments[xf])?Sf=vf.get(arguments[xf]):If=!1),If||(Sf=gf.apply(null,arguments),vf.set(arguments[xf],Sf)),hf>0&&(wf[xf]={cacheItem:vf,arg:arguments[xf]},If?uf(mf,wf):mf.push(wf),mf.length>hf&&df(mf.shift())),yf.wasMemoized=If,yf.numArgs=xf+1,Sf},"memoizerific");return yf.limit=hf,yf.wasMemoized=!1,yf.cache=pf,yf.lru=mf,yf}};function uf(hf,pf){var mf=hf.length,gf=pf.length,yf,vf,bf;for(vf=0;vf<mf;vf++){for(yf=!0,bf=0;bf<gf;bf++)if(!ff(hf[vf][bf].arg,pf[bf].arg)){yf=!1;break}if(yf)break}hf.push(hf.splice(vf,1)[0])}i$2(uf,"moveToMostRecentLru");function df(hf){var pf=hf.length,mf=hf[pf-1],gf,yf;for(mf.cacheItem.delete(mf.arg),yf=pf-2;yf>=0&&(mf=hf[yf],gf=mf.cacheItem.get(mf.arg),!gf||!gf.size);yf--)mf.cacheItem.delete(mf.arg)}i$2(df,"removeCachedResult");function ff(hf,pf){return hf===pf||hf!==hf&&pf!==pf}i$2(ff,"isEqual")},{"map-or-similar":1}]},{},[3])(3)})}),b$1=(()=>{let vo;return typeof window<"u"?vo=window:typeof globalThis<"u"?vo=globalThis:typeof global<"u"?vo=global:typeof self<"u"?vo=self:vo={},vo})(),se=i$2(vo=>vo.transports!==void 0,"isMulti"),le$1=i$2(()=>Math.random().toString(16).slice(2),"generateRandomId"),lt$1=class{constructor(vo={}){this.sender=le$1(),this.events={},this.data={},this.transports=[],this.isAsync=vo.async||!1,se(vo)?(this.transports=vo.transports||[],this.transports.forEach(Ai=>{Ai.setHandler(bo=>this.handleEvent(bo))})):this.transports=vo.transport?[vo.transport]:[],this.transports.forEach(Ai=>{Ai.setHandler(bo=>this.handleEvent(bo))})}get hasTransport(){return this.transports.length>0}addListener(vo,Ai){this.events[vo]=this.events[vo]||[],this.events[vo].push(Ai)}emit(vo,...Ai){let bo={type:vo,args:Ai,from:this.sender},Ra={};Ai.length>=1&&Ai[0]&&Ai[0].options&&(Ra=Ai[0].options);let pc=i$2(()=>{this.transports.forEach(mc=>{mc.send(bo,Ra)}),this.handleEvent(bo)},"handler");this.isAsync?setImmediate(pc):pc()}last(vo){return this.data[vo]}eventNames(){return Object.keys(this.events)}listenerCount(vo){let Ai=this.listeners(vo);return Ai?Ai.length:0}listeners(vo){return this.events[vo]||void 0}once(vo,Ai){let bo=this.onceListener(vo,Ai);this.addListener(vo,bo)}removeAllListeners(vo){vo?this.events[vo]&&delete this.events[vo]:this.events={}}removeListener(vo,Ai){let bo=this.listeners(vo);bo&&(this.events[vo]=bo.filter(Ra=>Ra!==Ai))}on(vo,Ai){this.addListener(vo,Ai)}off(vo,Ai){this.removeListener(vo,Ai)}handleEvent(vo){let Ai=this.listeners(vo.type);Ai&&Ai.length&&Ai.forEach(bo=>{bo.apply(vo,vo.args)}),this.data[vo.type]=vo.args}onceListener(vo,Ai){let bo=i$2((...Ra)=>(this.removeListener(vo,bo),Ai(...Ra)),"onceListener");return bo}};i$2(lt$1,"Channel");var z$2=lt$1,ce$1=Object.create,St=Object.defineProperty,fe$1=Object.getOwnPropertyDescriptor,wt$1=Object.getOwnPropertyNames,ue$1=Object.getPrototypeOf,pe$1=Object.prototype.hasOwnProperty,x$2=i$2((vo,Ai)=>i$2(function(){return Ai||(0,vo[wt$1(vo)[0]])((Ai={exports:{}}).exports,Ai),Ai.exports},"__require"),"__commonJS"),ye$1=i$2((vo,Ai,bo,Ra)=>{if(Ai&&typeof Ai=="object"||typeof Ai=="function")for(let pc of wt$1(Ai))!pe$1.call(vo,pc)&&pc!==bo&&St(vo,pc,{get:i$2(()=>Ai[pc],"get"),enumerable:!(Ra=fe$1(Ai,pc))||Ra.enumerable});return vo},"__copyProps"),tt$1=i$2((vo,Ai,bo)=>(bo=vo!=null?ce$1(ue$1(vo)):{},ye$1(Ai||!vo||!vo.__esModule?St(bo,"default",{value:vo,enumerable:!0}):bo,vo)),"__toESM"),de$1=["bubbles","cancelBubble","cancelable","composed","currentTarget","defaultPrevented","eventPhase","isTrusted","returnValue","srcElement","target","timeStamp","type"],he$1=["detail"];function Et$1(vo){let Ai=de$1.filter(bo=>vo[bo]!==void 0).reduce((bo,Ra)=>({...bo,[Ra]:vo[Ra]}),{});return vo instanceof CustomEvent&&he$1.filter(bo=>vo[bo]!==void 0).forEach(bo=>{Ai[bo]=vo[bo]}),Ai}i$2(Et$1,"extractEventHiddenProperties");var Ut$1=ie$2(At$1()),Tt$1=x$2({"node_modules/has-symbols/shams.js"(vo,Ai){Ai.exports=i$2(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var bo={},Ra=Symbol("test"),pc=Object(Ra);if(typeof Ra=="string"||Object.prototype.toString.call(Ra)!=="[object Symbol]"||Object.prototype.toString.call(pc)!=="[object Symbol]")return!1;var mc=42;bo[Ra]=mc;for(Ra in bo)return!1;if(typeof Object.keys=="function"&&Object.keys(bo).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(bo).length!==0)return!1;var uf=Object.getOwnPropertySymbols(bo);if(uf.length!==1||uf[0]!==Ra||!Object.prototype.propertyIsEnumerable.call(bo,Ra))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var df=Object.getOwnPropertyDescriptor(bo,Ra);if(df.value!==mc||df.enumerable!==!0)return!1}return!0},"hasSymbols")}}),Ft$1=x$2({"node_modules/has-symbols/index.js"(vo,Ai){var bo=typeof Symbol<"u"&&Symbol,Ra=Tt$1();Ai.exports=i$2(function(){return typeof bo!="function"||typeof Symbol!="function"||typeof bo("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Ra()},"hasNativeSymbols")}}),ge$1=x$2({"node_modules/function-bind/implementation.js"(vo,Ai){var bo="Function.prototype.bind called on incompatible ",Ra=Array.prototype.slice,pc=Object.prototype.toString,mc="[object Function]";Ai.exports=i$2(function(uf){var df=this;if(typeof df!="function"||pc.call(df)!==mc)throw new TypeError(bo+df);for(var ff=Ra.call(arguments,1),hf,pf=i$2(function(){if(this instanceof hf){var bf=df.apply(this,ff.concat(Ra.call(arguments)));return Object(bf)===bf?bf:this}else return df.apply(uf,ff.concat(Ra.call(arguments)))},"binder"),mf=Math.max(0,df.length-ff.length),gf=[],yf=0;yf<mf;yf++)gf.push("$"+yf);if(hf=Function("binder","return function ("+gf.join(",")+"){ return binder.apply(this,arguments); }")(pf),df.prototype){var vf=i$2(function(){},"Empty2");vf.prototype=df.prototype,hf.prototype=new vf,vf.prototype=null}return hf},"bind")}}),ut=x$2({"node_modules/function-bind/index.js"(vo,Ai){var bo=ge$1();Ai.exports=Function.prototype.bind||bo}}),me$1=x$2({"node_modules/has/src/index.js"(vo,Ai){var bo=ut();Ai.exports=bo.call(Function.call,Object.prototype.hasOwnProperty)}}),Nt$1=x$2({"node_modules/get-intrinsic/index.js"(vo,Ai){var bo,Ra=SyntaxError,pc=Function,mc=TypeError,uf=i$2(function(E1){try{return pc('"use strict"; return ('+E1+").constructor;")()}catch{}},"getEvalledConstructor"),df=Object.getOwnPropertyDescriptor;if(df)try{df({},"")}catch{df=null}var ff=i$2(function(){throw new mc},"throwTypeError"),hf=df?function(){try{return arguments.callee,ff}catch{try{return df(arguments,"callee").get}catch{return ff}}}():ff,pf=Ft$1()(),mf=Object.getPrototypeOf||function(E1){return E1.__proto__},gf={},yf=typeof Uint8Array>"u"?bo:mf(Uint8Array),vf={"%AggregateError%":typeof AggregateError>"u"?bo:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?bo:ArrayBuffer,"%ArrayIteratorPrototype%":pf?mf([][Symbol.iterator]()):bo,"%AsyncFromSyncIteratorPrototype%":bo,"%AsyncFunction%":gf,"%AsyncGenerator%":gf,"%AsyncGeneratorFunction%":gf,"%AsyncIteratorPrototype%":gf,"%Atomics%":typeof Atomics>"u"?bo:Atomics,"%BigInt%":typeof BigInt>"u"?bo:BigInt,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?bo:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?bo:Float32Array,"%Float64Array%":typeof Float64Array>"u"?bo:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?bo:FinalizationRegistry,"%Function%":pc,"%GeneratorFunction%":gf,"%Int8Array%":typeof Int8Array>"u"?bo:Int8Array,"%Int16Array%":typeof Int16Array>"u"?bo:Int16Array,"%Int32Array%":typeof Int32Array>"u"?bo:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":pf?mf(mf([][Symbol.iterator]())):bo,"%JSON%":typeof JSON=="object"?JSON:bo,"%Map%":typeof Map>"u"?bo:Map,"%MapIteratorPrototype%":typeof Map>"u"||!pf?bo:mf(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?bo:Promise,"%Proxy%":typeof Proxy>"u"?bo:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?bo:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?bo:Set,"%SetIteratorPrototype%":typeof Set>"u"||!pf?bo:mf(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?bo:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":pf?mf(""[Symbol.iterator]()):bo,"%Symbol%":pf?Symbol:bo,"%SyntaxError%":Ra,"%ThrowTypeError%":hf,"%TypedArray%":yf,"%TypeError%":mc,"%Uint8Array%":typeof Uint8Array>"u"?bo:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?bo:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?bo:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?bo:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?bo:WeakMap,"%WeakRef%":typeof WeakRef>"u"?bo:WeakRef,"%WeakSet%":typeof WeakSet>"u"?bo:WeakSet},bf=i$2(function E1(M1){var m1;if(M1==="%AsyncFunction%")m1=uf("async function () {}");else if(M1==="%GeneratorFunction%")m1=uf("function* () {}");else if(M1==="%AsyncGeneratorFunction%")m1=uf("async function* () {}");else if(M1==="%AsyncGenerator%"){var $1=E1("%AsyncGeneratorFunction%");$1&&(m1=$1.prototype)}else if(M1==="%AsyncIteratorPrototype%"){var k1=E1("%AsyncGenerator%");k1&&(m1=mf(k1.prototype))}return vf[M1]=m1,m1},"doEval2"),Sf={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},xf=ut(),wf=me$1(),If=xf.call(Function.call,Array.prototype.concat),l1=xf.call(Function.apply,Array.prototype.splice),s1=xf.call(Function.call,String.prototype.replace),c1=xf.call(Function.call,String.prototype.slice),u1=xf.call(Function.call,RegExp.prototype.exec),T1=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,_1=/\\(\\)?/g,R1=i$2(function(E1){var M1=c1(E1,0,1),m1=c1(E1,-1);if(M1==="%"&&m1!=="%")throw new Ra("invalid intrinsic syntax, expected closing `%`");if(m1==="%"&&M1!=="%")throw new Ra("invalid intrinsic syntax, expected opening `%`");var $1=[];return s1(E1,T1,function(k1,F1,U1,B1){$1[$1.length]=U1?s1(B1,_1,"$1"):F1||k1}),$1},"stringToPath3"),P1=i$2(function(E1,M1){var m1=E1,$1;if(wf(Sf,m1)&&($1=Sf[m1],m1="%"+$1[0]+"%"),wf(vf,m1)){var k1=vf[m1];if(k1===gf&&(k1=bf(m1)),typeof k1>"u"&&!M1)throw new mc("intrinsic "+E1+" exists, but is not available. Please file an issue!");return{alias:$1,name:m1,value:k1}}throw new Ra("intrinsic "+E1+" does not exist!")},"getBaseIntrinsic2");Ai.exports=i$2(function(E1,M1){if(typeof E1!="string"||E1.length===0)throw new mc("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof M1!="boolean")throw new mc('"allowMissing" argument must be a boolean');if(u1(/^%?[^%]*%?$/,E1)===null)throw new Ra("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var m1=R1(E1),$1=m1.length>0?m1[0]:"",k1=P1("%"+$1+"%",M1),F1=k1.name,U1=k1.value,B1=!1,W1=k1.alias;W1&&($1=W1[0],l1(m1,If([0,1],W1)));for(var Z1=1,O1=!0;Z1<m1.length;Z1+=1){var j1=m1[Z1],L1=c1(j1,0,1),G1=c1(j1,-1);if((L1==='"'||L1==="'"||L1==="`"||G1==='"'||G1==="'"||G1==="`")&&L1!==G1)throw new Ra("property names with quotes must have matching quotes");if((j1==="constructor"||!O1)&&(B1=!0),$1+="."+j1,F1="%"+$1+"%",wf(vf,F1))U1=vf[F1];else if(U1!=null){if(!(j1 in U1)){if(!M1)throw new mc("base intrinsic for "+E1+" exists, but the property is not available.");return}if(df&&Z1+1>=m1.length){var Y1=df(U1,j1);O1=!!Y1,O1&&"get"in Y1&&!("originalValue"in Y1.get)?U1=Y1.get:U1=U1[j1]}else O1=wf(U1,j1),U1=U1[j1];O1&&!B1&&(vf[F1]=U1)}}return U1},"GetIntrinsic")}}),ve$1=x$2({"node_modules/call-bind/index.js"(vo,Ai){var bo=ut(),Ra=Nt$1(),pc=Ra("%Function.prototype.apply%"),mc=Ra("%Function.prototype.call%"),uf=Ra("%Reflect.apply%",!0)||bo.call(mc,pc),df=Ra("%Object.getOwnPropertyDescriptor%",!0),ff=Ra("%Object.defineProperty%",!0),hf=Ra("%Math.max%");if(ff)try{ff({},"a",{value:1})}catch{ff=null}Ai.exports=i$2(function(mf){var gf=uf(bo,mc,arguments);if(df&&ff){var yf=df(gf,"length");yf.configurable&&ff(gf,"length",{value:1+hf(0,mf.length-(arguments.length-1))})}return gf},"callBind");var pf=i$2(function(){return uf(bo,pc,arguments)},"applyBind2");ff?ff(Ai.exports,"apply",{value:pf}):Ai.exports.apply=pf}}),_e=x$2({"node_modules/call-bind/callBound.js"(vo,Ai){var bo=Nt$1(),Ra=ve$1(),pc=Ra(bo("String.prototype.indexOf"));Ai.exports=i$2(function(mc,uf){var df=bo(mc,!!uf);return typeof df=="function"&&pc(mc,".prototype.")>-1?Ra(df):df},"callBoundIntrinsic")}}),be$1=x$2({"node_modules/has-tostringtag/shams.js"(vo,Ai){var bo=Tt$1();Ai.exports=i$2(function(){return bo()&&!!Symbol.toStringTag},"hasToStringTagShams")}}),Se=x$2({"node_modules/is-regex/index.js"(vo,Ai){var bo=_e(),Ra=be$1()(),pc,mc,uf,df;Ra&&(pc=bo("Object.prototype.hasOwnProperty"),mc=bo("RegExp.prototype.exec"),uf={},ff=i$2(function(){throw uf},"throwRegexMarker"),df={toString:ff,valueOf:ff},typeof Symbol.toPrimitive=="symbol"&&(df[Symbol.toPrimitive]=ff));var ff,hf=bo("Object.prototype.toString"),pf=Object.getOwnPropertyDescriptor,mf="[object RegExp]";Ai.exports=i$2(Ra?function(gf){if(!gf||typeof gf!="object")return!1;var yf=pf(gf,"lastIndex"),vf=yf&&pc(yf,"value");if(!vf)return!1;try{mc(gf,df)}catch(bf){return bf===uf}}:function(gf){return!gf||typeof gf!="object"&&typeof gf!="function"?!1:hf(gf)===mf},"isRegex")}}),we=x$2({"node_modules/is-function/index.js"(vo,Ai){Ai.exports=Ra;var bo=Object.prototype.toString;function Ra(pc){if(!pc)return!1;var mc=bo.call(pc);return mc==="[object Function]"||typeof pc=="function"&&mc!=="[object RegExp]"||typeof window<"u"&&(pc===window.setTimeout||pc===window.alert||pc===window.confirm||pc===window.prompt)}i$2(Ra,"isFunction3")}}),Ee$1=x$2({"node_modules/is-symbol/index.js"(vo,Ai){var bo=Object.prototype.toString,Ra=Ft$1()();Ra?(pc=Symbol.prototype.toString,mc=/^Symbol\(.*\)$/,uf=i$2(function(df){return typeof df.valueOf()!="symbol"?!1:mc.test(pc.call(df))},"isRealSymbolObject"),Ai.exports=i$2(function(df){if(typeof df=="symbol")return!0;if(bo.call(df)!=="[object Symbol]")return!1;try{return uf(df)}catch{return!1}},"isSymbol3")):Ai.exports=i$2(function(df){return!1},"isSymbol3");var pc,mc,uf}}),Oe$1=tt$1(Se()),Ae$1=tt$1(we()),Pe$1=tt$1(Ee$1());function xe(vo){return vo!=null&&typeof vo=="object"&&Array.isArray(vo)===!1}i$2(xe,"isObject");var Ce$1=typeof global=="object"&&global&&global.Object===Object&&global,Ie$1=Ce$1,je$1=typeof self=="object"&&self&&self.Object===Object&&self,Te=Ie$1||je$1||Function("return this")(),pt$1=Te,Fe$1=pt$1.Symbol,M$3=Fe$1,Rt$1=Object.prototype,Ne=Rt$1.hasOwnProperty,Re$1=Rt$1.toString,W$1=M$3?M$3.toStringTag:void 0;function Me$1(vo){var Ai=Ne.call(vo,W$1),bo=vo[W$1];try{vo[W$1]=void 0;var Ra=!0}catch{}var pc=Re$1.call(vo);return Ra&&(Ai?vo[W$1]=bo:delete vo[W$1]),pc}i$2(Me$1,"getRawTag");var $e$1=Me$1,ke$1=Object.prototype,De$1=ke$1.toString;function Le(vo){return De$1.call(vo)}i$2(Le,"objectToString");var Ue$1=Le,ze$1="[object Null]",We$1="[object Undefined]",Pt$1=M$3?M$3.toStringTag:void 0;function Be$1(vo){return vo==null?vo===void 0?We$1:ze$1:Pt$1&&Pt$1 in Object(vo)?$e$1(vo):Ue$1(vo)}i$2(Be$1,"baseGetTag");var Mt$1=Be$1;function He$1(vo){return vo!=null&&typeof vo=="object"}i$2(He$1,"isObjectLike");var qe$1=He$1,Ge$1="[object Symbol]";function Je(vo){return typeof vo=="symbol"||qe$1(vo)&&Mt$1(vo)==Ge$1}i$2(Je,"isSymbol");var yt$1=Je;function Ve$1(vo,Ai){for(var bo=-1,Ra=vo==null?0:vo.length,pc=Array(Ra);++bo<Ra;)pc[bo]=Ai(vo[bo],bo,vo);return pc}i$2(Ve$1,"arrayMap");var Ke$1=Ve$1,Ye$1=Array.isArray,dt=Ye$1,Ze=1/0,xt$1=M$3?M$3.prototype:void 0,Ct$1=xt$1?xt$1.toString:void 0;function $t$1(vo){if(typeof vo=="string")return vo;if(dt(vo))return Ke$1(vo,$t$1)+"";if(yt$1(vo))return Ct$1?Ct$1.call(vo):"";var Ai=vo+"";return Ai=="0"&&1/vo==-Ze?"-0":Ai}i$2($t$1,"baseToString");var Xe$1=$t$1;function Qe$1(vo){var Ai=typeof vo;return vo!=null&&(Ai=="object"||Ai=="function")}i$2(Qe$1,"isObject2");var kt$1=Qe$1,tr$1="[object AsyncFunction]",er="[object Function]",rr="[object GeneratorFunction]",nr="[object Proxy]";function or(vo){if(!kt$1(vo))return!1;var Ai=Mt$1(vo);return Ai==er||Ai==rr||Ai==tr$1||Ai==nr}i$2(or,"isFunction");var ar=or,ir=pt$1["__core-js_shared__"],ft$1=ir,It$1=function(){var vo=/[^.]+$/.exec(ft$1&&ft$1.keys&&ft$1.keys.IE_PROTO||"");return vo?"Symbol(src)_1."+vo:""}();function sr(vo){return!!It$1&&It$1 in vo}i$2(sr,"isMasked");var lr=sr,cr=Function.prototype,fr$1=cr.toString;function ur$1(vo){if(vo!=null){try{return fr$1.call(vo)}catch{}try{return vo+""}catch{}}return""}i$2(ur$1,"toSource");var pr$1=ur$1,yr$1=/[\\^$.*+?()[\]{}|]/g,dr=/^\[object .+?Constructor\]$/,hr$1=Function.prototype,gr$1=Object.prototype,mr$1=hr$1.toString,vr$1=gr$1.hasOwnProperty,_r$1=RegExp("^"+mr$1.call(vr$1).replace(yr$1,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function br$1(vo){if(!kt$1(vo)||lr(vo))return!1;var Ai=ar(vo)?_r$1:dr;return Ai.test(pr$1(vo))}i$2(br$1,"baseIsNative");var Sr$1=br$1;function wr$1(vo,Ai){return vo==null?void 0:vo[Ai]}i$2(wr$1,"getValue");var Er$1=wr$1;function Or(vo,Ai){var bo=Er$1(vo,Ai);return Sr$1(bo)?bo:void 0}i$2(Or,"getNative");var Dt$1=Or;function Ar$1(vo,Ai){return vo===Ai||vo!==vo&&Ai!==Ai}i$2(Ar$1,"eq");var Pr$1=Ar$1,xr$1=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Cr$1=/^\w*$/;function Ir$1(vo,Ai){if(dt(vo))return!1;var bo=typeof vo;return bo=="number"||bo=="symbol"||bo=="boolean"||vo==null||yt$1(vo)?!0:Cr$1.test(vo)||!xr$1.test(vo)||Ai!=null&&vo in Object(Ai)}i$2(Ir$1,"isKey");var jr$1=Ir$1,Tr$1=Dt$1(Object,"create"),B$1=Tr$1;function Fr(){this.__data__=B$1?B$1(null):{},this.size=0}i$2(Fr,"hashClear");var Nr$1=Fr;function Rr$1(vo){var Ai=this.has(vo)&&delete this.__data__[vo];return this.size-=Ai?1:0,Ai}i$2(Rr$1,"hashDelete");var Mr$1=Rr$1,$r$1="__lodash_hash_undefined__",kr$1=Object.prototype,Dr$1=kr$1.hasOwnProperty;function Lr$1(vo){var Ai=this.__data__;if(B$1){var bo=Ai[vo];return bo===$r$1?void 0:bo}return Dr$1.call(Ai,vo)?Ai[vo]:void 0}i$2(Lr$1,"hashGet");var Ur$1=Lr$1,zr$1=Object.prototype,Wr$1=zr$1.hasOwnProperty;function Br$1(vo){var Ai=this.__data__;return B$1?Ai[vo]!==void 0:Wr$1.call(Ai,vo)}i$2(Br$1,"hashHas");var Hr$1=Br$1,qr$1="__lodash_hash_undefined__";function Gr$1(vo,Ai){var bo=this.__data__;return this.size+=this.has(vo)?0:1,bo[vo]=B$1&&Ai===void 0?qr$1:Ai,this}i$2(Gr$1,"hashSet");var Jr$1=Gr$1;function $$2(vo){var Ai=-1,bo=vo==null?0:vo.length;for(this.clear();++Ai<bo;){var Ra=vo[Ai];this.set(Ra[0],Ra[1])}}i$2($$2,"Hash");$$2.prototype.clear=Nr$1;$$2.prototype.delete=Mr$1;$$2.prototype.get=Ur$1;$$2.prototype.has=Hr$1;$$2.prototype.set=Jr$1;var jt$1=$$2;function Vr$1(){this.__data__=[],this.size=0}i$2(Vr$1,"listCacheClear");var Kr$1=Vr$1;function Yr$1(vo,Ai){for(var bo=vo.length;bo--;)if(Pr$1(vo[bo][0],Ai))return bo;return-1}i$2(Yr$1,"assocIndexOf");var rt=Yr$1,Zr=Array.prototype,Xr=Zr.splice;function Qr$1(vo){var Ai=this.__data__,bo=rt(Ai,vo);if(bo<0)return!1;var Ra=Ai.length-1;return bo==Ra?Ai.pop():Xr.call(Ai,bo,1),--this.size,!0}i$2(Qr$1,"listCacheDelete");var tn=Qr$1;function en(vo){var Ai=this.__data__,bo=rt(Ai,vo);return bo<0?void 0:Ai[bo][1]}i$2(en,"listCacheGet");var rn=en;function nn(vo){return rt(this.__data__,vo)>-1}i$2(nn,"listCacheHas");var on=nn;function an(vo,Ai){var bo=this.__data__,Ra=rt(bo,vo);return Ra<0?(++this.size,bo.push([vo,Ai])):bo[Ra][1]=Ai,this}i$2(an,"listCacheSet");var sn=an;function k$3(vo){var Ai=-1,bo=vo==null?0:vo.length;for(this.clear();++Ai<bo;){var Ra=vo[Ai];this.set(Ra[0],Ra[1])}}i$2(k$3,"ListCache");k$3.prototype.clear=Kr$1;k$3.prototype.delete=tn;k$3.prototype.get=rn;k$3.prototype.has=on;k$3.prototype.set=sn;var ln=k$3,cn$1=Dt$1(pt$1,"Map"),fn=cn$1;function un(){this.size=0,this.__data__={hash:new jt$1,map:new(fn||ln),string:new jt$1}}i$2(un,"mapCacheClear");var pn$1=un;function yn(vo){var Ai=typeof vo;return Ai=="string"||Ai=="number"||Ai=="symbol"||Ai=="boolean"?vo!=="__proto__":vo===null}i$2(yn,"isKeyable");var dn=yn;function hn(vo,Ai){var bo=vo.__data__;return dn(Ai)?bo[typeof Ai=="string"?"string":"hash"]:bo.map}i$2(hn,"getMapData");var nt=hn;function gn(vo){var Ai=nt(this,vo).delete(vo);return this.size-=Ai?1:0,Ai}i$2(gn,"mapCacheDelete");var mn=gn;function vn$1(vo){return nt(this,vo).get(vo)}i$2(vn$1,"mapCacheGet");var _n$1=vn$1;function bn(vo){return nt(this,vo).has(vo)}i$2(bn,"mapCacheHas");var Sn=bn;function wn$1(vo,Ai){var bo=nt(this,vo),Ra=bo.size;return bo.set(vo,Ai),this.size+=bo.size==Ra?0:1,this}i$2(wn$1,"mapCacheSet");var En$1=wn$1;function D$2(vo){var Ai=-1,bo=vo==null?0:vo.length;for(this.clear();++Ai<bo;){var Ra=vo[Ai];this.set(Ra[0],Ra[1])}}i$2(D$2,"MapCache");D$2.prototype.clear=pn$1;D$2.prototype.delete=mn;D$2.prototype.get=_n$1;D$2.prototype.has=Sn;D$2.prototype.set=En$1;var Lt$1=D$2,On$1="Expected a function";function ht$1(vo,Ai){if(typeof vo!="function"||Ai!=null&&typeof Ai!="function")throw new TypeError(On$1);var bo=i$2(function(){var Ra=arguments,pc=Ai?Ai.apply(this,Ra):Ra[0],mc=bo.cache;if(mc.has(pc))return mc.get(pc);var uf=vo.apply(this,Ra);return bo.cache=mc.set(pc,uf)||mc,uf},"memoized");return bo.cache=new(ht$1.Cache||Lt$1),bo}i$2(ht$1,"memoize");ht$1.Cache=Lt$1;var An$1=ht$1,Pn$1=500;function xn(vo){var Ai=An$1(vo,function(Ra){return bo.size===Pn$1&&bo.clear(),Ra}),bo=Ai.cache;return Ai}i$2(xn,"memoizeCapped");var Cn$1=xn,In$1=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,jn$1=/\\(\\)?/g,Tn=Cn$1(function(vo){var Ai=[];return vo.charCodeAt(0)===46&&Ai.push(""),vo.replace(In$1,function(bo,Ra,pc,mc){Ai.push(pc?mc.replace(jn$1,"$1"):Ra||bo)}),Ai}),Fn$1=Tn;function Nn$1(vo){return vo==null?"":Xe$1(vo)}i$2(Nn$1,"toString");var Rn$1=Nn$1;function Mn$1(vo,Ai){return dt(vo)?vo:jr$1(vo,Ai)?[vo]:Fn$1(Rn$1(vo))}i$2(Mn$1,"castPath");var $n$1=Mn$1,kn$1=1/0;function Dn$1(vo){if(typeof vo=="string"||yt$1(vo))return vo;var Ai=vo+"";return Ai=="0"&&1/vo==-kn$1?"-0":Ai}i$2(Dn$1,"toKey");var Ln=Dn$1;function Un$1(vo,Ai){Ai=$n$1(Ai,vo);for(var bo=0,Ra=Ai.length;vo!=null&&bo<Ra;)vo=vo[Ln(Ai[bo++])];return bo&&bo==Ra?vo:void 0}i$2(Un$1,"baseGet");var zn=Un$1;function Wn$1(vo,Ai,bo){var Ra=vo==null?void 0:zn(vo,Ai);return Ra===void 0?bo:Ra}i$2(Wn$1,"get");var Bn=Wn$1,et$1=xe,Hn$1=i$2(vo=>{let Ai=null,bo=!1,Ra=!1,pc=!1,mc="";if(vo.indexOf("//")>=0||vo.indexOf("/*")>=0)for(let uf=0;uf<vo.length;uf+=1)!Ai&&!bo&&!Ra&&!pc?vo[uf]==='"'||vo[uf]==="'"||vo[uf]==="`"?Ai=vo[uf]:vo[uf]==="/"&&vo[uf+1]==="*"?bo=!0:vo[uf]==="/"&&vo[uf+1]==="/"?Ra=!0:vo[uf]==="/"&&vo[uf+1]!=="/"&&(pc=!0):(Ai&&(vo[uf]===Ai&&vo[uf-1]!=="\\"||vo[uf]===`
|
|
82
|
-
`&&Ai!=="`")&&(Ai=null),pc&&(vo[uf]==="/"&&vo[uf-1]!=="\\"||vo[uf]===`
|
|
83
|
-
`)&&(pc=!1),bo&&vo[uf-1]==="/"&&vo[uf-2]==="*"&&(bo=!1),Ra&&vo[uf]===`
|
|
84
|
-
`&&(Ra=!1)),!bo&&!Ra&&(mc+=vo[uf]);else mc=vo;return mc},"removeCodeComments"),qn=(0,Ut$1.default)(1e4)(vo=>Hn$1(vo).replace(/\n\s*/g,"").trim()),Gn=i$2(function(vo,Ai){let bo=Ai.slice(0,Ai.indexOf("{")),Ra=Ai.slice(Ai.indexOf("{"));if(bo.includes("=>")||bo.includes("function"))return Ai;let pc=bo;return pc=pc.replace(vo,"function"),pc+Ra},"convertShorthandMethods2"),Jn$1=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{3})?Z$/,H$1=i$2(vo=>vo.match(/^[\[\{\"\}].*[\]\}\"]$/),"isJSON");function zt$1(vo){if(!et$1(vo))return vo;let Ai=vo,bo=!1;return typeof Event<"u"&&vo instanceof Event&&(Ai=Et$1(Ai),bo=!0),Ai=Object.keys(Ai).reduce((Ra,pc)=>{try{Ai[pc]&&Ai[pc].toJSON,Ra[pc]=Ai[pc]}catch{bo=!0}return Ra},{}),bo?Ai:vo}i$2(zt$1,"convertUnconventionalData");var Vn$1=i$2(function(vo){let Ai,bo,Ra,pc;return i$2(function(mc,uf){try{if(mc==="")return pc=[],Ai=new Map([[uf,"[]"]]),bo=new Map,Ra=[],uf;let df=bo.get(this)||this;for(;Ra.length&&df!==Ra[0];)Ra.shift(),pc.pop();if(typeof uf=="boolean")return uf;if(uf===void 0)return vo.allowUndefined?"_undefined_":void 0;if(uf===null)return null;if(typeof uf=="number")return uf===-1/0?"_-Infinity_":uf===1/0?"_Infinity_":Number.isNaN(uf)?"_NaN_":uf;if(typeof uf=="bigint")return`_bigint_${uf.toString()}`;if(typeof uf=="string")return Jn$1.test(uf)?vo.allowDate?`_date_${uf}`:void 0:uf;if((0,Oe$1.default)(uf))return vo.allowRegExp?`_regexp_${uf.flags}|${uf.source}`:void 0;if((0,Ae$1.default)(uf)){if(!vo.allowFunction)return;let{name:hf}=uf,pf=uf.toString();return pf.match(/(\[native code\]|WEBPACK_IMPORTED_MODULE|__webpack_exports__|__webpack_require__)/)?`_function_${hf}|${(()=>{}).toString()}`:`_function_${hf}|${qn(Gn(mc,pf))}`}if((0,Pe$1.default)(uf)){if(!vo.allowSymbol)return;let hf=Symbol.keyFor(uf);return hf!==void 0?`_gsymbol_${hf}`:`_symbol_${uf.toString().slice(7,-1)}`}if(Ra.length>=vo.maxDepth)return Array.isArray(uf)?`[Array(${uf.length})]`:"[Object]";if(uf===this)return`_duplicate_${JSON.stringify(pc)}`;if(uf instanceof Error&&vo.allowError)return{__isConvertedError__:!0,errorProperties:{...uf.cause?{cause:uf.cause}:{},...uf,name:uf.name,message:uf.message,stack:uf.stack,"_constructor-name_":uf.constructor.name}};if(uf.constructor&&uf.constructor.name&&uf.constructor.name!=="Object"&&!Array.isArray(uf)&&!vo.allowClass)return;let ff=Ai.get(uf);if(!ff){let hf=Array.isArray(uf)?uf:zt$1(uf);if(uf.constructor&&uf.constructor.name&&uf.constructor.name!=="Object"&&!Array.isArray(uf)&&vo.allowClass)try{Object.assign(hf,{"_constructor-name_":uf.constructor.name})}catch{}return pc.push(mc),Ra.unshift(hf),Ai.set(uf,JSON.stringify(pc)),uf!==hf&&bo.set(uf,hf),hf}return`_duplicate_${ff}`}catch{return}},"replace")},"replacer2"),Kn$1=i$2(function reviver(options){let refs=[],root;return i$2(function revive(key,value){if(key===""&&(root=value,refs.forEach(({target:vo,container:Ai,replacement:bo})=>{let Ra=H$1(bo)?JSON.parse(bo):bo.split(".");Ra.length===0?Ai[vo]=root:Ai[vo]=Bn(root,Ra)})),key==="_constructor-name_")return value;if(et$1(value)&&value.__isConvertedError__){let{message:vo,...Ai}=value.errorProperties,bo=new Error(vo);return Object.assign(bo,Ai),bo}if(et$1(value)&&value["_constructor-name_"]&&options.allowFunction){let vo=value["_constructor-name_"];if(vo!=="Object"){let Ai=new Function(`return function ${vo.replace(/[^a-zA-Z0-9$_]+/g,"")}(){}`)();Object.setPrototypeOf(value,new Ai)}return delete value["_constructor-name_"],value}if(typeof value=="string"&&value.startsWith("_function_")&&options.allowFunction){let[,name,source]=value.match(/_function_([^|]*)\|(.*)/)||[],sourceSanitized=source.replace(/[(\(\))|\\| |\]|`]*$/,"");if(!options.lazyEval)return eval(`(${sourceSanitized})`);let result=i$2((...args)=>{let f=eval(`(${sourceSanitized})`);return f(...args)},"result");return Object.defineProperty(result,"toString",{value:i$2(()=>sourceSanitized,"value")}),Object.defineProperty(result,"name",{value:name}),result}if(typeof value=="string"&&value.startsWith("_regexp_")&&options.allowRegExp){let[,vo,Ai]=value.match(/_regexp_([^|]*)\|(.*)/)||[];return new RegExp(Ai,vo)}return typeof value=="string"&&value.startsWith("_date_")&&options.allowDate?new Date(value.replace("_date_","")):typeof value=="string"&&value.startsWith("_duplicate_")?(refs.push({target:key,container:this,replacement:value.replace(/^_duplicate_/,"")}),null):typeof value=="string"&&value.startsWith("_symbol_")&&options.allowSymbol?Symbol(value.replace("_symbol_","")):typeof value=="string"&&value.startsWith("_gsymbol_")&&options.allowSymbol?Symbol.for(value.replace("_gsymbol_","")):typeof value=="string"&&value==="_-Infinity_"?-1/0:typeof value=="string"&&value==="_Infinity_"?1/0:typeof value=="string"&&value==="_NaN_"?NaN:typeof value=="string"&&value.startsWith("_bigint_")&&typeof BigInt=="function"?BigInt(value.replace("_bigint_","")):value},"revive")},"reviver"),Wt$1={maxDepth:10,space:void 0,allowFunction:!0,allowRegExp:!0,allowDate:!0,allowClass:!0,allowError:!0,allowUndefined:!0,allowSymbol:!0,lazyEval:!0},ot=i$2((vo,Ai={})=>{let bo={...Wt$1,...Ai};return JSON.stringify(zt$1(vo),Vn$1(bo),Ai.space)},"stringify"),Yn$1=i$2(()=>{let vo=new Map;return i$2(function Ai(bo){et$1(bo)&&Object.entries(bo).forEach(([Ra,pc])=>{pc==="_undefined_"?bo[Ra]=void 0:vo.get(pc)||(vo.set(pc,!0),Ai(pc))}),Array.isArray(bo)&&bo.forEach((Ra,pc)=>{Ra==="_undefined_"?(vo.set(Ra,!0),bo[pc]=void 0):vo.get(Ra)||(vo.set(Ra,!0),Ai(Ra))})},"mutateUndefined")},"mutator"),at$1=i$2((vo,Ai={})=>{let bo={...Wt$1,...Ai},Ra=JSON.parse(vo,Kn$1(bo));return Yn$1()(Ra),Ra},"parse"),gt$1="Invariant failed";function q$2(vo,Ai){if(!vo){var bo=typeof Ai=="function"?Ai():Ai,Ra=bo?"".concat(gt$1,": ").concat(bo):gt$1;throw new Error(Ra)}}i$2(q$2,"invariant");var Bt$1=i$2(vo=>{let Ai=Array.from(document.querySelectorAll("iframe[data-is-storybook]")),[bo,...Ra]=Ai.filter(mc=>{var uf,df;try{return((uf=mc.contentWindow)==null?void 0:uf.location.origin)===vo.source.location.origin&&((df=mc.contentWindow)==null?void 0:df.location.pathname)===vo.source.location.pathname}catch{}try{return mc.contentWindow===vo.source}catch{}let ff=mc.getAttribute("src"),hf;try{if(!ff)return!1;({origin:hf}=new URL(ff,document.location.toString()))}catch{return!1}return hf===vo.origin}),pc=bo==null?void 0:bo.getAttribute("src");if(pc&&Ra.length===0){let{protocol:mc,host:uf,pathname:df}=new URL(pc,document.location.toString());return`${mc}//${uf}${df}`}return Ra.length>0&&s$3.error("found multiple candidates for event source"),null},"getEventSourceUrl"),{document:mt$1,location:vt$1}=b$1,Gt$1="storybook-channel",to$1={allowFunction:!1,maxDepth:25},_t$1=class{constructor(vo){if(this.config=vo,this.connected=!1,this.buffer=[],typeof(b$1==null?void 0:b$1.addEventListener)=="function"&&b$1.addEventListener("message",this.handleEvent.bind(this),!1),vo.page!=="manager"&&vo.page!=="preview")throw new Error(`postmsg-channel: "config.page" cannot be "${vo.page}"`)}setHandler(vo){this.handler=(...Ai)=>{vo.apply(this,Ai),!this.connected&&this.getLocalFrame().length&&(this.flush(),this.connected=!0)}}send(vo,Ai){let{target:bo,allowRegExp:Ra,allowFunction:pc,allowSymbol:mc,allowDate:uf,allowError:df,allowUndefined:ff,allowClass:hf,maxDepth:pf,space:mf,lazyEval:gf}=Ai||{},yf=Object.fromEntries(Object.entries({allowRegExp:Ra,allowFunction:pc,allowSymbol:mc,allowDate:uf,allowError:df,allowUndefined:ff,allowClass:hf,maxDepth:pf,space:mf,lazyEval:gf}).filter(([wf,If])=>typeof If<"u")),vf={...to$1,...b$1.CHANNEL_OPTIONS||{},...yf},bf=this.getFrames(bo),Sf=new URLSearchParams((vt$1==null?void 0:vt$1.search)||""),xf=ot({key:Gt$1,event:vo,refId:Sf.get("refId")},vf);return bf.length?(this.buffer.length&&this.flush(),bf.forEach(wf=>{try{wf.postMessage(xf,"*")}catch{s$3.error("sending over postmessage fail")}}),Promise.resolve(null)):new Promise((wf,If)=>{this.buffer.push({event:vo,resolve:wf,reject:If})})}flush(){let{buffer:vo}=this;this.buffer=[],vo.forEach(Ai=>{this.send(Ai.event).then(Ai.resolve).catch(Ai.reject)})}getFrames(vo){if(this.config.page==="manager"){let Ai=Array.from(mt$1.querySelectorAll("iframe[data-is-storybook][data-is-loaded]")).flatMap(bo=>{try{return bo.contentWindow&&bo.dataset.isStorybook!==void 0&&bo.id===vo?[bo.contentWindow]:[]}catch{return[]}});return Ai!=null&&Ai.length?Ai:this.getCurrentFrames()}return b$1&&b$1.parent&&b$1.parent!==b$1.self?[b$1.parent]:[]}getCurrentFrames(){return this.config.page==="manager"?Array.from(mt$1.querySelectorAll('[data-is-storybook="true"]')).flatMap(vo=>vo.contentWindow?[vo.contentWindow]:[]):b$1&&b$1.parent?[b$1.parent]:[]}getLocalFrame(){return this.config.page==="manager"?Array.from(mt$1.querySelectorAll("#storybook-preview-iframe")).flatMap(vo=>vo.contentWindow?[vo.contentWindow]:[]):b$1&&b$1.parent?[b$1.parent]:[]}handleEvent(vo){try{let{data:Ai}=vo,{key:bo,event:Ra,refId:pc}=typeof Ai=="string"&&H$1(Ai)?at$1(Ai,b$1.CHANNEL_OPTIONS||{}):Ai;if(bo===Gt$1){let mc=this.config.page==="manager"?'<span style="color: #37D5D3; background: black"> manager </span>':'<span style="color: #1EA7FD; background: black"> preview </span>',uf=Object.values(Qn$1).includes(Ra.type)?`<span style="color: #FF4785">${Ra.type}</span>`:`<span style="color: #FFAE00">${Ra.type}</span>`;if(pc&&(Ra.refId=pc),Ra.source=this.config.page==="preview"?vo.origin:Bt$1(vo),!Ra.source){r$3.error(`${mc} received ${uf} but was unable to determine the source of the event`);return}let df=`${mc} received ${uf} (${Ai.length})`;r$3.debug(vt$1.origin!==Ra.source?df:`${df} <span style="color: gray">(on ${vt$1.origin} from ${Ra.source})</span>`,...Ra.args),q$2(this.handler,"ChannelHandler should be set"),this.handler(Ra)}}catch(Ai){s$3.error(Ai)}}};i$2(_t$1,"PostMessageTransport");var G$2=_t$1,{WebSocket:eo$1}=b$1,bt=class{constructor({url:vo,onError:Ai,page:bo}){this.buffer=[],this.isReady=!1,this.socket=new eo$1(vo),this.socket.onopen=()=>{this.isReady=!0,this.flush()},this.socket.onmessage=({data:Ra})=>{let pc=typeof Ra=="string"&&H$1(Ra)?at$1(Ra):Ra;q$2(this.handler,"WebsocketTransport handler should be set"),this.handler(pc)},this.socket.onerror=Ra=>{Ai&&Ai(Ra)},this.socket.onclose=()=>{q$2(this.handler,"WebsocketTransport handler should be set"),this.handler({type:S$2,args:[],from:bo||"preview"})}}setHandler(vo){this.handler=vo}send(vo){this.isReady?this.sendNow(vo):this.sendLater(vo)}sendLater(vo){this.buffer.push(vo)}sendNow(vo){let Ai=ot(vo,{maxDepth:15,allowFunction:!1,...b$1.CHANNEL_OPTIONS});this.socket.send(Ai)}flush(){let{buffer:vo}=this;this.buffer=[],vo.forEach(Ai=>this.send(Ai))}};i$2(bt,"WebsocketTransport");var J$1=bt,{CONFIG_TYPE:ro}=b$1;function $o$1({page:vo,extraTransports:Ai=[]}){let bo=[new G$2({page:vo}),...Ai];if(ro==="DEVELOPMENT"){let Ra=window.location.protocol==="http:"?"ws":"wss",{hostname:pc,port:mc}=window.location,uf=`${Ra}://${pc}:${mc}/storybook-server-channel`;bo.push(new J$1({url:uf,onError:i$2(()=>{},"onError"),page:vo}))}return new z$2({transports:bo})}i$2($o$1,"createBrowserChannel");var oe$1=Object.defineProperty,t$3=(vo,Ai)=>oe$1(vo,"name",{value:Ai,configurable:!0});function r$1(vo){for(var Ai=[],bo=1;bo<arguments.length;bo++)Ai[bo-1]=arguments[bo];var Ra=Array.from(typeof vo=="string"?[vo]:vo);Ra[Ra.length-1]=Ra[Ra.length-1].replace(/\r?\n([\t ]*)$/,"");var pc=Ra.reduce(function(df,ff){var hf=ff.match(/\n([\t ]+|(?!\s).)/g);return hf?df.concat(hf.map(function(pf){var mf,gf;return(gf=(mf=pf.match(/[\t ]/g))===null||mf===void 0?void 0:mf.length)!==null&&gf!==void 0?gf:0})):df},[]);if(pc.length){var mc=new RegExp(`
|
|
85
|
-
[ ]{`+Math.min.apply(Math,pc)+"}","g");Ra=Ra.map(function(df){return df.replace(mc,`
|
|
86
|
-
`)})}Ra[0]=Ra[0].replace(/^\r?\n/,"");var uf=Ra[0];return Ai.forEach(function(df,ff){var hf=uf.match(/(?:^|\n)( *)$/),pf=hf?hf[1]:"",mf=df;typeof df=="string"&&df.includes(`
|
|
87
|
-
`)&&(mf=String(df).split(`
|
|
88
|
-
`).map(function(gf,yf){return yf===0?gf:""+pf+gf}).join(`
|
|
89
|
-
`)),uf+=mf+Ra[ff+1]}),uf}t$3(r$1,"dedent");function C$2({code:vo,category:Ai}){let bo=String(vo).padStart(4,"0");return`SB_${Ai}_${bo}`}t$3(C$2,"parseErrorCode");var p$1=class AT extends Error{constructor(Ai){super(AT.getFullMessage(Ai)),this.data={},this.fromStorybook=!0,this.category=Ai.category,this.documentation=Ai.documentation??!1,this.code=Ai.code}get fullErrorCode(){return C$2({code:this.code,category:this.category})}get name(){let Ai=this.constructor.name;return`${this.fullErrorCode} (${Ai})`}static getFullMessage({documentation:Ai,code:bo,category:Ra,message:pc}){let mc;return Ai===!0?mc=`https://storybook.js.org/error/${C$2({code:bo,category:Ra})}`:typeof Ai=="string"?mc=Ai:Array.isArray(Ai)&&(mc=`
|
|
90
|
-
${Ai.map(uf=>` - ${uf}`).join(`
|
|
91
|
-
`)}`),`${pc}${mc!=null?`
|
|
92
|
-
|
|
93
|
-
More info: ${mc}
|
|
94
|
-
`:""}`}};t$3(p$1,"StorybookError");var o$1=p$1,f$1=class extends o$1{constructor(vo){super({category:"PREVIEW_API",code:1,message:r$1`
|
|
95
|
-
Couldn't find story matching id '${vo.storyId}' after HMR.
|
|
96
|
-
- Did you just rename a story?
|
|
97
|
-
- Did you remove it from your CSF file?
|
|
98
|
-
- Are you sure a story with the id '${vo.storyId}' exists?
|
|
99
|
-
- Please check the values in the stories field of your main.js config and see if they would match your CSF File.
|
|
100
|
-
- Also check the browser console and terminal for potential error messages.`}),this.data=vo}};t$3(f$1,"MissingStoryAfterHmrError");var D$1=f$1,R$1=class extends o$1{constructor(vo){super({category:"PREVIEW_API",code:2,documentation:"https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#using-implicit-actions-during-rendering-is-deprecated-for-example-in-the-play-function",message:r$1`
|
|
101
|
-
We detected that you use an implicit action arg while ${vo.phase} of your story.
|
|
102
|
-
${vo.deprecated?`
|
|
103
|
-
This is deprecated and won't work in Storybook 8 anymore.
|
|
104
|
-
`:""}
|
|
105
|
-
Please provide an explicit spy to your args like this:
|
|
106
|
-
import { fn } from '@storybook/test';
|
|
107
|
-
...
|
|
108
|
-
args: {
|
|
109
|
-
${vo.name}: fn()
|
|
110
|
-
}`}),this.data=vo}};t$3(R$1,"ImplicitActionsDuringRendering");var b=class extends o$1{constructor(){super({category:"PREVIEW_API",code:3,message:r$1`
|
|
111
|
-
Cannot call \`storyStore.extract()\` without calling \`storyStore.cacheAllCsfFiles()\` first.
|
|
112
|
-
|
|
113
|
-
You probably meant to call \`await preview.extract()\` which does the above for you.`})}};t$3(b,"CalledExtractOnStoreError");var L$1=b,I$1=class extends o$1{constructor(){super({category:"PREVIEW_API",code:4,message:r$1`
|
|
114
|
-
Expected your framework's preset to export a \`renderToCanvas\` field.
|
|
115
|
-
|
|
116
|
-
Perhaps it needs to be upgraded for Storybook 7.0?`,documentation:"https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#mainjs-framework-field"})}};t$3(I$1,"MissingRenderToCanvasError");var G$1=I$1,P$2=class extends o$1{constructor(vo){super({category:"PREVIEW_API",code:5,message:r$1`
|
|
117
|
-
Called \`Preview.${vo.methodName}()\` before initialization.
|
|
118
|
-
|
|
119
|
-
The preview needs to load the story index before most methods can be called. If you want
|
|
120
|
-
to call \`${vo.methodName}\`, try \`await preview.initializationPromise;\` first.
|
|
121
|
-
|
|
122
|
-
If you didn't call the above code, then likely it was called by an addon that needs to
|
|
123
|
-
do the above.`}),this.data=vo}};t$3(P$2,"CalledPreviewMethodBeforeInitializationError");var Y$1=P$2,x$1=class extends o$1{constructor(vo){super({category:"PREVIEW_API",code:6,message:r$1`
|
|
124
|
-
Error fetching \`/index.json\`:
|
|
125
|
-
|
|
126
|
-
${vo.text}
|
|
127
|
-
|
|
128
|
-
If you are in development, this likely indicates a problem with your Storybook process,
|
|
129
|
-
check the terminal for errors.
|
|
130
|
-
|
|
131
|
-
If you are in a deployed Storybook, there may have been an issue deploying the full Storybook
|
|
132
|
-
build.`}),this.data=vo}};t$3(x$1,"StoryIndexFetchError");var M$2=x$1,T=class extends o$1{constructor(vo){super({category:"PREVIEW_API",code:7,message:r$1`
|
|
133
|
-
Tried to render docs entry ${vo.storyId} but it is a MDX file that has no CSF
|
|
134
|
-
references, or autodocs for a CSF file that some doesn't refer to itself.
|
|
135
|
-
|
|
136
|
-
This likely is an internal error in Storybook's indexing, or you've attached the
|
|
137
|
-
\`attached-mdx\` tag to an MDX file that is not attached.`}),this.data=vo}};t$3(T,"MdxFileWithNoCsfReferencesError");var H=T,w$1=class extends o$1{constructor(){super({category:"PREVIEW_API",code:8,message:r$1`
|
|
138
|
-
Couldn't find any stories in your Storybook.
|
|
139
|
-
|
|
140
|
-
- Please check your stories field of your main.js config: does it match correctly?
|
|
141
|
-
- Also check the browser console and terminal for error messages.`})}};t$3(w$1,"EmptyIndexError");var F$2=w$1,k$2=class extends o$1{constructor(vo){super({category:"PREVIEW_API",code:9,message:r$1`
|
|
142
|
-
Couldn't find story matching '${vo.storySpecifier}'.
|
|
143
|
-
|
|
144
|
-
- Are you sure a story with that id exists?
|
|
145
|
-
- Please check your stories field of your main.js config.
|
|
146
|
-
- Also check the browser console and terminal for error messages.`}),this.data=vo}};t$3(k$2,"NoStoryMatchError");var K$1=k$2,S$1=class extends o$1{constructor(vo){super({category:"PREVIEW_API",code:10,message:r$1`
|
|
147
|
-
Couldn't find story matching id '${vo.storyId}' after importing a CSF file.
|
|
148
|
-
|
|
149
|
-
The file was indexed as if the story was there, but then after importing the file in the browser
|
|
150
|
-
we didn't find the story. Possible reasons:
|
|
151
|
-
- You are using a custom story indexer that is misbehaving.
|
|
152
|
-
- You have a custom file loader that is removing or renaming exports.
|
|
153
|
-
|
|
154
|
-
Please check your browser console and terminal for errors that may explain the issue.`}),this.data=vo}};t$3(S$1,"MissingStoryFromCsfFileError");var X$1=S$1,v$2=class extends o$1{constructor(){super({category:"PREVIEW_API",code:11,message:r$1`
|
|
155
|
-
Cannot access the Story Store until the index is ready.
|
|
156
|
-
|
|
157
|
-
It is not recommended to use methods directly on the Story Store anyway, in Storybook 9 we will
|
|
158
|
-
remove access to the store entirely`})}};t$3(v$2,"StoryStoreAccessedBeforeInitializationError");var U$1=v$2,_=class extends o$1{constructor(vo){super({category:"PREVIEW_API",code:12,message:r$1`
|
|
159
|
-
Incorrect use of mount in the play function.
|
|
160
|
-
|
|
161
|
-
To use mount in the play function, you must satisfy the following two requirements:
|
|
162
|
-
|
|
163
|
-
1. You *must* destructure the mount property from the \`context\` (the argument passed to your play function).
|
|
164
|
-
This makes sure that Storybook does not start rendering the story before the play function begins.
|
|
165
|
-
|
|
166
|
-
2. Your Storybook framework or builder must be configured to transpile to ES2017 or newer.
|
|
167
|
-
This is because destructuring statements and async/await usages are otherwise transpiled away,
|
|
168
|
-
which prevents Storybook from recognizing your usage of \`mount\`.
|
|
169
|
-
|
|
170
|
-
Note that Angular is not supported. As async/await is transpiled to support the zone.js polyfill.
|
|
171
|
-
|
|
172
|
-
More info: https://storybook.js.org/docs/writing-tests/interaction-testing#run-code-before-the-component-gets-rendered
|
|
173
|
-
|
|
174
|
-
Received the following play function:
|
|
175
|
-
${vo.playFunction}`}),this.data=vo}};t$3(_,"MountMustBeDestructuredError");var J=_,V=class extends o$1{constructor(vo){super({category:"PREVIEW_API",code:14,message:r$1`
|
|
176
|
-
No render function available for storyId '${vo.id}'
|
|
177
|
-
`}),this.data=vo}};t$3(V,"NoRenderFunctionError");var q$1=V,N$1=class extends o$1{constructor(){super({category:"PREVIEW_API",code:15,message:r$1`
|
|
178
|
-
No component is mounted in your story.
|
|
179
|
-
|
|
180
|
-
This usually occurs when you destructure mount in the play function, but forget to call it.
|
|
181
|
-
|
|
182
|
-
For example:
|
|
183
|
-
|
|
184
|
-
async play({ mount, canvasElement }) {
|
|
185
|
-
// 👈 mount should be called: await mount();
|
|
186
|
-
const canvas = within(canvasElement);
|
|
187
|
-
const button = await canvas.findByRole('button');
|
|
188
|
-
await userEvent.click(button);
|
|
189
|
-
};
|
|
190
|
-
|
|
191
|
-
Make sure to either remove it or call mount in your play function.
|
|
192
|
-
`})}};t$3(N$1,"NoStoryMountedError");var z$1=N$1,A=class extends o$1{constructor(){super({category:"FRAMEWORK_NEXTJS",code:1,documentation:"https://storybook.js.org/docs/get-started/nextjs#faq",message:r$1`
|
|
193
|
-
You are importing avif images, but you don't have sharp installed.
|
|
194
|
-
|
|
195
|
-
You have to install sharp in order to use image optimization features in Next.js.
|
|
196
|
-
`})}};t$3(A,"NextJsSharpError");var W=class extends o$1{constructor(vo){super({category:"FRAMEWORK_NEXTJS",code:2,message:r$1`
|
|
197
|
-
Tried to access router mocks from "${vo.importType}" but they were not created yet. You might be running code in an unsupported environment.
|
|
198
|
-
`}),this.data=vo}};t$3(W,"NextjsRouterMocksNotAvailable");var $$1=class extends o$1{constructor(vo){super({category:"DOCS-TOOLS",code:1,documentation:"https://github.com/storybookjs/storybook/issues/26606",message:r$1`
|
|
199
|
-
There was a failure when generating detailed ArgTypes in ${vo.language} for:
|
|
200
|
-
${JSON.stringify(vo.type,null,2)}
|
|
201
|
-
|
|
202
|
-
Storybook will fall back to use a generic type description instead.
|
|
203
|
-
|
|
204
|
-
This type is either not supported or it is a bug in the docgen generation in Storybook.
|
|
205
|
-
If you think this is a bug, please detail it as much as possible in the Github issue.
|
|
206
|
-
`}),this.data=vo}};t$3($$1,"UnknownArgTypesError");var O$2=class extends o$1{constructor(vo){super({category:"ADDON_VITEST",code:1,message:r$1`
|
|
207
|
-
Encountered an unsupported value "${vo.value}" when setting the viewport ${vo.dimension} dimension.
|
|
208
|
-
|
|
209
|
-
The Storybook plugin only supports values in the following units:
|
|
210
|
-
- px, vh, vw, em, rem and %.
|
|
211
|
-
|
|
212
|
-
You can either change the viewport for this story to use one of the supported units or skip the test by adding '!test' to the story's tags per https://storybook.js.org/docs/writing-stories/tags
|
|
213
|
-
`}),this.data=vo}};t$3(O$2,"UnsupportedViewportDimensionError");var C$1=Object.create,u=Object.defineProperty,B=Object.getOwnPropertyDescriptor,F$1=Object.getOwnPropertyNames,h=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty,E=(vo,Ai)=>()=>(Ai||vo((Ai={exports:{}}).exports,Ai),Ai.exports),v$1=(vo,Ai,bo,Ra)=>{if(Ai&&typeof Ai=="object"||typeof Ai=="function")for(let pc of F$1(Ai))!w.call(vo,pc)&&pc!==bo&&u(vo,pc,{get:()=>Ai[pc],enumerable:!(Ra=B(Ai,pc))||Ra.enumerable});return vo},I=(vo,Ai,bo)=>(bo=vo!=null?C$1(h(vo)):{},v$1(!vo||!vo.__esModule?u(bo,"default",{value:vo,enumerable:!0}):bo,vo)),x=E(vo=>{Object.defineProperty(vo,"__esModule",{value:!0}),vo.isEqual=function(){var Ai=Object.prototype.toString,bo=Object.getPrototypeOf,Ra=Object.getOwnPropertySymbols?function(pc){return Object.keys(pc).concat(Object.getOwnPropertySymbols(pc))}:Object.keys;return function(pc,mc){return function uf(df,ff,hf){var pf,mf,gf,yf=Ai.call(df),vf=Ai.call(ff);if(df===ff)return!0;if(df==null||ff==null)return!1;if(hf.indexOf(df)>-1&&hf.indexOf(ff)>-1)return!0;if(hf.push(df,ff),yf!=vf||(pf=Ra(df),mf=Ra(ff),pf.length!=mf.length||pf.some(function(bf){return!uf(df[bf],ff[bf],hf)})))return!1;switch(yf.slice(8,-1)){case"Symbol":return df.valueOf()==ff.valueOf();case"Date":case"Number":return+df==+ff||+df!=+df&&+ff!=+ff;case"RegExp":case"Function":case"String":case"Boolean":return""+df==""+ff;case"Set":case"Map":pf=df.entries(),mf=ff.entries();do if(!uf((gf=pf.next()).value,mf.next().value,hf))return!1;while(!gf.done);return!0;case"ArrayBuffer":df=new Uint8Array(df),ff=new Uint8Array(ff);case"DataView":df=new Uint8Array(df.buffer),ff=new Uint8Array(ff.buffer);case"Float32Array":case"Float64Array":case"Int8Array":case"Int16Array":case"Int32Array":case"Uint8Array":case"Uint16Array":case"Uint32Array":case"Uint8ClampedArray":case"Arguments":case"Array":if(df.length!=ff.length)return!1;for(gf=0;gf<df.length;gf++)if((gf in df||gf in ff)&&(gf in df!=gf in ff||!uf(df[gf],ff[gf],hf)))return!1;return!0;case"Object":return uf(bo(df),bo(ff),hf);default:return!1}}(pc,mc,[])}}()});function R(vo){return vo.replace(/_/g," ").replace(/-/g," ").replace(/\./g," ").replace(/([^\n])([A-Z])([a-z])/g,(Ai,bo,Ra,pc)=>`${bo} ${Ra}${pc}`).replace(/([a-z])([A-Z])/g,(Ai,bo,Ra)=>`${bo} ${Ra}`).replace(/([a-z])([0-9])/gi,(Ai,bo,Ra)=>`${bo} ${Ra}`).replace(/([0-9])([a-z])/gi,(Ai,bo,Ra)=>`${bo} ${Ra}`).replace(/(\s|^)(\w)/g,(Ai,bo,Ra)=>`${bo}${Ra.toUpperCase()}`).replace(/ +/g," ").trim()}var l=I(x()),S=vo=>vo.map(Ai=>typeof Ai<"u").filter(Boolean).length,k$1=(vo,Ai)=>{let{exists:bo,eq:Ra,neq:pc,truthy:mc}=vo;if(S([bo,Ra,pc,mc])>1)throw new Error(`Invalid conditional test ${JSON.stringify({exists:bo,eq:Ra,neq:pc})}`);if(typeof Ra<"u")return(0,l.isEqual)(Ai,Ra);if(typeof pc<"u")return!(0,l.isEqual)(Ai,pc);if(typeof bo<"u"){let uf=typeof Ai<"u";return bo?uf:!uf}return typeof mc>"u"||mc?!!Ai:!Ai},P$1=(vo,Ai,bo)=>{if(!vo.if)return!0;let{arg:Ra,global:pc}=vo.if;if(S([Ra,pc])!==1)throw new Error(`Invalid conditional value ${JSON.stringify({arg:Ra,global:pc})}`);let mc=Ra?Ai[Ra]:bo[pc];return k$1(vo.if,mc)},O$1=vo=>vo.toLowerCase().replace(/[ ’–—―′¿'`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi,"-").replace(/-+/g,"-").replace(/^-+/,"").replace(/-+$/,""),f=(vo,Ai)=>{let bo=O$1(vo);if(bo==="")throw new Error(`Invalid ${Ai} '${vo}', must include alphanumeric characters`);return bo},G=(vo,Ai)=>`${f(vo,"kind")}${Ai?`--${f(Ai,"name")}`:""}`,N=vo=>R(vo);function m$3(vo,Ai){return Array.isArray(Ai)?Ai.includes(vo):vo.match(Ai)}function M$1(vo,{includeStories:Ai,excludeStories:bo}){return vo!=="__esModule"&&(!Ai||m$3(vo,Ai))&&(!bo||!m$3(vo,bo))}var z=(...vo)=>{let Ai=vo.reduce((bo,Ra)=>(Ra.startsWith("!")?bo.delete(Ra.slice(1)):bo.add(Ra),bo),new Set);return Array.from(Ai)},On=Object.create,ur=Object.defineProperty,Dn=Object.getOwnPropertyDescriptor,kn=Object.getOwnPropertyNames,jn=Object.getPrototypeOf,Mn=Object.prototype.hasOwnProperty,s$1=(vo,Ai)=>ur(vo,"name",{value:Ai,configurable:!0}),Re=(vo=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(vo,{get:(Ai,bo)=>(typeof require<"u"?require:Ai)[bo]}):vo)(function(vo){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+vo+'" is not supported')}),O=(vo,Ai)=>()=>(Ai||vo((Ai={exports:{}}).exports,Ai),Ai.exports),_n=(vo,Ai,bo,Ra)=>{if(Ai&&typeof Ai=="object"||typeof Ai=="function")for(let pc of kn(Ai))!Mn.call(vo,pc)&&pc!==bo&&ur(vo,pc,{get:()=>Ai[pc],enumerable:!(Ra=Dn(Ai,pc))||Ra.enumerable});return vo},ce=(vo,Ai,bo)=>(bo=vo!=null?On(jn(vo)):{},_n(ur(bo,"default",{value:vo,enumerable:!0}),vo)),Ir=O((vo,Ai)=>{(function(bo){if(typeof vo=="object"&&typeof Ai<"u")Ai.exports=bo();else if(typeof define=="function"&&define.amd)define([],bo);else{var Ra;typeof window<"u"?Ra=window:typeof global<"u"?Ra=global:typeof self<"u"?Ra=self:Ra=this,Ra.memoizerific=bo()}})(function(){return s$1(function bo(Ra,pc,mc){function uf(hf,pf){if(!pc[hf]){if(!Ra[hf]){var mf=typeof Re=="function"&ℜif(!pf&&mf)return mf(hf,!0);if(df)return df(hf,!0);var gf=new Error("Cannot find module '"+hf+"'");throw gf.code="MODULE_NOT_FOUND",gf}var yf=pc[hf]={exports:{}};Ra[hf][0].call(yf.exports,function(vf){var bf=Ra[hf][1][vf];return uf(bf||vf)},yf,yf.exports,bo,Ra,pc,mc)}return pc[hf].exports}s$1(uf,"s");for(var df=typeof Re=="function"&&Re,ff=0;ff<mc.length;ff++)uf(mc[ff]);return uf},"e")({1:[function(bo,Ra,pc){Ra.exports=function(mc){if(typeof Map!="function"||mc){var uf=bo("./similar");return new uf}else return new Map}},{"./similar":2}],2:[function(bo,Ra,pc){function mc(){return this.list=[],this.lastItem=void 0,this.size=0,this}s$1(mc,"Similar"),mc.prototype.get=function(uf){var df;if(this.lastItem&&this.isEqual(this.lastItem.key,uf))return this.lastItem.val;if(df=this.indexOf(uf),df>=0)return this.lastItem=this.list[df],this.list[df].val},mc.prototype.set=function(uf,df){var ff;return this.lastItem&&this.isEqual(this.lastItem.key,uf)?(this.lastItem.val=df,this):(ff=this.indexOf(uf),ff>=0?(this.lastItem=this.list[ff],this.list[ff].val=df,this):(this.lastItem={key:uf,val:df},this.list.push(this.lastItem),this.size++,this))},mc.prototype.delete=function(uf){var df;if(this.lastItem&&this.isEqual(this.lastItem.key,uf)&&(this.lastItem=void 0),df=this.indexOf(uf),df>=0)return this.size--,this.list.splice(df,1)[0]},mc.prototype.has=function(uf){var df;return this.lastItem&&this.isEqual(this.lastItem.key,uf)?!0:(df=this.indexOf(uf),df>=0?(this.lastItem=this.list[df],!0):!1)},mc.prototype.forEach=function(uf,df){var ff;for(ff=0;ff<this.size;ff++)uf.call(df||this,this.list[ff].val,this.list[ff].key,this)},mc.prototype.indexOf=function(uf){var df;for(df=0;df<this.size;df++)if(this.isEqual(this.list[df].key,uf))return df;return-1},mc.prototype.isEqual=function(uf,df){return uf===df||uf!==uf&&df!==df},Ra.exports=mc},{}],3:[function(bo,Ra,pc){var mc=bo("map-or-similar");Ra.exports=function(hf){var pf=new mc(!1),mf=[];return function(gf){var yf=s$1(function(){var vf=pf,bf,Sf,xf=arguments.length-1,wf=Array(xf+1),If=!0,l1;if((yf.numArgs||yf.numArgs===0)&&yf.numArgs!==xf+1)throw new Error("Memoizerific functions should always be called with the same number of arguments");for(l1=0;l1<xf;l1++){if(wf[l1]={cacheItem:vf,arg:arguments[l1]},vf.has(arguments[l1])){vf=vf.get(arguments[l1]);continue}If=!1,bf=new mc(!1),vf.set(arguments[l1],bf),vf=bf}return If&&(vf.has(arguments[xf])?Sf=vf.get(arguments[xf]):If=!1),If||(Sf=gf.apply(null,arguments),vf.set(arguments[xf],Sf)),hf>0&&(wf[xf]={cacheItem:vf,arg:arguments[xf]},If?uf(mf,wf):mf.push(wf),mf.length>hf&&df(mf.shift())),yf.wasMemoized=If,yf.numArgs=xf+1,Sf},"memoizerific");return yf.limit=hf,yf.wasMemoized=!1,yf.cache=pf,yf.lru=mf,yf}};function uf(hf,pf){var mf=hf.length,gf=pf.length,yf,vf,bf;for(vf=0;vf<mf;vf++){for(yf=!0,bf=0;bf<gf;bf++)if(!ff(hf[vf][bf].arg,pf[bf].arg)){yf=!1;break}if(yf)break}hf.push(hf.splice(vf,1)[0])}s$1(uf,"moveToMostRecentLru");function df(hf){var pf=hf.length,mf=hf[pf-1],gf,yf;for(mf.cacheItem.delete(mf.arg),yf=pf-2;yf>=0&&(mf=hf[yf],gf=mf.cacheItem.get(mf.arg),!gf||!gf.size);yf--)mf.cacheItem.delete(mf.arg)}s$1(df,"removeCachedResult");function ff(hf,pf){return hf===pf||hf!==hf&&pf!==pf}s$1(ff,"isEqual")},{"map-or-similar":1}]},{},[3])(3)})}),et=O(vo=>{Object.defineProperty(vo,"__esModule",{value:!0}),vo.encodeString=Ra;var Ai=Array.from({length:256},(pc,mc)=>"%"+((mc<16?"0":"")+mc.toString(16)).toUpperCase()),bo=new Int8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,1,1,1,0,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,0]);function Ra(pc){let mc=pc.length;if(mc===0)return"";let uf="",df=0,ff=0;e:for(;ff<mc;ff++){let hf=pc.charCodeAt(ff);for(;hf<128;){if(bo[hf]!==1&&(df<ff&&(uf+=pc.slice(df,ff)),df=ff+1,uf+=Ai[hf]),++ff===mc)break e;hf=pc.charCodeAt(ff)}if(df<ff&&(uf+=pc.slice(df,ff)),hf<2048){df=ff+1,uf+=Ai[192|hf>>6]+Ai[128|hf&63];continue}if(hf<55296||hf>=57344){df=ff+1,uf+=Ai[224|hf>>12]+Ai[128|hf>>6&63]+Ai[128|hf&63];continue}if(++ff,ff>=mc)throw new Error("URI malformed");let pf=pc.charCodeAt(ff)&1023;df=ff+1,hf=65536+((hf&1023)<<10|pf),uf+=Ai[240|hf>>18]+Ai[128|hf>>12&63]+Ai[128|hf>>6&63]+Ai[128|hf&63]}return df===0?pc:df<mc?uf+pc.slice(df):uf}s$1(Ra,"encodeString")}),Qe=O(vo=>{Object.defineProperty(vo,"__esModule",{value:!0}),vo.defaultOptions=vo.defaultShouldSerializeObject=vo.defaultValueSerializer=void 0;var Ai=et(),bo=s$1(mc=>{switch(typeof mc){case"string":return(0,Ai.encodeString)(mc);case"bigint":case"boolean":return""+mc;case"number":if(Number.isFinite(mc))return mc<1e21?""+mc:(0,Ai.encodeString)(""+mc);break}return mc instanceof Date?(0,Ai.encodeString)(mc.toISOString()):""},"defaultValueSerializer");vo.defaultValueSerializer=bo;var Ra=s$1(mc=>mc instanceof Date,"defaultShouldSerializeObject");vo.defaultShouldSerializeObject=Ra;var pc=s$1(mc=>mc,"identityFunc");vo.defaultOptions={nesting:!0,nestingSyntax:"dot",arrayRepeat:!1,arrayRepeatSyntax:"repeat",delimiter:38,valueDeserializer:pc,valueSerializer:vo.defaultValueSerializer,keyDeserializer:pc,shouldSerializeObject:vo.defaultShouldSerializeObject}}),tt=O(vo=>{Object.defineProperty(vo,"__esModule",{value:!0}),vo.getDeepObject=pc,vo.stringifyObject=pf;var Ai=Qe(),bo=et();function Ra(mf){return mf==="__proto__"||mf==="constructor"||mf==="prototype"}s$1(Ra,"isPrototypeKey");function pc(mf,gf,yf,vf,bf){if(Ra(gf))return mf;let Sf=mf[gf];return typeof Sf=="object"&&Sf!==null?Sf:!vf&&(bf||typeof yf=="number"||typeof yf=="string"&&yf*0===0&&yf.indexOf(".")===-1)?mf[gf]=[]:mf[gf]={}}s$1(pc,"getDeepObject");var mc=20,uf="[]",df="[",ff="]",hf=".";function pf(mf,gf,yf=0,vf,bf){let{nestingSyntax:Sf=Ai.defaultOptions.nestingSyntax,arrayRepeat:xf=Ai.defaultOptions.arrayRepeat,arrayRepeatSyntax:wf=Ai.defaultOptions.arrayRepeatSyntax,nesting:If=Ai.defaultOptions.nesting,delimiter:l1=Ai.defaultOptions.delimiter,valueSerializer:s1=Ai.defaultOptions.valueSerializer,shouldSerializeObject:c1=Ai.defaultOptions.shouldSerializeObject}=gf,u1=typeof l1=="number"?String.fromCharCode(l1):l1,T1=bf===!0&&xf,_1=Sf==="dot"||Sf==="js"&&!bf;if(yf>mc)return"";let R1="",P1=!0,E1=!1;for(let M1 in mf){let m1=mf[M1],$1;vf?($1=vf,T1?wf==="bracket"&&($1+=uf):_1?($1+=hf,$1+=M1):($1+=df,$1+=M1,$1+=ff)):$1=M1,P1||(R1+=u1),typeof m1=="object"&&m1!==null&&!c1(m1)?(E1=m1.pop!==void 0,(If||xf&&E1)&&(R1+=pf(m1,gf,yf+1,$1,E1))):(R1+=(0,bo.encodeString)($1),R1+="=",R1+=s1(m1,M1)),P1&&(P1=!1)}return R1}s$1(pf,"stringifyObject")}),Mo=O((vo,Ai)=>{var bo=12,Ra=0,pc=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,7,7,7,7,7,7,7,7,7,7,7,7,8,7,7,10,9,9,9,11,4,4,4,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,24,36,48,60,72,84,96,0,12,12,12,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,24,24,24,0,0,0,0,0,0,0,0,0,24,24,0,0,0,0,0,0,0,0,0,0,48,48,48,0,0,0,0,0,0,0,0,0,0,48,48,0,0,0,0,0,0,0,0,0,48,0,0,0,0,0,0,0,0,0,0,127,63,63,63,0,31,15,15,15,7,7,7];function mc(ff){var hf=ff.indexOf("%");if(hf===-1)return ff;for(var pf=ff.length,mf="",gf=0,yf=0,vf=hf,bf=bo;hf>-1&&hf<pf;){var Sf=df(ff[hf+1],4),xf=df(ff[hf+2],0),wf=Sf|xf,If=pc[wf];if(bf=pc[256+bf+If],yf=yf<<6|wf&pc[364+If],bf===bo)mf+=ff.slice(gf,vf),mf+=yf<=65535?String.fromCharCode(yf):String.fromCharCode(55232+(yf>>10),56320+(yf&1023)),yf=0,gf=hf+3,hf=vf=ff.indexOf("%",gf);else{if(bf===Ra)return null;if(hf+=3,hf<pf&&ff.charCodeAt(hf)===37)continue;return null}}return mf+ff.slice(gf)}s$1(mc,"decodeURIComponent");var uf={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};function df(ff,hf){var pf=uf[ff];return pf===void 0?255:pf<<hf}s$1(df,"hexCodeToInt"),Ai.exports=mc}),qo=O(vo=>{var Ai=vo&&vo.__importDefault||function(mf){return mf&&mf.__esModule?mf:{default:mf}};Object.defineProperty(vo,"__esModule",{value:!0}),vo.numberValueDeserializer=vo.numberKeyDeserializer=void 0,vo.parse=pf;var bo=tt(),Ra=Qe(),pc=Ai(Mo()),mc=s$1(mf=>{let gf=Number(mf);return Number.isNaN(gf)?mf:gf},"numberKeyDeserializer");vo.numberKeyDeserializer=mc;var uf=s$1(mf=>{let gf=Number(mf);return Number.isNaN(gf)?mf:gf},"numberValueDeserializer");vo.numberValueDeserializer=uf;var df=/\+/g,ff=s$1(function(){},"Empty");ff.prototype=Object.create(null);function hf(mf,gf,yf,vf,bf){let Sf=mf.substring(gf,yf);return vf&&(Sf=Sf.replace(df," ")),bf&&(Sf=(0,pc.default)(Sf)||Sf),Sf}s$1(hf,"computeKeySlice");function pf(mf,gf){let{valueDeserializer:yf=Ra.defaultOptions.valueDeserializer,keyDeserializer:vf=Ra.defaultOptions.keyDeserializer,arrayRepeatSyntax:bf=Ra.defaultOptions.arrayRepeatSyntax,nesting:Sf=Ra.defaultOptions.nesting,arrayRepeat:xf=Ra.defaultOptions.arrayRepeat,nestingSyntax:wf=Ra.defaultOptions.nestingSyntax,delimiter:If=Ra.defaultOptions.delimiter}=gf??{},l1=typeof If=="string"?If.charCodeAt(0):If,s1=wf==="js",c1=new ff;if(typeof mf!="string")return c1;let u1=mf.length,T1="",_1=-1,R1=-1,P1=-1,E1=c1,M1,m1="",$1="",k1=!1,F1=!1,U1=!1,B1=!1,W1=!1,Z1=!1,O1=!1,j1=0,L1=-1,G1=-1,Y1=-1;for(let z1=0;z1<u1+1;z1++){if(j1=z1!==u1?mf.charCodeAt(z1):l1,j1===l1){if(O1=R1>_1,O1||(R1=z1),P1!==R1-1&&($1=hf(mf,P1+1,L1>-1?L1:R1,U1,k1),m1=vf($1),M1!==void 0&&(E1=(0,bo.getDeepObject)(E1,M1,m1,s1&&W1,s1&&Z1))),O1||m1!==""){O1&&(T1=mf.slice(R1+1,z1),B1&&(T1=T1.replace(df," ")),F1&&(T1=(0,pc.default)(T1)||T1));let K1=yf(T1,m1);if(xf){let tT=E1[m1];tT===void 0?L1>-1?E1[m1]=[K1]:E1[m1]=K1:tT.pop?tT.push(K1):E1[m1]=[tT,K1]}else E1[m1]=K1}T1="",_1=z1,R1=z1,k1=!1,F1=!1,U1=!1,B1=!1,W1=!1,Z1=!1,L1=-1,P1=z1,E1=c1,M1=void 0,m1=""}else j1===93?(xf&&bf==="bracket"&&Y1===91&&(L1=G1),Sf&&(wf==="index"||s1)&&R1<=_1&&(P1!==G1&&($1=hf(mf,P1+1,z1,U1,k1),m1=vf($1),M1!==void 0&&(E1=(0,bo.getDeepObject)(E1,M1,m1,void 0,s1)),M1=m1,U1=!1,k1=!1),P1=z1,Z1=!0,W1=!1)):j1===46?Sf&&(wf==="dot"||s1)&&R1<=_1&&(P1!==G1&&($1=hf(mf,P1+1,z1,U1,k1),m1=vf($1),M1!==void 0&&(E1=(0,bo.getDeepObject)(E1,M1,m1,s1)),M1=m1,U1=!1,k1=!1),W1=!0,Z1=!1,P1=z1):j1===91?Sf&&(wf==="index"||s1)&&R1<=_1&&(P1!==G1&&($1=hf(mf,P1+1,z1,U1,k1),m1=vf($1),s1&&M1!==void 0&&(E1=(0,bo.getDeepObject)(E1,M1,m1,s1)),M1=m1,U1=!1,k1=!1,W1=!1,Z1=!0),P1=z1):j1===61?R1<=_1?R1=z1:F1=!0:j1===43?R1>_1?B1=!0:U1=!0:j1===37&&(R1>_1?F1=!0:k1=!0);G1=z1,Y1=j1}return c1}s$1(pf,"parse")}),Bo=O(vo=>{Object.defineProperty(vo,"__esModule",{value:!0}),vo.stringify=bo;var Ai=tt();function bo(Ra,pc){if(Ra===null||typeof Ra!="object")return"";let mc=pc??{};return(0,Ai.stringifyObject)(Ra,mc)}s$1(bo,"stringify")}),tr=O(vo=>{var Ai=vo&&vo.__createBinding||(Object.create?function(mc,uf,df,ff){ff===void 0&&(ff=df);var hf=Object.getOwnPropertyDescriptor(uf,df);(!hf||("get"in hf?!uf.__esModule:hf.writable||hf.configurable))&&(hf={enumerable:!0,get:s$1(function(){return uf[df]},"get")}),Object.defineProperty(mc,ff,hf)}:function(mc,uf,df,ff){ff===void 0&&(ff=df),mc[ff]=uf[df]}),bo=vo&&vo.__exportStar||function(mc,uf){for(var df in mc)df!=="default"&&!Object.prototype.hasOwnProperty.call(uf,df)&&Ai(uf,mc,df)};Object.defineProperty(vo,"__esModule",{value:!0}),vo.stringify=vo.parse=void 0;var Ra=qo();Object.defineProperty(vo,"parse",{enumerable:!0,get:s$1(function(){return Ra.parse},"get")});var pc=Bo();Object.defineProperty(vo,"stringify",{enumerable:!0,get:s$1(function(){return pc.stringify},"get")}),bo(Qe(),vo)}),lt=O((vo,Ai)=>{Ai.exports={Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",amp:"&",AMP:"&",andand:"⩕",And:"⩓",and:"∧",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angmsd:"∡",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",apacir:"⩯",ap:"≈",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",barwed:"⌅",Barwed:"⌆",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",because:"∵",Because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxdl:"┐",boxdL:"╕",boxDl:"╖",boxDL:"╗",boxdr:"┌",boxdR:"╒",boxDr:"╓",boxDR:"╔",boxh:"─",boxH:"═",boxhd:"┬",boxHd:"╤",boxhD:"╥",boxHD:"╦",boxhu:"┴",boxHu:"╧",boxhU:"╨",boxHU:"╩",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxul:"┘",boxuL:"╛",boxUl:"╜",boxUL:"╝",boxur:"└",boxuR:"╘",boxUr:"╙",boxUR:"╚",boxv:"│",boxV:"║",boxvh:"┼",boxvH:"╪",boxVh:"╫",boxVH:"╬",boxvl:"┤",boxvL:"╡",boxVl:"╢",boxVL:"╣",boxvr:"├",boxvR:"╞",boxVr:"╟",boxVR:"╠",bprime:"‵",breve:"˘",Breve:"˘",brvbar:"¦",bscr:"𝒷",Bscr:"ℬ",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsolb:"⧅",bsol:"\\",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",capand:"⩄",capbrcup:"⩉",capcap:"⩋",cap:"∩",Cap:"⋒",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",CenterDot:"·",cfr:"𝔠",Cfr:"ℭ",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cir:"○",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",colon:":",Colon:"∷",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",conint:"∮",Conint:"∯",ContourIntegral:"∮",copf:"𝕔",Copf:"ℂ",coprod:"∐",Coproduct:"∐",copy:"©",COPY:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",cross:"✗",Cross:"⨯",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cupbrcap:"⩈",cupcap:"⩆",CupCap:"≍",cup:"∪",Cup:"⋓",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dagger:"†",Dagger:"‡",daleth:"ℸ",darr:"↓",Darr:"↡",dArr:"⇓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",ddagger:"‡",ddarr:"⇊",DD:"ⅅ",dd:"ⅆ",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",diamond:"⋄",Diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrowBar:"⤓",downarrow:"↓",DownArrow:"↓",Downarrow:"⇓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVectorBar:"⥖",DownLeftVector:"↽",DownRightTeeVector:"⥟",DownRightVectorBar:"⥗",DownRightVector:"⇁",DownTeeArrow:"↧",DownTee:"⊤",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",Ecirc:"Ê",ecirc:"ê",ecir:"≖",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",edot:"ė",eDot:"≑",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp13:" ",emsp14:" ",emsp:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",escr:"ℯ",Escr:"ℰ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",exponentiale:"ⅇ",ExponentialE:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",forall:"∀",ForAll:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"𝒻",Fscr:"ℱ",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",ge:"≥",gE:"≧",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",gescc:"⪩",ges:"⩾",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",gg:"≫",Gg:"⋙",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gla:"⪥",gl:"≷",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gnE:"≩",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",gtcc:"⪧",gtcir:"⩺",gt:">",GT:">",Gt:"≫",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",harrcir:"⥈",harr:"↔",hArr:"⇔",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",Hfr:"ℌ",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",Hopf:"ℍ",horbar:"―",HorizontalLine:"─",hscr:"𝒽",Hscr:"ℋ",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",ifr:"𝔦",Ifr:"ℑ",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",Im:"ℑ",imof:"⊷",imped:"Ƶ",Implies:"⇒",incare:"℅",in:"∈",infin:"∞",infintie:"⧝",inodot:"ı",intcal:"⊺",int:"∫",Int:"∬",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"",InvisibleTimes:"",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",Iscr:"ℐ",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",lang:"⟨",Lang:"⟪",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",larrb:"⇤",larrbfs:"⤟",larr:"←",Larr:"↞",lArr:"⇐",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",latail:"⤙",lAtail:"⤛",lat:"⪫",late:"⪭",lates:"⪭︀",lbarr:"⤌",lBarr:"⤎",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",lE:"≦",LeftAngleBracket:"⟨",LeftArrowBar:"⇤",leftarrow:"←",LeftArrow:"←",Leftarrow:"⇐",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVectorBar:"⥙",LeftDownVector:"⇃",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTeeArrow:"↤",LeftTee:"⊣",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangleBar:"⧏",LeftTriangle:"⊲",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVectorBar:"⥘",LeftUpVector:"↿",LeftVectorBar:"⥒",LeftVector:"↼",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",lescc:"⪨",les:"⩽",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",llarr:"⇇",ll:"≪",Ll:"⋘",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoustache:"⎰",lmoust:"⎰",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lnE:"≨",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftrightarrow:"⟷",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longmapsto:"⟼",longrightarrow:"⟶",LongRightArrow:"⟶",Longrightarrow:"⟹",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",Lscr:"ℒ",lsh:"↰",Lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",ltcc:"⪦",ltcir:"⩹",lt:"<",LT:"<",Lt:"≪",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",midast:"*",midcir:"⫰",mid:"∣",middot:"·",minusb:"⊟",minus:"−",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",mscr:"𝓂",Mscr:"ℳ",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natural:"♮",naturals:"ℕ",natur:"♮",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",nearhk:"⤤",nearr:"↗",neArr:"⇗",nearrow:"↗",ne:"≠",nedot:"≐̸",NegativeMediumSpace:"",NegativeThickSpace:"",NegativeThinSpace:"",NegativeVeryThinSpace:"",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:`
|
|
214
|
-
`,nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nharr:"↮",nhArr:"⇎",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlarr:"↚",nlArr:"⇍",nldr:"‥",nlE:"≦̸",nle:"≰",nleftarrow:"↚",nLeftarrow:"⇍",nleftrightarrow:"↮",nLeftrightarrow:"⇎",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"",NonBreakingSpace:" ",nopf:"𝕟",Nopf:"ℕ",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangleBar:"⧏̸",NotLeftTriangle:"⋪",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangleBar:"⧐̸",NotRightTriangle:"⋫",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",nparallel:"∦",npar:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",nprec:"⊀",npreceq:"⪯̸",npre:"⪯̸",nrarrc:"⤳̸",nrarr:"↛",nrArr:"⇏",nrarrw:"↝̸",nrightarrow:"↛",nRightarrow:"⇏",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nvdash:"⊬",nvDash:"⊭",nVdash:"⊮",nVDash:"⊯",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwarr:"↖",nwArr:"⇖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",Ocirc:"Ô",ocirc:"ô",ocir:"⊚",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",orarr:"↻",Or:"⩔",or:"∨",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",otimesas:"⨶",Otimes:"⨷",otimes:"⊗",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",para:"¶",parallel:"∥",par:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plus:"+",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",popf:"𝕡",Popf:"ℙ",pound:"£",prap:"⪷",Pr:"⪻",pr:"≺",prcue:"≼",precapprox:"⪷",prec:"≺",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",pre:"⪯",prE:"⪳",precsim:"≾",prime:"′",Prime:"″",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportional:"∝",Proportion:"∷",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",qopf:"𝕢",Qopf:"ℚ",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',QUOT:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",Rang:"⟫",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarr:"→",Rarr:"↠",rArr:"⇒",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",ratail:"⤚",rAtail:"⤜",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rBarr:"⤏",RBarr:"⤐",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",Re:"ℜ",rect:"▭",reg:"®",REG:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",Rfr:"ℜ",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrowBar:"⇥",rightarrow:"→",RightArrow:"→",Rightarrow:"⇒",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVectorBar:"⥕",RightDownVector:"⇂",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTeeArrow:"↦",RightTee:"⊢",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangleBar:"⧐",RightTriangle:"⊳",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVectorBar:"⥔",RightUpVector:"↾",RightVectorBar:"⥓",RightVector:"⇀",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"",rmoustache:"⎱",rmoust:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",Ropf:"ℝ",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",rscr:"𝓇",Rscr:"ℛ",rsh:"↱",Rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",scap:"⪸",Scaron:"Š",scaron:"š",Sc:"⪼",sc:"≻",sccue:"≽",sce:"⪰",scE:"⪴",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdotb:"⊡",sdot:"⋅",sdote:"⩦",searhk:"⤥",searr:"↘",seArr:"⇘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",solbar:"⌿",solb:"⧄",sol:"/",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",square:"□",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squ:"□",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",Sub:"⋐",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",subset:"⊂",Subset:"⋐",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succapprox:"⪸",succ:"≻",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",sum:"∑",Sum:"∑",sung:"♪",sup1:"¹",sup2:"²",sup3:"³",sup:"⊃",Sup:"⋑",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",supset:"⊃",Supset:"⋑",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swarr:"↙",swArr:"⇙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:" ",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",therefore:"∴",Therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:" ",ThinSpace:" ",thinsp:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",tilde:"˜",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",timesbar:"⨱",timesb:"⊠",times:"×",timesd:"⨰",tint:"∭",toea:"⤨",topbot:"⌶",topcir:"⫱",top:"⊤",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",TRADE:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",uarr:"↑",Uarr:"↟",uArr:"⇑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrowBar:"⤒",uparrow:"↑",UpArrow:"↑",Uparrow:"⇑",UpArrowDownArrow:"⇅",updownarrow:"↕",UpDownArrow:"↕",Updownarrow:"⇕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",upsi:"υ",Upsi:"ϒ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTeeArrow:"↥",UpTee:"⊥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",vArr:"⇕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vBar:"⫨",Vbar:"⫫",vBarv:"⫩",Vcy:"В",vcy:"в",vdash:"⊢",vDash:"⊨",Vdash:"⊩",VDash:"⊫",Vdashl:"⫦",veebar:"⊻",vee:"∨",Vee:"⋁",veeeq:"≚",vellip:"⋮",verbar:"|",Verbar:"‖",vert:"|",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",wedge:"∧",Wedge:"⋀",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xharr:"⟷",xhArr:"⟺",Xi:"Ξ",xi:"ξ",xlarr:"⟵",xlArr:"⟸",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrarr:"⟶",xrArr:"⟹",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",yuml:"ÿ",Yuml:"Ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"",Zeta:"Ζ",zeta:"ζ",zfr:"𝔷",Zfr:"ℨ",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",zopf:"𝕫",Zopf:"ℤ",Zscr:"𝒵",zscr:"𝓏",zwj:"",zwnj:""}}),$o=O((vo,Ai)=>{Ai.exports={Aacute:"Á",aacute:"á",Acirc:"Â",acirc:"â",acute:"´",AElig:"Æ",aelig:"æ",Agrave:"À",agrave:"à",amp:"&",AMP:"&",Aring:"Å",aring:"å",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",brvbar:"¦",Ccedil:"Ç",ccedil:"ç",cedil:"¸",cent:"¢",copy:"©",COPY:"©",curren:"¤",deg:"°",divide:"÷",Eacute:"É",eacute:"é",Ecirc:"Ê",ecirc:"ê",Egrave:"È",egrave:"è",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",frac12:"½",frac14:"¼",frac34:"¾",gt:">",GT:">",Iacute:"Í",iacute:"í",Icirc:"Î",icirc:"î",iexcl:"¡",Igrave:"Ì",igrave:"ì",iquest:"¿",Iuml:"Ï",iuml:"ï",laquo:"«",lt:"<",LT:"<",macr:"¯",micro:"µ",middot:"·",nbsp:" ",not:"¬",Ntilde:"Ñ",ntilde:"ñ",Oacute:"Ó",oacute:"ó",Ocirc:"Ô",ocirc:"ô",Ograve:"Ò",ograve:"ò",ordf:"ª",ordm:"º",Oslash:"Ø",oslash:"ø",Otilde:"Õ",otilde:"õ",Ouml:"Ö",ouml:"ö",para:"¶",plusmn:"±",pound:"£",quot:'"',QUOT:'"',raquo:"»",reg:"®",REG:"®",sect:"§",shy:"",sup1:"¹",sup2:"²",sup3:"³",szlig:"ß",THORN:"Þ",thorn:"þ",times:"×",Uacute:"Ú",uacute:"ú",Ucirc:"Û",ucirc:"û",Ugrave:"Ù",ugrave:"ù",uml:"¨",Uuml:"Ü",uuml:"ü",Yacute:"Ý",yacute:"ý",yen:"¥",yuml:"ÿ"}}),ct=O((vo,Ai)=>{Ai.exports={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}}),Yo=O((vo,Ai)=>{Ai.exports={0:65533,128:8364,130:8218,131:402,132:8222,133:8230,134:8224,135:8225,136:710,137:8240,138:352,139:8249,140:338,142:381,145:8216,146:8217,147:8220,148:8221,149:8226,150:8211,151:8212,152:732,153:8482,154:353,155:8250,156:339,158:382,159:376}}),Xo=O(vo=>{var Ai=vo&&vo.__importDefault||function(mc){return mc&&mc.__esModule?mc:{default:mc}};Object.defineProperty(vo,"__esModule",{value:!0});var bo=Ai(Yo()),Ra=String.fromCodePoint||function(mc){var uf="";return mc>65535&&(mc-=65536,uf+=String.fromCharCode(mc>>>10&1023|55296),mc=56320|mc&1023),uf+=String.fromCharCode(mc),uf};function pc(mc){return mc>=55296&&mc<=57343||mc>1114111?"�":(mc in bo.default&&(mc=bo.default[mc]),Ra(mc))}s$1(pc,"decodeCodePoint"),vo.default=pc}),pt=O(vo=>{var Ai=vo&&vo.__importDefault||function(pf){return pf&&pf.__esModule?pf:{default:pf}};Object.defineProperty(vo,"__esModule",{value:!0}),vo.decodeHTML=vo.decodeHTMLStrict=vo.decodeXML=void 0;var bo=Ai(lt()),Ra=Ai($o()),pc=Ai(ct()),mc=Ai(Xo()),uf=/&(?:[a-zA-Z0-9]+|#[xX][\da-fA-F]+|#\d+);/g;vo.decodeXML=df(pc.default),vo.decodeHTMLStrict=df(bo.default);function df(pf){var mf=hf(pf);return function(gf){return String(gf).replace(uf,mf)}}s$1(df,"getStrictDecoder");var ff=s$1(function(pf,mf){return pf<mf?1:-1},"sorter");vo.decodeHTML=function(){for(var pf=Object.keys(Ra.default).sort(ff),mf=Object.keys(bo.default).sort(ff),gf=0,yf=0;gf<mf.length;gf++)pf[yf]===mf[gf]?(mf[gf]+=";?",yf++):mf[gf]+=";";var vf=new RegExp("&(?:"+mf.join("|")+"|#[xX][\\da-fA-F]+;?|#\\d+;?)","g"),bf=hf(bo.default);function Sf(xf){return xf.substr(-1)!==";"&&(xf+=";"),bf(xf)}return s$1(Sf,"replacer"),function(xf){return String(xf).replace(vf,Sf)}}();function hf(pf){return s$1(function(mf){if(mf.charAt(1)==="#"){var gf=mf.charAt(2);return gf==="X"||gf==="x"?mc.default(parseInt(mf.substr(3),16)):mc.default(parseInt(mf.substr(2),10))}return pf[mf.slice(1,-1)]||mf},"replace")}s$1(hf,"getReplacer")}),ft=O(vo=>{var Ai=vo&&vo.__importDefault||function(wf){return wf&&wf.__esModule?wf:{default:wf}};Object.defineProperty(vo,"__esModule",{value:!0}),vo.escapeUTF8=vo.escape=vo.encodeNonAsciiHTML=vo.encodeHTML=vo.encodeXML=void 0;var bo=Ai(ct()),Ra=ff(bo.default),pc=hf(Ra);vo.encodeXML=xf(Ra);var mc=Ai(lt()),uf=ff(mc.default),df=hf(uf);vo.encodeHTML=yf(uf,df),vo.encodeNonAsciiHTML=xf(uf);function ff(wf){return Object.keys(wf).sort().reduce(function(If,l1){return If[wf[l1]]="&"+l1+";",If},{})}s$1(ff,"getInverseObj");function hf(wf){for(var If=[],l1=[],s1=0,c1=Object.keys(wf);s1<c1.length;s1++){var u1=c1[s1];u1.length===1?If.push("\\"+u1):l1.push(u1)}If.sort();for(var T1=0;T1<If.length-1;T1++){for(var _1=T1;_1<If.length-1&&If[_1].charCodeAt(1)+1===If[_1+1].charCodeAt(1);)_1+=1;var R1=1+_1-T1;R1<3||If.splice(T1,R1,If[T1]+"-"+If[_1])}return l1.unshift("["+If.join("")+"]"),new RegExp(l1.join("|"),"g")}s$1(hf,"getInverseReplacer");var pf=/(?:[\x80-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g,mf=String.prototype.codePointAt!=null?function(wf){return wf.codePointAt(0)}:function(wf){return(wf.charCodeAt(0)-55296)*1024+wf.charCodeAt(1)-56320+65536};function gf(wf){return"&#x"+(wf.length>1?mf(wf):wf.charCodeAt(0)).toString(16).toUpperCase()+";"}s$1(gf,"singleCharReplacer");function yf(wf,If){return function(l1){return l1.replace(If,function(s1){return wf[s1]}).replace(pf,gf)}}s$1(yf,"getInverse");var vf=new RegExp(pc.source+"|"+pf.source,"g");function bf(wf){return wf.replace(vf,gf)}s$1(bf,"escape"),vo.escape=bf;function Sf(wf){return wf.replace(pc,gf)}s$1(Sf,"escapeUTF8"),vo.escapeUTF8=Sf;function xf(wf){return function(If){return If.replace(vf,function(l1){return wf[l1]||gf(l1)})}}s$1(xf,"getASCIIEncoder")}),pn=O(vo=>{Object.defineProperty(vo,"__esModule",{value:!0}),vo.decodeXMLStrict=vo.decodeHTML5Strict=vo.decodeHTML4Strict=vo.decodeHTML5=vo.decodeHTML4=vo.decodeHTMLStrict=vo.decodeHTML=vo.decodeXML=vo.encodeHTML5=vo.encodeHTML4=vo.escapeUTF8=vo.escape=vo.encodeNonAsciiHTML=vo.encodeHTML=vo.encodeXML=vo.encode=vo.decodeStrict=vo.decode=void 0;var Ai=pt(),bo=ft();function Ra(ff,hf){return(!hf||hf<=0?Ai.decodeXML:Ai.decodeHTML)(ff)}s$1(Ra,"decode"),vo.decode=Ra;function pc(ff,hf){return(!hf||hf<=0?Ai.decodeXML:Ai.decodeHTMLStrict)(ff)}s$1(pc,"decodeStrict"),vo.decodeStrict=pc;function mc(ff,hf){return(!hf||hf<=0?bo.encodeXML:bo.encodeHTML)(ff)}s$1(mc,"encode"),vo.encode=mc;var uf=ft();Object.defineProperty(vo,"encodeXML",{enumerable:!0,get:s$1(function(){return uf.encodeXML},"get")}),Object.defineProperty(vo,"encodeHTML",{enumerable:!0,get:s$1(function(){return uf.encodeHTML},"get")}),Object.defineProperty(vo,"encodeNonAsciiHTML",{enumerable:!0,get:s$1(function(){return uf.encodeNonAsciiHTML},"get")}),Object.defineProperty(vo,"escape",{enumerable:!0,get:s$1(function(){return uf.escape},"get")}),Object.defineProperty(vo,"escapeUTF8",{enumerable:!0,get:s$1(function(){return uf.escapeUTF8},"get")}),Object.defineProperty(vo,"encodeHTML4",{enumerable:!0,get:s$1(function(){return uf.encodeHTML},"get")}),Object.defineProperty(vo,"encodeHTML5",{enumerable:!0,get:s$1(function(){return uf.encodeHTML},"get")});var df=pt();Object.defineProperty(vo,"decodeXML",{enumerable:!0,get:s$1(function(){return df.decodeXML},"get")}),Object.defineProperty(vo,"decodeHTML",{enumerable:!0,get:s$1(function(){return df.decodeHTML},"get")}),Object.defineProperty(vo,"decodeHTMLStrict",{enumerable:!0,get:s$1(function(){return df.decodeHTMLStrict},"get")}),Object.defineProperty(vo,"decodeHTML4",{enumerable:!0,get:s$1(function(){return df.decodeHTML},"get")}),Object.defineProperty(vo,"decodeHTML5",{enumerable:!0,get:s$1(function(){return df.decodeHTML},"get")}),Object.defineProperty(vo,"decodeHTML4Strict",{enumerable:!0,get:s$1(function(){return df.decodeHTMLStrict},"get")}),Object.defineProperty(vo,"decodeHTML5Strict",{enumerable:!0,get:s$1(function(){return df.decodeHTMLStrict},"get")}),Object.defineProperty(vo,"decodeXMLStrict",{enumerable:!0,get:s$1(function(){return df.decodeXML},"get")})}),Rn=O((vo,Ai)=>{function bo(m1,$1){if(!(m1 instanceof $1))throw new TypeError("Cannot call a class as a function")}s$1(bo,"_classCallCheck");function Ra(m1,$1){for(var k1=0;k1<$1.length;k1++){var F1=$1[k1];F1.enumerable=F1.enumerable||!1,F1.configurable=!0,"value"in F1&&(F1.writable=!0),Object.defineProperty(m1,F1.key,F1)}}s$1(Ra,"_defineProperties");function pc(m1,$1,k1){return $1&&Ra(m1.prototype,$1),k1&&Ra(m1,k1),m1}s$1(pc,"_createClass");function mc(m1,$1){var k1=typeof Symbol<"u"&&m1[Symbol.iterator]||m1["@@iterator"];if(!k1){if(Array.isArray(m1)||(k1=uf(m1))||$1&&m1&&typeof m1.length=="number"){k1&&(m1=k1);var F1=0,U1=s$1(function(){},"F");return{s:U1,n:s$1(function(){return F1>=m1.length?{done:!0}:{done:!1,value:m1[F1++]}},"n"),e:s$1(function(O1){throw O1},"e"),f:U1}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
215
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var B1=!0,W1=!1,Z1;return{s:s$1(function(){k1=k1.call(m1)},"s"),n:s$1(function(){var O1=k1.next();return B1=O1.done,O1},"n"),e:s$1(function(O1){W1=!0,Z1=O1},"e"),f:s$1(function(){try{!B1&&k1.return!=null&&k1.return()}finally{if(W1)throw Z1}},"f")}}s$1(mc,"_createForOfIteratorHelper");function uf(m1,$1){if(m1){if(typeof m1=="string")return df(m1,$1);var k1=Object.prototype.toString.call(m1).slice(8,-1);if(k1==="Object"&&m1.constructor&&(k1=m1.constructor.name),k1==="Map"||k1==="Set")return Array.from(m1);if(k1==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(k1))return df(m1,$1)}}s$1(uf,"_unsupportedIterableToArray");function df(m1,$1){($1==null||$1>m1.length)&&($1=m1.length);for(var k1=0,F1=new Array($1);k1<$1;k1++)F1[k1]=m1[k1];return F1}s$1(df,"_arrayLikeToArray");var ff=pn(),hf={fg:"#FFF",bg:"#000",newline:!1,escapeXML:!1,stream:!1,colors:pf()};function pf(){var m1={0:"#000",1:"#A00",2:"#0A0",3:"#A50",4:"#00A",5:"#A0A",6:"#0AA",7:"#AAA",8:"#555",9:"#F55",10:"#5F5",11:"#FF5",12:"#55F",13:"#F5F",14:"#5FF",15:"#FFF"};return wf(0,5).forEach(function($1){wf(0,5).forEach(function(k1){wf(0,5).forEach(function(F1){return mf($1,k1,F1,m1)})})}),wf(0,23).forEach(function($1){var k1=$1+232,F1=gf($1*10+8);m1[k1]="#"+F1+F1+F1}),m1}s$1(pf,"getDefaultColors");function mf(m1,$1,k1,F1){var U1=16+m1*36+$1*6+k1,B1=m1>0?m1*40+55:0,W1=$1>0?$1*40+55:0,Z1=k1>0?k1*40+55:0;F1[U1]=yf([B1,W1,Z1])}s$1(mf,"setStyleColor");function gf(m1){for(var $1=m1.toString(16);$1.length<2;)$1="0"+$1;return $1}s$1(gf,"toHexString");function yf(m1){var $1=[],k1=mc(m1),F1;try{for(k1.s();!(F1=k1.n()).done;){var U1=F1.value;$1.push(gf(U1))}}catch(B1){k1.e(B1)}finally{k1.f()}return"#"+$1.join("")}s$1(yf,"toColorHexString");function vf(m1,$1,k1,F1){var U1;return $1==="text"?U1=s1(k1,F1):$1==="display"?U1=Sf(m1,k1,F1):$1==="xterm256Foreground"?U1=T1(m1,F1.colors[k1]):$1==="xterm256Background"?U1=_1(m1,F1.colors[k1]):$1==="rgb"&&(U1=bf(m1,k1)),U1}s$1(vf,"generateOutput");function bf(m1,$1){$1=$1.substring(2).slice(0,-1);var k1=+$1.substr(0,2),F1=$1.substring(5).split(";"),U1=F1.map(function(B1){return("0"+Number(B1).toString(16)).substr(-2)}).join("");return u1(m1,(k1===38?"color:#":"background-color:#")+U1)}s$1(bf,"handleRgb");function Sf(m1,$1,k1){$1=parseInt($1,10);var F1={"-1":s$1(function(){return"<br/>"},"_"),0:s$1(function(){return m1.length&&xf(m1)},"_"),1:s$1(function(){return c1(m1,"b")},"_"),3:s$1(function(){return c1(m1,"i")},"_"),4:s$1(function(){return c1(m1,"u")},"_"),8:s$1(function(){return u1(m1,"display:none")},"_"),9:s$1(function(){return c1(m1,"strike")},"_"),22:s$1(function(){return u1(m1,"font-weight:normal;text-decoration:none;font-style:normal")},"_"),23:s$1(function(){return R1(m1,"i")},"_"),24:s$1(function(){return R1(m1,"u")},"_"),39:s$1(function(){return T1(m1,k1.fg)},"_"),49:s$1(function(){return _1(m1,k1.bg)},"_"),53:s$1(function(){return u1(m1,"text-decoration:overline")},"_")},U1;return F1[$1]?U1=F1[$1]():4<$1&&$1<7?U1=c1(m1,"blink"):29<$1&&$1<38?U1=T1(m1,k1.colors[$1-30]):39<$1&&$1<48?U1=_1(m1,k1.colors[$1-40]):89<$1&&$1<98?U1=T1(m1,k1.colors[8+($1-90)]):99<$1&&$1<108&&(U1=_1(m1,k1.colors[8+($1-100)])),U1}s$1(Sf,"handleDisplay");function xf(m1){var $1=m1.slice(0);return m1.length=0,$1.reverse().map(function(k1){return"</"+k1+">"}).join("")}s$1(xf,"resetStyles");function wf(m1,$1){for(var k1=[],F1=m1;F1<=$1;F1++)k1.push(F1);return k1}s$1(wf,"range");function If(m1){return function($1){return(m1===null||$1.category!==m1)&&m1!=="all"}}s$1(If,"notCategory");function l1(m1){m1=parseInt(m1,10);var $1=null;return m1===0?$1="all":m1===1?$1="bold":2<m1&&m1<5?$1="underline":4<m1&&m1<7?$1="blink":m1===8?$1="hide":m1===9?$1="strike":29<m1&&m1<38||m1===39||89<m1&&m1<98?$1="foreground-color":(39<m1&&m1<48||m1===49||99<m1&&m1<108)&&($1="background-color"),$1}s$1(l1,"categoryForCode");function s1(m1,$1){return $1.escapeXML?ff.encodeXML(m1):m1}s$1(s1,"pushText");function c1(m1,$1,k1){return k1||(k1=""),m1.push($1),"<".concat($1).concat(k1?' style="'.concat(k1,'"'):"",">")}s$1(c1,"pushTag");function u1(m1,$1){return c1(m1,"span",$1)}s$1(u1,"pushStyle");function T1(m1,$1){return c1(m1,"span","color:"+$1)}s$1(T1,"pushForegroundColor");function _1(m1,$1){return c1(m1,"span","background-color:"+$1)}s$1(_1,"pushBackgroundColor");function R1(m1,$1){var k1;if(m1.slice(-1)[0]===$1&&(k1=m1.pop()),k1)return"</"+$1+">"}s$1(R1,"closeTag");function P1(m1,$1,k1){var F1=!1,U1=3;function B1(){return""}s$1(B1,"remove");function W1(N1,V1){return k1("xterm256Foreground",V1),""}s$1(W1,"removeXterm256Foreground");function Z1(N1,V1){return k1("xterm256Background",V1),""}s$1(Z1,"removeXterm256Background");function O1(N1){return $1.newline?k1("display",-1):k1("text",N1),""}s$1(O1,"newline");function j1(N1,V1){F1=!0,V1.trim().length===0&&(V1="0"),V1=V1.trimRight(";").split(";");var D1=mc(V1),d1;try{for(D1.s();!(d1=D1.n()).done;){var f1=d1.value;k1("display",f1)}}catch(A1){D1.e(A1)}finally{D1.f()}return""}s$1(j1,"ansiMess");function L1(N1){return k1("text",N1),""}s$1(L1,"realText");function G1(N1){return k1("rgb",N1),""}s$1(G1,"rgb");var Y1=[{pattern:/^\x08+/,sub:B1},{pattern:/^\x1b\[[012]?K/,sub:B1},{pattern:/^\x1b\[\(B/,sub:B1},{pattern:/^\x1b\[[34]8;2;\d+;\d+;\d+m/,sub:G1},{pattern:/^\x1b\[38;5;(\d+)m/,sub:W1},{pattern:/^\x1b\[48;5;(\d+)m/,sub:Z1},{pattern:/^\n/,sub:O1},{pattern:/^\r+\n/,sub:O1},{pattern:/^\r/,sub:O1},{pattern:/^\x1b\[((?:\d{1,3};?)+|)m/,sub:j1},{pattern:/^\x1b\[\d?J/,sub:B1},{pattern:/^\x1b\[\d{0,3};\d{0,3}f/,sub:B1},{pattern:/^\x1b\[?[\d;]{0,3}/,sub:B1},{pattern:/^(([^\x1b\x08\r\n])+)/,sub:L1}];function z1(N1,V1){V1>U1&&F1||(F1=!1,m1=m1.replace(N1.pattern,N1.sub))}s$1(z1,"process");var K1=[],tT=m1,iT=tT.length;e:for(;iT>0;){for(var aT=0,oT=0,nT=Y1.length;oT<nT;aT=++oT){var cT=Y1[aT];if(z1(cT,aT),m1.length!==iT){iT=m1.length;continue e}}if(m1.length===iT)break;K1.push(0),iT=m1.length}return K1}s$1(P1,"tokenize");function E1(m1,$1,k1){return $1!=="text"&&(m1=m1.filter(If(l1(k1))),m1.push({token:$1,data:k1,category:l1(k1)})),m1}s$1(E1,"updateStickyStack");var M1=function(){function m1($1){bo(this,m1),$1=$1||{},$1.colors&&($1.colors=Object.assign({},hf.colors,$1.colors)),this.options=Object.assign({},hf,$1),this.stack=[],this.stickyStack=[]}return s$1(m1,"Filter"),pc(m1,[{key:"toHtml",value:s$1(function($1){var k1=this;$1=typeof $1=="string"?[$1]:$1;var F1=this.stack,U1=this.options,B1=[];return this.stickyStack.forEach(function(W1){var Z1=vf(F1,W1.token,W1.data,U1);Z1&&B1.push(Z1)}),P1($1.join(""),U1,function(W1,Z1){var O1=vf(F1,W1,Z1,U1);O1&&B1.push(O1),U1.stream&&(k1.stickyStack=E1(k1.stickyStack,W1,Z1))}),F1.length&&B1.push(xf(F1)),B1.join("")},"toHtml")}]),m1}();Ai.exports=M1}),v=(()=>{let vo;return typeof window<"u"?vo=window:typeof globalThis<"u"?vo=globalThis:typeof global<"u"?vo=global:typeof self<"u"?vo=self:vo={},vo})();function fr(){let vo={setHandler:s$1(()=>{},"setHandler"),send:s$1(()=>{},"send")};return new z$2({transport:vo})}s$1(fr,"mockChannel");var hr=class{constructor(){this.getChannel=s$1(()=>{if(!this.channel){let vo=fr();return this.setChannel(vo),vo}return this.channel},"getChannel"),this.ready=s$1(()=>this.promise,"ready"),this.hasChannel=s$1(()=>!!this.channel,"hasChannel"),this.setChannel=s$1(vo=>{this.channel=vo,this.resolve()},"setChannel"),this.promise=new Promise(vo=>{this.resolve=()=>vo(this.getChannel())})}};s$1(hr,"AddonStore");var mr=hr,yr="__STORYBOOK_ADDONS_PREVIEW";function Nn(){return v[yr]||(v[yr]=new mr),v[yr]}s$1(Nn,"getAddonsStore");var q=Nn(),xr=class{constructor(){this.hookListsMap=void 0,this.mountedDecorators=void 0,this.prevMountedDecorators=void 0,this.currentHooks=void 0,this.nextHookIndex=void 0,this.currentPhase=void 0,this.currentEffects=void 0,this.prevEffects=void 0,this.currentDecoratorName=void 0,this.hasUpdates=void 0,this.currentContext=void 0,this.renderListener=s$1(vo=>{var Ai;vo===((Ai=this.currentContext)==null?void 0:Ai.id)&&(this.triggerEffects(),this.currentContext=null,this.removeRenderListeners())},"renderListener"),this.init()}init(){this.hookListsMap=new WeakMap,this.mountedDecorators=new Set,this.prevMountedDecorators=new Set,this.currentHooks=[],this.nextHookIndex=0,this.currentPhase="NONE",this.currentEffects=[],this.prevEffects=[],this.currentDecoratorName=null,this.hasUpdates=!1,this.currentContext=null}clean(){this.prevEffects.forEach(vo=>{vo.destroy&&vo.destroy()}),this.init(),this.removeRenderListeners()}getNextHook(){let vo=this.currentHooks[this.nextHookIndex];return this.nextHookIndex+=1,vo}triggerEffects(){this.prevEffects.forEach(vo=>{!this.currentEffects.includes(vo)&&vo.destroy&&vo.destroy()}),this.currentEffects.forEach(vo=>{this.prevEffects.includes(vo)||(vo.destroy=vo.create())}),this.prevEffects=this.currentEffects,this.currentEffects=[]}addRenderListeners(){this.removeRenderListeners(),q.getChannel().on(X$2,this.renderListener)}removeRenderListeners(){q.getChannel().removeListener(X$2,this.renderListener)}};s$1(xr,"HooksContext");var ee=xr;function Tt(vo){let Ai=s$1((...bo)=>{let{hooks:Ra}=typeof bo[0]=="function"?bo[1]:bo[0],pc=Ra.currentPhase,mc=Ra.currentHooks,uf=Ra.nextHookIndex,df=Ra.currentDecoratorName;Ra.currentDecoratorName=vo.name,Ra.prevMountedDecorators.has(vo)?(Ra.currentPhase="UPDATE",Ra.currentHooks=Ra.hookListsMap.get(vo)||[]):(Ra.currentPhase="MOUNT",Ra.currentHooks=[],Ra.hookListsMap.set(vo,Ra.currentHooks),Ra.prevMountedDecorators.add(vo)),Ra.nextHookIndex=0;let ff=v.STORYBOOK_HOOKS_CONTEXT;v.STORYBOOK_HOOKS_CONTEXT=Ra;let hf=vo(...bo);if(v.STORYBOOK_HOOKS_CONTEXT=ff,Ra.currentPhase==="UPDATE"&&Ra.getNextHook()!=null)throw new Error("Rendered fewer hooks than expected. This may be caused by an accidental early return statement.");return Ra.currentPhase=pc,Ra.currentHooks=mc,Ra.nextHookIndex=uf,Ra.currentDecoratorName=df,hf},"hookified");return Ai.originalFn=vo,Ai}s$1(Tt,"hookify");var gr=0,Vn=25,br=s$1(vo=>(Ai,bo)=>{let Ra=vo(Tt(Ai),bo.map(pc=>Tt(pc)));return pc=>{let{hooks:mc}=pc;mc.prevMountedDecorators??(mc.prevMountedDecorators=new Set),mc.mountedDecorators=new Set([Ai,...bo]),mc.currentContext=pc,mc.hasUpdates=!1;let uf=Ra(pc);for(gr=1;mc.hasUpdates;)if(mc.hasUpdates=!1,mc.currentEffects=[],uf=Ra(pc),gr+=1,gr>Vn)throw new Error("Too many re-renders. Storybook limits the number of renders to prevent an infinite loop.");return mc.addRenderListeners(),uf}},"applyHooks"),Un=s$1((vo,Ai)=>vo.length===Ai.length&&vo.every((bo,Ra)=>bo===Ai[Ra]),"areDepsEqual"),Sr=s$1(()=>new Error("Storybook preview hooks can only be called inside decorators and story functions."),"invalidHooksError");function xt(){return v.STORYBOOK_HOOKS_CONTEXT||null}s$1(xt,"getHooksContextOrNull");function Tr(){let vo=xt();if(vo==null)throw Sr();return vo}s$1(Tr,"getHooksContextOrThrow");function Hn(vo,Ai,bo){let Ra=Tr();if(Ra.currentPhase==="MOUNT"){bo!=null&&!Array.isArray(bo)&&s$3.warn(`${vo} received a final argument that is not an array (instead, received ${bo}). When specified, the final argument must be an array.`);let pc={name:vo,deps:bo};return Ra.currentHooks.push(pc),Ai(pc),pc}if(Ra.currentPhase==="UPDATE"){let pc=Ra.getNextHook();if(pc==null)throw new Error("Rendered more hooks than during the previous render.");return pc.name!==vo&&s$3.warn(`Storybook has detected a change in the order of Hooks${Ra.currentDecoratorName?` called by ${Ra.currentDecoratorName}`:""}. This will lead to bugs and errors if not fixed.`),bo!=null&&pc.deps==null&&s$3.warn(`${vo} received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.`),bo!=null&&pc.deps!=null&&bo.length!==pc.deps.length&&s$3.warn(`The final argument passed to ${vo} changed size between renders. The order and size of this array must remain constant.
|
|
216
|
-
Previous: ${pc.deps}
|
|
217
|
-
Incoming: ${bo}`),(bo==null||pc.deps==null||!Un(bo,pc.deps))&&(Ai(pc),pc.deps=bo),pc}throw Sr()}s$1(Hn,"useHook");function qe(vo,Ai,bo){let{memoizedState:Ra}=Hn(vo,pc=>{pc.memoizedState=Ai()},bo);return Ra}s$1(qe,"useMemoLike");function Wn(vo,Ai){return qe("useMemo",vo,Ai)}s$1(Wn,"useMemo");function Ee(vo,Ai){return qe("useCallback",()=>vo,Ai)}s$1(Ee,"useCallback");function Rt(vo,Ai){return qe(vo,()=>({current:Ai}),[])}s$1(Rt,"useRefLike");function $n(vo){return Rt("useRef",vo)}s$1($n,"useRef");function Yn(){let vo=xt();if(vo!=null&&vo.currentPhase!=="NONE")vo.hasUpdates=!0;else try{q.getChannel().emit(L$2)}catch{s$3.warn("State updates of Storybook preview hooks work only in browser")}}s$1(Yn,"triggerUpdate");function wt(vo,Ai){let bo=Rt(vo,typeof Ai=="function"?Ai():Ai),Ra=s$1(pc=>{bo.current=typeof pc=="function"?pc(bo.current):pc,Yn()},"setState");return[bo.current,Ra]}s$1(wt,"useStateLike");function Kn(vo){return wt("useState",vo)}s$1(Kn,"useState");function Xn(vo,Ai,bo){let Ra=bo!=null?()=>bo(Ai):Ai,[pc,mc]=wt("useReducer",Ra);return[pc,s$1(uf=>mc(df=>vo(df,uf)),"dispatch")]}s$1(Xn,"useReducer");function Et(vo,Ai){let bo=Tr(),Ra=qe("useEffect",()=>({create:vo}),Ai);bo.currentEffects.includes(Ra)||bo.currentEffects.push(Ra)}s$1(Et,"useEffect");function Jn(vo,Ai=[]){let bo=q.getChannel();return Et(()=>(Object.entries(vo).forEach(([Ra,pc])=>bo.on(Ra,pc)),()=>{Object.entries(vo).forEach(([Ra,pc])=>bo.removeListener(Ra,pc))}),[...Object.keys(vo),...Ai]),Ee(bo.emit.bind(bo),[bo])}s$1(Jn,"useChannel");function Be(){let{currentContext:vo}=Tr();if(vo==null)throw Sr();return vo}s$1(Be,"useStoryContext");function Qn(vo,Ai){let{parameters:bo}=Be();if(vo)return bo[vo]??Ai}s$1(Qn,"useParameter");function Zn(){let vo=q.getChannel(),{id:Ai,args:bo}=Be(),Ra=Ee(mc=>vo.emit(n$1,{storyId:Ai,updatedArgs:mc}),[vo,Ai]),pc=Ee(mc=>vo.emit(H$2,{storyId:Ai,argNames:mc}),[vo,Ai]);return[bo,Ra,pc]}s$1(Zn,"useArgs");function es(){let vo=q.getChannel(),{globals:Ai}=Be(),bo=Ee(Ra=>vo.emit(j,{globals:Ra}),[vo]);return[Ai,bo]}s$1(es,"useGlobals");function Rr(vo,Ai){let bo={},Ra=Object.entries(vo);for(let pc=0;pc<Ra.length;pc++){let[mc,uf]=Ra[pc];Ai(uf,mc)||(bo[mc]=uf)}return bo}s$1(Rr,"omitBy");function wr(vo,Ai){let bo={};for(let Ra=0;Ra<Ai.length;Ra++){let pc=Ai[Ra];Object.prototype.hasOwnProperty.call(vo,pc)&&(bo[pc]=vo[pc])}return bo}s$1(wr,"pick");function Er(vo,Ai){let bo={},Ra=Object.entries(vo);for(let pc=0;pc<Ra.length;pc++){let[mc,uf]=Ra[pc];Ai(uf,mc)&&(bo[mc]=uf)}return bo}s$1(Er,"pickBy");function k(vo){if(typeof vo!="object"||vo==null)return!1;if(Object.getPrototypeOf(vo)===null)return!0;if(vo.toString()!=="[object Object]")return!1;let Ai=vo;for(;Object.getPrototypeOf(Ai)!==null;)Ai=Object.getPrototypeOf(Ai);return Object.getPrototypeOf(vo)===Ai}s$1(k,"isPlainObject");function L(vo,Ai){let bo={},Ra=Object.keys(vo);for(let pc=0;pc<Ra.length;pc++){let mc=Ra[pc],uf=vo[mc];bo[mc]=Ai(uf,mc,vo)}return bo}s$1(L,"mapValues");var At="[object RegExp]",vt="[object String]",Ct="[object Number]",Pt="[object Boolean]",Ar="[object Arguments]",Ft="[object Symbol]",It="[object Date]",Ot="[object Map]",Dt="[object Set]",kt="[object Array]",jt="[object Function]",Mt="[object ArrayBuffer]",ze="[object Object]",_t="[object Error]",Lt="[object DataView]",Nt="[object Uint8Array]",qt="[object Uint8ClampedArray]",Bt="[object Uint16Array]",zt="[object Uint32Array]",Gt="[object BigUint64Array]",Vt="[object Int8Array]",Ut="[object Int16Array]",Ht="[object Int32Array]",Wt="[object BigInt64Array]",$t="[object Float32Array]",Yt="[object Float64Array]";function vr(vo){return Object.getOwnPropertySymbols(vo).filter(Ai=>Object.prototype.propertyIsEnumerable.call(vo,Ai))}s$1(vr,"getSymbols");function Cr(vo){return vo==null?vo===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(vo)}s$1(Cr,"getTag");function Pr(vo,Ai){if(typeof vo==typeof Ai)switch(typeof vo){case"bigint":case"string":case"boolean":case"symbol":case"undefined":return vo===Ai;case"number":return vo===Ai||Object.is(vo,Ai);case"function":return vo===Ai;case"object":return U(vo,Ai)}return U(vo,Ai)}s$1(Pr,"isEqual");function U(vo,Ai,bo){if(Object.is(vo,Ai))return!0;let Ra=Cr(vo),pc=Cr(Ai);if(Ra===Ar&&(Ra=ze),pc===Ar&&(pc=ze),Ra!==pc)return!1;switch(Ra){case vt:return vo.toString()===Ai.toString();case Ct:{let df=vo.valueOf(),ff=Ai.valueOf();return df===ff||Number.isNaN(df)&&Number.isNaN(ff)}case Pt:case It:case Ft:return Object.is(vo.valueOf(),Ai.valueOf());case At:return vo.source===Ai.source&&vo.flags===Ai.flags;case jt:return vo===Ai}bo=bo??new Map;let mc=bo.get(vo),uf=bo.get(Ai);if(mc!=null&&uf!=null)return mc===Ai;bo.set(vo,Ai),bo.set(Ai,vo);try{switch(Ra){case Ot:{if(vo.size!==Ai.size)return!1;for(let[df,ff]of vo.entries())if(!Ai.has(df)||!U(ff,Ai.get(df),bo))return!1;return!0}case Dt:{if(vo.size!==Ai.size)return!1;let df=Array.from(vo.values()),ff=Array.from(Ai.values());for(let hf=0;hf<df.length;hf++){let pf=df[hf],mf=ff.findIndex(gf=>U(pf,gf,bo));if(mf===-1)return!1;ff.splice(mf,1)}return!0}case kt:case Nt:case qt:case Bt:case zt:case Gt:case Vt:case Ut:case Ht:case Wt:case $t:case Yt:{if(typeof Buffer<"u"&&Buffer.isBuffer(vo)!==Buffer.isBuffer(Ai)||vo.length!==Ai.length)return!1;for(let df=0;df<vo.length;df++)if(!U(vo[df],Ai[df],bo))return!1;return!0}case Mt:return vo.byteLength!==Ai.byteLength?!1:U(new Uint8Array(vo),new Uint8Array(Ai),bo);case Lt:return vo.byteLength!==Ai.byteLength||vo.byteOffset!==Ai.byteOffset?!1:U(vo.buffer,Ai.buffer,bo);case _t:return vo.name===Ai.name&&vo.message===Ai.message;case ze:{if(!(U(vo.constructor,Ai.constructor,bo)||k(vo)&&k(Ai)))return!1;let df=[...Object.keys(vo),...vr(vo)],ff=[...Object.keys(Ai),...vr(Ai)];if(df.length!==ff.length)return!1;for(let hf=0;hf<df.length;hf++){let pf=df[hf],mf=vo[pf];if(!Object.prototype.hasOwnProperty.call(Ai,pf))return!1;let gf=Ai[pf];if(!U(mf,gf,bo))return!1}return!0}default:return!1}}finally{bo.delete(vo),bo.delete(Ai)}}s$1(U,"areObjectsEqual");var Ke=ce(Ir());function F(vo){for(var Ai=[],bo=1;bo<arguments.length;bo++)Ai[bo-1]=arguments[bo];var Ra=Array.from(typeof vo=="string"?[vo]:vo);Ra[Ra.length-1]=Ra[Ra.length-1].replace(/\r?\n([\t ]*)$/,"");var pc=Ra.reduce(function(df,ff){var hf=ff.match(/\n([\t ]+|(?!\s).)/g);return hf?df.concat(hf.map(function(pf){var mf,gf;return(gf=(mf=pf.match(/[\t ]/g))===null||mf===void 0?void 0:mf.length)!==null&&gf!==void 0?gf:0})):df},[]);if(pc.length){var mc=new RegExp(`
|
|
218
|
-
[ ]{`+Math.min.apply(Math,pc)+"}","g");Ra=Ra.map(function(df){return df.replace(mc,`
|
|
219
|
-
`)})}Ra[0]=Ra[0].replace(/^\r?\n/,"");var uf=Ra[0];return Ai.forEach(function(df,ff){var hf=uf.match(/(?:^|\n)( *)$/),pf=hf?hf[1]:"",mf=df;typeof df=="string"&&df.includes(`
|
|
220
|
-
`)&&(mf=String(df).split(`
|
|
221
|
-
`).map(function(gf,yf){return yf===0?gf:""+pf+gf}).join(`
|
|
222
|
-
`)),uf+=mf+Ra[ff+1]}),uf}s$1(F,"dedent");var de=Symbol("incompatible"),Dr=s$1((vo,Ai)=>{let bo=Ai.type;if(vo==null||!bo||Ai.mapping)return vo;switch(bo.name){case"string":return String(vo);case"enum":return vo;case"number":return Number(vo);case"boolean":return String(vo)==="true";case"array":return!bo.value||!Array.isArray(vo)?de:vo.reduce((Ra,pc,mc)=>{let uf=Dr(pc,{type:bo.value});return uf!==de&&(Ra[mc]=uf),Ra},new Array(vo.length));case"object":return typeof vo=="string"||typeof vo=="number"?vo:!bo.value||typeof vo!="object"?de:Object.entries(vo).reduce((Ra,[pc,mc])=>{let uf=Dr(mc,{type:bo.value[pc]});return uf===de?Ra:Object.assign(Ra,{[pc]:uf})},{});default:return de}},"map"),Xt=s$1((vo,Ai)=>Object.entries(vo).reduce((bo,[Ra,pc])=>{if(!Ai[Ra])return bo;let mc=Dr(pc,Ai[Ra]);return mc===de?bo:Object.assign(bo,{[Ra]:mc})},{}),"mapArgsToTypes"),Ae=s$1((vo,Ai)=>Array.isArray(vo)&&Array.isArray(Ai)?Ai.reduce((bo,Ra,pc)=>(bo[pc]=Ae(vo[pc],Ai[pc]),bo),[...vo]).filter(bo=>bo!==void 0):!k(vo)||!k(Ai)?Ai:Object.keys({...vo,...Ai}).reduce((bo,Ra)=>{if(Ra in Ai){let pc=Ae(vo[Ra],Ai[Ra]);pc!==void 0&&(bo[Ra]=pc)}else bo[Ra]=vo[Ra];return bo},{}),"combineArgs"),Jt=s$1((vo,Ai)=>Object.entries(Ai).reduce((bo,[Ra,{options:pc}])=>{function mc(){return Ra in vo&&(bo[Ra]=vo[Ra]),bo}if(s$1(mc,"allowArg"),!pc)return mc();if(!Array.isArray(pc))return n$2.error(F`
|
|
223
|
-
Invalid argType: '${Ra}.options' should be an array.
|
|
224
|
-
|
|
225
|
-
More info: https://storybook.js.org/docs/api/arg-types
|
|
226
|
-
`),mc();if(pc.some(mf=>mf&&["object","function"].includes(typeof mf)))return n$2.error(F`
|
|
227
|
-
Invalid argType: '${Ra}.options' should only contain primitives. Use a 'mapping' for complex values.
|
|
228
|
-
|
|
229
|
-
More info: https://storybook.js.org/docs/writing-stories/args#mapping-to-complex-arg-values
|
|
230
|
-
`),mc();let uf=Array.isArray(vo[Ra]),df=uf&&vo[Ra].findIndex(mf=>!pc.includes(mf)),ff=uf&&df===-1;if(vo[Ra]===void 0||pc.includes(vo[Ra])||ff)return mc();let hf=uf?`${Ra}[${df}]`:Ra,pf=pc.map(mf=>typeof mf=="string"?`'${mf}'`:String(mf)).join(", ");return n$2.warn(`Received illegal value for '${hf}'. Supported options: ${pf}`),bo},{}),"validateOptions"),re=Symbol("Deeply equal"),pe=s$1((vo,Ai)=>{if(typeof vo!=typeof Ai)return Ai;if(Pr(vo,Ai))return re;if(Array.isArray(vo)&&Array.isArray(Ai)){let bo=Ai.reduce((Ra,pc,mc)=>{let uf=pe(vo[mc],pc);return uf!==re&&(Ra[mc]=uf),Ra},new Array(Ai.length));return Ai.length>=vo.length?bo:bo.concat(new Array(vo.length-Ai.length).fill(void 0))}return k(vo)&&k(Ai)?Object.keys({...vo,...Ai}).reduce((bo,Ra)=>{let pc=pe(vo==null?void 0:vo[Ra],Ai==null?void 0:Ai[Ra]);return pc===re?bo:Object.assign(bo,{[Ra]:pc})},{}):Ai},"deepDiff"),kr="UNTARGETED";function Qt({args:vo,argTypes:Ai}){let bo={};return Object.entries(vo).forEach(([Ra,pc])=>{let{target:mc=kr}=Ai[Ra]||{};bo[mc]=bo[mc]||{},bo[mc][Ra]=pc}),bo}s$1(Qt,"groupArgsByTarget");function ts(vo){return Object.keys(vo).forEach(Ai=>vo[Ai]===void 0&&delete vo[Ai]),vo}s$1(ts,"deleteUndefined");var jr=class{constructor(){this.initialArgsByStoryId={},this.argsByStoryId={}}get(vo){if(!(vo in this.argsByStoryId))throw new Error(`No args known for ${vo} -- has it been rendered yet?`);return this.argsByStoryId[vo]}setInitial(vo){if(!this.initialArgsByStoryId[vo.id])this.initialArgsByStoryId[vo.id]=vo.initialArgs,this.argsByStoryId[vo.id]=vo.initialArgs;else if(this.initialArgsByStoryId[vo.id]!==vo.initialArgs){let Ai=pe(this.initialArgsByStoryId[vo.id],this.argsByStoryId[vo.id]);this.initialArgsByStoryId[vo.id]=vo.initialArgs,this.argsByStoryId[vo.id]=vo.initialArgs,Ai!==re&&this.updateFromDelta(vo,Ai)}}updateFromDelta(vo,Ai){let bo=Jt(Ai,vo.argTypes);this.argsByStoryId[vo.id]=Ae(this.argsByStoryId[vo.id],bo)}updateFromPersisted(vo,Ai){let bo=Xt(Ai,vo.argTypes);return this.updateFromDelta(vo,bo)}update(vo,Ai){if(!(vo in this.argsByStoryId))throw new Error(`No args known for ${vo} -- has it been rendered yet?`);this.argsByStoryId[vo]=ts({...this.argsByStoryId[vo],...Ai})}};s$1(jr,"ArgsStore");var Ge=jr,Ve=s$1((vo={})=>Object.entries(vo).reduce((Ai,[bo,{defaultValue:Ra}])=>(typeof Ra<"u"&&(Ai[bo]=Ra),Ai),{}),"getValuesFromArgTypes"),Mr=class{constructor({globals:vo={},globalTypes:Ai={}}){this.set({globals:vo,globalTypes:Ai})}set({globals:vo={},globalTypes:Ai={}}){let bo=this.initialGlobals&&pe(this.initialGlobals,this.globals);this.allowedGlobalNames=new Set([...Object.keys(vo),...Object.keys(Ai)]);let Ra=Ve(Ai);this.initialGlobals={...Ra,...vo},this.globals=this.initialGlobals,bo&&bo!==re&&this.updateFromPersisted(bo)}filterAllowedGlobals(vo){return Object.entries(vo).reduce((Ai,[bo,Ra])=>(this.allowedGlobalNames.has(bo)?Ai[bo]=Ra:s$3.warn(`Attempted to set a global (${bo}) that is not defined in initial globals or globalTypes`),Ai),{})}updateFromPersisted(vo){let Ai=this.filterAllowedGlobals(vo);this.globals={...this.globals,...Ai}}get(){return this.globals}update(vo){this.globals={...this.globals,...this.filterAllowedGlobals(vo)}}};s$1(Mr,"GlobalsStore");var Ue=Mr,Zt=ce(Ir()),ss=(0,Zt.default)(1)(vo=>Object.values(vo).reduce((Ai,bo)=>(Ai[bo.importPath]=Ai[bo.importPath]||bo,Ai),{})),_r=class{constructor({entries:vo}={v:5,entries:{}}){this.entries=vo}entryFromSpecifier(vo){let Ai=Object.values(this.entries);if(vo==="*")return Ai[0];if(typeof vo=="string")return this.entries[vo]?this.entries[vo]:Ai.find(pc=>pc.id.startsWith(vo));let{name:bo,title:Ra}=vo;return Ai.find(pc=>pc.name===bo&&pc.title===Ra)}storyIdToEntry(vo){let Ai=this.entries[vo];if(!Ai)throw new D$1({storyId:vo});return Ai}importPathToEntry(vo){return ss(this.entries)[vo]}};s$1(_r,"StoryIndexStore");var He=_r,is=s$1(vo=>typeof vo=="string"?{name:vo}:vo,"normalizeType"),as=s$1(vo=>typeof vo=="string"?{type:vo}:vo,"normalizeControl"),ls=s$1((vo,Ai)=>{let{type:bo,control:Ra,...pc}=vo,mc={name:Ai,...pc};return bo&&(mc.type=is(bo)),Ra?mc.control=as(Ra):Ra===!1&&(mc.control={disable:!0}),mc},"normalizeInputType"),te=s$1(vo=>L(vo,ls),"normalizeInputTypes"),P=s$1(vo=>Array.isArray(vo)?vo:vo?[vo]:[],"normalizeArrays"),fs=F`
|
|
231
|
-
CSF .story annotations deprecated; annotate story functions directly:
|
|
232
|
-
- StoryFn.story.name => StoryFn.storyName
|
|
233
|
-
- StoryFn.story.(parameters|decorators) => StoryFn.(parameters|decorators)
|
|
234
|
-
See https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#hoisted-csf-annotations for details and codemod.
|
|
235
|
-
`;function ve(vo,Ai,bo){let Ra=Ai,pc=typeof Ai=="function"?Ai:null,{story:mc}=Ra;mc&&(s$3.debug("deprecated story",mc),m$2(fs));let uf=N(vo),df=typeof Ra!="function"&&Ra.name||Ra.storyName||(mc==null?void 0:mc.name)||uf,ff=[...P(Ra.decorators),...P(mc==null?void 0:mc.decorators)],hf={...mc==null?void 0:mc.parameters,...Ra.parameters},pf={...mc==null?void 0:mc.args,...Ra.args},mf={...mc==null?void 0:mc.argTypes,...Ra.argTypes},gf=[...P(Ra.loaders),...P(mc==null?void 0:mc.loaders)],yf=[...P(Ra.beforeEach),...P(mc==null?void 0:mc.beforeEach)],{render:vf,play:bf,tags:Sf=[],globals:xf={}}=Ra,wf=hf.__id||G(bo.id,uf);return{moduleExport:Ai,id:wf,name:df,tags:Sf,decorators:ff,parameters:hf,args:pf,argTypes:te(mf),loaders:gf,beforeEach:yf,globals:xf,...vf&&{render:vf},...pc&&{userStoryFn:pc},...bf&&{play:bf}}}s$1(ve,"normalizeStory");function We(vo,Ai=vo.title,bo){let{id:Ra,argTypes:pc}=vo;return{id:O$1(Ra||Ai),...vo,title:Ai,...pc&&{argTypes:te(pc)},parameters:{fileName:bo,...vo.parameters}}}s$1(We,"normalizeComponentAnnotations");var hs=s$1(vo=>{let{globals:Ai,globalTypes:bo}=vo;(Ai||bo)&&s$3.error("Global args/argTypes can only be set globally",JSON.stringify({globals:Ai,globalTypes:bo}))},"checkGlobals"),gs=s$1(vo=>{let{options:Ai}=vo;Ai!=null&&Ai.storySort&&s$3.error("The storySort option parameter can only be set globally")},"checkStorySort"),eo=s$1(vo=>{vo&&(hs(vo),gs(vo))},"checkDisallowedParameters");function to(vo,Ai,bo){let{default:Ra,__namedExportsOrder:pc,...mc}=vo,uf=We(Ra,bo,Ai);eo(uf.parameters);let df={meta:uf,stories:{},moduleExports:vo};return Object.keys(mc).forEach(ff=>{if(M$1(ff,uf)){let hf=ve(ff,mc[ff],uf);eo(hf.parameters),df.stories[hf.id]=hf}}),df}s$1(to,"processCSFFile");function no(vo){return vo!=null&&bs(vo).includes("mount")}s$1(no,"mountDestructured");function bs(vo){let Ai=vo.toString().match(/[^(]*\(([^)]*)/);if(!Ai)return[];let bo=oo(Ai[1]);if(!bo.length)return[];let Ra=bo[0];return Ra.startsWith("{")&&Ra.endsWith("}")?oo(Ra.slice(1,-1).replace(/\s/g,"")).map(pc=>pc.replace(/:.*|=.*/g,"")):[]}s$1(bs,"getUsedProps");function oo(vo){let Ai=[],bo=[],Ra=0;for(let mc=0;mc<vo.length;mc++)if(vo[mc]==="{"||vo[mc]==="[")bo.push(vo[mc]==="{"?"}":"]");else if(vo[mc]===bo[bo.length-1])bo.pop();else if(!bo.length&&vo[mc]===","){let uf=vo.substring(Ra,mc).trim();uf&&Ai.push(uf),Ra=mc+1}let pc=vo.substring(Ra).trim();return pc&&Ai.push(pc),Ai}s$1(oo,"splitByComma");function so(vo,Ai,bo){let Ra=bo(vo);return pc=>Ai(Ra,pc)}s$1(so,"decorateStory");function io({componentId:vo,title:Ai,kind:bo,id:Ra,name:pc,story:mc,parameters:uf,initialArgs:df,argTypes:ff,...hf}={}){return hf}s$1(io,"sanitizeStoryContextUpdate");function Lr(vo,Ai){let bo={},Ra=s$1(mc=>uf=>{if(!bo.value)throw new Error("Decorated function called without init");return bo.value={...bo.value,...io(uf)},mc(bo.value)},"bindWithContext"),pc=Ai.reduce((mc,uf)=>so(mc,uf,Ra),vo);return mc=>(bo.value=mc,pc(mc))}s$1(Lr,"defaultDecorateStory");var M=s$1((...vo)=>{let Ai={},bo=vo.filter(Boolean),Ra=bo.reduce((pc,mc)=>(Object.entries(mc).forEach(([uf,df])=>{let ff=pc[uf];Array.isArray(df)||typeof ff>"u"?pc[uf]=df:k(df)&&k(ff)?Ai[uf]=!0:typeof df<"u"&&(pc[uf]=df)}),pc),{});return Object.keys(Ai).forEach(pc=>{let mc=bo.filter(Boolean).map(uf=>uf[pc]).filter(uf=>typeof uf<"u");mc.every(uf=>k(uf))?Ra[pc]=M(...mc):Ra[pc]=mc[mc.length-1]}),Ra},"combineParameters");function Ce(vo,Ai,bo){let{moduleExport:Ra,id:pc,name:mc}=vo||{},uf=ao(vo,Ai,bo),df=s$1(async s1=>{let c1={};for(let u1 of[..."__STORYBOOK_TEST_LOADERS__"in v&&Array.isArray(v.__STORYBOOK_TEST_LOADERS__)?[v.__STORYBOOK_TEST_LOADERS__]:[],P(bo.loaders),P(Ai.loaders),P(vo.loaders)]){if(s1.abortSignal.aborted)return c1;let T1=await Promise.all(u1.map(_1=>_1(s1)));Object.assign(c1,...T1)}return c1},"applyLoaders"),ff=s$1(async s1=>{let c1=new Array;for(let u1 of[...P(bo.beforeEach),...P(Ai.beforeEach),...P(vo.beforeEach)]){if(s1.abortSignal.aborted)return c1;let T1=await u1(s1);T1&&c1.push(T1)}return c1},"applyBeforeEach"),hf=s$1(s1=>s1.originalStoryFn(s1.args,s1),"undecoratedStoryFn"),{applyDecorators:pf=Lr,runStep:mf}=bo,gf=[...P(vo==null?void 0:vo.decorators),...P(Ai==null?void 0:Ai.decorators),...P(bo==null?void 0:bo.decorators)],yf=(vo==null?void 0:vo.userStoryFn)||(vo==null?void 0:vo.render)||Ai.render||bo.render,vf=br(pf)(hf,gf),bf=s$1(s1=>vf(s1),"unboundStoryFn"),Sf=(vo==null?void 0:vo.play)??(Ai==null?void 0:Ai.play),xf=no(Sf);if(!yf&&!xf)throw new q$1({id:pc});let wf=s$1(s1=>async()=>(await s1.renderToCanvas(),s1.canvas),"defaultMount"),If=vo.mount??Ai.mount??bo.mount??wf,l1=bo.testingLibraryRender;return{storyGlobals:{},...uf,moduleExport:Ra,id:pc,name:mc,story:mc,originalStoryFn:yf,undecoratedStoryFn:hf,unboundStoryFn:bf,applyLoaders:df,applyBeforeEach:ff,playFunction:Sf,runStep:mf,mount:If,testingLibraryRender:l1,renderToCanvas:bo.renderToCanvas,usesMount:xf}}s$1(Ce,"prepareStory");function Nr(vo,Ai,bo){return{...ao(void 0,vo,Ai),moduleExport:bo}}s$1(Nr,"prepareMeta");function ao(vo,Ai,bo){var Ra;let pc=["dev","test"],mc=((Ra=v.DOCS_OPTIONS)==null?void 0:Ra.autodocs)===!0?["autodocs"]:[],uf=z(...pc,...mc,...bo.tags??[],...Ai.tags??[],...(vo==null?void 0:vo.tags)??[]),df=M(bo.parameters,Ai.parameters,vo==null?void 0:vo.parameters),{argTypesEnhancers:ff=[],argsEnhancers:hf=[]}=bo,pf=M(bo.argTypes,Ai.argTypes,vo==null?void 0:vo.argTypes);if(vo){let wf=(vo==null?void 0:vo.userStoryFn)||(vo==null?void 0:vo.render)||Ai.render||bo.render;df.__isArgsStory=wf&&wf.length>0}let mf={...bo.args,...Ai.args,...vo==null?void 0:vo.args},gf={...Ai.globals,...vo==null?void 0:vo.globals},yf={componentId:Ai.id,title:Ai.title,kind:Ai.title,id:(vo==null?void 0:vo.id)||Ai.id,name:(vo==null?void 0:vo.name)||"__meta",story:(vo==null?void 0:vo.name)||"__meta",component:Ai.component,subcomponents:Ai.subcomponents,tags:uf,parameters:df,initialArgs:mf,argTypes:pf,storyGlobals:gf};yf.argTypes=ff.reduce((wf,If)=>If({...yf,argTypes:wf}),yf.argTypes);let vf={...mf};yf.initialArgs=hf.reduce((wf,If)=>({...wf,...If({...yf,initialArgs:wf})}),vf);let{name:bf,story:Sf,...xf}=yf;return xf}s$1(ao,"preparePartialAnnotations");function $e(vo){var Ai;let{args:bo}=vo,Ra={...vo,allArgs:void 0,argsByTarget:void 0};if((Ai=v.FEATURES)!=null&&Ai.argTypeTargetsV7){let uf=Qt(vo);Ra={...vo,allArgs:vo.args,argsByTarget:uf,args:uf[kr]||{}}}let pc=Object.entries(Ra.args).reduce((uf,[df,ff])=>{var hf;if(!((hf=Ra.argTypes[df])!=null&&hf.mapping))return uf[df]=ff,uf;let pf=s$1(mf=>{let gf=Ra.argTypes[df].mapping;return gf&&mf in gf?gf[mf]:mf},"mappingFn");return uf[df]=Array.isArray(ff)?ff.map(pf):pf(ff),uf},{}),mc=Object.entries(pc).reduce((uf,[df,ff])=>{let hf=Ra.argTypes[df]||{};return P$1(hf,pc,Ra.globals)&&(uf[df]=ff),uf},{});return{...Ra,unmappedArgs:bo,args:mc}}s$1($e,"prepareContext");var qr=s$1((vo,Ai,bo)=>{let Ra=typeof vo;switch(Ra){case"boolean":case"string":case"number":case"function":case"symbol":return{name:Ra}}return vo?bo.has(vo)?(s$3.warn(F`
|
|
236
|
-
We've detected a cycle in arg '${Ai}'. Args should be JSON-serializable.
|
|
237
|
-
|
|
238
|
-
Consider using the mapping feature or fully custom args:
|
|
239
|
-
- Mapping: https://storybook.js.org/docs/writing-stories/args#mapping-to-complex-arg-values
|
|
240
|
-
- Custom args: https://storybook.js.org/docs/essentials/controls#fully-custom-args
|
|
241
|
-
`),{name:"other",value:"cyclic object"}):(bo.add(vo),Array.isArray(vo)?{name:"array",value:vo.length>0?qr(vo[0],Ai,new Set(bo)):{name:"other",value:"unknown"}}:{name:"object",value:L(vo,pc=>qr(pc,Ai,new Set(bo)))}):{name:"object",value:{}}},"inferType"),Br=s$1(vo=>{let{id:Ai,argTypes:bo={},initialArgs:Ra={}}=vo,pc=L(Ra,(uf,df)=>({name:df,type:qr(uf,`${Ai}.${df}`,new Set)})),mc=L(bo,(uf,df)=>({name:df}));return M(pc,mc,bo)},"inferArgTypes");Br.secondPass=!0;var lo=s$1((vo,Ai)=>Array.isArray(Ai)?Ai.includes(vo):vo.match(Ai),"matches"),Ye=s$1((vo,Ai,bo)=>!Ai&&!bo?vo:vo&&Er(vo,(Ra,pc)=>{let mc=Ra.name||pc.toString();return!!(!Ai||lo(mc,Ai))&&(!bo||!lo(mc,bo))}),"filterArgTypes"),Es=s$1((vo,Ai,bo)=>{let{type:Ra,options:pc}=vo;if(Ra){if(bo.color&&bo.color.test(Ai)){let mc=Ra.name;if(mc==="string")return{control:{type:"color"}};mc!=="enum"&&s$3.warn(`Addon controls: Control of type color only supports string, received "${mc}" instead`)}if(bo.date&&bo.date.test(Ai))return{control:{type:"date"}};switch(Ra.name){case"array":return{control:{type:"object"}};case"boolean":return{control:{type:"boolean"}};case"string":return{control:{type:"text"}};case"number":return{control:{type:"number"}};case"enum":{let{value:mc}=Ra;return{control:{type:(mc==null?void 0:mc.length)<=5?"radio":"select"},options:mc}}case"function":case"symbol":return null;default:return{control:{type:pc?"select":"object"}}}}},"inferControl"),Pe=s$1(vo=>{let{argTypes:Ai,parameters:{__isArgsStory:bo,controls:{include:Ra=null,exclude:pc=null,matchers:mc={}}={}}}=vo;if(!bo)return Ai;let uf=Ye(Ai,Ra,pc),df=L(uf,(ff,hf)=>(ff==null?void 0:ff.type)&&Es(ff,hf.toString(),mc));return M(df,uf)},"inferControls");Pe.secondPass=!0;function Fe({argTypes:vo,globalTypes:Ai,argTypesEnhancers:bo,decorators:Ra,loaders:pc,beforeEach:mc,globals:uf,initialGlobals:df,...ff}){return uf&&Object.keys(uf).length>0&&m$2(F`
|
|
242
|
-
The preview.js 'globals' field is deprecated and will be removed in Storybook 9.0.
|
|
243
|
-
Please use 'initialGlobals' instead. Learn more:
|
|
244
|
-
|
|
245
|
-
https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#previewjs-globals-renamed-to-initialglobals
|
|
246
|
-
`),{...vo&&{argTypes:te(vo)},...Ai&&{globalTypes:te(Ai)},decorators:P(Ra),loaders:P(pc),beforeEach:P(mc),argTypesEnhancers:[...bo||[],Br,Pe],initialGlobals:M(df,uf),...ff}}s$1(Fe,"normalizeProjectAnnotations");var co=s$1(vo=>async()=>{let Ai=[];for(let bo of vo){let Ra=await bo();Ra&&Ai.unshift(Ra)}return async()=>{for(let bo of Ai)await bo()}},"composeBeforeAllHooks");function zr(vo){return async(Ai,bo,Ra)=>{await vo.reduceRight((pc,mc)=>async()=>mc(Ai,pc,Ra),async()=>bo(Ra))()}}s$1(zr,"composeStepRunners");function Oe(vo,Ai){return vo.map(bo=>{var Ra;return((Ra=bo.default)==null?void 0:Ra[Ai])??bo[Ai]}).filter(Boolean)}s$1(Oe,"getField");function oe(vo,Ai,bo={}){return Oe(vo,Ai).reduce((Ra,pc)=>{let mc=P(pc);return bo.reverseFileOrder?[...mc,...Ra]:[...Ra,...mc]},[])}s$1(oe,"getArrayField");function Ie(vo,Ai){return Object.assign({},...Oe(vo,Ai))}s$1(Ie,"getObjectField");function ue(vo,Ai){return Oe(vo,Ai).pop()}s$1(ue,"getSingletonField");function fe(vo){var Ai;let bo=oe(vo,"argTypesEnhancers"),Ra=Oe(vo,"runStep"),pc=oe(vo,"beforeAll");return{parameters:M(...Oe(vo,"parameters")),decorators:oe(vo,"decorators",{reverseFileOrder:!(((Ai=v.FEATURES)==null?void 0:Ai.legacyDecoratorFileOrder)??!1)}),args:Ie(vo,"args"),argsEnhancers:oe(vo,"argsEnhancers"),argTypes:Ie(vo,"argTypes"),argTypesEnhancers:[...bo.filter(mc=>!mc.secondPass),...bo.filter(mc=>mc.secondPass)],globals:Ie(vo,"globals"),initialGlobals:Ie(vo,"initialGlobals"),globalTypes:Ie(vo,"globalTypes"),loaders:oe(vo,"loaders"),beforeAll:co(pc),beforeEach:oe(vo,"beforeEach"),render:ue(vo,"render"),renderToCanvas:ue(vo,"renderToCanvas"),renderToDOM:ue(vo,"renderToDOM"),applyDecorators:ue(vo,"applyDecorators"),runStep:zr(Ra),tags:oe(vo,"tags"),mount:ue(vo,"mount"),testingLibraryRender:ue(vo,"testingLibraryRender")}}s$1(fe,"composeConfigs");function Ps(vo){globalThis.defaultProjectAnnotations=vo}s$1(Ps,"setDefaultProjectAnnotations");var Fs="ComposedStory",Is$1="Unnamed Story";function Os(vo){return vo?fe([vo]):{}}s$1(Os,"extractAnnotation");function Ds(vo){let Ai=Array.isArray(vo)?vo:[vo];return globalThis.globalProjectAnnotations=fe(Ai.map(Os)),fe([globalThis.defaultProjectAnnotations??{},globalThis.globalProjectAnnotations??{}])}s$1(Ds,"setProjectAnnotations");var $=[];function po(vo,Ai,bo,Ra,pc){var mc;if(vo===void 0)throw new Error("Expected a story but received undefined.");Ai.title=Ai.title??Fs;let uf=We(Ai),df=pc||vo.storyName||((mc=vo.story)==null?void 0:mc.name)||vo.name||Is$1,ff=ve(df,vo,uf),hf=Fe(fe([Ra&&Object.keys(Ra).length>0?Ra:globalThis.defaultProjectAnnotations??{},globalThis.globalProjectAnnotations??{},bo??{}])),pf=Ce(ff,uf,hf),mf={...Ve(hf.globalTypes),...hf.initialGlobals,...pf.storyGlobals},gf=s$1(()=>{let xf=$e({hooks:new ee,globals:mf,args:{...pf.initialArgs},viewMode:"story",loaded:{},abortSignal:new AbortController().signal,step:s$1((wf,If)=>pf.runStep(wf,If,xf),"step"),canvasElement:null,canvas:{},globalTypes:hf.globalTypes,...pf,context:null,mount:null});return xf.context=xf,pf.renderToCanvas&&(xf.renderToCanvas=async()=>{var wf;let If=await((wf=pf.renderToCanvas)==null?void 0:wf.call(pf,{componentId:pf.componentId,title:pf.title,id:pf.id,name:pf.name,tags:pf.tags,showMain:s$1(()=>{},"showMain"),showError:s$1(l1=>{throw new Error(`${l1.title}
|
|
247
|
-
${l1.description}`)},"showError"),showException:s$1(l1=>{throw l1},"showException"),forceRemount:!0,storyContext:xf,storyFn:s$1(()=>pf.unboundStoryFn(xf),"storyFn"),unboundStoryFn:pf.unboundStoryFn},xf.canvasElement));If&&$.push(If)}),xf.mount=pf.mount(xf),xf},"initializeContext"),yf,vf=s$1(async xf=>{var wf;let If=gf();return If.canvasElement??(If.canvasElement=(wf=globalThis==null?void 0:globalThis.document)==null?void 0:wf.body),yf&&(If.loaded=yf.loaded),Object.assign(If,xf),pf.playFunction(If)},"play"),bf=s$1(xf=>{let wf=gf();return Object.assign(wf,xf),_s(pf,wf)},"run"),Sf=pf.playFunction?vf:void 0;return Object.assign(s$1(function(xf){let wf=gf();return yf&&(wf.loaded=yf.loaded),wf.args={...wf.initialArgs,...xf},pf.unboundStoryFn(wf)},"storyFn"),{id:pf.id,storyName:df,load:s$1(async()=>{for(let wf of[...$].reverse())await wf();$.length=0;let xf=gf();xf.loaded=await pf.applyLoaders(xf),$.push(...(await pf.applyBeforeEach(xf)).filter(Boolean)),yf=xf},"load"),globals:mf,args:pf.initialArgs,parameters:pf.parameters,argTypes:pf.argTypes,play:Sf,run:bf,tags:pf.tags})}s$1(po,"composeStory");var ks=s$1((vo,Ai,bo,Ra)=>po(vo,Ai,bo,{},Ra),"defaultComposeStory");function js(vo,Ai,bo=ks){let{default:Ra,__esModule:pc,__namedExportsOrder:mc,...uf}=vo;return Object.entries(uf).reduce((df,[ff,hf])=>M$1(ff,Ra)?Object.assign(df,{[ff]:bo(hf,Ra,Ai,ff)}):df,{})}s$1(js,"composeStories");function Ms(vo){return vo.extend({mount:s$1(async({mount:Ai,page:bo},Ra)=>{await Ra(async(pc,...mc)=>{if(!("__pw_type"in pc)||"__pw_type"in pc&&pc.__pw_type!=="jsx")throw new Error(F`
|
|
248
|
-
Portable stories in Playwright CT only work when referencing JSX elements.
|
|
249
|
-
Please use JSX format for your components such as:
|
|
250
|
-
|
|
251
|
-
instead of:
|
|
252
|
-
await mount(MyComponent, { props: { foo: 'bar' } })
|
|
253
|
-
|
|
254
|
-
do:
|
|
255
|
-
await mount(<MyComponent foo="bar"/>)
|
|
256
|
-
|
|
257
|
-
More info: https://storybook.js.org/docs/api/portable-stories-playwright
|
|
258
|
-
`);await bo.evaluate(async df=>{var ff,hf,pf;let mf=await((ff=globalThis.__pwUnwrapObject)==null?void 0:ff.call(globalThis,df));return(pf=(hf="__pw_type"in mf?mf.type:mf)==null?void 0:hf.load)==null?void 0:pf.call(hf)},pc);let uf=await Ai(pc,...mc);return await bo.evaluate(async df=>{var ff,hf;let pf=await((ff=globalThis.__pwUnwrapObject)==null?void 0:ff.call(globalThis,df)),mf="__pw_type"in pf?pf.type:pf,gf=document.querySelector("#root");return(hf=mf==null?void 0:mf.play)==null?void 0:hf.call(mf,{canvasElement:gf})},pc),uf})},"mount")})}s$1(Ms,"createPlaywrightTest");async function _s(vo,Ai){var bo,Ra;for(let uf of[...$].reverse())await uf();if($.length=0,!Ai.canvasElement){let uf=document.createElement("div");(Ra=(bo=globalThis==null?void 0:globalThis.document)==null?void 0:bo.body)==null||Ra.appendChild(uf),Ai.canvasElement=uf,$.push(()=>{var df,ff,hf,pf;(ff=(df=globalThis==null?void 0:globalThis.document)==null?void 0:df.body)!=null&&ff.contains(uf)&&((pf=(hf=globalThis==null?void 0:globalThis.document)==null?void 0:hf.body)==null||pf.removeChild(uf))})}if(Ai.loaded=await vo.applyLoaders(Ai),Ai.abortSignal.aborted)return;$.push(...(await vo.applyBeforeEach(Ai)).filter(Boolean));let pc=vo.playFunction,mc=vo.usesMount;mc||await Ai.mount(),!Ai.abortSignal.aborted&&pc&&(mc||(Ai.mount=async()=>{throw new J({playFunction:pc.toString()})}),await pc(Ai))}s$1(_s,"runStory");function fo(vo,Ai){return Rr(wr(vo,Ai),bo=>bo===void 0)}s$1(fo,"picky");var yo=1e3,qs=1e4,Gr=class{constructor(vo,Ai,bo){this.importFn=Ai,this.getStoriesJsonData=s$1(()=>{let mc=this.getSetStoriesPayload(),uf=["fileName","docsOnly","framework","__id","__isArgsStory"];return{v:3,stories:L(mc.stories,df=>{let{importPath:ff}=this.storyIndex.entries[df.id];return{...fo(df,["id","name","title"]),importPath:ff,kind:df.title,story:df.name,parameters:{...fo(df.parameters,uf),fileName:ff}}})}},"getStoriesJsonData"),this.storyIndex=new He(vo),this.projectAnnotations=Fe(bo);let{initialGlobals:Ra,globalTypes:pc}=this.projectAnnotations;this.args=new Ge,this.userGlobals=new Ue({globals:Ra,globalTypes:pc}),this.hooks={},this.cleanupCallbacks={},this.processCSFFileWithCache=(0,Ke.default)(yo)(to),this.prepareMetaWithCache=(0,Ke.default)(yo)(Nr),this.prepareStoryWithCache=(0,Ke.default)(qs)(Ce)}setProjectAnnotations(vo){this.projectAnnotations=Fe(vo);let{initialGlobals:Ai,globalTypes:bo}=vo;this.userGlobals.set({globals:Ai,globalTypes:bo})}async onStoriesChanged({importFn:vo,storyIndex:Ai}){vo&&(this.importFn=vo),Ai&&(this.storyIndex.entries=Ai.entries),this.cachedCSFFiles&&await this.cacheAllCSFFiles()}async storyIdToEntry(vo){return this.storyIndex.storyIdToEntry(vo)}async loadCSFFileByStoryId(vo){let{importPath:Ai,title:bo}=this.storyIndex.storyIdToEntry(vo),Ra=await this.importFn(Ai);return this.processCSFFileWithCache(Ra,Ai,bo)}async loadAllCSFFiles(){let vo={};return Object.entries(this.storyIndex.entries).forEach(([Ai,{importPath:bo}])=>{vo[bo]=Ai}),(await Promise.all(Object.entries(vo).map(async([Ai,bo])=>({importPath:Ai,csfFile:await this.loadCSFFileByStoryId(bo)})))).reduce((Ai,{importPath:bo,csfFile:Ra})=>(Ai[bo]=Ra,Ai),{})}async cacheAllCSFFiles(){this.cachedCSFFiles=await this.loadAllCSFFiles()}preparedMetaFromCSFFile({csfFile:vo}){let Ai=vo.meta;return this.prepareMetaWithCache(Ai,this.projectAnnotations,vo.moduleExports.default)}async loadStory({storyId:vo}){let Ai=await this.loadCSFFileByStoryId(vo);return this.storyFromCSFFile({storyId:vo,csfFile:Ai})}storyFromCSFFile({storyId:vo,csfFile:Ai}){let bo=Ai.stories[vo];if(!bo)throw new X$1({storyId:vo});let Ra=Ai.meta,pc=this.prepareStoryWithCache(bo,Ra,this.projectAnnotations);return this.args.setInitial(pc),this.hooks[pc.id]=this.hooks[pc.id]||new ee,pc}componentStoriesFromCSFFile({csfFile:vo}){return Object.keys(this.storyIndex.entries).filter(Ai=>!!vo.stories[Ai]).map(Ai=>this.storyFromCSFFile({storyId:Ai,csfFile:vo}))}async loadEntry(vo){let Ai=await this.storyIdToEntry(vo),bo=Ai.type==="docs"?Ai.storiesImports:[],[Ra,...pc]=await Promise.all([this.importFn(Ai.importPath),...bo.map(mc=>{let uf=this.storyIndex.importPathToEntry(mc);return this.loadCSFFileByStoryId(uf.id)})]);return{entryExports:Ra,csfFiles:pc}}getStoryContext(vo,{forceInitialArgs:Ai=!1}={}){let bo=this.userGlobals.get(),{initialGlobals:Ra}=this.userGlobals;return $e({...vo,args:Ai?vo.initialArgs:this.args.get(vo.id),initialGlobals:Ra,globalTypes:this.projectAnnotations.globalTypes,userGlobals:bo,globals:{...bo,...vo.storyGlobals},hooks:this.hooks[vo.id]})}addCleanupCallbacks(vo,Ai){this.cleanupCallbacks[vo.id]=Ai}async cleanupStory(vo){this.hooks[vo.id].clean();let Ai=this.cleanupCallbacks[vo.id];if(Ai)for(let bo of[...Ai].reverse())await bo();delete this.cleanupCallbacks[vo.id]}extract(vo={includeDocsOnly:!1}){let{cachedCSFFiles:Ai}=this;if(!Ai)throw new L$1;return Object.entries(this.storyIndex.entries).reduce((bo,[Ra,{type:pc,importPath:mc}])=>{if(pc==="docs")return bo;let uf=Ai[mc],df=this.storyFromCSFFile({storyId:Ra,csfFile:uf});return!vo.includeDocsOnly&&df.parameters.docsOnly||(bo[Ra]=Object.entries(df).reduce((ff,[hf,pf])=>hf==="moduleExport"||typeof pf=="function"?ff:Array.isArray(pf)?Object.assign(ff,{[hf]:pf.slice().sort()}):Object.assign(ff,{[hf]:pf}),{args:df.initialArgs})),bo},{})}getSetStoriesPayload(){let vo=this.extract({includeDocsOnly:!0}),Ai=Object.values(vo).reduce((bo,{title:Ra})=>(bo[Ra]={},bo),{});return{v:2,globals:this.userGlobals.get(),globalParameters:{},kindParameters:Ai,stories:vo}}raw(){return m$2("StoryStore.raw() is deprecated and will be removed in 9.0, please use extract() instead"),Object.values(this.extract()).map(({id:vo})=>this.fromId(vo)).filter(Boolean)}fromId(vo){if(m$2("StoryStore.fromId() is deprecated and will be removed in 9.0, please use loadStory() instead"),!this.cachedCSFFiles)throw new Error("Cannot call fromId/raw() unless you call cacheAllCSFFiles() first.");let Ai;try{({importPath:Ai}=this.storyIndex.storyIdToEntry(vo))}catch{return null}let bo=this.cachedCSFFiles[Ai],Ra=this.storyFromCSFFile({storyId:vo,csfFile:bo});return{...Ra,storyFn:s$1(pc=>{let mc={...this.getStoryContext(Ra),abortSignal:new AbortController().signal,canvasElement:null,loaded:{},step:s$1((uf,df)=>Ra.runStep(uf,df,mc),"step"),context:null,mount:null,canvas:{},viewMode:"story"};return Ra.unboundStoryFn({...mc,...pc})},"storyFn")}}};s$1(Gr,"StoryStore");var ye=Gr;function Vr(vo){return vo.startsWith("\\\\?\\")?vo:vo.replace(/\\/g,"/")}s$1(Vr,"slash");function mo(vo){return vo.flatMap(Ai=>Ai.split("/")).filter(Boolean).join("/")}s$1(mo,"pathJoin");var Y=new Error("prepareAborted"),{AbortController:To}=globalThis;function xo(vo){try{let{name:Ai="Error",message:bo=String(vo),stack:Ra}=vo;return{name:Ai,message:bo,stack:Ra}}catch{return{name:"Error",message:String(vo)}}}s$1(xo,"serializeError");var Ur=class{constructor(vo,Ai,bo,Ra,pc,mc,uf={autoplay:!0,forceInitialArgs:!1},df){this.channel=vo,this.store=Ai,this.renderToScreen=bo,this.callbacks=Ra,this.id=pc,this.viewMode=mc,this.renderOptions=uf,this.type="story",this.notYetRendered=!0,this.rerenderEnqueued=!1,this.disableKeyListeners=!1,this.teardownRender=s$1(()=>{},"teardownRender"),this.torndown=!1,this.abortController=new To,df&&(this.story=df,this.phase="preparing")}async runPhase(vo,Ai,bo){this.phase=Ai,this.channel.emit(B$2,{newPhase:this.phase,storyId:this.id}),bo&&(await bo(),this.checkIfAborted(vo))}checkIfAborted(vo){return vo.aborted?(this.phase="aborted",this.channel.emit(B$2,{newPhase:this.phase,storyId:this.id}),!0):!1}async prepare(){if(await this.runPhase(this.abortController.signal,"preparing",async()=>{this.story=await this.store.loadStory({storyId:this.id})}),this.abortController.signal.aborted)throw await this.store.cleanupStory(this.story),Y}isEqual(vo){return!!(this.id===vo.id&&this.story&&this.story===vo.story)}isPreparing(){return["preparing"].includes(this.phase)}isPending(){return["loading","beforeEach","rendering","playing"].includes(this.phase)}async renderToElement(vo){return this.canvasElement=vo,this.render({initial:!0,forceRemount:!0})}storyContext(){if(!this.story)throw new Error("Cannot call storyContext before preparing");let{forceInitialArgs:vo}=this.renderOptions;return this.store.getStoryContext(this.story,{forceInitialArgs:vo})}async render({initial:vo=!1,forceRemount:Ai=!1}={}){var bo,Ra,pc,mc;let{canvasElement:uf}=this;if(!this.story)throw new Error("cannot render when not prepared");let df=this.story;if(!uf)throw new Error("cannot render when canvasElement is unset");let{id:ff,componentId:hf,title:pf,name:mf,tags:gf,applyLoaders:yf,applyBeforeEach:vf,unboundStoryFn:bf,playFunction:Sf,runStep:xf}=df;Ai&&!vo&&(this.cancelRender(),this.abortController=new To);let wf=this.abortController.signal,If=!1,l1=df.usesMount;try{let s1={...this.storyContext(),viewMode:this.viewMode,abortSignal:wf,canvasElement:uf,loaded:{},step:s$1((P1,E1)=>xf(P1,E1,s1),"step"),context:null,canvas:{},renderToCanvas:s$1(async()=>{let P1=await this.renderToScreen(c1,uf);this.teardownRender=P1||(()=>{}),If=!0},"renderToCanvas"),mount:s$1(async(...P1)=>{var E1,M1;(M1=(E1=this.callbacks).showStoryDuringRender)==null||M1.call(E1);let m1=null;return await this.runPhase(wf,"rendering",async()=>{m1=await df.mount(s1)(...P1)}),l1&&await this.runPhase(wf,"playing"),m1},"mount")};s1.context=s1;let c1={componentId:hf,title:pf,kind:pf,id:ff,name:mf,story:mf,tags:gf,...this.callbacks,showError:s$1(P1=>(this.phase="errored",this.callbacks.showError(P1)),"showError"),showException:s$1(P1=>(this.phase="errored",this.callbacks.showException(P1)),"showException"),forceRemount:Ai||this.notYetRendered,storyContext:s1,storyFn:s$1(()=>bf(s1),"storyFn"),unboundStoryFn:bf};if(await this.runPhase(wf,"loading",async()=>{s1.loaded=await yf(s1)}),wf.aborted)return;let u1=await vf(s1);if(this.store.addCleanupCallbacks(df,u1),this.checkIfAborted(wf)||(!If&&!l1&&await s1.mount(),this.notYetRendered=!1,wf.aborted))return;let T1=((Ra=(bo=this.story.parameters)==null?void 0:bo.test)==null?void 0:Ra.dangerouslyIgnoreUnhandledErrors)===!0,_1=new Set,R1=s$1(P1=>_1.add("error"in P1?P1.error:P1.reason),"onError");if(this.renderOptions.autoplay&&Ai&&Sf&&this.phase!=="errored"){window.addEventListener("error",R1),window.addEventListener("unhandledrejection",R1),this.disableKeyListeners=!0;try{if(l1?await Sf(s1):(s1.mount=async()=>{throw new J({playFunction:Sf.toString()})},await this.runPhase(wf,"playing",async()=>Sf(s1))),!If)throw new z$1;this.checkIfAborted(wf),!T1&&_1.size>0?await this.runPhase(wf,"errored"):await this.runPhase(wf,"played")}catch(P1){if((mc=(pc=this.callbacks).showStoryDuringRender)==null||mc.call(pc),await this.runPhase(wf,"errored",async()=>{this.channel.emit(a,xo(P1))}),this.story.parameters.throwPlayFunctionExceptions!==!1)throw P1;console.error(P1)}if(!T1&&_1.size>0&&this.channel.emit(Y$2,Array.from(_1).map(xo)),this.disableKeyListeners=!1,window.removeEventListener("unhandledrejection",R1),window.removeEventListener("error",R1),wf.aborted)return}await this.runPhase(wf,"completed",async()=>this.channel.emit(X$2,ff))}catch(s1){this.phase="errored",this.callbacks.showException(s1)}this.rerenderEnqueued&&(this.rerenderEnqueued=!1,this.render())}async rerender(){if(this.isPending()&&this.phase!=="playing")this.rerenderEnqueued=!0;else return this.render()}async remount(){return await this.teardown(),this.render({forceRemount:!0})}cancelRender(){var vo;(vo=this.abortController)==null||vo.abort()}async teardown(){this.torndown=!0,this.cancelRender(),this.story&&await this.store.cleanupStory(this.story);for(let vo=0;vo<3;vo+=1){if(!this.isPending()){await this.teardownRender();return}await new Promise(Ai=>setTimeout(Ai,0))}window.location.reload(),await new Promise(()=>{})}};s$1(Ur,"StoryRender");var ne=Ur,{fetch:di}=v,pi="./index.json",Hr=class{constructor(vo,Ai,bo=q.getChannel(),Ra=!0){this.importFn=vo,this.getProjectAnnotations=Ai,this.channel=bo,this.storyRenders=[],this.storeInitializationPromise=new Promise((pc,mc)=>{this.resolveStoreInitializationPromise=pc,this.rejectStoreInitializationPromise=mc}),Ra&&this.initialize()}get storyStore(){return new Proxy({},{get:s$1((vo,Ai)=>{if(this.storyStoreValue)return m$2("Accessing the Story Store is deprecated and will be removed in 9.0"),this.storyStoreValue[Ai];throw new U$1},"get")})}async initialize(){this.setupListeners();try{let vo=await this.getProjectAnnotationsOrRenderError();await this.runBeforeAllHook(vo),await this.initializeWithProjectAnnotations(vo)}catch(vo){this.rejectStoreInitializationPromise(vo)}}ready(){return this.storeInitializationPromise}setupListeners(){this.channel.on(m$1$1,this.onStoryIndexChanged.bind(this)),this.channel.on(j,this.onUpdateGlobals.bind(this)),this.channel.on(n$1,this.onUpdateArgs.bind(this)),this.channel.on(RE,this.onRequestArgTypesInfo.bind(this)),this.channel.on(H$2,this.onResetArgs.bind(this)),this.channel.on(L$2,this.onForceReRender.bind(this)),this.channel.on(P$3,this.onForceRemount.bind(this))}async getProjectAnnotationsOrRenderError(){try{let vo=await this.getProjectAnnotations();if(this.renderToCanvas=vo.renderToCanvas,!this.renderToCanvas)throw new G$1;return vo}catch(vo){throw this.renderPreviewEntryError("Error reading preview.js:",vo),vo}}async initializeWithProjectAnnotations(vo){this.projectAnnotationsBeforeInitialization=vo;try{let Ai=await this.getStoryIndexFromServer();return this.initializeWithStoryIndex(Ai)}catch(Ai){throw this.renderPreviewEntryError("Error loading story index:",Ai),Ai}}async runBeforeAllHook(vo){var Ai,bo;try{await((Ai=this.beforeAllCleanup)==null?void 0:Ai.call(this)),this.beforeAllCleanup=await((bo=vo.beforeAll)==null?void 0:bo.call(vo))}catch(Ra){throw this.renderPreviewEntryError("Error in beforeAll hook:",Ra),Ra}}async getStoryIndexFromServer(){let vo=await di(pi);if(vo.status===200)return vo.json();throw new M$2({text:await vo.text()})}initializeWithStoryIndex(vo){if(!this.projectAnnotationsBeforeInitialization)throw new Error("Cannot call initializeWithStoryIndex until project annotations resolve");this.storyStoreValue=new ye(vo,this.importFn,this.projectAnnotationsBeforeInitialization),delete this.projectAnnotationsBeforeInitialization,this.setInitialGlobals(),this.resolveStoreInitializationPromise()}async setInitialGlobals(){this.emitGlobals()}emitGlobals(){if(!this.storyStoreValue)throw new Y$1({methodName:"emitGlobals"});let vo={globals:this.storyStoreValue.userGlobals.get()||{},globalTypes:this.storyStoreValue.projectAnnotations.globalTypes||{}};this.channel.emit(u$1,vo)}async onGetProjectAnnotationsChanged({getProjectAnnotations:vo}){delete this.previewEntryError,this.getProjectAnnotations=vo;let Ai=await this.getProjectAnnotationsOrRenderError();if(await this.runBeforeAllHook(Ai),!this.storyStoreValue){await this.initializeWithProjectAnnotations(Ai);return}this.storyStoreValue.setProjectAnnotations(Ai),this.emitGlobals()}async onStoryIndexChanged(){if(delete this.previewEntryError,!(!this.storyStoreValue&&!this.projectAnnotationsBeforeInitialization))try{let vo=await this.getStoryIndexFromServer();if(this.projectAnnotationsBeforeInitialization){this.initializeWithStoryIndex(vo);return}await this.onStoriesChanged({storyIndex:vo})}catch(vo){throw this.renderPreviewEntryError("Error loading story index:",vo),vo}}async onStoriesChanged({importFn:vo,storyIndex:Ai}){if(!this.storyStoreValue)throw new Y$1({methodName:"onStoriesChanged"});await this.storyStoreValue.onStoriesChanged({importFn:vo,storyIndex:Ai})}async onUpdateGlobals({globals:vo,currentStory:Ai}){if(this.storyStoreValue||await this.storeInitializationPromise,!this.storyStoreValue)throw new Y$1({methodName:"onUpdateGlobals"});if(this.storyStoreValue.userGlobals.update(vo),Ai){let{initialGlobals:bo,storyGlobals:Ra,userGlobals:pc,globals:mc}=this.storyStoreValue.getStoryContext(Ai);this.channel.emit(U$3,{initialGlobals:bo,userGlobals:pc,storyGlobals:Ra,globals:mc})}else{let{initialGlobals:bo,globals:Ra}=this.storyStoreValue.userGlobals;this.channel.emit(U$3,{initialGlobals:bo,userGlobals:Ra,storyGlobals:{},globals:Ra})}await Promise.all(this.storyRenders.map(bo=>bo.rerender()))}async onUpdateArgs({storyId:vo,updatedArgs:Ai}){if(!this.storyStoreValue)throw new Y$1({methodName:"onUpdateArgs"});this.storyStoreValue.args.update(vo,Ai),await Promise.all(this.storyRenders.filter(bo=>bo.id===vo&&!bo.renderOptions.forceInitialArgs).map(bo=>bo.story&&bo.story.usesMount?bo.remount():bo.rerender())),this.channel.emit(Q,{storyId:vo,args:this.storyStoreValue.args.get(vo)})}async onRequestArgTypesInfo({id:vo,payload:Ai}){var bo;try{await this.storeInitializationPromise;let Ra=await((bo=this.storyStoreValue)==null?void 0:bo.loadStory(Ai));this.channel.emit(SE,{id:vo,success:!0,payload:{argTypes:(Ra==null?void 0:Ra.argTypes)||{}},error:null})}catch(Ra){this.channel.emit(SE,{id:vo,success:!1,error:Ra==null?void 0:Ra.message})}}async onResetArgs({storyId:vo,argNames:Ai}){var bo;if(!this.storyStoreValue)throw new Y$1({methodName:"onResetArgs"});let Ra=((bo=this.storyRenders.find(mc=>mc.id===vo))==null?void 0:bo.story)||await this.storyStoreValue.loadStory({storyId:vo}),pc=(Ai||[...new Set([...Object.keys(Ra.initialArgs),...Object.keys(this.storyStoreValue.args.get(vo))])]).reduce((mc,uf)=>(mc[uf]=Ra.initialArgs[uf],mc),{});await this.onUpdateArgs({storyId:vo,updatedArgs:pc})}async onForceReRender(){await Promise.all(this.storyRenders.map(vo=>vo.rerender()))}async onForceRemount({storyId:vo}){await Promise.all(this.storyRenders.filter(Ai=>Ai.id===vo).map(Ai=>Ai.remount()))}renderStoryToElement(vo,Ai,bo,Ra){if(!this.renderToCanvas||!this.storyStoreValue)throw new Y$1({methodName:"renderStoryToElement"});let pc=new ne(this.channel,this.storyStoreValue,this.renderToCanvas,bo,vo.id,"docs",Ra,vo);return pc.renderToElement(Ai),this.storyRenders.push(pc),async()=>{await this.teardownRender(pc)}}async teardownRender(vo,{viewModeChanged:Ai}={}){var bo;this.storyRenders=this.storyRenders.filter(Ra=>Ra!==vo),await((bo=vo==null?void 0:vo.teardown)==null?void 0:bo.call(vo,{viewModeChanged:Ai}))}async loadStory({storyId:vo}){if(!this.storyStoreValue)throw new Y$1({methodName:"loadStory"});return this.storyStoreValue.loadStory({storyId:vo})}getStoryContext(vo,{forceInitialArgs:Ai=!1}={}){if(!this.storyStoreValue)throw new Y$1({methodName:"getStoryContext"});return this.storyStoreValue.getStoryContext(vo,{forceInitialArgs:Ai})}async extract(vo){if(!this.storyStoreValue)throw new Y$1({methodName:"extract"});if(this.previewEntryError)throw this.previewEntryError;return await this.storyStoreValue.cacheAllCSFFiles(),this.storyStoreValue.extract(vo)}renderPreviewEntryError(vo,Ai){this.previewEntryError=Ai,s$3.error(vo),s$3.error(Ai),this.channel.emit(N$2,Ai)}};s$1(Hr,"Preview");var me=Hr,Wr="Invariant failed";function Xe(vo,Ai){if(!vo){var bo=typeof Ai=="function"?Ai():Ai,Ra=bo?"".concat(Wr,": ").concat(bo):Wr;throw new Error(Ra)}}s$1(Xe,"invariant");var $r=class{constructor(vo,Ai,bo,Ra){this.channel=vo,this.store=Ai,this.renderStoryToElement=bo,this.storyIdByName=s$1(pc=>{let mc=this.nameToStoryId.get(pc);if(mc)return mc;throw new Error(`No story found with that name: ${pc}`)},"storyIdByName"),this.componentStories=s$1(()=>this.componentStoriesValue,"componentStories"),this.componentStoriesFromCSFFile=s$1(pc=>this.store.componentStoriesFromCSFFile({csfFile:pc}),"componentStoriesFromCSFFile"),this.storyById=s$1(pc=>{if(!pc){if(!this.primaryStory)throw new Error("No primary story defined for docs entry. Did you forget to use `<Meta>`?");return this.primaryStory}let mc=this.storyIdToCSFFile.get(pc);if(!mc)throw new Error(`Called \`storyById\` for story that was never loaded: ${pc}`);return this.store.storyFromCSFFile({storyId:pc,csfFile:mc})},"storyById"),this.getStoryContext=s$1(pc=>({...this.store.getStoryContext(pc),loaded:{},viewMode:"docs"}),"getStoryContext"),this.loadStory=s$1(pc=>this.store.loadStory({storyId:pc}),"loadStory"),this.componentStoriesValue=[],this.storyIdToCSFFile=new Map,this.exportToStory=new Map,this.exportsToCSFFile=new Map,this.nameToStoryId=new Map,this.attachedCSFFiles=new Set,Ra.forEach((pc,mc)=>{this.referenceCSFFile(pc)})}referenceCSFFile(vo){this.exportsToCSFFile.set(vo.moduleExports,vo),this.exportsToCSFFile.set(vo.moduleExports.default,vo),this.store.componentStoriesFromCSFFile({csfFile:vo}).forEach(Ai=>{let bo=vo.stories[Ai.id];this.storyIdToCSFFile.set(bo.id,vo),this.exportToStory.set(bo.moduleExport,Ai)})}attachCSFFile(vo){if(!this.exportsToCSFFile.has(vo.moduleExports))throw new Error("Cannot attach a CSF file that has not been referenced");this.attachedCSFFiles.has(vo)||(this.attachedCSFFiles.add(vo),this.store.componentStoriesFromCSFFile({csfFile:vo}).forEach(Ai=>{this.nameToStoryId.set(Ai.name,Ai.id),this.componentStoriesValue.push(Ai),this.primaryStory||(this.primaryStory=Ai)}))}referenceMeta(vo,Ai){let bo=this.resolveModuleExport(vo);if(bo.type!=="meta")throw new Error("<Meta of={} /> must reference a CSF file module export or meta export. Did you mistakenly reference your component instead of your CSF file?");Ai&&this.attachCSFFile(bo.csfFile)}get projectAnnotations(){let{projectAnnotations:vo}=this.store;if(!vo)throw new Error("Can't get projectAnnotations from DocsContext before they are initialized");return vo}resolveAttachedModuleExportType(vo){if(vo==="story"){if(!this.primaryStory)throw new Error("No primary story attached to this docs file, did you forget to use <Meta of={} />?");return{type:"story",story:this.primaryStory}}if(this.attachedCSFFiles.size===0)throw new Error("No CSF file attached to this docs file, did you forget to use <Meta of={} />?");let Ai=Array.from(this.attachedCSFFiles)[0];if(vo==="meta")return{type:"meta",csfFile:Ai};let{component:bo}=Ai.meta;if(!bo)throw new Error("Attached CSF file does not defined a component, did you forget to export one?");return{type:"component",component:bo}}resolveModuleExport(vo){let Ai=this.exportsToCSFFile.get(vo);if(Ai)return{type:"meta",csfFile:Ai};let bo=this.exportToStory.get(vo);return bo?{type:"story",story:bo}:{type:"component",component:vo}}resolveOf(vo,Ai=[]){let bo;if(["component","meta","story"].includes(vo)){let Ra=vo;bo=this.resolveAttachedModuleExportType(Ra)}else bo=this.resolveModuleExport(vo);if(Ai.length&&!Ai.includes(bo.type)){let Ra=bo.type==="component"?"component or unknown":bo.type;throw new Error(F`Invalid value passed to the 'of' prop. The value was resolved to a '${Ra}' type but the only types for this block are: ${Ai.join(", ")}.
|
|
259
|
-
- Did you pass a component to the 'of' prop when the block only supports a story or a meta?
|
|
260
|
-
- ... or vice versa?
|
|
261
|
-
- Did you pass a story, CSF file or meta to the 'of' prop that is not indexed, ie. is not targeted by the 'stories' globs in the main configuration?`)}switch(bo.type){case"component":return{...bo,projectAnnotations:this.projectAnnotations};case"meta":return{...bo,preparedMeta:this.store.preparedMetaFromCSFFile({csfFile:bo.csfFile})};case"story":default:return bo}}};s$1($r,"DocsContext");var K=$r,Yr=class{constructor(vo,Ai,bo,Ra){this.channel=vo,this.store=Ai,this.entry=bo,this.callbacks=Ra,this.type="docs",this.subtype="csf",this.torndown=!1,this.disableKeyListeners=!1,this.preparing=!1,this.id=bo.id}isPreparing(){return this.preparing}async prepare(){this.preparing=!0;let{entryExports:vo,csfFiles:Ai=[]}=await this.store.loadEntry(this.id);if(this.torndown)throw Y;let{importPath:bo,title:Ra}=this.entry,pc=this.store.processCSFFileWithCache(vo,bo,Ra),mc=Object.keys(pc.stories)[0];this.story=this.store.storyFromCSFFile({storyId:mc,csfFile:pc}),this.csfFiles=[pc,...Ai],this.preparing=!1}isEqual(vo){return!!(this.id===vo.id&&this.story&&this.story===vo.story)}docsContext(vo){if(!this.csfFiles)throw new Error("Cannot render docs before preparing");let Ai=new K(this.channel,this.store,vo,this.csfFiles);return this.csfFiles.forEach(bo=>Ai.attachCSFFile(bo)),Ai}async renderToElement(vo,Ai){if(!this.story||!this.csfFiles)throw new Error("Cannot render docs before preparing");let bo=this.docsContext(Ai),{docs:Ra}=this.story.parameters||{};if(!Ra)throw new Error("Cannot render a story in viewMode=docs if `@storybook/addon-docs` is not installed");let pc=await Ra.renderer(),{render:mc}=pc,uf=s$1(async()=>{try{await mc(bo,Ra,vo),this.channel.emit(I$2,this.id)}catch(df){this.callbacks.showException(df)}},"renderDocs");return this.rerender=async()=>uf(),this.teardownRender=async({viewModeChanged:df})=>{!df||!vo||pc.unmount(vo)},uf()}async teardown({viewModeChanged:vo}={}){var Ai;(Ai=this.teardownRender)==null||Ai.call(this,{viewModeChanged:vo}),this.torndown=!0}};s$1(Yr,"CsfDocsRender");var De=Yr,Kr=class{constructor(vo,Ai,bo,Ra){this.channel=vo,this.store=Ai,this.entry=bo,this.callbacks=Ra,this.type="docs",this.subtype="mdx",this.torndown=!1,this.disableKeyListeners=!1,this.preparing=!1,this.id=bo.id}isPreparing(){return this.preparing}async prepare(){this.preparing=!0;let{entryExports:vo,csfFiles:Ai=[]}=await this.store.loadEntry(this.id);if(this.torndown)throw Y;this.csfFiles=Ai,this.exports=vo,this.preparing=!1}isEqual(vo){return!!(this.id===vo.id&&this.exports&&this.exports===vo.exports)}docsContext(vo){if(!this.csfFiles)throw new Error("Cannot render docs before preparing");return new K(this.channel,this.store,vo,this.csfFiles)}async renderToElement(vo,Ai){if(!this.exports||!this.csfFiles||!this.store.projectAnnotations)throw new Error("Cannot render docs before preparing");let bo=this.docsContext(Ai),{docs:Ra}=this.store.projectAnnotations.parameters||{};if(!Ra)throw new Error("Cannot render a story in viewMode=docs if `@storybook/addon-docs` is not installed");let pc={...Ra,page:this.exports.default},mc=await Ra.renderer(),{render:uf}=mc,df=s$1(async()=>{try{await uf(bo,pc,vo),this.channel.emit(I$2,this.id)}catch(ff){this.callbacks.showException(ff)}},"renderDocs");return this.rerender=async()=>df(),this.teardownRender=async({viewModeChanged:ff}={})=>{!ff||!vo||(mc.unmount(vo),this.torndown=!0)},df()}async teardown({viewModeChanged:vo}={}){var Ai;(Ai=this.teardownRender)==null||Ai.call(this,{viewModeChanged:vo}),this.torndown=!0}};s$1(Kr,"MdxDocsRender");var ke=Kr,Fi=globalThis;function Ii(vo){let Ai=vo.composedPath&&vo.composedPath()[0]||vo.target;return/input|textarea/i.test(Ai.tagName)||Ai.getAttribute("contenteditable")!==null}s$1(Ii,"focusInInput");var Fo="attached-mdx",Oi="unattached-mdx";function Di({tags:vo}){return(vo==null?void 0:vo.includes(Oi))||(vo==null?void 0:vo.includes(Fo))}s$1(Di,"isMdxEntry");function Jr(vo){return vo.type==="story"}s$1(Jr,"isStoryRender");function ki(vo){return vo.type==="docs"}s$1(ki,"isDocsRender");function ji(vo){return ki(vo)&&vo.subtype==="csf"}s$1(ji,"isCsfDocsRender");var Qr=class extends me{constructor(vo,Ai,bo,Ra){super(vo,Ai,void 0,!1),this.importFn=vo,this.getProjectAnnotations=Ai,this.selectionStore=bo,this.view=Ra,this.initialize()}setupListeners(){super.setupListeners(),Fi.onkeydown=this.onKeydown.bind(this),this.channel.on(p$2,this.onSetCurrentStory.bind(this)),this.channel.on(k$4,this.onUpdateQueryParams.bind(this)),this.channel.on(t$4,this.onPreloadStories.bind(this))}async setInitialGlobals(){if(!this.storyStoreValue)throw new Y$1({methodName:"setInitialGlobals"});let{globals:vo}=this.selectionStore.selectionSpecifier||{};vo&&this.storyStoreValue.userGlobals.updateFromPersisted(vo),this.emitGlobals()}async initializeWithStoryIndex(vo){return await super.initializeWithStoryIndex(vo),this.selectSpecifiedStory()}async selectSpecifiedStory(){if(!this.storyStoreValue)throw new Y$1({methodName:"selectSpecifiedStory"});if(this.selectionStore.selection){await this.renderSelection();return}if(!this.selectionStore.selectionSpecifier){this.renderMissingStory();return}let{storySpecifier:vo,args:Ai}=this.selectionStore.selectionSpecifier,bo=this.storyStoreValue.storyIndex.entryFromSpecifier(vo);if(!bo){vo==="*"?this.renderStoryLoadingException(vo,new F$2):this.renderStoryLoadingException(vo,new K$1({storySpecifier:vo.toString()}));return}let{id:Ra,type:pc}=bo;this.selectionStore.setSelection({storyId:Ra,viewMode:pc}),this.channel.emit(q$3,this.selectionStore.selection),this.channel.emit(r$2,this.selectionStore.selection),await this.renderSelection({persistedArgs:Ai})}async onGetProjectAnnotationsChanged({getProjectAnnotations:vo}){await super.onGetProjectAnnotationsChanged({getProjectAnnotations:vo}),this.selectionStore.selection&&this.renderSelection()}async onStoriesChanged({importFn:vo,storyIndex:Ai}){await super.onStoriesChanged({importFn:vo,storyIndex:Ai}),this.selectionStore.selection?await this.renderSelection():await this.selectSpecifiedStory()}onKeydown(vo){if(!this.storyRenders.find(Ai=>Ai.disableKeyListeners)&&!Ii(vo)){let{altKey:Ai,ctrlKey:bo,metaKey:Ra,shiftKey:pc,key:mc,code:uf,keyCode:df}=vo;this.channel.emit(W$2,{event:{altKey:Ai,ctrlKey:bo,metaKey:Ra,shiftKey:pc,key:mc,code:uf,keyCode:df}})}}async onSetCurrentStory(vo){this.selectionStore.setSelection({viewMode:"story",...vo}),await this.storeInitializationPromise,this.channel.emit(r$2,this.selectionStore.selection),this.renderSelection()}onUpdateQueryParams(vo){this.selectionStore.setQueryParams(vo)}async onUpdateGlobals({globals:vo}){var Ai,bo;let Ra=this.currentRender instanceof ne&&this.currentRender.story||void 0;super.onUpdateGlobals({globals:vo,currentStory:Ra}),(this.currentRender instanceof ke||this.currentRender instanceof De)&&await((bo=(Ai=this.currentRender).rerender)==null?void 0:bo.call(Ai))}async onUpdateArgs({storyId:vo,updatedArgs:Ai}){super.onUpdateArgs({storyId:vo,updatedArgs:Ai})}async onPreloadStories({ids:vo}){await this.storeInitializationPromise,this.storyStoreValue&&await Promise.allSettled(vo.map(Ai=>{var bo;return(bo=this.storyStoreValue)==null?void 0:bo.loadEntry(Ai)}))}async renderSelection({persistedArgs:vo}={}){var Ai,bo,Ra,pc;let{renderToCanvas:mc}=this;if(!this.storyStoreValue||!mc)throw new Y$1({methodName:"renderSelection"});let{selection:uf}=this.selectionStore;if(!uf)throw new Error("Cannot call renderSelection as no selection was made");let{storyId:df}=uf,ff;try{ff=await this.storyStoreValue.storyIdToEntry(df)}catch(bf){this.currentRender&&await this.teardownRender(this.currentRender),this.renderStoryLoadingException(df,bf);return}let hf=((Ai=this.currentSelection)==null?void 0:Ai.storyId)!==df,pf=((bo=this.currentRender)==null?void 0:bo.type)!==ff.type;ff.type==="story"?this.view.showPreparingStory({immediate:pf}):this.view.showPreparingDocs({immediate:pf}),(Ra=this.currentRender)!=null&&Ra.isPreparing()&&await this.teardownRender(this.currentRender);let mf;ff.type==="story"?mf=new ne(this.channel,this.storyStoreValue,mc,this.mainStoryCallbacks(df),df,"story"):Di(ff)?mf=new ke(this.channel,this.storyStoreValue,ff,this.mainStoryCallbacks(df)):mf=new De(this.channel,this.storyStoreValue,ff,this.mainStoryCallbacks(df));let gf=this.currentSelection;this.currentSelection=uf;let yf=this.currentRender;this.currentRender=mf;try{await mf.prepare()}catch(bf){yf&&await this.teardownRender(yf),bf!==Y&&this.renderStoryLoadingException(df,bf);return}let vf=!hf&&yf&&!mf.isEqual(yf);if(vo&&Jr(mf)&&(Xe(!!mf.story),this.storyStoreValue.args.updateFromPersisted(mf.story,vo)),yf&&!yf.torndown&&!hf&&!vf&&!pf){this.currentRender=yf,this.channel.emit(K$2,df),this.view.showMain();return}if(yf&&await this.teardownRender(yf,{viewModeChanged:pf}),gf&&(hf||pf)&&this.channel.emit(f$2,df),Jr(mf)){Xe(!!mf.story);let{parameters:bf,initialArgs:Sf,argTypes:xf,unmappedArgs:wf,initialGlobals:If,userGlobals:l1,storyGlobals:s1,globals:c1}=this.storyStoreValue.getStoryContext(mf.story);this.channel.emit(w$2,{id:df,parameters:bf,initialArgs:Sf,argTypes:xf,args:wf}),this.channel.emit(U$3,{userGlobals:l1,storyGlobals:s1,globals:c1,initialGlobals:If})}else{let{parameters:bf}=this.storyStoreValue.projectAnnotations,{initialGlobals:Sf,globals:xf}=this.storyStoreValue.userGlobals;if(this.channel.emit(U$3,{globals:xf,initialGlobals:Sf,storyGlobals:{},userGlobals:xf}),ji(mf)||((pc=mf.entry.tags)==null?void 0:pc.includes(Fo))){if(!mf.csfFiles)throw new H({storyId:df});({parameters:bf}=this.storyStoreValue.preparedMetaFromCSFFile({csfFile:mf.csfFiles[0]}))}this.channel.emit(D$3,{id:df,parameters:bf})}Jr(mf)?(Xe(!!mf.story),this.storyRenders.push(mf),this.currentRender.renderToElement(this.view.prepareForStory(mf.story))):this.currentRender.renderToElement(this.view.prepareForDocs(),this.renderStoryToElement.bind(this))}async teardownRender(vo,{viewModeChanged:Ai=!1}={}){var bo;this.storyRenders=this.storyRenders.filter(Ra=>Ra!==vo),await((bo=vo==null?void 0:vo.teardown)==null?void 0:bo.call(vo,{viewModeChanged:Ai}))}mainStoryCallbacks(vo){return{showStoryDuringRender:s$1(()=>this.view.showStoryDuringRender(),"showStoryDuringRender"),showMain:s$1(()=>this.view.showMain(),"showMain"),showError:s$1(Ai=>this.renderError(vo,Ai),"showError"),showException:s$1(Ai=>this.renderException(vo,Ai),"showException")}}renderPreviewEntryError(vo,Ai){super.renderPreviewEntryError(vo,Ai),this.view.showErrorDisplay(Ai)}renderMissingStory(){this.view.showNoPreview(),this.channel.emit(V$1)}renderStoryLoadingException(vo,Ai){s$3.error(Ai),this.view.showErrorDisplay(Ai),this.channel.emit(V$1,vo)}renderException(vo,Ai){let{name:bo="Error",message:Ra=String(Ai),stack:pc}=Ai;this.channel.emit(b$2,{name:bo,message:Ra,stack:pc}),this.channel.emit(B$2,{newPhase:"errored",storyId:vo}),this.view.showErrorDisplay(Ai),s$3.error(`Error rendering story '${vo}':`),s$3.error(Ai)}renderError(vo,{title:Ai,description:bo}){s$3.error(`Error rendering story ${Ai}: ${bo}`),this.channel.emit(x$3,{title:Ai,description:bo}),this.channel.emit(B$2,{newPhase:"errored",storyId:vo}),this.view.showErrorDisplay({message:Ai,stack:bo})}};s$1(Qr,"PreviewWithSelection");var he=Qr,Me=ce(tr()),Go=ce(tr()),zo=/^[a-zA-Z0-9 _-]*$/,Vo=/^-?[0-9]+(\.[0-9]+)?$/,aa=/^#([a-f0-9]{3,4}|[a-f0-9]{6}|[a-f0-9]{8})$/i,Uo=/^(rgba?|hsla?)\(([0-9]{1,3}),\s?([0-9]{1,3})%?,\s?([0-9]{1,3})%?,?\s?([0-9](\.[0-9]{1,2})?)?\)$/i,st=s$1((vo="",Ai)=>vo===null||vo===""||!zo.test(vo)?!1:Ai==null||Ai instanceof Date||typeof Ai=="number"||typeof Ai=="boolean"?!0:typeof Ai=="string"?zo.test(Ai)||Vo.test(Ai)||aa.test(Ai)||Uo.test(Ai):Array.isArray(Ai)?Ai.every(bo=>st(vo,bo)):k(Ai)?Object.entries(Ai).every(([bo,Ra])=>st(bo,Ra)):!1,"validateArgs"),la={delimiter:";",nesting:!0,arrayRepeat:!0,arrayRepeatSyntax:"bracket",nestingSyntax:"js",valueDeserializer(vo){if(vo.startsWith("!")){if(vo==="!undefined")return;if(vo==="!null")return null;if(vo==="!true")return!0;if(vo==="!false")return!1;if(vo.startsWith("!date(")&&vo.endsWith(")"))return new Date(vo.replaceAll(" ","+").slice(6,-1));if(vo.startsWith("!hex(")&&vo.endsWith(")"))return`#${vo.slice(5,-1)}`;let Ai=vo.slice(1).match(Uo);if(Ai)return vo.startsWith("!rgba")||vo.startsWith("!RGBA")?`${Ai[1]}(${Ai[2]}, ${Ai[3]}, ${Ai[4]}, ${Ai[5]})`:vo.startsWith("!hsla")||vo.startsWith("!HSLA")?`${Ai[1]}(${Ai[2]}, ${Ai[3]}%, ${Ai[4]}%, ${Ai[5]})`:vo.startsWith("!rgb")||vo.startsWith("!RGB")?`${Ai[1]}(${Ai[2]}, ${Ai[3]}, ${Ai[4]})`:`${Ai[1]}(${Ai[2]}, ${Ai[3]}%, ${Ai[4]}%)`}return Vo.test(vo)?Number(vo):vo}},it=s$1(vo=>{let Ai=vo.split(";").map(bo=>bo.replace("=","~").replace(":","="));return Object.entries((0,Go.parse)(Ai.join(";"),la)).reduce((bo,[Ra,pc])=>st(Ra,pc)?Object.assign(bo,{[Ra]:pc}):(n$2.warn(F`
|
|
262
|
-
Omitted potentially unsafe URL args.
|
|
263
|
-
|
|
264
|
-
More info: https://storybook.js.org/docs/writing-stories/args#setting-args-through-the-url
|
|
265
|
-
`),bo),{})},"parseArgsParam"),{history:Ho,document:X}=v;function ca(vo){let Ai=(vo||"").match(/^\/story\/(.+)/);if(!Ai)throw new Error(`Invalid path '${vo}', must start with '/story/'`);return Ai[1]}s$1(ca,"pathToId");var Wo=s$1(({selection:vo,extraParams:Ai})=>{let bo=X==null?void 0:X.location.search.slice(1),{path:Ra,selectedKind:pc,selectedStory:mc,...uf}=(0,Me.parse)(bo);return`?${(0,Me.stringify)({...uf,...Ai,...vo&&{id:vo.storyId,viewMode:vo.viewMode}})}`},"getQueryString"),da=s$1(vo=>{if(!vo)return;let Ai=Wo({selection:vo}),{hash:bo=""}=X.location;X.title=vo.storyId,Ho.replaceState({},"",`${X.location.pathname}${Ai}${bo}`)},"setPath"),pa=s$1(vo=>vo!=null&&typeof vo=="object"&&Array.isArray(vo)===!1,"isObject"),je=s$1(vo=>{if(vo!==void 0){if(typeof vo=="string")return vo;if(Array.isArray(vo))return je(vo[0]);if(pa(vo))return je(Object.values(vo).filter(Boolean))}},"getFirstString"),ua=s$1(()=>{if(typeof X<"u"){let vo=X.location.search.slice(1),Ai=(0,Me.parse)(vo),bo=typeof Ai.args=="string"?it(Ai.args):void 0,Ra=typeof Ai.globals=="string"?it(Ai.globals):void 0,pc=je(Ai.viewMode);(typeof pc!="string"||!pc.match(/docs|story/))&&(pc="story");let mc=je(Ai.path),uf=mc?ca(mc):je(Ai.id);if(uf)return{storySpecifier:uf,args:bo,globals:Ra,viewMode:pc}}return null},"getSelectionSpecifierFromPath"),at=class{constructor(){this.selectionSpecifier=ua()}setSelection(vo){this.selection=vo,da(this.selection)}setQueryParams(vo){let Ai=Wo({extraParams:vo}),{hash:bo=""}=X.location;Ho.replaceState({},"",`${X.location.pathname}${Ai}${bo}`)}};s$1(at,"UrlStore");var ge=at,An=ce(Rn()),vn=ce(tr()),{document:D}=v,wn=100,Cn=(vo=>(vo.MAIN="MAIN",vo.NOPREVIEW="NOPREVIEW",vo.PREPARING_STORY="PREPARING_STORY",vo.PREPARING_DOCS="PREPARING_DOCS",vo.ERROR="ERROR",vo))(Cn||{}),yt={PREPARING_STORY:"sb-show-preparing-story",PREPARING_DOCS:"sb-show-preparing-docs",MAIN:"sb-show-main",NOPREVIEW:"sb-show-nopreview",ERROR:"sb-show-errordisplay"},mt={centered:"sb-main-centered",fullscreen:"sb-main-fullscreen",padded:"sb-main-padded"},En=new An.default({escapeXML:!0}),ht=class{constructor(){if(this.testing=!1,typeof D<"u"){let{__SPECIAL_TEST_PARAMETER__:vo}=(0,vn.parse)(D.location.search.slice(1));switch(vo){case"preparing-story":{this.showPreparingStory(),this.testing=!0;break}case"preparing-docs":{this.showPreparingDocs(),this.testing=!0;break}}}}prepareForStory(vo){return this.showStory(),this.applyLayout(vo.parameters.layout),D.documentElement.scrollTop=0,D.documentElement.scrollLeft=0,this.storyRoot()}storyRoot(){return D.getElementById("storybook-root")}prepareForDocs(){return this.showMain(),this.showDocs(),this.applyLayout("fullscreen"),D.documentElement.scrollTop=0,D.documentElement.scrollLeft=0,this.docsRoot()}docsRoot(){return D.getElementById("storybook-docs")}applyLayout(vo="padded"){if(vo==="none"){D.body.classList.remove(this.currentLayoutClass),this.currentLayoutClass=null;return}this.checkIfLayoutExists(vo);let Ai=mt[vo];D.body.classList.remove(this.currentLayoutClass),D.body.classList.add(Ai),this.currentLayoutClass=Ai}checkIfLayoutExists(vo){mt[vo]||s$3.warn(F`
|
|
266
|
-
The desired layout: ${vo} is not a valid option.
|
|
267
|
-
The possible options are: ${Object.keys(mt).join(", ")}, none.
|
|
268
|
-
`)}showMode(vo){clearTimeout(this.preparingTimeout),Object.keys(Cn).forEach(Ai=>{Ai===vo?D.body.classList.add(yt[Ai]):D.body.classList.remove(yt[Ai])})}showErrorDisplay({message:vo="",stack:Ai=""}){let bo=vo,Ra=Ai,pc=vo.split(`
|
|
269
|
-
`);pc.length>1&&([bo]=pc,Ra=pc.slice(1).join(`
|
|
270
|
-
`).replace(/^\n/,"")),D.getElementById("error-message").innerHTML=En.toHtml(bo),D.getElementById("error-stack").innerHTML=En.toHtml(Ra),this.showMode("ERROR")}showNoPreview(){var vo,Ai;this.testing||(this.showMode("NOPREVIEW"),(vo=this.storyRoot())==null||vo.setAttribute("hidden","true"),(Ai=this.docsRoot())==null||Ai.setAttribute("hidden","true"))}showPreparingStory({immediate:vo=!1}={}){clearTimeout(this.preparingTimeout),vo?this.showMode("PREPARING_STORY"):this.preparingTimeout=setTimeout(()=>this.showMode("PREPARING_STORY"),wn)}showPreparingDocs({immediate:vo=!1}={}){clearTimeout(this.preparingTimeout),vo?this.showMode("PREPARING_DOCS"):this.preparingTimeout=setTimeout(()=>this.showMode("PREPARING_DOCS"),wn)}showMain(){this.showMode("MAIN")}showDocs(){this.storyRoot().setAttribute("hidden","true"),this.docsRoot().removeAttribute("hidden")}showStory(){this.docsRoot().setAttribute("hidden","true"),this.storyRoot().removeAttribute("hidden")}showStoryDuringRender(){D.body.classList.add(yt.MAIN)}};s$1(ht,"WebView");var be=ht,gt=class extends he{constructor(vo,Ai){super(vo,Ai,new ge,new be),this.importFn=vo,this.getProjectAnnotations=Ai,v.__STORYBOOK_PREVIEW__=this}};s$1(gt,"PreviewWeb");var{document:le}=v,Ya=["application/javascript","application/ecmascript","application/x-ecmascript","application/x-javascript","text/ecmascript","text/javascript","text/javascript1.0","text/javascript1.1","text/javascript1.2","text/javascript1.3","text/javascript1.4","text/javascript1.5","text/jscript","text/livescript","text/x-ecmascript","text/x-javascript","module"],Ka="script",Pn="scripts-root";function pr(){let vo=le.createEvent("Event");vo.initEvent("DOMContentLoaded",!0,!0),le.dispatchEvent(vo)}s$1(pr,"simulateDOMContentLoaded");function Xa(vo,Ai,bo){let Ra=le.createElement("script");Ra.type=vo.type==="module"?"module":"text/javascript",vo.src?(Ra.onload=Ai,Ra.onerror=Ai,Ra.src=vo.src):Ra.textContent=vo.innerText,bo?bo.appendChild(Ra):le.head.appendChild(Ra),vo.parentNode.removeChild(vo),vo.src||Ai()}s$1(Xa,"insertScript");function Fn(vo,Ai,bo=0){vo[bo](()=>{bo++,bo===vo.length?Ai():Fn(vo,Ai,bo)})}s$1(Fn,"insertScriptsSequentially");function In(vo){let Ai=le.getElementById(Pn);Ai?Ai.innerHTML="":(Ai=le.createElement("div"),Ai.id=Pn,le.body.appendChild(Ai));let bo=Array.from(vo.querySelectorAll(Ka));if(bo.length){let Ra=[];bo.forEach(pc=>{let mc=pc.getAttribute("type");(!mc||Ya.includes(mc))&&Ra.push(uf=>Xa(pc,uf,Ai))}),Ra.length&&Fn(Ra,pr,void 0)}else pr()}s$1(In,"simulatePageLoad");const FormFieldContext=y__default.createContext({}),FormItemContext=y__default.createContext({}),useFormField=()=>{const vo=y__default.useContext(FormFieldContext),Ai=y__default.useContext(FormItemContext),{getFieldState:bo,formState:Ra}=Yr$2(),pc=bo(vo.name,Ra);if(!vo)throw new Error("useFormField should be used within <FormField>");const{id:mc}=Ai;return{id:mc,name:vo.name,formItemId:`${mc}-form-item`,formDescriptionId:`${mc}-form-item-description`,formMessageId:`${mc}-form-item-message`,...pc}},Form=p1,FormField=({...vo})=>jsx(FormFieldContext.Provider,{value:{name:vo.name},children:jsx(Ec,{...vo})}),FormItem=y$2.forwardRef(({className:vo,...Ai},bo)=>{const Ra=y$2.useId();return jsx(FormItemContext.Provider,{value:{id:Ra},children:jsx("div",{ref:bo,className:cn("",vo),...Ai})})});FormItem.displayName="FormItem";const FormLabel=y$2.forwardRef(({className:vo,...Ai},bo)=>{const{error:Ra,formItemId:pc}=useFormField();return jsx(Label,{ref:bo,className:cn(Ra&&"text-destructive",vo),htmlFor:pc,...Ai})});FormLabel.displayName="FormLabel";const FormControl=y$2.forwardRef(({...vo},Ai)=>{const{error:bo,formItemId:Ra,formDescriptionId:pc,formMessageId:mc}=useFormField();return jsx(mn$1,{ref:Ai,id:Ra,"aria-describedby":bo?`${pc} ${mc}`:pc,"aria-invalid":!!bo,...vo})});FormControl.displayName="FormControl";const FormDescription=y$2.forwardRef(({className:vo,...Ai},bo)=>{const{formDescriptionId:Ra}=useFormField();return jsx("p",{ref:bo,id:Ra,className:cn("text-[0.8rem] text-gray-600",vo),...Ai})});FormDescription.displayName="FormDescription";const FormMessage=y$2.forwardRef(({className:vo,children:Ai,...bo},Ra)=>{const{error:pc,formMessageId:mc}=useFormField(),uf=pc?String(pc.message):Ai;return uf?jsx("p",{ref:Ra,id:mc,className:cn("text-[0.8rem] font-medium text-red-800",vo),...bo,children:uf}):null});FormMessage.displayName="FormMessage";var NAME="Label",Label$1=y$2.forwardRef((vo,Ai)=>jsx(we$1.label,{...vo,ref:Ai,onMouseDown:bo=>{var Ra;bo.target.closest("button, input, select, textarea")||((Ra=vo.onMouseDown)==null||Ra.call(vo,bo),!bo.defaultPrevented&&bo.detail>1&&bo.preventDefault())}}));Label$1.displayName=NAME;var Root=Label$1;const cx=h1,cva=(vo,Ai)=>bo=>cx(vo,bo==null?void 0:bo.class,bo==null?void 0:bo.className);function cn(...vo){return Ne$1(h1(vo))}const SPLIT_LOWER_UPPER_RE=new RegExp("([\\p{Ll}\\d])(\\p{Lu})","gu"),SPLIT_UPPER_UPPER_RE=new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])","gu"),SPLIT_SEPARATE_NUMBER_RE=new RegExp("(\\d)\\p{Ll}|(\\p{L})\\d","u"),DEFAULT_STRIP_REGEXP=/[^\p{L}\d]+/giu,SPLIT_REPLACE_VALUE="$1\0$2",DEFAULT_PREFIX_SUFFIX_CHARACTERS="";function split(vo){let Ai=vo.trim();Ai=Ai.replace(SPLIT_LOWER_UPPER_RE,SPLIT_REPLACE_VALUE).replace(SPLIT_UPPER_UPPER_RE,SPLIT_REPLACE_VALUE),Ai=Ai.replace(DEFAULT_STRIP_REGEXP,"\0");let bo=0,Ra=Ai.length;for(;Ai.charAt(bo)==="\0";)bo++;if(bo===Ra)return[];for(;Ai.charAt(Ra-1)==="\0";)Ra--;return Ai.slice(bo,Ra).split(/\0/g)}function splitSeparateNumbers(vo){const Ai=split(vo);for(let bo=0;bo<Ai.length;bo++){const Ra=Ai[bo],pc=SPLIT_SEPARATE_NUMBER_RE.exec(Ra);if(pc){const mc=pc.index+(pc[1]??pc[2]).length;Ai.splice(bo,1,Ra.slice(0,mc),Ra.slice(mc))}}return Ai}function noCase(vo,Ai){const[bo,Ra,pc]=splitPrefixSuffix(vo,Ai);return bo+Ra.map(lowerFactory(Ai==null?void 0:Ai.locale)).join((Ai==null?void 0:Ai.delimiter)??" ")+pc}function pascalCase(vo,Ai){const[bo,Ra,pc]=splitPrefixSuffix(vo,Ai),mc=lowerFactory(void 0),uf=upperFactory(void 0),df=pascalCaseTransformFactory(mc,uf);return bo+Ra.map(df).join("")+pc}function constantCase(vo,Ai){const[bo,Ra,pc]=splitPrefixSuffix(vo,Ai);return bo+Ra.map(upperFactory(void 0)).join("_")+pc}function sentenceCase(vo,Ai){const[bo,Ra,pc]=splitPrefixSuffix(vo,Ai),mc=lowerFactory(void 0),uf=upperFactory(void 0),df=capitalCaseTransformFactory(mc,uf);return bo+Ra.map((ff,hf)=>hf===0?df(ff):mc(ff)).join(" ")+pc}function snakeCase(vo,Ai){return noCase(vo,{delimiter:"_",...Ai})}function lowerFactory(vo){return vo===!1?Ai=>Ai.toLowerCase():Ai=>Ai.toLocaleLowerCase(vo)}function upperFactory(vo){return Ai=>Ai.toLocaleUpperCase(vo)}function capitalCaseTransformFactory(vo,Ai){return bo=>`${Ai(bo[0])}${vo(bo.slice(1))}`}function pascalCaseTransformFactory(vo,Ai){return(bo,Ra)=>{const pc=bo[0];return(Ra>0&&pc>="0"&&pc<="9"?"_"+pc:Ai(pc))+vo(bo.slice(1))}}function splitPrefixSuffix(vo,Ai={}){const bo=Ai.split??(Ai.separateNumbers?splitSeparateNumbers:split),Ra=Ai.prefixCharacters??DEFAULT_PREFIX_SUFFIX_CHARACTERS,pc=Ai.suffixCharacters??DEFAULT_PREFIX_SUFFIX_CHARACTERS;let mc=0,uf=vo.length;for(;mc<vo.length;){const df=vo.charAt(mc);if(!Ra.includes(df))break;mc++}for(;uf>mc;){const df=uf-1,ff=vo.charAt(df);if(!pc.includes(ff))break;uf=df}return[vo.slice(0,mc),bo(vo.slice(mc,uf)),vo.slice(uf)]}const versionInfo=Object.freeze({major:16,minor:10,patch:0,preReleaseTag:null});function devAssert(vo,Ai){throw new Error(Ai)}function isObjectLike(vo){return typeof vo=="object"&&vo!==null}function invariant$1(vo,Ai){throw new Error(Ai??"Unexpected invariant triggered.")}const LineRegExp=/\r\n|[\n\r]/g;function getLocation$1(vo,Ai){let bo=0,Ra=1;for(const pc of vo.body.matchAll(LineRegExp)){if(typeof pc.index=="number"||invariant$1(),pc.index>=Ai)break;bo=pc.index+pc[0].length,Ra+=1}return{line:Ra,column:Ai+1-bo}}function printLocation(vo){return printSourceLocation(vo.source,getLocation$1(vo.source,vo.start))}function printSourceLocation(vo,Ai){const bo=vo.locationOffset.column-1,Ra="".padStart(bo)+vo.body,pc=Ai.line-1,mc=vo.locationOffset.line-1,uf=Ai.line+mc,df=Ai.line===1?bo:0,ff=Ai.column+df,hf=`${vo.name}:${uf}:${ff}
|
|
271
|
-
`,pf=Ra.split(/\r\n|[\n\r]/g),mf=pf[pc];if(mf.length>120){const gf=Math.floor(ff/80),yf=ff%80,vf=[];for(let bf=0;bf<mf.length;bf+=80)vf.push(mf.slice(bf,bf+80));return hf+printPrefixedLines([[`${uf} |`,vf[0]],...vf.slice(1,gf+1).map(bf=>["|",bf]),["|","^".padStart(yf)],["|",vf[gf+1]]])}return hf+printPrefixedLines([[`${uf-1} |`,pf[pc-1]],[`${uf} |`,mf],["|","^".padStart(ff)],[`${uf+1} |`,pf[pc+1]]])}function printPrefixedLines(vo){const Ai=vo.filter(([Ra,pc])=>pc!==void 0),bo=Math.max(...Ai.map(([Ra])=>Ra.length));return Ai.map(([Ra,pc])=>Ra.padStart(bo)+(pc?" "+pc:"")).join(`
|
|
272
|
-
`)}function toNormalizedOptions(vo){const Ai=vo[0];return Ai==null||"kind"in Ai||"length"in Ai?{nodes:Ai,source:vo[1],positions:vo[2],path:vo[3],originalError:vo[4],extensions:vo[5]}:Ai}class GraphQLError extends Error{constructor(Ai,...bo){var Ra,pc,mc;const{nodes:uf,source:df,positions:ff,path:hf,originalError:pf,extensions:mf}=toNormalizedOptions(bo);super(Ai),this.name="GraphQLError",this.path=hf??void 0,this.originalError=pf??void 0,this.nodes=undefinedIfEmpty(Array.isArray(uf)?uf:uf?[uf]:void 0);const gf=undefinedIfEmpty((Ra=this.nodes)===null||Ra===void 0?void 0:Ra.map(vf=>vf.loc).filter(vf=>vf!=null));this.source=df??(gf==null||(pc=gf[0])===null||pc===void 0?void 0:pc.source),this.positions=ff??(gf==null?void 0:gf.map(vf=>vf.start)),this.locations=ff&&df?ff.map(vf=>getLocation$1(df,vf)):gf==null?void 0:gf.map(vf=>getLocation$1(vf.source,vf.start));const yf=isObjectLike(pf==null?void 0:pf.extensions)?pf==null?void 0:pf.extensions:void 0;this.extensions=(mc=mf??yf)!==null&&mc!==void 0?mc:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),pf!=null&&pf.stack?Object.defineProperty(this,"stack",{value:pf.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,GraphQLError):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let Ai=this.message;if(this.nodes)for(const bo of this.nodes)bo.loc&&(Ai+=`
|
|
273
|
-
|
|
274
|
-
`+printLocation(bo.loc));else if(this.source&&this.locations)for(const bo of this.locations)Ai+=`
|
|
275
|
-
|
|
276
|
-
`+printSourceLocation(this.source,bo);return Ai}toJSON(){const Ai={message:this.message};return this.locations!=null&&(Ai.locations=this.locations),this.path!=null&&(Ai.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(Ai.extensions=this.extensions),Ai}}function undefinedIfEmpty(vo){return vo===void 0||vo.length===0?void 0:vo}function syntaxError(vo,Ai,bo){return new GraphQLError(`Syntax Error: ${bo}`,{source:vo,positions:[Ai]})}let Location$1=class{constructor(vo,Ai,bo){this.start=vo.start,this.end=Ai.end,this.startToken=vo,this.endToken=Ai,this.source=bo}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}};class Token{constructor(Ai,bo,Ra,pc,mc,uf){this.kind=Ai,this.start=bo,this.end=Ra,this.line=pc,this.column=mc,this.value=uf,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const QueryDocumentKeys={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},kindValues=new Set(Object.keys(QueryDocumentKeys));function isNode(vo){const Ai=vo==null?void 0:vo.kind;return typeof Ai=="string"&&kindValues.has(Ai)}var OperationTypeNode;(function(vo){vo.QUERY="query",vo.MUTATION="mutation",vo.SUBSCRIPTION="subscription"})(OperationTypeNode||(OperationTypeNode={}));var DirectiveLocation;(function(vo){vo.QUERY="QUERY",vo.MUTATION="MUTATION",vo.SUBSCRIPTION="SUBSCRIPTION",vo.FIELD="FIELD",vo.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",vo.FRAGMENT_SPREAD="FRAGMENT_SPREAD",vo.INLINE_FRAGMENT="INLINE_FRAGMENT",vo.VARIABLE_DEFINITION="VARIABLE_DEFINITION",vo.SCHEMA="SCHEMA",vo.SCALAR="SCALAR",vo.OBJECT="OBJECT",vo.FIELD_DEFINITION="FIELD_DEFINITION",vo.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",vo.INTERFACE="INTERFACE",vo.UNION="UNION",vo.ENUM="ENUM",vo.ENUM_VALUE="ENUM_VALUE",vo.INPUT_OBJECT="INPUT_OBJECT",vo.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"})(DirectiveLocation||(DirectiveLocation={}));var Kind;(function(vo){vo.NAME="Name",vo.DOCUMENT="Document",vo.OPERATION_DEFINITION="OperationDefinition",vo.VARIABLE_DEFINITION="VariableDefinition",vo.SELECTION_SET="SelectionSet",vo.FIELD="Field",vo.ARGUMENT="Argument",vo.FRAGMENT_SPREAD="FragmentSpread",vo.INLINE_FRAGMENT="InlineFragment",vo.FRAGMENT_DEFINITION="FragmentDefinition",vo.VARIABLE="Variable",vo.INT="IntValue",vo.FLOAT="FloatValue",vo.STRING="StringValue",vo.BOOLEAN="BooleanValue",vo.NULL="NullValue",vo.ENUM="EnumValue",vo.LIST="ListValue",vo.OBJECT="ObjectValue",vo.OBJECT_FIELD="ObjectField",vo.DIRECTIVE="Directive",vo.NAMED_TYPE="NamedType",vo.LIST_TYPE="ListType",vo.NON_NULL_TYPE="NonNullType",vo.SCHEMA_DEFINITION="SchemaDefinition",vo.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",vo.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",vo.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",vo.FIELD_DEFINITION="FieldDefinition",vo.INPUT_VALUE_DEFINITION="InputValueDefinition",vo.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",vo.UNION_TYPE_DEFINITION="UnionTypeDefinition",vo.ENUM_TYPE_DEFINITION="EnumTypeDefinition",vo.ENUM_VALUE_DEFINITION="EnumValueDefinition",vo.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",vo.DIRECTIVE_DEFINITION="DirectiveDefinition",vo.SCHEMA_EXTENSION="SchemaExtension",vo.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",vo.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",vo.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",vo.UNION_TYPE_EXTENSION="UnionTypeExtension",vo.ENUM_TYPE_EXTENSION="EnumTypeExtension",vo.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"})(Kind||(Kind={}));function isWhiteSpace(vo){return vo===9||vo===32}function isDigit$1(vo){return vo>=48&&vo<=57}function isLetter(vo){return vo>=97&&vo<=122||vo>=65&&vo<=90}function isNameStart(vo){return isLetter(vo)||vo===95}function isNameContinue(vo){return isLetter(vo)||isDigit$1(vo)||vo===95}function dedentBlockStringLines(vo){var Ai;let bo=Number.MAX_SAFE_INTEGER,Ra=null,pc=-1;for(let uf=0;uf<vo.length;++uf){var mc;const df=vo[uf],ff=leadingWhitespace(df);ff!==df.length&&(Ra=(mc=Ra)!==null&&mc!==void 0?mc:uf,pc=uf,uf!==0&&ff<bo&&(bo=ff))}return vo.map((uf,df)=>df===0?uf:uf.slice(bo)).slice((Ai=Ra)!==null&&Ai!==void 0?Ai:0,pc+1)}function leadingWhitespace(vo){let Ai=0;for(;Ai<vo.length&&isWhiteSpace(vo.charCodeAt(Ai));)++Ai;return Ai}function isPrintableAsBlockString(vo){if(vo==="")return!0;let Ai=!0,bo=!1,Ra=!0,pc=!1;for(let mc=0;mc<vo.length;++mc)switch(vo.codePointAt(mc)){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 11:case 12:case 14:case 15:return!1;case 13:return!1;case 10:if(Ai&&!pc)return!1;pc=!0,Ai=!0,bo=!1;break;case 9:case 32:bo||(bo=Ai);break;default:Ra&&(Ra=bo),Ai=!1}return!(Ai||Ra&&pc)}function printBlockString(vo,Ai){const bo=vo.replace(/"""/g,'\\"""'),Ra=bo.split(/\r\n|[\n\r]/g),pc=Ra.length===1,mc=Ra.length>1&&Ra.slice(1).every(yf=>yf.length===0||isWhiteSpace(yf.charCodeAt(0))),uf=bo.endsWith('\\"""'),df=vo.endsWith('"')&&!uf,ff=vo.endsWith("\\"),hf=df||ff,pf=!pc||vo.length>70||hf||mc||uf;let mf="";const gf=pc&&isWhiteSpace(vo.charCodeAt(0));return(pf&&!gf||mc)&&(mf+=`
|
|
277
|
-
`),mf+=bo,(pf||hf)&&(mf+=`
|
|
278
|
-
`),'"""'+mf+'"""'}var TokenKind;(function(vo){vo.SOF="<SOF>",vo.EOF="<EOF>",vo.BANG="!",vo.DOLLAR="$",vo.AMP="&",vo.PAREN_L="(",vo.PAREN_R=")",vo.SPREAD="...",vo.COLON=":",vo.EQUALS="=",vo.AT="@",vo.BRACKET_L="[",vo.BRACKET_R="]",vo.BRACE_L="{",vo.PIPE="|",vo.BRACE_R="}",vo.NAME="Name",vo.INT="Int",vo.FLOAT="Float",vo.STRING="String",vo.BLOCK_STRING="BlockString",vo.COMMENT="Comment"})(TokenKind||(TokenKind={}));class Lexer{constructor(Ai){const bo=new Token(TokenKind.SOF,0,0,0,0);this.source=Ai,this.lastToken=bo,this.token=bo,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let Ai=this.token;if(Ai.kind!==TokenKind.EOF)do if(Ai.next)Ai=Ai.next;else{const bo=readNextToken(this,Ai.end);Ai.next=bo,bo.prev=Ai,Ai=bo}while(Ai.kind===TokenKind.COMMENT);return Ai}}function isPunctuatorTokenKind(vo){return vo===TokenKind.BANG||vo===TokenKind.DOLLAR||vo===TokenKind.AMP||vo===TokenKind.PAREN_L||vo===TokenKind.PAREN_R||vo===TokenKind.SPREAD||vo===TokenKind.COLON||vo===TokenKind.EQUALS||vo===TokenKind.AT||vo===TokenKind.BRACKET_L||vo===TokenKind.BRACKET_R||vo===TokenKind.BRACE_L||vo===TokenKind.PIPE||vo===TokenKind.BRACE_R}function isUnicodeScalarValue(vo){return vo>=0&&vo<=55295||vo>=57344&&vo<=1114111}function isSupplementaryCodePoint(vo,Ai){return isLeadingSurrogate(vo.charCodeAt(Ai))&&isTrailingSurrogate(vo.charCodeAt(Ai+1))}function isLeadingSurrogate(vo){return vo>=55296&&vo<=56319}function isTrailingSurrogate(vo){return vo>=56320&&vo<=57343}function printCodePointAt(vo,Ai){const bo=vo.source.body.codePointAt(Ai);if(bo===void 0)return TokenKind.EOF;if(bo>=32&&bo<=126){const Ra=String.fromCodePoint(bo);return Ra==='"'?`'"'`:`"${Ra}"`}return"U+"+bo.toString(16).toUpperCase().padStart(4,"0")}function createToken(vo,Ai,bo,Ra,pc){const mc=vo.line,uf=1+bo-vo.lineStart;return new Token(Ai,bo,Ra,mc,uf,pc)}function readNextToken(vo,Ai){const bo=vo.source.body,Ra=bo.length;let pc=Ai;for(;pc<Ra;){const mc=bo.charCodeAt(pc);switch(mc){case 65279:case 9:case 32:case 44:++pc;continue;case 10:++pc,++vo.line,vo.lineStart=pc;continue;case 13:bo.charCodeAt(pc+1)===10?pc+=2:++pc,++vo.line,vo.lineStart=pc;continue;case 35:return readComment(vo,pc);case 33:return createToken(vo,TokenKind.BANG,pc,pc+1);case 36:return createToken(vo,TokenKind.DOLLAR,pc,pc+1);case 38:return createToken(vo,TokenKind.AMP,pc,pc+1);case 40:return createToken(vo,TokenKind.PAREN_L,pc,pc+1);case 41:return createToken(vo,TokenKind.PAREN_R,pc,pc+1);case 46:if(bo.charCodeAt(pc+1)===46&&bo.charCodeAt(pc+2)===46)return createToken(vo,TokenKind.SPREAD,pc,pc+3);break;case 58:return createToken(vo,TokenKind.COLON,pc,pc+1);case 61:return createToken(vo,TokenKind.EQUALS,pc,pc+1);case 64:return createToken(vo,TokenKind.AT,pc,pc+1);case 91:return createToken(vo,TokenKind.BRACKET_L,pc,pc+1);case 93:return createToken(vo,TokenKind.BRACKET_R,pc,pc+1);case 123:return createToken(vo,TokenKind.BRACE_L,pc,pc+1);case 124:return createToken(vo,TokenKind.PIPE,pc,pc+1);case 125:return createToken(vo,TokenKind.BRACE_R,pc,pc+1);case 34:return bo.charCodeAt(pc+1)===34&&bo.charCodeAt(pc+2)===34?readBlockString(vo,pc):readString(vo,pc)}if(isDigit$1(mc)||mc===45)return readNumber(vo,pc,mc);if(isNameStart(mc))return readName(vo,pc);throw syntaxError(vo.source,pc,mc===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:isUnicodeScalarValue(mc)||isSupplementaryCodePoint(bo,pc)?`Unexpected character: ${printCodePointAt(vo,pc)}.`:`Invalid character: ${printCodePointAt(vo,pc)}.`)}return createToken(vo,TokenKind.EOF,Ra,Ra)}function readComment(vo,Ai){const bo=vo.source.body,Ra=bo.length;let pc=Ai+1;for(;pc<Ra;){const mc=bo.charCodeAt(pc);if(mc===10||mc===13)break;if(isUnicodeScalarValue(mc))++pc;else if(isSupplementaryCodePoint(bo,pc))pc+=2;else break}return createToken(vo,TokenKind.COMMENT,Ai,pc,bo.slice(Ai+1,pc))}function readNumber(vo,Ai,bo){const Ra=vo.source.body;let pc=Ai,mc=bo,uf=!1;if(mc===45&&(mc=Ra.charCodeAt(++pc)),mc===48){if(mc=Ra.charCodeAt(++pc),isDigit$1(mc))throw syntaxError(vo.source,pc,`Invalid number, unexpected digit after 0: ${printCodePointAt(vo,pc)}.`)}else pc=readDigits(vo,pc,mc),mc=Ra.charCodeAt(pc);if(mc===46&&(uf=!0,mc=Ra.charCodeAt(++pc),pc=readDigits(vo,pc,mc),mc=Ra.charCodeAt(pc)),(mc===69||mc===101)&&(uf=!0,mc=Ra.charCodeAt(++pc),(mc===43||mc===45)&&(mc=Ra.charCodeAt(++pc)),pc=readDigits(vo,pc,mc),mc=Ra.charCodeAt(pc)),mc===46||isNameStart(mc))throw syntaxError(vo.source,pc,`Invalid number, expected digit but got: ${printCodePointAt(vo,pc)}.`);return createToken(vo,uf?TokenKind.FLOAT:TokenKind.INT,Ai,pc,Ra.slice(Ai,pc))}function readDigits(vo,Ai,bo){if(!isDigit$1(bo))throw syntaxError(vo.source,Ai,`Invalid number, expected digit but got: ${printCodePointAt(vo,Ai)}.`);const Ra=vo.source.body;let pc=Ai+1;for(;isDigit$1(Ra.charCodeAt(pc));)++pc;return pc}function readString(vo,Ai){const bo=vo.source.body,Ra=bo.length;let pc=Ai+1,mc=pc,uf="";for(;pc<Ra;){const df=bo.charCodeAt(pc);if(df===34)return uf+=bo.slice(mc,pc),createToken(vo,TokenKind.STRING,Ai,pc+1,uf);if(df===92){uf+=bo.slice(mc,pc);const ff=bo.charCodeAt(pc+1)===117?bo.charCodeAt(pc+2)===123?readEscapedUnicodeVariableWidth(vo,pc):readEscapedUnicodeFixedWidth(vo,pc):readEscapedCharacter(vo,pc);uf+=ff.value,pc+=ff.size,mc=pc;continue}if(df===10||df===13)break;if(isUnicodeScalarValue(df))++pc;else if(isSupplementaryCodePoint(bo,pc))pc+=2;else throw syntaxError(vo.source,pc,`Invalid character within String: ${printCodePointAt(vo,pc)}.`)}throw syntaxError(vo.source,pc,"Unterminated string.")}function readEscapedUnicodeVariableWidth(vo,Ai){const bo=vo.source.body;let Ra=0,pc=3;for(;pc<12;){const mc=bo.charCodeAt(Ai+pc++);if(mc===125){if(pc<5||!isUnicodeScalarValue(Ra))break;return{value:String.fromCodePoint(Ra),size:pc}}if(Ra=Ra<<4|readHexDigit(mc),Ra<0)break}throw syntaxError(vo.source,Ai,`Invalid Unicode escape sequence: "${bo.slice(Ai,Ai+pc)}".`)}function readEscapedUnicodeFixedWidth(vo,Ai){const bo=vo.source.body,Ra=read16BitHexCode(bo,Ai+2);if(isUnicodeScalarValue(Ra))return{value:String.fromCodePoint(Ra),size:6};if(isLeadingSurrogate(Ra)&&bo.charCodeAt(Ai+6)===92&&bo.charCodeAt(Ai+7)===117){const pc=read16BitHexCode(bo,Ai+8);if(isTrailingSurrogate(pc))return{value:String.fromCodePoint(Ra,pc),size:12}}throw syntaxError(vo.source,Ai,`Invalid Unicode escape sequence: "${bo.slice(Ai,Ai+6)}".`)}function read16BitHexCode(vo,Ai){return readHexDigit(vo.charCodeAt(Ai))<<12|readHexDigit(vo.charCodeAt(Ai+1))<<8|readHexDigit(vo.charCodeAt(Ai+2))<<4|readHexDigit(vo.charCodeAt(Ai+3))}function readHexDigit(vo){return vo>=48&&vo<=57?vo-48:vo>=65&&vo<=70?vo-55:vo>=97&&vo<=102?vo-87:-1}function readEscapedCharacter(vo,Ai){const bo=vo.source.body;switch(bo.charCodeAt(Ai+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:`
|
|
279
|
-
`,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw syntaxError(vo.source,Ai,`Invalid character escape sequence: "${bo.slice(Ai,Ai+2)}".`)}function readBlockString(vo,Ai){const bo=vo.source.body,Ra=bo.length;let pc=vo.lineStart,mc=Ai+3,uf=mc,df="";const ff=[];for(;mc<Ra;){const hf=bo.charCodeAt(mc);if(hf===34&&bo.charCodeAt(mc+1)===34&&bo.charCodeAt(mc+2)===34){df+=bo.slice(uf,mc),ff.push(df);const pf=createToken(vo,TokenKind.BLOCK_STRING,Ai,mc+3,dedentBlockStringLines(ff).join(`
|
|
280
|
-
`));return vo.line+=ff.length-1,vo.lineStart=pc,pf}if(hf===92&&bo.charCodeAt(mc+1)===34&&bo.charCodeAt(mc+2)===34&&bo.charCodeAt(mc+3)===34){df+=bo.slice(uf,mc),uf=mc+1,mc+=4;continue}if(hf===10||hf===13){df+=bo.slice(uf,mc),ff.push(df),hf===13&&bo.charCodeAt(mc+1)===10?mc+=2:++mc,df="",uf=mc,pc=mc;continue}if(isUnicodeScalarValue(hf))++mc;else if(isSupplementaryCodePoint(bo,mc))mc+=2;else throw syntaxError(vo.source,mc,`Invalid character within String: ${printCodePointAt(vo,mc)}.`)}throw syntaxError(vo.source,mc,"Unterminated string.")}function readName(vo,Ai){const bo=vo.source.body,Ra=bo.length;let pc=Ai+1;for(;pc<Ra;){const mc=bo.charCodeAt(pc);if(isNameContinue(mc))++pc;else break}return createToken(vo,TokenKind.NAME,Ai,pc,bo.slice(Ai,pc))}const MAX_ARRAY_LENGTH=10,MAX_RECURSIVE_DEPTH=2;function inspect(vo){return formatValue(vo,[])}function formatValue(vo,Ai){switch(typeof vo){case"string":return JSON.stringify(vo);case"function":return vo.name?`[function ${vo.name}]`:"[function]";case"object":return formatObjectValue(vo,Ai);default:return String(vo)}}function formatObjectValue(vo,Ai){if(vo===null)return"null";if(Ai.includes(vo))return"[Circular]";const bo=[...Ai,vo];if(isJSONable(vo)){const Ra=vo.toJSON();if(Ra!==vo)return typeof Ra=="string"?Ra:formatValue(Ra,bo)}else if(Array.isArray(vo))return formatArray(vo,bo);return formatObject(vo,bo)}function isJSONable(vo){return typeof vo.toJSON=="function"}function formatObject(vo,Ai){const bo=Object.entries(vo);return bo.length===0?"{}":Ai.length>MAX_RECURSIVE_DEPTH?"["+getObjectTag(vo)+"]":"{ "+bo.map(([Ra,pc])=>Ra+": "+formatValue(pc,Ai)).join(", ")+" }"}function formatArray(vo,Ai){if(vo.length===0)return"[]";if(Ai.length>MAX_RECURSIVE_DEPTH)return"[Array]";const bo=Math.min(MAX_ARRAY_LENGTH,vo.length),Ra=vo.length-bo,pc=[];for(let mc=0;mc<bo;++mc)pc.push(formatValue(vo[mc],Ai));return Ra===1?pc.push("... 1 more item"):Ra>1&&pc.push(`... ${Ra} more items`),"["+pc.join(", ")+"]"}function getObjectTag(vo){const Ai=Object.prototype.toString.call(vo).replace(/^\[object /,"").replace(/]$/,"");if(Ai==="Object"&&typeof vo.constructor=="function"){const bo=vo.constructor.name;if(typeof bo=="string"&&bo!=="")return bo}return Ai}const isProduction=globalThis.process&&!0,instanceOf=isProduction?function vo(Ai,bo){return Ai instanceof bo}:function vo(Ai,bo){if(Ai instanceof bo)return!0;if(typeof Ai=="object"&&Ai!==null){var Ra;const pc=bo.prototype[Symbol.toStringTag],mc=Symbol.toStringTag in Ai?Ai[Symbol.toStringTag]:(Ra=Ai.constructor)===null||Ra===void 0?void 0:Ra.name;if(pc===mc){const uf=inspect(Ai);throw new Error(`Cannot use ${pc} "${uf}" from another module or realm.
|
|
281
|
-
|
|
282
|
-
Ensure that there is only one instance of "graphql" in the node_modules
|
|
283
|
-
directory. If different versions of "graphql" are the dependencies of other
|
|
284
|
-
relied on modules, use "resolutions" to ensure only one version is installed.
|
|
285
|
-
|
|
286
|
-
https://yarnpkg.com/en/docs/selective-version-resolutions
|
|
287
|
-
|
|
288
|
-
Duplicate "graphql" modules cannot be used at the same time since different
|
|
289
|
-
versions may have different capabilities and behavior. The data from one
|
|
290
|
-
version used in the function from another could produce confusing and
|
|
291
|
-
spurious results.`)}}return!1};class Source{constructor(Ai,bo="GraphQL request",Ra={line:1,column:1}){typeof Ai=="string"||devAssert(!1,`Body must be a string. Received: ${inspect(Ai)}.`),this.body=Ai,this.name=bo,this.locationOffset=Ra,this.locationOffset.line>0||devAssert(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||devAssert(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function isSource(vo){return instanceOf(vo,Source)}function parse(vo,Ai){const bo=new Parser$1(vo,Ai),Ra=bo.parseDocument();return Object.defineProperty(Ra,"tokenCount",{enumerable:!1,value:bo.tokenCount}),Ra}let Parser$1=class{constructor(vo,Ai={}){const bo=isSource(vo)?vo:new Source(vo);this._lexer=new Lexer(bo),this._options=Ai,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){const vo=this.expectToken(TokenKind.NAME);return this.node(vo,{kind:Kind.NAME,value:vo.value})}parseDocument(){return this.node(this._lexer.token,{kind:Kind.DOCUMENT,definitions:this.many(TokenKind.SOF,this.parseDefinition,TokenKind.EOF)})}parseDefinition(){if(this.peek(TokenKind.BRACE_L))return this.parseOperationDefinition();const vo=this.peekDescription(),Ai=vo?this._lexer.lookahead():this._lexer.token;if(Ai.kind===TokenKind.NAME){switch(Ai.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(vo)throw syntaxError(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(Ai.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(Ai)}parseOperationDefinition(){const vo=this._lexer.token;if(this.peek(TokenKind.BRACE_L))return this.node(vo,{kind:Kind.OPERATION_DEFINITION,operation:OperationTypeNode.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const Ai=this.parseOperationType();let bo;return this.peek(TokenKind.NAME)&&(bo=this.parseName()),this.node(vo,{kind:Kind.OPERATION_DEFINITION,operation:Ai,name:bo,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const vo=this.expectToken(TokenKind.NAME);switch(vo.value){case"query":return OperationTypeNode.QUERY;case"mutation":return OperationTypeNode.MUTATION;case"subscription":return OperationTypeNode.SUBSCRIPTION}throw this.unexpected(vo)}parseVariableDefinitions(){return this.optionalMany(TokenKind.PAREN_L,this.parseVariableDefinition,TokenKind.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:Kind.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(TokenKind.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(TokenKind.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const vo=this._lexer.token;return this.expectToken(TokenKind.DOLLAR),this.node(vo,{kind:Kind.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:Kind.SELECTION_SET,selections:this.many(TokenKind.BRACE_L,this.parseSelection,TokenKind.BRACE_R)})}parseSelection(){return this.peek(TokenKind.SPREAD)?this.parseFragment():this.parseField()}parseField(){const vo=this._lexer.token,Ai=this.parseName();let bo,Ra;return this.expectOptionalToken(TokenKind.COLON)?(bo=Ai,Ra=this.parseName()):Ra=Ai,this.node(vo,{kind:Kind.FIELD,alias:bo,name:Ra,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(TokenKind.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(vo){const Ai=vo?this.parseConstArgument:this.parseArgument;return this.optionalMany(TokenKind.PAREN_L,Ai,TokenKind.PAREN_R)}parseArgument(vo=!1){const Ai=this._lexer.token,bo=this.parseName();return this.expectToken(TokenKind.COLON),this.node(Ai,{kind:Kind.ARGUMENT,name:bo,value:this.parseValueLiteral(vo)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const vo=this._lexer.token;this.expectToken(TokenKind.SPREAD);const Ai=this.expectOptionalKeyword("on");return!Ai&&this.peek(TokenKind.NAME)?this.node(vo,{kind:Kind.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(vo,{kind:Kind.INLINE_FRAGMENT,typeCondition:Ai?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const vo=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(vo,{kind:Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(vo,{kind:Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(vo){const Ai=this._lexer.token;switch(Ai.kind){case TokenKind.BRACKET_L:return this.parseList(vo);case TokenKind.BRACE_L:return this.parseObject(vo);case TokenKind.INT:return this.advanceLexer(),this.node(Ai,{kind:Kind.INT,value:Ai.value});case TokenKind.FLOAT:return this.advanceLexer(),this.node(Ai,{kind:Kind.FLOAT,value:Ai.value});case TokenKind.STRING:case TokenKind.BLOCK_STRING:return this.parseStringLiteral();case TokenKind.NAME:switch(this.advanceLexer(),Ai.value){case"true":return this.node(Ai,{kind:Kind.BOOLEAN,value:!0});case"false":return this.node(Ai,{kind:Kind.BOOLEAN,value:!1});case"null":return this.node(Ai,{kind:Kind.NULL});default:return this.node(Ai,{kind:Kind.ENUM,value:Ai.value})}case TokenKind.DOLLAR:if(vo)if(this.expectToken(TokenKind.DOLLAR),this._lexer.token.kind===TokenKind.NAME){const bo=this._lexer.token.value;throw syntaxError(this._lexer.source,Ai.start,`Unexpected variable "$${bo}" in constant value.`)}else throw this.unexpected(Ai);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const vo=this._lexer.token;return this.advanceLexer(),this.node(vo,{kind:Kind.STRING,value:vo.value,block:vo.kind===TokenKind.BLOCK_STRING})}parseList(vo){const Ai=()=>this.parseValueLiteral(vo);return this.node(this._lexer.token,{kind:Kind.LIST,values:this.any(TokenKind.BRACKET_L,Ai,TokenKind.BRACKET_R)})}parseObject(vo){const Ai=()=>this.parseObjectField(vo);return this.node(this._lexer.token,{kind:Kind.OBJECT,fields:this.any(TokenKind.BRACE_L,Ai,TokenKind.BRACE_R)})}parseObjectField(vo){const Ai=this._lexer.token,bo=this.parseName();return this.expectToken(TokenKind.COLON),this.node(Ai,{kind:Kind.OBJECT_FIELD,name:bo,value:this.parseValueLiteral(vo)})}parseDirectives(vo){const Ai=[];for(;this.peek(TokenKind.AT);)Ai.push(this.parseDirective(vo));return Ai}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(vo){const Ai=this._lexer.token;return this.expectToken(TokenKind.AT),this.node(Ai,{kind:Kind.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(vo)})}parseTypeReference(){const vo=this._lexer.token;let Ai;if(this.expectOptionalToken(TokenKind.BRACKET_L)){const bo=this.parseTypeReference();this.expectToken(TokenKind.BRACKET_R),Ai=this.node(vo,{kind:Kind.LIST_TYPE,type:bo})}else Ai=this.parseNamedType();return this.expectOptionalToken(TokenKind.BANG)?this.node(vo,{kind:Kind.NON_NULL_TYPE,type:Ai}):Ai}parseNamedType(){return this.node(this._lexer.token,{kind:Kind.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(TokenKind.STRING)||this.peek(TokenKind.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const vo=this._lexer.token,Ai=this.parseDescription();this.expectKeyword("schema");const bo=this.parseConstDirectives(),Ra=this.many(TokenKind.BRACE_L,this.parseOperationTypeDefinition,TokenKind.BRACE_R);return this.node(vo,{kind:Kind.SCHEMA_DEFINITION,description:Ai,directives:bo,operationTypes:Ra})}parseOperationTypeDefinition(){const vo=this._lexer.token,Ai=this.parseOperationType();this.expectToken(TokenKind.COLON);const bo=this.parseNamedType();return this.node(vo,{kind:Kind.OPERATION_TYPE_DEFINITION,operation:Ai,type:bo})}parseScalarTypeDefinition(){const vo=this._lexer.token,Ai=this.parseDescription();this.expectKeyword("scalar");const bo=this.parseName(),Ra=this.parseConstDirectives();return this.node(vo,{kind:Kind.SCALAR_TYPE_DEFINITION,description:Ai,name:bo,directives:Ra})}parseObjectTypeDefinition(){const vo=this._lexer.token,Ai=this.parseDescription();this.expectKeyword("type");const bo=this.parseName(),Ra=this.parseImplementsInterfaces(),pc=this.parseConstDirectives(),mc=this.parseFieldsDefinition();return this.node(vo,{kind:Kind.OBJECT_TYPE_DEFINITION,description:Ai,name:bo,interfaces:Ra,directives:pc,fields:mc})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(TokenKind.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(TokenKind.BRACE_L,this.parseFieldDefinition,TokenKind.BRACE_R)}parseFieldDefinition(){const vo=this._lexer.token,Ai=this.parseDescription(),bo=this.parseName(),Ra=this.parseArgumentDefs();this.expectToken(TokenKind.COLON);const pc=this.parseTypeReference(),mc=this.parseConstDirectives();return this.node(vo,{kind:Kind.FIELD_DEFINITION,description:Ai,name:bo,arguments:Ra,type:pc,directives:mc})}parseArgumentDefs(){return this.optionalMany(TokenKind.PAREN_L,this.parseInputValueDef,TokenKind.PAREN_R)}parseInputValueDef(){const vo=this._lexer.token,Ai=this.parseDescription(),bo=this.parseName();this.expectToken(TokenKind.COLON);const Ra=this.parseTypeReference();let pc;this.expectOptionalToken(TokenKind.EQUALS)&&(pc=this.parseConstValueLiteral());const mc=this.parseConstDirectives();return this.node(vo,{kind:Kind.INPUT_VALUE_DEFINITION,description:Ai,name:bo,type:Ra,defaultValue:pc,directives:mc})}parseInterfaceTypeDefinition(){const vo=this._lexer.token,Ai=this.parseDescription();this.expectKeyword("interface");const bo=this.parseName(),Ra=this.parseImplementsInterfaces(),pc=this.parseConstDirectives(),mc=this.parseFieldsDefinition();return this.node(vo,{kind:Kind.INTERFACE_TYPE_DEFINITION,description:Ai,name:bo,interfaces:Ra,directives:pc,fields:mc})}parseUnionTypeDefinition(){const vo=this._lexer.token,Ai=this.parseDescription();this.expectKeyword("union");const bo=this.parseName(),Ra=this.parseConstDirectives(),pc=this.parseUnionMemberTypes();return this.node(vo,{kind:Kind.UNION_TYPE_DEFINITION,description:Ai,name:bo,directives:Ra,types:pc})}parseUnionMemberTypes(){return this.expectOptionalToken(TokenKind.EQUALS)?this.delimitedMany(TokenKind.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const vo=this._lexer.token,Ai=this.parseDescription();this.expectKeyword("enum");const bo=this.parseName(),Ra=this.parseConstDirectives(),pc=this.parseEnumValuesDefinition();return this.node(vo,{kind:Kind.ENUM_TYPE_DEFINITION,description:Ai,name:bo,directives:Ra,values:pc})}parseEnumValuesDefinition(){return this.optionalMany(TokenKind.BRACE_L,this.parseEnumValueDefinition,TokenKind.BRACE_R)}parseEnumValueDefinition(){const vo=this._lexer.token,Ai=this.parseDescription(),bo=this.parseEnumValueName(),Ra=this.parseConstDirectives();return this.node(vo,{kind:Kind.ENUM_VALUE_DEFINITION,description:Ai,name:bo,directives:Ra})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw syntaxError(this._lexer.source,this._lexer.token.start,`${getTokenDesc(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const vo=this._lexer.token,Ai=this.parseDescription();this.expectKeyword("input");const bo=this.parseName(),Ra=this.parseConstDirectives(),pc=this.parseInputFieldsDefinition();return this.node(vo,{kind:Kind.INPUT_OBJECT_TYPE_DEFINITION,description:Ai,name:bo,directives:Ra,fields:pc})}parseInputFieldsDefinition(){return this.optionalMany(TokenKind.BRACE_L,this.parseInputValueDef,TokenKind.BRACE_R)}parseTypeSystemExtension(){const vo=this._lexer.lookahead();if(vo.kind===TokenKind.NAME)switch(vo.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(vo)}parseSchemaExtension(){const vo=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const Ai=this.parseConstDirectives(),bo=this.optionalMany(TokenKind.BRACE_L,this.parseOperationTypeDefinition,TokenKind.BRACE_R);if(Ai.length===0&&bo.length===0)throw this.unexpected();return this.node(vo,{kind:Kind.SCHEMA_EXTENSION,directives:Ai,operationTypes:bo})}parseScalarTypeExtension(){const vo=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const Ai=this.parseName(),bo=this.parseConstDirectives();if(bo.length===0)throw this.unexpected();return this.node(vo,{kind:Kind.SCALAR_TYPE_EXTENSION,name:Ai,directives:bo})}parseObjectTypeExtension(){const vo=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const Ai=this.parseName(),bo=this.parseImplementsInterfaces(),Ra=this.parseConstDirectives(),pc=this.parseFieldsDefinition();if(bo.length===0&&Ra.length===0&&pc.length===0)throw this.unexpected();return this.node(vo,{kind:Kind.OBJECT_TYPE_EXTENSION,name:Ai,interfaces:bo,directives:Ra,fields:pc})}parseInterfaceTypeExtension(){const vo=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const Ai=this.parseName(),bo=this.parseImplementsInterfaces(),Ra=this.parseConstDirectives(),pc=this.parseFieldsDefinition();if(bo.length===0&&Ra.length===0&&pc.length===0)throw this.unexpected();return this.node(vo,{kind:Kind.INTERFACE_TYPE_EXTENSION,name:Ai,interfaces:bo,directives:Ra,fields:pc})}parseUnionTypeExtension(){const vo=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const Ai=this.parseName(),bo=this.parseConstDirectives(),Ra=this.parseUnionMemberTypes();if(bo.length===0&&Ra.length===0)throw this.unexpected();return this.node(vo,{kind:Kind.UNION_TYPE_EXTENSION,name:Ai,directives:bo,types:Ra})}parseEnumTypeExtension(){const vo=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const Ai=this.parseName(),bo=this.parseConstDirectives(),Ra=this.parseEnumValuesDefinition();if(bo.length===0&&Ra.length===0)throw this.unexpected();return this.node(vo,{kind:Kind.ENUM_TYPE_EXTENSION,name:Ai,directives:bo,values:Ra})}parseInputObjectTypeExtension(){const vo=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const Ai=this.parseName(),bo=this.parseConstDirectives(),Ra=this.parseInputFieldsDefinition();if(bo.length===0&&Ra.length===0)throw this.unexpected();return this.node(vo,{kind:Kind.INPUT_OBJECT_TYPE_EXTENSION,name:Ai,directives:bo,fields:Ra})}parseDirectiveDefinition(){const vo=this._lexer.token,Ai=this.parseDescription();this.expectKeyword("directive"),this.expectToken(TokenKind.AT);const bo=this.parseName(),Ra=this.parseArgumentDefs(),pc=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const mc=this.parseDirectiveLocations();return this.node(vo,{kind:Kind.DIRECTIVE_DEFINITION,description:Ai,name:bo,arguments:Ra,repeatable:pc,locations:mc})}parseDirectiveLocations(){return this.delimitedMany(TokenKind.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const vo=this._lexer.token,Ai=this.parseName();if(Object.prototype.hasOwnProperty.call(DirectiveLocation,Ai.value))return Ai;throw this.unexpected(vo)}node(vo,Ai){return this._options.noLocation!==!0&&(Ai.loc=new Location$1(vo,this._lexer.lastToken,this._lexer.source)),Ai}peek(vo){return this._lexer.token.kind===vo}expectToken(vo){const Ai=this._lexer.token;if(Ai.kind===vo)return this.advanceLexer(),Ai;throw syntaxError(this._lexer.source,Ai.start,`Expected ${getTokenKindDesc(vo)}, found ${getTokenDesc(Ai)}.`)}expectOptionalToken(vo){return this._lexer.token.kind===vo?(this.advanceLexer(),!0):!1}expectKeyword(vo){const Ai=this._lexer.token;if(Ai.kind===TokenKind.NAME&&Ai.value===vo)this.advanceLexer();else throw syntaxError(this._lexer.source,Ai.start,`Expected "${vo}", found ${getTokenDesc(Ai)}.`)}expectOptionalKeyword(vo){const Ai=this._lexer.token;return Ai.kind===TokenKind.NAME&&Ai.value===vo?(this.advanceLexer(),!0):!1}unexpected(vo){const Ai=vo??this._lexer.token;return syntaxError(this._lexer.source,Ai.start,`Unexpected ${getTokenDesc(Ai)}.`)}any(vo,Ai,bo){this.expectToken(vo);const Ra=[];for(;!this.expectOptionalToken(bo);)Ra.push(Ai.call(this));return Ra}optionalMany(vo,Ai,bo){if(this.expectOptionalToken(vo)){const Ra=[];do Ra.push(Ai.call(this));while(!this.expectOptionalToken(bo));return Ra}return[]}many(vo,Ai,bo){this.expectToken(vo);const Ra=[];do Ra.push(Ai.call(this));while(!this.expectOptionalToken(bo));return Ra}delimitedMany(vo,Ai){this.expectOptionalToken(vo);const bo=[];do bo.push(Ai.call(this));while(this.expectOptionalToken(vo));return bo}advanceLexer(){const{maxTokens:vo}=this._options,Ai=this._lexer.advance();if(Ai.kind!==TokenKind.EOF&&(++this._tokenCounter,vo!==void 0&&this._tokenCounter>vo))throw syntaxError(this._lexer.source,Ai.start,`Document contains more that ${vo} tokens. Parsing aborted.`)}};function getTokenDesc(vo){const Ai=vo.value;return getTokenKindDesc(vo.kind)+(Ai!=null?` "${Ai}"`:"")}function getTokenKindDesc(vo){return isPunctuatorTokenKind(vo)?`"${vo}"`:vo}const MAX_SUGGESTIONS=5;function didYouMean(vo,Ai){const[bo,Ra]=Ai?[vo,Ai]:[void 0,vo];let pc=" Did you mean ";bo&&(pc+=bo+" ");const mc=Ra.map(ff=>`"${ff}"`);switch(mc.length){case 0:return"";case 1:return pc+mc[0]+"?";case 2:return pc+mc[0]+" or "+mc[1]+"?"}const uf=mc.slice(0,MAX_SUGGESTIONS),df=uf.pop();return pc+uf.join(", ")+", or "+df+"?"}function identityFunc(vo){return vo}function keyMap(vo,Ai){const bo=Object.create(null);for(const Ra of vo)bo[Ai(Ra)]=Ra;return bo}function keyValMap(vo,Ai,bo){const Ra=Object.create(null);for(const pc of vo)Ra[Ai(pc)]=bo(pc);return Ra}function mapValue(vo,Ai){const bo=Object.create(null);for(const Ra of Object.keys(vo))bo[Ra]=Ai(vo[Ra],Ra);return bo}function naturalCompare(vo,Ai){let bo=0,Ra=0;for(;bo<vo.length&&Ra<Ai.length;){let pc=vo.charCodeAt(bo),mc=Ai.charCodeAt(Ra);if(isDigit(pc)&&isDigit(mc)){let uf=0;do++bo,uf=uf*10+pc-DIGIT_0,pc=vo.charCodeAt(bo);while(isDigit(pc)&&uf>0);let df=0;do++Ra,df=df*10+mc-DIGIT_0,mc=Ai.charCodeAt(Ra);while(isDigit(mc)&&df>0);if(uf<df)return-1;if(uf>df)return 1}else{if(pc<mc)return-1;if(pc>mc)return 1;++bo,++Ra}}return vo.length-Ai.length}const DIGIT_0=48,DIGIT_9=57;function isDigit(vo){return!isNaN(vo)&&DIGIT_0<=vo&&vo<=DIGIT_9}function suggestionList(vo,Ai){const bo=Object.create(null),Ra=new LexicalDistance(vo),pc=Math.floor(vo.length*.4)+1;for(const mc of Ai){const uf=Ra.measure(mc,pc);uf!==void 0&&(bo[mc]=uf)}return Object.keys(bo).sort((mc,uf)=>{const df=bo[mc]-bo[uf];return df!==0?df:naturalCompare(mc,uf)})}class LexicalDistance{constructor(Ai){this._input=Ai,this._inputLowerCase=Ai.toLowerCase(),this._inputArray=stringToArray(this._inputLowerCase),this._rows=[new Array(Ai.length+1).fill(0),new Array(Ai.length+1).fill(0),new Array(Ai.length+1).fill(0)]}measure(Ai,bo){if(this._input===Ai)return 0;const Ra=Ai.toLowerCase();if(this._inputLowerCase===Ra)return 1;let pc=stringToArray(Ra),mc=this._inputArray;if(pc.length<mc.length){const pf=pc;pc=mc,mc=pf}const uf=pc.length,df=mc.length;if(uf-df>bo)return;const ff=this._rows;for(let pf=0;pf<=df;pf++)ff[0][pf]=pf;for(let pf=1;pf<=uf;pf++){const mf=ff[(pf-1)%3],gf=ff[pf%3];let yf=gf[0]=pf;for(let vf=1;vf<=df;vf++){const bf=pc[pf-1]===mc[vf-1]?0:1;let Sf=Math.min(mf[vf]+1,gf[vf-1]+1,mf[vf-1]+bf);if(pf>1&&vf>1&&pc[pf-1]===mc[vf-2]&&pc[pf-2]===mc[vf-1]){const xf=ff[(pf-2)%3][vf-2];Sf=Math.min(Sf,xf+1)}Sf<yf&&(yf=Sf),gf[vf]=Sf}if(yf>bo)return}const hf=ff[uf%3][df];return hf<=bo?hf:void 0}}function stringToArray(vo){const Ai=vo.length,bo=new Array(Ai);for(let Ra=0;Ra<Ai;++Ra)bo[Ra]=vo.charCodeAt(Ra);return bo}function toObjMap(vo){if(vo==null)return Object.create(null);if(Object.getPrototypeOf(vo)===null)return vo;const Ai=Object.create(null);for(const[bo,Ra]of Object.entries(vo))Ai[bo]=Ra;return Ai}function printString(vo){return`"${vo.replace(escapedRegExp,escapedReplacer)}"`}const escapedRegExp=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function escapedReplacer(vo){return escapeSequences[vo.charCodeAt(0)]}const escapeSequences=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"],BREAK=Object.freeze({});function visit(vo,Ai,bo=QueryDocumentKeys){const Ra=new Map;for(const xf of Object.values(Kind))Ra.set(xf,getEnterLeaveForKind(Ai,xf));let pc,mc=Array.isArray(vo),uf=[vo],df=-1,ff=[],hf=vo,pf,mf;const gf=[],yf=[];do{df++;const xf=df===uf.length,wf=xf&&ff.length!==0;if(xf){if(pf=yf.length===0?void 0:gf[gf.length-1],hf=mf,mf=yf.pop(),wf)if(mc){hf=hf.slice();let l1=0;for(const[s1,c1]of ff){const u1=s1-l1;c1===null?(hf.splice(u1,1),l1++):hf[u1]=c1}}else{hf=Object.defineProperties({},Object.getOwnPropertyDescriptors(hf));for(const[l1,s1]of ff)hf[l1]=s1}df=pc.index,uf=pc.keys,ff=pc.edits,mc=pc.inArray,pc=pc.prev}else if(mf){if(pf=mc?df:uf[df],hf=mf[pf],hf==null)continue;gf.push(pf)}let If;if(!Array.isArray(hf)){var vf,bf;isNode(hf)||devAssert(!1,`Invalid AST Node: ${inspect(hf)}.`);const l1=xf?(vf=Ra.get(hf.kind))===null||vf===void 0?void 0:vf.leave:(bf=Ra.get(hf.kind))===null||bf===void 0?void 0:bf.enter;if(If=l1==null?void 0:l1.call(Ai,hf,pf,mf,gf,yf),If===BREAK)break;if(If===!1){if(!xf){gf.pop();continue}}else if(If!==void 0&&(ff.push([pf,If]),!xf))if(isNode(If))hf=If;else{gf.pop();continue}}if(If===void 0&&wf&&ff.push([pf,hf]),xf)gf.pop();else{var Sf;pc={inArray:mc,index:df,keys:uf,edits:ff,prev:pc},mc=Array.isArray(hf),uf=mc?hf:(Sf=bo[hf.kind])!==null&&Sf!==void 0?Sf:[],df=-1,ff=[],mf&&yf.push(mf),mf=hf}}while(pc!==void 0);return ff.length!==0?ff[ff.length-1][1]:vo}function visitInParallel(vo){const Ai=new Array(vo.length).fill(null),bo=Object.create(null);for(const Ra of Object.values(Kind)){let pc=!1;const mc=new Array(vo.length).fill(void 0),uf=new Array(vo.length).fill(void 0);for(let ff=0;ff<vo.length;++ff){const{enter:hf,leave:pf}=getEnterLeaveForKind(vo[ff],Ra);pc||(pc=hf!=null||pf!=null),mc[ff]=hf,uf[ff]=pf}if(!pc)continue;const df={enter(...ff){const hf=ff[0];for(let mf=0;mf<vo.length;mf++)if(Ai[mf]===null){var pf;const gf=(pf=mc[mf])===null||pf===void 0?void 0:pf.apply(vo[mf],ff);if(gf===!1)Ai[mf]=hf;else if(gf===BREAK)Ai[mf]=BREAK;else if(gf!==void 0)return gf}},leave(...ff){const hf=ff[0];for(let mf=0;mf<vo.length;mf++)if(Ai[mf]===null){var pf;const gf=(pf=uf[mf])===null||pf===void 0?void 0:pf.apply(vo[mf],ff);if(gf===BREAK)Ai[mf]=BREAK;else if(gf!==void 0&&gf!==!1)return gf}else Ai[mf]===hf&&(Ai[mf]=null)}};bo[Ra]=df}return bo}function getEnterLeaveForKind(vo,Ai){const bo=vo[Ai];return typeof bo=="object"?bo:typeof bo=="function"?{enter:bo,leave:void 0}:{enter:vo.enter,leave:vo.leave}}function print(vo){return visit(vo,printDocASTReducer)}const MAX_LINE_LENGTH=80,printDocASTReducer={Name:{leave:vo=>vo.value},Variable:{leave:vo=>"$"+vo.name},Document:{leave:vo=>join(vo.definitions,`
|
|
292
|
-
|
|
293
|
-
`)},OperationDefinition:{leave(vo){const Ai=wrap("(",join(vo.variableDefinitions,", "),")"),bo=join([vo.operation,join([vo.name,Ai]),join(vo.directives," ")]," ");return(bo==="query"?"":bo+" ")+vo.selectionSet}},VariableDefinition:{leave:({variable:vo,type:Ai,defaultValue:bo,directives:Ra})=>vo+": "+Ai+wrap(" = ",bo)+wrap(" ",join(Ra," "))},SelectionSet:{leave:({selections:vo})=>block(vo)},Field:{leave({alias:vo,name:Ai,arguments:bo,directives:Ra,selectionSet:pc}){const mc=wrap("",vo,": ")+Ai;let uf=mc+wrap("(",join(bo,", "),")");return uf.length>MAX_LINE_LENGTH&&(uf=mc+wrap(`(
|
|
294
|
-
`,indent(join(bo,`
|
|
295
|
-
`)),`
|
|
296
|
-
)`)),join([uf,join(Ra," "),pc]," ")}},Argument:{leave:({name:vo,value:Ai})=>vo+": "+Ai},FragmentSpread:{leave:({name:vo,directives:Ai})=>"..."+vo+wrap(" ",join(Ai," "))},InlineFragment:{leave:({typeCondition:vo,directives:Ai,selectionSet:bo})=>join(["...",wrap("on ",vo),join(Ai," "),bo]," ")},FragmentDefinition:{leave:({name:vo,typeCondition:Ai,variableDefinitions:bo,directives:Ra,selectionSet:pc})=>`fragment ${vo}${wrap("(",join(bo,", "),")")} on ${Ai} ${wrap("",join(Ra," ")," ")}`+pc},IntValue:{leave:({value:vo})=>vo},FloatValue:{leave:({value:vo})=>vo},StringValue:{leave:({value:vo,block:Ai})=>Ai?printBlockString(vo):printString(vo)},BooleanValue:{leave:({value:vo})=>vo?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:vo})=>vo},ListValue:{leave:({values:vo})=>"["+join(vo,", ")+"]"},ObjectValue:{leave:({fields:vo})=>"{"+join(vo,", ")+"}"},ObjectField:{leave:({name:vo,value:Ai})=>vo+": "+Ai},Directive:{leave:({name:vo,arguments:Ai})=>"@"+vo+wrap("(",join(Ai,", "),")")},NamedType:{leave:({name:vo})=>vo},ListType:{leave:({type:vo})=>"["+vo+"]"},NonNullType:{leave:({type:vo})=>vo+"!"},SchemaDefinition:{leave:({description:vo,directives:Ai,operationTypes:bo})=>wrap("",vo,`
|
|
297
|
-
`)+join(["schema",join(Ai," "),block(bo)]," ")},OperationTypeDefinition:{leave:({operation:vo,type:Ai})=>vo+": "+Ai},ScalarTypeDefinition:{leave:({description:vo,name:Ai,directives:bo})=>wrap("",vo,`
|
|
298
|
-
`)+join(["scalar",Ai,join(bo," ")]," ")},ObjectTypeDefinition:{leave:({description:vo,name:Ai,interfaces:bo,directives:Ra,fields:pc})=>wrap("",vo,`
|
|
299
|
-
`)+join(["type",Ai,wrap("implements ",join(bo," & ")),join(Ra," "),block(pc)]," ")},FieldDefinition:{leave:({description:vo,name:Ai,arguments:bo,type:Ra,directives:pc})=>wrap("",vo,`
|
|
300
|
-
`)+Ai+(hasMultilineItems(bo)?wrap(`(
|
|
301
|
-
`,indent(join(bo,`
|
|
302
|
-
`)),`
|
|
303
|
-
)`):wrap("(",join(bo,", "),")"))+": "+Ra+wrap(" ",join(pc," "))},InputValueDefinition:{leave:({description:vo,name:Ai,type:bo,defaultValue:Ra,directives:pc})=>wrap("",vo,`
|
|
304
|
-
`)+join([Ai+": "+bo,wrap("= ",Ra),join(pc," ")]," ")},InterfaceTypeDefinition:{leave:({description:vo,name:Ai,interfaces:bo,directives:Ra,fields:pc})=>wrap("",vo,`
|
|
305
|
-
`)+join(["interface",Ai,wrap("implements ",join(bo," & ")),join(Ra," "),block(pc)]," ")},UnionTypeDefinition:{leave:({description:vo,name:Ai,directives:bo,types:Ra})=>wrap("",vo,`
|
|
306
|
-
`)+join(["union",Ai,join(bo," "),wrap("= ",join(Ra," | "))]," ")},EnumTypeDefinition:{leave:({description:vo,name:Ai,directives:bo,values:Ra})=>wrap("",vo,`
|
|
307
|
-
`)+join(["enum",Ai,join(bo," "),block(Ra)]," ")},EnumValueDefinition:{leave:({description:vo,name:Ai,directives:bo})=>wrap("",vo,`
|
|
308
|
-
`)+join([Ai,join(bo," ")]," ")},InputObjectTypeDefinition:{leave:({description:vo,name:Ai,directives:bo,fields:Ra})=>wrap("",vo,`
|
|
309
|
-
`)+join(["input",Ai,join(bo," "),block(Ra)]," ")},DirectiveDefinition:{leave:({description:vo,name:Ai,arguments:bo,repeatable:Ra,locations:pc})=>wrap("",vo,`
|
|
310
|
-
`)+"directive @"+Ai+(hasMultilineItems(bo)?wrap(`(
|
|
311
|
-
`,indent(join(bo,`
|
|
312
|
-
`)),`
|
|
313
|
-
)`):wrap("(",join(bo,", "),")"))+(Ra?" repeatable":"")+" on "+join(pc," | ")},SchemaExtension:{leave:({directives:vo,operationTypes:Ai})=>join(["extend schema",join(vo," "),block(Ai)]," ")},ScalarTypeExtension:{leave:({name:vo,directives:Ai})=>join(["extend scalar",vo,join(Ai," ")]," ")},ObjectTypeExtension:{leave:({name:vo,interfaces:Ai,directives:bo,fields:Ra})=>join(["extend type",vo,wrap("implements ",join(Ai," & ")),join(bo," "),block(Ra)]," ")},InterfaceTypeExtension:{leave:({name:vo,interfaces:Ai,directives:bo,fields:Ra})=>join(["extend interface",vo,wrap("implements ",join(Ai," & ")),join(bo," "),block(Ra)]," ")},UnionTypeExtension:{leave:({name:vo,directives:Ai,types:bo})=>join(["extend union",vo,join(Ai," "),wrap("= ",join(bo," | "))]," ")},EnumTypeExtension:{leave:({name:vo,directives:Ai,values:bo})=>join(["extend enum",vo,join(Ai," "),block(bo)]," ")},InputObjectTypeExtension:{leave:({name:vo,directives:Ai,fields:bo})=>join(["extend input",vo,join(Ai," "),block(bo)]," ")}};function join(vo,Ai=""){var bo;return(bo=vo==null?void 0:vo.filter(Ra=>Ra).join(Ai))!==null&&bo!==void 0?bo:""}function block(vo){return wrap(`{
|
|
314
|
-
`,indent(join(vo,`
|
|
315
|
-
`)),`
|
|
316
|
-
}`)}function wrap(vo,Ai,bo=""){return Ai!=null&&Ai!==""?vo+Ai+bo:""}function indent(vo){return wrap(" ",vo.replace(/\n/g,`
|
|
317
|
-
`))}function hasMultilineItems(vo){var Ai;return(Ai=vo==null?void 0:vo.some(bo=>bo.includes(`
|
|
318
|
-
`)))!==null&&Ai!==void 0?Ai:!1}function valueFromASTUntyped(vo,Ai){switch(vo.kind){case Kind.NULL:return null;case Kind.INT:return parseInt(vo.value,10);case Kind.FLOAT:return parseFloat(vo.value);case Kind.STRING:case Kind.ENUM:case Kind.BOOLEAN:return vo.value;case Kind.LIST:return vo.values.map(bo=>valueFromASTUntyped(bo,Ai));case Kind.OBJECT:return keyValMap(vo.fields,bo=>bo.name.value,bo=>valueFromASTUntyped(bo.value,Ai));case Kind.VARIABLE:return Ai==null?void 0:Ai[vo.name.value]}}function assertName(vo){if(vo!=null||devAssert(!1,"Must provide name."),typeof vo=="string"||devAssert(!1,"Expected name to be a string."),vo.length===0)throw new GraphQLError("Expected name to be a non-empty string.");for(let Ai=1;Ai<vo.length;++Ai)if(!isNameContinue(vo.charCodeAt(Ai)))throw new GraphQLError(`Names must only contain [_a-zA-Z0-9] but "${vo}" does not.`);if(!isNameStart(vo.charCodeAt(0)))throw new GraphQLError(`Names must start with [_a-zA-Z] but "${vo}" does not.`);return vo}function assertEnumValueName(vo){if(vo==="true"||vo==="false"||vo==="null")throw new GraphQLError(`Enum values cannot be named: ${vo}`);return assertName(vo)}function isType(vo){return isScalarType(vo)||isObjectType(vo)||isInterfaceType(vo)||isUnionType(vo)||isEnumType(vo)||isInputObjectType(vo)||isListType(vo)||isNonNullType(vo)}function isScalarType(vo){return instanceOf(vo,GraphQLScalarType)}function isObjectType(vo){return instanceOf(vo,GraphQLObjectType)}function isInterfaceType(vo){return instanceOf(vo,GraphQLInterfaceType)}function isUnionType(vo){return instanceOf(vo,GraphQLUnionType)}function isEnumType(vo){return instanceOf(vo,GraphQLEnumType)}function isInputObjectType(vo){return instanceOf(vo,GraphQLInputObjectType)}function isListType(vo){return instanceOf(vo,GraphQLList)}function isNonNullType(vo){return instanceOf(vo,GraphQLNonNull)}function isInputType(vo){return isScalarType(vo)||isEnumType(vo)||isInputObjectType(vo)||isWrappingType(vo)&&isInputType(vo.ofType)}function isOutputType(vo){return isScalarType(vo)||isObjectType(vo)||isInterfaceType(vo)||isUnionType(vo)||isEnumType(vo)||isWrappingType(vo)&&isOutputType(vo.ofType)}function isLeafType(vo){return isScalarType(vo)||isEnumType(vo)}function isCompositeType(vo){return isObjectType(vo)||isInterfaceType(vo)||isUnionType(vo)}function isAbstractType(vo){return isInterfaceType(vo)||isUnionType(vo)}function assertAbstractType(vo){if(!isAbstractType(vo))throw new Error(`Expected ${inspect(vo)} to be a GraphQL abstract type.`);return vo}class GraphQLList{constructor(Ai){isType(Ai)||devAssert(!1,`Expected ${inspect(Ai)} to be a GraphQL type.`),this.ofType=Ai}get[Symbol.toStringTag](){return"GraphQLList"}toString(){return"["+String(this.ofType)+"]"}toJSON(){return this.toString()}}class GraphQLNonNull{constructor(Ai){isNullableType(Ai)||devAssert(!1,`Expected ${inspect(Ai)} to be a GraphQL nullable type.`),this.ofType=Ai}get[Symbol.toStringTag](){return"GraphQLNonNull"}toString(){return String(this.ofType)+"!"}toJSON(){return this.toString()}}function isWrappingType(vo){return isListType(vo)||isNonNullType(vo)}function isNullableType(vo){return isType(vo)&&!isNonNullType(vo)}function getNullableType(vo){if(vo)return isNonNullType(vo)?vo.ofType:vo}function isNamedType(vo){return isScalarType(vo)||isObjectType(vo)||isInterfaceType(vo)||isUnionType(vo)||isEnumType(vo)||isInputObjectType(vo)}function getNamedType(vo){if(vo){let Ai=vo;for(;isWrappingType(Ai);)Ai=Ai.ofType;return Ai}}function resolveReadonlyArrayThunk(vo){return typeof vo=="function"?vo():vo}function resolveObjMapThunk(vo){return typeof vo=="function"?vo():vo}class GraphQLScalarType{constructor(Ai){var bo,Ra,pc,mc;const uf=(bo=Ai.parseValue)!==null&&bo!==void 0?bo:identityFunc;this.name=assertName(Ai.name),this.description=Ai.description,this.specifiedByURL=Ai.specifiedByURL,this.serialize=(Ra=Ai.serialize)!==null&&Ra!==void 0?Ra:identityFunc,this.parseValue=uf,this.parseLiteral=(pc=Ai.parseLiteral)!==null&&pc!==void 0?pc:(df,ff)=>uf(valueFromASTUntyped(df,ff)),this.extensions=toObjMap(Ai.extensions),this.astNode=Ai.astNode,this.extensionASTNodes=(mc=Ai.extensionASTNodes)!==null&&mc!==void 0?mc:[],Ai.specifiedByURL==null||typeof Ai.specifiedByURL=="string"||devAssert(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${inspect(Ai.specifiedByURL)}.`),Ai.serialize==null||typeof Ai.serialize=="function"||devAssert(!1,`${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`),Ai.parseLiteral&&(typeof Ai.parseValue=="function"&&typeof Ai.parseLiteral=="function"||devAssert(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class GraphQLObjectType{constructor(Ai){var bo;this.name=assertName(Ai.name),this.description=Ai.description,this.isTypeOf=Ai.isTypeOf,this.extensions=toObjMap(Ai.extensions),this.astNode=Ai.astNode,this.extensionASTNodes=(bo=Ai.extensionASTNodes)!==null&&bo!==void 0?bo:[],this._fields=()=>defineFieldMap(Ai),this._interfaces=()=>defineInterfaces(Ai),Ai.isTypeOf==null||typeof Ai.isTypeOf=="function"||devAssert(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${inspect(Ai.isTypeOf)}.`)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:fieldsToFieldsConfig(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function defineInterfaces(vo){var Ai;const bo=resolveReadonlyArrayThunk((Ai=vo.interfaces)!==null&&Ai!==void 0?Ai:[]);return Array.isArray(bo)||devAssert(!1,`${vo.name} interfaces must be an Array or a function which returns an Array.`),bo}function defineFieldMap(vo){const Ai=resolveObjMapThunk(vo.fields);return isPlainObj(Ai)||devAssert(!1,`${vo.name} fields must be an object with field names as keys or a function which returns such an object.`),mapValue(Ai,(bo,Ra)=>{var pc;isPlainObj(bo)||devAssert(!1,`${vo.name}.${Ra} field config must be an object.`),bo.resolve==null||typeof bo.resolve=="function"||devAssert(!1,`${vo.name}.${Ra} field resolver must be a function if provided, but got: ${inspect(bo.resolve)}.`);const mc=(pc=bo.args)!==null&&pc!==void 0?pc:{};return isPlainObj(mc)||devAssert(!1,`${vo.name}.${Ra} args must be an object with argument names as keys.`),{name:assertName(Ra),description:bo.description,type:bo.type,args:defineArguments(mc),resolve:bo.resolve,subscribe:bo.subscribe,deprecationReason:bo.deprecationReason,extensions:toObjMap(bo.extensions),astNode:bo.astNode}})}function defineArguments(vo){return Object.entries(vo).map(([Ai,bo])=>({name:assertName(Ai),description:bo.description,type:bo.type,defaultValue:bo.defaultValue,deprecationReason:bo.deprecationReason,extensions:toObjMap(bo.extensions),astNode:bo.astNode}))}function isPlainObj(vo){return isObjectLike(vo)&&!Array.isArray(vo)}function fieldsToFieldsConfig(vo){return mapValue(vo,Ai=>({description:Ai.description,type:Ai.type,args:argsToArgsConfig(Ai.args),resolve:Ai.resolve,subscribe:Ai.subscribe,deprecationReason:Ai.deprecationReason,extensions:Ai.extensions,astNode:Ai.astNode}))}function argsToArgsConfig(vo){return keyValMap(vo,Ai=>Ai.name,Ai=>({description:Ai.description,type:Ai.type,defaultValue:Ai.defaultValue,deprecationReason:Ai.deprecationReason,extensions:Ai.extensions,astNode:Ai.astNode}))}function isRequiredArgument(vo){return isNonNullType(vo.type)&&vo.defaultValue===void 0}class GraphQLInterfaceType{constructor(Ai){var bo;this.name=assertName(Ai.name),this.description=Ai.description,this.resolveType=Ai.resolveType,this.extensions=toObjMap(Ai.extensions),this.astNode=Ai.astNode,this.extensionASTNodes=(bo=Ai.extensionASTNodes)!==null&&bo!==void 0?bo:[],this._fields=defineFieldMap.bind(void 0,Ai),this._interfaces=defineInterfaces.bind(void 0,Ai),Ai.resolveType==null||typeof Ai.resolveType=="function"||devAssert(!1,`${this.name} must provide "resolveType" as a function, but got: ${inspect(Ai.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:fieldsToFieldsConfig(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class GraphQLUnionType{constructor(Ai){var bo;this.name=assertName(Ai.name),this.description=Ai.description,this.resolveType=Ai.resolveType,this.extensions=toObjMap(Ai.extensions),this.astNode=Ai.astNode,this.extensionASTNodes=(bo=Ai.extensionASTNodes)!==null&&bo!==void 0?bo:[],this._types=defineTypes.bind(void 0,Ai),Ai.resolveType==null||typeof Ai.resolveType=="function"||devAssert(!1,`${this.name} must provide "resolveType" as a function, but got: ${inspect(Ai.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return typeof this._types=="function"&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function defineTypes(vo){const Ai=resolveReadonlyArrayThunk(vo.types);return Array.isArray(Ai)||devAssert(!1,`Must provide Array of types or a function which returns such an array for Union ${vo.name}.`),Ai}class GraphQLEnumType{constructor(Ai){var bo;this.name=assertName(Ai.name),this.description=Ai.description,this.extensions=toObjMap(Ai.extensions),this.astNode=Ai.astNode,this.extensionASTNodes=(bo=Ai.extensionASTNodes)!==null&&bo!==void 0?bo:[],this._values=typeof Ai.values=="function"?Ai.values:defineEnumValues(this.name,Ai.values),this._valueLookup=null,this._nameLookup=null}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return typeof this._values=="function"&&(this._values=defineEnumValues(this.name,this._values())),this._values}getValue(Ai){return this._nameLookup===null&&(this._nameLookup=keyMap(this.getValues(),bo=>bo.name)),this._nameLookup[Ai]}serialize(Ai){this._valueLookup===null&&(this._valueLookup=new Map(this.getValues().map(Ra=>[Ra.value,Ra])));const bo=this._valueLookup.get(Ai);if(bo===void 0)throw new GraphQLError(`Enum "${this.name}" cannot represent value: ${inspect(Ai)}`);return bo.name}parseValue(Ai){if(typeof Ai!="string"){const Ra=inspect(Ai);throw new GraphQLError(`Enum "${this.name}" cannot represent non-string value: ${Ra}.`+didYouMeanEnumValue(this,Ra))}const bo=this.getValue(Ai);if(bo==null)throw new GraphQLError(`Value "${Ai}" does not exist in "${this.name}" enum.`+didYouMeanEnumValue(this,Ai));return bo.value}parseLiteral(Ai,bo){if(Ai.kind!==Kind.ENUM){const pc=print(Ai);throw new GraphQLError(`Enum "${this.name}" cannot represent non-enum value: ${pc}.`+didYouMeanEnumValue(this,pc),{nodes:Ai})}const Ra=this.getValue(Ai.value);if(Ra==null){const pc=print(Ai);throw new GraphQLError(`Value "${pc}" does not exist in "${this.name}" enum.`+didYouMeanEnumValue(this,pc),{nodes:Ai})}return Ra.value}toConfig(){const Ai=keyValMap(this.getValues(),bo=>bo.name,bo=>({description:bo.description,value:bo.value,deprecationReason:bo.deprecationReason,extensions:bo.extensions,astNode:bo.astNode}));return{name:this.name,description:this.description,values:Ai,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function didYouMeanEnumValue(vo,Ai){const bo=vo.getValues().map(pc=>pc.name),Ra=suggestionList(Ai,bo);return didYouMean("the enum value",Ra)}function defineEnumValues(vo,Ai){return isPlainObj(Ai)||devAssert(!1,`${vo} values must be an object with value names as keys.`),Object.entries(Ai).map(([bo,Ra])=>(isPlainObj(Ra)||devAssert(!1,`${vo}.${bo} must refer to an object with a "value" key representing an internal value but got: ${inspect(Ra)}.`),{name:assertEnumValueName(bo),description:Ra.description,value:Ra.value!==void 0?Ra.value:bo,deprecationReason:Ra.deprecationReason,extensions:toObjMap(Ra.extensions),astNode:Ra.astNode}))}class GraphQLInputObjectType{constructor(Ai){var bo,Ra;this.name=assertName(Ai.name),this.description=Ai.description,this.extensions=toObjMap(Ai.extensions),this.astNode=Ai.astNode,this.extensionASTNodes=(bo=Ai.extensionASTNodes)!==null&&bo!==void 0?bo:[],this.isOneOf=(Ra=Ai.isOneOf)!==null&&Ra!==void 0?Ra:!1,this._fields=defineInputFieldMap.bind(void 0,Ai)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}toConfig(){const Ai=mapValue(this.getFields(),bo=>({description:bo.description,type:bo.type,defaultValue:bo.defaultValue,deprecationReason:bo.deprecationReason,extensions:bo.extensions,astNode:bo.astNode}));return{name:this.name,description:this.description,fields:Ai,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,isOneOf:this.isOneOf}}toString(){return this.name}toJSON(){return this.toString()}}function defineInputFieldMap(vo){const Ai=resolveObjMapThunk(vo.fields);return isPlainObj(Ai)||devAssert(!1,`${vo.name} fields must be an object with field names as keys or a function which returns such an object.`),mapValue(Ai,(bo,Ra)=>(!("resolve"in bo)||devAssert(!1,`${vo.name}.${Ra} field has a resolve property, but Input Types cannot define resolvers.`),{name:assertName(Ra),description:bo.description,type:bo.type,defaultValue:bo.defaultValue,deprecationReason:bo.deprecationReason,extensions:toObjMap(bo.extensions),astNode:bo.astNode}))}function isRequiredInputField(vo){return isNonNullType(vo.type)&&vo.defaultValue===void 0}function isEqualType(vo,Ai){return vo===Ai?!0:isNonNullType(vo)&&isNonNullType(Ai)||isListType(vo)&&isListType(Ai)?isEqualType(vo.ofType,Ai.ofType):!1}function isTypeSubTypeOf(vo,Ai,bo){return Ai===bo?!0:isNonNullType(bo)?isNonNullType(Ai)?isTypeSubTypeOf(vo,Ai.ofType,bo.ofType):!1:isNonNullType(Ai)?isTypeSubTypeOf(vo,Ai.ofType,bo):isListType(bo)?isListType(Ai)?isTypeSubTypeOf(vo,Ai.ofType,bo.ofType):!1:isListType(Ai)?!1:isAbstractType(bo)&&(isInterfaceType(Ai)||isObjectType(Ai))&&vo.isSubType(bo,Ai)}function doTypesOverlap(vo,Ai,bo){return Ai===bo?!0:isAbstractType(Ai)?isAbstractType(bo)?vo.getPossibleTypes(Ai).some(Ra=>vo.isSubType(bo,Ra)):vo.isSubType(Ai,bo):isAbstractType(bo)?vo.isSubType(bo,Ai):!1}const GRAPHQL_MAX_INT=2147483647,GRAPHQL_MIN_INT=-2147483648,GraphQLInt=new GraphQLScalarType({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize(vo){const Ai=serializeObject(vo);if(typeof Ai=="boolean")return Ai?1:0;let bo=Ai;if(typeof Ai=="string"&&Ai!==""&&(bo=Number(Ai)),typeof bo!="number"||!Number.isInteger(bo))throw new GraphQLError(`Int cannot represent non-integer value: ${inspect(Ai)}`);if(bo>GRAPHQL_MAX_INT||bo<GRAPHQL_MIN_INT)throw new GraphQLError("Int cannot represent non 32-bit signed integer value: "+inspect(Ai));return bo},parseValue(vo){if(typeof vo!="number"||!Number.isInteger(vo))throw new GraphQLError(`Int cannot represent non-integer value: ${inspect(vo)}`);if(vo>GRAPHQL_MAX_INT||vo<GRAPHQL_MIN_INT)throw new GraphQLError(`Int cannot represent non 32-bit signed integer value: ${vo}`);return vo},parseLiteral(vo){if(vo.kind!==Kind.INT)throw new GraphQLError(`Int cannot represent non-integer value: ${print(vo)}`,{nodes:vo});const Ai=parseInt(vo.value,10);if(Ai>GRAPHQL_MAX_INT||Ai<GRAPHQL_MIN_INT)throw new GraphQLError(`Int cannot represent non 32-bit signed integer value: ${vo.value}`,{nodes:vo});return Ai}}),GraphQLFloat=new GraphQLScalarType({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",serialize(vo){const Ai=serializeObject(vo);if(typeof Ai=="boolean")return Ai?1:0;let bo=Ai;if(typeof Ai=="string"&&Ai!==""&&(bo=Number(Ai)),typeof bo!="number"||!Number.isFinite(bo))throw new GraphQLError(`Float cannot represent non numeric value: ${inspect(Ai)}`);return bo},parseValue(vo){if(typeof vo!="number"||!Number.isFinite(vo))throw new GraphQLError(`Float cannot represent non numeric value: ${inspect(vo)}`);return vo},parseLiteral(vo){if(vo.kind!==Kind.FLOAT&&vo.kind!==Kind.INT)throw new GraphQLError(`Float cannot represent non numeric value: ${print(vo)}`,vo);return parseFloat(vo.value)}}),GraphQLString=new GraphQLScalarType({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",serialize(vo){const Ai=serializeObject(vo);if(typeof Ai=="string")return Ai;if(typeof Ai=="boolean")return Ai?"true":"false";if(typeof Ai=="number"&&Number.isFinite(Ai))return Ai.toString();throw new GraphQLError(`String cannot represent value: ${inspect(vo)}`)},parseValue(vo){if(typeof vo!="string")throw new GraphQLError(`String cannot represent a non string value: ${inspect(vo)}`);return vo},parseLiteral(vo){if(vo.kind!==Kind.STRING)throw new GraphQLError(`String cannot represent a non string value: ${print(vo)}`,{nodes:vo});return vo.value}}),GraphQLBoolean=new GraphQLScalarType({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize(vo){const Ai=serializeObject(vo);if(typeof Ai=="boolean")return Ai;if(Number.isFinite(Ai))return Ai!==0;throw new GraphQLError(`Boolean cannot represent a non boolean value: ${inspect(Ai)}`)},parseValue(vo){if(typeof vo!="boolean")throw new GraphQLError(`Boolean cannot represent a non boolean value: ${inspect(vo)}`);return vo},parseLiteral(vo){if(vo.kind!==Kind.BOOLEAN)throw new GraphQLError(`Boolean cannot represent a non boolean value: ${print(vo)}`,{nodes:vo});return vo.value}}),GraphQLID=new GraphQLScalarType({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',serialize(vo){const Ai=serializeObject(vo);if(typeof Ai=="string")return Ai;if(Number.isInteger(Ai))return String(Ai);throw new GraphQLError(`ID cannot represent value: ${inspect(vo)}`)},parseValue(vo){if(typeof vo=="string")return vo;if(typeof vo=="number"&&Number.isInteger(vo))return vo.toString();throw new GraphQLError(`ID cannot represent value: ${inspect(vo)}`)},parseLiteral(vo){if(vo.kind!==Kind.STRING&&vo.kind!==Kind.INT)throw new GraphQLError("ID cannot represent a non-string and non-integer value: "+print(vo),{nodes:vo});return vo.value}}),specifiedScalarTypes=Object.freeze([GraphQLString,GraphQLInt,GraphQLFloat,GraphQLBoolean,GraphQLID]);function isSpecifiedScalarType(vo){return specifiedScalarTypes.some(({name:Ai})=>vo.name===Ai)}function serializeObject(vo){if(isObjectLike(vo)){if(typeof vo.valueOf=="function"){const Ai=vo.valueOf();if(!isObjectLike(Ai))return Ai}if(typeof vo.toJSON=="function")return vo.toJSON()}return vo}function isDirective(vo){return instanceOf(vo,GraphQLDirective)}class GraphQLDirective{constructor(Ai){var bo,Ra;this.name=assertName(Ai.name),this.description=Ai.description,this.locations=Ai.locations,this.isRepeatable=(bo=Ai.isRepeatable)!==null&&bo!==void 0?bo:!1,this.extensions=toObjMap(Ai.extensions),this.astNode=Ai.astNode,Array.isArray(Ai.locations)||devAssert(!1,`@${Ai.name} locations must be an Array.`);const pc=(Ra=Ai.args)!==null&&Ra!==void 0?Ra:{};isObjectLike(pc)&&!Array.isArray(pc)||devAssert(!1,`@${Ai.name} args must be an object with argument names as keys.`),this.args=defineArguments(pc)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:argsToArgsConfig(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}}const GraphQLIncludeDirective=new GraphQLDirective({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[DirectiveLocation.FIELD,DirectiveLocation.FRAGMENT_SPREAD,DirectiveLocation.INLINE_FRAGMENT],args:{if:{type:new GraphQLNonNull(GraphQLBoolean),description:"Included when true."}}}),GraphQLSkipDirective=new GraphQLDirective({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[DirectiveLocation.FIELD,DirectiveLocation.FRAGMENT_SPREAD,DirectiveLocation.INLINE_FRAGMENT],args:{if:{type:new GraphQLNonNull(GraphQLBoolean),description:"Skipped when true."}}}),DEFAULT_DEPRECATION_REASON="No longer supported",GraphQLDeprecatedDirective=new GraphQLDirective({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[DirectiveLocation.FIELD_DEFINITION,DirectiveLocation.ARGUMENT_DEFINITION,DirectiveLocation.INPUT_FIELD_DEFINITION,DirectiveLocation.ENUM_VALUE],args:{reason:{type:GraphQLString,description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",defaultValue:DEFAULT_DEPRECATION_REASON}}}),GraphQLSpecifiedByDirective=new GraphQLDirective({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[DirectiveLocation.SCALAR],args:{url:{type:new GraphQLNonNull(GraphQLString),description:"The URL that specifies the behavior of this scalar."}}}),GraphQLOneOfDirective=new GraphQLDirective({name:"oneOf",description:"Indicates exactly one field must be supplied and this field must not be `null`.",locations:[DirectiveLocation.INPUT_OBJECT],args:{}}),specifiedDirectives=Object.freeze([GraphQLIncludeDirective,GraphQLSkipDirective,GraphQLDeprecatedDirective,GraphQLSpecifiedByDirective,GraphQLOneOfDirective]);function isSpecifiedDirective(vo){return specifiedDirectives.some(({name:Ai})=>Ai===vo.name)}function isIterableObject(vo){return typeof vo=="object"&&typeof(vo==null?void 0:vo[Symbol.iterator])=="function"}function astFromValue(vo,Ai){if(isNonNullType(Ai)){const bo=astFromValue(vo,Ai.ofType);return(bo==null?void 0:bo.kind)===Kind.NULL?null:bo}if(vo===null)return{kind:Kind.NULL};if(vo===void 0)return null;if(isListType(Ai)){const bo=Ai.ofType;if(isIterableObject(vo)){const Ra=[];for(const pc of vo){const mc=astFromValue(pc,bo);mc!=null&&Ra.push(mc)}return{kind:Kind.LIST,values:Ra}}return astFromValue(vo,bo)}if(isInputObjectType(Ai)){if(!isObjectLike(vo))return null;const bo=[];for(const Ra of Object.values(Ai.getFields())){const pc=astFromValue(vo[Ra.name],Ra.type);pc&&bo.push({kind:Kind.OBJECT_FIELD,name:{kind:Kind.NAME,value:Ra.name},value:pc})}return{kind:Kind.OBJECT,fields:bo}}if(isLeafType(Ai)){const bo=Ai.serialize(vo);if(bo==null)return null;if(typeof bo=="boolean")return{kind:Kind.BOOLEAN,value:bo};if(typeof bo=="number"&&Number.isFinite(bo)){const Ra=String(bo);return integerStringRegExp.test(Ra)?{kind:Kind.INT,value:Ra}:{kind:Kind.FLOAT,value:Ra}}if(typeof bo=="string")return isEnumType(Ai)?{kind:Kind.ENUM,value:bo}:Ai===GraphQLID&&integerStringRegExp.test(bo)?{kind:Kind.INT,value:bo}:{kind:Kind.STRING,value:bo};throw new TypeError(`Cannot convert value to AST: ${inspect(bo)}.`)}invariant$1(!1,"Unexpected input type: "+inspect(Ai))}const integerStringRegExp=/^-?(?:0|[1-9][0-9]*)$/,__Schema=new GraphQLObjectType({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:GraphQLString,resolve:vo=>vo.description},types:{description:"A list of all types supported by this server.",type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__Type))),resolve(vo){return Object.values(vo.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new GraphQLNonNull(__Type),resolve:vo=>vo.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:__Type,resolve:vo=>vo.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:__Type,resolve:vo=>vo.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__Directive))),resolve:vo=>vo.getDirectives()}})}),__Directive=new GraphQLObjectType({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
|
|
319
|
-
|
|
320
|
-
In some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.`,fields:()=>({name:{type:new GraphQLNonNull(GraphQLString),resolve:vo=>vo.name},description:{type:GraphQLString,resolve:vo=>vo.description},isRepeatable:{type:new GraphQLNonNull(GraphQLBoolean),resolve:vo=>vo.isRepeatable},locations:{type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__DirectiveLocation))),resolve:vo=>vo.locations},args:{type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__InputValue))),args:{includeDeprecated:{type:GraphQLBoolean,defaultValue:!1}},resolve(vo,{includeDeprecated:Ai}){return Ai?vo.args:vo.args.filter(bo=>bo.deprecationReason==null)}}})}),__DirectiveLocation=new GraphQLEnumType({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:DirectiveLocation.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:DirectiveLocation.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:DirectiveLocation.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:DirectiveLocation.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:DirectiveLocation.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:DirectiveLocation.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:DirectiveLocation.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:DirectiveLocation.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:DirectiveLocation.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:DirectiveLocation.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:DirectiveLocation.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:DirectiveLocation.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:DirectiveLocation.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:DirectiveLocation.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:DirectiveLocation.UNION,description:"Location adjacent to a union definition."},ENUM:{value:DirectiveLocation.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:DirectiveLocation.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:DirectiveLocation.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:DirectiveLocation.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),__Type=new GraphQLObjectType({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new GraphQLNonNull(__TypeKind),resolve(vo){if(isScalarType(vo))return TypeKind.SCALAR;if(isObjectType(vo))return TypeKind.OBJECT;if(isInterfaceType(vo))return TypeKind.INTERFACE;if(isUnionType(vo))return TypeKind.UNION;if(isEnumType(vo))return TypeKind.ENUM;if(isInputObjectType(vo))return TypeKind.INPUT_OBJECT;if(isListType(vo))return TypeKind.LIST;if(isNonNullType(vo))return TypeKind.NON_NULL;invariant$1(!1,`Unexpected type: "${inspect(vo)}".`)}},name:{type:GraphQLString,resolve:vo=>"name"in vo?vo.name:void 0},description:{type:GraphQLString,resolve:vo=>"description"in vo?vo.description:void 0},specifiedByURL:{type:GraphQLString,resolve:vo=>"specifiedByURL"in vo?vo.specifiedByURL:void 0},fields:{type:new GraphQLList(new GraphQLNonNull(__Field)),args:{includeDeprecated:{type:GraphQLBoolean,defaultValue:!1}},resolve(vo,{includeDeprecated:Ai}){if(isObjectType(vo)||isInterfaceType(vo)){const bo=Object.values(vo.getFields());return Ai?bo:bo.filter(Ra=>Ra.deprecationReason==null)}}},interfaces:{type:new GraphQLList(new GraphQLNonNull(__Type)),resolve(vo){if(isObjectType(vo)||isInterfaceType(vo))return vo.getInterfaces()}},possibleTypes:{type:new GraphQLList(new GraphQLNonNull(__Type)),resolve(vo,Ai,bo,{schema:Ra}){if(isAbstractType(vo))return Ra.getPossibleTypes(vo)}},enumValues:{type:new GraphQLList(new GraphQLNonNull(__EnumValue)),args:{includeDeprecated:{type:GraphQLBoolean,defaultValue:!1}},resolve(vo,{includeDeprecated:Ai}){if(isEnumType(vo)){const bo=vo.getValues();return Ai?bo:bo.filter(Ra=>Ra.deprecationReason==null)}}},inputFields:{type:new GraphQLList(new GraphQLNonNull(__InputValue)),args:{includeDeprecated:{type:GraphQLBoolean,defaultValue:!1}},resolve(vo,{includeDeprecated:Ai}){if(isInputObjectType(vo)){const bo=Object.values(vo.getFields());return Ai?bo:bo.filter(Ra=>Ra.deprecationReason==null)}}},ofType:{type:__Type,resolve:vo=>"ofType"in vo?vo.ofType:void 0},isOneOf:{type:GraphQLBoolean,resolve:vo=>{if(isInputObjectType(vo))return vo.isOneOf}}})}),__Field=new GraphQLObjectType({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new GraphQLNonNull(GraphQLString),resolve:vo=>vo.name},description:{type:GraphQLString,resolve:vo=>vo.description},args:{type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__InputValue))),args:{includeDeprecated:{type:GraphQLBoolean,defaultValue:!1}},resolve(vo,{includeDeprecated:Ai}){return Ai?vo.args:vo.args.filter(bo=>bo.deprecationReason==null)}},type:{type:new GraphQLNonNull(__Type),resolve:vo=>vo.type},isDeprecated:{type:new GraphQLNonNull(GraphQLBoolean),resolve:vo=>vo.deprecationReason!=null},deprecationReason:{type:GraphQLString,resolve:vo=>vo.deprecationReason}})}),__InputValue=new GraphQLObjectType({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new GraphQLNonNull(GraphQLString),resolve:vo=>vo.name},description:{type:GraphQLString,resolve:vo=>vo.description},type:{type:new GraphQLNonNull(__Type),resolve:vo=>vo.type},defaultValue:{type:GraphQLString,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(vo){const{type:Ai,defaultValue:bo}=vo,Ra=astFromValue(bo,Ai);return Ra?print(Ra):null}},isDeprecated:{type:new GraphQLNonNull(GraphQLBoolean),resolve:vo=>vo.deprecationReason!=null},deprecationReason:{type:GraphQLString,resolve:vo=>vo.deprecationReason}})}),__EnumValue=new GraphQLObjectType({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new GraphQLNonNull(GraphQLString),resolve:vo=>vo.name},description:{type:GraphQLString,resolve:vo=>vo.description},isDeprecated:{type:new GraphQLNonNull(GraphQLBoolean),resolve:vo=>vo.deprecationReason!=null},deprecationReason:{type:GraphQLString,resolve:vo=>vo.deprecationReason}})});var TypeKind;(function(vo){vo.SCALAR="SCALAR",vo.OBJECT="OBJECT",vo.INTERFACE="INTERFACE",vo.UNION="UNION",vo.ENUM="ENUM",vo.INPUT_OBJECT="INPUT_OBJECT",vo.LIST="LIST",vo.NON_NULL="NON_NULL"})(TypeKind||(TypeKind={}));const __TypeKind=new GraphQLEnumType({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:TypeKind.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:TypeKind.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:TypeKind.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:TypeKind.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:TypeKind.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:TypeKind.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:TypeKind.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:TypeKind.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),SchemaMetaFieldDef={name:"__schema",type:new GraphQLNonNull(__Schema),description:"Access the current type schema of this server.",args:[],resolve:(vo,Ai,bo,{schema:Ra})=>Ra,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},TypeMetaFieldDef={name:"__type",type:__Type,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new GraphQLNonNull(GraphQLString),defaultValue:void 0,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0}],resolve:(vo,{name:Ai},bo,{schema:Ra})=>Ra.getType(Ai),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},TypeNameMetaFieldDef={name:"__typename",type:new GraphQLNonNull(GraphQLString),description:"The name of the current Object type at runtime.",args:[],resolve:(vo,Ai,bo,{parentType:Ra})=>Ra.name,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},introspectionTypes=Object.freeze([__Schema,__Directive,__DirectiveLocation,__Type,__Field,__InputValue,__EnumValue,__TypeKind]);function isIntrospectionType(vo){return introspectionTypes.some(({name:Ai})=>vo.name===Ai)}function isSchema(vo){return instanceOf(vo,GraphQLSchema)}function assertSchema(vo){if(!isSchema(vo))throw new Error(`Expected ${inspect(vo)} to be a GraphQL schema.`);return vo}class GraphQLSchema{constructor(Ai){var bo,Ra;this.__validationErrors=Ai.assumeValid===!0?[]:void 0,isObjectLike(Ai)||devAssert(!1,"Must provide configuration object."),!Ai.types||Array.isArray(Ai.types)||devAssert(!1,`"types" must be Array if provided but got: ${inspect(Ai.types)}.`),!Ai.directives||Array.isArray(Ai.directives)||devAssert(!1,`"directives" must be Array if provided but got: ${inspect(Ai.directives)}.`),this.description=Ai.description,this.extensions=toObjMap(Ai.extensions),this.astNode=Ai.astNode,this.extensionASTNodes=(bo=Ai.extensionASTNodes)!==null&&bo!==void 0?bo:[],this._queryType=Ai.query,this._mutationType=Ai.mutation,this._subscriptionType=Ai.subscription,this._directives=(Ra=Ai.directives)!==null&&Ra!==void 0?Ra:specifiedDirectives;const pc=new Set(Ai.types);if(Ai.types!=null)for(const mc of Ai.types)pc.delete(mc),collectReferencedTypes(mc,pc);this._queryType!=null&&collectReferencedTypes(this._queryType,pc),this._mutationType!=null&&collectReferencedTypes(this._mutationType,pc),this._subscriptionType!=null&&collectReferencedTypes(this._subscriptionType,pc);for(const mc of this._directives)if(isDirective(mc))for(const uf of mc.args)collectReferencedTypes(uf.type,pc);collectReferencedTypes(__Schema,pc),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(const mc of pc){if(mc==null)continue;const uf=mc.name;if(uf||devAssert(!1,"One of the provided types for building the Schema is missing a name."),this._typeMap[uf]!==void 0)throw new Error(`Schema must contain uniquely named types but contains multiple types named "${uf}".`);if(this._typeMap[uf]=mc,isInterfaceType(mc)){for(const df of mc.getInterfaces())if(isInterfaceType(df)){let ff=this._implementationsMap[df.name];ff===void 0&&(ff=this._implementationsMap[df.name]={objects:[],interfaces:[]}),ff.interfaces.push(mc)}}else if(isObjectType(mc)){for(const df of mc.getInterfaces())if(isInterfaceType(df)){let ff=this._implementationsMap[df.name];ff===void 0&&(ff=this._implementationsMap[df.name]={objects:[],interfaces:[]}),ff.objects.push(mc)}}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(Ai){switch(Ai){case OperationTypeNode.QUERY:return this.getQueryType();case OperationTypeNode.MUTATION:return this.getMutationType();case OperationTypeNode.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(Ai){return this.getTypeMap()[Ai]}getPossibleTypes(Ai){return isUnionType(Ai)?Ai.getTypes():this.getImplementations(Ai).objects}getImplementations(Ai){return this._implementationsMap[Ai.name]??{objects:[],interfaces:[]}}isSubType(Ai,bo){let Ra=this._subTypeMap[Ai.name];if(Ra===void 0){if(Ra=Object.create(null),isUnionType(Ai))for(const pc of Ai.getTypes())Ra[pc.name]=!0;else{const pc=this.getImplementations(Ai);for(const mc of pc.objects)Ra[mc.name]=!0;for(const mc of pc.interfaces)Ra[mc.name]=!0}this._subTypeMap[Ai.name]=Ra}return Ra[bo.name]!==void 0}getDirectives(){return this._directives}getDirective(Ai){return this.getDirectives().find(bo=>bo.name===Ai)}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:this.__validationErrors!==void 0}}}function collectReferencedTypes(vo,Ai){const bo=getNamedType(vo);if(!Ai.has(bo)){if(Ai.add(bo),isUnionType(bo))for(const Ra of bo.getTypes())collectReferencedTypes(Ra,Ai);else if(isObjectType(bo)||isInterfaceType(bo)){for(const Ra of bo.getInterfaces())collectReferencedTypes(Ra,Ai);for(const Ra of Object.values(bo.getFields())){collectReferencedTypes(Ra.type,Ai);for(const pc of Ra.args)collectReferencedTypes(pc.type,Ai)}}else if(isInputObjectType(bo))for(const Ra of Object.values(bo.getFields()))collectReferencedTypes(Ra.type,Ai)}return Ai}function validateSchema(vo){if(assertSchema(vo),vo.__validationErrors)return vo.__validationErrors;const Ai=new SchemaValidationContext(vo);validateRootTypes(Ai),validateDirectives(Ai),validateTypes(Ai);const bo=Ai.getErrors();return vo.__validationErrors=bo,bo}function assertValidSchema(vo){const Ai=validateSchema(vo);if(Ai.length!==0)throw new Error(Ai.map(bo=>bo.message).join(`
|
|
321
|
-
|
|
322
|
-
`))}class SchemaValidationContext{constructor(Ai){this._errors=[],this.schema=Ai}reportError(Ai,bo){const Ra=Array.isArray(bo)?bo.filter(Boolean):bo;this._errors.push(new GraphQLError(Ai,{nodes:Ra}))}getErrors(){return this._errors}}function validateRootTypes(vo){const Ai=vo.schema,bo=Ai.getQueryType();if(!bo)vo.reportError("Query root type must be provided.",Ai.astNode);else if(!isObjectType(bo)){var Ra;vo.reportError(`Query root type must be Object type, it cannot be ${inspect(bo)}.`,(Ra=getOperationTypeNode(Ai,OperationTypeNode.QUERY))!==null&&Ra!==void 0?Ra:bo.astNode)}const pc=Ai.getMutationType();if(pc&&!isObjectType(pc)){var mc;vo.reportError(`Mutation root type must be Object type if provided, it cannot be ${inspect(pc)}.`,(mc=getOperationTypeNode(Ai,OperationTypeNode.MUTATION))!==null&&mc!==void 0?mc:pc.astNode)}const uf=Ai.getSubscriptionType();if(uf&&!isObjectType(uf)){var df;vo.reportError(`Subscription root type must be Object type if provided, it cannot be ${inspect(uf)}.`,(df=getOperationTypeNode(Ai,OperationTypeNode.SUBSCRIPTION))!==null&&df!==void 0?df:uf.astNode)}}function getOperationTypeNode(vo,Ai){var bo;return(bo=[vo.astNode,...vo.extensionASTNodes].flatMap(Ra=>{var pc;return(pc=Ra==null?void 0:Ra.operationTypes)!==null&&pc!==void 0?pc:[]}).find(Ra=>Ra.operation===Ai))===null||bo===void 0?void 0:bo.type}function validateDirectives(vo){for(const bo of vo.schema.getDirectives()){if(!isDirective(bo)){vo.reportError(`Expected directive but got: ${inspect(bo)}.`,bo==null?void 0:bo.astNode);continue}validateName(vo,bo),bo.locations.length===0&&vo.reportError(`Directive @${bo.name} must include 1 or more locations.`,bo.astNode);for(const Ra of bo.args)if(validateName(vo,Ra),isInputType(Ra.type)||vo.reportError(`The type of @${bo.name}(${Ra.name}:) must be Input Type but got: ${inspect(Ra.type)}.`,Ra.astNode),isRequiredArgument(Ra)&&Ra.deprecationReason!=null){var Ai;vo.reportError(`Required argument @${bo.name}(${Ra.name}:) cannot be deprecated.`,[getDeprecatedDirectiveNode(Ra.astNode),(Ai=Ra.astNode)===null||Ai===void 0?void 0:Ai.type])}}}function validateName(vo,Ai){Ai.name.startsWith("__")&&vo.reportError(`Name "${Ai.name}" must not begin with "__", which is reserved by GraphQL introspection.`,Ai.astNode)}function validateTypes(vo){const Ai=createInputObjectCircularRefsValidator(vo),bo=vo.schema.getTypeMap();for(const Ra of Object.values(bo)){if(!isNamedType(Ra)){vo.reportError(`Expected GraphQL named type but got: ${inspect(Ra)}.`,Ra.astNode);continue}isIntrospectionType(Ra)||validateName(vo,Ra),isObjectType(Ra)||isInterfaceType(Ra)?(validateFields(vo,Ra),validateInterfaces(vo,Ra)):isUnionType(Ra)?validateUnionMembers(vo,Ra):isEnumType(Ra)?validateEnumValues(vo,Ra):isInputObjectType(Ra)&&(validateInputFields(vo,Ra),Ai(Ra))}}function validateFields(vo,Ai){const bo=Object.values(Ai.getFields());bo.length===0&&vo.reportError(`Type ${Ai.name} must define one or more fields.`,[Ai.astNode,...Ai.extensionASTNodes]);for(const uf of bo){if(validateName(vo,uf),!isOutputType(uf.type)){var Ra;vo.reportError(`The type of ${Ai.name}.${uf.name} must be Output Type but got: ${inspect(uf.type)}.`,(Ra=uf.astNode)===null||Ra===void 0?void 0:Ra.type)}for(const df of uf.args){const ff=df.name;if(validateName(vo,df),!isInputType(df.type)){var pc;vo.reportError(`The type of ${Ai.name}.${uf.name}(${ff}:) must be Input Type but got: ${inspect(df.type)}.`,(pc=df.astNode)===null||pc===void 0?void 0:pc.type)}if(isRequiredArgument(df)&&df.deprecationReason!=null){var mc;vo.reportError(`Required argument ${Ai.name}.${uf.name}(${ff}:) cannot be deprecated.`,[getDeprecatedDirectiveNode(df.astNode),(mc=df.astNode)===null||mc===void 0?void 0:mc.type])}}}}function validateInterfaces(vo,Ai){const bo=Object.create(null);for(const Ra of Ai.getInterfaces()){if(!isInterfaceType(Ra)){vo.reportError(`Type ${inspect(Ai)} must only implement Interface types, it cannot implement ${inspect(Ra)}.`,getAllImplementsInterfaceNodes(Ai,Ra));continue}if(Ai===Ra){vo.reportError(`Type ${Ai.name} cannot implement itself because it would create a circular reference.`,getAllImplementsInterfaceNodes(Ai,Ra));continue}if(bo[Ra.name]){vo.reportError(`Type ${Ai.name} can only implement ${Ra.name} once.`,getAllImplementsInterfaceNodes(Ai,Ra));continue}bo[Ra.name]=!0,validateTypeImplementsAncestors(vo,Ai,Ra),validateTypeImplementsInterface(vo,Ai,Ra)}}function validateTypeImplementsInterface(vo,Ai,bo){const Ra=Ai.getFields();for(const ff of Object.values(bo.getFields())){const hf=ff.name,pf=Ra[hf];if(!pf){vo.reportError(`Interface field ${bo.name}.${hf} expected but ${Ai.name} does not provide it.`,[ff.astNode,Ai.astNode,...Ai.extensionASTNodes]);continue}if(!isTypeSubTypeOf(vo.schema,pf.type,ff.type)){var pc,mc;vo.reportError(`Interface field ${bo.name}.${hf} expects type ${inspect(ff.type)} but ${Ai.name}.${hf} is type ${inspect(pf.type)}.`,[(pc=ff.astNode)===null||pc===void 0?void 0:pc.type,(mc=pf.astNode)===null||mc===void 0?void 0:mc.type])}for(const mf of ff.args){const gf=mf.name,yf=pf.args.find(vf=>vf.name===gf);if(!yf){vo.reportError(`Interface field argument ${bo.name}.${hf}(${gf}:) expected but ${Ai.name}.${hf} does not provide it.`,[mf.astNode,pf.astNode]);continue}if(!isEqualType(mf.type,yf.type)){var uf,df;vo.reportError(`Interface field argument ${bo.name}.${hf}(${gf}:) expects type ${inspect(mf.type)} but ${Ai.name}.${hf}(${gf}:) is type ${inspect(yf.type)}.`,[(uf=mf.astNode)===null||uf===void 0?void 0:uf.type,(df=yf.astNode)===null||df===void 0?void 0:df.type])}}for(const mf of pf.args){const gf=mf.name;!ff.args.find(yf=>yf.name===gf)&&isRequiredArgument(mf)&&vo.reportError(`Object field ${Ai.name}.${hf} includes required argument ${gf} that is missing from the Interface field ${bo.name}.${hf}.`,[mf.astNode,ff.astNode])}}}function validateTypeImplementsAncestors(vo,Ai,bo){const Ra=Ai.getInterfaces();for(const pc of bo.getInterfaces())Ra.includes(pc)||vo.reportError(pc===Ai?`Type ${Ai.name} cannot implement ${bo.name} because it would create a circular reference.`:`Type ${Ai.name} must implement ${pc.name} because it is implemented by ${bo.name}.`,[...getAllImplementsInterfaceNodes(bo,pc),...getAllImplementsInterfaceNodes(Ai,bo)])}function validateUnionMembers(vo,Ai){const bo=Ai.getTypes();bo.length===0&&vo.reportError(`Union type ${Ai.name} must define one or more member types.`,[Ai.astNode,...Ai.extensionASTNodes]);const Ra=Object.create(null);for(const pc of bo){if(Ra[pc.name]){vo.reportError(`Union type ${Ai.name} can only include type ${pc.name} once.`,getUnionMemberTypeNodes(Ai,pc.name));continue}Ra[pc.name]=!0,isObjectType(pc)||vo.reportError(`Union type ${Ai.name} can only include Object types, it cannot include ${inspect(pc)}.`,getUnionMemberTypeNodes(Ai,String(pc)))}}function validateEnumValues(vo,Ai){const bo=Ai.getValues();bo.length===0&&vo.reportError(`Enum type ${Ai.name} must define one or more values.`,[Ai.astNode,...Ai.extensionASTNodes]);for(const Ra of bo)validateName(vo,Ra)}function validateInputFields(vo,Ai){const bo=Object.values(Ai.getFields());bo.length===0&&vo.reportError(`Input Object type ${Ai.name} must define one or more fields.`,[Ai.astNode,...Ai.extensionASTNodes]);for(const mc of bo){if(validateName(vo,mc),!isInputType(mc.type)){var Ra;vo.reportError(`The type of ${Ai.name}.${mc.name} must be Input Type but got: ${inspect(mc.type)}.`,(Ra=mc.astNode)===null||Ra===void 0?void 0:Ra.type)}if(isRequiredInputField(mc)&&mc.deprecationReason!=null){var pc;vo.reportError(`Required input field ${Ai.name}.${mc.name} cannot be deprecated.`,[getDeprecatedDirectiveNode(mc.astNode),(pc=mc.astNode)===null||pc===void 0?void 0:pc.type])}Ai.isOneOf&&validateOneOfInputObjectField(Ai,mc,vo)}}function validateOneOfInputObjectField(vo,Ai,bo){if(isNonNullType(Ai.type)){var Ra;bo.reportError(`OneOf input field ${vo.name}.${Ai.name} must be nullable.`,(Ra=Ai.astNode)===null||Ra===void 0?void 0:Ra.type)}Ai.defaultValue!==void 0&&bo.reportError(`OneOf input field ${vo.name}.${Ai.name} cannot have a default value.`,Ai.astNode)}function createInputObjectCircularRefsValidator(vo){const Ai=Object.create(null),bo=[],Ra=Object.create(null);return pc;function pc(mc){if(Ai[mc.name])return;Ai[mc.name]=!0,Ra[mc.name]=bo.length;const uf=Object.values(mc.getFields());for(const df of uf)if(isNonNullType(df.type)&&isInputObjectType(df.type.ofType)){const ff=df.type.ofType,hf=Ra[ff.name];if(bo.push(df),hf===void 0)pc(ff);else{const pf=bo.slice(hf),mf=pf.map(gf=>gf.name).join(".");vo.reportError(`Cannot reference Input Object "${ff.name}" within itself through a series of non-null fields: "${mf}".`,pf.map(gf=>gf.astNode))}bo.pop()}Ra[mc.name]=void 0}}function getAllImplementsInterfaceNodes(vo,Ai){const{astNode:bo,extensionASTNodes:Ra}=vo;return(bo!=null?[bo,...Ra]:Ra).flatMap(pc=>{var mc;return(mc=pc.interfaces)!==null&&mc!==void 0?mc:[]}).filter(pc=>pc.name.value===Ai.name)}function getUnionMemberTypeNodes(vo,Ai){const{astNode:bo,extensionASTNodes:Ra}=vo;return(bo!=null?[bo,...Ra]:Ra).flatMap(pc=>{var mc;return(mc=pc.types)!==null&&mc!==void 0?mc:[]}).filter(pc=>pc.name.value===Ai)}function getDeprecatedDirectiveNode(vo){var Ai;return vo==null||(Ai=vo.directives)===null||Ai===void 0?void 0:Ai.find(bo=>bo.name.value===GraphQLDeprecatedDirective.name)}function typeFromAST(vo,Ai){switch(Ai.kind){case Kind.LIST_TYPE:{const bo=typeFromAST(vo,Ai.type);return bo&&new GraphQLList(bo)}case Kind.NON_NULL_TYPE:{const bo=typeFromAST(vo,Ai.type);return bo&&new GraphQLNonNull(bo)}case Kind.NAMED_TYPE:return vo.getType(Ai.name.value)}}class TypeInfo{constructor(Ai,bo,Ra){this._schema=Ai,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=Ra??getFieldDef$1,bo&&(isInputType(bo)&&this._inputTypeStack.push(bo),isCompositeType(bo)&&this._parentTypeStack.push(bo),isOutputType(bo)&&this._typeStack.push(bo))}get[Symbol.toStringTag](){return"TypeInfo"}getType(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]}getParentType(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]}getInputType(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]}getParentInputType(){if(this._inputTypeStack.length>1)return this._inputTypeStack[this._inputTypeStack.length-2]}getFieldDef(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]}getDefaultValue(){if(this._defaultValueStack.length>0)return this._defaultValueStack[this._defaultValueStack.length-1]}getDirective(){return this._directive}getArgument(){return this._argument}getEnumValue(){return this._enumValue}enter(Ai){const bo=this._schema;switch(Ai.kind){case Kind.SELECTION_SET:{const pc=getNamedType(this.getType());this._parentTypeStack.push(isCompositeType(pc)?pc:void 0);break}case Kind.FIELD:{const pc=this.getParentType();let mc,uf;pc&&(mc=this._getFieldDef(bo,pc,Ai),mc&&(uf=mc.type)),this._fieldDefStack.push(mc),this._typeStack.push(isOutputType(uf)?uf:void 0);break}case Kind.DIRECTIVE:this._directive=bo.getDirective(Ai.name.value);break;case Kind.OPERATION_DEFINITION:{const pc=bo.getRootType(Ai.operation);this._typeStack.push(isObjectType(pc)?pc:void 0);break}case Kind.INLINE_FRAGMENT:case Kind.FRAGMENT_DEFINITION:{const pc=Ai.typeCondition,mc=pc?typeFromAST(bo,pc):getNamedType(this.getType());this._typeStack.push(isOutputType(mc)?mc:void 0);break}case Kind.VARIABLE_DEFINITION:{const pc=typeFromAST(bo,Ai.type);this._inputTypeStack.push(isInputType(pc)?pc:void 0);break}case Kind.ARGUMENT:{var Ra;let pc,mc;const uf=(Ra=this.getDirective())!==null&&Ra!==void 0?Ra:this.getFieldDef();uf&&(pc=uf.args.find(df=>df.name===Ai.name.value),pc&&(mc=pc.type)),this._argument=pc,this._defaultValueStack.push(pc?pc.defaultValue:void 0),this._inputTypeStack.push(isInputType(mc)?mc:void 0);break}case Kind.LIST:{const pc=getNullableType(this.getInputType()),mc=isListType(pc)?pc.ofType:pc;this._defaultValueStack.push(void 0),this._inputTypeStack.push(isInputType(mc)?mc:void 0);break}case Kind.OBJECT_FIELD:{const pc=getNamedType(this.getInputType());let mc,uf;isInputObjectType(pc)&&(uf=pc.getFields()[Ai.name.value],uf&&(mc=uf.type)),this._defaultValueStack.push(uf?uf.defaultValue:void 0),this._inputTypeStack.push(isInputType(mc)?mc:void 0);break}case Kind.ENUM:{const pc=getNamedType(this.getInputType());let mc;isEnumType(pc)&&(mc=pc.getValue(Ai.value)),this._enumValue=mc;break}}}leave(Ai){switch(Ai.kind){case Kind.SELECTION_SET:this._parentTypeStack.pop();break;case Kind.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case Kind.DIRECTIVE:this._directive=null;break;case Kind.OPERATION_DEFINITION:case Kind.INLINE_FRAGMENT:case Kind.FRAGMENT_DEFINITION:this._typeStack.pop();break;case Kind.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case Kind.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case Kind.LIST:case Kind.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case Kind.ENUM:this._enumValue=null;break}}}function getFieldDef$1(vo,Ai,bo){const Ra=bo.name.value;if(Ra===SchemaMetaFieldDef.name&&vo.getQueryType()===Ai)return SchemaMetaFieldDef;if(Ra===TypeMetaFieldDef.name&&vo.getQueryType()===Ai)return TypeMetaFieldDef;if(Ra===TypeNameMetaFieldDef.name&&isCompositeType(Ai))return TypeNameMetaFieldDef;if(isObjectType(Ai)||isInterfaceType(Ai))return Ai.getFields()[Ra]}function visitWithTypeInfo(vo,Ai){return{enter(...bo){const Ra=bo[0];vo.enter(Ra);const pc=getEnterLeaveForKind(Ai,Ra.kind).enter;if(pc){const mc=pc.apply(Ai,bo);return mc!==void 0&&(vo.leave(Ra),isNode(mc)&&vo.enter(mc)),mc}},leave(...bo){const Ra=bo[0],pc=getEnterLeaveForKind(Ai,Ra.kind).leave;let mc;return pc&&(mc=pc.apply(Ai,bo)),vo.leave(Ra),mc}}}function isExecutableDefinitionNode(vo){return vo.kind===Kind.OPERATION_DEFINITION||vo.kind===Kind.FRAGMENT_DEFINITION}function isTypeSystemDefinitionNode(vo){return vo.kind===Kind.SCHEMA_DEFINITION||isTypeDefinitionNode(vo)||vo.kind===Kind.DIRECTIVE_DEFINITION}function isTypeDefinitionNode(vo){return vo.kind===Kind.SCALAR_TYPE_DEFINITION||vo.kind===Kind.OBJECT_TYPE_DEFINITION||vo.kind===Kind.INTERFACE_TYPE_DEFINITION||vo.kind===Kind.UNION_TYPE_DEFINITION||vo.kind===Kind.ENUM_TYPE_DEFINITION||vo.kind===Kind.INPUT_OBJECT_TYPE_DEFINITION}function isTypeSystemExtensionNode(vo){return vo.kind===Kind.SCHEMA_EXTENSION||isTypeExtensionNode(vo)}function isTypeExtensionNode(vo){return vo.kind===Kind.SCALAR_TYPE_EXTENSION||vo.kind===Kind.OBJECT_TYPE_EXTENSION||vo.kind===Kind.INTERFACE_TYPE_EXTENSION||vo.kind===Kind.UNION_TYPE_EXTENSION||vo.kind===Kind.ENUM_TYPE_EXTENSION||vo.kind===Kind.INPUT_OBJECT_TYPE_EXTENSION}function ExecutableDefinitionsRule(vo){return{Document(Ai){for(const bo of Ai.definitions)if(!isExecutableDefinitionNode(bo)){const Ra=bo.kind===Kind.SCHEMA_DEFINITION||bo.kind===Kind.SCHEMA_EXTENSION?"schema":'"'+bo.name.value+'"';vo.reportError(new GraphQLError(`The ${Ra} definition is not executable.`,{nodes:bo}))}return!1}}}function FieldsOnCorrectTypeRule(vo){return{Field(Ai){const bo=vo.getParentType();if(bo&&!vo.getFieldDef()){const Ra=vo.getSchema(),pc=Ai.name.value;let mc=didYouMean("to use an inline fragment on",getSuggestedTypeNames(Ra,bo,pc));mc===""&&(mc=didYouMean(getSuggestedFieldNames(bo,pc))),vo.reportError(new GraphQLError(`Cannot query field "${pc}" on type "${bo.name}".`+mc,{nodes:Ai}))}}}}function getSuggestedTypeNames(vo,Ai,bo){if(!isAbstractType(Ai))return[];const Ra=new Set,pc=Object.create(null);for(const uf of vo.getPossibleTypes(Ai))if(uf.getFields()[bo]){Ra.add(uf),pc[uf.name]=1;for(const df of uf.getInterfaces()){var mc;df.getFields()[bo]&&(Ra.add(df),pc[df.name]=((mc=pc[df.name])!==null&&mc!==void 0?mc:0)+1)}}return[...Ra].sort((uf,df)=>{const ff=pc[df.name]-pc[uf.name];return ff!==0?ff:isInterfaceType(uf)&&vo.isSubType(uf,df)?-1:isInterfaceType(df)&&vo.isSubType(df,uf)?1:naturalCompare(uf.name,df.name)}).map(uf=>uf.name)}function getSuggestedFieldNames(vo,Ai){if(isObjectType(vo)||isInterfaceType(vo)){const bo=Object.keys(vo.getFields());return suggestionList(Ai,bo)}return[]}function FragmentsOnCompositeTypesRule(vo){return{InlineFragment(Ai){const bo=Ai.typeCondition;if(bo){const Ra=typeFromAST(vo.getSchema(),bo);if(Ra&&!isCompositeType(Ra)){const pc=print(bo);vo.reportError(new GraphQLError(`Fragment cannot condition on non composite type "${pc}".`,{nodes:bo}))}}},FragmentDefinition(Ai){const bo=typeFromAST(vo.getSchema(),Ai.typeCondition);if(bo&&!isCompositeType(bo)){const Ra=print(Ai.typeCondition);vo.reportError(new GraphQLError(`Fragment "${Ai.name.value}" cannot condition on non composite type "${Ra}".`,{nodes:Ai.typeCondition}))}}}}function KnownArgumentNamesRule(vo){return{...KnownArgumentNamesOnDirectivesRule(vo),Argument(Ai){const bo=vo.getArgument(),Ra=vo.getFieldDef(),pc=vo.getParentType();if(!bo&&Ra&&pc){const mc=Ai.name.value,uf=Ra.args.map(ff=>ff.name),df=suggestionList(mc,uf);vo.reportError(new GraphQLError(`Unknown argument "${mc}" on field "${pc.name}.${Ra.name}".`+didYouMean(df),{nodes:Ai}))}}}}function KnownArgumentNamesOnDirectivesRule(vo){const Ai=Object.create(null),bo=vo.getSchema(),Ra=bo?bo.getDirectives():specifiedDirectives;for(const uf of Ra)Ai[uf.name]=uf.args.map(df=>df.name);const pc=vo.getDocument().definitions;for(const uf of pc)if(uf.kind===Kind.DIRECTIVE_DEFINITION){var mc;const df=(mc=uf.arguments)!==null&&mc!==void 0?mc:[];Ai[uf.name.value]=df.map(ff=>ff.name.value)}return{Directive(uf){const df=uf.name.value,ff=Ai[df];if(uf.arguments&&ff)for(const hf of uf.arguments){const pf=hf.name.value;if(!ff.includes(pf)){const mf=suggestionList(pf,ff);vo.reportError(new GraphQLError(`Unknown argument "${pf}" on directive "@${df}".`+didYouMean(mf),{nodes:hf}))}}return!1}}}function KnownDirectivesRule(vo){const Ai=Object.create(null),bo=vo.getSchema(),Ra=bo?bo.getDirectives():specifiedDirectives;for(const mc of Ra)Ai[mc.name]=mc.locations;const pc=vo.getDocument().definitions;for(const mc of pc)mc.kind===Kind.DIRECTIVE_DEFINITION&&(Ai[mc.name.value]=mc.locations.map(uf=>uf.value));return{Directive(mc,uf,df,ff,hf){const pf=mc.name.value,mf=Ai[pf];if(!mf){vo.reportError(new GraphQLError(`Unknown directive "@${pf}".`,{nodes:mc}));return}const gf=getDirectiveLocationForASTPath(hf);gf&&!mf.includes(gf)&&vo.reportError(new GraphQLError(`Directive "@${pf}" may not be used on ${gf}.`,{nodes:mc}))}}}function getDirectiveLocationForASTPath(vo){const Ai=vo[vo.length-1];switch("kind"in Ai||invariant$1(),Ai.kind){case Kind.OPERATION_DEFINITION:return getDirectiveLocationForOperation(Ai.operation);case Kind.FIELD:return DirectiveLocation.FIELD;case Kind.FRAGMENT_SPREAD:return DirectiveLocation.FRAGMENT_SPREAD;case Kind.INLINE_FRAGMENT:return DirectiveLocation.INLINE_FRAGMENT;case Kind.FRAGMENT_DEFINITION:return DirectiveLocation.FRAGMENT_DEFINITION;case Kind.VARIABLE_DEFINITION:return DirectiveLocation.VARIABLE_DEFINITION;case Kind.SCHEMA_DEFINITION:case Kind.SCHEMA_EXTENSION:return DirectiveLocation.SCHEMA;case Kind.SCALAR_TYPE_DEFINITION:case Kind.SCALAR_TYPE_EXTENSION:return DirectiveLocation.SCALAR;case Kind.OBJECT_TYPE_DEFINITION:case Kind.OBJECT_TYPE_EXTENSION:return DirectiveLocation.OBJECT;case Kind.FIELD_DEFINITION:return DirectiveLocation.FIELD_DEFINITION;case Kind.INTERFACE_TYPE_DEFINITION:case Kind.INTERFACE_TYPE_EXTENSION:return DirectiveLocation.INTERFACE;case Kind.UNION_TYPE_DEFINITION:case Kind.UNION_TYPE_EXTENSION:return DirectiveLocation.UNION;case Kind.ENUM_TYPE_DEFINITION:case Kind.ENUM_TYPE_EXTENSION:return DirectiveLocation.ENUM;case Kind.ENUM_VALUE_DEFINITION:return DirectiveLocation.ENUM_VALUE;case Kind.INPUT_OBJECT_TYPE_DEFINITION:case Kind.INPUT_OBJECT_TYPE_EXTENSION:return DirectiveLocation.INPUT_OBJECT;case Kind.INPUT_VALUE_DEFINITION:{const bo=vo[vo.length-3];return"kind"in bo||invariant$1(),bo.kind===Kind.INPUT_OBJECT_TYPE_DEFINITION?DirectiveLocation.INPUT_FIELD_DEFINITION:DirectiveLocation.ARGUMENT_DEFINITION}default:invariant$1(!1,"Unexpected kind: "+inspect(Ai.kind))}}function getDirectiveLocationForOperation(vo){switch(vo){case OperationTypeNode.QUERY:return DirectiveLocation.QUERY;case OperationTypeNode.MUTATION:return DirectiveLocation.MUTATION;case OperationTypeNode.SUBSCRIPTION:return DirectiveLocation.SUBSCRIPTION}}function KnownFragmentNamesRule(vo){return{FragmentSpread(Ai){const bo=Ai.name.value;vo.getFragment(bo)||vo.reportError(new GraphQLError(`Unknown fragment "${bo}".`,{nodes:Ai.name}))}}}function KnownTypeNamesRule(vo){const Ai=vo.getSchema(),bo=Ai?Ai.getTypeMap():Object.create(null),Ra=Object.create(null);for(const mc of vo.getDocument().definitions)isTypeDefinitionNode(mc)&&(Ra[mc.name.value]=!0);const pc=[...Object.keys(bo),...Object.keys(Ra)];return{NamedType(mc,uf,df,ff,hf){const pf=mc.name.value;if(!bo[pf]&&!Ra[pf]){var mf;const gf=(mf=hf[2])!==null&&mf!==void 0?mf:df,yf=gf!=null&&isSDLNode(gf);if(yf&&standardTypeNames.includes(pf))return;const vf=suggestionList(pf,yf?standardTypeNames.concat(pc):pc);vo.reportError(new GraphQLError(`Unknown type "${pf}".`+didYouMean(vf),{nodes:mc}))}}}}const standardTypeNames=[...specifiedScalarTypes,...introspectionTypes].map(vo=>vo.name);function isSDLNode(vo){return"kind"in vo&&(isTypeSystemDefinitionNode(vo)||isTypeSystemExtensionNode(vo))}function LoneAnonymousOperationRule(vo){let Ai=0;return{Document(bo){Ai=bo.definitions.filter(Ra=>Ra.kind===Kind.OPERATION_DEFINITION).length},OperationDefinition(bo){!bo.name&&Ai>1&&vo.reportError(new GraphQLError("This anonymous operation must be the only defined operation.",{nodes:bo}))}}}function LoneSchemaDefinitionRule(vo){var Ai,bo,Ra;const pc=vo.getSchema(),mc=(Ai=(bo=(Ra=pc==null?void 0:pc.astNode)!==null&&Ra!==void 0?Ra:pc==null?void 0:pc.getQueryType())!==null&&bo!==void 0?bo:pc==null?void 0:pc.getMutationType())!==null&&Ai!==void 0?Ai:pc==null?void 0:pc.getSubscriptionType();let uf=0;return{SchemaDefinition(df){if(mc){vo.reportError(new GraphQLError("Cannot define a new schema within a schema extension.",{nodes:df}));return}uf>0&&vo.reportError(new GraphQLError("Must provide only one schema definition.",{nodes:df})),++uf}}}const MAX_LISTS_DEPTH=3;function MaxIntrospectionDepthRule(vo){function Ai(bo,Ra=Object.create(null),pc=0){if(bo.kind===Kind.FRAGMENT_SPREAD){const mc=bo.name.value;if(Ra[mc]===!0)return!1;const uf=vo.getFragment(mc);if(!uf)return!1;try{return Ra[mc]=!0,Ai(uf,Ra,pc)}finally{Ra[mc]=void 0}}if(bo.kind===Kind.FIELD&&(bo.name.value==="fields"||bo.name.value==="interfaces"||bo.name.value==="possibleTypes"||bo.name.value==="inputFields")&&(pc++,pc>=MAX_LISTS_DEPTH))return!0;if("selectionSet"in bo&&bo.selectionSet){for(const mc of bo.selectionSet.selections)if(Ai(mc,Ra,pc))return!0}return!1}return{Field(bo){if((bo.name.value==="__schema"||bo.name.value==="__type")&&Ai(bo))return vo.reportError(new GraphQLError("Maximum introspection depth exceeded",{nodes:[bo]})),!1}}}function NoFragmentCyclesRule(vo){const Ai=Object.create(null),bo=[],Ra=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(mc){return pc(mc),!1}};function pc(mc){if(Ai[mc.name.value])return;const uf=mc.name.value;Ai[uf]=!0;const df=vo.getFragmentSpreads(mc.selectionSet);if(df.length!==0){Ra[uf]=bo.length;for(const ff of df){const hf=ff.name.value,pf=Ra[hf];if(bo.push(ff),pf===void 0){const mf=vo.getFragment(hf);mf&&pc(mf)}else{const mf=bo.slice(pf),gf=mf.slice(0,-1).map(yf=>'"'+yf.name.value+'"').join(", ");vo.reportError(new GraphQLError(`Cannot spread fragment "${hf}" within itself`+(gf!==""?` via ${gf}.`:"."),{nodes:mf}))}bo.pop()}Ra[uf]=void 0}}}function NoUndefinedVariablesRule(vo){let Ai=Object.create(null);return{OperationDefinition:{enter(){Ai=Object.create(null)},leave(bo){const Ra=vo.getRecursiveVariableUsages(bo);for(const{node:pc}of Ra){const mc=pc.name.value;Ai[mc]!==!0&&vo.reportError(new GraphQLError(bo.name?`Variable "$${mc}" is not defined by operation "${bo.name.value}".`:`Variable "$${mc}" is not defined.`,{nodes:[pc,bo]}))}}},VariableDefinition(bo){Ai[bo.variable.name.value]=!0}}}function NoUnusedFragmentsRule(vo){const Ai=[],bo=[];return{OperationDefinition(Ra){return Ai.push(Ra),!1},FragmentDefinition(Ra){return bo.push(Ra),!1},Document:{leave(){const Ra=Object.create(null);for(const pc of Ai)for(const mc of vo.getRecursivelyReferencedFragments(pc))Ra[mc.name.value]=!0;for(const pc of bo){const mc=pc.name.value;Ra[mc]!==!0&&vo.reportError(new GraphQLError(`Fragment "${mc}" is never used.`,{nodes:pc}))}}}}}function NoUnusedVariablesRule(vo){let Ai=[];return{OperationDefinition:{enter(){Ai=[]},leave(bo){const Ra=Object.create(null),pc=vo.getRecursiveVariableUsages(bo);for(const{node:mc}of pc)Ra[mc.name.value]=!0;for(const mc of Ai){const uf=mc.variable.name.value;Ra[uf]!==!0&&vo.reportError(new GraphQLError(bo.name?`Variable "$${uf}" is never used in operation "${bo.name.value}".`:`Variable "$${uf}" is never used.`,{nodes:mc}))}}},VariableDefinition(bo){Ai.push(bo)}}}function sortValueNode(vo){switch(vo.kind){case Kind.OBJECT:return{...vo,fields:sortFields(vo.fields)};case Kind.LIST:return{...vo,values:vo.values.map(sortValueNode)};case Kind.INT:case Kind.FLOAT:case Kind.STRING:case Kind.BOOLEAN:case Kind.NULL:case Kind.ENUM:case Kind.VARIABLE:return vo}}function sortFields(vo){return vo.map(Ai=>({...Ai,value:sortValueNode(Ai.value)})).sort((Ai,bo)=>naturalCompare(Ai.name.value,bo.name.value))}function reasonMessage(vo){return Array.isArray(vo)?vo.map(([Ai,bo])=>`subfields "${Ai}" conflict because `+reasonMessage(bo)).join(" and "):vo}function OverlappingFieldsCanBeMergedRule(vo){const Ai=new OrderedPairSet,bo=new PairSet,Ra=new Map;return{SelectionSet(pc){const mc=findConflictsWithinSelectionSet(vo,Ra,Ai,bo,vo.getParentType(),pc);for(const[[uf,df],ff,hf]of mc){const pf=reasonMessage(df);vo.reportError(new GraphQLError(`Fields "${uf}" conflict because ${pf}. Use different aliases on the fields to fetch both if this was intentional.`,{nodes:ff.concat(hf)}))}}}}function findConflictsWithinSelectionSet(vo,Ai,bo,Ra,pc,mc){const uf=[],[df,ff]=getFieldsAndFragmentNames(vo,Ai,pc,mc);if(collectConflictsWithin(vo,uf,Ai,bo,Ra,df),ff.length!==0)for(let hf=0;hf<ff.length;hf++){collectConflictsBetweenFieldsAndFragment(vo,uf,Ai,bo,Ra,!1,df,ff[hf]);for(let pf=hf+1;pf<ff.length;pf++)collectConflictsBetweenFragments(vo,uf,Ai,bo,Ra,!1,ff[hf],ff[pf])}return uf}function collectConflictsBetweenFieldsAndFragment(vo,Ai,bo,Ra,pc,mc,uf,df){if(Ra.has(uf,df,mc))return;Ra.add(uf,df,mc);const ff=vo.getFragment(df);if(!ff)return;const[hf,pf]=getReferencedFieldsAndFragmentNames(vo,bo,ff);if(uf!==hf){collectConflictsBetween(vo,Ai,bo,Ra,pc,mc,uf,hf);for(const mf of pf)collectConflictsBetweenFieldsAndFragment(vo,Ai,bo,Ra,pc,mc,uf,mf)}}function collectConflictsBetweenFragments(vo,Ai,bo,Ra,pc,mc,uf,df){if(uf===df||pc.has(uf,df,mc))return;pc.add(uf,df,mc);const ff=vo.getFragment(uf),hf=vo.getFragment(df);if(!ff||!hf)return;const[pf,mf]=getReferencedFieldsAndFragmentNames(vo,bo,ff),[gf,yf]=getReferencedFieldsAndFragmentNames(vo,bo,hf);collectConflictsBetween(vo,Ai,bo,Ra,pc,mc,pf,gf);for(const vf of yf)collectConflictsBetweenFragments(vo,Ai,bo,Ra,pc,mc,uf,vf);for(const vf of mf)collectConflictsBetweenFragments(vo,Ai,bo,Ra,pc,mc,vf,df)}function findConflictsBetweenSubSelectionSets(vo,Ai,bo,Ra,pc,mc,uf,df,ff){const hf=[],[pf,mf]=getFieldsAndFragmentNames(vo,Ai,mc,uf),[gf,yf]=getFieldsAndFragmentNames(vo,Ai,df,ff);collectConflictsBetween(vo,hf,Ai,bo,Ra,pc,pf,gf);for(const vf of yf)collectConflictsBetweenFieldsAndFragment(vo,hf,Ai,bo,Ra,pc,pf,vf);for(const vf of mf)collectConflictsBetweenFieldsAndFragment(vo,hf,Ai,bo,Ra,pc,gf,vf);for(const vf of mf)for(const bf of yf)collectConflictsBetweenFragments(vo,hf,Ai,bo,Ra,pc,vf,bf);return hf}function collectConflictsWithin(vo,Ai,bo,Ra,pc,mc){for(const[uf,df]of Object.entries(mc))if(df.length>1)for(let ff=0;ff<df.length;ff++)for(let hf=ff+1;hf<df.length;hf++){const pf=findConflict(vo,bo,Ra,pc,!1,uf,df[ff],df[hf]);pf&&Ai.push(pf)}}function collectConflictsBetween(vo,Ai,bo,Ra,pc,mc,uf,df){for(const[ff,hf]of Object.entries(uf)){const pf=df[ff];if(pf)for(const mf of hf)for(const gf of pf){const yf=findConflict(vo,bo,Ra,pc,mc,ff,mf,gf);yf&&Ai.push(yf)}}}function findConflict(vo,Ai,bo,Ra,pc,mc,uf,df){const[ff,hf,pf]=uf,[mf,gf,yf]=df,vf=pc||ff!==mf&&isObjectType(ff)&&isObjectType(mf);if(!vf){const If=hf.name.value,l1=gf.name.value;if(If!==l1)return[[mc,`"${If}" and "${l1}" are different fields`],[hf],[gf]];if(!sameArguments(hf,gf))return[[mc,"they have differing arguments"],[hf],[gf]]}const bf=pf==null?void 0:pf.type,Sf=yf==null?void 0:yf.type;if(bf&&Sf&&doTypesConflict(bf,Sf))return[[mc,`they return conflicting types "${inspect(bf)}" and "${inspect(Sf)}"`],[hf],[gf]];const xf=hf.selectionSet,wf=gf.selectionSet;if(xf&&wf){const If=findConflictsBetweenSubSelectionSets(vo,Ai,bo,Ra,vf,getNamedType(bf),xf,getNamedType(Sf),wf);return subfieldConflicts(If,mc,hf,gf)}}function sameArguments(vo,Ai){const bo=vo.arguments,Ra=Ai.arguments;if(bo===void 0||bo.length===0)return Ra===void 0||Ra.length===0;if(Ra===void 0||Ra.length===0||bo.length!==Ra.length)return!1;const pc=new Map(Ra.map(({name:mc,value:uf})=>[mc.value,uf]));return bo.every(mc=>{const uf=mc.value,df=pc.get(mc.name.value);return df===void 0?!1:stringifyValue(uf)===stringifyValue(df)})}function stringifyValue(vo){return print(sortValueNode(vo))}function doTypesConflict(vo,Ai){return isListType(vo)?isListType(Ai)?doTypesConflict(vo.ofType,Ai.ofType):!0:isListType(Ai)?!0:isNonNullType(vo)?isNonNullType(Ai)?doTypesConflict(vo.ofType,Ai.ofType):!0:isNonNullType(Ai)?!0:isLeafType(vo)||isLeafType(Ai)?vo!==Ai:!1}function getFieldsAndFragmentNames(vo,Ai,bo,Ra){const pc=Ai.get(Ra);if(pc)return pc;const mc=Object.create(null),uf=Object.create(null);_collectFieldsAndFragmentNames(vo,bo,Ra,mc,uf);const df=[mc,Object.keys(uf)];return Ai.set(Ra,df),df}function getReferencedFieldsAndFragmentNames(vo,Ai,bo){const Ra=Ai.get(bo.selectionSet);if(Ra)return Ra;const pc=typeFromAST(vo.getSchema(),bo.typeCondition);return getFieldsAndFragmentNames(vo,Ai,pc,bo.selectionSet)}function _collectFieldsAndFragmentNames(vo,Ai,bo,Ra,pc){for(const mc of bo.selections)switch(mc.kind){case Kind.FIELD:{const uf=mc.name.value;let df;(isObjectType(Ai)||isInterfaceType(Ai))&&(df=Ai.getFields()[uf]);const ff=mc.alias?mc.alias.value:uf;Ra[ff]||(Ra[ff]=[]),Ra[ff].push([Ai,mc,df]);break}case Kind.FRAGMENT_SPREAD:pc[mc.name.value]=!0;break;case Kind.INLINE_FRAGMENT:{const uf=mc.typeCondition,df=uf?typeFromAST(vo.getSchema(),uf):Ai;_collectFieldsAndFragmentNames(vo,df,mc.selectionSet,Ra,pc);break}}}function subfieldConflicts(vo,Ai,bo,Ra){if(vo.length>0)return[[Ai,vo.map(([pc])=>pc)],[bo,...vo.map(([,pc])=>pc).flat()],[Ra,...vo.map(([,,pc])=>pc).flat()]]}class OrderedPairSet{constructor(){this._data=new Map}has(Ai,bo,Ra){var pc;const mc=(pc=this._data.get(Ai))===null||pc===void 0?void 0:pc.get(bo);return mc===void 0?!1:Ra?!0:Ra===mc}add(Ai,bo,Ra){const pc=this._data.get(Ai);pc===void 0?this._data.set(Ai,new Map([[bo,Ra]])):pc.set(bo,Ra)}}class PairSet{constructor(){this._orderedPairSet=new OrderedPairSet}has(Ai,bo,Ra){return Ai<bo?this._orderedPairSet.has(Ai,bo,Ra):this._orderedPairSet.has(bo,Ai,Ra)}add(Ai,bo,Ra){Ai<bo?this._orderedPairSet.add(Ai,bo,Ra):this._orderedPairSet.add(bo,Ai,Ra)}}function PossibleFragmentSpreadsRule(vo){return{InlineFragment(Ai){const bo=vo.getType(),Ra=vo.getParentType();if(isCompositeType(bo)&&isCompositeType(Ra)&&!doTypesOverlap(vo.getSchema(),bo,Ra)){const pc=inspect(Ra),mc=inspect(bo);vo.reportError(new GraphQLError(`Fragment cannot be spread here as objects of type "${pc}" can never be of type "${mc}".`,{nodes:Ai}))}},FragmentSpread(Ai){const bo=Ai.name.value,Ra=getFragmentType(vo,bo),pc=vo.getParentType();if(Ra&&pc&&!doTypesOverlap(vo.getSchema(),Ra,pc)){const mc=inspect(pc),uf=inspect(Ra);vo.reportError(new GraphQLError(`Fragment "${bo}" cannot be spread here as objects of type "${mc}" can never be of type "${uf}".`,{nodes:Ai}))}}}}function getFragmentType(vo,Ai){const bo=vo.getFragment(Ai);if(bo){const Ra=typeFromAST(vo.getSchema(),bo.typeCondition);if(isCompositeType(Ra))return Ra}}function PossibleTypeExtensionsRule(vo){const Ai=vo.getSchema(),bo=Object.create(null);for(const pc of vo.getDocument().definitions)isTypeDefinitionNode(pc)&&(bo[pc.name.value]=pc);return{ScalarTypeExtension:Ra,ObjectTypeExtension:Ra,InterfaceTypeExtension:Ra,UnionTypeExtension:Ra,EnumTypeExtension:Ra,InputObjectTypeExtension:Ra};function Ra(pc){const mc=pc.name.value,uf=bo[mc],df=Ai==null?void 0:Ai.getType(mc);let ff;if(uf?ff=defKindToExtKind[uf.kind]:df&&(ff=typeToExtKind(df)),ff){if(ff!==pc.kind){const hf=extensionKindToTypeName(pc.kind);vo.reportError(new GraphQLError(`Cannot extend non-${hf} type "${mc}".`,{nodes:uf?[uf,pc]:pc}))}}else{const hf=Object.keys({...bo,...Ai==null?void 0:Ai.getTypeMap()}),pf=suggestionList(mc,hf);vo.reportError(new GraphQLError(`Cannot extend type "${mc}" because it is not defined.`+didYouMean(pf),{nodes:pc.name}))}}}const defKindToExtKind={[Kind.SCALAR_TYPE_DEFINITION]:Kind.SCALAR_TYPE_EXTENSION,[Kind.OBJECT_TYPE_DEFINITION]:Kind.OBJECT_TYPE_EXTENSION,[Kind.INTERFACE_TYPE_DEFINITION]:Kind.INTERFACE_TYPE_EXTENSION,[Kind.UNION_TYPE_DEFINITION]:Kind.UNION_TYPE_EXTENSION,[Kind.ENUM_TYPE_DEFINITION]:Kind.ENUM_TYPE_EXTENSION,[Kind.INPUT_OBJECT_TYPE_DEFINITION]:Kind.INPUT_OBJECT_TYPE_EXTENSION};function typeToExtKind(vo){if(isScalarType(vo))return Kind.SCALAR_TYPE_EXTENSION;if(isObjectType(vo))return Kind.OBJECT_TYPE_EXTENSION;if(isInterfaceType(vo))return Kind.INTERFACE_TYPE_EXTENSION;if(isUnionType(vo))return Kind.UNION_TYPE_EXTENSION;if(isEnumType(vo))return Kind.ENUM_TYPE_EXTENSION;if(isInputObjectType(vo))return Kind.INPUT_OBJECT_TYPE_EXTENSION;invariant$1(!1,"Unexpected type: "+inspect(vo))}function extensionKindToTypeName(vo){switch(vo){case Kind.SCALAR_TYPE_EXTENSION:return"scalar";case Kind.OBJECT_TYPE_EXTENSION:return"object";case Kind.INTERFACE_TYPE_EXTENSION:return"interface";case Kind.UNION_TYPE_EXTENSION:return"union";case Kind.ENUM_TYPE_EXTENSION:return"enum";case Kind.INPUT_OBJECT_TYPE_EXTENSION:return"input object";default:invariant$1(!1,"Unexpected kind: "+inspect(vo))}}function ProvidedRequiredArgumentsRule(vo){return{...ProvidedRequiredArgumentsOnDirectivesRule(vo),Field:{leave(Ai){var bo;const Ra=vo.getFieldDef();if(!Ra)return!1;const pc=new Set((bo=Ai.arguments)===null||bo===void 0?void 0:bo.map(mc=>mc.name.value));for(const mc of Ra.args)if(!pc.has(mc.name)&&isRequiredArgument(mc)){const uf=inspect(mc.type);vo.reportError(new GraphQLError(`Field "${Ra.name}" argument "${mc.name}" of type "${uf}" is required, but it was not provided.`,{nodes:Ai}))}}}}}function ProvidedRequiredArgumentsOnDirectivesRule(vo){var Ai;const bo=Object.create(null),Ra=vo.getSchema(),pc=(Ai=Ra==null?void 0:Ra.getDirectives())!==null&&Ai!==void 0?Ai:specifiedDirectives;for(const df of pc)bo[df.name]=keyMap(df.args.filter(isRequiredArgument),ff=>ff.name);const mc=vo.getDocument().definitions;for(const df of mc)if(df.kind===Kind.DIRECTIVE_DEFINITION){var uf;const ff=(uf=df.arguments)!==null&&uf!==void 0?uf:[];bo[df.name.value]=keyMap(ff.filter(isRequiredArgumentNode),hf=>hf.name.value)}return{Directive:{leave(df){const ff=df.name.value,hf=bo[ff];if(hf){var pf;const mf=(pf=df.arguments)!==null&&pf!==void 0?pf:[],gf=new Set(mf.map(yf=>yf.name.value));for(const[yf,vf]of Object.entries(hf))if(!gf.has(yf)){const bf=isType(vf.type)?inspect(vf.type):print(vf.type);vo.reportError(new GraphQLError(`Directive "@${ff}" argument "${yf}" of type "${bf}" is required, but it was not provided.`,{nodes:df}))}}}}}}function isRequiredArgumentNode(vo){return vo.type.kind===Kind.NON_NULL_TYPE&&vo.defaultValue==null}function ScalarLeafsRule(vo){return{Field(Ai){const bo=vo.getType(),Ra=Ai.selectionSet;if(bo)if(isLeafType(getNamedType(bo))){if(Ra){const pc=Ai.name.value,mc=inspect(bo);vo.reportError(new GraphQLError(`Field "${pc}" must not have a selection since type "${mc}" has no subfields.`,{nodes:Ra}))}}else if(Ra){if(Ra.selections.length===0){const pc=Ai.name.value,mc=inspect(bo);vo.reportError(new GraphQLError(`Field "${pc}" of type "${mc}" must have at least one field selected.`,{nodes:Ai}))}}else{const pc=Ai.name.value,mc=inspect(bo);vo.reportError(new GraphQLError(`Field "${pc}" of type "${mc}" must have a selection of subfields. Did you mean "${pc} { ... }"?`,{nodes:Ai}))}}}}function valueFromAST(vo,Ai,bo){if(vo){if(vo.kind===Kind.VARIABLE){const Ra=vo.name.value;if(bo==null||bo[Ra]===void 0)return;const pc=bo[Ra];return pc===null&&isNonNullType(Ai)?void 0:pc}if(isNonNullType(Ai))return vo.kind===Kind.NULL?void 0:valueFromAST(vo,Ai.ofType,bo);if(vo.kind===Kind.NULL)return null;if(isListType(Ai)){const Ra=Ai.ofType;if(vo.kind===Kind.LIST){const mc=[];for(const uf of vo.values)if(isMissingVariable(uf,bo)){if(isNonNullType(Ra))return;mc.push(null)}else{const df=valueFromAST(uf,Ra,bo);if(df===void 0)return;mc.push(df)}return mc}const pc=valueFromAST(vo,Ra,bo);return pc===void 0?void 0:[pc]}if(isInputObjectType(Ai)){if(vo.kind!==Kind.OBJECT)return;const Ra=Object.create(null),pc=keyMap(vo.fields,mc=>mc.name.value);for(const mc of Object.values(Ai.getFields())){const uf=pc[mc.name];if(!uf||isMissingVariable(uf.value,bo)){if(mc.defaultValue!==void 0)Ra[mc.name]=mc.defaultValue;else if(isNonNullType(mc.type))return;continue}const df=valueFromAST(uf.value,mc.type,bo);if(df===void 0)return;Ra[mc.name]=df}if(Ai.isOneOf){const mc=Object.keys(Ra);if(mc.length!==1||Ra[mc[0]]===null)return}return Ra}if(isLeafType(Ai)){let Ra;try{Ra=Ai.parseLiteral(vo,bo)}catch{return}return Ra===void 0?void 0:Ra}invariant$1(!1,"Unexpected input type: "+inspect(Ai))}}function isMissingVariable(vo,Ai){return vo.kind===Kind.VARIABLE&&(Ai==null||Ai[vo.name.value]===void 0)}function getArgumentValues(vo,Ai,bo){var Ra;const pc={},mc=(Ra=Ai.arguments)!==null&&Ra!==void 0?Ra:[],uf=keyMap(mc,df=>df.name.value);for(const df of vo.args){const ff=df.name,hf=df.type,pf=uf[ff];if(!pf){if(df.defaultValue!==void 0)pc[ff]=df.defaultValue;else if(isNonNullType(hf))throw new GraphQLError(`Argument "${ff}" of required type "${inspect(hf)}" was not provided.`,{nodes:Ai});continue}const mf=pf.value;let gf=mf.kind===Kind.NULL;if(mf.kind===Kind.VARIABLE){const vf=mf.name.value;if(bo==null||!hasOwnProperty(bo,vf)){if(df.defaultValue!==void 0)pc[ff]=df.defaultValue;else if(isNonNullType(hf))throw new GraphQLError(`Argument "${ff}" of required type "${inspect(hf)}" was provided the variable "$${vf}" which was not provided a runtime value.`,{nodes:mf});continue}gf=bo[vf]==null}if(gf&&isNonNullType(hf))throw new GraphQLError(`Argument "${ff}" of non-null type "${inspect(hf)}" must not be null.`,{nodes:mf});const yf=valueFromAST(mf,hf,bo);if(yf===void 0)throw new GraphQLError(`Argument "${ff}" has invalid value ${print(mf)}.`,{nodes:mf});pc[ff]=yf}return pc}function getDirectiveValues(vo,Ai,bo){var Ra;const pc=(Ra=Ai.directives)===null||Ra===void 0?void 0:Ra.find(mc=>mc.name.value===vo.name);if(pc)return getArgumentValues(vo,pc,bo)}function hasOwnProperty(vo,Ai){return Object.prototype.hasOwnProperty.call(vo,Ai)}function collectFields(vo,Ai,bo,Ra,pc){const mc=new Map;return collectFieldsImpl(vo,Ai,bo,Ra,pc,mc,new Set),mc}function collectFieldsImpl(vo,Ai,bo,Ra,pc,mc,uf){for(const df of pc.selections)switch(df.kind){case Kind.FIELD:{if(!shouldIncludeNode(bo,df))continue;const ff=getFieldEntryKey(df),hf=mc.get(ff);hf!==void 0?hf.push(df):mc.set(ff,[df]);break}case Kind.INLINE_FRAGMENT:{if(!shouldIncludeNode(bo,df)||!doesFragmentConditionMatch(vo,df,Ra))continue;collectFieldsImpl(vo,Ai,bo,Ra,df.selectionSet,mc,uf);break}case Kind.FRAGMENT_SPREAD:{const ff=df.name.value;if(uf.has(ff)||!shouldIncludeNode(bo,df))continue;uf.add(ff);const hf=Ai[ff];if(!hf||!doesFragmentConditionMatch(vo,hf,Ra))continue;collectFieldsImpl(vo,Ai,bo,Ra,hf.selectionSet,mc,uf);break}}}function shouldIncludeNode(vo,Ai){const bo=getDirectiveValues(GraphQLSkipDirective,Ai,vo);if((bo==null?void 0:bo.if)===!0)return!1;const Ra=getDirectiveValues(GraphQLIncludeDirective,Ai,vo);return(Ra==null?void 0:Ra.if)!==!1}function doesFragmentConditionMatch(vo,Ai,bo){const Ra=Ai.typeCondition;if(!Ra)return!0;const pc=typeFromAST(vo,Ra);return pc===bo?!0:isAbstractType(pc)?vo.isSubType(pc,bo):!1}function getFieldEntryKey(vo){return vo.alias?vo.alias.value:vo.name.value}function SingleFieldSubscriptionsRule(vo){return{OperationDefinition(Ai){if(Ai.operation==="subscription"){const bo=vo.getSchema(),Ra=bo.getSubscriptionType();if(Ra){const pc=Ai.name?Ai.name.value:null,mc=Object.create(null),uf=vo.getDocument(),df=Object.create(null);for(const hf of uf.definitions)hf.kind===Kind.FRAGMENT_DEFINITION&&(df[hf.name.value]=hf);const ff=collectFields(bo,df,mc,Ra,Ai.selectionSet);if(ff.size>1){const hf=[...ff.values()].slice(1).flat();vo.reportError(new GraphQLError(pc!=null?`Subscription "${pc}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:hf}))}for(const hf of ff.values())hf[0].name.value.startsWith("__")&&vo.reportError(new GraphQLError(pc!=null?`Subscription "${pc}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:hf}))}}}}}function groupBy(vo,Ai){const bo=new Map;for(const Ra of vo){const pc=Ai(Ra),mc=bo.get(pc);mc===void 0?bo.set(pc,[Ra]):mc.push(Ra)}return bo}function UniqueArgumentDefinitionNamesRule(vo){return{DirectiveDefinition(Ra){var pc;const mc=(pc=Ra.arguments)!==null&&pc!==void 0?pc:[];return bo(`@${Ra.name.value}`,mc)},InterfaceTypeDefinition:Ai,InterfaceTypeExtension:Ai,ObjectTypeDefinition:Ai,ObjectTypeExtension:Ai};function Ai(Ra){var pc;const mc=Ra.name.value,uf=(pc=Ra.fields)!==null&&pc!==void 0?pc:[];for(const ff of uf){var df;const hf=ff.name.value,pf=(df=ff.arguments)!==null&&df!==void 0?df:[];bo(`${mc}.${hf}`,pf)}return!1}function bo(Ra,pc){const mc=groupBy(pc,uf=>uf.name.value);for(const[uf,df]of mc)df.length>1&&vo.reportError(new GraphQLError(`Argument "${Ra}(${uf}:)" can only be defined once.`,{nodes:df.map(ff=>ff.name)}));return!1}}function UniqueArgumentNamesRule(vo){return{Field:Ai,Directive:Ai};function Ai(bo){var Ra;const pc=(Ra=bo.arguments)!==null&&Ra!==void 0?Ra:[],mc=groupBy(pc,uf=>uf.name.value);for(const[uf,df]of mc)df.length>1&&vo.reportError(new GraphQLError(`There can be only one argument named "${uf}".`,{nodes:df.map(ff=>ff.name)}))}}function UniqueDirectiveNamesRule(vo){const Ai=Object.create(null),bo=vo.getSchema();return{DirectiveDefinition(Ra){const pc=Ra.name.value;if(bo!=null&&bo.getDirective(pc)){vo.reportError(new GraphQLError(`Directive "@${pc}" already exists in the schema. It cannot be redefined.`,{nodes:Ra.name}));return}return Ai[pc]?vo.reportError(new GraphQLError(`There can be only one directive named "@${pc}".`,{nodes:[Ai[pc],Ra.name]})):Ai[pc]=Ra.name,!1}}}function UniqueDirectivesPerLocationRule(vo){const Ai=Object.create(null),bo=vo.getSchema(),Ra=bo?bo.getDirectives():specifiedDirectives;for(const df of Ra)Ai[df.name]=!df.isRepeatable;const pc=vo.getDocument().definitions;for(const df of pc)df.kind===Kind.DIRECTIVE_DEFINITION&&(Ai[df.name.value]=!df.repeatable);const mc=Object.create(null),uf=Object.create(null);return{enter(df){if(!("directives"in df)||!df.directives)return;let ff;if(df.kind===Kind.SCHEMA_DEFINITION||df.kind===Kind.SCHEMA_EXTENSION)ff=mc;else if(isTypeDefinitionNode(df)||isTypeExtensionNode(df)){const hf=df.name.value;ff=uf[hf],ff===void 0&&(uf[hf]=ff=Object.create(null))}else ff=Object.create(null);for(const hf of df.directives){const pf=hf.name.value;Ai[pf]&&(ff[pf]?vo.reportError(new GraphQLError(`The directive "@${pf}" can only be used once at this location.`,{nodes:[ff[pf],hf]})):ff[pf]=hf)}}}}function UniqueEnumValueNamesRule(vo){const Ai=vo.getSchema(),bo=Ai?Ai.getTypeMap():Object.create(null),Ra=Object.create(null);return{EnumTypeDefinition:pc,EnumTypeExtension:pc};function pc(mc){var uf;const df=mc.name.value;Ra[df]||(Ra[df]=Object.create(null));const ff=(uf=mc.values)!==null&&uf!==void 0?uf:[],hf=Ra[df];for(const pf of ff){const mf=pf.name.value,gf=bo[df];isEnumType(gf)&&gf.getValue(mf)?vo.reportError(new GraphQLError(`Enum value "${df}.${mf}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:pf.name})):hf[mf]?vo.reportError(new GraphQLError(`Enum value "${df}.${mf}" can only be defined once.`,{nodes:[hf[mf],pf.name]})):hf[mf]=pf.name}return!1}}function UniqueFieldDefinitionNamesRule(vo){const Ai=vo.getSchema(),bo=Ai?Ai.getTypeMap():Object.create(null),Ra=Object.create(null);return{InputObjectTypeDefinition:pc,InputObjectTypeExtension:pc,InterfaceTypeDefinition:pc,InterfaceTypeExtension:pc,ObjectTypeDefinition:pc,ObjectTypeExtension:pc};function pc(mc){var uf;const df=mc.name.value;Ra[df]||(Ra[df]=Object.create(null));const ff=(uf=mc.fields)!==null&&uf!==void 0?uf:[],hf=Ra[df];for(const pf of ff){const mf=pf.name.value;hasField(bo[df],mf)?vo.reportError(new GraphQLError(`Field "${df}.${mf}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:pf.name})):hf[mf]?vo.reportError(new GraphQLError(`Field "${df}.${mf}" can only be defined once.`,{nodes:[hf[mf],pf.name]})):hf[mf]=pf.name}return!1}}function hasField(vo,Ai){return isObjectType(vo)||isInterfaceType(vo)||isInputObjectType(vo)?vo.getFields()[Ai]!=null:!1}function UniqueFragmentNamesRule(vo){const Ai=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(bo){const Ra=bo.name.value;return Ai[Ra]?vo.reportError(new GraphQLError(`There can be only one fragment named "${Ra}".`,{nodes:[Ai[Ra],bo.name]})):Ai[Ra]=bo.name,!1}}}function UniqueInputFieldNamesRule(vo){const Ai=[];let bo=Object.create(null);return{ObjectValue:{enter(){Ai.push(bo),bo=Object.create(null)},leave(){const Ra=Ai.pop();Ra||invariant$1(),bo=Ra}},ObjectField(Ra){const pc=Ra.name.value;bo[pc]?vo.reportError(new GraphQLError(`There can be only one input field named "${pc}".`,{nodes:[bo[pc],Ra.name]})):bo[pc]=Ra.name}}}function UniqueOperationNamesRule(vo){const Ai=Object.create(null);return{OperationDefinition(bo){const Ra=bo.name;return Ra&&(Ai[Ra.value]?vo.reportError(new GraphQLError(`There can be only one operation named "${Ra.value}".`,{nodes:[Ai[Ra.value],Ra]})):Ai[Ra.value]=Ra),!1},FragmentDefinition:()=>!1}}function UniqueOperationTypesRule(vo){const Ai=vo.getSchema(),bo=Object.create(null),Ra=Ai?{query:Ai.getQueryType(),mutation:Ai.getMutationType(),subscription:Ai.getSubscriptionType()}:{};return{SchemaDefinition:pc,SchemaExtension:pc};function pc(mc){var uf;const df=(uf=mc.operationTypes)!==null&&uf!==void 0?uf:[];for(const ff of df){const hf=ff.operation,pf=bo[hf];Ra[hf]?vo.reportError(new GraphQLError(`Type for ${hf} already defined in the schema. It cannot be redefined.`,{nodes:ff})):pf?vo.reportError(new GraphQLError(`There can be only one ${hf} type in schema.`,{nodes:[pf,ff]})):bo[hf]=ff}return!1}}function UniqueTypeNamesRule(vo){const Ai=Object.create(null),bo=vo.getSchema();return{ScalarTypeDefinition:Ra,ObjectTypeDefinition:Ra,InterfaceTypeDefinition:Ra,UnionTypeDefinition:Ra,EnumTypeDefinition:Ra,InputObjectTypeDefinition:Ra};function Ra(pc){const mc=pc.name.value;if(bo!=null&&bo.getType(mc)){vo.reportError(new GraphQLError(`Type "${mc}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:pc.name}));return}return Ai[mc]?vo.reportError(new GraphQLError(`There can be only one type named "${mc}".`,{nodes:[Ai[mc],pc.name]})):Ai[mc]=pc.name,!1}}function UniqueVariableNamesRule(vo){return{OperationDefinition(Ai){var bo;const Ra=(bo=Ai.variableDefinitions)!==null&&bo!==void 0?bo:[],pc=groupBy(Ra,mc=>mc.variable.name.value);for(const[mc,uf]of pc)uf.length>1&&vo.reportError(new GraphQLError(`There can be only one variable named "$${mc}".`,{nodes:uf.map(df=>df.variable.name)}))}}}function ValuesOfCorrectTypeRule(vo){let Ai={};return{OperationDefinition:{enter(){Ai={}}},VariableDefinition(bo){Ai[bo.variable.name.value]=bo},ListValue(bo){const Ra=getNullableType(vo.getParentInputType());if(!isListType(Ra))return isValidValueNode(vo,bo),!1},ObjectValue(bo){const Ra=getNamedType(vo.getInputType());if(!isInputObjectType(Ra))return isValidValueNode(vo,bo),!1;const pc=keyMap(bo.fields,mc=>mc.name.value);for(const mc of Object.values(Ra.getFields()))if(!pc[mc.name]&&isRequiredInputField(mc)){const uf=inspect(mc.type);vo.reportError(new GraphQLError(`Field "${Ra.name}.${mc.name}" of required type "${uf}" was not provided.`,{nodes:bo}))}Ra.isOneOf&&validateOneOfInputObject(vo,bo,Ra,pc,Ai)},ObjectField(bo){const Ra=getNamedType(vo.getParentInputType());if(!vo.getInputType()&&isInputObjectType(Ra)){const pc=suggestionList(bo.name.value,Object.keys(Ra.getFields()));vo.reportError(new GraphQLError(`Field "${bo.name.value}" is not defined by type "${Ra.name}".`+didYouMean(pc),{nodes:bo}))}},NullValue(bo){const Ra=vo.getInputType();isNonNullType(Ra)&&vo.reportError(new GraphQLError(`Expected value of type "${inspect(Ra)}", found ${print(bo)}.`,{nodes:bo}))},EnumValue:bo=>isValidValueNode(vo,bo),IntValue:bo=>isValidValueNode(vo,bo),FloatValue:bo=>isValidValueNode(vo,bo),StringValue:bo=>isValidValueNode(vo,bo),BooleanValue:bo=>isValidValueNode(vo,bo)}}function isValidValueNode(vo,Ai){const bo=vo.getInputType();if(!bo)return;const Ra=getNamedType(bo);if(!isLeafType(Ra)){const pc=inspect(bo);vo.reportError(new GraphQLError(`Expected value of type "${pc}", found ${print(Ai)}.`,{nodes:Ai}));return}try{if(Ra.parseLiteral(Ai,void 0)===void 0){const pc=inspect(bo);vo.reportError(new GraphQLError(`Expected value of type "${pc}", found ${print(Ai)}.`,{nodes:Ai}))}}catch(pc){const mc=inspect(bo);pc instanceof GraphQLError?vo.reportError(pc):vo.reportError(new GraphQLError(`Expected value of type "${mc}", found ${print(Ai)}; `+pc.message,{nodes:Ai,originalError:pc}))}}function validateOneOfInputObject(vo,Ai,bo,Ra,pc){var mc;const uf=Object.keys(Ra);if(uf.length!==1){vo.reportError(new GraphQLError(`OneOf Input Object "${bo.name}" must specify exactly one key.`,{nodes:[Ai]}));return}const df=(mc=Ra[uf[0]])===null||mc===void 0?void 0:mc.value,ff=!df||df.kind===Kind.NULL,hf=(df==null?void 0:df.kind)===Kind.VARIABLE;if(ff){vo.reportError(new GraphQLError(`Field "${bo.name}.${uf[0]}" must be non-null.`,{nodes:[Ai]}));return}if(hf){const pf=df.name.value;pc[pf].type.kind!==Kind.NON_NULL_TYPE&&vo.reportError(new GraphQLError(`Variable "${pf}" must be non-nullable to be used for OneOf Input Object "${bo.name}".`,{nodes:[Ai]}))}}function VariablesAreInputTypesRule(vo){return{VariableDefinition(Ai){const bo=typeFromAST(vo.getSchema(),Ai.type);if(bo!==void 0&&!isInputType(bo)){const Ra=Ai.variable.name.value,pc=print(Ai.type);vo.reportError(new GraphQLError(`Variable "$${Ra}" cannot be non-input type "${pc}".`,{nodes:Ai.type}))}}}}function VariablesInAllowedPositionRule(vo){let Ai=Object.create(null);return{OperationDefinition:{enter(){Ai=Object.create(null)},leave(bo){const Ra=vo.getRecursiveVariableUsages(bo);for(const{node:pc,type:mc,defaultValue:uf}of Ra){const df=pc.name.value,ff=Ai[df];if(ff&&mc){const hf=vo.getSchema(),pf=typeFromAST(hf,ff.type);if(pf&&!allowedVariableUsage(hf,pf,ff.defaultValue,mc,uf)){const mf=inspect(pf),gf=inspect(mc);vo.reportError(new GraphQLError(`Variable "$${df}" of type "${mf}" used in position expecting type "${gf}".`,{nodes:[ff,pc]}))}}}}},VariableDefinition(bo){Ai[bo.variable.name.value]=bo}}}function allowedVariableUsage(vo,Ai,bo,Ra,pc){if(isNonNullType(Ra)&&!isNonNullType(Ai)){if(!(bo!=null&&bo.kind!==Kind.NULL)&&pc===void 0)return!1;const mc=Ra.ofType;return isTypeSubTypeOf(vo,Ai,mc)}return isTypeSubTypeOf(vo,Ai,Ra)}const recommendedRules=Object.freeze([MaxIntrospectionDepthRule]),specifiedRules=Object.freeze([ExecutableDefinitionsRule,UniqueOperationNamesRule,LoneAnonymousOperationRule,SingleFieldSubscriptionsRule,KnownTypeNamesRule,FragmentsOnCompositeTypesRule,VariablesAreInputTypesRule,ScalarLeafsRule,FieldsOnCorrectTypeRule,UniqueFragmentNamesRule,KnownFragmentNamesRule,NoUnusedFragmentsRule,PossibleFragmentSpreadsRule,NoFragmentCyclesRule,UniqueVariableNamesRule,NoUndefinedVariablesRule,NoUnusedVariablesRule,KnownDirectivesRule,UniqueDirectivesPerLocationRule,KnownArgumentNamesRule,UniqueArgumentNamesRule,ValuesOfCorrectTypeRule,ProvidedRequiredArgumentsRule,VariablesInAllowedPositionRule,OverlappingFieldsCanBeMergedRule,UniqueInputFieldNamesRule,...recommendedRules]),specifiedSDLRules=Object.freeze([LoneSchemaDefinitionRule,UniqueOperationTypesRule,UniqueTypeNamesRule,UniqueEnumValueNamesRule,UniqueFieldDefinitionNamesRule,UniqueArgumentDefinitionNamesRule,UniqueDirectiveNamesRule,KnownTypeNamesRule,KnownDirectivesRule,UniqueDirectivesPerLocationRule,PossibleTypeExtensionsRule,KnownArgumentNamesOnDirectivesRule,UniqueArgumentNamesRule,UniqueInputFieldNamesRule,ProvidedRequiredArgumentsOnDirectivesRule]);class ASTValidationContext{constructor(Ai,bo){this._ast=Ai,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=bo}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(Ai){this._onError(Ai)}getDocument(){return this._ast}getFragment(Ai){let bo;if(this._fragments)bo=this._fragments;else{bo=Object.create(null);for(const Ra of this.getDocument().definitions)Ra.kind===Kind.FRAGMENT_DEFINITION&&(bo[Ra.name.value]=Ra);this._fragments=bo}return bo[Ai]}getFragmentSpreads(Ai){let bo=this._fragmentSpreads.get(Ai);if(!bo){bo=[];const Ra=[Ai];let pc;for(;pc=Ra.pop();)for(const mc of pc.selections)mc.kind===Kind.FRAGMENT_SPREAD?bo.push(mc):mc.selectionSet&&Ra.push(mc.selectionSet);this._fragmentSpreads.set(Ai,bo)}return bo}getRecursivelyReferencedFragments(Ai){let bo=this._recursivelyReferencedFragments.get(Ai);if(!bo){bo=[];const Ra=Object.create(null),pc=[Ai.selectionSet];let mc;for(;mc=pc.pop();)for(const uf of this.getFragmentSpreads(mc)){const df=uf.name.value;if(Ra[df]!==!0){Ra[df]=!0;const ff=this.getFragment(df);ff&&(bo.push(ff),pc.push(ff.selectionSet))}}this._recursivelyReferencedFragments.set(Ai,bo)}return bo}}class SDLValidationContext extends ASTValidationContext{constructor(Ai,bo,Ra){super(Ai,Ra),this._schema=bo}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}}class ValidationContext extends ASTValidationContext{constructor(Ai,bo,Ra,pc){super(bo,pc),this._schema=Ai,this._typeInfo=Ra,this._variableUsages=new Map,this._recursiveVariableUsages=new Map}get[Symbol.toStringTag](){return"ValidationContext"}getSchema(){return this._schema}getVariableUsages(Ai){let bo=this._variableUsages.get(Ai);if(!bo){const Ra=[],pc=new TypeInfo(this._schema);visit(Ai,visitWithTypeInfo(pc,{VariableDefinition:()=>!1,Variable(mc){Ra.push({node:mc,type:pc.getInputType(),defaultValue:pc.getDefaultValue()})}})),bo=Ra,this._variableUsages.set(Ai,bo)}return bo}getRecursiveVariableUsages(Ai){let bo=this._recursiveVariableUsages.get(Ai);if(!bo){bo=this.getVariableUsages(Ai);for(const Ra of this.getRecursivelyReferencedFragments(Ai))bo=bo.concat(this.getVariableUsages(Ra));this._recursiveVariableUsages.set(Ai,bo)}return bo}getType(){return this._typeInfo.getType()}getParentType(){return this._typeInfo.getParentType()}getInputType(){return this._typeInfo.getInputType()}getParentInputType(){return this._typeInfo.getParentInputType()}getFieldDef(){return this._typeInfo.getFieldDef()}getDirective(){return this._typeInfo.getDirective()}getArgument(){return this._typeInfo.getArgument()}getEnumValue(){return this._typeInfo.getEnumValue()}}function validate(vo,Ai,bo=specifiedRules,Ra,pc=new TypeInfo(vo)){var mc;const uf=(mc=void 0)!==null&&mc!==void 0?mc:100;Ai||devAssert(!1,"Must provide document."),assertValidSchema(vo);const df=Object.freeze({}),ff=[],hf=new ValidationContext(vo,Ai,pc,mf=>{if(ff.length>=uf)throw ff.push(new GraphQLError("Too many validation errors, error limit reached. Validation aborted.")),df;ff.push(mf)}),pf=visitInParallel(bo.map(mf=>mf(hf)));try{visit(Ai,visitWithTypeInfo(pc,pf))}catch(mf){if(mf!==df)throw mf}return ff}function validateSDL(vo,Ai,bo=specifiedSDLRules){const Ra=[],pc=new SDLValidationContext(vo,Ai,uf=>{Ra.push(uf)}),mc=bo.map(uf=>uf(pc));return visit(vo,visitInParallel(mc)),Ra}function assertValidSDL(vo){const Ai=validateSDL(vo);if(Ai.length!==0)throw new Error(Ai.map(bo=>bo.message).join(`
|
|
323
|
-
|
|
324
|
-
`))}function assertValidSDLExtension(vo,Ai){const bo=validateSDL(vo,Ai);if(bo.length!==0)throw new Error(bo.map(Ra=>Ra.message).join(`
|
|
325
|
-
|
|
326
|
-
`))}function toError(vo){return vo instanceof Error?vo:new NonErrorThrown(vo)}class NonErrorThrown extends Error{constructor(Ai){super("Unexpected error value: "+inspect(Ai)),this.name="NonErrorThrown",this.thrownValue=Ai}}function locatedError(vo,Ai,bo){var Ra;const pc=toError(vo);return isLocatedGraphQLError(pc)?pc:new GraphQLError(pc.message,{nodes:(Ra=pc.nodes)!==null&&Ra!==void 0?Ra:Ai,source:pc.source,positions:pc.positions,path:bo,originalError:pc})}function isLocatedGraphQLError(vo){return Array.isArray(vo.path)}function NoDeprecatedCustomRule(vo){return{Field(Ai){const bo=vo.getFieldDef(),Ra=bo==null?void 0:bo.deprecationReason;if(bo&&Ra!=null){const pc=vo.getParentType();pc!=null||invariant$1(),vo.reportError(new GraphQLError(`The field ${pc.name}.${bo.name} is deprecated. ${Ra}`,{nodes:Ai}))}},Argument(Ai){const bo=vo.getArgument(),Ra=bo==null?void 0:bo.deprecationReason;if(bo&&Ra!=null){const pc=vo.getDirective();if(pc!=null)vo.reportError(new GraphQLError(`Directive "@${pc.name}" argument "${bo.name}" is deprecated. ${Ra}`,{nodes:Ai}));else{const mc=vo.getParentType(),uf=vo.getFieldDef();mc!=null&&uf!=null||invariant$1(),vo.reportError(new GraphQLError(`Field "${mc.name}.${uf.name}" argument "${bo.name}" is deprecated. ${Ra}`,{nodes:Ai}))}}},ObjectField(Ai){const bo=getNamedType(vo.getParentInputType());if(isInputObjectType(bo)){const Ra=bo.getFields()[Ai.name.value],pc=Ra==null?void 0:Ra.deprecationReason;pc!=null&&vo.reportError(new GraphQLError(`The input field ${bo.name}.${Ra.name} is deprecated. ${pc}`,{nodes:Ai}))}},EnumValue(Ai){const bo=vo.getEnumValue(),Ra=bo==null?void 0:bo.deprecationReason;if(bo&&Ra!=null){const pc=getNamedType(vo.getInputType());pc!=null||invariant$1(),vo.reportError(new GraphQLError(`The enum value "${pc.name}.${bo.name}" is deprecated. ${Ra}`,{nodes:Ai}))}}}}function extendSchema(vo,Ai,bo){assertSchema(vo),Ai!=null&&Ai.kind===Kind.DOCUMENT||devAssert(!1,"Must provide valid Document AST."),assertValidSDLExtension(Ai,vo);const Ra=vo.toConfig(),pc=extendSchemaImpl(Ra,Ai,bo);return Ra===pc?vo:new GraphQLSchema(pc)}function extendSchemaImpl(vo,Ai,bo){var Ra,pc,mc,uf;const df=[],ff=Object.create(null),hf=[];let pf;const mf=[];for(const O1 of Ai.definitions)if(O1.kind===Kind.SCHEMA_DEFINITION)pf=O1;else if(O1.kind===Kind.SCHEMA_EXTENSION)mf.push(O1);else if(isTypeDefinitionNode(O1))df.push(O1);else if(isTypeExtensionNode(O1)){const j1=O1.name.value,L1=ff[j1];ff[j1]=L1?L1.concat([O1]):[O1]}else O1.kind===Kind.DIRECTIVE_DEFINITION&&hf.push(O1);if(Object.keys(ff).length===0&&df.length===0&&hf.length===0&&mf.length===0&&pf==null)return vo;const gf=Object.create(null);for(const O1 of vo.types)gf[O1.name]=wf(O1);for(const O1 of df){var yf;const j1=O1.name.value;gf[j1]=(yf=stdTypeMap[j1])!==null&&yf!==void 0?yf:Z1(O1)}const vf={query:vo.query&&Sf(vo.query),mutation:vo.mutation&&Sf(vo.mutation),subscription:vo.subscription&&Sf(vo.subscription),...pf&&P1([pf]),...P1(mf)};return{description:(Ra=pf)===null||Ra===void 0||(pc=Ra.description)===null||pc===void 0?void 0:pc.value,...vf,types:Object.values(gf),directives:[...vo.directives.map(xf),...hf.map(m1)],extensions:Object.create(null),astNode:(mc=pf)!==null&&mc!==void 0?mc:vo.astNode,extensionASTNodes:vo.extensionASTNodes.concat(mf),assumeValid:(uf=bo==null?void 0:bo.assumeValid)!==null&&uf!==void 0?uf:!1};function bf(O1){return isListType(O1)?new GraphQLList(bf(O1.ofType)):isNonNullType(O1)?new GraphQLNonNull(bf(O1.ofType)):Sf(O1)}function Sf(O1){return gf[O1.name]}function xf(O1){const j1=O1.toConfig();return new GraphQLDirective({...j1,args:mapValue(j1.args,R1)})}function wf(O1){if(isIntrospectionType(O1)||isSpecifiedScalarType(O1))return O1;if(isScalarType(O1))return s1(O1);if(isObjectType(O1))return c1(O1);if(isInterfaceType(O1))return u1(O1);if(isUnionType(O1))return T1(O1);if(isEnumType(O1))return l1(O1);if(isInputObjectType(O1))return If(O1);invariant$1(!1,"Unexpected type: "+inspect(O1))}function If(O1){var j1;const L1=O1.toConfig(),G1=(j1=ff[L1.name])!==null&&j1!==void 0?j1:[];return new GraphQLInputObjectType({...L1,fields:()=>({...mapValue(L1.fields,Y1=>({...Y1,type:bf(Y1.type)})),...F1(G1)}),extensionASTNodes:L1.extensionASTNodes.concat(G1)})}function l1(O1){var j1;const L1=O1.toConfig(),G1=(j1=ff[O1.name])!==null&&j1!==void 0?j1:[];return new GraphQLEnumType({...L1,values:{...L1.values,...U1(G1)},extensionASTNodes:L1.extensionASTNodes.concat(G1)})}function s1(O1){var j1;const L1=O1.toConfig(),G1=(j1=ff[L1.name])!==null&&j1!==void 0?j1:[];let Y1=L1.specifiedByURL;for(const K1 of G1){var z1;Y1=(z1=getSpecifiedByURL(K1))!==null&&z1!==void 0?z1:Y1}return new GraphQLScalarType({...L1,specifiedByURL:Y1,extensionASTNodes:L1.extensionASTNodes.concat(G1)})}function c1(O1){var j1;const L1=O1.toConfig(),G1=(j1=ff[L1.name])!==null&&j1!==void 0?j1:[];return new GraphQLObjectType({...L1,interfaces:()=>[...O1.getInterfaces().map(Sf),...B1(G1)],fields:()=>({...mapValue(L1.fields,_1),...$1(G1)}),extensionASTNodes:L1.extensionASTNodes.concat(G1)})}function u1(O1){var j1;const L1=O1.toConfig(),G1=(j1=ff[L1.name])!==null&&j1!==void 0?j1:[];return new GraphQLInterfaceType({...L1,interfaces:()=>[...O1.getInterfaces().map(Sf),...B1(G1)],fields:()=>({...mapValue(L1.fields,_1),...$1(G1)}),extensionASTNodes:L1.extensionASTNodes.concat(G1)})}function T1(O1){var j1;const L1=O1.toConfig(),G1=(j1=ff[L1.name])!==null&&j1!==void 0?j1:[];return new GraphQLUnionType({...L1,types:()=>[...O1.getTypes().map(Sf),...W1(G1)],extensionASTNodes:L1.extensionASTNodes.concat(G1)})}function _1(O1){return{...O1,type:bf(O1.type),args:O1.args&&mapValue(O1.args,R1)}}function R1(O1){return{...O1,type:bf(O1.type)}}function P1(O1){const j1={};for(const G1 of O1){var L1;const Y1=(L1=G1.operationTypes)!==null&&L1!==void 0?L1:[];for(const z1 of Y1)j1[z1.operation]=E1(z1.type)}return j1}function E1(O1){var j1;const L1=O1.name.value,G1=(j1=stdTypeMap[L1])!==null&&j1!==void 0?j1:gf[L1];if(G1===void 0)throw new Error(`Unknown type: "${L1}".`);return G1}function M1(O1){return O1.kind===Kind.LIST_TYPE?new GraphQLList(M1(O1.type)):O1.kind===Kind.NON_NULL_TYPE?new GraphQLNonNull(M1(O1.type)):E1(O1)}function m1(O1){var j1;return new GraphQLDirective({name:O1.name.value,description:(j1=O1.description)===null||j1===void 0?void 0:j1.value,locations:O1.locations.map(({value:L1})=>L1),isRepeatable:O1.repeatable,args:k1(O1.arguments),astNode:O1})}function $1(O1){const j1=Object.create(null);for(const Y1 of O1){var L1;const z1=(L1=Y1.fields)!==null&&L1!==void 0?L1:[];for(const K1 of z1){var G1;j1[K1.name.value]={type:M1(K1.type),description:(G1=K1.description)===null||G1===void 0?void 0:G1.value,args:k1(K1.arguments),deprecationReason:getDeprecationReason(K1),astNode:K1}}}return j1}function k1(O1){const j1=O1??[],L1=Object.create(null);for(const Y1 of j1){var G1;const z1=M1(Y1.type);L1[Y1.name.value]={type:z1,description:(G1=Y1.description)===null||G1===void 0?void 0:G1.value,defaultValue:valueFromAST(Y1.defaultValue,z1),deprecationReason:getDeprecationReason(Y1),astNode:Y1}}return L1}function F1(O1){const j1=Object.create(null);for(const Y1 of O1){var L1;const z1=(L1=Y1.fields)!==null&&L1!==void 0?L1:[];for(const K1 of z1){var G1;const tT=M1(K1.type);j1[K1.name.value]={type:tT,description:(G1=K1.description)===null||G1===void 0?void 0:G1.value,defaultValue:valueFromAST(K1.defaultValue,tT),deprecationReason:getDeprecationReason(K1),astNode:K1}}}return j1}function U1(O1){const j1=Object.create(null);for(const Y1 of O1){var L1;const z1=(L1=Y1.values)!==null&&L1!==void 0?L1:[];for(const K1 of z1){var G1;j1[K1.name.value]={description:(G1=K1.description)===null||G1===void 0?void 0:G1.value,deprecationReason:getDeprecationReason(K1),astNode:K1}}}return j1}function B1(O1){return O1.flatMap(j1=>{var L1,G1;return(L1=(G1=j1.interfaces)===null||G1===void 0?void 0:G1.map(E1))!==null&&L1!==void 0?L1:[]})}function W1(O1){return O1.flatMap(j1=>{var L1,G1;return(L1=(G1=j1.types)===null||G1===void 0?void 0:G1.map(E1))!==null&&L1!==void 0?L1:[]})}function Z1(O1){var j1;const L1=O1.name.value,G1=(j1=ff[L1])!==null&&j1!==void 0?j1:[];switch(O1.kind){case Kind.OBJECT_TYPE_DEFINITION:{var Y1;const oT=[O1,...G1];return new GraphQLObjectType({name:L1,description:(Y1=O1.description)===null||Y1===void 0?void 0:Y1.value,interfaces:()=>B1(oT),fields:()=>$1(oT),astNode:O1,extensionASTNodes:G1})}case Kind.INTERFACE_TYPE_DEFINITION:{var z1;const oT=[O1,...G1];return new GraphQLInterfaceType({name:L1,description:(z1=O1.description)===null||z1===void 0?void 0:z1.value,interfaces:()=>B1(oT),fields:()=>$1(oT),astNode:O1,extensionASTNodes:G1})}case Kind.ENUM_TYPE_DEFINITION:{var K1;const oT=[O1,...G1];return new GraphQLEnumType({name:L1,description:(K1=O1.description)===null||K1===void 0?void 0:K1.value,values:U1(oT),astNode:O1,extensionASTNodes:G1})}case Kind.UNION_TYPE_DEFINITION:{var tT;const oT=[O1,...G1];return new GraphQLUnionType({name:L1,description:(tT=O1.description)===null||tT===void 0?void 0:tT.value,types:()=>W1(oT),astNode:O1,extensionASTNodes:G1})}case Kind.SCALAR_TYPE_DEFINITION:{var iT;return new GraphQLScalarType({name:L1,description:(iT=O1.description)===null||iT===void 0?void 0:iT.value,specifiedByURL:getSpecifiedByURL(O1),astNode:O1,extensionASTNodes:G1})}case Kind.INPUT_OBJECT_TYPE_DEFINITION:{var aT;const oT=[O1,...G1];return new GraphQLInputObjectType({name:L1,description:(aT=O1.description)===null||aT===void 0?void 0:aT.value,fields:()=>F1(oT),astNode:O1,extensionASTNodes:G1,isOneOf:isOneOf(O1)})}}}}const stdTypeMap=keyMap([...specifiedScalarTypes,...introspectionTypes],vo=>vo.name);function getDeprecationReason(vo){const Ai=getDirectiveValues(GraphQLDeprecatedDirective,vo);return Ai==null?void 0:Ai.reason}function getSpecifiedByURL(vo){const Ai=getDirectiveValues(GraphQLSpecifiedByDirective,vo);return Ai==null?void 0:Ai.url}function isOneOf(vo){return!!getDirectiveValues(GraphQLOneOfDirective,vo)}function buildASTSchema(vo,Ai){vo!=null&&vo.kind===Kind.DOCUMENT||devAssert(!1,"Must provide valid Document AST."),(Ai==null?void 0:Ai.assumeValid)!==!0&&(Ai==null?void 0:Ai.assumeValidSDL)!==!0&&assertValidSDL(vo);const bo=extendSchemaImpl({description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},vo,Ai);if(bo.astNode==null)for(const pc of bo.types)switch(pc.name){case"Query":bo.query=pc;break;case"Mutation":bo.mutation=pc;break;case"Subscription":bo.subscription=pc;break}const Ra=[...bo.directives,...specifiedDirectives.filter(pc=>bo.directives.every(mc=>mc.name!==pc.name))];return new GraphQLSchema({...bo,directives:Ra})}function buildSchema(vo,Ai){const bo=parse(vo,{noLocation:void 0,allowLegacyFragmentVariables:void 0});return buildASTSchema(bo,{assumeValidSDL:void 0,assumeValid:void 0})}function printSchema(vo){return printFilteredSchema(vo,Ai=>!isSpecifiedDirective(Ai),isDefinedType)}function isDefinedType(vo){return!isSpecifiedScalarType(vo)&&!isIntrospectionType(vo)}function printFilteredSchema(vo,Ai,bo){const Ra=vo.getDirectives().filter(Ai),pc=Object.values(vo.getTypeMap()).filter(bo);return[printSchemaDefinition(vo),...Ra.map(mc=>printDirective(mc)),...pc.map(mc=>printType(mc))].filter(Boolean).join(`
|
|
327
|
-
|
|
328
|
-
`)}function printSchemaDefinition(vo){if(vo.description==null&&isSchemaOfCommonNames(vo))return;const Ai=[],bo=vo.getQueryType();bo&&Ai.push(` query: ${bo.name}`);const Ra=vo.getMutationType();Ra&&Ai.push(` mutation: ${Ra.name}`);const pc=vo.getSubscriptionType();return pc&&Ai.push(` subscription: ${pc.name}`),printDescription(vo)+`schema {
|
|
329
|
-
${Ai.join(`
|
|
330
|
-
`)}
|
|
331
|
-
}`}function isSchemaOfCommonNames(vo){const Ai=vo.getQueryType();if(Ai&&Ai.name!=="Query")return!1;const bo=vo.getMutationType();if(bo&&bo.name!=="Mutation")return!1;const Ra=vo.getSubscriptionType();return!(Ra&&Ra.name!=="Subscription")}function printType(vo){if(isScalarType(vo))return printScalar(vo);if(isObjectType(vo))return printObject(vo);if(isInterfaceType(vo))return printInterface(vo);if(isUnionType(vo))return printUnion(vo);if(isEnumType(vo))return printEnum(vo);if(isInputObjectType(vo))return printInputObject(vo);invariant$1(!1,"Unexpected type: "+inspect(vo))}function printScalar(vo){return printDescription(vo)+`scalar ${vo.name}`+printSpecifiedByURL(vo)}function printImplementedInterfaces(vo){const Ai=vo.getInterfaces();return Ai.length?" implements "+Ai.map(bo=>bo.name).join(" & "):""}function printObject(vo){return printDescription(vo)+`type ${vo.name}`+printImplementedInterfaces(vo)+printFields(vo)}function printInterface(vo){return printDescription(vo)+`interface ${vo.name}`+printImplementedInterfaces(vo)+printFields(vo)}function printUnion(vo){const Ai=vo.getTypes(),bo=Ai.length?" = "+Ai.join(" | "):"";return printDescription(vo)+"union "+vo.name+bo}function printEnum(vo){const Ai=vo.getValues().map((bo,Ra)=>printDescription(bo," ",!Ra)+" "+bo.name+printDeprecated(bo.deprecationReason));return printDescription(vo)+`enum ${vo.name}`+printBlock(Ai)}function printInputObject(vo){const Ai=Object.values(vo.getFields()).map((bo,Ra)=>printDescription(bo," ",!Ra)+" "+printInputValue(bo));return printDescription(vo)+`input ${vo.name}`+(vo.isOneOf?" @oneOf":"")+printBlock(Ai)}function printFields(vo){const Ai=Object.values(vo.getFields()).map((bo,Ra)=>printDescription(bo," ",!Ra)+" "+bo.name+printArgs(bo.args," ")+": "+String(bo.type)+printDeprecated(bo.deprecationReason));return printBlock(Ai)}function printBlock(vo){return vo.length!==0?` {
|
|
332
|
-
`+vo.join(`
|
|
333
|
-
`)+`
|
|
334
|
-
}`:""}function printArgs(vo,Ai=""){return vo.length===0?"":vo.every(bo=>!bo.description)?"("+vo.map(printInputValue).join(", ")+")":`(
|
|
335
|
-
`+vo.map((bo,Ra)=>printDescription(bo," "+Ai,!Ra)+" "+Ai+printInputValue(bo)).join(`
|
|
336
|
-
`)+`
|
|
337
|
-
`+Ai+")"}function printInputValue(vo){const Ai=astFromValue(vo.defaultValue,vo.type);let bo=vo.name+": "+String(vo.type);return Ai&&(bo+=` = ${print(Ai)}`),bo+printDeprecated(vo.deprecationReason)}function printDirective(vo){return printDescription(vo)+"directive @"+vo.name+printArgs(vo.args)+(vo.isRepeatable?" repeatable":"")+" on "+vo.locations.join(" | ")}function printDeprecated(vo){return vo==null?"":vo!==DEFAULT_DEPRECATION_REASON?` @deprecated(reason: ${print({kind:Kind.STRING,value:vo})})`:" @deprecated"}function printSpecifiedByURL(vo){return vo.specifiedByURL==null?"":` @specifiedBy(url: ${print({kind:Kind.STRING,value:vo.specifiedByURL})})`}function printDescription(vo,Ai="",bo=!0){const{description:Ra}=vo;if(Ra==null)return"";const pc=print({kind:Kind.STRING,value:Ra,block:isPrintableAsBlockString(Ra)});return(Ai&&!bo?`
|
|
338
|
-
`+Ai:Ai)+pc.replace(/\n/g,`
|
|
339
|
-
`+Ai)+`
|
|
340
|
-
`}function makeStateObject(vo,Ai){const bo=makeStateObjectName(vo,Ai),Ra={kind:Kind.OBJECT_TYPE_DEFINITION,name:{kind:Kind.NAME,value:bo},fields:[{description:{kind:Kind.STRING,value:`Add your ${Ai} state fields here`,block:!1},kind:Kind.FIELD_DEFINITION,name:{kind:Kind.NAME,value:"_placeholder"},type:{kind:Kind.NAMED_TYPE,name:{kind:Kind.NAME,value:"String"}}}]};return print(Ra)}function makeEmptyInputObject(vo){const Ai={kind:Kind.INPUT_OBJECT_TYPE_DEFINITION,name:{kind:Kind.NAME,value:vo},fields:[{description:{kind:Kind.STRING,value:"Add your inputs here",block:!1},kind:Kind.INPUT_VALUE_DEFINITION,name:{kind:Kind.NAME,value:"_placeholder"},type:{kind:Kind.NAMED_TYPE,name:{kind:Kind.NAME,value:"String"}}}]};return print(Ai)}function makeOperationInputName(vo){return`${pascalCase(vo)}Input`}function makeStateObjectName(vo,Ai){return`${pascalCase(vo)}${Ai==="local"?"Local":""}State`}function makeOperationInitialDoc(vo){const Ai=makeOperationInputName(vo);return makeEmptyInputObject(Ai)}function makeInitialSchemaDoc(vo,Ai){return makeStateObject(vo,Ai)}function isValidScalarValue(vo,Ai){if(vo in customScalars){const bo=customScalars[vo];if(bo instanceof GraphQLScalarType)return bo.parseValue(Ai)!==void 0}switch(vo){case"Int":return Number.isInteger(Ai);case"Float":return typeof Ai=="number";case"Boolean":return typeof Ai=="boolean";case"DateTime":return typeof Ai=="string"&&!isNaN(Date.parse(Ai));case"ID":case"String":default:return typeof Ai=="string"}}function getMinimalValue(vo,Ai,bo){const Ra=getNullableType(vo);if(isScalarType(Ra)){const pc=Ra.name;if(bo!==void 0&&isValidScalarValue(pc,bo))return bo;switch(pc){case"Int":case"Float":return 0;case"Boolean":return!1;case"DateTime":return new Date().toISOString();case"ID":case"String":default:return""}}if(isEnumType(Ra)){const pc=Ra.getValues().map(mc=>mc.value);return bo!==void 0&&pc.includes(bo)?bo:pc[0]||null}if(isListType(Ra))return bo!==void 0&&Array.isArray(bo)?bo:[];if(isObjectType(Ra)){const pc={},mc=Ra.getFields(),uf=bo;for(const df in mc){const ff=mc[df],hf=uf?uf[df]:void 0;pc[df]=getMinimalValue(ff.type,Ai,hf)}return pc}return null}function makeMinimalObjectFromSDL(vo,Ai,bo){const Ra=buildASTSchema(parse(vo)),pc=parse(Ai),mc=[];if(pc.definitions.forEach(pf=>{(pf.kind===Kind.OBJECT_TYPE_DEFINITION||pf.kind===Kind.OBJECT_TYPE_EXTENSION)&&mc.push(pf.name.value)}),mc.length===0)throw new Error("No object type definition found in SDL.");const uf=mc[0];let df=Ra.getType(uf),ff=Ra;if((!df||!isObjectType(df))&&(ff=extendSchema(Ra,pc),df=ff.getType(uf)),!df||!isObjectType(df))throw new Error(`Type "${uf}" is not a valid ObjectType.`);const hf=getMinimalValue(df,ff,bo);return JSON.stringify(hf,null,2)}function removeWhitespace(vo){return vo.replace(/\s+|\\n|\\t/g,"").toLowerCase()}function compareStringsWithoutWhitespace(vo,Ai){return removeWhitespace(vo)===removeWhitespace(Ai)}function renameSchemaType(vo,Ai,bo,Ra){const pc=Ra==="global"?"State":"LocalState",mc=`${pascalCase(Ai)}${pc}`,uf=`${pascalCase(bo)}${pc}`,df=parse(vo),ff=visit(df,{ObjectTypeDefinition:hf=>{if(hf.name.value===mc)return{...hf,name:{...hf.name,value:uf}}}});return print(ff)}function initializeModelSchema(vo){const{modelName:Ai,setStateSchema:bo}=vo,Ra=makeInitialSchemaDoc(Ai,"global");bo(Ra,"global")}function updateModelSchemaNames(vo){const{oldName:Ai,newName:bo,globalStateSchema:Ra,localStateSchema:pc,setStateSchema:mc}=vo,uf=renameSchemaType(Ra,Ai,bo,"global");if(mc(uf,"global"),pc){const df=renameSchemaType(pc,Ai,bo,"local");mc(df,"local")}}function handleModelNameChange(vo){const{oldName:Ai,newName:bo,globalStateSchema:Ra,setStateSchema:pc}=vo;if(!Ra){initializeModelSchema({modelName:bo,setStateSchema:pc});return}updateModelSchemaNames(vo)}const labelVariants=cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Label=y$2.forwardRef(({className:vo,...Ai},bo)=>jsx(Root,{ref:bo,className:cn(labelVariants(),vo),...Ai}));Label.displayName=Root.displayName;var validator$1={exports:{}},toDate={exports:{}},assertString={exports:{}},hasRequiredAssertString;function requireAssertString(){return hasRequiredAssertString||(hasRequiredAssertString=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=Ra;function bo(pc){"@babel/helpers - typeof";return bo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(mc){return typeof mc}:function(mc){return mc&&typeof Symbol=="function"&&mc.constructor===Symbol&&mc!==Symbol.prototype?"symbol":typeof mc},bo(pc)}function Ra(pc){var mc=typeof pc=="string"||pc instanceof String;if(!mc){var uf=bo(pc);throw pc===null?uf="null":uf==="object"&&(uf=pc.constructor.name),new TypeError("Expected a string but received a ".concat(uf))}}vo.exports=Ai.default,vo.exports.default=Ai.default}(assertString,assertString.exports)),assertString.exports}var hasRequiredToDate;function requireToDate(){return hasRequiredToDate||(hasRequiredToDate=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=pc;var bo=Ra(requireAssertString());function Ra(mc){return mc&&mc.__esModule?mc:{default:mc}}function pc(mc){return(0,bo.default)(mc),mc=Date.parse(mc),isNaN(mc)?null:new Date(mc)}vo.exports=Ai.default,vo.exports.default=Ai.default}(toDate,toDate.exports)),toDate.exports}var toFloat={exports:{}},isFloat={},alpha={},hasRequiredAlpha;function requireAlpha(){if(hasRequiredAlpha)return alpha;hasRequiredAlpha=1,Object.defineProperty(alpha,"__esModule",{value:!0}),alpha.farsiLocales=alpha.englishLocales=alpha.dotDecimal=alpha.decimal=alpha.commaDecimal=alpha.bengaliLocales=alpha.arabicLocales=alpha.alphanumeric=alpha.alpha=void 0;for(var vo=alpha.alpha={"en-US":/^[A-Z]+$/i,"az-AZ":/^[A-VXYZÇƏĞİıÖŞÜ]+$/i,"bg-BG":/^[А-Я]+$/i,"cs-CZ":/^[A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]+$/i,"da-DK":/^[A-ZÆØÅ]+$/i,"de-DE":/^[A-ZÄÖÜß]+$/i,"el-GR":/^[Α-ώ]+$/i,"es-ES":/^[A-ZÁÉÍÑÓÚÜ]+$/i,"fa-IR":/^[ابپتثجچحخدذرزژسشصضطظعغفقکگلمنوهی]+$/i,"fi-FI":/^[A-ZÅÄÖ]+$/i,"fr-FR":/^[A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,"it-IT":/^[A-ZÀÉÈÌÎÓÒÙ]+$/i,"ja-JP":/^[ぁ-んァ-ヶヲ-゚一-龠ー・。、]+$/i,"nb-NO":/^[A-ZÆØÅ]+$/i,"nl-NL":/^[A-ZÁÉËÏÓÖÜÚ]+$/i,"nn-NO":/^[A-ZÆØÅ]+$/i,"hu-HU":/^[A-ZÁÉÍÓÖŐÚÜŰ]+$/i,"pl-PL":/^[A-ZĄĆĘŚŁŃÓŻŹ]+$/i,"pt-PT":/^[A-ZÃÁÀÂÄÇÉÊËÍÏÕÓÔÖÚÜ]+$/i,"ru-RU":/^[А-ЯЁ]+$/i,"kk-KZ":/^[А-ЯЁ\u04D8\u04B0\u0406\u04A2\u0492\u04AE\u049A\u04E8\u04BA]+$/i,"sl-SI":/^[A-ZČĆĐŠŽ]+$/i,"sk-SK":/^[A-ZÁČĎÉÍŇÓŠŤÚÝŽĹŔĽÄÔ]+$/i,"sr-RS@latin":/^[A-ZČĆŽŠĐ]+$/i,"sr-RS":/^[А-ЯЂЈЉЊЋЏ]+$/i,"sv-SE":/^[A-ZÅÄÖ]+$/i,"th-TH":/^[ก-๐\s]+$/i,"tr-TR":/^[A-ZÇĞİıÖŞÜ]+$/i,"uk-UA":/^[А-ЩЬЮЯЄIЇҐі]+$/i,"vi-VN":/^[A-ZÀÁẠẢÃÂẦẤẬẨẪĂẰẮẶẲẴĐÈÉẸẺẼÊỀẾỆỂỄÌÍỊỈĨÒÓỌỎÕÔỒỐỘỔỖƠỜỚỢỞỠÙÚỤỦŨƯỪỨỰỬỮỲÝỴỶỸ]+$/i,"ko-KR":/^[ㄱ-ㅎㅏ-ㅣ가-힣]*$/,"ku-IQ":/^[ئابپتجچحخدرڕزژسشعغفڤقکگلڵمنوۆھەیێيطؤثآإأكضصةظذ]+$/i,ar:/^[ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]+$/,he:/^[א-ת]+$/,fa:/^['آاءأؤئبپتثجچحخدذرزژسشصضطظعغفقکگلمنوهةی']+$/i,bn:/^['ঀঁংঃঅআইঈউঊঋঌএঐওঔকখগঘঙচছজঝঞটঠডঢণতথদধনপফবভমযরলশষসহ়ঽািীুূৃৄেৈোৌ্ৎৗড়ঢ়য়ৠৡৢৣৰৱ৲৳৴৵৶৷৸৹৺৻']+$/,eo:/^[ABCĈD-GĜHĤIJĴK-PRSŜTUŬVZ]+$/i,"hi-IN":/^[\u0900-\u0961]+[\u0972-\u097F]*$/i,"si-LK":/^[\u0D80-\u0DFF]+$/},Ai=alpha.alphanumeric={"en-US":/^[0-9A-Z]+$/i,"az-AZ":/^[0-9A-VXYZÇƏĞİıÖŞÜ]+$/i,"bg-BG":/^[0-9А-Я]+$/i,"cs-CZ":/^[0-9A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]+$/i,"da-DK":/^[0-9A-ZÆØÅ]+$/i,"de-DE":/^[0-9A-ZÄÖÜß]+$/i,"el-GR":/^[0-9Α-ω]+$/i,"es-ES":/^[0-9A-ZÁÉÍÑÓÚÜ]+$/i,"fi-FI":/^[0-9A-ZÅÄÖ]+$/i,"fr-FR":/^[0-9A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,"it-IT":/^[0-9A-ZÀÉÈÌÎÓÒÙ]+$/i,"ja-JP":/^[0-90-9ぁ-んァ-ヶヲ-゚一-龠ー・。、]+$/i,"hu-HU":/^[0-9A-ZÁÉÍÓÖŐÚÜŰ]+$/i,"nb-NO":/^[0-9A-ZÆØÅ]+$/i,"nl-NL":/^[0-9A-ZÁÉËÏÓÖÜÚ]+$/i,"nn-NO":/^[0-9A-ZÆØÅ]+$/i,"pl-PL":/^[0-9A-ZĄĆĘŚŁŃÓŻŹ]+$/i,"pt-PT":/^[0-9A-ZÃÁÀÂÄÇÉÊËÍÏÕÓÔÖÚÜ]+$/i,"ru-RU":/^[0-9А-ЯЁ]+$/i,"kk-KZ":/^[0-9А-ЯЁ\u04D8\u04B0\u0406\u04A2\u0492\u04AE\u049A\u04E8\u04BA]+$/i,"sl-SI":/^[0-9A-ZČĆĐŠŽ]+$/i,"sk-SK":/^[0-9A-ZÁČĎÉÍŇÓŠŤÚÝŽĹŔĽÄÔ]+$/i,"sr-RS@latin":/^[0-9A-ZČĆŽŠĐ]+$/i,"sr-RS":/^[0-9А-ЯЂЈЉЊЋЏ]+$/i,"sv-SE":/^[0-9A-ZÅÄÖ]+$/i,"th-TH":/^[ก-๙\s]+$/i,"tr-TR":/^[0-9A-ZÇĞİıÖŞÜ]+$/i,"uk-UA":/^[0-9А-ЩЬЮЯЄIЇҐі]+$/i,"ko-KR":/^[0-9ㄱ-ㅎㅏ-ㅣ가-힣]*$/,"ku-IQ":/^[٠١٢٣٤٥٦٧٨٩0-9ئابپتجچحخدرڕزژسشعغفڤقکگلڵمنوۆھەیێيطؤثآإأكضصةظذ]+$/i,"vi-VN":/^[0-9A-ZÀÁẠẢÃÂẦẤẬẨẪĂẰẮẶẲẴĐÈÉẸẺẼÊỀẾỆỂỄÌÍỊỈĨÒÓỌỎÕÔỒỐỘỔỖƠỜỚỢỞỠÙÚỤỦŨƯỪỨỰỬỮỲÝỴỶỸ]+$/i,ar:/^[٠١٢٣٤٥٦٧٨٩0-9ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]+$/,he:/^[0-9א-ת]+$/,fa:/^['0-9آاءأؤئبپتثجچحخدذرزژسشصضطظعغفقکگلمنوهةی۱۲۳۴۵۶۷۸۹۰']+$/i,bn:/^['ঀঁংঃঅআইঈউঊঋঌএঐওঔকখগঘঙচছজঝঞটঠডঢণতথদধনপফবভমযরলশষসহ়ঽািীুূৃৄেৈোৌ্ৎৗড়ঢ়য়ৠৡৢৣ০১২৩৪৫৬৭৮৯ৰৱ৲৳৴৵৶৷৸৹৺৻']+$/,eo:/^[0-9ABCĈD-GĜHĤIJĴK-PRSŜTUŬVZ]+$/i,"hi-IN":/^[\u0900-\u0963]+[\u0966-\u097F]*$/i,"si-LK":/^[0-9\u0D80-\u0DFF]+$/},bo=alpha.decimal={"en-US":".",ar:"٫"},Ra=alpha.englishLocales=["AU","GB","HK","IN","NZ","ZA","ZM"],pc,mc=0;mc<Ra.length;mc++)pc="en-".concat(Ra[mc]),vo[pc]=vo["en-US"],Ai[pc]=Ai["en-US"],bo[pc]=bo["en-US"];for(var uf=alpha.arabicLocales=["AE","BH","DZ","EG","IQ","JO","KW","LB","LY","MA","QM","QA","SA","SD","SY","TN","YE"],df,ff=0;ff<uf.length;ff++)df="ar-".concat(uf[ff]),vo[df]=vo.ar,Ai[df]=Ai.ar,bo[df]=bo.ar;for(var hf=alpha.farsiLocales=["IR","AF"],pf,mf=0;mf<hf.length;mf++)pf="fa-".concat(hf[mf]),Ai[pf]=Ai.fa,bo[pf]=bo.ar;for(var gf=alpha.bengaliLocales=["BD","IN"],yf,vf=0;vf<gf.length;vf++)yf="bn-".concat(gf[vf]),vo[yf]=vo.bn,Ai[yf]=Ai.bn,bo[yf]=bo["en-US"];for(var bf=alpha.dotDecimal=["ar-EG","ar-LB","ar-LY"],Sf=alpha.commaDecimal=["bg-BG","cs-CZ","da-DK","de-DE","el-GR","en-ZM","eo","es-ES","fr-CA","fr-FR","id-ID","it-IT","ku-IQ","hi-IN","hu-HU","nb-NO","nn-NO","nl-NL","pl-PL","pt-PT","ru-RU","kk-KZ","si-LK","sl-SI","sr-RS@latin","sr-RS","sv-SE","tr-TR","uk-UA","vi-VN"],xf=0;xf<bf.length;xf++)bo[bf[xf]]=bo["en-US"];for(var wf=0;wf<Sf.length;wf++)bo[Sf[wf]]=",";return vo["fr-CA"]=vo["fr-FR"],Ai["fr-CA"]=Ai["fr-FR"],vo["pt-BR"]=vo["pt-PT"],Ai["pt-BR"]=Ai["pt-PT"],bo["pt-BR"]=bo["pt-PT"],vo["pl-Pl"]=vo["pl-PL"],Ai["pl-Pl"]=Ai["pl-PL"],bo["pl-Pl"]=bo["pl-PL"],vo["fa-AF"]=vo.fa,alpha}var hasRequiredIsFloat;function requireIsFloat(){if(hasRequiredIsFloat)return isFloat;hasRequiredIsFloat=1,Object.defineProperty(isFloat,"__esModule",{value:!0}),isFloat.default=Ra,isFloat.locales=void 0;var vo=bo(requireAssertString()),Ai=requireAlpha();function bo(pc){return pc&&pc.__esModule?pc:{default:pc}}function Ra(pc,mc){(0,vo.default)(pc),mc=mc||{};var uf=new RegExp("^(?:[-+])?(?:[0-9]+)?(?:\\".concat(mc.locale?Ai.decimal[mc.locale]:".","[0-9]*)?(?:[eE][\\+\\-]?(?:[0-9]+))?$"));if(pc===""||pc==="."||pc===","||pc==="-"||pc==="+")return!1;var df=parseFloat(pc.replace(",","."));return uf.test(pc)&&(!mc.hasOwnProperty("min")||df>=mc.min)&&(!mc.hasOwnProperty("max")||df<=mc.max)&&(!mc.hasOwnProperty("lt")||df<mc.lt)&&(!mc.hasOwnProperty("gt")||df>mc.gt)}return isFloat.locales=Object.keys(Ai.decimal),isFloat}var hasRequiredToFloat;function requireToFloat(){return hasRequiredToFloat||(hasRequiredToFloat=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=pc;var bo=Ra(requireIsFloat());function Ra(mc){return mc&&mc.__esModule?mc:{default:mc}}function pc(mc){return(0,bo.default)(mc)?parseFloat(mc):NaN}vo.exports=Ai.default,vo.exports.default=Ai.default}(toFloat,toFloat.exports)),toFloat.exports}var toInt={exports:{}},hasRequiredToInt;function requireToInt(){return hasRequiredToInt||(hasRequiredToInt=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=pc;var bo=Ra(requireAssertString());function Ra(mc){return mc&&mc.__esModule?mc:{default:mc}}function pc(mc,uf){return(0,bo.default)(mc),parseInt(mc,uf||10)}vo.exports=Ai.default,vo.exports.default=Ai.default}(toInt,toInt.exports)),toInt.exports}var toBoolean={exports:{}},hasRequiredToBoolean;function requireToBoolean(){return hasRequiredToBoolean||(hasRequiredToBoolean=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=pc;var bo=Ra(requireAssertString());function Ra(mc){return mc&&mc.__esModule?mc:{default:mc}}function pc(mc,uf){return(0,bo.default)(mc),uf?mc==="1"||/^true$/i.test(mc):mc!=="0"&&!/^false$/i.test(mc)&&mc!==""}vo.exports=Ai.default,vo.exports.default=Ai.default}(toBoolean,toBoolean.exports)),toBoolean.exports}var equals={exports:{}},hasRequiredEquals;function requireEquals(){return hasRequiredEquals||(hasRequiredEquals=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=pc;var bo=Ra(requireAssertString());function Ra(mc){return mc&&mc.__esModule?mc:{default:mc}}function pc(mc,uf){return(0,bo.default)(mc),mc===uf}vo.exports=Ai.default,vo.exports.default=Ai.default}(equals,equals.exports)),equals.exports}var contains$1={exports:{}},toString$1={exports:{}},hasRequiredToString;function requireToString(){return hasRequiredToString||(hasRequiredToString=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=Ra;function bo(pc){"@babel/helpers - typeof";return bo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(mc){return typeof mc}:function(mc){return mc&&typeof Symbol=="function"&&mc.constructor===Symbol&&mc!==Symbol.prototype?"symbol":typeof mc},bo(pc)}function Ra(pc){return bo(pc)==="object"&&pc!==null?typeof pc.toString=="function"?pc=pc.toString():pc="[object Object]":(pc===null||typeof pc>"u"||isNaN(pc)&&!pc.length)&&(pc=""),String(pc)}vo.exports=Ai.default,vo.exports.default=Ai.default}(toString$1,toString$1.exports)),toString$1.exports}var merge={exports:{}},hasRequiredMerge;function requireMerge(){return hasRequiredMerge||(hasRequiredMerge=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=bo;function bo(){var Ra=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},pc=arguments.length>1?arguments[1]:void 0;for(var mc in pc)typeof Ra[mc]>"u"&&(Ra[mc]=pc[mc]);return Ra}vo.exports=Ai.default,vo.exports.default=Ai.default}(merge,merge.exports)),merge.exports}var hasRequiredContains;function requireContains(){return hasRequiredContains||(hasRequiredContains=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=df;var bo=mc(requireAssertString()),Ra=mc(requireToString()),pc=mc(requireMerge());function mc(ff){return ff&&ff.__esModule?ff:{default:ff}}var uf={ignoreCase:!1,minOccurrences:1};function df(ff,hf,pf){return(0,bo.default)(ff),pf=(0,pc.default)(pf,uf),pf.ignoreCase?ff.toLowerCase().split((0,Ra.default)(hf).toLowerCase()).length>pf.minOccurrences:ff.split((0,Ra.default)(hf)).length>pf.minOccurrences}vo.exports=Ai.default,vo.exports.default=Ai.default}(contains$1,contains$1.exports)),contains$1.exports}var matches={exports:{}},hasRequiredMatches;function requireMatches(){return hasRequiredMatches||(hasRequiredMatches=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=pc;var bo=Ra(requireAssertString());function Ra(mc){return mc&&mc.__esModule?mc:{default:mc}}function pc(mc,uf,df){return(0,bo.default)(mc),Object.prototype.toString.call(uf)!=="[object RegExp]"&&(uf=new RegExp(uf,df)),!!mc.match(uf)}vo.exports=Ai.default,vo.exports.default=Ai.default}(matches,matches.exports)),matches.exports}var isEmail={exports:{}},isByteLength={exports:{}},hasRequiredIsByteLength;function requireIsByteLength(){return hasRequiredIsByteLength||(hasRequiredIsByteLength=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=mc;var bo=Ra(requireAssertString());function Ra(uf){return uf&&uf.__esModule?uf:{default:uf}}function pc(uf){"@babel/helpers - typeof";return pc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(df){return typeof df}:function(df){return df&&typeof Symbol=="function"&&df.constructor===Symbol&&df!==Symbol.prototype?"symbol":typeof df},pc(uf)}function mc(uf,df){(0,bo.default)(uf);var ff,hf;pc(df)==="object"?(ff=df.min||0,hf=df.max):(ff=arguments[1],hf=arguments[2]);var pf=encodeURI(uf).split(/%..|./).length-1;return pf>=ff&&(typeof hf>"u"||pf<=hf)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isByteLength,isByteLength.exports)),isByteLength.exports}var isFQDN={exports:{}},hasRequiredIsFQDN;function requireIsFQDN(){return hasRequiredIsFQDN||(hasRequiredIsFQDN=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=uf;var bo=pc(requireAssertString()),Ra=pc(requireMerge());function pc(df){return df&&df.__esModule?df:{default:df}}var mc={require_tld:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_numeric_tld:!1,allow_wildcard:!1,ignore_max_length:!1};function uf(df,ff){(0,bo.default)(df),ff=(0,Ra.default)(ff,mc),ff.allow_trailing_dot&&df[df.length-1]==="."&&(df=df.substring(0,df.length-1)),ff.allow_wildcard===!0&&df.indexOf("*.")===0&&(df=df.substring(2));var hf=df.split("."),pf=hf[hf.length-1];return ff.require_tld&&(hf.length<2||!ff.allow_numeric_tld&&!/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(pf)||/\s/.test(pf))||!ff.allow_numeric_tld&&/^\d+$/.test(pf)?!1:hf.every(function(mf){return!(mf.length>63&&!ff.ignore_max_length||!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(mf)||/[\uff01-\uff5e]/.test(mf)||/^-|-$/.test(mf)||!ff.allow_underscores&&/_/.test(mf))})}vo.exports=Ai.default,vo.exports.default=Ai.default}(isFQDN,isFQDN.exports)),isFQDN.exports}var isIP={exports:{}},hasRequiredIsIP;function requireIsIP(){return hasRequiredIsIP||(hasRequiredIsIP=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=hf;var bo=Ra(requireAssertString());function Ra(pf){return pf&&pf.__esModule?pf:{default:pf}}var pc="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",mc="(".concat(pc,"[.]){3}").concat(pc),uf=new RegExp("^".concat(mc,"$")),df="(?:[0-9a-fA-F]{1,4})",ff=new RegExp("^("+"(?:".concat(df,":){7}(?:").concat(df,"|:)|")+"(?:".concat(df,":){6}(?:").concat(mc,"|:").concat(df,"|:)|")+"(?:".concat(df,":){5}(?::").concat(mc,"|(:").concat(df,"){1,2}|:)|")+"(?:".concat(df,":){4}(?:(:").concat(df,"){0,1}:").concat(mc,"|(:").concat(df,"){1,3}|:)|")+"(?:".concat(df,":){3}(?:(:").concat(df,"){0,2}:").concat(mc,"|(:").concat(df,"){1,4}|:)|")+"(?:".concat(df,":){2}(?:(:").concat(df,"){0,3}:").concat(mc,"|(:").concat(df,"){1,5}|:)|")+"(?:".concat(df,":){1}(?:(:").concat(df,"){0,4}:").concat(mc,"|(:").concat(df,"){1,6}|:)|")+"(?::((?::".concat(df,"){0,5}:").concat(mc,"|(?::").concat(df,"){1,7}|:))")+")(%[0-9a-zA-Z-.:]{1,})?$");function hf(pf){var mf=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return(0,bo.default)(pf),mf=String(mf),mf?mf==="4"?uf.test(pf):mf==="6"?ff.test(pf):!1:hf(pf,4)||hf(pf,6)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isIP,isIP.exports)),isIP.exports}var hasRequiredIsEmail;function requireIsEmail(){return hasRequiredIsEmail||(hasRequiredIsEmail=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=xf;var bo=df(requireAssertString()),Ra=df(requireIsByteLength()),pc=df(requireIsFQDN()),mc=df(requireIsIP()),uf=df(requireMerge());function df(wf){return wf&&wf.__esModule?wf:{default:wf}}var ff={allow_display_name:!1,allow_underscores:!1,require_display_name:!1,allow_utf8_local_part:!0,require_tld:!0,blacklisted_chars:"",ignore_max_length:!1,host_blacklist:[],host_whitelist:[]},hf=/^([^\x00-\x1F\x7F-\x9F\cX]+)</i,pf=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i,mf=/^[a-z\d]+$/,gf=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f]))*$/i,yf=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\u00A1-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/i,vf=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*$/i,bf=254;function Sf(wf){var If=wf.replace(/^"(.+)"$/,"$1");if(!If.trim())return!1;var l1=/[\.";<>]/.test(If);if(l1){if(If===wf)return!1;var s1=If.split('"').length===If.split('\\"').length;if(!s1)return!1}return!0}function xf(wf,If){if((0,bo.default)(wf),If=(0,uf.default)(If,ff),If.require_display_name||If.allow_display_name){var l1=wf.match(hf);if(l1){var s1=l1[1];if(wf=wf.replace(s1,"").replace(/(^<|>$)/g,""),s1.endsWith(" ")&&(s1=s1.slice(0,-1)),!Sf(s1))return!1}else if(If.require_display_name)return!1}if(!If.ignore_max_length&&wf.length>bf)return!1;var c1=wf.split("@"),u1=c1.pop(),T1=u1.toLowerCase();if(If.host_blacklist.includes(T1)||If.host_whitelist.length>0&&!If.host_whitelist.includes(T1))return!1;var _1=c1.join("@");if(If.domain_specific_validation&&(T1==="gmail.com"||T1==="googlemail.com")){_1=_1.toLowerCase();var R1=_1.split("+")[0];if(!(0,Ra.default)(R1.replace(/\./g,""),{min:6,max:30}))return!1;for(var P1=R1.split("."),E1=0;E1<P1.length;E1++)if(!mf.test(P1[E1]))return!1}if(If.ignore_max_length===!1&&(!(0,Ra.default)(_1,{max:64})||!(0,Ra.default)(u1,{max:254})))return!1;if(!(0,pc.default)(u1,{require_tld:If.require_tld,ignore_max_length:If.ignore_max_length,allow_underscores:If.allow_underscores})){if(!If.allow_ip_domain)return!1;if(!(0,mc.default)(u1)){if(!u1.startsWith("[")||!u1.endsWith("]"))return!1;var M1=u1.slice(1,-1);if(M1.length===0||!(0,mc.default)(M1))return!1}}if(_1[0]==='"')return _1=_1.slice(1,_1.length-1),If.allow_utf8_local_part?vf.test(_1):gf.test(_1);for(var m1=If.allow_utf8_local_part?yf:pf,$1=_1.split("."),k1=0;k1<$1.length;k1++)if(!m1.test($1[k1]))return!1;return!(If.blacklisted_chars&&_1.search(new RegExp("[".concat(If.blacklisted_chars,"]+"),"g"))!==-1)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isEmail,isEmail.exports)),isEmail.exports}var isURL$1={exports:{}},hasRequiredIsURL;function requireIsURL(){return hasRequiredIsURL||(hasRequiredIsURL=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=xf;var bo=uf(requireAssertString()),Ra=uf(requireIsFQDN()),pc=uf(requireIsIP()),mc=uf(requireMerge());function uf(wf){return wf&&wf.__esModule?wf:{default:wf}}function df(wf,If){return gf(wf)||mf(wf,If)||hf(wf,If)||ff()}function ff(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
341
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hf(wf,If){if(wf){if(typeof wf=="string")return pf(wf,If);var l1=Object.prototype.toString.call(wf).slice(8,-1);if(l1==="Object"&&wf.constructor&&(l1=wf.constructor.name),l1==="Map"||l1==="Set")return Array.from(wf);if(l1==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l1))return pf(wf,If)}}function pf(wf,If){(If==null||If>wf.length)&&(If=wf.length);for(var l1=0,s1=new Array(If);l1<If;l1++)s1[l1]=wf[l1];return s1}function mf(wf,If){var l1=wf==null?null:typeof Symbol<"u"&&wf[Symbol.iterator]||wf["@@iterator"];if(l1!=null){var s1,c1,u1,T1,_1=[],R1=!0,P1=!1;try{if(u1=(l1=l1.call(wf)).next,If!==0)for(;!(R1=(s1=u1.call(l1)).done)&&(_1.push(s1.value),_1.length!==If);R1=!0);}catch(E1){P1=!0,c1=E1}finally{try{if(!R1&&l1.return!=null&&(T1=l1.return(),Object(T1)!==T1))return}finally{if(P1)throw c1}}return _1}}function gf(wf){if(Array.isArray(wf))return wf}var yf={protocols:["http","https","ftp"],require_tld:!0,require_protocol:!1,require_host:!0,require_port:!1,require_valid_protocol:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_protocol_relative_urls:!1,allow_fragments:!0,allow_query_components:!0,validate_length:!0},vf=/^\[([^\]]+)\](?::([0-9]+))?$/;function bf(wf){return Object.prototype.toString.call(wf)==="[object RegExp]"}function Sf(wf,If){for(var l1=0;l1<If.length;l1++){var s1=If[l1];if(wf===s1||bf(s1)&&s1.test(wf))return!0}return!1}function xf(wf,If){if((0,bo.default)(wf),!wf||/[\s<>]/.test(wf)||wf.indexOf("mailto:")===0||(If=(0,mc.default)(If,yf),If.validate_length&&wf.length>=2083)||!If.allow_fragments&&wf.includes("#")||!If.allow_query_components&&(wf.includes("?")||wf.includes("&")))return!1;var l1,s1,c1,u1,T1,_1,R1,P1;if(R1=wf.split("#"),wf=R1.shift(),R1=wf.split("?"),wf=R1.shift(),R1=wf.split("://"),R1.length>1){if(l1=R1.shift().toLowerCase(),If.require_valid_protocol&&If.protocols.indexOf(l1)===-1)return!1}else{if(If.require_protocol)return!1;if(wf.slice(0,2)==="//"){if(!If.allow_protocol_relative_urls)return!1;R1[0]=wf.slice(2)}}if(wf=R1.join("://"),wf==="")return!1;if(R1=wf.split("/"),wf=R1.shift(),wf===""&&!If.require_host)return!0;if(R1=wf.split("@"),R1.length>1){if(If.disallow_auth||R1[0]===""||(s1=R1.shift(),s1.indexOf(":")>=0&&s1.split(":").length>2))return!1;var E1=s1.split(":"),M1=df(E1,2),m1=M1[0],$1=M1[1];if(m1===""&&$1==="")return!1}u1=R1.join("@"),_1=null,P1=null;var k1=u1.match(vf);if(k1?(c1="",P1=k1[1],_1=k1[2]||null):(R1=u1.split(":"),c1=R1.shift(),R1.length&&(_1=R1.join(":"))),_1!==null&&_1.length>0){if(T1=parseInt(_1,10),!/^[0-9]+$/.test(_1)||T1<=0||T1>65535)return!1}else if(If.require_port)return!1;return If.host_whitelist?Sf(c1,If.host_whitelist):c1===""&&!If.require_host?!0:!(!(0,pc.default)(c1)&&!(0,Ra.default)(c1,If)&&(!P1||!(0,pc.default)(P1,6))||(c1=c1||P1,If.host_blacklist&&Sf(c1,If.host_blacklist)))}vo.exports=Ai.default,vo.exports.default=Ai.default}(isURL$1,isURL$1.exports)),isURL$1.exports}var isMACAddress={exports:{}},hasRequiredIsMACAddress;function requireIsMACAddress(){return hasRequiredIsMACAddress||(hasRequiredIsMACAddress=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=pf;var bo=Ra(requireAssertString());function Ra(mf){return mf&&mf.__esModule?mf:{default:mf}}var pc=/^(?:[0-9a-fA-F]{2}([-:\s]))([0-9a-fA-F]{2}\1){4}([0-9a-fA-F]{2})$/,mc=/^([0-9a-fA-F]){12}$/,uf=/^([0-9a-fA-F]{4}\.){2}([0-9a-fA-F]{4})$/,df=/^(?:[0-9a-fA-F]{2}([-:\s]))([0-9a-fA-F]{2}\1){6}([0-9a-fA-F]{2})$/,ff=/^([0-9a-fA-F]){16}$/,hf=/^([0-9a-fA-F]{4}\.){3}([0-9a-fA-F]{4})$/;function pf(mf,gf){return(0,bo.default)(mf),gf!=null&&gf.eui&&(gf.eui=String(gf.eui)),gf!=null&&gf.no_colons||gf!=null&&gf.no_separators?gf.eui==="48"?mc.test(mf):gf.eui==="64"?ff.test(mf):mc.test(mf)||ff.test(mf):(gf==null?void 0:gf.eui)==="48"?pc.test(mf)||uf.test(mf):(gf==null?void 0:gf.eui)==="64"?df.test(mf)||hf.test(mf):pf(mf,{eui:"48"})||pf(mf,{eui:"64"})}vo.exports=Ai.default,vo.exports.default=Ai.default}(isMACAddress,isMACAddress.exports)),isMACAddress.exports}var isIPRange={exports:{}},hasRequiredIsIPRange;function requireIsIPRange(){return hasRequiredIsIPRange||(hasRequiredIsIPRange=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=ff;var bo=pc(requireAssertString()),Ra=pc(requireIsIP());function pc(hf){return hf&&hf.__esModule?hf:{default:hf}}var mc=/^\d{1,3}$/,uf=32,df=128;function ff(hf){var pf=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(0,bo.default)(hf);var mf=hf.split("/");if(mf.length!==2||!mc.test(mf[1])||mf[1].length>1&&mf[1].startsWith("0"))return!1;var gf=(0,Ra.default)(mf[0],pf);if(!gf)return!1;var yf=null;switch(String(pf)){case"4":yf=uf;break;case"6":yf=df;break;default:yf=(0,Ra.default)(mf[0],"6")?df:uf}return mf[1]<=yf&&mf[1]>=0}vo.exports=Ai.default,vo.exports.default=Ai.default}(isIPRange,isIPRange.exports)),isIPRange.exports}var isDate={exports:{}},hasRequiredIsDate;function requireIsDate(){return hasRequiredIsDate||(hasRequiredIsDate=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=vf;var bo=Ra(requireMerge());function Ra(bf){return bf&&bf.__esModule?bf:{default:bf}}function pc(bf,Sf){return df(bf)||uf(bf,Sf)||hf(bf,Sf)||mc()}function mc(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
342
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uf(bf,Sf){var xf=bf==null?null:typeof Symbol<"u"&&bf[Symbol.iterator]||bf["@@iterator"];if(xf!=null){var wf,If,l1,s1,c1=[],u1=!0,T1=!1;try{if(l1=(xf=xf.call(bf)).next,Sf!==0)for(;!(u1=(wf=l1.call(xf)).done)&&(c1.push(wf.value),c1.length!==Sf);u1=!0);}catch(_1){T1=!0,If=_1}finally{try{if(!u1&&xf.return!=null&&(s1=xf.return(),Object(s1)!==s1))return}finally{if(T1)throw If}}return c1}}function df(bf){if(Array.isArray(bf))return bf}function ff(bf,Sf){var xf=typeof Symbol<"u"&&bf[Symbol.iterator]||bf["@@iterator"];if(!xf){if(Array.isArray(bf)||(xf=hf(bf))||Sf){xf&&(bf=xf);var wf=0,If=function(){};return{s:If,n:function(){return wf>=bf.length?{done:!0}:{done:!1,value:bf[wf++]}},e:function(u1){throw u1},f:If}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
343
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var l1=!0,s1=!1,c1;return{s:function(){xf=xf.call(bf)},n:function(){var u1=xf.next();return l1=u1.done,u1},e:function(u1){s1=!0,c1=u1},f:function(){try{!l1&&xf.return!=null&&xf.return()}finally{if(s1)throw c1}}}}function hf(bf,Sf){if(bf){if(typeof bf=="string")return pf(bf,Sf);var xf=Object.prototype.toString.call(bf).slice(8,-1);if(xf==="Object"&&bf.constructor&&(xf=bf.constructor.name),xf==="Map"||xf==="Set")return Array.from(bf);if(xf==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(xf))return pf(bf,Sf)}}function pf(bf,Sf){(Sf==null||Sf>bf.length)&&(Sf=bf.length);for(var xf=0,wf=new Array(Sf);xf<Sf;xf++)wf[xf]=bf[xf];return wf}var mf={format:"YYYY/MM/DD",delimiters:["/","-"],strictMode:!1};function gf(bf){return/(^(y{4}|y{2})[.\/-](m{1,2})[.\/-](d{1,2})$)|(^(m{1,2})[.\/-](d{1,2})[.\/-]((y{4}|y{2})$))|(^(d{1,2})[.\/-](m{1,2})[.\/-]((y{4}|y{2})$))/gi.test(bf)}function yf(bf,Sf){for(var xf=[],wf=Math.min(bf.length,Sf.length),If=0;If<wf;If++)xf.push([bf[If],Sf[If]]);return xf}function vf(bf,Sf){if(typeof Sf=="string"?Sf=(0,bo.default)({format:Sf},mf):Sf=(0,bo.default)(Sf,mf),typeof bf=="string"&&gf(Sf.format)){var xf=Sf.delimiters.find(function($1){return Sf.format.indexOf($1)!==-1}),wf=Sf.strictMode?xf:Sf.delimiters.find(function($1){return bf.indexOf($1)!==-1}),If=yf(bf.split(wf),Sf.format.toLowerCase().split(xf)),l1={},s1=ff(If),c1;try{for(s1.s();!(c1=s1.n()).done;){var u1=pc(c1.value,2),T1=u1[0],_1=u1[1];if(T1.length!==_1.length)return!1;l1[_1.charAt(0)]=T1}}catch($1){s1.e($1)}finally{s1.f()}var R1=l1.y;if(R1.startsWith("-"))return!1;if(l1.y.length===2){var P1=parseInt(l1.y,10);if(isNaN(P1))return!1;var E1=new Date().getFullYear()%100;P1<E1?R1="20".concat(l1.y):R1="19".concat(l1.y)}var M1=l1.m;l1.m.length===1&&(M1="0".concat(l1.m));var m1=l1.d;return l1.d.length===1&&(m1="0".concat(l1.d)),new Date("".concat(R1,"-").concat(M1,"-").concat(m1,"T00:00:00.000Z")).getUTCDate()===+l1.d}return Sf.strictMode?!1:Object.prototype.toString.call(bf)==="[object Date]"&&isFinite(bf)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isDate,isDate.exports)),isDate.exports}var isTime={exports:{}},hasRequiredIsTime;function requireIsTime(){return hasRequiredIsTime||(hasRequiredIsTime=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=uf;var bo=Ra(requireMerge());function Ra(df){return df&&df.__esModule?df:{default:df}}var pc={hourFormat:"hour24",mode:"default"},mc={hour24:{default:/^([01]?[0-9]|2[0-3]):([0-5][0-9])$/,withSeconds:/^([01]?[0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$/},hour12:{default:/^(0?[1-9]|1[0-2]):([0-5][0-9]) (A|P)M$/,withSeconds:/^(0?[1-9]|1[0-2]):([0-5][0-9]):([0-5][0-9]) (A|P)M$/}};function uf(df,ff){return ff=(0,bo.default)(ff,pc),typeof df!="string"?!1:mc[ff.hourFormat][ff.mode].test(df)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isTime,isTime.exports)),isTime.exports}var isBoolean={exports:{}},hasRequiredIsBoolean;function requireIsBoolean(){return hasRequiredIsBoolean||(hasRequiredIsBoolean=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=df;var bo=Ra(requireAssertString());function Ra(ff){return ff&&ff.__esModule?ff:{default:ff}}var pc={loose:!1},mc=["true","false","1","0"],uf=[].concat(mc,["yes","no"]);function df(ff){var hf=arguments.length>1&&arguments[1]!==void 0?arguments[1]:pc;return(0,bo.default)(ff),hf.loose?uf.includes(ff.toLowerCase()):mc.includes(ff)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isBoolean,isBoolean.exports)),isBoolean.exports}var isLocale={exports:{}},hasRequiredIsLocale;function requireIsLocale(){return hasRequiredIsLocale||(hasRequiredIsLocale=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=wf;var bo=Ra(requireAssertString());function Ra(If){return If&&If.__esModule?If:{default:If}}var pc="([A-Za-z]{3}(-[A-Za-z]{3}){0,2})",mc="(([a-zA-Z]{2,3}(-".concat(pc,")?)|([a-zA-Z]{5,8}))"),uf="([A-Za-z]{4})",df="([A-Za-z]{2}|\\d{3})",ff="([A-Za-z0-9]{5,8}|(\\d[A-Z-a-z0-9]{3}))",hf="(\\d|[A-W]|[Y-Z]|[a-w]|[y-z])",pf="(".concat(hf,"(-[A-Za-z0-9]{2,8})+)"),mf="(x(-[A-Za-z0-9]{1,8})+)",gf="((en-GB-oed)|(i-ami)|(i-bnn)|(i-default)|(i-enochian)|(i-hak)|(i-klingon)|(i-lux)|(i-mingo)|(i-navajo)|(i-pwn)|(i-tao)|(i-tay)|(i-tsu)|(sgn-BE-FR)|(sgn-BE-NL)|(sgn-CH-DE))",yf="((art-lojban)|(cel-gaulish)|(no-bok)|(no-nyn)|(zh-guoyu)|(zh-hakka)|(zh-min)|(zh-min-nan)|(zh-xiang))",vf="(".concat(gf,"|").concat(yf,")"),bf="(-|_)",Sf="".concat(mc,"(").concat(bf).concat(uf,")?(").concat(bf).concat(df,")?(").concat(bf).concat(ff,")*(").concat(bf).concat(pf,")*(").concat(bf).concat(mf,")?"),xf=new RegExp("(^".concat(mf,"$)|(^").concat(vf,"$)|(^").concat(Sf,"$)"));function wf(If){return(0,bo.default)(If),xf.test(If)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isLocale,isLocale.exports)),isLocale.exports}var isAbaRouting={exports:{}},hasRequiredIsAbaRouting;function requireIsAbaRouting(){return hasRequiredIsAbaRouting||(hasRequiredIsAbaRouting=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=mc;var bo=Ra(requireAssertString());function Ra(uf){return uf&&uf.__esModule?uf:{default:uf}}var pc=/^(?!(1[3-9])|(20)|(3[3-9])|(4[0-9])|(5[0-9])|(60)|(7[3-9])|(8[1-9])|(9[0-2])|(9[3-9]))[0-9]{9}$/;function mc(uf){if((0,bo.default)(uf),!pc.test(uf))return!1;for(var df=0,ff=0;ff<uf.length;ff++)ff%3===0?df+=uf[ff]*3:ff%3===1?df+=uf[ff]*7:df+=uf[ff]*1;return df%10===0}vo.exports=Ai.default,vo.exports.default=Ai.default}(isAbaRouting,isAbaRouting.exports)),isAbaRouting.exports}var isAlpha={},hasRequiredIsAlpha;function requireIsAlpha(){if(hasRequiredIsAlpha)return isAlpha;hasRequiredIsAlpha=1,Object.defineProperty(isAlpha,"__esModule",{value:!0}),isAlpha.default=Ra,isAlpha.locales=void 0;var vo=bo(requireAssertString()),Ai=requireAlpha();function bo(pc){return pc&&pc.__esModule?pc:{default:pc}}function Ra(pc){var mc=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"en-US",uf=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};(0,vo.default)(pc);var df=pc,ff=uf.ignore;if(ff)if(ff instanceof RegExp)df=df.replace(ff,"");else if(typeof ff=="string")df=df.replace(new RegExp("[".concat(ff.replace(/[-[\]{}()*+?.,\\^$|#\\s]/g,"\\$&"),"]"),"g"),"");else throw new Error("ignore should be instance of a String or RegExp");if(mc in Ai.alpha)return Ai.alpha[mc].test(df);throw new Error("Invalid locale '".concat(mc,"'"))}return isAlpha.locales=Object.keys(Ai.alpha),isAlpha}var isAlphanumeric={},hasRequiredIsAlphanumeric;function requireIsAlphanumeric(){if(hasRequiredIsAlphanumeric)return isAlphanumeric;hasRequiredIsAlphanumeric=1,Object.defineProperty(isAlphanumeric,"__esModule",{value:!0}),isAlphanumeric.default=Ra,isAlphanumeric.locales=void 0;var vo=bo(requireAssertString()),Ai=requireAlpha();function bo(pc){return pc&&pc.__esModule?pc:{default:pc}}function Ra(pc){var mc=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"en-US",uf=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};(0,vo.default)(pc);var df=pc,ff=uf.ignore;if(ff)if(ff instanceof RegExp)df=df.replace(ff,"");else if(typeof ff=="string")df=df.replace(new RegExp("[".concat(ff.replace(/[-[\]{}()*+?.,\\^$|#\\s]/g,"\\$&"),"]"),"g"),"");else throw new Error("ignore should be instance of a String or RegExp");if(mc in Ai.alphanumeric)return Ai.alphanumeric[mc].test(df);throw new Error("Invalid locale '".concat(mc,"'"))}return isAlphanumeric.locales=Object.keys(Ai.alphanumeric),isAlphanumeric}var isNumeric={exports:{}},hasRequiredIsNumeric;function requireIsNumeric(){return hasRequiredIsNumeric||(hasRequiredIsNumeric=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=uf;var bo=pc(requireAssertString()),Ra=requireAlpha();function pc(df){return df&&df.__esModule?df:{default:df}}var mc=/^[0-9]+$/;function uf(df,ff){return(0,bo.default)(df),ff&&ff.no_symbols?mc.test(df):new RegExp("^[+-]?([0-9]*[".concat((ff||{}).locale?Ra.decimal[ff.locale]:".","])?[0-9]+$")).test(df)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isNumeric,isNumeric.exports)),isNumeric.exports}var isPassportNumber={exports:{}},hasRequiredIsPassportNumber;function requireIsPassportNumber(){return hasRequiredIsPassportNumber||(hasRequiredIsPassportNumber=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=mc;var bo=Ra(requireAssertString());function Ra(uf){return uf&&uf.__esModule?uf:{default:uf}}var pc={AM:/^[A-Z]{2}\d{7}$/,AR:/^[A-Z]{3}\d{6}$/,AT:/^[A-Z]\d{7}$/,AU:/^[A-Z]\d{7}$/,AZ:/^[A-Z]{1}\d{8}$/,BE:/^[A-Z]{2}\d{6}$/,BG:/^\d{9}$/,BR:/^[A-Z]{2}\d{6}$/,BY:/^[A-Z]{2}\d{7}$/,CA:/^[A-Z]{2}\d{6}$/,CH:/^[A-Z]\d{7}$/,CN:/^G\d{8}$|^E(?![IO])[A-Z0-9]\d{7}$/,CY:/^[A-Z](\d{6}|\d{8})$/,CZ:/^\d{8}$/,DE:/^[CFGHJKLMNPRTVWXYZ0-9]{9}$/,DK:/^\d{9}$/,DZ:/^\d{9}$/,EE:/^([A-Z]\d{7}|[A-Z]{2}\d{7})$/,ES:/^[A-Z0-9]{2}([A-Z0-9]?)\d{6}$/,FI:/^[A-Z]{2}\d{7}$/,FR:/^\d{2}[A-Z]{2}\d{5}$/,GB:/^\d{9}$/,GR:/^[A-Z]{2}\d{7}$/,HR:/^\d{9}$/,HU:/^[A-Z]{2}(\d{6}|\d{7})$/,IE:/^[A-Z0-9]{2}\d{7}$/,IN:/^[A-Z]{1}-?\d{7}$/,ID:/^[A-C]\d{7}$/,IR:/^[A-Z]\d{8}$/,IS:/^(A)\d{7}$/,IT:/^[A-Z0-9]{2}\d{7}$/,JM:/^[Aa]\d{7}$/,JP:/^[A-Z]{2}\d{7}$/,KR:/^[MS]\d{8}$/,KZ:/^[a-zA-Z]\d{7}$/,LI:/^[a-zA-Z]\d{5}$/,LT:/^[A-Z0-9]{8}$/,LU:/^[A-Z0-9]{8}$/,LV:/^[A-Z0-9]{2}\d{7}$/,LY:/^[A-Z0-9]{8}$/,MT:/^\d{7}$/,MZ:/^([A-Z]{2}\d{7})|(\d{2}[A-Z]{2}\d{5})$/,MY:/^[AHK]\d{8}$/,MX:/^\d{10,11}$/,NL:/^[A-Z]{2}[A-Z0-9]{6}\d$/,NZ:/^([Ll]([Aa]|[Dd]|[Ff]|[Hh])|[Ee]([Aa]|[Pp])|[Nn])\d{6}$/,PH:/^([A-Z](\d{6}|\d{7}[A-Z]))|([A-Z]{2}(\d{6}|\d{7}))$/,PK:/^[A-Z]{2}\d{7}$/,PL:/^[A-Z]{2}\d{7}$/,PT:/^[A-Z]\d{6}$/,RO:/^\d{8,9}$/,RU:/^\d{9}$/,SE:/^\d{8}$/,SL:/^(P)[A-Z]\d{7}$/,SK:/^[0-9A-Z]\d{7}$/,TH:/^[A-Z]{1,2}\d{6,7}$/,TR:/^[A-Z]\d{8}$/,UA:/^[A-Z]{2}\d{6}$/,US:/^\d{9}$/,ZA:/^[TAMD]\d{8}$/};function mc(uf,df){(0,bo.default)(uf);var ff=uf.replace(/\s/g,"").toUpperCase();return df.toUpperCase()in pc&&pc[df].test(ff)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isPassportNumber,isPassportNumber.exports)),isPassportNumber.exports}var isPort={exports:{}},isInt={exports:{}},hasRequiredIsInt;function requireIsInt(){return hasRequiredIsInt||(hasRequiredIsInt=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=uf;var bo=Ra(requireAssertString());function Ra(df){return df&&df.__esModule?df:{default:df}}var pc=/^(?:[-+]?(?:0|[1-9][0-9]*))$/,mc=/^[-+]?[0-9]+$/;function uf(df,ff){(0,bo.default)(df),ff=ff||{};var hf=ff.allow_leading_zeroes===!1?pc:mc,pf=!ff.hasOwnProperty("min")||df>=ff.min,mf=!ff.hasOwnProperty("max")||df<=ff.max,gf=!ff.hasOwnProperty("lt")||df<ff.lt,yf=!ff.hasOwnProperty("gt")||df>ff.gt;return hf.test(df)&&pf&&mf&&gf&&yf}vo.exports=Ai.default,vo.exports.default=Ai.default}(isInt,isInt.exports)),isInt.exports}var hasRequiredIsPort;function requireIsPort(){return hasRequiredIsPort||(hasRequiredIsPort=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=pc;var bo=Ra(requireIsInt());function Ra(mc){return mc&&mc.__esModule?mc:{default:mc}}function pc(mc){return(0,bo.default)(mc,{allow_leading_zeroes:!1,min:0,max:65535})}vo.exports=Ai.default,vo.exports.default=Ai.default}(isPort,isPort.exports)),isPort.exports}var isLowercase={exports:{}},hasRequiredIsLowercase;function requireIsLowercase(){return hasRequiredIsLowercase||(hasRequiredIsLowercase=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=pc;var bo=Ra(requireAssertString());function Ra(mc){return mc&&mc.__esModule?mc:{default:mc}}function pc(mc){return(0,bo.default)(mc),mc===mc.toLowerCase()}vo.exports=Ai.default,vo.exports.default=Ai.default}(isLowercase,isLowercase.exports)),isLowercase.exports}var isUppercase={exports:{}},hasRequiredIsUppercase;function requireIsUppercase(){return hasRequiredIsUppercase||(hasRequiredIsUppercase=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=pc;var bo=Ra(requireAssertString());function Ra(mc){return mc&&mc.__esModule?mc:{default:mc}}function pc(mc){return(0,bo.default)(mc),mc===mc.toUpperCase()}vo.exports=Ai.default,vo.exports.default=Ai.default}(isUppercase,isUppercase.exports)),isUppercase.exports}var isIMEI={exports:{}},hasRequiredIsIMEI;function requireIsIMEI(){return hasRequiredIsIMEI||(hasRequiredIsIMEI=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=uf;var bo=Ra(requireAssertString());function Ra(df){return df&&df.__esModule?df:{default:df}}var pc=/^[0-9]{15}$/,mc=/^\d{2}-\d{6}-\d{6}-\d{1}$/;function uf(df,ff){(0,bo.default)(df),ff=ff||{};var hf=pc;if(ff.allow_hyphens&&(hf=mc),!hf.test(df))return!1;df=df.replace(/-/g,"");for(var pf=0,mf=2,gf=14,yf=0;yf<gf;yf++){var vf=df.substring(gf-yf-1,gf-yf),bf=parseInt(vf,10)*mf;bf>=10?pf+=bf%10+1:pf+=bf,mf===1?mf+=1:mf-=1}var Sf=(10-pf%10)%10;return Sf===parseInt(df.substring(14,15),10)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isIMEI,isIMEI.exports)),isIMEI.exports}var isAscii={exports:{}},hasRequiredIsAscii;function requireIsAscii(){return hasRequiredIsAscii||(hasRequiredIsAscii=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=mc;var bo=Ra(requireAssertString());function Ra(uf){return uf&&uf.__esModule?uf:{default:uf}}var pc=/^[\x00-\x7F]+$/;function mc(uf){return(0,bo.default)(uf),pc.test(uf)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isAscii,isAscii.exports)),isAscii.exports}var isFullWidth={},hasRequiredIsFullWidth;function requireIsFullWidth(){if(hasRequiredIsFullWidth)return isFullWidth;hasRequiredIsFullWidth=1,Object.defineProperty(isFullWidth,"__esModule",{value:!0}),isFullWidth.default=Ra,isFullWidth.fullWidth=void 0;var vo=Ai(requireAssertString());function Ai(pc){return pc&&pc.__esModule?pc:{default:pc}}var bo=isFullWidth.fullWidth=/[^\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]/;function Ra(pc){return(0,vo.default)(pc),bo.test(pc)}return isFullWidth}var isHalfWidth={},hasRequiredIsHalfWidth;function requireIsHalfWidth(){if(hasRequiredIsHalfWidth)return isHalfWidth;hasRequiredIsHalfWidth=1,Object.defineProperty(isHalfWidth,"__esModule",{value:!0}),isHalfWidth.default=Ra,isHalfWidth.halfWidth=void 0;var vo=Ai(requireAssertString());function Ai(pc){return pc&&pc.__esModule?pc:{default:pc}}var bo=isHalfWidth.halfWidth=/[\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]/;function Ra(pc){return(0,vo.default)(pc),bo.test(pc)}return isHalfWidth}var isVariableWidth={exports:{}},hasRequiredIsVariableWidth;function requireIsVariableWidth(){return hasRequiredIsVariableWidth||(hasRequiredIsVariableWidth=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=uf;var bo=mc(requireAssertString()),Ra=requireIsFullWidth(),pc=requireIsHalfWidth();function mc(df){return df&&df.__esModule?df:{default:df}}function uf(df){return(0,bo.default)(df),Ra.fullWidth.test(df)&&pc.halfWidth.test(df)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isVariableWidth,isVariableWidth.exports)),isVariableWidth.exports}var isMultibyte={exports:{}},hasRequiredIsMultibyte;function requireIsMultibyte(){return hasRequiredIsMultibyte||(hasRequiredIsMultibyte=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=mc;var bo=Ra(requireAssertString());function Ra(uf){return uf&&uf.__esModule?uf:{default:uf}}var pc=/[^\x00-\x7F]/;function mc(uf){return(0,bo.default)(uf),pc.test(uf)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isMultibyte,isMultibyte.exports)),isMultibyte.exports}var isSemVer={exports:{}},multilineRegex={exports:{}},hasRequiredMultilineRegex;function requireMultilineRegex(){return hasRequiredMultilineRegex||(hasRequiredMultilineRegex=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=bo;function bo(Ra,pc){var mc=Ra.join("");return new RegExp(mc,pc)}vo.exports=Ai.default,vo.exports.default=Ai.default}(multilineRegex,multilineRegex.exports)),multilineRegex.exports}var hasRequiredIsSemVer;function requireIsSemVer(){return hasRequiredIsSemVer||(hasRequiredIsSemVer=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=uf;var bo=pc(requireAssertString()),Ra=pc(requireMultilineRegex());function pc(df){return df&&df.__esModule?df:{default:df}}var mc=(0,Ra.default)(["^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)","(?:-((?:0|[1-9]\\d*|\\d*[a-z-][0-9a-z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-z-][0-9a-z-]*))*))","?(?:\\+([0-9a-z-]+(?:\\.[0-9a-z-]+)*))?$"],"i");function uf(df){return(0,bo.default)(df),mc.test(df)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isSemVer,isSemVer.exports)),isSemVer.exports}var isSurrogatePair={exports:{}},hasRequiredIsSurrogatePair;function requireIsSurrogatePair(){return hasRequiredIsSurrogatePair||(hasRequiredIsSurrogatePair=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=mc;var bo=Ra(requireAssertString());function Ra(uf){return uf&&uf.__esModule?uf:{default:uf}}var pc=/[\uD800-\uDBFF][\uDC00-\uDFFF]/;function mc(uf){return(0,bo.default)(uf),pc.test(uf)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isSurrogatePair,isSurrogatePair.exports)),isSurrogatePair.exports}var isDecimal={exports:{}},includes={exports:{}},hasRequiredIncludes;function requireIncludes(){return hasRequiredIncludes||(hasRequiredIncludes=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=void 0;var bo=function(Ra,pc){return Ra.some(function(mc){return pc===mc})};Ai.default=bo,vo.exports=Ai.default,vo.exports.default=Ai.default}(includes,includes.exports)),includes.exports}var hasRequiredIsDecimal;function requireIsDecimal(){return hasRequiredIsDecimal||(hasRequiredIsDecimal=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=pf;var bo=uf(requireMerge()),Ra=uf(requireAssertString()),pc=uf(requireIncludes()),mc=requireAlpha();function uf(mf){return mf&&mf.__esModule?mf:{default:mf}}function df(mf){var gf=new RegExp("^[-+]?([0-9]+)?(\\".concat(mc.decimal[mf.locale],"[0-9]{").concat(mf.decimal_digits,"})").concat(mf.force_decimal?"":"?","$"));return gf}var ff={force_decimal:!1,decimal_digits:"1,",locale:"en-US"},hf=["","-","+"];function pf(mf,gf){if((0,Ra.default)(mf),gf=(0,bo.default)(gf,ff),gf.locale in mc.decimal)return!(0,pc.default)(hf,mf.replace(/ /g,""))&&df(gf).test(mf);throw new Error("Invalid locale '".concat(gf.locale,"'"))}vo.exports=Ai.default,vo.exports.default=Ai.default}(isDecimal,isDecimal.exports)),isDecimal.exports}var isHexadecimal={exports:{}},hasRequiredIsHexadecimal;function requireIsHexadecimal(){return hasRequiredIsHexadecimal||(hasRequiredIsHexadecimal=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=mc;var bo=Ra(requireAssertString());function Ra(uf){return uf&&uf.__esModule?uf:{default:uf}}var pc=/^(0x|0h)?[0-9A-F]+$/i;function mc(uf){return(0,bo.default)(uf),pc.test(uf)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isHexadecimal,isHexadecimal.exports)),isHexadecimal.exports}var isOctal={exports:{}},hasRequiredIsOctal;function requireIsOctal(){return hasRequiredIsOctal||(hasRequiredIsOctal=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=mc;var bo=Ra(requireAssertString());function Ra(uf){return uf&&uf.__esModule?uf:{default:uf}}var pc=/^(0o)?[0-7]+$/i;function mc(uf){return(0,bo.default)(uf),pc.test(uf)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isOctal,isOctal.exports)),isOctal.exports}var isDivisibleBy={exports:{}},hasRequiredIsDivisibleBy;function requireIsDivisibleBy(){return hasRequiredIsDivisibleBy||(hasRequiredIsDivisibleBy=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=mc;var bo=pc(requireAssertString()),Ra=pc(requireToFloat());function pc(uf){return uf&&uf.__esModule?uf:{default:uf}}function mc(uf,df){return(0,bo.default)(uf),(0,Ra.default)(uf)%parseInt(df,10)===0}vo.exports=Ai.default,vo.exports.default=Ai.default}(isDivisibleBy,isDivisibleBy.exports)),isDivisibleBy.exports}var isHexColor={exports:{}},hasRequiredIsHexColor;function requireIsHexColor(){return hasRequiredIsHexColor||(hasRequiredIsHexColor=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=mc;var bo=Ra(requireAssertString());function Ra(uf){return uf&&uf.__esModule?uf:{default:uf}}var pc=/^#?([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$/i;function mc(uf){return(0,bo.default)(uf),pc.test(uf)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isHexColor,isHexColor.exports)),isHexColor.exports}var isRgbColor={exports:{}},hasRequiredIsRgbColor;function requireIsRgbColor(){return hasRequiredIsRgbColor||(hasRequiredIsRgbColor=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=ff;var bo=Ra(requireAssertString());function Ra(hf){return hf&&hf.__esModule?hf:{default:hf}}var pc=/^rgb\((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]),){2}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\)$/,mc=/^rgba\((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]),){3}(0?\.\d|1(\.0)?|0(\.0)?)\)$/,uf=/^rgb\((([0-9]%|[1-9][0-9]%|100%),){2}([0-9]%|[1-9][0-9]%|100%)\)$/,df=/^rgba\((([0-9]%|[1-9][0-9]%|100%),){3}(0?\.\d|1(\.0)?|0(\.0)?)\)$/;function ff(hf){var pf=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return(0,bo.default)(hf),pf?pc.test(hf)||mc.test(hf)||uf.test(hf)||df.test(hf):pc.test(hf)||mc.test(hf)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isRgbColor,isRgbColor.exports)),isRgbColor.exports}var isHSL={exports:{}},hasRequiredIsHSL;function requireIsHSL(){return hasRequiredIsHSL||(hasRequiredIsHSL=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=uf;var bo=Ra(requireAssertString());function Ra(df){return df&&df.__esModule?df:{default:df}}var pc=/^hsla?\(((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?))(deg|grad|rad|turn)?(,(\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%){2}(,((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%?))?\)$/i,mc=/^hsla?\(((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?))(deg|grad|rad|turn)?(\s(\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%){2}\s?(\/\s((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%?)\s?)?\)$/i;function uf(df){(0,bo.default)(df);var ff=df.replace(/\s+/g," ").replace(/\s?(hsla?\(|\)|,)\s?/ig,"$1");return ff.indexOf(",")!==-1?pc.test(ff):mc.test(ff)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isHSL,isHSL.exports)),isHSL.exports}var isISRC={exports:{}},hasRequiredIsISRC;function requireIsISRC(){return hasRequiredIsISRC||(hasRequiredIsISRC=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=mc;var bo=Ra(requireAssertString());function Ra(uf){return uf&&uf.__esModule?uf:{default:uf}}var pc=/^[A-Z]{2}[0-9A-Z]{3}\d{2}\d{5}$/;function mc(uf){return(0,bo.default)(uf),pc.test(uf)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isISRC,isISRC.exports)),isISRC.exports}var isIBAN={},hasRequiredIsIBAN;function requireIsIBAN(){if(hasRequiredIsIBAN)return isIBAN;hasRequiredIsIBAN=1,Object.defineProperty(isIBAN,"__esModule",{value:!0}),isIBAN.default=uf,isIBAN.locales=void 0;var vo=Ai(requireAssertString());function Ai(df){return df&&df.__esModule?df:{default:df}}var bo={AD:/^(AD[0-9]{2})\d{8}[A-Z0-9]{12}$/,AE:/^(AE[0-9]{2})\d{3}\d{16}$/,AL:/^(AL[0-9]{2})\d{8}[A-Z0-9]{16}$/,AT:/^(AT[0-9]{2})\d{16}$/,AZ:/^(AZ[0-9]{2})[A-Z0-9]{4}\d{20}$/,BA:/^(BA[0-9]{2})\d{16}$/,BE:/^(BE[0-9]{2})\d{12}$/,BG:/^(BG[0-9]{2})[A-Z]{4}\d{6}[A-Z0-9]{8}$/,BH:/^(BH[0-9]{2})[A-Z]{4}[A-Z0-9]{14}$/,BR:/^(BR[0-9]{2})\d{23}[A-Z]{1}[A-Z0-9]{1}$/,BY:/^(BY[0-9]{2})[A-Z0-9]{4}\d{20}$/,CH:/^(CH[0-9]{2})\d{5}[A-Z0-9]{12}$/,CR:/^(CR[0-9]{2})\d{18}$/,CY:/^(CY[0-9]{2})\d{8}[A-Z0-9]{16}$/,CZ:/^(CZ[0-9]{2})\d{20}$/,DE:/^(DE[0-9]{2})\d{18}$/,DK:/^(DK[0-9]{2})\d{14}$/,DO:/^(DO[0-9]{2})[A-Z]{4}\d{20}$/,DZ:/^(DZ\d{24})$/,EE:/^(EE[0-9]{2})\d{16}$/,EG:/^(EG[0-9]{2})\d{25}$/,ES:/^(ES[0-9]{2})\d{20}$/,FI:/^(FI[0-9]{2})\d{14}$/,FO:/^(FO[0-9]{2})\d{14}$/,FR:/^(FR[0-9]{2})\d{10}[A-Z0-9]{11}\d{2}$/,GB:/^(GB[0-9]{2})[A-Z]{4}\d{14}$/,GE:/^(GE[0-9]{2})[A-Z0-9]{2}\d{16}$/,GI:/^(GI[0-9]{2})[A-Z]{4}[A-Z0-9]{15}$/,GL:/^(GL[0-9]{2})\d{14}$/,GR:/^(GR[0-9]{2})\d{7}[A-Z0-9]{16}$/,GT:/^(GT[0-9]{2})[A-Z0-9]{4}[A-Z0-9]{20}$/,HR:/^(HR[0-9]{2})\d{17}$/,HU:/^(HU[0-9]{2})\d{24}$/,IE:/^(IE[0-9]{2})[A-Z0-9]{4}\d{14}$/,IL:/^(IL[0-9]{2})\d{19}$/,IQ:/^(IQ[0-9]{2})[A-Z]{4}\d{15}$/,IR:/^(IR[0-9]{2})0\d{2}0\d{18}$/,IS:/^(IS[0-9]{2})\d{22}$/,IT:/^(IT[0-9]{2})[A-Z]{1}\d{10}[A-Z0-9]{12}$/,JO:/^(JO[0-9]{2})[A-Z]{4}\d{22}$/,KW:/^(KW[0-9]{2})[A-Z]{4}[A-Z0-9]{22}$/,KZ:/^(KZ[0-9]{2})\d{3}[A-Z0-9]{13}$/,LB:/^(LB[0-9]{2})\d{4}[A-Z0-9]{20}$/,LC:/^(LC[0-9]{2})[A-Z]{4}[A-Z0-9]{24}$/,LI:/^(LI[0-9]{2})\d{5}[A-Z0-9]{12}$/,LT:/^(LT[0-9]{2})\d{16}$/,LU:/^(LU[0-9]{2})\d{3}[A-Z0-9]{13}$/,LV:/^(LV[0-9]{2})[A-Z]{4}[A-Z0-9]{13}$/,MA:/^(MA[0-9]{26})$/,MC:/^(MC[0-9]{2})\d{10}[A-Z0-9]{11}\d{2}$/,MD:/^(MD[0-9]{2})[A-Z0-9]{20}$/,ME:/^(ME[0-9]{2})\d{18}$/,MK:/^(MK[0-9]{2})\d{3}[A-Z0-9]{10}\d{2}$/,MR:/^(MR[0-9]{2})\d{23}$/,MT:/^(MT[0-9]{2})[A-Z]{4}\d{5}[A-Z0-9]{18}$/,MU:/^(MU[0-9]{2})[A-Z]{4}\d{19}[A-Z]{3}$/,MZ:/^(MZ[0-9]{2})\d{21}$/,NL:/^(NL[0-9]{2})[A-Z]{4}\d{10}$/,NO:/^(NO[0-9]{2})\d{11}$/,PK:/^(PK[0-9]{2})[A-Z0-9]{4}\d{16}$/,PL:/^(PL[0-9]{2})\d{24}$/,PS:/^(PS[0-9]{2})[A-Z0-9]{4}\d{21}$/,PT:/^(PT[0-9]{2})\d{21}$/,QA:/^(QA[0-9]{2})[A-Z]{4}[A-Z0-9]{21}$/,RO:/^(RO[0-9]{2})[A-Z]{4}[A-Z0-9]{16}$/,RS:/^(RS[0-9]{2})\d{18}$/,SA:/^(SA[0-9]{2})\d{2}[A-Z0-9]{18}$/,SC:/^(SC[0-9]{2})[A-Z]{4}\d{20}[A-Z]{3}$/,SE:/^(SE[0-9]{2})\d{20}$/,SI:/^(SI[0-9]{2})\d{15}$/,SK:/^(SK[0-9]{2})\d{20}$/,SM:/^(SM[0-9]{2})[A-Z]{1}\d{10}[A-Z0-9]{12}$/,SV:/^(SV[0-9]{2})[A-Z0-9]{4}\d{20}$/,TL:/^(TL[0-9]{2})\d{19}$/,TN:/^(TN[0-9]{2})\d{20}$/,TR:/^(TR[0-9]{2})\d{5}[A-Z0-9]{17}$/,UA:/^(UA[0-9]{2})\d{6}[A-Z0-9]{19}$/,VA:/^(VA[0-9]{2})\d{18}$/,VG:/^(VG[0-9]{2})[A-Z0-9]{4}\d{16}$/,XK:/^(XK[0-9]{2})\d{16}$/};function Ra(df){var ff=df.filter(function(hf){return!(hf in bo)});return!(ff.length>0)}function pc(df,ff){var hf=df.replace(/[\s\-]+/gi,"").toUpperCase(),pf=hf.slice(0,2).toUpperCase(),mf=pf in bo;if(ff.whitelist){if(!Ra(ff.whitelist))return!1;var gf=ff.whitelist.includes(pf);if(!gf)return!1}if(ff.blacklist){var yf=ff.blacklist.includes(pf);if(yf)return!1}return mf&&bo[pf].test(hf)}function mc(df){var ff=df.replace(/[^A-Z0-9]+/gi,"").toUpperCase(),hf=ff.slice(4)+ff.slice(0,4),pf=hf.replace(/[A-Z]/g,function(gf){return gf.charCodeAt(0)-55}),mf=pf.match(/\d{1,7}/g).reduce(function(gf,yf){return Number(gf+yf)%97},"");return mf===1}function uf(df){var ff=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return(0,vo.default)(df),pc(df,ff)&&mc(df)}return isIBAN.locales=Object.keys(bo),isIBAN}var isBIC={exports:{}},isISO31661Alpha2={},hasRequiredIsISO31661Alpha2;function requireIsISO31661Alpha2(){if(hasRequiredIsISO31661Alpha2)return isISO31661Alpha2;hasRequiredIsISO31661Alpha2=1,Object.defineProperty(isISO31661Alpha2,"__esModule",{value:!0}),isISO31661Alpha2.CountryCodes=void 0,isISO31661Alpha2.default=Ra;var vo=Ai(requireAssertString());function Ai(pc){return pc&&pc.__esModule?pc:{default:pc}}var bo=new Set(["AD","AE","AF","AG","AI","AL","AM","AO","AQ","AR","AS","AT","AU","AW","AX","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BL","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CR","CU","CV","CW","CX","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ","FK","FM","FO","FR","GA","GB","GD","GE","GF","GG","GH","GI","GL","GM","GN","GP","GQ","GR","GS","GT","GU","GW","GY","HK","HM","HN","HR","HT","HU","ID","IE","IL","IM","IN","IO","IQ","IR","IS","IT","JE","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MF","MG","MH","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY","QA","RE","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TF","TG","TH","TJ","TK","TL","TM","TN","TO","TR","TT","TV","TW","TZ","UA","UG","UM","US","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","YE","YT","ZA","ZM","ZW"]);function Ra(pc){return(0,vo.default)(pc),bo.has(pc.toUpperCase())}return isISO31661Alpha2.CountryCodes=bo,isISO31661Alpha2}var hasRequiredIsBIC;function requireIsBIC(){return hasRequiredIsBIC||(hasRequiredIsBIC=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=uf;var bo=pc(requireAssertString()),Ra=requireIsISO31661Alpha2();function pc(df){return df&&df.__esModule?df:{default:df}}var mc=/^[A-Za-z]{6}[A-Za-z0-9]{2}([A-Za-z0-9]{3})?$/;function uf(df){(0,bo.default)(df);var ff=df.slice(4,6).toUpperCase();return!Ra.CountryCodes.has(ff)&&ff!=="XK"?!1:mc.test(df)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isBIC,isBIC.exports)),isBIC.exports}var isMD5={exports:{}},hasRequiredIsMD5;function requireIsMD5(){return hasRequiredIsMD5||(hasRequiredIsMD5=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=mc;var bo=Ra(requireAssertString());function Ra(uf){return uf&&uf.__esModule?uf:{default:uf}}var pc=/^[a-f0-9]{32}$/;function mc(uf){return(0,bo.default)(uf),pc.test(uf)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isMD5,isMD5.exports)),isMD5.exports}var isHash={exports:{}},hasRequiredIsHash;function requireIsHash(){return hasRequiredIsHash||(hasRequiredIsHash=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=mc;var bo=Ra(requireAssertString());function Ra(uf){return uf&&uf.__esModule?uf:{default:uf}}var pc={md5:32,md4:32,sha1:40,sha256:64,sha384:96,sha512:128,ripemd128:32,ripemd160:40,tiger128:32,tiger160:40,tiger192:48,crc32:8,crc32b:8};function mc(uf,df){(0,bo.default)(uf);var ff=new RegExp("^[a-fA-F0-9]{".concat(pc[df],"}$"));return ff.test(uf)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isHash,isHash.exports)),isHash.exports}var isJWT={exports:{}},isBase64={exports:{}},hasRequiredIsBase64;function requireIsBase64(){return hasRequiredIsBase64||(hasRequiredIsBase64=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=ff;var bo=pc(requireAssertString()),Ra=pc(requireMerge());function pc(hf){return hf&&hf.__esModule?hf:{default:hf}}var mc=/[^A-Z0-9+\/=]/i,uf=/^[A-Z0-9_\-]*$/i,df={urlSafe:!1};function ff(hf,pf){(0,bo.default)(hf),pf=(0,Ra.default)(pf,df);var mf=hf.length;if(pf.urlSafe)return uf.test(hf);if(mf%4!==0||mc.test(hf))return!1;var gf=hf.indexOf("=");return gf===-1||gf===mf-1||gf===mf-2&&hf[mf-1]==="="}vo.exports=Ai.default,vo.exports.default=Ai.default}(isBase64,isBase64.exports)),isBase64.exports}var hasRequiredIsJWT;function requireIsJWT(){return hasRequiredIsJWT||(hasRequiredIsJWT=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=mc;var bo=pc(requireAssertString()),Ra=pc(requireIsBase64());function pc(uf){return uf&&uf.__esModule?uf:{default:uf}}function mc(uf){(0,bo.default)(uf);var df=uf.split("."),ff=df.length;return ff!==3?!1:df.reduce(function(hf,pf){return hf&&(0,Ra.default)(pf,{urlSafe:!0})},!0)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isJWT,isJWT.exports)),isJWT.exports}var isJSON={exports:{}},hasRequiredIsJSON;function requireIsJSON(){return hasRequiredIsJSON||(hasRequiredIsJSON=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=df;var bo=pc(requireAssertString()),Ra=pc(requireMerge());function pc(ff){return ff&&ff.__esModule?ff:{default:ff}}function mc(ff){"@babel/helpers - typeof";return mc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(hf){return typeof hf}:function(hf){return hf&&typeof Symbol=="function"&&hf.constructor===Symbol&&hf!==Symbol.prototype?"symbol":typeof hf},mc(ff)}var uf={allow_primitives:!1};function df(ff,hf){(0,bo.default)(ff);try{hf=(0,Ra.default)(hf,uf);var pf=[];hf.allow_primitives&&(pf=[null,!1,!0]);var mf=JSON.parse(ff);return pf.includes(mf)||!!mf&&mc(mf)==="object"}catch{}return!1}vo.exports=Ai.default,vo.exports.default=Ai.default}(isJSON,isJSON.exports)),isJSON.exports}var isEmpty={exports:{}},hasRequiredIsEmpty;function requireIsEmpty(){return hasRequiredIsEmpty||(hasRequiredIsEmpty=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=uf;var bo=pc(requireAssertString()),Ra=pc(requireMerge());function pc(df){return df&&df.__esModule?df:{default:df}}var mc={ignore_whitespace:!1};function uf(df,ff){return(0,bo.default)(df),ff=(0,Ra.default)(ff,mc),(ff.ignore_whitespace?df.trim().length:df.length)===0}vo.exports=Ai.default,vo.exports.default=Ai.default}(isEmpty,isEmpty.exports)),isEmpty.exports}var isLength={exports:{}},hasRequiredIsLength;function requireIsLength(){return hasRequiredIsLength||(hasRequiredIsLength=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=mc;var bo=Ra(requireAssertString());function Ra(uf){return uf&&uf.__esModule?uf:{default:uf}}function pc(uf){"@babel/helpers - typeof";return pc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(df){return typeof df}:function(df){return df&&typeof Symbol=="function"&&df.constructor===Symbol&&df!==Symbol.prototype?"symbol":typeof df},pc(uf)}function mc(uf,df){(0,bo.default)(uf);var ff,hf;pc(df)==="object"?(ff=df.min||0,hf=df.max):(ff=arguments[1]||0,hf=arguments[2]);var pf=uf.match(/(\uFE0F|\uFE0E)/g)||[],mf=uf.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g)||[],gf=uf.length-pf.length-mf.length;return gf>=ff&&(typeof hf>"u"||gf<=hf)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isLength,isLength.exports)),isLength.exports}var isUUID={exports:{}},hasRequiredIsUUID;function requireIsUUID(){return hasRequiredIsUUID||(hasRequiredIsUUID=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=mc;var bo=Ra(requireAssertString());function Ra(uf){return uf&&uf.__esModule?uf:{default:uf}}var pc={1:/^[0-9A-F]{8}-[0-9A-F]{4}-1[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i,2:/^[0-9A-F]{8}-[0-9A-F]{4}-2[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i,3:/^[0-9A-F]{8}-[0-9A-F]{4}-3[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i,4:/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,5:/^[0-9A-F]{8}-[0-9A-F]{4}-5[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,7:/^[0-9A-F]{8}-[0-9A-F]{4}-7[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,all:/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i};function mc(uf,df){(0,bo.default)(uf);var ff=pc[[void 0,null].includes(df)?"all":df];return!!ff&&ff.test(uf)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isUUID,isUUID.exports)),isUUID.exports}var isMongoId={exports:{}},hasRequiredIsMongoId;function requireIsMongoId(){return hasRequiredIsMongoId||(hasRequiredIsMongoId=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=mc;var bo=pc(requireAssertString()),Ra=pc(requireIsHexadecimal());function pc(uf){return uf&&uf.__esModule?uf:{default:uf}}function mc(uf){return(0,bo.default)(uf),(0,Ra.default)(uf)&&uf.length===24}vo.exports=Ai.default,vo.exports.default=Ai.default}(isMongoId,isMongoId.exports)),isMongoId.exports}var isAfter={exports:{}},hasRequiredIsAfter;function requireIsAfter(){return hasRequiredIsAfter||(hasRequiredIsAfter=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=pc;var bo=Ra(requireToDate());function Ra(mc){return mc&&mc.__esModule?mc:{default:mc}}function pc(mc,uf){var df=(uf==null?void 0:uf.comparisonDate)||uf||Date().toString(),ff=(0,bo.default)(df),hf=(0,bo.default)(mc);return!!(hf&&ff&&hf>ff)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isAfter,isAfter.exports)),isAfter.exports}var isBefore={exports:{}},hasRequiredIsBefore;function requireIsBefore(){return hasRequiredIsBefore||(hasRequiredIsBefore=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=mc;var bo=pc(requireAssertString()),Ra=pc(requireToDate());function pc(uf){return uf&&uf.__esModule?uf:{default:uf}}function mc(uf){var df=arguments.length>1&&arguments[1]!==void 0?arguments[1]:String(new Date);(0,bo.default)(uf);var ff=(0,Ra.default)(df),hf=(0,Ra.default)(uf);return!!(hf&&ff&&hf<ff)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isBefore,isBefore.exports)),isBefore.exports}var isIn={exports:{}},hasRequiredIsIn;function requireIsIn(){return hasRequiredIsIn||(hasRequiredIsIn=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=uf;var bo=pc(requireAssertString()),Ra=pc(requireToString());function pc(df){return df&&df.__esModule?df:{default:df}}function mc(df){"@babel/helpers - typeof";return mc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ff){return typeof ff}:function(ff){return ff&&typeof Symbol=="function"&&ff.constructor===Symbol&&ff!==Symbol.prototype?"symbol":typeof ff},mc(df)}function uf(df,ff){(0,bo.default)(df);var hf;if(Object.prototype.toString.call(ff)==="[object Array]"){var pf=[];for(hf in ff)({}).hasOwnProperty.call(ff,hf)&&(pf[hf]=(0,Ra.default)(ff[hf]));return pf.indexOf(df)>=0}else{if(mc(ff)==="object")return ff.hasOwnProperty(df);if(ff&&typeof ff.indexOf=="function")return ff.indexOf(df)>=0}return!1}vo.exports=Ai.default,vo.exports.default=Ai.default}(isIn,isIn.exports)),isIn.exports}var isLuhnNumber={exports:{}},hasRequiredIsLuhnNumber;function requireIsLuhnNumber(){return hasRequiredIsLuhnNumber||(hasRequiredIsLuhnNumber=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=pc;var bo=Ra(requireAssertString());function Ra(mc){return mc&&mc.__esModule?mc:{default:mc}}function pc(mc){(0,bo.default)(mc);for(var uf=mc.replace(/[- ]+/g,""),df=0,ff,hf,pf,mf=uf.length-1;mf>=0;mf--)ff=uf.substring(mf,mf+1),hf=parseInt(ff,10),pf?(hf*=2,hf>=10?df+=hf%10+1:df+=hf):df+=hf,pf=!pf;return!!(df%10===0&&uf)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isLuhnNumber,isLuhnNumber.exports)),isLuhnNumber.exports}var isCreditCard={exports:{}},hasRequiredIsCreditCard;function requireIsCreditCard(){return hasRequiredIsCreditCard||(hasRequiredIsCreditCard=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=df;var bo=pc(requireAssertString()),Ra=pc(requireIsLuhnNumber());function pc(ff){return ff&&ff.__esModule?ff:{default:ff}}var mc={amex:/^3[47][0-9]{13}$/,dinersclub:/^3(?:0[0-5]|[68][0-9])[0-9]{11}$/,discover:/^6(?:011|5[0-9][0-9])[0-9]{12,15}$/,jcb:/^(?:2131|1800|35\d{3})\d{11}$/,mastercard:/^5[1-5][0-9]{2}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}$/,unionpay:/^(6[27][0-9]{14}|^(81[0-9]{14,17}))$/,visa:/^(?:4[0-9]{12})(?:[0-9]{3,6})?$/},uf=function(){var ff=[];for(var hf in mc)mc.hasOwnProperty(hf)&&ff.push(mc[hf]);return ff}();function df(ff){var hf=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(0,bo.default)(ff);var pf=hf.provider,mf=ff.replace(/[- ]+/g,"");if(pf&&pf.toLowerCase()in mc){if(!mc[pf.toLowerCase()].test(mf))return!1}else{if(pf&&!(pf.toLowerCase()in mc))throw new Error("".concat(pf," is not a valid credit card provider."));if(!uf.some(function(gf){return gf.test(mf)}))return!1}return(0,Ra.default)(ff)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isCreditCard,isCreditCard.exports)),isCreditCard.exports}var isIdentityCard={exports:{}},hasRequiredIsIdentityCard;function requireIsIdentityCard(){return hasRequiredIsIdentityCard||(hasRequiredIsIdentityCard=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=uf;var bo=pc(requireAssertString()),Ra=pc(requireIsInt());function pc(df){return df&&df.__esModule?df:{default:df}}var mc={PL:function(df){(0,bo.default)(df);var ff={1:1,2:3,3:7,4:9,5:1,6:3,7:7,8:9,9:1,10:3,11:0};if(df!=null&&df.length===11&&(0,Ra.default)(df,{allow_leading_zeroes:!0})){var hf=df.split("").slice(0,-1),pf=hf.reduce(function(yf,vf,bf){return yf+Number(vf)*ff[bf+1]},0),mf=pf%10,gf=Number(df.charAt(df.length-1));if(mf===0&&gf===0||gf===10-mf)return!0}return!1},ES:function(df){(0,bo.default)(df);var ff=/^[0-9X-Z][0-9]{7}[TRWAGMYFPDXBNJZSQVHLCKE]$/,hf={X:0,Y:1,Z:2},pf=["T","R","W","A","G","M","Y","F","P","D","X","B","N","J","Z","S","Q","V","H","L","C","K","E"],mf=df.trim().toUpperCase();if(!ff.test(mf))return!1;var gf=mf.slice(0,-1).replace(/[X,Y,Z]/g,function(yf){return hf[yf]});return mf.endsWith(pf[gf%23])},FI:function(df){if((0,bo.default)(df),df.length!==11||!df.match(/^\d{6}[\-A\+]\d{3}[0-9ABCDEFHJKLMNPRSTUVWXY]{1}$/))return!1;var ff="0123456789ABCDEFHJKLMNPRSTUVWXY",hf=parseInt(df.slice(0,6),10)*1e3+parseInt(df.slice(7,10),10),pf=hf%31,mf=ff[pf];return mf===df.slice(10,11)},IN:function(df){var ff=/^[1-9]\d{3}\s?\d{4}\s?\d{4}$/,hf=[[0,1,2,3,4,5,6,7,8,9],[1,2,3,4,0,6,7,8,9,5],[2,3,4,0,1,7,8,9,5,6],[3,4,0,1,2,8,9,5,6,7],[4,0,1,2,3,9,5,6,7,8],[5,9,8,7,6,0,4,3,2,1],[6,5,9,8,7,1,0,4,3,2],[7,6,5,9,8,2,1,0,4,3],[8,7,6,5,9,3,2,1,0,4],[9,8,7,6,5,4,3,2,1,0]],pf=[[0,1,2,3,4,5,6,7,8,9],[1,5,7,6,2,8,3,0,9,4],[5,8,0,3,7,9,6,1,4,2],[8,9,1,6,0,4,3,5,2,7],[9,4,5,3,1,2,6,8,7,0],[4,2,8,6,5,7,3,9,0,1],[2,7,9,3,8,0,6,4,1,5],[7,0,4,6,9,1,3,2,5,8]],mf=df.trim();if(!ff.test(mf))return!1;var gf=0,yf=mf.replace(/\s/g,"").split("").map(Number).reverse();return yf.forEach(function(vf,bf){gf=hf[gf][pf[bf%8][vf]]}),gf===0},IR:function(df){if(!df.match(/^\d{10}$/)||(df="0000".concat(df).slice(df.length-6),parseInt(df.slice(3,9),10)===0))return!1;for(var ff=parseInt(df.slice(9,10),10),hf=0,pf=0;pf<9;pf++)hf+=parseInt(df.slice(pf,pf+1),10)*(10-pf);return hf%=11,hf<2&&ff===hf||hf>=2&&ff===11-hf},IT:function(df){return df.length!==9||df==="CA00000AA"?!1:df.search(/C[A-Z]\d{5}[A-Z]{2}/i)>-1},NO:function(df){var ff=df.trim();if(isNaN(Number(ff))||ff.length!==11||ff==="00000000000")return!1;var hf=ff.split("").map(Number),pf=(11-(3*hf[0]+7*hf[1]+6*hf[2]+1*hf[3]+8*hf[4]+9*hf[5]+4*hf[6]+5*hf[7]+2*hf[8])%11)%11,mf=(11-(5*hf[0]+4*hf[1]+3*hf[2]+2*hf[3]+7*hf[4]+6*hf[5]+5*hf[6]+4*hf[7]+3*hf[8]+2*pf)%11)%11;return!(pf!==hf[9]||mf!==hf[10])},TH:function(df){if(!df.match(/^[1-8]\d{12}$/))return!1;for(var ff=0,hf=0;hf<12;hf++)ff+=parseInt(df[hf],10)*(13-hf);return df[12]===((11-ff%11)%10).toString()},LK:function(df){var ff=/^[1-9]\d{8}[vx]$/i,hf=/^[1-9]\d{11}$/i;return df.length===10&&ff.test(df)?!0:!!(df.length===12&&hf.test(df))},"he-IL":function(df){var ff=/^\d{9}$/,hf=df.trim();if(!ff.test(hf))return!1;for(var pf=hf,mf=0,gf,yf=0;yf<pf.length;yf++)gf=Number(pf[yf])*(yf%2+1),mf+=gf>9?gf-9:gf;return mf%10===0},"ar-LY":function(df){var ff=/^(1|2)\d{11}$/,hf=df.trim();return!!ff.test(hf)},"ar-TN":function(df){var ff=/^\d{8}$/,hf=df.trim();return!!ff.test(hf)},"zh-CN":function(df){var ff=["11","12","13","14","15","21","22","23","31","32","33","34","35","36","37","41","42","43","44","45","46","50","51","52","53","54","61","62","63","64","65","71","81","82","91"],hf=["7","9","10","5","8","4","2","1","6","3","7","9","10","5","8","4","2"],pf=["1","0","X","9","8","7","6","5","4","3","2"],mf=function(wf){return ff.includes(wf)},gf=function(wf){var If=parseInt(wf.substring(0,4),10),l1=parseInt(wf.substring(4,6),10),s1=parseInt(wf.substring(6),10),c1=new Date(If,l1-1,s1);return c1>new Date?!1:c1.getFullYear()===If&&c1.getMonth()===l1-1&&c1.getDate()===s1},yf=function(wf){for(var If=wf.substring(0,17),l1=0,s1=0;s1<17;s1++)l1+=parseInt(If.charAt(s1),10)*parseInt(hf[s1],10);var c1=l1%11;return pf[c1]},vf=function(wf){return yf(wf)===wf.charAt(17).toUpperCase()},bf=function(wf){var If=/^[1-9]\d{7}((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))\d{3}$/.test(wf);if(!If)return!1;var l1=wf.substring(0,2);if(If=mf(l1),!If)return!1;var s1="19".concat(wf.substring(6,12));return If=gf(s1),!!If},Sf=function(wf){var If=/^[1-9]\d{5}[1-9]\d{3}((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))\d{3}(\d|x|X)$/.test(wf);if(!If)return!1;var l1=wf.substring(0,2);if(If=mf(l1),!If)return!1;var s1=wf.substring(6,14);return If=gf(s1),If?vf(wf):!1},xf=function(wf){var If=/^\d{15}|(\d{17}(\d|x|X))$/.test(wf);return If?wf.length===15?bf(wf):Sf(wf):!1};return xf(df)},"zh-HK":function(df){df=df.trim();var ff=/^[A-Z]{1,2}[0-9]{6}((\([0-9A]\))|(\[[0-9A]\])|([0-9A]))$/,hf=/^[0-9]$/;if(df=df.toUpperCase(),!ff.test(df))return!1;df=df.replace(/\[|\]|\(|\)/g,""),df.length===8&&(df="3".concat(df));for(var pf=0,mf=0;mf<=7;mf++){var gf=void 0;hf.test(df[mf])?gf=df[mf]:gf=(df[mf].charCodeAt(0)-55)%11,pf+=gf*(9-mf)}pf%=11;var yf;return pf===0?yf="0":pf===1?yf="A":yf=String(11-pf),yf===df[df.length-1]},"zh-TW":function(df){var ff={A:10,B:11,C:12,D:13,E:14,F:15,G:16,H:17,I:34,J:18,K:19,L:20,M:21,N:22,O:35,P:23,Q:24,R:25,S:26,T:27,U:28,V:29,W:32,X:30,Y:31,Z:33},hf=df.trim().toUpperCase();return/^[A-Z][0-9]{9}$/.test(hf)?Array.from(hf).reduce(function(pf,mf,gf){if(gf===0){var yf=ff[mf];return yf%10*9+Math.floor(yf/10)}return gf===9?(10-pf%10-Number(mf))%10===0:pf+Number(mf)*(9-gf)},0):!1}};function uf(df,ff){if((0,bo.default)(df),ff in mc)return mc[ff](df);if(ff==="any"){for(var hf in mc)if(mc.hasOwnProperty(hf)){var pf=mc[hf];if(pf(df))return!0}return!1}throw new Error("Invalid locale '".concat(ff,"'"))}vo.exports=Ai.default,vo.exports.default=Ai.default}(isIdentityCard,isIdentityCard.exports)),isIdentityCard.exports}var isEAN={exports:{}},hasRequiredIsEAN;function requireIsEAN(){return hasRequiredIsEAN||(hasRequiredIsEAN=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=hf;var bo=Ra(requireAssertString());function Ra(pf){return pf&&pf.__esModule?pf:{default:pf}}var pc=8,mc=14,uf=/^(\d{8}|\d{13}|\d{14})$/;function df(pf,mf){return pf===pc||pf===mc?mf%2===0?3:1:mf%2===0?1:3}function ff(pf){var mf=pf.slice(0,-1).split("").map(function(yf,vf){return Number(yf)*df(pf.length,vf)}).reduce(function(yf,vf){return yf+vf},0),gf=10-mf%10;return gf<10?gf:0}function hf(pf){(0,bo.default)(pf);var mf=Number(pf.slice(-1));return uf.test(pf)&&mf===ff(pf)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isEAN,isEAN.exports)),isEAN.exports}var isISIN={exports:{}},hasRequiredIsISIN;function requireIsISIN(){return hasRequiredIsISIN||(hasRequiredIsISIN=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=mc;var bo=Ra(requireAssertString());function Ra(uf){return uf&&uf.__esModule?uf:{default:uf}}var pc=/^[A-Z]{2}[0-9A-Z]{9}[0-9]$/;function mc(uf){if((0,bo.default)(uf),!pc.test(uf))return!1;for(var df=!0,ff=0,hf=uf.length-2;hf>=0;hf--)if(uf[hf]>="A"&&uf[hf]<="Z")for(var pf=uf[hf].charCodeAt(0)-55,mf=pf%10,gf=Math.trunc(pf/10),yf=0,vf=[mf,gf];yf<vf.length;yf++){var bf=vf[yf];df?bf>=5?ff+=1+(bf-5)*2:ff+=bf*2:ff+=bf,df=!df}else{var Sf=uf[hf].charCodeAt(0)-48;df?Sf>=5?ff+=1+(Sf-5)*2:ff+=Sf*2:ff+=Sf,df=!df}var xf=Math.trunc((ff+9)/10)*10-ff;return+uf[uf.length-1]===xf}vo.exports=Ai.default,vo.exports.default=Ai.default}(isISIN,isISIN.exports)),isISIN.exports}var isISBN={exports:{}},hasRequiredIsISBN;function requireIsISBN(){return hasRequiredIsISBN||(hasRequiredIsISBN=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=df;var bo=Ra(requireAssertString());function Ra(ff){return ff&&ff.__esModule?ff:{default:ff}}var pc=/^(?:[0-9]{9}X|[0-9]{10})$/,mc=/^(?:[0-9]{13})$/,uf=[1,3];function df(ff,hf){(0,bo.default)(ff);var pf=String((hf==null?void 0:hf.version)||hf);if(!(hf!=null&&hf.version||hf))return df(ff,{version:10})||df(ff,{version:13});var mf=ff.replace(/[\s-]+/g,""),gf=0;if(pf==="10"){if(!pc.test(mf))return!1;for(var yf=0;yf<pf-1;yf++)gf+=(yf+1)*mf.charAt(yf);if(mf.charAt(9)==="X"?gf+=10*10:gf+=10*mf.charAt(9),gf%11===0)return!0}else if(pf==="13"){if(!mc.test(mf))return!1;for(var vf=0;vf<12;vf++)gf+=uf[vf%2]*mf.charAt(vf);if(mf.charAt(12)-(10-gf%10)%10===0)return!0}return!1}vo.exports=Ai.default,vo.exports.default=Ai.default}(isISBN,isISBN.exports)),isISBN.exports}var isISSN={exports:{}},hasRequiredIsISSN;function requireIsISSN(){return hasRequiredIsISSN||(hasRequiredIsISSN=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=mc;var bo=Ra(requireAssertString());function Ra(uf){return uf&&uf.__esModule?uf:{default:uf}}var pc="^\\d{4}-?\\d{3}[\\dX]$";function mc(uf){var df=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(0,bo.default)(uf);var ff=pc;if(ff=df.require_hyphen?ff.replace("?",""):ff,ff=df.case_sensitive?new RegExp(ff):new RegExp(ff,"i"),!ff.test(uf))return!1;for(var hf=uf.replace("-","").toUpperCase(),pf=0,mf=0;mf<hf.length;mf++){var gf=hf[mf];pf+=(gf==="X"?10:+gf)*(8-mf)}return pf%11===0}vo.exports=Ai.default,vo.exports.default=Ai.default}(isISSN,isISSN.exports)),isISSN.exports}var isTaxID={exports:{}},algorithms={},hasRequiredAlgorithms;function requireAlgorithms(){if(hasRequiredAlgorithms)return algorithms;hasRequiredAlgorithms=1,Object.defineProperty(algorithms,"__esModule",{value:!0}),algorithms.iso7064Check=vo,algorithms.luhnCheck=Ai,algorithms.reverseMultiplyAndSum=bo,algorithms.verhoeffCheck=Ra;function vo(pc){for(var mc=10,uf=0;uf<pc.length-1;uf++)mc=(parseInt(pc[uf],10)+mc)%10===0?10*2%11:(parseInt(pc[uf],10)+mc)%10*2%11;return mc=mc===1?0:11-mc,mc===parseInt(pc[10],10)}function Ai(pc){for(var mc=0,uf=!1,df=pc.length-1;df>=0;df--){if(uf){var ff=parseInt(pc[df],10)*2;ff>9?mc+=ff.toString().split("").map(function(hf){return parseInt(hf,10)}).reduce(function(hf,pf){return hf+pf},0):mc+=ff}else mc+=parseInt(pc[df],10);uf=!uf}return mc%10===0}function bo(pc,mc){for(var uf=0,df=0;df<pc.length;df++)uf+=pc[df]*(mc-df);return uf}function Ra(pc){for(var mc=[[0,1,2,3,4,5,6,7,8,9],[1,2,3,4,0,6,7,8,9,5],[2,3,4,0,1,7,8,9,5,6],[3,4,0,1,2,8,9,5,6,7],[4,0,1,2,3,9,5,6,7,8],[5,9,8,7,6,0,4,3,2,1],[6,5,9,8,7,1,0,4,3,2],[7,6,5,9,8,2,1,0,4,3],[8,7,6,5,9,3,2,1,0,4],[9,8,7,6,5,4,3,2,1,0]],uf=[[0,1,2,3,4,5,6,7,8,9],[1,5,7,6,2,8,3,0,9,4],[5,8,0,3,7,9,6,1,4,2],[8,9,1,6,0,4,3,5,2,7],[9,4,5,3,1,2,6,8,7,0],[4,2,8,6,5,7,3,9,0,1],[2,7,9,3,8,0,6,4,1,5],[7,0,4,6,9,1,3,2,5,8]],df=pc.split("").reverse().join(""),ff=0,hf=0;hf<df.length;hf++)ff=mc[ff][uf[hf%8][parseInt(df[hf],10)]];return ff===0}return algorithms}var hasRequiredIsTaxID;function requireIsTaxID(){return hasRequiredIsTaxID||(hasRequiredIsTaxID=1,function(vo,Ai){function bo(d1){"@babel/helpers - typeof";return bo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(f1){return typeof f1}:function(f1){return f1&&typeof Symbol=="function"&&f1.constructor===Symbol&&f1!==Symbol.prototype?"symbol":typeof f1},bo(d1)}Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=D1;var Ra=ff(requireAssertString()),pc=df(requireAlgorithms()),mc=ff(requireIsDate());function uf(d1){if(typeof WeakMap!="function")return null;var f1=new WeakMap,A1=new WeakMap;return(uf=function(Q1){return Q1?A1:f1})(d1)}function df(d1,f1){if(d1&&d1.__esModule)return d1;if(d1===null||bo(d1)!="object"&&typeof d1!="function")return{default:d1};var A1=uf(f1);if(A1&&A1.has(d1))return A1.get(d1);var Q1={__proto__:null},q1=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var H1 in d1)if(H1!=="default"&&{}.hasOwnProperty.call(d1,H1)){var J1=q1?Object.getOwnPropertyDescriptor(d1,H1):null;J1&&(J1.get||J1.set)?Object.defineProperty(Q1,H1,J1):Q1[H1]=d1[H1]}return Q1.default=d1,A1&&A1.set(d1,Q1),Q1}function ff(d1){return d1&&d1.__esModule?d1:{default:d1}}function hf(d1){return yf(d1)||gf(d1)||mf(d1)||pf()}function pf(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
344
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mf(d1,f1){if(d1){if(typeof d1=="string")return vf(d1,f1);var A1=Object.prototype.toString.call(d1).slice(8,-1);if(A1==="Object"&&d1.constructor&&(A1=d1.constructor.name),A1==="Map"||A1==="Set")return Array.from(d1);if(A1==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(A1))return vf(d1,f1)}}function gf(d1){if(typeof Symbol<"u"&&d1[Symbol.iterator]!=null||d1["@@iterator"]!=null)return Array.from(d1)}function yf(d1){if(Array.isArray(d1))return vf(d1)}function vf(d1,f1){(f1==null||f1>d1.length)&&(f1=d1.length);for(var A1=0,Q1=new Array(f1);A1<f1;A1++)Q1[A1]=d1[A1];return Q1}function bf(d1){var f1=d1.slice(0,2),A1=parseInt(d1.slice(2,4),10);A1>40?(A1-=40,f1="20".concat(f1)):A1>20?(A1-=20,f1="18".concat(f1)):f1="19".concat(f1),A1<10&&(A1="0".concat(A1));var Q1="".concat(f1,"/").concat(A1,"/").concat(d1.slice(4,6));if(!(0,mc.default)(Q1,"YYYY/MM/DD"))return!1;for(var q1=d1.split("").map(function(rT){return parseInt(rT,10)}),H1=[2,4,8,5,10,9,7,3,6],J1=0,eT=0;eT<H1.length;eT++)J1+=q1[eT]*H1[eT];return J1=J1%11===10?0:J1%11,J1===q1[9]}function Sf(d1){var f1=d1.split(""),A1=f1.filter(function(q1,H1){return H1%2}).map(function(q1){return Number(q1)*2}).join("").split(""),Q1=f1.filter(function(q1,H1){return!(H1%2)}).concat(A1).map(function(q1){return Number(q1)}).reduce(function(q1,H1){return q1+H1});return Q1%10===0}function xf(d1){d1=d1.replace(/\W/,"");var f1=parseInt(d1.slice(0,2),10);if(d1.length===10)f1<54?f1="20".concat(f1):f1="19".concat(f1);else{if(d1.slice(6)==="000")return!1;if(f1<54)f1="19".concat(f1);else return!1}f1.length===3&&(f1=[f1.slice(0,2),"0",f1.slice(2)].join(""));var A1=parseInt(d1.slice(2,4),10);if(A1>50&&(A1-=50),A1>20){if(parseInt(f1,10)<2004)return!1;A1-=20}A1<10&&(A1="0".concat(A1));var Q1="".concat(f1,"/").concat(A1,"/").concat(d1.slice(4,6));if(!(0,mc.default)(Q1,"YYYY/MM/DD"))return!1;if(d1.length===10&&parseInt(d1,10)%11!==0){var q1=parseInt(d1.slice(0,9),10)%11;if(parseInt(f1,10)<1986&&q1===10){if(parseInt(d1.slice(9),10)!==0)return!1}else return!1}return!0}function wf(d1){return pc.luhnCheck(d1)}function If(d1){for(var f1=d1.split("").map(function(rT){return parseInt(rT,10)}),A1=[],Q1=0;Q1<f1.length-1;Q1++){A1.push("");for(var q1=0;q1<f1.length-1;q1++)f1[Q1]===f1[q1]&&(A1[Q1]+=q1)}if(A1=A1.filter(function(rT){return rT.length>1}),A1.length!==2&&A1.length!==3)return!1;if(A1[0].length===3){for(var H1=A1[0].split("").map(function(rT){return parseInt(rT,10)}),J1=0,eT=0;eT<H1.length-1;eT++)H1[eT]+1===H1[eT+1]&&(J1+=1);if(J1===2)return!1}return pc.iso7064Check(d1)}function l1(d1){d1=d1.replace(/\W/,"");var f1=parseInt(d1.slice(4,6),10),A1=d1.slice(6,7);switch(A1){case"0":case"1":case"2":case"3":f1="19".concat(f1);break;case"4":case"9":f1<37?f1="20".concat(f1):f1="19".concat(f1);break;default:if(f1<37)f1="20".concat(f1);else if(f1>58)f1="18".concat(f1);else return!1;break}f1.length===3&&(f1=[f1.slice(0,2),"0",f1.slice(2)].join(""));var Q1="".concat(f1,"/").concat(d1.slice(2,4),"/").concat(d1.slice(0,2));if(!(0,mc.default)(Q1,"YYYY/MM/DD"))return!1;for(var q1=d1.split("").map(function(rT){return parseInt(rT,10)}),H1=0,J1=4,eT=0;eT<9;eT++)H1+=q1[eT]*J1,J1-=1,J1===1&&(J1=7);return H1%=11,H1===1?!1:H1===0?q1[9]===0:q1[9]===11-H1}function s1(d1){for(var f1=d1.slice(0,8).split("").map(function(H1){return parseInt(H1,10)}),A1=0,Q1=1;Q1<f1.length;Q1+=2)A1+=f1[Q1];for(var q1=0;q1<f1.length;q1+=2)f1[q1]<2?A1+=1-f1[q1]:(A1+=2*(f1[q1]-2)+5,f1[q1]>4&&(A1+=2));return String.fromCharCode(A1%26+65)===d1.charAt(8)}function c1(d1){for(var f1=d1.split("").map(function(q1){return parseInt(q1,10)}),A1=0,Q1=0;Q1<8;Q1++)A1+=f1[Q1]*Math.pow(2,8-Q1);return A1%11%10===f1[8]}function u1(d1){var f1=pc.reverseMultiplyAndSum(d1.split("").slice(0,7).map(function(A1){return parseInt(A1,10)}),8);return d1.length===9&&d1[8]!=="W"&&(f1+=(d1[8].charCodeAt(0)-64)*9),f1%=23,f1===0?d1[7].toUpperCase()==="W":d1[7].toUpperCase()===String.fromCharCode(64+f1)}var T1={andover:["10","12"],atlanta:["60","67"],austin:["50","53"],brookhaven:["01","02","03","04","05","06","11","13","14","16","21","22","23","25","34","51","52","54","55","56","57","58","59","65"],cincinnati:["30","32","35","36","37","38","61"],fresno:["15","24"],internet:["20","26","27","45","46","47"],kansas:["40","44"],memphis:["94","95"],ogden:["80","90"],philadelphia:["33","39","41","42","43","46","48","62","63","64","66","68","71","72","73","74","75","76","77","81","82","83","84","85","86","87","88","91","92","93","98","99"],sba:["31"]};function _1(){var d1=[];for(var f1 in T1)T1.hasOwnProperty(f1)&&d1.push.apply(d1,hf(T1[f1]));return d1}function R1(d1){return _1().indexOf(d1.slice(0,2))!==-1}function P1(d1){for(var f1=0,A1=d1.split(""),Q1=parseInt(A1.pop(),10),q1=0;q1<A1.length;q1++)f1+=A1[9-q1]*(2+q1%6);var H1=11-f1%11;return H1===11?H1=0:H1===10&&(H1=9),Q1===H1}function E1(d1){var f1=d1.toUpperCase().split("");if(isNaN(parseInt(f1[0],10))&&f1.length>1){var A1=0;switch(f1[0]){case"Y":A1=1;break;case"Z":A1=2;break}f1.splice(0,1,A1)}else for(;f1.length<9;)f1.unshift(0);var Q1=["T","R","W","A","G","M","Y","F","P","D","X","B","N","J","Z","S","Q","V","H","L","C","K","E"];f1=f1.join("");var q1=parseInt(f1.slice(0,8),10)%23;return f1[8]===Q1[q1]}function M1(d1){var f1=d1.slice(1,3),A1=d1.slice(0,1);switch(A1){case"1":case"2":f1="18".concat(f1);break;case"3":case"4":f1="19".concat(f1);break;default:f1="20".concat(f1);break}var Q1="".concat(f1,"/").concat(d1.slice(3,5),"/").concat(d1.slice(5,7));if(!(0,mc.default)(Q1,"YYYY/MM/DD"))return!1;for(var q1=d1.split("").map(function(sT){return parseInt(sT,10)}),H1=0,J1=1,eT=0;eT<10;eT++)H1+=q1[eT]*J1,J1+=1,J1===10&&(J1=1);if(H1%11===10){H1=0,J1=3;for(var rT=0;rT<10;rT++)H1+=q1[rT]*J1,J1+=1,J1===10&&(J1=1);if(H1%11===10)return q1[10]===0}return H1%11===q1[10]}function m1(d1){var f1=d1.slice(4,6),A1=d1.slice(6,7);switch(A1){case"+":f1="18".concat(f1);break;case"-":f1="19".concat(f1);break;default:f1="20".concat(f1);break}var Q1="".concat(f1,"/").concat(d1.slice(2,4),"/").concat(d1.slice(0,2));if(!(0,mc.default)(Q1,"YYYY/MM/DD"))return!1;var q1=parseInt(d1.slice(0,6)+d1.slice(7,10),10)%31;if(q1<10)return q1===parseInt(d1.slice(10),10);q1-=10;var H1=["A","B","C","D","E","F","H","J","K","L","M","N","P","R","S","T","U","V","W","X","Y"];return H1[q1]===d1.slice(10)}function $1(d1){if(d1.slice(2,4)!=="00"||d1.slice(4,6)!=="00"){var f1="".concat(d1.slice(0,2),"/").concat(d1.slice(2,4),"/").concat(d1.slice(4,6));if(!(0,mc.default)(f1,"YY/MM/DD"))return!1}var A1=97-parseInt(d1.slice(0,9),10)%97,Q1=parseInt(d1.slice(9,11),10);return!(A1!==Q1&&(A1=97-parseInt("2".concat(d1.slice(0,9)),10)%97,A1!==Q1))}function k1(d1){d1=d1.replace(/\s/g,"");var f1=parseInt(d1.slice(0,10),10)%511,A1=parseInt(d1.slice(10,13),10);return f1===A1}function F1(d1){var f1="".concat(d1.slice(0,4),"/").concat(d1.slice(4,6),"/").concat(d1.slice(6,8));return!(0,mc.default)(f1,"YYYY/MM/DD")||!pc.luhnCheck(d1.slice(0,12))?!1:pc.verhoeffCheck("".concat(d1.slice(0,11)).concat(d1[12]))}function U1(d1){return pc.iso7064Check(d1)}function B1(d1){for(var f1=d1.split("").map(function(q1){return parseInt(q1,10)}),A1=8,Q1=1;Q1<9;Q1++)A1+=f1[Q1]*(Q1+1);return A1%11===f1[9]}function W1(d1){for(var f1=!1,A1=!1,Q1=0;Q1<3;Q1++)if(!f1&&/[AEIOU]/.test(d1[Q1]))f1=!0;else if(!A1&&f1&&d1[Q1]==="X")A1=!0;else if(Q1>0&&(f1&&!A1&&!/[AEIOU]/.test(d1[Q1])||A1&&!/X/.test(d1[Q1])))return!1;return!0}function Z1(d1){var f1=d1.toUpperCase().split("");if(!W1(f1.slice(0,3))||!W1(f1.slice(3,6)))return!1;for(var A1=[6,7,9,10,12,13,14],Q1={L:"0",M:"1",N:"2",P:"3",Q:"4",R:"5",S:"6",T:"7",U:"8",V:"9"},q1=0,H1=A1;q1<H1.length;q1++){var J1=H1[q1];f1[J1]in Q1&&f1.splice(J1,1,Q1[f1[J1]])}var eT={A:"01",B:"02",C:"03",D:"04",E:"05",H:"06",L:"07",M:"08",P:"09",R:"10",S:"11",T:"12"},rT=eT[f1[8]],sT=parseInt(f1[9]+f1[10],10);sT>40&&(sT-=40),sT<10&&(sT="0".concat(sT));var dT="".concat(f1[6]).concat(f1[7],"/").concat(rT,"/").concat(sT);if(!(0,mc.default)(dT,"YY/MM/DD"))return!1;for(var fT=0,uT=1;uT<f1.length-1;uT+=2){var mT=parseInt(f1[uT],10);isNaN(mT)&&(mT=f1[uT].charCodeAt(0)-65),fT+=mT}for(var pT={A:1,B:0,C:5,D:7,E:9,F:13,G:15,H:17,I:19,J:21,K:2,L:4,M:18,N:20,O:11,P:3,Q:6,R:8,S:12,T:14,U:16,V:10,W:22,X:25,Y:24,Z:23,0:1,1:0},gT=0;gT<f1.length-1;gT+=2){var bT=0;if(f1[gT]in pT)bT=pT[f1[gT]];else{var xT=parseInt(f1[gT],10);bT=2*xT+1,xT>4&&(bT+=2)}fT+=bT}return String.fromCharCode(65+fT%26)===f1[15]}function O1(d1){d1=d1.replace(/\W/,"");var f1=d1.slice(0,2);if(f1!=="32"){var A1=d1.slice(2,4);if(A1!=="00"){var Q1=d1.slice(4,6);switch(d1[6]){case"0":Q1="18".concat(Q1);break;case"1":Q1="19".concat(Q1);break;default:Q1="20".concat(Q1);break}var q1="".concat(Q1,"/").concat(d1.slice(2,4),"/").concat(f1);if(!(0,mc.default)(q1,"YYYY/MM/DD"))return!1}for(var H1=1101,J1=[1,6,3,7,9,10,5,8,4,2],eT=0;eT<d1.length-1;eT++)H1-=parseInt(d1[eT],10)*J1[eT];return parseInt(d1[10],10)===H1%11}return!0}function j1(d1){if(d1.length!==9){for(var f1=d1.toUpperCase().split("");f1.length<8;)f1.unshift(0);switch(d1[7]){case"A":case"P":if(parseInt(f1[6],10)===0)return!1;break;default:{var A1=parseInt(f1.join("").slice(0,5),10);if(A1>32e3)return!1;var Q1=parseInt(f1.join("").slice(5,7),10);if(A1===Q1)return!1}}}return!0}function L1(d1){return pc.reverseMultiplyAndSum(d1.split("").slice(0,8).map(function(f1){return parseInt(f1,10)}),9)%11===parseInt(d1[8],10)}function G1(d1){if(d1.length===10){for(var f1=[6,5,7,2,3,4,5,6,7],A1=0,Q1=0;Q1<f1.length;Q1++)A1+=parseInt(d1[Q1],10)*f1[Q1];return A1%=11,A1===10?!1:A1===parseInt(d1[9],10)}var q1=d1.slice(0,2),H1=parseInt(d1.slice(2,4),10);H1>80?(q1="18".concat(q1),H1-=80):H1>60?(q1="22".concat(q1),H1-=60):H1>40?(q1="21".concat(q1),H1-=40):H1>20?(q1="20".concat(q1),H1-=20):q1="19".concat(q1),H1<10&&(H1="0".concat(H1));var J1="".concat(q1,"/").concat(H1,"/").concat(d1.slice(4,6));if(!(0,mc.default)(J1,"YYYY/MM/DD"))return!1;for(var eT=0,rT=1,sT=0;sT<d1.length-1;sT++)eT+=parseInt(d1[sT],10)*rT%10,rT+=2,rT>10?rT=1:rT===5&&(rT+=2);return eT=10-eT%10,eT===parseInt(d1[10],10)}function Y1(d1){if(d1.length===11){var f1,A1;if(f1=0,d1==="11111111111"||d1==="22222222222"||d1==="33333333333"||d1==="44444444444"||d1==="55555555555"||d1==="66666666666"||d1==="77777777777"||d1==="88888888888"||d1==="99999999999"||d1==="00000000000")return!1;for(var Q1=1;Q1<=9;Q1++)f1+=parseInt(d1.substring(Q1-1,Q1),10)*(11-Q1);if(A1=f1*10%11,A1===10&&(A1=0),A1!==parseInt(d1.substring(9,10),10))return!1;f1=0;for(var q1=1;q1<=10;q1++)f1+=parseInt(d1.substring(q1-1,q1),10)*(12-q1);return A1=f1*10%11,A1===10&&(A1=0),A1===parseInt(d1.substring(10,11),10)}if(d1==="00000000000000"||d1==="11111111111111"||d1==="22222222222222"||d1==="33333333333333"||d1==="44444444444444"||d1==="55555555555555"||d1==="66666666666666"||d1==="77777777777777"||d1==="88888888888888"||d1==="99999999999999")return!1;for(var H1=d1.length-2,J1=d1.substring(0,H1),eT=d1.substring(H1),rT=0,sT=H1-7,dT=H1;dT>=1;dT--)rT+=J1.charAt(H1-dT)*sT,sT-=1,sT<2&&(sT=9);var fT=rT%11<2?0:11-rT%11;if(fT!==parseInt(eT.charAt(0),10))return!1;H1+=1,J1=d1.substring(0,H1),rT=0,sT=H1-7;for(var uT=H1;uT>=1;uT--)rT+=J1.charAt(H1-uT)*sT,sT-=1,sT<2&&(sT=9);return fT=rT%11<2?0:11-rT%11,fT===parseInt(eT.charAt(1),10)}function z1(d1){var f1=11-pc.reverseMultiplyAndSum(d1.split("").slice(0,8).map(function(A1){return parseInt(A1,10)}),9)%11;return f1>9?parseInt(d1[8],10)===0:f1===parseInt(d1[8],10)}function K1(d1){if(d1.slice(0,4)!=="9000"){var f1=d1.slice(1,3);switch(d1[0]){case"1":case"2":f1="19".concat(f1);break;case"3":case"4":f1="18".concat(f1);break;case"5":case"6":f1="20".concat(f1);break}var A1="".concat(f1,"/").concat(d1.slice(3,5),"/").concat(d1.slice(5,7));if(A1.length===8){if(!(0,mc.default)(A1,"YY/MM/DD"))return!1}else if(!(0,mc.default)(A1,"YYYY/MM/DD"))return!1;for(var Q1=d1.split("").map(function(eT){return parseInt(eT,10)}),q1=[2,7,9,1,4,6,3,5,8,2,7,9],H1=0,J1=0;J1<q1.length;J1++)H1+=Q1[J1]*q1[J1];return H1%11===10?Q1[12]===1:Q1[12]===H1%11}return!0}function tT(d1){if(d1.length===9){if(d1=d1.replace(/\W/,""),d1.slice(6)==="000")return!1;var f1=parseInt(d1.slice(0,2),10);if(f1>53)return!1;f1<10?f1="190".concat(f1):f1="19".concat(f1);var A1=parseInt(d1.slice(2,4),10);A1>50&&(A1-=50),A1<10&&(A1="0".concat(A1));var Q1="".concat(f1,"/").concat(A1,"/").concat(d1.slice(4,6));if(!(0,mc.default)(Q1,"YYYY/MM/DD"))return!1}return!0}function iT(d1){var f1=11-pc.reverseMultiplyAndSum(d1.split("").slice(0,7).map(function(A1){return parseInt(A1,10)}),8)%11;return f1===10?parseInt(d1[7],10)===0:f1===parseInt(d1[7],10)}function aT(d1){var f1=d1.slice(0);d1.length>11&&(f1=f1.slice(2));var A1="",Q1=f1.slice(2,4),q1=parseInt(f1.slice(4,6),10);if(d1.length>11)A1=d1.slice(0,4);else if(A1=d1.slice(0,2),d1.length===11&&q1<60){var H1=new Date().getFullYear().toString(),J1=parseInt(H1.slice(0,2),10);if(H1=parseInt(H1,10),d1[6]==="-")parseInt("".concat(J1).concat(A1),10)>H1?A1="".concat(J1-1).concat(A1):A1="".concat(J1).concat(A1);else if(A1="".concat(J1-1).concat(A1),H1-parseInt(A1,10)<100)return!1}q1>60&&(q1-=60),q1<10&&(q1="0".concat(q1));var eT="".concat(A1,"/").concat(Q1,"/").concat(q1);if(eT.length===8){if(!(0,mc.default)(eT,"YY/MM/DD"))return!1}else if(!(0,mc.default)(eT,"YYYY/MM/DD"))return!1;return pc.luhnCheck(d1.replace(/\W/,""))}function oT(d1){for(var f1=d1.split("").map(function(H1){return parseInt(H1,10)}),A1=[-1,5,7,9,4,6,10,5,7],Q1=0,q1=0;q1<A1.length;q1++)Q1+=f1[q1]*A1[q1];return Q1%11===10?f1[9]===0:f1[9]===Q1%11}var nT={"bg-BG":/^\d{10}$/,"cs-CZ":/^\d{6}\/{0,1}\d{3,4}$/,"de-AT":/^\d{9}$/,"de-DE":/^[1-9]\d{10}$/,"dk-DK":/^\d{6}-{0,1}\d{4}$/,"el-CY":/^[09]\d{7}[A-Z]$/,"el-GR":/^([0-4]|[7-9])\d{8}$/,"en-CA":/^\d{9}$/,"en-GB":/^\d{10}$|^(?!GB|NK|TN|ZZ)(?![DFIQUV])[A-Z](?![DFIQUVO])[A-Z]\d{6}[ABCD ]$/i,"en-IE":/^\d{7}[A-W][A-IW]{0,1}$/i,"en-US":/^\d{2}[- ]{0,1}\d{7}$/,"es-AR":/(20|23|24|27|30|33|34)[0-9]{8}[0-9]/,"es-ES":/^(\d{0,8}|[XYZKLM]\d{7})[A-HJ-NP-TV-Z]$/i,"et-EE":/^[1-6]\d{6}(00[1-9]|0[1-9][0-9]|[1-6][0-9]{2}|70[0-9]|710)\d$/,"fi-FI":/^\d{6}[-+A]\d{3}[0-9A-FHJ-NPR-Y]$/i,"fr-BE":/^\d{11}$/,"fr-FR":/^[0-3]\d{12}$|^[0-3]\d\s\d{2}(\s\d{3}){3}$/,"fr-LU":/^\d{13}$/,"hr-HR":/^\d{11}$/,"hu-HU":/^8\d{9}$/,"it-IT":/^[A-Z]{6}[L-NP-V0-9]{2}[A-EHLMPRST][L-NP-V0-9]{2}[A-ILMZ][L-NP-V0-9]{3}[A-Z]$/i,"lv-LV":/^\d{6}-{0,1}\d{5}$/,"mt-MT":/^\d{3,7}[APMGLHBZ]$|^([1-8])\1\d{7}$/i,"nl-NL":/^\d{9}$/,"pl-PL":/^\d{10,11}$/,"pt-BR":/(?:^\d{11}$)|(?:^\d{14}$)/,"pt-PT":/^\d{9}$/,"ro-RO":/^\d{13}$/,"sk-SK":/^\d{6}\/{0,1}\d{3,4}$/,"sl-SI":/^[1-9]\d{7}$/,"sv-SE":/^(\d{6}[-+]{0,1}\d{4}|(18|19|20)\d{6}[-+]{0,1}\d{4})$/,"uk-UA":/^\d{10}$/};nT["lb-LU"]=nT["fr-LU"],nT["lt-LT"]=nT["et-EE"],nT["nl-BE"]=nT["fr-BE"],nT["fr-CA"]=nT["en-CA"];var cT={"bg-BG":bf,"cs-CZ":xf,"de-AT":wf,"de-DE":If,"dk-DK":l1,"el-CY":s1,"el-GR":c1,"en-CA":Sf,"en-IE":u1,"en-US":R1,"es-AR":P1,"es-ES":E1,"et-EE":M1,"fi-FI":m1,"fr-BE":$1,"fr-FR":k1,"fr-LU":F1,"hr-HR":U1,"hu-HU":B1,"it-IT":Z1,"lv-LV":O1,"mt-MT":j1,"nl-NL":L1,"pl-PL":G1,"pt-BR":Y1,"pt-PT":z1,"ro-RO":K1,"sk-SK":tT,"sl-SI":iT,"sv-SE":aT,"uk-UA":oT};cT["lb-LU"]=cT["fr-LU"],cT["lt-LT"]=cT["et-EE"],cT["nl-BE"]=cT["fr-BE"],cT["fr-CA"]=cT["en-CA"];var N1=/[-\\\/!@#$%\^&\*\(\)\+\=\[\]]+/g,V1={"de-AT":N1,"de-DE":/[\/\\]/g,"fr-BE":N1};V1["nl-BE"]=V1["fr-BE"];function D1(d1){var f1=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"en-US";(0,Ra.default)(d1);var A1=d1.slice(0);if(f1 in nT)return f1 in V1&&(A1=A1.replace(V1[f1],"")),nT[f1].test(A1)?f1 in cT?cT[f1](A1):!0:!1;throw new Error("Invalid locale '".concat(f1,"'"))}vo.exports=Ai.default,vo.exports.default=Ai.default}(isTaxID,isTaxID.exports)),isTaxID.exports}var isMobilePhone={},hasRequiredIsMobilePhone;function requireIsMobilePhone(){if(hasRequiredIsMobilePhone)return isMobilePhone;hasRequiredIsMobilePhone=1,Object.defineProperty(isMobilePhone,"__esModule",{value:!0}),isMobilePhone.default=Ra,isMobilePhone.locales=void 0;var vo=Ai(requireAssertString());function Ai(pc){return pc&&pc.__esModule?pc:{default:pc}}var bo={"am-AM":/^(\+?374|0)(33|4[134]|55|77|88|9[13-689])\d{6}$/,"ar-AE":/^((\+?971)|0)?5[024568]\d{7}$/,"ar-BH":/^(\+?973)?(3|6)\d{7}$/,"ar-DZ":/^(\+?213|0)(5|6|7)\d{8}$/,"ar-LB":/^(\+?961)?((3|81)\d{6}|7\d{7})$/,"ar-EG":/^((\+?20)|0)?1[0125]\d{8}$/,"ar-IQ":/^(\+?964|0)?7[0-9]\d{8}$/,"ar-JO":/^(\+?962|0)?7[789]\d{7}$/,"ar-KW":/^(\+?965)([569]\d{7}|41\d{6})$/,"ar-LY":/^((\+?218)|0)?(9[1-6]\d{7}|[1-8]\d{7,9})$/,"ar-MA":/^(?:(?:\+|00)212|0)[5-7]\d{8}$/,"ar-OM":/^((\+|00)968)?(9[1-9])\d{6}$/,"ar-PS":/^(\+?970|0)5[6|9](\d{7})$/,"ar-SA":/^(!?(\+?966)|0)?5\d{8}$/,"ar-SD":/^((\+?249)|0)?(9[012369]|1[012])\d{7}$/,"ar-SY":/^(!?(\+?963)|0)?9\d{8}$/,"ar-TN":/^(\+?216)?[2459]\d{7}$/,"az-AZ":/^(\+994|0)(10|5[015]|7[07]|99)\d{7}$/,"bs-BA":/^((((\+|00)3876)|06))((([0-3]|[5-6])\d{6})|(4\d{7}))$/,"be-BY":/^(\+?375)?(24|25|29|33|44)\d{7}$/,"bg-BG":/^(\+?359|0)?8[789]\d{7}$/,"bn-BD":/^(\+?880|0)1[13456789][0-9]{8}$/,"ca-AD":/^(\+376)?[346]\d{5}$/,"cs-CZ":/^(\+?420)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,"da-DK":/^(\+?45)?\s?\d{2}\s?\d{2}\s?\d{2}\s?\d{2}$/,"de-DE":/^((\+49|0)1)(5[0-25-9]\d|6([23]|0\d?)|7([0-57-9]|6\d))\d{7,9}$/,"de-AT":/^(\+43|0)\d{1,4}\d{3,12}$/,"de-CH":/^(\+41|0)([1-9])\d{1,9}$/,"de-LU":/^(\+352)?((6\d1)\d{6})$/,"dv-MV":/^(\+?960)?(7[2-9]|9[1-9])\d{5}$/,"el-GR":/^(\+?30|0)?6(8[5-9]|9(?![26])[0-9])\d{7}$/,"el-CY":/^(\+?357?)?(9(9|6)\d{6})$/,"en-AI":/^(\+?1|0)264(?:2(35|92)|4(?:6[1-2]|76|97)|5(?:3[6-9]|8[1-4])|7(?:2(4|9)|72))\d{4}$/,"en-AU":/^(\+?61|0)4\d{8}$/,"en-AG":/^(?:\+1|1)268(?:464|7(?:1[3-9]|[28]\d|3[0246]|64|7[0-689]))\d{4}$/,"en-BM":/^(\+?1)?441(((3|7)\d{6}$)|(5[0-3][0-9]\d{4}$)|(59\d{5}$))/,"en-BS":/^(\+?1[-\s]?|0)?\(?242\)?[-\s]?\d{3}[-\s]?\d{4}$/,"en-GB":/^(\+?44|0)7\d{9}$/,"en-GG":/^(\+?44|0)1481\d{6}$/,"en-GH":/^(\+233|0)(20|50|24|54|27|57|26|56|23|28|55|59)\d{7}$/,"en-GY":/^(\+592|0)6\d{6}$/,"en-HK":/^(\+?852[-\s]?)?[456789]\d{3}[-\s]?\d{4}$/,"en-MO":/^(\+?853[-\s]?)?[6]\d{3}[-\s]?\d{4}$/,"en-IE":/^(\+?353|0)8[356789]\d{7}$/,"en-IN":/^(\+?91|0)?[6789]\d{9}$/,"en-JM":/^(\+?876)?\d{7}$/,"en-KE":/^(\+?254|0)(7|1)\d{8}$/,"fr-CF":/^(\+?236| ?)(70|75|77|72|21|22)\d{6}$/,"en-SS":/^(\+?211|0)(9[1257])\d{7}$/,"en-KI":/^((\+686|686)?)?( )?((6|7)(2|3|8)[0-9]{6})$/,"en-KN":/^(?:\+1|1)869(?:46\d|48[89]|55[6-8]|66\d|76[02-7])\d{4}$/,"en-LS":/^(\+?266)(22|28|57|58|59|27|52)\d{6}$/,"en-MT":/^(\+?356|0)?(99|79|77|21|27|22|25)[0-9]{6}$/,"en-MU":/^(\+?230|0)?\d{8}$/,"en-MW":/^(\+?265|0)(((77|88|31|99|98|21)\d{7})|(((111)|1)\d{6})|(32000\d{4}))$/,"en-NA":/^(\+?264|0)(6|8)\d{7}$/,"en-NG":/^(\+?234|0)?[789]\d{9}$/,"en-NZ":/^(\+?64|0)[28]\d{7,9}$/,"en-PG":/^(\+?675|0)?(7\d|8[18])\d{6}$/,"en-PK":/^((00|\+)?92|0)3[0-6]\d{8}$/,"en-PH":/^(09|\+639)\d{9}$/,"en-RW":/^(\+?250|0)?[7]\d{8}$/,"en-SG":/^(\+65)?[3689]\d{7}$/,"en-SL":/^(\+?232|0)\d{8}$/,"en-TZ":/^(\+?255|0)?[67]\d{8}$/,"en-UG":/^(\+?256|0)?[7]\d{8}$/,"en-US":/^((\+1|1)?( |-)?)?(\([2-9][0-9]{2}\)|[2-9][0-9]{2})( |-)?([2-9][0-9]{2}( |-)?[0-9]{4})$/,"en-ZA":/^(\+?27|0)\d{9}$/,"en-ZM":/^(\+?26)?09[567]\d{7}$/,"en-ZW":/^(\+263)[0-9]{9}$/,"en-BW":/^(\+?267)?(7[1-8]{1})\d{6}$/,"es-AR":/^\+?549(11|[2368]\d)\d{8}$/,"es-BO":/^(\+?591)?(6|7)\d{7}$/,"es-CO":/^(\+?57)?3(0(0|1|2|4|5)|1\d|2[0-4]|5(0|1))\d{7}$/,"es-CL":/^(\+?56|0)[2-9]\d{1}\d{7}$/,"es-CR":/^(\+506)?[2-8]\d{7}$/,"es-CU":/^(\+53|0053)?5\d{7}$/,"es-DO":/^(\+?1)?8[024]9\d{7}$/,"es-HN":/^(\+?504)?[9|8|3|2]\d{7}$/,"es-EC":/^(\+?593|0)([2-7]|9[2-9])\d{7}$/,"es-ES":/^(\+?34)?[6|7]\d{8}$/,"es-PE":/^(\+?51)?9\d{8}$/,"es-MX":/^(\+?52)?(1|01)?\d{10,11}$/,"es-NI":/^(\+?505)\d{7,8}$/,"es-PA":/^(\+?507)\d{7,8}$/,"es-PY":/^(\+?595|0)9[9876]\d{7}$/,"es-SV":/^(\+?503)?[67]\d{7}$/,"es-UY":/^(\+598|0)9[1-9][\d]{6}$/,"es-VE":/^(\+?58)?(2|4)\d{9}$/,"et-EE":/^(\+?372)?\s?(5|8[1-4])\s?([0-9]\s?){6,7}$/,"fa-IR":/^(\+?98[\-\s]?|0)9[0-39]\d[\-\s]?\d{3}[\-\s]?\d{4}$/,"fi-FI":/^(\+?358|0)\s?(4[0-6]|50)\s?(\d\s?){4,8}$/,"fj-FJ":/^(\+?679)?\s?\d{3}\s?\d{4}$/,"fo-FO":/^(\+?298)?\s?\d{2}\s?\d{2}\s?\d{2}$/,"fr-BF":/^(\+226|0)[67]\d{7}$/,"fr-BJ":/^(\+229)\d{8}$/,"fr-CD":/^(\+?243|0)?(8|9)\d{8}$/,"fr-CM":/^(\+?237)6[0-9]{8}$/,"fr-FR":/^(\+?33|0)[67]\d{8}$/,"fr-GF":/^(\+?594|0|00594)[67]\d{8}$/,"fr-GP":/^(\+?590|0|00590)[67]\d{8}$/,"fr-MQ":/^(\+?596|0|00596)[67]\d{8}$/,"fr-PF":/^(\+?689)?8[789]\d{6}$/,"fr-RE":/^(\+?262|0|00262)[67]\d{8}$/,"fr-WF":/^(\+681)?\d{6}$/,"he-IL":/^(\+972|0)([23489]|5[012345689]|77)[1-9]\d{6}$/,"hu-HU":/^(\+?36|06)(20|30|31|50|70)\d{7}$/,"id-ID":/^(\+?62|0)8(1[123456789]|2[1238]|3[1238]|5[12356789]|7[78]|9[56789]|8[123456789])([\s?|\d]{5,11})$/,"ir-IR":/^(\+98|0)?9\d{9}$/,"it-IT":/^(\+?39)?\s?3\d{2} ?\d{6,7}$/,"it-SM":/^((\+378)|(0549)|(\+390549)|(\+3780549))?6\d{5,9}$/,"ja-JP":/^(\+81[ \-]?(\(0\))?|0)[6789]0[ \-]?\d{4}[ \-]?\d{4}$/,"ka-GE":/^(\+?995)?(79\d{7}|5\d{8})$/,"kk-KZ":/^(\+?7|8)?7\d{9}$/,"kl-GL":/^(\+?299)?\s?\d{2}\s?\d{2}\s?\d{2}$/,"ko-KR":/^((\+?82)[ \-]?)?0?1([0|1|6|7|8|9]{1})[ \-]?\d{3,4}[ \-]?\d{4}$/,"ky-KG":/^(\+?7\s?\+?7|0)\s?\d{2}\s?\d{3}\s?\d{4}$/,"lt-LT":/^(\+370|8)\d{8}$/,"lv-LV":/^(\+?371)2\d{7}$/,"mg-MG":/^((\+?261|0)(2|3)\d)?\d{7}$/,"mn-MN":/^(\+|00|011)?976(77|81|88|91|94|95|96|99)\d{6}$/,"my-MM":/^(\+?959|09|9)(2[5-7]|3[1-2]|4[0-5]|6[6-9]|7[5-9]|9[6-9])[0-9]{7}$/,"ms-MY":/^(\+?60|0)1(([0145](-|\s)?\d{7,8})|([236-9](-|\s)?\d{7}))$/,"mz-MZ":/^(\+?258)?8[234567]\d{7}$/,"nb-NO":/^(\+?47)?[49]\d{7}$/,"ne-NP":/^(\+?977)?9[78]\d{8}$/,"nl-BE":/^(\+?32|0)4\d{8}$/,"nl-NL":/^(((\+|00)?31\(0\))|((\+|00)?31)|0)6{1}\d{8}$/,"nl-AW":/^(\+)?297(56|59|64|73|74|99)\d{5}$/,"nn-NO":/^(\+?47)?[49]\d{7}$/,"pl-PL":/^(\+?48)? ?([5-8]\d|45) ?\d{3} ?\d{2} ?\d{2}$/,"pt-BR":/^((\+?55\ ?[1-9]{2}\ ?)|(\+?55\ ?\([1-9]{2}\)\ ?)|(0[1-9]{2}\ ?)|(\([1-9]{2}\)\ ?)|([1-9]{2}\ ?))((\d{4}\-?\d{4})|(9[1-9]{1}\d{3}\-?\d{4}))$/,"pt-PT":/^(\+?351)?9[1236]\d{7}$/,"pt-AO":/^(\+244)\d{9}$/,"ro-MD":/^(\+?373|0)((6(0|1|2|6|7|8|9))|(7(6|7|8|9)))\d{6}$/,"ro-RO":/^(\+?40|0)\s?7\d{2}(\/|\s|\.|-)?\d{3}(\s|\.|-)?\d{3}$/,"ru-RU":/^(\+?7|8)?9\d{9}$/,"si-LK":/^(?:0|94|\+94)?(7(0|1|2|4|5|6|7|8)( |-)?)\d{7}$/,"sl-SI":/^(\+386\s?|0)(\d{1}\s?\d{3}\s?\d{2}\s?\d{2}|\d{2}\s?\d{3}\s?\d{3})$/,"sk-SK":/^(\+?421)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,"so-SO":/^(\+?252|0)((6[0-9])\d{7}|(7[1-9])\d{7})$/,"sq-AL":/^(\+355|0)6[789]\d{6}$/,"sr-RS":/^(\+3816|06)[- \d]{5,9}$/,"sv-SE":/^(\+?46|0)[\s\-]?7[\s\-]?[02369]([\s\-]?\d){7}$/,"tg-TJ":/^(\+?992)?[5][5]\d{7}$/,"th-TH":/^(\+66|66|0)\d{9}$/,"tr-TR":/^(\+?90|0)?5\d{9}$/,"tk-TM":/^(\+993|993|8)\d{8}$/,"uk-UA":/^(\+?38|8)?0\d{9}$/,"uz-UZ":/^(\+?998)?(6[125-79]|7[1-69]|88|9\d)\d{7}$/,"vi-VN":/^((\+?84)|0)((3([2-9]))|(5([25689]))|(7([0|6-9]))|(8([1-9]))|(9([0-9])))([0-9]{7})$/,"zh-CN":/^((\+|00)86)?(1[3-9]|9[28])\d{9}$/,"zh-TW":/^(\+?886\-?|0)?9\d{8}$/,"dz-BT":/^(\+?975|0)?(17|16|77|02)\d{6}$/,"ar-YE":/^(((\+|00)9677|0?7)[0137]\d{7}|((\+|00)967|0)[1-7]\d{6})$/,"ar-EH":/^(\+?212|0)[\s\-]?(5288|5289)[\s\-]?\d{5}$/,"fa-AF":/^(\+93|0)?(2{1}[0-8]{1}|[3-5]{1}[0-4]{1})(\d{7})$/};bo["en-CA"]=bo["en-US"],bo["fr-CA"]=bo["en-CA"],bo["fr-BE"]=bo["nl-BE"],bo["zh-HK"]=bo["en-HK"],bo["zh-MO"]=bo["en-MO"],bo["ga-IE"]=bo["en-IE"],bo["fr-CH"]=bo["de-CH"],bo["it-CH"]=bo["fr-CH"];function Ra(pc,mc,uf){if((0,vo.default)(pc),uf&&uf.strictMode&&!pc.startsWith("+"))return!1;if(Array.isArray(mc))return mc.some(function(hf){if(bo.hasOwnProperty(hf)){var pf=bo[hf];if(pf.test(pc))return!0}return!1});if(mc in bo)return bo[mc].test(pc);if(!mc||mc==="any"){for(var df in bo)if(bo.hasOwnProperty(df)){var ff=bo[df];if(ff.test(pc))return!0}return!1}throw new Error("Invalid locale '".concat(mc,"'"))}return isMobilePhone.locales=Object.keys(bo),isMobilePhone}var isEthereumAddress={exports:{}},hasRequiredIsEthereumAddress;function requireIsEthereumAddress(){return hasRequiredIsEthereumAddress||(hasRequiredIsEthereumAddress=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=mc;var bo=Ra(requireAssertString());function Ra(uf){return uf&&uf.__esModule?uf:{default:uf}}var pc=/^(0x)[0-9a-f]{40}$/i;function mc(uf){return(0,bo.default)(uf),pc.test(uf)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isEthereumAddress,isEthereumAddress.exports)),isEthereumAddress.exports}var isCurrency={exports:{}},hasRequiredIsCurrency;function requireIsCurrency(){return hasRequiredIsCurrency||(hasRequiredIsCurrency=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=df;var bo=pc(requireMerge()),Ra=pc(requireAssertString());function pc(ff){return ff&&ff.__esModule?ff:{default:ff}}function mc(ff){var hf="\\d{".concat(ff.digits_after_decimal[0],"}");ff.digits_after_decimal.forEach(function(wf,If){If!==0&&(hf="".concat(hf,"|\\d{").concat(wf,"}"))});var pf="(".concat(ff.symbol.replace(/\W/,function(wf){return"\\".concat(wf)}),")").concat(ff.require_symbol?"":"?"),mf="-?",gf="[1-9]\\d*",yf="[1-9]\\d{0,2}(\\".concat(ff.thousands_separator,"\\d{3})*"),vf=["0",gf,yf],bf="(".concat(vf.join("|"),")?"),Sf="(\\".concat(ff.decimal_separator,"(").concat(hf,"))").concat(ff.require_decimal?"":"?"),xf=bf+(ff.allow_decimal||ff.require_decimal?Sf:"");return ff.allow_negatives&&!ff.parens_for_negatives&&(ff.negative_sign_after_digits?xf+=mf:ff.negative_sign_before_digits&&(xf=mf+xf)),ff.allow_negative_sign_placeholder?xf="( (?!\\-))?".concat(xf):ff.allow_space_after_symbol?xf=" ?".concat(xf):ff.allow_space_after_digits&&(xf+="( (?!$))?"),ff.symbol_after_digits?xf+=pf:xf=pf+xf,ff.allow_negatives&&(ff.parens_for_negatives?xf="(\\(".concat(xf,"\\)|").concat(xf,")"):ff.negative_sign_before_digits||ff.negative_sign_after_digits||(xf=mf+xf)),new RegExp("^(?!-? )(?=.*\\d)".concat(xf,"$"))}var uf={symbol:"$",require_symbol:!1,allow_space_after_symbol:!1,symbol_after_digits:!1,allow_negatives:!0,parens_for_negatives:!1,negative_sign_before_digits:!1,negative_sign_after_digits:!1,allow_negative_sign_placeholder:!1,thousands_separator:",",decimal_separator:".",allow_decimal:!0,require_decimal:!1,digits_after_decimal:[2],allow_space_after_digits:!1};function df(ff,hf){return(0,Ra.default)(ff),hf=(0,bo.default)(hf,uf),mc(hf).test(ff)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isCurrency,isCurrency.exports)),isCurrency.exports}var isBtcAddress={exports:{}},hasRequiredIsBtcAddress;function requireIsBtcAddress(){return hasRequiredIsBtcAddress||(hasRequiredIsBtcAddress=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=uf;var bo=Ra(requireAssertString());function Ra(df){return df&&df.__esModule?df:{default:df}}var pc=/^(bc1)[a-z0-9]{25,39}$/,mc=/^(1|3)[A-HJ-NP-Za-km-z1-9]{25,39}$/;function uf(df){return(0,bo.default)(df),pc.test(df)||mc.test(df)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isBtcAddress,isBtcAddress.exports)),isBtcAddress.exports}var isISO6346={},hasRequiredIsISO6346;function requireIsISO6346(){if(hasRequiredIsISO6346)return isISO6346;hasRequiredIsISO6346=1,Object.defineProperty(isISO6346,"__esModule",{value:!0}),isISO6346.isFreightContainerID=void 0,isISO6346.isISO6346=pc;var vo=Ai(requireAssertString());function Ai(mc){return mc&&mc.__esModule?mc:{default:mc}}var bo=/^[A-Z]{3}(U[0-9]{7})|([J,Z][0-9]{6,7})$/,Ra=/^[0-9]$/;function pc(mc){if((0,vo.default)(mc),mc=mc.toUpperCase(),!bo.test(mc))return!1;if(mc.length===11){for(var uf=0,df=0;df<mc.length-1;df++)if(Ra.test(mc[df]))uf+=mc[df]*Math.pow(2,df);else{var ff=void 0,hf=mc.charCodeAt(df)-55;hf<11?ff=hf:hf>=11&&hf<=20?ff=12+hf%11:hf>=21&&hf<=30?ff=23+hf%21:ff=34+hf%31,uf+=ff*Math.pow(2,df)}var pf=uf%11;return Number(mc[mc.length-1])===pf}return!0}return isISO6346.isFreightContainerID=pc,isISO6346}var isISO6391={exports:{}},hasRequiredIsISO6391;function requireIsISO6391(){return hasRequiredIsISO6391||(hasRequiredIsISO6391=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=mc;var bo=Ra(requireAssertString());function Ra(uf){return uf&&uf.__esModule?uf:{default:uf}}var pc=new Set(["aa","ab","ae","af","ak","am","an","ar","as","av","ay","az","az","ba","be","bg","bh","bi","bm","bn","bo","br","bs","ca","ce","ch","co","cr","cs","cu","cv","cy","da","de","dv","dz","ee","el","en","eo","es","et","eu","fa","ff","fi","fj","fo","fr","fy","ga","gd","gl","gn","gu","gv","ha","he","hi","ho","hr","ht","hu","hy","hz","ia","id","ie","ig","ii","ik","io","is","it","iu","ja","jv","ka","kg","ki","kj","kk","kl","km","kn","ko","kr","ks","ku","kv","kw","ky","la","lb","lg","li","ln","lo","lt","lu","lv","mg","mh","mi","mk","ml","mn","mr","ms","mt","my","na","nb","nd","ne","ng","nl","nn","no","nr","nv","ny","oc","oj","om","or","os","pa","pi","pl","ps","pt","qu","rm","rn","ro","ru","rw","sa","sc","sd","se","sg","si","sk","sl","sm","sn","so","sq","sr","ss","st","su","sv","sw","ta","te","tg","th","ti","tk","tl","tn","to","tr","ts","tt","tw","ty","ug","uk","ur","uz","ve","vi","vo","wa","wo","xh","yi","yo","za","zh","zu"]);function mc(uf){return(0,bo.default)(uf),pc.has(uf)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isISO6391,isISO6391.exports)),isISO6391.exports}var isISO8601={exports:{}},hasRequiredIsISO8601;function requireIsISO8601(){return hasRequiredIsISO8601||(hasRequiredIsISO8601=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=df;var bo=Ra(requireAssertString());function Ra(ff){return ff&&ff.__esModule?ff:{default:ff}}var pc=/^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-3])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/,mc=/^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-3])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/,uf=function(ff){var hf=ff.match(/^(\d{4})-?(\d{3})([ T]{1}\.*|$)/);if(hf){var pf=Number(hf[1]),mf=Number(hf[2]);return pf%4===0&&pf%100!==0||pf%400===0?mf<=366:mf<=365}var gf=ff.match(/(\d{4})-?(\d{0,2})-?(\d*)/).map(Number),yf=gf[1],vf=gf[2],bf=gf[3],Sf=vf&&"0".concat(vf).slice(-2),xf=bf&&"0".concat(bf).slice(-2),wf=new Date("".concat(yf,"-").concat(Sf||"01","-").concat(xf||"01"));return vf&&bf?wf.getUTCFullYear()===yf&&wf.getUTCMonth()+1===vf&&wf.getUTCDate()===bf:!0};function df(ff){var hf=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(0,bo.default)(ff);var pf=hf.strictSeparator?mc.test(ff):pc.test(ff);return pf&&hf.strict?uf(ff):pf}vo.exports=Ai.default,vo.exports.default=Ai.default}(isISO8601,isISO8601.exports)),isISO8601.exports}var isRFC3339={exports:{}},hasRequiredIsRFC3339;function requireIsRFC3339(){return hasRequiredIsRFC3339||(hasRequiredIsRFC3339=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=xf;var bo=Ra(requireAssertString());function Ra(wf){return wf&&wf.__esModule?wf:{default:wf}}var pc=/[0-9]{4}/,mc=/(0[1-9]|1[0-2])/,uf=/([12]\d|0[1-9]|3[01])/,df=/([01][0-9]|2[0-3])/,ff=/[0-5][0-9]/,hf=/([0-5][0-9]|60)/,pf=/(\.[0-9]+)?/,mf=new RegExp("[-+]".concat(df.source,":").concat(ff.source)),gf=new RegExp("([zZ]|".concat(mf.source,")")),yf=new RegExp("".concat(df.source,":").concat(ff.source,":").concat(hf.source).concat(pf.source)),vf=new RegExp("".concat(pc.source,"-").concat(mc.source,"-").concat(uf.source)),bf=new RegExp("".concat(yf.source).concat(gf.source)),Sf=new RegExp("^".concat(vf.source,"[ tT]").concat(bf.source,"$"));function xf(wf){return(0,bo.default)(wf),Sf.test(wf)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isRFC3339,isRFC3339.exports)),isRFC3339.exports}var isISO31661Alpha3={exports:{}},hasRequiredIsISO31661Alpha3;function requireIsISO31661Alpha3(){return hasRequiredIsISO31661Alpha3||(hasRequiredIsISO31661Alpha3=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=mc;var bo=Ra(requireAssertString());function Ra(uf){return uf&&uf.__esModule?uf:{default:uf}}var pc=new Set(["AFG","ALA","ALB","DZA","ASM","AND","AGO","AIA","ATA","ATG","ARG","ARM","ABW","AUS","AUT","AZE","BHS","BHR","BGD","BRB","BLR","BEL","BLZ","BEN","BMU","BTN","BOL","BES","BIH","BWA","BVT","BRA","IOT","BRN","BGR","BFA","BDI","KHM","CMR","CAN","CPV","CYM","CAF","TCD","CHL","CHN","CXR","CCK","COL","COM","COG","COD","COK","CRI","CIV","HRV","CUB","CUW","CYP","CZE","DNK","DJI","DMA","DOM","ECU","EGY","SLV","GNQ","ERI","EST","ETH","FLK","FRO","FJI","FIN","FRA","GUF","PYF","ATF","GAB","GMB","GEO","DEU","GHA","GIB","GRC","GRL","GRD","GLP","GUM","GTM","GGY","GIN","GNB","GUY","HTI","HMD","VAT","HND","HKG","HUN","ISL","IND","IDN","IRN","IRQ","IRL","IMN","ISR","ITA","JAM","JPN","JEY","JOR","KAZ","KEN","KIR","PRK","KOR","KWT","KGZ","LAO","LVA","LBN","LSO","LBR","LBY","LIE","LTU","LUX","MAC","MKD","MDG","MWI","MYS","MDV","MLI","MLT","MHL","MTQ","MRT","MUS","MYT","MEX","FSM","MDA","MCO","MNG","MNE","MSR","MAR","MOZ","MMR","NAM","NRU","NPL","NLD","NCL","NZL","NIC","NER","NGA","NIU","NFK","MNP","NOR","OMN","PAK","PLW","PSE","PAN","PNG","PRY","PER","PHL","PCN","POL","PRT","PRI","QAT","REU","ROU","RUS","RWA","BLM","SHN","KNA","LCA","MAF","SPM","VCT","WSM","SMR","STP","SAU","SEN","SRB","SYC","SLE","SGP","SXM","SVK","SVN","SLB","SOM","ZAF","SGS","SSD","ESP","LKA","SDN","SUR","SJM","SWZ","SWE","CHE","SYR","TWN","TJK","TZA","THA","TLS","TGO","TKL","TON","TTO","TUN","TUR","TKM","TCA","TUV","UGA","UKR","ARE","GBR","USA","UMI","URY","UZB","VUT","VEN","VNM","VGB","VIR","WLF","ESH","YEM","ZMB","ZWE"]);function mc(uf){return(0,bo.default)(uf),pc.has(uf.toUpperCase())}vo.exports=Ai.default,vo.exports.default=Ai.default}(isISO31661Alpha3,isISO31661Alpha3.exports)),isISO31661Alpha3.exports}var isISO4217={},hasRequiredIsISO4217;function requireIsISO4217(){if(hasRequiredIsISO4217)return isISO4217;hasRequiredIsISO4217=1,Object.defineProperty(isISO4217,"__esModule",{value:!0}),isISO4217.CurrencyCodes=void 0,isISO4217.default=Ra;var vo=Ai(requireAssertString());function Ai(pc){return pc&&pc.__esModule?pc:{default:pc}}var bo=new Set(["AED","AFN","ALL","AMD","ANG","AOA","ARS","AUD","AWG","AZN","BAM","BBD","BDT","BGN","BHD","BIF","BMD","BND","BOB","BOV","BRL","BSD","BTN","BWP","BYN","BZD","CAD","CDF","CHE","CHF","CHW","CLF","CLP","CNY","COP","COU","CRC","CUC","CUP","CVE","CZK","DJF","DKK","DOP","DZD","EGP","ERN","ETB","EUR","FJD","FKP","GBP","GEL","GHS","GIP","GMD","GNF","GTQ","GYD","HKD","HNL","HRK","HTG","HUF","IDR","ILS","INR","IQD","IRR","ISK","JMD","JOD","JPY","KES","KGS","KHR","KMF","KPW","KRW","KWD","KYD","KZT","LAK","LBP","LKR","LRD","LSL","LYD","MAD","MDL","MGA","MKD","MMK","MNT","MOP","MRU","MUR","MVR","MWK","MXN","MXV","MYR","MZN","NAD","NGN","NIO","NOK","NPR","NZD","OMR","PAB","PEN","PGK","PHP","PKR","PLN","PYG","QAR","RON","RSD","RUB","RWF","SAR","SBD","SCR","SDG","SEK","SGD","SHP","SLE","SLL","SOS","SRD","SSP","STN","SVC","SYP","SZL","THB","TJS","TMT","TND","TOP","TRY","TTD","TWD","TZS","UAH","UGX","USD","USN","UYI","UYU","UYW","UZS","VES","VND","VUV","WST","XAF","XAG","XAU","XBA","XBB","XBC","XBD","XCD","XDR","XOF","XPD","XPF","XPT","XSU","XTS","XUA","XXX","YER","ZAR","ZMW","ZWL"]);function Ra(pc){return(0,vo.default)(pc),bo.has(pc.toUpperCase())}return isISO4217.CurrencyCodes=bo,isISO4217}var isBase32={exports:{}},hasRequiredIsBase32;function requireIsBase32(){return hasRequiredIsBase32||(hasRequiredIsBase32=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=ff;var bo=pc(requireAssertString()),Ra=pc(requireMerge());function pc(hf){return hf&&hf.__esModule?hf:{default:hf}}var mc=/^[A-Z2-7]+=*$/,uf=/^[A-HJKMNP-TV-Z0-9]+$/,df={crockford:!1};function ff(hf,pf){if((0,bo.default)(hf),pf=(0,Ra.default)(pf,df),pf.crockford)return uf.test(hf);var mf=hf.length;return!!(mf%8===0&&mc.test(hf))}vo.exports=Ai.default,vo.exports.default=Ai.default}(isBase32,isBase32.exports)),isBase32.exports}var isBase58={exports:{}},hasRequiredIsBase58;function requireIsBase58(){return hasRequiredIsBase58||(hasRequiredIsBase58=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=mc;var bo=Ra(requireAssertString());function Ra(uf){return uf&&uf.__esModule?uf:{default:uf}}var pc=/^[A-HJ-NP-Za-km-z1-9]*$/;function mc(uf){return(0,bo.default)(uf),!!pc.test(uf)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isBase58,isBase58.exports)),isBase58.exports}var isDataURI={exports:{}},hasRequiredIsDataURI;function requireIsDataURI(){return hasRequiredIsDataURI||(hasRequiredIsDataURI=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=df;var bo=Ra(requireAssertString());function Ra(ff){return ff&&ff.__esModule?ff:{default:ff}}var pc=/^[a-z]+\/[a-z0-9\-\+\._]+$/i,mc=/^[a-z\-]+=[a-z0-9\-]+$/i,uf=/^[a-z0-9!\$&'\(\)\*\+,;=\-\._~:@\/\?%\s]*$/i;function df(ff){(0,bo.default)(ff);var hf=ff.split(",");if(hf.length<2)return!1;var pf=hf.shift().trim().split(";"),mf=pf.shift();if(mf.slice(0,5)!=="data:")return!1;var gf=mf.slice(5);if(gf!==""&&!pc.test(gf))return!1;for(var yf=0;yf<pf.length;yf++)if(!(yf===pf.length-1&&pf[yf].toLowerCase()==="base64")&&!mc.test(pf[yf]))return!1;for(var vf=0;vf<hf.length;vf++)if(!uf.test(hf[vf]))return!1;return!0}vo.exports=Ai.default,vo.exports.default=Ai.default}(isDataURI,isDataURI.exports)),isDataURI.exports}var isMagnetURI={exports:{}},hasRequiredIsMagnetURI;function requireIsMagnetURI(){return hasRequiredIsMagnetURI||(hasRequiredIsMagnetURI=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=mc;var bo=Ra(requireAssertString());function Ra(uf){return uf&&uf.__esModule?uf:{default:uf}}var pc=/(?:^magnet:\?|[^?&]&)xt(?:\.1)?=urn:(?:(?:aich|bitprint|btih|ed2k|ed2khash|kzhash|md5|sha1|tree:tiger):[a-z0-9]{32}(?:[a-z0-9]{8})?|btmh:1220[a-z0-9]{64})(?:$|&)/i;function mc(uf){return(0,bo.default)(uf),uf.indexOf("magnet:?")!==0?!1:pc.test(uf)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isMagnetURI,isMagnetURI.exports)),isMagnetURI.exports}var isMailtoURI={exports:{}},trim={exports:{}},rtrim={exports:{}},hasRequiredRtrim;function requireRtrim(){return hasRequiredRtrim||(hasRequiredRtrim=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=pc;var bo=Ra(requireAssertString());function Ra(mc){return mc&&mc.__esModule?mc:{default:mc}}function pc(mc,uf){if((0,bo.default)(mc),uf){var df=new RegExp("[".concat(uf.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"]+$"),"g");return mc.replace(df,"")}for(var ff=mc.length-1;/\s/.test(mc.charAt(ff));)ff-=1;return mc.slice(0,ff+1)}vo.exports=Ai.default,vo.exports.default=Ai.default}(rtrim,rtrim.exports)),rtrim.exports}var ltrim={exports:{}},hasRequiredLtrim;function requireLtrim(){return hasRequiredLtrim||(hasRequiredLtrim=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=pc;var bo=Ra(requireAssertString());function Ra(mc){return mc&&mc.__esModule?mc:{default:mc}}function pc(mc,uf){(0,bo.default)(mc);var df=uf?new RegExp("^[".concat(uf.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"]+"),"g"):/^\s+/g;return mc.replace(df,"")}vo.exports=Ai.default,vo.exports.default=Ai.default}(ltrim,ltrim.exports)),ltrim.exports}var hasRequiredTrim;function requireTrim(){return hasRequiredTrim||(hasRequiredTrim=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=mc;var bo=pc(requireRtrim()),Ra=pc(requireLtrim());function pc(uf){return uf&&uf.__esModule?uf:{default:uf}}function mc(uf,df){return(0,bo.default)((0,Ra.default)(uf,df),df)}vo.exports=Ai.default,vo.exports.default=Ai.default}(trim,trim.exports)),trim.exports}var hasRequiredIsMailtoURI;function requireIsMailtoURI(){return hasRequiredIsMailtoURI||(hasRequiredIsMailtoURI=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=vf;var bo=mc(requireTrim()),Ra=mc(requireIsEmail()),pc=mc(requireAssertString());function mc(bf){return bf&&bf.__esModule?bf:{default:bf}}function uf(bf,Sf){return hf(bf)||ff(bf,Sf)||mf(bf,Sf)||df()}function df(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
345
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ff(bf,Sf){var xf=bf==null?null:typeof Symbol<"u"&&bf[Symbol.iterator]||bf["@@iterator"];if(xf!=null){var wf,If,l1,s1,c1=[],u1=!0,T1=!1;try{if(l1=(xf=xf.call(bf)).next,Sf!==0)for(;!(u1=(wf=l1.call(xf)).done)&&(c1.push(wf.value),c1.length!==Sf);u1=!0);}catch(_1){T1=!0,If=_1}finally{try{if(!u1&&xf.return!=null&&(s1=xf.return(),Object(s1)!==s1))return}finally{if(T1)throw If}}return c1}}function hf(bf){if(Array.isArray(bf))return bf}function pf(bf,Sf){var xf=typeof Symbol<"u"&&bf[Symbol.iterator]||bf["@@iterator"];if(!xf){if(Array.isArray(bf)||(xf=mf(bf))||Sf){xf&&(bf=xf);var wf=0,If=function(){};return{s:If,n:function(){return wf>=bf.length?{done:!0}:{done:!1,value:bf[wf++]}},e:function(u1){throw u1},f:If}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
346
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var l1=!0,s1=!1,c1;return{s:function(){xf=xf.call(bf)},n:function(){var u1=xf.next();return l1=u1.done,u1},e:function(u1){s1=!0,c1=u1},f:function(){try{!l1&&xf.return!=null&&xf.return()}finally{if(s1)throw c1}}}}function mf(bf,Sf){if(bf){if(typeof bf=="string")return gf(bf,Sf);var xf=Object.prototype.toString.call(bf).slice(8,-1);if(xf==="Object"&&bf.constructor&&(xf=bf.constructor.name),xf==="Map"||xf==="Set")return Array.from(bf);if(xf==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(xf))return gf(bf,Sf)}}function gf(bf,Sf){(Sf==null||Sf>bf.length)&&(Sf=bf.length);for(var xf=0,wf=new Array(Sf);xf<Sf;xf++)wf[xf]=bf[xf];return wf}function yf(bf){var Sf=new Set(["subject","body","cc","bcc"]),xf={cc:"",bcc:""},wf=!1,If=bf.split("&");if(If.length>4)return!1;var l1=pf(If),s1;try{for(l1.s();!(s1=l1.n()).done;){var c1=s1.value,u1=c1.split("="),T1=uf(u1,2),_1=T1[0],R1=T1[1];if(_1&&!Sf.has(_1)){wf=!0;break}R1&&(_1==="cc"||_1==="bcc")&&(xf[_1]=R1),_1&&Sf.delete(_1)}}catch(P1){l1.e(P1)}finally{l1.f()}return wf?!1:xf}function vf(bf,Sf){if((0,pc.default)(bf),bf.indexOf("mailto:")!==0)return!1;var xf=bf.replace("mailto:","").split("?"),wf=uf(xf,2),If=wf[0],l1=wf[1],s1=l1===void 0?"":l1;if(!If&&!s1)return!0;var c1=yf(s1);return c1?"".concat(If,",").concat(c1.cc,",").concat(c1.bcc).split(",").every(function(u1){return u1=(0,bo.default)(u1," "),u1?(0,Ra.default)(u1,Sf):!0}):!1}vo.exports=Ai.default,vo.exports.default=Ai.default}(isMailtoURI,isMailtoURI.exports)),isMailtoURI.exports}var isMimeType={exports:{}},hasRequiredIsMimeType;function requireIsMimeType(){return hasRequiredIsMimeType||(hasRequiredIsMimeType=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=df;var bo=Ra(requireAssertString());function Ra(ff){return ff&&ff.__esModule?ff:{default:ff}}var pc=/^(application|audio|font|image|message|model|multipart|text|video)\/[a-zA-Z0-9\.\-\+_]{1,100}$/i,mc=/^text\/[a-zA-Z0-9\.\-\+]{1,100};\s?charset=("[a-zA-Z0-9\.\-\+\s]{0,70}"|[a-zA-Z0-9\.\-\+]{0,70})(\s?\([a-zA-Z0-9\.\-\+\s]{1,20}\))?$/i,uf=/^multipart\/[a-zA-Z0-9\.\-\+]{1,100}(;\s?(boundary|charset)=("[a-zA-Z0-9\.\-\+\s]{0,70}"|[a-zA-Z0-9\.\-\+]{0,70})(\s?\([a-zA-Z0-9\.\-\+\s]{1,20}\))?){0,2}$/i;function df(ff){return(0,bo.default)(ff),pc.test(ff)||mc.test(ff)||uf.test(ff)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isMimeType,isMimeType.exports)),isMimeType.exports}var isLatLong={exports:{}},hasRequiredIsLatLong;function requireIsLatLong(){return hasRequiredIsLatLong||(hasRequiredIsLatLong=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=pf;var bo=pc(requireAssertString()),Ra=pc(requireMerge());function pc(mf){return mf&&mf.__esModule?mf:{default:mf}}var mc=/^\(?[+-]?(90(\.0+)?|[1-8]?\d(\.\d+)?)$/,uf=/^\s?[+-]?(180(\.0+)?|1[0-7]\d(\.\d+)?|\d{1,2}(\.\d+)?)\)?$/,df=/^(([1-8]?\d)\D+([1-5]?\d|60)\D+([1-5]?\d|60)(\.\d+)?|90\D+0\D+0)\D+[NSns]?$/i,ff=/^\s*([1-7]?\d{1,2}\D+([1-5]?\d|60)\D+([1-5]?\d|60)(\.\d+)?|180\D+0\D+0)\D+[EWew]?$/i,hf={checkDMS:!1};function pf(mf,gf){if((0,bo.default)(mf),gf=(0,Ra.default)(gf,hf),!mf.includes(","))return!1;var yf=mf.split(",");return yf[0].startsWith("(")&&!yf[1].endsWith(")")||yf[1].endsWith(")")&&!yf[0].startsWith("(")?!1:gf.checkDMS?df.test(yf[0])&&ff.test(yf[1]):mc.test(yf[0])&&uf.test(yf[1])}vo.exports=Ai.default,vo.exports.default=Ai.default}(isLatLong,isLatLong.exports)),isLatLong.exports}var isPostalCode={},hasRequiredIsPostalCode;function requireIsPostalCode(){if(hasRequiredIsPostalCode)return isPostalCode;hasRequiredIsPostalCode=1,Object.defineProperty(isPostalCode,"__esModule",{value:!0}),isPostalCode.default=df,isPostalCode.locales=void 0;var vo=Ai(requireAssertString());function Ai(ff){return ff&&ff.__esModule?ff:{default:ff}}var bo=/^\d{3}$/,Ra=/^\d{4}$/,pc=/^\d{5}$/,mc=/^\d{6}$/,uf={AD:/^AD\d{3}$/,AT:Ra,AU:Ra,AZ:/^AZ\d{4}$/,BA:/^([7-8]\d{4}$)/,BE:Ra,BG:Ra,BR:/^\d{5}-\d{3}$/,BY:/^2[1-4]\d{4}$/,CA:/^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJ-NPRSTV-Z][\s\-]?\d[ABCEGHJ-NPRSTV-Z]\d$/i,CH:Ra,CN:/^(0[1-7]|1[012356]|2[0-7]|3[0-6]|4[0-7]|5[1-7]|6[1-7]|7[1-5]|8[1345]|9[09])\d{4}$/,CZ:/^\d{3}\s?\d{2}$/,DE:pc,DK:Ra,DO:pc,DZ:pc,EE:pc,ES:/^(5[0-2]{1}|[0-4]{1}\d{1})\d{3}$/,FI:pc,FR:/^\d{2}\s?\d{3}$/,GB:/^(gir\s?0aa|[a-z]{1,2}\d[\da-z]?\s?(\d[a-z]{2})?)$/i,GR:/^\d{3}\s?\d{2}$/,HR:/^([1-5]\d{4}$)/,HT:/^HT\d{4}$/,HU:Ra,ID:pc,IE:/^(?!.*(?:o))[A-Za-z]\d[\dw]\s\w{4}$/i,IL:/^(\d{5}|\d{7})$/,IN:/^((?!10|29|35|54|55|65|66|86|87|88|89)[1-9][0-9]{5})$/,IR:/^(?!(\d)\1{3})[13-9]{4}[1346-9][013-9]{5}$/,IS:bo,IT:pc,JP:/^\d{3}\-\d{4}$/,KE:pc,KR:/^(\d{5}|\d{6})$/,LI:/^(948[5-9]|949[0-7])$/,LT:/^LT\-\d{5}$/,LU:Ra,LV:/^LV\-\d{4}$/,LK:pc,MG:bo,MX:pc,MT:/^[A-Za-z]{3}\s{0,1}\d{4}$/,MY:pc,NL:/^[1-9]\d{3}\s?(?!sa|sd|ss)[a-z]{2}$/i,NO:Ra,NP:/^(10|21|22|32|33|34|44|45|56|57)\d{3}$|^(977)$/i,NZ:Ra,PL:/^\d{2}\-\d{3}$/,PR:/^00[679]\d{2}([ -]\d{4})?$/,PT:/^\d{4}\-\d{3}?$/,RO:mc,RU:mc,SA:pc,SE:/^[1-9]\d{2}\s?\d{2}$/,SG:mc,SI:Ra,SK:/^\d{3}\s?\d{2}$/,TH:pc,TN:Ra,TW:/^\d{3}(\d{2})?$/,UA:pc,US:/^\d{5}(-\d{4})?$/,ZA:Ra,ZM:pc};isPostalCode.locales=Object.keys(uf);function df(ff,hf){if((0,vo.default)(ff),hf in uf)return uf[hf].test(ff);if(hf==="any"){for(var pf in uf)if(uf.hasOwnProperty(pf)){var mf=uf[pf];if(mf.test(ff))return!0}return!1}throw new Error("Invalid locale '".concat(hf,"'"))}return isPostalCode}var _escape={exports:{}},hasRequired_escape;function require_escape(){return hasRequired_escape||(hasRequired_escape=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=pc;var bo=Ra(requireAssertString());function Ra(mc){return mc&&mc.__esModule?mc:{default:mc}}function pc(mc){return(0,bo.default)(mc),mc.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">").replace(/\//g,"/").replace(/\\/g,"\").replace(/`/g,"`")}vo.exports=Ai.default,vo.exports.default=Ai.default}(_escape,_escape.exports)),_escape.exports}var _unescape={exports:{}},hasRequired_unescape;function require_unescape(){return hasRequired_unescape||(hasRequired_unescape=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=pc;var bo=Ra(requireAssertString());function Ra(mc){return mc&&mc.__esModule?mc:{default:mc}}function pc(mc){return(0,bo.default)(mc),mc.replace(/"/g,'"').replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">").replace(///g,"/").replace(/\/g,"\\").replace(/`/g,"`").replace(/&/g,"&")}vo.exports=Ai.default,vo.exports.default=Ai.default}(_unescape,_unescape.exports)),_unescape.exports}var stripLow={exports:{}},blacklist={exports:{}},hasRequiredBlacklist;function requireBlacklist(){return hasRequiredBlacklist||(hasRequiredBlacklist=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=pc;var bo=Ra(requireAssertString());function Ra(mc){return mc&&mc.__esModule?mc:{default:mc}}function pc(mc,uf){return(0,bo.default)(mc),mc.replace(new RegExp("[".concat(uf,"]+"),"g"),"")}vo.exports=Ai.default,vo.exports.default=Ai.default}(blacklist,blacklist.exports)),blacklist.exports}var hasRequiredStripLow;function requireStripLow(){return hasRequiredStripLow||(hasRequiredStripLow=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=mc;var bo=pc(requireAssertString()),Ra=pc(requireBlacklist());function pc(uf){return uf&&uf.__esModule?uf:{default:uf}}function mc(uf,df){(0,bo.default)(uf);var ff=df?"\\x00-\\x09\\x0B\\x0C\\x0E-\\x1F\\x7F":"\\x00-\\x1F\\x7F";return(0,Ra.default)(uf,ff)}vo.exports=Ai.default,vo.exports.default=Ai.default}(stripLow,stripLow.exports)),stripLow.exports}var whitelist={exports:{}},hasRequiredWhitelist;function requireWhitelist(){return hasRequiredWhitelist||(hasRequiredWhitelist=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=pc;var bo=Ra(requireAssertString());function Ra(mc){return mc&&mc.__esModule?mc:{default:mc}}function pc(mc,uf){return(0,bo.default)(mc),mc.replace(new RegExp("[^".concat(uf,"]+"),"g"),"")}vo.exports=Ai.default,vo.exports.default=Ai.default}(whitelist,whitelist.exports)),whitelist.exports}var isWhitelisted={exports:{}},hasRequiredIsWhitelisted;function requireIsWhitelisted(){return hasRequiredIsWhitelisted||(hasRequiredIsWhitelisted=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=pc;var bo=Ra(requireAssertString());function Ra(mc){return mc&&mc.__esModule?mc:{default:mc}}function pc(mc,uf){(0,bo.default)(mc);for(var df=mc.length-1;df>=0;df--)if(uf.indexOf(mc[df])===-1)return!1;return!0}vo.exports=Ai.default,vo.exports.default=Ai.default}(isWhitelisted,isWhitelisted.exports)),isWhitelisted.exports}var normalizeEmail={exports:{}},hasRequiredNormalizeEmail;function requireNormalizeEmail(){return hasRequiredNormalizeEmail||(hasRequiredNormalizeEmail=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=pf;var bo=Ra(requireMerge());function Ra(mf){return mf&&mf.__esModule?mf:{default:mf}}var pc={all_lowercase:!0,gmail_lowercase:!0,gmail_remove_dots:!0,gmail_remove_subaddress:!0,gmail_convert_googlemaildotcom:!0,outlookdotcom_lowercase:!0,outlookdotcom_remove_subaddress:!0,yahoo_lowercase:!0,yahoo_remove_subaddress:!0,yandex_lowercase:!0,icloud_lowercase:!0,icloud_remove_subaddress:!0},mc=["icloud.com","me.com"],uf=["hotmail.at","hotmail.be","hotmail.ca","hotmail.cl","hotmail.co.il","hotmail.co.nz","hotmail.co.th","hotmail.co.uk","hotmail.com","hotmail.com.ar","hotmail.com.au","hotmail.com.br","hotmail.com.gr","hotmail.com.mx","hotmail.com.pe","hotmail.com.tr","hotmail.com.vn","hotmail.cz","hotmail.de","hotmail.dk","hotmail.es","hotmail.fr","hotmail.hu","hotmail.id","hotmail.ie","hotmail.in","hotmail.it","hotmail.jp","hotmail.kr","hotmail.lv","hotmail.my","hotmail.ph","hotmail.pt","hotmail.sa","hotmail.sg","hotmail.sk","live.be","live.co.uk","live.com","live.com.ar","live.com.mx","live.de","live.es","live.eu","live.fr","live.it","live.nl","msn.com","outlook.at","outlook.be","outlook.cl","outlook.co.il","outlook.co.nz","outlook.co.th","outlook.com","outlook.com.ar","outlook.com.au","outlook.com.br","outlook.com.gr","outlook.com.pe","outlook.com.tr","outlook.com.vn","outlook.cz","outlook.de","outlook.dk","outlook.es","outlook.fr","outlook.hu","outlook.id","outlook.ie","outlook.in","outlook.it","outlook.jp","outlook.kr","outlook.lv","outlook.my","outlook.ph","outlook.pt","outlook.sa","outlook.sg","outlook.sk","passport.com"],df=["rocketmail.com","yahoo.ca","yahoo.co.uk","yahoo.com","yahoo.de","yahoo.fr","yahoo.in","yahoo.it","ymail.com"],ff=["yandex.ru","yandex.ua","yandex.kz","yandex.com","yandex.by","ya.ru"];function hf(mf){return mf.length>1?mf:""}function pf(mf,gf){gf=(0,bo.default)(gf,pc);var yf=mf.split("@"),vf=yf.pop(),bf=yf.join("@"),Sf=[bf,vf];if(Sf[1]=Sf[1].toLowerCase(),Sf[1]==="gmail.com"||Sf[1]==="googlemail.com"){if(gf.gmail_remove_subaddress&&(Sf[0]=Sf[0].split("+")[0]),gf.gmail_remove_dots&&(Sf[0]=Sf[0].replace(/\.+/g,hf)),!Sf[0].length)return!1;(gf.all_lowercase||gf.gmail_lowercase)&&(Sf[0]=Sf[0].toLowerCase()),Sf[1]=gf.gmail_convert_googlemaildotcom?"gmail.com":Sf[1]}else if(mc.indexOf(Sf[1])>=0){if(gf.icloud_remove_subaddress&&(Sf[0]=Sf[0].split("+")[0]),!Sf[0].length)return!1;(gf.all_lowercase||gf.icloud_lowercase)&&(Sf[0]=Sf[0].toLowerCase())}else if(uf.indexOf(Sf[1])>=0){if(gf.outlookdotcom_remove_subaddress&&(Sf[0]=Sf[0].split("+")[0]),!Sf[0].length)return!1;(gf.all_lowercase||gf.outlookdotcom_lowercase)&&(Sf[0]=Sf[0].toLowerCase())}else if(df.indexOf(Sf[1])>=0){if(gf.yahoo_remove_subaddress){var xf=Sf[0].split("-");Sf[0]=xf.length>1?xf.slice(0,-1).join("-"):xf[0]}if(!Sf[0].length)return!1;(gf.all_lowercase||gf.yahoo_lowercase)&&(Sf[0]=Sf[0].toLowerCase())}else ff.indexOf(Sf[1])>=0?((gf.all_lowercase||gf.yandex_lowercase)&&(Sf[0]=Sf[0].toLowerCase()),Sf[1]="yandex.ru"):gf.all_lowercase&&(Sf[0]=Sf[0].toLowerCase());return Sf.join("@")}vo.exports=Ai.default,vo.exports.default=Ai.default}(normalizeEmail,normalizeEmail.exports)),normalizeEmail.exports}var isSlug={exports:{}},hasRequiredIsSlug;function requireIsSlug(){return hasRequiredIsSlug||(hasRequiredIsSlug=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=mc;var bo=Ra(requireAssertString());function Ra(uf){return uf&&uf.__esModule?uf:{default:uf}}var pc=/^[^\s-_](?!.*?[-_]{2,})[a-z0-9-\\][^\s]*[^-_\s]$/;function mc(uf){return(0,bo.default)(uf),pc.test(uf)}vo.exports=Ai.default,vo.exports.default=Ai.default}(isSlug,isSlug.exports)),isSlug.exports}var isLicensePlate={exports:{}},hasRequiredIsLicensePlate;function requireIsLicensePlate(){return hasRequiredIsLicensePlate||(hasRequiredIsLicensePlate=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=mc;var bo=Ra(requireAssertString());function Ra(uf){return uf&&uf.__esModule?uf:{default:uf}}var pc={"cs-CZ":function(uf){return/^(([ABCDEFHIJKLMNPRSTUVXYZ]|[0-9])-?){5,8}$/.test(uf)},"de-DE":function(uf){return/^((A|AA|AB|AC|AE|AH|AK|AM|AN|AÖ|AP|AS|AT|AU|AW|AZ|B|BA|BB|BC|BE|BF|BH|BI|BK|BL|BM|BN|BO|BÖ|BS|BT|BZ|C|CA|CB|CE|CO|CR|CW|D|DA|DD|DE|DH|DI|DL|DM|DN|DO|DU|DW|DZ|E|EA|EB|ED|EE|EF|EG|EH|EI|EL|EM|EN|ER|ES|EU|EW|F|FB|FD|FF|FG|FI|FL|FN|FO|FR|FS|FT|FÜ|FW|FZ|G|GA|GC|GD|GE|GF|GG|GI|GK|GL|GM|GN|GÖ|GP|GR|GS|GT|GÜ|GV|GW|GZ|H|HA|HB|HC|HD|HE|HF|HG|HH|HI|HK|HL|HM|HN|HO|HP|HR|HS|HU|HV|HX|HY|HZ|IK|IL|IN|IZ|J|JE|JL|K|KA|KB|KC|KE|KF|KG|KH|KI|KK|KL|KM|KN|KO|KR|KS|KT|KU|KW|KY|L|LA|LB|LC|LD|LF|LG|LH|LI|LL|LM|LN|LÖ|LP|LR|LU|M|MA|MB|MC|MD|ME|MG|MH|MI|MK|ML|MM|MN|MO|MQ|MR|MS|MÜ|MW|MY|MZ|N|NB|ND|NE|NF|NH|NI|NK|NM|NÖ|NP|NR|NT|NU|NW|NY|NZ|OA|OB|OC|OD|OE|OF|OG|OH|OK|OL|OP|OS|OZ|P|PA|PB|PE|PF|PI|PL|PM|PN|PR|PS|PW|PZ|R|RA|RC|RD|RE|RG|RH|RI|RL|RM|RN|RO|RP|RS|RT|RU|RV|RW|RZ|S|SB|SC|SE|SG|SI|SK|SL|SM|SN|SO|SP|SR|ST|SU|SW|SY|SZ|TE|TF|TG|TO|TP|TR|TS|TT|TÜ|ÜB|UE|UH|UL|UM|UN|V|VB|VG|VK|VR|VS|W|WA|WB|WE|WF|WI|WK|WL|WM|WN|WO|WR|WS|WT|WÜ|WW|WZ|Z|ZE|ZI|ZP|ZR|ZW|ZZ)[- ]?[A-Z]{1,2}[- ]?\d{1,4}|(ABG|ABI|AIB|AIC|ALF|ALZ|ANA|ANG|ANK|APD|ARN|ART|ASL|ASZ|AUR|AZE|BAD|BAR|BBG|BCH|BED|BER|BGD|BGL|BID|BIN|BIR|BIT|BIW|BKS|BLB|BLK|BNA|BOG|BOH|BOR|BOT|BRA|BRB|BRG|BRK|BRL|BRV|BSB|BSK|BTF|BÜD|BUL|BÜR|BÜS|BÜZ|CAS|CHA|CLP|CLZ|COC|COE|CUX|DAH|DAN|DAU|DBR|DEG|DEL|DGF|DIL|DIN|DIZ|DKB|DLG|DON|DUD|DÜW|EBE|EBN|EBS|ECK|EIC|EIL|EIN|EIS|EMD|EMS|ERB|ERH|ERK|ERZ|ESB|ESW|FDB|FDS|FEU|FFB|FKB|FLÖ|FOR|FRG|FRI|FRW|FTL|FÜS|GAN|GAP|GDB|GEL|GEO|GER|GHA|GHC|GLA|GMN|GNT|GOA|GOH|GRA|GRH|GRI|GRM|GRZ|GTH|GUB|GUN|GVM|HAB|HAL|HAM|HAS|HBN|HBS|HCH|HDH|HDL|HEB|HEF|HEI|HER|HET|HGN|HGW|HHM|HIG|HIP|HMÜ|HOG|HOH|HOL|HOM|HOR|HÖS|HOT|HRO|HSK|HST|HVL|HWI|IGB|ILL|JÜL|KEH|KEL|KEM|KIB|KLE|KLZ|KÖN|KÖT|KÖZ|KRU|KÜN|KUS|KYF|LAN|LAU|LBS|LBZ|LDK|LDS|LEO|LER|LEV|LIB|LIF|LIP|LÖB|LOS|LRO|LSZ|LÜN|LUP|LWL|MAB|MAI|MAK|MAL|MED|MEG|MEI|MEK|MEL|MER|MET|MGH|MGN|MHL|MIL|MKK|MOD|MOL|MON|MOS|MSE|MSH|MSP|MST|MTK|MTL|MÜB|MÜR|MYK|MZG|NAB|NAI|NAU|NDH|NEA|NEB|NEC|NEN|NES|NEW|NMB|NMS|NOH|NOL|NOM|NOR|NVP|NWM|OAL|OBB|OBG|OCH|OHA|ÖHR|OHV|OHZ|OPR|OSL|OVI|OVL|OVP|PAF|PAN|PAR|PCH|PEG|PIR|PLÖ|PRÜ|QFT|QLB|RDG|REG|REH|REI|RID|RIE|ROD|ROF|ROK|ROL|ROS|ROT|ROW|RSL|RÜD|RÜG|SAB|SAD|SAN|SAW|SBG|SBK|SCZ|SDH|SDL|SDT|SEB|SEE|SEF|SEL|SFB|SFT|SGH|SHA|SHG|SHK|SHL|SIG|SIM|SLE|SLF|SLK|SLN|SLS|SLÜ|SLZ|SMÜ|SOB|SOG|SOK|SÖM|SON|SPB|SPN|SRB|SRO|STA|STB|STD|STE|STL|SUL|SÜW|SWA|SZB|TBB|TDO|TET|TIR|TÖL|TUT|UEM|UER|UFF|USI|VAI|VEC|VER|VIB|VIE|VIT|VOH|WAF|WAK|WAN|WAR|WAT|WBS|WDA|WEL|WEN|WER|WES|WHV|WIL|WIS|WIT|WIZ|WLG|WMS|WND|WOB|WOH|WOL|WOR|WOS|WRN|WSF|WST|WSW|WTL|WTM|WUG|WÜM|WUN|WUR|WZL|ZEL|ZIG)[- ]?(([A-Z][- ]?\d{1,4})|([A-Z]{2}[- ]?\d{1,3})))[- ]?(E|H)?$/.test(uf)},"de-LI":function(uf){return/^FL[- ]?\d{1,5}[UZ]?$/.test(uf)},"en-IN":function(uf){return/^[A-Z]{2}[ -]?[0-9]{1,2}(?:[ -]?[A-Z])(?:[ -]?[A-Z]*)?[ -]?[0-9]{4}$/.test(uf)},"es-AR":function(uf){return/^(([A-Z]{2} ?[0-9]{3} ?[A-Z]{2})|([A-Z]{3} ?[0-9]{3}))$/.test(uf)},"fi-FI":function(uf){return/^(?=.{4,7})(([A-Z]{1,3}|[0-9]{1,3})[\s-]?([A-Z]{1,3}|[0-9]{1,5}))$/.test(uf)},"hu-HU":function(uf){return/^((((?!AAA)(([A-NPRSTVZWXY]{1})([A-PR-Z]{1})([A-HJ-NPR-Z]))|(A[ABC]I)|A[ABC]O|A[A-W]Q|BPI|BPO|UCO|UDO|XAO)-(?!000)\d{3})|(M\d{6})|((CK|DT|CD|HC|H[ABEFIKLMNPRSTVX]|MA|OT|R[A-Z]) \d{2}-\d{2})|(CD \d{3}-\d{3})|(C-(C|X) \d{4})|(X-(A|B|C) \d{4})|(([EPVZ]-\d{5}))|(S A[A-Z]{2} \d{2})|(SP \d{2}-\d{2}))$/.test(uf)},"pt-BR":function(uf){return/^[A-Z]{3}[ -]?[0-9][A-Z][0-9]{2}|[A-Z]{3}[ -]?[0-9]{4}$/.test(uf)},"pt-PT":function(uf){return/^([A-Z]{2}|[0-9]{2})[ -·]?([A-Z]{2}|[0-9]{2})[ -·]?([A-Z]{2}|[0-9]{2})$/.test(uf)},"sq-AL":function(uf){return/^[A-Z]{2}[- ]?((\d{3}[- ]?(([A-Z]{2})|T))|(R[- ]?\d{3}))$/.test(uf)},"sv-SE":function(uf){return/^[A-HJ-PR-UW-Z]{3} ?[\d]{2}[A-HJ-PR-UW-Z1-9]$|(^[A-ZÅÄÖ ]{2,7}$)/.test(uf.trim())},"en-PK":function(uf){return/(^[A-Z]{2}((\s|-){0,1})[0-9]{3,4}((\s|-)[0-9]{2}){0,1}$)|(^[A-Z]{3}((\s|-){0,1})[0-9]{3,4}((\s|-)[0-9]{2}){0,1}$)|(^[A-Z]{4}((\s|-){0,1})[0-9]{3,4}((\s|-)[0-9]{2}){0,1}$)|(^[A-Z]((\s|-){0,1})[0-9]{4}((\s|-)[0-9]{2}){0,1}$)/.test(uf.trim())}};function mc(uf,df){if((0,bo.default)(uf),df in pc)return pc[df](uf);if(df==="any"){for(var ff in pc){var hf=pc[ff];if(hf(uf))return!0}return!1}throw new Error("Invalid locale '".concat(df,"'"))}vo.exports=Ai.default,vo.exports.default=Ai.default}(isLicensePlate,isLicensePlate.exports)),isLicensePlate.exports}var isStrongPassword={exports:{}},hasRequiredIsStrongPassword;function requireIsStrongPassword(){return hasRequiredIsStrongPassword||(hasRequiredIsStrongPassword=1,function(vo,Ai){Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=yf;var bo=pc(requireMerge()),Ra=pc(requireAssertString());function pc(vf){return vf&&vf.__esModule?vf:{default:vf}}var mc=/^[A-Z]$/,uf=/^[a-z]$/,df=/^[0-9]$/,ff=/^[-#!$@£%^&*()_+|~=`{}\[\]:";'<>?,.\/\\ ]$/,hf={minLength:8,minLowercase:1,minUppercase:1,minNumbers:1,minSymbols:1,returnScore:!1,pointsPerUnique:1,pointsPerRepeat:.5,pointsForContainingLower:10,pointsForContainingUpper:10,pointsForContainingNumber:10,pointsForContainingSymbol:10};function pf(vf){var bf={};return Array.from(vf).forEach(function(Sf){var xf=bf[Sf];xf?bf[Sf]+=1:bf[Sf]=1}),bf}function mf(vf){var bf=pf(vf),Sf={length:vf.length,uniqueChars:Object.keys(bf).length,uppercaseCount:0,lowercaseCount:0,numberCount:0,symbolCount:0};return Object.keys(bf).forEach(function(xf){mc.test(xf)?Sf.uppercaseCount+=bf[xf]:uf.test(xf)?Sf.lowercaseCount+=bf[xf]:df.test(xf)?Sf.numberCount+=bf[xf]:ff.test(xf)&&(Sf.symbolCount+=bf[xf])}),Sf}function gf(vf,bf){var Sf=0;return Sf+=vf.uniqueChars*bf.pointsPerUnique,Sf+=(vf.length-vf.uniqueChars)*bf.pointsPerRepeat,vf.lowercaseCount>0&&(Sf+=bf.pointsForContainingLower),vf.uppercaseCount>0&&(Sf+=bf.pointsForContainingUpper),vf.numberCount>0&&(Sf+=bf.pointsForContainingNumber),vf.symbolCount>0&&(Sf+=bf.pointsForContainingSymbol),Sf}function yf(vf){var bf=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;(0,Ra.default)(vf);var Sf=mf(vf);return bf=(0,bo.default)(bf||{},hf),bf.returnScore?gf(Sf,bf):Sf.length>=bf.minLength&&Sf.lowercaseCount>=bf.minLowercase&&Sf.uppercaseCount>=bf.minUppercase&&Sf.numberCount>=bf.minNumbers&&Sf.symbolCount>=bf.minSymbols}vo.exports=Ai.default,vo.exports.default=Ai.default}(isStrongPassword,isStrongPassword.exports)),isStrongPassword.exports}var isVAT={},hasRequiredIsVAT;function requireIsVAT(){if(hasRequiredIsVAT)return isVAT;hasRequiredIsVAT=1;function vo(mf){"@babel/helpers - typeof";return vo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(gf){return typeof gf}:function(gf){return gf&&typeof Symbol=="function"&&gf.constructor===Symbol&&gf!==Symbol.prototype?"symbol":typeof gf},vo(mf)}Object.defineProperty(isVAT,"__esModule",{value:!0}),isVAT.default=pf,isVAT.vatMatchers=void 0;var Ai=mc(requireAssertString()),bo=pc(requireAlgorithms());function Ra(mf){if(typeof WeakMap!="function")return null;var gf=new WeakMap,yf=new WeakMap;return(Ra=function(vf){return vf?yf:gf})(mf)}function pc(mf,gf){if(mf&&mf.__esModule)return mf;if(mf===null||vo(mf)!="object"&&typeof mf!="function")return{default:mf};var yf=Ra(gf);if(yf&&yf.has(mf))return yf.get(mf);var vf={__proto__:null},bf=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Sf in mf)if(Sf!=="default"&&{}.hasOwnProperty.call(mf,Sf)){var xf=bf?Object.getOwnPropertyDescriptor(mf,Sf):null;xf&&(xf.get||xf.set)?Object.defineProperty(vf,Sf,xf):vf[Sf]=mf[Sf]}return vf.default=mf,yf&&yf.set(mf,vf),vf}function mc(mf){return mf&&mf.__esModule?mf:{default:mf}}var uf=function(mf){var gf=mf.match(/^(AU)?(\d{11})$/);if(!gf)return!1;var yf=[10,1,3,5,7,9,11,13,15,17,19];mf=mf.replace(/^AU/,"");for(var vf=(parseInt(mf.slice(0,1),10)-1).toString()+mf.slice(1),bf=0,Sf=0;Sf<11;Sf++)bf+=yf[Sf]*vf.charAt(Sf);return bf!==0&&bf%89===0},df=function(mf){var gf=function(yf){var vf=yf.pop(),bf=[5,4,3,2,7,6,5,4],Sf=(11-yf.reduce(function(xf,wf,If){return xf+wf*bf[If]},0)%11)%11;return vf===Sf};return/^(CHE[- ]?)?(\d{9}|(\d{3}\.\d{3}\.\d{3})|(\d{3} \d{3} \d{3})) ?(TVA|MWST|IVA)?$/.test(mf)&&gf(mf.match(/\d/g).map(function(yf){return+yf}))},ff=function(mf){var gf=mf.match(/^(PT)?(\d{9})$/);if(!gf)return!1;var yf=gf[2],vf=11-bo.reverseMultiplyAndSum(yf.split("").slice(0,8).map(function(bf){return parseInt(bf,10)}),9)%11;return vf>9?parseInt(yf[8],10)===0:vf===parseInt(yf[8],10)},hf=isVAT.vatMatchers={AT:function(mf){return/^(AT)?U\d{8}$/.test(mf)},BE:function(mf){return/^(BE)?\d{10}$/.test(mf)},BG:function(mf){return/^(BG)?\d{9,10}$/.test(mf)},HR:function(mf){return/^(HR)?\d{11}$/.test(mf)},CY:function(mf){return/^(CY)?\w{9}$/.test(mf)},CZ:function(mf){return/^(CZ)?\d{8,10}$/.test(mf)},DK:function(mf){return/^(DK)?\d{8}$/.test(mf)},EE:function(mf){return/^(EE)?\d{9}$/.test(mf)},FI:function(mf){return/^(FI)?\d{8}$/.test(mf)},FR:function(mf){return/^(FR)?\w{2}\d{9}$/.test(mf)},DE:function(mf){return/^(DE)?\d{9}$/.test(mf)},EL:function(mf){return/^(EL)?\d{9}$/.test(mf)},HU:function(mf){return/^(HU)?\d{8}$/.test(mf)},IE:function(mf){return/^(IE)?\d{7}\w{1}(W)?$/.test(mf)},IT:function(mf){return/^(IT)?\d{11}$/.test(mf)},LV:function(mf){return/^(LV)?\d{11}$/.test(mf)},LT:function(mf){return/^(LT)?\d{9,12}$/.test(mf)},LU:function(mf){return/^(LU)?\d{8}$/.test(mf)},MT:function(mf){return/^(MT)?\d{8}$/.test(mf)},NL:function(mf){return/^(NL)?\d{9}B\d{2}$/.test(mf)},PL:function(mf){return/^(PL)?(\d{10}|(\d{3}-\d{3}-\d{2}-\d{2})|(\d{3}-\d{2}-\d{2}-\d{3}))$/.test(mf)},PT:ff,RO:function(mf){return/^(RO)?\d{2,10}$/.test(mf)},SK:function(mf){return/^(SK)?\d{10}$/.test(mf)},SI:function(mf){return/^(SI)?\d{8}$/.test(mf)},ES:function(mf){return/^(ES)?\w\d{7}[A-Z]$/.test(mf)},SE:function(mf){return/^(SE)?\d{12}$/.test(mf)},AL:function(mf){return/^(AL)?\w{9}[A-Z]$/.test(mf)},MK:function(mf){return/^(MK)?\d{13}$/.test(mf)},AU:uf,BY:function(mf){return/^(УНП )?\d{9}$/.test(mf)},CA:function(mf){return/^(CA)?\d{9}$/.test(mf)},IS:function(mf){return/^(IS)?\d{5,6}$/.test(mf)},IN:function(mf){return/^(IN)?\d{15}$/.test(mf)},ID:function(mf){return/^(ID)?(\d{15}|(\d{2}.\d{3}.\d{3}.\d{1}-\d{3}.\d{3}))$/.test(mf)},IL:function(mf){return/^(IL)?\d{9}$/.test(mf)},KZ:function(mf){return/^(KZ)?\d{12}$/.test(mf)},NZ:function(mf){return/^(NZ)?\d{9}$/.test(mf)},NG:function(mf){return/^(NG)?(\d{12}|(\d{8}-\d{4}))$/.test(mf)},NO:function(mf){return/^(NO)?\d{9}MVA$/.test(mf)},PH:function(mf){return/^(PH)?(\d{12}|\d{3} \d{3} \d{3} \d{3})$/.test(mf)},RU:function(mf){return/^(RU)?(\d{10}|\d{12})$/.test(mf)},SM:function(mf){return/^(SM)?\d{5}$/.test(mf)},SA:function(mf){return/^(SA)?\d{15}$/.test(mf)},RS:function(mf){return/^(RS)?\d{9}$/.test(mf)},CH:df,TR:function(mf){return/^(TR)?\d{10}$/.test(mf)},UA:function(mf){return/^(UA)?\d{12}$/.test(mf)},GB:function(mf){return/^GB((\d{3} \d{4} ([0-8][0-9]|9[0-6]))|(\d{9} \d{3})|(((GD[0-4])|(HA[5-9]))[0-9]{2}))$/.test(mf)},UZ:function(mf){return/^(UZ)?\d{9}$/.test(mf)},AR:function(mf){return/^(AR)?\d{11}$/.test(mf)},BO:function(mf){return/^(BO)?\d{7}$/.test(mf)},BR:function(mf){return/^(BR)?((\d{2}.\d{3}.\d{3}\/\d{4}-\d{2})|(\d{3}.\d{3}.\d{3}-\d{2}))$/.test(mf)},CL:function(mf){return/^(CL)?\d{8}-\d{1}$/.test(mf)},CO:function(mf){return/^(CO)?\d{10}$/.test(mf)},CR:function(mf){return/^(CR)?\d{9,12}$/.test(mf)},EC:function(mf){return/^(EC)?\d{13}$/.test(mf)},SV:function(mf){return/^(SV)?\d{4}-\d{6}-\d{3}-\d{1}$/.test(mf)},GT:function(mf){return/^(GT)?\d{7}-\d{1}$/.test(mf)},HN:function(mf){return/^(HN)?$/.test(mf)},MX:function(mf){return/^(MX)?\w{3,4}\d{6}\w{3}$/.test(mf)},NI:function(mf){return/^(NI)?\d{3}-\d{6}-\d{4}\w{1}$/.test(mf)},PA:function(mf){return/^(PA)?$/.test(mf)},PY:function(mf){return/^(PY)?\d{6,8}-\d{1}$/.test(mf)},PE:function(mf){return/^(PE)?\d{11}$/.test(mf)},DO:function(mf){return/^(DO)?(\d{11}|(\d{3}-\d{7}-\d{1})|[1,4,5]{1}\d{8}|([1,4,5]{1})-\d{2}-\d{5}-\d{1})$/.test(mf)},UY:function(mf){return/^(UY)?\d{12}$/.test(mf)},VE:function(mf){return/^(VE)?[J,G,V,E]{1}-(\d{9}|(\d{8}-\d{1}))$/.test(mf)}};function pf(mf,gf){if((0,Ai.default)(mf),(0,Ai.default)(gf),gf in hf)return hf[gf](mf);throw new Error("Invalid country code: '".concat(gf,"'"))}return isVAT}var hasRequiredValidator;function requireValidator(){return hasRequiredValidator||(hasRequiredValidator=1,function(vo,Ai){function bo(lT){"@babel/helpers - typeof";return bo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(hT){return typeof hT}:function(hT){return hT&&typeof Symbol=="function"&&hT.constructor===Symbol&&hT!==Symbol.prototype?"symbol":typeof hT},bo(lT)}Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=void 0;var Ra=X1(requireToDate()),pc=X1(requireToFloat()),mc=X1(requireToInt()),uf=X1(requireToBoolean()),df=X1(requireEquals()),ff=X1(requireContains()),hf=X1(requireMatches()),pf=X1(requireIsEmail()),mf=X1(requireIsURL()),gf=X1(requireIsMACAddress()),yf=X1(requireIsIP()),vf=X1(requireIsIPRange()),bf=X1(requireIsFQDN()),Sf=X1(requireIsDate()),xf=X1(requireIsTime()),wf=X1(requireIsBoolean()),If=X1(requireIsLocale()),l1=X1(requireIsAbaRouting()),s1=ST(requireIsAlpha()),c1=ST(requireIsAlphanumeric()),u1=X1(requireIsNumeric()),T1=X1(requireIsPassportNumber()),_1=X1(requireIsPort()),R1=X1(requireIsLowercase()),P1=X1(requireIsUppercase()),E1=X1(requireIsIMEI()),M1=X1(requireIsAscii()),m1=X1(requireIsFullWidth()),$1=X1(requireIsHalfWidth()),k1=X1(requireIsVariableWidth()),F1=X1(requireIsMultibyte()),U1=X1(requireIsSemVer()),B1=X1(requireIsSurrogatePair()),W1=X1(requireIsInt()),Z1=ST(requireIsFloat()),O1=X1(requireIsDecimal()),j1=X1(requireIsHexadecimal()),L1=X1(requireIsOctal()),G1=X1(requireIsDivisibleBy()),Y1=X1(requireIsHexColor()),z1=X1(requireIsRgbColor()),K1=X1(requireIsHSL()),tT=X1(requireIsISRC()),iT=ST(requireIsIBAN()),aT=X1(requireIsBIC()),oT=X1(requireIsMD5()),nT=X1(requireIsHash()),cT=X1(requireIsJWT()),N1=X1(requireIsJSON()),V1=X1(requireIsEmpty()),D1=X1(requireIsLength()),d1=X1(requireIsByteLength()),f1=X1(requireIsUUID()),A1=X1(requireIsMongoId()),Q1=X1(requireIsAfter()),q1=X1(requireIsBefore()),H1=X1(requireIsIn()),J1=X1(requireIsLuhnNumber()),eT=X1(requireIsCreditCard()),rT=X1(requireIsIdentityCard()),sT=X1(requireIsEAN()),dT=X1(requireIsISIN()),fT=X1(requireIsISBN()),uT=X1(requireIsISSN()),mT=X1(requireIsTaxID()),pT=ST(requireIsMobilePhone()),gT=X1(requireIsEthereumAddress()),bT=X1(requireIsCurrency()),xT=X1(requireIsBtcAddress()),ET=requireIsISO6346(),_T=X1(requireIsISO6391()),NT=X1(requireIsISO8601()),RT=X1(requireIsRFC3339()),PT=X1(requireIsISO31661Alpha2()),DT=X1(requireIsISO31661Alpha3()),MT=X1(requireIsISO4217()),LT=X1(requireIsBase32()),FT=X1(requireIsBase58()),jT=X1(requireIsBase64()),VT=X1(requireIsDataURI()),BT=X1(requireIsMagnetURI()),UT=X1(requireIsMailtoURI()),QT=X1(requireIsMimeType()),qT=X1(requireIsLatLong()),OT=ST(requireIsPostalCode()),GT=X1(requireLtrim()),HT=X1(requireRtrim()),ZT=X1(requireTrim()),WT=X1(require_escape()),zT=X1(require_unescape()),YT=X1(requireStripLow()),XT=X1(requireWhitelist()),JT=X1(requireBlacklist()),KT=X1(requireIsWhitelisted()),e$=X1(requireNormalizeEmail()),t$=X1(requireIsSlug()),r$=X1(requireIsLicensePlate()),n$=X1(requireIsStrongPassword()),i$=X1(requireIsVAT());function IT(lT){if(typeof WeakMap!="function")return null;var hT=new WeakMap,yT=new WeakMap;return(IT=function(vT){return vT?yT:hT})(lT)}function ST(lT,hT){if(lT&&lT.__esModule)return lT;if(lT===null||bo(lT)!="object"&&typeof lT!="function")return{default:lT};var yT=IT(hT);if(yT&&yT.has(lT))return yT.get(lT);var vT={__proto__:null},a$=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var TT in lT)if(TT!=="default"&&{}.hasOwnProperty.call(lT,TT)){var wT=a$?Object.getOwnPropertyDescriptor(lT,TT):null;wT&&(wT.get||wT.set)?Object.defineProperty(vT,TT,wT):vT[TT]=lT[TT]}return vT.default=lT,yT&&yT.set(lT,vT),vT}function X1(lT){return lT&&lT.__esModule?lT:{default:lT}}var o$="13.12.0",s$={version:o$,toDate:Ra.default,toFloat:pc.default,toInt:mc.default,toBoolean:uf.default,equals:df.default,contains:ff.default,matches:hf.default,isEmail:pf.default,isURL:mf.default,isMACAddress:gf.default,isIP:yf.default,isIPRange:vf.default,isFQDN:bf.default,isBoolean:wf.default,isIBAN:iT.default,isBIC:aT.default,isAbaRouting:l1.default,isAlpha:s1.default,isAlphaLocales:s1.locales,isAlphanumeric:c1.default,isAlphanumericLocales:c1.locales,isNumeric:u1.default,isPassportNumber:T1.default,isPort:_1.default,isLowercase:R1.default,isUppercase:P1.default,isAscii:M1.default,isFullWidth:m1.default,isHalfWidth:$1.default,isVariableWidth:k1.default,isMultibyte:F1.default,isSemVer:U1.default,isSurrogatePair:B1.default,isInt:W1.default,isIMEI:E1.default,isFloat:Z1.default,isFloatLocales:Z1.locales,isDecimal:O1.default,isHexadecimal:j1.default,isOctal:L1.default,isDivisibleBy:G1.default,isHexColor:Y1.default,isRgbColor:z1.default,isHSL:K1.default,isISRC:tT.default,isMD5:oT.default,isHash:nT.default,isJWT:cT.default,isJSON:N1.default,isEmpty:V1.default,isLength:D1.default,isLocale:If.default,isByteLength:d1.default,isUUID:f1.default,isMongoId:A1.default,isAfter:Q1.default,isBefore:q1.default,isIn:H1.default,isLuhnNumber:J1.default,isCreditCard:eT.default,isIdentityCard:rT.default,isEAN:sT.default,isISIN:dT.default,isISBN:fT.default,isISSN:uT.default,isMobilePhone:pT.default,isMobilePhoneLocales:pT.locales,isPostalCode:OT.default,isPostalCodeLocales:OT.locales,isEthereumAddress:gT.default,isCurrency:bT.default,isBtcAddress:xT.default,isISO6346:ET.isISO6346,isFreightContainerID:ET.isFreightContainerID,isISO6391:_T.default,isISO8601:NT.default,isRFC3339:RT.default,isISO31661Alpha2:PT.default,isISO31661Alpha3:DT.default,isISO4217:MT.default,isBase32:LT.default,isBase58:FT.default,isBase64:jT.default,isDataURI:VT.default,isMagnetURI:BT.default,isMailtoURI:UT.default,isMimeType:QT.default,isLatLong:qT.default,ltrim:GT.default,rtrim:HT.default,trim:ZT.default,escape:WT.default,unescape:zT.default,stripLow:YT.default,whitelist:XT.default,blacklist:JT.default,isWhitelisted:KT.default,normalizeEmail:e$.default,toString,isSlug:t$.default,isStrongPassword:n$.default,isTaxID:mT.default,isDate:Sf.default,isTime:xf.default,isLicensePlate:r$.default,isVAT:i$.default,ibanLocales:iT.locales};Ai.default=s$,vo.exports=Ai.default,vo.exports.default=Ai.default}(validator$1,validator$1.exports)),validator$1.exports}var validatorExports=requireValidator();const validator=xo$2(validatorExports);function createNameSchema(vo={}){const{required:Ai=!1,allowEmpty:bo=!1,unique:Ra=[]}=vo,pc=bo?h$2.string():h$2.string().min(1),mc=pc.refine(uf=>!uf&&bo?!0:!Ra.map(df=>df.toLowerCase()).includes(uf.replace(/^\s+|\s+$/g,"_").toLowerCase()),{message:"Item with this name already exists"});return Ai?Ra.length>0?mc:pc:Ra.length>0?h$2.string().optional().refine(uf=>uf===void 0||!uf&&bo?!0:!Ra.map(df=>df.toLowerCase()).includes(uf.replace(/^\s+|\s+$/g,"_").toLowerCase()),{message:"Item with this name already exists"}):h$2.string().optional()}function createConstantCaseSchema(vo={}){return createNameSchema(vo).transform(Ai=>Ai&&Ai.toUpperCase()).refine(Ai=>!Ai||validator.isUppercase(Ai),{message:"Must be uppercase"})}function createLowercaseSnakeCaseSchema(vo={}){return createNameSchema(vo).transform(Ai=>Ai&&Ai.toLowerCase()).refine(Ai=>!Ai||validator.isLowercase(Ai),{message:"Must be lowercase"})}function toLowercaseSnakeCase(vo,Ai={}){return createLowercaseSnakeCaseSchema(Ai).parse(snakeCase(vo))}function toConstantCase(vo,Ai={}){return createConstantCaseSchema(Ai).parse(constantCase(vo))}h$2.object({name:createNameSchema({allowEmpty:!0}),website:h$2.union([h$2.string().url(),h$2.literal("")]).optional().default("")}).default({name:"",website:""});h$2.string().default("");const s=(vo,Ai,bo)=>{if(vo&&"reportValidity"in vo){const Ra=B$3(bo,Ai);vo.setCustomValidity(Ra&&Ra.message||""),vo.reportValidity()}},o=(vo,Ai)=>{for(const bo in Ai.fields){const Ra=Ai.fields[bo];Ra&&Ra.ref&&"reportValidity"in Ra.ref?s(Ra.ref,bo,vo):Ra.refs&&Ra.refs.forEach(pc=>s(pc,bo,vo))}},r=(vo,Ai)=>{Ai.shouldUseNativeValidation&&o(vo,Ai);const bo={};for(const Ra in vo){const pc=B$3(Ai.fields,Ra),mc=Object.assign(vo[Ra]||{},{ref:pc&&pc.ref});if(i$1(Ai.names||Object.keys(vo),Ra)){const uf=Object.assign({},B$3(bo,Ra));ge$2(uf,"root",mc),ge$2(bo,Ra,uf)}else ge$2(bo,Ra,mc)}return bo},i$1=(vo,Ai)=>vo.some(bo=>bo.startsWith(Ai+"."));var n=function(vo,Ai){for(var bo={};vo.length;){var Ra=vo[0],pc=Ra.code,mc=Ra.message,uf=Ra.path.join(".");if(!bo[uf])if("unionErrors"in Ra){var df=Ra.unionErrors[0].errors[0];bo[uf]={message:df.message,type:df.code}}else bo[uf]={message:mc,type:pc};if("unionErrors"in Ra&&Ra.unionErrors.forEach(function(pf){return pf.errors.forEach(function(mf){return vo.push(mf)})}),Ai){var ff=bo[uf].types,hf=ff&&ff[Ra.code];bo[uf]=Mf(uf,Ai,bo,pc,hf?[].concat(hf,Ra.message):Ra.message)}vo.shift()}return bo},t$2=function(vo,Ai,bo){return bo===void 0&&(bo={}),function(Ra,pc,mc){try{return Promise.resolve(function(uf,df){try{var ff=Promise.resolve(vo[bo.mode==="sync"?"parse":"parseAsync"](Ra,Ai)).then(function(hf){return mc.shouldUseNativeValidation&&o({},mc),{errors:{},values:bo.raw?Ra:hf}})}catch(hf){return df(hf)}return ff&&ff.then?ff.then(void 0,df):ff}(0,function(uf){if(function(df){return Array.isArray(df==null?void 0:df.errors)}(uf))return{values:{},errors:r(n(uf.errors,!mc.shouldUseNativeValidation&&mc.criteriaMode==="all"),mc)};throw uf}))}catch(uf){return Promise.reject(uf)}}};const Textarea=forwardRef(({className:vo,...Ai},bo)=>{const Ra=useRef(null),pc=useCallback(uf=>{uf.style.height="auto";const df=Math.max(uf.scrollHeight,uf.offsetHeight);uf.style.height=`${df}px`},[]),mc=useCallback(uf=>{pc(uf.currentTarget)},[pc]);return y$2.useEffect(()=>{Ra.current&&pc(Ra.current)},[pc]),useImperativeHandle(bo,()=>({focus:()=>{var uf;return(uf=Ra.current)==null?void 0:uf.focus()},element:Ra.current})),jsx("textarea",{...Ai,className:cn("min-h-10 w-full resize-none rounded-md border border-gray-200 bg-gray-50 px-3 py-2 text-sm text-gray-800 placeholder:text-gray-600 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",vo),ref:Ra,onInput:mc})});Textarea.displayName="Textarea";const TextField=forwardRef(({name:vo,value:Ai,onSubmit:bo,label:Ra,placeholder:pc,unique:mc,className:uf="",rows:df=1,focusOnMount:ff=!1,required:hf=!1,allowEmpty:pf=!1,shouldReset:mf=!1,onChange:gf},yf)=>{const vf=useRef(null);useEffect(()=>{ff&&vf.current&&vf.current.focus()},[ff]);const bf=h$2.object({[vo]:createNameSchema({required:hf,allowEmpty:pf,unique:mc})}),Sf=Wf({resolver:t$2(bf),defaultValues:{[vo]:Ai??""}}),xf=useCallback(s1=>{const c1=s1[vo];c1===void 0||Ai===c1||(bo(c1),mf&&Sf.reset({[vo]:""}))},[vo,Ai,bo,Sf,mf]),wf=useCallback(async()=>{const s1=Sf.getValues()[vo]??"";if(!(Ai==null&&(!s1||s1.trim()===""))&&!compareStringsWithoutWhitespace(s1,Ai??""))try{await Sf.trigger(),Sf.formState.isValid&&await Sf.handleSubmit(xf)()}catch{}},[Sf,xf,vo,Ai]),If=useCallback(s1=>{s1.key==="Enter"&&(s1.preventDefault(),s1.target.blur())},[]),l1=useCallback(s1=>{const c1=s1.target.value;gf==null||gf(c1)},[gf]);return useImperativeHandle(yf,()=>({focus:()=>{var s1;return(s1=vf.current)==null?void 0:s1.focus()}})),useEffect(()=>{Sf.reset({[vo]:Ai??""})},[Sf,vo,Ai]),jsx(Form,{...Sf,children:jsx(FormField,{control:Sf.control,name:vo,render:({field:s1})=>jsxs(FormItem,{className:"grid h-full grid-rows-[auto,1fr] gap-2 overflow-visible",children:[!!Ra&&jsx(FormLabel,{htmlFor:vo,className:"text-sm font-medium text-gray-700",children:Ra}),jsx(FormControl,{children:jsx(Textarea,{...s1,id:vo,ref:c1=>{c1&&(s1.ref(c1.element),vf.current=c1)},placeholder:pc,onBlur:wf,onChange:c1=>{s1.onChange(c1),l1(c1)},onKeyDown:If,rows:df,className:uf})}),jsx(FormMessage,{})]})})})});TextField.displayName="TextField";function ModuleForm({module:vo,onAddModule:Ai,updateModuleName:bo,modules:Ra=[]}){const pc=!!vo,mc=Ra.map(df=>df.name),uf=async df=>{const ff=toLowercaseSnakeCase(df);ff.length&&(pc?ff!==vo.name&&bo(vo.id,ff):await Ai(ff))};return jsx(TextField,{name:"name",label:pc?"Module name":"Add module",value:vo==null?void 0:vo.name,onSubmit:uf,placeholder:"Add module",unique:mc,shouldReset:!pc,required:!0},(vo==null?void 0:vo.id)??"new")}const Input=y$2.forwardRef(({className:vo,type:Ai,...bo},Ra)=>jsx("input",{type:Ai,className:cn("flex h-9 w-full rounded-md border border-gray-400 bg-transparent px-3 py-1 text-sm transition-colors hover:bg-gray-100 focus-visible:bg-gray-200 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",vo),ref:Ra,...bo}));Input.displayName="Input";let rangeFrom=[],rangeTo=[];(()=>{let vo="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(Ai=>Ai?parseInt(Ai,36):1);for(let Ai=0,bo=0;Ai<vo.length;Ai++)(Ai%2?rangeTo:rangeFrom).push(bo=bo+vo[Ai])})();function isExtendingChar(vo){if(vo<768)return!1;for(let Ai=0,bo=rangeFrom.length;;){let Ra=Ai+bo>>1;if(vo<rangeFrom[Ra])bo=Ra;else if(vo>=rangeTo[Ra])Ai=Ra+1;else return!0;if(Ai==bo)return!1}}function isRegionalIndicator(vo){return vo>=127462&&vo<=127487}const ZWJ=8205;function findClusterBreak$1(vo,Ai,bo=!0,Ra=!0){return(bo?nextClusterBreak:prevClusterBreak)(vo,Ai,Ra)}function nextClusterBreak(vo,Ai,bo){if(Ai==vo.length)return Ai;Ai&&surrogateLow$1(vo.charCodeAt(Ai))&&surrogateHigh$1(vo.charCodeAt(Ai-1))&&Ai--;let Ra=codePointAt$1(vo,Ai);for(Ai+=codePointSize$1(Ra);Ai<vo.length;){let pc=codePointAt$1(vo,Ai);if(Ra==ZWJ||pc==ZWJ||bo&&isExtendingChar(pc))Ai+=codePointSize$1(pc),Ra=pc;else if(isRegionalIndicator(pc)){let mc=0,uf=Ai-2;for(;uf>=0&&isRegionalIndicator(codePointAt$1(vo,uf));)mc++,uf-=2;if(mc%2==0)break;Ai+=2}else break}return Ai}function prevClusterBreak(vo,Ai,bo){for(;Ai>0;){let Ra=nextClusterBreak(vo,Ai-2,bo);if(Ra<Ai)return Ra;Ai--}return 0}function codePointAt$1(vo,Ai){let bo=vo.charCodeAt(Ai);if(!surrogateHigh$1(bo)||Ai+1==vo.length)return bo;let Ra=vo.charCodeAt(Ai+1);return surrogateLow$1(Ra)?(bo-55296<<10)+(Ra-56320)+65536:bo}function surrogateLow$1(vo){return vo>=56320&&vo<57344}function surrogateHigh$1(vo){return vo>=55296&&vo<56320}function codePointSize$1(vo){return vo<65536?1:2}class Text{lineAt(Ai){if(Ai<0||Ai>this.length)throw new RangeError(`Invalid position ${Ai} in document of length ${this.length}`);return this.lineInner(Ai,!1,1,0)}line(Ai){if(Ai<1||Ai>this.lines)throw new RangeError(`Invalid line number ${Ai} in ${this.lines}-line document`);return this.lineInner(Ai,!0,1,0)}replace(Ai,bo,Ra){[Ai,bo]=clip(this,Ai,bo);let pc=[];return this.decompose(0,Ai,pc,2),Ra.length&&Ra.decompose(0,Ra.length,pc,3),this.decompose(bo,this.length,pc,1),TextNode.from(pc,this.length-(bo-Ai)+Ra.length)}append(Ai){return this.replace(this.length,this.length,Ai)}slice(Ai,bo=this.length){[Ai,bo]=clip(this,Ai,bo);let Ra=[];return this.decompose(Ai,bo,Ra,0),TextNode.from(Ra,bo-Ai)}eq(Ai){if(Ai==this)return!0;if(Ai.length!=this.length||Ai.lines!=this.lines)return!1;let bo=this.scanIdentical(Ai,1),Ra=this.length-this.scanIdentical(Ai,-1),pc=new RawTextCursor(this),mc=new RawTextCursor(Ai);for(let uf=bo,df=bo;;){if(pc.next(uf),mc.next(uf),uf=0,pc.lineBreak!=mc.lineBreak||pc.done!=mc.done||pc.value!=mc.value)return!1;if(df+=pc.value.length,pc.done||df>=Ra)return!0}}iter(Ai=1){return new RawTextCursor(this,Ai)}iterRange(Ai,bo=this.length){return new PartialTextCursor(this,Ai,bo)}iterLines(Ai,bo){let Ra;if(Ai==null)Ra=this.iter();else{bo==null&&(bo=this.lines+1);let pc=this.line(Ai).from;Ra=this.iterRange(pc,Math.max(pc,bo==this.lines+1?this.length:bo<=1?0:this.line(bo-1).to))}return new LineCursor(Ra)}toString(){return this.sliceString(0)}toJSON(){let Ai=[];return this.flatten(Ai),Ai}constructor(){}static of(Ai){if(Ai.length==0)throw new RangeError("A document must have at least one line");return Ai.length==1&&!Ai[0]?Text.empty:Ai.length<=32?new TextLeaf(Ai):TextNode.from(TextLeaf.split(Ai,[]))}}class TextLeaf extends Text{constructor(Ai,bo=textLength(Ai)){super(),this.text=Ai,this.length=bo}get lines(){return this.text.length}get children(){return null}lineInner(Ai,bo,Ra,pc){for(let mc=0;;mc++){let uf=this.text[mc],df=pc+uf.length;if((bo?Ra:df)>=Ai)return new Line(pc,df,Ra,uf);pc=df+1,Ra++}}decompose(Ai,bo,Ra,pc){let mc=Ai<=0&&bo>=this.length?this:new TextLeaf(sliceText(this.text,Ai,bo),Math.min(bo,this.length)-Math.max(0,Ai));if(pc&1){let uf=Ra.pop(),df=appendText(mc.text,uf.text.slice(),0,mc.length);if(df.length<=32)Ra.push(new TextLeaf(df,uf.length+mc.length));else{let ff=df.length>>1;Ra.push(new TextLeaf(df.slice(0,ff)),new TextLeaf(df.slice(ff)))}}else Ra.push(mc)}replace(Ai,bo,Ra){if(!(Ra instanceof TextLeaf))return super.replace(Ai,bo,Ra);[Ai,bo]=clip(this,Ai,bo);let pc=appendText(this.text,appendText(Ra.text,sliceText(this.text,0,Ai)),bo),mc=this.length+Ra.length-(bo-Ai);return pc.length<=32?new TextLeaf(pc,mc):TextNode.from(TextLeaf.split(pc,[]),mc)}sliceString(Ai,bo=this.length,Ra=`
|
|
347
|
-
`){[Ai,bo]=clip(this,Ai,bo);let pc="";for(let mc=0,uf=0;mc<=bo&&uf<this.text.length;uf++){let df=this.text[uf],ff=mc+df.length;mc>Ai&&uf&&(pc+=Ra),Ai<ff&&bo>mc&&(pc+=df.slice(Math.max(0,Ai-mc),bo-mc)),mc=ff+1}return pc}flatten(Ai){for(let bo of this.text)Ai.push(bo)}scanIdentical(){return 0}static split(Ai,bo){let Ra=[],pc=-1;for(let mc of Ai)Ra.push(mc),pc+=mc.length+1,Ra.length==32&&(bo.push(new TextLeaf(Ra,pc)),Ra=[],pc=-1);return pc>-1&&bo.push(new TextLeaf(Ra,pc)),bo}}class TextNode extends Text{constructor(Ai,bo){super(),this.children=Ai,this.length=bo,this.lines=0;for(let Ra of Ai)this.lines+=Ra.lines}lineInner(Ai,bo,Ra,pc){for(let mc=0;;mc++){let uf=this.children[mc],df=pc+uf.length,ff=Ra+uf.lines-1;if((bo?ff:df)>=Ai)return uf.lineInner(Ai,bo,Ra,pc);pc=df+1,Ra=ff+1}}decompose(Ai,bo,Ra,pc){for(let mc=0,uf=0;uf<=bo&&mc<this.children.length;mc++){let df=this.children[mc],ff=uf+df.length;if(Ai<=ff&&bo>=uf){let hf=pc&((uf<=Ai?1:0)|(ff>=bo?2:0));uf>=Ai&&ff<=bo&&!hf?Ra.push(df):df.decompose(Ai-uf,bo-uf,Ra,hf)}uf=ff+1}}replace(Ai,bo,Ra){if([Ai,bo]=clip(this,Ai,bo),Ra.lines<this.lines)for(let pc=0,mc=0;pc<this.children.length;pc++){let uf=this.children[pc],df=mc+uf.length;if(Ai>=mc&&bo<=df){let ff=uf.replace(Ai-mc,bo-mc,Ra),hf=this.lines-uf.lines+ff.lines;if(ff.lines<hf>>4&&ff.lines>hf>>6){let pf=this.children.slice();return pf[pc]=ff,new TextNode(pf,this.length-(bo-Ai)+Ra.length)}return super.replace(mc,df,ff)}mc=df+1}return super.replace(Ai,bo,Ra)}sliceString(Ai,bo=this.length,Ra=`
|
|
348
|
-
`){[Ai,bo]=clip(this,Ai,bo);let pc="";for(let mc=0,uf=0;mc<this.children.length&&uf<=bo;mc++){let df=this.children[mc],ff=uf+df.length;uf>Ai&&mc&&(pc+=Ra),Ai<ff&&bo>uf&&(pc+=df.sliceString(Ai-uf,bo-uf,Ra)),uf=ff+1}return pc}flatten(Ai){for(let bo of this.children)bo.flatten(Ai)}scanIdentical(Ai,bo){if(!(Ai instanceof TextNode))return 0;let Ra=0,[pc,mc,uf,df]=bo>0?[0,0,this.children.length,Ai.children.length]:[this.children.length-1,Ai.children.length-1,-1,-1];for(;;pc+=bo,mc+=bo){if(pc==uf||mc==df)return Ra;let ff=this.children[pc],hf=Ai.children[mc];if(ff!=hf)return Ra+ff.scanIdentical(hf,bo);Ra+=ff.length+1}}static from(Ai,bo=Ai.reduce((Ra,pc)=>Ra+pc.length+1,-1)){let Ra=0;for(let yf of Ai)Ra+=yf.lines;if(Ra<32){let yf=[];for(let vf of Ai)vf.flatten(yf);return new TextLeaf(yf,bo)}let pc=Math.max(32,Ra>>5),mc=pc<<1,uf=pc>>1,df=[],ff=0,hf=-1,pf=[];function mf(yf){let vf;if(yf.lines>mc&&yf instanceof TextNode)for(let bf of yf.children)mf(bf);else yf.lines>uf&&(ff>uf||!ff)?(gf(),df.push(yf)):yf instanceof TextLeaf&&ff&&(vf=pf[pf.length-1])instanceof TextLeaf&&yf.lines+vf.lines<=32?(ff+=yf.lines,hf+=yf.length+1,pf[pf.length-1]=new TextLeaf(vf.text.concat(yf.text),vf.length+1+yf.length)):(ff+yf.lines>pc&&gf(),ff+=yf.lines,hf+=yf.length+1,pf.push(yf))}function gf(){ff!=0&&(df.push(pf.length==1?pf[0]:TextNode.from(pf,hf)),hf=-1,ff=pf.length=0)}for(let yf of Ai)mf(yf);return gf(),df.length==1?df[0]:new TextNode(df,bo)}}Text.empty=new TextLeaf([""],0);function textLength(vo){let Ai=-1;for(let bo of vo)Ai+=bo.length+1;return Ai}function appendText(vo,Ai,bo=0,Ra=1e9){for(let pc=0,mc=0,uf=!0;mc<vo.length&&pc<=Ra;mc++){let df=vo[mc],ff=pc+df.length;ff>=bo&&(ff>Ra&&(df=df.slice(0,Ra-pc)),pc<bo&&(df=df.slice(bo-pc)),uf?(Ai[Ai.length-1]+=df,uf=!1):Ai.push(df)),pc=ff+1}return Ai}function sliceText(vo,Ai,bo){return appendText(vo,[""],Ai,bo)}class RawTextCursor{constructor(Ai,bo=1){this.dir=bo,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[Ai],this.offsets=[bo>0?1:(Ai instanceof TextLeaf?Ai.text.length:Ai.children.length)<<1]}nextInner(Ai,bo){for(this.done=this.lineBreak=!1;;){let Ra=this.nodes.length-1,pc=this.nodes[Ra],mc=this.offsets[Ra],uf=mc>>1,df=pc instanceof TextLeaf?pc.text.length:pc.children.length;if(uf==(bo>0?df:0)){if(Ra==0)return this.done=!0,this.value="",this;bo>0&&this.offsets[Ra-1]++,this.nodes.pop(),this.offsets.pop()}else if((mc&1)==(bo>0?0:1)){if(this.offsets[Ra]+=bo,Ai==0)return this.lineBreak=!0,this.value=`
|
|
349
|
-
`,this;Ai--}else if(pc instanceof TextLeaf){let ff=pc.text[uf+(bo<0?-1:0)];if(this.offsets[Ra]+=bo,ff.length>Math.max(0,Ai))return this.value=Ai==0?ff:bo>0?ff.slice(Ai):ff.slice(0,ff.length-Ai),this;Ai-=ff.length}else{let ff=pc.children[uf+(bo<0?-1:0)];Ai>ff.length?(Ai-=ff.length,this.offsets[Ra]+=bo):(bo<0&&this.offsets[Ra]--,this.nodes.push(ff),this.offsets.push(bo>0?1:(ff instanceof TextLeaf?ff.text.length:ff.children.length)<<1))}}}next(Ai=0){return Ai<0&&(this.nextInner(-Ai,-this.dir),Ai=this.value.length),this.nextInner(Ai,this.dir)}}class PartialTextCursor{constructor(Ai,bo,Ra){this.value="",this.done=!1,this.cursor=new RawTextCursor(Ai,bo>Ra?-1:1),this.pos=bo>Ra?Ai.length:0,this.from=Math.min(bo,Ra),this.to=Math.max(bo,Ra)}nextInner(Ai,bo){if(bo<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;Ai+=Math.max(0,bo<0?this.pos-this.to:this.from-this.pos);let Ra=bo<0?this.pos-this.from:this.to-this.pos;Ai>Ra&&(Ai=Ra),Ra-=Ai;let{value:pc}=this.cursor.next(Ai);return this.pos+=(pc.length+Ai)*bo,this.value=pc.length<=Ra?pc:bo<0?pc.slice(pc.length-Ra):pc.slice(0,Ra),this.done=!this.value,this}next(Ai=0){return Ai<0?Ai=Math.max(Ai,this.from-this.pos):Ai>0&&(Ai=Math.min(Ai,this.to-this.pos)),this.nextInner(Ai,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class LineCursor{constructor(Ai){this.inner=Ai,this.afterBreak=!0,this.value="",this.done=!1}next(Ai=0){let{done:bo,lineBreak:Ra,value:pc}=this.inner.next(Ai);return bo&&this.afterBreak?(this.value="",this.afterBreak=!1):bo?(this.done=!0,this.value=""):Ra?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=pc,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Text.prototype[Symbol.iterator]=function(){return this.iter()},RawTextCursor.prototype[Symbol.iterator]=PartialTextCursor.prototype[Symbol.iterator]=LineCursor.prototype[Symbol.iterator]=function(){return this});class Line{constructor(Ai,bo,Ra,pc){this.from=Ai,this.to=bo,this.number=Ra,this.text=pc}get length(){return this.to-this.from}}function clip(vo,Ai,bo){return Ai=Math.max(0,Math.min(vo.length,Ai)),[Ai,Math.max(Ai,Math.min(vo.length,bo))]}function findClusterBreak(vo,Ai,bo=!0,Ra=!0){return findClusterBreak$1(vo,Ai,bo,Ra)}function surrogateLow(vo){return vo>=56320&&vo<57344}function surrogateHigh(vo){return vo>=55296&&vo<56320}function codePointAt(vo,Ai){let bo=vo.charCodeAt(Ai);if(!surrogateHigh(bo)||Ai+1==vo.length)return bo;let Ra=vo.charCodeAt(Ai+1);return surrogateLow(Ra)?(bo-55296<<10)+(Ra-56320)+65536:bo}function fromCodePoint(vo){return vo<=65535?String.fromCharCode(vo):(vo-=65536,String.fromCharCode((vo>>10)+55296,(vo&1023)+56320))}function codePointSize(vo){return vo<65536?1:2}const DefaultSplit=/\r\n?|\n/;var MapMode=function(vo){return vo[vo.Simple=0]="Simple",vo[vo.TrackDel=1]="TrackDel",vo[vo.TrackBefore=2]="TrackBefore",vo[vo.TrackAfter=3]="TrackAfter",vo}(MapMode||(MapMode={}));class ChangeDesc{constructor(Ai){this.sections=Ai}get length(){let Ai=0;for(let bo=0;bo<this.sections.length;bo+=2)Ai+=this.sections[bo];return Ai}get newLength(){let Ai=0;for(let bo=0;bo<this.sections.length;bo+=2){let Ra=this.sections[bo+1];Ai+=Ra<0?this.sections[bo]:Ra}return Ai}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(Ai){for(let bo=0,Ra=0,pc=0;bo<this.sections.length;){let mc=this.sections[bo++],uf=this.sections[bo++];uf<0?(Ai(Ra,pc,mc),pc+=mc):pc+=uf,Ra+=mc}}iterChangedRanges(Ai,bo=!1){iterChanges(this,Ai,bo)}get invertedDesc(){let Ai=[];for(let bo=0;bo<this.sections.length;){let Ra=this.sections[bo++],pc=this.sections[bo++];pc<0?Ai.push(Ra,pc):Ai.push(pc,Ra)}return new ChangeDesc(Ai)}composeDesc(Ai){return this.empty?Ai:Ai.empty?this:composeSets(this,Ai)}mapDesc(Ai,bo=!1){return Ai.empty?this:mapSet(this,Ai,bo)}mapPos(Ai,bo=-1,Ra=MapMode.Simple){let pc=0,mc=0;for(let uf=0;uf<this.sections.length;){let df=this.sections[uf++],ff=this.sections[uf++],hf=pc+df;if(ff<0){if(hf>Ai)return mc+(Ai-pc);mc+=df}else{if(Ra!=MapMode.Simple&&hf>=Ai&&(Ra==MapMode.TrackDel&&pc<Ai&&hf>Ai||Ra==MapMode.TrackBefore&&pc<Ai||Ra==MapMode.TrackAfter&&hf>Ai))return null;if(hf>Ai||hf==Ai&&bo<0&&!df)return Ai==pc||bo<0?mc:mc+ff;mc+=ff}pc=hf}if(Ai>pc)throw new RangeError(`Position ${Ai} is out of range for changeset of length ${pc}`);return mc}touchesRange(Ai,bo=Ai){for(let Ra=0,pc=0;Ra<this.sections.length&&pc<=bo;){let mc=this.sections[Ra++],uf=this.sections[Ra++],df=pc+mc;if(uf>=0&&pc<=bo&&df>=Ai)return pc<Ai&&df>bo?"cover":!0;pc=df}return!1}toString(){let Ai="";for(let bo=0;bo<this.sections.length;){let Ra=this.sections[bo++],pc=this.sections[bo++];Ai+=(Ai?" ":"")+Ra+(pc>=0?":"+pc:"")}return Ai}toJSON(){return this.sections}static fromJSON(Ai){if(!Array.isArray(Ai)||Ai.length%2||Ai.some(bo=>typeof bo!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new ChangeDesc(Ai)}static create(Ai){return new ChangeDesc(Ai)}}class ChangeSet extends ChangeDesc{constructor(Ai,bo){super(Ai),this.inserted=bo}apply(Ai){if(this.length!=Ai.length)throw new RangeError("Applying change set to a document with the wrong length");return iterChanges(this,(bo,Ra,pc,mc,uf)=>Ai=Ai.replace(pc,pc+(Ra-bo),uf),!1),Ai}mapDesc(Ai,bo=!1){return mapSet(this,Ai,bo,!0)}invert(Ai){let bo=this.sections.slice(),Ra=[];for(let pc=0,mc=0;pc<bo.length;pc+=2){let uf=bo[pc],df=bo[pc+1];if(df>=0){bo[pc]=df,bo[pc+1]=uf;let ff=pc>>1;for(;Ra.length<ff;)Ra.push(Text.empty);Ra.push(uf?Ai.slice(mc,mc+uf):Text.empty)}mc+=uf}return new ChangeSet(bo,Ra)}compose(Ai){return this.empty?Ai:Ai.empty?this:composeSets(this,Ai,!0)}map(Ai,bo=!1){return Ai.empty?this:mapSet(this,Ai,bo,!0)}iterChanges(Ai,bo=!1){iterChanges(this,Ai,bo)}get desc(){return ChangeDesc.create(this.sections)}filter(Ai){let bo=[],Ra=[],pc=[],mc=new SectionIter(this);e:for(let uf=0,df=0;;){let ff=uf==Ai.length?1e9:Ai[uf++];for(;df<ff||df==ff&&mc.len==0;){if(mc.done)break e;let pf=Math.min(mc.len,ff-df);addSection(pc,pf,-1);let mf=mc.ins==-1?-1:mc.off==0?mc.ins:0;addSection(bo,pf,mf),mf>0&&addInsert(Ra,bo,mc.text),mc.forward(pf),df+=pf}let hf=Ai[uf++];for(;df<hf;){if(mc.done)break e;let pf=Math.min(mc.len,hf-df);addSection(bo,pf,-1),addSection(pc,pf,mc.ins==-1?-1:mc.off==0?mc.ins:0),mc.forward(pf),df+=pf}}return{changes:new ChangeSet(bo,Ra),filtered:ChangeDesc.create(pc)}}toJSON(){let Ai=[];for(let bo=0;bo<this.sections.length;bo+=2){let Ra=this.sections[bo],pc=this.sections[bo+1];pc<0?Ai.push(Ra):pc==0?Ai.push([Ra]):Ai.push([Ra].concat(this.inserted[bo>>1].toJSON()))}return Ai}static of(Ai,bo,Ra){let pc=[],mc=[],uf=0,df=null;function ff(pf=!1){if(!pf&&!pc.length)return;uf<bo&&addSection(pc,bo-uf,-1);let mf=new ChangeSet(pc,mc);df=df?df.compose(mf.map(df)):mf,pc=[],mc=[],uf=0}function hf(pf){if(Array.isArray(pf))for(let mf of pf)hf(mf);else if(pf instanceof ChangeSet){if(pf.length!=bo)throw new RangeError(`Mismatched change set length (got ${pf.length}, expected ${bo})`);ff(),df=df?df.compose(pf.map(df)):pf}else{let{from:mf,to:gf=mf,insert:yf}=pf;if(mf>gf||mf<0||gf>bo)throw new RangeError(`Invalid change range ${mf} to ${gf} (in doc of length ${bo})`);let vf=yf?typeof yf=="string"?Text.of(yf.split(Ra||DefaultSplit)):yf:Text.empty,bf=vf.length;if(mf==gf&&bf==0)return;mf<uf&&ff(),mf>uf&&addSection(pc,mf-uf,-1),addSection(pc,gf-mf,bf),addInsert(mc,pc,vf),uf=gf}}return hf(Ai),ff(!df),df}static empty(Ai){return new ChangeSet(Ai?[Ai,-1]:[],[])}static fromJSON(Ai){if(!Array.isArray(Ai))throw new RangeError("Invalid JSON representation of ChangeSet");let bo=[],Ra=[];for(let pc=0;pc<Ai.length;pc++){let mc=Ai[pc];if(typeof mc=="number")bo.push(mc,-1);else{if(!Array.isArray(mc)||typeof mc[0]!="number"||mc.some((uf,df)=>df&&typeof uf!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(mc.length==1)bo.push(mc[0],0);else{for(;Ra.length<pc;)Ra.push(Text.empty);Ra[pc]=Text.of(mc.slice(1)),bo.push(mc[0],Ra[pc].length)}}}return new ChangeSet(bo,Ra)}static createSet(Ai,bo){return new ChangeSet(Ai,bo)}}function addSection(vo,Ai,bo,Ra=!1){if(Ai==0&&bo<=0)return;let pc=vo.length-2;pc>=0&&bo<=0&&bo==vo[pc+1]?vo[pc]+=Ai:pc>=0&&Ai==0&&vo[pc]==0?vo[pc+1]+=bo:Ra?(vo[pc]+=Ai,vo[pc+1]+=bo):vo.push(Ai,bo)}function addInsert(vo,Ai,bo){if(bo.length==0)return;let Ra=Ai.length-2>>1;if(Ra<vo.length)vo[vo.length-1]=vo[vo.length-1].append(bo);else{for(;vo.length<Ra;)vo.push(Text.empty);vo.push(bo)}}function iterChanges(vo,Ai,bo){let Ra=vo.inserted;for(let pc=0,mc=0,uf=0;uf<vo.sections.length;){let df=vo.sections[uf++],ff=vo.sections[uf++];if(ff<0)pc+=df,mc+=df;else{let hf=pc,pf=mc,mf=Text.empty;for(;hf+=df,pf+=ff,ff&&Ra&&(mf=mf.append(Ra[uf-2>>1])),!(bo||uf==vo.sections.length||vo.sections[uf+1]<0);)df=vo.sections[uf++],ff=vo.sections[uf++];Ai(pc,hf,mc,pf,mf),pc=hf,mc=pf}}}function mapSet(vo,Ai,bo,Ra=!1){let pc=[],mc=Ra?[]:null,uf=new SectionIter(vo),df=new SectionIter(Ai);for(let ff=-1;;){if(uf.done&&df.len||df.done&&uf.len)throw new Error("Mismatched change set lengths");if(uf.ins==-1&&df.ins==-1){let hf=Math.min(uf.len,df.len);addSection(pc,hf,-1),uf.forward(hf),df.forward(hf)}else if(df.ins>=0&&(uf.ins<0||ff==uf.i||uf.off==0&&(df.len<uf.len||df.len==uf.len&&!bo))){let hf=df.len;for(addSection(pc,df.ins,-1);hf;){let pf=Math.min(uf.len,hf);uf.ins>=0&&ff<uf.i&&uf.len<=pf&&(addSection(pc,0,uf.ins),mc&&addInsert(mc,pc,uf.text),ff=uf.i),uf.forward(pf),hf-=pf}df.next()}else if(uf.ins>=0){let hf=0,pf=uf.len;for(;pf;)if(df.ins==-1){let mf=Math.min(pf,df.len);hf+=mf,pf-=mf,df.forward(mf)}else if(df.ins==0&&df.len<pf)pf-=df.len,df.next();else break;addSection(pc,hf,ff<uf.i?uf.ins:0),mc&&ff<uf.i&&addInsert(mc,pc,uf.text),ff=uf.i,uf.forward(uf.len-pf)}else{if(uf.done&&df.done)return mc?ChangeSet.createSet(pc,mc):ChangeDesc.create(pc);throw new Error("Mismatched change set lengths")}}}function composeSets(vo,Ai,bo=!1){let Ra=[],pc=bo?[]:null,mc=new SectionIter(vo),uf=new SectionIter(Ai);for(let df=!1;;){if(mc.done&&uf.done)return pc?ChangeSet.createSet(Ra,pc):ChangeDesc.create(Ra);if(mc.ins==0)addSection(Ra,mc.len,0,df),mc.next();else if(uf.len==0&&!uf.done)addSection(Ra,0,uf.ins,df),pc&&addInsert(pc,Ra,uf.text),uf.next();else{if(mc.done||uf.done)throw new Error("Mismatched change set lengths");{let ff=Math.min(mc.len2,uf.len),hf=Ra.length;if(mc.ins==-1){let pf=uf.ins==-1?-1:uf.off?0:uf.ins;addSection(Ra,ff,pf,df),pc&&pf&&addInsert(pc,Ra,uf.text)}else uf.ins==-1?(addSection(Ra,mc.off?0:mc.len,ff,df),pc&&addInsert(pc,Ra,mc.textBit(ff))):(addSection(Ra,mc.off?0:mc.len,uf.off?0:uf.ins,df),pc&&!uf.off&&addInsert(pc,Ra,uf.text));df=(mc.ins>ff||uf.ins>=0&&uf.len>ff)&&(df||Ra.length>hf),mc.forward2(ff),uf.forward(ff)}}}}class SectionIter{constructor(Ai){this.set=Ai,this.i=0,this.next()}next(){let{sections:Ai}=this.set;this.i<Ai.length?(this.len=Ai[this.i++],this.ins=Ai[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:Ai}=this.set,bo=this.i-2>>1;return bo>=Ai.length?Text.empty:Ai[bo]}textBit(Ai){let{inserted:bo}=this.set,Ra=this.i-2>>1;return Ra>=bo.length&&!Ai?Text.empty:bo[Ra].slice(this.off,Ai==null?void 0:this.off+Ai)}forward(Ai){Ai==this.len?this.next():(this.len-=Ai,this.off+=Ai)}forward2(Ai){this.ins==-1?this.forward(Ai):Ai==this.ins?this.next():(this.ins-=Ai,this.off+=Ai)}}let SelectionRange$1=class $T{constructor(Ai,bo,Ra){this.from=Ai,this.to=bo,this.flags=Ra}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let Ai=this.flags&7;return Ai==7?null:Ai}get goalColumn(){let Ai=this.flags>>6;return Ai==16777215?void 0:Ai}map(Ai,bo=-1){let Ra,pc;return this.empty?Ra=pc=Ai.mapPos(this.from,bo):(Ra=Ai.mapPos(this.from,1),pc=Ai.mapPos(this.to,-1)),Ra==this.from&&pc==this.to?this:new $T(Ra,pc,this.flags)}extend(Ai,bo=Ai){if(Ai<=this.anchor&&bo>=this.anchor)return EditorSelection.range(Ai,bo);let Ra=Math.abs(Ai-this.anchor)>Math.abs(bo-this.anchor)?Ai:bo;return EditorSelection.range(this.anchor,Ra)}eq(Ai,bo=!1){return this.anchor==Ai.anchor&&this.head==Ai.head&&(!bo||!this.empty||this.assoc==Ai.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(Ai){if(!Ai||typeof Ai.anchor!="number"||typeof Ai.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return EditorSelection.range(Ai.anchor,Ai.head)}static create(Ai,bo,Ra){return new $T(Ai,bo,Ra)}};class EditorSelection{constructor(Ai,bo){this.ranges=Ai,this.mainIndex=bo}map(Ai,bo=-1){return Ai.empty?this:EditorSelection.create(this.ranges.map(Ra=>Ra.map(Ai,bo)),this.mainIndex)}eq(Ai,bo=!1){if(this.ranges.length!=Ai.ranges.length||this.mainIndex!=Ai.mainIndex)return!1;for(let Ra=0;Ra<this.ranges.length;Ra++)if(!this.ranges[Ra].eq(Ai.ranges[Ra],bo))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new EditorSelection([this.main],0)}addRange(Ai,bo=!0){return EditorSelection.create([Ai].concat(this.ranges),bo?0:this.mainIndex+1)}replaceRange(Ai,bo=this.mainIndex){let Ra=this.ranges.slice();return Ra[bo]=Ai,EditorSelection.create(Ra,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(Ai=>Ai.toJSON()),main:this.mainIndex}}static fromJSON(Ai){if(!Ai||!Array.isArray(Ai.ranges)||typeof Ai.main!="number"||Ai.main>=Ai.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new EditorSelection(Ai.ranges.map(bo=>SelectionRange$1.fromJSON(bo)),Ai.main)}static single(Ai,bo=Ai){return new EditorSelection([EditorSelection.range(Ai,bo)],0)}static create(Ai,bo=0){if(Ai.length==0)throw new RangeError("A selection needs at least one range");for(let Ra=0,pc=0;pc<Ai.length;pc++){let mc=Ai[pc];if(mc.empty?mc.from<=Ra:mc.from<Ra)return EditorSelection.normalized(Ai.slice(),bo);Ra=mc.to}return new EditorSelection(Ai,bo)}static cursor(Ai,bo=0,Ra,pc){return SelectionRange$1.create(Ai,Ai,(bo==0?0:bo<0?8:16)|(Ra==null?7:Math.min(6,Ra))|(pc??16777215)<<6)}static range(Ai,bo,Ra,pc){let mc=(Ra??16777215)<<6|(pc==null?7:Math.min(6,pc));return bo<Ai?SelectionRange$1.create(bo,Ai,48|mc):SelectionRange$1.create(Ai,bo,(bo>Ai?8:0)|mc)}static normalized(Ai,bo=0){let Ra=Ai[bo];Ai.sort((pc,mc)=>pc.from-mc.from),bo=Ai.indexOf(Ra);for(let pc=1;pc<Ai.length;pc++){let mc=Ai[pc],uf=Ai[pc-1];if(mc.empty?mc.from<=uf.to:mc.from<uf.to){let df=uf.from,ff=Math.max(mc.to,uf.to);pc<=bo&&bo--,Ai.splice(--pc,2,mc.anchor>mc.head?EditorSelection.range(ff,df):EditorSelection.range(df,ff))}}return new EditorSelection(Ai,bo)}}function checkSelection(vo,Ai){for(let bo of vo.ranges)if(bo.to>Ai)throw new RangeError("Selection points outside of document")}let nextID=0;class Facet{constructor(Ai,bo,Ra,pc,mc){this.combine=Ai,this.compareInput=bo,this.compare=Ra,this.isStatic=pc,this.id=nextID++,this.default=Ai([]),this.extensions=typeof mc=="function"?mc(this):mc}get reader(){return this}static define(Ai={}){return new Facet(Ai.combine||(bo=>bo),Ai.compareInput||((bo,Ra)=>bo===Ra),Ai.compare||(Ai.combine?(bo,Ra)=>bo===Ra:sameArray$1),!!Ai.static,Ai.enables)}of(Ai){return new FacetProvider([],this,0,Ai)}compute(Ai,bo){if(this.isStatic)throw new Error("Can't compute a static facet");return new FacetProvider(Ai,this,1,bo)}computeN(Ai,bo){if(this.isStatic)throw new Error("Can't compute a static facet");return new FacetProvider(Ai,this,2,bo)}from(Ai,bo){return bo||(bo=Ra=>Ra),this.compute([Ai],Ra=>bo(Ra.field(Ai)))}}function sameArray$1(vo,Ai){return vo==Ai||vo.length==Ai.length&&vo.every((bo,Ra)=>bo===Ai[Ra])}class FacetProvider{constructor(Ai,bo,Ra,pc){this.dependencies=Ai,this.facet=bo,this.type=Ra,this.value=pc,this.id=nextID++}dynamicSlot(Ai){var bo;let Ra=this.value,pc=this.facet.compareInput,mc=this.id,uf=Ai[mc]>>1,df=this.type==2,ff=!1,hf=!1,pf=[];for(let mf of this.dependencies)mf=="doc"?ff=!0:mf=="selection"?hf=!0:((bo=Ai[mf.id])!==null&&bo!==void 0?bo:1)&1||pf.push(Ai[mf.id]);return{create(mf){return mf.values[uf]=Ra(mf),1},update(mf,gf){if(ff&&gf.docChanged||hf&&(gf.docChanged||gf.selection)||ensureAll(mf,pf)){let yf=Ra(mf);if(df?!compareArray(yf,mf.values[uf],pc):!pc(yf,mf.values[uf]))return mf.values[uf]=yf,1}return 0},reconfigure:(mf,gf)=>{let yf,vf=gf.config.address[mc];if(vf!=null){let bf=getAddr(gf,vf);if(this.dependencies.every(Sf=>Sf instanceof Facet?gf.facet(Sf)===mf.facet(Sf):Sf instanceof StateField?gf.field(Sf,!1)==mf.field(Sf,!1):!0)||(df?compareArray(yf=Ra(mf),bf,pc):pc(yf=Ra(mf),bf)))return mf.values[uf]=bf,0}else yf=Ra(mf);return mf.values[uf]=yf,1}}}}function compareArray(vo,Ai,bo){if(vo.length!=Ai.length)return!1;for(let Ra=0;Ra<vo.length;Ra++)if(!bo(vo[Ra],Ai[Ra]))return!1;return!0}function ensureAll(vo,Ai){let bo=!1;for(let Ra of Ai)ensureAddr(vo,Ra)&1&&(bo=!0);return bo}function dynamicFacetSlot(vo,Ai,bo){let Ra=bo.map(ff=>vo[ff.id]),pc=bo.map(ff=>ff.type),mc=Ra.filter(ff=>!(ff&1)),uf=vo[Ai.id]>>1;function df(ff){let hf=[];for(let pf=0;pf<Ra.length;pf++){let mf=getAddr(ff,Ra[pf]);if(pc[pf]==2)for(let gf of mf)hf.push(gf);else hf.push(mf)}return Ai.combine(hf)}return{create(ff){for(let hf of Ra)ensureAddr(ff,hf);return ff.values[uf]=df(ff),1},update(ff,hf){if(!ensureAll(ff,mc))return 0;let pf=df(ff);return Ai.compare(pf,ff.values[uf])?0:(ff.values[uf]=pf,1)},reconfigure(ff,hf){let pf=ensureAll(ff,Ra),mf=hf.config.facets[Ai.id],gf=hf.facet(Ai);if(mf&&!pf&&sameArray$1(bo,mf))return ff.values[uf]=gf,0;let yf=df(ff);return Ai.compare(yf,gf)?(ff.values[uf]=gf,0):(ff.values[uf]=yf,1)}}}const initField=Facet.define({static:!0});class StateField{constructor(Ai,bo,Ra,pc,mc){this.id=Ai,this.createF=bo,this.updateF=Ra,this.compareF=pc,this.spec=mc,this.provides=void 0}static define(Ai){let bo=new StateField(nextID++,Ai.create,Ai.update,Ai.compare||((Ra,pc)=>Ra===pc),Ai);return Ai.provide&&(bo.provides=Ai.provide(bo)),bo}create(Ai){let bo=Ai.facet(initField).find(Ra=>Ra.field==this);return((bo==null?void 0:bo.create)||this.createF)(Ai)}slot(Ai){let bo=Ai[this.id]>>1;return{create:Ra=>(Ra.values[bo]=this.create(Ra),1),update:(Ra,pc)=>{let mc=Ra.values[bo],uf=this.updateF(mc,pc);return this.compareF(mc,uf)?0:(Ra.values[bo]=uf,1)},reconfigure:(Ra,pc)=>pc.config.address[this.id]!=null?(Ra.values[bo]=pc.field(this),0):(Ra.values[bo]=this.create(Ra),1)}}init(Ai){return[this,initField.of({field:this,create:Ai})]}get extension(){return this}}const Prec_={lowest:4,low:3,default:2,high:1,highest:0};function prec(vo){return Ai=>new PrecExtension(Ai,vo)}const Prec={highest:prec(Prec_.highest),high:prec(Prec_.high),default:prec(Prec_.default),low:prec(Prec_.low),lowest:prec(Prec_.lowest)};class PrecExtension{constructor(Ai,bo){this.inner=Ai,this.prec=bo}}class Compartment{of(Ai){return new CompartmentInstance(this,Ai)}reconfigure(Ai){return Compartment.reconfigure.of({compartment:this,extension:Ai})}get(Ai){return Ai.config.compartments.get(this)}}class CompartmentInstance{constructor(Ai,bo){this.compartment=Ai,this.inner=bo}}class Configuration{constructor(Ai,bo,Ra,pc,mc,uf){for(this.base=Ai,this.compartments=bo,this.dynamicSlots=Ra,this.address=pc,this.staticValues=mc,this.facets=uf,this.statusTemplate=[];this.statusTemplate.length<Ra.length;)this.statusTemplate.push(0)}staticFacet(Ai){let bo=this.address[Ai.id];return bo==null?Ai.default:this.staticValues[bo>>1]}static resolve(Ai,bo,Ra){let pc=[],mc=Object.create(null),uf=new Map;for(let gf of flatten(Ai,bo,uf))gf instanceof StateField?pc.push(gf):(mc[gf.facet.id]||(mc[gf.facet.id]=[])).push(gf);let df=Object.create(null),ff=[],hf=[];for(let gf of pc)df[gf.id]=hf.length<<1,hf.push(yf=>gf.slot(yf));let pf=Ra==null?void 0:Ra.config.facets;for(let gf in mc){let yf=mc[gf],vf=yf[0].facet,bf=pf&&pf[gf]||[];if(yf.every(Sf=>Sf.type==0))if(df[vf.id]=ff.length<<1|1,sameArray$1(bf,yf))ff.push(Ra.facet(vf));else{let Sf=vf.combine(yf.map(xf=>xf.value));ff.push(Ra&&vf.compare(Sf,Ra.facet(vf))?Ra.facet(vf):Sf)}else{for(let Sf of yf)Sf.type==0?(df[Sf.id]=ff.length<<1|1,ff.push(Sf.value)):(df[Sf.id]=hf.length<<1,hf.push(xf=>Sf.dynamicSlot(xf)));df[vf.id]=hf.length<<1,hf.push(Sf=>dynamicFacetSlot(Sf,vf,yf))}}let mf=hf.map(gf=>gf(df));return new Configuration(Ai,uf,mf,df,ff,mc)}}function flatten(vo,Ai,bo){let Ra=[[],[],[],[],[]],pc=new Map;function mc(uf,df){let ff=pc.get(uf);if(ff!=null){if(ff<=df)return;let hf=Ra[ff].indexOf(uf);hf>-1&&Ra[ff].splice(hf,1),uf instanceof CompartmentInstance&&bo.delete(uf.compartment)}if(pc.set(uf,df),Array.isArray(uf))for(let hf of uf)mc(hf,df);else if(uf instanceof CompartmentInstance){if(bo.has(uf.compartment))throw new RangeError("Duplicate use of compartment in extensions");let hf=Ai.get(uf.compartment)||uf.inner;bo.set(uf.compartment,hf),mc(hf,df)}else if(uf instanceof PrecExtension)mc(uf.inner,uf.prec);else if(uf instanceof StateField)Ra[df].push(uf),uf.provides&&mc(uf.provides,df);else if(uf instanceof FacetProvider)Ra[df].push(uf),uf.facet.extensions&&mc(uf.facet.extensions,Prec_.default);else{let hf=uf.extension;if(!hf)throw new Error(`Unrecognized extension value in extension set (${uf}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);mc(hf,df)}}return mc(vo,Prec_.default),Ra.reduce((uf,df)=>uf.concat(df))}function ensureAddr(vo,Ai){if(Ai&1)return 2;let bo=Ai>>1,Ra=vo.status[bo];if(Ra==4)throw new Error("Cyclic dependency between fields and/or facets");if(Ra&2)return Ra;vo.status[bo]=4;let pc=vo.computeSlot(vo,vo.config.dynamicSlots[bo]);return vo.status[bo]=2|pc}function getAddr(vo,Ai){return Ai&1?vo.config.staticValues[Ai>>1]:vo.values[Ai>>1]}const languageData=Facet.define(),allowMultipleSelections=Facet.define({combine:vo=>vo.some(Ai=>Ai),static:!0}),lineSeparator=Facet.define({combine:vo=>vo.length?vo[0]:void 0,static:!0}),changeFilter=Facet.define(),transactionFilter=Facet.define(),transactionExtender=Facet.define(),readOnly=Facet.define({combine:vo=>vo.length?vo[0]:!1});class Annotation{constructor(Ai,bo){this.type=Ai,this.value=bo}static define(){return new AnnotationType}}class AnnotationType{of(Ai){return new Annotation(this,Ai)}}class StateEffectType{constructor(Ai){this.map=Ai}of(Ai){return new StateEffect(this,Ai)}}class StateEffect{constructor(Ai,bo){this.type=Ai,this.value=bo}map(Ai){let bo=this.type.map(this.value,Ai);return bo===void 0?void 0:bo==this.value?this:new StateEffect(this.type,bo)}is(Ai){return this.type==Ai}static define(Ai={}){return new StateEffectType(Ai.map||(bo=>bo))}static mapEffects(Ai,bo){if(!Ai.length)return Ai;let Ra=[];for(let pc of Ai){let mc=pc.map(bo);mc&&Ra.push(mc)}return Ra}}StateEffect.reconfigure=StateEffect.define();StateEffect.appendConfig=StateEffect.define();class Transaction{constructor(Ai,bo,Ra,pc,mc,uf){this.startState=Ai,this.changes=bo,this.selection=Ra,this.effects=pc,this.annotations=mc,this.scrollIntoView=uf,this._doc=null,this._state=null,Ra&&checkSelection(Ra,bo.newLength),mc.some(df=>df.type==Transaction.time)||(this.annotations=mc.concat(Transaction.time.of(Date.now())))}static create(Ai,bo,Ra,pc,mc,uf){return new Transaction(Ai,bo,Ra,pc,mc,uf)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(Ai){for(let bo of this.annotations)if(bo.type==Ai)return bo.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(Ai){let bo=this.annotation(Transaction.userEvent);return!!(bo&&(bo==Ai||bo.length>Ai.length&&bo.slice(0,Ai.length)==Ai&&bo[Ai.length]=="."))}}Transaction.time=Annotation.define();Transaction.userEvent=Annotation.define();Transaction.addToHistory=Annotation.define();Transaction.remote=Annotation.define();function joinRanges(vo,Ai){let bo=[];for(let Ra=0,pc=0;;){let mc,uf;if(Ra<vo.length&&(pc==Ai.length||Ai[pc]>=vo[Ra]))mc=vo[Ra++],uf=vo[Ra++];else if(pc<Ai.length)mc=Ai[pc++],uf=Ai[pc++];else return bo;!bo.length||bo[bo.length-1]<mc?bo.push(mc,uf):bo[bo.length-1]<uf&&(bo[bo.length-1]=uf)}}function mergeTransaction(vo,Ai,bo){var Ra;let pc,mc,uf;return bo?(pc=Ai.changes,mc=ChangeSet.empty(Ai.changes.length),uf=vo.changes.compose(Ai.changes)):(pc=Ai.changes.map(vo.changes),mc=vo.changes.mapDesc(Ai.changes,!0),uf=vo.changes.compose(pc)),{changes:uf,selection:Ai.selection?Ai.selection.map(mc):(Ra=vo.selection)===null||Ra===void 0?void 0:Ra.map(pc),effects:StateEffect.mapEffects(vo.effects,pc).concat(StateEffect.mapEffects(Ai.effects,mc)),annotations:vo.annotations.length?vo.annotations.concat(Ai.annotations):Ai.annotations,scrollIntoView:vo.scrollIntoView||Ai.scrollIntoView}}function resolveTransactionInner(vo,Ai,bo){let Ra=Ai.selection,pc=asArray$2(Ai.annotations);return Ai.userEvent&&(pc=pc.concat(Transaction.userEvent.of(Ai.userEvent))),{changes:Ai.changes instanceof ChangeSet?Ai.changes:ChangeSet.of(Ai.changes||[],bo,vo.facet(lineSeparator)),selection:Ra&&(Ra instanceof EditorSelection?Ra:EditorSelection.single(Ra.anchor,Ra.head)),effects:asArray$2(Ai.effects),annotations:pc,scrollIntoView:!!Ai.scrollIntoView}}function resolveTransaction(vo,Ai,bo){let Ra=resolveTransactionInner(vo,Ai.length?Ai[0]:{},vo.doc.length);Ai.length&&Ai[0].filter===!1&&(bo=!1);for(let mc=1;mc<Ai.length;mc++){Ai[mc].filter===!1&&(bo=!1);let uf=!!Ai[mc].sequential;Ra=mergeTransaction(Ra,resolveTransactionInner(vo,Ai[mc],uf?Ra.changes.newLength:vo.doc.length),uf)}let pc=Transaction.create(vo,Ra.changes,Ra.selection,Ra.effects,Ra.annotations,Ra.scrollIntoView);return extendTransaction(bo?filterTransaction(pc):pc)}function filterTransaction(vo){let Ai=vo.startState,bo=!0;for(let pc of Ai.facet(changeFilter)){let mc=pc(vo);if(mc===!1){bo=!1;break}Array.isArray(mc)&&(bo=bo===!0?mc:joinRanges(bo,mc))}if(bo!==!0){let pc,mc;if(bo===!1)mc=vo.changes.invertedDesc,pc=ChangeSet.empty(Ai.doc.length);else{let uf=vo.changes.filter(bo);pc=uf.changes,mc=uf.filtered.mapDesc(uf.changes).invertedDesc}vo=Transaction.create(Ai,pc,vo.selection&&vo.selection.map(mc),StateEffect.mapEffects(vo.effects,mc),vo.annotations,vo.scrollIntoView)}let Ra=Ai.facet(transactionFilter);for(let pc=Ra.length-1;pc>=0;pc--){let mc=Ra[pc](vo);mc instanceof Transaction?vo=mc:Array.isArray(mc)&&mc.length==1&&mc[0]instanceof Transaction?vo=mc[0]:vo=resolveTransaction(Ai,asArray$2(mc),!1)}return vo}function extendTransaction(vo){let Ai=vo.startState,bo=Ai.facet(transactionExtender),Ra=vo;for(let pc=bo.length-1;pc>=0;pc--){let mc=bo[pc](vo);mc&&Object.keys(mc).length&&(Ra=mergeTransaction(Ra,resolveTransactionInner(Ai,mc,vo.changes.newLength),!0))}return Ra==vo?vo:Transaction.create(Ai,vo.changes,vo.selection,Ra.effects,Ra.annotations,Ra.scrollIntoView)}const none$2=[];function asArray$2(vo){return vo==null?none$2:Array.isArray(vo)?vo:[vo]}var CharCategory=function(vo){return vo[vo.Word=0]="Word",vo[vo.Space=1]="Space",vo[vo.Other=2]="Other",vo}(CharCategory||(CharCategory={}));const nonASCIISingleCaseWordChar=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let wordChar;try{wordChar=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(vo){}function hasWordChar(vo){if(wordChar)return wordChar.test(vo);for(let Ai=0;Ai<vo.length;Ai++){let bo=vo[Ai];if(/\w/.test(bo)||bo>""&&(bo.toUpperCase()!=bo.toLowerCase()||nonASCIISingleCaseWordChar.test(bo)))return!0}return!1}function makeCategorizer(vo){return Ai=>{if(!/\S/.test(Ai))return CharCategory.Space;if(hasWordChar(Ai))return CharCategory.Word;for(let bo=0;bo<vo.length;bo++)if(Ai.indexOf(vo[bo])>-1)return CharCategory.Word;return CharCategory.Other}}class EditorState{constructor(Ai,bo,Ra,pc,mc,uf){this.config=Ai,this.doc=bo,this.selection=Ra,this.values=pc,this.status=Ai.statusTemplate.slice(),this.computeSlot=mc,uf&&(uf._state=this);for(let df=0;df<this.config.dynamicSlots.length;df++)ensureAddr(this,df<<1);this.computeSlot=null}field(Ai,bo=!0){let Ra=this.config.address[Ai.id];if(Ra==null){if(bo)throw new RangeError("Field is not present in this state");return}return ensureAddr(this,Ra),getAddr(this,Ra)}update(...Ai){return resolveTransaction(this,Ai,!0)}applyTransaction(Ai){let bo=this.config,{base:Ra,compartments:pc}=bo;for(let df of Ai.effects)df.is(Compartment.reconfigure)?(bo&&(pc=new Map,bo.compartments.forEach((ff,hf)=>pc.set(hf,ff)),bo=null),pc.set(df.value.compartment,df.value.extension)):df.is(StateEffect.reconfigure)?(bo=null,Ra=df.value):df.is(StateEffect.appendConfig)&&(bo=null,Ra=asArray$2(Ra).concat(df.value));let mc;bo?mc=Ai.startState.values.slice():(bo=Configuration.resolve(Ra,pc,this),mc=new EditorState(bo,this.doc,this.selection,bo.dynamicSlots.map(()=>null),(df,ff)=>ff.reconfigure(df,this),null).values);let uf=Ai.startState.facet(allowMultipleSelections)?Ai.newSelection:Ai.newSelection.asSingle();new EditorState(bo,Ai.newDoc,uf,mc,(df,ff)=>ff.update(df,Ai),Ai)}replaceSelection(Ai){return typeof Ai=="string"&&(Ai=this.toText(Ai)),this.changeByRange(bo=>({changes:{from:bo.from,to:bo.to,insert:Ai},range:EditorSelection.cursor(bo.from+Ai.length)}))}changeByRange(Ai){let bo=this.selection,Ra=Ai(bo.ranges[0]),pc=this.changes(Ra.changes),mc=[Ra.range],uf=asArray$2(Ra.effects);for(let df=1;df<bo.ranges.length;df++){let ff=Ai(bo.ranges[df]),hf=this.changes(ff.changes),pf=hf.map(pc);for(let gf=0;gf<df;gf++)mc[gf]=mc[gf].map(pf);let mf=pc.mapDesc(hf,!0);mc.push(ff.range.map(mf)),pc=pc.compose(pf),uf=StateEffect.mapEffects(uf,pf).concat(StateEffect.mapEffects(asArray$2(ff.effects),mf))}return{changes:pc,selection:EditorSelection.create(mc,bo.mainIndex),effects:uf}}changes(Ai=[]){return Ai instanceof ChangeSet?Ai:ChangeSet.of(Ai,this.doc.length,this.facet(EditorState.lineSeparator))}toText(Ai){return Text.of(Ai.split(this.facet(EditorState.lineSeparator)||DefaultSplit))}sliceDoc(Ai=0,bo=this.doc.length){return this.doc.sliceString(Ai,bo,this.lineBreak)}facet(Ai){let bo=this.config.address[Ai.id];return bo==null?Ai.default:(ensureAddr(this,bo),getAddr(this,bo))}toJSON(Ai){let bo={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(Ai)for(let Ra in Ai){let pc=Ai[Ra];pc instanceof StateField&&this.config.address[pc.id]!=null&&(bo[Ra]=pc.spec.toJSON(this.field(Ai[Ra]),this))}return bo}static fromJSON(Ai,bo={},Ra){if(!Ai||typeof Ai.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let pc=[];if(Ra){for(let mc in Ra)if(Object.prototype.hasOwnProperty.call(Ai,mc)){let uf=Ra[mc],df=Ai[mc];pc.push(uf.init(ff=>uf.spec.fromJSON(df,ff)))}}return EditorState.create({doc:Ai.doc,selection:EditorSelection.fromJSON(Ai.selection),extensions:bo.extensions?pc.concat([bo.extensions]):pc})}static create(Ai={}){let bo=Configuration.resolve(Ai.extensions||[],new Map),Ra=Ai.doc instanceof Text?Ai.doc:Text.of((Ai.doc||"").split(bo.staticFacet(EditorState.lineSeparator)||DefaultSplit)),pc=Ai.selection?Ai.selection instanceof EditorSelection?Ai.selection:EditorSelection.single(Ai.selection.anchor,Ai.selection.head):EditorSelection.single(0);return checkSelection(pc,Ra.length),bo.staticFacet(allowMultipleSelections)||(pc=pc.asSingle()),new EditorState(bo,Ra,pc,bo.dynamicSlots.map(()=>null),(mc,uf)=>uf.create(mc),null)}get tabSize(){return this.facet(EditorState.tabSize)}get lineBreak(){return this.facet(EditorState.lineSeparator)||`
|
|
350
|
-
`}get readOnly(){return this.facet(readOnly)}phrase(Ai,...bo){for(let Ra of this.facet(EditorState.phrases))if(Object.prototype.hasOwnProperty.call(Ra,Ai)){Ai=Ra[Ai];break}return bo.length&&(Ai=Ai.replace(/\$(\$|\d*)/g,(Ra,pc)=>{if(pc=="$")return"$";let mc=+(pc||1);return!mc||mc>bo.length?Ra:bo[mc-1]})),Ai}languageDataAt(Ai,bo,Ra=-1){let pc=[];for(let mc of this.facet(languageData))for(let uf of mc(this,bo,Ra))Object.prototype.hasOwnProperty.call(uf,Ai)&&pc.push(uf[Ai]);return pc}charCategorizer(Ai){return makeCategorizer(this.languageDataAt("wordChars",Ai).join(""))}wordAt(Ai){let{text:bo,from:Ra,length:pc}=this.doc.lineAt(Ai),mc=this.charCategorizer(Ai),uf=Ai-Ra,df=Ai-Ra;for(;uf>0;){let ff=findClusterBreak(bo,uf,!1);if(mc(bo.slice(ff,uf))!=CharCategory.Word)break;uf=ff}for(;df<pc;){let ff=findClusterBreak(bo,df);if(mc(bo.slice(df,ff))!=CharCategory.Word)break;df=ff}return uf==df?null:EditorSelection.range(uf+Ra,df+Ra)}}EditorState.allowMultipleSelections=allowMultipleSelections;EditorState.tabSize=Facet.define({combine:vo=>vo.length?vo[0]:4});EditorState.lineSeparator=lineSeparator;EditorState.readOnly=readOnly;EditorState.phrases=Facet.define({compare(vo,Ai){let bo=Object.keys(vo),Ra=Object.keys(Ai);return bo.length==Ra.length&&bo.every(pc=>vo[pc]==Ai[pc])}});EditorState.languageData=languageData;EditorState.changeFilter=changeFilter;EditorState.transactionFilter=transactionFilter;EditorState.transactionExtender=transactionExtender;Compartment.reconfigure=StateEffect.define();function combineConfig(vo,Ai,bo={}){let Ra={};for(let pc of vo)for(let mc of Object.keys(pc)){let uf=pc[mc],df=Ra[mc];if(df===void 0)Ra[mc]=uf;else if(!(df===uf||uf===void 0))if(Object.hasOwnProperty.call(bo,mc))Ra[mc]=bo[mc](df,uf);else throw new Error("Config merge conflict for field "+mc)}for(let pc in Ai)Ra[pc]===void 0&&(Ra[pc]=Ai[pc]);return Ra}class RangeValue{eq(Ai){return this==Ai}range(Ai,bo=Ai){return Range$3.create(Ai,bo,this)}}RangeValue.prototype.startSide=RangeValue.prototype.endSide=0;RangeValue.prototype.point=!1;RangeValue.prototype.mapMode=MapMode.TrackDel;let Range$3=class kT{constructor(Ai,bo,Ra){this.from=Ai,this.to=bo,this.value=Ra}static create(Ai,bo,Ra){return new kT(Ai,bo,Ra)}};function cmpRange(vo,Ai){return vo.from-Ai.from||vo.value.startSide-Ai.value.startSide}class Chunk{constructor(Ai,bo,Ra,pc){this.from=Ai,this.to=bo,this.value=Ra,this.maxPoint=pc}get length(){return this.to[this.to.length-1]}findIndex(Ai,bo,Ra,pc=0){let mc=Ra?this.to:this.from;for(let uf=pc,df=mc.length;;){if(uf==df)return uf;let ff=uf+df>>1,hf=mc[ff]-Ai||(Ra?this.value[ff].endSide:this.value[ff].startSide)-bo;if(ff==uf)return hf>=0?uf:df;hf>=0?df=ff:uf=ff+1}}between(Ai,bo,Ra,pc){for(let mc=this.findIndex(bo,-1e9,!0),uf=this.findIndex(Ra,1e9,!1,mc);mc<uf;mc++)if(pc(this.from[mc]+Ai,this.to[mc]+Ai,this.value[mc])===!1)return!1}map(Ai,bo){let Ra=[],pc=[],mc=[],uf=-1,df=-1;for(let ff=0;ff<this.value.length;ff++){let hf=this.value[ff],pf=this.from[ff]+Ai,mf=this.to[ff]+Ai,gf,yf;if(pf==mf){let vf=bo.mapPos(pf,hf.startSide,hf.mapMode);if(vf==null||(gf=yf=vf,hf.startSide!=hf.endSide&&(yf=bo.mapPos(pf,hf.endSide),yf<gf)))continue}else if(gf=bo.mapPos(pf,hf.startSide),yf=bo.mapPos(mf,hf.endSide),gf>yf||gf==yf&&hf.startSide>0&&hf.endSide<=0)continue;(yf-gf||hf.endSide-hf.startSide)<0||(uf<0&&(uf=gf),hf.point&&(df=Math.max(df,yf-gf)),Ra.push(hf),pc.push(gf-uf),mc.push(yf-uf))}return{mapped:Ra.length?new Chunk(pc,mc,Ra,df):null,pos:uf}}}class RangeSet{constructor(Ai,bo,Ra,pc){this.chunkPos=Ai,this.chunk=bo,this.nextLayer=Ra,this.maxPoint=pc}static create(Ai,bo,Ra,pc){return new RangeSet(Ai,bo,Ra,pc)}get length(){let Ai=this.chunk.length-1;return Ai<0?0:Math.max(this.chunkEnd(Ai),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let Ai=this.nextLayer.size;for(let bo of this.chunk)Ai+=bo.value.length;return Ai}chunkEnd(Ai){return this.chunkPos[Ai]+this.chunk[Ai].length}update(Ai){let{add:bo=[],sort:Ra=!1,filterFrom:pc=0,filterTo:mc=this.length}=Ai,uf=Ai.filter;if(bo.length==0&&!uf)return this;if(Ra&&(bo=bo.slice().sort(cmpRange)),this.isEmpty)return bo.length?RangeSet.of(bo):this;let df=new LayerCursor(this,null,-1).goto(0),ff=0,hf=[],pf=new RangeSetBuilder;for(;df.value||ff<bo.length;)if(ff<bo.length&&(df.from-bo[ff].from||df.startSide-bo[ff].value.startSide)>=0){let mf=bo[ff++];pf.addInner(mf.from,mf.to,mf.value)||hf.push(mf)}else df.rangeIndex==1&&df.chunkIndex<this.chunk.length&&(ff==bo.length||this.chunkEnd(df.chunkIndex)<bo[ff].from)&&(!uf||pc>this.chunkEnd(df.chunkIndex)||mc<this.chunkPos[df.chunkIndex])&&pf.addChunk(this.chunkPos[df.chunkIndex],this.chunk[df.chunkIndex])?df.nextChunk():((!uf||pc>df.to||mc<df.from||uf(df.from,df.to,df.value))&&(pf.addInner(df.from,df.to,df.value)||hf.push(Range$3.create(df.from,df.to,df.value))),df.next());return pf.finishInner(this.nextLayer.isEmpty&&!hf.length?RangeSet.empty:this.nextLayer.update({add:hf,filter:uf,filterFrom:pc,filterTo:mc}))}map(Ai){if(Ai.empty||this.isEmpty)return this;let bo=[],Ra=[],pc=-1;for(let uf=0;uf<this.chunk.length;uf++){let df=this.chunkPos[uf],ff=this.chunk[uf],hf=Ai.touchesRange(df,df+ff.length);if(hf===!1)pc=Math.max(pc,ff.maxPoint),bo.push(ff),Ra.push(Ai.mapPos(df));else if(hf===!0){let{mapped:pf,pos:mf}=ff.map(df,Ai);pf&&(pc=Math.max(pc,pf.maxPoint),bo.push(pf),Ra.push(mf))}}let mc=this.nextLayer.map(Ai);return bo.length==0?mc:new RangeSet(Ra,bo,mc||RangeSet.empty,pc)}between(Ai,bo,Ra){if(!this.isEmpty){for(let pc=0;pc<this.chunk.length;pc++){let mc=this.chunkPos[pc],uf=this.chunk[pc];if(bo>=mc&&Ai<=mc+uf.length&&uf.between(mc,Ai-mc,bo-mc,Ra)===!1)return}this.nextLayer.between(Ai,bo,Ra)}}iter(Ai=0){return HeapCursor.from([this]).goto(Ai)}get isEmpty(){return this.nextLayer==this}static iter(Ai,bo=0){return HeapCursor.from(Ai).goto(bo)}static compare(Ai,bo,Ra,pc,mc=-1){let uf=Ai.filter(mf=>mf.maxPoint>0||!mf.isEmpty&&mf.maxPoint>=mc),df=bo.filter(mf=>mf.maxPoint>0||!mf.isEmpty&&mf.maxPoint>=mc),ff=findSharedChunks(uf,df,Ra),hf=new SpanCursor(uf,ff,mc),pf=new SpanCursor(df,ff,mc);Ra.iterGaps((mf,gf,yf)=>compare(hf,mf,pf,gf,yf,pc)),Ra.empty&&Ra.length==0&&compare(hf,0,pf,0,0,pc)}static eq(Ai,bo,Ra=0,pc){pc==null&&(pc=999999999);let mc=Ai.filter(pf=>!pf.isEmpty&&bo.indexOf(pf)<0),uf=bo.filter(pf=>!pf.isEmpty&&Ai.indexOf(pf)<0);if(mc.length!=uf.length)return!1;if(!mc.length)return!0;let df=findSharedChunks(mc,uf),ff=new SpanCursor(mc,df,0).goto(Ra),hf=new SpanCursor(uf,df,0).goto(Ra);for(;;){if(ff.to!=hf.to||!sameValues(ff.active,hf.active)||ff.point&&(!hf.point||!ff.point.eq(hf.point)))return!1;if(ff.to>pc)return!0;ff.next(),hf.next()}}static spans(Ai,bo,Ra,pc,mc=-1){let uf=new SpanCursor(Ai,null,mc).goto(bo),df=bo,ff=uf.openStart;for(;;){let hf=Math.min(uf.to,Ra);if(uf.point){let pf=uf.activeForPoint(uf.to),mf=uf.pointFrom<bo?pf.length+1:uf.point.startSide<0?pf.length:Math.min(pf.length,ff);pc.point(df,hf,uf.point,pf,mf,uf.pointRank),ff=Math.min(uf.openEnd(hf),pf.length)}else hf>df&&(pc.span(df,hf,uf.active,ff),ff=uf.openEnd(hf));if(uf.to>Ra)return ff+(uf.point&&uf.to>Ra?1:0);df=uf.to,uf.next()}}static of(Ai,bo=!1){let Ra=new RangeSetBuilder;for(let pc of Ai instanceof Range$3?[Ai]:bo?lazySort(Ai):Ai)Ra.add(pc.from,pc.to,pc.value);return Ra.finish()}static join(Ai){if(!Ai.length)return RangeSet.empty;let bo=Ai[Ai.length-1];for(let Ra=Ai.length-2;Ra>=0;Ra--)for(let pc=Ai[Ra];pc!=RangeSet.empty;pc=pc.nextLayer)bo=new RangeSet(pc.chunkPos,pc.chunk,bo,Math.max(pc.maxPoint,bo.maxPoint));return bo}}RangeSet.empty=new RangeSet([],[],null,-1);function lazySort(vo){if(vo.length>1)for(let Ai=vo[0],bo=1;bo<vo.length;bo++){let Ra=vo[bo];if(cmpRange(Ai,Ra)>0)return vo.slice().sort(cmpRange);Ai=Ra}return vo}RangeSet.empty.nextLayer=RangeSet.empty;class RangeSetBuilder{finishChunk(Ai){this.chunks.push(new Chunk(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,Ai&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(Ai,bo,Ra){this.addInner(Ai,bo,Ra)||(this.nextLayer||(this.nextLayer=new RangeSetBuilder)).add(Ai,bo,Ra)}addInner(Ai,bo,Ra){let pc=Ai-this.lastTo||Ra.startSide-this.last.endSide;if(pc<=0&&(Ai-this.lastFrom||Ra.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return pc<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=Ai),this.from.push(Ai-this.chunkStart),this.to.push(bo-this.chunkStart),this.last=Ra,this.lastFrom=Ai,this.lastTo=bo,this.value.push(Ra),Ra.point&&(this.maxPoint=Math.max(this.maxPoint,bo-Ai)),!0)}addChunk(Ai,bo){if((Ai-this.lastTo||bo.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,bo.maxPoint),this.chunks.push(bo),this.chunkPos.push(Ai);let Ra=bo.value.length-1;return this.last=bo.value[Ra],this.lastFrom=bo.from[Ra]+Ai,this.lastTo=bo.to[Ra]+Ai,!0}finish(){return this.finishInner(RangeSet.empty)}finishInner(Ai){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return Ai;let bo=RangeSet.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(Ai):Ai,this.setMaxPoint);return this.from=null,bo}}function findSharedChunks(vo,Ai,bo){let Ra=new Map;for(let mc of vo)for(let uf=0;uf<mc.chunk.length;uf++)mc.chunk[uf].maxPoint<=0&&Ra.set(mc.chunk[uf],mc.chunkPos[uf]);let pc=new Set;for(let mc of Ai)for(let uf=0;uf<mc.chunk.length;uf++){let df=Ra.get(mc.chunk[uf]);df!=null&&(bo?bo.mapPos(df):df)==mc.chunkPos[uf]&&!(bo!=null&&bo.touchesRange(df,df+mc.chunk[uf].length))&&pc.add(mc.chunk[uf])}return pc}class LayerCursor{constructor(Ai,bo,Ra,pc=0){this.layer=Ai,this.skip=bo,this.minPoint=Ra,this.rank=pc}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(Ai,bo=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(Ai,bo,!1),this}gotoInner(Ai,bo,Ra){for(;this.chunkIndex<this.layer.chunk.length;){let pc=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(pc)||this.layer.chunkEnd(this.chunkIndex)<Ai||pc.maxPoint<this.minPoint))break;this.chunkIndex++,Ra=!1}if(this.chunkIndex<this.layer.chunk.length){let pc=this.layer.chunk[this.chunkIndex].findIndex(Ai-this.layer.chunkPos[this.chunkIndex],bo,!0);(!Ra||this.rangeIndex<pc)&&this.setRangeIndex(pc)}this.next()}forward(Ai,bo){(this.to-Ai||this.endSide-bo)<0&&this.gotoInner(Ai,bo,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let Ai=this.layer.chunkPos[this.chunkIndex],bo=this.layer.chunk[this.chunkIndex],Ra=Ai+bo.from[this.rangeIndex];if(this.from=Ra,this.to=Ai+bo.to[this.rangeIndex],this.value=bo.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(Ai){if(Ai==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=Ai}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(Ai){return this.from-Ai.from||this.startSide-Ai.startSide||this.rank-Ai.rank||this.to-Ai.to||this.endSide-Ai.endSide}}class HeapCursor{constructor(Ai){this.heap=Ai}static from(Ai,bo=null,Ra=-1){let pc=[];for(let mc=0;mc<Ai.length;mc++)for(let uf=Ai[mc];!uf.isEmpty;uf=uf.nextLayer)uf.maxPoint>=Ra&&pc.push(new LayerCursor(uf,bo,Ra,mc));return pc.length==1?pc[0]:new HeapCursor(pc)}get startSide(){return this.value?this.value.startSide:0}goto(Ai,bo=-1e9){for(let Ra of this.heap)Ra.goto(Ai,bo);for(let Ra=this.heap.length>>1;Ra>=0;Ra--)heapBubble(this.heap,Ra);return this.next(),this}forward(Ai,bo){for(let Ra of this.heap)Ra.forward(Ai,bo);for(let Ra=this.heap.length>>1;Ra>=0;Ra--)heapBubble(this.heap,Ra);(this.to-Ai||this.value.endSide-bo)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let Ai=this.heap[0];this.from=Ai.from,this.to=Ai.to,this.value=Ai.value,this.rank=Ai.rank,Ai.value&&Ai.next(),heapBubble(this.heap,0)}}}function heapBubble(vo,Ai){for(let bo=vo[Ai];;){let Ra=(Ai<<1)+1;if(Ra>=vo.length)break;let pc=vo[Ra];if(Ra+1<vo.length&&pc.compare(vo[Ra+1])>=0&&(pc=vo[Ra+1],Ra++),bo.compare(pc)<0)break;vo[Ra]=bo,vo[Ai]=pc,Ai=Ra}}class SpanCursor{constructor(Ai,bo,Ra){this.minPoint=Ra,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=HeapCursor.from(Ai,bo,Ra)}goto(Ai,bo=-1e9){return this.cursor.goto(Ai,bo),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=Ai,this.endSide=bo,this.openStart=-1,this.next(),this}forward(Ai,bo){for(;this.minActive>-1&&(this.activeTo[this.minActive]-Ai||this.active[this.minActive].endSide-bo)<0;)this.removeActive(this.minActive);this.cursor.forward(Ai,bo)}removeActive(Ai){remove(this.active,Ai),remove(this.activeTo,Ai),remove(this.activeRank,Ai),this.minActive=findMinIndex(this.active,this.activeTo)}addActive(Ai){let bo=0,{value:Ra,to:pc,rank:mc}=this.cursor;for(;bo<this.activeRank.length&&(mc-this.activeRank[bo]||pc-this.activeTo[bo])>0;)bo++;insert(this.active,bo,Ra),insert(this.activeTo,bo,pc),insert(this.activeRank,bo,mc),Ai&&insert(Ai,bo,this.cursor.from),this.minActive=findMinIndex(this.active,this.activeTo)}next(){let Ai=this.to,bo=this.point;this.point=null;let Ra=this.openStart<0?[]:null;for(;;){let pc=this.minActive;if(pc>-1&&(this.activeTo[pc]-this.cursor.from||this.active[pc].endSide-this.cursor.startSide)<0){if(this.activeTo[pc]>Ai){this.to=this.activeTo[pc],this.endSide=this.active[pc].endSide;break}this.removeActive(pc),Ra&&remove(Ra,pc)}else if(this.cursor.value)if(this.cursor.from>Ai){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let mc=this.cursor.value;if(!mc.point)this.addActive(Ra),this.cursor.next();else if(bo&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=mc,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=mc.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(Ra){this.openStart=0;for(let pc=Ra.length-1;pc>=0&&Ra[pc]<Ai;pc--)this.openStart++}}activeForPoint(Ai){if(!this.active.length)return this.active;let bo=[];for(let Ra=this.active.length-1;Ra>=0&&!(this.activeRank[Ra]<this.pointRank);Ra--)(this.activeTo[Ra]>Ai||this.activeTo[Ra]==Ai&&this.active[Ra].endSide>=this.point.endSide)&&bo.push(this.active[Ra]);return bo.reverse()}openEnd(Ai){let bo=0;for(let Ra=this.activeTo.length-1;Ra>=0&&this.activeTo[Ra]>Ai;Ra--)bo++;return bo}}function compare(vo,Ai,bo,Ra,pc,mc){vo.goto(Ai),bo.goto(Ra);let uf=Ra+pc,df=Ra,ff=Ra-Ai;for(;;){let hf=vo.to+ff-bo.to,pf=hf||vo.endSide-bo.endSide,mf=pf<0?vo.to+ff:bo.to,gf=Math.min(mf,uf);if(vo.point||bo.point?vo.point&&bo.point&&(vo.point==bo.point||vo.point.eq(bo.point))&&sameValues(vo.activeForPoint(vo.to),bo.activeForPoint(bo.to))||mc.comparePoint(df,gf,vo.point,bo.point):gf>df&&!sameValues(vo.active,bo.active)&&mc.compareRange(df,gf,vo.active,bo.active),mf>uf)break;(hf||vo.openEnd!=bo.openEnd)&&mc.boundChange&&mc.boundChange(mf),df=mf,pf<=0&&vo.next(),pf>=0&&bo.next()}}function sameValues(vo,Ai){if(vo.length!=Ai.length)return!1;for(let bo=0;bo<vo.length;bo++)if(vo[bo]!=Ai[bo]&&!vo[bo].eq(Ai[bo]))return!1;return!0}function remove(vo,Ai){for(let bo=Ai,Ra=vo.length-1;bo<Ra;bo++)vo[bo]=vo[bo+1];vo.pop()}function insert(vo,Ai,bo){for(let Ra=vo.length-1;Ra>=Ai;Ra--)vo[Ra+1]=vo[Ra];vo[Ai]=bo}function findMinIndex(vo,Ai){let bo=-1,Ra=1e9;for(let pc=0;pc<Ai.length;pc++)(Ai[pc]-Ra||vo[pc].endSide-vo[bo].endSide)<0&&(bo=pc,Ra=Ai[pc]);return bo}function countColumn(vo,Ai,bo=vo.length){let Ra=0;for(let pc=0;pc<bo;)vo.charCodeAt(pc)==9?(Ra+=Ai-Ra%Ai,pc++):(Ra++,pc=findClusterBreak(vo,pc));return Ra}function findColumn(vo,Ai,bo,Ra){for(let pc=0,mc=0;;){if(mc>=Ai)return pc;if(pc==vo.length)break;mc+=vo.charCodeAt(pc)==9?bo-mc%bo:1,pc=findClusterBreak(vo,pc)}return Ra===!0?-1:vo.length}const C="ͼ",COUNT=typeof Symbol>"u"?"__"+C:Symbol.for(C),SET=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),top=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class StyleModule{constructor(Ai,bo){this.rules=[];let{finish:Ra}=bo||{};function pc(uf){return/^@/.test(uf)?[uf]:uf.split(/,\s*/)}function mc(uf,df,ff,hf){let pf=[],mf=/^@(\w+)\b/.exec(uf[0]),gf=mf&&mf[1]=="keyframes";if(mf&&df==null)return ff.push(uf[0]+";");for(let yf in df){let vf=df[yf];if(/&/.test(yf))mc(yf.split(/,\s*/).map(bf=>uf.map(Sf=>bf.replace(/&/,Sf))).reduce((bf,Sf)=>bf.concat(Sf)),vf,ff);else if(vf&&typeof vf=="object"){if(!mf)throw new RangeError("The value of a property ("+yf+") should be a primitive value.");mc(pc(yf),vf,pf,gf)}else vf!=null&&pf.push(yf.replace(/_.*/,"").replace(/[A-Z]/g,bf=>"-"+bf.toLowerCase())+": "+vf+";")}(pf.length||gf)&&ff.push((Ra&&!mf&&!hf?uf.map(Ra):uf).join(", ")+" {"+pf.join(" ")+"}")}for(let uf in Ai)mc(pc(uf),Ai[uf],this.rules)}getRules(){return this.rules.join(`
|
|
351
|
-
`)}static newName(){let Ai=top[COUNT]||1;return top[COUNT]=Ai+1,C+Ai.toString(36)}static mount(Ai,bo,Ra){let pc=Ai[SET],mc=Ra&&Ra.nonce;pc?mc&&pc.setNonce(mc):pc=new StyleSet(Ai,mc),pc.mount(Array.isArray(bo)?bo:[bo],Ai)}}let adoptedSet=new Map;class StyleSet{constructor(Ai,bo){let Ra=Ai.ownerDocument||Ai,pc=Ra.defaultView;if(!Ai.head&&Ai.adoptedStyleSheets&&pc.CSSStyleSheet){let mc=adoptedSet.get(Ra);if(mc)return Ai[SET]=mc;this.sheet=new pc.CSSStyleSheet,adoptedSet.set(Ra,this)}else this.styleTag=Ra.createElement("style"),bo&&this.styleTag.setAttribute("nonce",bo);this.modules=[],Ai[SET]=this}mount(Ai,bo){let Ra=this.sheet,pc=0,mc=0;for(let uf=0;uf<Ai.length;uf++){let df=Ai[uf],ff=this.modules.indexOf(df);if(ff<mc&&ff>-1&&(this.modules.splice(ff,1),mc--,ff=-1),ff==-1){if(this.modules.splice(mc++,0,df),Ra)for(let hf=0;hf<df.rules.length;hf++)Ra.insertRule(df.rules[hf],pc++)}else{for(;mc<ff;)pc+=this.modules[mc++].rules.length;pc+=df.rules.length,mc++}}if(Ra)bo.adoptedStyleSheets.indexOf(this.sheet)<0&&(bo.adoptedStyleSheets=[this.sheet,...bo.adoptedStyleSheets]);else{let uf="";for(let ff=0;ff<this.modules.length;ff++)uf+=this.modules[ff].getRules()+`
|
|
352
|
-
`;this.styleTag.textContent=uf;let df=bo.head||bo;this.styleTag.parentNode!=df&&df.insertBefore(this.styleTag,df.firstChild)}}setNonce(Ai){this.styleTag&&this.styleTag.getAttribute("nonce")!=Ai&&this.styleTag.setAttribute("nonce",Ai)}}var base={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},shift={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},mac=typeof navigator<"u"&&/Mac/.test(navigator.platform),ie$1=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var i$5=0;i$5<10;i$5++)base[48+i$5]=base[96+i$5]=String(i$5);for(var i$5=1;i$5<=24;i$5++)base[i$5+111]="F"+i$5;for(var i$5=65;i$5<=90;i$5++)base[i$5]=String.fromCharCode(i$5+32),shift[i$5]=String.fromCharCode(i$5);for(var code in base)shift.hasOwnProperty(code)||(shift[code]=base[code]);function keyName(vo){var Ai=mac&&vo.metaKey&&vo.shiftKey&&!vo.ctrlKey&&!vo.altKey||ie$1&&vo.shiftKey&&vo.key&&vo.key.length==1||vo.key=="Unidentified",bo=!Ai&&vo.key||(vo.shiftKey?shift:base)[vo.keyCode]||vo.key||"Unidentified";return bo=="Esc"&&(bo="Escape"),bo=="Del"&&(bo="Delete"),bo=="Left"&&(bo="ArrowLeft"),bo=="Up"&&(bo="ArrowUp"),bo=="Right"&&(bo="ArrowRight"),bo=="Down"&&(bo="ArrowDown"),bo}function getSelection(vo){let Ai;return vo.nodeType==11?Ai=vo.getSelection?vo:vo.ownerDocument:Ai=vo,Ai.getSelection()}function contains(vo,Ai){return Ai?vo==Ai||vo.contains(Ai.nodeType!=1?Ai.parentNode:Ai):!1}function hasSelection(vo,Ai){if(!Ai.anchorNode)return!1;try{return contains(vo,Ai.anchorNode)}catch{return!1}}function clientRectsFor(vo){return vo.nodeType==3?textRange(vo,0,vo.nodeValue.length).getClientRects():vo.nodeType==1?vo.getClientRects():[]}function isEquivalentPosition(vo,Ai,bo,Ra){return bo?scanFor(vo,Ai,bo,Ra,-1)||scanFor(vo,Ai,bo,Ra,1):!1}function domIndex(vo){for(var Ai=0;;Ai++)if(vo=vo.previousSibling,!vo)return Ai}function isBlockElement(vo){return vo.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(vo.nodeName)}function scanFor(vo,Ai,bo,Ra,pc){for(;;){if(vo==bo&&Ai==Ra)return!0;if(Ai==(pc<0?0:maxOffset(vo))){if(vo.nodeName=="DIV")return!1;let mc=vo.parentNode;if(!mc||mc.nodeType!=1)return!1;Ai=domIndex(vo)+(pc<0?0:1),vo=mc}else if(vo.nodeType==1){if(vo=vo.childNodes[Ai+(pc<0?-1:0)],vo.nodeType==1&&vo.contentEditable=="false")return!1;Ai=pc<0?maxOffset(vo):0}else return!1}}function maxOffset(vo){return vo.nodeType==3?vo.nodeValue.length:vo.childNodes.length}function flattenRect(vo,Ai){let bo=Ai?vo.left:vo.right;return{left:bo,right:bo,top:vo.top,bottom:vo.bottom}}function windowRect(vo){let Ai=vo.visualViewport;return Ai?{left:0,right:Ai.width,top:0,bottom:Ai.height}:{left:0,right:vo.innerWidth,top:0,bottom:vo.innerHeight}}function getScale(vo,Ai){let bo=Ai.width/vo.offsetWidth,Ra=Ai.height/vo.offsetHeight;return(bo>.995&&bo<1.005||!isFinite(bo)||Math.abs(Ai.width-vo.offsetWidth)<1)&&(bo=1),(Ra>.995&&Ra<1.005||!isFinite(Ra)||Math.abs(Ai.height-vo.offsetHeight)<1)&&(Ra=1),{scaleX:bo,scaleY:Ra}}function scrollRectIntoView(vo,Ai,bo,Ra,pc,mc,uf,df){let ff=vo.ownerDocument,hf=ff.defaultView||window;for(let pf=vo,mf=!1;pf&&!mf;)if(pf.nodeType==1){let gf,yf=pf==ff.body,vf=1,bf=1;if(yf)gf=windowRect(hf);else{if(/^(fixed|sticky)$/.test(getComputedStyle(pf).position)&&(mf=!0),pf.scrollHeight<=pf.clientHeight&&pf.scrollWidth<=pf.clientWidth){pf=pf.assignedSlot||pf.parentNode;continue}let wf=pf.getBoundingClientRect();({scaleX:vf,scaleY:bf}=getScale(pf,wf)),gf={left:wf.left,right:wf.left+pf.clientWidth*vf,top:wf.top,bottom:wf.top+pf.clientHeight*bf}}let Sf=0,xf=0;if(pc=="nearest")Ai.top<gf.top?(xf=-(gf.top-Ai.top+uf),bo>0&&Ai.bottom>gf.bottom+xf&&(xf=Ai.bottom-gf.bottom+xf+uf)):Ai.bottom>gf.bottom&&(xf=Ai.bottom-gf.bottom+uf,bo<0&&Ai.top-xf<gf.top&&(xf=-(gf.top+xf-Ai.top+uf)));else{let wf=Ai.bottom-Ai.top,If=gf.bottom-gf.top;xf=(pc=="center"&&wf<=If?Ai.top+wf/2-If/2:pc=="start"||pc=="center"&&bo<0?Ai.top-uf:Ai.bottom-If+uf)-gf.top}if(Ra=="nearest"?Ai.left<gf.left?(Sf=-(gf.left-Ai.left+mc),bo>0&&Ai.right>gf.right+Sf&&(Sf=Ai.right-gf.right+Sf+mc)):Ai.right>gf.right&&(Sf=Ai.right-gf.right+mc,bo<0&&Ai.left<gf.left+Sf&&(Sf=-(gf.left+Sf-Ai.left+mc))):Sf=(Ra=="center"?Ai.left+(Ai.right-Ai.left)/2-(gf.right-gf.left)/2:Ra=="start"==df?Ai.left-mc:Ai.right-(gf.right-gf.left)+mc)-gf.left,Sf||xf)if(yf)hf.scrollBy(Sf,xf);else{let wf=0,If=0;if(xf){let l1=pf.scrollTop;pf.scrollTop+=xf/bf,If=(pf.scrollTop-l1)*bf}if(Sf){let l1=pf.scrollLeft;pf.scrollLeft+=Sf/vf,wf=(pf.scrollLeft-l1)*vf}Ai={left:Ai.left-wf,top:Ai.top-If,right:Ai.right-wf,bottom:Ai.bottom-If},wf&&Math.abs(wf-Sf)<1&&(Ra="nearest"),If&&Math.abs(If-xf)<1&&(pc="nearest")}if(yf)break;pf=pf.assignedSlot||pf.parentNode}else if(pf.nodeType==11)pf=pf.host;else break}function scrollableParents(vo){let Ai=vo.ownerDocument,bo,Ra;for(let pc=vo.parentNode;pc&&!(pc==Ai.body||bo&&Ra);)if(pc.nodeType==1)!Ra&&pc.scrollHeight>pc.clientHeight&&(Ra=pc),!bo&&pc.scrollWidth>pc.clientWidth&&(bo=pc),pc=pc.assignedSlot||pc.parentNode;else if(pc.nodeType==11)pc=pc.host;else break;return{x:bo,y:Ra}}class DOMSelectionState{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(Ai){return this.anchorNode==Ai.anchorNode&&this.anchorOffset==Ai.anchorOffset&&this.focusNode==Ai.focusNode&&this.focusOffset==Ai.focusOffset}setRange(Ai){let{anchorNode:bo,focusNode:Ra}=Ai;this.set(bo,Math.min(Ai.anchorOffset,bo?maxOffset(bo):0),Ra,Math.min(Ai.focusOffset,Ra?maxOffset(Ra):0))}set(Ai,bo,Ra,pc){this.anchorNode=Ai,this.anchorOffset=bo,this.focusNode=Ra,this.focusOffset=pc}}let preventScrollSupported=null;function focusPreventScroll(vo){if(vo.setActive)return vo.setActive();if(preventScrollSupported)return vo.focus(preventScrollSupported);let Ai=[];for(let bo=vo;bo&&(Ai.push(bo,bo.scrollTop,bo.scrollLeft),bo!=bo.ownerDocument);bo=bo.parentNode);if(vo.focus(preventScrollSupported==null?{get preventScroll(){return preventScrollSupported={preventScroll:!0},!0}}:void 0),!preventScrollSupported){preventScrollSupported=!1;for(let bo=0;bo<Ai.length;){let Ra=Ai[bo++],pc=Ai[bo++],mc=Ai[bo++];Ra.scrollTop!=pc&&(Ra.scrollTop=pc),Ra.scrollLeft!=mc&&(Ra.scrollLeft=mc)}}}let scratchRange;function textRange(vo,Ai,bo=Ai){let Ra=scratchRange||(scratchRange=document.createRange());return Ra.setEnd(vo,bo),Ra.setStart(vo,Ai),Ra}function dispatchKey(vo,Ai,bo,Ra){let pc={key:Ai,code:Ai,keyCode:bo,which:bo,cancelable:!0};Ra&&({altKey:pc.altKey,ctrlKey:pc.ctrlKey,shiftKey:pc.shiftKey,metaKey:pc.metaKey}=Ra);let mc=new KeyboardEvent("keydown",pc);mc.synthetic=!0,vo.dispatchEvent(mc);let uf=new KeyboardEvent("keyup",pc);return uf.synthetic=!0,vo.dispatchEvent(uf),mc.defaultPrevented||uf.defaultPrevented}function getRoot(vo){for(;vo;){if(vo&&(vo.nodeType==9||vo.nodeType==11&&vo.host))return vo;vo=vo.assignedSlot||vo.parentNode}return null}function clearAttributes(vo){for(;vo.attributes.length;)vo.removeAttributeNode(vo.attributes[0])}function atElementStart(vo,Ai){let bo=Ai.focusNode,Ra=Ai.focusOffset;if(!bo||Ai.anchorNode!=bo||Ai.anchorOffset!=Ra)return!1;for(Ra=Math.min(Ra,maxOffset(bo));;)if(Ra){if(bo.nodeType!=1)return!1;let pc=bo.childNodes[Ra-1];pc.contentEditable=="false"?Ra--:(bo=pc,Ra=maxOffset(bo))}else{if(bo==vo)return!0;Ra=domIndex(bo),bo=bo.parentNode}}function isScrolledToBottom(vo){return vo.scrollTop>Math.max(1,vo.scrollHeight-vo.clientHeight-4)}function textNodeBefore(vo,Ai){for(let bo=vo,Ra=Ai;;){if(bo.nodeType==3&&Ra>0)return{node:bo,offset:Ra};if(bo.nodeType==1&&Ra>0){if(bo.contentEditable=="false")return null;bo=bo.childNodes[Ra-1],Ra=maxOffset(bo)}else if(bo.parentNode&&!isBlockElement(bo))Ra=domIndex(bo),bo=bo.parentNode;else return null}}function textNodeAfter(vo,Ai){for(let bo=vo,Ra=Ai;;){if(bo.nodeType==3&&Ra<bo.nodeValue.length)return{node:bo,offset:Ra};if(bo.nodeType==1&&Ra<bo.childNodes.length){if(bo.contentEditable=="false")return null;bo=bo.childNodes[Ra],Ra=0}else if(bo.parentNode&&!isBlockElement(bo))Ra=domIndex(bo)+1,bo=bo.parentNode;else return null}}class DOMPos{constructor(Ai,bo,Ra=!0){this.node=Ai,this.offset=bo,this.precise=Ra}static before(Ai,bo){return new DOMPos(Ai.parentNode,domIndex(Ai),bo)}static after(Ai,bo){return new DOMPos(Ai.parentNode,domIndex(Ai)+1,bo)}}const noChildren=[];class ContentView{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(Ai){let bo=this.posAtStart;for(let Ra of this.children){if(Ra==Ai)return bo;bo+=Ra.length+Ra.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(Ai){return this.posBefore(Ai)+Ai.length}sync(Ai,bo){if(this.flags&2){let Ra=this.dom,pc=null,mc;for(let uf of this.children){if(uf.flags&7){if(!uf.dom&&(mc=pc?pc.nextSibling:Ra.firstChild)){let df=ContentView.get(mc);(!df||!df.parent&&df.canReuseDOM(uf))&&uf.reuseDOM(mc)}uf.sync(Ai,bo),uf.flags&=-8}if(mc=pc?pc.nextSibling:Ra.firstChild,bo&&!bo.written&&bo.node==Ra&&mc!=uf.dom&&(bo.written=!0),uf.dom.parentNode==Ra)for(;mc&&mc!=uf.dom;)mc=rm$1(mc);else Ra.insertBefore(uf.dom,mc);pc=uf.dom}for(mc=pc?pc.nextSibling:Ra.firstChild,mc&&bo&&bo.node==Ra&&(bo.written=!0);mc;)mc=rm$1(mc)}else if(this.flags&1)for(let Ra of this.children)Ra.flags&7&&(Ra.sync(Ai,bo),Ra.flags&=-8)}reuseDOM(Ai){}localPosFromDOM(Ai,bo){let Ra;if(Ai==this.dom)Ra=this.dom.childNodes[bo];else{let pc=maxOffset(Ai)==0?0:bo==0?-1:1;for(;;){let mc=Ai.parentNode;if(mc==this.dom)break;pc==0&&mc.firstChild!=mc.lastChild&&(Ai==mc.firstChild?pc=-1:pc=1),Ai=mc}pc<0?Ra=Ai:Ra=Ai.nextSibling}if(Ra==this.dom.firstChild)return 0;for(;Ra&&!ContentView.get(Ra);)Ra=Ra.nextSibling;if(!Ra)return this.length;for(let pc=0,mc=0;;pc++){let uf=this.children[pc];if(uf.dom==Ra)return mc;mc+=uf.length+uf.breakAfter}}domBoundsAround(Ai,bo,Ra=0){let pc=-1,mc=-1,uf=-1,df=-1;for(let ff=0,hf=Ra,pf=Ra;ff<this.children.length;ff++){let mf=this.children[ff],gf=hf+mf.length;if(hf<Ai&&gf>bo)return mf.domBoundsAround(Ai,bo,hf);if(gf>=Ai&&pc==-1&&(pc=ff,mc=hf),hf>bo&&mf.dom.parentNode==this.dom){uf=ff,df=pf;break}pf=gf,hf=gf+mf.breakAfter}return{from:mc,to:df<0?Ra+this.length:df,startDOM:(pc?this.children[pc-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:uf<this.children.length&&uf>=0?this.children[uf].dom:null}}markDirty(Ai=!1){this.flags|=2,this.markParentsDirty(Ai)}markParentsDirty(Ai){for(let bo=this.parent;bo;bo=bo.parent){if(Ai&&(bo.flags|=2),bo.flags&1)return;bo.flags|=1,Ai=!1}}setParent(Ai){this.parent!=Ai&&(this.parent=Ai,this.flags&7&&this.markParentsDirty(!0))}setDOM(Ai){this.dom!=Ai&&(this.dom&&(this.dom.cmView=null),this.dom=Ai,Ai.cmView=this)}get rootView(){for(let Ai=this;;){let bo=Ai.parent;if(!bo)return Ai;Ai=bo}}replaceChildren(Ai,bo,Ra=noChildren){this.markDirty();for(let pc=Ai;pc<bo;pc++){let mc=this.children[pc];mc.parent==this&&Ra.indexOf(mc)<0&&mc.destroy()}Ra.length<250?this.children.splice(Ai,bo-Ai,...Ra):this.children=[].concat(this.children.slice(0,Ai),Ra,this.children.slice(bo));for(let pc=0;pc<Ra.length;pc++)Ra[pc].setParent(this)}ignoreMutation(Ai){return!1}ignoreEvent(Ai){return!1}childCursor(Ai=this.length){return new ChildCursor(this.children,Ai,this.children.length)}childPos(Ai,bo=1){return this.childCursor().findPos(Ai,bo)}toString(){let Ai=this.constructor.name.replace("View","");return Ai+(this.children.length?"("+this.children.join()+")":this.length?"["+(Ai=="Text"?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}static get(Ai){return Ai.cmView}get isEditable(){return!0}get isWidget(){return!1}get isHidden(){return!1}merge(Ai,bo,Ra,pc,mc,uf){return!1}become(Ai){return!1}canReuseDOM(Ai){return Ai.constructor==this.constructor&&!((this.flags|Ai.flags)&8)}getSide(){return 0}destroy(){for(let Ai of this.children)Ai.parent==this&&Ai.destroy();this.parent=null}}ContentView.prototype.breakAfter=0;function rm$1(vo){let Ai=vo.nextSibling;return vo.parentNode.removeChild(vo),Ai}class ChildCursor{constructor(Ai,bo,Ra){this.children=Ai,this.pos=bo,this.i=Ra,this.off=0}findPos(Ai,bo=1){for(;;){if(Ai>this.pos||Ai==this.pos&&(bo>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=Ai-this.pos,this;let Ra=this.children[--this.i];this.pos-=Ra.length+Ra.breakAfter}}}function replaceRange(vo,Ai,bo,Ra,pc,mc,uf,df,ff){let{children:hf}=vo,pf=hf.length?hf[Ai]:null,mf=mc.length?mc[mc.length-1]:null,gf=mf?mf.breakAfter:uf;if(!(Ai==Ra&&pf&&!uf&&!gf&&mc.length<2&&pf.merge(bo,pc,mc.length?mf:null,bo==0,df,ff))){if(Ra<hf.length){let yf=hf[Ra];yf&&(pc<yf.length||yf.breakAfter&&mf!=null&&mf.breakAfter)?(Ai==Ra&&(yf=yf.split(pc),pc=0),!gf&&mf&&yf.merge(0,pc,mf,!0,0,ff)?mc[mc.length-1]=yf:((pc||yf.children.length&&!yf.children[0].length)&&yf.merge(0,pc,null,!1,0,ff),mc.push(yf))):yf!=null&&yf.breakAfter&&(mf?mf.breakAfter=1:uf=1),Ra++}for(pf&&(pf.breakAfter=uf,bo>0&&(!uf&&mc.length&&pf.merge(bo,pf.length,mc[0],!1,df,0)?pf.breakAfter=mc.shift().breakAfter:(bo<pf.length||pf.children.length&&pf.children[pf.children.length-1].length==0)&&pf.merge(bo,pf.length,null,!1,df,0),Ai++));Ai<Ra&&mc.length;)if(hf[Ra-1].become(mc[mc.length-1]))Ra--,mc.pop(),ff=mc.length?0:df;else if(hf[Ai].become(mc[0]))Ai++,mc.shift(),df=mc.length?0:ff;else break;!mc.length&&Ai&&Ra<hf.length&&!hf[Ai-1].breakAfter&&hf[Ra].merge(0,0,hf[Ai-1],!1,df,ff)&&Ai--,(Ai<Ra||mc.length)&&vo.replaceChildren(Ai,Ra,mc)}}function mergeChildrenInto(vo,Ai,bo,Ra,pc,mc){let uf=vo.childCursor(),{i:df,off:ff}=uf.findPos(bo,1),{i:hf,off:pf}=uf.findPos(Ai,-1),mf=Ai-bo;for(let gf of Ra)mf+=gf.length;vo.length+=mf,replaceRange(vo,hf,pf,df,ff,Ra,0,pc,mc)}let nav=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},doc=typeof document<"u"?document:{documentElement:{style:{}}};const ie_edge=/Edge\/(\d+)/.exec(nav.userAgent),ie_upto10=/MSIE \d/.test(nav.userAgent),ie_11up=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(nav.userAgent),ie=!!(ie_upto10||ie_11up||ie_edge),gecko=!ie&&/gecko\/(\d+)/i.test(nav.userAgent),chrome=!ie&&/Chrome\/(\d+)/.exec(nav.userAgent),webkit="webkitFontSmoothing"in doc.documentElement.style,safari=!ie&&/Apple Computer/.test(nav.vendor),ios=safari&&(/Mobile\/\w+/.test(nav.userAgent)||nav.maxTouchPoints>2);var browser={mac:ios||/Mac/.test(nav.platform),windows:/Win/.test(nav.platform),linux:/Linux|X11/.test(nav.platform),ie,ie_version:ie_upto10?doc.documentMode||6:ie_11up?+ie_11up[1]:ie_edge?+ie_edge[1]:0,gecko,gecko_version:gecko?+(/Firefox\/(\d+)/.exec(nav.userAgent)||[0,0])[1]:0,chrome:!!chrome,chrome_version:chrome?+chrome[1]:0,ios,android:/Android\b/.test(nav.userAgent),webkit,safari,webkit_version:webkit?+(/\bAppleWebKit\/(\d+)/.exec(nav.userAgent)||[0,0])[1]:0,tabSize:doc.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const MaxJoinLen=256;class TextView extends ContentView{constructor(Ai){super(),this.text=Ai}get length(){return this.text.length}createDOM(Ai){this.setDOM(Ai||document.createTextNode(this.text))}sync(Ai,bo){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(bo&&bo.node==this.dom&&(bo.written=!0),this.dom.nodeValue=this.text)}reuseDOM(Ai){Ai.nodeType==3&&this.createDOM(Ai)}merge(Ai,bo,Ra){return this.flags&8||Ra&&(!(Ra instanceof TextView)||this.length-(bo-Ai)+Ra.length>MaxJoinLen||Ra.flags&8)?!1:(this.text=this.text.slice(0,Ai)+(Ra?Ra.text:"")+this.text.slice(bo),this.markDirty(),!0)}split(Ai){let bo=new TextView(this.text.slice(Ai));return this.text=this.text.slice(0,Ai),this.markDirty(),bo.flags|=this.flags&8,bo}localPosFromDOM(Ai,bo){return Ai==this.dom?bo:bo?this.text.length:0}domAtPos(Ai){return new DOMPos(this.dom,Ai)}domBoundsAround(Ai,bo,Ra){return{from:Ra,to:Ra+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(Ai,bo){return textCoords(this.dom,Ai,bo)}}class MarkView extends ContentView{constructor(Ai,bo=[],Ra=0){super(),this.mark=Ai,this.children=bo,this.length=Ra;for(let pc of bo)pc.setParent(this)}setAttrs(Ai){if(clearAttributes(Ai),this.mark.class&&(Ai.className=this.mark.class),this.mark.attrs)for(let bo in this.mark.attrs)Ai.setAttribute(bo,this.mark.attrs[bo]);return Ai}canReuseDOM(Ai){return super.canReuseDOM(Ai)&&!((this.flags|Ai.flags)&8)}reuseDOM(Ai){Ai.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(Ai),this.flags|=6)}sync(Ai,bo){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(Ai,bo)}merge(Ai,bo,Ra,pc,mc,uf){return Ra&&(!(Ra instanceof MarkView&&Ra.mark.eq(this.mark))||Ai&&mc<=0||bo<this.length&&uf<=0)?!1:(mergeChildrenInto(this,Ai,bo,Ra?Ra.children.slice():[],mc-1,uf-1),this.markDirty(),!0)}split(Ai){let bo=[],Ra=0,pc=-1,mc=0;for(let df of this.children){let ff=Ra+df.length;ff>Ai&&bo.push(Ra<Ai?df.split(Ai-Ra):df),pc<0&&Ra>=Ai&&(pc=mc),Ra=ff,mc++}let uf=this.length-Ai;return this.length=Ai,pc>-1&&(this.children.length=pc,this.markDirty()),new MarkView(this.mark,bo,uf)}domAtPos(Ai){return inlineDOMAtPos(this,Ai)}coordsAt(Ai,bo){return coordsInChildren(this,Ai,bo)}}function textCoords(vo,Ai,bo){let Ra=vo.nodeValue.length;Ai>Ra&&(Ai=Ra);let pc=Ai,mc=Ai,uf=0;Ai==0&&bo<0||Ai==Ra&&bo>=0?browser.chrome||browser.gecko||(Ai?(pc--,uf=1):mc<Ra&&(mc++,uf=-1)):bo<0?pc--:mc<Ra&&mc++;let df=textRange(vo,pc,mc).getClientRects();if(!df.length)return null;let ff=df[(uf?uf<0:bo>=0)?0:df.length-1];return browser.safari&&!uf&&ff.width==0&&(ff=Array.prototype.find.call(df,hf=>hf.width)||ff),uf?flattenRect(ff,uf<0):ff||null}class WidgetView extends ContentView{static create(Ai,bo,Ra){return new WidgetView(Ai,bo,Ra)}constructor(Ai,bo,Ra){super(),this.widget=Ai,this.length=bo,this.side=Ra,this.prevWidget=null}split(Ai){let bo=WidgetView.create(this.widget,this.length-Ai,this.side);return this.length-=Ai,bo}sync(Ai){(!this.dom||!this.widget.updateDOM(this.dom,Ai))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(Ai)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(Ai,bo,Ra,pc,mc,uf){return Ra&&(!(Ra instanceof WidgetView)||!this.widget.compare(Ra.widget)||Ai>0&&mc<=0||bo<this.length&&uf<=0)?!1:(this.length=Ai+(Ra?Ra.length:0)+(this.length-bo),!0)}become(Ai){return Ai instanceof WidgetView&&Ai.side==this.side&&this.widget.constructor==Ai.widget.constructor?(this.widget.compare(Ai.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=Ai.widget,this.length=Ai.length,!0):!1}ignoreMutation(){return!0}ignoreEvent(Ai){return this.widget.ignoreEvent(Ai)}get overrideDOMText(){if(this.length==0)return Text.empty;let Ai=this;for(;Ai.parent;)Ai=Ai.parent;let{view:bo}=Ai,Ra=bo&&bo.state.doc,pc=this.posAtStart;return Ra?Ra.slice(pc,pc+this.length):Text.empty}domAtPos(Ai){return(this.length?Ai==0:this.side>0)?DOMPos.before(this.dom):DOMPos.after(this.dom,Ai==this.length)}domBoundsAround(){return null}coordsAt(Ai,bo){let Ra=this.widget.coordsAt(this.dom,Ai,bo);if(Ra)return Ra;let pc=this.dom.getClientRects(),mc=null;if(!pc.length)return null;let uf=this.side?this.side<0:Ai>0;for(let df=uf?pc.length-1:0;mc=pc[df],!(Ai>0?df==0:df==pc.length-1||mc.top<mc.bottom);df+=uf?-1:1);return flattenRect(mc,!uf)}get isEditable(){return!1}get isWidget(){return!0}get isHidden(){return this.widget.isHidden}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}}class WidgetBufferView extends ContentView{constructor(Ai){super(),this.side=Ai}get length(){return 0}merge(){return!1}become(Ai){return Ai instanceof WidgetBufferView&&Ai.side==this.side}split(){return new WidgetBufferView(this.side)}sync(){if(!this.dom){let Ai=document.createElement("img");Ai.className="cm-widgetBuffer",Ai.setAttribute("aria-hidden","true"),this.setDOM(Ai)}}getSide(){return this.side}domAtPos(Ai){return this.side>0?DOMPos.before(this.dom):DOMPos.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(Ai){return this.dom.getBoundingClientRect()}get overrideDOMText(){return Text.empty}get isHidden(){return!0}}TextView.prototype.children=WidgetView.prototype.children=WidgetBufferView.prototype.children=noChildren;function inlineDOMAtPos(vo,Ai){let bo=vo.dom,{children:Ra}=vo,pc=0;for(let mc=0;pc<Ra.length;pc++){let uf=Ra[pc],df=mc+uf.length;if(!(df==mc&&uf.getSide()<=0)){if(Ai>mc&&Ai<df&&uf.dom.parentNode==bo)return uf.domAtPos(Ai-mc);if(Ai<=mc)break;mc=df}}for(let mc=pc;mc>0;mc--){let uf=Ra[mc-1];if(uf.dom.parentNode==bo)return uf.domAtPos(uf.length)}for(let mc=pc;mc<Ra.length;mc++){let uf=Ra[mc];if(uf.dom.parentNode==bo)return uf.domAtPos(0)}return new DOMPos(bo,0)}function joinInlineInto(vo,Ai,bo){let Ra,{children:pc}=vo;bo>0&&Ai instanceof MarkView&&pc.length&&(Ra=pc[pc.length-1])instanceof MarkView&&Ra.mark.eq(Ai.mark)?joinInlineInto(Ra,Ai.children[0],bo-1):(pc.push(Ai),Ai.setParent(vo)),vo.length+=Ai.length}function coordsInChildren(vo,Ai,bo){let Ra=null,pc=-1,mc=null,uf=-1;function df(hf,pf){for(let mf=0,gf=0;mf<hf.children.length&&gf<=pf;mf++){let yf=hf.children[mf],vf=gf+yf.length;vf>=pf&&(yf.children.length?df(yf,pf-gf):(!mc||mc.isHidden&&bo>0)&&(vf>pf||gf==vf&&yf.getSide()>0)?(mc=yf,uf=pf-gf):(gf<pf||gf==vf&&yf.getSide()<0&&!yf.isHidden)&&(Ra=yf,pc=pf-gf)),gf=vf}}df(vo,Ai);let ff=(bo<0?Ra:mc)||Ra||mc;return ff?ff.coordsAt(Math.max(0,ff==Ra?pc:uf),bo):fallbackRect(vo)}function fallbackRect(vo){let Ai=vo.dom.lastChild;if(!Ai)return vo.dom.getBoundingClientRect();let bo=clientRectsFor(Ai);return bo[bo.length-1]||null}function combineAttrs(vo,Ai){for(let bo in vo)bo=="class"&&Ai.class?Ai.class+=" "+vo.class:bo=="style"&&Ai.style?Ai.style+=";"+vo.style:Ai[bo]=vo[bo];return Ai}const noAttrs$1=Object.create(null);function attrsEq(vo,Ai,bo){if(vo==Ai)return!0;vo||(vo=noAttrs$1),Ai||(Ai=noAttrs$1);let Ra=Object.keys(vo),pc=Object.keys(Ai);if(Ra.length-(bo&&Ra.indexOf(bo)>-1?1:0)!=pc.length-(bo&&pc.indexOf(bo)>-1?1:0))return!1;for(let mc of Ra)if(mc!=bo&&(pc.indexOf(mc)==-1||vo[mc]!==Ai[mc]))return!1;return!0}function updateAttrs(vo,Ai,bo){let Ra=!1;if(Ai)for(let pc in Ai)bo&&pc in bo||(Ra=!0,pc=="style"?vo.style.cssText="":vo.removeAttribute(pc));if(bo)for(let pc in bo)Ai&&Ai[pc]==bo[pc]||(Ra=!0,pc=="style"?vo.style.cssText=bo[pc]:vo.setAttribute(pc,bo[pc]));return Ra}function getAttrs(vo){let Ai=Object.create(null);for(let bo=0;bo<vo.attributes.length;bo++){let Ra=vo.attributes[bo];Ai[Ra.name]=Ra.value}return Ai}class WidgetType{eq(Ai){return!1}updateDOM(Ai,bo){return!1}compare(Ai){return this==Ai||this.constructor==Ai.constructor&&this.eq(Ai)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(Ai){return!0}coordsAt(Ai,bo,Ra){return null}get isHidden(){return!1}get editable(){return!1}destroy(Ai){}}var BlockType=function(vo){return vo[vo.Text=0]="Text",vo[vo.WidgetBefore=1]="WidgetBefore",vo[vo.WidgetAfter=2]="WidgetAfter",vo[vo.WidgetRange=3]="WidgetRange",vo}(BlockType||(BlockType={}));class Decoration extends RangeValue{constructor(Ai,bo,Ra,pc){super(),this.startSide=Ai,this.endSide=bo,this.widget=Ra,this.spec=pc}get heightRelevant(){return!1}static mark(Ai){return new MarkDecoration(Ai)}static widget(Ai){let bo=Math.max(-1e4,Math.min(1e4,Ai.side||0)),Ra=!!Ai.block;return bo+=Ra&&!Ai.inlineOrder?bo>0?3e8:-4e8:bo>0?1e8:-1e8,new PointDecoration(Ai,bo,bo,Ra,Ai.widget||null,!1)}static replace(Ai){let bo=!!Ai.block,Ra,pc;if(Ai.isBlockGap)Ra=-5e8,pc=4e8;else{let{start:mc,end:uf}=getInclusive(Ai,bo);Ra=(mc?bo?-3e8:-1:5e8)-1,pc=(uf?bo?2e8:1:-6e8)+1}return new PointDecoration(Ai,Ra,pc,bo,Ai.widget||null,!0)}static line(Ai){return new LineDecoration(Ai)}static set(Ai,bo=!1){return RangeSet.of(Ai,bo)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Decoration.none=RangeSet.empty;class MarkDecoration extends Decoration{constructor(Ai){let{start:bo,end:Ra}=getInclusive(Ai);super(bo?-1:5e8,Ra?1:-6e8,null,Ai),this.tagName=Ai.tagName||"span",this.class=Ai.class||"",this.attrs=Ai.attributes||null}eq(Ai){var bo,Ra;return this==Ai||Ai instanceof MarkDecoration&&this.tagName==Ai.tagName&&(this.class||((bo=this.attrs)===null||bo===void 0?void 0:bo.class))==(Ai.class||((Ra=Ai.attrs)===null||Ra===void 0?void 0:Ra.class))&&attrsEq(this.attrs,Ai.attrs,"class")}range(Ai,bo=Ai){if(Ai>=bo)throw new RangeError("Mark decorations may not be empty");return super.range(Ai,bo)}}MarkDecoration.prototype.point=!1;class LineDecoration extends Decoration{constructor(Ai){super(-2e8,-2e8,null,Ai)}eq(Ai){return Ai instanceof LineDecoration&&this.spec.class==Ai.spec.class&&attrsEq(this.spec.attributes,Ai.spec.attributes)}range(Ai,bo=Ai){if(bo!=Ai)throw new RangeError("Line decoration ranges must be zero-length");return super.range(Ai,bo)}}LineDecoration.prototype.mapMode=MapMode.TrackBefore;LineDecoration.prototype.point=!0;class PointDecoration extends Decoration{constructor(Ai,bo,Ra,pc,mc,uf){super(bo,Ra,mc,Ai),this.block=pc,this.isReplace=uf,this.mapMode=pc?bo<=0?MapMode.TrackBefore:MapMode.TrackAfter:MapMode.TrackDel}get type(){return this.startSide!=this.endSide?BlockType.WidgetRange:this.startSide<=0?BlockType.WidgetBefore:BlockType.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(Ai){return Ai instanceof PointDecoration&&widgetsEq(this.widget,Ai.widget)&&this.block==Ai.block&&this.startSide==Ai.startSide&&this.endSide==Ai.endSide}range(Ai,bo=Ai){if(this.isReplace&&(Ai>bo||Ai==bo&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&bo!=Ai)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(Ai,bo)}}PointDecoration.prototype.point=!0;function getInclusive(vo,Ai=!1){let{inclusiveStart:bo,inclusiveEnd:Ra}=vo;return bo==null&&(bo=vo.inclusive),Ra==null&&(Ra=vo.inclusive),{start:bo??Ai,end:Ra??Ai}}function widgetsEq(vo,Ai){return vo==Ai||!!(vo&&Ai&&vo.compare(Ai))}function addRange(vo,Ai,bo,Ra=0){let pc=bo.length-1;pc>=0&&bo[pc]+Ra>=vo?bo[pc]=Math.max(bo[pc],Ai):bo.push(vo,Ai)}class LineView extends ContentView{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(Ai,bo,Ra,pc,mc,uf){if(Ra){if(!(Ra instanceof LineView))return!1;this.dom||Ra.transferDOM(this)}return pc&&this.setDeco(Ra?Ra.attrs:null),mergeChildrenInto(this,Ai,bo,Ra?Ra.children.slice():[],mc,uf),!0}split(Ai){let bo=new LineView;if(bo.breakAfter=this.breakAfter,this.length==0)return bo;let{i:Ra,off:pc}=this.childPos(Ai);pc&&(bo.append(this.children[Ra].split(pc),0),this.children[Ra].merge(pc,this.children[Ra].length,null,!1,0,0),Ra++);for(let mc=Ra;mc<this.children.length;mc++)bo.append(this.children[mc],0);for(;Ra>0&&this.children[Ra-1].length==0;)this.children[--Ra].destroy();return this.children.length=Ra,this.markDirty(),this.length=Ai,bo}transferDOM(Ai){this.dom&&(this.markDirty(),Ai.setDOM(this.dom),Ai.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(Ai){attrsEq(this.attrs,Ai)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=Ai)}append(Ai,bo){joinInlineInto(this,Ai,bo)}addLineDeco(Ai){let bo=Ai.spec.attributes,Ra=Ai.spec.class;bo&&(this.attrs=combineAttrs(bo,this.attrs||{})),Ra&&(this.attrs=combineAttrs({class:Ra},this.attrs||{}))}domAtPos(Ai){return inlineDOMAtPos(this,Ai)}reuseDOM(Ai){Ai.nodeName=="DIV"&&(this.setDOM(Ai),this.flags|=6)}sync(Ai,bo){var Ra;this.dom?this.flags&4&&(clearAttributes(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(updateAttrs(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(Ai,bo);let pc=this.dom.lastChild;for(;pc&&ContentView.get(pc)instanceof MarkView;)pc=pc.lastChild;if(!pc||!this.length||pc.nodeName!="BR"&&((Ra=ContentView.get(pc))===null||Ra===void 0?void 0:Ra.isEditable)==!1&&(!browser.ios||!this.children.some(mc=>mc instanceof TextView))){let mc=document.createElement("BR");mc.cmIgnore=!0,this.dom.appendChild(mc)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let Ai=0,bo;for(let Ra of this.children){if(!(Ra instanceof TextView)||/[^ -~]/.test(Ra.text))return null;let pc=clientRectsFor(Ra.dom);if(pc.length!=1)return null;Ai+=pc[0].width,bo=pc[0].height}return Ai?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:Ai/this.length,textHeight:bo}:null}coordsAt(Ai,bo){let Ra=coordsInChildren(this,Ai,bo);if(!this.children.length&&Ra&&this.parent){let{heightOracle:pc}=this.parent.view.viewState,mc=Ra.bottom-Ra.top;if(Math.abs(mc-pc.lineHeight)<2&&pc.textHeight<mc){let uf=(mc-pc.textHeight)/2;return{top:Ra.top+uf,bottom:Ra.bottom-uf,left:Ra.left,right:Ra.left}}}return Ra}become(Ai){return Ai instanceof LineView&&this.children.length==0&&Ai.children.length==0&&attrsEq(this.attrs,Ai.attrs)&&this.breakAfter==Ai.breakAfter}covers(){return!0}static find(Ai,bo){for(let Ra=0,pc=0;Ra<Ai.children.length;Ra++){let mc=Ai.children[Ra],uf=pc+mc.length;if(uf>=bo){if(mc instanceof LineView)return mc;if(uf>bo)break}pc=uf+mc.breakAfter}return null}}class BlockWidgetView extends ContentView{constructor(Ai,bo,Ra){super(),this.widget=Ai,this.length=bo,this.deco=Ra,this.breakAfter=0,this.prevWidget=null}merge(Ai,bo,Ra,pc,mc,uf){return Ra&&(!(Ra instanceof BlockWidgetView)||!this.widget.compare(Ra.widget)||Ai>0&&mc<=0||bo<this.length&&uf<=0)?!1:(this.length=Ai+(Ra?Ra.length:0)+(this.length-bo),!0)}domAtPos(Ai){return Ai==0?DOMPos.before(this.dom):DOMPos.after(this.dom,Ai==this.length)}split(Ai){let bo=this.length-Ai;this.length=Ai;let Ra=new BlockWidgetView(this.widget,bo,this.deco);return Ra.breakAfter=this.breakAfter,Ra}get children(){return noChildren}sync(Ai){(!this.dom||!this.widget.updateDOM(this.dom,Ai))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(Ai)),this.widget.editable||(this.dom.contentEditable="false"))}get overrideDOMText(){return this.parent?this.parent.view.state.doc.slice(this.posAtStart,this.posAtEnd):Text.empty}domBoundsAround(){return null}become(Ai){return Ai instanceof BlockWidgetView&&Ai.widget.constructor==this.widget.constructor?(Ai.widget.compare(this.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=Ai.widget,this.length=Ai.length,this.deco=Ai.deco,this.breakAfter=Ai.breakAfter,!0):!1}ignoreMutation(){return!0}ignoreEvent(Ai){return this.widget.ignoreEvent(Ai)}get isEditable(){return!1}get isWidget(){return!0}coordsAt(Ai,bo){return this.widget.coordsAt(this.dom,Ai,bo)||(this.widget instanceof BlockGapWidget?null:flattenRect(this.dom.getBoundingClientRect(),this.length?Ai==0:bo<=0))}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}covers(Ai){let{startSide:bo,endSide:Ra}=this.deco;return bo==Ra?!1:Ai<0?bo<0:Ra>0}}class BlockGapWidget extends WidgetType{constructor(Ai){super(),this.height=Ai}toDOM(){let Ai=document.createElement("div");return Ai.className="cm-gap",this.updateDOM(Ai),Ai}eq(Ai){return Ai.height==this.height}updateDOM(Ai){return Ai.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class ContentBuilder{constructor(Ai,bo,Ra,pc){this.doc=Ai,this.pos=bo,this.end=Ra,this.disallowBlockEffectsFor=pc,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=Ai.iter(),this.skip=bo}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let Ai=this.content[this.content.length-1];return!(Ai.breakAfter||Ai instanceof BlockWidgetView&&Ai.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new LineView),this.atCursorPos=!0),this.curLine}flushBuffer(Ai=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(wrapMarks(new WidgetBufferView(-1),Ai),Ai.length),this.pendingBuffer=0)}addBlockWidget(Ai){this.flushBuffer(),this.curLine=null,this.content.push(Ai)}finish(Ai){this.pendingBuffer&&Ai<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(Ai&&this.content.length&&this.content[this.content.length-1]instanceof BlockWidgetView)&&this.getLine()}buildText(Ai,bo,Ra){for(;Ai>0;){if(this.textOff==this.text.length){let{value:mc,lineBreak:uf,done:df}=this.cursor.next(this.skip);if(this.skip=0,df)throw new Error("Ran out of text content when drawing inline views");if(uf){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,Ai--;continue}else this.text=mc,this.textOff=0}let pc=Math.min(this.text.length-this.textOff,Ai,512);this.flushBuffer(bo.slice(bo.length-Ra)),this.getLine().append(wrapMarks(new TextView(this.text.slice(this.textOff,this.textOff+pc)),bo),Ra),this.atCursorPos=!0,this.textOff+=pc,Ai-=pc,Ra=0}}span(Ai,bo,Ra,pc){this.buildText(bo-Ai,Ra,pc),this.pos=bo,this.openStart<0&&(this.openStart=pc)}point(Ai,bo,Ra,pc,mc,uf){if(this.disallowBlockEffectsFor[uf]&&Ra instanceof PointDecoration){if(Ra.block)throw new RangeError("Block decorations may not be specified via plugins");if(bo>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let df=bo-Ai;if(Ra instanceof PointDecoration)if(Ra.block)Ra.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new BlockWidgetView(Ra.widget||NullWidget.block,df,Ra));else{let ff=WidgetView.create(Ra.widget||NullWidget.inline,df,df?0:Ra.startSide),hf=this.atCursorPos&&!ff.isEditable&&mc<=pc.length&&(Ai<bo||Ra.startSide>0),pf=!ff.isEditable&&(Ai<bo||mc>pc.length||Ra.startSide<=0),mf=this.getLine();this.pendingBuffer==2&&!hf&&!ff.isEditable&&(this.pendingBuffer=0),this.flushBuffer(pc),hf&&(mf.append(wrapMarks(new WidgetBufferView(1),pc),mc),mc=pc.length+Math.max(0,mc-pc.length)),mf.append(wrapMarks(ff,pc),mc),this.atCursorPos=pf,this.pendingBuffer=pf?Ai<bo||mc>pc.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=pc.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(Ra);df&&(this.textOff+df<=this.text.length?this.textOff+=df:(this.skip+=df-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=bo),this.openStart<0&&(this.openStart=mc)}static build(Ai,bo,Ra,pc,mc){let uf=new ContentBuilder(Ai,bo,Ra,mc);return uf.openEnd=RangeSet.spans(pc,bo,Ra,uf),uf.openStart<0&&(uf.openStart=uf.openEnd),uf.finish(uf.openEnd),uf}}function wrapMarks(vo,Ai){for(let bo of Ai)vo=new MarkView(bo,[vo],vo.length);return vo}class NullWidget extends WidgetType{constructor(Ai){super(),this.tag=Ai}eq(Ai){return Ai.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(Ai){return Ai.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}NullWidget.inline=new NullWidget("span");NullWidget.block=new NullWidget("div");var Direction=function(vo){return vo[vo.LTR=0]="LTR",vo[vo.RTL=1]="RTL",vo}(Direction||(Direction={}));const LTR=Direction.LTR,RTL=Direction.RTL;function dec(vo){let Ai=[];for(let bo=0;bo<vo.length;bo++)Ai.push(1<<+vo[bo]);return Ai}const LowTypes=dec("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),ArabicTypes=dec("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),Brackets=Object.create(null),BracketStack=[];for(let vo of["()","[]","{}"]){let Ai=vo.charCodeAt(0),bo=vo.charCodeAt(1);Brackets[Ai]=bo,Brackets[bo]=-Ai}function charType(vo){return vo<=247?LowTypes[vo]:1424<=vo&&vo<=1524?2:1536<=vo&&vo<=1785?ArabicTypes[vo-1536]:1774<=vo&&vo<=2220?4:8192<=vo&&vo<=8204?256:64336<=vo&&vo<=65023?4:1}const BidiRE=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class BidiSpan{get dir(){return this.level%2?RTL:LTR}constructor(Ai,bo,Ra){this.from=Ai,this.to=bo,this.level=Ra}side(Ai,bo){return this.dir==bo==Ai?this.to:this.from}forward(Ai,bo){return Ai==(this.dir==bo)}static find(Ai,bo,Ra,pc){let mc=-1;for(let uf=0;uf<Ai.length;uf++){let df=Ai[uf];if(df.from<=bo&&df.to>=bo){if(df.level==Ra)return uf;(mc<0||(pc!=0?pc<0?df.from<bo:df.to>bo:Ai[mc].level>df.level))&&(mc=uf)}}if(mc<0)throw new RangeError("Index out of range");return mc}}function isolatesEq(vo,Ai){if(vo.length!=Ai.length)return!1;for(let bo=0;bo<vo.length;bo++){let Ra=vo[bo],pc=Ai[bo];if(Ra.from!=pc.from||Ra.to!=pc.to||Ra.direction!=pc.direction||!isolatesEq(Ra.inner,pc.inner))return!1}return!0}const types=[];function computeCharTypes(vo,Ai,bo,Ra,pc){for(let mc=0;mc<=Ra.length;mc++){let uf=mc?Ra[mc-1].to:Ai,df=mc<Ra.length?Ra[mc].from:bo,ff=mc?256:pc;for(let hf=uf,pf=ff,mf=ff;hf<df;hf++){let gf=charType(vo.charCodeAt(hf));gf==512?gf=pf:gf==8&&mf==4&&(gf=16),types[hf]=gf==4?2:gf,gf&7&&(mf=gf),pf=gf}for(let hf=uf,pf=ff,mf=ff;hf<df;hf++){let gf=types[hf];if(gf==128)hf<df-1&&pf==types[hf+1]&&pf&24?gf=types[hf]=pf:types[hf]=256;else if(gf==64){let yf=hf+1;for(;yf<df&&types[yf]==64;)yf++;let vf=hf&&pf==8||yf<bo&&types[yf]==8?mf==1?1:8:256;for(let bf=hf;bf<yf;bf++)types[bf]=vf;hf=yf-1}else gf==8&&mf==1&&(types[hf]=1);pf=gf,gf&7&&(mf=gf)}}}function processBracketPairs(vo,Ai,bo,Ra,pc){let mc=pc==1?2:1;for(let uf=0,df=0,ff=0;uf<=Ra.length;uf++){let hf=uf?Ra[uf-1].to:Ai,pf=uf<Ra.length?Ra[uf].from:bo;for(let mf=hf,gf,yf,vf;mf<pf;mf++)if(yf=Brackets[gf=vo.charCodeAt(mf)])if(yf<0){for(let bf=df-3;bf>=0;bf-=3)if(BracketStack[bf+1]==-yf){let Sf=BracketStack[bf+2],xf=Sf&2?pc:Sf&4?Sf&1?mc:pc:0;xf&&(types[mf]=types[BracketStack[bf]]=xf),df=bf;break}}else{if(BracketStack.length==189)break;BracketStack[df++]=mf,BracketStack[df++]=gf,BracketStack[df++]=ff}else if((vf=types[mf])==2||vf==1){let bf=vf==pc;ff=bf?0:1;for(let Sf=df-3;Sf>=0;Sf-=3){let xf=BracketStack[Sf+2];if(xf&2)break;if(bf)BracketStack[Sf+2]|=2;else{if(xf&4)break;BracketStack[Sf+2]|=4}}}}}function processNeutrals(vo,Ai,bo,Ra){for(let pc=0,mc=Ra;pc<=bo.length;pc++){let uf=pc?bo[pc-1].to:vo,df=pc<bo.length?bo[pc].from:Ai;for(let ff=uf;ff<df;){let hf=types[ff];if(hf==256){let pf=ff+1;for(;;)if(pf==df){if(pc==bo.length)break;pf=bo[pc++].to,df=pc<bo.length?bo[pc].from:Ai}else if(types[pf]==256)pf++;else break;let mf=mc==1,gf=(pf<Ai?types[pf]:Ra)==1,yf=mf==gf?mf?1:2:Ra;for(let vf=pf,bf=pc,Sf=bf?bo[bf-1].to:vo;vf>ff;)vf==Sf&&(vf=bo[--bf].from,Sf=bf?bo[bf-1].to:vo),types[--vf]=yf;ff=pf}else mc=hf,ff++}}}function emitSpans(vo,Ai,bo,Ra,pc,mc,uf){let df=Ra%2?2:1;if(Ra%2==pc%2)for(let ff=Ai,hf=0;ff<bo;){let pf=!0,mf=!1;if(hf==mc.length||ff<mc[hf].from){let bf=types[ff];bf!=df&&(pf=!1,mf=bf==16)}let gf=!pf&&df==1?[]:null,yf=pf?Ra:Ra+1,vf=ff;e:for(;;)if(hf<mc.length&&vf==mc[hf].from){if(mf)break e;let bf=mc[hf];if(!pf)for(let Sf=bf.to,xf=hf+1;;){if(Sf==bo)break e;if(xf<mc.length&&mc[xf].from==Sf)Sf=mc[xf++].to;else{if(types[Sf]==df)break e;break}}if(hf++,gf)gf.push(bf);else{bf.from>ff&&uf.push(new BidiSpan(ff,bf.from,yf));let Sf=bf.direction==LTR!=!(yf%2);computeSectionOrder(vo,Sf?Ra+1:Ra,pc,bf.inner,bf.from,bf.to,uf),ff=bf.to}vf=bf.to}else{if(vf==bo||(pf?types[vf]!=df:types[vf]==df))break;vf++}gf?emitSpans(vo,ff,vf,Ra+1,pc,gf,uf):ff<vf&&uf.push(new BidiSpan(ff,vf,yf)),ff=vf}else for(let ff=bo,hf=mc.length;ff>Ai;){let pf=!0,mf=!1;if(!hf||ff>mc[hf-1].to){let bf=types[ff-1];bf!=df&&(pf=!1,mf=bf==16)}let gf=!pf&&df==1?[]:null,yf=pf?Ra:Ra+1,vf=ff;e:for(;;)if(hf&&vf==mc[hf-1].to){if(mf)break e;let bf=mc[--hf];if(!pf)for(let Sf=bf.from,xf=hf;;){if(Sf==Ai)break e;if(xf&&mc[xf-1].to==Sf)Sf=mc[--xf].from;else{if(types[Sf-1]==df)break e;break}}if(gf)gf.push(bf);else{bf.to<ff&&uf.push(new BidiSpan(bf.to,ff,yf));let Sf=bf.direction==LTR!=!(yf%2);computeSectionOrder(vo,Sf?Ra+1:Ra,pc,bf.inner,bf.from,bf.to,uf),ff=bf.from}vf=bf.from}else{if(vf==Ai||(pf?types[vf-1]!=df:types[vf-1]==df))break;vf--}gf?emitSpans(vo,vf,ff,Ra+1,pc,gf,uf):vf<ff&&uf.push(new BidiSpan(vf,ff,yf)),ff=vf}}function computeSectionOrder(vo,Ai,bo,Ra,pc,mc,uf){let df=Ai%2?2:1;computeCharTypes(vo,pc,mc,Ra,df),processBracketPairs(vo,pc,mc,Ra,df),processNeutrals(pc,mc,Ra,df),emitSpans(vo,pc,mc,Ai,bo,Ra,uf)}function computeOrder(vo,Ai,bo){if(!vo)return[new BidiSpan(0,0,Ai==RTL?1:0)];if(Ai==LTR&&!bo.length&&!BidiRE.test(vo))return trivialOrder(vo.length);if(bo.length)for(;vo.length>types.length;)types[types.length]=256;let Ra=[],pc=Ai==LTR?0:1;return computeSectionOrder(vo,pc,pc,bo,0,vo.length,Ra),Ra}function trivialOrder(vo){return[new BidiSpan(0,vo,0)]}let movedOver="";function moveVisually(vo,Ai,bo,Ra,pc){var mc;let uf=Ra.head-vo.from,df=BidiSpan.find(Ai,uf,(mc=Ra.bidiLevel)!==null&&mc!==void 0?mc:-1,Ra.assoc),ff=Ai[df],hf=ff.side(pc,bo);if(uf==hf){let gf=df+=pc?1:-1;if(gf<0||gf>=Ai.length)return null;ff=Ai[df=gf],uf=ff.side(!pc,bo),hf=ff.side(pc,bo)}let pf=findClusterBreak(vo.text,uf,ff.forward(pc,bo));(pf<ff.from||pf>ff.to)&&(pf=hf),movedOver=vo.text.slice(Math.min(uf,pf),Math.max(uf,pf));let mf=df==(pc?Ai.length-1:0)?null:Ai[df+(pc?1:-1)];return mf&&pf==hf&&mf.level+(pc?0:1)<ff.level?EditorSelection.cursor(mf.side(!pc,bo)+vo.from,mf.forward(pc,bo)?1:-1,mf.level):EditorSelection.cursor(pf+vo.from,ff.forward(pc,bo)?-1:1,ff.level)}function autoDirection(vo,Ai,bo){for(let Ra=Ai;Ra<bo;Ra++){let pc=charType(vo.charCodeAt(Ra));if(pc==1)return LTR;if(pc==2||pc==4)return RTL}return LTR}const clickAddsSelectionRange=Facet.define(),dragMovesSelection$1=Facet.define(),mouseSelectionStyle=Facet.define(),exceptionSink=Facet.define(),updateListener=Facet.define(),inputHandler$1=Facet.define(),focusChangeEffect=Facet.define(),clipboardInputFilter=Facet.define(),clipboardOutputFilter=Facet.define(),perLineTextDirection=Facet.define({combine:vo=>vo.some(Ai=>Ai)}),nativeSelectionHidden=Facet.define({combine:vo=>vo.some(Ai=>Ai)}),scrollHandler=Facet.define();class ScrollTarget{constructor(Ai,bo="nearest",Ra="nearest",pc=5,mc=5,uf=!1){this.range=Ai,this.y=bo,this.x=Ra,this.yMargin=pc,this.xMargin=mc,this.isSnapshot=uf}map(Ai){return Ai.empty?this:new ScrollTarget(this.range.map(Ai),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(Ai){return this.range.to<=Ai.doc.length?this:new ScrollTarget(EditorSelection.cursor(Ai.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const scrollIntoView$1=StateEffect.define({map:(vo,Ai)=>vo.map(Ai)}),setEditContextFormatting=StateEffect.define();function logException(vo,Ai,bo){let Ra=vo.facet(exceptionSink);Ra.length?Ra[0](Ai):window.onerror?window.onerror(String(Ai),bo,void 0,void 0,Ai):bo?console.error(bo+":",Ai):console.error(Ai)}const editable=Facet.define({combine:vo=>vo.length?vo[0]:!0});let nextPluginID=0;const viewPlugin=Facet.define();class ViewPlugin{constructor(Ai,bo,Ra,pc,mc){this.id=Ai,this.create=bo,this.domEventHandlers=Ra,this.domEventObservers=pc,this.extension=mc(this)}static define(Ai,bo){const{eventHandlers:Ra,eventObservers:pc,provide:mc,decorations:uf}=bo||{};return new ViewPlugin(nextPluginID++,Ai,Ra,pc,df=>{let ff=[viewPlugin.of(df)];return uf&&ff.push(decorations.of(hf=>{let pf=hf.plugin(df);return pf?uf(pf):Decoration.none})),mc&&ff.push(mc(df)),ff})}static fromClass(Ai,bo){return ViewPlugin.define(Ra=>new Ai(Ra),bo)}}class PluginInstance{constructor(Ai){this.spec=Ai,this.mustUpdate=null,this.value=null}update(Ai){if(this.value){if(this.mustUpdate){let bo=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(bo)}catch(Ra){if(logException(bo.state,Ra,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(Ai)}catch(bo){logException(Ai.state,bo,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(Ai){var bo;if(!((bo=this.value)===null||bo===void 0)&&bo.destroy)try{this.value.destroy()}catch(Ra){logException(Ai.state,Ra,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const editorAttributes=Facet.define(),contentAttributes=Facet.define(),decorations=Facet.define(),outerDecorations=Facet.define(),atomicRanges=Facet.define(),bidiIsolatedRanges=Facet.define();function getIsolatedRanges(vo,Ai){let bo=vo.state.facet(bidiIsolatedRanges);if(!bo.length)return bo;let Ra=bo.map(mc=>mc instanceof Function?mc(vo):mc),pc=[];return RangeSet.spans(Ra,Ai.from,Ai.to,{point(){},span(mc,uf,df,ff){let hf=mc-Ai.from,pf=uf-Ai.from,mf=pc;for(let gf=df.length-1;gf>=0;gf--,ff--){let yf=df[gf].spec.bidiIsolate,vf;if(yf==null&&(yf=autoDirection(Ai.text,hf,pf)),ff>0&&mf.length&&(vf=mf[mf.length-1]).to==hf&&vf.direction==yf)vf.to=pf,mf=vf.inner;else{let bf={from:hf,to:pf,direction:yf,inner:[]};mf.push(bf),mf=bf.inner}}}}),pc}const scrollMargins=Facet.define();function getScrollMargins(vo){let Ai=0,bo=0,Ra=0,pc=0;for(let mc of vo.state.facet(scrollMargins)){let uf=mc(vo);uf&&(uf.left!=null&&(Ai=Math.max(Ai,uf.left)),uf.right!=null&&(bo=Math.max(bo,uf.right)),uf.top!=null&&(Ra=Math.max(Ra,uf.top)),uf.bottom!=null&&(pc=Math.max(pc,uf.bottom)))}return{left:Ai,right:bo,top:Ra,bottom:pc}}const styleModule=Facet.define();class ChangedRange{constructor(Ai,bo,Ra,pc){this.fromA=Ai,this.toA=bo,this.fromB=Ra,this.toB=pc}join(Ai){return new ChangedRange(Math.min(this.fromA,Ai.fromA),Math.max(this.toA,Ai.toA),Math.min(this.fromB,Ai.fromB),Math.max(this.toB,Ai.toB))}addToSet(Ai){let bo=Ai.length,Ra=this;for(;bo>0;bo--){let pc=Ai[bo-1];if(!(pc.fromA>Ra.toA)){if(pc.toA<Ra.fromA)break;Ra=Ra.join(pc),Ai.splice(bo-1,1)}}return Ai.splice(bo,0,Ra),Ai}static extendWithRanges(Ai,bo){if(bo.length==0)return Ai;let Ra=[];for(let pc=0,mc=0,uf=0,df=0;;pc++){let ff=pc==Ai.length?null:Ai[pc],hf=uf-df,pf=ff?ff.fromB:1e9;for(;mc<bo.length&&bo[mc]<pf;){let mf=bo[mc],gf=bo[mc+1],yf=Math.max(df,mf),vf=Math.min(pf,gf);if(yf<=vf&&new ChangedRange(yf+hf,vf+hf,yf,vf).addToSet(Ra),gf>pf)break;mc+=2}if(!ff)return Ra;new ChangedRange(ff.fromA,ff.toA,ff.fromB,ff.toB).addToSet(Ra),uf=ff.toA,df=ff.toB}}}class ViewUpdate{constructor(Ai,bo,Ra){this.view=Ai,this.state=bo,this.transactions=Ra,this.flags=0,this.startState=Ai.state,this.changes=ChangeSet.empty(this.startState.doc.length);for(let mc of Ra)this.changes=this.changes.compose(mc.changes);let pc=[];this.changes.iterChangedRanges((mc,uf,df,ff)=>pc.push(new ChangedRange(mc,uf,df,ff))),this.changedRanges=pc}static create(Ai,bo,Ra){return new ViewUpdate(Ai,bo,Ra)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(Ai=>Ai.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}class DocView extends ContentView{get length(){return this.view.state.doc.length}constructor(Ai){super(),this.view=Ai,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=Decoration.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(Ai.contentDOM),this.children=[new LineView],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new ChangedRange(0,0,0,Ai.state.doc.length)],0,null)}update(Ai){var bo;let Ra=Ai.changedRanges;this.minWidth>0&&Ra.length&&(Ra.every(({fromA:hf,toA:pf})=>pf<this.minWidthFrom||hf>this.minWidthTo)?(this.minWidthFrom=Ai.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=Ai.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(Ai);let pc=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((bo=this.domChanged)===null||bo===void 0)&&bo.newSel?pc=this.domChanged.newSel.head:!touchesComposition(Ai.changes,this.hasComposition)&&!Ai.selectionSet&&(pc=Ai.state.selection.main.head));let mc=pc>-1?findCompositionRange(this.view,Ai.changes,pc):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:hf,to:pf}=this.hasComposition;Ra=new ChangedRange(hf,pf,Ai.changes.mapPos(hf,-1),Ai.changes.mapPos(pf,1)).addToSet(Ra.slice())}this.hasComposition=mc?{from:mc.range.fromB,to:mc.range.toB}:null,(browser.ie||browser.chrome)&&!mc&&Ai&&Ai.state.doc.lines!=Ai.startState.doc.lines&&(this.forceSelection=!0);let uf=this.decorations,df=this.updateDeco(),ff=findChangedDeco(uf,df,Ai.changes);return Ra=ChangedRange.extendWithRanges(Ra,ff),!(this.flags&7)&&Ra.length==0?!1:(this.updateInner(Ra,Ai.startState.doc.length,mc),Ai.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(Ai,bo,Ra){this.view.viewState.mustMeasureContent=!0,this.updateChildren(Ai,bo,Ra);let{observer:pc}=this.view;pc.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let uf=browser.chrome||browser.ios?{node:pc.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,uf),this.flags&=-8,uf&&(uf.written||pc.selectionRange.focusNode!=uf.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(uf=>uf.flags&=-9);let mc=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let uf of this.children)uf instanceof BlockWidgetView&&uf.widget instanceof BlockGapWidget&&mc.push(uf.dom);pc.updateGaps(mc)}updateChildren(Ai,bo,Ra){let pc=Ra?Ra.range.addToSet(Ai.slice()):Ai,mc=this.childCursor(bo);for(let uf=pc.length-1;;uf--){let df=uf>=0?pc[uf]:null;if(!df)break;let{fromA:ff,toA:hf,fromB:pf,toB:mf}=df,gf,yf,vf,bf;if(Ra&&Ra.range.fromB<mf&&Ra.range.toB>pf){let l1=ContentBuilder.build(this.view.state.doc,pf,Ra.range.fromB,this.decorations,this.dynamicDecorationMap),s1=ContentBuilder.build(this.view.state.doc,Ra.range.toB,mf,this.decorations,this.dynamicDecorationMap);yf=l1.breakAtStart,vf=l1.openStart,bf=s1.openEnd;let c1=this.compositionView(Ra);s1.breakAtStart?c1.breakAfter=1:s1.content.length&&c1.merge(c1.length,c1.length,s1.content[0],!1,s1.openStart,0)&&(c1.breakAfter=s1.content[0].breakAfter,s1.content.shift()),l1.content.length&&c1.merge(0,0,l1.content[l1.content.length-1],!0,0,l1.openEnd)&&l1.content.pop(),gf=l1.content.concat(c1).concat(s1.content)}else({content:gf,breakAtStart:yf,openStart:vf,openEnd:bf}=ContentBuilder.build(this.view.state.doc,pf,mf,this.decorations,this.dynamicDecorationMap));let{i:Sf,off:xf}=mc.findPos(hf,1),{i:wf,off:If}=mc.findPos(ff,-1);replaceRange(this,wf,If,Sf,xf,gf,yf,vf,bf)}Ra&&this.fixCompositionDOM(Ra)}updateEditContextFormatting(Ai){this.editContextFormatting=this.editContextFormatting.map(Ai.changes);for(let bo of Ai.transactions)for(let Ra of bo.effects)Ra.is(setEditContextFormatting)&&(this.editContextFormatting=Ra.value)}compositionView(Ai){let bo=new TextView(Ai.text.nodeValue);bo.flags|=8;for(let{deco:pc}of Ai.marks)bo=new MarkView(pc,[bo],bo.length);let Ra=new LineView;return Ra.append(bo,0),Ra}fixCompositionDOM(Ai){let bo=(mc,uf)=>{uf.flags|=8|(uf.children.some(ff=>ff.flags&7)?1:0),this.markedForComposition.add(uf);let df=ContentView.get(mc);df&&df!=uf&&(df.dom=null),uf.setDOM(mc)},Ra=this.childPos(Ai.range.fromB,1),pc=this.children[Ra.i];bo(Ai.line,pc);for(let mc=Ai.marks.length-1;mc>=-1;mc--)Ra=pc.childPos(Ra.off,1),pc=pc.children[Ra.i],bo(mc>=0?Ai.marks[mc].node:Ai.text,pc)}updateSelection(Ai=!1,bo=!1){(Ai||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let Ra=this.view.root.activeElement,pc=Ra==this.dom,mc=!pc&&!(this.view.state.facet(editable)||this.dom.tabIndex>-1)&&hasSelection(this.dom,this.view.observer.selectionRange)&&!(Ra&&this.dom.contains(Ra));if(!(pc||bo||mc))return;let uf=this.forceSelection;this.forceSelection=!1;let df=this.view.state.selection.main,ff=this.moveToLine(this.domAtPos(df.anchor)),hf=df.empty?ff:this.moveToLine(this.domAtPos(df.head));if(browser.gecko&&df.empty&&!this.hasComposition&&betweenUneditable(ff)){let mf=document.createTextNode("");this.view.observer.ignore(()=>ff.node.insertBefore(mf,ff.node.childNodes[ff.offset]||null)),ff=hf=new DOMPos(mf,0),uf=!0}let pf=this.view.observer.selectionRange;(uf||!pf.focusNode||(!isEquivalentPosition(ff.node,ff.offset,pf.anchorNode,pf.anchorOffset)||!isEquivalentPosition(hf.node,hf.offset,pf.focusNode,pf.focusOffset))&&!this.suppressWidgetCursorChange(pf,df))&&(this.view.observer.ignore(()=>{browser.android&&browser.chrome&&this.dom.contains(pf.focusNode)&&inUneditable(pf.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let mf=getSelection(this.view.root);if(mf)if(df.empty){if(browser.gecko){let gf=nextToUneditable(ff.node,ff.offset);if(gf&&gf!=3){let yf=(gf==1?textNodeBefore:textNodeAfter)(ff.node,ff.offset);yf&&(ff=new DOMPos(yf.node,yf.offset))}}mf.collapse(ff.node,ff.offset),df.bidiLevel!=null&&mf.caretBidiLevel!==void 0&&(mf.caretBidiLevel=df.bidiLevel)}else if(mf.extend){mf.collapse(ff.node,ff.offset);try{mf.extend(hf.node,hf.offset)}catch{}}else{let gf=document.createRange();df.anchor>df.head&&([ff,hf]=[hf,ff]),gf.setEnd(hf.node,hf.offset),gf.setStart(ff.node,ff.offset),mf.removeAllRanges(),mf.addRange(gf)}mc&&this.view.root.activeElement==this.dom&&(this.dom.blur(),Ra&&Ra.focus())}),this.view.observer.setSelectionRange(ff,hf)),this.impreciseAnchor=ff.precise?null:new DOMPos(pf.anchorNode,pf.anchorOffset),this.impreciseHead=hf.precise?null:new DOMPos(pf.focusNode,pf.focusOffset)}suppressWidgetCursorChange(Ai,bo){return this.hasComposition&&bo.empty&&isEquivalentPosition(Ai.focusNode,Ai.focusOffset,Ai.anchorNode,Ai.anchorOffset)&&this.posFromDOM(Ai.focusNode,Ai.focusOffset)==bo.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:Ai}=this,bo=Ai.state.selection.main,Ra=getSelection(Ai.root),{anchorNode:pc,anchorOffset:mc}=Ai.observer.selectionRange;if(!Ra||!bo.empty||!bo.assoc||!Ra.modify)return;let uf=LineView.find(this,bo.head);if(!uf)return;let df=uf.posAtStart;if(bo.head==df||bo.head==df+uf.length)return;let ff=this.coordsAt(bo.head,-1),hf=this.coordsAt(bo.head,1);if(!ff||!hf||ff.bottom>hf.top)return;let pf=this.domAtPos(bo.head+bo.assoc);Ra.collapse(pf.node,pf.offset),Ra.modify("move",bo.assoc<0?"forward":"backward","lineboundary"),Ai.observer.readSelectionRange();let mf=Ai.observer.selectionRange;Ai.docView.posFromDOM(mf.anchorNode,mf.anchorOffset)!=bo.from&&Ra.collapse(pc,mc)}moveToLine(Ai){let bo=this.dom,Ra;if(Ai.node!=bo)return Ai;for(let pc=Ai.offset;!Ra&&pc<bo.childNodes.length;pc++){let mc=ContentView.get(bo.childNodes[pc]);mc instanceof LineView&&(Ra=mc.domAtPos(0))}for(let pc=Ai.offset-1;!Ra&&pc>=0;pc--){let mc=ContentView.get(bo.childNodes[pc]);mc instanceof LineView&&(Ra=mc.domAtPos(mc.length))}return Ra?new DOMPos(Ra.node,Ra.offset,!0):Ai}nearest(Ai){for(let bo=Ai;bo;){let Ra=ContentView.get(bo);if(Ra&&Ra.rootView==this)return Ra;bo=bo.parentNode}return null}posFromDOM(Ai,bo){let Ra=this.nearest(Ai);if(!Ra)throw new RangeError("Trying to find position for a DOM position outside of the document");return Ra.localPosFromDOM(Ai,bo)+Ra.posAtStart}domAtPos(Ai){let{i:bo,off:Ra}=this.childCursor().findPos(Ai,-1);for(;bo<this.children.length-1;){let pc=this.children[bo];if(Ra<pc.length||pc instanceof LineView)break;bo++,Ra=0}return this.children[bo].domAtPos(Ra)}coordsAt(Ai,bo){let Ra=null,pc=0;for(let mc=this.length,uf=this.children.length-1;uf>=0;uf--){let df=this.children[uf],ff=mc-df.breakAfter,hf=ff-df.length;if(ff<Ai)break;if(hf<=Ai&&(hf<Ai||df.covers(-1))&&(ff>Ai||df.covers(1))&&(!Ra||df instanceof LineView&&!(Ra instanceof LineView&&bo>=0)))Ra=df,pc=hf;else if(Ra&&hf==Ai&&ff==Ai&&df instanceof BlockWidgetView&&Math.abs(bo)<2){if(df.deco.startSide<0)break;uf&&(Ra=null)}mc=hf}return Ra?Ra.coordsAt(Ai-pc,bo):null}coordsForChar(Ai){let{i:bo,off:Ra}=this.childPos(Ai,1),pc=this.children[bo];if(!(pc instanceof LineView))return null;for(;pc.children.length;){let{i:df,off:ff}=pc.childPos(Ra,1);for(;;df++){if(df==pc.children.length)return null;if((pc=pc.children[df]).length)break}Ra=ff}if(!(pc instanceof TextView))return null;let mc=findClusterBreak(pc.text,Ra);if(mc==Ra)return null;let uf=textRange(pc.dom,Ra,mc).getClientRects();for(let df=0;df<uf.length;df++){let ff=uf[df];if(df==uf.length-1||ff.top<ff.bottom&&ff.left<ff.right)return ff}return null}measureVisibleLineHeights(Ai){let bo=[],{from:Ra,to:pc}=Ai,mc=this.view.contentDOM.clientWidth,uf=mc>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,df=-1,ff=this.view.textDirection==Direction.LTR;for(let hf=0,pf=0;pf<this.children.length;pf++){let mf=this.children[pf],gf=hf+mf.length;if(gf>pc)break;if(hf>=Ra){let yf=mf.dom.getBoundingClientRect();if(bo.push(yf.height),uf){let vf=mf.dom.lastChild,bf=vf?clientRectsFor(vf):[];if(bf.length){let Sf=bf[bf.length-1],xf=ff?Sf.right-yf.left:yf.right-Sf.left;xf>df&&(df=xf,this.minWidth=mc,this.minWidthFrom=hf,this.minWidthTo=gf)}}}hf=gf+mf.breakAfter}return bo}textDirectionAt(Ai){let{i:bo}=this.childPos(Ai,1);return getComputedStyle(this.children[bo].dom).direction=="rtl"?Direction.RTL:Direction.LTR}measureTextSize(){for(let mc of this.children)if(mc instanceof LineView){let uf=mc.measureTextSize();if(uf)return uf}let Ai=document.createElement("div"),bo,Ra,pc;return Ai.className="cm-line",Ai.style.width="99999px",Ai.style.position="absolute",Ai.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(Ai);let mc=clientRectsFor(Ai.firstChild)[0];bo=Ai.getBoundingClientRect().height,Ra=mc?mc.width/27:7,pc=mc?mc.height:bo,Ai.remove()}),{lineHeight:bo,charWidth:Ra,textHeight:pc}}childCursor(Ai=this.length){let bo=this.children.length;return bo&&(Ai-=this.children[--bo].length),new ChildCursor(this.children,Ai,bo)}computeBlockGapDeco(){let Ai=[],bo=this.view.viewState;for(let Ra=0,pc=0;;pc++){let mc=pc==bo.viewports.length?null:bo.viewports[pc],uf=mc?mc.from-1:this.length;if(uf>Ra){let df=(bo.lineBlockAt(uf).bottom-bo.lineBlockAt(Ra).top)/this.view.scaleY;Ai.push(Decoration.replace({widget:new BlockGapWidget(df),block:!0,inclusive:!0,isBlockGap:!0}).range(Ra,uf))}if(!mc)break;Ra=mc.to+1}return Decoration.set(Ai)}updateDeco(){let Ai=1,bo=this.view.state.facet(decorations).map(mc=>(this.dynamicDecorationMap[Ai++]=typeof mc=="function")?mc(this.view):mc),Ra=!1,pc=this.view.state.facet(outerDecorations).map((mc,uf)=>{let df=typeof mc=="function";return df&&(Ra=!0),df?mc(this.view):mc});for(pc.length&&(this.dynamicDecorationMap[Ai++]=Ra,bo.push(RangeSet.join(pc))),this.decorations=[this.editContextFormatting,...bo,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];Ai<this.decorations.length;)this.dynamicDecorationMap[Ai++]=!1;return this.decorations}scrollIntoView(Ai){if(Ai.isSnapshot){let hf=this.view.viewState.lineBlockAt(Ai.range.head);this.view.scrollDOM.scrollTop=hf.top-Ai.yMargin,this.view.scrollDOM.scrollLeft=Ai.xMargin;return}for(let hf of this.view.state.facet(scrollHandler))try{if(hf(this.view,Ai.range,Ai))return!0}catch(pf){logException(this.view.state,pf,"scroll handler")}let{range:bo}=Ai,Ra=this.coordsAt(bo.head,bo.empty?bo.assoc:bo.head>bo.anchor?-1:1),pc;if(!Ra)return;!bo.empty&&(pc=this.coordsAt(bo.anchor,bo.anchor>bo.head?-1:1))&&(Ra={left:Math.min(Ra.left,pc.left),top:Math.min(Ra.top,pc.top),right:Math.max(Ra.right,pc.right),bottom:Math.max(Ra.bottom,pc.bottom)});let mc=getScrollMargins(this.view),uf={left:Ra.left-mc.left,top:Ra.top-mc.top,right:Ra.right+mc.right,bottom:Ra.bottom+mc.bottom},{offsetWidth:df,offsetHeight:ff}=this.view.scrollDOM;scrollRectIntoView(this.view.scrollDOM,uf,bo.head<bo.anchor?-1:1,Ai.x,Ai.y,Math.max(Math.min(Ai.xMargin,df),-df),Math.max(Math.min(Ai.yMargin,ff),-ff),this.view.textDirection==Direction.LTR)}}function betweenUneditable(vo){return vo.node.nodeType==1&&vo.node.firstChild&&(vo.offset==0||vo.node.childNodes[vo.offset-1].contentEditable=="false")&&(vo.offset==vo.node.childNodes.length||vo.node.childNodes[vo.offset].contentEditable=="false")}function findCompositionNode(vo,Ai){let bo=vo.observer.selectionRange;if(!bo.focusNode)return null;let Ra=textNodeBefore(bo.focusNode,bo.focusOffset),pc=textNodeAfter(bo.focusNode,bo.focusOffset),mc=Ra||pc;if(pc&&Ra&&pc.node!=Ra.node){let df=ContentView.get(pc.node);if(!df||df instanceof TextView&&df.text!=pc.node.nodeValue)mc=pc;else if(vo.docView.lastCompositionAfterCursor){let ff=ContentView.get(Ra.node);!ff||ff instanceof TextView&&ff.text!=Ra.node.nodeValue||(mc=pc)}}if(vo.docView.lastCompositionAfterCursor=mc!=Ra,!mc)return null;let uf=Ai-mc.offset;return{from:uf,to:uf+mc.node.nodeValue.length,node:mc.node}}function findCompositionRange(vo,Ai,bo){let Ra=findCompositionNode(vo,bo);if(!Ra)return null;let{node:pc,from:mc,to:uf}=Ra,df=pc.nodeValue;if(/[\n\r]/.test(df)||vo.state.doc.sliceString(Ra.from,Ra.to)!=df)return null;let ff=Ai.invertedDesc,hf=new ChangedRange(ff.mapPos(mc),ff.mapPos(uf),mc,uf),pf=[];for(let mf=pc.parentNode;;mf=mf.parentNode){let gf=ContentView.get(mf);if(gf instanceof MarkView)pf.push({node:mf,deco:gf.mark});else{if(gf instanceof LineView||mf.nodeName=="DIV"&&mf.parentNode==vo.contentDOM)return{range:hf,text:pc,marks:pf,line:mf};if(mf!=vo.contentDOM)pf.push({node:mf,deco:new MarkDecoration({inclusive:!0,attributes:getAttrs(mf),tagName:mf.tagName.toLowerCase()})});else return null}}}function nextToUneditable(vo,Ai){return vo.nodeType!=1?0:(Ai&&vo.childNodes[Ai-1].contentEditable=="false"?1:0)|(Ai<vo.childNodes.length&&vo.childNodes[Ai].contentEditable=="false"?2:0)}let DecorationComparator$1=class{constructor(){this.changes=[]}compareRange(vo,Ai){addRange(vo,Ai,this.changes)}comparePoint(vo,Ai){addRange(vo,Ai,this.changes)}boundChange(vo){addRange(vo,vo,this.changes)}};function findChangedDeco(vo,Ai,bo){let Ra=new DecorationComparator$1;return RangeSet.compare(vo,Ai,bo,Ra),Ra.changes}function inUneditable(vo,Ai){for(let bo=vo;bo&&bo!=Ai;bo=bo.assignedSlot||bo.parentNode)if(bo.nodeType==1&&bo.contentEditable=="false")return!0;return!1}function touchesComposition(vo,Ai){let bo=!1;return Ai&&vo.iterChangedRanges((Ra,pc)=>{Ra<Ai.to&&pc>Ai.from&&(bo=!0)}),bo}function groupAt(vo,Ai,bo=1){let Ra=vo.charCategorizer(Ai),pc=vo.doc.lineAt(Ai),mc=Ai-pc.from;if(pc.length==0)return EditorSelection.cursor(Ai);mc==0?bo=1:mc==pc.length&&(bo=-1);let uf=mc,df=mc;bo<0?uf=findClusterBreak(pc.text,mc,!1):df=findClusterBreak(pc.text,mc);let ff=Ra(pc.text.slice(uf,df));for(;uf>0;){let hf=findClusterBreak(pc.text,uf,!1);if(Ra(pc.text.slice(hf,uf))!=ff)break;uf=hf}for(;df<pc.length;){let hf=findClusterBreak(pc.text,df);if(Ra(pc.text.slice(df,hf))!=ff)break;df=hf}return EditorSelection.range(uf+pc.from,df+pc.from)}function getdx(vo,Ai){return Ai.left>vo?Ai.left-vo:Math.max(0,vo-Ai.right)}function getdy(vo,Ai){return Ai.top>vo?Ai.top-vo:Math.max(0,vo-Ai.bottom)}function yOverlap(vo,Ai){return vo.top<Ai.bottom-1&&vo.bottom>Ai.top+1}function upTop(vo,Ai){return Ai<vo.top?{top:Ai,left:vo.left,right:vo.right,bottom:vo.bottom}:vo}function upBot(vo,Ai){return Ai>vo.bottom?{top:vo.top,left:vo.left,right:vo.right,bottom:Ai}:vo}function domPosAtCoords(vo,Ai,bo){let Ra,pc,mc,uf,df=!1,ff,hf,pf,mf;for(let vf=vo.firstChild;vf;vf=vf.nextSibling){let bf=clientRectsFor(vf);for(let Sf=0;Sf<bf.length;Sf++){let xf=bf[Sf];pc&&yOverlap(pc,xf)&&(xf=upTop(upBot(xf,pc.bottom),pc.top));let wf=getdx(Ai,xf),If=getdy(bo,xf);if(wf==0&&If==0)return vf.nodeType==3?domPosInText(vf,Ai,bo):domPosAtCoords(vf,Ai,bo);if(!Ra||uf>If||uf==If&&mc>wf){Ra=vf,pc=xf,mc=wf,uf=If;let l1=If?bo<xf.top?-1:1:wf?Ai<xf.left?-1:1:0;df=!l1||(l1>0?Sf<bf.length-1:Sf>0)}wf==0?bo>xf.bottom&&(!pf||pf.bottom<xf.bottom)?(ff=vf,pf=xf):bo<xf.top&&(!mf||mf.top>xf.top)&&(hf=vf,mf=xf):pf&&yOverlap(pf,xf)?pf=upBot(pf,xf.bottom):mf&&yOverlap(mf,xf)&&(mf=upTop(mf,xf.top))}}if(pf&&pf.bottom>=bo?(Ra=ff,pc=pf):mf&&mf.top<=bo&&(Ra=hf,pc=mf),!Ra)return{node:vo,offset:0};let gf=Math.max(pc.left,Math.min(pc.right,Ai));if(Ra.nodeType==3)return domPosInText(Ra,gf,bo);if(df&&Ra.contentEditable!="false")return domPosAtCoords(Ra,gf,bo);let yf=Array.prototype.indexOf.call(vo.childNodes,Ra)+(Ai>=(pc.left+pc.right)/2?1:0);return{node:vo,offset:yf}}function domPosInText(vo,Ai,bo){let Ra=vo.nodeValue.length,pc=-1,mc=1e9,uf=0;for(let df=0;df<Ra;df++){let ff=textRange(vo,df,df+1).getClientRects();for(let hf=0;hf<ff.length;hf++){let pf=ff[hf];if(pf.top==pf.bottom)continue;uf||(uf=Ai-pf.left);let mf=(pf.top>bo?pf.top-bo:bo-pf.bottom)-1;if(pf.left-1<=Ai&&pf.right+1>=Ai&&mf<mc){let gf=Ai>=(pf.left+pf.right)/2,yf=gf;if((browser.chrome||browser.gecko)&&textRange(vo,df).getBoundingClientRect().left==pf.right&&(yf=!gf),mf<=0)return{node:vo,offset:df+(yf?1:0)};pc=df+(yf?1:0),mc=mf}}}return{node:vo,offset:pc>-1?pc:uf>0?vo.nodeValue.length:0}}function posAtCoords(vo,Ai,bo,Ra=-1){var pc,mc;let uf=vo.contentDOM.getBoundingClientRect(),df=uf.top+vo.viewState.paddingTop,ff,{docHeight:hf}=vo.viewState,{x:pf,y:mf}=Ai,gf=mf-df;if(gf<0)return 0;if(gf>hf)return vo.state.doc.length;for(let l1=vo.viewState.heightOracle.textHeight/2,s1=!1;ff=vo.elementAtHeight(gf),ff.type!=BlockType.Text;)for(;gf=Ra>0?ff.bottom+l1:ff.top-l1,!(gf>=0&&gf<=hf);){if(s1)return bo?null:0;s1=!0,Ra=-Ra}mf=df+gf;let yf=ff.from;if(yf<vo.viewport.from)return vo.viewport.from==0?0:bo?null:posAtCoordsImprecise(vo,uf,ff,pf,mf);if(yf>vo.viewport.to)return vo.viewport.to==vo.state.doc.length?vo.state.doc.length:bo?null:posAtCoordsImprecise(vo,uf,ff,pf,mf);let vf=vo.dom.ownerDocument,bf=vo.root.elementFromPoint?vo.root:vf,Sf=bf.elementFromPoint(pf,mf);Sf&&!vo.contentDOM.contains(Sf)&&(Sf=null),Sf||(pf=Math.max(uf.left+1,Math.min(uf.right-1,pf)),Sf=bf.elementFromPoint(pf,mf),Sf&&!vo.contentDOM.contains(Sf)&&(Sf=null));let xf,wf=-1;if(Sf&&((pc=vo.docView.nearest(Sf))===null||pc===void 0?void 0:pc.isEditable)!=!1){if(vf.caretPositionFromPoint){let l1=vf.caretPositionFromPoint(pf,mf);l1&&({offsetNode:xf,offset:wf}=l1)}else if(vf.caretRangeFromPoint){let l1=vf.caretRangeFromPoint(pf,mf);l1&&({startContainer:xf,startOffset:wf}=l1,(!vo.contentDOM.contains(xf)||browser.safari&&isSuspiciousSafariCaretResult(xf,wf,pf)||browser.chrome&&isSuspiciousChromeCaretResult(xf,wf,pf))&&(xf=void 0))}xf&&(wf=Math.min(maxOffset(xf),wf))}if(!xf||!vo.docView.dom.contains(xf)){let l1=LineView.find(vo.docView,yf);if(!l1)return gf>ff.top+ff.height/2?ff.to:ff.from;({node:xf,offset:wf}=domPosAtCoords(l1.dom,pf,mf))}let If=vo.docView.nearest(xf);if(!If)return null;if(If.isWidget&&((mc=If.dom)===null||mc===void 0?void 0:mc.nodeType)==1){let l1=If.dom.getBoundingClientRect();return Ai.y<l1.top||Ai.y<=l1.bottom&&Ai.x<=(l1.left+l1.right)/2?If.posAtStart:If.posAtEnd}else return If.localPosFromDOM(xf,wf)+If.posAtStart}function posAtCoordsImprecise(vo,Ai,bo,Ra,pc){let mc=Math.round((Ra-Ai.left)*vo.defaultCharacterWidth);if(vo.lineWrapping&&bo.height>vo.defaultLineHeight*1.5){let df=vo.viewState.heightOracle.textHeight,ff=Math.floor((pc-bo.top-(vo.defaultLineHeight-df)*.5)/df);mc+=ff*vo.viewState.heightOracle.lineLength}let uf=vo.state.sliceDoc(bo.from,bo.to);return bo.from+findColumn(uf,mc,vo.state.tabSize)}function isSuspiciousSafariCaretResult(vo,Ai,bo){let Ra;if(vo.nodeType!=3||Ai!=(Ra=vo.nodeValue.length))return!1;for(let pc=vo.nextSibling;pc;pc=pc.nextSibling)if(pc.nodeType!=1||pc.nodeName!="BR")return!1;return textRange(vo,Ra-1,Ra).getBoundingClientRect().left>bo}function isSuspiciousChromeCaretResult(vo,Ai,bo){if(Ai!=0)return!1;for(let pc=vo;;){let mc=pc.parentNode;if(!mc||mc.nodeType!=1||mc.firstChild!=pc)return!1;if(mc.classList.contains("cm-line"))break;pc=mc}let Ra=vo.nodeType==1?vo.getBoundingClientRect():textRange(vo,0,Math.max(vo.nodeValue.length,1)).getBoundingClientRect();return bo-Ra.left>5}function blockAt(vo,Ai){let bo=vo.lineBlockAt(Ai);if(Array.isArray(bo.type)){for(let Ra of bo.type)if(Ra.to>Ai||Ra.to==Ai&&(Ra.to==bo.to||Ra.type==BlockType.Text))return Ra}return bo}function moveToLineBoundary(vo,Ai,bo,Ra){let pc=blockAt(vo,Ai.head),mc=!Ra||pc.type!=BlockType.Text||!(vo.lineWrapping||pc.widgetLineBreaks)?null:vo.coordsAtPos(Ai.assoc<0&&Ai.head>pc.from?Ai.head-1:Ai.head);if(mc){let uf=vo.dom.getBoundingClientRect(),df=vo.textDirectionAt(pc.from),ff=vo.posAtCoords({x:bo==(df==Direction.LTR)?uf.right-1:uf.left+1,y:(mc.top+mc.bottom)/2});if(ff!=null)return EditorSelection.cursor(ff,bo?-1:1)}return EditorSelection.cursor(bo?pc.to:pc.from,bo?-1:1)}function moveByChar(vo,Ai,bo,Ra){let pc=vo.state.doc.lineAt(Ai.head),mc=vo.bidiSpans(pc),uf=vo.textDirectionAt(pc.from);for(let df=Ai,ff=null;;){let hf=moveVisually(pc,mc,uf,df,bo),pf=movedOver;if(!hf){if(pc.number==(bo?vo.state.doc.lines:1))return df;pf=`
|
|
353
|
-
`,pc=vo.state.doc.line(pc.number+(bo?1:-1)),mc=vo.bidiSpans(pc),hf=vo.visualLineSide(pc,!bo)}if(ff){if(!ff(pf))return df}else{if(!Ra)return hf;ff=Ra(pf)}df=hf}}function byGroup(vo,Ai,bo){let Ra=vo.state.charCategorizer(Ai),pc=Ra(bo);return mc=>{let uf=Ra(mc);return pc==CharCategory.Space&&(pc=uf),pc==uf}}function moveVertically(vo,Ai,bo,Ra){let pc=Ai.head,mc=bo?1:-1;if(pc==(bo?vo.state.doc.length:0))return EditorSelection.cursor(pc,Ai.assoc);let uf=Ai.goalColumn,df,ff=vo.contentDOM.getBoundingClientRect(),hf=vo.coordsAtPos(pc,Ai.assoc||-1),pf=vo.documentTop;if(hf)uf==null&&(uf=hf.left-ff.left),df=mc<0?hf.top:hf.bottom;else{let yf=vo.viewState.lineBlockAt(pc);uf==null&&(uf=Math.min(ff.right-ff.left,vo.defaultCharacterWidth*(pc-yf.from))),df=(mc<0?yf.top:yf.bottom)+pf}let mf=ff.left+uf,gf=Ra??vo.viewState.heightOracle.textHeight>>1;for(let yf=0;;yf+=10){let vf=df+(gf+yf)*mc,bf=posAtCoords(vo,{x:mf,y:vf},!1,mc);if(vf<ff.top||vf>ff.bottom||(mc<0?bf<pc:bf>pc)){let Sf=vo.docView.coordsForChar(bf),xf=!Sf||vf<Sf.top?-1:1;return EditorSelection.cursor(bf,xf,void 0,uf)}}}function skipAtomicRanges(vo,Ai,bo){for(;;){let Ra=0;for(let pc of vo)pc.between(Ai-1,Ai+1,(mc,uf,df)=>{if(Ai>mc&&Ai<uf){let ff=Ra||bo||(Ai-mc<uf-Ai?-1:1);Ai=ff<0?mc:uf,Ra=ff}});if(!Ra)return Ai}}function skipAtoms(vo,Ai,bo){let Ra=skipAtomicRanges(vo.state.facet(atomicRanges).map(pc=>pc(vo)),bo.from,Ai.head>bo.from?-1:1);return Ra==bo.from?bo:EditorSelection.cursor(Ra,Ra<bo.from?1:-1)}const LineBreakPlaceholder="";class DOMReader{constructor(Ai,bo){this.points=Ai,this.text="",this.lineSeparator=bo.facet(EditorState.lineSeparator)}append(Ai){this.text+=Ai}lineBreak(){this.text+=LineBreakPlaceholder}readRange(Ai,bo){if(!Ai)return this;let Ra=Ai.parentNode;for(let pc=Ai;;){this.findPointBefore(Ra,pc);let mc=this.text.length;this.readNode(pc);let uf=pc.nextSibling;if(uf==bo)break;let df=ContentView.get(pc),ff=ContentView.get(uf);(df&&ff?df.breakAfter:(df?df.breakAfter:isBlockElement(pc))||isBlockElement(uf)&&(pc.nodeName!="BR"||pc.cmIgnore)&&this.text.length>mc)&&this.lineBreak(),pc=uf}return this.findPointBefore(Ra,bo),this}readTextNode(Ai){let bo=Ai.nodeValue;for(let Ra of this.points)Ra.node==Ai&&(Ra.pos=this.text.length+Math.min(Ra.offset,bo.length));for(let Ra=0,pc=this.lineSeparator?null:/\r\n?|\n/g;;){let mc=-1,uf=1,df;if(this.lineSeparator?(mc=bo.indexOf(this.lineSeparator,Ra),uf=this.lineSeparator.length):(df=pc.exec(bo))&&(mc=df.index,uf=df[0].length),this.append(bo.slice(Ra,mc<0?bo.length:mc)),mc<0)break;if(this.lineBreak(),uf>1)for(let ff of this.points)ff.node==Ai&&ff.pos>this.text.length&&(ff.pos-=uf-1);Ra=mc+uf}}readNode(Ai){if(Ai.cmIgnore)return;let bo=ContentView.get(Ai),Ra=bo&&bo.overrideDOMText;if(Ra!=null){this.findPointInside(Ai,Ra.length);for(let pc=Ra.iter();!pc.next().done;)pc.lineBreak?this.lineBreak():this.append(pc.value)}else Ai.nodeType==3?this.readTextNode(Ai):Ai.nodeName=="BR"?Ai.nextSibling&&this.lineBreak():Ai.nodeType==1&&this.readRange(Ai.firstChild,null)}findPointBefore(Ai,bo){for(let Ra of this.points)Ra.node==Ai&&Ai.childNodes[Ra.offset]==bo&&(Ra.pos=this.text.length)}findPointInside(Ai,bo){for(let Ra of this.points)(Ai.nodeType==3?Ra.node==Ai:Ai.contains(Ra.node))&&(Ra.pos=this.text.length+(isAtEnd(Ai,Ra.node,Ra.offset)?bo:0))}}function isAtEnd(vo,Ai,bo){for(;;){if(!Ai||bo<maxOffset(Ai))return!1;if(Ai==vo)return!0;bo=domIndex(Ai)+1,Ai=Ai.parentNode}}class DOMPoint{constructor(Ai,bo){this.node=Ai,this.offset=bo,this.pos=-1}}class DOMChange{constructor(Ai,bo,Ra,pc){this.typeOver=pc,this.bounds=null,this.text="",this.domChanged=bo>-1;let{impreciseHead:mc,impreciseAnchor:uf}=Ai.docView;if(Ai.state.readOnly&&bo>-1)this.newSel=null;else if(bo>-1&&(this.bounds=Ai.docView.domBoundsAround(bo,Ra,0))){let df=mc||uf?[]:selectionPoints(Ai),ff=new DOMReader(df,Ai.state);ff.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=ff.text,this.newSel=selectionFromPoints(df,this.bounds.from)}else{let df=Ai.observer.selectionRange,ff=mc&&mc.node==df.focusNode&&mc.offset==df.focusOffset||!contains(Ai.contentDOM,df.focusNode)?Ai.state.selection.main.head:Ai.docView.posFromDOM(df.focusNode,df.focusOffset),hf=uf&&uf.node==df.anchorNode&&uf.offset==df.anchorOffset||!contains(Ai.contentDOM,df.anchorNode)?Ai.state.selection.main.anchor:Ai.docView.posFromDOM(df.anchorNode,df.anchorOffset),pf=Ai.viewport;if((browser.ios||browser.chrome)&&Ai.state.selection.main.empty&&ff!=hf&&(pf.from>0||pf.to<Ai.state.doc.length)){let mf=Math.min(ff,hf),gf=Math.max(ff,hf),yf=pf.from-mf,vf=pf.to-gf;(yf==0||yf==1||mf==0)&&(vf==0||vf==-1||gf==Ai.state.doc.length)&&(ff=0,hf=Ai.state.doc.length)}this.newSel=EditorSelection.single(hf,ff)}}}function applyDOMChange(vo,Ai){let bo,{newSel:Ra}=Ai,pc=vo.state.selection.main,mc=vo.inputState.lastKeyTime>Date.now()-100?vo.inputState.lastKeyCode:-1;if(Ai.bounds){let{from:uf,to:df}=Ai.bounds,ff=pc.from,hf=null;(mc===8||browser.android&&Ai.text.length<df-uf)&&(ff=pc.to,hf="end");let pf=findDiff(vo.state.doc.sliceString(uf,df,LineBreakPlaceholder),Ai.text,ff-uf,hf);pf&&(browser.chrome&&mc==13&&pf.toB==pf.from+2&&Ai.text.slice(pf.from,pf.toB)==LineBreakPlaceholder+LineBreakPlaceholder&&pf.toB--,bo={from:uf+pf.from,to:uf+pf.toA,insert:Text.of(Ai.text.slice(pf.from,pf.toB).split(LineBreakPlaceholder))})}else Ra&&(!vo.hasFocus&&vo.state.facet(editable)||Ra.main.eq(pc))&&(Ra=null);if(!bo&&!Ra)return!1;if(!bo&&Ai.typeOver&&!pc.empty&&Ra&&Ra.main.empty?bo={from:pc.from,to:pc.to,insert:vo.state.doc.slice(pc.from,pc.to)}:bo&&bo.from>=pc.from&&bo.to<=pc.to&&(bo.from!=pc.from||bo.to!=pc.to)&&pc.to-pc.from-(bo.to-bo.from)<=4?bo={from:pc.from,to:pc.to,insert:vo.state.doc.slice(pc.from,bo.from).append(bo.insert).append(vo.state.doc.slice(bo.to,pc.to))}:(browser.mac||browser.android)&&bo&&bo.from==bo.to&&bo.from==pc.head-1&&/^\. ?$/.test(bo.insert.toString())&&vo.contentDOM.getAttribute("autocorrect")=="off"?(Ra&&bo.insert.length==2&&(Ra=EditorSelection.single(Ra.main.anchor-1,Ra.main.head-1)),bo={from:pc.from,to:pc.to,insert:Text.of([" "])}):browser.chrome&&bo&&bo.from==bo.to&&bo.from==pc.head&&bo.insert.toString()==`
|
|
354
|
-
`&&vo.lineWrapping&&(Ra&&(Ra=EditorSelection.single(Ra.main.anchor-1,Ra.main.head-1)),bo={from:pc.from,to:pc.to,insert:Text.of([" "])}),bo)return applyDOMChangeInner(vo,bo,Ra,mc);if(Ra&&!Ra.main.eq(pc)){let uf=!1,df="select";return vo.inputState.lastSelectionTime>Date.now()-50&&(vo.inputState.lastSelectionOrigin=="select"&&(uf=!0),df=vo.inputState.lastSelectionOrigin),vo.dispatch({selection:Ra,scrollIntoView:uf,userEvent:df}),!0}else return!1}function applyDOMChangeInner(vo,Ai,bo,Ra=-1){if(browser.ios&&vo.inputState.flushIOSKey(Ai))return!0;let pc=vo.state.selection.main;if(browser.android&&(Ai.to==pc.to&&(Ai.from==pc.from||Ai.from==pc.from-1&&vo.state.sliceDoc(Ai.from,pc.from)==" ")&&Ai.insert.length==1&&Ai.insert.lines==2&&dispatchKey(vo.contentDOM,"Enter",13)||(Ai.from==pc.from-1&&Ai.to==pc.to&&Ai.insert.length==0||Ra==8&&Ai.insert.length<Ai.to-Ai.from&&Ai.to>pc.head)&&dispatchKey(vo.contentDOM,"Backspace",8)||Ai.from==pc.from&&Ai.to==pc.to+1&&Ai.insert.length==0&&dispatchKey(vo.contentDOM,"Delete",46)))return!0;let mc=Ai.insert.toString();vo.inputState.composing>=0&&vo.inputState.composing++;let uf,df=()=>uf||(uf=applyDefaultInsert(vo,Ai,bo));return vo.state.facet(inputHandler$1).some(ff=>ff(vo,Ai.from,Ai.to,mc,df))||vo.dispatch(df()),!0}function applyDefaultInsert(vo,Ai,bo){let Ra,pc=vo.state,mc=pc.selection.main;if(Ai.from>=mc.from&&Ai.to<=mc.to&&Ai.to-Ai.from>=(mc.to-mc.from)/3&&(!bo||bo.main.empty&&bo.main.from==Ai.from+Ai.insert.length)&&vo.inputState.composing<0){let df=mc.from<Ai.from?pc.sliceDoc(mc.from,Ai.from):"",ff=mc.to>Ai.to?pc.sliceDoc(Ai.to,mc.to):"";Ra=pc.replaceSelection(vo.state.toText(df+Ai.insert.sliceString(0,void 0,vo.state.lineBreak)+ff))}else{let df=pc.changes(Ai),ff=bo&&bo.main.to<=df.newLength?bo.main:void 0;if(pc.selection.ranges.length>1&&vo.inputState.composing>=0&&Ai.to<=mc.to&&Ai.to>=mc.to-10){let hf=vo.state.sliceDoc(Ai.from,Ai.to),pf,mf=bo&&findCompositionNode(vo,bo.main.head);if(mf){let vf=Ai.insert.length-(Ai.to-Ai.from);pf={from:mf.from,to:mf.to-vf}}else pf=vo.state.doc.lineAt(mc.head);let gf=mc.to-Ai.to,yf=mc.to-mc.from;Ra=pc.changeByRange(vf=>{if(vf.from==mc.from&&vf.to==mc.to)return{changes:df,range:ff||vf.map(df)};let bf=vf.to-gf,Sf=bf-hf.length;if(vf.to-vf.from!=yf||vo.state.sliceDoc(Sf,bf)!=hf||vf.to>=pf.from&&vf.from<=pf.to)return{range:vf};let xf=pc.changes({from:Sf,to:bf,insert:Ai.insert}),wf=vf.to-mc.to;return{changes:xf,range:ff?EditorSelection.range(Math.max(0,ff.anchor+wf),Math.max(0,ff.head+wf)):vf.map(xf)}})}else Ra={changes:df,selection:ff&&pc.selection.replaceRange(ff)}}let uf="input.type";return(vo.composing||vo.inputState.compositionPendingChange&&vo.inputState.compositionEndedAt>Date.now()-50)&&(vo.inputState.compositionPendingChange=!1,uf+=".compose",vo.inputState.compositionFirstChange&&(uf+=".start",vo.inputState.compositionFirstChange=!1)),pc.update(Ra,{userEvent:uf,scrollIntoView:!0})}function findDiff(vo,Ai,bo,Ra){let pc=Math.min(vo.length,Ai.length),mc=0;for(;mc<pc&&vo.charCodeAt(mc)==Ai.charCodeAt(mc);)mc++;if(mc==pc&&vo.length==Ai.length)return null;let uf=vo.length,df=Ai.length;for(;uf>0&&df>0&&vo.charCodeAt(uf-1)==Ai.charCodeAt(df-1);)uf--,df--;if(Ra=="end"){let ff=Math.max(0,mc-Math.min(uf,df));bo-=uf+ff-mc}if(uf<mc&&vo.length<Ai.length){let ff=bo<=mc&&bo>=uf?mc-bo:0;mc-=ff,df=mc+(df-uf),uf=mc}else if(df<mc){let ff=bo<=mc&&bo>=df?mc-bo:0;mc-=ff,uf=mc+(uf-df),df=mc}return{from:mc,toA:uf,toB:df}}function selectionPoints(vo){let Ai=[];if(vo.root.activeElement!=vo.contentDOM)return Ai;let{anchorNode:bo,anchorOffset:Ra,focusNode:pc,focusOffset:mc}=vo.observer.selectionRange;return bo&&(Ai.push(new DOMPoint(bo,Ra)),(pc!=bo||mc!=Ra)&&Ai.push(new DOMPoint(pc,mc))),Ai}function selectionFromPoints(vo,Ai){if(vo.length==0)return null;let bo=vo[0].pos,Ra=vo.length==2?vo[1].pos:bo;return bo>-1&&Ra>-1?EditorSelection.single(bo+Ai,Ra+Ai):null}class InputState{setSelectionOrigin(Ai){this.lastSelectionOrigin=Ai,this.lastSelectionTime=Date.now()}constructor(Ai){this.view=Ai,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=Ai.hasFocus,browser.safari&&Ai.contentDOM.addEventListener("input",()=>null),browser.gecko&&firefoxCopyCutHack(Ai.contentDOM.ownerDocument)}handleEvent(Ai){!eventBelongsToEditor(this.view,Ai)||this.ignoreDuringComposition(Ai)||Ai.type=="keydown"&&this.keydown(Ai)||this.runHandlers(Ai.type,Ai)}runHandlers(Ai,bo){let Ra=this.handlers[Ai];if(Ra){for(let pc of Ra.observers)pc(this.view,bo);for(let pc of Ra.handlers){if(bo.defaultPrevented)break;if(pc(this.view,bo)){bo.preventDefault();break}}}}ensureHandlers(Ai){let bo=computeHandlers(Ai),Ra=this.handlers,pc=this.view.contentDOM;for(let mc in bo)if(mc!="scroll"){let uf=!bo[mc].handlers.length,df=Ra[mc];df&&uf!=!df.handlers.length&&(pc.removeEventListener(mc,this.handleEvent),df=null),df||pc.addEventListener(mc,this.handleEvent,{passive:uf})}for(let mc in Ra)mc!="scroll"&&!bo[mc]&&pc.removeEventListener(mc,this.handleEvent);this.handlers=bo}keydown(Ai){if(this.lastKeyCode=Ai.keyCode,this.lastKeyTime=Date.now(),Ai.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&Ai.keyCode!=27&&modifierCodes.indexOf(Ai.keyCode)<0&&(this.tabFocusMode=-1),browser.android&&browser.chrome&&!Ai.synthetic&&(Ai.keyCode==13||Ai.keyCode==8))return this.view.observer.delayAndroidKey(Ai.key,Ai.keyCode),!0;let bo;return browser.ios&&!Ai.synthetic&&!Ai.altKey&&!Ai.metaKey&&((bo=PendingKeys.find(Ra=>Ra.keyCode==Ai.keyCode))&&!Ai.ctrlKey||EmacsyPendingKeys.indexOf(Ai.key)>-1&&Ai.ctrlKey&&!Ai.shiftKey)?(this.pendingIOSKey=bo||Ai,setTimeout(()=>this.flushIOSKey(),250),!0):(Ai.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(Ai){let bo=this.pendingIOSKey;return!bo||bo.key=="Enter"&&Ai&&Ai.from<Ai.to&&/^\S+$/.test(Ai.insert.toString())?!1:(this.pendingIOSKey=void 0,dispatchKey(this.view.contentDOM,bo.key,bo.keyCode,bo instanceof KeyboardEvent?bo:void 0))}ignoreDuringComposition(Ai){return/^key/.test(Ai.type)?this.composing>0?!0:browser.safari&&!browser.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(Ai){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=Ai}update(Ai){this.view.observer.update(Ai),this.mouseSelection&&this.mouseSelection.update(Ai),this.draggedContent&&Ai.docChanged&&(this.draggedContent=this.draggedContent.map(Ai.changes)),Ai.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function bindHandler(vo,Ai){return(bo,Ra)=>{try{return Ai.call(vo,Ra,bo)}catch(pc){logException(bo.state,pc)}}}function computeHandlers(vo){let Ai=Object.create(null);function bo(Ra){return Ai[Ra]||(Ai[Ra]={observers:[],handlers:[]})}for(let Ra of vo){let pc=Ra.spec;if(pc&&pc.domEventHandlers)for(let mc in pc.domEventHandlers){let uf=pc.domEventHandlers[mc];uf&&bo(mc).handlers.push(bindHandler(Ra.value,uf))}if(pc&&pc.domEventObservers)for(let mc in pc.domEventObservers){let uf=pc.domEventObservers[mc];uf&&bo(mc).observers.push(bindHandler(Ra.value,uf))}}for(let Ra in handlers)bo(Ra).handlers.push(handlers[Ra]);for(let Ra in observers)bo(Ra).observers.push(observers[Ra]);return Ai}const PendingKeys=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],EmacsyPendingKeys="dthko",modifierCodes=[16,17,18,20,91,92,224,225],dragScrollMargin=6;function dragScrollSpeed(vo){return Math.max(0,vo)*.7+8}function dist(vo,Ai){return Math.max(Math.abs(vo.clientX-Ai.clientX),Math.abs(vo.clientY-Ai.clientY))}class MouseSelection{constructor(Ai,bo,Ra,pc){this.view=Ai,this.startEvent=bo,this.style=Ra,this.mustSelect=pc,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=bo,this.scrollParents=scrollableParents(Ai.contentDOM),this.atoms=Ai.state.facet(atomicRanges).map(uf=>uf(Ai));let mc=Ai.contentDOM.ownerDocument;mc.addEventListener("mousemove",this.move=this.move.bind(this)),mc.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=bo.shiftKey,this.multiple=Ai.state.facet(EditorState.allowMultipleSelections)&&addsSelectionRange(Ai,bo),this.dragging=isInPrimarySelection(Ai,bo)&&getClickType(bo)==1?null:!1}start(Ai){this.dragging===!1&&this.select(Ai)}move(Ai){if(Ai.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&dist(this.startEvent,Ai)<10)return;this.select(this.lastEvent=Ai);let bo=0,Ra=0,pc=0,mc=0,uf=this.view.win.innerWidth,df=this.view.win.innerHeight;this.scrollParents.x&&({left:pc,right:uf}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:mc,bottom:df}=this.scrollParents.y.getBoundingClientRect());let ff=getScrollMargins(this.view);Ai.clientX-ff.left<=pc+dragScrollMargin?bo=-dragScrollSpeed(pc-Ai.clientX):Ai.clientX+ff.right>=uf-dragScrollMargin&&(bo=dragScrollSpeed(Ai.clientX-uf)),Ai.clientY-ff.top<=mc+dragScrollMargin?Ra=-dragScrollSpeed(mc-Ai.clientY):Ai.clientY+ff.bottom>=df-dragScrollMargin&&(Ra=dragScrollSpeed(Ai.clientY-df)),this.setScrollSpeed(bo,Ra)}up(Ai){this.dragging==null&&this.select(this.lastEvent),this.dragging||Ai.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let Ai=this.view.contentDOM.ownerDocument;Ai.removeEventListener("mousemove",this.move),Ai.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(Ai,bo){this.scrollSpeed={x:Ai,y:bo},Ai||bo?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:Ai,y:bo}=this.scrollSpeed;Ai&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=Ai,Ai=0),bo&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=bo,bo=0),(Ai||bo)&&this.view.win.scrollBy(Ai,bo),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(Ai){let bo=null;for(let Ra=0;Ra<Ai.ranges.length;Ra++){let pc=Ai.ranges[Ra],mc=null;if(pc.empty){let uf=skipAtomicRanges(this.atoms,pc.from,0);uf!=pc.from&&(mc=EditorSelection.cursor(uf,-1))}else{let uf=skipAtomicRanges(this.atoms,pc.from,-1),df=skipAtomicRanges(this.atoms,pc.to,1);(uf!=pc.from||df!=pc.to)&&(mc=EditorSelection.range(pc.from==pc.anchor?uf:df,pc.from==pc.head?uf:df))}mc&&(bo||(bo=Ai.ranges.slice()),bo[Ra]=mc)}return bo?EditorSelection.create(bo,Ai.mainIndex):Ai}select(Ai){let{view:bo}=this,Ra=this.skipAtoms(this.style.get(Ai,this.extend,this.multiple));(this.mustSelect||!Ra.eq(bo.state.selection,this.dragging===!1))&&this.view.dispatch({selection:Ra,userEvent:"select.pointer"}),this.mustSelect=!1}update(Ai){Ai.transactions.some(bo=>bo.isUserEvent("input.type"))?this.destroy():this.style.update(Ai)&&setTimeout(()=>this.select(this.lastEvent),20)}}function addsSelectionRange(vo,Ai){let bo=vo.state.facet(clickAddsSelectionRange);return bo.length?bo[0](Ai):browser.mac?Ai.metaKey:Ai.ctrlKey}function dragMovesSelection(vo,Ai){let bo=vo.state.facet(dragMovesSelection$1);return bo.length?bo[0](Ai):browser.mac?!Ai.altKey:!Ai.ctrlKey}function isInPrimarySelection(vo,Ai){let{main:bo}=vo.state.selection;if(bo.empty)return!1;let Ra=getSelection(vo.root);if(!Ra||Ra.rangeCount==0)return!0;let pc=Ra.getRangeAt(0).getClientRects();for(let mc=0;mc<pc.length;mc++){let uf=pc[mc];if(uf.left<=Ai.clientX&&uf.right>=Ai.clientX&&uf.top<=Ai.clientY&&uf.bottom>=Ai.clientY)return!0}return!1}function eventBelongsToEditor(vo,Ai){if(!Ai.bubbles)return!0;if(Ai.defaultPrevented)return!1;for(let bo=Ai.target,Ra;bo!=vo.contentDOM;bo=bo.parentNode)if(!bo||bo.nodeType==11||(Ra=ContentView.get(bo))&&Ra.ignoreEvent(Ai))return!1;return!0}const handlers=Object.create(null),observers=Object.create(null),brokenClipboardAPI=browser.ie&&browser.ie_version<15||browser.ios&&browser.webkit_version<604;function capturePaste(vo){let Ai=vo.dom.parentNode;if(!Ai)return;let bo=Ai.appendChild(document.createElement("textarea"));bo.style.cssText="position: fixed; left: -10000px; top: 10px",bo.focus(),setTimeout(()=>{vo.focus(),bo.remove(),doPaste(vo,bo.value)},50)}function textFilter(vo,Ai,bo){for(let Ra of vo.facet(Ai))bo=Ra(bo,vo);return bo}function doPaste(vo,Ai){Ai=textFilter(vo.state,clipboardInputFilter,Ai);let{state:bo}=vo,Ra,pc=1,mc=bo.toText(Ai),uf=mc.lines==bo.selection.ranges.length;if(lastLinewiseCopy!=null&&bo.selection.ranges.every(df=>df.empty)&&lastLinewiseCopy==mc.toString()){let df=-1;Ra=bo.changeByRange(ff=>{let hf=bo.doc.lineAt(ff.from);if(hf.from==df)return{range:ff};df=hf.from;let pf=bo.toText((uf?mc.line(pc++).text:Ai)+bo.lineBreak);return{changes:{from:hf.from,insert:pf},range:EditorSelection.cursor(ff.from+pf.length)}})}else uf?Ra=bo.changeByRange(df=>{let ff=mc.line(pc++);return{changes:{from:df.from,to:df.to,insert:ff.text},range:EditorSelection.cursor(df.from+ff.length)}}):Ra=bo.replaceSelection(mc);vo.dispatch(Ra,{userEvent:"input.paste",scrollIntoView:!0})}observers.scroll=vo=>{vo.inputState.lastScrollTop=vo.scrollDOM.scrollTop,vo.inputState.lastScrollLeft=vo.scrollDOM.scrollLeft};handlers.keydown=(vo,Ai)=>(vo.inputState.setSelectionOrigin("select"),Ai.keyCode==27&&vo.inputState.tabFocusMode!=0&&(vo.inputState.tabFocusMode=Date.now()+2e3),!1);observers.touchstart=(vo,Ai)=>{vo.inputState.lastTouchTime=Date.now(),vo.inputState.setSelectionOrigin("select.pointer")};observers.touchmove=vo=>{vo.inputState.setSelectionOrigin("select.pointer")};handlers.mousedown=(vo,Ai)=>{if(vo.observer.flush(),vo.inputState.lastTouchTime>Date.now()-2e3)return!1;let bo=null;for(let Ra of vo.state.facet(mouseSelectionStyle))if(bo=Ra(vo,Ai),bo)break;if(!bo&&Ai.button==0&&(bo=basicMouseSelection(vo,Ai)),bo){let Ra=!vo.hasFocus;vo.inputState.startMouseSelection(new MouseSelection(vo,Ai,bo,Ra)),Ra&&vo.observer.ignore(()=>{focusPreventScroll(vo.contentDOM);let mc=vo.root.activeElement;mc&&!mc.contains(vo.contentDOM)&&mc.blur()});let pc=vo.inputState.mouseSelection;if(pc)return pc.start(Ai),pc.dragging===!1}return!1};function rangeForClick(vo,Ai,bo,Ra){if(Ra==1)return EditorSelection.cursor(Ai,bo);if(Ra==2)return groupAt(vo.state,Ai,bo);{let pc=LineView.find(vo.docView,Ai),mc=vo.state.doc.lineAt(pc?pc.posAtEnd:Ai),uf=pc?pc.posAtStart:mc.from,df=pc?pc.posAtEnd:mc.to;return df<vo.state.doc.length&&df==mc.to&&df++,EditorSelection.range(uf,df)}}let inside=(vo,Ai,bo)=>Ai>=bo.top&&Ai<=bo.bottom&&vo>=bo.left&&vo<=bo.right;function findPositionSide(vo,Ai,bo,Ra){let pc=LineView.find(vo.docView,Ai);if(!pc)return 1;let mc=Ai-pc.posAtStart;if(mc==0)return 1;if(mc==pc.length)return-1;let uf=pc.coordsAt(mc,-1);if(uf&&inside(bo,Ra,uf))return-1;let df=pc.coordsAt(mc,1);return df&&inside(bo,Ra,df)?1:uf&&uf.bottom>=Ra?-1:1}function queryPos(vo,Ai){let bo=vo.posAtCoords({x:Ai.clientX,y:Ai.clientY},!1);return{pos:bo,bias:findPositionSide(vo,bo,Ai.clientX,Ai.clientY)}}const BadMouseDetail=browser.ie&&browser.ie_version<=11;let lastMouseDown=null,lastMouseDownCount=0,lastMouseDownTime=0;function getClickType(vo){if(!BadMouseDetail)return vo.detail;let Ai=lastMouseDown,bo=lastMouseDownTime;return lastMouseDown=vo,lastMouseDownTime=Date.now(),lastMouseDownCount=!Ai||bo>Date.now()-400&&Math.abs(Ai.clientX-vo.clientX)<2&&Math.abs(Ai.clientY-vo.clientY)<2?(lastMouseDownCount+1)%3:1}function basicMouseSelection(vo,Ai){let bo=queryPos(vo,Ai),Ra=getClickType(Ai),pc=vo.state.selection;return{update(mc){mc.docChanged&&(bo.pos=mc.changes.mapPos(bo.pos),pc=pc.map(mc.changes))},get(mc,uf,df){let ff=queryPos(vo,mc),hf,pf=rangeForClick(vo,ff.pos,ff.bias,Ra);if(bo.pos!=ff.pos&&!uf){let mf=rangeForClick(vo,bo.pos,bo.bias,Ra),gf=Math.min(mf.from,pf.from),yf=Math.max(mf.to,pf.to);pf=gf<pf.from?EditorSelection.range(gf,yf):EditorSelection.range(yf,gf)}return uf?pc.replaceRange(pc.main.extend(pf.from,pf.to)):df&&Ra==1&&pc.ranges.length>1&&(hf=removeRangeAround(pc,ff.pos))?hf:df?pc.addRange(pf):EditorSelection.create([pf])}}}function removeRangeAround(vo,Ai){for(let bo=0;bo<vo.ranges.length;bo++){let{from:Ra,to:pc}=vo.ranges[bo];if(Ra<=Ai&&pc>=Ai)return EditorSelection.create(vo.ranges.slice(0,bo).concat(vo.ranges.slice(bo+1)),vo.mainIndex==bo?0:vo.mainIndex-(vo.mainIndex>bo?1:0))}return null}handlers.dragstart=(vo,Ai)=>{let{selection:{main:bo}}=vo.state;if(Ai.target.draggable){let pc=vo.docView.nearest(Ai.target);if(pc&&pc.isWidget){let mc=pc.posAtStart,uf=mc+pc.length;(mc>=bo.to||uf<=bo.from)&&(bo=EditorSelection.range(mc,uf))}}let{inputState:Ra}=vo;return Ra.mouseSelection&&(Ra.mouseSelection.dragging=!0),Ra.draggedContent=bo,Ai.dataTransfer&&(Ai.dataTransfer.setData("Text",textFilter(vo.state,clipboardOutputFilter,vo.state.sliceDoc(bo.from,bo.to))),Ai.dataTransfer.effectAllowed="copyMove"),!1};handlers.dragend=vo=>(vo.inputState.draggedContent=null,!1);function dropText(vo,Ai,bo,Ra){if(bo=textFilter(vo.state,clipboardInputFilter,bo),!bo)return;let pc=vo.posAtCoords({x:Ai.clientX,y:Ai.clientY},!1),{draggedContent:mc}=vo.inputState,uf=Ra&&mc&&dragMovesSelection(vo,Ai)?{from:mc.from,to:mc.to}:null,df={from:pc,insert:bo},ff=vo.state.changes(uf?[uf,df]:df);vo.focus(),vo.dispatch({changes:ff,selection:{anchor:ff.mapPos(pc,-1),head:ff.mapPos(pc,1)},userEvent:uf?"move.drop":"input.drop"}),vo.inputState.draggedContent=null}handlers.drop=(vo,Ai)=>{if(!Ai.dataTransfer)return!1;if(vo.state.readOnly)return!0;let bo=Ai.dataTransfer.files;if(bo&&bo.length){let Ra=Array(bo.length),pc=0,mc=()=>{++pc==bo.length&&dropText(vo,Ai,Ra.filter(uf=>uf!=null).join(vo.state.lineBreak),!1)};for(let uf=0;uf<bo.length;uf++){let df=new FileReader;df.onerror=mc,df.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(df.result)||(Ra[uf]=df.result),mc()},df.readAsText(bo[uf])}return!0}else{let Ra=Ai.dataTransfer.getData("Text");if(Ra)return dropText(vo,Ai,Ra,!0),!0}return!1};handlers.paste=(vo,Ai)=>{if(vo.state.readOnly)return!0;vo.observer.flush();let bo=brokenClipboardAPI?null:Ai.clipboardData;return bo?(doPaste(vo,bo.getData("text/plain")||bo.getData("text/uri-list")),!0):(capturePaste(vo),!1)};function captureCopy(vo,Ai){let bo=vo.dom.parentNode;if(!bo)return;let Ra=bo.appendChild(document.createElement("textarea"));Ra.style.cssText="position: fixed; left: -10000px; top: 10px",Ra.value=Ai,Ra.focus(),Ra.selectionEnd=Ai.length,Ra.selectionStart=0,setTimeout(()=>{Ra.remove(),vo.focus()},50)}function copiedRange(vo){let Ai=[],bo=[],Ra=!1;for(let pc of vo.selection.ranges)pc.empty||(Ai.push(vo.sliceDoc(pc.from,pc.to)),bo.push(pc));if(!Ai.length){let pc=-1;for(let{from:mc}of vo.selection.ranges){let uf=vo.doc.lineAt(mc);uf.number>pc&&(Ai.push(uf.text),bo.push({from:uf.from,to:Math.min(vo.doc.length,uf.to+1)})),pc=uf.number}Ra=!0}return{text:textFilter(vo,clipboardOutputFilter,Ai.join(vo.lineBreak)),ranges:bo,linewise:Ra}}let lastLinewiseCopy=null;handlers.copy=handlers.cut=(vo,Ai)=>{let{text:bo,ranges:Ra,linewise:pc}=copiedRange(vo.state);if(!bo&&!pc)return!1;lastLinewiseCopy=pc?bo:null,Ai.type=="cut"&&!vo.state.readOnly&&vo.dispatch({changes:Ra,scrollIntoView:!0,userEvent:"delete.cut"});let mc=brokenClipboardAPI?null:Ai.clipboardData;return mc?(mc.clearData(),mc.setData("text/plain",bo),!0):(captureCopy(vo,bo),!1)};const isFocusChange=Annotation.define();function focusChangeTransaction(vo,Ai){let bo=[];for(let Ra of vo.facet(focusChangeEffect)){let pc=Ra(vo,Ai);pc&&bo.push(pc)}return bo?vo.update({effects:bo,annotations:isFocusChange.of(!0)}):null}function updateForFocusChange(vo){setTimeout(()=>{let Ai=vo.hasFocus;if(Ai!=vo.inputState.notifiedFocused){let bo=focusChangeTransaction(vo.state,Ai);bo?vo.dispatch(bo):vo.update([])}},10)}observers.focus=vo=>{vo.inputState.lastFocusTime=Date.now(),!vo.scrollDOM.scrollTop&&(vo.inputState.lastScrollTop||vo.inputState.lastScrollLeft)&&(vo.scrollDOM.scrollTop=vo.inputState.lastScrollTop,vo.scrollDOM.scrollLeft=vo.inputState.lastScrollLeft),updateForFocusChange(vo)};observers.blur=vo=>{vo.observer.clearSelectionRange(),updateForFocusChange(vo)};observers.compositionstart=observers.compositionupdate=vo=>{vo.observer.editContext||(vo.inputState.compositionFirstChange==null&&(vo.inputState.compositionFirstChange=!0),vo.inputState.composing<0&&(vo.inputState.composing=0))};observers.compositionend=vo=>{vo.observer.editContext||(vo.inputState.composing=-1,vo.inputState.compositionEndedAt=Date.now(),vo.inputState.compositionPendingKey=!0,vo.inputState.compositionPendingChange=vo.observer.pendingRecords().length>0,vo.inputState.compositionFirstChange=null,browser.chrome&&browser.android?vo.observer.flushSoon():vo.inputState.compositionPendingChange?Promise.resolve().then(()=>vo.observer.flush()):setTimeout(()=>{vo.inputState.composing<0&&vo.docView.hasComposition&&vo.update([])},50))};observers.contextmenu=vo=>{vo.inputState.lastContextMenu=Date.now()};handlers.beforeinput=(vo,Ai)=>{var bo,Ra;if(Ai.inputType=="insertReplacementText"&&vo.observer.editContext){let mc=(bo=Ai.dataTransfer)===null||bo===void 0?void 0:bo.getData("text/plain"),uf=Ai.getTargetRanges();if(mc&&uf.length){let df=uf[0],ff=vo.posAtDOM(df.startContainer,df.startOffset),hf=vo.posAtDOM(df.endContainer,df.endOffset);return applyDOMChangeInner(vo,{from:ff,to:hf,insert:vo.state.toText(mc)},null),!0}}let pc;if(browser.chrome&&browser.android&&(pc=PendingKeys.find(mc=>mc.inputType==Ai.inputType))&&(vo.observer.delayAndroidKey(pc.key,pc.keyCode),pc.key=="Backspace"||pc.key=="Delete")){let mc=((Ra=window.visualViewport)===null||Ra===void 0?void 0:Ra.height)||0;setTimeout(()=>{var uf;(((uf=window.visualViewport)===null||uf===void 0?void 0:uf.height)||0)>mc+10&&vo.hasFocus&&(vo.contentDOM.blur(),vo.focus())},100)}return browser.ios&&Ai.inputType=="deleteContentForward"&&vo.observer.flushSoon(),browser.safari&&Ai.inputType=="insertText"&&vo.inputState.composing>=0&&setTimeout(()=>observers.compositionend(vo,Ai),20),!1};const appliedFirefoxHack=new Set;function firefoxCopyCutHack(vo){appliedFirefoxHack.has(vo)||(appliedFirefoxHack.add(vo),vo.addEventListener("copy",()=>{}),vo.addEventListener("cut",()=>{}))}const wrappingWhiteSpace=["pre-wrap","normal","pre-line","break-spaces"];let heightChangeFlag=!1;function clearHeightChangeFlag(){heightChangeFlag=!1}class HeightOracle{constructor(Ai){this.lineWrapping=Ai,this.doc=Text.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(Ai,bo){let Ra=this.doc.lineAt(bo).number-this.doc.lineAt(Ai).number+1;return this.lineWrapping&&(Ra+=Math.max(0,Math.ceil((bo-Ai-Ra*this.lineLength*.5)/this.lineLength))),this.lineHeight*Ra}heightForLine(Ai){return this.lineWrapping?(1+Math.max(0,Math.ceil((Ai-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(Ai){return this.doc=Ai,this}mustRefreshForWrapping(Ai){return wrappingWhiteSpace.indexOf(Ai)>-1!=this.lineWrapping}mustRefreshForHeights(Ai){let bo=!1;for(let Ra=0;Ra<Ai.length;Ra++){let pc=Ai[Ra];pc<0?Ra++:this.heightSamples[Math.floor(pc*10)]||(bo=!0,this.heightSamples[Math.floor(pc*10)]=!0)}return bo}refresh(Ai,bo,Ra,pc,mc,uf){let df=wrappingWhiteSpace.indexOf(Ai)>-1,ff=Math.round(bo)!=Math.round(this.lineHeight)||this.lineWrapping!=df;if(this.lineWrapping=df,this.lineHeight=bo,this.charWidth=Ra,this.textHeight=pc,this.lineLength=mc,ff){this.heightSamples={};for(let hf=0;hf<uf.length;hf++){let pf=uf[hf];pf<0?hf++:this.heightSamples[Math.floor(pf*10)]=!0}}return ff}}class MeasuredHeights{constructor(Ai,bo){this.from=Ai,this.heights=bo,this.index=0}get more(){return this.index<this.heights.length}}class BlockInfo{constructor(Ai,bo,Ra,pc,mc){this.from=Ai,this.length=bo,this.top=Ra,this.height=pc,this._content=mc}get type(){return typeof this._content=="number"?BlockType.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof PointDecoration?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(Ai){let bo=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(Ai._content)?Ai._content:[Ai]);return new BlockInfo(this.from,this.length+Ai.length,this.top,this.height+Ai.height,bo)}}var QueryType$1=function(vo){return vo[vo.ByPos=0]="ByPos",vo[vo.ByHeight=1]="ByHeight",vo[vo.ByPosNoHeight=2]="ByPosNoHeight",vo}(QueryType$1||(QueryType$1={}));const Epsilon=.001;class HeightMap{constructor(Ai,bo,Ra=2){this.length=Ai,this.height=bo,this.flags=Ra}get outdated(){return(this.flags&2)>0}set outdated(Ai){this.flags=(Ai?2:0)|this.flags&-3}setHeight(Ai){this.height!=Ai&&(Math.abs(this.height-Ai)>Epsilon&&(heightChangeFlag=!0),this.height=Ai)}replace(Ai,bo,Ra){return HeightMap.of(Ra)}decomposeLeft(Ai,bo){bo.push(this)}decomposeRight(Ai,bo){bo.push(this)}applyChanges(Ai,bo,Ra,pc){let mc=this,uf=Ra.doc;for(let df=pc.length-1;df>=0;df--){let{fromA:ff,toA:hf,fromB:pf,toB:mf}=pc[df],gf=mc.lineAt(ff,QueryType$1.ByPosNoHeight,Ra.setDoc(bo),0,0),yf=gf.to>=hf?gf:mc.lineAt(hf,QueryType$1.ByPosNoHeight,Ra,0,0);for(mf+=yf.to-hf,hf=yf.to;df>0&&gf.from<=pc[df-1].toA;)ff=pc[df-1].fromA,pf=pc[df-1].fromB,df--,ff<gf.from&&(gf=mc.lineAt(ff,QueryType$1.ByPosNoHeight,Ra,0,0));pf+=gf.from-ff,ff=gf.from;let vf=NodeBuilder.build(Ra.setDoc(uf),Ai,pf,mf);mc=replace(mc,mc.replace(ff,hf,vf))}return mc.updateHeight(Ra,0)}static empty(){return new HeightMapText(0,0)}static of(Ai){if(Ai.length==1)return Ai[0];let bo=0,Ra=Ai.length,pc=0,mc=0;for(;;)if(bo==Ra)if(pc>mc*2){let df=Ai[bo-1];df.break?Ai.splice(--bo,1,df.left,null,df.right):Ai.splice(--bo,1,df.left,df.right),Ra+=1+df.break,pc-=df.size}else if(mc>pc*2){let df=Ai[Ra];df.break?Ai.splice(Ra,1,df.left,null,df.right):Ai.splice(Ra,1,df.left,df.right),Ra+=2+df.break,mc-=df.size}else break;else if(pc<mc){let df=Ai[bo++];df&&(pc+=df.size)}else{let df=Ai[--Ra];df&&(mc+=df.size)}let uf=0;return Ai[bo-1]==null?(uf=1,bo--):Ai[bo]==null&&(uf=1,Ra++),new HeightMapBranch(HeightMap.of(Ai.slice(0,bo)),uf,HeightMap.of(Ai.slice(Ra)))}}function replace(vo,Ai){return vo==Ai?vo:(vo.constructor!=Ai.constructor&&(heightChangeFlag=!0),Ai)}HeightMap.prototype.size=1;class HeightMapBlock extends HeightMap{constructor(Ai,bo,Ra){super(Ai,bo),this.deco=Ra}blockAt(Ai,bo,Ra,pc){return new BlockInfo(pc,this.length,Ra,this.height,this.deco||0)}lineAt(Ai,bo,Ra,pc,mc){return this.blockAt(0,Ra,pc,mc)}forEachLine(Ai,bo,Ra,pc,mc,uf){Ai<=mc+this.length&&bo>=mc&&uf(this.blockAt(0,Ra,pc,mc))}updateHeight(Ai,bo=0,Ra=!1,pc){return pc&&pc.from<=bo&&pc.more&&this.setHeight(pc.heights[pc.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class HeightMapText extends HeightMapBlock{constructor(Ai,bo){super(Ai,bo,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(Ai,bo,Ra,pc){return new BlockInfo(pc,this.length,Ra,this.height,this.breaks)}replace(Ai,bo,Ra){let pc=Ra[0];return Ra.length==1&&(pc instanceof HeightMapText||pc instanceof HeightMapGap&&pc.flags&4)&&Math.abs(this.length-pc.length)<10?(pc instanceof HeightMapGap?pc=new HeightMapText(pc.length,this.height):pc.height=this.height,this.outdated||(pc.outdated=!1),pc):HeightMap.of(Ra)}updateHeight(Ai,bo=0,Ra=!1,pc){return pc&&pc.from<=bo&&pc.more?this.setHeight(pc.heights[pc.index++]):(Ra||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,Ai.heightForLine(this.length-this.collapsed))+this.breaks*Ai.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class HeightMapGap extends HeightMap{constructor(Ai){super(Ai,0)}heightMetrics(Ai,bo){let Ra=Ai.doc.lineAt(bo).number,pc=Ai.doc.lineAt(bo+this.length).number,mc=pc-Ra+1,uf,df=0;if(Ai.lineWrapping){let ff=Math.min(this.height,Ai.lineHeight*mc);uf=ff/mc,this.length>mc+1&&(df=(this.height-ff)/(this.length-mc-1))}else uf=this.height/mc;return{firstLine:Ra,lastLine:pc,perLine:uf,perChar:df}}blockAt(Ai,bo,Ra,pc){let{firstLine:mc,lastLine:uf,perLine:df,perChar:ff}=this.heightMetrics(bo,pc);if(bo.lineWrapping){let hf=pc+(Ai<bo.lineHeight?0:Math.round(Math.max(0,Math.min(1,(Ai-Ra)/this.height))*this.length)),pf=bo.doc.lineAt(hf),mf=df+pf.length*ff,gf=Math.max(Ra,Ai-mf/2);return new BlockInfo(pf.from,pf.length,gf,mf,0)}else{let hf=Math.max(0,Math.min(uf-mc,Math.floor((Ai-Ra)/df))),{from:pf,length:mf}=bo.doc.line(mc+hf);return new BlockInfo(pf,mf,Ra+df*hf,df,0)}}lineAt(Ai,bo,Ra,pc,mc){if(bo==QueryType$1.ByHeight)return this.blockAt(Ai,Ra,pc,mc);if(bo==QueryType$1.ByPosNoHeight){let{from:yf,to:vf}=Ra.doc.lineAt(Ai);return new BlockInfo(yf,vf-yf,0,0,0)}let{firstLine:uf,perLine:df,perChar:ff}=this.heightMetrics(Ra,mc),hf=Ra.doc.lineAt(Ai),pf=df+hf.length*ff,mf=hf.number-uf,gf=pc+df*mf+ff*(hf.from-mc-mf);return new BlockInfo(hf.from,hf.length,Math.max(pc,Math.min(gf,pc+this.height-pf)),pf,0)}forEachLine(Ai,bo,Ra,pc,mc,uf){Ai=Math.max(Ai,mc),bo=Math.min(bo,mc+this.length);let{firstLine:df,perLine:ff,perChar:hf}=this.heightMetrics(Ra,mc);for(let pf=Ai,mf=pc;pf<=bo;){let gf=Ra.doc.lineAt(pf);if(pf==Ai){let vf=gf.number-df;mf+=ff*vf+hf*(Ai-mc-vf)}let yf=ff+hf*gf.length;uf(new BlockInfo(gf.from,gf.length,mf,yf,0)),mf+=yf,pf=gf.to+1}}replace(Ai,bo,Ra){let pc=this.length-bo;if(pc>0){let mc=Ra[Ra.length-1];mc instanceof HeightMapGap?Ra[Ra.length-1]=new HeightMapGap(mc.length+pc):Ra.push(null,new HeightMapGap(pc-1))}if(Ai>0){let mc=Ra[0];mc instanceof HeightMapGap?Ra[0]=new HeightMapGap(Ai+mc.length):Ra.unshift(new HeightMapGap(Ai-1),null)}return HeightMap.of(Ra)}decomposeLeft(Ai,bo){bo.push(new HeightMapGap(Ai-1),null)}decomposeRight(Ai,bo){bo.push(null,new HeightMapGap(this.length-Ai-1))}updateHeight(Ai,bo=0,Ra=!1,pc){let mc=bo+this.length;if(pc&&pc.from<=bo+this.length&&pc.more){let uf=[],df=Math.max(bo,pc.from),ff=-1;for(pc.from>bo&&uf.push(new HeightMapGap(pc.from-bo-1).updateHeight(Ai,bo));df<=mc&&pc.more;){let pf=Ai.doc.lineAt(df).length;uf.length&&uf.push(null);let mf=pc.heights[pc.index++];ff==-1?ff=mf:Math.abs(mf-ff)>=Epsilon&&(ff=-2);let gf=new HeightMapText(pf,mf);gf.outdated=!1,uf.push(gf),df+=pf+1}df<=mc&&uf.push(null,new HeightMapGap(mc-df).updateHeight(Ai,df));let hf=HeightMap.of(uf);return(ff<0||Math.abs(hf.height-this.height)>=Epsilon||Math.abs(ff-this.heightMetrics(Ai,bo).perLine)>=Epsilon)&&(heightChangeFlag=!0),replace(this,hf)}else(Ra||this.outdated)&&(this.setHeight(Ai.heightForGap(bo,bo+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class HeightMapBranch extends HeightMap{constructor(Ai,bo,Ra){super(Ai.length+bo+Ra.length,Ai.height+Ra.height,bo|(Ai.outdated||Ra.outdated?2:0)),this.left=Ai,this.right=Ra,this.size=Ai.size+Ra.size}get break(){return this.flags&1}blockAt(Ai,bo,Ra,pc){let mc=Ra+this.left.height;return Ai<mc?this.left.blockAt(Ai,bo,Ra,pc):this.right.blockAt(Ai,bo,mc,pc+this.left.length+this.break)}lineAt(Ai,bo,Ra,pc,mc){let uf=pc+this.left.height,df=mc+this.left.length+this.break,ff=bo==QueryType$1.ByHeight?Ai<uf:Ai<df,hf=ff?this.left.lineAt(Ai,bo,Ra,pc,mc):this.right.lineAt(Ai,bo,Ra,uf,df);if(this.break||(ff?hf.to<df:hf.from>df))return hf;let pf=bo==QueryType$1.ByPosNoHeight?QueryType$1.ByPosNoHeight:QueryType$1.ByPos;return ff?hf.join(this.right.lineAt(df,pf,Ra,uf,df)):this.left.lineAt(df,pf,Ra,pc,mc).join(hf)}forEachLine(Ai,bo,Ra,pc,mc,uf){let df=pc+this.left.height,ff=mc+this.left.length+this.break;if(this.break)Ai<ff&&this.left.forEachLine(Ai,bo,Ra,pc,mc,uf),bo>=ff&&this.right.forEachLine(Ai,bo,Ra,df,ff,uf);else{let hf=this.lineAt(ff,QueryType$1.ByPos,Ra,pc,mc);Ai<hf.from&&this.left.forEachLine(Ai,hf.from-1,Ra,pc,mc,uf),hf.to>=Ai&&hf.from<=bo&&uf(hf),bo>hf.to&&this.right.forEachLine(hf.to+1,bo,Ra,df,ff,uf)}}replace(Ai,bo,Ra){let pc=this.left.length+this.break;if(bo<pc)return this.balanced(this.left.replace(Ai,bo,Ra),this.right);if(Ai>this.left.length)return this.balanced(this.left,this.right.replace(Ai-pc,bo-pc,Ra));let mc=[];Ai>0&&this.decomposeLeft(Ai,mc);let uf=mc.length;for(let df of Ra)mc.push(df);if(Ai>0&&mergeGaps(mc,uf-1),bo<this.length){let df=mc.length;this.decomposeRight(bo,mc),mergeGaps(mc,df)}return HeightMap.of(mc)}decomposeLeft(Ai,bo){let Ra=this.left.length;if(Ai<=Ra)return this.left.decomposeLeft(Ai,bo);bo.push(this.left),this.break&&(Ra++,Ai>=Ra&&bo.push(null)),Ai>Ra&&this.right.decomposeLeft(Ai-Ra,bo)}decomposeRight(Ai,bo){let Ra=this.left.length,pc=Ra+this.break;if(Ai>=pc)return this.right.decomposeRight(Ai-pc,bo);Ai<Ra&&this.left.decomposeRight(Ai,bo),this.break&&Ai<pc&&bo.push(null),bo.push(this.right)}balanced(Ai,bo){return Ai.size>2*bo.size||bo.size>2*Ai.size?HeightMap.of(this.break?[Ai,null,bo]:[Ai,bo]):(this.left=replace(this.left,Ai),this.right=replace(this.right,bo),this.setHeight(Ai.height+bo.height),this.outdated=Ai.outdated||bo.outdated,this.size=Ai.size+bo.size,this.length=Ai.length+this.break+bo.length,this)}updateHeight(Ai,bo=0,Ra=!1,pc){let{left:mc,right:uf}=this,df=bo+mc.length+this.break,ff=null;return pc&&pc.from<=bo+mc.length&&pc.more?ff=mc=mc.updateHeight(Ai,bo,Ra,pc):mc.updateHeight(Ai,bo,Ra),pc&&pc.from<=df+uf.length&&pc.more?ff=uf=uf.updateHeight(Ai,df,Ra,pc):uf.updateHeight(Ai,df,Ra),ff?this.balanced(mc,uf):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function mergeGaps(vo,Ai){let bo,Ra;vo[Ai]==null&&(bo=vo[Ai-1])instanceof HeightMapGap&&(Ra=vo[Ai+1])instanceof HeightMapGap&&vo.splice(Ai-1,3,new HeightMapGap(bo.length+1+Ra.length))}const relevantWidgetHeight=5;class NodeBuilder{constructor(Ai,bo){this.pos=Ai,this.oracle=bo,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=Ai}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(Ai,bo){if(this.lineStart>-1){let Ra=Math.min(bo,this.lineEnd),pc=this.nodes[this.nodes.length-1];pc instanceof HeightMapText?pc.length+=Ra-this.pos:(Ra>this.pos||!this.isCovered)&&this.nodes.push(new HeightMapText(Ra-this.pos,-1)),this.writtenTo=Ra,bo>Ra&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=bo}point(Ai,bo,Ra){if(Ai<bo||Ra.heightRelevant){let pc=Ra.widget?Ra.widget.estimatedHeight:0,mc=Ra.widget?Ra.widget.lineBreaks:0;pc<0&&(pc=this.oracle.lineHeight);let uf=bo-Ai;Ra.block?this.addBlock(new HeightMapBlock(uf,pc,Ra)):(uf||mc||pc>=relevantWidgetHeight)&&this.addLineDeco(pc,mc,uf)}else bo>Ai&&this.span(Ai,bo);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:Ai,to:bo}=this.oracle.doc.lineAt(this.pos);this.lineStart=Ai,this.lineEnd=bo,this.writtenTo<Ai&&((this.writtenTo<Ai-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,Ai-1)),this.nodes.push(null)),this.pos>Ai&&this.nodes.push(new HeightMapText(this.pos-Ai,-1)),this.writtenTo=this.pos}blankContent(Ai,bo){let Ra=new HeightMapGap(bo-Ai);return this.oracle.doc.lineAt(Ai).to==bo&&(Ra.flags|=4),Ra}ensureLine(){this.enterLine();let Ai=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(Ai instanceof HeightMapText)return Ai;let bo=new HeightMapText(0,-1);return this.nodes.push(bo),bo}addBlock(Ai){this.enterLine();let bo=Ai.deco;bo&&bo.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(Ai),this.writtenTo=this.pos=this.pos+Ai.length,bo&&bo.endSide>0&&(this.covering=Ai)}addLineDeco(Ai,bo,Ra){let pc=this.ensureLine();pc.length+=Ra,pc.collapsed+=Ra,pc.widgetHeight=Math.max(pc.widgetHeight,Ai),pc.breaks+=bo,this.writtenTo=this.pos=this.pos+Ra}finish(Ai){let bo=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(bo instanceof HeightMapText)&&!this.isCovered?this.nodes.push(new HeightMapText(0,-1)):(this.writtenTo<this.pos||bo==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let Ra=Ai;for(let pc of this.nodes)pc instanceof HeightMapText&&pc.updateHeight(this.oracle,Ra),Ra+=pc?pc.length:1;return this.nodes}static build(Ai,bo,Ra,pc){let mc=new NodeBuilder(Ra,Ai);return RangeSet.spans(bo,Ra,pc,mc,0),mc.finish(Ra)}}function heightRelevantDecoChanges(vo,Ai,bo){let Ra=new DecorationComparator;return RangeSet.compare(vo,Ai,bo,Ra,0),Ra.changes}class DecorationComparator{constructor(){this.changes=[]}compareRange(){}comparePoint(Ai,bo,Ra,pc){(Ai<bo||Ra&&Ra.heightRelevant||pc&&pc.heightRelevant)&&addRange(Ai,bo,this.changes,5)}}function visiblePixelRange(vo,Ai){let bo=vo.getBoundingClientRect(),Ra=vo.ownerDocument,pc=Ra.defaultView||window,mc=Math.max(0,bo.left),uf=Math.min(pc.innerWidth,bo.right),df=Math.max(0,bo.top),ff=Math.min(pc.innerHeight,bo.bottom);for(let hf=vo.parentNode;hf&&hf!=Ra.body;)if(hf.nodeType==1){let pf=hf,mf=window.getComputedStyle(pf);if((pf.scrollHeight>pf.clientHeight||pf.scrollWidth>pf.clientWidth)&&mf.overflow!="visible"){let gf=pf.getBoundingClientRect();mc=Math.max(mc,gf.left),uf=Math.min(uf,gf.right),df=Math.max(df,gf.top),ff=Math.min(hf==vo.parentNode?pc.innerHeight:ff,gf.bottom)}hf=mf.position=="absolute"||mf.position=="fixed"?pf.offsetParent:pf.parentNode}else if(hf.nodeType==11)hf=hf.host;else break;return{left:mc-bo.left,right:Math.max(mc,uf)-bo.left,top:df-(bo.top+Ai),bottom:Math.max(df,ff)-(bo.top+Ai)}}function fullPixelRange(vo,Ai){let bo=vo.getBoundingClientRect();return{left:0,right:bo.right-bo.left,top:Ai,bottom:bo.bottom-(bo.top+Ai)}}class LineGap{constructor(Ai,bo,Ra,pc){this.from=Ai,this.to=bo,this.size=Ra,this.displaySize=pc}static same(Ai,bo){if(Ai.length!=bo.length)return!1;for(let Ra=0;Ra<Ai.length;Ra++){let pc=Ai[Ra],mc=bo[Ra];if(pc.from!=mc.from||pc.to!=mc.to||pc.size!=mc.size)return!1}return!0}draw(Ai,bo){return Decoration.replace({widget:new LineGapWidget(this.displaySize*(bo?Ai.scaleY:Ai.scaleX),bo)}).range(this.from,this.to)}}class LineGapWidget extends WidgetType{constructor(Ai,bo){super(),this.size=Ai,this.vertical=bo}eq(Ai){return Ai.size==this.size&&Ai.vertical==this.vertical}toDOM(){let Ai=document.createElement("div");return this.vertical?Ai.style.height=this.size+"px":(Ai.style.width=this.size+"px",Ai.style.height="2px",Ai.style.display="inline-block"),Ai}get estimatedHeight(){return this.vertical?this.size:-1}}class ViewState{constructor(Ai){this.state=Ai,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=IdScaler,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=Direction.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let bo=Ai.facet(contentAttributes).some(Ra=>typeof Ra!="function"&&Ra.class=="cm-lineWrapping");this.heightOracle=new HeightOracle(bo),this.stateDeco=Ai.facet(decorations).filter(Ra=>typeof Ra!="function"),this.heightMap=HeightMap.empty().applyChanges(this.stateDeco,Text.empty,this.heightOracle.setDoc(Ai.doc),[new ChangedRange(0,0,0,Ai.doc.length)]);for(let Ra=0;Ra<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());Ra++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Decoration.set(this.lineGaps.map(Ra=>Ra.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let Ai=[this.viewport],{main:bo}=this.state.selection;for(let Ra=0;Ra<=1;Ra++){let pc=Ra?bo.head:bo.anchor;if(!Ai.some(({from:mc,to:uf})=>pc>=mc&&pc<=uf)){let{from:mc,to:uf}=this.lineBlockAt(pc);Ai.push(new Viewport(mc,uf))}}return this.viewports=Ai.sort((Ra,pc)=>Ra.from-pc.from),this.updateScaler()}updateScaler(){let Ai=this.scaler;return this.scaler=this.heightMap.height<=7e6?IdScaler:new BigScaler(this.heightOracle,this.heightMap,this.viewports),Ai.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,Ai=>{this.viewportLines.push(scaleBlock(Ai,this.scaler))})}update(Ai,bo=null){this.state=Ai.state;let Ra=this.stateDeco;this.stateDeco=this.state.facet(decorations).filter(pf=>typeof pf!="function");let pc=Ai.changedRanges,mc=ChangedRange.extendWithRanges(pc,heightRelevantDecoChanges(Ra,this.stateDeco,Ai?Ai.changes:ChangeSet.empty(this.state.doc.length))),uf=this.heightMap.height,df=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);clearHeightChangeFlag(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,Ai.startState.doc,this.heightOracle.setDoc(this.state.doc),mc),(this.heightMap.height!=uf||heightChangeFlag)&&(Ai.flags|=2),df?(this.scrollAnchorPos=Ai.changes.mapPos(df.from,-1),this.scrollAnchorHeight=df.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let ff=mc.length?this.mapViewport(this.viewport,Ai.changes):this.viewport;(bo&&(bo.range.head<ff.from||bo.range.head>ff.to)||!this.viewportIsAppropriate(ff))&&(ff=this.getViewport(0,bo));let hf=ff.from!=this.viewport.from||ff.to!=this.viewport.to;this.viewport=ff,Ai.flags|=this.updateForViewport(),(hf||!Ai.changes.empty||Ai.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,Ai.changes))),Ai.flags|=this.computeVisibleRanges(Ai.changes),bo&&(this.scrollTarget=bo),!this.mustEnforceCursorAssoc&&Ai.selectionSet&&Ai.view.lineWrapping&&Ai.state.selection.main.empty&&Ai.state.selection.main.assoc&&!Ai.state.facet(nativeSelectionHidden)&&(this.mustEnforceCursorAssoc=!0)}measure(Ai){let bo=Ai.contentDOM,Ra=window.getComputedStyle(bo),pc=this.heightOracle,mc=Ra.whiteSpace;this.defaultTextDirection=Ra.direction=="rtl"?Direction.RTL:Direction.LTR;let uf=this.heightOracle.mustRefreshForWrapping(mc),df=bo.getBoundingClientRect(),ff=uf||this.mustMeasureContent||this.contentDOMHeight!=df.height;this.contentDOMHeight=df.height,this.mustMeasureContent=!1;let hf=0,pf=0;if(df.width&&df.height){let{scaleX:l1,scaleY:s1}=getScale(bo,df);(l1>.005&&Math.abs(this.scaleX-l1)>.005||s1>.005&&Math.abs(this.scaleY-s1)>.005)&&(this.scaleX=l1,this.scaleY=s1,hf|=16,uf=ff=!0)}let mf=(parseInt(Ra.paddingTop)||0)*this.scaleY,gf=(parseInt(Ra.paddingBottom)||0)*this.scaleY;(this.paddingTop!=mf||this.paddingBottom!=gf)&&(this.paddingTop=mf,this.paddingBottom=gf,hf|=18),this.editorWidth!=Ai.scrollDOM.clientWidth&&(pc.lineWrapping&&(ff=!0),this.editorWidth=Ai.scrollDOM.clientWidth,hf|=16);let yf=Ai.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=yf&&(this.scrollAnchorHeight=-1,this.scrollTop=yf),this.scrolledToBottom=isScrolledToBottom(Ai.scrollDOM);let vf=(this.printing?fullPixelRange:visiblePixelRange)(bo,this.paddingTop),bf=vf.top-this.pixelViewport.top,Sf=vf.bottom-this.pixelViewport.bottom;this.pixelViewport=vf;let xf=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(xf!=this.inView&&(this.inView=xf,xf&&(ff=!0)),!this.inView&&!this.scrollTarget)return 0;let wf=df.width;if((this.contentDOMWidth!=wf||this.editorHeight!=Ai.scrollDOM.clientHeight)&&(this.contentDOMWidth=df.width,this.editorHeight=Ai.scrollDOM.clientHeight,hf|=16),ff){let l1=Ai.docView.measureVisibleLineHeights(this.viewport);if(pc.mustRefreshForHeights(l1)&&(uf=!0),uf||pc.lineWrapping&&Math.abs(wf-this.contentDOMWidth)>pc.charWidth){let{lineHeight:s1,charWidth:c1,textHeight:u1}=Ai.docView.measureTextSize();uf=s1>0&&pc.refresh(mc,s1,c1,u1,wf/c1,l1),uf&&(Ai.docView.minWidth=0,hf|=16)}bf>0&&Sf>0?pf=Math.max(bf,Sf):bf<0&&Sf<0&&(pf=Math.min(bf,Sf)),clearHeightChangeFlag();for(let s1 of this.viewports){let c1=s1.from==this.viewport.from?l1:Ai.docView.measureVisibleLineHeights(s1);this.heightMap=(uf?HeightMap.empty().applyChanges(this.stateDeco,Text.empty,this.heightOracle,[new ChangedRange(0,0,0,Ai.state.doc.length)]):this.heightMap).updateHeight(pc,0,uf,new MeasuredHeights(s1.from,c1))}heightChangeFlag&&(hf|=2)}let If=!this.viewportIsAppropriate(this.viewport,pf)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return If&&(hf&2&&(hf|=this.updateScaler()),this.viewport=this.getViewport(pf,this.scrollTarget),hf|=this.updateForViewport()),(hf&2||If)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(uf?[]:this.lineGaps,Ai)),hf|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,Ai.docView.enforceCursorAssoc()),hf}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(Ai,bo){let Ra=.5-Math.max(-.5,Math.min(.5,Ai/1e3/2)),pc=this.heightMap,mc=this.heightOracle,{visibleTop:uf,visibleBottom:df}=this,ff=new Viewport(pc.lineAt(uf-Ra*1e3,QueryType$1.ByHeight,mc,0,0).from,pc.lineAt(df+(1-Ra)*1e3,QueryType$1.ByHeight,mc,0,0).to);if(bo){let{head:hf}=bo.range;if(hf<ff.from||hf>ff.to){let pf=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),mf=pc.lineAt(hf,QueryType$1.ByPos,mc,0,0),gf;bo.y=="center"?gf=(mf.top+mf.bottom)/2-pf/2:bo.y=="start"||bo.y=="nearest"&&hf<ff.from?gf=mf.top:gf=mf.bottom-pf,ff=new Viewport(pc.lineAt(gf-1e3/2,QueryType$1.ByHeight,mc,0,0).from,pc.lineAt(gf+pf+1e3/2,QueryType$1.ByHeight,mc,0,0).to)}}return ff}mapViewport(Ai,bo){let Ra=bo.mapPos(Ai.from,-1),pc=bo.mapPos(Ai.to,1);return new Viewport(this.heightMap.lineAt(Ra,QueryType$1.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(pc,QueryType$1.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:Ai,to:bo},Ra=0){if(!this.inView)return!0;let{top:pc}=this.heightMap.lineAt(Ai,QueryType$1.ByPos,this.heightOracle,0,0),{bottom:mc}=this.heightMap.lineAt(bo,QueryType$1.ByPos,this.heightOracle,0,0),{visibleTop:uf,visibleBottom:df}=this;return(Ai==0||pc<=uf-Math.max(10,Math.min(-Ra,250)))&&(bo==this.state.doc.length||mc>=df+Math.max(10,Math.min(Ra,250)))&&pc>uf-2*1e3&&mc<df+2*1e3}mapLineGaps(Ai,bo){if(!Ai.length||bo.empty)return Ai;let Ra=[];for(let pc of Ai)bo.touchesRange(pc.from,pc.to)||Ra.push(new LineGap(bo.mapPos(pc.from),bo.mapPos(pc.to),pc.size,pc.displaySize));return Ra}ensureLineGaps(Ai,bo){let Ra=this.heightOracle.lineWrapping,pc=Ra?1e4:2e3,mc=pc>>1,uf=pc<<1;if(this.defaultTextDirection!=Direction.LTR&&!Ra)return[];let df=[],ff=(pf,mf,gf,yf)=>{if(mf-pf<mc)return;let vf=this.state.selection.main,bf=[vf.from];vf.empty||bf.push(vf.to);for(let xf of bf)if(xf>pf&&xf<mf){ff(pf,xf-10,gf,yf),ff(xf+10,mf,gf,yf);return}let Sf=find(Ai,xf=>xf.from>=gf.from&&xf.to<=gf.to&&Math.abs(xf.from-pf)<mc&&Math.abs(xf.to-mf)<mc&&!bf.some(wf=>xf.from<wf&&xf.to>wf));if(!Sf){if(mf<gf.to&&bo&&Ra&&bo.visibleRanges.some(If=>If.from<=mf&&If.to>=mf)){let If=bo.moveToLineBoundary(EditorSelection.cursor(mf),!1,!0).head;If>pf&&(mf=If)}let xf=this.gapSize(gf,pf,mf,yf),wf=Ra||xf<2e6?xf:2e6;Sf=new LineGap(pf,mf,xf,wf)}df.push(Sf)},hf=pf=>{if(pf.length<uf||pf.type!=BlockType.Text)return;let mf=lineStructure(pf.from,pf.to,this.stateDeco);if(mf.total<uf)return;let gf=this.scrollTarget?this.scrollTarget.range.head:null,yf,vf;if(Ra){let bf=pc/this.heightOracle.lineLength*this.heightOracle.lineHeight,Sf,xf;if(gf!=null){let wf=findFraction(mf,gf),If=((this.visibleBottom-this.visibleTop)/2+bf)/pf.height;Sf=wf-If,xf=wf+If}else Sf=(this.visibleTop-pf.top-bf)/pf.height,xf=(this.visibleBottom-pf.top+bf)/pf.height;yf=findPosition(mf,Sf),vf=findPosition(mf,xf)}else{let bf=mf.total*this.heightOracle.charWidth,Sf=pc*this.heightOracle.charWidth,xf=0;if(bf>2e6)for(let c1 of Ai)c1.from>=pf.from&&c1.from<pf.to&&c1.size!=c1.displaySize&&c1.from*this.heightOracle.charWidth+xf<this.pixelViewport.left&&(xf=c1.size-c1.displaySize);let wf=this.pixelViewport.left+xf,If=this.pixelViewport.right+xf,l1,s1;if(gf!=null){let c1=findFraction(mf,gf),u1=((If-wf)/2+Sf)/bf;l1=c1-u1,s1=c1+u1}else l1=(wf-Sf)/bf,s1=(If+Sf)/bf;yf=findPosition(mf,l1),vf=findPosition(mf,s1)}yf>pf.from&&ff(pf.from,yf,pf,mf),vf<pf.to&&ff(vf,pf.to,pf,mf)};for(let pf of this.viewportLines)Array.isArray(pf.type)?pf.type.forEach(hf):hf(pf);return df}gapSize(Ai,bo,Ra,pc){let mc=findFraction(pc,Ra)-findFraction(pc,bo);return this.heightOracle.lineWrapping?Ai.height*mc:pc.total*this.heightOracle.charWidth*mc}updateLineGaps(Ai){LineGap.same(Ai,this.lineGaps)||(this.lineGaps=Ai,this.lineGapDeco=Decoration.set(Ai.map(bo=>bo.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(Ai){let bo=this.stateDeco;this.lineGaps.length&&(bo=bo.concat(this.lineGapDeco));let Ra=[];RangeSet.spans(bo,this.viewport.from,this.viewport.to,{span(mc,uf){Ra.push({from:mc,to:uf})},point(){}},20);let pc=0;if(Ra.length!=this.visibleRanges.length)pc=12;else for(let mc=0;mc<Ra.length&&!(pc&8);mc++){let uf=this.visibleRanges[mc],df=Ra[mc];(uf.from!=df.from||uf.to!=df.to)&&(pc|=4,Ai&&Ai.mapPos(uf.from,-1)==df.from&&Ai.mapPos(uf.to,1)==df.to||(pc|=8))}return this.visibleRanges=Ra,pc}lineBlockAt(Ai){return Ai>=this.viewport.from&&Ai<=this.viewport.to&&this.viewportLines.find(bo=>bo.from<=Ai&&bo.to>=Ai)||scaleBlock(this.heightMap.lineAt(Ai,QueryType$1.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(Ai){return Ai>=this.viewportLines[0].top&&Ai<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(bo=>bo.top<=Ai&&bo.bottom>=Ai)||scaleBlock(this.heightMap.lineAt(this.scaler.fromDOM(Ai),QueryType$1.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(Ai){let bo=this.lineBlockAtHeight(Ai+8);return bo.from>=this.viewport.from||this.viewportLines[0].top-Ai>200?bo:this.viewportLines[0]}elementAtHeight(Ai){return scaleBlock(this.heightMap.blockAt(this.scaler.fromDOM(Ai),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Viewport{constructor(Ai,bo){this.from=Ai,this.to=bo}}function lineStructure(vo,Ai,bo){let Ra=[],pc=vo,mc=0;return RangeSet.spans(bo,vo,Ai,{span(){},point(uf,df){uf>pc&&(Ra.push({from:pc,to:uf}),mc+=uf-pc),pc=df}},20),pc<Ai&&(Ra.push({from:pc,to:Ai}),mc+=Ai-pc),{total:mc,ranges:Ra}}function findPosition({total:vo,ranges:Ai},bo){if(bo<=0)return Ai[0].from;if(bo>=1)return Ai[Ai.length-1].to;let Ra=Math.floor(vo*bo);for(let pc=0;;pc++){let{from:mc,to:uf}=Ai[pc],df=uf-mc;if(Ra<=df)return mc+Ra;Ra-=df}}function findFraction(vo,Ai){let bo=0;for(let{from:Ra,to:pc}of vo.ranges){if(Ai<=pc){bo+=Ai-Ra;break}bo+=pc-Ra}return bo/vo.total}function find(vo,Ai){for(let bo of vo)if(Ai(bo))return bo}const IdScaler={toDOM(vo){return vo},fromDOM(vo){return vo},scale:1,eq(vo){return vo==this}};class BigScaler{constructor(Ai,bo,Ra){let pc=0,mc=0,uf=0;this.viewports=Ra.map(({from:df,to:ff})=>{let hf=bo.lineAt(df,QueryType$1.ByPos,Ai,0,0).top,pf=bo.lineAt(ff,QueryType$1.ByPos,Ai,0,0).bottom;return pc+=pf-hf,{from:df,to:ff,top:hf,bottom:pf,domTop:0,domBottom:0}}),this.scale=(7e6-pc)/(bo.height-pc);for(let df of this.viewports)df.domTop=uf+(df.top-mc)*this.scale,uf=df.domBottom=df.domTop+(df.bottom-df.top),mc=df.bottom}toDOM(Ai){for(let bo=0,Ra=0,pc=0;;bo++){let mc=bo<this.viewports.length?this.viewports[bo]:null;if(!mc||Ai<mc.top)return pc+(Ai-Ra)*this.scale;if(Ai<=mc.bottom)return mc.domTop+(Ai-mc.top);Ra=mc.bottom,pc=mc.domBottom}}fromDOM(Ai){for(let bo=0,Ra=0,pc=0;;bo++){let mc=bo<this.viewports.length?this.viewports[bo]:null;if(!mc||Ai<mc.domTop)return Ra+(Ai-pc)/this.scale;if(Ai<=mc.domBottom)return mc.top+(Ai-mc.domTop);Ra=mc.bottom,pc=mc.domBottom}}eq(Ai){return Ai instanceof BigScaler?this.scale==Ai.scale&&this.viewports.length==Ai.viewports.length&&this.viewports.every((bo,Ra)=>bo.from==Ai.viewports[Ra].from&&bo.to==Ai.viewports[Ra].to):!1}}function scaleBlock(vo,Ai){if(Ai.scale==1)return vo;let bo=Ai.toDOM(vo.top),Ra=Ai.toDOM(vo.bottom);return new BlockInfo(vo.from,vo.length,bo,Ra-bo,Array.isArray(vo._content)?vo._content.map(pc=>scaleBlock(pc,Ai)):vo._content)}const theme=Facet.define({combine:vo=>vo.join(" ")}),darkTheme=Facet.define({combine:vo=>vo.indexOf(!0)>-1}),baseThemeID=StyleModule.newName(),baseLightID=StyleModule.newName(),baseDarkID=StyleModule.newName(),lightDarkIDs={"&light":"."+baseLightID,"&dark":"."+baseDarkID};function buildTheme(vo,Ai,bo){return new StyleModule(Ai,{finish(Ra){return/&/.test(Ra)?Ra.replace(/&\w*/,pc=>{if(pc=="&")return vo;if(!bo||!bo[pc])throw new RangeError(`Unsupported selector: ${pc}`);return bo[pc]}):vo+" "+Ra}})}const baseTheme$1$2=buildTheme("."+baseThemeID,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},lightDarkIDs),observeOptions={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},useCharData=browser.ie&&browser.ie_version<=11;class DOMObserver{constructor(Ai){this.view=Ai,this.active=!1,this.editContext=null,this.selectionRange=new DOMSelectionState,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=Ai.contentDOM,this.observer=new MutationObserver(bo=>{for(let Ra of bo)this.queue.push(Ra);(browser.ie&&browser.ie_version<=11||browser.ios&&Ai.composing)&&bo.some(Ra=>Ra.type=="childList"&&Ra.removedNodes.length||Ra.type=="characterData"&&Ra.oldValue.length>Ra.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&Ai.constructor.EDIT_CONTEXT!==!1&&!(browser.chrome&&browser.chrome_version<126)&&(this.editContext=new EditContextManager(Ai),Ai.state.facet(editable)&&(Ai.contentDOM.editContext=this.editContext.editContext)),useCharData&&(this.onCharData=bo=>{this.queue.push({target:bo.target,type:"characterData",oldValue:bo.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var bo;((bo=this.view.docView)===null||bo===void 0?void 0:bo.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(Ai.scrollDOM)),this.addWindowListeners(this.win=Ai.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(bo=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),bo.length>0&&bo[bo.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(bo=>{bo.length>0&&bo[bo.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(Ai){this.view.inputState.runHandlers("scroll",Ai),this.intersecting&&this.view.measure()}onScroll(Ai){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(Ai)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(Ai){(Ai.type=="change"||!Ai.type)&&!Ai.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(Ai){if(this.gapIntersection&&(Ai.length!=this.gaps.length||this.gaps.some((bo,Ra)=>bo!=Ai[Ra]))){this.gapIntersection.disconnect();for(let bo of Ai)this.gapIntersection.observe(bo);this.gaps=Ai}}onSelectionChange(Ai){let bo=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:Ra}=this,pc=this.selectionRange;if(Ra.state.facet(editable)?Ra.root.activeElement!=this.dom:!hasSelection(this.dom,pc))return;let mc=pc.anchorNode&&Ra.docView.nearest(pc.anchorNode);if(mc&&mc.ignoreEvent(Ai)){bo||(this.selectionChanged=!1);return}(browser.ie&&browser.ie_version<=11||browser.android&&browser.chrome)&&!Ra.state.selection.main.empty&&pc.focusNode&&isEquivalentPosition(pc.focusNode,pc.focusOffset,pc.anchorNode,pc.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:Ai}=this,bo=getSelection(Ai.root);if(!bo)return!1;let Ra=browser.safari&&Ai.root.nodeType==11&&Ai.root.activeElement==this.dom&&safariSelectionRangeHack(this.view,bo)||bo;if(!Ra||this.selectionRange.eq(Ra))return!1;let pc=hasSelection(this.dom,Ra);return pc&&!this.selectionChanged&&Ai.inputState.lastFocusTime>Date.now()-200&&Ai.inputState.lastTouchTime<Date.now()-300&&atElementStart(this.dom,Ra)?(this.view.inputState.lastFocusTime=0,Ai.docView.updateSelection(),!1):(this.selectionRange.setRange(Ra),pc&&(this.selectionChanged=!0),!0)}setSelectionRange(Ai,bo){this.selectionRange.set(Ai.node,Ai.offset,bo.node,bo.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let Ai=0,bo=null;for(let Ra=this.dom;Ra;)if(Ra.nodeType==1)!bo&&Ai<this.scrollTargets.length&&this.scrollTargets[Ai]==Ra?Ai++:bo||(bo=this.scrollTargets.slice(0,Ai)),bo&&bo.push(Ra),Ra=Ra.assignedSlot||Ra.parentNode;else if(Ra.nodeType==11)Ra=Ra.host;else break;if(Ai<this.scrollTargets.length&&!bo&&(bo=this.scrollTargets.slice(0,Ai)),bo){for(let Ra of this.scrollTargets)Ra.removeEventListener("scroll",this.onScroll);for(let Ra of this.scrollTargets=bo)Ra.addEventListener("scroll",this.onScroll)}}ignore(Ai){if(!this.active)return Ai();try{return this.stop(),Ai()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,observeOptions),useCharData&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),useCharData&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(Ai,bo){var Ra;if(!this.delayedAndroidKey){let pc=()=>{let mc=this.delayedAndroidKey;mc&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=mc.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&mc.force&&dispatchKey(this.dom,mc.key,mc.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(pc)}(!this.delayedAndroidKey||Ai=="Enter")&&(this.delayedAndroidKey={key:Ai,keyCode:bo,force:this.lastChange<Date.now()-50||!!(!((Ra=this.delayedAndroidKey)===null||Ra===void 0)&&Ra.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let Ai of this.observer.takeRecords())this.queue.push(Ai);return this.queue}processRecords(){let Ai=this.pendingRecords();Ai.length&&(this.queue=[]);let bo=-1,Ra=-1,pc=!1;for(let mc of Ai){let uf=this.readMutation(mc);uf&&(uf.typeOver&&(pc=!0),bo==-1?{from:bo,to:Ra}=uf:(bo=Math.min(uf.from,bo),Ra=Math.max(uf.to,Ra)))}return{from:bo,to:Ra,typeOver:pc}}readChange(){let{from:Ai,to:bo,typeOver:Ra}=this.processRecords(),pc=this.selectionChanged&&hasSelection(this.dom,this.selectionRange);if(Ai<0&&!pc)return null;Ai>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let mc=new DOMChange(this.view,Ai,bo,Ra);return this.view.docView.domChanged={newSel:mc.newSel?mc.newSel.main:null},mc}flush(Ai=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;Ai&&this.readSelectionRange();let bo=this.readChange();if(!bo)return this.view.requestMeasure(),!1;let Ra=this.view.state,pc=applyDOMChange(this.view,bo);return this.view.state==Ra&&(bo.domChanged||bo.newSel&&!bo.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),pc}readMutation(Ai){let bo=this.view.docView.nearest(Ai.target);if(!bo||bo.ignoreMutation(Ai))return null;if(bo.markDirty(Ai.type=="attributes"),Ai.type=="attributes"&&(bo.flags|=4),Ai.type=="childList"){let Ra=findChild(bo,Ai.previousSibling||Ai.target.previousSibling,-1),pc=findChild(bo,Ai.nextSibling||Ai.target.nextSibling,1);return{from:Ra?bo.posAfter(Ra):bo.posAtStart,to:pc?bo.posBefore(pc):bo.posAtEnd,typeOver:!1}}else return Ai.type=="characterData"?{from:bo.posAtStart,to:bo.posAtEnd,typeOver:Ai.target.nodeValue==Ai.oldValue}:null}setWindow(Ai){Ai!=this.win&&(this.removeWindowListeners(this.win),this.win=Ai,this.addWindowListeners(this.win))}addWindowListeners(Ai){Ai.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):Ai.addEventListener("beforeprint",this.onPrint),Ai.addEventListener("scroll",this.onScroll),Ai.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(Ai){Ai.removeEventListener("scroll",this.onScroll),Ai.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):Ai.removeEventListener("beforeprint",this.onPrint),Ai.document.removeEventListener("selectionchange",this.onSelectionChange)}update(Ai){this.editContext&&(this.editContext.update(Ai),Ai.startState.facet(editable)!=Ai.state.facet(editable)&&(Ai.view.contentDOM.editContext=Ai.state.facet(editable)?this.editContext.editContext:null))}destroy(){var Ai,bo,Ra;this.stop(),(Ai=this.intersection)===null||Ai===void 0||Ai.disconnect(),(bo=this.gapIntersection)===null||bo===void 0||bo.disconnect(),(Ra=this.resizeScroll)===null||Ra===void 0||Ra.disconnect();for(let pc of this.scrollTargets)pc.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function findChild(vo,Ai,bo){for(;Ai;){let Ra=ContentView.get(Ai);if(Ra&&Ra.parent==vo)return Ra;let pc=Ai.parentNode;Ai=pc!=vo.dom?pc:bo>0?Ai.nextSibling:Ai.previousSibling}return null}function buildSelectionRangeFromRange(vo,Ai){let bo=Ai.startContainer,Ra=Ai.startOffset,pc=Ai.endContainer,mc=Ai.endOffset,uf=vo.docView.domAtPos(vo.state.selection.main.anchor);return isEquivalentPosition(uf.node,uf.offset,pc,mc)&&([bo,Ra,pc,mc]=[pc,mc,bo,Ra]),{anchorNode:bo,anchorOffset:Ra,focusNode:pc,focusOffset:mc}}function safariSelectionRangeHack(vo,Ai){if(Ai.getComposedRanges){let pc=Ai.getComposedRanges(vo.root)[0];if(pc)return buildSelectionRangeFromRange(vo,pc)}let bo=null;function Ra(pc){pc.preventDefault(),pc.stopImmediatePropagation(),bo=pc.getTargetRanges()[0]}return vo.contentDOM.addEventListener("beforeinput",Ra,!0),vo.dom.ownerDocument.execCommand("indent"),vo.contentDOM.removeEventListener("beforeinput",Ra,!0),bo?buildSelectionRangeFromRange(vo,bo):null}class EditContextManager{constructor(Ai){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(Ai.state);let bo=this.editContext=new window.EditContext({text:Ai.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,Ai.state.selection.main.anchor))),selectionEnd:this.toContextPos(Ai.state.selection.main.head)});this.handlers.textupdate=Ra=>{let{anchor:pc}=Ai.state.selection.main,mc=this.toEditorPos(Ra.updateRangeStart),uf=this.toEditorPos(Ra.updateRangeEnd);Ai.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:Ra.updateRangeStart,editorBase:mc,drifted:!1});let df={from:mc,to:uf,insert:Text.of(Ra.text.split(`
|
|
355
|
-
`))};if(df.from==this.from&&pc<this.from?df.from=pc:df.to==this.to&&pc>this.to&&(df.to=pc),!(df.from==df.to&&!df.insert.length)){if(this.pendingContextChange=df,!Ai.state.readOnly){let ff=this.to-this.from+(df.to-df.from+df.insert.length);applyDOMChangeInner(Ai,df,EditorSelection.single(this.toEditorPos(Ra.selectionStart,ff),this.toEditorPos(Ra.selectionEnd,ff)))}this.pendingContextChange&&(this.revertPending(Ai.state),this.setSelection(Ai.state))}},this.handlers.characterboundsupdate=Ra=>{let pc=[],mc=null;for(let uf=this.toEditorPos(Ra.rangeStart),df=this.toEditorPos(Ra.rangeEnd);uf<df;uf++){let ff=Ai.coordsForChar(uf);mc=ff&&new DOMRect(ff.left,ff.top,ff.right-ff.left,ff.bottom-ff.top)||mc||new DOMRect,pc.push(mc)}bo.updateCharacterBounds(Ra.rangeStart,pc)},this.handlers.textformatupdate=Ra=>{let pc=[];for(let mc of Ra.getTextFormats()){let uf=mc.underlineStyle,df=mc.underlineThickness;if(uf!="None"&&df!="None"){let ff=this.toEditorPos(mc.rangeStart),hf=this.toEditorPos(mc.rangeEnd);if(ff<hf){let pf=`text-decoration: underline ${uf=="Dashed"?"dashed ":uf=="Squiggle"?"wavy ":""}${df=="Thin"?1:2}px`;pc.push(Decoration.mark({attributes:{style:pf}}).range(ff,hf))}}}Ai.dispatch({effects:setEditContextFormatting.of(Decoration.set(pc))})},this.handlers.compositionstart=()=>{Ai.inputState.composing<0&&(Ai.inputState.composing=0,Ai.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(Ai.inputState.composing=-1,Ai.inputState.compositionFirstChange=null,this.composing){let{drifted:Ra}=this.composing;this.composing=null,Ra&&this.reset(Ai.state)}};for(let Ra in this.handlers)bo.addEventListener(Ra,this.handlers[Ra]);this.measureReq={read:Ra=>{this.editContext.updateControlBounds(Ra.contentDOM.getBoundingClientRect());let pc=getSelection(Ra.root);pc&&pc.rangeCount&&this.editContext.updateSelectionBounds(pc.getRangeAt(0).getBoundingClientRect())}}}applyEdits(Ai){let bo=0,Ra=!1,pc=this.pendingContextChange;return Ai.changes.iterChanges((mc,uf,df,ff,hf)=>{if(Ra)return;let pf=hf.length-(uf-mc);if(pc&&uf>=pc.to)if(pc.from==mc&&pc.to==uf&&pc.insert.eq(hf)){pc=this.pendingContextChange=null,bo+=pf,this.to+=pf;return}else pc=null,this.revertPending(Ai.state);if(mc+=bo,uf+=bo,uf<=this.from)this.from+=pf,this.to+=pf;else if(mc<this.to){if(mc<this.from||uf>this.to||this.to-this.from+hf.length>3e4){Ra=!0;return}this.editContext.updateText(this.toContextPos(mc),this.toContextPos(uf),hf.toString()),this.to+=pf}bo+=pf}),pc&&!Ra&&this.revertPending(Ai.state),!Ra}update(Ai){let bo=this.pendingContextChange;this.composing&&(this.composing.drifted||Ai.transactions.some(Ra=>!Ra.isUserEvent("input.type")&&Ra.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=Ai.changes.mapPos(this.composing.editorBase)):!this.applyEdits(Ai)||!this.rangeIsValid(Ai.state)?(this.pendingContextChange=null,this.reset(Ai.state)):(Ai.docChanged||Ai.selectionSet||bo)&&this.setSelection(Ai.state),(Ai.geometryChanged||Ai.docChanged||Ai.selectionSet)&&Ai.view.requestMeasure(this.measureReq)}resetRange(Ai){let{head:bo}=Ai.selection.main;this.from=Math.max(0,bo-1e4),this.to=Math.min(Ai.doc.length,bo+1e4)}reset(Ai){this.resetRange(Ai),this.editContext.updateText(0,this.editContext.text.length,Ai.doc.sliceString(this.from,this.to)),this.setSelection(Ai)}revertPending(Ai){let bo=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(bo.from),this.toContextPos(bo.from+bo.insert.length),Ai.doc.sliceString(bo.from,bo.to))}setSelection(Ai){let{main:bo}=Ai.selection,Ra=this.toContextPos(Math.max(this.from,Math.min(this.to,bo.anchor))),pc=this.toContextPos(bo.head);(this.editContext.selectionStart!=Ra||this.editContext.selectionEnd!=pc)&&this.editContext.updateSelection(Ra,pc)}rangeIsValid(Ai){let{head:bo}=Ai.selection.main;return!(this.from>0&&bo-this.from<500||this.to<Ai.doc.length&&this.to-bo<500||this.to-this.from>1e4*3)}toEditorPos(Ai,bo=this.to-this.from){Ai=Math.min(Ai,bo);let Ra=this.composing;return Ra&&Ra.drifted?Ra.editorBase+(Ai-Ra.contextBase):Ai+this.from}toContextPos(Ai){let bo=this.composing;return bo&&bo.drifted?bo.contextBase+(Ai-bo.editorBase):Ai-this.from}destroy(){for(let Ai in this.handlers)this.editContext.removeEventListener(Ai,this.handlers[Ai])}}class EditorView{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(Ai={}){var bo;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),Ai.parent&&Ai.parent.appendChild(this.dom);let{dispatch:Ra}=Ai;this.dispatchTransactions=Ai.dispatchTransactions||Ra&&(pc=>pc.forEach(mc=>Ra(mc,this)))||(pc=>this.update(pc)),this.dispatch=this.dispatch.bind(this),this._root=Ai.root||getRoot(Ai.parent)||document,this.viewState=new ViewState(Ai.state||EditorState.create(Ai)),Ai.scrollTo&&Ai.scrollTo.is(scrollIntoView$1)&&(this.viewState.scrollTarget=Ai.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(viewPlugin).map(pc=>new PluginInstance(pc));for(let pc of this.plugins)pc.update(this);this.observer=new DOMObserver(this),this.inputState=new InputState(this),this.inputState.ensureHandlers(this.plugins),this.docView=new DocView(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((bo=document.fonts)===null||bo===void 0)&&bo.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...Ai){let bo=Ai.length==1&&Ai[0]instanceof Transaction?Ai:Ai.length==1&&Array.isArray(Ai[0])?Ai[0]:[this.state.update(...Ai)];this.dispatchTransactions(bo,this)}update(Ai){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let bo=!1,Ra=!1,pc,mc=this.state;for(let gf of Ai){if(gf.startState!=mc)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");mc=gf.state}if(this.destroyed){this.viewState.state=mc;return}let uf=this.hasFocus,df=0,ff=null;Ai.some(gf=>gf.annotation(isFocusChange))?(this.inputState.notifiedFocused=uf,df=1):uf!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=uf,ff=focusChangeTransaction(mc,uf),ff||(df=1));let hf=this.observer.delayedAndroidKey,pf=null;if(hf?(this.observer.clearDelayedAndroidKey(),pf=this.observer.readChange(),(pf&&!this.state.doc.eq(mc.doc)||!this.state.selection.eq(mc.selection))&&(pf=null)):this.observer.clear(),mc.facet(EditorState.phrases)!=this.state.facet(EditorState.phrases))return this.setState(mc);pc=ViewUpdate.create(this,mc,Ai),pc.flags|=df;let mf=this.viewState.scrollTarget;try{this.updateState=2;for(let gf of Ai){if(mf&&(mf=mf.map(gf.changes)),gf.scrollIntoView){let{main:yf}=gf.state.selection;mf=new ScrollTarget(yf.empty?yf:EditorSelection.cursor(yf.head,yf.head>yf.anchor?-1:1))}for(let yf of gf.effects)yf.is(scrollIntoView$1)&&(mf=yf.value.clip(this.state))}this.viewState.update(pc,mf),this.bidiCache=CachedOrder.update(this.bidiCache,pc.changes),pc.empty||(this.updatePlugins(pc),this.inputState.update(pc)),bo=this.docView.update(pc),this.state.facet(styleModule)!=this.styleModules&&this.mountStyles(),Ra=this.updateAttrs(),this.showAnnouncements(Ai),this.docView.updateSelection(bo,Ai.some(gf=>gf.isUserEvent("select.pointer")))}finally{this.updateState=0}if(pc.startState.facet(theme)!=pc.state.facet(theme)&&(this.viewState.mustMeasureContent=!0),(bo||Ra||mf||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),bo&&this.docViewUpdate(),!pc.empty)for(let gf of this.state.facet(updateListener))try{gf(pc)}catch(yf){logException(this.state,yf,"update listener")}(ff||pf)&&Promise.resolve().then(()=>{ff&&this.state==ff.startState&&this.dispatch(ff),pf&&!applyDOMChange(this,pf)&&hf.force&&dispatchKey(this.contentDOM,hf.key,hf.keyCode)})}setState(Ai){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=Ai;return}this.updateState=2;let bo=this.hasFocus;try{for(let Ra of this.plugins)Ra.destroy(this);this.viewState=new ViewState(Ai),this.plugins=Ai.facet(viewPlugin).map(Ra=>new PluginInstance(Ra)),this.pluginMap.clear();for(let Ra of this.plugins)Ra.update(this);this.docView.destroy(),this.docView=new DocView(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}bo&&this.focus(),this.requestMeasure()}updatePlugins(Ai){let bo=Ai.startState.facet(viewPlugin),Ra=Ai.state.facet(viewPlugin);if(bo!=Ra){let pc=[];for(let mc of Ra){let uf=bo.indexOf(mc);if(uf<0)pc.push(new PluginInstance(mc));else{let df=this.plugins[uf];df.mustUpdate=Ai,pc.push(df)}}for(let mc of this.plugins)mc.mustUpdate!=Ai&&mc.destroy(this);this.plugins=pc,this.pluginMap.clear()}else for(let pc of this.plugins)pc.mustUpdate=Ai;for(let pc=0;pc<this.plugins.length;pc++)this.plugins[pc].update(this);bo!=Ra&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let Ai of this.plugins){let bo=Ai.value;if(bo&&bo.docViewUpdate)try{bo.docViewUpdate(this)}catch(Ra){logException(this.state,Ra,"doc view update listener")}}}measure(Ai=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,Ai&&this.observer.forceFlush();let bo=null,Ra=this.scrollDOM,pc=Ra.scrollTop*this.scaleY,{scrollAnchorPos:mc,scrollAnchorHeight:uf}=this.viewState;Math.abs(pc-this.viewState.scrollTop)>1&&(uf=-1),this.viewState.scrollAnchorHeight=-1;try{for(let df=0;;df++){if(uf<0)if(isScrolledToBottom(Ra))mc=-1,uf=this.viewState.heightMap.height;else{let yf=this.viewState.scrollAnchorAt(pc);mc=yf.from,uf=yf.top}this.updateState=1;let ff=this.viewState.measure(this);if(!ff&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(df>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let hf=[];ff&4||([this.measureRequests,hf]=[hf,this.measureRequests]);let pf=hf.map(yf=>{try{return yf.read(this)}catch(vf){return logException(this.state,vf),BadMeasure}}),mf=ViewUpdate.create(this,this.state,[]),gf=!1;mf.flags|=ff,bo?bo.flags|=ff:bo=mf,this.updateState=2,mf.empty||(this.updatePlugins(mf),this.inputState.update(mf),this.updateAttrs(),gf=this.docView.update(mf),gf&&this.docViewUpdate());for(let yf=0;yf<hf.length;yf++)if(pf[yf]!=BadMeasure)try{let vf=hf[yf];vf.write&&vf.write(pf[yf],this)}catch(vf){logException(this.state,vf)}if(gf&&this.docView.updateSelection(!0),!mf.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,uf=-1;continue}else{let yf=(mc<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(mc).top)-uf;if(yf>1||yf<-1){pc=pc+yf,Ra.scrollTop=pc/this.scaleY,uf=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(bo&&!bo.empty)for(let df of this.state.facet(updateListener))df(bo)}get themeClasses(){return baseThemeID+" "+(this.state.facet(darkTheme)?baseDarkID:baseLightID)+" "+this.state.facet(theme)}updateAttrs(){let Ai=attrsFromFacet(this,editorAttributes,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),bo={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(editable)?"true":"false",class:"cm-content",style:`${browser.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(bo["aria-readonly"]="true"),attrsFromFacet(this,contentAttributes,bo);let Ra=this.observer.ignore(()=>{let pc=updateAttrs(this.contentDOM,this.contentAttrs,bo),mc=updateAttrs(this.dom,this.editorAttrs,Ai);return pc||mc});return this.editorAttrs=Ai,this.contentAttrs=bo,Ra}showAnnouncements(Ai){let bo=!0;for(let Ra of Ai)for(let pc of Ra.effects)if(pc.is(EditorView.announce)){bo&&(this.announceDOM.textContent=""),bo=!1;let mc=this.announceDOM.appendChild(document.createElement("div"));mc.textContent=pc.value}}mountStyles(){this.styleModules=this.state.facet(styleModule);let Ai=this.state.facet(EditorView.cspNonce);StyleModule.mount(this.root,this.styleModules.concat(baseTheme$1$2).reverse(),Ai?{nonce:Ai}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(Ai){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),Ai){if(this.measureRequests.indexOf(Ai)>-1)return;if(Ai.key!=null){for(let bo=0;bo<this.measureRequests.length;bo++)if(this.measureRequests[bo].key===Ai.key){this.measureRequests[bo]=Ai;return}}this.measureRequests.push(Ai)}}plugin(Ai){let bo=this.pluginMap.get(Ai);return(bo===void 0||bo&&bo.spec!=Ai)&&this.pluginMap.set(Ai,bo=this.plugins.find(Ra=>Ra.spec==Ai)||null),bo&&bo.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(Ai){return this.readMeasured(),this.viewState.elementAtHeight(Ai)}lineBlockAtHeight(Ai){return this.readMeasured(),this.viewState.lineBlockAtHeight(Ai)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(Ai){return this.viewState.lineBlockAt(Ai)}get contentHeight(){return this.viewState.contentHeight}moveByChar(Ai,bo,Ra){return skipAtoms(this,Ai,moveByChar(this,Ai,bo,Ra))}moveByGroup(Ai,bo){return skipAtoms(this,Ai,moveByChar(this,Ai,bo,Ra=>byGroup(this,Ai.head,Ra)))}visualLineSide(Ai,bo){let Ra=this.bidiSpans(Ai),pc=this.textDirectionAt(Ai.from),mc=Ra[bo?Ra.length-1:0];return EditorSelection.cursor(mc.side(bo,pc)+Ai.from,mc.forward(!bo,pc)?1:-1)}moveToLineBoundary(Ai,bo,Ra=!0){return moveToLineBoundary(this,Ai,bo,Ra)}moveVertically(Ai,bo,Ra){return skipAtoms(this,Ai,moveVertically(this,Ai,bo,Ra))}domAtPos(Ai){return this.docView.domAtPos(Ai)}posAtDOM(Ai,bo=0){return this.docView.posFromDOM(Ai,bo)}posAtCoords(Ai,bo=!0){return this.readMeasured(),posAtCoords(this,Ai,bo)}coordsAtPos(Ai,bo=1){this.readMeasured();let Ra=this.docView.coordsAt(Ai,bo);if(!Ra||Ra.left==Ra.right)return Ra;let pc=this.state.doc.lineAt(Ai),mc=this.bidiSpans(pc),uf=mc[BidiSpan.find(mc,Ai-pc.from,-1,bo)];return flattenRect(Ra,uf.dir==Direction.LTR==bo>0)}coordsForChar(Ai){return this.readMeasured(),this.docView.coordsForChar(Ai)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(Ai){return!this.state.facet(perLineTextDirection)||Ai<this.viewport.from||Ai>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(Ai))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(Ai){if(Ai.length>MaxBidiLine)return trivialOrder(Ai.length);let bo=this.textDirectionAt(Ai.from),Ra;for(let mc of this.bidiCache)if(mc.from==Ai.from&&mc.dir==bo&&(mc.fresh||isolatesEq(mc.isolates,Ra=getIsolatedRanges(this,Ai))))return mc.order;Ra||(Ra=getIsolatedRanges(this,Ai));let pc=computeOrder(Ai.text,bo,Ra);return this.bidiCache.push(new CachedOrder(Ai.from,Ai.to,bo,Ra,!0,pc)),pc}get hasFocus(){var Ai;return(this.dom.ownerDocument.hasFocus()||browser.safari&&((Ai=this.inputState)===null||Ai===void 0?void 0:Ai.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{focusPreventScroll(this.contentDOM),this.docView.updateSelection()})}setRoot(Ai){this._root!=Ai&&(this._root=Ai,this.observer.setWindow((Ai.nodeType==9?Ai:Ai.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let Ai of this.plugins)Ai.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(Ai,bo={}){return scrollIntoView$1.of(new ScrollTarget(typeof Ai=="number"?EditorSelection.cursor(Ai):Ai,bo.y,bo.x,bo.yMargin,bo.xMargin))}scrollSnapshot(){let{scrollTop:Ai,scrollLeft:bo}=this.scrollDOM,Ra=this.viewState.scrollAnchorAt(Ai);return scrollIntoView$1.of(new ScrollTarget(EditorSelection.cursor(Ra.from),"start","start",Ra.top-Ai,bo,!0))}setTabFocusMode(Ai){Ai==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof Ai=="boolean"?this.inputState.tabFocusMode=Ai?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+Ai)}static domEventHandlers(Ai){return ViewPlugin.define(()=>({}),{eventHandlers:Ai})}static domEventObservers(Ai){return ViewPlugin.define(()=>({}),{eventObservers:Ai})}static theme(Ai,bo){let Ra=StyleModule.newName(),pc=[theme.of(Ra),styleModule.of(buildTheme(`.${Ra}`,Ai))];return bo&&bo.dark&&pc.push(darkTheme.of(!0)),pc}static baseTheme(Ai){return Prec.lowest(styleModule.of(buildTheme("."+baseThemeID,Ai,lightDarkIDs)))}static findFromDOM(Ai){var bo;let Ra=Ai.querySelector(".cm-content"),pc=Ra&&ContentView.get(Ra)||ContentView.get(Ai);return((bo=pc==null?void 0:pc.rootView)===null||bo===void 0?void 0:bo.view)||null}}EditorView.styleModule=styleModule;EditorView.inputHandler=inputHandler$1;EditorView.clipboardInputFilter=clipboardInputFilter;EditorView.clipboardOutputFilter=clipboardOutputFilter;EditorView.scrollHandler=scrollHandler;EditorView.focusChangeEffect=focusChangeEffect;EditorView.perLineTextDirection=perLineTextDirection;EditorView.exceptionSink=exceptionSink;EditorView.updateListener=updateListener;EditorView.editable=editable;EditorView.mouseSelectionStyle=mouseSelectionStyle;EditorView.dragMovesSelection=dragMovesSelection$1;EditorView.clickAddsSelectionRange=clickAddsSelectionRange;EditorView.decorations=decorations;EditorView.outerDecorations=outerDecorations;EditorView.atomicRanges=atomicRanges;EditorView.bidiIsolatedRanges=bidiIsolatedRanges;EditorView.scrollMargins=scrollMargins;EditorView.darkTheme=darkTheme;EditorView.cspNonce=Facet.define({combine:vo=>vo.length?vo[0]:""});EditorView.contentAttributes=contentAttributes;EditorView.editorAttributes=editorAttributes;EditorView.lineWrapping=EditorView.contentAttributes.of({class:"cm-lineWrapping"});EditorView.announce=StateEffect.define();const MaxBidiLine=4096,BadMeasure={};class CachedOrder{constructor(Ai,bo,Ra,pc,mc,uf){this.from=Ai,this.to=bo,this.dir=Ra,this.isolates=pc,this.fresh=mc,this.order=uf}static update(Ai,bo){if(bo.empty&&!Ai.some(mc=>mc.fresh))return Ai;let Ra=[],pc=Ai.length?Ai[Ai.length-1].dir:Direction.LTR;for(let mc=Math.max(0,Ai.length-10);mc<Ai.length;mc++){let uf=Ai[mc];uf.dir==pc&&!bo.touchesRange(uf.from,uf.to)&&Ra.push(new CachedOrder(bo.mapPos(uf.from,1),bo.mapPos(uf.to,-1),uf.dir,uf.isolates,!1,uf.order))}return Ra}}function attrsFromFacet(vo,Ai,bo){for(let Ra=vo.state.facet(Ai),pc=Ra.length-1;pc>=0;pc--){let mc=Ra[pc],uf=typeof mc=="function"?mc(vo):mc;uf&&combineAttrs(uf,bo)}return bo}const currentPlatform=browser.mac?"mac":browser.windows?"win":browser.linux?"linux":"key";function normalizeKeyName(vo,Ai){const bo=vo.split(/-(?!$)/);let Ra=bo[bo.length-1];Ra=="Space"&&(Ra=" ");let pc,mc,uf,df;for(let ff=0;ff<bo.length-1;++ff){const hf=bo[ff];if(/^(cmd|meta|m)$/i.test(hf))df=!0;else if(/^a(lt)?$/i.test(hf))pc=!0;else if(/^(c|ctrl|control)$/i.test(hf))mc=!0;else if(/^s(hift)?$/i.test(hf))uf=!0;else if(/^mod$/i.test(hf))Ai=="mac"?df=!0:mc=!0;else throw new Error("Unrecognized modifier name: "+hf)}return pc&&(Ra="Alt-"+Ra),mc&&(Ra="Ctrl-"+Ra),df&&(Ra="Meta-"+Ra),uf&&(Ra="Shift-"+Ra),Ra}function modifiers(vo,Ai,bo){return Ai.altKey&&(vo="Alt-"+vo),Ai.ctrlKey&&(vo="Ctrl-"+vo),Ai.metaKey&&(vo="Meta-"+vo),bo!==!1&&Ai.shiftKey&&(vo="Shift-"+vo),vo}const handleKeyEvents=Prec.default(EditorView.domEventHandlers({keydown(vo,Ai){return runHandlers(getKeymap(Ai.state),vo,Ai,"editor")}})),keymap=Facet.define({enables:handleKeyEvents}),Keymaps=new WeakMap;function getKeymap(vo){let Ai=vo.facet(keymap),bo=Keymaps.get(Ai);return bo||Keymaps.set(Ai,bo=buildKeymap(Ai.reduce((Ra,pc)=>Ra.concat(pc),[]))),bo}function runScopeHandlers(vo,Ai,bo){return runHandlers(getKeymap(vo.state),Ai,vo,bo)}let storedPrefix=null;const PrefixTimeout=4e3;function buildKeymap(vo,Ai=currentPlatform){let bo=Object.create(null),Ra=Object.create(null),pc=(uf,df)=>{let ff=Ra[uf];if(ff==null)Ra[uf]=df;else if(ff!=df)throw new Error("Key binding "+uf+" is used both as a regular binding and as a multi-stroke prefix")},mc=(uf,df,ff,hf,pf)=>{var mf,gf;let yf=bo[uf]||(bo[uf]=Object.create(null)),vf=df.split(/ (?!$)/).map(xf=>normalizeKeyName(xf,Ai));for(let xf=1;xf<vf.length;xf++){let wf=vf.slice(0,xf).join(" ");pc(wf,!0),yf[wf]||(yf[wf]={preventDefault:!0,stopPropagation:!1,run:[If=>{let l1=storedPrefix={view:If,prefix:wf,scope:uf};return setTimeout(()=>{storedPrefix==l1&&(storedPrefix=null)},PrefixTimeout),!0}]})}let bf=vf.join(" ");pc(bf,!1);let Sf=yf[bf]||(yf[bf]={preventDefault:!1,stopPropagation:!1,run:((gf=(mf=yf._any)===null||mf===void 0?void 0:mf.run)===null||gf===void 0?void 0:gf.slice())||[]});ff&&Sf.run.push(ff),hf&&(Sf.preventDefault=!0),pf&&(Sf.stopPropagation=!0)};for(let uf of vo){let df=uf.scope?uf.scope.split(" "):["editor"];if(uf.any)for(let hf of df){let pf=bo[hf]||(bo[hf]=Object.create(null));pf._any||(pf._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:mf}=uf;for(let gf in pf)pf[gf].run.push(yf=>mf(yf,currentKeyEvent))}let ff=uf[Ai]||uf.key;if(ff)for(let hf of df)mc(hf,ff,uf.run,uf.preventDefault,uf.stopPropagation),uf.shift&&mc(hf,"Shift-"+ff,uf.shift,uf.preventDefault,uf.stopPropagation)}return bo}let currentKeyEvent=null;function runHandlers(vo,Ai,bo,Ra){currentKeyEvent=Ai;let pc=keyName(Ai),mc=codePointAt(pc,0),uf=codePointSize(mc)==pc.length&&pc!=" ",df="",ff=!1,hf=!1,pf=!1;storedPrefix&&storedPrefix.view==bo&&storedPrefix.scope==Ra&&(df=storedPrefix.prefix+" ",modifierCodes.indexOf(Ai.keyCode)<0&&(hf=!0,storedPrefix=null));let mf=new Set,gf=Sf=>{if(Sf){for(let xf of Sf.run)if(!mf.has(xf)&&(mf.add(xf),xf(bo)))return Sf.stopPropagation&&(pf=!0),!0;Sf.preventDefault&&(Sf.stopPropagation&&(pf=!0),hf=!0)}return!1},yf=vo[Ra],vf,bf;return yf&&(gf(yf[df+modifiers(pc,Ai,!uf)])?ff=!0:uf&&(Ai.altKey||Ai.metaKey||Ai.ctrlKey)&&!(browser.windows&&Ai.ctrlKey&&Ai.altKey)&&(vf=base[Ai.keyCode])&&vf!=pc?(gf(yf[df+modifiers(vf,Ai,!0)])||Ai.shiftKey&&(bf=shift[Ai.keyCode])!=pc&&bf!=vf&&gf(yf[df+modifiers(bf,Ai,!1)]))&&(ff=!0):uf&&Ai.shiftKey&&gf(yf[df+modifiers(pc,Ai,!0)])&&(ff=!0),!ff&&gf(yf._any)&&(ff=!0)),hf&&(ff=!0),ff&&pf&&Ai.stopPropagation(),currentKeyEvent=null,ff}class RectangleMarker{constructor(Ai,bo,Ra,pc,mc){this.className=Ai,this.left=bo,this.top=Ra,this.width=pc,this.height=mc}draw(){let Ai=document.createElement("div");return Ai.className=this.className,this.adjust(Ai),Ai}update(Ai,bo){return bo.className!=this.className?!1:(this.adjust(Ai),!0)}adjust(Ai){Ai.style.left=this.left+"px",Ai.style.top=this.top+"px",this.width!=null&&(Ai.style.width=this.width+"px"),Ai.style.height=this.height+"px"}eq(Ai){return this.left==Ai.left&&this.top==Ai.top&&this.width==Ai.width&&this.height==Ai.height&&this.className==Ai.className}static forRange(Ai,bo,Ra){if(Ra.empty){let pc=Ai.coordsAtPos(Ra.head,Ra.assoc||1);if(!pc)return[];let mc=getBase(Ai);return[new RectangleMarker(bo,pc.left-mc.left,pc.top-mc.top,null,pc.bottom-pc.top)]}else return rectanglesForRange(Ai,bo,Ra)}}function getBase(vo){let Ai=vo.scrollDOM.getBoundingClientRect();return{left:(vo.textDirection==Direction.LTR?Ai.left:Ai.right-vo.scrollDOM.clientWidth*vo.scaleX)-vo.scrollDOM.scrollLeft*vo.scaleX,top:Ai.top-vo.scrollDOM.scrollTop*vo.scaleY}}function wrappedLine(vo,Ai,bo,Ra){let pc=vo.coordsAtPos(Ai,bo*2);if(!pc)return Ra;let mc=vo.dom.getBoundingClientRect(),uf=(pc.top+pc.bottom)/2,df=vo.posAtCoords({x:mc.left+1,y:uf}),ff=vo.posAtCoords({x:mc.right-1,y:uf});return df==null||ff==null?Ra:{from:Math.max(Ra.from,Math.min(df,ff)),to:Math.min(Ra.to,Math.max(df,ff))}}function rectanglesForRange(vo,Ai,bo){if(bo.to<=vo.viewport.from||bo.from>=vo.viewport.to)return[];let Ra=Math.max(bo.from,vo.viewport.from),pc=Math.min(bo.to,vo.viewport.to),mc=vo.textDirection==Direction.LTR,uf=vo.contentDOM,df=uf.getBoundingClientRect(),ff=getBase(vo),hf=uf.querySelector(".cm-line"),pf=hf&&window.getComputedStyle(hf),mf=df.left+(pf?parseInt(pf.paddingLeft)+Math.min(0,parseInt(pf.textIndent)):0),gf=df.right-(pf?parseInt(pf.paddingRight):0),yf=blockAt(vo,Ra),vf=blockAt(vo,pc),bf=yf.type==BlockType.Text?yf:null,Sf=vf.type==BlockType.Text?vf:null;if(bf&&(vo.lineWrapping||yf.widgetLineBreaks)&&(bf=wrappedLine(vo,Ra,1,bf)),Sf&&(vo.lineWrapping||vf.widgetLineBreaks)&&(Sf=wrappedLine(vo,pc,-1,Sf)),bf&&Sf&&bf.from==Sf.from&&bf.to==Sf.to)return wf(If(bo.from,bo.to,bf));{let s1=bf?If(bo.from,null,bf):l1(yf,!1),c1=Sf?If(null,bo.to,Sf):l1(vf,!0),u1=[];return(bf||yf).to<(Sf||vf).from-(bf&&Sf?1:0)||yf.widgetLineBreaks>1&&s1.bottom+vo.defaultLineHeight/2<c1.top?u1.push(xf(mf,s1.bottom,gf,c1.top)):s1.bottom<c1.top&&vo.elementAtHeight((s1.bottom+c1.top)/2).type==BlockType.Text&&(s1.bottom=c1.top=(s1.bottom+c1.top)/2),wf(s1).concat(u1).concat(wf(c1))}function xf(s1,c1,u1,T1){return new RectangleMarker(Ai,s1-ff.left,c1-ff.top,u1-s1,T1-c1)}function wf({top:s1,bottom:c1,horizontal:u1}){let T1=[];for(let _1=0;_1<u1.length;_1+=2)T1.push(xf(u1[_1],s1,u1[_1+1],c1));return T1}function If(s1,c1,u1){let T1=1e9,_1=-1e9,R1=[];function P1(m1,$1,k1,F1,U1){let B1=vo.coordsAtPos(m1,m1==u1.to?-2:2),W1=vo.coordsAtPos(k1,k1==u1.from?2:-2);!B1||!W1||(T1=Math.min(B1.top,W1.top,T1),_1=Math.max(B1.bottom,W1.bottom,_1),U1==Direction.LTR?R1.push(mc&&$1?mf:B1.left,mc&&F1?gf:W1.right):R1.push(!mc&&F1?mf:W1.left,!mc&&$1?gf:B1.right))}let E1=s1??u1.from,M1=c1??u1.to;for(let m1 of vo.visibleRanges)if(m1.to>E1&&m1.from<M1)for(let $1=Math.max(m1.from,E1),k1=Math.min(m1.to,M1);;){let F1=vo.state.doc.lineAt($1);for(let U1 of vo.bidiSpans(F1)){let B1=U1.from+F1.from,W1=U1.to+F1.from;if(B1>=k1)break;W1>$1&&P1(Math.max(B1,$1),s1==null&&B1<=E1,Math.min(W1,k1),c1==null&&W1>=M1,U1.dir)}if($1=F1.to+1,$1>=k1)break}return R1.length==0&&P1(E1,s1==null,M1,c1==null,vo.textDirection),{top:T1,bottom:_1,horizontal:R1}}function l1(s1,c1){let u1=df.top+(c1?s1.top:s1.bottom);return{top:u1,bottom:u1,horizontal:[]}}}function sameMarker(vo,Ai){return vo.constructor==Ai.constructor&&vo.eq(Ai)}class LayerView{constructor(Ai,bo){this.view=Ai,this.layer=bo,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=Ai.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),bo.above&&this.dom.classList.add("cm-layer-above"),bo.class&&this.dom.classList.add(bo.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(Ai.state),Ai.requestMeasure(this.measureReq),bo.mount&&bo.mount(this.dom,Ai)}update(Ai){Ai.startState.facet(layerOrder)!=Ai.state.facet(layerOrder)&&this.setOrder(Ai.state),(this.layer.update(Ai,this.dom)||Ai.geometryChanged)&&(this.scale(),Ai.view.requestMeasure(this.measureReq))}docViewUpdate(Ai){this.layer.updateOnDocViewUpdate!==!1&&Ai.requestMeasure(this.measureReq)}setOrder(Ai){let bo=0,Ra=Ai.facet(layerOrder);for(;bo<Ra.length&&Ra[bo]!=this.layer;)bo++;this.dom.style.zIndex=String((this.layer.above?150:-1)-bo)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:Ai,scaleY:bo}=this.view;(Ai!=this.scaleX||bo!=this.scaleY)&&(this.scaleX=Ai,this.scaleY=bo,this.dom.style.transform=`scale(${1/Ai}, ${1/bo})`)}draw(Ai){if(Ai.length!=this.drawn.length||Ai.some((bo,Ra)=>!sameMarker(bo,this.drawn[Ra]))){let bo=this.dom.firstChild,Ra=0;for(let pc of Ai)pc.update&&bo&&pc.constructor&&this.drawn[Ra].constructor&&pc.update(bo,this.drawn[Ra])?(bo=bo.nextSibling,Ra++):this.dom.insertBefore(pc.draw(),bo);for(;bo;){let pc=bo.nextSibling;bo.remove(),bo=pc}this.drawn=Ai}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const layerOrder=Facet.define();function layer(vo){return[ViewPlugin.define(Ai=>new LayerView(Ai,vo)),layerOrder.of(vo)]}const CanHidePrimary=!(browser.ios&&browser.webkit&&browser.webkit_version<534),selectionConfig=Facet.define({combine(vo){return combineConfig(vo,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(Ai,bo)=>Math.min(Ai,bo),drawRangeCursor:(Ai,bo)=>Ai||bo})}});function drawSelection(vo={}){return[selectionConfig.of(vo),cursorLayer,selectionLayer,hideNativeSelection,nativeSelectionHidden.of(!0)]}function configChanged(vo){return vo.startState.facet(selectionConfig)!=vo.state.facet(selectionConfig)}const cursorLayer=layer({above:!0,markers(vo){let{state:Ai}=vo,bo=Ai.facet(selectionConfig),Ra=[];for(let pc of Ai.selection.ranges){let mc=pc==Ai.selection.main;if(pc.empty?!mc||CanHidePrimary:bo.drawRangeCursor){let uf=mc?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",df=pc.empty?pc:EditorSelection.cursor(pc.head,pc.head>pc.anchor?-1:1);for(let ff of RectangleMarker.forRange(vo,uf,df))Ra.push(ff)}}return Ra},update(vo,Ai){vo.transactions.some(Ra=>Ra.selection)&&(Ai.style.animationName=Ai.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let bo=configChanged(vo);return bo&&setBlinkRate(vo.state,Ai),vo.docChanged||vo.selectionSet||bo},mount(vo,Ai){setBlinkRate(Ai.state,vo)},class:"cm-cursorLayer"});function setBlinkRate(vo,Ai){Ai.style.animationDuration=vo.facet(selectionConfig).cursorBlinkRate+"ms"}const selectionLayer=layer({above:!1,markers(vo){return vo.state.selection.ranges.map(Ai=>Ai.empty?[]:RectangleMarker.forRange(vo,"cm-selectionBackground",Ai)).reduce((Ai,bo)=>Ai.concat(bo))},update(vo,Ai){return vo.docChanged||vo.selectionSet||vo.viewportChanged||configChanged(vo)},class:"cm-selectionLayer"}),themeSpec={".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"}},".cm-content":{"& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}};CanHidePrimary&&(themeSpec[".cm-line"].caretColor=themeSpec[".cm-content"].caretColor="transparent !important");const hideNativeSelection=Prec.highest(EditorView.theme(themeSpec)),setDropCursorPos=StateEffect.define({map(vo,Ai){return vo==null?null:Ai.mapPos(vo)}}),dropCursorPos=StateField.define({create(){return null},update(vo,Ai){return vo!=null&&(vo=Ai.changes.mapPos(vo)),Ai.effects.reduce((bo,Ra)=>Ra.is(setDropCursorPos)?Ra.value:bo,vo)}}),drawDropCursor=ViewPlugin.fromClass(class{constructor(vo){this.view=vo,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(vo){var Ai;let bo=vo.state.field(dropCursorPos);bo==null?this.cursor!=null&&((Ai=this.cursor)===null||Ai===void 0||Ai.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(vo.startState.field(dropCursorPos)!=bo||vo.docChanged||vo.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:vo}=this,Ai=vo.state.field(dropCursorPos),bo=Ai!=null&&vo.coordsAtPos(Ai);if(!bo)return null;let Ra=vo.scrollDOM.getBoundingClientRect();return{left:bo.left-Ra.left+vo.scrollDOM.scrollLeft*vo.scaleX,top:bo.top-Ra.top+vo.scrollDOM.scrollTop*vo.scaleY,height:bo.bottom-bo.top}}drawCursor(vo){if(this.cursor){let{scaleX:Ai,scaleY:bo}=this.view;vo?(this.cursor.style.left=vo.left/Ai+"px",this.cursor.style.top=vo.top/bo+"px",this.cursor.style.height=vo.height/bo+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(vo){this.view.state.field(dropCursorPos)!=vo&&this.view.dispatch({effects:setDropCursorPos.of(vo)})}},{eventObservers:{dragover(vo){this.setDropPos(this.view.posAtCoords({x:vo.clientX,y:vo.clientY}))},dragleave(vo){(vo.target==this.view.contentDOM||!this.view.contentDOM.contains(vo.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function dropCursor(){return[dropCursorPos,drawDropCursor]}function iterMatches(vo,Ai,bo,Ra,pc){Ai.lastIndex=0;for(let mc=vo.iterRange(bo,Ra),uf=bo,df;!mc.next().done;uf+=mc.value.length)if(!mc.lineBreak)for(;df=Ai.exec(mc.value);)pc(uf+df.index,df)}function matchRanges(vo,Ai){let bo=vo.visibleRanges;if(bo.length==1&&bo[0].from==vo.viewport.from&&bo[0].to==vo.viewport.to)return bo;let Ra=[];for(let{from:pc,to:mc}of bo)pc=Math.max(vo.state.doc.lineAt(pc).from,pc-Ai),mc=Math.min(vo.state.doc.lineAt(mc).to,mc+Ai),Ra.length&&Ra[Ra.length-1].to>=pc?Ra[Ra.length-1].to=mc:Ra.push({from:pc,to:mc});return Ra}class MatchDecorator{constructor(Ai){const{regexp:bo,decoration:Ra,decorate:pc,boundary:mc,maxLength:uf=1e3}=Ai;if(!bo.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=bo,pc)this.addMatch=(df,ff,hf,pf)=>pc(pf,hf,hf+df[0].length,df,ff);else if(typeof Ra=="function")this.addMatch=(df,ff,hf,pf)=>{let mf=Ra(df,ff,hf);mf&&pf(hf,hf+df[0].length,mf)};else if(Ra)this.addMatch=(df,ff,hf,pf)=>pf(hf,hf+df[0].length,Ra);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=mc,this.maxLength=uf}createDeco(Ai){let bo=new RangeSetBuilder,Ra=bo.add.bind(bo);for(let{from:pc,to:mc}of matchRanges(Ai,this.maxLength))iterMatches(Ai.state.doc,this.regexp,pc,mc,(uf,df)=>this.addMatch(df,Ai,uf,Ra));return bo.finish()}updateDeco(Ai,bo){let Ra=1e9,pc=-1;return Ai.docChanged&&Ai.changes.iterChanges((mc,uf,df,ff)=>{ff>=Ai.view.viewport.from&&df<=Ai.view.viewport.to&&(Ra=Math.min(df,Ra),pc=Math.max(ff,pc))}),Ai.viewportMoved||pc-Ra>1e3?this.createDeco(Ai.view):pc>-1?this.updateRange(Ai.view,bo.map(Ai.changes),Ra,pc):bo}updateRange(Ai,bo,Ra,pc){for(let mc of Ai.visibleRanges){let uf=Math.max(mc.from,Ra),df=Math.min(mc.to,pc);if(df>uf){let ff=Ai.state.doc.lineAt(uf),hf=ff.to<df?Ai.state.doc.lineAt(df):ff,pf=Math.max(mc.from,ff.from),mf=Math.min(mc.to,hf.to);if(this.boundary){for(;uf>ff.from;uf--)if(this.boundary.test(ff.text[uf-1-ff.from])){pf=uf;break}for(;df<hf.to;df++)if(this.boundary.test(hf.text[df-hf.from])){mf=df;break}}let gf=[],yf,vf=(bf,Sf,xf)=>gf.push(xf.range(bf,Sf));if(ff==hf)for(this.regexp.lastIndex=pf-ff.from;(yf=this.regexp.exec(ff.text))&&yf.index<mf-ff.from;)this.addMatch(yf,Ai,yf.index+ff.from,vf);else iterMatches(Ai.state.doc,this.regexp,pf,mf,(bf,Sf)=>this.addMatch(Sf,Ai,bf,vf));bo=bo.update({filterFrom:pf,filterTo:mf,filter:(bf,Sf)=>bf<pf||Sf>mf,add:gf})}}return bo}}const UnicodeRegexpSupport=/x/.unicode!=null?"gu":"g",Specials=new RegExp(`[\0-\b
|
|
356
|
-
--\u2028\u2029\uFEFF-]`,UnicodeRegexpSupport),Names={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let _supportsTabSize=null;function supportsTabSize(){var vo;if(_supportsTabSize==null&&typeof document<"u"&&document.body){let Ai=document.body.style;_supportsTabSize=((vo=Ai.tabSize)!==null&&vo!==void 0?vo:Ai.MozTabSize)!=null}return _supportsTabSize||!1}const specialCharConfig=Facet.define({combine(vo){let Ai=combineConfig(vo,{render:null,specialChars:Specials,addSpecialChars:null});return(Ai.replaceTabs=!supportsTabSize())&&(Ai.specialChars=new RegExp(" |"+Ai.specialChars.source,UnicodeRegexpSupport)),Ai.addSpecialChars&&(Ai.specialChars=new RegExp(Ai.specialChars.source+"|"+Ai.addSpecialChars.source,UnicodeRegexpSupport)),Ai}});function highlightSpecialChars(vo={}){return[specialCharConfig.of(vo),specialCharPlugin()]}let _plugin=null;function specialCharPlugin(){return _plugin||(_plugin=ViewPlugin.fromClass(class{constructor(vo){this.view=vo,this.decorations=Decoration.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(vo.state.facet(specialCharConfig)),this.decorations=this.decorator.createDeco(vo)}makeDecorator(vo){return new MatchDecorator({regexp:vo.specialChars,decoration:(Ai,bo,Ra)=>{let{doc:pc}=bo.state,mc=codePointAt(Ai[0],0);if(mc==9){let uf=pc.lineAt(Ra),df=bo.state.tabSize,ff=countColumn(uf.text,df,Ra-uf.from);return Decoration.replace({widget:new TabWidget((df-ff%df)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[mc]||(this.decorationCache[mc]=Decoration.replace({widget:new SpecialCharWidget(vo,mc)}))},boundary:vo.replaceTabs?void 0:/[^]/})}update(vo){let Ai=vo.state.facet(specialCharConfig);vo.startState.facet(specialCharConfig)!=Ai?(this.decorator=this.makeDecorator(Ai),this.decorations=this.decorator.createDeco(vo.view)):this.decorations=this.decorator.updateDeco(vo,this.decorations)}},{decorations:vo=>vo.decorations}))}const DefaultPlaceholder="•";function placeholder$1(vo){return vo>=32?DefaultPlaceholder:vo==10?"":String.fromCharCode(9216+vo)}class SpecialCharWidget extends WidgetType{constructor(Ai,bo){super(),this.options=Ai,this.code=bo}eq(Ai){return Ai.code==this.code}toDOM(Ai){let bo=placeholder$1(this.code),Ra=Ai.state.phrase("Control character")+" "+(Names[this.code]||"0x"+this.code.toString(16)),pc=this.options.render&&this.options.render(this.code,Ra,bo);if(pc)return pc;let mc=document.createElement("span");return mc.textContent=bo,mc.title=Ra,mc.setAttribute("aria-label",Ra),mc.className="cm-specialChar",mc}ignoreEvent(){return!1}}class TabWidget extends WidgetType{constructor(Ai){super(),this.width=Ai}eq(Ai){return Ai.width==this.width}toDOM(){let Ai=document.createElement("span");return Ai.textContent=" ",Ai.className="cm-tab",Ai.style.width=this.width+"px",Ai}ignoreEvent(){return!1}}function highlightActiveLine(){return activeLineHighlighter}const lineDeco=Decoration.line({class:"cm-activeLine"}),activeLineHighlighter=ViewPlugin.fromClass(class{constructor(vo){this.decorations=this.getDeco(vo)}update(vo){(vo.docChanged||vo.selectionSet)&&(this.decorations=this.getDeco(vo.view))}getDeco(vo){let Ai=-1,bo=[];for(let Ra of vo.state.selection.ranges){let pc=vo.lineBlockAt(Ra.head);pc.from>Ai&&(bo.push(lineDeco.range(pc.from)),Ai=pc.from)}return Decoration.set(bo)}},{decorations:vo=>vo.decorations}),MaxOff=2e3;function rectangleFor(vo,Ai,bo){let Ra=Math.min(Ai.line,bo.line),pc=Math.max(Ai.line,bo.line),mc=[];if(Ai.off>MaxOff||bo.off>MaxOff||Ai.col<0||bo.col<0){let uf=Math.min(Ai.off,bo.off),df=Math.max(Ai.off,bo.off);for(let ff=Ra;ff<=pc;ff++){let hf=vo.doc.line(ff);hf.length<=df&&mc.push(EditorSelection.range(hf.from+uf,hf.to+df))}}else{let uf=Math.min(Ai.col,bo.col),df=Math.max(Ai.col,bo.col);for(let ff=Ra;ff<=pc;ff++){let hf=vo.doc.line(ff),pf=findColumn(hf.text,uf,vo.tabSize,!0);if(pf<0)mc.push(EditorSelection.cursor(hf.to));else{let mf=findColumn(hf.text,df,vo.tabSize);mc.push(EditorSelection.range(hf.from+pf,hf.from+mf))}}}return mc}function absoluteColumn(vo,Ai){let bo=vo.coordsAtPos(vo.viewport.from);return bo?Math.round(Math.abs((bo.left-Ai)/vo.defaultCharacterWidth)):-1}function getPos(vo,Ai){let bo=vo.posAtCoords({x:Ai.clientX,y:Ai.clientY},!1),Ra=vo.state.doc.lineAt(bo),pc=bo-Ra.from,mc=pc>MaxOff?-1:pc==Ra.length?absoluteColumn(vo,Ai.clientX):countColumn(Ra.text,vo.state.tabSize,bo-Ra.from);return{line:Ra.number,col:mc,off:pc}}function rectangleSelectionStyle(vo,Ai){let bo=getPos(vo,Ai),Ra=vo.state.selection;return bo?{update(pc){if(pc.docChanged){let mc=pc.changes.mapPos(pc.startState.doc.line(bo.line).from),uf=pc.state.doc.lineAt(mc);bo={line:uf.number,col:bo.col,off:Math.min(bo.off,uf.length)},Ra=Ra.map(pc.changes)}},get(pc,mc,uf){let df=getPos(vo,pc);if(!df)return Ra;let ff=rectangleFor(vo.state,bo,df);return ff.length?uf?EditorSelection.create(ff.concat(Ra.ranges)):EditorSelection.create(ff):Ra}}:null}function rectangularSelection(vo){let Ai=bo=>bo.altKey&&bo.button==0;return EditorView.mouseSelectionStyle.of((bo,Ra)=>Ai(Ra)?rectangleSelectionStyle(bo,Ra):null)}const keys={Alt:[18,vo=>!!vo.altKey],Control:[17,vo=>!!vo.ctrlKey],Shift:[16,vo=>!!vo.shiftKey],Meta:[91,vo=>!!vo.metaKey]},showCrosshair={style:"cursor: crosshair"};function crosshairCursor(vo={}){let[Ai,bo]=keys[vo.key||"Alt"],Ra=ViewPlugin.fromClass(class{constructor(pc){this.view=pc,this.isDown=!1}set(pc){this.isDown!=pc&&(this.isDown=pc,this.view.update([]))}},{eventObservers:{keydown(pc){this.set(pc.keyCode==Ai||bo(pc))},keyup(pc){(pc.keyCode==Ai||!bo(pc))&&this.set(!1)},mousemove(pc){this.set(bo(pc))}}});return[Ra,EditorView.contentAttributes.of(pc=>{var mc;return!((mc=pc.plugin(Ra))===null||mc===void 0)&&mc.isDown?showCrosshair:null})]}const Outside="-10000px";class TooltipViewManager{constructor(Ai,bo,Ra,pc){this.facet=bo,this.createTooltipView=Ra,this.removeTooltipView=pc,this.input=Ai.state.facet(bo),this.tooltips=this.input.filter(uf=>uf);let mc=null;this.tooltipViews=this.tooltips.map(uf=>mc=Ra(uf,mc))}update(Ai,bo){var Ra;let pc=Ai.state.facet(this.facet),mc=pc.filter(ff=>ff);if(pc===this.input){for(let ff of this.tooltipViews)ff.update&&ff.update(Ai);return!1}let uf=[],df=bo?[]:null;for(let ff=0;ff<mc.length;ff++){let hf=mc[ff],pf=-1;if(hf){for(let mf=0;mf<this.tooltips.length;mf++){let gf=this.tooltips[mf];gf&&gf.create==hf.create&&(pf=mf)}if(pf<0)uf[ff]=this.createTooltipView(hf,ff?uf[ff-1]:null),df&&(df[ff]=!!hf.above);else{let mf=uf[ff]=this.tooltipViews[pf];df&&(df[ff]=bo[pf]),mf.update&&mf.update(Ai)}}}for(let ff of this.tooltipViews)uf.indexOf(ff)<0&&(this.removeTooltipView(ff),(Ra=ff.destroy)===null||Ra===void 0||Ra.call(ff));return bo&&(df.forEach((ff,hf)=>bo[hf]=ff),bo.length=df.length),this.input=pc,this.tooltips=mc,this.tooltipViews=uf,!0}}function windowSpace(vo){let{win:Ai}=vo;return{top:0,left:0,bottom:Ai.innerHeight,right:Ai.innerWidth}}const tooltipConfig=Facet.define({combine:vo=>{var Ai,bo,Ra;return{position:browser.ios?"absolute":((Ai=vo.find(pc=>pc.position))===null||Ai===void 0?void 0:Ai.position)||"fixed",parent:((bo=vo.find(pc=>pc.parent))===null||bo===void 0?void 0:bo.parent)||null,tooltipSpace:((Ra=vo.find(pc=>pc.tooltipSpace))===null||Ra===void 0?void 0:Ra.tooltipSpace)||windowSpace}}}),knownHeight=new WeakMap,tooltipPlugin=ViewPlugin.fromClass(class{constructor(vo){this.view=vo,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let Ai=vo.state.facet(tooltipConfig);this.position=Ai.position,this.parent=Ai.parent,this.classes=vo.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new TooltipViewManager(vo,showTooltip,(bo,Ra)=>this.createTooltip(bo,Ra),bo=>{this.resizeObserver&&this.resizeObserver.unobserve(bo.dom),bo.dom.remove()}),this.above=this.manager.tooltips.map(bo=>!!bo.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(bo=>{Date.now()>this.lastTransaction-50&&bo.length>0&&bo[bo.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),vo.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let vo of this.manager.tooltipViews)this.intersectionObserver.observe(vo.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(vo){vo.transactions.length&&(this.lastTransaction=Date.now());let Ai=this.manager.update(vo,this.above);Ai&&this.observeIntersection();let bo=Ai||vo.geometryChanged,Ra=vo.state.facet(tooltipConfig);if(Ra.position!=this.position&&!this.madeAbsolute){this.position=Ra.position;for(let pc of this.manager.tooltipViews)pc.dom.style.position=this.position;bo=!0}if(Ra.parent!=this.parent){this.parent&&this.container.remove(),this.parent=Ra.parent,this.createContainer();for(let pc of this.manager.tooltipViews)this.container.appendChild(pc.dom);bo=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);bo&&this.maybeMeasure()}createTooltip(vo,Ai){let bo=vo.create(this.view),Ra=Ai?Ai.dom:null;if(bo.dom.classList.add("cm-tooltip"),vo.arrow&&!bo.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let pc=document.createElement("div");pc.className="cm-tooltip-arrow",bo.dom.appendChild(pc)}return bo.dom.style.position=this.position,bo.dom.style.top=Outside,bo.dom.style.left="0px",this.container.insertBefore(bo.dom,Ra),bo.mount&&bo.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(bo.dom),bo}destroy(){var vo,Ai,bo;this.view.win.removeEventListener("resize",this.measureSoon);for(let Ra of this.manager.tooltipViews)Ra.dom.remove(),(vo=Ra.destroy)===null||vo===void 0||vo.call(Ra);this.parent&&this.container.remove(),(Ai=this.resizeObserver)===null||Ai===void 0||Ai.disconnect(),(bo=this.intersectionObserver)===null||bo===void 0||bo.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let vo=1,Ai=1,bo=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:mc}=this.manager.tooltipViews[0];if(browser.gecko)bo=mc.offsetParent!=this.container.ownerDocument.body;else if(mc.style.top==Outside&&mc.style.left=="0px"){let uf=mc.getBoundingClientRect();bo=Math.abs(uf.top+1e4)>1||Math.abs(uf.left)>1}}if(bo||this.position=="absolute")if(this.parent){let mc=this.parent.getBoundingClientRect();mc.width&&mc.height&&(vo=mc.width/this.parent.offsetWidth,Ai=mc.height/this.parent.offsetHeight)}else({scaleX:vo,scaleY:Ai}=this.view.viewState);let Ra=this.view.scrollDOM.getBoundingClientRect(),pc=getScrollMargins(this.view);return{visible:{left:Ra.left+pc.left,top:Ra.top+pc.top,right:Ra.right-pc.right,bottom:Ra.bottom-pc.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((mc,uf)=>{let df=this.manager.tooltipViews[uf];return df.getCoords?df.getCoords(mc.pos):this.view.coordsAtPos(mc.pos)}),size:this.manager.tooltipViews.map(({dom:mc})=>mc.getBoundingClientRect()),space:this.view.state.facet(tooltipConfig).tooltipSpace(this.view),scaleX:vo,scaleY:Ai,makeAbsolute:bo}}writeMeasure(vo){var Ai;if(vo.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let df of this.manager.tooltipViews)df.dom.style.position="absolute"}let{visible:bo,space:Ra,scaleX:pc,scaleY:mc}=vo,uf=[];for(let df=0;df<this.manager.tooltips.length;df++){let ff=this.manager.tooltips[df],hf=this.manager.tooltipViews[df],{dom:pf}=hf,mf=vo.pos[df],gf=vo.size[df];if(!mf||ff.clip!==!1&&(mf.bottom<=Math.max(bo.top,Ra.top)||mf.top>=Math.min(bo.bottom,Ra.bottom)||mf.right<Math.max(bo.left,Ra.left)-.1||mf.left>Math.min(bo.right,Ra.right)+.1)){pf.style.top=Outside;continue}let yf=ff.arrow?hf.dom.querySelector(".cm-tooltip-arrow"):null,vf=yf?7:0,bf=gf.right-gf.left,Sf=(Ai=knownHeight.get(hf))!==null&&Ai!==void 0?Ai:gf.bottom-gf.top,xf=hf.offset||noOffset,wf=this.view.textDirection==Direction.LTR,If=gf.width>Ra.right-Ra.left?wf?Ra.left:Ra.right-gf.width:wf?Math.max(Ra.left,Math.min(mf.left-(yf?14:0)+xf.x,Ra.right-bf)):Math.min(Math.max(Ra.left,mf.left-bf+(yf?14:0)-xf.x),Ra.right-bf),l1=this.above[df];!ff.strictSide&&(l1?mf.top-Sf-vf-xf.y<Ra.top:mf.bottom+Sf+vf+xf.y>Ra.bottom)&&l1==Ra.bottom-mf.bottom>mf.top-Ra.top&&(l1=this.above[df]=!l1);let s1=(l1?mf.top-Ra.top:Ra.bottom-mf.bottom)-vf;if(s1<Sf&&hf.resize!==!1){if(s1<this.view.defaultLineHeight){pf.style.top=Outside;continue}knownHeight.set(hf,Sf),pf.style.height=(Sf=s1)/mc+"px"}else pf.style.height&&(pf.style.height="");let c1=l1?mf.top-Sf-vf-xf.y:mf.bottom+vf+xf.y,u1=If+bf;if(hf.overlap!==!0)for(let T1 of uf)T1.left<u1&&T1.right>If&&T1.top<c1+Sf&&T1.bottom>c1&&(c1=l1?T1.top-Sf-2-vf:T1.bottom+vf+2);if(this.position=="absolute"?(pf.style.top=(c1-vo.parent.top)/mc+"px",setLeftStyle(pf,(If-vo.parent.left)/pc)):(pf.style.top=c1/mc+"px",setLeftStyle(pf,If/pc)),yf){let T1=mf.left+(wf?xf.x:-xf.x)-(If+14-7);yf.style.left=T1/pc+"px"}hf.overlap!==!0&&uf.push({left:If,top:c1,right:u1,bottom:c1+Sf}),pf.classList.toggle("cm-tooltip-above",l1),pf.classList.toggle("cm-tooltip-below",!l1),hf.positioned&&hf.positioned(vo.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let vo of this.manager.tooltipViews)vo.dom.style.top=Outside}},{eventObservers:{scroll(){this.maybeMeasure()}}});function setLeftStyle(vo,Ai){let bo=parseInt(vo.style.left,10);(isNaN(bo)||Math.abs(Ai-bo)>1)&&(vo.style.left=Ai+"px")}const baseTheme$5=EditorView.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),noOffset={x:0,y:0},showTooltip=Facet.define({enables:[tooltipPlugin,baseTheme$5]}),showHoverTooltip=Facet.define({combine:vo=>vo.reduce((Ai,bo)=>Ai.concat(bo),[])});class HoverTooltipHost{static create(Ai){return new HoverTooltipHost(Ai)}constructor(Ai){this.view=Ai,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new TooltipViewManager(Ai,showHoverTooltip,(bo,Ra)=>this.createHostedView(bo,Ra),bo=>bo.dom.remove())}createHostedView(Ai,bo){let Ra=Ai.create(this.view);return Ra.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(Ra.dom,bo?bo.dom.nextSibling:this.dom.firstChild),this.mounted&&Ra.mount&&Ra.mount(this.view),Ra}mount(Ai){for(let bo of this.manager.tooltipViews)bo.mount&&bo.mount(Ai);this.mounted=!0}positioned(Ai){for(let bo of this.manager.tooltipViews)bo.positioned&&bo.positioned(Ai)}update(Ai){this.manager.update(Ai)}destroy(){var Ai;for(let bo of this.manager.tooltipViews)(Ai=bo.destroy)===null||Ai===void 0||Ai.call(bo)}passProp(Ai){let bo;for(let Ra of this.manager.tooltipViews){let pc=Ra[Ai];if(pc!==void 0){if(bo===void 0)bo=pc;else if(bo!==pc)return}}return bo}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const showHoverTooltipHost=showTooltip.compute([showHoverTooltip],vo=>{let Ai=vo.facet(showHoverTooltip);return Ai.length===0?null:{pos:Math.min(...Ai.map(bo=>bo.pos)),end:Math.max(...Ai.map(bo=>{var Ra;return(Ra=bo.end)!==null&&Ra!==void 0?Ra:bo.pos})),create:HoverTooltipHost.create,above:Ai[0].above,arrow:Ai.some(bo=>bo.arrow)}});class HoverPlugin{constructor(Ai,bo,Ra,pc,mc){this.view=Ai,this.source=bo,this.field=Ra,this.setHover=pc,this.hoverTime=mc,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:Ai.dom,time:0},this.checkHover=this.checkHover.bind(this),Ai.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),Ai.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let Ai=Date.now()-this.lastMove.time;Ai<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-Ai):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:Ai,lastMove:bo}=this,Ra=Ai.docView.nearest(bo.target);if(!Ra)return;let pc,mc=1;if(Ra instanceof WidgetView)pc=Ra.posAtStart;else{if(pc=Ai.posAtCoords(bo),pc==null)return;let df=Ai.coordsAtPos(pc);if(!df||bo.y<df.top||bo.y>df.bottom||bo.x<df.left-Ai.defaultCharacterWidth||bo.x>df.right+Ai.defaultCharacterWidth)return;let ff=Ai.bidiSpans(Ai.state.doc.lineAt(pc)).find(pf=>pf.from<=pc&&pf.to>=pc),hf=ff&&ff.dir==Direction.RTL?-1:1;mc=bo.x<df.left?-hf:hf}let uf=this.source(Ai,pc,mc);if(uf!=null&&uf.then){let df=this.pending={pos:pc};uf.then(ff=>{this.pending==df&&(this.pending=null,ff&&!(Array.isArray(ff)&&!ff.length)&&Ai.dispatch({effects:this.setHover.of(Array.isArray(ff)?ff:[ff])}))},ff=>logException(Ai.state,ff,"hover tooltip"))}else uf&&!(Array.isArray(uf)&&!uf.length)&&Ai.dispatch({effects:this.setHover.of(Array.isArray(uf)?uf:[uf])})}get tooltip(){let Ai=this.view.plugin(tooltipPlugin),bo=Ai?Ai.manager.tooltips.findIndex(Ra=>Ra.create==HoverTooltipHost.create):-1;return bo>-1?Ai.manager.tooltipViews[bo]:null}mousemove(Ai){var bo,Ra;this.lastMove={x:Ai.clientX,y:Ai.clientY,target:Ai.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:pc,tooltip:mc}=this;if(pc.length&&mc&&!isInTooltip(mc.dom,Ai)||this.pending){let{pos:uf}=pc[0]||this.pending,df=(Ra=(bo=pc[0])===null||bo===void 0?void 0:bo.end)!==null&&Ra!==void 0?Ra:uf;(uf==df?this.view.posAtCoords(this.lastMove)!=uf:!isOverRange(this.view,uf,df,Ai.clientX,Ai.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(Ai){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:bo}=this;if(bo.length){let{tooltip:Ra}=this;Ra&&Ra.dom.contains(Ai.relatedTarget)?this.watchTooltipLeave(Ra.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(Ai){let bo=Ra=>{Ai.removeEventListener("mouseleave",bo),this.active.length&&!this.view.dom.contains(Ra.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};Ai.addEventListener("mouseleave",bo)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const tooltipMargin=4;function isInTooltip(vo,Ai){let{left:bo,right:Ra,top:pc,bottom:mc}=vo.getBoundingClientRect(),uf;if(uf=vo.querySelector(".cm-tooltip-arrow")){let df=uf.getBoundingClientRect();pc=Math.min(df.top,pc),mc=Math.max(df.bottom,mc)}return Ai.clientX>=bo-tooltipMargin&&Ai.clientX<=Ra+tooltipMargin&&Ai.clientY>=pc-tooltipMargin&&Ai.clientY<=mc+tooltipMargin}function isOverRange(vo,Ai,bo,Ra,pc,mc){let uf=vo.scrollDOM.getBoundingClientRect(),df=vo.documentTop+vo.documentPadding.top+vo.contentHeight;if(uf.left>Ra||uf.right<Ra||uf.top>pc||Math.min(uf.bottom,df)<pc)return!1;let ff=vo.posAtCoords({x:Ra,y:pc},!1);return ff>=Ai&&ff<=bo}function hoverTooltip(vo,Ai={}){let bo=StateEffect.define(),Ra=StateField.define({create(){return[]},update(pc,mc){if(pc.length&&(Ai.hideOnChange&&(mc.docChanged||mc.selection)?pc=[]:Ai.hideOn&&(pc=pc.filter(uf=>!Ai.hideOn(mc,uf))),mc.docChanged)){let uf=[];for(let df of pc){let ff=mc.changes.mapPos(df.pos,-1,MapMode.TrackDel);if(ff!=null){let hf=Object.assign(Object.create(null),df);hf.pos=ff,hf.end!=null&&(hf.end=mc.changes.mapPos(hf.end)),uf.push(hf)}}pc=uf}for(let uf of mc.effects)uf.is(bo)&&(pc=uf.value),uf.is(closeHoverTooltipEffect)&&(pc=[]);return pc},provide:pc=>showHoverTooltip.from(pc)});return{active:Ra,extension:[Ra,ViewPlugin.define(pc=>new HoverPlugin(pc,vo,Ra,bo,Ai.hoverTime||300)),showHoverTooltipHost]}}function getTooltip(vo,Ai){let bo=vo.plugin(tooltipPlugin);if(!bo)return null;let Ra=bo.manager.tooltips.indexOf(Ai);return Ra<0?null:bo.manager.tooltipViews[Ra]}const closeHoverTooltipEffect=StateEffect.define(),panelConfig=Facet.define({combine(vo){let Ai,bo;for(let Ra of vo)Ai=Ai||Ra.topContainer,bo=bo||Ra.bottomContainer;return{topContainer:Ai,bottomContainer:bo}}});function getPanel(vo,Ai){let bo=vo.plugin(panelPlugin),Ra=bo?bo.specs.indexOf(Ai):-1;return Ra>-1?bo.panels[Ra]:null}const panelPlugin=ViewPlugin.fromClass(class{constructor(vo){this.input=vo.state.facet(showPanel),this.specs=this.input.filter(bo=>bo),this.panels=this.specs.map(bo=>bo(vo));let Ai=vo.state.facet(panelConfig);this.top=new PanelGroup(vo,!0,Ai.topContainer),this.bottom=new PanelGroup(vo,!1,Ai.bottomContainer),this.top.sync(this.panels.filter(bo=>bo.top)),this.bottom.sync(this.panels.filter(bo=>!bo.top));for(let bo of this.panels)bo.dom.classList.add("cm-panel"),bo.mount&&bo.mount()}update(vo){let Ai=vo.state.facet(panelConfig);this.top.container!=Ai.topContainer&&(this.top.sync([]),this.top=new PanelGroup(vo.view,!0,Ai.topContainer)),this.bottom.container!=Ai.bottomContainer&&(this.bottom.sync([]),this.bottom=new PanelGroup(vo.view,!1,Ai.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let bo=vo.state.facet(showPanel);if(bo!=this.input){let Ra=bo.filter(ff=>ff),pc=[],mc=[],uf=[],df=[];for(let ff of Ra){let hf=this.specs.indexOf(ff),pf;hf<0?(pf=ff(vo.view),df.push(pf)):(pf=this.panels[hf],pf.update&&pf.update(vo)),pc.push(pf),(pf.top?mc:uf).push(pf)}this.specs=Ra,this.panels=pc,this.top.sync(mc),this.bottom.sync(uf);for(let ff of df)ff.dom.classList.add("cm-panel"),ff.mount&&ff.mount()}else for(let Ra of this.panels)Ra.update&&Ra.update(vo)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:vo=>EditorView.scrollMargins.of(Ai=>{let bo=Ai.plugin(vo);return bo&&{top:bo.top.scrollMargin(),bottom:bo.bottom.scrollMargin()}})});class PanelGroup{constructor(Ai,bo,Ra){this.view=Ai,this.top=bo,this.container=Ra,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(Ai){for(let bo of this.panels)bo.destroy&&Ai.indexOf(bo)<0&&bo.destroy();this.panels=Ai,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let bo=this.container||this.view.dom;bo.insertBefore(this.dom,this.top?bo.firstChild:null)}let Ai=this.dom.firstChild;for(let bo of this.panels)if(bo.dom.parentNode==this.dom){for(;Ai!=bo.dom;)Ai=rm(Ai);Ai=Ai.nextSibling}else this.dom.insertBefore(bo.dom,Ai);for(;Ai;)Ai=rm(Ai)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let Ai of this.classes.split(" "))Ai&&this.container.classList.remove(Ai);for(let Ai of(this.classes=this.view.themeClasses).split(" "))Ai&&this.container.classList.add(Ai)}}}function rm(vo){let Ai=vo.nextSibling;return vo.remove(),Ai}const showPanel=Facet.define({enables:panelPlugin});class GutterMarker extends RangeValue{compare(Ai){return this==Ai||this.constructor==Ai.constructor&&this.eq(Ai)}eq(Ai){return!1}destroy(Ai){}}GutterMarker.prototype.elementClass="";GutterMarker.prototype.toDOM=void 0;GutterMarker.prototype.mapMode=MapMode.TrackBefore;GutterMarker.prototype.startSide=GutterMarker.prototype.endSide=-1;GutterMarker.prototype.point=!0;const gutterLineClass=Facet.define(),gutterWidgetClass=Facet.define(),defaults$1={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>RangeSet.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},activeGutters=Facet.define();function gutter(vo){return[gutters(),activeGutters.of(Object.assign(Object.assign({},defaults$1),vo))]}const unfixGutters=Facet.define({combine:vo=>vo.some(Ai=>Ai)});function gutters(vo){return[gutterView]}const gutterView=ViewPlugin.fromClass(class{constructor(vo){this.view=vo,this.prevViewport=vo.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=vo.state.facet(activeGutters).map(Ai=>new SingleGutterView(vo,Ai));for(let Ai of this.gutters)this.dom.appendChild(Ai.dom);this.fixed=!vo.state.facet(unfixGutters),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),vo.scrollDOM.insertBefore(this.dom,vo.contentDOM)}update(vo){if(this.updateGutters(vo)){let Ai=this.prevViewport,bo=vo.view.viewport,Ra=Math.min(Ai.to,bo.to)-Math.max(Ai.from,bo.from);this.syncGutters(Ra<(bo.to-bo.from)*.8)}vo.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px"),this.view.state.facet(unfixGutters)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=vo.view.viewport}syncGutters(vo){let Ai=this.dom.nextSibling;vo&&this.dom.remove();let bo=RangeSet.iter(this.view.state.facet(gutterLineClass),this.view.viewport.from),Ra=[],pc=this.gutters.map(mc=>new UpdateContext(mc,this.view.viewport,-this.view.documentPadding.top));for(let mc of this.view.viewportLineBlocks)if(Ra.length&&(Ra=[]),Array.isArray(mc.type)){let uf=!0;for(let df of mc.type)if(df.type==BlockType.Text&&uf){advanceCursor(bo,Ra,df.from);for(let ff of pc)ff.line(this.view,df,Ra);uf=!1}else if(df.widget)for(let ff of pc)ff.widget(this.view,df)}else if(mc.type==BlockType.Text){advanceCursor(bo,Ra,mc.from);for(let uf of pc)uf.line(this.view,mc,Ra)}else if(mc.widget)for(let uf of pc)uf.widget(this.view,mc);for(let mc of pc)mc.finish();vo&&this.view.scrollDOM.insertBefore(this.dom,Ai)}updateGutters(vo){let Ai=vo.startState.facet(activeGutters),bo=vo.state.facet(activeGutters),Ra=vo.docChanged||vo.heightChanged||vo.viewportChanged||!RangeSet.eq(vo.startState.facet(gutterLineClass),vo.state.facet(gutterLineClass),vo.view.viewport.from,vo.view.viewport.to);if(Ai==bo)for(let pc of this.gutters)pc.update(vo)&&(Ra=!0);else{Ra=!0;let pc=[];for(let mc of bo){let uf=Ai.indexOf(mc);uf<0?pc.push(new SingleGutterView(this.view,mc)):(this.gutters[uf].update(vo),pc.push(this.gutters[uf]))}for(let mc of this.gutters)mc.dom.remove(),pc.indexOf(mc)<0&&mc.destroy();for(let mc of pc)this.dom.appendChild(mc.dom);this.gutters=pc}return Ra}destroy(){for(let vo of this.gutters)vo.destroy();this.dom.remove()}},{provide:vo=>EditorView.scrollMargins.of(Ai=>{let bo=Ai.plugin(vo);return!bo||bo.gutters.length==0||!bo.fixed?null:Ai.textDirection==Direction.LTR?{left:bo.dom.offsetWidth*Ai.scaleX}:{right:bo.dom.offsetWidth*Ai.scaleX}})});function asArray$1(vo){return Array.isArray(vo)?vo:[vo]}function advanceCursor(vo,Ai,bo){for(;vo.value&&vo.from<=bo;)vo.from==bo&&Ai.push(vo.value),vo.next()}class UpdateContext{constructor(Ai,bo,Ra){this.gutter=Ai,this.height=Ra,this.i=0,this.cursor=RangeSet.iter(Ai.markers,bo.from)}addElement(Ai,bo,Ra){let{gutter:pc}=this,mc=(bo.top-this.height)/Ai.scaleY,uf=bo.height/Ai.scaleY;if(this.i==pc.elements.length){let df=new GutterElement(Ai,uf,mc,Ra);pc.elements.push(df),pc.dom.appendChild(df.dom)}else pc.elements[this.i].update(Ai,uf,mc,Ra);this.height=bo.bottom,this.i++}line(Ai,bo,Ra){let pc=[];advanceCursor(this.cursor,pc,bo.from),Ra.length&&(pc=pc.concat(Ra));let mc=this.gutter.config.lineMarker(Ai,bo,pc);mc&&pc.unshift(mc);let uf=this.gutter;pc.length==0&&!uf.config.renderEmptyElements||this.addElement(Ai,bo,pc)}widget(Ai,bo){let Ra=this.gutter.config.widgetMarker(Ai,bo.widget,bo),pc=Ra?[Ra]:null;for(let mc of Ai.state.facet(gutterWidgetClass)){let uf=mc(Ai,bo.widget,bo);uf&&(pc||(pc=[])).push(uf)}pc&&this.addElement(Ai,bo,pc)}finish(){let Ai=this.gutter;for(;Ai.elements.length>this.i;){let bo=Ai.elements.pop();Ai.dom.removeChild(bo.dom),bo.destroy()}}}class SingleGutterView{constructor(Ai,bo){this.view=Ai,this.config=bo,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let Ra in bo.domEventHandlers)this.dom.addEventListener(Ra,pc=>{let mc=pc.target,uf;if(mc!=this.dom&&this.dom.contains(mc)){for(;mc.parentNode!=this.dom;)mc=mc.parentNode;let ff=mc.getBoundingClientRect();uf=(ff.top+ff.bottom)/2}else uf=pc.clientY;let df=Ai.lineBlockAtHeight(uf-Ai.documentTop);bo.domEventHandlers[Ra](Ai,df,pc)&&pc.preventDefault()});this.markers=asArray$1(bo.markers(Ai)),bo.initialSpacer&&(this.spacer=new GutterElement(Ai,0,0,[bo.initialSpacer(Ai)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(Ai){let bo=this.markers;if(this.markers=asArray$1(this.config.markers(Ai.view)),this.spacer&&this.config.updateSpacer){let pc=this.config.updateSpacer(this.spacer.markers[0],Ai);pc!=this.spacer.markers[0]&&this.spacer.update(Ai.view,0,0,[pc])}let Ra=Ai.view.viewport;return!RangeSet.eq(this.markers,bo,Ra.from,Ra.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(Ai):!1)}destroy(){for(let Ai of this.elements)Ai.destroy()}}class GutterElement{constructor(Ai,bo,Ra,pc){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(Ai,bo,Ra,pc)}update(Ai,bo,Ra,pc){this.height!=bo&&(this.height=bo,this.dom.style.height=bo+"px"),this.above!=Ra&&(this.dom.style.marginTop=(this.above=Ra)?Ra+"px":""),sameMarkers(this.markers,pc)||this.setMarkers(Ai,pc)}setMarkers(Ai,bo){let Ra="cm-gutterElement",pc=this.dom.firstChild;for(let mc=0,uf=0;;){let df=uf,ff=mc<bo.length?bo[mc++]:null,hf=!1;if(ff){let pf=ff.elementClass;pf&&(Ra+=" "+pf);for(let mf=uf;mf<this.markers.length;mf++)if(this.markers[mf].compare(ff)){df=mf,hf=!0;break}}else df=this.markers.length;for(;uf<df;){let pf=this.markers[uf++];if(pf.toDOM){pf.destroy(pc);let mf=pc.nextSibling;pc.remove(),pc=mf}}if(!ff)break;ff.toDOM&&(hf?pc=pc.nextSibling:this.dom.insertBefore(ff.toDOM(Ai),pc)),hf&&uf++}this.dom.className=Ra,this.markers=bo}destroy(){this.setMarkers(null,[])}}function sameMarkers(vo,Ai){if(vo.length!=Ai.length)return!1;for(let bo=0;bo<vo.length;bo++)if(!vo[bo].compare(Ai[bo]))return!1;return!0}const lineNumberMarkers=Facet.define(),lineNumberWidgetMarker=Facet.define(),lineNumberConfig=Facet.define({combine(vo){return combineConfig(vo,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(Ai,bo){let Ra=Object.assign({},Ai);for(let pc in bo){let mc=Ra[pc],uf=bo[pc];Ra[pc]=mc?(df,ff,hf)=>mc(df,ff,hf)||uf(df,ff,hf):uf}return Ra}})}});class NumberMarker extends GutterMarker{constructor(Ai){super(),this.number=Ai}eq(Ai){return this.number==Ai.number}toDOM(){return document.createTextNode(this.number)}}function formatNumber(vo,Ai){return vo.state.facet(lineNumberConfig).formatNumber(Ai,vo.state)}const lineNumberGutter=activeGutters.compute([lineNumberConfig],vo=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(Ai){return Ai.state.facet(lineNumberMarkers)},lineMarker(Ai,bo,Ra){return Ra.some(pc=>pc.toDOM)?null:new NumberMarker(formatNumber(Ai,Ai.state.doc.lineAt(bo.from).number))},widgetMarker:(Ai,bo,Ra)=>{for(let pc of Ai.state.facet(lineNumberWidgetMarker)){let mc=pc(Ai,bo,Ra);if(mc)return mc}return null},lineMarkerChange:Ai=>Ai.startState.facet(lineNumberConfig)!=Ai.state.facet(lineNumberConfig),initialSpacer(Ai){return new NumberMarker(formatNumber(Ai,maxLineNumber(Ai.state.doc.lines)))},updateSpacer(Ai,bo){let Ra=formatNumber(bo.view,maxLineNumber(bo.view.state.doc.lines));return Ra==Ai.number?Ai:new NumberMarker(Ra)},domEventHandlers:vo.facet(lineNumberConfig).domEventHandlers}));function lineNumbers(vo={}){return[lineNumberConfig.of(vo),gutters(),lineNumberGutter]}function maxLineNumber(vo){let Ai=9;for(;Ai<vo;)Ai=Ai*10+9;return Ai}const activeLineGutterMarker=new class extends GutterMarker{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},activeLineGutterHighlighter=gutterLineClass.compute(["selection"],vo=>{let Ai=[],bo=-1;for(let Ra of vo.selection.ranges){let pc=vo.doc.lineAt(Ra.head).from;pc>bo&&(bo=pc,Ai.push(activeLineGutterMarker.range(pc)))}return RangeSet.of(Ai)});function highlightActiveLineGutter(){return activeLineGutterHighlighter}const DefaultBufferLength=1024;let nextPropID=0,Range$2=class{constructor(vo,Ai){this.from=vo,this.to=Ai}};class NodeProp{constructor(Ai={}){this.id=nextPropID++,this.perNode=!!Ai.perNode,this.deserialize=Ai.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(Ai){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof Ai!="function"&&(Ai=NodeType.match(Ai)),bo=>{let Ra=Ai(bo);return Ra===void 0?null:[this,Ra]}}}NodeProp.closedBy=new NodeProp({deserialize:vo=>vo.split(" ")});NodeProp.openedBy=new NodeProp({deserialize:vo=>vo.split(" ")});NodeProp.group=new NodeProp({deserialize:vo=>vo.split(" ")});NodeProp.isolate=new NodeProp({deserialize:vo=>{if(vo&&vo!="rtl"&&vo!="ltr"&&vo!="auto")throw new RangeError("Invalid value for isolate: "+vo);return vo||"auto"}});NodeProp.contextHash=new NodeProp({perNode:!0});NodeProp.lookAhead=new NodeProp({perNode:!0});NodeProp.mounted=new NodeProp({perNode:!0});class MountedTree{constructor(Ai,bo,Ra){this.tree=Ai,this.overlay=bo,this.parser=Ra}static get(Ai){return Ai&&Ai.props&&Ai.props[NodeProp.mounted.id]}}const noProps=Object.create(null);class NodeType{constructor(Ai,bo,Ra,pc=0){this.name=Ai,this.props=bo,this.id=Ra,this.flags=pc}static define(Ai){let bo=Ai.props&&Ai.props.length?Object.create(null):noProps,Ra=(Ai.top?1:0)|(Ai.skipped?2:0)|(Ai.error?4:0)|(Ai.name==null?8:0),pc=new NodeType(Ai.name||"",bo,Ai.id,Ra);if(Ai.props){for(let mc of Ai.props)if(Array.isArray(mc)||(mc=mc(pc)),mc){if(mc[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");bo[mc[0].id]=mc[1]}}return pc}prop(Ai){return this.props[Ai.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(Ai){if(typeof Ai=="string"){if(this.name==Ai)return!0;let bo=this.prop(NodeProp.group);return bo?bo.indexOf(Ai)>-1:!1}return this.id==Ai}static match(Ai){let bo=Object.create(null);for(let Ra in Ai)for(let pc of Ra.split(" "))bo[pc]=Ai[Ra];return Ra=>{for(let pc=Ra.prop(NodeProp.group),mc=-1;mc<(pc?pc.length:0);mc++){let uf=bo[mc<0?Ra.name:pc[mc]];if(uf)return uf}}}}NodeType.none=new NodeType("",Object.create(null),0,8);class NodeSet{constructor(Ai){this.types=Ai;for(let bo=0;bo<Ai.length;bo++)if(Ai[bo].id!=bo)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...Ai){let bo=[];for(let Ra of this.types){let pc=null;for(let mc of Ai){let uf=mc(Ra);uf&&(pc||(pc=Object.assign({},Ra.props)),pc[uf[0].id]=uf[1])}bo.push(pc?new NodeType(Ra.name,pc,Ra.id,Ra.flags):Ra)}return new NodeSet(bo)}}const CachedNode=new WeakMap,CachedInnerNode=new WeakMap;var IterMode;(function(vo){vo[vo.ExcludeBuffers=1]="ExcludeBuffers",vo[vo.IncludeAnonymous=2]="IncludeAnonymous",vo[vo.IgnoreMounts=4]="IgnoreMounts",vo[vo.IgnoreOverlays=8]="IgnoreOverlays"})(IterMode||(IterMode={}));class Tree{constructor(Ai,bo,Ra,pc,mc){if(this.type=Ai,this.children=bo,this.positions=Ra,this.length=pc,this.props=null,mc&&mc.length){this.props=Object.create(null);for(let[uf,df]of mc)this.props[typeof uf=="number"?uf:uf.id]=df}}toString(){let Ai=MountedTree.get(this);if(Ai&&!Ai.overlay)return Ai.tree.toString();let bo="";for(let Ra of this.children){let pc=Ra.toString();pc&&(bo&&(bo+=","),bo+=pc)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(bo.length?"("+bo+")":""):bo}cursor(Ai=0){return new TreeCursor(this.topNode,Ai)}cursorAt(Ai,bo=0,Ra=0){let pc=CachedNode.get(this)||this.topNode,mc=new TreeCursor(pc);return mc.moveTo(Ai,bo),CachedNode.set(this,mc._tree),mc}get topNode(){return new TreeNode(this,0,0,null)}resolve(Ai,bo=0){let Ra=resolveNode(CachedNode.get(this)||this.topNode,Ai,bo,!1);return CachedNode.set(this,Ra),Ra}resolveInner(Ai,bo=0){let Ra=resolveNode(CachedInnerNode.get(this)||this.topNode,Ai,bo,!0);return CachedInnerNode.set(this,Ra),Ra}resolveStack(Ai,bo=0){return stackIterator(this,Ai,bo)}iterate(Ai){let{enter:bo,leave:Ra,from:pc=0,to:mc=this.length}=Ai,uf=Ai.mode||0,df=(uf&IterMode.IncludeAnonymous)>0;for(let ff=this.cursor(uf|IterMode.IncludeAnonymous);;){let hf=!1;if(ff.from<=mc&&ff.to>=pc&&(!df&&ff.type.isAnonymous||bo(ff)!==!1)){if(ff.firstChild())continue;hf=!0}for(;hf&&Ra&&(df||!ff.type.isAnonymous)&&Ra(ff),!ff.nextSibling();){if(!ff.parent())return;hf=!0}}}prop(Ai){return Ai.perNode?this.props?this.props[Ai.id]:void 0:this.type.prop(Ai)}get propValues(){let Ai=[];if(this.props)for(let bo in this.props)Ai.push([+bo,this.props[bo]]);return Ai}balance(Ai={}){return this.children.length<=8?this:balanceRange(NodeType.none,this.children,this.positions,0,this.children.length,0,this.length,(bo,Ra,pc)=>new Tree(this.type,bo,Ra,pc,this.propValues),Ai.makeTree||((bo,Ra,pc)=>new Tree(NodeType.none,bo,Ra,pc)))}static build(Ai){return buildTree(Ai)}}Tree.empty=new Tree(NodeType.none,[],[],0);class FlatBufferCursor{constructor(Ai,bo){this.buffer=Ai,this.index=bo}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new FlatBufferCursor(this.buffer,this.index)}}class TreeBuffer{constructor(Ai,bo,Ra){this.buffer=Ai,this.length=bo,this.set=Ra}get type(){return NodeType.none}toString(){let Ai=[];for(let bo=0;bo<this.buffer.length;)Ai.push(this.childString(bo)),bo=this.buffer[bo+3];return Ai.join(",")}childString(Ai){let bo=this.buffer[Ai],Ra=this.buffer[Ai+3],pc=this.set.types[bo],mc=pc.name;if(/\W/.test(mc)&&!pc.isError&&(mc=JSON.stringify(mc)),Ai+=4,Ra==Ai)return mc;let uf=[];for(;Ai<Ra;)uf.push(this.childString(Ai)),Ai=this.buffer[Ai+3];return mc+"("+uf.join(",")+")"}findChild(Ai,bo,Ra,pc,mc){let{buffer:uf}=this,df=-1;for(let ff=Ai;ff!=bo&&!(checkSide(mc,pc,uf[ff+1],uf[ff+2])&&(df=ff,Ra>0));ff=uf[ff+3]);return df}slice(Ai,bo,Ra){let pc=this.buffer,mc=new Uint16Array(bo-Ai),uf=0;for(let df=Ai,ff=0;df<bo;){mc[ff++]=pc[df++],mc[ff++]=pc[df++]-Ra;let hf=mc[ff++]=pc[df++]-Ra;mc[ff++]=pc[df++]-Ai,uf=Math.max(uf,hf)}return new TreeBuffer(mc,uf,this.set)}}function checkSide(vo,Ai,bo,Ra){switch(vo){case-2:return bo<Ai;case-1:return Ra>=Ai&&bo<Ai;case 0:return bo<Ai&&Ra>Ai;case 1:return bo<=Ai&&Ra>Ai;case 2:return Ra>Ai;case 4:return!0}}function resolveNode(vo,Ai,bo,Ra){for(var pc;vo.from==vo.to||(bo<1?vo.from>=Ai:vo.from>Ai)||(bo>-1?vo.to<=Ai:vo.to<Ai);){let uf=!Ra&&vo instanceof TreeNode&&vo.index<0?null:vo.parent;if(!uf)return vo;vo=uf}let mc=Ra?0:IterMode.IgnoreOverlays;if(Ra)for(let uf=vo,df=uf.parent;df;uf=df,df=uf.parent)uf instanceof TreeNode&&uf.index<0&&((pc=df.enter(Ai,bo,mc))===null||pc===void 0?void 0:pc.from)!=uf.from&&(vo=df);for(;;){let uf=vo.enter(Ai,bo,mc);if(!uf)return vo;vo=uf}}class BaseNode{cursor(Ai=0){return new TreeCursor(this,Ai)}getChild(Ai,bo=null,Ra=null){let pc=getChildren(this,Ai,bo,Ra);return pc.length?pc[0]:null}getChildren(Ai,bo=null,Ra=null){return getChildren(this,Ai,bo,Ra)}resolve(Ai,bo=0){return resolveNode(this,Ai,bo,!1)}resolveInner(Ai,bo=0){return resolveNode(this,Ai,bo,!0)}matchContext(Ai){return matchNodeContext(this.parent,Ai)}enterUnfinishedNodesBefore(Ai){let bo=this.childBefore(Ai),Ra=this;for(;bo;){let pc=bo.lastChild;if(!pc||pc.to!=bo.to)break;pc.type.isError&&pc.from==pc.to?(Ra=bo,bo=pc.prevSibling):bo=pc}return Ra}get node(){return this}get next(){return this.parent}}class TreeNode extends BaseNode{constructor(Ai,bo,Ra,pc){super(),this._tree=Ai,this.from=bo,this.index=Ra,this._parent=pc}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(Ai,bo,Ra,pc,mc=0){for(let uf=this;;){for(let{children:df,positions:ff}=uf._tree,hf=bo>0?df.length:-1;Ai!=hf;Ai+=bo){let pf=df[Ai],mf=ff[Ai]+uf.from;if(checkSide(pc,Ra,mf,mf+pf.length)){if(pf instanceof TreeBuffer){if(mc&IterMode.ExcludeBuffers)continue;let gf=pf.findChild(0,pf.buffer.length,bo,Ra-mf,pc);if(gf>-1)return new BufferNode(new BufferContext(uf,pf,Ai,mf),null,gf)}else if(mc&IterMode.IncludeAnonymous||!pf.type.isAnonymous||hasChild(pf)){let gf;if(!(mc&IterMode.IgnoreMounts)&&(gf=MountedTree.get(pf))&&!gf.overlay)return new TreeNode(gf.tree,mf,Ai,uf);let yf=new TreeNode(pf,mf,Ai,uf);return mc&IterMode.IncludeAnonymous||!yf.type.isAnonymous?yf:yf.nextChild(bo<0?pf.children.length-1:0,bo,Ra,pc)}}}if(mc&IterMode.IncludeAnonymous||!uf.type.isAnonymous||(uf.index>=0?Ai=uf.index+bo:Ai=bo<0?-1:uf._parent._tree.children.length,uf=uf._parent,!uf))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(Ai){return this.nextChild(0,1,Ai,2)}childBefore(Ai){return this.nextChild(this._tree.children.length-1,-1,Ai,-2)}enter(Ai,bo,Ra=0){let pc;if(!(Ra&IterMode.IgnoreOverlays)&&(pc=MountedTree.get(this._tree))&&pc.overlay){let mc=Ai-this.from;for(let{from:uf,to:df}of pc.overlay)if((bo>0?uf<=mc:uf<mc)&&(bo<0?df>=mc:df>mc))return new TreeNode(pc.tree,pc.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,Ai,bo,Ra)}nextSignificantParent(){let Ai=this;for(;Ai.type.isAnonymous&&Ai._parent;)Ai=Ai._parent;return Ai}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function getChildren(vo,Ai,bo,Ra){let pc=vo.cursor(),mc=[];if(!pc.firstChild())return mc;if(bo!=null){for(let uf=!1;!uf;)if(uf=pc.type.is(bo),!pc.nextSibling())return mc}for(;;){if(Ra!=null&&pc.type.is(Ra))return mc;if(pc.type.is(Ai)&&mc.push(pc.node),!pc.nextSibling())return Ra==null?mc:[]}}function matchNodeContext(vo,Ai,bo=Ai.length-1){for(let Ra=vo;bo>=0;Ra=Ra.parent){if(!Ra)return!1;if(!Ra.type.isAnonymous){if(Ai[bo]&&Ai[bo]!=Ra.name)return!1;bo--}}return!0}class BufferContext{constructor(Ai,bo,Ra,pc){this.parent=Ai,this.buffer=bo,this.index=Ra,this.start=pc}}class BufferNode extends BaseNode{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(Ai,bo,Ra){super(),this.context=Ai,this._parent=bo,this.index=Ra,this.type=Ai.buffer.set.types[Ai.buffer.buffer[Ra]]}child(Ai,bo,Ra){let{buffer:pc}=this.context,mc=pc.findChild(this.index+4,pc.buffer[this.index+3],Ai,bo-this.context.start,Ra);return mc<0?null:new BufferNode(this.context,this,mc)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(Ai){return this.child(1,Ai,2)}childBefore(Ai){return this.child(-1,Ai,-2)}enter(Ai,bo,Ra=0){if(Ra&IterMode.ExcludeBuffers)return null;let{buffer:pc}=this.context,mc=pc.findChild(this.index+4,pc.buffer[this.index+3],bo>0?1:-1,Ai-this.context.start,bo);return mc<0?null:new BufferNode(this.context,this,mc)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(Ai){return this._parent?null:this.context.parent.nextChild(this.context.index+Ai,Ai,0,4)}get nextSibling(){let{buffer:Ai}=this.context,bo=Ai.buffer[this.index+3];return bo<(this._parent?Ai.buffer[this._parent.index+3]:Ai.buffer.length)?new BufferNode(this.context,this._parent,bo):this.externalSibling(1)}get prevSibling(){let{buffer:Ai}=this.context,bo=this._parent?this._parent.index+4:0;return this.index==bo?this.externalSibling(-1):new BufferNode(this.context,this._parent,Ai.findChild(bo,this.index,-1,0,4))}get tree(){return null}toTree(){let Ai=[],bo=[],{buffer:Ra}=this.context,pc=this.index+4,mc=Ra.buffer[this.index+3];if(mc>pc){let uf=Ra.buffer[this.index+1];Ai.push(Ra.slice(pc,mc,uf)),bo.push(0)}return new Tree(this.type,Ai,bo,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function iterStack(vo){if(!vo.length)return null;let Ai=0,bo=vo[0];for(let mc=1;mc<vo.length;mc++){let uf=vo[mc];(uf.from>bo.from||uf.to<bo.to)&&(bo=uf,Ai=mc)}let Ra=bo instanceof TreeNode&&bo.index<0?null:bo.parent,pc=vo.slice();return Ra?pc[Ai]=Ra:pc.splice(Ai,1),new StackIterator(pc,bo)}class StackIterator{constructor(Ai,bo){this.heads=Ai,this.node=bo}get next(){return iterStack(this.heads)}}function stackIterator(vo,Ai,bo){let Ra=vo.resolveInner(Ai,bo),pc=null;for(let mc=Ra instanceof TreeNode?Ra:Ra.context.parent;mc;mc=mc.parent)if(mc.index<0){let uf=mc.parent;(pc||(pc=[Ra])).push(uf.resolve(Ai,bo)),mc=uf}else{let uf=MountedTree.get(mc.tree);if(uf&&uf.overlay&&uf.overlay[0].from<=Ai&&uf.overlay[uf.overlay.length-1].to>=Ai){let df=new TreeNode(uf.tree,uf.overlay[0].from+mc.from,-1,mc);(pc||(pc=[Ra])).push(resolveNode(df,Ai,bo,!1))}}return pc?iterStack(pc):Ra}class TreeCursor{get name(){return this.type.name}constructor(Ai,bo=0){if(this.mode=bo,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,Ai instanceof TreeNode)this.yieldNode(Ai);else{this._tree=Ai.context.parent,this.buffer=Ai.context;for(let Ra=Ai._parent;Ra;Ra=Ra._parent)this.stack.unshift(Ra.index);this.bufferNode=Ai,this.yieldBuf(Ai.index)}}yieldNode(Ai){return Ai?(this._tree=Ai,this.type=Ai.type,this.from=Ai.from,this.to=Ai.to,!0):!1}yieldBuf(Ai,bo){this.index=Ai;let{start:Ra,buffer:pc}=this.buffer;return this.type=bo||pc.set.types[pc.buffer[Ai]],this.from=Ra+pc.buffer[Ai+1],this.to=Ra+pc.buffer[Ai+2],!0}yield(Ai){return Ai?Ai instanceof TreeNode?(this.buffer=null,this.yieldNode(Ai)):(this.buffer=Ai.context,this.yieldBuf(Ai.index,Ai.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(Ai,bo,Ra){if(!this.buffer)return this.yield(this._tree.nextChild(Ai<0?this._tree._tree.children.length-1:0,Ai,bo,Ra,this.mode));let{buffer:pc}=this.buffer,mc=pc.findChild(this.index+4,pc.buffer[this.index+3],Ai,bo-this.buffer.start,Ra);return mc<0?!1:(this.stack.push(this.index),this.yieldBuf(mc))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(Ai){return this.enterChild(1,Ai,2)}childBefore(Ai){return this.enterChild(-1,Ai,-2)}enter(Ai,bo,Ra=this.mode){return this.buffer?Ra&IterMode.ExcludeBuffers?!1:this.enterChild(1,Ai,bo):this.yield(this._tree.enter(Ai,bo,Ra))}parent(){if(!this.buffer)return this.yieldNode(this.mode&IterMode.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let Ai=this.mode&IterMode.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(Ai)}sibling(Ai){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+Ai,Ai,0,4,this.mode)):!1;let{buffer:bo}=this.buffer,Ra=this.stack.length-1;if(Ai<0){let pc=Ra<0?0:this.stack[Ra]+4;if(this.index!=pc)return this.yieldBuf(bo.findChild(pc,this.index,-1,0,4))}else{let pc=bo.buffer[this.index+3];if(pc<(Ra<0?bo.buffer.length:bo.buffer[this.stack[Ra]+3]))return this.yieldBuf(pc)}return Ra<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+Ai,Ai,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(Ai){let bo,Ra,{buffer:pc}=this;if(pc){if(Ai>0){if(this.index<pc.buffer.buffer.length)return!1}else for(let mc=0;mc<this.index;mc++)if(pc.buffer.buffer[mc+3]<this.index)return!1;({index:bo,parent:Ra}=pc)}else({index:bo,_parent:Ra}=this._tree);for(;Ra;{index:bo,_parent:Ra}=Ra)if(bo>-1)for(let mc=bo+Ai,uf=Ai<0?-1:Ra._tree.children.length;mc!=uf;mc+=Ai){let df=Ra._tree.children[mc];if(this.mode&IterMode.IncludeAnonymous||df instanceof TreeBuffer||!df.type.isAnonymous||hasChild(df))return!1}return!0}move(Ai,bo){if(bo&&this.enterChild(Ai,0,4))return!0;for(;;){if(this.sibling(Ai))return!0;if(this.atLastNode(Ai)||!this.parent())return!1}}next(Ai=!0){return this.move(1,Ai)}prev(Ai=!0){return this.move(-1,Ai)}moveTo(Ai,bo=0){for(;(this.from==this.to||(bo<1?this.from>=Ai:this.from>Ai)||(bo>-1?this.to<=Ai:this.to<Ai))&&this.parent(););for(;this.enterChild(1,Ai,bo););return this}get node(){if(!this.buffer)return this._tree;let Ai=this.bufferNode,bo=null,Ra=0;if(Ai&&Ai.context==this.buffer)e:for(let pc=this.index,mc=this.stack.length;mc>=0;){for(let uf=Ai;uf;uf=uf._parent)if(uf.index==pc){if(pc==this.index)return uf;bo=uf,Ra=mc+1;break e}pc=this.stack[--mc]}for(let pc=Ra;pc<this.stack.length;pc++)bo=new BufferNode(this.buffer,bo,this.stack[pc]);return this.bufferNode=new BufferNode(this.buffer,bo,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(Ai,bo){for(let Ra=0;;){let pc=!1;if(this.type.isAnonymous||Ai(this)!==!1){if(this.firstChild()){Ra++;continue}this.type.isAnonymous||(pc=!0)}for(;;){if(pc&&bo&&bo(this),pc=this.type.isAnonymous,!Ra)return;if(this.nextSibling())break;this.parent(),Ra--,pc=!0}}}matchContext(Ai){if(!this.buffer)return matchNodeContext(this.node.parent,Ai);let{buffer:bo}=this.buffer,{types:Ra}=bo.set;for(let pc=Ai.length-1,mc=this.stack.length-1;pc>=0;mc--){if(mc<0)return matchNodeContext(this._tree,Ai,pc);let uf=Ra[bo.buffer[this.stack[mc]]];if(!uf.isAnonymous){if(Ai[pc]&&Ai[pc]!=uf.name)return!1;pc--}}return!0}}function hasChild(vo){return vo.children.some(Ai=>Ai instanceof TreeBuffer||!Ai.type.isAnonymous||hasChild(Ai))}function buildTree(vo){var Ai;let{buffer:bo,nodeSet:Ra,maxBufferLength:pc=DefaultBufferLength,reused:mc=[],minRepeatType:uf=Ra.types.length}=vo,df=Array.isArray(bo)?new FlatBufferCursor(bo,bo.length):bo,ff=Ra.types,hf=0,pf=0;function mf(s1,c1,u1,T1,_1,R1){let{id:P1,start:E1,end:M1,size:m1}=df,$1=pf,k1=hf;for(;m1<0;)if(df.next(),m1==-1){let Z1=mc[P1];u1.push(Z1),T1.push(E1-s1);return}else if(m1==-3){hf=P1;return}else if(m1==-4){pf=P1;return}else throw new RangeError(`Unrecognized record size: ${m1}`);let F1=ff[P1],U1,B1,W1=E1-s1;if(M1-E1<=pc&&(B1=Sf(df.pos-c1,_1))){let Z1=new Uint16Array(B1.size-B1.skip),O1=df.pos-B1.size,j1=Z1.length;for(;df.pos>O1;)j1=xf(B1.start,Z1,j1);U1=new TreeBuffer(Z1,M1-B1.start,Ra),W1=B1.start-s1}else{let Z1=df.pos-m1;df.next();let O1=[],j1=[],L1=P1>=uf?P1:-1,G1=0,Y1=M1;for(;df.pos>Z1;)L1>=0&&df.id==L1&&df.size>=0?(df.end<=Y1-pc&&(vf(O1,j1,E1,G1,df.end,Y1,L1,$1,k1),G1=O1.length,Y1=df.end),df.next()):R1>2500?gf(E1,Z1,O1,j1):mf(E1,Z1,O1,j1,L1,R1+1);if(L1>=0&&G1>0&&G1<O1.length&&vf(O1,j1,E1,G1,E1,Y1,L1,$1,k1),O1.reverse(),j1.reverse(),L1>-1&&G1>0){let z1=yf(F1,k1);U1=balanceRange(F1,O1,j1,0,O1.length,0,M1-E1,z1,z1)}else U1=bf(F1,O1,j1,M1-E1,$1-M1,k1)}u1.push(U1),T1.push(W1)}function gf(s1,c1,u1,T1){let _1=[],R1=0,P1=-1;for(;df.pos>c1;){let{id:E1,start:M1,end:m1,size:$1}=df;if($1>4)df.next();else{if(P1>-1&&M1<P1)break;P1<0&&(P1=m1-pc),_1.push(E1,M1,m1),R1++,df.next()}}if(R1){let E1=new Uint16Array(R1*4),M1=_1[_1.length-2];for(let m1=_1.length-3,$1=0;m1>=0;m1-=3)E1[$1++]=_1[m1],E1[$1++]=_1[m1+1]-M1,E1[$1++]=_1[m1+2]-M1,E1[$1++]=$1;u1.push(new TreeBuffer(E1,_1[2]-M1,Ra)),T1.push(M1-s1)}}function yf(s1,c1){return(u1,T1,_1)=>{let R1=0,P1=u1.length-1,E1,M1;if(P1>=0&&(E1=u1[P1])instanceof Tree){if(!P1&&E1.type==s1&&E1.length==_1)return E1;(M1=E1.prop(NodeProp.lookAhead))&&(R1=T1[P1]+E1.length+M1)}return bf(s1,u1,T1,_1,R1,c1)}}function vf(s1,c1,u1,T1,_1,R1,P1,E1,M1){let m1=[],$1=[];for(;s1.length>T1;)m1.push(s1.pop()),$1.push(c1.pop()+u1-_1);s1.push(bf(Ra.types[P1],m1,$1,R1-_1,E1-R1,M1)),c1.push(_1-u1)}function bf(s1,c1,u1,T1,_1,R1,P1){if(R1){let E1=[NodeProp.contextHash,R1];P1=P1?[E1].concat(P1):[E1]}if(_1>25){let E1=[NodeProp.lookAhead,_1];P1=P1?[E1].concat(P1):[E1]}return new Tree(s1,c1,u1,T1,P1)}function Sf(s1,c1){let u1=df.fork(),T1=0,_1=0,R1=0,P1=u1.end-pc,E1={size:0,start:0,skip:0};e:for(let M1=u1.pos-s1;u1.pos>M1;){let m1=u1.size;if(u1.id==c1&&m1>=0){E1.size=T1,E1.start=_1,E1.skip=R1,R1+=4,T1+=4,u1.next();continue}let $1=u1.pos-m1;if(m1<0||$1<M1||u1.start<P1)break;let k1=u1.id>=uf?4:0,F1=u1.start;for(u1.next();u1.pos>$1;){if(u1.size<0)if(u1.size==-3)k1+=4;else break e;else u1.id>=uf&&(k1+=4);u1.next()}_1=F1,T1+=m1,R1+=k1}return(c1<0||T1==s1)&&(E1.size=T1,E1.start=_1,E1.skip=R1),E1.size>4?E1:void 0}function xf(s1,c1,u1){let{id:T1,start:_1,end:R1,size:P1}=df;if(df.next(),P1>=0&&T1<uf){let E1=u1;if(P1>4){let M1=df.pos-(P1-4);for(;df.pos>M1;)u1=xf(s1,c1,u1)}c1[--u1]=E1,c1[--u1]=R1-s1,c1[--u1]=_1-s1,c1[--u1]=T1}else P1==-3?hf=T1:P1==-4&&(pf=T1);return u1}let wf=[],If=[];for(;df.pos>0;)mf(vo.start||0,vo.bufferStart||0,wf,If,-1,0);let l1=(Ai=vo.length)!==null&&Ai!==void 0?Ai:wf.length?If[0]+wf[0].length:0;return new Tree(ff[vo.topID],wf.reverse(),If.reverse(),l1)}const nodeSizeCache=new WeakMap;function nodeSize(vo,Ai){if(!vo.isAnonymous||Ai instanceof TreeBuffer||Ai.type!=vo)return 1;let bo=nodeSizeCache.get(Ai);if(bo==null){bo=1;for(let Ra of Ai.children){if(Ra.type!=vo||!(Ra instanceof Tree)){bo=1;break}bo+=nodeSize(vo,Ra)}nodeSizeCache.set(Ai,bo)}return bo}function balanceRange(vo,Ai,bo,Ra,pc,mc,uf,df,ff){let hf=0;for(let vf=Ra;vf<pc;vf++)hf+=nodeSize(vo,Ai[vf]);let pf=Math.ceil(hf*1.5/8),mf=[],gf=[];function yf(vf,bf,Sf,xf,wf){for(let If=Sf;If<xf;){let l1=If,s1=bf[If],c1=nodeSize(vo,vf[If]);for(If++;If<xf;If++){let u1=nodeSize(vo,vf[If]);if(c1+u1>=pf)break;c1+=u1}if(If==l1+1){if(c1>pf){let u1=vf[l1];yf(u1.children,u1.positions,0,u1.children.length,bf[l1]+wf);continue}mf.push(vf[l1])}else{let u1=bf[If-1]+vf[If-1].length-s1;mf.push(balanceRange(vo,vf,bf,l1,If,s1,u1,null,ff))}gf.push(s1+wf-mc)}}return yf(Ai,bo,Ra,pc,0),(df||ff)(mf,gf,uf)}class TreeFragment{constructor(Ai,bo,Ra,pc,mc=!1,uf=!1){this.from=Ai,this.to=bo,this.tree=Ra,this.offset=pc,this.open=(mc?1:0)|(uf?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(Ai,bo=[],Ra=!1){let pc=[new TreeFragment(0,Ai.length,Ai,0,!1,Ra)];for(let mc of bo)mc.to>Ai.length&&pc.push(mc);return pc}static applyChanges(Ai,bo,Ra=128){if(!bo.length)return Ai;let pc=[],mc=1,uf=Ai.length?Ai[0]:null;for(let df=0,ff=0,hf=0;;df++){let pf=df<bo.length?bo[df]:null,mf=pf?pf.fromA:1e9;if(mf-ff>=Ra)for(;uf&&uf.from<mf;){let gf=uf;if(ff>=gf.from||mf<=gf.to||hf){let yf=Math.max(gf.from,ff)-hf,vf=Math.min(gf.to,mf)-hf;gf=yf>=vf?null:new TreeFragment(yf,vf,gf.tree,gf.offset+hf,df>0,!!pf)}if(gf&&pc.push(gf),uf.to>mf)break;uf=mc<Ai.length?Ai[mc++]:null}if(!pf)break;ff=pf.toA,hf=pf.toA-pf.toB}return pc}}class Parser{startParse(Ai,bo,Ra){return typeof Ai=="string"&&(Ai=new StringInput(Ai)),Ra=Ra?Ra.length?Ra.map(pc=>new Range$2(pc.from,pc.to)):[new Range$2(0,0)]:[new Range$2(0,Ai.length)],this.createParse(Ai,bo||[],Ra)}parse(Ai,bo,Ra){let pc=this.startParse(Ai,bo,Ra);for(;;){let mc=pc.advance();if(mc)return mc}}}class StringInput{constructor(Ai){this.string=Ai}get length(){return this.string.length}chunk(Ai){return this.string.slice(Ai)}get lineChunks(){return!1}read(Ai,bo){return this.string.slice(Ai,bo)}}new NodeProp({perNode:!0});let nextTagID=0;class Tag{constructor(Ai,bo,Ra,pc){this.name=Ai,this.set=bo,this.base=Ra,this.modified=pc,this.id=nextTagID++}toString(){let{name:Ai}=this;for(let bo of this.modified)bo.name&&(Ai=`${bo.name}(${Ai})`);return Ai}static define(Ai,bo){let Ra=typeof Ai=="string"?Ai:"?";if(Ai instanceof Tag&&(bo=Ai),bo!=null&&bo.base)throw new Error("Can not derive from a modified tag");let pc=new Tag(Ra,[],null,[]);if(pc.set.push(pc),bo)for(let mc of bo.set)pc.set.push(mc);return pc}static defineModifier(Ai){let bo=new Modifier(Ai);return Ra=>Ra.modified.indexOf(bo)>-1?Ra:Modifier.get(Ra.base||Ra,Ra.modified.concat(bo).sort((pc,mc)=>pc.id-mc.id))}}let nextModifierID=0;class Modifier{constructor(Ai){this.name=Ai,this.instances=[],this.id=nextModifierID++}static get(Ai,bo){if(!bo.length)return Ai;let Ra=bo[0].instances.find(df=>df.base==Ai&&sameArray(bo,df.modified));if(Ra)return Ra;let pc=[],mc=new Tag(Ai.name,pc,Ai,bo);for(let df of bo)df.instances.push(mc);let uf=powerSet(bo);for(let df of Ai.set)if(!df.modified.length)for(let ff of uf)pc.push(Modifier.get(df,ff));return mc}}function sameArray(vo,Ai){return vo.length==Ai.length&&vo.every((bo,Ra)=>bo==Ai[Ra])}function powerSet(vo){let Ai=[[]];for(let bo=0;bo<vo.length;bo++)for(let Ra=0,pc=Ai.length;Ra<pc;Ra++)Ai.push(Ai[Ra].concat(vo[bo]));return Ai.sort((bo,Ra)=>Ra.length-bo.length)}function styleTags(vo){let Ai=Object.create(null);for(let bo in vo){let Ra=vo[bo];Array.isArray(Ra)||(Ra=[Ra]);for(let pc of bo.split(" "))if(pc){let mc=[],uf=2,df=pc;for(let mf=0;;){if(df=="..."&&mf>0&&mf+3==pc.length){uf=1;break}let gf=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(df);if(!gf)throw new RangeError("Invalid path: "+pc);if(mc.push(gf[0]=="*"?"":gf[0][0]=='"'?JSON.parse(gf[0]):gf[0]),mf+=gf[0].length,mf==pc.length)break;let yf=pc[mf++];if(mf==pc.length&&yf=="!"){uf=0;break}if(yf!="/")throw new RangeError("Invalid path: "+pc);df=pc.slice(mf)}let ff=mc.length-1,hf=mc[ff];if(!hf)throw new RangeError("Invalid path: "+pc);let pf=new Rule(Ra,uf,ff>0?mc.slice(0,ff):null);Ai[hf]=pf.sort(Ai[hf])}}return ruleNodeProp.add(Ai)}const ruleNodeProp=new NodeProp;class Rule{constructor(Ai,bo,Ra,pc){this.tags=Ai,this.mode=bo,this.context=Ra,this.next=pc}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(Ai){return!Ai||Ai.depth<this.depth?(this.next=Ai,this):(Ai.next=this.sort(Ai.next),Ai)}get depth(){return this.context?this.context.length:0}}Rule.empty=new Rule([],2,null);function tagHighlighter(vo,Ai){let bo=Object.create(null);for(let mc of vo)if(!Array.isArray(mc.tag))bo[mc.tag.id]=mc.class;else for(let uf of mc.tag)bo[uf.id]=mc.class;let{scope:Ra,all:pc=null}=Ai||{};return{style:mc=>{let uf=pc;for(let df of mc)for(let ff of df.set){let hf=bo[ff.id];if(hf){uf=uf?uf+" "+hf:hf;break}}return uf},scope:Ra}}function highlightTags(vo,Ai){let bo=null;for(let Ra of vo){let pc=Ra.style(Ai);pc&&(bo=bo?bo+" "+pc:pc)}return bo}function highlightTree(vo,Ai,bo,Ra=0,pc=vo.length){let mc=new HighlightBuilder(Ra,Array.isArray(Ai)?Ai:[Ai],bo);mc.highlightRange(vo.cursor(),Ra,pc,"",mc.highlighters),mc.flush(pc)}class HighlightBuilder{constructor(Ai,bo,Ra){this.at=Ai,this.highlighters=bo,this.span=Ra,this.class=""}startSpan(Ai,bo){bo!=this.class&&(this.flush(Ai),Ai>this.at&&(this.at=Ai),this.class=bo)}flush(Ai){Ai>this.at&&this.class&&this.span(this.at,Ai,this.class)}highlightRange(Ai,bo,Ra,pc,mc){let{type:uf,from:df,to:ff}=Ai;if(df>=Ra||ff<=bo)return;uf.isTop&&(mc=this.highlighters.filter(yf=>!yf.scope||yf.scope(uf)));let hf=pc,pf=getStyleTags(Ai)||Rule.empty,mf=highlightTags(mc,pf.tags);if(mf&&(hf&&(hf+=" "),hf+=mf,pf.mode==1&&(pc+=(pc?" ":"")+mf)),this.startSpan(Math.max(bo,df),hf),pf.opaque)return;let gf=Ai.tree&&Ai.tree.prop(NodeProp.mounted);if(gf&&gf.overlay){let yf=Ai.node.enter(gf.overlay[0].from+df,1),vf=this.highlighters.filter(Sf=>!Sf.scope||Sf.scope(gf.tree.type)),bf=Ai.firstChild();for(let Sf=0,xf=df;;Sf++){let wf=Sf<gf.overlay.length?gf.overlay[Sf]:null,If=wf?wf.from+df:ff,l1=Math.max(bo,xf),s1=Math.min(Ra,If);if(l1<s1&&bf)for(;Ai.from<s1&&(this.highlightRange(Ai,l1,s1,pc,mc),this.startSpan(Math.min(s1,Ai.to),hf),!(Ai.to>=If||!Ai.nextSibling())););if(!wf||If>Ra)break;xf=wf.to+df,xf>bo&&(this.highlightRange(yf.cursor(),Math.max(bo,wf.from+df),Math.min(Ra,xf),"",vf),this.startSpan(Math.min(Ra,xf),hf))}bf&&Ai.parent()}else if(Ai.firstChild()){gf&&(pc="");do if(!(Ai.to<=bo)){if(Ai.from>=Ra)break;this.highlightRange(Ai,bo,Ra,pc,mc),this.startSpan(Math.min(Ra,Ai.to),hf)}while(Ai.nextSibling());Ai.parent()}}}function getStyleTags(vo){let Ai=vo.type.prop(ruleNodeProp);for(;Ai&&Ai.context&&!vo.matchContext(Ai.context);)Ai=Ai.next;return Ai||null}const t$1=Tag.define,comment=t$1(),name$1=t$1(),typeName=t$1(name$1),propertyName=t$1(name$1),literal=t$1(),string=t$1(literal),number=t$1(literal),content=t$1(),heading=t$1(content),keyword=t$1(),operator=t$1(),punctuation=t$1(),bracket=t$1(punctuation),meta=t$1(),tags={comment,lineComment:t$1(comment),blockComment:t$1(comment),docComment:t$1(comment),name:name$1,variableName:t$1(name$1),typeName,tagName:t$1(typeName),propertyName,attributeName:t$1(propertyName),className:t$1(name$1),labelName:t$1(name$1),namespace:t$1(name$1),macroName:t$1(name$1),literal,string,docString:t$1(string),character:t$1(string),attributeValue:t$1(string),number,integer:t$1(number),float:t$1(number),bool:t$1(literal),regexp:t$1(literal),escape:t$1(literal),color:t$1(literal),url:t$1(literal),keyword,self:t$1(keyword),null:t$1(keyword),atom:t$1(keyword),unit:t$1(keyword),modifier:t$1(keyword),operatorKeyword:t$1(keyword),controlKeyword:t$1(keyword),definitionKeyword:t$1(keyword),moduleKeyword:t$1(keyword),operator,derefOperator:t$1(operator),arithmeticOperator:t$1(operator),logicOperator:t$1(operator),bitwiseOperator:t$1(operator),compareOperator:t$1(operator),updateOperator:t$1(operator),definitionOperator:t$1(operator),typeOperator:t$1(operator),controlOperator:t$1(operator),punctuation,separator:t$1(punctuation),bracket,angleBracket:t$1(bracket),squareBracket:t$1(bracket),paren:t$1(bracket),brace:t$1(bracket),content,heading,heading1:t$1(heading),heading2:t$1(heading),heading3:t$1(heading),heading4:t$1(heading),heading5:t$1(heading),heading6:t$1(heading),contentSeparator:t$1(content),list:t$1(content),quote:t$1(content),emphasis:t$1(content),strong:t$1(content),link:t$1(content),monospace:t$1(content),strikethrough:t$1(content),inserted:t$1(),deleted:t$1(),changed:t$1(),invalid:t$1(),meta,documentMeta:t$1(meta),annotation:t$1(meta),processingInstruction:t$1(meta),definition:Tag.defineModifier("definition"),constant:Tag.defineModifier("constant"),function:Tag.defineModifier("function"),standard:Tag.defineModifier("standard"),local:Tag.defineModifier("local"),special:Tag.defineModifier("special")};for(let vo in tags){let Ai=tags[vo];Ai instanceof Tag&&(Ai.name=vo)}tagHighlighter([{tag:tags.link,class:"tok-link"},{tag:tags.heading,class:"tok-heading"},{tag:tags.emphasis,class:"tok-emphasis"},{tag:tags.strong,class:"tok-strong"},{tag:tags.keyword,class:"tok-keyword"},{tag:tags.atom,class:"tok-atom"},{tag:tags.bool,class:"tok-bool"},{tag:tags.url,class:"tok-url"},{tag:tags.labelName,class:"tok-labelName"},{tag:tags.inserted,class:"tok-inserted"},{tag:tags.deleted,class:"tok-deleted"},{tag:tags.literal,class:"tok-literal"},{tag:tags.string,class:"tok-string"},{tag:tags.number,class:"tok-number"},{tag:[tags.regexp,tags.escape,tags.special(tags.string)],class:"tok-string2"},{tag:tags.variableName,class:"tok-variableName"},{tag:tags.local(tags.variableName),class:"tok-variableName tok-local"},{tag:tags.definition(tags.variableName),class:"tok-variableName tok-definition"},{tag:tags.special(tags.variableName),class:"tok-variableName2"},{tag:tags.definition(tags.propertyName),class:"tok-propertyName tok-definition"},{tag:tags.typeName,class:"tok-typeName"},{tag:tags.namespace,class:"tok-namespace"},{tag:tags.className,class:"tok-className"},{tag:tags.macroName,class:"tok-macroName"},{tag:tags.propertyName,class:"tok-propertyName"},{tag:tags.operator,class:"tok-operator"},{tag:tags.comment,class:"tok-comment"},{tag:tags.meta,class:"tok-meta"},{tag:tags.invalid,class:"tok-invalid"},{tag:tags.punctuation,class:"tok-punctuation"}]);var _a;const languageDataProp=new NodeProp;function defineLanguageFacet(vo){return Facet.define({combine:vo?Ai=>Ai.concat(vo):void 0})}const sublanguageProp=new NodeProp;class Language{constructor(Ai,bo,Ra=[],pc=""){this.data=Ai,this.name=pc,EditorState.prototype.hasOwnProperty("tree")||Object.defineProperty(EditorState.prototype,"tree",{get(){return syntaxTree(this)}}),this.parser=bo,this.extension=[language.of(this),EditorState.languageData.of((mc,uf,df)=>{let ff=topNodeAt(mc,uf,df),hf=ff.type.prop(languageDataProp);if(!hf)return[];let pf=mc.facet(hf),mf=ff.type.prop(sublanguageProp);if(mf){let gf=ff.resolve(uf-ff.from,df);for(let yf of mf)if(yf.test(gf,mc)){let vf=mc.facet(yf.facet);return yf.type=="replace"?vf:vf.concat(pf)}}return pf})].concat(Ra)}isActiveAt(Ai,bo,Ra=-1){return topNodeAt(Ai,bo,Ra).type.prop(languageDataProp)==this.data}findRegions(Ai){let bo=Ai.facet(language);if((bo==null?void 0:bo.data)==this.data)return[{from:0,to:Ai.doc.length}];if(!bo||!bo.allowsNesting)return[];let Ra=[],pc=(mc,uf)=>{if(mc.prop(languageDataProp)==this.data){Ra.push({from:uf,to:uf+mc.length});return}let df=mc.prop(NodeProp.mounted);if(df){if(df.tree.prop(languageDataProp)==this.data){if(df.overlay)for(let ff of df.overlay)Ra.push({from:ff.from+uf,to:ff.to+uf});else Ra.push({from:uf,to:uf+mc.length});return}else if(df.overlay){let ff=Ra.length;if(pc(df.tree,df.overlay[0].from+uf),Ra.length>ff)return}}for(let ff=0;ff<mc.children.length;ff++){let hf=mc.children[ff];hf instanceof Tree&&pc(hf,mc.positions[ff]+uf)}};return pc(syntaxTree(Ai),0),Ra}get allowsNesting(){return!0}}Language.setState=StateEffect.define();function topNodeAt(vo,Ai,bo){let Ra=vo.facet(language),pc=syntaxTree(vo).topNode;if(!Ra||Ra.allowsNesting)for(let mc=pc;mc;mc=mc.enter(Ai,bo,IterMode.ExcludeBuffers))mc.type.isTop&&(pc=mc);return pc}class LRLanguage extends Language{constructor(Ai,bo,Ra){super(Ai,bo,[],Ra),this.parser=bo}static define(Ai){let bo=defineLanguageFacet(Ai.languageData);return new LRLanguage(bo,Ai.parser.configure({props:[languageDataProp.add(Ra=>Ra.isTop?bo:void 0)]}),Ai.name)}configure(Ai,bo){return new LRLanguage(this.data,this.parser.configure(Ai),bo||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function syntaxTree(vo){let Ai=vo.field(Language.state,!1);return Ai?Ai.tree:Tree.empty}class DocInput{constructor(Ai){this.doc=Ai,this.cursorPos=0,this.string="",this.cursor=Ai.iter()}get length(){return this.doc.length}syncTo(Ai){return this.string=this.cursor.next(Ai-this.cursorPos).value,this.cursorPos=Ai+this.string.length,this.cursorPos-this.string.length}chunk(Ai){return this.syncTo(Ai),this.string}get lineChunks(){return!0}read(Ai,bo){let Ra=this.cursorPos-this.string.length;return Ai<Ra||bo>=this.cursorPos?this.doc.sliceString(Ai,bo):this.string.slice(Ai-Ra,bo-Ra)}}let currentContext=null;class ParseContext{constructor(Ai,bo,Ra=[],pc,mc,uf,df,ff){this.parser=Ai,this.state=bo,this.fragments=Ra,this.tree=pc,this.treeLen=mc,this.viewport=uf,this.skipped=df,this.scheduleOn=ff,this.parse=null,this.tempSkipped=[]}static create(Ai,bo,Ra){return new ParseContext(Ai,bo,[],Tree.empty,0,Ra,[],null)}startParse(){return this.parser.startParse(new DocInput(this.state.doc),this.fragments)}work(Ai,bo){return bo!=null&&bo>=this.state.doc.length&&(bo=void 0),this.tree!=Tree.empty&&this.isDone(bo??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var Ra;if(typeof Ai=="number"){let pc=Date.now()+Ai;Ai=()=>Date.now()>pc}for(this.parse||(this.parse=this.startParse()),bo!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>bo)&&bo<this.state.doc.length&&this.parse.stopAt(bo);;){let pc=this.parse.advance();if(pc)if(this.fragments=this.withoutTempSkipped(TreeFragment.addTree(pc,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(Ra=this.parse.stoppedAt)!==null&&Ra!==void 0?Ra:this.state.doc.length,this.tree=pc,this.parse=null,this.treeLen<(bo??this.state.doc.length))this.parse=this.startParse();else return!0;if(Ai())return!1}})}takeTree(){let Ai,bo;this.parse&&(Ai=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>Ai)&&this.parse.stopAt(Ai),this.withContext(()=>{for(;!(bo=this.parse.advance()););}),this.treeLen=Ai,this.tree=bo,this.fragments=this.withoutTempSkipped(TreeFragment.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(Ai){let bo=currentContext;currentContext=this;try{return Ai()}finally{currentContext=bo}}withoutTempSkipped(Ai){for(let bo;bo=this.tempSkipped.pop();)Ai=cutFragments(Ai,bo.from,bo.to);return Ai}changes(Ai,bo){let{fragments:Ra,tree:pc,treeLen:mc,viewport:uf,skipped:df}=this;if(this.takeTree(),!Ai.empty){let ff=[];if(Ai.iterChangedRanges((hf,pf,mf,gf)=>ff.push({fromA:hf,toA:pf,fromB:mf,toB:gf})),Ra=TreeFragment.applyChanges(Ra,ff),pc=Tree.empty,mc=0,uf={from:Ai.mapPos(uf.from,-1),to:Ai.mapPos(uf.to,1)},this.skipped.length){df=[];for(let hf of this.skipped){let pf=Ai.mapPos(hf.from,1),mf=Ai.mapPos(hf.to,-1);pf<mf&&df.push({from:pf,to:mf})}}}return new ParseContext(this.parser,bo,Ra,pc,mc,uf,df,this.scheduleOn)}updateViewport(Ai){if(this.viewport.from==Ai.from&&this.viewport.to==Ai.to)return!1;this.viewport=Ai;let bo=this.skipped.length;for(let Ra=0;Ra<this.skipped.length;Ra++){let{from:pc,to:mc}=this.skipped[Ra];pc<Ai.to&&mc>Ai.from&&(this.fragments=cutFragments(this.fragments,pc,mc),this.skipped.splice(Ra--,1))}return this.skipped.length>=bo?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(Ai,bo){this.skipped.push({from:Ai,to:bo})}static getSkippingParser(Ai){return new class extends Parser{createParse(bo,Ra,pc){let mc=pc[0].from,uf=pc[pc.length-1].to;return{parsedPos:mc,advance(){let df=currentContext;if(df){for(let ff of pc)df.tempSkipped.push(ff);Ai&&(df.scheduleOn=df.scheduleOn?Promise.all([df.scheduleOn,Ai]):Ai)}return this.parsedPos=uf,new Tree(NodeType.none,[],[],uf-mc)},stoppedAt:null,stopAt(){}}}}}isDone(Ai){Ai=Math.min(Ai,this.state.doc.length);let bo=this.fragments;return this.treeLen>=Ai&&bo.length&&bo[0].from==0&&bo[0].to>=Ai}static get(){return currentContext}}function cutFragments(vo,Ai,bo){return TreeFragment.applyChanges(vo,[{fromA:Ai,toA:bo,fromB:Ai,toB:bo}])}class LanguageState{constructor(Ai){this.context=Ai,this.tree=Ai.tree}apply(Ai){if(!Ai.docChanged&&this.tree==this.context.tree)return this;let bo=this.context.changes(Ai.changes,Ai.state),Ra=this.context.treeLen==Ai.startState.doc.length?void 0:Math.max(Ai.changes.mapPos(this.context.treeLen),bo.viewport.to);return bo.work(20,Ra)||bo.takeTree(),new LanguageState(bo)}static init(Ai){let bo=Math.min(3e3,Ai.doc.length),Ra=ParseContext.create(Ai.facet(language).parser,Ai,{from:0,to:bo});return Ra.work(20,bo)||Ra.takeTree(),new LanguageState(Ra)}}Language.state=StateField.define({create:LanguageState.init,update(vo,Ai){for(let bo of Ai.effects)if(bo.is(Language.setState))return bo.value;return Ai.startState.facet(language)!=Ai.state.facet(language)?LanguageState.init(Ai.state):vo.apply(Ai)}});let requestIdle=vo=>{let Ai=setTimeout(()=>vo(),500);return()=>clearTimeout(Ai)};typeof requestIdleCallback<"u"&&(requestIdle=vo=>{let Ai=-1,bo=setTimeout(()=>{Ai=requestIdleCallback(vo,{timeout:400})},100);return()=>Ai<0?clearTimeout(bo):cancelIdleCallback(Ai)});const isInputPending=typeof navigator<"u"&&!((_a=navigator.scheduling)===null||_a===void 0)&&_a.isInputPending?()=>navigator.scheduling.isInputPending():null,parseWorker=ViewPlugin.fromClass(class{constructor(vo){this.view=vo,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(vo){let Ai=this.view.state.field(Language.state).context;(Ai.updateViewport(vo.view.viewport)||this.view.viewport.to>Ai.treeLen)&&this.scheduleWork(),(vo.docChanged||vo.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(Ai)}scheduleWork(){if(this.working)return;let{state:vo}=this.view,Ai=vo.field(Language.state);(Ai.tree!=Ai.context.tree||!Ai.context.isDone(vo.doc.length))&&(this.working=requestIdle(this.work))}work(vo){this.working=null;let Ai=Date.now();if(this.chunkEnd<Ai&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=Ai+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:bo,viewport:{to:Ra}}=this.view,pc=bo.field(Language.state);if(pc.tree==pc.context.tree&&pc.context.isDone(Ra+1e5))return;let mc=Date.now()+Math.min(this.chunkBudget,100,vo&&!isInputPending?Math.max(25,vo.timeRemaining()-5):1e9),uf=pc.context.treeLen<Ra&&bo.doc.length>Ra+1e3,df=pc.context.work(()=>isInputPending&&isInputPending()||Date.now()>mc,Ra+(uf?0:1e5));this.chunkBudget-=Date.now()-Ai,(df||this.chunkBudget<=0)&&(pc.context.takeTree(),this.view.dispatch({effects:Language.setState.of(new LanguageState(pc.context))})),this.chunkBudget>0&&!(df&&!uf)&&this.scheduleWork(),this.checkAsyncSchedule(pc.context)}checkAsyncSchedule(vo){vo.scheduleOn&&(this.workScheduled++,vo.scheduleOn.then(()=>this.scheduleWork()).catch(Ai=>logException(this.view.state,Ai)).then(()=>this.workScheduled--),vo.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),language=Facet.define({combine(vo){return vo.length?vo[0]:null},enables:vo=>[Language.state,parseWorker,EditorView.contentAttributes.compute([vo],Ai=>{let bo=Ai.facet(vo);return bo&&bo.name?{"data-language":bo.name}:{}})]});class LanguageSupport{constructor(Ai,bo=[]){this.language=Ai,this.support=bo,this.extension=[Ai,bo]}}const indentService=Facet.define(),indentUnit=Facet.define({combine:vo=>{if(!vo.length)return" ";let Ai=vo[0];if(!Ai||/\S/.test(Ai)||Array.from(Ai).some(bo=>bo!=Ai[0]))throw new Error("Invalid indent unit: "+JSON.stringify(vo[0]));return Ai}});function getIndentUnit(vo){let Ai=vo.facet(indentUnit);return Ai.charCodeAt(0)==9?vo.tabSize*Ai.length:Ai.length}function indentString(vo,Ai){let bo="",Ra=vo.tabSize,pc=vo.facet(indentUnit)[0];if(pc==" "){for(;Ai>=Ra;)bo+=" ",Ai-=Ra;pc=" "}for(let mc=0;mc<Ai;mc++)bo+=pc;return bo}function getIndentation(vo,Ai){vo instanceof EditorState&&(vo=new IndentContext(vo));for(let Ra of vo.state.facet(indentService)){let pc=Ra(vo,Ai);if(pc!==void 0)return pc}let bo=syntaxTree(vo.state);return bo.length>=Ai?syntaxIndentation(vo,bo,Ai):null}class IndentContext{constructor(Ai,bo={}){this.state=Ai,this.options=bo,this.unit=getIndentUnit(Ai)}lineAt(Ai,bo=1){let Ra=this.state.doc.lineAt(Ai),{simulateBreak:pc,simulateDoubleBreak:mc}=this.options;return pc!=null&&pc>=Ra.from&&pc<=Ra.to?mc&&pc==Ai?{text:"",from:Ai}:(bo<0?pc<Ai:pc<=Ai)?{text:Ra.text.slice(pc-Ra.from),from:pc}:{text:Ra.text.slice(0,pc-Ra.from),from:Ra.from}:Ra}textAfterPos(Ai,bo=1){if(this.options.simulateDoubleBreak&&Ai==this.options.simulateBreak)return"";let{text:Ra,from:pc}=this.lineAt(Ai,bo);return Ra.slice(Ai-pc,Math.min(Ra.length,Ai+100-pc))}column(Ai,bo=1){let{text:Ra,from:pc}=this.lineAt(Ai,bo),mc=this.countColumn(Ra,Ai-pc),uf=this.options.overrideIndentation?this.options.overrideIndentation(pc):-1;return uf>-1&&(mc+=uf-this.countColumn(Ra,Ra.search(/\S|$/))),mc}countColumn(Ai,bo=Ai.length){return countColumn(Ai,this.state.tabSize,bo)}lineIndent(Ai,bo=1){let{text:Ra,from:pc}=this.lineAt(Ai,bo),mc=this.options.overrideIndentation;if(mc){let uf=mc(pc);if(uf>-1)return uf}return this.countColumn(Ra,Ra.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const indentNodeProp=new NodeProp;function syntaxIndentation(vo,Ai,bo){let Ra=Ai.resolveStack(bo),pc=Ai.resolveInner(bo,-1).resolve(bo,0).enterUnfinishedNodesBefore(bo);if(pc!=Ra.node){let mc=[];for(let uf=pc;uf&&!(uf.from==Ra.node.from&&uf.type==Ra.node.type);uf=uf.parent)mc.push(uf);for(let uf=mc.length-1;uf>=0;uf--)Ra={node:mc[uf],next:Ra}}return indentFor(Ra,vo,bo)}function indentFor(vo,Ai,bo){for(let Ra=vo;Ra;Ra=Ra.next){let pc=indentStrategy(Ra.node);if(pc)return pc(TreeIndentContext.create(Ai,bo,Ra))}return 0}function ignoreClosed(vo){return vo.pos==vo.options.simulateBreak&&vo.options.simulateDoubleBreak}function indentStrategy(vo){let Ai=vo.type.prop(indentNodeProp);if(Ai)return Ai;let bo=vo.firstChild,Ra;if(bo&&(Ra=bo.type.prop(NodeProp.closedBy))){let pc=vo.lastChild,mc=pc&&Ra.indexOf(pc.name)>-1;return uf=>delimitedStrategy(uf,!0,1,void 0,mc&&!ignoreClosed(uf)?pc.from:void 0)}return vo.parent==null?topIndent:null}function topIndent(){return 0}class TreeIndentContext extends IndentContext{constructor(Ai,bo,Ra){super(Ai.state,Ai.options),this.base=Ai,this.pos=bo,this.context=Ra}get node(){return this.context.node}static create(Ai,bo,Ra){return new TreeIndentContext(Ai,bo,Ra)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(Ai){let bo=this.state.doc.lineAt(Ai.from);for(;;){let Ra=Ai.resolve(bo.from);for(;Ra.parent&&Ra.parent.from==Ra.from;)Ra=Ra.parent;if(isParent(Ra,Ai))break;bo=this.state.doc.lineAt(Ra.from)}return this.lineIndent(bo.from)}continue(){return indentFor(this.context.next,this.base,this.pos)}}function isParent(vo,Ai){for(let bo=Ai;bo;bo=bo.parent)if(vo==bo)return!0;return!1}function bracketedAligned(vo){let Ai=vo.node,bo=Ai.childAfter(Ai.from),Ra=Ai.lastChild;if(!bo)return null;let pc=vo.options.simulateBreak,mc=vo.state.doc.lineAt(bo.from),uf=pc==null||pc<=mc.from?mc.to:Math.min(mc.to,pc);for(let df=bo.to;;){let ff=Ai.childAfter(df);if(!ff||ff==Ra)return null;if(!ff.type.isSkipped){if(ff.from>=uf)return null;let hf=/^ */.exec(mc.text.slice(bo.to-mc.from))[0].length;return{from:bo.from,to:bo.to+hf}}df=ff.to}}function delimitedIndent({closing:vo,align:Ai=!0,units:bo=1}){return Ra=>delimitedStrategy(Ra,Ai,bo,vo)}function delimitedStrategy(vo,Ai,bo,Ra,pc){let mc=vo.textAfter,uf=mc.match(/^\s*/)[0].length,df=Ra&&mc.slice(uf,uf+Ra.length)==Ra||pc==vo.pos+uf,ff=Ai?bracketedAligned(vo):null;return ff?df?vo.column(ff.from):vo.column(ff.to):vo.baseIndent+(df?0:vo.unit*bo)}function continuedIndent({except:vo,units:Ai=1}={}){return bo=>{let Ra=vo&&vo.test(bo.textAfter);return bo.baseIndent+(Ra?0:Ai*bo.unit)}}const DontIndentBeyond=200;function indentOnInput(){return EditorState.transactionFilter.of(vo=>{if(!vo.docChanged||!vo.isUserEvent("input.type")&&!vo.isUserEvent("input.complete"))return vo;let Ai=vo.startState.languageDataAt("indentOnInput",vo.startState.selection.main.head);if(!Ai.length)return vo;let bo=vo.newDoc,{head:Ra}=vo.newSelection.main,pc=bo.lineAt(Ra);if(Ra>pc.from+DontIndentBeyond)return vo;let mc=bo.sliceString(pc.from,Ra);if(!Ai.some(hf=>hf.test(mc)))return vo;let{state:uf}=vo,df=-1,ff=[];for(let{head:hf}of uf.selection.ranges){let pf=uf.doc.lineAt(hf);if(pf.from==df)continue;df=pf.from;let mf=getIndentation(uf,pf.from);if(mf==null)continue;let gf=/^\s*/.exec(pf.text)[0],yf=indentString(uf,mf);gf!=yf&&ff.push({from:pf.from,to:pf.from+gf.length,insert:yf})}return ff.length?[vo,{changes:ff,sequential:!0}]:vo})}const foldService=Facet.define(),foldNodeProp=new NodeProp;function foldInside(vo){let Ai=vo.firstChild,bo=vo.lastChild;return Ai&&Ai.to<bo.from?{from:Ai.to,to:bo.type.isError?vo.to:bo.from}:null}function syntaxFolding(vo,Ai,bo){let Ra=syntaxTree(vo);if(Ra.length<bo)return null;let pc=Ra.resolveStack(bo,1),mc=null;for(let uf=pc;uf;uf=uf.next){let df=uf.node;if(df.to<=bo||df.from>bo)continue;if(mc&&df.from<Ai)break;let ff=df.type.prop(foldNodeProp);if(ff&&(df.to<Ra.length-50||Ra.length==vo.doc.length||!isUnfinished(df))){let hf=ff(df,vo);hf&&hf.from<=bo&&hf.from>=Ai&&hf.to>bo&&(mc=hf)}}return mc}function isUnfinished(vo){let Ai=vo.lastChild;return Ai&&Ai.to==vo.to&&Ai.type.isError}function foldable(vo,Ai,bo){for(let Ra of vo.facet(foldService)){let pc=Ra(vo,Ai,bo);if(pc)return pc}return syntaxFolding(vo,Ai,bo)}function mapRange(vo,Ai){let bo=Ai.mapPos(vo.from,1),Ra=Ai.mapPos(vo.to,-1);return bo>=Ra?void 0:{from:bo,to:Ra}}const foldEffect=StateEffect.define({map:mapRange}),unfoldEffect=StateEffect.define({map:mapRange});function selectedLines(vo){let Ai=[];for(let{head:bo}of vo.state.selection.ranges)Ai.some(Ra=>Ra.from<=bo&&Ra.to>=bo)||Ai.push(vo.lineBlockAt(bo));return Ai}const foldState=StateField.define({create(){return Decoration.none},update(vo,Ai){vo=vo.map(Ai.changes);for(let bo of Ai.effects)if(bo.is(foldEffect)&&!foldExists(vo,bo.value.from,bo.value.to)){let{preparePlaceholder:Ra}=Ai.state.facet(foldConfig),pc=Ra?Decoration.replace({widget:new PreparedFoldWidget(Ra(Ai.state,bo.value))}):foldWidget;vo=vo.update({add:[pc.range(bo.value.from,bo.value.to)]})}else bo.is(unfoldEffect)&&(vo=vo.update({filter:(Ra,pc)=>bo.value.from!=Ra||bo.value.to!=pc,filterFrom:bo.value.from,filterTo:bo.value.to}));if(Ai.selection){let bo=!1,{head:Ra}=Ai.selection.main;vo.between(Ra,Ra,(pc,mc)=>{pc<Ra&&mc>Ra&&(bo=!0)}),bo&&(vo=vo.update({filterFrom:Ra,filterTo:Ra,filter:(pc,mc)=>mc<=Ra||pc>=Ra}))}return vo},provide:vo=>EditorView.decorations.from(vo),toJSON(vo,Ai){let bo=[];return vo.between(0,Ai.doc.length,(Ra,pc)=>{bo.push(Ra,pc)}),bo},fromJSON(vo){if(!Array.isArray(vo)||vo.length%2)throw new RangeError("Invalid JSON for fold state");let Ai=[];for(let bo=0;bo<vo.length;){let Ra=vo[bo++],pc=vo[bo++];if(typeof Ra!="number"||typeof pc!="number")throw new RangeError("Invalid JSON for fold state");Ai.push(foldWidget.range(Ra,pc))}return Decoration.set(Ai,!0)}});function findFold(vo,Ai,bo){var Ra;let pc=null;return(Ra=vo.field(foldState,!1))===null||Ra===void 0||Ra.between(Ai,bo,(mc,uf)=>{(!pc||pc.from>mc)&&(pc={from:mc,to:uf})}),pc}function foldExists(vo,Ai,bo){let Ra=!1;return vo.between(Ai,Ai,(pc,mc)=>{pc==Ai&&mc==bo&&(Ra=!0)}),Ra}function maybeEnable(vo,Ai){return vo.field(foldState,!1)?Ai:Ai.concat(StateEffect.appendConfig.of(codeFolding()))}const foldCode=vo=>{for(let Ai of selectedLines(vo)){let bo=foldable(vo.state,Ai.from,Ai.to);if(bo)return vo.dispatch({effects:maybeEnable(vo.state,[foldEffect.of(bo),announceFold(vo,bo)])}),!0}return!1},unfoldCode=vo=>{if(!vo.state.field(foldState,!1))return!1;let Ai=[];for(let bo of selectedLines(vo)){let Ra=findFold(vo.state,bo.from,bo.to);Ra&&Ai.push(unfoldEffect.of(Ra),announceFold(vo,Ra,!1))}return Ai.length&&vo.dispatch({effects:Ai}),Ai.length>0};function announceFold(vo,Ai,bo=!0){let Ra=vo.state.doc.lineAt(Ai.from).number,pc=vo.state.doc.lineAt(Ai.to).number;return EditorView.announce.of(`${vo.state.phrase(bo?"Folded lines":"Unfolded lines")} ${Ra} ${vo.state.phrase("to")} ${pc}.`)}const foldAll=vo=>{let{state:Ai}=vo,bo=[];for(let Ra=0;Ra<Ai.doc.length;){let pc=vo.lineBlockAt(Ra),mc=foldable(Ai,pc.from,pc.to);mc&&bo.push(foldEffect.of(mc)),Ra=(mc?vo.lineBlockAt(mc.to):pc).to+1}return bo.length&&vo.dispatch({effects:maybeEnable(vo.state,bo)}),!!bo.length},unfoldAll=vo=>{let Ai=vo.state.field(foldState,!1);if(!Ai||!Ai.size)return!1;let bo=[];return Ai.between(0,vo.state.doc.length,(Ra,pc)=>{bo.push(unfoldEffect.of({from:Ra,to:pc}))}),vo.dispatch({effects:bo}),!0},foldKeymap=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:foldCode},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:unfoldCode},{key:"Ctrl-Alt-[",run:foldAll},{key:"Ctrl-Alt-]",run:unfoldAll}],defaultConfig={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},foldConfig=Facet.define({combine(vo){return combineConfig(vo,defaultConfig)}});function codeFolding(vo){return[foldState,baseTheme$1$1]}function widgetToDOM(vo,Ai){let{state:bo}=vo,Ra=bo.facet(foldConfig),pc=uf=>{let df=vo.lineBlockAt(vo.posAtDOM(uf.target)),ff=findFold(vo.state,df.from,df.to);ff&&vo.dispatch({effects:unfoldEffect.of(ff)}),uf.preventDefault()};if(Ra.placeholderDOM)return Ra.placeholderDOM(vo,pc,Ai);let mc=document.createElement("span");return mc.textContent=Ra.placeholderText,mc.setAttribute("aria-label",bo.phrase("folded code")),mc.title=bo.phrase("unfold"),mc.className="cm-foldPlaceholder",mc.onclick=pc,mc}const foldWidget=Decoration.replace({widget:new class extends WidgetType{toDOM(vo){return widgetToDOM(vo,null)}}});class PreparedFoldWidget extends WidgetType{constructor(Ai){super(),this.value=Ai}eq(Ai){return this.value==Ai.value}toDOM(Ai){return widgetToDOM(Ai,this.value)}}const foldGutterDefaults={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class FoldMarker extends GutterMarker{constructor(Ai,bo){super(),this.config=Ai,this.open=bo}eq(Ai){return this.config==Ai.config&&this.open==Ai.open}toDOM(Ai){if(this.config.markerDOM)return this.config.markerDOM(this.open);let bo=document.createElement("span");return bo.textContent=this.open?this.config.openText:this.config.closedText,bo.title=Ai.state.phrase(this.open?"Fold line":"Unfold line"),bo}}function foldGutter(vo={}){let Ai=Object.assign(Object.assign({},foldGutterDefaults),vo),bo=new FoldMarker(Ai,!0),Ra=new FoldMarker(Ai,!1),pc=ViewPlugin.fromClass(class{constructor(uf){this.from=uf.viewport.from,this.markers=this.buildMarkers(uf)}update(uf){(uf.docChanged||uf.viewportChanged||uf.startState.facet(language)!=uf.state.facet(language)||uf.startState.field(foldState,!1)!=uf.state.field(foldState,!1)||syntaxTree(uf.startState)!=syntaxTree(uf.state)||Ai.foldingChanged(uf))&&(this.markers=this.buildMarkers(uf.view))}buildMarkers(uf){let df=new RangeSetBuilder;for(let ff of uf.viewportLineBlocks){let hf=findFold(uf.state,ff.from,ff.to)?Ra:foldable(uf.state,ff.from,ff.to)?bo:null;hf&&df.add(ff.from,ff.from,hf)}return df.finish()}}),{domEventHandlers:mc}=Ai;return[pc,gutter({class:"cm-foldGutter",markers(uf){var df;return((df=uf.plugin(pc))===null||df===void 0?void 0:df.markers)||RangeSet.empty},initialSpacer(){return new FoldMarker(Ai,!1)},domEventHandlers:Object.assign(Object.assign({},mc),{click:(uf,df,ff)=>{if(mc.click&&mc.click(uf,df,ff))return!0;let hf=findFold(uf.state,df.from,df.to);if(hf)return uf.dispatch({effects:unfoldEffect.of(hf)}),!0;let pf=foldable(uf.state,df.from,df.to);return pf?(uf.dispatch({effects:foldEffect.of(pf)}),!0):!1}})}),codeFolding()]}const baseTheme$1$1=EditorView.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class HighlightStyle{constructor(Ai,bo){this.specs=Ai;let Ra;function pc(df){let ff=StyleModule.newName();return(Ra||(Ra=Object.create(null)))["."+ff]=df,ff}const mc=typeof bo.all=="string"?bo.all:bo.all?pc(bo.all):void 0,uf=bo.scope;this.scope=uf instanceof Language?df=>df.prop(languageDataProp)==uf.data:uf?df=>df==uf:void 0,this.style=tagHighlighter(Ai.map(df=>({tag:df.tag,class:df.class||pc(Object.assign({},df,{tag:null}))})),{all:mc}).style,this.module=Ra?new StyleModule(Ra):null,this.themeType=bo.themeType}static define(Ai,bo){return new HighlightStyle(Ai,bo||{})}}const highlighterFacet=Facet.define(),fallbackHighlighter=Facet.define({combine(vo){return vo.length?[vo[0]]:null}});function getHighlighters(vo){let Ai=vo.facet(highlighterFacet);return Ai.length?Ai:vo.facet(fallbackHighlighter)}function syntaxHighlighting(vo,Ai){let bo=[treeHighlighter],Ra;return vo instanceof HighlightStyle&&(vo.module&&bo.push(EditorView.styleModule.of(vo.module)),Ra=vo.themeType),Ai!=null&&Ai.fallback?bo.push(fallbackHighlighter.of(vo)):Ra?bo.push(highlighterFacet.computeN([EditorView.darkTheme],pc=>pc.facet(EditorView.darkTheme)==(Ra=="dark")?[vo]:[])):bo.push(highlighterFacet.of(vo)),bo}class TreeHighlighter{constructor(Ai){this.markCache=Object.create(null),this.tree=syntaxTree(Ai.state),this.decorations=this.buildDeco(Ai,getHighlighters(Ai.state)),this.decoratedTo=Ai.viewport.to}update(Ai){let bo=syntaxTree(Ai.state),Ra=getHighlighters(Ai.state),pc=Ra!=getHighlighters(Ai.startState),{viewport:mc}=Ai.view,uf=Ai.changes.mapPos(this.decoratedTo,1);bo.length<mc.to&&!pc&&bo.type==this.tree.type&&uf>=mc.to?(this.decorations=this.decorations.map(Ai.changes),this.decoratedTo=uf):(bo!=this.tree||Ai.viewportChanged||pc)&&(this.tree=bo,this.decorations=this.buildDeco(Ai.view,Ra),this.decoratedTo=mc.to)}buildDeco(Ai,bo){if(!bo||!this.tree.length)return Decoration.none;let Ra=new RangeSetBuilder;for(let{from:pc,to:mc}of Ai.visibleRanges)highlightTree(this.tree,bo,(uf,df,ff)=>{Ra.add(uf,df,this.markCache[ff]||(this.markCache[ff]=Decoration.mark({class:ff})))},pc,mc);return Ra.finish()}}const treeHighlighter=Prec.high(ViewPlugin.fromClass(TreeHighlighter,{decorations:vo=>vo.decorations})),defaultHighlightStyle=HighlightStyle.define([{tag:tags.meta,color:"#404740"},{tag:tags.link,textDecoration:"underline"},{tag:tags.heading,textDecoration:"underline",fontWeight:"bold"},{tag:tags.emphasis,fontStyle:"italic"},{tag:tags.strong,fontWeight:"bold"},{tag:tags.strikethrough,textDecoration:"line-through"},{tag:tags.keyword,color:"#708"},{tag:[tags.atom,tags.bool,tags.url,tags.contentSeparator,tags.labelName],color:"#219"},{tag:[tags.literal,tags.inserted],color:"#164"},{tag:[tags.string,tags.deleted],color:"#a11"},{tag:[tags.regexp,tags.escape,tags.special(tags.string)],color:"#e40"},{tag:tags.definition(tags.variableName),color:"#00f"},{tag:tags.local(tags.variableName),color:"#30a"},{tag:[tags.typeName,tags.namespace],color:"#085"},{tag:tags.className,color:"#167"},{tag:[tags.special(tags.variableName),tags.macroName],color:"#256"},{tag:tags.definition(tags.propertyName),color:"#00c"},{tag:tags.comment,color:"#940"},{tag:tags.invalid,color:"#f00"}]),baseTheme$4=EditorView.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),DefaultScanDist=1e4,DefaultBrackets="()[]{}",bracketMatchingConfig=Facet.define({combine(vo){return combineConfig(vo,{afterCursor:!0,brackets:DefaultBrackets,maxScanDistance:DefaultScanDist,renderMatch:defaultRenderMatch})}}),matchingMark=Decoration.mark({class:"cm-matchingBracket"}),nonmatchingMark=Decoration.mark({class:"cm-nonmatchingBracket"});function defaultRenderMatch(vo){let Ai=[],bo=vo.matched?matchingMark:nonmatchingMark;return Ai.push(bo.range(vo.start.from,vo.start.to)),vo.end&&Ai.push(bo.range(vo.end.from,vo.end.to)),Ai}const bracketMatchingState=StateField.define({create(){return Decoration.none},update(vo,Ai){if(!Ai.docChanged&&!Ai.selection)return vo;let bo=[],Ra=Ai.state.facet(bracketMatchingConfig);for(let pc of Ai.state.selection.ranges){if(!pc.empty)continue;let mc=matchBrackets(Ai.state,pc.head,-1,Ra)||pc.head>0&&matchBrackets(Ai.state,pc.head-1,1,Ra)||Ra.afterCursor&&(matchBrackets(Ai.state,pc.head,1,Ra)||pc.head<Ai.state.doc.length&&matchBrackets(Ai.state,pc.head+1,-1,Ra));mc&&(bo=bo.concat(Ra.renderMatch(mc,Ai.state)))}return Decoration.set(bo,!0)},provide:vo=>EditorView.decorations.from(vo)}),bracketMatchingUnique=[bracketMatchingState,baseTheme$4];function bracketMatching(vo={}){return[bracketMatchingConfig.of(vo),bracketMatchingUnique]}const bracketMatchingHandle=new NodeProp;function matchingNodes(vo,Ai,bo){let Ra=vo.prop(Ai<0?NodeProp.openedBy:NodeProp.closedBy);if(Ra)return Ra;if(vo.name.length==1){let pc=bo.indexOf(vo.name);if(pc>-1&&pc%2==(Ai<0?1:0))return[bo[pc+Ai]]}return null}function findHandle(vo){let Ai=vo.type.prop(bracketMatchingHandle);return Ai?Ai(vo.node):vo}function matchBrackets(vo,Ai,bo,Ra={}){let pc=Ra.maxScanDistance||DefaultScanDist,mc=Ra.brackets||DefaultBrackets,uf=syntaxTree(vo),df=uf.resolveInner(Ai,bo);for(let ff=df;ff;ff=ff.parent){let hf=matchingNodes(ff.type,bo,mc);if(hf&&ff.from<ff.to){let pf=findHandle(ff);if(pf&&(bo>0?Ai>=pf.from&&Ai<pf.to:Ai>pf.from&&Ai<=pf.to))return matchMarkedBrackets(vo,Ai,bo,ff,pf,hf,mc)}}return matchPlainBrackets(vo,Ai,bo,uf,df.type,pc,mc)}function matchMarkedBrackets(vo,Ai,bo,Ra,pc,mc,uf){let df=Ra.parent,ff={from:pc.from,to:pc.to},hf=0,pf=df==null?void 0:df.cursor();if(pf&&(bo<0?pf.childBefore(Ra.from):pf.childAfter(Ra.to)))do if(bo<0?pf.to<=Ra.from:pf.from>=Ra.to){if(hf==0&&mc.indexOf(pf.type.name)>-1&&pf.from<pf.to){let mf=findHandle(pf);return{start:ff,end:mf?{from:mf.from,to:mf.to}:void 0,matched:!0}}else if(matchingNodes(pf.type,bo,uf))hf++;else if(matchingNodes(pf.type,-bo,uf)){if(hf==0){let mf=findHandle(pf);return{start:ff,end:mf&&mf.from<mf.to?{from:mf.from,to:mf.to}:void 0,matched:!1}}hf--}}while(bo<0?pf.prevSibling():pf.nextSibling());return{start:ff,matched:!1}}function matchPlainBrackets(vo,Ai,bo,Ra,pc,mc,uf){let df=bo<0?vo.sliceDoc(Ai-1,Ai):vo.sliceDoc(Ai,Ai+1),ff=uf.indexOf(df);if(ff<0||ff%2==0!=bo>0)return null;let hf={from:bo<0?Ai-1:Ai,to:bo>0?Ai+1:Ai},pf=vo.doc.iterRange(Ai,bo>0?vo.doc.length:0),mf=0;for(let gf=0;!pf.next().done&&gf<=mc;){let yf=pf.value;bo<0&&(gf+=yf.length);let vf=Ai+gf*bo;for(let bf=bo>0?0:yf.length-1,Sf=bo>0?yf.length:-1;bf!=Sf;bf+=bo){let xf=uf.indexOf(yf[bf]);if(!(xf<0||Ra.resolveInner(vf+bf,1).type!=pc))if(xf%2==0==bo>0)mf++;else{if(mf==1)return{start:hf,end:{from:vf+bf,to:vf+bf+1},matched:xf>>1==ff>>1};mf--}}bo>0&&(gf+=yf.length)}return pf.done?{start:hf,matched:!1}:null}const noTokens=Object.create(null),typeArray=[NodeType.none],warned=[],byTag=Object.create(null),defaultTable=Object.create(null);for(let[vo,Ai]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])defaultTable[vo]=createTokenType(noTokens,Ai);function warnForPart(vo,Ai){warned.indexOf(vo)>-1||(warned.push(vo),console.warn(Ai))}function createTokenType(vo,Ai){let bo=[];for(let df of Ai.split(" ")){let ff=[];for(let hf of df.split(".")){let pf=vo[hf]||tags[hf];pf?typeof pf=="function"?ff.length?ff=ff.map(pf):warnForPart(hf,`Modifier ${hf} used at start of tag`):ff.length?warnForPart(hf,`Tag ${hf} used as modifier`):ff=Array.isArray(pf)?pf:[pf]:warnForPart(hf,`Unknown highlighting tag ${hf}`)}for(let hf of ff)bo.push(hf)}if(!bo.length)return 0;let Ra=Ai.replace(/ /g,"_"),pc=Ra+" "+bo.map(df=>df.id),mc=byTag[pc];if(mc)return mc.id;let uf=byTag[pc]=NodeType.define({id:typeArray.length,name:Ra,props:[styleTags({[Ra]:bo})]});return typeArray.push(uf),uf.id}Direction.RTL,Direction.LTR;const createTheme=({variant:vo,settings:Ai,styles:bo})=>{const Ra=EditorView.theme({"&":{backgroundColor:Ai.background,color:Ai.foreground},".cm-content":{caretColor:Ai.caret},".cm-cursor, .cm-dropCursor":{borderLeftColor:Ai.caret},"&.cm-focused .cm-selectionBackgroundm .cm-selectionBackground, .cm-content ::selection":{backgroundColor:Ai.selection},".cm-activeLine":{backgroundColor:Ai.lineHighlight},".cm-gutters":{backgroundColor:Ai.gutterBackground,color:Ai.gutterForeground},".cm-activeLineGutter":{backgroundColor:Ai.lineHighlight}},{dark:vo==="dark"}),pc=HighlightStyle.define(bo);return[Ra,syntaxHighlighting(pc)]};createTheme({variant:"dark",settings:{background:"#200020",foreground:"#D0D0FF",caret:"#7070FF",selection:"#80000080",gutterBackground:"#200020",gutterForeground:"#C080C0",lineHighlight:"#80000040"},styles:[{tag:tags.comment,color:"#404080"},{tag:[tags.string,tags.regexp],color:"#999999"},{tag:tags.number,color:"#7090B0"},{tag:[tags.bool,tags.null],color:"#8080A0"},{tag:[tags.punctuation,tags.derefOperator],color:"#805080"},{tag:tags.keyword,color:"#60B0FF"},{tag:tags.definitionKeyword,color:"#B0FFF0"},{tag:tags.moduleKeyword,color:"#60B0FF"},{tag:tags.operator,color:"#A0A0FF"},{tag:[tags.variableName,tags.self],color:"#008080"},{tag:tags.operatorKeyword,color:"#A0A0FF"},{tag:tags.controlKeyword,color:"#80A0FF"},{tag:tags.className,color:"#70E080"},{tag:[tags.function(tags.propertyName),tags.propertyName],color:"#50A0A0"},{tag:tags.tagName,color:"#009090"},{tag:tags.modifier,color:"#B0FFF0"},{tag:[tags.squareBracket,tags.attributeName],color:"#D0D0FF"}]});const ayuLight=createTheme({variant:"light",settings:{background:"#fcfcfc",foreground:"#5c6166",caret:"#ffaa33",selection:"#036dd626",gutterBackground:"#fcfcfc",gutterForeground:"#8a919966",lineHighlight:"#8a91991a"},styles:[{tag:tags.comment,color:"#787b8099"},{tag:tags.string,color:"#86b300"},{tag:tags.regexp,color:"#4cbf99"},{tag:[tags.number,tags.bool,tags.null],color:"#ffaa33"},{tag:tags.variableName,color:"#5c6166"},{tag:[tags.definitionKeyword,tags.modifier],color:"#fa8d3e"},{tag:[tags.keyword,tags.special(tags.brace)],color:"#fa8d3e"},{tag:tags.operator,color:"#ed9366"},{tag:tags.separator,color:"#5c6166b3"},{tag:tags.punctuation,color:"#5c6166"},{tag:[tags.definition(tags.propertyName),tags.function(tags.variableName)],color:"#f2ae49"},{tag:[tags.className,tags.definition(tags.typeName)],color:"#22a4e6"},{tag:[tags.tagName,tags.typeName,tags.self,tags.labelName],color:"#55b4d4"},{tag:tags.angleBracket,color:"#55b4d480"},{tag:tags.attributeName,color:"#f2ae49"}]});createTheme({variant:"dark",settings:{background:"#15191EFA",foreground:"#EEF2F7",caret:"#C4C4C4",selection:"#90B2D557",gutterBackground:"#15191EFA",gutterForeground:"#aaaaaa95",lineHighlight:"#57575712"},styles:[{tag:tags.comment,color:"#6E6E6E"},{tag:[tags.string,tags.regexp,tags.special(tags.brace)],color:"#5C81B3"},{tag:tags.number,color:"#C1E1B8"},{tag:tags.bool,color:"#53667D"},{tag:[tags.definitionKeyword,tags.modifier,tags.function(tags.propertyName)],color:"#A3D295",fontWeight:"bold"},{tag:[tags.keyword,tags.moduleKeyword,tags.operatorKeyword,tags.operator],color:"#697A8E",fontWeight:"bold"},{tag:[tags.variableName,tags.attributeName],color:"#708E67"},{tag:[tags.function(tags.variableName),tags.definition(tags.propertyName),tags.derefOperator],color:"#fff"},{tag:tags.tagName,color:"#A3D295"}]});createTheme({variant:"dark",settings:{background:"#2e241d",foreground:"#BAAE9E",caret:"#A7A7A7",selection:"#DDF0FF33",gutterBackground:"#28211C",gutterForeground:"#BAAE9E90",lineHighlight:"#FFFFFF08"},styles:[{tag:tags.comment,color:"#666666"},{tag:[tags.string,tags.special(tags.brace)],color:"#54BE0D"},{tag:tags.regexp,color:"#E9C062"},{tag:tags.number,color:"#CF6A4C"},{tag:[tags.keyword,tags.operator],color:"#5EA6EA"},{tag:tags.variableName,color:"#7587A6"},{tag:[tags.definitionKeyword,tags.modifier],color:"#F9EE98"},{tag:[tags.propertyName,tags.function(tags.variableName)],color:"#937121"},{tag:[tags.typeName,tags.angleBracket,tags.tagName],color:"#9B859D"}]});createTheme({variant:"dark",settings:{background:"#3b2627",foreground:"#E6E1C4",caret:"#E6E1C4",selection:"#16120E",gutterBackground:"#3b2627",gutterForeground:"#E6E1C490",lineHighlight:"#1F1611"},styles:[{tag:tags.comment,color:"#6B4E32"},{tag:[tags.keyword,tags.operator,tags.derefOperator],color:"#EF5D32"},{tag:tags.className,color:"#EFAC32",fontWeight:"bold"},{tag:[tags.typeName,tags.propertyName,tags.function(tags.variableName),tags.definition(tags.variableName)],color:"#EFAC32"},{tag:tags.definition(tags.typeName),color:"#EFAC32",fontWeight:"bold"},{tag:tags.labelName,color:"#EFAC32",fontWeight:"bold"},{tag:[tags.number,tags.bool],color:"#6C99BB"},{tag:[tags.variableName,tags.self],color:"#7DAF9C"},{tag:[tags.string,tags.special(tags.brace),tags.regexp],color:"#D9D762"},{tag:[tags.angleBracket,tags.tagName,tags.attributeName],color:"#EFCB43"}]});createTheme({variant:"dark",settings:{background:"#000205",foreground:"#FFFFFF",caret:"#E60065",selection:"#E60C6559",gutterBackground:"#000205",gutterForeground:"#ffffff90",lineHighlight:"#4DD7FC1A"},styles:[{tag:tags.comment,color:"#404040"},{tag:[tags.string,tags.special(tags.brace),tags.regexp],color:"#00D8FF"},{tag:tags.number,color:"#E62286"},{tag:[tags.variableName,tags.attributeName,tags.self],color:"#E62286",fontWeight:"bold"},{tag:tags.function(tags.variableName),color:"#fff",fontWeight:"bold"}]});createTheme({variant:"light",settings:{background:"#fff",foreground:"#000",caret:"#000",selection:"#BDD5FC",gutterBackground:"#fff",gutterForeground:"#00000070",lineHighlight:"#FFFBD1"},styles:[{tag:tags.comment,color:"#BCC8BA"},{tag:[tags.string,tags.special(tags.brace),tags.regexp],color:"#5D90CD"},{tag:[tags.number,tags.bool,tags.null],color:"#46A609"},{tag:tags.keyword,color:"#AF956F"},{tag:[tags.definitionKeyword,tags.modifier],color:"#C52727"},{tag:[tags.angleBracket,tags.tagName,tags.attributeName],color:"#606060"},{tag:tags.self,color:"#000"}]});createTheme({variant:"dark",settings:{background:"#00254b",foreground:"#FFFFFF",caret:"#FFFFFF",selection:"#B36539BF",gutterBackground:"#00254b",gutterForeground:"#FFFFFF70",lineHighlight:"#00000059"},styles:[{tag:tags.comment,color:"#0088FF"},{tag:tags.string,color:"#3AD900"},{tag:tags.regexp,color:"#80FFC2"},{tag:[tags.number,tags.bool,tags.null],color:"#FF628C"},{tag:[tags.definitionKeyword,tags.modifier],color:"#FFEE80"},{tag:tags.variableName,color:"#CCCCCC"},{tag:tags.self,color:"#FF80E1"},{tag:[tags.className,tags.definition(tags.propertyName),tags.function(tags.variableName),tags.definition(tags.typeName),tags.labelName],color:"#FFDD00"},{tag:[tags.keyword,tags.operator],color:"#FF9D00"},{tag:[tags.propertyName,tags.typeName],color:"#80FFBB"},{tag:tags.special(tags.brace),color:"#EDEF7D"},{tag:tags.attributeName,color:"#9EFFFF"},{tag:tags.derefOperator,color:"#fff"}]});createTheme({variant:"dark",settings:{background:"#060521",foreground:"#E0E0E0",caret:"#FFFFFFA6",selection:"#122BBB",gutterBackground:"#060521",gutterForeground:"#E0E0E090",lineHighlight:"#FFFFFF0F"},styles:[{tag:tags.comment,color:"#AEAEAE"},{tag:[tags.string,tags.special(tags.brace),tags.regexp],color:"#8DFF8E"},{tag:[tags.className,tags.definition(tags.propertyName),tags.function(tags.variableName),tags.function(tags.definition(tags.variableName)),tags.definition(tags.typeName)],color:"#A3EBFF"},{tag:[tags.number,tags.bool,tags.null],color:"#62E9BD"},{tag:[tags.keyword,tags.operator],color:"#2BF1DC"},{tag:[tags.definitionKeyword,tags.modifier],color:"#F8FBB1"},{tag:[tags.variableName,tags.self],color:"#B683CA"},{tag:[tags.angleBracket,tags.tagName,tags.typeName,tags.propertyName],color:"#60A4F1"},{tag:tags.derefOperator,color:"#E0E0E0"},{tag:tags.attributeName,color:"#7BACCA"}]});createTheme({variant:"dark",settings:{background:"#2d2f3f",foreground:"#f8f8f2",caret:"#f8f8f0",selection:"#44475a",gutterBackground:"#282a36",gutterForeground:"rgb(144, 145, 148)",lineHighlight:"#44475a"},styles:[{tag:tags.comment,color:"#6272a4"},{tag:[tags.string,tags.special(tags.brace)],color:"#f1fa8c"},{tag:[tags.number,tags.self,tags.bool,tags.null],color:"#bd93f9"},{tag:[tags.keyword,tags.operator],color:"#ff79c6"},{tag:[tags.definitionKeyword,tags.typeName],color:"#8be9fd"},{tag:tags.definition(tags.typeName),color:"#f8f8f2"},{tag:[tags.className,tags.definition(tags.propertyName),tags.function(tags.variableName),tags.attributeName],color:"#50fa7b"}]});createTheme({variant:"light",settings:{background:"#FFFFFF",foreground:"#000000",caret:"#000000",selection:"#80C7FF",gutterBackground:"#FFFFFF",gutterForeground:"#00000070",lineHighlight:"#C1E2F8"},styles:[{tag:tags.comment,color:"#AAAAAA"},{tag:[tags.keyword,tags.operator,tags.typeName,tags.tagName,tags.propertyName],color:"#2F6F9F",fontWeight:"bold"},{tag:[tags.attributeName,tags.definition(tags.propertyName)],color:"#4F9FD0"},{tag:[tags.className,tags.string,tags.special(tags.brace)],color:"#CF4F5F"},{tag:tags.number,color:"#CF4F5F",fontWeight:"bold"},{tag:tags.variableName,fontWeight:"bold"}]});createTheme({variant:"light",settings:{background:"#f2f1f8",foreground:"#0c006b",caret:"#5c49e9",selection:"#d5d1f2",gutterBackground:"#f2f1f8",gutterForeground:"#0c006b70",lineHighlight:"#e1def3"},styles:[{tag:tags.comment,color:"#9995b7"},{tag:tags.keyword,color:"#ff5792",fontWeight:"bold"},{tag:[tags.definitionKeyword,tags.modifier],color:"#ff5792"},{tag:[tags.className,tags.tagName,tags.definition(tags.typeName)],color:"#0094f0"},{tag:[tags.number,tags.bool,tags.null,tags.special(tags.brace)],color:"#5842ff"},{tag:[tags.definition(tags.propertyName),tags.function(tags.variableName)],color:"#0095a8"},{tag:tags.typeName,color:"#b3694d"},{tag:[tags.propertyName,tags.variableName],color:"#fa8900"},{tag:tags.operator,color:"#ff5792"},{tag:tags.self,color:"#e64100"},{tag:[tags.string,tags.regexp],color:"#00b368"},{tag:[tags.paren,tags.bracket],color:"#0431fa"},{tag:tags.labelName,color:"#00bdd6"},{tag:tags.attributeName,color:"#e64100"},{tag:tags.angleBracket,color:"#9995b7"}]});createTheme({variant:"light",settings:{background:"#faf4ed",foreground:"#575279",caret:"#575279",selection:"#6e6a8614",gutterBackground:"#faf4ed",gutterForeground:"#57527970",lineHighlight:"#6e6a860d"},styles:[{tag:tags.comment,color:"#9893a5"},{tag:[tags.bool,tags.null],color:"#286983"},{tag:tags.number,color:"#d7827e"},{tag:tags.className,color:"#d7827e"},{tag:[tags.angleBracket,tags.tagName,tags.typeName],color:"#56949f"},{tag:tags.attributeName,color:"#907aa9"},{tag:tags.punctuation,color:"#797593"},{tag:[tags.keyword,tags.modifier],color:"#286983"},{tag:[tags.string,tags.regexp],color:"#ea9d34"},{tag:tags.variableName,color:"#d7827e"}]});createTheme({variant:"light",settings:{background:"#FFFFFF",foreground:"#000000",caret:"#000000",selection:"#FFFD0054",gutterBackground:"#FFFFFF",gutterForeground:"#00000070",lineHighlight:"#00000008"},styles:[{tag:tags.comment,color:"#CFCFCF"},{tag:[tags.number,tags.bool,tags.null],color:"#E66C29"},{tag:[tags.className,tags.definition(tags.propertyName),tags.function(tags.variableName),tags.labelName,tags.definition(tags.typeName)],color:"#2EB43B"},{tag:tags.keyword,color:"#D8B229"},{tag:tags.operator,color:"#4EA44E",fontWeight:"bold"},{tag:[tags.definitionKeyword,tags.modifier],color:"#925A47"},{tag:tags.string,color:"#704D3D"},{tag:tags.typeName,color:"#2F8996"},{tag:[tags.variableName,tags.propertyName],color:"#77ACB0"},{tag:tags.self,color:"#77ACB0",fontWeight:"bold"},{tag:tags.regexp,color:"#E3965E"},{tag:[tags.tagName,tags.angleBracket],color:"#BAA827"},{tag:tags.attributeName,color:"#B06520"},{tag:tags.derefOperator,color:"#000"}]});createTheme({variant:"light",settings:{background:"#fef7e5",foreground:"#586E75",caret:"#000000",selection:"#073642",gutterBackground:"#fef7e5",gutterForeground:"#586E7580",lineHighlight:"#EEE8D5"},styles:[{tag:tags.comment,color:"#93A1A1"},{tag:tags.string,color:"#2AA198"},{tag:tags.regexp,color:"#D30102"},{tag:tags.number,color:"#D33682"},{tag:tags.variableName,color:"#268BD2"},{tag:[tags.keyword,tags.operator,tags.punctuation],color:"#859900"},{tag:[tags.definitionKeyword,tags.modifier],color:"#073642",fontWeight:"bold"},{tag:[tags.className,tags.self,tags.definition(tags.propertyName)],color:"#268BD2"},{tag:tags.function(tags.variableName),color:"#268BD2"},{tag:[tags.bool,tags.null],color:"#B58900"},{tag:tags.tagName,color:"#268BD2",fontWeight:"bold"},{tag:tags.angleBracket,color:"#93A1A1"},{tag:tags.attributeName,color:"#93A1A1"},{tag:tags.typeName,color:"#859900"}]});createTheme({variant:"light",settings:{background:"#FFFFFF",foreground:"#4D4D4C",caret:"#AEAFAD",selection:"#D6D6D6",gutterBackground:"#FFFFFF",gutterForeground:"#4D4D4C80",lineHighlight:"#EFEFEF"},styles:[{tag:tags.comment,color:"#8E908C"},{tag:[tags.variableName,tags.self,tags.propertyName,tags.attributeName,tags.regexp],color:"#C82829"},{tag:[tags.number,tags.bool,tags.null],color:"#F5871F"},{tag:[tags.className,tags.typeName,tags.definition(tags.typeName)],color:"#C99E00"},{tag:[tags.string,tags.special(tags.brace)],color:"#718C00"},{tag:tags.operator,color:"#3E999F"},{tag:[tags.definition(tags.propertyName),tags.function(tags.variableName)],color:"#4271AE"},{tag:tags.keyword,color:"#8959A8"},{tag:tags.derefOperator,color:"#4D4D4C"}]});function objectValues(vo){const Ai=Object.keys(vo),bo=Ai.length,Ra=new Array(bo);for(let pc=0;pc<bo;++pc)Ra[pc]=vo[Ai[pc]];return Ra}function hintList(vo,Ai){return filterAndSortList(Ai,normalizeText(vo.string))}function filterAndSortList(vo,Ai){if(!Ai||Ai.trim()===""||Ai.trim()===":"||Ai.trim()==="{")return filterNonEmpty(vo,Ra=>!Ra.isDeprecated);const bo=vo.map(Ra=>({proximity:getProximity(normalizeText(Ra.label),Ai),entry:Ra}));return filterNonEmpty(filterNonEmpty(bo,Ra=>Ra.proximity<=2),Ra=>!Ra.entry.isDeprecated).sort((Ra,pc)=>(Ra.entry.isDeprecated?1:0)-(pc.entry.isDeprecated?1:0)||Ra.proximity-pc.proximity||Ra.entry.label.length-pc.entry.label.length).map(Ra=>Ra.entry)}function filterNonEmpty(vo,Ai){const bo=vo.filter(Ai);return bo.length===0?vo:bo}function normalizeText(vo){return vo.toLowerCase().replaceAll(/\W/g,"")}function getProximity(vo,Ai){let bo=lexicalDistance(Ai,vo);return vo.length>Ai.length&&(bo-=vo.length-Ai.length-1,bo+=vo.indexOf(Ai)===0?0:.5),bo}function lexicalDistance(vo,Ai){let bo,Ra;const pc=[],mc=vo.length,uf=Ai.length;for(bo=0;bo<=mc;bo++)pc[bo]=[bo];for(Ra=1;Ra<=uf;Ra++)pc[0][Ra]=Ra;for(bo=1;bo<=mc;bo++)for(Ra=1;Ra<=uf;Ra++){const df=vo[bo-1]===Ai[Ra-1]?0:1;pc[bo][Ra]=Math.min(pc[bo-1][Ra]+1,pc[bo][Ra-1]+1,pc[bo-1][Ra-1]+df),bo>1&&Ra>1&&vo[bo-1]===Ai[Ra-2]&&vo[bo-2]===Ai[Ra-1]&&(pc[bo][Ra]=Math.min(pc[bo][Ra],pc[bo-2][Ra-2]+df))}return pc[mc][uf]}const insertSuffix=vo=>` {
|
|
357
|
-
$1
|
|
358
|
-
}`,getInsertText=(vo,Ai,bo)=>{if(!Ai)return bo??vo;const Ra=getNamedType(Ai);return isObjectType(Ra)||isInputObjectType(Ra)||isListType(Ra)||isAbstractType(Ra)?vo+insertSuffix():bo??vo},getInputInsertText=(vo,Ai,bo)=>{if(isListType(Ai)){const Ra=getNamedType(Ai.ofType);return vo+`[${getInsertText("",Ra,"$1")}]`}return getInsertText(vo,Ai,bo)},getFieldInsertText=vo=>{const Ai=vo.args.filter(bo=>bo.type.toString().endsWith("!"));if(Ai.length)return vo.name+`(${Ai.map((bo,Ra)=>`${bo.name}: $${Ra+1}`)}) ${getInsertText("",vo.type,`
|
|
359
|
-
`)}`};var DocumentUri;(function(vo){function Ai(bo){return typeof bo=="string"}vo.is=Ai})(DocumentUri||(DocumentUri={}));var URI;(function(vo){function Ai(bo){return typeof bo=="string"}vo.is=Ai})(URI||(URI={}));var integer;(function(vo){vo.MIN_VALUE=-2147483648,vo.MAX_VALUE=2147483647;function Ai(bo){return typeof bo=="number"&&vo.MIN_VALUE<=bo&&bo<=vo.MAX_VALUE}vo.is=Ai})(integer||(integer={}));var uinteger;(function(vo){vo.MIN_VALUE=0,vo.MAX_VALUE=2147483647;function Ai(bo){return typeof bo=="number"&&vo.MIN_VALUE<=bo&&bo<=vo.MAX_VALUE}vo.is=Ai})(uinteger||(uinteger={}));var Position$2;(function(vo){function Ai(Ra,pc){return Ra===Number.MAX_VALUE&&(Ra=uinteger.MAX_VALUE),pc===Number.MAX_VALUE&&(pc=uinteger.MAX_VALUE),{line:Ra,character:pc}}vo.create=Ai;function bo(Ra){let pc=Ra;return Is.objectLiteral(pc)&&Is.uinteger(pc.line)&&Is.uinteger(pc.character)}vo.is=bo})(Position$2||(Position$2={}));var Range$1;(function(vo){function Ai(Ra,pc,mc,uf){if(Is.uinteger(Ra)&&Is.uinteger(pc)&&Is.uinteger(mc)&&Is.uinteger(uf))return{start:Position$2.create(Ra,pc),end:Position$2.create(mc,uf)};if(Position$2.is(Ra)&&Position$2.is(pc))return{start:Ra,end:pc};throw new Error(`Range#create called with invalid arguments[${Ra}, ${pc}, ${mc}, ${uf}]`)}vo.create=Ai;function bo(Ra){let pc=Ra;return Is.objectLiteral(pc)&&Position$2.is(pc.start)&&Position$2.is(pc.end)}vo.is=bo})(Range$1||(Range$1={}));var Location;(function(vo){function Ai(Ra,pc){return{uri:Ra,range:pc}}vo.create=Ai;function bo(Ra){let pc=Ra;return Is.objectLiteral(pc)&&Range$1.is(pc.range)&&(Is.string(pc.uri)||Is.undefined(pc.uri))}vo.is=bo})(Location||(Location={}));var LocationLink;(function(vo){function Ai(Ra,pc,mc,uf){return{targetUri:Ra,targetRange:pc,targetSelectionRange:mc,originSelectionRange:uf}}vo.create=Ai;function bo(Ra){let pc=Ra;return Is.objectLiteral(pc)&&Range$1.is(pc.targetRange)&&Is.string(pc.targetUri)&&Range$1.is(pc.targetSelectionRange)&&(Range$1.is(pc.originSelectionRange)||Is.undefined(pc.originSelectionRange))}vo.is=bo})(LocationLink||(LocationLink={}));var Color;(function(vo){function Ai(Ra,pc,mc,uf){return{red:Ra,green:pc,blue:mc,alpha:uf}}vo.create=Ai;function bo(Ra){const pc=Ra;return Is.objectLiteral(pc)&&Is.numberRange(pc.red,0,1)&&Is.numberRange(pc.green,0,1)&&Is.numberRange(pc.blue,0,1)&&Is.numberRange(pc.alpha,0,1)}vo.is=bo})(Color||(Color={}));var ColorInformation;(function(vo){function Ai(Ra,pc){return{range:Ra,color:pc}}vo.create=Ai;function bo(Ra){const pc=Ra;return Is.objectLiteral(pc)&&Range$1.is(pc.range)&&Color.is(pc.color)}vo.is=bo})(ColorInformation||(ColorInformation={}));var ColorPresentation;(function(vo){function Ai(Ra,pc,mc){return{label:Ra,textEdit:pc,additionalTextEdits:mc}}vo.create=Ai;function bo(Ra){const pc=Ra;return Is.objectLiteral(pc)&&Is.string(pc.label)&&(Is.undefined(pc.textEdit)||TextEdit.is(pc))&&(Is.undefined(pc.additionalTextEdits)||Is.typedArray(pc.additionalTextEdits,TextEdit.is))}vo.is=bo})(ColorPresentation||(ColorPresentation={}));var FoldingRangeKind;(function(vo){vo.Comment="comment",vo.Imports="imports",vo.Region="region"})(FoldingRangeKind||(FoldingRangeKind={}));var FoldingRange;(function(vo){function Ai(Ra,pc,mc,uf,df,ff){const hf={startLine:Ra,endLine:pc};return Is.defined(mc)&&(hf.startCharacter=mc),Is.defined(uf)&&(hf.endCharacter=uf),Is.defined(df)&&(hf.kind=df),Is.defined(ff)&&(hf.collapsedText=ff),hf}vo.create=Ai;function bo(Ra){const pc=Ra;return Is.objectLiteral(pc)&&Is.uinteger(pc.startLine)&&Is.uinteger(pc.startLine)&&(Is.undefined(pc.startCharacter)||Is.uinteger(pc.startCharacter))&&(Is.undefined(pc.endCharacter)||Is.uinteger(pc.endCharacter))&&(Is.undefined(pc.kind)||Is.string(pc.kind))}vo.is=bo})(FoldingRange||(FoldingRange={}));var DiagnosticRelatedInformation;(function(vo){function Ai(Ra,pc){return{location:Ra,message:pc}}vo.create=Ai;function bo(Ra){let pc=Ra;return Is.defined(pc)&&Location.is(pc.location)&&Is.string(pc.message)}vo.is=bo})(DiagnosticRelatedInformation||(DiagnosticRelatedInformation={}));var DiagnosticSeverity;(function(vo){vo.Error=1,vo.Warning=2,vo.Information=3,vo.Hint=4})(DiagnosticSeverity||(DiagnosticSeverity={}));var DiagnosticTag;(function(vo){vo.Unnecessary=1,vo.Deprecated=2})(DiagnosticTag||(DiagnosticTag={}));var CodeDescription;(function(vo){function Ai(bo){const Ra=bo;return Is.objectLiteral(Ra)&&Is.string(Ra.href)}vo.is=Ai})(CodeDescription||(CodeDescription={}));var Diagnostic;(function(vo){function Ai(Ra,pc,mc,uf,df,ff){let hf={range:Ra,message:pc};return Is.defined(mc)&&(hf.severity=mc),Is.defined(uf)&&(hf.code=uf),Is.defined(df)&&(hf.source=df),Is.defined(ff)&&(hf.relatedInformation=ff),hf}vo.create=Ai;function bo(Ra){var pc;let mc=Ra;return Is.defined(mc)&&Range$1.is(mc.range)&&Is.string(mc.message)&&(Is.number(mc.severity)||Is.undefined(mc.severity))&&(Is.integer(mc.code)||Is.string(mc.code)||Is.undefined(mc.code))&&(Is.undefined(mc.codeDescription)||Is.string((pc=mc.codeDescription)===null||pc===void 0?void 0:pc.href))&&(Is.string(mc.source)||Is.undefined(mc.source))&&(Is.undefined(mc.relatedInformation)||Is.typedArray(mc.relatedInformation,DiagnosticRelatedInformation.is))}vo.is=bo})(Diagnostic||(Diagnostic={}));var Command;(function(vo){function Ai(Ra,pc,...mc){let uf={title:Ra,command:pc};return Is.defined(mc)&&mc.length>0&&(uf.arguments=mc),uf}vo.create=Ai;function bo(Ra){let pc=Ra;return Is.defined(pc)&&Is.string(pc.title)&&Is.string(pc.command)}vo.is=bo})(Command||(Command={}));var TextEdit;(function(vo){function Ai(mc,uf){return{range:mc,newText:uf}}vo.replace=Ai;function bo(mc,uf){return{range:{start:mc,end:mc},newText:uf}}vo.insert=bo;function Ra(mc){return{range:mc,newText:""}}vo.del=Ra;function pc(mc){const uf=mc;return Is.objectLiteral(uf)&&Is.string(uf.newText)&&Range$1.is(uf.range)}vo.is=pc})(TextEdit||(TextEdit={}));var ChangeAnnotation;(function(vo){function Ai(Ra,pc,mc){const uf={label:Ra};return pc!==void 0&&(uf.needsConfirmation=pc),mc!==void 0&&(uf.description=mc),uf}vo.create=Ai;function bo(Ra){const pc=Ra;return Is.objectLiteral(pc)&&Is.string(pc.label)&&(Is.boolean(pc.needsConfirmation)||pc.needsConfirmation===void 0)&&(Is.string(pc.description)||pc.description===void 0)}vo.is=bo})(ChangeAnnotation||(ChangeAnnotation={}));var ChangeAnnotationIdentifier;(function(vo){function Ai(bo){const Ra=bo;return Is.string(Ra)}vo.is=Ai})(ChangeAnnotationIdentifier||(ChangeAnnotationIdentifier={}));var AnnotatedTextEdit;(function(vo){function Ai(mc,uf,df){return{range:mc,newText:uf,annotationId:df}}vo.replace=Ai;function bo(mc,uf,df){return{range:{start:mc,end:mc},newText:uf,annotationId:df}}vo.insert=bo;function Ra(mc,uf){return{range:mc,newText:"",annotationId:uf}}vo.del=Ra;function pc(mc){const uf=mc;return TextEdit.is(uf)&&(ChangeAnnotation.is(uf.annotationId)||ChangeAnnotationIdentifier.is(uf.annotationId))}vo.is=pc})(AnnotatedTextEdit||(AnnotatedTextEdit={}));var TextDocumentEdit;(function(vo){function Ai(Ra,pc){return{textDocument:Ra,edits:pc}}vo.create=Ai;function bo(Ra){let pc=Ra;return Is.defined(pc)&&OptionalVersionedTextDocumentIdentifier.is(pc.textDocument)&&Array.isArray(pc.edits)}vo.is=bo})(TextDocumentEdit||(TextDocumentEdit={}));var CreateFile;(function(vo){function Ai(Ra,pc,mc){let uf={kind:"create",uri:Ra};return pc!==void 0&&(pc.overwrite!==void 0||pc.ignoreIfExists!==void 0)&&(uf.options=pc),mc!==void 0&&(uf.annotationId=mc),uf}vo.create=Ai;function bo(Ra){let pc=Ra;return pc&&pc.kind==="create"&&Is.string(pc.uri)&&(pc.options===void 0||(pc.options.overwrite===void 0||Is.boolean(pc.options.overwrite))&&(pc.options.ignoreIfExists===void 0||Is.boolean(pc.options.ignoreIfExists)))&&(pc.annotationId===void 0||ChangeAnnotationIdentifier.is(pc.annotationId))}vo.is=bo})(CreateFile||(CreateFile={}));var RenameFile;(function(vo){function Ai(Ra,pc,mc,uf){let df={kind:"rename",oldUri:Ra,newUri:pc};return mc!==void 0&&(mc.overwrite!==void 0||mc.ignoreIfExists!==void 0)&&(df.options=mc),uf!==void 0&&(df.annotationId=uf),df}vo.create=Ai;function bo(Ra){let pc=Ra;return pc&&pc.kind==="rename"&&Is.string(pc.oldUri)&&Is.string(pc.newUri)&&(pc.options===void 0||(pc.options.overwrite===void 0||Is.boolean(pc.options.overwrite))&&(pc.options.ignoreIfExists===void 0||Is.boolean(pc.options.ignoreIfExists)))&&(pc.annotationId===void 0||ChangeAnnotationIdentifier.is(pc.annotationId))}vo.is=bo})(RenameFile||(RenameFile={}));var DeleteFile;(function(vo){function Ai(Ra,pc,mc){let uf={kind:"delete",uri:Ra};return pc!==void 0&&(pc.recursive!==void 0||pc.ignoreIfNotExists!==void 0)&&(uf.options=pc),mc!==void 0&&(uf.annotationId=mc),uf}vo.create=Ai;function bo(Ra){let pc=Ra;return pc&&pc.kind==="delete"&&Is.string(pc.uri)&&(pc.options===void 0||(pc.options.recursive===void 0||Is.boolean(pc.options.recursive))&&(pc.options.ignoreIfNotExists===void 0||Is.boolean(pc.options.ignoreIfNotExists)))&&(pc.annotationId===void 0||ChangeAnnotationIdentifier.is(pc.annotationId))}vo.is=bo})(DeleteFile||(DeleteFile={}));var WorkspaceEdit;(function(vo){function Ai(bo){let Ra=bo;return Ra&&(Ra.changes!==void 0||Ra.documentChanges!==void 0)&&(Ra.documentChanges===void 0||Ra.documentChanges.every(pc=>Is.string(pc.kind)?CreateFile.is(pc)||RenameFile.is(pc)||DeleteFile.is(pc):TextDocumentEdit.is(pc)))}vo.is=Ai})(WorkspaceEdit||(WorkspaceEdit={}));var TextDocumentIdentifier;(function(vo){function Ai(Ra){return{uri:Ra}}vo.create=Ai;function bo(Ra){let pc=Ra;return Is.defined(pc)&&Is.string(pc.uri)}vo.is=bo})(TextDocumentIdentifier||(TextDocumentIdentifier={}));var VersionedTextDocumentIdentifier;(function(vo){function Ai(Ra,pc){return{uri:Ra,version:pc}}vo.create=Ai;function bo(Ra){let pc=Ra;return Is.defined(pc)&&Is.string(pc.uri)&&Is.integer(pc.version)}vo.is=bo})(VersionedTextDocumentIdentifier||(VersionedTextDocumentIdentifier={}));var OptionalVersionedTextDocumentIdentifier;(function(vo){function Ai(Ra,pc){return{uri:Ra,version:pc}}vo.create=Ai;function bo(Ra){let pc=Ra;return Is.defined(pc)&&Is.string(pc.uri)&&(pc.version===null||Is.integer(pc.version))}vo.is=bo})(OptionalVersionedTextDocumentIdentifier||(OptionalVersionedTextDocumentIdentifier={}));var TextDocumentItem;(function(vo){function Ai(Ra,pc,mc,uf){return{uri:Ra,languageId:pc,version:mc,text:uf}}vo.create=Ai;function bo(Ra){let pc=Ra;return Is.defined(pc)&&Is.string(pc.uri)&&Is.string(pc.languageId)&&Is.integer(pc.version)&&Is.string(pc.text)}vo.is=bo})(TextDocumentItem||(TextDocumentItem={}));var MarkupKind;(function(vo){vo.PlainText="plaintext",vo.Markdown="markdown";function Ai(bo){const Ra=bo;return Ra===vo.PlainText||Ra===vo.Markdown}vo.is=Ai})(MarkupKind||(MarkupKind={}));var MarkupContent;(function(vo){function Ai(bo){const Ra=bo;return Is.objectLiteral(bo)&&MarkupKind.is(Ra.kind)&&Is.string(Ra.value)}vo.is=Ai})(MarkupContent||(MarkupContent={}));var CompletionItemKind$1;(function(vo){vo.Text=1,vo.Method=2,vo.Function=3,vo.Constructor=4,vo.Field=5,vo.Variable=6,vo.Class=7,vo.Interface=8,vo.Module=9,vo.Property=10,vo.Unit=11,vo.Value=12,vo.Enum=13,vo.Keyword=14,vo.Snippet=15,vo.Color=16,vo.File=17,vo.Reference=18,vo.Folder=19,vo.EnumMember=20,vo.Constant=21,vo.Struct=22,vo.Event=23,vo.Operator=24,vo.TypeParameter=25})(CompletionItemKind$1||(CompletionItemKind$1={}));var InsertTextFormat;(function(vo){vo.PlainText=1,vo.Snippet=2})(InsertTextFormat||(InsertTextFormat={}));var CompletionItemTag;(function(vo){vo.Deprecated=1})(CompletionItemTag||(CompletionItemTag={}));var InsertReplaceEdit;(function(vo){function Ai(Ra,pc,mc){return{newText:Ra,insert:pc,replace:mc}}vo.create=Ai;function bo(Ra){const pc=Ra;return pc&&Is.string(pc.newText)&&Range$1.is(pc.insert)&&Range$1.is(pc.replace)}vo.is=bo})(InsertReplaceEdit||(InsertReplaceEdit={}));var InsertTextMode;(function(vo){vo.asIs=1,vo.adjustIndentation=2})(InsertTextMode||(InsertTextMode={}));var CompletionItemLabelDetails;(function(vo){function Ai(bo){const Ra=bo;return Ra&&(Is.string(Ra.detail)||Ra.detail===void 0)&&(Is.string(Ra.description)||Ra.description===void 0)}vo.is=Ai})(CompletionItemLabelDetails||(CompletionItemLabelDetails={}));var CompletionItem;(function(vo){function Ai(bo){return{label:bo}}vo.create=Ai})(CompletionItem||(CompletionItem={}));var CompletionList;(function(vo){function Ai(bo,Ra){return{items:bo||[],isIncomplete:!!Ra}}vo.create=Ai})(CompletionList||(CompletionList={}));var MarkedString;(function(vo){function Ai(Ra){return Ra.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}vo.fromPlainText=Ai;function bo(Ra){const pc=Ra;return Is.string(pc)||Is.objectLiteral(pc)&&Is.string(pc.language)&&Is.string(pc.value)}vo.is=bo})(MarkedString||(MarkedString={}));var Hover;(function(vo){function Ai(bo){let Ra=bo;return!!Ra&&Is.objectLiteral(Ra)&&(MarkupContent.is(Ra.contents)||MarkedString.is(Ra.contents)||Is.typedArray(Ra.contents,MarkedString.is))&&(bo.range===void 0||Range$1.is(bo.range))}vo.is=Ai})(Hover||(Hover={}));var ParameterInformation;(function(vo){function Ai(bo,Ra){return Ra?{label:bo,documentation:Ra}:{label:bo}}vo.create=Ai})(ParameterInformation||(ParameterInformation={}));var SignatureInformation;(function(vo){function Ai(bo,Ra,...pc){let mc={label:bo};return Is.defined(Ra)&&(mc.documentation=Ra),Is.defined(pc)?mc.parameters=pc:mc.parameters=[],mc}vo.create=Ai})(SignatureInformation||(SignatureInformation={}));var DocumentHighlightKind;(function(vo){vo.Text=1,vo.Read=2,vo.Write=3})(DocumentHighlightKind||(DocumentHighlightKind={}));var DocumentHighlight;(function(vo){function Ai(bo,Ra){let pc={range:bo};return Is.number(Ra)&&(pc.kind=Ra),pc}vo.create=Ai})(DocumentHighlight||(DocumentHighlight={}));var SymbolKind;(function(vo){vo.File=1,vo.Module=2,vo.Namespace=3,vo.Package=4,vo.Class=5,vo.Method=6,vo.Property=7,vo.Field=8,vo.Constructor=9,vo.Enum=10,vo.Interface=11,vo.Function=12,vo.Variable=13,vo.Constant=14,vo.String=15,vo.Number=16,vo.Boolean=17,vo.Array=18,vo.Object=19,vo.Key=20,vo.Null=21,vo.EnumMember=22,vo.Struct=23,vo.Event=24,vo.Operator=25,vo.TypeParameter=26})(SymbolKind||(SymbolKind={}));var SymbolTag;(function(vo){vo.Deprecated=1})(SymbolTag||(SymbolTag={}));var SymbolInformation;(function(vo){function Ai(bo,Ra,pc,mc,uf){let df={name:bo,kind:Ra,location:{uri:mc,range:pc}};return uf&&(df.containerName=uf),df}vo.create=Ai})(SymbolInformation||(SymbolInformation={}));var WorkspaceSymbol;(function(vo){function Ai(bo,Ra,pc,mc){return mc!==void 0?{name:bo,kind:Ra,location:{uri:pc,range:mc}}:{name:bo,kind:Ra,location:{uri:pc}}}vo.create=Ai})(WorkspaceSymbol||(WorkspaceSymbol={}));var DocumentSymbol;(function(vo){function Ai(Ra,pc,mc,uf,df,ff){let hf={name:Ra,detail:pc,kind:mc,range:uf,selectionRange:df};return ff!==void 0&&(hf.children=ff),hf}vo.create=Ai;function bo(Ra){let pc=Ra;return pc&&Is.string(pc.name)&&Is.number(pc.kind)&&Range$1.is(pc.range)&&Range$1.is(pc.selectionRange)&&(pc.detail===void 0||Is.string(pc.detail))&&(pc.deprecated===void 0||Is.boolean(pc.deprecated))&&(pc.children===void 0||Array.isArray(pc.children))&&(pc.tags===void 0||Array.isArray(pc.tags))}vo.is=bo})(DocumentSymbol||(DocumentSymbol={}));var CodeActionKind;(function(vo){vo.Empty="",vo.QuickFix="quickfix",vo.Refactor="refactor",vo.RefactorExtract="refactor.extract",vo.RefactorInline="refactor.inline",vo.RefactorRewrite="refactor.rewrite",vo.Source="source",vo.SourceOrganizeImports="source.organizeImports",vo.SourceFixAll="source.fixAll"})(CodeActionKind||(CodeActionKind={}));var CodeActionTriggerKind;(function(vo){vo.Invoked=1,vo.Automatic=2})(CodeActionTriggerKind||(CodeActionTriggerKind={}));var CodeActionContext;(function(vo){function Ai(Ra,pc,mc){let uf={diagnostics:Ra};return pc!=null&&(uf.only=pc),mc!=null&&(uf.triggerKind=mc),uf}vo.create=Ai;function bo(Ra){let pc=Ra;return Is.defined(pc)&&Is.typedArray(pc.diagnostics,Diagnostic.is)&&(pc.only===void 0||Is.typedArray(pc.only,Is.string))&&(pc.triggerKind===void 0||pc.triggerKind===CodeActionTriggerKind.Invoked||pc.triggerKind===CodeActionTriggerKind.Automatic)}vo.is=bo})(CodeActionContext||(CodeActionContext={}));var CodeAction;(function(vo){function Ai(Ra,pc,mc){let uf={title:Ra},df=!0;return typeof pc=="string"?(df=!1,uf.kind=pc):Command.is(pc)?uf.command=pc:uf.edit=pc,df&&mc!==void 0&&(uf.kind=mc),uf}vo.create=Ai;function bo(Ra){let pc=Ra;return pc&&Is.string(pc.title)&&(pc.diagnostics===void 0||Is.typedArray(pc.diagnostics,Diagnostic.is))&&(pc.kind===void 0||Is.string(pc.kind))&&(pc.edit!==void 0||pc.command!==void 0)&&(pc.command===void 0||Command.is(pc.command))&&(pc.isPreferred===void 0||Is.boolean(pc.isPreferred))&&(pc.edit===void 0||WorkspaceEdit.is(pc.edit))}vo.is=bo})(CodeAction||(CodeAction={}));var CodeLens;(function(vo){function Ai(Ra,pc){let mc={range:Ra};return Is.defined(pc)&&(mc.data=pc),mc}vo.create=Ai;function bo(Ra){let pc=Ra;return Is.defined(pc)&&Range$1.is(pc.range)&&(Is.undefined(pc.command)||Command.is(pc.command))}vo.is=bo})(CodeLens||(CodeLens={}));var FormattingOptions;(function(vo){function Ai(Ra,pc){return{tabSize:Ra,insertSpaces:pc}}vo.create=Ai;function bo(Ra){let pc=Ra;return Is.defined(pc)&&Is.uinteger(pc.tabSize)&&Is.boolean(pc.insertSpaces)}vo.is=bo})(FormattingOptions||(FormattingOptions={}));var DocumentLink;(function(vo){function Ai(Ra,pc,mc){return{range:Ra,target:pc,data:mc}}vo.create=Ai;function bo(Ra){let pc=Ra;return Is.defined(pc)&&Range$1.is(pc.range)&&(Is.undefined(pc.target)||Is.string(pc.target))}vo.is=bo})(DocumentLink||(DocumentLink={}));var SelectionRange;(function(vo){function Ai(Ra,pc){return{range:Ra,parent:pc}}vo.create=Ai;function bo(Ra){let pc=Ra;return Is.objectLiteral(pc)&&Range$1.is(pc.range)&&(pc.parent===void 0||vo.is(pc.parent))}vo.is=bo})(SelectionRange||(SelectionRange={}));var SemanticTokenTypes;(function(vo){vo.namespace="namespace",vo.type="type",vo.class="class",vo.enum="enum",vo.interface="interface",vo.struct="struct",vo.typeParameter="typeParameter",vo.parameter="parameter",vo.variable="variable",vo.property="property",vo.enumMember="enumMember",vo.event="event",vo.function="function",vo.method="method",vo.macro="macro",vo.keyword="keyword",vo.modifier="modifier",vo.comment="comment",vo.string="string",vo.number="number",vo.regexp="regexp",vo.operator="operator",vo.decorator="decorator"})(SemanticTokenTypes||(SemanticTokenTypes={}));var SemanticTokenModifiers;(function(vo){vo.declaration="declaration",vo.definition="definition",vo.readonly="readonly",vo.static="static",vo.deprecated="deprecated",vo.abstract="abstract",vo.async="async",vo.modification="modification",vo.documentation="documentation",vo.defaultLibrary="defaultLibrary"})(SemanticTokenModifiers||(SemanticTokenModifiers={}));var SemanticTokens;(function(vo){function Ai(bo){const Ra=bo;return Is.objectLiteral(Ra)&&(Ra.resultId===void 0||typeof Ra.resultId=="string")&&Array.isArray(Ra.data)&&(Ra.data.length===0||typeof Ra.data[0]=="number")}vo.is=Ai})(SemanticTokens||(SemanticTokens={}));var InlineValueText;(function(vo){function Ai(Ra,pc){return{range:Ra,text:pc}}vo.create=Ai;function bo(Ra){const pc=Ra;return pc!=null&&Range$1.is(pc.range)&&Is.string(pc.text)}vo.is=bo})(InlineValueText||(InlineValueText={}));var InlineValueVariableLookup;(function(vo){function Ai(Ra,pc,mc){return{range:Ra,variableName:pc,caseSensitiveLookup:mc}}vo.create=Ai;function bo(Ra){const pc=Ra;return pc!=null&&Range$1.is(pc.range)&&Is.boolean(pc.caseSensitiveLookup)&&(Is.string(pc.variableName)||pc.variableName===void 0)}vo.is=bo})(InlineValueVariableLookup||(InlineValueVariableLookup={}));var InlineValueEvaluatableExpression;(function(vo){function Ai(Ra,pc){return{range:Ra,expression:pc}}vo.create=Ai;function bo(Ra){const pc=Ra;return pc!=null&&Range$1.is(pc.range)&&(Is.string(pc.expression)||pc.expression===void 0)}vo.is=bo})(InlineValueEvaluatableExpression||(InlineValueEvaluatableExpression={}));var InlineValueContext;(function(vo){function Ai(Ra,pc){return{frameId:Ra,stoppedLocation:pc}}vo.create=Ai;function bo(Ra){const pc=Ra;return Is.defined(pc)&&Range$1.is(Ra.stoppedLocation)}vo.is=bo})(InlineValueContext||(InlineValueContext={}));var InlayHintKind;(function(vo){vo.Type=1,vo.Parameter=2;function Ai(bo){return bo===1||bo===2}vo.is=Ai})(InlayHintKind||(InlayHintKind={}));var InlayHintLabelPart;(function(vo){function Ai(Ra){return{value:Ra}}vo.create=Ai;function bo(Ra){const pc=Ra;return Is.objectLiteral(pc)&&(pc.tooltip===void 0||Is.string(pc.tooltip)||MarkupContent.is(pc.tooltip))&&(pc.location===void 0||Location.is(pc.location))&&(pc.command===void 0||Command.is(pc.command))}vo.is=bo})(InlayHintLabelPart||(InlayHintLabelPart={}));var InlayHint;(function(vo){function Ai(Ra,pc,mc){const uf={position:Ra,label:pc};return mc!==void 0&&(uf.kind=mc),uf}vo.create=Ai;function bo(Ra){const pc=Ra;return Is.objectLiteral(pc)&&Position$2.is(pc.position)&&(Is.string(pc.label)||Is.typedArray(pc.label,InlayHintLabelPart.is))&&(pc.kind===void 0||InlayHintKind.is(pc.kind))&&pc.textEdits===void 0||Is.typedArray(pc.textEdits,TextEdit.is)&&(pc.tooltip===void 0||Is.string(pc.tooltip)||MarkupContent.is(pc.tooltip))&&(pc.paddingLeft===void 0||Is.boolean(pc.paddingLeft))&&(pc.paddingRight===void 0||Is.boolean(pc.paddingRight))}vo.is=bo})(InlayHint||(InlayHint={}));var StringValue;(function(vo){function Ai(bo){return{kind:"snippet",value:bo}}vo.createSnippet=Ai})(StringValue||(StringValue={}));var InlineCompletionItem;(function(vo){function Ai(bo,Ra,pc,mc){return{insertText:bo,filterText:Ra,range:pc,command:mc}}vo.create=Ai})(InlineCompletionItem||(InlineCompletionItem={}));var InlineCompletionList;(function(vo){function Ai(bo){return{items:bo}}vo.create=Ai})(InlineCompletionList||(InlineCompletionList={}));var InlineCompletionTriggerKind;(function(vo){vo.Invoked=0,vo.Automatic=1})(InlineCompletionTriggerKind||(InlineCompletionTriggerKind={}));var SelectedCompletionInfo;(function(vo){function Ai(bo,Ra){return{range:bo,text:Ra}}vo.create=Ai})(SelectedCompletionInfo||(SelectedCompletionInfo={}));var InlineCompletionContext;(function(vo){function Ai(bo,Ra){return{triggerKind:bo,selectedCompletionInfo:Ra}}vo.create=Ai})(InlineCompletionContext||(InlineCompletionContext={}));var WorkspaceFolder;(function(vo){function Ai(bo){const Ra=bo;return Is.objectLiteral(Ra)&&URI.is(Ra.uri)&&Is.string(Ra.name)}vo.is=Ai})(WorkspaceFolder||(WorkspaceFolder={}));var TextDocument;(function(vo){function Ai(mc,uf,df,ff){return new FullTextDocument(mc,uf,df,ff)}vo.create=Ai;function bo(mc){let uf=mc;return!!(Is.defined(uf)&&Is.string(uf.uri)&&(Is.undefined(uf.languageId)||Is.string(uf.languageId))&&Is.uinteger(uf.lineCount)&&Is.func(uf.getText)&&Is.func(uf.positionAt)&&Is.func(uf.offsetAt))}vo.is=bo;function Ra(mc,uf){let df=mc.getText(),ff=pc(uf,(pf,mf)=>{let gf=pf.range.start.line-mf.range.start.line;return gf===0?pf.range.start.character-mf.range.start.character:gf}),hf=df.length;for(let pf=ff.length-1;pf>=0;pf--){let mf=ff[pf],gf=mc.offsetAt(mf.range.start),yf=mc.offsetAt(mf.range.end);if(yf<=hf)df=df.substring(0,gf)+mf.newText+df.substring(yf,df.length);else throw new Error("Overlapping edit");hf=gf}return df}vo.applyEdits=Ra;function pc(mc,uf){if(mc.length<=1)return mc;const df=mc.length/2|0,ff=mc.slice(0,df),hf=mc.slice(df);pc(ff,uf),pc(hf,uf);let pf=0,mf=0,gf=0;for(;pf<ff.length&&mf<hf.length;)uf(ff[pf],hf[mf])<=0?mc[gf++]=ff[pf++]:mc[gf++]=hf[mf++];for(;pf<ff.length;)mc[gf++]=ff[pf++];for(;mf<hf.length;)mc[gf++]=hf[mf++];return mc}})(TextDocument||(TextDocument={}));class FullTextDocument{constructor(Ai,bo,Ra,pc){this._uri=Ai,this._languageId=bo,this._version=Ra,this._content=pc,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(Ai){if(Ai){let bo=this.offsetAt(Ai.start),Ra=this.offsetAt(Ai.end);return this._content.substring(bo,Ra)}return this._content}update(Ai,bo){this._content=Ai.text,this._version=bo,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let Ai=[],bo=this._content,Ra=!0;for(let pc=0;pc<bo.length;pc++){Ra&&(Ai.push(pc),Ra=!1);let mc=bo.charAt(pc);Ra=mc==="\r"||mc===`
|
|
360
|
-
`,mc==="\r"&&pc+1<bo.length&&bo.charAt(pc+1)===`
|
|
361
|
-
`&&pc++}Ra&&bo.length>0&&Ai.push(bo.length),this._lineOffsets=Ai}return this._lineOffsets}positionAt(Ai){Ai=Math.max(Math.min(Ai,this._content.length),0);let bo=this.getLineOffsets(),Ra=0,pc=bo.length;if(pc===0)return Position$2.create(0,Ai);for(;Ra<pc;){let uf=Math.floor((Ra+pc)/2);bo[uf]>Ai?pc=uf:Ra=uf+1}let mc=Ra-1;return Position$2.create(mc,Ai-bo[mc])}offsetAt(Ai){let bo=this.getLineOffsets();if(Ai.line>=bo.length)return this._content.length;if(Ai.line<0)return 0;let Ra=bo[Ai.line],pc=Ai.line+1<bo.length?bo[Ai.line+1]:this._content.length;return Math.max(Math.min(Ra+Ai.character,pc),Ra)}get lineCount(){return this.getLineOffsets().length}}var Is;(function(vo){const Ai=Object.prototype.toString;function bo(yf){return typeof yf<"u"}vo.defined=bo;function Ra(yf){return typeof yf>"u"}vo.undefined=Ra;function pc(yf){return yf===!0||yf===!1}vo.boolean=pc;function mc(yf){return Ai.call(yf)==="[object String]"}vo.string=mc;function uf(yf){return Ai.call(yf)==="[object Number]"}vo.number=uf;function df(yf,vf,bf){return Ai.call(yf)==="[object Number]"&&vf<=yf&&yf<=bf}vo.numberRange=df;function ff(yf){return Ai.call(yf)==="[object Number]"&&-2147483648<=yf&&yf<=2147483647}vo.integer=ff;function hf(yf){return Ai.call(yf)==="[object Number]"&&0<=yf&&yf<=2147483647}vo.uinteger=hf;function pf(yf){return Ai.call(yf)==="[object Function]"}vo.func=pf;function mf(yf){return yf!==null&&typeof yf=="object"}vo.objectLiteral=mf;function gf(yf,vf){return Array.isArray(yf)&&yf.every(vf)}vo.typedArray=gf})(Is||(Is={}));class CharacterStream{constructor(Ai){this._start=0,this._pos=0,this.getStartOfToken=()=>this._start,this.getCurrentPosition=()=>this._pos,this.eol=()=>this._sourceText.length===this._pos,this.sol=()=>this._pos===0,this.peek=()=>this._sourceText.charAt(this._pos)||null,this.next=()=>{const bo=this._sourceText.charAt(this._pos);return this._pos++,bo},this.eat=bo=>{if(this._testNextCharacter(bo))return this._start=this._pos,this._pos++,this._sourceText.charAt(this._pos-1)},this.eatWhile=bo=>{let Ra=this._testNextCharacter(bo),pc=!1;for(Ra&&(pc=Ra,this._start=this._pos);Ra;)this._pos++,Ra=this._testNextCharacter(bo),pc=!0;return pc},this.eatSpace=()=>this.eatWhile(/[\s\u00a0]/),this.skipToEnd=()=>{this._pos=this._sourceText.length},this.skipTo=bo=>{this._pos=bo},this.match=(bo,Ra=!0,pc=!1)=>{let mc=null,uf=null;return typeof bo=="string"?(uf=new RegExp(bo,pc?"i":"g").test(this._sourceText.slice(this._pos,this._pos+bo.length)),mc=bo):bo instanceof RegExp&&(uf=this._sourceText.slice(this._pos).match(bo),mc=uf==null?void 0:uf[0]),uf!=null&&(typeof bo=="string"||uf instanceof Array&&this._sourceText.startsWith(uf[0],this._pos))?(Ra&&(this._start=this._pos,mc&&mc.length&&(this._pos+=mc.length)),uf):!1},this.backUp=bo=>{this._pos-=bo},this.column=()=>this._pos,this.indentation=()=>{const bo=this._sourceText.match(/\s*/);let Ra=0;if(bo&&bo.length!==0){const pc=bo[0];let mc=0;for(;pc.length>mc;)pc.charCodeAt(mc)===9?Ra+=2:Ra++,mc++}return Ra},this.current=()=>this._sourceText.slice(this._start,this._pos),this._sourceText=Ai}_testNextCharacter(Ai){const bo=this._sourceText.charAt(this._pos);let Ra=!1;return typeof Ai=="string"?Ra=bo===Ai:Ra=Ai instanceof RegExp?Ai.test(bo):Ai(bo),Ra}}function opt(vo){return{ofRule:vo}}function list(vo,Ai){return{ofRule:vo,isList:!0,separator:Ai}}function butNot(vo,Ai){const bo=vo.match;return vo.match=Ra=>{let pc=!1;return bo&&(pc=bo(Ra)),pc&&Ai.every(mc=>mc.match&&!mc.match(Ra))},vo}function t(vo,Ai){return{style:Ai,match:bo=>bo.kind===vo}}function p$3(vo,Ai){return{style:Ai||"punctuation",match:bo=>bo.kind==="Punctuation"&&bo.value===vo}}const isIgnored=vo=>vo===" "||vo===" "||vo===","||vo===`
|
|
362
|
-
`||vo==="\r"||vo==="\uFEFF"||vo===" ",LexRules={Name:/^[_A-Za-z][_0-9A-Za-z]*/,Punctuation:/^(?:!|\$|\(|\)|\.\.\.|:|=|&|@|\[|]|\{|\||\})/,Number:/^-?(?:0|(?:[1-9][0-9]*))(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/,String:/^(?:"""(?:\\"""|[^"]|"[^"]|""[^"])*(?:""")?|"(?:[^"\\]|\\(?:"|\/|\\|b|f|n|r|t|u[0-9a-fA-F]{4}))*"?)/,Comment:/^#.*/},ParseRules={Document:[list("Definition")],Definition(vo){switch(vo.value){case"{":return"ShortQuery";case"query":return"Query";case"mutation":return"Mutation";case"subscription":return"Subscription";case"fragment":return Kind.FRAGMENT_DEFINITION;case"schema":return"SchemaDef";case"scalar":return"ScalarDef";case"type":return"ObjectTypeDef";case"interface":return"InterfaceDef";case"union":return"UnionDef";case"enum":return"EnumDef";case"input":return"InputDef";case"extend":return"ExtendDef";case"directive":return"DirectiveDef"}},ShortQuery:["SelectionSet"],Query:[word("query"),opt(name("def")),opt("VariableDefinitions"),list("Directive"),"SelectionSet"],Mutation:[word("mutation"),opt(name("def")),opt("VariableDefinitions"),list("Directive"),"SelectionSet"],Subscription:[word("subscription"),opt(name("def")),opt("VariableDefinitions"),list("Directive"),"SelectionSet"],VariableDefinitions:[p$3("("),list("VariableDefinition"),p$3(")")],VariableDefinition:["Variable",p$3(":"),"Type",opt("DefaultValue")],Variable:[p$3("$","variable"),name("variable")],DefaultValue:[p$3("="),"Value"],SelectionSet:[p$3("{"),list("Selection"),p$3("}")],Selection(vo,Ai){return vo.value==="..."?Ai.match(/[\s\u00a0,]*(on\b|@|{)/,!1)?"InlineFragment":"FragmentSpread":Ai.match(/[\s\u00a0,]*:/,!1)?"AliasedField":"Field"},AliasedField:[name("property"),p$3(":"),name("qualifier"),opt("Arguments"),list("Directive"),opt("SelectionSet")],Field:[name("property"),opt("Arguments"),list("Directive"),opt("SelectionSet")],Arguments:[p$3("("),list("Argument"),p$3(")")],Argument:[name("attribute"),p$3(":"),"Value"],FragmentSpread:[p$3("..."),name("def"),list("Directive")],InlineFragment:[p$3("..."),opt("TypeCondition"),list("Directive"),"SelectionSet"],FragmentDefinition:[word("fragment"),opt(butNot(name("def"),[word("on")])),"TypeCondition",list("Directive"),"SelectionSet"],TypeCondition:[word("on"),"NamedType"],Value(vo){switch(vo.kind){case"Number":return"NumberValue";case"String":return"StringValue";case"Punctuation":switch(vo.value){case"[":return"ListValue";case"{":return"ObjectValue";case"$":return"Variable";case"&":return"NamedType"}return null;case"Name":switch(vo.value){case"true":case"false":return"BooleanValue"}return vo.value==="null"?"NullValue":"EnumValue"}},NumberValue:[t("Number","number")],StringValue:[{style:"string",match:vo=>vo.kind==="String",update(vo,Ai){Ai.value.startsWith('"""')&&(vo.inBlockstring=!Ai.value.slice(3).endsWith('"""'))}}],BooleanValue:[t("Name","builtin")],NullValue:[t("Name","keyword")],EnumValue:[name("string-2")],ListValue:[p$3("["),list("Value"),p$3("]")],ObjectValue:[p$3("{"),list("ObjectField"),p$3("}")],ObjectField:[name("attribute"),p$3(":"),"Value"],Type(vo){return vo.value==="["?"ListType":"NonNullType"},ListType:[p$3("["),"Type",p$3("]"),opt(p$3("!"))],NonNullType:["NamedType",opt(p$3("!"))],NamedType:[type("atom")],Directive:[p$3("@","meta"),name("meta"),opt("Arguments")],DirectiveDef:[word("directive"),p$3("@","meta"),name("meta"),opt("ArgumentsDef"),word("on"),list("DirectiveLocation",p$3("|"))],InterfaceDef:[word("interface"),name("atom"),opt("Implements"),list("Directive"),p$3("{"),list("FieldDef"),p$3("}")],Implements:[word("implements"),list("NamedType",p$3("&"))],DirectiveLocation:[name("string-2")],SchemaDef:[word("schema"),list("Directive"),p$3("{"),list("OperationTypeDef"),p$3("}")],OperationTypeDef:[name("keyword"),p$3(":"),name("atom")],ScalarDef:[word("scalar"),name("atom"),list("Directive")],ObjectTypeDef:[word("type"),name("atom"),opt("Implements"),list("Directive"),p$3("{"),list("FieldDef"),p$3("}")],FieldDef:[name("property"),opt("ArgumentsDef"),p$3(":"),"Type",list("Directive")],ArgumentsDef:[p$3("("),list("InputValueDef"),p$3(")")],InputValueDef:[name("attribute"),p$3(":"),"Type",opt("DefaultValue"),list("Directive")],UnionDef:[word("union"),name("atom"),list("Directive"),p$3("="),list("UnionMember",p$3("|"))],UnionMember:["NamedType"],EnumDef:[word("enum"),name("atom"),list("Directive"),p$3("{"),list("EnumValueDef"),p$3("}")],EnumValueDef:[name("string-2"),list("Directive")],InputDef:[word("input"),name("atom"),list("Directive"),p$3("{"),list("InputValueDef"),p$3("}")],ExtendDef:[word("extend"),"ExtensionDefinition"],ExtensionDefinition(vo){switch(vo.value){case"schema":return Kind.SCHEMA_EXTENSION;case"scalar":return Kind.SCALAR_TYPE_EXTENSION;case"type":return Kind.OBJECT_TYPE_EXTENSION;case"interface":return Kind.INTERFACE_TYPE_EXTENSION;case"union":return Kind.UNION_TYPE_EXTENSION;case"enum":return Kind.ENUM_TYPE_EXTENSION;case"input":return Kind.INPUT_OBJECT_TYPE_EXTENSION}},[Kind.SCHEMA_EXTENSION]:["SchemaDef"],[Kind.SCALAR_TYPE_EXTENSION]:["ScalarDef"],[Kind.OBJECT_TYPE_EXTENSION]:["ObjectTypeDef"],[Kind.INTERFACE_TYPE_EXTENSION]:["InterfaceDef"],[Kind.UNION_TYPE_EXTENSION]:["UnionDef"],[Kind.ENUM_TYPE_EXTENSION]:["EnumDef"],[Kind.INPUT_OBJECT_TYPE_EXTENSION]:["InputDef"]};function word(vo){return{style:"keyword",match:Ai=>Ai.kind==="Name"&&Ai.value===vo}}function name(vo){return{style:vo,match:Ai=>Ai.kind==="Name",update(Ai,bo){Ai.name=bo.value}}}function type(vo){return{style:vo,match:Ai=>Ai.kind==="Name",update(Ai,bo){var Ra;!((Ra=Ai.prevState)===null||Ra===void 0)&&Ra.prevState&&(Ai.name=bo.value,Ai.prevState.prevState.type=bo.value)}}}function onlineParser(vo={eatWhitespace:Ai=>Ai.eatWhile(isIgnored),lexRules:LexRules,parseRules:ParseRules,editorConfig:{}}){return{startState(){const Ai={level:0,step:0,name:null,kind:null,type:null,rule:null,needsSeparator:!1,prevState:null};return pushRule(vo.parseRules,Ai,Kind.DOCUMENT),Ai},token(Ai,bo){return getToken(Ai,bo,vo)}}}function getToken(vo,Ai,bo){var Ra;if(Ai.inBlockstring)return vo.match(/.*"""/)?(Ai.inBlockstring=!1,"string"):(vo.skipToEnd(),"string");const{lexRules:pc,parseRules:mc,eatWhitespace:uf,editorConfig:df}=bo;if(Ai.rule&&Ai.rule.length===0?popRule(Ai):Ai.needsAdvance&&(Ai.needsAdvance=!1,advanceRule(Ai,!0)),vo.sol()){const pf=(df==null?void 0:df.tabSize)||2;Ai.indentLevel=Math.floor(vo.indentation()/pf)}if(uf(vo))return"ws";const ff=lex(pc,vo);if(!ff)return vo.match(/\S+/)||vo.match(/\s/),pushRule(SpecialParseRules,Ai,"Invalid"),"invalidchar";if(ff.kind==="Comment")return pushRule(SpecialParseRules,Ai,"Comment"),"comment";const hf=assign({},Ai);if(ff.kind==="Punctuation"){if(/^[{([]/.test(ff.value))Ai.indentLevel!==void 0&&(Ai.levels=(Ai.levels||[]).concat(Ai.indentLevel+1));else if(/^[})\]]/.test(ff.value)){const pf=Ai.levels=(Ai.levels||[]).slice(0,-1);Ai.indentLevel&&pf.length>0&&pf.at(-1)<Ai.indentLevel&&(Ai.indentLevel=pf.at(-1))}}for(;Ai.rule;){let pf=typeof Ai.rule=="function"?Ai.step===0?Ai.rule(ff,vo):null:Ai.rule[Ai.step];if(Ai.needsSeparator&&(pf=pf==null?void 0:pf.separator),pf){if(pf.ofRule&&(pf=pf.ofRule),typeof pf=="string"){pushRule(mc,Ai,pf);continue}if(!((Ra=pf.match)===null||Ra===void 0)&&Ra.call(pf,ff))return pf.update&&pf.update(Ai,ff),ff.kind==="Punctuation"?advanceRule(Ai,!0):Ai.needsAdvance=!0,pf.style}unsuccessful(Ai)}return assign(Ai,hf),pushRule(SpecialParseRules,Ai,"Invalid"),"invalidchar"}function assign(vo,Ai){const bo=Object.keys(Ai);for(let Ra=0;Ra<bo.length;Ra++)vo[bo[Ra]]=Ai[bo[Ra]];return vo}const SpecialParseRules={Invalid:[],Comment:[]};function pushRule(vo,Ai,bo){if(!vo[bo])throw new TypeError("Unknown rule: "+bo);Ai.prevState=Object.assign({},Ai),Ai.kind=bo,Ai.name=null,Ai.type=null,Ai.rule=vo[bo],Ai.step=0,Ai.needsSeparator=!1}function popRule(vo){vo.prevState&&(vo.kind=vo.prevState.kind,vo.name=vo.prevState.name,vo.type=vo.prevState.type,vo.rule=vo.prevState.rule,vo.step=vo.prevState.step,vo.needsSeparator=vo.prevState.needsSeparator,vo.prevState=vo.prevState.prevState)}function advanceRule(vo,Ai){var bo;if(isList(vo)&&vo.rule){const Ra=vo.rule[vo.step];if(Ra.separator){const{separator:pc}=Ra;if(vo.needsSeparator=!vo.needsSeparator,!vo.needsSeparator&&pc.ofRule)return}if(Ai)return}for(vo.needsSeparator=!1,vo.step++;vo.rule&&!(Array.isArray(vo.rule)&&vo.step<vo.rule.length);)popRule(vo),vo.rule&&(isList(vo)?!((bo=vo.rule)===null||bo===void 0)&&bo[vo.step].separator&&(vo.needsSeparator=!vo.needsSeparator):(vo.needsSeparator=!1,vo.step++))}function isList(vo){const Ai=Array.isArray(vo.rule)&&typeof vo.rule[vo.step]!="string"&&vo.rule[vo.step];return Ai&&Ai.isList}function unsuccessful(vo){for(;vo.rule&&!(Array.isArray(vo.rule)&&vo.rule[vo.step].ofRule);)popRule(vo);vo.rule&&advanceRule(vo,!1)}function lex(vo,Ai){const bo=Object.keys(vo);for(let Ra=0;Ra<bo.length;Ra++){const pc=Ai.match(vo[bo[Ra]]);if(pc&&pc instanceof Array)return{kind:bo[Ra],value:pc[0]}}}function runOnlineParser(vo,Ai){const bo=vo.split(`
|
|
363
|
-
`),Ra=onlineParser();let pc=Ra.startState(),mc="",uf=new CharacterStream("");for(let df=0;df<bo.length;df++){for(uf=new CharacterStream(bo[df]);!uf.eol()&&(mc=Ra.token(uf,pc),Ai(uf,pc,mc,df)!=="BREAK"););Ai(uf,pc,mc,df),pc.kind||(pc=Ra.startState())}return{start:uf.getStartOfToken(),end:uf.getCurrentPosition(),string:uf.current(),state:pc,style:mc}}var GraphQLDocumentMode;(function(vo){vo.TYPE_SYSTEM="TYPE_SYSTEM",vo.EXECUTABLE="EXECUTABLE",vo.UNKNOWN="UNKNOWN"})(GraphQLDocumentMode||(GraphQLDocumentMode={}));const TYPE_SYSTEM_KINDS=[Kind.SCHEMA_DEFINITION,Kind.OPERATION_TYPE_DEFINITION,Kind.SCALAR_TYPE_DEFINITION,Kind.OBJECT_TYPE_DEFINITION,Kind.INTERFACE_TYPE_DEFINITION,Kind.UNION_TYPE_DEFINITION,Kind.ENUM_TYPE_DEFINITION,Kind.INPUT_OBJECT_TYPE_DEFINITION,Kind.DIRECTIVE_DEFINITION,Kind.SCHEMA_EXTENSION,Kind.SCALAR_TYPE_EXTENSION,Kind.OBJECT_TYPE_EXTENSION,Kind.INTERFACE_TYPE_EXTENSION,Kind.UNION_TYPE_EXTENSION,Kind.ENUM_TYPE_EXTENSION,Kind.INPUT_OBJECT_TYPE_EXTENSION],getParsedMode=vo=>{let Ai=GraphQLDocumentMode.UNKNOWN;if(vo)try{visit(parse(vo),{enter(bo){if(bo.kind==="Document"){Ai=GraphQLDocumentMode.EXECUTABLE;return}return TYPE_SYSTEM_KINDS.includes(bo.kind)?(Ai=GraphQLDocumentMode.TYPE_SYSTEM,BREAK):!1}})}catch{return Ai}return Ai};function getDocumentMode(vo,Ai){return Ai!=null&&Ai.endsWith(".graphqls")?GraphQLDocumentMode.TYPE_SYSTEM:getParsedMode(vo)}function getTokenAtPosition(vo,Ai,bo=0){let Ra=null,pc=null,mc=null;const uf=runOnlineParser(vo,(df,ff,hf,pf)=>{if(!(pf!==Ai.line||df.getCurrentPosition()+bo<Ai.character+1))return Ra=hf,pc=Object.assign({},ff),mc=df.current(),"BREAK"});return{start:uf.start,end:uf.end,string:mc||uf.string,state:pc||uf.state,style:Ra||uf.style}}function getContextAtPosition(vo,Ai,bo,Ra,pc){const mc=getTokenAtPosition(vo,Ai,1);if(!mc)return null;const uf=mc.state.kind==="Invalid"?mc.state.prevState:mc.state;if(!uf)return null;const df=getTypeInfo(bo,mc.state),ff=(pc==null?void 0:pc.mode)||getDocumentMode(vo,pc==null?void 0:pc.uri);return{token:mc,state:uf,typeInfo:df,mode:ff}}function getFieldDef(vo,Ai,bo){return bo===SchemaMetaFieldDef.name&&vo.getQueryType()===Ai?SchemaMetaFieldDef:bo===TypeMetaFieldDef.name&&vo.getQueryType()===Ai?TypeMetaFieldDef:bo===TypeNameMetaFieldDef.name&&isCompositeType(Ai)?TypeNameMetaFieldDef:"getFields"in Ai?Ai.getFields()[bo]:null}function forEachState(vo,Ai){const bo=[];let Ra=vo;for(;Ra!=null&&Ra.kind;)bo.push(Ra),Ra=Ra.prevState;for(let pc=bo.length-1;pc>=0;pc--)Ai(bo[pc])}function getDefinitionState(vo){let Ai;return forEachState(vo,bo=>{switch(bo.kind){case"Query":case"ShortQuery":case"Mutation":case"Subscription":case"FragmentDefinition":Ai=bo;break}}),Ai}function getTypeInfo(vo,Ai){let bo,Ra,pc,mc,uf,df,ff,hf,pf,mf,gf;return forEachState(Ai,yf=>{var vf;switch(yf.kind){case RuleKinds.QUERY:case"ShortQuery":mf=vo.getQueryType();break;case RuleKinds.MUTATION:mf=vo.getMutationType();break;case RuleKinds.SUBSCRIPTION:mf=vo.getSubscriptionType();break;case RuleKinds.INLINE_FRAGMENT:case RuleKinds.FRAGMENT_DEFINITION:yf.type&&(mf=vo.getType(yf.type));break;case RuleKinds.FIELD:case RuleKinds.ALIASED_FIELD:{!mf||!yf.name?uf=null:(uf=pf?getFieldDef(vo,pf,yf.name):null,mf=uf?uf.type:null);break}case RuleKinds.SELECTION_SET:pf=getNamedType(mf);break;case RuleKinds.DIRECTIVE:pc=yf.name?vo.getDirective(yf.name):null;break;case RuleKinds.INTERFACE_DEF:yf.name&&(ff=null,gf=new GraphQLInterfaceType({name:yf.name,interfaces:[],fields:{}}));break;case RuleKinds.OBJECT_TYPE_DEF:yf.name&&(gf=null,ff=new GraphQLObjectType({name:yf.name,interfaces:[],fields:{}}));break;case RuleKinds.ARGUMENTS:{if(yf.prevState)switch(yf.prevState.kind){case RuleKinds.FIELD:Ra=uf&&uf.args;break;case RuleKinds.DIRECTIVE:Ra=pc&&pc.args;break;case RuleKinds.ALIASED_FIELD:{const If=(vf=yf.prevState)===null||vf===void 0?void 0:vf.name;if(!If){Ra=null;break}const l1=pf?getFieldDef(vo,pf,If):null;if(!l1){Ra=null;break}Ra=l1.args;break}default:Ra=null;break}else Ra=null;break}case RuleKinds.ARGUMENT:if(Ra){for(let If=0;If<Ra.length;If++)if(Ra[If].name===yf.name){bo=Ra[If];break}}df=bo==null?void 0:bo.type;break;case RuleKinds.VARIABLE_DEFINITION:case RuleKinds.VARIABLE:mf=df;break;case RuleKinds.ENUM_VALUE:const bf=getNamedType(df);mc=bf instanceof GraphQLEnumType?bf.getValues().find(If=>If.value===yf.name):null;break;case RuleKinds.LIST_VALUE:const Sf=getNullableType(df);df=Sf instanceof GraphQLList?Sf.ofType:null;break;case RuleKinds.OBJECT_VALUE:const xf=getNamedType(df);hf=xf instanceof GraphQLInputObjectType?xf.getFields():null;break;case RuleKinds.OBJECT_FIELD:const wf=yf.name&&hf?hf[yf.name]:null;df=wf==null?void 0:wf.type,uf=wf,mf=uf?uf.type:null;break;case RuleKinds.NAMED_TYPE:yf.name&&(mf=vo.getType(yf.name));break}}),{argDef:bo,argDefs:Ra,directiveDef:pc,enumValue:mc,fieldDef:uf,inputType:df,objectFieldDefs:hf,parentType:pf,type:mf,interfaceDef:gf,objectTypeDef:ff}}const AdditionalRuleKinds={ALIASED_FIELD:"AliasedField",ARGUMENTS:"Arguments",SHORT_QUERY:"ShortQuery",QUERY:"Query",MUTATION:"Mutation",SUBSCRIPTION:"Subscription",TYPE_CONDITION:"TypeCondition",INVALID:"Invalid",COMMENT:"Comment",SCHEMA_DEF:"SchemaDef",SCALAR_DEF:"ScalarDef",OBJECT_TYPE_DEF:"ObjectTypeDef",OBJECT_VALUE:"ObjectValue",LIST_VALUE:"ListValue",INTERFACE_DEF:"InterfaceDef",UNION_DEF:"UnionDef",ENUM_DEF:"EnumDef",ENUM_VALUE:"EnumValue",FIELD_DEF:"FieldDef",INPUT_DEF:"InputDef",INPUT_VALUE_DEF:"InputValueDef",ARGUMENTS_DEF:"ArgumentsDef",EXTEND_DEF:"ExtendDef",EXTENSION_DEFINITION:"ExtensionDefinition",DIRECTIVE_DEF:"DirectiveDef",IMPLEMENTS:"Implements",VARIABLE_DEFINITIONS:"VariableDefinitions",TYPE:"Type",VARIABLE:"Variable"},RuleKinds=Object.assign(Object.assign({},Kind),AdditionalRuleKinds);var CompletionItemKind;(function(vo){vo.Text=1,vo.Method=2,vo.Function=3,vo.Constructor=4,vo.Field=5,vo.Variable=6,vo.Class=7,vo.Interface=8,vo.Module=9,vo.Property=10,vo.Unit=11,vo.Value=12,vo.Enum=13,vo.Keyword=14,vo.Snippet=15,vo.Color=16,vo.File=17,vo.Reference=18,vo.Folder=19,vo.EnumMember=20,vo.Constant=21,vo.Struct=22,vo.Event=23,vo.Operator=24,vo.TypeParameter=25})(CompletionItemKind||(CompletionItemKind={}));const SuggestionCommand={command:"editor.action.triggerSuggest",title:"Suggestions"},collectFragmentDefs=vo=>[];function getAutocompleteSuggestions(vo,Ai,bo,Ra,pc,mc){var uf;const df=Object.assign(Object.assign({},mc),{schema:vo}),ff=getContextAtPosition(Ai,bo,vo,Ra,mc);if(!ff)return[];const{state:hf,typeInfo:pf,mode:mf,token:gf}=ff,{kind:yf,step:vf,prevState:bf}=hf;if(yf===RuleKinds.DOCUMENT)return mf===GraphQLDocumentMode.TYPE_SYSTEM?getSuggestionsForTypeSystemDefinitions(gf):mf===GraphQLDocumentMode.EXECUTABLE?getSuggestionsForExecutableDefinitions(gf):getSuggestionsForUnknownDocumentMode(gf);if(yf===RuleKinds.EXTEND_DEF)return getSuggestionsForExtensionDefinitions(gf);if(((uf=bf==null?void 0:bf.prevState)===null||uf===void 0?void 0:uf.kind)===RuleKinds.EXTENSION_DEFINITION&&hf.name)return hintList(gf,[]);if((bf==null?void 0:bf.kind)===Kind.SCALAR_TYPE_EXTENSION)return hintList(gf,Object.values(vo.getTypeMap()).filter(isScalarType).map(xf=>({label:xf.name,kind:CompletionItemKind.Function})));if((bf==null?void 0:bf.kind)===Kind.OBJECT_TYPE_EXTENSION)return hintList(gf,Object.values(vo.getTypeMap()).filter(xf=>isObjectType(xf)&&!xf.name.startsWith("__")).map(xf=>({label:xf.name,kind:CompletionItemKind.Function})));if((bf==null?void 0:bf.kind)===Kind.INTERFACE_TYPE_EXTENSION)return hintList(gf,Object.values(vo.getTypeMap()).filter(isInterfaceType).map(xf=>({label:xf.name,kind:CompletionItemKind.Function})));if((bf==null?void 0:bf.kind)===Kind.UNION_TYPE_EXTENSION)return hintList(gf,Object.values(vo.getTypeMap()).filter(isUnionType).map(xf=>({label:xf.name,kind:CompletionItemKind.Function})));if((bf==null?void 0:bf.kind)===Kind.ENUM_TYPE_EXTENSION)return hintList(gf,Object.values(vo.getTypeMap()).filter(xf=>isEnumType(xf)&&!xf.name.startsWith("__")).map(xf=>({label:xf.name,kind:CompletionItemKind.Function})));if((bf==null?void 0:bf.kind)===Kind.INPUT_OBJECT_TYPE_EXTENSION)return hintList(gf,Object.values(vo.getTypeMap()).filter(isInputObjectType).map(xf=>({label:xf.name,kind:CompletionItemKind.Function})));if(yf===RuleKinds.IMPLEMENTS||yf===RuleKinds.NAMED_TYPE&&(bf==null?void 0:bf.kind)===RuleKinds.IMPLEMENTS)return getSuggestionsForImplements(gf,hf,vo,Ai,pf);if(yf===RuleKinds.SELECTION_SET||yf===RuleKinds.FIELD||yf===RuleKinds.ALIASED_FIELD)return getSuggestionsForFieldNames(gf,pf,df);if(yf===RuleKinds.ARGUMENTS||yf===RuleKinds.ARGUMENT&&vf===0){const{argDefs:xf}=pf;if(xf)return hintList(gf,xf.map(wf=>{var If;return{label:wf.name,insertText:getInputInsertText(wf.name+": ",wf.type),insertTextMode:InsertTextMode.adjustIndentation,insertTextFormat:InsertTextFormat.Snippet,command:SuggestionCommand,labelDetails:{detail:" "+String(wf.type)},documentation:(If=wf.description)!==null&&If!==void 0?If:void 0,kind:CompletionItemKind.Variable,type:wf.type}}))}if((yf===RuleKinds.OBJECT_VALUE||yf===RuleKinds.OBJECT_FIELD&&vf===0)&&pf.objectFieldDefs){const xf=objectValues(pf.objectFieldDefs),wf=yf===RuleKinds.OBJECT_VALUE?CompletionItemKind.Value:CompletionItemKind.Field;return hintList(gf,xf.map(If=>{var l1;return{label:If.name,detail:String(If.type),documentation:(l1=If==null?void 0:If.description)!==null&&l1!==void 0?l1:void 0,kind:wf,type:If.type,insertText:getInputInsertText(If.name+": ",If.type),insertTextMode:InsertTextMode.adjustIndentation,insertTextFormat:InsertTextFormat.Snippet,command:SuggestionCommand}}))}if(yf===RuleKinds.ENUM_VALUE||yf===RuleKinds.LIST_VALUE&&vf===1||yf===RuleKinds.OBJECT_FIELD&&vf===2||yf===RuleKinds.ARGUMENT&&vf===2)return getSuggestionsForInputValues(gf,pf,Ai,vo);if(yf===RuleKinds.VARIABLE&&vf===1){const xf=getNamedType(pf.inputType),wf=getVariableCompletions(Ai,vo,gf);return hintList(gf,wf.filter(If=>If.detail===(xf==null?void 0:xf.name)))}if(yf===RuleKinds.TYPE_CONDITION&&vf===1||yf===RuleKinds.NAMED_TYPE&&bf!=null&&bf.kind===RuleKinds.TYPE_CONDITION)return getSuggestionsForFragmentTypeConditions(gf,pf,vo);if(yf===RuleKinds.FRAGMENT_SPREAD&&vf===1)return getSuggestionsForFragmentSpread(gf,pf,vo,Ai,Array.isArray(pc)?pc:collectFragmentDefs());const Sf=unwrapType(hf);return Sf.kind===RuleKinds.FIELD_DEF?hintList(gf,Object.values(vo.getTypeMap()).filter(xf=>isOutputType(xf)&&!xf.name.startsWith("__")).map(xf=>({label:xf.name,kind:CompletionItemKind.Function,insertText:mc!=null&&mc.fillLeafsOnComplete?xf.name+`
|
|
364
|
-
`:xf.name,insertTextMode:InsertTextMode.adjustIndentation}))):Sf.kind===RuleKinds.INPUT_VALUE_DEF&&vf===2?hintList(gf,Object.values(vo.getTypeMap()).filter(xf=>isInputType(xf)&&!xf.name.startsWith("__")).map(xf=>({label:xf.name,kind:CompletionItemKind.Function,insertText:mc!=null&&mc.fillLeafsOnComplete?xf.name+`
|
|
365
|
-
$1`:xf.name,insertTextMode:InsertTextMode.adjustIndentation,insertTextFormat:InsertTextFormat.Snippet}))):yf===RuleKinds.VARIABLE_DEFINITION&&vf===2||yf===RuleKinds.LIST_TYPE&&vf===1||yf===RuleKinds.NAMED_TYPE&&bf&&(bf.kind===RuleKinds.VARIABLE_DEFINITION||bf.kind===RuleKinds.LIST_TYPE||bf.kind===RuleKinds.NON_NULL_TYPE)?getSuggestionsForVariableDefinition(gf,vo):yf===RuleKinds.DIRECTIVE?getSuggestionsForDirective(gf,hf,vo):yf===RuleKinds.DIRECTIVE_DEF?getSuggestionsForDirectiveArguments(gf,hf,vo):[]}const typeSystemCompletionItems=[{label:"type",kind:CompletionItemKind.Function},{label:"interface",kind:CompletionItemKind.Function},{label:"union",kind:CompletionItemKind.Function},{label:"input",kind:CompletionItemKind.Function},{label:"scalar",kind:CompletionItemKind.Function},{label:"schema",kind:CompletionItemKind.Function}],executableCompletionItems=[{label:"query",kind:CompletionItemKind.Function},{label:"mutation",kind:CompletionItemKind.Function},{label:"subscription",kind:CompletionItemKind.Function},{label:"fragment",kind:CompletionItemKind.Function},{label:"{",kind:CompletionItemKind.Constructor}];function getSuggestionsForTypeSystemDefinitions(vo){return hintList(vo,[{label:"extend",kind:CompletionItemKind.Function},...typeSystemCompletionItems])}function getSuggestionsForExecutableDefinitions(vo){return hintList(vo,executableCompletionItems)}function getSuggestionsForUnknownDocumentMode(vo){return hintList(vo,[{label:"extend",kind:CompletionItemKind.Function},...executableCompletionItems,...typeSystemCompletionItems])}function getSuggestionsForExtensionDefinitions(vo){return hintList(vo,typeSystemCompletionItems)}function getSuggestionsForFieldNames(vo,Ai,bo){var Ra;if(Ai.parentType){const{parentType:pc}=Ai;let mc=[];return"getFields"in pc&&(mc=objectValues(pc.getFields())),isCompositeType(pc)&&mc.push(TypeNameMetaFieldDef),pc===((Ra=bo==null?void 0:bo.schema)===null||Ra===void 0?void 0:Ra.getQueryType())&&mc.push(SchemaMetaFieldDef,TypeMetaFieldDef),hintList(vo,mc.map((uf,df)=>{var ff;const hf={sortText:String(df)+uf.name,label:uf.name,detail:String(uf.type),documentation:(ff=uf.description)!==null&&ff!==void 0?ff:void 0,deprecated:!!uf.deprecationReason,isDeprecated:!!uf.deprecationReason,deprecationReason:uf.deprecationReason,kind:CompletionItemKind.Field,labelDetails:{detail:" "+uf.type.toString()},type:uf.type};return bo!=null&&bo.fillLeafsOnComplete&&(hf.insertText=getFieldInsertText(uf),hf.insertText||(hf.insertText=getInsertText(uf.name,uf.type,uf.name+(vo.state.needsAdvance?"":`
|
|
366
|
-
`))),hf.insertText&&(hf.insertTextFormat=InsertTextFormat.Snippet,hf.insertTextMode=InsertTextMode.adjustIndentation,hf.command=SuggestionCommand)),hf}))}return[]}function getSuggestionsForInputValues(vo,Ai,bo,Ra){const pc=getNamedType(Ai.inputType),mc=getVariableCompletions(bo,Ra,vo).filter(uf=>uf.detail===(pc==null?void 0:pc.name));if(pc instanceof GraphQLEnumType){const uf=pc.getValues();return hintList(vo,uf.map(df=>{var ff;return{label:df.name,detail:String(pc),documentation:(ff=df.description)!==null&&ff!==void 0?ff:void 0,deprecated:!!df.deprecationReason,isDeprecated:!!df.deprecationReason,deprecationReason:df.deprecationReason,kind:CompletionItemKind.EnumMember,type:pc}}).concat(mc))}return pc===GraphQLBoolean?hintList(vo,mc.concat([{label:"true",detail:String(GraphQLBoolean),documentation:"Not false.",kind:CompletionItemKind.Variable,type:GraphQLBoolean},{label:"false",detail:String(GraphQLBoolean),documentation:"Not true.",kind:CompletionItemKind.Variable,type:GraphQLBoolean}])):mc}function getSuggestionsForImplements(vo,Ai,bo,Ra,pc){if(Ai.needsSeparator)return[];const mc=bo.getTypeMap(),uf=objectValues(mc).filter(isInterfaceType),df=uf.map(({name:gf})=>gf),ff=new Set;runOnlineParser(Ra,(gf,yf)=>{var vf,bf,Sf,xf,wf;if(yf.name&&(yf.kind===RuleKinds.INTERFACE_DEF&&!df.includes(yf.name)&&ff.add(yf.name),yf.kind===RuleKinds.NAMED_TYPE&&((vf=yf.prevState)===null||vf===void 0?void 0:vf.kind)===RuleKinds.IMPLEMENTS)){if(pc.interfaceDef){if(!((bf=pc.interfaceDef)===null||bf===void 0)&&bf.getInterfaces().find(({name:s1})=>s1===yf.name))return;const If=bo.getType(yf.name),l1=(Sf=pc.interfaceDef)===null||Sf===void 0?void 0:Sf.toConfig();pc.interfaceDef=new GraphQLInterfaceType(Object.assign(Object.assign({},l1),{interfaces:[...l1.interfaces,If||new GraphQLInterfaceType({name:yf.name,fields:{}})]}))}else if(pc.objectTypeDef){if(!((xf=pc.objectTypeDef)===null||xf===void 0)&&xf.getInterfaces().find(({name:s1})=>s1===yf.name))return;const If=bo.getType(yf.name),l1=(wf=pc.objectTypeDef)===null||wf===void 0?void 0:wf.toConfig();pc.objectTypeDef=new GraphQLObjectType(Object.assign(Object.assign({},l1),{interfaces:[...l1.interfaces,If||new GraphQLInterfaceType({name:yf.name,fields:{}})]}))}}});const hf=pc.interfaceDef||pc.objectTypeDef,pf=((hf==null?void 0:hf.getInterfaces())||[]).map(({name:gf})=>gf),mf=uf.concat([...ff].map(gf=>({name:gf}))).filter(({name:gf})=>gf!==(hf==null?void 0:hf.name)&&!pf.includes(gf));return hintList(vo,mf.map(gf=>{const yf={label:gf.name,kind:CompletionItemKind.Interface,type:gf};return gf!=null&&gf.description&&(yf.documentation=gf.description),yf}))}function getSuggestionsForFragmentTypeConditions(vo,Ai,bo,Ra){let pc;if(Ai.parentType)if(isAbstractType(Ai.parentType)){const mc=assertAbstractType(Ai.parentType),uf=bo.getPossibleTypes(mc),df=Object.create(null);for(const ff of uf)for(const hf of ff.getInterfaces())df[hf.name]=hf;pc=uf.concat(objectValues(df))}else pc=[Ai.parentType];else{const mc=bo.getTypeMap();pc=objectValues(mc).filter(uf=>isCompositeType(uf)&&!uf.name.startsWith("__"))}return hintList(vo,pc.map(mc=>{const uf=getNamedType(mc);return{label:String(mc),documentation:(uf==null?void 0:uf.description)||"",kind:CompletionItemKind.Field}}))}function getSuggestionsForFragmentSpread(vo,Ai,bo,Ra,pc){if(!Ra)return[];const mc=bo.getTypeMap(),uf=getDefinitionState(vo.state),df=getFragmentDefinitions(Ra);pc&&pc.length>0&&df.push(...pc);const ff=df.filter(hf=>mc[hf.typeCondition.name.value]&&!(uf&&uf.kind===RuleKinds.FRAGMENT_DEFINITION&&uf.name===hf.name.value)&&isCompositeType(Ai.parentType)&&isCompositeType(mc[hf.typeCondition.name.value])&&doTypesOverlap(bo,Ai.parentType,mc[hf.typeCondition.name.value]));return hintList(vo,ff.map(hf=>({label:hf.name.value,detail:String(mc[hf.typeCondition.name.value]),documentation:`fragment ${hf.name.value} on ${hf.typeCondition.name.value}`,labelDetails:{detail:`fragment ${hf.name.value} on ${hf.typeCondition.name.value}`},kind:CompletionItemKind.Field,type:mc[hf.typeCondition.name.value]})))}const getParentDefinition=(vo,Ai)=>{var bo,Ra,pc,mc,uf,df,ff,hf,pf,mf;if(((bo=vo.prevState)===null||bo===void 0?void 0:bo.kind)===Ai)return vo.prevState;if(((pc=(Ra=vo.prevState)===null||Ra===void 0?void 0:Ra.prevState)===null||pc===void 0?void 0:pc.kind)===Ai)return vo.prevState.prevState;if(((df=(uf=(mc=vo.prevState)===null||mc===void 0?void 0:mc.prevState)===null||uf===void 0?void 0:uf.prevState)===null||df===void 0?void 0:df.kind)===Ai)return vo.prevState.prevState.prevState;if(((mf=(pf=(hf=(ff=vo.prevState)===null||ff===void 0?void 0:ff.prevState)===null||hf===void 0?void 0:hf.prevState)===null||pf===void 0?void 0:pf.prevState)===null||mf===void 0?void 0:mf.kind)===Ai)return vo.prevState.prevState.prevState.prevState};function getVariableCompletions(vo,Ai,bo){let Ra=null,pc;const mc=Object.create({});return runOnlineParser(vo,(uf,df)=>{var ff;if((df==null?void 0:df.kind)===RuleKinds.VARIABLE&&df.name&&(Ra=df.name),(df==null?void 0:df.kind)===RuleKinds.NAMED_TYPE&&Ra){const hf=getParentDefinition(df,RuleKinds.TYPE);hf!=null&&hf.type&&(pc=Ai.getType(hf==null?void 0:hf.type))}if(Ra&&pc&&!mc[Ra]){const hf=bo.string==="$"||((ff=bo==null?void 0:bo.state)===null||ff===void 0?void 0:ff.kind)==="Variable"?Ra:"$"+Ra;mc[Ra]={detail:pc.toString(),insertText:hf,label:"$"+Ra,rawInsert:hf,type:pc,kind:CompletionItemKind.Variable},Ra=null,pc=null}}),objectValues(mc)}function getFragmentDefinitions(vo){const Ai=[];return runOnlineParser(vo,(bo,Ra)=>{Ra.kind===RuleKinds.FRAGMENT_DEFINITION&&Ra.name&&Ra.type&&Ai.push({kind:RuleKinds.FRAGMENT_DEFINITION,name:{kind:Kind.NAME,value:Ra.name},selectionSet:{kind:RuleKinds.SELECTION_SET,selections:[]},typeCondition:{kind:RuleKinds.NAMED_TYPE,name:{kind:Kind.NAME,value:Ra.type}}})}),Ai}function getSuggestionsForVariableDefinition(vo,Ai,bo){const Ra=Ai.getTypeMap(),pc=objectValues(Ra).filter(isInputType);return hintList(vo,pc.map(mc=>({label:mc.name,documentation:(mc==null?void 0:mc.description)||"",kind:CompletionItemKind.Variable})))}function getSuggestionsForDirective(vo,Ai,bo,Ra){var pc;if(!((pc=Ai.prevState)===null||pc===void 0)&&pc.kind){const mc=bo.getDirectives().filter(uf=>canUseDirective(Ai.prevState,uf));return hintList(vo,mc.map(uf=>({label:uf.name,documentation:(uf==null?void 0:uf.description)||"",kind:CompletionItemKind.Function})))}return[]}function getSuggestionsForDirectiveArguments(vo,Ai,bo,Ra){const pc=bo.getDirectives().find(mc=>mc.name===Ai.name);return hintList(vo,(pc==null?void 0:pc.args.map(mc=>({label:mc.name,documentation:mc.description||"",kind:CompletionItemKind.Field})))||[])}function canUseDirective(vo,Ai){if(!(vo!=null&&vo.kind))return!1;const{kind:bo,prevState:Ra}=vo,{locations:pc}=Ai;switch(bo){case RuleKinds.QUERY:return pc.includes(DirectiveLocation.QUERY);case RuleKinds.MUTATION:return pc.includes(DirectiveLocation.MUTATION);case RuleKinds.SUBSCRIPTION:return pc.includes(DirectiveLocation.SUBSCRIPTION);case RuleKinds.FIELD:case RuleKinds.ALIASED_FIELD:return pc.includes(DirectiveLocation.FIELD);case RuleKinds.FRAGMENT_DEFINITION:return pc.includes(DirectiveLocation.FRAGMENT_DEFINITION);case RuleKinds.FRAGMENT_SPREAD:return pc.includes(DirectiveLocation.FRAGMENT_SPREAD);case RuleKinds.INLINE_FRAGMENT:return pc.includes(DirectiveLocation.INLINE_FRAGMENT);case RuleKinds.SCHEMA_DEF:return pc.includes(DirectiveLocation.SCHEMA);case RuleKinds.SCALAR_DEF:return pc.includes(DirectiveLocation.SCALAR);case RuleKinds.OBJECT_TYPE_DEF:return pc.includes(DirectiveLocation.OBJECT);case RuleKinds.FIELD_DEF:return pc.includes(DirectiveLocation.FIELD_DEFINITION);case RuleKinds.INTERFACE_DEF:return pc.includes(DirectiveLocation.INTERFACE);case RuleKinds.UNION_DEF:return pc.includes(DirectiveLocation.UNION);case RuleKinds.ENUM_DEF:return pc.includes(DirectiveLocation.ENUM);case RuleKinds.ENUM_VALUE:return pc.includes(DirectiveLocation.ENUM_VALUE);case RuleKinds.INPUT_DEF:return pc.includes(DirectiveLocation.INPUT_OBJECT);case RuleKinds.INPUT_VALUE_DEF:switch(Ra==null?void 0:Ra.kind){case RuleKinds.ARGUMENTS_DEF:return pc.includes(DirectiveLocation.ARGUMENT_DEFINITION);case RuleKinds.INPUT_DEF:return pc.includes(DirectiveLocation.INPUT_FIELD_DEFINITION)}}return!1}function unwrapType(vo){return vo.prevState&&vo.kind&&[RuleKinds.NAMED_TYPE,RuleKinds.LIST_TYPE,RuleKinds.TYPE,RuleKinds.NON_NULL_TYPE].includes(vo.kind)?unwrapType(vo.prevState):vo}var nullthrows={exports:{}},hasRequiredNullthrows;function requireNullthrows(){if(hasRequiredNullthrows)return nullthrows.exports;hasRequiredNullthrows=1;function vo(Ai,bo){if(Ai!=null)return Ai;var Ra=new Error(bo!==void 0?bo:"Got unexpected "+Ai);throw Ra.framesToPop=1,Ra}return nullthrows.exports=vo,nullthrows.exports.default=vo,Object.defineProperty(nullthrows.exports,"__esModule",{value:!0}),nullthrows.exports}requireNullthrows();class Range{constructor(Ai,bo){this.containsPosition=Ra=>this.start.line===Ra.line?this.start.character<=Ra.character:this.end.line===Ra.line?this.end.character>=Ra.character:this.start.line<=Ra.line&&this.end.line>=Ra.line,this.start=Ai,this.end=bo}setStart(Ai,bo){this.start=new Position$1(Ai,bo)}setEnd(Ai,bo){this.end=new Position$1(Ai,bo)}}let Position$1=class{constructor(vo,Ai){this.lessThanOrEqualTo=bo=>this.line<bo.line||this.line===bo.line&&this.character<=bo.character,this.line=vo,this.character=Ai}setLine(vo){this.line=vo}setCharacter(vo){this.character=vo}};function validateWithCustomRules(vo,Ai,bo,Ra,pc){const mc=specifiedRules.filter(uf=>!(uf===NoUnusedFragmentsRule||uf===ExecutableDefinitionsRule));return validate(vo,Ai,mc).filter(uf=>{if(uf.message.includes("Unknown directive")&&uf.nodes){const df=uf.nodes[0];if(df&&df.kind===Kind.DIRECTIVE){const ff=df.name.value;if(ff==="arguments"||ff==="argumentDefinitions")return!1}}return!0})}const SEVERITY$1={Error:"Error",Warning:"Warning",Information:"Information",Hint:"Hint"},DIAGNOSTIC_SEVERITY={[SEVERITY$1.Error]:1,[SEVERITY$1.Warning]:2,[SEVERITY$1.Information]:3,[SEVERITY$1.Hint]:4},invariant=(vo,Ai)=>{if(!vo)throw new Error(Ai)};function getDiagnostics(vo,Ai=null,bo,Ra,pc){var mc,uf;let df=null;const ff=vo;try{df=parse(ff)}catch(hf){if(hf instanceof GraphQLError){const pf=getRange((uf=(mc=hf.locations)===null||mc===void 0?void 0:mc[0])!==null&&uf!==void 0?uf:{line:0,column:0},ff);return[{severity:DIAGNOSTIC_SEVERITY.Error,message:hf.message,source:"GraphQL: Syntax",range:pf}]}throw hf}return validateQuery(df,Ai)}function validateQuery(vo,Ai=null,bo,Ra){if(!Ai)return[];const pc=validateWithCustomRules(Ai,vo).flatMap(uf=>annotations(uf,DIAGNOSTIC_SEVERITY.Error,"Validation")),mc=validate(Ai,vo,[NoDeprecatedCustomRule]).flatMap(uf=>annotations(uf,DIAGNOSTIC_SEVERITY.Warning,"Deprecation"));return pc.concat(mc)}function annotations(vo,Ai,bo){if(!vo.nodes)return[];const Ra=[];for(const[pc,mc]of vo.nodes.entries()){const uf=mc.kind!=="Variable"&&"name"in mc&&mc.name!==void 0?mc.name:"variable"in mc&&mc.variable!==void 0?mc.variable:mc;if(uf){invariant(vo.locations,"GraphQL validation error requires locations.");const df=vo.locations[pc],ff=getLocation(uf),hf=df.column+(ff.end-ff.start);Ra.push({source:`GraphQL: ${bo}`,message:vo.message,severity:Ai,range:new Range(new Position$1(df.line-1,df.column-1),new Position$1(df.line-1,hf))})}}return Ra}function getRange(vo,Ai){const bo=onlineParser(),Ra=bo.startState(),pc=Ai.split(`
|
|
367
|
-
`);invariant(pc.length>=vo.line,"Query text must have more lines than where the error happened");let mc=null;for(let hf=0;hf<vo.line;hf++)for(mc=new CharacterStream(pc[hf]);!mc.eol()&&bo.token(mc,Ra)!=="invalidchar";);invariant(mc,"Expected Parser stream to be available.");const uf=vo.line-1,df=mc.getStartOfToken(),ff=mc.getCurrentPosition();return new Range(new Position$1(uf,df),new Position$1(uf,ff))}function getLocation(vo){const Ai=vo.loc;return invariant(Ai,"Expected ASTNode to have a location."),Ai}class Stack{constructor(Ai,bo,Ra,pc,mc,uf,df,ff,hf,pf=0,mf){this.p=Ai,this.stack=bo,this.state=Ra,this.reducePos=pc,this.pos=mc,this.score=uf,this.buffer=df,this.bufferBase=ff,this.curContext=hf,this.lookAhead=pf,this.parent=mf}toString(){return`[${this.stack.filter((Ai,bo)=>bo%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(Ai,bo,Ra=0){let pc=Ai.parser.context;return new Stack(Ai,[],bo,Ra,Ra,0,[],0,pc?new StackContext(pc,pc.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(Ai,bo){this.stack.push(this.state,bo,this.bufferBase+this.buffer.length),this.state=Ai}reduce(Ai){var bo;let Ra=Ai>>19,pc=Ai&65535,{parser:mc}=this.p,uf=this.reducePos<this.pos-25;uf&&this.setLookAhead(this.pos);let df=mc.dynamicPrecedence(pc);if(df&&(this.score+=df),Ra==0){this.pushState(mc.getGoto(this.state,pc,!0),this.reducePos),pc<mc.minRepeatTerm&&this.storeNode(pc,this.reducePos,this.reducePos,uf?8:4,!0),this.reduceContext(pc,this.reducePos);return}let ff=this.stack.length-(Ra-1)*3-(Ai&262144?6:0),hf=ff?this.stack[ff-2]:this.p.ranges[0].from,pf=this.reducePos-hf;pf>=2e3&&!(!((bo=this.p.parser.nodeSet.types[pc])===null||bo===void 0)&&bo.isAnonymous)&&(hf==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=pf):this.p.lastBigReductionSize<pf&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=hf,this.p.lastBigReductionSize=pf));let mf=ff?this.stack[ff-1]:0,gf=this.bufferBase+this.buffer.length-mf;if(pc<mc.minRepeatTerm||Ai&131072){let yf=mc.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(pc,hf,yf,gf+4,!0)}if(Ai&262144)this.state=this.stack[ff];else{let yf=this.stack[ff-3];this.state=mc.getGoto(yf,pc,!0)}for(;this.stack.length>ff;)this.stack.pop();this.reduceContext(pc,hf)}storeNode(Ai,bo,Ra,pc=4,mc=!1){if(Ai==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let uf=this,df=this.buffer.length;if(df==0&&uf.parent&&(df=uf.bufferBase-uf.parent.bufferBase,uf=uf.parent),df>0&&uf.buffer[df-4]==0&&uf.buffer[df-1]>-1){if(bo==Ra)return;if(uf.buffer[df-2]>=bo){uf.buffer[df-2]=Ra;return}}}if(!mc||this.pos==Ra)this.buffer.push(Ai,bo,Ra,pc);else{let uf=this.buffer.length;if(uf>0&&this.buffer[uf-4]!=0){let df=!1;for(let ff=uf;ff>0&&this.buffer[ff-2]>Ra;ff-=4)if(this.buffer[ff-1]>=0){df=!0;break}if(df)for(;uf>0&&this.buffer[uf-2]>Ra;)this.buffer[uf]=this.buffer[uf-4],this.buffer[uf+1]=this.buffer[uf-3],this.buffer[uf+2]=this.buffer[uf-2],this.buffer[uf+3]=this.buffer[uf-1],uf-=4,pc>4&&(pc-=4)}this.buffer[uf]=Ai,this.buffer[uf+1]=bo,this.buffer[uf+2]=Ra,this.buffer[uf+3]=pc}}shift(Ai,bo,Ra,pc){if(Ai&131072)this.pushState(Ai&65535,this.pos);else if(Ai&262144)this.pos=pc,this.shiftContext(bo,Ra),bo<=this.p.parser.maxNode&&this.buffer.push(bo,Ra,pc,4);else{let mc=Ai,{parser:uf}=this.p;(pc>this.pos||bo<=uf.maxNode)&&(this.pos=pc,uf.stateFlag(mc,1)||(this.reducePos=pc)),this.pushState(mc,Ra),this.shiftContext(bo,Ra),bo<=uf.maxNode&&this.buffer.push(bo,Ra,pc,4)}}apply(Ai,bo,Ra,pc){Ai&65536?this.reduce(Ai):this.shift(Ai,bo,Ra,pc)}useNode(Ai,bo){let Ra=this.p.reused.length-1;(Ra<0||this.p.reused[Ra]!=Ai)&&(this.p.reused.push(Ai),Ra++);let pc=this.pos;this.reducePos=this.pos=pc+Ai.length,this.pushState(bo,pc),this.buffer.push(Ra,pc,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,Ai,this,this.p.stream.reset(this.pos-Ai.length)))}split(){let Ai=this,bo=Ai.buffer.length;for(;bo>0&&Ai.buffer[bo-2]>Ai.reducePos;)bo-=4;let Ra=Ai.buffer.slice(bo),pc=Ai.bufferBase+bo;for(;Ai&&pc==Ai.bufferBase;)Ai=Ai.parent;return new Stack(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,Ra,pc,this.curContext,this.lookAhead,Ai)}recoverByDelete(Ai,bo){let Ra=Ai<=this.p.parser.maxNode;Ra&&this.storeNode(Ai,this.pos,bo,4),this.storeNode(0,this.pos,bo,Ra?8:4),this.pos=this.reducePos=bo,this.score-=190}canShift(Ai){for(let bo=new SimulatedStack(this);;){let Ra=this.p.parser.stateSlot(bo.state,4)||this.p.parser.hasAction(bo.state,Ai);if(Ra==0)return!1;if(!(Ra&65536))return!0;bo.reduce(Ra)}}recoverByInsert(Ai){if(this.stack.length>=300)return[];let bo=this.p.parser.nextStates(this.state);if(bo.length>8||this.stack.length>=120){let pc=[];for(let mc=0,uf;mc<bo.length;mc+=2)(uf=bo[mc+1])!=this.state&&this.p.parser.hasAction(uf,Ai)&&pc.push(bo[mc],uf);if(this.stack.length<120)for(let mc=0;pc.length<8&&mc<bo.length;mc+=2){let uf=bo[mc+1];pc.some((df,ff)=>ff&1&&df==uf)||pc.push(bo[mc],uf)}bo=pc}let Ra=[];for(let pc=0;pc<bo.length&&Ra.length<4;pc+=2){let mc=bo[pc+1];if(mc==this.state)continue;let uf=this.split();uf.pushState(mc,this.pos),uf.storeNode(0,uf.pos,uf.pos,4,!0),uf.shiftContext(bo[pc],this.pos),uf.reducePos=this.pos,uf.score-=200,Ra.push(uf)}return Ra}forceReduce(){let{parser:Ai}=this.p,bo=Ai.stateSlot(this.state,5);if(!(bo&65536))return!1;if(!Ai.validAction(this.state,bo)){let Ra=bo>>19,pc=bo&65535,mc=this.stack.length-Ra*3;if(mc<0||Ai.getGoto(this.stack[mc],pc,!1)<0){let uf=this.findForcedReduction();if(uf==null)return!1;bo=uf}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(bo),!0}findForcedReduction(){let{parser:Ai}=this.p,bo=[],Ra=(pc,mc)=>{if(!bo.includes(pc))return bo.push(pc),Ai.allActions(pc,uf=>{if(!(uf&393216))if(uf&65536){let df=(uf>>19)-mc;if(df>1){let ff=uf&65535,hf=this.stack.length-df*3;if(hf>=0&&Ai.getGoto(this.stack[hf],ff,!1)>=0)return df<<19|65536|ff}}else{let df=Ra(uf,mc+1);if(df!=null)return df}})};return Ra(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:Ai}=this.p;return Ai.data[Ai.stateSlot(this.state,1)]==65535&&!Ai.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(Ai){if(this.state!=Ai.state||this.stack.length!=Ai.stack.length)return!1;for(let bo=0;bo<this.stack.length;bo+=3)if(this.stack[bo]!=Ai.stack[bo])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(Ai){return this.p.parser.dialect.flags[Ai]}shiftContext(Ai,bo){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,Ai,this,this.p.stream.reset(bo)))}reduceContext(Ai,bo){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,Ai,this,this.p.stream.reset(bo)))}emitContext(){let Ai=this.buffer.length-1;(Ai<0||this.buffer[Ai]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let Ai=this.buffer.length-1;(Ai<0||this.buffer[Ai]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(Ai){if(Ai!=this.curContext.context){let bo=new StackContext(this.curContext.tracker,Ai);bo.hash!=this.curContext.hash&&this.emitContext(),this.curContext=bo}}setLookAhead(Ai){Ai>this.lookAhead&&(this.emitLookAhead(),this.lookAhead=Ai)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class StackContext{constructor(Ai,bo){this.tracker=Ai,this.context=bo,this.hash=Ai.strict?Ai.hash(bo):0}}class SimulatedStack{constructor(Ai){this.start=Ai,this.state=Ai.state,this.stack=Ai.stack,this.base=this.stack.length}reduce(Ai){let bo=Ai&65535,Ra=Ai>>19;Ra==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(Ra-1)*3;let pc=this.start.p.parser.getGoto(this.stack[this.base-3],bo,!0);this.state=pc}}class StackBufferCursor{constructor(Ai,bo,Ra){this.stack=Ai,this.pos=bo,this.index=Ra,this.buffer=Ai.buffer,this.index==0&&this.maybeNext()}static create(Ai,bo=Ai.bufferBase+Ai.buffer.length){return new StackBufferCursor(Ai,bo,bo-Ai.bufferBase)}maybeNext(){let Ai=this.stack.parent;Ai!=null&&(this.index=this.stack.bufferBase-Ai.bufferBase,this.stack=Ai,this.buffer=Ai.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new StackBufferCursor(this.stack,this.pos,this.index)}}function decodeArray(vo,Ai=Uint16Array){if(typeof vo!="string")return vo;let bo=null;for(let Ra=0,pc=0;Ra<vo.length;){let mc=0;for(;;){let uf=vo.charCodeAt(Ra++),df=!1;if(uf==126){mc=65535;break}uf>=92&&uf--,uf>=34&&uf--;let ff=uf-32;if(ff>=46&&(ff-=46,df=!0),mc+=ff,df)break;mc*=46}bo?bo[pc++]=mc:bo=new Ai(mc)}return bo}class CachedToken{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const nullToken=new CachedToken;class InputStream{constructor(Ai,bo){this.input=Ai,this.ranges=bo,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=nullToken,this.rangeIndex=0,this.pos=this.chunkPos=bo[0].from,this.range=bo[0],this.end=bo[bo.length-1].to,this.readNext()}resolveOffset(Ai,bo){let Ra=this.range,pc=this.rangeIndex,mc=this.pos+Ai;for(;mc<Ra.from;){if(!pc)return null;let uf=this.ranges[--pc];mc-=Ra.from-uf.to,Ra=uf}for(;bo<0?mc>Ra.to:mc>=Ra.to;){if(pc==this.ranges.length-1)return null;let uf=this.ranges[++pc];mc+=uf.from-Ra.to,Ra=uf}return mc}clipPos(Ai){if(Ai>=this.range.from&&Ai<this.range.to)return Ai;for(let bo of this.ranges)if(bo.to>Ai)return Math.max(Ai,bo.from);return this.end}peek(Ai){let bo=this.chunkOff+Ai,Ra,pc;if(bo>=0&&bo<this.chunk.length)Ra=this.pos+Ai,pc=this.chunk.charCodeAt(bo);else{let mc=this.resolveOffset(Ai,1);if(mc==null)return-1;if(Ra=mc,Ra>=this.chunk2Pos&&Ra<this.chunk2Pos+this.chunk2.length)pc=this.chunk2.charCodeAt(Ra-this.chunk2Pos);else{let uf=this.rangeIndex,df=this.range;for(;df.to<=Ra;)df=this.ranges[++uf];this.chunk2=this.input.chunk(this.chunk2Pos=Ra),Ra+this.chunk2.length>df.to&&(this.chunk2=this.chunk2.slice(0,df.to-Ra)),pc=this.chunk2.charCodeAt(0)}}return Ra>=this.token.lookAhead&&(this.token.lookAhead=Ra+1),pc}acceptToken(Ai,bo=0){let Ra=bo?this.resolveOffset(bo,-1):this.pos;if(Ra==null||Ra<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=Ai,this.token.end=Ra}acceptTokenTo(Ai,bo){this.token.value=Ai,this.token.end=bo}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:Ai,chunkPos:bo}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=Ai,this.chunk2Pos=bo,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let Ai=this.input.chunk(this.pos),bo=this.pos+Ai.length;this.chunk=bo>this.range.to?Ai.slice(0,this.range.to-this.pos):Ai,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(Ai=1){for(this.chunkOff+=Ai;this.pos+Ai>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();Ai-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=Ai,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(Ai,bo){if(bo?(this.token=bo,bo.start=Ai,bo.lookAhead=Ai+1,bo.value=bo.extended=-1):this.token=nullToken,this.pos!=Ai){if(this.pos=Ai,Ai==this.end)return this.setDone(),this;for(;Ai<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;Ai>=this.range.to;)this.range=this.ranges[++this.rangeIndex];Ai>=this.chunkPos&&Ai<this.chunkPos+this.chunk.length?this.chunkOff=Ai-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(Ai,bo){if(Ai>=this.chunkPos&&bo<=this.chunkPos+this.chunk.length)return this.chunk.slice(Ai-this.chunkPos,bo-this.chunkPos);if(Ai>=this.chunk2Pos&&bo<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(Ai-this.chunk2Pos,bo-this.chunk2Pos);if(Ai>=this.range.from&&bo<=this.range.to)return this.input.read(Ai,bo);let Ra="";for(let pc of this.ranges){if(pc.from>=bo)break;pc.to>Ai&&(Ra+=this.input.read(Math.max(pc.from,Ai),Math.min(pc.to,bo)))}return Ra}}class TokenGroup{constructor(Ai,bo){this.data=Ai,this.id=bo}token(Ai,bo){let{parser:Ra}=bo.p;readToken(this.data,Ai,bo,this.id,Ra.data,Ra.tokenPrecTable)}}TokenGroup.prototype.contextual=TokenGroup.prototype.fallback=TokenGroup.prototype.extend=!1;TokenGroup.prototype.fallback=TokenGroup.prototype.extend=!1;function readToken(vo,Ai,bo,Ra,pc,mc){let uf=0,df=1<<Ra,{dialect:ff}=bo.p.parser;e:for(;df&vo[uf];){let hf=vo[uf+1];for(let yf=uf+3;yf<hf;yf+=2)if((vo[yf+1]&df)>0){let vf=vo[yf];if(ff.allows(vf)&&(Ai.token.value==-1||Ai.token.value==vf||overrides(vf,Ai.token.value,pc,mc))){Ai.acceptToken(vf);break}}let pf=Ai.next,mf=0,gf=vo[uf+2];if(Ai.next<0&&gf>mf&&vo[hf+gf*3-3]==65535){uf=vo[hf+gf*3-1];continue e}for(;mf<gf;){let yf=mf+gf>>1,vf=hf+yf+(yf<<1),bf=vo[vf],Sf=vo[vf+1]||65536;if(pf<bf)gf=yf;else if(pf>=Sf)mf=yf+1;else{uf=vo[vf+2],Ai.advance();continue e}}break}}function findOffset(vo,Ai,bo){for(let Ra=Ai,pc;(pc=vo[Ra])!=65535;Ra++)if(pc==bo)return Ra-Ai;return-1}function overrides(vo,Ai,bo,Ra){let pc=findOffset(bo,Ra,Ai);return pc<0||findOffset(bo,Ra,vo)<pc}const verbose=typeof process<"u"&&define_process_env_default&&/\bparse\b/.test(define_process_env_default.LOG);let stackIDs=null;function cutAt(vo,Ai,bo){let Ra=vo.cursor(IterMode.IncludeAnonymous);for(Ra.moveTo(Ai);;)if(!(bo<0?Ra.childBefore(Ai):Ra.childAfter(Ai)))for(;;){if((bo<0?Ra.to<Ai:Ra.from>Ai)&&!Ra.type.isError)return bo<0?Math.max(0,Math.min(Ra.to-1,Ai-25)):Math.min(vo.length,Math.max(Ra.from+1,Ai+25));if(bo<0?Ra.prevSibling():Ra.nextSibling())break;if(!Ra.parent())return bo<0?0:vo.length}}class FragmentCursor{constructor(Ai,bo){this.fragments=Ai,this.nodeSet=bo,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let Ai=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(Ai){for(this.safeFrom=Ai.openStart?cutAt(Ai.tree,Ai.from+Ai.offset,1)-Ai.offset:Ai.from,this.safeTo=Ai.openEnd?cutAt(Ai.tree,Ai.to+Ai.offset,-1)-Ai.offset:Ai.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(Ai.tree),this.start.push(-Ai.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(Ai){if(Ai<this.nextStart)return null;for(;this.fragment&&this.safeTo<=Ai;)this.nextFragment();if(!this.fragment)return null;for(;;){let bo=this.trees.length-1;if(bo<0)return this.nextFragment(),null;let Ra=this.trees[bo],pc=this.index[bo];if(pc==Ra.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let mc=Ra.children[pc],uf=this.start[bo]+Ra.positions[pc];if(uf>Ai)return this.nextStart=uf,null;if(mc instanceof Tree){if(uf==Ai){if(uf<this.safeFrom)return null;let df=uf+mc.length;if(df<=this.safeTo){let ff=mc.prop(NodeProp.lookAhead);if(!ff||df+ff<this.fragment.to)return mc}}this.index[bo]++,uf+mc.length>=Math.max(this.safeFrom,Ai)&&(this.trees.push(mc),this.start.push(uf),this.index.push(0))}else this.index[bo]++,this.nextStart=uf+mc.length}}}class TokenCache{constructor(Ai,bo){this.stream=bo,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=Ai.tokenizers.map(Ra=>new CachedToken)}getActions(Ai){let bo=0,Ra=null,{parser:pc}=Ai.p,{tokenizers:mc}=pc,uf=pc.stateSlot(Ai.state,3),df=Ai.curContext?Ai.curContext.hash:0,ff=0;for(let hf=0;hf<mc.length;hf++){if(!(1<<hf&uf))continue;let pf=mc[hf],mf=this.tokens[hf];if(!(Ra&&!pf.fallback)&&((pf.contextual||mf.start!=Ai.pos||mf.mask!=uf||mf.context!=df)&&(this.updateCachedToken(mf,pf,Ai),mf.mask=uf,mf.context=df),mf.lookAhead>mf.end+25&&(ff=Math.max(mf.lookAhead,ff)),mf.value!=0)){let gf=bo;if(mf.extended>-1&&(bo=this.addActions(Ai,mf.extended,mf.end,bo)),bo=this.addActions(Ai,mf.value,mf.end,bo),!pf.extend&&(Ra=mf,bo>gf))break}}for(;this.actions.length>bo;)this.actions.pop();return ff&&Ai.setLookAhead(ff),!Ra&&Ai.pos==this.stream.end&&(Ra=new CachedToken,Ra.value=Ai.p.parser.eofTerm,Ra.start=Ra.end=Ai.pos,bo=this.addActions(Ai,Ra.value,Ra.end,bo)),this.mainToken=Ra,this.actions}getMainToken(Ai){if(this.mainToken)return this.mainToken;let bo=new CachedToken,{pos:Ra,p:pc}=Ai;return bo.start=Ra,bo.end=Math.min(Ra+1,pc.stream.end),bo.value=Ra==pc.stream.end?pc.parser.eofTerm:0,bo}updateCachedToken(Ai,bo,Ra){let pc=this.stream.clipPos(Ra.pos);if(bo.token(this.stream.reset(pc,Ai),Ra),Ai.value>-1){let{parser:mc}=Ra.p;for(let uf=0;uf<mc.specialized.length;uf++)if(mc.specialized[uf]==Ai.value){let df=mc.specializers[uf](this.stream.read(Ai.start,Ai.end),Ra);if(df>=0&&Ra.p.parser.dialect.allows(df>>1)){df&1?Ai.extended=df>>1:Ai.value=df>>1;break}}}else Ai.value=0,Ai.end=this.stream.clipPos(pc+1)}putAction(Ai,bo,Ra,pc){for(let mc=0;mc<pc;mc+=3)if(this.actions[mc]==Ai)return pc;return this.actions[pc++]=Ai,this.actions[pc++]=bo,this.actions[pc++]=Ra,pc}addActions(Ai,bo,Ra,pc){let{state:mc}=Ai,{parser:uf}=Ai.p,{data:df}=uf;for(let ff=0;ff<2;ff++)for(let hf=uf.stateSlot(mc,ff?2:1);;hf+=3){if(df[hf]==65535)if(df[hf+1]==1)hf=pair(df,hf+2);else{pc==0&&df[hf+1]==2&&(pc=this.putAction(pair(df,hf+2),bo,Ra,pc));break}df[hf]==bo&&(pc=this.putAction(pair(df,hf+1),bo,Ra,pc))}return pc}}class Parse{constructor(Ai,bo,Ra,pc){this.parser=Ai,this.input=bo,this.ranges=pc,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new InputStream(bo,pc),this.tokens=new TokenCache(Ai,this.stream),this.topTerm=Ai.top[1];let{from:mc}=pc[0];this.stacks=[Stack.start(this,Ai.top[0],mc)],this.fragments=Ra.length&&this.stream.end-mc>Ai.bufferLength*4?new FragmentCursor(Ra,Ai.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let Ai=this.stacks,bo=this.minStackPos,Ra=this.stacks=[],pc,mc;if(this.bigReductionCount>300&&Ai.length==1){let[uf]=Ai;for(;uf.forceReduce()&&uf.stack.length&&uf.stack[uf.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let uf=0;uf<Ai.length;uf++){let df=Ai[uf];for(;;){if(this.tokens.mainToken=null,df.pos>bo)Ra.push(df);else{if(this.advanceStack(df,Ra,Ai))continue;{pc||(pc=[],mc=[]),pc.push(df);let ff=this.tokens.getMainToken(df);mc.push(ff.value,ff.end)}}break}}if(!Ra.length){let uf=pc&&findFinished(pc);if(uf)return verbose&&console.log("Finish with "+this.stackID(uf)),this.stackToTree(uf);if(this.parser.strict)throw verbose&&pc&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+bo);this.recovering||(this.recovering=5)}if(this.recovering&&pc){let uf=this.stoppedAt!=null&&pc[0].pos>this.stoppedAt?pc[0]:this.runRecovery(pc,mc,Ra);if(uf)return verbose&&console.log("Force-finish "+this.stackID(uf)),this.stackToTree(uf.forceAll())}if(this.recovering){let uf=this.recovering==1?1:this.recovering*3;if(Ra.length>uf)for(Ra.sort((df,ff)=>ff.score-df.score);Ra.length>uf;)Ra.pop();Ra.some(df=>df.reducePos>bo)&&this.recovering--}else if(Ra.length>1){e:for(let uf=0;uf<Ra.length-1;uf++){let df=Ra[uf];for(let ff=uf+1;ff<Ra.length;ff++){let hf=Ra[ff];if(df.sameState(hf)||df.buffer.length>500&&hf.buffer.length>500)if((df.score-hf.score||df.buffer.length-hf.buffer.length)>0)Ra.splice(ff--,1);else{Ra.splice(uf--,1);continue e}}}Ra.length>12&&Ra.splice(12,Ra.length-12)}this.minStackPos=Ra[0].pos;for(let uf=1;uf<Ra.length;uf++)Ra[uf].pos<this.minStackPos&&(this.minStackPos=Ra[uf].pos);return null}stopAt(Ai){if(this.stoppedAt!=null&&this.stoppedAt<Ai)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=Ai}advanceStack(Ai,bo,Ra){let pc=Ai.pos,{parser:mc}=this,uf=verbose?this.stackID(Ai)+" -> ":"";if(this.stoppedAt!=null&&pc>this.stoppedAt)return Ai.forceReduce()?Ai:null;if(this.fragments){let hf=Ai.curContext&&Ai.curContext.tracker.strict,pf=hf?Ai.curContext.hash:0;for(let mf=this.fragments.nodeAt(pc);mf;){let gf=this.parser.nodeSet.types[mf.type.id]==mf.type?mc.getGoto(Ai.state,mf.type.id):-1;if(gf>-1&&mf.length&&(!hf||(mf.prop(NodeProp.contextHash)||0)==pf))return Ai.useNode(mf,gf),verbose&&console.log(uf+this.stackID(Ai)+` (via reuse of ${mc.getName(mf.type.id)})`),!0;if(!(mf instanceof Tree)||mf.children.length==0||mf.positions[0]>0)break;let yf=mf.children[0];if(yf instanceof Tree&&mf.positions[0]==0)mf=yf;else break}}let df=mc.stateSlot(Ai.state,4);if(df>0)return Ai.reduce(df),verbose&&console.log(uf+this.stackID(Ai)+` (via always-reduce ${mc.getName(df&65535)})`),!0;if(Ai.stack.length>=8400)for(;Ai.stack.length>6e3&&Ai.forceReduce(););let ff=this.tokens.getActions(Ai);for(let hf=0;hf<ff.length;){let pf=ff[hf++],mf=ff[hf++],gf=ff[hf++],yf=hf==ff.length||!Ra,vf=yf?Ai:Ai.split(),bf=this.tokens.mainToken;if(vf.apply(pf,mf,bf?bf.start:vf.pos,gf),verbose&&console.log(uf+this.stackID(vf)+` (via ${pf&65536?`reduce of ${mc.getName(pf&65535)}`:"shift"} for ${mc.getName(mf)} @ ${pc}${vf==Ai?"":", split"})`),yf)return!0;vf.pos>pc?bo.push(vf):Ra.push(vf)}return!1}advanceFully(Ai,bo){let Ra=Ai.pos;for(;;){if(!this.advanceStack(Ai,null,null))return!1;if(Ai.pos>Ra)return pushStackDedup(Ai,bo),!0}}runRecovery(Ai,bo,Ra){let pc=null,mc=!1;for(let uf=0;uf<Ai.length;uf++){let df=Ai[uf],ff=bo[uf<<1],hf=bo[(uf<<1)+1],pf=verbose?this.stackID(df)+" -> ":"";if(df.deadEnd&&(mc||(mc=!0,df.restart(),verbose&&console.log(pf+this.stackID(df)+" (restarted)"),this.advanceFully(df,Ra))))continue;let mf=df.split(),gf=pf;for(let yf=0;mf.forceReduce()&&yf<10&&(verbose&&console.log(gf+this.stackID(mf)+" (via force-reduce)"),!this.advanceFully(mf,Ra));yf++)verbose&&(gf=this.stackID(mf)+" -> ");for(let yf of df.recoverByInsert(ff))verbose&&console.log(pf+this.stackID(yf)+" (via recover-insert)"),this.advanceFully(yf,Ra);this.stream.end>df.pos?(hf==df.pos&&(hf++,ff=0),df.recoverByDelete(ff,hf),verbose&&console.log(pf+this.stackID(df)+` (via recover-delete ${this.parser.getName(ff)})`),pushStackDedup(df,Ra)):(!pc||pc.score<df.score)&&(pc=df)}return pc}stackToTree(Ai){return Ai.close(),Tree.build({buffer:StackBufferCursor.create(Ai),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:Ai.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(Ai){let bo=(stackIDs||(stackIDs=new WeakMap)).get(Ai);return bo||stackIDs.set(Ai,bo=String.fromCodePoint(this.nextStackID++)),bo+Ai}}function pushStackDedup(vo,Ai){for(let bo=0;bo<Ai.length;bo++){let Ra=Ai[bo];if(Ra.pos==vo.pos&&Ra.sameState(vo)){Ai[bo].score<vo.score&&(Ai[bo]=vo);return}}Ai.push(vo)}class Dialect{constructor(Ai,bo,Ra){this.source=Ai,this.flags=bo,this.disabled=Ra}allows(Ai){return!this.disabled||this.disabled[Ai]==0}}class LRParser extends Parser{constructor(Ai){if(super(),this.wrappers=[],Ai.version!=14)throw new RangeError(`Parser version (${Ai.version}) doesn't match runtime version (14)`);let bo=Ai.nodeNames.split(" ");this.minRepeatTerm=bo.length;for(let df=0;df<Ai.repeatNodeCount;df++)bo.push("");let Ra=Object.keys(Ai.topRules).map(df=>Ai.topRules[df][1]),pc=[];for(let df=0;df<bo.length;df++)pc.push([]);function mc(df,ff,hf){pc[df].push([ff,ff.deserialize(String(hf))])}if(Ai.nodeProps)for(let df of Ai.nodeProps){let ff=df[0];typeof ff=="string"&&(ff=NodeProp[ff]);for(let hf=1;hf<df.length;){let pf=df[hf++];if(pf>=0)mc(pf,ff,df[hf++]);else{let mf=df[hf+-pf];for(let gf=-pf;gf>0;gf--)mc(df[hf++],ff,mf);hf++}}}this.nodeSet=new NodeSet(bo.map((df,ff)=>NodeType.define({name:ff>=this.minRepeatTerm?void 0:df,id:ff,props:pc[ff],top:Ra.indexOf(ff)>-1,error:ff==0,skipped:Ai.skippedNodes&&Ai.skippedNodes.indexOf(ff)>-1}))),Ai.propSources&&(this.nodeSet=this.nodeSet.extend(...Ai.propSources)),this.strict=!1,this.bufferLength=DefaultBufferLength;let uf=decodeArray(Ai.tokenData);this.context=Ai.context,this.specializerSpecs=Ai.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let df=0;df<this.specializerSpecs.length;df++)this.specialized[df]=this.specializerSpecs[df].term;this.specializers=this.specializerSpecs.map(getSpecializer),this.states=decodeArray(Ai.states,Uint32Array),this.data=decodeArray(Ai.stateData),this.goto=decodeArray(Ai.goto),this.maxTerm=Ai.maxTerm,this.tokenizers=Ai.tokenizers.map(df=>typeof df=="number"?new TokenGroup(uf,df):df),this.topRules=Ai.topRules,this.dialects=Ai.dialects||{},this.dynamicPrecedences=Ai.dynamicPrecedences||null,this.tokenPrecTable=Ai.tokenPrec,this.termNames=Ai.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(Ai,bo,Ra){let pc=new Parse(this,Ai,bo,Ra);for(let mc of this.wrappers)pc=mc(pc,Ai,bo,Ra);return pc}getGoto(Ai,bo,Ra=!1){let pc=this.goto;if(bo>=pc[0])return-1;for(let mc=pc[bo+1];;){let uf=pc[mc++],df=uf&1,ff=pc[mc++];if(df&&Ra)return ff;for(let hf=mc+(uf>>1);mc<hf;mc++)if(pc[mc]==Ai)return ff;if(df)return-1}}hasAction(Ai,bo){let Ra=this.data;for(let pc=0;pc<2;pc++)for(let mc=this.stateSlot(Ai,pc?2:1),uf;;mc+=3){if((uf=Ra[mc])==65535)if(Ra[mc+1]==1)uf=Ra[mc=pair(Ra,mc+2)];else{if(Ra[mc+1]==2)return pair(Ra,mc+2);break}if(uf==bo||uf==0)return pair(Ra,mc+1)}return 0}stateSlot(Ai,bo){return this.states[Ai*6+bo]}stateFlag(Ai,bo){return(this.stateSlot(Ai,0)&bo)>0}validAction(Ai,bo){return!!this.allActions(Ai,Ra=>Ra==bo?!0:null)}allActions(Ai,bo){let Ra=this.stateSlot(Ai,4),pc=Ra?bo(Ra):void 0;for(let mc=this.stateSlot(Ai,1);pc==null;mc+=3){if(this.data[mc]==65535)if(this.data[mc+1]==1)mc=pair(this.data,mc+2);else break;pc=bo(pair(this.data,mc+1))}return pc}nextStates(Ai){let bo=[];for(let Ra=this.stateSlot(Ai,1);;Ra+=3){if(this.data[Ra]==65535)if(this.data[Ra+1]==1)Ra=pair(this.data,Ra+2);else break;if(!(this.data[Ra+2]&1)){let pc=this.data[Ra+1];bo.some((mc,uf)=>uf&1&&mc==pc)||bo.push(this.data[Ra],pc)}}return bo}configure(Ai){let bo=Object.assign(Object.create(LRParser.prototype),this);if(Ai.props&&(bo.nodeSet=this.nodeSet.extend(...Ai.props)),Ai.top){let Ra=this.topRules[Ai.top];if(!Ra)throw new RangeError(`Invalid top rule name ${Ai.top}`);bo.top=Ra}return Ai.tokenizers&&(bo.tokenizers=this.tokenizers.map(Ra=>{let pc=Ai.tokenizers.find(mc=>mc.from==Ra);return pc?pc.to:Ra})),Ai.specializers&&(bo.specializers=this.specializers.slice(),bo.specializerSpecs=this.specializerSpecs.map((Ra,pc)=>{let mc=Ai.specializers.find(df=>df.from==Ra.external);if(!mc)return Ra;let uf=Object.assign(Object.assign({},Ra),{external:mc.to});return bo.specializers[pc]=getSpecializer(uf),uf})),Ai.contextTracker&&(bo.context=Ai.contextTracker),Ai.dialect&&(bo.dialect=this.parseDialect(Ai.dialect)),Ai.strict!=null&&(bo.strict=Ai.strict),Ai.wrap&&(bo.wrappers=bo.wrappers.concat(Ai.wrap)),Ai.bufferLength!=null&&(bo.bufferLength=Ai.bufferLength),bo}hasWrappers(){return this.wrappers.length>0}getName(Ai){return this.termNames?this.termNames[Ai]:String(Ai<=this.maxNode&&this.nodeSet.types[Ai].name||Ai)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(Ai){let bo=this.dynamicPrecedences;return bo==null?0:bo[Ai]||0}parseDialect(Ai){let bo=Object.keys(this.dialects),Ra=bo.map(()=>!1);if(Ai)for(let mc of Ai.split(" ")){let uf=bo.indexOf(mc);uf>=0&&(Ra[uf]=!0)}let pc=null;for(let mc=0;mc<bo.length;mc++)if(!Ra[mc])for(let uf=this.dialects[bo[mc]],df;(df=this.data[uf++])!=65535;)(pc||(pc=new Uint8Array(this.maxTerm+1)))[df]=1;return new Dialect(Ai,Ra,pc)}static deserialize(Ai){return new LRParser(Ai)}}function pair(vo,Ai){return vo[Ai]|vo[Ai+1]<<16}function findFinished(vo){let Ai=null;for(let bo of vo){let Ra=bo.p.stoppedAt;(bo.pos==bo.p.stream.end||Ra!=null&&bo.pos>Ra)&&bo.p.parser.stateFlag(bo.state,2)&&(!Ai||Ai.score<bo.score)&&(Ai=bo)}return Ai}function getSpecializer(vo){if(vo.external){let Ai=vo.extend?1:0;return(bo,Ra)=>vo.external(bo,Ra)<<1|Ai}return vo.get}function crelt(){var vo=arguments[0];typeof vo=="string"&&(vo=document.createElement(vo));var Ai=1,bo=arguments[1];if(bo&&typeof bo=="object"&&bo.nodeType==null&&!Array.isArray(bo)){for(var Ra in bo)if(Object.prototype.hasOwnProperty.call(bo,Ra)){var pc=bo[Ra];typeof pc=="string"?vo.setAttribute(Ra,pc):pc!=null&&(vo[Ra]=pc)}Ai++}for(;Ai<arguments.length;Ai++)add(vo,arguments[Ai]);return vo}function add(vo,Ai){if(typeof Ai=="string")vo.appendChild(document.createTextNode(Ai));else if(Ai!=null)if(Ai.nodeType!=null)vo.appendChild(Ai);else if(Array.isArray(Ai))for(var bo=0;bo<Ai.length;bo++)add(vo,Ai[bo]);else throw new RangeError("Unsupported child node: "+Ai)}class SelectedDiagnostic{constructor(Ai,bo,Ra){this.from=Ai,this.to=bo,this.diagnostic=Ra}}class LintState{constructor(Ai,bo,Ra){this.diagnostics=Ai,this.panel=bo,this.selected=Ra}static init(Ai,bo,Ra){let pc=Ai,mc=Ra.facet(lintConfig).markerFilter;mc&&(pc=mc(pc,Ra));let uf=Ai.slice().sort((mf,gf)=>mf.from-gf.from||mf.to-gf.to),df=new RangeSetBuilder,ff=[],hf=0;for(let mf=0;;){let gf=mf==uf.length?null:uf[mf];if(!gf&&!ff.length)break;let yf,vf;for(ff.length?(yf=hf,vf=ff.reduce((Sf,xf)=>Math.min(Sf,xf.to),gf&&gf.from>yf?gf.from:1e8)):(yf=gf.from,vf=gf.to,ff.push(gf),mf++);mf<uf.length;){let Sf=uf[mf];if(Sf.from==yf&&(Sf.to>Sf.from||Sf.to==yf))ff.push(Sf),mf++,vf=Math.min(Sf.to,vf);else{vf=Math.min(Sf.from,vf);break}}let bf=maxSeverity(ff);if(ff.some(Sf=>Sf.from==Sf.to||Sf.from==Sf.to-1&&Ra.doc.lineAt(Sf.from).to==Sf.from))df.add(yf,yf,Decoration.widget({widget:new DiagnosticWidget(bf),diagnostics:ff.slice()}));else{let Sf=ff.reduce((xf,wf)=>wf.markClass?xf+" "+wf.markClass:xf,"");df.add(yf,vf,Decoration.mark({class:"cm-lintRange cm-lintRange-"+bf+Sf,diagnostics:ff.slice(),inclusiveEnd:ff.some(xf=>xf.to>vf)}))}hf=vf;for(let Sf=0;Sf<ff.length;Sf++)ff[Sf].to<=hf&&ff.splice(Sf--,1)}let pf=df.finish();return new LintState(pf,bo,findDiagnostic(pf))}}function findDiagnostic(vo,Ai=null,bo=0){let Ra=null;return vo.between(bo,1e9,(pc,mc,{spec:uf})=>{if(!(Ai&&uf.diagnostics.indexOf(Ai)<0))if(!Ra)Ra=new SelectedDiagnostic(pc,mc,Ai||uf.diagnostics[0]);else{if(uf.diagnostics.indexOf(Ra.diagnostic)<0)return!1;Ra=new SelectedDiagnostic(Ra.from,mc,Ra.diagnostic)}}),Ra}function hideTooltip(vo,Ai){let bo=Ai.pos,Ra=Ai.end||bo,pc=vo.state.facet(lintConfig).hideOn(vo,bo,Ra);if(pc!=null)return pc;let mc=vo.startState.doc.lineAt(Ai.pos);return!!(vo.effects.some(uf=>uf.is(setDiagnosticsEffect))||vo.changes.touchesRange(mc.from,Math.max(mc.to,Ra)))}function maybeEnableLint(vo,Ai){return vo.field(lintState,!1)?Ai:Ai.concat(StateEffect.appendConfig.of(lintExtensions))}function setDiagnostics(vo,Ai){return{effects:maybeEnableLint(vo,[setDiagnosticsEffect.of(Ai)])}}const setDiagnosticsEffect=StateEffect.define(),togglePanel$1=StateEffect.define(),movePanelSelection=StateEffect.define(),lintState=StateField.define({create(){return new LintState(Decoration.none,null,null)},update(vo,Ai){if(Ai.docChanged&&vo.diagnostics.size){let bo=vo.diagnostics.map(Ai.changes),Ra=null,pc=vo.panel;if(vo.selected){let mc=Ai.changes.mapPos(vo.selected.from,1);Ra=findDiagnostic(bo,vo.selected.diagnostic,mc)||findDiagnostic(bo,null,mc)}!bo.size&&pc&&Ai.state.facet(lintConfig).autoPanel&&(pc=null),vo=new LintState(bo,pc,Ra)}for(let bo of Ai.effects)if(bo.is(setDiagnosticsEffect)){let Ra=Ai.state.facet(lintConfig).autoPanel?bo.value.length?LintPanel.open:null:vo.panel;vo=LintState.init(bo.value,Ra,Ai.state)}else bo.is(togglePanel$1)?vo=new LintState(vo.diagnostics,bo.value?LintPanel.open:null,vo.selected):bo.is(movePanelSelection)&&(vo=new LintState(vo.diagnostics,vo.panel,bo.value));return vo},provide:vo=>[showPanel.from(vo,Ai=>Ai.panel),EditorView.decorations.from(vo,Ai=>Ai.diagnostics)]}),activeMark=Decoration.mark({class:"cm-lintRange cm-lintRange-active"});function lintTooltip(vo,Ai,bo){let{diagnostics:Ra}=vo.state.field(lintState),pc,mc=-1,uf=-1;Ra.between(Ai-(bo<0?1:0),Ai+(bo>0?1:0),(ff,hf,{spec:pf})=>{if(Ai>=ff&&Ai<=hf&&(ff==hf||(Ai>ff||bo>0)&&(Ai<hf||bo<0)))return pc=pf.diagnostics,mc=ff,uf=hf,!1});let df=vo.state.facet(lintConfig).tooltipFilter;return pc&&df&&(pc=df(pc,vo.state)),pc?{pos:mc,end:uf,above:vo.state.doc.lineAt(mc).to<uf,create(){return{dom:diagnosticsTooltip(vo,pc)}}}:null}function diagnosticsTooltip(vo,Ai){return crelt("ul",{class:"cm-tooltip-lint"},Ai.map(bo=>renderDiagnostic(vo,bo,!1)))}const openLintPanel=vo=>{let Ai=vo.state.field(lintState,!1);(!Ai||!Ai.panel)&&vo.dispatch({effects:maybeEnableLint(vo.state,[togglePanel$1.of(!0)])});let bo=getPanel(vo,LintPanel.open);return bo&&bo.dom.querySelector(".cm-panel-lint ul").focus(),!0},closeLintPanel=vo=>{let Ai=vo.state.field(lintState,!1);return!Ai||!Ai.panel?!1:(vo.dispatch({effects:togglePanel$1.of(!1)}),!0)},nextDiagnostic=vo=>{let Ai=vo.state.field(lintState,!1);if(!Ai)return!1;let bo=vo.state.selection.main,Ra=Ai.diagnostics.iter(bo.to+1);return!Ra.value&&(Ra=Ai.diagnostics.iter(0),!Ra.value||Ra.from==bo.from&&Ra.to==bo.to)?!1:(vo.dispatch({selection:{anchor:Ra.from,head:Ra.to},scrollIntoView:!0}),!0)},lintKeymap=[{key:"Mod-Shift-m",run:openLintPanel,preventDefault:!0},{key:"F8",run:nextDiagnostic}],lintPlugin=ViewPlugin.fromClass(class{constructor(vo){this.view=vo,this.timeout=-1,this.set=!0;let{delay:Ai}=vo.state.facet(lintConfig);this.lintTime=Date.now()+Ai,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,Ai)}run(){clearTimeout(this.timeout);let vo=Date.now();if(vo<this.lintTime-10)this.timeout=setTimeout(this.run,this.lintTime-vo);else{this.set=!1;let{state:Ai}=this.view,{sources:bo}=Ai.facet(lintConfig);bo.length&&batchResults(bo.map(Ra=>Promise.resolve(Ra(this.view))),Ra=>{this.view.state.doc==Ai.doc&&this.view.dispatch(setDiagnostics(this.view.state,Ra.reduce((pc,mc)=>pc.concat(mc))))},Ra=>{logException(this.view.state,Ra)})}}update(vo){let Ai=vo.state.facet(lintConfig);(vo.docChanged||Ai!=vo.startState.facet(lintConfig)||Ai.needsRefresh&&Ai.needsRefresh(vo))&&(this.lintTime=Date.now()+Ai.delay,this.set||(this.set=!0,this.timeout=setTimeout(this.run,Ai.delay)))}force(){this.set&&(this.lintTime=Date.now(),this.run())}destroy(){clearTimeout(this.timeout)}});function batchResults(vo,Ai,bo){let Ra=[],pc=-1;for(let mc of vo)mc.then(uf=>{Ra.push(uf),clearTimeout(pc),Ra.length==vo.length?Ai(Ra):pc=setTimeout(()=>Ai(Ra),200)},bo)}const lintConfig=Facet.define({combine(vo){return Object.assign({sources:vo.map(Ai=>Ai.source).filter(Ai=>Ai!=null)},combineConfig(vo.map(Ai=>Ai.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{needsRefresh:(Ai,bo)=>Ai?bo?Ra=>Ai(Ra)||bo(Ra):Ai:bo}))}});function linter(vo,Ai={}){return[lintConfig.of({source:vo,config:Ai}),lintPlugin,lintExtensions]}function forceLinting(vo){let Ai=vo.plugin(lintPlugin);Ai&&Ai.force()}function assignKeys(vo){let Ai=[];if(vo)e:for(let{name:bo}of vo){for(let Ra=0;Ra<bo.length;Ra++){let pc=bo[Ra];if(/[a-zA-Z]/.test(pc)&&!Ai.some(mc=>mc.toLowerCase()==pc.toLowerCase())){Ai.push(pc);continue e}}Ai.push("")}return Ai}function renderDiagnostic(vo,Ai,bo){var Ra;let pc=bo?assignKeys(Ai.actions):[];return crelt("li",{class:"cm-diagnostic cm-diagnostic-"+Ai.severity},crelt("span",{class:"cm-diagnosticText"},Ai.renderMessage?Ai.renderMessage(vo):Ai.message),(Ra=Ai.actions)===null||Ra===void 0?void 0:Ra.map((mc,uf)=>{let df=!1,ff=gf=>{if(gf.preventDefault(),df)return;df=!0;let yf=findDiagnostic(vo.state.field(lintState).diagnostics,Ai);yf&&mc.apply(vo,yf.from,yf.to)},{name:hf}=mc,pf=pc[uf]?hf.indexOf(pc[uf]):-1,mf=pf<0?hf:[hf.slice(0,pf),crelt("u",hf.slice(pf,pf+1)),hf.slice(pf+1)];return crelt("button",{type:"button",class:"cm-diagnosticAction",onclick:ff,onmousedown:ff,"aria-label":` Action: ${hf}${pf<0?"":` (access key "${pc[uf]})"`}.`},mf)}),Ai.source&&crelt("div",{class:"cm-diagnosticSource"},Ai.source))}class DiagnosticWidget extends WidgetType{constructor(Ai){super(),this.sev=Ai}eq(Ai){return Ai.sev==this.sev}toDOM(){return crelt("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class PanelItem{constructor(Ai,bo){this.diagnostic=bo,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=renderDiagnostic(Ai,bo,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class LintPanel{constructor(Ai){this.view=Ai,this.items=[];let bo=pc=>{if(pc.keyCode==27)closeLintPanel(this.view),this.view.focus();else if(pc.keyCode==38||pc.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(pc.keyCode==40||pc.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(pc.keyCode==36)this.moveSelection(0);else if(pc.keyCode==35)this.moveSelection(this.items.length-1);else if(pc.keyCode==13)this.view.focus();else if(pc.keyCode>=65&&pc.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:mc}=this.items[this.selectedIndex],uf=assignKeys(mc.actions);for(let df=0;df<uf.length;df++)if(uf[df].toUpperCase().charCodeAt(0)==pc.keyCode){let ff=findDiagnostic(this.view.state.field(lintState).diagnostics,mc);ff&&mc.actions[df].apply(Ai,ff.from,ff.to)}}else return;pc.preventDefault()},Ra=pc=>{for(let mc=0;mc<this.items.length;mc++)this.items[mc].dom.contains(pc.target)&&this.moveSelection(mc)};this.list=crelt("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:bo,onclick:Ra}),this.dom=crelt("div",{class:"cm-panel-lint"},this.list,crelt("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>closeLintPanel(this.view)},"×")),this.update()}get selectedIndex(){let Ai=this.view.state.field(lintState).selected;if(!Ai)return-1;for(let bo=0;bo<this.items.length;bo++)if(this.items[bo].diagnostic==Ai.diagnostic)return bo;return-1}update(){let{diagnostics:Ai,selected:bo}=this.view.state.field(lintState),Ra=0,pc=!1,mc=null,uf=new Set;for(Ai.between(0,this.view.state.doc.length,(df,ff,{spec:hf})=>{for(let pf of hf.diagnostics){if(uf.has(pf))continue;uf.add(pf);let mf=-1,gf;for(let yf=Ra;yf<this.items.length;yf++)if(this.items[yf].diagnostic==pf){mf=yf;break}mf<0?(gf=new PanelItem(this.view,pf),this.items.splice(Ra,0,gf),pc=!0):(gf=this.items[mf],mf>Ra&&(this.items.splice(Ra,mf-Ra),pc=!0)),bo&&gf.diagnostic==bo.diagnostic?gf.dom.hasAttribute("aria-selected")||(gf.dom.setAttribute("aria-selected","true"),mc=gf):gf.dom.hasAttribute("aria-selected")&&gf.dom.removeAttribute("aria-selected"),Ra++}});Ra<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)pc=!0,this.items.pop();this.items.length==0&&(this.items.push(new PanelItem(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),pc=!0),mc?(this.list.setAttribute("aria-activedescendant",mc.id),this.view.requestMeasure({key:this,read:()=>({sel:mc.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:df,panel:ff})=>{let hf=ff.height/this.list.offsetHeight;df.top<ff.top?this.list.scrollTop-=(ff.top-df.top)/hf:df.bottom>ff.bottom&&(this.list.scrollTop+=(df.bottom-ff.bottom)/hf)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),pc&&this.sync()}sync(){let Ai=this.list.firstChild;function bo(){let Ra=Ai;Ai=Ra.nextSibling,Ra.remove()}for(let Ra of this.items)if(Ra.dom.parentNode==this.list){for(;Ai!=Ra.dom;)bo();Ai=Ra.dom.nextSibling}else this.list.insertBefore(Ra.dom,Ai);for(;Ai;)bo()}moveSelection(Ai){if(this.selectedIndex<0)return;let bo=this.view.state.field(lintState),Ra=findDiagnostic(bo.diagnostics,this.items[Ai].diagnostic);Ra&&this.view.dispatch({selection:{anchor:Ra.from,head:Ra.to},scrollIntoView:!0,effects:movePanelSelection.of(Ra)})}static open(Ai){return new LintPanel(Ai)}}function svg(vo,Ai='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${Ai}>${encodeURIComponent(vo)}</svg>')`}function underline(vo){return svg(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${vo}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const baseTheme$3=EditorView.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:underline("#d11")},".cm-lintRange-warning":{backgroundImage:underline("orange")},".cm-lintRange-info":{backgroundImage:underline("#999")},".cm-lintRange-hint":{backgroundImage:underline("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function severityWeight(vo){return vo=="error"?4:vo=="warning"?3:vo=="info"?2:1}function maxSeverity(vo){let Ai="hint",bo=1;for(let Ra of vo){let pc=severityWeight(Ra.severity);pc>bo&&(bo=pc,Ai=Ra.severity)}return Ai}const lintExtensions=[lintState,EditorView.decorations.compute([lintState],vo=>{let{selected:Ai,panel:bo}=vo.field(lintState);return!Ai||!bo||Ai.from==Ai.to?Decoration.none:Decoration.set([activeMark.range(Ai.from,Ai.to)])}),hoverTooltip(lintTooltip,{hideOn:hideTooltip}),baseTheme$3];function posToOffset(vo,Ai){return vo.line(Ai.line+1).from+Ai.character}function offsetToPos(vo,Ai){const bo=vo.lineAt(Ai);return new Position(bo.number-1,Ai-bo.from)}class Position{constructor(Ai,bo){this.line=Ai,this.character=bo}setLine(Ai){this.line=Ai}setCharacter(Ai){this.character=Ai}lessThanOrEqualTo(Ai){return this.line<Ai.line||this.line===Ai.line&&this.character<=Ai.character}}const isMac=()=>navigator.userAgent.includes("Mac"),isMetaKeyPressed=vo=>isMac()?vo.metaKey:vo.ctrlKey,schemaEffect=StateEffect.define(),schemaStateField=StateField.define({create(){},update(vo,Ai){for(const bo of Ai.effects)if(bo.is(schemaEffect))return bo.value;return vo}}),optionsEffect=StateEffect.define(),optionsStateField=StateField.define({create(){},update(vo,Ai){for(const bo of Ai.effects)if(bo.is(optionsEffect))return bo.value;return vo}}),getSchema=vo=>vo.field(schemaStateField),getOpts=vo=>vo.field(optionsStateField),defaultOpts={showErrorOnInvalidSchema:!0},stateExtensions=(vo,Ai)=>[schemaStateField.init(()=>vo),optionsStateField.init(()=>Object.assign(Object.assign({},defaultOpts),Ai))],spec_name={__proto__:null,query:241,mutation:243,subscription:245,on:86,fragment:92,schema:102,scalar:114,type:120,implements:126,interface:140,union:146,enum:154,input:164,directive:172,repeatable:176,extend:192},parser$1=LRParser.deserialize({version:14,states:"LWOYQPOOO!WQPO'#C}O!`QPO'#C_OOQO'#C_'#C_O!iQPO'#DYOOQO'#Ev'#EvOOQO'#D_'#D_O!nQPO'#D^O#_QPO'#D^O!iQPO'#DhO!iQPO'#DrO!iQPO'#DuO!iQPO'#DyO!iQPO'#EOOOQO'#Dd'#DdO#fQPO'#ESOOQO'#D]'#D]O!vQPO'#E^OOQO'#Ea'#EaOOQO'#E]'#E]OOQO'#FT'#FTOOQO'#Eu'#EuOOQO'#Eh'#EhQYQPOOOOQO'#C`'#C`OOQO'#DZ'#DZOOQO'#D`'#D`OOQO'#Di'#DiOOQO'#Ds'#DsOOQO'#Dv'#DvOOQO'#Dz'#DzOOQO'#EP'#EPOOQO'#ET'#ETOOQO'#E_'#E_O#kQPO'#CaO$VQPO'#DQO$[QPO'#DPO$sQPO'#DPO$xQPO'#DSO%WQPO'#DOOOQO'#En'#EnO%fQPO,59iOOQO'#Ca'#CaO%qQPO'#CxOOQO'#El'#ElO'hQPO'#CwO)[QPO'#CdOOQO,58y,58yO)aQPO,58yO)fQPO,58yO)nQPO,58yOOQO'#DT'#DTO)yQPO,59tO{QPO'#FUOOQO'#Db'#DbOOQO,59x,59xO*OQPO,59xO!nQPO,59xO!iQPO,5:PO!iQPO,5:SO!iQPO,5:^O!iQPO,5:aO!iQPO,5:eO!iQPO,5:jO*TQPO,5:nOOQO'#Df'#DfO*YQPO,5:SO+aQPO,5:^O,hQPO,5:aO-oQPO,5:eO.sQPO,5:jO/wQPO,5:nO!nQPO,5:xO!iQPO,5:|O!iQPO,5:}O!iQPO,5;OO!iQPO,5;PO!iQPO,5;QO!iQPO,5;ROOQO-E8f-E8fOOQO,59l,59lO0VQPO'#CzOOQO,59k,59kO0[QPO,59kO0mQPO,59kOOQO'#DR'#DRO0tQPO,59kO1OQPO,59nO!iQPO'#DVOOQO,59p,59pO)aQPO,59pO)fQPO,59pOOQO'#DW'#DWOOQO,59j,59jOOQO-E8l-E8lOOQO1G/T1G/TOOQO,59d,59dOOQO-E8j-E8jO1aQPO'#CeOOQO'#Ei'#EiO1fQPO,59OOOQO1G.e1G.eO)aQPO1G.eO)fQPO1G.eO)fQPO1G/`O1nQPO'#DcO1sQPO,5;pOOQO1G/d1G/dO*OQPO1G/dO1xQPO1G/kO4QQPO1G/nO5]QPO1G/xO6hQPO1G/{O7pQPO1G0PO8xQPO1G0UO/wQPO1G0YO9PQPO1G/nO9WQPO'#DkO9`QPO'#FWOOQO'#Dn'#DnOOQO1G/n1G/nO9hQPO1G/nOOQO'#Dl'#DlO:iQPO1G/xOOQO1G/x1G/xO:pQPO1G/xO;qQPO1G/{O;xQPO'#DxO5dQPO1G/{O<QQQO'#FYOOQO'#D|'#D|OOQO1G0P1G0PO6oQPO1G0PO9`QPO'#FZOOQO'#ER'#EROOQO1G0U1G0UO7wQPO1G0UO<YQPO'#DqO!iQPO'#DqOOQO'#Ep'#EpO<_QPO'#DpO<pQSO1G0YO)yQPO1G0YO>QQPO1G0YOOQO'#EV'#EVOOQO1G0d1G0dO>YQPO1G0dO!qQPO1G0hO?ZQPO1G0iO?ZQPO1G0jO?fQPO1G0kO?nQPO1G0lO?vQPO1G0mOOQO'#C|'#C|O@OQPO'#C{OOQO'#Em'#EmO@TQPO,59fOOQO1G/V1G/VO@]QPO1G/VO@nQPO1G/VOOQO1G/Y1G/YOOQO'#Cg'#CgOOQO,59q,59qOOQO1G/[1G/[O)aQPO1G/[O@uQPO,59POOQO-E8g-E8gOOQO1G.j1G.jOOQO7+$P7+$PO)aQPO7+$POOQO7+$z7+$zO)aQPO7+$zO!iQPO,59}OOQO1G1[1G1[OOQO7+%O7+%OOOQO7+%V7+%VOBOQPO7+%YOOQO7+%Y7+%YO@}QPO7+%YOCZQPO7+%dOOQO7+%d7+%dOBYQPO7+%dODfQPO7+%gODmQPO7+%gOOQO7+%k7+%kODtQPO7+%kOOQO7+%p7+%pOEuQPO7+%pO<pQSO7+%tO)yQPO7+%tO>QQPO7+%tO!iQPO,5:VOOQO,5:V,5:VOFvQPO'#DoO!iQPO'#DoOOQO'#Eo'#EoOGRQPO,5;rO!iQPO,5:dOOQO,5:d,5:dOG^QQO'#D}OGlQQO'#D}OOQO'#Eq'#EqOGqQQO,5;tOG|QPO,5;uO@uQPO,5:]OHXQPO,5:]OOQO-E8n-E8nOOQO'#EZ'#EZOOQO'#E['#E[OOQO'#EY'#EYOH^QPO7+%tOOQO'#EX'#EXO<sQSO'#EXOOQO7+&O7+&OOOQO7+&S7+&SOJcQPO7+&TOOQO7+&T7+&TOIbQPO7+&TOKnQPO7+&UOOQO7+&U7+&UOJmQPO7+&UOLyQPO7+&VOMQQPO7+&VOOQO7+&W7+&WOMXQPO7+&WOOQO7+&X7+&XONYQPO7+&XO! ZQQO,59gOOQO-E8k-E8kOOQO1G/Q1G/QOOQO7+$q7+$qO! xQPO7+$qOOQO7+$v7+$vO@uQPO'#CjO!!ZQPO'#E|OOQO'#E|'#E|O!#UQPO1G.kOOQO<<Gk<<GkOOQO<<Hf<<HfOOQO1G/i1G/iOOQO<<Ht<<HtO!#gQPO<<HtOOQO<<IO<<IOO!$hQPO<<IOO!%iQPO<<IROOQO<<IV<<IVOOQO<<I[<<I[O!&mQPO<<I`O<pQSO<<I`O)yQPO<<I`OOQO1G/q1G/qO@uQPO,5:ZO!'qQPO,5:ZO!'vQPO,5:ZOOQO-E8m-E8mOOQO1G1^1G1^OOQO1G0O1G0OO!(RQQO'#CxO!(dQQO'#CwOOQO,5:i,5:iO!(rQQO,5:iOOQO-E8o-E8oOOQO1G1`1G1`OOQO1G1a1G1aO!)QQPO1G/wO@uQPO1G/wO<sQSO,5:sOOQO,5:s,5:sOOQO<<Io<<IoO!)lQPO<<IoOOQO<<Ip<<IpO!*mQPO<<IpO!+nQPO<<IqOOQO<<Ir<<IrOOQO<<Is<<IsO!,rQQO'#CsO!,yQPO'#CvOOQO'#FP'#FPO!-RQPO1G/ROOQO<<H]<<H]O!-^QPO,59UOOQO,59V,59VO! ZQQO'#ClOOQO7+$V7+$VO!-cQPO7+$VO!-nQPO7+$VOOQOAN>`AN>`OOQOAN>jAN>jO!-|QPOAN>zO<pQSOAN>zO!/QQPO1G/uO@uQPO1G/uO!/`QPO1G/uOOQO1G0T1G0TOOQO7+%c7+%cO!/eQPO7+%cO!/|QPO7+%cOOQO1G0_1G0_OOQOAN?ZAN?ZOOQOAN?[AN?[O!0TQQO'#EjO!0xQQO,59_OOQO,59_,59_O!1PQPO'#FROOQO'#Ek'#EkO!1UQPO,59bOOQO,59b,59bOOQO7+$m7+$mOOQO1G.p1G.pOOQO,59W,59WOOQO<<Gq<<GqO!1^QPO<<GqO!1iQPOG24fOOQO7+%a7+%aO!2mQPO7+%aO@uQPO7+%aOOQO<<H}<<H}O!2{QPO<<H}OOQO,5;U,5;UOOQO-E8h-E8hOOQO1G.y1G.yO! ZQQO,5;mOOQO-E8i-E8iOOQO1G.|1G.|OOQOAN=]AN=]OOQO<<H{<<H{O!3dQPO<<H{OOQOAN>iAN>iO!3rQPO1G1XOOQOAN>gAN>gOOQO7+&s7+&s",stateData:"!4S~O#hOSPOS~OcUOiPO!OiO!TjO!^kO!hlO!kmO!onO!toO!xpO#SqO#lhO#mhO#nhO~O#krO#vvO~OV!OOiPOm{O#kzO~Oi!VOm{O~O!TjO!Z!cO!^kO!hlO!kmO!onO!toO~O!xpO~P!vOm!iO~OVuXhuXiuXmuX#kuX#oTX#tuX#vuX~O#o!rO~OV!sOiPOm{OhsX#ksX#tsX#vsX~O#k!wO~OiPOm{O{#OO#kzO~O#t#POhrX#krX#vrX~Oh#RO#krO#vvO~OV!sOilXmlXhlX#klX#tlX#vlXclX!OlX!TlX!^lX!hlX!klX!olX!tlX!xlX#SlX#flX#llX#mlX#nlX#rlXUlXYlX{lX!zlX#olX~Om{OikXhkX#kkX#tkX#vkXckX!OkX!TkX!^kX!hkX!kkX!okX!tkX!xkX#SkX#fkX#lkX#mkX#nkX#rkXUkXYkX{kX!zkX#okX~OY#UO~OiPO~OiPOm{O~OV!OOiPOm{O~O{#OO~Oi!VO~Om#gO~Oi#jOm{O!a#nOc![a!O![a!T![a!^![a!h![a!k![a!o![a!t![a!x![a#S![a#f![a#l![a#m![a#n![a~Oi#jOm{O!a#nOc!fa!O!fa!T!fa!^!fa!h!fa!k!fa!o!fa!t!fa!x!fa#S!fa#f!fa#l!fa#m!fa#n!fa~Om{O#r#sOc!iai!ia!O!ia!T!ia!^!ia!h!ia!k!ia!o!ia!t!ia!x!ia#S!ia#f!ia#l!ia#m!ia#n!ia~Oi#uOm{Oc!ma!O!ma!T!ma!^!ma!h!ma!k!ma!o!ma!t!ma!x!ma#S!ma#f!ma#l!ma#m!ma#n!ma~Oi#yOm{Oc!ra!O!ra!T!ra!^!ra!h!ra!k!ra!o!ra!t!ra!x!ra#S!ra#f!ra#l!ra#m!ra#n!ra~OcUO{#OO!z$UO#kzO~O#k$_O~OiPOhsa#ksa#tsa#vsa~Om{O~P0[OV!sOm{O~P0[Om{Ohva#kva#tva#vva~O#o$kO~OU$mOY#UO~O#o$rO~Oh$sO~Om{Oc!Xii!Xi!O!Xi!T!Xi!^!Xi!h!Xi!k!Xi!o!Xi!t!Xi!x!Xi#S!Xi#f!Xi#l!Xi#m!Xi#n!Xi~Oi#jOm{Oc![i!O![i!T![i!^![i!h![i!k![i!o![i!t![i!x![i#S![i#f![i#l![i#m![i#n![i~O!a#nO~P2|Oi#jOm{Oc!fi!O!fi!T!fi!^!fi!h!fi!k!fi!o!fi!t!fi!x!fi#S!fi#f!fi#l!fi#m!fi#n!fi~O!a#nO~P4XO#r#sOc!iii!ii!O!ii!T!ii!^!ii!h!ii!k!ii!o!ii!t!ii!x!ii#S!ii#f!ii#l!ii#m!ii#n!ii~Om{O~P5dOi#uOc!mi!O!mi!T!mi!^!mi!h!mi!k!mi!o!mi!t!mi!x!mi#S!mi#f!mi#l!mi#m!mi#n!mi~Om{O~P6oOi#yOc!ri!O!ri!T!ri!^!ri!h!ri!k!ri!o!ri!t!ri!x!ri#S!ri#f!ri#l!ri#m!ri#n!ri~Om{O~P7wO#y%VO~P2|O#kzO#y%VO~OcUO#kzO~Oi#jOc![i!O![i!T![i!^![i!h![i!k![i!o![i!t![i!x![i#S![i#f![i#l![i#m![i#n![i~O#y%VO~P4XOi#jOc!fi!O!fi!T!fi!^!fi!h!fi!k!fi!o!fi!t!fi!x!fi#S!fi#f!fi#l!fi#m!fi#n!fi~O#{%]O~P5gO#kzO#{%]O~OcUOf%_O~O#o%dO~OcUO#kzO{!dX!z!dX#o!dX~O#{%lO$O%gO$P%gO$Q%gO$R%gO$S%gO$T%gO$U%gO$V%gO$W%hO$X%hO$Y%hO$Z%hO$[%hO$]%hO$^%hO$_%hO$`%hO$a%hO$b%hO~O{#OO!z$UO~Oi!VOc#Qi!O#Qi!T#Qi!^#Qi!h#Qi!k#Qi!o#Qi!t#Qi!x#Qi#S#Qi#f#Qi#l#Qi#m#Qi#n#Qi~Oi#jOm{O!a#nO~Om{O#r#sO~Oi#uOm{O~Oi#yOm{O~O#o%{O~OU%}O#k$_O~OiPOhsi#ksi#tsi#vsi~Om{O~P@]O]&RO#kzO~Oi#jOc![q!O![q!T![q!^![q!h![q!k![q!o![q!t![q!x![q#S![q#f![q#l![q#m![q#n![q~Om{O#y%VO~P@}Oi#jOc!fq!O!fq!T!fq!^!fq!h!fq!k!fq!o!fq!t!fq!x!fq#S!fq#f!fq#l!fq#m!fq#n!fq~Om{O#y%VO~PBYOc!iqi!iq!O!iq!T!iq!^!iq!h!iq!k!iq!o!iq!t!iq!x!iq#S!iq#f!iq#l!iq#m!iq#n!iq~O#{%]O~PCeO#r#sO~PCeOi#uOc!mq!O!mq!T!mq!^!mq!h!mq!k!mq!o!mq!t!mq!x!mq#S!mq#f!mq#l!mq#m!mq#n!mq~Oi#yOc!rq!O!rq!T!rq!^!rq!h!rq!k!rq!o!rq!t!rq!x!rq#S!rq#f!rq#l!rq#m!rq#n!rq~OcUO#kzO#o&eO~OcUOh&iO#kzO~Om&kOc!qXf!qXh!qX~Of&nO~OcUOf%_Oh&pO~OcUOh&qO#kzO~O#o&sO~O#{&tOc!vqi!vq!O!vq!T!vq!^!vq!h!vq!k!vq!o!vq!t!vq!x!vq#S!vq#f!vq#l!vq#m!vq#n!vq~Oi#jOc#Vq!O#Vq!T#Vq!^#Vq!h#Vq!k#Vq!o#Vq!t#Vq!x#Vq#S#Vq#f#Vq#l#Vq#m#Vq#n#Vq~Om{O#y%VO~PIbOi#jOc#Wq!O#Wq!T#Wq!^#Wq!h#Wq!k#Wq!o#Wq!t#Wq!x#Wq#S#Wq#f#Wq#l#Wq#m#Wq#n#Wq~Om{O#y%VO~PJmOc#Xqi#Xq!O#Xq!T#Xq!^#Xq!h#Xq!k#Xq!o#Xq!t#Xq!x#Xq#S#Xq#f#Xq#l#Xq#m#Xq#n#Xq~O#{%]O~PKxO#r#sO~PKxOi#uOc#Yq!O#Yq!T#Yq!^#Yq!h#Yq!k#Yq!o#Yq!t#Yq!x#Yq#S#Yq#f#Yq#l#Yq#m#Yq#n#Yq~Oi#yOc#Zq!O#Zq!T#Zq!^#Zq!h#Zq!k#Zq!o#Zq!t#Zq!x#Zq#S#Zq#f#Zq#l#Zq#m#Zq#n#Zq~OY'PO]&}Oa'POb'POc'POd'POe'POf'POi'OO~OiPOhsq#ksq#tsq#vsq~O#q'TOU#pXY#pXm#pX#r#pX#t#pXc#pX{#pX!z#pX#k#pX[#pXh#pX#o#pX~Om{O#r'UO#t'VOUXiYXi~Oi#jOc![y!O![y!T![y!^![y!h![y!k![y!o![y!t![y!x![y#S![y#f![y#l![y#m![y#n![y~Oi#jOc!fy!O!fy!T!fy!^!fy!h!fy!k!fy!o!fy!t!fy!x!fy#S!fy#f!fy#l!fy#m!fy#n!fy~O#{%]Oc!iyi!iy!O!iy!T!iy!^!iy!h!iy!k!iy!o!iy!t!iy!x!iy#S!iy#f!iy#l!iy#m!iy#n!iy~O#{&tOc!vyi!vy!O!vy!T!vy!^!vy!h!vy!k!vy!o!vy!t!vy!x!vy#S!vy#f!vy#l!vy#m!vy#n!vy~O#o'_O~OcUO#kzO#o'_O~OV!sOclXflXhlXmlX~Om&kOckXfkXhkX~Om&kOc!qaf!qah!qa~Om{O#r'UOc!ei{!ei!z!ei#k!eih!ei#o!ei~Oi#jOc#Vy!O#Vy!T#Vy!^#Vy!h#Vy!k#Vy!o#Vy!t#Vy!x#Vy#S#Vy#f#Vy#l#Vy#m#Vy#n#Vy~Oi#jOc#Wy!O#Wy!T#Wy!^#Wy!h#Wy!k#Wy!o#Wy!t#Wy!x#Wy#S#Wy#f#Wy#l#Wy#m#Wy#n#Wy~O#{%]Oc#Xyi#Xy!O#Xy!T#Xy!^#Xy!h#Xy!k#Xy!o#Xy!t#Xy!x#Xy#S#Xy#f#Xy#l#Xy#m#Xy#n#Xy~O['jO~P! ZOh'nO#kzO~O#t'oOUoi#koi~O['pO~O#t'rOUXqYXq~Om{O#t'rOUXqYXq~O#{&tOc!v!Ri!v!R!O!v!R!T!v!R!^!v!R!h!v!R!k!v!R!o!v!R!t!v!R!x!v!R#S!v!R#f!v!R#l!v!R#m!v!R#n!v!R~Om{Oc!cih!ci#k!ci~O#o'wO~Om{Oc!eq{!eq!z!eq#k!eqh!eq#o!eq~O#r'UO~P!/eO#t'zOY#^X[#^X]#^Xa#^Xb#^Xc#^Xd#^Xe#^Xf#^Xi#^X~O['|O~P! ZO#o'}O~Oh(PO#kzO~O#t(QOUXyYXy~O#{&tOc!v!Zi!v!Z!O!v!Z!T!v!Z!^!v!Z!h!v!Z!k!v!Z!o!v!Z!t!v!Z!x!v!Z#S!v!Z#f!v!Z#l!v!Z#m!v!Z#n!v!Z~Om{Oc!cqh!cq#k!cq~Om{Oc!ey{!ey!z!ey#k!eyh!ey#o!ey~Om{Oc!cyh!cy#k!cy~O#t(WOh#ui#k#ui~Odefe~",goto:":k$OPPP$P$T$[PP&d&jP&nPP'Z'd'mPPPPPP'vPP'v'}*|P,T,_,c,g-k-o-s-w-o.O-o.U.[P$P.oP.s.w.{/bP/l/|.w0P0TP0P0ZP0e0wP1P2T2X2e0P2nP0P2xP3S0P3dP3n4O0P4SP4^.w4nP4uP5P5]5i5i.s5q5uP5q5y5y5y5y5y5y5}6T6Z6a6g7r7x8O8U8cPPP8i8mPPPPP8qPP9WP9eP8m9iP9qP:Z:cTTOgSQOgR#]!VSsPyQ!SQS!TSvQ!dXQ!eYQ!fZQ!g[Q!h]Q#a![Q#b!]Q#c!^Q#d!_Q#e!`Q#f!a^#}!i#g#y$Q%X%c&gQ$X!kQ$Y!lQ$Z!mQ$[!nQ$]!oQ$^!pj$g!z#i#s$k$r%V%]%d&R&e&s'_'wS%X#j%[Q%e$OQ&g%YT'k'O'mQ!RQR#Z!ST#V!O#WQ$h!zQ%W#iQ%^#s^&S$k%d&R&e&s'_'wQ&X$rQ&d%VR&j%]_&S$k%d&R&e&s'_'w_&T$k%d&R&e&s'_'wQ'X&UQ'c&rR'y'dZ'P%{&}'U'i'}Q!QQQ!YVQ!utQ!|vS#Y!R!SQ#`!ZQ#m!dQ#q!eQ#t!fQ#x!gQ#|!hQ$W!jS$d!v!xQ$f!yQ$j!}Q$o#ZQ$q#[Q$u#aS$x#b#hS${#c#oQ$}#dQ%P#eQ%R#fQ%n$XQ%q$YQ%t$ZQ%v$[Q%x$]Q%z$^Q&P$eQ&Z$vQ&]$yQ&m%_Q&w%oQ&y%rQ'W&UQ'a&nQ'b&rQ's'XQ'u'^S'x'c'dQ(R'vQ(T'yR(V(S#Z|QVtv}!R!S!Z!d!e!f!g!h!j!v!x!y!}#Z#[#a#b#c#d#e#f#h#o$X$Y$Z$[$]$^$e$v$y%_%o%r&U&l&n&r'X'^'c'd'v'y(SQ!vtS#S{&kR$e!xT$a!s$bT$`!s$bSROgQ!PQQ!ttQ!{vU#X!Q!R!SU$c!u!v!xS$i!|!}S$n#Y#ZQ$p#[S&O$d$eQ&Q$jQ&V$oQ&W$qR'R&PTxPyTwPyTuPyStPyR!xuQ!USR!yvQ!}vR#[!US!zv!UQ$R!iU%S#g$S$TS&b%T%UR']&cTSOgTdOgT`OgSWOg^$O!i#g#y$Q%X%c&gS%Y#j%[T%`#u%bSVOgQ!ZWR!jaQ!XVS#_!Y!ZQ$V!jQ$t#`R%m$WR#^!VT^OgQ![WR!kaSXOgQ!]WR!laQ#h!dQ#o!eQ$v#bQ$y#cQ%o$YR%r$Z]#i!d!e#b#c$Y$ZQ#l!dQ#p!eU$w#b#h#mU$z#c#o#qQ%p$YQ%s$ZS&Y$v$xS&[$y${S&v%o%qS&x%r%tQ'Y&ZQ'Z&]Q'f&wR'g&yT%Z#j%[Q$T!iQ%U#gQ&f%XR'`&g_$P!i#g#y$Q%X%c&gSYOgQ!^WR!maSZOgQ!_WR!naQ#r!fS$|#d#tQ%u$[Q&^$}R&z%vS[OgQ!`WR!oaQ#w!gS%O#e#xQ%w$]Q&_%PR&{%xT%a#u%bS]OgQ!aWR!paQ#{!hS%Q#f#|Q%y$^Q&`%RR&|%zS_OgR!bWQ$S!iS%T#g$TR&c%UQ%j$RQ&a%SQ'[&bR't']W%k$R%S&b']Q&u%lR'e&t]%i$R%S%l&b&t']TcOgTaOgTbOgQgOR!qgQ#W!OR$l#WQ'i&}R'{'iQ'm'OR(O'm#Q}QVtv!R!S!Z!d!e!f!g!h!j!v!x!y!}#Z#[#a#b#c#d#e#f#h#o$X$Y$Z$[$]$^$e$v$y%o%r&U&r'X'^'c'd'v'y(SS#T}&lT&l%_&nQ$b!sR%|$bQyPR#QyQ%[#jR&h%[W$Q!i#g%X&gQ%c#yT%f$Q%cQ%b#uR&o%bTfOgTeOgQ&U$kQ&r%dQ'S&RQ'^&eQ'd&sQ'v'_R(S'wQ'Q%{S'h&}'iQ'q'UR(U'}T'l'O'm]!WV!Y!Z!j#`$W}#k!d!e#b#c#h#m#o#q$Y$Z$v$x$y${%o%q%r%t&Z&]&w&y]#v!g#e#x$]%P%x]#z!h#f#|$^%R%z",nodeNames:"⚠ Comment Document OperationDefinition OperationType Name ) ( VariableDefinitions VariableDefinition Variable NamedType ] [ ListType NonNullType DefaultValue IntValue FloatValue StringValue BooleanValue NullValue EnumValue ListValue } { ObjectValue Directives Directive DirectiveName Arguments Argument ArgumentAttributeName SelectionSet Selection Field Alias FieldName FragmentSpread FragmentName InlineFragment TypeCondition OnKeyword on FragmentDefinition FragmentKeyword fragment TypeSystemDefinition SchemaDefinition Description SchemaKeyword schema RootTypeDefinition RootOperationTypeDefinition TypeDefinition ScalarTypeDefinition ScalarKeyword scalar ObjectTypeDefinition TypeKeyword type ImplementsInterfaces ImplementsKeyword implements FieldsDefinition FieldDefinition ArgumentsDefinition InputValueDefinition InterfaceTypeDefinition InterfaceKeyword interface UnionTypeDefinition UnionKeyword union UnionMemberTypes EnumTypeDefinition EnumKeyword enum EnumValuesDefinition EnumValueDefinition InputObjectTypeDefinition InputKeyword input InputFieldsDefinition DirectiveDefinition DirectiveKeyword directive RepeatableKeyword repeatable DirectiveLocations DirectiveLocation ExecutableDirectiveLocation TypeSystemDirectiveLocation TypeSystemExtension SchemaExtension ExtendKeyword extend TypeExtension ScalarTypeExtension ObjectTypeExtension InterfaceTypeExtension UnionTypeExtension EnumTypeExtension InputObjectTypeExtension",maxTerm:156,nodeProps:[["openedBy",6,"(",12,"[",24,"{"],["closedBy",7,")",13,"]",25,"}"]],skippedNodes:[0,1],repeatNodeCount:10,tokenData:"#Ci~R!XX^$npq$nqr%crs%hst4ptu4{vw5jxy5oyz5t|}5y}!O6O!O!P7g!Q![6U![!]7x!_!`7}!b!c8S!c!d8q!d!g9[!g!hCZ!h!iHd!i!k9[!k!l!/v!l!o9[!o!p!Id!p!q9[!q!r!Mm!r!s9[!s!t#!u!t!u9[!u!v#%d!v!w9[!w!x#0n!x!y#3]!y!}9[!}#O#=[#P#Q#=a#R#S9[#T#Y9[#Y#Z#=f#Z#b9[#b#c#@Q#c#h9[#h#i#BU#i#o9[#o#p#CY#p#q#C_#q#r#Cd#y#z$n$f$g$n#BY#BZ$n$IS$I_$n$I|$JO$n$JT$JU$n$KV$KW$n&FU&FV$n~$sY#h~X^$npq$n#y#z$n$f$g$n#BY#BZ$n$IS$I_$n$I|$JO$n$JT$JU$n$KV$KW$n&FU&FV$n~%hO#q~~%kVOY&QZ]&Q^r&Qrs(as#O&Q#O#P&o#P~&Q~&TVOY&QZ]&Q^r&Qrs&js#O&Q#O#P&o#P~&Q~&oOc~~&rXrs&Q!P!Q&Q#O#P&Q#U#V&Q#Y#Z&Q#b#c&Q#f#g&Q#h#i&Q#i#j'_~'bR!QX^r(irs)_s#O(i#O#P)w#P~(i~)[PYZ(i~)bROr(irs)ks~(i~)nROr(irs&js~(i~)zXrs*g!P!Q(i#O#P(i#U#V(i#Y#Z(i#b#c(i#f#g(i#h#i(i#i#j3n~*jXOY(iYZ(iZ](i]^)X^r(irs+Vs#O(i#O#P)w#P~(i~+YROr(irs+cs~(i~+fXOY(iYZ(iZ](i]^(i^r(irs,Rs#O(i#O#P,a#P~(i~,WRc~Or(irs)ks~(i~,dfOY(iYZ(iZ](i]^)X^r(irs-xs!P(i!P!Q(i!Q#O(i#O#P,a#P#U(i#U#V(i#V#Y(i#Y#Z(i#Z#b(i#b#c(i#c#f(i#f#g(i#g#h(i#h#i(i#i#j/f#j~(i~-{XOY(iYZ(iZ](i]^(i^r(irs.hs#O(i#O#P,a#P~(i~.kROr(irs.ts~(i~.yXc~OY(iYZ(iZ](i]^(i^r(irs,Rs#O(i#O#P,a#P~(i~/i_OY(iYZ(iZ](i]^)X^r(irs)_s!Q(i!QX^r(irs)_s!Q(i!QX^r(irs)_s!Q(i!QX^r(irs)_s!Q(i!Q![(i![!c(i!c!i(i!i#O(i#O#P)w#P#T(i#T#Z(i#Z~(i~3qR!Q![3z!c!i3z#T#Z3z~3}R!Q![4W!c!i4W#T#Z4W~4ZR!Q![4d!c!i4d#T#Z4d~4gR!Q![(i!c!i(i#T#Z(i~4uQP~OY4pZ~4p~5OR!c!}5X#R#S5X#T#o5X~5^SY~!Q![5X!c!}5X#R#S5X#T#o5X~5oO#y~~5tOV~~5yOU~~6OO#t~~6RP!Q![6U~6ZSa~!O!P6g!Q![6U!g!h6{#X#Y6{~6jP!Q![6m~6rRb~!Q![6m!g!h6{#X#Y6{~7OR{|7X}!O7X!Q![7_~7[P!Q![7_~7dPb~!Q![7_~7jP!O!P7m~7pP!O!P7s~7xO#v~~7}O#o~~8SO#r~~8VR!c!}8`#R#S8`#T#o8`~8eSm~!Q![8`!c!}8`#R#S8`#T#o8`V8xU#kPfQ!Q![9[!c!t9[!t!u9o!u!}9[#R#S9[#T#o9[R9cS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V9vU#kPfQ!Q![9[!c!i9[!i!j:Y!j!}9[#R#S9[#T#o9[V:aU#kPfQ!Q![9[!c!w9[!w!x:s!x!}9[#R#S9[#T#o9[V:zU#kPfQ!Q![9[!c!o9[!o!p;^!p!}9[#R#S9[#T#o9[V;eU#kPfQ!Q![9[!c!g9[!g!h;w!h!}9[#R#S9[#T#o9[V<OU#kPfQ!Q![9[!c!p9[!p!q<b!q!}9[#R#S9[#T#o9[V<iU#kPfQ!Q![9[!c!v9[!v!w<{!w!}9[#R#S9[#T#o9[V=SS#kPfQ!Q![9[!c!}9[#R#S=`#T#o9[V=gU#kPfQ!Q![9[!c!f9[!f!g=y!g!}9[#R#S9[#T#o9[V>QU#kPfQ!Q![9[!c!g9[!g!h>d!h!}9[#R#S9[#T#o9[V>kU#kPfQ!Q![9[!c!h9[!h!i>}!i!}9[#R#S9[#T#o9[V?UU#kPfQ!Q![9[!c!k9[!k!l?h!l!}9[#R#S9[#T#o9[V?oU#kPfQ!Q![9[!c!p9[!p!q@R!q!}9[#R#S9[#T#o9[V@YU#kPfQ!Q![9[!c!k9[!k!l@l!l!}9[#R#S9[#T#o9[V@sU#kPfQ!Q![9[!c!v9[!v!wAV!w!}9[#R#S9[#T#o9[VA^U#kPfQ!Q![9[!c!k9[!k!lAp!l!}9[#R#S9[#T#o9[VAwU#kPfQ!Q![9[!c!q9[!q!rBZ!r!}9[#R#S9[#T#o9[VBbU#kPfQ!Q![9[!c!p9[!p!qBt!q!}9[#R#S9[#T#o9[VB}S$[S#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[VCbU#kPfQ!Q![9[!c!p9[!p!qCt!q!}9[#R#S9[#T#o9[VC{U#kPfQ!Q![9[!c!w9[!w!xD_!x!}9[#R#S9[#T#o9[VDfU#kPfQ!Q![9[!c!o9[!o!pDx!p!}9[#R#S9[#T#o9[VERS$_S#kPfQ!Q![9[!c!}9[#R#SE_#T#o9[VEfU#kPfQ!Q![9[!c!x9[!x!yEx!y!}9[#R#S9[#T#o9[VFPT#kPfQ!Q![9[!c!dF`!d!}9[#R#S9[#T#o9[VFgU#kPfQ!Q![9[!c!n9[!n!oFy!o!}9[#R#S9[#T#o9[VGQU#kPfQ!Q![9[!c!w9[!w!xGd!x!}9[#R#S9[#T#o9[VGkU#kPfQ!Q![9[!c!g9[!g!hG}!h!}9[#R#S9[#T#o9[VHWS$`S#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[VHkW#kPfQ!Q![9[!c!k9[!k!lIT!l!t9[!t!u!#S!u!}9[#R#S9[#T#o9[VI[U#kPfQ!Q![9[!c!g9[!g!hIn!h!}9[#R#S9[#T#o9[VIuU#kPfQ!Q![9[!c!n9[!n!oJX!o!}9[#R#S9[#T#o9[VJ`U#kPfQ!Q![9[!c!f9[!f!gJr!g!}9[#R#S9[#T#o9[VJ{S$RS#kPfQ!Q![9[!c!}9[#R#SKX#T#o9[VK`U#kPfQ!Q![9[!c!f9[!f!gKr!g!}9[#R#S9[#T#o9[VKyU#kPfQ!Q![9[!c!g9[!g!hL]!h!}9[#R#S9[#T#o9[VLdU#kPfQ!Q![9[!c!h9[!h!iLv!i!}9[#R#S9[#T#o9[VL}U#kPfQ!Q![9[!c!k9[!k!lMa!l!}9[#R#S9[#T#o9[VMhU#kPfQ!Q![9[!c!p9[!p!qMz!q!}9[#R#S9[#T#o9[VNRU#kPfQ!Q![9[!c!k9[!k!lNe!l!}9[#R#S9[#T#o9[VNlU#kPfQ!Q![9[!c!v9[!v!w! O!w!}9[#R#S9[#T#o9[V! VU#kPfQ!Q![9[!c!k9[!k!l! i!l!}9[#R#S9[#T#o9[V! pU#kPfQ!Q![9[!c!q9[!q!r!!S!r!}9[#R#S9[#T#o9[V!!ZU#kPfQ!Q![9[!c!p9[!p!q!!m!q!}9[#R#S9[#T#o9[V!!vS$ZS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V!#ZT#kPfQ!Q![9[!c!d!#j!d!}9[#R#S9[#T#o9[V!#qU#kPfQ!Q![9[!c!i9[!i!j!$T!j!}9[#R#S9[#T#o9[V!$[U#kPfQ!Q![9[!c!o9[!o!p!$n!p!}9[#R#S9[#T#o9[V!$uU#kPfQ!Q![9[!c!g9[!g!h!%X!h!}9[#R#S9[#T#o9[V!%`U#kPfQ!Q![9[!c!p9[!p!q!%r!q!}9[#R#S9[#T#o9[V!%yU#kPfQ!Q![9[!c!v9[!v!w!&]!w!}9[#R#S9[#T#o9[V!&dS#kPfQ!Q![9[!c!}9[#R#S!&p#T#o9[V!&wW#kPfQ!Q![9[!c!f9[!f!g!'a!g!u9[!u!v!,q!v!}9[#R#S9[#T#o9[V!'hU#kPfQ!Q![9[!c!g9[!g!h!'z!h!}9[#R#S9[#T#o9[V!(RU#kPfQ!Q![9[!c!h9[!h!i!(e!i!}9[#R#S9[#T#o9[V!(lU#kPfQ!Q![9[!c!k9[!k!l!)O!l!}9[#R#S9[#T#o9[V!)VU#kPfQ!Q![9[!c!p9[!p!q!)i!q!}9[#R#S9[#T#o9[V!)pU#kPfQ!Q![9[!c!k9[!k!l!*S!l!}9[#R#S9[#T#o9[V!*ZU#kPfQ!Q![9[!c!v9[!v!w!*m!w!}9[#R#S9[#T#o9[V!*tU#kPfQ!Q![9[!c!k9[!k!l!+W!l!}9[#R#S9[#T#o9[V!+_U#kPfQ!Q![9[!c!q9[!q!r!+q!r!}9[#R#S9[#T#o9[V!+xU#kPfQ!Q![9[!c!p9[!p!q!,[!q!}9[#R#S9[#T#o9[V!,eS$SS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V!,xU#kPfQ!Q![9[!c!r9[!r!s!-[!s!}9[#R#S9[#T#o9[V!-cU#kPfQ!Q![9[!c!t9[!t!u!-u!u!}9[#R#S9[#T#o9[V!-|U#kPfQ!Q![9[!c!g9[!g!h!.`!h!}9[#R#S9[#T#o9[V!.gT#kPfQ!Q![9[!c!d!.v!d!}9[#R#S9[#T#o9[V!.}U#kPfQ!Q![9[!c!f9[!f!g!/a!g!}9[#R#S9[#T#o9[V!/jS$TS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V!/}U#kPfQ!Q![9[!c!p9[!p!q!0a!q!}9[#R#S9[#T#o9[V!0hY#kPfQ!Q![9[!c!n9[!n!o!1W!o!r9[!r!s!7|!s!v9[!v!w!Et!w!}9[#R#S9[#T#o9[V!1_U#kPfQ!Q![9[!c!k9[!k!l!1q!l!}9[#R#S9[#T#o9[V!1xU#kPfQ!Q![9[!c!p9[!p!q!2[!q!}9[#R#S9[#T#o9[V!2cU#kPfQ!Q![9[!c!g9[!g!h!2u!h!}9[#R#S9[#T#o9[V!2|S#kPfQ!Q![9[!c!}9[#R#S!3Y#T#o9[V!3aU#kPfQ!Q![9[!c!h9[!h!i!3s!i!}9[#R#S9[#T#o9[V!3zU#kPfQ!Q![9[!c!t9[!t!u!4^!u!}9[#R#S9[#T#o9[V!4eT#kPfQ!Q![9[!c!d!4t!d!}9[#R#S9[#T#o9[V!4{U#kPfQ!Q![9[!c!i9[!i!j!5_!j!}9[#R#S9[#T#o9[V!5fU#kPfQ!Q![9[!c!o9[!o!p!5x!p!}9[#R#S9[#T#o9[V!6PU#kPfQ!Q![9[!c!g9[!g!h!6c!h!}9[#R#S9[#T#o9[V!6jU#kPfQ!Q![9[!c!p9[!p!q!6|!q!}9[#R#S9[#T#o9[V!7TU#kPfQ!Q![9[!c!v9[!v!w!7g!w!}9[#R#S9[#T#o9[V!7pS$US#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V!8TU#kPfQ!Q![9[!c!w9[!w!x!8g!x!}9[#R#S9[#T#o9[V!8nU#kPfQ!Q![9[!c!v9[!v!w!9Q!w!}9[#R#S9[#T#o9[V!9XS#kPfQ!Q![9[!c!}9[#R#S!9e#T#o9[V!9lW#kPfQ!Q![9[!c!h9[!h!i!:U!i!q9[!q!r!Bl!r!}9[#R#S9[#T#o9[V!:]U#kPfQ!Q![9[!c!k9[!k!l!:o!l!}9[#R#S9[#T#o9[V!:vU#kPfQ!Q![9[!c!g9[!g!h!;Y!h!}9[#R#S9[#T#o9[V!;aU#kPfQ!Q![9[!c!n9[!n!o!;s!o!}9[#R#S9[#T#o9[V!;zU#kPfQ!Q![9[!c!f9[!f!g!<^!g!}9[#R#S9[#T#o9[V!<eS#kPfQ!Q![9[!c!}9[#R#S!<q#T#o9[V!<xU#kPfQ!Q![9[!c!f9[!f!g!=[!g!}9[#R#S9[#T#o9[V!=cU#kPfQ!Q![9[!c!g9[!g!h!=u!h!}9[#R#S9[#T#o9[V!=|U#kPfQ!Q![9[!c!h9[!h!i!>`!i!}9[#R#S9[#T#o9[V!>gU#kPfQ!Q![9[!c!k9[!k!l!>y!l!}9[#R#S9[#T#o9[V!?QU#kPfQ!Q![9[!c!p9[!p!q!?d!q!}9[#R#S9[#T#o9[V!?kU#kPfQ!Q![9[!c!k9[!k!l!?}!l!}9[#R#S9[#T#o9[V!@UU#kPfQ!Q![9[!c!v9[!v!w!@h!w!}9[#R#S9[#T#o9[V!@oU#kPfQ!Q![9[!c!k9[!k!l!AR!l!}9[#R#S9[#T#o9[V!AYU#kPfQ!Q![9[!c!q9[!q!r!Al!r!}9[#R#S9[#T#o9[V!AsU#kPfQ!Q![9[!c!p9[!p!q!BV!q!}9[#R#S9[#T#o9[V!B`S$bS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V!BsU#kPfQ!Q![9[!c!d9[!d!e!CV!e!}9[#R#S9[#T#o9[V!C^U#kPfQ!Q![9[!c!l9[!l!m!Cp!m!}9[#R#S9[#T#o9[V!CwU#kPfQ!Q![9[!c!g9[!g!h!DZ!h!}9[#R#S9[#T#o9[V!DbU#kPfQ!Q![9[!c!e9[!e!f!Dt!f!}9[#R#S9[#T#o9[V!D{U#kPfQ!Q![9[!c!v9[!v!w!E_!w!}9[#R#S9[#T#o9[V!EhS$aS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V!E{U#kPfQ!Q![9[!c!g9[!g!h!F_!h!}9[#R#S9[#T#o9[V!FfU#kPfQ!Q![9[!c!t9[!t!u!Fx!u!}9[#R#S9[#T#o9[V!GPU#kPfQ!Q![9[!c!h9[!h!i!Gc!i!}9[#R#S9[#T#o9[V!GjT#kPfQ!Q![9[!c!d!Gy!d!}9[#R#S9[#T#o9[V!HQU#kPfQ!Q![9[!c!e9[!e!f!Hd!f!}9[#R#S9[#T#o9[V!HkU#kPfQ!Q![9[!c!g9[!g!h!H}!h!}9[#R#S9[#T#o9[V!IWS$]S#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V!IkU#kPfQ!Q![9[!c!w9[!w!x!I}!x!}9[#R#S9[#T#o9[V!JUU#kPfQ!Q![9[!c!v9[!v!w!Jh!w!}9[#R#S9[#T#o9[V!JoT#kPfQ!Q![9[!c!d!KO!d!}9[#R#S9[#T#o9[V!KVU#kPfQ!Q![9[!c!v9[!v!w!Ki!w!}9[#R#S9[#T#o9[V!KpU#kPfQ!Q![9[!c!k9[!k!l!LS!l!}9[#R#S9[#T#o9[V!LZU#kPfQ!Q![9[!c!q9[!q!r!Lm!r!}9[#R#S9[#T#o9[V!LtU#kPfQ!Q![9[!c!p9[!p!q!MW!q!}9[#R#S9[#T#o9[V!MaS$PS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V!MtU#kPfQ!Q![9[!c!d9[!d!e!NW!e!}9[#R#S9[#T#o9[V!N_U#kPfQ!Q![9[!c!l9[!l!m!Nq!m!}9[#R#S9[#T#o9[V!NxU#kPfQ!Q![9[!c!g9[!g!h# [!h!}9[#R#S9[#T#o9[V# cU#kPfQ!Q![9[!c!e9[!e!f# u!f!}9[#R#S9[#T#o9[V# |U#kPfQ!Q![9[!c!v9[!v!w#!`!w!}9[#R#S9[#T#o9[V#!iS$YS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V#!|U#kPfQ!Q![9[!c!w9[!w!x##`!x!}9[#R#S9[#T#o9[V##gU#kPfQ!Q![9[!c!g9[!g!h##y!h!}9[#R#S9[#T#o9[V#$QU#kPfQ!Q![9[!c!t9[!t!u#$d!u!}9[#R#S9[#T#o9[V#$kU#kPfQ!Q![9[!c!{9[!{!|#$}!|!}9[#R#S9[#T#o9[V#%WS$OS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V#%kW#kPfQ!Q![9[!c!e9[!e!f#&T!f!w9[!w!x#*s!x!}9[#R#S9[#T#o9[V#&[V#kPfQ!Q![9[!c!d#&q!d!j9[!j!k#(r!k!}9[#R#S9[#T#o9[V#&xU#kPfQ!Q![9[!c!n9[!n!o#'[!o!}9[#R#S9[#T#o9[V#'cT#kPfQ!Q![9[!c!d#'r!d!}9[#R#S9[#T#o9[V#'yU#kPfQ!Q![9[!c!t9[!t!u#(]!u!}9[#R#S9[#T#o9[V#(fS$XS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V#(yU#kPfQ!Q![9[!c!g9[!g!h#)]!h!}9[#R#S9[#T#o9[V#)dU#kPfQ!Q![9[!c!o9[!o!p#)v!p!}9[#R#S9[#T#o9[V#)}T#kPfQ!Q![9[!c!d#*^!d!}9[#R#S9[#T#o9[V#*gS$WS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V#*zU#kPfQ!Q![9[!c!d9[!d!e#+^!e!}9[#R#S9[#T#o9[V#+eU#kPfQ!Q![9[!c!u9[!u!v#+w!v!}9[#R#S9[#T#o9[V#,OU#kPfQ!Q![9[!c!e9[!e!f#,b!f!}9[#R#S9[#T#o9[V#,iU#kPfQ!Q![9[!c!t9[!t!u#,{!u!}9[#R#S9[#T#o9[V#-SU#kPfQ!Q![9[!c!k9[!k!l#-f!l!}9[#R#S9[#T#o9[V#-mU#kPfQ!Q![9[!c!r9[!r!s#.P!s!}9[#R#S9[#T#o9[V#.WU#kPfQ!Q![9[!c!v9[!v!w#.j!w!}9[#R#S9[#T#o9[V#.qU#kPfQ!Q![9[!c!k9[!k!l#/T!l!}9[#R#S9[#T#o9[V#/[U#kPfQ!Q![9[!c!q9[!q!r#/n!r!}9[#R#S9[#T#o9[V#/uU#kPfQ!Q![9[!c!p9[!p!q#0X!q!}9[#R#S9[#T#o9[V#0bS$QS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V#0uU#kPfQ!Q![9[!c!p9[!p!q#1X!q!}9[#R#S9[#T#o9[V#1`U#kPfQ!Q![9[!c!k9[!k!l#1r!l!}9[#R#S9[#T#o9[V#1yU#kPfQ!Q![9[!c!q9[!q!r#2]!r!}9[#R#S9[#T#o9[V#2dU#kPfQ!Q![9[!c!p9[!p!q#2v!q!}9[#R#S9[#T#o9[V#3PS$^S#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V#3dT#kPfQ!Q![9[!c!d#3s!d!}9[#R#S9[#T#o9[V#3zU#kPfQ!Q![9[!c!t9[!t!u#4^!u!}9[#R#S9[#T#o9[V#4eU#kPfQ!Q![9[!c!k9[!k!l#4w!l!}9[#R#S9[#T#o9[V#5OT#kPfQ!Q![9[!c!d#5_!d!}9[#R#S9[#T#o9[V#5fU#kPfQ!Q![9[!c!d9[!d!e#5x!e!}9[#R#S9[#T#o9[V#6PU#kPfQ!Q![9[!c!n9[!n!o#6c!o!}9[#R#S9[#T#o9[V#6jU#kPfQ!Q![9[!c!g9[!g!h#6|!h!}9[#R#S9[#T#o9[V#7TS#kPfQ!Q![9[!c!}9[#R#S#7a#T#o9[V#7hU#kPfQ!Q![9[!c!f9[!f!g#7z!g!}9[#R#S9[#T#o9[V#8RU#kPfQ!Q![9[!c!g9[!g!h#8e!h!}9[#R#S9[#T#o9[V#8lU#kPfQ!Q![9[!c!h9[!h!i#9O!i!}9[#R#S9[#T#o9[V#9VU#kPfQ!Q![9[!c!k9[!k!l#9i!l!}9[#R#S9[#T#o9[V#9pU#kPfQ!Q![9[!c!p9[!p!q#:S!q!}9[#R#S9[#T#o9[V#:ZU#kPfQ!Q![9[!c!k9[!k!l#:m!l!}9[#R#S9[#T#o9[V#:tU#kPfQ!Q![9[!c!v9[!v!w#;W!w!}9[#R#S9[#T#o9[V#;_U#kPfQ!Q![9[!c!k9[!k!l#;q!l!}9[#R#S9[#T#o9[V#;xU#kPfQ!Q![9[!c!q9[!q!r#<[!r!}9[#R#S9[#T#o9[V#<cU#kPfQ!Q![9[!c!p9[!p!q#<u!q!}9[#R#S9[#T#o9[V#=OS$VS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[~#=aO]~~#=fO[~R#=mT#kPfQ!Q![9[!c!}9[#R#S9[#T#U#=|#U#o9[R#>TU#kPfQ!Q![9[!c!}9[#R#S9[#T#`9[#`#a#>g#a#o9[R#>nU#kPfQ!Q![9[!c!}9[#R#S9[#T#g9[#g#h#?Q#h#o9[R#?XU#kPfQ!Q![9[!c!}9[#R#S9[#T#X9[#X#Y#?k#Y#o9[R#?tS#kPdQfQ!Q![9[!c!}9[#R#S9[#T#o9[R#@XU#kPfQ!Q![9[!c!}9[#R#S9[#T#i9[#i#j#@k#j#o9[R#@rU#kPfQ!Q![9[!c!}9[#R#S9[#T#`9[#`#a#AU#a#o9[R#A]U#kPfQ!Q![9[!c!}9[#R#S9[#T#`9[#`#a#Ao#a#o9[R#AxS#kPeQfQ!Q![9[!c!}9[#R#S9[#T#o9[R#B]U#kPfQ!Q![9[!c!}9[#R#S9[#T#f9[#f#g#Bo#g#o9[R#BvU#kPfQ!Q![9[!c!}9[#R#S9[#T#i9[#i#j#?Q#j#o9[~#C_Oi~~#CdO#{~~#CiOh~",tokenizers:[0,1,2],topRules:{Document:[0,2]},specialized:[{term:119,get:vo=>spec_name[vo]||-1}],tokenPrec:2989}),nodesWithBraces="RootTypeDefinition InputFieldsDefinition EnumValuesDefinition FieldsDefinition SelectionSet { }",keywords="scalar type interface union enum input implements fragment extend schema directive on repeatable",punctuations="( ) { } : [ ]",graphqlLanguage=LRLanguage.define({parser:parser$1.configure({props:[styleTags({Variable:tags.variableName,BooleanValue:tags.bool,Description:tags.string,StringValue:tags.string,Comment:tags.lineComment,IntValue:tags.integer,FloatValue:tags.float,EnumValue:tags.special(tags.name),NullValue:tags.null,DirectiveName:tags.modifier,[keywords]:tags.keyword,OperationType:tags.definitionKeyword,FieldName:tags.propertyName,Field:tags.propertyName,ArgumentAttributeName:tags.attributeName,Name:tags.atom,"( )":tags.paren,"{ }":tags.brace,",":tags.separator,[punctuations]:tags.punctuation}),indentNodeProp.add({[nodesWithBraces]:delimitedIndent({closing:"}",align:!0})}),foldNodeProp.add({[nodesWithBraces]:foldInside})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*(\{|\})$/}});function graphqlLanguageSupport(){return new LanguageSupport(graphqlLanguage)}const AUTOCOMPLETE_CHARS=/^[a-zA-Z0-9_@(]$/,completion=graphqlLanguage.data.of({autocomplete(vo){const Ai=getSchema(vo.state),bo=getOpts(vo.state);if(!Ai)return null;const Ra=vo.matchBefore(/\w*/);if(!Ra)return null;const pc=Ra.text.split("").pop();if(!AUTOCOMPLETE_CHARS.test(pc)&&!vo.explicit)return null;const mc=vo.state.doc.toString(),uf=offsetToPos(vo.state.doc,vo.pos),df=getAutocompleteSuggestions(Ai,mc,uf,void 0,void 0,bo==null?void 0:bo.autocompleteOptions);return df.length===0?null:{from:Ra.from,options:df.map(ff=>({label:ff.label,detail:ff.detail||"",info(hf){if(bo!=null&&bo.onCompletionInfoRender)return bo.onCompletionInfoRender(ff,vo,hf);if(ff.documentation||ff.isDeprecated&&ff.deprecationReason){const pf=document.createElement("div");return pf.textContent=ff.documentation||ff.deprecationReason||"",pf}}}))}}}),jump=EditorView.domEventHandlers({click(vo,Ai){var bo,Ra,pc;const mc=getSchema(Ai.state);if(!mc)return;const uf=Ai.state.selection.main.head,df=offsetToPos(Ai.state.doc,uf),ff=getTokenAtPosition(Ai.state.doc.toString(),df),hf=getTypeInfo(mc,ff.state),pf=getOpts(Ai.state);pf!=null&&pf.onShowInDocs&&isMetaKeyPressed(vo)&&pf.onShowInDocs((bo=hf.fieldDef)===null||bo===void 0?void 0:bo.name,(Ra=hf.type)===null||Ra===void 0?void 0:Ra.toString(),(pc=hf.parentType)===null||pc===void 0?void 0:pc.toString())}}),SEVERITY=["error","warning","info"],lint=linter(vo=>{const Ai=getSchema(vo.state),bo=getOpts(vo.state);if(!Ai)return[];const Ra=validateSchema(Ai);if(Ra.length){if(!(bo!=null&&bo.showErrorOnInvalidSchema))return[];const pc=Ra.map(mc=>mc.message);return[{from:0,to:vo.state.doc.length,severity:"error",message:pc.join(`
|
|
368
|
-
`),actions:[]}]}return getDiagnostics(vo.state.doc.toString(),Ai).map(pc=>{if(!pc.severity||!pc.source)return null;const mc=posToOffset(vo.state.doc,new Position(pc.range.start.line,pc.range.start.character)),uf=Math.max(0,Math.min(mc,vo.state.doc.length)),df=posToOffset(vo.state.doc,new Position(pc.range.end.line,pc.range.end.character-1)),ff=Math.min(Math.max(uf+1,df),vo.state.doc.length);return{from:uf,to:uf===ff?ff+1:ff,severity:SEVERITY[pc.severity-1],message:pc.message,actions:[]}}).filter(pc=>!!pc)},{needsRefresh(vo){return vo.startState.field(schemaStateField)!==vo.state.field(schemaStateField)||vo.startState.field(optionsStateField)!==vo.state.field(optionsStateField)}});function graphql(vo,Ai){return[graphqlLanguageSupport(),completion,lint,jump,stateExtensions(vo,Ai)]}const hiddenQueryTypeDefDoc=`type Query {
|
|
369
|
-
_hidden: String
|
|
370
|
-
}
|
|
371
|
-
`,typeDefsDoc=typeDefs.join(`
|
|
372
|
-
`),initialSchemaDoc=`${hiddenQueryTypeDefDoc}
|
|
373
|
-
${typeDefsDoc}`,initialSchema=buildSchema(initialSchemaDoc),updateTimeout=5e3;function isURL(vo){try{return!!new URL(vo)}catch{return!1}}const asArray=vo=>Array.isArray(vo)?vo:vo?[vo]:[],invalidDocRegex=/\.[a-z0-9]+$/i;function isDocumentString(vo){if(typeof vo!="string"||invalidDocRegex.test(vo)||isURL(vo))return!1;try{return parse(vo),!0}catch(Ai){if(!Ai.message.includes("EOF")&&vo.replace(/(\#[^*]*)/g,"").trim()!==""&&vo.includes(" "))throw new Error(`Failed to parse the GraphQL document. ${Ai.message}
|
|
374
|
-
${vo}`)}return!1}function createDefaultRules(){let vo=["NoUnusedFragmentsRule","NoUnusedVariablesRule","KnownDirectivesRule"];return versionInfo.major<15&&(vo=vo.map(Ai=>Ai.replace(/Rule$/,""))),specifiedRules.filter(Ai=>!vo.includes(Ai.name))}var MapperKind;(function(vo){vo.TYPE="MapperKind.TYPE",vo.SCALAR_TYPE="MapperKind.SCALAR_TYPE",vo.ENUM_TYPE="MapperKind.ENUM_TYPE",vo.COMPOSITE_TYPE="MapperKind.COMPOSITE_TYPE",vo.OBJECT_TYPE="MapperKind.OBJECT_TYPE",vo.INPUT_OBJECT_TYPE="MapperKind.INPUT_OBJECT_TYPE",vo.ABSTRACT_TYPE="MapperKind.ABSTRACT_TYPE",vo.UNION_TYPE="MapperKind.UNION_TYPE",vo.INTERFACE_TYPE="MapperKind.INTERFACE_TYPE",vo.ROOT_OBJECT="MapperKind.ROOT_OBJECT",vo.QUERY="MapperKind.QUERY",vo.MUTATION="MapperKind.MUTATION",vo.SUBSCRIPTION="MapperKind.SUBSCRIPTION",vo.DIRECTIVE="MapperKind.DIRECTIVE",vo.FIELD="MapperKind.FIELD",vo.COMPOSITE_FIELD="MapperKind.COMPOSITE_FIELD",vo.OBJECT_FIELD="MapperKind.OBJECT_FIELD",vo.ROOT_FIELD="MapperKind.ROOT_FIELD",vo.QUERY_ROOT_FIELD="MapperKind.QUERY_ROOT_FIELD",vo.MUTATION_ROOT_FIELD="MapperKind.MUTATION_ROOT_FIELD",vo.SUBSCRIPTION_ROOT_FIELD="MapperKind.SUBSCRIPTION_ROOT_FIELD",vo.INTERFACE_FIELD="MapperKind.INTERFACE_FIELD",vo.INPUT_OBJECT_FIELD="MapperKind.INPUT_OBJECT_FIELD",vo.ARGUMENT="MapperKind.ARGUMENT",vo.ENUM_VALUE="MapperKind.ENUM_VALUE"})(MapperKind||(MapperKind={}));function getObjectTypeFromTypeMap(vo,Ai){if(Ai){const bo=vo[Ai.name];if(isObjectType(bo))return bo}}function isNamedStub(vo){if("getFields"in vo){const Ai=vo.getFields();for(const bo in Ai)return Ai[bo].name==="_fake"}return!1}function getBuiltInForStub(vo){switch(vo.name){case GraphQLInt.name:return GraphQLInt;case GraphQLFloat.name:return GraphQLFloat;case GraphQLString.name:return GraphQLString;case GraphQLBoolean.name:return GraphQLBoolean;case GraphQLID.name:return GraphQLID;default:return vo}}function rewireTypes(vo,Ai){const bo=Object.create(null);for(const gf in vo)bo[gf]=vo[gf];const Ra=Object.create(null);for(const gf in bo){const yf=bo[gf];if(yf==null||gf.startsWith("__"))continue;const vf=yf.name;if(!vf.startsWith("__")){if(Ra[vf]!=null){console.warn(`Duplicate schema type name ${vf} found; keeping the existing one found in the schema`);continue}Ra[vf]=yf}}for(const gf in Ra)Ra[gf]=df(Ra[gf]);const pc=Ai.map(gf=>mc(gf));return{typeMap:Ra,directives:pc};function mc(gf){if(isSpecifiedDirective(gf))return gf;const yf=gf.toConfig();return yf.args=uf(yf.args),new GraphQLDirective(yf)}function uf(gf){const yf={};for(const vf in gf){const bf=gf[vf],Sf=mf(bf.type);Sf!=null&&(bf.type=Sf,yf[vf]=bf)}return yf}function df(gf){if(isObjectType(gf)){const yf=gf.toConfig(),vf={...yf,fields:()=>ff(yf.fields),interfaces:()=>pf(yf.interfaces)};return new GraphQLObjectType(vf)}else if(isInterfaceType(gf)){const yf=gf.toConfig(),vf={...yf,fields:()=>ff(yf.fields)};return"interfaces"in vf&&(vf.interfaces=()=>pf(yf.interfaces)),new GraphQLInterfaceType(vf)}else if(isUnionType(gf)){const yf=gf.toConfig(),vf={...yf,types:()=>pf(yf.types)};return new GraphQLUnionType(vf)}else if(isInputObjectType(gf)){const yf=gf.toConfig(),vf={...yf,fields:()=>hf(yf.fields)};return new GraphQLInputObjectType(vf)}else if(isEnumType(gf)){const yf=gf.toConfig();return new GraphQLEnumType(yf)}else if(isScalarType(gf)){if(isSpecifiedScalarType(gf))return gf;const yf=gf.toConfig();return new GraphQLScalarType(yf)}throw new Error(`Unexpected schema type: ${gf}`)}function ff(gf){const yf={};for(const vf in gf){const bf=gf[vf],Sf=mf(bf.type);Sf!=null&&bf.args&&(bf.type=Sf,bf.args=uf(bf.args),yf[vf]=bf)}return yf}function hf(gf){const yf={};for(const vf in gf){const bf=gf[vf],Sf=mf(bf.type);Sf!=null&&(bf.type=Sf,yf[vf]=bf)}return yf}function pf(gf){const yf=[];for(const vf of gf){const bf=mf(vf);bf!=null&&yf.push(bf)}return yf}function mf(gf){if(isListType(gf)){const yf=mf(gf.ofType);return yf!=null?new GraphQLList(yf):null}else if(isNonNullType(gf)){const yf=mf(gf.ofType);return yf!=null?new GraphQLNonNull(yf):null}else if(isNamedType(gf)){let yf=bo[gf.name];return yf===void 0&&(yf=isNamedStub(gf)?getBuiltInForStub(gf):df(gf),Ra[yf.name]=bo[gf.name]=yf),yf!=null?Ra[yf.name]:null}return null}}function transformInputValue(vo,Ai,bo=null,Ra=null){if(Ai==null)return Ai;const pc=getNullableType(vo);if(isLeafType(pc))return bo!=null?bo(pc,Ai):Ai;if(isListType(pc))return asArray(Ai).map(mc=>transformInputValue(pc.ofType,mc,bo,Ra));if(isInputObjectType(pc)){const mc=pc.getFields(),uf={};for(const df in Ai){const ff=mc[df];ff!=null&&(uf[df]=transformInputValue(ff.type,Ai[df],bo,Ra))}return Ra!=null?Ra(pc,uf):uf}}function serializeInputValue(vo,Ai){return transformInputValue(vo,Ai,(bo,Ra)=>{try{return bo.serialize(Ra)}catch{return Ra}})}function parseInputValue(vo,Ai){return transformInputValue(vo,Ai,(bo,Ra)=>{try{return bo.parseValue(Ra)}catch{return Ra}})}function mapSchema(vo,Ai={}){const bo=mapArguments(mapFields(mapTypes(mapDefaultValues(mapEnumValues(mapTypes(mapDefaultValues(vo.getTypeMap(),vo,serializeInputValue),vo,Ai,df=>isLeafType(df)),vo,Ai),vo,parseInputValue),vo,Ai,df=>!isLeafType(df)),vo,Ai),vo,Ai),Ra=vo.getDirectives(),pc=mapDirectives(Ra,vo,Ai),{typeMap:mc,directives:uf}=rewireTypes(bo,pc);return new GraphQLSchema({...vo.toConfig(),query:getObjectTypeFromTypeMap(mc,getObjectTypeFromTypeMap(bo,vo.getQueryType())),mutation:getObjectTypeFromTypeMap(mc,getObjectTypeFromTypeMap(bo,vo.getMutationType())),subscription:getObjectTypeFromTypeMap(mc,getObjectTypeFromTypeMap(bo,vo.getSubscriptionType())),types:Object.values(mc),directives:uf})}function mapTypes(vo,Ai,bo,Ra=()=>!0){const pc={};for(const mc in vo)if(!mc.startsWith("__")){const uf=vo[mc];if(uf==null||!Ra(uf)){pc[mc]=uf;continue}const df=getTypeMapper(Ai,bo,mc);if(df==null){pc[mc]=uf;continue}const ff=df(uf,Ai);if(ff===void 0){pc[mc]=uf;continue}pc[mc]=ff}return pc}function mapEnumValues(vo,Ai,bo){const Ra=getEnumValueMapper(bo);return Ra?mapTypes(vo,Ai,{[MapperKind.ENUM_TYPE]:pc=>{const mc=pc.toConfig(),uf=mc.values,df={};for(const ff in uf){const hf=uf[ff],pf=Ra(hf,pc.name,Ai,ff);if(pf===void 0)df[ff]=hf;else if(Array.isArray(pf)){const[mf,gf]=pf;df[mf]=gf===void 0?hf:gf}else pf!==null&&(df[ff]=pf)}return correctASTNodes(new GraphQLEnumType({...mc,values:df}))}},pc=>isEnumType(pc)):vo}function mapDefaultValues(vo,Ai,bo){const Ra=mapArguments(vo,Ai,{[MapperKind.ARGUMENT]:pc=>{if(pc.defaultValue===void 0)return pc;const mc=getNewType(vo,pc.type);if(mc!=null)return{...pc,defaultValue:bo(mc,pc.defaultValue)}}});return mapFields(Ra,Ai,{[MapperKind.INPUT_OBJECT_FIELD]:pc=>{if(pc.defaultValue===void 0)return pc;const mc=getNewType(Ra,pc.type);if(mc!=null)return{...pc,defaultValue:bo(mc,pc.defaultValue)}}})}function getNewType(vo,Ai){if(isListType(Ai)){const bo=getNewType(vo,Ai.ofType);return bo!=null?new GraphQLList(bo):null}else if(isNonNullType(Ai)){const bo=getNewType(vo,Ai.ofType);return bo!=null?new GraphQLNonNull(bo):null}else if(isNamedType(Ai))return vo[Ai.name]??null;return null}function mapFields(vo,Ai,bo){const Ra={};for(const pc in vo)if(!pc.startsWith("__")){const mc=vo[pc];if(!isObjectType(mc)&&!isInterfaceType(mc)&&!isInputObjectType(mc)){Ra[pc]=mc;continue}const uf=getFieldMapper(Ai,bo,pc);if(uf==null){Ra[pc]=mc;continue}const df=mc.toConfig(),ff=df.fields,hf={};for(const pf in ff){const mf=ff[pf],gf=uf(mf,pf,pc,Ai);if(gf===void 0)hf[pf]=mf;else if(Array.isArray(gf)){const[yf,vf]=gf;vf.astNode!=null&&(vf.astNode={...vf.astNode,name:{...vf.astNode.name,value:yf}}),hf[yf]=vf===void 0?mf:vf}else gf!==null&&(hf[pf]=gf)}isObjectType(mc)?Ra[pc]=correctASTNodes(new GraphQLObjectType({...df,fields:hf})):isInterfaceType(mc)?Ra[pc]=correctASTNodes(new GraphQLInterfaceType({...df,fields:hf})):Ra[pc]=correctASTNodes(new GraphQLInputObjectType({...df,fields:hf}))}return Ra}function mapArguments(vo,Ai,bo){const Ra={};for(const pc in vo)if(!pc.startsWith("__")){const mc=vo[pc];if(!isObjectType(mc)&&!isInterfaceType(mc)){Ra[pc]=mc;continue}const uf=getArgumentMapper(bo);if(uf==null){Ra[pc]=mc;continue}const df=mc.toConfig(),ff=df.fields,hf={};for(const pf in ff){const mf=ff[pf],gf=mf.args;if(gf==null){hf[pf]=mf;continue}const yf=Object.keys(gf);if(!yf.length){hf[pf]=mf;continue}const vf={};for(const bf of yf){const Sf=gf[bf],xf=uf(Sf,pf,pc,Ai);if(xf===void 0)vf[bf]=Sf;else if(Array.isArray(xf)){const[wf,If]=xf;vf[wf]=If}else xf!==null&&(vf[bf]=xf)}hf[pf]={...mf,args:vf}}isObjectType(mc)?Ra[pc]=new GraphQLObjectType({...df,fields:hf}):isInterfaceType(mc)?Ra[pc]=new GraphQLInterfaceType({...df,fields:hf}):Ra[pc]=new GraphQLInputObjectType({...df,fields:hf})}return Ra}function mapDirectives(vo,Ai,bo){const Ra=getDirectiveMapper(bo);if(Ra==null)return vo.slice();const pc=[];for(const mc of vo){const uf=Ra(mc,Ai);uf===void 0?pc.push(mc):uf!==null&&pc.push(uf)}return pc}function getTypeSpecifiers(vo,Ai){var bo,Ra,pc;const mc=vo.getType(Ai),uf=[MapperKind.TYPE];return isObjectType(mc)?(uf.push(MapperKind.COMPOSITE_TYPE,MapperKind.OBJECT_TYPE),Ai===((bo=vo.getQueryType())==null?void 0:bo.name)?uf.push(MapperKind.ROOT_OBJECT,MapperKind.QUERY):Ai===((Ra=vo.getMutationType())==null?void 0:Ra.name)?uf.push(MapperKind.ROOT_OBJECT,MapperKind.MUTATION):Ai===((pc=vo.getSubscriptionType())==null?void 0:pc.name)&&uf.push(MapperKind.ROOT_OBJECT,MapperKind.SUBSCRIPTION)):isInputObjectType(mc)?uf.push(MapperKind.INPUT_OBJECT_TYPE):isInterfaceType(mc)?uf.push(MapperKind.COMPOSITE_TYPE,MapperKind.ABSTRACT_TYPE,MapperKind.INTERFACE_TYPE):isUnionType(mc)?uf.push(MapperKind.COMPOSITE_TYPE,MapperKind.ABSTRACT_TYPE,MapperKind.UNION_TYPE):isEnumType(mc)?uf.push(MapperKind.ENUM_TYPE):isScalarType(mc)&&uf.push(MapperKind.SCALAR_TYPE),uf}function getTypeMapper(vo,Ai,bo){const Ra=getTypeSpecifiers(vo,bo);let pc;const mc=[...Ra];for(;!pc&&mc.length>0;){const uf=mc.pop();pc=Ai[uf]}return pc??null}function getFieldSpecifiers(vo,Ai){var bo,Ra,pc;const mc=vo.getType(Ai),uf=[MapperKind.FIELD];return isObjectType(mc)?(uf.push(MapperKind.COMPOSITE_FIELD,MapperKind.OBJECT_FIELD),Ai===((bo=vo.getQueryType())==null?void 0:bo.name)?uf.push(MapperKind.ROOT_FIELD,MapperKind.QUERY_ROOT_FIELD):Ai===((Ra=vo.getMutationType())==null?void 0:Ra.name)?uf.push(MapperKind.ROOT_FIELD,MapperKind.MUTATION_ROOT_FIELD):Ai===((pc=vo.getSubscriptionType())==null?void 0:pc.name)&&uf.push(MapperKind.ROOT_FIELD,MapperKind.SUBSCRIPTION_ROOT_FIELD)):isInterfaceType(mc)?uf.push(MapperKind.COMPOSITE_FIELD,MapperKind.INTERFACE_FIELD):isInputObjectType(mc)&&uf.push(MapperKind.INPUT_OBJECT_FIELD),uf}function getFieldMapper(vo,Ai,bo){const Ra=getFieldSpecifiers(vo,bo);let pc;const mc=[...Ra];for(;!pc&&mc.length>0;){const uf=mc.pop();pc=Ai[uf]}return pc??null}function getArgumentMapper(vo){return vo[MapperKind.ARGUMENT]??null}function getDirectiveMapper(vo){return vo[MapperKind.DIRECTIVE]??null}function getEnumValueMapper(vo){return vo[MapperKind.ENUM_VALUE]??null}function correctASTNodes(vo){if(isObjectType(vo)){const Ai=vo.toConfig();if(Ai.astNode!=null){const bo=[];for(const Ra in Ai.fields){const pc=Ai.fields[Ra];pc.astNode!=null&&bo.push(pc.astNode)}Ai.astNode={...Ai.astNode,kind:Kind.OBJECT_TYPE_DEFINITION,fields:bo}}return Ai.extensionASTNodes!=null&&(Ai.extensionASTNodes=Ai.extensionASTNodes.map(bo=>({...bo,kind:Kind.OBJECT_TYPE_EXTENSION,fields:void 0}))),new GraphQLObjectType(Ai)}else if(isInterfaceType(vo)){const Ai=vo.toConfig();if(Ai.astNode!=null){const bo=[];for(const Ra in Ai.fields){const pc=Ai.fields[Ra];pc.astNode!=null&&bo.push(pc.astNode)}Ai.astNode={...Ai.astNode,kind:Kind.INTERFACE_TYPE_DEFINITION,fields:bo}}return Ai.extensionASTNodes!=null&&(Ai.extensionASTNodes=Ai.extensionASTNodes.map(bo=>({...bo,kind:Kind.INTERFACE_TYPE_EXTENSION,fields:void 0}))),new GraphQLInterfaceType(Ai)}else if(isInputObjectType(vo)){const Ai=vo.toConfig();if(Ai.astNode!=null){const bo=[];for(const Ra in Ai.fields){const pc=Ai.fields[Ra];pc.astNode!=null&&bo.push(pc.astNode)}Ai.astNode={...Ai.astNode,kind:Kind.INPUT_OBJECT_TYPE_DEFINITION,fields:bo}}return Ai.extensionASTNodes!=null&&(Ai.extensionASTNodes=Ai.extensionASTNodes.map(bo=>({...bo,kind:Kind.INPUT_OBJECT_TYPE_EXTENSION,fields:void 0}))),new GraphQLInputObjectType(Ai)}else if(isEnumType(vo)){const Ai=vo.toConfig();if(Ai.astNode!=null){const bo=[];for(const Ra in Ai.values){const pc=Ai.values[Ra];pc.astNode!=null&&bo.push(pc.astNode)}Ai.astNode={...Ai.astNode,values:bo}}return Ai.extensionASTNodes!=null&&(Ai.extensionASTNodes=Ai.extensionASTNodes.map(bo=>({...bo,values:void 0}))),new GraphQLEnumType(Ai)}else return vo}function filterSchema({schema:vo,typeFilter:Ai=()=>!0,fieldFilter:bo=void 0,rootFieldFilter:Ra=void 0,objectFieldFilter:pc=void 0,interfaceFieldFilter:mc=void 0,inputObjectFieldFilter:uf=void 0,argumentFilter:df=void 0,directiveFilter:ff=void 0,enumValueFilter:hf=void 0}){return mapSchema(vo,{[MapperKind.QUERY]:pf=>filterRootFields(pf,"Query",Ra,df),[MapperKind.MUTATION]:pf=>filterRootFields(pf,"Mutation",Ra,df),[MapperKind.SUBSCRIPTION]:pf=>filterRootFields(pf,"Subscription",Ra,df),[MapperKind.OBJECT_TYPE]:pf=>Ai(pf.name,pf)?filterElementFields(GraphQLObjectType,pf,pc||bo,df):null,[MapperKind.INTERFACE_TYPE]:pf=>Ai(pf.name,pf)?filterElementFields(GraphQLInterfaceType,pf,mc||bo,df):null,[MapperKind.INPUT_OBJECT_TYPE]:pf=>Ai(pf.name,pf)?filterElementFields(GraphQLInputObjectType,pf,uf||bo):null,[MapperKind.UNION_TYPE]:pf=>Ai(pf.name,pf)?void 0:null,[MapperKind.ENUM_TYPE]:pf=>Ai(pf.name,pf)?void 0:null,[MapperKind.SCALAR_TYPE]:pf=>Ai(pf.name,pf)?void 0:null,[MapperKind.DIRECTIVE]:pf=>ff&&!ff(pf.name,pf)?null:void 0,[MapperKind.ENUM_VALUE]:(pf,mf,gf,yf)=>hf&&!hf(mf,yf,pf)?null:void 0})}function filterRootFields(vo,Ai,bo,Ra){if(bo||Ra){const pc=vo.toConfig();for(const mc in pc.fields){const uf=pc.fields[mc];if(bo&&!bo(Ai,mc,pc.fields[mc]))delete pc.fields[mc];else if(Ra&&uf.args)for(const df in uf.args)Ra(vo.name,mc,df,uf.args[df])||delete uf.args[df]}return new GraphQLObjectType(pc)}return vo}function filterElementFields(vo,Ai,bo,Ra){if(bo||Ra){const pc=Ai.toConfig();for(const mc in pc.fields){const uf=pc.fields[mc];if(bo&&!bo(Ai.name,mc,pc.fields[mc]))delete pc.fields[mc];else if(Ra&&"args"in uf)for(const df in uf.args)Ra(Ai.name,mc,df,uf.args[df])||delete uf.args[df]}return new vo(pc)}}const hiddenQueryTypeDefinitions=parse(hiddenQueryTypeDefDoc).definitions,standardLibCustomScalarDefinitions=parse(typeDefsDoc).definitions,alwaysIncludedDefinitions=[...hiddenQueryTypeDefinitions,...standardLibCustomScalarDefinitions],rules=createDefaultRules().filter(vo=>vo.name!=="ExecutableDefinitionsRule");function makeSharedSchemaSdl(vo,Ai,bo,Ra){try{const pc=buildSchema(vo),mc=[Ai,bo,Ra].filter(Boolean).map(df=>safeParseSdl(df)).filter(Boolean),uf=makeSafeDocumentNode(pc,mc);return printSchema(buildASTSchema(uf))}catch(pc){return console.debug("in make shared schema",pc),vo}}function makeSafeDocumentNode(vo,Ai){try{const bo=[...alwaysIncludedDefinitions];for(const Ra of Ai)for(const pc of Ra.definitions){const mc={kind:Kind.DOCUMENT,definitions:[pc]};safeValidateAst(vo,mc)&&bo.push(pc)}return{kind:Kind.DOCUMENT,definitions:bo}}catch(bo){return console.debug("in make safe document node",bo),{kind:Kind.DOCUMENT,definitions:alwaysIncludedDefinitions}}}function safeValidateAst(vo,Ai){try{return!validate(vo,Ai,rules).length}catch(bo){return console.debug("in safe validate",bo),!1}}function safeParseSdl(vo){try{return!vo||!isDocumentString(vo)?null:parse(vo)}catch(Ai){return console.debug("in safe parse",Ai),null}}const SchemaContext=createContext(printSchema(initialSchema));function SchemaContextProvider(vo){const{children:Ai,globalStateSchemaSdl:bo,localStateSchemaSdl:Ra,operationSchemasSdl:pc}=vo,[mc,uf]=useState(()=>makeSharedSchemaSdl(printSchema(initialSchema),bo,Ra,pc));return useEffect(()=>{uf(df=>makeSharedSchemaSdl(df,bo,Ra,pc))},[bo,Ra,pc]),jsx(SchemaContext.Provider,{value:mc,children:Ai})}function useSchemaContext(){return useContext(SchemaContext)}class CompletionContext{constructor(Ai,bo,Ra,pc){this.state=Ai,this.pos=bo,this.explicit=Ra,this.view=pc,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(Ai){let bo=syntaxTree(this.state).resolveInner(this.pos,-1);for(;bo&&Ai.indexOf(bo.name)<0;)bo=bo.parent;return bo?{from:bo.from,to:this.pos,text:this.state.sliceDoc(bo.from,this.pos),type:bo.type}:null}matchBefore(Ai){let bo=this.state.doc.lineAt(this.pos),Ra=Math.max(bo.from,this.pos-250),pc=bo.text.slice(Ra-bo.from,this.pos-bo.from),mc=pc.search(ensureAnchor(Ai,!1));return mc<0?null:{from:Ra+mc,to:this.pos,text:pc.slice(mc)}}get aborted(){return this.abortListeners==null}addEventListener(Ai,bo,Ra){Ai=="abort"&&this.abortListeners&&(this.abortListeners.push(bo),Ra&&Ra.onDocChange&&(this.abortOnDocChange=!0))}}function toSet(vo){let Ai=Object.keys(vo).join(""),bo=/\w/.test(Ai);return bo&&(Ai=Ai.replace(/\w/g,"")),`[${bo?"\\w":""}${Ai.replace(/[^\w\s]/g,"\\$&")}]`}function prefixMatch(vo){let Ai=Object.create(null),bo=Object.create(null);for(let{label:pc}of vo){Ai[pc[0]]=!0;for(let mc=1;mc<pc.length;mc++)bo[pc[mc]]=!0}let Ra=toSet(Ai)+toSet(bo)+"*$";return[new RegExp("^"+Ra),new RegExp(Ra)]}function completeFromList(vo){let Ai=vo.map(pc=>typeof pc=="string"?{label:pc}:pc),[bo,Ra]=Ai.every(pc=>/^\w+$/.test(pc.label))?[/\w*$/,/\w+$/]:prefixMatch(Ai);return pc=>{let mc=pc.matchBefore(Ra);return mc||pc.explicit?{from:mc?mc.from:pc.pos,options:Ai,validFor:bo}:null}}class Option{constructor(Ai,bo,Ra,pc){this.completion=Ai,this.source=bo,this.match=Ra,this.score=pc}}function cur(vo){return vo.selection.main.from}function ensureAnchor(vo,Ai){var bo;let{source:Ra}=vo,pc=Ai&&Ra[0]!="^",mc=Ra[Ra.length-1]!="$";return!pc&&!mc?vo:new RegExp(`${pc?"^":""}(?:${Ra})${mc?"$":""}`,(bo=vo.flags)!==null&&bo!==void 0?bo:vo.ignoreCase?"i":"")}const pickedCompletion=Annotation.define();function insertCompletionText(vo,Ai,bo,Ra){let{main:pc}=vo.selection,mc=bo-pc.from,uf=Ra-pc.from;return Object.assign(Object.assign({},vo.changeByRange(df=>{if(df!=pc&&bo!=Ra&&vo.sliceDoc(df.from+mc,df.from+uf)!=vo.sliceDoc(bo,Ra))return{range:df};let ff=vo.toText(Ai);return{changes:{from:df.from+mc,to:Ra==pc.from?df.to:df.from+uf,insert:ff},range:EditorSelection.cursor(df.from+mc+ff.length)}})),{scrollIntoView:!0,userEvent:"input.complete"})}const SourceCache=new WeakMap;function asSource(vo){if(!Array.isArray(vo))return vo;let Ai=SourceCache.get(vo);return Ai||SourceCache.set(vo,Ai=completeFromList(vo)),Ai}const startCompletionEffect=StateEffect.define(),closeCompletionEffect=StateEffect.define();class FuzzyMatcher{constructor(Ai){this.pattern=Ai,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let bo=0;bo<Ai.length;){let Ra=codePointAt(Ai,bo),pc=codePointSize(Ra);this.chars.push(Ra);let mc=Ai.slice(bo,bo+pc),uf=mc.toUpperCase();this.folded.push(codePointAt(uf==mc?mc.toLowerCase():uf,0)),bo+=pc}this.astral=Ai.length!=this.chars.length}ret(Ai,bo){return this.score=Ai,this.matched=bo,this}match(Ai){if(this.pattern.length==0)return this.ret(-100,[]);if(Ai.length<this.pattern.length)return null;let{chars:bo,folded:Ra,any:pc,precise:mc,byWord:uf}=this;if(bo.length==1){let wf=codePointAt(Ai,0),If=codePointSize(wf),l1=If==Ai.length?0:-100;if(wf!=bo[0])if(wf==Ra[0])l1+=-200;else return null;return this.ret(l1,[0,If])}let df=Ai.indexOf(this.pattern);if(df==0)return this.ret(Ai.length==this.pattern.length?0:-100,[0,this.pattern.length]);let ff=bo.length,hf=0;if(df<0){for(let wf=0,If=Math.min(Ai.length,200);wf<If&&hf<ff;){let l1=codePointAt(Ai,wf);(l1==bo[hf]||l1==Ra[hf])&&(pc[hf++]=wf),wf+=codePointSize(l1)}if(hf<ff)return null}let pf=0,mf=0,gf=!1,yf=0,vf=-1,bf=-1,Sf=/[a-z]/.test(Ai),xf=!0;for(let wf=0,If=Math.min(Ai.length,200),l1=0;wf<If&&mf<ff;){let s1=codePointAt(Ai,wf);df<0&&(pf<ff&&s1==bo[pf]&&(mc[pf++]=wf),yf<ff&&(s1==bo[yf]||s1==Ra[yf]?(yf==0&&(vf=wf),bf=wf+1,yf++):yf=0));let c1,u1=s1<255?s1>=48&&s1<=57||s1>=97&&s1<=122?2:s1>=65&&s1<=90?1:0:(c1=fromCodePoint(s1))!=c1.toLowerCase()?1:c1!=c1.toUpperCase()?2:0;(!wf||u1==1&&Sf||l1==0&&u1!=0)&&(bo[mf]==s1||Ra[mf]==s1&&(gf=!0)?uf[mf++]=wf:uf.length&&(xf=!1)),l1=u1,wf+=codePointSize(s1)}return mf==ff&&uf[0]==0&&xf?this.result(-100+(gf?-200:0),uf,Ai):yf==ff&&vf==0?this.ret(-200-Ai.length+(bf==Ai.length?0:-100),[0,bf]):df>-1?this.ret(-700-Ai.length,[df,df+this.pattern.length]):yf==ff?this.ret(-900-Ai.length,[vf,bf]):mf==ff?this.result(-100+(gf?-200:0)+-700+(xf?0:-1100),uf,Ai):bo.length==2?null:this.result((pc[0]?-700:0)+-200+-1100,pc,Ai)}result(Ai,bo,Ra){let pc=[],mc=0;for(let uf of bo){let df=uf+(this.astral?codePointSize(codePointAt(Ra,uf)):1);mc&&pc[mc-1]==uf?pc[mc-1]=df:(pc[mc++]=uf,pc[mc++]=df)}return this.ret(Ai-Ra.length,pc)}}class StrictMatcher{constructor(Ai){this.pattern=Ai,this.matched=[],this.score=0,this.folded=Ai.toLowerCase()}match(Ai){if(Ai.length<this.pattern.length)return null;let bo=Ai.slice(0,this.pattern.length),Ra=bo==this.pattern?0:bo.toLowerCase()==this.folded?-200:null;return Ra==null?null:(this.matched=[0,bo.length],this.score=Ra+(Ai.length==this.pattern.length?0:-100),this)}}const completionConfig=Facet.define({combine(vo){return combineConfig(vo,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:defaultPositionInfo,filterStrict:!1,compareCompletions:(Ai,bo)=>Ai.label.localeCompare(bo.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(Ai,bo)=>Ai&&bo,closeOnBlur:(Ai,bo)=>Ai&&bo,icons:(Ai,bo)=>Ai&&bo,tooltipClass:(Ai,bo)=>Ra=>joinClass(Ai(Ra),bo(Ra)),optionClass:(Ai,bo)=>Ra=>joinClass(Ai(Ra),bo(Ra)),addToOptions:(Ai,bo)=>Ai.concat(bo),filterStrict:(Ai,bo)=>Ai||bo})}});function joinClass(vo,Ai){return vo?Ai?vo+" "+Ai:vo:Ai}function defaultPositionInfo(vo,Ai,bo,Ra,pc,mc){let uf=vo.textDirection==Direction.RTL,df=uf,ff=!1,hf="top",pf,mf,gf=Ai.left-pc.left,yf=pc.right-Ai.right,vf=Ra.right-Ra.left,bf=Ra.bottom-Ra.top;if(df&&gf<Math.min(vf,yf)?df=!1:!df&&yf<Math.min(vf,gf)&&(df=!0),vf<=(df?gf:yf))pf=Math.max(pc.top,Math.min(bo.top,pc.bottom-bf))-Ai.top,mf=Math.min(400,df?gf:yf);else{ff=!0,mf=Math.min(400,(uf?Ai.right:pc.right-Ai.left)-30);let wf=pc.bottom-Ai.bottom;wf>=bf||wf>Ai.top?pf=bo.bottom-Ai.top:(hf="bottom",pf=Ai.bottom-bo.top)}let Sf=(Ai.bottom-Ai.top)/mc.offsetHeight,xf=(Ai.right-Ai.left)/mc.offsetWidth;return{style:`${hf}: ${pf/Sf}px; max-width: ${mf/xf}px`,class:"cm-completionInfo-"+(ff?uf?"left-narrow":"right-narrow":df?"left":"right")}}function optionContent(vo){let Ai=vo.addToOptions.slice();return vo.icons&&Ai.push({render(bo){let Ra=document.createElement("div");return Ra.classList.add("cm-completionIcon"),bo.type&&Ra.classList.add(...bo.type.split(/\s+/g).map(pc=>"cm-completionIcon-"+pc)),Ra.setAttribute("aria-hidden","true"),Ra},position:20}),Ai.push({render(bo,Ra,pc,mc){let uf=document.createElement("span");uf.className="cm-completionLabel";let df=bo.displayLabel||bo.label,ff=0;for(let hf=0;hf<mc.length;){let pf=mc[hf++],mf=mc[hf++];pf>ff&&uf.appendChild(document.createTextNode(df.slice(ff,pf)));let gf=uf.appendChild(document.createElement("span"));gf.appendChild(document.createTextNode(df.slice(pf,mf))),gf.className="cm-completionMatchedText",ff=mf}return ff<df.length&&uf.appendChild(document.createTextNode(df.slice(ff))),uf},position:50},{render(bo){if(!bo.detail)return null;let Ra=document.createElement("span");return Ra.className="cm-completionDetail",Ra.textContent=bo.detail,Ra},position:80}),Ai.sort((bo,Ra)=>bo.position-Ra.position).map(bo=>bo.render)}function rangeAroundSelected(vo,Ai,bo){if(vo<=bo)return{from:0,to:vo};if(Ai<0&&(Ai=0),Ai<=vo>>1){let pc=Math.floor(Ai/bo);return{from:pc*bo,to:(pc+1)*bo}}let Ra=Math.floor((vo-Ai)/bo);return{from:vo-(Ra+1)*bo,to:vo-Ra*bo}}class CompletionTooltip{constructor(Ai,bo,Ra){this.view=Ai,this.stateField=bo,this.applyCompletion=Ra,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:ff=>this.placeInfo(ff),key:this},this.space=null,this.currentClass="";let pc=Ai.state.field(bo),{options:mc,selected:uf}=pc.open,df=Ai.state.facet(completionConfig);this.optionContent=optionContent(df),this.optionClass=df.optionClass,this.tooltipClass=df.tooltipClass,this.range=rangeAroundSelected(mc.length,uf,df.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(Ai.state),this.dom.addEventListener("mousedown",ff=>{let{options:hf}=Ai.state.field(bo).open;for(let pf=ff.target,mf;pf&&pf!=this.dom;pf=pf.parentNode)if(pf.nodeName=="LI"&&(mf=/-(\d+)$/.exec(pf.id))&&+mf[1]<hf.length){this.applyCompletion(Ai,hf[+mf[1]]),ff.preventDefault();return}}),this.dom.addEventListener("focusout",ff=>{let hf=Ai.state.field(this.stateField,!1);hf&&hf.tooltip&&Ai.state.facet(completionConfig).closeOnBlur&&ff.relatedTarget!=Ai.contentDOM&&Ai.dispatch({effects:closeCompletionEffect.of(null)})}),this.showOptions(mc,pc.id)}mount(){this.updateSel()}showOptions(Ai,bo){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(Ai,bo,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(Ai){var bo;let Ra=Ai.state.field(this.stateField),pc=Ai.startState.field(this.stateField);if(this.updateTooltipClass(Ai.state),Ra!=pc){let{options:mc,selected:uf,disabled:df}=Ra.open;(!pc.open||pc.open.options!=mc)&&(this.range=rangeAroundSelected(mc.length,uf,Ai.state.facet(completionConfig).maxRenderedOptions),this.showOptions(mc,Ra.id)),this.updateSel(),df!=((bo=pc.open)===null||bo===void 0?void 0:bo.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!df)}}updateTooltipClass(Ai){let bo=this.tooltipClass(Ai);if(bo!=this.currentClass){for(let Ra of this.currentClass.split(" "))Ra&&this.dom.classList.remove(Ra);for(let Ra of bo.split(" "))Ra&&this.dom.classList.add(Ra);this.currentClass=bo}}positioned(Ai){this.space=Ai,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let Ai=this.view.state.field(this.stateField),bo=Ai.open;if((bo.selected>-1&&bo.selected<this.range.from||bo.selected>=this.range.to)&&(this.range=rangeAroundSelected(bo.options.length,bo.selected,this.view.state.facet(completionConfig).maxRenderedOptions),this.showOptions(bo.options,Ai.id)),this.updateSelectedOption(bo.selected)){this.destroyInfo();let{completion:Ra}=bo.options[bo.selected],{info:pc}=Ra;if(!pc)return;let mc=typeof pc=="string"?document.createTextNode(pc):pc(Ra);if(!mc)return;"then"in mc?mc.then(uf=>{uf&&this.view.state.field(this.stateField,!1)==Ai&&this.addInfoPane(uf,Ra)}).catch(uf=>logException(this.view.state,uf,"completion info")):this.addInfoPane(mc,Ra)}}addInfoPane(Ai,bo){this.destroyInfo();let Ra=this.info=document.createElement("div");if(Ra.className="cm-tooltip cm-completionInfo",Ai.nodeType!=null)Ra.appendChild(Ai),this.infoDestroy=null;else{let{dom:pc,destroy:mc}=Ai;Ra.appendChild(pc),this.infoDestroy=mc||null}this.dom.appendChild(Ra),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(Ai){let bo=null;for(let Ra=this.list.firstChild,pc=this.range.from;Ra;Ra=Ra.nextSibling,pc++)Ra.nodeName!="LI"||!Ra.id?pc--:pc==Ai?Ra.hasAttribute("aria-selected")||(Ra.setAttribute("aria-selected","true"),bo=Ra):Ra.hasAttribute("aria-selected")&&Ra.removeAttribute("aria-selected");return bo&&scrollIntoView(this.list,bo),bo}measureInfo(){let Ai=this.dom.querySelector("[aria-selected]");if(!Ai||!this.info)return null;let bo=this.dom.getBoundingClientRect(),Ra=this.info.getBoundingClientRect(),pc=Ai.getBoundingClientRect(),mc=this.space;if(!mc){let uf=this.dom.ownerDocument.defaultView||window;mc={left:0,top:0,right:uf.innerWidth,bottom:uf.innerHeight}}return pc.top>Math.min(mc.bottom,bo.bottom)-10||pc.bottom<Math.max(mc.top,bo.top)+10?null:this.view.state.facet(completionConfig).positionInfo(this.view,bo,pc,Ra,mc,this.dom)}placeInfo(Ai){this.info&&(Ai?(Ai.style&&(this.info.style.cssText=Ai.style),this.info.className="cm-tooltip cm-completionInfo "+(Ai.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(Ai,bo,Ra){const pc=document.createElement("ul");pc.id=bo,pc.setAttribute("role","listbox"),pc.setAttribute("aria-expanded","true"),pc.setAttribute("aria-label",this.view.state.phrase("Completions"));let mc=null;for(let uf=Ra.from;uf<Ra.to;uf++){let{completion:df,match:ff}=Ai[uf],{section:hf}=df;if(hf){let gf=typeof hf=="string"?hf:hf.name;if(gf!=mc&&(uf>Ra.from||Ra.from==0))if(mc=gf,typeof hf!="string"&&hf.header)pc.appendChild(hf.header(hf));else{let yf=pc.appendChild(document.createElement("completion-section"));yf.textContent=gf}}const pf=pc.appendChild(document.createElement("li"));pf.id=bo+"-"+uf,pf.setAttribute("role","option");let mf=this.optionClass(df);mf&&(pf.className=mf);for(let gf of this.optionContent){let yf=gf(df,this.view.state,this.view,ff);yf&&pf.appendChild(yf)}}return Ra.from&&pc.classList.add("cm-completionListIncompleteTop"),Ra.to<Ai.length&&pc.classList.add("cm-completionListIncompleteBottom"),pc}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function completionTooltip(vo,Ai){return bo=>new CompletionTooltip(bo,vo,Ai)}function scrollIntoView(vo,Ai){let bo=vo.getBoundingClientRect(),Ra=Ai.getBoundingClientRect(),pc=bo.height/vo.offsetHeight;Ra.top<bo.top?vo.scrollTop-=(bo.top-Ra.top)/pc:Ra.bottom>bo.bottom&&(vo.scrollTop+=(Ra.bottom-bo.bottom)/pc)}function score(vo){return(vo.boost||0)*100+(vo.apply?10:0)+(vo.info?5:0)+(vo.type?1:0)}function sortOptions(vo,Ai){let bo=[],Ra=null,pc=hf=>{bo.push(hf);let{section:pf}=hf.completion;if(pf){Ra||(Ra=[]);let mf=typeof pf=="string"?pf:pf.name;Ra.some(gf=>gf.name==mf)||Ra.push(typeof pf=="string"?{name:mf}:pf)}},mc=Ai.facet(completionConfig);for(let hf of vo)if(hf.hasResult()){let pf=hf.result.getMatch;if(hf.result.filter===!1)for(let mf of hf.result.options)pc(new Option(mf,hf.source,pf?pf(mf):[],1e9-bo.length));else{let mf=Ai.sliceDoc(hf.from,hf.to),gf,yf=mc.filterStrict?new StrictMatcher(mf):new FuzzyMatcher(mf);for(let vf of hf.result.options)if(gf=yf.match(vf.label)){let bf=vf.displayLabel?pf?pf(vf,gf.matched):[]:gf.matched;pc(new Option(vf,hf.source,bf,gf.score+(vf.boost||0)))}}}if(Ra){let hf=Object.create(null),pf=0,mf=(gf,yf)=>{var vf,bf;return((vf=gf.rank)!==null&&vf!==void 0?vf:1e9)-((bf=yf.rank)!==null&&bf!==void 0?bf:1e9)||(gf.name<yf.name?-1:1)};for(let gf of Ra.sort(mf))pf-=1e5,hf[gf.name]=pf;for(let gf of bo){let{section:yf}=gf.completion;yf&&(gf.score+=hf[typeof yf=="string"?yf:yf.name])}}let uf=[],df=null,ff=mc.compareCompletions;for(let hf of bo.sort((pf,mf)=>mf.score-pf.score||ff(pf.completion,mf.completion))){let pf=hf.completion;!df||df.label!=pf.label||df.detail!=pf.detail||df.type!=null&&pf.type!=null&&df.type!=pf.type||df.apply!=pf.apply||df.boost!=pf.boost?uf.push(hf):score(hf.completion)>score(df)&&(uf[uf.length-1]=hf),df=hf.completion}return uf}class CompletionDialog{constructor(Ai,bo,Ra,pc,mc,uf){this.options=Ai,this.attrs=bo,this.tooltip=Ra,this.timestamp=pc,this.selected=mc,this.disabled=uf}setSelected(Ai,bo){return Ai==this.selected||Ai>=this.options.length?this:new CompletionDialog(this.options,makeAttrs(bo,Ai),this.tooltip,this.timestamp,Ai,this.disabled)}static build(Ai,bo,Ra,pc,mc,uf){if(pc&&!uf&&Ai.some(hf=>hf.isPending))return pc.setDisabled();let df=sortOptions(Ai,bo);if(!df.length)return pc&&Ai.some(hf=>hf.isPending)?pc.setDisabled():null;let ff=bo.facet(completionConfig).selectOnOpen?0:-1;if(pc&&pc.selected!=ff&&pc.selected!=-1){let hf=pc.options[pc.selected].completion;for(let pf=0;pf<df.length;pf++)if(df[pf].completion==hf){ff=pf;break}}return new CompletionDialog(df,makeAttrs(Ra,ff),{pos:Ai.reduce((hf,pf)=>pf.hasResult()?Math.min(hf,pf.from):hf,1e8),create:createTooltip,above:mc.aboveCursor},pc?pc.timestamp:Date.now(),ff,!1)}map(Ai){return new CompletionDialog(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:Ai.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}setDisabled(){return new CompletionDialog(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class CompletionState{constructor(Ai,bo,Ra){this.active=Ai,this.id=bo,this.open=Ra}static start(){return new CompletionState(none$1,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(Ai){let{state:bo}=Ai,Ra=bo.facet(completionConfig),pc=(Ra.override||bo.languageDataAt("autocomplete",cur(bo)).map(asSource)).map(df=>(this.active.find(ff=>ff.source==df)||new ActiveSource(df,this.active.some(ff=>ff.state!=0)?1:0)).update(Ai,Ra));pc.length==this.active.length&&pc.every((df,ff)=>df==this.active[ff])&&(pc=this.active);let mc=this.open,uf=Ai.effects.some(df=>df.is(setActiveEffect));mc&&Ai.docChanged&&(mc=mc.map(Ai.changes)),Ai.selection||pc.some(df=>df.hasResult()&&Ai.changes.touchesRange(df.from,df.to))||!sameResults(pc,this.active)||uf?mc=CompletionDialog.build(pc,bo,this.id,mc,Ra,uf):mc&&mc.disabled&&!pc.some(df=>df.isPending)&&(mc=null),!mc&&pc.every(df=>!df.isPending)&&pc.some(df=>df.hasResult())&&(pc=pc.map(df=>df.hasResult()?new ActiveSource(df.source,0):df));for(let df of Ai.effects)df.is(setSelectedEffect)&&(mc=mc&&mc.setSelected(df.value,this.id));return pc==this.active&&mc==this.open?this:new CompletionState(pc,this.id,mc)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?baseAttrs:noAttrs}}function sameResults(vo,Ai){if(vo==Ai)return!0;for(let bo=0,Ra=0;;){for(;bo<vo.length&&!vo[bo].hasResult();)bo++;for(;Ra<Ai.length&&!Ai[Ra].hasResult();)Ra++;let pc=bo==vo.length,mc=Ra==Ai.length;if(pc||mc)return pc==mc;if(vo[bo++].result!=Ai[Ra++].result)return!1}}const baseAttrs={"aria-autocomplete":"list"},noAttrs={};function makeAttrs(vo,Ai){let bo={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":vo};return Ai>-1&&(bo["aria-activedescendant"]=vo+"-"+Ai),bo}const none$1=[];function getUpdateType(vo,Ai){if(vo.isUserEvent("input.complete")){let Ra=vo.annotation(pickedCompletion);if(Ra&&Ai.activateOnCompletion(Ra))return 12}let bo=vo.isUserEvent("input.type");return bo&&Ai.activateOnTyping?5:bo?1:vo.isUserEvent("delete.backward")?2:vo.selection?8:vo.docChanged?16:0}class ActiveSource{constructor(Ai,bo,Ra=!1){this.source=Ai,this.state=bo,this.explicit=Ra}hasResult(){return!1}get isPending(){return this.state==1}update(Ai,bo){let Ra=getUpdateType(Ai,bo),pc=this;(Ra&8||Ra&16&&this.touches(Ai))&&(pc=new ActiveSource(pc.source,0)),Ra&4&&pc.state==0&&(pc=new ActiveSource(this.source,1)),pc=pc.updateFor(Ai,Ra);for(let mc of Ai.effects)if(mc.is(startCompletionEffect))pc=new ActiveSource(pc.source,1,mc.value);else if(mc.is(closeCompletionEffect))pc=new ActiveSource(pc.source,0);else if(mc.is(setActiveEffect))for(let uf of mc.value)uf.source==pc.source&&(pc=uf);return pc}updateFor(Ai,bo){return this.map(Ai.changes)}map(Ai){return this}touches(Ai){return Ai.changes.touchesRange(cur(Ai.state))}}class ActiveResult extends ActiveSource{constructor(Ai,bo,Ra,pc,mc,uf){super(Ai,3,bo),this.limit=Ra,this.result=pc,this.from=mc,this.to=uf}hasResult(){return!0}updateFor(Ai,bo){var Ra;if(!(bo&3))return this.map(Ai.changes);let pc=this.result;pc.map&&!Ai.changes.empty&&(pc=pc.map(pc,Ai.changes));let mc=Ai.changes.mapPos(this.from),uf=Ai.changes.mapPos(this.to,1),df=cur(Ai.state);if(df>uf||!pc||bo&2&&(cur(Ai.startState)==this.from||df<this.limit))return new ActiveSource(this.source,bo&4?1:0);let ff=Ai.changes.mapPos(this.limit);return checkValid(pc.validFor,Ai.state,mc,uf)?new ActiveResult(this.source,this.explicit,ff,pc,mc,uf):pc.update&&(pc=pc.update(pc,mc,uf,new CompletionContext(Ai.state,df,!1)))?new ActiveResult(this.source,this.explicit,ff,pc,pc.from,(Ra=pc.to)!==null&&Ra!==void 0?Ra:cur(Ai.state)):new ActiveSource(this.source,1,this.explicit)}map(Ai){return Ai.empty?this:(this.result.map?this.result.map(this.result,Ai):this.result)?new ActiveResult(this.source,this.explicit,Ai.mapPos(this.limit),this.result,Ai.mapPos(this.from),Ai.mapPos(this.to,1)):new ActiveSource(this.source,0)}touches(Ai){return Ai.changes.touchesRange(this.from,this.to)}}function checkValid(vo,Ai,bo,Ra){if(!vo)return!1;let pc=Ai.sliceDoc(bo,Ra);return typeof vo=="function"?vo(pc,bo,Ra,Ai):ensureAnchor(vo,!0).test(pc)}const setActiveEffect=StateEffect.define({map(vo,Ai){return vo.map(bo=>bo.map(Ai))}}),setSelectedEffect=StateEffect.define(),completionState=StateField.define({create(){return CompletionState.start()},update(vo,Ai){return vo.update(Ai)},provide:vo=>[showTooltip.from(vo,Ai=>Ai.tooltip),EditorView.contentAttributes.from(vo,Ai=>Ai.attrs)]});function applyCompletion(vo,Ai){const bo=Ai.completion.apply||Ai.completion.label;let Ra=vo.state.field(completionState).active.find(pc=>pc.source==Ai.source);return Ra instanceof ActiveResult?(typeof bo=="string"?vo.dispatch(Object.assign(Object.assign({},insertCompletionText(vo.state,bo,Ra.from,Ra.to)),{annotations:pickedCompletion.of(Ai.completion)})):bo(vo,Ai.completion,Ra.from,Ra.to),!0):!1}const createTooltip=completionTooltip(completionState,applyCompletion);function moveCompletionSelection(vo,Ai="option"){return bo=>{let Ra=bo.state.field(completionState,!1);if(!Ra||!Ra.open||Ra.open.disabled||Date.now()-Ra.open.timestamp<bo.state.facet(completionConfig).interactionDelay)return!1;let pc=1,mc;Ai=="page"&&(mc=getTooltip(bo,Ra.open.tooltip))&&(pc=Math.max(2,Math.floor(mc.dom.offsetHeight/mc.dom.querySelector("li").offsetHeight)-1));let{length:uf}=Ra.open.options,df=Ra.open.selected>-1?Ra.open.selected+pc*(vo?1:-1):vo?0:uf-1;return df<0?df=Ai=="page"?0:uf-1:df>=uf&&(df=Ai=="page"?uf-1:0),bo.dispatch({effects:setSelectedEffect.of(df)}),!0}}const acceptCompletion=vo=>{let Ai=vo.state.field(completionState,!1);return vo.state.readOnly||!Ai||!Ai.open||Ai.open.selected<0||Ai.open.disabled||Date.now()-Ai.open.timestamp<vo.state.facet(completionConfig).interactionDelay?!1:applyCompletion(vo,Ai.open.options[Ai.open.selected])},startCompletion=vo=>vo.state.field(completionState,!1)?(vo.dispatch({effects:startCompletionEffect.of(!0)}),!0):!1,closeCompletion=vo=>{let Ai=vo.state.field(completionState,!1);return!Ai||!Ai.active.some(bo=>bo.state!=0)?!1:(vo.dispatch({effects:closeCompletionEffect.of(null)}),!0)};class RunningQuery{constructor(Ai,bo){this.active=Ai,this.context=bo,this.time=Date.now(),this.updates=[],this.done=void 0}}const MaxUpdateCount=50,MinAbortTime=1e3,completionPlugin=ViewPlugin.fromClass(class{constructor(vo){this.view=vo,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let Ai of vo.state.field(completionState).active)Ai.isPending&&this.startQuery(Ai)}update(vo){let Ai=vo.state.field(completionState),bo=vo.state.facet(completionConfig);if(!vo.selectionSet&&!vo.docChanged&&vo.startState.field(completionState)==Ai)return;let Ra=vo.transactions.some(mc=>{let uf=getUpdateType(mc,bo);return uf&8||(mc.selection||mc.docChanged)&&!(uf&3)});for(let mc=0;mc<this.running.length;mc++){let uf=this.running[mc];if(Ra||uf.context.abortOnDocChange&&vo.docChanged||uf.updates.length+vo.transactions.length>MaxUpdateCount&&Date.now()-uf.time>MinAbortTime){for(let df of uf.context.abortListeners)try{df()}catch(ff){logException(this.view.state,ff)}uf.context.abortListeners=null,this.running.splice(mc--,1)}else uf.updates.push(...vo.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),vo.transactions.some(mc=>mc.effects.some(uf=>uf.is(startCompletionEffect)))&&(this.pendingStart=!0);let pc=this.pendingStart?50:bo.activateOnTypingDelay;if(this.debounceUpdate=Ai.active.some(mc=>mc.isPending&&!this.running.some(uf=>uf.active.source==mc.source))?setTimeout(()=>this.startUpdate(),pc):-1,this.composing!=0)for(let mc of vo.transactions)mc.isUserEvent("input.type")?this.composing=2:this.composing==2&&mc.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:vo}=this.view,Ai=vo.field(completionState);for(let bo of Ai.active)bo.isPending&&!this.running.some(Ra=>Ra.active.source==bo.source)&&this.startQuery(bo);this.running.length&&Ai.open&&Ai.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(completionConfig).updateSyncTime))}startQuery(vo){let{state:Ai}=this.view,bo=cur(Ai),Ra=new CompletionContext(Ai,bo,vo.explicit,this.view),pc=new RunningQuery(vo,Ra);this.running.push(pc),Promise.resolve(vo.source(Ra)).then(mc=>{pc.context.aborted||(pc.done=mc||null,this.scheduleAccept())},mc=>{this.view.dispatch({effects:closeCompletionEffect.of(null)}),logException(this.view.state,mc)})}scheduleAccept(){this.running.every(vo=>vo.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(completionConfig).updateSyncTime))}accept(){var vo;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let Ai=[],bo=this.view.state.facet(completionConfig),Ra=this.view.state.field(completionState);for(let pc=0;pc<this.running.length;pc++){let mc=this.running[pc];if(mc.done===void 0)continue;if(this.running.splice(pc--,1),mc.done){let df=cur(mc.updates.length?mc.updates[0].startState:this.view.state),ff=Math.min(df,mc.done.from+(mc.active.explicit?0:1)),hf=new ActiveResult(mc.active.source,mc.active.explicit,ff,mc.done,mc.done.from,(vo=mc.done.to)!==null&&vo!==void 0?vo:df);for(let pf of mc.updates)hf=hf.update(pf,bo);if(hf.hasResult()){Ai.push(hf);continue}}let uf=Ra.active.find(df=>df.source==mc.active.source);if(uf&&uf.isPending)if(mc.done==null){let df=new ActiveSource(mc.active.source,0);for(let ff of mc.updates)df=df.update(ff,bo);df.isPending||Ai.push(df)}else this.startQuery(uf)}(Ai.length||Ra.open&&Ra.open.disabled)&&this.view.dispatch({effects:setActiveEffect.of(Ai)})}},{eventHandlers:{blur(vo){let Ai=this.view.state.field(completionState,!1);if(Ai&&Ai.tooltip&&this.view.state.facet(completionConfig).closeOnBlur){let bo=Ai.open&&getTooltip(this.view,Ai.open.tooltip);(!bo||!bo.dom.contains(vo.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:closeCompletionEffect.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:startCompletionEffect.of(!1)}),20),this.composing=0}}}),windows=typeof navigator=="object"&&/Win/.test(navigator.platform),commitCharacters=Prec.highest(EditorView.domEventHandlers({keydown(vo,Ai){let bo=Ai.state.field(completionState,!1);if(!bo||!bo.open||bo.open.disabled||bo.open.selected<0||vo.key.length>1||vo.ctrlKey&&!(windows&&vo.altKey)||vo.metaKey)return!1;let Ra=bo.open.options[bo.open.selected],pc=bo.active.find(uf=>uf.source==Ra.source),mc=Ra.completion.commitCharacters||pc.result.commitCharacters;return mc&&mc.indexOf(vo.key)>-1&&applyCompletion(Ai,Ra),!1}})),baseTheme$2=EditorView.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),defaults={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},closeBracketEffect=StateEffect.define({map(vo,Ai){return Ai.mapPos(vo,-1,MapMode.TrackAfter)??void 0}}),closedBracket=new class extends RangeValue{};closedBracket.startSide=1;closedBracket.endSide=-1;const bracketState=StateField.define({create(){return RangeSet.empty},update(vo,Ai){if(vo=vo.map(Ai.changes),Ai.selection){let bo=Ai.state.doc.lineAt(Ai.selection.main.head);vo=vo.update({filter:Ra=>Ra>=bo.from&&Ra<=bo.to})}for(let bo of Ai.effects)bo.is(closeBracketEffect)&&(vo=vo.update({add:[closedBracket.range(bo.value,bo.value+1)]}));return vo}});function closeBrackets(){return[inputHandler,bracketState]}const definedClosing="()[]{}<>";function closing(vo){for(let Ai=0;Ai<definedClosing.length;Ai+=2)if(definedClosing.charCodeAt(Ai)==vo)return definedClosing.charAt(Ai+1);return fromCodePoint(vo<128?vo:vo+1)}function config(vo,Ai){return vo.languageDataAt("closeBrackets",Ai)[0]||defaults}const android=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),inputHandler=EditorView.inputHandler.of((vo,Ai,bo,Ra)=>{if((android?vo.composing:vo.compositionStarted)||vo.state.readOnly)return!1;let pc=vo.state.selection.main;if(Ra.length>2||Ra.length==2&&codePointSize(codePointAt(Ra,0))==1||Ai!=pc.from||bo!=pc.to)return!1;let mc=insertBracket(vo.state,Ra);return mc?(vo.dispatch(mc),!0):!1}),deleteBracketPair=({state:vo,dispatch:Ai})=>{if(vo.readOnly)return!1;let bo=config(vo,vo.selection.main.head).brackets||defaults.brackets,Ra=null,pc=vo.changeByRange(mc=>{if(mc.empty){let uf=prevChar(vo.doc,mc.head);for(let df of bo)if(df==uf&&nextChar(vo.doc,mc.head)==closing(codePointAt(df,0)))return{changes:{from:mc.head-df.length,to:mc.head+df.length},range:EditorSelection.cursor(mc.head-df.length)}}return{range:Ra=mc}});return Ra||Ai(vo.update(pc,{scrollIntoView:!0,userEvent:"delete.backward"})),!Ra},closeBracketsKeymap=[{key:"Backspace",run:deleteBracketPair}];function insertBracket(vo,Ai){let bo=config(vo,vo.selection.main.head),Ra=bo.brackets||defaults.brackets;for(let pc of Ra){let mc=closing(codePointAt(pc,0));if(Ai==pc)return mc==pc?handleSame(vo,pc,Ra.indexOf(pc+pc+pc)>-1,bo):handleOpen(vo,pc,mc,bo.before||defaults.before);if(Ai==mc&&closedBracketAt(vo,vo.selection.main.from))return handleClose(vo,pc,mc)}return null}function closedBracketAt(vo,Ai){let bo=!1;return vo.field(bracketState).between(0,vo.doc.length,Ra=>{Ra==Ai&&(bo=!0)}),bo}function nextChar(vo,Ai){let bo=vo.sliceString(Ai,Ai+2);return bo.slice(0,codePointSize(codePointAt(bo,0)))}function prevChar(vo,Ai){let bo=vo.sliceString(Ai-2,Ai);return codePointSize(codePointAt(bo,0))==bo.length?bo:bo.slice(1)}function handleOpen(vo,Ai,bo,Ra){let pc=null,mc=vo.changeByRange(uf=>{if(!uf.empty)return{changes:[{insert:Ai,from:uf.from},{insert:bo,from:uf.to}],effects:closeBracketEffect.of(uf.to+Ai.length),range:EditorSelection.range(uf.anchor+Ai.length,uf.head+Ai.length)};let df=nextChar(vo.doc,uf.head);return!df||/\s/.test(df)||Ra.indexOf(df)>-1?{changes:{insert:Ai+bo,from:uf.head},effects:closeBracketEffect.of(uf.head+Ai.length),range:EditorSelection.cursor(uf.head+Ai.length)}:{range:pc=uf}});return pc?null:vo.update(mc,{scrollIntoView:!0,userEvent:"input.type"})}function handleClose(vo,Ai,bo){let Ra=null,pc=vo.changeByRange(mc=>mc.empty&&nextChar(vo.doc,mc.head)==bo?{changes:{from:mc.head,to:mc.head+bo.length,insert:bo},range:EditorSelection.cursor(mc.head+bo.length)}:Ra={range:mc});return Ra?null:vo.update(pc,{scrollIntoView:!0,userEvent:"input.type"})}function handleSame(vo,Ai,bo,Ra){let pc=Ra.stringPrefixes||defaults.stringPrefixes,mc=null,uf=vo.changeByRange(df=>{if(!df.empty)return{changes:[{insert:Ai,from:df.from},{insert:Ai,from:df.to}],effects:closeBracketEffect.of(df.to+Ai.length),range:EditorSelection.range(df.anchor+Ai.length,df.head+Ai.length)};let ff=df.head,hf=nextChar(vo.doc,ff),pf;if(hf==Ai){if(nodeStart(vo,ff))return{changes:{insert:Ai+Ai,from:ff},effects:closeBracketEffect.of(ff+Ai.length),range:EditorSelection.cursor(ff+Ai.length)};if(closedBracketAt(vo,ff)){let mf=bo&&vo.sliceDoc(ff,ff+Ai.length*3)==Ai+Ai+Ai?Ai+Ai+Ai:Ai;return{changes:{from:ff,to:ff+mf.length,insert:mf},range:EditorSelection.cursor(ff+mf.length)}}}else{if(bo&&vo.sliceDoc(ff-2*Ai.length,ff)==Ai+Ai&&(pf=canStartStringAt(vo,ff-2*Ai.length,pc))>-1&&nodeStart(vo,pf))return{changes:{insert:Ai+Ai+Ai+Ai,from:ff},effects:closeBracketEffect.of(ff+Ai.length),range:EditorSelection.cursor(ff+Ai.length)};if(vo.charCategorizer(ff)(hf)!=CharCategory.Word&&canStartStringAt(vo,ff,pc)>-1&&!probablyInString(vo,ff,Ai,pc))return{changes:{insert:Ai+Ai,from:ff},effects:closeBracketEffect.of(ff+Ai.length),range:EditorSelection.cursor(ff+Ai.length)}}return{range:mc=df}});return mc?null:vo.update(uf,{scrollIntoView:!0,userEvent:"input.type"})}function nodeStart(vo,Ai){let bo=syntaxTree(vo).resolveInner(Ai+1);return bo.parent&&bo.from==Ai}function probablyInString(vo,Ai,bo,Ra){let pc=syntaxTree(vo).resolveInner(Ai,-1),mc=Ra.reduce((uf,df)=>Math.max(uf,df.length),0);for(let uf=0;uf<5;uf++){let df=vo.sliceDoc(pc.from,Math.min(pc.to,pc.from+bo.length+mc)),ff=df.indexOf(bo);if(!ff||ff>-1&&Ra.indexOf(df.slice(0,ff))>-1){let pf=pc.firstChild;for(;pf&&pf.from==pc.from&&pf.to-pf.from>bo.length+ff;){if(vo.sliceDoc(pf.to-bo.length,pf.to)==bo)return!1;pf=pf.firstChild}return!0}let hf=pc.to==Ai&&pc.parent;if(!hf)break;pc=hf}return!1}function canStartStringAt(vo,Ai,bo){let Ra=vo.charCategorizer(Ai);if(Ra(vo.sliceDoc(Ai-1,Ai))!=CharCategory.Word)return Ai;for(let pc of bo){let mc=Ai-pc.length;if(vo.sliceDoc(mc,Ai)==pc&&Ra(vo.sliceDoc(mc-1,mc))!=CharCategory.Word)return mc}return-1}function autocompletion(vo={}){return[commitCharacters,completionState,completionConfig.of(vo),completionPlugin,completionKeymapExt,baseTheme$2]}const completionKeymap=[{key:"Ctrl-Space",run:startCompletion},{mac:"Alt-`",run:startCompletion},{key:"Escape",run:closeCompletion},{key:"ArrowDown",run:moveCompletionSelection(!0)},{key:"ArrowUp",run:moveCompletionSelection(!1)},{key:"PageDown",run:moveCompletionSelection(!0,"page")},{key:"PageUp",run:moveCompletionSelection(!1,"page")},{key:"Enter",run:acceptCompletion}],completionKeymapExt=Prec.highest(keymap.computeN([completionConfig],vo=>vo.facet(completionConfig).defaultKeymap?[completionKeymap]:[])),toggleComment=vo=>{let{state:Ai}=vo,bo=Ai.doc.lineAt(Ai.selection.main.from),Ra=getConfig(vo.state,bo.from);return Ra.line?toggleLineComment(vo):Ra.block?toggleBlockCommentByLine(vo):!1};function command(vo,Ai){return({state:bo,dispatch:Ra})=>{if(bo.readOnly)return!1;let pc=vo(Ai,bo);return pc?(Ra(bo.update(pc)),!0):!1}}const toggleLineComment=command(changeLineComment,0),toggleBlockComment=command(changeBlockComment,0),toggleBlockCommentByLine=command((vo,Ai)=>changeBlockComment(vo,Ai,selectedLineRanges(Ai)),0);function getConfig(vo,Ai){let bo=vo.languageDataAt("commentTokens",Ai);return bo.length?bo[0]:{}}const SearchMargin=50;function findBlockComment(vo,{open:Ai,close:bo},Ra,pc){let mc=vo.sliceDoc(Ra-SearchMargin,Ra),uf=vo.sliceDoc(pc,pc+SearchMargin),df=/\s*$/.exec(mc)[0].length,ff=/^\s*/.exec(uf)[0].length,hf=mc.length-df;if(mc.slice(hf-Ai.length,hf)==Ai&&uf.slice(ff,ff+bo.length)==bo)return{open:{pos:Ra-df,margin:df&&1},close:{pos:pc+ff,margin:ff&&1}};let pf,mf;pc-Ra<=2*SearchMargin?pf=mf=vo.sliceDoc(Ra,pc):(pf=vo.sliceDoc(Ra,Ra+SearchMargin),mf=vo.sliceDoc(pc-SearchMargin,pc));let gf=/^\s*/.exec(pf)[0].length,yf=/\s*$/.exec(mf)[0].length,vf=mf.length-yf-bo.length;return pf.slice(gf,gf+Ai.length)==Ai&&mf.slice(vf,vf+bo.length)==bo?{open:{pos:Ra+gf+Ai.length,margin:/\s/.test(pf.charAt(gf+Ai.length))?1:0},close:{pos:pc-yf-bo.length,margin:/\s/.test(mf.charAt(vf-1))?1:0}}:null}function selectedLineRanges(vo){let Ai=[];for(let bo of vo.selection.ranges){let Ra=vo.doc.lineAt(bo.from),pc=bo.to<=Ra.to?Ra:vo.doc.lineAt(bo.to);pc.from>Ra.from&&pc.from==bo.to&&(pc=bo.to==Ra.to+1?Ra:vo.doc.lineAt(bo.to-1));let mc=Ai.length-1;mc>=0&&Ai[mc].to>Ra.from?Ai[mc].to=pc.to:Ai.push({from:Ra.from+/^\s*/.exec(Ra.text)[0].length,to:pc.to})}return Ai}function changeBlockComment(vo,Ai,bo=Ai.selection.ranges){let Ra=bo.map(mc=>getConfig(Ai,mc.from).block);if(!Ra.every(mc=>mc))return null;let pc=bo.map((mc,uf)=>findBlockComment(Ai,Ra[uf],mc.from,mc.to));if(vo!=2&&!pc.every(mc=>mc))return{changes:Ai.changes(bo.map((mc,uf)=>pc[uf]?[]:[{from:mc.from,insert:Ra[uf].open+" "},{from:mc.to,insert:" "+Ra[uf].close}]))};if(vo!=1&&pc.some(mc=>mc)){let mc=[];for(let uf=0,df;uf<pc.length;uf++)if(df=pc[uf]){let ff=Ra[uf],{open:hf,close:pf}=df;mc.push({from:hf.pos-ff.open.length,to:hf.pos+hf.margin},{from:pf.pos-pf.margin,to:pf.pos+ff.close.length})}return{changes:mc}}return null}function changeLineComment(vo,Ai,bo=Ai.selection.ranges){let Ra=[],pc=-1;for(let{from:mc,to:uf}of bo){let df=Ra.length,ff=1e9,hf=getConfig(Ai,mc).line;if(hf){for(let pf=mc;pf<=uf;){let mf=Ai.doc.lineAt(pf);if(mf.from>pc&&(mc==uf||uf>mf.from)){pc=mf.from;let gf=/^\s*/.exec(mf.text)[0].length,yf=gf==mf.length,vf=mf.text.slice(gf,gf+hf.length)==hf?gf:-1;gf<mf.text.length&&gf<ff&&(ff=gf),Ra.push({line:mf,comment:vf,token:hf,indent:gf,empty:yf,single:!1})}pf=mf.to+1}if(ff<1e9)for(let pf=df;pf<Ra.length;pf++)Ra[pf].indent<Ra[pf].line.text.length&&(Ra[pf].indent=ff);Ra.length==df+1&&(Ra[df].single=!0)}}if(vo!=2&&Ra.some(mc=>mc.comment<0&&(!mc.empty||mc.single))){let mc=[];for(let{line:df,token:ff,indent:hf,empty:pf,single:mf}of Ra)(mf||!pf)&&mc.push({from:df.from+hf,insert:ff+" "});let uf=Ai.changes(mc);return{changes:uf,selection:Ai.selection.map(uf,1)}}else if(vo!=1&&Ra.some(mc=>mc.comment>=0)){let mc=[];for(let{line:uf,comment:df,token:ff}of Ra)if(df>=0){let hf=uf.from+df,pf=hf+ff.length;uf.text[pf-uf.from]==" "&&pf++,mc.push({from:hf,to:pf})}return{changes:mc}}return null}const fromHistory=Annotation.define(),isolateHistory=Annotation.define(),invertedEffects=Facet.define(),historyConfig=Facet.define({combine(vo){return combineConfig(vo,{minDepth:100,newGroupDelay:500,joinToEvent:(Ai,bo)=>bo},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(Ai,bo)=>(Ra,pc)=>Ai(Ra,pc)||bo(Ra,pc)})}}),historyField_=StateField.define({create(){return HistoryState.empty},update(vo,Ai){let bo=Ai.state.facet(historyConfig),Ra=Ai.annotation(fromHistory);if(Ra){let ff=HistEvent.fromTransaction(Ai,Ra.selection),hf=Ra.side,pf=hf==0?vo.undone:vo.done;return ff?pf=updateBranch(pf,pf.length,bo.minDepth,ff):pf=addSelection(pf,Ai.startState.selection),new HistoryState(hf==0?Ra.rest:pf,hf==0?pf:Ra.rest)}let pc=Ai.annotation(isolateHistory);if((pc=="full"||pc=="before")&&(vo=vo.isolate()),Ai.annotation(Transaction.addToHistory)===!1)return Ai.changes.empty?vo:vo.addMapping(Ai.changes.desc);let mc=HistEvent.fromTransaction(Ai),uf=Ai.annotation(Transaction.time),df=Ai.annotation(Transaction.userEvent);return mc?vo=vo.addChanges(mc,uf,df,bo,Ai):Ai.selection&&(vo=vo.addSelection(Ai.startState.selection,uf,df,bo.newGroupDelay)),(pc=="full"||pc=="after")&&(vo=vo.isolate()),vo},toJSON(vo){return{done:vo.done.map(Ai=>Ai.toJSON()),undone:vo.undone.map(Ai=>Ai.toJSON())}},fromJSON(vo){return new HistoryState(vo.done.map(HistEvent.fromJSON),vo.undone.map(HistEvent.fromJSON))}});function history(vo={}){return[historyField_,historyConfig.of(vo),EditorView.domEventHandlers({beforeinput(Ai,bo){let Ra=Ai.inputType=="historyUndo"?undo:Ai.inputType=="historyRedo"?redo:null;return Ra?(Ai.preventDefault(),Ra(bo)):!1}})]}function cmd(vo,Ai){return function({state:bo,dispatch:Ra}){if(!Ai&&bo.readOnly)return!1;let pc=bo.field(historyField_,!1);if(!pc)return!1;let mc=pc.pop(vo,bo,Ai);return mc?(Ra(mc),!0):!1}}const undo=cmd(0,!1),redo=cmd(1,!1),undoSelection=cmd(0,!0),redoSelection=cmd(1,!0);class HistEvent{constructor(Ai,bo,Ra,pc,mc){this.changes=Ai,this.effects=bo,this.mapped=Ra,this.startSelection=pc,this.selectionsAfter=mc}setSelAfter(Ai){return new HistEvent(this.changes,this.effects,this.mapped,this.startSelection,Ai)}toJSON(){var Ai,bo,Ra;return{changes:(Ai=this.changes)===null||Ai===void 0?void 0:Ai.toJSON(),mapped:(bo=this.mapped)===null||bo===void 0?void 0:bo.toJSON(),startSelection:(Ra=this.startSelection)===null||Ra===void 0?void 0:Ra.toJSON(),selectionsAfter:this.selectionsAfter.map(pc=>pc.toJSON())}}static fromJSON(Ai){return new HistEvent(Ai.changes&&ChangeSet.fromJSON(Ai.changes),[],Ai.mapped&&ChangeDesc.fromJSON(Ai.mapped),Ai.startSelection&&EditorSelection.fromJSON(Ai.startSelection),Ai.selectionsAfter.map(EditorSelection.fromJSON))}static fromTransaction(Ai,bo){let Ra=none;for(let pc of Ai.startState.facet(invertedEffects)){let mc=pc(Ai);mc.length&&(Ra=Ra.concat(mc))}return!Ra.length&&Ai.changes.empty?null:new HistEvent(Ai.changes.invert(Ai.startState.doc),Ra,void 0,bo||Ai.startState.selection,none)}static selection(Ai){return new HistEvent(void 0,none,void 0,void 0,Ai)}}function updateBranch(vo,Ai,bo,Ra){let pc=Ai+1>bo+20?Ai-bo-1:0,mc=vo.slice(pc,Ai);return mc.push(Ra),mc}function isAdjacent(vo,Ai){let bo=[],Ra=!1;return vo.iterChangedRanges((pc,mc)=>bo.push(pc,mc)),Ai.iterChangedRanges((pc,mc,uf,df)=>{for(let ff=0;ff<bo.length;){let hf=bo[ff++],pf=bo[ff++];df>=hf&&uf<=pf&&(Ra=!0)}}),Ra}function eqSelectionShape(vo,Ai){return vo.ranges.length==Ai.ranges.length&&vo.ranges.filter((bo,Ra)=>bo.empty!=Ai.ranges[Ra].empty).length===0}function conc(vo,Ai){return vo.length?Ai.length?vo.concat(Ai):vo:Ai}const none=[],MaxSelectionsPerEvent=200;function addSelection(vo,Ai){if(vo.length){let bo=vo[vo.length-1],Ra=bo.selectionsAfter.slice(Math.max(0,bo.selectionsAfter.length-MaxSelectionsPerEvent));return Ra.length&&Ra[Ra.length-1].eq(Ai)?vo:(Ra.push(Ai),updateBranch(vo,vo.length-1,1e9,bo.setSelAfter(Ra)))}else return[HistEvent.selection([Ai])]}function popSelection(vo){let Ai=vo[vo.length-1],bo=vo.slice();return bo[vo.length-1]=Ai.setSelAfter(Ai.selectionsAfter.slice(0,Ai.selectionsAfter.length-1)),bo}function addMappingToBranch(vo,Ai){if(!vo.length)return vo;let bo=vo.length,Ra=none;for(;bo;){let pc=mapEvent(vo[bo-1],Ai,Ra);if(pc.changes&&!pc.changes.empty||pc.effects.length){let mc=vo.slice(0,bo);return mc[bo-1]=pc,mc}else Ai=pc.mapped,bo--,Ra=pc.selectionsAfter}return Ra.length?[HistEvent.selection(Ra)]:none}function mapEvent(vo,Ai,bo){let Ra=conc(vo.selectionsAfter.length?vo.selectionsAfter.map(df=>df.map(Ai)):none,bo);if(!vo.changes)return HistEvent.selection(Ra);let pc=vo.changes.map(Ai),mc=Ai.mapDesc(vo.changes,!0),uf=vo.mapped?vo.mapped.composeDesc(mc):mc;return new HistEvent(pc,StateEffect.mapEffects(vo.effects,Ai),uf,vo.startSelection.map(mc),Ra)}const joinableUserEvent=/^(input\.type|delete)($|\.)/;class HistoryState{constructor(Ai,bo,Ra=0,pc=void 0){this.done=Ai,this.undone=bo,this.prevTime=Ra,this.prevUserEvent=pc}isolate(){return this.prevTime?new HistoryState(this.done,this.undone):this}addChanges(Ai,bo,Ra,pc,mc){let uf=this.done,df=uf[uf.length-1];return df&&df.changes&&!df.changes.empty&&Ai.changes&&(!Ra||joinableUserEvent.test(Ra))&&(!df.selectionsAfter.length&&bo-this.prevTime<pc.newGroupDelay&&pc.joinToEvent(mc,isAdjacent(df.changes,Ai.changes))||Ra=="input.type.compose")?uf=updateBranch(uf,uf.length-1,pc.minDepth,new HistEvent(Ai.changes.compose(df.changes),conc(StateEffect.mapEffects(Ai.effects,df.changes),df.effects),df.mapped,df.startSelection,none)):uf=updateBranch(uf,uf.length,pc.minDepth,Ai),new HistoryState(uf,none,bo,Ra)}addSelection(Ai,bo,Ra,pc){let mc=this.done.length?this.done[this.done.length-1].selectionsAfter:none;return mc.length>0&&bo-this.prevTime<pc&&Ra==this.prevUserEvent&&Ra&&/^select($|\.)/.test(Ra)&&eqSelectionShape(mc[mc.length-1],Ai)?this:new HistoryState(addSelection(this.done,Ai),this.undone,bo,Ra)}addMapping(Ai){return new HistoryState(addMappingToBranch(this.done,Ai),addMappingToBranch(this.undone,Ai),this.prevTime,this.prevUserEvent)}pop(Ai,bo,Ra){let pc=Ai==0?this.done:this.undone;if(pc.length==0)return null;let mc=pc[pc.length-1],uf=mc.selectionsAfter[0]||bo.selection;if(Ra&&mc.selectionsAfter.length)return bo.update({selection:mc.selectionsAfter[mc.selectionsAfter.length-1],annotations:fromHistory.of({side:Ai,rest:popSelection(pc),selection:uf}),userEvent:Ai==0?"select.undo":"select.redo",scrollIntoView:!0});if(mc.changes){let df=pc.length==1?none:pc.slice(0,pc.length-1);return mc.mapped&&(df=addMappingToBranch(df,mc.mapped)),bo.update({changes:mc.changes,selection:mc.startSelection,effects:mc.effects,annotations:fromHistory.of({side:Ai,rest:df,selection:uf}),filter:!1,userEvent:Ai==0?"undo":"redo",scrollIntoView:!0})}else return null}}HistoryState.empty=new HistoryState(none,none);const historyKeymap=[{key:"Mod-z",run:undo,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:redo,preventDefault:!0},{linux:"Ctrl-Shift-z",run:redo,preventDefault:!0},{key:"Mod-u",run:undoSelection,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:redoSelection,preventDefault:!0}];function updateSel(vo,Ai){return EditorSelection.create(vo.ranges.map(Ai),vo.mainIndex)}function setSel(vo,Ai){return vo.update({selection:Ai,scrollIntoView:!0,userEvent:"select"})}function moveSel({state:vo,dispatch:Ai},bo){let Ra=updateSel(vo.selection,bo);return Ra.eq(vo.selection,!0)?!1:(Ai(setSel(vo,Ra)),!0)}function rangeEnd(vo,Ai){return EditorSelection.cursor(Ai?vo.to:vo.from)}function cursorByChar(vo,Ai){return moveSel(vo,bo=>bo.empty?vo.moveByChar(bo,Ai):rangeEnd(bo,Ai))}function ltrAtCursor(vo){return vo.textDirectionAt(vo.state.selection.main.head)==Direction.LTR}const cursorCharLeft=vo=>cursorByChar(vo,!ltrAtCursor(vo)),cursorCharRight=vo=>cursorByChar(vo,ltrAtCursor(vo));function cursorByGroup(vo,Ai){return moveSel(vo,bo=>bo.empty?vo.moveByGroup(bo,Ai):rangeEnd(bo,Ai))}const cursorGroupLeft=vo=>cursorByGroup(vo,!ltrAtCursor(vo)),cursorGroupRight=vo=>cursorByGroup(vo,ltrAtCursor(vo));function interestingNode(vo,Ai,bo){if(Ai.type.prop(bo))return!0;let Ra=Ai.to-Ai.from;return Ra&&(Ra>2||/[^\s,.;:]/.test(vo.sliceDoc(Ai.from,Ai.to)))||Ai.firstChild}function moveBySyntax(vo,Ai,bo){let Ra=syntaxTree(vo).resolveInner(Ai.head),pc=bo?NodeProp.closedBy:NodeProp.openedBy;for(let ff=Ai.head;;){let hf=bo?Ra.childAfter(ff):Ra.childBefore(ff);if(!hf)break;interestingNode(vo,hf,pc)?Ra=hf:ff=bo?hf.to:hf.from}let mc=Ra.type.prop(pc),uf,df;return mc&&(uf=bo?matchBrackets(vo,Ra.from,1):matchBrackets(vo,Ra.to,-1))&&uf.matched?df=bo?uf.end.to:uf.end.from:df=bo?Ra.to:Ra.from,EditorSelection.cursor(df,bo?-1:1)}const cursorSyntaxLeft=vo=>moveSel(vo,Ai=>moveBySyntax(vo.state,Ai,!ltrAtCursor(vo))),cursorSyntaxRight=vo=>moveSel(vo,Ai=>moveBySyntax(vo.state,Ai,ltrAtCursor(vo)));function cursorByLine(vo,Ai){return moveSel(vo,bo=>{if(!bo.empty)return rangeEnd(bo,Ai);let Ra=vo.moveVertically(bo,Ai);return Ra.head!=bo.head?Ra:vo.moveToLineBoundary(bo,Ai)})}const cursorLineUp=vo=>cursorByLine(vo,!1),cursorLineDown=vo=>cursorByLine(vo,!0);function pageInfo(vo){let Ai=vo.scrollDOM.clientHeight<vo.scrollDOM.scrollHeight-2,bo=0,Ra=0,pc;if(Ai){for(let mc of vo.state.facet(EditorView.scrollMargins)){let uf=mc(vo);uf!=null&&uf.top&&(bo=Math.max(uf==null?void 0:uf.top,bo)),uf!=null&&uf.bottom&&(Ra=Math.max(uf==null?void 0:uf.bottom,Ra))}pc=vo.scrollDOM.clientHeight-bo-Ra}else pc=(vo.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:bo,marginBottom:Ra,selfScroll:Ai,height:Math.max(vo.defaultLineHeight,pc-5)}}function cursorByPage(vo,Ai){let bo=pageInfo(vo),{state:Ra}=vo,pc=updateSel(Ra.selection,uf=>uf.empty?vo.moveVertically(uf,Ai,bo.height):rangeEnd(uf,Ai));if(pc.eq(Ra.selection))return!1;let mc;if(bo.selfScroll){let uf=vo.coordsAtPos(Ra.selection.main.head),df=vo.scrollDOM.getBoundingClientRect(),ff=df.top+bo.marginTop,hf=df.bottom-bo.marginBottom;uf&&uf.top>ff&&uf.bottom<hf&&(mc=EditorView.scrollIntoView(pc.main.head,{y:"start",yMargin:uf.top-ff}))}return vo.dispatch(setSel(Ra,pc),{effects:mc}),!0}const cursorPageUp=vo=>cursorByPage(vo,!1),cursorPageDown=vo=>cursorByPage(vo,!0);function moveByLineBoundary(vo,Ai,bo){let Ra=vo.lineBlockAt(Ai.head),pc=vo.moveToLineBoundary(Ai,bo);if(pc.head==Ai.head&&pc.head!=(bo?Ra.to:Ra.from)&&(pc=vo.moveToLineBoundary(Ai,bo,!1)),!bo&&pc.head==Ra.from&&Ra.length){let mc=/^\s*/.exec(vo.state.sliceDoc(Ra.from,Math.min(Ra.from+100,Ra.to)))[0].length;mc&&Ai.head!=Ra.from+mc&&(pc=EditorSelection.cursor(Ra.from+mc))}return pc}const cursorLineBoundaryForward=vo=>moveSel(vo,Ai=>moveByLineBoundary(vo,Ai,!0)),cursorLineBoundaryBackward=vo=>moveSel(vo,Ai=>moveByLineBoundary(vo,Ai,!1)),cursorLineBoundaryLeft=vo=>moveSel(vo,Ai=>moveByLineBoundary(vo,Ai,!ltrAtCursor(vo))),cursorLineBoundaryRight=vo=>moveSel(vo,Ai=>moveByLineBoundary(vo,Ai,ltrAtCursor(vo))),cursorLineStart=vo=>moveSel(vo,Ai=>EditorSelection.cursor(vo.lineBlockAt(Ai.head).from,1)),cursorLineEnd=vo=>moveSel(vo,Ai=>EditorSelection.cursor(vo.lineBlockAt(Ai.head).to,-1));function toMatchingBracket(vo,Ai,bo){let Ra=!1,pc=updateSel(vo.selection,mc=>{let uf=matchBrackets(vo,mc.head,-1)||matchBrackets(vo,mc.head,1)||mc.head>0&&matchBrackets(vo,mc.head-1,1)||mc.head<vo.doc.length&&matchBrackets(vo,mc.head+1,-1);if(!uf||!uf.end)return mc;Ra=!0;let df=uf.start.from==mc.head?uf.end.to:uf.end.from;return EditorSelection.cursor(df)});return Ra?(Ai(setSel(vo,pc)),!0):!1}const cursorMatchingBracket=({state:vo,dispatch:Ai})=>toMatchingBracket(vo,Ai);function extendSel(vo,Ai){let bo=updateSel(vo.state.selection,Ra=>{let pc=Ai(Ra);return EditorSelection.range(Ra.anchor,pc.head,pc.goalColumn,pc.bidiLevel||void 0)});return bo.eq(vo.state.selection)?!1:(vo.dispatch(setSel(vo.state,bo)),!0)}function selectByChar(vo,Ai){return extendSel(vo,bo=>vo.moveByChar(bo,Ai))}const selectCharLeft=vo=>selectByChar(vo,!ltrAtCursor(vo)),selectCharRight=vo=>selectByChar(vo,ltrAtCursor(vo));function selectByGroup(vo,Ai){return extendSel(vo,bo=>vo.moveByGroup(bo,Ai))}const selectGroupLeft=vo=>selectByGroup(vo,!ltrAtCursor(vo)),selectGroupRight=vo=>selectByGroup(vo,ltrAtCursor(vo)),selectSyntaxLeft=vo=>extendSel(vo,Ai=>moveBySyntax(vo.state,Ai,!ltrAtCursor(vo))),selectSyntaxRight=vo=>extendSel(vo,Ai=>moveBySyntax(vo.state,Ai,ltrAtCursor(vo)));function selectByLine(vo,Ai){return extendSel(vo,bo=>vo.moveVertically(bo,Ai))}const selectLineUp=vo=>selectByLine(vo,!1),selectLineDown=vo=>selectByLine(vo,!0);function selectByPage(vo,Ai){return extendSel(vo,bo=>vo.moveVertically(bo,Ai,pageInfo(vo).height))}const selectPageUp=vo=>selectByPage(vo,!1),selectPageDown=vo=>selectByPage(vo,!0),selectLineBoundaryForward=vo=>extendSel(vo,Ai=>moveByLineBoundary(vo,Ai,!0)),selectLineBoundaryBackward=vo=>extendSel(vo,Ai=>moveByLineBoundary(vo,Ai,!1)),selectLineBoundaryLeft=vo=>extendSel(vo,Ai=>moveByLineBoundary(vo,Ai,!ltrAtCursor(vo))),selectLineBoundaryRight=vo=>extendSel(vo,Ai=>moveByLineBoundary(vo,Ai,ltrAtCursor(vo))),selectLineStart=vo=>extendSel(vo,Ai=>EditorSelection.cursor(vo.lineBlockAt(Ai.head).from)),selectLineEnd=vo=>extendSel(vo,Ai=>EditorSelection.cursor(vo.lineBlockAt(Ai.head).to)),cursorDocStart=({state:vo,dispatch:Ai})=>(Ai(setSel(vo,{anchor:0})),!0),cursorDocEnd=({state:vo,dispatch:Ai})=>(Ai(setSel(vo,{anchor:vo.doc.length})),!0),selectDocStart=({state:vo,dispatch:Ai})=>(Ai(setSel(vo,{anchor:vo.selection.main.anchor,head:0})),!0),selectDocEnd=({state:vo,dispatch:Ai})=>(Ai(setSel(vo,{anchor:vo.selection.main.anchor,head:vo.doc.length})),!0),selectAll=({state:vo,dispatch:Ai})=>(Ai(vo.update({selection:{anchor:0,head:vo.doc.length},userEvent:"select"})),!0),selectLine=({state:vo,dispatch:Ai})=>{let bo=selectedLineBlocks(vo).map(({from:Ra,to:pc})=>EditorSelection.range(Ra,Math.min(pc+1,vo.doc.length)));return Ai(vo.update({selection:EditorSelection.create(bo),userEvent:"select"})),!0},selectParentSyntax=({state:vo,dispatch:Ai})=>{let bo=updateSel(vo.selection,Ra=>{let pc=syntaxTree(vo),mc=pc.resolveStack(Ra.from,1);if(Ra.empty){let uf=pc.resolveStack(Ra.from,-1);uf.node.from>=mc.node.from&&uf.node.to<=mc.node.to&&(mc=uf)}for(let uf=mc;uf;uf=uf.next){let{node:df}=uf;if((df.from<Ra.from&&df.to>=Ra.to||df.to>Ra.to&&df.from<=Ra.from)&&uf.next)return EditorSelection.range(df.to,df.from)}return Ra});return bo.eq(vo.selection)?!1:(Ai(setSel(vo,bo)),!0)},simplifySelection=({state:vo,dispatch:Ai})=>{let bo=vo.selection,Ra=null;return bo.ranges.length>1?Ra=EditorSelection.create([bo.main]):bo.main.empty||(Ra=EditorSelection.create([EditorSelection.cursor(bo.main.head)])),Ra?(Ai(setSel(vo,Ra)),!0):!1};function deleteBy(vo,Ai){if(vo.state.readOnly)return!1;let bo="delete.selection",{state:Ra}=vo,pc=Ra.changeByRange(mc=>{let{from:uf,to:df}=mc;if(uf==df){let ff=Ai(mc);ff<uf?(bo="delete.backward",ff=skipAtomic(vo,ff,!1)):ff>uf&&(bo="delete.forward",ff=skipAtomic(vo,ff,!0)),uf=Math.min(uf,ff),df=Math.max(df,ff)}else uf=skipAtomic(vo,uf,!1),df=skipAtomic(vo,df,!0);return uf==df?{range:mc}:{changes:{from:uf,to:df},range:EditorSelection.cursor(uf,uf<mc.head?-1:1)}});return pc.changes.empty?!1:(vo.dispatch(Ra.update(pc,{scrollIntoView:!0,userEvent:bo,effects:bo=="delete.selection"?EditorView.announce.of(Ra.phrase("Selection deleted")):void 0})),!0)}function skipAtomic(vo,Ai,bo){if(vo instanceof EditorView)for(let Ra of vo.state.facet(EditorView.atomicRanges).map(pc=>pc(vo)))Ra.between(Ai,Ai,(pc,mc)=>{pc<Ai&&mc>Ai&&(Ai=bo?mc:pc)});return Ai}const deleteByChar=(vo,Ai,bo)=>deleteBy(vo,Ra=>{let pc=Ra.from,{state:mc}=vo,uf=mc.doc.lineAt(pc),df,ff;if(bo&&!Ai&&pc>uf.from&&pc<uf.from+200&&!/[^ \t]/.test(df=uf.text.slice(0,pc-uf.from))){if(df[df.length-1]==" ")return pc-1;let hf=countColumn(df,mc.tabSize),pf=hf%getIndentUnit(mc)||getIndentUnit(mc);for(let mf=0;mf<pf&&df[df.length-1-mf]==" ";mf++)pc--;ff=pc}else ff=findClusterBreak(uf.text,pc-uf.from,Ai,Ai)+uf.from,ff==pc&&uf.number!=(Ai?mc.doc.lines:1)?ff+=Ai?1:-1:!Ai&&/[\ufe00-\ufe0f]/.test(uf.text.slice(ff-uf.from,pc-uf.from))&&(ff=findClusterBreak(uf.text,ff-uf.from,!1,!1)+uf.from);return ff}),deleteCharBackward=vo=>deleteByChar(vo,!1,!0),deleteCharForward=vo=>deleteByChar(vo,!0,!1),deleteByGroup=(vo,Ai)=>deleteBy(vo,bo=>{let Ra=bo.head,{state:pc}=vo,mc=pc.doc.lineAt(Ra),uf=pc.charCategorizer(Ra);for(let df=null;;){if(Ra==(Ai?mc.to:mc.from)){Ra==bo.head&&mc.number!=(Ai?pc.doc.lines:1)&&(Ra+=Ai?1:-1);break}let ff=findClusterBreak(mc.text,Ra-mc.from,Ai)+mc.from,hf=mc.text.slice(Math.min(Ra,ff)-mc.from,Math.max(Ra,ff)-mc.from),pf=uf(hf);if(df!=null&&pf!=df)break;(hf!=" "||Ra!=bo.head)&&(df=pf),Ra=ff}return Ra}),deleteGroupBackward=vo=>deleteByGroup(vo,!1),deleteGroupForward=vo=>deleteByGroup(vo,!0),deleteToLineEnd=vo=>deleteBy(vo,Ai=>{let bo=vo.lineBlockAt(Ai.head).to;return Ai.head<bo?bo:Math.min(vo.state.doc.length,Ai.head+1)}),deleteLineBoundaryBackward=vo=>deleteBy(vo,Ai=>{let bo=vo.moveToLineBoundary(Ai,!1).head;return Ai.head>bo?bo:Math.max(0,Ai.head-1)}),deleteLineBoundaryForward=vo=>deleteBy(vo,Ai=>{let bo=vo.moveToLineBoundary(Ai,!0).head;return Ai.head<bo?bo:Math.min(vo.state.doc.length,Ai.head+1)}),splitLine=({state:vo,dispatch:Ai})=>{if(vo.readOnly)return!1;let bo=vo.changeByRange(Ra=>({changes:{from:Ra.from,to:Ra.to,insert:Text.of(["",""])},range:EditorSelection.cursor(Ra.from)}));return Ai(vo.update(bo,{scrollIntoView:!0,userEvent:"input"})),!0},transposeChars=({state:vo,dispatch:Ai})=>{if(vo.readOnly)return!1;let bo=vo.changeByRange(Ra=>{if(!Ra.empty||Ra.from==0||Ra.from==vo.doc.length)return{range:Ra};let pc=Ra.from,mc=vo.doc.lineAt(pc),uf=pc==mc.from?pc-1:findClusterBreak(mc.text,pc-mc.from,!1)+mc.from,df=pc==mc.to?pc+1:findClusterBreak(mc.text,pc-mc.from,!0)+mc.from;return{changes:{from:uf,to:df,insert:vo.doc.slice(pc,df).append(vo.doc.slice(uf,pc))},range:EditorSelection.cursor(df)}});return bo.changes.empty?!1:(Ai(vo.update(bo,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function selectedLineBlocks(vo){let Ai=[],bo=-1;for(let Ra of vo.selection.ranges){let pc=vo.doc.lineAt(Ra.from),mc=vo.doc.lineAt(Ra.to);if(!Ra.empty&&Ra.to==mc.from&&(mc=vo.doc.lineAt(Ra.to-1)),bo>=pc.number){let uf=Ai[Ai.length-1];uf.to=mc.to,uf.ranges.push(Ra)}else Ai.push({from:pc.from,to:mc.to,ranges:[Ra]});bo=mc.number+1}return Ai}function moveLine(vo,Ai,bo){if(vo.readOnly)return!1;let Ra=[],pc=[];for(let mc of selectedLineBlocks(vo)){if(bo?mc.to==vo.doc.length:mc.from==0)continue;let uf=vo.doc.lineAt(bo?mc.to+1:mc.from-1),df=uf.length+1;if(bo){Ra.push({from:mc.to,to:uf.to},{from:mc.from,insert:uf.text+vo.lineBreak});for(let ff of mc.ranges)pc.push(EditorSelection.range(Math.min(vo.doc.length,ff.anchor+df),Math.min(vo.doc.length,ff.head+df)))}else{Ra.push({from:uf.from,to:mc.from},{from:mc.to,insert:vo.lineBreak+uf.text});for(let ff of mc.ranges)pc.push(EditorSelection.range(ff.anchor-df,ff.head-df))}}return Ra.length?(Ai(vo.update({changes:Ra,scrollIntoView:!0,selection:EditorSelection.create(pc,vo.selection.mainIndex),userEvent:"move.line"})),!0):!1}const moveLineUp=({state:vo,dispatch:Ai})=>moveLine(vo,Ai,!1),moveLineDown=({state:vo,dispatch:Ai})=>moveLine(vo,Ai,!0);function copyLine(vo,Ai,bo){if(vo.readOnly)return!1;let Ra=[];for(let pc of selectedLineBlocks(vo))bo?Ra.push({from:pc.from,insert:vo.doc.slice(pc.from,pc.to)+vo.lineBreak}):Ra.push({from:pc.to,insert:vo.lineBreak+vo.doc.slice(pc.from,pc.to)});return Ai(vo.update({changes:Ra,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const copyLineUp=({state:vo,dispatch:Ai})=>copyLine(vo,Ai,!1),copyLineDown=({state:vo,dispatch:Ai})=>copyLine(vo,Ai,!0),deleteLine=vo=>{if(vo.state.readOnly)return!1;let{state:Ai}=vo,bo=Ai.changes(selectedLineBlocks(Ai).map(({from:pc,to:mc})=>(pc>0?pc--:mc<Ai.doc.length&&mc++,{from:pc,to:mc}))),Ra=updateSel(Ai.selection,pc=>{let mc;if(vo.lineWrapping){let uf=vo.lineBlockAt(pc.head),df=vo.coordsAtPos(pc.head,pc.assoc||1);df&&(mc=uf.bottom+vo.documentTop-df.bottom+vo.defaultLineHeight/2)}return vo.moveVertically(pc,!0,mc)}).map(bo);return vo.dispatch({changes:bo,selection:Ra,scrollIntoView:!0,userEvent:"delete.line"}),!0};function isBetweenBrackets(vo,Ai){if(/\(\)|\[\]|\{\}/.test(vo.sliceDoc(Ai-1,Ai+1)))return{from:Ai,to:Ai};let bo=syntaxTree(vo).resolveInner(Ai),Ra=bo.childBefore(Ai),pc=bo.childAfter(Ai),mc;return Ra&&pc&&Ra.to<=Ai&&pc.from>=Ai&&(mc=Ra.type.prop(NodeProp.closedBy))&&mc.indexOf(pc.name)>-1&&vo.doc.lineAt(Ra.to).from==vo.doc.lineAt(pc.from).from&&!/\S/.test(vo.sliceDoc(Ra.to,pc.from))?{from:Ra.to,to:pc.from}:null}const insertNewlineAndIndent=newlineAndIndent(!1),insertBlankLine=newlineAndIndent(!0);function newlineAndIndent(vo){return({state:Ai,dispatch:bo})=>{if(Ai.readOnly)return!1;let Ra=Ai.changeByRange(pc=>{let{from:mc,to:uf}=pc,df=Ai.doc.lineAt(mc),ff=!vo&&mc==uf&&isBetweenBrackets(Ai,mc);vo&&(mc=uf=(uf<=df.to?df:Ai.doc.lineAt(uf)).to);let hf=new IndentContext(Ai,{simulateBreak:mc,simulateDoubleBreak:!!ff}),pf=getIndentation(hf,mc);for(pf==null&&(pf=countColumn(/^\s*/.exec(Ai.doc.lineAt(mc).text)[0],Ai.tabSize));uf<df.to&&/\s/.test(df.text[uf-df.from]);)uf++;ff?{from:mc,to:uf}=ff:mc>df.from&&mc<df.from+100&&!/\S/.test(df.text.slice(0,mc))&&(mc=df.from);let mf=["",indentString(Ai,pf)];return ff&&mf.push(indentString(Ai,hf.lineIndent(df.from,-1))),{changes:{from:mc,to:uf,insert:Text.of(mf)},range:EditorSelection.cursor(mc+1+mf[1].length)}});return bo(Ai.update(Ra,{scrollIntoView:!0,userEvent:"input"})),!0}}function changeBySelectedLine(vo,Ai){let bo=-1;return vo.changeByRange(Ra=>{let pc=[];for(let uf=Ra.from;uf<=Ra.to;){let df=vo.doc.lineAt(uf);df.number>bo&&(Ra.empty||Ra.to>df.from)&&(Ai(df,pc,Ra),bo=df.number),uf=df.to+1}let mc=vo.changes(pc);return{changes:pc,range:EditorSelection.range(mc.mapPos(Ra.anchor,1),mc.mapPos(Ra.head,1))}})}const indentSelection=({state:vo,dispatch:Ai})=>{if(vo.readOnly)return!1;let bo=Object.create(null),Ra=new IndentContext(vo,{overrideIndentation:mc=>bo[mc]??-1}),pc=changeBySelectedLine(vo,(mc,uf,df)=>{let ff=getIndentation(Ra,mc.from);if(ff==null)return;/\S/.test(mc.text)||(ff=0);let hf=/^\s*/.exec(mc.text)[0],pf=indentString(vo,ff);(hf!=pf||df.from<mc.from+hf.length)&&(bo[mc.from]=ff,uf.push({from:mc.from,to:mc.from+hf.length,insert:pf}))});return pc.changes.empty||Ai(vo.update(pc,{userEvent:"indent"})),!0},indentMore=({state:vo,dispatch:Ai})=>vo.readOnly?!1:(Ai(vo.update(changeBySelectedLine(vo,(bo,Ra)=>{Ra.push({from:bo.from,insert:vo.facet(indentUnit)})}),{userEvent:"input.indent"})),!0),indentLess=({state:vo,dispatch:Ai})=>vo.readOnly?!1:(Ai(vo.update(changeBySelectedLine(vo,(bo,Ra)=>{let pc=/^\s*/.exec(bo.text)[0];if(!pc)return;let mc=countColumn(pc,vo.tabSize),uf=0,df=indentString(vo,Math.max(0,mc-getIndentUnit(vo)));for(;uf<pc.length&&uf<df.length&&pc.charCodeAt(uf)==df.charCodeAt(uf);)uf++;Ra.push({from:bo.from+uf,to:bo.from+pc.length,insert:df.slice(uf)})}),{userEvent:"delete.dedent"})),!0),toggleTabFocusMode=vo=>(vo.setTabFocusMode(),!0),emacsStyleKeymap=[{key:"Ctrl-b",run:cursorCharLeft,shift:selectCharLeft,preventDefault:!0},{key:"Ctrl-f",run:cursorCharRight,shift:selectCharRight},{key:"Ctrl-p",run:cursorLineUp,shift:selectLineUp},{key:"Ctrl-n",run:cursorLineDown,shift:selectLineDown},{key:"Ctrl-a",run:cursorLineStart,shift:selectLineStart},{key:"Ctrl-e",run:cursorLineEnd,shift:selectLineEnd},{key:"Ctrl-d",run:deleteCharForward},{key:"Ctrl-h",run:deleteCharBackward},{key:"Ctrl-k",run:deleteToLineEnd},{key:"Ctrl-Alt-h",run:deleteGroupBackward},{key:"Ctrl-o",run:splitLine},{key:"Ctrl-t",run:transposeChars},{key:"Ctrl-v",run:cursorPageDown}],standardKeymap=[{key:"ArrowLeft",run:cursorCharLeft,shift:selectCharLeft,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:cursorGroupLeft,shift:selectGroupLeft,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:cursorLineBoundaryLeft,shift:selectLineBoundaryLeft,preventDefault:!0},{key:"ArrowRight",run:cursorCharRight,shift:selectCharRight,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:cursorGroupRight,shift:selectGroupRight,preventDefault:!0},{mac:"Cmd-ArrowRight",run:cursorLineBoundaryRight,shift:selectLineBoundaryRight,preventDefault:!0},{key:"ArrowUp",run:cursorLineUp,shift:selectLineUp,preventDefault:!0},{mac:"Cmd-ArrowUp",run:cursorDocStart,shift:selectDocStart},{mac:"Ctrl-ArrowUp",run:cursorPageUp,shift:selectPageUp},{key:"ArrowDown",run:cursorLineDown,shift:selectLineDown,preventDefault:!0},{mac:"Cmd-ArrowDown",run:cursorDocEnd,shift:selectDocEnd},{mac:"Ctrl-ArrowDown",run:cursorPageDown,shift:selectPageDown},{key:"PageUp",run:cursorPageUp,shift:selectPageUp},{key:"PageDown",run:cursorPageDown,shift:selectPageDown},{key:"Home",run:cursorLineBoundaryBackward,shift:selectLineBoundaryBackward,preventDefault:!0},{key:"Mod-Home",run:cursorDocStart,shift:selectDocStart},{key:"End",run:cursorLineBoundaryForward,shift:selectLineBoundaryForward,preventDefault:!0},{key:"Mod-End",run:cursorDocEnd,shift:selectDocEnd},{key:"Enter",run:insertNewlineAndIndent,shift:insertNewlineAndIndent},{key:"Mod-a",run:selectAll},{key:"Backspace",run:deleteCharBackward,shift:deleteCharBackward},{key:"Delete",run:deleteCharForward},{key:"Mod-Backspace",mac:"Alt-Backspace",run:deleteGroupBackward},{key:"Mod-Delete",mac:"Alt-Delete",run:deleteGroupForward},{mac:"Mod-Backspace",run:deleteLineBoundaryBackward},{mac:"Mod-Delete",run:deleteLineBoundaryForward}].concat(emacsStyleKeymap.map(vo=>({mac:vo.key,run:vo.run,shift:vo.shift}))),defaultKeymap=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:cursorSyntaxLeft,shift:selectSyntaxLeft},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:cursorSyntaxRight,shift:selectSyntaxRight},{key:"Alt-ArrowUp",run:moveLineUp},{key:"Shift-Alt-ArrowUp",run:copyLineUp},{key:"Alt-ArrowDown",run:moveLineDown},{key:"Shift-Alt-ArrowDown",run:copyLineDown},{key:"Escape",run:simplifySelection},{key:"Mod-Enter",run:insertBlankLine},{key:"Alt-l",mac:"Ctrl-l",run:selectLine},{key:"Mod-i",run:selectParentSyntax,preventDefault:!0},{key:"Mod-[",run:indentLess},{key:"Mod-]",run:indentMore},{key:"Mod-Alt-\\",run:indentSelection},{key:"Shift-Mod-k",run:deleteLine},{key:"Shift-Mod-\\",run:cursorMatchingBracket},{key:"Mod-/",run:toggleComment},{key:"Alt-A",run:toggleBlockComment},{key:"Ctrl-m",mac:"Shift-Alt-m",run:toggleTabFocusMode}].concat(standardKeymap),indentWithTab={key:"Tab",run:indentMore,shift:indentLess},basicNormalize=typeof String.prototype.normalize=="function"?vo=>vo.normalize("NFKD"):vo=>vo;class SearchCursor{constructor(Ai,bo,Ra=0,pc=Ai.length,mc,uf){this.test=uf,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=Ai.iterRange(Ra,pc),this.bufferStart=Ra,this.normalize=mc?df=>mc(basicNormalize(df)):basicNormalize,this.query=this.normalize(bo)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return codePointAt(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let Ai=this.peek();if(Ai<0)return this.done=!0,this;let bo=fromCodePoint(Ai),Ra=this.bufferStart+this.bufferPos;this.bufferPos+=codePointSize(Ai);let pc=this.normalize(bo);if(pc.length)for(let mc=0,uf=Ra;;mc++){let df=pc.charCodeAt(mc),ff=this.match(df,uf,this.bufferPos+this.bufferStart);if(mc==pc.length-1){if(ff)return this.value=ff,this;break}uf==Ra&&mc<bo.length&&bo.charCodeAt(mc)==df&&uf++}}}match(Ai,bo,Ra){let pc=null;for(let mc=0;mc<this.matches.length;mc+=2){let uf=this.matches[mc],df=!1;this.query.charCodeAt(uf)==Ai&&(uf==this.query.length-1?pc={from:this.matches[mc+1],to:Ra}:(this.matches[mc]++,df=!0)),df||(this.matches.splice(mc,2),mc-=2)}return this.query.charCodeAt(0)==Ai&&(this.query.length==1?pc={from:bo,to:Ra}:this.matches.push(1,bo)),pc&&this.test&&!this.test(pc.from,pc.to,this.buffer,this.bufferStart)&&(pc=null),pc}}typeof Symbol<"u"&&(SearchCursor.prototype[Symbol.iterator]=function(){return this});const empty={from:-1,to:-1,match:/.*/.exec("")},baseFlags="gm"+(/x/.unicode==null?"":"u");class RegExpCursor{constructor(Ai,bo,Ra,pc=0,mc=Ai.length){if(this.text=Ai,this.to=mc,this.curLine="",this.done=!1,this.value=empty,/\\[sWDnr]|\n|\r|\[\^/.test(bo))return new MultilineRegExpCursor(Ai,bo,Ra,pc,mc);this.re=new RegExp(bo,baseFlags+(Ra!=null&&Ra.ignoreCase?"i":"")),this.test=Ra==null?void 0:Ra.test,this.iter=Ai.iter();let uf=Ai.lineAt(pc);this.curLineStart=uf.from,this.matchPos=toCharEnd(Ai,pc),this.getLine(this.curLineStart)}getLine(Ai){this.iter.next(Ai),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let Ai=this.matchPos-this.curLineStart;;){this.re.lastIndex=Ai;let bo=this.matchPos<=this.to&&this.re.exec(this.curLine);if(bo){let Ra=this.curLineStart+bo.index,pc=Ra+bo[0].length;if(this.matchPos=toCharEnd(this.text,pc+(Ra==pc?1:0)),Ra==this.curLineStart+this.curLine.length&&this.nextLine(),(Ra<pc||Ra>this.value.to)&&(!this.test||this.test(Ra,pc,bo)))return this.value={from:Ra,to:pc,match:bo},this;Ai=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),Ai=0;else return this.done=!0,this}}}const flattened=new WeakMap;class FlattenedDoc{constructor(Ai,bo){this.from=Ai,this.text=bo}get to(){return this.from+this.text.length}static get(Ai,bo,Ra){let pc=flattened.get(Ai);if(!pc||pc.from>=Ra||pc.to<=bo){let df=new FlattenedDoc(bo,Ai.sliceString(bo,Ra));return flattened.set(Ai,df),df}if(pc.from==bo&&pc.to==Ra)return pc;let{text:mc,from:uf}=pc;return uf>bo&&(mc=Ai.sliceString(bo,uf)+mc,uf=bo),pc.to<Ra&&(mc+=Ai.sliceString(pc.to,Ra)),flattened.set(Ai,new FlattenedDoc(uf,mc)),new FlattenedDoc(bo,mc.slice(bo-uf,Ra-uf))}}class MultilineRegExpCursor{constructor(Ai,bo,Ra,pc,mc){this.text=Ai,this.to=mc,this.done=!1,this.value=empty,this.matchPos=toCharEnd(Ai,pc),this.re=new RegExp(bo,baseFlags+(Ra!=null&&Ra.ignoreCase?"i":"")),this.test=Ra==null?void 0:Ra.test,this.flat=FlattenedDoc.get(Ai,pc,this.chunkEnd(pc+5e3))}chunkEnd(Ai){return Ai>=this.to?this.to:this.text.lineAt(Ai).to}next(){for(;;){let Ai=this.re.lastIndex=this.matchPos-this.flat.from,bo=this.re.exec(this.flat.text);if(bo&&!bo[0]&&bo.index==Ai&&(this.re.lastIndex=Ai+1,bo=this.re.exec(this.flat.text)),bo){let Ra=this.flat.from+bo.index,pc=Ra+bo[0].length;if((this.flat.to>=this.to||bo.index+bo[0].length<=this.flat.text.length-10)&&(!this.test||this.test(Ra,pc,bo)))return this.value={from:Ra,to:pc,match:bo},this.matchPos=toCharEnd(this.text,pc+(Ra==pc?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=FlattenedDoc.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(RegExpCursor.prototype[Symbol.iterator]=MultilineRegExpCursor.prototype[Symbol.iterator]=function(){return this});function validRegExp(vo){try{return new RegExp(vo,baseFlags),!0}catch{return!1}}function toCharEnd(vo,Ai){if(Ai>=vo.length)return Ai;let bo=vo.lineAt(Ai),Ra;for(;Ai<bo.to&&(Ra=bo.text.charCodeAt(Ai-bo.from))>=56320&&Ra<57344;)Ai++;return Ai}function createLineDialog(vo){let Ai=String(vo.state.doc.lineAt(vo.state.selection.main.head).number),bo=crelt("input",{class:"cm-textfield",name:"line",value:Ai}),Ra=crelt("form",{class:"cm-gotoLine",onkeydown:mc=>{mc.keyCode==27?(mc.preventDefault(),vo.dispatch({effects:dialogEffect.of(!1)}),vo.focus()):mc.keyCode==13&&(mc.preventDefault(),pc())},onsubmit:mc=>{mc.preventDefault(),pc()}},crelt("label",vo.state.phrase("Go to line"),": ",bo)," ",crelt("button",{class:"cm-button",type:"submit"},vo.state.phrase("go")));function pc(){let mc=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(bo.value);if(!mc)return;let{state:uf}=vo,df=uf.doc.lineAt(uf.selection.main.head),[,ff,hf,pf,mf]=mc,gf=pf?+pf.slice(1):0,yf=hf?+hf:df.number;if(hf&&mf){let Sf=yf/100;ff&&(Sf=Sf*(ff=="-"?-1:1)+df.number/uf.doc.lines),yf=Math.round(uf.doc.lines*Sf)}else hf&&ff&&(yf=yf*(ff=="-"?-1:1)+df.number);let vf=uf.doc.line(Math.max(1,Math.min(uf.doc.lines,yf))),bf=EditorSelection.cursor(vf.from+Math.max(0,Math.min(gf,vf.length)));vo.dispatch({effects:[dialogEffect.of(!1),EditorView.scrollIntoView(bf.from,{y:"center"})],selection:bf}),vo.focus()}return{dom:Ra}}const dialogEffect=StateEffect.define(),dialogField=StateField.define({create(){return!0},update(vo,Ai){for(let bo of Ai.effects)bo.is(dialogEffect)&&(vo=bo.value);return vo},provide:vo=>showPanel.from(vo,Ai=>Ai?createLineDialog:null)}),gotoLine=vo=>{let Ai=getPanel(vo,createLineDialog);if(!Ai){let bo=[dialogEffect.of(!0)];vo.state.field(dialogField,!1)==null&&bo.push(StateEffect.appendConfig.of([dialogField,baseTheme$1])),vo.dispatch({effects:bo}),Ai=getPanel(vo,createLineDialog)}return Ai&&Ai.dom.querySelector("input").select(),!0},baseTheme$1=EditorView.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),defaultHighlightOptions={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},highlightConfig=Facet.define({combine(vo){return combineConfig(vo,defaultHighlightOptions,{highlightWordAroundCursor:(Ai,bo)=>Ai||bo,minSelectionLength:Math.min,maxMatches:Math.min})}});function highlightSelectionMatches(vo){return[defaultTheme,matchHighlighter]}const matchDeco=Decoration.mark({class:"cm-selectionMatch"}),mainMatchDeco=Decoration.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function insideWordBoundaries(vo,Ai,bo,Ra){return(bo==0||vo(Ai.sliceDoc(bo-1,bo))!=CharCategory.Word)&&(Ra==Ai.doc.length||vo(Ai.sliceDoc(Ra,Ra+1))!=CharCategory.Word)}function insideWord(vo,Ai,bo,Ra){return vo(Ai.sliceDoc(bo,bo+1))==CharCategory.Word&&vo(Ai.sliceDoc(Ra-1,Ra))==CharCategory.Word}const matchHighlighter=ViewPlugin.fromClass(class{constructor(vo){this.decorations=this.getDeco(vo)}update(vo){(vo.selectionSet||vo.docChanged||vo.viewportChanged)&&(this.decorations=this.getDeco(vo.view))}getDeco(vo){let Ai=vo.state.facet(highlightConfig),{state:bo}=vo,Ra=bo.selection;if(Ra.ranges.length>1)return Decoration.none;let pc=Ra.main,mc,uf=null;if(pc.empty){if(!Ai.highlightWordAroundCursor)return Decoration.none;let ff=bo.wordAt(pc.head);if(!ff)return Decoration.none;uf=bo.charCategorizer(pc.head),mc=bo.sliceDoc(ff.from,ff.to)}else{let ff=pc.to-pc.from;if(ff<Ai.minSelectionLength||ff>200)return Decoration.none;if(Ai.wholeWords){if(mc=bo.sliceDoc(pc.from,pc.to),uf=bo.charCategorizer(pc.head),!(insideWordBoundaries(uf,bo,pc.from,pc.to)&&insideWord(uf,bo,pc.from,pc.to)))return Decoration.none}else if(mc=bo.sliceDoc(pc.from,pc.to),!mc)return Decoration.none}let df=[];for(let ff of vo.visibleRanges){let hf=new SearchCursor(bo.doc,mc,ff.from,ff.to);for(;!hf.next().done;){let{from:pf,to:mf}=hf.value;if((!uf||insideWordBoundaries(uf,bo,pf,mf))&&(pc.empty&&pf<=pc.from&&mf>=pc.to?df.push(mainMatchDeco.range(pf,mf)):(pf>=pc.to||mf<=pc.from)&&df.push(matchDeco.range(pf,mf)),df.length>Ai.maxMatches))return Decoration.none}}return Decoration.set(df)}},{decorations:vo=>vo.decorations}),defaultTheme=EditorView.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),selectWord=({state:vo,dispatch:Ai})=>{let{selection:bo}=vo,Ra=EditorSelection.create(bo.ranges.map(pc=>vo.wordAt(pc.head)||EditorSelection.cursor(pc.head)),bo.mainIndex);return Ra.eq(bo)?!1:(Ai(vo.update({selection:Ra})),!0)};function findNextOccurrence(vo,Ai){let{main:bo,ranges:Ra}=vo.selection,pc=vo.wordAt(bo.head),mc=pc&&pc.from==bo.from&&pc.to==bo.to;for(let uf=!1,df=new SearchCursor(vo.doc,Ai,Ra[Ra.length-1].to);;)if(df.next(),df.done){if(uf)return null;df=new SearchCursor(vo.doc,Ai,0,Math.max(0,Ra[Ra.length-1].from-1)),uf=!0}else{if(uf&&Ra.some(ff=>ff.from==df.value.from))continue;if(mc){let ff=vo.wordAt(df.value.from);if(!ff||ff.from!=df.value.from||ff.to!=df.value.to)continue}return df.value}}const selectNextOccurrence=({state:vo,dispatch:Ai})=>{let{ranges:bo}=vo.selection;if(bo.some(mc=>mc.from===mc.to))return selectWord({state:vo,dispatch:Ai});let Ra=vo.sliceDoc(bo[0].from,bo[0].to);if(vo.selection.ranges.some(mc=>vo.sliceDoc(mc.from,mc.to)!=Ra))return!1;let pc=findNextOccurrence(vo,Ra);return pc?(Ai(vo.update({selection:vo.selection.addRange(EditorSelection.range(pc.from,pc.to),!1),effects:EditorView.scrollIntoView(pc.to)})),!0):!1},searchConfigFacet=Facet.define({combine(vo){return combineConfig(vo,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:Ai=>new SearchPanel(Ai),scrollToMatch:Ai=>EditorView.scrollIntoView(Ai)})}});class SearchQuery{constructor(Ai){this.search=Ai.search,this.caseSensitive=!!Ai.caseSensitive,this.literal=!!Ai.literal,this.regexp=!!Ai.regexp,this.replace=Ai.replace||"",this.valid=!!this.search&&(!this.regexp||validRegExp(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!Ai.wholeWord}unquote(Ai){return this.literal?Ai:Ai.replace(/\\([nrt\\])/g,(bo,Ra)=>Ra=="n"?`
|
|
375
|
-
`:Ra=="r"?"\r":Ra=="t"?" ":"\\")}eq(Ai){return this.search==Ai.search&&this.replace==Ai.replace&&this.caseSensitive==Ai.caseSensitive&&this.regexp==Ai.regexp&&this.wholeWord==Ai.wholeWord}create(){return this.regexp?new RegExpQuery(this):new StringQuery(this)}getCursor(Ai,bo=0,Ra){let pc=Ai.doc?Ai:EditorState.create({doc:Ai});return Ra==null&&(Ra=pc.doc.length),this.regexp?regexpCursor(this,pc,bo,Ra):stringCursor(this,pc,bo,Ra)}}class QueryType{constructor(Ai){this.spec=Ai}}function stringCursor(vo,Ai,bo,Ra){return new SearchCursor(Ai.doc,vo.unquoted,bo,Ra,vo.caseSensitive?void 0:pc=>pc.toLowerCase(),vo.wholeWord?stringWordTest(Ai.doc,Ai.charCategorizer(Ai.selection.main.head)):void 0)}function stringWordTest(vo,Ai){return(bo,Ra,pc,mc)=>((mc>bo||mc+pc.length<Ra)&&(mc=Math.max(0,bo-2),pc=vo.sliceString(mc,Math.min(vo.length,Ra+2))),(Ai(charBefore(pc,bo-mc))!=CharCategory.Word||Ai(charAfter(pc,bo-mc))!=CharCategory.Word)&&(Ai(charAfter(pc,Ra-mc))!=CharCategory.Word||Ai(charBefore(pc,Ra-mc))!=CharCategory.Word))}class StringQuery extends QueryType{constructor(Ai){super(Ai)}nextMatch(Ai,bo,Ra){let pc=stringCursor(this.spec,Ai,Ra,Ai.doc.length).nextOverlapping();if(pc.done){let mc=Math.min(Ai.doc.length,bo+this.spec.unquoted.length);pc=stringCursor(this.spec,Ai,0,mc).nextOverlapping()}return pc.done||pc.value.from==bo&&pc.value.to==Ra?null:pc.value}prevMatchInRange(Ai,bo,Ra){for(let pc=Ra;;){let mc=Math.max(bo,pc-1e4-this.spec.unquoted.length),uf=stringCursor(this.spec,Ai,mc,pc),df=null;for(;!uf.nextOverlapping().done;)df=uf.value;if(df)return df;if(mc==bo)return null;pc-=1e4}}prevMatch(Ai,bo,Ra){let pc=this.prevMatchInRange(Ai,0,bo);return pc||(pc=this.prevMatchInRange(Ai,Math.max(0,Ra-this.spec.unquoted.length),Ai.doc.length)),pc&&(pc.from!=bo||pc.to!=Ra)?pc:null}getReplacement(Ai){return this.spec.unquote(this.spec.replace)}matchAll(Ai,bo){let Ra=stringCursor(this.spec,Ai,0,Ai.doc.length),pc=[];for(;!Ra.next().done;){if(pc.length>=bo)return null;pc.push(Ra.value)}return pc}highlight(Ai,bo,Ra,pc){let mc=stringCursor(this.spec,Ai,Math.max(0,bo-this.spec.unquoted.length),Math.min(Ra+this.spec.unquoted.length,Ai.doc.length));for(;!mc.next().done;)pc(mc.value.from,mc.value.to)}}function regexpCursor(vo,Ai,bo,Ra){return new RegExpCursor(Ai.doc,vo.search,{ignoreCase:!vo.caseSensitive,test:vo.wholeWord?regexpWordTest(Ai.charCategorizer(Ai.selection.main.head)):void 0},bo,Ra)}function charBefore(vo,Ai){return vo.slice(findClusterBreak(vo,Ai,!1),Ai)}function charAfter(vo,Ai){return vo.slice(Ai,findClusterBreak(vo,Ai))}function regexpWordTest(vo){return(Ai,bo,Ra)=>!Ra[0].length||(vo(charBefore(Ra.input,Ra.index))!=CharCategory.Word||vo(charAfter(Ra.input,Ra.index))!=CharCategory.Word)&&(vo(charAfter(Ra.input,Ra.index+Ra[0].length))!=CharCategory.Word||vo(charBefore(Ra.input,Ra.index+Ra[0].length))!=CharCategory.Word)}class RegExpQuery extends QueryType{nextMatch(Ai,bo,Ra){let pc=regexpCursor(this.spec,Ai,Ra,Ai.doc.length).next();return pc.done&&(pc=regexpCursor(this.spec,Ai,0,bo).next()),pc.done?null:pc.value}prevMatchInRange(Ai,bo,Ra){for(let pc=1;;pc++){let mc=Math.max(bo,Ra-pc*1e4),uf=regexpCursor(this.spec,Ai,mc,Ra),df=null;for(;!uf.next().done;)df=uf.value;if(df&&(mc==bo||df.from>mc+10))return df;if(mc==bo)return null}}prevMatch(Ai,bo,Ra){return this.prevMatchInRange(Ai,0,bo)||this.prevMatchInRange(Ai,Ra,Ai.doc.length)}getReplacement(Ai){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,(bo,Ra)=>Ra=="$"?"$":Ra=="&"?Ai.match[0]:Ra!="0"&&+Ra<Ai.match.length?Ai.match[Ra]:bo)}matchAll(Ai,bo){let Ra=regexpCursor(this.spec,Ai,0,Ai.doc.length),pc=[];for(;!Ra.next().done;){if(pc.length>=bo)return null;pc.push(Ra.value)}return pc}highlight(Ai,bo,Ra,pc){let mc=regexpCursor(this.spec,Ai,Math.max(0,bo-250),Math.min(Ra+250,Ai.doc.length));for(;!mc.next().done;)pc(mc.value.from,mc.value.to)}}const setSearchQuery=StateEffect.define(),togglePanel=StateEffect.define(),searchState=StateField.define({create(vo){return new SearchState(defaultQuery(vo).create(),null)},update(vo,Ai){for(let bo of Ai.effects)bo.is(setSearchQuery)?vo=new SearchState(bo.value.create(),vo.panel):bo.is(togglePanel)&&(vo=new SearchState(vo.query,bo.value?createSearchPanel:null));return vo},provide:vo=>showPanel.from(vo,Ai=>Ai.panel)});class SearchState{constructor(Ai,bo){this.query=Ai,this.panel=bo}}const matchMark=Decoration.mark({class:"cm-searchMatch"}),selectedMatchMark=Decoration.mark({class:"cm-searchMatch cm-searchMatch-selected"}),searchHighlighter=ViewPlugin.fromClass(class{constructor(vo){this.view=vo,this.decorations=this.highlight(vo.state.field(searchState))}update(vo){let Ai=vo.state.field(searchState);(Ai!=vo.startState.field(searchState)||vo.docChanged||vo.selectionSet||vo.viewportChanged)&&(this.decorations=this.highlight(Ai))}highlight({query:vo,panel:Ai}){if(!Ai||!vo.spec.valid)return Decoration.none;let{view:bo}=this,Ra=new RangeSetBuilder;for(let pc=0,mc=bo.visibleRanges,uf=mc.length;pc<uf;pc++){let{from:df,to:ff}=mc[pc];for(;pc<uf-1&&ff>mc[pc+1].from-2*250;)ff=mc[++pc].to;vo.highlight(bo.state,df,ff,(hf,pf)=>{let mf=bo.state.selection.ranges.some(gf=>gf.from==hf&&gf.to==pf);Ra.add(hf,pf,mf?selectedMatchMark:matchMark)})}return Ra.finish()}},{decorations:vo=>vo.decorations});function searchCommand(vo){return Ai=>{let bo=Ai.state.field(searchState,!1);return bo&&bo.query.spec.valid?vo(Ai,bo):openSearchPanel(Ai)}}const findNext=searchCommand((vo,{query:Ai})=>{let{to:bo}=vo.state.selection.main,Ra=Ai.nextMatch(vo.state,bo,bo);if(!Ra)return!1;let pc=EditorSelection.single(Ra.from,Ra.to),mc=vo.state.facet(searchConfigFacet);return vo.dispatch({selection:pc,effects:[announceMatch(vo,Ra),mc.scrollToMatch(pc.main,vo)],userEvent:"select.search"}),selectSearchInput(vo),!0}),findPrevious=searchCommand((vo,{query:Ai})=>{let{state:bo}=vo,{from:Ra}=bo.selection.main,pc=Ai.prevMatch(bo,Ra,Ra);if(!pc)return!1;let mc=EditorSelection.single(pc.from,pc.to),uf=vo.state.facet(searchConfigFacet);return vo.dispatch({selection:mc,effects:[announceMatch(vo,pc),uf.scrollToMatch(mc.main,vo)],userEvent:"select.search"}),selectSearchInput(vo),!0}),selectMatches=searchCommand((vo,{query:Ai})=>{let bo=Ai.matchAll(vo.state,1e3);return!bo||!bo.length?!1:(vo.dispatch({selection:EditorSelection.create(bo.map(Ra=>EditorSelection.range(Ra.from,Ra.to))),userEvent:"select.search.matches"}),!0)}),selectSelectionMatches=({state:vo,dispatch:Ai})=>{let bo=vo.selection;if(bo.ranges.length>1||bo.main.empty)return!1;let{from:Ra,to:pc}=bo.main,mc=[],uf=0;for(let df=new SearchCursor(vo.doc,vo.sliceDoc(Ra,pc));!df.next().done;){if(mc.length>1e3)return!1;df.value.from==Ra&&(uf=mc.length),mc.push(EditorSelection.range(df.value.from,df.value.to))}return Ai(vo.update({selection:EditorSelection.create(mc,uf),userEvent:"select.search.matches"})),!0},replaceNext=searchCommand((vo,{query:Ai})=>{let{state:bo}=vo,{from:Ra,to:pc}=bo.selection.main;if(bo.readOnly)return!1;let mc=Ai.nextMatch(bo,Ra,Ra);if(!mc)return!1;let uf=mc,df=[],ff,hf,pf=[];if(uf.from==Ra&&uf.to==pc&&(hf=bo.toText(Ai.getReplacement(uf)),df.push({from:uf.from,to:uf.to,insert:hf}),uf=Ai.nextMatch(bo,uf.from,uf.to),pf.push(EditorView.announce.of(bo.phrase("replaced match on line $",bo.doc.lineAt(Ra).number)+"."))),uf){let mf=df.length==0||df[0].from>=mc.to?0:mc.to-mc.from-hf.length;ff=EditorSelection.single(uf.from-mf,uf.to-mf),pf.push(announceMatch(vo,uf)),pf.push(bo.facet(searchConfigFacet).scrollToMatch(ff.main,vo))}return vo.dispatch({changes:df,selection:ff,effects:pf,userEvent:"input.replace"}),!0}),replaceAll=searchCommand((vo,{query:Ai})=>{if(vo.state.readOnly)return!1;let bo=Ai.matchAll(vo.state,1e9).map(pc=>{let{from:mc,to:uf}=pc;return{from:mc,to:uf,insert:Ai.getReplacement(pc)}});if(!bo.length)return!1;let Ra=vo.state.phrase("replaced $ matches",bo.length)+".";return vo.dispatch({changes:bo,effects:EditorView.announce.of(Ra),userEvent:"input.replace.all"}),!0});function createSearchPanel(vo){return vo.state.facet(searchConfigFacet).createPanel(vo)}function defaultQuery(vo,Ai){var bo,Ra,pc,mc,uf;let df=vo.selection.main,ff=df.empty||df.to>df.from+100?"":vo.sliceDoc(df.from,df.to);if(Ai&&!ff)return Ai;let hf=vo.facet(searchConfigFacet);return new SearchQuery({search:((bo=Ai==null?void 0:Ai.literal)!==null&&bo!==void 0?bo:hf.literal)?ff:ff.replace(/\n/g,"\\n"),caseSensitive:(Ra=Ai==null?void 0:Ai.caseSensitive)!==null&&Ra!==void 0?Ra:hf.caseSensitive,literal:(pc=Ai==null?void 0:Ai.literal)!==null&&pc!==void 0?pc:hf.literal,regexp:(mc=Ai==null?void 0:Ai.regexp)!==null&&mc!==void 0?mc:hf.regexp,wholeWord:(uf=Ai==null?void 0:Ai.wholeWord)!==null&&uf!==void 0?uf:hf.wholeWord})}function getSearchInput(vo){let Ai=getPanel(vo,createSearchPanel);return Ai&&Ai.dom.querySelector("[main-field]")}function selectSearchInput(vo){let Ai=getSearchInput(vo);Ai&&Ai==vo.root.activeElement&&Ai.select()}const openSearchPanel=vo=>{let Ai=vo.state.field(searchState,!1);if(Ai&&Ai.panel){let bo=getSearchInput(vo);if(bo&&bo!=vo.root.activeElement){let Ra=defaultQuery(vo.state,Ai.query.spec);Ra.valid&&vo.dispatch({effects:setSearchQuery.of(Ra)}),bo.focus(),bo.select()}}else vo.dispatch({effects:[togglePanel.of(!0),Ai?setSearchQuery.of(defaultQuery(vo.state,Ai.query.spec)):StateEffect.appendConfig.of(searchExtensions)]});return!0},closeSearchPanel=vo=>{let Ai=vo.state.field(searchState,!1);if(!Ai||!Ai.panel)return!1;let bo=getPanel(vo,createSearchPanel);return bo&&bo.dom.contains(vo.root.activeElement)&&vo.focus(),vo.dispatch({effects:togglePanel.of(!1)}),!0},searchKeymap=[{key:"Mod-f",run:openSearchPanel,scope:"editor search-panel"},{key:"F3",run:findNext,shift:findPrevious,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:findNext,shift:findPrevious,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:closeSearchPanel,scope:"editor search-panel"},{key:"Mod-Shift-l",run:selectSelectionMatches},{key:"Mod-Alt-g",run:gotoLine},{key:"Mod-d",run:selectNextOccurrence,preventDefault:!0}];class SearchPanel{constructor(Ai){this.view=Ai;let bo=this.query=Ai.state.field(searchState).query.spec;this.commit=this.commit.bind(this),this.searchField=crelt("input",{value:bo.search,placeholder:phrase(Ai,"Find"),"aria-label":phrase(Ai,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=crelt("input",{value:bo.replace,placeholder:phrase(Ai,"Replace"),"aria-label":phrase(Ai,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=crelt("input",{type:"checkbox",name:"case",form:"",checked:bo.caseSensitive,onchange:this.commit}),this.reField=crelt("input",{type:"checkbox",name:"re",form:"",checked:bo.regexp,onchange:this.commit}),this.wordField=crelt("input",{type:"checkbox",name:"word",form:"",checked:bo.wholeWord,onchange:this.commit});function Ra(pc,mc,uf){return crelt("button",{class:"cm-button",name:pc,onclick:mc,type:"button"},uf)}this.dom=crelt("div",{onkeydown:pc=>this.keydown(pc),class:"cm-search"},[this.searchField,Ra("next",()=>findNext(Ai),[phrase(Ai,"next")]),Ra("prev",()=>findPrevious(Ai),[phrase(Ai,"previous")]),Ra("select",()=>selectMatches(Ai),[phrase(Ai,"all")]),crelt("label",null,[this.caseField,phrase(Ai,"match case")]),crelt("label",null,[this.reField,phrase(Ai,"regexp")]),crelt("label",null,[this.wordField,phrase(Ai,"by word")]),...Ai.state.readOnly?[]:[crelt("br"),this.replaceField,Ra("replace",()=>replaceNext(Ai),[phrase(Ai,"replace")]),Ra("replaceAll",()=>replaceAll(Ai),[phrase(Ai,"replace all")])],crelt("button",{name:"close",onclick:()=>closeSearchPanel(Ai),"aria-label":phrase(Ai,"close"),type:"button"},["×"])])}commit(){let Ai=new SearchQuery({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});Ai.eq(this.query)||(this.query=Ai,this.view.dispatch({effects:setSearchQuery.of(Ai)}))}keydown(Ai){runScopeHandlers(this.view,Ai,"search-panel")?Ai.preventDefault():Ai.keyCode==13&&Ai.target==this.searchField?(Ai.preventDefault(),(Ai.shiftKey?findPrevious:findNext)(this.view)):Ai.keyCode==13&&Ai.target==this.replaceField&&(Ai.preventDefault(),replaceNext(this.view))}update(Ai){for(let bo of Ai.transactions)for(let Ra of bo.effects)Ra.is(setSearchQuery)&&!Ra.value.eq(this.query)&&this.setQuery(Ra.value)}setQuery(Ai){this.query=Ai,this.searchField.value=Ai.search,this.replaceField.value=Ai.replace,this.caseField.checked=Ai.caseSensitive,this.reField.checked=Ai.regexp,this.wordField.checked=Ai.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(searchConfigFacet).top}}function phrase(vo,Ai){return vo.state.phrase(Ai)}const AnnounceMargin=30,Break=/[\s\.,:;?!]/;function announceMatch(vo,{from:Ai,to:bo}){let Ra=vo.state.doc.lineAt(Ai),pc=vo.state.doc.lineAt(bo).to,mc=Math.max(Ra.from,Ai-AnnounceMargin),uf=Math.min(pc,bo+AnnounceMargin),df=vo.state.sliceDoc(mc,uf);if(mc!=Ra.from){for(let ff=0;ff<AnnounceMargin;ff++)if(!Break.test(df[ff+1])&&Break.test(df[ff])){df=df.slice(ff);break}}if(uf!=pc){for(let ff=df.length-1;ff>df.length-AnnounceMargin;ff--)if(!Break.test(df[ff-1])&&Break.test(df[ff])){df=df.slice(0,ff);break}}return EditorView.announce.of(`${vo.state.phrase("current match")}. ${df} ${vo.state.phrase("on line")} ${Ra.number}.`)}const baseTheme=EditorView.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),searchExtensions=[searchState,Prec.low(searchHighlighter),baseTheme];function convertGraphQLErrorToDiagnostic(vo){var Ai,bo,Ra,pc;return{from:(Ai=vo.locations)!=null&&Ai[0]?((bo=vo.positions)==null?void 0:bo[0])??0:0,to:(Ra=vo.locations)!=null&&Ra[0]?(((pc=vo.positions)==null?void 0:pc[0])??0)+1:1,severity:"error",message:vo.message}}function makeLinter(vo,Ai){return linter(bo=>{const Ra=bo.state.doc.toString();let pc=[];if(Ai&&(pc=pc.concat(Ai(Ra))),isDocumentString(Ra))try{const mc=parse(Ra),uf=new Set(mc.definitions.filter(hf=>"name"in hf&&hf.name).map(hf=>hf.name.value)),df=filterSchema({schema:vo,typeFilter:hf=>!uf.has(hf)}),ff=validateSDL(mc,df).map(hf=>locatedError(hf,mc)).filter((hf,pf,mf)=>pf===mf.findIndex(gf=>{var yf,vf,bf,Sf,xf,wf,If,l1;return gf.message===hf.message&&((vf=(yf=gf.locations)==null?void 0:yf[0])==null?void 0:vf.line)===((Sf=(bf=hf.locations)==null?void 0:bf[0])==null?void 0:Sf.line)&&((wf=(xf=gf.locations)==null?void 0:xf[0])==null?void 0:wf.column)===((l1=(If=hf.locations)==null?void 0:If[0])==null?void 0:l1.column)}));pc=pc.concat(ff.map(convertGraphQLErrorToDiagnostic))}catch(mc){mc instanceof GraphQLError&&pc.push(convertGraphQLErrorToDiagnostic(mc))}return pc})}function makeUpdateHandler(vo,Ai,bo){return EditorView.updateListener.of(Ra=>{if(vo||!Ra.docChanged||Ra.transactions.some(mc=>mc.annotation(Transaction.userEvent)==="external"))return;const pc=Ra.state.doc.toString();Ai.current&&clearTimeout(Ai.current),Ai.current=setTimeout(()=>{bo==null||bo(pc)},updateTimeout)})}function makeFocusHandler(vo,Ai,bo){return EditorView.focusChangeEffect.of((Ra,pc)=>{if(vo||pc)return null;Ai.current&&clearTimeout(Ai.current);const mc=Ra.doc.toString();return bo==null||bo(mc),null})}function makePasteHandler(vo,Ai,bo){return EditorView.domEventHandlers({paste:(Ra,pc)=>{if(vo)return!1;const mc=pc.state.doc.toString();return Ai.current&&clearTimeout(Ai.current),bo==null||bo(mc),forceLinting(pc),!1}})}function useEditorRefs(){const vo=useRef(null),Ai=useRef(null),bo=useRef(new Compartment),Ra=useRef(new Compartment),pc=useRef(new Compartment),mc=useRef(null);return{editorRef:vo,viewRef:Ai,updateListenerCompartment:bo,focusHandlerCompartment:Ra,pasteHandlerCompartment:pc,timeoutRef:mc}}function useEditorCleanup(vo){useEffect(()=>()=>{vo.current&&(vo.current.destroy(),vo.current=null)},[])}function useHandlerReconfiguration(vo,Ai,bo,Ra,pc){useEffect(()=>{vo&&(vo.dispatch({effects:[pc.updateListener.reconfigure(makeUpdateHandler(Ai,bo,Ra)),pc.focusHandler.reconfigure(makeFocusHandler(Ai,bo,Ra)),pc.pasteHandler.reconfigure(makePasteHandler(Ai,bo,Ra))]}),forceLinting(vo))},[Ai,Ra])}function useDocumentSync(vo,Ai){useEffect(()=>{if(!vo)return;const bo=vo.state.doc.toString();bo!==Ai&&(vo.dispatch({changes:{from:0,to:bo.length,insert:Ai},annotations:[Transaction.userEvent.of("external")]}),forceLinting(vo))},[Ai])}const baseEditorExtensions=[lineNumbers(),highlightActiveLineGutter(),highlightSpecialChars(),history(),foldGutter(),drawSelection(),dropCursor(),EditorState.allowMultipleSelections.of(!0),indentOnInput(),syntaxHighlighting(defaultHighlightStyle,{fallback:!0}),bracketMatching(),closeBrackets(),autocompletion(),rectangularSelection(),crosshairCursor(),highlightActiveLine(),highlightSelectionMatches(),EditorView.lineWrapping],baseKeymap=[...closeBracketsKeymap,...defaultKeymap,...searchKeymap,...historyKeymap,...foldKeymap,...completionKeymap,...lintKeymap,indentWithTab],GraphqlEditor=memo(function vo(Ai){const{doc:bo,readonly:Ra=!1,updateDocumentInModel:pc,customLinter:mc}=Ai,{editorRef:uf,viewRef:df,updateListenerCompartment:ff,focusHandlerCompartment:hf,pasteHandlerCompartment:pf,timeoutRef:mf}=useEditorRefs(),gf=useRef(new Compartment),yf=useRef(new Compartment),vf=useSchemaContext();return useEffect(()=>{if(!df.current){const bf=buildSchema(vf);df.current=new EditorView({state:EditorState.create({doc:bo,extensions:[...baseEditorExtensions,keymap.of(baseKeymap),ayuLight,gf.current.of(graphql(bf)),yf.current.of(makeLinter(bf,mc)),ff.current.of(makeUpdateHandler(Ra,mf,pc)),hf.current.of(makeFocusHandler(Ra,mf,pc)),pf.current.of(makePasteHandler(Ra,mf,pc)),EditorState.readOnly.of(Ra)]}),parent:uf.current}),forceLinting(df.current)}},[]),useEditorCleanup(df),useEffect(()=>{const bf=df.current;if(!bf)return;const Sf=getSchema(bf.state),xf=Sf?printSchema(Sf):null;if(!Sf||xf!==vf)try{const wf=buildSchema(vf);bf.dispatch({effects:[gf.current.reconfigure(graphql(wf)),yf.current.reconfigure(makeLinter(wf,mc))]}),forceLinting(bf)}catch(wf){console.debug("in schema update",wf)}},[vf,mc]),useHandlerReconfiguration(df.current,Ra,mf,pc,{updateListener:ff.current,focusHandler:hf.current,pasteHandler:pf.current}),useDocumentSync(df.current,bo),jsx("div",{ref:uf})}),jsonHighlighting=styleTags({String:tags.string,Number:tags.number,"True False":tags.bool,PropertyName:tags.propertyName,Null:tags.null,", :":tags.separator,"[ ]":tags.squareBracket,"{ }":tags.brace}),parser=LRParser.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[jsonHighlighting],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),jsonParseLinter=()=>vo=>{try{JSON.parse(vo.state.doc.toString())}catch(Ai){if(!(Ai instanceof SyntaxError))throw Ai;const bo=getErrorPosition(Ai,vo.state.doc);return[{from:bo,message:Ai.message,severity:"error",to:bo}]}return[]};function getErrorPosition(vo,Ai){let bo;return(bo=vo.message.match(/at position (\d+)/))?Math.min(+bo[1],Ai.length):(bo=vo.message.match(/at line (\d+) column (\d+)/))?Math.min(Ai.line(+bo[1]).from+ +bo[2]-1,Ai.length):0}const jsonLanguage=LRLanguage.define({name:"json",parser:parser.configure({props:[indentNodeProp.add({Object:continuedIndent({except:/^\s*\}/}),Array:continuedIndent({except:/^\s*\]/})}),foldNodeProp.add({"Object Array":foldInside})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function json(){return new LanguageSupport(jsonLanguage)}const JSONEditor=memo(function vo(Ai){const{doc:bo,readonly:Ra=!1,updateDocumentInModel:pc}=Ai,{editorRef:mc,viewRef:uf,updateListenerCompartment:df,focusHandlerCompartment:ff,pasteHandlerCompartment:hf,timeoutRef:pf}=useEditorRefs();return useEffect(()=>{uf.current||(uf.current=new EditorView({state:EditorState.create({doc:bo,extensions:[...baseEditorExtensions,keymap.of(baseKeymap),ayuLight,jsonLanguage,json(),linter(jsonParseLinter()),df.current.of(makeUpdateHandler(Ra,pf,pc)),ff.current.of(makeFocusHandler(Ra,pf,pc)),hf.current.of(makePasteHandler(Ra,pf,pc)),EditorState.readOnly.of(Ra)]}),parent:mc.current}),forceLinting(uf.current))},[]),useEditorCleanup(uf),useHandlerReconfiguration(uf.current,Ra,pf,pc,{updateListener:df.current,focusHandler:ff.current,pasteHandler:hf.current}),useDocumentSync(uf.current,bo),jsx("div",{ref:mc})}),module={Component:P$4.lazyWithPreload(()=>Promise.resolve().then(()=>editor)),documentTypes:["powerhouse/document-model"],config:{id:"document-model-editor-v2",disableExternalControls:!0,documentToolbarEnabled:!0}};h$2.object({name:h$2.string(),documentType:h$2.string(),extension:h$2.string(),description:h$2.string(),authorName:h$2.string(),authorWebsite:h$2.string()});function ModelMetadata(vo){return jsxs("div",{children:[jsx(ModelNameForm,{...vo}),jsx("div",{className:"flex h-full flex-col gap-4",children:jsxs("div",{className:"grid flex-1 grid-cols-3 items-start gap-4",children:[jsxs("div",{className:"col-span-2 flex h-full flex-col gap-4",children:[jsx("div",{className:"shrink-0",children:jsx(DocumentTypeForm,{...vo})}),jsx("div",{className:"min-h-0 flex-1",children:jsx(DescriptionForm,{...vo})})]}),jsxs("div",{className:"col-span-1 flex flex-col gap-4",children:[jsx(AuthorNameForm,{...vo}),jsx(AuthorWebsiteForm,{...vo}),jsx(ModelExtensionForm,{...vo})]})]})})]})}function ModelNameForm(vo){const{name:Ai,globalStateSchema:bo,localStateSchema:Ra,setModelName:pc,setStateSchema:mc}=vo,uf=useCallback(df=>{if(Ai===df)return;if(pc(df),!bo){const hf=makeInitialSchemaDoc(df,"global");mc(hf,"global");return}const ff=renameSchemaType(bo,Ai,df,"global");if(mc(ff,"global"),Ra){const hf=renameSchemaType(Ra,Ai,df,"local");mc(hf,"local")}handleModelNameChange({oldName:Ai,newName:df,globalStateSchema:bo,localStateSchema:Ra,setStateSchema:mc})},[Ai,bo,Ra,mc]);return jsx(TextField,{name:"name",value:Ai,onSubmit:uf,placeholder:"Model name",className:"border-none pl-0 text-xl font-bold text-gray-900",required:!0,focusOnMount:!0})}function DocumentTypeForm(vo){const{documentType:Ai,setModelId:bo}=vo;return jsx(TextField,{label:"Document Type",name:"powerhouse/document-model",value:Ai,onSubmit:bo,placeholder:"Document Type",required:!0})}function ModelExtensionForm(vo){const{extension:Ai,setModelExtension:bo}=vo;return jsx(TextField,{name:"extension",value:Ai,onSubmit:bo,label:"Model Extension",placeholder:"Example .phdm",required:!0})}function DescriptionForm(vo){const{description:Ai,setModelDescription:bo}=vo;return jsx(TextField,{name:"description",label:"Model Description",value:Ai,onSubmit:bo,placeholder:"Describe your document to others",allowEmpty:!0,className:"h-full"})}function AuthorNameForm(vo){const{authorName:Ai,setAuthorName:bo}=vo;return jsx(TextField,{name:"authorName",value:Ai,onSubmit:bo,label:"Author Name",placeholder:"Username or organisation",allowEmpty:!0})}function AuthorWebsiteForm(vo){const{authorWebsite:Ai,setAuthorWebsite:bo}=vo;return jsx(TextField,{name:"authorWebsite",value:Ai,label:"Website URL",onSubmit:Ra=>{Ai&&!Ra||bo(Ra)},placeholder:"https://www.powerhouse.inc/",allowEmpty:!0})}function Divider({className:vo,size:Ai="sm",margin:bo="md"}){function Ra(){return Ai==="sm"?"h-px":Ai==="md"?"h-1":"h-1.5"}function pc(){return bo==="sm"?"my-4":bo==="md"?"my-6":"my-8"}const mc=Ra(),uf=pc();return jsx("div",{className:cn("bg-gray-200",mc,uf,vo)})}function OperationForm({operation:vo,module:Ai,focusOnMount:bo,allOperationNames:Ra,onAddOperationAndInitialSchema:pc,updateOperationName:mc,deleteOperation:uf}){const df=!!vo,ff=useCallback(async pf=>{if(df&&pf===""){uf(vo.id);return}const mf=toConstantCase(pf);df?mf!==vo.name&&mc(vo.id,mf):await pc(Ai.id,mf)},[df,vo==null?void 0:vo.id,vo==null?void 0:vo.name,Ai.id,uf,mc,pc]),hf=useCallback(pf=>{df&&pf===""&&uf(vo.id)},[df,vo==null?void 0:vo.id,uf]);return jsx(TextField,{name:"name",value:vo==null?void 0:vo.name,label:df?"Operation name":"Add operation",onSubmit:ff,onChange:hf,placeholder:"Add operation",required:!df,allowEmpty:!df,shouldReset:!df,focusOnMount:bo,unique:Ra})}function OperationDescriptionForm({operation:vo,focusOnMount:Ai,setOperationDescription:bo}){const Ra=useRef(null);return useEffect(()=>{Ai&&Ra.current&&Ra.current.focus()},[Ai]),jsx(TextField,{ref:Ra,name:"description",value:vo.description,onSubmit:pc=>bo(vo.id,pc),label:"Operation description",allowEmpty:!0,placeholder:"Operation Description"})}function OperationErrorForm({operation:vo,error:Ai,focusOnMount:bo,onSubmit:Ra,onAddOperationError:pc,deleteOperationError:mc,setOperationErrorName:uf}){const df=useRef(null),ff=!!Ai,hf=vo.errors.map(gf=>gf.name).filter(Boolean),pf=useCallback(gf=>{if(ff&&gf===""){mc(Ai.id);return}const yf=pascalCase(gf);ff?uf(vo.id,Ai.id,yf):pc(vo.id,yf),Ra==null||Ra()},[ff,Ai==null?void 0:Ai.id,vo.id,mc,uf,pc,Ra]),mf=useCallback(gf=>{ff&&gf===""&&mc(Ai.id)},[ff,Ai==null?void 0:Ai.id,mc]);return jsx(TextField,{ref:df,name:"name",value:Ai==null?void 0:Ai.name,onSubmit:pf,onChange:mf,placeholder:"Add exception",required:!ff,allowEmpty:!ff,shouldReset:!ff,unique:hf,focusOnMount:bo})}function OperationErrors({operation:vo,addOperationError:Ai,deleteOperationError:bo,setOperationErrorName:Ra}){const pc=useId(),[mc,uf]=useState(!1),df=useCallback(async(hf,pf)=>{const mf=await Ai(hf,pf);return mf&&uf(!0),mf},[Ai,uf]),ff=useCallback(()=>uf(!1),[uf]);return jsxs("ul",{className:"ml-4 list-disc",children:[vo.errors.map(hf=>jsx("li",{children:jsx(OperationErrorForm,{error:hf,operation:vo,onAddOperationError:df,deleteOperationError:bo,setOperationErrorName:Ra})},hf.id)),jsx("li",{children:jsx(OperationErrorForm,{operation:vo,onAddOperationError:df,deleteOperationError:bo,setOperationErrorName:Ra,focusOnMount:mc,onSubmit:ff},`${pc}-${mc}`)})]})}function ensureDocumentContainsNodeWithNameAndType(vo,Ai,bo){return!vo||!isDocumentString(vo)?!0:parse(vo).definitions.some(Ra=>{var pc;return Ra.kind===Kind[bo]&&"name"in Ra&&((pc=Ra.name)==null?void 0:pc.value)===Ai})}function createNodeTypeAndNameDiagnostic(vo,Ai){var bo,Ra,pc,mc;if(!vo||!isDocumentString(vo))return;const uf=parse(vo).definitions[0],df="name"in uf?uf.name:null;return{from:((bo=df==null?void 0:df.loc)==null?void 0:bo.start)??((Ra=uf.loc)==null?void 0:Ra.start)??0,to:((pc=df==null?void 0:df.loc)==null?void 0:pc.end)??((mc=uf.loc)==null?void 0:mc.end)??0,severity:"error",message:Ai}}function ensureValidStateSchemaName(vo,Ai,bo){if(!vo||!isDocumentString(vo))return[];const Ra=`${pascalCase(Ai)}${bo==="local"?"Local":""}State`;return ensureDocumentContainsNodeWithNameAndType(vo,Ra,"OBJECT_TYPE_DEFINITION")?[]:[createNodeTypeAndNameDiagnostic(vo,`${sentenceCase(bo)} state schema must be named ${Ra}`)].filter(Boolean)}function ensureValidOperationSchemaInputName(vo,Ai){if(!vo||!isDocumentString(vo))return[];const bo=`${pascalCase(Ai)}Input`;return ensureDocumentContainsNodeWithNameAndType(vo,bo,"INPUT_OBJECT_TYPE_DEFINITION")?[]:[createNodeTypeAndNameDiagnostic(vo,`Operation schema must contain an input type named ${bo}`)].filter(Boolean)}function Operation(vo){const{operation:Ai,module:bo,allOperationNames:Ra,lastCreatedOperationId:pc,onAddOperationAndInitialSchema:mc,updateOperationName:uf,deleteOperation:df,updateOperationSchema:ff,setOperationDescription:hf,addOperationError:pf,deleteOperationError:mf,setOperationErrorName:gf}=vo,yf=useCallback(bf=>ff(Ai.id,bf),[Ai.id,ff]),vf=useCallback(bf=>Ai.name?ensureValidOperationSchemaInputName(bf,Ai.name):[],[Ai.name]);return jsxs("div",{className:"mt-4 grid grid-cols-2 gap-x-12",style:{gridTemplateAreas:`
|
|
376
|
-
"left editor"
|
|
377
|
-
"errors editor"
|
|
378
|
-
`,gridTemplateRows:"auto 1fr"},children:[jsxs("div",{className:"flex flex-col gap-2",style:{gridArea:"left"},children:[jsx(OperationForm,{operation:Ai,onAddOperationAndInitialSchema:mc,updateOperationName:uf,deleteOperation:df,module:bo,allOperationNames:Ra}),jsx(OperationDescriptionForm,{operation:Ai,focusOnMount:Ai.id===pc,setOperationDescription:hf})]}),jsx("div",{className:"relative top-8",style:{gridArea:"editor"},children:jsx(GraphqlEditor,{doc:Ai.schema??"",updateDocumentInModel:yf,customLinter:vf})}),jsxs("div",{style:{gridArea:"errors"},children:[jsx("h3",{className:"my-2 text-sm font-medium text-gray-700",children:"Reducer Exceptions"}),jsx(OperationErrors,{operation:Ai,addOperationError:pf,deleteOperationError:mf,setOperationErrorName:gf})]})]})}function Operations({module:vo,allOperations:Ai,shouldFocusNewOperation:bo,updateOperationName:Ra,deleteOperation:pc,addOperationAndInitialSchema:mc,addOperationError:uf,deleteOperationError:df,setOperationErrorName:ff,updateOperationSchema:hf,setOperationDescription:pf}){const[mf,gf]=useState(null),yf=useId(),vf=Ai.map(Sf=>Sf.name).filter(Boolean),bf=useCallback(async(Sf,xf)=>{const wf=await mc(Sf,xf);return wf&&gf(wf),wf},[mc,gf]);return jsxs("div",{children:[vo.operations.map(Sf=>jsx("div",{children:jsx(Operation,{operation:Sf,module:vo,lastCreatedOperationId:mf,allOperationNames:vf,addOperationError:uf,deleteOperationError:df,setOperationErrorName:ff,onAddOperationAndInitialSchema:bf,updateOperationName:Ra,deleteOperation:pc,updateOperationSchema:hf,setOperationDescription:pf})},Sf.id)),jsx("div",{className:"mt-6 w-1/2 pr-6",children:jsx(OperationForm,{onAddOperationAndInitialSchema:bf,updateOperationName:Ra,deleteOperation:pc,module:vo,allOperationNames:vf,focusOnMount:bo},yf)})]})}function Module(vo){const{module:Ai,modules:bo,allOperations:Ra,lastCreatedModuleId:pc,onAddModule:mc,updateModuleName:uf,deleteModule:df,updateOperationName:ff,deleteOperation:hf,addOperationAndInitialSchema:pf,updateOperationSchema:mf,setOperationDescription:gf,addOperationError:yf,deleteOperationError:vf,setOperationErrorName:bf}=vo;return jsxs("div",{className:"relative rounded-3xl bg-gray-100 p-6",children:[jsxs("div",{className:"mb-2 w-1/2 pr-6",children:[jsx(ModuleForm,{modules:bo,module:Ai,onAddModule:mc,updateModuleName:uf}),!!Ai&&jsx("button",{"aria-label":"Delete module",tabIndex:-1,className:"absolute right-1 top-1 p-2 text-gray-800 transition-colors hover:text-gray-500",onClick:()=>{df(Ai.id)},children:jsx(_e$1,{name:"Xmark",size:32})})]}),!!Ai&&jsx(Operations,{module:Ai,allOperations:Ra,shouldFocusNewOperation:Ai.id===pc,updateOperationName:ff,deleteOperation:hf,addOperationAndInitialSchema:pf,updateOperationSchema:mf,setOperationDescription:gf,addOperationError:yf,deleteOperationError:vf,setOperationErrorName:bf})]})}function Modules({modules:vo,allOperations:Ai,addModule:bo,updateModuleName:Ra,deleteModule:pc,updateOperationName:mc,deleteOperation:uf,addOperationAndInitialSchema:df,updateOperationSchema:ff,setOperationDescription:hf,addOperationError:pf,deleteOperationError:mf,setOperationErrorName:gf}){const[yf,vf]=useState(null),bf=useRef(null),Sf=useCallback(async xf=>{var wf;const If=await bo(xf);return If&&(vf(If),(wf=bf.current)==null||wf.focus()),If},[bo,vf]);return jsxs("div",{className:"flex flex-col gap-2",children:[vo.map(xf=>jsx(Module,{module:xf,modules:vo,allOperations:Ai,lastCreatedModuleId:yf,onAddModule:Sf,updateModuleName:Ra,deleteModule:pc,updateOperationName:mc,deleteOperation:uf,addOperationAndInitialSchema:df,updateOperationSchema:ff,setOperationDescription:hf,addOperationError:pf,deleteOperationError:mf,setOperationErrorName:gf},xf.id)),jsx(Module,{modules:vo,allOperations:Ai,lastCreatedModuleId:yf,onAddModule:Sf,updateModuleName:Ra,deleteModule:pc,updateOperationName:mc,deleteOperation:uf,addOperationAndInitialSchema:df,updateOperationSchema:ff,setOperationDescription:hf,addOperationError:pf,deleteOperationError:mf,setOperationErrorName:gf},"add-module"),jsx("div",{ref:bf,tabIndex:0,className:"size-0 overflow-hidden","aria-hidden":"true"})]})}const Tabs=QC,TabsList=y$2.forwardRef(({className:vo,...Ai},bo)=>jsx(JC,{ref:bo,className:cn("flex items-center justify-center rounded-xl bg-slate-50 p-1 shadow-[inset_0px_0px_2px_rgba(255,255,255,0.50)]",vo),...Ai}));TabsList.displayName=JC.displayName;const TabsTrigger=y$2.forwardRef(({className:vo,...Ai},bo)=>jsx(eI,{ref:bo,className:cn("flex w-full items-center justify-center whitespace-nowrap rounded-lg p-1 text-sm text-gray-500 transition-all disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-gray-50 data-[state=active]:text-gray-800 data-[state=active]:shadow-[0px_16px_16px_-4px_rgba(0,0,0,0.10)]",vo),...Ai}));TabsTrigger.displayName=eI.displayName;const TabsContent=y$2.forwardRef(({className:vo,...Ai},bo)=>jsx(ia,{ref:bo,className:cn("",vo),...Ai}));TabsContent.displayName=ia.displayName;const Button=forwardRef((vo,Ai)=>{const{className:bo,...Ra}=vo;return jsx("button",{ref:Ai,...Ra,className:cn("h-10 whitespace-nowrap rounded-md border border-gray-200 bg-gray-50 px-4 py-2 text-sm font-medium text-gray-800 transition-colors hover:bg-gray-100 hover:text-gray-900 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",bo)})});function StateEditor({modelName:vo,stateSchema:Ai,initialValue:bo,setStateSchema:Ra,setInitialState:pc,scope:mc}){const uf=useSchemaContext(),[df,ff]=useState(!1),hf=useCallback(vf=>ensureValidStateSchemaName(vf,vo,mc),[vo,mc]),pf=useCallback(()=>{ff(vf=>!vf)},[]),mf=useCallback(vf=>Ra(vf,mc),[Ra,mc]),gf=useCallback(vf=>pc(vf,mc),[pc,mc]),yf=useCallback(()=>{const vf=makeMinimalObjectFromSDL(uf,Ai,bo?JSON.parse(bo):{});pc(vf,mc)},[uf,Ai,bo,pc,mc]);return jsxs("div",{className:"grid grid-cols-2 gap-4",children:[jsxs("div",{children:[jsxs("h3",{className:"mb-2 text-lg capitalize",children:[mc," state schema"]}),jsxs(Button,{onClick:pf,className:"mb-2 flex w-fit items-center gap-2",children:[df?"Hide":"Show"," standard library",jsx("svg",{className:cn("inline-block transition-transform",df?"rotate-180":"rotate-0"),xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{d:"M11.9883 6.01172C11.4363 6.01172 10.9883 6.45972 10.9883 7.01172V13.0117H6.98828L11.9883 18.0117L16.9883 13.0117H12.9883V7.01172C12.9883 6.45972 12.5403 6.01172 11.9883 6.01172Z",fill:"black"})})]}),df&&jsx(GraphqlEditor,{doc:typeDefsDoc,readonly:!0}),jsx(GraphqlEditor,{doc:Ai,updateDocumentInModel:mf,customLinter:hf})]}),jsxs("div",{children:[jsxs("div",{className:"flex flex-col items-end",children:[jsxs("h3",{className:"mb-2 text-right text-lg capitalize",children:[mc," state initial value"]}),jsxs(Button,{onClick:yf,className:"mb-2 flex w-fit items-center gap-2",children:["Sync with schema"," ",jsx("svg",{className:"inline-block",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsx("path",{d:"M8.00521 1.99219C6.63588 1.99219 5.32788 2.45152 4.27588 3.28419C3.98721 3.51219 3.94321 3.93285 4.17188 4.22151C4.40054 4.51018 4.82055 4.55418 5.10921 4.32552C5.92721 3.67819 6.93921 3.32552 8.00521 3.32552C10.5825 3.32552 12.6719 5.41485 12.6719 7.99218H11.3385L13.3385 10.6588L15.3385 7.99218H14.0052C14.0052 4.67818 11.3192 1.99219 8.00521 1.99219ZM2.67188 5.32552L0.671875 7.99218H2.00521C2.00521 11.3062 4.69121 13.9922 8.00521 13.9922C9.37521 13.9922 10.6825 13.5335 11.7345 12.7002C12.0232 12.4722 12.0672 12.0515 11.8385 11.7628C11.6099 11.4742 11.1899 11.4302 10.9012 11.6588C10.0825 12.3068 9.07188 12.6588 8.00521 12.6588C5.42788 12.6588 3.33854 10.5695 3.33854 7.99218H4.67188L2.67188 5.32552Z",fill:"#343839"})})]})]}),jsx(JSONEditor,{doc:bo,updateDocumentInModel:gf})]})]})}function StateSchemas({modelName:vo,globalStateSchema:Ai,localStateSchema:bo,globalStateInitialValue:Ra,localStateInitialValue:pc,setStateSchema:mc,setInitialState:uf}){const df=useCallback(()=>{const ff=makeInitialSchemaDoc(vo,"local");mc(ff,"local"),uf("","local")},[vo,mc,uf]);return jsxs(Tabs,{className:"pb-8",activationMode:"manual",defaultValue:"global",children:[jsx("div",{className:"my-6",children:jsxs(TabsList,{className:"mx-auto flex max-w-sm",children:[jsx(TabsTrigger,{value:"global",children:"Global"}),jsx(TabsTrigger,{value:"local",children:"Local"})]})}),jsx(TabsContent,{value:"global",tabIndex:-1,children:jsx(StateEditor,{modelName:vo,stateSchema:Ai,initialValue:Ra,setStateSchema:mc,setInitialState:uf,scope:"global"})}),jsx(TabsContent,{value:"local",tabIndex:-1,children:bo?jsx(StateEditor,{modelName:vo,stateSchema:bo,initialValue:pc,setStateSchema:mc,setInitialState:uf,scope:"local"}):jsxs("div",{className:"",children:[jsx("h3",{className:"mb-2 text-lg capitalize",children:"local state schema"}),jsx(Button,{onClick:df,children:"Add local state"})]})})]})}function Editor(vo){const{document:Ai,documentNodeName:bo,dispatch:Ra}=vo,{name:pc,id:mc,extension:uf,description:df,author:{name:ff,website:hf}}=useMemo(()=>Ai.state.global,[Ai.state.global]),{state:{global:{schema:pf,initialValue:mf},local:{schema:gf,initialValue:yf}},modules:vf}=useMemo(()=>Ai.state.global.specifications[0],[Ai.state.global.specifications[0]]),bf=useMemo(()=>vf.flatMap(O1=>O1.operations),[vf]),Sf=useRef(!pc&&!!bo&&bf.length===0);useEffect(()=>{!Sf.current||!bo||(Ra(actions.setModelName({name:bo})),initializeModelSchema({modelName:bo,setStateSchema:(O1,j1)=>{Ra(actions.setStateSchema({schema:O1,scope:j1}))}}),Sf.current=!1)},[bo]);const xf=useMemo(()=>bf.flatMap(O1=>O1.schema??[]).join(`
|
|
379
|
-
`),[bf]),wf=useCallback(O1=>{compareStringsWithoutWhitespace(O1,mc)||Ra(actions.setModelId({id:O1}))},[mc]),If=useCallback(O1=>{compareStringsWithoutWhitespace(O1,df)||Ra(actions.setModelDescription({description:O1}))},[df]),l1=useCallback(O1=>{compareStringsWithoutWhitespace(O1,uf)||Ra(actions.setModelExtension({extension:O1}))},[uf]),s1=useCallback(O1=>{compareStringsWithoutWhitespace(O1,pc)||Ra(actions.setModelName({name:O1}))},[pc]),c1=useCallback(O1=>{compareStringsWithoutWhitespace(O1,ff)||Ra(actions.setAuthorName({authorName:O1}))},[ff]),u1=useCallback(O1=>{compareStringsWithoutWhitespace(O1,hf??"")||Ra(actions.setAuthorWebsite({authorWebsite:O1}))},[hf]),T1=useCallback((O1,j1)=>{compareStringsWithoutWhitespace(O1,j1==="global"?pf:gf)||Ra(actions.setStateSchema({schema:O1,scope:j1}))},[pf,gf]),_1=useCallback((O1,j1)=>{compareStringsWithoutWhitespace(O1,j1==="global"?mf:yf)||Ra(actions.setInitialState({initialValue:O1,scope:j1}))},[mf,yf]),R1=useCallback(O1=>new Promise(j1=>{try{if(vf.some(G1=>compareStringsWithoutWhitespace(G1.name,O1))){j1(void 0);return}const L1=index.hashKey();Ra(actions.addModule({id:L1,name:O1})),j1(L1)}catch(L1){console.error("Failed to add module:",L1),j1(void 0)}}),[vf]),P1=useCallback((O1,j1)=>{vf.some(L1=>compareStringsWithoutWhitespace(L1.name,j1))||Ra(actions.setModuleName({id:O1,name:j1}))},[vf]),E1=useCallback(O1=>Ra(actions.deleteModule({id:O1})),[]),M1=useCallback((O1,j1)=>new Promise(L1=>{var G1;try{if((((G1=vf.find(z1=>z1.id===O1))==null?void 0:G1.operations.map(z1=>z1.name).filter(Boolean))??[]).some(z1=>compareStringsWithoutWhitespace(z1,j1))){L1(void 0);return}const Y1=index.hashKey();Ra(actions.addOperation({id:Y1,moduleId:O1,name:j1})),L1(Y1)}catch(Y1){console.error("Failed to add operation:",Y1),L1(void 0)}}),[vf]),m1=useCallback((O1,j1)=>{const L1=vf.find(G1=>G1.operations.some(Y1=>Y1.id===O1));((L1==null?void 0:L1.operations.map(G1=>G1.name).filter(Boolean))??[]).some(G1=>compareStringsWithoutWhitespace(G1,j1))||Ra(actions.setOperationName({id:O1,name:j1}))},[vf]),$1=useCallback((O1,j1)=>{const L1=bf.find(G1=>G1.id===O1);L1!=null&&L1.schema&&compareStringsWithoutWhitespace(j1,L1.schema)||Ra(actions.setOperationSchema({id:O1,schema:j1}))},[bf]),k1=useCallback((O1,j1)=>{var L1;const G1=((L1=bf.find(Y1=>Y1.id===O1))==null?void 0:L1.description)??"";compareStringsWithoutWhitespace(G1,j1)||Ra(actions.setOperationDescription({id:O1,description:j1}))},[bf]),F1=useCallback(O1=>Ra(actions.deleteOperation({id:O1})),[]),U1=useCallback((O1,j1)=>new Promise(L1=>{try{const G1=bf.find(z1=>z1.id===O1);if(((G1==null?void 0:G1.errors.map(z1=>z1.name).filter(Boolean))??[]).some(z1=>compareStringsWithoutWhitespace(z1,j1))){L1(void 0);return}const Y1=index.hashKey();Ra(actions.addOperationError({id:Y1,operationId:O1,errorName:j1})),L1(Y1)}catch(G1){console.error("Failed to add operation error:",G1),L1(void 0)}}),[bf]),B1=useCallback(O1=>Ra(actions.deleteOperationError({id:O1})),[]),W1=useCallback((O1,j1,L1)=>{const G1=bf.find(Y1=>Y1.id===O1);((G1==null?void 0:G1.errors.map(Y1=>Y1.name).filter(Boolean))??[]).some(Y1=>compareStringsWithoutWhitespace(Y1,L1))||Ra(actions.setOperationErrorName({id:j1,errorName:L1}))},[bf]),Z1=useCallback(async(O1,j1)=>{try{const L1=await M1(O1,j1);if(!L1)return;try{return $1(L1,makeOperationInitialDoc(j1)),L1}catch(G1){console.error("Failed to update operation schema:",G1);return}}catch(L1){console.error("Failed to add operation and schema:",L1);return}},[M1,$1]);return jsx("main",{className:"min-h-dvh bg-gray-50",children:jsx(SchemaContextProvider,{globalStateSchemaSdl:pf,localStateSchemaSdl:gf,operationSchemasSdl:xf,children:jsxs("div",{className:"mx-auto max-w-6xl px-4 pt-8",children:[jsx(ModelMetadata,{name:pc,documentType:mc,extension:uf,description:df,authorName:ff,authorWebsite:hf??"",globalStateSchema:pf,localStateSchema:gf,setModelId:wf,setModelDescription:If,setModelExtension:l1,setModelName:s1,setAuthorName:c1,setAuthorWebsite:u1,setStateSchema:T1}),jsx(Divider,{}),jsxs("div",{children:[jsx(StateSchemas,{modelName:pc,globalStateSchema:pf,globalStateInitialValue:mf,localStateSchema:gf,localStateInitialValue:yf,setStateSchema:T1,setInitialState:_1}),jsx(Divider,{}),jsx("h3",{className:"mb-6 text-lg",children:"Global Operations"}),jsx(Modules,{modules:vf,allOperations:bf,addModule:R1,updateModuleName:P1,deleteModule:E1,updateOperationName:m1,updateOperationSchema:$1,setOperationDescription:k1,deleteOperation:F1,addOperationError:U1,deleteOperationError:B1,setOperationErrorName:W1,addOperationAndInitialSchema:Z1})]})]})})})}const editor=Object.freeze(Object.defineProperty({__proto__:null,default:Editor},Symbol.toStringTag,{value:"Module"})),m$1={Component:P$4.lazyWithPreload(()=>__vitePreload(()=>import("./editor-60nGXV5G.js"),__vite__mapDeps([0,1,2,3,4]))),documentTypes:["*"],config:{id:"json-editor",disableExternalControls:!1}},p={Component:P$4.lazyWithPreload(()=>__vitePreload(()=>import("./editor-SnTX_0Eh.js"),__vite__mapDeps([5,2,1,3,4]))),documentTypes:["powerhouse/budget-statement"],config:{id:"budget-statement-editor",disableExternalControls:!1}},i={Component:P$4.lazyWithPreload(()=>__vitePreload(()=>import("./editor-tXMAhhZ0.js"),__vite__mapDeps([6,2,1,3,4]))),documentTypes:["makerdao/scope-framework"],config:{id:"scope-framework-editor",disableExternalControls:!1}},m={Component:P$4.lazyWithPreload(()=>__vitePreload(()=>import("./editor-Dz4kC13f.js"),__vite__mapDeps([7,2,1,3,4]))),documentTypes:["makerdao/rwa-portfolio"],config:{id:"rwa-editor",disableExternalControls:!0}},e={Component:I1,documentTypes:["powerhouse/chat-room"],config:{id:"chatroom-editor",disableExternalControls:!0,documentToolbarEnabled:!0,showSwitchboardLink:!0}},editors=Object.freeze(Object.defineProperty({__proto__:null,BudgetStatement:p,ChatRoomEditor:e,DocumentModel2:module,Json:m$1,RealWorldAssets:m,ScopeFramework:i},Symbol.toStringTag,{value:"Module"}));export{C1 as C,DocumentEditor as D,EditorToolbar as E,Md as M,Od as O,P$4 as P,ToolbarButton as T,YS as Y,EditorWorksheet as a,TextInput as b,TextInputVariant as c,editors as e,x1 as x};
|
|
380
|
-
//# sourceMappingURL=editors-BKkmhJH6.js.map
|